bibot 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -535,12 +535,14 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(_ref2) {
535
535
  borderRadius: 10,
536
536
  display: 'flex',
537
537
  flexDirection: 'column',
538
- justifyContent: 'space-between'
538
+ justifyContent: 'space-between',
539
+ border: '2px solid #dedede'
539
540
  }
540
541
  }, React.createElement("div", {
541
542
  className: styles["chat-header"],
542
543
  style: {
543
544
  backgroundColor: (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede',
545
+ height: '50px',
544
546
  borderTopLeftRadius: 8,
545
547
  borderTopRightRadius: 8,
546
548
  display: 'flex',
@@ -607,11 +609,12 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(_ref2) {
607
609
  marginBottom: 10,
608
610
  padding: '5px 10px',
609
611
  borderRadius: 8,
610
- maxWidth: 70,
612
+ maxWidth: '70%',
611
613
  alignSelf: 'flex-end',
612
614
  fontSize: '15px',
613
615
  backgroundColor: '#b8b8b8c6',
614
- color: '#000'
616
+ color: '#000',
617
+ textAlign: 'left'
615
618
  }
616
619
  }, message.text) : React.createElement("div", {
617
620
  key: index,
@@ -629,10 +632,12 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(_ref2) {
629
632
  marginBottom: 10,
630
633
  padding: '5px 10px',
631
634
  borderRadius: 8,
635
+ maxWidth: '70%',
632
636
  alignSelf: 'flex-start',
633
637
  fontSize: '15px',
634
638
  backgroundColor: '#f0f0f0',
635
- color: '#000'
639
+ color: '#000',
640
+ textAlign: 'left'
636
641
  }
637
642
  }, message.text));
638
643
  }), showPredefinedQuestions && predefinedQuestions && predefinedQuestions.length > 0 && React.createElement(PredefinedQuestions, {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/config/endpointEnums.ts","../src/hooks/usePluginFactory.tsx","../node_modules/babel-plugin-transform-async-to-promises/helpers.mjs","../src/config/appStateEnums.ts","../src/reducers/appReducer.ts","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/v4.js","../src/utils/sessionManager.tsx","../src/context/AppContext.tsx","../src/services/plugin-api.tsx","../src/hooks/useBiBotChatBot.tsx","../src/component/bibot.tsx","../src/index.tsx"],"sourcesContent":["\nexport const APP_DATA = {\n APP_NAME: 'Bibot'\n}\n\nconst baseUrls = {\n inference: 'https://inference.dev.bibot.thespuka.com/v0',\n}\n\nexport const endpoints = {\n get inference () {\n return baseUrls.inference\n },\n} as const\n\nexport enum domain {\n app = '/app',\n bibot = '/bibot',\n inference = '/inference',\n}\n\nexport enum resources {\n chatBubble = '/chat-bubble-config',\n predefinedQ = '/predefined-q',\n localQ = '/local-q',\n timedOutLocalQ = '/t-local-q',\n q = '/q'\n}\n","import axios from 'axios';\nimport { endpoints } from '../config/endpointEnums';\nconst inferenceBaseURL = endpoints.inference;\n\nexport const createPluginAxiosInstance = (params = {}, headers = {}) => {\n const instance = axios.create({\n baseURL: inferenceBaseURL,\n timeout: 60000, // 1 minute\n headers: {\n 'Content-Type': 'application/json',\n ...headers\n },\n ...params\n });\n\n\n instance.interceptors.response.use(\n (response) => {\n return response\n },\n async (error) => {\n let errMsg = 'An unknown error occurred'\n if (error.response) {\n errMsg = error.response.data.message\n } else if (error.request) {\n errMsg = 'No response received from the server.'\n } else {\n errMsg = `Error setting up the request: ${error.message}`\n }\n return await Promise.reject(new Error(errMsg))\n }\n )\n\n return instance\n}\n\n ","// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\nexport const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.iterator || (Symbol.iterator = Symbol(\"Symbol.iterator\"))) : \"@@iterator\";\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof target[_iteratorSymbol] === \"function\") {\n\t\tvar iterator = target[_iteratorSymbol](), step, pact, reject;\n\t\tfunction _cycle(result) {\n\t\t\ttry {\n\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pact) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t} else {\n\t\t\t\t\tpact = result;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t\t}\n\t\t}\n\t\t_cycle();\n\t\tif (iterator.return) {\n\t\t\tvar _fixup = function(value) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\titerator.return();\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tif (pact && pact.then) {\n\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t});\n\t\t\t}\n\t\t\t_fixup();\n\t\t}\n\t\treturn pact;\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"Object is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\nexport const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))) : \"@@asyncIterator\";\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof target[_asyncIteratorSymbol] === \"function\") {\n\t\tvar pact = new _Pact();\n\t\tvar iterator = target[_asyncIteratorSymbol]();\n\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\treturn pact;\n\t\tfunction _resumeAfterBody(result) {\n\t\t\tif (check && check()) {\n\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t}\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t}\n\t\tfunction _resumeAfterNext(step) {\n\t\t\tif (step.done) {\n\t\t\t\t_settle(pact, 1);\n\t\t\t} else {\n\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t}\n\t\t}\n\t\tfunction _reject(error) {\n\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, result);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = /*#__PURE__*/ {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\tvar result = _entry(_this);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tresult.then(returnValue, function(error) {\n\t\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturnValue(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\n\t_AsyncGenerator.prototype[_asyncIteratorSymbol] = function() {\n\t\treturn this;\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","export enum appStateEnums {\n BIBOT = 'BIBOT'\n}\n","import { appStateEnums } from '../config/appStateEnums'\nimport type { AppStates, AppAction } from '../types/coreInterfaces'\n\nexport const appReducer = (state: AppStates, action: AppAction): AppStates => {\n console.log('This is the appReducer state', state, action)\n switch (action.type) {\n case appStateEnums.BIBOT:\n return {\n ...state,\n chatIsOpen: action.chatIsOpen\n }\n default:\n return state\n }\n}\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","import { v4 as uuidv4 } from 'uuid'\n\nconst SESSION_KEY: string = 'bibotUserSessionId'\n\nconst getSessionId = (): string => {\n const sessionId = localStorage.getItem(SESSION_KEY)\n if (sessionId === null) {\n const newSessionId = uuidv4()\n localStorage.setItem(SESSION_KEY, newSessionId)\n return newSessionId\n }\n return sessionId\n}\n\nexport { getSessionId }\n","import { appStateEnums } from '../config/appStateEnums'\nimport React, { createContext, useReducer, useEffect } from 'react'\nimport { ReactNode } from 'react'\nimport { appReducer } from '../reducers/appReducer'\nimport type { AppContextProps, AppStates } from '../types/coreInterfaces'\nimport { getSessionId } from '../utils/sessionManager'\n\ninterface AppProps {\n children: ReactNode\n}\n\nconst dummyDispatch = () => {} // A no-op function.\n\nconst defaultContextValue: AppContextProps = {\n state: {\n chatIsOpen: false,\n sessionId: getSessionId()\n },\n dispatch: dummyDispatch\n}\n\nconst AppContext = createContext<AppContextProps>(defaultContextValue)\n\nconst AppProvider: React.FC<AppProps> = ({ children }) => {\n const APP_STATE_KEY = 'app_states'\n const initialState: AppStates = {\n chatIsOpen: false,\n sessionId: getSessionId()\n }\n\n const [state, dispatch] = useReducer(appReducer, initialState)\n\n useEffect(() => {\n // Pool the initial states from local storage\n const storedStates = localStorage.getItem(APP_STATE_KEY)\n\n if (storedStates) {\n try {\n const parsedStates = JSON.parse(storedStates)\n\n // Merge stored states with initial states\n const updatedStates = {\n ...initialState,\n ...parsedStates\n }\n console.log(initialState, parsedStates, updatedStates)\n // Dispatch action to update the states\n dispatch({ type: appStateEnums.BIBOT, ...updatedStates })\n } catch (error) {\n console.error('Failed to parse app states from local storage:', error)\n }\n }\n }, [])\n\n useEffect(() => {\n console.log('Changes in state: ', state)\n localStorage.setItem(APP_STATE_KEY, JSON.stringify(state))\n }, [state])\n\n return (\n <AppContext.Provider value={{ state, dispatch }}>\n {children}\n </AppContext.Provider>\n )\n}\n\nexport { AppContext, AppProvider }\n","import { domain, resources } from '../config/endpointEnums'\nimport { createPluginAxiosInstance } from '../hooks/usePluginFactory'\n\nconst pluginAxiosInstance=createPluginAxiosInstance()\n\ninterface Q_DATA_TYPE {\n client_id: string\n q: string\n endSession?: boolean\n session_id: string\n chat_id: string\n tries?: number\n}\n\ninterface RemoteChatBubbleConfigProps {\n bgColor: string,\n chatColor: string,\n title: string,\n userImage: string\n}\n\nasync function askTimedOutBiBot(data: Q_DATA_TYPE): Promise<string> {\n try {\n // return 'Hello'\n const path=`${domain.bibot}${resources.timedOutLocalQ}`\n const response=await pluginAxiosInstance.post<any>(path, data)\n console.log(response)\n return response.data.message\n } catch (error) {\n console.log(error.message)\n return error.message\n }\n}\n\nasync function askBiBot(data: Q_DATA_TYPE): Promise<string> {\n try {\n const path=`${domain.inference}${resources.q}`\n const response=await pluginAxiosInstance.post<any>(path, data)\n console.log(response)\n return response.data.message\n // return 'Hello'\n } catch (error1) {\n console.log(error1.message)\n if (error1.code==='ECONNABORTED'||error1.message.includes('Endpoint request timed out')) {\n try {\n return await askTimedOutBiBot({\n ...data,\n tries: 2\n })\n } catch (error2) {\n if (error2.code==='ECONNABORTED'||error2.message.includes('Endpoint request timed out')) {\n try {\n return await askTimedOutBiBot({\n ...data,\n tries: 3\n })\n } catch (error3) {\n return error3.message\n }\n } else {\n return error2.message\n }\n }\n } else {\n return error1.message\n }\n }\n}\n// TODO: Emmanuel fix the default returned values, especially the userImage to a default robot image\nasync function getRemoteClientChatBubbleConfig(params: { client_id: string }): Promise<RemoteChatBubbleConfigProps> {\n try {\n // return {\n // bgColor: 'white',\n // chatColor: 'blue',\n // title: 'ChatBot',\n // userImage: 'string'\n // }\n const path=`${domain.inference}${resources.chatBubble}`\n const response=await pluginAxiosInstance.get<any>(path, { params })\n return response.data\n } catch (error) {\n return {\n bgColor: 'white',\n chatColor: 'blue',\n title: 'ChatBot',\n userImage: 'string'\n }\n }\n}\n\nasync function getRemoteClientChatPredefinedQuestions(params: { client_id: string }): Promise<string[]> {\n try {\n // return ['Hello']\n const path=`${domain.inference}${resources.predefinedQ}`\n const response=await pluginAxiosInstance.get<any>(path, { params })\n return response.data.predefined_messages\n } catch (error) {\n return ['These are placeholders', 'They will be removed in production', 'This will be empty if there are no predefined questions', 'So hide if there are no predefined questions']\n }\n}\n\nasync function GetPredefinedQuestion (){\n const clientId = '6c74b4bb-0395-4751-a55f-7d065d67c56b'\n try {\n // return [{question: \"q\", answer: \"a\"}]\n const path = `${domain.inference}${resources.predefinedQ}?client_id=${clientId}`\n const response = await pluginAxiosInstance.get(path)\n return response.data\n } catch (error) {\n console.error('Error fetching subscription:', error)\n }\n }\n\nexport {\n askBiBot,\n getRemoteClientChatBubbleConfig,\n getRemoteClientChatPredefinedQuestions,\n GetPredefinedQuestion\n}\n","import { message } from 'antd'\nimport React, { useEffect, useRef, useState, useContext, useCallback } from 'react'\nimport { AppContext } from '../context/AppContext'\n\nimport { v4 as uuidv4 } from 'uuid'\nimport { askBiBot, getRemoteClientChatBubbleConfig, getRemoteClientChatPredefinedQuestions } from '../services/plugin-api'\ninterface UseBiBotChatBotProps {\n clientId: string\n }\n\ninterface ChatBubbleConfigProps {\n bgColor?: string,\n color?: string,\n title?: string,\n logo_url?: string\n}\nconst useBiBotChatBot = ({ clientId }: UseBiBotChatBotProps) => {\n const [predefinedQuestions, setPredefinedQuestions] = useState<string[]>([]) // State to store predefined questions\n const [showPredefinedQuestions, setShowPredefinedQuestions] = useState(true); // State to toggle predefined questions\n const { state } = useContext(AppContext)\n const [ chatIsOpen, setChatIsOpen ] = useState<boolean>(false)\n const [messages, setMessages] = useState<Array<{ sender: 'user' | 'bot', text: string }>>([])\n const [userInput, setUserInput] = useState('')\n const [isLoading, setIsLoading] = useState(false)\n const messageEndRef = useRef<HTMLDivElement>(null)\n const [chatBubbleConfig, setChatBubbleConfig] = useState<ChatBubbleConfigProps>()\n\n // Function to handle selecting a predefined question\n const handlePredefinedQuestionSelect = (question: any) => {\n setUserInput(question);\n sendInputInquiry();\n setShowPredefinedQuestions(false); // Hide predefined questions after selection\n }\n \n const getChatBubbleConfig = useCallback(async()=>{\n const remotePredefinedQuestions = await getRemoteClientChatPredefinedQuestions({client_id: clientId})\n if (remotePredefinedQuestions){\n setPredefinedQuestions(remotePredefinedQuestions)\n }\n const remoteChatBubbleConfig = await getRemoteClientChatBubbleConfig({client_id: clientId})\n if (remoteChatBubbleConfig){\n setChatBubbleConfig(remoteChatBubbleConfig)\n }\n },[clientId])\n\n useEffect(()=>{\n void getChatBubbleConfig()\n }, [getChatBubbleConfig])\n \n useEffect(() => {\n if (messageEndRef?.current) { messageEndRef.current.scrollIntoView({ behavior: 'smooth' }) }\n }, [messages])\n\n const toggleChat = () => {\n console.log('This is it', chatIsOpen)\n setChatIsOpen(!chatIsOpen)\n }\n\n const handleUserInput = (e: React.ChangeEvent<HTMLInputElement>) => {\n setUserInput(e.target.value)\n }\n\n async function sendInputInquiry () {\n setIsLoading(true)\n setUserInput('')\n try {\n if (userInput.trim()) {\n // dispatch({ type: appStateEnums.BIBOT, chatIsOpen: true })\n setMessages(messages => [...messages, { sender: 'user', text: userInput }])\n const response = await askBiBot({\n client_id: clientId,\n q: userInput.trim(),\n session_id: state.sessionId,\n chat_id: uuidv4()\n })\n setMessages(messages => [...messages, { sender: 'bot', text: response }])\n }\n } catch (error) {\n void message.error(error?.message ?? 'Failed to get response from server')\n } finally {\n setIsLoading(false)\n }\n }\n\n const handleKeyPress = async (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !isLoading) {\n await sendInputInquiry()\n }\n }\n return {\n chatIsOpen,\n messages,\n isLoading,\n messageEndRef,\n userInput,\n handleUserInput,\n handleKeyPress,\n toggleChat,\n sendInputInquiry,\n chatBubbleConfig,\n showPredefinedQuestions,\n predefinedQuestions,\n handlePredefinedQuestionSelect,\n }\n}\n\nexport { useBiBotChatBot }\n","import { Avatar, Indicator } from '@mantine/core'\nimport { Close, SendRounded } from '@mui/icons-material'\nimport ChatIcon from '@mui/icons-material/Chat'\nimport { Button } from 'antd'\nimport { useBiBotChatBot } from '../hooks'\nimport * as React from 'react'\nimport styles from '../styles.module.css'\n\ninterface bubbleProps {\n clientId: string\n}\n\ninterface PredefinedQuestionsProps {\n onSelect: (question: string) => void\n questions: string[]\n}\n\nconst PredefinedQuestions = ({ questions, onSelect }: PredefinedQuestionsProps) => {\n return (\n <div className={styles['predefined-questions']}>\n {questions.map((question, index) => (\n <div key={index} className={styles['predefined-questions']} onClick={() => onSelect(question)}>\n {question}\n </div>\n ))}\n </div>\n );\n};\n\nconst ChatBubbleBiBot = ({ clientId }: bubbleProps) => {\n const {\n chatIsOpen,\n messages,\n isLoading,\n messageEndRef,\n userInput,\n handleUserInput,\n handleKeyPress,\n sendInputInquiry,\n toggleChat,\n chatBubbleConfig,\n showPredefinedQuestions,\n predefinedQuestions,\n handlePredefinedQuestionSelect,\n } = useBiBotChatBot({clientId})\n\n return (\n \n <div className={`chat-bubble ${chatIsOpen ? 'open' : ''}`} style={{ position: 'fixed', bottom: '20px', right: '20px', zIndex: 9999}}>\n {chatIsOpen && (\n <div className={styles[\"chat-window\"]} style={{ backgroundColor: '#fff', position: 'absolute', bottom: '50px', right: '25px', width: 350, height: 500, borderRadius: 10, display: 'flex', flexDirection: 'column', justifyContent: 'space-between' }}>\n <div className={styles[\"chat-header\"]} style={{ backgroundColor: chatBubbleConfig?.color ?? '#dedede', borderTopLeftRadius: 8, borderTopRightRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'flex-start', paddingInline: 15, paddingBlock: 30 }}>\n <div style={{ alignItems: 'center', display: 'flex', color: '#fff', fontWeight: 'bold' }}>\n <Indicator inline size={12} offset={7} position=\"bottom-end\" color={ 'green' }>\n <Avatar color=\"white\" src={chatBubbleConfig?.logo_url} alt=\"profile\" />\n </Indicator>\n </div>\n <div style={{ display: 'flex', flexDirection: 'column', textAlign: 'left', paddingLeft: '10px', justifyContent: 'flex-start', color: '#fff' }}>\n <span style={{ fontWeight: 'bold' }}>{chatBubbleConfig?.title}</span>\n {}\n {isLoading ? <span style={{ fontSize: '12px', lineHeight: '0.5' }}>Typing...</span> : <span style={{ fontSize: '12px', lineHeight: '0.5' }}>{'Online'}</span>}\n </div>\n </div>\n <div className={styles[\"message-list\"]} style={{ height: 'calc(100% - 100px)', overflowY: 'auto', padding: 10, display: 'flex', flexGrow: 1, flexDirection: 'column'}}>\n {messages.map((message: { sender: 'user' | 'bot', text: string }, index: number) => (\n message.sender === 'user'\n ? <div key={index} className={`message ${message.sender}`} style={{ marginBottom: 10, padding: '5px 10px', borderRadius: 8, maxWidth: 70, alignSelf: 'flex-end', fontSize: '15px', backgroundColor: '#b8b8b8c6', color:'#000'}}>\n {message.text}\n </div>\n : <div key={index} style={{ display: 'flex' }}>\n <Avatar color=\"white\" src={chatBubbleConfig?.logo_url} size={25} alt=\"profile\" />\n <div className={`message ${message.sender}`} style={{ marginBottom: 10, padding: '5px 10px', borderRadius: 8, alignSelf: 'flex-start', fontSize: '15px', backgroundColor: '#f0f0f0', color:'#000'}}>\n {message.text}\n </div>\n </div>\n ))}\n {showPredefinedQuestions && predefinedQuestions && predefinedQuestions.length > 0 && (\n <PredefinedQuestions questions={predefinedQuestions} onSelect={handlePredefinedQuestionSelect} />\n )}\n {isLoading && <div style={{marginLeft: '20px'}} className='message'> <div className=\"loader\"></div> </div> }\n <div ref={messageEndRef} />\n </div>\n <div className={styles[\"input-area\"]} style={{ display: 'flex', alignItems: 'center', borderTop: '1px solid #ddd', padding: 10, borderBottomLeftRadius: 8, borderBottomRightRadius: 8}}>\n <input\n style={{ outline: 'none', flexGrow: 1, border: 'none', backgroundColor: 'transparent', padding: '5px 10px', marginRight: 10}}\n autoFocus={true}\n type=\"text\"\n value={userInput}\n onChange={handleUserInput}\n onKeyDown={handleKeyPress}\n placeholder=\"Ask a question\"\n />\n <Button disabled={isLoading ?? true} style={{ backgroundColor: 'transparent', color: isLoading ? '#dedede' : chatBubbleConfig?.color }} size='middle' icon={<SendRounded />} onClick={sendInputInquiry}/>\n </div>\n </div>\n )}\n <Button type='link' onClick={toggleChat} className={styles[\"chat-toggle\"]} style={{ backgroundColor: chatBubbleConfig?.color ?? '#dedede', color: '#fff', borderRadius: '50%', width: '60px', height: '60px', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n {chatIsOpen ? <Close style={{ width: 30, height: 30, color: '#fff' }} /> : <ChatIcon style={{ width: 30, height: 30, color: '#fff' }}/>}\n </Button>\n </div>\n\n )\n}\n\nexport default ChatBubbleBiBot\n","import * as React from 'react'\n\nimport ChatBubbleBiBot from './component/bibot';\nimport { AppProvider } from './context/AppContext';\nimport { MantineProvider } from '@mantine/core'\ninterface Props {\n clientId: string\n}\nexport const BiBot = ({ clientId }: Props) => {\n return (\n <AppProvider>\n <MantineProvider>\n <ChatBubbleBiBot clientId={clientId}/>\n </MantineProvider>\n \n </AppProvider>\n )\n \n}\n"],"names":["baseUrls","inference","endpoints","domain","resources","inferenceBaseURL","createPluginAxiosInstance","params","headers","instance","axios","create","_extends","baseURL","timeout","interceptors","response","use","error","errMsg","data","message","request","Promise","resolve","reject","Error","e","appStateEnums","appReducer","state","action","console","log","type","BIBOT","chatIsOpen","SESSION_KEY","getSessionId","sessionId","localStorage","getItem","newSessionId","uuidv4","setItem","dummyDispatch","defaultContextValue","dispatch","AppContext","createContext","AppProvider","_ref","children","APP_STATE_KEY","initialState","_useReducer","useReducer","useEffect","storedStates","parsedStates","JSON","parse","updatedStates","stringify","React","Provider","value","getRemoteClientChatPredefinedQuestions","path","predefinedQ","pluginAxiosInstance","get","then","predefined_messages","getRemoteClientChatBubbleConfig","chatBubble","bgColor","chatColor","title","userImage","askBiBot","q","post","error1","code","includes","_catch","askTimedOutBiBot","tries","error2","error3","bibot","timedOutLocalQ","useBiBotChatBot","sendInputInquiry","setIsLoading","setUserInput","_finallyRethrows","_temp2","userInput","trim","setMessages","messages","concat","sender","text","client_id","clientId","session_id","chat_id","_error$message","_wasThrown","_result","_useState","useState","predefinedQuestions","setPredefinedQuestions","_useState2","showPredefinedQuestions","setShowPredefinedQuestions","_useContext","useContext","_useState3","setChatIsOpen","_useState4","_useState5","_useState6","isLoading","messageEndRef","useRef","_useState7","chatBubbleConfig","setChatBubbleConfig","handlePredefinedQuestionSelect","question","getChatBubbleConfig","useCallback","remotePredefinedQuestions","remoteChatBubbleConfig","current","scrollIntoView","behavior","toggleChat","handleUserInput","target","handleKeyPress","key","_temp","PredefinedQuestions","questions","onSelect","className","styles","map","index","onClick","ChatBubbleBiBot","_ref2","_useBiBotChatBot","style","position","bottom","right","zIndex","backgroundColor","width","height","borderRadius","display","flexDirection","justifyContent","_chatBubbleConfig$col","color","borderTopLeftRadius","borderTopRightRadius","alignItems","paddingInline","paddingBlock","fontWeight","Indicator","inline","size","offset","Avatar","src","logo_url","alt","textAlign","paddingLeft","fontSize","lineHeight","overflowY","padding","flexGrow","marginBottom","maxWidth","alignSelf","length","marginLeft","ref","borderTop","borderBottomLeftRadius","borderBottomRightRadius","outline","border","marginRight","autoFocus","onChange","onKeyDown","placeholder","Button","disabled","icon","SendRounded","_chatBubbleConfig$col2","Close","ChatIcon","BiBot","MantineProvider"],"mappings":";;;;;;;;;;;;;;;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;MAAEC,MAAM,EAAE,EAAE;MAAEM,KAAK,EAAE;;IAAY,GAAG5G,oBAACwJ,QAAQ;IAACzD,KAAK,EAAE;MAAEM,KAAK,EAAE,EAAE;MAAEC,MAAM,EAAE,EAAE;MAAEM,KAAK,EAAE;;IAAW,CAChI,CACL;AAGV,CAAC;;IC9FY6C,KAAK,GAAG,SAARA,KAAKA,CAAAtK,IAAA;MAAMwD,QAAQ,GAAAxD,IAAA,CAARwD,QAAQ;EAC9B,OACA3C,oBAACd,WAAW,QACVc,oBAAC0J,oBAAe,QAChB1J,oBAAC4F,eAAe;IAACjD,QAAQ,EAAEA;IAAW,CACpB,CAEN;AAGhB,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/config/endpointEnums.ts","../src/hooks/usePluginFactory.tsx","../node_modules/babel-plugin-transform-async-to-promises/helpers.mjs","../src/config/appStateEnums.ts","../src/reducers/appReducer.ts","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/v4.js","../src/utils/sessionManager.tsx","../src/context/AppContext.tsx","../src/services/plugin-api.tsx","../src/hooks/useBiBotChatBot.tsx","../src/component/bibot.tsx","../src/index.tsx"],"sourcesContent":["\nexport const APP_DATA = {\n APP_NAME: 'Bibot'\n}\n\nconst baseUrls = {\n inference: 'https://inference.dev.bibot.thespuka.com/v0',\n}\n\nexport const endpoints = {\n get inference () {\n return baseUrls.inference\n },\n} as const\n\nexport enum domain {\n app = '/app',\n bibot = '/bibot',\n inference = '/inference',\n}\n\nexport enum resources {\n chatBubble = '/chat-bubble-config',\n predefinedQ = '/predefined-q',\n localQ = '/local-q',\n timedOutLocalQ = '/t-local-q',\n q = '/q'\n}\n","import axios from 'axios';\nimport { endpoints } from '../config/endpointEnums';\nconst inferenceBaseURL = endpoints.inference;\n\nexport const createPluginAxiosInstance = (params = {}, headers = {}) => {\n const instance = axios.create({\n baseURL: inferenceBaseURL,\n timeout: 60000, // 1 minute\n headers: {\n 'Content-Type': 'application/json',\n ...headers\n },\n ...params\n });\n\n\n instance.interceptors.response.use(\n (response) => {\n return response\n },\n async (error) => {\n let errMsg = 'An unknown error occurred'\n if (error.response) {\n errMsg = error.response.data.message\n } else if (error.request) {\n errMsg = 'No response received from the server.'\n } else {\n errMsg = `Error setting up the request: ${error.message}`\n }\n return await Promise.reject(new Error(errMsg))\n }\n )\n\n return instance\n}\n\n ","// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\nexport const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.iterator || (Symbol.iterator = Symbol(\"Symbol.iterator\"))) : \"@@iterator\";\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof target[_iteratorSymbol] === \"function\") {\n\t\tvar iterator = target[_iteratorSymbol](), step, pact, reject;\n\t\tfunction _cycle(result) {\n\t\t\ttry {\n\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pact) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t} else {\n\t\t\t\t\tpact = result;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t\t}\n\t\t}\n\t\t_cycle();\n\t\tif (iterator.return) {\n\t\t\tvar _fixup = function(value) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\titerator.return();\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tif (pact && pact.then) {\n\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t});\n\t\t\t}\n\t\t\t_fixup();\n\t\t}\n\t\treturn pact;\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"Object is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\nexport const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))) : \"@@asyncIterator\";\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof target[_asyncIteratorSymbol] === \"function\") {\n\t\tvar pact = new _Pact();\n\t\tvar iterator = target[_asyncIteratorSymbol]();\n\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\treturn pact;\n\t\tfunction _resumeAfterBody(result) {\n\t\t\tif (check && check()) {\n\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t}\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t}\n\t\tfunction _resumeAfterNext(step) {\n\t\t\tif (step.done) {\n\t\t\t\t_settle(pact, 1);\n\t\t\t} else {\n\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t}\n\t\t}\n\t\tfunction _reject(error) {\n\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, result);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = /*#__PURE__*/ {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\tvar result = _entry(_this);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tresult.then(returnValue, function(error) {\n\t\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturnValue(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\n\t_AsyncGenerator.prototype[_asyncIteratorSymbol] = function() {\n\t\treturn this;\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","export enum appStateEnums {\n BIBOT = 'BIBOT'\n}\n","import { appStateEnums } from '../config/appStateEnums'\nimport type { AppStates, AppAction } from '../types/coreInterfaces'\n\nexport const appReducer = (state: AppStates, action: AppAction): AppStates => {\n console.log('This is the appReducer state', state, action)\n switch (action.type) {\n case appStateEnums.BIBOT:\n return {\n ...state,\n chatIsOpen: action.chatIsOpen\n }\n default:\n return state\n }\n}\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","import { v4 as uuidv4 } from 'uuid'\n\nconst SESSION_KEY: string = 'bibotUserSessionId'\n\nconst getSessionId = (): string => {\n const sessionId = localStorage.getItem(SESSION_KEY)\n if (sessionId === null) {\n const newSessionId = uuidv4()\n localStorage.setItem(SESSION_KEY, newSessionId)\n return newSessionId\n }\n return sessionId\n}\n\nexport { getSessionId }\n","import { appStateEnums } from '../config/appStateEnums'\nimport React, { createContext, useReducer, useEffect } from 'react'\nimport { ReactNode } from 'react'\nimport { appReducer } from '../reducers/appReducer'\nimport type { AppContextProps, AppStates } from '../types/coreInterfaces'\nimport { getSessionId } from '../utils/sessionManager'\n\ninterface AppProps {\n children: ReactNode\n}\n\nconst dummyDispatch = () => {} // A no-op function.\n\nconst defaultContextValue: AppContextProps = {\n state: {\n chatIsOpen: false,\n sessionId: getSessionId()\n },\n dispatch: dummyDispatch\n}\n\nconst AppContext = createContext<AppContextProps>(defaultContextValue)\n\nconst AppProvider: React.FC<AppProps> = ({ children }) => {\n const APP_STATE_KEY = 'app_states'\n const initialState: AppStates = {\n chatIsOpen: false,\n sessionId: getSessionId()\n }\n\n const [state, dispatch] = useReducer(appReducer, initialState)\n\n useEffect(() => {\n // Pool the initial states from local storage\n const storedStates = localStorage.getItem(APP_STATE_KEY)\n\n if (storedStates) {\n try {\n const parsedStates = JSON.parse(storedStates)\n\n // Merge stored states with initial states\n const updatedStates = {\n ...initialState,\n ...parsedStates\n }\n console.log(initialState, parsedStates, updatedStates)\n // Dispatch action to update the states\n dispatch({ type: appStateEnums.BIBOT, ...updatedStates })\n } catch (error) {\n console.error('Failed to parse app states from local storage:', error)\n }\n }\n }, [])\n\n useEffect(() => {\n console.log('Changes in state: ', state)\n localStorage.setItem(APP_STATE_KEY, JSON.stringify(state))\n }, [state])\n\n return (\n <AppContext.Provider value={{ state, dispatch }}>\n {children}\n </AppContext.Provider>\n )\n}\n\nexport { AppContext, AppProvider }\n","import { domain, resources } from '../config/endpointEnums'\nimport { createPluginAxiosInstance } from '../hooks/usePluginFactory'\n\nconst pluginAxiosInstance=createPluginAxiosInstance()\n\ninterface Q_DATA_TYPE {\n client_id: string\n q: string\n endSession?: boolean\n session_id: string\n chat_id: string\n tries?: number\n}\n\ninterface RemoteChatBubbleConfigProps {\n bgColor: string,\n chatColor: string,\n title: string,\n userImage: string\n}\n\nasync function askTimedOutBiBot(data: Q_DATA_TYPE): Promise<string> {\n try {\n // return 'Hello'\n const path=`${domain.bibot}${resources.timedOutLocalQ}`\n const response=await pluginAxiosInstance.post<any>(path, data)\n console.log(response)\n return response.data.message\n } catch (error) {\n console.log(error.message)\n return error.message\n }\n}\n\nasync function askBiBot(data: Q_DATA_TYPE): Promise<string> {\n try {\n const path=`${domain.inference}${resources.q}`\n const response=await pluginAxiosInstance.post<any>(path, data)\n console.log(response)\n return response.data.message\n // return 'Hello'\n } catch (error1) {\n console.log(error1.message)\n if (error1.code==='ECONNABORTED'||error1.message.includes('Endpoint request timed out')) {\n try {\n return await askTimedOutBiBot({\n ...data,\n tries: 2\n })\n } catch (error2) {\n if (error2.code==='ECONNABORTED'||error2.message.includes('Endpoint request timed out')) {\n try {\n return await askTimedOutBiBot({\n ...data,\n tries: 3\n })\n } catch (error3) {\n return error3.message\n }\n } else {\n return error2.message\n }\n }\n } else {\n return error1.message\n }\n }\n}\n// TODO: Emmanuel fix the default returned values, especially the userImage to a default robot image\nasync function getRemoteClientChatBubbleConfig(params: { client_id: string }): Promise<RemoteChatBubbleConfigProps> {\n try {\n // return {\n // bgColor: 'white',\n // chatColor: 'blue',\n // title: 'ChatBot',\n // userImage: 'string'\n // }\n const path=`${domain.inference}${resources.chatBubble}`\n const response=await pluginAxiosInstance.get<any>(path, { params })\n return response.data\n } catch (error) {\n return {\n bgColor: 'white',\n chatColor: 'blue',\n title: 'ChatBot',\n userImage: 'string'\n }\n }\n}\n\nasync function getRemoteClientChatPredefinedQuestions(params: { client_id: string }): Promise<string[]> {\n try {\n // return ['Hello']\n const path=`${domain.inference}${resources.predefinedQ}`\n const response=await pluginAxiosInstance.get<any>(path, { params })\n return response.data.predefined_messages\n } catch (error) {\n return ['These are placeholders', 'They will be removed in production', 'This will be empty if there are no predefined questions', 'So hide if there are no predefined questions']\n }\n}\n\nasync function GetPredefinedQuestion (){\n const clientId = '6c74b4bb-0395-4751-a55f-7d065d67c56b'\n try {\n // return [{question: \"q\", answer: \"a\"}]\n const path = `${domain.inference}${resources.predefinedQ}?client_id=${clientId}`\n const response = await pluginAxiosInstance.get(path)\n return response.data\n } catch (error) {\n console.error('Error fetching subscription:', error)\n }\n }\n\nexport {\n askBiBot,\n getRemoteClientChatBubbleConfig,\n getRemoteClientChatPredefinedQuestions,\n GetPredefinedQuestion\n}\n","import { message } from 'antd'\nimport React, { useEffect, useRef, useState, useContext, useCallback } from 'react'\nimport { AppContext } from '../context/AppContext'\n\nimport { v4 as uuidv4 } from 'uuid'\nimport { askBiBot, getRemoteClientChatBubbleConfig, getRemoteClientChatPredefinedQuestions } from '../services/plugin-api'\ninterface UseBiBotChatBotProps {\n clientId: string\n }\n\ninterface ChatBubbleConfigProps {\n bgColor?: string,\n color?: string,\n title?: string,\n logo_url?: string\n}\nconst useBiBotChatBot = ({ clientId }: UseBiBotChatBotProps) => {\n const [predefinedQuestions, setPredefinedQuestions] = useState<string[]>([]) // State to store predefined questions\n const [showPredefinedQuestions, setShowPredefinedQuestions] = useState(true); // State to toggle predefined questions\n const { state } = useContext(AppContext)\n const [ chatIsOpen, setChatIsOpen ] = useState<boolean>(false)\n const [messages, setMessages] = useState<Array<{ sender: 'user' | 'bot', text: string }>>([])\n const [userInput, setUserInput] = useState('')\n const [isLoading, setIsLoading] = useState(false)\n const messageEndRef = useRef<HTMLDivElement>(null)\n const [chatBubbleConfig, setChatBubbleConfig] = useState<ChatBubbleConfigProps>()\n\n // Function to handle selecting a predefined question\n const handlePredefinedQuestionSelect = (question: any) => {\n setUserInput(question);\n sendInputInquiry();\n setShowPredefinedQuestions(false); // Hide predefined questions after selection\n }\n \n const getChatBubbleConfig = useCallback(async()=>{\n const remotePredefinedQuestions = await getRemoteClientChatPredefinedQuestions({client_id: clientId})\n if (remotePredefinedQuestions){\n setPredefinedQuestions(remotePredefinedQuestions)\n }\n const remoteChatBubbleConfig = await getRemoteClientChatBubbleConfig({client_id: clientId})\n if (remoteChatBubbleConfig){\n setChatBubbleConfig(remoteChatBubbleConfig)\n }\n },[clientId])\n\n useEffect(()=>{\n void getChatBubbleConfig()\n }, [getChatBubbleConfig])\n \n useEffect(() => {\n if (messageEndRef?.current) { messageEndRef.current.scrollIntoView({ behavior: 'smooth' }) }\n }, [messages])\n\n const toggleChat = () => {\n console.log('This is it', chatIsOpen)\n setChatIsOpen(!chatIsOpen)\n }\n\n const handleUserInput = (e: React.ChangeEvent<HTMLInputElement>) => {\n setUserInput(e.target.value)\n }\n\n async function sendInputInquiry () {\n setIsLoading(true)\n setUserInput('')\n try {\n if (userInput.trim()) {\n // dispatch({ type: appStateEnums.BIBOT, chatIsOpen: true })\n setMessages(messages => [...messages, { sender: 'user', text: userInput }])\n const response = await askBiBot({\n client_id: clientId,\n q: userInput.trim(),\n session_id: state.sessionId,\n chat_id: uuidv4()\n })\n setMessages(messages => [...messages, { sender: 'bot', text: response }])\n }\n } catch (error) {\n void message.error(error?.message ?? 'Failed to get response from server')\n } finally {\n setIsLoading(false)\n }\n }\n\n const handleKeyPress = async (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !isLoading) {\n await sendInputInquiry()\n }\n }\n return {\n chatIsOpen,\n messages,\n isLoading,\n messageEndRef,\n userInput,\n handleUserInput,\n handleKeyPress,\n toggleChat,\n sendInputInquiry,\n chatBubbleConfig,\n showPredefinedQuestions,\n predefinedQuestions,\n handlePredefinedQuestionSelect,\n }\n}\n\nexport { useBiBotChatBot }\n","import { Avatar, Indicator } from '@mantine/core'\nimport { Close, SendRounded } from '@mui/icons-material'\nimport ChatIcon from '@mui/icons-material/Chat'\nimport { Button } from 'antd'\nimport { useBiBotChatBot } from '../hooks'\nimport * as React from 'react'\nimport styles from '../styles.module.css'\n\ninterface bubbleProps {\n clientId: string\n}\n\ninterface PredefinedQuestionsProps {\n onSelect: (question: string) => void\n questions: string[]\n}\n\nconst PredefinedQuestions = ({ questions, onSelect }: PredefinedQuestionsProps) => {\n return (\n <div className={styles['predefined-questions']}>\n {questions.map((question, index) => (\n <div key={index} className={styles['predefined-questions']} onClick={() => onSelect(question)}>\n {question}\n </div>\n ))}\n </div>\n );\n};\n\nconst ChatBubbleBiBot = ({ clientId }: bubbleProps) => {\n const {\n chatIsOpen,\n messages,\n isLoading,\n messageEndRef,\n userInput,\n handleUserInput,\n handleKeyPress,\n sendInputInquiry,\n toggleChat,\n chatBubbleConfig,\n showPredefinedQuestions,\n predefinedQuestions,\n handlePredefinedQuestionSelect,\n } = useBiBotChatBot({clientId})\n\n return (\n \n <div className={`chat-bubble ${chatIsOpen ? 'open' : ''}`} style={{ position: 'fixed', bottom: '20px', right: '20px', zIndex: 9999}}>\n {chatIsOpen && (\n <div className={styles[\"chat-window\"]} style={{ backgroundColor: '#fff', position: 'absolute', bottom: '50px', right: '25px', width: 350, height: 500, borderRadius: 10, display: 'flex', flexDirection: 'column', justifyContent: 'space-between', border: '2px solid #dedede' }}>\n <div className={styles[\"chat-header\"]} style={{ backgroundColor: chatBubbleConfig?.color ?? '#dedede', height: '50px', borderTopLeftRadius: 8, borderTopRightRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'flex-start', paddingInline: 15, paddingBlock: 30 }}>\n <div style={{ alignItems: 'center', display: 'flex', color: '#fff', fontWeight: 'bold' }}>\n <Indicator inline size={12} offset={7} position=\"bottom-end\" color={ 'green' }>\n <Avatar color=\"white\" src={chatBubbleConfig?.logo_url} alt=\"profile\" />\n </Indicator>\n </div>\n <div style={{ display: 'flex', flexDirection: 'column', textAlign: 'left', paddingLeft: '10px', justifyContent: 'flex-start', color: '#fff' }}>\n <span style={{ fontWeight: 'bold' }}>{chatBubbleConfig?.title}</span>\n {}\n {isLoading ? <span style={{ fontSize: '12px', lineHeight: '0.5' }}>Typing...</span> : <span style={{ fontSize: '12px', lineHeight: '0.5' }}>{'Online'}</span>}\n </div>\n </div>\n <div className={styles[\"message-list\"]} style={{ height: 'calc(100% - 100px)', overflowY: 'auto', padding: 10, display: 'flex', flexGrow: 1, flexDirection: 'column'}}>\n {messages.map((message: { sender: 'user' | 'bot', text: string }, index: number) => (\n message.sender === 'user'\n ? <div key={index} className={`message ${message.sender}`} style={{ marginBottom: 10, padding: '5px 10px', borderRadius: 8, maxWidth: '70%', alignSelf: 'flex-end', fontSize: '15px', backgroundColor: '#b8b8b8c6', color:'#000', textAlign: 'left'}}>\n {message.text}\n </div>\n : <div key={index} style={{ display: 'flex' }}>\n <Avatar color=\"white\" src={chatBubbleConfig?.logo_url} size={25} alt=\"profile\" />\n <div className={`message ${message.sender}`} style={{ marginBottom: 10, padding: '5px 10px', borderRadius: 8, maxWidth: '70%', alignSelf: 'flex-start', fontSize: '15px', backgroundColor: '#f0f0f0', color:'#000', textAlign: 'left' }}>\n {message.text}\n </div>\n </div>\n ))}\n {showPredefinedQuestions && predefinedQuestions && predefinedQuestions.length > 0 && (\n <PredefinedQuestions questions={predefinedQuestions} onSelect={handlePredefinedQuestionSelect} />\n )}\n {isLoading && <div style={{marginLeft: '20px'}} className='message'> <div className=\"loader\"></div> </div> }\n <div ref={messageEndRef} />\n </div>\n <div className={styles[\"input-area\"]} style={{ display: 'flex', alignItems: 'center', borderTop: '1px solid #ddd', padding: 10, borderBottomLeftRadius: 8, borderBottomRightRadius: 8}}>\n <input\n style={{ outline: 'none', flexGrow: 1, border: 'none', backgroundColor: 'transparent', padding: '5px 10px', marginRight: 10}}\n autoFocus={true}\n type=\"text\"\n value={userInput}\n onChange={handleUserInput}\n onKeyDown={handleKeyPress}\n placeholder=\"Ask a question\"\n />\n <Button disabled={isLoading ?? true} style={{ backgroundColor: 'transparent', color: isLoading ? '#dedede' : chatBubbleConfig?.color }} size='middle' icon={<SendRounded />} onClick={sendInputInquiry}/>\n </div>\n </div>\n )}\n <Button type='link' onClick={toggleChat} className={styles[\"chat-toggle\"]} style={{ backgroundColor: chatBubbleConfig?.color ?? '#dedede', color: '#fff', borderRadius: '50%', width: '60px', height: '60px', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n {chatIsOpen ? <Close style={{ width: 30, height: 30, color: '#fff' }} /> : <ChatIcon style={{ width: 30, height: 30, color: '#fff' }}/>}\n </Button>\n </div>\n\n )\n}\n\nexport default ChatBubbleBiBot\n","import * as React from 'react'\n\nimport ChatBubbleBiBot from './component/bibot';\nimport { AppProvider } from './context/AppContext';\nimport { MantineProvider } from '@mantine/core'\ninterface Props {\n clientId: string\n}\nexport const BiBot = ({ clientId }: Props) => {\n return (\n <AppProvider>\n <MantineProvider>\n <ChatBubbleBiBot clientId={clientId}/>\n </MantineProvider>\n \n </AppProvider>\n )\n \n}\n"],"names":["baseUrls","inference","endpoints","domain","resources","inferenceBaseURL","createPluginAxiosInstance","params","headers","instance","axios","create","_extends","baseURL","timeout","interceptors","response","use","error","errMsg","data","message","request","Promise","resolve","reject","Error","e","appStateEnums","appReducer","state","action","console","log","type","BIBOT","chatIsOpen","SESSION_KEY","getSessionId","sessionId","localStorage","getItem","newSessionId","uuidv4","setItem","dummyDispatch","defaultContextValue","dispatch","AppContext","createContext","AppProvider","_ref","children","APP_STATE_KEY","initialState","_useReducer","useReducer","useEffect","storedStates","parsedStates","JSON","parse","updatedStates","stringify","React","Provider","value","getRemoteClientChatPredefinedQuestions","path","predefinedQ","pluginAxiosInstance","get","then","predefined_messages","getRemoteClientChatBubbleConfig","chatBubble","bgColor","chatColor","title","userImage","askBiBot","q","post","error1","code","includes","_catch","askTimedOutBiBot","tries","error2","error3","bibot","timedOutLocalQ","useBiBotChatBot","sendInputInquiry","setIsLoading","setUserInput","_finallyRethrows","_temp2","userInput","trim","setMessages","messages","concat","sender","text","client_id","clientId","session_id","chat_id","_error$message","_wasThrown","_result","_useState","useState","predefinedQuestions","setPredefinedQuestions","_useState2","showPredefinedQuestions","setShowPredefinedQuestions","_useContext","useContext","_useState3","setChatIsOpen","_useState4","_useState5","_useState6","isLoading","messageEndRef","useRef","_useState7","chatBubbleConfig","setChatBubbleConfig","handlePredefinedQuestionSelect","question","getChatBubbleConfig","useCallback","remotePredefinedQuestions","remoteChatBubbleConfig","current","scrollIntoView","behavior","toggleChat","handleUserInput","target","handleKeyPress","key","_temp","PredefinedQuestions","questions","onSelect","className","styles","map","index","onClick","ChatBubbleBiBot","_ref2","_useBiBotChatBot","style","position","bottom","right","zIndex","backgroundColor","width","height","borderRadius","display","flexDirection","justifyContent","border","_chatBubbleConfig$col","color","borderTopLeftRadius","borderTopRightRadius","alignItems","paddingInline","paddingBlock","fontWeight","Indicator","inline","size","offset","Avatar","src","logo_url","alt","textAlign","paddingLeft","fontSize","lineHeight","overflowY","padding","flexGrow","marginBottom","maxWidth","alignSelf","length","marginLeft","ref","borderTop","borderBottomLeftRadius","borderBottomRightRadius","outline","marginRight","autoFocus","onChange","onKeyDown","placeholder","Button","disabled","icon","SendRounded","_chatBubbleConfig$col2","Close","ChatIcon","BiBot","MantineProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,QAAQ,GAAG;EACfC,SAAS,EAAE;CACZ;AAEM,IAAMC,SAAS,GAAG;EACvB,IAAID,SAASA;IACX,OAAOD,QAAQ,CAACC,SAAS;;CAEnB;AAEV,IAAYE,MAIX;AAJD,WAAYA,MAAM;EAChBA,sBAAY;EACZA,0BAAgB;EAChBA,kCAAwB;AAC1B,CAAC,EAJWA,MAAM,KAANA,MAAM;AAMlB,IAAYC,SAMX;AAND,WAAYA,SAAS;EACnBA,+CAAkC;EAClCA,0CAA6B;EAC7BA,gCAAmB;EACnBA,0CAA6B;EAC7BA,qBAAQ;AACV,CAAC,EANWA,SAAS,KAATA,SAAS;;ACnBrB,IAAMC,gBAAgB,GAAGH,SAAS,CAACD,SAAS;AAE5C,AAAO,IAAMK,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAIC,MAAM,EAAOC,OAAO;MAApBD,MAAM;IAANA,MAAM,GAAG,EAAE;;EAAA,IAAEC,OAAO;IAAPA,OAAO,GAAG,EAAE;;EACjE,IAAMC,QAAQ,GAAGC,KAAK,CAACC,MAAM,CAAAC,QAAA;IAC3BC,OAAO,EAAER,gBAAgB;IACzBS,OAAO,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ES,IAAI,EAAC,QAAQ;IAAC8B,IAAI,EAAEpJ,oBAACqJ,yBAAW,OAAG;IAAE1D,OAAO,EAAE7D;IAAmB,CACrM,CAET,EACD9B,oBAACkJ,WAAM;IAAChL,IAAI,EAAC,MAAM;IAACyH,OAAO,EAAEb,UAAU;IAAES,SAAS,EAAEC,MAAM,CAAC,aAAa,CAAC;IAAEO,KAAK,EAAE;MAAEK,eAAe,GAAAkD,sBAAA,GAAEnF,gBAAgB,aAAhBA,gBAAgB,uBAAhBA,gBAAgB,CAAE0C,KAAK,YAAAyC,sBAAA,GAAI,SAAS;MAAEzC,KAAK,EAAE,MAAM;MAAEN,YAAY,EAAE,KAAK;MAAEF,KAAK,EAAE,MAAM;MAAEC,MAAM,EAAE,MAAM;MAAEE,OAAO,EAAE,MAAM;MAAEQ,UAAU,EAAE,QAAQ;MAAEN,cAAc,EAAE;;KAClQtI,UAAU,GAAG4B,oBAACuJ,mBAAK;IAACxD,KAAK,EAAE;MAAEM,KAAK,EAAE,EAAE;MAAEC,MAAM,EAAE,EAAE;MAAEO,KAAK,EAAE;;IAAY,GAAG7G,oBAACwJ,QAAQ;IAACzD,KAAK,EAAE;MAAEM,KAAK,EAAE,EAAE;MAAEC,MAAM,EAAE,EAAE;MAAEO,KAAK,EAAE;;IAAW,CAChI,CACL;AAGV,CAAC;;IC9FY4C,KAAK,GAAG,SAARA,KAAKA,CAAAtK,IAAA;MAAMwD,QAAQ,GAAAxD,IAAA,CAARwD,QAAQ;EAC9B,OACA3C,oBAACd,WAAW,QACVc,oBAAC0J,oBAAe,QAChB1J,oBAAC4F,eAAe;IAACjD,QAAQ,EAAEA;IAAW,CACpB,CAEN;AAGhB,CAAC;;;;"}
@@ -532,12 +532,14 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(_ref2) {
532
532
  borderRadius: 10,
533
533
  display: 'flex',
534
534
  flexDirection: 'column',
535
- justifyContent: 'space-between'
535
+ justifyContent: 'space-between',
536
+ border: '2px solid #dedede'
536
537
  }
537
538
  }, createElement("div", {
538
539
  className: styles["chat-header"],
539
540
  style: {
540
541
  backgroundColor: (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede',
542
+ height: '50px',
541
543
  borderTopLeftRadius: 8,
542
544
  borderTopRightRadius: 8,
543
545
  display: 'flex',
@@ -604,11 +606,12 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(_ref2) {
604
606
  marginBottom: 10,
605
607
  padding: '5px 10px',
606
608
  borderRadius: 8,
607
- maxWidth: 70,
609
+ maxWidth: '70%',
608
610
  alignSelf: 'flex-end',
609
611
  fontSize: '15px',
610
612
  backgroundColor: '#b8b8b8c6',
611
- color: '#000'
613
+ color: '#000',
614
+ textAlign: 'left'
612
615
  }
613
616
  }, message.text) : createElement("div", {
614
617
  key: index,
@@ -626,10 +629,12 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(_ref2) {
626
629
  marginBottom: 10,
627
630
  padding: '5px 10px',
628
631
  borderRadius: 8,
632
+ maxWidth: '70%',
629
633
  alignSelf: 'flex-start',
630
634
  fontSize: '15px',
631
635
  backgroundColor: '#f0f0f0',
632
- color: '#000'
636
+ color: '#000',
637
+ textAlign: 'left'
633
638
  }
634
639
  }, message.text));
635
640
  }), showPredefinedQuestions && predefinedQuestions && predefinedQuestions.length > 0 && createElement(PredefinedQuestions, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.modern.js","sources":["../src/config/endpointEnums.ts","../src/hooks/usePluginFactory.tsx","../node_modules/babel-plugin-transform-async-to-promises/helpers.mjs","../src/config/appStateEnums.ts","../src/reducers/appReducer.ts","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/v4.js","../src/utils/sessionManager.tsx","../src/context/AppContext.tsx","../src/services/plugin-api.tsx","../src/hooks/useBiBotChatBot.tsx","../src/component/bibot.tsx","../src/index.tsx"],"sourcesContent":["\nexport const APP_DATA = {\n APP_NAME: 'Bibot'\n}\n\nconst baseUrls = {\n inference: 'https://inference.dev.bibot.thespuka.com/v0',\n}\n\nexport const endpoints = {\n get inference () {\n return baseUrls.inference\n },\n} as const\n\nexport enum domain {\n app = '/app',\n bibot = '/bibot',\n inference = '/inference',\n}\n\nexport enum resources {\n chatBubble = '/chat-bubble-config',\n predefinedQ = '/predefined-q',\n localQ = '/local-q',\n timedOutLocalQ = '/t-local-q',\n q = '/q'\n}\n","import axios from 'axios';\nimport { endpoints } from '../config/endpointEnums';\nconst inferenceBaseURL = endpoints.inference;\n\nexport const createPluginAxiosInstance = (params = {}, headers = {}) => {\n const instance = axios.create({\n baseURL: inferenceBaseURL,\n timeout: 60000, // 1 minute\n headers: {\n 'Content-Type': 'application/json',\n ...headers\n },\n ...params\n });\n\n\n instance.interceptors.response.use(\n (response) => {\n return response\n },\n async (error) => {\n let errMsg = 'An unknown error occurred'\n if (error.response) {\n errMsg = error.response.data.message\n } else if (error.request) {\n errMsg = 'No response received from the server.'\n } else {\n errMsg = `Error setting up the request: ${error.message}`\n }\n return await Promise.reject(new Error(errMsg))\n }\n )\n\n return instance\n}\n\n ","// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\nexport const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.iterator || (Symbol.iterator = Symbol(\"Symbol.iterator\"))) : \"@@iterator\";\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof target[_iteratorSymbol] === \"function\") {\n\t\tvar iterator = target[_iteratorSymbol](), step, pact, reject;\n\t\tfunction _cycle(result) {\n\t\t\ttry {\n\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pact) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t} else {\n\t\t\t\t\tpact = result;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t\t}\n\t\t}\n\t\t_cycle();\n\t\tif (iterator.return) {\n\t\t\tvar _fixup = function(value) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\titerator.return();\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tif (pact && pact.then) {\n\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t});\n\t\t\t}\n\t\t\t_fixup();\n\t\t}\n\t\treturn pact;\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"Object is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\nexport const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))) : \"@@asyncIterator\";\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof target[_asyncIteratorSymbol] === \"function\") {\n\t\tvar pact = new _Pact();\n\t\tvar iterator = target[_asyncIteratorSymbol]();\n\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\treturn pact;\n\t\tfunction _resumeAfterBody(result) {\n\t\t\tif (check && check()) {\n\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t}\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t}\n\t\tfunction _resumeAfterNext(step) {\n\t\t\tif (step.done) {\n\t\t\t\t_settle(pact, 1);\n\t\t\t} else {\n\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t}\n\t\t}\n\t\tfunction _reject(error) {\n\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, result);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = /*#__PURE__*/ {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\tvar result = _entry(_this);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tresult.then(returnValue, function(error) {\n\t\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturnValue(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\n\t_AsyncGenerator.prototype[_asyncIteratorSymbol] = function() {\n\t\treturn this;\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","export enum appStateEnums {\n BIBOT = 'BIBOT'\n}\n","import { appStateEnums } from '../config/appStateEnums'\nimport type { AppStates, AppAction } from '../types/coreInterfaces'\n\nexport const appReducer = (state: AppStates, action: AppAction): AppStates => {\n console.log('This is the appReducer state', state, action)\n switch (action.type) {\n case appStateEnums.BIBOT:\n return {\n ...state,\n chatIsOpen: action.chatIsOpen\n }\n default:\n return state\n }\n}\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","import { v4 as uuidv4 } from 'uuid'\n\nconst SESSION_KEY: string = 'bibotUserSessionId'\n\nconst getSessionId = (): string => {\n const sessionId = localStorage.getItem(SESSION_KEY)\n if (sessionId === null) {\n const newSessionId = uuidv4()\n localStorage.setItem(SESSION_KEY, newSessionId)\n return newSessionId\n }\n return sessionId\n}\n\nexport { getSessionId }\n","import { appStateEnums } from '../config/appStateEnums'\nimport React, { createContext, useReducer, useEffect } from 'react'\nimport { ReactNode } from 'react'\nimport { appReducer } from '../reducers/appReducer'\nimport type { AppContextProps, AppStates } from '../types/coreInterfaces'\nimport { getSessionId } from '../utils/sessionManager'\n\ninterface AppProps {\n children: ReactNode\n}\n\nconst dummyDispatch = () => {} // A no-op function.\n\nconst defaultContextValue: AppContextProps = {\n state: {\n chatIsOpen: false,\n sessionId: getSessionId()\n },\n dispatch: dummyDispatch\n}\n\nconst AppContext = createContext<AppContextProps>(defaultContextValue)\n\nconst AppProvider: React.FC<AppProps> = ({ children }) => {\n const APP_STATE_KEY = 'app_states'\n const initialState: AppStates = {\n chatIsOpen: false,\n sessionId: getSessionId()\n }\n\n const [state, dispatch] = useReducer(appReducer, initialState)\n\n useEffect(() => {\n // Pool the initial states from local storage\n const storedStates = localStorage.getItem(APP_STATE_KEY)\n\n if (storedStates) {\n try {\n const parsedStates = JSON.parse(storedStates)\n\n // Merge stored states with initial states\n const updatedStates = {\n ...initialState,\n ...parsedStates\n }\n console.log(initialState, parsedStates, updatedStates)\n // Dispatch action to update the states\n dispatch({ type: appStateEnums.BIBOT, ...updatedStates })\n } catch (error) {\n console.error('Failed to parse app states from local storage:', error)\n }\n }\n }, [])\n\n useEffect(() => {\n console.log('Changes in state: ', state)\n localStorage.setItem(APP_STATE_KEY, JSON.stringify(state))\n }, [state])\n\n return (\n <AppContext.Provider value={{ state, dispatch }}>\n {children}\n </AppContext.Provider>\n )\n}\n\nexport { AppContext, AppProvider }\n","import { domain, resources } from '../config/endpointEnums'\nimport { createPluginAxiosInstance } from '../hooks/usePluginFactory'\n\nconst pluginAxiosInstance=createPluginAxiosInstance()\n\ninterface Q_DATA_TYPE {\n client_id: string\n q: string\n endSession?: boolean\n session_id: string\n chat_id: string\n tries?: number\n}\n\ninterface RemoteChatBubbleConfigProps {\n bgColor: string,\n chatColor: string,\n title: string,\n userImage: string\n}\n\nasync function askTimedOutBiBot(data: Q_DATA_TYPE): Promise<string> {\n try {\n // return 'Hello'\n const path=`${domain.bibot}${resources.timedOutLocalQ}`\n const response=await pluginAxiosInstance.post<any>(path, data)\n console.log(response)\n return response.data.message\n } catch (error) {\n console.log(error.message)\n return error.message\n }\n}\n\nasync function askBiBot(data: Q_DATA_TYPE): Promise<string> {\n try {\n const path=`${domain.inference}${resources.q}`\n const response=await pluginAxiosInstance.post<any>(path, data)\n console.log(response)\n return response.data.message\n // return 'Hello'\n } catch (error1) {\n console.log(error1.message)\n if (error1.code==='ECONNABORTED'||error1.message.includes('Endpoint request timed out')) {\n try {\n return await askTimedOutBiBot({\n ...data,\n tries: 2\n })\n } catch (error2) {\n if (error2.code==='ECONNABORTED'||error2.message.includes('Endpoint request timed out')) {\n try {\n return await askTimedOutBiBot({\n ...data,\n tries: 3\n })\n } catch (error3) {\n return error3.message\n }\n } else {\n return error2.message\n }\n }\n } else {\n return error1.message\n }\n }\n}\n// TODO: Emmanuel fix the default returned values, especially the userImage to a default robot image\nasync function getRemoteClientChatBubbleConfig(params: { client_id: string }): Promise<RemoteChatBubbleConfigProps> {\n try {\n // return {\n // bgColor: 'white',\n // chatColor: 'blue',\n // title: 'ChatBot',\n // userImage: 'string'\n // }\n const path=`${domain.inference}${resources.chatBubble}`\n const response=await pluginAxiosInstance.get<any>(path, { params })\n return response.data\n } catch (error) {\n return {\n bgColor: 'white',\n chatColor: 'blue',\n title: 'ChatBot',\n userImage: 'string'\n }\n }\n}\n\nasync function getRemoteClientChatPredefinedQuestions(params: { client_id: string }): Promise<string[]> {\n try {\n // return ['Hello']\n const path=`${domain.inference}${resources.predefinedQ}`\n const response=await pluginAxiosInstance.get<any>(path, { params })\n return response.data.predefined_messages\n } catch (error) {\n return ['These are placeholders', 'They will be removed in production', 'This will be empty if there are no predefined questions', 'So hide if there are no predefined questions']\n }\n}\n\nasync function GetPredefinedQuestion (){\n const clientId = '6c74b4bb-0395-4751-a55f-7d065d67c56b'\n try {\n // return [{question: \"q\", answer: \"a\"}]\n const path = `${domain.inference}${resources.predefinedQ}?client_id=${clientId}`\n const response = await pluginAxiosInstance.get(path)\n return response.data\n } catch (error) {\n console.error('Error fetching subscription:', error)\n }\n }\n\nexport {\n askBiBot,\n getRemoteClientChatBubbleConfig,\n getRemoteClientChatPredefinedQuestions,\n GetPredefinedQuestion\n}\n","import { message } from 'antd'\nimport React, { useEffect, useRef, useState, useContext, useCallback } from 'react'\nimport { AppContext } from '../context/AppContext'\n\nimport { v4 as uuidv4 } from 'uuid'\nimport { askBiBot, getRemoteClientChatBubbleConfig, getRemoteClientChatPredefinedQuestions } from '../services/plugin-api'\ninterface UseBiBotChatBotProps {\n clientId: string\n }\n\ninterface ChatBubbleConfigProps {\n bgColor?: string,\n color?: string,\n title?: string,\n logo_url?: string\n}\nconst useBiBotChatBot = ({ clientId }: UseBiBotChatBotProps) => {\n const [predefinedQuestions, setPredefinedQuestions] = useState<string[]>([]) // State to store predefined questions\n const [showPredefinedQuestions, setShowPredefinedQuestions] = useState(true); // State to toggle predefined questions\n const { state } = useContext(AppContext)\n const [ chatIsOpen, setChatIsOpen ] = useState<boolean>(false)\n const [messages, setMessages] = useState<Array<{ sender: 'user' | 'bot', text: string }>>([])\n const [userInput, setUserInput] = useState('')\n const [isLoading, setIsLoading] = useState(false)\n const messageEndRef = useRef<HTMLDivElement>(null)\n const [chatBubbleConfig, setChatBubbleConfig] = useState<ChatBubbleConfigProps>()\n\n // Function to handle selecting a predefined question\n const handlePredefinedQuestionSelect = (question: any) => {\n setUserInput(question);\n sendInputInquiry();\n setShowPredefinedQuestions(false); // Hide predefined questions after selection\n }\n \n const getChatBubbleConfig = useCallback(async()=>{\n const remotePredefinedQuestions = await getRemoteClientChatPredefinedQuestions({client_id: clientId})\n if (remotePredefinedQuestions){\n setPredefinedQuestions(remotePredefinedQuestions)\n }\n const remoteChatBubbleConfig = await getRemoteClientChatBubbleConfig({client_id: clientId})\n if (remoteChatBubbleConfig){\n setChatBubbleConfig(remoteChatBubbleConfig)\n }\n },[clientId])\n\n useEffect(()=>{\n void getChatBubbleConfig()\n }, [getChatBubbleConfig])\n \n useEffect(() => {\n if (messageEndRef?.current) { messageEndRef.current.scrollIntoView({ behavior: 'smooth' }) }\n }, [messages])\n\n const toggleChat = () => {\n console.log('This is it', chatIsOpen)\n setChatIsOpen(!chatIsOpen)\n }\n\n const handleUserInput = (e: React.ChangeEvent<HTMLInputElement>) => {\n setUserInput(e.target.value)\n }\n\n async function sendInputInquiry () {\n setIsLoading(true)\n setUserInput('')\n try {\n if (userInput.trim()) {\n // dispatch({ type: appStateEnums.BIBOT, chatIsOpen: true })\n setMessages(messages => [...messages, { sender: 'user', text: userInput }])\n const response = await askBiBot({\n client_id: clientId,\n q: userInput.trim(),\n session_id: state.sessionId,\n chat_id: uuidv4()\n })\n setMessages(messages => [...messages, { sender: 'bot', text: response }])\n }\n } catch (error) {\n void message.error(error?.message ?? 'Failed to get response from server')\n } finally {\n setIsLoading(false)\n }\n }\n\n const handleKeyPress = async (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !isLoading) {\n await sendInputInquiry()\n }\n }\n return {\n chatIsOpen,\n messages,\n isLoading,\n messageEndRef,\n userInput,\n handleUserInput,\n handleKeyPress,\n toggleChat,\n sendInputInquiry,\n chatBubbleConfig,\n showPredefinedQuestions,\n predefinedQuestions,\n handlePredefinedQuestionSelect,\n }\n}\n\nexport { useBiBotChatBot }\n","import { Avatar, Indicator } from '@mantine/core'\nimport { Close, SendRounded } from '@mui/icons-material'\nimport ChatIcon from '@mui/icons-material/Chat'\nimport { Button } from 'antd'\nimport { useBiBotChatBot } from '../hooks'\nimport * as React from 'react'\nimport styles from '../styles.module.css'\n\ninterface bubbleProps {\n clientId: string\n}\n\ninterface PredefinedQuestionsProps {\n onSelect: (question: string) => void\n questions: string[]\n}\n\nconst PredefinedQuestions = ({ questions, onSelect }: PredefinedQuestionsProps) => {\n return (\n <div className={styles['predefined-questions']}>\n {questions.map((question, index) => (\n <div key={index} className={styles['predefined-questions']} onClick={() => onSelect(question)}>\n {question}\n </div>\n ))}\n </div>\n );\n};\n\nconst ChatBubbleBiBot = ({ clientId }: bubbleProps) => {\n const {\n chatIsOpen,\n messages,\n isLoading,\n messageEndRef,\n userInput,\n handleUserInput,\n handleKeyPress,\n sendInputInquiry,\n toggleChat,\n chatBubbleConfig,\n showPredefinedQuestions,\n predefinedQuestions,\n handlePredefinedQuestionSelect,\n } = useBiBotChatBot({clientId})\n\n return (\n \n <div className={`chat-bubble ${chatIsOpen ? 'open' : ''}`} style={{ position: 'fixed', bottom: '20px', right: '20px', zIndex: 9999}}>\n {chatIsOpen && (\n <div className={styles[\"chat-window\"]} style={{ backgroundColor: '#fff', position: 'absolute', bottom: '50px', right: '25px', width: 350, height: 500, borderRadius: 10, display: 'flex', flexDirection: 'column', justifyContent: 'space-between' }}>\n <div className={styles[\"chat-header\"]} style={{ backgroundColor: chatBubbleConfig?.color ?? '#dedede', borderTopLeftRadius: 8, borderTopRightRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'flex-start', paddingInline: 15, paddingBlock: 30 }}>\n <div style={{ alignItems: 'center', display: 'flex', color: '#fff', fontWeight: 'bold' }}>\n <Indicator inline size={12} offset={7} position=\"bottom-end\" color={ 'green' }>\n <Avatar color=\"white\" src={chatBubbleConfig?.logo_url} alt=\"profile\" />\n </Indicator>\n </div>\n <div style={{ display: 'flex', flexDirection: 'column', textAlign: 'left', paddingLeft: '10px', justifyContent: 'flex-start', color: '#fff' }}>\n <span style={{ fontWeight: 'bold' }}>{chatBubbleConfig?.title}</span>\n {}\n {isLoading ? <span style={{ fontSize: '12px', lineHeight: '0.5' }}>Typing...</span> : <span style={{ fontSize: '12px', lineHeight: '0.5' }}>{'Online'}</span>}\n </div>\n </div>\n <div className={styles[\"message-list\"]} style={{ height: 'calc(100% - 100px)', overflowY: 'auto', padding: 10, display: 'flex', flexGrow: 1, flexDirection: 'column'}}>\n {messages.map((message: { sender: 'user' | 'bot', text: string }, index: number) => (\n message.sender === 'user'\n ? <div key={index} className={`message ${message.sender}`} style={{ marginBottom: 10, padding: '5px 10px', borderRadius: 8, maxWidth: 70, alignSelf: 'flex-end', fontSize: '15px', backgroundColor: '#b8b8b8c6', color:'#000'}}>\n {message.text}\n </div>\n : <div key={index} style={{ display: 'flex' }}>\n <Avatar color=\"white\" src={chatBubbleConfig?.logo_url} size={25} alt=\"profile\" />\n <div className={`message ${message.sender}`} style={{ marginBottom: 10, padding: '5px 10px', borderRadius: 8, alignSelf: 'flex-start', fontSize: '15px', backgroundColor: '#f0f0f0', color:'#000'}}>\n {message.text}\n </div>\n </div>\n ))}\n {showPredefinedQuestions && predefinedQuestions && predefinedQuestions.length > 0 && (\n <PredefinedQuestions questions={predefinedQuestions} onSelect={handlePredefinedQuestionSelect} />\n )}\n {isLoading && <div style={{marginLeft: '20px'}} className='message'> <div className=\"loader\"></div> </div> }\n <div ref={messageEndRef} />\n </div>\n <div className={styles[\"input-area\"]} style={{ display: 'flex', alignItems: 'center', borderTop: '1px solid #ddd', padding: 10, borderBottomLeftRadius: 8, borderBottomRightRadius: 8}}>\n <input\n style={{ outline: 'none', flexGrow: 1, border: 'none', backgroundColor: 'transparent', padding: '5px 10px', marginRight: 10}}\n autoFocus={true}\n type=\"text\"\n value={userInput}\n onChange={handleUserInput}\n onKeyDown={handleKeyPress}\n placeholder=\"Ask a question\"\n />\n <Button disabled={isLoading ?? true} style={{ backgroundColor: 'transparent', color: isLoading ? '#dedede' : chatBubbleConfig?.color }} size='middle' icon={<SendRounded />} onClick={sendInputInquiry}/>\n </div>\n </div>\n )}\n <Button type='link' onClick={toggleChat} className={styles[\"chat-toggle\"]} style={{ backgroundColor: chatBubbleConfig?.color ?? '#dedede', color: '#fff', borderRadius: '50%', width: '60px', height: '60px', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n {chatIsOpen ? <Close style={{ width: 30, height: 30, color: '#fff' }} /> : <ChatIcon style={{ width: 30, height: 30, color: '#fff' }}/>}\n </Button>\n </div>\n\n )\n}\n\nexport default ChatBubbleBiBot\n","import * as React from 'react'\n\nimport ChatBubbleBiBot from './component/bibot';\nimport { AppProvider } from './context/AppContext';\nimport { MantineProvider } from '@mantine/core'\ninterface Props {\n clientId: string\n}\nexport const BiBot = ({ clientId }: Props) => {\n return (\n <AppProvider>\n <MantineProvider>\n <ChatBubbleBiBot clientId={clientId}/>\n </MantineProvider>\n \n </AppProvider>\n )\n \n}\n"],"names":["baseUrls","inference","endpoints","domain","resources","inferenceBaseURL","createPluginAxiosInstance","params","headers","instance","axios","create","_extends","baseURL","timeout","interceptors","response","use","error","errMsg","data","message","request","Promise","resolve","reject","Error","e","appStateEnums","appReducer","state","action","console","log","type","BIBOT","chatIsOpen","SESSION_KEY","getSessionId","sessionId","localStorage","getItem","newSessionId","uuidv4","setItem","dummyDispatch","defaultContextValue","dispatch","AppContext","createContext","AppProvider","_ref","children","APP_STATE_KEY","initialState","_useReducer","useReducer","useEffect","storedStates","parsedStates","JSON","parse","updatedStates","stringify","React","Provider","value","getRemoteClientChatPredefinedQuestions","path","predefinedQ","pluginAxiosInstance","get","then","predefined_messages","getRemoteClientChatBubbleConfig","chatBubble","bgColor","chatColor","title","userImage","askBiBot","q","post","error1","code","includes","_catch","askTimedOutBiBot","tries","error2","error3","bibot","timedOutLocalQ","useBiBotChatBot","sendInputInquiry","setIsLoading","setUserInput","_finallyRethrows","_temp2","userInput","trim","setMessages","messages","concat","sender","text","client_id","clientId","session_id","chat_id","_error$message","_wasThrown","_result","_useState","useState","predefinedQuestions","setPredefinedQuestions","_useState2","showPredefinedQuestions","setShowPredefinedQuestions","_useContext","useContext","_useState3","setChatIsOpen","_useState4","_useState5","_useState6","isLoading","messageEndRef","useRef","_useState7","chatBubbleConfig","setChatBubbleConfig","handlePredefinedQuestionSelect","question","getChatBubbleConfig","useCallback","remotePredefinedQuestions","remoteChatBubbleConfig","current","scrollIntoView","behavior","toggleChat","handleUserInput","target","handleKeyPress","key","_temp","PredefinedQuestions","questions","onSelect","className","styles","map","index","onClick","ChatBubbleBiBot","_ref2","_useBiBotChatBot","style","position","bottom","right","zIndex","backgroundColor","width","height","borderRadius","display","flexDirection","justifyContent","_chatBubbleConfig$col","color","borderTopLeftRadius","borderTopRightRadius","alignItems","paddingInline","paddingBlock","fontWeight","Indicator","inline","size","offset","Avatar","src","logo_url","alt","textAlign","paddingLeft","fontSize","lineHeight","overflowY","padding","flexGrow","marginBottom","maxWidth","alignSelf","length","marginLeft","ref","borderTop","borderBottomLeftRadius","borderBottomRightRadius","outline","border","marginRight","autoFocus","onChange","onKeyDown","placeholder","Button","disabled","icon","SendRounded","_chatBubbleConfig$col2","Close","ChatIcon","BiBot","MantineProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,QAAQ,GAAG;EACfC,SAAS,EAAE;CACZ;AAEM,IAAMC,SAAS,GAAG;EACvB,IAAID,SAASA;IACX,OAAOD,QAAQ,CAACC,SAAS;;CAEnB;AAEV,IAAYE,MAIX;AAJD,WAAYA,MAAM;EAChBA,sBAAY;EACZA,0BAAgB;EAChBA,kCAAwB;AAC1B,CAAC,EAJWA,MAAM,KAANA,MAAM;AAMlB,IAAYC,SAMX;AAND,WAAYA,SAAS;EACnBA,+CAAkC;EACl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B1J,cAAC4F,eAAe;IAACjD,QAAQ,EAAEA;IAAW,CACpB,CAEN;AAGhB,CAAC;;;;"}
1
+ {"version":3,"file":"index.modern.js","sources":["../src/config/endpointEnums.ts","../src/hooks/usePluginFactory.tsx","../node_modules/babel-plugin-transform-async-to-promises/helpers.mjs","../src/config/appStateEnums.ts","../src/reducers/appReducer.ts","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/native.js","../node_modules/uuid/dist/esm-browser/v4.js","../src/utils/sessionManager.tsx","../src/context/AppContext.tsx","../src/services/plugin-api.tsx","../src/hooks/useBiBotChatBot.tsx","../src/component/bibot.tsx","../src/index.tsx"],"sourcesContent":["\nexport const APP_DATA = {\n APP_NAME: 'Bibot'\n}\n\nconst baseUrls = {\n inference: 'https://inference.dev.bibot.thespuka.com/v0',\n}\n\nexport const endpoints = {\n get inference () {\n return baseUrls.inference\n },\n} as const\n\nexport enum domain {\n app = '/app',\n bibot = '/bibot',\n inference = '/inference',\n}\n\nexport enum resources {\n chatBubble = '/chat-bubble-config',\n predefinedQ = '/predefined-q',\n localQ = '/local-q',\n timedOutLocalQ = '/t-local-q',\n q = '/q'\n}\n","import axios from 'axios';\nimport { endpoints } from '../config/endpointEnums';\nconst inferenceBaseURL = endpoints.inference;\n\nexport const createPluginAxiosInstance = (params = {}, headers = {}) => {\n const instance = axios.create({\n baseURL: inferenceBaseURL,\n timeout: 60000, // 1 minute\n headers: {\n 'Content-Type': 'application/json',\n ...headers\n },\n ...params\n });\n\n\n instance.interceptors.response.use(\n (response) => {\n return response\n },\n async (error) => {\n let errMsg = 'An unknown error occurred'\n if (error.response) {\n errMsg = error.response.data.message\n } else if (error.request) {\n errMsg = 'No response received from the server.'\n } else {\n errMsg = `Error setting up the request: ${error.message}`\n }\n return await Promise.reject(new Error(errMsg))\n }\n )\n\n return instance\n}\n\n ","// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\nexport const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.iterator || (Symbol.iterator = Symbol(\"Symbol.iterator\"))) : \"@@iterator\";\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof target[_iteratorSymbol] === \"function\") {\n\t\tvar iterator = target[_iteratorSymbol](), step, pact, reject;\n\t\tfunction _cycle(result) {\n\t\t\ttry {\n\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pact) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t} else {\n\t\t\t\t\tpact = result;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t\t}\n\t\t}\n\t\t_cycle();\n\t\tif (iterator.return) {\n\t\t\tvar _fixup = function(value) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\titerator.return();\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tif (pact && pact.then) {\n\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t});\n\t\t\t}\n\t\t\t_fixup();\n\t\t}\n\t\treturn pact;\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"Object is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\nexport const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))) : \"@@asyncIterator\";\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof target[_asyncIteratorSymbol] === \"function\") {\n\t\tvar pact = new _Pact();\n\t\tvar iterator = target[_asyncIteratorSymbol]();\n\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\treturn pact;\n\t\tfunction _resumeAfterBody(result) {\n\t\t\tif (check && check()) {\n\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t}\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t}\n\t\tfunction _resumeAfterNext(step) {\n\t\t\tif (step.done) {\n\t\t\t\t_settle(pact, 1);\n\t\t\t} else {\n\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t}\n\t\t}\n\t\tfunction _reject(error) {\n\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, result);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = /*#__PURE__*/ {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\tvar result = _entry(_this);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tresult.then(returnValue, function(error) {\n\t\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturnValue(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\n\t_AsyncGenerator.prototype[_asyncIteratorSymbol] = function() {\n\t\treturn this;\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","export enum appStateEnums {\n BIBOT = 'BIBOT'\n}\n","import { appStateEnums } from '../config/appStateEnums'\nimport type { AppStates, AppAction } from '../types/coreInterfaces'\n\nexport const appReducer = (state: AppStates, action: AppAction): AppStates => {\n console.log('This is the appReducer state', state, action)\n switch (action.type) {\n case appStateEnums.BIBOT:\n return {\n ...state,\n chatIsOpen: action.chatIsOpen\n }\n default:\n return state\n }\n}\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","import { v4 as uuidv4 } from 'uuid'\n\nconst SESSION_KEY: string = 'bibotUserSessionId'\n\nconst getSessionId = (): string => {\n const sessionId = localStorage.getItem(SESSION_KEY)\n if (sessionId === null) {\n const newSessionId = uuidv4()\n localStorage.setItem(SESSION_KEY, newSessionId)\n return newSessionId\n }\n return sessionId\n}\n\nexport { getSessionId }\n","import { appStateEnums } from '../config/appStateEnums'\nimport React, { createContext, useReducer, useEffect } from 'react'\nimport { ReactNode } from 'react'\nimport { appReducer } from '../reducers/appReducer'\nimport type { AppContextProps, AppStates } from '../types/coreInterfaces'\nimport { getSessionId } from '../utils/sessionManager'\n\ninterface AppProps {\n children: ReactNode\n}\n\nconst dummyDispatch = () => {} // A no-op function.\n\nconst defaultContextValue: AppContextProps = {\n state: {\n chatIsOpen: false,\n sessionId: getSessionId()\n },\n dispatch: dummyDispatch\n}\n\nconst AppContext = createContext<AppContextProps>(defaultContextValue)\n\nconst AppProvider: React.FC<AppProps> = ({ children }) => {\n const APP_STATE_KEY = 'app_states'\n const initialState: AppStates = {\n chatIsOpen: false,\n sessionId: getSessionId()\n }\n\n const [state, dispatch] = useReducer(appReducer, initialState)\n\n useEffect(() => {\n // Pool the initial states from local storage\n const storedStates = localStorage.getItem(APP_STATE_KEY)\n\n if (storedStates) {\n try {\n const parsedStates = JSON.parse(storedStates)\n\n // Merge stored states with initial states\n const updatedStates = {\n ...initialState,\n ...parsedStates\n }\n console.log(initialState, parsedStates, updatedStates)\n // Dispatch action to update the states\n dispatch({ type: appStateEnums.BIBOT, ...updatedStates })\n } catch (error) {\n console.error('Failed to parse app states from local storage:', error)\n }\n }\n }, [])\n\n useEffect(() => {\n console.log('Changes in state: ', state)\n localStorage.setItem(APP_STATE_KEY, JSON.stringify(state))\n }, [state])\n\n return (\n <AppContext.Provider value={{ state, dispatch }}>\n {children}\n </AppContext.Provider>\n )\n}\n\nexport { AppContext, AppProvider }\n","import { domain, resources } from '../config/endpointEnums'\nimport { createPluginAxiosInstance } from '../hooks/usePluginFactory'\n\nconst pluginAxiosInstance=createPluginAxiosInstance()\n\ninterface Q_DATA_TYPE {\n client_id: string\n q: string\n endSession?: boolean\n session_id: string\n chat_id: string\n tries?: number\n}\n\ninterface RemoteChatBubbleConfigProps {\n bgColor: string,\n chatColor: string,\n title: string,\n userImage: string\n}\n\nasync function askTimedOutBiBot(data: Q_DATA_TYPE): Promise<string> {\n try {\n // return 'Hello'\n const path=`${domain.bibot}${resources.timedOutLocalQ}`\n const response=await pluginAxiosInstance.post<any>(path, data)\n console.log(response)\n return response.data.message\n } catch (error) {\n console.log(error.message)\n return error.message\n }\n}\n\nasync function askBiBot(data: Q_DATA_TYPE): Promise<string> {\n try {\n const path=`${domain.inference}${resources.q}`\n const response=await pluginAxiosInstance.post<any>(path, data)\n console.log(response)\n return response.data.message\n // return 'Hello'\n } catch (error1) {\n console.log(error1.message)\n if (error1.code==='ECONNABORTED'||error1.message.includes('Endpoint request timed out')) {\n try {\n return await askTimedOutBiBot({\n ...data,\n tries: 2\n })\n } catch (error2) {\n if (error2.code==='ECONNABORTED'||error2.message.includes('Endpoint request timed out')) {\n try {\n return await askTimedOutBiBot({\n ...data,\n tries: 3\n })\n } catch (error3) {\n return error3.message\n }\n } else {\n return error2.message\n }\n }\n } else {\n return error1.message\n }\n }\n}\n// TODO: Emmanuel fix the default returned values, especially the userImage to a default robot image\nasync function getRemoteClientChatBubbleConfig(params: { client_id: string }): Promise<RemoteChatBubbleConfigProps> {\n try {\n // return {\n // bgColor: 'white',\n // chatColor: 'blue',\n // title: 'ChatBot',\n // userImage: 'string'\n // }\n const path=`${domain.inference}${resources.chatBubble}`\n const response=await pluginAxiosInstance.get<any>(path, { params })\n return response.data\n } catch (error) {\n return {\n bgColor: 'white',\n chatColor: 'blue',\n title: 'ChatBot',\n userImage: 'string'\n }\n }\n}\n\nasync function getRemoteClientChatPredefinedQuestions(params: { client_id: string }): Promise<string[]> {\n try {\n // return ['Hello']\n const path=`${domain.inference}${resources.predefinedQ}`\n const response=await pluginAxiosInstance.get<any>(path, { params })\n return response.data.predefined_messages\n } catch (error) {\n return ['These are placeholders', 'They will be removed in production', 'This will be empty if there are no predefined questions', 'So hide if there are no predefined questions']\n }\n}\n\nasync function GetPredefinedQuestion (){\n const clientId = '6c74b4bb-0395-4751-a55f-7d065d67c56b'\n try {\n // return [{question: \"q\", answer: \"a\"}]\n const path = `${domain.inference}${resources.predefinedQ}?client_id=${clientId}`\n const response = await pluginAxiosInstance.get(path)\n return response.data\n } catch (error) {\n console.error('Error fetching subscription:', error)\n }\n }\n\nexport {\n askBiBot,\n getRemoteClientChatBubbleConfig,\n getRemoteClientChatPredefinedQuestions,\n GetPredefinedQuestion\n}\n","import { message } from 'antd'\nimport React, { useEffect, useRef, useState, useContext, useCallback } from 'react'\nimport { AppContext } from '../context/AppContext'\n\nimport { v4 as uuidv4 } from 'uuid'\nimport { askBiBot, getRemoteClientChatBubbleConfig, getRemoteClientChatPredefinedQuestions } from '../services/plugin-api'\ninterface UseBiBotChatBotProps {\n clientId: string\n }\n\ninterface ChatBubbleConfigProps {\n bgColor?: string,\n color?: string,\n title?: string,\n logo_url?: string\n}\nconst useBiBotChatBot = ({ clientId }: UseBiBotChatBotProps) => {\n const [predefinedQuestions, setPredefinedQuestions] = useState<string[]>([]) // State to store predefined questions\n const [showPredefinedQuestions, setShowPredefinedQuestions] = useState(true); // State to toggle predefined questions\n const { state } = useContext(AppContext)\n const [ chatIsOpen, setChatIsOpen ] = useState<boolean>(false)\n const [messages, setMessages] = useState<Array<{ sender: 'user' | 'bot', text: string }>>([])\n const [userInput, setUserInput] = useState('')\n const [isLoading, setIsLoading] = useState(false)\n const messageEndRef = useRef<HTMLDivElement>(null)\n const [chatBubbleConfig, setChatBubbleConfig] = useState<ChatBubbleConfigProps>()\n\n // Function to handle selecting a predefined question\n const handlePredefinedQuestionSelect = (question: any) => {\n setUserInput(question);\n sendInputInquiry();\n setShowPredefinedQuestions(false); // Hide predefined questions after selection\n }\n \n const getChatBubbleConfig = useCallback(async()=>{\n const remotePredefinedQuestions = await getRemoteClientChatPredefinedQuestions({client_id: clientId})\n if (remotePredefinedQuestions){\n setPredefinedQuestions(remotePredefinedQuestions)\n }\n const remoteChatBubbleConfig = await getRemoteClientChatBubbleConfig({client_id: clientId})\n if (remoteChatBubbleConfig){\n setChatBubbleConfig(remoteChatBubbleConfig)\n }\n },[clientId])\n\n useEffect(()=>{\n void getChatBubbleConfig()\n }, [getChatBubbleConfig])\n \n useEffect(() => {\n if (messageEndRef?.current) { messageEndRef.current.scrollIntoView({ behavior: 'smooth' }) }\n }, [messages])\n\n const toggleChat = () => {\n console.log('This is it', chatIsOpen)\n setChatIsOpen(!chatIsOpen)\n }\n\n const handleUserInput = (e: React.ChangeEvent<HTMLInputElement>) => {\n setUserInput(e.target.value)\n }\n\n async function sendInputInquiry () {\n setIsLoading(true)\n setUserInput('')\n try {\n if (userInput.trim()) {\n // dispatch({ type: appStateEnums.BIBOT, chatIsOpen: true })\n setMessages(messages => [...messages, { sender: 'user', text: userInput }])\n const response = await askBiBot({\n client_id: clientId,\n q: userInput.trim(),\n session_id: state.sessionId,\n chat_id: uuidv4()\n })\n setMessages(messages => [...messages, { sender: 'bot', text: response }])\n }\n } catch (error) {\n void message.error(error?.message ?? 'Failed to get response from server')\n } finally {\n setIsLoading(false)\n }\n }\n\n const handleKeyPress = async (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !isLoading) {\n await sendInputInquiry()\n }\n }\n return {\n chatIsOpen,\n messages,\n isLoading,\n messageEndRef,\n userInput,\n handleUserInput,\n handleKeyPress,\n toggleChat,\n sendInputInquiry,\n chatBubbleConfig,\n showPredefinedQuestions,\n predefinedQuestions,\n handlePredefinedQuestionSelect,\n }\n}\n\nexport { useBiBotChatBot }\n","import { Avatar, Indicator } from '@mantine/core'\nimport { Close, SendRounded } from '@mui/icons-material'\nimport ChatIcon from '@mui/icons-material/Chat'\nimport { Button } from 'antd'\nimport { useBiBotChatBot } from '../hooks'\nimport * as React from 'react'\nimport styles from '../styles.module.css'\n\ninterface bubbleProps {\n clientId: string\n}\n\ninterface PredefinedQuestionsProps {\n onSelect: (question: string) => void\n questions: string[]\n}\n\nconst PredefinedQuestions = ({ questions, onSelect }: PredefinedQuestionsProps) => {\n return (\n <div className={styles['predefined-questions']}>\n {questions.map((question, index) => (\n <div key={index} className={styles['predefined-questions']} onClick={() => onSelect(question)}>\n {question}\n </div>\n ))}\n </div>\n );\n};\n\nconst ChatBubbleBiBot = ({ clientId }: bubbleProps) => {\n const {\n chatIsOpen,\n messages,\n isLoading,\n messageEndRef,\n userInput,\n handleUserInput,\n handleKeyPress,\n sendInputInquiry,\n toggleChat,\n chatBubbleConfig,\n showPredefinedQuestions,\n predefinedQuestions,\n handlePredefinedQuestionSelect,\n } = useBiBotChatBot({clientId})\n\n return (\n \n <div className={`chat-bubble ${chatIsOpen ? 'open' : ''}`} style={{ position: 'fixed', bottom: '20px', right: '20px', zIndex: 9999}}>\n {chatIsOpen && (\n <div className={styles[\"chat-window\"]} style={{ backgroundColor: '#fff', position: 'absolute', bottom: '50px', right: '25px', width: 350, height: 500, borderRadius: 10, display: 'flex', flexDirection: 'column', justifyContent: 'space-between', border: '2px solid #dedede' }}>\n <div className={styles[\"chat-header\"]} style={{ backgroundColor: chatBubbleConfig?.color ?? '#dedede', height: '50px', borderTopLeftRadius: 8, borderTopRightRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'flex-start', paddingInline: 15, paddingBlock: 30 }}>\n <div style={{ alignItems: 'center', display: 'flex', color: '#fff', fontWeight: 'bold' }}>\n <Indicator inline size={12} offset={7} position=\"bottom-end\" color={ 'green' }>\n <Avatar color=\"white\" src={chatBubbleConfig?.logo_url} alt=\"profile\" />\n </Indicator>\n </div>\n <div style={{ display: 'flex', flexDirection: 'column', textAlign: 'left', paddingLeft: '10px', justifyContent: 'flex-start', color: '#fff' }}>\n <span style={{ fontWeight: 'bold' }}>{chatBubbleConfig?.title}</span>\n {}\n {isLoading ? <span style={{ fontSize: '12px', lineHeight: '0.5' }}>Typing...</span> : <span style={{ fontSize: '12px', lineHeight: '0.5' }}>{'Online'}</span>}\n </div>\n </div>\n <div className={styles[\"message-list\"]} style={{ height: 'calc(100% - 100px)', overflowY: 'auto', padding: 10, display: 'flex', flexGrow: 1, flexDirection: 'column'}}>\n {messages.map((message: { sender: 'user' | 'bot', text: string }, index: number) => (\n message.sender === 'user'\n ? <div key={index} className={`message ${message.sender}`} style={{ marginBottom: 10, padding: '5px 10px', borderRadius: 8, maxWidth: '70%', alignSelf: 'flex-end', fontSize: '15px', backgroundColor: '#b8b8b8c6', color:'#000', textAlign: 'left'}}>\n {message.text}\n </div>\n : <div key={index} style={{ display: 'flex' }}>\n <Avatar color=\"white\" src={chatBubbleConfig?.logo_url} size={25} alt=\"profile\" />\n <div className={`message ${message.sender}`} style={{ marginBottom: 10, padding: '5px 10px', borderRadius: 8, maxWidth: '70%', alignSelf: 'flex-start', fontSize: '15px', backgroundColor: '#f0f0f0', color:'#000', textAlign: 'left' }}>\n {message.text}\n </div>\n </div>\n ))}\n {showPredefinedQuestions && predefinedQuestions && predefinedQuestions.length > 0 && (\n <PredefinedQuestions questions={predefinedQuestions} onSelect={handlePredefinedQuestionSelect} />\n )}\n {isLoading && <div style={{marginLeft: '20px'}} className='message'> <div className=\"loader\"></div> </div> }\n <div ref={messageEndRef} />\n </div>\n <div className={styles[\"input-area\"]} style={{ display: 'flex', alignItems: 'center', borderTop: '1px solid #ddd', padding: 10, borderBottomLeftRadius: 8, borderBottomRightRadius: 8}}>\n <input\n style={{ outline: 'none', flexGrow: 1, border: 'none', backgroundColor: 'transparent', padding: '5px 10px', marginRight: 10}}\n autoFocus={true}\n type=\"text\"\n value={userInput}\n onChange={handleUserInput}\n onKeyDown={handleKeyPress}\n placeholder=\"Ask a question\"\n />\n <Button disabled={isLoading ?? true} style={{ backgroundColor: 'transparent', color: isLoading ? '#dedede' : chatBubbleConfig?.color }} size='middle' icon={<SendRounded />} onClick={sendInputInquiry}/>\n </div>\n </div>\n )}\n <Button type='link' onClick={toggleChat} className={styles[\"chat-toggle\"]} style={{ backgroundColor: chatBubbleConfig?.color ?? '#dedede', color: '#fff', borderRadius: '50%', width: '60px', height: '60px', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n {chatIsOpen ? <Close style={{ width: 30, height: 30, color: '#fff' }} /> : <ChatIcon style={{ width: 30, height: 30, color: '#fff' }}/>}\n </Button>\n </div>\n\n )\n}\n\nexport default ChatBubbleBiBot\n","import * as React from 'react'\n\nimport ChatBubbleBiBot from './component/bibot';\nimport { AppProvider } from './context/AppContext';\nimport { MantineProvider } from '@mantine/core'\ninterface Props {\n clientId: string\n}\nexport const BiBot = ({ clientId }: Props) => {\n return (\n <AppProvider>\n <MantineProvider>\n <ChatBubbleBiBot clientId={clientId}/>\n </MantineProvider>\n \n </AppProvider>\n )\n \n}\n"],"names":["baseUrls","inference","endpoints","domain","resources","inferenceBaseURL","createPluginAxiosInstance","params","headers","instance","axios","create","_extends","baseURL","timeout","interceptors","response","use","error","errMsg","data","message","request","Promise","resolve","reject","Error","e","appStateEnums","appReducer","state","action","console","log","type","BIBOT","chatIsOpen","SESSION_KEY","getSessionId","sessionId","localStorage","getItem","newSessionId","uuidv4","setItem","dummyDispatch","defaultContextValue","dispatch","AppContext","createContext","AppProvider","_ref","children","APP_STATE_KEY","initialState","_useReducer","useReducer","useEffect","storedStates","parsedStates","JSON","parse","updatedStates","stringify","React","Provider","value","getRemoteClientChatPredefinedQuestions","path","predefinedQ","pluginAxiosInstance","get","then","predefined_messages","getRemoteClientChatBubbleConfig","chatBubble","bgColor","chatColor","title","userImage","askBiBot","q","post","error1","code","includes","_catch","askTimedOutBiBot","tries","error2","error3","bibot","timedOutLocalQ","useBiBotChatBot","sendInputInquiry","setIsLoading","setUserInput","_finallyRethrows","_temp2","userInput","trim","setMessages","messages","concat","sender","text","client_id","clientId","session_id","chat_id","_error$message","_wasThrown","_result","_useState","useState","predefinedQuestions","setPredefinedQuestions","_useState2","showPredefinedQuestions","setShowPredefinedQuestions","_useContext","useContext","_useState3","setChatIsOpen","_useState4","_useState5","_useState6","isLoading","messageEndRef","useRef","_useState7","chatBubbleConfig","setChatBubbleConfig","handlePredefinedQuestionSelect","question","getChatBubbleConfig","useCallback","remotePredefinedQuestions","remoteChatBubbleConfig","current","scrollIntoView","behavior","toggleChat","handleUserInput","target","handleKeyPress","key","_temp","PredefinedQuestions","questions","onSelect","className","styles","map","index","onClick","ChatBubbleBiBot","_ref2","_useBiBotChatBot","style","position","bottom","right","zIndex","backgroundColor","width","height","borderRadius","display","flexDirection","justifyContent","border","_chatBubbleConfig$col","color","borderTopLeftRadius","borderTopRightRadius","alignItems","paddingInline","paddingBlock","fontWeight","Indicator","inline","size","offset","Avatar","src","logo_url","alt","textAlign","paddingLeft","fontSize","lineHeight","overflowY","padding","flexGrow","marginBottom","maxWidth","alignSelf","length","marginLeft","ref","borderTop","borderBottomLeftRadius","borderBottomRightRadius","outline","marginRight","autoFocus","onChange","onKeyDown","placeholder","Button","disabled","icon","SendRounded","_chatBubbleConfig$col2","Close","ChatIcon","BiBot","MantineProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,QAAQ,GAAG;EACfC,SAAS,EAAE;CACZ;AAEM,IAAMC,SAAS,GAAG;EACvB,IAAID,SAASA;IACX,OAAOD,QAAQ,CAACC,SAAS;;CAEnB;AAEV,IAAYE,MAIX;AAJD,WAAYA,MAAM;EAChBA,sBAAY;EACZA,0BAAgB;EAChBA,kCAAwB;AAC1B,CAAC,EAJWA,MAAM,KAANA,MAAM;AAMlB,IAAYC,SAMX;AAND,WAAYA,SAAS;EACnBA,+CAAkC;EAClCA,0CAA6B;EAC7BA,gCAAmB;EACnBA,0CAA6B;EAC7BA,qBAAQ;AACV,CAAC,EANWA,SAAS,KAATA,SAAS;;ACnBrB,IAAMC,gBAAgB,GAAGH,SAAS,CAACD,SAAS;AAE5C,AAAO,IAAMK,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAIC,MAAM,EAAOC,OAAO;MAApBD,MAAM;IAANA,MAAM,GAAG,EAAE;;EAAA,IAAEC,OAAO;IAAPA,OAAO,GAAG,EAAE;;EACjE,IAAMC,QAAQ,GAAGC,KAAK,CAACC,MAAM,CAAAC,QAAA;IAC3BC,OAAO,EAAER,gBAAgB;IACzBS,OAAO,EAAE,KAAK;IACdN,OAAO,EAAAI,QAAA;MACL,cAAc,EAAE;OACbJ,OAAO;KAETD,MAAM,CACV,CAAC;EAGFE,QAAQ,CAACM,YAAY,CAACC,QAAQ,CAACC,GAAG,CAChC,UAACD,QAAQ;IACP,OAAOA,QAAQ;GAChB,YACME,KAAK;IAAA;MACV,IAAIC,MAAM,GAAG,2BAA2B;MACxC,IAAID,KAAK,CAACF,QAAQ,EAAE;QAClBG,MAAM,GAAGD,KAAK,CAACF,QAAQ,CAACI,IAAI,CAACC,OAAO;OACrC,MAAM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,SAAS;MAAEzC,KAAK,EAAE,MAAM;MAAEN,YAAY,EAAE,KAAK;MAAEF,KAAK,EAAE,MAAM;MAAEC,MAAM,EAAE,MAAM;MAAEE,OAAO,EAAE,MAAM;MAAEQ,UAAU,EAAE,QAAQ;MAAEN,cAAc,EAAE;;KAClQtI,UAAU,GAAG4B,cAACuJ,KAAK;IAACxD,KAAK,EAAE;MAAEM,KAAK,EAAE,EAAE;MAAEC,MAAM,EAAE,EAAE;MAAEO,KAAK,EAAE;;IAAY,GAAG7G,cAACwJ,QAAQ;IAACzD,KAAK,EAAE;MAAEM,KAAK,EAAE,EAAE;MAAEC,MAAM,EAAE,EAAE;MAAEO,KAAK,EAAE;;IAAW,CAChI,CACL;AAGV,CAAC;;IC9FY4C,KAAK,GAAG,SAARA,KAAKA,CAAAtK,IAAA;MAAMwD,QAAQ,GAAAxD,IAAA,CAARwD,QAAQ;EAC9B,OACA3C,cAACd,WAAW,QACVc,cAAC0J,eAAe,QAChB1J,cAAC4F,eAAe;IAACjD,QAAQ,EAAEA;IAAW,CACpB,CAEN;AAGhB,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bibot",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Made with create-react-library",
5
5
  "author": "chrisdjin",
6
6
  "license": "ISC",