@gudhub/core 1.2.4-beta.3 → 1.2.4-beta.32
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.
- package/GUDHUB/AppProcessor/AppProcessor.js +62 -24
- package/GUDHUB/ChunksManager/ChunksManager.js +61 -61
- package/GUDHUB/ChunksManager/ChunksManager.test.js +8 -4
- package/GUDHUB/DataService/AppDataService.js +232 -0
- package/GUDHUB/DataService/ChunkDataService.js +10 -0
- package/GUDHUB/DataService/IndexedDB/IndexedDBAppService.js +799 -63
- package/GUDHUB/DataService/IndexedDB/IndexedDBChunkService.js +303 -46
- package/GUDHUB/DataService/IndexedDB/IndexedDBService.js +342 -2
- package/GUDHUB/DataService/IndexedDB/StoreManager/BaseStoreManager.js +124 -0
- package/GUDHUB/DataService/IndexedDB/StoreManager/managers.js +113 -0
- package/GUDHUB/DataService/IndexedDB/appDataConf.js +6 -3
- package/GUDHUB/DataService/IndexedDB/appRequestWorker.js +225 -0
- package/GUDHUB/DataService/IndexedDB/chunkDataConf.js +3 -3
- package/GUDHUB/DataService/IndexedDB/consts.js +3 -1
- package/GUDHUB/DataService/IndexedDB/init.js +15 -14
- package/GUDHUB/DataService/IndexedDB/storeManagerConf/chunkCacheStoreManagerConf.js +11 -0
- package/GUDHUB/DataService/IndexedDB/storeManagerConf/init.js +1 -0
- package/GUDHUB/DataService/export.js +8 -5
- package/GUDHUB/DataService/httpService/AppHttpService.js +22 -4
- package/GUDHUB/DataService/httpService/ChunkHttpService.js +19 -2
- package/GUDHUB/DataService/utils.js +104 -1
- package/GUDHUB/FileManager/FileManager.js +7 -3
- package/GUDHUB/GHConstructor/createAngularModuleInstance.js +3 -3
- package/GUDHUB/GHConstructor/createClassInstance.js +3 -3
- package/GUDHUB/ItemProcessor/ItemProcessor.js +24 -0
- package/GUDHUB/Storage/ModulesList.js +18 -2
- package/GUDHUB/Utils/AppsTemplateService/AppsTemplateService.js +37 -1
- package/GUDHUB/Utils/Utils.js +29 -1
- package/GUDHUB/Utils/merge_chunks/merge_chunks.js +36 -28
- package/GUDHUB/Utils/merge_chunks/merge_chunks.worker.js +78 -0
- package/GUDHUB/Utils/merge_compare_items/merge_compare_items.js +40 -9
- package/GUDHUB/WebSocket/WebSocket.js +2 -1
- package/GUDHUB/consts.js +21 -1
- package/GUDHUB/gudhub.js +39 -14
- package/appRequestWorker.js +1 -0
- package/appRequestWorker.js.LICENSE.txt +13 -0
- package/appRequestWorker.js.map +1 -0
- package/package.json +17 -6
- package/umd/appRequestWorker.js +1 -0
- package/umd/library.min.js +1 -300
- package/webpack.config.js +154 -0
- package/.vscode/launch.json +0 -31
- package/umd/library.min.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
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__={2505:(module,__unused_webpack_exports,__webpack_require__)=>{eval("module.exports = __webpack_require__(8015);\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/axios/index.js?")},5592:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(9516);\nvar settle = __webpack_require__(7522);\nvar cookies = __webpack_require__(3948);\nvar buildURL = __webpack_require__(9106);\nvar buildFullPath = __webpack_require__(9615);\nvar parseHeaders = __webpack_require__(2012);\nvar isURLSameOrigin = __webpack_require__(4202);\nvar createError = __webpack_require__(7763);\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?")},8015:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\nvar utils = __webpack_require__(9516);\nvar bind = __webpack_require__(9012);\nvar Axios = __webpack_require__(5155);\nvar mergeConfig = __webpack_require__(5343);\nvar defaults = __webpack_require__(6987);\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__(1928);\naxios.CancelToken = __webpack_require__(3191);\naxios.isCancel = __webpack_require__(3864);\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = __webpack_require__(7980);\n\n// Expose isAxiosError\naxios.isAxiosError = __webpack_require__(5019);\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?')},1928: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?")},3191:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar Cancel = __webpack_require__(1928);\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?")},3864: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?")},5155:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(9516);\nvar buildURL = __webpack_require__(9106);\nvar InterceptorManager = __webpack_require__(3471);\nvar dispatchRequest = __webpack_require__(4490);\nvar mergeConfig = __webpack_require__(5343);\nvar validator = __webpack_require__(4841);\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?")},3471:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(9516);\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?")},9615:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar isAbsoluteURL = __webpack_require__(9137);\nvar combineURLs = __webpack_require__(4680);\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?")},7763:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar enhanceError = __webpack_require__(5449);\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?")},4490:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(9516);\nvar transformData = __webpack_require__(2881);\nvar isCancel = __webpack_require__(3864);\nvar defaults = __webpack_require__(6987);\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?")},5449: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?")},5343:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(9516);\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?")},7522:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar createError = __webpack_require__(7763);\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?")},2881:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(9516);\nvar defaults = __webpack_require__(6987);\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?")},6987:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(9516);\nvar normalizeHeaderName = __webpack_require__(7018);\nvar enhanceError = __webpack_require__(5449);\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__(5592);\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = __webpack_require__(5592);\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?")},9012: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?")},9106:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(9516);\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?")},4680: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?")},3948:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(9516);\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?")},9137: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?')},5019: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?")},4202:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(9516);\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?")},7018:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(9516);\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?")},2012:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(9516);\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?")},7980: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?")},4841:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar pkg = __webpack_require__(4198);\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?")},9516:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar bind = __webpack_require__(9012);\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?")},8075:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(453);\n\nvar callBind = __webpack_require__(487);\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?")},487:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar bind = __webpack_require__(6743);\nvar GetIntrinsic = __webpack_require__(453);\nvar setFunctionLength = __webpack_require__(6897);\n\nvar $TypeError = __webpack_require__(9675);\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__(655);\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?")},5886:(__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?')},427:(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?")},9784:(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?')},4273:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4994)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = add;\nvar _typeof2 = _interopRequireDefault(__webpack_require__(3738));\nvar _index = _interopRequireDefault(__webpack_require__(6642));\nvar _index2 = _interopRequireDefault(__webpack_require__(2442));\nvar _index3 = _interopRequireDefault(__webpack_require__(5039));\nvar _index4 = _interopRequireDefault(__webpack_require__(427));\nvar _index5 = _interopRequireDefault(__webpack_require__(9784));\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?')},6642:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4994)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = addDays;\nvar _index = _interopRequireDefault(__webpack_require__(9784));\nvar _index2 = _interopRequireDefault(__webpack_require__(5039));\nvar _index3 = _interopRequireDefault(__webpack_require__(427));\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?')},2442:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4994)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = addMonths;\nvar _index = _interopRequireDefault(__webpack_require__(9784));\nvar _index2 = _interopRequireDefault(__webpack_require__(5039));\nvar _index3 = _interopRequireDefault(__webpack_require__(427));\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?')},8316:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4994)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = isSameWeek;\nvar _index = _interopRequireDefault(__webpack_require__(9551));\nvar _index2 = _interopRequireDefault(__webpack_require__(427));\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?')},7800:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4994)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = setDay;\nvar _index = _interopRequireDefault(__webpack_require__(6642));\nvar _index2 = _interopRequireDefault(__webpack_require__(5039));\nvar _index3 = _interopRequireDefault(__webpack_require__(9784));\nvar _index4 = _interopRequireDefault(__webpack_require__(427));\nvar _index5 = __webpack_require__(5886);\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?')},9551:(module,exports,__webpack_require__)=>{"use strict";eval('\n\nvar _interopRequireDefault = (__webpack_require__(4994)["default"]);\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = startOfWeek;\nvar _index = _interopRequireDefault(__webpack_require__(5039));\nvar _index2 = _interopRequireDefault(__webpack_require__(9784));\nvar _index3 = _interopRequireDefault(__webpack_require__(427));\nvar _index4 = __webpack_require__(5886);\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?')},5039:(module,exports,__webpack_require__)=>{"use strict";eval("\n\nvar _interopRequireDefault = (__webpack_require__(4994)[\"default\"]);\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = toDate;\nvar _typeof2 = _interopRequireDefault(__webpack_require__(3738));\nvar _index = _interopRequireDefault(__webpack_require__(427));\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?")},41:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar $defineProperty = __webpack_require__(655);\n\nvar $SyntaxError = __webpack_require__(8068);\nvar $TypeError = __webpack_require__(9675);\n\nvar gopd = __webpack_require__(5795);\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?")},655:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(453);\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?")},1237: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?")},9383:module=>{"use strict";eval("\n\n/** @type {import('.')} */\nmodule.exports = Error;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/es-errors/index.js?")},9290: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?")},9538: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?")},8068: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?")},9675: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?")},5345: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?")},9353: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?")},6743:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar implementation = __webpack_require__(9353);\n\nmodule.exports = Function.prototype.bind || implementation;\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/function-bind/index.js?")},453:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar undefined;\n\nvar $Error = __webpack_require__(9383);\nvar $EvalError = __webpack_require__(1237);\nvar $RangeError = __webpack_require__(9290);\nvar $ReferenceError = __webpack_require__(9538);\nvar $SyntaxError = __webpack_require__(8068);\nvar $TypeError = __webpack_require__(9675);\nvar $URIError = __webpack_require__(5345);\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__(4039)();\nvar hasProto = __webpack_require__(24)();\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__(6743);\nvar hasOwn = __webpack_require__(9957);\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?")},5795:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(453);\n\n/** @type {import('.')} */\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?")},592:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar $defineProperty = __webpack_require__(655);\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?")},24:module=>{"use strict";eval("\n\nvar test = {\n\t__proto__: null,\n\tfoo: {}\n};\n\n// @ts-expect-error: TS errors on an inherited property for some reason\nvar result = { __proto__: test }.foo === test.foo\n\t&& !(test instanceof Object);\n\n/** @type {import('.')} */\nmodule.exports = function hasProto() {\n\treturn result;\n};\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/has-proto/index.js?")},4039:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = __webpack_require__(1333);\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?")},1333: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?")},9957:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = __webpack_require__(6743);\n\n/** @type {import('.')} */\nmodule.exports = bind.call(call, $hasOwn);\n\n\n//# sourceURL=webpack://@gudhub/core/./node_modules/hasown/index.js?")},5615:(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?")},8859:(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__(2634);\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nvar quotes = {\n __proto__: null,\n 'double': '\"',\n single: \"'\"\n};\nvar quoteREs = {\n __proto__: null,\n 'double': /([\"\\\\])/g,\n single: /(['\\\\])/g\n};\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {\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 (\n (typeof globalThis !== 'undefined' && obj === globalThis)\n || (typeof __webpack_require__.g !== 'undefined' && obj === __webpack_require__.g)\n ) {\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 style = opts.quoteStyle || defaultStyle;\n var quoteChar = quotes[style];\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\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 var quoteRE = quoteREs[opts.quoteStyle || 'single'];\n quoteRE.lastIndex = 0;\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, quoteRE, '\\\\$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?")},4765: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?")},5373:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar stringify = __webpack_require__(8636);\nvar parse = __webpack_require__(2642);\nvar formats = __webpack_require__(4765);\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?")},2642:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar utils = __webpack_require__(7720);\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowEmptyArrays: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decodeDotInKeys: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n duplicates: 'combine',\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictDepth: 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('✓')\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 cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');\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;\n var 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(String(val));\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n var existing = has.call(obj, key);\n if (existing && options.duplicates === 'combine') {\n obj[key] = utils.combine(obj[key], val);\n } else if (!existing || options.duplicates === 'last') {\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 = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))\n ? []\n : [].concat(leaf);\n } else {\n obj = options.plainObjects ? { __proto__: null } : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;\n var index = parseInt(decodedRoot, 10);\n if (!options.parseArrays && decodedRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== decodedRoot\n && String(index) === decodedRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else if (decodedRoot !== '__proto__') {\n obj[decodedRoot] = 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, check strictDepth option for throw, else just add whatever is left\n\n if (segment) {\n if (options.strictDepth === true) {\n throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');\n }\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 (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {\n throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.decoder !== null && typeof 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 var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;\n\n if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {\n throw new TypeError('The duplicates option must be either combine, first, or last');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\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 decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,\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 duplicates: duplicates,\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 strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,\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 ? { __proto__: null } : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? { __proto__: 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?")},8636:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar getSideChannel = __webpack_require__(920);\nvar utils = __webpack_require__(7720);\nvar formats = __webpack_require__(4765);\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 allowEmptyArrays: false,\n arrayFormat: 'indices',\n charset: 'utf-8',\n charsetSentinel: false,\n commaRoundTrip: false,\n delimiter: '&',\n encode: true,\n encodeDotInKeys: false,\n encoder: utils.encode,\n encodeValuesOnly: false,\n filter: void undefined,\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 allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\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 encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\\./g, '%2E') : String(prefix);\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;\n\n if (allowEmptyArrays && isArray(obj) && obj.length === 0) {\n return adjustedPrefix + '[]';\n }\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && key && typeof key.value !== 'undefined'\n ? key.value\n : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\\./g, '%2E') : String(key);\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');\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 allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\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 (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {\n throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');\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 var arrayFormat;\n if (opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if ('indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = defaults.arrayFormat;\n }\n\n if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n arrayFormat: arrayFormat,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n commaRoundTrip: !!opts.commaRoundTrip,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,\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 generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];\n var commaRoundTrip = generateArrayPrefix === 'comma' && options.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 var value = obj[key];\n\n if (options.skipNulls && value === null) {\n continue;\n }\n pushToArray(keys, stringify(\n value,\n key,\n generateArrayPrefix,\n commaRoundTrip,\n options.allowEmptyArrays,\n options.strictNullHandling,\n options.skipNulls,\n options.encodeDotInKeys,\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('✓'), 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?")},7720:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar formats = __webpack_require__(4765);\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 ? { __proto__: 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' && typeof source !== 'function') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if (\n (options && (options.plainObjects || options.allowPrototypes))\n || !has.call(Object.prototype, source)\n ) {\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, defaultDecoder, 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 limit = 1024;\n\n/* eslint operator-linebreak: [2, \"before\"] */\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 j = 0; j < string.length; j += limit) {\n var segment = string.length >= limit ? string.slice(j, j + limit) : string;\n var arr = [];\n\n for (var i = 0; i < segment.length; ++i) {\n var c = segment.charCodeAt(i);\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 arr[arr.length] = segment.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n arr[arr.length] = hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n arr[arr.length] = hexTable[0xC0 | (c >> 6)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n arr[arr.length] = hexTable[0xE0 | (c >> 12)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));\n\n arr[arr.length] = hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n out += arr.join('');\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?")},6897:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(453);\nvar define = __webpack_require__(41);\nvar hasDescriptors = __webpack_require__(592)();\nvar gOPD = __webpack_require__(5795);\n\nvar $TypeError = __webpack_require__(9675);\nvar $floor = GetIntrinsic('%Math.floor%');\n\n/** @type {import('.')} */\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?")},920:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\nvar GetIntrinsic = __webpack_require__(453);\nvar callBound = __webpack_require__(8075);\nvar inspect = __webpack_require__(8859);\n\nvar $TypeError = __webpack_require__(9675);\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*/\n/** @type {import('.').listGetNode} */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\t/** @type {typeof list | NonNullable<(typeof list)['next']>} */\n\tvar prev = list;\n\t/** @type {(typeof list)['next']} */\n\tvar curr;\n\tfor (; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\tcurr.next = /** @type {NonNullable<typeof list.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\n/** @type {import('.').listGet} */\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\n/** @type {import('.').listSet} */\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 = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t});\n\t}\n};\n/** @type {import('.').listHas} */\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannel() {\n\t/** @type {WeakMap<object, unknown>} */ var $wm;\n\t/** @type {Map<object, unknown>} */ var $m;\n\t/** @type {import('.').RootNode<unknown>} */ var $o;\n\n\t/** @type {import('.').Channel} */\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?")},1591: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?")},2634:()=>{eval("/* (ignored) */\n\n//# sourceURL=webpack://@gudhub/core/./util.inspect_(ignored)?")},4994:module=>{eval('function _interopRequireDefault(e) {\n return e && e.__esModule ? e : {\n "default": e\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?')},3738: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?')},7437:(__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\nvar 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";\nvar wss_url = "wss://gudhub.com/GudHub/ws/app/";\nvar node_server_url = "https://gudhub.com/api/services/prod";\nvar async_modules_path = \'build/latest/async_modules_node/\';\nvar automation_modules_path = \'build/latest/automation_modules/\';\nvar file_server_url = \'https://gudhub.com\';\nvar cache_chunk_requests = true;\nvar cache_app_requests = true;\n\n// FOR TESTS\nvar port = 9000;\n// EXTERNAL MODULE: ./GUDHUB/consts.js\nvar consts = __webpack_require__(6950);\n;// CONCATENATED MODULE: ./GUDHUB/DataService/DataService.js\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }\nfunction _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nvar DataService = /*#__PURE__*/_createClass(function DataService() {\n _classCallCheck(this, DataService);\n});\n;\n;// CONCATENATED MODULE: ./GUDHUB/DataService/AppDataService.js\nfunction AppDataService_typeof(o) { "@babel/helpers - typeof"; return AppDataService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, AppDataService_typeof(o); }\nfunction _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == AppDataService_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(AppDataService_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction AppDataService_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction AppDataService_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, AppDataService_toPropertyKey(o.key), o); } }\nfunction AppDataService_createClass(e, r, t) { return r && AppDataService_defineProperties(e.prototype, r), t && AppDataService_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction AppDataService_toPropertyKey(t) { var i = AppDataService_toPrimitive(t, "string"); return "symbol" == AppDataService_typeof(i) ? i : i + ""; }\nfunction AppDataService_toPrimitive(t, r) { if ("object" != AppDataService_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != AppDataService_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && ("object" == AppDataService_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n//TODO processRequestedApp should be checked that all code is ok !!!!!!!!!!!!!!!! Ive not ended checking\n\nvar AppDataService = /*#__PURE__*/function (_DataService) {\n //interface for indexeddb and http services\n\n function AppDataService(req, conf, gudhub) {\n var _this;\n AppDataService_classCallCheck(this, AppDataService);\n _this = _callSuper(this, AppDataService);\n _this.chunkDataService = new export_ChunkDataService(req, chunkDataServiceConf, gudhub);\n _this.gudhub = gudhub;\n return _this;\n }\n _inherits(AppDataService, _DataService);\n return AppDataService_createClass(AppDataService, [{\n key: "isWithCache",\n value: function isWithCache() {\n return false;\n }\n\n //here\n }, {\n key: "processRequestedApp",\n value: function () {\n var _processRequestedApp = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(id, sentData) {\n var res, cachedApp, _res, _res2, _res3;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (this.isWithCache()) {\n _context.next = 9;\n break;\n }\n _context.next = 3;\n return this.chunkDataService.getMergedChunkForIDList(id, sentData.chunks);\n case 3:\n res = _context.sent;\n if (!res) {\n _context.next = 8;\n break;\n }\n _context.next = 7;\n return this.gudhub.util.mergeChunks([res, sentData]);\n case 7:\n sentData.items_list = _context.sent;\n case 8:\n return _context.abrupt("return", sentData);\n case 9:\n throw new Error();\n case 13:\n cachedApp = _context.sent;\n if (cachedApp) {\n _context.next = 23;\n break;\n }\n _context.next = 17;\n return this.chunkDataService.getMergedChunkForIDList(id, sentData.chunks);\n case 17:\n _res = _context.sent;\n if (!_res) {\n _context.next = 22;\n break;\n }\n _context.next = 21;\n return this.gudhub.util.mergeChunks([_res, sentData]);\n case 21:\n sentData.items_list = _context.sent;\n case 22:\n return _context.abrupt("return", sentData);\n case 23:\n _context.next = 25;\n return this.chunkDataService.getCachedMergedChunk(id, cachedApp.chunks);\n case 25:\n _res2 = _context.sent;\n if (!_res2) {\n _context.next = 32;\n break;\n }\n _context.next = 29;\n return this.gudhub.util.mergeChunks([cachedApp, _res2, sentData]);\n case 29:\n sentData.items_list = _context.sent;\n _context.next = 35;\n break;\n case 32:\n _context.next = 34;\n return this.gudhub.util.mergeChunks([cachedApp, sentData]);\n case 34:\n sentData.items_list = _context.sent;\n case 35:\n return _context.abrupt("return", sentData);\n case 38:\n _context.prev = 38;\n _context.t0 = _context["catch"](10);\n _context.next = 42;\n return this.chunkDataService.getMergedChunkForIDList(sentData.chunks);\n case 42:\n _res3 = _context.sent;\n if (!_res3) {\n _context.next = 47;\n break;\n }\n _context.next = 46;\n return this.gudhub.util.mergeChunks([_res3, sentData]);\n case 46:\n sentData.items_list = _context.sent;\n case 47:\n return _context.abrupt("return", sentData);\n case 48:\n case "end":\n return _context.stop();\n }\n }, _callee, this, [[10, 38]]);\n }));\n function processRequestedApp(_x, _x2) {\n return _processRequestedApp.apply(this, arguments);\n }\n return processRequestedApp;\n }()\n }]);\n}(DataService);\n;// CONCATENATED MODULE: ./GUDHUB/api/AppApi.js\nfunction AppApi_typeof(o) { "@babel/helpers - typeof"; return AppApi_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, AppApi_typeof(o); }\nfunction AppApi_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ AppApi_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == AppApi_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(AppApi_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction AppApi_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction AppApi_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { AppApi_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { AppApi_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction AppApi_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction AppApi_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, AppApi_toPropertyKey(o.key), o); } }\nfunction AppApi_createClass(e, r, t) { return r && AppApi_defineProperties(e.prototype, r), t && AppApi_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction AppApi_toPropertyKey(t) { var i = AppApi_toPrimitive(t, "string"); return "symbol" == AppApi_typeof(i) ? i : i + ""; }\nfunction AppApi_toPrimitive(t, r) { if ("object" != AppApi_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != AppApi_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar AppAPI = /*#__PURE__*/function () {\n function AppAPI(req) {\n AppApi_classCallCheck(this, AppAPI);\n this.req = req;\n }\n return AppApi_createClass(AppAPI, [{\n key: "getApp",\n value: function () {\n var _getApp = AppApi_asyncToGenerator(/*#__PURE__*/AppApi_regeneratorRuntime().mark(function _callee(app_id) {\n return AppApi_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt("return", this.req.get({\n url: "/api/app/get",\n params: {\n app_id: app_id\n }\n }));\n case 1:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function getApp(_x) {\n return _getApp.apply(this, arguments);\n }\n return getApp;\n }()\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/DataService/utils.js\nvar objectAssignWithoutOverride = function objectAssignWithoutOverride(target) {\n for (var _len = arguments.length, sourceList = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n sourceList[_key - 1] = arguments[_key];\n }\n for (var _i = 0, _sourceList = sourceList; _i < _sourceList.length; _i++) {\n var source = _sourceList[_i];\n if (!source) continue;\n for (var _i2 = 0, _Object$keys = Object.keys(source); _i2 < _Object$keys.length; _i2++) {\n var key = _Object$keys[_i2];\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 var desc = Object.getOwnPropertyDescriptor(source, key);\n if (desc.enumerable) Object.defineProperty(target, key, desc);\n }\n }\n }\n};\nvar objectAssignWithOverride = function objectAssignWithOverride(target) {\n for (var _len2 = arguments.length, sourceList = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n sourceList[_key2 - 1] = arguments[_key2];\n }\n for (var _i3 = 0, _sourceList2 = sourceList; _i3 < _sourceList2.length; _i3++) {\n var source = _sourceList2[_i3];\n if (!source) continue;\n for (var _i4 = 0, _Object$keys2 = Object.keys(source); _i4 < _Object$keys2.length; _i4++) {\n var key = _Object$keys2[_i4];\n //this doesnt iterate over class like source properties\n var desc = Object.getOwnPropertyDescriptor(source, key);\n if (desc.enumerable) Object.defineProperty(target, key, desc);\n }\n }\n};\nvar checkInstanceModifier = function checkInstanceModifier(target) {\n for (var _len3 = arguments.length, sourceList = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n sourceList[_key3 - 1] = arguments[_key3];\n }\n for (var _i5 = 0, _sourceList3 = sourceList; _i5 < _sourceList3.length; _i5++) {\n var source = _sourceList3[_i5];\n if (!source) continue;\n for (var _i6 = 0, _Object$keys3 = Object.keys(source); _i6 < _Object$keys3.length; _i6++) {\n var key = _Object$keys3[_i6];\n //this doesnt iterate over class like source properties\n var desc = Object.getOwnPropertyDescriptor(source, key);\n if (desc.enumerable) Object.defineProperty(target, key, desc);\n }\n }\n};\n\n// // Base classes\n// class IndexedDBMixin {\n// constructor(dbName, version) {\n// this.dbName = dbName;\n// this.version = version;\n// this.dbPromise = this.openConnection();\n// }\n\n// openConnection() {\n// return new Promise((resolve, reject) => {\n// const request = indexedDB.open(this.dbName, this.version);\n\n// request.onupgradeneeded = (event) => {\n// const db = event.target.result;\n// if (!db.objectStoreNames.contains(\'storeName\')) {\n// db.createObjectStore(\'storeName\', { keyPath: \'id\' });\n// }\n// };\n\n// request.onsuccess = (event) => resolve(event.target.result);\n// request.onerror = (event) => reject(event.target.error);\n// });\n// }\n\n// async getDB() {\n// return await this.dbPromise;\n// }\n\n// async addRecord(storeName, record) {\n// const db = await this.getDB();\n// return new Promise((resolve, reject) => {\n// const transaction = db.transaction(storeName, \'readwrite\');\n// const store = transaction.objectStore(storeName);\n// const request = store.add(record);\n\n// request.onsuccess = () => resolve(request.result);\n// request.onerror = () => reject(request.error);\n// });\n// }\n\n// async getRecord(storeName, key) {\n// const db = await this.getDB();\n// return new Promise((resolve, reject) => {\n// const transaction = db.transaction(storeName, \'readonly\');\n// const store = transaction.objectStore(storeName);\n// const request = store.get(key);\n\n// request.onsuccess = () => resolve(request.result);\n// request.onerror = () => reject(request.error);\n// });\n// }\n// }\n\n// class LoggingMixin {\n// log(message) {\n// console.log(message);\n// }\n\n// error(message) {\n// console.error(message);\n// }\n// }\n\n// // Mixin function\n// function applyMixins(targetClass, baseClasses) {\n// baseClasses.forEach(baseClass => {\n// Object.getOwnPropertyDescriptors(baseClass.prototype).forEach(descriptor => {\n// Object.defineProperty(targetClass.prototype, descriptor[0], descriptor[1]);\n// });\n// });\n// }\n\n// // Combined class\n// class EnhancedIndexedDB extends IndexedDBMixin {\n// constructor(dbName, version) {\n// super(dbName, version);\n// }\n// }\n\n// // Apply mixins\n// applyMixins(EnhancedIndexedDB, [LoggingMixin]);\n\n// // Usage example\n// const dbFacade = new EnhancedIndexedDB(\'myDatabase\', 1);\n\n// dbFacade.addRecord(\'storeName\', { id: 1, name: \'Sample\' })\n// .then((id) => {\n// dbFacade.log(\'Record added with id: \' + id);\n// })\n// .catch((error) => {\n// dbFacade.error(\'Error adding record: \' + error);\n// });\n\n// dbFacade.getRecord(\'storeName\', 1)\n// .then((record) => {\n// dbFacade.log(\'Record retrieved: \' + JSON.stringify(record));\n// })\n// .catch((error) => {\n// dbFacade.error(\'Error retrieving record: \' + error);\n// });\n;// CONCATENATED MODULE: ./GUDHUB/DataService/httpService/HttpService.js\nfunction HttpService_typeof(o) { "@babel/helpers - typeof"; return HttpService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, HttpService_typeof(o); }\nfunction HttpService_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, HttpService_toPropertyKey(o.key), o); } }\nfunction HttpService_createClass(e, r, t) { return r && HttpService_defineProperties(e.prototype, r), t && HttpService_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction HttpService_toPropertyKey(t) { var i = HttpService_toPrimitive(t, "string"); return "symbol" == HttpService_typeof(i) ? i : i + ""; }\nfunction HttpService_toPrimitive(t, r) { if ("object" != HttpService_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != HttpService_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nfunction HttpService_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nvar HttpService = /*#__PURE__*/HttpService_createClass(function HttpService() {\n HttpService_classCallCheck(this, HttpService);\n});\n;// CONCATENATED MODULE: ./GUDHUB/DataService/httpService/AppHttpService.js\nfunction AppHttpService_typeof(o) { "@babel/helpers - typeof"; return AppHttpService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, AppHttpService_typeof(o); }\nfunction AppHttpService_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ AppHttpService_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == AppHttpService_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(AppHttpService_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction AppHttpService_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction AppHttpService_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { AppHttpService_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { AppHttpService_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction AppHttpService_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction AppHttpService_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, AppHttpService_toPropertyKey(o.key), o); } }\nfunction AppHttpService_createClass(e, r, t) { return r && AppHttpService_defineProperties(e.prototype, r), t && AppHttpService_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction AppHttpService_toPropertyKey(t) { var i = AppHttpService_toPrimitive(t, "string"); return "symbol" == AppHttpService_typeof(i) ? i : i + ""; }\nfunction AppHttpService_toPrimitive(t, r) { if ("object" != AppHttpService_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != AppHttpService_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nfunction AppHttpService_callSuper(t, o, e) { return o = AppHttpService_getPrototypeOf(o), AppHttpService_possibleConstructorReturn(t, AppHttpService_isNativeReflectConstruct() ? Reflect.construct(o, e || [], AppHttpService_getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction AppHttpService_possibleConstructorReturn(t, e) { if (e && ("object" == AppHttpService_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return AppHttpService_assertThisInitialized(t); }\nfunction AppHttpService_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); return e; }\nfunction AppHttpService_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (AppHttpService_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction AppHttpService_getPrototypeOf(t) { return AppHttpService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, AppHttpService_getPrototypeOf(t); }\nfunction AppHttpService_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && AppHttpService_setPrototypeOf(t, e); }\nfunction AppHttpService_setPrototypeOf(t, e) { return AppHttpService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, AppHttpService_setPrototypeOf(t, e); }\n\n\n\n\n\nvar AppHttpService = /*#__PURE__*/function (_AppDataService) {\n function AppHttpService(req, conf, gudhub) {\n var _this;\n AppHttpService_classCallCheck(this, AppHttpService);\n _this = AppHttpService_callSuper(this, AppHttpService, [req, conf, gudhub]);\n _this.appApi = new AppAPI(req);\n var indexDBService = new HttpService(conf);\n\n // this.chunkDataService = new ChunkDataService; //TODO move to \n\n objectAssignWithOverride(_this, indexDBService);\n return _this;\n }\n AppHttpService_inherits(AppHttpService, _AppDataService);\n return AppHttpService_createClass(AppHttpService, [{\n key: "getApp",\n value: function () {\n var _getApp = AppHttpService_asyncToGenerator(/*#__PURE__*/AppHttpService_regeneratorRuntime().mark(function _callee(id) {\n var sentData;\n return AppHttpService_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this.appApi.getApp(id);\n case 2:\n sentData = _context.sent;\n return _context.abrupt("return", this.processRequestedApp(id, sentData));\n case 4:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function getApp(_x) {\n return _getApp.apply(this, arguments);\n }\n return getApp;\n }() //TODO should be getApp and getAppAndProcessData - refactor whole code to use them\n //TODO андрей говорил про то что там надо фильтровать айтемы удаленные, я так и не доделал\n }, {\n key: "getAppWithoutProcessing",\n value: function () {\n var _getAppWithoutProcessing = AppHttpService_asyncToGenerator(/*#__PURE__*/AppHttpService_regeneratorRuntime().mark(function _callee2(id) {\n return AppHttpService_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt("return", this.appApi.getApp(id));\n case 1:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function getAppWithoutProcessing(_x2) {\n return _getAppWithoutProcessing.apply(this, arguments);\n }\n return getAppWithoutProcessing;\n }()\n }, {\n key: "putApp",\n value: function () {\n var _putApp = AppHttpService_asyncToGenerator(/*#__PURE__*/AppHttpService_regeneratorRuntime().mark(function _callee3(id, app) {\n return AppHttpService_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n case "end":\n return _context3.stop();\n }\n }, _callee3);\n }));\n function putApp(_x3, _x4) {\n return _putApp.apply(this, arguments);\n }\n return putApp;\n }()\n }], [{\n key: Symbol.hasInstance,\n value: function value(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}(AppDataService);\n;\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/appDataConf.js\n// import { dbName } from "./consts.js";\n\n// move to folder also remove chunksConf\n\nvar appsConf = {\n // dbName,\n // dbVersion,\n store: \'apps\'\n};\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/chunkDataConf.js\n// import { dbName, dbVersion } from "./consts.js";\n\nvar chunkDataConf_chunksConf = {\n // dbName,\n // dbVersion,\n store: \'chunks\'\n};\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/consts.js\nvar dbName = "gudhub";\n// export const dbVersion = 7;\n\n//todo dynamic version change chatgpt used, maybe isnt good to use static version\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/storeManagerConf/chunkCacheStoreManagerConf.js\n// import { dbName, dbVersion } from "./consts.js";\n\nvar chunksMergeConf = {\n // dbName,\n // dbVersion,\n store: \'chunksMergeCache\'\n};\n\n//seems dbname and dbversion arent required here\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/IndexedDBService.js\nfunction IndexedDBService_typeof(o) { "@babel/helpers - typeof"; return IndexedDBService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, IndexedDBService_typeof(o); }\nfunction _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction IndexedDBService_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ IndexedDBService_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == IndexedDBService_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(IndexedDBService_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction IndexedDBService_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction IndexedDBService_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { IndexedDBService_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { IndexedDBService_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction IndexedDBService_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, IndexedDBService_toPropertyKey(o.key), o); } }\nfunction IndexedDBService_createClass(e, r, t) { return r && IndexedDBService_defineProperties(e.prototype, r), t && IndexedDBService_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction IndexedDBService_toPropertyKey(t) { var i = IndexedDBService_toPrimitive(t, "string"); return "symbol" == IndexedDBService_typeof(i) ? i : i + ""; }\nfunction IndexedDBService_toPrimitive(t, r) { if ("object" != IndexedDBService_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != IndexedDBService_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nfunction IndexedDBService_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\n\n\n\n\n\n// этот класс для наследования был создан, т.е. надо подумать как его скомпоновать с IndexedDBManager\nvar IndexedDBService = /*#__PURE__*/IndexedDBService_createClass(function IndexedDBService(conf) {\n IndexedDBService_classCallCheck(this, IndexedDBService);\n this.store = conf.store;\n this.dbName = conf.dbName;\n this.dbVersion = conf.dbVersion;\n this.requestCache = new Map(); // id -> promise ///TODO seems irrelevant to class IndexedDBManager (could be renamed to Facade already)\n});\n\n//Maybe rename to Facade\nvar IndexedDBManager = /*#__PURE__*/function () {\n function IndexedDBManager(dbName,\n // dbVersion, \n storeNameList) {\n IndexedDBService_classCallCheck(this, IndexedDBManager);\n if (!IndexedDBManager.dbNameToInstanceMap) {\n IndexedDBManager.dbNameToInstanceMap = new Map();\n }\n if (IndexedDBManager.dbNameToInstanceMap.has(dbName)) return IndexedDBManager.dbNameToInstanceMap.get(dbName);\n this.db = null;\n // this.queue = [];\n // this.isProcessing = false;\n\n this.dbName = dbName;\n // this.dbVersion = dbVersion;\n this.storeNameList = storeNameList;\n // this.storeNameList = [];\n\n IndexedDBManager.dbNameToInstanceMap.set(dbName, this);\n\n // this.db = new Promise((resolve, reject) => {\n\n // });\n\n // this.dbPrms = this.openDB();\n\n this.db = null;\n\n // this.db = this.openDB();\n\n // this \n\n // this.openDB();\n }\n\n // TODO also remove outdated stores\n return IndexedDBService_createClass(IndexedDBManager, [{\n key: "checkAndCreateStore",\n value: function () {\n var _checkAndCreateStore = IndexedDBService_asyncToGenerator(/*#__PURE__*/IndexedDBService_regeneratorRuntime().mark(function _callee(storeName) {\n var _this = this;\n var databases, dbInfo, storeExists, self;\n return IndexedDBService_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return indexedDB.databases();\n case 2:\n databases = _context.sent;\n dbInfo = databases.find(function (db) {\n return db.name === _this.dbName;\n });\n storeExists = false;\n self = this;\n if (!dbInfo) {\n _context.next = 10;\n break;\n }\n _context.next = 9;\n return new Promise(function (resolve, reject) {\n var request = indexedDB.open(self.dbName);\n request.onsuccess = function (event) {\n var db = event.target.result;\n var exists = db.objectStoreNames.contains(storeName);\n db.close();\n resolve(exists);\n };\n request.onerror = function (event) {\n reject(event.target.error);\n };\n });\n case 9:\n storeExists = _context.sent;\n case 10:\n if (storeExists) {\n _context.next = 12;\n break;\n }\n return _context.abrupt("return", new Promise(function (resolve, reject) {\n var request = indexedDB.open(self.dbName, dbInfo ? dbInfo.version + 1 : 1);\n request.onupgradeneeded = function (event) {\n var db = event.target.result;\n if (!db.objectStoreNames.contains(storeName)) {\n db.createObjectStore(storeName);\n }\n };\n request.onsuccess = function (event) {\n var db = event.target.result;\n db.close();\n resolve();\n };\n request.onerror = reject;\n }));\n case 12:\n return _context.abrupt("return", true);\n case 13:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function checkAndCreateStore(_x) {\n return _checkAndCreateStore.apply(this, arguments);\n }\n return checkAndCreateStore;\n }() // // Usage example\n // checkAndCreateStore(\'myDatabase\', \'myObjectStore\').then(() => {\n // console.log(\'Check and creation (if necessary) complete.\');\n // }).catch(error => {\n // console.error(\'Error checking and creating object store:\', error);\n // });\n }, {\n key: "openDB",\n value: function () {\n var _openDB = IndexedDBService_asyncToGenerator(/*#__PURE__*/IndexedDBService_regeneratorRuntime().mark(function _callee2() {\n var _this2 = this;\n var resolver, rejecter, dbPrms, _iterator, _step, storeName, self, request;\n return IndexedDBService_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (!this.db) {\n _context2.next = 2;\n break;\n }\n return _context2.abrupt("return", this.db);\n case 2:\n dbPrms = new Promise(function (resolve, reject) {\n resolver = resolve;\n rejecter = reject;\n });\n _iterator = _createForOfIteratorHelper(this.storeNameList);\n _context2.prev = 4;\n _iterator.s();\n case 6:\n if ((_step = _iterator.n()).done) {\n _context2.next = 12;\n break;\n }\n storeName = _step.value;\n _context2.next = 10;\n return this.checkAndCreateStore(storeName);\n case 10:\n _context2.next = 6;\n break;\n case 12:\n _context2.next = 17;\n break;\n case 14:\n _context2.prev = 14;\n _context2.t0 = _context2["catch"](4);\n _iterator.e(_context2.t0);\n case 17:\n _context2.prev = 17;\n _iterator.f();\n return _context2.finish(17);\n case 20:\n self = this; // return new Promise((resolve, reject) => {\n // const request = indexedDB.open(this.dbName, this.dbVersion);\n request = indexedDB.open(this.dbName); // request.onupgradeneeded = (event) => {\n // const db = event.target.result;\n // this.storeNameList.forEach(storeName => {\n // if (\n // !db.objectStoreNames.contains(storeName)\n // ) {\n // db.createObjectStore(storeName);\n // }\n // });\n // };\n request.onsuccess = function (event) {\n self.db = event.target.result;\n\n // let version = this.db.version;\n\n resolver(_this2.db);\n };\n request.onerror = rejecter;\n return _context2.abrupt("return", dbPrms);\n case 25:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this, [[4, 14, 17, 20]]);\n }));\n function openDB() {\n return _openDB.apply(this, arguments);\n }\n return openDB;\n }()\n }, {\n key: "executeOperation",\n value: function () {\n var _executeOperation = IndexedDBService_asyncToGenerator(/*#__PURE__*/IndexedDBService_regeneratorRuntime().mark(function _callee3(storeName, operation) {\n var db;\n return IndexedDBService_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return this.openDB();\n case 2:\n db = _context3.sent;\n return _context3.abrupt("return", new Promise(function (resolve, reject) {\n var transaction = db.transaction(storeName, \'readwrite\'); //TODO not all operations readwrite\n var store = transaction.objectStore(storeName);\n transaction.oncomplete = function () {\n return resolve();\n };\n transaction.onerror = function (event) {\n return reject("Transaction failed: ".concat(event.target.error));\n };\n try {\n operation(store);\n } catch (error) {\n reject("Operation failed: ".concat(error.message));\n }\n }));\n case 4:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function executeOperation(_x2, _x3) {\n return _executeOperation.apply(this, arguments);\n }\n return executeOperation;\n }() // в инете пишут что индексдб сам хендлит транзакции, может не нужно вообще городить эти конструкции\n // async enqueueOperation(storeName, type, operation) {\n // await this.ensureStoreExists(storeName); // Ensure the store exists <-----------------------\n // const db = await this.dbPromise;\n // return new Promise((resolve, reject) => {\n // const transaction = db.transaction(storeName, type);\n // const store = transaction.objectStore(storeName);\n // const request = operation(store);\n // request.onsuccess = (event) => {\n // resolve(event.target.result);\n // };\n // request.onerror = (event) => {\n // reject(event.target.error);\n // };\n // });\n // }\n }, {\n key: "enqueueOperation",\n value: function () {\n var _enqueueOperation = IndexedDBService_asyncToGenerator(/*#__PURE__*/IndexedDBService_regeneratorRuntime().mark(function _callee4(storeName, operation) {\n var _this$queue$shift, _storeName, _operation;\n return IndexedDBService_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n this.queue.push({\n storeName: storeName,\n operation: operation\n });\n if (this.isProcessing) {\n _context4.next = 16;\n break;\n }\n this.isProcessing = true;\n case 3:\n if (!(this.queue.length > 0)) {\n _context4.next = 15;\n break;\n }\n _this$queue$shift = this.queue.shift(), _storeName = _this$queue$shift.storeName, _operation = _this$queue$shift.operation;\n _context4.prev = 5;\n _context4.next = 8;\n return this.executeOperation(_storeName, _operation);\n case 8:\n _context4.next = 13;\n break;\n case 10:\n _context4.prev = 10;\n _context4.t0 = _context4["catch"](5);\n console.error(\'Operation failed:\', _context4.t0);\n case 13:\n _context4.next = 3;\n break;\n case 15:\n this.isProcessing = false;\n case 16:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this, [[5, 10]]);\n }));\n function enqueueOperation(_x4, _x5) {\n return _enqueueOperation.apply(this, arguments);\n }\n return enqueueOperation;\n }() // единственное что тут не нравится - версия динамически меняется\n }, {\n key: "ensureStoreExists",\n value: function () {\n var _ensureStoreExists = IndexedDBService_asyncToGenerator(/*#__PURE__*/IndexedDBService_regeneratorRuntime().mark(function _callee5(storeName) {\n return IndexedDBService_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n case "end":\n return _context5.stop();\n }\n }, _callee5);\n }));\n function ensureStoreExists(_x6) {\n return _ensureStoreExists.apply(this, arguments);\n }\n return ensureStoreExists;\n }() // async ensureStoreExists(storeName) {\n // const db = await this.dbPromise;\n // if (!db.objectStoreNames.contains(storeName)) {\n // this.db.close();\n // const version = db.version + 1;\n // const request = indexedDB.open(this.dbName, version);\n // request.onupgradeneeded = (event) => {\n // const upgradedDb = event.target.result;\n // if (!upgradedDb.objectStoreNames.contains(storeName)) {\n // upgradedDb.createObjectStore(storeName, { keyPath: \'id\', autoIncrement: true });\n // }\n // };\n // return new Promise((resolve, reject) => {\n // request.onsuccess = (event) => {\n // this.db = event.target.result;\n // this.dbPromise = Promise.resolve(this.db); // Update the dbPromise\n // resolve(this.db);\n // };\n // request.onerror = (event) => {\n // reject(event.target.error);\n // };\n // });\n // }\n // return Promise.resolve(db);\n // }\n }, {\n key: "createObjectStore",\n value: function () {\n var _createObjectStore = IndexedDBService_asyncToGenerator(/*#__PURE__*/IndexedDBService_regeneratorRuntime().mark(function _callee6(storeName) {\n return IndexedDBService_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n case "end":\n return _context6.stop();\n }\n }, _callee6);\n }));\n function createObjectStore(_x7) {\n return _createObjectStore.apply(this, arguments);\n }\n return createObjectStore;\n }()\n }]);\n}();\nvar IndexedDBService_gudhubIndexedDBManager = new IndexedDBManager(dbName,\n// dbVersion, \n[appsConf.store, chunkDataConf_chunksConf.store, chunksMergeConf.store]);\n\n// export default dbManager; \n\n// последний ответ посмотри, там я спрашивал можно ли не закрывать и открывать дб из каждого сторменеджера\n\n// await this.ensureStoreExists(storeName); // Ensure the store exists - вот этот код вроде ок, т.е. перед выполнением след операции проверка\n;// CONCATENATED MODULE: ./GUDHUB/DataService/ChunkDataService.js\nfunction ChunkDataService_typeof(o) { "@babel/helpers - typeof"; return ChunkDataService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, ChunkDataService_typeof(o); }\nfunction ChunkDataService_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction ChunkDataService_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, ChunkDataService_toPropertyKey(o.key), o); } }\nfunction ChunkDataService_createClass(e, r, t) { return r && ChunkDataService_defineProperties(e.prototype, r), t && ChunkDataService_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction ChunkDataService_toPropertyKey(t) { var i = ChunkDataService_toPrimitive(t, "string"); return "symbol" == ChunkDataService_typeof(i) ? i : i + ""; }\nfunction ChunkDataService_toPrimitive(t, r) { if ("object" != ChunkDataService_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != ChunkDataService_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nfunction ChunkDataService_callSuper(t, o, e) { return o = ChunkDataService_getPrototypeOf(o), ChunkDataService_possibleConstructorReturn(t, ChunkDataService_isNativeReflectConstruct() ? Reflect.construct(o, e || [], ChunkDataService_getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction ChunkDataService_possibleConstructorReturn(t, e) { if (e && ("object" == ChunkDataService_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return ChunkDataService_assertThisInitialized(t); }\nfunction ChunkDataService_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); return e; }\nfunction ChunkDataService_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (ChunkDataService_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction ChunkDataService_getPrototypeOf(t) { return ChunkDataService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, ChunkDataService_getPrototypeOf(t); }\nfunction ChunkDataService_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && ChunkDataService_setPrototypeOf(t, e); }\nfunction ChunkDataService_setPrototypeOf(t, e) { return ChunkDataService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, ChunkDataService_setPrototypeOf(t, e); }\n\nvar ChunkDataService = /*#__PURE__*/function (_DataService) {\n function ChunkDataService() {\n ChunkDataService_classCallCheck(this, ChunkDataService);\n return ChunkDataService_callSuper(this, ChunkDataService, arguments);\n }\n ChunkDataService_inherits(ChunkDataService, _DataService);\n return ChunkDataService_createClass(ChunkDataService, [{\n key: "getMergedChunkForIDList",\n value:\n //interface for indexeddb and http services\n\n //here\n function getMergedChunkForIDList(idList) {}\n }, {\n key: "isWithCache",\n value: function isWithCache() {\n return false;\n }\n }]);\n}(DataService);\n;// CONCATENATED MODULE: ./GUDHUB/api/ChunkApi.js\nfunction ChunkApi_typeof(o) { "@babel/helpers - typeof"; return ChunkApi_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, ChunkApi_typeof(o); }\nfunction ChunkApi_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ ChunkApi_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == ChunkApi_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(ChunkApi_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction ChunkApi_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction ChunkApi_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { ChunkApi_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { ChunkApi_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction ChunkApi_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction ChunkApi_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, ChunkApi_toPropertyKey(o.key), o); } }\nfunction ChunkApi_createClass(e, r, t) { return r && ChunkApi_defineProperties(e.prototype, r), t && ChunkApi_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction ChunkApi_toPropertyKey(t) { var i = ChunkApi_toPrimitive(t, "string"); return "symbol" == ChunkApi_typeof(i) ? i : i + ""; }\nfunction ChunkApi_toPrimitive(t, r) { if ("object" != ChunkApi_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != ChunkApi_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar ChunkAPI = /*#__PURE__*/function () {\n function ChunkAPI(req) {\n ChunkApi_classCallCheck(this, ChunkAPI);\n this.req = req;\n }\n return ChunkApi_createClass(ChunkAPI, [{\n key: "getChunk",\n value: function () {\n var _getChunk = ChunkApi_asyncToGenerator(/*#__PURE__*/ChunkApi_regeneratorRuntime().mark(function _callee(app_id, chunk_id) {\n return ChunkApi_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt("return", this.req.get({\n url: "".concat(this.req.root, "/api/get-items-chunk/").concat(app_id, "/").concat(chunk_id),\n method: \'GET\'\n }));\n case 1:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function getChunk(_x, _x2) {\n return _getChunk.apply(this, arguments);\n }\n return getChunk;\n }()\n }, {\n key: "getLastChunk",\n value: function () {\n var _getLastChunk = ChunkApi_asyncToGenerator(/*#__PURE__*/ChunkApi_regeneratorRuntime().mark(function _callee2(app_id) {\n return ChunkApi_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt("return", this.req.axiosRequest({\n url: "".concat(this.req.root, "/api/get-last-items-chunk/").concat(app_id),\n method: \'GET\'\n }));\n case 1:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function getLastChunk(_x3) {\n return _getLastChunk.apply(this, arguments);\n }\n return getLastChunk;\n }()\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/DataService/httpService/ChunkHttpService.js\nfunction ChunkHttpService_typeof(o) { "@babel/helpers - typeof"; return ChunkHttpService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, ChunkHttpService_typeof(o); }\nfunction ChunkHttpService_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ ChunkHttpService_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == ChunkHttpService_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(ChunkHttpService_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction ChunkHttpService_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction ChunkHttpService_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { ChunkHttpService_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { ChunkHttpService_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction ChunkHttpService_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction ChunkHttpService_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, ChunkHttpService_toPropertyKey(o.key), o); } }\nfunction ChunkHttpService_createClass(e, r, t) { return r && ChunkHttpService_defineProperties(e.prototype, r), t && ChunkHttpService_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction ChunkHttpService_toPropertyKey(t) { var i = ChunkHttpService_toPrimitive(t, "string"); return "symbol" == ChunkHttpService_typeof(i) ? i : i + ""; }\nfunction ChunkHttpService_toPrimitive(t, r) { if ("object" != ChunkHttpService_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != ChunkHttpService_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nfunction ChunkHttpService_callSuper(t, o, e) { return o = ChunkHttpService_getPrototypeOf(o), ChunkHttpService_possibleConstructorReturn(t, ChunkHttpService_isNativeReflectConstruct() ? Reflect.construct(o, e || [], ChunkHttpService_getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction ChunkHttpService_possibleConstructorReturn(t, e) { if (e && ("object" == ChunkHttpService_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return ChunkHttpService_assertThisInitialized(t); }\nfunction ChunkHttpService_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); return e; }\nfunction ChunkHttpService_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (ChunkHttpService_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction ChunkHttpService_getPrototypeOf(t) { return ChunkHttpService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, ChunkHttpService_getPrototypeOf(t); }\nfunction ChunkHttpService_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && ChunkHttpService_setPrototypeOf(t, e); }\nfunction ChunkHttpService_setPrototypeOf(t, e) { return ChunkHttpService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, ChunkHttpService_setPrototypeOf(t, e); }\n\n\n\n\nvar ChunkHttpService = /*#__PURE__*/function (_ChunkDataService) {\n function ChunkHttpService(req, conf) {\n var _this;\n ChunkHttpService_classCallCheck(this, ChunkHttpService);\n _this = ChunkHttpService_callSuper(this, ChunkHttpService);\n _this.chunkApi = new ChunkAPI(req);\n var httpService = new HttpService(conf);\n objectAssignWithOverride(_this, httpService);\n return _this;\n }\n ChunkHttpService_inherits(ChunkHttpService, _ChunkDataService);\n return ChunkHttpService_createClass(ChunkHttpService, [{\n key: "getChunk",\n value: function () {\n var _getChunk = ChunkHttpService_asyncToGenerator(/*#__PURE__*/ChunkHttpService_regeneratorRuntime().mark(function _callee(app_id, id) {\n return ChunkHttpService_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt("return", this.chunkApi.getChunk(app_id, id));\n case 1:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function getChunk(_x, _x2) {\n return _getChunk.apply(this, arguments);\n }\n return getChunk;\n }()\n }, {\n key: "getChunksForId",\n value: function () {\n var _getChunksForId = ChunkHttpService_asyncToGenerator(/*#__PURE__*/ChunkHttpService_regeneratorRuntime().mark(function _callee2(app_id) {\n return ChunkHttpService_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt("return", []);\n case 1:\n case "end":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getChunksForId(_x3) {\n return _getChunksForId.apply(this, arguments);\n }\n return getChunksForId;\n }()\n }, {\n key: "getCachedMergedChunk",\n value: function getCachedMergedChunk(id, chunkHashesList) {}\n\n //here\n }, {\n key: "getMergedChunkForIDList",\n value: function getMergedChunkForIDList(id, chunkHashesList) {}\n }, {\n key: "putChunk",\n value: function putChunk() {\n //do nothing\n }\n }], [{\n key: Symbol.hasInstance,\n value: function value(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}(ChunkDataService);\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/StoreManager/BaseStoreManager.js\nfunction BaseStoreManager_typeof(o) { "@babel/helpers - typeof"; return BaseStoreManager_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, BaseStoreManager_typeof(o); }\nfunction BaseStoreManager_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ BaseStoreManager_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == BaseStoreManager_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(BaseStoreManager_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction BaseStoreManager_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction BaseStoreManager_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { BaseStoreManager_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { BaseStoreManager_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction BaseStoreManager_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction BaseStoreManager_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, BaseStoreManager_toPropertyKey(o.key), o); } }\nfunction BaseStoreManager_createClass(e, r, t) { return r && BaseStoreManager_defineProperties(e.prototype, r), t && BaseStoreManager_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction BaseStoreManager_toPropertyKey(t) { var i = BaseStoreManager_toPrimitive(t, "string"); return "symbol" == BaseStoreManager_typeof(i) ? i : i + ""; }\nfunction BaseStoreManager_toPrimitive(t, r) { if ("object" != BaseStoreManager_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != BaseStoreManager_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar BaseStoreManager_BaseStoreManager = /*#__PURE__*/function () {\n // constructor(dbManager, dbName, storeName) {\n function BaseStoreManager(dbManager, storeName) {\n BaseStoreManager_classCallCheck(this, BaseStoreManager);\n this.dbManager = dbManager;\n // this.dbName = dbName;\n this.storeName = storeName;\n // this.dbManager.openDB(this.dbName, [this.storeName]);\n // this.dbManager.ensureStoreExists(this.storeName);\n }\n return BaseStoreManager_createClass(BaseStoreManager, [{\n key: "addItem",\n value: function () {\n var _addItem = BaseStoreManager_asyncToGenerator(/*#__PURE__*/BaseStoreManager_regeneratorRuntime().mark(function _callee2(id, data) {\n var _this = this;\n return BaseStoreManager_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt("return", new Promise(/*#__PURE__*/function () {\n var _ref = BaseStoreManager_asyncToGenerator(/*#__PURE__*/BaseStoreManager_regeneratorRuntime().mark(function _callee(resolve, reject) {\n return BaseStoreManager_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _this.dbManager.executeOperation(_this.storeName, function (store) {\n var request = store.add(data, id);\n request.onsuccess = resolve;\n request.onerror = reject;\n });\n case 1:\n case "end":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x3, _x4) {\n return _ref.apply(this, arguments);\n };\n }()));\n case 1:\n case "end":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function addItem(_x, _x2) {\n return _addItem.apply(this, arguments);\n }\n return addItem;\n }()\n }, {\n key: "putItem",\n value: function () {\n var _putItem = BaseStoreManager_asyncToGenerator(/*#__PURE__*/BaseStoreManager_regeneratorRuntime().mark(function _callee4(id, data) {\n var _this2 = this;\n return BaseStoreManager_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt("return", new Promise(/*#__PURE__*/function () {\n var _ref2 = BaseStoreManager_asyncToGenerator(/*#__PURE__*/BaseStoreManager_regeneratorRuntime().mark(function _callee3(resolve, reject) {\n return BaseStoreManager_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _this2.dbManager.executeOperation(_this2.storeName, function (store) {\n var request = store.put(data, id);\n request.onsuccess = resolve;\n request.onerror = reject;\n });\n case 1:\n case "end":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function (_x7, _x8) {\n return _ref2.apply(this, arguments);\n };\n }()));\n case 1:\n case "end":\n return _context4.stop();\n }\n }, _callee4);\n }));\n function putItem(_x5, _x6) {\n return _putItem.apply(this, arguments);\n }\n return putItem;\n }()\n }, {\n key: "hasItem",\n value: function () {\n var _hasItem = BaseStoreManager_asyncToGenerator(/*#__PURE__*/BaseStoreManager_regeneratorRuntime().mark(function _callee6(id) {\n var _this3 = this;\n var item;\n return BaseStoreManager_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.prev = 0;\n _context6.next = 3;\n return this.getItem(id);\n case 3:\n item = _context6.sent;\n if (item) {\n _context6.next = 6;\n break;\n }\n return _context6.abrupt("return", false);\n case 6:\n return _context6.abrupt("return", true);\n case 9:\n _context6.prev = 9;\n _context6.t0 = _context6["catch"](0);\n return _context6.abrupt("return", false);\n case 12:\n return _context6.abrupt("return", new Promise(/*#__PURE__*/function () {\n var _ref3 = BaseStoreManager_asyncToGenerator(/*#__PURE__*/BaseStoreManager_regeneratorRuntime().mark(function _callee5(resolve, reject) {\n return BaseStoreManager_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _this3.dbManager.executeOperation(_this3.storeName, function (store) {\n var request = store.get(id);\n request.onsuccess = function () {\n var data = request.result;\n resolve(data);\n };\n request.onerror = reject;\n });\n case 1:\n case "end":\n return _context5.stop();\n }\n }, _callee5);\n }));\n return function (_x10, _x11) {\n return _ref3.apply(this, arguments);\n };\n }()));\n case 13:\n case "end":\n return _context6.stop();\n }\n }, _callee6, this, [[0, 9]]);\n }));\n function hasItem(_x9) {\n return _hasItem.apply(this, arguments);\n }\n return hasItem;\n }()\n }, {\n key: "getItem",\n value: function () {\n var _getItem = BaseStoreManager_asyncToGenerator(/*#__PURE__*/BaseStoreManager_regeneratorRuntime().mark(function _callee8(id) {\n var _this4 = this;\n return BaseStoreManager_regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n return _context8.abrupt("return", new Promise(/*#__PURE__*/function () {\n var _ref4 = BaseStoreManager_asyncToGenerator(/*#__PURE__*/BaseStoreManager_regeneratorRuntime().mark(function _callee7(resolve, reject) {\n return BaseStoreManager_regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _this4.dbManager.executeOperation(_this4.storeName, function (store) {\n var request = store.get(id);\n request.onsuccess = function () {\n var data = request.result;\n resolve(data);\n };\n request.onerror = reject;\n });\n case 1:\n case "end":\n return _context7.stop();\n }\n }, _callee7);\n }));\n return function (_x13, _x14) {\n return _ref4.apply(this, arguments);\n };\n }()));\n case 1:\n case "end":\n return _context8.stop();\n }\n }, _callee8);\n }));\n function getItem(_x12) {\n return _getItem.apply(this, arguments);\n }\n return getItem;\n }()\n }, {\n key: "updateItem",\n value: function () {\n var _updateItem = BaseStoreManager_asyncToGenerator(/*#__PURE__*/BaseStoreManager_regeneratorRuntime().mark(function _callee10(id, updatedItem) {\n var _this5 = this;\n return BaseStoreManager_regeneratorRuntime().wrap(function _callee10$(_context10) {\n while (1) switch (_context10.prev = _context10.next) {\n case 0:\n return _context10.abrupt("return", new Promise(/*#__PURE__*/function () {\n var _ref5 = BaseStoreManager_asyncToGenerator(/*#__PURE__*/BaseStoreManager_regeneratorRuntime().mark(function _callee9(resolve, reject) {\n return BaseStoreManager_regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n _this5.dbManager.executeOperation(_this5.storeName, function (store) {\n var request = store.get(id);\n request.onsuccess = function () {\n var data = request.result;\n Object.assign(data, updatedItem);\n store.put(data, id);\n\n //TODO wait put operation before resolve\n resolve();\n };\n request.onerror = reject;\n });\n case 1:\n case "end":\n return _context9.stop();\n }\n }, _callee9);\n }));\n return function (_x17, _x18) {\n return _ref5.apply(this, arguments);\n };\n }()));\n case 1:\n case "end":\n return _context10.stop();\n }\n }, _callee10);\n }));\n function updateItem(_x15, _x16) {\n return _updateItem.apply(this, arguments);\n }\n return updateItem;\n }()\n }, {\n key: "deleteItem",\n value: function () {\n var _deleteItem = BaseStoreManager_asyncToGenerator(/*#__PURE__*/BaseStoreManager_regeneratorRuntime().mark(function _callee12(id) {\n var _this6 = this;\n return BaseStoreManager_regeneratorRuntime().wrap(function _callee12$(_context12) {\n while (1) switch (_context12.prev = _context12.next) {\n case 0:\n return _context12.abrupt("return", new Promise(/*#__PURE__*/function () {\n var _ref6 = BaseStoreManager_asyncToGenerator(/*#__PURE__*/BaseStoreManager_regeneratorRuntime().mark(function _callee11(resolve, reject) {\n return BaseStoreManager_regeneratorRuntime().wrap(function _callee11$(_context11) {\n while (1) switch (_context11.prev = _context11.next) {\n case 0:\n _this6.dbManager.executeOperation(_this6.storeName, function (store) {\n var request = store["delete"](id);\n request.onsuccess = resolve;\n request.onerror = reject;\n });\n case 1:\n case "end":\n return _context11.stop();\n }\n }, _callee11);\n }));\n return function (_x20, _x21) {\n return _ref6.apply(this, arguments);\n };\n }()));\n case 1:\n case "end":\n return _context12.stop();\n }\n }, _callee12);\n }));\n function deleteItem(_x19) {\n return _deleteItem.apply(this, arguments);\n }\n return deleteItem;\n }()\n }]);\n}();\n\n//TODO move to base class here\n// this.requestCache = new Map; // id -> promise ///TODO seems irrelevant to class IndexedDBManager (could be renamed to Facade already)\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/StoreManager/managers.js\nfunction managers_typeof(o) { "@babel/helpers - typeof"; return managers_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, managers_typeof(o); }\nfunction managers_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ managers_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == managers_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(managers_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction managers_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction managers_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { managers_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { managers_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction managers_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction managers_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, managers_toPropertyKey(o.key), o); } }\nfunction managers_createClass(e, r, t) { return r && managers_defineProperties(e.prototype, r), t && managers_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction managers_toPropertyKey(t) { var i = managers_toPrimitive(t, "string"); return "symbol" == managers_typeof(i) ? i : i + ""; }\nfunction managers_toPrimitive(t, r) { if ("object" != managers_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != managers_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nfunction managers_callSuper(t, o, e) { return o = managers_getPrototypeOf(o), managers_possibleConstructorReturn(t, managers_isNativeReflectConstruct() ? Reflect.construct(o, e || [], managers_getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction managers_possibleConstructorReturn(t, e) { if (e && ("object" == managers_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return managers_assertThisInitialized(t); }\nfunction managers_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); return e; }\nfunction managers_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (managers_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction managers_getPrototypeOf(t) { return managers_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, managers_getPrototypeOf(t); }\nfunction managers_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && managers_setPrototypeOf(t, e); }\nfunction managers_setPrototypeOf(t, e) { return managers_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, managers_setPrototypeOf(t, e); }\n\n\n// import { dbName } from "../consts";\n\n\n\nvar AppStoreManager = /*#__PURE__*/function (_BaseStoreManager) {\n function AppStoreManager() {\n managers_classCallCheck(this, AppStoreManager);\n return managers_callSuper(this, AppStoreManager, [IndexedDBService_gudhubIndexedDBManager, appsConf.store]);\n }\n managers_inherits(AppStoreManager, _BaseStoreManager);\n return managers_createClass(AppStoreManager, [{\n key: "getApp",\n value: function () {\n var _getApp = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee(id) {\n return managers_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n return _context.abrupt("return", this.getItem(id));\n case 1:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function getApp(_x) {\n return _getApp.apply(this, arguments);\n }\n return getApp;\n }()\n }, {\n key: "addApp",\n value: function () {\n var _addApp = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee2(id, data) {\n return managers_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt("return", this.addItem(id, data));\n case 1:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function addApp(_x2, _x3) {\n return _addApp.apply(this, arguments);\n }\n return addApp;\n }()\n }, {\n key: "putApp",\n value: function () {\n var _putApp = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee3(id, data) {\n return managers_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt("return", this.putItem(id, data));\n case 1:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function putApp(_x4, _x5) {\n return _putApp.apply(this, arguments);\n }\n return putApp;\n }()\n }, {\n key: "hasApp",\n value: function () {\n var _hasApp = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee4(id) {\n return managers_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt("return", this.hasItem(id));\n case 1:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function hasApp(_x6) {\n return _hasApp.apply(this, arguments);\n }\n return hasApp;\n }()\n }, {\n key: "deleteApp",\n value: function () {\n var _deleteApp = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee5(id) {\n return managers_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n return _context5.abrupt("return", this.deleteItem(id));\n case 1:\n case "end":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function deleteApp(_x7) {\n return _deleteApp.apply(this, arguments);\n }\n return deleteApp;\n }() // Additional methods specific to AppStoreManager if necessary\n }]);\n}(BaseStoreManager_BaseStoreManager);\nvar ChunksStoreManager = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_BaseStoreManager2) {\n function ChunksStoreManager() {\n managers_classCallCheck(this, ChunksStoreManager);\n return managers_callSuper(this, ChunksStoreManager, [gudhubIndexedDBManager, chunksConf.store]);\n }\n managers_inherits(ChunksStoreManager, _BaseStoreManager2);\n return managers_createClass(ChunksStoreManager, [{\n key: "getChunk",\n value: function () {\n var _getChunk = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee6(id) {\n return managers_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n return _context6.abrupt("return", this.getItem(id));\n case 1:\n case "end":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function getChunk(_x8) {\n return _getChunk.apply(this, arguments);\n }\n return getChunk;\n }()\n }, {\n key: "addChunk",\n value: function () {\n var _addChunk = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee7(id, chunk) {\n return managers_regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n return _context7.abrupt("return", this.addItem(id, chunk));\n case 1:\n case "end":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function addChunk(_x9, _x10) {\n return _addChunk.apply(this, arguments);\n }\n return addChunk;\n }()\n }, {\n key: "putChunk",\n value: function () {\n var _putChunk = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee8(id, chunk) {\n return managers_regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n return _context8.abrupt("return", this.putItem(id, chunk));\n case 1:\n case "end":\n return _context8.stop();\n }\n }, _callee8, this);\n }));\n function putChunk(_x11, _x12) {\n return _putChunk.apply(this, arguments);\n }\n return putChunk;\n }()\n }, {\n key: "deleteChunk",\n value: function () {\n var _deleteChunk = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee9(id) {\n return managers_regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n return _context9.abrupt("return", this.deleteItem(id));\n case 1:\n case "end":\n return _context9.stop();\n }\n }, _callee9, this);\n }));\n function deleteChunk(_x13) {\n return _deleteChunk.apply(this, arguments);\n }\n return deleteChunk;\n }() //use item methods from BaseStoreManager !!!!!!!\n // Additional methods specific to ChunksStoreManager if necessary\n }]);\n}(BaseStoreManager)));\nvar MergedChunksStoreManager = /*#__PURE__*/function (_BaseStoreManager3) {\n function MergedChunksStoreManager() {\n managers_classCallCheck(this, MergedChunksStoreManager);\n return managers_callSuper(this, MergedChunksStoreManager, [IndexedDBService_gudhubIndexedDBManager, chunksMergeConf.store]);\n }\n managers_inherits(MergedChunksStoreManager, _BaseStoreManager3);\n return managers_createClass(MergedChunksStoreManager, [{\n key: "get",\n value: function () {\n var _get = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee10(id) {\n return managers_regeneratorRuntime().wrap(function _callee10$(_context10) {\n while (1) switch (_context10.prev = _context10.next) {\n case 0:\n return _context10.abrupt("return", this.getItem(id));\n case 1:\n case "end":\n return _context10.stop();\n }\n }, _callee10, this);\n }));\n function get(_x14) {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n }, {\n key: "add",\n value: function () {\n var _add = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee11(id, chunk) {\n return managers_regeneratorRuntime().wrap(function _callee11$(_context11) {\n while (1) switch (_context11.prev = _context11.next) {\n case 0:\n return _context11.abrupt("return", this.addItem(id, chunk));\n case 1:\n case "end":\n return _context11.stop();\n }\n }, _callee11, this);\n }));\n function add(_x15, _x16) {\n return _add.apply(this, arguments);\n }\n return add;\n }() //TODO update here ok?\n }, {\n key: "put",\n value: function () {\n var _put = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee12(id, chunk) {\n return managers_regeneratorRuntime().wrap(function _callee12$(_context12) {\n while (1) switch (_context12.prev = _context12.next) {\n case 0:\n return _context12.abrupt("return", this.putItem(id, chunk));\n case 1:\n case "end":\n return _context12.stop();\n }\n }, _callee12, this);\n }));\n function put(_x17, _x18) {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n }, {\n key: "delete",\n value: function () {\n var _delete2 = managers_asyncToGenerator(/*#__PURE__*/managers_regeneratorRuntime().mark(function _callee13(id) {\n return managers_regeneratorRuntime().wrap(function _callee13$(_context13) {\n while (1) switch (_context13.prev = _context13.next) {\n case 0:\n return _context13.abrupt("return", this.deleteItem(id));\n case 1:\n case "end":\n return _context13.stop();\n }\n }, _callee13, this);\n }));\n function _delete(_x19) {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n }]);\n}(BaseStoreManager_BaseStoreManager);\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/IndexedDBChunkService.js\nfunction IndexedDBChunkService_typeof(o) { "@babel/helpers - typeof"; return IndexedDBChunkService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, IndexedDBChunkService_typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || IndexedDBChunkService_unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return IndexedDBChunkService_arrayLikeToArray(r); }\nfunction IndexedDBChunkService_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = IndexedDBChunkService_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }\nfunction IndexedDBChunkService_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return IndexedDBChunkService_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? IndexedDBChunkService_arrayLikeToArray(r, a) : void 0; } }\nfunction IndexedDBChunkService_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction IndexedDBChunkService_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ IndexedDBChunkService_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == IndexedDBChunkService_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(IndexedDBChunkService_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction IndexedDBChunkService_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction IndexedDBChunkService_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { IndexedDBChunkService_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { IndexedDBChunkService_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction IndexedDBChunkService_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction IndexedDBChunkService_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, IndexedDBChunkService_toPropertyKey(o.key), o); } }\nfunction IndexedDBChunkService_createClass(e, r, t) { return r && IndexedDBChunkService_defineProperties(e.prototype, r), t && IndexedDBChunkService_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction IndexedDBChunkService_toPropertyKey(t) { var i = IndexedDBChunkService_toPrimitive(t, "string"); return "symbol" == IndexedDBChunkService_typeof(i) ? i : i + ""; }\nfunction IndexedDBChunkService_toPrimitive(t, r) { if ("object" != IndexedDBChunkService_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != IndexedDBChunkService_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nfunction IndexedDBChunkService_callSuper(t, o, e) { return o = IndexedDBChunkService_getPrototypeOf(o), IndexedDBChunkService_possibleConstructorReturn(t, IndexedDBChunkService_isNativeReflectConstruct() ? Reflect.construct(o, e || [], IndexedDBChunkService_getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction IndexedDBChunkService_possibleConstructorReturn(t, e) { if (e && ("object" == IndexedDBChunkService_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return IndexedDBChunkService_assertThisInitialized(t); }\nfunction IndexedDBChunkService_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); return e; }\nfunction IndexedDBChunkService_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (IndexedDBChunkService_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction IndexedDBChunkService_getPrototypeOf(t) { return IndexedDBChunkService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, IndexedDBChunkService_getPrototypeOf(t); }\nfunction IndexedDBChunkService_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && IndexedDBChunkService_setPrototypeOf(t, e); }\nfunction IndexedDBChunkService_setPrototypeOf(t, e) { return IndexedDBChunkService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, IndexedDBChunkService_setPrototypeOf(t, e); }\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//this should be global in project\n// class IndexedDBFacade extends CacheService {\n\n// }\n\n// class ChunkCachedDataService extends ChunkDataService {\n// dataService;\n// }\n\nvar IndexedDBChunkService = /*#__PURE__*/function (_ChunkDataService) {\n function IndexedDBChunkService(req, conf, gudhub) {\n var _this;\n IndexedDBChunkService_classCallCheck(this, IndexedDBChunkService);\n _this = IndexedDBChunkService_callSuper(this, IndexedDBChunkService, [req, conf]);\n _this.dataService = new ChunkHttpService(req);\n\n // let indexDBService = new IndexedDBService(conf);\n\n _this.requestCache = new Map(); // id -> promise ///TODO seems irrelevant to class IndexedDBManager (could be renamed to Facade already)\n\n _this.gudhub = gudhub;\n\n // this.storeManager = new ChunksStoreManager;\n _this.storeManager = new MergedChunksStoreManager();\n\n // this.storeManager = new ChunksStoreManager;\n\n // objectAssignWithOverride(this, indexDBService);\n // objectAssignWithOverride(this, new ChunksStoreManager);\n return _this;\n }\n\n //TODO use IndexedDBFacade here\n // indexDBAccess = new IndexedDBFacade;\n IndexedDBChunkService_inherits(IndexedDBChunkService, _ChunkDataService);\n return IndexedDBChunkService_createClass(IndexedDBChunkService, [{\n key: "getCachedMergedChunk",\n value: function () {\n var _getCachedMergedChunk = IndexedDBChunkService_asyncToGenerator(/*#__PURE__*/IndexedDBChunkService_regeneratorRuntime().mark(function _callee(id, chunkHashesList) {\n var _this2 = this;\n var cachedData, requests, newChunks, mergedData;\n return IndexedDBChunkService_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return this.storeManager.get(id);\n case 3:\n cachedData = _context.sent;\n return _context.abrupt("return", cachedData.mergedData);\n case 7:\n _context.prev = 7;\n _context.t0 = _context["catch"](0);\n // let newHashes = chunkHashesList.filter(c => !cachedData.hashes.includes(c));\n requests = chunkHashesList.map(function (hash) {\n return _this2.dataService.getChunk(id, hash);\n });\n _context.next = 12;\n return Promise.all(requests);\n case 12:\n newChunks = _context.sent;\n _context.next = 15;\n return this.gudhub.util.mergeChunks(newChunks);\n case 15:\n mergedData = _context.sent;\n this.putMergedChunks(id, {\n hashes: chunkHashesList,\n mergedData: {\n items_list: mergedData\n }\n });\n return _context.abrupt("return", {\n items_list: mergedData\n });\n case 18:\n case "end":\n return _context.stop();\n }\n }, _callee, this, [[0, 7]]);\n }));\n function getCachedMergedChunk(_x, _x2) {\n return _getCachedMergedChunk.apply(this, arguments);\n }\n return getCachedMergedChunk;\n }()\n }, {\n key: "isWithCache",\n value: function isWithCache() {\n return true;\n }\n }, {\n key: "getMergedChunkForApp",\n value: function () {\n var _getMergedChunkForApp = IndexedDBChunkService_asyncToGenerator(/*#__PURE__*/IndexedDBChunkService_regeneratorRuntime().mark(function _callee2(id) {\n return IndexedDBChunkService_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n case "end":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function getMergedChunkForApp(_x3) {\n return _getMergedChunkForApp.apply(this, arguments);\n }\n return getMergedChunkForApp;\n }() //here // TODO replace this with getMergedChunkForApp in future\n }, {\n key: "getMergedChunkForIDList",\n value: function () {\n var _getMergedChunkForIDList = IndexedDBChunkService_asyncToGenerator(/*#__PURE__*/IndexedDBChunkService_regeneratorRuntime().mark(function _callee3(id, chunkHashesList) {\n var _this3 = this;\n var isCachedValid, cachedData, _iterator, _step, hash, newChunkHashes, newChunks, requests, mergedData, _requests, _newChunks, _mergedData;\n return IndexedDBChunkService_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.prev = 0;\n isCachedValid = true;\n _context3.next = 4;\n return this.storeManager.get(id);\n case 4:\n cachedData = _context3.sent;\n _context3.prev = 5;\n if (!(chunkHashesList.length < cachedData.hashes.length)) {\n _context3.next = 8;\n break;\n }\n throw new Error();\n case 8:\n _iterator = IndexedDBChunkService_createForOfIteratorHelper(cachedData.hashes);\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n hash = _step.value;\n if (chunkHashesList.indexOf(hash) != cachedData.hashes.indexOf(hash)) isCachedValid = false;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n _context3.next = 15;\n break;\n case 12:\n _context3.prev = 12;\n _context3.t0 = _context3["catch"](5);\n isCachedValid = false;\n case 15:\n if (!isCachedValid) {\n // todo reload all data\n }\n newChunkHashes = [];\n newChunks = [];\n if (chunkHashesList.length > cachedData.hashes.length) {\n newChunkHashes = chunkHashesList.slice(cachedData.hashes.length);\n }\n if (!isCachedValid) {\n newChunkHashes = chunkHashesList;\n }\n if (!(newChunkHashes.length > 0)) {\n _context3.next = 25;\n break;\n }\n requests = newChunkHashes.map(function (hash) {\n return _this3.dataService.getChunk(id, hash);\n });\n _context3.next = 24;\n return Promise.all(requests);\n case 24:\n newChunks = _context3.sent;\n case 25:\n if (isCachedValid) {\n _context3.next = 29;\n break;\n }\n _context3.next = 28;\n return this.gudhub.util.mergeChunks(_toConsumableArray(newChunks));\n case 28:\n mergedData = _context3.sent;\n case 29:\n if (!isCachedValid) {\n _context3.next = 33;\n break;\n }\n _context3.next = 32;\n return this.gudhub.util.mergeChunks([cachedData.mergedData].concat(_toConsumableArray(newChunks)));\n case 32:\n mergedData = _context3.sent;\n case 33:\n if (newChunkHashes.length > 0) {\n this.putMergedChunks(id, {\n hashes: chunkHashesList,\n mergedData: {\n items_list: mergedData\n }\n });\n }\n return _context3.abrupt("return", {\n items_list: mergedData\n });\n case 37:\n _context3.prev = 37;\n _context3.t1 = _context3["catch"](0);\n // let newHashes = chunkHashesList.filter(c => !cachedData.hashes.includes(c));\n _requests = chunkHashesList.map(function (hash) {\n return _this3.dataService.getChunk(id, hash);\n });\n _context3.next = 42;\n return Promise.all(_requests);\n case 42:\n _newChunks = _context3.sent;\n _context3.next = 45;\n return this.gudhub.util.mergeChunks(_newChunks);\n case 45:\n _mergedData = _context3.sent;\n this.putMergedChunks(id, {\n hashes: chunkHashesList,\n mergedData: {\n items_list: _mergedData\n }\n });\n return _context3.abrupt("return", {\n items_list: _mergedData\n });\n case 48:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this, [[0, 37], [5, 12]]);\n }));\n function getMergedChunkForIDList(_x4, _x5) {\n return _getMergedChunkForIDList.apply(this, arguments);\n }\n return getMergedChunkForIDList;\n }() // async function fetchAndMergeArrays(urls) {\n // try {\n // // Create an array of fetch promises\n // const requests = urls.map(url => fetch(url).then(response => response.json()));\n // // Wait for all requests to complete\n // const results = await Promise.all(requests);\n // // Merge all arrays\n // const mergedArray = results.flat(); // or use reduce: results.reduce((acc, arr) => acc.concat(arr), []);\n // return mergedArray;\n // } catch (error) {\n // console.error(\'Error fetching data:\', error);\n // throw error;\n // }\n // }\n // // Example usage:\n // const urls = [\'https://api.example.com/data1\', \'https://api.example.com/data2\'];\n // fetchAndMergeArrays(urls)\n // .then(mergedArray => console.log(mergedArray))\n // .catch(error => console.error(\'Error:\', error));\n //todo also optimize chunks transactions etc\n }, {\n key: "putMergedChunks",\n value: function () {\n var _putMergedChunks = IndexedDBChunkService_asyncToGenerator(/*#__PURE__*/IndexedDBChunkService_regeneratorRuntime().mark(function _callee4(id, data) {\n return IndexedDBChunkService_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt("return", this.storeManager.put(id, data));\n case 1:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function putMergedChunks(_x6, _x7) {\n return _putMergedChunks.apply(this, arguments);\n }\n return putMergedChunks;\n }() // async getMergedChunks(id, data) {\n // return this.storeManager.get(id, data);\n // }\n }, {\n key: "putChunk",\n value: function () {\n var _putChunk = IndexedDBChunkService_asyncToGenerator(/*#__PURE__*/IndexedDBChunkService_regeneratorRuntime().mark(function _callee5(id, data) {\n return IndexedDBChunkService_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n return _context5.abrupt("return", this.storeManager.putChunk(id, data));\n case 1:\n case "end":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function putChunk(_x8, _x9) {\n return _putChunk.apply(this, arguments);\n }\n return putChunk;\n }() // async getApp(id) {\n // if (this.requestCache.has(id)) return this.requestCache.get(id);\n // let self = this;\n // let dataServiceRequest = this.dataService.getApp(id);\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 (\n // !cachedData\n // ) {\n // dataServiceRequest.then(resolve, reject);\n // dataServiceRequest.then(data => self.putApp(id, data));\n // }\n // if (\n // cachedData\n // ) {\n // resolve(cachedData);\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 // 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 // self.requestCache.set(id, pr);\n // return pr;\n // }\n }, {\n key: "getChunk",\n value: function () {\n var _getChunk = IndexedDBChunkService_asyncToGenerator(/*#__PURE__*/IndexedDBChunkService_regeneratorRuntime().mark(function _callee6(app_id, id) {\n var pr, reqPrms, res;\n return IndexedDBChunkService_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n if (!this.requestCache.has(id)) {\n _context6.next = 2;\n break;\n }\n return _context6.abrupt("return", this.requestCache.get(id));\n case 2:\n _context6.prev = 2;\n pr = this.storeManager.getChunk(id); // 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 (\n // !cachedData\n // ) {\n // reject();\n // }\n // if (\n // cachedData\n // ) {\n // resolve(cachedData);\n // }\n // };\n // storeRequest.onerror = reject\n // } catch (error) {\n // reject();\n // }\n // });\n self.requestCache.set(id, pr);\n _context6.next = 7;\n return pr;\n case 7:\n return _context6.abrupt("return", pr);\n case 10:\n _context6.prev = 10;\n _context6.t0 = _context6["catch"](2);\n reqPrms = this.dataService.getChunk(app_id, id);\n this.requestCache.set(id, reqPrms);\n _context6.next = 16;\n return reqPrms;\n case 16:\n res = _context6.sent;\n this.putChunk(id, res);\n // putPrms.then(() => self.gudhub.triggerAppUpdate(id));\n return _context6.abrupt("return", reqPrms);\n case 19:\n case "end":\n return _context6.stop();\n }\n }, _callee6, this, [[2, 10]]);\n }));\n function getChunk(_x10, _x11) {\n return _getChunk.apply(this, arguments);\n }\n return getChunk;\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 key: Symbol.hasInstance,\n value: function value(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 }]);\n}(ChunkDataService);\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/IndexedDBAppService.js\nfunction IndexedDBAppService_callSuper(t, o, e) { return o = IndexedDBAppService_getPrototypeOf(o), IndexedDBAppService_possibleConstructorReturn(t, IndexedDBAppService_isNativeReflectConstruct() ? Reflect.construct(o, e || [], IndexedDBAppService_getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction IndexedDBAppService_possibleConstructorReturn(t, e) { if (e && ("object" == IndexedDBAppService_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return IndexedDBAppService_assertThisInitialized(t); }\nfunction IndexedDBAppService_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); return e; }\nfunction IndexedDBAppService_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (IndexedDBAppService_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction IndexedDBAppService_getPrototypeOf(t) { return IndexedDBAppService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, IndexedDBAppService_getPrototypeOf(t); }\nfunction IndexedDBAppService_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && IndexedDBAppService_setPrototypeOf(t, e); }\nfunction IndexedDBAppService_setPrototypeOf(t, e) { return IndexedDBAppService_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, IndexedDBAppService_setPrototypeOf(t, e); }\nfunction IndexedDBAppService_typeof(o) { "@babel/helpers - typeof"; return IndexedDBAppService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, IndexedDBAppService_typeof(o); }\nfunction IndexedDBAppService_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ IndexedDBAppService_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == IndexedDBAppService_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(IndexedDBAppService_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction IndexedDBAppService_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction IndexedDBAppService_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { IndexedDBAppService_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { IndexedDBAppService_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction IndexedDBAppService_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction IndexedDBAppService_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, IndexedDBAppService_toPropertyKey(o.key), o); } }\nfunction IndexedDBAppService_createClass(e, r, t) { return r && IndexedDBAppService_defineProperties(e.prototype, r), t && IndexedDBAppService_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction IndexedDBAppService_toPropertyKey(t) { var i = IndexedDBAppService_toPrimitive(t, "string"); return "symbol" == IndexedDBAppService_typeof(i) ? i : i + ""; }\nfunction IndexedDBAppService_toPrimitive(t, r) { if ("object" != IndexedDBAppService_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != IndexedDBAppService_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\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\n\n\n\n//this should be global in project\n// class IndexedDBFacade extends CacheService {\n\n// }\nvar IndexedDBManager1 = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {\n function IndexedDBManager1(dbName, storeName) {\n IndexedDBAppService_classCallCheck(this, IndexedDBManager1);\n this.dbName = dbName;\n this.storeName = storeName;\n this.db = null;\n this.queue = [];\n this.isProcessing = false;\n }\n return IndexedDBAppService_createClass(IndexedDBManager1, [{\n key: "openDB",\n value: function () {\n var _openDB = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee() {\n var _this = this;\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!this.db) {\n _context.next = 2;\n break;\n }\n return _context.abrupt("return", this.db);\n case 2:\n return _context.abrupt("return", new Promise(function (resolve, reject) {\n var request = indexedDB.open(_this.dbName, 1);\n request.onupgradeneeded = function (event) {\n var db = event.target.result;\n if (!db.objectStoreNames.contains(_this.storeName)) {\n db.createObjectStore(_this.storeName, {\n keyPath: \'id\',\n autoIncrement: true\n });\n }\n };\n request.onsuccess = function (event) {\n _this.db = event.target.result;\n resolve(_this.db);\n };\n request.onerror = function (event) {\n reject(event.target.error);\n };\n }));\n case 3:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function openDB() {\n return _openDB.apply(this, arguments);\n }\n return openDB;\n }()\n }, {\n key: "executeOperation",\n value: function () {\n var _executeOperation = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee2(operation) {\n var _this2 = this;\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this.openDB();\n case 2:\n return _context2.abrupt("return", new Promise(function (resolve, reject) {\n var transaction = _this2.db.transaction(_this2.storeName, \'readwrite\');\n var store = transaction.objectStore(_this2.storeName);\n transaction.oncomplete = function () {\n return resolve();\n };\n transaction.onerror = function (event) {\n return reject(event.target.error);\n };\n operation(store);\n }));\n case 3:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function executeOperation(_x) {\n return _executeOperation.apply(this, arguments);\n }\n return executeOperation;\n }()\n }, {\n key: "enqueueOperation",\n value: function () {\n var _enqueueOperation = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee3(operation) {\n var currentOperation;\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n this.queue.push(operation);\n if (this.isProcessing) {\n _context3.next = 16;\n break;\n }\n this.isProcessing = true;\n case 3:\n if (!(this.queue.length > 0)) {\n _context3.next = 15;\n break;\n }\n currentOperation = this.queue.shift();\n _context3.prev = 5;\n _context3.next = 8;\n return this.executeOperation(currentOperation);\n case 8:\n _context3.next = 13;\n break;\n case 10:\n _context3.prev = 10;\n _context3.t0 = _context3["catch"](5);\n console.error(\'Operation failed:\', _context3.t0);\n case 13:\n _context3.next = 3;\n break;\n case 15:\n this.isProcessing = false;\n case 16:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this, [[5, 10]]);\n }));\n function enqueueOperation(_x2) {\n return _enqueueOperation.apply(this, arguments);\n }\n return enqueueOperation;\n }()\n }]);\n}()));\nvar IndexedDBManager2 = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {\n function IndexedDBManager2(dbName, storeName) {\n IndexedDBAppService_classCallCheck(this, IndexedDBManager2);\n this.dbName = dbName;\n this.storeName = storeName;\n this.db = null;\n this.queue = [];\n this.isProcessing = false;\n }\n return IndexedDBAppService_createClass(IndexedDBManager2, [{\n key: "openDB",\n value: function () {\n var _openDB2 = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee4() {\n var _this3 = this;\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n if (!this.db) {\n _context4.next = 2;\n break;\n }\n return _context4.abrupt("return", this.db);\n case 2:\n return _context4.abrupt("return", new Promise(function (resolve, reject) {\n var request = indexedDB.open(_this3.dbName, 1);\n request.onupgradeneeded = function (event) {\n var db = event.target.result;\n if (!db.objectStoreNames.contains(_this3.storeName)) {\n db.createObjectStore(_this3.storeName, {\n keyPath: \'id\',\n autoIncrement: true\n });\n }\n };\n request.onsuccess = function (event) {\n _this3.db = event.target.result;\n resolve(_this3.db);\n };\n request.onerror = function (event) {\n reject(event.target.error);\n };\n }));\n case 3:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function openDB() {\n return _openDB2.apply(this, arguments);\n }\n return openDB;\n }()\n }, {\n key: "executeOperation",\n value: function () {\n var _executeOperation2 = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee5(operation) {\n var _this4 = this;\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return this.openDB();\n case 2:\n return _context5.abrupt("return", new Promise(function (resolve, reject) {\n var transaction = _this4.db.transaction(_this4.storeName, \'readwrite\');\n var store = transaction.objectStore(_this4.storeName);\n transaction.oncomplete = function () {\n return resolve();\n };\n transaction.onerror = function (event) {\n return reject(event.target.error);\n };\n operation(store);\n }));\n case 3:\n case "end":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function executeOperation(_x3) {\n return _executeOperation2.apply(this, arguments);\n }\n return executeOperation;\n }()\n }, {\n key: "enqueueOperation",\n value: function () {\n var _enqueueOperation2 = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee6(operation) {\n var currentOperation;\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n this.queue.push(operation);\n if (this.isProcessing) {\n _context6.next = 16;\n break;\n }\n this.isProcessing = true;\n case 3:\n if (!(this.queue.length > 0)) {\n _context6.next = 15;\n break;\n }\n currentOperation = this.queue.shift();\n _context6.prev = 5;\n _context6.next = 8;\n return this.executeOperation(currentOperation);\n case 8:\n _context6.next = 13;\n break;\n case 10:\n _context6.prev = 10;\n _context6.t0 = _context6["catch"](5);\n console.error(\'Operation failed:\', _context6.t0);\n case 13:\n _context6.next = 3;\n break;\n case 15:\n this.isProcessing = false;\n case 16:\n case "end":\n return _context6.stop();\n }\n }, _callee6, this, [[5, 10]]);\n }));\n function enqueueOperation(_x4) {\n return _enqueueOperation2.apply(this, arguments);\n }\n return enqueueOperation;\n }()\n }]);\n}())); //todo андрей сказал чанки два раза грузятся\n//при первой загрузке когда нет бд ничего не отображается\n//андрей предлагает грохать бд если проблемы со сторами\n// может поменять имя на StoreAppService???? потому что я уже сделал абстракцию\nvar IndexedDBAppServiceForWorker = /*#__PURE__*/function (_AppDataService) {\n function IndexedDBAppServiceForWorker(req, conf, gudhub) {\n var _this5;\n IndexedDBAppService_classCallCheck(this, IndexedDBAppServiceForWorker);\n _this5 = IndexedDBAppService_callSuper(this, IndexedDBAppServiceForWorker, [req, conf, gudhub]);\n _this5.dataService = new AppHttpService(req, conf, gudhub);\n\n // let indexDBService = new IndexedDBService(conf);\n // let indexDBAppStoreManager = new AppStoreManager;\n\n _this5.requestCache = new Map(); // id -> promise ///TODO seems irrelevant to class IndexedDBManager (could be renamed to Facade already)\n\n _this5.gudhub = gudhub;\n _this5.chunkDataService = new IndexedDBChunkService(req, chunksMergeConf, gudhub);\n\n // let res = await this.chunkDataService.getMergedChunkForIDList(id, sentData.chunks);\n\n //TODO objectAssignWithOverride here too?\n // this.dbManager = new IndexedDBManager(\'myDatabase\', \'appsStore\');\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 // this.db = null;\n // this.queue = [];\n // this.isProcessing = false;\n\n //todo worker pool?\n\n _this5.storeManager = new AppStoreManager();\n\n // objectAssignWithOverride(this, indexDBService);\n // objectAssignWithOverride(this, new AppStoreManager);\n return _this5;\n }\n IndexedDBAppService_inherits(IndexedDBAppServiceForWorker, _AppDataService);\n return IndexedDBAppService_createClass(IndexedDBAppServiceForWorker, [{\n key: "isWithCache",\n value:\n //TODO use IndexedDBFacade here\n // indexDBAccess = new IndexedDBFacade;\n\n function isWithCache() {\n return false;\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 //TODO для чанков с индексддб будет точно такой код поєтому может вынести его в какое-то место? например в отдельный класс\n\n // async executeOperation(operation) {\n // await this.openDB();\n // return new Promise((resolve, reject) => {\n // const transaction = this.db.transaction(this.storeName, \'readwrite\');\n // const store = transaction.objectStore(this.storeName);\n\n // transaction.oncomplete = () => resolve();\n // transaction.onerror = (event) => reject(event.target.error);\n\n // operation(store);\n // });\n // }\n\n // async enqueueOperation(operation) {\n // this.queue.push(operation);\n\n // if (!this.isProcessing) {\n // this.isProcessing = true;\n // while (this.queue.length > 0) {\n // const currentOperation = this.queue.shift();\n // try {\n // await this.executeOperation(currentOperation);\n // } catch (error) {\n // console.error(\'Operation failed:\', error);\n // }\n // }\n // this.isProcessing = false;\n // }\n // }\n\n // async addData(data) {\n // await this.enqueueOperation((store) => {\n // store.add(data);\n // });\n // }\n\n // async updateData(id, updatedData) {\n // await this.enqueueOperation((store) => {\n // const request = store.get(id);\n // request.onsuccess = () => {\n // const data = request.result;\n // Object.assign(data, updatedData);\n // store.put(data);\n // };\n // });\n // }\n\n // async deleteData(id) {\n // await this.enqueueOperation((store) => {\n // store.delete(id);\n // });\n // }\n }, {\n key: "getAppWithoutProcessing",\n value: function () {\n var _getAppWithoutProcessing = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee7(id) {\n var data;\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _context7.next = 2;\n return this.dataService.getAppWithoutProcessing(id);\n case 2:\n data = _context7.sent;\n _context7.next = 5;\n return this.putApp(id, data);\n case 5:\n return _context7.abrupt("return", data);\n case 6:\n case "end":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function getAppWithoutProcessing(_x5) {\n return _getAppWithoutProcessing.apply(this, arguments);\n }\n return getAppWithoutProcessing;\n }() // this returns data for specific chunks + app request data\n // async getAppWithSpecificChunksList(id, list) {\n // let data = await this.dataService.getAppWithoutProcessing(id);\n // await self.putApp(id, data);\n // let processedData = await self.processRequestedApp(id, data);//here нужно пересмотреть\n // return processedData;\n // }\n }, {\n key: "getApp",\n value: function () {\n var _getApp = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee13(id) {\n var self, data, processedData, pr;\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee13$(_context13) {\n while (1) switch (_context13.prev = _context13.next) {\n case 0:\n // if (this.requestCache.has(id)) return this.requestCache.get(id);\n // return at first time cached app request?????? no seems for worker its ok\n self = this; // let dataServiceRequest = this.dataService.getAppWithoutProcessing(id);\n _context13.next = 3;\n return this.dataService.getAppWithoutProcessing(id);\n case 3:\n data = _context13.sent;\n _context13.next = 6;\n return self.processRequestedApp(id, data);\n case 6:\n processedData = _context13.sent;\n return _context13.abrupt("return", processedData);\n case 10:\n case "end":\n return _context13.stop();\n }\n }, _callee13, this);\n }));\n function getApp(_x6) {\n return _getApp.apply(this, arguments);\n }\n return getApp;\n }()\n }, {\n key: "getCached",\n value: function () {\n var _getCached = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee15(id) {\n var self, pr;\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee15$(_context15) {\n while (1) switch (_context15.prev = _context15.next) {\n case 0:\n return _context15.abrupt("return", this.storeManager.getApp(id));\n case 4:\n case "end":\n return _context15.stop();\n }\n }, _callee15, this);\n }));\n function getCached(_x13) {\n return _getCached.apply(this, arguments);\n }\n return getCached;\n }()\n }, {\n key: "putApp",\n value: function () {\n var _putApp = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee16(id, data) {\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee16$(_context16) {\n while (1) switch (_context16.prev = _context16.next) {\n case 0:\n return _context16.abrupt("return", this.storeManager.putApp(id, data));\n case 1:\n case "end":\n return _context16.stop();\n }\n }, _callee16, this);\n }));\n function putApp(_x16, _x17) {\n return _putApp.apply(this, arguments);\n }\n return putApp;\n }() // duplicated code 2 times in 2 classes openDatabase\n // async openDatabase() {\n // if (this.db) return this.db;\n // return new Promise((resolve, reject) => {\n // const request = indexedDB.open(this.dbName, this.dbVersion);\n // request.onsuccess = event => {\n // this.db = event.target.result;\n // resolve(this.db);\n // };\n // request.onerror = event => {\n // reject(event.target.error);\n // };\n // });\n // }\n }], [{\n key: Symbol.hasInstance,\n value: function value(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}(AppDataService);\nvar IndexedDBAppService = /*#__PURE__*/function (_AppDataService2) {\n function IndexedDBAppService(req, conf, gudhub) {\n var _this6;\n IndexedDBAppService_classCallCheck(this, IndexedDBAppService);\n _this6 = IndexedDBAppService_callSuper(this, IndexedDBAppService, [req, conf, gudhub]);\n _this6.dataService = new AppHttpService(req, conf, gudhub); // TODO isnt used in class. Why?\n\n // let indexDBService = new IndexedDBService(conf);\n\n _this6.requestCache = new Map(); // id -> promise ///TODO seems irrelevant to class IndexedDBManager (could be renamed to Facade already)\n\n _this6.gudhub = gudhub;\n _this6.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 _this6.appRequestAndProcessWorker = new Worker(\'node_modules/@gudhub/core/umd/appRequestWorker.js\');\n // this.appRequestAndProcessWorker = new Worker(\'override_npm/gudhub/umd/appRequestWorker.js\');\n // this.appRequestAndProcessWorker = new AppRequestWorker();\n\n // new Worker(new URL(\'./worker.js\', import.meta.url));\n\n _this6.appRequestAndProcessWorker.postMessage({\n type: \'init\',\n gudhubSerialized: _this6.gudhub.serialized\n });\n var self = _this6;\n _this6.appRequestAndProcessWorker.onerror = function (e) {\n // self.appRequestAndProcessWorker.terminate();\n\n // console.error(\'Error in worker:\', e);\n };\n\n // let self = this;\n\n _this6.appRequestAndProcessWorker.onmessage = function (e) {\n if (e.data.type == \'requestApp\') {\n if (self.resolveFnMap.has(e.data.id)) {\n var resolver = self.resolveFnMap.get(e.data.id);\n resolver(e.data.data);\n }\n\n // self.requestCache.set(id, new Promise);\n }\n\n // todo check this for new code\n // todo outdated code, to remove\n if (e.data.type == \'processData\') {\n // if (id == e.data.id) {\n self.gudhub.itemProcessor.handleDiff(e.data.id, e.data.compareRes);\n if (e.data.viewListChanged || e.data.fieldListChanged) {\n self.gudhub.appProcessor.updateAppFieldsAndViews(e.data.newVersion);\n }\n\n //here\n\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 _this6.storeManager = new AppStoreManager();\n\n // objectAssignWithOverride(this, indexDBService);\n // objectAssignWithOverride(this, new AppStoreManager());\n return _this6;\n }\n IndexedDBAppService_inherits(IndexedDBAppService, _AppDataService2);\n return IndexedDBAppService_createClass(IndexedDBAppService, [{\n key: "isWithCache",\n value:\n //TODO use IndexedDBFacade here\n // indexDBAccess = new IndexedDBFacade;\n\n function isWithCache() {\n return false; //doesnt use indexeddb\n }\n }, {\n key: "getApp",\n value: function () {\n var _getApp2 = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee17(id) {\n var self, hasId, cached, cachedMergedChunk, getFromDBPrms, prms;\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee17$(_context17) {\n while (1) switch (_context17.prev = _context17.next) {\n case 0:\n if (!this.requestCache.has(id)) {\n _context17.next = 2;\n break;\n }\n return _context17.abrupt("return", this.requestCache.get(id));\n case 2:\n // по этому коду есть вопрос - вызовы getApp кешируются выше и тогда выходит возвращается старая версия?\n self = this;\n _context17.next = 5;\n return this.has(id);\n case 5:\n hasId = _context17.sent;\n if (true) {\n _context17.next = 22;\n break;\n }\n _context17.next = 9;\n return this.getCached(id);\n case 9:\n cached = _context17.sent;\n _context17.next = 12;\n return this.chunkDataService.getCachedMergedChunk(id, cached.chunks);\n case 12:\n cachedMergedChunk = _context17.sent;\n _context17.next = 15;\n return this.gudhub.util.mergeChunks([cachedMergedChunk, cached]);\n case 15:\n cached.items_list = _context17.sent;\n getFromDBPrms = Promise.resolve(cached); // let getFromDBPrms = await this.getCached(id); // todo here should be merged with cached mergedChunk\n this.requestCache.set(id, getFromDBPrms);\n this.appRequestAndProcessWorker.postMessage({\n type: \'processData\',\n id: id\n });\n return _context17.abrupt("return", getFromDBPrms);\n case 22:\n // this.requestCache.set(id, new Promise);\n prms = new Promise(function (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 _context17.abrupt("return", prms);\n case 26:\n case "end":\n return _context17.stop();\n }\n }, _callee17, this);\n }));\n function getApp(_x18) {\n return _getApp2.apply(this, arguments);\n }\n return getApp;\n }() //TODO page isnt loaded when indexeddb empty. Investigate getApp in IndexedDBAppService here\n }, {\n key: "getCached",\n value: function () {\n var _getCached2 = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee19(id) {\n var self, pr;\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee19$(_context19) {\n while (1) switch (_context19.prev = _context19.next) {\n case 0:\n return _context19.abrupt("return", this.storeManager.getApp(id));\n case 4:\n case "end":\n return _context19.stop();\n }\n }, _callee19, this);\n }));\n function getCached(_x19) {\n return _getCached2.apply(this, arguments);\n }\n return getCached;\n }()\n }, {\n key: "has",\n value: function () {\n var _has = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee20(id) {\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee20$(_context20) {\n while (1) switch (_context20.prev = _context20.next) {\n case 0:\n _context20.prev = 0;\n return _context20.abrupt("return", this.storeManager.hasApp(id));\n case 4:\n _context20.prev = 4;\n _context20.t0 = _context20["catch"](0);\n debugger;\n case 7:\n case "end":\n return _context20.stop();\n }\n }, _callee20, this, [[0, 4]]);\n }));\n function has(_x22) {\n return _has.apply(this, arguments);\n }\n return has;\n }()\n }, {\n key: "putApp",\n value: function () {\n var _putApp2 = IndexedDBAppService_asyncToGenerator(/*#__PURE__*/IndexedDBAppService_regeneratorRuntime().mark(function _callee21(id, data) {\n return IndexedDBAppService_regeneratorRuntime().wrap(function _callee21$(_context21) {\n while (1) switch (_context21.prev = _context21.next) {\n case 0:\n return _context21.abrupt("return", this.storeManager.putApp(id, data));\n case 1:\n case "end":\n return _context21.stop();\n }\n }, _callee21, this);\n }));\n function putApp(_x23, _x24) {\n return _putApp2.apply(this, arguments);\n }\n return putApp;\n }() //todo openDatabase only once and then preserve it for further usage\n // async openDatabase() {\n // if (this.db) return this.db;\n // return new Promise((resolve, reject) => {\n // const request = indexedDB.open(this.dbName, this.dbVersion);\n // request.onsuccess = event => {\n // this.db = event.target.result;\n // resolve(this.db);\n // };\n // request.onerror = event => {\n // reject(event.target.error);\n // };\n // });\n // }\n }], [{\n key: Symbol.hasInstance,\n value: function value(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}(AppDataService);\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/init.js\n\n\n\n\n\n// //TODO move to indexeddbmanager\n// if (\n// IS_BROWSER\n// ) {\n// const request = indexedDB.open(dbName, dbVersion);\n\n// request.onupgradeneeded = event => {\n// const db = event.target.result;\n\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\n\n//TODO confs should be used only for appropriate classes therefore it doesnt make sense to export them here\n\nvar export_AppDataService;\nvar export_ChunkDataService;\nvar appDataServiceConf;\nvar chunkDataServiceConf;\nif (consts/* IS_BROWSER */.KJ && cache_chunk_requests) {\n export_ChunkDataService = IndexedDBChunkService;\n chunkDataServiceConf = chunkDataConf_chunksConf;\n} else {\n export_ChunkDataService = ChunkHttpService;\n}\nif (consts/* IS_BROWSER */.KJ && cache_app_requests // todo here outdated approach\n) {\n export_AppDataService = IndexedDBAppService; // here will be AppHttpService for browser too, check compatability. Checked. seems different code. IndexedDBAppService uses worker\n appDataServiceConf = appsConf;\n} else {\n export_AppDataService = AppHttpService;\n}\n\n// EXTERNAL MODULE: ./node_modules/axios/index.js\nvar axios = __webpack_require__(2505);\n;// CONCATENATED MODULE: ./GUDHUB/utils.js\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || utils_unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction utils_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return utils_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? utils_arrayLikeToArray(r, a) : void 0; } }\nfunction utils_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction replaceSpecialCharacters(obj) {\n return JSON.stringify(obj).replace(/\\+|&|%/g, function (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() {\n var fieldsToFilter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n return fieldsToFilter.filter(function (field) {\n return field.field_value != null;\n });\n}\nfunction convertObjToUrlParams() {\n var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var entries = Object.entries(obj);\n if (!entries.length) return "";\n return "&".concat(entries.map(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n return "".concat(key, "=").concat(value);\n }).join("&"));\n}\n// EXTERNAL MODULE: ./node_modules/qs/lib/index.js\nvar lib = __webpack_require__(5373);\n;// CONCATENATED MODULE: ./GUDHUB/gudhub-https-service.js\nfunction gudhub_https_service_typeof(o) { "@babel/helpers - typeof"; return gudhub_https_service_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, gudhub_https_service_typeof(o); }\nfunction gudhub_https_service_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ gudhub_https_service_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == gudhub_https_service_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(gudhub_https_service_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction gudhub_https_service_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction gudhub_https_service_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { gudhub_https_service_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { gudhub_https_service_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction gudhub_https_service_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction gudhub_https_service_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, gudhub_https_service_toPropertyKey(o.key), o); } }\nfunction gudhub_https_service_createClass(e, r, t) { return r && gudhub_https_service_defineProperties(e.prototype, r), t && gudhub_https_service_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction gudhub_https_service_toPropertyKey(t) { var i = gudhub_https_service_toPrimitive(t, "string"); return "symbol" == gudhub_https_service_typeof(i) ? i : i + ""; }\nfunction gudhub_https_service_toPrimitive(t, r) { if ("object" != gudhub_https_service_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != gudhub_https_service_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\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\nvar GudHubHttpsService = /*#__PURE__*/function () {\n function GudHubHttpsService(server_url) {\n gudhub_https_service_classCallCheck(this, GudHubHttpsService);\n this.root = server_url;\n this.requestPromises = [];\n }\n\n //****************** INITIALISATION **************//\n // Here we set a function to get token\n return gudhub_https_service_createClass(GudHubHttpsService, [{\n key: "init",\n value: function init(getToken) {\n this.getToken = getToken;\n }\n\n //********************* GET ***********************//\n }, {\n key: "get",\n value: function () {\n var _get = gudhub_https_service_asyncToGenerator(/*#__PURE__*/gudhub_https_service_regeneratorRuntime().mark(function _callee(request) {\n var _this = this;\n var accessToken, hesh, promise;\n return gudhub_https_service_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this.getToken();\n case 2:\n accessToken = _context.sent;\n hesh = this.getHashCode(request);\n if (!this.requestPromises[hesh]) {\n _context.next = 6;\n break;\n }\n return _context.abrupt("return", this.requestPromises[hesh].promise);\n case 6:\n promise = new Promise(function (resolve, reject) {\n var url;\n if (request.externalResource) {\n url = request.url;\n } else {\n url = _this.root + request.url;\n url = "".concat(url).concat(/\\?/.test(url) ? "&" : "?", "token=").concat(accessToken).concat(convertObjToUrlParams(request.params));\n }\n axios.get(url, {\n validateStatus: function validateStatus(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: ".concat(response.status), response);\n }\n // handle success\n resolve(response.data);\n })["catch"](function (err) {\n console.error("GUDHUB HTTP SERVICE: GET ERROR: ".concat(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 _context.abrupt("return", promise);\n case 9:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function get(_x) {\n return _get.apply(this, arguments);\n }\n return get;\n }() //********************* POST ***********************//\n }, {\n key: "post",\n value: function () {\n var _post = gudhub_https_service_asyncToGenerator(/*#__PURE__*/gudhub_https_service_regeneratorRuntime().mark(function _callee2(request) {\n var _this2 = this;\n var hesh, promise;\n return gudhub_https_service_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n hesh = this.getHashCode(request);\n _context2.next = 3;\n return this.getToken();\n case 3:\n request.form["token"] = _context2.sent;\n if (!this.requestPromises[hesh]) {\n _context2.next = 6;\n break;\n }\n return _context2.abrupt("return", this.requestPromises[hesh].promise);\n case 6:\n promise = new Promise(function (resolve, reject) {\n axios.post(_this2.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 validateStatus(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: ".concat(response.status), response);\n }\n // handle success\n resolve(response.data);\n })["catch"](function (error) {\n console.error("GUDHUB HTTP SERVICE: POST ERROR: ".concat(error.response.status, "\\n"), error);\n console.log("Request message: ", request);\n reject(error);\n });\n });\n this.pushPromise(promise, hesh);\n return _context2.abrupt("return", promise);\n case 9:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function post(_x2) {\n return _post.apply(this, arguments);\n }\n return post;\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 key: "axiosRequest",\n value: function axiosRequest(request) {\n var hesh = this.getHashCode(request);\n if (this.requestPromises[hesh]) {\n return this.requestPromises[hesh].promise;\n }\n var method = request.method ? request.method.toLowerCase() : \'get\';\n var url = request.url;\n var headers = request.headers || {};\n if (request.form) {\n headers[\'Content-Type\'] = \'application/x-www-form-urlencoded\';\n }\n var promise = new Promise(/*#__PURE__*/function () {\n var _ref = gudhub_https_service_asyncToGenerator(/*#__PURE__*/gudhub_https_service_regeneratorRuntime().mark(function _callee3(resolve, reject) {\n var _yield$axios$method, data;\n return gudhub_https_service_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.prev = 0;\n _context3.next = 3;\n return axios[method](url, method === \'post\' ? lib.stringify(request.form) || request.body : {\n headers: headers\n }, method === \'post\' ? {\n headers: headers\n } : {});\n case 3:\n _yield$axios$method = _context3.sent;\n data = _yield$axios$method.data;\n resolve(data);\n _context3.next = 13;\n break;\n case 8:\n _context3.prev = 8;\n _context3.t0 = _context3["catch"](0);\n console.log("ERROR -> GUDHUB HTTP SERVICE -> SIMPLE POST :", _context3.t0.message);\n console.log("Request message: ", request);\n reject(_context3.t0);\n case 13:\n case "end":\n return _context3.stop();\n }\n }, _callee3, null, [[0, 8]]);\n }));\n return function (_x3, _x4) {\n return _ref.apply(this, arguments);\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 key: "pushPromise",\n value: function pushPromise(promise, hesh) {\n var _this3 = this;\n this.requestPromises[hesh] = {\n promise: promise,\n hesh: hesh,\n callback: promise.then(function () {\n _this3.destroyPromise(hesh);\n })["catch"](function (err) {\n _this3.destroyPromise(hesh);\n })\n };\n }\n\n /*************** DELETE PROMISE ***************/\n // It deletes promise from this.requestPromises by hash after promise resolve\n }, {\n key: "destroyPromise",\n value: function destroyPromise(hesh) {\n this.requestPromises = this.requestPromises.filter(function (request) {\n return request.hesh !== hesh;\n });\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 }, {\n key: "getHashCode",\n value: function getHashCode(request) {\n var hash = 0;\n var str = lib.stringify(request);\n if (str.length == 0) return hash;\n for (var i = 0; i < str.length; i++) {\n var _char = str.charCodeAt(i);\n hash = (hash << 5) - hash + _char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return "h" + hash;\n }\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/PipeService/utils.js\nfunction utils_typeof(o) { "@babel/helpers - typeof"; return utils_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, utils_typeof(o); }\nfunction createId(obj) {\n var stringId = "";\n for (var 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 || utils_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\nfunction PipeService_typeof(o) { "@babel/helpers - typeof"; return PipeService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, PipeService_typeof(o); }\nfunction PipeService_toConsumableArray(r) { return PipeService_arrayWithoutHoles(r) || PipeService_iterableToArray(r) || PipeService_unsupportedIterableToArray(r) || PipeService_nonIterableSpread(); }\nfunction PipeService_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction PipeService_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return PipeService_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? PipeService_arrayLikeToArray(r, a) : void 0; } }\nfunction PipeService_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }\nfunction PipeService_arrayWithoutHoles(r) { if (Array.isArray(r)) return PipeService_arrayLikeToArray(r); }\nfunction PipeService_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction PipeService_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction PipeService_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, PipeService_toPropertyKey(o.key), o); } }\nfunction PipeService_createClass(e, r, t) { return r && PipeService_defineProperties(e.prototype, r), t && PipeService_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction PipeService_toPropertyKey(t) { var i = PipeService_toPrimitive(t, "string"); return "symbol" == PipeService_typeof(i) ? i : i + ""; }\nfunction PipeService_toPrimitive(t, r) { if ("object" != PipeService_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != PipeService_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\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\nvar PipeService = /*#__PURE__*/function () {\n function PipeService() {\n PipeService_classCallCheck(this, PipeService);\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 return PipeService_createClass(PipeService, [{\n key: "on",\n value: function on(types, destination, fn) {\n var _this = this;\n if (checkParams(types, destination, fn)) {\n types.split(" ").map(function (type) {\n return type + ":" + createId(destination);\n }).forEach(function (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 key: "emit",\n value: function emit(types, destination, value, params) {\n var _this2 = this;\n types.split(" ").forEach(function (type) {\n var listenerName = type + ":" + createId(destination);\n var toBeRemovedState = false;\n if (_this2.subscribers[listenerName]) {\n // if subscribers list is empty we put message to messageBox\n if (_this2.subscribers[listenerName].size == 0) {\n _this2.messageBox[listenerName] = [types, destination, value, params, toBeRemovedState];\n return _this2;\n }\n\n // sending messege to subscribers\n _this2.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 _this2.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 key: "onRoot",\n value: function 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 key: "destroy",\n value: function destroy(types, destination, func) {\n var _this3 = this;\n types.split(" ").forEach(function (type) {\n var listenerName = type + ":" + createId(destination);\n\n //if we pass a function then we remove just function in subscriber property\n if (_this3.subscribers[listenerName] && func) {\n _this3.subscribers[listenerName]["delete"](func);\n }\n\n //if we are not passing a function then we remove a subscriber property\n if (_this3.subscribers[listenerName] && !func) {\n delete _this3.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 key: "checkMessageBox",\n value: function checkMessageBox(listenerName) {\n var _this4 = this;\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(function () {\n if (_this4.messageBox[listenerName]) {\n _this4.emit.apply(_this4, PipeService_toConsumableArray(_this4.messageBox[listenerName]));\n\n //we mark message after it was readed as "to be removed" to remove it in next itration \n _this4.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 }, {\n key: "cleanMesssageBox",\n value: function cleanMesssageBox() {\n for (var listenerName in this.messageBox) {\n if (this.messageBox[listenerName][4]) {\n delete this.messageBox[listenerName];\n }\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?t=1\',\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=3",\n css: "https://gudhub.com/modules/text-area-ghe/dist/style.css",\n type: "gh_element",\n technology: "class"\n }, {\n data_type: "resource_calendar",\n name: "Resource Сalendar",\n icon: "calendar",\n url: file_server_url + \'/\' + async_modules_path + "resource_calendar_data.js",\n type: \'gh_element\',\n technology: \'angular\'\n }, {\n data_type: "visualizer_with_control_panel",\n name: "Visualizer With Control Panel",\n icon: \'visualizer\',\n url: file_server_url + \'/\' + async_modules_path + "visualizer_with_control_panel_data.js",\n type: \'gh_element\',\n technology: \'angular\'\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\nfunction Storage_typeof(o) { "@babel/helpers - typeof"; return Storage_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, Storage_typeof(o); }\nfunction Storage_toConsumableArray(r) { return Storage_arrayWithoutHoles(r) || Storage_iterableToArray(r) || Storage_unsupportedIterableToArray(r) || Storage_nonIterableSpread(); }\nfunction Storage_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction Storage_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return Storage_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Storage_arrayLikeToArray(r, a) : void 0; } }\nfunction Storage_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }\nfunction Storage_arrayWithoutHoles(r) { if (Array.isArray(r)) return Storage_arrayLikeToArray(r); }\nfunction Storage_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction Storage_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ Storage_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == Storage_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(Storage_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction Storage_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction Storage_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { Storage_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { Storage_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = Storage_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction Storage_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction Storage_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, Storage_toPropertyKey(o.key), o); } }\nfunction Storage_createClass(e, r, t) { return r && Storage_defineProperties(e.prototype, r), t && Storage_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction Storage_toPropertyKey(t) { var i = Storage_toPrimitive(t, "string"); return "symbol" == Storage_typeof(i) ? i : i + ""; }\nfunction Storage_toPrimitive(t, r) { if ("object" != Storage_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != Storage_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\n\nvar Storage = /*#__PURE__*/function () {\n function Storage(async_modules_path, file_server_url, automation_modules_path) {\n Storage_classCallCheck(this, Storage);\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 return Storage_createClass(Storage, [{\n key: "getMainStorage",\n value: function getMainStorage() {\n return this;\n }\n }, {\n key: "getAppsList",\n value: function getAppsList() {\n return this.apps_list;\n }\n }, {\n key: "getUser",\n value: function getUser() {\n return this.user;\n }\n }, {\n key: "getUsersList",\n value: function getUsersList() {\n return this.users_list;\n }\n }, {\n key: "getModulesList",\n value: function getModulesList(type, isPrivate, createdFor) {\n if (typeof type === \'undefined\') {\n return this.modulesList;\n } else if (isPrivate == false) {\n return this.modulesList.filter(function (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(function (module) {\n return module.type === type;\n });\n }\n }\n }, {\n key: "getModuleUrl",\n value: function getModuleUrl(module_id) {\n return this.modulesList.find(function (module) {\n return module.data_type == module_id;\n });\n }\n\n //!!!!!!!!!!!!!!******** All Methods below should be moved to AppProcesor and Auth **********!!!!!!!!!!!!!!!!//\n }, {\n key: "setUser",\n value: function setUser(user) {\n this.user = user;\n this.users_list.push(user);\n }\n }, {\n key: "updateUser",\n value: function updateUser() {\n var user = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\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 = _objectSpread(_objectSpread({}, this.user), user);\n this.users_list = this.users_list.filter(function (oldUser) {\n return oldUser.user_id != user.user_id;\n });\n this.users_list.push(this.user);\n }\n }, {\n key: "unsetUser",\n value: function unsetUser() {\n this.user = {};\n }\n }, {\n key: "getApp",\n value: function getApp(app_id) {\n for (var 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 }, {\n key: "unsetApps",\n value: function unsetApps() {\n this.apps_list = [];\n }\n\n // addApp(app) {\n // this.apps_list.push(app);\n // return this.apps_list;\n // }\n }, {\n key: "updateApp",\n value: function updateApp(newApp) {\n this.apps_list = this.apps_list.map(function (app) {\n return app.app_id == newApp.app_id ? newApp : app;\n });\n return this.apps_list;\n }\n }, {\n key: "deleteApp",\n value: function deleteApp(app_id) {\n this.apps_list = this.apps_list.filter(function (app) {\n return app.app_id != app_id;\n });\n return this.apps_list;\n }\n }, {\n key: "updateItemsInApp",\n value: function () {\n var _updateItemsInApp = Storage_asyncToGenerator(/*#__PURE__*/Storage_regeneratorRuntime().mark(function _callee(itemsToUpdate, app_id) {\n var appToUpdate;\n return Storage_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this.getApp(app_id);\n case 2:\n appToUpdate = _context.sent;\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 _context.abrupt("return", appToUpdate);\n case 5:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function updateItemsInApp(_x, _x2) {\n return _updateItemsInApp.apply(this, arguments);\n }\n return updateItemsInApp;\n }()\n }, {\n key: "addItemsToApp",\n value: function () {\n var _addItemsToApp = Storage_asyncToGenerator(/*#__PURE__*/Storage_regeneratorRuntime().mark(function _callee2(items, app_id) {\n var appToUpdate, _appToUpdate$items_li;\n return Storage_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this.getApp(app_id);\n case 2:\n appToUpdate = _context2.sent;\n if (appToUpdate) {\n (_appToUpdate$items_li = appToUpdate.items_list).push.apply(_appToUpdate$items_li, Storage_toConsumableArray(items));\n this.updateApp(appToUpdate);\n this.pipeService.emit("gh_items_update", {\n app_id: app_id\n }, items);\n }\n return _context2.abrupt("return", appToUpdate);\n case 5:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function addItemsToApp(_x3, _x4) {\n return _addItemsToApp.apply(this, arguments);\n }\n return addItemsToApp;\n }()\n }, {\n key: "deleteItemsInApp",\n value: function () {\n var _deleteItemsInApp = Storage_asyncToGenerator(/*#__PURE__*/Storage_regeneratorRuntime().mark(function _callee3(itemsToDelete, app_id) {\n var appToUpdate;\n return Storage_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return this.getApp(app_id);\n case 2:\n appToUpdate = _context3.sent;\n if (appToUpdate) {\n appToUpdate.items_list = appToUpdate.items_list.filter(function (item) {\n return !itemsToDelete.find(function (itemToDelete) {\n return itemToDelete.item_id == item.item_id;\n });\n });\n this.updateApp(appToUpdate);\n }\n return _context3.abrupt("return", appToUpdate);\n case 5:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function deleteItemsInApp(_x5, _x6) {\n return _deleteItemsInApp.apply(this, arguments);\n }\n return deleteItemsInApp;\n }()\n }]);\n}();\n// EXTERNAL MODULE: ./node_modules/ws/browser.js\nvar browser = __webpack_require__(1591);\n;// CONCATENATED MODULE: ./GUDHUB/WebSocket/WebSocket.js\nfunction WebSocket_typeof(o) { "@babel/helpers - typeof"; return WebSocket_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, WebSocket_typeof(o); }\nfunction WebSocket_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ WebSocket_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == WebSocket_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(WebSocket_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction WebSocket_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction WebSocket_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { WebSocket_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { WebSocket_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction WebSocket_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction WebSocket_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, WebSocket_toPropertyKey(o.key), o); } }\nfunction WebSocket_createClass(e, r, t) { return r && WebSocket_defineProperties(e.prototype, r), t && WebSocket_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction WebSocket_toPropertyKey(t) { var i = WebSocket_toPrimitive(t, "string"); return "symbol" == WebSocket_typeof(i) ? i : i + ""; }\nfunction WebSocket_toPrimitive(t, r) { if ("object" != WebSocket_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != WebSocket_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\n\n\nvar WebSocketApi = /*#__PURE__*/function () {\n function WebSocketApi(url, auth) {\n WebSocket_classCallCheck(this, WebSocketApi);\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 = consts/* IS_BROWSER */.KJ;\n }\n return WebSocket_createClass(WebSocketApi, [{\n key: "addSubscription",\n value: function () {\n var _addSubscription = WebSocket_asyncToGenerator(/*#__PURE__*/WebSocket_regeneratorRuntime().mark(function _callee(app_id) {\n var token, subscription;\n return WebSocket_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this.auth.getToken();\n case 2:\n token = _context.sent;\n subscription = "token=".concat(token, "/~/app_id=").concat(app_id);\n if (this.connected) {\n this.websocket.send(subscription);\n }\n this.queue.push(app_id);\n case 6:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function addSubscription(_x) {\n return _addSubscription.apply(this, arguments);\n }\n return addSubscription;\n }()\n }, {\n key: "onOpen",\n value: function () {\n var _onOpen = WebSocket_asyncToGenerator(/*#__PURE__*/WebSocket_regeneratorRuntime().mark(function _callee2() {\n var _this = this;\n var token;\n return WebSocket_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n this.reload = true;\n console.log("websocket opened");\n this.connected = true;\n _context2.next = 5;\n return this.auth.getToken();\n case 5:\n token = _context2.sent;\n this.queue.forEach(function (queue) {\n var subscription = "token=".concat(token, "/~/app_id=").concat(queue);\n _this.websocket.send(subscription);\n });\n case 7:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function onOpen() {\n return _onOpen.apply(this, arguments);\n }\n return onOpen;\n }()\n }, {\n key: "onError",\n value: function onError(error) {\n console.log("websocket error: ", error);\n this.websocket.close();\n }\n }, {\n key: "onClose",\n value: function 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 }, {\n key: "onMessage",\n value: function () {\n var _onMessage = WebSocket_asyncToGenerator(/*#__PURE__*/WebSocket_regeneratorRuntime().mark(function _callee3(event) {\n var message, hartBeatDelay, incomeMessage, token;\n return WebSocket_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n message = this.isBrowser ? event.data : event;\n if (!message.match(/HeartBeat/)) {\n _context3.next = 10;\n break;\n }\n hartBeatDelay = new Date().getTime() - this.heartBeatTimeStemp;\n if (!(this.ALLOWED_HEART_BEAT_DELEY < hartBeatDelay)) {\n _context3.next = 8;\n break;\n }\n _context3.next = 6;\n return this.onConnectionLost();\n case 6:\n _context3.next = 10;\n break;\n case 8:\n this.websocket.send("HeartBeat");\n this.heartBeatTimeStemp = new Date().getTime();\n case 10:\n if (this.firstHeartBeat) {\n this.connectionChecker();\n this.firstHeartBeat = false;\n }\n if (!message.match(/[{}]/)) {\n _context3.next = 17;\n break;\n }\n incomeMessage = JSON.parse(message);\n _context3.next = 15;\n return this.auth.getToken();\n case 15:\n token = _context3.sent;\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 case 17:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function onMessage(_x2) {\n return _onMessage.apply(this, arguments);\n }\n return onMessage;\n }()\n }, {\n key: "initWebSocket",\n value: function 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 }, {\n key: "connectionChecker",\n value: function connectionChecker() {\n var _this2 = this;\n setInterval(/*#__PURE__*/WebSocket_asyncToGenerator(/*#__PURE__*/WebSocket_regeneratorRuntime().mark(function _callee4() {\n var hartBeatDelay;\n return WebSocket_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n hartBeatDelay = new Date().getTime() - _this2.heartBeatTimeStemp; // console.log(hartBeatDelay, this.ALLOWED_HEART_BEAT_DELEY, "interval");\n if (!(_this2.ALLOWED_HEART_BEAT_DELEY < hartBeatDelay)) {\n _context4.next = 4;\n break;\n }\n _context4.next = 4;\n return _this2.onConnectionLost();\n case 4:\n case "end":\n return _context4.stop();\n }\n }, _callee4);\n })), 1000);\n }\n }, {\n key: "onConnectionLost",\n value: function () {\n var _onConnectionLost = WebSocket_asyncToGenerator(/*#__PURE__*/WebSocket_regeneratorRuntime().mark(function _callee5() {\n return WebSocket_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.prev = 0;\n _context5.next = 3;\n return this.auth.getVersion();\n case 3:\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 _context5.next = 9;\n break;\n case 6:\n _context5.prev = 6;\n _context5.t0 = _context5["catch"](0);\n console.log(_context5.t0);\n case 9:\n case "end":\n return _context5.stop();\n }\n }, _callee5, this, [[0, 6]]);\n }));\n function onConnectionLost() {\n return _onConnectionLost.apply(this, arguments);\n }\n return onConnectionLost;\n }()\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/filterPreparation.js\nfunction filterPreparation_typeof(o) { "@babel/helpers - typeof"; return filterPreparation_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, filterPreparation_typeof(o); }\nfunction filterPreparation_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ filterPreparation_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == filterPreparation_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(filterPreparation_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction filterPreparation_toConsumableArray(r) { return filterPreparation_arrayWithoutHoles(r) || filterPreparation_iterableToArray(r) || filterPreparation_unsupportedIterableToArray(r) || filterPreparation_nonIterableSpread(); }\nfunction filterPreparation_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction filterPreparation_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }\nfunction filterPreparation_arrayWithoutHoles(r) { if (Array.isArray(r)) return filterPreparation_arrayLikeToArray(r); }\nfunction filterPreparation_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = filterPreparation_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }\nfunction filterPreparation_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return filterPreparation_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? filterPreparation_arrayLikeToArray(r, a) : void 0; } }\nfunction filterPreparation_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction filterPreparation_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction filterPreparation_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { filterPreparation_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { filterPreparation_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction filterPreparation(_x, _x2, _x3) {\n return _filterPreparation.apply(this, arguments);\n}\nfunction _filterPreparation() {\n _filterPreparation = filterPreparation_asyncToGenerator(/*#__PURE__*/filterPreparation_regeneratorRuntime().mark(function _callee(filters_list, storage, pipeService) {\n var variables,\n filterArray,\n objectMethod,\n _iterator,\n _step,\n filter,\n _iterator2,\n _step2,\n filterValue,\n functionName,\n func,\n _filter$valuesArray,\n _filter$valuesArray2,\n field_value,\n fieldMethod,\n _args = arguments;\n return filterPreparation_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n fieldMethod = function _fieldMethod(address) {\n return new Promise(function (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 variables = _args.length > 3 && _args[3] !== undefined ? _args[3] : {};\n filterArray = [];\n objectMethod = {\n variableMethodcurrent_app: function variableMethodcurrent_app() {\n return [variables.current_app_id || variables.app_id];\n },\n variableMethodelement_app: function variableMethodelement_app() {\n return [variables.element_app_id];\n },\n variableMethodcurrent_item: function variableMethodcurrent_item() {\n var currentValue = "".concat(variables.current_app_id || variables.app_id, ".").concat(variables.item_id);\n return [currentValue];\n },\n variableMethoduser_id: function variableMethoduser_id() {\n var storage_user = storage.getUser();\n return [storage_user.user_id];\n },\n variableMethoduser_email: function variableMethoduser_email(filter) {\n var storage_user = storage.getUser();\n return [storage_user.username];\n },\n variableMethodtoday: function variableMethodtoday(filter) {\n var date = new Date();\n var start_date = new Date(date.getFullYear(), date.getMonth(), date.getDate());\n var end_date = new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1);\n var result = start_date.valueOf().toString() + ":" + end_date.valueOf().toString();\n return [result];\n },\n variableMethodvariable: function variableMethodvariable(property) {\n return [variables[property]];\n }\n };\n if (!filters_list) {\n _context.next = 40;\n break;\n }\n _iterator = filterPreparation_createForOfIteratorHelper(filters_list);\n _context.prev = 6;\n _iterator.s();\n case 8:\n if ((_step = _iterator.n()).done) {\n _context.next = 32;\n break;\n }\n filter = _step.value;\n if (!filter) {\n _context.next = 29;\n break;\n }\n _context.t0 = filter.input_type;\n _context.next = _context.t0 === "variable" ? 14 : _context.t0 === "field" ? 19 : 25;\n break;\n case 14:\n filter.valuesArray = [];\n _iterator2 = filterPreparation_createForOfIteratorHelper(filter === null || filter === void 0 ? void 0 : filter.input_value.split(\',\'));\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n filterValue = _step2.value;\n functionName = filter.input_type + "Method" + filterValue;\n func = objectMethod[functionName];\n if (typeof func === "function") {\n if (!filter.valuesArray) {\n filter.valuesArray = func();\n } else {\n (_filter$valuesArray = filter.valuesArray).push.apply(_filter$valuesArray, filterPreparation_toConsumableArray(func()));\n }\n } else {\n if (!filter.valuesArray) {\n filter.valuesArray = objectMethod.variableMethodvariable(filterValue);\n } else {\n (_filter$valuesArray2 = filter.valuesArray).push.apply(_filter$valuesArray2, filterPreparation_toConsumableArray(objectMethod.variableMethodvariable(filterValue)));\n }\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n filterArray.push(filter);\n return _context.abrupt("break", 27);\n case 19:\n _context.next = 21;\n return 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 case 21:\n field_value = _context.sent;\n if (field_value != null) {\n filter.valuesArray.push(field_value);\n }\n filterArray.push(filter);\n return _context.abrupt("break", 27);\n case 25:\n filterArray.push(filter);\n return _context.abrupt("break", 27);\n case 27:\n _context.next = 30;\n break;\n case 29:\n filterArray.push(filter);\n case 30:\n _context.next = 8;\n break;\n case 32:\n _context.next = 37;\n break;\n case 34:\n _context.prev = 34;\n _context.t1 = _context["catch"](6);\n _iterator.e(_context.t1);\n case 37:\n _context.prev = 37;\n _iterator.f();\n return _context.finish(37);\n case 40:\n return _context.abrupt("return", filterArray);\n case 41:\n case "end":\n return _context.stop();\n }\n }, _callee, null, [[6, 34, 37, 40]]);\n }));\n return _filterPreparation.apply(this, arguments);\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\nfunction utils_slicedToArray(r, e) { return utils_arrayWithHoles(r) || utils_iterableToArrayLimit(r, e) || filter_utils_unsupportedIterableToArray(r, e) || utils_nonIterableRest(); }\nfunction utils_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction filter_utils_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return filter_utils_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? filter_utils_arrayLikeToArray(r, a) : void 0; } }\nfunction filter_utils_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction utils_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction utils_arrayWithHoles(r) { if (Array.isArray(r)) return r; }\n\nfunction getDistanceFromLatLonInKm(coordsFrom, coordsTo) {\n var _coordsFrom$split = coordsFrom.split(\':\'),\n _coordsFrom$split2 = utils_slicedToArray(_coordsFrom$split, 3),\n lat1 = _coordsFrom$split2[0],\n lon1 = _coordsFrom$split2[1],\n distance = _coordsFrom$split2[2];\n var _coordsTo$split = coordsTo.split(\':\'),\n _coordsTo$split2 = utils_slicedToArray(_coordsTo$split, 2),\n lat2 = _coordsTo$split2[0],\n lon2 = _coordsTo$split2[1];\n var R = 6371; // Radius of the earth in km\n var dLat = deg2rad(lat2 - lat1); // deg2rad below\n var dLon = deg2rad(lon2 - lon1);\n var 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 var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var 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 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n type = _ref.type,\n _ref$date = _ref.date,\n date = _ref$date === void 0 ? 0 : _ref$date,\n _ref$match = _ref.match,\n match = _ref$match === void 0 ? true : _ref$match;\n var itemTime = arguments.length > 1 ? arguments[1] : undefined;\n if (!itemTime && type) return false;\n var newDate = new Date();\n var result = true;\n switch (type) {\n case "day":\n var filterDayStart = getDateInMs(date);\n var filterDayEnd = getDateInMs(date + 1);\n result = filterDayStart <= itemTime && itemTime < filterDayEnd;\n break;\n case "days":\n if (date < 0) {\n var currentDayEnd = getDateInMs(1);\n var startPast7Days = getDateInMs(-6);\n result = startPast7Days <= itemTime && itemTime < currentDayEnd;\n } else {\n var currentDay = getDateInMs();\n var 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 var weekStart = newDate.getDate() - newDate.getDay();\n var daysToEnd = date == -2 ? 13 : 6;\n var weekEnd = weekStart + daysToEnd;\n var weekDayStart = newDate.setDate(weekStart + date * 7);\n var currentDate = new Date();\n var weekDayEnd = currentDate.setDate(weekEnd + date * 7);\n var _getWeek = getWeek(weekDayStart, weekDayEnd),\n _getWeek2 = utils_slicedToArray(_getWeek, 2),\n sunday = _getWeek2[0],\n saturday = _getWeek2[1];\n result = sunday <= itemTime && itemTime <= saturday;\n break;\n case "month":\n if (newDate.getFullYear() !== new Date(itemTime).getFullYear()) return false;\n var month = newDate.getMonth() + date;\n result = month === new Date(itemTime).getMonth();\n break;\n case "year":\n var 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() {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var 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(function (item) {\n return item.fields.find(function (field) {\n return field.index_value && field.index_value.toLowerCase().indexOf(filter.toLowerCase()) !== -1;\n });\n });\n }\n return items;\n}\nvar 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\nfunction filter_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = filter_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }\nfunction filter_slicedToArray(r, e) { return filter_arrayWithHoles(r) || filter_iterableToArrayLimit(r, e) || filter_unsupportedIterableToArray(r, e) || filter_nonIterableRest(); }\nfunction filter_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction filter_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return filter_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? filter_arrayLikeToArray(r, a) : void 0; } }\nfunction filter_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction filter_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction filter_arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction filter_callSuper(t, o, e) { return o = filter_getPrototypeOf(o), filter_possibleConstructorReturn(t, filter_isNativeReflectConstruct() ? Reflect.construct(o, e || [], filter_getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction filter_possibleConstructorReturn(t, e) { if (e && ("object" == filter_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return filter_assertThisInitialized(t); }\nfunction filter_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); return e; }\nfunction filter_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (filter_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction filter_getPrototypeOf(t) { return filter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, filter_getPrototypeOf(t); }\nfunction filter_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && filter_setPrototypeOf(t, e); }\nfunction filter_setPrototypeOf(t, e) { return filter_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, filter_setPrototypeOf(t, e); }\nfunction filter_typeof(o) { "@babel/helpers - typeof"; return filter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, filter_typeof(o); }\nfunction filter_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction filter_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, filter_toPropertyKey(o.key), o); } }\nfunction filter_createClass(e, r, t) { return r && filter_defineProperties(e.prototype, r), t && filter_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction filter_toPropertyKey(t) { var i = filter_toPrimitive(t, "string"); return "symbol" == filter_typeof(i) ? i : i + ""; }\nfunction filter_toPrimitive(t, r) { if ("object" != filter_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != filter_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\n\n/* harmony default export */ function filter_filter(items, filters) {\n var itemsFilter = new ItemsFilter();\n if (!items || !items.length) {\n return [];\n }\n return itemsFilter.filter(filters, items);\n}\nvar Checker = /*#__PURE__*/function () {\n function Checker() {\n filter_classCallCheck(this, Checker);\n }\n return filter_createClass(Checker, [{\n key: "changeBehavior",\n value: function changeBehavior(checkOption) {\n switch (checkOption) {\n case "contain_or":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(function (_filter) {\n return data.some(function (_dataItem) {\n return _dataItem.indexOf(_filter) !== -1;\n });\n });\n };\n break;\n case "contain_and":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.every(function (_filter) {\n return data.some(function (_dataItem) {\n return _dataItem.indexOf(_filter) !== -1;\n });\n });\n };\n break;\n case "not_contain_or":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(function (_filter) {\n return data.every(function (_dataItem) {\n return _dataItem.indexOf(_filter) === -1;\n });\n });\n };\n break;\n case "not_contain_and":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.every(function (_filter) {\n return data.every(function (_dataItem) {\n return _dataItem.indexOf(_filter) === -1;\n });\n });\n };\n break;\n case "equal_or":\n this._checkFn = function (data, filtersValues) {\n if (!data.length) return false;\n return data.some(function (_dataItem) {\n return filtersValues.some(function (_filter) {\n return _dataItem == _filter;\n });\n });\n };\n break;\n case "equal_and":\n this._checkFn = function (data, filtersValues) {\n if (!data.length) return false;\n var filtersValuesSet = new Set(filtersValues);\n while (data.length && filtersValuesSet.size) {\n var 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 var filtersValuesSet = new Set(filtersValues);\n while (data.length && filtersValuesSet.size) {\n var 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 var filtersValuesSet = new Set(filtersValues);\n while (data.length && filtersValuesSet.size) {\n var 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(function (_filter) {\n return data.every(function (_dataItem) {\n return _dataItem > _filter;\n });\n });\n };\n break;\n case "lower":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(function (_filter) {\n return data.every(function (_dataItem) {\n return _dataItem < _filter;\n });\n });\n };\n break;\n case "range":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(function (_filter) {\n return data.every(function (_dataItem) {\n return _filter.start <= _dataItem && _dataItem < _filter.end;\n });\n });\n };\n break;\n case "value":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(function (_filter) {\n return data.some(function (_dataItem) {\n return _dataItem == _filter;\n });\n });\n };\n break;\n case \'search\':\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(function (_filter) {\n return isSimilarStrings(_filter, data);\n });\n };\n break;\n case "phone_equal_or":\n this._checkFn = function (data, filtersValues) {\n if (!data.length) return false;\n return filtersValues.some(function (_filter) {\n return data.some(function (_dataItem) {\n return _dataItem.replace(/[^0-9]/g, "").indexOf(_filter.replace(/[^0-9]/g, "")) !== -1;\n });\n });\n };\n break;\n case \'distance\':\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(function (_filter) {\n return data.some(function (_dataItem) {\n return getDistanceFromLatLonInKm(_filter, _dataItem);\n });\n });\n };\n break;\n case "date_in":\n case "date_out":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(function (_filter) {\n return data.some(function (_dataItem) {\n return getDate(_filter, _dataItem);\n });\n });\n };\n break;\n case "recurring_date":\n this._checkFn = function (data, filtersValues) {\n return filtersValues.some(function (_filter) {\n return data.some(function (_dataItem) {\n return gudhub.checkRecurringDate(_dataItem, _filter);\n });\n });\n };\n break;\n }\n return this;\n }\n }, {\n key: "check",\n value: function check(aggregate) {\n return this.changeBehavior(aggregate.getCheckOption())._checkFn(aggregate.getEntity(), aggregate.getFilterValues());\n }\n }]);\n}();\nvar NumberFetchStrategy = /*#__PURE__*/function () {\n function NumberFetchStrategy() {\n filter_classCallCheck(this, NumberFetchStrategy);\n }\n return filter_createClass(NumberFetchStrategy, [{\n key: "convert",\n value: function convert(val) {\n return [Number(val)];\n }\n }, {\n key: "convertFilterValue",\n value: function convertFilterValue(val) {\n return Number(val);\n }\n }]);\n}();\nvar RangeFetchStrategy = /*#__PURE__*/function (_NumberFetchStrategy) {\n function RangeFetchStrategy() {\n filter_classCallCheck(this, RangeFetchStrategy);\n return filter_callSuper(this, RangeFetchStrategy, arguments);\n }\n filter_inherits(RangeFetchStrategy, _NumberFetchStrategy);\n return filter_createClass(RangeFetchStrategy, [{\n key: "convertFilterValue",\n value: function convertFilterValue(val) {\n return {\n start: Number(val.split(":")[0]),\n end: Number(val.split(":")[1])\n };\n }\n }]);\n}(NumberFetchStrategy);\nvar StringFetchStrategy = /*#__PURE__*/function () {\n function StringFetchStrategy() {\n filter_classCallCheck(this, StringFetchStrategy);\n }\n return filter_createClass(StringFetchStrategy, [{\n key: "convert",\n value: function convert(val) {\n return String(val != null ? val : "").toLowerCase().split(",");\n }\n }, {\n key: "convertFilterValue",\n value: function convertFilterValue(val) {\n if (val === 0) return "0";\n return String(val || "").toLowerCase();\n }\n }]);\n}();\nvar dateFetchStrategy = /*#__PURE__*/function (_NumberFetchStrategy2) {\n function dateFetchStrategy() {\n filter_classCallCheck(this, dateFetchStrategy);\n return filter_callSuper(this, dateFetchStrategy, arguments);\n }\n filter_inherits(dateFetchStrategy, _NumberFetchStrategy2);\n return filter_createClass(dateFetchStrategy, [{\n key: "convertFilterValue",\n value: function convertFilterValue(val) {\n var _val$split = val.split(":"),\n _val$split2 = filter_slicedToArray(_val$split, 3),\n type = _val$split2[0],\n date = _val$split2[1],\n match = _val$split2[2];\n return {\n type: type,\n date: Number(date),\n match: !!Number(match)\n };\n }\n }]);\n}(NumberFetchStrategy);\nvar BooleanFetchStrategy = /*#__PURE__*/function () {\n function BooleanFetchStrategy() {\n filter_classCallCheck(this, BooleanFetchStrategy);\n }\n return filter_createClass(BooleanFetchStrategy, [{\n key: "convert",\n value: function convert(val) {\n return [String(Boolean(val))];\n }\n }, {\n key: "convertFilterValue",\n value: function convertFilterValue(val) {\n return String(val);\n }\n }]);\n}();\nvar RecurringDateStrategy = /*#__PURE__*/function () {\n function RecurringDateStrategy() {\n filter_classCallCheck(this, RecurringDateStrategy);\n }\n return filter_createClass(RecurringDateStrategy, [{\n key: "convert",\n value: function convert(val) {\n return [Number(val)];\n }\n }, {\n key: "convertFilterValue",\n value: function convertFilterValue(val) {\n return String(val);\n }\n }]);\n}();\nvar Aggregate = /*#__PURE__*/function () {\n function Aggregate() {\n filter_classCallCheck(this, Aggregate);\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 return filter_createClass(Aggregate, [{\n key: "setStrategy",\n value: function 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 }, {\n key: "setEntity",\n value: function setEntity(val) {\n this._entity = this._currentStrategy.convert(val);\n return this;\n }\n }, {\n key: "getEntity",\n value: function getEntity() {\n return this._entity;\n }\n }, {\n key: "setFilterValues",\n value: function setFilterValues(val) {\n var _this = this;\n var temp = Array.isArray(val) ? val : [val];\n this._filterValues = temp.map(function (curFilterVal) {\n return _this._currentStrategy.convertFilterValue(curFilterVal);\n });\n return this;\n }\n }, {\n key: "getFilterValues",\n value: function getFilterValues() {\n return this._filterValues;\n }\n }, {\n key: "getCheckOption",\n value: function getCheckOption() {\n return this._checkOption;\n }\n }]);\n}();\nvar ItemsFilter = /*#__PURE__*/function () {\n function ItemsFilter() {\n filter_classCallCheck(this, ItemsFilter);\n }\n return filter_createClass(ItemsFilter, [{\n key: "filter",\n value: function filter(filters, items) {\n var allFiltersAndStrategy = this.checkIfAllFiltersHaveAndStrategy(filters);\n var filteredItems = [];\n var activeFilters = filters.filter(function (filter) {\n return filter.valuesArray.length;\n });\n var _iterator = filter_createForOfIteratorHelper(items),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var item = _step.value;\n var result = true;\n var _loop = function _loop() {\n var filter = activeFilters[i];\n var currField = item.fields.find(function (itemField) {\n return filter.field_id == itemField.field_id;\n });\n var filterAggregate = new Aggregate();\n var 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 return 1; // break\n }\n };\n for (var i = 0; i < activeFilters.length; i++) {\n if (_loop()) break;\n }\n if (result) {\n filteredItems.push(item);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n if (filteredItems.length || filters.length && !filteredItems.length) {\n return filteredItems;\n } else {\n return items;\n }\n }\n }, {\n key: "checkIfAllFiltersHaveAndStrategy",\n value: function checkIfAllFiltersHaveAndStrategy(filters) {\n return filters.every(function (filter) {\n if (!filter.boolean_strategy || filter.boolean_strategy == \'and\') {\n return true;\n }\n return false;\n });\n }\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/mergeFilters.js\nfunction mergeFilters_mergeFilters(srcFilters, destFilters) {\n var mergedFieldIds = [];\n var filters = [];\n if (srcFilters.length > 0) {\n srcFilters.forEach(function (filter) {\n filters.push(filter);\n });\n } else {\n filters = destFilters;\n }\n if (filters.length > 0) {\n filters.forEach(function (filter, index) {\n for (var 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 (var 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__(5615);\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 json_to_items_jsonToItems(json, fieldsMap) {\n var proccessedMap = [];\n var itemsPath = [];\n\n //-- Step 1 --// \n // iterating through map and generating list of paths for each field_id\n fieldsMap.forEach(function (fieldMap) {\n var 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(function (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 var items = getPathForItems(proccessedMap).map(function (itemPath) {\n return {\n fields: itemPath.fields.map(function (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 var matchedPaths = [];\n\n //-- Creating matchedPaths for compearing targetPath with pathsToCompare\n pathsToCompare.forEach(function (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(function (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(function (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 var itemsPath = [];\n proccessedMap.length && proccessedMap[0].json_paths.forEach(function (jsonPath) {\n var itemPath = {\n fields: []\n };\n proccessedMap.forEach(function (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\nfunction merge_compare_items_typeof(o) { "@babel/helpers - typeof"; return merge_compare_items_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, merge_compare_items_typeof(o); }\nfunction merge_compare_items_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction merge_compare_items_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, merge_compare_items_toPropertyKey(o.key), o); } }\nfunction merge_compare_items_createClass(e, r, t) { return r && merge_compare_items_defineProperties(e.prototype, r), t && merge_compare_items_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction merge_compare_items_toPropertyKey(t) { var i = merge_compare_items_toPrimitive(t, "string"); return "symbol" == merge_compare_items_typeof(i) ? i : i + ""; }\nfunction merge_compare_items_toPrimitive(t, r) { if ("object" != merge_compare_items_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != merge_compare_items_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nfunction merge_compare_items_slicedToArray(r, e) { return merge_compare_items_arrayWithHoles(r) || merge_compare_items_iterableToArrayLimit(r, e) || merge_compare_items_unsupportedIterableToArray(r, e) || merge_compare_items_nonIterableRest(); }\nfunction merge_compare_items_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction merge_compare_items_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return merge_compare_items_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? merge_compare_items_arrayLikeToArray(r, a) : void 0; } }\nfunction merge_compare_items_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction merge_compare_items_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction merge_compare_items_arrayWithHoles(r) { if (Array.isArray(r)) return r; }\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 merge_compare_items_populateWithItemRef(sorceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id) {\n var resultedItems = [];\n var theSameIdValueFn = function theSameIdValueFn(srcComprItem, dstComprItem) {\n var 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(function (dstItem) {\n sorceItemsRef.forEach(function (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 merge_compare_items_mergeItems(sorceItems, destinationItems, mergeByFieldId) {\n var src = JSON.parse(JSON.stringify(sorceItems));\n var dst = JSON.parse(JSON.stringify(destinationItems));\n var result = [];\n\n //-- The Source and in the Destination has the same item ids but different field values\n var differentSrcItemFn = function differentSrcItemFn(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 var theSameSrcItemFn = function theSameSrcItemFn(srcItem) {\n result.push(srcItem);\n };\n\n //-- Items thoase exist in the Source but they are not exist in the Destination list \n var newSrcItemFn = function newSrcItemFn(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 var uniqDestItemFn = function uniqDestItemFn(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 merge_compare_items_compareItems(sorceItems, destinationItems, fieldToCompare) {\n var src = JSON.parse(JSON.stringify(sorceItems));\n var dst = JSON.parse(JSON.stringify(destinationItems));\n var result = {\n is_items_diff: false,\n new_src_items: [],\n diff_src_items: [],\n same_items: [],\n trash_src_items: []\n };\n var differentSrcItemFn = function differentSrcItemFn(item) {\n result.diff_src_items.push(item);\n };\n var theSameSrcItemFn = function theSameSrcItemFn(item) {\n result.same_items.push(item);\n };\n var newSrcItemFn = function newSrcItemFn(item) {\n result.new_src_items.push(item);\n };\n var trashSrcItemFn = function trashSrcItemFn(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(function (srcField) {\n var 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(function (srcItem) {\n var notFoundDestItemforSrc = true;\n var srcVal = getFieldById(srcItem, fieldToCompare).field_value;\n dst.forEach(function (dstItem) {\n var 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 var dstItemsMap = new ItemsMapper(dst);\n src.forEach(function (srcItem) {\n var 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 (var _i = 0, _Object$entries = Object.entries(dstItemsMap.itemsMap); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = merge_compare_items_slicedToArray(_Object$entries[_i], 2),\n key = _Object$entries$_i[0],\n value = _Object$entries$_i[1];\n uniqDestItemFn(dst[value]);\n }\n}\nfunction compareTwoItems(src, dst, differentSrcItemFn, theSameSrcItemFn, trashSrcItemFn) {\n var sameItem = true;\n for (var i = 0; i < src.fields.length; i++) {\n var 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 var srcFieldVal = getFieldById(srcItem, srcFieldId).field_value;\n var dstFieldIdVal = getFieldById(dstItem, dstFieldId).field_value;\n if (srcFieldVal == dstFieldIdVal) {\n theSameSrcItemFn(srcItem, dstItem);\n }\n}\nfunction getFieldById(item, field_id) {\n var result = null;\n for (var 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}\nvar ItemsMapper = /*#__PURE__*/function () {\n function ItemsMapper(items) {\n var _this = this;\n merge_compare_items_classCallCheck(this, ItemsMapper);\n this._itemsMap = {};\n items.forEach(function (item, key) {\n _this._itemsMap[item.item_id] = key;\n });\n }\n return merge_compare_items_createClass(ItemsMapper, [{\n key: "pullItemIndex",\n value: function pullItemIndex(item_id) {\n var index = this._itemsMap[item_id];\n delete this._itemsMap[item_id];\n return index;\n }\n }, {\n key: "getItemIndex",\n value: function getItemIndex(item_id) {\n return this._itemsMap[item_id];\n }\n }, {\n key: "itemsMap",\n get: function get() {\n return this._itemsMap;\n }\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/Utils/filter/group.js\nfunction group_group(fieldGroup, items) {\n var groupItemList = [];\n var arrayGroupField;\n if (!fieldGroup) {\n groupItemList = items;\n } else {\n arrayGroupField = fieldGroup.split(",");\n }\n var arrayValue = new Set();\n if (fieldGroup) {\n items.forEach(function (item) {\n var valueField = "";\n arrayGroupField.forEach(function (fieldToGroup, index) {\n var findField = item.fields.find(function (field) {\n return field.field_id == fieldToGroup;\n });\n if (findField) {\n valueField += findField.field_value;\n }\n if (arrayGroupField.length - 1 == index) {\n var 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 var 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 populate_items_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(function (item) {\n model.forEach(function (modelField) {\n var field = item.fields.find(function (sourceField) {\n return sourceField.element_id == modelField.element_id;\n });\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(function (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__(4273);\n// EXTERNAL MODULE: ./node_modules/date-fns/setDay/index.js\nvar setDay = __webpack_require__(7800);\n// EXTERNAL MODULE: ./node_modules/date-fns/isSameWeek/index.js\nvar isSameWeek = __webpack_require__(8316);\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 get_date_populateWithDate(items, model) {\n items.forEach(function (item) {\n model.forEach(function (modelField) {\n var field = item.fields.find(function (sourceField) {\n return sourceField.element_id == modelField.element_id;\n });\n if (field) {\n if (modelField.data_range) {\n if (modelField.date_type.includes(\'calendar\')) {\n field.field_value = "".concat(getStartDate(modelField.date_type), ":").concat(get_date_getDate(modelField.date_type));\n } else {\n field.field_value = "".concat(getStartDate(modelField.date_type), ":").concat(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 var currentDate = new Date();\n function weekTime(currentDate) {\n var day = currentDate.getDay();\n var 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 var diff = currentDate.getDate() - day + numberOfDays + (day == 0 ? -6 : 1);\n return new Date(currentDate.setDate(diff));\n }\n function quarterTime(currentDate) {\n var numberMonths;\n var numberDays;\n var currentQuarter = Math.floor(currentDate.getMonth() / 3);\n var 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 var currentQuarter = Math.floor(date.getMonth() / 3);\n var 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 get_date_checkRecurringDate(date, option) {\n date = new Date(date);\n var 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 var currentYear = new Date().getFullYear();\n var 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\nfunction merge_objects_typeof(o) { "@babel/helpers - typeof"; return merge_objects_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, merge_objects_typeof(o); }\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 merge_objects_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 && merge_objects_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 merge_chunks_worker_typeof(o) { "@babel/helpers - typeof"; return merge_chunks_worker_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, merge_chunks_worker_typeof(o); }\nfunction merge_chunks_worker_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction merge_chunks_worker_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? merge_chunks_worker_ownKeys(Object(t), !0).forEach(function (r) { merge_chunks_worker_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : merge_chunks_worker_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction merge_chunks_worker_defineProperty(e, r, t) { return (r = merge_chunks_worker_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction merge_chunks_worker_toPropertyKey(t) { var i = merge_chunks_worker_toPrimitive(t, "string"); return "symbol" == merge_chunks_worker_typeof(i) ? i : i + ""; }\nfunction merge_chunks_worker_toPrimitive(t, r) { if ("object" != merge_chunks_worker_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != merge_chunks_worker_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nfunction mergeChunks(chunks) {\n var result = {};\n chunks.forEach(function (chunk) {\n chunk.items_list.forEach(function (item) {\n var dstItem = result[item.item_id];\n if (dstItem) {\n dstItem.trash = item.trash;\n return item.fields.forEach(function (srcField) {\n var isFieldNonExist = true;\n dstItem.fields = dstItem.fields.map(function (dstField) {\n if (Number(dstField.field_id) === Number(srcField.field_id)) {\n isFieldNonExist = false;\n if (dstField.field_value != srcField.field_value) {\n return merge_chunks_worker_objectSpread(merge_chunks_worker_objectSpread({}, 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 var 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 //dont launch new thread because already used in worker.\n // Main reason is that renderer process allocates memory for structured clones for communication between trheads\n return mergeChunks(chunks);\n if (typeof Worker !== \'undefined\') {\n return new Promise(function (resolve, reject) {\n var chunkWorkerBlob = new Blob([mergeChunksWorker()], {\n type: "application/javascript"\n });\n var 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 nested_list_makeNestedList(arr, id, parent_id, children_property, priority_property) {\n var array = JSON.parse(JSON.stringify(arr));\n var children = Boolean(children_property) ? children_property : \'children\';\n var priority = Boolean(priority_property) ? priority_property : false;\n var i;\n for (i = 0; i < array.length; i++) {\n if (array[i][parent_id] && array[i][parent_id] !== 0) {\n array.forEach(function (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(function (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(function (a, b) {\n return a[priority] - b[priority];\n });\n unsorted_array.forEach(function (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\nfunction MergeFields_typeof(o) { "@babel/helpers - typeof"; return MergeFields_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, MergeFields_typeof(o); }\nfunction MergeFields_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ MergeFields_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == MergeFields_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(MergeFields_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction MergeFields_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction MergeFields_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { MergeFields_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { MergeFields_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction MergeFields_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction MergeFields_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, MergeFields_toPropertyKey(o.key), o); } }\nfunction MergeFields_createClass(e, r, t) { return r && MergeFields_defineProperties(e.prototype, r), t && MergeFields_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction MergeFields_toPropertyKey(t) { var i = MergeFields_toPrimitive(t, "string"); return "symbol" == MergeFields_typeof(i) ? i : i + ""; }\nfunction MergeFields_toPrimitive(t, r) { if ("object" != MergeFields_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != MergeFields_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar FieldsOperator = /*#__PURE__*/function () {\n function FieldsOperator(gudhub) {\n MergeFields_classCallCheck(this, FieldsOperator);\n this.gudhub = gudhub;\n }\n return MergeFields_createClass(FieldsOperator, [{\n key: "mergeFieldLists",\n value: function mergeFieldLists(fieldsToView, fieldList) {\n var _this = this;\n var fieldsToViewCopy = JSON.parse(JSON.stringify(fieldsToView));\n var fieldListCopy = JSON.parse(JSON.stringify(fieldList));\n var existingFieldsIds = fieldListCopy.map(function (field) {\n return field.field_id;\n });\n if (!fieldListCopy.length) {\n return [];\n }\n return fieldListCopy.reduce(function (viewArray, currentField) {\n var positionInViewArray = null;\n var props = viewArray.find(function (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 var defaultIntrpr = currentField.data_model && currentField.data_model.interpretation ? currentField.data_model.interpretation.find(function (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 var firstMerge = _this.gudhub.util.mergeObjects({\n show: 1\n }, defaultIntrpr);\n var 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 }, {\n key: "createFieldsListToView",\n value: function createFieldsListToView(appId, tableSettingsFieldListToView) {\n var _this2 = this;\n var self = this;\n return new Promise(/*#__PURE__*/function () {\n var _ref = MergeFields_asyncToGenerator(/*#__PURE__*/MergeFields_regeneratorRuntime().mark(function _callee(resolve) {\n var fieldList, correctFieldList, checkFiledFromPipe;\n return MergeFields_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n checkFiledFromPipe = function _checkFiledFromPipe(correctFieldList) {\n var counter = 0;\n fieldList.forEach(function (elemetFromPipe, index) {\n var correctFiel = correctFieldList.find(function (elemet) {\n return elemetFromPipe.field_id == elemet.field_id;\n });\n if (!correctFiel) {\n self.gudhub.ghconstructor.getInstance(elemetFromPipe.data_type).then(function (data) {\n if (data) {\n var template = data.getTemplate();\n var show_field = template.model.data_model.interpretation.find(function (intrpr) {\n return intrpr.src == \'table\';\n });\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 _context.next = 3;\n return _this2.gudhub.getFieldModels(appId);\n case 3:\n fieldList = _context.sent;\n if (tableSettingsFieldListToView.length !== 0) {\n correctFieldList = [];\n tableSettingsFieldListToView.forEach(function (elementFromTable, index) {\n var fieldOnPipe = fieldList.find(function (element) {\n return elementFromTable.field_id == element.field_id;\n });\n if (fieldOnPipe) {\n var show_field = fieldOnPipe.data_model.interpretation.find(function (intrpr) {\n return intrpr.src == \'table\';\n });\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 case 5:\n case "end":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n }\n }, {\n key: "createFieldsListToViewWithDataType",\n value: function createFieldsListToViewWithDataType(appId, tableSettingsFieldListToView) {\n var _this3 = this;\n return new Promise(/*#__PURE__*/function () {\n var _ref2 = MergeFields_asyncToGenerator(/*#__PURE__*/MergeFields_regeneratorRuntime().mark(function _callee3(resolve) {\n var columnsToView, fieldList, actualFieldIds, promises;\n return MergeFields_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n columnsToView = [];\n _context3.next = 3;\n return _this3.gudhub.getFieldModels(appId);\n case 3:\n fieldList = _context3.sent;\n actualFieldIds = fieldList.map(function (field) {\n return +field.field_id;\n });\n promises = [];\n columnsToView = fieldList.reduce(function (viewColumsList, currentField) {\n var field = viewColumsList.find(function (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(/*#__PURE__*/function () {\n var _ref3 = MergeFields_asyncToGenerator(/*#__PURE__*/MergeFields_regeneratorRuntime().mark(function _callee2(resolve) {\n var instance, template, defaultIntepretation;\n return MergeFields_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return _this3.gudhub.ghconstructor.getInstance(currentField.data_type);\n case 2:\n instance = _context2.sent;\n template = instance.getTemplate();\n defaultIntepretation = template.model.data_model.interpretation.find(function (intrpr) {\n return intrpr.src == \'table\';\n }) || {\n settings: {\n show_field: 1\n }\n };\n viewColumsList.find(function (view) {\n return view.field_id == currentField.field_id;\n }).show = defaultIntepretation.settings.show_field;\n resolve(true);\n case 7:\n case "end":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function (_x3) {\n return _ref3.apply(this, arguments);\n };\n }()));\n }\n return viewColumsList;\n }, tableSettingsFieldListToView);\n Promise.all(promises).then(function () {\n columnsToView = columnsToView.filter(function (field) {\n return actualFieldIds.indexOf(field.field_id) != -1;\n });\n resolve(columnsToView);\n });\n case 8:\n case "end":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function (_x2) {\n return _ref2.apply(this, arguments);\n };\n }());\n }\n }]);\n}();\n\n;// CONCATENATED MODULE: ./GUDHUB/Utils/ItemsSelection/ItemsSelection.js\nfunction ItemsSelection_typeof(o) { "@babel/helpers - typeof"; return ItemsSelection_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, ItemsSelection_typeof(o); }\nfunction ItemsSelection_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ ItemsSelection_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == ItemsSelection_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(ItemsSelection_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction ItemsSelection_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction ItemsSelection_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { ItemsSelection_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { ItemsSelection_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction ItemsSelection_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction ItemsSelection_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, ItemsSelection_toPropertyKey(o.key), o); } }\nfunction ItemsSelection_createClass(e, r, t) { return r && ItemsSelection_defineProperties(e.prototype, r), t && ItemsSelection_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction ItemsSelection_toPropertyKey(t) { var i = ItemsSelection_toPrimitive(t, "string"); return "symbol" == ItemsSelection_typeof(i) ? i : i + ""; }\nfunction ItemsSelection_toPrimitive(t, r) { if ("object" != ItemsSelection_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != ItemsSelection_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar ItemsSelection = /*#__PURE__*/function () {\n function ItemsSelection(gudhub) {\n ItemsSelection_classCallCheck(this, ItemsSelection);\n this.gudhub = gudhub;\n this.selectedItems = {};\n }\n return ItemsSelection_createClass(ItemsSelection, [{\n key: "selectItems",\n value: function () {\n var _selectItems = ItemsSelection_asyncToGenerator(/*#__PURE__*/ItemsSelection_regeneratorRuntime().mark(function _callee(appId, items) {\n var app, itemObject, selectedItemsIds;\n return ItemsSelection_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (this.selectedItems.hasOwnProperty(appId)) {\n _context.next = 6;\n break;\n }\n this.selectedItems[appId] = {\n items: [],\n app: []\n };\n _context.next = 4;\n return this.gudhub.getApp(appId);\n case 4:\n app = _context.sent;\n this.selectedItems[appId].app = app;\n case 6:\n itemObject = this.selectedItems[appId];\n selectedItemsIds = itemObject.items.map(function (obj) {\n return obj.item_id;\n });\n items.forEach(function (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 case 9:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function selectItems(_x, _x2) {\n return _selectItems.apply(this, arguments);\n }\n return selectItems;\n }()\n }, {\n key: "getSelectedItems",\n value: function getSelectedItems(appId) {\n return this.selectedItems[appId] ? this.selectedItems[appId] : {\n items: [],\n app: []\n };\n }\n }, {\n key: "clearSelectedItems",\n value: function clearSelectedItems(appId) {\n if (this.selectedItems[appId]) {\n this.selectedItems[appId].items = [];\n }\n }\n }, {\n key: "isItemSelected",\n value: function isItemSelected(appId, itemId) {\n var array = this.getSelectedItems(appId);\n if (array !== null) {\n array = array.items.map(function (obj) {\n return obj.item_id;\n });\n return array.indexOf(itemId) != -1;\n } else {\n return false;\n }\n }\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 json_constructor_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction json_constructor_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? json_constructor_ownKeys(Object(t), !0).forEach(function (r) { json_constructor_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : json_constructor_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction json_constructor_toConsumableArray(r) { return json_constructor_arrayWithoutHoles(r) || json_constructor_iterableToArray(r) || json_constructor_unsupportedIterableToArray(r) || json_constructor_nonIterableSpread(); }\nfunction json_constructor_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction json_constructor_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return json_constructor_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? json_constructor_arrayLikeToArray(r, a) : void 0; } }\nfunction json_constructor_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }\nfunction json_constructor_arrayWithoutHoles(r) { if (Array.isArray(r)) return json_constructor_arrayLikeToArray(r); }\nfunction json_constructor_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction json_constructor_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ json_constructor_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == json_constructor_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(json_constructor_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction json_constructor_defineProperty(e, r, t) { return (r = json_constructor_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction json_constructor_toPropertyKey(t) { var i = json_constructor_toPrimitive(t, "string"); return "symbol" == json_constructor_typeof(i) ? i : i + ""; }\nfunction json_constructor_toPrimitive(t, r) { if ("object" != json_constructor_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != json_constructor_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nfunction json_constructor_typeof(o) { "@babel/helpers - typeof"; return json_constructor_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, json_constructor_typeof(o); }\nfunction json_constructor_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction json_constructor_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { json_constructor_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { json_constructor_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction compiler(scheme, item, util, variables, appId) {\n function schemeCompiler(_x, _x2, _x3) {\n return _schemeCompiler.apply(this, arguments);\n }\n /* Get properties value for array childs in scheme, for each application filtered item. */\n function _schemeCompiler() {\n _schemeCompiler = json_constructor_asyncToGenerator(/*#__PURE__*/json_constructor_regeneratorRuntime().mark(function _callee(scheme, item, appId) {\n var value, result, key, element, res;\n return json_constructor_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n value = null;\n if (!(scheme.type === "array")) {\n _context.next = 13;\n break;\n }\n if (!Number(scheme.is_static)) {\n _context.next = 10;\n break;\n }\n _context.t0 = Array;\n _context.next = 6;\n return getChildsPropertiesObject(scheme.childs, item, appId);\n case 6:\n _context.t1 = _context.sent;\n value = new _context.t0(_context.t1);\n _context.next = 13;\n break;\n case 10:\n _context.next = 12;\n return getArrayOfItemsWithProperties(scheme, item, appId);\n case 12:\n value = _context.sent;\n case 13:\n if (!(scheme.type === "object")) {\n _context.next = 23;\n break;\n }\n if (!Number(scheme.current_item)) {\n _context.next = 20;\n break;\n }\n _context.next = 17;\n return getItemWithProperties(scheme, item);\n case 17:\n value = _context.sent;\n _context.next = 23;\n break;\n case 20:\n _context.next = 22;\n return getChildsPropertiesObject(scheme.childs, item, appId);\n case 22:\n value = _context.sent;\n case 23:\n if (!(scheme.type === "property")) {\n _context.next = 27;\n break;\n }\n _context.next = 26;\n return getFieldValue(scheme, item, appId);\n case 26:\n value = _context.sent;\n case 27:\n if (!(json_constructor_typeof(scheme) === "object" && typeof scheme.type === \'undefined\')) {\n _context.next = 41;\n break;\n }\n result = {};\n _context.t2 = json_constructor_regeneratorRuntime().keys(scheme);\n case 30:\n if ((_context.t3 = _context.t2()).done) {\n _context.next = 40;\n break;\n }\n key = _context.t3.value;\n if (!scheme.hasOwnProperty(key)) {\n _context.next = 38;\n break;\n }\n element = scheme[key];\n _context.next = 36;\n return schemeCompiler(element, item, appId);\n case 36:\n res = _context.sent;\n result[key] = res[element.property_name];\n case 38:\n _context.next = 30;\n break;\n case 40:\n return _context.abrupt("return", result);\n case 41:\n return _context.abrupt("return", json_constructor_defineProperty({}, scheme.property_name, value));\n case 42:\n case "end":\n return _context.stop();\n }\n }, _callee);\n }));\n return _schemeCompiler.apply(this, arguments);\n }\n function getArrayOfItemsWithProperties(_x4, _x5, _x6) {\n return _getArrayOfItemsWithProperties.apply(this, arguments);\n }\n function _getArrayOfItemsWithProperties() {\n _getArrayOfItemsWithProperties = json_constructor_asyncToGenerator(/*#__PURE__*/json_constructor_regeneratorRuntime().mark(function _callee3(scheme, item, recievedApp) {\n var app, filteredItems, itemsWithValue, itemsWithoutValue, offset, limit, arrayOfItemsWithProperties;\n return json_constructor_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return util.gudhub.getApp(Number(scheme.app_id));\n case 2:\n app = _context3.sent;\n _context3.next = 5;\n return filterItems(scheme.filter, app.items_list, recievedApp, item);\n case 5:\n filteredItems = _context3.sent;\n if (scheme.isSortable && scheme.field_id_to_sort && scheme.field_id_to_sort !== \'\') {\n itemsWithValue = filteredItems.flatMap(function (item) {\n var fieldToSort = item.fields.find(function (field) {\n return field.field_id == scheme.field_id_to_sort;\n });\n if (!fieldToSort || fieldToSort.field_value == \'\') {\n return [];\n } else {\n return item;\n }\n });\n itemsWithoutValue = filteredItems.filter(function (item) {\n if (!itemsWithValue.includes(item)) {\n return item;\n }\n });\n itemsWithValue = itemsWithValue.sort(function (a, b) {\n if (scheme.sortType == \'desc\') {\n return b.fields.find(function (field) {\n return field.field_id == scheme.field_id_to_sort;\n }).field_value - a.fields.find(function (field) {\n return field.field_id == scheme.field_id_to_sort;\n }).field_value;\n } else {\n return a.fields.find(function (field) {\n return field.field_id == scheme.field_id_to_sort;\n }).field_value - b.fields.find(function (field) {\n return field.field_id == scheme.field_id_to_sort;\n }).field_value;\n }\n });\n filteredItems = [].concat(json_constructor_toConsumableArray(itemsWithValue), json_constructor_toConsumableArray(itemsWithoutValue));\n }\n if (scheme.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 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 arrayOfItemsWithProperties = filteredItems.map(/*#__PURE__*/function () {\n var _ref2 = json_constructor_asyncToGenerator(/*#__PURE__*/json_constructor_regeneratorRuntime().mark(function _callee2(item) {\n return json_constructor_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt("return", getChildsPropertiesObject(scheme.childs, item, app.app_id));\n case 1:\n case "end":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function (_x20) {\n return _ref2.apply(this, arguments);\n };\n }());\n return _context3.abrupt("return", Promise.all(arrayOfItemsWithProperties));\n case 11:\n case "end":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return _getArrayOfItemsWithProperties.apply(this, arguments);\n }\n function getItemWithProperties(_x7, _x8) {\n return _getItemWithProperties.apply(this, arguments);\n }\n /* Get properties value for object childs in scheme. */\n function _getItemWithProperties() {\n _getItemWithProperties = json_constructor_asyncToGenerator(/*#__PURE__*/json_constructor_regeneratorRuntime().mark(function _callee4(scheme, item) {\n var app, items;\n return json_constructor_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return util.gudhub.getApp(scheme.app_id);\n case 2:\n app = _context4.sent;\n items = app.items_list || [];\n return _context4.abrupt("return", getChildsPropertiesObject(scheme.childs, item || items[0], app.app_id));\n case 5:\n case "end":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return _getItemWithProperties.apply(this, arguments);\n }\n function getChildsPropertiesObject(_x9, _x10, _x11) {\n return _getChildsPropertiesObject.apply(this, arguments);\n }\n /* Get property value based on interpretation value */\n function _getChildsPropertiesObject() {\n _getChildsPropertiesObject = json_constructor_asyncToGenerator(/*#__PURE__*/json_constructor_regeneratorRuntime().mark(function _callee6(properties, item, appId) {\n var propertiesArray, resolvedPropertiesArray;\n return json_constructor_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return properties.map(/*#__PURE__*/function () {\n var _ref3 = json_constructor_asyncToGenerator(/*#__PURE__*/json_constructor_regeneratorRuntime().mark(function _callee5(child) {\n return json_constructor_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n return _context5.abrupt("return", schemeCompiler(child, item, appId));\n case 1:\n case "end":\n return _context5.stop();\n }\n }, _callee5);\n }));\n return function (_x21) {\n return _ref3.apply(this, arguments);\n };\n }());\n case 2:\n propertiesArray = _context6.sent;\n _context6.next = 5;\n return Promise.all(propertiesArray);\n case 5:\n resolvedPropertiesArray = _context6.sent;\n return _context6.abrupt("return", resolvedPropertiesArray.reduce(function (acc, object) {\n return json_constructor_objectSpread(json_constructor_objectSpread({}, acc), object);\n }, {}));\n case 7:\n case "end":\n return _context6.stop();\n }\n }, _callee6);\n }));\n return _getChildsPropertiesObject.apply(this, arguments);\n }\n function getFieldValue(_x12, _x13, _x14) {\n return _getFieldValue.apply(this, arguments);\n }\n function _getFieldValue() {\n _getFieldValue = json_constructor_asyncToGenerator(/*#__PURE__*/json_constructor_regeneratorRuntime().mark(function _callee7(scheme, item, appId) {\n var result, func, _result, interpretatedValue, value;\n return json_constructor_regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _context7.t0 = scheme.property_type;\n _context7.next = _context7.t0 === "static" ? 3 : _context7.t0 === "variable" ? 4 : _context7.t0 === "field_id" ? 9 : _context7.t0 === "function" ? 10 : _context7.t0 === "field_value" ? 20 : 20;\n break;\n case 3:\n return _context7.abrupt("return", scheme.static_field_value);\n case 4:\n _context7.t1 = scheme.variable_type;\n _context7.next = _context7.t1 === "app_id" ? 7 : _context7.t1 === "current_item" ? 8 : 8;\n break;\n case 7:\n return _context7.abrupt("return", appId);\n case 8:\n return _context7.abrupt("return", "".concat(appId, ".").concat(item.item_id));\n case 9:\n return _context7.abrupt("return", scheme.field_id);\n case 10:\n if (!(typeof scheme["function"] === \'function\')) {\n _context7.next = 15;\n break;\n }\n result = scheme["function"].apply(scheme, [item, appId, util.gudhub].concat(json_constructor_toConsumableArray(scheme.args)));\n return _context7.abrupt("return", result);\n case 15:\n func = new Function(\'item, appId, gudhub\', \'return (async \' + scheme["function"] + \')(item, appId, gudhub)\');\n _context7.next = 18;\n return func(item, appId, util.gudhub);\n case 18:\n _result = _context7.sent;\n return _context7.abrupt("return", _result);\n case 20:\n if (!(!scheme.field_id && scheme.name_space)) {\n _context7.next = 24;\n break;\n }\n _context7.next = 23;\n return util.gudhub.getFieldIdByNameSpace(appId, scheme.name_space);\n case 23:\n scheme.field_id = _context7.sent;\n case 24:\n if (!Boolean(Number(scheme.interpretation))) {\n _context7.next = 31;\n break;\n }\n _context7.next = 27;\n return util.gudhub.getInterpretationById(Number(appId), Number(item.item_id), Number(scheme.field_id), \'value\');\n case 27:\n interpretatedValue = _context7.sent;\n return _context7.abrupt("return", interpretatedValue);\n case 31:\n _context7.next = 33;\n return util.gudhub.getFieldValue(Number(appId), Number(item.item_id), Number(scheme.field_id));\n case 33:\n value = _context7.sent;\n return _context7.abrupt("return", value);\n case 35:\n case "end":\n return _context7.stop();\n }\n }, _callee7);\n }));\n return _getFieldValue.apply(this, arguments);\n }\n function getFilteredItems(_x15, _x16, _x17, _x18, _x19) {\n return _getFilteredItems.apply(this, arguments);\n }\n /* Filter items by scheme filter */\n function _getFilteredItems() {\n _getFilteredItems = json_constructor_asyncToGenerator(/*#__PURE__*/json_constructor_regeneratorRuntime().mark(function _callee8(filtersList, element_app_id, app_id, item_id, itemsList) {\n var modified_filters_list;\n return json_constructor_regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n _context8.next = 2;\n return util.gudhub.prefilter(JSON.parse(JSON.stringify(filtersList)), json_constructor_objectSpread({\n element_app_id: element_app_id,\n app_id: app_id,\n item_id: item_id\n }, variables));\n case 2:\n modified_filters_list = _context8.sent;\n return _context8.abrupt("return", util.gudhub.filter(itemsList, [].concat(json_constructor_toConsumableArray(modified_filters_list), json_constructor_toConsumableArray(filtersList))));\n case 4:\n case "end":\n return _context8.stop();\n }\n }, _callee8);\n }));\n return _getFilteredItems.apply(this, arguments);\n }\n function filterItems() {\n return _filterItems.apply(this, arguments);\n }\n function _filterItems() {\n _filterItems = json_constructor_asyncToGenerator(/*#__PURE__*/json_constructor_regeneratorRuntime().mark(function _callee9() {\n var filtersList,\n itemsList,\n appId,\n item,\n _args9 = arguments;\n return json_constructor_regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n filtersList = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : [];\n itemsList = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : [];\n appId = _args9.length > 2 && _args9[2] !== undefined ? _args9[2] : \'\';\n item = _args9.length > 3 && _args9[3] !== undefined ? _args9[3] : {};\n return _context9.abrupt("return", filtersList.length ? getFilteredItems(filtersList, appId, appId, item.item_id, itemsList) : json_constructor_toConsumableArray(itemsList));\n case 5:\n case "end":\n return _context9.stop();\n }\n }, _callee9);\n }));\n return _filterItems.apply(this, arguments);\n }\n return schemeCompiler(scheme, item, appId, variables);\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/AppsTemplateService/AppsTemplateService.js\nfunction AppsTemplateService_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = AppsTemplateService_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }\nfunction AppsTemplateService_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return AppsTemplateService_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? AppsTemplateService_arrayLikeToArray(r, a) : void 0; } }\nfunction AppsTemplateService_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction AppsTemplateService_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ AppsTemplateService_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == AppsTemplateService_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(AppsTemplateService_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction AppsTemplateService_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction AppsTemplateService_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { AppsTemplateService_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { AppsTemplateService_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction AppsTemplateService_typeof(o) { "@babel/helpers - typeof"; return AppsTemplateService_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, AppsTemplateService_typeof(o); }\nfunction AppsTemplateService_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction AppsTemplateService_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, AppsTemplateService_toPropertyKey(o.key), o); } }\nfunction AppsTemplateService_createClass(e, r, t) { return r && AppsTemplateService_defineProperties(e.prototype, r), t && AppsTemplateService_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction AppsTemplateService_toPropertyKey(t) { var i = AppsTemplateService_toPrimitive(t, "string"); return "symbol" == AppsTemplateService_typeof(i) ? i : i + ""; }\nfunction AppsTemplateService_toPrimitive(t, r) { if ("object" != AppsTemplateService_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != AppsTemplateService_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar AppsTemplateService = /*#__PURE__*/function () {\n function AppsTemplateService(gudhub) {\n AppsTemplateService_classCallCheck(this, AppsTemplateService);\n this.gudhub = gudhub;\n this.appsConnectingMap = {\n apps: [],\n fields: [],\n items: [],\n views: []\n };\n }\n return AppsTemplateService_createClass(AppsTemplateService, [{\n key: "createAppsFromTemplate",\n value: function createAppsFromTemplate(pack, maxNumberOfInsstalledItems, progressCallback, installFromMaster) {\n var _this = this;\n var self = this;\n return new Promise(function (resolve) {\n var stepsCount = pack.apps.length * 6;\n var stepPercents = 100 / stepsCount;\n var currentStep = 0;\n self.createApps(pack, function (status) {\n currentStep += 1;\n progressCallback ? progressCallback.call(_this, {\n percent: currentStep * stepPercents,\n status: status\n }) : null;\n }, installFromMaster).then(function (success) {\n self.createItems(success, maxNumberOfInsstalledItems, function (status) {\n if (typeof status === \'string\') {\n currentStep += 1;\n progressCallback ? progressCallback.call(_this, {\n percent: currentStep * stepPercents,\n status: status\n }) : null;\n } else if (AppsTemplateService_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 }, {\n key: "createItems",\n value: function createItems(create_apps, maxNumberOfInsstalledItems, callback, installFromMaster) {\n var _this2 = this;\n return new Promise(/*#__PURE__*/function () {\n var _ref = AppsTemplateService_asyncToGenerator(/*#__PURE__*/AppsTemplateService_regeneratorRuntime().mark(function _callee2(resolve) {\n var MAX_NUMBER_OF_INSTALLED_ITEMS, self, createsItems, promises, _yield$self$gudhub$re, accesstoken;\n return AppsTemplateService_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n MAX_NUMBER_OF_INSTALLED_ITEMS = maxNumberOfInsstalledItems ? maxNumberOfInsstalledItems : 100000;\n self = _this2;\n createsItems = [];\n promises = [];\n _context2.next = 6;\n return 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 case 6:\n _yield$self$gudhub$re = _context2.sent;\n accesstoken = _yield$self$gudhub$re.accesstoken;\n create_apps.forEach(function (app) {\n promises.push(new Promise(/*#__PURE__*/function () {\n var _ref2 = AppsTemplateService_asyncToGenerator(/*#__PURE__*/AppsTemplateService_regeneratorRuntime().mark(function _callee(app_resolve) {\n var result_app, source_app, items;\n return AppsTemplateService_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!installFromMaster) {\n _context.next = 6;\n break;\n }\n _context.next = 3;\n return self.gudhub.req.axiosRequest({\n url: "https://gudhub.com/GudHub_Test/api/app/get?token=".concat(accesstoken, "&app_id=").concat(self._searchOldAppId(app.app_id, self.appsConnectingMap.apps)),\n method: \'GET\'\n });\n case 3:\n result_app = _context.sent;\n _context.next = 9;\n break;\n case 6:\n _context.next = 8;\n return self.gudhub.getApp(self._searchOldAppId(app.app_id, self.appsConnectingMap.apps));\n case 8:\n result_app = _context.sent;\n case 9:\n callback ? callback.call(_this2, "GET APP: ".concat(result_app.app_name, " (Items steps)")) : null;\n source_app = JSON.parse(JSON.stringify(result_app));\n items = source_app.items_list.map(function (item) {\n return {\n index_number: item.index_number,\n item_id: 0,\n fields: []\n };\n }).filter(function (item, index) {\n return index <= MAX_NUMBER_OF_INSTALLED_ITEMS;\n });\n self.gudhub.addNewItems(app.app_id, items).then(function (items) {\n callback ? callback.call(_this2, "ADD NEW ITEMS: ".concat(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 case 13:\n case "end":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x2) {\n return _ref2.apply(this, arguments);\n };\n }()));\n });\n Promise.all(promises).then(function () {\n createsItems.forEach(function (app) {\n app.items_list.forEach(function (item) {\n item.fields.forEach(function (field_item) {\n self.appsConnectingMap.fields.forEach(function (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(function () {\n var promises = [];\n createsItems.forEach(function (created_app) {\n promises.push(new Promise(function (resolve) {\n var newItems = created_app.items_list.map(function (item) {\n item.fields.forEach(function (field) {\n delete field.data_id;\n });\n return item;\n });\n self.gudhub.updateItems(created_app.app_id, newItems).then(function () {\n callback ? callback.call(_this2, "REPLACE VALUE: ".concat(created_app.app_name, " (Items steps)")) : null;\n resolve();\n });\n }));\n });\n Promise.all(promises).then(function () {\n callback.call(_this2, createsItems);\n resolve();\n });\n });\n });\n case 10:\n case "end":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n }\n }, {\n key: "deleteField",\n value: function deleteField(apps) {\n apps.forEach(function (app) {\n app.items_list.forEach(function (item) {\n item.fields = item.fields.filter(function (field) {\n return app.field_list.findIndex(function (f) {\n return f.field_id == field.field_id;\n }) > -1;\n });\n });\n });\n }\n }, {\n key: "replaceValue",\n value: function replaceValue(apps, map) {\n var _this3 = this;\n return new Promise(/*#__PURE__*/function () {\n var _ref3 = AppsTemplateService_asyncToGenerator(/*#__PURE__*/AppsTemplateService_regeneratorRuntime().mark(function _callee3(resolve) {\n var allPromises, self;\n return AppsTemplateService_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n allPromises = [];\n self = _this3;\n apps.forEach(function (app) {\n app.field_list.forEach(function (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(function (resolve) {\n self.gudhub.ghconstructor.getInstance(field_of_list.data_type).then(function (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(function (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(function (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(function (result) {\n resolve(result);\n });\n } else {\n resolve(result);\n }\n case 4:\n case "end":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function (_x3) {\n return _ref3.apply(this, arguments);\n };\n }());\n }\n }, {\n key: "documentInstallerHelper",\n value: function documentInstallerHelper(appId, items, elementId) {\n var self = this;\n var itemsWithClonedDocument = [];\n return new Promise(/*#__PURE__*/function () {\n var _ref4 = AppsTemplateService_asyncToGenerator(/*#__PURE__*/AppsTemplateService_regeneratorRuntime().mark(function _callee4(resolve) {\n var _iterator, _step, item, itemId, field, document, newDocument;\n return AppsTemplateService_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _iterator = AppsTemplateService_createForOfIteratorHelper(items);\n _context4.prev = 1;\n _iterator.s();\n case 3:\n if ((_step = _iterator.n()).done) {\n _context4.next = 19;\n break;\n }\n item = _step.value;\n itemId = item.item_id;\n field = item.fields.find(function (field) {\n return field.element_id === elementId;\n });\n if (!(field && field.field_value && field.field_value.length > 0)) {\n _context4.next = 17;\n break;\n }\n _context4.next = 10;\n return self.gudhub.getDocument({\n _id: field.field_value\n });\n case 10:\n document = _context4.sent;\n if (!(document && document.data)) {\n _context4.next = 17;\n break;\n }\n _context4.next = 14;\n return self.gudhub.createDocument({\n app_id: appId,\n item_id: itemId,\n element_id: elementId,\n data: document.data\n });\n case 14:\n newDocument = _context4.sent;\n field.field_value = newDocument._id;\n itemsWithClonedDocument.push(item);\n case 17:\n _context4.next = 3;\n break;\n case 19:\n _context4.next = 24;\n break;\n case 21:\n _context4.prev = 21;\n _context4.t0 = _context4["catch"](1);\n _iterator.e(_context4.t0);\n case 24:\n _context4.prev = 24;\n _iterator.f();\n return _context4.finish(24);\n case 27:\n resolve(itemsWithClonedDocument);\n case 28:\n case "end":\n return _context4.stop();\n }\n }, _callee4, null, [[1, 21, 24, 27]]);\n }));\n return function (_x4) {\n return _ref4.apply(this, arguments);\n };\n }());\n }\n }, {\n key: "_replaceValueItemRef",\n value: function _replaceValueItemRef(app, field_of_list, map) {\n app.items_list.forEach(function (item) {\n item.fields.forEach(function (field_of_item) {\n if (field_of_item.field_id === field_of_list.field_id && field_of_item.field_value) {\n var arr_values = field_of_item.field_value.split(\',\');\n arr_values.forEach(function (one_value, key) {\n var value = one_value.split(\'.\');\n map.apps.forEach(function (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(function (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 }, {\n key: "_addFieldValue",\n value: function _addFieldValue(source_app_items, create_items, appsConnectingMap) {\n create_items.forEach(function (new_item) {\n appsConnectingMap.items.forEach(function (item_of_map) {\n if (new_item.item_id === item_of_map.new_item_id) {\n source_app_items.forEach(function (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 }, {\n key: "_updateMap",\n value: function _updateMap(new_items, old_items) {\n var _this4 = this;\n old_items.forEach(function (old_item) {\n new_items.forEach(function (new_item) {\n if (old_item.index_number === new_item.index_number) {\n _this4.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 }, {\n key: "_searchOldAppId",\n value: function _searchOldAppId(app_id, apps) {\n var findId = 0;\n apps.forEach(function (value) {\n if (value.new_app_id === app_id) {\n findId = value.old_app_id;\n }\n });\n return findId;\n }\n }, {\n key: "createApps",\n value: function createApps(pack, callback, installFromMaster) {\n var _this5 = this;\n var self = this;\n var progress = {\n step_size: 100 / (pack.apps.length * 3),\n apps: []\n };\n return new Promise(/*#__PURE__*/function () {\n var _ref5 = AppsTemplateService_asyncToGenerator(/*#__PURE__*/AppsTemplateService_regeneratorRuntime().mark(function _callee5(resolve) {\n var source_apps, created_apps, updated_apps, _yield$self$gudhub$re2, accesstoken, _iterator2, _step2, _loop;\n return AppsTemplateService_regeneratorRuntime().wrap(function _callee5$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n source_apps = {};\n created_apps = [];\n updated_apps = [];\n _context6.next = 5;\n return 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 case 5:\n _yield$self$gudhub$re2 = _context6.sent;\n accesstoken = _yield$self$gudhub$re2.accesstoken;\n _iterator2 = AppsTemplateService_createForOfIteratorHelper(pack.apps);\n _context6.prev = 8;\n _loop = /*#__PURE__*/AppsTemplateService_regeneratorRuntime().mark(function _loop() {\n var app_id, result_app, source_app, appTemplate;\n return AppsTemplateService_regeneratorRuntime().wrap(function _loop$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n app_id = _step2.value;\n if (!installFromMaster) {\n _context5.next = 7;\n break;\n }\n _context5.next = 4;\n return self.gudhub.req.axiosRequest({\n url: "https://gudhub.com/GudHub_Test/api/app/get?token=".concat(accesstoken, "&app_id=").concat(app_id),\n method: \'GET\'\n });\n case 4:\n result_app = _context5.sent;\n _context5.next = 10;\n break;\n case 7:\n _context5.next = 9;\n return self.gudhub.getApp(app_id);\n case 9:\n result_app = _context5.sent;\n case 10:\n callback ? callback.call(_this5, "GET APP: ".concat(result_app.app_name, " (App steps)")) : null;\n 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 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(function (created_app) {\n callback ? callback.call(_this5, "CREATE NEW APP: ".concat(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(function (created_app) {\n self.gudhub.updateApp(created_app).then(function (updated_app) {\n callback ? callback.call(_this5, "UPDATE APP: ".concat(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 case 20:\n case "end":\n return _context5.stop();\n }\n }, _loop);\n });\n _iterator2.s();\n case 11:\n if ((_step2 = _iterator2.n()).done) {\n _context6.next = 15;\n break;\n }\n return _context6.delegateYield(_loop(), "t0", 13);\n case 13:\n _context6.next = 11;\n break;\n case 15:\n _context6.next = 20;\n break;\n case 17:\n _context6.prev = 17;\n _context6.t1 = _context6["catch"](8);\n _iterator2.e(_context6.t1);\n case 20:\n _context6.prev = 20;\n _iterator2.f();\n return _context6.finish(20);\n case 23:\n case "end":\n return _context6.stop();\n }\n }, _callee5, null, [[8, 17, 20, 23]]);\n }));\n return function (_x5) {\n return _ref5.apply(this, arguments);\n };\n }());\n }\n }, {\n key: "mapApp",\n value: function 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(function (old_field) {\n new_app.field_list.forEach(function (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(function (old_view) {\n new_app.views_list.forEach(function (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 }, {\n key: "crawling",\n value: function crawling(object, action) {\n var properties = object === null ? [] : Object.keys(object);\n var self = this;\n if (properties.length > 0) {\n properties.forEach(function (prop) {\n var 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 }, {\n key: "resetViewsIds",\n value: function 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 }, {\n key: "connectApps",\n value: function connectApps(apps, appsConnectingMap, source_apps) {\n var self = this;\n apps.forEach(function (app) {\n appsConnectingMap.apps.forEach(function (appMap) {\n if (app.view_init === appMap.new_view_init) {\n appsConnectingMap.views.forEach(function (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 var fieldsArr = String(value).split(\',\'),\n newFieldsArr = [];\n appsConnectingMap.fields.forEach(function (field) {\n fieldsArr.forEach(function (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(function (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(function (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 var pron_name = \'container_id\';\n var old_app_id = appsConnectingMap.apps.find(function (appMap) {\n return appMap.new_app_id === app.app_id;\n }).old_app_id;\n var path = self.findPath(source_apps[old_app_id].views_list, pron_name, value);\n parent[prop] = "".concat(self.getValueByPath(app.views_list, path, pron_name));\n }\n if (prop.indexOf("trigger") !== -1 && value.model && value.model.nodes) {\n var nodes = value.model.nodes;\n var nodeProperties = ["inputs", "outputs"];\n var _loop2 = function _loop2(index) {\n nodeProperties.forEach(function (property) {\n var node = nodes[index];\n var numericProperties = Object.keys(node[property]).filter(function (prop) {\n return prop !== \'\' && !isNaN(prop);\n }); // field_id as keys\n\n numericProperties.forEach(function (old_field_id) {\n var correspondFieldOfConnectingMap = appsConnectingMap.fields.filter(function (field) {\n return field.old_field_id == old_field_id;\n });\n if (correspondFieldOfConnectingMap.length !== 0 && correspondFieldOfConnectingMap[0].new_field_id) {\n var new_field_id = correspondFieldOfConnectingMap[0].new_field_id.toString();\n var connectionObjectCopy = node[property][old_field_id];\n connectionObjectCopy.connections.forEach(function (connection) {\n if (connection.input == old_field_id) {\n connection.input = new_field_id;\n }\n if (connection.output == old_field_id) {\n connection.output = new_field_id;\n }\n });\n delete node[property][old_field_id];\n node[property][new_field_id] = connectionObjectCopy;\n }\n });\n });\n };\n for (var index in nodes) {\n _loop2(index);\n }\n ;\n }\n });\n });\n return apps;\n }\n }, {\n key: "getValueByPath",\n value: function getValueByPath(source, path, prop) {\n var temp = source;\n path.split(\'.\').forEach(function (item) {\n temp = temp[item];\n });\n return temp[prop];\n }\n }, {\n key: "findPath",\n value: function findPath(source, prop, value) {\n var self = this;\n var isFound = false;\n var toClearPath = false;\n var path = [];\n self.crawling(source, function (propSource, valueSource, parentSource) {\n if (toClearPath) {\n path.reverse().forEach(function (item) {\n if (toClearPath) {\n item["delete"] = true;\n if (item.parent === parentSource) {\n toClearPath = false;\n path = path.filter(function (item) {\n return !item["delete"];\n });\n path.reverse();\n }\n }\n });\n }\n if (!isFound) {\n if (AppsTemplateService_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 && AppsTemplateService_typeof(parentSource[propSource]) !== \'object\') {\n toClearPath = true;\n }\n }\n });\n return path.map(function (item) {\n return item.prop;\n }).join(\'.\');\n }\n }, {\n key: "prepareAppTemplate",\n value: function prepareAppTemplate(appToTemplate) {\n var self = this;\n var 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(function (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 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}();\n\n;// CONCATENATED MODULE: ./GUDHUB/Utils/FIleHelper/FileHelper.js\nfunction FileHelper_typeof(o) { "@babel/helpers - typeof"; return FileHelper_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, FileHelper_typeof(o); }\nfunction FileHelper_toConsumableArray(r) { return FileHelper_arrayWithoutHoles(r) || FileHelper_iterableToArray(r) || FileHelper_unsupportedIterableToArray(r) || FileHelper_nonIterableSpread(); }\nfunction FileHelper_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction FileHelper_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return FileHelper_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? FileHelper_arrayLikeToArray(r, a) : void 0; } }\nfunction FileHelper_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }\nfunction FileHelper_arrayWithoutHoles(r) { if (Array.isArray(r)) return FileHelper_arrayLikeToArray(r); }\nfunction FileHelper_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction FileHelper_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction FileHelper_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, FileHelper_toPropertyKey(o.key), o); } }\nfunction FileHelper_createClass(e, r, t) { return r && FileHelper_defineProperties(e.prototype, r), t && FileHelper_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction FileHelper_toPropertyKey(t) { var i = FileHelper_toPrimitive(t, "string"); return "symbol" == FileHelper_typeof(i) ? i : i + ""; }\nfunction FileHelper_toPrimitive(t, r) { if ("object" != FileHelper_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != FileHelper_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar FileHelper = /*#__PURE__*/function () {\n function FileHelper(gudhub) {\n FileHelper_classCallCheck(this, FileHelper);\n this.gudhub = gudhub;\n }\n return FileHelper_createClass(FileHelper, [{\n key: "fileInstallerHelper",\n value: function fileInstallerHelper(appId, items, elementId) {\n var self = this;\n return new Promise(function (resolve) {\n var files = [[]];\n var chainPromises = Promise.resolve();\n var results = [];\n items.forEach(function (item) {\n var itemId = item.item_id;\n var field = item.fields.find(function (field) {\n return field.element_id === elementId;\n });\n if (field && field.field_value) {\n var fileIds = field.field_value.split(\'.\');\n fileIds.forEach(function (fileId) {\n var 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(function (filePack) {\n chainPromises = chainPromises.then(function () {\n return self.gudhub.duplicateFile(filePack);\n }).then(function (result) {\n results = [].concat(FileHelper_toConsumableArray(results), FileHelper_toConsumableArray(result));\n });\n });\n chainPromises.then(function () {\n items.forEach(function (item) {\n var itemId = item.item_id;\n var field = item.fields.find(function (field) {\n return field.element_id === elementId;\n });\n if (field && field.field_value) {\n field.field_value = \'\';\n results.forEach(function (file) {\n if (file.item_id === itemId) {\n field.field_value = field.field_value.split(\',\').filter(function (fileId) {\n return fileId;\n }).concat(file.file_id).join(\',\');\n }\n });\n }\n });\n resolve();\n });\n });\n }\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/Utils/compareObjects/compareObjects.js\nfunction compareObjects_compareObjects(target, source) {\n return JSON.stringify(target) === JSON.stringify(source);\n}\n;// CONCATENATED MODULE: ./GUDHUB/Utils/dynamicPromiseAll/dynamicPromiseAll.js\nfunction dynamicPromiseAll_typeof(o) { "@babel/helpers - typeof"; return dynamicPromiseAll_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, dynamicPromiseAll_typeof(o); }\nfunction dynamicPromiseAll_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ dynamicPromiseAll_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == dynamicPromiseAll_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(dynamicPromiseAll_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction dynamicPromiseAll_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = dynamicPromiseAll_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }\nfunction dynamicPromiseAll_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return dynamicPromiseAll_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? dynamicPromiseAll_arrayLikeToArray(r, a) : void 0; } }\nfunction dynamicPromiseAll_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction dynamicPromiseAll_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction dynamicPromiseAll_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { dynamicPromiseAll_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { dynamicPromiseAll_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction dynamicPromiseAll_dynamicPromiseAll(_x) {\n return _dynamicPromiseAll.apply(this, arguments);\n}\nfunction _dynamicPromiseAll() {\n _dynamicPromiseAll = dynamicPromiseAll_asyncToGenerator(/*#__PURE__*/dynamicPromiseAll_regeneratorRuntime().mark(function _callee(promises) {\n var allDone, _iterator, _step, promise, result;\n return dynamicPromiseAll_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return Promise.all(promises);\n case 2:\n allDone = true;\n _iterator = dynamicPromiseAll_createForOfIteratorHelper(promises);\n _context.prev = 4;\n _iterator.s();\n case 6:\n if ((_step = _iterator.n()).done) {\n _context.next = 19;\n break;\n }\n promise = _step.value;\n _context.next = 10;\n return _checkPromiseStatus(promise);\n case 10:\n result = _context.sent;\n if (!(result.state === \'pending\')) {\n _context.next = 14;\n break;\n }\n allDone = false;\n return _context.abrupt("break", 19);\n case 14:\n if (!(result.state === \'rejected\')) {\n _context.next = 17;\n break;\n }\n throw result.reason;\n case 17:\n _context.next = 6;\n break;\n case 19:\n _context.next = 24;\n break;\n case 21:\n _context.prev = 21;\n _context.t0 = _context["catch"](4);\n _iterator.e(_context.t0);\n case 24:\n _context.prev = 24;\n _iterator.f();\n return _context.finish(24);\n case 27:\n if (!allDone) {\n _context.next = 29;\n break;\n }\n return _context.abrupt("return", true);\n case 29:\n return _context.abrupt("return", dynamicPromiseAll_dynamicPromiseAll(promises));\n case 30:\n case "end":\n return _context.stop();\n }\n }, _callee, null, [[4, 21, 24, 27]]);\n }));\n return _dynamicPromiseAll.apply(this, arguments);\n}\nfunction _checkPromiseStatus(promise) {\n var pending = {\n state: \'pending\'\n };\n return Promise.race([promise, pending]).then(function (value) {\n if (value === pending) {\n return value;\n }\n return {\n state: \'resolved\',\n value: value\n };\n }, function (reason) {\n return {\n state: \'rejected\',\n reason: reason\n };\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_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\nfunction Utils_typeof(o) { "@babel/helpers - typeof"; return Utils_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, Utils_typeof(o); }\nfunction Utils_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ Utils_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == Utils_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(Utils_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction Utils_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction Utils_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { Utils_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { Utils_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction Utils_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction Utils_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, Utils_toPropertyKey(o.key), o); } }\nfunction Utils_createClass(e, r, t) { return r && Utils_defineProperties(e.prototype, r), t && Utils_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction Utils_toPropertyKey(t) { var i = Utils_toPrimitive(t, "string"); return "symbol" == Utils_typeof(i) ? i : i + ""; }\nfunction Utils_toPrimitive(t, r) { if ("object" != Utils_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != Utils_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar Utils = /*#__PURE__*/function () {\n function Utils(gudhub) {\n Utils_classCallCheck(this, Utils);\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 return Utils_createClass(Utils, [{\n key: "prefilter",\n value: function prefilter(filters_list) {\n var variables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return filterPreparation(filters_list, this.gudhub.storage, this.gudhub.pipeService, variables);\n }\n }, {\n key: "filter",\n value: function filter(items, filter_list) {\n return filter_filter(items, filter_list);\n }\n }, {\n key: "mergeFilters",\n value: function mergeFilters(src, dest) {\n return mergeFilters_mergeFilters(src, dest);\n }\n }, {\n key: "group",\n value: function group(fieldGroup, items) {\n return group_group(fieldGroup, items);\n }\n }, {\n key: "getFilteredItems",\n value: function () {\n var _getFilteredItems = Utils_asyncToGenerator(/*#__PURE__*/Utils_regeneratorRuntime().mark(function _callee() {\n var items,\n filters_list,\n element_app_id,\n app_id,\n item_id,\n field_group,\n search,\n search_params,\n modified_filters_list,\n itemsList,\n newItems,\n _args = arguments;\n return Utils_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n items = _args.length > 0 && _args[0] !== undefined ? _args[0] : [];\n filters_list = _args.length > 1 && _args[1] !== undefined ? _args[1] : [];\n element_app_id = _args.length > 2 ? _args[2] : undefined;\n app_id = _args.length > 3 ? _args[3] : undefined;\n item_id = _args.length > 4 ? _args[4] : undefined;\n field_group = _args.length > 5 && _args[5] !== undefined ? _args[5] : "";\n search = _args.length > 6 ? _args[6] : undefined;\n search_params = _args.length > 7 ? _args[7] : undefined;\n _context.next = 10;\n return this.prefilter(filters_list, {\n element_app_id: element_app_id,\n app_id: app_id,\n item_id: item_id\n });\n case 10:\n modified_filters_list = _context.sent;\n itemsList = this.filter(items, modified_filters_list);\n newItems = this.group(field_group, itemsList);\n return _context.abrupt("return", newItems.filter(function (newItem) {\n if (search) {\n return searchValue([newItem], search).length === 1;\n } else return true;\n }).filter(function (newItem) {\n if (search_params) {\n return searchValue([newItem], search_params).length === 1;\n } else return true;\n }));\n case 14:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function getFilteredItems() {\n return _getFilteredItems.apply(this, arguments);\n }\n return getFilteredItems;\n }()\n }, {\n key: "jsonToItems",\n value: function jsonToItems(json, map) {\n return json_to_items_jsonToItems(json, map);\n }\n }, {\n key: "getDate",\n value: function getDate(queryKey) {\n return get_date_getDate(queryKey);\n }\n }, {\n key: "checkRecurringDate",\n value: function checkRecurringDate(date, option) {\n return get_date_checkRecurringDate(date, option);\n }\n }, {\n key: "populateItems",\n value: function populateItems(items, model, keep_data) {\n return populate_items_populateItems(items, model, keep_data);\n }\n }, {\n key: "populateWithDate",\n value: function populateWithDate(items, model) {\n return get_date_populateWithDate(items, model);\n }\n }, {\n key: "populateWithItemRef",\n value: function populateWithItemRef(sourceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id) {\n return merge_compare_items_populateWithItemRef(sourceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id);\n }\n\n //here\n }, {\n key: "compareItems",\n value: function compareItems(sourceItems, destinationItems, fieldToCompare) {\n return merge_compare_items_compareItems(sourceItems, destinationItems, fieldToCompare);\n }\n }, {\n key: "mergeItems",\n value: function mergeItems(sourceItems, destinationItems, mergeByFieldId) {\n return merge_compare_items_mergeItems(sourceItems, destinationItems, mergeByFieldId);\n }\n }, {\n key: "mergeObjects",\n value: function mergeObjects(target, source, optionsArgument) {\n return merge_objects_mergeObjects(target, source, optionsArgument);\n }\n }, {\n key: "makeNestedList",\n value: function makeNestedList(arr, id, parent_id, children_property, priority_property) {\n return nested_list_makeNestedList(arr, id, parent_id, children_property, priority_property);\n }\n }, {\n key: "mergeChunks",\n value: function () {\n var _mergeChunks2 = Utils_asyncToGenerator(/*#__PURE__*/Utils_regeneratorRuntime().mark(function _callee2(chunks) {\n return Utils_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt("return", merge_chunks_mergeChunks(chunks));\n case 1:\n case "end":\n return _context2.stop();\n }\n }, _callee2);\n }));\n function mergeChunks(_x) {\n return _mergeChunks2.apply(this, arguments);\n }\n return mergeChunks;\n }()\n }, {\n key: "mergeFieldLists",\n value: function mergeFieldLists(fieldsToView, fieldList) {\n return this.MergeFields.mergeFieldLists(fieldsToView, fieldList);\n }\n }, {\n key: "createFieldsListToView",\n value: function createFieldsListToView(appId, tableSettingsFieldListToView) {\n return this.MergeFields.createFieldsListToView(appId, tableSettingsFieldListToView);\n }\n }, {\n key: "createFieldsListToViewWithDataType",\n value: function createFieldsListToViewWithDataType(appId, tableSettingsFieldListToView) {\n return this.MergeFields.createFieldsListToViewWithDataType(appId, tableSettingsFieldListToView);\n }\n }, {\n key: "selectItems",\n value: function selectItems(appId, items) {\n return this.ItemsSelection.selectItems(appId, items);\n }\n }, {\n key: "getSelectedItems",\n value: function getSelectedItems(appId) {\n return this.ItemsSelection.getSelectedItems(appId);\n }\n }, {\n key: "clearSelectedItems",\n value: function clearSelectedItems(appId) {\n return this.ItemsSelection.clearSelectedItems(appId);\n }\n }, {\n key: "isItemSelected",\n value: function isItemSelected(appId, itemId) {\n return this.ItemsSelection.isItemSelected(appId, itemId);\n }\n }, {\n key: "jsonConstructor",\n value: function jsonConstructor(scheme, item, variables, appId) {\n return compiler(scheme, item, this, variables, appId);\n }\n }, {\n key: "fileInstallerHelper",\n value: function fileInstallerHelper(appId, items, elementId) {\n return this.FileHelper.fileInstallerHelper(appId, items, elementId);\n }\n }, {\n key: "createAppsFromTemplate",\n value: function createAppsFromTemplate(pack, maxNumberOfInsstalledItems, progressCallback, installFromMaster) {\n return this.AppsTemplateService.createAppsFromTemplate(pack, maxNumberOfInsstalledItems, progressCallback, installFromMaster);\n }\n }, {\n key: "createApps",\n value: function createApps(pack) {\n return this.AppsTemplateService.createApps(pack);\n }\n }, {\n key: "createItems",\n value: function createItems(create_apps, maxNumberOfInsstalledItems) {\n return this.AppsTemplateService.createItems(create_apps, maxNumberOfInsstalledItems);\n }\n }, {\n key: "areViewListsEqual",\n value: function areViewListsEqual(list1, list2) {\n var sortedList1 = list1.sort(function (e1, e2) {\n return e1.view_id - e2.view_id;\n });\n var sortedList2 = list2.sort(function (e1, e2) {\n return e1.view_id - e2.view_id;\n });\n return this.compareObjects(sortedList1, sortedList2);\n }\n }, {\n key: "areFieldListsEqual",\n value: function areFieldListsEqual(list1, list2) {\n var sortedList1 = list1.sort(function (e1, e2) {\n return e1.field_id - e2.field_id;\n });\n var sortedList2 = list2.sort(function (e1, e2) {\n return e1.field_id - e2.field_id;\n });\n return this.compareObjects(sortedList1, sortedList2);\n }\n }, {\n key: "compareObjects",\n value: function compareObjects(obj1, obj2) {\n return compareObjects_compareObjects(obj1, obj2);\n }\n\n //\n }, {\n key: "compareAppsItemsLists",\n value: function compareAppsItemsLists(items_list1, items_list2, callback) {\n var 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: items_list1,\n items_list2: items_list2\n });\n this.worker.addEventListener("message", function (event) {\n var diff = event.data.diff;\n callback(diff);\n });\n }\n }, {\n key: "dynamicPromiseAll",\n value: function dynamicPromiseAll(promisesArray) {\n return dynamicPromiseAll_dynamicPromiseAll(promisesArray);\n }\n }, {\n key: "sortItems",\n value: function sortItems(items, options) {\n return sortItems_sortItems(items, options);\n }\n }, {\n key: "debounce",\n value: function debounce(func, delay) {\n var timeoutId;\n return function () {\n var _this = this;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n clearTimeout(timeoutId);\n timeoutId = setTimeout(function () {\n func.apply(_this, args);\n }, delay);\n };\n }\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/Auth/Auth.js\nfunction Auth_typeof(o) { "@babel/helpers - typeof"; return Auth_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, Auth_typeof(o); }\nfunction Auth_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ Auth_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == Auth_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(Auth_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction Auth_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction Auth_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { Auth_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { Auth_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction Auth_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction Auth_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, Auth_toPropertyKey(o.key), o); } }\nfunction Auth_createClass(e, r, t) { return r && Auth_defineProperties(e.prototype, r), t && Auth_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction Auth_toPropertyKey(t) { var i = Auth_toPrimitive(t, "string"); return "symbol" == Auth_typeof(i) ? i : i + ""; }\nfunction Auth_toPrimitive(t, r) { if ("object" != Auth_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != Auth_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar Auth = /*#__PURE__*/function () {\n function Auth(req, storage) {\n Auth_classCallCheck(this, Auth);\n this.req = req;\n this.storage = storage;\n }\n return Auth_createClass(Auth, [{\n key: "login",\n value: function () {\n var _login = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee() {\n var _ref,\n username,\n password,\n user,\n _args = arguments;\n return Auth_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _ref = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, username = _ref.username, password = _ref.password;\n _context.next = 3;\n return this.loginApi(username, password);\n case 3:\n user = _context.sent;\n this.storage.updateUser(user);\n return _context.abrupt("return", user);\n case 6:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function login() {\n return _login.apply(this, arguments);\n }\n return login;\n }()\n }, {\n key: "loginWithToken",\n value: function () {\n var _loginWithToken = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee2(token) {\n var user;\n return Auth_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this.loginWithTokenApi(token);\n case 2:\n user = _context2.sent;\n this.storage.updateUser(user);\n return _context2.abrupt("return", user);\n case 5:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function loginWithToken(_x) {\n return _loginWithToken.apply(this, arguments);\n }\n return loginWithToken;\n }()\n }, {\n key: "logout",\n value: function () {\n var _logout = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee3(token) {\n var response;\n return Auth_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return this.logoutApi(token);\n case 2:\n response = _context3.sent;\n return _context3.abrupt("return", response);\n case 4:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function logout(_x2) {\n return _logout.apply(this, arguments);\n }\n return logout;\n }()\n }, {\n key: "signup",\n value: function () {\n var _signup = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee4(user) {\n var newUser;\n return Auth_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return this.signupApi(user);\n case 2:\n newUser = _context4.sent;\n return _context4.abrupt("return", newUser);\n case 4:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function signup(_x3) {\n return _signup.apply(this, arguments);\n }\n return signup;\n }()\n }, {\n key: "updateToken",\n value: function () {\n var _updateToken = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee5(auth_key) {\n var user;\n return Auth_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return this.updateTokenApi(auth_key);\n case 2:\n user = _context5.sent;\n return _context5.abrupt("return", user);\n case 4:\n case "end":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function updateToken(_x4) {\n return _updateToken.apply(this, arguments);\n }\n return updateToken;\n }()\n }, {\n key: "updateUser",\n value: function () {\n var _updateUser = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee6(userData) {\n var user;\n return Auth_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return this.updateUserApi(userData);\n case 2:\n user = _context6.sent;\n this.storage.updateUser(user);\n return _context6.abrupt("return", user);\n case 5:\n case "end":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function updateUser(_x5) {\n return _updateUser.apply(this, arguments);\n }\n return updateUser;\n }()\n }, {\n key: "updateAvatar",\n value: function () {\n var _updateAvatar = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee7(imageData) {\n var user;\n return Auth_regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _context7.next = 2;\n return this.avatarUploadApi(imageData);\n case 2:\n user = _context7.sent;\n this.storage.updateUser(user);\n return _context7.abrupt("return", user);\n case 5:\n case "end":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function updateAvatar(_x6) {\n return _updateAvatar.apply(this, arguments);\n }\n return updateAvatar;\n }()\n }, {\n key: "getUsersList",\n value: function () {\n var _getUsersList = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee8(keyword) {\n var usersList;\n return Auth_regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n _context8.next = 2;\n return this.getUsersListApi(keyword);\n case 2:\n usersList = _context8.sent;\n return _context8.abrupt("return", usersList);\n case 4:\n case "end":\n return _context8.stop();\n }\n }, _callee8, this);\n }));\n function getUsersList(_x7) {\n return _getUsersList.apply(this, arguments);\n }\n return getUsersList;\n }()\n }, {\n key: "loginApi",\n value: function () {\n var _loginApi = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee9(username, password) {\n var user;\n return Auth_regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n _context9.prev = 0;\n _context9.next = 3;\n return this.req.axiosRequest({\n method: \'POST\',\n url: "".concat(this.req.root, "/auth/login"),\n form: {\n username: username,\n password: password\n }\n });\n case 3:\n user = _context9.sent;\n return _context9.abrupt("return", user);\n case 7:\n _context9.prev = 7;\n _context9.t0 = _context9["catch"](0);\n console.log(_context9.t0);\n case 10:\n case "end":\n return _context9.stop();\n }\n }, _callee9, this, [[0, 7]]);\n }));\n function loginApi(_x8, _x9) {\n return _loginApi.apply(this, arguments);\n }\n return loginApi;\n }()\n }, {\n key: "loginWithTokenApi",\n value: function () {\n var _loginWithTokenApi = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee10(token) {\n var user;\n return Auth_regeneratorRuntime().wrap(function _callee10$(_context10) {\n while (1) switch (_context10.prev = _context10.next) {\n case 0:\n _context10.prev = 0;\n _context10.next = 3;\n return this.req.axiosRequest({\n method: \'POST\',\n url: "".concat(this.req.root, "/auth/login?accesstoken=").concat(token)\n });\n case 3:\n user = _context10.sent;\n return _context10.abrupt("return", user);\n case 7:\n _context10.prev = 7;\n _context10.t0 = _context10["catch"](0);\n console.log(_context10.t0);\n case 10:\n case "end":\n return _context10.stop();\n }\n }, _callee10, this, [[0, 7]]);\n }));\n function loginWithTokenApi(_x10) {\n return _loginWithTokenApi.apply(this, arguments);\n }\n return loginWithTokenApi;\n }()\n }, {\n key: "updateTokenApi",\n value: function () {\n var _updateTokenApi = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee11(auth_key) {\n var user;\n return Auth_regeneratorRuntime().wrap(function _callee11$(_context11) {\n while (1) switch (_context11.prev = _context11.next) {\n case 0:\n _context11.prev = 0;\n _context11.next = 3;\n return this.req.axiosRequest({\n method: \'POST\',\n url: "".concat(this.req.root, "/auth/login"),\n form: {\n auth_key: auth_key\n }\n });\n case 3:\n user = _context11.sent;\n return _context11.abrupt("return", user);\n case 7:\n _context11.prev = 7;\n _context11.t0 = _context11["catch"](0);\n console.log(_context11.t0);\n case 10:\n case "end":\n return _context11.stop();\n }\n }, _callee11, this, [[0, 7]]);\n }));\n function updateTokenApi(_x11) {\n return _updateTokenApi.apply(this, arguments);\n }\n return updateTokenApi;\n }()\n }, {\n key: "logoutApi",\n value: function logoutApi(token) {\n return this.req.post({\n url: "/auth/logout",\n form: {\n token: token\n }\n });\n }\n }, {\n key: "signupApi",\n value: function signupApi(user) {\n return this.req.axiosRequest({\n method: \'POST\',\n url: "".concat(this.req.root, "/auth/singup"),\n form: {\n user: JSON.stringify(user)\n }\n });\n }\n }, {\n key: "getUsersListApi",\n value: function getUsersListApi(keyword) {\n return this.req.get({\n url: "/auth/userlist",\n params: {\n keyword: keyword\n }\n });\n }\n }, {\n key: "updateUserApi",\n value: function updateUserApi(userData) {\n return this.req.post({\n url: "/auth/updateuser",\n form: {\n user: JSON.stringify(userData)\n }\n });\n }\n }, {\n key: "avatarUploadApi",\n value: function avatarUploadApi(image) {\n return this.req.post({\n url: "/auth/avatar-upload",\n form: {\n image: image\n }\n });\n }\n }, {\n key: "getUserByIdApi",\n value: function getUserByIdApi(id) {\n return this.req.get({\n url: "/auth/getuserbyid",\n params: {\n id: id\n }\n });\n }\n }, {\n key: "getVersion",\n value: function getVersion() {\n return this.req.get({\n url: "/version"\n });\n }\n }, {\n key: "getUserFromStorage",\n value: function getUserFromStorage(id) {\n return this.storage.getUsersList().find(function (user) {\n return user.user_id == id;\n });\n }\n }, {\n key: "saveUserToStorage",\n value: function saveUserToStorage(saveUser) {\n var usersList = this.storage.getUsersList();\n var userInStorage = usersList.find(function (user) {\n return user.user_id == saveUser.user_id;\n });\n if (!userInStorage) {\n usersList.push(saveUser);\n return saveUser;\n }\n return userInStorage;\n }\n }, {\n key: "getUserById",\n value: function () {\n var _getUserById = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee12(userId) {\n var user, receivedUser;\n return Auth_regeneratorRuntime().wrap(function _callee12$(_context12) {\n while (1) switch (_context12.prev = _context12.next) {\n case 0:\n user = this.getUserFromStorage(userId);\n if (user) {\n _context12.next = 9;\n break;\n }\n _context12.next = 4;\n return this.getUserByIdApi(userId);\n case 4:\n receivedUser = _context12.sent;\n if (receivedUser) {\n _context12.next = 7;\n break;\n }\n return _context12.abrupt("return", null);\n case 7:\n user = this.getUserFromStorage(userId);\n if (!user) {\n this.saveUserToStorage(receivedUser);\n user = receivedUser;\n }\n case 9:\n return _context12.abrupt("return", user);\n case 10:\n case "end":\n return _context12.stop();\n }\n }, _callee12, this);\n }));\n function getUserById(_x12) {\n return _getUserById.apply(this, arguments);\n }\n return getUserById;\n }()\n }, {\n key: "getToken",\n value: function () {\n var _getToken = Auth_asyncToGenerator(/*#__PURE__*/Auth_regeneratorRuntime().mark(function _callee13() {\n var expiryDate, currentDate, accesstoken, user;\n return Auth_regeneratorRuntime().wrap(function _callee13$(_context13) {\n while (1) switch (_context13.prev = _context13.next) {\n case 0:\n expiryDate = new Date(this.storage.getUser().expirydate);\n currentDate = new Date();\n accesstoken = this.storage.getUser().accesstoken;\n /*-- checking if token exists and if it\'s not expired*/\n if (!(expiryDate < currentDate || !accesstoken)) {\n _context13.next = 9;\n break;\n }\n _context13.next = 6;\n return this.updateToken(this.storage.getUser().auth_key);\n case 6:\n user = _context13.sent;\n this.storage.updateUser(user);\n accesstoken = user.accesstoken;\n case 9:\n return _context13.abrupt("return", accesstoken);\n case 10:\n case "end":\n return _context13.stop();\n }\n }, _callee13, this);\n }));\n function getToken() {\n return _getToken.apply(this, arguments);\n }\n return getToken;\n }()\n }]);\n}();\n// EXTERNAL MODULE: ./GUDHUB/GHConstructor/createAngularModuleInstance.js\nvar createAngularModuleInstance = __webpack_require__(3147);\n;// CONCATENATED MODULE: ./GUDHUB/GHConstructor/createClassInstance.js\nfunction createClassInstance_typeof(o) { "@babel/helpers - typeof"; return createClassInstance_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, createClassInstance_typeof(o); }\nfunction createClassInstance_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ createClassInstance_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == createClassInstance_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(createClassInstance_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction createClassInstance_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction createClassInstance_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { createClassInstance_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { createClassInstance_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\n\n\nfunction createClassInstance(_x, _x2, _x3, _x4, _x5) {\n return _createClassInstance.apply(this, arguments);\n}\nfunction _createClassInstance() {\n _createClassInstance = createClassInstance_asyncToGenerator(/*#__PURE__*/createClassInstance_regeneratorRuntime().mark(function _callee6(gudhub, module_id, js_url, css_url, nodeWindow) {\n var downloadModule, moduleData, module, importedClass, linkTag, result;\n return createClassInstance_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.prev = 0;\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 - ".concat(module_id));\n }\n\n // Import module using dynamic import\n downloadModule = function downloadModule(url) {\n if (!consts/* IS_BROWSER_MAIN_THREAD */.tH && !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 = function (command) {\n console.log(\'QUERY COMMAND SUPPORTED: \', command);\n return false;\n };\n global.angular = angular;\n }\n return new Promise(/*#__PURE__*/function () {\n var _ref = createClassInstance_asyncToGenerator(/*#__PURE__*/createClassInstance_regeneratorRuntime().mark(function _callee(resolve) {\n var moduleData, encodedJs, dataUri;\n return createClassInstance_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return axios.get(url)["catch"](function (err) {\n console.log("Failed to fetch: ".concat(url, " in ghconstructor. Module id: ").concat(module_id));\n });\n case 2:\n moduleData = _context.sent;\n encodedJs = encodeURIComponent(moduleData.data);\n dataUri = \'data:text/javascript;charset=utf-8,\' + encodedJs;\n resolve(dataUri);\n case 6:\n case "end":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x6) {\n return _ref.apply(this, arguments);\n };\n }());\n };\n _context6.next = 5;\n return downloadModule(js_url);\n case 5:\n moduleData = _context6.sent;\n _context6.prev = 6;\n _context6.next = 9;\n return import(/* webpackIgnore: true */moduleData);\n case 9:\n module = _context6.sent;\n _context6.next = 16;\n break;\n case 12:\n _context6.prev = 12;\n _context6.t0 = _context6["catch"](6);\n console.log("Error while importing module: ".concat(module_id));\n console.log(_context6.t0);\n case 16:\n // Creating class from imported module\n importedClass = new module["default"](module_id); // 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 if (css_url && consts/* IS_BROWSER_MAIN_THREAD */.tH) {\n 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 result = {\n type: module_id,\n //*************** GET TEMPLATE ****************//\n\n getTemplate: function getTemplate(ref, changeFieldName, displayFieldName, field_model, appId, itemId) {\n var 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 getDefaultValue(fieldModel, valuesArray, itemsList, currentAppId) {\n return new Promise(/*#__PURE__*/function () {\n var _ref2 = createClassInstance_asyncToGenerator(/*#__PURE__*/createClassInstance_regeneratorRuntime().mark(function _callee2(resolve) {\n var getValueFunction, value;\n return createClassInstance_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n getValueFunction = importedClass.getDefaultValue;\n if (!getValueFunction) {\n _context2.next = 8;\n break;\n }\n _context2.next = 4;\n return getValueFunction(fieldModel, valuesArray, itemsList, currentAppId);\n case 4:\n value = _context2.sent;\n resolve(value);\n _context2.next = 9;\n break;\n case 8:\n resolve(null);\n case 9:\n case "end":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function (_x7) {\n return _ref2.apply(this, arguments);\n };\n }());\n },\n //*************** GET SETTINGS ****************//\n\n getSettings: function getSettings(scope, settingType, fieldModels) {\n return importedClass.getSettings(scope, settingType, fieldModels);\n },\n //*************** FILTER****************//\n\n filter: {\n getSearchOptions: function getSearchOptions(fieldModel) {\n var 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 getDropdownValues() {\n var 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 getInterpretation(value, interpretation_id, dataType, field, itemId, appId) {\n return new Promise(/*#__PURE__*/function () {\n var _ref3 = createClassInstance_asyncToGenerator(/*#__PURE__*/createClassInstance_regeneratorRuntime().mark(function _callee3(resolve) {\n var currentDataType, interpr_arr, data, _result;\n return createClassInstance_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n currentDataType = importedClass;\n _context3.prev = 1;\n _context3.next = 4;\n return currentDataType.getInterpretation(gudhub, value, appId, itemId, field, dataType);\n case 4:\n interpr_arr = _context3.sent;\n data = interpr_arr.find(function (item) {\n return item.id == interpretation_id;\n }) || interpr_arr.find(function (item) {\n return item.id == \'default\';\n });\n _context3.next = 8;\n return data.content();\n case 8:\n _result = _context3.sent;\n resolve({\n html: _result\n });\n _context3.next = 16;\n break;\n case 12:\n _context3.prev = 12;\n _context3.t0 = _context3["catch"](1);\n console.log("ERROR IN ".concat(module_id), _context3.t0);\n resolve({\n html: \'<span>no interpretation</span>\'\n });\n case 16:\n case "end":\n return _context3.stop();\n }\n }, _callee3, null, [[1, 12]]);\n }));\n return function (_x8) {\n return _ref3.apply(this, arguments);\n };\n }());\n },\n //*************** GET INTERPRETATIONS LIST ****************//\n\n getInterpretationsList: function getInterpretationsList(field_value, appId, itemId, field) {\n return importedClass.getInterpretation(field_value, appId, itemId, field);\n },\n //*************** GET INTERPRETATED VALUE ****************//\n\n getInterpretatedValue: function getInterpretatedValue(field_value, field_model, appId, itemId) {\n return new Promise(/*#__PURE__*/function () {\n var _ref4 = createClassInstance_asyncToGenerator(/*#__PURE__*/createClassInstance_regeneratorRuntime().mark(function _callee4(resolve) {\n var getInterpretatedValueFunction, value;\n return createClassInstance_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n getInterpretatedValueFunction = importedClass.getInterpretatedValue;\n if (!getInterpretatedValueFunction) {\n _context4.next = 8;\n break;\n }\n _context4.next = 4;\n return getInterpretatedValueFunction(field_value, field_model, appId, itemId);\n case 4:\n value = _context4.sent;\n resolve(value);\n _context4.next = 9;\n break;\n case 8:\n resolve(field_value);\n case 9:\n case "end":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return function (_x9) {\n return _ref4.apply(this, arguments);\n };\n }());\n },\n //*************** ON MESSAGE ****************//\n\n onMessage: function onMessage(appId, userId, response) {\n return new Promise(/*#__PURE__*/function () {\n var _ref5 = createClassInstance_asyncToGenerator(/*#__PURE__*/createClassInstance_regeneratorRuntime().mark(function _callee5(resolve) {\n var onMessageFunction, _result2;\n return createClassInstance_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n onMessageFunction = importedClass.onMessage;\n if (!onMessageFunction) {\n _context5.next = 6;\n break;\n }\n _context5.next = 4;\n return onMessageFunction(appId, userId, response);\n case 4:\n _result2 = _context5.sent;\n resolve(_result2);\n case 6:\n resolve(null);\n case 7:\n case "end":\n return _context5.stop();\n }\n }, _callee5);\n }));\n return function (_x10) {\n return _ref5.apply(this, arguments);\n };\n }());\n },\n //*************** EXTEND CONTROLLER ****************//\n\n extendController: function extendController(actionScope) {\n importedClass.getActionScope(actionScope);\n },\n //*************** RUN ACTION ****************//\n\n runAction: function runAction(scope) {\n try {\n importedClass.runAction(scope);\n } catch (e) {}\n },\n //*************** GET WINDOW SCOPE ****************//\n\n getWindowScope: function getWindowScope(windowScope) {\n return importedClass.getWindowScope(windowScope);\n },\n //*************** GET WINDOW HTML ****************//\n\n getWindowHTML: function getWindowHTML(scope) {\n return importedClass.getWindowHTML(scope);\n }\n };\n return _context6.abrupt("return", result);\n case 22:\n _context6.prev = 22;\n _context6.t1 = _context6["catch"](0);\n console.log(_context6.t1);\n console.log("Failed in createClassInstance (ghconstructor). Module id: ".concat(module_id, ". JS url: ").concat(js_url));\n case 26:\n case "end":\n return _context6.stop();\n }\n }, _callee6, null, [[0, 22], [6, 12]]);\n }));\n return _createClassInstance.apply(this, arguments);\n}\n;// CONCATENATED MODULE: ./GUDHUB/GHConstructor/ghconstructor.js\nfunction ghconstructor_typeof(o) { "@babel/helpers - typeof"; return ghconstructor_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, ghconstructor_typeof(o); }\nfunction ghconstructor_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ ghconstructor_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == ghconstructor_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(ghconstructor_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction ghconstructor_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction ghconstructor_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { ghconstructor_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { ghconstructor_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction ghconstructor_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction ghconstructor_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, ghconstructor_toPropertyKey(o.key), o); } }\nfunction ghconstructor_createClass(e, r, t) { return r && ghconstructor_defineProperties(e.prototype, r), t && ghconstructor_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction ghconstructor_toPropertyKey(t) { var i = ghconstructor_toPrimitive(t, "string"); return "symbol" == ghconstructor_typeof(i) ? i : i + ""; }\nfunction ghconstructor_toPrimitive(t, r) { if ("object" != ghconstructor_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != ghconstructor_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\n\n\nvar GHConstructor = /*#__PURE__*/function () {\n function GHConstructor(gudhub) {\n ghconstructor_classCallCheck(this, GHConstructor);\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 return ghconstructor_createClass(GHConstructor, [{\n key: "getInstance",\n value: (function () {\n var _getInstance = ghconstructor_asyncToGenerator(/*#__PURE__*/ghconstructor_regeneratorRuntime().mark(function _callee(module_id) {\n return ghconstructor_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!this.getCached(module_id)) {\n _context.next = 4;\n break;\n }\n return _context.abrupt("return", this.getCached(module_id));\n case 4:\n if (!this.modulesQueue[module_id]) {\n _context.next = 9;\n break;\n }\n _context.next = 7;\n return this.modulesQueue[module_id];\n case 7:\n _context.next = 12;\n break;\n case 9:\n this.modulesQueue[module_id] = this.createInstance(module_id);\n _context.next = 12;\n return this.modulesQueue[module_id];\n case 12:\n return _context.abrupt("return", this.getCached(module_id));\n case 13:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function getInstance(_x) {\n return _getInstance.apply(this, arguments);\n }\n return getInstance;\n }()\n /*************** PUT TO CACHE ***************/\n // Just pushing module to cache.\n )\n }, {\n key: "pupToCache",\n value: function 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 key: "getCached",\n value: function 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 key: "initAngularInjector",\n value: function 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 key: "initJsdomWindow",\n value: function 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 key: "createInstance",\n value: (function () {\n var _createInstance = ghconstructor_asyncToGenerator(/*#__PURE__*/ghconstructor_regeneratorRuntime().mark(function _callee2(module_id) {\n var module, result;\n return ghconstructor_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n module = this.gudhub.storage.getModuleUrl(module_id);\n if (module) {\n _context2.next = 4;\n break;\n }\n console.log("Cannot find module: ".concat(module_id));\n return _context2.abrupt("return");\n case 4:\n if (!(module.type === \'gh_element\')) {\n _context2.next = 15;\n break;\n }\n if (!(module.technology === \'angular\')) {\n _context2.next = 11;\n break;\n }\n _context2.next = 8;\n return (0,createAngularModuleInstance/* default */.A)(this.gudhub, module_id, module.url, this.angularInjector, this.nodeWindow);\n case 8:\n result = _context2.sent;\n _context2.next = 15;\n break;\n case 11:\n if (!(module.technology === \'class\')) {\n _context2.next = 15;\n break;\n }\n _context2.next = 14;\n return createClassInstance(this.gudhub, module_id, module.js, module.css, this.nodeWindow);\n case 14:\n result = _context2.sent;\n case 15:\n if (result) {\n this.pupToCache(module_id, result);\n }\n return _context2.abrupt("return", result);\n case 17:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function createInstance(_x2) {\n return _createInstance.apply(this, arguments);\n }\n return createInstance;\n }())\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/AppProcessor/AppProcessor.js\nfunction AppProcessor_typeof(o) { "@babel/helpers - typeof"; return AppProcessor_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, AppProcessor_typeof(o); }\nfunction AppProcessor_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction AppProcessor_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? AppProcessor_ownKeys(Object(t), !0).forEach(function (r) { AppProcessor_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : AppProcessor_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction AppProcessor_defineProperty(e, r, t) { return (r = AppProcessor_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction AppProcessor_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = AppProcessor_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }\nfunction AppProcessor_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return AppProcessor_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? AppProcessor_arrayLikeToArray(r, a) : void 0; } }\nfunction AppProcessor_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction AppProcessor_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ AppProcessor_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == AppProcessor_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(AppProcessor_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction AppProcessor_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction AppProcessor_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { AppProcessor_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { AppProcessor_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction AppProcessor_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction AppProcessor_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, AppProcessor_toPropertyKey(o.key), o); } }\nfunction AppProcessor_createClass(e, r, t) { return r && AppProcessor_defineProperties(e.prototype, r), t && AppProcessor_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction AppProcessor_toPropertyKey(t) { var i = AppProcessor_toPrimitive(t, "string"); return "symbol" == AppProcessor_typeof(i) ? i : i + ""; }\nfunction AppProcessor_toPrimitive(t, r) { if ("object" != AppProcessor_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != AppProcessor_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\n\nvar AppProcessor = /*#__PURE__*/function () {\n function AppProcessor(storage, pipeService, req, websocket,\n // chunksManager,\n util, activateSW, dataService) {\n AppProcessor_classCallCheck(this, AppProcessor);\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 return AppProcessor_createClass(AppProcessor, [{\n key: "createNewAppApi",\n value: function () {\n var _createNewAppApi = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee(app) {\n var response;\n return AppProcessor_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return this.req.post({\n url: "/api/app/create",\n form: {\n app: JSON.stringify(app)\n }\n });\n case 3:\n response = _context.sent;\n response.from_apps_list = true;\n return _context.abrupt("return", response);\n case 8:\n _context.prev = 8;\n _context.t0 = _context["catch"](0);\n console.log(_context.t0);\n return _context.abrupt("return", null);\n case 12:\n case "end":\n return _context.stop();\n }\n }, _callee, this, [[0, 8]]);\n }));\n function createNewAppApi(_x) {\n return _createNewAppApi.apply(this, arguments);\n }\n return createNewAppApi;\n }()\n }, {\n key: "updateAppApi",\n value: function () {\n var _updateAppApi = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee2(app) {\n var response;\n return AppProcessor_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.prev = 0;\n _context2.next = 3;\n return this.req.post({\n url: "/api/app/update",\n form: {\n app: JSON.stringify(app)\n }\n });\n case 3:\n response = _context2.sent;\n return _context2.abrupt("return", response);\n case 7:\n _context2.prev = 7;\n _context2.t0 = _context2["catch"](0);\n console.log(_context2.t0);\n return _context2.abrupt("return", null);\n case 11:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this, [[0, 7]]);\n }));\n function updateAppApi(_x2) {\n return _updateAppApi.apply(this, arguments);\n }\n return updateAppApi;\n }()\n }, {\n key: "deleteAppApi",\n value: function () {\n var _deleteAppApi = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee3(app_id) {\n var response;\n return AppProcessor_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.prev = 0;\n _context3.next = 3;\n return this.req.post({\n url: "/api/app/delete",\n form: {\n app_id: app_id\n }\n });\n case 3:\n response = _context3.sent;\n return _context3.abrupt("return", response);\n case 7:\n _context3.prev = 7;\n _context3.t0 = _context3["catch"](0);\n console.log(_context3.t0);\n return _context3.abrupt("return", null);\n case 11:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this, [[0, 7]]);\n }));\n function deleteAppApi(_x3) {\n return _deleteAppApi.apply(this, arguments);\n }\n return deleteAppApi;\n }()\n }, {\n key: "getAppListApi",\n value: function () {\n var _getAppListApi = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee4() {\n var response;\n return AppProcessor_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.prev = 0;\n _context4.next = 3;\n return this.req.get({\n url: "/api/applist/get"\n });\n case 3:\n response = _context4.sent;\n return _context4.abrupt("return", response.apps_list.map(function (app) {\n app.from_apps_list = true;\n return app;\n }));\n case 7:\n _context4.prev = 7;\n _context4.t0 = _context4["catch"](0);\n console.log(_context4.t0);\n return _context4.abrupt("return", null);\n case 11:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this, [[0, 7]]);\n }));\n function getAppListApi() {\n return _getAppListApi.apply(this, arguments);\n }\n return getAppListApi;\n }()\n }, {\n key: "getAppListFromStorage",\n value: function getAppListFromStorage() {\n return this.storage.getAppsList();\n }\n }, {\n key: "getAppFromStorage",\n value: function getAppFromStorage(app_id) {\n var app = this.storage.getApp(app_id);\n return app && app.field_list.length ? app : null;\n }\n }, {\n key: "addNewAppToStorage",\n value: function addNewAppToStorage(app) {\n return this.storage.getAppsList().push(app);\n }\n }, {\n key: "saveAppInStorage",\n value: function saveAppInStorage(app) {\n app.items_object = {};\n for (var item = 0; item < app.items_list.length; item++) {\n app.items_object[app.items_list[item].item_id] = {};\n for (var 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 var 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 }, {\n key: "updateAppFieldsAndViews",\n value: function updateAppFieldsAndViews(app) {\n var _this = this;\n var 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(function (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 }, {\n key: "updateAppInStorage",\n value: function updateAppInStorage(app) {\n var 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 }, {\n key: "deletingAppFromStorage",\n value: function deletingAppFromStorage(app_id) {\n var appList = this.storage.getAppsList();\n appList.forEach(function (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 }, {\n key: "updateAppsListInStorage",\n value: function updateAppsListInStorage() {\n var appsList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var _iterator = AppProcessor_createForOfIteratorHelper(appsList),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var app = _step.value;\n var 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 } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n }, {\n key: "refreshApps",\n value: function () {\n var _refreshApps = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee5() {\n var apps_id,\n _iterator2,\n _step2,\n app_id,\n app,\n item,\n field,\n _args5 = arguments;\n return AppProcessor_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n apps_id = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : [];\n _iterator2 = AppProcessor_createForOfIteratorHelper(apps_id);\n _context5.prev = 2;\n _iterator2.s();\n case 4:\n if ((_step2 = _iterator2.n()).done) {\n _context5.next = 19;\n break;\n }\n app_id = _step2.value;\n if (!(app_id != undefined)) {\n _context5.next = 17;\n break;\n }\n _context5.prev = 7;\n _context5.next = 10;\n return this.dataService.getApp(app_id);\n case 10:\n app = _context5.sent;\n if (app) {\n app.items_object = {};\n for (item = 0; item < app.items_list.length; item++) {\n app.items_object[app.items_list[item].item_id] = {};\n for (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 _context5.next = 17;\n break;\n case 14:\n _context5.prev = 14;\n _context5.t0 = _context5["catch"](7);\n console.log(_context5.t0);\n case 17:\n _context5.next = 4;\n break;\n case 19:\n _context5.next = 24;\n break;\n case 21:\n _context5.prev = 21;\n _context5.t1 = _context5["catch"](2);\n _iterator2.e(_context5.t1);\n case 24:\n _context5.prev = 24;\n _iterator2.f();\n return _context5.finish(24);\n case 27:\n console.log("Apps refreshed: ", JSON.stringify(apps_id));\n case 28:\n case "end":\n return _context5.stop();\n }\n }, _callee5, this, [[2, 21, 24, 27], [7, 14]]);\n }));\n function refreshApps() {\n return _refreshApps.apply(this, arguments);\n }\n return refreshApps;\n }()\n }, {\n key: "refreshAppsList",\n value: function () {\n var _refreshAppsList = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee6() {\n var currentAppsList, appsListFromApi, mergedAppsList;\n return AppProcessor_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n currentAppsList = this.getAppListFromStorage();\n _context6.next = 3;\n return this.getAppListApi();\n case 3:\n appsListFromApi = _context6.sent;\n mergedAppsList = appsListFromApi.map(function (apiApp) {\n return AppProcessor_objectSpread(AppProcessor_objectSpread({}, apiApp), currentAppsList.find(function (app) {\n return app.app_id === apiApp.app_id;\n }));\n });\n this.updateAppsListInStorage(mergedAppsList);\n this.pipeService.emit(\'gh_apps_list_refreshed\', {});\n case 7:\n case "end":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function refreshAppsList() {\n return _refreshAppsList.apply(this, arguments);\n }\n return refreshAppsList;\n }()\n }, {\n key: "getAppsList",\n value: function () {\n var _getAppsList = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee7() {\n var app_list, received_app_list;\n return AppProcessor_regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n app_list = this.getAppListFromStorage();\n if (this.applistReceived) {\n _context7.next = 10;\n break;\n }\n _context7.next = 4;\n return this.getAppListApi();\n case 4:\n received_app_list = _context7.sent;\n if (received_app_list) {\n _context7.next = 7;\n break;\n }\n return _context7.abrupt("return", null);\n case 7:\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); // commented due to unfinished app_init development, its shape causes exceptions\n case 10:\n return _context7.abrupt("return", app_list);\n case 11:\n case "end":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function getAppsList() {\n return _getAppsList.apply(this, arguments);\n }\n return getAppsList;\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 }, {\n key: "getAppInfo",\n value: function () {\n var _getAppInfo = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee8(app_id) {\n var app_list;\n return AppProcessor_regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n _context8.next = 2;\n return this.getAppsList();\n case 2:\n app_list = _context8.sent;\n return _context8.abrupt("return", app_list ? app_list.find(function (app) {\n return app.app_id == app_id;\n }) : null);\n case 4:\n case "end":\n return _context8.stop();\n }\n }, _callee8, this);\n }));\n function getAppInfo(_x4) {\n return _getAppInfo.apply(this, arguments);\n }\n return getAppInfo;\n }()\n }, {\n key: "deleteApp",\n value: function () {\n var _deleteApp = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee9(app_id) {\n return AppProcessor_regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n _context9.next = 2;\n return this.deleteAppApi(app_id);\n case 2:\n return _context9.abrupt("return", this.deletingAppFromStorage(app_id));\n case 3:\n case "end":\n return _context9.stop();\n }\n }, _callee9, this);\n }));\n function deleteApp(_x5) {\n return _deleteApp.apply(this, arguments);\n }\n return deleteApp;\n }()\n }, {\n key: "getApp",\n value: function () {\n var _getApp = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee11(app_id) {\n var trash,\n app,\n self,\n pr,\n _args11 = arguments;\n return AppProcessor_regeneratorRuntime().wrap(function _callee11$(_context11) {\n while (1) switch (_context11.prev = _context11.next) {\n case 0:\n trash = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : false;\n if (app_id) {\n _context11.next = 3;\n break;\n }\n return _context11.abrupt("return", null);\n case 3:\n app = this.getAppFromStorage(app_id);\n if (!app) {\n _context11.next = 6;\n break;\n }\n return _context11.abrupt("return", app);\n case 6:\n if (!this.appRequestCache.has(app_id)) {\n _context11.next = 8;\n break;\n }\n return _context11.abrupt("return", this.appRequestCache.get(app_id));\n case 8:\n self = this;\n pr = new Promise(/*#__PURE__*/function () {\n var _ref = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee10(resolve, reject) {\n var _app, filtered;\n return AppProcessor_regeneratorRuntime().wrap(function _callee10$(_context10) {\n while (1) switch (_context10.prev = _context10.next) {\n case 0:\n _context10.prev = 0;\n _context10.next = 3;\n return self.dataService.getApp(app_id);\n case 3:\n _app = _context10.sent;\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 filtered = trash ? _app : AppProcessor_objectSpread(AppProcessor_objectSpread({}, _app), {}, {\n items_list: _app.items_list.filter(function (item) {\n return !item.trash;\n })\n });\n filtered = trash ? filtered : AppProcessor_objectSpread(AppProcessor_objectSpread({}, filtered), {}, {\n field_list: filtered.field_list.filter(function (f) {\n return !f.trash;\n })\n });\n resolve(filtered);\n self.saveAppInStorage(filtered);\n self.ws.addSubscription(app_id);\n _context10.next = 15;\n break;\n case 12:\n _context10.prev = 12;\n _context10.t0 = _context10["catch"](0);\n reject();\n case 15:\n case "end":\n return _context10.stop();\n }\n }, _callee10, null, [[0, 12]]);\n }));\n return function (_x7, _x8) {\n return _ref.apply(this, arguments);\n };\n }());\n self.appRequestCache.set(app_id, pr);\n return _context11.abrupt("return", pr);\n case 12:\n case "end":\n return _context11.stop();\n }\n }, _callee11, this);\n }));\n function getApp(_x6) {\n return _getApp.apply(this, arguments);\n }\n return getApp;\n }()\n }, {\n key: "updateApp",\n value: function () {\n var _updateApp = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee12(app) {\n var storageApp, updatedApp;\n return AppProcessor_regeneratorRuntime().wrap(function _callee12$(_context12) {\n while (1) switch (_context12.prev = _context12.next) {\n case 0:\n if (!(!app.views_list || !app.views_list.length || !app.show)) {\n _context12.next = 6;\n break;\n }\n _context12.next = 3;\n return this.getApp(app.app_id);\n case 3:\n storageApp = _context12.sent;\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 case 6:\n _context12.next = 8;\n return this.updateAppApi(app);\n case 8:\n updatedApp = _context12.sent;\n this.updateAppFieldsAndViews(updatedApp);\n return _context12.abrupt("return", updatedApp);\n case 11:\n case "end":\n return _context12.stop();\n }\n }, _callee12, this);\n }));\n function updateApp(_x9) {\n return _updateApp.apply(this, arguments);\n }\n return updateApp;\n }()\n }, {\n key: "updateAppInfo",\n value: function () {\n var _updateAppInfo = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee13() {\n var appInfo,\n _args13 = arguments;\n return AppProcessor_regeneratorRuntime().wrap(function _callee13$(_context13) {\n while (1) switch (_context13.prev = _context13.next) {\n case 0:\n appInfo = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};\n this.pipeService.emit("gh_app_info_update", {\n app_id: appInfo.app_id\n }, appInfo);\n return _context13.abrupt("return", this.updateApp(appInfo));\n case 3:\n case "end":\n return _context13.stop();\n }\n }, _callee13, this);\n }));\n function updateAppInfo() {\n return _updateAppInfo.apply(this, arguments);\n }\n return updateAppInfo;\n }()\n }, {\n key: "createNewApp",\n value: function () {\n var _createNewApp = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee14(app) {\n var newApp;\n return AppProcessor_regeneratorRuntime().wrap(function _callee14$(_context14) {\n while (1) switch (_context14.prev = _context14.next) {\n case 0:\n _context14.next = 2;\n return this.createNewAppApi(app);\n case 2:\n newApp = _context14.sent;\n newApp.items_object = {};\n this.addNewAppToStorage(newApp);\n return _context14.abrupt("return", newApp);\n case 6:\n case "end":\n return _context14.stop();\n }\n }, _callee14, this);\n }));\n function createNewApp(_x10) {\n return _createNewApp.apply(this, arguments);\n }\n return createNewApp;\n }()\n }, {\n key: "getAppViews",\n value: function () {\n var _getAppViews = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee15(app_id) {\n var app;\n return AppProcessor_regeneratorRuntime().wrap(function _callee15$(_context15) {\n while (1) switch (_context15.prev = _context15.next) {\n case 0:\n if (!app_id) {\n _context15.next = 5;\n break;\n }\n _context15.next = 3;\n return this.getApp(app_id);\n case 3:\n app = _context15.sent;\n return _context15.abrupt("return", app.views_list);\n case 5:\n case "end":\n return _context15.stop();\n }\n }, _callee15, this);\n }));\n function getAppViews(_x11) {\n return _getAppViews.apply(this, arguments);\n }\n return getAppViews;\n }()\n }, {\n key: "handleAppChange",\n value: function () {\n var _handleAppChange = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee16(id, prevVersion, nextVersion) {\n var res1, res2;\n return AppProcessor_regeneratorRuntime().wrap(function _callee16$(_context16) {\n while (1) switch (_context16.prev = _context16.next) {\n case 0:\n res1 = this.util.areViewListsEqual(prevVersion.views_list, nextVersion.views_list);\n res2 = this.util.areFieldListsEqual(prevVersion.field_list, nextVersion.field_list);\n if (res1 || res2) {\n this.updateAppFieldsAndViews({\n id: id,\n views_list: nextVersion.views_list,\n field_list: nextVersion.field_list\n });\n }\n case 3:\n case "end":\n return _context16.stop();\n }\n }, _callee16, this);\n }));\n function handleAppChange(_x12, _x13, _x14) {\n return _handleAppChange.apply(this, arguments);\n }\n return handleAppChange;\n }()\n }, {\n key: "clearAppProcessor",\n value: function clearAppProcessor() {\n this.getAppListPromises = null;\n this.getAppPromises = {};\n this.applistReceived = false;\n }\n }, {\n key: "appListeners",\n value: function appListeners() {\n var _this2 = this;\n this.pipeService.onRoot("gh_app_get", {}, /*#__PURE__*/function () {\n var _ref2 = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee17(event, data) {\n var app;\n return AppProcessor_regeneratorRuntime().wrap(function _callee17$(_context17) {\n while (1) switch (_context17.prev = _context17.next) {\n case 0:\n if (!(data && data.app_id)) {\n _context17.next = 5;\n break;\n }\n _context17.next = 3;\n return _this2.getApp(data.app_id);\n case 3:\n app = _context17.sent;\n _this2.pipeService.emit("gh_app_get", data, app);\n case 5:\n case "end":\n return _context17.stop();\n }\n }, _callee17);\n }));\n return function (_x15, _x16) {\n return _ref2.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot("gh_apps_list_get", {}, /*#__PURE__*/function () {\n var _ref3 = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee18(event, data) {\n var appList;\n return AppProcessor_regeneratorRuntime().wrap(function _callee18$(_context18) {\n while (1) switch (_context18.prev = _context18.next) {\n case 0:\n _context18.next = 2;\n return _this2.getAppsList();\n case 2:\n appList = _context18.sent;\n _this2.pipeService.emit("gh_apps_list_get", data, appList);\n case 4:\n case "end":\n return _context18.stop();\n }\n }, _callee18);\n }));\n return function (_x17, _x18) {\n return _ref3.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot("gh_delete_app", {}, /*#__PURE__*/function () {\n var _ref4 = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee19(event, data) {\n var appList;\n return AppProcessor_regeneratorRuntime().wrap(function _callee19$(_context19) {\n while (1) switch (_context19.prev = _context19.next) {\n case 0:\n _context19.next = 2;\n return _this2.deleteApp(data.app_id);\n case 2:\n appList = _context19.sent;\n _this2.pipeService.emit("gh_apps_list_update", {\n recipient: "all"\n }, appList);\n case 4:\n case "end":\n return _context19.stop();\n }\n }, _callee19);\n }));\n return function (_x19, _x20) {\n return _ref4.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot("gh_app_update", {}, /*#__PURE__*/function () {\n var _ref5 = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee20(event, data) {\n var newApp, appsList;\n return AppProcessor_regeneratorRuntime().wrap(function _callee20$(_context20) {\n while (1) switch (_context20.prev = _context20.next) {\n case 0:\n data.app.items_list = [];\n data.app.file_list = [];\n _context20.next = 4;\n return _this2.updateApp(data.app);\n case 4:\n newApp = _context20.sent;\n _this2.pipeService.emit("gh_app_views_update", {\n app_id: newApp.app_id\n }, newApp.views_list);\n _context20.next = 8;\n return _this2.getAppsList();\n case 8:\n appsList = _context20.sent;\n _this2.pipeService.emit("gh_apps_list_update", {\n recipient: "all"\n }, appsList);\n newApp.field_list.forEach(function (fieldModel) {\n _this2.pipeService.emit("gh_model_update", {\n app_id: newApp.app_id,\n field_id: fieldModel.field_id\n }, fieldModel);\n });\n case 11:\n case "end":\n return _context20.stop();\n }\n }, _callee20);\n }));\n return function (_x21, _x22) {\n return _ref5.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot("gh_app_view_get", {}, /*#__PURE__*/function () {\n var _ref6 = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee21(event, data) {\n var app;\n return AppProcessor_regeneratorRuntime().wrap(function _callee21$(_context21) {\n while (1) switch (_context21.prev = _context21.next) {\n case 0:\n if (!(data && data.app_id)) {\n _context21.next = 5;\n break;\n }\n _context21.next = 3;\n return _this2.getApp(data.app_id);\n case 3:\n app = _context21.sent;\n app.views_list.forEach(function (view, key) {\n if (view.view_id == data.view_id) {\n _this2.pipeService.emit("gh_app_view_get", data, app.views_list[key]);\n }\n });\n case 5:\n case "end":\n return _context21.stop();\n }\n }, _callee21);\n }));\n return function (_x23, _x24) {\n return _ref6.apply(this, arguments);\n };\n }());\n\n // Return app_name, app_id, app_icon\n this.pipeService.onRoot("gh_app_info_get", {}, /*#__PURE__*/function () {\n var _ref7 = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee22(event, data) {\n var appInfo;\n return AppProcessor_regeneratorRuntime().wrap(function _callee22$(_context22) {\n while (1) switch (_context22.prev = _context22.next) {\n case 0:\n _context22.next = 2;\n return _this2.getAppInfo(data.app_id);\n case 2:\n appInfo = _context22.sent;\n if (appInfo) _this2.pipeService.emit("gh_app_info_get", data, appInfo);\n case 4:\n case "end":\n return _context22.stop();\n }\n }, _callee22);\n }));\n return function (_x25, _x26) {\n return _ref7.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot("gh_app_info_update", {}, /*#__PURE__*/function () {\n var _ref8 = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee23(event, data) {\n var appInfo;\n return AppProcessor_regeneratorRuntime().wrap(function _callee23$(_context23) {\n while (1) switch (_context23.prev = _context23.next) {\n case 0:\n if (!(data && data.app)) {\n _context23.next = 5;\n break;\n }\n _context23.next = 3;\n return _this2.updateAppInfo(data.app);\n case 3:\n appInfo = _context23.sent;\n _this2.pipeService.emit("gh_app_info_update", {\n app_id: data.app.app_id\n }, appInfo);\n case 5:\n case "end":\n return _context23.stop();\n }\n }, _callee23);\n }));\n return function (_x27, _x28) {\n return _ref8.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot("gh_app_create", {}, /*#__PURE__*/function () {\n var _ref9 = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee24(event, data) {\n var appsList;\n return AppProcessor_regeneratorRuntime().wrap(function _callee24$(_context24) {\n while (1) switch (_context24.prev = _context24.next) {\n case 0:\n _context24.next = 2;\n return _this2.createNewApp(data.app);\n case 2:\n _context24.next = 4;\n return _this2.getAppsList();\n case 4:\n appsList = _context24.sent;\n _this2.pipeService.emit("gh_apps_list_update", {\n recipient: "all"\n }, appsList);\n case 6:\n case "end":\n return _context24.stop();\n }\n }, _callee24);\n }));\n return function (_x29, _x30) {\n return _ref9.apply(this, arguments);\n };\n }());\n if (consts/* IS_BROWSER_MAIN_THREAD */.tH && this.activateSW) {\n navigator.serviceWorker.addEventListener("message", /*#__PURE__*/function () {\n var _ref10 = AppProcessor_asyncToGenerator(/*#__PURE__*/AppProcessor_regeneratorRuntime().mark(function _callee25(event) {\n var app;\n return AppProcessor_regeneratorRuntime().wrap(function _callee25$(_context25) {\n while (1) switch (_context25.prev = _context25.next) {\n case 0:\n if (!(event.data.type === "refresh app")) {\n _context25.next = 9;\n break;\n }\n _context25.next = 3;\n return _this2.getApp(event.data.payload.app_id);\n case 3:\n app = _context25.sent;\n if (app) {\n _this2.util.compareAppsItemsLists(app.items_list, event.data.payload.items_list.filter(function (item) {\n return !item.trash;\n }), function (_ref11) {\n var diff_fields_items = _ref11.diff_fields_items,\n diff_fields_items_Ids = _ref11.diff_fields_items_Ids,\n diff_items = _ref11.diff_items,\n newItems = _ref11.newItems,\n deletedItems = _ref11.deletedItems;\n if (diff_items.length || newItems.length || deletedItems.length) {\n _this2.pipeService.emit("gh_items_update", {\n app_id: event.data.payload.app_id\n }, event.data.payload.items_list.filter(function (item) {\n return !item.trash;\n }));\n diff_items.forEach(function (item) {\n return _this2.pipeService.emit("gh_item_update", {\n app_id: event.data.payload.app_id,\n item_id: item.item_id\n }, item);\n });\n }\n diff_fields_items_Ids.forEach(function (item_id) {\n var item = diff_fields_items[item_id];\n if (!item) return;\n item.forEach(function (field) {\n _this2.pipeService.emit("gh_value_update", {\n app_id: event.data.payload.app_id,\n item_id: item_id,\n field_id: field.field_id\n }, field.field_value);\n });\n });\n });\n }\n _context25.next = 7;\n return _this2.util.mergeChunks([app, event.data.payload]);\n case 7:\n event.data.payload.items_list = _context25.sent;\n //here check Ask Andrew\n _this2.saveAppInStorage(event.data.payload);\n case 9:\n case "end":\n return _context25.stop();\n }\n }, _callee25);\n }));\n return function (_x31) {\n return _ref10.apply(this, arguments);\n };\n }());\n }\n }\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/ItemProcessor/ItemProcessor.js\nfunction ItemProcessor_typeof(o) { "@babel/helpers - typeof"; return ItemProcessor_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, ItemProcessor_typeof(o); }\nfunction ItemProcessor_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction ItemProcessor_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ItemProcessor_ownKeys(Object(t), !0).forEach(function (r) { ItemProcessor_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ItemProcessor_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction ItemProcessor_defineProperty(e, r, t) { return (r = ItemProcessor_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction ItemProcessor_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ ItemProcessor_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == ItemProcessor_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(ItemProcessor_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction ItemProcessor_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction ItemProcessor_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { ItemProcessor_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { ItemProcessor_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction ItemProcessor_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction ItemProcessor_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, ItemProcessor_toPropertyKey(o.key), o); } }\nfunction ItemProcessor_createClass(e, r, t) { return r && ItemProcessor_defineProperties(e.prototype, r), t && ItemProcessor_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction ItemProcessor_toPropertyKey(t) { var i = ItemProcessor_toPrimitive(t, "string"); return "symbol" == ItemProcessor_typeof(i) ? i : i + ""; }\nfunction ItemProcessor_toPrimitive(t, r) { if ("object" != ItemProcessor_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != ItemProcessor_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\n\nvar ItemProcessor = /*#__PURE__*/function () {\n function ItemProcessor(storage, pipeService, req, appProcessor, util) {\n ItemProcessor_classCallCheck(this, ItemProcessor);\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 return ItemProcessor_createClass(ItemProcessor, [{\n key: "addItemsApi",\n value: function () {\n var _addItemsApi = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee(app_id, itemsList) {\n var response;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return this.req.post({\n url: "/api/items/add",\n form: {\n items: JSON.stringify(itemsList),\n app_id: app_id\n }\n });\n case 3:\n response = _context.sent;\n return _context.abrupt("return", response);\n case 7:\n _context.prev = 7;\n _context.t0 = _context["catch"](0);\n console.log(_context.t0);\n return _context.abrupt("return", null);\n case 11:\n case "end":\n return _context.stop();\n }\n }, _callee, this, [[0, 7]]);\n }));\n function addItemsApi(_x, _x2) {\n return _addItemsApi.apply(this, arguments);\n }\n return addItemsApi;\n }()\n }, {\n key: "updateItemsApi",\n value: function () {\n var _updateItemsApi = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee2(app_id, itemsList) {\n var response;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.prev = 0;\n _context2.next = 3;\n return this.req.post({\n url: "/api/items/update",\n form: {\n items: JSON.stringify(itemsList),\n app_id: app_id\n }\n });\n case 3:\n response = _context2.sent;\n return _context2.abrupt("return", response);\n case 7:\n _context2.prev = 7;\n _context2.t0 = _context2["catch"](0);\n console.log(_context2.t0);\n return _context2.abrupt("return", null);\n case 11:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this, [[0, 7]]);\n }));\n function updateItemsApi(_x3, _x4) {\n return _updateItemsApi.apply(this, arguments);\n }\n return updateItemsApi;\n }()\n }, {\n key: "deleteItemsApi",\n value: function deleteItemsApi(items_ids) {\n try {\n var 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 }, {\n key: "addItemsToStorage",\n value: function () {\n var _addItemsToStorage = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee3(app_id, items) {\n var _this = this;\n var app;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return this.appProcessor.getApp(app_id);\n case 2:\n app = _context3.sent;\n if (app) {\n items.forEach(function (item) {\n app.items_list.push(item);\n app.items_object[item.item_id] = {};\n for (var 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: app_id\n }, [item]);\n });\n this.pipeService.emit("gh_items_update", {\n app_id: app_id\n }, app.items_list);\n this.storage.updateApp(app);\n }\n return _context3.abrupt("return", app);\n case 5:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function addItemsToStorage(_x5, _x6) {\n return _addItemsToStorage.apply(this, arguments);\n }\n return addItemsToStorage;\n }()\n }, {\n key: "updateItemsInStorage",\n value: function () {\n var _updateItemsInStorage = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee4(app_id, items) {\n var _this2 = this;\n var app;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n this.pipeService.emit("gh_items_update", {\n app_id: app_id\n }, items);\n //-- getting app from storage\n _context4.next = 3;\n return this.appProcessor.getApp(app_id);\n case 3:\n app = _context4.sent;\n if (app && items) {\n items.forEach(function (item) {\n var addressToEmit = {\n app_id: app_id\n };\n _this2.pipeService.emit("gh_item_update", addressToEmit, [item]);\n addressToEmit.item_id = item.item_id;\n _this2.pipeService.emit("gh_item_update", addressToEmit, item);\n //-- Looking for updated item in the main storage according to \'item_id\'\n var fundedItem = app.items_list.find(function (storageItem) {\n return storageItem.item_id == item.item_id;\n });\n if (fundedItem) {\n //-- Updating value in existing fields\n item.fields.forEach(function (field) {\n var fundedField = fundedItem.fields.find(function (storageField) {\n return storageField.field_id == field.field_id;\n });\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 _this2.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 _this2.pipeService.emit("gh_value_update", addressToEmit, field.field_value);\n }\n });\n }\n });\n }\n return _context4.abrupt("return", items);\n case 6:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function updateItemsInStorage(_x7, _x8) {\n return _updateItemsInStorage.apply(this, arguments);\n }\n return updateItemsInStorage;\n }() //here\n /////\n }, {\n key: "handleItemsChange",\n value: function handleItemsChange(id, prevVersion, nextVersion) {\n var 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\n //\n }, {\n key: "triggerItemsChange",\n value: function triggerItemsChange(id, compareRes) {\n this.updateItemsInStorage(id, compareRes.diff_src_items);\n this.addItemsToStorage(id, compareRes.new_src_items);\n }\n\n //\n }, {\n key: "handleDiff",\n value: function 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 }, {\n key: "deleteItemsFromStorage",\n value: function () {\n var _deleteItemsFromStorage = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee5(app_id) {\n var itemsForDelete,\n app,\n _args5 = arguments;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n itemsForDelete = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : [];\n _context5.next = 3;\n return this.appProcessor.getApp(app_id);\n case 3:\n app = _context5.sent;\n if (app) {\n app.items_list = app.items_list.filter(function (item) {\n if (itemsForDelete.find(function (findedItem) {\n return item.item_id == findedItem.item_id;\n })) {\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: app_id\n }, app.items_list);\n this.storage.updateApp(app);\n }\n case 5:\n case "end":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function deleteItemsFromStorage(_x9) {\n return _deleteItemsFromStorage.apply(this, arguments);\n }\n return deleteItemsFromStorage;\n }()\n }, {\n key: "getItems",\n value: function () {\n var _getItems = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee6(app_id) {\n var trash,\n app,\n _args6 = arguments;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n trash = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : false;\n _context6.next = 3;\n return this.appProcessor.getApp(app_id, trash);\n case 3:\n app = _context6.sent;\n if (app) {\n _context6.next = 6;\n break;\n }\n return _context6.abrupt("return", null);\n case 6:\n return _context6.abrupt("return", app.items_list);\n case 7:\n case "end":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function getItems(_x10) {\n return _getItems.apply(this, arguments);\n }\n return getItems;\n }()\n }, {\n key: "addNewItems",\n value: function () {\n var _addNewItems = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee7(app_id, itemsList) {\n var preparedItemsList, newItems;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n preparedItemsList = itemsList.map(function (item) {\n return ItemProcessor_objectSpread(ItemProcessor_objectSpread({}, item), {}, {\n fields: filterFields(item.fields)\n });\n });\n _context7.next = 3;\n return this.addItemsApi(app_id, preparedItemsList);\n case 3:\n newItems = _context7.sent;\n _context7.next = 6;\n return this.addItemsToStorage(app_id, newItems);\n case 6:\n this.pipeService.emit("gh_items_add", {\n app_id: app_id\n }, newItems);\n return _context7.abrupt("return", newItems);\n case 8:\n case "end":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function addNewItems(_x11, _x12) {\n return _addNewItems.apply(this, arguments);\n }\n return addNewItems;\n }()\n }, {\n key: "updateItems",\n value: function () {\n var _updateItems = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee8(app_id, itemsList) {\n var preparedItemsList, updatedItems;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n preparedItemsList = itemsList.map(function (item) {\n return ItemProcessor_objectSpread(ItemProcessor_objectSpread({}, item), {}, {\n fields: filterFields(item.fields)\n });\n });\n _context8.next = 3;\n return this.updateItemsApi(app_id, preparedItemsList);\n case 3:\n updatedItems = _context8.sent;\n _context8.next = 6;\n return this.updateItemsInStorage(app_id, updatedItems);\n case 6:\n return _context8.abrupt("return", _context8.sent);\n case 7:\n case "end":\n return _context8.stop();\n }\n }, _callee8, this);\n }));\n function updateItems(_x13, _x14) {\n return _updateItems.apply(this, arguments);\n }\n return updateItems;\n }()\n }, {\n key: "deleteItems",\n value: function () {\n var _deleteItems = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee10(app_id, itemsIds) {\n var _this3 = this;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee10$(_context10) {\n while (1) switch (_context10.prev = _context10.next) {\n case 0:\n return _context10.abrupt("return", this.deleteItemsApi(itemsIds).then(/*#__PURE__*/function () {\n var _ref = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee9(items) {\n return ItemProcessor_regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n _context9.next = 2;\n return _this3.deleteItemsFromStorage(app_id, items);\n case 2:\n return _context9.abrupt("return", _context9.sent);\n case 3:\n case "end":\n return _context9.stop();\n }\n }, _callee9);\n }));\n return function (_x17) {\n return _ref.apply(this, arguments);\n };\n }()));\n case 1:\n case "end":\n return _context10.stop();\n }\n }, _callee10, this);\n }));\n function deleteItems(_x15, _x16) {\n return _deleteItems.apply(this, arguments);\n }\n return deleteItems;\n }()\n }, {\n key: "itemListeners",\n value: function itemListeners() {\n var _this4 = this;\n this.pipeService.onRoot("gh_items_get", {}, /*#__PURE__*/function () {\n var _ref2 = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee11(event, data) {\n var items;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee11$(_context11) {\n while (1) switch (_context11.prev = _context11.next) {\n case 0:\n if (!(data && data.app_id)) {\n _context11.next = 5;\n break;\n }\n _context11.next = 3;\n return _this4.getItems(data.app_id);\n case 3:\n items = _context11.sent;\n if (items) {\n _this4.pipeService.emit("gh_items_get", data, items);\n } else {\n _this4.pipeService.emit("gh_items_get", data, []);\n }\n case 5:\n case "end":\n return _context11.stop();\n }\n }, _callee11);\n }));\n return function (_x18, _x19) {\n return _ref2.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot("gh_items_add", {}, /*#__PURE__*/function () {\n var _ref3 = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee12(event, data) {\n var items;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee12$(_context12) {\n while (1) switch (_context12.prev = _context12.next) {\n case 0:\n if (!(data && data.app_id && data.items)) {\n _context12.next = 5;\n break;\n }\n _context12.next = 3;\n return _this4.addNewItems(data.app_id, data.items);\n case 3:\n items = _context12.sent;\n if (items) {\n _this4.pipeService.emit("gh_items_add", data, items);\n } else {\n _this4.pipeService.emit("gh_items_add", data, []);\n }\n case 5:\n case "end":\n return _context12.stop();\n }\n }, _callee12);\n }));\n return function (_x20, _x21) {\n return _ref3.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot("gh_items_update", {}, /*#__PURE__*/function () {\n var _ref4 = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee13(event, data) {\n var items;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee13$(_context13) {\n while (1) switch (_context13.prev = _context13.next) {\n case 0:\n if (!(data && data.app_id && data.items)) {\n _context13.next = 5;\n break;\n }\n _context13.next = 3;\n return _this4.updateItems(data.app_id, data.items);\n case 3:\n items = _context13.sent;\n if (items) {\n _this4.pipeService.emit("gh_items_update", data, items);\n } else {\n _this4.pipeService.emit("gh_items_update", data, []);\n }\n case 5:\n case "end":\n return _context13.stop();\n }\n }, _callee13);\n }));\n return function (_x22, _x23) {\n return _ref4.apply(this, arguments);\n };\n }());\n\n /* ---- FIELD VALUE GET LISTENING ---- */\n this.pipeService.onRoot("gh_item_get", {}, /*#__PURE__*/function () {\n var _ref5 = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee14(event, data) {\n var items, item;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee14$(_context14) {\n while (1) switch (_context14.prev = _context14.next) {\n case 0:\n if (!(data && data.app_id)) {\n _context14.next = 6;\n break;\n }\n _context14.next = 3;\n return _this4.getItems(data.app_id);\n case 3:\n items = _context14.sent;\n item = items.find(function (item) {\n return item.item_id == data.item_id;\n });\n _this4.pipeService.emit("gh_item_get", data, item);\n case 6:\n case "end":\n return _context14.stop();\n }\n }, _callee14);\n }));\n return function (_x24, _x25) {\n return _ref5.apply(this, arguments);\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", {}, /*#__PURE__*/function () {\n var _ref6 = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee15(event, data) {\n var items, filteredItems;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee15$(_context15) {\n while (1) switch (_context15.prev = _context15.next) {\n case 0:\n if (!(data && data.element_app_id)) {\n _context15.next = 8;\n break;\n }\n _context15.next = 3;\n return _this4.getItems(data.element_app_id);\n case 3:\n items = _context15.sent;\n _context15.next = 6;\n return _this4.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 case 6:\n filteredItems = _context15.sent;\n _this4.pipeService.emit("gh_filtered_items_get", data, filteredItems);\n case 8:\n case "end":\n return _context15.stop();\n }\n }, _callee15);\n }));\n return function (_x26, _x27) {\n return _ref6.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot("gh_filter_items", {}, /*#__PURE__*/function () {\n var _ref7 = ItemProcessor_asyncToGenerator(/*#__PURE__*/ItemProcessor_regeneratorRuntime().mark(function _callee16(event, data) {\n var filteredItems;\n return ItemProcessor_regeneratorRuntime().wrap(function _callee16$(_context16) {\n while (1) switch (_context16.prev = _context16.next) {\n case 0:\n if (!(data && data.items)) {\n _context16.next = 5;\n break;\n }\n _context16.next = 3;\n return _this4.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 case 3:\n filteredItems = _context16.sent;\n _this4.pipeService.emit("gh_filter_items", data, filteredItems);\n case 5:\n case "end":\n return _context16.stop();\n }\n }, _callee16);\n }));\n return function (_x28, _x29) {\n return _ref7.apply(this, arguments);\n };\n }());\n }\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/FieldProcessor/FieldProcessor.js\nfunction FieldProcessor_typeof(o) { "@babel/helpers - typeof"; return FieldProcessor_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, FieldProcessor_typeof(o); }\nfunction FieldProcessor_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ FieldProcessor_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == FieldProcessor_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(FieldProcessor_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction FieldProcessor_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction FieldProcessor_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? FieldProcessor_ownKeys(Object(t), !0).forEach(function (r) { FieldProcessor_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : FieldProcessor_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction FieldProcessor_defineProperty(e, r, t) { return (r = FieldProcessor_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction FieldProcessor_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction FieldProcessor_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { FieldProcessor_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { FieldProcessor_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction FieldProcessor_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction FieldProcessor_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, FieldProcessor_toPropertyKey(o.key), o); } }\nfunction FieldProcessor_createClass(e, r, t) { return r && FieldProcessor_defineProperties(e.prototype, r), t && FieldProcessor_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction FieldProcessor_toPropertyKey(t) { var i = FieldProcessor_toPrimitive(t, "string"); return "symbol" == FieldProcessor_typeof(i) ? i : i + ""; }\nfunction FieldProcessor_toPrimitive(t, r) { if ("object" != FieldProcessor_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != FieldProcessor_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar FieldProcessor = /*#__PURE__*/function () {\n function FieldProcessor(storage, req, appProcessor, itemProcessor, pipeService) {\n FieldProcessor_classCallCheck(this, FieldProcessor);\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 return FieldProcessor_createClass(FieldProcessor, [{\n key: "deleteFieldApi",\n value: function deleteFieldApi(field_id) {\n return this.req.post({\n url: "/api/app/delete-field",\n form: {\n field_id: field_id\n }\n });\n }\n }, {\n key: "updatedFieldApi",\n value: function () {\n var _updatedFieldApi = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee(app_id) {\n var fieldModel,\n app,\n appToUpdate,\n _args = arguments;\n return FieldProcessor_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n fieldModel = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};\n _context.next = 3;\n return this.appProcessor.getApp(app_id);\n case 3:\n app = _context.sent;\n appToUpdate = {\n app_id: 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(function (field) {\n return field.field_id == fieldModel.field_id ? FieldProcessor_objectSpread(FieldProcessor_objectSpread({}, field), fieldModel) : field;\n }),\n views_list: app.views_list\n };\n return _context.abrupt("return", this.appProcessor.updateApp(appToUpdate));\n case 6:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function updatedFieldApi(_x) {\n return _updatedFieldApi.apply(this, arguments);\n }\n return updatedFieldApi;\n }()\n }, {\n key: "setFieldValueApi",\n value: function setFieldValueApi(app_id, item_id, field_id, field_value) {\n var itemToUpdate = [{\n item_id: item_id,\n fields: [{\n field_id: field_id,\n field_value: field_value\n }]\n }];\n return this.itemProcessor.updateItems(app_id, itemToUpdate);\n }\n }, {\n key: "deleteFieldInStorage",\n value: function deleteFieldInStorage(app_id, field_id) {\n var app = this.storage.getApp(app_id);\n app.field_list = app.field_list.filter(function (field) {\n return field.file_id != field_id;\n });\n app.items_list = app.items_list.map(function (item) {\n item.fields = item.fields.filter(function (field) {\n return field.field_id != field_id;\n });\n return item;\n });\n this.storage.updateApp(app);\n return true;\n }\n }, {\n key: "updateFieldInStorage",\n value: function updateFieldInStorage(app_id, fieldModel) {\n var app = this.storage.getApp(app_id);\n app.field_list = app.field_list.map(function (field) {\n return field.field_id == fieldModel.field_id ? FieldProcessor_objectSpread(FieldProcessor_objectSpread({}, field), fieldModel) : field;\n });\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 }, {\n key: "updateFieldValue",\n value: function updateFieldValue(app_id, item_id, field_id, field_value) {\n var app = this.storage.getApp(app_id);\n app.items_list.forEach(function (item) {\n if (item.item_id == item_id) {\n item.fields.forEach(function (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 }, {\n key: "getField",\n value: function () {\n var _getField = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee2(app_id, field_id) {\n var app, i;\n return FieldProcessor_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this.appProcessor.getApp(app_id);\n case 2:\n app = _context2.sent;\n if (app) {\n _context2.next = 5;\n break;\n }\n return _context2.abrupt("return", null);\n case 5:\n i = 0;\n case 6:\n if (!(i < app.field_list.length)) {\n _context2.next = 12;\n break;\n }\n if (!(app.field_list[i].field_id == field_id)) {\n _context2.next = 9;\n break;\n }\n return _context2.abrupt("return", app.field_list[i]);\n case 9:\n i++;\n _context2.next = 6;\n break;\n case 12:\n return _context2.abrupt("return", null);\n case 13:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function getField(_x2, _x3) {\n return _getField.apply(this, arguments);\n }\n return getField;\n }()\n }, {\n key: "getFieldIdByNameSpace",\n value: function () {\n var _getFieldIdByNameSpace = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee3(app_id, name_space) {\n var app, i;\n return FieldProcessor_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return this.appProcessor.getApp(app_id);\n case 2:\n app = _context3.sent;\n if (app) {\n _context3.next = 5;\n break;\n }\n return _context3.abrupt("return", null);\n case 5:\n i = 0;\n case 6:\n if (!(i < app.field_list.length)) {\n _context3.next = 12;\n break;\n }\n if (!(app.field_list[i].name_space == name_space)) {\n _context3.next = 9;\n break;\n }\n return _context3.abrupt("return", app.field_list[i].field_id);\n case 9:\n i++;\n _context3.next = 6;\n break;\n case 12:\n return _context3.abrupt("return", null);\n case 13:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function getFieldIdByNameSpace(_x4, _x5) {\n return _getFieldIdByNameSpace.apply(this, arguments);\n }\n return getFieldIdByNameSpace;\n }() //!!!!! Shou Be Renamed to getFields() !!!!!!!\n }, {\n key: "getFieldModels",\n value: function () {\n var _getFieldModels = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee4(app_id) {\n var app;\n return FieldProcessor_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return this.appProcessor.getApp(app_id);\n case 2:\n app = _context4.sent;\n if (app) {\n _context4.next = 5;\n break;\n }\n return _context4.abrupt("return", null);\n case 5:\n return _context4.abrupt("return", app.field_list);\n case 6:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function getFieldModels(_x6) {\n return _getFieldModels.apply(this, arguments);\n }\n return getFieldModels;\n }() //!!!!! Shou Be added fieldID argument !!!!!!!\n }, {\n key: "updateField",\n value: function () {\n var _updateField = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee5(app_id, fieldModel) {\n var newModel;\n return FieldProcessor_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n if (!(!app_id || !fieldModel)) {\n _context5.next = 2;\n break;\n }\n return _context5.abrupt("return");\n case 2:\n _context5.next = 4;\n return this.updatedFieldApi(app_id, fieldModel);\n case 4:\n newModel = _context5.sent;\n return _context5.abrupt("return", this.updateFieldInStorage(app_id, newModel));\n case 6:\n case "end":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function updateField(_x7, _x8) {\n return _updateField.apply(this, arguments);\n }\n return updateField;\n }()\n }, {\n key: "deleteField",\n value: function () {\n var _deleteField = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee6(app_id, field_id) {\n return FieldProcessor_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return this.deleteFieldApi(field_id);\n case 2:\n return _context6.abrupt("return", this.deleteFieldInStorage(app_id, field_id));\n case 3:\n case "end":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function deleteField(_x9, _x10) {\n return _deleteField.apply(this, arguments);\n }\n return deleteField;\n }() //this method should alwaise return value if no value we return null\n }, {\n key: "getFieldValue",\n value: function () {\n var _getFieldValue = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee7(app_id, item_id, field_id) {\n var fieldValue, app;\n return FieldProcessor_regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n fieldValue = null;\n _context7.next = 3;\n return this.appProcessor.getApp(app_id);\n case 3:\n app = _context7.sent;\n try {\n fieldValue = app.items_object[item_id][field_id].field_value;\n } catch (err) {}\n return _context7.abrupt("return", fieldValue);\n case 6:\n case "end":\n return _context7.stop();\n }\n }, _callee7, this);\n }));\n function getFieldValue(_x11, _x12, _x13) {\n return _getFieldValue.apply(this, arguments);\n }\n return getFieldValue;\n }()\n }, {\n key: "setFieldValue",\n value: function () {\n var _setFieldValue = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee8(app_id, item_id, field_id, field_value) {\n return FieldProcessor_regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n if (!(!app_id || !item_id || !field_id)) {\n _context8.next = 2;\n break;\n }\n return _context8.abrupt("return");\n case 2:\n _context8.next = 4;\n return this.setFieldValueApi(app_id, item_id, field_id, field_value);\n case 4:\n return _context8.abrupt("return", this.updateFieldValue(app_id, item_id, field_id, field_value));\n case 5:\n case "end":\n return _context8.stop();\n }\n }, _callee8, this);\n }));\n function setFieldValue(_x14, _x15, _x16, _x17) {\n return _setFieldValue.apply(this, arguments);\n }\n return setFieldValue;\n }()\n }, {\n key: "fieldListeners",\n value: function fieldListeners() {\n var _this = this;\n this.pipeService.onRoot(\'gh_value_get\', {}, /*#__PURE__*/function () {\n var _ref = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee9(event, data) {\n var field_value;\n return FieldProcessor_regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n if (!(data.app_id && data.item_id && data.field_id)) {\n _context9.next = 5;\n break;\n }\n _context9.next = 3;\n return _this.getFieldValue(data.app_id, data.item_id, data.field_id);\n case 3:\n field_value = _context9.sent;\n _this.pipeService.emit(\'gh_value_get\', data, field_value);\n case 5:\n case "end":\n return _context9.stop();\n }\n }, _callee9);\n }));\n return function (_x18, _x19) {\n return _ref.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot(\'gh_value_set\', {}, /*#__PURE__*/function () {\n var _ref2 = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee10(event, data) {\n return FieldProcessor_regeneratorRuntime().wrap(function _callee10$(_context10) {\n while (1) switch (_context10.prev = _context10.next) {\n case 0:\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 case 1:\n case "end":\n return _context10.stop();\n }\n }, _callee10);\n }));\n return function (_x20, _x21) {\n return _ref2.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot(\'gh_model_get\', {}, /*#__PURE__*/function () {\n var _ref3 = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee11(event, data) {\n var field_model;\n return FieldProcessor_regeneratorRuntime().wrap(function _callee11$(_context11) {\n while (1) switch (_context11.prev = _context11.next) {\n case 0:\n _context11.prev = 0;\n _context11.next = 3;\n return _this.getField(data.app_id, data.field_id);\n case 3:\n field_model = _context11.sent;\n _this.pipeService.emit(\'gh_model_get\', data, field_model);\n _context11.next = 10;\n break;\n case 7:\n _context11.prev = 7;\n _context11.t0 = _context11["catch"](0);\n console.log(\'Field model: \', _context11.t0);\n case 10:\n case "end":\n return _context11.stop();\n }\n }, _callee11, null, [[0, 7]]);\n }));\n return function (_x22, _x23) {\n return _ref3.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot(\'gh_model_update\', {}, /*#__PURE__*/function () {\n var _ref4 = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee12(event, data) {\n var field_model;\n return FieldProcessor_regeneratorRuntime().wrap(function _callee12$(_context12) {\n while (1) switch (_context12.prev = _context12.next) {\n case 0:\n _context12.next = 2;\n return _this.updateField(data.app_id, data.field_model);\n case 2:\n field_model = _context12.sent;\n _this.pipeService.emit(\'gh_model_update\', {\n app_id: data.app_id,\n field_id: data.field_id\n }, field_model);\n case 4:\n case "end":\n return _context12.stop();\n }\n }, _callee12);\n }));\n return function (_x24, _x25) {\n return _ref4.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot(\'gh_models_get\', {}, /*#__PURE__*/function () {\n var _ref5 = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee13(event, data) {\n var field_models;\n return FieldProcessor_regeneratorRuntime().wrap(function _callee13$(_context13) {\n while (1) switch (_context13.prev = _context13.next) {\n case 0:\n _context13.next = 2;\n return _this.getFieldModels(data.app_id);\n case 2:\n field_models = _context13.sent;\n _this.pipeService.emit(\'gh_models_get\', data, field_models);\n case 4:\n case "end":\n return _context13.stop();\n }\n }, _callee13);\n }));\n return function (_x26, _x27) {\n return _ref5.apply(this, arguments);\n };\n }());\n this.pipeService.onRoot(\'gh_model_delete\', {}, /*#__PURE__*/function () {\n var _ref6 = FieldProcessor_asyncToGenerator(/*#__PURE__*/FieldProcessor_regeneratorRuntime().mark(function _callee14(event, data) {\n var status;\n return FieldProcessor_regeneratorRuntime().wrap(function _callee14$(_context14) {\n while (1) switch (_context14.prev = _context14.next) {\n case 0:\n _context14.next = 2;\n return _this.deleteField(data.app_id, data.field_id);\n case 2:\n status = _context14.sent;\n _this.pipeService.emit(\'gh_model_delete\', data, status);\n case 4:\n case "end":\n return _context14.stop();\n }\n }, _callee14);\n }));\n return function (_x28, _x29) {\n return _ref6.apply(this, arguments);\n };\n }());\n }\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/FileManager/FileManager.js\nfunction FileManager_typeof(o) { "@babel/helpers - typeof"; return FileManager_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, FileManager_typeof(o); }\nfunction FileManager_toConsumableArray(r) { return FileManager_arrayWithoutHoles(r) || FileManager_iterableToArray(r) || FileManager_unsupportedIterableToArray(r) || FileManager_nonIterableSpread(); }\nfunction FileManager_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction FileManager_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return FileManager_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? FileManager_arrayLikeToArray(r, a) : void 0; } }\nfunction FileManager_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }\nfunction FileManager_arrayWithoutHoles(r) { if (Array.isArray(r)) return FileManager_arrayLikeToArray(r); }\nfunction FileManager_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction FileManager_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ FileManager_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == FileManager_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(FileManager_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction FileManager_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction FileManager_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { FileManager_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { FileManager_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction FileManager_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction FileManager_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, FileManager_toPropertyKey(o.key), o); } }\nfunction FileManager_createClass(e, r, t) { return r && FileManager_defineProperties(e.prototype, r), t && FileManager_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction FileManager_toPropertyKey(t) { var i = FileManager_toPrimitive(t, "string"); return "symbol" == FileManager_typeof(i) ? i : i + ""; }\nfunction FileManager_toPrimitive(t, r) { if ("object" != FileManager_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != FileManager_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar FileManager = /*#__PURE__*/function () {\n function FileManager(storage, pipeService, req, appProcessor) {\n FileManager_classCallCheck(this, FileManager);\n this.storage = storage;\n this.pipeService = pipeService;\n this.req = req;\n this.appProcessor = appProcessor;\n }\n\n //********************* UPLOAD FILE *********************//\n return FileManager_createClass(FileManager, [{\n key: "uploadFileApi",\n value: function () {\n var _uploadFileApi = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee(fileData, app_id, item_id) {\n var form, file;\n return FileManager_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n form = {\n "file-0": fileData,\n app_id: app_id,\n item_id: item_id\n };\n _context.next = 4;\n return this.req.post({\n url: "/file/formupload",\n form: form\n });\n case 4:\n file = _context.sent;\n return _context.abrupt("return", file);\n case 8:\n _context.prev = 8;\n _context.t0 = _context["catch"](0);\n console.log(_context.t0);\n return _context.abrupt("return", null);\n case 12:\n case "end":\n return _context.stop();\n }\n }, _callee, this, [[0, 8]]);\n }));\n function uploadFileApi(_x, _x2, _x3) {\n return _uploadFileApi.apply(this, arguments);\n }\n return uploadFileApi;\n }()\n }, {\n key: "uploadFileFromStringApi",\n value: function () {\n var _uploadFileFromStringApi = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee2(fileObject) {\n var file;\n return FileManager_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.prev = 0;\n _context2.next = 3;\n return this.req.post({\n url: "/file/upload",\n form: {\n file: JSON.stringify(fileObject)\n }\n });\n case 3:\n file = _context2.sent;\n return _context2.abrupt("return", file);\n case 7:\n _context2.prev = 7;\n _context2.t0 = _context2["catch"](0);\n console.log(_context2.t0);\n return _context2.abrupt("return", null);\n case 11:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this, [[0, 7]]);\n }));\n function uploadFileFromStringApi(_x4) {\n return _uploadFileFromStringApi.apply(this, arguments);\n }\n return uploadFileFromStringApi;\n }()\n }, {\n key: "updateFileFromStringApi",\n value: function () {\n var _updateFileFromStringApi = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee3(data, file_id, file_name, extension, format, alt, title) {\n var fileObj, file;\n return FileManager_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.prev = 0;\n fileObj = {\n file_name: file_name,\n extension: extension,\n file_id: file_id,\n format: format,\n source: data,\n alt: alt,\n title: title\n };\n _context3.next = 4;\n return this.req.post({\n url: "/file/update",\n form: {\n file: JSON.stringify(fileObj)\n }\n });\n case 4:\n file = _context3.sent;\n return _context3.abrupt("return", file);\n case 8:\n _context3.prev = 8;\n _context3.t0 = _context3["catch"](0);\n console.log(_context3.t0);\n return _context3.abrupt("return", null);\n case 12:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this, [[0, 8]]);\n }));\n function updateFileFromStringApi(_x5, _x6, _x7, _x8, _x9, _x10, _x11) {\n return _updateFileFromStringApi.apply(this, arguments);\n }\n return updateFileFromStringApi;\n }()\n }, {\n key: "duplicateFileApi",\n value: function () {\n var _duplicateFileApi = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee4(files) {\n return FileManager_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n return _context4.abrupt("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 case 1:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function duplicateFileApi(_x12) {\n return _duplicateFileApi.apply(this, arguments);\n }\n return duplicateFileApi;\n }()\n }, {\n key: "downloadFileFromString",\n value: function () {\n var _downloadFileFromString = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee5(app_id, file_id) {\n var file, data;\n return FileManager_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return this.isFileExists(app_id, file_id);\n case 2:\n if (!_context5.sent) {\n _context5.next = 12;\n break;\n }\n _context5.next = 5;\n return this.getFile(app_id, file_id);\n case 5:\n file = _context5.sent;\n _context5.next = 8;\n return this.req.get({\n url: file.url + \'?timestamp=\' + file.last_update,\n externalResource: true\n });\n case 8:\n data = _context5.sent;\n return _context5.abrupt("return", {\n file: file,\n data: data,\n type: \'file\'\n });\n case 12:\n return _context5.abrupt("return", false);\n case 13:\n case "end":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function downloadFileFromString(_x13, _x14) {\n return _downloadFileFromString.apply(this, arguments);\n }\n return downloadFileFromString;\n }()\n }, {\n key: "duplicateFile",\n value: function () {\n var _duplicateFile = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee6(files) {\n var _this = this;\n var duplicatedFiles;\n return FileManager_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return this.duplicateFileApi(files);\n case 2:\n duplicatedFiles = _context6.sent;\n duplicatedFiles.forEach(function (file) {\n _this.addFileToStorage(file.app_id, file);\n });\n return _context6.abrupt("return", duplicatedFiles);\n case 5:\n case "end":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function duplicateFile(_x15) {\n return _duplicateFile.apply(this, arguments);\n }\n return duplicateFile;\n }()\n }, {\n key: "deleteFileApi",\n value: function () {\n var _deleteFileApi = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee7(id) {\n var file;\n return FileManager_regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _context7.prev = 0;\n _context7.next = 3;\n return this.req.get({\n url: "/file/delete?file_id=".concat(id)\n });\n case 3:\n file = _context7.sent;\n return _context7.abrupt("return", file);\n case 7:\n _context7.prev = 7;\n _context7.t0 = _context7["catch"](0);\n console.log(_context7.t0);\n return _context7.abrupt("return", null);\n case 11:\n case "end":\n return _context7.stop();\n }\n }, _callee7, this, [[0, 7]]);\n }));\n function deleteFileApi(_x16) {\n return _deleteFileApi.apply(this, arguments);\n }\n return deleteFileApi;\n }()\n }, {\n key: "addFileToStorage",\n value: function addFileToStorage(app_id, file) {\n var 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: app_id,\n item_id: file.item_id,\n file_id: file.file_id\n }, file);\n }\n }\n }, {\n key: "addFilesToStorage",\n value: function addFilesToStorage(app_id, files) {\n var _this2 = this;\n var app = this.storage.getApp(app_id);\n if (app) {\n var _app$file_list;\n (_app$file_list = app.file_list).push.apply(_app$file_list, FileManager_toConsumableArray(files));\n this.storage.updateApp(app);\n files.forEach(function (file) {\n _this2.pipeService.emit("gh_file_upload", {\n app_id: app_id,\n item_id: file.item_id,\n file_id: file.file_id\n }, file);\n });\n }\n }\n }, {\n key: "deleteFileFromStorage",\n value: function deleteFileFromStorage(fileId, app_id) {\n var app = this.storage.getApp(app_id);\n if (app) {\n var deletedFile;\n app.file_list = app.file_list.filter(function (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 }, {\n key: "updateFileInStorage",\n value: function updateFileInStorage(fileId, app_id, newFile) {\n var app = this.storage.getApp(app_id);\n if (app) {\n app.file_list = app.file_list.map(function (file) {\n return file.file_id == fileId ? newFile : file;\n });\n this.storage.updateApp(app);\n this.pipeService.emit("gh_file_update", {\n file_id: fileId\n });\n }\n }\n }, {\n key: "getFile",\n value: function () {\n var _getFile = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee8(app_id, file_id) {\n var app;\n return FileManager_regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n _context8.next = 2;\n return this.appProcessor.getApp(app_id);\n case 2:\n app = _context8.sent;\n return _context8.abrupt("return", new Promise(function (resolve, reject) {\n var findedFile = app.file_list.find(function (file) {\n return file.file_id == file_id;\n });\n if (findedFile) {\n resolve(findedFile);\n } else {\n resolve(\'\');\n }\n }));\n case 4:\n case "end":\n return _context8.stop();\n }\n }, _callee8, this);\n }));\n function getFile(_x17, _x18) {\n return _getFile.apply(this, arguments);\n }\n return getFile;\n }()\n }, {\n key: "getFiles",\n value: function () {\n var _getFiles = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee9(app_id) {\n var filesId,\n app,\n _args9 = arguments;\n return FileManager_regeneratorRuntime().wrap(function _callee9$(_context9) {\n while (1) switch (_context9.prev = _context9.next) {\n case 0:\n filesId = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : [];\n _context9.next = 3;\n return this.appProcessor.getApp(app_id);\n case 3:\n app = _context9.sent;\n return _context9.abrupt("return", new Promise(function (resolve, reject) {\n var findedFiles = app.file_list.filter(function (file) {\n return filesId.some(function (id) {\n return id == file.file_id;\n });\n });\n if (findedFiles) {\n resolve(findedFiles);\n } else {\n resolve(\'\');\n }\n }));\n case 5:\n case "end":\n return _context9.stop();\n }\n }, _callee9, this);\n }));\n function getFiles(_x19) {\n return _getFiles.apply(this, arguments);\n }\n return getFiles;\n }()\n }, {\n key: "uploadFile",\n value: function () {\n var _uploadFile = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee10(fileData, app_id, item_id) {\n var file;\n return FileManager_regeneratorRuntime().wrap(function _callee10$(_context10) {\n while (1) switch (_context10.prev = _context10.next) {\n case 0:\n _context10.next = 2;\n return this.uploadFileApi(fileData, app_id, item_id);\n case 2:\n file = _context10.sent;\n this.addFileToStorage(app_id, file);\n return _context10.abrupt("return", file);\n case 5:\n case "end":\n return _context10.stop();\n }\n }, _callee10, this);\n }));\n function uploadFile(_x20, _x21, _x22) {\n return _uploadFile.apply(this, arguments);\n }\n return uploadFile;\n }()\n }, {\n key: "uploadFileFromString",\n value: function () {\n var _uploadFileFromString = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee11(fileObject) {\n var file;\n return FileManager_regeneratorRuntime().wrap(function _callee11$(_context11) {\n while (1) switch (_context11.prev = _context11.next) {\n case 0:\n _context11.next = 2;\n return this.uploadFileFromStringApi(fileObject);\n case 2:\n file = _context11.sent;\n this.addFileToStorage(file.app_id, file);\n return _context11.abrupt("return", file);\n case 5:\n case "end":\n return _context11.stop();\n }\n }, _callee11, this);\n }));\n function uploadFileFromString(_x23) {\n return _uploadFileFromString.apply(this, arguments);\n }\n return uploadFileFromString;\n }()\n }, {\n key: "updateFileFromString",\n value: function () {\n var _updateFileFromString = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee12(data, file_id, file_name, extension, format, alt, title) {\n var file;\n return FileManager_regeneratorRuntime().wrap(function _callee12$(_context12) {\n while (1) switch (_context12.prev = _context12.next) {\n case 0:\n _context12.next = 2;\n return this.updateFileFromStringApi(data, file_id, file_name, extension, format, alt, title);\n case 2:\n file = _context12.sent;\n this.updateFileInStorage(file_id, file.app_id, file);\n return _context12.abrupt("return", file);\n case 5:\n case "end":\n return _context12.stop();\n }\n }, _callee12, this);\n }));\n function updateFileFromString(_x24, _x25, _x26, _x27, _x28, _x29, _x30) {\n return _updateFileFromString.apply(this, arguments);\n }\n return updateFileFromString;\n }()\n }, {\n key: "deleteFile",\n value: function () {\n var _deleteFile = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee13(id, app_id) {\n return FileManager_regeneratorRuntime().wrap(function _callee13$(_context13) {\n while (1) switch (_context13.prev = _context13.next) {\n case 0:\n _context13.next = 2;\n return this.deleteFileApi(id);\n case 2:\n this.deleteFileFromStorage(id, app_id);\n return _context13.abrupt("return", true);\n case 4:\n case "end":\n return _context13.stop();\n }\n }, _callee13, this);\n }));\n function deleteFile(_x31, _x32) {\n return _deleteFile.apply(this, arguments);\n }\n return deleteFile;\n }()\n }, {\n key: "isFileExists",\n value: function () {\n var _isFileExists = FileManager_asyncToGenerator(/*#__PURE__*/FileManager_regeneratorRuntime().mark(function _callee14(app_id, file_id) {\n var urlPattern, file;\n return FileManager_regeneratorRuntime().wrap(function _callee14$(_context14) {\n while (1) switch (_context14.prev = _context14.next) {\n case 0:\n urlPattern = /^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$/;\n if (!Boolean(file_id)) {\n _context14.next = 12;\n break;\n }\n _context14.next = 4;\n return this.getFile(app_id, file_id);\n case 4:\n file = _context14.sent;\n if (!Boolean(file)) {\n _context14.next = 9;\n break;\n }\n return _context14.abrupt("return", urlPattern.test(file.url));\n case 9:\n return _context14.abrupt("return", false);\n case 10:\n _context14.next = 13;\n break;\n case 12:\n return _context14.abrupt("return", false);\n case 13:\n case "end":\n return _context14.stop();\n }\n }, _callee14, this);\n }));\n function isFileExists(_x33, _x34) {\n return _isFileExists.apply(this, arguments);\n }\n return isFileExists;\n }()\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/DocumentManager/DocumentManager.js\nfunction DocumentManager_typeof(o) { "@babel/helpers - typeof"; return DocumentManager_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, DocumentManager_typeof(o); }\nfunction DocumentManager_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction DocumentManager_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, DocumentManager_toPropertyKey(o.key), o); } }\nfunction DocumentManager_createClass(e, r, t) { return r && DocumentManager_defineProperties(e.prototype, r), t && DocumentManager_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction DocumentManager_toPropertyKey(t) { var i = DocumentManager_toPrimitive(t, "string"); return "symbol" == DocumentManager_typeof(i) ? i : i + ""; }\nfunction DocumentManager_toPrimitive(t, r) { if ("object" != DocumentManager_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != DocumentManager_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\n/* \n Document Template request\n {\n app_id: 1,\n item_id: 1\n element_id: 1,\n data: {}\n }\n\n*/\n\nvar DocumentManager = /*#__PURE__*/function () {\n function DocumentManager(req, pipeService) {\n DocumentManager_classCallCheck(this, DocumentManager);\n this.req = req;\n this.pipeService = pipeService;\n }\n return DocumentManager_createClass(DocumentManager, [{\n key: "createDocument",\n value: function 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 }, {\n key: "emitDocumentInsert",\n value: function emitDocumentInsert(data) {\n var 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 }, {\n key: "getDocument",\n value: function 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 }, {\n key: "getDocuments",\n value: function 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 }, {\n key: "deleteDocument",\n value: function 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}();\n;// CONCATENATED MODULE: ./GUDHUB/GHConstructor/interpritate.js\nfunction interpritate_typeof(o) { "@babel/helpers - typeof"; return interpritate_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, interpritate_typeof(o); }\nfunction interpritate_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ interpritate_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == interpritate_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(interpritate_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction interpritate_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction interpritate_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { interpritate_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { interpritate_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction interpritate_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction interpritate_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, interpritate_toPropertyKey(o.key), o); } }\nfunction interpritate_createClass(e, r, t) { return r && interpritate_defineProperties(e.prototype, r), t && interpritate_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction interpritate_toPropertyKey(t) { var i = interpritate_toPrimitive(t, "string"); return "symbol" == interpritate_typeof(i) ? i : i + ""; }\nfunction interpritate_toPrimitive(t, r) { if ("object" != interpritate_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != interpritate_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar Interpritate = /*#__PURE__*/function () {\n function Interpritate(gudhub) {\n interpritate_classCallCheck(this, Interpritate);\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 return interpritate_createClass(Interpritate, [{\n key: "getInterpretationObj",\n value: (function () {\n var _getInterpretationObj = interpritate_asyncToGenerator(/*#__PURE__*/interpritate_regeneratorRuntime().mark(function _callee(fieldDataModel, defaultFieldDataModel, src, containerId, itemId, appId) {\n var currentIntrpr, defaultIntrprObj, interpretation, i, item, filteredItems;\n return interpritate_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n currentIntrpr = []; // Creating default interpretation\n 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 interpretation = defaultIntrprObj;\n if (!(fieldDataModel.data_model && fieldDataModel.data_model.interpretation)) {\n _context.next = 22;\n break;\n }\n // To detect interpretation we use (container_id), if there is not (container_id) we use (src)\n for (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 i = 0;\n case 6:\n if (!(i < currentIntrpr.length)) {\n _context.next = 22;\n break;\n }\n if (!(currentIntrpr[i].settings && currentIntrpr[i].settings.condition_filter && currentIntrpr[i].settings.filters_list.length > 0)) {\n _context.next = 18;\n break;\n }\n _context.next = 10;\n return gudhub.getItem(appId, itemId);\n case 10:\n item = _context.sent;\n if (!item) {\n _context.next = 16;\n break;\n }\n filteredItems = gudhub.filter([item], currentIntrpr[i].settings.filters_list);\n if (!(filteredItems.length > 0)) {\n _context.next = 16;\n break;\n }\n interpretation = currentIntrpr[i];\n return _context.abrupt("break", 22);\n case 16:\n _context.next = 19;\n break;\n case 18:\n interpretation = gudhub.mergeObjects(interpretation, currentIntrpr[i]);\n case 19:\n i++;\n _context.next = 6;\n break;\n case 22:\n return _context.abrupt("return", interpretation);\n case 23:\n case "end":\n return _context.stop();\n }\n }, _callee);\n }));\n function getInterpretationObj(_x, _x2, _x3, _x4, _x5, _x6) {\n return _getInterpretationObj.apply(this, arguments);\n }\n return getInterpretationObj;\n }() /*********************** GET INTERPRETATION ***********************/)\n }, {\n key: "getInterpretation",\n value: function getInterpretation(value, field, dataType, source, itemId, appId, containerId) {\n var self = this;\n return new Promise(/*#__PURE__*/function () {\n var _ref = interpritate_asyncToGenerator(/*#__PURE__*/interpritate_regeneratorRuntime().mark(function _callee3(resolve, reject) {\n var data_type;\n return interpritate_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n /*-- By default we use \'data_type\' from field but in case if field is undefined we use \'dataType\' from attribute*/\n data_type = field && field.data_type ? field.data_type : dataType;\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(/*#__PURE__*/function () {\n var _ref2 = interpritate_asyncToGenerator(/*#__PURE__*/interpritate_regeneratorRuntime().mark(function _callee2(data) {\n var interpretationObj;\n return interpritate_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n if (!data) {\n _context2.next = 5;\n break;\n }\n _context2.next = 3;\n return self.getInterpretationObj(field, data.getTemplate().model, source, containerId, itemId, appId);\n case 3:\n interpretationObj = _context2.sent;\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 case 5:\n case "end":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function (_x9) {\n return _ref2.apply(this, arguments);\n };\n }(), function (error) {});\n } else {\n console.error(\'Get Interpretation: data_type is undefined\', dataType, field);\n }\n case 2:\n case "end":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function (_x7, _x8) {\n return _ref.apply(this, arguments);\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 }, {\n key: "getInterpretationById",\n value: (function () {\n var _getInterpretationById = interpritate_asyncToGenerator(/*#__PURE__*/interpritate_regeneratorRuntime().mark(function _callee4(appId, itemId, fieldId, interpretationId) {\n var value,\n field,\n fieldValue,\n fieldModel,\n instance,\n interpretatedValue,\n _args4 = arguments;\n return interpritate_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n value = _args4.length > 4 && _args4[4] !== undefined ? _args4[4] : null;\n field = _args4.length > 5 && _args4[5] !== undefined ? _args4[5] : null;\n if (!(value == null)) {\n _context4.next = 8;\n break;\n }\n _context4.next = 5;\n return this.gudhub.getFieldValue(appId, itemId, fieldId);\n case 5:\n _context4.t0 = _context4.sent;\n _context4.next = 9;\n break;\n case 8:\n _context4.t0 = value;\n case 9:\n fieldValue = _context4.t0;\n if (!(field == null)) {\n _context4.next = 16;\n break;\n }\n _context4.next = 13;\n return this.gudhub.getField(appId, fieldId);\n case 13:\n _context4.t1 = _context4.sent;\n _context4.next = 17;\n break;\n case 16:\n _context4.t1 = field;\n case 17:\n fieldModel = _context4.t1;\n if (!(fieldModel == null)) {\n _context4.next = 20;\n break;\n }\n return _context4.abrupt("return", \'\');\n case 20:\n _context4.next = 22;\n return this.gudhub.ghconstructor.getInstance(fieldModel.data_type);\n case 22:\n instance = _context4.sent;\n _context4.next = 25;\n return instance.getInterpretation(fieldValue, interpretationId, fieldModel.data_type, fieldModel, itemId, appId);\n case 25:\n interpretatedValue = _context4.sent;\n if (!(interpretatedValue.html == \'<span>no interpretation</span>\')) {\n _context4.next = 30;\n break;\n }\n return _context4.abrupt("return", fieldValue);\n case 30:\n return _context4.abrupt("return", interpretatedValue.html);\n case 31:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function getInterpretationById(_x10, _x11, _x12, _x13) {\n return _getInterpretationById.apply(this, arguments);\n }\n return getInterpretationById;\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 var response = JSON.parse(message.response);\n if (!response.data_type) return;\n gudhub.ghconstructor.getInstance(response.data_type).then(function (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\nfunction GroupManager_typeof(o) { "@babel/helpers - typeof"; return GroupManager_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, GroupManager_typeof(o); }\nfunction GroupManager_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ GroupManager_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == GroupManager_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(GroupManager_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction GroupManager_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction GroupManager_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { GroupManager_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { GroupManager_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction GroupManager_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction GroupManager_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, GroupManager_toPropertyKey(o.key), o); } }\nfunction GroupManager_createClass(e, r, t) { return r && GroupManager_defineProperties(e.prototype, r), t && GroupManager_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction GroupManager_toPropertyKey(t) { var i = GroupManager_toPrimitive(t, "string"); return "symbol" == GroupManager_typeof(i) ? i : i + ""; }\nfunction GroupManager_toPrimitive(t, r) { if ("object" != GroupManager_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != GroupManager_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar GroupManager = /*#__PURE__*/function () {\n function GroupManager(gudhub, req) {\n GroupManager_classCallCheck(this, GroupManager);\n this.req = req;\n this.gudhub = gudhub;\n }\n\n //********************* CREATE GROUP *********************//\n return GroupManager_createClass(GroupManager, [{\n key: "createGroupApi",\n value: function () {\n var _createGroupApi = GroupManager_asyncToGenerator(/*#__PURE__*/GroupManager_regeneratorRuntime().mark(function _callee(groupName) {\n var form, group;\n return GroupManager_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context.t0 = _context.sent;\n _context.t1 = groupName;\n form = {\n token: _context.t0,\n group_name: _context.t1\n };\n _context.next = 8;\n return this.req.post({\n url: "/api/sharing-group/create-group",\n form: form\n });\n case 8:\n group = _context.sent;\n return _context.abrupt("return", group);\n case 12:\n _context.prev = 12;\n _context.t2 = _context["catch"](0);\n console.log(_context.t2);\n return _context.abrupt("return", null);\n case 16:\n case "end":\n return _context.stop();\n }\n }, _callee, this, [[0, 12]]);\n }));\n function createGroupApi(_x) {\n return _createGroupApi.apply(this, arguments);\n }\n return createGroupApi;\n }() //********************* UPDATE GROUP *********************//\n }, {\n key: "updateGroupApi",\n value: function () {\n var _updateGroupApi = GroupManager_asyncToGenerator(/*#__PURE__*/GroupManager_regeneratorRuntime().mark(function _callee2(groupId, groupName) {\n var form, group;\n return GroupManager_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.prev = 0;\n _context2.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context2.t0 = _context2.sent;\n _context2.t1 = groupName;\n _context2.t2 = groupId;\n form = {\n token: _context2.t0,\n group_name: _context2.t1,\n group_id: _context2.t2\n };\n _context2.next = 9;\n return this.req.post({\n url: "/api/sharing-group/update-group",\n form: form\n });\n case 9:\n group = _context2.sent;\n return _context2.abrupt("return", group);\n case 13:\n _context2.prev = 13;\n _context2.t3 = _context2["catch"](0);\n console.log(_context2.t3);\n return _context2.abrupt("return", null);\n case 17:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this, [[0, 13]]);\n }));\n function updateGroupApi(_x2, _x3) {\n return _updateGroupApi.apply(this, arguments);\n }\n return updateGroupApi;\n }() //********************* DELETE GROUP *********************//\n }, {\n key: "deleteGroupApi",\n value: function () {\n var _deleteGroupApi = GroupManager_asyncToGenerator(/*#__PURE__*/GroupManager_regeneratorRuntime().mark(function _callee3(groupId) {\n var form, group;\n return GroupManager_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.prev = 0;\n _context3.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context3.t0 = _context3.sent;\n _context3.t1 = groupId;\n form = {\n token: _context3.t0,\n group_id: _context3.t1\n };\n _context3.next = 8;\n return this.req.post({\n url: "/api/sharing-group/delete-group",\n form: form\n });\n case 8:\n group = _context3.sent;\n return _context3.abrupt("return", group);\n case 12:\n _context3.prev = 12;\n _context3.t2 = _context3["catch"](0);\n console.log(_context3.t2);\n return _context3.abrupt("return", null);\n case 16:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this, [[0, 12]]);\n }));\n function deleteGroupApi(_x4) {\n return _deleteGroupApi.apply(this, arguments);\n }\n return deleteGroupApi;\n }() //********************* ADD USER TO GROUP *********************//\n }, {\n key: "addUserToGroupApi",\n value: function () {\n var _addUserToGroupApi = GroupManager_asyncToGenerator(/*#__PURE__*/GroupManager_regeneratorRuntime().mark(function _callee4(groupId, userId, permission) {\n var form, group;\n return GroupManager_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.prev = 0;\n _context4.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context4.t0 = _context4.sent;\n _context4.t1 = groupId;\n _context4.t2 = userId;\n _context4.t3 = permission;\n form = {\n token: _context4.t0,\n group_id: _context4.t1,\n user_id: _context4.t2,\n group_permission: _context4.t3\n };\n _context4.next = 10;\n return this.req.post({\n url: "/api/sharing-group/add-user-to-group",\n form: form\n });\n case 10:\n group = _context4.sent;\n return _context4.abrupt("return", group);\n case 14:\n _context4.prev = 14;\n _context4.t4 = _context4["catch"](0);\n console.log(_context4.t4);\n return _context4.abrupt("return", null);\n case 18:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this, [[0, 14]]);\n }));\n function addUserToGroupApi(_x5, _x6, _x7) {\n return _addUserToGroupApi.apply(this, arguments);\n }\n return addUserToGroupApi;\n }() //********************* GET USERS BY GROUP *********************//\n }, {\n key: "getUsersByGroupApi",\n value: function () {\n var _getUsersByGroupApi = GroupManager_asyncToGenerator(/*#__PURE__*/GroupManager_regeneratorRuntime().mark(function _callee5(groupId) {\n var form, group;\n return GroupManager_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.prev = 0;\n _context5.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context5.t0 = _context5.sent;\n _context5.t1 = groupId;\n form = {\n token: _context5.t0,\n group_id: _context5.t1\n };\n _context5.next = 8;\n return this.req.post({\n url: "/api/sharing-group/get-users-by-group",\n form: form\n });\n case 8:\n group = _context5.sent;\n return _context5.abrupt("return", group);\n case 12:\n _context5.prev = 12;\n _context5.t2 = _context5["catch"](0);\n console.log(_context5.t2);\n return _context5.abrupt("return", null);\n case 16:\n case "end":\n return _context5.stop();\n }\n }, _callee5, this, [[0, 12]]);\n }));\n function getUsersByGroupApi(_x8) {\n return _getUsersByGroupApi.apply(this, arguments);\n }\n return getUsersByGroupApi;\n }() //********************* UPDATE USER IN GROUP *********************//\n }, {\n key: "updateUserInGroupApi",\n value: function () {\n var _updateUserInGroupApi = GroupManager_asyncToGenerator(/*#__PURE__*/GroupManager_regeneratorRuntime().mark(function _callee6(userId, groupId, permission) {\n var form, group;\n return GroupManager_regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n _context6.prev = 0;\n _context6.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context6.t0 = _context6.sent;\n _context6.t1 = userId;\n _context6.t2 = groupId;\n _context6.t3 = permission;\n form = {\n token: _context6.t0,\n user_id: _context6.t1,\n group_id: _context6.t2,\n group_permission: _context6.t3\n };\n _context6.next = 10;\n return this.req.post({\n url: "/api/sharing-group/update-user-in-group",\n form: form\n });\n case 10:\n group = _context6.sent;\n return _context6.abrupt("return", group);\n case 14:\n _context6.prev = 14;\n _context6.t4 = _context6["catch"](0);\n console.log(_context6.t4);\n return _context6.abrupt("return", null);\n case 18:\n case "end":\n return _context6.stop();\n }\n }, _callee6, this, [[0, 14]]);\n }));\n function updateUserInGroupApi(_x9, _x10, _x11) {\n return _updateUserInGroupApi.apply(this, arguments);\n }\n return updateUserInGroupApi;\n }() //********************* REMOVE USER FROM GROUP *********************//\n }, {\n key: "deleteUserFromGroupApi",\n value: function () {\n var _deleteUserFromGroupApi = GroupManager_asyncToGenerator(/*#__PURE__*/GroupManager_regeneratorRuntime().mark(function _callee7(userId, groupId) {\n var form, group;\n return GroupManager_regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n _context7.prev = 0;\n _context7.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context7.t0 = _context7.sent;\n _context7.t1 = userId;\n _context7.t2 = groupId;\n form = {\n token: _context7.t0,\n user_id: _context7.t1,\n group_id: _context7.t2\n };\n _context7.next = 9;\n return this.req.post({\n url: "/api/sharing-group/delete-user-from-group",\n form: form\n });\n case 9:\n group = _context7.sent;\n return _context7.abrupt("return", group);\n case 13:\n _context7.prev = 13;\n _context7.t3 = _context7["catch"](0);\n console.log(_context7.t3);\n return _context7.abrupt("return", null);\n case 17:\n case "end":\n return _context7.stop();\n }\n }, _callee7, this, [[0, 13]]);\n }));\n function deleteUserFromGroupApi(_x12, _x13) {\n return _deleteUserFromGroupApi.apply(this, arguments);\n }\n return deleteUserFromGroupApi;\n }() //********************* GET GROUPS BY USER *********************//\n }, {\n key: "getGroupsByUserApi",\n value: function () {\n var _getGroupsByUserApi = GroupManager_asyncToGenerator(/*#__PURE__*/GroupManager_regeneratorRuntime().mark(function _callee8(userId) {\n var form, group;\n return GroupManager_regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n _context8.prev = 0;\n _context8.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context8.t0 = _context8.sent;\n _context8.t1 = userId;\n form = {\n token: _context8.t0,\n user_id: _context8.t1\n };\n _context8.next = 8;\n return this.req.post({\n url: "/api/sharing-group/get-groups-by-user",\n form: form\n });\n case 8:\n group = _context8.sent;\n return _context8.abrupt("return", group);\n case 12:\n _context8.prev = 12;\n _context8.t2 = _context8["catch"](0);\n console.log(_context8.t2);\n return _context8.abrupt("return", null);\n case 16:\n case "end":\n return _context8.stop();\n }\n }, _callee8, this, [[0, 12]]);\n }));\n function getGroupsByUserApi(_x14) {\n return _getGroupsByUserApi.apply(this, arguments);\n }\n return getGroupsByUserApi;\n }()\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/Utils/sharing/AppGroupSharing.js\nfunction AppGroupSharing_typeof(o) { "@babel/helpers - typeof"; return AppGroupSharing_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, AppGroupSharing_typeof(o); }\nfunction AppGroupSharing_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ AppGroupSharing_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == AppGroupSharing_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(AppGroupSharing_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction AppGroupSharing_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction AppGroupSharing_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { AppGroupSharing_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { AppGroupSharing_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction AppGroupSharing_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction AppGroupSharing_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, AppGroupSharing_toPropertyKey(o.key), o); } }\nfunction AppGroupSharing_createClass(e, r, t) { return r && AppGroupSharing_defineProperties(e.prototype, r), t && AppGroupSharing_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction AppGroupSharing_toPropertyKey(t) { var i = AppGroupSharing_toPrimitive(t, "string"); return "symbol" == AppGroupSharing_typeof(i) ? i : i + ""; }\nfunction AppGroupSharing_toPrimitive(t, r) { if ("object" != AppGroupSharing_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != AppGroupSharing_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar AppGroupSharing = /*#__PURE__*/function () {\n function AppGroupSharing(gudhub, req) {\n AppGroupSharing_classCallCheck(this, AppGroupSharing);\n this.req = req;\n this.gudhub = gudhub;\n }\n\n //********************* ADD APP TO GROUP *********************//\n return AppGroupSharing_createClass(AppGroupSharing, [{\n key: "addAppToGroupApi",\n value: function () {\n var _addAppToGroupApi = AppGroupSharing_asyncToGenerator(/*#__PURE__*/AppGroupSharing_regeneratorRuntime().mark(function _callee(appId, groupId, permission) {\n var form, group;\n return AppGroupSharing_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context.t0 = _context.sent;\n _context.t1 = appId;\n _context.t2 = groupId;\n _context.t3 = permission;\n form = {\n token: _context.t0,\n app_id: _context.t1,\n group_id: _context.t2,\n app_permission: _context.t3\n };\n _context.next = 10;\n return this.req.post({\n url: "/api/sharing-group/add-app-to-group",\n form: form\n });\n case 10:\n group = _context.sent;\n return _context.abrupt("return", group);\n case 14:\n _context.prev = 14;\n _context.t4 = _context["catch"](0);\n console.log(_context.t4);\n return _context.abrupt("return", null);\n case 18:\n case "end":\n return _context.stop();\n }\n }, _callee, this, [[0, 14]]);\n }));\n function addAppToGroupApi(_x, _x2, _x3) {\n return _addAppToGroupApi.apply(this, arguments);\n }\n return addAppToGroupApi;\n }() //********************* GET APPS BY GROUP *********************//\n }, {\n key: "getAppsByGroupApi",\n value: function () {\n var _getAppsByGroupApi = AppGroupSharing_asyncToGenerator(/*#__PURE__*/AppGroupSharing_regeneratorRuntime().mark(function _callee2(groupId) {\n var form, group;\n return AppGroupSharing_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.prev = 0;\n _context2.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context2.t0 = _context2.sent;\n _context2.t1 = groupId;\n form = {\n token: _context2.t0,\n group_id: _context2.t1\n };\n _context2.next = 8;\n return this.req.post({\n url: "/api/sharing-group/get-apps-by-group",\n form: form\n });\n case 8:\n group = _context2.sent;\n return _context2.abrupt("return", group);\n case 12:\n _context2.prev = 12;\n _context2.t2 = _context2["catch"](0);\n console.log(_context2.t2);\n return _context2.abrupt("return", null);\n case 16:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this, [[0, 12]]);\n }));\n function getAppsByGroupApi(_x4) {\n return _getAppsByGroupApi.apply(this, arguments);\n }\n return getAppsByGroupApi;\n }() //********************* UPDATE APP IN GROUP *********************//\n }, {\n key: "updateAppInGroupApi",\n value: function () {\n var _updateAppInGroupApi = AppGroupSharing_asyncToGenerator(/*#__PURE__*/AppGroupSharing_regeneratorRuntime().mark(function _callee3(appId, groupId, permission) {\n var form, group;\n return AppGroupSharing_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.prev = 0;\n _context3.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context3.t0 = _context3.sent;\n _context3.t1 = groupId;\n _context3.t2 = appId;\n _context3.t3 = permission;\n form = {\n token: _context3.t0,\n group_id: _context3.t1,\n app_id: _context3.t2,\n app_permission: _context3.t3\n };\n _context3.next = 10;\n return this.req.post({\n url: "/api/sharing-group/update-app-in-group",\n form: form\n });\n case 10:\n group = _context3.sent;\n return _context3.abrupt("return", group);\n case 14:\n _context3.prev = 14;\n _context3.t4 = _context3["catch"](0);\n console.log(_context3.t4);\n return _context3.abrupt("return", null);\n case 18:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this, [[0, 14]]);\n }));\n function updateAppInGroupApi(_x5, _x6, _x7) {\n return _updateAppInGroupApi.apply(this, arguments);\n }\n return updateAppInGroupApi;\n }() //********************* DELETE APP FROM GROUP *********************//\n }, {\n key: "deleteAppFromGroupApi",\n value: function () {\n var _deleteAppFromGroupApi = AppGroupSharing_asyncToGenerator(/*#__PURE__*/AppGroupSharing_regeneratorRuntime().mark(function _callee4(appId, groupId, permission) {\n var form, group;\n return AppGroupSharing_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.prev = 0;\n _context4.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context4.t0 = _context4.sent;\n _context4.t1 = groupId;\n _context4.t2 = appId;\n _context4.t3 = permission;\n form = {\n token: _context4.t0,\n group_id: _context4.t1,\n app_id: _context4.t2,\n app_permission: _context4.t3\n };\n _context4.next = 10;\n return this.req.post({\n url: "/api/sharing-group/delete-app-from-group",\n form: form\n });\n case 10:\n group = _context4.sent;\n return _context4.abrupt("return", group);\n case 14:\n _context4.prev = 14;\n _context4.t4 = _context4["catch"](0);\n console.log(_context4.t4);\n return _context4.abrupt("return", null);\n case 18:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this, [[0, 14]]);\n }));\n function deleteAppFromGroupApi(_x8, _x9, _x10) {\n return _deleteAppFromGroupApi.apply(this, arguments);\n }\n return deleteAppFromGroupApi;\n }() //********************* GET GROUPS BY APP *********************//\n }, {\n key: "getGroupsByAppApi",\n value: function () {\n var _getGroupsByAppApi = AppGroupSharing_asyncToGenerator(/*#__PURE__*/AppGroupSharing_regeneratorRuntime().mark(function _callee5(appId) {\n var form, group;\n return AppGroupSharing_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.prev = 0;\n _context5.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context5.t0 = _context5.sent;\n _context5.t1 = appId;\n form = {\n token: _context5.t0,\n app_id: _context5.t1\n };\n _context5.next = 8;\n return this.req.post({\n url: "/api/sharing-group/get-groups-by-app",\n form: form\n });\n case 8:\n group = _context5.sent;\n return _context5.abrupt("return", group);\n case 12:\n _context5.prev = 12;\n _context5.t2 = _context5["catch"](0);\n console.log(_context5.t2);\n return _context5.abrupt("return", null);\n case 16:\n case "end":\n return _context5.stop();\n }\n }, _callee5, this, [[0, 12]]);\n }));\n function getGroupsByAppApi(_x11) {\n return _getGroupsByAppApi.apply(this, arguments);\n }\n return getGroupsByAppApi;\n }()\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/Utils/sharing/GroupSharing.js\nfunction GroupSharing_typeof(o) { "@babel/helpers - typeof"; return GroupSharing_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, GroupSharing_typeof(o); }\nfunction GroupSharing_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ GroupSharing_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == GroupSharing_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(GroupSharing_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction GroupSharing_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction GroupSharing_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { GroupSharing_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { GroupSharing_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction GroupSharing_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction GroupSharing_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, GroupSharing_toPropertyKey(o.key), o); } }\nfunction GroupSharing_createClass(e, r, t) { return r && GroupSharing_defineProperties(e.prototype, r), t && GroupSharing_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction GroupSharing_toPropertyKey(t) { var i = GroupSharing_toPrimitive(t, "string"); return "symbol" == GroupSharing_typeof(i) ? i : i + ""; }\nfunction GroupSharing_toPrimitive(t, r) { if ("object" != GroupSharing_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != GroupSharing_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\n\n\nvar GroupSharing = /*#__PURE__*/function () {\n function GroupSharing(gudhub, req, pipeService) {\n GroupSharing_classCallCheck(this, GroupSharing);\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 return GroupSharing_createClass(GroupSharing, [{\n key: "createGroup",\n value: function createGroup(groupName) {\n return this.groupManager.createGroupApi(groupName);\n }\n }, {\n key: "updateGroup",\n value: function updateGroup(groupId, groupName) {\n return this.groupManager.updateGroupApi(groupId, groupName);\n }\n }, {\n key: "deleteGroup",\n value: function deleteGroup(groupId) {\n return this.groupManager.deleteGroupApi(groupId);\n }\n }, {\n key: "addUserToGroup",\n value: function () {\n var _addUserToGroup = GroupSharing_asyncToGenerator(/*#__PURE__*/GroupSharing_regeneratorRuntime().mark(function _callee(userId, groupId, permission) {\n var newUser;\n return GroupSharing_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this.groupManager.addUserToGroupApi(userId, groupId, permission);\n case 2:\n newUser = _context.sent;\n this.pipeService.emit("group_members_add", {\n app_id: "group_sharing"\n }, newUser);\n return _context.abrupt("return", newUser);\n case 5:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function addUserToGroup(_x, _x2, _x3) {\n return _addUserToGroup.apply(this, arguments);\n }\n return addUserToGroup;\n }()\n }, {\n key: "getUsersByGroup",\n value: function getUsersByGroup(groupId) {\n return this.groupManager.getUsersByGroupApi(groupId);\n }\n }, {\n key: "updateUserInGroup",\n value: function () {\n var _updateUserInGroup = GroupSharing_asyncToGenerator(/*#__PURE__*/GroupSharing_regeneratorRuntime().mark(function _callee2(userId, groupId, permission) {\n var updatedUser;\n return GroupSharing_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this.groupManager.updateUserInGroupApi(userId, groupId, permission);\n case 2:\n updatedUser = _context2.sent;\n this.pipeService.emit("group_members_update", {\n app_id: "group_sharing"\n }, updatedUser);\n return _context2.abrupt("return", updatedUser);\n case 5:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function updateUserInGroup(_x4, _x5, _x6) {\n return _updateUserInGroup.apply(this, arguments);\n }\n return updateUserInGroup;\n }()\n }, {\n key: "deleteUserFromGroup",\n value: function () {\n var _deleteUserFromGroup = GroupSharing_asyncToGenerator(/*#__PURE__*/GroupSharing_regeneratorRuntime().mark(function _callee3(userId, groupId) {\n var deletedUser;\n return GroupSharing_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return this.groupManager.deleteUserFromGroupApi(userId, groupId);\n case 2:\n deletedUser = _context3.sent;\n this.pipeService.emit("group_members_delete", {\n app_id: "group_sharing"\n }, deletedUser);\n return _context3.abrupt("return", deletedUser);\n case 5:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function deleteUserFromGroup(_x7, _x8) {\n return _deleteUserFromGroup.apply(this, arguments);\n }\n return deleteUserFromGroup;\n }()\n }, {\n key: "getGroupsByUser",\n value: function getGroupsByUser(userId) {\n return this.groupManager.getGroupsByUserApi(userId);\n }\n }, {\n key: "addAppToGroup",\n value: function addAppToGroup(appId, groupId, permission) {\n return this.appGroupSharing.addAppToGroupApi(appId, groupId, permission);\n }\n }, {\n key: "getAppsByGroup",\n value: function getAppsByGroup(groupId) {\n return this.appGroupSharing.getAppsByGroupApi(groupId);\n }\n }, {\n key: "updateAppInGroup",\n value: function updateAppInGroup(appId, groupId, permission) {\n return this.appGroupSharing.updateAppInGroupApi(appId, groupId, permission);\n }\n }, {\n key: "deleteAppFromGroup",\n value: function deleteAppFromGroup(appId, groupId, permission) {\n return this.appGroupSharing.deleteAppFromGroupApi(appId, groupId, permission);\n }\n }, {\n key: "getGroupsByApp",\n value: function getGroupsByApp(appId) {\n return this.appGroupSharing.getGroupsByAppApi(appId);\n }\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/Utils/sharing/Sharing.js\nfunction Sharing_typeof(o) { "@babel/helpers - typeof"; return Sharing_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, Sharing_typeof(o); }\nfunction Sharing_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ Sharing_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == Sharing_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(Sharing_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction Sharing_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction Sharing_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { Sharing_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { Sharing_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction Sharing_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction Sharing_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, Sharing_toPropertyKey(o.key), o); } }\nfunction Sharing_createClass(e, r, t) { return r && Sharing_defineProperties(e.prototype, r), t && Sharing_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction Sharing_toPropertyKey(t) { var i = Sharing_toPrimitive(t, "string"); return "symbol" == Sharing_typeof(i) ? i : i + ""; }\nfunction Sharing_toPrimitive(t, r) { if ("object" != Sharing_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != Sharing_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar Sharing = /*#__PURE__*/function () {\n function Sharing(gudhub, req) {\n Sharing_classCallCheck(this, Sharing);\n this.req = req;\n this.gudhub = gudhub;\n }\n return Sharing_createClass(Sharing, [{\n key: "add",\n value: function () {\n var _add = Sharing_asyncToGenerator(/*#__PURE__*/Sharing_regeneratorRuntime().mark(function _callee(appId, userId, permission) {\n var form, response;\n return Sharing_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context.t0 = _context.sent;\n _context.t1 = appId;\n _context.t2 = userId;\n _context.t3 = permission;\n form = {\n token: _context.t0,\n app_id: _context.t1,\n user_id: _context.t2,\n sharing_permission: _context.t3\n };\n _context.next = 10;\n return this.req.post({\n url: "/sharing/add",\n form: form\n });\n case 10:\n response = _context.sent;\n return _context.abrupt("return", response);\n case 14:\n _context.prev = 14;\n _context.t4 = _context["catch"](0);\n console.log(_context.t4);\n return _context.abrupt("return", null);\n case 18:\n case "end":\n return _context.stop();\n }\n }, _callee, this, [[0, 14]]);\n }));\n function add(_x, _x2, _x3) {\n return _add.apply(this, arguments);\n }\n return add;\n }()\n }, {\n key: "update",\n value: function () {\n var _update = Sharing_asyncToGenerator(/*#__PURE__*/Sharing_regeneratorRuntime().mark(function _callee2(appId, userId, permission) {\n var form, response;\n return Sharing_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.prev = 0;\n _context2.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context2.t0 = _context2.sent;\n _context2.t1 = appId;\n _context2.t2 = userId;\n _context2.t3 = permission;\n form = {\n token: _context2.t0,\n app_id: _context2.t1,\n user_id: _context2.t2,\n sharing_permission: _context2.t3\n };\n _context2.next = 10;\n return this.req.post({\n url: "/sharing/update",\n form: form\n });\n case 10:\n response = _context2.sent;\n return _context2.abrupt("return", response);\n case 14:\n _context2.prev = 14;\n _context2.t4 = _context2["catch"](0);\n console.log(_context2.t4);\n return _context2.abrupt("return", null);\n case 18:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this, [[0, 14]]);\n }));\n function update(_x4, _x5, _x6) {\n return _update.apply(this, arguments);\n }\n return update;\n }()\n }, {\n key: "delete",\n value: function () {\n var _delete2 = Sharing_asyncToGenerator(/*#__PURE__*/Sharing_regeneratorRuntime().mark(function _callee3(appId, userId) {\n var form, response;\n return Sharing_regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.prev = 0;\n _context3.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context3.t0 = _context3.sent;\n _context3.t1 = appId;\n _context3.t2 = userId;\n form = {\n token: _context3.t0,\n app_id: _context3.t1,\n user_id: _context3.t2\n };\n _context3.next = 9;\n return this.req.post({\n url: "/sharing/delete",\n form: form\n });\n case 9:\n response = _context3.sent;\n return _context3.abrupt("return", response);\n case 13:\n _context3.prev = 13;\n _context3.t3 = _context3["catch"](0);\n console.log(_context3.t3);\n return _context3.abrupt("return", null);\n case 17:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this, [[0, 13]]);\n }));\n function _delete(_x7, _x8) {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n }, {\n key: "getAppUsers",\n value: function () {\n var _getAppUsers = Sharing_asyncToGenerator(/*#__PURE__*/Sharing_regeneratorRuntime().mark(function _callee4(appId) {\n var form, response;\n return Sharing_regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.prev = 0;\n _context4.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context4.t0 = _context4.sent;\n _context4.t1 = appId;\n form = {\n token: _context4.t0,\n app_id: _context4.t1\n };\n _context4.next = 8;\n return this.req.post({\n url: "/sharing/get-app-users",\n form: form\n });\n case 8:\n response = _context4.sent;\n return _context4.abrupt("return", response);\n case 12:\n _context4.prev = 12;\n _context4.t2 = _context4["catch"](0);\n console.log(_context4.t2);\n return _context4.abrupt("return", null);\n case 16:\n case "end":\n return _context4.stop();\n }\n }, _callee4, this, [[0, 12]]);\n }));\n function getAppUsers(_x9) {\n return _getAppUsers.apply(this, arguments);\n }\n return getAppUsers;\n }()\n }, {\n key: "addInvitation",\n value: function () {\n var _addInvitation = Sharing_asyncToGenerator(/*#__PURE__*/Sharing_regeneratorRuntime().mark(function _callee5(guestsEmails, apps) {\n var form, response;\n return Sharing_regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.prev = 0;\n _context5.next = 3;\n return this.gudhub.auth.getToken();\n case 3:\n _context5.t0 = _context5.sent;\n _context5.t1 = guestsEmails;\n _context5.t2 = apps;\n form = {\n token: _context5.t0,\n guests_emails: _context5.t1,\n apps: _context5.t2\n };\n _context5.next = 9;\n return this.req.post({\n url: "/api/invitation/add",\n form: form\n });\n case 9:\n response = _context5.sent;\n return _context5.abrupt("return", response);\n case 13:\n _context5.prev = 13;\n _context5.t3 = _context5["catch"](0);\n console.log(_context5.t3);\n return _context5.abrupt("return", null);\n case 17:\n case "end":\n return _context5.stop();\n }\n }, _callee5, this, [[0, 13]]);\n }));\n function addInvitation(_x10, _x11) {\n return _addInvitation.apply(this, arguments);\n }\n return addInvitation;\n }()\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/WebSocket/WebSocketEmitter.js\nfunction WebSocketEmitter_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ WebSocketEmitter_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == WebSocketEmitter_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(WebSocketEmitter_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction WebSocketEmitter_typeof(o) { "@babel/helpers - typeof"; return WebSocketEmitter_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, WebSocketEmitter_typeof(o); }\nfunction WebSocketEmitter_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction WebSocketEmitter_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { WebSocketEmitter_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { WebSocketEmitter_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction WebSocketEmitter_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction WebSocketEmitter_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, WebSocketEmitter_toPropertyKey(o.key), o); } }\nfunction WebSocketEmitter_createClass(e, r, t) { return r && WebSocketEmitter_defineProperties(e.prototype, r), t && WebSocketEmitter_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction WebSocketEmitter_toPropertyKey(t) { var i = WebSocketEmitter_toPrimitive(t, "string"); return "symbol" == WebSocketEmitter_typeof(i) ? i : i + ""; }\nfunction WebSocketEmitter_toPrimitive(t, r) { if ("object" != WebSocketEmitter_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != WebSocketEmitter_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\nvar WebSocketEmitter = /*#__PURE__*/function () {\n function WebSocketEmitter(gudhub) {\n WebSocketEmitter_classCallCheck(this, WebSocketEmitter);\n this.gudhub = gudhub;\n }\n return WebSocketEmitter_createClass(WebSocketEmitter, [{\n key: "emitToUser",\n value: function () {\n var _emitToUser = WebSocketEmitter_asyncToGenerator(/*#__PURE__*/WebSocketEmitter_regeneratorRuntime().mark(function _callee(user_id, data) {\n var message, response;\n return WebSocketEmitter_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n message = {\n user_id: user_id,\n data: WebSocketEmitter_typeof(data) === \'object\' ? JSON.stringify(data) : data\n };\n _context.next = 3;\n return this.gudhub.req.post({\n url: \'/ws/emit-to-user\',\n form: message\n });\n case 3:\n response = _context.sent;\n return _context.abrupt("return", response);\n case 5:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function emitToUser(_x, _x2) {\n return _emitToUser.apply(this, arguments);\n }\n return emitToUser;\n }()\n }, {\n key: "broadcastToAppSubscribers",\n value: function () {\n var _broadcastToAppSubscribers = WebSocketEmitter_asyncToGenerator(/*#__PURE__*/WebSocketEmitter_regeneratorRuntime().mark(function _callee2(app_id, data_type, data) {\n var message, response;\n return WebSocketEmitter_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n message = {\n app_id: app_id,\n data: JSON.stringify({\n data_type: data_type,\n data: data\n })\n };\n _context2.next = 3;\n return this.gudhub.req.post({\n url: \'/ws/broadcast-to-app-subscribers\',\n form: message\n });\n case 3:\n response = _context2.sent;\n return _context2.abrupt("return", response);\n case 5:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function broadcastToAppSubscribers(_x3, _x4, _x5) {\n return _broadcastToAppSubscribers.apply(this, arguments);\n }\n return broadcastToAppSubscribers;\n }()\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/gudhub.js\nfunction gudhub_typeof(o) { "@babel/helpers - typeof"; return gudhub_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, gudhub_typeof(o); }\nfunction gudhub_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ gudhub_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == gudhub_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(gudhub_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction gudhub_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction gudhub_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { gudhub_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { gudhub_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction gudhub_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }\nfunction gudhub_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, gudhub_toPropertyKey(o.key), o); } }\nfunction gudhub_createClass(e, r, t) { return r && gudhub_defineProperties(e.prototype, r), t && gudhub_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }\nfunction gudhub_toPropertyKey(t) { var i = gudhub_toPrimitive(t, "string"); return "symbol" == gudhub_typeof(i) ? i : i + ""; }\nfunction gudhub_toPrimitive(t, r) { if ("object" != gudhub_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != gudhub_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }\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\nvar GudHub = /*#__PURE__*/function () {\n function GudHub(authKey) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\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 gudhub_classCallCheck(this, GudHub);\n this.serialized = {\n authKey: authKey,\n options: 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 var 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 return gudhub_createClass(GudHub, [{\n key: "activateSW",\n value: function () {\n var _activateSW = gudhub_asyncToGenerator(/*#__PURE__*/gudhub_regeneratorRuntime().mark(function _callee(swLink) {\n var sw;\n return gudhub_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(consts/* IS_BROWSER_MAIN_THREAD */.tH && "serviceWorker" in window.navigator)) {\n _context.next = 14;\n break;\n }\n _context.prev = 1;\n _context.next = 4;\n return window.navigator.serviceWorker.register(swLink);\n case 4:\n sw = _context.sent;\n sw.update().then(function () {\n return console.log("%cSW ->>> Service worker successful updated", "display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;");\n })["catch"](function () {\n return console.warn("SW ->>> Service worker is not updated");\n });\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 _context.next = 12;\n break;\n case 9:\n _context.prev = 9;\n _context.t0 = _context["catch"](1);\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;", _context.t0);\n case 12:\n _context.next = 15;\n break;\n case 14:\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 case 15:\n case "end":\n return _context.stop();\n }\n }, _callee, null, [[1, 9]]);\n }));\n function activateSW(_x) {\n return _activateSW.apply(this, arguments);\n }\n return activateSW;\n }() //************************* PIPESERVICE METHODS ****************************//\n //============= ON PIPE ===============//\n }, {\n key: "on",\n value: function on(types, destination, fn) {\n this.pipeService.on(types, destination, fn);\n return this;\n }\n\n //============= EMIT PIPE ==============//\n }, {\n key: "emit",\n value: function emit(types, destination, address, params) {\n this.pipeService.emit(types, destination, address, params);\n return this;\n }\n\n //============ DELETE LISTENER ========//\n }, {\n key: "destroy",\n value: function destroy(types, destination, func) {\n this.pipeService.destroy(types, destination, func);\n return this;\n }\n\n //************************* FILTERATION ****************************//\n }, {\n key: "prefilter",\n value: function prefilter(filters_list, variables) {\n return this.util.prefilter(filters_list, variables);\n }\n\n //============ DEBOUNCE ========//\n }, {\n key: "debounce",\n value: function debounce(func, delay) {\n return this.util.debounce(func, delay);\n }\n\n //************************* WEBSOCKETS EMITTER ****************************//\n }, {\n key: "emitToUser",\n value: function emitToUser(user_id, data) {\n return this.websocketsemitter.emitToUser(user_id, data);\n }\n }, {\n key: "broadcastToAppSubscribers",\n value: function broadcastToAppSubscribers(app_id, data_type, data) {\n return this.websocketsemitter.broadcastToAppSubscribers(app_id, data_type, data);\n }\n\n /******************* INTERPRITATE *******************/\n }, {\n key: "getInterpretation",\n value: function 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 key: "getInterpretationById",\n value: function getInterpretationById(appId, itemId, fieldId, interpretationId, value, field) {\n return this.interpritate.getInterpretationById(appId, itemId, fieldId, interpretationId, value, field);\n }\n\n //============ FILTER ==========//\n }, {\n key: "filter",\n value: function filter(items, filter_list) {\n return this.util.filter(items, filter_list);\n }\n\n //============ MERGE FILTERS ==========//\n }, {\n key: "mergeFilters",\n value: function mergeFilters(source, destination) {\n return this.util.mergeFilters(source, destination);\n }\n\n //============ GROUP ==========//\n }, {\n key: "group",\n value: function group(fieldGroup, items) {\n return this.util.group(fieldGroup, items);\n }\n\n //============ GET FILTERED ITEMS ==========//\n //it returns items with applyed filter\n }, {\n key: "getFilteredItems",\n value: function getFilteredItems(items, filters_list) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\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 }, {\n key: "sortItems",\n value: function sortItems(items, options) {\n return this.util.sortItems(items, options);\n }\n\n //\n //here\n }, {\n key: "triggerAppChange",\n value: function triggerAppChange(id, prevVersion, newVersion) {\n this.itemProcessor.handleItemsChange(id, prevVersion, newVersion);\n this.appProcessor.handleAppChange(id, prevVersion, newVersion);\n }\n\n //\n //TODO handleAppChange\n }, {\n key: "triggerIemsChange",\n value: function triggerIemsChange(id, compareRes) {\n this.itemProcessor.triggerItemsChange(id, compareRes);\n }\n }, {\n key: "jsonToItems",\n value: function jsonToItems(json, map) {\n return this.util.jsonToItems(json, map);\n }\n }, {\n key: "getDate",\n value: function getDate(queryKey) {\n return this.util.getDate(queryKey);\n }\n }, {\n key: "populateWithDate",\n value: function populateWithDate(items, model) {\n return this.util.populateWithDate(items, model);\n }\n }, {\n key: "checkRecurringDate",\n value: function checkRecurringDate(date, option) {\n return this.util.checkRecurringDate(date, option);\n }\n }, {\n key: "populateItems",\n value: function populateItems(items, model, keep_data) {\n return this.util.populateItems(items, model, keep_data);\n }\n }, {\n key: "populateWithItemRef",\n value: function populateWithItemRef(sourceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id) {\n return this.util.populateWithItemRef(sourceItemsRef, srcFieldIdToCompare, destinationItems, destFieldIdToCompare, destFieldForRef, app_id);\n }\n }, {\n key: "compareItems",\n value: function compareItems(sourceItems, destinationItems, fieldToCompare) {\n return this.util.compareItems(sourceItems, destinationItems, fieldToCompare);\n }\n }, {\n key: "mergeItems",\n value: function mergeItems(sourceItems, destinationItems, mergeByFieldId) {\n return this.util.mergeItems(sourceItems, destinationItems, mergeByFieldId);\n }\n }, {\n key: "mergeObjects",\n value: function mergeObjects(sourceObject, destinationObject) {\n return this.util.mergeObjects(sourceObject, destinationObject);\n }\n }, {\n key: "makeNestedList",\n value: function makeNestedList(arr, id, parent_id, children_property, priority_property) {\n return this.util.makeNestedList(arr, id, parent_id, children_property, priority_property);\n }\n }, {\n key: "jsonConstructor",\n value: function jsonConstructor(scheme, items, variables, appId) {\n return this.util.jsonConstructor(scheme, items, variables, appId);\n }\n\n //************************* APP PROCESSOR ****************************//\n }, {\n key: "getAppsList",\n value: function getAppsList() {\n return this.appProcessor.getAppsList();\n }\n }, {\n key: "getAppInfo",\n value: function getAppInfo(app_id) {\n return this.appProcessor.getAppInfo(app_id);\n }\n }, {\n key: "deleteApp",\n value: function deleteApp(app_id) {\n return this.appProcessor.deleteApp(app_id);\n }\n }, {\n key: "getApp",\n value: function getApp(app_id) {\n return this.appProcessor.getApp(app_id);\n }\n }, {\n key: "updateApp",\n value: function updateApp(app) {\n return this.appProcessor.updateApp(app);\n }\n }, {\n key: "updateAppInfo",\n value: function updateAppInfo(appInfo) {\n return this.appProcessor.updateAppInfo(appInfo);\n }\n }, {\n key: "createNewApp",\n value: function createNewApp(app) {\n return this.appProcessor.createNewApp(app);\n }\n }, {\n key: "getItems",\n value: function getItems(app_id) {\n return this.itemProcessor.getItems(app_id);\n }\n }, {\n key: "getItem",\n value: function () {\n var _getItem = gudhub_asyncToGenerator(/*#__PURE__*/gudhub_regeneratorRuntime().mark(function _callee2(app_id, item_id) {\n var items;\n return gudhub_regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return this.getItems(app_id);\n case 2:\n items = _context2.sent;\n if (!items) {\n _context2.next = 5;\n break;\n }\n return _context2.abrupt("return", items.find(function (item) {\n return item.item_id == item_id;\n }));\n case 5:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function getItem(_x2, _x3) {\n return _getItem.apply(this, arguments);\n }\n return getItem;\n }()\n }, {\n key: "addNewItems",\n value: function addNewItems(app_id, itemsList) {\n return this.itemProcessor.addNewItems(app_id, itemsList);\n }\n }, {\n key: "updateItems",\n value: function updateItems(app_id, itemsList) {\n return this.itemProcessor.updateItems(app_id, itemsList);\n }\n }, {\n key: "deleteItems",\n value: function deleteItems(app_id, itemsIds) {\n return this.itemProcessor.deleteItems(app_id, itemsIds);\n }\n }, {\n key: "getField",\n value: function getField(app_id, field_id) {\n return this.fieldProcessor.getField(app_id, field_id);\n }\n }, {\n key: "getFieldIdByNameSpace",\n value: function getFieldIdByNameSpace(app_id, name_space) {\n return this.fieldProcessor.getFieldIdByNameSpace(app_id, name_space);\n }\n }, {\n key: "getFieldModels",\n value: function getFieldModels(app_id) {\n return this.fieldProcessor.getFieldModels(app_id);\n }\n }, {\n key: "updateField",\n value: function updateField(app_id, fieldModel) {\n return this.fieldProcessor.updateField(app_id, fieldModel);\n }\n }, {\n key: "deleteField",\n value: function deleteField(app_id, field_id) {\n return this.fieldProcessor.deleteField(app_id, field_id);\n }\n }, {\n key: "getFieldValue",\n value: function getFieldValue(app_id, item_id, field_id) {\n return this.fieldProcessor.getFieldValue(app_id, item_id, field_id);\n }\n }, {\n key: "setFieldValue",\n value: function setFieldValue(app_id, item_id, field_id, field_value) {\n return this.fieldProcessor.setFieldValue(app_id, item_id, field_id, field_value);\n }\n }, {\n key: "getFile",\n value: function getFile(app_id, file_id) {\n return this.fileManager.getFile(app_id, file_id);\n }\n }, {\n key: "getFiles",\n value: function getFiles(app_id, filesId) {\n return this.fileManager.getFiles(app_id, filesId);\n }\n }, {\n key: "uploadFile",\n value: function uploadFile(fileData, app_id, item_id) {\n return this.fileManager.uploadFile(fileData, app_id, item_id);\n }\n }, {\n key: "uploadFileFromString",\n value: function 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 }, {\n key: "updateFileFromString",\n value: function updateFileFromString(data, file_id, file_name, extension, format, alt, title) {\n return this.fileManager.updateFileFromString(data, file_id, file_name, extension, format, alt, title);\n }\n }, {\n key: "deleteFile",\n value: function deleteFile(app_id, id) {\n return this.fileManager.deleteFile(app_id, id);\n }\n }, {\n key: "duplicateFile",\n value: function duplicateFile(files) {\n return this.fileManager.duplicateFile(files);\n }\n }, {\n key: "downloadFileFromString",\n value: function downloadFileFromString(app_id, file_id) {\n return this.fileManager.downloadFileFromString(app_id, file_id);\n }\n }, {\n key: "createDocument",\n value: function createDocument(documentObject) {\n return this.documentManager.createDocument(documentObject);\n }\n }, {\n key: "getDocument",\n value: function getDocument(documentAddress) {\n return this.documentManager.getDocument(documentAddress);\n }\n }, {\n key: "getDocuments",\n value: function getDocuments(documentAddress) {\n return this.documentManager.getDocuments(documentAddress);\n }\n }, {\n key: "deleteDocument",\n value: function deleteDocument(documentAddress) {\n return this.documentManager.deleteDocument(documentAddress);\n }\n }, {\n key: "login",\n value: function login(data) {\n return this.auth.login(data);\n }\n }, {\n key: "loginWithToken",\n value: function loginWithToken(token) {\n return this.auth.loginWithToken(token);\n }\n }, {\n key: "logout",\n value: function logout(token) {\n this.appProcessor.clearAppProcessor();\n return this.auth.logout(token);\n }\n }, {\n key: "signup",\n value: function signup(user) {\n return this.auth.signup(user);\n }\n }, {\n key: "getUsersList",\n value: function getUsersList(keyword) {\n return this.auth.getUsersList(keyword);\n }\n }, {\n key: "updateToken",\n value: function updateToken(auth_key) {\n return this.auth.updateToken(auth_key);\n }\n }, {\n key: "avatarUploadApi",\n value: function avatarUploadApi(image) {\n return this.auth.avatarUploadApi(image);\n }\n }, {\n key: "getVersion",\n value: function getVersion() {\n return this.auth.getVersion();\n }\n }, {\n key: "getUserById",\n value: function getUserById(userId) {\n return this.auth.getUserById(userId);\n }\n }, {\n key: "getToken",\n value: function getToken() {\n return this.auth.getToken();\n }\n }, {\n key: "updateUser",\n value: function updateUser(userData) {\n return this.auth.updateUser(userData);\n }\n }, {\n key: "updateAvatar",\n value: function updateAvatar(imageData) {\n return this.auth.updateAvatar(imageData);\n }\n }]);\n}();\n;// CONCATENATED MODULE: ./GUDHUB/DataService/IndexedDB/appRequestWorker.js\nfunction appRequestWorker_typeof(o) { "@babel/helpers - typeof"; return appRequestWorker_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, appRequestWorker_typeof(o); }\nfunction appRequestWorker_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ appRequestWorker_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == appRequestWorker_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(appRequestWorker_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction appRequestWorker_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction appRequestWorker_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { appRequestWorker_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { appRequestWorker_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\n\n\n\n\n\n\n\nvar appRequestWorker_gudhub = {};\nvar appDataService = {};\nvar chunkDataService = {};\n\n//TODO also ChunkDataService !!!!!!!!!!!!!!!!!!!!!!!\n\nself.onmessage = /*#__PURE__*/function () {\n var _ref = appRequestWorker_asyncToGenerator(/*#__PURE__*/appRequestWorker_regeneratorRuntime().mark(function _callee(e) {\n var cached, cachedChunksList, nextVersion, isMergedChunkUpdated, res, comparison, flag1, flag2, data;\n return appRequestWorker_regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (e.data.type === \'init\') {\n e.data.gudhubSerialized.options.initWebsocket = false;\n appRequestWorker_gudhub = new GudHub(e.data.gudhubSerialized.authKey, e.data.gudhubSerialized.options);\n appDataService = new IndexedDBAppServiceForWorker(appRequestWorker_gudhub.req, appsConf, appRequestWorker_gudhub);\n chunkDataService = new IndexedDBChunkService(appRequestWorker_gudhub.req, chunksMergeConf, appRequestWorker_gudhub);\n }\n if (!(e.data.type === \'processData\')) {\n _context.next = 29;\n break;\n }\n _context.next = 4;\n return appDataService.getCached(e.data.id);\n case 4:\n cached = _context.sent;\n // merge ?\n cachedChunksList = cached.chunks;\n _context.next = 8;\n return appDataService.getAppWithoutProcessing(e.data.id);\n case 8:\n nextVersion = _context.sent;\n isMergedChunkUpdated = true;\n if (cachedChunksList.length != nextVersion.chunks.length) isMergedChunkUpdated = false;\n\n //TODO here old chunks should be exactly with ids that came from app get request\n if (nextVersion.chunks.some(function (entry) {\n return !cachedChunksList.includes(entry);\n })) isMergedChunkUpdated = false;\n if (isMergedChunkUpdated) {\n _context.next = 25;\n break;\n }\n _context.next = 15;\n return chunkDataService.getCachedMergedChunk(e.data.id, cached.chunks);\n case 15:\n res = _context.sent;\n if (!res) {\n _context.next = 22;\n break;\n }\n _context.next = 19;\n return appRequestWorker_gudhub.util.mergeChunks([\n // cachedApp,\n res, cached]);\n case 19:\n cached.items_list = _context.sent;\n _context.next = 22;\n break;\n case 22:\n _context.next = 24;\n return appDataService.getApp(e.data.id);\n case 24:\n nextVersion = _context.sent;\n case 25:\n // let comparison = gudhub.compareItems(cached.items_list, newVersion.items_list);\n comparison = appRequestWorker_gudhub.compareItems(nextVersion.items_list, cached.items_list); // async handleAppChange(id, prevVersion, nextVersion) {\n flag1 = appRequestWorker_gudhub.util.areViewListsEqual(cached.views_list, nextVersion.views_list);\n flag2 = appRequestWorker_gudhub.util.areFieldListsEqual(cached.field_list, nextVersion.field_list); // if (\n // res1 ||\n // res2\n // ) {\n // this.updateAppFieldsAndViews({id, views_list: nextVersion.views_list, field_list: nextVersion.field_list});\n // }\n // }\n this.postMessage({\n id: e.data.id,\n compareRes: comparison,\n newVersion: nextVersion,\n type: e.data.type,\n viewListChanged: flag1,\n fieldListChanged: flag2\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 case 29:\n if (!(e.data.type === \'requestApp\')) {\n _context.next = 34;\n break;\n }\n _context.next = 32;\n return appDataService.getApp(e.data.id);\n case 32:\n data = _context.sent;\n //todo check process request method seems there i return cahced version not most recent data from server\n\n this.postMessage({\n id: e.data.id,\n type: e.data.type,\n data: data\n });\n case 34:\n case "end":\n return _context.stop();\n }\n }, _callee, this);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n}();\n\n//# sourceURL=webpack://@gudhub/core/./GUDHUB/DataService/IndexedDB/appRequestWorker.js_+_68_modules?')},3147:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";eval('/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ A: () => (/* binding */ createAngularModuleInstance)\n/* harmony export */ });\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2505);\n/* harmony import */ var _consts_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6950);\nfunction _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\n\n\n\n/*************** FAKE ANGULAR $Q ***************/\n// It\'s needed when we import angular code.\n\nvar $q = {\n when: function when(a) {\n return new Promise(function (resolve) {\n resolve(a);\n });\n }\n};\n\n/*************** FAKE ANGULAR ***************/\n// It\'s needed when we import angular code.\n\nvar factoryReturns = {};\nvar angular = {\n module: function module() {\n return angular;\n },\n directive: function directive() {\n return angular;\n },\n factory: function 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: function service() {\n return angular;\n },\n run: function run() {\n return angular;\n },\n filter: function filter() {\n return angular;\n },\n controller: function controller() {\n return angular;\n },\n value: function value() {\n return angular;\n },\n element: function element() {\n return angular;\n },\n injector: function injector() {\n return angular;\n },\n invoke: function 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\nfunction createAngularModuleInstance(_x, _x2, _x3, _x4, _x5) {\n return _createAngularModuleInstance.apply(this, arguments);\n}\nfunction _createAngularModuleInstance() {\n _createAngularModuleInstance = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(gudhub, module_id, module_url, angularInjector, nodeWindow) {\n var angularModule, importedClass, module, _module, proxy, response, code, encodedCode, _module2, result;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n _context5.prev = 0;\n if (!_consts_js__WEBPACK_IMPORTED_MODULE_1__/* .IS_BROWSER_MAIN_THREAD */ .tH) {\n _context5.next = 25;\n break;\n }\n if (!window.angular) {\n _context5.next = 17;\n break;\n }\n if (angularInjector.has(module_id)) {\n _context5.next = 6;\n break;\n }\n _context5.next = 6;\n return angularInjector.get(\'$ocLazyLoad\').load(module_url);\n case 6:\n _context5.next = 8;\n return angularInjector.get(module_id);\n case 8:\n angularModule = _context5.sent;\n _context5.next = 11;\n return axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);\n case 11:\n module = _context5.sent;\n module = module.data;\n try {\n eval(module);\n } catch (error) {\n console.error("ERROR WHILE EVAL() IN GHCONSTRUCTOR. MODULE ID: ".concat(module_id));\n console.log(error);\n }\n importedClass = factoryReturns[module_id];\n _context5.next = 23;\n break;\n case 17:\n _context5.next = 19;\n return axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);\n case 19:\n _module = _context5.sent;\n _module = _module.data;\n try {\n eval(_module);\n } catch (err) {\n console.log("Error while importing module: ".concat(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 case 23:\n _context5.next = 44;\n break;\n case 25:\n proxy = new Proxy(nodeWindow, {\n get: function get(target, property) {\n return target[property];\n },\n set: function set(target, property, value) {\n target[property] = value;\n global[property] = value;\n return true;\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 = function (command) {\n return false;\n };\n global.angular = angular;\n }\n\n // Downloading module\'s code and transform it to data url.\n _context5.next = 29;\n return axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);\n case 29:\n response = _context5.sent;\n code = response.data;\n encodedCode = encodeURIComponent(code);\n encodedCode = \'data:text/javascript;charset=utf-8,\' + encodedCode;\n _context5.prev = 33;\n _context5.next = 36;\n return import(/* webpackIgnore: true */encodedCode);\n case 36:\n _module2 = _context5.sent;\n _context5.next = 43;\n break;\n case 39:\n _context5.prev = 39;\n _context5.t0 = _context5["catch"](33);\n console.log("Error while importing module: ".concat(module_id));\n console.log(_context5.t0);\n case 43:\n // Modules always exports classes as default, so we create new class instance.\n\n importedClass = new _module2["default"]();\n case 44:\n result = {\n type: module_id,\n //*************** GET TEMPLATE ****************//\n\n getTemplate: function getTemplate(ref, changeFieldName, displayFieldName, field_model, appId, itemId) {\n var 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 getDefaultValue(fieldModel, valuesArray, itemsList, currentAppId) {\n return new Promise(/*#__PURE__*/function () {\n var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve) {\n var getValueFunction, value;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n getValueFunction = importedClass.getDefaultValue;\n if (!getValueFunction) {\n _context.next = 8;\n break;\n }\n _context.next = 4;\n return getValueFunction(fieldModel, valuesArray, itemsList, currentAppId);\n case 4:\n value = _context.sent;\n resolve(value);\n _context.next = 9;\n break;\n case 8:\n resolve(null);\n case 9:\n case "end":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x6) {\n return _ref.apply(this, arguments);\n };\n }());\n },\n //*************** GET SETTINGS ****************//\n\n getSettings: function getSettings(scope, settingType, fieldModels) {\n return importedClass.getSettings(scope, settingType, fieldModels);\n },\n //*************** FILTER****************//\n\n filter: {\n getSearchOptions: function getSearchOptions(fieldModel) {\n var 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 getDropdownValues() {\n var 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 getInterpretation(value, interpretation_id, dataType, field, itemId, appId) {\n return new Promise(/*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve) {\n var currentDataType, interpr_arr, data, _result;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n currentDataType = importedClass;\n _context2.prev = 1;\n _context2.next = 4;\n return currentDataType.getInterpretation(gudhub, value, appId, itemId, field, dataType);\n case 4:\n interpr_arr = _context2.sent;\n data = interpr_arr.find(function (item) {\n return item.id == interpretation_id;\n }) || interpr_arr.find(function (item) {\n return item.id == \'default\';\n });\n _context2.next = 8;\n return data.content();\n case 8:\n _result = _context2.sent;\n resolve({\n html: _result\n });\n _context2.next = 16;\n break;\n case 12:\n _context2.prev = 12;\n _context2.t0 = _context2["catch"](1);\n console.log("ERROR IN ".concat(module_id), _context2.t0);\n resolve({\n html: \'<span>no interpretation</span>\'\n });\n case 16:\n case "end":\n return _context2.stop();\n }\n }, _callee2, null, [[1, 12]]);\n }));\n return function (_x7) {\n return _ref2.apply(this, arguments);\n };\n }());\n },\n //*************** GET INTERPRETATIONS LIST ****************//\n\n getInterpretationsList: function getInterpretationsList(field_value, appId, itemId, field) {\n return importedClass.getInterpretation(field_value, appId, itemId, field);\n },\n //*************** GET INTERPRETATED VALUE ****************//\n\n getInterpretatedValue: function getInterpretatedValue(field_value, field_model, appId, itemId) {\n return new Promise(/*#__PURE__*/function () {\n var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {\n var getInterpretatedValueFunction, value;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n getInterpretatedValueFunction = importedClass.getInterpretatedValue;\n if (!getInterpretatedValueFunction) {\n _context3.next = 8;\n break;\n }\n _context3.next = 4;\n return getInterpretatedValueFunction(field_value, field_model, appId, itemId);\n case 4:\n value = _context3.sent;\n resolve(value);\n _context3.next = 9;\n break;\n case 8:\n resolve(field_value);\n case 9:\n case "end":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function (_x8) {\n return _ref3.apply(this, arguments);\n };\n }());\n },\n //*************** ON MESSAGE ****************//\n\n onMessage: function onMessage(appId, userId, response) {\n return new Promise(/*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(resolve) {\n var onMessageFunction, _result2;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n onMessageFunction = importedClass.onMessage;\n if (!onMessageFunction) {\n _context4.next = 6;\n break;\n }\n _context4.next = 4;\n return onMessageFunction(appId, userId, response);\n case 4:\n _result2 = _context4.sent;\n resolve(_result2);\n case 6:\n resolve(null);\n case 7:\n case "end":\n return _context4.stop();\n }\n }, _callee4);\n }));\n return function (_x9) {\n return _ref4.apply(this, arguments);\n };\n }());\n }\n }; // We need these methods in browser environment only\n if (_consts_js__WEBPACK_IMPORTED_MODULE_1__/* .IS_BROWSER_MAIN_THREAD */ .tH) {\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 _context5.abrupt("return", result);\n case 49:\n _context5.prev = 49;\n _context5.t1 = _context5["catch"](0);\n console.log(_context5.t1);\n console.log("Failed in createAngularModuleInstance (ghconstructor). Module id: ".concat(module_id, "."));\n case 53:\n case "end":\n return _context5.stop();\n }\n }, _callee5, null, [[0, 49], [33, 39]]);\n }));\n return _createAngularModuleInstance.apply(this, arguments);\n}\n\n//# sourceURL=webpack://@gudhub/core/./GUDHUB/GHConstructor/createAngularModuleInstance.js?')},6950:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";eval('/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ KJ: () => (/* binding */ IS_BROWSER),\n/* harmony export */ tH: () => (/* binding */ IS_BROWSER_MAIN_THREAD)\n/* harmony export */ });\n/* unused harmony exports IS_BROWSER_WORKER, IS_NODE */\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nvar IS_BROWSER_MAIN_THREAD = ![typeof window === "undefined" ? "undefined" : _typeof(window), typeof document === "undefined" ? "undefined" : _typeof(document)].includes("undefined");\nvar IS_BROWSER_WORKER = (typeof self === "undefined" ? "undefined" : _typeof(self)) === "object" && typeof WorkerGlobalScope != \'undefined\';\nvar IS_BROWSER = IS_BROWSER_MAIN_THREAD || IS_BROWSER_WORKER;\nvar IS_NODE =\n// @ts-expect-error\ntypeof process !== "undefined" &&\n// @ts-expect-error\nprocess.versions != null &&\n// @ts-expect-error\nprocess.versions.node != null;\n\n// IS_WEB\n\n//# sourceURL=webpack://@gudhub/core/./GUDHUB/consts.js?')},4198:module=>{"use strict";eval('module.exports = /*#__PURE__*/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__(7437);return __webpack_exports__})()));
|