@gudhub/core 1.2.4-beta.11 → 1.2.4-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (()=>{var __webpack_modules__={9669:(module,__unused_webpack_exports,__webpack_require__)=>{eval("module.exports = __webpack_require__(1609);\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/index.js?")},5448:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\nvar settle = __webpack_require__(6026);\nvar cookies = __webpack_require__(4372);\nvar buildURL = __webpack_require__(5327);\nvar buildFullPath = __webpack_require__(4097);\nvar parseHeaders = __webpack_require__(4109);\nvar isURLSameOrigin = __webpack_require__(7985);\nvar createError = __webpack_require__(5061);\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/adapters/xhr.js?")},1609:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\nvar utils = __webpack_require__(4867);\nvar bind = __webpack_require__(1849);\nvar Axios = __webpack_require__(321);\nvar mergeConfig = __webpack_require__(7185);\nvar defaults = __webpack_require__(5655);\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = __webpack_require__(5263);\naxios.CancelToken = __webpack_require__(4972);\naxios.isCancel = __webpack_require__(6502);\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = __webpack_require__(8713);\n\n// Expose isAxiosError\naxios.isAxiosError = __webpack_require__(6268);\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports["default"] = axios;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/axios.js?')},5263:module=>{"use strict";eval("\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/cancel/Cancel.js?")},4972:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar Cancel = __webpack_require__(5263);\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/cancel/CancelToken.js?")},6502:module=>{"use strict";eval("\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/cancel/isCancel.js?")},321:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\nvar buildURL = __webpack_require__(5327);\nvar InterceptorManager = __webpack_require__(782);\nvar dispatchRequest = __webpack_require__(3572);\nvar mergeConfig = __webpack_require__(7185);\nvar validator = __webpack_require__(4875);\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/Axios.js?")},782:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/InterceptorManager.js?")},4097:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar isAbsoluteURL = __webpack_require__(1793);\nvar combineURLs = __webpack_require__(7303);\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/buildFullPath.js?")},5061:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar enhanceError = __webpack_require__(481);\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/createError.js?")},3572:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\nvar transformData = __webpack_require__(8527);\nvar isCancel = __webpack_require__(6502);\nvar defaults = __webpack_require__(5655);\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/dispatchRequest.js?")},481:module=>{"use strict";eval("\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/enhanceError.js?")},7185:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/mergeConfig.js?")},6026:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar createError = __webpack_require__(5061);\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/settle.js?")},8527:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\nvar defaults = __webpack_require__(5655);\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/transformData.js?")},5655:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\nvar normalizeHeaderName = __webpack_require__(6016);\nvar enhanceError = __webpack_require__(481);\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = __webpack_require__(5448);\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = __webpack_require__(5448);\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/defaults.js?")},1849:module=>{"use strict";eval("\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/bind.js?")},5327:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/buildURL.js?")},7303:module=>{"use strict";eval("\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/combineURLs.js?")},4372:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/cookies.js?")},1793:module=>{"use strict";eval('\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/isAbsoluteURL.js?')},6268:module=>{"use strict";eval("\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/isAxiosError.js?")},7985:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/isURLSameOrigin.js?")},6016:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/normalizeHeaderName.js?")},4109:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/parseHeaders.js?")},8713:module=>{"use strict";eval("\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/spread.js?")},4875:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar pkg = __webpack_require__(8593);\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/validator.js?")},4867:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar bind = __webpack_require__(1849);\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/utils.js?")},1924:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(210);\n\nvar callBind = __webpack_require__(5559);\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/call-bind/callBound.js?")},5559:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar bind = __webpack_require__(8612);\nvar GetIntrinsic = __webpack_require__(210);\nvar setFunctionLength = __webpack_require__(7771);\n\nvar $TypeError = __webpack_require__(4453);\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $defineProperty = __webpack_require__(4429);\nvar $max = GetIntrinsic('%Math.max%');\n\nmodule.exports = function callBind(originalFunction) {\n\tif (typeof originalFunction !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\tvar func = $reflectApply(bind, $call, arguments);\n\treturn setFunctionLength(\n\t\tfunc,\n\t\t1 + $max(0, originalFunction.length - (arguments.length - 1)),\n\t\ttrue\n\t);\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/call-bind/index.js?")},8729:(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.getDefaultOptions = getDefaultOptions;\nexports.setDefaultOptions = setDefaultOptions;\nvar defaultOptions = {};\nfunction getDefaultOptions() {\n return defaultOptions;\n}\nfunction setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/_lib/defaultOptions/index.js?')},8734:(module,exports)=>{"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = requiredArgs;\nfunction requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/_lib/requiredArgs/index.js?")},2084:(module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = toInteger;\nfunction toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n var number = Number(dirtyNumber);\n if (isNaN(number)) {\n return number;\n }\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/_lib/toInteger/index.js?')},5430:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4836)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = add;\nvar _typeof2 = _interopRequireDefault(__webpack_require__(8698));\nvar _index = _interopRequireDefault(__webpack_require__(7262));\nvar _index2 = _interopRequireDefault(__webpack_require__(6581));\nvar _index3 = _interopRequireDefault(__webpack_require__(1171));\nvar _index4 = _interopRequireDefault(__webpack_require__(8734));\nvar _index5 = _interopRequireDefault(__webpack_require__(2084));\n/**\n * @name add\n * @category Common Helpers\n * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @description\n * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n *\n * | Key | Description |\n * |----------------|------------------------------------|\n * | years | Amount of years to be added |\n * | months | Amount of months to be added |\n * | weeks | Amount of weeks to be added |\n * | days | Amount of days to be added |\n * | hours | Amount of hours to be added |\n * | minutes | Amount of minutes to be added |\n * | seconds | Amount of seconds to be added |\n *\n * All values default to 0\n *\n * @returns {Date} the new date with the seconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add the following duration to 1 September 2014, 10:19:50\n * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30,\n * })\n * //=> Thu Jun 15 2017 15:29:20\n */\nfunction add(dirtyDate, duration) {\n (0, _index4.default)(2, arguments);\n if (!duration || (0, _typeof2.default)(duration) !== \'object\') return new Date(NaN);\n var years = duration.years ? (0, _index5.default)(duration.years) : 0;\n var months = duration.months ? (0, _index5.default)(duration.months) : 0;\n var weeks = duration.weeks ? (0, _index5.default)(duration.weeks) : 0;\n var days = duration.days ? (0, _index5.default)(duration.days) : 0;\n var hours = duration.hours ? (0, _index5.default)(duration.hours) : 0;\n var minutes = duration.minutes ? (0, _index5.default)(duration.minutes) : 0;\n var seconds = duration.seconds ? (0, _index5.default)(duration.seconds) : 0;\n\n // Add years and months\n var date = (0, _index3.default)(dirtyDate);\n var dateWithMonths = months || years ? (0, _index2.default)(date, months + years * 12) : date;\n\n // Add weeks and days\n var dateWithDays = days || weeks ? (0, _index.default)(dateWithMonths, days + weeks * 7) : dateWithMonths;\n\n // Add days, hours, minutes and seconds\n var minutesToAdd = minutes + hours * 60;\n var secondsToAdd = seconds + minutesToAdd * 60;\n var msToAdd = secondsToAdd * 1000;\n var finalDate = new Date(dateWithDays.getTime() + msToAdd);\n return finalDate;\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/add/index.js?')},7262:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4836)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = addDays;\nvar _index = _interopRequireDefault(__webpack_require__(2084));\nvar _index2 = _interopRequireDefault(__webpack_require__(1171));\nvar _index3 = _interopRequireDefault(__webpack_require__(8734));\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} - the new date with the days added\n * @throws {TypeError} - 2 arguments required\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nfunction addDays(dirtyDate, dirtyAmount) {\n (0, _index3.default)(2, arguments);\n var date = (0, _index2.default)(dirtyDate);\n var amount = (0, _index.default)(dirtyAmount);\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n date.setDate(date.getDate() + amount);\n return date;\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/addDays/index.js?')},6581:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4836)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = addMonths;\nvar _index = _interopRequireDefault(__webpack_require__(2084));\nvar _index2 = _interopRequireDefault(__webpack_require__(1171));\nvar _index3 = _interopRequireDefault(__webpack_require__(8734));\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the months added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n */\nfunction addMonths(dirtyDate, dirtyAmount) {\n (0, _index3.default)(2, arguments);\n var date = (0, _index2.default)(dirtyDate);\n var amount = (0, _index.default)(dirtyAmount);\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n var dayOfMonth = date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we\'ll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n var endOfDesiredMonth = new Date(date.getTime());\n endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);\n var daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we\'re already at the end of the month, then this is the correct date\n // and we\'re done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won\'t\n // cause an overflow, so set the desired day-of-month. Note that we can\'t\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);\n return date;\n }\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/addMonths/index.js?')},5276:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4836)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = isSameWeek;\nvar _index = _interopRequireDefault(__webpack_require__(2466));\nvar _index2 = _interopRequireDefault(__webpack_require__(8734));\n/**\n * @name isSameWeek\n * @category Week Helpers\n * @summary Are the given dates in the same week (and month and year)?\n *\n * @description\n * Are the given dates in the same week (and month and year)?\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Boolean} the dates are in the same week (and month and year)\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // Are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))\n * //=> true\n *\n * @example\n * // If week starts with Monday,\n * // are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {\n * weekStartsOn: 1\n * })\n * //=> false\n *\n * @example\n * // Are 1 January 2014 and 1 January 2015 in the same week?\n * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1))\n * //=> false\n */\nfunction isSameWeek(dirtyDateLeft, dirtyDateRight, options) {\n (0, _index2.default)(2, arguments);\n var dateLeftStartOfWeek = (0, _index.default)(dirtyDateLeft, options);\n var dateRightStartOfWeek = (0, _index.default)(dirtyDateRight, options);\n return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime();\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/isSameWeek/index.js?')},8933:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4836)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = setDay;\nvar _index = _interopRequireDefault(__webpack_require__(7262));\nvar _index2 = _interopRequireDefault(__webpack_require__(1171));\nvar _index3 = _interopRequireDefault(__webpack_require__(2084));\nvar _index4 = _interopRequireDefault(__webpack_require__(8734));\nvar _index5 = __webpack_require__(8729);\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} day - the day of the week of the new date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the new date with the day of the week set\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nfunction setDay(dirtyDate, dirtyDay, options) {\n var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;\n (0, _index4.default)(2, arguments);\n var defaultOptions = (0, _index5.getDefaultOptions)();\n var weekStartsOn = (0, _index3.default)((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);\n\n // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError(\'weekStartsOn must be between 0 and 6 inclusively\');\n }\n var date = (0, _index2.default)(dirtyDate);\n var day = (0, _index3.default)(dirtyDay);\n var currentDay = date.getDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var delta = 7 - weekStartsOn;\n var diff = day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7;\n return (0, _index.default)(date, diff);\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/setDay/index.js?')},2466:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4836)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = startOfWeek;\nvar _index = _interopRequireDefault(__webpack_require__(1171));\nvar _index2 = _interopRequireDefault(__webpack_require__(2084));\nvar _index3 = _interopRequireDefault(__webpack_require__(8734));\nvar _index4 = __webpack_require__(8729);\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the start of a week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nfunction startOfWeek(dirtyDate, options) {\n var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;\n (0, _index3.default)(1, arguments);\n var defaultOptions = (0, _index4.getDefaultOptions)();\n var weekStartsOn = (0, _index2.default)((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);\n\n // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError(\'weekStartsOn must be between 0 and 6 inclusively\');\n }\n var date = (0, _index.default)(dirtyDate);\n var day = date.getDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setDate(date.getDate() - diff);\n date.setHours(0, 0, 0, 0);\n return date;\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/startOfWeek/index.js?')},1171:(module,exports,__webpack_require__)=>{"use strict";eval("\n\nvar _interopRequireDefault = (__webpack_require__(4836)[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = toDate;\nvar _typeof2 = _interopRequireDefault(__webpack_require__(8698));\nvar _index = _interopRequireDefault(__webpack_require__(8734));\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nfunction toDate(argument) {\n (0, _index.default)(1, arguments);\n var argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (argument instanceof Date || (0, _typeof2.default)(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\");\n // eslint-disable-next-line no-console\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/toDate/index.js?")},2296:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar $defineProperty = __webpack_require__(4429);\n\nvar $SyntaxError = __webpack_require__(3464);\nvar $TypeError = __webpack_require__(4453);\n\nvar gopd = __webpack_require__(7296);\n\n/** @type {import('.')} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor<unknown>} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/define-data-property/index.js?")},4429:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(210);\n\n/** @type {import('.')} */\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nmodule.exports = $defineProperty;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-define-property/index.js?")},3981:module=>{"use strict";eval("\n\n/** @type {import('./eval')} */\nmodule.exports = EvalError;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/eval.js?")},1648:module=>{"use strict";eval("\n\n/** @type {import('.')} */\nmodule.exports = Error;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/index.js?")},4726:module=>{"use strict";eval("\n\n/** @type {import('./range')} */\nmodule.exports = RangeError;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/range.js?")},6712:module=>{"use strict";eval("\n\n/** @type {import('./ref')} */\nmodule.exports = ReferenceError;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/ref.js?")},3464:module=>{"use strict";eval("\n\n/** @type {import('./syntax')} */\nmodule.exports = SyntaxError;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/syntax.js?")},4453:module=>{"use strict";eval("\n\n/** @type {import('./type')} */\nmodule.exports = TypeError;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/type.js?")},3915:module=>{"use strict";eval("\n\n/** @type {import('./uri')} */\nmodule.exports = URIError;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/uri.js?")},7648:module=>{"use strict";eval("\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/function-bind/implementation.js?")},8612:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar implementation = __webpack_require__(7648);\n\nmodule.exports = Function.prototype.bind || implementation;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/function-bind/index.js?")},210:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar undefined;\n\nvar $Error = __webpack_require__(1648);\nvar $EvalError = __webpack_require__(3981);\nvar $RangeError = __webpack_require__(4726);\nvar $ReferenceError = __webpack_require__(6712);\nvar $SyntaxError = __webpack_require__(3464);\nvar $TypeError = __webpack_require__(4453);\nvar $URIError = __webpack_require__(3915);\n\nvar $Function = Function;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = __webpack_require__(1405)();\nvar hasProto = __webpack_require__(8185)();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t__proto__: null,\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': $Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': $EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': $RangeError,\n\t'%ReferenceError%': $ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': $URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t__proto__: null,\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = __webpack_require__(8612);\nvar hasOwn = __webpack_require__(8824);\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/get-intrinsic/index.js?")},7296:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(210);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/gopd/index.js?")},1044:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar $defineProperty = __webpack_require__(4429);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\treturn !!$defineProperty;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!$defineProperty) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/has-property-descriptors/index.js?")},8185:module=>{"use strict";eval("\n\nvar test = {\n\t__proto__: null,\n\tfoo: {}\n};\n\nvar $Object = Object;\n\n/** @type {import('.')} */\nmodule.exports = function hasProto() {\n\t// @ts-expect-error: TS errors on an inherited property for some reason\n\treturn { __proto__: test }.foo === test.foo\n\t\t&& !(test instanceof $Object);\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/has-proto/index.js?")},1405:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = __webpack_require__(5419);\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/has-symbols/index.js?")},5419:module=>{"use strict";eval("\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/has-symbols/shams.js?")},8824:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = __webpack_require__(8612);\n\n/** @type {import('.')} */\nmodule.exports = bind.call(call, $hasOwn);\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/hasown/index.js?")},9832:(module,__unused_webpack_exports,__webpack_require__)=>{eval("/*! jsonpath 1.1.1 */\n\n(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=undefined;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=undefined;for(var o=0;o<r.length;o++)s(r[o]);return s})({\"./aesprim\":[function(require,module,exports){\n/*\n Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>\n Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>\n Copyright (C) 2013 Mathias Bynens <mathias@qiwi.be>\n Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>\n Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be>\n Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>\n Copyright (C) 2012 Kris Kowal <kris.kowal@cixar.com>\n Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>\n Copyright (C) 2012 Arpad Borsos <arpad.borsos@googlemail.com>\n Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*jslint bitwise:true plusplus:true */\n/*global esprima:true, define:true, exports:true, window: true,\nthrowErrorTolerant: true,\nthrowError: true, generateStatement: true, peek: true,\nparseAssignmentExpression: true, parseBlock: true, parseExpression: true,\nparseFunctionDeclaration: true, parseFunctionExpression: true,\nparseFunctionSourceElements: true, parseVariableIdentifier: true,\nparseLeftHandSideExpression: true,\nparseUnaryExpression: true,\nparseStatement: true, parseSourceElement: true */\n\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,\n // Rhino, and plain browser loading.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define(['exports'], factory);\n } else if (typeof exports !== 'undefined') {\n factory(exports);\n } else {\n factory((root.esprima = {}));\n }\n}(this, function (exports) {\n 'use strict';\n\n var Token,\n TokenName,\n FnExprTokens,\n Syntax,\n PropertyKind,\n Messages,\n Regex,\n SyntaxTreeDelegate,\n source,\n strict,\n index,\n lineNumber,\n lineStart,\n length,\n delegate,\n lookahead,\n state,\n extra;\n\n Token = {\n BooleanLiteral: 1,\n EOF: 2,\n Identifier: 3,\n Keyword: 4,\n NullLiteral: 5,\n NumericLiteral: 6,\n Punctuator: 7,\n StringLiteral: 8,\n RegularExpression: 9\n };\n\n TokenName = {};\n TokenName[Token.BooleanLiteral] = 'Boolean';\n TokenName[Token.EOF] = '<end>';\n TokenName[Token.Identifier] = 'Identifier';\n TokenName[Token.Keyword] = 'Keyword';\n TokenName[Token.NullLiteral] = 'Null';\n TokenName[Token.NumericLiteral] = 'Numeric';\n TokenName[Token.Punctuator] = 'Punctuator';\n TokenName[Token.StringLiteral] = 'String';\n TokenName[Token.RegularExpression] = 'RegularExpression';\n\n // A function following one of those tokens is an expression.\n FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',\n 'return', 'case', 'delete', 'throw', 'void',\n // assignment operators\n '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',\n '&=', '|=', '^=', ',',\n // binary/unary operators\n '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',\n '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',\n '<=', '<', '>', '!=', '!=='];\n\n Syntax = {\n AssignmentExpression: 'AssignmentExpression',\n ArrayExpression: 'ArrayExpression',\n BlockStatement: 'BlockStatement',\n BinaryExpression: 'BinaryExpression',\n BreakStatement: 'BreakStatement',\n CallExpression: 'CallExpression',\n CatchClause: 'CatchClause',\n ConditionalExpression: 'ConditionalExpression',\n ContinueStatement: 'ContinueStatement',\n DoWhileStatement: 'DoWhileStatement',\n DebuggerStatement: 'DebuggerStatement',\n EmptyStatement: 'EmptyStatement',\n ExpressionStatement: 'ExpressionStatement',\n ForStatement: 'ForStatement',\n ForInStatement: 'ForInStatement',\n FunctionDeclaration: 'FunctionDeclaration',\n FunctionExpression: 'FunctionExpression',\n Identifier: 'Identifier',\n IfStatement: 'IfStatement',\n Literal: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExpression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n NewExpression: 'NewExpression',\n ObjectExpression: 'ObjectExpression',\n Program: 'Program',\n Property: 'Property',\n ReturnStatement: 'ReturnStatement',\n SequenceExpression: 'SequenceExpression',\n SwitchStatement: 'SwitchStatement',\n SwitchCase: 'SwitchCase',\n ThisExpression: 'ThisExpression',\n ThrowStatement: 'ThrowStatement',\n TryStatement: 'TryStatement',\n UnaryExpression: 'UnaryExpression',\n UpdateExpression: 'UpdateExpression',\n VariableDeclaration: 'VariableDeclaration',\n VariableDeclarator: 'VariableDeclarator',\n WhileStatement: 'WhileStatement',\n WithStatement: 'WithStatement'\n };\n\n PropertyKind = {\n Data: 1,\n Get: 2,\n Set: 4\n };\n\n // Error messages should be identical to V8.\n Messages = {\n UnexpectedToken: 'Unexpected token %0',\n UnexpectedNumber: 'Unexpected number',\n UnexpectedString: 'Unexpected string',\n UnexpectedIdentifier: 'Unexpected identifier',\n UnexpectedReserved: 'Unexpected reserved word',\n UnexpectedEOS: 'Unexpected end of input',\n NewlineAfterThrow: 'Illegal newline after throw',\n InvalidRegExp: 'Invalid regular expression',\n UnterminatedRegExp: 'Invalid regular expression: missing /',\n InvalidLHSInAssignment: 'Invalid left-hand side in assignment',\n InvalidLHSInForIn: 'Invalid left-hand side in for-in',\n MultipleDefaultsInSwitch: 'More than one default clause in switch statement',\n NoCatchOrFinally: 'Missing catch or finally after try',\n UnknownLabel: 'Undefined label \\'%0\\'',\n Redeclaration: '%0 \\'%1\\' has already been declared',\n IllegalContinue: 'Illegal continue statement',\n IllegalBreak: 'Illegal break statement',\n IllegalReturn: 'Illegal return statement',\n StrictModeWith: 'Strict mode code may not include a with statement',\n StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',\n StrictVarName: 'Variable name may not be eval or arguments in strict mode',\n StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',\n StrictParamDupe: 'Strict mode function may not have duplicate parameter names',\n StrictFunctionName: 'Function name may not be eval or arguments in strict mode',\n StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',\n StrictDelete: 'Delete of an unqualified identifier in strict mode.',\n StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',\n AccessorDataProperty: 'Object literal may not have data and accessor property with the same name',\n AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',\n StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',\n StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',\n StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',\n StrictReservedWord: 'Use of future reserved word in strict mode'\n };\n\n // See also tools/generate-unicode-regex.py.\n Regex = {\n NonAsciiIdentifierStart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]'),\n NonAsciiIdentifierPart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0\\u08A2-\\u08AC\\u08E4-\\u08FE\\u0900-\\u0963\\u0966-\\u096F\\u0971-\\u0977\\u0979-\\u097F\\u0981-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C01-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C82\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D02\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1D00-\\u1DE6\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA697\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A\\uAA7B\\uAA80-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE26\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]')\n };\n\n // Ensure the condition is true, otherwise throw an error.\n // This is only to have a better contract semantic, i.e. another safety net\n // to catch a logic error. The condition shall be fulfilled in normal case.\n // Do NOT use this to enforce a certain condition on any user input.\n\n function assert(condition, message) {\n /* istanbul ignore if */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }\n\n function isDecimalDigit(ch) {\n return (ch >= 48 && ch <= 57); // 0..9\n }\n\n function isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n }\n\n function isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n }\n\n\n // 7.2 White Space\n\n function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }\n\n // 7.3 Line Terminators\n\n function isLineTerminator(ch) {\n return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);\n }\n\n // 7.6 Identifier Names and Identifiers\n\n function isIdentifierStart(ch) {\n return (ch == 0x40) || (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }\n\n function isIdentifierPart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch >= 0x30 && ch <= 0x39) || // 0..9\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n }\n\n // 7.6.1.2 Future Reserved Words\n\n function isFutureReservedWord(id) {\n switch (id) {\n case 'class':\n case 'enum':\n case 'export':\n case 'extends':\n case 'import':\n case 'super':\n return true;\n default:\n return false;\n }\n }\n\n function isStrictModeReservedWord(id) {\n switch (id) {\n case 'implements':\n case 'interface':\n case 'package':\n case 'private':\n case 'protected':\n case 'public':\n case 'static':\n case 'yield':\n case 'let':\n return true;\n default:\n return false;\n }\n }\n\n function isRestrictedWord(id) {\n return id === 'eval' || id === 'arguments';\n }\n\n // 7.6.1.1 Keywords\n\n function isKeyword(id) {\n if (strict && isStrictModeReservedWord(id)) {\n return true;\n }\n\n // 'const' is specialized as Keyword in V8.\n // 'yield' and 'let' are for compatiblity with SpiderMonkey and ES.next.\n // Some others are from future reserved words.\n\n switch (id.length) {\n case 2:\n return (id === 'if') || (id === 'in') || (id === 'do');\n case 3:\n return (id === 'var') || (id === 'for') || (id === 'new') ||\n (id === 'try') || (id === 'let');\n case 4:\n return (id === 'this') || (id === 'else') || (id === 'case') ||\n (id === 'void') || (id === 'with') || (id === 'enum');\n case 5:\n return (id === 'while') || (id === 'break') || (id === 'catch') ||\n (id === 'throw') || (id === 'const') || (id === 'yield') ||\n (id === 'class') || (id === 'super');\n case 6:\n return (id === 'return') || (id === 'typeof') || (id === 'delete') ||\n (id === 'switch') || (id === 'export') || (id === 'import');\n case 7:\n return (id === 'default') || (id === 'finally') || (id === 'extends');\n case 8:\n return (id === 'function') || (id === 'continue') || (id === 'debugger');\n case 10:\n return (id === 'instanceof');\n default:\n return false;\n }\n }\n\n // 7.4 Comments\n\n function addComment(type, value, start, end, loc) {\n var comment, attacher;\n\n assert(typeof start === 'number', 'Comment must have valid position');\n\n // Because the way the actual token is scanned, often the comments\n // (if any) are skipped twice during the lexical analysis.\n // Thus, we need to skip adding a comment if the comment array already\n // handled it.\n if (state.lastCommentStart >= start) {\n return;\n }\n state.lastCommentStart = start;\n\n comment = {\n type: type,\n value: value\n };\n if (extra.range) {\n comment.range = [start, end];\n }\n if (extra.loc) {\n comment.loc = loc;\n }\n extra.comments.push(comment);\n if (extra.attachComment) {\n extra.leadingComments.push(comment);\n extra.trailingComments.push(comment);\n }\n }\n\n function skipSingleLineComment(offset) {\n var start, loc, ch, comment;\n\n start = index - offset;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - offset\n }\n };\n\n while (index < length) {\n ch = source.charCodeAt(index);\n ++index;\n if (isLineTerminator(ch)) {\n if (extra.comments) {\n comment = source.slice(start + offset, index - 1);\n loc.end = {\n line: lineNumber,\n column: index - lineStart - 1\n };\n addComment('Line', comment, start, index - 1, loc);\n }\n if (ch === 13 && source.charCodeAt(index) === 10) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n return;\n }\n }\n\n if (extra.comments) {\n comment = source.slice(start + offset, index);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Line', comment, start, index, loc);\n }\n }\n\n function skipMultiLineComment() {\n var start, loc, ch, comment;\n\n if (extra.comments) {\n start = index - 2;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - 2\n }\n };\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (isLineTerminator(ch)) {\n if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n ++index;\n lineStart = index;\n if (index >= length) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else if (ch === 0x2A) {\n // Block comment ends with '*/'.\n if (source.charCodeAt(index + 1) === 0x2F) {\n ++index;\n ++index;\n if (extra.comments) {\n comment = source.slice(start + 2, index - 2);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Block', comment, start, index, loc);\n }\n return;\n }\n ++index;\n } else {\n ++index;\n }\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n function skipComment() {\n var ch, start;\n\n start = (index === 0);\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch)) {\n ++index;\n } else if (isLineTerminator(ch)) {\n ++index;\n if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n start = true;\n } else if (ch === 0x2F) { // U+002F is '/'\n ch = source.charCodeAt(index + 1);\n if (ch === 0x2F) {\n ++index;\n ++index;\n skipSingleLineComment(2);\n start = true;\n } else if (ch === 0x2A) { // U+002A is '*'\n ++index;\n ++index;\n skipMultiLineComment();\n } else {\n break;\n }\n } else if (start && ch === 0x2D) { // U+002D is '-'\n // U+003E is '>'\n if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {\n // '--\x3e' is a single-line comment\n index += 3;\n skipSingleLineComment(3);\n } else {\n break;\n }\n } else if (ch === 0x3C) { // U+003C is '<'\n if (source.slice(index + 1, index + 4) === '!--') {\n ++index; // `<`\n ++index; // `!`\n ++index; // `-`\n ++index; // `-`\n skipSingleLineComment(4);\n } else {\n break;\n }\n } else {\n break;\n }\n }\n }\n\n function scanHexEscape(prefix) {\n var i, len, ch, code = 0;\n\n len = (prefix === 'u') ? 4 : 2;\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n return '';\n }\n }\n return String.fromCharCode(code);\n }\n\n function getEscapedIdentifier() {\n var ch, id;\n\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (!isIdentifierPart(ch)) {\n break;\n }\n ++index;\n id += String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id += ch;\n }\n }\n\n return id;\n }\n\n function getIdentifier() {\n var start, ch;\n\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n }\n\n function scanIdentifier() {\n var start, id, type;\n\n start = index;\n\n // Backslash (U+005C) starts an escaped character.\n id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = Token.Identifier;\n } else if (isKeyword(id)) {\n type = Token.Keyword;\n } else if (id === 'null') {\n type = Token.NullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = Token.BooleanLiteral;\n } else {\n type = Token.Identifier;\n }\n\n return {\n type: type,\n value: id,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n\n // 7.7 Punctuators\n\n function scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n case 0x28: // ( open bracket\n case 0x29: // ) close bracket\n case 0x3B: // ; semicolon\n case 0x2C: // , comma\n case 0x7B: // { open curly brace\n case 0x7D: // } close curly brace\n case 0x5B: // [\n case 0x5D: // ]\n case 0x3A: // :\n case 0x3F: // ?\n case 0x7E: // ~\n ++index;\n if (extra.tokenize) {\n if (code === 0x28) {\n extra.openParenToken = extra.tokens.length;\n } else if (code === 0x7B) {\n extra.openCurlyToken = extra.tokens.length;\n }\n }\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (U+003D) marks an assignment or comparison operator.\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n case 0x2D: // -\n case 0x2F: // /\n case 0x3C: // <\n case 0x3E: // >\n case 0x5E: // ^\n case 0x7C: // |\n case 0x25: // %\n case 0x26: // &\n case 0x2A: // *\n index += 2;\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n case 0x21: // !\n case 0x3D: // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n return {\n type: Token.Punctuator,\n value: source.slice(start, index),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n }\n }\n\n // 4-character punctuator: >>>=\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: Token.Punctuator,\n value: ch4,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 3-character punctuators: === !== >>> <<= >>=\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: Token.Punctuator,\n value: ch3,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // Other 2-character punctuators: ++ -- << >> && ||\n ch2 = ch3.substr(0, 2);\n\n if ((ch1 === ch2[1] && ('+-<>&|'.indexOf(ch1) >= 0)) || ch2 === '=>') {\n index += 2;\n return {\n type: Token.Punctuator,\n value: ch2,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 1-character punctuators: < > = ! + - * % & | ^ /\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: Token.Punctuator,\n value: ch1,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n // 7.8.3 Numeric Literals\n\n function scanHexLiteral(start) {\n var number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt('0x' + number, 16),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function scanOctalLiteral(start) {\n var number = '0' + source[index++];\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function scanNumericLiteral() {\n var number, start, ch;\n\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),\n 'Numeric literal must start with a decimal digit or a decimal point');\n\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n }\n\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseFloat(number),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 7.8.4 String Literals\n\n function scanStringLiteral() {\n var str = '', quote, start, ch, code, unescaped, restore, octal = false, startLineNumber, startLineStart;\n startLineNumber = lineNumber;\n startLineStart = lineStart;\n\n quote = source[index];\n assert((quote === '\\'' || quote === '\"'),\n 'String literal must starts with a quote');\n\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n str += unescaped;\n } else {\n index = restore;\n str += ch;\n }\n break;\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch);\n\n // \\0 is not octal escape sequence\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]);\n\n // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n if ('0123'.indexOf(ch) >= 0 &&\n index < length &&\n isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.StringLiteral,\n value: str,\n octal: octal,\n startLineNumber: startLineNumber,\n startLineStart: startLineStart,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function testRegExp(pattern, flags) {\n var value;\n try {\n value = new RegExp(pattern, flags);\n } catch (e) {\n throwError({}, Messages.InvalidRegExp);\n }\n return value;\n }\n\n function scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n\n classMarker = false;\n terminated = false;\n while (index < length) {\n ch = source[index++];\n str += ch;\n if (ch === '\\\\') {\n ch = source[index++];\n // ECMA-262 7.8.5\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n\n // Exclude leading and trailing slash.\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n }\n\n function scanRegExpFlags() {\n var ch, str, flags, restore;\n\n str = '';\n flags = '';\n while (index < length) {\n ch = source[index];\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n if (ch === '\\\\' && index < length) {\n ch = source[index];\n if (ch === 'u') {\n ++index;\n restore = index;\n ch = scanHexEscape('u');\n if (ch) {\n flags += ch;\n for (str += '\\\\u'; restore < index; ++restore) {\n str += source[restore];\n }\n } else {\n index = restore;\n flags += 'u';\n str += '\\\\u';\n }\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n } else {\n str += '\\\\';\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n return {\n value: flags,\n literal: str\n };\n }\n\n function scanRegExp() {\n var start, body, flags, pattern, value;\n\n lookahead = null;\n skipComment();\n start = index;\n\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n\n if (extra.tokenize) {\n return {\n type: Token.RegularExpression,\n value: value,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n return {\n literal: body.literal + flags.literal,\n value: value,\n start: start,\n end: index\n };\n }\n\n function collectRegex() {\n var pos, loc, regex, token;\n\n skipComment();\n\n pos = index;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n regex = scanRegExp();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n /* istanbul ignore next */\n if (!extra.tokenize) {\n // Pop the previous token, which is likely '/' or '/='\n if (extra.tokens.length > 0) {\n token = extra.tokens[extra.tokens.length - 1];\n if (token.range[0] === pos && token.type === 'Punctuator') {\n if (token.value === '/' || token.value === '/=') {\n extra.tokens.pop();\n }\n }\n }\n\n extra.tokens.push({\n type: 'RegularExpression',\n value: regex.literal,\n range: [pos, index],\n loc: loc\n });\n }\n\n return regex;\n }\n\n function isIdentifierName(token) {\n return token.type === Token.Identifier ||\n token.type === Token.Keyword ||\n token.type === Token.BooleanLiteral ||\n token.type === Token.NullLiteral;\n }\n\n function advanceSlash() {\n var prevToken,\n checkToken;\n // Using the following algorithm:\n // https://github.com/mozilla/sweet.js/wiki/design\n prevToken = extra.tokens[extra.tokens.length - 1];\n if (!prevToken) {\n // Nothing before that: it cannot be a division.\n return collectRegex();\n }\n if (prevToken.type === 'Punctuator') {\n if (prevToken.value === ']') {\n return scanPunctuator();\n }\n if (prevToken.value === ')') {\n checkToken = extra.tokens[extra.openParenToken - 1];\n if (checkToken &&\n checkToken.type === 'Keyword' &&\n (checkToken.value === 'if' ||\n checkToken.value === 'while' ||\n checkToken.value === 'for' ||\n checkToken.value === 'with')) {\n return collectRegex();\n }\n return scanPunctuator();\n }\n if (prevToken.value === '}') {\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n if (extra.tokens[extra.openCurlyToken - 3] &&\n extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {\n // Anonymous function.\n checkToken = extra.tokens[extra.openCurlyToken - 4];\n if (!checkToken) {\n return scanPunctuator();\n }\n } else if (extra.tokens[extra.openCurlyToken - 4] &&\n extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {\n // Named function.\n checkToken = extra.tokens[extra.openCurlyToken - 5];\n if (!checkToken) {\n return collectRegex();\n }\n } else {\n return scanPunctuator();\n }\n // checkToken determines whether the function is\n // a declaration or an expression.\n if (FnExprTokens.indexOf(checkToken.value) >= 0) {\n // It is an expression.\n return scanPunctuator();\n }\n // It is a declaration.\n return collectRegex();\n }\n return collectRegex();\n }\n if (prevToken.type === 'Keyword') {\n return collectRegex();\n }\n return scanPunctuator();\n }\n\n function advance() {\n var ch;\n\n skipComment();\n\n if (index >= length) {\n return {\n type: Token.EOF,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: index,\n end: index\n };\n }\n\n ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Very common: ( and ) and ;\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (U+0027) or double quote (U+0022).\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n }\n\n\n // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n // Slash (/) U+002F can also start a regex.\n if (extra.tokenize && ch === 0x2F) {\n return advanceSlash();\n }\n\n return scanPunctuator();\n }\n\n function collectToken() {\n var loc, token, range, value;\n\n skipComment();\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n token = advance();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n if (token.type !== Token.EOF) {\n value = source.slice(token.start, token.end);\n extra.tokens.push({\n type: TokenName[token.type],\n value: value,\n range: [token.start, token.end],\n loc: loc\n });\n }\n\n return token;\n }\n\n function lex() {\n var token;\n\n token = lookahead;\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n return token;\n }\n\n function peek() {\n var pos, line, start;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n index = pos;\n lineNumber = line;\n lineStart = start;\n }\n\n function Position(line, column) {\n this.line = line;\n this.column = column;\n }\n\n function SourceLocation(startLine, startColumn, line, column) {\n this.start = new Position(startLine, startColumn);\n this.end = new Position(line, column);\n }\n\n SyntaxTreeDelegate = {\n\n name: 'SyntaxTree',\n\n processComment: function (node) {\n var lastChild, trailingComments;\n\n if (node.type === Syntax.Program) {\n if (node.body.length > 0) {\n return;\n }\n }\n\n if (extra.trailingComments.length > 0) {\n if (extra.trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.trailingComments;\n extra.trailingComments = [];\n } else {\n extra.trailingComments.length = 0;\n }\n } else {\n if (extra.bottomRightStack.length > 0 &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n delete extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n }\n }\n\n // Eating the stack.\n while (extra.bottomRightStack.length > 0 && extra.bottomRightStack[extra.bottomRightStack.length - 1].range[0] >= node.range[0]) {\n lastChild = extra.bottomRightStack.pop();\n }\n\n if (lastChild) {\n if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = lastChild.leadingComments;\n delete lastChild.leadingComments;\n }\n } else if (extra.leadingComments.length > 0 && extra.leadingComments[extra.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = extra.leadingComments;\n extra.leadingComments = [];\n }\n\n\n if (trailingComments) {\n node.trailingComments = trailingComments;\n }\n\n extra.bottomRightStack.push(node);\n },\n\n markEnd: function (node, startToken) {\n if (extra.range) {\n node.range = [startToken.start, index];\n }\n if (extra.loc) {\n node.loc = new SourceLocation(\n startToken.startLineNumber === undefined ? startToken.lineNumber : startToken.startLineNumber,\n startToken.start - (startToken.startLineStart === undefined ? startToken.lineStart : startToken.startLineStart),\n lineNumber,\n index - lineStart\n );\n this.postProcess(node);\n }\n\n if (extra.attachComment) {\n this.processComment(node);\n }\n return node;\n },\n\n postProcess: function (node) {\n if (extra.source) {\n node.loc.source = extra.source;\n }\n return node;\n },\n\n createArrayExpression: function (elements) {\n return {\n type: Syntax.ArrayExpression,\n elements: elements\n };\n },\n\n createAssignmentExpression: function (operator, left, right) {\n return {\n type: Syntax.AssignmentExpression,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBinaryExpression: function (operator, left, right) {\n var type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression :\n Syntax.BinaryExpression;\n return {\n type: type,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBlockStatement: function (body) {\n return {\n type: Syntax.BlockStatement,\n body: body\n };\n },\n\n createBreakStatement: function (label) {\n return {\n type: Syntax.BreakStatement,\n label: label\n };\n },\n\n createCallExpression: function (callee, args) {\n return {\n type: Syntax.CallExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createCatchClause: function (param, body) {\n return {\n type: Syntax.CatchClause,\n param: param,\n body: body\n };\n },\n\n createConditionalExpression: function (test, consequent, alternate) {\n return {\n type: Syntax.ConditionalExpression,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createContinueStatement: function (label) {\n return {\n type: Syntax.ContinueStatement,\n label: label\n };\n },\n\n createDebuggerStatement: function () {\n return {\n type: Syntax.DebuggerStatement\n };\n },\n\n createDoWhileStatement: function (body, test) {\n return {\n type: Syntax.DoWhileStatement,\n body: body,\n test: test\n };\n },\n\n createEmptyStatement: function () {\n return {\n type: Syntax.EmptyStatement\n };\n },\n\n createExpressionStatement: function (expression) {\n return {\n type: Syntax.ExpressionStatement,\n expression: expression\n };\n },\n\n createForStatement: function (init, test, update, body) {\n return {\n type: Syntax.ForStatement,\n init: init,\n test: test,\n update: update,\n body: body\n };\n },\n\n createForInStatement: function (left, right, body) {\n return {\n type: Syntax.ForInStatement,\n left: left,\n right: right,\n body: body,\n each: false\n };\n },\n\n createFunctionDeclaration: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionDeclaration,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createFunctionExpression: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionExpression,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createIdentifier: function (name) {\n return {\n type: Syntax.Identifier,\n name: name\n };\n },\n\n createIfStatement: function (test, consequent, alternate) {\n return {\n type: Syntax.IfStatement,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createLabeledStatement: function (label, body) {\n return {\n type: Syntax.LabeledStatement,\n label: label,\n body: body\n };\n },\n\n createLiteral: function (token) {\n return {\n type: Syntax.Literal,\n value: token.value,\n raw: source.slice(token.start, token.end)\n };\n },\n\n createMemberExpression: function (accessor, object, property) {\n return {\n type: Syntax.MemberExpression,\n computed: accessor === '[',\n object: object,\n property: property\n };\n },\n\n createNewExpression: function (callee, args) {\n return {\n type: Syntax.NewExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createObjectExpression: function (properties) {\n return {\n type: Syntax.ObjectExpression,\n properties: properties\n };\n },\n\n createPostfixExpression: function (operator, argument) {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: false\n };\n },\n\n createProgram: function (body) {\n return {\n type: Syntax.Program,\n body: body\n };\n },\n\n createProperty: function (kind, key, value) {\n return {\n type: Syntax.Property,\n key: key,\n value: value,\n kind: kind\n };\n },\n\n createReturnStatement: function (argument) {\n return {\n type: Syntax.ReturnStatement,\n argument: argument\n };\n },\n\n createSequenceExpression: function (expressions) {\n return {\n type: Syntax.SequenceExpression,\n expressions: expressions\n };\n },\n\n createSwitchCase: function (test, consequent) {\n return {\n type: Syntax.SwitchCase,\n test: test,\n consequent: consequent\n };\n },\n\n createSwitchStatement: function (discriminant, cases) {\n return {\n type: Syntax.SwitchStatement,\n discriminant: discriminant,\n cases: cases\n };\n },\n\n createThisExpression: function () {\n return {\n type: Syntax.ThisExpression\n };\n },\n\n createThrowStatement: function (argument) {\n return {\n type: Syntax.ThrowStatement,\n argument: argument\n };\n },\n\n createTryStatement: function (block, guardedHandlers, handlers, finalizer) {\n return {\n type: Syntax.TryStatement,\n block: block,\n guardedHandlers: guardedHandlers,\n handlers: handlers,\n finalizer: finalizer\n };\n },\n\n createUnaryExpression: function (operator, argument) {\n if (operator === '++' || operator === '--') {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n }\n return {\n type: Syntax.UnaryExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n },\n\n createVariableDeclaration: function (declarations, kind) {\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n },\n\n createVariableDeclarator: function (id, init) {\n return {\n type: Syntax.VariableDeclarator,\n id: id,\n init: init\n };\n },\n\n createWhileStatement: function (test, body) {\n return {\n type: Syntax.WhileStatement,\n test: test,\n body: body\n };\n },\n\n createWithStatement: function (object, body) {\n return {\n type: Syntax.WithStatement,\n object: object,\n body: body\n };\n }\n };\n\n // Return true if there is a line terminator before the next token.\n\n function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }\n\n // Throw an exception\n\n function throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(\n /%(\\d)/g,\n function (whole, index) {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n }\n );\n\n if (typeof token.lineNumber === 'number') {\n error = new Error('Line ' + token.lineNumber + ': ' + msg);\n error.index = token.start;\n error.lineNumber = token.lineNumber;\n error.column = token.start - lineStart + 1;\n } else {\n error = new Error('Line ' + lineNumber + ': ' + msg);\n error.index = index;\n error.lineNumber = lineNumber;\n error.column = index - lineStart + 1;\n }\n\n error.description = msg;\n throw error;\n }\n\n function throwErrorTolerant() {\n try {\n throwError.apply(null, arguments);\n } catch (e) {\n if (extra.errors) {\n extra.errors.push(e);\n } else {\n throw e;\n }\n }\n }\n\n\n // Throw an exception because of the token.\n\n function throwUnexpected(token) {\n if (token.type === Token.EOF) {\n throwError(token, Messages.UnexpectedEOS);\n }\n\n if (token.type === Token.NumericLiteral) {\n throwError(token, Messages.UnexpectedNumber);\n }\n\n if (token.type === Token.StringLiteral) {\n throwError(token, Messages.UnexpectedString);\n }\n\n if (token.type === Token.Identifier) {\n throwError(token, Messages.UnexpectedIdentifier);\n }\n\n if (token.type === Token.Keyword) {\n if (isFutureReservedWord(token.value)) {\n throwError(token, Messages.UnexpectedReserved);\n } else if (strict && isStrictModeReservedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictReservedWord);\n return;\n }\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // BooleanLiteral, NullLiteral, or Punctuator.\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // Expect the next token to match the specified punctuator.\n // If not, an exception will be thrown.\n\n function expect(value) {\n var token = lex();\n if (token.type !== Token.Punctuator || token.value !== value) {\n throwUnexpected(token);\n }\n }\n\n // Expect the next token to match the specified keyword.\n // If not, an exception will be thrown.\n\n function expectKeyword(keyword) {\n var token = lex();\n if (token.type !== Token.Keyword || token.value !== keyword) {\n throwUnexpected(token);\n }\n }\n\n // Return true if the next token matches the specified punctuator.\n\n function match(value) {\n return lookahead.type === Token.Punctuator && lookahead.value === value;\n }\n\n // Return true if the next token matches the specified keyword\n\n function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }\n\n // Return true if the next token is an assignment operator\n\n function matchAssign() {\n var op;\n\n if (lookahead.type !== Token.Punctuator) {\n return false;\n }\n op = lookahead.value;\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }\n\n function consumeSemicolon() {\n var line;\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B || match(';')) {\n lex();\n return;\n }\n\n line = lineNumber;\n skipComment();\n if (lineNumber !== line) {\n return;\n }\n\n if (lookahead.type !== Token.EOF && !match('}')) {\n throwUnexpected(lookahead);\n }\n }\n\n // Return true if provided expression is LeftHandSideExpression\n\n function isLeftHandSide(expr) {\n return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression;\n }\n\n // 11.1.4 Array Initialiser\n\n function parseArrayInitialiser() {\n var elements = [], startToken;\n\n startToken = lookahead;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseAssignmentExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n\n return delegate.markEnd(delegate.createArrayExpression(elements), startToken);\n }\n\n // 11.1.5 Object Initialiser\n\n function parsePropertyFunction(param, first) {\n var previousStrict, body, startToken;\n\n previousStrict = strict;\n startToken = lookahead;\n body = parseFunctionSourceElements();\n if (first && strict && isRestrictedWord(param[0].name)) {\n throwErrorTolerant(first, Messages.StrictParamName);\n }\n strict = previousStrict;\n return delegate.markEnd(delegate.createFunctionExpression(null, param, [], body), startToken);\n }\n\n function parseObjectPropertyKey() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {\n if (strict && token.octal) {\n throwErrorTolerant(token, Messages.StrictOctalLiteral);\n }\n return delegate.markEnd(delegate.createLiteral(token), startToken);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseObjectProperty() {\n var token, key, id, value, param, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n if (token.type === Token.Identifier) {\n\n id = parseObjectPropertyKey();\n\n // Property Assignment: Getter and Setter.\n\n if (token.value === 'get' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n expect(')');\n value = parsePropertyFunction([]);\n return delegate.markEnd(delegate.createProperty('get', key, value), startToken);\n }\n if (token.value === 'set' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n token = lookahead;\n if (token.type !== Token.Identifier) {\n expect(')');\n throwErrorTolerant(token, Messages.UnexpectedToken, token.value);\n value = parsePropertyFunction([]);\n } else {\n param = [ parseVariableIdentifier() ];\n expect(')');\n value = parsePropertyFunction(param, token);\n }\n return delegate.markEnd(delegate.createProperty('set', key, value), startToken);\n }\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', id, value), startToken);\n }\n if (token.type === Token.EOF || token.type === Token.Punctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', key, value), startToken);\n }\n }\n\n function parseObjectInitialiser() {\n var properties = [], property, name, key, kind, map = {}, toString = String, startToken;\n\n startToken = lookahead;\n\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === Syntax.Identifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set;\n\n key = '$' + name;\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n if (map[key] === PropertyKind.Data) {\n if (strict && kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.StrictDuplicateProperty);\n } else if (kind !== PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n }\n } else {\n if (kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n } else if (map[key] & kind) {\n throwErrorTolerant({}, Messages.AccessorGetSet);\n }\n }\n map[key] |= kind;\n } else {\n map[key] = kind;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n\n return delegate.markEnd(delegate.createObjectExpression(properties), startToken);\n }\n\n // 11.1.6 The Grouping Operator\n\n function parseGroupExpression() {\n var expr;\n\n expect('(');\n\n expr = parseExpression();\n\n expect(')');\n\n return expr;\n }\n\n\n // 11.1 Primary Expressions\n\n function parsePrimaryExpression() {\n var type, token, expr, startToken;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n startToken = lookahead;\n\n if (type === Token.Identifier) {\n expr = delegate.createIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n if (strict && lookahead.octal) {\n throwErrorTolerant(lookahead, Messages.StrictOctalLiteral);\n }\n expr = delegate.createLiteral(lex());\n } else if (type === Token.Keyword) {\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n expr = delegate.createThisExpression();\n } else {\n throwUnexpected(lex());\n }\n } else if (type === Token.BooleanLiteral) {\n token = lex();\n token.value = (token.value === 'true');\n expr = delegate.createLiteral(token);\n } else if (type === Token.NullLiteral) {\n token = lex();\n token.value = null;\n expr = delegate.createLiteral(token);\n } else if (match('/') || match('/=')) {\n if (typeof extra.tokens !== 'undefined') {\n expr = delegate.createLiteral(collectRegex());\n } else {\n expr = delegate.createLiteral(scanRegExp());\n }\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return delegate.markEnd(expr, startToken);\n }\n\n // 11.2 Left-Hand-Side Expressions\n\n function parseArguments() {\n var args = [];\n\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseAssignmentExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return args;\n }\n\n function parseNonComputedProperty() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseNonComputedMember() {\n expect('.');\n\n return parseNonComputedProperty();\n }\n\n function parseComputedMember() {\n var expr;\n\n expect('[');\n\n expr = parseExpression();\n\n expect(']');\n\n return expr;\n }\n\n function parseNewExpression() {\n var callee, args, startToken;\n\n startToken = lookahead;\n expectKeyword('new');\n callee = parseLeftHandSideExpression();\n args = match('(') ? parseArguments() : [];\n\n return delegate.markEnd(delegate.createNewExpression(callee, args), startToken);\n }\n\n function parseLeftHandSideExpressionAllowCall() {\n var previousAllowIn, expr, args, property, startToken;\n\n startToken = lookahead;\n\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n state.allowIn = previousAllowIn;\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = delegate.createCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n break;\n }\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n function parseLeftHandSideExpression() {\n var previousAllowIn, expr, property, startToken;\n\n startToken = lookahead;\n\n previousAllowIn = state.allowIn;\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n state.allowIn = previousAllowIn;\n\n while (match('.') || match('[')) {\n if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n }\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 11.3 Postfix Expressions\n\n function parsePostfixExpression() {\n var expr, token, startToken = lookahead;\n\n expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === Token.Punctuator) {\n if ((match('++') || match('--')) && !peekLineTerminator()) {\n // 11.3.1, 11.3.2\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPostfix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n token = lex();\n expr = delegate.markEnd(delegate.createPostfixExpression(token.value, expr), startToken);\n }\n }\n\n return expr;\n }\n\n // 11.4 Unary Operators\n\n function parseUnaryExpression() {\n var token, expr, startToken;\n\n if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n // 11.4.4, 11.4.5\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPrefix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {\n throwErrorTolerant({}, Messages.StrictDelete);\n }\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n }\n\n function binaryPrecedence(token, allowIn) {\n var prec = 0;\n\n if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n prec = 7;\n break;\n\n case 'in':\n prec = allowIn ? 7 : 0;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n\n default:\n break;\n }\n\n return prec;\n }\n\n // 11.5 Multiplicative Operators\n // 11.6 Additive Operators\n // 11.7 Bitwise Shift Operators\n // 11.8 Relational Operators\n // 11.9 Equality Operators\n // 11.10 Binary Bitwise Operators\n // 11.11 Binary Logical Operators\n\n function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers[markers.length - 1];\n delegate.markEnd(expr, marker);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n delegate.markEnd(expr, marker);\n }\n\n return expr;\n }\n\n\n // 11.12 Conditional Operator\n\n function parseConditionalExpression() {\n var expr, previousAllowIn, consequent, alternate, startToken;\n\n startToken = lookahead;\n\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n consequent = parseAssignmentExpression();\n state.allowIn = previousAllowIn;\n expect(':');\n alternate = parseAssignmentExpression();\n\n expr = delegate.createConditionalExpression(expr, consequent, alternate);\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 11.13 Assignment Operators\n\n function parseAssignmentExpression() {\n var token, left, right, node, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n node = left = parseConditionalExpression();\n\n if (matchAssign()) {\n // LeftHandSideExpression\n if (!isLeftHandSide(left)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n // 11.13.1\n if (strict && left.type === Syntax.Identifier && isRestrictedWord(left.name)) {\n throwErrorTolerant(token, Messages.StrictLHSAssignment);\n }\n\n token = lex();\n right = parseAssignmentExpression();\n node = delegate.markEnd(delegate.createAssignmentExpression(token.value, left, right), startToken);\n }\n\n return node;\n }\n\n // 11.14 Comma Operator\n\n function parseExpression() {\n var expr, startToken = lookahead;\n\n expr = parseAssignmentExpression();\n\n if (match(',')) {\n expr = delegate.createSequenceExpression([ expr ]);\n\n while (index < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expr.expressions.push(parseAssignmentExpression());\n }\n\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 12.1 Block\n\n function parseStatementList() {\n var list = [],\n statement;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n statement = parseSourceElement();\n if (typeof statement === 'undefined') {\n break;\n }\n list.push(statement);\n }\n\n return list;\n }\n\n function parseBlock() {\n var block, startToken;\n\n startToken = lookahead;\n expect('{');\n\n block = parseStatementList();\n\n expect('}');\n\n return delegate.markEnd(delegate.createBlockStatement(block), startToken);\n }\n\n // 12.2 Variable Statement\n\n function parseVariableIdentifier() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (token.type !== Token.Identifier) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseVariableDeclaration(kind) {\n var init = null, id, startToken;\n\n startToken = lookahead;\n id = parseVariableIdentifier();\n\n // 12.2.1\n if (strict && isRestrictedWord(id.name)) {\n throwErrorTolerant({}, Messages.StrictVarName);\n }\n\n if (kind === 'const') {\n expect('=');\n init = parseAssignmentExpression();\n } else if (match('=')) {\n lex();\n init = parseAssignmentExpression();\n }\n\n return delegate.markEnd(delegate.createVariableDeclarator(id, init), startToken);\n }\n\n function parseVariableDeclarationList(kind) {\n var list = [];\n\n do {\n list.push(parseVariableDeclaration(kind));\n if (!match(',')) {\n break;\n }\n lex();\n } while (index < length);\n\n return list;\n }\n\n function parseVariableStatement() {\n var declarations;\n\n expectKeyword('var');\n\n declarations = parseVariableDeclarationList();\n\n consumeSemicolon();\n\n return delegate.createVariableDeclaration(declarations, 'var');\n }\n\n // kind may be `const` or `let`\n // Both are experimental and not in the specification yet.\n // see http://wiki.ecmascript.org/doku.php?id=harmony:const\n // and http://wiki.ecmascript.org/doku.php?id=harmony:let\n function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }\n\n // 12.3 Empty Statement\n\n function parseEmptyStatement() {\n expect(';');\n return delegate.createEmptyStatement();\n }\n\n // 12.4 Expression Statement\n\n function parseExpressionStatement() {\n var expr = parseExpression();\n consumeSemicolon();\n return delegate.createExpressionStatement(expr);\n }\n\n // 12.5 If statement\n\n function parseIfStatement() {\n var test, consequent, alternate;\n\n expectKeyword('if');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n consequent = parseStatement();\n\n if (matchKeyword('else')) {\n lex();\n alternate = parseStatement();\n } else {\n alternate = null;\n }\n\n return delegate.createIfStatement(test, consequent, alternate);\n }\n\n // 12.6 Iteration Statements\n\n function parseDoWhileStatement() {\n var body, test, oldInIteration;\n\n expectKeyword('do');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n if (match(';')) {\n lex();\n }\n\n return delegate.createDoWhileStatement(body, test);\n }\n\n function parseWhileStatement() {\n var test, body, oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return delegate.createWhileStatement(test, body);\n }\n\n function parseForVariableDeclaration() {\n var token, declarations, startToken;\n\n startToken = lookahead;\n token = lex();\n declarations = parseVariableDeclarationList();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, token.value), startToken);\n }\n\n function parseForStatement() {\n var init, test, update, left, right, body, oldInIteration;\n\n init = test = update = null;\n\n expectKeyword('for');\n\n expect('(');\n\n if (match(';')) {\n lex();\n } else {\n if (matchKeyword('var') || matchKeyword('let')) {\n state.allowIn = false;\n init = parseForVariableDeclaration();\n state.allowIn = true;\n\n if (init.declarations.length === 1 && matchKeyword('in')) {\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n } else {\n state.allowIn = false;\n init = parseExpression();\n state.allowIn = true;\n\n if (matchKeyword('in')) {\n // LeftHandSideExpression\n if (!isLeftHandSide(init)) {\n throwErrorTolerant({}, Messages.InvalidLHSInForIn);\n }\n\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n }\n\n if (typeof left === 'undefined') {\n expect(';');\n }\n }\n\n if (typeof left === 'undefined') {\n\n if (!match(';')) {\n test = parseExpression();\n }\n expect(';');\n\n if (!match(')')) {\n update = parseExpression();\n }\n }\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return (typeof left === 'undefined') ?\n delegate.createForStatement(init, test, update, body) :\n delegate.createForInStatement(left, right, body);\n }\n\n // 12.7 The continue statement\n\n function parseContinueStatement() {\n var label = null, key;\n\n expectKeyword('continue');\n\n // Optimize the most common form: 'continue;'.\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(label);\n }\n\n // 12.8 The break statement\n\n function parseBreakStatement() {\n var label = null, key;\n\n expectKeyword('break');\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(label);\n }\n\n // 12.9 The return statement\n\n function parseReturnStatement() {\n var argument = null;\n\n expectKeyword('return');\n\n if (!state.inFunctionBody) {\n throwErrorTolerant({}, Messages.IllegalReturn);\n }\n\n // 'return' followed by a space and an identifier is very common.\n if (source.charCodeAt(index) === 0x20) {\n if (isIdentifierStart(source.charCodeAt(index + 1))) {\n argument = parseExpression();\n consumeSemicolon();\n return delegate.createReturnStatement(argument);\n }\n }\n\n if (peekLineTerminator()) {\n return delegate.createReturnStatement(null);\n }\n\n if (!match(';')) {\n if (!match('}') && lookahead.type !== Token.EOF) {\n argument = parseExpression();\n }\n }\n\n consumeSemicolon();\n\n return delegate.createReturnStatement(argument);\n }\n\n // 12.10 The with statement\n\n function parseWithStatement() {\n var object, body;\n\n if (strict) {\n // TODO(ikarienator): Should we update the test cases instead?\n skipComment();\n throwErrorTolerant({}, Messages.StrictModeWith);\n }\n\n expectKeyword('with');\n\n expect('(');\n\n object = parseExpression();\n\n expect(')');\n\n body = parseStatement();\n\n return delegate.createWithStatement(object, body);\n }\n\n // 12.10 The swith statement\n\n function parseSwitchCase() {\n var test, consequent = [], statement, startToken;\n\n startToken = lookahead;\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n statement = parseStatement();\n consequent.push(statement);\n }\n\n return delegate.markEnd(delegate.createSwitchCase(test, consequent), startToken);\n }\n\n function parseSwitchStatement() {\n var discriminant, cases, clause, oldInSwitch, defaultFound;\n\n expectKeyword('switch');\n\n expect('(');\n\n discriminant = parseExpression();\n\n expect(')');\n\n expect('{');\n\n cases = [];\n\n if (match('}')) {\n lex();\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n oldInSwitch = state.inSwitch;\n state.inSwitch = true;\n defaultFound = false;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n clause = parseSwitchCase();\n if (clause.test === null) {\n if (defaultFound) {\n throwError({}, Messages.MultipleDefaultsInSwitch);\n }\n defaultFound = true;\n }\n cases.push(clause);\n }\n\n state.inSwitch = oldInSwitch;\n\n expect('}');\n\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n // 12.13 The throw statement\n\n function parseThrowStatement() {\n var argument;\n\n expectKeyword('throw');\n\n if (peekLineTerminator()) {\n throwError({}, Messages.NewlineAfterThrow);\n }\n\n argument = parseExpression();\n\n consumeSemicolon();\n\n return delegate.createThrowStatement(argument);\n }\n\n // 12.14 The try statement\n\n function parseCatchClause() {\n var param, body, startToken;\n\n startToken = lookahead;\n expectKeyword('catch');\n\n expect('(');\n if (match(')')) {\n throwUnexpected(lookahead);\n }\n\n param = parseVariableIdentifier();\n // 12.14.1\n if (strict && isRestrictedWord(param.name)) {\n throwErrorTolerant({}, Messages.StrictCatchVariable);\n }\n\n expect(')');\n body = parseBlock();\n return delegate.markEnd(delegate.createCatchClause(param, body), startToken);\n }\n\n function parseTryStatement() {\n var block, handlers = [], finalizer = null;\n\n expectKeyword('try');\n\n block = parseBlock();\n\n if (matchKeyword('catch')) {\n handlers.push(parseCatchClause());\n }\n\n if (matchKeyword('finally')) {\n lex();\n finalizer = parseBlock();\n }\n\n if (handlers.length === 0 && !finalizer) {\n throwError({}, Messages.NoCatchOrFinally);\n }\n\n return delegate.createTryStatement(block, [], handlers, finalizer);\n }\n\n // 12.15 The debugger statement\n\n function parseDebuggerStatement() {\n expectKeyword('debugger');\n\n consumeSemicolon();\n\n return delegate.createDebuggerStatement();\n }\n\n // 12 Statements\n\n function parseStatement() {\n var type = lookahead.type,\n expr,\n labeledBody,\n key,\n startToken;\n\n if (type === Token.EOF) {\n throwUnexpected(lookahead);\n }\n\n if (type === Token.Punctuator && lookahead.value === '{') {\n return parseBlock();\n }\n\n startToken = lookahead;\n\n if (type === Token.Punctuator) {\n switch (lookahead.value) {\n case ';':\n return delegate.markEnd(parseEmptyStatement(), startToken);\n case '(':\n return delegate.markEnd(parseExpressionStatement(), startToken);\n default:\n break;\n }\n }\n\n if (type === Token.Keyword) {\n switch (lookahead.value) {\n case 'break':\n return delegate.markEnd(parseBreakStatement(), startToken);\n case 'continue':\n return delegate.markEnd(parseContinueStatement(), startToken);\n case 'debugger':\n return delegate.markEnd(parseDebuggerStatement(), startToken);\n case 'do':\n return delegate.markEnd(parseDoWhileStatement(), startToken);\n case 'for':\n return delegate.markEnd(parseForStatement(), startToken);\n case 'function':\n return delegate.markEnd(parseFunctionDeclaration(), startToken);\n case 'if':\n return delegate.markEnd(parseIfStatement(), startToken);\n case 'return':\n return delegate.markEnd(parseReturnStatement(), startToken);\n case 'switch':\n return delegate.markEnd(parseSwitchStatement(), startToken);\n case 'throw':\n return delegate.markEnd(parseThrowStatement(), startToken);\n case 'try':\n return delegate.markEnd(parseTryStatement(), startToken);\n case 'var':\n return delegate.markEnd(parseVariableStatement(), startToken);\n case 'while':\n return delegate.markEnd(parseWhileStatement(), startToken);\n case 'with':\n return delegate.markEnd(parseWithStatement(), startToken);\n default:\n break;\n }\n }\n\n expr = parseExpression();\n\n // 12.12 Labelled Statements\n if ((expr.type === Syntax.Identifier) && match(':')) {\n lex();\n\n key = '$' + expr.name;\n if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.Redeclaration, 'Label', expr.name);\n }\n\n state.labelSet[key] = true;\n labeledBody = parseStatement();\n delete state.labelSet[key];\n return delegate.markEnd(delegate.createLabeledStatement(expr, labeledBody), startToken);\n }\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createExpressionStatement(expr), startToken);\n }\n\n // 13 Function Definition\n\n function parseFunctionSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted,\n oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, startToken;\n\n startToken = lookahead;\n expect('{');\n\n while (index < length) {\n if (lookahead.type !== Token.StringLiteral) {\n break;\n }\n token = lookahead;\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n oldLabelSet = state.labelSet;\n oldInIteration = state.inIteration;\n oldInSwitch = state.inSwitch;\n oldInFunctionBody = state.inFunctionBody;\n\n state.labelSet = {};\n state.inIteration = false;\n state.inSwitch = false;\n state.inFunctionBody = true;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n\n expect('}');\n\n state.labelSet = oldLabelSet;\n state.inIteration = oldInIteration;\n state.inSwitch = oldInSwitch;\n state.inFunctionBody = oldInFunctionBody;\n\n return delegate.markEnd(delegate.createBlockStatement(sourceElements), startToken);\n }\n\n function parseParams(firstRestricted) {\n var param, params = [], token, stricted, paramSet, key, message;\n expect('(');\n\n if (!match(')')) {\n paramSet = {};\n while (index < length) {\n token = lookahead;\n param = parseVariableIdentifier();\n key = '$' + token.value;\n if (strict) {\n if (isRestrictedWord(token.value)) {\n stricted = token;\n message = Messages.StrictParamName;\n }\n if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n stricted = token;\n message = Messages.StrictParamDupe;\n }\n } else if (!firstRestricted) {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictParamName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n } else if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n firstRestricted = token;\n message = Messages.StrictParamDupe;\n }\n }\n params.push(param);\n paramSet[key] = true;\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return {\n params: params,\n stricted: stricted,\n firstRestricted: firstRestricted,\n message: message\n };\n }\n\n function parseFunctionDeclaration() {\n var id, params = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, startToken;\n\n startToken = lookahead;\n\n expectKeyword('function');\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionDeclaration(id, params, [], body), startToken);\n }\n\n function parseFunctionExpression() {\n var token, id = null, stricted, firstRestricted, message, tmp, params = [], body, previousStrict, startToken;\n\n startToken = lookahead;\n expectKeyword('function');\n\n if (!match('(')) {\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionExpression(id, params, [], body), startToken);\n }\n\n // 14 Program\n\n function parseSourceElement() {\n if (lookahead.type === Token.Keyword) {\n switch (lookahead.value) {\n case 'const':\n case 'let':\n return parseConstLetDeclaration(lookahead.value);\n case 'function':\n return parseFunctionDeclaration();\n default:\n return parseStatement();\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n return parseStatement();\n }\n }\n\n function parseSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted;\n\n while (index < length) {\n token = lookahead;\n if (token.type !== Token.StringLiteral) {\n break;\n }\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n while (index < length) {\n sourceElement = parseSourceElement();\n /* istanbul ignore if */\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n return sourceElements;\n }\n\n function parseProgram() {\n var body, startToken;\n\n skipComment();\n peek();\n startToken = lookahead;\n strict = false;\n\n body = parseSourceElements();\n return delegate.markEnd(delegate.createProgram(body), startToken);\n }\n\n function filterTokenLocation() {\n var i, entry, token, tokens = [];\n\n for (i = 0; i < extra.tokens.length; ++i) {\n entry = extra.tokens[i];\n token = {\n type: entry.type,\n value: entry.value\n };\n if (extra.range) {\n token.range = entry.range;\n }\n if (extra.loc) {\n token.loc = entry.loc;\n }\n tokens.push(token);\n }\n\n extra.tokens = tokens;\n }\n\n function tokenize(code, options) {\n var toString,\n token,\n tokens;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n\n // Options matching.\n options = options || {};\n\n // Of course we collect tokens here.\n options.tokens = true;\n extra.tokens = [];\n extra.tokenize = true;\n // The following two fields are necessary to compute the Regex tokens.\n extra.openParenToken = -1;\n extra.openCurlyToken = -1;\n\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n\n try {\n peek();\n if (lookahead.type === Token.EOF) {\n return extra.tokens;\n }\n\n token = lex();\n while (lookahead.type !== Token.EOF) {\n try {\n token = lex();\n } catch (lexError) {\n token = lookahead;\n if (extra.errors) {\n extra.errors.push(lexError);\n // We have to break on the first error\n // to avoid infinite loops.\n break;\n } else {\n throw lexError;\n }\n }\n }\n\n filterTokenLocation();\n tokens = extra.tokens;\n if (typeof extra.comments !== 'undefined') {\n tokens.comments = extra.comments;\n }\n if (typeof extra.errors !== 'undefined') {\n tokens.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n return tokens;\n }\n\n function parse(code, options) {\n var program, toString;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n if (typeof options !== 'undefined') {\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;\n\n if (extra.loc && options.source !== null && options.source !== undefined) {\n extra.source = toString(options.source);\n }\n\n if (typeof options.tokens === 'boolean' && options.tokens) {\n extra.tokens = [];\n }\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n if (extra.attachComment) {\n extra.range = true;\n extra.comments = [];\n extra.bottomRightStack = [];\n extra.trailingComments = [];\n extra.leadingComments = [];\n }\n }\n\n try {\n program = parseProgram();\n if (typeof extra.comments !== 'undefined') {\n program.comments = extra.comments;\n }\n if (typeof extra.tokens !== 'undefined') {\n filterTokenLocation();\n program.tokens = extra.tokens;\n }\n if (typeof extra.errors !== 'undefined') {\n program.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n\n return program;\n }\n\n // Sync with *.json manifests.\n exports.version = '1.2.2';\n\n exports.tokenize = tokenize;\n\n exports.parse = parse;\n\n // Deep copy.\n /* istanbul ignore next */\n exports.Syntax = (function () {\n var name, types = {};\n\n if (typeof Object.create === 'function') {\n types = Object.create(null);\n }\n\n for (name in Syntax) {\n if (Syntax.hasOwnProperty(name)) {\n types[name] = Syntax[name];\n }\n }\n\n if (typeof Object.freeze === 'function') {\n Object.freeze(types);\n }\n\n return types;\n }());\n\n}));\n/* vim: set sw=4 ts=4 et tw=80 : */\n\n},{}],1:[function(require,module,exports){\n(function (process){\n/* parser generated by jison 0.4.13 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar parser = {trace: function trace() { },\nyy: {},\nsymbols_: {\"error\":2,\"JSON_PATH\":3,\"DOLLAR\":4,\"PATH_COMPONENTS\":5,\"LEADING_CHILD_MEMBER_EXPRESSION\":6,\"PATH_COMPONENT\":7,\"MEMBER_COMPONENT\":8,\"SUBSCRIPT_COMPONENT\":9,\"CHILD_MEMBER_COMPONENT\":10,\"DESCENDANT_MEMBER_COMPONENT\":11,\"DOT\":12,\"MEMBER_EXPRESSION\":13,\"DOT_DOT\":14,\"STAR\":15,\"IDENTIFIER\":16,\"SCRIPT_EXPRESSION\":17,\"INTEGER\":18,\"END\":19,\"CHILD_SUBSCRIPT_COMPONENT\":20,\"DESCENDANT_SUBSCRIPT_COMPONENT\":21,\"[\":22,\"SUBSCRIPT\":23,\"]\":24,\"SUBSCRIPT_EXPRESSION\":25,\"SUBSCRIPT_EXPRESSION_LIST\":26,\"SUBSCRIPT_EXPRESSION_LISTABLE\":27,\",\":28,\"STRING_LITERAL\":29,\"ARRAY_SLICE\":30,\"FILTER_EXPRESSION\":31,\"QQ_STRING\":32,\"Q_STRING\":33,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"DOLLAR\",12:\"DOT\",14:\"DOT_DOT\",15:\"STAR\",16:\"IDENTIFIER\",17:\"SCRIPT_EXPRESSION\",18:\"INTEGER\",19:\"END\",22:\"[\",24:\"]\",28:\",\",30:\"ARRAY_SLICE\",31:\"FILTER_EXPRESSION\",32:\"QQ_STRING\",33:\"Q_STRING\"},\nproductions_: [0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */\n/**/) {\n/* this == yyval */\nif (!yy.ast) {\n yy.ast = _ast;\n _ast.initialize();\n}\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:yy.ast.set({ expression: { type: \"root\", value: $$[$0] } }); yy.ast.unshift(); return yy.ast.yield()\nbreak;\ncase 2:yy.ast.set({ expression: { type: \"root\", value: $$[$0-1] } }); yy.ast.unshift(); return yy.ast.yield()\nbreak;\ncase 3:yy.ast.unshift(); return yy.ast.yield()\nbreak;\ncase 4:yy.ast.set({ operation: \"member\", scope: \"child\", expression: { type: \"identifier\", value: $$[$0-1] }}); yy.ast.unshift(); return yy.ast.yield()\nbreak;\ncase 5:\nbreak;\ncase 6:\nbreak;\ncase 7:yy.ast.set({ operation: \"member\" }); yy.ast.push()\nbreak;\ncase 8:yy.ast.set({ operation: \"subscript\" }); yy.ast.push() \nbreak;\ncase 9:yy.ast.set({ scope: \"child\" })\nbreak;\ncase 10:yy.ast.set({ scope: \"descendant\" })\nbreak;\ncase 11:\nbreak;\ncase 12:yy.ast.set({ scope: \"child\", operation: \"member\" })\nbreak;\ncase 13:\nbreak;\ncase 14:yy.ast.set({ expression: { type: \"wildcard\", value: $$[$0] } })\nbreak;\ncase 15:yy.ast.set({ expression: { type: \"identifier\", value: $$[$0] } })\nbreak;\ncase 16:yy.ast.set({ expression: { type: \"script_expression\", value: $$[$0] } })\nbreak;\ncase 17:yy.ast.set({ expression: { type: \"numeric_literal\", value: parseInt($$[$0]) } })\nbreak;\ncase 18:\nbreak;\ncase 19:yy.ast.set({ scope: \"child\" })\nbreak;\ncase 20:yy.ast.set({ scope: \"descendant\" })\nbreak;\ncase 21:\nbreak;\ncase 22:\nbreak;\ncase 23:\nbreak;\ncase 24:$$[$0].length > 1? yy.ast.set({ expression: { type: \"union\", value: $$[$0] } }) : this.$ = $$[$0]\nbreak;\ncase 25:this.$ = [$$[$0]]\nbreak;\ncase 26:this.$ = $$[$0-2].concat($$[$0])\nbreak;\ncase 27:this.$ = { expression: { type: \"numeric_literal\", value: parseInt($$[$0]) } }; yy.ast.set(this.$)\nbreak;\ncase 28:this.$ = { expression: { type: \"string_literal\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 29:this.$ = { expression: { type: \"slice\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 30:this.$ = { expression: { type: \"wildcard\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 31:this.$ = { expression: { type: \"script_expression\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 32:this.$ = { expression: { type: \"filter_expression\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 33:this.$ = $$[$0]\nbreak;\ncase 34:this.$ = $$[$0]\nbreak;\n}\n},\ntable: [{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],\ndefaultActions: {27:[2,23],29:[2,30],30:[2,31],31:[2,32]},\nparseError: function parseError(str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n throw new Error(str);\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n this.lexer.setInput(input);\n this.lexer.yy = this.yy;\n this.yy.lexer = this.lexer;\n this.yy.parser = this;\n if (typeof this.lexer.yylloc == 'undefined') {\n this.lexer.yylloc = {};\n }\n var yyloc = this.lexer.yylloc;\n lstack.push(yyloc);\n var ranges = this.lexer.options && this.lexer.options.ranges;\n if (typeof this.yy.parseError === 'function') {\n this.parseError = this.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = self.lexer.lex() || EOF;\n if (typeof token !== 'number') {\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (this.lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + this.lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: this.lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: this.lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(this.lexer.yytext);\n lstack.push(this.lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = this.lexer.yyleng;\n yytext = this.lexer.yytext;\n yylineno = this.lexer.yylineno;\n yyloc = this.lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n this.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\nvar _ast = {\n\n initialize: function() {\n this._nodes = [];\n this._node = {};\n this._stash = [];\n },\n\n set: function(props) {\n for (var k in props) this._node[k] = props[k];\n return this._node;\n },\n\n node: function(obj) {\n if (arguments.length) this._node = obj;\n return this._node;\n },\n\n push: function() {\n this._nodes.push(this._node);\n this._node = {};\n },\n\n unshift: function() {\n this._nodes.unshift(this._node);\n this._node = {};\n },\n\n yield: function() {\n var _nodes = this._nodes;\n this.initialize();\n return _nodes;\n }\n};\n/* generated by jison-lex 0.2.1 */\nvar lexer = (function(){\nvar lexer = {\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input) {\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function (match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex() {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin(condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState() {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules() {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState(n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState(condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START\n/**/) {\n\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:return 4\nbreak;\ncase 1:return 14\nbreak;\ncase 2:return 12\nbreak;\ncase 3:return 15\nbreak;\ncase 4:return 16\nbreak;\ncase 5:return 22\nbreak;\ncase 6:return 24\nbreak;\ncase 7:return 28\nbreak;\ncase 8:return 30\nbreak;\ncase 9:return 18\nbreak;\ncase 10:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 32;\nbreak;\ncase 11:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 33;\nbreak;\ncase 12:return 17\nbreak;\ncase 13:return 31\nbreak;\n}\n},\nrules: [/^(?:\\$)/,/^(?:\\.\\.)/,/^(?:\\.)/,/^(?:\\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\\[)/,/^(?:\\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\\:((-?(?:0|[1-9][0-9]*)))?(\\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:\"(?:\\\\[\"bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^\"\\\\])*\")/,/^(?:'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*')/,/^(?:\\(.+?\\)(?=\\]))/,/^(?:\\?\\(.+?\\)(?=\\]))/],\nconditions: {\"INITIAL\":{\"rules\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],\"inclusive\":true}}\n};\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain(args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}\n\n}).call(this,require('_process'))\n},{\"_process\":14,\"fs\":12,\"path\":13}],2:[function(require,module,exports){\nmodule.exports = {\n identifier: \"[a-zA-Z_]+[a-zA-Z0-9_]*\",\n integer: \"-?(?:0|[1-9][0-9]*)\",\n qq_string: \"\\\"(?:\\\\\\\\[\\\"bfnrt/\\\\\\\\]|\\\\\\\\u[a-fA-F0-9]{4}|[^\\\"\\\\\\\\])*\\\"\",\n q_string: \"'(?:\\\\\\\\[\\'bfnrt/\\\\\\\\]|\\\\\\\\u[a-fA-F0-9]{4}|[^\\'\\\\\\\\])*'\"\n};\n\n},{}],3:[function(require,module,exports){\nvar dict = require('./dict');\nvar fs = require('fs');\nvar grammar = {\n\n lex: {\n\n macros: {\n esc: \"\\\\\\\\\",\n int: dict.integer\n },\n\n rules: [\n [\"\\\\$\", \"return 'DOLLAR'\"],\n [\"\\\\.\\\\.\", \"return 'DOT_DOT'\"],\n [\"\\\\.\", \"return 'DOT'\"],\n [\"\\\\*\", \"return 'STAR'\"],\n [dict.identifier, \"return 'IDENTIFIER'\"],\n [\"\\\\[\", \"return '['\"],\n [\"\\\\]\", \"return ']'\"],\n [\",\", \"return ','\"],\n [\"({int})?\\\\:({int})?(\\\\:({int})?)?\", \"return 'ARRAY_SLICE'\"],\n [\"{int}\", \"return 'INTEGER'\"],\n [dict.qq_string, \"yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';\"],\n [dict.q_string, \"yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';\"],\n [\"\\\\(.+?\\\\)(?=\\\\])\", \"return 'SCRIPT_EXPRESSION'\"],\n [\"\\\\?\\\\(.+?\\\\)(?=\\\\])\", \"return 'FILTER_EXPRESSION'\"]\n ]\n },\n\n start: \"JSON_PATH\",\n\n bnf: {\n\n JSON_PATH: [\n [ 'DOLLAR', 'yy.ast.set({ expression: { type: \"root\", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()' ],\n [ 'DOLLAR PATH_COMPONENTS', 'yy.ast.set({ expression: { type: \"root\", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()' ],\n [ 'LEADING_CHILD_MEMBER_EXPRESSION', 'yy.ast.unshift(); return yy.ast.yield()' ],\n [ 'LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS', 'yy.ast.set({ operation: \"member\", scope: \"child\", expression: { type: \"identifier\", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()' ] ],\n\n PATH_COMPONENTS: [\n [ 'PATH_COMPONENT', '' ],\n [ 'PATH_COMPONENTS PATH_COMPONENT', '' ] ],\n\n PATH_COMPONENT: [\n [ 'MEMBER_COMPONENT', 'yy.ast.set({ operation: \"member\" }); yy.ast.push()' ],\n [ 'SUBSCRIPT_COMPONENT', 'yy.ast.set({ operation: \"subscript\" }); yy.ast.push() ' ] ],\n\n MEMBER_COMPONENT: [\n [ 'CHILD_MEMBER_COMPONENT', 'yy.ast.set({ scope: \"child\" })' ],\n [ 'DESCENDANT_MEMBER_COMPONENT', 'yy.ast.set({ scope: \"descendant\" })' ] ],\n\n CHILD_MEMBER_COMPONENT: [\n [ 'DOT MEMBER_EXPRESSION', '' ] ],\n\n LEADING_CHILD_MEMBER_EXPRESSION: [\n [ 'MEMBER_EXPRESSION', 'yy.ast.set({ scope: \"child\", operation: \"member\" })' ] ],\n\n DESCENDANT_MEMBER_COMPONENT: [\n [ 'DOT_DOT MEMBER_EXPRESSION', '' ] ],\n\n MEMBER_EXPRESSION: [\n [ 'STAR', 'yy.ast.set({ expression: { type: \"wildcard\", value: $1 } })' ],\n [ 'IDENTIFIER', 'yy.ast.set({ expression: { type: \"identifier\", value: $1 } })' ],\n [ 'SCRIPT_EXPRESSION', 'yy.ast.set({ expression: { type: \"script_expression\", value: $1 } })' ],\n [ 'INTEGER', 'yy.ast.set({ expression: { type: \"numeric_literal\", value: parseInt($1) } })' ],\n [ 'END', '' ] ],\n\n SUBSCRIPT_COMPONENT: [\n [ 'CHILD_SUBSCRIPT_COMPONENT', 'yy.ast.set({ scope: \"child\" })' ],\n [ 'DESCENDANT_SUBSCRIPT_COMPONENT', 'yy.ast.set({ scope: \"descendant\" })' ] ],\n\n CHILD_SUBSCRIPT_COMPONENT: [\n [ '[ SUBSCRIPT ]', '' ] ],\n\n DESCENDANT_SUBSCRIPT_COMPONENT: [\n [ 'DOT_DOT [ SUBSCRIPT ]', '' ] ],\n\n SUBSCRIPT: [\n [ 'SUBSCRIPT_EXPRESSION', '' ],\n [ 'SUBSCRIPT_EXPRESSION_LIST', '$1.length > 1? yy.ast.set({ expression: { type: \"union\", value: $1 } }) : $$ = $1' ] ],\n\n SUBSCRIPT_EXPRESSION_LIST: [\n [ 'SUBSCRIPT_EXPRESSION_LISTABLE', '$$ = [$1]'],\n [ 'SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE', '$$ = $1.concat($3)' ] ],\n\n SUBSCRIPT_EXPRESSION_LISTABLE: [\n [ 'INTEGER', '$$ = { expression: { type: \"numeric_literal\", value: parseInt($1) } }; yy.ast.set($$)' ],\n [ 'STRING_LITERAL', '$$ = { expression: { type: \"string_literal\", value: $1 } }; yy.ast.set($$)' ],\n [ 'ARRAY_SLICE', '$$ = { expression: { type: \"slice\", value: $1 } }; yy.ast.set($$)' ] ],\n\n SUBSCRIPT_EXPRESSION: [\n [ 'STAR', '$$ = { expression: { type: \"wildcard\", value: $1 } }; yy.ast.set($$)' ],\n [ 'SCRIPT_EXPRESSION', '$$ = { expression: { type: \"script_expression\", value: $1 } }; yy.ast.set($$)' ],\n [ 'FILTER_EXPRESSION', '$$ = { expression: { type: \"filter_expression\", value: $1 } }; yy.ast.set($$)' ] ],\n\n STRING_LITERAL: [\n [ 'QQ_STRING', \"$$ = $1\" ],\n [ 'Q_STRING', \"$$ = $1\" ] ]\n }\n};\nif (fs.readFileSync) {\n grammar.moduleInclude = fs.readFileSync(require.resolve(\"../include/module.js\"));\n grammar.actionInclude = fs.readFileSync(require.resolve(\"../include/action.js\"));\n}\n\nmodule.exports = grammar;\n\n},{\"./dict\":2,\"fs\":12}],4:[function(require,module,exports){\nvar aesprim = require('./aesprim');\nvar slice = require('./slice');\nvar _evaluate = require('static-eval');\nvar _uniq = require('underscore').uniq;\n\nvar Handlers = function() {\n return this.initialize.apply(this, arguments);\n}\n\nHandlers.prototype.initialize = function() {\n this.traverse = traverser(true);\n this.descend = traverser();\n}\n\nHandlers.prototype.keys = Object.keys;\n\nHandlers.prototype.resolve = function(component) {\n\n var key = [ component.operation, component.scope, component.expression.type ].join('-');\n var method = this._fns[key];\n\n if (!method) throw new Error(\"couldn't resolve key: \" + key);\n return method.bind(this);\n};\n\nHandlers.prototype.register = function(key, handler) {\n\n if (!handler instanceof Function) {\n throw new Error(\"handler must be a function\");\n }\n\n this._fns[key] = handler;\n};\n\nHandlers.prototype._fns = {\n\n 'member-child-identifier': function(component, partial) {\n var key = component.expression.value;\n var value = partial.value;\n if (value instanceof Object && key in value) {\n return [ { value: value[key], path: partial.path.concat(key) } ]\n }\n },\n\n 'member-descendant-identifier':\n _traverse(function(key, value, ref) { return key == ref }),\n\n 'subscript-child-numeric_literal':\n _descend(function(key, value, ref) { return key === ref }),\n\n 'member-child-numeric_literal':\n _descend(function(key, value, ref) { return String(key) === String(ref) }),\n\n 'subscript-descendant-numeric_literal':\n _traverse(function(key, value, ref) { return key === ref }),\n\n 'member-child-wildcard':\n _descend(function() { return true }),\n\n 'member-descendant-wildcard':\n _traverse(function() { return true }),\n\n 'subscript-descendant-wildcard':\n _traverse(function() { return true }),\n\n 'subscript-child-wildcard':\n _descend(function() { return true }),\n\n 'subscript-child-slice': function(component, partial) {\n if (is_array(partial.value)) {\n var args = component.expression.value.split(':').map(_parse_nullable_int);\n var values = partial.value.map(function(v, i) { return { value: v, path: partial.path.concat(i) } });\n return slice.apply(null, [values].concat(args));\n }\n },\n\n 'subscript-child-union': function(component, partial) {\n var results = [];\n component.expression.value.forEach(function(component) {\n var _component = { operation: 'subscript', scope: 'child', expression: component.expression };\n var handler = this.resolve(_component);\n var _results = handler(_component, partial);\n if (_results) {\n results = results.concat(_results);\n }\n }, this);\n\n return unique(results);\n },\n\n 'subscript-descendant-union': function(component, partial, count) {\n\n var jp = require('..');\n var self = this;\n\n var results = [];\n var nodes = jp.nodes(partial, '$..*').slice(1);\n\n nodes.forEach(function(node) {\n if (results.length >= count) return;\n component.expression.value.forEach(function(component) {\n var _component = { operation: 'subscript', scope: 'child', expression: component.expression };\n var handler = self.resolve(_component);\n var _results = handler(_component, node);\n results = results.concat(_results);\n });\n });\n\n return unique(results);\n },\n\n 'subscript-child-filter_expression': function(component, partial, count) {\n\n // slice out the expression from ?(expression)\n var src = component.expression.value.slice(2, -1);\n var ast = aesprim.parse(src).body[0].expression;\n\n var passable = function(key, value) {\n return evaluate(ast, { '@': value });\n }\n\n return this.descend(partial, null, passable, count);\n\n },\n\n 'subscript-descendant-filter_expression': function(component, partial, count) {\n\n // slice out the expression from ?(expression)\n var src = component.expression.value.slice(2, -1);\n var ast = aesprim.parse(src).body[0].expression;\n\n var passable = function(key, value) {\n return evaluate(ast, { '@': value });\n }\n\n return this.traverse(partial, null, passable, count);\n },\n\n 'subscript-child-script_expression': function(component, partial) {\n var exp = component.expression.value.slice(1, -1);\n return eval_recurse(partial, exp, '$[{{value}}]');\n },\n\n 'member-child-script_expression': function(component, partial) {\n var exp = component.expression.value.slice(1, -1);\n return eval_recurse(partial, exp, '$.{{value}}');\n },\n\n 'member-descendant-script_expression': function(component, partial) {\n var exp = component.expression.value.slice(1, -1);\n return eval_recurse(partial, exp, '$..value');\n }\n};\n\nHandlers.prototype._fns['subscript-child-string_literal'] =\n\tHandlers.prototype._fns['member-child-identifier'];\n\nHandlers.prototype._fns['member-descendant-numeric_literal'] =\n Handlers.prototype._fns['subscript-descendant-string_literal'] =\n Handlers.prototype._fns['member-descendant-identifier'];\n\nfunction eval_recurse(partial, src, template) {\n\n var jp = require('./index');\n var ast = aesprim.parse(src).body[0].expression;\n var value = evaluate(ast, { '@': partial.value });\n var path = template.replace(/\\{\\{\\s*value\\s*\\}\\}/g, value);\n\n var results = jp.nodes(partial.value, path);\n results.forEach(function(r) {\n r.path = partial.path.concat(r.path.slice(1));\n });\n\n return results;\n}\n\nfunction is_array(val) {\n return Array.isArray(val);\n}\n\nfunction is_object(val) {\n // is this a non-array, non-null object?\n return val && !(val instanceof Array) && val instanceof Object;\n}\n\nfunction traverser(recurse) {\n\n return function(partial, ref, passable, count) {\n\n var value = partial.value;\n var path = partial.path;\n\n var results = [];\n\n var descend = function(value, path) {\n\n if (is_array(value)) {\n value.forEach(function(element, index) {\n if (results.length >= count) { return }\n if (passable(index, element, ref)) {\n results.push({ path: path.concat(index), value: element });\n }\n });\n value.forEach(function(element, index) {\n if (results.length >= count) { return }\n if (recurse) {\n descend(element, path.concat(index));\n }\n });\n } else if (is_object(value)) {\n this.keys(value).forEach(function(k) {\n if (results.length >= count) { return }\n if (passable(k, value[k], ref)) {\n results.push({ path: path.concat(k), value: value[k] });\n }\n })\n this.keys(value).forEach(function(k) {\n if (results.length >= count) { return }\n if (recurse) {\n descend(value[k], path.concat(k));\n }\n });\n }\n }.bind(this);\n descend(value, path);\n return results;\n }\n}\n\nfunction _descend(passable) {\n return function(component, partial, count) {\n return this.descend(partial, component.expression.value, passable, count);\n }\n}\n\nfunction _traverse(passable) {\n return function(component, partial, count) {\n return this.traverse(partial, component.expression.value, passable, count);\n }\n}\n\nfunction evaluate() {\n try { return _evaluate.apply(this, arguments) }\n catch (e) { }\n}\n\nfunction unique(results) {\n results = results.filter(function(d) { return d })\n return _uniq(\n results,\n function(r) { return r.path.map(function(c) { return String(c).replace('-', '--') }).join('-') }\n );\n}\n\nfunction _parse_nullable_int(val) {\n var sval = String(val);\n return sval.match(/^-?[0-9]+$/) ? parseInt(sval) : null;\n}\n\nmodule.exports = Handlers;\n\n},{\"..\":\"jsonpath\",\"./aesprim\":\"./aesprim\",\"./index\":5,\"./slice\":7,\"static-eval\":15,\"underscore\":12}],5:[function(require,module,exports){\nvar assert = require('assert');\nvar dict = require('./dict');\nvar Parser = require('./parser');\nvar Handlers = require('./handlers');\n\nvar JSONPath = function() {\n this.initialize.apply(this, arguments);\n};\n\nJSONPath.prototype.initialize = function() {\n this.parser = new Parser();\n this.handlers = new Handlers();\n};\n\nJSONPath.prototype.parse = function(string) {\n assert.ok(_is_string(string), \"we need a path\");\n return this.parser.parse(string);\n};\n\nJSONPath.prototype.parent = function(obj, string) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n\n var node = this.nodes(obj, string)[0];\n var key = node.path.pop(); /* jshint unused:false */\n return this.value(obj, node.path);\n}\n\nJSONPath.prototype.apply = function(obj, string, fn) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n assert.equal(typeof fn, \"function\", \"fn needs to be function\")\n\n var nodes = this.nodes(obj, string).sort(function(a, b) {\n // sort nodes so we apply from the bottom up\n return b.path.length - a.path.length;\n });\n\n nodes.forEach(function(node) {\n var key = node.path.pop();\n var parent = this.value(obj, this.stringify(node.path));\n var val = node.value = fn.call(obj, parent[key]);\n parent[key] = val;\n }, this);\n\n return nodes;\n}\n\nJSONPath.prototype.value = function(obj, path, value) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(path, \"we need a path\");\n\n if (arguments.length >= 3) {\n var node = this.nodes(obj, path).shift();\n if (!node) return this._vivify(obj, path, value);\n var key = node.path.slice(-1).shift();\n var parent = this.parent(obj, this.stringify(node.path));\n parent[key] = value;\n }\n return this.query(obj, this.stringify(path), 1).shift();\n}\n\nJSONPath.prototype._vivify = function(obj, string, value) {\n\n var self = this;\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n\n var path = this.parser.parse(string)\n .map(function(component) { return component.expression.value });\n\n var setValue = function(path, value) {\n var key = path.pop();\n var node = self.value(obj, path);\n if (!node) {\n setValue(path.concat(), typeof key === 'string' ? {} : []);\n node = self.value(obj, path);\n }\n node[key] = value;\n }\n setValue(path, value);\n return this.query(obj, string)[0];\n}\n\nJSONPath.prototype.query = function(obj, string, count) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(_is_string(string), \"we need a path\");\n\n var results = this.nodes(obj, string, count)\n .map(function(r) { return r.value });\n\n return results;\n};\n\nJSONPath.prototype.paths = function(obj, string, count) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n\n var results = this.nodes(obj, string, count)\n .map(function(r) { return r.path });\n\n return results;\n};\n\nJSONPath.prototype.nodes = function(obj, string, count) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n\n if (count === 0) return [];\n\n var path = this.parser.parse(string);\n var handlers = this.handlers;\n\n var partials = [ { path: ['$'], value: obj } ];\n var matches = [];\n\n if (path.length && path[0].expression.type == 'root') path.shift();\n\n if (!path.length) return partials;\n\n path.forEach(function(component, index) {\n\n if (matches.length >= count) return;\n var handler = handlers.resolve(component);\n var _partials = [];\n\n partials.forEach(function(p) {\n\n if (matches.length >= count) return;\n var results = handler(component, p, count);\n\n if (index == path.length - 1) {\n // if we're through the components we're done\n matches = matches.concat(results || []);\n } else {\n // otherwise accumulate and carry on through\n _partials = _partials.concat(results || []);\n }\n });\n\n partials = _partials;\n\n });\n\n return count ? matches.slice(0, count) : matches;\n};\n\nJSONPath.prototype.stringify = function(path) {\n\n assert.ok(path, \"we need a path\");\n\n var string = '$';\n\n var templates = {\n 'descendant-member': '..{{value}}',\n 'child-member': '.{{value}}',\n 'descendant-subscript': '..[{{value}}]',\n 'child-subscript': '[{{value}}]'\n };\n\n path = this._normalize(path);\n\n path.forEach(function(component) {\n\n if (component.expression.type == 'root') return;\n\n var key = [component.scope, component.operation].join('-');\n var template = templates[key];\n var value;\n\n if (component.expression.type == 'string_literal') {\n value = JSON.stringify(component.expression.value)\n } else {\n value = component.expression.value;\n }\n\n if (!template) throw new Error(\"couldn't find template \" + key);\n\n string += template.replace(/{{value}}/, value);\n });\n\n return string;\n}\n\nJSONPath.prototype._normalize = function(path) {\n\n assert.ok(path, \"we need a path\");\n\n if (typeof path == \"string\") {\n\n return this.parser.parse(path);\n\n } else if (Array.isArray(path) && typeof path[0] == \"string\") {\n\n var _path = [ { expression: { type: \"root\", value: \"$\" } } ];\n\n path.forEach(function(component, index) {\n\n if (component == '$' && index === 0) return;\n\n if (typeof component == \"string\" && component.match(\"^\" + dict.identifier + \"$\")) {\n\n _path.push({\n operation: 'member',\n scope: 'child',\n expression: { value: component, type: 'identifier' }\n });\n\n } else {\n\n var type = typeof component == \"number\" ?\n 'numeric_literal' : 'string_literal';\n\n _path.push({\n operation: 'subscript',\n scope: 'child',\n expression: { value: component, type: type }\n });\n }\n });\n\n return _path;\n\n } else if (Array.isArray(path) && typeof path[0] == \"object\") {\n\n return path\n }\n\n throw new Error(\"couldn't understand path \" + path);\n}\n\nfunction _is_string(obj) {\n return Object.prototype.toString.call(obj) == '[object String]';\n}\n\nJSONPath.Handlers = Handlers;\nJSONPath.Parser = Parser;\n\nvar instance = new JSONPath;\ninstance.JSONPath = JSONPath;\n\nmodule.exports = instance;\n\n},{\"./dict\":2,\"./handlers\":4,\"./parser\":6,\"assert\":8}],6:[function(require,module,exports){\nvar grammar = require('./grammar');\nvar gparser = require('../generated/parser');\n\nvar Parser = function() {\n\n var parser = new gparser.Parser();\n\n var _parseError = parser.parseError;\n parser.yy.parseError = function() {\n if (parser.yy.ast) {\n parser.yy.ast.initialize();\n }\n _parseError.apply(parser, arguments);\n }\n\n return parser;\n\n};\n\nParser.grammar = grammar;\nmodule.exports = Parser;\n\n},{\"../generated/parser\":1,\"./grammar\":3}],7:[function(require,module,exports){\nmodule.exports = function(arr, start, end, step) {\n\n if (typeof start == 'string') throw new Error(\"start cannot be a string\");\n if (typeof end == 'string') throw new Error(\"end cannot be a string\");\n if (typeof step == 'string') throw new Error(\"step cannot be a string\");\n\n var len = arr.length;\n\n if (step === 0) throw new Error(\"step cannot be zero\");\n step = step ? integer(step) : 1;\n\n // normalize negative values\n start = start < 0 ? len + start : start;\n end = end < 0 ? len + end : end;\n\n // default extents to extents\n start = integer(start === 0 ? 0 : !start ? (step > 0 ? 0 : len - 1) : start);\n end = integer(end === 0 ? 0 : !end ? (step > 0 ? len : -1) : end);\n\n // clamp extents\n start = step > 0 ? Math.max(0, start) : Math.min(len, start);\n end = step > 0 ? Math.min(end, len) : Math.max(-1, end);\n\n // return empty if extents are backwards\n if (step > 0 && end <= start) return [];\n if (step < 0 && start <= end) return [];\n\n var result = [];\n\n for (var i = start; i != end; i += step) {\n if ((step < 0 && i <= end) || (step > 0 && i >= end)) break;\n result.push(arr[i]);\n }\n\n return result;\n}\n\nfunction integer(val) {\n return String(val).match(/^[0-9]+$/) ? parseInt(val) :\n Number.isFinite(val) ? parseInt(val, 10) : 0;\n}\n\n},{}],8:[function(require,module,exports){\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// when used in node, this will actually load the util module we depend on\n// versus loading the builtin util module as happens otherwise\n// this is a bug in node module loading as far as I am concerned\nvar util = require('util/');\n\nvar pSlice = Array.prototype.slice;\nvar hasOwn = Object.prototype.hasOwnProperty;\n\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nassert.AssertionError = function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n }\n else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = stackStartFunction.name;\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n};\n\n// assert.AssertionError instanceof Error\nutil.inherits(assert.AssertionError, Error);\n\nfunction replacer(key, value) {\n if (util.isUndefined(value)) {\n return '' + value;\n }\n if (util.isNumber(value) && !isFinite(value)) {\n return value.toString();\n }\n if (util.isFunction(value) || util.isRegExp(value)) {\n return value.toString();\n }\n return value;\n}\n\nfunction truncate(s, n) {\n if (util.isString(s)) {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\n\nfunction getMessage(self) {\n return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' +\n self.operator + ' ' +\n truncate(JSON.stringify(self.expected, replacer), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction fail(actual, expected, message, operator, stackStartFunction) {\n throw new assert.AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nfunction ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n}\nassert.ok = ok;\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\n\nassert.equal = function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', assert.equal);\n};\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\n\nassert.notEqual = function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', assert.notEqual);\n }\n};\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\n\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected)) {\n fail(actual, expected, message, 'deepEqual', assert.deepEqual);\n }\n};\n\nfunction _deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (util.isBuffer(actual) && util.isBuffer(expected)) {\n if (actual.length != expected.length) return false;\n\n for (var i = 0; i < actual.length; i++) {\n if (actual[i] !== expected[i]) return false;\n }\n\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (util.isDate(actual) && util.isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (util.isRegExp(actual) && util.isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!util.isObject(actual) && !util.isObject(expected)) {\n return actual == expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b) {\n if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n // if one is a primitive, the other must be same\n if (util.isPrimitive(a) || util.isPrimitive(b)) {\n return a === b;\n }\n var aIsArgs = isArguments(a),\n bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b);\n }\n var ka = objectKeys(a),\n kb = objectKeys(b),\n key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key])) return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\n\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected)) {\n fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);\n }\n};\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\n\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', assert.strictEqual);\n }\n};\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\n\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', assert.notStrictEqual);\n }\n};\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n } else if (actual instanceof expected) {\n return true;\n } else if (expected.call({}, actual) === true) {\n return true;\n }\n\n return false;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (util.isString(expected)) {\n message = expected;\n expected = null;\n }\n\n try {\n block();\n } catch (e) {\n actual = e;\n }\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n if (!shouldThrow && expectedException(actual, expected)) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\n\nassert.throws = function(block, /*optional*/error, /*optional*/message) {\n _throws.apply(this, [true].concat(pSlice.call(arguments)));\n};\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = function(block, /*optional*/message) {\n _throws.apply(this, [false].concat(pSlice.call(arguments)));\n};\n\nassert.ifError = function(err) { if (err) {throw err;}};\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n\n},{\"util/\":11}],9:[function(require,module,exports){\nif (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n},{}],10:[function(require,module,exports){\nmodule.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}\n},{}],11:[function(require,module,exports){\n(function (process,global){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n}).call(this,require('_process'),typeof __webpack_require__.g !== \"undefined\" ? __webpack_require__.g : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"./support/isBuffer\":10,\"_process\":14,\"inherits\":9}],12:[function(require,module,exports){\n\n},{}],13:[function(require,module,exports){\n(function (process){\n// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,\n// backported and transplited with Babel, with backwards-compat fixes\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function (path) {\n if (typeof path !== 'string') path = path + '';\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) {\n // return '//';\n // Backwards-compat fix:\n return '/';\n }\n return path.slice(0, end);\n};\n\nfunction basename(path) {\n if (typeof path !== 'string') path = path + '';\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n}\n\n// Uses a mixed approach for backwards-compatibility, as ext behavior changed\n// in new Node.js versions, so only basename() above is backported here\nexports.basename = function (path, ext) {\n var f = basename(path);\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\nexports.extname = function (path) {\n if (typeof path !== 'string') path = path + '';\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = true\n ? function (str, start, len) { return str.substr(start, len) }\n : 0\n;\n\n}).call(this,require('_process'))\n},{\"_process\":14}],14:[function(require,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],15:[function(require,module,exports){\nvar unparse = require('escodegen').generate;\n\nmodule.exports = function (ast, vars) {\n if (!vars) vars = {};\n var FAIL = {};\n \n var result = (function walk (node, scopeVars) {\n if (node.type === 'Literal') {\n return node.value;\n }\n else if (node.type === 'UnaryExpression'){\n var val = walk(node.argument)\n if (node.operator === '+') return +val\n if (node.operator === '-') return -val\n if (node.operator === '~') return ~val\n if (node.operator === '!') return !val\n return FAIL\n }\n else if (node.type === 'ArrayExpression') {\n var xs = [];\n for (var i = 0, l = node.elements.length; i < l; i++) {\n var x = walk(node.elements[i]);\n if (x === FAIL) return FAIL;\n xs.push(x);\n }\n return xs;\n }\n else if (node.type === 'ObjectExpression') {\n var obj = {};\n for (var i = 0; i < node.properties.length; i++) {\n var prop = node.properties[i];\n var value = prop.value === null\n ? prop.value\n : walk(prop.value)\n ;\n if (value === FAIL) return FAIL;\n obj[prop.key.value || prop.key.name] = value;\n }\n return obj;\n }\n else if (node.type === 'BinaryExpression' ||\n node.type === 'LogicalExpression') {\n var l = walk(node.left);\n if (l === FAIL) return FAIL;\n var r = walk(node.right);\n if (r === FAIL) return FAIL;\n \n var op = node.operator;\n if (op === '==') return l == r;\n if (op === '===') return l === r;\n if (op === '!=') return l != r;\n if (op === '!==') return l !== r;\n if (op === '+') return l + r;\n if (op === '-') return l - r;\n if (op === '*') return l * r;\n if (op === '/') return l / r;\n if (op === '%') return l % r;\n if (op === '<') return l < r;\n if (op === '<=') return l <= r;\n if (op === '>') return l > r;\n if (op === '>=') return l >= r;\n if (op === '|') return l | r;\n if (op === '&') return l & r;\n if (op === '^') return l ^ r;\n if (op === '&&') return l && r;\n if (op === '||') return l || r;\n \n return FAIL;\n }\n else if (node.type === 'Identifier') {\n if ({}.hasOwnProperty.call(vars, node.name)) {\n return vars[node.name];\n }\n else return FAIL;\n }\n else if (node.type === 'ThisExpression') {\n if ({}.hasOwnProperty.call(vars, 'this')) {\n return vars['this'];\n }\n else return FAIL;\n }\n else if (node.type === 'CallExpression') {\n var callee = walk(node.callee);\n if (callee === FAIL) return FAIL;\n if (typeof callee !== 'function') return FAIL;\n \n var ctx = node.callee.object ? walk(node.callee.object) : FAIL;\n if (ctx === FAIL) ctx = null;\n\n var args = [];\n for (var i = 0, l = node.arguments.length; i < l; i++) {\n var x = walk(node.arguments[i]);\n if (x === FAIL) return FAIL;\n args.push(x);\n }\n return callee.apply(ctx, args);\n }\n else if (node.type === 'MemberExpression') {\n var obj = walk(node.object);\n // do not allow access to methods on Function \n if((obj === FAIL) || (typeof obj == 'function')){\n return FAIL;\n }\n if (node.property.type === 'Identifier') {\n return obj[node.property.name];\n }\n var prop = walk(node.property);\n if (prop === FAIL) return FAIL;\n return obj[prop];\n }\n else if (node.type === 'ConditionalExpression') {\n var val = walk(node.test)\n if (val === FAIL) return FAIL;\n return val ? walk(node.consequent) : walk(node.alternate)\n }\n else if (node.type === 'ExpressionStatement') {\n var val = walk(node.expression)\n if (val === FAIL) return FAIL;\n return val;\n }\n else if (node.type === 'ReturnStatement') {\n return walk(node.argument)\n }\n else if (node.type === 'FunctionExpression') {\n \n var bodies = node.body.body;\n \n // Create a \"scope\" for our arguments\n var oldVars = {};\n Object.keys(vars).forEach(function(element){\n oldVars[element] = vars[element];\n })\n\n for(var i=0; i<node.params.length; i++){\n var key = node.params[i];\n if(key.type == 'Identifier'){\n vars[key.name] = null;\n }\n else return FAIL;\n }\n for(var i in bodies){\n if(walk(bodies[i]) === FAIL){\n return FAIL;\n }\n }\n // restore the vars and scope after we walk\n vars = oldVars;\n \n var keys = Object.keys(vars);\n var vals = keys.map(function(key) {\n return vars[key];\n });\n return Function(keys.join(', '), 'return ' + unparse(node)).apply(null, vals);\n }\n else if (node.type === 'TemplateLiteral') {\n var str = '';\n for (var i = 0; i < node.expressions.length; i++) {\n str += walk(node.quasis[i]);\n str += walk(node.expressions[i]);\n }\n str += walk(node.quasis[i]);\n return str;\n }\n else if (node.type === 'TaggedTemplateExpression') {\n var tag = walk(node.tag);\n var quasi = node.quasi;\n var strings = quasi.quasis.map(walk);\n var values = quasi.expressions.map(walk);\n return tag.apply(null, [strings].concat(values));\n }\n else if (node.type === 'TemplateElement') {\n return node.value.cooked;\n }\n else return FAIL;\n })(ast);\n \n return result === FAIL ? undefined : result;\n};\n\n},{\"escodegen\":12}],\"jsonpath\":[function(require,module,exports){\nmodule.exports = require('./lib/index');\n\n},{\"./lib/index\":5}]},{},[\"jsonpath\"])(\"jsonpath\")\n});\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/jsonpath/jsonpath.js?")},631:(module,__unused_webpack_exports,__webpack_require__)=>{eval("var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = __webpack_require__(4654);\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other\n /* eslint-env browser */\n if (typeof window !== 'undefined' && obj === window) {\n return '{ [object Window] }';\n }\n if (obj === __webpack_require__.g) {\n return '{ [object globalThis] }';\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '&quot;');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/object-inspect/index.js?")},5798:module=>{"use strict";eval("\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/qs/lib/formats.js?")},129:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar stringify = __webpack_require__(8261);\nvar parse = __webpack_require__(5235);\nvar formats = __webpack_require__(5798);\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/qs/lib/index.js?")},5235:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(2769);\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = { __proto__: null };\n\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = utils.maybeMap(\n parseArrayValue(part.slice(pos + 1), options),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n if (has.call(obj, key)) {\n obj[key] = utils.combine(obj[key], val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var leaf = valuesParsed ? val : parseArrayValue(val, options);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (!options.parseArrays && cleanRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else if (cleanRoot !== '__proto__') {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n return {\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/qs/lib/parse.js?")},8261:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar getSideChannel = __webpack_require__(7478);\nvar utils = __webpack_require__(2769);\nvar formats = __webpack_require__(5798);\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar sentinel = {};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n commaRoundTrip,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel\n) {\n var obj = object;\n\n var tmpSc = sideChannel;\n var step = 0;\n var findFlag = false;\n while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {\n // Where object last appeared in the ref tree\n var pos = tmpSc.get(object);\n step += 1;\n if (typeof pos !== 'undefined') {\n if (pos === step) {\n throw new RangeError('Cyclic object value');\n } else {\n findFlag = true; // Break while\n }\n }\n if (typeof tmpSc.get(sentinel) === 'undefined') {\n step = 0;\n }\n }\n\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n if (encodeValuesOnly && encoder) {\n obj = utils.maybeMap(obj, encoder);\n }\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');\n\n sideChannel.set(object, step);\n var valueSideChannel = getSideChannel();\n valueSideChannel.set(sentinel, sideChannel);\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n commaRoundTrip,\n strictNullHandling,\n skipNulls,\n generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (opts && opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if (opts && 'indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n commaRoundTrip,\n options.strictNullHandling,\n options.skipNulls,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('&#10003;'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/qs/lib/stringify.js?")},2769:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar formats = __webpack_require__(5798);\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n /* eslint operator-linebreak: [2, \"before\"] */\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/qs/lib/utils.js?")},7771:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(210);\nvar define = __webpack_require__(2296);\nvar hasDescriptors = __webpack_require__(1044)();\nvar gOPD = __webpack_require__(7296);\n\nvar $TypeError = __webpack_require__(4453);\nvar $floor = GetIntrinsic('%Math.floor%');\n\n/** @typedef {(...args: unknown[]) => unknown} Func */\n\n/** @type {<T extends Func = Func>(fn: T, length: number, loose?: boolean) => T} */\nmodule.exports = function setFunctionLength(fn, length) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tif (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {\n\t\tthrow new $TypeError('`length` must be a positive 32-bit integer');\n\t}\n\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\n\tvar functionLengthIsConfigurable = true;\n\tvar functionLengthIsWritable = true;\n\tif ('length' in fn && gOPD) {\n\t\tvar desc = gOPD(fn, 'length');\n\t\tif (desc && !desc.configurable) {\n\t\t\tfunctionLengthIsConfigurable = false;\n\t\t}\n\t\tif (desc && !desc.writable) {\n\t\t\tfunctionLengthIsWritable = false;\n\t\t}\n\t}\n\n\tif (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);\n\t\t} else {\n\t\t\tdefine(/** @type {Parameters<define>[0]} */ (fn), 'length', length);\n\t\t}\n\t}\n\treturn fn;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/set-function-length/index.js?")},7478:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(210);\nvar callBound = __webpack_require__(1924);\nvar inspect = __webpack_require__(631);\n\nvar $TypeError = __webpack_require__(4453);\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n* This function traverses the list returning the node corresponding to the given key.\n*\n* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.\n*/\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/side-channel/index.js?")},7026:module=>{"use strict";eval("\n\nmodule.exports = function () {\n throw new Error(\n 'ws does not work in the browser. Browser clients must use the native ' +\n 'WebSocket object'\n );\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/ws/browser.js?")},4654:()=>{eval("/* (ignored) */\n\n//# sourceURL=webpack://@gudhub/core/./util.inspect_(ignored)?")},4836:module=>{eval('function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n "default": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/@babel/runtime/helpers/interopRequireDefault.js?')},8698:module=>{eval('function _typeof(o) {\n "@babel/helpers - typeof";\n\n return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;\n }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/@babel/runtime/helpers/typeof.js?')},1953:(__unused_webpack___webpack_module__,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";eval("\n;// CONCATENATED MODULE: ./GUDHUB/config.js\nconst server_url = \"https://gudhub.com/GudHub_Test\";\n//export const server_url = \"https://gudhub.com/GudHub_Temp\";\n//export const server_url = \"https://integration.gudhub.com/GudHub_Test\";\n//export const server_url = \"http://localhost:9000\";\nconst wss_url = \"wss://gudhub.com/GudHub/ws/app/\";\nconst node_server_url = \"https://gudhub.com/api/services/prod\";\nconst async_modules_path = 'build/latest/async_modules_node/';\nconst automation_modules_path = 'build/latest/automation_modules/';\nconst file_server_url = 'https://gudhub.com';\nconst cache_chunk_requests = true;\nconst cache_app_requests = true;\n\n// FOR TESTS\nconst port = 9000;\n// EXTERNAL MODULE: ./GUDHUB/consts.js\nvar consts = __webpack_require__(738);\n;// CONCATENATED MODULE: ./GUDHUB/DataService/DataService.js\nclass DataService {}\n;\n;// CONCATENATED MODULE: ./GUDHUB/DataService/AppDataService.js\n\n\nclass AppDataService extends DataService {\n //interface for indexeddb and http services\n\n constructor(req, conf, gudhub) {\n super();\n this.chunkDataService = new export_ChunkDataService(req, chunkDataServiceConf, gudhub);\n this.gudhub = gudhub;\n }\n isWithCache() {\n return false;\n }\n\n //here\n async processRequestedApp(id, sentData) {\n if (!this.isWithCache()) {\n // async getChunks(app_id, chunk_ids) {\n // let chunks = [];\n // if(chunk_ids){\n // chunks = await Promise.all(chunk_ids.map((chunk_id) => this.getChunk(app_id, chunk_id)));\n // }\n // return chunks;\n // }\n\n // let res = await this.chunkDataService.getChunks(id, sentData.chunks);\n let res = await Promise.all(sentData.chunks.map(chunk_id => this.chunkDataService.getChunk(id, chunk_id)));\n if (!res) res = [];\n sentData.items_list = await this.gudhub.util.mergeChunks([...res, sentData]);\n return sentData;\n\n // this.dataService.putApp(id, nextVersion);\n\n // return this.mergeAndReturnStrategy.handle(sentData, chunks);\n }\n\n try {\n let cachedVersion = await this.getCached(id);\n if (!cachedVersion) {\n //TODO maybe dont wait for chunks at first load\n\n // let res = await this.chunkDataService.getChunks(id, sentData.chunks);\n let res = await Promise.all(sentData.chunks.map(chunk_id => this.chunkDataService.getChunk(id, chunk_id)));\n if (!res) res = [];\n sentData.items_list = await this.gudhub.util.mergeChunks([...res, sentData]);\n\n // this.putInCache(id, sentData);\n\n return sentData;\n }\n let newHashesList = sentData.chunks.filter(c => !cachedVersion.chunks.includes(c));\n\n // let self = this;\n\n // let res = await this.chunkDataService.getChunks(id, newHashesList);\n let res = await Promise.all(newHashesList.map(chunk_id => this.chunkDataService.getChunk(id, chunk_id)));\n if (!res) res = [];\n\n // this.chunkDataService.getChunks(id, newHashesList).then((res) => {\n\n sentData.items_list = await this.gudhub.util.mergeChunks([cachedVersion, ...res, sentData]);\n\n // this.gudhub.triggerAppChange(id, cachedVersion, sentData);\n\n // self.putInCache(id, sentData);\n // });\n\n return sentData;\n\n // return cachedVersion;\n } catch (error) {\n // res = await this.chunkDataService.getChunks(id, sentData.chunks);\n let res = await Promise.all(sentData.chunks.map(chunk_id => this.chunkDataService.getChunk(id, chunk_id)));\n if (!res) res = [];\n sentData.items_list = await this.gudhub.util.mergeChunks([...res, sentData]);\n\n // this.putInCache(id, sentData);\n\n return sentData;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/api/AppApi.js\nclass AppAPI {\n constructor(req) {\n this.req = req;\n }\n async getApp(app_id) {\n return this.req.get({\n url: `/api/app/get`,\n params: {\n app_id: app_id\n }\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/utils.js\nlet objectAssignWithoutOverride = (target, ...sourceList) => {\n for (let source of sourceList) {\n if (!source) continue;\n for (let key of Object.keys(source)) {\n //this doesnt iterate over class like source properties\n if (!(key in target)) {\n //checks own and inherited keys, works fine also for class prototypes and instances\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (desc.enumerable) Object.defineProperty(target, key, desc);\n }\n }\n }\n};\nlet objectAssignWithOverride = (target, ...sourceList) => {\n for (let source of sourceList) {\n if (!source) continue;\n for (let key of Object.keys(source)) {\n //this doesnt iterate over class like source properties\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (desc.enumerable) Object.defineProperty(target, key, desc);\n }\n }\n};\nlet checkInstanceModifier = (target, ...sourceList) => {\n for (let source of sourceList) {\n if (!source) continue;\n for (let key of Object.keys(source)) {\n //this doesnt iterate over class like source properties\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (desc.enumerable) Object.defineProperty(target, key, desc);\n }\n }\n};\n;// CONCATENATED MODULE: ./GUDHUB/DataService/httpService/HttpService.js\nclass HttpService {}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/httpService/AppHttpService.js\n\n\n\n\n\nclass AppHttpService extends AppDataService {\n constructor(req, conf, gudhub) {\n super(req, conf, gudhub);\n this.appApi = new AppAPI(req);\n let indexDBService = new HttpService(conf);\n\n // this.chunkDataService = new ChunkDataService; //TODO move to \n\n objectAssignWithOverride(this, indexDBService);\n }\n async getApp(id) {\n let sentData = await this.appApi.getApp(id);\n return this.processRequestedApp(id, sentData); // here is a problem. IndexedDB App service has Data service AppHttpService\n }\n\n //TODO should be getApp and getAppAndProcessData - refactor whole code to use them\n\n //TODO андрей говорил про то что там надо фильтровать айтемы удаленные, я так и не доделал\n\n async getAppWithoutProcessing(id) {\n return this.appApi.getApp(id);\n }\n async putApp(id, app) {\n // do nothing\n }\n static [Symbol.hasInstance](instance) {\n try {\n if (instance instanceof AppHttpService) return true;\n if (instance instanceof HttpService) return true; //TODO requires multiple inheritance, thhink how to overcome it\n return false;\n } catch (error) {\n return false;\n }\n }\n}\n;\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/IndexedDBService.js\nclass IndexedDBService {\n constructor(conf) {\n this.store = conf.store;\n this.dbName = conf.dbName;\n this.dbVersion = conf.dbVersion;\n this.requestCache = new Map(); // id -> promise\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/ChunkDataService.js\n\nclass ChunkDataService extends DataService {\n //interface for indexeddb and http services\n}\n;// CONCATENATED MODULE: ./GUDHUB/api/ChunkApi.js\nclass ChunkAPI {\n constructor(req) {\n this.req = req;\n }\n async getChunk(app_id, chunk_id) {\n return this.req.get({\n url: `${this.req.root}/api/get-items-chunk/${app_id}/${chunk_id}`,\n method: 'GET'\n });\n }\n async getLastChunk(app_id) {\n return this.req.axiosRequest({\n url: `${this.req.root}/api/get-last-items-chunk/${app_id}`,\n method: 'GET'\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/httpService/ChunkHttpService.js\n\n\n\n\nclass ChunkHttpService extends ChunkDataService {\n constructor(req, conf) {\n super();\n this.chunkApi = new ChunkAPI(req);\n let httpService = new HttpService(conf);\n objectAssignWithOverride(this, httpService);\n }\n async getChunk(app_id, id) {\n return this.chunkApi.getChunk(app_id, id);\n }\n putChunk() {\n //do nothing\n }\n static [Symbol.hasInstance](instance) {\n try {\n if (instance instanceof ChunkHttpService) return true;\n if (instance instanceof HttpService) return true; //TODO requires multiple inheritance, thhink how to overcome it\n return false;\n } catch (error) {\n return false;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/IndexedDBChunkService.js\n // removed \"ChunkCacheDataService\" from imported because it was causing an error \"{ ChunkCacheDataService } not found in exported names\" in \"gudhub-node-server\"\n\n\n\n\n//this should be global in project\n// class IndexedDBFacade extends CacheService {\n\n// }\n\n// class ChunkCachedDataService extends ChunkDataService {\n// dataService;\n// }\n\nclass IndexedDBChunkService extends ChunkDataService {\n constructor(req, conf, gudhub) {\n super(req, conf);\n this.dataService = new ChunkHttpService(req);\n let indexDBService = new IndexedDBService(conf);\n this.gudhub = gudhub;\n objectAssignWithOverride(this, indexDBService);\n }\n\n //TODO use IndexedDBFacade here\n // indexDBAccess = new IndexedDBFacade;\n\n static [Symbol.hasInstance](instance) {\n try {\n if (instance instanceof IndexedDBChunkService) return true;\n if (instance instanceof IndexedDBService) return true; //TODO requires multiple inheritance, thhink how to overcome it\n return false;\n } catch (error) {\n return false;\n }\n }\n async putChunk(id, data) {\n try {\n const db = await this.openDatabase();\n const transaction = db.transaction(this.store, \"readwrite\");\n const store = transaction.objectStore(this.store);\n store.put(data, id);\n } catch (error) {}\n }\n\n // async getApp(id) {\n // if (this.requestCache.has(id)) return this.requestCache.get(id);\n\n // let self = this;\n\n // let dataServiceRequest = this.dataService.getApp(id);\n\n // let pr = new Promise(async (resolve, reject) => {\n // try {\n // const db = await self.openDatabase();\n // const transaction = db.transaction(self.store, \"readonly\");\n // const store = transaction.objectStore(self.store);\n\n // const storeRequest = store.get(id);\n\n // storeRequest.onsuccess = (e) => {\n\n // let cachedData = e.target.result;\n\n // if (\n // !cachedData\n // ) {\n // dataServiceRequest.then(resolve, reject);\n // dataServiceRequest.then(data => self.putApp(id, data));\n // }\n\n // if (\n // cachedData\n // ) {\n // resolve(cachedData);\n\n // dataServiceRequest.then(async (data) => {\n // // self.gudhub.processAppUpd(data, cachedData);//\n // await self.putApp(id, data);\n // self.gudhub.triggerAppUpdate(id, prevVersion, newVersion);\n // });\n // }\n // };\n\n // storeRequest.onerror = () => {\n // dataServiceRequest.then(resolve, reject);\n // dataServiceRequest.then(data => self.putApp(id, data));\n // }\n // } catch (error) {\n // dataServiceRequest.then(resolve, reject);\n // dataServiceRequest.then(data => self.putApp(id, data));\n // }\n // });\n\n // self.requestCache.set(id, pr);\n\n // return pr;\n // }\n\n async getChunk(app_id, id) {\n if (this.requestCache.has(id)) return this.requestCache.get(id);\n try {\n let self = this;\n let pr = new Promise(async (resolve, reject) => {\n try {\n const db = await self.openDatabase();\n const transaction = db.transaction(self.store, \"readonly\");\n const store = transaction.objectStore(self.store);\n const storeRequest = store.get(id);\n storeRequest.onsuccess = e => {\n let cachedData = e.target.result;\n if (!cachedData) {\n reject();\n }\n if (cachedData) {\n resolve(cachedData);\n }\n };\n storeRequest.onerror = reject;\n } catch (error) {\n reject();\n }\n });\n self.requestCache.set(id, pr);\n await pr;\n return pr;\n } catch (e) {\n let reqPrms = this.dataService.getChunk(app_id, id);\n this.requestCache.set(id, reqPrms);\n let res = await reqPrms;\n this.putChunk(id, res);\n // putPrms.then(() => self.gudhub.triggerAppUpdate(id));\n\n return reqPrms;\n }\n }\n async openDatabase() {\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(this.dbName, this.dbVersion);\n request.onsuccess = event => {\n resolve(event.target.result);\n };\n request.onerror = event => {\n reject(event.target.error);\n };\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/consts.js\nconst dbName = \"gudhub\";\nconst dbVersion = 7;\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/chunkDataConf.js\n\nconst chunksConf = {\n dbName: dbName,\n dbVersion: dbVersion,\n store: 'chunks'\n};\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/IndexedDBAppService.js\n\n // removed \"ChunkCacheDataService\" from imported because it was causing an error \"{ ChunkCacheDataService } not found in exported names\" in \"gudhub-node-server\"\n\n\n\n\n\n\n//this should be global in project\n// class IndexedDBFacade extends CacheService {\n\n// }\n\n//todo андрей сказал чанки два раза грузятся\n//при первой загрузке когда нет бд ничего не отображается\n//андрей предлагает грохать бд если проблемы со сторами\n\nclass IndexedDBAppServiceForWorker extends AppDataService {\n constructor(req, conf, gudhub) {\n super(req, conf, gudhub);\n this.dataService = new AppHttpService(req, conf, gudhub);\n let indexDBService = new IndexedDBService(conf);\n this.gudhub = gudhub;\n this.chunkDataService = new IndexedDBChunkService(req, chunksConf, gudhub);\n\n //TODO also think how to use AppDataService without overriding chunkDataService here. seems it gets http chunk service for worker somehow\n // maybe IS_WEB is wrong inside worker\n\n //todo worker pool?\n\n objectAssignWithOverride(this, indexDBService);\n }\n static [Symbol.hasInstance](instance) {\n try {\n if (instance instanceof IndexedDBAppServiceForWorker) return true;\n if (instance instanceof IndexedDBService) return true; //TODO requires multiple inheritance, thhink how to overcome it\n return false;\n } catch (error) {\n return false;\n }\n }\n\n //TODO use IndexedDBFacade here\n // indexDBAccess = new IndexedDBFacade;\n\n isWithCache() {\n return true;\n }\n\n // getApp(id) {\n // let worker = new Worker('../../appRequestWorker.js');\n\n // worker.postMessage({ type: 'init', gudhubSerialized: this.gudhub.serialized });\n\n // // Send the main data to be processed\n // const mainData = { /* your data here */ };\n // worker.postMessage({ type: 'processData', data: mainData });\n\n // worker.onmessage = function(e) {\n // console.log('Data processed by worker:', e.data);\n // };\n\n // worker.onerror = function(e) {\n // console.error('Error in worker:', e);\n // };\n\n // worker.onmessage = (msgEv) => {\n\n // }\n\n // }\n\n async getApp(id) {\n // if (this.requestCache.has(id)) return this.requestCache.get(id);\n\n let self = this;\n\n // let dataServiceRequest = this.dataService.getAppWithoutProcessing(id);\n let data = await this.dataService.getAppWithoutProcessing(id);\n let processedData = await self.processRequestedApp(id, data); //here\n\n self.putApp(id, processedData);\n return processedData;\n let pr = new Promise(async (resolve, reject) => {\n try {\n const db = await self.openDatabase();\n const transaction = db.transaction(self.store, \"readonly\");\n const store = transaction.objectStore(self.store);\n const storeRequest = store.get(id);\n storeRequest.onsuccess = e => {\n let cachedData = e.target.result;\n if (!cachedData) {\n dataServiceRequest.then(async data => {\n let processedData = await self.processRequestedApp(id, data); //here\n\n // let comparison = this.gudhub.util.compareItems([], processedData.items_list);\n\n // let cached\n\n resolve(processedData);\n self.putApp(id, processedData);\n }, reject);\n }\n if (cachedData) {\n // resolve(cachedData);\n\n dataServiceRequest.then(async data => {\n let processedData = await self.processRequestedApp(id, data); //here\n\n // let comparison = this.gudhub.util.compareItems(cachedData.items_list, processedData.items_list);\n\n resolve(processedData);\n self.putApp(id, processedData);\n });\n }\n };\n storeRequest.onerror = () => {\n dataServiceRequest.then(async data => {\n let processedData = await self.processRequestedApp(id, data); //here\n\n // let comparison = this.gudhub.util.compareItems([], processedData.items_list);\n\n // let cached\n\n resolve(processedData);\n self.putApp(id, processedData);\n }, reject);\n };\n } catch (error) {\n dataServiceRequest.then(async data => {\n let processedData = await self.processRequestedApp(id, data); //here\n\n // let comparison = this.gudhub.util.compareItems([], processedData.items_list);\n\n // let cached\n\n resolve(processedData);\n self.putApp(id, processedData);\n }, reject);\n }\n });\n\n // self.requestCache.set(id, pr);\n\n return pr;\n }\n async getCached(id) {\n let self = this;\n let pr = new Promise(async (resolve, reject) => {\n try {\n const db = await self.openDatabase();\n const transaction = db.transaction(self.store, \"readonly\");\n const store = transaction.objectStore(self.store);\n const storeRequest = store.get(id);\n storeRequest.onsuccess = e => {\n let cachedData = e.target.result;\n if (!cachedData) {\n reject();\n }\n if (cachedData) {\n resolve(cachedData);\n }\n };\n storeRequest.onerror = reject;\n } catch (error) {\n reject();\n }\n });\n return pr;\n }\n async putApp(id, data) {\n try {\n const db = await this.openDatabase();\n const transaction = db.transaction(this.store, \"readwrite\");\n const store = transaction.objectStore(this.store);\n store.put(data, id);\n } catch (error) {}\n }\n async openDatabase() {\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(this.dbName, this.dbVersion);\n request.onsuccess = event => {\n resolve(event.target.result);\n };\n request.onerror = event => {\n reject(event.target.error);\n };\n });\n }\n}\nclass IndexedDBAppService extends AppDataService {\n constructor(req, conf, gudhub) {\n super(req, conf, gudhub);\n this.dataService = new AppHttpService(req, conf, gudhub);\n let indexDBService = new IndexedDBService(conf);\n this.gudhub = gudhub;\n this.resolveFnMap = new Map(); // id -> resolve\n\n // this.appRequestAndProcessWorker = new Worker('./appRequestWorker.js');\n // this.appRequestAndProcessWorker = new Worker(new URL('./appRequestWorker.js', import.meta.url));\n this.appRequestAndProcessWorker = new Worker('node_modules/@gudhub/core/umd/appRequestWorker.js');\n // this.appRequestAndProcessWorker = new AppRequestWorker();\n\n // new Worker(new URL('./worker.js', import.meta.url));\n\n this.appRequestAndProcessWorker.postMessage({\n type: 'init',\n gudhubSerialized: this.gudhub.serialized\n });\n let self = this;\n this.appRequestAndProcessWorker.onerror = function (e) {\n // self.appRequestAndProcessWorker.terminate();\n\n // console.error('Error in worker:', e);\n };\n\n // let self = this;\n\n this.appRequestAndProcessWorker.onmessage = function (e) {\n if (e.data.type == 'requestApp') {\n if (self.resolveFnMap.has(e.data.id)) {\n let resolver = self.resolveFnMap.get(e.data.id);\n resolver(e.data.data);\n }\n\n // self.requestCache.set(id, new Promise);\n }\n\n if (e.data.type == 'processData') {\n // if (id == e.data.id) {\n self.gudhub.itemProcessor.handleDiff(e.data.id, e.data.compareRes);\n // }\n }\n\n // worker.terminate();\n\n // this.postMessage({id: e.data.id, compareRes: comparison});\n\n // console.log('Data processed by worker:', e.data);\n };\n\n // worker.onerror = function(e) {\n // // worker.terminate();\n\n // // console.error('Error in worker:', e);\n // };\n\n //todo worker pool?\n\n objectAssignWithOverride(this, indexDBService);\n }\n static [Symbol.hasInstance](instance) {\n try {\n if (instance instanceof IndexedDBAppService) return true;\n if (instance instanceof IndexedDBService) return true; //TODO requires multiple inheritance, thhink how to overcome it\n return false;\n } catch (error) {\n return false;\n }\n }\n\n //TODO use IndexedDBFacade here\n // indexDBAccess = new IndexedDBFacade;\n\n isWithCache() {\n return true;\n }\n async getApp(id) {\n if (this.requestCache.has(id)) return this.requestCache.get(id);\n let self = this;\n let hasId = await this.has(id);\n if (hasId) {\n let getFromDBPrms = this.getCached(id);\n this.requestCache.set(id, getFromDBPrms);\n this.appRequestAndProcessWorker.postMessage({\n type: 'processData',\n id: id\n });\n return getFromDBPrms;\n } else {\n // this.requestCache.set(id, new Promise);\n\n let prms = new Promise((resolve, reject) => {\n self.resolveFnMap.set(id, resolve);\n });\n this.requestCache.set(id, prms);\n\n //todo define types as constants\n this.appRequestAndProcessWorker.postMessage({\n type: 'requestApp',\n id: id\n });\n return prms;\n\n //todo somehow handle answer from worker\n\n //maybe use mesage library to communicate with worker\n }\n\n // let worker = new Worker('./appRequestWorker.js');\n\n // worker.postMessage({ type: 'init', gudhubSerialized: this.gudhub.serialized });\n\n // Send the main data to be processed\n // const mainData = { /* your data here */ };\n // this.appRequestAndProcessWorker.postMessage({ type: 'processData', id: id });\n\n // let self = this;\n\n // worker.onmessage = function(e) {\n\n // if (id == e.data.id) {\n // self.gudhub.itemProcessor.handleDiff(e.data.id, e.data.compareRes);\n // }\n\n // // worker.terminate();\n\n // // this.postMessage({id: e.data.id, compareRes: comparison});\n\n // // console.log('Data processed by worker:', e.data);\n // };\n\n // worker.onerror = function(e) {\n // // worker.terminate();\n\n // // console.error('Error in worker:', e);\n // };\n\n // return getFromDBPrms;\n }\n\n //TODO page isnt loaded when indexeddb empty. Investigate getApp in IndexedDBAppService here\n\n async getCached(id) {\n let self = this;\n let pr = new Promise(async (resolve, reject) => {\n try {\n const db = await self.openDatabase();\n const transaction = db.transaction(self.store, \"readonly\");\n const store = transaction.objectStore(self.store);\n const storeRequest = store.get(id);\n storeRequest.onsuccess = e => {\n let cachedData = e.target.result;\n if (!cachedData) {\n reject();\n }\n if (cachedData) {\n resolve(cachedData);\n }\n };\n storeRequest.onerror = reject;\n } catch (error) {\n reject();\n }\n });\n return pr;\n }\n async has(id) {\n try {\n let cached = await this.getCached(id);\n if (!cached) return false;\n return true;\n } catch (e) {\n //todo check error type and then rethrow maybe here\n\n return false;\n }\n }\n async putApp(id, data) {\n try {\n const db = await this.openDatabase();\n const transaction = db.transaction(this.store, \"readwrite\");\n const store = transaction.objectStore(this.store);\n store.put(data, id);\n } catch (error) {}\n }\n\n //todo openDatabase only once and then preserve it for further usage\n async openDatabase() {\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(this.dbName, this.dbVersion);\n request.onsuccess = event => {\n resolve(event.target.result);\n };\n request.onerror = event => {\n reject(event.target.error);\n };\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/appDataConf.js\n\nconst appsConf = {\n dbName: dbName,\n dbVersion: dbVersion,\n store: 'apps'\n};\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/init.js\n\n\n\n\nif (consts/* IS_WEB */.P) {\n const request = indexedDB.open(dbName, dbVersion);\n request.onupgradeneeded = event => {\n const db = event.target.result;\n for (let store of [appsConf.store, chunksConf.store]) {\n if (!db.objectStoreNames.contains(store)) {\n db.createObjectStore(store);\n }\n }\n };\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/export.js\n\n\n\n\n\n\n\n\n\nlet export_AppDataService;\nlet export_ChunkDataService;\nlet appDataServiceConf;\nlet chunkDataServiceConf;\nif (consts/* IS_WEB */.P && cache_chunk_requests) {\n export_ChunkDataService = IndexedDBChunkService;\n chunkDataServiceConf = chunksConf;\n} else {\n export_ChunkDataService = ChunkHttpService;\n}\nif (consts/* IS_WEB */.P && cache_app_requests) {\n export_AppDataService = IndexedDBAppService;\n appDataServiceConf = appsConf;\n} else {\n export_AppDataService = AppHttpService;\n}\n\n// EXTERNAL MODULE: ./node_modules/axios/index.js\nvar axios = __webpack_require__(9669);\n;// CONCATENATED MODULE: ./GUDHUB/utils.js\nfunction replaceSpecialCharacters(obj) {\n return JSON.stringify(obj).replace(/\\+|&|%/g, match => {\n switch (match) {\n case \"+\":\n return \"%2B\";\n case \"&\":\n return \"%26\";\n case \"%\":\n return \"%25\";\n }\n });\n}\n\n/*----------------------------- FILTERING ITEM's FIELDS BEFORE SENDING -------------------------*/\n\n/*-- Checking if some fields has null in field_value ( we don't send such fields )*/\nfunction filterFields(fieldsToFilter = []) {\n return fieldsToFilter.filter(field => field.field_value != null);\n}\nfunction convertObjToUrlParams(obj = {}) {\n const entries = Object.entries(obj);\n if (!entries.length) return \"\";\n return `&${entries.map(([key, value]) => `${key}=${value}`).join(\"&\")}`;\n}\n// EXTERNAL MODULE: ./node_modules/qs/lib/index.js\nvar lib = __webpack_require__(129);\n;// CONCATENATED MODULE: ./GUDHUB/gudhub-https-service.js\n//****************** GUDHUB HTTPS SERVICE ***********************//\n//-- This Service decorates each POST and GET request with Token\n//-- This Service take care of toking beeing always valid\n\n\n\n\nclass GudHubHttpsService {\n constructor(server_url) {\n this.root = server_url;\n this.requestPromises = [];\n }\n\n //****************** INITIALISATION **************//\n // Here we set a function to get token\n init(getToken) {\n this.getToken = getToken;\n }\n\n //********************* GET ***********************//\n async get(request) {\n const accessToken = await this.getToken();\n const hesh = this.getHashCode(request);\n if (this.requestPromises[hesh]) {\n return this.requestPromises[hesh].promise;\n }\n const promise = new Promise((resolve, reject) => {\n let url;\n if (request.externalResource) {\n url = request.url;\n } else {\n url = this.root + request.url;\n url = `${url}${/\\?/.test(url) ? \"&\" : \"?\"}token=${accessToken}${convertObjToUrlParams(request.params)}`;\n }\n axios.get(url, {\n validateStatus: function (status) {\n return status < 400; // Resolve only if the status code is less than 400\n }\n }).then(function (response) {\n if (response.status != 200) {\n console.error(`GUDHUB HTTP SERVICE: GET ERROR: ${response.status}`, response);\n }\n // handle success\n resolve(response.data);\n }).catch(function (err) {\n console.error(`GUDHUB HTTP SERVICE: GET ERROR: ${err.response.status}\\n`, err);\n console.log(\"Request message: \", request);\n if (err.response && err.response.data) {\n console.log('Error response data: ', err.response.data);\n }\n reject(err);\n });\n });\n this.pushPromise(promise, hesh);\n return promise;\n }\n\n //********************* POST ***********************//\n async post(request) {\n const hesh = this.getHashCode(request);\n request.form[\"token\"] = await this.getToken();\n if (this.requestPromises[hesh]) {\n return this.requestPromises[hesh].promise;\n }\n const promise = new Promise((resolve, reject) => {\n axios.post(this.root + request.url, lib.stringify(request.form), {\n maxBodyLength: Infinity,\n headers: request.headers || {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n validateStatus: function (status) {\n return status < 400; // Resolve only if the status code is less than 400\n }\n }).then(function (response) {\n if (response.status != 200) {\n console.error(`GUDHUB HTTP SERVICE: POST ERROR: ${response.status}`, response);\n }\n // handle success\n resolve(response.data);\n }).catch(function (error) {\n console.error(`GUDHUB HTTP SERVICE: POST ERROR: ${error.response.status}\\n`, error);\n console.log(\"Request message: \", request);\n reject(error);\n });\n });\n this.pushPromise(promise, hesh);\n return promise;\n }\n\n /*************** AXIOS REQUEST ***************/\n // It's using to send simple requests to custom urls without token\n // If you want to send application/x-www-form-urlencoded, pass data in 'form' property of request\n // If you wnt to send any other type of data, just pass it to 'body' property of request\n\n axiosRequest(request) {\n const hesh = this.getHashCode(request);\n if (this.requestPromises[hesh]) {\n return this.requestPromises[hesh].promise;\n }\n let method = request.method ? request.method.toLowerCase() : 'get';\n let url = request.url;\n let headers = request.headers || {};\n if (request.form) {\n headers['Content-Type'] = 'application/x-www-form-urlencoded';\n }\n const promise = new Promise(async (resolve, reject) => {\n try {\n const {\n data\n } = await axios[method](url, method === 'post' ? lib.stringify(request.form) || request.body : {\n headers\n }, method === 'post' ? {\n headers\n } : {});\n resolve(data);\n } catch (error) {\n console.log(\"ERROR -> GUDHUB HTTP SERVICE -> SIMPLE POST :\", error.message);\n console.log(\"Request message: \", request);\n reject(error);\n }\n });\n this.pushPromise(promise, hesh);\n return promise;\n }\n\n /*************** PUSH PROMISE ***************/\n // It push promise object by hash to this.requestPromises\n\n pushPromise(promise, hesh) {\n this.requestPromises[hesh] = {\n promise,\n hesh,\n callback: promise.then(() => {\n this.destroyPromise(hesh);\n }).catch(err => {\n this.destroyPromise(hesh);\n })\n };\n }\n\n /*************** DELETE PROMISE ***************/\n // It deletes promise from this.requestPromises by hash after promise resolve\n\n destroyPromise(hesh) {\n this.requestPromises = this.requestPromises.filter(request => request.hesh !== hesh);\n }\n\n //********************* GET HASH CODE ***********************//\n // it generates numeric identificator whish is the same for similar requests\n // HASH CODE is generated based on: request.params, request.url, request.form\n getHashCode(request) {\n let hash = 0;\n let str = lib.stringify(request);\n if (str.length == 0) return hash;\n for (let i = 0; i < str.length; i++) {\n let char = str.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash = hash & hash; // Convert to 32bit integer\n }\n\n return \"h\" + hash;\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/PipeService/utils.js\nfunction createId(obj) {\n let stringId = \"\";\n for (let key in obj) {\n if (obj.hasOwnProperty(key) && obj[key]) {\n stringId += \".\" + obj[key];\n }\n }\n return stringId ? stringId.substring(1) : \"any\";\n}\nfunction checkParams(type, destination, fn) {\n if (type == undefined || typeof type !== \"string\") {\n console.log(\"Listener type is \\\"undefined\\\" or not have actual 'type' for subscribe\");\n return false;\n }\n if (destination == undefined || typeof destination !== \"object\") {\n console.log(\"Listener destination is \\\"undefined\\\" or not have actual 'type' for subscribe\");\n return false;\n }\n if (typeof fn !== \"function\") {\n console.log(\"Listener is not a function for subscribe!\");\n return false;\n }\n return true;\n}\n;// CONCATENATED MODULE: ./GUDHUB/PipeService/PipeService.js\n/*============================================================================*/\n/*======================== PIPE MODULE ===============================*/\n/*============================================================================*/\n\n/*\n| ======================== PIPE EVENTS TYPES =================================\n|\n|\n| ---------------------------- APP EVENTS -----------------------------------\n| 'gh_app' - send event when element initialised\n| 'gh_app_info_get' - Return app_name, app_id, app_icon\n| 'gh_app_get' -\n| 'gh_app_update' -\n| 'gh_apps_list_get' -\n| 'gh_delete_app' -\n| 'gh_apps_list_update' -\n|\n| ---------------------------- VIEW EVENTS -----------------------------------\n| 'gh_app_views_update' -\n| 'gh_app_view_get' -\n| -------------------------- ITEM EVENTS ------------------------------------\n|\n| 'gh_items_get' - get items_list\n| 'gh_items_chunks_get' - get items splitted to chunks with specified chunk size\n| 'gh_items_update' - update items_list\n|\n| 'gh_item_update' - item's any field value update\n| 'gh_item_get' - item fields value get\n|\n| -------------------------- FIELD EVENTS -----------------------------------\n|\n| 'gh_model_get' - get field model in field_list.\n| 'gh_model_update' - update field model in field_list\n| 'gh_model_delete' - delete field model from field_list and from items\n|\n|\n|\n| 'gh_models_edit' - use in 'edit_template','edit_field' and 'edit_interpretation'\n| actions\n| 'gh_models_get' - get field_model list.\n|\n|\n|\n| 'gh_value_update' - update field value in item\n| 'gh_value_get' - get field value\n| 'gh_interpreted_value_get' - get field interpretation\n| 'gh_value_set' - setter of field value\n|\n*/\n\n\nclass PipeService {\n constructor() {\n this.subscribers = {};\n this.messageBox = {};\n }\n\n //============================== ON PIPE ====================================//\n /*----------------------------------------------------------------------------\n | Params:\n | 'type' - String (require). type of event ('gh_field_update', ........)\n | from event list or maybe 'gh_field_update gh_field_value_update'\n | 'destination' - Object (require).\n | {\n | app_id: '',\n | item_id: ''\n | field_id: ''\n | }\n | 'fn' - Function (require). callback function\n | 'scope' - Scope\n |------------------------------------------------------------------------------*/\n\n on(types, destination, fn) {\n if (checkParams(types, destination, fn)) {\n types.split(\" \").map(type => {\n return type + \":\" + createId(destination);\n }).forEach(typeWithId => {\n if (!this.subscribers[typeWithId]) {\n this.subscribers[typeWithId] = new Set();\n }\n this.subscribers[typeWithId].add(fn);\n\n //checking for messeges those were sent before subscription created\n this.checkMessageBox(typeWithId);\n });\n }\n return this;\n }\n\n //============================== EMIT PIPE ====================================//\n /*------------------------------------------------------------------------------\n | Params:\n | 'type' - String (require). type of event ('gh_field_update', ........)\n | from eventlist\n | 'destination' - Object (require).\n | {\n | app_id: '',\n | item_id: ''\n | field_id: ''\n | }\n | 'value' - Any (require). Emiter value to subscribers\n |-------------------------------------------------------------------------------*/\n\n emit(types, destination, value, params) {\n types.split(\" \").forEach(type => {\n const listenerName = type + \":\" + createId(destination);\n let toBeRemovedState = false;\n if (this.subscribers[listenerName]) {\n // if subscribers list is empty we put message to messageBox\n if (this.subscribers[listenerName].size == 0) {\n this.messageBox[listenerName] = [types, destination, value, params, toBeRemovedState];\n return this;\n }\n\n // sending messege to subscribers\n this.subscribers[listenerName].forEach(function (fn) {\n fn(null, value, params);\n });\n } else {\n // if there no subscribers list we put message to messageBox\n this.messageBox[listenerName] = [types, destination, value, params, toBeRemovedState];\n }\n });\n return this;\n }\n\n //============================== ON ROOT PIPE ====================================//\n /*---------------------------------------------------------------------------------\n | Params:\n | 'type' - String (require). type of event ('gh_field_update', ........)\n | from event list or maybe 'gh_field_update gh_field_value_update'\n | 'destination' - Object (require).\n | {\n | app_id: '',\n | item_id: ''\n | field_id: ''\n | }\n | 'fn' - Function (require). callback function\n |---------------------------------------------------------------------------------*/\n\n onRoot(type, destination, fn) {\n return this.on(type, destination, fn);\n }\n\n //=========================== DELETE LISTENER =================================//\n /*-------------------------------------------------------------------------------\n | Params:\n | 'type' - String (require). type of event ('gh_field_update', ........)\n | from eventlist\n | 'destination' - Object (require).\n | {\n | app_id: '',\n | item_id: ''\n | field_id: ''\n | }\n |--------------------------------------------------------------------------------*/\n\n destroy(types, destination, func) {\n types.split(\" \").forEach(type => {\n const listenerName = type + \":\" + createId(destination);\n\n //if we pass a function then we remove just function in subscriber property\n if (this.subscribers[listenerName] && func) {\n this.subscribers[listenerName].delete(func);\n }\n\n //if we are not passing a function then we remove a subscriber property\n if (this.subscribers[listenerName] && !func) {\n delete this.subscribers[listenerName];\n }\n });\n return this;\n }\n\n //============================== MESSAGE BOX ====================================//\n /*---------------------------------------------------------------------------------\n | If emitting event started erlier then subscriber apears then we save it to the MessageBox\n | After subscriber is created we update check MessageBox for encomming messendges\n |\n |---------------------------------------------------------------------------------*/\n\n checkMessageBox(listenerName) {\n //Here we delete all messages those are marked as \"to be removed\"\n this.cleanMesssageBox();\n if (this.messageBox[listenerName]) {\n //-- Emiting messages from the MessageBox\n //We use timeout to emit message after subscriber is created\n setTimeout(() => {\n if (this.messageBox[listenerName]) {\n this.emit(...this.messageBox[listenerName]);\n\n //we mark message after it was readed as \"to be removed\" to remove it in next itration \n this.messageBox[listenerName][4] = true;\n }\n }, 0);\n }\n }\n\n /*-------- CLEAN MESSAGE BOX -----------*/\n // This method delete all messages those are marked as \"to be deleted\"\n // The thing is that we can't remove message in the same iteration that is wy we mark them as \"to be removed\n // and then will remove them in the second iteration just before checking the MessageBox\n cleanMesssageBox() {\n for (let listenerName in this.messageBox) {\n if (this.messageBox[listenerName][4]) {\n delete this.messageBox[listenerName];\n }\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Storage/ModulesList.js\nfunction generateModulesList(async_modules_path, file_server_url, automation_modules_path) {\n return [/* GH ELEMENTS */\n {\n data_type: \"text\",\n name: \"Text\",\n icon: \"text_icon\",\n url: file_server_url + '/' + async_modules_path + \"text_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"text_opt\",\n name: \"Options\",\n icon: \"option_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"text_options_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"number\",\n name: \"Number\",\n icon: \"number\",\n url: file_server_url + '/' + async_modules_path + \"number_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"task_board\",\n name: \"Task Board\",\n icon: \"task_board\",\n url: file_server_url + '/' + async_modules_path + \"task_board_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"visualizer\",\n name: \"visualizer\",\n icon: 'visualizer',\n url: file_server_url + '/' + async_modules_path + \"visualizer_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"enterprice_visualizer\",\n name: \"Enterprice Visualizer\",\n icon: \"visualizer\",\n private: true,\n url: file_server_url + '/' + async_modules_path + \"enterprice_visualizer_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"email\",\n name: \"Email\",\n icon: \"email\",\n url: file_server_url + '/' + async_modules_path + \"email_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'date',\n name: \"Date\",\n icon: \"date_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"date_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'radio_button',\n name: \"Radio Button\",\n icon: \"radio_button_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"radio_button_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'radio_icon',\n name: \"Radio icon\",\n icon: \"radio_icon_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"radio_icon_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'twilio_phone',\n name: \"Twilio Phone\",\n icon: \"phone_twilio_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"twilio_phone_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"twilio_autodialer\",\n name: \"Twilio Auto Dialer\",\n icon: \"twilio_dialer\",\n url: file_server_url + '/' + async_modules_path + \"twillio_autodialer_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"color\",\n name: \"Color\",\n icon: \"paint_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"color_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"charts\",\n name: \"Charts\",\n icon: \"graph_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"charts_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'funnel_chart',\n name: \"Funnel chart\",\n icon: \"funnel_chart_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"funnel_chart_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"add_items_from_template\",\n name: \"Add items from template\",\n icon: \"contact_second\",\n url: file_server_url + '/' + async_modules_path + \"add_items_from_template_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"item_ref\",\n name: \"Reference\",\n icon: \"reference\",\n url: file_server_url + '/' + async_modules_path + \"itemRef_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"calendar\",\n name: 'Calendar',\n icon: 'calendar',\n js: 'https://gudhub.com/modules/FullCalendar-Gh-Element/dist/main.js?t=4',\n css: 'https://gudhub.com/modules/FullCalendar-Gh-Element/dist/style.css?t=1',\n type: 'gh_element',\n technology: \"class\"\n }, {\n data_type: \"data_ref\",\n name: 'Data Reference',\n icon: 'data_reference',\n url: file_server_url + '/' + async_modules_path + \"data_ref_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"table\",\n name: 'Table',\n icon: 'table',\n url: file_server_url + '/' + async_modules_path + \"table_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"tile\",\n name: 'Tile table',\n icon: 'tile_table',\n url: file_server_url + '/' + async_modules_path + \"tile_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"file\",\n name: 'File',\n icon: 'box',\n url: file_server_url + '/' + async_modules_path + \"file_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"image\",\n name: 'Image',\n icon: 'image',\n url: file_server_url + '/' + async_modules_path + \"image_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"text_editor\",\n name: 'Text Editor',\n icon: 'square',\n url: file_server_url + '/' + async_modules_path + \"text_editor_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"tinymse\",\n name: 'Text editor MSE',\n icon: 'tag',\n url: file_server_url + '/' + async_modules_path + \"tinymse_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"duration\",\n name: 'Duration',\n icon: 'number_gh_element',\n url: file_server_url + '/' + async_modules_path + \"duration_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"user\",\n name: 'User',\n icon: 'user_gh_element',\n url: file_server_url + '/' + async_modules_path + \"user_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"app\",\n name: 'App',\n icon: 'app',\n url: file_server_url + '/' + async_modules_path + \"application_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"field\",\n name: 'Field',\n icon: 'field_gh_element',\n url: file_server_url + '/' + async_modules_path + \"field_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"available\",\n name: 'Available',\n icon: 'availible_gh_element',\n url: file_server_url + '/' + async_modules_path + \"available_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"view_list\",\n name: 'View List',\n icon: 'view_list',\n url: file_server_url + '/' + async_modules_path + \"view_list_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"calculator\",\n name: 'Calculator',\n icon: 'calculator',\n url: file_server_url + '/' + async_modules_path + \"calculator_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"string_join\",\n name: 'String Joiner',\n icon: 'string_join_gh_element',\n url: file_server_url + '/' + async_modules_path + \"string_joiner_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"signature\",\n name: 'Signature',\n icon: 'signature',\n url: file_server_url + '/' + async_modules_path + \"signature_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"sendEmail\",\n name: 'Send Email',\n icon: 'send_email_gh_element',\n url: file_server_url + '/' + async_modules_path + \"send_email_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"boolean\",\n name: 'Yes/No',\n icon: 'boolen_gh_element',\n url: file_server_url + '/' + async_modules_path + \"boolean_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"product_gallery\",\n name: 'Product gallery',\n icon: 'product_gallery',\n url: file_server_url + '/' + async_modules_path + \"product_gallery_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"online_inventory\",\n name: 'Online inventory',\n icon: 'slab',\n url: file_server_url + '/' + async_modules_path + \"online_inventory_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"3d_edges\",\n name: '3D Edges',\n icon: '3d_edges_gh_element',\n url: file_server_url + '/' + async_modules_path + \"3d_edges_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"color_list\",\n name: 'Color list',\n icon: 'circular_gh_element',\n url: file_server_url + '/' + async_modules_path + \"color_list_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"go_to_link\",\n name: 'Go to Link',\n icon: 'go_to_link',\n url: file_server_url + '/' + async_modules_path + \"go_to_link_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"go_to_view\",\n name: 'Go to View',\n icon: 'go_to_view',\n url: file_server_url + '/' + async_modules_path + \"go_to_view_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"range\",\n name: 'Range',\n icon: 'range_gh_element',\n url: file_server_url + '/' + async_modules_path + \"range_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"barcode\",\n name: 'Barcode',\n icon: 'barcode_gh_element',\n url: file_server_url + '/' + async_modules_path + \"barcode_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"item_remote_add\",\n name: 'Item remote add',\n icon: 'remote_add_gh_element',\n url: file_server_url + '/' + async_modules_path + \"item_remote_add_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"item_remote_update\",\n name: 'Item remote update',\n icon: 'remote_update_gh_element',\n url: file_server_url + '/' + async_modules_path + \"item_remote_update_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"timeline\",\n name: 'Timeline',\n icon: 'timeline',\n url: file_server_url + '/' + async_modules_path + \"timeline_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"delete_item\",\n name: 'Delete Item',\n icon: 'rubbish',\n url: file_server_url + '/' + async_modules_path + \"delete_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"print_doc\",\n name: 'Print document',\n icon: 'print',\n url: file_server_url + '/' + async_modules_path + \"print_doc_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"open_item\",\n name: 'Open Item',\n icon: 'delete',\n private: true,\n url: file_server_url + '/' + async_modules_path + \"open_item_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"edit_template\",\n name: \"Edit template\",\n icon: \"delete\",\n private: true,\n url: file_server_url + '/' + async_modules_path + \"edit_template_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"open_app\",\n private: true,\n name: 'Open App',\n icon: 'delete',\n url: file_server_url + '/' + async_modules_path + \"open_app_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"user_settings\",\n private: true,\n name: 'User Settings',\n icon: 'delete',\n url: file_server_url + '/' + async_modules_path + \"user_settings_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"app_sharing\",\n name: 'Sharing',\n icon: 'sharing',\n url: file_server_url + '/' + async_modules_path + \"sharing_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"app_constructor\",\n private: true,\n name: 'App constructor',\n icon: 'app_constructor',\n url: file_server_url + '/' + async_modules_path + \"app_constructor_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"app_settings\",\n name: 'App Settings',\n icon: 'configuration',\n url: file_server_url + '/' + async_modules_path + \"app_settings_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"export_csv\",\n name: 'Export CSV',\n icon: 'export_csv',\n url: file_server_url + '/' + async_modules_path + \"export_csv.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"import_csv\",\n name: \"Import CSV\",\n icon: \"import_csv\",\n url: file_server_url + '/' + async_modules_path + \"import_csv.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"add_items\",\n name: 'Add Items',\n icon: 'plus',\n url: file_server_url + '/' + async_modules_path + \"add_items_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"update_items\",\n name: 'Update Items',\n icon: 'update',\n url: file_server_url + '/' + async_modules_path + \"update_items_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"install_app\",\n name: 'Install',\n icon: 'install',\n url: file_server_url + '/' + async_modules_path + \"install_app_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"search_action\",\n name: 'Search',\n icon: 'search',\n url: file_server_url + '/' + async_modules_path + \"search_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"filter_table\",\n name: 'Table filter',\n icon: 'filter',\n url: file_server_url + '/' + async_modules_path + \"filter_table_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"slider\",\n name: 'Slider',\n icon: 'slider',\n url: file_server_url + '/' + async_modules_path + \"slider_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"clone_item\",\n name: 'Clone Item',\n icon: 'double_plus',\n url: file_server_url + '/' + async_modules_path + \"clone_item_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"close\",\n name: 'Close',\n icon: 'cross',\n url: file_server_url + '/' + async_modules_path + \"close_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"phone\",\n name: 'Phone',\n icon: 'phone_thin',\n url: file_server_url + '/' + async_modules_path + \"phone_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"link\",\n name: 'Link',\n icon: 'link_gh_element',\n url: file_server_url + '/' + async_modules_path + \"link_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"sheduling\",\n name: 'Sheduling',\n icon: 'scheduling',\n url: file_server_url + '/' + async_modules_path + \"sheduling_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"qrcode\",\n name: 'QR Code',\n icon: 'qr_code',\n url: file_server_url + '/' + async_modules_path + \"qrcode_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"graph2d\",\n name: 'Graph',\n icon: 'graph',\n url: file_server_url + '/' + async_modules_path + \"graph2d_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"quote_tool\",\n name: 'Quote tool',\n icon: 'quoters',\n url: file_server_url + '/' + async_modules_path + \"quote_tool_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"cards\",\n name: 'Cards',\n icon: 'cards',\n url: file_server_url + '/' + async_modules_path + \"cards_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"jsonConstructor\",\n name: 'Json Constructor',\n icon: 'button',\n url: file_server_url + '/' + async_modules_path + \"json_constructor_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"button\",\n name: 'Button',\n icon: 'button',\n js: \"https://gudhub.com/modules/button_action/button_action.js?t=1\",\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: \"editorjs\",\n name: 'EditorJS',\n icon: 'code_editor',\n js: \"https://gudhub.com/modules/Editor-Js/dist/main.js?t=2\",\n css: \"https://gudhub.com/modules/Editor-Js/dist/style.css?t=2\",\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: \"filter_advanced\",\n name: 'Filter Advanced',\n icon: 'filter_advanced',\n url: file_server_url + '/' + async_modules_path + \"filter_advanced_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"code_editor\",\n name: 'Code Editor',\n icon: 'code_editor',\n url: file_server_url + '/' + async_modules_path + \"code_editor_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"icon\",\n name: 'Icon',\n icon: 'icon_gh_element',\n url: file_server_url + '/' + async_modules_path + \"icon_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"quoteRequest\",\n name: 'Quote Request',\n icon: 'invoices',\n url: file_server_url + '/' + async_modules_path + \"quote_request_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"view_container\",\n name: 'View Container',\n icon: 'pencil',\n url: file_server_url + '/' + async_modules_path + \"view_container_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"element_ref\",\n name: \"Element Reference\",\n icon: \"cloudSync_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"element_ref_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"quote_tool_objects_renderer\",\n name: 'Quote Tool Renderer',\n icon: 'l_counter',\n url: file_server_url + '/' + async_modules_path + \"quote_tool_objects_renderer_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"quote_tool_objects_renderer_generator\",\n name: 'Quote Tool Parts Generator',\n icon: 'l_counter_arrow',\n url: file_server_url + '/' + async_modules_path + \"quote_tool_objects_renderer_generator_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"trigger\",\n name: 'Trigger',\n icon: 'job',\n url: file_server_url + '/' + async_modules_path + \"trigger_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"voting\",\n name: 'Voting',\n icon: 'like_gh_element',\n url: file_server_url + '/' + async_modules_path + \"voting_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"view_tabs\",\n name: \"View Tab\",\n icon: \"tabs\",\n url: file_server_url + '/' + async_modules_path + \"view_tabs.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"filter_tabs\",\n name: \"Filter Tabs\",\n icon: \"filter_tabs_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"filter_tabs.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"gps_coords\",\n name: 'GPS Coords',\n icon: 'location_gh_element',\n url: file_server_url + '/' + async_modules_path + \"gps_coords.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"google_map\",\n name: 'Google Map',\n icon: 'location',\n url: file_server_url + '/' + async_modules_path + \"google_map_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"data_migrations\",\n name: \"Data migrations\",\n icon: \"view_list_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"data_migrations.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"additional_settings\",\n name: \"Additional Settings\",\n icon: \"\",\n private: true,\n url: file_server_url + '/' + async_modules_path + \"gh_additional_settings_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"send_request\",\n name: \"Send Request\",\n icon: \"send_request_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"send_request_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"webcam\",\n name: \"Web camera\",\n icon: \"webcam_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"webcam_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"json_viewer\",\n name: \"JSON viewer\",\n icon: \"json_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"json_viewer_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"notifications\",\n name: \"Notifications\",\n icon: \"full_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"notifications_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"api\",\n name: \"API\",\n icon: \"job\",\n url: file_server_url + '/' + async_modules_path + \"api_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"smart_input\",\n name: \"Smart Input\",\n icon: \"roket\",\n url: file_server_url + '/' + async_modules_path + \"smart_input_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"json_editor\",\n name: \"JSON Editor\",\n icon: \"code\",\n url: file_server_url + '/' + async_modules_path + \"json_editor_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"grapes_html_editor\",\n name: 'Grapes Html Editor',\n icon: 'code_editor',\n url: file_server_url + '/' + async_modules_path + \"grapes_html_editor_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"quiz\",\n name: 'Quiz',\n icon: 'quiz_gh_element',\n url: file_server_url + '/' + async_modules_path + \"quiz_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"password_input\",\n name: \"Password\",\n icon: \"lock_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"password_input_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"vs_code\",\n name: 'VS Code',\n icon: 'code_editor',\n url: file_server_url + '/' + async_modules_path + \"vs_code_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"nested_list\",\n name: 'Nested List',\n icon: 'scheduling',\n js: \"https://gudhub.com/modules/Nested-List/dist/main.js?t=2\",\n css: \"https://gudhub.com/modules/Nested-List/dist/style.css?t=2\",\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: \"countertop_smart_quote\",\n name: 'Countertop Smart Quote',\n icon: 'quoters',\n url: file_server_url + '/' + async_modules_path + \"countertop_smart_quote_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"markdown_viewer\",\n name: 'Markdown viewer',\n icon: 'code_editor',\n js: \"https://gudhub.com/modules/markdown-it-gh-element/dist/main.js?t=1\",\n css: \"https://gudhub.com/modules/markdown-it-gh-element/dist/style.css?t=1\",\n type: 'gh_element',\n technology: \"class\"\n }, {\n data_type: \"html_viewer\",\n name: 'HTML Viewer',\n icon: 'code_editor',\n js: \"https://gudhub.com/modules/HTML-Viewer/dist/main.js?t=1\",\n css: \"https://gudhub.com/modules/HTML-Viewer/dist/style.css?t=1\",\n type: 'gh_element',\n technology: \"class\"\n }, {\n data_type: \"element_customizer\",\n name: \"Element Customizer\",\n icon: \"pencil\",\n url: file_server_url + '/' + async_modules_path + \"element_customizer_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'task',\n name: 'Task',\n icon: 'table',\n url: file_server_url + '/' + async_modules_path + 'task_data.js',\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'cron_picker',\n name: 'Cron Picker',\n icon: 'table',\n js: 'https://gudhub.com/modules/Cron-Picker/dist/main.js?t=2',\n css: 'https://gudhub.com/modules/Cron-Picker/dist/style.css?t=2',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'balance_sheet',\n name: 'Balance Sheet',\n icon: 'table',\n js: 'https://gudhub.com/modules/balance-sheet/dist/main.js?t=2',\n css: 'https://gudhub.com/modules/balance-sheet/dist/style.css?t=2',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'quote_form',\n name: 'Quote Form',\n icon: 'table',\n js: 'https://gudhub.com/modules/countertop-quote-form/dist/main.js',\n css: 'https://gudhub.com/modules/countertop-quote-form/dist/style.css',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'static_nested_list',\n name: 'Nested Filter',\n icon: 'scheduling',\n js: 'https://gudhub.com/modules/nested-filter/dist/main.js?t=1',\n css: 'https://gudhub.com/modules/nested-filter/dist/style.css?t=1',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'conversations',\n name: 'Conversations',\n icon: 'timeline',\n js: 'https://gudhub.com/modules/conversation/dist/main.js?t=1',\n css: 'https://gudhub.com/modules/conversation/dist/style.css?t=1',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'study_journal',\n name: 'Study Journal',\n icon: 'timeline',\n js: 'https://gudhub.com/modules/Study-Journal/dist/main.js',\n css: 'https://gudhub.com/modules/Study-Journal/dist/style.css',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'study_schedule',\n name: 'Study Schedule',\n icon: 'timeline',\n js: 'https://gudhub.com/modules/Study-Schedule/dist/main.js?t=1',\n css: 'https://gudhub.com/modules/Study-Schedule/dist/style.css?t=1',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'avatar',\n name: 'Avatar',\n icon: 'user',\n js: 'https://gudhub.com/modules/Gh-Avatar/dist/main.js?t=1',\n css: 'https://gudhub.com/modules/Gh-Avatar/dist/style.css?t=1',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: \"text_area\",\n name: \"Text Area\",\n icon: \"text_icon\",\n js: \"https://gudhub.com/modules/text-area-ghe/dist/main.js?t=1\",\n css: \"https://gudhub.com/modules/text-area-ghe/dist/style.css\",\n type: \"gh_element\",\n technology: \"class\"\n }, /* AUTOMATION MODULES */\n /*\n We have next types for automations:\n - API\n - GhElement\n - Quiz\n - SmartInput\n - Trigger\n - Task\n - Iterator\n */\n {\n data_type: 'API',\n name: 'API',\n url: file_server_url + '/' + automation_modules_path + 'api_node.js',\n type: 'automation',\n icon: 'automation_api',\n private: true\n }, {\n data_type: 'Calculator',\n name: 'Calculator',\n url: file_server_url + '/' + automation_modules_path + 'calculator.js',\n type: 'automation',\n icon: 'automation_calculator'\n }, {\n data_type: 'CompareItems',\n name: 'Compare Items',\n url: file_server_url + '/' + automation_modules_path + 'compare_items.js',\n type: 'automation',\n icon: 'automation_compare_items'\n }, {\n data_type: 'Constants',\n name: 'Constants',\n url: file_server_url + '/' + automation_modules_path + 'constants.js',\n type: 'automation',\n icon: 'automation_constants'\n }, {\n data_type: 'CreateFiles',\n name: 'Create Files',\n url: file_server_url + '/' + automation_modules_path + 'create_files.js',\n type: 'automation',\n icon: 'automation_create_files'\n }, {\n data_type: 'CreateItemsApi',\n name: 'Create Items Api',\n url: file_server_url + '/' + automation_modules_path + 'create_item_api.js',\n type: 'automation',\n icon: 'automation_create_items_api'\n }, {\n data_type: 'FileDuplicate',\n name: 'File Duplicate',\n url: file_server_url + '/' + automation_modules_path + 'file_duplicate.js',\n type: 'automation',\n icon: 'automation_file_duplicate'\n }, {\n data_type: 'Filter',\n name: 'Filter',\n url: file_server_url + '/' + automation_modules_path + 'filter_node.js',\n type: 'automation',\n icon: 'filter'\n }, {\n data_type: 'GetItemByItemRef',\n name: 'Get Item By Item Ref',\n url: file_server_url + '/' + automation_modules_path + 'get_item_by_item_ref.js',\n type: 'automation',\n icon: 'automation_get_item_by_item_ref'\n }, {\n data_type: 'GetItems',\n name: 'Get Items',\n url: file_server_url + '/' + automation_modules_path + 'get_items.js',\n type: 'automation',\n icon: 'automation_get_items'\n }, {\n data_type: 'GhElementNode',\n name: 'Gh Element Node',\n url: file_server_url + '/' + automation_modules_path + 'gh_element_node.js',\n type: 'automation',\n icon: 'automation_gh_element_node',\n private: true,\n created_for: ['GhElement']\n }, {\n data_type: 'IfCondition',\n name: 'If Condition',\n url: file_server_url + '/' + automation_modules_path + 'if_condition.js',\n type: 'automation',\n icon: 'automation_if_condition'\n }, {\n data_type: 'ItemConstructor',\n name: 'Item Constructor',\n url: file_server_url + '/' + automation_modules_path + 'item_constructor.js',\n type: 'automation',\n icon: 'automation_item_constructor'\n }, {\n data_type: 'ItemDestructor',\n name: 'Item Destructor',\n url: file_server_url + '/' + automation_modules_path + 'item_destructor.js',\n type: 'automation',\n icon: 'automation_item_destructor'\n }, {\n data_type: 'JSONScheme',\n name: 'JSON Scheme',\n url: file_server_url + '/' + automation_modules_path + 'json_scheme.js',\n type: 'automation',\n icon: 'automation_json_scheme'\n }, {\n data_type: 'MergeItems',\n name: 'Merge Items',\n url: file_server_url + '/' + automation_modules_path + 'merge_items.js',\n type: 'automation',\n icon: 'automation_merge_items'\n }, {\n data_type: 'MessageConstructor',\n name: 'Message Constructor',\n url: file_server_url + '/' + automation_modules_path + 'message_constructor.js',\n type: 'automation',\n icon: 'automation_message_constructor'\n }, {\n data_type: 'ObjectToItem',\n name: 'Object To Item',\n url: file_server_url + '/' + automation_modules_path + 'obj_to_item.js',\n type: 'automation',\n icon: 'automation_object_to_item'\n }, {\n data_type: 'ObjectConstructor',\n name: 'Object Constructor',\n url: file_server_url + '/' + automation_modules_path + 'object_constructor.js',\n type: 'automation',\n icon: 'automation_object_constructor'\n }, {\n data_type: 'ObjectDestructor',\n name: 'Object Destructor',\n url: file_server_url + '/' + automation_modules_path + 'object_destructor.js',\n type: 'automation',\n icon: 'automation_object_destructor'\n }, {\n data_type: 'PopulateElement',\n // Available for GH Elements only\n name: 'Populate Element',\n url: file_server_url + '/' + automation_modules_path + 'populate_element.js',\n type: 'automation',\n icon: 'automation_populate_element',\n private: true,\n created_for: ['GhElement']\n }, {\n data_type: 'PopulateItems',\n name: 'Populate Items',\n url: file_server_url + '/' + automation_modules_path + 'populate_items.js',\n type: 'automation',\n icon: 'automation_populate_items'\n }, {\n data_type: 'PopulateWithDate',\n name: 'Populate With Date',\n url: file_server_url + '/' + automation_modules_path + 'populate_with_date.js',\n type: 'automation',\n icon: 'automation_populate_with_date'\n }, {\n data_type: 'PopulateWithItemRef',\n name: 'Populate with Item Ref',\n url: file_server_url + '/' + automation_modules_path + 'populate_with_item_ref.js',\n type: 'automation',\n icon: 'automation_populate_with_item_ref'\n }, {\n data_type: 'PopUpForm',\n // Available for Quiz Node, GH Element, Smart Input\n name: 'Pop Up Form',\n url: file_server_url + '/' + automation_modules_path + 'popup_form.js',\n type: 'automation',\n icon: 'automation_pop_up_form',\n private: true,\n created_for: ['Quiz', 'GhElement', 'SmartInput', 'Iterator']\n }, {\n data_type: 'QuizForm',\n // Available for Quiz Node only\n name: 'Quiz Form',\n url: file_server_url + '/' + automation_modules_path + 'quiz_form.js',\n type: 'automation',\n icon: 'automation_quiz_form',\n private: true,\n created_for: ['Quiz']\n }, {\n data_type: 'QuizNode',\n name: 'Quiz Node',\n url: file_server_url + '/' + automation_modules_path + 'quiz_node.js',\n type: 'automation',\n icon: 'automation_quiz_node',\n private: true\n }, {\n data_type: 'Request',\n name: 'Request',\n url: file_server_url + '/' + automation_modules_path + 'request_node.js',\n type: 'automation',\n icon: 'automation_request'\n }, {\n data_type: 'Response',\n // Available for API only\n name: 'Response',\n url: file_server_url + '/' + automation_modules_path + 'response_node.js',\n type: 'automation',\n icon: 'automation_response',\n private: true,\n created_for: ['API']\n }, {\n data_type: 'SmartInput',\n name: 'Smart Input',\n url: file_server_url + '/' + automation_modules_path + 'smart_input.js',\n type: 'automation',\n icon: 'automation_smart_input',\n private: true\n }, {\n data_type: 'Trigger',\n name: 'Trigger',\n url: file_server_url + '/' + automation_modules_path + 'trigger_node.js',\n type: 'automation',\n icon: 'automation_trigger',\n private: true\n }, {\n data_type: 'TwilioSMS',\n name: 'Twilio SMS',\n url: file_server_url + '/' + automation_modules_path + 'twilio_sms.js',\n type: 'automation',\n icon: 'automation_twilio'\n }, {\n data_type: 'TwilioAuth',\n name: 'Twilio Auth',\n url: file_server_url + '/' + automation_modules_path + 'twilio_auth.js',\n type: 'automation',\n icon: 'table'\n }, {\n data_type: 'TwilioDevice',\n name: 'Twilio Device',\n url: file_server_url + '/' + automation_modules_path + 'twilio_device.js',\n type: 'automation',\n icon: 'table'\n }, {\n data_type: 'UpdateItemsApi',\n name: 'Update Items Api',\n url: file_server_url + '/' + automation_modules_path + 'update_items_api.js',\n type: 'automation',\n icon: 'automation_update_items_api'\n }, {\n data_type: 'GoogleCalendar',\n name: 'Google Calendar',\n url: file_server_url + '/' + automation_modules_path + 'google_calendar.js',\n type: 'automation',\n icon: 'calendar'\n }, {\n data_type: 'VerifyEmail',\n name: 'Verify email',\n url: file_server_url + '/' + automation_modules_path + 'verify_email.js',\n type: 'automation',\n icon: 'check_in_circle'\n }, {\n data_type: 'Iterator',\n name: 'Iterator',\n url: file_server_url + '/' + automation_modules_path + 'iterator.js',\n type: 'automation',\n icon: 'update'\n }, {\n data_type: 'IteratorInput',\n name: 'Iterator Input',\n url: file_server_url + '/' + automation_modules_path + 'iterator_input.js',\n type: 'automation',\n icon: 'arrow_right',\n private: true\n }, {\n data_type: 'IteratorOutput',\n name: 'Iterator Output',\n url: file_server_url + '/' + automation_modules_path + 'iterator_output.js',\n type: 'automation',\n icon: 'arrow_right',\n private: true\n }, {\n data_type: 'SendEmail',\n name: 'Send email',\n url: file_server_url + '/' + automation_modules_path + 'send_email.js',\n type: 'automation',\n icon: 'email'\n }, {\n data_type: 'FileReader',\n name: 'File Reader',\n url: file_server_url + '/' + automation_modules_path + 'file_reader.js',\n type: 'automation',\n icon: 'file'\n }, {\n data_type: 'WebsitesChecker',\n name: 'Websites Checker',\n url: file_server_url + '/' + automation_modules_path + 'websites_checker.js',\n type: 'automation',\n icon: 'world'\n }, {\n data_type: 'VoiceMachineDetection',\n name: 'Voice Machine Detection',\n url: file_server_url + '/' + automation_modules_path + 'voice_machine_detection.js',\n type: 'automation',\n icon: 'automation_calculator'\n }, {\n data_type: 'Task',\n name: 'Task',\n url: file_server_url + '/' + automation_modules_path + 'task.js',\n type: 'automation',\n icon: 'automation_calculator',\n private: true\n }, {\n data_type: 'DeleteItems',\n name: 'Delete Items',\n url: file_server_url + '/' + automation_modules_path + 'delete_items.js',\n type: 'automation',\n icon: 'rubbish'\n }, {\n data_type: 'GoToItem',\n name: 'Go To Item',\n url: file_server_url + '/' + automation_modules_path + 'go_to_item.js',\n type: 'automation',\n icon: 'cursor_point'\n }, {\n data_type: 'FireWorks',\n name: 'Fire Works',\n url: file_server_url + '/' + automation_modules_path + 'fireworks_node.js',\n type: 'automation',\n icon: 'weeding_party'\n }, {\n data_type: 'SendMessage',\n name: 'Send Message',\n url: file_server_url + '/' + automation_modules_path + 'send_message.js',\n type: 'automation',\n icon: 'speech_bubble'\n }, {\n data_type: 'TurboSMS',\n name: 'Turbo SMS',\n url: file_server_url + '/' + automation_modules_path + 'turbo_sms.js',\n type: 'automation',\n icon: 'email'\n }];\n}\n;// CONCATENATED MODULE: ./GUDHUB/Storage/Storage.js\n\nclass Storage {\n constructor(async_modules_path, file_server_url, automation_modules_path) {\n this.apps_list = [];\n this.users_list = [];\n this.user = {};\n this.modulesList = generateModulesList(async_modules_path, file_server_url, automation_modules_path);\n this.ghComponentsPromises = [];\n }\n getMainStorage() {\n return this;\n }\n getAppsList() {\n return this.apps_list;\n }\n getUser() {\n return this.user;\n }\n getUsersList() {\n return this.users_list;\n }\n getModulesList(type, isPrivate, createdFor) {\n if (typeof type === 'undefined') {\n return this.modulesList;\n } else if (isPrivate == false) {\n return this.modulesList.filter(module => {\n if (module.created_for) {\n return module.type === type && module.private && module.created_for.includes(createdFor);\n }\n return module.type === type && !module.private;\n });\n } else {\n return this.modulesList.filter(module => {\n return module.type === type;\n });\n }\n }\n getModuleUrl(module_id) {\n return this.modulesList.find(module => module.data_type == module_id);\n }\n\n //!!!!!!!!!!!!!!******** All Methods below should be moved to AppProcesor and Auth **********!!!!!!!!!!!!!!!!//\n setUser(user) {\n this.user = user;\n this.users_list.push(user);\n }\n updateUser(user = {}) {\n if (user.avatar_128) {\n user.avatar_128 = user.avatar_128 + \"?\" + new Date().getTime();\n }\n if (user.avatar_512) {\n user.avatar_512 = user.avatar_512 + \"?\" + new Date().getTime();\n }\n this.user = {\n ...this.user,\n ...user\n };\n this.users_list = this.users_list.filter(oldUser => oldUser.user_id != user.user_id);\n this.users_list.push(this.user);\n }\n unsetUser() {\n this.user = {};\n }\n getApp(app_id) {\n for (let i = 0; i < this.apps_list.length; i++) {\n if (this.apps_list[i].app_id == app_id) {\n return this.apps_list[i];\n }\n }\n }\n unsetApps() {\n this.apps_list = [];\n }\n\n // addApp(app) {\n // this.apps_list.push(app);\n // return this.apps_list;\n // }\n\n updateApp(newApp) {\n this.apps_list = this.apps_list.map(app => app.app_id == newApp.app_id ? newApp : app);\n return this.apps_list;\n }\n deleteApp(app_id) {\n this.apps_list = this.apps_list.filter(app => app.app_id != app_id);\n return this.apps_list;\n }\n async updateItemsInApp(itemsToUpdate, app_id) {\n const appToUpdate = await this.getApp(app_id);\n if (appToUpdate) {\n appToUpdate.items_list = updateItems(itemsToUpdate, appToUpdate.items_list, this.pipeService.emit.bind(this.pipeService), app_id);\n this.updateApp(appToUpdate);\n }\n return appToUpdate;\n }\n async addItemsToApp(items, app_id) {\n const appToUpdate = await this.getApp(app_id);\n if (appToUpdate) {\n appToUpdate.items_list.push(...items);\n this.updateApp(appToUpdate);\n this.pipeService.emit(\"gh_items_update\", {\n app_id\n }, items);\n }\n return appToUpdate;\n }\n async deleteItemsInApp(itemsToDelete, app_id) {\n const appToUpdate = await this.getApp(app_id);\n if (appToUpdate) {\n appToUpdate.items_list = appToUpdate.items_list.filter(item => !itemsToDelete.find(itemToDelete => itemToDelete.item_id == item.item_id));\n this.updateApp(appToUpdate);\n }\n return appToUpdate;\n }\n}\n// EXTERNAL MODULE: ./node_modules/ws/browser.js\nvar browser = __webpack_require__(7026);\n;// CONCATENATED MODULE: ./GUDHUB/WebSocket/WebSocket.js\n\nclass WebSocketApi {\n constructor(url, auth) {\n this.websocket = null;\n this.connected = false;\n this.queue = [];\n this.url = url;\n this.auth = auth;\n this.heartBeatTimeStemp = 10000000000000;\n this.ALLOWED_HEART_BEAT_DELEY = 12000;\n this.firstHeartBeat = true;\n this.reload = true;\n this.isBrowser = ![typeof window, typeof document].includes(\"undefined\");\n }\n async addSubscription(app_id) {\n //console.log(\"Added new subscription: app_id - \", app_id);\n\n const token = await this.auth.getToken();\n const subscription = `token=${token}/~/app_id=${app_id}`;\n if (this.connected) {\n this.websocket.send(subscription);\n }\n this.queue.push(app_id);\n }\n async onOpen() {\n this.reload = true;\n console.log(\"websocket opened\");\n this.connected = true;\n const token = await this.auth.getToken();\n this.queue.forEach(queue => {\n const subscription = `token=${token}/~/app_id=${queue}`;\n this.websocket.send(subscription);\n });\n }\n onError(error) {\n console.log(\"websocket error: \", error);\n this.websocket.close();\n }\n onClose() {\n console.log(\"websocket close\");\n this.connected = false;\n try {\n this.initWebSocket(this.onMassageHandler, this.refreshAppsHandler);\n } catch (error) {\n console.log(error);\n }\n }\n async onMessage(event) {\n const message = this.isBrowser ? event.data : event;\n if (message.match(/HeartBeat/)) {\n const hartBeatDelay = new Date().getTime() - this.heartBeatTimeStemp;\n if (this.ALLOWED_HEART_BEAT_DELEY < hartBeatDelay) {\n await this.onConnectionLost();\n } else {\n this.websocket.send(\"HeartBeat\");\n this.heartBeatTimeStemp = new Date().getTime();\n }\n }\n if (this.firstHeartBeat) {\n this.connectionChecker();\n this.firstHeartBeat = false;\n }\n if (message.match(/[{}]/)) {\n let incomeMessage = JSON.parse(message);\n const token = await this.auth.getToken();\n\n //-- We don't want to update storage of user who initieted the update. That is why we check if token from websocket is not the same as users token.\n if (incomeMessage.token != token) {\n this.onMassageHandler(incomeMessage);\n }\n }\n }\n initWebSocket(onMassageHandler, refreshAppsHandler) {\n this.onMassageHandler = onMassageHandler;\n this.refreshAppsHandler = refreshAppsHandler;\n if (this.isBrowser) {\n this.websocket = new WebSocket(this.url);\n this.websocket.onopen = this.onOpen.bind(this);\n this.websocket.onerror = this.onError.bind(this);\n this.websocket.onclose = this.onClose.bind(this);\n this.websocket.onmessage = this.onMessage.bind(this);\n } else {\n this.websocket = new browser(this.url);\n this.websocket.on(\"open\", this.onOpen);\n this.websocket.on(\"error\", this.onError);\n this.websocket.on(\"close\", this.onClose);\n this.websocket.on(\"message\", this.onMessage);\n }\n console.log(\"websocket initialized\");\n }\n connectionChecker() {\n setInterval(async () => {\n let hartBeatDelay = new Date().getTime() - this.heartBeatTimeStemp;\n // console.log(hartBeatDelay, this.ALLOWED_HEART_BEAT_DELEY, \"interval\");\n if (this.ALLOWED_HEART_BEAT_DELEY < hartBeatDelay) {\n await this.onConnectionLost();\n }\n }, 1000);\n }\n async onConnectionLost() {\n try {\n await this.auth.getVersion();\n if (this.reload) {\n this.reload = false;\n console.log(\"Connected\");\n this.heartBeatTimeStemp = 10000000000000;\n this.websocket.close();\n // Should be uncommented after websocket is fixed\n // this.refreshAppsHandler(this.queue);\n }\n } catch (error) {\n console.log(error);\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/filterPreparation.js\nasync function filterPreparation(filters_list, storage, pipeService, variables = {}) {\n const filterArray = [];\n const objectMethod = {\n variableMethodcurrent_app() {\n return [variables.current_app_id || variables.app_id];\n },\n variableMethodelement_app() {\n return [variables.element_app_id];\n },\n variableMethodcurrent_item() {\n const currentValue = `${variables.current_app_id || variables.app_id}.${variables.item_id}`;\n return [currentValue];\n },\n variableMethoduser_id() {\n const storage_user = storage.getUser();\n return [storage_user.user_id];\n },\n variableMethoduser_email(filter) {\n const storage_user = storage.getUser();\n return [storage_user.username];\n },\n variableMethodtoday(filter) {\n const date = new Date();\n const start_date = new Date(date.getFullYear(), date.getMonth(), date.getDate());\n const end_date = new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1);\n const result = start_date.valueOf().toString() + \":\" + end_date.valueOf().toString();\n return [result];\n },\n variableMethodvariable(property) {\n return [variables[property]];\n }\n };\n if (filters_list) {\n for (const filter of filters_list) {\n if (filter) {\n // ---------------------- WARNING !!! -------------------------------\n // Should be fixed: modification of filters_list valuesArray\n switch (filter.input_type) {\n case \"variable\":\n filter.valuesArray = [];\n for (const filterValue of filter?.input_value.split(',')) {\n const functionName = filter.input_type + \"Method\" + filterValue;\n const func = objectMethod[functionName];\n if (typeof func === \"function\") {\n if (!filter.valuesArray) {\n filter.valuesArray = func();\n } else {\n filter.valuesArray.push(...func());\n }\n } else {\n if (!filter.valuesArray) {\n filter.valuesArray = objectMethod.variableMethodvariable(filterValue);\n } else {\n filter.valuesArray.push(...objectMethod.variableMethodvariable(filterValue));\n }\n }\n }\n filterArray.push(filter);\n break;\n case \"field\":\n const field_value = await fieldMethod({\n app_id: variables.current_app_id || variables.app_id,\n item_id: variables.item_id,\n field_id: filter.input_value\n });\n if (field_value != null) {\n filter.valuesArray.push(field_value);\n }\n filterArray.push(filter);\n break;\n default:\n filterArray.push(filter);\n break;\n }\n } else {\n filterArray.push(filter);\n }\n }\n }\n function fieldMethod(address) {\n return new Promise(resolve => {\n pipeService.on(\"gh_value_get\", address, function ghValueGet(event, field_value) {\n pipeService.destroy(\"gh_value_get\", address, ghValueGet);\n resolve(field_value);\n }).emit(\"gh_value_get\", {}, address);\n });\n }\n return filterArray;\n}\n;// CONCATENATED MODULE: ./node_modules/fuse.js/dist/fuse.esm.js\n/**\n * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)\n *\n * Copyright (c) 2022 Kiro Risk (http://kiro.me)\n * All Rights Reserved. Apache Software License 2.0\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfunction isArray(value) {\n return !Array.isArray\n ? getTag(value) === '[object Array]'\n : Array.isArray(value)\n}\n\n// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js\nconst INFINITY = 1 / 0;\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value\n }\n let result = value + '';\n return result == '0' && 1 / value == -INFINITY ? '-0' : result\n}\n\nfunction fuse_esm_toString(value) {\n return value == null ? '' : baseToString(value)\n}\n\nfunction isString(value) {\n return typeof value === 'string'\n}\n\nfunction isNumber(value) {\n return typeof value === 'number'\n}\n\n// Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js\nfunction isBoolean(value) {\n return (\n value === true ||\n value === false ||\n (isObjectLike(value) && getTag(value) == '[object Boolean]')\n )\n}\n\nfunction isObject(value) {\n return typeof value === 'object'\n}\n\n// Checks if `value` is object-like.\nfunction isObjectLike(value) {\n return isObject(value) && value !== null\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null\n}\n\nfunction isBlank(value) {\n return !value.trim().length\n}\n\n// Gets the `toStringTag` of `value`.\n// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js\nfunction getTag(value) {\n return value == null\n ? value === undefined\n ? '[object Undefined]'\n : '[object Null]'\n : Object.prototype.toString.call(value)\n}\n\nconst EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';\n\nconst INCORRECT_INDEX_TYPE = \"Incorrect 'index' type\";\n\nconst LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) =>\n `Invalid value for key ${key}`;\n\nconst PATTERN_LENGTH_TOO_LARGE = (max) =>\n `Pattern length exceeds max of ${max}.`;\n\nconst MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;\n\nconst INVALID_KEY_WEIGHT_VALUE = (key) =>\n `Property 'weight' in key '${key}' must be a positive integer`;\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nclass KeyStore {\n constructor(keys) {\n this._keys = [];\n this._keyMap = {};\n\n let totalWeight = 0;\n\n keys.forEach((key) => {\n let obj = createKey(key);\n\n totalWeight += obj.weight;\n\n this._keys.push(obj);\n this._keyMap[obj.id] = obj;\n\n totalWeight += obj.weight;\n });\n\n // Normalize weights so that their sum is equal to 1\n this._keys.forEach((key) => {\n key.weight /= totalWeight;\n });\n }\n get(keyId) {\n return this._keyMap[keyId]\n }\n keys() {\n return this._keys\n }\n toJSON() {\n return JSON.stringify(this._keys)\n }\n}\n\nfunction createKey(key) {\n let path = null;\n let id = null;\n let src = null;\n let weight = 1;\n let getFn = null;\n\n if (isString(key) || isArray(key)) {\n src = key;\n path = createKeyPath(key);\n id = createKeyId(key);\n } else {\n if (!hasOwn.call(key, 'name')) {\n throw new Error(MISSING_KEY_PROPERTY('name'))\n }\n\n const name = key.name;\n src = name;\n\n if (hasOwn.call(key, 'weight')) {\n weight = key.weight;\n\n if (weight <= 0) {\n throw new Error(INVALID_KEY_WEIGHT_VALUE(name))\n }\n }\n\n path = createKeyPath(name);\n id = createKeyId(name);\n getFn = key.getFn;\n }\n\n return { path, id, weight, src, getFn }\n}\n\nfunction createKeyPath(key) {\n return isArray(key) ? key : key.split('.')\n}\n\nfunction createKeyId(key) {\n return isArray(key) ? key.join('.') : key\n}\n\nfunction get(obj, path) {\n let list = [];\n let arr = false;\n\n const deepGet = (obj, path, index) => {\n if (!isDefined(obj)) {\n return\n }\n if (!path[index]) {\n // If there's no path left, we've arrived at the object we care about.\n list.push(obj);\n } else {\n let key = path[index];\n\n const value = obj[key];\n\n if (!isDefined(value)) {\n return\n }\n\n // If we're at the last value in the path, and if it's a string/number/bool,\n // add it to the list\n if (\n index === path.length - 1 &&\n (isString(value) || isNumber(value) || isBoolean(value))\n ) {\n list.push(fuse_esm_toString(value));\n } else if (isArray(value)) {\n arr = true;\n // Search each item in the array.\n for (let i = 0, len = value.length; i < len; i += 1) {\n deepGet(value[i], path, index + 1);\n }\n } else if (path.length) {\n // An object. Recurse further.\n deepGet(value, path, index + 1);\n }\n }\n };\n\n // Backwards compatibility (since path used to be a string)\n deepGet(obj, isString(path) ? path.split('.') : path, 0);\n\n return arr ? list : list[0]\n}\n\nconst MatchOptions = {\n // Whether the matches should be included in the result set. When `true`, each record in the result\n // set will include the indices of the matched characters.\n // These can consequently be used for highlighting purposes.\n includeMatches: false,\n // When `true`, the matching function will continue to the end of a search pattern even if\n // a perfect match has already been located in the string.\n findAllMatches: false,\n // Minimum number of characters that must be matched before a result is considered a match\n minMatchCharLength: 1\n};\n\nconst BasicOptions = {\n // When `true`, the algorithm continues searching to the end of the input even if a perfect\n // match is found before the end of the same input.\n isCaseSensitive: false,\n // When true, the matching function will continue to the end of a search pattern even if\n includeScore: false,\n // List of properties that will be searched. This also supports nested properties.\n keys: [],\n // Whether to sort the result list, by score\n shouldSort: true,\n // Default sort function: sort by ascending score, ascending index\n sortFn: (a, b) =>\n a.score === b.score ? (a.idx < b.idx ? -1 : 1) : a.score < b.score ? -1 : 1\n};\n\nconst FuzzyOptions = {\n // Approximately where in the text is the pattern expected to be found?\n location: 0,\n // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match\n // (of both letters and location), a threshold of '1.0' would match anything.\n threshold: 0.6,\n // Determines how close the match must be to the fuzzy location (specified above).\n // An exact letter match which is 'distance' characters away from the fuzzy location\n // would score as a complete mismatch. A distance of '0' requires the match be at\n // the exact location specified, a threshold of '1000' would require a perfect match\n // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.\n distance: 100\n};\n\nconst AdvancedOptions = {\n // When `true`, it enables the use of unix-like search commands\n useExtendedSearch: false,\n // The get function to use when fetching an object's properties.\n // The default will search nested paths *ie foo.bar.baz*\n getFn: get,\n // When `true`, search will ignore `location` and `distance`, so it won't matter\n // where in the string the pattern appears.\n // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score\n ignoreLocation: false,\n // When `true`, the calculation for the relevance score (used for sorting) will\n // ignore the field-length norm.\n // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm\n ignoreFieldNorm: false,\n // The weight to determine how much field length norm effects scoring.\n fieldNormWeight: 1\n};\n\nvar Config = {\n ...BasicOptions,\n ...MatchOptions,\n ...FuzzyOptions,\n ...AdvancedOptions\n};\n\nconst SPACE = /[^ ]+/g;\n\n// Field-length norm: the shorter the field, the higher the weight.\n// Set to 3 decimals to reduce index size.\nfunction norm(weight = 1, mantissa = 3) {\n const cache = new Map();\n const m = Math.pow(10, mantissa);\n\n return {\n get(value) {\n const numTokens = value.match(SPACE).length;\n\n if (cache.has(numTokens)) {\n return cache.get(numTokens)\n }\n\n // Default function is 1/sqrt(x), weight makes that variable\n const norm = 1 / Math.pow(numTokens, 0.5 * weight);\n\n // In place of `toFixed(mantissa)`, for faster computation\n const n = parseFloat(Math.round(norm * m) / m);\n\n cache.set(numTokens, n);\n\n return n\n },\n clear() {\n cache.clear();\n }\n }\n}\n\nclass FuseIndex {\n constructor({\n getFn = Config.getFn,\n fieldNormWeight = Config.fieldNormWeight\n } = {}) {\n this.norm = norm(fieldNormWeight, 3);\n this.getFn = getFn;\n this.isCreated = false;\n\n this.setIndexRecords();\n }\n setSources(docs = []) {\n this.docs = docs;\n }\n setIndexRecords(records = []) {\n this.records = records;\n }\n setKeys(keys = []) {\n this.keys = keys;\n this._keysMap = {};\n keys.forEach((key, idx) => {\n this._keysMap[key.id] = idx;\n });\n }\n create() {\n if (this.isCreated || !this.docs.length) {\n return\n }\n\n this.isCreated = true;\n\n // List is Array<String>\n if (isString(this.docs[0])) {\n this.docs.forEach((doc, docIndex) => {\n this._addString(doc, docIndex);\n });\n } else {\n // List is Array<Object>\n this.docs.forEach((doc, docIndex) => {\n this._addObject(doc, docIndex);\n });\n }\n\n this.norm.clear();\n }\n // Adds a doc to the end of the index\n add(doc) {\n const idx = this.size();\n\n if (isString(doc)) {\n this._addString(doc, idx);\n } else {\n this._addObject(doc, idx);\n }\n }\n // Removes the doc at the specified index of the index\n removeAt(idx) {\n this.records.splice(idx, 1);\n\n // Change ref index of every subsquent doc\n for (let i = idx, len = this.size(); i < len; i += 1) {\n this.records[i].i -= 1;\n }\n }\n getValueForItemAtKeyId(item, keyId) {\n return item[this._keysMap[keyId]]\n }\n size() {\n return this.records.length\n }\n _addString(doc, docIndex) {\n if (!isDefined(doc) || isBlank(doc)) {\n return\n }\n\n let record = {\n v: doc,\n i: docIndex,\n n: this.norm.get(doc)\n };\n\n this.records.push(record);\n }\n _addObject(doc, docIndex) {\n let record = { i: docIndex, $: {} };\n\n // Iterate over every key (i.e, path), and fetch the value at that key\n this.keys.forEach((key, keyIndex) => {\n let value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path);\n\n if (!isDefined(value)) {\n return\n }\n\n if (isArray(value)) {\n let subRecords = [];\n const stack = [{ nestedArrIndex: -1, value }];\n\n while (stack.length) {\n const { nestedArrIndex, value } = stack.pop();\n\n if (!isDefined(value)) {\n continue\n }\n\n if (isString(value) && !isBlank(value)) {\n let subRecord = {\n v: value,\n i: nestedArrIndex,\n n: this.norm.get(value)\n };\n\n subRecords.push(subRecord);\n } else if (isArray(value)) {\n value.forEach((item, k) => {\n stack.push({\n nestedArrIndex: k,\n value: item\n });\n });\n } else ;\n }\n record.$[keyIndex] = subRecords;\n } else if (isString(value) && !isBlank(value)) {\n let subRecord = {\n v: value,\n n: this.norm.get(value)\n };\n\n record.$[keyIndex] = subRecord;\n }\n });\n\n this.records.push(record);\n }\n toJSON() {\n return {\n keys: this.keys,\n records: this.records\n }\n }\n}\n\nfunction createIndex(\n keys,\n docs,\n { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}\n) {\n const myIndex = new FuseIndex({ getFn, fieldNormWeight });\n myIndex.setKeys(keys.map(createKey));\n myIndex.setSources(docs);\n myIndex.create();\n return myIndex\n}\n\nfunction parseIndex(\n data,\n { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}\n) {\n const { keys, records } = data;\n const myIndex = new FuseIndex({ getFn, fieldNormWeight });\n myIndex.setKeys(keys);\n myIndex.setIndexRecords(records);\n return myIndex\n}\n\nfunction computeScore$1(\n pattern,\n {\n errors = 0,\n currentLocation = 0,\n expectedLocation = 0,\n distance = Config.distance,\n ignoreLocation = Config.ignoreLocation\n } = {}\n) {\n const accuracy = errors / pattern.length;\n\n if (ignoreLocation) {\n return accuracy\n }\n\n const proximity = Math.abs(expectedLocation - currentLocation);\n\n if (!distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy\n }\n\n return accuracy + proximity / distance\n}\n\nfunction convertMaskToIndices(\n matchmask = [],\n minMatchCharLength = Config.minMatchCharLength\n) {\n let indices = [];\n let start = -1;\n let end = -1;\n let i = 0;\n\n for (let len = matchmask.length; i < len; i += 1) {\n let match = matchmask[i];\n if (match && start === -1) {\n start = i;\n } else if (!match && start !== -1) {\n end = i - 1;\n if (end - start + 1 >= minMatchCharLength) {\n indices.push([start, end]);\n }\n start = -1;\n }\n }\n\n // (i-1 - start) + 1 => i - start\n if (matchmask[i - 1] && i - start >= minMatchCharLength) {\n indices.push([start, i - 1]);\n }\n\n return indices\n}\n\n// Machine word size\nconst MAX_BITS = 32;\n\nfunction search(\n text,\n pattern,\n patternAlphabet,\n {\n location = Config.location,\n distance = Config.distance,\n threshold = Config.threshold,\n findAllMatches = Config.findAllMatches,\n minMatchCharLength = Config.minMatchCharLength,\n includeMatches = Config.includeMatches,\n ignoreLocation = Config.ignoreLocation\n } = {}\n) {\n if (pattern.length > MAX_BITS) {\n throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS))\n }\n\n const patternLen = pattern.length;\n // Set starting location at beginning text and initialize the alphabet.\n const textLen = text.length;\n // Handle the case when location > text.length\n const expectedLocation = Math.max(0, Math.min(location, textLen));\n // Highest score beyond which we give up.\n let currentThreshold = threshold;\n // Is there a nearby exact match? (speedup)\n let bestLocation = expectedLocation;\n\n // Performance: only computer matches when the minMatchCharLength > 1\n // OR if `includeMatches` is true.\n const computeMatches = minMatchCharLength > 1 || includeMatches;\n // A mask of the matches, used for building the indices\n const matchMask = computeMatches ? Array(textLen) : [];\n\n let index;\n\n // Get all exact matches, here for speed up\n while ((index = text.indexOf(pattern, bestLocation)) > -1) {\n let score = computeScore$1(pattern, {\n currentLocation: index,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n currentThreshold = Math.min(score, currentThreshold);\n bestLocation = index + patternLen;\n\n if (computeMatches) {\n let i = 0;\n while (i < patternLen) {\n matchMask[index + i] = 1;\n i += 1;\n }\n }\n }\n\n // Reset the best location\n bestLocation = -1;\n\n let lastBitArr = [];\n let finalScore = 1;\n let binMax = patternLen + textLen;\n\n const mask = 1 << (patternLen - 1);\n\n for (let i = 0; i < patternLen; i += 1) {\n // Scan for the best match; each iteration allows for one more error.\n // Run a binary search to determine how far from the match location we can stray\n // at this error level.\n let binMin = 0;\n let binMid = binMax;\n\n while (binMin < binMid) {\n const score = computeScore$1(pattern, {\n errors: i,\n currentLocation: expectedLocation + binMid,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n if (score <= currentThreshold) {\n binMin = binMid;\n } else {\n binMax = binMid;\n }\n\n binMid = Math.floor((binMax - binMin) / 2 + binMin);\n }\n\n // Use the result from this iteration as the maximum for the next.\n binMax = binMid;\n\n let start = Math.max(1, expectedLocation - binMid + 1);\n let finish = findAllMatches\n ? textLen\n : Math.min(expectedLocation + binMid, textLen) + patternLen;\n\n // Initialize the bit array\n let bitArr = Array(finish + 2);\n\n bitArr[finish + 1] = (1 << i) - 1;\n\n for (let j = finish; j >= start; j -= 1) {\n let currentLocation = j - 1;\n let charMatch = patternAlphabet[text.charAt(currentLocation)];\n\n if (computeMatches) {\n // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)\n matchMask[currentLocation] = +!!charMatch;\n }\n\n // First pass: exact match\n bitArr[j] = ((bitArr[j + 1] << 1) | 1) & charMatch;\n\n // Subsequent passes: fuzzy match\n if (i) {\n bitArr[j] |=\n ((lastBitArr[j + 1] | lastBitArr[j]) << 1) | 1 | lastBitArr[j + 1];\n }\n\n if (bitArr[j] & mask) {\n finalScore = computeScore$1(pattern, {\n errors: i,\n currentLocation,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n // This match will almost certainly be better than any existing match.\n // But check anyway.\n if (finalScore <= currentThreshold) {\n // Indeed it is\n currentThreshold = finalScore;\n bestLocation = currentLocation;\n\n // Already passed `loc`, downhill from here on in.\n if (bestLocation <= expectedLocation) {\n break\n }\n\n // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.\n start = Math.max(1, 2 * expectedLocation - bestLocation);\n }\n }\n }\n\n // No hope for a (better) match at greater error levels.\n const score = computeScore$1(pattern, {\n errors: i + 1,\n currentLocation: expectedLocation,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n if (score > currentThreshold) {\n break\n }\n\n lastBitArr = bitArr;\n }\n\n const result = {\n isMatch: bestLocation >= 0,\n // Count exact matches (those with a score of 0) to be \"almost\" exact\n score: Math.max(0.001, finalScore)\n };\n\n if (computeMatches) {\n const indices = convertMaskToIndices(matchMask, minMatchCharLength);\n if (!indices.length) {\n result.isMatch = false;\n } else if (includeMatches) {\n result.indices = indices;\n }\n }\n\n return result\n}\n\nfunction createPatternAlphabet(pattern) {\n let mask = {};\n\n for (let i = 0, len = pattern.length; i < len; i += 1) {\n const char = pattern.charAt(i);\n mask[char] = (mask[char] || 0) | (1 << (len - i - 1));\n }\n\n return mask\n}\n\nclass BitapSearch {\n constructor(\n pattern,\n {\n location = Config.location,\n threshold = Config.threshold,\n distance = Config.distance,\n includeMatches = Config.includeMatches,\n findAllMatches = Config.findAllMatches,\n minMatchCharLength = Config.minMatchCharLength,\n isCaseSensitive = Config.isCaseSensitive,\n ignoreLocation = Config.ignoreLocation\n } = {}\n ) {\n this.options = {\n location,\n threshold,\n distance,\n includeMatches,\n findAllMatches,\n minMatchCharLength,\n isCaseSensitive,\n ignoreLocation\n };\n\n this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n\n this.chunks = [];\n\n if (!this.pattern.length) {\n return\n }\n\n const addChunk = (pattern, startIndex) => {\n this.chunks.push({\n pattern,\n alphabet: createPatternAlphabet(pattern),\n startIndex\n });\n };\n\n const len = this.pattern.length;\n\n if (len > MAX_BITS) {\n let i = 0;\n const remainder = len % MAX_BITS;\n const end = len - remainder;\n\n while (i < end) {\n addChunk(this.pattern.substr(i, MAX_BITS), i);\n i += MAX_BITS;\n }\n\n if (remainder) {\n const startIndex = len - MAX_BITS;\n addChunk(this.pattern.substr(startIndex), startIndex);\n }\n } else {\n addChunk(this.pattern, 0);\n }\n }\n\n searchIn(text) {\n const { isCaseSensitive, includeMatches } = this.options;\n\n if (!isCaseSensitive) {\n text = text.toLowerCase();\n }\n\n // Exact match\n if (this.pattern === text) {\n let result = {\n isMatch: true,\n score: 0\n };\n\n if (includeMatches) {\n result.indices = [[0, text.length - 1]];\n }\n\n return result\n }\n\n // Otherwise, use Bitap algorithm\n const {\n location,\n distance,\n threshold,\n findAllMatches,\n minMatchCharLength,\n ignoreLocation\n } = this.options;\n\n let allIndices = [];\n let totalScore = 0;\n let hasMatches = false;\n\n this.chunks.forEach(({ pattern, alphabet, startIndex }) => {\n const { isMatch, score, indices } = search(text, pattern, alphabet, {\n location: location + startIndex,\n distance,\n threshold,\n findAllMatches,\n minMatchCharLength,\n includeMatches,\n ignoreLocation\n });\n\n if (isMatch) {\n hasMatches = true;\n }\n\n totalScore += score;\n\n if (isMatch && indices) {\n allIndices = [...allIndices, ...indices];\n }\n });\n\n let result = {\n isMatch: hasMatches,\n score: hasMatches ? totalScore / this.chunks.length : 1\n };\n\n if (hasMatches && includeMatches) {\n result.indices = allIndices;\n }\n\n return result\n }\n}\n\nclass BaseMatch {\n constructor(pattern) {\n this.pattern = pattern;\n }\n static isMultiMatch(pattern) {\n return getMatch(pattern, this.multiRegex)\n }\n static isSingleMatch(pattern) {\n return getMatch(pattern, this.singleRegex)\n }\n search(/*text*/) {}\n}\n\nfunction getMatch(pattern, exp) {\n const matches = pattern.match(exp);\n return matches ? matches[1] : null\n}\n\n// Token: 'file\n\nclass ExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'exact'\n }\n static get multiRegex() {\n return /^=\"(.*)\"$/\n }\n static get singleRegex() {\n return /^=(.*)$/\n }\n search(text) {\n const isMatch = text === this.pattern;\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, this.pattern.length - 1]\n }\n }\n}\n\n// Token: !fire\n\nclass InverseExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'inverse-exact'\n }\n static get multiRegex() {\n return /^!\"(.*)\"$/\n }\n static get singleRegex() {\n return /^!(.*)$/\n }\n search(text) {\n const index = text.indexOf(this.pattern);\n const isMatch = index === -1;\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, text.length - 1]\n }\n }\n}\n\n// Token: ^file\n\nclass PrefixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'prefix-exact'\n }\n static get multiRegex() {\n return /^\\^\"(.*)\"$/\n }\n static get singleRegex() {\n return /^\\^(.*)$/\n }\n search(text) {\n const isMatch = text.startsWith(this.pattern);\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, this.pattern.length - 1]\n }\n }\n}\n\n// Token: !^fire\n\nclass InversePrefixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'inverse-prefix-exact'\n }\n static get multiRegex() {\n return /^!\\^\"(.*)\"$/\n }\n static get singleRegex() {\n return /^!\\^(.*)$/\n }\n search(text) {\n const isMatch = !text.startsWith(this.pattern);\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, text.length - 1]\n }\n }\n}\n\n// Token: .file$\n\nclass SuffixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'suffix-exact'\n }\n static get multiRegex() {\n return /^\"(.*)\"\\$$/\n }\n static get singleRegex() {\n return /^(.*)\\$$/\n }\n search(text) {\n const isMatch = text.endsWith(this.pattern);\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [text.length - this.pattern.length, text.length - 1]\n }\n }\n}\n\n// Token: !.file$\n\nclass InverseSuffixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'inverse-suffix-exact'\n }\n static get multiRegex() {\n return /^!\"(.*)\"\\$$/\n }\n static get singleRegex() {\n return /^!(.*)\\$$/\n }\n search(text) {\n const isMatch = !text.endsWith(this.pattern);\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, text.length - 1]\n }\n }\n}\n\nclass FuzzyMatch extends BaseMatch {\n constructor(\n pattern,\n {\n location = Config.location,\n threshold = Config.threshold,\n distance = Config.distance,\n includeMatches = Config.includeMatches,\n findAllMatches = Config.findAllMatches,\n minMatchCharLength = Config.minMatchCharLength,\n isCaseSensitive = Config.isCaseSensitive,\n ignoreLocation = Config.ignoreLocation\n } = {}\n ) {\n super(pattern);\n this._bitapSearch = new BitapSearch(pattern, {\n location,\n threshold,\n distance,\n includeMatches,\n findAllMatches,\n minMatchCharLength,\n isCaseSensitive,\n ignoreLocation\n });\n }\n static get type() {\n return 'fuzzy'\n }\n static get multiRegex() {\n return /^\"(.*)\"$/\n }\n static get singleRegex() {\n return /^(.*)$/\n }\n search(text) {\n return this._bitapSearch.searchIn(text)\n }\n}\n\n// Token: 'file\n\nclass IncludeMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'include'\n }\n static get multiRegex() {\n return /^'\"(.*)\"$/\n }\n static get singleRegex() {\n return /^'(.*)$/\n }\n search(text) {\n let location = 0;\n let index;\n\n const indices = [];\n const patternLen = this.pattern.length;\n\n // Get all exact matches\n while ((index = text.indexOf(this.pattern, location)) > -1) {\n location = index + patternLen;\n indices.push([index, location - 1]);\n }\n\n const isMatch = !!indices.length;\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices\n }\n }\n}\n\n// ❗Order is important. DO NOT CHANGE.\nconst searchers = [\n ExactMatch,\n IncludeMatch,\n PrefixExactMatch,\n InversePrefixExactMatch,\n InverseSuffixExactMatch,\n SuffixExactMatch,\n InverseExactMatch,\n FuzzyMatch\n];\n\nconst searchersLen = searchers.length;\n\n// Regex to split by spaces, but keep anything in quotes together\nconst SPACE_RE = / +(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)/;\nconst OR_TOKEN = '|';\n\n// Return a 2D array representation of the query, for simpler parsing.\n// Example:\n// \"^core go$ | rb$ | py$ xy$\" => [[\"^core\", \"go$\"], [\"rb$\"], [\"py$\", \"xy$\"]]\nfunction parseQuery(pattern, options = {}) {\n return pattern.split(OR_TOKEN).map((item) => {\n let query = item\n .trim()\n .split(SPACE_RE)\n .filter((item) => item && !!item.trim());\n\n let results = [];\n for (let i = 0, len = query.length; i < len; i += 1) {\n const queryItem = query[i];\n\n // 1. Handle multiple query match (i.e, once that are quoted, like `\"hello world\"`)\n let found = false;\n let idx = -1;\n while (!found && ++idx < searchersLen) {\n const searcher = searchers[idx];\n let token = searcher.isMultiMatch(queryItem);\n if (token) {\n results.push(new searcher(token, options));\n found = true;\n }\n }\n\n if (found) {\n continue\n }\n\n // 2. Handle single query matches (i.e, once that are *not* quoted)\n idx = -1;\n while (++idx < searchersLen) {\n const searcher = searchers[idx];\n let token = searcher.isSingleMatch(queryItem);\n if (token) {\n results.push(new searcher(token, options));\n break\n }\n }\n }\n\n return results\n })\n}\n\n// These extended matchers can return an array of matches, as opposed\n// to a singl match\nconst MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]);\n\n/**\n * Command-like searching\n * ======================\n *\n * Given multiple search terms delimited by spaces.e.g. `^jscript .python$ ruby !java`,\n * search in a given text.\n *\n * Search syntax:\n *\n * | Token | Match type | Description |\n * | ----------- | -------------------------- | -------------------------------------- |\n * | `jscript` | fuzzy-match | Items that fuzzy match `jscript` |\n * | `=scheme` | exact-match | Items that are `scheme` |\n * | `'python` | include-match | Items that include `python` |\n * | `!ruby` | inverse-exact-match | Items that do not include `ruby` |\n * | `^java` | prefix-exact-match | Items that start with `java` |\n * | `!^earlang` | inverse-prefix-exact-match | Items that do not start with `earlang` |\n * | `.js$` | suffix-exact-match | Items that end with `.js` |\n * | `!.go$` | inverse-suffix-exact-match | Items that do not end with `.go` |\n *\n * A single pipe character acts as an OR operator. For example, the following\n * query matches entries that start with `core` and end with either`go`, `rb`,\n * or`py`.\n *\n * ```\n * ^core go$ | rb$ | py$\n * ```\n */\nclass ExtendedSearch {\n constructor(\n pattern,\n {\n isCaseSensitive = Config.isCaseSensitive,\n includeMatches = Config.includeMatches,\n minMatchCharLength = Config.minMatchCharLength,\n ignoreLocation = Config.ignoreLocation,\n findAllMatches = Config.findAllMatches,\n location = Config.location,\n threshold = Config.threshold,\n distance = Config.distance\n } = {}\n ) {\n this.query = null;\n this.options = {\n isCaseSensitive,\n includeMatches,\n minMatchCharLength,\n findAllMatches,\n ignoreLocation,\n location,\n threshold,\n distance\n };\n\n this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n this.query = parseQuery(this.pattern, this.options);\n }\n\n static condition(_, options) {\n return options.useExtendedSearch\n }\n\n searchIn(text) {\n const query = this.query;\n\n if (!query) {\n return {\n isMatch: false,\n score: 1\n }\n }\n\n const { includeMatches, isCaseSensitive } = this.options;\n\n text = isCaseSensitive ? text : text.toLowerCase();\n\n let numMatches = 0;\n let allIndices = [];\n let totalScore = 0;\n\n // ORs\n for (let i = 0, qLen = query.length; i < qLen; i += 1) {\n const searchers = query[i];\n\n // Reset indices\n allIndices.length = 0;\n numMatches = 0;\n\n // ANDs\n for (let j = 0, pLen = searchers.length; j < pLen; j += 1) {\n const searcher = searchers[j];\n const { isMatch, indices, score } = searcher.search(text);\n\n if (isMatch) {\n numMatches += 1;\n totalScore += score;\n if (includeMatches) {\n const type = searcher.constructor.type;\n if (MultiMatchSet.has(type)) {\n allIndices = [...allIndices, ...indices];\n } else {\n allIndices.push(indices);\n }\n }\n } else {\n totalScore = 0;\n numMatches = 0;\n allIndices.length = 0;\n break\n }\n }\n\n // OR condition, so if TRUE, return\n if (numMatches) {\n let result = {\n isMatch: true,\n score: totalScore / numMatches\n };\n\n if (includeMatches) {\n result.indices = allIndices;\n }\n\n return result\n }\n }\n\n // Nothing was matched\n return {\n isMatch: false,\n score: 1\n }\n }\n}\n\nconst registeredSearchers = [];\n\nfunction register(...args) {\n registeredSearchers.push(...args);\n}\n\nfunction createSearcher(pattern, options) {\n for (let i = 0, len = registeredSearchers.length; i < len; i += 1) {\n let searcherClass = registeredSearchers[i];\n if (searcherClass.condition(pattern, options)) {\n return new searcherClass(pattern, options)\n }\n }\n\n return new BitapSearch(pattern, options)\n}\n\nconst LogicalOperator = {\n AND: '$and',\n OR: '$or'\n};\n\nconst KeyType = {\n PATH: '$path',\n PATTERN: '$val'\n};\n\nconst isExpression = (query) =>\n !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);\n\nconst isPath = (query) => !!query[KeyType.PATH];\n\nconst isLeaf = (query) =>\n !isArray(query) && isObject(query) && !isExpression(query);\n\nconst convertToExplicit = (query) => ({\n [LogicalOperator.AND]: Object.keys(query).map((key) => ({\n [key]: query[key]\n }))\n});\n\n// When `auto` is `true`, the parse function will infer and initialize and add\n// the appropriate `Searcher` instance\nfunction parse(query, options, { auto = true } = {}) {\n const next = (query) => {\n let keys = Object.keys(query);\n\n const isQueryPath = isPath(query);\n\n if (!isQueryPath && keys.length > 1 && !isExpression(query)) {\n return next(convertToExplicit(query))\n }\n\n if (isLeaf(query)) {\n const key = isQueryPath ? query[KeyType.PATH] : keys[0];\n\n const pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];\n\n if (!isString(pattern)) {\n throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key))\n }\n\n const obj = {\n keyId: createKeyId(key),\n pattern\n };\n\n if (auto) {\n obj.searcher = createSearcher(pattern, options);\n }\n\n return obj\n }\n\n let node = {\n children: [],\n operator: keys[0]\n };\n\n keys.forEach((key) => {\n const value = query[key];\n\n if (isArray(value)) {\n value.forEach((item) => {\n node.children.push(next(item));\n });\n }\n });\n\n return node\n };\n\n if (!isExpression(query)) {\n query = convertToExplicit(query);\n }\n\n return next(query)\n}\n\n// Practical scoring function\nfunction computeScore(\n results,\n { ignoreFieldNorm = Config.ignoreFieldNorm }\n) {\n results.forEach((result) => {\n let totalScore = 1;\n\n result.matches.forEach(({ key, norm, score }) => {\n const weight = key ? key.weight : null;\n\n totalScore *= Math.pow(\n score === 0 && weight ? Number.EPSILON : score,\n (weight || 1) * (ignoreFieldNorm ? 1 : norm)\n );\n });\n\n result.score = totalScore;\n });\n}\n\nfunction transformMatches(result, data) {\n const matches = result.matches;\n data.matches = [];\n\n if (!isDefined(matches)) {\n return\n }\n\n matches.forEach((match) => {\n if (!isDefined(match.indices) || !match.indices.length) {\n return\n }\n\n const { indices, value } = match;\n\n let obj = {\n indices,\n value\n };\n\n if (match.key) {\n obj.key = match.key.src;\n }\n\n if (match.idx > -1) {\n obj.refIndex = match.idx;\n }\n\n data.matches.push(obj);\n });\n}\n\nfunction transformScore(result, data) {\n data.score = result.score;\n}\n\nfunction format(\n results,\n docs,\n {\n includeMatches = Config.includeMatches,\n includeScore = Config.includeScore\n } = {}\n) {\n const transformers = [];\n\n if (includeMatches) transformers.push(transformMatches);\n if (includeScore) transformers.push(transformScore);\n\n return results.map((result) => {\n const { idx } = result;\n\n const data = {\n item: docs[idx],\n refIndex: idx\n };\n\n if (transformers.length) {\n transformers.forEach((transformer) => {\n transformer(result, data);\n });\n }\n\n return data\n })\n}\n\nclass Fuse {\n constructor(docs, options = {}, index) {\n this.options = { ...Config, ...options };\n\n if (\n this.options.useExtendedSearch &&\n !true\n ) {}\n\n this._keyStore = new KeyStore(this.options.keys);\n\n this.setCollection(docs, index);\n }\n\n setCollection(docs, index) {\n this._docs = docs;\n\n if (index && !(index instanceof FuseIndex)) {\n throw new Error(INCORRECT_INDEX_TYPE)\n }\n\n this._myIndex =\n index ||\n createIndex(this.options.keys, this._docs, {\n getFn: this.options.getFn,\n fieldNormWeight: this.options.fieldNormWeight\n });\n }\n\n add(doc) {\n if (!isDefined(doc)) {\n return\n }\n\n this._docs.push(doc);\n this._myIndex.add(doc);\n }\n\n remove(predicate = (/* doc, idx */) => false) {\n const results = [];\n\n for (let i = 0, len = this._docs.length; i < len; i += 1) {\n const doc = this._docs[i];\n if (predicate(doc, i)) {\n this.removeAt(i);\n i -= 1;\n len -= 1;\n\n results.push(doc);\n }\n }\n\n return results\n }\n\n removeAt(idx) {\n this._docs.splice(idx, 1);\n this._myIndex.removeAt(idx);\n }\n\n getIndex() {\n return this._myIndex\n }\n\n search(query, { limit = -1 } = {}) {\n const {\n includeMatches,\n includeScore,\n shouldSort,\n sortFn,\n ignoreFieldNorm\n } = this.options;\n\n let results = isString(query)\n ? isString(this._docs[0])\n ? this._searchStringList(query)\n : this._searchObjectList(query)\n : this._searchLogical(query);\n\n computeScore(results, { ignoreFieldNorm });\n\n if (shouldSort) {\n results.sort(sortFn);\n }\n\n if (isNumber(limit) && limit > -1) {\n results = results.slice(0, limit);\n }\n\n return format(results, this._docs, {\n includeMatches,\n includeScore\n })\n }\n\n _searchStringList(query) {\n const searcher = createSearcher(query, this.options);\n const { records } = this._myIndex;\n const results = [];\n\n // Iterate over every string in the index\n records.forEach(({ v: text, i: idx, n: norm }) => {\n if (!isDefined(text)) {\n return\n }\n\n const { isMatch, score, indices } = searcher.searchIn(text);\n\n if (isMatch) {\n results.push({\n item: text,\n idx,\n matches: [{ score, value: text, norm, indices }]\n });\n }\n });\n\n return results\n }\n\n _searchLogical(query) {\n\n const expression = parse(query, this.options);\n\n const evaluate = (node, item, idx) => {\n if (!node.children) {\n const { keyId, searcher } = node;\n\n const matches = this._findMatches({\n key: this._keyStore.get(keyId),\n value: this._myIndex.getValueForItemAtKeyId(item, keyId),\n searcher\n });\n\n if (matches && matches.length) {\n return [\n {\n idx,\n item,\n matches\n }\n ]\n }\n\n return []\n }\n\n const res = [];\n for (let i = 0, len = node.children.length; i < len; i += 1) {\n const child = node.children[i];\n const result = evaluate(child, item, idx);\n if (result.length) {\n res.push(...result);\n } else if (node.operator === LogicalOperator.AND) {\n return []\n }\n }\n return res\n };\n\n const records = this._myIndex.records;\n const resultMap = {};\n const results = [];\n\n records.forEach(({ $: item, i: idx }) => {\n if (isDefined(item)) {\n let expResults = evaluate(expression, item, idx);\n\n if (expResults.length) {\n // Dedupe when adding\n if (!resultMap[idx]) {\n resultMap[idx] = { idx, item, matches: [] };\n results.push(resultMap[idx]);\n }\n expResults.forEach(({ matches }) => {\n resultMap[idx].matches.push(...matches);\n });\n }\n }\n });\n\n return results\n }\n\n _searchObjectList(query) {\n const searcher = createSearcher(query, this.options);\n const { keys, records } = this._myIndex;\n const results = [];\n\n // List is Array<Object>\n records.forEach(({ $: item, i: idx }) => {\n if (!isDefined(item)) {\n return\n }\n\n let matches = [];\n\n // Iterate over every key (i.e, path), and fetch the value at that key\n keys.forEach((key, keyIndex) => {\n matches.push(\n ...this._findMatches({\n key,\n value: item[keyIndex],\n searcher\n })\n );\n });\n\n if (matches.length) {\n results.push({\n idx,\n item,\n matches\n });\n }\n });\n\n return results\n }\n _findMatches({ key, value, searcher }) {\n if (!isDefined(value)) {\n return []\n }\n\n let matches = [];\n\n if (isArray(value)) {\n value.forEach(({ v: text, i: idx, n: norm }) => {\n if (!isDefined(text)) {\n return\n }\n\n const { isMatch, score, indices } = searcher.searchIn(text);\n\n if (isMatch) {\n matches.push({\n score,\n key,\n value: text,\n idx,\n norm,\n indices\n });\n }\n });\n } else {\n const { v: text, n: norm } = value;\n\n const { isMatch, score, indices } = searcher.searchIn(text);\n\n if (isMatch) {\n matches.push({ score, key, value: text, norm, indices });\n }\n }\n\n return matches\n }\n}\n\nFuse.version = '6.6.2';\nFuse.createIndex = createIndex;\nFuse.parseIndex = parseIndex;\nFuse.config = Config;\n\n{\n Fuse.parseQuery = parse;\n}\n\n{\n register(ExtendedSearch);\n}\n\n\n\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/utils.js\n\nfunction getDistanceFromLatLonInKm(coordsFrom, coordsTo) {\n const [lat1, lon1, distance] = coordsFrom.split(':');\n const [lat2, lon2] = coordsTo.split(':');\n const R = 6371; // Radius of the earth in km\n const dLat = deg2rad(lat2 - lat1); // deg2rad below\n const dLon = deg2rad(lon2 - lon1);\n const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2);\n const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n const distanceBetween = R * c; // Distance in km\n\n return Number(distance) >= distanceBetween;\n}\nfunction deg2rad(deg) {\n return deg * (Math.PI / 180);\n}\nfunction getDate({\n type,\n date = 0,\n match = true\n} = {}, itemTime) {\n if (!itemTime && type) return false;\n const newDate = new Date();\n let result = true;\n switch (type) {\n case \"day\":\n const filterDayStart = getDateInMs(date);\n const filterDayEnd = getDateInMs(date + 1);\n result = filterDayStart <= itemTime && itemTime < filterDayEnd;\n break;\n case \"days\":\n if (date < 0) {\n const currentDayEnd = getDateInMs(1);\n const startPast7Days = getDateInMs(-6);\n result = startPast7Days <= itemTime && itemTime < currentDayEnd;\n } else {\n const currentDay = getDateInMs();\n const startNext7Days = getDateInMs(7);\n result = currentDay <= itemTime && itemTime < startNext7Days;\n }\n break;\n case \"day_week\":\n result = date === new Date(itemTime).getDay();\n break;\n case \"week\":\n const weekStart = newDate.getDate() - newDate.getDay();\n const daysToEnd = date == -2 ? 13 : 6;\n const weekEnd = weekStart + daysToEnd;\n const weekDayStart = newDate.setDate(weekStart + date * 7);\n const currentDate = new Date();\n const weekDayEnd = currentDate.setDate(weekEnd + date * 7);\n const [sunday, saturday] = getWeek(weekDayStart, weekDayEnd);\n result = sunday <= itemTime && itemTime <= saturday;\n break;\n case \"month\":\n if (newDate.getFullYear() !== new Date(itemTime).getFullYear()) return false;\n const month = newDate.getMonth() + date;\n result = month === new Date(itemTime).getMonth();\n break;\n case \"year\":\n const year = newDate.getFullYear() + date;\n result = year === new Date(itemTime).getFullYear();\n break;\n default:\n return true;\n }\n return match ? result : !result;\n}\nfunction getWeek(start, end) {\n return [new Date(start), new Date(end)];\n}\nfunction getDateInMs(date = 0) {\n const currentDay = new Date();\n return new Date(currentDay.getFullYear(), currentDay.getMonth(), currentDay.getDate() + date).valueOf();\n}\nfunction searchValue(items, filter) {\n if (!items || !items.length) return;\n if (filter) {\n return items.filter(item => item.fields.find(field => field.index_value && field.index_value.toLowerCase().indexOf(filter.toLowerCase()) !== -1));\n }\n return items;\n}\nconst fuse = new Fuse([]);\nfunction isSimilarStrings(str1, strArray) {\n fuse.setCollection(strArray);\n return Boolean(fuse.search(str1).length);\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/filter.js\n\n/* harmony default export */ function filter(items, filters) {\n const itemsFilter = new ItemsFilter();\n if (!items || !items.length) {\n return [];\n }\n return itemsFilter.filter(filters, items);\n}\nclass Checker {\n changeBehavior(checkOption) {\n switch (checkOption) {\n case \"contain_or\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.some(_dataItem => _dataItem.indexOf(_filter) !== -1));\n };\n break;\n case \"contain_and\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.every(_filter => data.some(_dataItem => _dataItem.indexOf(_filter) !== -1));\n };\n break;\n case \"not_contain_or\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.every(_dataItem => _dataItem.indexOf(_filter) === -1));\n };\n break;\n case \"not_contain_and\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.every(_filter => data.every(_dataItem => _dataItem.indexOf(_filter) === -1));\n };\n break;\n case \"equal_or\":\n this._checkFn = function (data, filtersValues) {\n if (!data.length) return false;\n return data.some(_dataItem => filtersValues.some(_filter => _dataItem == _filter));\n };\n break;\n case \"equal_and\":\n this._checkFn = function (data, filtersValues) {\n if (!data.length) return false;\n let filtersValuesSet = new Set(filtersValues);\n while (data.length && filtersValuesSet.size) {\n let dataValue = data.pop();\n if (filtersValuesSet.has(dataValue)) {\n filtersValuesSet.delete(dataValue);\n }\n }\n return !filtersValuesSet.size;\n };\n break;\n case \"not_equal_or\":\n this._checkFn = function (data, filtersValues) {\n if (!data.length) return true;\n let filtersValuesSet = new Set(filtersValues);\n while (data.length && filtersValuesSet.size) {\n let dataValue = data.pop();\n if (!filtersValuesSet.has(dataValue)) {\n return true;\n }\n }\n return false;\n };\n break;\n case \"not_equal_and\":\n this._checkFn = function (data, filtersValues) {\n let filtersValuesSet = new Set(filtersValues);\n while (data.length && filtersValuesSet.size) {\n let dataValue = data.pop();\n if (filtersValuesSet.has(dataValue)) {\n return false;\n }\n }\n return true;\n };\n break;\n case \"bigger\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.every(_dataItem => _dataItem > _filter));\n };\n break;\n case \"lower\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.every(_dataItem => _dataItem < _filter));\n };\n break;\n case \"range\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.every(_dataItem => _filter.start <= _dataItem && _dataItem < _filter.end));\n };\n break;\n case \"value\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.some(_dataItem => _dataItem == _filter));\n };\n break;\n case 'search':\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => isSimilarStrings(_filter, data));\n };\n break;\n case \"phone_equal_or\":\n this._checkFn = function (data, filtersValues) {\n if (!data.length) return false;\n return filtersValues.some(_filter => data.some(_dataItem => _dataItem.replace(/[^0-9]/g, \"\").indexOf(_filter.replace(/[^0-9]/g, \"\")) !== -1));\n };\n break;\n case 'distance':\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.some(_dataItem => getDistanceFromLatLonInKm(_filter, _dataItem)));\n };\n break;\n case \"date_in\":\n case \"date_out\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.some(_dataItem => getDate(_filter, _dataItem)));\n };\n break;\n case \"recurring_date\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.some(_dataItem => gudhub.checkRecurringDate(_dataItem, _filter)));\n };\n break;\n }\n return this;\n }\n check(aggregate) {\n return this.changeBehavior(aggregate.getCheckOption())._checkFn(aggregate.getEntity(), aggregate.getFilterValues());\n }\n}\nclass NumberFetchStrategy {\n convert(val) {\n return [Number(val)];\n }\n convertFilterValue(val) {\n return Number(val);\n }\n}\nclass RangeFetchStrategy extends NumberFetchStrategy {\n convertFilterValue(val) {\n return {\n start: Number(val.split(\":\")[0]),\n end: Number(val.split(\":\")[1])\n };\n }\n}\nclass StringFetchStrategy {\n convert(val) {\n return String(val != null ? val : \"\").toLowerCase().split(\",\");\n }\n convertFilterValue(val) {\n if (val === 0) return \"0\";\n return String(val || \"\").toLowerCase();\n }\n}\nclass dateFetchStrategy extends NumberFetchStrategy {\n convertFilterValue(val) {\n const [type, date, match] = val.split(\":\");\n return {\n type,\n date: Number(date),\n match: !!Number(match)\n };\n }\n}\nclass BooleanFetchStrategy {\n convert(val) {\n return [String(Boolean(val))];\n }\n convertFilterValue(val) {\n return String(val);\n }\n}\nclass RecurringDateStrategy {\n convert(val) {\n return [Number(val)];\n }\n convertFilterValue(val) {\n return String(val);\n }\n}\nclass Aggregate {\n constructor() {\n this._strategies = {\n stringStrategy: new StringFetchStrategy(),\n numberStrategy: new NumberFetchStrategy(),\n booleanStrategy: new BooleanFetchStrategy(),\n rangeStrategy: new RangeFetchStrategy(),\n dateStrategy: new dateFetchStrategy(),\n recurringDateStrategy: new RecurringDateStrategy()\n };\n }\n setStrategy(checkOption) {\n this._checkOption = checkOption;\n switch (checkOption) {\n case \"contain_or\":\n case \"contain_and\":\n case \"not_contain_or\":\n case \"not_contain_and\":\n case \"equal_or\":\n case \"equal_and\":\n case \"not_equal_or\":\n case \"not_equal_and\":\n case \"phone_equal_or\":\n case 'distance':\n case 'search':\n this._currentStrategy = this._strategies.stringStrategy;\n break;\n case \"bigger\":\n case \"lower\":\n this._currentStrategy = this._strategies.numberStrategy;\n break;\n case \"range\":\n this._currentStrategy = this._strategies.rangeStrategy;\n break;\n case \"date_in\":\n case \"date_out\":\n this._currentStrategy = this._strategies.dateStrategy;\n break;\n case \"value\":\n this._currentStrategy = this._strategies.booleanStrategy;\n break;\n case \"recurring_date\":\n this._currentStrategy = this._strategies.recurringDateStrategy;\n }\n return this;\n }\n setEntity(val) {\n this._entity = this._currentStrategy.convert(val);\n return this;\n }\n getEntity() {\n return this._entity;\n }\n setFilterValues(val) {\n let temp = Array.isArray(val) ? val : [val];\n this._filterValues = temp.map(curFilterVal => this._currentStrategy.convertFilterValue(curFilterVal));\n return this;\n }\n getFilterValues() {\n return this._filterValues;\n }\n getCheckOption() {\n return this._checkOption;\n }\n}\nclass ItemsFilter {\n constructor() {}\n filter(filters, items) {\n const allFiltersAndStrategy = this.checkIfAllFiltersHaveAndStrategy(filters);\n const filteredItems = [];\n const activeFilters = filters.filter(function (filter) {\n return filter.valuesArray.length;\n });\n for (let item of items) {\n let result = true;\n for (let i = 0; i < activeFilters.length; i++) {\n const filter = activeFilters[i];\n const currField = item.fields.find(function (itemField) {\n return filter.field_id == itemField.field_id;\n });\n const filterAggregate = new Aggregate();\n const filterChecker = new Checker();\n filterAggregate.setStrategy(filter.search_type).setEntity(currField && currField.field_value != undefined ? currField.field_value : null).setFilterValues(filter.valuesArray);\n switch (filter.boolean_strategy) {\n case 'and':\n result = result && filterChecker.check(filterAggregate);\n break;\n case 'or':\n result = result || filterChecker.check(filterAggregate);\n break;\n default:\n result = result && filterChecker.check(filterAggregate);\n }\n\n // Needed for performance optimization\n // We don't need to check other filters if we already know that result is false in case of 'and' strategy\n if (!result && allFiltersAndStrategy) {\n break;\n }\n }\n if (result) {\n filteredItems.push(item);\n }\n }\n if (filteredItems.length || filters.length && !filteredItems.length) {\n return filteredItems;\n } else {\n return items;\n }\n }\n checkIfAllFiltersHaveAndStrategy(filters) {\n return filters.every(filter => {\n if (!filter.boolean_strategy || filter.boolean_strategy == 'and') {\n return true;\n }\n return false;\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/mergeFilters.js\nfunction mergeFilters(srcFilters, destFilters) {\n const mergedFieldIds = [];\n let filters = [];\n if (srcFilters.length > 0) {\n srcFilters.forEach(filter => {\n filters.push(filter);\n });\n } else {\n filters = destFilters;\n }\n if (filters.length > 0) {\n filters.forEach((filter, index) => {\n for (let i = 0; i < destFilters.length; i++) {\n if (filter.field_id == destFilters[i].field_id) {\n mergedFieldIds.push(filter.field_id);\n filters[index] = gudhub.mergeObjects(destFilters[i], filter);\n }\n }\n });\n for (let k = 0; k < destFilters.length; k++) {\n if (!mergedFieldIds.includes(destFilters[k].field_id)) {\n filters.push(destFilters[k]);\n }\n }\n }\n return filters;\n}\n// EXTERNAL MODULE: ./node_modules/jsonpath/jsonpath.js\nvar jsonpath = __webpack_require__(9832);\n;// CONCATENATED MODULE: ./GUDHUB/Utils/json_to_items/json_to_items.js\n\n\n/*\n|==================================== JSON TO ITEMS ==================================|\n|====================== jsonToItems (json, fieldsMap) =================|\n|=====================================================================================|\n| Arguments:\n| - json - is an object that is going to be converted to items\n|\n|\n| - fieldsMap - this map is an object array that contains field_id and jsonPath to get data from \n| [\n| {\n| field_id: 431,\n| json_path : \"$..item_id\"\n| }\n| ]\n|\n|\n| - Returns items_list:\n| [\n| fields: {\n| field_id: 12356,\n| field_value: \"test value\"\n| }\n| ]\n|\n|=====================================================================================|\n*/\n\nfunction jsonToItems(json, fieldsMap) {\n let proccessedMap = [];\n let itemsPath = [];\n\n //-- Step 1 --// \n // iterating through map and generating list of paths for each field_id\n fieldsMap.forEach(fieldMap => {\n let json_paths = [];\n try {\n json_paths = jsonpath.paths(json, fieldMap.json_path);\n proccessedMap.push({\n field_id: fieldMap.field_id,\n json_paths: json_paths,\n json_paths_length: json_paths.length\n });\n } catch (err) {\n console.log(err);\n }\n });\n\n //-- Step 2 --//\n // we are sorrting by json_paths_length to find a field with biggest number of json_paths\n // we are going to use the first element of the proccessedMap array as a main iterator\n proccessedMap.sort((b, a) => {\n return a.json_paths_length - b.json_paths_length;\n });\n\n //-- Step 3 --//\n // creating items array based on proccessedMap\n let items = getPathForItems(proccessedMap).map(itemPath => {\n return {\n fields: itemPath.fields.map(field => {\n return {\n field_id: field.field_id,\n field_value: jsonpath.value(json, field.json_path)\n };\n })\n };\n });\n return items;\n}\n\n//**************** BEST MATCH ****************//\n// it looks for jsonPath in the pathsToCompare that is mutching the best\nfunction bestMatch(targetPath, pathsToCompare) {\n let matchedPaths = [];\n\n //-- Creating matchedPaths for compearing targetPath with pathsToCompare\n pathsToCompare.forEach(path => {\n matchedPaths.push({\n path_to_compare: path,\n match_coefficient: 0\n });\n });\n\n //-- Assigning match_coefficient to each path from matchedPaths arrey to determine which path match the best\n // Bigger coefficient means better munch \n targetPath.forEach((trgElem, key) => {\n for (var i = 0; i < matchedPaths.length; i++) {\n if (matchedPaths[i].path_to_compare[key] == trgElem) {\n matchedPaths[i].match_coefficient += 1 / (key + 1);\n }\n }\n });\n\n //-- Sorting matchedPaths by match_coefficient in order to return puth that match the best\n matchedPaths.sort((b, a) => {\n return a.match_coefficient - b.match_coefficient;\n });\n\n //-- Returning first element of matchedPaths[] with biggest match_coefficient with is a best match result\n return matchedPaths[0].path_to_compare;\n}\n\n//*************** GET PATH FOR ITEMS ****************//\n/* Here we create array of items those are contains jsonePaths \n/* at the next step we are going to create field_value from json_path\n| [\n| fields:\n| {\n| field_id : 123,\n| json_path : $..test_path\n| }\n| ]\n|*/\nfunction getPathForItems(proccessedMap) {\n let itemsPath = [];\n proccessedMap.length && proccessedMap[0].json_paths.forEach(jsonPath => {\n let itemPath = {\n fields: []\n };\n proccessedMap.forEach(pMap => {\n itemPath.fields.push({\n field_id: pMap.field_id,\n json_path: bestMatch(jsonPath, pMap.json_paths)\n });\n });\n itemsPath.push(itemPath);\n });\n return itemsPath;\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/merge_compare_items/merge_compare_items.js\n//********************************************//\n//******************* ITEMS ******************//\n//********************************************//\n\n/*\n|============================================== POPULATE WITH ITEM REFFERENCE ==========================================================|\n|===== populateWithItemRef (sorceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id) =====|\n|=======================================================================================================================================|\n| We update destination Items with item_ref of sorce Items. Connectiontion between sorceItemsRef & srcFieldIdToCompare we are checking with \n| help of srcFieldIdToCompare & destFieldIdToCompare. After connection is detected we save the item_ref into destFieldForRef.\n|\n| Arguments:\n| - sorceItemsRef - items those are will be used as referense for item_ref\n| - destinationItems - items those are will be used to save item_ref to sorceItemsRef \n| - srcFieldIdToCompare - we use value from this field to find the similar items in source and destimation items array\n| - destFieldIdToCompare - we use value from this field to find the similar items in source and destimation items array\n| - destFieldForRef - field where value of item_ref\n| - app_id - we use aplication id to generate value for item_ref\n|\n| Return:\n| [{},{}...] - returns arey of updated items\n| \n|=====================================================================================================================================|\n*/\n\n//********************** POPULATE WITH ITEM REFFERENCE ************************/\nfunction populateWithItemRef(sorceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id) {\n let resultedItems = [];\n const theSameIdValueFn = function (srcComprItem, dstComprItem) {\n let fieldForRef = getFieldById(dstComprItem, destFieldForRef);\n if (fieldForRef) {\n fieldForRef.field_value = app_id + \".\" + srcComprItem.item_id;\n resultedItems.push(dstComprItem);\n }\n };\n destinationItems.forEach(dstItem => {\n sorceItemsRef.forEach(srcItem => {\n compareTwoItemsByFieldId(srcItem, dstItem, srcFieldIdToCompare, destFieldIdToCompare, theSameIdValueFn);\n });\n });\n return resultedItems;\n}\n\n/*\n|====================================== MERGE ITEM ==================================|\n|============== mergeItems (sorceItems, destinationItems) ============|\n|====================================================================================|\n| We replace all fields with values in destinationItems by values from sorceItems.\n| If destinationItems doesn't have fields that sorceItems then we create them in destinationItems\n|\n| NOTE: items from chanks hase a history properti in a field \n|\n| Arguments:\n| - sorceItems - array of items that will be used to update items from destinationItems items array\n| - destinationItems - array of items that is gong to be updated\n|\n| Return:\n| [{},{}...] - returns arey of updated items\n| \n|==================================================================================|\n*/\n\n//********************** MERGE ITEMS ************************/\nfunction mergeItems(sorceItems, destinationItems, mergeByFieldId) {\n let src = JSON.parse(JSON.stringify(sorceItems));\n let dst = JSON.parse(JSON.stringify(destinationItems));\n let result = [];\n\n //-- The Source and in the Destination has the same item ids but different field values\n const differentSrcItemFn = function (srcItem, dstItem) {\n result.push(mergeTwoItems(srcItem, dstItem));\n };\n\n //-- The Source and in the Destination has the same item ids and field values\n const theSameSrcItemFn = function (srcItem) {\n result.push(srcItem);\n };\n\n //-- Items thoase exist in the Source but they are not exist in the Destination list \n const newSrcItemFn = function (srcItem) {\n result.push(srcItem);\n };\n\n //-- Items thoase exist in the Destination list but they are not exist in the Source list\n const uniqDestItemFn = function (dstItem) {\n result.push(dstItem);\n };\n\n //--------- Compearing Src & Dst Items by item_id ---------//\n if (mergeByFieldId) {\n compareItemsByFieldId(src, dst, mergeByFieldId, differentSrcItemFn, theSameSrcItemFn, newSrcItemFn);\n } else compareItemsByItemId(src, dst, differentSrcItemFn, theSameSrcItemFn, newSrcItemFn, uniqDestItemFn);\n\n //--------- Final Report ---------//\n return result;\n}\n\n/*\n|==================================== COMPARE ITEM ==================================================|\n|=========== compareItems (sorceItems, destinationItems, fieldToCompare) =============|\n|====================================================================================================|\n| We compare fields of sorceItems with fields of destinationItems. It means that if sorceItems \n| have the same fields with the same values as destinationItems thay will be described as 'same_items'\n| even if destinationItems have additional fields those sorceItems doesn't have\n|\n| There to ways how it works:\n| 1 compering items by item_id (if fieldToCompare is undefined)\n| 2 compering items by value of specific field_id (if fieldToCompare is defined)\n|\n| Arguments:\n| - sorceItems - array of items that is going to be used as a sorce for comperison\n| - destinationItems - array of items that is gong to be compared with sorceItems\n| - fieldToCompare - field that we use to compare sorce items with destination items, if this is not specified then we compare items by item_id\n|\n| Return:\n| {\n| is_items_diff: false,\n| new_src_items:[],\n| diff_src_items:[],\n| same_items:[]\n| }\n|\n|==================================================================================|\n*/\n\n//********************** COMPARE ITEMS ************************/\nfunction compareItems(sorceItems, destinationItems, fieldToCompare) {\n const src = JSON.parse(JSON.stringify(sorceItems));\n const dst = JSON.parse(JSON.stringify(destinationItems));\n let result = {\n is_items_diff: false,\n new_src_items: [],\n diff_src_items: [],\n same_items: [],\n trash_src_items: []\n };\n const differentSrcItemFn = function (item) {\n result.diff_src_items.push(item);\n };\n const theSameSrcItemFn = function (item) {\n result.same_items.push(item);\n };\n const newSrcItemFn = function (item) {\n result.new_src_items.push(item);\n };\n const trashSrcItemFn = function (item) {\n result.trash_src_items.push(item);\n };\n\n //--------- Compearing Src & Dst Items by item_id ---------//\n if (fieldToCompare) {\n //TODO trashSrcItemFn\n compareItemsByFieldId(src, dst, fieldToCompare, differentSrcItemFn, theSameSrcItemFn, newSrcItemFn);\n }\n if (!fieldToCompare) {\n compareItemsByItemId(src, dst, differentSrcItemFn, theSameSrcItemFn, newSrcItemFn, null, trashSrcItemFn);\n }\n\n //--------- Final Report ---------//\n result.is_items_diff = result.new_src_items.length > 0 || result.diff_src_items.length > 0;\n return result;\n}\nfunction mergeTwoItems(src, dst) {\n src.fields.forEach(srcField => {\n let destField = getFieldById(dst, srcField.field_id);\n if (destField) {\n destField.field_value = srcField.field_value;\n\n // if we work with chanked items then we merge history \n if (srcField.history && destField.history) {\n destField.history = srcField.history.concat(destField.history);\n }\n } else {\n //-- if we didn't find field with item then we add it\n dst.fields.push(srcField);\n }\n });\n return dst;\n}\nfunction compareItemsByFieldId(src, dst, fieldToCompare, differentSrcItemFn, theSameSrcItemFn, newSrcItemFn) {\n src.forEach(srcItem => {\n let notFoundDestItemforSrc = true;\n let srcVal = getFieldById(srcItem, fieldToCompare).field_value;\n dst.forEach(dstItem => {\n let dstVal = getFieldById(dstItem, fieldToCompare).field_value;\n if (srcVal == dstVal) {\n notFoundDestItemforSrc = false;\n compareTwoItems(srcItem, dstItem, differentSrcItemFn, theSameSrcItemFn);\n }\n });\n\n //-- If there no destination item with the same item_id then it means that item is new\n if (notFoundDestItemforSrc) {\n newSrcItemFn(srcItem);\n }\n });\n}\nfunction compareItemsByItemId(src, dst, differentSrcItemFn, theSameSrcItemFn, newSrcItemFn, uniqDestItemFn, trashSrcItemFn) {\n let dstItemsMap = new ItemsMapper(dst);\n src.forEach(srcItem => {\n let destIndex = dstItemsMap.pullItemIndex(srcItem.item_id);\n if (destIndex != undefined) {\n compareTwoItems(srcItem, dst[destIndex], differentSrcItemFn, theSameSrcItemFn, trashSrcItemFn);\n } else {\n if (srcItem.trash) trashSrcItemFn(srcItem);\n if (!srcItem.trash) newSrcItemFn(srcItem);\n }\n ;\n });\n\n //-- In case if we have destination items which are new then we \n if (uniqDestItemFn) for (const [key, value] of Object.entries(dstItemsMap.itemsMap)) {\n uniqDestItemFn(dst[value]);\n }\n}\nfunction compareTwoItems(src, dst, differentSrcItemFn, theSameSrcItemFn, trashSrcItemFn) {\n let sameItem = true;\n for (let i = 0; i < src.fields.length; i++) {\n let destField = getFieldById(dst, src.fields[i].field_id);\n if (destField) {\n //-- if value of some field of the item is different then item is different too\n if (destField.field_value != src.fields[i].field_value) {\n sameItem = sameItem && false;\n }\n } else {\n //-- if we didn't find field with item then item is different\n sameItem = sameItem && false;\n }\n }\n\n //-- Sending Compearing Result\n if (sameItem) {\n if (src.trash) trashSrcItemFn(src, dst);\n if (!src.trash) theSameSrcItemFn(src, dst);\n }\n if (!sameItem) {\n if (src.trash) trashSrcItemFn(src, dst);\n if (!src.trash) differentSrcItemFn(src, dst);\n }\n}\nfunction compareTwoItemsByFieldId(srcItem, dstItem, srcFieldId, dstFieldId, theSameSrcItemFn) {\n let srcFieldVal = getFieldById(srcItem, srcFieldId).field_value;\n let dstFieldIdVal = getFieldById(dstItem, dstFieldId).field_value;\n if (srcFieldVal == dstFieldIdVal) {\n theSameSrcItemFn(srcItem, dstItem);\n }\n}\nfunction getFieldById(item, field_id) {\n let result = null;\n for (let i = 0; i < item.fields.length; i++) {\n if (field_id == item.fields[i].field_id) {\n result = item.fields[i];\n }\n }\n ;\n return result;\n}\nclass ItemsMapper {\n constructor(items) {\n this._itemsMap = {};\n items.forEach((item, key) => {\n this._itemsMap[item.item_id] = key;\n });\n }\n pullItemIndex(item_id) {\n let index = this._itemsMap[item_id];\n delete this._itemsMap[item_id];\n return index;\n }\n getItemIndex(item_id) {\n return this._itemsMap[item_id];\n }\n get itemsMap() {\n return this._itemsMap;\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/group.js\nfunction group(fieldGroup, items) {\n let groupItemList = [];\n let arrayGroupField;\n if (!fieldGroup) {\n groupItemList = items;\n } else {\n arrayGroupField = fieldGroup.split(\",\");\n }\n let arrayValue = new Set();\n if (fieldGroup) {\n items.forEach(item => {\n let valueField = \"\";\n arrayGroupField.forEach((fieldToGroup, index) => {\n const findField = item.fields.find(field => field.field_id == fieldToGroup);\n if (findField) {\n valueField += findField.field_value;\n }\n if (arrayGroupField.length - 1 == index) {\n let itemUnics = findUniqItem(valueField);\n if (itemUnics) {\n groupItemList.push(item);\n }\n }\n });\n });\n }\n\n // send field value and check if it's unique\n function findUniqItem(value) {\n const uniqValue = !arrayValue.has(value);\n if (uniqValue) {\n arrayValue.add(value);\n }\n return uniqValue;\n }\n return groupItemList;\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/populate_items/populate_items.js\n//********************************************//\n//******************* ITEMS ******************//\n//********************************************//\n\n/*\n|====================================== ITEMS UPDATE ================================|\n|=========== updateItems (items, model, eraseOtherValues) ============|\n|====================================================================================|\n|\n| items - GudHub items those we are going to be updated\n| eraseOtherValues - if is 'true' then we erase fields those are not going to be updated\n| model - by this model we update values. The model format should have folowing format:\n|\n| \n| model = [\n| {\n| \"element_id\" : 228464,\n| \"field_value\" : 777\n| }]\n|\n|==================================================================================|\n*/\n\n//********************** UPDATE ITEMS ************************/\nfunction populateItems(items, model, keep_data) {\n var itemsCopy = JSON.parse(JSON.stringify(items));\n if (keep_data) {\n return populateItemsAndKeepOtherValues(itemsCopy, model);\n } else {\n return populateItemsAndEraseOtherValues(itemsCopy, model);\n }\n}\n\n//---- Update Items And KEEP Other Values ----//\nfunction populateItemsAndKeepOtherValues(items, model) {\n items.forEach(item => {\n model.forEach(modelField => {\n let field = item.fields.find(sourceField => sourceField.element_id == modelField.element_id);\n if (field) {\n field.field_value = modelField.field_value;\n } else {\n //-- if we didn't find field with item then we add it\n modelField.field_id = modelField.element_id; //backend send ERROR if don't send field_id\n item.fields.push(modelField);\n }\n });\n });\n return items;\n}\n\n//---- Update Items And ERASE Other Values ----//\nfunction populateItemsAndEraseOtherValues(items, model) {\n items.forEach(item => {\n item.fields = [].concat(model);\n });\n return items;\n}\n// EXTERNAL MODULE: ./node_modules/date-fns/add/index.js\nvar add = __webpack_require__(5430);\n// EXTERNAL MODULE: ./node_modules/date-fns/setDay/index.js\nvar setDay = __webpack_require__(8933);\n// EXTERNAL MODULE: ./node_modules/date-fns/isSameWeek/index.js\nvar isSameWeek = __webpack_require__(5276);\n;// CONCATENATED MODULE: ./GUDHUB/Utils/get_date/get_date.js\n/*\n|====================================== GETTING DATE ================================|\n|=========================== getDate (queryKey) ======================|\n|====================================================================================|\n| Arguments:\n| - queryKey - according to 'queryKey' we decide with date should be returned to user\n|\n| Return:\n| - date in miliseconds\n| \n|==================================================================================|\n*/\n\n\n\n\n//********************** POPULATE WITH DATE ************************//\nfunction populateWithDate(items, model) {\n items.forEach(item => {\n model.forEach(modelField => {\n let field = item.fields.find(sourceField => sourceField.element_id == modelField.element_id);\n if (field) {\n if (modelField.data_range) {\n if (modelField.date_type.includes('calendar')) {\n field.field_value = `${getStartDate(modelField.date_type)}:${get_date_getDate(modelField.date_type)}`;\n } else {\n field.field_value = `${getStartDate(modelField.date_type)}:${get_date_getDate(modelField.date_type)}`;\n }\n } else {\n field.field_value = get_date_getDate(modelField.date_type);\n }\n } else {\n //-- if we didn't find field in item then we add it\n item.fields.push({\n field_id: modelField.element_id,\n element_id: modelField.element_id,\n field_value: get_date_getDate(modelField.date_type)\n });\n }\n });\n });\n return items;\n}\n\n//******************* GET START DATE *********************//\nfunction getStartDate(dateType) {\n let currentDate = new Date();\n function weekTime(currentDate) {\n var day = currentDate.getDay();\n let numberOfDays;\n if (dateType.includes(\"week_current,current\")) {\n numberOfDays = 0;\n }\n if (dateType.includes(\"week_next,future\")) {\n numberOfDays = 7;\n }\n if (dateType.includes(\"week_past,past\")) {\n numberOfDays = -7;\n }\n let diff = currentDate.getDate() - day + numberOfDays + (day == 0 ? -6 : 1);\n return new Date(currentDate.setDate(diff));\n }\n function quarterTime(currentDate) {\n let numberMonths;\n let numberDays;\n let currentQuarter = Math.floor(currentDate.getMonth() / 3);\n let year = currentDate.getFullYear();\n if (dateType.includes(\"quarter_current,current\")) {\n numberMonths = 0;\n numberDays = 0;\n }\n if (dateType.includes(\"quarter_next,future\")) {\n numberMonths = 3;\n numberDays = 0;\n }\n if (dateType.includes(\"quarter_past,past\")) {\n numberMonths = -3;\n numberDays = 0;\n }\n return new Date(year, currentQuarter * 3 + numberMonths, 1 + numberDays);\n }\n switch (dateType) {\n case \"week_current,current\":\n return weekTime(new Date()).getTime();\n case \"month_current,current\":\n return new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).getTime();\n case \"quarter_current,current\":\n return quarterTime(new Date()).getTime();\n case \"year_current,current\":\n return add(new Date(currentDate.getFullYear(), 0, 1), {\n years: 0\n }).getTime();\n case \"week_next,future\":\n return weekTime(new Date()).getTime();\n case \"month_next,future\":\n return new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1).getTime();\n case \"quarter_next,future\":\n return quarterTime(new Date()).getTime();\n case \"year_next,future\":\n return add(currentDate, {\n days: 0\n }).getTime();\n case \"week_past,past\":\n return weekTime(new Date()).getTime();\n case \"month_past,past\":\n return new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).getTime();\n case \"quarter_past,past\":\n return quarterTime(new Date()).getTime();\n case \"year_past,past\":\n return add(currentDate, {\n years: -1\n }).getTime();\n case \"year_past,past,calendar\":\n return add(new Date(currentDate.getFullYear(), 0, 1), {\n years: -1\n }).getTime();\n case \"year_future,future,calendar\":\n return add(new Date(currentDate.getFullYear() + 1, 0, 1), {\n years: 0\n }).getTime();\n case \"today_current,current\":\n return add(currentDate, {\n days: 0\n }).getTime();\n case \"tomorrow,future\":\n return add(currentDate, {\n days: 1\n }).getTime();\n case \"7_days_future,future\":\n return add(currentDate, {\n days: 0\n }).getTime();\n case \"10_days_future,future\":\n return add(currentDate, {\n days: 0\n }).getTime();\n case \"14_days_future,future\":\n return add(currentDate, {\n days: 0\n }).getTime();\n case \"30_days_future,future\":\n return add(currentDate, {\n days: 0\n }).getTime();\n case \"yesterday,past\":\n return add(currentDate, {\n days: -1\n }).getTime();\n case \"7_days_past,past\":\n return add(currentDate, {\n days: -7\n }).getTime();\n case \"10_days_past,past\":\n return add(currentDate, {\n days: -10\n }).getTime();\n case \"14_days_past,past\":\n return add(currentDate, {\n days: -14\n }).getTime();\n case \"30_days_past,past\":\n return add(currentDate, {\n days: -30\n }).getTime();\n }\n}\n//********************** GET DATE ************************//\nfunction get_date_getDate(queryKey) {\n var date = new Date();\n function getMonday(d) {\n d = new Date(d);\n var day = d.getDay(),\n diff = d.getDate() - day + 6 + (day == 0 ? +6 : 1);\n return new Date(d.setDate(diff));\n }\n function getNextWeek(d) {\n d = new Date(d);\n var day = d.getDay(),\n diff = d.getDate() - day + 13 + (day == 0 ? -6 : 1);\n return new Date(d.setDate(diff));\n }\n function getPastWeek(d) {\n d = new Date(d);\n var day = d.getDay(),\n diff = d.getDate() - day - 1 + (day == 0 ? -6 : 1);\n return new Date(d.setDate(diff));\n }\n let currentQuarter = Math.floor(date.getMonth() / 3);\n let year = date.getFullYear();\n switch (queryKey) {\n case \"next_day\":\n return add(date, {\n days: 1\n }).getTime();\n case \"two_days_after\":\n return add(date, {\n days: 2\n }).getTime();\n case \"three_days_after\":\n return add(date, {\n days: 3\n }).getTime();\n case \"four_days_after\":\n return add(date, {\n days: 4\n }).getTime();\n case \"next_week\":\n return add(date, {\n weeks: 1\n }).getTime();\n case \"two_weeks_after\":\n return add(date, {\n weeks: 2\n }).getTime();\n case \"three_weeks_after\":\n return add(date, {\n weeks: 3\n }).getTime();\n case \"this_sunday\":\n return setDay(date, 0, {\n weekStartsOn: 1\n });\n case \"this_monday\":\n return setDay(date, 1, {\n weekStartsOn: 1\n });\n case \"this_tuesday\":\n return setDay(date, 2, {\n weekStartsOn: 1\n });\n case \"this_wednesday\":\n return setDay(date, 3, {\n weekStartsOn: 1\n });\n case \"this_thursday\":\n return setDay(date, 4, {\n weekStartsOn: 1\n });\n case \"this_friday\":\n return setDay(date, 5, {\n weekStartsOn: 1\n });\n case \"this_saturday\":\n return setDay(date, 6, {\n weekStartsOn: 1\n });\n case \"today_current,current\":\n return add(date, {\n days: 0\n }).getTime();\n case \"tomorrow,future\":\n return add(date, {\n days: 1\n }).getTime();\n case \"7_days_future,future\":\n return add(date, {\n days: 7\n }).getTime();\n case \"10_days_future,future\":\n return add(date, {\n days: 10\n }).getTime();\n case \"14_days_future,future\":\n return add(date, {\n days: 14\n }).getTime();\n case \"30_days_future,future\":\n return add(date, {\n days: 30\n }).getTime();\n case \"yesterday,past\":\n return add(date, {\n days: -1\n }).getTime();\n case \"7_days_past,past\":\n return add(date, {\n days: 0\n }).getTime();\n case \"10_days_past,past\":\n return add(date, {\n days: 0\n }).getTime();\n case \"14_days_past,past\":\n return add(date, {\n days: 0\n }).getTime();\n case \"30_days_past,past\":\n return add(date, {\n days: 0\n }).getTime();\n case \"year_future,future,calendar\":\n return add(new Date(date.getFullYear() + 1, 0, 0), {\n years: 1\n }).getTime();\n case \"year_past,past,calendar\":\n return add(new Date(date.getFullYear(), 0, 0), {\n years: 0\n }).getTime();\n case \"week_current,current\":\n return getMonday(new Date()).getTime();\n case \"month_current,current\":\n return new Date(date.getFullYear(), date.getMonth() + 1, 0).getTime();\n case \"quarter_current,current\":\n return new Date(year, (currentQuarter + 1) * 3, 0).getTime();\n case \"year_current,current\":\n return add(new Date(date.getFullYear() + 1, 0, 0), {\n years: 0\n }).getTime();\n case \"week_next,future\":\n return getNextWeek(new Date()).getTime();\n case \"month_next,future\":\n return new Date(date.getFullYear(), date.getMonth() + 2, 0).getTime();\n case \"quarter_next,future\":\n return new Date(year, (currentQuarter + 1) * 3 + 3, 0).getTime();\n case \"year_next,future\":\n return add(date, {\n years: 1\n }).getTime();\n case \"week_past,past\":\n return getPastWeek(new Date()).getTime();\n case \"month_past,past\":\n return new Date(date.getFullYear(), date.getMonth(), 0, 0).getTime();\n case \"quarter_past,past\":\n return new Date(year, (currentQuarter + 1) * 3 - 3, 0).getTime();\n case \"year_past,past\":\n return add(date, {\n days: 0\n }).getTime();\n case \"now\":\n default:\n return date.getTime();\n }\n}\n\n//********************** CHECK RECURRING DATE ************************//\n\nfunction checkRecurringDate(date, option) {\n date = new Date(date);\n let currentDate = new Date();\n switch (option) {\n case 'day':\n if (date.getDate() + '.' + date.getMonth() === currentDate.getDate() + '.' + currentDate.getMonth()) {\n return true;\n } else {\n return false;\n }\n case 'week':\n let currentYear = new Date().getFullYear();\n let shiftedYearDate = new Date(currentYear, date.getMonth(), date.getDate());\n return isSameWeek(shiftedYearDate, currentDate);\n case 'month':\n if (date.getMonth() === currentDate.getMonth()) {\n return true;\n } else {\n return false;\n }\n default:\n return true;\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/merge_objects/merge_objects.js\n// Value of properties for source object woun't be changed by target object\n// If source of target hase unique properties they are going to be created in resulted object\n\nfunction mergeObjects(target, source, optionsArgument) {\n return deepmerge(target, source, optionsArgument);\n}\n\n/* Deepmerge - Start */\n// this code was copied from https://codepen.io/pushpanathank/pen/owjJGG\n// Basicaly I need it to marge field models\nfunction isMergeableObject(val) {\n var nonNullObject = val && typeof val === 'object';\n return nonNullObject && Object.prototype.toString.call(val) !== '[object RegExp]' && Object.prototype.toString.call(val) !== '[object Date]';\n}\nfunction emptyTarget(val) {\n return Array.isArray(val) ? [] : {};\n}\nfunction cloneIfNecessary(value, optionsArgument) {\n var clone = optionsArgument && optionsArgument.clone === true;\n return clone && isMergeableObject(value) ? deepmerge(emptyTarget(value), value, optionsArgument) : value;\n}\nfunction defaultArrayMerge(target, source, optionsArgument) {\n var destination = target.slice();\n source.forEach(function (e, i) {\n if (typeof destination[i] === 'undefined') {\n destination[i] = cloneIfNecessary(e, optionsArgument);\n } else if (isMergeableObject(e)) {\n destination[i] = deepmerge(target[i], e, optionsArgument);\n } else if (target.indexOf(e) === -1) {\n destination.push(cloneIfNecessary(e, optionsArgument));\n }\n });\n return destination;\n}\nfunction mergeObject(target, source, optionsArgument) {\n var destination = {};\n if (isMergeableObject(target)) {\n Object.keys(target).forEach(function (key) {\n destination[key] = cloneIfNecessary(target[key], optionsArgument);\n });\n }\n Object.keys(source).forEach(function (key) {\n if (!isMergeableObject(source[key]) || !target[key]) {\n destination[key] = cloneIfNecessary(source[key], optionsArgument);\n } else {\n destination[key] = deepmerge(target[key], source[key], optionsArgument);\n }\n });\n return destination;\n}\nfunction deepmerge(target, source, optionsArgument) {\n target = target !== undefined ? target : {};\n source = source !== undefined ? source : {};\n var array = Array.isArray(source);\n var options = optionsArgument || {\n arrayMerge: defaultArrayMerge\n };\n var arrayMerge = options.arrayMerge || defaultArrayMerge;\n if (array) {\n return Array.isArray(target) ? arrayMerge(target, source, optionsArgument) : cloneIfNecessary(source, optionsArgument);\n } else {\n return mergeObject(target, source, optionsArgument);\n }\n}\ndeepmerge.all = function deepmergeAll(array, optionsArgument) {\n if (!Array.isArray(array) || array.length < 2) {\n throw new Error('first argument should be an array with at least two elements');\n }\n\n // we are sure there are at least 2 values, so it is safe to have no initial value\n return array.reduce(function (prev, next) {\n return deepmerge(prev, next, optionsArgument);\n });\n};\n/* Deepmerge - Ends */\n\n// // Sample\n// const defaultPerson = {\n// name: 'Push',\n// gender: 'Male',\n// hair: {\n// color: 'Black',\n// cut: 'Short'\n// },\n// eyes: 'blue',\n// family: ['mom', 'dad']\n// };\n\n// const me = {\n// name: 'Nathan',\n// gender: 'Male',\n// hair: {\n// cut: 'Long'\n// },\n// family: ['wife', 'kids', 'dog']\n// };\n\n// const result1 = deepmerge(defaultPerson, me);\n// document.getElementById('result1').innerHTML = JSON.stringify(result1, null, \"\\t\");\n\n// const result2 = deepmerge.all([,\n// { level1: { level2: { name: 'Push', parts: ['head', 'shoulders'] } } },\n// { level1: { level2: { face: 'Round', parts: ['knees', 'toes'] } } },\n// { level1: { level2: { eyes: 'Black', parts: ['eyes'] } } },\n// ]);\n\n// document.getElementById('result2').innerHTML = JSON.stringify(result2, null, \"\\t\");\n;// CONCATENATED MODULE: ./GUDHUB/Utils/merge_chunks/merge_chunks.worker.js\nfunction mergeChunks(chunks) {\n const result = {};\n chunks.forEach(chunk => {\n chunk.items_list.forEach(item => {\n const dstItem = result[item.item_id];\n if (dstItem) {\n dstItem.trash = item.trash;\n return item.fields.forEach(srcField => {\n let isFieldNonExist = true;\n dstItem.fields = dstItem.fields.map(dstField => {\n if (Number(dstField.field_id) === Number(srcField.field_id)) {\n isFieldNonExist = false;\n if (dstField.field_value != srcField.field_value) {\n return {\n ...srcField,\n history: srcField.history.concat(dstField.history)\n };\n }\n return dstField;\n }\n return dstField;\n });\n if (isFieldNonExist) dstItem.fields.push(srcField);\n });\n }\n return result[item.item_id] = item;\n });\n });\n return Object.values(result);\n}\nself.onmessage = function (e) {\n const mergedChunks = mergeChunks(e.data);\n self.postMessage(mergedChunks);\n};\nfunction mergeChunksWorker() {\n return `function mergeChunks(chunks) {\n const result = {};\n \n chunks.forEach((chunk) => {\n chunk.items_list.forEach((item) => {\n const dstItem = result[item.item_id];\n if (dstItem) {\n dstItem.trash = item.trash;\n return item.fields.forEach((srcField) => {\n let isFieldNonExist = true;\n dstItem.fields = dstItem.fields.map((dstField) => {\n if (Number(dstField.field_id) === Number(srcField.field_id)) {\n isFieldNonExist = false;\n if (dstField.field_value != srcField.field_value) {\n return {\n ...srcField,\n history: srcField.history.concat(dstField.history),\n };\n }\n return dstField;\n }\n return dstField;\n });\n if (isFieldNonExist) dstItem.fields.push(srcField);\n });\n }\n return (result[item.item_id] = item);\n });\n });\n return Object.values(result);\n }\n\n\n self.onmessage = function(e) { \n const mergedChunks = mergeChunks(e.data);\n self.postMessage(mergedChunks);\n }`;\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/merge_chunks/merge_chunks.js\n\n\n// const mergeChunksWorkerSingletone = new Worker('mergeWorker.js'); //TODO\n\nfunction merge_chunks_mergeChunks(chunks) {\n if (typeof Worker !== 'undefined') {\n return new Promise((resolve, reject) => {\n const chunkWorkerBlob = new Blob([mergeChunksWorker()], {\n type: \"application/javascript\"\n });\n let worker = new Worker(URL.createObjectURL(chunkWorkerBlob));\n worker.postMessage(chunks);\n worker.onmessage = function (e) {\n resolve(e.data);\n worker.terminate();\n };\n worker.onerror = function (e) {\n reject();\n worker.terminate();\n };\n worker.postMessage(chunks);\n });\n } else {\n return mergeChunks(chunks);\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/nested_list/nested_list.js\nfunction makeNestedList(arr, id, parent_id, children_property, priority_property) {\n let array = JSON.parse(JSON.stringify(arr));\n let children = Boolean(children_property) ? children_property : 'children';\n let priority = Boolean(priority_property) ? priority_property : false;\n let i;\n for (i = 0; i < array.length; i++) {\n if (array[i][parent_id] && array[i][parent_id] !== 0) {\n array.forEach(parent => {\n if (array[i][parent_id] == parent[id]) {\n if (!parent[children]) {\n parent[children] = [];\n }\n parent[children].push(array[i]);\n array.splice(i, 1);\n i == 0 ? i = 0 : i--;\n } else if (parent[children]) {\n findIdsOfChildren(parent);\n }\n });\n }\n }\n function findIdsOfChildren(parent) {\n parent[children].forEach(child => {\n if (child[id] == array[i][parent_id]) {\n if (!child[children]) {\n child[children] = [];\n }\n child[children].push(array[i]);\n array.splice(i, 1);\n i == 0 ? i = 0 : i--;\n } else if (child[children]) {\n findIdsOfChildren(child);\n }\n });\n }\n function sortChildrensByPriority(unsorted_array) {\n unsorted_array.sort((a, b) => a[priority] - b[priority]);\n unsorted_array.forEach(element => {\n if (element[children]) {\n sortChildrensByPriority(element[children]);\n }\n });\n }\n if (priority) {\n sortChildrensByPriority(array);\n }\n return array;\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/MergeFields/MergeFields.js\nclass FieldsOperator {\n constructor(gudhub) {\n this.gudhub = gudhub;\n }\n mergeFieldLists(fieldsToView, fieldList) {\n let fieldsToViewCopy = JSON.parse(JSON.stringify(fieldsToView));\n let fieldListCopy = JSON.parse(JSON.stringify(fieldList));\n let existingFieldsIds = fieldListCopy.map(field => field.field_id);\n if (!fieldListCopy.length) {\n return [];\n }\n return fieldListCopy.reduce((viewArray, currentField) => {\n let positionInViewArray = null;\n let props = viewArray.find((view, index) => {\n if (currentField.field_id == view.field_id) {\n positionInViewArray = index;\n return true;\n }\n return false;\n });\n if (!props) {\n let defaultIntrpr = currentField.data_model && currentField.data_model.interpretation ? currentField.data_model.interpretation.find(intrpr => {\n return intrpr.src == 'table';\n }) || {\n settings: {\n show_field: 1\n }\n } : {\n settings: {\n show_field: 1\n }\n };\n if (defaultIntrpr.settings.show_field) {\n let firstMerge = this.gudhub.util.mergeObjects({\n show: 1\n }, defaultIntrpr);\n let secondMerge = this.gudhub.util.mergeObjects(firstMerge, currentField);\n viewArray.push(secondMerge);\n }\n } else {\n viewArray[positionInViewArray] = this.gudhub.util.mergeObjects(viewArray[positionInViewArray], currentField);\n }\n return viewArray;\n }, fieldsToViewCopy).filter(function (field) {\n return field.show && existingFieldsIds.indexOf(field.field_id) != -1;\n });\n }\n createFieldsListToView(appId, tableSettingsFieldListToView) {\n const self = this;\n return new Promise(async resolve => {\n let fieldList = await this.gudhub.getFieldModels(appId);\n if (tableSettingsFieldListToView.length !== 0) {\n let correctFieldList = [];\n tableSettingsFieldListToView.forEach((elementFromTable, index) => {\n let fieldOnPipe = fieldList.find(element => elementFromTable.field_id == element.field_id);\n if (fieldOnPipe) {\n let show_field = fieldOnPipe.data_model.interpretation.find(intrpr => intrpr.src == 'table');\n if (!show_field) {\n show_field = {\n settings: {\n show_field: 1\n }\n };\n }\n correctFieldList.push({\n field_id: fieldOnPipe.field_id,\n show: elementFromTable.show,\n width: elementFromTable.width ? elementFromTable.width : \"150px\"\n });\n }\n if (index + 1 == tableSettingsFieldListToView.length) {\n checkFiledFromPipe(correctFieldList);\n }\n });\n } else {\n checkFiledFromPipe(tableSettingsFieldListToView);\n }\n function checkFiledFromPipe(correctFieldList) {\n let counter = 0;\n fieldList.forEach((elemetFromPipe, index) => {\n let correctFiel = correctFieldList.find(elemet => elemetFromPipe.field_id == elemet.field_id);\n if (!correctFiel) {\n self.gudhub.ghconstructor.getInstance(elemetFromPipe.data_type).then(data => {\n if (data) {\n let template = data.getTemplate();\n let show_field = template.model.data_model.interpretation.find(intrpr => intrpr.src == 'table');\n if (!show_field) {\n show_field = {\n settings: {\n show_field: 1\n }\n };\n }\n correctFieldList.push({\n field_id: elemetFromPipe.field_id,\n show: show_field.settings.show_field\n });\n if (counter == fieldList.length - 1) {\n resolve(correctFieldList);\n }\n }\n counter++;\n }, function errorCallback(result) {\n counter++;\n });\n } else {\n if (counter == fieldList.length - 1) {\n resolve(correctFieldList);\n }\n counter++;\n }\n });\n }\n });\n }\n createFieldsListToViewWithDataType(appId, tableSettingsFieldListToView) {\n return new Promise(async resolve => {\n let columnsToView = [];\n let fieldList = await this.gudhub.getFieldModels(appId);\n let actualFieldIds = fieldList.map(field => +field.field_id);\n const promises = [];\n columnsToView = fieldList.reduce((viewColumsList, currentField) => {\n let field = viewColumsList.find((view, index) => {\n if (currentField.field_id == view.field_id) {\n return true;\n }\n return false;\n });\n if (!field) {\n viewColumsList.push({\n field_id: currentField.field_id,\n data_type: currentField.data_type\n });\n promises.push(new Promise(async resolve => {\n const instance = await this.gudhub.ghconstructor.getInstance(currentField.data_type);\n const template = instance.getTemplate();\n const defaultIntepretation = template.model.data_model.interpretation.find(intrpr => intrpr.src == 'table') || {\n settings: {\n show_field: 1\n }\n };\n viewColumsList.find(view => view.field_id == currentField.field_id).show = defaultIntepretation.settings.show_field;\n resolve(true);\n }));\n }\n return viewColumsList;\n }, tableSettingsFieldListToView);\n Promise.all(promises).then(() => {\n columnsToView = columnsToView.filter(field => actualFieldIds.indexOf(field.field_id) != -1);\n resolve(columnsToView);\n });\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/ItemsSelection/ItemsSelection.js\nclass ItemsSelection {\n constructor(gudhub) {\n this.gudhub = gudhub;\n this.selectedItems = {};\n }\n async selectItems(appId, items) {\n if (!this.selectedItems.hasOwnProperty(appId)) {\n this.selectedItems[appId] = {\n items: [],\n app: []\n };\n let app = await this.gudhub.getApp(appId);\n this.selectedItems[appId].app = app;\n }\n let itemObject = this.selectedItems[appId];\n let selectedItemsIds = itemObject.items.map(obj => obj.item_id);\n items.forEach(item => {\n if (selectedItemsIds.indexOf(item.item_id) != -1) {\n itemObject.items.splice(selectedItemsIds.indexOf(item.item_id), 1);\n } else {\n itemObject.items[itemObject.items.length] = item;\n }\n });\n }\n getSelectedItems(appId) {\n return this.selectedItems[appId] ? this.selectedItems[appId] : {\n items: [],\n app: []\n };\n }\n clearSelectedItems(appId) {\n if (this.selectedItems[appId]) {\n this.selectedItems[appId].items = [];\n }\n }\n isItemSelected(appId, itemId) {\n let array = this.getSelectedItems(appId);\n if (array !== null) {\n array = array.items.map(obj => obj.item_id);\n return array.indexOf(itemId) != -1;\n } else {\n return false;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/compare_items_lists_worker/compare_items_lists.worker.js\nfunction compare_items_lists_Worker() {\n return `function createList(items) {\n return items.reduce(\n (acc, item) => {\n acc.list[item.item_id] = item;\n acc.ids.push(item.item_id);\n return acc;\n },\n { ids: [], list: {} }\n );\n };\n function compareItemsLists(oldItems, newItems) {\n const { ids: oldIds, list: oldList } = createList(oldItems);\n const { ids: newIds, list: newList } = createList(newItems);\n\n const deletedItemsIds = oldIds.filter((id) => !newIds.includes(id));\n const recentItemsIds = oldIds.filter((id) => !deletedItemsIds.includes(id));\n const newItemsIds = newIds.filter((id) => !oldIds.includes(id));\n\n const diff_fields_items = {};\n const diff_fields_items_Ids = [];\n \n recentItemsIds.forEach((id) => {\n const newItem = newList[id];\n const oldItem = oldList[id];\n\n oldItem.fields.forEach((field1) => {\n const sameField = newItem.fields.find(\n (field2) => Number(field2.field_id) === Number(field1.field_id)\n );\n\n if (!sameField) {\n if (!diff_fields_items[newItem.item_id]) {\n diff_fields_items[newItem.item_id] = [];\n diff_fields_items_Ids.push(newItem.item_id);\n }\n\n return diff_fields_items[newItem.item_id].push(field1);\n }\n\n if (field1.field_value != sameField.field_value) {\n if (!diff_fields_items[newItem.item_id]) {\n diff_fields_items[newItem.item_id] = [];\n diff_fields_items_Ids.push(newItem.item_id);\n }\n return diff_fields_items[newItem.item_id].push(field1);\n }\n });\n });\n\n return {\n newItems: newItemsIds.reduce((acc, id) => {\n acc.push(newList[id]);\n return acc;\n }, []),\n deletedItems: deletedItemsIds.reduce((acc, id) => {\n acc.push(oldList[id]);\n return acc;\n }, []),\n diff_fields_items_Ids,\n diff_fields_items,\n diff_items: diff_fields_items_Ids.reduce((acc, id) => {\n acc.push(oldList[id]);\n return acc;\n }, []),\n };\n }\n\n self.addEventListener(\"message\", (event) => {\n const { items_list1, items_list2 } = event.data;\n\n const diff = compareItemsLists(items_list1, items_list2);\n self.postMessage({ diff });\n });`;\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/json_constructor/json_constructor.js\nfunction compiler(scheme, item, util, variables, appId) {\n async function schemeCompiler(scheme, item, appId) {\n let value = null;\n if (scheme.type === \"array\") {\n // get properties value for array childs for each application item\n if (Number(scheme.is_static)) {\n value = new Array(await getChildsPropertiesObject(scheme.childs, item, appId));\n } else {\n value = await getArrayOfItemsWithProperties(scheme, item, appId);\n }\n }\n if (scheme.type === \"object\") {\n // get properties value for object childs\n if (Number(scheme.current_item)) {\n value = await getItemWithProperties(scheme, item);\n } else {\n value = await getChildsPropertiesObject(scheme.childs, item, appId);\n }\n }\n if (scheme.type === \"property\") {\n // get properties value\n value = await getFieldValue(scheme, item, appId);\n }\n if (typeof scheme === \"object\" && typeof scheme.type === 'undefined') {\n const result = {};\n for (const key in scheme) {\n if (scheme.hasOwnProperty(key)) {\n const element = scheme[key];\n const res = await schemeCompiler(element, item, appId);\n result[key] = res[element.property_name];\n }\n }\n return result;\n }\n return {\n [scheme.property_name]: value\n };\n }\n\n /* Get properties value for array childs in scheme, for each application filtered item. */\n async function getArrayOfItemsWithProperties(scheme, item, recievedApp) {\n const app = await util.gudhub.getApp(Number(scheme.app_id));\n let filteredItems = await filterItems(scheme.filter, app.items_list, recievedApp, item);\n if (scheme.isSortable && scheme.field_id_to_sort && scheme.field_id_to_sort !== '') {\n let itemsWithValue = filteredItems.flatMap(item => {\n let fieldToSort = item.fields.find(field => field.field_id == scheme.field_id_to_sort);\n if (!fieldToSort || fieldToSort.field_value == '') {\n return [];\n } else {\n return item;\n }\n });\n let itemsWithoutValue = filteredItems.filter(item => {\n if (!itemsWithValue.includes(item)) {\n return item;\n }\n });\n itemsWithValue = itemsWithValue.sort((a, b) => {\n if (scheme.sortType == 'desc') {\n return b.fields.find(field => field.field_id == scheme.field_id_to_sort).field_value - a.fields.find(field => field.field_id == scheme.field_id_to_sort).field_value;\n } else {\n return a.fields.find(field => field.field_id == scheme.field_id_to_sort).field_value - b.fields.find(field => field.field_id == scheme.field_id_to_sort).field_value;\n }\n });\n filteredItems = [...itemsWithValue, ...itemsWithoutValue];\n }\n if (scheme.offset) {\n let offset;\n if (scheme.use_variables_for_limit_and_offset && variables) {\n offset = variables[scheme.offset];\n } else {\n offset = /^[0-9]+$/.test(scheme.offset) ? scheme.offset : 0;\n }\n filteredItems = filteredItems.slice(offset);\n }\n if (scheme.limit) {\n let limit;\n if (scheme.use_variables_for_limit_and_offset && variables) {\n limit = variables[scheme.limit];\n } else {\n limit = /^[0-9]+$/.test(scheme.limit) || 0;\n }\n if (limit !== 0) {\n filteredItems = filteredItems.slice(0, limit);\n }\n }\n const arrayOfItemsWithProperties = filteredItems.map(async item => {\n return getChildsPropertiesObject(scheme.childs, item, app.app_id);\n });\n return Promise.all(arrayOfItemsWithProperties);\n }\n async function getItemWithProperties(scheme, item) {\n const app = await util.gudhub.getApp(scheme.app_id);\n const items = app.items_list || [];\n return getChildsPropertiesObject(scheme.childs, item || items[0], app.app_id);\n }\n\n /* Get properties value for object childs in scheme. */\n async function getChildsPropertiesObject(properties, item, appId) {\n const propertiesArray = await properties.map(async child => {\n return schemeCompiler(child, item, appId);\n });\n const resolvedPropertiesArray = await Promise.all(propertiesArray);\n return resolvedPropertiesArray.reduce((acc, object) => {\n return {\n ...acc,\n ...object\n };\n }, {});\n }\n\n /* Get property value based on interpretation value */\n async function getFieldValue(scheme, item, appId) {\n switch (scheme.property_type) {\n case \"static\":\n return scheme.static_field_value;\n case \"variable\":\n switch (scheme.variable_type) {\n case \"app_id\":\n return appId;\n // case \"user_id\":\n // resolve(storage.getUser().user_id);\n // break;\n case \"current_item\":\n default:\n return `${appId}.${item.item_id}`;\n }\n case \"field_id\":\n return scheme.field_id;\n case \"function\":\n if (typeof scheme.function === 'function') {\n let result = scheme.function(item, appId, util.gudhub, ...scheme.args);\n return result;\n } else {\n const func = new Function('item, appId, gudhub', 'return (async ' + scheme.function + ')(item, appId, gudhub)');\n let result = await func(item, appId, util.gudhub);\n return result;\n }\n case \"field_value\":\n default:\n if (!scheme.field_id && scheme.name_space) {\n scheme.field_id = await util.gudhub.getFieldIdByNameSpace(appId, scheme.name_space);\n }\n if (Boolean(Number(scheme.interpretation))) {\n let interpretatedValue = await util.gudhub.getInterpretationById(Number(appId), Number(item.item_id), Number(scheme.field_id), 'value');\n return interpretatedValue;\n } else {\n let value = await util.gudhub.getFieldValue(Number(appId), Number(item.item_id), Number(scheme.field_id));\n return value;\n }\n }\n }\n async function getFilteredItems(filtersList, element_app_id, app_id, item_id, itemsList) {\n const modified_filters_list = await util.gudhub.prefilter(JSON.parse(JSON.stringify(filtersList)), {\n element_app_id,\n app_id,\n item_id,\n ...variables\n });\n return util.gudhub.filter(itemsList, [...modified_filters_list, ...filtersList]);\n }\n\n /* Filter items by scheme filter */\n async function filterItems(filtersList = [], itemsList = [], appId = '', item = {}) {\n return filtersList.length ? getFilteredItems(filtersList, appId, appId, item.item_id, itemsList) : [...itemsList];\n }\n return schemeCompiler(scheme, item, appId, variables);\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/AppsTemplateService/AppsTemplateService.js\nclass AppsTemplateService {\n constructor(gudhub) {\n this.gudhub = gudhub;\n this.appsConnectingMap = {\n apps: [],\n fields: [],\n items: [],\n views: []\n };\n }\n createAppsFromTemplate(pack, maxNumberOfInsstalledItems, progressCallback, installFromMaster) {\n const self = this;\n return new Promise(resolve => {\n const stepsCount = pack.apps.length * 6;\n const stepPercents = 100 / stepsCount;\n let currentStep = 0;\n self.createApps(pack, status => {\n currentStep += 1;\n progressCallback ? progressCallback.call(this, {\n percent: currentStep * stepPercents,\n status\n }) : null;\n }, installFromMaster).then(success => {\n self.createItems(success, maxNumberOfInsstalledItems, status => {\n if (typeof status === 'string') {\n currentStep += 1;\n progressCallback ? progressCallback.call(this, {\n percent: currentStep * stepPercents,\n status\n }) : null;\n } else if (typeof status === 'object') {\n progressCallback ? progressCallback.call(this, {\n status: 'Done',\n apps: status\n }) : null;\n resolve();\n }\n }, installFromMaster);\n });\n });\n }\n createItems(create_apps, maxNumberOfInsstalledItems, callback, installFromMaster) {\n return new Promise(async resolve => {\n const MAX_NUMBER_OF_INSTALLED_ITEMS = maxNumberOfInsstalledItems ? maxNumberOfInsstalledItems : 100000;\n const self = this;\n let createsItems = [];\n let promises = [];\n const {\n accesstoken\n } = await self.gudhub.req.axiosRequest({\n method: 'POST',\n url: 'https://gudhub.com/GudHub_Test/auth/login',\n form: {\n auth_key: '3HMOtCbC0M/1/1e4y4Uxo/Kh/aFN4V5LG2//5ixx7TZyiUfMb7IHAAHCj9PsLrOSDrZuuWkbX4BIX23f51H+eA=='\n }\n });\n create_apps.forEach(app => {\n promises.push(new Promise(async app_resolve => {\n let result_app;\n if (installFromMaster) {\n result_app = await self.gudhub.req.axiosRequest({\n url: `https://gudhub.com/GudHub_Test/api/app/get?token=${accesstoken}&app_id=${self._searchOldAppId(app.app_id, self.appsConnectingMap.apps)}`,\n method: 'GET'\n });\n } else {\n result_app = await self.gudhub.getApp(self._searchOldAppId(app.app_id, self.appsConnectingMap.apps));\n }\n callback ? callback.call(this, `GET APP: ${result_app.app_name} (Items steps)`) : null;\n let source_app = JSON.parse(JSON.stringify(result_app));\n let items = source_app.items_list.map(item => {\n return {\n index_number: item.index_number,\n item_id: 0,\n fields: []\n };\n }).filter((item, index) => index <= MAX_NUMBER_OF_INSTALLED_ITEMS);\n self.gudhub.addNewItems(app.app_id, items).then(items => {\n callback ? callback.call(this, `ADD NEW ITEMS: ${result_app.app_name} (Items steps)`) : null;\n app.items_list = items;\n self._updateMap(app.items_list, source_app.items_list);\n self._addFieldValue(source_app.items_list, app.items_list, self.appsConnectingMap);\n createsItems.push(app);\n app_resolve();\n });\n }));\n });\n Promise.all(promises).then(() => {\n createsItems.forEach(app => {\n app.items_list.forEach(item => {\n item.fields.forEach(field_item => {\n self.appsConnectingMap.fields.forEach(field_map => {\n if (field_item.field_id === field_map.old_field_id) {\n field_item.field_id = field_map.new_field_id;\n field_item.element_id = field_map.new_field_id;\n }\n });\n });\n });\n });\n self.deleteField(createsItems);\n self.replaceValue(createsItems, self.appsConnectingMap).then(() => {\n const promises = [];\n createsItems.forEach(created_app => {\n promises.push(new Promise(resolve => {\n let newItems = created_app.items_list.map(item => {\n item.fields.forEach(field => {\n delete field.data_id;\n });\n return item;\n });\n self.gudhub.updateItems(created_app.app_id, newItems).then(() => {\n callback ? callback.call(this, `REPLACE VALUE: ${created_app.app_name} (Items steps)`) : null;\n resolve();\n });\n }));\n });\n Promise.all(promises).then(() => {\n callback.call(this, createsItems);\n resolve();\n });\n });\n });\n });\n }\n deleteField(apps) {\n apps.forEach(app => {\n app.items_list.forEach(item => {\n item.fields = item.fields.filter(field => {\n return app.field_list.findIndex(f => f.field_id == field.field_id) > -1;\n });\n });\n });\n }\n replaceValue(apps, map) {\n return new Promise(async resolve => {\n const allPromises = [];\n const self = this;\n apps.forEach(app => {\n app.field_list.forEach(field_of_list => {\n if (field_of_list.data_type === 'item_ref') {\n self._replaceValueItemRef(app, field_of_list, map);\n }\n allPromises.push(new Promise(resolve => {\n self.gudhub.ghconstructor.getInstance(field_of_list.data_type).then(data => {\n if (typeof data === 'undefined') {\n console.log('ERROR WHILE GETTING INSTANCE OF ', field_of_list.data_type);\n resolve({\n type: field_of_list.data_type\n });\n return;\n }\n if (data.getTemplate().constructor == 'file') {\n return self.gudhub.util.fileInstallerHelper(app.app_id, app.items_list, field_of_list.field_id).then(result => {\n resolve(result);\n });\n } else if (data.getTemplate().constructor == 'document') {\n self.documentInstallerHelper(app.app_id, app.items_list, field_of_list.field_id).then(result => {\n resolve(data);\n });\n } else {\n resolve(data);\n }\n });\n }));\n });\n });\n if (allPromises.length > 0) {\n Promise.all(allPromises).then(result => {\n resolve(result);\n });\n } else {\n resolve(result);\n }\n });\n }\n documentInstallerHelper(appId, items, elementId) {\n const self = this;\n return new Promise(async resolve => {\n for (const item of items) {\n const itemId = item.item_id;\n const field = item.fields.find(field => field.element_id === elementId);\n if (field && field.field_value && field.field_value.length > 0) {\n const document = await self.gudhub.getDocument({\n _id: field.field_value\n });\n if (document && document.data) {\n const newDocument = await self.gudhub.createDocument({\n app_id: appId,\n item_id: itemId,\n element_id: elementId,\n data: document.data\n });\n field.field_value = newDocument._id;\n }\n }\n }\n resolve();\n });\n }\n _replaceValueItemRef(app, field_of_list, map) {\n app.items_list.forEach(item => {\n item.fields.forEach(field_of_item => {\n if (field_of_item.field_id === field_of_list.field_id && field_of_item.field_value) {\n let arr_values = field_of_item.field_value.split(',');\n arr_values.forEach((one_value, key) => {\n let value = one_value.split('.');\n map.apps.forEach(app_ids => {\n if (value[0] == app_ids.old_app_id) {\n value[0] = app_ids.new_app_id;\n }\n });\n map.items.forEach(item_ids => {\n if (value[1] == item_ids.old_item_id) {\n value[1] = item_ids.new_item_id;\n }\n });\n arr_values[key] = value.join('.');\n });\n field_of_item.field_value = arr_values.join(',');\n }\n });\n });\n }\n _addFieldValue(source_app_items, create_items, appsConnectingMap) {\n create_items.forEach(new_item => {\n appsConnectingMap.items.forEach(item_of_map => {\n if (new_item.item_id === item_of_map.new_item_id) {\n source_app_items.forEach(old_item => {\n if (item_of_map.old_item_id === old_item.item_id) {\n new_item.fields = old_item.fields;\n }\n });\n }\n });\n });\n }\n _updateMap(new_items, old_items) {\n old_items.forEach(old_item => {\n new_items.forEach(new_item => {\n if (old_item.index_number === new_item.index_number) {\n this.appsConnectingMap.items.push({\n old_item_id: old_item.item_id,\n new_item_id: new_item.item_id\n });\n }\n });\n });\n }\n _searchOldAppId(app_id, apps) {\n let findId = 0;\n apps.forEach(value => {\n if (value.new_app_id === app_id) {\n findId = value.old_app_id;\n }\n });\n return findId;\n }\n createApps(pack, callback, installFromMaster) {\n const self = this;\n let progress = {\n step_size: 100 / (pack.apps.length * 3),\n apps: []\n };\n return new Promise(async resolve => {\n let source_apps = {};\n let created_apps = [];\n let updated_apps = [];\n const {\n accesstoken\n } = await self.gudhub.req.axiosRequest({\n method: 'POST',\n url: 'https://gudhub.com/GudHub_Test/auth/login',\n form: {\n auth_key: '3HMOtCbC0M/1/1e4y4Uxo/Kh/aFN4V5LG2//5ixx7TZyiUfMb7IHAAHCj9PsLrOSDrZuuWkbX4BIX23f51H+eA=='\n }\n });\n for (const app_id of pack.apps) {\n let result_app;\n if (installFromMaster) {\n result_app = await self.gudhub.req.axiosRequest({\n url: `https://gudhub.com/GudHub_Test/api/app/get?token=${accesstoken}&app_id=${app_id}`,\n method: 'GET'\n });\n } else {\n result_app = await self.gudhub.getApp(app_id);\n }\n callback ? callback.call(this, `GET APP: ${result_app.app_name} (App steps)`) : null;\n let source_app = JSON.parse(JSON.stringify(result_app));\n source_apps[source_app.app_id] = source_app;\n progress.apps.push(source_app.icon);\n let appTemplate = self.prepareAppTemplate(source_app);\n appTemplate.app_name = appTemplate.app_name + ' New';\n appTemplate.privacy = 1;\n if (pack.data_to_change) {\n if (pack.data_to_change.name) {\n appTemplate.app_name = pack.data_to_change.name;\n }\n if (pack.data_to_change.icon) {\n appTemplate.icon = pack.data_to_change.icon;\n }\n }\n self.resetViewsIds(appTemplate);\n self.gudhub.createNewApp(appTemplate).then(created_app => {\n callback ? callback.call(this, `CREATE NEW APP: ${result_app.app_name} (App steps)`) : null;\n created_apps.push(created_app);\n self.mapApp(source_app, created_app, self.appsConnectingMap);\n if (pack.apps.length == created_apps.length) {\n self.connectApps(created_apps, self.appsConnectingMap, source_apps);\n created_apps.forEach(created_app => {\n self.gudhub.updateApp(created_app).then(updated_app => {\n callback ? callback.call(this, `UPDATE APP: ${result_app.app_name} (App steps)`) : null;\n updated_apps.push(updated_app);\n if (pack.apps.length == updated_apps.length) {\n resolve(updated_apps);\n }\n });\n });\n }\n });\n }\n });\n }\n mapApp(base_app, new_app, appsConnectingMap) {\n appsConnectingMap.apps.push({\n old_app_id: base_app.app_id,\n new_app_id: new_app.app_id,\n old_view_init: base_app.view_init,\n new_view_init: new_app.view_init\n });\n base_app.field_list.forEach(old_field => {\n new_app.field_list.forEach(new_field => {\n if (old_field.name_space == new_field.name_space) {\n appsConnectingMap.fields.push({\n name_space: old_field.name_space,\n old_field_id: old_field.field_id,\n new_field_id: new_field.field_id\n });\n }\n });\n });\n base_app.views_list.forEach(old_view => {\n new_app.views_list.forEach(new_view => {\n if (old_view.name == new_view.name) {\n appsConnectingMap.views.push({\n name: old_view.name,\n old_view_id: old_view.view_id,\n new_view_id: new_view.view_id\n });\n }\n });\n });\n }\n crawling(object, action) {\n let properties = object === null ? [] : Object.keys(object);\n const self = this;\n if (properties.length > 0) {\n properties.forEach(prop => {\n let propertyValue = object[prop];\n if (typeof propertyValue !== 'undefined' && typeof object != 'string') {\n action(prop, propertyValue, object);\n self.crawling(propertyValue, action);\n }\n });\n }\n }\n resetViewsIds(app) {\n app.view_init = 0;\n this.crawling(app.views_list, function (prop, value, parent) {\n if (prop == 'view_id' || prop == 'container_id') {\n parent[prop] = 0;\n }\n });\n }\n connectApps(apps, appsConnectingMap, source_apps) {\n const self = this;\n apps.forEach(app => {\n appsConnectingMap.apps.forEach(appMap => {\n if (app.view_init === appMap.new_view_init) {\n appsConnectingMap.views.forEach(view => {\n if (appMap.old_view_init === view.old_view_id) {\n app.view_init = view.new_view_id;\n }\n });\n }\n });\n self.crawling(app.field_list, function (prop, value, parent) {\n if (prop.indexOf(\"field_id\") !== -1 || prop.indexOf(\"FieldId\") !== -1 || prop.indexOf(\"destination_field\") !== -1) {\n let fieldsArr = String(value).split(','),\n newFieldsArr = [];\n appsConnectingMap.fields.forEach(field => {\n fieldsArr.forEach(fieldFromValue => {\n if (fieldFromValue == field.old_field_id) {\n newFieldsArr.push(field.new_field_id);\n }\n });\n });\n if (newFieldsArr.length) {\n parent[prop] = newFieldsArr.join(',');\n }\n }\n if (prop.indexOf(\"app_id\") != -1 || prop.indexOf(\"AppId\") != -1 || prop.indexOf(\"destination_app\") != -1) {\n appsConnectingMap.apps.forEach(app => {\n if (value == app.old_app_id) {\n parent[prop] = app.new_app_id;\n }\n });\n }\n if (prop.indexOf(\"view_id\") !== -1) {\n appsConnectingMap.views.forEach(view => {\n if (value == view.old_view_id) {\n parent[prop] = view.new_view_id;\n }\n });\n }\n if (prop.indexOf(\"src\") !== -1 && isFinite(value)) {\n const pron_name = 'container_id';\n const old_app_id = appsConnectingMap.apps.find(appMap => appMap.new_app_id === app.app_id).old_app_id;\n const path = self.findPath(source_apps[old_app_id].views_list, pron_name, value);\n parent[prop] = `${self.getValueByPath(app.views_list, path, pron_name)}`;\n }\n });\n });\n return apps;\n }\n getValueByPath(source, path, prop) {\n let temp = source;\n path.split('.').forEach(item => {\n temp = temp[item];\n });\n return temp[prop];\n }\n findPath(source, prop, value) {\n const self = this;\n let isFound = false;\n let toClearPath = false;\n let path = [];\n self.crawling(source, function (propSource, valueSource, parentSource) {\n if (toClearPath) {\n path.reverse().forEach(item => {\n if (toClearPath) {\n item.delete = true;\n if (item.parent === parentSource) {\n toClearPath = false;\n path = path.filter(item => !item.delete);\n path.reverse();\n }\n }\n });\n }\n if (!isFound) {\n if (typeof parentSource[propSource] === 'object') {\n path.push({\n prop: propSource,\n parent: parentSource\n });\n }\n if (valueSource == value && prop === propSource) {\n isFound = true;\n } else if (Object.keys(parentSource).pop() === propSource && typeof parentSource[propSource] !== 'object') {\n toClearPath = true;\n }\n }\n });\n return path.map(item => item.prop).join('.');\n }\n prepareAppTemplate(appToTemplate) {\n const self = this;\n let app = JSON.parse(JSON.stringify(appToTemplate));\n self.crawling(app.views_list, function (prop, value, parent) {\n if (prop == \"element_id\") {\n parent.element_id = -Number(value);\n parent.create_element = -Number(value);\n }\n });\n app.field_list.forEach(field => {\n field.create_field = -Number(field.field_id);\n field.element_id = -Number(field.field_id);\n field.field_id = -Number(field.field_id);\n field.field_value = \"\"; /* Should be removed when we update createApp API*/\n });\n\n app.items_list = [];\n delete app.app_id;\n delete app.icon.id;\n delete app.group_id;\n delete app.trash;\n delete app.last_update;\n delete app.file_list;\n return app;\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/FIleHelper/FileHelper.js\nclass FileHelper {\n constructor(gudhub) {\n this.gudhub = gudhub;\n }\n fileInstallerHelper(appId, items, elementId) {\n const self = this;\n return new Promise(resolve => {\n const files = [[]];\n let chainPromises = Promise.resolve();\n let results = [];\n items.forEach(item => {\n const itemId = item.item_id;\n const field = item.fields.find(field => field.element_id === elementId);\n if (field && field.field_value) {\n const fileIds = field.field_value.split('.');\n fileIds.forEach(fileId => {\n const newFile = {\n source: fileId,\n destination: {\n app_id: appId,\n item_id: itemId,\n element_id: elementId\n }\n };\n if (files[files.length - 1].length !== 10) {\n // 10 - max duplicate files\n files[files.length - 1].push(newFile);\n } else {\n files.push([newFile]);\n }\n });\n }\n });\n files.forEach(filePack => {\n chainPromises = chainPromises.then(() => {\n return self.gudhub.duplicateFile(filePack);\n }).then(result => {\n results = [...results, ...result];\n });\n });\n chainPromises.then(() => {\n items.forEach(item => {\n const itemId = item.item_id;\n const field = item.fields.find(field => field.element_id === elementId);\n if (field && field.field_value) {\n field.field_value = '';\n results.forEach(file => {\n if (file.item_id === itemId) {\n field.field_value = field.field_value.split(',').filter(fileId => fileId).concat(file.file_id).join(',');\n }\n });\n }\n });\n resolve();\n });\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/compareObjects/compareObjects.js\nfunction compareObjects(target, source) {\n return JSON.stringify(target) === JSON.stringify(source);\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/dynamicPromiseAll/dynamicPromiseAll.js\nasync function dynamicPromiseAll(promises) {\n await Promise.all(promises);\n let allDone = true;\n for (const promise of promises) {\n const result = await _checkPromiseStatus(promise);\n if (result.state === 'pending') {\n allDone = false;\n break;\n }\n if (result.state === 'rejected') {\n throw result.reason;\n break;\n }\n }\n if (allDone) {\n return true;\n }\n return dynamicPromiseAll(promises);\n}\nfunction _checkPromiseStatus(promise) {\n const pending = {\n state: 'pending'\n };\n return Promise.race([promise, pending]).then(value => {\n if (value === pending) {\n return value;\n }\n return {\n state: 'resolved',\n value\n };\n }, reason => ({\n state: 'rejected',\n reason\n }));\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/sortItems.js\n/**\n * Sort items by field value of given field\n * \n * @param {array} items - items of application\n * @param {object} options - object with options for sorting\n * @property {number|string} sort_field_id - field id for sorting items \n * @property {boolean} descending - sort type (if set to true - items sort by descending else by ascending)\n * \n */\n\nfunction sortItems(items, options) {\n /*-- stop filtering if arguments are empty*/\n if (!items || !items.length) {\n return [];\n }\n if (!items[0].fields.length) {\n return items;\n }\n var compareFieldId = options && options.sort_field_id || items[0].fields[0].field_id;\n\n /* Get field value*/\n function getFieldValue(item) {\n var result = null;\n for (var i = 0; i < item.fields.length; i++) {\n if (item.fields[i].field_id == compareFieldId) {\n result = item.fields[i].field_value;\n break;\n }\n }\n return result;\n }\n\n /* Sort items array*/\n items.sort(function (a, b) {\n var aVal = getFieldValue(a);\n var bVal = getFieldValue(b);\n if (aVal === null) {\n return -1;\n }\n if (bVal === null) {\n return 1;\n }\n if (/^\\d+$/.test(aVal) && /^\\d+$/.test(bVal)) {\n return Number(aVal) < Number(bVal) ? -1 : 1;\n }\n if (/^\\d+$/.test(aVal) || /^\\d+$/.test(bVal)) {\n return /^\\d+$/.test(aVal) ? -1 : 1;\n }\n return aVal.toLowerCase() > bVal.toLowerCase() ? 1 : -1;\n });\n return options && options.descending ? items.reverse() : items;\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/Utils.js\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nclass Utils {\n constructor(gudhub) {\n this.gudhub = gudhub;\n this.MergeFields = new FieldsOperator(gudhub);\n this.ItemsSelection = new ItemsSelection(gudhub);\n this.AppsTemplateService = new AppsTemplateService(gudhub);\n this.FileHelper = new FileHelper(gudhub);\n }\n prefilter(filters_list, variables = {}) {\n return filterPreparation(filters_list, this.gudhub.storage, this.gudhub.pipeService, variables);\n }\n filter(items, filter_list) {\n return filter(items, filter_list);\n }\n mergeFilters(src, dest) {\n return mergeFilters(src, dest);\n }\n group(fieldGroup, items) {\n return group(fieldGroup, items);\n }\n async getFilteredItems(items = [], filters_list = [], element_app_id, app_id, item_id, field_group = \"\", search, search_params) {\n const modified_filters_list = await this.prefilter(filters_list, {\n element_app_id,\n app_id,\n item_id\n });\n const itemsList = this.filter(items, modified_filters_list);\n const newItems = this.group(field_group, itemsList);\n return newItems.filter(newItem => {\n if (search) {\n return searchValue([newItem], search).length === 1;\n } else return true;\n }).filter(newItem => {\n if (search_params) {\n return searchValue([newItem], search_params).length === 1;\n } else return true;\n });\n }\n jsonToItems(json, map) {\n return jsonToItems(json, map);\n }\n getDate(queryKey) {\n return get_date_getDate(queryKey);\n }\n checkRecurringDate(date, option) {\n return checkRecurringDate(date, option);\n }\n populateItems(items, model, keep_data) {\n return populateItems(items, model, keep_data);\n }\n populateWithDate(items, model) {\n return populateWithDate(items, model);\n }\n populateWithItemRef(sourceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id) {\n return populateWithItemRef(sourceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id);\n }\n\n //here\n compareItems(sourceItems, destinationItems, fieldToCompare) {\n return compareItems(sourceItems, destinationItems, fieldToCompare);\n }\n mergeItems(sourceItems, destinationItems, mergeByFieldId) {\n return mergeItems(sourceItems, destinationItems, mergeByFieldId);\n }\n mergeObjects(target, source, optionsArgument) {\n return mergeObjects(target, source, optionsArgument);\n }\n makeNestedList(arr, id, parent_id, children_property, priority_property) {\n return makeNestedList(arr, id, parent_id, children_property, priority_property);\n }\n async mergeChunks(chunks) {\n return merge_chunks_mergeChunks(chunks);\n\n // const chunkWorkerBlob = new Blob([mergeChunksWorker()], {\n // type: \"application/javascript\",\n // });\n // this.worker = new Worker(URL.createObjectURL(chunkWorkerBlob));\n // this.worker.postMessage(chunks);\n // this.worker.addEventListener(\"message\", (event) => {\n // const { diff } = event.data;\n // callback(event.data);\n // });\n }\n\n mergeFieldLists(fieldsToView, fieldList) {\n return this.MergeFields.mergeFieldLists(fieldsToView, fieldList);\n }\n createFieldsListToView(appId, tableSettingsFieldListToView) {\n return this.MergeFields.createFieldsListToView(appId, tableSettingsFieldListToView);\n }\n createFieldsListToViewWithDataType(appId, tableSettingsFieldListToView) {\n return this.MergeFields.createFieldsListToViewWithDataType(appId, tableSettingsFieldListToView);\n }\n selectItems(appId, items) {\n return this.ItemsSelection.selectItems(appId, items);\n }\n getSelectedItems(appId) {\n return this.ItemsSelection.getSelectedItems(appId);\n }\n clearSelectedItems(appId) {\n return this.ItemsSelection.clearSelectedItems(appId);\n }\n isItemSelected(appId, itemId) {\n return this.ItemsSelection.isItemSelected(appId, itemId);\n }\n jsonConstructor(scheme, item, variables, appId) {\n return compiler(scheme, item, this, variables, appId);\n }\n fileInstallerHelper(appId, items, elementId) {\n return this.FileHelper.fileInstallerHelper(appId, items, elementId);\n }\n createAppsFromTemplate(pack, maxNumberOfInsstalledItems, progressCallback, installFromMaster) {\n return this.AppsTemplateService.createAppsFromTemplate(pack, maxNumberOfInsstalledItems, progressCallback, installFromMaster);\n }\n createApps(pack) {\n return this.AppsTemplateService.createApps(pack);\n }\n createItems(create_apps, maxNumberOfInsstalledItems) {\n return this.AppsTemplateService.createItems(create_apps, maxNumberOfInsstalledItems);\n }\n compareObjects(obj1, obj2) {\n return compareObjects(obj1, obj2);\n }\n compareAppsItemsLists(items_list1, items_list2, callback) {\n const chunkWorkerBlob = new Blob([compare_items_lists_Worker()], {\n type: \"application/javascript\"\n });\n this.worker = new Worker(URL.createObjectURL(chunkWorkerBlob));\n this.worker.postMessage({\n items_list1,\n items_list2\n });\n this.worker.addEventListener(\"message\", event => {\n const {\n diff\n } = event.data;\n callback(diff);\n });\n }\n dynamicPromiseAll(promisesArray) {\n return dynamicPromiseAll(promisesArray);\n }\n sortItems(items, options) {\n return sortItems(items, options);\n }\n debounce(func, delay) {\n let timeoutId;\n return function (...args) {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => {\n func.apply(this, args);\n }, delay);\n };\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Auth/Auth.js\nclass Auth {\n constructor(req, storage) {\n this.req = req;\n this.storage = storage;\n }\n async login({\n username,\n password\n } = {}) {\n const user = await this.loginApi(username, password);\n this.storage.updateUser(user);\n return user;\n }\n async loginWithToken(token) {\n const user = await this.loginWithTokenApi(token);\n this.storage.updateUser(user);\n return user;\n }\n async logout(token) {\n const response = await this.logoutApi(token);\n return response;\n }\n async signup(user) {\n const newUser = await this.signupApi(user);\n return newUser;\n }\n async updateToken(auth_key) {\n const user = await this.updateTokenApi(auth_key);\n return user;\n }\n async updateUser(userData) {\n const user = await this.updateUserApi(userData);\n this.storage.updateUser(user);\n return user;\n }\n async updateAvatar(imageData) {\n const user = await this.avatarUploadApi(imageData);\n this.storage.updateUser(user);\n return user;\n }\n async getUsersList(keyword) {\n const usersList = await this.getUsersListApi(keyword);\n return usersList;\n }\n async loginApi(username, password) {\n try {\n const user = await this.req.axiosRequest({\n method: 'POST',\n url: `${this.req.root}/auth/login`,\n form: {\n username,\n password\n }\n });\n return user;\n } catch (error) {\n console.log(error);\n }\n }\n async loginWithTokenApi(token) {\n try {\n const user = await this.req.axiosRequest({\n method: 'POST',\n url: `${this.req.root}/auth/login?accesstoken=${token}`\n });\n return user;\n } catch (error) {\n console.log(error);\n }\n }\n async updateTokenApi(auth_key) {\n try {\n const user = await this.req.axiosRequest({\n method: 'POST',\n url: `${this.req.root}/auth/login`,\n form: {\n auth_key\n }\n });\n return user;\n } catch (error) {\n console.log(error);\n }\n }\n logoutApi(token) {\n return this.req.post({\n url: \"/auth/logout\",\n form: {\n token\n }\n });\n }\n signupApi(user) {\n return this.req.axiosRequest({\n method: 'POST',\n url: `${this.req.root}/auth/singup`,\n form: {\n user: JSON.stringify(user)\n }\n });\n }\n getUsersListApi(keyword) {\n return this.req.get({\n url: \"/auth/userlist\",\n params: {\n keyword\n }\n });\n }\n updateUserApi(userData) {\n return this.req.post({\n url: \"/auth/updateuser\",\n form: {\n user: JSON.stringify(userData)\n }\n });\n }\n avatarUploadApi(image) {\n return this.req.post({\n url: \"/auth/avatar-upload\",\n form: {\n image\n }\n });\n }\n getUserByIdApi(id) {\n return this.req.get({\n url: \"/auth/getuserbyid\",\n params: {\n id\n }\n });\n }\n getVersion() {\n return this.req.get({\n url: \"/version\"\n });\n }\n getUserFromStorage(id) {\n return this.storage.getUsersList().find(user => user.user_id == id);\n }\n saveUserToStorage(saveUser) {\n const usersList = this.storage.getUsersList();\n const userInStorage = usersList.find(user => user.user_id == saveUser.user_id);\n if (!userInStorage) {\n usersList.push(saveUser);\n return saveUser;\n }\n return userInStorage;\n }\n async getUserById(userId) {\n let user = this.getUserFromStorage(userId);\n if (!user) {\n let receivedUser = await this.getUserByIdApi(userId);\n if (!receivedUser) return null;\n user = this.getUserFromStorage(userId);\n if (!user) {\n this.saveUserToStorage(receivedUser);\n user = receivedUser;\n }\n }\n return user;\n }\n async getToken() {\n const expiryDate = new Date(this.storage.getUser().expirydate);\n const currentDate = new Date();\n let accesstoken = this.storage.getUser().accesstoken;\n\n /*-- checking if token exists and if it's not expired*/\n if (expiryDate < currentDate || !accesstoken) {\n /*-- If token is expired we send request to server to update it*/\n const user = await this.updateToken(this.storage.getUser().auth_key);\n this.storage.updateUser(user);\n accesstoken = user.accesstoken;\n }\n return accesstoken;\n }\n}\n// EXTERNAL MODULE: ./GUDHUB/GHConstructor/createAngularModuleInstance.js\nvar createAngularModuleInstance = __webpack_require__(960);\n;// CONCATENATED MODULE: ./GUDHUB/GHConstructor/createClassInstance.js\n\n\nasync function createClassInstance(gudhub, module_id, js_url, css_url, nodeWindow) {\n try {\n // Check if there is url to javascript file of module\n\n if (!js_url) {\n console.error(`JS link must be provided for this data type - ${module_id}`);\n }\n\n // Import module using dynamic import\n\n let downloadModule = url => {\n if (!consts/* IS_WEB */.P && !global.hasOwnProperty('window')) {\n global.window = proxy;\n global.document = nodeWindow.document;\n global.Element = nodeWindow.Element;\n global.CharacterData = nodeWindow.CharacterData;\n global.this = proxy;\n global.self = proxy;\n global.Blob = nodeWindow.Blob;\n global.Node = nodeWindow.Node;\n global.navigator = nodeWindow.navigator;\n global.HTMLElement = nodeWindow.HTMLElement;\n global.XMLHttpRequest = nodeWindow.XMLHttpRequest;\n global.WebSocket = nodeWindow.WebSocket;\n global.crypto = nodeWindow.crypto;\n global.DOMParser = nodeWindow.DOMParser;\n global.Symbol = nodeWindow.Symbol;\n global.document.queryCommandSupported = command => {\n console.log('QUERY COMMAND SUPPORTED: ', command);\n return false;\n };\n global.angular = angular;\n }\n return new Promise(async resolve => {\n let moduleData = await axios.get(url).catch(err => {\n console.log(`Failed to fetch: ${url} in ghconstructor. Module id: ${module_id}`);\n });\n let encodedJs = encodeURIComponent(moduleData.data);\n let dataUri = 'data:text/javascript;charset=utf-8,' + encodedJs;\n resolve(dataUri);\n });\n };\n let moduleData = await downloadModule(js_url);\n let module;\n try {\n module = await import( /* webpackIgnore: true */moduleData);\n } catch (err) {\n console.log(`Error while importing module: ${module_id}`);\n console.log(err);\n }\n\n // Creating class from imported module\n\n let importedClass = new module.default(module_id);\n\n // Check if there is url to css file of module\n // If true, and there is no css for this data type, than create link tag to this css in head\n\n if (css_url && consts/* IS_WEB */.P) {\n const linkTag = document.createElement('link');\n linkTag.href = css_url;\n linkTag.setAttribute('data-module', module_id);\n linkTag.setAttribute('rel', 'stylesheet');\n document.getElementsByTagName('head')[0].appendChild(linkTag);\n }\n let result = {\n type: module_id,\n //*************** GET TEMPLATE ****************//\n\n getTemplate: function (ref, changeFieldName, displayFieldName, field_model, appId, itemId) {\n let displayFieldNameChecked = displayFieldName === 'false' ? false : true;\n return importedClass.getTemplate(ref, changeFieldName, displayFieldNameChecked, field_model, appId, itemId);\n },\n //*************** GET DEFAULT VALUE ****************//\n\n getDefaultValue: function (fieldModel, valuesArray, itemsList, currentAppId) {\n return new Promise(async resolve => {\n let getValueFunction = importedClass.getDefaultValue;\n if (getValueFunction) {\n let value = await getValueFunction(fieldModel, valuesArray, itemsList, currentAppId);\n resolve(value);\n } else {\n resolve(null);\n }\n });\n },\n //*************** GET SETTINGS ****************//\n\n getSettings: function (scope, settingType, fieldModels) {\n return importedClass.getSettings(scope, settingType, fieldModels);\n },\n //*************** FILTER****************//\n\n filter: {\n getSearchOptions: function (fieldModel) {\n let d_type = importedClass;\n if (d_type.filter && d_type.filter.getSearchOptions) {\n return importedClass.filter.getSearchOptions(fieldModel);\n }\n return [];\n },\n getDropdownValues: function () {\n let d_type = importedClass;\n if (d_type.filter && d_type.filter.getDropdownValues) {\n return d_type.filter.getDropdownValues();\n } else {\n return [];\n }\n }\n },\n //*************** GET INTERPRETATION ****************//\n\n getInterpretation: function (value, interpretation_id, dataType, field, itemId, appId) {\n return new Promise(async resolve => {\n let currentDataType = importedClass;\n try {\n let interpr_arr = await currentDataType.getInterpretation(gudhub, value, appId, itemId, field, dataType);\n let data = interpr_arr.find(item => item.id == interpretation_id) || interpr_arr.find(item => item.id == 'default');\n let result = await data.content();\n resolve({\n html: result\n });\n } catch (error) {\n console.log(`ERROR IN ${module_id}`, error);\n resolve({\n html: '<span>no interpretation</span>'\n });\n }\n });\n },\n //*************** GET INTERPRETATIONS LIST ****************//\n\n getInterpretationsList: function (field_value, appId, itemId, field) {\n return importedClass.getInterpretation(field_value, appId, itemId, field);\n },\n //*************** GET INTERPRETATED VALUE ****************//\n\n getInterpretatedValue: function (field_value, field_model, appId, itemId) {\n return new Promise(async resolve => {\n let getInterpretatedValueFunction = importedClass.getInterpretatedValue;\n if (getInterpretatedValueFunction) {\n let value = await getInterpretatedValueFunction(field_value, field_model, appId, itemId);\n resolve(value);\n } else {\n resolve(field_value);\n }\n });\n },\n //*************** ON MESSAGE ****************//\n\n onMessage: function (appId, userId, response) {\n return new Promise(async resolve => {\n const onMessageFunction = importedClass.onMessage;\n if (onMessageFunction) {\n const result = await onMessageFunction(appId, userId, response);\n resolve(result);\n }\n resolve(null);\n });\n },\n //*************** EXTEND CONTROLLER ****************//\n\n extendController: function (actionScope) {\n importedClass.getActionScope(actionScope);\n },\n //*************** RUN ACTION ****************//\n\n runAction: function (scope) {\n try {\n importedClass.runAction(scope);\n } catch (e) {}\n },\n //*************** GET WINDOW SCOPE ****************//\n\n getWindowScope: function (windowScope) {\n return importedClass.getWindowScope(windowScope);\n },\n //*************** GET WINDOW HTML ****************//\n\n getWindowHTML: function (scope) {\n return importedClass.getWindowHTML(scope);\n }\n };\n return result;\n } catch (err) {\n console.log(err);\n console.log(`Failed in createClassInstance (ghconstructor). Module id: ${module_id}. JS url: ${js_url}`);\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/GHConstructor/ghconstructor.js\n\n\nclass GHConstructor {\n constructor(gudhub) {\n this.gudhub = gudhub;\n this.cache = {};\n this.modulesQueue = {};\n this.angularInjector;\n this.nodeWindow;\n }\n\n /*************** GET INSTANCE ***************/\n // Firstly, check if module is loading right now in modules queue.\n // If not, check if module is in cache. If not, create new instance and put loading to modules queue.\n // If yes, return module from cache.\n\n async getInstance(module_id) {\n if (this.getCached(module_id)) {\n return this.getCached(module_id);\n } else if (this.modulesQueue[module_id]) {\n await this.modulesQueue[module_id];\n } else {\n this.modulesQueue[module_id] = this.createInstance(module_id);\n await this.modulesQueue[module_id];\n }\n return this.getCached(module_id);\n }\n\n /*************** PUT TO CACHE ***************/\n // Just pushing module to cache.\n\n pupToCache(module_id, module) {\n this.cache[module_id] = module;\n }\n\n /*************** GET CACHED ***************/\n // Find module in cache and return it.\n\n getCached(module_id) {\n return this.cache[module_id];\n }\n\n /*************** INIT ANGULAR INJECTOR ***************/\n // Saves angular injector to this.angularInjector.\n // It's needed to correctly takes module's functions, that uses angular services.\n\n initAngularInjector(angularInjector) {\n this.angularInjector = angularInjector;\n }\n\n /*************** INIT JSDOM WINDOW ***************/\n // Saves jsdom's window object to this.window.\n // It's needed to eval browser code on node when library works in node environment.\n\n initJsdomWindow(window) {\n this.nodeWindow = window;\n }\n\n /*************** CREATE INSTANCE ***************/\n // Check if module is \"angular\" or \"class\"\n // Than, creating instance for that type of module\n // Finally, returns the result (created instance) and puting it to the cache\n\n async createInstance(module_id) {\n let module = this.gudhub.storage.getModuleUrl(module_id);\n if (!module) {\n console.log(`Cannot find module: ${module_id}`);\n return;\n }\n let result;\n if (module.type === 'gh_element') {\n if (module.technology === 'angular') {\n result = await (0,createAngularModuleInstance/* default */.Z)(this.gudhub, module_id, module.url, this.angularInjector, this.nodeWindow);\n } else if (module.technology === 'class') {\n result = await createClassInstance(this.gudhub, module_id, module.js, module.css, this.nodeWindow);\n }\n }\n if (result) {\n this.pupToCache(module_id, result);\n }\n return result;\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/AppProcessor/AppProcessor.js\n\nclass AppProcessor {\n constructor(storage, pipeService, req, websocket,\n // chunksManager,\n util, activateSW, dataService) {\n this.storage = storage;\n this.pipeService = pipeService;\n this.req = req;\n this.ws = websocket;\n this.applistReceived = false;\n this.activateSW = activateSW; // we use this flag to check if applist was received. The problem is that if you receive an app it also goes to app_list as a result you have the app_list with one app.\n // this.chunksManager = chunksManager;\n this.util = util;\n this.appListeners();\n this.dataService = dataService;\n this.appRequestCache = new Map();\n\n // this.dataServiceRequestedIdSet = new Set;\n }\n\n async createNewAppApi(app) {\n try {\n const response = await this.req.post({\n url: \"/api/app/create\",\n form: {\n app: JSON.stringify(app)\n }\n });\n response.from_apps_list = true;\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async updateAppApi(app) {\n try {\n const response = await this.req.post({\n url: \"/api/app/update\",\n form: {\n app: JSON.stringify(app)\n }\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async deleteAppApi(app_id) {\n try {\n const response = await this.req.post({\n url: \"/api/app/delete\",\n form: {\n app_id\n }\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async getAppListApi() {\n try {\n const response = await this.req.get({\n url: \"/api/applist/get\"\n });\n return response.apps_list.map(app => {\n app.from_apps_list = true;\n return app;\n });\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n getAppListFromStorage() {\n return this.storage.getAppsList();\n }\n getAppFromStorage(app_id) {\n const app = this.storage.getApp(app_id);\n return app && app.field_list.length ? app : null;\n }\n addNewAppToStorage(app) {\n return this.storage.getAppsList().push(app);\n }\n saveAppInStorage(app) {\n app.items_object = {};\n for (let item = 0; item < app.items_list.length; item++) {\n app.items_object[app.items_list[item].item_id] = {};\n for (let field = 0; field < app.items_list[item].fields.length; field++) {\n app.items_object[app.items_list[item].item_id][app.items_list[item].fields[field].field_id] = app.items_list[item].fields[field];\n }\n }\n const storageApp = this.storage.getApp(app.app_id);\n if (storageApp) {\n app.from_apps_list = storageApp.from_apps_list;\n app.permission = storageApp.permission;\n this.storage.updateApp(app);\n } else {\n app.from_apps_list = false;\n this.addNewAppToStorage(app);\n }\n return this.getAppFromStorage(app.app_id);\n }\n updateAppFieldsAndViews(app) {\n const storageApp = this.getAppFromStorage(app.app_id);\n app.items_list = storageApp.items_list;\n app.file_list = storageApp.file_list;\n app.from_apps_list = storageApp.from_apps_list;\n app.items_object = storageApp.items_object;\n this.storage.updateApp(app);\n //-- Sending updates for Views Updates\n this.pipeService.emit(\"gh_app_views_update\", {\n app_id: app.app_id\n }, app.views_list);\n\n //-- Sending updates for updating Fields\n app.field_list.forEach(fieldModel => {\n this.pipeService.emit(\"gh_model_update\", {\n app_id: app.app_id,\n field_id: fieldModel.field_id\n }, fieldModel);\n });\n }\n updateAppInStorage(app) {\n const storageApp = this.storage.getApp(app.app_id);\n if (storageApp) {\n this.storage.updateApp(app);\n this.pipeService.emit(\"gh_app_update\", {\n app_id: app.app_id\n }, app);\n this.pipeService.emit(\"gh_items_update\", {\n app_id: app.app_id\n }, app.items_list);\n } else {\n this.addNewAppToStorage(app);\n }\n ;\n }\n deletingAppFromStorage(app_id) {\n let appList = this.storage.getAppsList();\n appList.forEach((app, key) => {\n if (app.app_id == app_id) appList.splice(key);\n });\n return appList;\n }\n\n //-- here we check if app already in storage then we dont update it.\n //-- the thing is that is posible that we receive app before receiveng an applist\n updateAppsListInStorage(appsList = []) {\n for (const app of appsList) {\n const storageApp = this.storage.getApp(app.app_id);\n if (storageApp) {\n storageApp.from_apps_list = app.from_apps_list;\n storageApp.permission = app.permission;\n } else this.addNewAppToStorage(app);\n }\n }\n async refreshApps(apps_id = []) {\n for (const app_id of apps_id) {\n if (app_id != undefined) {\n try {\n const app = await this.dataService.getApp(app_id);\n if (app) {\n app.items_object = {};\n for (let item = 0; item < app.items_list.length; item++) {\n app.items_object[app.items_list[item].item_id] = {};\n for (let field = 0; field < app.items_list[item].fields.length; field++) {\n app.items_object[app.items_list[item].item_id][app.items_list[item].fields[field].field_id] = app.items_list[item].fields[field];\n }\n }\n this.updateAppInStorage(app);\n // This emit needs to update values in app after websockets reconnect\n this.pipeService.emit('gh_app_views_update', {\n app_id: app.app_id\n }, app.views_list);\n }\n } catch (err) {\n console.log(err);\n }\n }\n }\n console.log(\"Apps refreshed: \", JSON.stringify(apps_id));\n }\n async refreshAppsList() {\n let currentAppsList = this.getAppListFromStorage();\n let appsListFromApi = await this.getAppListApi();\n let mergedAppsList = appsListFromApi.map(apiApp => {\n return {\n ...apiApp,\n ...currentAppsList.find(app => app.app_id === apiApp.app_id)\n };\n });\n this.updateAppsListInStorage(mergedAppsList);\n this.pipeService.emit('gh_apps_list_refreshed', {});\n }\n async getAppsList() {\n let app_list = this.getAppListFromStorage();\n if (!this.applistReceived) {\n let received_app_list = await this.getAppListApi();\n if (!received_app_list) return null;\n\n // for oprimization purpose: in case when there was severals calls at same moment of the getAppLists one call will overwrite app_list of another call with the same app_list,\n this.updateAppsListInStorage(received_app_list);\n this.applistReceived = true;\n app_list = received_app_list;\n\n // Here we get default user's app\n // We do it here to do it only once\n // We do it because we need to initialize WebSockets, which we do in getApp method\n this.getApp(this.storage.getUser().app_init);\n }\n return app_list;\n }\n\n //********** GET APP INFO ************/\n //-- it returs App with Empty fields_list, items_list, file_list, views_list\n //-- Such simmple data needed to render App Icons, and do some simple updates in App like updating App name icon permisions etc when full app data is not needed\n async getAppInfo(app_id) {\n const app_list = await this.getAppsList();\n return app_list ? app_list.find(app => app.app_id == app_id) : null;\n }\n async deleteApp(app_id) {\n await this.deleteAppApi(app_id);\n return this.deletingAppFromStorage(app_id);\n }\n async getApp(app_id, trash = false) {\n if (!app_id) return null;\n let app = this.getAppFromStorage(app_id);\n if (app) return app;\n if (this.appRequestCache.has(app_id)) return this.appRequestCache.get(app_id);\n let self = this;\n let pr = new Promise(async (resolve, reject) => {\n try {\n let app = await self.dataService.getApp(app_id);\n if (!app) reject();\n\n //!!! temporary check !!!! if app has chanks property then we start getting it\n // if (\n // receivedApp.chunks &&\n // receivedApp.chunks.length\n // ) {\n // // here should be checked is merge required\n\n // let chunks = await self.chunksManager.getChunks(app_id, receivedApp.chunks);\n // receivedApp.items_list = self.util.mergeChunks([\n // ...chunks,\n // receivedApp,\n // ]);\n // }\n\n // This code for trash must be changed\n // return trash ? app : {...app, items_list: app.items_list.filter(item => !item.trash)};\n let filtered = trash ? app : {\n ...app,\n items_list: app.items_list.filter(item => !item.trash)\n };\n resolve(filtered);\n self.saveAppInStorage(filtered);\n self.ws.addSubscription(app_id);\n } catch (error) {\n reject();\n }\n });\n self.appRequestCache.set(app_id, pr);\n return pr;\n }\n async updateApp(app) {\n if (!app.views_list || !app.views_list.length || !app.show) {\n const storageApp = await this.getApp(app.app_id);\n if (!app.views_list || !app.views_list.length) {\n app.views_list = storageApp.views_list;\n }\n if (typeof app.show === 'undefined') {\n app.show = storageApp.show;\n }\n }\n const updatedApp = await this.updateAppApi(app);\n this.updateAppFieldsAndViews(updatedApp);\n return updatedApp;\n }\n async updateAppInfo(appInfo = {}) {\n this.pipeService.emit(\"gh_app_info_update\", {\n app_id: appInfo.app_id\n }, appInfo);\n return this.updateApp(appInfo);\n }\n async createNewApp(app) {\n const newApp = await this.createNewAppApi(app);\n newApp.items_object = {};\n this.addNewAppToStorage(newApp);\n return newApp;\n }\n async getAppViews(app_id) {\n if (app_id) {\n const app = await this.getApp(app_id);\n return app.views_list;\n }\n }\n async handleAppChange(id, prevVersion, nextVersion) {\n // generate required events etc, do job\n }\n clearAppProcessor() {\n this.getAppListPromises = null;\n this.getAppPromises = {};\n this.applistReceived = false;\n }\n appListeners() {\n this.pipeService.onRoot(\"gh_app_get\", {}, async (event, data) => {\n if (data && data.app_id) {\n const app = await this.getApp(data.app_id);\n this.pipeService.emit(\"gh_app_get\", data, app);\n }\n });\n this.pipeService.onRoot(\"gh_apps_list_get\", {}, async (event, data) => {\n const appList = await this.getAppsList();\n this.pipeService.emit(\"gh_apps_list_get\", data, appList);\n });\n this.pipeService.onRoot(\"gh_delete_app\", {}, async (event, data) => {\n const appList = await this.deleteApp(data.app_id);\n this.pipeService.emit(\"gh_apps_list_update\", {\n recipient: \"all\"\n }, appList);\n });\n this.pipeService.onRoot(\"gh_app_update\", {}, async (event, data) => {\n data.app.items_list = [];\n data.app.file_list = [];\n const newApp = await this.updateApp(data.app);\n this.pipeService.emit(\"gh_app_views_update\", {\n app_id: newApp.app_id\n }, newApp.views_list);\n const appsList = await this.getAppsList();\n this.pipeService.emit(\"gh_apps_list_update\", {\n recipient: \"all\"\n }, appsList);\n newApp.field_list.forEach(fieldModel => {\n this.pipeService.emit(\"gh_model_update\", {\n app_id: newApp.app_id,\n field_id: fieldModel.field_id\n }, fieldModel);\n });\n });\n this.pipeService.onRoot(\"gh_app_view_get\", {}, async (event, data) => {\n if (data && data.app_id) {\n const app = await this.getApp(data.app_id);\n app.views_list.forEach((view, key) => {\n if (view.view_id == data.view_id) {\n this.pipeService.emit(\"gh_app_view_get\", data, app.views_list[key]);\n }\n });\n }\n });\n\n // Return app_name, app_id, app_icon\n this.pipeService.onRoot(\"gh_app_info_get\", {}, async (event, data) => {\n const appInfo = await this.getAppInfo(data.app_id);\n if (appInfo) this.pipeService.emit(\"gh_app_info_get\", data, appInfo);\n });\n this.pipeService.onRoot(\"gh_app_info_update\", {}, async (event, data) => {\n if (data && data.app) {\n const appInfo = await this.updateAppInfo(data.app);\n this.pipeService.emit(\"gh_app_info_update\", {\n app_id: data.app.app_id\n }, appInfo);\n }\n });\n this.pipeService.onRoot(\"gh_app_create\", {}, async (event, data) => {\n await this.createNewApp(data.app);\n const appsList = await this.getAppsList();\n this.pipeService.emit(\"gh_apps_list_update\", {\n recipient: \"all\"\n }, appsList);\n });\n if (consts/* IS_WEB */.P && this.activateSW) {\n navigator.serviceWorker.addEventListener(\"message\", async event => {\n if (event.data.type === \"refresh app\") {\n const app = await this.getApp(event.data.payload.app_id);\n if (app) {\n this.util.compareAppsItemsLists(app.items_list, event.data.payload.items_list.filter(item => !item.trash), ({\n diff_fields_items,\n diff_fields_items_Ids,\n diff_items,\n newItems,\n deletedItems\n }) => {\n if (diff_items.length || newItems.length || deletedItems.length) {\n this.pipeService.emit(\"gh_items_update\", {\n app_id: event.data.payload.app_id\n }, event.data.payload.items_list.filter(item => !item.trash));\n diff_items.forEach(item => this.pipeService.emit(\"gh_item_update\", {\n app_id: event.data.payload.app_id,\n item_id: item.item_id\n }, item));\n }\n diff_fields_items_Ids.forEach(item_id => {\n const item = diff_fields_items[item_id];\n if (!item) return;\n item.forEach(field => {\n this.pipeService.emit(\"gh_value_update\", {\n app_id: event.data.payload.app_id,\n item_id,\n field_id: field.field_id\n }, field.field_value);\n });\n });\n });\n }\n event.data.payload.items_list = await this.util.mergeChunks([app, event.data.payload]); //here check Ask Andrew\n this.saveAppInStorage(event.data.payload);\n }\n // if (event.data.type === \"refresh appList\") {\n // this.storage.unsetApps();\n // this.updateAppsListInStorage(\n // event.data.payload.apps_list.map((app) => {\n // app.from_apps_list = true;\n // return app;\n // })\n // );\n // this.pipeService.emit(\n // \"gh_apps_list_update\",\n // { recipient: \"all\" },\n // event.data.payload.apps_list\n // );\n // }\n });\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/ItemProcessor/ItemProcessor.js\n\nclass ItemProcessor {\n constructor(storage, pipeService, req, appProcessor, util) {\n this.storage = storage;\n this.pipeService = pipeService;\n this.req = req;\n this.appProcessor = appProcessor;\n this.util = util;\n this.itemListeners();\n }\n async addItemsApi(app_id, itemsList) {\n try {\n const response = await this.req.post({\n url: \"/api/items/add\",\n form: {\n items: JSON.stringify(itemsList),\n app_id\n }\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async updateItemsApi(app_id, itemsList) {\n try {\n const response = await this.req.post({\n url: \"/api/items/update\",\n form: {\n items: JSON.stringify(itemsList),\n app_id\n }\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n deleteItemsApi(items_ids) {\n try {\n const response = this.req.post({\n url: \"/api/items/delete\",\n form: {\n items_ids: JSON.stringify(items_ids)\n }\n });\n response.from_apps_list = true;\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async addItemsToStorage(app_id, items) {\n // !!!!! Need to fix this\n const app = await this.appProcessor.getApp(app_id);\n if (app) {\n items.forEach(item => {\n app.items_list.push(item);\n app.items_object[item.item_id] = {};\n for (let field = 0; field < item.fields.length; field++) {\n app.items_object[item.item_id][item.fields[field].field_id] = item.fields[field];\n }\n this.pipeService.emit(\"gh_item_update\", {\n app_id\n }, [item]);\n });\n this.pipeService.emit(\"gh_items_update\", {\n app_id\n }, app.items_list);\n this.storage.updateApp(app);\n }\n return app;\n }\n async updateItemsInStorage(app_id, items) {\n this.pipeService.emit(\"gh_items_update\", {\n app_id\n }, items);\n //-- getting app from storage\n const app = await this.appProcessor.getApp(app_id);\n if (app && items) {\n items.forEach(item => {\n const addressToEmit = {\n app_id\n };\n this.pipeService.emit(\"gh_item_update\", addressToEmit, [item]);\n addressToEmit.item_id = item.item_id;\n this.pipeService.emit(\"gh_item_update\", addressToEmit, item);\n //-- Looking for updated item in the main storage according to 'item_id'\n const fundedItem = app.items_list.find(storageItem => storageItem.item_id == item.item_id);\n if (fundedItem) {\n //-- Updating value in existing fields\n item.fields.forEach(field => {\n const fundedField = fundedItem.fields.find(storageField => storageField.field_id == field.field_id);\n addressToEmit.field_id = field.field_id;\n if (fundedField) {\n //-- Checking if value of existing fields were updated, because we are not sending updates if value didn't changed\n if (fundedField.field_value != field.field_value) {\n fundedField.field_value = field.field_value;\n app.items_object[fundedItem.item_id][fundedField.field_id] = fundedField;\n this.pipeService.emit(\"gh_value_update\", addressToEmit, field.field_value);\n }\n } else {\n //-- Pushing new fields to the storage (it's when user enters new value)\n fundedItem.fields.push(field);\n app.items_object[fundedItem.item_id][field.field_id] = field;\n this.pipeService.emit(\"gh_value_update\", addressToEmit, field.field_value);\n }\n });\n }\n });\n }\n return items;\n }\n\n //here\n handleItemsChange(id, prevVersion, nextVersion) {\n let compareRes = this.util.compareItems(prevVersion.items_list, nextVersion.items_list);\n this.updateItemsInStorage(id, compareRes.diff_src_items);\n this.addItemsToStorage(id, compareRes.new_src_items);\n }\n triggerItemsChange(id, compareRes) {\n this.updateItemsInStorage(id, compareRes.diff_src_items);\n this.addItemsToStorage(id, compareRes.new_src_items);\n }\n handleDiff(id, compare) {\n this.updateItemsInStorage(id, compare.diff_src_items);\n this.addItemsToStorage(id, compare.new_src_items);\n this.deleteItemsFromStorage(id, compare.trash_src_items);\n }\n async deleteItemsFromStorage(app_id, itemsForDelete = []) {\n const app = await this.appProcessor.getApp(app_id);\n if (app) {\n app.items_list = app.items_list.filter(item => {\n if (itemsForDelete.find(findedItem => item.item_id == findedItem.item_id)) {\n delete app.items_object[item.item_id];\n return false;\n }\n return true;\n });\n this.pipeService.emit(\"gh_items_update\", {\n app_id\n }, app.items_list);\n this.storage.updateApp(app);\n }\n }\n async getItems(app_id, trash = false) {\n const app = await this.appProcessor.getApp(app_id, trash);\n if (!app) return null;\n return app.items_list;\n }\n async addNewItems(app_id, itemsList) {\n const preparedItemsList = itemsList.map(item => ({\n ...item,\n fields: filterFields(item.fields)\n }));\n const newItems = await this.addItemsApi(app_id, preparedItemsList);\n await this.addItemsToStorage(app_id, newItems);\n this.pipeService.emit(\"gh_items_add\", {\n app_id\n }, newItems);\n return newItems;\n }\n async updateItems(app_id, itemsList) {\n const preparedItemsList = itemsList.map(item => ({\n ...item,\n fields: filterFields(item.fields)\n }));\n const updatedItems = await this.updateItemsApi(app_id, preparedItemsList);\n return await this.updateItemsInStorage(app_id, updatedItems);\n }\n async deleteItems(app_id, itemsIds) {\n return this.deleteItemsApi(itemsIds).then(async items => await this.deleteItemsFromStorage(app_id, items));\n }\n itemListeners() {\n this.pipeService.onRoot(\"gh_items_get\", {}, async (event, data) => {\n if (data && data.app_id) {\n const items = await this.getItems(data.app_id);\n if (items) {\n this.pipeService.emit(\"gh_items_get\", data, items);\n } else {\n this.pipeService.emit(\"gh_items_get\", data, []);\n }\n }\n });\n this.pipeService.onRoot(\"gh_items_add\", {}, async (event, data) => {\n if (data && data.app_id && data.items) {\n const items = await this.addNewItems(data.app_id, data.items);\n if (items) {\n this.pipeService.emit(\"gh_items_add\", data, items);\n } else {\n this.pipeService.emit(\"gh_items_add\", data, []);\n }\n }\n });\n this.pipeService.onRoot(\"gh_items_update\", {}, async (event, data) => {\n if (data && data.app_id && data.items) {\n const items = await this.updateItems(data.app_id, data.items);\n if (items) {\n this.pipeService.emit(\"gh_items_update\", data, items);\n } else {\n this.pipeService.emit(\"gh_items_update\", data, []);\n }\n }\n });\n\n /* ---- FIELD VALUE GET LISTENING ---- */\n this.pipeService.onRoot(\"gh_item_get\", {}, async (event, data) => {\n if (data && data.app_id) {\n const items = await this.getItems(data.app_id);\n const item = items.find(item => item.item_id == data.item_id);\n this.pipeService.emit(\"gh_item_get\", data, item);\n }\n });\n\n // GETTING FILTERED ITEM\n /* data = {\n app_id: current appId,\n element_app_id: for reference appId,\n itemsId: current itemId,\n filters_list: filters list,\n field_groupe ?: field group,\n search?: search value,\n }\n */\n this.pipeService.onRoot(\"gh_filtered_items_get\", {}, async (event, data) => {\n if (data && data.element_app_id) {\n const items = await this.getItems(data.element_app_id);\n const filteredItems = await this.util.getFilteredItems(items, data.filters_list, data.element_app_id, data.app_id, data.item_id, data.field_groupe, data.search, data.search_params);\n this.pipeService.emit(\"gh_filtered_items_get\", data, filteredItems);\n }\n });\n this.pipeService.onRoot(\"gh_filter_items\", {}, async (event, data) => {\n if (data && data.items) {\n const filteredItems = await this.util.getFilteredItems(data.items, data.filters_list, data.element_app_id, data.app_id, data.item_id, data.field_groupe, data.search, data.search_params);\n this.pipeService.emit(\"gh_filter_items\", data, filteredItems);\n }\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/FieldProcessor/FieldProcessor.js\nclass FieldProcessor {\n constructor(storage, req, appProcessor, itemProcessor, pipeService) {\n this.storage = storage;\n this.req = req;\n this.appProcessor = appProcessor;\n this.itemProcessor = itemProcessor;\n this.pipeService = pipeService;\n this.fieldListeners();\n }\n deleteFieldApi(field_id) {\n return this.req.post({\n url: \"/api/app/delete-field\",\n form: {\n field_id\n }\n });\n }\n async updatedFieldApi(app_id, fieldModel = {}) {\n const app = await this.appProcessor.getApp(app_id);\n const appToUpdate = {\n app_id,\n app_name: app.app_name,\n group_id: app.group_id,\n icon: app.icon,\n field_list: app.field_list.map(field => field.field_id == fieldModel.field_id ? {\n ...field,\n ...fieldModel\n } : field),\n views_list: app.views_list\n };\n return this.appProcessor.updateApp(appToUpdate);\n }\n setFieldValueApi(app_id, item_id, field_id, field_value) {\n const itemToUpdate = [{\n item_id,\n fields: [{\n field_id,\n field_value\n }]\n }];\n return this.itemProcessor.updateItems(app_id, itemToUpdate);\n }\n deleteFieldInStorage(app_id, field_id) {\n const app = this.storage.getApp(app_id);\n app.field_list = app.field_list.filter(field => field.file_id != field_id);\n app.items_list = app.items_list.map(item => {\n item.fields = item.fields.filter(field => field.field_id != field_id);\n return item;\n });\n this.storage.updateApp(app);\n return true;\n }\n updateFieldInStorage(app_id, fieldModel) {\n const app = this.storage.getApp(app_id);\n app.field_list = app.field_list.map(field => field.field_id == fieldModel.field_id ? {\n ...field,\n ...fieldModel\n } : field);\n this.storage.updateApp(app);\n return fieldModel;\n }\n\n //This method was created for setFieldValue()\n //!!!!! 1) Change for each to for\n //!!!!! 2) Stop iteration after value has been found\n updateFieldValue(app_id, item_id, field_id, field_value) {\n const app = this.storage.getApp(app_id);\n app.items_list.forEach(item => {\n if (item.item_id == item_id) {\n item.fields.forEach(field => {\n if (field.field_id == field_id) {\n field.field_value = field_value;\n app.items_object[item.item_id][field.field_id] = field;\n }\n });\n }\n });\n this.storage.updateApp(app);\n return field_value;\n }\n async getField(app_id, field_id) {\n const app = await this.appProcessor.getApp(app_id);\n if (!app) return null;\n for (let i = 0; i < app.field_list.length; i++) {\n if (app.field_list[i].field_id == field_id) {\n return app.field_list[i];\n }\n }\n return null;\n }\n async getFieldIdByNameSpace(app_id, name_space) {\n const app = await this.appProcessor.getApp(app_id);\n if (!app) return null;\n for (let i = 0; i < app.field_list.length; i++) {\n if (app.field_list[i].name_space == name_space) {\n return app.field_list[i].field_id;\n }\n }\n return null;\n }\n\n //!!!!! Shou Be Renamed to getFields() !!!!!!!\n async getFieldModels(app_id) {\n const app = await this.appProcessor.getApp(app_id);\n if (!app) return null;\n return app.field_list;\n }\n\n //!!!!! Shou Be added fieldID argument !!!!!!!\n async updateField(app_id, fieldModel) {\n if (!app_id || !fieldModel) {\n return;\n }\n const newModel = await this.updatedFieldApi(app_id, fieldModel);\n return this.updateFieldInStorage(app_id, newModel);\n }\n async deleteField(app_id, field_id) {\n await this.deleteFieldApi(field_id);\n return this.deleteFieldInStorage(app_id, field_id);\n }\n\n //this method should alwaise return value if no value we return null\n async getFieldValue(app_id, item_id, field_id) {\n let fieldValue = null;\n const app = await this.appProcessor.getApp(app_id);\n try {\n fieldValue = app.items_object[item_id][field_id].field_value;\n } catch (err) {}\n return fieldValue;\n }\n async setFieldValue(app_id, item_id, field_id, field_value) {\n if (!app_id || !item_id || !field_id) {\n return;\n }\n await this.setFieldValueApi(app_id, item_id, field_id, field_value);\n return this.updateFieldValue(app_id, item_id, field_id, field_value);\n }\n fieldListeners() {\n this.pipeService.onRoot('gh_value_get', {}, async (event, data) => {\n if (data.app_id && data.item_id && data.field_id) {\n let field_value = await this.getFieldValue(data.app_id, data.item_id, data.field_id);\n this.pipeService.emit('gh_value_get', data, field_value);\n }\n });\n this.pipeService.onRoot('gh_value_set', {}, async (event, data) => {\n if (data.item_id) {\n this.setFieldValue(data.app_id, data.item_id, data.field_id, data.new_value);\n delete data.new_value;\n }\n });\n this.pipeService.onRoot('gh_model_get', {}, async (event, data) => {\n try {\n let field_model = await this.getField(data.app_id, data.field_id);\n this.pipeService.emit('gh_model_get', data, field_model);\n } catch (error) {\n console.log('Field model: ', error);\n }\n });\n this.pipeService.onRoot('gh_model_update', {}, async (event, data) => {\n let field_model = await this.updateField(data.app_id, data.field_model);\n this.pipeService.emit('gh_model_update', {\n app_id: data.app_id,\n field_id: data.field_id\n }, field_model);\n });\n this.pipeService.onRoot('gh_models_get', {}, async (event, data) => {\n let field_models = await this.getFieldModels(data.app_id);\n this.pipeService.emit('gh_models_get', data, field_models);\n });\n this.pipeService.onRoot('gh_model_delete', {}, async (event, data) => {\n let status = await this.deleteField(data.app_id, data.field_id);\n this.pipeService.emit('gh_model_delete', data, status);\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/FileManager/FileManager.js\nclass FileManager {\n constructor(storage, pipeService, req, appProcessor) {\n this.storage = storage;\n this.pipeService = pipeService;\n this.req = req;\n this.appProcessor = appProcessor;\n }\n\n //********************* UPLOAD FILE *********************//\n\n async uploadFileApi(fileData, app_id, item_id) {\n try {\n const form = {\n \"file-0\": fileData,\n app_id,\n item_id\n };\n const file = await this.req.post({\n url: \"/file/formupload\",\n form\n });\n return file;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async uploadFileFromStringApi(fileObject) {\n try {\n const file = await this.req.post({\n url: \"/file/upload\",\n form: {\n file: JSON.stringify(fileObject)\n }\n });\n return file;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async updateFileFromStringApi(data, file_id, file_name, extension, format) {\n try {\n const fileObj = {\n file_name,\n extension,\n file_id,\n format,\n source: data\n };\n const file = await this.req.post({\n url: \"/file/update\",\n form: {\n file: JSON.stringify(fileObj)\n }\n });\n return file;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async duplicateFileApi(files) {\n return this.req.post({\n url: \"/api/new/file/duplicate\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n form: {\n files: JSON.stringify(files)\n }\n });\n }\n async downloadFileFromString(app_id, file_id) {\n if (await this.isFileExists(app_id, file_id)) {\n let file = await this.getFile(app_id, file_id);\n let data = await this.req.get({\n url: file.url + '?timestamp=' + file.last_update,\n externalResource: true\n });\n return {\n file,\n data,\n type: 'file'\n };\n } else {\n return false;\n }\n }\n async duplicateFile(files) {\n let duplicatedFiles = await this.duplicateFileApi(files);\n duplicatedFiles.forEach(file => {\n this.addFileToStorage(file.app_id, file);\n });\n return duplicatedFiles;\n }\n async deleteFileApi(id) {\n try {\n const file = await this.req.get({\n url: `/file/delete?file_id=${id}`\n });\n return file;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n addFileToStorage(app_id, file) {\n const app = this.storage.getApp(app_id);\n if (app) {\n app.file_list.push(file);\n this.storage.updateApp(app);\n this.pipeService.emit(\"gh_file_upload\", {\n app_id,\n item_id: file.item_id,\n file_id: file.file_id\n }, file);\n }\n }\n addFilesToStorage(app_id, files) {\n const app = this.storage.getApp(app_id);\n if (app) {\n app.file_list.push(...files);\n this.storage.updateApp(app);\n files.forEach(file => {\n this.pipeService.emit(\"gh_file_upload\", {\n app_id,\n item_id: file.item_id,\n file_id: file.file_id\n }, file);\n });\n }\n }\n deleteFileFromStorage(fileId, app_id) {\n const app = this.storage.getApp(app_id);\n if (app) {\n let deletedFile;\n app.file_list = app.file_list.filter(file => {\n if (file.file_id != fileId) {\n return true;\n } else {\n deletedFile = file;\n return false;\n }\n });\n this.storage.updateApp(app);\n this.pipeService.emit(\"gh_file_delete\", {\n file_id: fileId\n }, deletedFile);\n }\n }\n updateFileInStorage(fileId, app_id, newFile) {\n const app = this.storage.getApp(app_id);\n if (app) {\n app.file_list = app.file_list.map(file => file.file_id == fileId ? newFile : file);\n this.storage.updateApp(app);\n this.pipeService.emit(\"gh_file_update\", {\n file_id: fileId\n });\n }\n }\n async getFile(app_id, file_id) {\n const app = await this.appProcessor.getApp(app_id);\n return new Promise((resolve, reject) => {\n let findedFile = app.file_list.find(file => {\n return file.file_id == file_id;\n });\n if (findedFile) {\n resolve(findedFile);\n } else {\n resolve('');\n }\n });\n }\n async getFiles(app_id, filesId = []) {\n const app = await this.appProcessor.getApp(app_id);\n return new Promise((resolve, reject) => {\n let findedFiles = app.file_list.filter(file => {\n return filesId.some(id => {\n return id == file.file_id;\n });\n });\n if (findedFiles) {\n resolve(findedFiles);\n } else {\n resolve('');\n }\n });\n }\n async uploadFile(fileData, app_id, item_id) {\n const file = await this.uploadFileApi(fileData, app_id, item_id);\n this.addFileToStorage(app_id, file);\n return file;\n }\n async uploadFileFromString(fileObject) {\n const file = await this.uploadFileFromStringApi(fileObject);\n this.addFileToStorage(file.app_id, file);\n return file;\n }\n async updateFileFromString(data, file_id, file_name, extension, format) {\n const file = await this.updateFileFromStringApi(data, file_id, file_name, extension, format);\n this.updateFileInStorage(file_id, file.app_id, file);\n return file;\n }\n async deleteFile(id, app_id) {\n await this.deleteFileApi(id);\n this.deleteFileFromStorage(id, app_id);\n return true;\n }\n async isFileExists(app_id, file_id) {\n let urlPattern = /^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$/;\n if (Boolean(file_id)) {\n let file = await this.getFile(app_id, file_id);\n if (Boolean(file)) {\n return urlPattern.test(file.url);\n } else {\n return false;\n }\n } else {\n return false;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DocumentManager/DocumentManager.js\n/* \n Document Template request\n {\n app_id: 1,\n item_id: 1\n element_id: 1,\n data: {}\n }\n\n*/\n\nclass DocumentManager {\n constructor(req, pipeService) {\n this.req = req;\n this.pipeService = pipeService;\n }\n createDocument(documentObject) {\n this.emitDocumentInsert(documentObject);\n return this.req.post({\n url: \"/api/new/document/insert-one\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n form: {\n document: JSON.stringify(documentObject)\n }\n });\n }\n emitDocumentInsert(data) {\n const dataToEmit = typeof data.data === \"string\" ? JSON.parse(data.data) : data.data;\n this.pipeService.emit(\"gh_document_insert_one\", {\n app_id: data.app_id,\n item_id: data.item_id,\n element_id: data.element_id\n }, dataToEmit);\n }\n getDocument(documentAddress) {\n return this.req.post({\n url: \"/api/new/document/find-one\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n form: {\n document: JSON.stringify(documentAddress)\n }\n });\n }\n getDocuments(documentsAddresses) {\n return this.req.post({\n url: \"/api/new/document/find\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n form: {\n document: JSON.stringify(documentsAddresses)\n }\n });\n }\n deleteDocument(documentAddress) {\n return this.req.post({\n url: \"/api/new/document/remove-one\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n form: {\n document: JSON.stringify(documentAddress)\n }\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/GHConstructor/interpritate.js\nclass Interpritate {\n constructor(gudhub) {\n this.gudhub = gudhub;\n }\n\n /*********************** GET INTERPRETATION OBJ ***********************/\n // In this method we are looking for interpretation in data model according to interpretation src\n // then we merged with default interpretation from defaultFieldDataModel\n // if there are no current interpretation we use default interpretation\n async getInterpretationObj(fieldDataModel, defaultFieldDataModel, src, containerId, itemId, appId) {\n var currentIntrpr = [];\n // Creating default interpretation\n var defaultIntrprObj = defaultFieldDataModel.data_model.interpretation.find(function (interpritation) {\n return interpritation.src == src;\n }) || defaultFieldDataModel.data_model.interpretation.find(function (interpritation) {\n return interpritation.src == 'table';\n }) || {\n id: 'default'\n };\n var interpretation = defaultIntrprObj;\n if (fieldDataModel.data_model && fieldDataModel.data_model.interpretation) {\n // To detect interpretation we use (container_id), if there is not (container_id) we use (src)\n for (var i = 0; i < fieldDataModel.data_model.interpretation.length; i++) {\n if (fieldDataModel.data_model.interpretation[i].src == src || fieldDataModel.data_model.interpretation[i].src == containerId) {\n currentIntrpr.push(fieldDataModel.data_model.interpretation[i]);\n }\n }\n for (var i = 0; i < currentIntrpr.length; i++) {\n if (currentIntrpr[i].settings && currentIntrpr[i].settings.condition_filter && currentIntrpr[i].settings.filters_list.length > 0) {\n const item = await gudhub.getItem(appId, itemId);\n if (item) {\n const filteredItems = gudhub.filter([item], currentIntrpr[i].settings.filters_list);\n if (filteredItems.length > 0) {\n interpretation = currentIntrpr[i];\n break;\n }\n }\n } else {\n interpretation = gudhub.mergeObjects(interpretation, currentIntrpr[i]);\n }\n }\n }\n return interpretation;\n }\n\n /*********************** GET INTERPRETATION ***********************/\n\n getInterpretation(value, field, dataType, source, itemId, appId, containerId) {\n const self = this;\n return new Promise(async (resolve, reject) => {\n /*-- By default we use 'data_type' from field but in case if field is undefined we use 'dataType' from attribute*/\n var data_type = field && field.data_type ? field.data_type : dataType;\n\n /*---- Constructing Data Object ----*/\n if (data_type) {\n /*-- if we have data_type then we construct new data object to interpritate value*/\n gudhub.ghconstructor.getInstance(data_type).then(async function (data) {\n if (data) {\n var interpretationObj = await self.getInterpretationObj(field, data.getTemplate().model, source, containerId, itemId, appId);\n data.getInterpretation(value, interpretationObj.id, data_type, field, itemId, appId).then(function (result) {\n // console.log(result, interpretationObj)\n\n resolve(gudhub.mergeObjects(result, interpretationObj));\n }, function (error) {\n reject();\n });\n }\n }, function (error) {});\n } else {\n console.error('Get Interpretation: data_type is undefined', dataType, field);\n }\n });\n }\n\n /********************* GET INTERPRETATION BY ID *********************/\n\n // We add ability to pass value as argument, to reduce number of operations in this case (getFieldValue)\n // This helps if you call method many times, for example in calculator sum and you already have field value\n // By default, value is null, to not break old code working with this method\n\n // For field same as above for value\n async getInterpretationById(appId, itemId, fieldId, interpretationId, value = null, field = null) {\n let fieldValue = value == null ? await this.gudhub.getFieldValue(appId, itemId, fieldId) : value;\n let fieldModel = field == null ? await this.gudhub.getField(appId, fieldId) : field;\n if (fieldModel == null) {\n return '';\n }\n const instance = await this.gudhub.ghconstructor.getInstance(fieldModel.data_type);\n const interpretatedValue = await instance.getInterpretation(fieldValue, interpretationId, fieldModel.data_type, fieldModel, itemId, appId);\n if (interpretatedValue.html == '<span>no interpretation</span>') {\n return fieldValue;\n } else {\n return interpretatedValue.html;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/WebSocket/WebsocketHandler.js\nfunction WebsocketHandler(gudhub, message) {\n switch (message.api) {\n case \"/items/update\":\n console.log(\"/items/update - \", message);\n gudhub.itemProcessor.updateItemsInStorage(message.app_id, message.response);\n break;\n case \"/items/add\":\n console.log(\"/items/add - \", message);\n gudhub.itemProcessor.addItemsToStorage(message.app_id, message.response);\n break;\n case \"/items/delete\":\n console.log(\"/items/delete - \", message);\n gudhub.itemProcessor.deleteItemsFromStorage(message.app_id, message.response);\n break;\n case \"/app/update\":\n console.log(\"/app/update - \", message);\n gudhub.appProcessor.updateAppFieldsAndViews(message.response);\n break;\n case \"/file/delete\":\n console.log(\"file/delete - \", message);\n gudhub.fileManager.deleteFileFromStorage(message.response.file_id, message.app_id);\n break;\n case \"/file/upload\":\n console.log(\"file/upload - \", message);\n gudhub.fileManager.addFileToStorage(message.app_id, message.response);\n break;\n case \"/file/formupload\":\n //I'm not shure if we are using it (probably in contact form)\n console.log(\"file/formupload - \", message);\n break;\n case \"/file/update\":\n //I'm not shure if we are using it (probably in contact form)\n gudhub.fileManager.updateFileInStorage(message.response.file_id, message.response.app_id, message.response);\n console.log(\"file/update - \", message);\n break;\n case \"/new/file/duplicate\":\n //I'm not shure if we are using it (probably in contact form)\n gudhub.fileManager.addFilesToStorage(message.app_id, message.response);\n console.log(\"new/file/duplicate - \", message);\n break;\n case '/api/new/document/insert-one':\n gudhub.documentManager.emitDocumentInsert(message.response);\n console.log('/api/new/document/insert-one - ', message);\n break;\n case '/ws/emit-to-user':\n console.log('/ws/emit-to-user - ', message);\n break;\n case '/ws/broadcast-to-app-subscribers':\n console.log('/ws/broadcast-to-app-subscribers - ', message);\n const response = JSON.parse(message.response);\n if (!response.data_type) return;\n gudhub.ghconstructor.getInstance(response.data_type).then(instance => {\n instance.onMessage(message.app_id, message.user_id, response);\n });\n break;\n default:\n console.warn(\"WEBSOCKETS is not process this API:\", message.api);\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/groupManager/GroupManager.js\nclass GroupManager {\n constructor(gudhub, req) {\n this.req = req;\n this.gudhub = gudhub;\n }\n\n //********************* CREATE GROUP *********************//\n\n async createGroupApi(groupName) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_name: groupName\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/create-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* UPDATE GROUP *********************//\n\n async updateGroupApi(groupId, groupName) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_name: groupName,\n group_id: groupId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/update-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* DELETE GROUP *********************//\n\n async deleteGroupApi(groupId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_id: groupId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/delete-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* ADD USER TO GROUP *********************//\n\n async addUserToGroupApi(groupId, userId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_id: groupId,\n user_id: userId,\n group_permission: permission\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/add-user-to-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* GET USERS BY GROUP *********************//\n\n async getUsersByGroupApi(groupId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_id: groupId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/get-users-by-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* UPDATE USER IN GROUP *********************//\n\n async updateUserInGroupApi(userId, groupId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n user_id: userId,\n group_id: groupId,\n group_permission: permission\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/update-user-in-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* REMOVE USER FROM GROUP *********************//\n\n async deleteUserFromGroupApi(userId, groupId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n user_id: userId,\n group_id: groupId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/delete-user-from-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* GET GROUPS BY USER *********************//\n\n async getGroupsByUserApi(userId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n user_id: userId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/get-groups-by-user\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/sharing/AppGroupSharing.js\nclass AppGroupSharing {\n constructor(gudhub, req) {\n this.req = req;\n this.gudhub = gudhub;\n }\n\n //********************* ADD APP TO GROUP *********************//\n\n async addAppToGroupApi(appId, groupId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n app_id: appId,\n group_id: groupId,\n app_permission: permission\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/add-app-to-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* GET APPS BY GROUP *********************//\n\n async getAppsByGroupApi(groupId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_id: groupId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/get-apps-by-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* UPDATE APP IN GROUP *********************//\n\n async updateAppInGroupApi(appId, groupId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_id: groupId,\n app_id: appId,\n app_permission: permission\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/update-app-in-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* DELETE APP FROM GROUP *********************//\n\n async deleteAppFromGroupApi(appId, groupId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_id: groupId,\n app_id: appId,\n app_permission: permission\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/delete-app-from-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* GET GROUPS BY APP *********************//\n\n async getGroupsByAppApi(appId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n app_id: appId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/get-groups-by-app\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/sharing/GroupSharing.js\n\n\nclass GroupSharing {\n constructor(gudhub, req, pipeService) {\n this.req = req;\n this.gudhub = gudhub;\n this.pipeService = pipeService;\n this.groupManager = new GroupManager(gudhub, req);\n this.appGroupSharing = new AppGroupSharing(gudhub, req);\n }\n createGroup(groupName) {\n return this.groupManager.createGroupApi(groupName);\n }\n updateGroup(groupId, groupName) {\n return this.groupManager.updateGroupApi(groupId, groupName);\n }\n deleteGroup(groupId) {\n return this.groupManager.deleteGroupApi(groupId);\n }\n async addUserToGroup(userId, groupId, permission) {\n let newUser = await this.groupManager.addUserToGroupApi(userId, groupId, permission);\n this.pipeService.emit(\"group_members_add\", {\n app_id: \"group_sharing\"\n }, newUser);\n return newUser;\n }\n getUsersByGroup(groupId) {\n return this.groupManager.getUsersByGroupApi(groupId);\n }\n async updateUserInGroup(userId, groupId, permission) {\n let updatedUser = await this.groupManager.updateUserInGroupApi(userId, groupId, permission);\n this.pipeService.emit(\"group_members_update\", {\n app_id: \"group_sharing\"\n }, updatedUser);\n return updatedUser;\n }\n async deleteUserFromGroup(userId, groupId) {\n let deletedUser = await this.groupManager.deleteUserFromGroupApi(userId, groupId);\n this.pipeService.emit(\"group_members_delete\", {\n app_id: \"group_sharing\"\n }, deletedUser);\n return deletedUser;\n }\n getGroupsByUser(userId) {\n return this.groupManager.getGroupsByUserApi(userId);\n }\n addAppToGroup(appId, groupId, permission) {\n return this.appGroupSharing.addAppToGroupApi(appId, groupId, permission);\n }\n getAppsByGroup(groupId) {\n return this.appGroupSharing.getAppsByGroupApi(groupId);\n }\n updateAppInGroup(appId, groupId, permission) {\n return this.appGroupSharing.updateAppInGroupApi(appId, groupId, permission);\n }\n deleteAppFromGroup(appId, groupId, permission) {\n return this.appGroupSharing.deleteAppFromGroupApi(appId, groupId, permission);\n }\n getGroupsByApp(appId) {\n return this.appGroupSharing.getGroupsByAppApi(appId);\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/sharing/Sharing.js\nclass Sharing {\n constructor(gudhub, req) {\n this.req = req;\n this.gudhub = gudhub;\n }\n async add(appId, userId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n app_id: appId,\n user_id: userId,\n sharing_permission: permission\n };\n const response = await this.req.post({\n url: \"/sharing/add\",\n form\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async update(appId, userId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n app_id: appId,\n user_id: userId,\n sharing_permission: permission\n };\n const response = await this.req.post({\n url: \"/sharing/update\",\n form\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async delete(appId, userId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n app_id: appId,\n user_id: userId\n };\n const response = await this.req.post({\n url: \"/sharing/delete\",\n form\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async getAppUsers(appId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n app_id: appId\n };\n const response = await this.req.post({\n url: \"/sharing/get-app-users\",\n form\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async addInvitation(guestsEmails, apps) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n guests_emails: guestsEmails,\n apps\n };\n const response = await this.req.post({\n url: \"/api/invitation/add\",\n form\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/WebSocket/WebSocketEmitter.js\nclass WebSocketEmitter {\n constructor(gudhub) {\n this.gudhub = gudhub;\n }\n async emitToUser(user_id, data) {\n const message = {\n user_id,\n data: typeof data === 'object' ? JSON.stringify(data) : data\n };\n const response = await this.gudhub.req.post({\n url: '/ws/emit-to-user',\n form: message\n });\n return response;\n }\n async broadcastToAppSubscribers(app_id, data_type, data) {\n const message = {\n app_id,\n data: JSON.stringify({\n data_type,\n data\n })\n };\n const response = await this.gudhub.req.post({\n url: '/ws/broadcast-to-app-subscribers',\n form: message\n });\n return response;\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/gudhub.js\n\n\n\n\n\n\n\n\n\n\n\n\n// import { ChunksManager } from \"./ChunksManager/ChunksManager.js\";\n\n\n\n\n\n\n\n\nclass GudHub {\n constructor(authKey, options = {\n server_url: server_url,\n wss_url: wss_url,\n node_server_url: node_server_url,\n initWebsocket: false,\n activateSW: false,\n swLink: \"\",\n async_modules_path: async_modules_path,\n file_server_url: file_server_url,\n automation_modules_path: automation_modules_path,\n accesstoken: this.accesstoken,\n expirydate: this.expirydate\n }) {\n this.serialized = {\n authKey,\n options\n };\n this.config = options;\n this.ghconstructor = new GHConstructor(this);\n this.interpritate = new Interpritate(this);\n this.pipeService = new PipeService();\n this.storage = new Storage(options.async_modules_path, options.file_server_url, options.automation_modules_path);\n this.util = new Utils(this);\n this.req = new GudHubHttpsService(options.server_url);\n this.auth = new Auth(this.req, this.storage);\n this.sharing = new Sharing(this, this.req);\n this.groupSharing = new GroupSharing(this, this.req, this.pipeService);\n\n // Login with access token - pass to setUser access token and after it user can make requests with access token\n // This method created for optimize GudHub initialization without auth key\n if (authKey) {\n this.storage.setUser({\n auth_key: authKey\n });\n } else if (options.accesstoken && options.expirydate) {\n this.storage.setUser({\n accesstoken: options.accesstoken,\n expirydate: options.expirydate\n });\n }\n this.req.init(this.auth.getToken.bind(this.auth));\n this.ws = new WebSocketApi(options.wss_url, this.auth);\n\n //todo\n // this.chunksManager = new ChunksManager(\n // this.storage,\n // this.pipeService,\n // this.req,\n // this.util,\n // new ChunkDataService(this.req, chunkDataServiceConf, this),\n // );\n this.appProcessor = new AppProcessor(this.storage, this.pipeService, this.req, this.ws,\n // this.chunksManager,\n this.util, options.activateSW, new export_AppDataService(this.req, appDataServiceConf, this));\n this.itemProcessor = new ItemProcessor(this.storage, this.pipeService, this.req, this.appProcessor, this.util);\n this.fieldProcessor = new FieldProcessor(this.storage, this.req, this.appProcessor, this.itemProcessor, this.pipeService);\n this.fileManager = new FileManager(this.storage, this.pipeService, this.req, this.appProcessor);\n this.documentManager = new DocumentManager(this.req, this.pipeService);\n this.websocketsemitter = new WebSocketEmitter(this);\n if (options.initWebsocket) {\n const gudhub = this;\n this.ws.initWebSocket(WebsocketHandler.bind(this, gudhub), this.appProcessor.refreshApps.bind(this.appProcessor));\n }\n if (options.activateSW) {\n this.activateSW(options.swLink);\n }\n }\n async activateSW(swLink) {\n if (consts/* IS_WEB */.P && \"serviceWorker\" in window.navigator) {\n try {\n const sw = await window.navigator.serviceWorker.register(swLink);\n sw.update().then(() => console.log(\"%cSW ->>> Service worker successful updated\", \"display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;\")).catch(() => console.warn(\"SW ->>> Service worker is not updated\"));\n console.log(\"%cSW ->>> Service worker is registered\", \"display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;\", sw);\n } catch (error) {\n console.warn(\"%cSW ->>> Service worker is not registered\", \"display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;\", error);\n }\n } else {\n console.log(\"%cSW ->>> ServiceWorkers not supported\", \"display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;\");\n }\n }\n\n //************************* PIPESERVICE METHODS ****************************//\n //============= ON PIPE ===============//\n on(types, destination, fn) {\n this.pipeService.on(types, destination, fn);\n return this;\n }\n\n //============= EMIT PIPE ==============//\n emit(types, destination, address, params) {\n this.pipeService.emit(types, destination, address, params);\n return this;\n }\n\n //============ DELETE LISTENER ========//\n destroy(types, destination, func) {\n this.pipeService.destroy(types, destination, func);\n return this;\n }\n\n //************************* FILTERATION ****************************//\n prefilter(filters_list, variables) {\n return this.util.prefilter(filters_list, variables);\n }\n\n //============ DEBOUNCE ========//\n debounce(func, delay) {\n return this.util.debounce(func, delay);\n }\n\n //************************* WEBSOCKETS EMITTER ****************************//\n\n emitToUser(user_id, data) {\n return this.websocketsemitter.emitToUser(user_id, data);\n }\n broadcastToAppSubscribers(app_id, data_type, data) {\n return this.websocketsemitter.broadcastToAppSubscribers(app_id, data_type, data);\n }\n\n /******************* INTERPRITATE *******************/\n\n getInterpretation(value, field, dataType, source, itemId, appId, containerId) {\n return this.interpritate.getInterpretation(value, field, dataType, source, itemId, appId, containerId);\n }\n\n /******************* GET INTERPRETATION BY ID *******************/\n\n getInterpretationById(appId, itemId, fieldId, interpretationId, value, field) {\n return this.interpritate.getInterpretationById(appId, itemId, fieldId, interpretationId, value, field);\n }\n\n //============ FILTER ==========//\n filter(items, filter_list) {\n return this.util.filter(items, filter_list);\n }\n\n //============ MERGE FILTERS ==========//\n mergeFilters(source, destination) {\n return this.util.mergeFilters(source, destination);\n }\n\n //============ GROUP ==========//\n group(fieldGroup, items) {\n return this.util.group(fieldGroup, items);\n }\n\n //============ GET FILTERED ITEMS ==========//\n //it returns items with applyed filter\n getFilteredItems(items, filters_list, options = {}) {\n return this.util.getFilteredItems(items, filters_list, options.element_app_id, options.app_id, options.item_id, options.field_group, options.search, options.search_params);\n }\n sortItems(items, options) {\n return this.util.sortItems(items, options);\n }\n\n //here\n triggerAppChange(id, prevVersion, newVersion) {\n this.itemProcessor.handleItemsChange(id, prevVersion, newVersion);\n this.appProcessor.handleAppChange(id, prevVersion, newVersion);\n }\n\n //TODO handleAppChange\n triggerIemsChange(id, compareRes) {\n this.itemProcessor.triggerItemsChange(id, compareRes);\n }\n jsonToItems(json, map) {\n return this.util.jsonToItems(json, map);\n }\n getDate(queryKey) {\n return this.util.getDate(queryKey);\n }\n populateWithDate(items, model) {\n return this.util.populateWithDate(items, model);\n }\n checkRecurringDate(date, option) {\n return this.util.checkRecurringDate(date, option);\n }\n populateItems(items, model, keep_data) {\n return this.util.populateItems(items, model, keep_data);\n }\n populateWithItemRef(sourceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id) {\n return this.util.populateWithItemRef(sourceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id);\n }\n compareItems(sourceItems, destinationItems, fieldToCompare) {\n return this.util.compareItems(sourceItems, destinationItems, fieldToCompare);\n }\n mergeItems(sourceItems, destinationItems, mergeByFieldId) {\n return this.util.mergeItems(sourceItems, destinationItems, mergeByFieldId);\n }\n mergeObjects(sourceObject, destinationObject) {\n return this.util.mergeObjects(sourceObject, destinationObject);\n }\n makeNestedList(arr, id, parent_id, children_property, priority_property) {\n return this.util.makeNestedList(arr, id, parent_id, children_property, priority_property);\n }\n jsonConstructor(scheme, items, variables, appId) {\n return this.util.jsonConstructor(scheme, items, variables, appId);\n }\n\n //************************* APP PROCESSOR ****************************//\n getAppsList() {\n return this.appProcessor.getAppsList();\n }\n getAppInfo(app_id) {\n return this.appProcessor.getAppInfo(app_id);\n }\n deleteApp(app_id) {\n return this.appProcessor.deleteApp(app_id);\n }\n getApp(app_id) {\n return this.appProcessor.getApp(app_id);\n }\n updateApp(app) {\n return this.appProcessor.updateApp(app);\n }\n updateAppInfo(appInfo) {\n return this.appProcessor.updateAppInfo(appInfo);\n }\n createNewApp(app) {\n return this.appProcessor.createNewApp(app);\n }\n getItems(app_id) {\n return this.itemProcessor.getItems(app_id);\n }\n async getItem(app_id, item_id) {\n const items = await this.getItems(app_id);\n if (items) {\n return items.find(item => item.item_id == item_id);\n }\n }\n addNewItems(app_id, itemsList) {\n return this.itemProcessor.addNewItems(app_id, itemsList);\n }\n updateItems(app_id, itemsList) {\n return this.itemProcessor.updateItems(app_id, itemsList);\n }\n deleteItems(app_id, itemsIds) {\n return this.itemProcessor.deleteItems(app_id, itemsIds);\n }\n getField(app_id, field_id) {\n return this.fieldProcessor.getField(app_id, field_id);\n }\n getFieldIdByNameSpace(app_id, name_space) {\n return this.fieldProcessor.getFieldIdByNameSpace(app_id, name_space);\n }\n getFieldModels(app_id) {\n return this.fieldProcessor.getFieldModels(app_id);\n }\n updateField(app_id, fieldModel) {\n return this.fieldProcessor.updateField(app_id, fieldModel);\n }\n deleteField(app_id, field_id) {\n return this.fieldProcessor.deleteField(app_id, field_id);\n }\n getFieldValue(app_id, item_id, field_id) {\n return this.fieldProcessor.getFieldValue(app_id, item_id, field_id);\n }\n setFieldValue(app_id, item_id, field_id, field_value) {\n return this.fieldProcessor.setFieldValue(app_id, item_id, field_id, field_value);\n }\n getFile(app_id, file_id) {\n return this.fileManager.getFile(app_id, file_id);\n }\n getFiles(app_id, filesId) {\n return this.fileManager.getFiles(app_id, filesId);\n }\n uploadFile(fileData, app_id, item_id) {\n return this.fileManager.uploadFile(fileData, app_id, item_id);\n }\n uploadFileFromString(source, file_name, app_id, item_id, extension, format, element_id) {\n return this.fileManager.uploadFileFromString(source, file_name, app_id, item_id, extension, format, element_id);\n }\n updateFileFromString(data, file_id, file_name, extension, format) {\n return this.fileManager.updateFileFromString(data, file_id, file_name, extension, format);\n }\n deleteFile(app_id, id) {\n return this.fileManager.deleteFile(app_id, id);\n }\n duplicateFile(files) {\n return this.fileManager.duplicateFile(files);\n }\n downloadFileFromString(app_id, file_id) {\n return this.fileManager.downloadFileFromString(app_id, file_id);\n }\n createDocument(documentObject) {\n return this.documentManager.createDocument(documentObject);\n }\n getDocument(documentAddress) {\n return this.documentManager.getDocument(documentAddress);\n }\n getDocuments(documentAddress) {\n return this.documentManager.getDocuments(documentAddress);\n }\n deleteDocument(documentAddress) {\n return this.documentManager.deleteDocument(documentAddress);\n }\n login(data) {\n return this.auth.login(data);\n }\n loginWithToken(token) {\n return this.auth.loginWithToken(token);\n }\n logout(token) {\n this.appProcessor.clearAppProcessor();\n return this.auth.logout(token);\n }\n signup(user) {\n return this.auth.signup(user);\n }\n getUsersList(keyword) {\n return this.auth.getUsersList(keyword);\n }\n updateToken(auth_key) {\n return this.auth.updateToken(auth_key);\n }\n avatarUploadApi(image) {\n return this.auth.avatarUploadApi(image);\n }\n getVersion() {\n return this.auth.getVersion();\n }\n getUserById(userId) {\n return this.auth.getUserById(userId);\n }\n getToken() {\n return this.auth.getToken();\n }\n updateUser(userData) {\n return this.auth.updateUser(userData);\n }\n updateAvatar(imageData) {\n return this.auth.updateAvatar(imageData);\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/appRequestWorker.js\n\n\n\n\nlet appRequestWorker_gudhub = {};\nlet appDataService = {};\n\n//TODO also ChunkDataService !!!!!!!!!!!!!!!!!!!!!!!\n\nself.onmessage = async function (e) {\n if (e.data.type === 'init') {\n appRequestWorker_gudhub = new GudHub(e.data.gudhubSerialized.authKey, e.data.gudhubSerialized.options);\n appDataService = new IndexedDBAppServiceForWorker(appRequestWorker_gudhub.req, appsConf, appRequestWorker_gudhub);\n }\n if (e.data.type === 'processData') {\n //todo cached could not exist !!!!!!!!!!!!!!!!!!!\n\n let cached = await appDataService.getCached(e.data.id);\n let newVersion = await appDataService.getApp(e.data.id);\n\n // let comparison = gudhub.compareItems(cached.items_list, newVersion.items_list);\n let comparison = appRequestWorker_gudhub.compareItems(newVersion.items_list, cached.items_list);\n this.postMessage({\n id: e.data.id,\n compareRes: comparison,\n newVersion,\n type: e.data.type\n });\n\n /// todo process data merge and then call merge and compare and then return from here for example event to update\n\n // also dont forget that main thread also uses AppDataService !!!!!!!!!!!!!!!!!! make temporarile a separate class for it maybe\n }\n\n if (e.data.type === 'requestApp') {\n let data = await appDataService.getApp(e.data.id);\n this.postMessage({\n id: e.data.id,\n type: e.data.type,\n data\n });\n }\n\n // this.appRequestAndProcessWorker.postMessage({ type: 'requestApp', id: id });\n};\n\n//# sourceURL=webpack://@gudhub/core/./GUDHUB/DataService/IndexedDB/appRequestWorker.js_+_65_modules?")},960:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Z: () => (/* binding */ createAngularModuleInstance)\n/* harmony export */ });\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9669);\n/* harmony import */ var _consts_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(738);\n\n\n\n/*************** FAKE ANGULAR $Q ***************/\n// It's needed when we import angular code.\n\nlet $q = {\n when: function (a) {\n return new Promise(resolve => {\n resolve(a);\n });\n }\n};\n\n/*************** FAKE ANGULAR ***************/\n// It's needed when we import angular code.\n\nlet factoryReturns = {};\nlet angular = {\n module() {\n return angular;\n },\n directive() {\n return angular;\n },\n factory(name, args) {\n try {\n if (typeof args === 'object') {\n factoryReturns[name] = args[args.length - 1]($q);\n } else {\n factoryReturns[name] = args($q);\n }\n } catch (error) {\n console.log('Errror in data type: ', name);\n console.log(error);\n }\n return angular;\n },\n service() {\n return angular;\n },\n run() {\n return angular;\n },\n filter() {\n return angular;\n },\n controller() {\n return angular;\n },\n value() {\n return angular;\n },\n element() {\n return angular;\n },\n injector() {\n return angular;\n },\n invoke() {\n return angular;\n }\n};\n\n/*************** CREATE INSTANCE ***************/\n// Here we are importing modules using dynamic import.\n// For browser: just do dynamic import with url as parameter.\n// In node environment we can't dynamically import module from url, so we download module's code via axios and transform it to data url.\n// Then creating classes from imported modules.\n// Finally, creating instance of module, using functions from imported classes. If we in browser - also takes methods from angular's injector.\n\n/*** TODO ***/\n// Need to make angular modules instances creation similar to pure js classes.\n\nasync function createAngularModuleInstance(gudhub, module_id, module_url, angularInjector, nodeWindow) {\n try {\n let angularModule;\n let importedClass;\n if (_consts_js__WEBPACK_IMPORTED_MODULE_1__/* .IS_WEB */ .P) {\n if (window.angular) {\n // Download module with $ocLazyLoad if module not in injector already.\n\n if (!angularInjector.has(module_id)) {\n await angularInjector.get('$ocLazyLoad').load(module_url);\n }\n angularModule = await angularInjector.get(module_id);\n\n // Then, dynamically import modules from url.\n\n let module = await axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);\n module = module.data;\n try {\n eval(module);\n } catch (error) {\n console.error(`ERROR WHILE EVAL() IN GHCONSTRUCTOR. MODULE ID: ${module_id}`);\n console.log(error);\n }\n importedClass = factoryReturns[module_id];\n } else {\n let module = await axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);\n module = module.data;\n try {\n eval(module);\n } catch (err) {\n console.log(`Error while importing module: ${module_id}`);\n console.log(err);\n }\n\n // Modules always exports classes as default, so we create new class instance.\n\n importedClass = factoryReturns[module_id];\n }\n } else {\n const proxy = new Proxy(nodeWindow, {\n get: (target, property) => {\n return target[property];\n },\n set: (target, property, value) => {\n target[property] = value;\n global[property] = value;\n return true;\n }\n });\n\n // If node's global object don't have window and it's methods yet - set it.\n if (!global.hasOwnProperty('window')) {\n global.window = proxy;\n global.document = nodeWindow.document;\n global.Element = nodeWindow.Element;\n global.CharacterData = nodeWindow.CharacterData;\n global.this = proxy;\n global.self = proxy;\n global.Blob = nodeWindow.Blob;\n global.Node = nodeWindow.Node;\n global.navigator = nodeWindow.navigator;\n global.HTMLElement = nodeWindow.HTMLElement;\n global.XMLHttpRequest = nodeWindow.XMLHttpRequest;\n global.WebSocket = nodeWindow.WebSocket;\n global.crypto = nodeWindow.crypto;\n global.DOMParser = nodeWindow.DOMParser;\n global.Symbol = nodeWindow.Symbol;\n global.document.queryCommandSupported = command => {\n return false;\n };\n global.angular = angular;\n }\n\n // Downloading module's code and transform it to data url.\n\n let response = await axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);\n let code = response.data;\n let encodedCode = encodeURIComponent(code);\n encodedCode = 'data:text/javascript;charset=utf-8,' + encodedCode;\n let module;\n\n // Then, dynamically import modules from data url.\n\n try {\n module = await import( /* webpackIgnore: true */encodedCode);\n } catch (err) {\n console.log(`Error while importing module: ${module_id}`);\n console.log(err);\n }\n\n // Modules always exports classes as default, so we create new class instance.\n\n importedClass = new module.default();\n }\n let result = {\n type: module_id,\n //*************** GET TEMPLATE ****************//\n\n getTemplate: function (ref, changeFieldName, displayFieldName, field_model, appId, itemId) {\n let displayFieldNameChecked = displayFieldName === 'false' ? false : true;\n return importedClass.getTemplate(ref, changeFieldName, displayFieldNameChecked, field_model, appId, itemId);\n },\n //*************** GET DEFAULT VALUE ****************//\n\n getDefaultValue: function (fieldModel, valuesArray, itemsList, currentAppId) {\n return new Promise(async resolve => {\n let getValueFunction = importedClass.getDefaultValue;\n if (getValueFunction) {\n let value = await getValueFunction(fieldModel, valuesArray, itemsList, currentAppId);\n resolve(value);\n } else {\n resolve(null);\n }\n });\n },\n //*************** GET SETTINGS ****************//\n\n getSettings: function (scope, settingType, fieldModels) {\n return importedClass.getSettings(scope, settingType, fieldModels);\n },\n //*************** FILTER****************//\n\n filter: {\n getSearchOptions: function (fieldModel) {\n let d_type = importedClass;\n if (d_type.filter && d_type.filter.getSearchOptions) {\n return importedClass.filter.getSearchOptions(fieldModel) || null;\n }\n return [];\n },\n getDropdownValues: function () {\n let d_type = importedClass;\n if (d_type.filter && d_type.filter.getDropdownValues) {\n return d_type.filter.getDropdownValues() || null;\n } else {\n return [];\n }\n }\n },\n //*************** GET INTERPRETATION ****************//\n\n getInterpretation: function (value, interpretation_id, dataType, field, itemId, appId) {\n return new Promise(async resolve => {\n let currentDataType = importedClass;\n try {\n let interpr_arr = await currentDataType.getInterpretation(gudhub, value, appId, itemId, field, dataType);\n let data = interpr_arr.find(item => item.id == interpretation_id) || interpr_arr.find(item => item.id == 'default');\n let result = await data.content();\n resolve({\n html: result\n });\n } catch (error) {\n console.log(`ERROR IN ${module_id}`, error);\n resolve({\n html: '<span>no interpretation</span>'\n });\n }\n });\n },\n //*************** GET INTERPRETATIONS LIST ****************//\n\n getInterpretationsList: function (field_value, appId, itemId, field) {\n return importedClass.getInterpretation(field_value, appId, itemId, field);\n },\n //*************** GET INTERPRETATED VALUE ****************//\n\n getInterpretatedValue: function (field_value, field_model, appId, itemId) {\n return new Promise(async resolve => {\n let getInterpretatedValueFunction = importedClass.getInterpretatedValue;\n if (getInterpretatedValueFunction) {\n let value = await getInterpretatedValueFunction(field_value, field_model, appId, itemId);\n resolve(value);\n } else {\n resolve(field_value);\n }\n });\n },\n //*************** ON MESSAGE ****************//\n\n onMessage: function (appId, userId, response) {\n return new Promise(async resolve => {\n const onMessageFunction = importedClass.onMessage;\n if (onMessageFunction) {\n const result = await onMessageFunction(appId, userId, response);\n resolve(result);\n }\n resolve(null);\n });\n }\n };\n\n // We need these methods in browser environment only\n\n if (_consts_js__WEBPACK_IMPORTED_MODULE_1__/* .IS_WEB */ .P) {\n //*************** EXTEND CONTROLLER ****************//\n\n result.extendController = function (actionScope) {\n angularModule.getActionScope(actionScope);\n };\n\n //*************** RUN ACTION ****************//\n\n result.runAction = function (scope) {\n try {\n angularModule.runAction(scope);\n } catch (e) {}\n };\n\n //*************** GET WINDOW SCOPE ****************//\n\n result.getWindowScope = function (windowScope) {\n return angularModule.getWindowScope(windowScope);\n };\n\n //*************** GET WINDOW HTML ****************//\n\n result.getWindowHTML = function (scope) {\n return angularModule.getWindowHTML(scope);\n };\n }\n return result;\n } catch (err) {\n console.log(err);\n console.log(`Failed in createAngularModuleInstance (ghconstructor). Module id: ${module_id}.`);\n }\n}\n\n//# sourceURL=webpack://@gudhub/core/./GUDHUB/GHConstructor/createAngularModuleInstance.js?")},738:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";eval('/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ P: () => (/* binding */ IS_WEB)\n/* harmony export */ });\nconst IS_WEB = ![typeof window, typeof document].includes("undefined");\n\n//# sourceURL=webpack://@gudhub/core/./GUDHUB/consts.js?')},8593:module=>{"use strict";eval('module.exports = JSON.parse(\'{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}\');\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/package.json?')}},__webpack_module_cache__={};function __webpack_require__(e){var n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var t=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](t,t.exports,__webpack_require__),t.exports}__webpack_require__.d=(e,n)=>{for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var __webpack_exports__=__webpack_require__(1953)})();
1
+ !function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(this,(()=>(()=>{var __webpack_modules__={9669:(module,__unused_webpack_exports,__webpack_require__)=>{eval("module.exports = __webpack_require__(1609);\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/index.js?")},5448:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\nvar settle = __webpack_require__(6026);\nvar cookies = __webpack_require__(4372);\nvar buildURL = __webpack_require__(5327);\nvar buildFullPath = __webpack_require__(4097);\nvar parseHeaders = __webpack_require__(4109);\nvar isURLSameOrigin = __webpack_require__(7985);\nvar createError = __webpack_require__(5061);\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/adapters/xhr.js?")},1609:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\nvar utils = __webpack_require__(4867);\nvar bind = __webpack_require__(1849);\nvar Axios = __webpack_require__(321);\nvar mergeConfig = __webpack_require__(7185);\nvar defaults = __webpack_require__(5655);\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = __webpack_require__(5263);\naxios.CancelToken = __webpack_require__(4972);\naxios.isCancel = __webpack_require__(6502);\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = __webpack_require__(8713);\n\n// Expose isAxiosError\naxios.isAxiosError = __webpack_require__(6268);\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports["default"] = axios;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/axios.js?')},5263:module=>{"use strict";eval("\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/cancel/Cancel.js?")},4972:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar Cancel = __webpack_require__(5263);\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/cancel/CancelToken.js?")},6502:module=>{"use strict";eval("\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/cancel/isCancel.js?")},321:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\nvar buildURL = __webpack_require__(5327);\nvar InterceptorManager = __webpack_require__(782);\nvar dispatchRequest = __webpack_require__(3572);\nvar mergeConfig = __webpack_require__(7185);\nvar validator = __webpack_require__(4875);\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/Axios.js?")},782:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/InterceptorManager.js?")},4097:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar isAbsoluteURL = __webpack_require__(1793);\nvar combineURLs = __webpack_require__(7303);\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/buildFullPath.js?")},5061:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar enhanceError = __webpack_require__(481);\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/createError.js?")},3572:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\nvar transformData = __webpack_require__(8527);\nvar isCancel = __webpack_require__(6502);\nvar defaults = __webpack_require__(5655);\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/dispatchRequest.js?")},481:module=>{"use strict";eval("\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/enhanceError.js?")},7185:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/mergeConfig.js?")},6026:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar createError = __webpack_require__(5061);\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/settle.js?")},8527:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\nvar defaults = __webpack_require__(5655);\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/core/transformData.js?")},5655:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\nvar normalizeHeaderName = __webpack_require__(6016);\nvar enhanceError = __webpack_require__(481);\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = __webpack_require__(5448);\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = __webpack_require__(5448);\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/defaults.js?")},1849:module=>{"use strict";eval("\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/bind.js?")},5327:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/buildURL.js?")},7303:module=>{"use strict";eval("\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/combineURLs.js?")},4372:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/cookies.js?")},1793:module=>{"use strict";eval('\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/isAbsoluteURL.js?')},6268:module=>{"use strict";eval("\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/isAxiosError.js?")},7985:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/isURLSameOrigin.js?")},6016:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/normalizeHeaderName.js?")},4109:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(4867);\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/parseHeaders.js?")},8713:module=>{"use strict";eval("\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/spread.js?")},4875:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar pkg = __webpack_require__(8593);\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/helpers/validator.js?")},4867:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar bind = __webpack_require__(1849);\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/lib/utils.js?")},1924:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(210);\n\nvar callBind = __webpack_require__(5559);\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/call-bind/callBound.js?")},5559:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar bind = __webpack_require__(8612);\nvar GetIntrinsic = __webpack_require__(210);\nvar setFunctionLength = __webpack_require__(7771);\n\nvar $TypeError = __webpack_require__(4453);\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $defineProperty = __webpack_require__(4429);\nvar $max = GetIntrinsic('%Math.max%');\n\nmodule.exports = function callBind(originalFunction) {\n\tif (typeof originalFunction !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\tvar func = $reflectApply(bind, $call, arguments);\n\treturn setFunctionLength(\n\t\tfunc,\n\t\t1 + $max(0, originalFunction.length - (arguments.length - 1)),\n\t\ttrue\n\t);\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/call-bind/index.js?")},8729:(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.getDefaultOptions = getDefaultOptions;\nexports.setDefaultOptions = setDefaultOptions;\nvar defaultOptions = {};\nfunction getDefaultOptions() {\n return defaultOptions;\n}\nfunction setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/_lib/defaultOptions/index.js?')},8734:(module,exports)=>{"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = requiredArgs;\nfunction requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/_lib/requiredArgs/index.js?")},2084:(module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = toInteger;\nfunction toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n var number = Number(dirtyNumber);\n if (isNaN(number)) {\n return number;\n }\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/_lib/toInteger/index.js?')},5430:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4836)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = add;\nvar _typeof2 = _interopRequireDefault(__webpack_require__(8698));\nvar _index = _interopRequireDefault(__webpack_require__(7262));\nvar _index2 = _interopRequireDefault(__webpack_require__(6581));\nvar _index3 = _interopRequireDefault(__webpack_require__(1171));\nvar _index4 = _interopRequireDefault(__webpack_require__(8734));\nvar _index5 = _interopRequireDefault(__webpack_require__(2084));\n/**\n * @name add\n * @category Common Helpers\n * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @description\n * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n *\n * | Key | Description |\n * |----------------|------------------------------------|\n * | years | Amount of years to be added |\n * | months | Amount of months to be added |\n * | weeks | Amount of weeks to be added |\n * | days | Amount of days to be added |\n * | hours | Amount of hours to be added |\n * | minutes | Amount of minutes to be added |\n * | seconds | Amount of seconds to be added |\n *\n * All values default to 0\n *\n * @returns {Date} the new date with the seconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add the following duration to 1 September 2014, 10:19:50\n * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30,\n * })\n * //=> Thu Jun 15 2017 15:29:20\n */\nfunction add(dirtyDate, duration) {\n (0, _index4.default)(2, arguments);\n if (!duration || (0, _typeof2.default)(duration) !== \'object\') return new Date(NaN);\n var years = duration.years ? (0, _index5.default)(duration.years) : 0;\n var months = duration.months ? (0, _index5.default)(duration.months) : 0;\n var weeks = duration.weeks ? (0, _index5.default)(duration.weeks) : 0;\n var days = duration.days ? (0, _index5.default)(duration.days) : 0;\n var hours = duration.hours ? (0, _index5.default)(duration.hours) : 0;\n var minutes = duration.minutes ? (0, _index5.default)(duration.minutes) : 0;\n var seconds = duration.seconds ? (0, _index5.default)(duration.seconds) : 0;\n\n // Add years and months\n var date = (0, _index3.default)(dirtyDate);\n var dateWithMonths = months || years ? (0, _index2.default)(date, months + years * 12) : date;\n\n // Add weeks and days\n var dateWithDays = days || weeks ? (0, _index.default)(dateWithMonths, days + weeks * 7) : dateWithMonths;\n\n // Add days, hours, minutes and seconds\n var minutesToAdd = minutes + hours * 60;\n var secondsToAdd = seconds + minutesToAdd * 60;\n var msToAdd = secondsToAdd * 1000;\n var finalDate = new Date(dateWithDays.getTime() + msToAdd);\n return finalDate;\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/add/index.js?')},7262:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4836)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = addDays;\nvar _index = _interopRequireDefault(__webpack_require__(2084));\nvar _index2 = _interopRequireDefault(__webpack_require__(1171));\nvar _index3 = _interopRequireDefault(__webpack_require__(8734));\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} - the new date with the days added\n * @throws {TypeError} - 2 arguments required\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nfunction addDays(dirtyDate, dirtyAmount) {\n (0, _index3.default)(2, arguments);\n var date = (0, _index2.default)(dirtyDate);\n var amount = (0, _index.default)(dirtyAmount);\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n date.setDate(date.getDate() + amount);\n return date;\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/addDays/index.js?')},6581:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4836)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = addMonths;\nvar _index = _interopRequireDefault(__webpack_require__(2084));\nvar _index2 = _interopRequireDefault(__webpack_require__(1171));\nvar _index3 = _interopRequireDefault(__webpack_require__(8734));\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the months added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n */\nfunction addMonths(dirtyDate, dirtyAmount) {\n (0, _index3.default)(2, arguments);\n var date = (0, _index2.default)(dirtyDate);\n var amount = (0, _index.default)(dirtyAmount);\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n var dayOfMonth = date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we\'ll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n var endOfDesiredMonth = new Date(date.getTime());\n endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);\n var daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we\'re already at the end of the month, then this is the correct date\n // and we\'re done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won\'t\n // cause an overflow, so set the desired day-of-month. Note that we can\'t\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);\n return date;\n }\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/addMonths/index.js?')},5276:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4836)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = isSameWeek;\nvar _index = _interopRequireDefault(__webpack_require__(2466));\nvar _index2 = _interopRequireDefault(__webpack_require__(8734));\n/**\n * @name isSameWeek\n * @category Week Helpers\n * @summary Are the given dates in the same week (and month and year)?\n *\n * @description\n * Are the given dates in the same week (and month and year)?\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Boolean} the dates are in the same week (and month and year)\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // Are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))\n * //=> true\n *\n * @example\n * // If week starts with Monday,\n * // are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {\n * weekStartsOn: 1\n * })\n * //=> false\n *\n * @example\n * // Are 1 January 2014 and 1 January 2015 in the same week?\n * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1))\n * //=> false\n */\nfunction isSameWeek(dirtyDateLeft, dirtyDateRight, options) {\n (0, _index2.default)(2, arguments);\n var dateLeftStartOfWeek = (0, _index.default)(dirtyDateLeft, options);\n var dateRightStartOfWeek = (0, _index.default)(dirtyDateRight, options);\n return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime();\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/isSameWeek/index.js?')},8933:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4836)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = setDay;\nvar _index = _interopRequireDefault(__webpack_require__(7262));\nvar _index2 = _interopRequireDefault(__webpack_require__(1171));\nvar _index3 = _interopRequireDefault(__webpack_require__(2084));\nvar _index4 = _interopRequireDefault(__webpack_require__(8734));\nvar _index5 = __webpack_require__(8729);\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} day - the day of the week of the new date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the new date with the day of the week set\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * const result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nfunction setDay(dirtyDate, dirtyDay, options) {\n var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;\n (0, _index4.default)(2, arguments);\n var defaultOptions = (0, _index5.getDefaultOptions)();\n var weekStartsOn = (0, _index3.default)((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);\n\n // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError(\'weekStartsOn must be between 0 and 6 inclusively\');\n }\n var date = (0, _index2.default)(dirtyDate);\n var day = (0, _index3.default)(dirtyDay);\n var currentDay = date.getDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var delta = 7 - weekStartsOn;\n var diff = day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7;\n return (0, _index.default)(date, diff);\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/setDay/index.js?')},2466:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4836)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = startOfWeek;\nvar _index = _interopRequireDefault(__webpack_require__(1171));\nvar _index2 = _interopRequireDefault(__webpack_require__(2084));\nvar _index3 = _interopRequireDefault(__webpack_require__(8734));\nvar _index4 = __webpack_require__(8729);\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the start of a week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nfunction startOfWeek(dirtyDate, options) {\n var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;\n (0, _index3.default)(1, arguments);\n var defaultOptions = (0, _index4.getDefaultOptions)();\n var weekStartsOn = (0, _index2.default)((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);\n\n // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError(\'weekStartsOn must be between 0 and 6 inclusively\');\n }\n var date = (0, _index.default)(dirtyDate);\n var day = date.getDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setDate(date.getDate() - diff);\n date.setHours(0, 0, 0, 0);\n return date;\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/startOfWeek/index.js?')},1171:(module,exports,__webpack_require__)=>{"use strict";eval("\n\nvar _interopRequireDefault = (__webpack_require__(4836)[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = toDate;\nvar _typeof2 = _interopRequireDefault(__webpack_require__(8698));\nvar _index = _interopRequireDefault(__webpack_require__(8734));\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nfunction toDate(argument) {\n (0, _index.default)(1, arguments);\n var argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (argument instanceof Date || (0, _typeof2.default)(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\");\n // eslint-disable-next-line no-console\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/date-fns/toDate/index.js?")},2296:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar $defineProperty = __webpack_require__(4429);\n\nvar $SyntaxError = __webpack_require__(3464);\nvar $TypeError = __webpack_require__(4453);\n\nvar gopd = __webpack_require__(7296);\n\n/** @type {import('.')} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor<unknown>} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/define-data-property/index.js?")},4429:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(210);\n\n/** @type {import('.')} */\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nmodule.exports = $defineProperty;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-define-property/index.js?")},3981:module=>{"use strict";eval("\n\n/** @type {import('./eval')} */\nmodule.exports = EvalError;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/eval.js?")},1648:module=>{"use strict";eval("\n\n/** @type {import('.')} */\nmodule.exports = Error;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/index.js?")},4726:module=>{"use strict";eval("\n\n/** @type {import('./range')} */\nmodule.exports = RangeError;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/range.js?")},6712:module=>{"use strict";eval("\n\n/** @type {import('./ref')} */\nmodule.exports = ReferenceError;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/ref.js?")},3464:module=>{"use strict";eval("\n\n/** @type {import('./syntax')} */\nmodule.exports = SyntaxError;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/syntax.js?")},4453:module=>{"use strict";eval("\n\n/** @type {import('./type')} */\nmodule.exports = TypeError;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/type.js?")},3915:module=>{"use strict";eval("\n\n/** @type {import('./uri')} */\nmodule.exports = URIError;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/uri.js?")},7648:module=>{"use strict";eval("\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/function-bind/implementation.js?")},8612:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar implementation = __webpack_require__(7648);\n\nmodule.exports = Function.prototype.bind || implementation;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/function-bind/index.js?")},210:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar undefined;\n\nvar $Error = __webpack_require__(1648);\nvar $EvalError = __webpack_require__(3981);\nvar $RangeError = __webpack_require__(4726);\nvar $ReferenceError = __webpack_require__(6712);\nvar $SyntaxError = __webpack_require__(3464);\nvar $TypeError = __webpack_require__(4453);\nvar $URIError = __webpack_require__(3915);\n\nvar $Function = Function;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = __webpack_require__(1405)();\nvar hasProto = __webpack_require__(8185)();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t__proto__: null,\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': $Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': $EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': $RangeError,\n\t'%ReferenceError%': $ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': $URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t__proto__: null,\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = __webpack_require__(8612);\nvar hasOwn = __webpack_require__(8824);\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/get-intrinsic/index.js?")},7296:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(210);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/gopd/index.js?")},1044:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar $defineProperty = __webpack_require__(4429);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\treturn !!$defineProperty;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!$defineProperty) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/has-property-descriptors/index.js?")},8185:module=>{"use strict";eval("\n\nvar test = {\n\t__proto__: null,\n\tfoo: {}\n};\n\nvar $Object = Object;\n\n/** @type {import('.')} */\nmodule.exports = function hasProto() {\n\t// @ts-expect-error: TS errors on an inherited property for some reason\n\treturn { __proto__: test }.foo === test.foo\n\t\t&& !(test instanceof $Object);\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/has-proto/index.js?")},1405:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = __webpack_require__(5419);\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/has-symbols/index.js?")},5419:module=>{"use strict";eval("\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/has-symbols/shams.js?")},8824:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = __webpack_require__(8612);\n\n/** @type {import('.')} */\nmodule.exports = bind.call(call, $hasOwn);\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/hasown/index.js?")},9832:(module,__unused_webpack_exports,__webpack_require__)=>{eval("/*! jsonpath 1.1.1 */\n\n(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=undefined;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=undefined;for(var o=0;o<r.length;o++)s(r[o]);return s})({\"./aesprim\":[function(require,module,exports){\n/*\n Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>\n Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>\n Copyright (C) 2013 Mathias Bynens <mathias@qiwi.be>\n Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>\n Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be>\n Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>\n Copyright (C) 2012 Kris Kowal <kris.kowal@cixar.com>\n Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>\n Copyright (C) 2012 Arpad Borsos <arpad.borsos@googlemail.com>\n Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*jslint bitwise:true plusplus:true */\n/*global esprima:true, define:true, exports:true, window: true,\nthrowErrorTolerant: true,\nthrowError: true, generateStatement: true, peek: true,\nparseAssignmentExpression: true, parseBlock: true, parseExpression: true,\nparseFunctionDeclaration: true, parseFunctionExpression: true,\nparseFunctionSourceElements: true, parseVariableIdentifier: true,\nparseLeftHandSideExpression: true,\nparseUnaryExpression: true,\nparseStatement: true, parseSourceElement: true */\n\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,\n // Rhino, and plain browser loading.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define(['exports'], factory);\n } else if (typeof exports !== 'undefined') {\n factory(exports);\n } else {\n factory((root.esprima = {}));\n }\n}(this, function (exports) {\n 'use strict';\n\n var Token,\n TokenName,\n FnExprTokens,\n Syntax,\n PropertyKind,\n Messages,\n Regex,\n SyntaxTreeDelegate,\n source,\n strict,\n index,\n lineNumber,\n lineStart,\n length,\n delegate,\n lookahead,\n state,\n extra;\n\n Token = {\n BooleanLiteral: 1,\n EOF: 2,\n Identifier: 3,\n Keyword: 4,\n NullLiteral: 5,\n NumericLiteral: 6,\n Punctuator: 7,\n StringLiteral: 8,\n RegularExpression: 9\n };\n\n TokenName = {};\n TokenName[Token.BooleanLiteral] = 'Boolean';\n TokenName[Token.EOF] = '<end>';\n TokenName[Token.Identifier] = 'Identifier';\n TokenName[Token.Keyword] = 'Keyword';\n TokenName[Token.NullLiteral] = 'Null';\n TokenName[Token.NumericLiteral] = 'Numeric';\n TokenName[Token.Punctuator] = 'Punctuator';\n TokenName[Token.StringLiteral] = 'String';\n TokenName[Token.RegularExpression] = 'RegularExpression';\n\n // A function following one of those tokens is an expression.\n FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',\n 'return', 'case', 'delete', 'throw', 'void',\n // assignment operators\n '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',\n '&=', '|=', '^=', ',',\n // binary/unary operators\n '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',\n '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',\n '<=', '<', '>', '!=', '!=='];\n\n Syntax = {\n AssignmentExpression: 'AssignmentExpression',\n ArrayExpression: 'ArrayExpression',\n BlockStatement: 'BlockStatement',\n BinaryExpression: 'BinaryExpression',\n BreakStatement: 'BreakStatement',\n CallExpression: 'CallExpression',\n CatchClause: 'CatchClause',\n ConditionalExpression: 'ConditionalExpression',\n ContinueStatement: 'ContinueStatement',\n DoWhileStatement: 'DoWhileStatement',\n DebuggerStatement: 'DebuggerStatement',\n EmptyStatement: 'EmptyStatement',\n ExpressionStatement: 'ExpressionStatement',\n ForStatement: 'ForStatement',\n ForInStatement: 'ForInStatement',\n FunctionDeclaration: 'FunctionDeclaration',\n FunctionExpression: 'FunctionExpression',\n Identifier: 'Identifier',\n IfStatement: 'IfStatement',\n Literal: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExpression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n NewExpression: 'NewExpression',\n ObjectExpression: 'ObjectExpression',\n Program: 'Program',\n Property: 'Property',\n ReturnStatement: 'ReturnStatement',\n SequenceExpression: 'SequenceExpression',\n SwitchStatement: 'SwitchStatement',\n SwitchCase: 'SwitchCase',\n ThisExpression: 'ThisExpression',\n ThrowStatement: 'ThrowStatement',\n TryStatement: 'TryStatement',\n UnaryExpression: 'UnaryExpression',\n UpdateExpression: 'UpdateExpression',\n VariableDeclaration: 'VariableDeclaration',\n VariableDeclarator: 'VariableDeclarator',\n WhileStatement: 'WhileStatement',\n WithStatement: 'WithStatement'\n };\n\n PropertyKind = {\n Data: 1,\n Get: 2,\n Set: 4\n };\n\n // Error messages should be identical to V8.\n Messages = {\n UnexpectedToken: 'Unexpected token %0',\n UnexpectedNumber: 'Unexpected number',\n UnexpectedString: 'Unexpected string',\n UnexpectedIdentifier: 'Unexpected identifier',\n UnexpectedReserved: 'Unexpected reserved word',\n UnexpectedEOS: 'Unexpected end of input',\n NewlineAfterThrow: 'Illegal newline after throw',\n InvalidRegExp: 'Invalid regular expression',\n UnterminatedRegExp: 'Invalid regular expression: missing /',\n InvalidLHSInAssignment: 'Invalid left-hand side in assignment',\n InvalidLHSInForIn: 'Invalid left-hand side in for-in',\n MultipleDefaultsInSwitch: 'More than one default clause in switch statement',\n NoCatchOrFinally: 'Missing catch or finally after try',\n UnknownLabel: 'Undefined label \\'%0\\'',\n Redeclaration: '%0 \\'%1\\' has already been declared',\n IllegalContinue: 'Illegal continue statement',\n IllegalBreak: 'Illegal break statement',\n IllegalReturn: 'Illegal return statement',\n StrictModeWith: 'Strict mode code may not include a with statement',\n StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',\n StrictVarName: 'Variable name may not be eval or arguments in strict mode',\n StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',\n StrictParamDupe: 'Strict mode function may not have duplicate parameter names',\n StrictFunctionName: 'Function name may not be eval or arguments in strict mode',\n StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',\n StrictDelete: 'Delete of an unqualified identifier in strict mode.',\n StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',\n AccessorDataProperty: 'Object literal may not have data and accessor property with the same name',\n AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',\n StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',\n StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',\n StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',\n StrictReservedWord: 'Use of future reserved word in strict mode'\n };\n\n // See also tools/generate-unicode-regex.py.\n Regex = {\n NonAsciiIdentifierStart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]'),\n NonAsciiIdentifierPart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0\\u08A2-\\u08AC\\u08E4-\\u08FE\\u0900-\\u0963\\u0966-\\u096F\\u0971-\\u0977\\u0979-\\u097F\\u0981-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C01-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C82\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D02\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1D00-\\u1DE6\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA697\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A\\uAA7B\\uAA80-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE26\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]')\n };\n\n // Ensure the condition is true, otherwise throw an error.\n // This is only to have a better contract semantic, i.e. another safety net\n // to catch a logic error. The condition shall be fulfilled in normal case.\n // Do NOT use this to enforce a certain condition on any user input.\n\n function assert(condition, message) {\n /* istanbul ignore if */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }\n\n function isDecimalDigit(ch) {\n return (ch >= 48 && ch <= 57); // 0..9\n }\n\n function isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n }\n\n function isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n }\n\n\n // 7.2 White Space\n\n function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }\n\n // 7.3 Line Terminators\n\n function isLineTerminator(ch) {\n return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);\n }\n\n // 7.6 Identifier Names and Identifiers\n\n function isIdentifierStart(ch) {\n return (ch == 0x40) || (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch)));\n }\n\n function isIdentifierPart(ch) {\n return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)\n (ch >= 0x41 && ch <= 0x5A) || // A..Z\n (ch >= 0x61 && ch <= 0x7A) || // a..z\n (ch >= 0x30 && ch <= 0x39) || // 0..9\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n }\n\n // 7.6.1.2 Future Reserved Words\n\n function isFutureReservedWord(id) {\n switch (id) {\n case 'class':\n case 'enum':\n case 'export':\n case 'extends':\n case 'import':\n case 'super':\n return true;\n default:\n return false;\n }\n }\n\n function isStrictModeReservedWord(id) {\n switch (id) {\n case 'implements':\n case 'interface':\n case 'package':\n case 'private':\n case 'protected':\n case 'public':\n case 'static':\n case 'yield':\n case 'let':\n return true;\n default:\n return false;\n }\n }\n\n function isRestrictedWord(id) {\n return id === 'eval' || id === 'arguments';\n }\n\n // 7.6.1.1 Keywords\n\n function isKeyword(id) {\n if (strict && isStrictModeReservedWord(id)) {\n return true;\n }\n\n // 'const' is specialized as Keyword in V8.\n // 'yield' and 'let' are for compatiblity with SpiderMonkey and ES.next.\n // Some others are from future reserved words.\n\n switch (id.length) {\n case 2:\n return (id === 'if') || (id === 'in') || (id === 'do');\n case 3:\n return (id === 'var') || (id === 'for') || (id === 'new') ||\n (id === 'try') || (id === 'let');\n case 4:\n return (id === 'this') || (id === 'else') || (id === 'case') ||\n (id === 'void') || (id === 'with') || (id === 'enum');\n case 5:\n return (id === 'while') || (id === 'break') || (id === 'catch') ||\n (id === 'throw') || (id === 'const') || (id === 'yield') ||\n (id === 'class') || (id === 'super');\n case 6:\n return (id === 'return') || (id === 'typeof') || (id === 'delete') ||\n (id === 'switch') || (id === 'export') || (id === 'import');\n case 7:\n return (id === 'default') || (id === 'finally') || (id === 'extends');\n case 8:\n return (id === 'function') || (id === 'continue') || (id === 'debugger');\n case 10:\n return (id === 'instanceof');\n default:\n return false;\n }\n }\n\n // 7.4 Comments\n\n function addComment(type, value, start, end, loc) {\n var comment, attacher;\n\n assert(typeof start === 'number', 'Comment must have valid position');\n\n // Because the way the actual token is scanned, often the comments\n // (if any) are skipped twice during the lexical analysis.\n // Thus, we need to skip adding a comment if the comment array already\n // handled it.\n if (state.lastCommentStart >= start) {\n return;\n }\n state.lastCommentStart = start;\n\n comment = {\n type: type,\n value: value\n };\n if (extra.range) {\n comment.range = [start, end];\n }\n if (extra.loc) {\n comment.loc = loc;\n }\n extra.comments.push(comment);\n if (extra.attachComment) {\n extra.leadingComments.push(comment);\n extra.trailingComments.push(comment);\n }\n }\n\n function skipSingleLineComment(offset) {\n var start, loc, ch, comment;\n\n start = index - offset;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - offset\n }\n };\n\n while (index < length) {\n ch = source.charCodeAt(index);\n ++index;\n if (isLineTerminator(ch)) {\n if (extra.comments) {\n comment = source.slice(start + offset, index - 1);\n loc.end = {\n line: lineNumber,\n column: index - lineStart - 1\n };\n addComment('Line', comment, start, index - 1, loc);\n }\n if (ch === 13 && source.charCodeAt(index) === 10) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n return;\n }\n }\n\n if (extra.comments) {\n comment = source.slice(start + offset, index);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Line', comment, start, index, loc);\n }\n }\n\n function skipMultiLineComment() {\n var start, loc, ch, comment;\n\n if (extra.comments) {\n start = index - 2;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - 2\n }\n };\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (isLineTerminator(ch)) {\n if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n ++index;\n lineStart = index;\n if (index >= length) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else if (ch === 0x2A) {\n // Block comment ends with '*/'.\n if (source.charCodeAt(index + 1) === 0x2F) {\n ++index;\n ++index;\n if (extra.comments) {\n comment = source.slice(start + 2, index - 2);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Block', comment, start, index, loc);\n }\n return;\n }\n ++index;\n } else {\n ++index;\n }\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n function skipComment() {\n var ch, start;\n\n start = (index === 0);\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch)) {\n ++index;\n } else if (isLineTerminator(ch)) {\n ++index;\n if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n start = true;\n } else if (ch === 0x2F) { // U+002F is '/'\n ch = source.charCodeAt(index + 1);\n if (ch === 0x2F) {\n ++index;\n ++index;\n skipSingleLineComment(2);\n start = true;\n } else if (ch === 0x2A) { // U+002A is '*'\n ++index;\n ++index;\n skipMultiLineComment();\n } else {\n break;\n }\n } else if (start && ch === 0x2D) { // U+002D is '-'\n // U+003E is '>'\n if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {\n // '--\x3e' is a single-line comment\n index += 3;\n skipSingleLineComment(3);\n } else {\n break;\n }\n } else if (ch === 0x3C) { // U+003C is '<'\n if (source.slice(index + 1, index + 4) === '!--') {\n ++index; // `<`\n ++index; // `!`\n ++index; // `-`\n ++index; // `-`\n skipSingleLineComment(4);\n } else {\n break;\n }\n } else {\n break;\n }\n }\n }\n\n function scanHexEscape(prefix) {\n var i, len, ch, code = 0;\n\n len = (prefix === 'u') ? 4 : 2;\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n return '';\n }\n }\n return String.fromCharCode(code);\n }\n\n function getEscapedIdentifier() {\n var ch, id;\n\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (!isIdentifierPart(ch)) {\n break;\n }\n ++index;\n id += String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id += ch;\n }\n }\n\n return id;\n }\n\n function getIdentifier() {\n var start, ch;\n\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n }\n\n function scanIdentifier() {\n var start, id, type;\n\n start = index;\n\n // Backslash (U+005C) starts an escaped character.\n id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = Token.Identifier;\n } else if (isKeyword(id)) {\n type = Token.Keyword;\n } else if (id === 'null') {\n type = Token.NullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = Token.BooleanLiteral;\n } else {\n type = Token.Identifier;\n }\n\n return {\n type: type,\n value: id,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n\n // 7.7 Punctuators\n\n function scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n case 0x28: // ( open bracket\n case 0x29: // ) close bracket\n case 0x3B: // ; semicolon\n case 0x2C: // , comma\n case 0x7B: // { open curly brace\n case 0x7D: // } close curly brace\n case 0x5B: // [\n case 0x5D: // ]\n case 0x3A: // :\n case 0x3F: // ?\n case 0x7E: // ~\n ++index;\n if (extra.tokenize) {\n if (code === 0x28) {\n extra.openParenToken = extra.tokens.length;\n } else if (code === 0x7B) {\n extra.openCurlyToken = extra.tokens.length;\n }\n }\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (U+003D) marks an assignment or comparison operator.\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n case 0x2D: // -\n case 0x2F: // /\n case 0x3C: // <\n case 0x3E: // >\n case 0x5E: // ^\n case 0x7C: // |\n case 0x25: // %\n case 0x26: // &\n case 0x2A: // *\n index += 2;\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n case 0x21: // !\n case 0x3D: // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n return {\n type: Token.Punctuator,\n value: source.slice(start, index),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n }\n }\n\n // 4-character punctuator: >>>=\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: Token.Punctuator,\n value: ch4,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 3-character punctuators: === !== >>> <<= >>=\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: Token.Punctuator,\n value: ch3,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // Other 2-character punctuators: ++ -- << >> && ||\n ch2 = ch3.substr(0, 2);\n\n if ((ch1 === ch2[1] && ('+-<>&|'.indexOf(ch1) >= 0)) || ch2 === '=>') {\n index += 2;\n return {\n type: Token.Punctuator,\n value: ch2,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 1-character punctuators: < > = ! + - * % & | ^ /\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: Token.Punctuator,\n value: ch1,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n // 7.8.3 Numeric Literals\n\n function scanHexLiteral(start) {\n var number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt('0x' + number, 16),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function scanOctalLiteral(start) {\n var number = '0' + source[index++];\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function scanNumericLiteral() {\n var number, start, ch;\n\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),\n 'Numeric literal must start with a decimal digit or a decimal point');\n\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n }\n\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseFloat(number),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 7.8.4 String Literals\n\n function scanStringLiteral() {\n var str = '', quote, start, ch, code, unescaped, restore, octal = false, startLineNumber, startLineStart;\n startLineNumber = lineNumber;\n startLineStart = lineStart;\n\n quote = source[index];\n assert((quote === '\\'' || quote === '\"'),\n 'String literal must starts with a quote');\n\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n str += unescaped;\n } else {\n index = restore;\n str += ch;\n }\n break;\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch);\n\n // \\0 is not octal escape sequence\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]);\n\n // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n if ('0123'.indexOf(ch) >= 0 &&\n index < length &&\n isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.StringLiteral,\n value: str,\n octal: octal,\n startLineNumber: startLineNumber,\n startLineStart: startLineStart,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function testRegExp(pattern, flags) {\n var value;\n try {\n value = new RegExp(pattern, flags);\n } catch (e) {\n throwError({}, Messages.InvalidRegExp);\n }\n return value;\n }\n\n function scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n\n classMarker = false;\n terminated = false;\n while (index < length) {\n ch = source[index++];\n str += ch;\n if (ch === '\\\\') {\n ch = source[index++];\n // ECMA-262 7.8.5\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n\n // Exclude leading and trailing slash.\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n }\n\n function scanRegExpFlags() {\n var ch, str, flags, restore;\n\n str = '';\n flags = '';\n while (index < length) {\n ch = source[index];\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n if (ch === '\\\\' && index < length) {\n ch = source[index];\n if (ch === 'u') {\n ++index;\n restore = index;\n ch = scanHexEscape('u');\n if (ch) {\n flags += ch;\n for (str += '\\\\u'; restore < index; ++restore) {\n str += source[restore];\n }\n } else {\n index = restore;\n flags += 'u';\n str += '\\\\u';\n }\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n } else {\n str += '\\\\';\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n return {\n value: flags,\n literal: str\n };\n }\n\n function scanRegExp() {\n var start, body, flags, pattern, value;\n\n lookahead = null;\n skipComment();\n start = index;\n\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n\n if (extra.tokenize) {\n return {\n type: Token.RegularExpression,\n value: value,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n return {\n literal: body.literal + flags.literal,\n value: value,\n start: start,\n end: index\n };\n }\n\n function collectRegex() {\n var pos, loc, regex, token;\n\n skipComment();\n\n pos = index;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n regex = scanRegExp();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n /* istanbul ignore next */\n if (!extra.tokenize) {\n // Pop the previous token, which is likely '/' or '/='\n if (extra.tokens.length > 0) {\n token = extra.tokens[extra.tokens.length - 1];\n if (token.range[0] === pos && token.type === 'Punctuator') {\n if (token.value === '/' || token.value === '/=') {\n extra.tokens.pop();\n }\n }\n }\n\n extra.tokens.push({\n type: 'RegularExpression',\n value: regex.literal,\n range: [pos, index],\n loc: loc\n });\n }\n\n return regex;\n }\n\n function isIdentifierName(token) {\n return token.type === Token.Identifier ||\n token.type === Token.Keyword ||\n token.type === Token.BooleanLiteral ||\n token.type === Token.NullLiteral;\n }\n\n function advanceSlash() {\n var prevToken,\n checkToken;\n // Using the following algorithm:\n // https://github.com/mozilla/sweet.js/wiki/design\n prevToken = extra.tokens[extra.tokens.length - 1];\n if (!prevToken) {\n // Nothing before that: it cannot be a division.\n return collectRegex();\n }\n if (prevToken.type === 'Punctuator') {\n if (prevToken.value === ']') {\n return scanPunctuator();\n }\n if (prevToken.value === ')') {\n checkToken = extra.tokens[extra.openParenToken - 1];\n if (checkToken &&\n checkToken.type === 'Keyword' &&\n (checkToken.value === 'if' ||\n checkToken.value === 'while' ||\n checkToken.value === 'for' ||\n checkToken.value === 'with')) {\n return collectRegex();\n }\n return scanPunctuator();\n }\n if (prevToken.value === '}') {\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n if (extra.tokens[extra.openCurlyToken - 3] &&\n extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {\n // Anonymous function.\n checkToken = extra.tokens[extra.openCurlyToken - 4];\n if (!checkToken) {\n return scanPunctuator();\n }\n } else if (extra.tokens[extra.openCurlyToken - 4] &&\n extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {\n // Named function.\n checkToken = extra.tokens[extra.openCurlyToken - 5];\n if (!checkToken) {\n return collectRegex();\n }\n } else {\n return scanPunctuator();\n }\n // checkToken determines whether the function is\n // a declaration or an expression.\n if (FnExprTokens.indexOf(checkToken.value) >= 0) {\n // It is an expression.\n return scanPunctuator();\n }\n // It is a declaration.\n return collectRegex();\n }\n return collectRegex();\n }\n if (prevToken.type === 'Keyword') {\n return collectRegex();\n }\n return scanPunctuator();\n }\n\n function advance() {\n var ch;\n\n skipComment();\n\n if (index >= length) {\n return {\n type: Token.EOF,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: index,\n end: index\n };\n }\n\n ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Very common: ( and ) and ;\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (U+0027) or double quote (U+0022).\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n }\n\n\n // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n // Slash (/) U+002F can also start a regex.\n if (extra.tokenize && ch === 0x2F) {\n return advanceSlash();\n }\n\n return scanPunctuator();\n }\n\n function collectToken() {\n var loc, token, range, value;\n\n skipComment();\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n token = advance();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n if (token.type !== Token.EOF) {\n value = source.slice(token.start, token.end);\n extra.tokens.push({\n type: TokenName[token.type],\n value: value,\n range: [token.start, token.end],\n loc: loc\n });\n }\n\n return token;\n }\n\n function lex() {\n var token;\n\n token = lookahead;\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n return token;\n }\n\n function peek() {\n var pos, line, start;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n index = pos;\n lineNumber = line;\n lineStart = start;\n }\n\n function Position(line, column) {\n this.line = line;\n this.column = column;\n }\n\n function SourceLocation(startLine, startColumn, line, column) {\n this.start = new Position(startLine, startColumn);\n this.end = new Position(line, column);\n }\n\n SyntaxTreeDelegate = {\n\n name: 'SyntaxTree',\n\n processComment: function (node) {\n var lastChild, trailingComments;\n\n if (node.type === Syntax.Program) {\n if (node.body.length > 0) {\n return;\n }\n }\n\n if (extra.trailingComments.length > 0) {\n if (extra.trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.trailingComments;\n extra.trailingComments = [];\n } else {\n extra.trailingComments.length = 0;\n }\n } else {\n if (extra.bottomRightStack.length > 0 &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n delete extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n }\n }\n\n // Eating the stack.\n while (extra.bottomRightStack.length > 0 && extra.bottomRightStack[extra.bottomRightStack.length - 1].range[0] >= node.range[0]) {\n lastChild = extra.bottomRightStack.pop();\n }\n\n if (lastChild) {\n if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = lastChild.leadingComments;\n delete lastChild.leadingComments;\n }\n } else if (extra.leadingComments.length > 0 && extra.leadingComments[extra.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = extra.leadingComments;\n extra.leadingComments = [];\n }\n\n\n if (trailingComments) {\n node.trailingComments = trailingComments;\n }\n\n extra.bottomRightStack.push(node);\n },\n\n markEnd: function (node, startToken) {\n if (extra.range) {\n node.range = [startToken.start, index];\n }\n if (extra.loc) {\n node.loc = new SourceLocation(\n startToken.startLineNumber === undefined ? startToken.lineNumber : startToken.startLineNumber,\n startToken.start - (startToken.startLineStart === undefined ? startToken.lineStart : startToken.startLineStart),\n lineNumber,\n index - lineStart\n );\n this.postProcess(node);\n }\n\n if (extra.attachComment) {\n this.processComment(node);\n }\n return node;\n },\n\n postProcess: function (node) {\n if (extra.source) {\n node.loc.source = extra.source;\n }\n return node;\n },\n\n createArrayExpression: function (elements) {\n return {\n type: Syntax.ArrayExpression,\n elements: elements\n };\n },\n\n createAssignmentExpression: function (operator, left, right) {\n return {\n type: Syntax.AssignmentExpression,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBinaryExpression: function (operator, left, right) {\n var type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression :\n Syntax.BinaryExpression;\n return {\n type: type,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBlockStatement: function (body) {\n return {\n type: Syntax.BlockStatement,\n body: body\n };\n },\n\n createBreakStatement: function (label) {\n return {\n type: Syntax.BreakStatement,\n label: label\n };\n },\n\n createCallExpression: function (callee, args) {\n return {\n type: Syntax.CallExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createCatchClause: function (param, body) {\n return {\n type: Syntax.CatchClause,\n param: param,\n body: body\n };\n },\n\n createConditionalExpression: function (test, consequent, alternate) {\n return {\n type: Syntax.ConditionalExpression,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createContinueStatement: function (label) {\n return {\n type: Syntax.ContinueStatement,\n label: label\n };\n },\n\n createDebuggerStatement: function () {\n return {\n type: Syntax.DebuggerStatement\n };\n },\n\n createDoWhileStatement: function (body, test) {\n return {\n type: Syntax.DoWhileStatement,\n body: body,\n test: test\n };\n },\n\n createEmptyStatement: function () {\n return {\n type: Syntax.EmptyStatement\n };\n },\n\n createExpressionStatement: function (expression) {\n return {\n type: Syntax.ExpressionStatement,\n expression: expression\n };\n },\n\n createForStatement: function (init, test, update, body) {\n return {\n type: Syntax.ForStatement,\n init: init,\n test: test,\n update: update,\n body: body\n };\n },\n\n createForInStatement: function (left, right, body) {\n return {\n type: Syntax.ForInStatement,\n left: left,\n right: right,\n body: body,\n each: false\n };\n },\n\n createFunctionDeclaration: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionDeclaration,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createFunctionExpression: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionExpression,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createIdentifier: function (name) {\n return {\n type: Syntax.Identifier,\n name: name\n };\n },\n\n createIfStatement: function (test, consequent, alternate) {\n return {\n type: Syntax.IfStatement,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createLabeledStatement: function (label, body) {\n return {\n type: Syntax.LabeledStatement,\n label: label,\n body: body\n };\n },\n\n createLiteral: function (token) {\n return {\n type: Syntax.Literal,\n value: token.value,\n raw: source.slice(token.start, token.end)\n };\n },\n\n createMemberExpression: function (accessor, object, property) {\n return {\n type: Syntax.MemberExpression,\n computed: accessor === '[',\n object: object,\n property: property\n };\n },\n\n createNewExpression: function (callee, args) {\n return {\n type: Syntax.NewExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createObjectExpression: function (properties) {\n return {\n type: Syntax.ObjectExpression,\n properties: properties\n };\n },\n\n createPostfixExpression: function (operator, argument) {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: false\n };\n },\n\n createProgram: function (body) {\n return {\n type: Syntax.Program,\n body: body\n };\n },\n\n createProperty: function (kind, key, value) {\n return {\n type: Syntax.Property,\n key: key,\n value: value,\n kind: kind\n };\n },\n\n createReturnStatement: function (argument) {\n return {\n type: Syntax.ReturnStatement,\n argument: argument\n };\n },\n\n createSequenceExpression: function (expressions) {\n return {\n type: Syntax.SequenceExpression,\n expressions: expressions\n };\n },\n\n createSwitchCase: function (test, consequent) {\n return {\n type: Syntax.SwitchCase,\n test: test,\n consequent: consequent\n };\n },\n\n createSwitchStatement: function (discriminant, cases) {\n return {\n type: Syntax.SwitchStatement,\n discriminant: discriminant,\n cases: cases\n };\n },\n\n createThisExpression: function () {\n return {\n type: Syntax.ThisExpression\n };\n },\n\n createThrowStatement: function (argument) {\n return {\n type: Syntax.ThrowStatement,\n argument: argument\n };\n },\n\n createTryStatement: function (block, guardedHandlers, handlers, finalizer) {\n return {\n type: Syntax.TryStatement,\n block: block,\n guardedHandlers: guardedHandlers,\n handlers: handlers,\n finalizer: finalizer\n };\n },\n\n createUnaryExpression: function (operator, argument) {\n if (operator === '++' || operator === '--') {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n }\n return {\n type: Syntax.UnaryExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n },\n\n createVariableDeclaration: function (declarations, kind) {\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n },\n\n createVariableDeclarator: function (id, init) {\n return {\n type: Syntax.VariableDeclarator,\n id: id,\n init: init\n };\n },\n\n createWhileStatement: function (test, body) {\n return {\n type: Syntax.WhileStatement,\n test: test,\n body: body\n };\n },\n\n createWithStatement: function (object, body) {\n return {\n type: Syntax.WithStatement,\n object: object,\n body: body\n };\n }\n };\n\n // Return true if there is a line terminator before the next token.\n\n function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }\n\n // Throw an exception\n\n function throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(\n /%(\\d)/g,\n function (whole, index) {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n }\n );\n\n if (typeof token.lineNumber === 'number') {\n error = new Error('Line ' + token.lineNumber + ': ' + msg);\n error.index = token.start;\n error.lineNumber = token.lineNumber;\n error.column = token.start - lineStart + 1;\n } else {\n error = new Error('Line ' + lineNumber + ': ' + msg);\n error.index = index;\n error.lineNumber = lineNumber;\n error.column = index - lineStart + 1;\n }\n\n error.description = msg;\n throw error;\n }\n\n function throwErrorTolerant() {\n try {\n throwError.apply(null, arguments);\n } catch (e) {\n if (extra.errors) {\n extra.errors.push(e);\n } else {\n throw e;\n }\n }\n }\n\n\n // Throw an exception because of the token.\n\n function throwUnexpected(token) {\n if (token.type === Token.EOF) {\n throwError(token, Messages.UnexpectedEOS);\n }\n\n if (token.type === Token.NumericLiteral) {\n throwError(token, Messages.UnexpectedNumber);\n }\n\n if (token.type === Token.StringLiteral) {\n throwError(token, Messages.UnexpectedString);\n }\n\n if (token.type === Token.Identifier) {\n throwError(token, Messages.UnexpectedIdentifier);\n }\n\n if (token.type === Token.Keyword) {\n if (isFutureReservedWord(token.value)) {\n throwError(token, Messages.UnexpectedReserved);\n } else if (strict && isStrictModeReservedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictReservedWord);\n return;\n }\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // BooleanLiteral, NullLiteral, or Punctuator.\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // Expect the next token to match the specified punctuator.\n // If not, an exception will be thrown.\n\n function expect(value) {\n var token = lex();\n if (token.type !== Token.Punctuator || token.value !== value) {\n throwUnexpected(token);\n }\n }\n\n // Expect the next token to match the specified keyword.\n // If not, an exception will be thrown.\n\n function expectKeyword(keyword) {\n var token = lex();\n if (token.type !== Token.Keyword || token.value !== keyword) {\n throwUnexpected(token);\n }\n }\n\n // Return true if the next token matches the specified punctuator.\n\n function match(value) {\n return lookahead.type === Token.Punctuator && lookahead.value === value;\n }\n\n // Return true if the next token matches the specified keyword\n\n function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }\n\n // Return true if the next token is an assignment operator\n\n function matchAssign() {\n var op;\n\n if (lookahead.type !== Token.Punctuator) {\n return false;\n }\n op = lookahead.value;\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }\n\n function consumeSemicolon() {\n var line;\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B || match(';')) {\n lex();\n return;\n }\n\n line = lineNumber;\n skipComment();\n if (lineNumber !== line) {\n return;\n }\n\n if (lookahead.type !== Token.EOF && !match('}')) {\n throwUnexpected(lookahead);\n }\n }\n\n // Return true if provided expression is LeftHandSideExpression\n\n function isLeftHandSide(expr) {\n return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression;\n }\n\n // 11.1.4 Array Initialiser\n\n function parseArrayInitialiser() {\n var elements = [], startToken;\n\n startToken = lookahead;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseAssignmentExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n\n return delegate.markEnd(delegate.createArrayExpression(elements), startToken);\n }\n\n // 11.1.5 Object Initialiser\n\n function parsePropertyFunction(param, first) {\n var previousStrict, body, startToken;\n\n previousStrict = strict;\n startToken = lookahead;\n body = parseFunctionSourceElements();\n if (first && strict && isRestrictedWord(param[0].name)) {\n throwErrorTolerant(first, Messages.StrictParamName);\n }\n strict = previousStrict;\n return delegate.markEnd(delegate.createFunctionExpression(null, param, [], body), startToken);\n }\n\n function parseObjectPropertyKey() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {\n if (strict && token.octal) {\n throwErrorTolerant(token, Messages.StrictOctalLiteral);\n }\n return delegate.markEnd(delegate.createLiteral(token), startToken);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseObjectProperty() {\n var token, key, id, value, param, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n if (token.type === Token.Identifier) {\n\n id = parseObjectPropertyKey();\n\n // Property Assignment: Getter and Setter.\n\n if (token.value === 'get' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n expect(')');\n value = parsePropertyFunction([]);\n return delegate.markEnd(delegate.createProperty('get', key, value), startToken);\n }\n if (token.value === 'set' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n token = lookahead;\n if (token.type !== Token.Identifier) {\n expect(')');\n throwErrorTolerant(token, Messages.UnexpectedToken, token.value);\n value = parsePropertyFunction([]);\n } else {\n param = [ parseVariableIdentifier() ];\n expect(')');\n value = parsePropertyFunction(param, token);\n }\n return delegate.markEnd(delegate.createProperty('set', key, value), startToken);\n }\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', id, value), startToken);\n }\n if (token.type === Token.EOF || token.type === Token.Punctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', key, value), startToken);\n }\n }\n\n function parseObjectInitialiser() {\n var properties = [], property, name, key, kind, map = {}, toString = String, startToken;\n\n startToken = lookahead;\n\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === Syntax.Identifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set;\n\n key = '$' + name;\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n if (map[key] === PropertyKind.Data) {\n if (strict && kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.StrictDuplicateProperty);\n } else if (kind !== PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n }\n } else {\n if (kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n } else if (map[key] & kind) {\n throwErrorTolerant({}, Messages.AccessorGetSet);\n }\n }\n map[key] |= kind;\n } else {\n map[key] = kind;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n\n return delegate.markEnd(delegate.createObjectExpression(properties), startToken);\n }\n\n // 11.1.6 The Grouping Operator\n\n function parseGroupExpression() {\n var expr;\n\n expect('(');\n\n expr = parseExpression();\n\n expect(')');\n\n return expr;\n }\n\n\n // 11.1 Primary Expressions\n\n function parsePrimaryExpression() {\n var type, token, expr, startToken;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n startToken = lookahead;\n\n if (type === Token.Identifier) {\n expr = delegate.createIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n if (strict && lookahead.octal) {\n throwErrorTolerant(lookahead, Messages.StrictOctalLiteral);\n }\n expr = delegate.createLiteral(lex());\n } else if (type === Token.Keyword) {\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n expr = delegate.createThisExpression();\n } else {\n throwUnexpected(lex());\n }\n } else if (type === Token.BooleanLiteral) {\n token = lex();\n token.value = (token.value === 'true');\n expr = delegate.createLiteral(token);\n } else if (type === Token.NullLiteral) {\n token = lex();\n token.value = null;\n expr = delegate.createLiteral(token);\n } else if (match('/') || match('/=')) {\n if (typeof extra.tokens !== 'undefined') {\n expr = delegate.createLiteral(collectRegex());\n } else {\n expr = delegate.createLiteral(scanRegExp());\n }\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return delegate.markEnd(expr, startToken);\n }\n\n // 11.2 Left-Hand-Side Expressions\n\n function parseArguments() {\n var args = [];\n\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseAssignmentExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return args;\n }\n\n function parseNonComputedProperty() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseNonComputedMember() {\n expect('.');\n\n return parseNonComputedProperty();\n }\n\n function parseComputedMember() {\n var expr;\n\n expect('[');\n\n expr = parseExpression();\n\n expect(']');\n\n return expr;\n }\n\n function parseNewExpression() {\n var callee, args, startToken;\n\n startToken = lookahead;\n expectKeyword('new');\n callee = parseLeftHandSideExpression();\n args = match('(') ? parseArguments() : [];\n\n return delegate.markEnd(delegate.createNewExpression(callee, args), startToken);\n }\n\n function parseLeftHandSideExpressionAllowCall() {\n var previousAllowIn, expr, args, property, startToken;\n\n startToken = lookahead;\n\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n state.allowIn = previousAllowIn;\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = delegate.createCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n break;\n }\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n function parseLeftHandSideExpression() {\n var previousAllowIn, expr, property, startToken;\n\n startToken = lookahead;\n\n previousAllowIn = state.allowIn;\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n state.allowIn = previousAllowIn;\n\n while (match('.') || match('[')) {\n if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n }\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 11.3 Postfix Expressions\n\n function parsePostfixExpression() {\n var expr, token, startToken = lookahead;\n\n expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === Token.Punctuator) {\n if ((match('++') || match('--')) && !peekLineTerminator()) {\n // 11.3.1, 11.3.2\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPostfix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n token = lex();\n expr = delegate.markEnd(delegate.createPostfixExpression(token.value, expr), startToken);\n }\n }\n\n return expr;\n }\n\n // 11.4 Unary Operators\n\n function parseUnaryExpression() {\n var token, expr, startToken;\n\n if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n // 11.4.4, 11.4.5\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPrefix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {\n throwErrorTolerant({}, Messages.StrictDelete);\n }\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n }\n\n function binaryPrecedence(token, allowIn) {\n var prec = 0;\n\n if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n prec = 7;\n break;\n\n case 'in':\n prec = allowIn ? 7 : 0;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n\n default:\n break;\n }\n\n return prec;\n }\n\n // 11.5 Multiplicative Operators\n // 11.6 Additive Operators\n // 11.7 Bitwise Shift Operators\n // 11.8 Relational Operators\n // 11.9 Equality Operators\n // 11.10 Binary Bitwise Operators\n // 11.11 Binary Logical Operators\n\n function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers[markers.length - 1];\n delegate.markEnd(expr, marker);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n delegate.markEnd(expr, marker);\n }\n\n return expr;\n }\n\n\n // 11.12 Conditional Operator\n\n function parseConditionalExpression() {\n var expr, previousAllowIn, consequent, alternate, startToken;\n\n startToken = lookahead;\n\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n consequent = parseAssignmentExpression();\n state.allowIn = previousAllowIn;\n expect(':');\n alternate = parseAssignmentExpression();\n\n expr = delegate.createConditionalExpression(expr, consequent, alternate);\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 11.13 Assignment Operators\n\n function parseAssignmentExpression() {\n var token, left, right, node, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n node = left = parseConditionalExpression();\n\n if (matchAssign()) {\n // LeftHandSideExpression\n if (!isLeftHandSide(left)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n // 11.13.1\n if (strict && left.type === Syntax.Identifier && isRestrictedWord(left.name)) {\n throwErrorTolerant(token, Messages.StrictLHSAssignment);\n }\n\n token = lex();\n right = parseAssignmentExpression();\n node = delegate.markEnd(delegate.createAssignmentExpression(token.value, left, right), startToken);\n }\n\n return node;\n }\n\n // 11.14 Comma Operator\n\n function parseExpression() {\n var expr, startToken = lookahead;\n\n expr = parseAssignmentExpression();\n\n if (match(',')) {\n expr = delegate.createSequenceExpression([ expr ]);\n\n while (index < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expr.expressions.push(parseAssignmentExpression());\n }\n\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 12.1 Block\n\n function parseStatementList() {\n var list = [],\n statement;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n statement = parseSourceElement();\n if (typeof statement === 'undefined') {\n break;\n }\n list.push(statement);\n }\n\n return list;\n }\n\n function parseBlock() {\n var block, startToken;\n\n startToken = lookahead;\n expect('{');\n\n block = parseStatementList();\n\n expect('}');\n\n return delegate.markEnd(delegate.createBlockStatement(block), startToken);\n }\n\n // 12.2 Variable Statement\n\n function parseVariableIdentifier() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (token.type !== Token.Identifier) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseVariableDeclaration(kind) {\n var init = null, id, startToken;\n\n startToken = lookahead;\n id = parseVariableIdentifier();\n\n // 12.2.1\n if (strict && isRestrictedWord(id.name)) {\n throwErrorTolerant({}, Messages.StrictVarName);\n }\n\n if (kind === 'const') {\n expect('=');\n init = parseAssignmentExpression();\n } else if (match('=')) {\n lex();\n init = parseAssignmentExpression();\n }\n\n return delegate.markEnd(delegate.createVariableDeclarator(id, init), startToken);\n }\n\n function parseVariableDeclarationList(kind) {\n var list = [];\n\n do {\n list.push(parseVariableDeclaration(kind));\n if (!match(',')) {\n break;\n }\n lex();\n } while (index < length);\n\n return list;\n }\n\n function parseVariableStatement() {\n var declarations;\n\n expectKeyword('var');\n\n declarations = parseVariableDeclarationList();\n\n consumeSemicolon();\n\n return delegate.createVariableDeclaration(declarations, 'var');\n }\n\n // kind may be `const` or `let`\n // Both are experimental and not in the specification yet.\n // see http://wiki.ecmascript.org/doku.php?id=harmony:const\n // and http://wiki.ecmascript.org/doku.php?id=harmony:let\n function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }\n\n // 12.3 Empty Statement\n\n function parseEmptyStatement() {\n expect(';');\n return delegate.createEmptyStatement();\n }\n\n // 12.4 Expression Statement\n\n function parseExpressionStatement() {\n var expr = parseExpression();\n consumeSemicolon();\n return delegate.createExpressionStatement(expr);\n }\n\n // 12.5 If statement\n\n function parseIfStatement() {\n var test, consequent, alternate;\n\n expectKeyword('if');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n consequent = parseStatement();\n\n if (matchKeyword('else')) {\n lex();\n alternate = parseStatement();\n } else {\n alternate = null;\n }\n\n return delegate.createIfStatement(test, consequent, alternate);\n }\n\n // 12.6 Iteration Statements\n\n function parseDoWhileStatement() {\n var body, test, oldInIteration;\n\n expectKeyword('do');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n if (match(';')) {\n lex();\n }\n\n return delegate.createDoWhileStatement(body, test);\n }\n\n function parseWhileStatement() {\n var test, body, oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return delegate.createWhileStatement(test, body);\n }\n\n function parseForVariableDeclaration() {\n var token, declarations, startToken;\n\n startToken = lookahead;\n token = lex();\n declarations = parseVariableDeclarationList();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, token.value), startToken);\n }\n\n function parseForStatement() {\n var init, test, update, left, right, body, oldInIteration;\n\n init = test = update = null;\n\n expectKeyword('for');\n\n expect('(');\n\n if (match(';')) {\n lex();\n } else {\n if (matchKeyword('var') || matchKeyword('let')) {\n state.allowIn = false;\n init = parseForVariableDeclaration();\n state.allowIn = true;\n\n if (init.declarations.length === 1 && matchKeyword('in')) {\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n } else {\n state.allowIn = false;\n init = parseExpression();\n state.allowIn = true;\n\n if (matchKeyword('in')) {\n // LeftHandSideExpression\n if (!isLeftHandSide(init)) {\n throwErrorTolerant({}, Messages.InvalidLHSInForIn);\n }\n\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n }\n\n if (typeof left === 'undefined') {\n expect(';');\n }\n }\n\n if (typeof left === 'undefined') {\n\n if (!match(';')) {\n test = parseExpression();\n }\n expect(';');\n\n if (!match(')')) {\n update = parseExpression();\n }\n }\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return (typeof left === 'undefined') ?\n delegate.createForStatement(init, test, update, body) :\n delegate.createForInStatement(left, right, body);\n }\n\n // 12.7 The continue statement\n\n function parseContinueStatement() {\n var label = null, key;\n\n expectKeyword('continue');\n\n // Optimize the most common form: 'continue;'.\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(label);\n }\n\n // 12.8 The break statement\n\n function parseBreakStatement() {\n var label = null, key;\n\n expectKeyword('break');\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(label);\n }\n\n // 12.9 The return statement\n\n function parseReturnStatement() {\n var argument = null;\n\n expectKeyword('return');\n\n if (!state.inFunctionBody) {\n throwErrorTolerant({}, Messages.IllegalReturn);\n }\n\n // 'return' followed by a space and an identifier is very common.\n if (source.charCodeAt(index) === 0x20) {\n if (isIdentifierStart(source.charCodeAt(index + 1))) {\n argument = parseExpression();\n consumeSemicolon();\n return delegate.createReturnStatement(argument);\n }\n }\n\n if (peekLineTerminator()) {\n return delegate.createReturnStatement(null);\n }\n\n if (!match(';')) {\n if (!match('}') && lookahead.type !== Token.EOF) {\n argument = parseExpression();\n }\n }\n\n consumeSemicolon();\n\n return delegate.createReturnStatement(argument);\n }\n\n // 12.10 The with statement\n\n function parseWithStatement() {\n var object, body;\n\n if (strict) {\n // TODO(ikarienator): Should we update the test cases instead?\n skipComment();\n throwErrorTolerant({}, Messages.StrictModeWith);\n }\n\n expectKeyword('with');\n\n expect('(');\n\n object = parseExpression();\n\n expect(')');\n\n body = parseStatement();\n\n return delegate.createWithStatement(object, body);\n }\n\n // 12.10 The swith statement\n\n function parseSwitchCase() {\n var test, consequent = [], statement, startToken;\n\n startToken = lookahead;\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n statement = parseStatement();\n consequent.push(statement);\n }\n\n return delegate.markEnd(delegate.createSwitchCase(test, consequent), startToken);\n }\n\n function parseSwitchStatement() {\n var discriminant, cases, clause, oldInSwitch, defaultFound;\n\n expectKeyword('switch');\n\n expect('(');\n\n discriminant = parseExpression();\n\n expect(')');\n\n expect('{');\n\n cases = [];\n\n if (match('}')) {\n lex();\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n oldInSwitch = state.inSwitch;\n state.inSwitch = true;\n defaultFound = false;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n clause = parseSwitchCase();\n if (clause.test === null) {\n if (defaultFound) {\n throwError({}, Messages.MultipleDefaultsInSwitch);\n }\n defaultFound = true;\n }\n cases.push(clause);\n }\n\n state.inSwitch = oldInSwitch;\n\n expect('}');\n\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n // 12.13 The throw statement\n\n function parseThrowStatement() {\n var argument;\n\n expectKeyword('throw');\n\n if (peekLineTerminator()) {\n throwError({}, Messages.NewlineAfterThrow);\n }\n\n argument = parseExpression();\n\n consumeSemicolon();\n\n return delegate.createThrowStatement(argument);\n }\n\n // 12.14 The try statement\n\n function parseCatchClause() {\n var param, body, startToken;\n\n startToken = lookahead;\n expectKeyword('catch');\n\n expect('(');\n if (match(')')) {\n throwUnexpected(lookahead);\n }\n\n param = parseVariableIdentifier();\n // 12.14.1\n if (strict && isRestrictedWord(param.name)) {\n throwErrorTolerant({}, Messages.StrictCatchVariable);\n }\n\n expect(')');\n body = parseBlock();\n return delegate.markEnd(delegate.createCatchClause(param, body), startToken);\n }\n\n function parseTryStatement() {\n var block, handlers = [], finalizer = null;\n\n expectKeyword('try');\n\n block = parseBlock();\n\n if (matchKeyword('catch')) {\n handlers.push(parseCatchClause());\n }\n\n if (matchKeyword('finally')) {\n lex();\n finalizer = parseBlock();\n }\n\n if (handlers.length === 0 && !finalizer) {\n throwError({}, Messages.NoCatchOrFinally);\n }\n\n return delegate.createTryStatement(block, [], handlers, finalizer);\n }\n\n // 12.15 The debugger statement\n\n function parseDebuggerStatement() {\n expectKeyword('debugger');\n\n consumeSemicolon();\n\n return delegate.createDebuggerStatement();\n }\n\n // 12 Statements\n\n function parseStatement() {\n var type = lookahead.type,\n expr,\n labeledBody,\n key,\n startToken;\n\n if (type === Token.EOF) {\n throwUnexpected(lookahead);\n }\n\n if (type === Token.Punctuator && lookahead.value === '{') {\n return parseBlock();\n }\n\n startToken = lookahead;\n\n if (type === Token.Punctuator) {\n switch (lookahead.value) {\n case ';':\n return delegate.markEnd(parseEmptyStatement(), startToken);\n case '(':\n return delegate.markEnd(parseExpressionStatement(), startToken);\n default:\n break;\n }\n }\n\n if (type === Token.Keyword) {\n switch (lookahead.value) {\n case 'break':\n return delegate.markEnd(parseBreakStatement(), startToken);\n case 'continue':\n return delegate.markEnd(parseContinueStatement(), startToken);\n case 'debugger':\n return delegate.markEnd(parseDebuggerStatement(), startToken);\n case 'do':\n return delegate.markEnd(parseDoWhileStatement(), startToken);\n case 'for':\n return delegate.markEnd(parseForStatement(), startToken);\n case 'function':\n return delegate.markEnd(parseFunctionDeclaration(), startToken);\n case 'if':\n return delegate.markEnd(parseIfStatement(), startToken);\n case 'return':\n return delegate.markEnd(parseReturnStatement(), startToken);\n case 'switch':\n return delegate.markEnd(parseSwitchStatement(), startToken);\n case 'throw':\n return delegate.markEnd(parseThrowStatement(), startToken);\n case 'try':\n return delegate.markEnd(parseTryStatement(), startToken);\n case 'var':\n return delegate.markEnd(parseVariableStatement(), startToken);\n case 'while':\n return delegate.markEnd(parseWhileStatement(), startToken);\n case 'with':\n return delegate.markEnd(parseWithStatement(), startToken);\n default:\n break;\n }\n }\n\n expr = parseExpression();\n\n // 12.12 Labelled Statements\n if ((expr.type === Syntax.Identifier) && match(':')) {\n lex();\n\n key = '$' + expr.name;\n if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.Redeclaration, 'Label', expr.name);\n }\n\n state.labelSet[key] = true;\n labeledBody = parseStatement();\n delete state.labelSet[key];\n return delegate.markEnd(delegate.createLabeledStatement(expr, labeledBody), startToken);\n }\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createExpressionStatement(expr), startToken);\n }\n\n // 13 Function Definition\n\n function parseFunctionSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted,\n oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, startToken;\n\n startToken = lookahead;\n expect('{');\n\n while (index < length) {\n if (lookahead.type !== Token.StringLiteral) {\n break;\n }\n token = lookahead;\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n oldLabelSet = state.labelSet;\n oldInIteration = state.inIteration;\n oldInSwitch = state.inSwitch;\n oldInFunctionBody = state.inFunctionBody;\n\n state.labelSet = {};\n state.inIteration = false;\n state.inSwitch = false;\n state.inFunctionBody = true;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n\n expect('}');\n\n state.labelSet = oldLabelSet;\n state.inIteration = oldInIteration;\n state.inSwitch = oldInSwitch;\n state.inFunctionBody = oldInFunctionBody;\n\n return delegate.markEnd(delegate.createBlockStatement(sourceElements), startToken);\n }\n\n function parseParams(firstRestricted) {\n var param, params = [], token, stricted, paramSet, key, message;\n expect('(');\n\n if (!match(')')) {\n paramSet = {};\n while (index < length) {\n token = lookahead;\n param = parseVariableIdentifier();\n key = '$' + token.value;\n if (strict) {\n if (isRestrictedWord(token.value)) {\n stricted = token;\n message = Messages.StrictParamName;\n }\n if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n stricted = token;\n message = Messages.StrictParamDupe;\n }\n } else if (!firstRestricted) {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictParamName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n } else if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n firstRestricted = token;\n message = Messages.StrictParamDupe;\n }\n }\n params.push(param);\n paramSet[key] = true;\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return {\n params: params,\n stricted: stricted,\n firstRestricted: firstRestricted,\n message: message\n };\n }\n\n function parseFunctionDeclaration() {\n var id, params = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, startToken;\n\n startToken = lookahead;\n\n expectKeyword('function');\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionDeclaration(id, params, [], body), startToken);\n }\n\n function parseFunctionExpression() {\n var token, id = null, stricted, firstRestricted, message, tmp, params = [], body, previousStrict, startToken;\n\n startToken = lookahead;\n expectKeyword('function');\n\n if (!match('(')) {\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionExpression(id, params, [], body), startToken);\n }\n\n // 14 Program\n\n function parseSourceElement() {\n if (lookahead.type === Token.Keyword) {\n switch (lookahead.value) {\n case 'const':\n case 'let':\n return parseConstLetDeclaration(lookahead.value);\n case 'function':\n return parseFunctionDeclaration();\n default:\n return parseStatement();\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n return parseStatement();\n }\n }\n\n function parseSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted;\n\n while (index < length) {\n token = lookahead;\n if (token.type !== Token.StringLiteral) {\n break;\n }\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n while (index < length) {\n sourceElement = parseSourceElement();\n /* istanbul ignore if */\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n return sourceElements;\n }\n\n function parseProgram() {\n var body, startToken;\n\n skipComment();\n peek();\n startToken = lookahead;\n strict = false;\n\n body = parseSourceElements();\n return delegate.markEnd(delegate.createProgram(body), startToken);\n }\n\n function filterTokenLocation() {\n var i, entry, token, tokens = [];\n\n for (i = 0; i < extra.tokens.length; ++i) {\n entry = extra.tokens[i];\n token = {\n type: entry.type,\n value: entry.value\n };\n if (extra.range) {\n token.range = entry.range;\n }\n if (extra.loc) {\n token.loc = entry.loc;\n }\n tokens.push(token);\n }\n\n extra.tokens = tokens;\n }\n\n function tokenize(code, options) {\n var toString,\n token,\n tokens;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n\n // Options matching.\n options = options || {};\n\n // Of course we collect tokens here.\n options.tokens = true;\n extra.tokens = [];\n extra.tokenize = true;\n // The following two fields are necessary to compute the Regex tokens.\n extra.openParenToken = -1;\n extra.openCurlyToken = -1;\n\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n\n try {\n peek();\n if (lookahead.type === Token.EOF) {\n return extra.tokens;\n }\n\n token = lex();\n while (lookahead.type !== Token.EOF) {\n try {\n token = lex();\n } catch (lexError) {\n token = lookahead;\n if (extra.errors) {\n extra.errors.push(lexError);\n // We have to break on the first error\n // to avoid infinite loops.\n break;\n } else {\n throw lexError;\n }\n }\n }\n\n filterTokenLocation();\n tokens = extra.tokens;\n if (typeof extra.comments !== 'undefined') {\n tokens.comments = extra.comments;\n }\n if (typeof extra.errors !== 'undefined') {\n tokens.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n return tokens;\n }\n\n function parse(code, options) {\n var program, toString;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n if (typeof options !== 'undefined') {\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;\n\n if (extra.loc && options.source !== null && options.source !== undefined) {\n extra.source = toString(options.source);\n }\n\n if (typeof options.tokens === 'boolean' && options.tokens) {\n extra.tokens = [];\n }\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n if (extra.attachComment) {\n extra.range = true;\n extra.comments = [];\n extra.bottomRightStack = [];\n extra.trailingComments = [];\n extra.leadingComments = [];\n }\n }\n\n try {\n program = parseProgram();\n if (typeof extra.comments !== 'undefined') {\n program.comments = extra.comments;\n }\n if (typeof extra.tokens !== 'undefined') {\n filterTokenLocation();\n program.tokens = extra.tokens;\n }\n if (typeof extra.errors !== 'undefined') {\n program.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n\n return program;\n }\n\n // Sync with *.json manifests.\n exports.version = '1.2.2';\n\n exports.tokenize = tokenize;\n\n exports.parse = parse;\n\n // Deep copy.\n /* istanbul ignore next */\n exports.Syntax = (function () {\n var name, types = {};\n\n if (typeof Object.create === 'function') {\n types = Object.create(null);\n }\n\n for (name in Syntax) {\n if (Syntax.hasOwnProperty(name)) {\n types[name] = Syntax[name];\n }\n }\n\n if (typeof Object.freeze === 'function') {\n Object.freeze(types);\n }\n\n return types;\n }());\n\n}));\n/* vim: set sw=4 ts=4 et tw=80 : */\n\n},{}],1:[function(require,module,exports){\n(function (process){\n/* parser generated by jison 0.4.13 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar parser = {trace: function trace() { },\nyy: {},\nsymbols_: {\"error\":2,\"JSON_PATH\":3,\"DOLLAR\":4,\"PATH_COMPONENTS\":5,\"LEADING_CHILD_MEMBER_EXPRESSION\":6,\"PATH_COMPONENT\":7,\"MEMBER_COMPONENT\":8,\"SUBSCRIPT_COMPONENT\":9,\"CHILD_MEMBER_COMPONENT\":10,\"DESCENDANT_MEMBER_COMPONENT\":11,\"DOT\":12,\"MEMBER_EXPRESSION\":13,\"DOT_DOT\":14,\"STAR\":15,\"IDENTIFIER\":16,\"SCRIPT_EXPRESSION\":17,\"INTEGER\":18,\"END\":19,\"CHILD_SUBSCRIPT_COMPONENT\":20,\"DESCENDANT_SUBSCRIPT_COMPONENT\":21,\"[\":22,\"SUBSCRIPT\":23,\"]\":24,\"SUBSCRIPT_EXPRESSION\":25,\"SUBSCRIPT_EXPRESSION_LIST\":26,\"SUBSCRIPT_EXPRESSION_LISTABLE\":27,\",\":28,\"STRING_LITERAL\":29,\"ARRAY_SLICE\":30,\"FILTER_EXPRESSION\":31,\"QQ_STRING\":32,\"Q_STRING\":33,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"DOLLAR\",12:\"DOT\",14:\"DOT_DOT\",15:\"STAR\",16:\"IDENTIFIER\",17:\"SCRIPT_EXPRESSION\",18:\"INTEGER\",19:\"END\",22:\"[\",24:\"]\",28:\",\",30:\"ARRAY_SLICE\",31:\"FILTER_EXPRESSION\",32:\"QQ_STRING\",33:\"Q_STRING\"},\nproductions_: [0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */\n/**/) {\n/* this == yyval */\nif (!yy.ast) {\n yy.ast = _ast;\n _ast.initialize();\n}\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:yy.ast.set({ expression: { type: \"root\", value: $$[$0] } }); yy.ast.unshift(); return yy.ast.yield()\nbreak;\ncase 2:yy.ast.set({ expression: { type: \"root\", value: $$[$0-1] } }); yy.ast.unshift(); return yy.ast.yield()\nbreak;\ncase 3:yy.ast.unshift(); return yy.ast.yield()\nbreak;\ncase 4:yy.ast.set({ operation: \"member\", scope: \"child\", expression: { type: \"identifier\", value: $$[$0-1] }}); yy.ast.unshift(); return yy.ast.yield()\nbreak;\ncase 5:\nbreak;\ncase 6:\nbreak;\ncase 7:yy.ast.set({ operation: \"member\" }); yy.ast.push()\nbreak;\ncase 8:yy.ast.set({ operation: \"subscript\" }); yy.ast.push() \nbreak;\ncase 9:yy.ast.set({ scope: \"child\" })\nbreak;\ncase 10:yy.ast.set({ scope: \"descendant\" })\nbreak;\ncase 11:\nbreak;\ncase 12:yy.ast.set({ scope: \"child\", operation: \"member\" })\nbreak;\ncase 13:\nbreak;\ncase 14:yy.ast.set({ expression: { type: \"wildcard\", value: $$[$0] } })\nbreak;\ncase 15:yy.ast.set({ expression: { type: \"identifier\", value: $$[$0] } })\nbreak;\ncase 16:yy.ast.set({ expression: { type: \"script_expression\", value: $$[$0] } })\nbreak;\ncase 17:yy.ast.set({ expression: { type: \"numeric_literal\", value: parseInt($$[$0]) } })\nbreak;\ncase 18:\nbreak;\ncase 19:yy.ast.set({ scope: \"child\" })\nbreak;\ncase 20:yy.ast.set({ scope: \"descendant\" })\nbreak;\ncase 21:\nbreak;\ncase 22:\nbreak;\ncase 23:\nbreak;\ncase 24:$$[$0].length > 1? yy.ast.set({ expression: { type: \"union\", value: $$[$0] } }) : this.$ = $$[$0]\nbreak;\ncase 25:this.$ = [$$[$0]]\nbreak;\ncase 26:this.$ = $$[$0-2].concat($$[$0])\nbreak;\ncase 27:this.$ = { expression: { type: \"numeric_literal\", value: parseInt($$[$0]) } }; yy.ast.set(this.$)\nbreak;\ncase 28:this.$ = { expression: { type: \"string_literal\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 29:this.$ = { expression: { type: \"slice\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 30:this.$ = { expression: { type: \"wildcard\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 31:this.$ = { expression: { type: \"script_expression\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 32:this.$ = { expression: { type: \"filter_expression\", value: $$[$0] } }; yy.ast.set(this.$)\nbreak;\ncase 33:this.$ = $$[$0]\nbreak;\ncase 34:this.$ = $$[$0]\nbreak;\n}\n},\ntable: [{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],\ndefaultActions: {27:[2,23],29:[2,30],30:[2,31],31:[2,32]},\nparseError: function parseError(str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n throw new Error(str);\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n this.lexer.setInput(input);\n this.lexer.yy = this.yy;\n this.yy.lexer = this.lexer;\n this.yy.parser = this;\n if (typeof this.lexer.yylloc == 'undefined') {\n this.lexer.yylloc = {};\n }\n var yyloc = this.lexer.yylloc;\n lstack.push(yyloc);\n var ranges = this.lexer.options && this.lexer.options.ranges;\n if (typeof this.yy.parseError === 'function') {\n this.parseError = this.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = self.lexer.lex() || EOF;\n if (typeof token !== 'number') {\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (this.lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + this.lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: this.lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: this.lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(this.lexer.yytext);\n lstack.push(this.lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = this.lexer.yyleng;\n yytext = this.lexer.yytext;\n yylineno = this.lexer.yylineno;\n yyloc = this.lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n this.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\nvar _ast = {\n\n initialize: function() {\n this._nodes = [];\n this._node = {};\n this._stash = [];\n },\n\n set: function(props) {\n for (var k in props) this._node[k] = props[k];\n return this._node;\n },\n\n node: function(obj) {\n if (arguments.length) this._node = obj;\n return this._node;\n },\n\n push: function() {\n this._nodes.push(this._node);\n this._node = {};\n },\n\n unshift: function() {\n this._nodes.unshift(this._node);\n this._node = {};\n },\n\n yield: function() {\n var _nodes = this._nodes;\n this.initialize();\n return _nodes;\n }\n};\n/* generated by jison-lex 0.2.1 */\nvar lexer = (function(){\nvar lexer = {\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input) {\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function (match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex() {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin(condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState() {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules() {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState(n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState(condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START\n/**/) {\n\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:return 4\nbreak;\ncase 1:return 14\nbreak;\ncase 2:return 12\nbreak;\ncase 3:return 15\nbreak;\ncase 4:return 16\nbreak;\ncase 5:return 22\nbreak;\ncase 6:return 24\nbreak;\ncase 7:return 28\nbreak;\ncase 8:return 30\nbreak;\ncase 9:return 18\nbreak;\ncase 10:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 32;\nbreak;\ncase 11:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 33;\nbreak;\ncase 12:return 17\nbreak;\ncase 13:return 31\nbreak;\n}\n},\nrules: [/^(?:\\$)/,/^(?:\\.\\.)/,/^(?:\\.)/,/^(?:\\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\\[)/,/^(?:\\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\\:((-?(?:0|[1-9][0-9]*)))?(\\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:\"(?:\\\\[\"bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^\"\\\\])*\")/,/^(?:'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*')/,/^(?:\\(.+?\\)(?=\\]))/,/^(?:\\?\\(.+?\\)(?=\\]))/],\nconditions: {\"INITIAL\":{\"rules\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],\"inclusive\":true}}\n};\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain(args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}\n\n}).call(this,require('_process'))\n},{\"_process\":14,\"fs\":12,\"path\":13}],2:[function(require,module,exports){\nmodule.exports = {\n identifier: \"[a-zA-Z_]+[a-zA-Z0-9_]*\",\n integer: \"-?(?:0|[1-9][0-9]*)\",\n qq_string: \"\\\"(?:\\\\\\\\[\\\"bfnrt/\\\\\\\\]|\\\\\\\\u[a-fA-F0-9]{4}|[^\\\"\\\\\\\\])*\\\"\",\n q_string: \"'(?:\\\\\\\\[\\'bfnrt/\\\\\\\\]|\\\\\\\\u[a-fA-F0-9]{4}|[^\\'\\\\\\\\])*'\"\n};\n\n},{}],3:[function(require,module,exports){\nvar dict = require('./dict');\nvar fs = require('fs');\nvar grammar = {\n\n lex: {\n\n macros: {\n esc: \"\\\\\\\\\",\n int: dict.integer\n },\n\n rules: [\n [\"\\\\$\", \"return 'DOLLAR'\"],\n [\"\\\\.\\\\.\", \"return 'DOT_DOT'\"],\n [\"\\\\.\", \"return 'DOT'\"],\n [\"\\\\*\", \"return 'STAR'\"],\n [dict.identifier, \"return 'IDENTIFIER'\"],\n [\"\\\\[\", \"return '['\"],\n [\"\\\\]\", \"return ']'\"],\n [\",\", \"return ','\"],\n [\"({int})?\\\\:({int})?(\\\\:({int})?)?\", \"return 'ARRAY_SLICE'\"],\n [\"{int}\", \"return 'INTEGER'\"],\n [dict.qq_string, \"yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';\"],\n [dict.q_string, \"yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';\"],\n [\"\\\\(.+?\\\\)(?=\\\\])\", \"return 'SCRIPT_EXPRESSION'\"],\n [\"\\\\?\\\\(.+?\\\\)(?=\\\\])\", \"return 'FILTER_EXPRESSION'\"]\n ]\n },\n\n start: \"JSON_PATH\",\n\n bnf: {\n\n JSON_PATH: [\n [ 'DOLLAR', 'yy.ast.set({ expression: { type: \"root\", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()' ],\n [ 'DOLLAR PATH_COMPONENTS', 'yy.ast.set({ expression: { type: \"root\", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()' ],\n [ 'LEADING_CHILD_MEMBER_EXPRESSION', 'yy.ast.unshift(); return yy.ast.yield()' ],\n [ 'LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS', 'yy.ast.set({ operation: \"member\", scope: \"child\", expression: { type: \"identifier\", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()' ] ],\n\n PATH_COMPONENTS: [\n [ 'PATH_COMPONENT', '' ],\n [ 'PATH_COMPONENTS PATH_COMPONENT', '' ] ],\n\n PATH_COMPONENT: [\n [ 'MEMBER_COMPONENT', 'yy.ast.set({ operation: \"member\" }); yy.ast.push()' ],\n [ 'SUBSCRIPT_COMPONENT', 'yy.ast.set({ operation: \"subscript\" }); yy.ast.push() ' ] ],\n\n MEMBER_COMPONENT: [\n [ 'CHILD_MEMBER_COMPONENT', 'yy.ast.set({ scope: \"child\" })' ],\n [ 'DESCENDANT_MEMBER_COMPONENT', 'yy.ast.set({ scope: \"descendant\" })' ] ],\n\n CHILD_MEMBER_COMPONENT: [\n [ 'DOT MEMBER_EXPRESSION', '' ] ],\n\n LEADING_CHILD_MEMBER_EXPRESSION: [\n [ 'MEMBER_EXPRESSION', 'yy.ast.set({ scope: \"child\", operation: \"member\" })' ] ],\n\n DESCENDANT_MEMBER_COMPONENT: [\n [ 'DOT_DOT MEMBER_EXPRESSION', '' ] ],\n\n MEMBER_EXPRESSION: [\n [ 'STAR', 'yy.ast.set({ expression: { type: \"wildcard\", value: $1 } })' ],\n [ 'IDENTIFIER', 'yy.ast.set({ expression: { type: \"identifier\", value: $1 } })' ],\n [ 'SCRIPT_EXPRESSION', 'yy.ast.set({ expression: { type: \"script_expression\", value: $1 } })' ],\n [ 'INTEGER', 'yy.ast.set({ expression: { type: \"numeric_literal\", value: parseInt($1) } })' ],\n [ 'END', '' ] ],\n\n SUBSCRIPT_COMPONENT: [\n [ 'CHILD_SUBSCRIPT_COMPONENT', 'yy.ast.set({ scope: \"child\" })' ],\n [ 'DESCENDANT_SUBSCRIPT_COMPONENT', 'yy.ast.set({ scope: \"descendant\" })' ] ],\n\n CHILD_SUBSCRIPT_COMPONENT: [\n [ '[ SUBSCRIPT ]', '' ] ],\n\n DESCENDANT_SUBSCRIPT_COMPONENT: [\n [ 'DOT_DOT [ SUBSCRIPT ]', '' ] ],\n\n SUBSCRIPT: [\n [ 'SUBSCRIPT_EXPRESSION', '' ],\n [ 'SUBSCRIPT_EXPRESSION_LIST', '$1.length > 1? yy.ast.set({ expression: { type: \"union\", value: $1 } }) : $$ = $1' ] ],\n\n SUBSCRIPT_EXPRESSION_LIST: [\n [ 'SUBSCRIPT_EXPRESSION_LISTABLE', '$$ = [$1]'],\n [ 'SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE', '$$ = $1.concat($3)' ] ],\n\n SUBSCRIPT_EXPRESSION_LISTABLE: [\n [ 'INTEGER', '$$ = { expression: { type: \"numeric_literal\", value: parseInt($1) } }; yy.ast.set($$)' ],\n [ 'STRING_LITERAL', '$$ = { expression: { type: \"string_literal\", value: $1 } }; yy.ast.set($$)' ],\n [ 'ARRAY_SLICE', '$$ = { expression: { type: \"slice\", value: $1 } }; yy.ast.set($$)' ] ],\n\n SUBSCRIPT_EXPRESSION: [\n [ 'STAR', '$$ = { expression: { type: \"wildcard\", value: $1 } }; yy.ast.set($$)' ],\n [ 'SCRIPT_EXPRESSION', '$$ = { expression: { type: \"script_expression\", value: $1 } }; yy.ast.set($$)' ],\n [ 'FILTER_EXPRESSION', '$$ = { expression: { type: \"filter_expression\", value: $1 } }; yy.ast.set($$)' ] ],\n\n STRING_LITERAL: [\n [ 'QQ_STRING', \"$$ = $1\" ],\n [ 'Q_STRING', \"$$ = $1\" ] ]\n }\n};\nif (fs.readFileSync) {\n grammar.moduleInclude = fs.readFileSync(require.resolve(\"../include/module.js\"));\n grammar.actionInclude = fs.readFileSync(require.resolve(\"../include/action.js\"));\n}\n\nmodule.exports = grammar;\n\n},{\"./dict\":2,\"fs\":12}],4:[function(require,module,exports){\nvar aesprim = require('./aesprim');\nvar slice = require('./slice');\nvar _evaluate = require('static-eval');\nvar _uniq = require('underscore').uniq;\n\nvar Handlers = function() {\n return this.initialize.apply(this, arguments);\n}\n\nHandlers.prototype.initialize = function() {\n this.traverse = traverser(true);\n this.descend = traverser();\n}\n\nHandlers.prototype.keys = Object.keys;\n\nHandlers.prototype.resolve = function(component) {\n\n var key = [ component.operation, component.scope, component.expression.type ].join('-');\n var method = this._fns[key];\n\n if (!method) throw new Error(\"couldn't resolve key: \" + key);\n return method.bind(this);\n};\n\nHandlers.prototype.register = function(key, handler) {\n\n if (!handler instanceof Function) {\n throw new Error(\"handler must be a function\");\n }\n\n this._fns[key] = handler;\n};\n\nHandlers.prototype._fns = {\n\n 'member-child-identifier': function(component, partial) {\n var key = component.expression.value;\n var value = partial.value;\n if (value instanceof Object && key in value) {\n return [ { value: value[key], path: partial.path.concat(key) } ]\n }\n },\n\n 'member-descendant-identifier':\n _traverse(function(key, value, ref) { return key == ref }),\n\n 'subscript-child-numeric_literal':\n _descend(function(key, value, ref) { return key === ref }),\n\n 'member-child-numeric_literal':\n _descend(function(key, value, ref) { return String(key) === String(ref) }),\n\n 'subscript-descendant-numeric_literal':\n _traverse(function(key, value, ref) { return key === ref }),\n\n 'member-child-wildcard':\n _descend(function() { return true }),\n\n 'member-descendant-wildcard':\n _traverse(function() { return true }),\n\n 'subscript-descendant-wildcard':\n _traverse(function() { return true }),\n\n 'subscript-child-wildcard':\n _descend(function() { return true }),\n\n 'subscript-child-slice': function(component, partial) {\n if (is_array(partial.value)) {\n var args = component.expression.value.split(':').map(_parse_nullable_int);\n var values = partial.value.map(function(v, i) { return { value: v, path: partial.path.concat(i) } });\n return slice.apply(null, [values].concat(args));\n }\n },\n\n 'subscript-child-union': function(component, partial) {\n var results = [];\n component.expression.value.forEach(function(component) {\n var _component = { operation: 'subscript', scope: 'child', expression: component.expression };\n var handler = this.resolve(_component);\n var _results = handler(_component, partial);\n if (_results) {\n results = results.concat(_results);\n }\n }, this);\n\n return unique(results);\n },\n\n 'subscript-descendant-union': function(component, partial, count) {\n\n var jp = require('..');\n var self = this;\n\n var results = [];\n var nodes = jp.nodes(partial, '$..*').slice(1);\n\n nodes.forEach(function(node) {\n if (results.length >= count) return;\n component.expression.value.forEach(function(component) {\n var _component = { operation: 'subscript', scope: 'child', expression: component.expression };\n var handler = self.resolve(_component);\n var _results = handler(_component, node);\n results = results.concat(_results);\n });\n });\n\n return unique(results);\n },\n\n 'subscript-child-filter_expression': function(component, partial, count) {\n\n // slice out the expression from ?(expression)\n var src = component.expression.value.slice(2, -1);\n var ast = aesprim.parse(src).body[0].expression;\n\n var passable = function(key, value) {\n return evaluate(ast, { '@': value });\n }\n\n return this.descend(partial, null, passable, count);\n\n },\n\n 'subscript-descendant-filter_expression': function(component, partial, count) {\n\n // slice out the expression from ?(expression)\n var src = component.expression.value.slice(2, -1);\n var ast = aesprim.parse(src).body[0].expression;\n\n var passable = function(key, value) {\n return evaluate(ast, { '@': value });\n }\n\n return this.traverse(partial, null, passable, count);\n },\n\n 'subscript-child-script_expression': function(component, partial) {\n var exp = component.expression.value.slice(1, -1);\n return eval_recurse(partial, exp, '$[{{value}}]');\n },\n\n 'member-child-script_expression': function(component, partial) {\n var exp = component.expression.value.slice(1, -1);\n return eval_recurse(partial, exp, '$.{{value}}');\n },\n\n 'member-descendant-script_expression': function(component, partial) {\n var exp = component.expression.value.slice(1, -1);\n return eval_recurse(partial, exp, '$..value');\n }\n};\n\nHandlers.prototype._fns['subscript-child-string_literal'] =\n\tHandlers.prototype._fns['member-child-identifier'];\n\nHandlers.prototype._fns['member-descendant-numeric_literal'] =\n Handlers.prototype._fns['subscript-descendant-string_literal'] =\n Handlers.prototype._fns['member-descendant-identifier'];\n\nfunction eval_recurse(partial, src, template) {\n\n var jp = require('./index');\n var ast = aesprim.parse(src).body[0].expression;\n var value = evaluate(ast, { '@': partial.value });\n var path = template.replace(/\\{\\{\\s*value\\s*\\}\\}/g, value);\n\n var results = jp.nodes(partial.value, path);\n results.forEach(function(r) {\n r.path = partial.path.concat(r.path.slice(1));\n });\n\n return results;\n}\n\nfunction is_array(val) {\n return Array.isArray(val);\n}\n\nfunction is_object(val) {\n // is this a non-array, non-null object?\n return val && !(val instanceof Array) && val instanceof Object;\n}\n\nfunction traverser(recurse) {\n\n return function(partial, ref, passable, count) {\n\n var value = partial.value;\n var path = partial.path;\n\n var results = [];\n\n var descend = function(value, path) {\n\n if (is_array(value)) {\n value.forEach(function(element, index) {\n if (results.length >= count) { return }\n if (passable(index, element, ref)) {\n results.push({ path: path.concat(index), value: element });\n }\n });\n value.forEach(function(element, index) {\n if (results.length >= count) { return }\n if (recurse) {\n descend(element, path.concat(index));\n }\n });\n } else if (is_object(value)) {\n this.keys(value).forEach(function(k) {\n if (results.length >= count) { return }\n if (passable(k, value[k], ref)) {\n results.push({ path: path.concat(k), value: value[k] });\n }\n })\n this.keys(value).forEach(function(k) {\n if (results.length >= count) { return }\n if (recurse) {\n descend(value[k], path.concat(k));\n }\n });\n }\n }.bind(this);\n descend(value, path);\n return results;\n }\n}\n\nfunction _descend(passable) {\n return function(component, partial, count) {\n return this.descend(partial, component.expression.value, passable, count);\n }\n}\n\nfunction _traverse(passable) {\n return function(component, partial, count) {\n return this.traverse(partial, component.expression.value, passable, count);\n }\n}\n\nfunction evaluate() {\n try { return _evaluate.apply(this, arguments) }\n catch (e) { }\n}\n\nfunction unique(results) {\n results = results.filter(function(d) { return d })\n return _uniq(\n results,\n function(r) { return r.path.map(function(c) { return String(c).replace('-', '--') }).join('-') }\n );\n}\n\nfunction _parse_nullable_int(val) {\n var sval = String(val);\n return sval.match(/^-?[0-9]+$/) ? parseInt(sval) : null;\n}\n\nmodule.exports = Handlers;\n\n},{\"..\":\"jsonpath\",\"./aesprim\":\"./aesprim\",\"./index\":5,\"./slice\":7,\"static-eval\":15,\"underscore\":12}],5:[function(require,module,exports){\nvar assert = require('assert');\nvar dict = require('./dict');\nvar Parser = require('./parser');\nvar Handlers = require('./handlers');\n\nvar JSONPath = function() {\n this.initialize.apply(this, arguments);\n};\n\nJSONPath.prototype.initialize = function() {\n this.parser = new Parser();\n this.handlers = new Handlers();\n};\n\nJSONPath.prototype.parse = function(string) {\n assert.ok(_is_string(string), \"we need a path\");\n return this.parser.parse(string);\n};\n\nJSONPath.prototype.parent = function(obj, string) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n\n var node = this.nodes(obj, string)[0];\n var key = node.path.pop(); /* jshint unused:false */\n return this.value(obj, node.path);\n}\n\nJSONPath.prototype.apply = function(obj, string, fn) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n assert.equal(typeof fn, \"function\", \"fn needs to be function\")\n\n var nodes = this.nodes(obj, string).sort(function(a, b) {\n // sort nodes so we apply from the bottom up\n return b.path.length - a.path.length;\n });\n\n nodes.forEach(function(node) {\n var key = node.path.pop();\n var parent = this.value(obj, this.stringify(node.path));\n var val = node.value = fn.call(obj, parent[key]);\n parent[key] = val;\n }, this);\n\n return nodes;\n}\n\nJSONPath.prototype.value = function(obj, path, value) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(path, \"we need a path\");\n\n if (arguments.length >= 3) {\n var node = this.nodes(obj, path).shift();\n if (!node) return this._vivify(obj, path, value);\n var key = node.path.slice(-1).shift();\n var parent = this.parent(obj, this.stringify(node.path));\n parent[key] = value;\n }\n return this.query(obj, this.stringify(path), 1).shift();\n}\n\nJSONPath.prototype._vivify = function(obj, string, value) {\n\n var self = this;\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n\n var path = this.parser.parse(string)\n .map(function(component) { return component.expression.value });\n\n var setValue = function(path, value) {\n var key = path.pop();\n var node = self.value(obj, path);\n if (!node) {\n setValue(path.concat(), typeof key === 'string' ? {} : []);\n node = self.value(obj, path);\n }\n node[key] = value;\n }\n setValue(path, value);\n return this.query(obj, string)[0];\n}\n\nJSONPath.prototype.query = function(obj, string, count) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(_is_string(string), \"we need a path\");\n\n var results = this.nodes(obj, string, count)\n .map(function(r) { return r.value });\n\n return results;\n};\n\nJSONPath.prototype.paths = function(obj, string, count) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n\n var results = this.nodes(obj, string, count)\n .map(function(r) { return r.path });\n\n return results;\n};\n\nJSONPath.prototype.nodes = function(obj, string, count) {\n\n assert.ok(obj instanceof Object, \"obj needs to be an object\");\n assert.ok(string, \"we need a path\");\n\n if (count === 0) return [];\n\n var path = this.parser.parse(string);\n var handlers = this.handlers;\n\n var partials = [ { path: ['$'], value: obj } ];\n var matches = [];\n\n if (path.length && path[0].expression.type == 'root') path.shift();\n\n if (!path.length) return partials;\n\n path.forEach(function(component, index) {\n\n if (matches.length >= count) return;\n var handler = handlers.resolve(component);\n var _partials = [];\n\n partials.forEach(function(p) {\n\n if (matches.length >= count) return;\n var results = handler(component, p, count);\n\n if (index == path.length - 1) {\n // if we're through the components we're done\n matches = matches.concat(results || []);\n } else {\n // otherwise accumulate and carry on through\n _partials = _partials.concat(results || []);\n }\n });\n\n partials = _partials;\n\n });\n\n return count ? matches.slice(0, count) : matches;\n};\n\nJSONPath.prototype.stringify = function(path) {\n\n assert.ok(path, \"we need a path\");\n\n var string = '$';\n\n var templates = {\n 'descendant-member': '..{{value}}',\n 'child-member': '.{{value}}',\n 'descendant-subscript': '..[{{value}}]',\n 'child-subscript': '[{{value}}]'\n };\n\n path = this._normalize(path);\n\n path.forEach(function(component) {\n\n if (component.expression.type == 'root') return;\n\n var key = [component.scope, component.operation].join('-');\n var template = templates[key];\n var value;\n\n if (component.expression.type == 'string_literal') {\n value = JSON.stringify(component.expression.value)\n } else {\n value = component.expression.value;\n }\n\n if (!template) throw new Error(\"couldn't find template \" + key);\n\n string += template.replace(/{{value}}/, value);\n });\n\n return string;\n}\n\nJSONPath.prototype._normalize = function(path) {\n\n assert.ok(path, \"we need a path\");\n\n if (typeof path == \"string\") {\n\n return this.parser.parse(path);\n\n } else if (Array.isArray(path) && typeof path[0] == \"string\") {\n\n var _path = [ { expression: { type: \"root\", value: \"$\" } } ];\n\n path.forEach(function(component, index) {\n\n if (component == '$' && index === 0) return;\n\n if (typeof component == \"string\" && component.match(\"^\" + dict.identifier + \"$\")) {\n\n _path.push({\n operation: 'member',\n scope: 'child',\n expression: { value: component, type: 'identifier' }\n });\n\n } else {\n\n var type = typeof component == \"number\" ?\n 'numeric_literal' : 'string_literal';\n\n _path.push({\n operation: 'subscript',\n scope: 'child',\n expression: { value: component, type: type }\n });\n }\n });\n\n return _path;\n\n } else if (Array.isArray(path) && typeof path[0] == \"object\") {\n\n return path\n }\n\n throw new Error(\"couldn't understand path \" + path);\n}\n\nfunction _is_string(obj) {\n return Object.prototype.toString.call(obj) == '[object String]';\n}\n\nJSONPath.Handlers = Handlers;\nJSONPath.Parser = Parser;\n\nvar instance = new JSONPath;\ninstance.JSONPath = JSONPath;\n\nmodule.exports = instance;\n\n},{\"./dict\":2,\"./handlers\":4,\"./parser\":6,\"assert\":8}],6:[function(require,module,exports){\nvar grammar = require('./grammar');\nvar gparser = require('../generated/parser');\n\nvar Parser = function() {\n\n var parser = new gparser.Parser();\n\n var _parseError = parser.parseError;\n parser.yy.parseError = function() {\n if (parser.yy.ast) {\n parser.yy.ast.initialize();\n }\n _parseError.apply(parser, arguments);\n }\n\n return parser;\n\n};\n\nParser.grammar = grammar;\nmodule.exports = Parser;\n\n},{\"../generated/parser\":1,\"./grammar\":3}],7:[function(require,module,exports){\nmodule.exports = function(arr, start, end, step) {\n\n if (typeof start == 'string') throw new Error(\"start cannot be a string\");\n if (typeof end == 'string') throw new Error(\"end cannot be a string\");\n if (typeof step == 'string') throw new Error(\"step cannot be a string\");\n\n var len = arr.length;\n\n if (step === 0) throw new Error(\"step cannot be zero\");\n step = step ? integer(step) : 1;\n\n // normalize negative values\n start = start < 0 ? len + start : start;\n end = end < 0 ? len + end : end;\n\n // default extents to extents\n start = integer(start === 0 ? 0 : !start ? (step > 0 ? 0 : len - 1) : start);\n end = integer(end === 0 ? 0 : !end ? (step > 0 ? len : -1) : end);\n\n // clamp extents\n start = step > 0 ? Math.max(0, start) : Math.min(len, start);\n end = step > 0 ? Math.min(end, len) : Math.max(-1, end);\n\n // return empty if extents are backwards\n if (step > 0 && end <= start) return [];\n if (step < 0 && start <= end) return [];\n\n var result = [];\n\n for (var i = start; i != end; i += step) {\n if ((step < 0 && i <= end) || (step > 0 && i >= end)) break;\n result.push(arr[i]);\n }\n\n return result;\n}\n\nfunction integer(val) {\n return String(val).match(/^[0-9]+$/) ? parseInt(val) :\n Number.isFinite(val) ? parseInt(val, 10) : 0;\n}\n\n},{}],8:[function(require,module,exports){\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// when used in node, this will actually load the util module we depend on\n// versus loading the builtin util module as happens otherwise\n// this is a bug in node module loading as far as I am concerned\nvar util = require('util/');\n\nvar pSlice = Array.prototype.slice;\nvar hasOwn = Object.prototype.hasOwnProperty;\n\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nassert.AssertionError = function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n }\n else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = stackStartFunction.name;\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n};\n\n// assert.AssertionError instanceof Error\nutil.inherits(assert.AssertionError, Error);\n\nfunction replacer(key, value) {\n if (util.isUndefined(value)) {\n return '' + value;\n }\n if (util.isNumber(value) && !isFinite(value)) {\n return value.toString();\n }\n if (util.isFunction(value) || util.isRegExp(value)) {\n return value.toString();\n }\n return value;\n}\n\nfunction truncate(s, n) {\n if (util.isString(s)) {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\n\nfunction getMessage(self) {\n return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' +\n self.operator + ' ' +\n truncate(JSON.stringify(self.expected, replacer), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction fail(actual, expected, message, operator, stackStartFunction) {\n throw new assert.AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nfunction ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n}\nassert.ok = ok;\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\n\nassert.equal = function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', assert.equal);\n};\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\n\nassert.notEqual = function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', assert.notEqual);\n }\n};\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\n\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected)) {\n fail(actual, expected, message, 'deepEqual', assert.deepEqual);\n }\n};\n\nfunction _deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (util.isBuffer(actual) && util.isBuffer(expected)) {\n if (actual.length != expected.length) return false;\n\n for (var i = 0; i < actual.length; i++) {\n if (actual[i] !== expected[i]) return false;\n }\n\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (util.isDate(actual) && util.isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (util.isRegExp(actual) && util.isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!util.isObject(actual) && !util.isObject(expected)) {\n return actual == expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b) {\n if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n // if one is a primitive, the other must be same\n if (util.isPrimitive(a) || util.isPrimitive(b)) {\n return a === b;\n }\n var aIsArgs = isArguments(a),\n bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b);\n }\n var ka = objectKeys(a),\n kb = objectKeys(b),\n key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key])) return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\n\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected)) {\n fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);\n }\n};\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\n\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', assert.strictEqual);\n }\n};\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\n\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', assert.notStrictEqual);\n }\n};\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n } else if (actual instanceof expected) {\n return true;\n } else if (expected.call({}, actual) === true) {\n return true;\n }\n\n return false;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (util.isString(expected)) {\n message = expected;\n expected = null;\n }\n\n try {\n block();\n } catch (e) {\n actual = e;\n }\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n if (!shouldThrow && expectedException(actual, expected)) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\n\nassert.throws = function(block, /*optional*/error, /*optional*/message) {\n _throws.apply(this, [true].concat(pSlice.call(arguments)));\n};\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = function(block, /*optional*/message) {\n _throws.apply(this, [false].concat(pSlice.call(arguments)));\n};\n\nassert.ifError = function(err) { if (err) {throw err;}};\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n\n},{\"util/\":11}],9:[function(require,module,exports){\nif (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n},{}],10:[function(require,module,exports){\nmodule.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}\n},{}],11:[function(require,module,exports){\n(function (process,global){\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n}).call(this,require('_process'),typeof __webpack_require__.g !== \"undefined\" ? __webpack_require__.g : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"./support/isBuffer\":10,\"_process\":14,\"inherits\":9}],12:[function(require,module,exports){\n\n},{}],13:[function(require,module,exports){\n(function (process){\n// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,\n// backported and transplited with Babel, with backwards-compat fixes\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function (path) {\n if (typeof path !== 'string') path = path + '';\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) {\n // return '//';\n // Backwards-compat fix:\n return '/';\n }\n return path.slice(0, end);\n};\n\nfunction basename(path) {\n if (typeof path !== 'string') path = path + '';\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n}\n\n// Uses a mixed approach for backwards-compatibility, as ext behavior changed\n// in new Node.js versions, so only basename() above is backported here\nexports.basename = function (path, ext) {\n var f = basename(path);\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\nexports.extname = function (path) {\n if (typeof path !== 'string') path = path + '';\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = true\n ? function (str, start, len) { return str.substr(start, len) }\n : 0\n;\n\n}).call(this,require('_process'))\n},{\"_process\":14}],14:[function(require,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],15:[function(require,module,exports){\nvar unparse = require('escodegen').generate;\n\nmodule.exports = function (ast, vars) {\n if (!vars) vars = {};\n var FAIL = {};\n \n var result = (function walk (node, scopeVars) {\n if (node.type === 'Literal') {\n return node.value;\n }\n else if (node.type === 'UnaryExpression'){\n var val = walk(node.argument)\n if (node.operator === '+') return +val\n if (node.operator === '-') return -val\n if (node.operator === '~') return ~val\n if (node.operator === '!') return !val\n return FAIL\n }\n else if (node.type === 'ArrayExpression') {\n var xs = [];\n for (var i = 0, l = node.elements.length; i < l; i++) {\n var x = walk(node.elements[i]);\n if (x === FAIL) return FAIL;\n xs.push(x);\n }\n return xs;\n }\n else if (node.type === 'ObjectExpression') {\n var obj = {};\n for (var i = 0; i < node.properties.length; i++) {\n var prop = node.properties[i];\n var value = prop.value === null\n ? prop.value\n : walk(prop.value)\n ;\n if (value === FAIL) return FAIL;\n obj[prop.key.value || prop.key.name] = value;\n }\n return obj;\n }\n else if (node.type === 'BinaryExpression' ||\n node.type === 'LogicalExpression') {\n var l = walk(node.left);\n if (l === FAIL) return FAIL;\n var r = walk(node.right);\n if (r === FAIL) return FAIL;\n \n var op = node.operator;\n if (op === '==') return l == r;\n if (op === '===') return l === r;\n if (op === '!=') return l != r;\n if (op === '!==') return l !== r;\n if (op === '+') return l + r;\n if (op === '-') return l - r;\n if (op === '*') return l * r;\n if (op === '/') return l / r;\n if (op === '%') return l % r;\n if (op === '<') return l < r;\n if (op === '<=') return l <= r;\n if (op === '>') return l > r;\n if (op === '>=') return l >= r;\n if (op === '|') return l | r;\n if (op === '&') return l & r;\n if (op === '^') return l ^ r;\n if (op === '&&') return l && r;\n if (op === '||') return l || r;\n \n return FAIL;\n }\n else if (node.type === 'Identifier') {\n if ({}.hasOwnProperty.call(vars, node.name)) {\n return vars[node.name];\n }\n else return FAIL;\n }\n else if (node.type === 'ThisExpression') {\n if ({}.hasOwnProperty.call(vars, 'this')) {\n return vars['this'];\n }\n else return FAIL;\n }\n else if (node.type === 'CallExpression') {\n var callee = walk(node.callee);\n if (callee === FAIL) return FAIL;\n if (typeof callee !== 'function') return FAIL;\n \n var ctx = node.callee.object ? walk(node.callee.object) : FAIL;\n if (ctx === FAIL) ctx = null;\n\n var args = [];\n for (var i = 0, l = node.arguments.length; i < l; i++) {\n var x = walk(node.arguments[i]);\n if (x === FAIL) return FAIL;\n args.push(x);\n }\n return callee.apply(ctx, args);\n }\n else if (node.type === 'MemberExpression') {\n var obj = walk(node.object);\n // do not allow access to methods on Function \n if((obj === FAIL) || (typeof obj == 'function')){\n return FAIL;\n }\n if (node.property.type === 'Identifier') {\n return obj[node.property.name];\n }\n var prop = walk(node.property);\n if (prop === FAIL) return FAIL;\n return obj[prop];\n }\n else if (node.type === 'ConditionalExpression') {\n var val = walk(node.test)\n if (val === FAIL) return FAIL;\n return val ? walk(node.consequent) : walk(node.alternate)\n }\n else if (node.type === 'ExpressionStatement') {\n var val = walk(node.expression)\n if (val === FAIL) return FAIL;\n return val;\n }\n else if (node.type === 'ReturnStatement') {\n return walk(node.argument)\n }\n else if (node.type === 'FunctionExpression') {\n \n var bodies = node.body.body;\n \n // Create a \"scope\" for our arguments\n var oldVars = {};\n Object.keys(vars).forEach(function(element){\n oldVars[element] = vars[element];\n })\n\n for(var i=0; i<node.params.length; i++){\n var key = node.params[i];\n if(key.type == 'Identifier'){\n vars[key.name] = null;\n }\n else return FAIL;\n }\n for(var i in bodies){\n if(walk(bodies[i]) === FAIL){\n return FAIL;\n }\n }\n // restore the vars and scope after we walk\n vars = oldVars;\n \n var keys = Object.keys(vars);\n var vals = keys.map(function(key) {\n return vars[key];\n });\n return Function(keys.join(', '), 'return ' + unparse(node)).apply(null, vals);\n }\n else if (node.type === 'TemplateLiteral') {\n var str = '';\n for (var i = 0; i < node.expressions.length; i++) {\n str += walk(node.quasis[i]);\n str += walk(node.expressions[i]);\n }\n str += walk(node.quasis[i]);\n return str;\n }\n else if (node.type === 'TaggedTemplateExpression') {\n var tag = walk(node.tag);\n var quasi = node.quasi;\n var strings = quasi.quasis.map(walk);\n var values = quasi.expressions.map(walk);\n return tag.apply(null, [strings].concat(values));\n }\n else if (node.type === 'TemplateElement') {\n return node.value.cooked;\n }\n else return FAIL;\n })(ast);\n \n return result === FAIL ? undefined : result;\n};\n\n},{\"escodegen\":12}],\"jsonpath\":[function(require,module,exports){\nmodule.exports = require('./lib/index');\n\n},{\"./lib/index\":5}]},{},[\"jsonpath\"])(\"jsonpath\")\n});\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/jsonpath/jsonpath.js?")},631:(module,__unused_webpack_exports,__webpack_require__)=>{eval("var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = __webpack_require__(4654);\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other\n /* eslint-env browser */\n if (typeof window !== 'undefined' && obj === window) {\n return '{ [object Window] }';\n }\n if (obj === __webpack_require__.g) {\n return '{ [object globalThis] }';\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '&quot;');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/object-inspect/index.js?")},5798:module=>{"use strict";eval("\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/qs/lib/formats.js?")},129:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar stringify = __webpack_require__(8261);\nvar parse = __webpack_require__(5235);\nvar formats = __webpack_require__(5798);\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/qs/lib/index.js?")},5235:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(2769);\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = { __proto__: null };\n\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = utils.maybeMap(\n parseArrayValue(part.slice(pos + 1), options),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n if (has.call(obj, key)) {\n obj[key] = utils.combine(obj[key], val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var leaf = valuesParsed ? val : parseArrayValue(val, options);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (!options.parseArrays && cleanRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else if (cleanRoot !== '__proto__') {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n return {\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/qs/lib/parse.js?")},8261:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar getSideChannel = __webpack_require__(7478);\nvar utils = __webpack_require__(2769);\nvar formats = __webpack_require__(5798);\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar sentinel = {};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n commaRoundTrip,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel\n) {\n var obj = object;\n\n var tmpSc = sideChannel;\n var step = 0;\n var findFlag = false;\n while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {\n // Where object last appeared in the ref tree\n var pos = tmpSc.get(object);\n step += 1;\n if (typeof pos !== 'undefined') {\n if (pos === step) {\n throw new RangeError('Cyclic object value');\n } else {\n findFlag = true; // Break while\n }\n }\n if (typeof tmpSc.get(sentinel) === 'undefined') {\n step = 0;\n }\n }\n\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n if (encodeValuesOnly && encoder) {\n obj = utils.maybeMap(obj, encoder);\n }\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');\n\n sideChannel.set(object, step);\n var valueSideChannel = getSideChannel();\n valueSideChannel.set(sentinel, sideChannel);\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n commaRoundTrip,\n strictNullHandling,\n skipNulls,\n generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (opts && opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if (opts && 'indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n commaRoundTrip,\n options.strictNullHandling,\n options.skipNulls,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('&#10003;'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/qs/lib/stringify.js?")},2769:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar formats = __webpack_require__(5798);\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n /* eslint operator-linebreak: [2, \"before\"] */\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/qs/lib/utils.js?")},7771:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(210);\nvar define = __webpack_require__(2296);\nvar hasDescriptors = __webpack_require__(1044)();\nvar gOPD = __webpack_require__(7296);\n\nvar $TypeError = __webpack_require__(4453);\nvar $floor = GetIntrinsic('%Math.floor%');\n\n/** @typedef {(...args: unknown[]) => unknown} Func */\n\n/** @type {<T extends Func = Func>(fn: T, length: number, loose?: boolean) => T} */\nmodule.exports = function setFunctionLength(fn, length) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tif (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {\n\t\tthrow new $TypeError('`length` must be a positive 32-bit integer');\n\t}\n\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\n\tvar functionLengthIsConfigurable = true;\n\tvar functionLengthIsWritable = true;\n\tif ('length' in fn && gOPD) {\n\t\tvar desc = gOPD(fn, 'length');\n\t\tif (desc && !desc.configurable) {\n\t\t\tfunctionLengthIsConfigurable = false;\n\t\t}\n\t\tif (desc && !desc.writable) {\n\t\t\tfunctionLengthIsWritable = false;\n\t\t}\n\t}\n\n\tif (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);\n\t\t} else {\n\t\t\tdefine(/** @type {Parameters<define>[0]} */ (fn), 'length', length);\n\t\t}\n\t}\n\treturn fn;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/set-function-length/index.js?")},7478:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(210);\nvar callBound = __webpack_require__(1924);\nvar inspect = __webpack_require__(631);\n\nvar $TypeError = __webpack_require__(4453);\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n* This function traverses the list returning the node corresponding to the given key.\n*\n* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.\n*/\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/side-channel/index.js?")},7026:module=>{"use strict";eval("\n\nmodule.exports = function () {\n throw new Error(\n 'ws does not work in the browser. Browser clients must use the native ' +\n 'WebSocket object'\n );\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/ws/browser.js?")},4654:()=>{eval("/* (ignored) */\n\n//# sourceURL=webpack://@gudhub/core/./util.inspect_(ignored)?")},4836:module=>{eval('function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n "default": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/@babel/runtime/helpers/interopRequireDefault.js?')},8698:module=>{eval('function _typeof(o) {\n "@babel/helpers - typeof";\n\n return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;\n }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/@babel/runtime/helpers/typeof.js?')},1953:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";eval("// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n;// CONCATENATED MODULE: ./GUDHUB/config.js\nconst server_url = \"https://gudhub.com/GudHub_Test\";\n//export const server_url = \"https://gudhub.com/GudHub_Temp\";\n//export const server_url = \"https://integration.gudhub.com/GudHub_Test\";\n//export const server_url = \"http://localhost:9000\";\nconst wss_url = \"wss://gudhub.com/GudHub/ws/app/\";\nconst node_server_url = \"https://gudhub.com/api/services/prod\";\nconst async_modules_path = 'build/latest/async_modules_node/';\nconst automation_modules_path = 'build/latest/automation_modules/';\nconst file_server_url = 'https://gudhub.com';\nconst cache_chunk_requests = true;\nconst cache_app_requests = true;\n\n// FOR TESTS\nconst port = 9000;\n// EXTERNAL MODULE: ./GUDHUB/consts.js\nvar consts = __webpack_require__(738);\n;// CONCATENATED MODULE: ./GUDHUB/DataService/DataService.js\nclass DataService {}\n;\n;// CONCATENATED MODULE: ./GUDHUB/DataService/AppDataService.js\n\n\nclass AppDataService extends DataService {\n //interface for indexeddb and http services\n\n constructor(req, conf, gudhub) {\n super();\n this.chunkDataService = new export_ChunkDataService(req, chunkDataServiceConf, gudhub);\n this.gudhub = gudhub;\n }\n isWithCache() {\n return false;\n }\n\n //here\n async processRequestedApp(id, sentData) {\n if (!this.isWithCache()) {\n // async getChunks(app_id, chunk_ids) {\n // let chunks = [];\n // if(chunk_ids){\n // chunks = await Promise.all(chunk_ids.map((chunk_id) => this.getChunk(app_id, chunk_id)));\n // }\n // return chunks;\n // }\n\n // let res = await this.chunkDataService.getChunks(id, sentData.chunks);\n let res = await Promise.all(sentData.chunks.map(chunk_id => this.chunkDataService.getChunk(id, chunk_id)));\n if (!res) res = [];\n sentData.items_list = await this.gudhub.util.mergeChunks([...res, sentData]);\n return sentData;\n\n // this.dataService.putApp(id, nextVersion);\n\n // return this.mergeAndReturnStrategy.handle(sentData, chunks);\n }\n\n try {\n let cachedVersion = await this.getCached(id);\n if (!cachedVersion) {\n //TODO maybe dont wait for chunks at first load\n\n // let res = await this.chunkDataService.getChunks(id, sentData.chunks);\n let res = await Promise.all(sentData.chunks.map(chunk_id => this.chunkDataService.getChunk(id, chunk_id)));\n if (!res) res = [];\n sentData.items_list = await this.gudhub.util.mergeChunks([...res, sentData]);\n\n // this.putInCache(id, sentData);\n\n return sentData;\n }\n let newHashesList = sentData.chunks.filter(c => !cachedVersion.chunks.includes(c));\n\n // let self = this;\n\n // let res = await this.chunkDataService.getChunks(id, newHashesList);\n let res = await Promise.all(newHashesList.map(chunk_id => this.chunkDataService.getChunk(id, chunk_id)));\n if (!res) res = [];\n\n // this.chunkDataService.getChunks(id, newHashesList).then((res) => {\n\n sentData.items_list = await this.gudhub.util.mergeChunks([cachedVersion, ...res, sentData]);\n\n // this.gudhub.triggerAppChange(id, cachedVersion, sentData);\n\n // self.putInCache(id, sentData);\n // });\n\n return sentData;\n\n // return cachedVersion;\n } catch (error) {\n // res = await this.chunkDataService.getChunks(id, sentData.chunks);\n let res = await Promise.all(sentData.chunks.map(chunk_id => this.chunkDataService.getChunk(id, chunk_id)));\n if (!res) res = [];\n sentData.items_list = await this.gudhub.util.mergeChunks([...res, sentData]);\n\n // this.putInCache(id, sentData);\n\n return sentData;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/api/AppApi.js\nclass AppAPI {\n constructor(req) {\n this.req = req;\n }\n async getApp(app_id) {\n return this.req.get({\n url: `/api/app/get`,\n params: {\n app_id: app_id\n }\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/utils.js\nlet objectAssignWithoutOverride = (target, ...sourceList) => {\n for (let source of sourceList) {\n if (!source) continue;\n for (let key of Object.keys(source)) {\n //this doesnt iterate over class like source properties\n if (!(key in target)) {\n //checks own and inherited keys, works fine also for class prototypes and instances\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (desc.enumerable) Object.defineProperty(target, key, desc);\n }\n }\n }\n};\nlet objectAssignWithOverride = (target, ...sourceList) => {\n for (let source of sourceList) {\n if (!source) continue;\n for (let key of Object.keys(source)) {\n //this doesnt iterate over class like source properties\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (desc.enumerable) Object.defineProperty(target, key, desc);\n }\n }\n};\nlet checkInstanceModifier = (target, ...sourceList) => {\n for (let source of sourceList) {\n if (!source) continue;\n for (let key of Object.keys(source)) {\n //this doesnt iterate over class like source properties\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (desc.enumerable) Object.defineProperty(target, key, desc);\n }\n }\n};\n;// CONCATENATED MODULE: ./GUDHUB/DataService/httpService/HttpService.js\nclass HttpService {}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/httpService/AppHttpService.js\n\n\n\n\n\nclass AppHttpService extends AppDataService {\n constructor(req, conf, gudhub) {\n super(req, conf, gudhub);\n this.appApi = new AppAPI(req);\n let indexDBService = new HttpService(conf);\n\n // this.chunkDataService = new ChunkDataService; //TODO move to \n\n objectAssignWithOverride(this, indexDBService);\n }\n async getApp(id) {\n let sentData = await this.appApi.getApp(id);\n return this.processRequestedApp(id, sentData); // here is a problem. IndexedDB App service has Data service AppHttpService\n }\n\n //TODO should be getApp and getAppAndProcessData - refactor whole code to use them\n\n //TODO андрей говорил про то что там надо фильтровать айтемы удаленные, я так и не доделал\n\n async getAppWithoutProcessing(id) {\n return this.appApi.getApp(id);\n }\n async putApp(id, app) {\n // do nothing\n }\n static [Symbol.hasInstance](instance) {\n try {\n if (instance instanceof AppHttpService) return true;\n if (instance instanceof HttpService) return true; //TODO requires multiple inheritance, thhink how to overcome it\n return false;\n } catch (error) {\n return false;\n }\n }\n}\n;\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/IndexedDBService.js\nclass IndexedDBService {\n constructor(conf) {\n this.store = conf.store;\n this.dbName = conf.dbName;\n this.dbVersion = conf.dbVersion;\n this.requestCache = new Map(); // id -> promise\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/ChunkDataService.js\n\nclass ChunkDataService extends DataService {\n //interface for indexeddb and http services\n}\n;// CONCATENATED MODULE: ./GUDHUB/api/ChunkApi.js\nclass ChunkAPI {\n constructor(req) {\n this.req = req;\n }\n async getChunk(app_id, chunk_id) {\n return this.req.get({\n url: `${this.req.root}/api/get-items-chunk/${app_id}/${chunk_id}`,\n method: 'GET'\n });\n }\n async getLastChunk(app_id) {\n return this.req.axiosRequest({\n url: `${this.req.root}/api/get-last-items-chunk/${app_id}`,\n method: 'GET'\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/httpService/ChunkHttpService.js\n\n\n\n\nclass ChunkHttpService extends ChunkDataService {\n constructor(req, conf) {\n super();\n this.chunkApi = new ChunkAPI(req);\n let httpService = new HttpService(conf);\n objectAssignWithOverride(this, httpService);\n }\n async getChunk(app_id, id) {\n return this.chunkApi.getChunk(app_id, id);\n }\n putChunk() {\n //do nothing\n }\n static [Symbol.hasInstance](instance) {\n try {\n if (instance instanceof ChunkHttpService) return true;\n if (instance instanceof HttpService) return true; //TODO requires multiple inheritance, thhink how to overcome it\n return false;\n } catch (error) {\n return false;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/IndexedDBChunkService.js\n // removed \"ChunkCacheDataService\" from imported because it was causing an error \"{ ChunkCacheDataService } not found in exported names\" in \"gudhub-node-server\"\n\n\n\n\n//this should be global in project\n// class IndexedDBFacade extends CacheService {\n\n// }\n\n// class ChunkCachedDataService extends ChunkDataService {\n// dataService;\n// }\n\nclass IndexedDBChunkService extends ChunkDataService {\n constructor(req, conf, gudhub) {\n super(req, conf);\n this.dataService = new ChunkHttpService(req);\n let indexDBService = new IndexedDBService(conf);\n this.gudhub = gudhub;\n objectAssignWithOverride(this, indexDBService);\n }\n\n //TODO use IndexedDBFacade here\n // indexDBAccess = new IndexedDBFacade;\n\n static [Symbol.hasInstance](instance) {\n try {\n if (instance instanceof IndexedDBChunkService) return true;\n if (instance instanceof IndexedDBService) return true; //TODO requires multiple inheritance, thhink how to overcome it\n return false;\n } catch (error) {\n return false;\n }\n }\n async putChunk(id, data) {\n try {\n const db = await this.openDatabase();\n const transaction = db.transaction(this.store, \"readwrite\");\n const store = transaction.objectStore(this.store);\n store.put(data, id);\n } catch (error) {}\n }\n\n // async getApp(id) {\n // if (this.requestCache.has(id)) return this.requestCache.get(id);\n\n // let self = this;\n\n // let dataServiceRequest = this.dataService.getApp(id);\n\n // let pr = new Promise(async (resolve, reject) => {\n // try {\n // const db = await self.openDatabase();\n // const transaction = db.transaction(self.store, \"readonly\");\n // const store = transaction.objectStore(self.store);\n\n // const storeRequest = store.get(id);\n\n // storeRequest.onsuccess = (e) => {\n\n // let cachedData = e.target.result;\n\n // if (\n // !cachedData\n // ) {\n // dataServiceRequest.then(resolve, reject);\n // dataServiceRequest.then(data => self.putApp(id, data));\n // }\n\n // if (\n // cachedData\n // ) {\n // resolve(cachedData);\n\n // dataServiceRequest.then(async (data) => {\n // // self.gudhub.processAppUpd(data, cachedData);//\n // await self.putApp(id, data);\n // self.gudhub.triggerAppUpdate(id, prevVersion, newVersion);\n // });\n // }\n // };\n\n // storeRequest.onerror = () => {\n // dataServiceRequest.then(resolve, reject);\n // dataServiceRequest.then(data => self.putApp(id, data));\n // }\n // } catch (error) {\n // dataServiceRequest.then(resolve, reject);\n // dataServiceRequest.then(data => self.putApp(id, data));\n // }\n // });\n\n // self.requestCache.set(id, pr);\n\n // return pr;\n // }\n\n async getChunk(app_id, id) {\n if (this.requestCache.has(id)) return this.requestCache.get(id);\n try {\n let self = this;\n let pr = new Promise(async (resolve, reject) => {\n try {\n const db = await self.openDatabase();\n const transaction = db.transaction(self.store, \"readonly\");\n const store = transaction.objectStore(self.store);\n const storeRequest = store.get(id);\n storeRequest.onsuccess = e => {\n let cachedData = e.target.result;\n if (!cachedData) {\n reject();\n }\n if (cachedData) {\n resolve(cachedData);\n }\n };\n storeRequest.onerror = reject;\n } catch (error) {\n reject();\n }\n });\n self.requestCache.set(id, pr);\n await pr;\n return pr;\n } catch (e) {\n let reqPrms = this.dataService.getChunk(app_id, id);\n this.requestCache.set(id, reqPrms);\n let res = await reqPrms;\n this.putChunk(id, res);\n // putPrms.then(() => self.gudhub.triggerAppUpdate(id));\n\n return reqPrms;\n }\n }\n async openDatabase() {\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(this.dbName, this.dbVersion);\n request.onsuccess = event => {\n resolve(event.target.result);\n };\n request.onerror = event => {\n reject(event.target.error);\n };\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/consts.js\nconst dbName = \"gudhub\";\nconst dbVersion = 7;\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/chunkDataConf.js\n\nconst chunksConf = {\n dbName: dbName,\n dbVersion: dbVersion,\n store: 'chunks'\n};\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/IndexedDBAppService.js\n\n // removed \"ChunkCacheDataService\" from imported because it was causing an error \"{ ChunkCacheDataService } not found in exported names\" in \"gudhub-node-server\"\n\n\n\n\n\n\n//this should be global in project\n// class IndexedDBFacade extends CacheService {\n\n// }\n\n//todo андрей сказал чанки два раза грузятся\n//при первой загрузке когда нет бд ничего не отображается\n//андрей предлагает грохать бд если проблемы со сторами\n\nclass IndexedDBAppServiceForWorker extends AppDataService {\n constructor(req, conf, gudhub) {\n super(req, conf, gudhub);\n this.dataService = new AppHttpService(req, conf, gudhub);\n let indexDBService = new IndexedDBService(conf);\n this.gudhub = gudhub;\n this.chunkDataService = new IndexedDBChunkService(req, chunksConf, gudhub);\n\n //TODO also think how to use AppDataService without overriding chunkDataService here. seems it gets http chunk service for worker somehow\n // maybe IS_WEB is wrong inside worker\n\n //todo worker pool?\n\n objectAssignWithOverride(this, indexDBService);\n }\n static [Symbol.hasInstance](instance) {\n try {\n if (instance instanceof IndexedDBAppServiceForWorker) return true;\n if (instance instanceof IndexedDBService) return true; //TODO requires multiple inheritance, thhink how to overcome it\n return false;\n } catch (error) {\n return false;\n }\n }\n\n //TODO use IndexedDBFacade here\n // indexDBAccess = new IndexedDBFacade;\n\n isWithCache() {\n return true;\n }\n\n // getApp(id) {\n // let worker = new Worker('../../appRequestWorker.js');\n\n // worker.postMessage({ type: 'init', gudhubSerialized: this.gudhub.serialized });\n\n // // Send the main data to be processed\n // const mainData = { /* your data here */ };\n // worker.postMessage({ type: 'processData', data: mainData });\n\n // worker.onmessage = function(e) {\n // console.log('Data processed by worker:', e.data);\n // };\n\n // worker.onerror = function(e) {\n // console.error('Error in worker:', e);\n // };\n\n // worker.onmessage = (msgEv) => {\n\n // }\n\n // }\n\n async getApp(id) {\n // if (this.requestCache.has(id)) return this.requestCache.get(id);\n\n let self = this;\n\n // let dataServiceRequest = this.dataService.getAppWithoutProcessing(id);\n let data = await this.dataService.getAppWithoutProcessing(id);\n let processedData = await self.processRequestedApp(id, data); //here\n\n self.putApp(id, processedData);\n return processedData;\n let pr = new Promise(async (resolve, reject) => {\n try {\n const db = await self.openDatabase();\n const transaction = db.transaction(self.store, \"readonly\");\n const store = transaction.objectStore(self.store);\n const storeRequest = store.get(id);\n storeRequest.onsuccess = e => {\n let cachedData = e.target.result;\n if (!cachedData) {\n dataServiceRequest.then(async data => {\n let processedData = await self.processRequestedApp(id, data); //here\n\n // let comparison = this.gudhub.util.compareItems([], processedData.items_list);\n\n // let cached\n\n resolve(processedData);\n self.putApp(id, processedData);\n }, reject);\n }\n if (cachedData) {\n // resolve(cachedData);\n\n dataServiceRequest.then(async data => {\n let processedData = await self.processRequestedApp(id, data); //here\n\n // let comparison = this.gudhub.util.compareItems(cachedData.items_list, processedData.items_list);\n\n resolve(processedData);\n self.putApp(id, processedData);\n });\n }\n };\n storeRequest.onerror = () => {\n dataServiceRequest.then(async data => {\n let processedData = await self.processRequestedApp(id, data); //here\n\n // let comparison = this.gudhub.util.compareItems([], processedData.items_list);\n\n // let cached\n\n resolve(processedData);\n self.putApp(id, processedData);\n }, reject);\n };\n } catch (error) {\n dataServiceRequest.then(async data => {\n let processedData = await self.processRequestedApp(id, data); //here\n\n // let comparison = this.gudhub.util.compareItems([], processedData.items_list);\n\n // let cached\n\n resolve(processedData);\n self.putApp(id, processedData);\n }, reject);\n }\n });\n\n // self.requestCache.set(id, pr);\n\n return pr;\n }\n async getCached(id) {\n let self = this;\n let pr = new Promise(async (resolve, reject) => {\n try {\n const db = await self.openDatabase();\n const transaction = db.transaction(self.store, \"readonly\");\n const store = transaction.objectStore(self.store);\n const storeRequest = store.get(id);\n storeRequest.onsuccess = e => {\n let cachedData = e.target.result;\n if (!cachedData) {\n reject();\n }\n if (cachedData) {\n resolve(cachedData);\n }\n };\n storeRequest.onerror = reject;\n } catch (error) {\n reject();\n }\n });\n return pr;\n }\n async putApp(id, data) {\n try {\n const db = await this.openDatabase();\n const transaction = db.transaction(this.store, \"readwrite\");\n const store = transaction.objectStore(this.store);\n store.put(data, id);\n } catch (error) {}\n }\n async openDatabase() {\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(this.dbName, this.dbVersion);\n request.onsuccess = event => {\n resolve(event.target.result);\n };\n request.onerror = event => {\n reject(event.target.error);\n };\n });\n }\n}\nclass IndexedDBAppService extends AppDataService {\n constructor(req, conf, gudhub) {\n super(req, conf, gudhub);\n this.dataService = new AppHttpService(req, conf, gudhub);\n let indexDBService = new IndexedDBService(conf);\n this.gudhub = gudhub;\n this.resolveFnMap = new Map(); // id -> resolve\n\n // this.appRequestAndProcessWorker = new Worker('./appRequestWorker.js');\n // this.appRequestAndProcessWorker = new Worker(new URL('./appRequestWorker.js', import.meta.url));\n this.appRequestAndProcessWorker = new Worker('node_modules/@gudhub/core/umd/appRequestWorker.js');\n // this.appRequestAndProcessWorker = new AppRequestWorker();\n\n // new Worker(new URL('./worker.js', import.meta.url));\n\n this.appRequestAndProcessWorker.postMessage({\n type: 'init',\n gudhubSerialized: this.gudhub.serialized\n });\n let self = this;\n this.appRequestAndProcessWorker.onerror = function (e) {\n // self.appRequestAndProcessWorker.terminate();\n\n // console.error('Error in worker:', e);\n };\n\n // let self = this;\n\n this.appRequestAndProcessWorker.onmessage = function (e) {\n if (e.data.type == 'requestApp') {\n if (self.resolveFnMap.has(e.data.id)) {\n let resolver = self.resolveFnMap.get(e.data.id);\n resolver(e.data.data);\n }\n\n // self.requestCache.set(id, new Promise);\n }\n\n if (e.data.type == 'processData') {\n // if (id == e.data.id) {\n self.gudhub.itemProcessor.handleDiff(e.data.id, e.data.compareRes);\n // }\n }\n\n // worker.terminate();\n\n // this.postMessage({id: e.data.id, compareRes: comparison});\n\n // console.log('Data processed by worker:', e.data);\n };\n\n // worker.onerror = function(e) {\n // // worker.terminate();\n\n // // console.error('Error in worker:', e);\n // };\n\n //todo worker pool?\n\n objectAssignWithOverride(this, indexDBService);\n }\n static [Symbol.hasInstance](instance) {\n try {\n if (instance instanceof IndexedDBAppService) return true;\n if (instance instanceof IndexedDBService) return true; //TODO requires multiple inheritance, thhink how to overcome it\n return false;\n } catch (error) {\n return false;\n }\n }\n\n //TODO use IndexedDBFacade here\n // indexDBAccess = new IndexedDBFacade;\n\n isWithCache() {\n return true;\n }\n async getApp(id) {\n if (this.requestCache.has(id)) return this.requestCache.get(id);\n let self = this;\n let hasId = await this.has(id);\n if (hasId) {\n let getFromDBPrms = this.getCached(id);\n this.requestCache.set(id, getFromDBPrms);\n this.appRequestAndProcessWorker.postMessage({\n type: 'processData',\n id: id\n });\n return getFromDBPrms;\n } else {\n // this.requestCache.set(id, new Promise);\n\n let prms = new Promise((resolve, reject) => {\n self.resolveFnMap.set(id, resolve);\n });\n this.requestCache.set(id, prms);\n\n //todo define types as constants\n this.appRequestAndProcessWorker.postMessage({\n type: 'requestApp',\n id: id\n });\n return prms;\n\n //todo somehow handle answer from worker\n\n //maybe use mesage library to communicate with worker\n }\n\n // let worker = new Worker('./appRequestWorker.js');\n\n // worker.postMessage({ type: 'init', gudhubSerialized: this.gudhub.serialized });\n\n // Send the main data to be processed\n // const mainData = { /* your data here */ };\n // this.appRequestAndProcessWorker.postMessage({ type: 'processData', id: id });\n\n // let self = this;\n\n // worker.onmessage = function(e) {\n\n // if (id == e.data.id) {\n // self.gudhub.itemProcessor.handleDiff(e.data.id, e.data.compareRes);\n // }\n\n // // worker.terminate();\n\n // // this.postMessage({id: e.data.id, compareRes: comparison});\n\n // // console.log('Data processed by worker:', e.data);\n // };\n\n // worker.onerror = function(e) {\n // // worker.terminate();\n\n // // console.error('Error in worker:', e);\n // };\n\n // return getFromDBPrms;\n }\n\n //TODO page isnt loaded when indexeddb empty. Investigate getApp in IndexedDBAppService here\n\n async getCached(id) {\n let self = this;\n let pr = new Promise(async (resolve, reject) => {\n try {\n const db = await self.openDatabase();\n const transaction = db.transaction(self.store, \"readonly\");\n const store = transaction.objectStore(self.store);\n const storeRequest = store.get(id);\n storeRequest.onsuccess = e => {\n let cachedData = e.target.result;\n if (!cachedData) {\n reject();\n }\n if (cachedData) {\n resolve(cachedData);\n }\n };\n storeRequest.onerror = reject;\n } catch (error) {\n reject();\n }\n });\n return pr;\n }\n async has(id) {\n try {\n let cached = await this.getCached(id);\n if (!cached) return false;\n return true;\n } catch (e) {\n //todo check error type and then rethrow maybe here\n\n return false;\n }\n }\n async putApp(id, data) {\n try {\n const db = await this.openDatabase();\n const transaction = db.transaction(this.store, \"readwrite\");\n const store = transaction.objectStore(this.store);\n store.put(data, id);\n } catch (error) {}\n }\n\n //todo openDatabase only once and then preserve it for further usage\n async openDatabase() {\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(this.dbName, this.dbVersion);\n request.onsuccess = event => {\n resolve(event.target.result);\n };\n request.onerror = event => {\n reject(event.target.error);\n };\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/appDataConf.js\n\nconst appsConf = {\n dbName: dbName,\n dbVersion: dbVersion,\n store: 'apps'\n};\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/init.js\n\n\n\n\nif (consts/* IS_WEB */.P) {\n const request = indexedDB.open(dbName, dbVersion);\n request.onupgradeneeded = event => {\n const db = event.target.result;\n for (let store of [appsConf.store, chunksConf.store]) {\n if (!db.objectStoreNames.contains(store)) {\n db.createObjectStore(store);\n }\n }\n };\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/export.js\n\n\n\n\n\n\n\n\n\nlet export_AppDataService;\nlet export_ChunkDataService;\nlet appDataServiceConf;\nlet chunkDataServiceConf;\nif (consts/* IS_WEB */.P && cache_chunk_requests) {\n export_ChunkDataService = IndexedDBChunkService;\n chunkDataServiceConf = chunksConf;\n} else {\n export_ChunkDataService = ChunkHttpService;\n}\nif (consts/* IS_WEB */.P && cache_app_requests) {\n export_AppDataService = IndexedDBAppService;\n appDataServiceConf = appsConf;\n} else {\n export_AppDataService = AppHttpService;\n}\n\n// EXTERNAL MODULE: ./node_modules/axios/index.js\nvar axios = __webpack_require__(9669);\n;// CONCATENATED MODULE: ./GUDHUB/utils.js\nfunction replaceSpecialCharacters(obj) {\n return JSON.stringify(obj).replace(/\\+|&|%/g, match => {\n switch (match) {\n case \"+\":\n return \"%2B\";\n case \"&\":\n return \"%26\";\n case \"%\":\n return \"%25\";\n }\n });\n}\n\n/*----------------------------- FILTERING ITEM's FIELDS BEFORE SENDING -------------------------*/\n\n/*-- Checking if some fields has null in field_value ( we don't send such fields )*/\nfunction filterFields(fieldsToFilter = []) {\n return fieldsToFilter.filter(field => field.field_value != null);\n}\nfunction convertObjToUrlParams(obj = {}) {\n const entries = Object.entries(obj);\n if (!entries.length) return \"\";\n return `&${entries.map(([key, value]) => `${key}=${value}`).join(\"&\")}`;\n}\n// EXTERNAL MODULE: ./node_modules/qs/lib/index.js\nvar lib = __webpack_require__(129);\n;// CONCATENATED MODULE: ./GUDHUB/gudhub-https-service.js\n//****************** GUDHUB HTTPS SERVICE ***********************//\n//-- This Service decorates each POST and GET request with Token\n//-- This Service take care of toking beeing always valid\n\n\n\n\nclass GudHubHttpsService {\n constructor(server_url) {\n this.root = server_url;\n this.requestPromises = [];\n }\n\n //****************** INITIALISATION **************//\n // Here we set a function to get token\n init(getToken) {\n this.getToken = getToken;\n }\n\n //********************* GET ***********************//\n async get(request) {\n const accessToken = await this.getToken();\n const hesh = this.getHashCode(request);\n if (this.requestPromises[hesh]) {\n return this.requestPromises[hesh].promise;\n }\n const promise = new Promise((resolve, reject) => {\n let url;\n if (request.externalResource) {\n url = request.url;\n } else {\n url = this.root + request.url;\n url = `${url}${/\\?/.test(url) ? \"&\" : \"?\"}token=${accessToken}${convertObjToUrlParams(request.params)}`;\n }\n axios.get(url, {\n validateStatus: function (status) {\n return status < 400; // Resolve only if the status code is less than 400\n }\n }).then(function (response) {\n if (response.status != 200) {\n console.error(`GUDHUB HTTP SERVICE: GET ERROR: ${response.status}`, response);\n }\n // handle success\n resolve(response.data);\n }).catch(function (err) {\n console.error(`GUDHUB HTTP SERVICE: GET ERROR: ${err.response.status}\\n`, err);\n console.log(\"Request message: \", request);\n if (err.response && err.response.data) {\n console.log('Error response data: ', err.response.data);\n }\n reject(err);\n });\n });\n this.pushPromise(promise, hesh);\n return promise;\n }\n\n //********************* POST ***********************//\n async post(request) {\n const hesh = this.getHashCode(request);\n request.form[\"token\"] = await this.getToken();\n if (this.requestPromises[hesh]) {\n return this.requestPromises[hesh].promise;\n }\n const promise = new Promise((resolve, reject) => {\n axios.post(this.root + request.url, lib.stringify(request.form), {\n maxBodyLength: Infinity,\n headers: request.headers || {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n validateStatus: function (status) {\n return status < 400; // Resolve only if the status code is less than 400\n }\n }).then(function (response) {\n if (response.status != 200) {\n console.error(`GUDHUB HTTP SERVICE: POST ERROR: ${response.status}`, response);\n }\n // handle success\n resolve(response.data);\n }).catch(function (error) {\n console.error(`GUDHUB HTTP SERVICE: POST ERROR: ${error.response.status}\\n`, error);\n console.log(\"Request message: \", request);\n reject(error);\n });\n });\n this.pushPromise(promise, hesh);\n return promise;\n }\n\n /*************** AXIOS REQUEST ***************/\n // It's using to send simple requests to custom urls without token\n // If you want to send application/x-www-form-urlencoded, pass data in 'form' property of request\n // If you wnt to send any other type of data, just pass it to 'body' property of request\n\n axiosRequest(request) {\n const hesh = this.getHashCode(request);\n if (this.requestPromises[hesh]) {\n return this.requestPromises[hesh].promise;\n }\n let method = request.method ? request.method.toLowerCase() : 'get';\n let url = request.url;\n let headers = request.headers || {};\n if (request.form) {\n headers['Content-Type'] = 'application/x-www-form-urlencoded';\n }\n const promise = new Promise(async (resolve, reject) => {\n try {\n const {\n data\n } = await axios[method](url, method === 'post' ? lib.stringify(request.form) || request.body : {\n headers\n }, method === 'post' ? {\n headers\n } : {});\n resolve(data);\n } catch (error) {\n console.log(\"ERROR -> GUDHUB HTTP SERVICE -> SIMPLE POST :\", error.message);\n console.log(\"Request message: \", request);\n reject(error);\n }\n });\n this.pushPromise(promise, hesh);\n return promise;\n }\n\n /*************** PUSH PROMISE ***************/\n // It push promise object by hash to this.requestPromises\n\n pushPromise(promise, hesh) {\n this.requestPromises[hesh] = {\n promise,\n hesh,\n callback: promise.then(() => {\n this.destroyPromise(hesh);\n }).catch(err => {\n this.destroyPromise(hesh);\n })\n };\n }\n\n /*************** DELETE PROMISE ***************/\n // It deletes promise from this.requestPromises by hash after promise resolve\n\n destroyPromise(hesh) {\n this.requestPromises = this.requestPromises.filter(request => request.hesh !== hesh);\n }\n\n //********************* GET HASH CODE ***********************//\n // it generates numeric identificator whish is the same for similar requests\n // HASH CODE is generated based on: request.params, request.url, request.form\n getHashCode(request) {\n let hash = 0;\n let str = lib.stringify(request);\n if (str.length == 0) return hash;\n for (let i = 0; i < str.length; i++) {\n let char = str.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash = hash & hash; // Convert to 32bit integer\n }\n\n return \"h\" + hash;\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/PipeService/utils.js\nfunction createId(obj) {\n let stringId = \"\";\n for (let key in obj) {\n if (obj.hasOwnProperty(key) && obj[key]) {\n stringId += \".\" + obj[key];\n }\n }\n return stringId ? stringId.substring(1) : \"any\";\n}\nfunction checkParams(type, destination, fn) {\n if (type == undefined || typeof type !== \"string\") {\n console.log(\"Listener type is \\\"undefined\\\" or not have actual 'type' for subscribe\");\n return false;\n }\n if (destination == undefined || typeof destination !== \"object\") {\n console.log(\"Listener destination is \\\"undefined\\\" or not have actual 'type' for subscribe\");\n return false;\n }\n if (typeof fn !== \"function\") {\n console.log(\"Listener is not a function for subscribe!\");\n return false;\n }\n return true;\n}\n;// CONCATENATED MODULE: ./GUDHUB/PipeService/PipeService.js\n/*============================================================================*/\n/*======================== PIPE MODULE ===============================*/\n/*============================================================================*/\n\n/*\n| ======================== PIPE EVENTS TYPES =================================\n|\n|\n| ---------------------------- APP EVENTS -----------------------------------\n| 'gh_app' - send event when element initialised\n| 'gh_app_info_get' - Return app_name, app_id, app_icon\n| 'gh_app_get' -\n| 'gh_app_update' -\n| 'gh_apps_list_get' -\n| 'gh_delete_app' -\n| 'gh_apps_list_update' -\n|\n| ---------------------------- VIEW EVENTS -----------------------------------\n| 'gh_app_views_update' -\n| 'gh_app_view_get' -\n| -------------------------- ITEM EVENTS ------------------------------------\n|\n| 'gh_items_get' - get items_list\n| 'gh_items_chunks_get' - get items splitted to chunks with specified chunk size\n| 'gh_items_update' - update items_list\n|\n| 'gh_item_update' - item's any field value update\n| 'gh_item_get' - item fields value get\n|\n| -------------------------- FIELD EVENTS -----------------------------------\n|\n| 'gh_model_get' - get field model in field_list.\n| 'gh_model_update' - update field model in field_list\n| 'gh_model_delete' - delete field model from field_list and from items\n|\n|\n|\n| 'gh_models_edit' - use in 'edit_template','edit_field' and 'edit_interpretation'\n| actions\n| 'gh_models_get' - get field_model list.\n|\n|\n|\n| 'gh_value_update' - update field value in item\n| 'gh_value_get' - get field value\n| 'gh_interpreted_value_get' - get field interpretation\n| 'gh_value_set' - setter of field value\n|\n*/\n\n\nclass PipeService {\n constructor() {\n this.subscribers = {};\n this.messageBox = {};\n }\n\n //============================== ON PIPE ====================================//\n /*----------------------------------------------------------------------------\n | Params:\n | 'type' - String (require). type of event ('gh_field_update', ........)\n | from event list or maybe 'gh_field_update gh_field_value_update'\n | 'destination' - Object (require).\n | {\n | app_id: '',\n | item_id: ''\n | field_id: ''\n | }\n | 'fn' - Function (require). callback function\n | 'scope' - Scope\n |------------------------------------------------------------------------------*/\n\n on(types, destination, fn) {\n if (checkParams(types, destination, fn)) {\n types.split(\" \").map(type => {\n return type + \":\" + createId(destination);\n }).forEach(typeWithId => {\n if (!this.subscribers[typeWithId]) {\n this.subscribers[typeWithId] = new Set();\n }\n this.subscribers[typeWithId].add(fn);\n\n //checking for messeges those were sent before subscription created\n this.checkMessageBox(typeWithId);\n });\n }\n return this;\n }\n\n //============================== EMIT PIPE ====================================//\n /*------------------------------------------------------------------------------\n | Params:\n | 'type' - String (require). type of event ('gh_field_update', ........)\n | from eventlist\n | 'destination' - Object (require).\n | {\n | app_id: '',\n | item_id: ''\n | field_id: ''\n | }\n | 'value' - Any (require). Emiter value to subscribers\n |-------------------------------------------------------------------------------*/\n\n emit(types, destination, value, params) {\n types.split(\" \").forEach(type => {\n const listenerName = type + \":\" + createId(destination);\n let toBeRemovedState = false;\n if (this.subscribers[listenerName]) {\n // if subscribers list is empty we put message to messageBox\n if (this.subscribers[listenerName].size == 0) {\n this.messageBox[listenerName] = [types, destination, value, params, toBeRemovedState];\n return this;\n }\n\n // sending messege to subscribers\n this.subscribers[listenerName].forEach(function (fn) {\n fn(null, value, params);\n });\n } else {\n // if there no subscribers list we put message to messageBox\n this.messageBox[listenerName] = [types, destination, value, params, toBeRemovedState];\n }\n });\n return this;\n }\n\n //============================== ON ROOT PIPE ====================================//\n /*---------------------------------------------------------------------------------\n | Params:\n | 'type' - String (require). type of event ('gh_field_update', ........)\n | from event list or maybe 'gh_field_update gh_field_value_update'\n | 'destination' - Object (require).\n | {\n | app_id: '',\n | item_id: ''\n | field_id: ''\n | }\n | 'fn' - Function (require). callback function\n |---------------------------------------------------------------------------------*/\n\n onRoot(type, destination, fn) {\n return this.on(type, destination, fn);\n }\n\n //=========================== DELETE LISTENER =================================//\n /*-------------------------------------------------------------------------------\n | Params:\n | 'type' - String (require). type of event ('gh_field_update', ........)\n | from eventlist\n | 'destination' - Object (require).\n | {\n | app_id: '',\n | item_id: ''\n | field_id: ''\n | }\n |--------------------------------------------------------------------------------*/\n\n destroy(types, destination, func) {\n types.split(\" \").forEach(type => {\n const listenerName = type + \":\" + createId(destination);\n\n //if we pass a function then we remove just function in subscriber property\n if (this.subscribers[listenerName] && func) {\n this.subscribers[listenerName].delete(func);\n }\n\n //if we are not passing a function then we remove a subscriber property\n if (this.subscribers[listenerName] && !func) {\n delete this.subscribers[listenerName];\n }\n });\n return this;\n }\n\n //============================== MESSAGE BOX ====================================//\n /*---------------------------------------------------------------------------------\n | If emitting event started erlier then subscriber apears then we save it to the MessageBox\n | After subscriber is created we update check MessageBox for encomming messendges\n |\n |---------------------------------------------------------------------------------*/\n\n checkMessageBox(listenerName) {\n //Here we delete all messages those are marked as \"to be removed\"\n this.cleanMesssageBox();\n if (this.messageBox[listenerName]) {\n //-- Emiting messages from the MessageBox\n //We use timeout to emit message after subscriber is created\n setTimeout(() => {\n if (this.messageBox[listenerName]) {\n this.emit(...this.messageBox[listenerName]);\n\n //we mark message after it was readed as \"to be removed\" to remove it in next itration \n this.messageBox[listenerName][4] = true;\n }\n }, 0);\n }\n }\n\n /*-------- CLEAN MESSAGE BOX -----------*/\n // This method delete all messages those are marked as \"to be deleted\"\n // The thing is that we can't remove message in the same iteration that is wy we mark them as \"to be removed\n // and then will remove them in the second iteration just before checking the MessageBox\n cleanMesssageBox() {\n for (let listenerName in this.messageBox) {\n if (this.messageBox[listenerName][4]) {\n delete this.messageBox[listenerName];\n }\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Storage/ModulesList.js\nfunction generateModulesList(async_modules_path, file_server_url, automation_modules_path) {\n return [/* GH ELEMENTS */\n {\n data_type: \"text\",\n name: \"Text\",\n icon: \"text_icon\",\n url: file_server_url + '/' + async_modules_path + \"text_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"text_opt\",\n name: \"Options\",\n icon: \"option_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"text_options_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"number\",\n name: \"Number\",\n icon: \"number\",\n url: file_server_url + '/' + async_modules_path + \"number_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"task_board\",\n name: \"Task Board\",\n icon: \"task_board\",\n url: file_server_url + '/' + async_modules_path + \"task_board_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"visualizer\",\n name: \"visualizer\",\n icon: 'visualizer',\n url: file_server_url + '/' + async_modules_path + \"visualizer_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"enterprice_visualizer\",\n name: \"Enterprice Visualizer\",\n icon: \"visualizer\",\n private: true,\n url: file_server_url + '/' + async_modules_path + \"enterprice_visualizer_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"email\",\n name: \"Email\",\n icon: \"email\",\n url: file_server_url + '/' + async_modules_path + \"email_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'date',\n name: \"Date\",\n icon: \"date_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"date_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'radio_button',\n name: \"Radio Button\",\n icon: \"radio_button_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"radio_button_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'radio_icon',\n name: \"Radio icon\",\n icon: \"radio_icon_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"radio_icon_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'twilio_phone',\n name: \"Twilio Phone\",\n icon: \"phone_twilio_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"twilio_phone_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"twilio_autodialer\",\n name: \"Twilio Auto Dialer\",\n icon: \"twilio_dialer\",\n url: file_server_url + '/' + async_modules_path + \"twillio_autodialer_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"color\",\n name: \"Color\",\n icon: \"paint_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"color_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"charts\",\n name: \"Charts\",\n icon: \"graph_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"charts_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'funnel_chart',\n name: \"Funnel chart\",\n icon: \"funnel_chart_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"funnel_chart_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"add_items_from_template\",\n name: \"Add items from template\",\n icon: \"contact_second\",\n url: file_server_url + '/' + async_modules_path + \"add_items_from_template_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"item_ref\",\n name: \"Reference\",\n icon: \"reference\",\n url: file_server_url + '/' + async_modules_path + \"itemRef_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"calendar\",\n name: 'Calendar',\n icon: 'calendar',\n js: 'https://gudhub.com/modules/FullCalendar-Gh-Element/dist/main.js?t=4',\n css: 'https://gudhub.com/modules/FullCalendar-Gh-Element/dist/style.css?t=1',\n type: 'gh_element',\n technology: \"class\"\n }, {\n data_type: \"data_ref\",\n name: 'Data Reference',\n icon: 'data_reference',\n url: file_server_url + '/' + async_modules_path + \"data_ref_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"table\",\n name: 'Table',\n icon: 'table',\n url: file_server_url + '/' + async_modules_path + \"table_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"tile\",\n name: 'Tile table',\n icon: 'tile_table',\n url: file_server_url + '/' + async_modules_path + \"tile_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"file\",\n name: 'File',\n icon: 'box',\n url: file_server_url + '/' + async_modules_path + \"file_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"image\",\n name: 'Image',\n icon: 'image',\n url: file_server_url + '/' + async_modules_path + \"image_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"text_editor\",\n name: 'Text Editor',\n icon: 'square',\n url: file_server_url + '/' + async_modules_path + \"text_editor_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"tinymse\",\n name: 'Text editor MSE',\n icon: 'tag',\n url: file_server_url + '/' + async_modules_path + \"tinymse_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"duration\",\n name: 'Duration',\n icon: 'number_gh_element',\n url: file_server_url + '/' + async_modules_path + \"duration_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"user\",\n name: 'User',\n icon: 'user_gh_element',\n url: file_server_url + '/' + async_modules_path + \"user_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"app\",\n name: 'App',\n icon: 'app',\n url: file_server_url + '/' + async_modules_path + \"application_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"field\",\n name: 'Field',\n icon: 'field_gh_element',\n url: file_server_url + '/' + async_modules_path + \"field_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"available\",\n name: 'Available',\n icon: 'availible_gh_element',\n url: file_server_url + '/' + async_modules_path + \"available_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"view_list\",\n name: 'View List',\n icon: 'view_list',\n url: file_server_url + '/' + async_modules_path + \"view_list_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"calculator\",\n name: 'Calculator',\n icon: 'calculator',\n url: file_server_url + '/' + async_modules_path + \"calculator_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"string_join\",\n name: 'String Joiner',\n icon: 'string_join_gh_element',\n url: file_server_url + '/' + async_modules_path + \"string_joiner_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"signature\",\n name: 'Signature',\n icon: 'signature',\n url: file_server_url + '/' + async_modules_path + \"signature_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"sendEmail\",\n name: 'Send Email',\n icon: 'send_email_gh_element',\n url: file_server_url + '/' + async_modules_path + \"send_email_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"boolean\",\n name: 'Yes/No',\n icon: 'boolen_gh_element',\n url: file_server_url + '/' + async_modules_path + \"boolean_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"product_gallery\",\n name: 'Product gallery',\n icon: 'product_gallery',\n url: file_server_url + '/' + async_modules_path + \"product_gallery_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"online_inventory\",\n name: 'Online inventory',\n icon: 'slab',\n url: file_server_url + '/' + async_modules_path + \"online_inventory_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"3d_edges\",\n name: '3D Edges',\n icon: '3d_edges_gh_element',\n url: file_server_url + '/' + async_modules_path + \"3d_edges_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"color_list\",\n name: 'Color list',\n icon: 'circular_gh_element',\n url: file_server_url + '/' + async_modules_path + \"color_list_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"go_to_link\",\n name: 'Go to Link',\n icon: 'go_to_link',\n url: file_server_url + '/' + async_modules_path + \"go_to_link_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"go_to_view\",\n name: 'Go to View',\n icon: 'go_to_view',\n url: file_server_url + '/' + async_modules_path + \"go_to_view_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"range\",\n name: 'Range',\n icon: 'range_gh_element',\n url: file_server_url + '/' + async_modules_path + \"range_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"barcode\",\n name: 'Barcode',\n icon: 'barcode_gh_element',\n url: file_server_url + '/' + async_modules_path + \"barcode_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"item_remote_add\",\n name: 'Item remote add',\n icon: 'remote_add_gh_element',\n url: file_server_url + '/' + async_modules_path + \"item_remote_add_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"item_remote_update\",\n name: 'Item remote update',\n icon: 'remote_update_gh_element',\n url: file_server_url + '/' + async_modules_path + \"item_remote_update_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"timeline\",\n name: 'Timeline',\n icon: 'timeline',\n url: file_server_url + '/' + async_modules_path + \"timeline_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"delete_item\",\n name: 'Delete Item',\n icon: 'rubbish',\n url: file_server_url + '/' + async_modules_path + \"delete_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"print_doc\",\n name: 'Print document',\n icon: 'print',\n url: file_server_url + '/' + async_modules_path + \"print_doc_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"open_item\",\n name: 'Open Item',\n icon: 'delete',\n private: true,\n url: file_server_url + '/' + async_modules_path + \"open_item_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"edit_template\",\n name: \"Edit template\",\n icon: \"delete\",\n private: true,\n url: file_server_url + '/' + async_modules_path + \"edit_template_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"open_app\",\n private: true,\n name: 'Open App',\n icon: 'delete',\n url: file_server_url + '/' + async_modules_path + \"open_app_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"user_settings\",\n private: true,\n name: 'User Settings',\n icon: 'delete',\n url: file_server_url + '/' + async_modules_path + \"user_settings_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"app_sharing\",\n name: 'Sharing',\n icon: 'sharing',\n url: file_server_url + '/' + async_modules_path + \"sharing_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"app_constructor\",\n private: true,\n name: 'App constructor',\n icon: 'app_constructor',\n url: file_server_url + '/' + async_modules_path + \"app_constructor_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"app_settings\",\n name: 'App Settings',\n icon: 'configuration',\n url: file_server_url + '/' + async_modules_path + \"app_settings_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"export_csv\",\n name: 'Export CSV',\n icon: 'export_csv',\n url: file_server_url + '/' + async_modules_path + \"export_csv.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"import_csv\",\n name: \"Import CSV\",\n icon: \"import_csv\",\n url: file_server_url + '/' + async_modules_path + \"import_csv.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"add_items\",\n name: 'Add Items',\n icon: 'plus',\n url: file_server_url + '/' + async_modules_path + \"add_items_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"update_items\",\n name: 'Update Items',\n icon: 'update',\n url: file_server_url + '/' + async_modules_path + \"update_items_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"install_app\",\n name: 'Install',\n icon: 'install',\n url: file_server_url + '/' + async_modules_path + \"install_app_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"search_action\",\n name: 'Search',\n icon: 'search',\n url: file_server_url + '/' + async_modules_path + \"search_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"filter_table\",\n name: 'Table filter',\n icon: 'filter',\n url: file_server_url + '/' + async_modules_path + \"filter_table_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"slider\",\n name: 'Slider',\n icon: 'slider',\n url: file_server_url + '/' + async_modules_path + \"slider_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"clone_item\",\n name: 'Clone Item',\n icon: 'double_plus',\n url: file_server_url + '/' + async_modules_path + \"clone_item_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"close\",\n name: 'Close',\n icon: 'cross',\n url: file_server_url + '/' + async_modules_path + \"close_action.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"phone\",\n name: 'Phone',\n icon: 'phone_thin',\n url: file_server_url + '/' + async_modules_path + \"phone_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"link\",\n name: 'Link',\n icon: 'link_gh_element',\n url: file_server_url + '/' + async_modules_path + \"link_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"sheduling\",\n name: 'Sheduling',\n icon: 'scheduling',\n url: file_server_url + '/' + async_modules_path + \"sheduling_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"qrcode\",\n name: 'QR Code',\n icon: 'qr_code',\n url: file_server_url + '/' + async_modules_path + \"qrcode_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"graph2d\",\n name: 'Graph',\n icon: 'graph',\n url: file_server_url + '/' + async_modules_path + \"graph2d_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"quote_tool\",\n name: 'Quote tool',\n icon: 'quoters',\n url: file_server_url + '/' + async_modules_path + \"quote_tool_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"cards\",\n name: 'Cards',\n icon: 'cards',\n url: file_server_url + '/' + async_modules_path + \"cards_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"jsonConstructor\",\n name: 'Json Constructor',\n icon: 'button',\n url: file_server_url + '/' + async_modules_path + \"json_constructor_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"button\",\n name: 'Button',\n icon: 'button',\n js: \"https://gudhub.com/modules/button_action/button_action.js?t=1\",\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: \"editorjs\",\n name: 'EditorJS',\n icon: 'code_editor',\n js: \"https://gudhub.com/modules/Editor-Js/dist/main.js?t=2\",\n css: \"https://gudhub.com/modules/Editor-Js/dist/style.css?t=2\",\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: \"filter_advanced\",\n name: 'Filter Advanced',\n icon: 'filter_advanced',\n url: file_server_url + '/' + async_modules_path + \"filter_advanced_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"code_editor\",\n name: 'Code Editor',\n icon: 'code_editor',\n url: file_server_url + '/' + async_modules_path + \"code_editor_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"icon\",\n name: 'Icon',\n icon: 'icon_gh_element',\n url: file_server_url + '/' + async_modules_path + \"icon_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"quoteRequest\",\n name: 'Quote Request',\n icon: 'invoices',\n url: file_server_url + '/' + async_modules_path + \"quote_request_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"view_container\",\n name: 'View Container',\n icon: 'pencil',\n url: file_server_url + '/' + async_modules_path + \"view_container_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"element_ref\",\n name: \"Element Reference\",\n icon: \"cloudSync_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"element_ref_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"quote_tool_objects_renderer\",\n name: 'Quote Tool Renderer',\n icon: 'l_counter',\n url: file_server_url + '/' + async_modules_path + \"quote_tool_objects_renderer_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"quote_tool_objects_renderer_generator\",\n name: 'Quote Tool Parts Generator',\n icon: 'l_counter_arrow',\n url: file_server_url + '/' + async_modules_path + \"quote_tool_objects_renderer_generator_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"trigger\",\n name: 'Trigger',\n icon: 'job',\n url: file_server_url + '/' + async_modules_path + \"trigger_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"voting\",\n name: 'Voting',\n icon: 'like_gh_element',\n url: file_server_url + '/' + async_modules_path + \"voting_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"view_tabs\",\n name: \"View Tab\",\n icon: \"tabs\",\n url: file_server_url + '/' + async_modules_path + \"view_tabs.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"filter_tabs\",\n name: \"Filter Tabs\",\n icon: \"filter_tabs_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"filter_tabs.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"gps_coords\",\n name: 'GPS Coords',\n icon: 'location_gh_element',\n url: file_server_url + '/' + async_modules_path + \"gps_coords.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"google_map\",\n name: 'Google Map',\n icon: 'location',\n url: file_server_url + '/' + async_modules_path + \"google_map_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"data_migrations\",\n name: \"Data migrations\",\n icon: \"view_list_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"data_migrations.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"additional_settings\",\n name: \"Additional Settings\",\n icon: \"\",\n private: true,\n url: file_server_url + '/' + async_modules_path + \"gh_additional_settings_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"send_request\",\n name: \"Send Request\",\n icon: \"send_request_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"send_request_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"webcam\",\n name: \"Web camera\",\n icon: \"webcam_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"webcam_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"json_viewer\",\n name: \"JSON viewer\",\n icon: \"json_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"json_viewer_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"notifications\",\n name: \"Notifications\",\n icon: \"full_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"notifications_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"api\",\n name: \"API\",\n icon: \"job\",\n url: file_server_url + '/' + async_modules_path + \"api_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"smart_input\",\n name: \"Smart Input\",\n icon: \"roket\",\n url: file_server_url + '/' + async_modules_path + \"smart_input_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"json_editor\",\n name: \"JSON Editor\",\n icon: \"code\",\n url: file_server_url + '/' + async_modules_path + \"json_editor_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"grapes_html_editor\",\n name: 'Grapes Html Editor',\n icon: 'code_editor',\n url: file_server_url + '/' + async_modules_path + \"grapes_html_editor_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"quiz\",\n name: 'Quiz',\n icon: 'quiz_gh_element',\n url: file_server_url + '/' + async_modules_path + \"quiz_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"password_input\",\n name: \"Password\",\n icon: \"lock_gh_element\",\n url: file_server_url + '/' + async_modules_path + \"password_input_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"vs_code\",\n name: 'VS Code',\n icon: 'code_editor',\n url: file_server_url + '/' + async_modules_path + \"vs_code_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"nested_list\",\n name: 'Nested List',\n icon: 'scheduling',\n js: \"https://gudhub.com/modules/Nested-List/dist/main.js?t=2\",\n css: \"https://gudhub.com/modules/Nested-List/dist/style.css?t=2\",\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: \"countertop_smart_quote\",\n name: 'Countertop Smart Quote',\n icon: 'quoters',\n url: file_server_url + '/' + async_modules_path + \"countertop_smart_quote_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: \"markdown_viewer\",\n name: 'Markdown viewer',\n icon: 'code_editor',\n js: \"https://gudhub.com/modules/markdown-it-gh-element/dist/main.js?t=1\",\n css: \"https://gudhub.com/modules/markdown-it-gh-element/dist/style.css?t=1\",\n type: 'gh_element',\n technology: \"class\"\n }, {\n data_type: \"html_viewer\",\n name: 'HTML Viewer',\n icon: 'code_editor',\n js: \"https://gudhub.com/modules/HTML-Viewer/dist/main.js?t=1\",\n css: \"https://gudhub.com/modules/HTML-Viewer/dist/style.css?t=1\",\n type: 'gh_element',\n technology: \"class\"\n }, {\n data_type: \"element_customizer\",\n name: \"Element Customizer\",\n icon: \"pencil\",\n url: file_server_url + '/' + async_modules_path + \"element_customizer_data.js\",\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'task',\n name: 'Task',\n icon: 'table',\n url: file_server_url + '/' + async_modules_path + 'task_data.js',\n type: 'gh_element',\n technology: 'angular'\n }, {\n data_type: 'cron_picker',\n name: 'Cron Picker',\n icon: 'table',\n js: 'https://gudhub.com/modules/Cron-Picker/dist/main.js?t=2',\n css: 'https://gudhub.com/modules/Cron-Picker/dist/style.css?t=2',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'balance_sheet',\n name: 'Balance Sheet',\n icon: 'table',\n js: 'https://gudhub.com/modules/balance-sheet/dist/main.js?t=2',\n css: 'https://gudhub.com/modules/balance-sheet/dist/style.css?t=2',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'quote_form',\n name: 'Quote Form',\n icon: 'table',\n js: 'https://gudhub.com/modules/countertop-quote-form/dist/main.js',\n css: 'https://gudhub.com/modules/countertop-quote-form/dist/style.css',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'static_nested_list',\n name: 'Nested Filter',\n icon: 'scheduling',\n js: 'https://gudhub.com/modules/nested-filter/dist/main.js?t=1',\n css: 'https://gudhub.com/modules/nested-filter/dist/style.css?t=1',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'conversations',\n name: 'Conversations',\n icon: 'timeline',\n js: 'https://gudhub.com/modules/conversation/dist/main.js?t=1',\n css: 'https://gudhub.com/modules/conversation/dist/style.css?t=1',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'study_journal',\n name: 'Study Journal',\n icon: 'timeline',\n js: 'https://gudhub.com/modules/Study-Journal/dist/main.js',\n css: 'https://gudhub.com/modules/Study-Journal/dist/style.css',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'study_schedule',\n name: 'Study Schedule',\n icon: 'timeline',\n js: 'https://gudhub.com/modules/Study-Schedule/dist/main.js?t=1',\n css: 'https://gudhub.com/modules/Study-Schedule/dist/style.css?t=1',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: 'avatar',\n name: 'Avatar',\n icon: 'user',\n js: 'https://gudhub.com/modules/Gh-Avatar/dist/main.js?t=1',\n css: 'https://gudhub.com/modules/Gh-Avatar/dist/style.css?t=1',\n type: 'gh_element',\n technology: 'class'\n }, {\n data_type: \"text_area\",\n name: \"Text Area\",\n icon: \"text_icon\",\n js: \"https://gudhub.com/modules/text-area-ghe/dist/main.js?t=1\",\n css: \"https://gudhub.com/modules/text-area-ghe/dist/style.css\",\n type: \"gh_element\",\n technology: \"class\"\n }, /* AUTOMATION MODULES */\n /*\n We have next types for automations:\n - API\n - GhElement\n - Quiz\n - SmartInput\n - Trigger\n - Task\n - Iterator\n */\n {\n data_type: 'API',\n name: 'API',\n url: file_server_url + '/' + automation_modules_path + 'api_node.js',\n type: 'automation',\n icon: 'automation_api',\n private: true\n }, {\n data_type: 'Calculator',\n name: 'Calculator',\n url: file_server_url + '/' + automation_modules_path + 'calculator.js',\n type: 'automation',\n icon: 'automation_calculator'\n }, {\n data_type: 'CompareItems',\n name: 'Compare Items',\n url: file_server_url + '/' + automation_modules_path + 'compare_items.js',\n type: 'automation',\n icon: 'automation_compare_items'\n }, {\n data_type: 'Constants',\n name: 'Constants',\n url: file_server_url + '/' + automation_modules_path + 'constants.js',\n type: 'automation',\n icon: 'automation_constants'\n }, {\n data_type: 'CreateFiles',\n name: 'Create Files',\n url: file_server_url + '/' + automation_modules_path + 'create_files.js',\n type: 'automation',\n icon: 'automation_create_files'\n }, {\n data_type: 'CreateItemsApi',\n name: 'Create Items Api',\n url: file_server_url + '/' + automation_modules_path + 'create_item_api.js',\n type: 'automation',\n icon: 'automation_create_items_api'\n }, {\n data_type: 'FileDuplicate',\n name: 'File Duplicate',\n url: file_server_url + '/' + automation_modules_path + 'file_duplicate.js',\n type: 'automation',\n icon: 'automation_file_duplicate'\n }, {\n data_type: 'Filter',\n name: 'Filter',\n url: file_server_url + '/' + automation_modules_path + 'filter_node.js',\n type: 'automation',\n icon: 'filter'\n }, {\n data_type: 'GetItemByItemRef',\n name: 'Get Item By Item Ref',\n url: file_server_url + '/' + automation_modules_path + 'get_item_by_item_ref.js',\n type: 'automation',\n icon: 'automation_get_item_by_item_ref'\n }, {\n data_type: 'GetItems',\n name: 'Get Items',\n url: file_server_url + '/' + automation_modules_path + 'get_items.js',\n type: 'automation',\n icon: 'automation_get_items'\n }, {\n data_type: 'GhElementNode',\n name: 'Gh Element Node',\n url: file_server_url + '/' + automation_modules_path + 'gh_element_node.js',\n type: 'automation',\n icon: 'automation_gh_element_node',\n private: true,\n created_for: ['GhElement']\n }, {\n data_type: 'IfCondition',\n name: 'If Condition',\n url: file_server_url + '/' + automation_modules_path + 'if_condition.js',\n type: 'automation',\n icon: 'automation_if_condition'\n }, {\n data_type: 'ItemConstructor',\n name: 'Item Constructor',\n url: file_server_url + '/' + automation_modules_path + 'item_constructor.js',\n type: 'automation',\n icon: 'automation_item_constructor'\n }, {\n data_type: 'ItemDestructor',\n name: 'Item Destructor',\n url: file_server_url + '/' + automation_modules_path + 'item_destructor.js',\n type: 'automation',\n icon: 'automation_item_destructor'\n }, {\n data_type: 'JSONScheme',\n name: 'JSON Scheme',\n url: file_server_url + '/' + automation_modules_path + 'json_scheme.js',\n type: 'automation',\n icon: 'automation_json_scheme'\n }, {\n data_type: 'MergeItems',\n name: 'Merge Items',\n url: file_server_url + '/' + automation_modules_path + 'merge_items.js',\n type: 'automation',\n icon: 'automation_merge_items'\n }, {\n data_type: 'MessageConstructor',\n name: 'Message Constructor',\n url: file_server_url + '/' + automation_modules_path + 'message_constructor.js',\n type: 'automation',\n icon: 'automation_message_constructor'\n }, {\n data_type: 'ObjectToItem',\n name: 'Object To Item',\n url: file_server_url + '/' + automation_modules_path + 'obj_to_item.js',\n type: 'automation',\n icon: 'automation_object_to_item'\n }, {\n data_type: 'ObjectConstructor',\n name: 'Object Constructor',\n url: file_server_url + '/' + automation_modules_path + 'object_constructor.js',\n type: 'automation',\n icon: 'automation_object_constructor'\n }, {\n data_type: 'ObjectDestructor',\n name: 'Object Destructor',\n url: file_server_url + '/' + automation_modules_path + 'object_destructor.js',\n type: 'automation',\n icon: 'automation_object_destructor'\n }, {\n data_type: 'PopulateElement',\n // Available for GH Elements only\n name: 'Populate Element',\n url: file_server_url + '/' + automation_modules_path + 'populate_element.js',\n type: 'automation',\n icon: 'automation_populate_element',\n private: true,\n created_for: ['GhElement']\n }, {\n data_type: 'PopulateItems',\n name: 'Populate Items',\n url: file_server_url + '/' + automation_modules_path + 'populate_items.js',\n type: 'automation',\n icon: 'automation_populate_items'\n }, {\n data_type: 'PopulateWithDate',\n name: 'Populate With Date',\n url: file_server_url + '/' + automation_modules_path + 'populate_with_date.js',\n type: 'automation',\n icon: 'automation_populate_with_date'\n }, {\n data_type: 'PopulateWithItemRef',\n name: 'Populate with Item Ref',\n url: file_server_url + '/' + automation_modules_path + 'populate_with_item_ref.js',\n type: 'automation',\n icon: 'automation_populate_with_item_ref'\n }, {\n data_type: 'PopUpForm',\n // Available for Quiz Node, GH Element, Smart Input\n name: 'Pop Up Form',\n url: file_server_url + '/' + automation_modules_path + 'popup_form.js',\n type: 'automation',\n icon: 'automation_pop_up_form',\n private: true,\n created_for: ['Quiz', 'GhElement', 'SmartInput', 'Iterator']\n }, {\n data_type: 'QuizForm',\n // Available for Quiz Node only\n name: 'Quiz Form',\n url: file_server_url + '/' + automation_modules_path + 'quiz_form.js',\n type: 'automation',\n icon: 'automation_quiz_form',\n private: true,\n created_for: ['Quiz']\n }, {\n data_type: 'QuizNode',\n name: 'Quiz Node',\n url: file_server_url + '/' + automation_modules_path + 'quiz_node.js',\n type: 'automation',\n icon: 'automation_quiz_node',\n private: true\n }, {\n data_type: 'Request',\n name: 'Request',\n url: file_server_url + '/' + automation_modules_path + 'request_node.js',\n type: 'automation',\n icon: 'automation_request'\n }, {\n data_type: 'Response',\n // Available for API only\n name: 'Response',\n url: file_server_url + '/' + automation_modules_path + 'response_node.js',\n type: 'automation',\n icon: 'automation_response',\n private: true,\n created_for: ['API']\n }, {\n data_type: 'SmartInput',\n name: 'Smart Input',\n url: file_server_url + '/' + automation_modules_path + 'smart_input.js',\n type: 'automation',\n icon: 'automation_smart_input',\n private: true\n }, {\n data_type: 'Trigger',\n name: 'Trigger',\n url: file_server_url + '/' + automation_modules_path + 'trigger_node.js',\n type: 'automation',\n icon: 'automation_trigger',\n private: true\n }, {\n data_type: 'TwilioSMS',\n name: 'Twilio SMS',\n url: file_server_url + '/' + automation_modules_path + 'twilio_sms.js',\n type: 'automation',\n icon: 'automation_twilio'\n }, {\n data_type: 'TwilioAuth',\n name: 'Twilio Auth',\n url: file_server_url + '/' + automation_modules_path + 'twilio_auth.js',\n type: 'automation',\n icon: 'table'\n }, {\n data_type: 'TwilioDevice',\n name: 'Twilio Device',\n url: file_server_url + '/' + automation_modules_path + 'twilio_device.js',\n type: 'automation',\n icon: 'table'\n }, {\n data_type: 'UpdateItemsApi',\n name: 'Update Items Api',\n url: file_server_url + '/' + automation_modules_path + 'update_items_api.js',\n type: 'automation',\n icon: 'automation_update_items_api'\n }, {\n data_type: 'GoogleCalendar',\n name: 'Google Calendar',\n url: file_server_url + '/' + automation_modules_path + 'google_calendar.js',\n type: 'automation',\n icon: 'calendar'\n }, {\n data_type: 'VerifyEmail',\n name: 'Verify email',\n url: file_server_url + '/' + automation_modules_path + 'verify_email.js',\n type: 'automation',\n icon: 'check_in_circle'\n }, {\n data_type: 'Iterator',\n name: 'Iterator',\n url: file_server_url + '/' + automation_modules_path + 'iterator.js',\n type: 'automation',\n icon: 'update'\n }, {\n data_type: 'IteratorInput',\n name: 'Iterator Input',\n url: file_server_url + '/' + automation_modules_path + 'iterator_input.js',\n type: 'automation',\n icon: 'arrow_right',\n private: true\n }, {\n data_type: 'IteratorOutput',\n name: 'Iterator Output',\n url: file_server_url + '/' + automation_modules_path + 'iterator_output.js',\n type: 'automation',\n icon: 'arrow_right',\n private: true\n }, {\n data_type: 'SendEmail',\n name: 'Send email',\n url: file_server_url + '/' + automation_modules_path + 'send_email.js',\n type: 'automation',\n icon: 'email'\n }, {\n data_type: 'FileReader',\n name: 'File Reader',\n url: file_server_url + '/' + automation_modules_path + 'file_reader.js',\n type: 'automation',\n icon: 'file'\n }, {\n data_type: 'WebsitesChecker',\n name: 'Websites Checker',\n url: file_server_url + '/' + automation_modules_path + 'websites_checker.js',\n type: 'automation',\n icon: 'world'\n }, {\n data_type: 'VoiceMachineDetection',\n name: 'Voice Machine Detection',\n url: file_server_url + '/' + automation_modules_path + 'voice_machine_detection.js',\n type: 'automation',\n icon: 'automation_calculator'\n }, {\n data_type: 'Task',\n name: 'Task',\n url: file_server_url + '/' + automation_modules_path + 'task.js',\n type: 'automation',\n icon: 'automation_calculator',\n private: true\n }, {\n data_type: 'DeleteItems',\n name: 'Delete Items',\n url: file_server_url + '/' + automation_modules_path + 'delete_items.js',\n type: 'automation',\n icon: 'rubbish'\n }, {\n data_type: 'GoToItem',\n name: 'Go To Item',\n url: file_server_url + '/' + automation_modules_path + 'go_to_item.js',\n type: 'automation',\n icon: 'cursor_point'\n }, {\n data_type: 'FireWorks',\n name: 'Fire Works',\n url: file_server_url + '/' + automation_modules_path + 'fireworks_node.js',\n type: 'automation',\n icon: 'weeding_party'\n }, {\n data_type: 'SendMessage',\n name: 'Send Message',\n url: file_server_url + '/' + automation_modules_path + 'send_message.js',\n type: 'automation',\n icon: 'speech_bubble'\n }, {\n data_type: 'TurboSMS',\n name: 'Turbo SMS',\n url: file_server_url + '/' + automation_modules_path + 'turbo_sms.js',\n type: 'automation',\n icon: 'email'\n }];\n}\n;// CONCATENATED MODULE: ./GUDHUB/Storage/Storage.js\n\nclass Storage {\n constructor(async_modules_path, file_server_url, automation_modules_path) {\n this.apps_list = [];\n this.users_list = [];\n this.user = {};\n this.modulesList = generateModulesList(async_modules_path, file_server_url, automation_modules_path);\n this.ghComponentsPromises = [];\n }\n getMainStorage() {\n return this;\n }\n getAppsList() {\n return this.apps_list;\n }\n getUser() {\n return this.user;\n }\n getUsersList() {\n return this.users_list;\n }\n getModulesList(type, isPrivate, createdFor) {\n if (typeof type === 'undefined') {\n return this.modulesList;\n } else if (isPrivate == false) {\n return this.modulesList.filter(module => {\n if (module.created_for) {\n return module.type === type && module.private && module.created_for.includes(createdFor);\n }\n return module.type === type && !module.private;\n });\n } else {\n return this.modulesList.filter(module => {\n return module.type === type;\n });\n }\n }\n getModuleUrl(module_id) {\n return this.modulesList.find(module => module.data_type == module_id);\n }\n\n //!!!!!!!!!!!!!!******** All Methods below should be moved to AppProcesor and Auth **********!!!!!!!!!!!!!!!!//\n setUser(user) {\n this.user = user;\n this.users_list.push(user);\n }\n updateUser(user = {}) {\n if (user.avatar_128) {\n user.avatar_128 = user.avatar_128 + \"?\" + new Date().getTime();\n }\n if (user.avatar_512) {\n user.avatar_512 = user.avatar_512 + \"?\" + new Date().getTime();\n }\n this.user = {\n ...this.user,\n ...user\n };\n this.users_list = this.users_list.filter(oldUser => oldUser.user_id != user.user_id);\n this.users_list.push(this.user);\n }\n unsetUser() {\n this.user = {};\n }\n getApp(app_id) {\n for (let i = 0; i < this.apps_list.length; i++) {\n if (this.apps_list[i].app_id == app_id) {\n return this.apps_list[i];\n }\n }\n }\n unsetApps() {\n this.apps_list = [];\n }\n\n // addApp(app) {\n // this.apps_list.push(app);\n // return this.apps_list;\n // }\n\n updateApp(newApp) {\n this.apps_list = this.apps_list.map(app => app.app_id == newApp.app_id ? newApp : app);\n return this.apps_list;\n }\n deleteApp(app_id) {\n this.apps_list = this.apps_list.filter(app => app.app_id != app_id);\n return this.apps_list;\n }\n async updateItemsInApp(itemsToUpdate, app_id) {\n const appToUpdate = await this.getApp(app_id);\n if (appToUpdate) {\n appToUpdate.items_list = updateItems(itemsToUpdate, appToUpdate.items_list, this.pipeService.emit.bind(this.pipeService), app_id);\n this.updateApp(appToUpdate);\n }\n return appToUpdate;\n }\n async addItemsToApp(items, app_id) {\n const appToUpdate = await this.getApp(app_id);\n if (appToUpdate) {\n appToUpdate.items_list.push(...items);\n this.updateApp(appToUpdate);\n this.pipeService.emit(\"gh_items_update\", {\n app_id\n }, items);\n }\n return appToUpdate;\n }\n async deleteItemsInApp(itemsToDelete, app_id) {\n const appToUpdate = await this.getApp(app_id);\n if (appToUpdate) {\n appToUpdate.items_list = appToUpdate.items_list.filter(item => !itemsToDelete.find(itemToDelete => itemToDelete.item_id == item.item_id));\n this.updateApp(appToUpdate);\n }\n return appToUpdate;\n }\n}\n// EXTERNAL MODULE: ./node_modules/ws/browser.js\nvar browser = __webpack_require__(7026);\n;// CONCATENATED MODULE: ./GUDHUB/WebSocket/WebSocket.js\n\nclass WebSocketApi {\n constructor(url, auth) {\n this.websocket = null;\n this.connected = false;\n this.queue = [];\n this.url = url;\n this.auth = auth;\n this.heartBeatTimeStemp = 10000000000000;\n this.ALLOWED_HEART_BEAT_DELEY = 12000;\n this.firstHeartBeat = true;\n this.reload = true;\n this.isBrowser = ![typeof window, typeof document].includes(\"undefined\");\n }\n async addSubscription(app_id) {\n //console.log(\"Added new subscription: app_id - \", app_id);\n\n const token = await this.auth.getToken();\n const subscription = `token=${token}/~/app_id=${app_id}`;\n if (this.connected) {\n this.websocket.send(subscription);\n }\n this.queue.push(app_id);\n }\n async onOpen() {\n this.reload = true;\n console.log(\"websocket opened\");\n this.connected = true;\n const token = await this.auth.getToken();\n this.queue.forEach(queue => {\n const subscription = `token=${token}/~/app_id=${queue}`;\n this.websocket.send(subscription);\n });\n }\n onError(error) {\n console.log(\"websocket error: \", error);\n this.websocket.close();\n }\n onClose() {\n console.log(\"websocket close\");\n this.connected = false;\n try {\n this.initWebSocket(this.onMassageHandler, this.refreshAppsHandler);\n } catch (error) {\n console.log(error);\n }\n }\n async onMessage(event) {\n const message = this.isBrowser ? event.data : event;\n if (message.match(/HeartBeat/)) {\n const hartBeatDelay = new Date().getTime() - this.heartBeatTimeStemp;\n if (this.ALLOWED_HEART_BEAT_DELEY < hartBeatDelay) {\n await this.onConnectionLost();\n } else {\n this.websocket.send(\"HeartBeat\");\n this.heartBeatTimeStemp = new Date().getTime();\n }\n }\n if (this.firstHeartBeat) {\n this.connectionChecker();\n this.firstHeartBeat = false;\n }\n if (message.match(/[{}]/)) {\n let incomeMessage = JSON.parse(message);\n const token = await this.auth.getToken();\n\n //-- We don't want to update storage of user who initieted the update. That is why we check if token from websocket is not the same as users token.\n if (incomeMessage.token != token) {\n this.onMassageHandler(incomeMessage);\n }\n }\n }\n initWebSocket(onMassageHandler, refreshAppsHandler) {\n this.onMassageHandler = onMassageHandler;\n this.refreshAppsHandler = refreshAppsHandler;\n if (this.isBrowser) {\n this.websocket = new WebSocket(this.url);\n this.websocket.onopen = this.onOpen.bind(this);\n this.websocket.onerror = this.onError.bind(this);\n this.websocket.onclose = this.onClose.bind(this);\n this.websocket.onmessage = this.onMessage.bind(this);\n } else {\n this.websocket = new browser(this.url);\n this.websocket.on(\"open\", this.onOpen);\n this.websocket.on(\"error\", this.onError);\n this.websocket.on(\"close\", this.onClose);\n this.websocket.on(\"message\", this.onMessage);\n }\n console.log(\"websocket initialized\");\n }\n connectionChecker() {\n setInterval(async () => {\n let hartBeatDelay = new Date().getTime() - this.heartBeatTimeStemp;\n // console.log(hartBeatDelay, this.ALLOWED_HEART_BEAT_DELEY, \"interval\");\n if (this.ALLOWED_HEART_BEAT_DELEY < hartBeatDelay) {\n await this.onConnectionLost();\n }\n }, 1000);\n }\n async onConnectionLost() {\n try {\n await this.auth.getVersion();\n if (this.reload) {\n this.reload = false;\n console.log(\"Connected\");\n this.heartBeatTimeStemp = 10000000000000;\n this.websocket.close();\n // Should be uncommented after websocket is fixed\n // this.refreshAppsHandler(this.queue);\n }\n } catch (error) {\n console.log(error);\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/filterPreparation.js\nasync function filterPreparation(filters_list, storage, pipeService, variables = {}) {\n const filterArray = [];\n const objectMethod = {\n variableMethodcurrent_app() {\n return [variables.current_app_id || variables.app_id];\n },\n variableMethodelement_app() {\n return [variables.element_app_id];\n },\n variableMethodcurrent_item() {\n const currentValue = `${variables.current_app_id || variables.app_id}.${variables.item_id}`;\n return [currentValue];\n },\n variableMethoduser_id() {\n const storage_user = storage.getUser();\n return [storage_user.user_id];\n },\n variableMethoduser_email(filter) {\n const storage_user = storage.getUser();\n return [storage_user.username];\n },\n variableMethodtoday(filter) {\n const date = new Date();\n const start_date = new Date(date.getFullYear(), date.getMonth(), date.getDate());\n const end_date = new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1);\n const result = start_date.valueOf().toString() + \":\" + end_date.valueOf().toString();\n return [result];\n },\n variableMethodvariable(property) {\n return [variables[property]];\n }\n };\n if (filters_list) {\n for (const filter of filters_list) {\n if (filter) {\n // ---------------------- WARNING !!! -------------------------------\n // Should be fixed: modification of filters_list valuesArray\n switch (filter.input_type) {\n case \"variable\":\n filter.valuesArray = [];\n for (const filterValue of filter?.input_value.split(',')) {\n const functionName = filter.input_type + \"Method\" + filterValue;\n const func = objectMethod[functionName];\n if (typeof func === \"function\") {\n if (!filter.valuesArray) {\n filter.valuesArray = func();\n } else {\n filter.valuesArray.push(...func());\n }\n } else {\n if (!filter.valuesArray) {\n filter.valuesArray = objectMethod.variableMethodvariable(filterValue);\n } else {\n filter.valuesArray.push(...objectMethod.variableMethodvariable(filterValue));\n }\n }\n }\n filterArray.push(filter);\n break;\n case \"field\":\n const field_value = await fieldMethod({\n app_id: variables.current_app_id || variables.app_id,\n item_id: variables.item_id,\n field_id: filter.input_value\n });\n if (field_value != null) {\n filter.valuesArray.push(field_value);\n }\n filterArray.push(filter);\n break;\n default:\n filterArray.push(filter);\n break;\n }\n } else {\n filterArray.push(filter);\n }\n }\n }\n function fieldMethod(address) {\n return new Promise(resolve => {\n pipeService.on(\"gh_value_get\", address, function ghValueGet(event, field_value) {\n pipeService.destroy(\"gh_value_get\", address, ghValueGet);\n resolve(field_value);\n }).emit(\"gh_value_get\", {}, address);\n });\n }\n return filterArray;\n}\n;// CONCATENATED MODULE: ./node_modules/fuse.js/dist/fuse.esm.js\n/**\n * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)\n *\n * Copyright (c) 2022 Kiro Risk (http://kiro.me)\n * All Rights Reserved. Apache Software License 2.0\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfunction isArray(value) {\n return !Array.isArray\n ? getTag(value) === '[object Array]'\n : Array.isArray(value)\n}\n\n// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js\nconst INFINITY = 1 / 0;\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value\n }\n let result = value + '';\n return result == '0' && 1 / value == -INFINITY ? '-0' : result\n}\n\nfunction fuse_esm_toString(value) {\n return value == null ? '' : baseToString(value)\n}\n\nfunction isString(value) {\n return typeof value === 'string'\n}\n\nfunction isNumber(value) {\n return typeof value === 'number'\n}\n\n// Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js\nfunction isBoolean(value) {\n return (\n value === true ||\n value === false ||\n (isObjectLike(value) && getTag(value) == '[object Boolean]')\n )\n}\n\nfunction isObject(value) {\n return typeof value === 'object'\n}\n\n// Checks if `value` is object-like.\nfunction isObjectLike(value) {\n return isObject(value) && value !== null\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null\n}\n\nfunction isBlank(value) {\n return !value.trim().length\n}\n\n// Gets the `toStringTag` of `value`.\n// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js\nfunction getTag(value) {\n return value == null\n ? value === undefined\n ? '[object Undefined]'\n : '[object Null]'\n : Object.prototype.toString.call(value)\n}\n\nconst EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';\n\nconst INCORRECT_INDEX_TYPE = \"Incorrect 'index' type\";\n\nconst LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) =>\n `Invalid value for key ${key}`;\n\nconst PATTERN_LENGTH_TOO_LARGE = (max) =>\n `Pattern length exceeds max of ${max}.`;\n\nconst MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;\n\nconst INVALID_KEY_WEIGHT_VALUE = (key) =>\n `Property 'weight' in key '${key}' must be a positive integer`;\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nclass KeyStore {\n constructor(keys) {\n this._keys = [];\n this._keyMap = {};\n\n let totalWeight = 0;\n\n keys.forEach((key) => {\n let obj = createKey(key);\n\n totalWeight += obj.weight;\n\n this._keys.push(obj);\n this._keyMap[obj.id] = obj;\n\n totalWeight += obj.weight;\n });\n\n // Normalize weights so that their sum is equal to 1\n this._keys.forEach((key) => {\n key.weight /= totalWeight;\n });\n }\n get(keyId) {\n return this._keyMap[keyId]\n }\n keys() {\n return this._keys\n }\n toJSON() {\n return JSON.stringify(this._keys)\n }\n}\n\nfunction createKey(key) {\n let path = null;\n let id = null;\n let src = null;\n let weight = 1;\n let getFn = null;\n\n if (isString(key) || isArray(key)) {\n src = key;\n path = createKeyPath(key);\n id = createKeyId(key);\n } else {\n if (!hasOwn.call(key, 'name')) {\n throw new Error(MISSING_KEY_PROPERTY('name'))\n }\n\n const name = key.name;\n src = name;\n\n if (hasOwn.call(key, 'weight')) {\n weight = key.weight;\n\n if (weight <= 0) {\n throw new Error(INVALID_KEY_WEIGHT_VALUE(name))\n }\n }\n\n path = createKeyPath(name);\n id = createKeyId(name);\n getFn = key.getFn;\n }\n\n return { path, id, weight, src, getFn }\n}\n\nfunction createKeyPath(key) {\n return isArray(key) ? key : key.split('.')\n}\n\nfunction createKeyId(key) {\n return isArray(key) ? key.join('.') : key\n}\n\nfunction get(obj, path) {\n let list = [];\n let arr = false;\n\n const deepGet = (obj, path, index) => {\n if (!isDefined(obj)) {\n return\n }\n if (!path[index]) {\n // If there's no path left, we've arrived at the object we care about.\n list.push(obj);\n } else {\n let key = path[index];\n\n const value = obj[key];\n\n if (!isDefined(value)) {\n return\n }\n\n // If we're at the last value in the path, and if it's a string/number/bool,\n // add it to the list\n if (\n index === path.length - 1 &&\n (isString(value) || isNumber(value) || isBoolean(value))\n ) {\n list.push(fuse_esm_toString(value));\n } else if (isArray(value)) {\n arr = true;\n // Search each item in the array.\n for (let i = 0, len = value.length; i < len; i += 1) {\n deepGet(value[i], path, index + 1);\n }\n } else if (path.length) {\n // An object. Recurse further.\n deepGet(value, path, index + 1);\n }\n }\n };\n\n // Backwards compatibility (since path used to be a string)\n deepGet(obj, isString(path) ? path.split('.') : path, 0);\n\n return arr ? list : list[0]\n}\n\nconst MatchOptions = {\n // Whether the matches should be included in the result set. When `true`, each record in the result\n // set will include the indices of the matched characters.\n // These can consequently be used for highlighting purposes.\n includeMatches: false,\n // When `true`, the matching function will continue to the end of a search pattern even if\n // a perfect match has already been located in the string.\n findAllMatches: false,\n // Minimum number of characters that must be matched before a result is considered a match\n minMatchCharLength: 1\n};\n\nconst BasicOptions = {\n // When `true`, the algorithm continues searching to the end of the input even if a perfect\n // match is found before the end of the same input.\n isCaseSensitive: false,\n // When true, the matching function will continue to the end of a search pattern even if\n includeScore: false,\n // List of properties that will be searched. This also supports nested properties.\n keys: [],\n // Whether to sort the result list, by score\n shouldSort: true,\n // Default sort function: sort by ascending score, ascending index\n sortFn: (a, b) =>\n a.score === b.score ? (a.idx < b.idx ? -1 : 1) : a.score < b.score ? -1 : 1\n};\n\nconst FuzzyOptions = {\n // Approximately where in the text is the pattern expected to be found?\n location: 0,\n // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match\n // (of both letters and location), a threshold of '1.0' would match anything.\n threshold: 0.6,\n // Determines how close the match must be to the fuzzy location (specified above).\n // An exact letter match which is 'distance' characters away from the fuzzy location\n // would score as a complete mismatch. A distance of '0' requires the match be at\n // the exact location specified, a threshold of '1000' would require a perfect match\n // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.\n distance: 100\n};\n\nconst AdvancedOptions = {\n // When `true`, it enables the use of unix-like search commands\n useExtendedSearch: false,\n // The get function to use when fetching an object's properties.\n // The default will search nested paths *ie foo.bar.baz*\n getFn: get,\n // When `true`, search will ignore `location` and `distance`, so it won't matter\n // where in the string the pattern appears.\n // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score\n ignoreLocation: false,\n // When `true`, the calculation for the relevance score (used for sorting) will\n // ignore the field-length norm.\n // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm\n ignoreFieldNorm: false,\n // The weight to determine how much field length norm effects scoring.\n fieldNormWeight: 1\n};\n\nvar Config = {\n ...BasicOptions,\n ...MatchOptions,\n ...FuzzyOptions,\n ...AdvancedOptions\n};\n\nconst SPACE = /[^ ]+/g;\n\n// Field-length norm: the shorter the field, the higher the weight.\n// Set to 3 decimals to reduce index size.\nfunction norm(weight = 1, mantissa = 3) {\n const cache = new Map();\n const m = Math.pow(10, mantissa);\n\n return {\n get(value) {\n const numTokens = value.match(SPACE).length;\n\n if (cache.has(numTokens)) {\n return cache.get(numTokens)\n }\n\n // Default function is 1/sqrt(x), weight makes that variable\n const norm = 1 / Math.pow(numTokens, 0.5 * weight);\n\n // In place of `toFixed(mantissa)`, for faster computation\n const n = parseFloat(Math.round(norm * m) / m);\n\n cache.set(numTokens, n);\n\n return n\n },\n clear() {\n cache.clear();\n }\n }\n}\n\nclass FuseIndex {\n constructor({\n getFn = Config.getFn,\n fieldNormWeight = Config.fieldNormWeight\n } = {}) {\n this.norm = norm(fieldNormWeight, 3);\n this.getFn = getFn;\n this.isCreated = false;\n\n this.setIndexRecords();\n }\n setSources(docs = []) {\n this.docs = docs;\n }\n setIndexRecords(records = []) {\n this.records = records;\n }\n setKeys(keys = []) {\n this.keys = keys;\n this._keysMap = {};\n keys.forEach((key, idx) => {\n this._keysMap[key.id] = idx;\n });\n }\n create() {\n if (this.isCreated || !this.docs.length) {\n return\n }\n\n this.isCreated = true;\n\n // List is Array<String>\n if (isString(this.docs[0])) {\n this.docs.forEach((doc, docIndex) => {\n this._addString(doc, docIndex);\n });\n } else {\n // List is Array<Object>\n this.docs.forEach((doc, docIndex) => {\n this._addObject(doc, docIndex);\n });\n }\n\n this.norm.clear();\n }\n // Adds a doc to the end of the index\n add(doc) {\n const idx = this.size();\n\n if (isString(doc)) {\n this._addString(doc, idx);\n } else {\n this._addObject(doc, idx);\n }\n }\n // Removes the doc at the specified index of the index\n removeAt(idx) {\n this.records.splice(idx, 1);\n\n // Change ref index of every subsquent doc\n for (let i = idx, len = this.size(); i < len; i += 1) {\n this.records[i].i -= 1;\n }\n }\n getValueForItemAtKeyId(item, keyId) {\n return item[this._keysMap[keyId]]\n }\n size() {\n return this.records.length\n }\n _addString(doc, docIndex) {\n if (!isDefined(doc) || isBlank(doc)) {\n return\n }\n\n let record = {\n v: doc,\n i: docIndex,\n n: this.norm.get(doc)\n };\n\n this.records.push(record);\n }\n _addObject(doc, docIndex) {\n let record = { i: docIndex, $: {} };\n\n // Iterate over every key (i.e, path), and fetch the value at that key\n this.keys.forEach((key, keyIndex) => {\n let value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path);\n\n if (!isDefined(value)) {\n return\n }\n\n if (isArray(value)) {\n let subRecords = [];\n const stack = [{ nestedArrIndex: -1, value }];\n\n while (stack.length) {\n const { nestedArrIndex, value } = stack.pop();\n\n if (!isDefined(value)) {\n continue\n }\n\n if (isString(value) && !isBlank(value)) {\n let subRecord = {\n v: value,\n i: nestedArrIndex,\n n: this.norm.get(value)\n };\n\n subRecords.push(subRecord);\n } else if (isArray(value)) {\n value.forEach((item, k) => {\n stack.push({\n nestedArrIndex: k,\n value: item\n });\n });\n } else ;\n }\n record.$[keyIndex] = subRecords;\n } else if (isString(value) && !isBlank(value)) {\n let subRecord = {\n v: value,\n n: this.norm.get(value)\n };\n\n record.$[keyIndex] = subRecord;\n }\n });\n\n this.records.push(record);\n }\n toJSON() {\n return {\n keys: this.keys,\n records: this.records\n }\n }\n}\n\nfunction createIndex(\n keys,\n docs,\n { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}\n) {\n const myIndex = new FuseIndex({ getFn, fieldNormWeight });\n myIndex.setKeys(keys.map(createKey));\n myIndex.setSources(docs);\n myIndex.create();\n return myIndex\n}\n\nfunction parseIndex(\n data,\n { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}\n) {\n const { keys, records } = data;\n const myIndex = new FuseIndex({ getFn, fieldNormWeight });\n myIndex.setKeys(keys);\n myIndex.setIndexRecords(records);\n return myIndex\n}\n\nfunction computeScore$1(\n pattern,\n {\n errors = 0,\n currentLocation = 0,\n expectedLocation = 0,\n distance = Config.distance,\n ignoreLocation = Config.ignoreLocation\n } = {}\n) {\n const accuracy = errors / pattern.length;\n\n if (ignoreLocation) {\n return accuracy\n }\n\n const proximity = Math.abs(expectedLocation - currentLocation);\n\n if (!distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy\n }\n\n return accuracy + proximity / distance\n}\n\nfunction convertMaskToIndices(\n matchmask = [],\n minMatchCharLength = Config.minMatchCharLength\n) {\n let indices = [];\n let start = -1;\n let end = -1;\n let i = 0;\n\n for (let len = matchmask.length; i < len; i += 1) {\n let match = matchmask[i];\n if (match && start === -1) {\n start = i;\n } else if (!match && start !== -1) {\n end = i - 1;\n if (end - start + 1 >= minMatchCharLength) {\n indices.push([start, end]);\n }\n start = -1;\n }\n }\n\n // (i-1 - start) + 1 => i - start\n if (matchmask[i - 1] && i - start >= minMatchCharLength) {\n indices.push([start, i - 1]);\n }\n\n return indices\n}\n\n// Machine word size\nconst MAX_BITS = 32;\n\nfunction search(\n text,\n pattern,\n patternAlphabet,\n {\n location = Config.location,\n distance = Config.distance,\n threshold = Config.threshold,\n findAllMatches = Config.findAllMatches,\n minMatchCharLength = Config.minMatchCharLength,\n includeMatches = Config.includeMatches,\n ignoreLocation = Config.ignoreLocation\n } = {}\n) {\n if (pattern.length > MAX_BITS) {\n throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS))\n }\n\n const patternLen = pattern.length;\n // Set starting location at beginning text and initialize the alphabet.\n const textLen = text.length;\n // Handle the case when location > text.length\n const expectedLocation = Math.max(0, Math.min(location, textLen));\n // Highest score beyond which we give up.\n let currentThreshold = threshold;\n // Is there a nearby exact match? (speedup)\n let bestLocation = expectedLocation;\n\n // Performance: only computer matches when the minMatchCharLength > 1\n // OR if `includeMatches` is true.\n const computeMatches = minMatchCharLength > 1 || includeMatches;\n // A mask of the matches, used for building the indices\n const matchMask = computeMatches ? Array(textLen) : [];\n\n let index;\n\n // Get all exact matches, here for speed up\n while ((index = text.indexOf(pattern, bestLocation)) > -1) {\n let score = computeScore$1(pattern, {\n currentLocation: index,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n currentThreshold = Math.min(score, currentThreshold);\n bestLocation = index + patternLen;\n\n if (computeMatches) {\n let i = 0;\n while (i < patternLen) {\n matchMask[index + i] = 1;\n i += 1;\n }\n }\n }\n\n // Reset the best location\n bestLocation = -1;\n\n let lastBitArr = [];\n let finalScore = 1;\n let binMax = patternLen + textLen;\n\n const mask = 1 << (patternLen - 1);\n\n for (let i = 0; i < patternLen; i += 1) {\n // Scan for the best match; each iteration allows for one more error.\n // Run a binary search to determine how far from the match location we can stray\n // at this error level.\n let binMin = 0;\n let binMid = binMax;\n\n while (binMin < binMid) {\n const score = computeScore$1(pattern, {\n errors: i,\n currentLocation: expectedLocation + binMid,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n if (score <= currentThreshold) {\n binMin = binMid;\n } else {\n binMax = binMid;\n }\n\n binMid = Math.floor((binMax - binMin) / 2 + binMin);\n }\n\n // Use the result from this iteration as the maximum for the next.\n binMax = binMid;\n\n let start = Math.max(1, expectedLocation - binMid + 1);\n let finish = findAllMatches\n ? textLen\n : Math.min(expectedLocation + binMid, textLen) + patternLen;\n\n // Initialize the bit array\n let bitArr = Array(finish + 2);\n\n bitArr[finish + 1] = (1 << i) - 1;\n\n for (let j = finish; j >= start; j -= 1) {\n let currentLocation = j - 1;\n let charMatch = patternAlphabet[text.charAt(currentLocation)];\n\n if (computeMatches) {\n // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)\n matchMask[currentLocation] = +!!charMatch;\n }\n\n // First pass: exact match\n bitArr[j] = ((bitArr[j + 1] << 1) | 1) & charMatch;\n\n // Subsequent passes: fuzzy match\n if (i) {\n bitArr[j] |=\n ((lastBitArr[j + 1] | lastBitArr[j]) << 1) | 1 | lastBitArr[j + 1];\n }\n\n if (bitArr[j] & mask) {\n finalScore = computeScore$1(pattern, {\n errors: i,\n currentLocation,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n // This match will almost certainly be better than any existing match.\n // But check anyway.\n if (finalScore <= currentThreshold) {\n // Indeed it is\n currentThreshold = finalScore;\n bestLocation = currentLocation;\n\n // Already passed `loc`, downhill from here on in.\n if (bestLocation <= expectedLocation) {\n break\n }\n\n // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.\n start = Math.max(1, 2 * expectedLocation - bestLocation);\n }\n }\n }\n\n // No hope for a (better) match at greater error levels.\n const score = computeScore$1(pattern, {\n errors: i + 1,\n currentLocation: expectedLocation,\n expectedLocation,\n distance,\n ignoreLocation\n });\n\n if (score > currentThreshold) {\n break\n }\n\n lastBitArr = bitArr;\n }\n\n const result = {\n isMatch: bestLocation >= 0,\n // Count exact matches (those with a score of 0) to be \"almost\" exact\n score: Math.max(0.001, finalScore)\n };\n\n if (computeMatches) {\n const indices = convertMaskToIndices(matchMask, minMatchCharLength);\n if (!indices.length) {\n result.isMatch = false;\n } else if (includeMatches) {\n result.indices = indices;\n }\n }\n\n return result\n}\n\nfunction createPatternAlphabet(pattern) {\n let mask = {};\n\n for (let i = 0, len = pattern.length; i < len; i += 1) {\n const char = pattern.charAt(i);\n mask[char] = (mask[char] || 0) | (1 << (len - i - 1));\n }\n\n return mask\n}\n\nclass BitapSearch {\n constructor(\n pattern,\n {\n location = Config.location,\n threshold = Config.threshold,\n distance = Config.distance,\n includeMatches = Config.includeMatches,\n findAllMatches = Config.findAllMatches,\n minMatchCharLength = Config.minMatchCharLength,\n isCaseSensitive = Config.isCaseSensitive,\n ignoreLocation = Config.ignoreLocation\n } = {}\n ) {\n this.options = {\n location,\n threshold,\n distance,\n includeMatches,\n findAllMatches,\n minMatchCharLength,\n isCaseSensitive,\n ignoreLocation\n };\n\n this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n\n this.chunks = [];\n\n if (!this.pattern.length) {\n return\n }\n\n const addChunk = (pattern, startIndex) => {\n this.chunks.push({\n pattern,\n alphabet: createPatternAlphabet(pattern),\n startIndex\n });\n };\n\n const len = this.pattern.length;\n\n if (len > MAX_BITS) {\n let i = 0;\n const remainder = len % MAX_BITS;\n const end = len - remainder;\n\n while (i < end) {\n addChunk(this.pattern.substr(i, MAX_BITS), i);\n i += MAX_BITS;\n }\n\n if (remainder) {\n const startIndex = len - MAX_BITS;\n addChunk(this.pattern.substr(startIndex), startIndex);\n }\n } else {\n addChunk(this.pattern, 0);\n }\n }\n\n searchIn(text) {\n const { isCaseSensitive, includeMatches } = this.options;\n\n if (!isCaseSensitive) {\n text = text.toLowerCase();\n }\n\n // Exact match\n if (this.pattern === text) {\n let result = {\n isMatch: true,\n score: 0\n };\n\n if (includeMatches) {\n result.indices = [[0, text.length - 1]];\n }\n\n return result\n }\n\n // Otherwise, use Bitap algorithm\n const {\n location,\n distance,\n threshold,\n findAllMatches,\n minMatchCharLength,\n ignoreLocation\n } = this.options;\n\n let allIndices = [];\n let totalScore = 0;\n let hasMatches = false;\n\n this.chunks.forEach(({ pattern, alphabet, startIndex }) => {\n const { isMatch, score, indices } = search(text, pattern, alphabet, {\n location: location + startIndex,\n distance,\n threshold,\n findAllMatches,\n minMatchCharLength,\n includeMatches,\n ignoreLocation\n });\n\n if (isMatch) {\n hasMatches = true;\n }\n\n totalScore += score;\n\n if (isMatch && indices) {\n allIndices = [...allIndices, ...indices];\n }\n });\n\n let result = {\n isMatch: hasMatches,\n score: hasMatches ? totalScore / this.chunks.length : 1\n };\n\n if (hasMatches && includeMatches) {\n result.indices = allIndices;\n }\n\n return result\n }\n}\n\nclass BaseMatch {\n constructor(pattern) {\n this.pattern = pattern;\n }\n static isMultiMatch(pattern) {\n return getMatch(pattern, this.multiRegex)\n }\n static isSingleMatch(pattern) {\n return getMatch(pattern, this.singleRegex)\n }\n search(/*text*/) {}\n}\n\nfunction getMatch(pattern, exp) {\n const matches = pattern.match(exp);\n return matches ? matches[1] : null\n}\n\n// Token: 'file\n\nclass ExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'exact'\n }\n static get multiRegex() {\n return /^=\"(.*)\"$/\n }\n static get singleRegex() {\n return /^=(.*)$/\n }\n search(text) {\n const isMatch = text === this.pattern;\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, this.pattern.length - 1]\n }\n }\n}\n\n// Token: !fire\n\nclass InverseExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'inverse-exact'\n }\n static get multiRegex() {\n return /^!\"(.*)\"$/\n }\n static get singleRegex() {\n return /^!(.*)$/\n }\n search(text) {\n const index = text.indexOf(this.pattern);\n const isMatch = index === -1;\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, text.length - 1]\n }\n }\n}\n\n// Token: ^file\n\nclass PrefixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'prefix-exact'\n }\n static get multiRegex() {\n return /^\\^\"(.*)\"$/\n }\n static get singleRegex() {\n return /^\\^(.*)$/\n }\n search(text) {\n const isMatch = text.startsWith(this.pattern);\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, this.pattern.length - 1]\n }\n }\n}\n\n// Token: !^fire\n\nclass InversePrefixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'inverse-prefix-exact'\n }\n static get multiRegex() {\n return /^!\\^\"(.*)\"$/\n }\n static get singleRegex() {\n return /^!\\^(.*)$/\n }\n search(text) {\n const isMatch = !text.startsWith(this.pattern);\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, text.length - 1]\n }\n }\n}\n\n// Token: .file$\n\nclass SuffixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'suffix-exact'\n }\n static get multiRegex() {\n return /^\"(.*)\"\\$$/\n }\n static get singleRegex() {\n return /^(.*)\\$$/\n }\n search(text) {\n const isMatch = text.endsWith(this.pattern);\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [text.length - this.pattern.length, text.length - 1]\n }\n }\n}\n\n// Token: !.file$\n\nclass InverseSuffixExactMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'inverse-suffix-exact'\n }\n static get multiRegex() {\n return /^!\"(.*)\"\\$$/\n }\n static get singleRegex() {\n return /^!(.*)\\$$/\n }\n search(text) {\n const isMatch = !text.endsWith(this.pattern);\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices: [0, text.length - 1]\n }\n }\n}\n\nclass FuzzyMatch extends BaseMatch {\n constructor(\n pattern,\n {\n location = Config.location,\n threshold = Config.threshold,\n distance = Config.distance,\n includeMatches = Config.includeMatches,\n findAllMatches = Config.findAllMatches,\n minMatchCharLength = Config.minMatchCharLength,\n isCaseSensitive = Config.isCaseSensitive,\n ignoreLocation = Config.ignoreLocation\n } = {}\n ) {\n super(pattern);\n this._bitapSearch = new BitapSearch(pattern, {\n location,\n threshold,\n distance,\n includeMatches,\n findAllMatches,\n minMatchCharLength,\n isCaseSensitive,\n ignoreLocation\n });\n }\n static get type() {\n return 'fuzzy'\n }\n static get multiRegex() {\n return /^\"(.*)\"$/\n }\n static get singleRegex() {\n return /^(.*)$/\n }\n search(text) {\n return this._bitapSearch.searchIn(text)\n }\n}\n\n// Token: 'file\n\nclass IncludeMatch extends BaseMatch {\n constructor(pattern) {\n super(pattern);\n }\n static get type() {\n return 'include'\n }\n static get multiRegex() {\n return /^'\"(.*)\"$/\n }\n static get singleRegex() {\n return /^'(.*)$/\n }\n search(text) {\n let location = 0;\n let index;\n\n const indices = [];\n const patternLen = this.pattern.length;\n\n // Get all exact matches\n while ((index = text.indexOf(this.pattern, location)) > -1) {\n location = index + patternLen;\n indices.push([index, location - 1]);\n }\n\n const isMatch = !!indices.length;\n\n return {\n isMatch,\n score: isMatch ? 0 : 1,\n indices\n }\n }\n}\n\n// ❗Order is important. DO NOT CHANGE.\nconst searchers = [\n ExactMatch,\n IncludeMatch,\n PrefixExactMatch,\n InversePrefixExactMatch,\n InverseSuffixExactMatch,\n SuffixExactMatch,\n InverseExactMatch,\n FuzzyMatch\n];\n\nconst searchersLen = searchers.length;\n\n// Regex to split by spaces, but keep anything in quotes together\nconst SPACE_RE = / +(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)/;\nconst OR_TOKEN = '|';\n\n// Return a 2D array representation of the query, for simpler parsing.\n// Example:\n// \"^core go$ | rb$ | py$ xy$\" => [[\"^core\", \"go$\"], [\"rb$\"], [\"py$\", \"xy$\"]]\nfunction parseQuery(pattern, options = {}) {\n return pattern.split(OR_TOKEN).map((item) => {\n let query = item\n .trim()\n .split(SPACE_RE)\n .filter((item) => item && !!item.trim());\n\n let results = [];\n for (let i = 0, len = query.length; i < len; i += 1) {\n const queryItem = query[i];\n\n // 1. Handle multiple query match (i.e, once that are quoted, like `\"hello world\"`)\n let found = false;\n let idx = -1;\n while (!found && ++idx < searchersLen) {\n const searcher = searchers[idx];\n let token = searcher.isMultiMatch(queryItem);\n if (token) {\n results.push(new searcher(token, options));\n found = true;\n }\n }\n\n if (found) {\n continue\n }\n\n // 2. Handle single query matches (i.e, once that are *not* quoted)\n idx = -1;\n while (++idx < searchersLen) {\n const searcher = searchers[idx];\n let token = searcher.isSingleMatch(queryItem);\n if (token) {\n results.push(new searcher(token, options));\n break\n }\n }\n }\n\n return results\n })\n}\n\n// These extended matchers can return an array of matches, as opposed\n// to a singl match\nconst MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]);\n\n/**\n * Command-like searching\n * ======================\n *\n * Given multiple search terms delimited by spaces.e.g. `^jscript .python$ ruby !java`,\n * search in a given text.\n *\n * Search syntax:\n *\n * | Token | Match type | Description |\n * | ----------- | -------------------------- | -------------------------------------- |\n * | `jscript` | fuzzy-match | Items that fuzzy match `jscript` |\n * | `=scheme` | exact-match | Items that are `scheme` |\n * | `'python` | include-match | Items that include `python` |\n * | `!ruby` | inverse-exact-match | Items that do not include `ruby` |\n * | `^java` | prefix-exact-match | Items that start with `java` |\n * | `!^earlang` | inverse-prefix-exact-match | Items that do not start with `earlang` |\n * | `.js$` | suffix-exact-match | Items that end with `.js` |\n * | `!.go$` | inverse-suffix-exact-match | Items that do not end with `.go` |\n *\n * A single pipe character acts as an OR operator. For example, the following\n * query matches entries that start with `core` and end with either`go`, `rb`,\n * or`py`.\n *\n * ```\n * ^core go$ | rb$ | py$\n * ```\n */\nclass ExtendedSearch {\n constructor(\n pattern,\n {\n isCaseSensitive = Config.isCaseSensitive,\n includeMatches = Config.includeMatches,\n minMatchCharLength = Config.minMatchCharLength,\n ignoreLocation = Config.ignoreLocation,\n findAllMatches = Config.findAllMatches,\n location = Config.location,\n threshold = Config.threshold,\n distance = Config.distance\n } = {}\n ) {\n this.query = null;\n this.options = {\n isCaseSensitive,\n includeMatches,\n minMatchCharLength,\n findAllMatches,\n ignoreLocation,\n location,\n threshold,\n distance\n };\n\n this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();\n this.query = parseQuery(this.pattern, this.options);\n }\n\n static condition(_, options) {\n return options.useExtendedSearch\n }\n\n searchIn(text) {\n const query = this.query;\n\n if (!query) {\n return {\n isMatch: false,\n score: 1\n }\n }\n\n const { includeMatches, isCaseSensitive } = this.options;\n\n text = isCaseSensitive ? text : text.toLowerCase();\n\n let numMatches = 0;\n let allIndices = [];\n let totalScore = 0;\n\n // ORs\n for (let i = 0, qLen = query.length; i < qLen; i += 1) {\n const searchers = query[i];\n\n // Reset indices\n allIndices.length = 0;\n numMatches = 0;\n\n // ANDs\n for (let j = 0, pLen = searchers.length; j < pLen; j += 1) {\n const searcher = searchers[j];\n const { isMatch, indices, score } = searcher.search(text);\n\n if (isMatch) {\n numMatches += 1;\n totalScore += score;\n if (includeMatches) {\n const type = searcher.constructor.type;\n if (MultiMatchSet.has(type)) {\n allIndices = [...allIndices, ...indices];\n } else {\n allIndices.push(indices);\n }\n }\n } else {\n totalScore = 0;\n numMatches = 0;\n allIndices.length = 0;\n break\n }\n }\n\n // OR condition, so if TRUE, return\n if (numMatches) {\n let result = {\n isMatch: true,\n score: totalScore / numMatches\n };\n\n if (includeMatches) {\n result.indices = allIndices;\n }\n\n return result\n }\n }\n\n // Nothing was matched\n return {\n isMatch: false,\n score: 1\n }\n }\n}\n\nconst registeredSearchers = [];\n\nfunction register(...args) {\n registeredSearchers.push(...args);\n}\n\nfunction createSearcher(pattern, options) {\n for (let i = 0, len = registeredSearchers.length; i < len; i += 1) {\n let searcherClass = registeredSearchers[i];\n if (searcherClass.condition(pattern, options)) {\n return new searcherClass(pattern, options)\n }\n }\n\n return new BitapSearch(pattern, options)\n}\n\nconst LogicalOperator = {\n AND: '$and',\n OR: '$or'\n};\n\nconst KeyType = {\n PATH: '$path',\n PATTERN: '$val'\n};\n\nconst isExpression = (query) =>\n !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);\n\nconst isPath = (query) => !!query[KeyType.PATH];\n\nconst isLeaf = (query) =>\n !isArray(query) && isObject(query) && !isExpression(query);\n\nconst convertToExplicit = (query) => ({\n [LogicalOperator.AND]: Object.keys(query).map((key) => ({\n [key]: query[key]\n }))\n});\n\n// When `auto` is `true`, the parse function will infer and initialize and add\n// the appropriate `Searcher` instance\nfunction parse(query, options, { auto = true } = {}) {\n const next = (query) => {\n let keys = Object.keys(query);\n\n const isQueryPath = isPath(query);\n\n if (!isQueryPath && keys.length > 1 && !isExpression(query)) {\n return next(convertToExplicit(query))\n }\n\n if (isLeaf(query)) {\n const key = isQueryPath ? query[KeyType.PATH] : keys[0];\n\n const pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];\n\n if (!isString(pattern)) {\n throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key))\n }\n\n const obj = {\n keyId: createKeyId(key),\n pattern\n };\n\n if (auto) {\n obj.searcher = createSearcher(pattern, options);\n }\n\n return obj\n }\n\n let node = {\n children: [],\n operator: keys[0]\n };\n\n keys.forEach((key) => {\n const value = query[key];\n\n if (isArray(value)) {\n value.forEach((item) => {\n node.children.push(next(item));\n });\n }\n });\n\n return node\n };\n\n if (!isExpression(query)) {\n query = convertToExplicit(query);\n }\n\n return next(query)\n}\n\n// Practical scoring function\nfunction computeScore(\n results,\n { ignoreFieldNorm = Config.ignoreFieldNorm }\n) {\n results.forEach((result) => {\n let totalScore = 1;\n\n result.matches.forEach(({ key, norm, score }) => {\n const weight = key ? key.weight : null;\n\n totalScore *= Math.pow(\n score === 0 && weight ? Number.EPSILON : score,\n (weight || 1) * (ignoreFieldNorm ? 1 : norm)\n );\n });\n\n result.score = totalScore;\n });\n}\n\nfunction transformMatches(result, data) {\n const matches = result.matches;\n data.matches = [];\n\n if (!isDefined(matches)) {\n return\n }\n\n matches.forEach((match) => {\n if (!isDefined(match.indices) || !match.indices.length) {\n return\n }\n\n const { indices, value } = match;\n\n let obj = {\n indices,\n value\n };\n\n if (match.key) {\n obj.key = match.key.src;\n }\n\n if (match.idx > -1) {\n obj.refIndex = match.idx;\n }\n\n data.matches.push(obj);\n });\n}\n\nfunction transformScore(result, data) {\n data.score = result.score;\n}\n\nfunction format(\n results,\n docs,\n {\n includeMatches = Config.includeMatches,\n includeScore = Config.includeScore\n } = {}\n) {\n const transformers = [];\n\n if (includeMatches) transformers.push(transformMatches);\n if (includeScore) transformers.push(transformScore);\n\n return results.map((result) => {\n const { idx } = result;\n\n const data = {\n item: docs[idx],\n refIndex: idx\n };\n\n if (transformers.length) {\n transformers.forEach((transformer) => {\n transformer(result, data);\n });\n }\n\n return data\n })\n}\n\nclass Fuse {\n constructor(docs, options = {}, index) {\n this.options = { ...Config, ...options };\n\n if (\n this.options.useExtendedSearch &&\n !true\n ) {}\n\n this._keyStore = new KeyStore(this.options.keys);\n\n this.setCollection(docs, index);\n }\n\n setCollection(docs, index) {\n this._docs = docs;\n\n if (index && !(index instanceof FuseIndex)) {\n throw new Error(INCORRECT_INDEX_TYPE)\n }\n\n this._myIndex =\n index ||\n createIndex(this.options.keys, this._docs, {\n getFn: this.options.getFn,\n fieldNormWeight: this.options.fieldNormWeight\n });\n }\n\n add(doc) {\n if (!isDefined(doc)) {\n return\n }\n\n this._docs.push(doc);\n this._myIndex.add(doc);\n }\n\n remove(predicate = (/* doc, idx */) => false) {\n const results = [];\n\n for (let i = 0, len = this._docs.length; i < len; i += 1) {\n const doc = this._docs[i];\n if (predicate(doc, i)) {\n this.removeAt(i);\n i -= 1;\n len -= 1;\n\n results.push(doc);\n }\n }\n\n return results\n }\n\n removeAt(idx) {\n this._docs.splice(idx, 1);\n this._myIndex.removeAt(idx);\n }\n\n getIndex() {\n return this._myIndex\n }\n\n search(query, { limit = -1 } = {}) {\n const {\n includeMatches,\n includeScore,\n shouldSort,\n sortFn,\n ignoreFieldNorm\n } = this.options;\n\n let results = isString(query)\n ? isString(this._docs[0])\n ? this._searchStringList(query)\n : this._searchObjectList(query)\n : this._searchLogical(query);\n\n computeScore(results, { ignoreFieldNorm });\n\n if (shouldSort) {\n results.sort(sortFn);\n }\n\n if (isNumber(limit) && limit > -1) {\n results = results.slice(0, limit);\n }\n\n return format(results, this._docs, {\n includeMatches,\n includeScore\n })\n }\n\n _searchStringList(query) {\n const searcher = createSearcher(query, this.options);\n const { records } = this._myIndex;\n const results = [];\n\n // Iterate over every string in the index\n records.forEach(({ v: text, i: idx, n: norm }) => {\n if (!isDefined(text)) {\n return\n }\n\n const { isMatch, score, indices } = searcher.searchIn(text);\n\n if (isMatch) {\n results.push({\n item: text,\n idx,\n matches: [{ score, value: text, norm, indices }]\n });\n }\n });\n\n return results\n }\n\n _searchLogical(query) {\n\n const expression = parse(query, this.options);\n\n const evaluate = (node, item, idx) => {\n if (!node.children) {\n const { keyId, searcher } = node;\n\n const matches = this._findMatches({\n key: this._keyStore.get(keyId),\n value: this._myIndex.getValueForItemAtKeyId(item, keyId),\n searcher\n });\n\n if (matches && matches.length) {\n return [\n {\n idx,\n item,\n matches\n }\n ]\n }\n\n return []\n }\n\n const res = [];\n for (let i = 0, len = node.children.length; i < len; i += 1) {\n const child = node.children[i];\n const result = evaluate(child, item, idx);\n if (result.length) {\n res.push(...result);\n } else if (node.operator === LogicalOperator.AND) {\n return []\n }\n }\n return res\n };\n\n const records = this._myIndex.records;\n const resultMap = {};\n const results = [];\n\n records.forEach(({ $: item, i: idx }) => {\n if (isDefined(item)) {\n let expResults = evaluate(expression, item, idx);\n\n if (expResults.length) {\n // Dedupe when adding\n if (!resultMap[idx]) {\n resultMap[idx] = { idx, item, matches: [] };\n results.push(resultMap[idx]);\n }\n expResults.forEach(({ matches }) => {\n resultMap[idx].matches.push(...matches);\n });\n }\n }\n });\n\n return results\n }\n\n _searchObjectList(query) {\n const searcher = createSearcher(query, this.options);\n const { keys, records } = this._myIndex;\n const results = [];\n\n // List is Array<Object>\n records.forEach(({ $: item, i: idx }) => {\n if (!isDefined(item)) {\n return\n }\n\n let matches = [];\n\n // Iterate over every key (i.e, path), and fetch the value at that key\n keys.forEach((key, keyIndex) => {\n matches.push(\n ...this._findMatches({\n key,\n value: item[keyIndex],\n searcher\n })\n );\n });\n\n if (matches.length) {\n results.push({\n idx,\n item,\n matches\n });\n }\n });\n\n return results\n }\n _findMatches({ key, value, searcher }) {\n if (!isDefined(value)) {\n return []\n }\n\n let matches = [];\n\n if (isArray(value)) {\n value.forEach(({ v: text, i: idx, n: norm }) => {\n if (!isDefined(text)) {\n return\n }\n\n const { isMatch, score, indices } = searcher.searchIn(text);\n\n if (isMatch) {\n matches.push({\n score,\n key,\n value: text,\n idx,\n norm,\n indices\n });\n }\n });\n } else {\n const { v: text, n: norm } = value;\n\n const { isMatch, score, indices } = searcher.searchIn(text);\n\n if (isMatch) {\n matches.push({ score, key, value: text, norm, indices });\n }\n }\n\n return matches\n }\n}\n\nFuse.version = '6.6.2';\nFuse.createIndex = createIndex;\nFuse.parseIndex = parseIndex;\nFuse.config = Config;\n\n{\n Fuse.parseQuery = parse;\n}\n\n{\n register(ExtendedSearch);\n}\n\n\n\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/utils.js\n\nfunction getDistanceFromLatLonInKm(coordsFrom, coordsTo) {\n const [lat1, lon1, distance] = coordsFrom.split(':');\n const [lat2, lon2] = coordsTo.split(':');\n const R = 6371; // Radius of the earth in km\n const dLat = deg2rad(lat2 - lat1); // deg2rad below\n const dLon = deg2rad(lon2 - lon1);\n const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2);\n const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n const distanceBetween = R * c; // Distance in km\n\n return Number(distance) >= distanceBetween;\n}\nfunction deg2rad(deg) {\n return deg * (Math.PI / 180);\n}\nfunction getDate({\n type,\n date = 0,\n match = true\n} = {}, itemTime) {\n if (!itemTime && type) return false;\n const newDate = new Date();\n let result = true;\n switch (type) {\n case \"day\":\n const filterDayStart = getDateInMs(date);\n const filterDayEnd = getDateInMs(date + 1);\n result = filterDayStart <= itemTime && itemTime < filterDayEnd;\n break;\n case \"days\":\n if (date < 0) {\n const currentDayEnd = getDateInMs(1);\n const startPast7Days = getDateInMs(-6);\n result = startPast7Days <= itemTime && itemTime < currentDayEnd;\n } else {\n const currentDay = getDateInMs();\n const startNext7Days = getDateInMs(7);\n result = currentDay <= itemTime && itemTime < startNext7Days;\n }\n break;\n case \"day_week\":\n result = date === new Date(itemTime).getDay();\n break;\n case \"week\":\n const weekStart = newDate.getDate() - newDate.getDay();\n const daysToEnd = date == -2 ? 13 : 6;\n const weekEnd = weekStart + daysToEnd;\n const weekDayStart = newDate.setDate(weekStart + date * 7);\n const currentDate = new Date();\n const weekDayEnd = currentDate.setDate(weekEnd + date * 7);\n const [sunday, saturday] = getWeek(weekDayStart, weekDayEnd);\n result = sunday <= itemTime && itemTime <= saturday;\n break;\n case \"month\":\n if (newDate.getFullYear() !== new Date(itemTime).getFullYear()) return false;\n const month = newDate.getMonth() + date;\n result = month === new Date(itemTime).getMonth();\n break;\n case \"year\":\n const year = newDate.getFullYear() + date;\n result = year === new Date(itemTime).getFullYear();\n break;\n default:\n return true;\n }\n return match ? result : !result;\n}\nfunction getWeek(start, end) {\n return [new Date(start), new Date(end)];\n}\nfunction getDateInMs(date = 0) {\n const currentDay = new Date();\n return new Date(currentDay.getFullYear(), currentDay.getMonth(), currentDay.getDate() + date).valueOf();\n}\nfunction searchValue(items, filter) {\n if (!items || !items.length) return;\n if (filter) {\n return items.filter(item => item.fields.find(field => field.index_value && field.index_value.toLowerCase().indexOf(filter.toLowerCase()) !== -1));\n }\n return items;\n}\nconst fuse = new Fuse([]);\nfunction isSimilarStrings(str1, strArray) {\n fuse.setCollection(strArray);\n return Boolean(fuse.search(str1).length);\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/filter.js\n\n/* harmony default export */ function filter(items, filters) {\n const itemsFilter = new ItemsFilter();\n if (!items || !items.length) {\n return [];\n }\n return itemsFilter.filter(filters, items);\n}\nclass Checker {\n changeBehavior(checkOption) {\n switch (checkOption) {\n case \"contain_or\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.some(_dataItem => _dataItem.indexOf(_filter) !== -1));\n };\n break;\n case \"contain_and\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.every(_filter => data.some(_dataItem => _dataItem.indexOf(_filter) !== -1));\n };\n break;\n case \"not_contain_or\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.every(_dataItem => _dataItem.indexOf(_filter) === -1));\n };\n break;\n case \"not_contain_and\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.every(_filter => data.every(_dataItem => _dataItem.indexOf(_filter) === -1));\n };\n break;\n case \"equal_or\":\n this._checkFn = function (data, filtersValues) {\n if (!data.length) return false;\n return data.some(_dataItem => filtersValues.some(_filter => _dataItem == _filter));\n };\n break;\n case \"equal_and\":\n this._checkFn = function (data, filtersValues) {\n if (!data.length) return false;\n let filtersValuesSet = new Set(filtersValues);\n while (data.length && filtersValuesSet.size) {\n let dataValue = data.pop();\n if (filtersValuesSet.has(dataValue)) {\n filtersValuesSet.delete(dataValue);\n }\n }\n return !filtersValuesSet.size;\n };\n break;\n case \"not_equal_or\":\n this._checkFn = function (data, filtersValues) {\n if (!data.length) return true;\n let filtersValuesSet = new Set(filtersValues);\n while (data.length && filtersValuesSet.size) {\n let dataValue = data.pop();\n if (!filtersValuesSet.has(dataValue)) {\n return true;\n }\n }\n return false;\n };\n break;\n case \"not_equal_and\":\n this._checkFn = function (data, filtersValues) {\n let filtersValuesSet = new Set(filtersValues);\n while (data.length && filtersValuesSet.size) {\n let dataValue = data.pop();\n if (filtersValuesSet.has(dataValue)) {\n return false;\n }\n }\n return true;\n };\n break;\n case \"bigger\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.every(_dataItem => _dataItem > _filter));\n };\n break;\n case \"lower\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.every(_dataItem => _dataItem < _filter));\n };\n break;\n case \"range\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.every(_dataItem => _filter.start <= _dataItem && _dataItem < _filter.end));\n };\n break;\n case \"value\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.some(_dataItem => _dataItem == _filter));\n };\n break;\n case 'search':\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => isSimilarStrings(_filter, data));\n };\n break;\n case \"phone_equal_or\":\n this._checkFn = function (data, filtersValues) {\n if (!data.length) return false;\n return filtersValues.some(_filter => data.some(_dataItem => _dataItem.replace(/[^0-9]/g, \"\").indexOf(_filter.replace(/[^0-9]/g, \"\")) !== -1));\n };\n break;\n case 'distance':\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.some(_dataItem => getDistanceFromLatLonInKm(_filter, _dataItem)));\n };\n break;\n case \"date_in\":\n case \"date_out\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.some(_dataItem => getDate(_filter, _dataItem)));\n };\n break;\n case \"recurring_date\":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(_filter => data.some(_dataItem => gudhub.checkRecurringDate(_dataItem, _filter)));\n };\n break;\n }\n return this;\n }\n check(aggregate) {\n return this.changeBehavior(aggregate.getCheckOption())._checkFn(aggregate.getEntity(), aggregate.getFilterValues());\n }\n}\nclass NumberFetchStrategy {\n convert(val) {\n return [Number(val)];\n }\n convertFilterValue(val) {\n return Number(val);\n }\n}\nclass RangeFetchStrategy extends NumberFetchStrategy {\n convertFilterValue(val) {\n return {\n start: Number(val.split(\":\")[0]),\n end: Number(val.split(\":\")[1])\n };\n }\n}\nclass StringFetchStrategy {\n convert(val) {\n return String(val != null ? val : \"\").toLowerCase().split(\",\");\n }\n convertFilterValue(val) {\n if (val === 0) return \"0\";\n return String(val || \"\").toLowerCase();\n }\n}\nclass dateFetchStrategy extends NumberFetchStrategy {\n convertFilterValue(val) {\n const [type, date, match] = val.split(\":\");\n return {\n type,\n date: Number(date),\n match: !!Number(match)\n };\n }\n}\nclass BooleanFetchStrategy {\n convert(val) {\n return [String(Boolean(val))];\n }\n convertFilterValue(val) {\n return String(val);\n }\n}\nclass RecurringDateStrategy {\n convert(val) {\n return [Number(val)];\n }\n convertFilterValue(val) {\n return String(val);\n }\n}\nclass Aggregate {\n constructor() {\n this._strategies = {\n stringStrategy: new StringFetchStrategy(),\n numberStrategy: new NumberFetchStrategy(),\n booleanStrategy: new BooleanFetchStrategy(),\n rangeStrategy: new RangeFetchStrategy(),\n dateStrategy: new dateFetchStrategy(),\n recurringDateStrategy: new RecurringDateStrategy()\n };\n }\n setStrategy(checkOption) {\n this._checkOption = checkOption;\n switch (checkOption) {\n case \"contain_or\":\n case \"contain_and\":\n case \"not_contain_or\":\n case \"not_contain_and\":\n case \"equal_or\":\n case \"equal_and\":\n case \"not_equal_or\":\n case \"not_equal_and\":\n case \"phone_equal_or\":\n case 'distance':\n case 'search':\n this._currentStrategy = this._strategies.stringStrategy;\n break;\n case \"bigger\":\n case \"lower\":\n this._currentStrategy = this._strategies.numberStrategy;\n break;\n case \"range\":\n this._currentStrategy = this._strategies.rangeStrategy;\n break;\n case \"date_in\":\n case \"date_out\":\n this._currentStrategy = this._strategies.dateStrategy;\n break;\n case \"value\":\n this._currentStrategy = this._strategies.booleanStrategy;\n break;\n case \"recurring_date\":\n this._currentStrategy = this._strategies.recurringDateStrategy;\n }\n return this;\n }\n setEntity(val) {\n this._entity = this._currentStrategy.convert(val);\n return this;\n }\n getEntity() {\n return this._entity;\n }\n setFilterValues(val) {\n let temp = Array.isArray(val) ? val : [val];\n this._filterValues = temp.map(curFilterVal => this._currentStrategy.convertFilterValue(curFilterVal));\n return this;\n }\n getFilterValues() {\n return this._filterValues;\n }\n getCheckOption() {\n return this._checkOption;\n }\n}\nclass ItemsFilter {\n constructor() {}\n filter(filters, items) {\n const allFiltersAndStrategy = this.checkIfAllFiltersHaveAndStrategy(filters);\n const filteredItems = [];\n const activeFilters = filters.filter(function (filter) {\n return filter.valuesArray.length;\n });\n for (let item of items) {\n let result = true;\n for (let i = 0; i < activeFilters.length; i++) {\n const filter = activeFilters[i];\n const currField = item.fields.find(function (itemField) {\n return filter.field_id == itemField.field_id;\n });\n const filterAggregate = new Aggregate();\n const filterChecker = new Checker();\n filterAggregate.setStrategy(filter.search_type).setEntity(currField && currField.field_value != undefined ? currField.field_value : null).setFilterValues(filter.valuesArray);\n switch (filter.boolean_strategy) {\n case 'and':\n result = result && filterChecker.check(filterAggregate);\n break;\n case 'or':\n result = result || filterChecker.check(filterAggregate);\n break;\n default:\n result = result && filterChecker.check(filterAggregate);\n }\n\n // Needed for performance optimization\n // We don't need to check other filters if we already know that result is false in case of 'and' strategy\n if (!result && allFiltersAndStrategy) {\n break;\n }\n }\n if (result) {\n filteredItems.push(item);\n }\n }\n if (filteredItems.length || filters.length && !filteredItems.length) {\n return filteredItems;\n } else {\n return items;\n }\n }\n checkIfAllFiltersHaveAndStrategy(filters) {\n return filters.every(filter => {\n if (!filter.boolean_strategy || filter.boolean_strategy == 'and') {\n return true;\n }\n return false;\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/mergeFilters.js\nfunction mergeFilters(srcFilters, destFilters) {\n const mergedFieldIds = [];\n let filters = [];\n if (srcFilters.length > 0) {\n srcFilters.forEach(filter => {\n filters.push(filter);\n });\n } else {\n filters = destFilters;\n }\n if (filters.length > 0) {\n filters.forEach((filter, index) => {\n for (let i = 0; i < destFilters.length; i++) {\n if (filter.field_id == destFilters[i].field_id) {\n mergedFieldIds.push(filter.field_id);\n filters[index] = gudhub.mergeObjects(destFilters[i], filter);\n }\n }\n });\n for (let k = 0; k < destFilters.length; k++) {\n if (!mergedFieldIds.includes(destFilters[k].field_id)) {\n filters.push(destFilters[k]);\n }\n }\n }\n return filters;\n}\n// EXTERNAL MODULE: ./node_modules/jsonpath/jsonpath.js\nvar jsonpath = __webpack_require__(9832);\n;// CONCATENATED MODULE: ./GUDHUB/Utils/json_to_items/json_to_items.js\n\n\n/*\n|==================================== JSON TO ITEMS ==================================|\n|====================== jsonToItems (json, fieldsMap) =================|\n|=====================================================================================|\n| Arguments:\n| - json - is an object that is going to be converted to items\n|\n|\n| - fieldsMap - this map is an object array that contains field_id and jsonPath to get data from \n| [\n| {\n| field_id: 431,\n| json_path : \"$..item_id\"\n| }\n| ]\n|\n|\n| - Returns items_list:\n| [\n| fields: {\n| field_id: 12356,\n| field_value: \"test value\"\n| }\n| ]\n|\n|=====================================================================================|\n*/\n\nfunction jsonToItems(json, fieldsMap) {\n let proccessedMap = [];\n let itemsPath = [];\n\n //-- Step 1 --// \n // iterating through map and generating list of paths for each field_id\n fieldsMap.forEach(fieldMap => {\n let json_paths = [];\n try {\n json_paths = jsonpath.paths(json, fieldMap.json_path);\n proccessedMap.push({\n field_id: fieldMap.field_id,\n json_paths: json_paths,\n json_paths_length: json_paths.length\n });\n } catch (err) {\n console.log(err);\n }\n });\n\n //-- Step 2 --//\n // we are sorrting by json_paths_length to find a field with biggest number of json_paths\n // we are going to use the first element of the proccessedMap array as a main iterator\n proccessedMap.sort((b, a) => {\n return a.json_paths_length - b.json_paths_length;\n });\n\n //-- Step 3 --//\n // creating items array based on proccessedMap\n let items = getPathForItems(proccessedMap).map(itemPath => {\n return {\n fields: itemPath.fields.map(field => {\n return {\n field_id: field.field_id,\n field_value: jsonpath.value(json, field.json_path)\n };\n })\n };\n });\n return items;\n}\n\n//**************** BEST MATCH ****************//\n// it looks for jsonPath in the pathsToCompare that is mutching the best\nfunction bestMatch(targetPath, pathsToCompare) {\n let matchedPaths = [];\n\n //-- Creating matchedPaths for compearing targetPath with pathsToCompare\n pathsToCompare.forEach(path => {\n matchedPaths.push({\n path_to_compare: path,\n match_coefficient: 0\n });\n });\n\n //-- Assigning match_coefficient to each path from matchedPaths arrey to determine which path match the best\n // Bigger coefficient means better munch \n targetPath.forEach((trgElem, key) => {\n for (var i = 0; i < matchedPaths.length; i++) {\n if (matchedPaths[i].path_to_compare[key] == trgElem) {\n matchedPaths[i].match_coefficient += 1 / (key + 1);\n }\n }\n });\n\n //-- Sorting matchedPaths by match_coefficient in order to return puth that match the best\n matchedPaths.sort((b, a) => {\n return a.match_coefficient - b.match_coefficient;\n });\n\n //-- Returning first element of matchedPaths[] with biggest match_coefficient with is a best match result\n return matchedPaths[0].path_to_compare;\n}\n\n//*************** GET PATH FOR ITEMS ****************//\n/* Here we create array of items those are contains jsonePaths \n/* at the next step we are going to create field_value from json_path\n| [\n| fields:\n| {\n| field_id : 123,\n| json_path : $..test_path\n| }\n| ]\n|*/\nfunction getPathForItems(proccessedMap) {\n let itemsPath = [];\n proccessedMap.length && proccessedMap[0].json_paths.forEach(jsonPath => {\n let itemPath = {\n fields: []\n };\n proccessedMap.forEach(pMap => {\n itemPath.fields.push({\n field_id: pMap.field_id,\n json_path: bestMatch(jsonPath, pMap.json_paths)\n });\n });\n itemsPath.push(itemPath);\n });\n return itemsPath;\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/merge_compare_items/merge_compare_items.js\n//********************************************//\n//******************* ITEMS ******************//\n//********************************************//\n\n/*\n|============================================== POPULATE WITH ITEM REFFERENCE ==========================================================|\n|===== populateWithItemRef (sorceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id) =====|\n|=======================================================================================================================================|\n| We update destination Items with item_ref of sorce Items. Connectiontion between sorceItemsRef & srcFieldIdToCompare we are checking with \n| help of srcFieldIdToCompare & destFieldIdToCompare. After connection is detected we save the item_ref into destFieldForRef.\n|\n| Arguments:\n| - sorceItemsRef - items those are will be used as referense for item_ref\n| - destinationItems - items those are will be used to save item_ref to sorceItemsRef \n| - srcFieldIdToCompare - we use value from this field to find the similar items in source and destimation items array\n| - destFieldIdToCompare - we use value from this field to find the similar items in source and destimation items array\n| - destFieldForRef - field where value of item_ref\n| - app_id - we use aplication id to generate value for item_ref\n|\n| Return:\n| [{},{}...] - returns arey of updated items\n| \n|=====================================================================================================================================|\n*/\n\n//********************** POPULATE WITH ITEM REFFERENCE ************************/\nfunction populateWithItemRef(sorceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id) {\n let resultedItems = [];\n const theSameIdValueFn = function (srcComprItem, dstComprItem) {\n let fieldForRef = getFieldById(dstComprItem, destFieldForRef);\n if (fieldForRef) {\n fieldForRef.field_value = app_id + \".\" + srcComprItem.item_id;\n resultedItems.push(dstComprItem);\n }\n };\n destinationItems.forEach(dstItem => {\n sorceItemsRef.forEach(srcItem => {\n compareTwoItemsByFieldId(srcItem, dstItem, srcFieldIdToCompare, destFieldIdToCompare, theSameIdValueFn);\n });\n });\n return resultedItems;\n}\n\n/*\n|====================================== MERGE ITEM ==================================|\n|============== mergeItems (sorceItems, destinationItems) ============|\n|====================================================================================|\n| We replace all fields with values in destinationItems by values from sorceItems.\n| If destinationItems doesn't have fields that sorceItems then we create them in destinationItems\n|\n| NOTE: items from chanks hase a history properti in a field \n|\n| Arguments:\n| - sorceItems - array of items that will be used to update items from destinationItems items array\n| - destinationItems - array of items that is gong to be updated\n|\n| Return:\n| [{},{}...] - returns arey of updated items\n| \n|==================================================================================|\n*/\n\n//********************** MERGE ITEMS ************************/\nfunction mergeItems(sorceItems, destinationItems, mergeByFieldId) {\n let src = JSON.parse(JSON.stringify(sorceItems));\n let dst = JSON.parse(JSON.stringify(destinationItems));\n let result = [];\n\n //-- The Source and in the Destination has the same item ids but different field values\n const differentSrcItemFn = function (srcItem, dstItem) {\n result.push(mergeTwoItems(srcItem, dstItem));\n };\n\n //-- The Source and in the Destination has the same item ids and field values\n const theSameSrcItemFn = function (srcItem) {\n result.push(srcItem);\n };\n\n //-- Items thoase exist in the Source but they are not exist in the Destination list \n const newSrcItemFn = function (srcItem) {\n result.push(srcItem);\n };\n\n //-- Items thoase exist in the Destination list but they are not exist in the Source list\n const uniqDestItemFn = function (dstItem) {\n result.push(dstItem);\n };\n\n //--------- Compearing Src & Dst Items by item_id ---------//\n if (mergeByFieldId) {\n compareItemsByFieldId(src, dst, mergeByFieldId, differentSrcItemFn, theSameSrcItemFn, newSrcItemFn);\n } else compareItemsByItemId(src, dst, differentSrcItemFn, theSameSrcItemFn, newSrcItemFn, uniqDestItemFn);\n\n //--------- Final Report ---------//\n return result;\n}\n\n/*\n|==================================== COMPARE ITEM ==================================================|\n|=========== compareItems (sorceItems, destinationItems, fieldToCompare) =============|\n|====================================================================================================|\n| We compare fields of sorceItems with fields of destinationItems. It means that if sorceItems \n| have the same fields with the same values as destinationItems thay will be described as 'same_items'\n| even if destinationItems have additional fields those sorceItems doesn't have\n|\n| There to ways how it works:\n| 1 compering items by item_id (if fieldToCompare is undefined)\n| 2 compering items by value of specific field_id (if fieldToCompare is defined)\n|\n| Arguments:\n| - sorceItems - array of items that is going to be used as a sorce for comperison\n| - destinationItems - array of items that is gong to be compared with sorceItems\n| - fieldToCompare - field that we use to compare sorce items with destination items, if this is not specified then we compare items by item_id\n|\n| Return:\n| {\n| is_items_diff: false,\n| new_src_items:[],\n| diff_src_items:[],\n| same_items:[]\n| }\n|\n|==================================================================================|\n*/\n\n//********************** COMPARE ITEMS ************************/\nfunction compareItems(sorceItems, destinationItems, fieldToCompare) {\n const src = JSON.parse(JSON.stringify(sorceItems));\n const dst = JSON.parse(JSON.stringify(destinationItems));\n let result = {\n is_items_diff: false,\n new_src_items: [],\n diff_src_items: [],\n same_items: [],\n trash_src_items: []\n };\n const differentSrcItemFn = function (item) {\n result.diff_src_items.push(item);\n };\n const theSameSrcItemFn = function (item) {\n result.same_items.push(item);\n };\n const newSrcItemFn = function (item) {\n result.new_src_items.push(item);\n };\n const trashSrcItemFn = function (item) {\n result.trash_src_items.push(item);\n };\n\n //--------- Compearing Src & Dst Items by item_id ---------//\n if (fieldToCompare) {\n //TODO trashSrcItemFn\n compareItemsByFieldId(src, dst, fieldToCompare, differentSrcItemFn, theSameSrcItemFn, newSrcItemFn);\n }\n if (!fieldToCompare) {\n compareItemsByItemId(src, dst, differentSrcItemFn, theSameSrcItemFn, newSrcItemFn, null, trashSrcItemFn);\n }\n\n //--------- Final Report ---------//\n result.is_items_diff = result.new_src_items.length > 0 || result.diff_src_items.length > 0;\n return result;\n}\nfunction mergeTwoItems(src, dst) {\n src.fields.forEach(srcField => {\n let destField = getFieldById(dst, srcField.field_id);\n if (destField) {\n destField.field_value = srcField.field_value;\n\n // if we work with chanked items then we merge history \n if (srcField.history && destField.history) {\n destField.history = srcField.history.concat(destField.history);\n }\n } else {\n //-- if we didn't find field with item then we add it\n dst.fields.push(srcField);\n }\n });\n return dst;\n}\nfunction compareItemsByFieldId(src, dst, fieldToCompare, differentSrcItemFn, theSameSrcItemFn, newSrcItemFn) {\n src.forEach(srcItem => {\n let notFoundDestItemforSrc = true;\n let srcVal = getFieldById(srcItem, fieldToCompare).field_value;\n dst.forEach(dstItem => {\n let dstVal = getFieldById(dstItem, fieldToCompare).field_value;\n if (srcVal == dstVal) {\n notFoundDestItemforSrc = false;\n compareTwoItems(srcItem, dstItem, differentSrcItemFn, theSameSrcItemFn);\n }\n });\n\n //-- If there no destination item with the same item_id then it means that item is new\n if (notFoundDestItemforSrc) {\n newSrcItemFn(srcItem);\n }\n });\n}\nfunction compareItemsByItemId(src, dst, differentSrcItemFn, theSameSrcItemFn, newSrcItemFn, uniqDestItemFn, trashSrcItemFn) {\n let dstItemsMap = new ItemsMapper(dst);\n src.forEach(srcItem => {\n let destIndex = dstItemsMap.pullItemIndex(srcItem.item_id);\n if (destIndex != undefined) {\n compareTwoItems(srcItem, dst[destIndex], differentSrcItemFn, theSameSrcItemFn, trashSrcItemFn);\n } else {\n if (srcItem.trash) trashSrcItemFn(srcItem);\n if (!srcItem.trash) newSrcItemFn(srcItem);\n }\n ;\n });\n\n //-- In case if we have destination items which are new then we \n if (uniqDestItemFn) for (const [key, value] of Object.entries(dstItemsMap.itemsMap)) {\n uniqDestItemFn(dst[value]);\n }\n}\nfunction compareTwoItems(src, dst, differentSrcItemFn, theSameSrcItemFn, trashSrcItemFn) {\n let sameItem = true;\n for (let i = 0; i < src.fields.length; i++) {\n let destField = getFieldById(dst, src.fields[i].field_id);\n if (destField) {\n //-- if value of some field of the item is different then item is different too\n if (destField.field_value != src.fields[i].field_value) {\n sameItem = sameItem && false;\n }\n } else {\n //-- if we didn't find field with item then item is different\n sameItem = sameItem && false;\n }\n }\n\n //-- Sending Compearing Result\n if (sameItem) {\n if (src.trash) trashSrcItemFn(src, dst);\n if (!src.trash) theSameSrcItemFn(src, dst);\n }\n if (!sameItem) {\n if (src.trash) trashSrcItemFn(src, dst);\n if (!src.trash) differentSrcItemFn(src, dst);\n }\n}\nfunction compareTwoItemsByFieldId(srcItem, dstItem, srcFieldId, dstFieldId, theSameSrcItemFn) {\n let srcFieldVal = getFieldById(srcItem, srcFieldId).field_value;\n let dstFieldIdVal = getFieldById(dstItem, dstFieldId).field_value;\n if (srcFieldVal == dstFieldIdVal) {\n theSameSrcItemFn(srcItem, dstItem);\n }\n}\nfunction getFieldById(item, field_id) {\n let result = null;\n for (let i = 0; i < item.fields.length; i++) {\n if (field_id == item.fields[i].field_id) {\n result = item.fields[i];\n }\n }\n ;\n return result;\n}\nclass ItemsMapper {\n constructor(items) {\n this._itemsMap = {};\n items.forEach((item, key) => {\n this._itemsMap[item.item_id] = key;\n });\n }\n pullItemIndex(item_id) {\n let index = this._itemsMap[item_id];\n delete this._itemsMap[item_id];\n return index;\n }\n getItemIndex(item_id) {\n return this._itemsMap[item_id];\n }\n get itemsMap() {\n return this._itemsMap;\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/group.js\nfunction group(fieldGroup, items) {\n let groupItemList = [];\n let arrayGroupField;\n if (!fieldGroup) {\n groupItemList = items;\n } else {\n arrayGroupField = fieldGroup.split(\",\");\n }\n let arrayValue = new Set();\n if (fieldGroup) {\n items.forEach(item => {\n let valueField = \"\";\n arrayGroupField.forEach((fieldToGroup, index) => {\n const findField = item.fields.find(field => field.field_id == fieldToGroup);\n if (findField) {\n valueField += findField.field_value;\n }\n if (arrayGroupField.length - 1 == index) {\n let itemUnics = findUniqItem(valueField);\n if (itemUnics) {\n groupItemList.push(item);\n }\n }\n });\n });\n }\n\n // send field value and check if it's unique\n function findUniqItem(value) {\n const uniqValue = !arrayValue.has(value);\n if (uniqValue) {\n arrayValue.add(value);\n }\n return uniqValue;\n }\n return groupItemList;\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/populate_items/populate_items.js\n//********************************************//\n//******************* ITEMS ******************//\n//********************************************//\n\n/*\n|====================================== ITEMS UPDATE ================================|\n|=========== updateItems (items, model, eraseOtherValues) ============|\n|====================================================================================|\n|\n| items - GudHub items those we are going to be updated\n| eraseOtherValues - if is 'true' then we erase fields those are not going to be updated\n| model - by this model we update values. The model format should have folowing format:\n|\n| \n| model = [\n| {\n| \"element_id\" : 228464,\n| \"field_value\" : 777\n| }]\n|\n|==================================================================================|\n*/\n\n//********************** UPDATE ITEMS ************************/\nfunction populateItems(items, model, keep_data) {\n var itemsCopy = JSON.parse(JSON.stringify(items));\n if (keep_data) {\n return populateItemsAndKeepOtherValues(itemsCopy, model);\n } else {\n return populateItemsAndEraseOtherValues(itemsCopy, model);\n }\n}\n\n//---- Update Items And KEEP Other Values ----//\nfunction populateItemsAndKeepOtherValues(items, model) {\n items.forEach(item => {\n model.forEach(modelField => {\n let field = item.fields.find(sourceField => sourceField.element_id == modelField.element_id);\n if (field) {\n field.field_value = modelField.field_value;\n } else {\n //-- if we didn't find field with item then we add it\n modelField.field_id = modelField.element_id; //backend send ERROR if don't send field_id\n item.fields.push(modelField);\n }\n });\n });\n return items;\n}\n\n//---- Update Items And ERASE Other Values ----//\nfunction populateItemsAndEraseOtherValues(items, model) {\n items.forEach(item => {\n item.fields = [].concat(model);\n });\n return items;\n}\n// EXTERNAL MODULE: ./node_modules/date-fns/add/index.js\nvar add = __webpack_require__(5430);\n// EXTERNAL MODULE: ./node_modules/date-fns/setDay/index.js\nvar setDay = __webpack_require__(8933);\n// EXTERNAL MODULE: ./node_modules/date-fns/isSameWeek/index.js\nvar isSameWeek = __webpack_require__(5276);\n;// CONCATENATED MODULE: ./GUDHUB/Utils/get_date/get_date.js\n/*\n|====================================== GETTING DATE ================================|\n|=========================== getDate (queryKey) ======================|\n|====================================================================================|\n| Arguments:\n| - queryKey - according to 'queryKey' we decide with date should be returned to user\n|\n| Return:\n| - date in miliseconds\n| \n|==================================================================================|\n*/\n\n\n\n\n//********************** POPULATE WITH DATE ************************//\nfunction populateWithDate(items, model) {\n items.forEach(item => {\n model.forEach(modelField => {\n let field = item.fields.find(sourceField => sourceField.element_id == modelField.element_id);\n if (field) {\n if (modelField.data_range) {\n if (modelField.date_type.includes('calendar')) {\n field.field_value = `${getStartDate(modelField.date_type)}:${get_date_getDate(modelField.date_type)}`;\n } else {\n field.field_value = `${getStartDate(modelField.date_type)}:${get_date_getDate(modelField.date_type)}`;\n }\n } else {\n field.field_value = get_date_getDate(modelField.date_type);\n }\n } else {\n //-- if we didn't find field in item then we add it\n item.fields.push({\n field_id: modelField.element_id,\n element_id: modelField.element_id,\n field_value: get_date_getDate(modelField.date_type)\n });\n }\n });\n });\n return items;\n}\n\n//******************* GET START DATE *********************//\nfunction getStartDate(dateType) {\n let currentDate = new Date();\n function weekTime(currentDate) {\n var day = currentDate.getDay();\n let numberOfDays;\n if (dateType.includes(\"week_current,current\")) {\n numberOfDays = 0;\n }\n if (dateType.includes(\"week_next,future\")) {\n numberOfDays = 7;\n }\n if (dateType.includes(\"week_past,past\")) {\n numberOfDays = -7;\n }\n let diff = currentDate.getDate() - day + numberOfDays + (day == 0 ? -6 : 1);\n return new Date(currentDate.setDate(diff));\n }\n function quarterTime(currentDate) {\n let numberMonths;\n let numberDays;\n let currentQuarter = Math.floor(currentDate.getMonth() / 3);\n let year = currentDate.getFullYear();\n if (dateType.includes(\"quarter_current,current\")) {\n numberMonths = 0;\n numberDays = 0;\n }\n if (dateType.includes(\"quarter_next,future\")) {\n numberMonths = 3;\n numberDays = 0;\n }\n if (dateType.includes(\"quarter_past,past\")) {\n numberMonths = -3;\n numberDays = 0;\n }\n return new Date(year, currentQuarter * 3 + numberMonths, 1 + numberDays);\n }\n switch (dateType) {\n case \"week_current,current\":\n return weekTime(new Date()).getTime();\n case \"month_current,current\":\n return new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).getTime();\n case \"quarter_current,current\":\n return quarterTime(new Date()).getTime();\n case \"year_current,current\":\n return add(new Date(currentDate.getFullYear(), 0, 1), {\n years: 0\n }).getTime();\n case \"week_next,future\":\n return weekTime(new Date()).getTime();\n case \"month_next,future\":\n return new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 1).getTime();\n case \"quarter_next,future\":\n return quarterTime(new Date()).getTime();\n case \"year_next,future\":\n return add(currentDate, {\n days: 0\n }).getTime();\n case \"week_past,past\":\n return weekTime(new Date()).getTime();\n case \"month_past,past\":\n return new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).getTime();\n case \"quarter_past,past\":\n return quarterTime(new Date()).getTime();\n case \"year_past,past\":\n return add(currentDate, {\n years: -1\n }).getTime();\n case \"year_past,past,calendar\":\n return add(new Date(currentDate.getFullYear(), 0, 1), {\n years: -1\n }).getTime();\n case \"year_future,future,calendar\":\n return add(new Date(currentDate.getFullYear() + 1, 0, 1), {\n years: 0\n }).getTime();\n case \"today_current,current\":\n return add(currentDate, {\n days: 0\n }).getTime();\n case \"tomorrow,future\":\n return add(currentDate, {\n days: 1\n }).getTime();\n case \"7_days_future,future\":\n return add(currentDate, {\n days: 0\n }).getTime();\n case \"10_days_future,future\":\n return add(currentDate, {\n days: 0\n }).getTime();\n case \"14_days_future,future\":\n return add(currentDate, {\n days: 0\n }).getTime();\n case \"30_days_future,future\":\n return add(currentDate, {\n days: 0\n }).getTime();\n case \"yesterday,past\":\n return add(currentDate, {\n days: -1\n }).getTime();\n case \"7_days_past,past\":\n return add(currentDate, {\n days: -7\n }).getTime();\n case \"10_days_past,past\":\n return add(currentDate, {\n days: -10\n }).getTime();\n case \"14_days_past,past\":\n return add(currentDate, {\n days: -14\n }).getTime();\n case \"30_days_past,past\":\n return add(currentDate, {\n days: -30\n }).getTime();\n }\n}\n//********************** GET DATE ************************//\nfunction get_date_getDate(queryKey) {\n var date = new Date();\n function getMonday(d) {\n d = new Date(d);\n var day = d.getDay(),\n diff = d.getDate() - day + 6 + (day == 0 ? +6 : 1);\n return new Date(d.setDate(diff));\n }\n function getNextWeek(d) {\n d = new Date(d);\n var day = d.getDay(),\n diff = d.getDate() - day + 13 + (day == 0 ? -6 : 1);\n return new Date(d.setDate(diff));\n }\n function getPastWeek(d) {\n d = new Date(d);\n var day = d.getDay(),\n diff = d.getDate() - day - 1 + (day == 0 ? -6 : 1);\n return new Date(d.setDate(diff));\n }\n let currentQuarter = Math.floor(date.getMonth() / 3);\n let year = date.getFullYear();\n switch (queryKey) {\n case \"next_day\":\n return add(date, {\n days: 1\n }).getTime();\n case \"two_days_after\":\n return add(date, {\n days: 2\n }).getTime();\n case \"three_days_after\":\n return add(date, {\n days: 3\n }).getTime();\n case \"four_days_after\":\n return add(date, {\n days: 4\n }).getTime();\n case \"next_week\":\n return add(date, {\n weeks: 1\n }).getTime();\n case \"two_weeks_after\":\n return add(date, {\n weeks: 2\n }).getTime();\n case \"three_weeks_after\":\n return add(date, {\n weeks: 3\n }).getTime();\n case \"this_sunday\":\n return setDay(date, 0, {\n weekStartsOn: 1\n });\n case \"this_monday\":\n return setDay(date, 1, {\n weekStartsOn: 1\n });\n case \"this_tuesday\":\n return setDay(date, 2, {\n weekStartsOn: 1\n });\n case \"this_wednesday\":\n return setDay(date, 3, {\n weekStartsOn: 1\n });\n case \"this_thursday\":\n return setDay(date, 4, {\n weekStartsOn: 1\n });\n case \"this_friday\":\n return setDay(date, 5, {\n weekStartsOn: 1\n });\n case \"this_saturday\":\n return setDay(date, 6, {\n weekStartsOn: 1\n });\n case \"today_current,current\":\n return add(date, {\n days: 0\n }).getTime();\n case \"tomorrow,future\":\n return add(date, {\n days: 1\n }).getTime();\n case \"7_days_future,future\":\n return add(date, {\n days: 7\n }).getTime();\n case \"10_days_future,future\":\n return add(date, {\n days: 10\n }).getTime();\n case \"14_days_future,future\":\n return add(date, {\n days: 14\n }).getTime();\n case \"30_days_future,future\":\n return add(date, {\n days: 30\n }).getTime();\n case \"yesterday,past\":\n return add(date, {\n days: -1\n }).getTime();\n case \"7_days_past,past\":\n return add(date, {\n days: 0\n }).getTime();\n case \"10_days_past,past\":\n return add(date, {\n days: 0\n }).getTime();\n case \"14_days_past,past\":\n return add(date, {\n days: 0\n }).getTime();\n case \"30_days_past,past\":\n return add(date, {\n days: 0\n }).getTime();\n case \"year_future,future,calendar\":\n return add(new Date(date.getFullYear() + 1, 0, 0), {\n years: 1\n }).getTime();\n case \"year_past,past,calendar\":\n return add(new Date(date.getFullYear(), 0, 0), {\n years: 0\n }).getTime();\n case \"week_current,current\":\n return getMonday(new Date()).getTime();\n case \"month_current,current\":\n return new Date(date.getFullYear(), date.getMonth() + 1, 0).getTime();\n case \"quarter_current,current\":\n return new Date(year, (currentQuarter + 1) * 3, 0).getTime();\n case \"year_current,current\":\n return add(new Date(date.getFullYear() + 1, 0, 0), {\n years: 0\n }).getTime();\n case \"week_next,future\":\n return getNextWeek(new Date()).getTime();\n case \"month_next,future\":\n return new Date(date.getFullYear(), date.getMonth() + 2, 0).getTime();\n case \"quarter_next,future\":\n return new Date(year, (currentQuarter + 1) * 3 + 3, 0).getTime();\n case \"year_next,future\":\n return add(date, {\n years: 1\n }).getTime();\n case \"week_past,past\":\n return getPastWeek(new Date()).getTime();\n case \"month_past,past\":\n return new Date(date.getFullYear(), date.getMonth(), 0, 0).getTime();\n case \"quarter_past,past\":\n return new Date(year, (currentQuarter + 1) * 3 - 3, 0).getTime();\n case \"year_past,past\":\n return add(date, {\n days: 0\n }).getTime();\n case \"now\":\n default:\n return date.getTime();\n }\n}\n\n//********************** CHECK RECURRING DATE ************************//\n\nfunction checkRecurringDate(date, option) {\n date = new Date(date);\n let currentDate = new Date();\n switch (option) {\n case 'day':\n if (date.getDate() + '.' + date.getMonth() === currentDate.getDate() + '.' + currentDate.getMonth()) {\n return true;\n } else {\n return false;\n }\n case 'week':\n let currentYear = new Date().getFullYear();\n let shiftedYearDate = new Date(currentYear, date.getMonth(), date.getDate());\n return isSameWeek(shiftedYearDate, currentDate);\n case 'month':\n if (date.getMonth() === currentDate.getMonth()) {\n return true;\n } else {\n return false;\n }\n default:\n return true;\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/merge_objects/merge_objects.js\n// Value of properties for source object woun't be changed by target object\n// If source of target hase unique properties they are going to be created in resulted object\n\nfunction mergeObjects(target, source, optionsArgument) {\n return deepmerge(target, source, optionsArgument);\n}\n\n/* Deepmerge - Start */\n// this code was copied from https://codepen.io/pushpanathank/pen/owjJGG\n// Basicaly I need it to marge field models\nfunction isMergeableObject(val) {\n var nonNullObject = val && typeof val === 'object';\n return nonNullObject && Object.prototype.toString.call(val) !== '[object RegExp]' && Object.prototype.toString.call(val) !== '[object Date]';\n}\nfunction emptyTarget(val) {\n return Array.isArray(val) ? [] : {};\n}\nfunction cloneIfNecessary(value, optionsArgument) {\n var clone = optionsArgument && optionsArgument.clone === true;\n return clone && isMergeableObject(value) ? deepmerge(emptyTarget(value), value, optionsArgument) : value;\n}\nfunction defaultArrayMerge(target, source, optionsArgument) {\n var destination = target.slice();\n source.forEach(function (e, i) {\n if (typeof destination[i] === 'undefined') {\n destination[i] = cloneIfNecessary(e, optionsArgument);\n } else if (isMergeableObject(e)) {\n destination[i] = deepmerge(target[i], e, optionsArgument);\n } else if (target.indexOf(e) === -1) {\n destination.push(cloneIfNecessary(e, optionsArgument));\n }\n });\n return destination;\n}\nfunction mergeObject(target, source, optionsArgument) {\n var destination = {};\n if (isMergeableObject(target)) {\n Object.keys(target).forEach(function (key) {\n destination[key] = cloneIfNecessary(target[key], optionsArgument);\n });\n }\n Object.keys(source).forEach(function (key) {\n if (!isMergeableObject(source[key]) || !target[key]) {\n destination[key] = cloneIfNecessary(source[key], optionsArgument);\n } else {\n destination[key] = deepmerge(target[key], source[key], optionsArgument);\n }\n });\n return destination;\n}\nfunction deepmerge(target, source, optionsArgument) {\n target = target !== undefined ? target : {};\n source = source !== undefined ? source : {};\n var array = Array.isArray(source);\n var options = optionsArgument || {\n arrayMerge: defaultArrayMerge\n };\n var arrayMerge = options.arrayMerge || defaultArrayMerge;\n if (array) {\n return Array.isArray(target) ? arrayMerge(target, source, optionsArgument) : cloneIfNecessary(source, optionsArgument);\n } else {\n return mergeObject(target, source, optionsArgument);\n }\n}\ndeepmerge.all = function deepmergeAll(array, optionsArgument) {\n if (!Array.isArray(array) || array.length < 2) {\n throw new Error('first argument should be an array with at least two elements');\n }\n\n // we are sure there are at least 2 values, so it is safe to have no initial value\n return array.reduce(function (prev, next) {\n return deepmerge(prev, next, optionsArgument);\n });\n};\n/* Deepmerge - Ends */\n\n// // Sample\n// const defaultPerson = {\n// name: 'Push',\n// gender: 'Male',\n// hair: {\n// color: 'Black',\n// cut: 'Short'\n// },\n// eyes: 'blue',\n// family: ['mom', 'dad']\n// };\n\n// const me = {\n// name: 'Nathan',\n// gender: 'Male',\n// hair: {\n// cut: 'Long'\n// },\n// family: ['wife', 'kids', 'dog']\n// };\n\n// const result1 = deepmerge(defaultPerson, me);\n// document.getElementById('result1').innerHTML = JSON.stringify(result1, null, \"\\t\");\n\n// const result2 = deepmerge.all([,\n// { level1: { level2: { name: 'Push', parts: ['head', 'shoulders'] } } },\n// { level1: { level2: { face: 'Round', parts: ['knees', 'toes'] } } },\n// { level1: { level2: { eyes: 'Black', parts: ['eyes'] } } },\n// ]);\n\n// document.getElementById('result2').innerHTML = JSON.stringify(result2, null, \"\\t\");\n;// CONCATENATED MODULE: ./GUDHUB/Utils/merge_chunks/merge_chunks.worker.js\nfunction mergeChunks(chunks) {\n const result = {};\n chunks.forEach(chunk => {\n chunk.items_list.forEach(item => {\n const dstItem = result[item.item_id];\n if (dstItem) {\n dstItem.trash = item.trash;\n return item.fields.forEach(srcField => {\n let isFieldNonExist = true;\n dstItem.fields = dstItem.fields.map(dstField => {\n if (Number(dstField.field_id) === Number(srcField.field_id)) {\n isFieldNonExist = false;\n if (dstField.field_value != srcField.field_value) {\n return {\n ...srcField,\n history: srcField.history.concat(dstField.history)\n };\n }\n return dstField;\n }\n return dstField;\n });\n if (isFieldNonExist) dstItem.fields.push(srcField);\n });\n }\n return result[item.item_id] = item;\n });\n });\n return Object.values(result);\n}\nself.onmessage = function (e) {\n const mergedChunks = mergeChunks(e.data);\n self.postMessage(mergedChunks);\n};\nfunction mergeChunksWorker() {\n return `function mergeChunks(chunks) {\n const result = {};\n \n chunks.forEach((chunk) => {\n chunk.items_list.forEach((item) => {\n const dstItem = result[item.item_id];\n if (dstItem) {\n dstItem.trash = item.trash;\n return item.fields.forEach((srcField) => {\n let isFieldNonExist = true;\n dstItem.fields = dstItem.fields.map((dstField) => {\n if (Number(dstField.field_id) === Number(srcField.field_id)) {\n isFieldNonExist = false;\n if (dstField.field_value != srcField.field_value) {\n return {\n ...srcField,\n history: srcField.history.concat(dstField.history),\n };\n }\n return dstField;\n }\n return dstField;\n });\n if (isFieldNonExist) dstItem.fields.push(srcField);\n });\n }\n return (result[item.item_id] = item);\n });\n });\n return Object.values(result);\n }\n\n\n self.onmessage = function(e) { \n const mergedChunks = mergeChunks(e.data);\n self.postMessage(mergedChunks);\n }`;\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/merge_chunks/merge_chunks.js\n\n\n// const mergeChunksWorkerSingletone = new Worker('mergeWorker.js'); //TODO\n\nfunction merge_chunks_mergeChunks(chunks) {\n if (typeof Worker !== 'undefined') {\n return new Promise((resolve, reject) => {\n const chunkWorkerBlob = new Blob([mergeChunksWorker()], {\n type: \"application/javascript\"\n });\n let worker = new Worker(URL.createObjectURL(chunkWorkerBlob));\n worker.postMessage(chunks);\n worker.onmessage = function (e) {\n resolve(e.data);\n worker.terminate();\n };\n worker.onerror = function (e) {\n reject();\n worker.terminate();\n };\n worker.postMessage(chunks);\n });\n } else {\n return mergeChunks(chunks);\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/nested_list/nested_list.js\nfunction makeNestedList(arr, id, parent_id, children_property, priority_property) {\n let array = JSON.parse(JSON.stringify(arr));\n let children = Boolean(children_property) ? children_property : 'children';\n let priority = Boolean(priority_property) ? priority_property : false;\n let i;\n for (i = 0; i < array.length; i++) {\n if (array[i][parent_id] && array[i][parent_id] !== 0) {\n array.forEach(parent => {\n if (array[i][parent_id] == parent[id]) {\n if (!parent[children]) {\n parent[children] = [];\n }\n parent[children].push(array[i]);\n array.splice(i, 1);\n i == 0 ? i = 0 : i--;\n } else if (parent[children]) {\n findIdsOfChildren(parent);\n }\n });\n }\n }\n function findIdsOfChildren(parent) {\n parent[children].forEach(child => {\n if (child[id] == array[i][parent_id]) {\n if (!child[children]) {\n child[children] = [];\n }\n child[children].push(array[i]);\n array.splice(i, 1);\n i == 0 ? i = 0 : i--;\n } else if (child[children]) {\n findIdsOfChildren(child);\n }\n });\n }\n function sortChildrensByPriority(unsorted_array) {\n unsorted_array.sort((a, b) => a[priority] - b[priority]);\n unsorted_array.forEach(element => {\n if (element[children]) {\n sortChildrensByPriority(element[children]);\n }\n });\n }\n if (priority) {\n sortChildrensByPriority(array);\n }\n return array;\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/MergeFields/MergeFields.js\nclass FieldsOperator {\n constructor(gudhub) {\n this.gudhub = gudhub;\n }\n mergeFieldLists(fieldsToView, fieldList) {\n let fieldsToViewCopy = JSON.parse(JSON.stringify(fieldsToView));\n let fieldListCopy = JSON.parse(JSON.stringify(fieldList));\n let existingFieldsIds = fieldListCopy.map(field => field.field_id);\n if (!fieldListCopy.length) {\n return [];\n }\n return fieldListCopy.reduce((viewArray, currentField) => {\n let positionInViewArray = null;\n let props = viewArray.find((view, index) => {\n if (currentField.field_id == view.field_id) {\n positionInViewArray = index;\n return true;\n }\n return false;\n });\n if (!props) {\n let defaultIntrpr = currentField.data_model && currentField.data_model.interpretation ? currentField.data_model.interpretation.find(intrpr => {\n return intrpr.src == 'table';\n }) || {\n settings: {\n show_field: 1\n }\n } : {\n settings: {\n show_field: 1\n }\n };\n if (defaultIntrpr.settings.show_field) {\n let firstMerge = this.gudhub.util.mergeObjects({\n show: 1\n }, defaultIntrpr);\n let secondMerge = this.gudhub.util.mergeObjects(firstMerge, currentField);\n viewArray.push(secondMerge);\n }\n } else {\n viewArray[positionInViewArray] = this.gudhub.util.mergeObjects(viewArray[positionInViewArray], currentField);\n }\n return viewArray;\n }, fieldsToViewCopy).filter(function (field) {\n return field.show && existingFieldsIds.indexOf(field.field_id) != -1;\n });\n }\n createFieldsListToView(appId, tableSettingsFieldListToView) {\n const self = this;\n return new Promise(async resolve => {\n let fieldList = await this.gudhub.getFieldModels(appId);\n if (tableSettingsFieldListToView.length !== 0) {\n let correctFieldList = [];\n tableSettingsFieldListToView.forEach((elementFromTable, index) => {\n let fieldOnPipe = fieldList.find(element => elementFromTable.field_id == element.field_id);\n if (fieldOnPipe) {\n let show_field = fieldOnPipe.data_model.interpretation.find(intrpr => intrpr.src == 'table');\n if (!show_field) {\n show_field = {\n settings: {\n show_field: 1\n }\n };\n }\n correctFieldList.push({\n field_id: fieldOnPipe.field_id,\n show: elementFromTable.show,\n width: elementFromTable.width ? elementFromTable.width : \"150px\"\n });\n }\n if (index + 1 == tableSettingsFieldListToView.length) {\n checkFiledFromPipe(correctFieldList);\n }\n });\n } else {\n checkFiledFromPipe(tableSettingsFieldListToView);\n }\n function checkFiledFromPipe(correctFieldList) {\n let counter = 0;\n fieldList.forEach((elemetFromPipe, index) => {\n let correctFiel = correctFieldList.find(elemet => elemetFromPipe.field_id == elemet.field_id);\n if (!correctFiel) {\n self.gudhub.ghconstructor.getInstance(elemetFromPipe.data_type).then(data => {\n if (data) {\n let template = data.getTemplate();\n let show_field = template.model.data_model.interpretation.find(intrpr => intrpr.src == 'table');\n if (!show_field) {\n show_field = {\n settings: {\n show_field: 1\n }\n };\n }\n correctFieldList.push({\n field_id: elemetFromPipe.field_id,\n show: show_field.settings.show_field\n });\n if (counter == fieldList.length - 1) {\n resolve(correctFieldList);\n }\n }\n counter++;\n }, function errorCallback(result) {\n counter++;\n });\n } else {\n if (counter == fieldList.length - 1) {\n resolve(correctFieldList);\n }\n counter++;\n }\n });\n }\n });\n }\n createFieldsListToViewWithDataType(appId, tableSettingsFieldListToView) {\n return new Promise(async resolve => {\n let columnsToView = [];\n let fieldList = await this.gudhub.getFieldModels(appId);\n let actualFieldIds = fieldList.map(field => +field.field_id);\n const promises = [];\n columnsToView = fieldList.reduce((viewColumsList, currentField) => {\n let field = viewColumsList.find((view, index) => {\n if (currentField.field_id == view.field_id) {\n return true;\n }\n return false;\n });\n if (!field) {\n viewColumsList.push({\n field_id: currentField.field_id,\n data_type: currentField.data_type\n });\n promises.push(new Promise(async resolve => {\n const instance = await this.gudhub.ghconstructor.getInstance(currentField.data_type);\n const template = instance.getTemplate();\n const defaultIntepretation = template.model.data_model.interpretation.find(intrpr => intrpr.src == 'table') || {\n settings: {\n show_field: 1\n }\n };\n viewColumsList.find(view => view.field_id == currentField.field_id).show = defaultIntepretation.settings.show_field;\n resolve(true);\n }));\n }\n return viewColumsList;\n }, tableSettingsFieldListToView);\n Promise.all(promises).then(() => {\n columnsToView = columnsToView.filter(field => actualFieldIds.indexOf(field.field_id) != -1);\n resolve(columnsToView);\n });\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/ItemsSelection/ItemsSelection.js\nclass ItemsSelection {\n constructor(gudhub) {\n this.gudhub = gudhub;\n this.selectedItems = {};\n }\n async selectItems(appId, items) {\n if (!this.selectedItems.hasOwnProperty(appId)) {\n this.selectedItems[appId] = {\n items: [],\n app: []\n };\n let app = await this.gudhub.getApp(appId);\n this.selectedItems[appId].app = app;\n }\n let itemObject = this.selectedItems[appId];\n let selectedItemsIds = itemObject.items.map(obj => obj.item_id);\n items.forEach(item => {\n if (selectedItemsIds.indexOf(item.item_id) != -1) {\n itemObject.items.splice(selectedItemsIds.indexOf(item.item_id), 1);\n } else {\n itemObject.items[itemObject.items.length] = item;\n }\n });\n }\n getSelectedItems(appId) {\n return this.selectedItems[appId] ? this.selectedItems[appId] : {\n items: [],\n app: []\n };\n }\n clearSelectedItems(appId) {\n if (this.selectedItems[appId]) {\n this.selectedItems[appId].items = [];\n }\n }\n isItemSelected(appId, itemId) {\n let array = this.getSelectedItems(appId);\n if (array !== null) {\n array = array.items.map(obj => obj.item_id);\n return array.indexOf(itemId) != -1;\n } else {\n return false;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/compare_items_lists_worker/compare_items_lists.worker.js\nfunction compare_items_lists_Worker() {\n return `function createList(items) {\n return items.reduce(\n (acc, item) => {\n acc.list[item.item_id] = item;\n acc.ids.push(item.item_id);\n return acc;\n },\n { ids: [], list: {} }\n );\n };\n function compareItemsLists(oldItems, newItems) {\n const { ids: oldIds, list: oldList } = createList(oldItems);\n const { ids: newIds, list: newList } = createList(newItems);\n\n const deletedItemsIds = oldIds.filter((id) => !newIds.includes(id));\n const recentItemsIds = oldIds.filter((id) => !deletedItemsIds.includes(id));\n const newItemsIds = newIds.filter((id) => !oldIds.includes(id));\n\n const diff_fields_items = {};\n const diff_fields_items_Ids = [];\n \n recentItemsIds.forEach((id) => {\n const newItem = newList[id];\n const oldItem = oldList[id];\n\n oldItem.fields.forEach((field1) => {\n const sameField = newItem.fields.find(\n (field2) => Number(field2.field_id) === Number(field1.field_id)\n );\n\n if (!sameField) {\n if (!diff_fields_items[newItem.item_id]) {\n diff_fields_items[newItem.item_id] = [];\n diff_fields_items_Ids.push(newItem.item_id);\n }\n\n return diff_fields_items[newItem.item_id].push(field1);\n }\n\n if (field1.field_value != sameField.field_value) {\n if (!diff_fields_items[newItem.item_id]) {\n diff_fields_items[newItem.item_id] = [];\n diff_fields_items_Ids.push(newItem.item_id);\n }\n return diff_fields_items[newItem.item_id].push(field1);\n }\n });\n });\n\n return {\n newItems: newItemsIds.reduce((acc, id) => {\n acc.push(newList[id]);\n return acc;\n }, []),\n deletedItems: deletedItemsIds.reduce((acc, id) => {\n acc.push(oldList[id]);\n return acc;\n }, []),\n diff_fields_items_Ids,\n diff_fields_items,\n diff_items: diff_fields_items_Ids.reduce((acc, id) => {\n acc.push(oldList[id]);\n return acc;\n }, []),\n };\n }\n\n self.addEventListener(\"message\", (event) => {\n const { items_list1, items_list2 } = event.data;\n\n const diff = compareItemsLists(items_list1, items_list2);\n self.postMessage({ diff });\n });`;\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/json_constructor/json_constructor.js\nfunction compiler(scheme, item, util, variables, appId) {\n async function schemeCompiler(scheme, item, appId) {\n let value = null;\n if (scheme.type === \"array\") {\n // get properties value for array childs for each application item\n if (Number(scheme.is_static)) {\n value = new Array(await getChildsPropertiesObject(scheme.childs, item, appId));\n } else {\n value = await getArrayOfItemsWithProperties(scheme, item, appId);\n }\n }\n if (scheme.type === \"object\") {\n // get properties value for object childs\n if (Number(scheme.current_item)) {\n value = await getItemWithProperties(scheme, item);\n } else {\n value = await getChildsPropertiesObject(scheme.childs, item, appId);\n }\n }\n if (scheme.type === \"property\") {\n // get properties value\n value = await getFieldValue(scheme, item, appId);\n }\n if (typeof scheme === \"object\" && typeof scheme.type === 'undefined') {\n const result = {};\n for (const key in scheme) {\n if (scheme.hasOwnProperty(key)) {\n const element = scheme[key];\n const res = await schemeCompiler(element, item, appId);\n result[key] = res[element.property_name];\n }\n }\n return result;\n }\n return {\n [scheme.property_name]: value\n };\n }\n\n /* Get properties value for array childs in scheme, for each application filtered item. */\n async function getArrayOfItemsWithProperties(scheme, item, recievedApp) {\n const app = await util.gudhub.getApp(Number(scheme.app_id));\n let filteredItems = await filterItems(scheme.filter, app.items_list, recievedApp, item);\n if (scheme.isSortable && scheme.field_id_to_sort && scheme.field_id_to_sort !== '') {\n let itemsWithValue = filteredItems.flatMap(item => {\n let fieldToSort = item.fields.find(field => field.field_id == scheme.field_id_to_sort);\n if (!fieldToSort || fieldToSort.field_value == '') {\n return [];\n } else {\n return item;\n }\n });\n let itemsWithoutValue = filteredItems.filter(item => {\n if (!itemsWithValue.includes(item)) {\n return item;\n }\n });\n itemsWithValue = itemsWithValue.sort((a, b) => {\n if (scheme.sortType == 'desc') {\n return b.fields.find(field => field.field_id == scheme.field_id_to_sort).field_value - a.fields.find(field => field.field_id == scheme.field_id_to_sort).field_value;\n } else {\n return a.fields.find(field => field.field_id == scheme.field_id_to_sort).field_value - b.fields.find(field => field.field_id == scheme.field_id_to_sort).field_value;\n }\n });\n filteredItems = [...itemsWithValue, ...itemsWithoutValue];\n }\n if (scheme.offset) {\n let offset;\n if (scheme.use_variables_for_limit_and_offset && variables) {\n offset = variables[scheme.offset];\n } else {\n offset = /^[0-9]+$/.test(scheme.offset) ? scheme.offset : 0;\n }\n filteredItems = filteredItems.slice(offset);\n }\n if (scheme.limit) {\n let limit;\n if (scheme.use_variables_for_limit_and_offset && variables) {\n limit = variables[scheme.limit];\n } else {\n limit = /^[0-9]+$/.test(scheme.limit) || 0;\n }\n if (limit !== 0) {\n filteredItems = filteredItems.slice(0, limit);\n }\n }\n const arrayOfItemsWithProperties = filteredItems.map(async item => {\n return getChildsPropertiesObject(scheme.childs, item, app.app_id);\n });\n return Promise.all(arrayOfItemsWithProperties);\n }\n async function getItemWithProperties(scheme, item) {\n const app = await util.gudhub.getApp(scheme.app_id);\n const items = app.items_list || [];\n return getChildsPropertiesObject(scheme.childs, item || items[0], app.app_id);\n }\n\n /* Get properties value for object childs in scheme. */\n async function getChildsPropertiesObject(properties, item, appId) {\n const propertiesArray = await properties.map(async child => {\n return schemeCompiler(child, item, appId);\n });\n const resolvedPropertiesArray = await Promise.all(propertiesArray);\n return resolvedPropertiesArray.reduce((acc, object) => {\n return {\n ...acc,\n ...object\n };\n }, {});\n }\n\n /* Get property value based on interpretation value */\n async function getFieldValue(scheme, item, appId) {\n switch (scheme.property_type) {\n case \"static\":\n return scheme.static_field_value;\n case \"variable\":\n switch (scheme.variable_type) {\n case \"app_id\":\n return appId;\n // case \"user_id\":\n // resolve(storage.getUser().user_id);\n // break;\n case \"current_item\":\n default:\n return `${appId}.${item.item_id}`;\n }\n case \"field_id\":\n return scheme.field_id;\n case \"function\":\n if (typeof scheme.function === 'function') {\n let result = scheme.function(item, appId, util.gudhub, ...scheme.args);\n return result;\n } else {\n const func = new Function('item, appId, gudhub', 'return (async ' + scheme.function + ')(item, appId, gudhub)');\n let result = await func(item, appId, util.gudhub);\n return result;\n }\n case \"field_value\":\n default:\n if (!scheme.field_id && scheme.name_space) {\n scheme.field_id = await util.gudhub.getFieldIdByNameSpace(appId, scheme.name_space);\n }\n if (Boolean(Number(scheme.interpretation))) {\n let interpretatedValue = await util.gudhub.getInterpretationById(Number(appId), Number(item.item_id), Number(scheme.field_id), 'value');\n return interpretatedValue;\n } else {\n let value = await util.gudhub.getFieldValue(Number(appId), Number(item.item_id), Number(scheme.field_id));\n return value;\n }\n }\n }\n async function getFilteredItems(filtersList, element_app_id, app_id, item_id, itemsList) {\n const modified_filters_list = await util.gudhub.prefilter(JSON.parse(JSON.stringify(filtersList)), {\n element_app_id,\n app_id,\n item_id,\n ...variables\n });\n return util.gudhub.filter(itemsList, [...modified_filters_list, ...filtersList]);\n }\n\n /* Filter items by scheme filter */\n async function filterItems(filtersList = [], itemsList = [], appId = '', item = {}) {\n return filtersList.length ? getFilteredItems(filtersList, appId, appId, item.item_id, itemsList) : [...itemsList];\n }\n return schemeCompiler(scheme, item, appId, variables);\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/AppsTemplateService/AppsTemplateService.js\nclass AppsTemplateService {\n constructor(gudhub) {\n this.gudhub = gudhub;\n this.appsConnectingMap = {\n apps: [],\n fields: [],\n items: [],\n views: []\n };\n }\n createAppsFromTemplate(pack, maxNumberOfInsstalledItems, progressCallback, installFromMaster) {\n const self = this;\n return new Promise(resolve => {\n const stepsCount = pack.apps.length * 6;\n const stepPercents = 100 / stepsCount;\n let currentStep = 0;\n self.createApps(pack, status => {\n currentStep += 1;\n progressCallback ? progressCallback.call(this, {\n percent: currentStep * stepPercents,\n status\n }) : null;\n }, installFromMaster).then(success => {\n self.createItems(success, maxNumberOfInsstalledItems, status => {\n if (typeof status === 'string') {\n currentStep += 1;\n progressCallback ? progressCallback.call(this, {\n percent: currentStep * stepPercents,\n status\n }) : null;\n } else if (typeof status === 'object') {\n progressCallback ? progressCallback.call(this, {\n status: 'Done',\n apps: status\n }) : null;\n resolve();\n }\n }, installFromMaster);\n });\n });\n }\n createItems(create_apps, maxNumberOfInsstalledItems, callback, installFromMaster) {\n return new Promise(async resolve => {\n const MAX_NUMBER_OF_INSTALLED_ITEMS = maxNumberOfInsstalledItems ? maxNumberOfInsstalledItems : 100000;\n const self = this;\n let createsItems = [];\n let promises = [];\n const {\n accesstoken\n } = await self.gudhub.req.axiosRequest({\n method: 'POST',\n url: 'https://gudhub.com/GudHub_Test/auth/login',\n form: {\n auth_key: '3HMOtCbC0M/1/1e4y4Uxo/Kh/aFN4V5LG2//5ixx7TZyiUfMb7IHAAHCj9PsLrOSDrZuuWkbX4BIX23f51H+eA=='\n }\n });\n create_apps.forEach(app => {\n promises.push(new Promise(async app_resolve => {\n let result_app;\n if (installFromMaster) {\n result_app = await self.gudhub.req.axiosRequest({\n url: `https://gudhub.com/GudHub_Test/api/app/get?token=${accesstoken}&app_id=${self._searchOldAppId(app.app_id, self.appsConnectingMap.apps)}`,\n method: 'GET'\n });\n } else {\n result_app = await self.gudhub.getApp(self._searchOldAppId(app.app_id, self.appsConnectingMap.apps));\n }\n callback ? callback.call(this, `GET APP: ${result_app.app_name} (Items steps)`) : null;\n let source_app = JSON.parse(JSON.stringify(result_app));\n let items = source_app.items_list.map(item => {\n return {\n index_number: item.index_number,\n item_id: 0,\n fields: []\n };\n }).filter((item, index) => index <= MAX_NUMBER_OF_INSTALLED_ITEMS);\n self.gudhub.addNewItems(app.app_id, items).then(items => {\n callback ? callback.call(this, `ADD NEW ITEMS: ${result_app.app_name} (Items steps)`) : null;\n app.items_list = items;\n self._updateMap(app.items_list, source_app.items_list);\n self._addFieldValue(source_app.items_list, app.items_list, self.appsConnectingMap);\n createsItems.push(app);\n app_resolve();\n });\n }));\n });\n Promise.all(promises).then(() => {\n createsItems.forEach(app => {\n app.items_list.forEach(item => {\n item.fields.forEach(field_item => {\n self.appsConnectingMap.fields.forEach(field_map => {\n if (field_item.field_id === field_map.old_field_id) {\n field_item.field_id = field_map.new_field_id;\n field_item.element_id = field_map.new_field_id;\n }\n });\n });\n });\n });\n self.deleteField(createsItems);\n self.replaceValue(createsItems, self.appsConnectingMap).then(() => {\n const promises = [];\n createsItems.forEach(created_app => {\n promises.push(new Promise(resolve => {\n let newItems = created_app.items_list.map(item => {\n item.fields.forEach(field => {\n delete field.data_id;\n });\n return item;\n });\n self.gudhub.updateItems(created_app.app_id, newItems).then(() => {\n callback ? callback.call(this, `REPLACE VALUE: ${created_app.app_name} (Items steps)`) : null;\n resolve();\n });\n }));\n });\n Promise.all(promises).then(() => {\n callback.call(this, createsItems);\n resolve();\n });\n });\n });\n });\n }\n deleteField(apps) {\n apps.forEach(app => {\n app.items_list.forEach(item => {\n item.fields = item.fields.filter(field => {\n return app.field_list.findIndex(f => f.field_id == field.field_id) > -1;\n });\n });\n });\n }\n replaceValue(apps, map) {\n return new Promise(async resolve => {\n const allPromises = [];\n const self = this;\n apps.forEach(app => {\n app.field_list.forEach(field_of_list => {\n if (field_of_list.data_type === 'item_ref') {\n self._replaceValueItemRef(app, field_of_list, map);\n }\n allPromises.push(new Promise(resolve => {\n self.gudhub.ghconstructor.getInstance(field_of_list.data_type).then(data => {\n if (typeof data === 'undefined') {\n console.log('ERROR WHILE GETTING INSTANCE OF ', field_of_list.data_type);\n resolve({\n type: field_of_list.data_type\n });\n return;\n }\n if (data.getTemplate().constructor == 'file') {\n return self.gudhub.util.fileInstallerHelper(app.app_id, app.items_list, field_of_list.field_id).then(result => {\n resolve(result);\n });\n } else if (data.getTemplate().constructor == 'document') {\n self.documentInstallerHelper(app.app_id, app.items_list, field_of_list.field_id).then(result => {\n resolve(data);\n });\n } else {\n resolve(data);\n }\n });\n }));\n });\n });\n if (allPromises.length > 0) {\n Promise.all(allPromises).then(result => {\n resolve(result);\n });\n } else {\n resolve(result);\n }\n });\n }\n documentInstallerHelper(appId, items, elementId) {\n const self = this;\n return new Promise(async resolve => {\n for (const item of items) {\n const itemId = item.item_id;\n const field = item.fields.find(field => field.element_id === elementId);\n if (field && field.field_value && field.field_value.length > 0) {\n const document = await self.gudhub.getDocument({\n _id: field.field_value\n });\n if (document && document.data) {\n const newDocument = await self.gudhub.createDocument({\n app_id: appId,\n item_id: itemId,\n element_id: elementId,\n data: document.data\n });\n field.field_value = newDocument._id;\n }\n }\n }\n resolve();\n });\n }\n _replaceValueItemRef(app, field_of_list, map) {\n app.items_list.forEach(item => {\n item.fields.forEach(field_of_item => {\n if (field_of_item.field_id === field_of_list.field_id && field_of_item.field_value) {\n let arr_values = field_of_item.field_value.split(',');\n arr_values.forEach((one_value, key) => {\n let value = one_value.split('.');\n map.apps.forEach(app_ids => {\n if (value[0] == app_ids.old_app_id) {\n value[0] = app_ids.new_app_id;\n }\n });\n map.items.forEach(item_ids => {\n if (value[1] == item_ids.old_item_id) {\n value[1] = item_ids.new_item_id;\n }\n });\n arr_values[key] = value.join('.');\n });\n field_of_item.field_value = arr_values.join(',');\n }\n });\n });\n }\n _addFieldValue(source_app_items, create_items, appsConnectingMap) {\n create_items.forEach(new_item => {\n appsConnectingMap.items.forEach(item_of_map => {\n if (new_item.item_id === item_of_map.new_item_id) {\n source_app_items.forEach(old_item => {\n if (item_of_map.old_item_id === old_item.item_id) {\n new_item.fields = old_item.fields;\n }\n });\n }\n });\n });\n }\n _updateMap(new_items, old_items) {\n old_items.forEach(old_item => {\n new_items.forEach(new_item => {\n if (old_item.index_number === new_item.index_number) {\n this.appsConnectingMap.items.push({\n old_item_id: old_item.item_id,\n new_item_id: new_item.item_id\n });\n }\n });\n });\n }\n _searchOldAppId(app_id, apps) {\n let findId = 0;\n apps.forEach(value => {\n if (value.new_app_id === app_id) {\n findId = value.old_app_id;\n }\n });\n return findId;\n }\n createApps(pack, callback, installFromMaster) {\n const self = this;\n let progress = {\n step_size: 100 / (pack.apps.length * 3),\n apps: []\n };\n return new Promise(async resolve => {\n let source_apps = {};\n let created_apps = [];\n let updated_apps = [];\n const {\n accesstoken\n } = await self.gudhub.req.axiosRequest({\n method: 'POST',\n url: 'https://gudhub.com/GudHub_Test/auth/login',\n form: {\n auth_key: '3HMOtCbC0M/1/1e4y4Uxo/Kh/aFN4V5LG2//5ixx7TZyiUfMb7IHAAHCj9PsLrOSDrZuuWkbX4BIX23f51H+eA=='\n }\n });\n for (const app_id of pack.apps) {\n let result_app;\n if (installFromMaster) {\n result_app = await self.gudhub.req.axiosRequest({\n url: `https://gudhub.com/GudHub_Test/api/app/get?token=${accesstoken}&app_id=${app_id}`,\n method: 'GET'\n });\n } else {\n result_app = await self.gudhub.getApp(app_id);\n }\n callback ? callback.call(this, `GET APP: ${result_app.app_name} (App steps)`) : null;\n let source_app = JSON.parse(JSON.stringify(result_app));\n source_apps[source_app.app_id] = source_app;\n progress.apps.push(source_app.icon);\n let appTemplate = self.prepareAppTemplate(source_app);\n appTemplate.app_name = appTemplate.app_name + ' New';\n appTemplate.privacy = 1;\n if (pack.data_to_change) {\n if (pack.data_to_change.name) {\n appTemplate.app_name = pack.data_to_change.name;\n }\n if (pack.data_to_change.icon) {\n appTemplate.icon = pack.data_to_change.icon;\n }\n }\n self.resetViewsIds(appTemplate);\n self.gudhub.createNewApp(appTemplate).then(created_app => {\n callback ? callback.call(this, `CREATE NEW APP: ${result_app.app_name} (App steps)`) : null;\n created_apps.push(created_app);\n self.mapApp(source_app, created_app, self.appsConnectingMap);\n if (pack.apps.length == created_apps.length) {\n self.connectApps(created_apps, self.appsConnectingMap, source_apps);\n created_apps.forEach(created_app => {\n self.gudhub.updateApp(created_app).then(updated_app => {\n callback ? callback.call(this, `UPDATE APP: ${result_app.app_name} (App steps)`) : null;\n updated_apps.push(updated_app);\n if (pack.apps.length == updated_apps.length) {\n resolve(updated_apps);\n }\n });\n });\n }\n });\n }\n });\n }\n mapApp(base_app, new_app, appsConnectingMap) {\n appsConnectingMap.apps.push({\n old_app_id: base_app.app_id,\n new_app_id: new_app.app_id,\n old_view_init: base_app.view_init,\n new_view_init: new_app.view_init\n });\n base_app.field_list.forEach(old_field => {\n new_app.field_list.forEach(new_field => {\n if (old_field.name_space == new_field.name_space) {\n appsConnectingMap.fields.push({\n name_space: old_field.name_space,\n old_field_id: old_field.field_id,\n new_field_id: new_field.field_id\n });\n }\n });\n });\n base_app.views_list.forEach(old_view => {\n new_app.views_list.forEach(new_view => {\n if (old_view.name == new_view.name) {\n appsConnectingMap.views.push({\n name: old_view.name,\n old_view_id: old_view.view_id,\n new_view_id: new_view.view_id\n });\n }\n });\n });\n }\n crawling(object, action) {\n let properties = object === null ? [] : Object.keys(object);\n const self = this;\n if (properties.length > 0) {\n properties.forEach(prop => {\n let propertyValue = object[prop];\n if (typeof propertyValue !== 'undefined' && typeof object != 'string') {\n action(prop, propertyValue, object);\n self.crawling(propertyValue, action);\n }\n });\n }\n }\n resetViewsIds(app) {\n app.view_init = 0;\n this.crawling(app.views_list, function (prop, value, parent) {\n if (prop == 'view_id' || prop == 'container_id') {\n parent[prop] = 0;\n }\n });\n }\n connectApps(apps, appsConnectingMap, source_apps) {\n const self = this;\n apps.forEach(app => {\n appsConnectingMap.apps.forEach(appMap => {\n if (app.view_init === appMap.new_view_init) {\n appsConnectingMap.views.forEach(view => {\n if (appMap.old_view_init === view.old_view_id) {\n app.view_init = view.new_view_id;\n }\n });\n }\n });\n self.crawling(app.field_list, function (prop, value, parent) {\n if (prop.indexOf(\"field_id\") !== -1 || prop.indexOf(\"FieldId\") !== -1 || prop.indexOf(\"destination_field\") !== -1) {\n let fieldsArr = String(value).split(','),\n newFieldsArr = [];\n appsConnectingMap.fields.forEach(field => {\n fieldsArr.forEach(fieldFromValue => {\n if (fieldFromValue == field.old_field_id) {\n newFieldsArr.push(field.new_field_id);\n }\n });\n });\n if (newFieldsArr.length) {\n parent[prop] = newFieldsArr.join(',');\n }\n }\n if (prop.indexOf(\"app_id\") != -1 || prop.indexOf(\"AppId\") != -1 || prop.indexOf(\"destination_app\") != -1) {\n appsConnectingMap.apps.forEach(app => {\n if (value == app.old_app_id) {\n parent[prop] = app.new_app_id;\n }\n });\n }\n if (prop.indexOf(\"view_id\") !== -1) {\n appsConnectingMap.views.forEach(view => {\n if (value == view.old_view_id) {\n parent[prop] = view.new_view_id;\n }\n });\n }\n if (prop.indexOf(\"src\") !== -1 && isFinite(value)) {\n const pron_name = 'container_id';\n const old_app_id = appsConnectingMap.apps.find(appMap => appMap.new_app_id === app.app_id).old_app_id;\n const path = self.findPath(source_apps[old_app_id].views_list, pron_name, value);\n parent[prop] = `${self.getValueByPath(app.views_list, path, pron_name)}`;\n }\n });\n });\n return apps;\n }\n getValueByPath(source, path, prop) {\n let temp = source;\n path.split('.').forEach(item => {\n temp = temp[item];\n });\n return temp[prop];\n }\n findPath(source, prop, value) {\n const self = this;\n let isFound = false;\n let toClearPath = false;\n let path = [];\n self.crawling(source, function (propSource, valueSource, parentSource) {\n if (toClearPath) {\n path.reverse().forEach(item => {\n if (toClearPath) {\n item.delete = true;\n if (item.parent === parentSource) {\n toClearPath = false;\n path = path.filter(item => !item.delete);\n path.reverse();\n }\n }\n });\n }\n if (!isFound) {\n if (typeof parentSource[propSource] === 'object') {\n path.push({\n prop: propSource,\n parent: parentSource\n });\n }\n if (valueSource == value && prop === propSource) {\n isFound = true;\n } else if (Object.keys(parentSource).pop() === propSource && typeof parentSource[propSource] !== 'object') {\n toClearPath = true;\n }\n }\n });\n return path.map(item => item.prop).join('.');\n }\n prepareAppTemplate(appToTemplate) {\n const self = this;\n let app = JSON.parse(JSON.stringify(appToTemplate));\n self.crawling(app.views_list, function (prop, value, parent) {\n if (prop == \"element_id\") {\n parent.element_id = -Number(value);\n parent.create_element = -Number(value);\n }\n });\n app.field_list.forEach(field => {\n field.create_field = -Number(field.field_id);\n field.element_id = -Number(field.field_id);\n field.field_id = -Number(field.field_id);\n field.field_value = \"\"; /* Should be removed when we update createApp API*/\n });\n\n app.items_list = [];\n delete app.app_id;\n delete app.icon.id;\n delete app.group_id;\n delete app.trash;\n delete app.last_update;\n delete app.file_list;\n return app;\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/FIleHelper/FileHelper.js\nclass FileHelper {\n constructor(gudhub) {\n this.gudhub = gudhub;\n }\n fileInstallerHelper(appId, items, elementId) {\n const self = this;\n return new Promise(resolve => {\n const files = [[]];\n let chainPromises = Promise.resolve();\n let results = [];\n items.forEach(item => {\n const itemId = item.item_id;\n const field = item.fields.find(field => field.element_id === elementId);\n if (field && field.field_value) {\n const fileIds = field.field_value.split('.');\n fileIds.forEach(fileId => {\n const newFile = {\n source: fileId,\n destination: {\n app_id: appId,\n item_id: itemId,\n element_id: elementId\n }\n };\n if (files[files.length - 1].length !== 10) {\n // 10 - max duplicate files\n files[files.length - 1].push(newFile);\n } else {\n files.push([newFile]);\n }\n });\n }\n });\n files.forEach(filePack => {\n chainPromises = chainPromises.then(() => {\n return self.gudhub.duplicateFile(filePack);\n }).then(result => {\n results = [...results, ...result];\n });\n });\n chainPromises.then(() => {\n items.forEach(item => {\n const itemId = item.item_id;\n const field = item.fields.find(field => field.element_id === elementId);\n if (field && field.field_value) {\n field.field_value = '';\n results.forEach(file => {\n if (file.item_id === itemId) {\n field.field_value = field.field_value.split(',').filter(fileId => fileId).concat(file.file_id).join(',');\n }\n });\n }\n });\n resolve();\n });\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/compareObjects/compareObjects.js\nfunction compareObjects(target, source) {\n return JSON.stringify(target) === JSON.stringify(source);\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/dynamicPromiseAll/dynamicPromiseAll.js\nasync function dynamicPromiseAll(promises) {\n await Promise.all(promises);\n let allDone = true;\n for (const promise of promises) {\n const result = await _checkPromiseStatus(promise);\n if (result.state === 'pending') {\n allDone = false;\n break;\n }\n if (result.state === 'rejected') {\n throw result.reason;\n break;\n }\n }\n if (allDone) {\n return true;\n }\n return dynamicPromiseAll(promises);\n}\nfunction _checkPromiseStatus(promise) {\n const pending = {\n state: 'pending'\n };\n return Promise.race([promise, pending]).then(value => {\n if (value === pending) {\n return value;\n }\n return {\n state: 'resolved',\n value\n };\n }, reason => ({\n state: 'rejected',\n reason\n }));\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/sortItems.js\n/**\n * Sort items by field value of given field\n * \n * @param {array} items - items of application\n * @param {object} options - object with options for sorting\n * @property {number|string} sort_field_id - field id for sorting items \n * @property {boolean} descending - sort type (if set to true - items sort by descending else by ascending)\n * \n */\n\nfunction sortItems(items, options) {\n /*-- stop filtering if arguments are empty*/\n if (!items || !items.length) {\n return [];\n }\n if (!items[0].fields.length) {\n return items;\n }\n var compareFieldId = options && options.sort_field_id || items[0].fields[0].field_id;\n\n /* Get field value*/\n function getFieldValue(item) {\n var result = null;\n for (var i = 0; i < item.fields.length; i++) {\n if (item.fields[i].field_id == compareFieldId) {\n result = item.fields[i].field_value;\n break;\n }\n }\n return result;\n }\n\n /* Sort items array*/\n items.sort(function (a, b) {\n var aVal = getFieldValue(a);\n var bVal = getFieldValue(b);\n if (aVal === null) {\n return -1;\n }\n if (bVal === null) {\n return 1;\n }\n if (/^\\d+$/.test(aVal) && /^\\d+$/.test(bVal)) {\n return Number(aVal) < Number(bVal) ? -1 : 1;\n }\n if (/^\\d+$/.test(aVal) || /^\\d+$/.test(bVal)) {\n return /^\\d+$/.test(aVal) ? -1 : 1;\n }\n return aVal.toLowerCase() > bVal.toLowerCase() ? 1 : -1;\n });\n return options && options.descending ? items.reverse() : items;\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/Utils.js\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nclass Utils {\n constructor(gudhub) {\n this.gudhub = gudhub;\n this.MergeFields = new FieldsOperator(gudhub);\n this.ItemsSelection = new ItemsSelection(gudhub);\n this.AppsTemplateService = new AppsTemplateService(gudhub);\n this.FileHelper = new FileHelper(gudhub);\n }\n prefilter(filters_list, variables = {}) {\n return filterPreparation(filters_list, this.gudhub.storage, this.gudhub.pipeService, variables);\n }\n filter(items, filter_list) {\n return filter(items, filter_list);\n }\n mergeFilters(src, dest) {\n return mergeFilters(src, dest);\n }\n group(fieldGroup, items) {\n return group(fieldGroup, items);\n }\n async getFilteredItems(items = [], filters_list = [], element_app_id, app_id, item_id, field_group = \"\", search, search_params) {\n const modified_filters_list = await this.prefilter(filters_list, {\n element_app_id,\n app_id,\n item_id\n });\n const itemsList = this.filter(items, modified_filters_list);\n const newItems = this.group(field_group, itemsList);\n return newItems.filter(newItem => {\n if (search) {\n return searchValue([newItem], search).length === 1;\n } else return true;\n }).filter(newItem => {\n if (search_params) {\n return searchValue([newItem], search_params).length === 1;\n } else return true;\n });\n }\n jsonToItems(json, map) {\n return jsonToItems(json, map);\n }\n getDate(queryKey) {\n return get_date_getDate(queryKey);\n }\n checkRecurringDate(date, option) {\n return checkRecurringDate(date, option);\n }\n populateItems(items, model, keep_data) {\n return populateItems(items, model, keep_data);\n }\n populateWithDate(items, model) {\n return populateWithDate(items, model);\n }\n populateWithItemRef(sourceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id) {\n return populateWithItemRef(sourceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id);\n }\n\n //here\n compareItems(sourceItems, destinationItems, fieldToCompare) {\n return compareItems(sourceItems, destinationItems, fieldToCompare);\n }\n mergeItems(sourceItems, destinationItems, mergeByFieldId) {\n return mergeItems(sourceItems, destinationItems, mergeByFieldId);\n }\n mergeObjects(target, source, optionsArgument) {\n return mergeObjects(target, source, optionsArgument);\n }\n makeNestedList(arr, id, parent_id, children_property, priority_property) {\n return makeNestedList(arr, id, parent_id, children_property, priority_property);\n }\n async mergeChunks(chunks) {\n return merge_chunks_mergeChunks(chunks);\n\n // const chunkWorkerBlob = new Blob([mergeChunksWorker()], {\n // type: \"application/javascript\",\n // });\n // this.worker = new Worker(URL.createObjectURL(chunkWorkerBlob));\n // this.worker.postMessage(chunks);\n // this.worker.addEventListener(\"message\", (event) => {\n // const { diff } = event.data;\n // callback(event.data);\n // });\n }\n\n mergeFieldLists(fieldsToView, fieldList) {\n return this.MergeFields.mergeFieldLists(fieldsToView, fieldList);\n }\n createFieldsListToView(appId, tableSettingsFieldListToView) {\n return this.MergeFields.createFieldsListToView(appId, tableSettingsFieldListToView);\n }\n createFieldsListToViewWithDataType(appId, tableSettingsFieldListToView) {\n return this.MergeFields.createFieldsListToViewWithDataType(appId, tableSettingsFieldListToView);\n }\n selectItems(appId, items) {\n return this.ItemsSelection.selectItems(appId, items);\n }\n getSelectedItems(appId) {\n return this.ItemsSelection.getSelectedItems(appId);\n }\n clearSelectedItems(appId) {\n return this.ItemsSelection.clearSelectedItems(appId);\n }\n isItemSelected(appId, itemId) {\n return this.ItemsSelection.isItemSelected(appId, itemId);\n }\n jsonConstructor(scheme, item, variables, appId) {\n return compiler(scheme, item, this, variables, appId);\n }\n fileInstallerHelper(appId, items, elementId) {\n return this.FileHelper.fileInstallerHelper(appId, items, elementId);\n }\n createAppsFromTemplate(pack, maxNumberOfInsstalledItems, progressCallback, installFromMaster) {\n return this.AppsTemplateService.createAppsFromTemplate(pack, maxNumberOfInsstalledItems, progressCallback, installFromMaster);\n }\n createApps(pack) {\n return this.AppsTemplateService.createApps(pack);\n }\n createItems(create_apps, maxNumberOfInsstalledItems) {\n return this.AppsTemplateService.createItems(create_apps, maxNumberOfInsstalledItems);\n }\n compareObjects(obj1, obj2) {\n return compareObjects(obj1, obj2);\n }\n compareAppsItemsLists(items_list1, items_list2, callback) {\n const chunkWorkerBlob = new Blob([compare_items_lists_Worker()], {\n type: \"application/javascript\"\n });\n this.worker = new Worker(URL.createObjectURL(chunkWorkerBlob));\n this.worker.postMessage({\n items_list1,\n items_list2\n });\n this.worker.addEventListener(\"message\", event => {\n const {\n diff\n } = event.data;\n callback(diff);\n });\n }\n dynamicPromiseAll(promisesArray) {\n return dynamicPromiseAll(promisesArray);\n }\n sortItems(items, options) {\n return sortItems(items, options);\n }\n debounce(func, delay) {\n let timeoutId;\n return function (...args) {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => {\n func.apply(this, args);\n }, delay);\n };\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Auth/Auth.js\nclass Auth {\n constructor(req, storage) {\n this.req = req;\n this.storage = storage;\n }\n async login({\n username,\n password\n } = {}) {\n const user = await this.loginApi(username, password);\n this.storage.updateUser(user);\n return user;\n }\n async loginWithToken(token) {\n const user = await this.loginWithTokenApi(token);\n this.storage.updateUser(user);\n return user;\n }\n async logout(token) {\n const response = await this.logoutApi(token);\n return response;\n }\n async signup(user) {\n const newUser = await this.signupApi(user);\n return newUser;\n }\n async updateToken(auth_key) {\n const user = await this.updateTokenApi(auth_key);\n return user;\n }\n async updateUser(userData) {\n const user = await this.updateUserApi(userData);\n this.storage.updateUser(user);\n return user;\n }\n async updateAvatar(imageData) {\n const user = await this.avatarUploadApi(imageData);\n this.storage.updateUser(user);\n return user;\n }\n async getUsersList(keyword) {\n const usersList = await this.getUsersListApi(keyword);\n return usersList;\n }\n async loginApi(username, password) {\n try {\n const user = await this.req.axiosRequest({\n method: 'POST',\n url: `${this.req.root}/auth/login`,\n form: {\n username,\n password\n }\n });\n return user;\n } catch (error) {\n console.log(error);\n }\n }\n async loginWithTokenApi(token) {\n try {\n const user = await this.req.axiosRequest({\n method: 'POST',\n url: `${this.req.root}/auth/login?accesstoken=${token}`\n });\n return user;\n } catch (error) {\n console.log(error);\n }\n }\n async updateTokenApi(auth_key) {\n try {\n const user = await this.req.axiosRequest({\n method: 'POST',\n url: `${this.req.root}/auth/login`,\n form: {\n auth_key\n }\n });\n return user;\n } catch (error) {\n console.log(error);\n }\n }\n logoutApi(token) {\n return this.req.post({\n url: \"/auth/logout\",\n form: {\n token\n }\n });\n }\n signupApi(user) {\n return this.req.axiosRequest({\n method: 'POST',\n url: `${this.req.root}/auth/singup`,\n form: {\n user: JSON.stringify(user)\n }\n });\n }\n getUsersListApi(keyword) {\n return this.req.get({\n url: \"/auth/userlist\",\n params: {\n keyword\n }\n });\n }\n updateUserApi(userData) {\n return this.req.post({\n url: \"/auth/updateuser\",\n form: {\n user: JSON.stringify(userData)\n }\n });\n }\n avatarUploadApi(image) {\n return this.req.post({\n url: \"/auth/avatar-upload\",\n form: {\n image\n }\n });\n }\n getUserByIdApi(id) {\n return this.req.get({\n url: \"/auth/getuserbyid\",\n params: {\n id\n }\n });\n }\n getVersion() {\n return this.req.get({\n url: \"/version\"\n });\n }\n getUserFromStorage(id) {\n return this.storage.getUsersList().find(user => user.user_id == id);\n }\n saveUserToStorage(saveUser) {\n const usersList = this.storage.getUsersList();\n const userInStorage = usersList.find(user => user.user_id == saveUser.user_id);\n if (!userInStorage) {\n usersList.push(saveUser);\n return saveUser;\n }\n return userInStorage;\n }\n async getUserById(userId) {\n let user = this.getUserFromStorage(userId);\n if (!user) {\n let receivedUser = await this.getUserByIdApi(userId);\n if (!receivedUser) return null;\n user = this.getUserFromStorage(userId);\n if (!user) {\n this.saveUserToStorage(receivedUser);\n user = receivedUser;\n }\n }\n return user;\n }\n async getToken() {\n const expiryDate = new Date(this.storage.getUser().expirydate);\n const currentDate = new Date();\n let accesstoken = this.storage.getUser().accesstoken;\n\n /*-- checking if token exists and if it's not expired*/\n if (expiryDate < currentDate || !accesstoken) {\n /*-- If token is expired we send request to server to update it*/\n const user = await this.updateToken(this.storage.getUser().auth_key);\n this.storage.updateUser(user);\n accesstoken = user.accesstoken;\n }\n return accesstoken;\n }\n}\n// EXTERNAL MODULE: ./GUDHUB/GHConstructor/createAngularModuleInstance.js\nvar createAngularModuleInstance = __webpack_require__(960);\n;// CONCATENATED MODULE: ./GUDHUB/GHConstructor/createClassInstance.js\n\n\nasync function createClassInstance(gudhub, module_id, js_url, css_url, nodeWindow) {\n try {\n // Check if there is url to javascript file of module\n\n if (!js_url) {\n console.error(`JS link must be provided for this data type - ${module_id}`);\n }\n\n // Import module using dynamic import\n\n let downloadModule = url => {\n if (!consts/* IS_WEB */.P && !global.hasOwnProperty('window')) {\n global.window = proxy;\n global.document = nodeWindow.document;\n global.Element = nodeWindow.Element;\n global.CharacterData = nodeWindow.CharacterData;\n global.this = proxy;\n global.self = proxy;\n global.Blob = nodeWindow.Blob;\n global.Node = nodeWindow.Node;\n global.navigator = nodeWindow.navigator;\n global.HTMLElement = nodeWindow.HTMLElement;\n global.XMLHttpRequest = nodeWindow.XMLHttpRequest;\n global.WebSocket = nodeWindow.WebSocket;\n global.crypto = nodeWindow.crypto;\n global.DOMParser = nodeWindow.DOMParser;\n global.Symbol = nodeWindow.Symbol;\n global.document.queryCommandSupported = command => {\n console.log('QUERY COMMAND SUPPORTED: ', command);\n return false;\n };\n global.angular = angular;\n }\n return new Promise(async resolve => {\n let moduleData = await axios.get(url).catch(err => {\n console.log(`Failed to fetch: ${url} in ghconstructor. Module id: ${module_id}`);\n });\n let encodedJs = encodeURIComponent(moduleData.data);\n let dataUri = 'data:text/javascript;charset=utf-8,' + encodedJs;\n resolve(dataUri);\n });\n };\n let moduleData = await downloadModule(js_url);\n let module;\n try {\n module = await import( /* webpackIgnore: true */moduleData);\n } catch (err) {\n console.log(`Error while importing module: ${module_id}`);\n console.log(err);\n }\n\n // Creating class from imported module\n\n let importedClass = new module.default(module_id);\n\n // Check if there is url to css file of module\n // If true, and there is no css for this data type, than create link tag to this css in head\n\n if (css_url && consts/* IS_WEB */.P) {\n const linkTag = document.createElement('link');\n linkTag.href = css_url;\n linkTag.setAttribute('data-module', module_id);\n linkTag.setAttribute('rel', 'stylesheet');\n document.getElementsByTagName('head')[0].appendChild(linkTag);\n }\n let result = {\n type: module_id,\n //*************** GET TEMPLATE ****************//\n\n getTemplate: function (ref, changeFieldName, displayFieldName, field_model, appId, itemId) {\n let displayFieldNameChecked = displayFieldName === 'false' ? false : true;\n return importedClass.getTemplate(ref, changeFieldName, displayFieldNameChecked, field_model, appId, itemId);\n },\n //*************** GET DEFAULT VALUE ****************//\n\n getDefaultValue: function (fieldModel, valuesArray, itemsList, currentAppId) {\n return new Promise(async resolve => {\n let getValueFunction = importedClass.getDefaultValue;\n if (getValueFunction) {\n let value = await getValueFunction(fieldModel, valuesArray, itemsList, currentAppId);\n resolve(value);\n } else {\n resolve(null);\n }\n });\n },\n //*************** GET SETTINGS ****************//\n\n getSettings: function (scope, settingType, fieldModels) {\n return importedClass.getSettings(scope, settingType, fieldModels);\n },\n //*************** FILTER****************//\n\n filter: {\n getSearchOptions: function (fieldModel) {\n let d_type = importedClass;\n if (d_type.filter && d_type.filter.getSearchOptions) {\n return importedClass.filter.getSearchOptions(fieldModel);\n }\n return [];\n },\n getDropdownValues: function () {\n let d_type = importedClass;\n if (d_type.filter && d_type.filter.getDropdownValues) {\n return d_type.filter.getDropdownValues();\n } else {\n return [];\n }\n }\n },\n //*************** GET INTERPRETATION ****************//\n\n getInterpretation: function (value, interpretation_id, dataType, field, itemId, appId) {\n return new Promise(async resolve => {\n let currentDataType = importedClass;\n try {\n let interpr_arr = await currentDataType.getInterpretation(gudhub, value, appId, itemId, field, dataType);\n let data = interpr_arr.find(item => item.id == interpretation_id) || interpr_arr.find(item => item.id == 'default');\n let result = await data.content();\n resolve({\n html: result\n });\n } catch (error) {\n console.log(`ERROR IN ${module_id}`, error);\n resolve({\n html: '<span>no interpretation</span>'\n });\n }\n });\n },\n //*************** GET INTERPRETATIONS LIST ****************//\n\n getInterpretationsList: function (field_value, appId, itemId, field) {\n return importedClass.getInterpretation(field_value, appId, itemId, field);\n },\n //*************** GET INTERPRETATED VALUE ****************//\n\n getInterpretatedValue: function (field_value, field_model, appId, itemId) {\n return new Promise(async resolve => {\n let getInterpretatedValueFunction = importedClass.getInterpretatedValue;\n if (getInterpretatedValueFunction) {\n let value = await getInterpretatedValueFunction(field_value, field_model, appId, itemId);\n resolve(value);\n } else {\n resolve(field_value);\n }\n });\n },\n //*************** ON MESSAGE ****************//\n\n onMessage: function (appId, userId, response) {\n return new Promise(async resolve => {\n const onMessageFunction = importedClass.onMessage;\n if (onMessageFunction) {\n const result = await onMessageFunction(appId, userId, response);\n resolve(result);\n }\n resolve(null);\n });\n },\n //*************** EXTEND CONTROLLER ****************//\n\n extendController: function (actionScope) {\n importedClass.getActionScope(actionScope);\n },\n //*************** RUN ACTION ****************//\n\n runAction: function (scope) {\n try {\n importedClass.runAction(scope);\n } catch (e) {}\n },\n //*************** GET WINDOW SCOPE ****************//\n\n getWindowScope: function (windowScope) {\n return importedClass.getWindowScope(windowScope);\n },\n //*************** GET WINDOW HTML ****************//\n\n getWindowHTML: function (scope) {\n return importedClass.getWindowHTML(scope);\n }\n };\n return result;\n } catch (err) {\n console.log(err);\n console.log(`Failed in createClassInstance (ghconstructor). Module id: ${module_id}. JS url: ${js_url}`);\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/GHConstructor/ghconstructor.js\n\n\nclass GHConstructor {\n constructor(gudhub) {\n this.gudhub = gudhub;\n this.cache = {};\n this.modulesQueue = {};\n this.angularInjector;\n this.nodeWindow;\n }\n\n /*************** GET INSTANCE ***************/\n // Firstly, check if module is loading right now in modules queue.\n // If not, check if module is in cache. If not, create new instance and put loading to modules queue.\n // If yes, return module from cache.\n\n async getInstance(module_id) {\n if (this.getCached(module_id)) {\n return this.getCached(module_id);\n } else if (this.modulesQueue[module_id]) {\n await this.modulesQueue[module_id];\n } else {\n this.modulesQueue[module_id] = this.createInstance(module_id);\n await this.modulesQueue[module_id];\n }\n return this.getCached(module_id);\n }\n\n /*************** PUT TO CACHE ***************/\n // Just pushing module to cache.\n\n pupToCache(module_id, module) {\n this.cache[module_id] = module;\n }\n\n /*************** GET CACHED ***************/\n // Find module in cache and return it.\n\n getCached(module_id) {\n return this.cache[module_id];\n }\n\n /*************** INIT ANGULAR INJECTOR ***************/\n // Saves angular injector to this.angularInjector.\n // It's needed to correctly takes module's functions, that uses angular services.\n\n initAngularInjector(angularInjector) {\n this.angularInjector = angularInjector;\n }\n\n /*************** INIT JSDOM WINDOW ***************/\n // Saves jsdom's window object to this.window.\n // It's needed to eval browser code on node when library works in node environment.\n\n initJsdomWindow(window) {\n this.nodeWindow = window;\n }\n\n /*************** CREATE INSTANCE ***************/\n // Check if module is \"angular\" or \"class\"\n // Than, creating instance for that type of module\n // Finally, returns the result (created instance) and puting it to the cache\n\n async createInstance(module_id) {\n let module = this.gudhub.storage.getModuleUrl(module_id);\n if (!module) {\n console.log(`Cannot find module: ${module_id}`);\n return;\n }\n let result;\n if (module.type === 'gh_element') {\n if (module.technology === 'angular') {\n result = await (0,createAngularModuleInstance/* default */.Z)(this.gudhub, module_id, module.url, this.angularInjector, this.nodeWindow);\n } else if (module.technology === 'class') {\n result = await createClassInstance(this.gudhub, module_id, module.js, module.css, this.nodeWindow);\n }\n }\n if (result) {\n this.pupToCache(module_id, result);\n }\n return result;\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/AppProcessor/AppProcessor.js\n\nclass AppProcessor {\n constructor(storage, pipeService, req, websocket,\n // chunksManager,\n util, activateSW, dataService) {\n this.storage = storage;\n this.pipeService = pipeService;\n this.req = req;\n this.ws = websocket;\n this.applistReceived = false;\n this.activateSW = activateSW; // we use this flag to check if applist was received. The problem is that if you receive an app it also goes to app_list as a result you have the app_list with one app.\n // this.chunksManager = chunksManager;\n this.util = util;\n this.appListeners();\n this.dataService = dataService;\n this.appRequestCache = new Map();\n\n // this.dataServiceRequestedIdSet = new Set;\n }\n\n async createNewAppApi(app) {\n try {\n const response = await this.req.post({\n url: \"/api/app/create\",\n form: {\n app: JSON.stringify(app)\n }\n });\n response.from_apps_list = true;\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async updateAppApi(app) {\n try {\n const response = await this.req.post({\n url: \"/api/app/update\",\n form: {\n app: JSON.stringify(app)\n }\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async deleteAppApi(app_id) {\n try {\n const response = await this.req.post({\n url: \"/api/app/delete\",\n form: {\n app_id\n }\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async getAppListApi() {\n try {\n const response = await this.req.get({\n url: \"/api/applist/get\"\n });\n return response.apps_list.map(app => {\n app.from_apps_list = true;\n return app;\n });\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n getAppListFromStorage() {\n return this.storage.getAppsList();\n }\n getAppFromStorage(app_id) {\n const app = this.storage.getApp(app_id);\n return app && app.field_list.length ? app : null;\n }\n addNewAppToStorage(app) {\n return this.storage.getAppsList().push(app);\n }\n saveAppInStorage(app) {\n app.items_object = {};\n for (let item = 0; item < app.items_list.length; item++) {\n app.items_object[app.items_list[item].item_id] = {};\n for (let field = 0; field < app.items_list[item].fields.length; field++) {\n app.items_object[app.items_list[item].item_id][app.items_list[item].fields[field].field_id] = app.items_list[item].fields[field];\n }\n }\n const storageApp = this.storage.getApp(app.app_id);\n if (storageApp) {\n app.from_apps_list = storageApp.from_apps_list;\n app.permission = storageApp.permission;\n this.storage.updateApp(app);\n } else {\n app.from_apps_list = false;\n this.addNewAppToStorage(app);\n }\n return this.getAppFromStorage(app.app_id);\n }\n updateAppFieldsAndViews(app) {\n const storageApp = this.getAppFromStorage(app.app_id);\n app.items_list = storageApp.items_list;\n app.file_list = storageApp.file_list;\n app.from_apps_list = storageApp.from_apps_list;\n app.items_object = storageApp.items_object;\n this.storage.updateApp(app);\n //-- Sending updates for Views Updates\n this.pipeService.emit(\"gh_app_views_update\", {\n app_id: app.app_id\n }, app.views_list);\n\n //-- Sending updates for updating Fields\n app.field_list.forEach(fieldModel => {\n this.pipeService.emit(\"gh_model_update\", {\n app_id: app.app_id,\n field_id: fieldModel.field_id\n }, fieldModel);\n });\n }\n updateAppInStorage(app) {\n const storageApp = this.storage.getApp(app.app_id);\n if (storageApp) {\n this.storage.updateApp(app);\n this.pipeService.emit(\"gh_app_update\", {\n app_id: app.app_id\n }, app);\n this.pipeService.emit(\"gh_items_update\", {\n app_id: app.app_id\n }, app.items_list);\n } else {\n this.addNewAppToStorage(app);\n }\n ;\n }\n deletingAppFromStorage(app_id) {\n let appList = this.storage.getAppsList();\n appList.forEach((app, key) => {\n if (app.app_id == app_id) appList.splice(key);\n });\n return appList;\n }\n\n //-- here we check if app already in storage then we dont update it.\n //-- the thing is that is posible that we receive app before receiveng an applist\n updateAppsListInStorage(appsList = []) {\n for (const app of appsList) {\n const storageApp = this.storage.getApp(app.app_id);\n if (storageApp) {\n storageApp.from_apps_list = app.from_apps_list;\n storageApp.permission = app.permission;\n } else this.addNewAppToStorage(app);\n }\n }\n async refreshApps(apps_id = []) {\n for (const app_id of apps_id) {\n if (app_id != undefined) {\n try {\n const app = await this.dataService.getApp(app_id);\n if (app) {\n app.items_object = {};\n for (let item = 0; item < app.items_list.length; item++) {\n app.items_object[app.items_list[item].item_id] = {};\n for (let field = 0; field < app.items_list[item].fields.length; field++) {\n app.items_object[app.items_list[item].item_id][app.items_list[item].fields[field].field_id] = app.items_list[item].fields[field];\n }\n }\n this.updateAppInStorage(app);\n // This emit needs to update values in app after websockets reconnect\n this.pipeService.emit('gh_app_views_update', {\n app_id: app.app_id\n }, app.views_list);\n }\n } catch (err) {\n console.log(err);\n }\n }\n }\n console.log(\"Apps refreshed: \", JSON.stringify(apps_id));\n }\n async refreshAppsList() {\n let currentAppsList = this.getAppListFromStorage();\n let appsListFromApi = await this.getAppListApi();\n let mergedAppsList = appsListFromApi.map(apiApp => {\n return {\n ...apiApp,\n ...currentAppsList.find(app => app.app_id === apiApp.app_id)\n };\n });\n this.updateAppsListInStorage(mergedAppsList);\n this.pipeService.emit('gh_apps_list_refreshed', {});\n }\n async getAppsList() {\n let app_list = this.getAppListFromStorage();\n if (!this.applistReceived) {\n let received_app_list = await this.getAppListApi();\n if (!received_app_list) return null;\n\n // for oprimization purpose: in case when there was severals calls at same moment of the getAppLists one call will overwrite app_list of another call with the same app_list,\n this.updateAppsListInStorage(received_app_list);\n this.applistReceived = true;\n app_list = received_app_list;\n\n // Here we get default user's app\n // We do it here to do it only once\n // We do it because we need to initialize WebSockets, which we do in getApp method\n this.getApp(this.storage.getUser().app_init);\n }\n return app_list;\n }\n\n //********** GET APP INFO ************/\n //-- it returs App with Empty fields_list, items_list, file_list, views_list\n //-- Such simmple data needed to render App Icons, and do some simple updates in App like updating App name icon permisions etc when full app data is not needed\n async getAppInfo(app_id) {\n const app_list = await this.getAppsList();\n return app_list ? app_list.find(app => app.app_id == app_id) : null;\n }\n async deleteApp(app_id) {\n await this.deleteAppApi(app_id);\n return this.deletingAppFromStorage(app_id);\n }\n async getApp(app_id, trash = false) {\n if (!app_id) return null;\n let app = this.getAppFromStorage(app_id);\n if (app) return app;\n if (this.appRequestCache.has(app_id)) return this.appRequestCache.get(app_id);\n let self = this;\n let pr = new Promise(async (resolve, reject) => {\n try {\n let app = await self.dataService.getApp(app_id);\n if (!app) reject();\n\n //!!! temporary check !!!! if app has chanks property then we start getting it\n // if (\n // receivedApp.chunks &&\n // receivedApp.chunks.length\n // ) {\n // // here should be checked is merge required\n\n // let chunks = await self.chunksManager.getChunks(app_id, receivedApp.chunks);\n // receivedApp.items_list = self.util.mergeChunks([\n // ...chunks,\n // receivedApp,\n // ]);\n // }\n\n // This code for trash must be changed\n // return trash ? app : {...app, items_list: app.items_list.filter(item => !item.trash)};\n let filtered = trash ? app : {\n ...app,\n items_list: app.items_list.filter(item => !item.trash)\n };\n resolve(filtered);\n self.saveAppInStorage(filtered);\n self.ws.addSubscription(app_id);\n } catch (error) {\n reject();\n }\n });\n self.appRequestCache.set(app_id, pr);\n return pr;\n }\n async updateApp(app) {\n if (!app.views_list || !app.views_list.length || !app.show) {\n const storageApp = await this.getApp(app.app_id);\n if (!app.views_list || !app.views_list.length) {\n app.views_list = storageApp.views_list;\n }\n if (typeof app.show === 'undefined') {\n app.show = storageApp.show;\n }\n }\n const updatedApp = await this.updateAppApi(app);\n this.updateAppFieldsAndViews(updatedApp);\n return updatedApp;\n }\n async updateAppInfo(appInfo = {}) {\n this.pipeService.emit(\"gh_app_info_update\", {\n app_id: appInfo.app_id\n }, appInfo);\n return this.updateApp(appInfo);\n }\n async createNewApp(app) {\n const newApp = await this.createNewAppApi(app);\n newApp.items_object = {};\n this.addNewAppToStorage(newApp);\n return newApp;\n }\n async getAppViews(app_id) {\n if (app_id) {\n const app = await this.getApp(app_id);\n return app.views_list;\n }\n }\n async handleAppChange(id, prevVersion, nextVersion) {\n // generate required events etc, do job\n }\n clearAppProcessor() {\n this.getAppListPromises = null;\n this.getAppPromises = {};\n this.applistReceived = false;\n }\n appListeners() {\n this.pipeService.onRoot(\"gh_app_get\", {}, async (event, data) => {\n if (data && data.app_id) {\n const app = await this.getApp(data.app_id);\n this.pipeService.emit(\"gh_app_get\", data, app);\n }\n });\n this.pipeService.onRoot(\"gh_apps_list_get\", {}, async (event, data) => {\n const appList = await this.getAppsList();\n this.pipeService.emit(\"gh_apps_list_get\", data, appList);\n });\n this.pipeService.onRoot(\"gh_delete_app\", {}, async (event, data) => {\n const appList = await this.deleteApp(data.app_id);\n this.pipeService.emit(\"gh_apps_list_update\", {\n recipient: \"all\"\n }, appList);\n });\n this.pipeService.onRoot(\"gh_app_update\", {}, async (event, data) => {\n data.app.items_list = [];\n data.app.file_list = [];\n const newApp = await this.updateApp(data.app);\n this.pipeService.emit(\"gh_app_views_update\", {\n app_id: newApp.app_id\n }, newApp.views_list);\n const appsList = await this.getAppsList();\n this.pipeService.emit(\"gh_apps_list_update\", {\n recipient: \"all\"\n }, appsList);\n newApp.field_list.forEach(fieldModel => {\n this.pipeService.emit(\"gh_model_update\", {\n app_id: newApp.app_id,\n field_id: fieldModel.field_id\n }, fieldModel);\n });\n });\n this.pipeService.onRoot(\"gh_app_view_get\", {}, async (event, data) => {\n if (data && data.app_id) {\n const app = await this.getApp(data.app_id);\n app.views_list.forEach((view, key) => {\n if (view.view_id == data.view_id) {\n this.pipeService.emit(\"gh_app_view_get\", data, app.views_list[key]);\n }\n });\n }\n });\n\n // Return app_name, app_id, app_icon\n this.pipeService.onRoot(\"gh_app_info_get\", {}, async (event, data) => {\n const appInfo = await this.getAppInfo(data.app_id);\n if (appInfo) this.pipeService.emit(\"gh_app_info_get\", data, appInfo);\n });\n this.pipeService.onRoot(\"gh_app_info_update\", {}, async (event, data) => {\n if (data && data.app) {\n const appInfo = await this.updateAppInfo(data.app);\n this.pipeService.emit(\"gh_app_info_update\", {\n app_id: data.app.app_id\n }, appInfo);\n }\n });\n this.pipeService.onRoot(\"gh_app_create\", {}, async (event, data) => {\n await this.createNewApp(data.app);\n const appsList = await this.getAppsList();\n this.pipeService.emit(\"gh_apps_list_update\", {\n recipient: \"all\"\n }, appsList);\n });\n if (consts/* IS_WEB */.P && this.activateSW) {\n navigator.serviceWorker.addEventListener(\"message\", async event => {\n if (event.data.type === \"refresh app\") {\n const app = await this.getApp(event.data.payload.app_id);\n if (app) {\n this.util.compareAppsItemsLists(app.items_list, event.data.payload.items_list.filter(item => !item.trash), ({\n diff_fields_items,\n diff_fields_items_Ids,\n diff_items,\n newItems,\n deletedItems\n }) => {\n if (diff_items.length || newItems.length || deletedItems.length) {\n this.pipeService.emit(\"gh_items_update\", {\n app_id: event.data.payload.app_id\n }, event.data.payload.items_list.filter(item => !item.trash));\n diff_items.forEach(item => this.pipeService.emit(\"gh_item_update\", {\n app_id: event.data.payload.app_id,\n item_id: item.item_id\n }, item));\n }\n diff_fields_items_Ids.forEach(item_id => {\n const item = diff_fields_items[item_id];\n if (!item) return;\n item.forEach(field => {\n this.pipeService.emit(\"gh_value_update\", {\n app_id: event.data.payload.app_id,\n item_id,\n field_id: field.field_id\n }, field.field_value);\n });\n });\n });\n }\n event.data.payload.items_list = await this.util.mergeChunks([app, event.data.payload]); //here check Ask Andrew\n this.saveAppInStorage(event.data.payload);\n }\n // if (event.data.type === \"refresh appList\") {\n // this.storage.unsetApps();\n // this.updateAppsListInStorage(\n // event.data.payload.apps_list.map((app) => {\n // app.from_apps_list = true;\n // return app;\n // })\n // );\n // this.pipeService.emit(\n // \"gh_apps_list_update\",\n // { recipient: \"all\" },\n // event.data.payload.apps_list\n // );\n // }\n });\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/ItemProcessor/ItemProcessor.js\n\nclass ItemProcessor {\n constructor(storage, pipeService, req, appProcessor, util) {\n this.storage = storage;\n this.pipeService = pipeService;\n this.req = req;\n this.appProcessor = appProcessor;\n this.util = util;\n this.itemListeners();\n }\n async addItemsApi(app_id, itemsList) {\n try {\n const response = await this.req.post({\n url: \"/api/items/add\",\n form: {\n items: JSON.stringify(itemsList),\n app_id\n }\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async updateItemsApi(app_id, itemsList) {\n try {\n const response = await this.req.post({\n url: \"/api/items/update\",\n form: {\n items: JSON.stringify(itemsList),\n app_id\n }\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n deleteItemsApi(items_ids) {\n try {\n const response = this.req.post({\n url: \"/api/items/delete\",\n form: {\n items_ids: JSON.stringify(items_ids)\n }\n });\n response.from_apps_list = true;\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async addItemsToStorage(app_id, items) {\n // !!!!! Need to fix this\n const app = await this.appProcessor.getApp(app_id);\n if (app) {\n items.forEach(item => {\n app.items_list.push(item);\n app.items_object[item.item_id] = {};\n for (let field = 0; field < item.fields.length; field++) {\n app.items_object[item.item_id][item.fields[field].field_id] = item.fields[field];\n }\n this.pipeService.emit(\"gh_item_update\", {\n app_id\n }, [item]);\n });\n this.pipeService.emit(\"gh_items_update\", {\n app_id\n }, app.items_list);\n this.storage.updateApp(app);\n }\n return app;\n }\n async updateItemsInStorage(app_id, items) {\n this.pipeService.emit(\"gh_items_update\", {\n app_id\n }, items);\n //-- getting app from storage\n const app = await this.appProcessor.getApp(app_id);\n if (app && items) {\n items.forEach(item => {\n const addressToEmit = {\n app_id\n };\n this.pipeService.emit(\"gh_item_update\", addressToEmit, [item]);\n addressToEmit.item_id = item.item_id;\n this.pipeService.emit(\"gh_item_update\", addressToEmit, item);\n //-- Looking for updated item in the main storage according to 'item_id'\n const fundedItem = app.items_list.find(storageItem => storageItem.item_id == item.item_id);\n if (fundedItem) {\n //-- Updating value in existing fields\n item.fields.forEach(field => {\n const fundedField = fundedItem.fields.find(storageField => storageField.field_id == field.field_id);\n addressToEmit.field_id = field.field_id;\n if (fundedField) {\n //-- Checking if value of existing fields were updated, because we are not sending updates if value didn't changed\n if (fundedField.field_value != field.field_value) {\n fundedField.field_value = field.field_value;\n app.items_object[fundedItem.item_id][fundedField.field_id] = fundedField;\n this.pipeService.emit(\"gh_value_update\", addressToEmit, field.field_value);\n }\n } else {\n //-- Pushing new fields to the storage (it's when user enters new value)\n fundedItem.fields.push(field);\n app.items_object[fundedItem.item_id][field.field_id] = field;\n this.pipeService.emit(\"gh_value_update\", addressToEmit, field.field_value);\n }\n });\n }\n });\n }\n return items;\n }\n\n //here\n handleItemsChange(id, prevVersion, nextVersion) {\n let compareRes = this.util.compareItems(prevVersion.items_list, nextVersion.items_list);\n this.updateItemsInStorage(id, compareRes.diff_src_items);\n this.addItemsToStorage(id, compareRes.new_src_items);\n }\n triggerItemsChange(id, compareRes) {\n this.updateItemsInStorage(id, compareRes.diff_src_items);\n this.addItemsToStorage(id, compareRes.new_src_items);\n }\n handleDiff(id, compare) {\n this.updateItemsInStorage(id, compare.diff_src_items);\n this.addItemsToStorage(id, compare.new_src_items);\n this.deleteItemsFromStorage(id, compare.trash_src_items);\n }\n async deleteItemsFromStorage(app_id, itemsForDelete = []) {\n const app = await this.appProcessor.getApp(app_id);\n if (app) {\n app.items_list = app.items_list.filter(item => {\n if (itemsForDelete.find(findedItem => item.item_id == findedItem.item_id)) {\n delete app.items_object[item.item_id];\n return false;\n }\n return true;\n });\n this.pipeService.emit(\"gh_items_update\", {\n app_id\n }, app.items_list);\n this.storage.updateApp(app);\n }\n }\n async getItems(app_id, trash = false) {\n const app = await this.appProcessor.getApp(app_id, trash);\n if (!app) return null;\n return app.items_list;\n }\n async addNewItems(app_id, itemsList) {\n const preparedItemsList = itemsList.map(item => ({\n ...item,\n fields: filterFields(item.fields)\n }));\n const newItems = await this.addItemsApi(app_id, preparedItemsList);\n await this.addItemsToStorage(app_id, newItems);\n this.pipeService.emit(\"gh_items_add\", {\n app_id\n }, newItems);\n return newItems;\n }\n async updateItems(app_id, itemsList) {\n const preparedItemsList = itemsList.map(item => ({\n ...item,\n fields: filterFields(item.fields)\n }));\n const updatedItems = await this.updateItemsApi(app_id, preparedItemsList);\n return await this.updateItemsInStorage(app_id, updatedItems);\n }\n async deleteItems(app_id, itemsIds) {\n return this.deleteItemsApi(itemsIds).then(async items => await this.deleteItemsFromStorage(app_id, items));\n }\n itemListeners() {\n this.pipeService.onRoot(\"gh_items_get\", {}, async (event, data) => {\n if (data && data.app_id) {\n const items = await this.getItems(data.app_id);\n if (items) {\n this.pipeService.emit(\"gh_items_get\", data, items);\n } else {\n this.pipeService.emit(\"gh_items_get\", data, []);\n }\n }\n });\n this.pipeService.onRoot(\"gh_items_add\", {}, async (event, data) => {\n if (data && data.app_id && data.items) {\n const items = await this.addNewItems(data.app_id, data.items);\n if (items) {\n this.pipeService.emit(\"gh_items_add\", data, items);\n } else {\n this.pipeService.emit(\"gh_items_add\", data, []);\n }\n }\n });\n this.pipeService.onRoot(\"gh_items_update\", {}, async (event, data) => {\n if (data && data.app_id && data.items) {\n const items = await this.updateItems(data.app_id, data.items);\n if (items) {\n this.pipeService.emit(\"gh_items_update\", data, items);\n } else {\n this.pipeService.emit(\"gh_items_update\", data, []);\n }\n }\n });\n\n /* ---- FIELD VALUE GET LISTENING ---- */\n this.pipeService.onRoot(\"gh_item_get\", {}, async (event, data) => {\n if (data && data.app_id) {\n const items = await this.getItems(data.app_id);\n const item = items.find(item => item.item_id == data.item_id);\n this.pipeService.emit(\"gh_item_get\", data, item);\n }\n });\n\n // GETTING FILTERED ITEM\n /* data = {\n app_id: current appId,\n element_app_id: for reference appId,\n itemsId: current itemId,\n filters_list: filters list,\n field_groupe ?: field group,\n search?: search value,\n }\n */\n this.pipeService.onRoot(\"gh_filtered_items_get\", {}, async (event, data) => {\n if (data && data.element_app_id) {\n const items = await this.getItems(data.element_app_id);\n const filteredItems = await this.util.getFilteredItems(items, data.filters_list, data.element_app_id, data.app_id, data.item_id, data.field_groupe, data.search, data.search_params);\n this.pipeService.emit(\"gh_filtered_items_get\", data, filteredItems);\n }\n });\n this.pipeService.onRoot(\"gh_filter_items\", {}, async (event, data) => {\n if (data && data.items) {\n const filteredItems = await this.util.getFilteredItems(data.items, data.filters_list, data.element_app_id, data.app_id, data.item_id, data.field_groupe, data.search, data.search_params);\n this.pipeService.emit(\"gh_filter_items\", data, filteredItems);\n }\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/FieldProcessor/FieldProcessor.js\nclass FieldProcessor {\n constructor(storage, req, appProcessor, itemProcessor, pipeService) {\n this.storage = storage;\n this.req = req;\n this.appProcessor = appProcessor;\n this.itemProcessor = itemProcessor;\n this.pipeService = pipeService;\n this.fieldListeners();\n }\n deleteFieldApi(field_id) {\n return this.req.post({\n url: \"/api/app/delete-field\",\n form: {\n field_id\n }\n });\n }\n async updatedFieldApi(app_id, fieldModel = {}) {\n const app = await this.appProcessor.getApp(app_id);\n const appToUpdate = {\n app_id,\n app_name: app.app_name,\n group_id: app.group_id,\n icon: app.icon,\n field_list: app.field_list.map(field => field.field_id == fieldModel.field_id ? {\n ...field,\n ...fieldModel\n } : field),\n views_list: app.views_list\n };\n return this.appProcessor.updateApp(appToUpdate);\n }\n setFieldValueApi(app_id, item_id, field_id, field_value) {\n const itemToUpdate = [{\n item_id,\n fields: [{\n field_id,\n field_value\n }]\n }];\n return this.itemProcessor.updateItems(app_id, itemToUpdate);\n }\n deleteFieldInStorage(app_id, field_id) {\n const app = this.storage.getApp(app_id);\n app.field_list = app.field_list.filter(field => field.file_id != field_id);\n app.items_list = app.items_list.map(item => {\n item.fields = item.fields.filter(field => field.field_id != field_id);\n return item;\n });\n this.storage.updateApp(app);\n return true;\n }\n updateFieldInStorage(app_id, fieldModel) {\n const app = this.storage.getApp(app_id);\n app.field_list = app.field_list.map(field => field.field_id == fieldModel.field_id ? {\n ...field,\n ...fieldModel\n } : field);\n this.storage.updateApp(app);\n return fieldModel;\n }\n\n //This method was created for setFieldValue()\n //!!!!! 1) Change for each to for\n //!!!!! 2) Stop iteration after value has been found\n updateFieldValue(app_id, item_id, field_id, field_value) {\n const app = this.storage.getApp(app_id);\n app.items_list.forEach(item => {\n if (item.item_id == item_id) {\n item.fields.forEach(field => {\n if (field.field_id == field_id) {\n field.field_value = field_value;\n app.items_object[item.item_id][field.field_id] = field;\n }\n });\n }\n });\n this.storage.updateApp(app);\n return field_value;\n }\n async getField(app_id, field_id) {\n const app = await this.appProcessor.getApp(app_id);\n if (!app) return null;\n for (let i = 0; i < app.field_list.length; i++) {\n if (app.field_list[i].field_id == field_id) {\n return app.field_list[i];\n }\n }\n return null;\n }\n async getFieldIdByNameSpace(app_id, name_space) {\n const app = await this.appProcessor.getApp(app_id);\n if (!app) return null;\n for (let i = 0; i < app.field_list.length; i++) {\n if (app.field_list[i].name_space == name_space) {\n return app.field_list[i].field_id;\n }\n }\n return null;\n }\n\n //!!!!! Shou Be Renamed to getFields() !!!!!!!\n async getFieldModels(app_id) {\n const app = await this.appProcessor.getApp(app_id);\n if (!app) return null;\n return app.field_list;\n }\n\n //!!!!! Shou Be added fieldID argument !!!!!!!\n async updateField(app_id, fieldModel) {\n if (!app_id || !fieldModel) {\n return;\n }\n const newModel = await this.updatedFieldApi(app_id, fieldModel);\n return this.updateFieldInStorage(app_id, newModel);\n }\n async deleteField(app_id, field_id) {\n await this.deleteFieldApi(field_id);\n return this.deleteFieldInStorage(app_id, field_id);\n }\n\n //this method should alwaise return value if no value we return null\n async getFieldValue(app_id, item_id, field_id) {\n let fieldValue = null;\n const app = await this.appProcessor.getApp(app_id);\n try {\n fieldValue = app.items_object[item_id][field_id].field_value;\n } catch (err) {}\n return fieldValue;\n }\n async setFieldValue(app_id, item_id, field_id, field_value) {\n if (!app_id || !item_id || !field_id) {\n return;\n }\n await this.setFieldValueApi(app_id, item_id, field_id, field_value);\n return this.updateFieldValue(app_id, item_id, field_id, field_value);\n }\n fieldListeners() {\n this.pipeService.onRoot('gh_value_get', {}, async (event, data) => {\n if (data.app_id && data.item_id && data.field_id) {\n let field_value = await this.getFieldValue(data.app_id, data.item_id, data.field_id);\n this.pipeService.emit('gh_value_get', data, field_value);\n }\n });\n this.pipeService.onRoot('gh_value_set', {}, async (event, data) => {\n if (data.item_id) {\n this.setFieldValue(data.app_id, data.item_id, data.field_id, data.new_value);\n delete data.new_value;\n }\n });\n this.pipeService.onRoot('gh_model_get', {}, async (event, data) => {\n try {\n let field_model = await this.getField(data.app_id, data.field_id);\n this.pipeService.emit('gh_model_get', data, field_model);\n } catch (error) {\n console.log('Field model: ', error);\n }\n });\n this.pipeService.onRoot('gh_model_update', {}, async (event, data) => {\n let field_model = await this.updateField(data.app_id, data.field_model);\n this.pipeService.emit('gh_model_update', {\n app_id: data.app_id,\n field_id: data.field_id\n }, field_model);\n });\n this.pipeService.onRoot('gh_models_get', {}, async (event, data) => {\n let field_models = await this.getFieldModels(data.app_id);\n this.pipeService.emit('gh_models_get', data, field_models);\n });\n this.pipeService.onRoot('gh_model_delete', {}, async (event, data) => {\n let status = await this.deleteField(data.app_id, data.field_id);\n this.pipeService.emit('gh_model_delete', data, status);\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/FileManager/FileManager.js\nclass FileManager {\n constructor(storage, pipeService, req, appProcessor) {\n this.storage = storage;\n this.pipeService = pipeService;\n this.req = req;\n this.appProcessor = appProcessor;\n }\n\n //********************* UPLOAD FILE *********************//\n\n async uploadFileApi(fileData, app_id, item_id) {\n try {\n const form = {\n \"file-0\": fileData,\n app_id,\n item_id\n };\n const file = await this.req.post({\n url: \"/file/formupload\",\n form\n });\n return file;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async uploadFileFromStringApi(fileObject) {\n try {\n const file = await this.req.post({\n url: \"/file/upload\",\n form: {\n file: JSON.stringify(fileObject)\n }\n });\n return file;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async updateFileFromStringApi(data, file_id, file_name, extension, format) {\n try {\n const fileObj = {\n file_name,\n extension,\n file_id,\n format,\n source: data\n };\n const file = await this.req.post({\n url: \"/file/update\",\n form: {\n file: JSON.stringify(fileObj)\n }\n });\n return file;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async duplicateFileApi(files) {\n return this.req.post({\n url: \"/api/new/file/duplicate\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n form: {\n files: JSON.stringify(files)\n }\n });\n }\n async downloadFileFromString(app_id, file_id) {\n if (await this.isFileExists(app_id, file_id)) {\n let file = await this.getFile(app_id, file_id);\n let data = await this.req.get({\n url: file.url + '?timestamp=' + file.last_update,\n externalResource: true\n });\n return {\n file,\n data,\n type: 'file'\n };\n } else {\n return false;\n }\n }\n async duplicateFile(files) {\n let duplicatedFiles = await this.duplicateFileApi(files);\n duplicatedFiles.forEach(file => {\n this.addFileToStorage(file.app_id, file);\n });\n return duplicatedFiles;\n }\n async deleteFileApi(id) {\n try {\n const file = await this.req.get({\n url: `/file/delete?file_id=${id}`\n });\n return file;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n addFileToStorage(app_id, file) {\n const app = this.storage.getApp(app_id);\n if (app) {\n app.file_list.push(file);\n this.storage.updateApp(app);\n this.pipeService.emit(\"gh_file_upload\", {\n app_id,\n item_id: file.item_id,\n file_id: file.file_id\n }, file);\n }\n }\n addFilesToStorage(app_id, files) {\n const app = this.storage.getApp(app_id);\n if (app) {\n app.file_list.push(...files);\n this.storage.updateApp(app);\n files.forEach(file => {\n this.pipeService.emit(\"gh_file_upload\", {\n app_id,\n item_id: file.item_id,\n file_id: file.file_id\n }, file);\n });\n }\n }\n deleteFileFromStorage(fileId, app_id) {\n const app = this.storage.getApp(app_id);\n if (app) {\n let deletedFile;\n app.file_list = app.file_list.filter(file => {\n if (file.file_id != fileId) {\n return true;\n } else {\n deletedFile = file;\n return false;\n }\n });\n this.storage.updateApp(app);\n this.pipeService.emit(\"gh_file_delete\", {\n file_id: fileId\n }, deletedFile);\n }\n }\n updateFileInStorage(fileId, app_id, newFile) {\n const app = this.storage.getApp(app_id);\n if (app) {\n app.file_list = app.file_list.map(file => file.file_id == fileId ? newFile : file);\n this.storage.updateApp(app);\n this.pipeService.emit(\"gh_file_update\", {\n file_id: fileId\n });\n }\n }\n async getFile(app_id, file_id) {\n const app = await this.appProcessor.getApp(app_id);\n return new Promise((resolve, reject) => {\n let findedFile = app.file_list.find(file => {\n return file.file_id == file_id;\n });\n if (findedFile) {\n resolve(findedFile);\n } else {\n resolve('');\n }\n });\n }\n async getFiles(app_id, filesId = []) {\n const app = await this.appProcessor.getApp(app_id);\n return new Promise((resolve, reject) => {\n let findedFiles = app.file_list.filter(file => {\n return filesId.some(id => {\n return id == file.file_id;\n });\n });\n if (findedFiles) {\n resolve(findedFiles);\n } else {\n resolve('');\n }\n });\n }\n async uploadFile(fileData, app_id, item_id) {\n const file = await this.uploadFileApi(fileData, app_id, item_id);\n this.addFileToStorage(app_id, file);\n return file;\n }\n async uploadFileFromString(fileObject) {\n const file = await this.uploadFileFromStringApi(fileObject);\n this.addFileToStorage(file.app_id, file);\n return file;\n }\n async updateFileFromString(data, file_id, file_name, extension, format) {\n const file = await this.updateFileFromStringApi(data, file_id, file_name, extension, format);\n this.updateFileInStorage(file_id, file.app_id, file);\n return file;\n }\n async deleteFile(id, app_id) {\n await this.deleteFileApi(id);\n this.deleteFileFromStorage(id, app_id);\n return true;\n }\n async isFileExists(app_id, file_id) {\n let urlPattern = /^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$/;\n if (Boolean(file_id)) {\n let file = await this.getFile(app_id, file_id);\n if (Boolean(file)) {\n return urlPattern.test(file.url);\n } else {\n return false;\n }\n } else {\n return false;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DocumentManager/DocumentManager.js\n/* \n Document Template request\n {\n app_id: 1,\n item_id: 1\n element_id: 1,\n data: {}\n }\n\n*/\n\nclass DocumentManager {\n constructor(req, pipeService) {\n this.req = req;\n this.pipeService = pipeService;\n }\n createDocument(documentObject) {\n this.emitDocumentInsert(documentObject);\n return this.req.post({\n url: \"/api/new/document/insert-one\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n form: {\n document: JSON.stringify(documentObject)\n }\n });\n }\n emitDocumentInsert(data) {\n const dataToEmit = typeof data.data === \"string\" ? JSON.parse(data.data) : data.data;\n this.pipeService.emit(\"gh_document_insert_one\", {\n app_id: data.app_id,\n item_id: data.item_id,\n element_id: data.element_id\n }, dataToEmit);\n }\n getDocument(documentAddress) {\n return this.req.post({\n url: \"/api/new/document/find-one\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n form: {\n document: JSON.stringify(documentAddress)\n }\n });\n }\n getDocuments(documentsAddresses) {\n return this.req.post({\n url: \"/api/new/document/find\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n form: {\n document: JSON.stringify(documentsAddresses)\n }\n });\n }\n deleteDocument(documentAddress) {\n return this.req.post({\n url: \"/api/new/document/remove-one\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n form: {\n document: JSON.stringify(documentAddress)\n }\n });\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/GHConstructor/interpritate.js\nclass Interpritate {\n constructor(gudhub) {\n this.gudhub = gudhub;\n }\n\n /*********************** GET INTERPRETATION OBJ ***********************/\n // In this method we are looking for interpretation in data model according to interpretation src\n // then we merged with default interpretation from defaultFieldDataModel\n // if there are no current interpretation we use default interpretation\n async getInterpretationObj(fieldDataModel, defaultFieldDataModel, src, containerId, itemId, appId) {\n var currentIntrpr = [];\n // Creating default interpretation\n var defaultIntrprObj = defaultFieldDataModel.data_model.interpretation.find(function (interpritation) {\n return interpritation.src == src;\n }) || defaultFieldDataModel.data_model.interpretation.find(function (interpritation) {\n return interpritation.src == 'table';\n }) || {\n id: 'default'\n };\n var interpretation = defaultIntrprObj;\n if (fieldDataModel.data_model && fieldDataModel.data_model.interpretation) {\n // To detect interpretation we use (container_id), if there is not (container_id) we use (src)\n for (var i = 0; i < fieldDataModel.data_model.interpretation.length; i++) {\n if (fieldDataModel.data_model.interpretation[i].src == src || fieldDataModel.data_model.interpretation[i].src == containerId) {\n currentIntrpr.push(fieldDataModel.data_model.interpretation[i]);\n }\n }\n for (var i = 0; i < currentIntrpr.length; i++) {\n if (currentIntrpr[i].settings && currentIntrpr[i].settings.condition_filter && currentIntrpr[i].settings.filters_list.length > 0) {\n const item = await gudhub.getItem(appId, itemId);\n if (item) {\n const filteredItems = gudhub.filter([item], currentIntrpr[i].settings.filters_list);\n if (filteredItems.length > 0) {\n interpretation = currentIntrpr[i];\n break;\n }\n }\n } else {\n interpretation = gudhub.mergeObjects(interpretation, currentIntrpr[i]);\n }\n }\n }\n return interpretation;\n }\n\n /*********************** GET INTERPRETATION ***********************/\n\n getInterpretation(value, field, dataType, source, itemId, appId, containerId) {\n const self = this;\n return new Promise(async (resolve, reject) => {\n /*-- By default we use 'data_type' from field but in case if field is undefined we use 'dataType' from attribute*/\n var data_type = field && field.data_type ? field.data_type : dataType;\n\n /*---- Constructing Data Object ----*/\n if (data_type) {\n /*-- if we have data_type then we construct new data object to interpritate value*/\n gudhub.ghconstructor.getInstance(data_type).then(async function (data) {\n if (data) {\n var interpretationObj = await self.getInterpretationObj(field, data.getTemplate().model, source, containerId, itemId, appId);\n data.getInterpretation(value, interpretationObj.id, data_type, field, itemId, appId).then(function (result) {\n // console.log(result, interpretationObj)\n\n resolve(gudhub.mergeObjects(result, interpretationObj));\n }, function (error) {\n reject();\n });\n }\n }, function (error) {});\n } else {\n console.error('Get Interpretation: data_type is undefined', dataType, field);\n }\n });\n }\n\n /********************* GET INTERPRETATION BY ID *********************/\n\n // We add ability to pass value as argument, to reduce number of operations in this case (getFieldValue)\n // This helps if you call method many times, for example in calculator sum and you already have field value\n // By default, value is null, to not break old code working with this method\n\n // For field same as above for value\n async getInterpretationById(appId, itemId, fieldId, interpretationId, value = null, field = null) {\n let fieldValue = value == null ? await this.gudhub.getFieldValue(appId, itemId, fieldId) : value;\n let fieldModel = field == null ? await this.gudhub.getField(appId, fieldId) : field;\n if (fieldModel == null) {\n return '';\n }\n const instance = await this.gudhub.ghconstructor.getInstance(fieldModel.data_type);\n const interpretatedValue = await instance.getInterpretation(fieldValue, interpretationId, fieldModel.data_type, fieldModel, itemId, appId);\n if (interpretatedValue.html == '<span>no interpretation</span>') {\n return fieldValue;\n } else {\n return interpretatedValue.html;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/WebSocket/WebsocketHandler.js\nfunction WebsocketHandler(gudhub, message) {\n switch (message.api) {\n case \"/items/update\":\n console.log(\"/items/update - \", message);\n gudhub.itemProcessor.updateItemsInStorage(message.app_id, message.response);\n break;\n case \"/items/add\":\n console.log(\"/items/add - \", message);\n gudhub.itemProcessor.addItemsToStorage(message.app_id, message.response);\n break;\n case \"/items/delete\":\n console.log(\"/items/delete - \", message);\n gudhub.itemProcessor.deleteItemsFromStorage(message.app_id, message.response);\n break;\n case \"/app/update\":\n console.log(\"/app/update - \", message);\n gudhub.appProcessor.updateAppFieldsAndViews(message.response);\n break;\n case \"/file/delete\":\n console.log(\"file/delete - \", message);\n gudhub.fileManager.deleteFileFromStorage(message.response.file_id, message.app_id);\n break;\n case \"/file/upload\":\n console.log(\"file/upload - \", message);\n gudhub.fileManager.addFileToStorage(message.app_id, message.response);\n break;\n case \"/file/formupload\":\n //I'm not shure if we are using it (probably in contact form)\n console.log(\"file/formupload - \", message);\n break;\n case \"/file/update\":\n //I'm not shure if we are using it (probably in contact form)\n gudhub.fileManager.updateFileInStorage(message.response.file_id, message.response.app_id, message.response);\n console.log(\"file/update - \", message);\n break;\n case \"/new/file/duplicate\":\n //I'm not shure if we are using it (probably in contact form)\n gudhub.fileManager.addFilesToStorage(message.app_id, message.response);\n console.log(\"new/file/duplicate - \", message);\n break;\n case '/api/new/document/insert-one':\n gudhub.documentManager.emitDocumentInsert(message.response);\n console.log('/api/new/document/insert-one - ', message);\n break;\n case '/ws/emit-to-user':\n console.log('/ws/emit-to-user - ', message);\n break;\n case '/ws/broadcast-to-app-subscribers':\n console.log('/ws/broadcast-to-app-subscribers - ', message);\n const response = JSON.parse(message.response);\n if (!response.data_type) return;\n gudhub.ghconstructor.getInstance(response.data_type).then(instance => {\n instance.onMessage(message.app_id, message.user_id, response);\n });\n break;\n default:\n console.warn(\"WEBSOCKETS is not process this API:\", message.api);\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/groupManager/GroupManager.js\nclass GroupManager {\n constructor(gudhub, req) {\n this.req = req;\n this.gudhub = gudhub;\n }\n\n //********************* CREATE GROUP *********************//\n\n async createGroupApi(groupName) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_name: groupName\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/create-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* UPDATE GROUP *********************//\n\n async updateGroupApi(groupId, groupName) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_name: groupName,\n group_id: groupId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/update-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* DELETE GROUP *********************//\n\n async deleteGroupApi(groupId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_id: groupId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/delete-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* ADD USER TO GROUP *********************//\n\n async addUserToGroupApi(groupId, userId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_id: groupId,\n user_id: userId,\n group_permission: permission\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/add-user-to-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* GET USERS BY GROUP *********************//\n\n async getUsersByGroupApi(groupId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_id: groupId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/get-users-by-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* UPDATE USER IN GROUP *********************//\n\n async updateUserInGroupApi(userId, groupId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n user_id: userId,\n group_id: groupId,\n group_permission: permission\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/update-user-in-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* REMOVE USER FROM GROUP *********************//\n\n async deleteUserFromGroupApi(userId, groupId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n user_id: userId,\n group_id: groupId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/delete-user-from-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* GET GROUPS BY USER *********************//\n\n async getGroupsByUserApi(userId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n user_id: userId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/get-groups-by-user\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/sharing/AppGroupSharing.js\nclass AppGroupSharing {\n constructor(gudhub, req) {\n this.req = req;\n this.gudhub = gudhub;\n }\n\n //********************* ADD APP TO GROUP *********************//\n\n async addAppToGroupApi(appId, groupId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n app_id: appId,\n group_id: groupId,\n app_permission: permission\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/add-app-to-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* GET APPS BY GROUP *********************//\n\n async getAppsByGroupApi(groupId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_id: groupId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/get-apps-by-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* UPDATE APP IN GROUP *********************//\n\n async updateAppInGroupApi(appId, groupId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_id: groupId,\n app_id: appId,\n app_permission: permission\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/update-app-in-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* DELETE APP FROM GROUP *********************//\n\n async deleteAppFromGroupApi(appId, groupId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n group_id: groupId,\n app_id: appId,\n app_permission: permission\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/delete-app-from-group\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n\n //********************* GET GROUPS BY APP *********************//\n\n async getGroupsByAppApi(appId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n app_id: appId\n };\n const group = await this.req.post({\n url: \"/api/sharing-group/get-groups-by-app\",\n form\n });\n return group;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/sharing/GroupSharing.js\n\n\nclass GroupSharing {\n constructor(gudhub, req, pipeService) {\n this.req = req;\n this.gudhub = gudhub;\n this.pipeService = pipeService;\n this.groupManager = new GroupManager(gudhub, req);\n this.appGroupSharing = new AppGroupSharing(gudhub, req);\n }\n createGroup(groupName) {\n return this.groupManager.createGroupApi(groupName);\n }\n updateGroup(groupId, groupName) {\n return this.groupManager.updateGroupApi(groupId, groupName);\n }\n deleteGroup(groupId) {\n return this.groupManager.deleteGroupApi(groupId);\n }\n async addUserToGroup(userId, groupId, permission) {\n let newUser = await this.groupManager.addUserToGroupApi(userId, groupId, permission);\n this.pipeService.emit(\"group_members_add\", {\n app_id: \"group_sharing\"\n }, newUser);\n return newUser;\n }\n getUsersByGroup(groupId) {\n return this.groupManager.getUsersByGroupApi(groupId);\n }\n async updateUserInGroup(userId, groupId, permission) {\n let updatedUser = await this.groupManager.updateUserInGroupApi(userId, groupId, permission);\n this.pipeService.emit(\"group_members_update\", {\n app_id: \"group_sharing\"\n }, updatedUser);\n return updatedUser;\n }\n async deleteUserFromGroup(userId, groupId) {\n let deletedUser = await this.groupManager.deleteUserFromGroupApi(userId, groupId);\n this.pipeService.emit(\"group_members_delete\", {\n app_id: \"group_sharing\"\n }, deletedUser);\n return deletedUser;\n }\n getGroupsByUser(userId) {\n return this.groupManager.getGroupsByUserApi(userId);\n }\n addAppToGroup(appId, groupId, permission) {\n return this.appGroupSharing.addAppToGroupApi(appId, groupId, permission);\n }\n getAppsByGroup(groupId) {\n return this.appGroupSharing.getAppsByGroupApi(groupId);\n }\n updateAppInGroup(appId, groupId, permission) {\n return this.appGroupSharing.updateAppInGroupApi(appId, groupId, permission);\n }\n deleteAppFromGroup(appId, groupId, permission) {\n return this.appGroupSharing.deleteAppFromGroupApi(appId, groupId, permission);\n }\n getGroupsByApp(appId) {\n return this.appGroupSharing.getGroupsByAppApi(appId);\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/sharing/Sharing.js\nclass Sharing {\n constructor(gudhub, req) {\n this.req = req;\n this.gudhub = gudhub;\n }\n async add(appId, userId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n app_id: appId,\n user_id: userId,\n sharing_permission: permission\n };\n const response = await this.req.post({\n url: \"/sharing/add\",\n form\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async update(appId, userId, permission) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n app_id: appId,\n user_id: userId,\n sharing_permission: permission\n };\n const response = await this.req.post({\n url: \"/sharing/update\",\n form\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async delete(appId, userId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n app_id: appId,\n user_id: userId\n };\n const response = await this.req.post({\n url: \"/sharing/delete\",\n form\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async getAppUsers(appId) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n app_id: appId\n };\n const response = await this.req.post({\n url: \"/sharing/get-app-users\",\n form\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n async addInvitation(guestsEmails, apps) {\n try {\n const form = {\n token: await this.gudhub.auth.getToken(),\n guests_emails: guestsEmails,\n apps\n };\n const response = await this.req.post({\n url: \"/api/invitation/add\",\n form\n });\n return response;\n } catch (err) {\n console.log(err);\n return null;\n }\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/WebSocket/WebSocketEmitter.js\nclass WebSocketEmitter {\n constructor(gudhub) {\n this.gudhub = gudhub;\n }\n async emitToUser(user_id, data) {\n const message = {\n user_id,\n data: typeof data === 'object' ? JSON.stringify(data) : data\n };\n const response = await this.gudhub.req.post({\n url: '/ws/emit-to-user',\n form: message\n });\n return response;\n }\n async broadcastToAppSubscribers(app_id, data_type, data) {\n const message = {\n app_id,\n data: JSON.stringify({\n data_type,\n data\n })\n };\n const response = await this.gudhub.req.post({\n url: '/ws/broadcast-to-app-subscribers',\n form: message\n });\n return response;\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/gudhub.js\n\n\n\n\n\n\n\n\n\n\n\n\n// import { ChunksManager } from \"./ChunksManager/ChunksManager.js\";\n\n\n\n\n\n\n\n\nclass GudHub {\n constructor(authKey, options = {\n server_url: server_url,\n wss_url: wss_url,\n node_server_url: node_server_url,\n initWebsocket: false,\n activateSW: false,\n swLink: \"\",\n async_modules_path: async_modules_path,\n file_server_url: file_server_url,\n automation_modules_path: automation_modules_path,\n accesstoken: this.accesstoken,\n expirydate: this.expirydate\n }) {\n this.serialized = {\n authKey,\n options\n };\n this.config = options;\n this.ghconstructor = new GHConstructor(this);\n this.interpritate = new Interpritate(this);\n this.pipeService = new PipeService();\n this.storage = new Storage(options.async_modules_path, options.file_server_url, options.automation_modules_path);\n this.util = new Utils(this);\n this.req = new GudHubHttpsService(options.server_url);\n this.auth = new Auth(this.req, this.storage);\n this.sharing = new Sharing(this, this.req);\n this.groupSharing = new GroupSharing(this, this.req, this.pipeService);\n\n // Login with access token - pass to setUser access token and after it user can make requests with access token\n // This method created for optimize GudHub initialization without auth key\n if (authKey) {\n this.storage.setUser({\n auth_key: authKey\n });\n } else if (options.accesstoken && options.expirydate) {\n this.storage.setUser({\n accesstoken: options.accesstoken,\n expirydate: options.expirydate\n });\n }\n this.req.init(this.auth.getToken.bind(this.auth));\n this.ws = new WebSocketApi(options.wss_url, this.auth);\n\n //todo\n // this.chunksManager = new ChunksManager(\n // this.storage,\n // this.pipeService,\n // this.req,\n // this.util,\n // new ChunkDataService(this.req, chunkDataServiceConf, this),\n // );\n this.appProcessor = new AppProcessor(this.storage, this.pipeService, this.req, this.ws,\n // this.chunksManager,\n this.util, options.activateSW, new export_AppDataService(this.req, appDataServiceConf, this));\n this.itemProcessor = new ItemProcessor(this.storage, this.pipeService, this.req, this.appProcessor, this.util);\n this.fieldProcessor = new FieldProcessor(this.storage, this.req, this.appProcessor, this.itemProcessor, this.pipeService);\n this.fileManager = new FileManager(this.storage, this.pipeService, this.req, this.appProcessor);\n this.documentManager = new DocumentManager(this.req, this.pipeService);\n this.websocketsemitter = new WebSocketEmitter(this);\n if (options.initWebsocket) {\n const gudhub = this;\n this.ws.initWebSocket(WebsocketHandler.bind(this, gudhub), this.appProcessor.refreshApps.bind(this.appProcessor));\n }\n if (options.activateSW) {\n this.activateSW(options.swLink);\n }\n }\n async activateSW(swLink) {\n if (consts/* IS_WEB */.P && \"serviceWorker\" in window.navigator) {\n try {\n const sw = await window.navigator.serviceWorker.register(swLink);\n sw.update().then(() => console.log(\"%cSW ->>> Service worker successful updated\", \"display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;\")).catch(() => console.warn(\"SW ->>> Service worker is not updated\"));\n console.log(\"%cSW ->>> Service worker is registered\", \"display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;\", sw);\n } catch (error) {\n console.warn(\"%cSW ->>> Service worker is not registered\", \"display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;\", error);\n }\n } else {\n console.log(\"%cSW ->>> ServiceWorkers not supported\", \"display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;\");\n }\n }\n\n //************************* PIPESERVICE METHODS ****************************//\n //============= ON PIPE ===============//\n on(types, destination, fn) {\n this.pipeService.on(types, destination, fn);\n return this;\n }\n\n //============= EMIT PIPE ==============//\n emit(types, destination, address, params) {\n this.pipeService.emit(types, destination, address, params);\n return this;\n }\n\n //============ DELETE LISTENER ========//\n destroy(types, destination, func) {\n this.pipeService.destroy(types, destination, func);\n return this;\n }\n\n //************************* FILTERATION ****************************//\n prefilter(filters_list, variables) {\n return this.util.prefilter(filters_list, variables);\n }\n\n //============ DEBOUNCE ========//\n debounce(func, delay) {\n return this.util.debounce(func, delay);\n }\n\n //************************* WEBSOCKETS EMITTER ****************************//\n\n emitToUser(user_id, data) {\n return this.websocketsemitter.emitToUser(user_id, data);\n }\n broadcastToAppSubscribers(app_id, data_type, data) {\n return this.websocketsemitter.broadcastToAppSubscribers(app_id, data_type, data);\n }\n\n /******************* INTERPRITATE *******************/\n\n getInterpretation(value, field, dataType, source, itemId, appId, containerId) {\n return this.interpritate.getInterpretation(value, field, dataType, source, itemId, appId, containerId);\n }\n\n /******************* GET INTERPRETATION BY ID *******************/\n\n getInterpretationById(appId, itemId, fieldId, interpretationId, value, field) {\n return this.interpritate.getInterpretationById(appId, itemId, fieldId, interpretationId, value, field);\n }\n\n //============ FILTER ==========//\n filter(items, filter_list) {\n return this.util.filter(items, filter_list);\n }\n\n //============ MERGE FILTERS ==========//\n mergeFilters(source, destination) {\n return this.util.mergeFilters(source, destination);\n }\n\n //============ GROUP ==========//\n group(fieldGroup, items) {\n return this.util.group(fieldGroup, items);\n }\n\n //============ GET FILTERED ITEMS ==========//\n //it returns items with applyed filter\n getFilteredItems(items, filters_list, options = {}) {\n return this.util.getFilteredItems(items, filters_list, options.element_app_id, options.app_id, options.item_id, options.field_group, options.search, options.search_params);\n }\n sortItems(items, options) {\n return this.util.sortItems(items, options);\n }\n\n //here\n triggerAppChange(id, prevVersion, newVersion) {\n this.itemProcessor.handleItemsChange(id, prevVersion, newVersion);\n this.appProcessor.handleAppChange(id, prevVersion, newVersion);\n }\n\n //TODO handleAppChange\n triggerIemsChange(id, compareRes) {\n this.itemProcessor.triggerItemsChange(id, compareRes);\n }\n jsonToItems(json, map) {\n return this.util.jsonToItems(json, map);\n }\n getDate(queryKey) {\n return this.util.getDate(queryKey);\n }\n populateWithDate(items, model) {\n return this.util.populateWithDate(items, model);\n }\n checkRecurringDate(date, option) {\n return this.util.checkRecurringDate(date, option);\n }\n populateItems(items, model, keep_data) {\n return this.util.populateItems(items, model, keep_data);\n }\n populateWithItemRef(sourceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id) {\n return this.util.populateWithItemRef(sourceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id);\n }\n compareItems(sourceItems, destinationItems, fieldToCompare) {\n return this.util.compareItems(sourceItems, destinationItems, fieldToCompare);\n }\n mergeItems(sourceItems, destinationItems, mergeByFieldId) {\n return this.util.mergeItems(sourceItems, destinationItems, mergeByFieldId);\n }\n mergeObjects(sourceObject, destinationObject) {\n return this.util.mergeObjects(sourceObject, destinationObject);\n }\n makeNestedList(arr, id, parent_id, children_property, priority_property) {\n return this.util.makeNestedList(arr, id, parent_id, children_property, priority_property);\n }\n jsonConstructor(scheme, items, variables, appId) {\n return this.util.jsonConstructor(scheme, items, variables, appId);\n }\n\n //************************* APP PROCESSOR ****************************//\n getAppsList() {\n return this.appProcessor.getAppsList();\n }\n getAppInfo(app_id) {\n return this.appProcessor.getAppInfo(app_id);\n }\n deleteApp(app_id) {\n return this.appProcessor.deleteApp(app_id);\n }\n getApp(app_id) {\n return this.appProcessor.getApp(app_id);\n }\n updateApp(app) {\n return this.appProcessor.updateApp(app);\n }\n updateAppInfo(appInfo) {\n return this.appProcessor.updateAppInfo(appInfo);\n }\n createNewApp(app) {\n return this.appProcessor.createNewApp(app);\n }\n getItems(app_id) {\n return this.itemProcessor.getItems(app_id);\n }\n async getItem(app_id, item_id) {\n const items = await this.getItems(app_id);\n if (items) {\n return items.find(item => item.item_id == item_id);\n }\n }\n addNewItems(app_id, itemsList) {\n return this.itemProcessor.addNewItems(app_id, itemsList);\n }\n updateItems(app_id, itemsList) {\n return this.itemProcessor.updateItems(app_id, itemsList);\n }\n deleteItems(app_id, itemsIds) {\n return this.itemProcessor.deleteItems(app_id, itemsIds);\n }\n getField(app_id, field_id) {\n return this.fieldProcessor.getField(app_id, field_id);\n }\n getFieldIdByNameSpace(app_id, name_space) {\n return this.fieldProcessor.getFieldIdByNameSpace(app_id, name_space);\n }\n getFieldModels(app_id) {\n return this.fieldProcessor.getFieldModels(app_id);\n }\n updateField(app_id, fieldModel) {\n return this.fieldProcessor.updateField(app_id, fieldModel);\n }\n deleteField(app_id, field_id) {\n return this.fieldProcessor.deleteField(app_id, field_id);\n }\n getFieldValue(app_id, item_id, field_id) {\n return this.fieldProcessor.getFieldValue(app_id, item_id, field_id);\n }\n setFieldValue(app_id, item_id, field_id, field_value) {\n return this.fieldProcessor.setFieldValue(app_id, item_id, field_id, field_value);\n }\n getFile(app_id, file_id) {\n return this.fileManager.getFile(app_id, file_id);\n }\n getFiles(app_id, filesId) {\n return this.fileManager.getFiles(app_id, filesId);\n }\n uploadFile(fileData, app_id, item_id) {\n return this.fileManager.uploadFile(fileData, app_id, item_id);\n }\n uploadFileFromString(source, file_name, app_id, item_id, extension, format, element_id) {\n return this.fileManager.uploadFileFromString(source, file_name, app_id, item_id, extension, format, element_id);\n }\n updateFileFromString(data, file_id, file_name, extension, format) {\n return this.fileManager.updateFileFromString(data, file_id, file_name, extension, format);\n }\n deleteFile(app_id, id) {\n return this.fileManager.deleteFile(app_id, id);\n }\n duplicateFile(files) {\n return this.fileManager.duplicateFile(files);\n }\n downloadFileFromString(app_id, file_id) {\n return this.fileManager.downloadFileFromString(app_id, file_id);\n }\n createDocument(documentObject) {\n return this.documentManager.createDocument(documentObject);\n }\n getDocument(documentAddress) {\n return this.documentManager.getDocument(documentAddress);\n }\n getDocuments(documentAddress) {\n return this.documentManager.getDocuments(documentAddress);\n }\n deleteDocument(documentAddress) {\n return this.documentManager.deleteDocument(documentAddress);\n }\n login(data) {\n return this.auth.login(data);\n }\n loginWithToken(token) {\n return this.auth.loginWithToken(token);\n }\n logout(token) {\n this.appProcessor.clearAppProcessor();\n return this.auth.logout(token);\n }\n signup(user) {\n return this.auth.signup(user);\n }\n getUsersList(keyword) {\n return this.auth.getUsersList(keyword);\n }\n updateToken(auth_key) {\n return this.auth.updateToken(auth_key);\n }\n avatarUploadApi(image) {\n return this.auth.avatarUploadApi(image);\n }\n getVersion() {\n return this.auth.getVersion();\n }\n getUserById(userId) {\n return this.auth.getUserById(userId);\n }\n getToken() {\n return this.auth.getToken();\n }\n updateUser(userData) {\n return this.auth.updateUser(userData);\n }\n updateAvatar(imageData) {\n return this.auth.updateAvatar(imageData);\n }\n}\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/appRequestWorker.js\n\n\n\n\nlet appRequestWorker_gudhub = {};\nlet appDataService = {};\n\n//TODO also ChunkDataService !!!!!!!!!!!!!!!!!!!!!!!\n\nself.onmessage = async function (e) {\n if (e.data.type === 'init') {\n appRequestWorker_gudhub = new GudHub(e.data.gudhubSerialized.authKey, e.data.gudhubSerialized.options);\n appDataService = new IndexedDBAppServiceForWorker(appRequestWorker_gudhub.req, appsConf, appRequestWorker_gudhub);\n }\n if (e.data.type === 'processData') {\n //todo cached could not exist !!!!!!!!!!!!!!!!!!!\n\n let cached = await appDataService.getCached(e.data.id);\n let newVersion = await appDataService.getApp(e.data.id);\n\n // let comparison = gudhub.compareItems(cached.items_list, newVersion.items_list);\n let comparison = appRequestWorker_gudhub.compareItems(newVersion.items_list, cached.items_list);\n this.postMessage({\n id: e.data.id,\n compareRes: comparison,\n newVersion,\n type: e.data.type\n });\n\n /// todo process data merge and then call merge and compare and then return from here for example event to update\n\n // also dont forget that main thread also uses AppDataService !!!!!!!!!!!!!!!!!! make temporarile a separate class for it maybe\n }\n\n if (e.data.type === 'requestApp') {\n let data = await appDataService.getApp(e.data.id);\n this.postMessage({\n id: e.data.id,\n type: e.data.type,\n data\n });\n }\n\n // this.appRequestAndProcessWorker.postMessage({ type: 'requestApp', id: id });\n};\n\n//# sourceURL=webpack://@gudhub/core/./GUDHUB/DataService/IndexedDB/appRequestWorker.js_+_65_modules?")},960:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Z: () => (/* binding */ createAngularModuleInstance)\n/* harmony export */ });\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9669);\n/* harmony import */ var _consts_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(738);\n\n\n\n/*************** FAKE ANGULAR $Q ***************/\n// It's needed when we import angular code.\n\nlet $q = {\n when: function (a) {\n return new Promise(resolve => {\n resolve(a);\n });\n }\n};\n\n/*************** FAKE ANGULAR ***************/\n// It's needed when we import angular code.\n\nlet factoryReturns = {};\nlet angular = {\n module() {\n return angular;\n },\n directive() {\n return angular;\n },\n factory(name, args) {\n try {\n if (typeof args === 'object') {\n factoryReturns[name] = args[args.length - 1]($q);\n } else {\n factoryReturns[name] = args($q);\n }\n } catch (error) {\n console.log('Errror in data type: ', name);\n console.log(error);\n }\n return angular;\n },\n service() {\n return angular;\n },\n run() {\n return angular;\n },\n filter() {\n return angular;\n },\n controller() {\n return angular;\n },\n value() {\n return angular;\n },\n element() {\n return angular;\n },\n injector() {\n return angular;\n },\n invoke() {\n return angular;\n }\n};\n\n/*************** CREATE INSTANCE ***************/\n// Here we are importing modules using dynamic import.\n// For browser: just do dynamic import with url as parameter.\n// In node environment we can't dynamically import module from url, so we download module's code via axios and transform it to data url.\n// Then creating classes from imported modules.\n// Finally, creating instance of module, using functions from imported classes. If we in browser - also takes methods from angular's injector.\n\n/*** TODO ***/\n// Need to make angular modules instances creation similar to pure js classes.\n\nasync function createAngularModuleInstance(gudhub, module_id, module_url, angularInjector, nodeWindow) {\n try {\n let angularModule;\n let importedClass;\n if (_consts_js__WEBPACK_IMPORTED_MODULE_1__/* .IS_WEB */ .P) {\n if (window.angular) {\n // Download module with $ocLazyLoad if module not in injector already.\n\n if (!angularInjector.has(module_id)) {\n await angularInjector.get('$ocLazyLoad').load(module_url);\n }\n angularModule = await angularInjector.get(module_id);\n\n // Then, dynamically import modules from url.\n\n let module = await axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);\n module = module.data;\n try {\n eval(module);\n } catch (error) {\n console.error(`ERROR WHILE EVAL() IN GHCONSTRUCTOR. MODULE ID: ${module_id}`);\n console.log(error);\n }\n importedClass = factoryReturns[module_id];\n } else {\n let module = await axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);\n module = module.data;\n try {\n eval(module);\n } catch (err) {\n console.log(`Error while importing module: ${module_id}`);\n console.log(err);\n }\n\n // Modules always exports classes as default, so we create new class instance.\n\n importedClass = factoryReturns[module_id];\n }\n } else {\n const proxy = new Proxy(nodeWindow, {\n get: (target, property) => {\n return target[property];\n },\n set: (target, property, value) => {\n target[property] = value;\n global[property] = value;\n return true;\n }\n });\n\n // If node's global object don't have window and it's methods yet - set it.\n if (!global.hasOwnProperty('window')) {\n global.window = proxy;\n global.document = nodeWindow.document;\n global.Element = nodeWindow.Element;\n global.CharacterData = nodeWindow.CharacterData;\n global.this = proxy;\n global.self = proxy;\n global.Blob = nodeWindow.Blob;\n global.Node = nodeWindow.Node;\n global.navigator = nodeWindow.navigator;\n global.HTMLElement = nodeWindow.HTMLElement;\n global.XMLHttpRequest = nodeWindow.XMLHttpRequest;\n global.WebSocket = nodeWindow.WebSocket;\n global.crypto = nodeWindow.crypto;\n global.DOMParser = nodeWindow.DOMParser;\n global.Symbol = nodeWindow.Symbol;\n global.document.queryCommandSupported = command => {\n return false;\n };\n global.angular = angular;\n }\n\n // Downloading module's code and transform it to data url.\n\n let response = await axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);\n let code = response.data;\n let encodedCode = encodeURIComponent(code);\n encodedCode = 'data:text/javascript;charset=utf-8,' + encodedCode;\n let module;\n\n // Then, dynamically import modules from data url.\n\n try {\n module = await import( /* webpackIgnore: true */encodedCode);\n } catch (err) {\n console.log(`Error while importing module: ${module_id}`);\n console.log(err);\n }\n\n // Modules always exports classes as default, so we create new class instance.\n\n importedClass = new module.default();\n }\n let result = {\n type: module_id,\n //*************** GET TEMPLATE ****************//\n\n getTemplate: function (ref, changeFieldName, displayFieldName, field_model, appId, itemId) {\n let displayFieldNameChecked = displayFieldName === 'false' ? false : true;\n return importedClass.getTemplate(ref, changeFieldName, displayFieldNameChecked, field_model, appId, itemId);\n },\n //*************** GET DEFAULT VALUE ****************//\n\n getDefaultValue: function (fieldModel, valuesArray, itemsList, currentAppId) {\n return new Promise(async resolve => {\n let getValueFunction = importedClass.getDefaultValue;\n if (getValueFunction) {\n let value = await getValueFunction(fieldModel, valuesArray, itemsList, currentAppId);\n resolve(value);\n } else {\n resolve(null);\n }\n });\n },\n //*************** GET SETTINGS ****************//\n\n getSettings: function (scope, settingType, fieldModels) {\n return importedClass.getSettings(scope, settingType, fieldModels);\n },\n //*************** FILTER****************//\n\n filter: {\n getSearchOptions: function (fieldModel) {\n let d_type = importedClass;\n if (d_type.filter && d_type.filter.getSearchOptions) {\n return importedClass.filter.getSearchOptions(fieldModel) || null;\n }\n return [];\n },\n getDropdownValues: function () {\n let d_type = importedClass;\n if (d_type.filter && d_type.filter.getDropdownValues) {\n return d_type.filter.getDropdownValues() || null;\n } else {\n return [];\n }\n }\n },\n //*************** GET INTERPRETATION ****************//\n\n getInterpretation: function (value, interpretation_id, dataType, field, itemId, appId) {\n return new Promise(async resolve => {\n let currentDataType = importedClass;\n try {\n let interpr_arr = await currentDataType.getInterpretation(gudhub, value, appId, itemId, field, dataType);\n let data = interpr_arr.find(item => item.id == interpretation_id) || interpr_arr.find(item => item.id == 'default');\n let result = await data.content();\n resolve({\n html: result\n });\n } catch (error) {\n console.log(`ERROR IN ${module_id}`, error);\n resolve({\n html: '<span>no interpretation</span>'\n });\n }\n });\n },\n //*************** GET INTERPRETATIONS LIST ****************//\n\n getInterpretationsList: function (field_value, appId, itemId, field) {\n return importedClass.getInterpretation(field_value, appId, itemId, field);\n },\n //*************** GET INTERPRETATED VALUE ****************//\n\n getInterpretatedValue: function (field_value, field_model, appId, itemId) {\n return new Promise(async resolve => {\n let getInterpretatedValueFunction = importedClass.getInterpretatedValue;\n if (getInterpretatedValueFunction) {\n let value = await getInterpretatedValueFunction(field_value, field_model, appId, itemId);\n resolve(value);\n } else {\n resolve(field_value);\n }\n });\n },\n //*************** ON MESSAGE ****************//\n\n onMessage: function (appId, userId, response) {\n return new Promise(async resolve => {\n const onMessageFunction = importedClass.onMessage;\n if (onMessageFunction) {\n const result = await onMessageFunction(appId, userId, response);\n resolve(result);\n }\n resolve(null);\n });\n }\n };\n\n // We need these methods in browser environment only\n\n if (_consts_js__WEBPACK_IMPORTED_MODULE_1__/* .IS_WEB */ .P) {\n //*************** EXTEND CONTROLLER ****************//\n\n result.extendController = function (actionScope) {\n angularModule.getActionScope(actionScope);\n };\n\n //*************** RUN ACTION ****************//\n\n result.runAction = function (scope) {\n try {\n angularModule.runAction(scope);\n } catch (e) {}\n };\n\n //*************** GET WINDOW SCOPE ****************//\n\n result.getWindowScope = function (windowScope) {\n return angularModule.getWindowScope(windowScope);\n };\n\n //*************** GET WINDOW HTML ****************//\n\n result.getWindowHTML = function (scope) {\n return angularModule.getWindowHTML(scope);\n };\n }\n return result;\n } catch (err) {\n console.log(err);\n console.log(`Failed in createAngularModuleInstance (ghconstructor). Module id: ${module_id}.`);\n }\n}\n\n//# sourceURL=webpack://@gudhub/core/./GUDHUB/GHConstructor/createAngularModuleInstance.js?")},738:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";eval('/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ P: () => (/* binding */ IS_WEB)\n/* harmony export */ });\nconst IS_WEB = ![typeof window, typeof document].includes("undefined");\n\n//# sourceURL=webpack://@gudhub/core/./GUDHUB/consts.js?')},8593:module=>{"use strict";eval('module.exports = JSON.parse(\'{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}\');\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/package.json?')}},__webpack_module_cache__={};function __webpack_require__(e){var n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var t=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](t,t.exports,__webpack_require__),t.exports}__webpack_require__.d=(e,n)=>{for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(1953);return __webpack_exports__})()));