{"version":3,"file":"appbase-js.umd.js","sources":["../node_modules/url-parser-lite/index.js","../src/utils/index.js","../src/utils/schema/mongodb.js","../src/utils/schema/elasticsearch.js","../src/utils/schema/index.js","../src/core/index.js","../node_modules/querystring/decode.js","../node_modules/querystring/encode.js","../node_modules/querystring/index.js","../node_modules/cross-fetch/dist/browser-ponyfill.js","../src/core/request/fetch.js","../src/core/api/index.js","../src/core/api/get.js","../src/core/api/update.js","../src/core/api/delete.js","../src/core/api/bulk.js","../src/core/api/search.js","../src/core/api/msearch.js","../src/core/api/reactiveSearchApi.js","../src/core/api/reactiveSearchv3Api.js","../src/core/api/getMappings.js","../src/core/api/getSuggestionsv3Api.js","../src/index.js"],"sourcesContent":["function URL(url) {\n var pattern = RegExp(\"^(([^:/?#]*)?://)?(((.*)?@)?([^/?#]*)?)([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\n var matches = url.match(pattern);\n\n return {\n protocol: matches[2],\n auth: matches[5],\n host: matches[6],\n path: matches[7],\n query: matches[9],\n hash: matches[11]\n };\n}\n\nmodule.exports = URL;\n","export function contains(string, substring) {\n return string.indexOf(substring) !== -1;\n}\nexport function isAppbase(url) {\n return contains(url, 'scalr.api.appbase.io');\n}\nexport function btoa(input = '') {\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n const str = input;\n let output = '';\n\n // eslint-disable-next-line\n for (\n let block = 0, charCode, i = 0, map = chars;\n str.charAt(i | 0) || ((map = '='), i % 1); // eslint-disable-line no-bitwise\n output += map.charAt(63 & (block >> (8 - (i % 1) * 8))) // eslint-disable-line no-bitwise\n ) {\n charCode = str.charCodeAt((i += 3 / 4));\n\n if (charCode > 0xff) {\n throw new Error(\n '\"btoa\" failed: The string to be encoded contains characters outside of the Latin1 range.',\n );\n }\n\n block = (block << 8) | charCode; // eslint-disable-line no-bitwise\n }\n\n return output;\n}\nexport function uuidv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0; // eslint-disable-line no-bitwise\n\n const v = c === 'x' ? r : (r & 0x3) | 0x8; // eslint-disable-line no-bitwise\n return v.toString(16);\n });\n}\n\nexport function validateRSQuery(query) {\n if (query && Object.prototype.toString.call(query) === '[object Array]') {\n for (let i = 0; i < query.length; i += 1) {\n const q = query[i];\n if (q) {\n if (!q.id) {\n return new Error(\"'id' field must be present in query object\");\n }\n } else {\n return new Error('query object can not have an empty value');\n }\n }\n return true;\n }\n return new Error(\"invalid query value, 'query' value must be an array\");\n}\n\nexport function validate(object, fields) {\n const invalid = [];\n const emptyFor = {\n object: null,\n string: '',\n number: 0,\n };\n const keys = Object.keys(fields);\n keys.forEach((key) => {\n const types = fields[key].split('|');\n const matchedType = types.find(\n type =>\n // eslint-disable-next-line\n typeof object[key] === type\n );\n if (!matchedType || object[key] === emptyFor[matchedType]) {\n invalid.push(key);\n }\n });\n let missing = '';\n for (let i = 0; i < invalid.length; i += 1) {\n missing += `${invalid[i]}, `;\n }\n if (invalid.length > 0) {\n return new Error(`fields missing: ${missing}`);\n }\n\n return true;\n}\n\nexport function removeUndefined(value = {}) {\n if (\n value\n || !(Object.keys(value).length === 0 && value.constructor === Object)\n ) {\n return JSON.parse(JSON.stringify(value));\n }\n return null;\n}\n\n/**\n * Send only when a connection is opened\n * @param {Object} socket\n * @param {Function} callback\n */\nexport function waitForSocketConnection(socket, callback) {\n setTimeout(() => {\n if (socket.readyState === 1) {\n if (callback != null) {\n callback();\n }\n } else {\n waitForSocketConnection(socket, callback);\n }\n }, 5); // wait 5 ms for the connection...\n}\n\nexport function encodeHeaders(headers = {}, shouldEncode = true) {\n // Encode headers\n let encodedHeaders = {};\n if (shouldEncode) {\n Object.keys(headers).forEach((header) => {\n encodedHeaders[header] = encodeURI(headers[header]);\n });\n } else {\n encodedHeaders = headers;\n }\n return encodedHeaders;\n}\nexport function getMongoRequest(app, mongo) {\n const mongodb = {};\n if (app) {\n mongodb.index = app;\n }\n if (mongo) {\n if (mongo.db) {\n mongodb.db = mongo.db;\n }\n if (mongo.collection) {\n mongodb.collection = mongo.collection;\n }\n }\n return mongodb;\n }\n\nexport function getTelemetryHeaders(enableTelemetry, shouldSetHeaders) {\n const headers = {};\n if (!shouldSetHeaders) {\n return headers;\n }\n Object.assign(headers, {\n 'X-Search-Client': 'Appbase JS',\n });\n\n if (enableTelemetry === false) {\n Object.assign(headers, {\n 'X-Enable-Telemetry': enableTelemetry,\n });\n }\n\n return headers;\n}\n\n\nexport const backendAlias = {\n MONGODB: 'mongodb', // mongodb\n ELASTICSEARCH: 'elasticsearch', // elasticsearch\n};\nexport const dataTypes = {\n ARRAY: 'array',\n FUNCTION: 'function',\n OBJECT: 'object',\n NUMBER: 'number',\n BOOLEAN: 'boolean',\n STRING: 'string',\n};\nconst checkDataType = (temp) => {\n // eslint-disable-next-line\n if (typeof temp === dataTypes.OBJECT) {\n if (Array.isArray(temp)) {\n return dataTypes.ARRAY;\n }\n\n return dataTypes.OBJECT;\n }\n return typeof temp;\n};\n\nexport function validateSchema(\n passedProperties = {},\n schema = {},\n backendName = '',\n) {\n const passedPropertiesKeys = Object.keys(passedProperties).filter(\n propertyKey => !!passedProperties[propertyKey],\n );\n const acceptedProperties = Object.keys(schema);\n const requiredProperties = [];\n // fetch required properties\n acceptedProperties.forEach((propName) => {\n const currentProperty = schema[propName];\n if (currentProperty.required) {\n requiredProperties.push(propName);\n }\n });\n // check for required properties\n requiredProperties.forEach((requiredProperty) => {\n if (!passedPropertiesKeys.includes(requiredProperty)) {\n throw new Error(\n `${requiredProperty} is required when using the ${backendName} Search backend.`,\n );\n }\n });\n\n // check for accepted properties\n passedPropertiesKeys.forEach((passedPropertyKey) => {\n if (!acceptedProperties.includes(passedPropertyKey)) {\n throw new Error(\n `${passedPropertyKey} property isn't accepted property by ${backendName} backend.`,\n );\n }\n\n const acceptedTypes = Array.isArray(schema[passedPropertyKey].type)\n ? schema[passedPropertyKey].type\n : [...schema[passedPropertyKey].type];\n const receivedPropertyType = checkDataType(\n passedProperties[passedPropertyKey],\n );\n if (!acceptedTypes.includes(receivedPropertyType)) {\n throw new Error(\n `The property ${passedPropertyKey} is expected with type(s) [${acceptedTypes.join(\n ', ',\n )}], but type was set as ${receivedPropertyType}.`,\n );\n }\n });\n}\n","import { dataTypes } from '../index';\n\nexport default {\n url: {\n type: dataTypes.STRING,\n required: true,\n },\n app: {\n type: dataTypes.STRING,\n required: false,\n },\n credentials: {\n type: dataTypes.STRING,\n required: false,\n },\n enableTelemetry: {\n type: dataTypes.BOOLEAN,\n required: false,\n },\n mongodb: {\n type: dataTypes.OBJECT,\n required: true,\n },\n username: {\n type: dataTypes.STRING,\n required: false,\n },\n password: {\n type: dataTypes.STRING,\n required: false,\n },\n};\n","import { dataTypes } from '../index';\n\nexport default {\n url: {\n type: dataTypes.STRING,\n required: true,\n },\n app: {\n type: dataTypes.STRING,\n required: true,\n },\n credentials: {\n type: dataTypes.STRING,\n required: false,\n },\n enableTelemetry: {\n type: dataTypes.BOOLEAN,\n required: false,\n },\n username: {\n type: dataTypes.STRING,\n required: false,\n },\n password: {\n type: dataTypes.STRING,\n required: false,\n },\n};\n","import mongodb from './mongodb';\nimport elasticsearch from './elasticsearch';\n\nexport default { mongodb, elasticsearch };\n","import URL from 'url-parser-lite';\nimport { backendAlias, isAppbase, validateSchema } from '../utils/index';\nimport SCHEMA from '../utils/schema/index';\n/**\n * Returns an instance of Appbase client\n * @param {Object} config To configure properties\n * @param {String} config.url\n * @param {String} config.app\n * @param {String} config.credentials\n * @param {String} config.username\n * @param {String} config.password\n * @param {Boolean} config.enableTelemetry\n * @param {Object} config.mongodb\n * A callback function which will be invoked before a fetch request made\n */\nfunction AppBase(config) {\n const {\n auth = null,\n host = '',\n path = '',\n protocol = '',\n } = URL(config.url || '');\n let { url } = config;\n url = host + path;\n // Parse url\n if (url.slice(-1) === '/') {\n url = url.slice(0, -1);\n }\n const backendName = backendAlias[config.mongodb ? 'MONGODB' : 'ELASTICSEARCH'];\n // eslint-disable-next-line\n const schema = SCHEMA[backendName];\n validateSchema(\n {\n url: config.url,\n app: config.app,\n credentials: config.credentials,\n username: config.username,\n password: config.password,\n enableTelemetry: config.enableTelemetry,\n mongodb: config.mongodb,\n },\n schema,\n backendName,\n );\n\n if (typeof protocol !== 'string' || protocol === '') {\n throw new Error(\n 'Protocol is not present in url. URL should be of the form https://appbase-demo-ansible-abxiydt-arc.searchbase.io',\n );\n }\n\n let credentials = auth || null;\n if (!config.mongodb) {\n if (isAppbase(url) && credentials === null) {\n throw new Error(\n 'Authentication information is not present. Did you add credentials?',\n );\n }\n }\n /**\n * Credentials can be provided as a part of the URL,\n * as username, password args or as a credentials argument directly */\n if (typeof config.credentials === 'string' && config.credentials !== '') {\n // eslint-disable-next-line\n credentials = config.credentials;\n } else if (\n typeof config.username === 'string'\n && config.username !== ''\n && typeof config.password === 'string'\n && config.password !== ''\n ) {\n credentials = `${config.username}:${config.password}`;\n }\n\n this.url = url;\n this.protocol = protocol;\n this.app = config.app;\n this.credentials = credentials;\n if (config.mongodb) {\n this.mongodb = config.mongodb;\n }\n\n if (typeof config.enableTelemetry === 'boolean') {\n this.enableTelemetry = config.enableTelemetry;\n }\n}\nexport default AppBase;\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'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (Array.isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\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'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return Object.keys(obj).map(function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (Array.isArray(obj[k])) {\n return obj[k].map(function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n","'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n","var __root__ = (function (root) {\nfunction F() { this.fetch = false; }\nF.prototype = root;\nreturn new F();\n})(typeof self !== 'undefined' ? self : this);\n(function(self) {\n\n(function(self) {\n\n if (self.fetch) {\n return\n }\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isDataView = function(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n };\n\n var isArrayBufferView = ArrayBuffer.isView || function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue+','+value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) { items.push(name); });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) { items.push(value); });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) { items.push([name, value]); });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n throw new Error('unsupported BodyInit type')\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'omit';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, { body: this._bodyInit })\n };\n\n function decode(body) {\n var form = new FormData();\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n var xhr = new XMLHttpRequest();\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n };\n self.fetch.polyfill = true;\n})(typeof self !== 'undefined' ? self : this);\n}).call(__root__, void(0));\nvar fetch = __root__.fetch;\nvar Response = fetch.Response = __root__.Response;\nvar Request = fetch.Request = __root__.Request;\nvar Headers = fetch.Headers = __root__.Headers;\nif (typeof module === 'object' && module.exports) {\nmodule.exports = fetch;\n// Needed for TypeScript consumers without esModuleInterop.\nmodule.exports.default = fetch;\n}\n","import querystring from 'querystring';\nimport fetch from 'cross-fetch';\nimport { btoa, removeUndefined } from '../../utils/index';\n\n/**\n * To perform fetch request\n * @param {Object} args\n * @param {String} args.method\n * @param {String} args.path\n * @param {Object} args.params\n * @param {Object} args.body\n * @param {Object} args.headers\n * @param {boolean} args.isSuggestionsAPI\n */\nfunction fetchRequest(args) {\n return new Promise((resolve, reject) => {\n const parsedArgs = removeUndefined(args);\n try {\n const {\n method,\n path,\n params,\n body,\n isRSAPI,\n isSuggestionsAPI,\n isMongoRequest = false,\n } = parsedArgs;\n const app = isSuggestionsAPI ? '.suggestions' : this.app;\n let bodyCopy = body;\n const contentType = path.endsWith('msearch') || path.endsWith('bulk')\n ? 'application/x-ndjson'\n : 'application/json';\n const headers = Object.assign(\n {},\n {\n Accept: 'application/json',\n 'Content-Type': contentType,\n },\n args.headers,\n this.headers,\n );\n const timestamp = Date.now();\n if (this.credentials) {\n headers.Authorization = `Basic ${btoa(this.credentials)}`;\n }\n const requestOptions = {\n method,\n headers,\n };\n if (Array.isArray(bodyCopy)) {\n let arrayBody = '';\n bodyCopy.forEach((item) => {\n arrayBody += JSON.stringify(item);\n arrayBody += '\\n';\n });\n\n bodyCopy = arrayBody;\n } else {\n bodyCopy = JSON.stringify(bodyCopy) || {};\n }\n\n if (Object.keys(bodyCopy).length !== 0) {\n requestOptions.body = bodyCopy;\n }\n\n const handleTransformRequest = (res) => {\n if (\n this.transformRequest\n && typeof this.transformRequest === 'function'\n ) {\n const tarnsformRequestPromise = this.transformRequest(res);\n return tarnsformRequestPromise instanceof Promise\n ? tarnsformRequestPromise\n : Promise.resolve(tarnsformRequestPromise);\n }\n return Promise.resolve(res);\n };\n\n let responseHeaders = {};\n\n let paramsString = '';\n if (params) {\n paramsString = `?${querystring.stringify(params)}`;\n }\n const finalURL = this.mongodb\n ? `${this.protocol}://${this.url}`\n : `${this.protocol}://${this.url}/${app}/${path}${paramsString}`;\n\n return handleTransformRequest(\n Object.assign(\n {},\n {\n url: finalURL,\n },\n requestOptions,\n ),\n )\n .then((ts) => {\n const transformedRequest = Object.assign({}, ts);\n const { url } = transformedRequest;\n delete transformedRequest.url;\n return fetch(\n url || finalURL,\n Object.assign({}, transformedRequest, {\n // apply timestamp header for RS API\n headers:\n isRSAPI && !isMongoRequest\n ? Object.assign({}, transformedRequest.headers, {\n 'x-timestamp': new Date().getTime(),\n })\n : transformedRequest.headers,\n }),\n )\n .then((res) => {\n console.log(res);\n if (res.status >= 500) {\n return reject(res);\n }\n responseHeaders = res.headers;\n return res\n .json()\n .then((data) => {\n console.log('json 123', data);\n if (res.status >= 400) {\n return reject(res);\n }\n if (data && data.error) {\n console.log('data.error', data);\n return reject(data);\n }\n // Handle error from RS API RESPONSE\n if (\n isRSAPI\n && data\n && Object.prototype.toString.call(data) === '[object Object]'\n ) {\n console.log('line 138', data);\n if (body && body.query && body.query instanceof Array) {\n let errorResponses = 0;\n const allResponses = body.query.filter(\n q => q.execute || q.execute === undefined,\n ).length;\n if (data) {\n Object.keys(data).forEach((key) => {\n if (\n data[key]\n && Object.prototype.hasOwnProperty.call(\n data[key],\n 'error',\n )\n ) {\n errorResponses += 1;\n }\n });\n }\n // reject only when all responses has error\n if (\n errorResponses > 0\n && allResponses === errorResponses\n ) {\n console.log('line 163', data);\n return reject(data);\n }\n }\n }\n\n // Handle error from _msearch response\n if (data && data.responses instanceof Array) {\n const allResponses = data.responses.length;\n const errorResponses = data.responses.filter(entry => Object.prototype.hasOwnProperty.call(entry, 'error')).length;\n // reject only when all responses has error\n if (allResponses === errorResponses) {\n console.log('line 177', allResponses, errorResponses);\n return reject(data);\n }\n }\n const response = Object.assign({}, data, {\n _timestamp: timestamp,\n _headers: responseHeaders,\n });\n return resolve(response);\n })\n .catch((e) => {\n console.log('line 184', e);\n return reject(e);\n });\n })\n .catch((e) => {\n console.log('line 189', e);\n return reject(e);\n });\n })\n .catch((err) => {\n console.log('line 194', err);\n return reject(err);\n });\n } catch (e) {\n console.log('line 198', e);\n return reject(e);\n }\n });\n}\nexport default fetchRequest;\n","import { removeUndefined, validate } from '../../utils/index';\n\n/**\n * Index Service\n * @param {Object} args\n * @param {String} args.type\n * @param {Object} args.body\n * @param {String} args.id\n */\nfunction indexApi(args) {\n const parsedArgs = removeUndefined(args);\n // Validate arguments\n const valid = validate(parsedArgs, {\n body: 'object',\n });\n if (valid !== true) {\n throw valid;\n }\n const { type = '_doc', id, body } = parsedArgs;\n\n delete parsedArgs.type;\n delete parsedArgs.body;\n delete parsedArgs.id;\n\n let path;\n if (id) {\n path = type ? `${type}/${encodeURIComponent(id)}` : encodeURIComponent(id);\n } else {\n path = type;\n }\n return this.performFetchRequest({\n method: 'POST',\n path,\n params: parsedArgs,\n body,\n });\n}\nexport default indexApi;\n","import { removeUndefined, validate } from '../../utils/index';\n\n/**\n * Get Service\n * @param {Object} args\n * @param {String} args.type\n * @param {String} args.id\n */\nfunction getApi(args) {\n const parsedArgs = removeUndefined(args);\n // Validate arguments\n const valid = validate(parsedArgs, {\n id: 'string|number',\n });\n\n if (valid !== true) {\n throw valid;\n }\n\n const { type = '_doc', id } = parsedArgs;\n\n delete parsedArgs.type;\n delete parsedArgs.id;\n\n const path = `${type}/${encodeURIComponent(id)}`;\n\n return this.performFetchRequest({\n method: 'GET',\n path,\n params: parsedArgs,\n });\n}\nexport default getApi;\n","import { removeUndefined, validate } from '../../utils/index';\n\n/**\n * Update Service\n * @param {Object} args\n * @param {String} args.type\n * @param {Object} args.body\n * @param {String} args.id\n */\nfunction updateApi(args) {\n const parsedArgs = removeUndefined(args);\n // Validate arguments\n const valid = validate(parsedArgs, {\n id: 'string|number',\n body: 'object',\n });\n if (valid !== true) {\n throw valid;\n }\n\n const { type = '_doc', id, body } = parsedArgs;\n delete parsedArgs.type;\n delete parsedArgs.id;\n delete parsedArgs.body;\n const path = `${type}/${encodeURIComponent(id)}/_update`;\n\n return this.performFetchRequest({\n method: 'POST',\n path,\n params: parsedArgs,\n body,\n });\n}\nexport default updateApi;\n","import { removeUndefined, validate } from '../../utils/index';\n\n/**\n * Delete Service\n * @param {Object} args\n * @param {String} args.type\n * @param {String} args.id\n */\nfunction deleteApi(args) {\n const parsedArgs = removeUndefined(args);\n // Validate arguments\n const valid = validate(parsedArgs, {\n id: 'string|number',\n });\n if (valid !== true) {\n throw valid;\n }\n\n const { type = '_doc', id } = parsedArgs;\n delete parsedArgs.type;\n delete parsedArgs.id;\n\n const path = `${type}/${encodeURIComponent(id)}`;\n\n return this.performFetchRequest({\n method: 'DELETE',\n path,\n params: parsedArgs,\n });\n}\nexport default deleteApi;\n","import { removeUndefined, validate } from '../../utils/index';\n\n/**\n * Bulk Service\n * @param {Object} args\n * @param {String} args.type\n * @param {Object} args.body\n */\nfunction bulkApi(args) {\n const parsedArgs = removeUndefined(args);\n // Validate arguments\n const valid = validate(parsedArgs, {\n body: 'object',\n });\n if (valid !== true) {\n throw valid;\n }\n\n const { type, body } = parsedArgs;\n\n delete parsedArgs.type;\n delete parsedArgs.body;\n\n let path;\n if (type) {\n path = `${type}/_bulk`;\n } else {\n path = '_bulk';\n }\n\n return this.performFetchRequest({\n method: 'POST',\n path,\n params: parsedArgs,\n body,\n });\n}\nexport default bulkApi;\n","import { removeUndefined, validate } from '../../utils/index';\n\n/**\n * Search Service\n * @param {Object} args\n * @param {String} args.type\n * @param {Object} args.body\n */\nfunction searchApi(args) {\n const parsedArgs = removeUndefined(args);\n // Validate arguments\n const valid = validate(parsedArgs, {\n body: 'object',\n });\n if (valid !== true) {\n throw valid;\n }\n\n let type;\n if (Array.isArray(parsedArgs.type)) {\n type = parsedArgs.type.join();\n } else {\n // eslint-disable-next-line\n type = parsedArgs.type;\n }\n\n const { body } = parsedArgs;\n\n delete parsedArgs.type;\n delete parsedArgs.body;\n\n let path;\n if (type) {\n path = `${type}/_search`;\n } else {\n path = '_search';\n }\n\n return this.performFetchRequest({\n method: 'POST',\n path,\n params: parsedArgs,\n body,\n });\n}\nexport default searchApi;\n","import { removeUndefined, validate } from '../../utils/index';\n\n/**\n * Msearch Service\n * @param {Object} args\n * @param {String} args.type\n * @param {Object} args.body\n */\nfunction msearchApi(args) {\n const parsedArgs = removeUndefined(args);\n // Validate arguments\n const valid = validate(parsedArgs, {\n body: 'object',\n });\n if (valid !== true) {\n throw valid;\n }\n\n let type;\n if (Array.isArray(parsedArgs.type)) {\n type = parsedArgs.type.join();\n } else {\n ({ type } = parsedArgs);\n }\n\n const { body } = parsedArgs;\n\n delete parsedArgs.type;\n delete parsedArgs.body;\n\n let path;\n if (type) {\n path = `${type}/_msearch`;\n } else {\n path = '_msearch';\n }\n\n return this.performFetchRequest({\n method: 'POST',\n path,\n params: parsedArgs,\n body,\n });\n}\nexport default msearchApi;\n","import {\n getTelemetryHeaders,\n getMongoRequest,\n removeUndefined,\n validateRSQuery,\n} from '../../utils/index';\n\n/**\n * ReactiveSearch API Service for v3\n * @param {Array} query\n * @param {Object} settings\n * @param {boolean} settings.recordAnalytics\n * @param {boolean} settings.userId\n * @param {boolean} settings.enableQueryRules\n * @param {boolean} settings.customEvents\n */\nfunction reactiveSearchApi(query, settings) {\n const parsedSettings = removeUndefined(settings);\n\n // Validate query\n const valid = validateRSQuery(query);\n\n if (valid !== true) {\n throw valid;\n }\n\n const body = {\n settings: parsedSettings,\n query,\n };\n\n if (this.mongodb) {\n Object.assign(body, { mongodb: getMongoRequest(this.app, this.mongodb) });\n }\n return this.performFetchRequest({\n method: 'POST',\n path: '_reactivesearch',\n body,\n headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),\n isRSAPI: true,\n isMongoRequest: !!this.mongodb,\n });\n}\nexport default reactiveSearchApi;\n","import {\n removeUndefined,\n validateRSQuery,\n getMongoRequest,\n getTelemetryHeaders,\n} from '../../utils/index';\n\n/**\n * ReactiveSearch API Service for v3\n * @param {Array} query\n * @param {Object} settings\n * @param {boolean} settings.recordAnalytics\n * @param {boolean} settings.userId\n * @param {boolean} settings.enableQueryRules\n * @param {boolean} settings.customEvents\n */\nfunction reactiveSearchv3Api(query, settings) {\n const parsedSettings = removeUndefined(settings);\n\n // Validate query\n const valid = validateRSQuery(query);\n\n if (valid !== true) {\n throw valid;\n }\n\n const body = {\n settings: parsedSettings,\n query,\n };\n if (this.mongodb) {\n Object.assign(body, { mongodb: getMongoRequest(this.app, this.mongodb) });\n }\n return this.performFetchRequest({\n method: 'POST',\n path: '_reactivesearch.v3',\n body,\n headers: getTelemetryHeaders(this.enableTelemetry, !this.mongodb),\n isRSAPI: true,\n isMongoRequest: !!this.mongodb,\n });\n}\nexport default reactiveSearchv3Api;\n","/**\n * To get mappings\n */\nfunction getMappings() {\n return this.performFetchRequest({\n method: 'GET',\n path: '_mapping',\n });\n}\nexport default getMappings;\n","import {\n getMongoRequest,\n getTelemetryHeaders,\n removeUndefined,\n validateRSQuery,\n} from '../../utils/index';\n\n/**\n * ReactiveSearch suggestions API for v3\n * @param {Array} query\n * @param {Object} settings\n * @param {boolean} settings.recordAnalytics\n * @param {boolean} settings.userId\n * @param {boolean} settings.enableQueryRules\n * @param {boolean} settings.customEvents\n */\nfunction getSuggestionsv3Api(query, settings) {\n const parsedSettings = removeUndefined(settings);\n\n // Validate query\n const valid = validateRSQuery(query);\n\n if (valid !== true) {\n throw valid;\n }\n\n const body = {\n settings: parsedSettings,\n query,\n };\n\n if (this.mongodb) {\n Object.assign(body, { mongodb: getMongoRequest(this.app, this.mongodb) });\n }\n return this.performFetchRequest({\n method: 'POST',\n path: '_reactivesearch.v3',\n body,\n headers: getTelemetryHeaders(this.enableTelemetry),\n isRSAPI: true,\n isSuggestionsAPI: true,\n isMongoRequest: !!this.mongodb,\n });\n}\n\nexport default getSuggestionsv3Api;\n","import AppBaseClient from './core/index';\nimport fetchRequest from './core/request/fetch';\nimport indexApi from './core/api/index';\nimport getApi from './core/api/get';\nimport updateApi from './core/api/update';\nimport deleteApi from './core/api/delete';\nimport bulkApi from './core/api/bulk';\nimport searchApi from './core/api/search';\nimport msearchApi from './core/api/msearch';\nimport reactiveSearchApi from './core/api/reactiveSearchApi';\nimport reactiveSearchv3Api from './core/api/reactiveSearchv3Api';\nimport getMappingsApi from './core/api/getMappings';\nimport { encodeHeaders } from './utils/index';\nimport getSuggestionsv3Api from './core/api/getSuggestionsv3Api';\n\nexport default function appbasejs(config) {\n const client = new AppBaseClient(config);\n\n AppBaseClient.prototype.performFetchRequest = fetchRequest;\n\n AppBaseClient.prototype.index = indexApi;\n\n AppBaseClient.prototype.get = getApi;\n\n AppBaseClient.prototype.update = updateApi;\n\n AppBaseClient.prototype.delete = deleteApi;\n\n AppBaseClient.prototype.bulk = bulkApi;\n\n AppBaseClient.prototype.search = searchApi;\n\n AppBaseClient.prototype.msearch = msearchApi;\n\n AppBaseClient.prototype.reactiveSearch = reactiveSearchApi;\n\n AppBaseClient.prototype.reactiveSearchv3 = reactiveSearchv3Api;\n\n AppBaseClient.prototype.getQuerySuggestions = getSuggestionsv3Api;\n\n AppBaseClient.prototype.getMappings = getMappingsApi;\n\n AppBaseClient.prototype.setHeaders = function setHeaders(\n headers = {},\n shouldEncode = false,\n ) {\n // Encode headers\n if (shouldEncode) {\n this.headers = encodeHeaders(headers);\n } else {\n this.headers = headers;\n }\n };\n\n if (typeof window !== 'undefined') {\n window.Appbase = client;\n }\n return client;\n}\n"],"names":["contains","string","substring","indexOf","isAppbase","url","btoa","input","chars","str","output","block","charCode","i","map","charAt","charCodeAt","Error","validateRSQuery","query","Object","prototype","toString","call","length","q","id","validate","object","fields","invalid","emptyFor","number","keys","forEach","key","types","split","matchedType","find","type","push","missing","removeUndefined","value","constructor","JSON","parse","stringify","encodeHeaders","headers","shouldEncode","encodedHeaders","header","encodeURI","getMongoRequest","app","mongo","mongodb","index","db","collection","getTelemetryHeaders","enableTelemetry","shouldSetHeaders","assign","backendAlias","MONGODB","ELASTICSEARCH","dataTypes","ARRAY","FUNCTION","OBJECT","NUMBER","BOOLEAN","STRING","checkDataType","temp","Array","isArray","validateSchema","passedProperties","schema","backendName","passedPropertiesKeys","filter","propertyKey","acceptedProperties","requiredProperties","propName","currentProperty","required","requiredProperty","includes","passedPropertyKey","acceptedTypes","receivedPropertyType","join","credentials","username","password","elasticsearch","AppBase","config","URL","auth","host","path","protocol","slice","SCHEMA","require$$0","require$$1","this","fetchRequest","args","Promise","resolve","reject","parsedArgs","method","params","body","isRSAPI","isSuggestionsAPI","isMongoRequest","bodyCopy","contentType","endsWith","Accept","timestamp","Date","now","Authorization","requestOptions","arrayBody","item","handleTransformRequest","res","transformRequest","tarnsformRequestPromise","responseHeaders","paramsString","querystring","finalURL","then","ts","transformedRequest","fetch","getTime","console","log","status","json","data","error","errorResponses","allResponses","execute","undefined","hasOwnProperty","responses","entry","response","_timestamp","_headers","catch","e","err","indexApi","valid","encodeURIComponent","performFetchRequest","getApi","updateApi","deleteApi","bulkApi","searchApi","msearchApi","reactiveSearchApi","settings","parsedSettings","reactiveSearchv3Api","getMappings","getSuggestionsv3Api","appbasejs","client","AppBaseClient","get","update","delete","bulk","search","msearch","reactiveSearch","reactiveSearchv3","getQuerySuggestions","getMappingsApi","setHeaders","window","Appbase"],"mappings":";;;;;;IAAA,SAAS,GAAG,CAAC,GAAG,EAAE;QACd,IAAI,OAAO,GAAG,MAAM,CAAC,sEAAsE,CAAC,CAAC;QAC7F,IAAI,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;;QAEjC,OAAO;YACH,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;YACpB,IAA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