@0xbot/chat-react 1.0.9 → 1.0.10
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/AaveLendingPoolABI-CdLq16uB-BGiZ7zvm.mjs +4 -0
- package/dist/AaveLendingPoolAddressesProvider-EOSAznLK-BSWFPv4x.mjs +4 -0
- package/dist/AavePriceOracleABI-C2UEpXR4-C_hStKK4.mjs +4 -0
- package/dist/AaveProtocolDataProviderABI-0JclmmLX-DLxLoyai.mjs +4 -0
- package/dist/BaseDrops-BrQZPqKk-B26CkeNy.mjs +4 -0
- package/dist/D3MM_READ_ABI-B5536S-z-CL3RJ1A8.mjs +4 -0
- package/dist/D3Proxy-CKIzLOhI-CGvfWU5A.mjs +4 -0
- package/dist/DODO1155-DDY5Jxhf-DGclqdqY.mjs +4 -0
- package/dist/DODO721-Kl5REiwU-CjPebx7D.mjs +4 -0
- package/dist/DODOCirculationHelperABI-gu1sCqZ2-DKVM1578.mjs +4 -0
- package/dist/DODORouteProxy-51kl6QgI-DjkLwYNY.mjs +4 -0
- package/dist/DODOV1PmmHelperABI-DQqthyaE-1aS8xEGz.mjs +4 -0
- package/dist/DVM-DjtWbqiJ-BbQRScdF.mjs +4 -0
- package/dist/DropsERC721-7Bckjcar-cRaNDmuo.mjs +4 -0
- package/dist/FilterAdmin-jm_-DS1l-BsNgsP2z.mjs +4 -0
- package/dist/FilterERC1155V1-VIUlIHdF-KqUEDK8Y.mjs +4 -0
- package/dist/FilterERC721V1-CWDEPGmH-BeOtdHta.mjs +4 -0
- package/dist/Fragment-Bd_AXeVx-C-ytfCBz.mjs +4 -0
- package/dist/FundingABI-WqQDGVVa-CaLckA9D.mjs +4 -0
- package/dist/IdodoV2-DlW8pwaE-1tII4uF5.mjs +4 -0
- package/dist/LockedTokenVaultABI-CfBj0wEX-CB4fg14z.mjs +4 -0
- package/dist/MarginTrading-CQ5odvHB-hsA_0CMf.mjs +4 -0
- package/dist/MarginTradingFactory-2RKqvCSO-DgmL1WxL.mjs +4 -0
- package/dist/MerkleDistributorABI-Ctn26fnA-BbXWPnph.mjs +4 -0
- package/dist/NonfungiblePositionManager-c8Yw_9-Q-DoGzZtUT.mjs +4 -0
- package/dist/PancakePairABI-Cc9LuXnX-CSfuOSUk.mjs +4 -0
- package/dist/UniswapV3Pool-Da11VKXE-Bpirv2VX.mjs +4 -0
- package/dist/add-CHJpf5Lw.mjs +19 -0
- package/dist/all-wallets-D2hkkUJ3.mjs +10 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/app-store-CqLKqQ5V.mjs +21 -0
- package/dist/apple-B0XeUiD1.mjs +22 -0
- package/dist/arrow-bottom-aeJVAvnL.mjs +12 -0
- package/dist/arrow-bottom-circle-R6EgzTHW.mjs +15 -0
- package/dist/arrow-left-BqQ4buTv.mjs +12 -0
- package/dist/arrow-right-C6Ed0Mzu.mjs +12 -0
- package/dist/arrow-top-BidIjQzK.mjs +12 -0
- package/dist/bank-yI5ZTpcM.mjs +18 -0
- package/dist/baseFilterV1-BPjWXMKw-Hn2CtZK1.mjs +4 -0
- package/dist/basic-Ck_Otdyv.mjs +5718 -0
- package/dist/browser-DfN9W7W3.mjs +18 -0
- package/dist/bsc-3D5wcqPq-Crqli4pE.mjs +4 -0
- package/dist/card-DNVrOepi.mjs +18 -0
- package/dist/chat-library.es.js +4 -826
- package/dist/chat-library.umd.js +7758 -11
- package/dist/checkmark-Y_JAaFYi.mjs +15 -0
- package/dist/checkmark-bold-BaUBCwEZ.mjs +12 -0
- package/dist/chevron-bottom-DT-gLTLE.mjs +12 -0
- package/dist/chevron-left-Db6JDZK5.mjs +12 -0
- package/dist/chevron-right-CcBMjaBn.mjs +12 -0
- package/dist/chevron-top-RvW8f4V7.mjs +12 -0
- package/dist/chrome-store-DnpyKbMo.mjs +65 -0
- package/dist/classicalPoolABI-D5LxySAJ-D7PleszW.mjs +4 -0
- package/dist/clock-Bz19eiZx.mjs +12 -0
- package/dist/close-Pad_fUXU.mjs +12 -0
- package/dist/coinPlaceholder-B7RKkvE0.mjs +12 -0
- package/dist/compass-Dw45tdte.mjs +12 -0
- package/dist/components/DodoSwap.d.ts +14 -0
- package/dist/copy-CwnxEVdO.mjs +19 -0
- package/dist/core-BncCIRvy.mjs +16730 -0
- package/dist/cursor-C6uOuAov.mjs +7 -0
- package/dist/cursor-transparent-xIFYE_0X.mjs +16 -0
- package/dist/desktop-Dz5Hje94.mjs +13 -0
- package/dist/disconnect-CTdx5PqO.mjs +12 -0
- package/dist/discord-C-gRbozI.mjs +21 -0
- package/dist/dodoABI-CLkEBJ8P-Bu3dOG4h.mjs +4 -0
- package/dist/dodoBuyoutModel-BtQv3C3q-BdkKV4YI.mjs +4 -0
- package/dist/dodoCP-N8KA8JwJ-TdVQ5mZP.mjs +4 -0
- package/dist/dodoCPABI-CdAN0KhU-COvDVH7-.mjs +4 -0
- package/dist/dodoCPABIV2-yzF6FlEg-nSP7QBK6.mjs +4 -0
- package/dist/dodoCPFactory-CD0SxXT6-C-NYcE0L.mjs +4 -0
- package/dist/dodoCpProxy-D2AI9-4r-CNpIMaS9.mjs +4 -0
- package/dist/dodoCpProxyV2-CGZRqk2H-CFqfOsrA.mjs +4 -0
- package/dist/dodoCpProxyV202-CoZaEf_6-D3tcGKYm.mjs +4 -0
- package/dist/dodoCustomMintableERC20-CPpNoX1v-CheGl3pc.mjs +4 -0
- package/dist/dodoDPPAdmin-B-fmpTbV-DDnM12B9.mjs +4 -0
- package/dist/dodoDPPFactory-DwAkVskt-BlCcT0Y7.mjs +4 -0
- package/dist/dodoDSP-B6KYm-Cn-BlRNrfLD.mjs +4 -0
- package/dist/dodoDSPFactory-j1eg7Ez--DBzB5BJy.mjs +4 -0
- package/dist/dodoDVM-DDYx1JAy-Dvy00nJq.mjs +4 -0
- package/dist/dodoDVMFactory-FpnJdZb2-pnHsrTp3.mjs +4 -0
- package/dist/dodoDppProxy-A7PPYsqp-D06i9e-K.mjs +4 -0
- package/dist/dodoDropsProxy-vHUWsRNO-QPtLS8Fb.mjs +4 -0
- package/dist/dodoDspProxy-CU7OAvJG-jDB-e7lT.mjs +4 -0
- package/dist/dodoERC20V3Factory-Cz4XKDrU-BczFXEyV.mjs +4 -0
- package/dist/dodoEthProxyABI-CoX95QJI-ClpiGz9q.mjs +4 -0
- package/dist/dodoFeeImpl-zR9Qv4Tq-DEWk3Y40.mjs +4 -0
- package/dist/dodoFragment-4lxmE2XJ-CyrfbNi9.mjs +4 -0
- package/dist/dodoMineV3Proxy-xOGM7Jnv-DB_whEuY.mjs +4 -0
- package/dist/dodoMineV3ProxyOld-BqsZxJRU-D2D73qEi.mjs +4 -0
- package/dist/dodoMiningABI-9J5C_6kN-Dd9oBdgN.mjs +4 -0
- package/dist/dodoMiningReaderABI-DmUXA9Gv-5oVswgl3.mjs +4 -0
- package/dist/dodoNftERC1155-Bw6ID2NE-B6ec1_gD.mjs +4 -0
- package/dist/dodoNftERC721-CI1l0ip9-4w4aINlO.mjs +4 -0
- package/dist/dodoNftPoolProxy-DQkcZHUV-QkmZ2nMD.mjs +4 -0
- package/dist/dodoNftProxy-Di-aoLYM-DxMxz-31.mjs +4 -0
- package/dist/dodoNftVault-B4NZaXcd-CnVQXRy8.mjs +4 -0
- package/dist/dodoOracleABI-BxwZofBV-CMjdc9D8.mjs +4 -0
- package/dist/dodoPair-VN1aEVFz-yv3rmA46.mjs +4 -0
- package/dist/dodoPreminingABI-DU7ocR7L-DbnrMY8U.mjs +4 -0
- package/dist/dodoProxyV2-9ED9HqK5-D1IbsmqR.mjs +4 -0
- package/dist/dodoStarterProxy-B1TdMOvw-Dc_OorIU.mjs +4 -0
- package/dist/dodoTokenABI-Dd2DVUbK-H42B3M0V.mjs +4 -0
- package/dist/dodoUpCPFactoryABI-C1W0Q4Ft-BoaZdses.mjs +4 -0
- package/dist/dodoUpCpFactory-D8ifQyp--qgHD5MAq.mjs +4 -0
- package/dist/dodoV1PairProxy-DyRTqyPe-C8yy7JSs.mjs +4 -0
- package/dist/dodoZooABI-D9Uc4iLK-KrPSOwCN.mjs +4 -0
- package/dist/dppPoolABI-BvoeLJgK-CDxK1JW7.mjs +4 -0
- package/dist/erc20ABI-v08X4jmE-CVM8vD3s.mjs +4 -0
- package/dist/erc20Helper-CG659oLz-CFUQnmR-.mjs +4 -0
- package/dist/eth-B9cviUl5-CG8RPzNA.mjs +4 -0
- package/dist/etherscan-BoxwTKtb.mjs +10 -0
- package/dist/exclamation-triangle-lJzIh3b3.mjs +8 -0
- package/dist/extension-Cu9Cmk3m.mjs +12 -0
- package/dist/external-link-BvvHuuY0.mjs +12 -0
- package/dist/facebook-By3QHn59.mjs +30 -0
- package/dist/farcaster-B6Uk0IIz.mjs +16 -0
- package/dist/feeABI-DnQdJUpQ-DesVgwnT.mjs +4 -0
- package/dist/filters-7iolnXNp.mjs +12 -0
- package/dist/github-CbNFQ-rE.mjs +22 -0
- package/dist/google-B4kpRWe2.mjs +22 -0
- package/dist/help-circle-BHYOhZH-.mjs +16 -0
- package/dist/helper-DvTqUYSd-DjCOVcV8.mjs +22500 -0
- package/dist/id-B63SRnJH.mjs +16 -0
- package/dist/image-BFYG_I7p.mjs +8 -0
- package/dist/index-Cm7qS4de-ByNXzPPy.mjs +188 -0
- package/dist/index-Csyx760V.mjs +1037 -0
- package/dist/index-DId52aLZ.mjs +102718 -0
- package/dist/index-KEmmG3yM-D6PVhm18.mjs +390 -0
- package/dist/index.css +1 -1
- package/dist/info-MhMaxvuu.mjs +7 -0
- package/dist/info-circle-Br6R310O.mjs +16 -0
- package/dist/lightbulb-CvIgiu_8.mjs +7 -0
- package/dist/mail-C37s8I6x.mjs +12 -0
- package/dist/mobile-6yKClGQT.mjs +13 -0
- package/dist/more-CoCXkplN.mjs +15 -0
- package/dist/multicallABI-D9E1EeQD-BHmsV5Ww.mjs +4 -0
- package/dist/network-placeholder-RiVpBWSW.mjs +18 -0
- package/dist/nftContract-d4b6ObxG-DDocz_o1.mjs +4 -0
- package/dist/nftFilterAdmin-DMr_jrK_-CzdnxC1u.mjs +4 -0
- package/dist/nftPlaceholder-BqPW-YRA.mjs +12 -0
- package/dist/off-BYd8177g.mjs +12 -0
- package/dist/oneBitSettlement-DMzQ-0t_-6O4CfYZH.mjs +4 -0
- package/dist/play-store-DOI54pIO.mjs +36 -0
- package/dist/plus-D3V6i3OL.mjs +17 -0
- package/dist/qr-code-BMbd5nBQ.mjs +10 -0
- package/dist/react-datetime.cjs-BazkzJ-h.mjs +3535 -0
- package/dist/recycle-horizontal-Rf_bshe8.mjs +13 -0
- package/dist/refresh-D188VUaC.mjs +12 -0
- package/dist/reown-logo-BlqEBF0T.mjs +16 -0
- package/dist/search-BwlhXkfV.mjs +12 -0
- package/dist/secp256k1-B3zICmiT.mjs +1469 -0
- package/dist/secp256k1-DgHq90iL.mjs +1510 -0
- package/dist/send-gHEIp_-C.mjs +19 -0
- package/dist/setApprovalForAll-BvnCORJI-BsLcI446.mjs +4 -0
- package/dist/spaceIdABI-BS4XGAT1-BjuJy2_U.mjs +4 -0
- package/dist/spaceIdResolverABI-sYDT8GfP-D5rMp5Lb.mjs +4 -0
- package/dist/swapHorizontal-CSBQUUlD.mjs +12 -0
- package/dist/swapHorizontalBold-BJqpmrQd.mjs +12 -0
- package/dist/swapHorizontalMedium-R5UjzDTB.mjs +20 -0
- package/dist/swapHorizontalRoundedBold-Dajt5M8H.mjs +12 -0
- package/dist/swapVertical-C00VFvcQ.mjs +12 -0
- package/dist/telegram-BjMNjPGO.mjs +20 -0
- package/dist/three-dots-CzB3opP1.mjs +9 -0
- package/dist/twitch-BJyvHwSX.mjs +22 -0
- package/dist/twitterIcon-C13sV4pO.mjs +10 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/request.d.ts +1 -0
- package/dist/utils/version.d.ts +13 -0
- package/dist/v3MiningABI-ZjGBkolS-DpOFVbMt.mjs +4 -0
- package/dist/vdodo-ttc2RVOs-BsdVbO8I.mjs +4 -0
- package/dist/vdodoTokenABI-PldrbOSo-CmQmhg5z.mjs +4 -0
- package/dist/verify-CZf1Key9.mjs +12 -0
- package/dist/verify-filled-TxR2AkrB.mjs +12 -0
- package/dist/w3m-modal-CtlM8yh_.mjs +1471 -0
- package/dist/wallet-placeholder-BZj9RGcX.mjs +18 -0
- package/dist/wallet-w_3wvddk.mjs +12 -0
- package/dist/walletconnect-Dst7WudJ.mjs +36 -0
- package/dist/warning-circle-BAvO6TFh.mjs +16 -0
- package/dist/weth-Dz5DGEIF-y7HuL7DE.mjs +4 -0
- package/dist/x-Ch4skAxW.mjs +16 -0
- package/package.json +2 -1
package/dist/chat-library.es.js
CHANGED
|
@@ -1,828 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Be from "markdown-it";
|
|
3
|
-
import te from "highlight.js";
|
|
4
|
-
import ee from "localforage";
|
|
5
|
-
import qe from "axios";
|
|
6
|
-
import Te from "@fingerprintjs/fingerprintjs";
|
|
7
|
-
var de = { exports: {} }, z = {};
|
|
8
|
-
/** @license React v16.14.0
|
|
9
|
-
* react-jsx-runtime.production.min.js
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
12
|
-
*
|
|
13
|
-
* This source code is licensed under the MIT license found in the
|
|
14
|
-
* LICENSE file in the root directory of this source tree.
|
|
15
|
-
*/
|
|
16
|
-
var xe;
|
|
17
|
-
function Fe() {
|
|
18
|
-
if (xe) return z;
|
|
19
|
-
xe = 1;
|
|
20
|
-
var n = Ce, s = 60103;
|
|
21
|
-
if (z.Fragment = 60107, typeof Symbol == "function" && Symbol.for) {
|
|
22
|
-
var h = Symbol.for;
|
|
23
|
-
s = h("react.element"), z.Fragment = h("react.fragment");
|
|
24
|
-
}
|
|
25
|
-
var v = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = Object.prototype.hasOwnProperty, x = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
26
|
-
function T(w, _, l) {
|
|
27
|
-
var c, g = {}, b = null, P = null;
|
|
28
|
-
l !== void 0 && (b = "" + l), _.key !== void 0 && (b = "" + _.key), _.ref !== void 0 && (P = _.ref);
|
|
29
|
-
for (c in _) y.call(_, c) && !x.hasOwnProperty(c) && (g[c] = _[c]);
|
|
30
|
-
if (w && w.defaultProps) for (c in _ = w.defaultProps, _) g[c] === void 0 && (g[c] = _[c]);
|
|
31
|
-
return { $$typeof: s, type: w, key: b, ref: P, props: g, _owner: v.current };
|
|
32
|
-
}
|
|
33
|
-
return z.jsx = T, z.jsxs = T, z;
|
|
34
|
-
}
|
|
35
|
-
var fe = {};
|
|
36
|
-
/** @license React v16.14.0
|
|
37
|
-
* react-jsx-runtime.development.js
|
|
38
|
-
*
|
|
39
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the MIT license found in the
|
|
42
|
-
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/
|
|
44
|
-
var we;
|
|
45
|
-
function He() {
|
|
46
|
-
return we || (we = 1, function(n) {
|
|
47
|
-
process.env.NODE_ENV !== "production" && function() {
|
|
48
|
-
var s = Ce, h = 60103, v = 60106;
|
|
49
|
-
n.Fragment = 60107;
|
|
50
|
-
var y = 60108, x = 60114, T = 60109, w = 60110, _ = 60112, l = 60113, c = 60120, g = 60115, b = 60116, P = 60121, k = 60122, I = 60117, Y = 60129, S = 60131;
|
|
51
|
-
if (typeof Symbol == "function" && Symbol.for) {
|
|
52
|
-
var f = Symbol.for;
|
|
53
|
-
h = f("react.element"), v = f("react.portal"), n.Fragment = f("react.fragment"), y = f("react.strict_mode"), x = f("react.profiler"), T = f("react.provider"), w = f("react.context"), _ = f("react.forward_ref"), l = f("react.suspense"), c = f("react.suspense_list"), g = f("react.memo"), b = f("react.lazy"), P = f("react.block"), k = f("react.server.block"), I = f("react.fundamental"), f("react.scope"), f("react.opaque.id"), Y = f("react.debug_trace_mode"), f("react.offscreen"), S = f("react.legacy_hidden");
|
|
54
|
-
}
|
|
55
|
-
var V = typeof Symbol == "function" && Symbol.iterator, W = "@@iterator";
|
|
56
|
-
function L(e) {
|
|
57
|
-
if (e === null || typeof e != "object")
|
|
58
|
-
return null;
|
|
59
|
-
var t = V && e[V] || e[W];
|
|
60
|
-
return typeof t == "function" ? t : null;
|
|
61
|
-
}
|
|
62
|
-
var $ = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
63
|
-
function O(e) {
|
|
64
|
-
{
|
|
65
|
-
for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++)
|
|
66
|
-
r[o - 1] = arguments[o];
|
|
67
|
-
A("error", e, r);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function A(e, t, r) {
|
|
71
|
-
{
|
|
72
|
-
var o = $.ReactDebugCurrentFrame, R = "";
|
|
73
|
-
if (d) {
|
|
74
|
-
var E = a(d.type), u = d._owner;
|
|
75
|
-
R += ae(E, d._source, u && a(u.type));
|
|
76
|
-
}
|
|
77
|
-
R += o.getStackAddendum(), R !== "" && (t += "%s", r = r.concat([R]));
|
|
78
|
-
var i = r.map(function(j) {
|
|
79
|
-
return "" + j;
|
|
80
|
-
});
|
|
81
|
-
i.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, i);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
var U = !1;
|
|
85
|
-
function F(e) {
|
|
86
|
-
return !!(typeof e == "string" || typeof e == "function" || e === n.Fragment || e === x || e === Y || e === y || e === l || e === c || e === S || U || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === g || e.$$typeof === T || e.$$typeof === w || e.$$typeof === _ || e.$$typeof === I || e.$$typeof === P || e[0] === k));
|
|
87
|
-
}
|
|
88
|
-
var q = /^(.*)[\\\/]/;
|
|
89
|
-
function ae(e, t, r) {
|
|
90
|
-
var o = "";
|
|
91
|
-
if (t) {
|
|
92
|
-
var R = t.fileName, E = R.replace(q, "");
|
|
93
|
-
if (/^index\./.test(E)) {
|
|
94
|
-
var u = R.match(q);
|
|
95
|
-
if (u) {
|
|
96
|
-
var i = u[1];
|
|
97
|
-
if (i) {
|
|
98
|
-
var j = i.replace(q, "");
|
|
99
|
-
E = j + "/" + E;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
o = " (at " + E + ":" + t.lineNumber + ")";
|
|
104
|
-
} else r && (o = " (created by " + r + ")");
|
|
105
|
-
return `
|
|
106
|
-
in ` + (e || "Unknown") + o;
|
|
107
|
-
}
|
|
108
|
-
var se = 1;
|
|
109
|
-
function Q(e) {
|
|
110
|
-
return e._status === se ? e._result : null;
|
|
111
|
-
}
|
|
112
|
-
function oe(e, t, r) {
|
|
113
|
-
var o = t.displayName || t.name || "";
|
|
114
|
-
return e.displayName || (o !== "" ? r + "(" + o + ")" : r);
|
|
115
|
-
}
|
|
116
|
-
function a(e) {
|
|
117
|
-
if (e == null)
|
|
118
|
-
return null;
|
|
119
|
-
if (typeof e.tag == "number" && O("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
120
|
-
return e.displayName || e.name || null;
|
|
121
|
-
if (typeof e == "string")
|
|
122
|
-
return e;
|
|
123
|
-
switch (e) {
|
|
124
|
-
case n.Fragment:
|
|
125
|
-
return "Fragment";
|
|
126
|
-
case v:
|
|
127
|
-
return "Portal";
|
|
128
|
-
case x:
|
|
129
|
-
return "Profiler";
|
|
130
|
-
case y:
|
|
131
|
-
return "StrictMode";
|
|
132
|
-
case l:
|
|
133
|
-
return "Suspense";
|
|
134
|
-
case c:
|
|
135
|
-
return "SuspenseList";
|
|
136
|
-
}
|
|
137
|
-
if (typeof e == "object")
|
|
138
|
-
switch (e.$$typeof) {
|
|
139
|
-
case w:
|
|
140
|
-
return "Context.Consumer";
|
|
141
|
-
case T:
|
|
142
|
-
return "Context.Provider";
|
|
143
|
-
case _:
|
|
144
|
-
return oe(e, e.render, "ForwardRef");
|
|
145
|
-
case g:
|
|
146
|
-
return a(e.type);
|
|
147
|
-
case P:
|
|
148
|
-
return a(e.render);
|
|
149
|
-
case b: {
|
|
150
|
-
var t = e, r = Q(t);
|
|
151
|
-
if (r)
|
|
152
|
-
return a(r);
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
158
|
-
var p = {};
|
|
159
|
-
$.ReactDebugCurrentFrame;
|
|
160
|
-
var d = null;
|
|
161
|
-
function m(e) {
|
|
162
|
-
d = e;
|
|
163
|
-
}
|
|
164
|
-
function N(e, t, r, o, R) {
|
|
165
|
-
{
|
|
166
|
-
var E = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
167
|
-
for (var u in e)
|
|
168
|
-
if (E(e, u)) {
|
|
169
|
-
var i = void 0;
|
|
170
|
-
try {
|
|
171
|
-
if (typeof e[u] != "function") {
|
|
172
|
-
var j = Error((o || "React class") + ": " + r + " type `" + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[u] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
173
|
-
throw j.name = "Invariant Violation", j;
|
|
174
|
-
}
|
|
175
|
-
i = e[u](t, u, o, r, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
176
|
-
} catch (D) {
|
|
177
|
-
i = D;
|
|
178
|
-
}
|
|
179
|
-
i && !(i instanceof Error) && (m(R), O("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", r, u, typeof i), m(null)), i instanceof Error && !(i.message in p) && (p[i.message] = !0, m(R), O("Failed %s type: %s", r, i.message), m(null));
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
var H = $.ReactCurrentOwner, Z = Object.prototype.hasOwnProperty, X = {
|
|
184
|
-
key: !0,
|
|
185
|
-
ref: !0,
|
|
186
|
-
__self: !0,
|
|
187
|
-
__source: !0
|
|
188
|
-
}, ge, pe;
|
|
189
|
-
function Se(e) {
|
|
190
|
-
if (Z.call(e, "ref")) {
|
|
191
|
-
var t = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
192
|
-
if (t && t.isReactWarning)
|
|
193
|
-
return !1;
|
|
194
|
-
}
|
|
195
|
-
return e.ref !== void 0;
|
|
196
|
-
}
|
|
197
|
-
function je(e) {
|
|
198
|
-
if (Z.call(e, "key")) {
|
|
199
|
-
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
200
|
-
if (t && t.isReactWarning)
|
|
201
|
-
return !1;
|
|
202
|
-
}
|
|
203
|
-
return e.key !== void 0;
|
|
204
|
-
}
|
|
205
|
-
function Pe(e, t) {
|
|
206
|
-
typeof e.ref == "string" && H.current;
|
|
207
|
-
}
|
|
208
|
-
function ke(e, t) {
|
|
209
|
-
{
|
|
210
|
-
var r = function() {
|
|
211
|
-
ge || (ge = !0, O("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
212
|
-
};
|
|
213
|
-
r.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
214
|
-
get: r,
|
|
215
|
-
configurable: !0
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
function Ae(e, t) {
|
|
220
|
-
{
|
|
221
|
-
var r = function() {
|
|
222
|
-
pe || (pe = !0, O("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
223
|
-
};
|
|
224
|
-
r.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
225
|
-
get: r,
|
|
226
|
-
configurable: !0
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
var Ie = function(e, t, r, o, R, E, u) {
|
|
231
|
-
var i = {
|
|
232
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
233
|
-
$$typeof: h,
|
|
234
|
-
// Built-in properties that belong on the element
|
|
235
|
-
type: e,
|
|
236
|
-
key: t,
|
|
237
|
-
ref: r,
|
|
238
|
-
props: u,
|
|
239
|
-
// Record the component responsible for creating this element.
|
|
240
|
-
_owner: E
|
|
241
|
-
};
|
|
242
|
-
return i._store = {}, Object.defineProperty(i._store, "validated", {
|
|
243
|
-
configurable: !1,
|
|
244
|
-
enumerable: !1,
|
|
245
|
-
writable: !0,
|
|
246
|
-
value: !1
|
|
247
|
-
}), Object.defineProperty(i, "_self", {
|
|
248
|
-
configurable: !1,
|
|
249
|
-
enumerable: !1,
|
|
250
|
-
writable: !1,
|
|
251
|
-
value: o
|
|
252
|
-
}), Object.defineProperty(i, "_source", {
|
|
253
|
-
configurable: !1,
|
|
254
|
-
enumerable: !1,
|
|
255
|
-
writable: !1,
|
|
256
|
-
value: R
|
|
257
|
-
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
|
|
258
|
-
};
|
|
259
|
-
function Le(e, t, r, o, R) {
|
|
260
|
-
{
|
|
261
|
-
var E, u = {}, i = null, j = null;
|
|
262
|
-
r !== void 0 && (i = "" + r), je(t) && (i = "" + t.key), Se(t) && (j = t.ref, Pe(t, R));
|
|
263
|
-
for (E in t)
|
|
264
|
-
Z.call(t, E) && !X.hasOwnProperty(E) && (u[E] = t[E]);
|
|
265
|
-
if (e && e.defaultProps) {
|
|
266
|
-
var D = e.defaultProps;
|
|
267
|
-
for (E in D)
|
|
268
|
-
u[E] === void 0 && (u[E] = D[E]);
|
|
269
|
-
}
|
|
270
|
-
if (i || j) {
|
|
271
|
-
var B = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
272
|
-
i && ke(u, B), j && Ae(u, B);
|
|
273
|
-
}
|
|
274
|
-
return Ie(e, i, j, R, o, H.current, u);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
var ie = $.ReactCurrentOwner;
|
|
278
|
-
$.ReactDebugCurrentFrame;
|
|
279
|
-
function J(e) {
|
|
280
|
-
d = e;
|
|
281
|
-
}
|
|
282
|
-
var ce;
|
|
283
|
-
ce = !1;
|
|
284
|
-
function le(e) {
|
|
285
|
-
return typeof e == "object" && e !== null && e.$$typeof === h;
|
|
286
|
-
}
|
|
287
|
-
function he() {
|
|
288
|
-
{
|
|
289
|
-
if (ie.current) {
|
|
290
|
-
var e = a(ie.current.type);
|
|
291
|
-
if (e)
|
|
292
|
-
return `
|
|
293
|
-
|
|
294
|
-
Check the render method of \`` + e + "`.";
|
|
295
|
-
}
|
|
296
|
-
return "";
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
function De(e) {
|
|
300
|
-
return "";
|
|
301
|
-
}
|
|
302
|
-
var _e = {};
|
|
303
|
-
function Me(e) {
|
|
304
|
-
{
|
|
305
|
-
var t = he();
|
|
306
|
-
if (!t) {
|
|
307
|
-
var r = typeof e == "string" ? e : e.displayName || e.name;
|
|
308
|
-
r && (t = `
|
|
309
|
-
|
|
310
|
-
Check the top-level render call using <` + r + ">.");
|
|
311
|
-
}
|
|
312
|
-
return t;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
function me(e, t) {
|
|
316
|
-
{
|
|
317
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
318
|
-
return;
|
|
319
|
-
e._store.validated = !0;
|
|
320
|
-
var r = Me(t);
|
|
321
|
-
if (_e[r])
|
|
322
|
-
return;
|
|
323
|
-
_e[r] = !0;
|
|
324
|
-
var o = "";
|
|
325
|
-
e && e._owner && e._owner !== ie.current && (o = " It was passed a child from " + a(e._owner.type) + "."), J(e), O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', r, o), J(null);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
function Ee(e, t) {
|
|
329
|
-
{
|
|
330
|
-
if (typeof e != "object")
|
|
331
|
-
return;
|
|
332
|
-
if (Array.isArray(e))
|
|
333
|
-
for (var r = 0; r < e.length; r++) {
|
|
334
|
-
var o = e[r];
|
|
335
|
-
le(o) && me(o, t);
|
|
336
|
-
}
|
|
337
|
-
else if (le(e))
|
|
338
|
-
e._store && (e._store.validated = !0);
|
|
339
|
-
else if (e) {
|
|
340
|
-
var R = L(e);
|
|
341
|
-
if (typeof R == "function" && R !== e.entries)
|
|
342
|
-
for (var E = R.call(e), u; !(u = E.next()).done; )
|
|
343
|
-
le(u.value) && me(u.value, t);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
function $e(e) {
|
|
348
|
-
{
|
|
349
|
-
var t = e.type;
|
|
350
|
-
if (t == null || typeof t == "string")
|
|
351
|
-
return;
|
|
352
|
-
var r;
|
|
353
|
-
if (typeof t == "function")
|
|
354
|
-
r = t.propTypes;
|
|
355
|
-
else if (typeof t == "object" && (t.$$typeof === _ || // Note: Memo only checks outer props here.
|
|
356
|
-
// Inner props are checked in the reconciler.
|
|
357
|
-
t.$$typeof === g))
|
|
358
|
-
r = t.propTypes;
|
|
359
|
-
else
|
|
360
|
-
return;
|
|
361
|
-
if (r) {
|
|
362
|
-
var o = a(t);
|
|
363
|
-
N(r, e.props, "prop", o, e);
|
|
364
|
-
} else if (t.PropTypes !== void 0 && !ce) {
|
|
365
|
-
ce = !0;
|
|
366
|
-
var R = a(t);
|
|
367
|
-
O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", R || "Unknown");
|
|
368
|
-
}
|
|
369
|
-
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
function Ne(e) {
|
|
373
|
-
{
|
|
374
|
-
for (var t = Object.keys(e.props), r = 0; r < t.length; r++) {
|
|
375
|
-
var o = t[r];
|
|
376
|
-
if (o !== "children" && o !== "key") {
|
|
377
|
-
J(e), O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), J(null);
|
|
378
|
-
break;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
e.ref !== null && (J(e), O("Invalid attribute `ref` supplied to `React.Fragment`."), J(null));
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
function Re(e, t, r, o, R, E) {
|
|
385
|
-
{
|
|
386
|
-
var u = F(e);
|
|
387
|
-
if (!u) {
|
|
388
|
-
var i = "";
|
|
389
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
390
|
-
var j = De();
|
|
391
|
-
j ? i += j : i += he();
|
|
392
|
-
var D;
|
|
393
|
-
e === null ? D = "null" : Array.isArray(e) ? D = "array" : e !== void 0 && e.$$typeof === h ? (D = "<" + (a(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : D = typeof e, O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, i);
|
|
394
|
-
}
|
|
395
|
-
var B = Le(e, t, r, R, E);
|
|
396
|
-
if (B == null)
|
|
397
|
-
return B;
|
|
398
|
-
if (u) {
|
|
399
|
-
var K = t.children;
|
|
400
|
-
if (K !== void 0)
|
|
401
|
-
if (o)
|
|
402
|
-
if (Array.isArray(K)) {
|
|
403
|
-
for (var ue = 0; ue < K.length; ue++)
|
|
404
|
-
Ee(K[ue], e);
|
|
405
|
-
Object.freeze && Object.freeze(K);
|
|
406
|
-
} else
|
|
407
|
-
O("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
408
|
-
else
|
|
409
|
-
Ee(K, e);
|
|
410
|
-
}
|
|
411
|
-
return e === n.Fragment ? Ne(B) : $e(B), B;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
function Ye(e, t, r) {
|
|
415
|
-
return Re(e, t, r, !0);
|
|
416
|
-
}
|
|
417
|
-
function Ve(e, t, r) {
|
|
418
|
-
return Re(e, t, r, !1);
|
|
419
|
-
}
|
|
420
|
-
var We = Ve, Ue = Ye;
|
|
421
|
-
n.jsx = We, n.jsxs = Ue;
|
|
422
|
-
}();
|
|
423
|
-
}(fe)), fe;
|
|
424
|
-
}
|
|
425
|
-
process.env.NODE_ENV === "production" ? de.exports = Fe() : de.exports = He();
|
|
426
|
-
var C = de.exports;
|
|
427
|
-
const be = ({
|
|
428
|
-
self: n,
|
|
429
|
-
UserAvatar: s,
|
|
430
|
-
AgentAvatar: h,
|
|
431
|
-
loading: v,
|
|
432
|
-
loadingText: y,
|
|
433
|
-
emptyText: x,
|
|
434
|
-
content: T,
|
|
435
|
-
children: w
|
|
436
|
-
}) => /* @__PURE__ */ C.jsxs("div", { className: `message-container message-spacing-small message-spacing-medium ${n ? "message-align-right" : "message-align-left"}`, children: [
|
|
437
|
-
!n && /* @__PURE__ */ C.jsx("img", { src: h, className: "chat-avatar", alt: "Agent Avatar" }),
|
|
438
|
-
/* @__PURE__ */ C.jsxs("div", { className: `message-bubble ${n ? "chat-message" : ""}`, children: [
|
|
439
|
-
!T && !v && /* @__PURE__ */ C.jsx("div", { className: "message-empty", children: x }),
|
|
440
|
-
w,
|
|
441
|
-
v && /* @__PURE__ */ C.jsx("div", { className: "message-loading", children: y })
|
|
442
|
-
] }),
|
|
443
|
-
n && /* @__PURE__ */ C.jsx("img", { src: s, className: "chat-avatar", alt: "User Avatar" })
|
|
444
|
-
] }), Je = (n) => {
|
|
445
|
-
n.renderer.rules.fence = (s, h) => {
|
|
446
|
-
const v = s[h], y = v.info ? v.info.trim() : "";
|
|
447
|
-
let x = "";
|
|
448
|
-
if (y && te.getLanguage(y))
|
|
449
|
-
try {
|
|
450
|
-
x = te.highlight(v.content, { language: y }).value;
|
|
451
|
-
} catch {
|
|
452
|
-
x = n.utils.escapeHtml(v.content);
|
|
453
|
-
}
|
|
454
|
-
else
|
|
455
|
-
x = n.utils.escapeHtml(v.content);
|
|
456
|
-
return `
|
|
457
|
-
<div class="code-block-element">
|
|
458
|
-
<div class="code-area">
|
|
459
|
-
<div class="header">
|
|
460
|
-
<div class="text">
|
|
461
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
|
462
|
-
<path fill="#fff" fill-opacity="0.55" fill-rule="evenodd" d="M7 9v6H5.2V9H7Zm0-1v8H5c-.552 0-1-.299-1-.667V8.667C4 8.298 4.448 8 5 8h2Z" clip-rule="evenodd"/>
|
|
463
|
-
<path stroke="#fff" stroke-linejoin="bevel" stroke-opacity="0.55" d="m8.5 10 3 2-3 2M15.5 15h-4"/>
|
|
464
|
-
<path fill="#fff" fill-opacity="0.55" fill-rule="evenodd" d="M17 9v6h1.8V9H17Zm0-1v8h2c.552 0 1-.299 1-.667V8.667C20 8.298 19.552 8 19 8h-2Z" clip-rule="evenodd"/>
|
|
465
|
-
</svg>
|
|
466
|
-
<span class="code-area-language">${y}</span>
|
|
467
|
-
</div>
|
|
468
|
-
<div class="copy">
|
|
469
|
-
<button class="copy-btn" onclick="copyCodeToClipboard(this)">Copy</button>
|
|
470
|
-
</div>
|
|
471
|
-
</div>
|
|
472
|
-
<div class="content">
|
|
473
|
-
<pre><code class="hljs language-${n.utils.escapeHtml(y)}">${x}</code></pre>
|
|
474
|
-
</div>
|
|
475
|
-
</div>
|
|
476
|
-
</div>
|
|
477
|
-
`;
|
|
478
|
-
};
|
|
479
|
-
}, Ke = new Be({
|
|
480
|
-
highlight: (n, s) => {
|
|
481
|
-
if (s && te.getLanguage(s))
|
|
482
|
-
try {
|
|
483
|
-
return te.highlight(n, { language: s }).value;
|
|
484
|
-
} catch {
|
|
485
|
-
}
|
|
486
|
-
return "";
|
|
487
|
-
}
|
|
488
|
-
}).use(Je), ze = (n, s = !1) => Ke.render(n, s);
|
|
489
|
-
function re(n = {}) {
|
|
490
|
-
const { prefix: s = "0xbot-chat" } = n, h = (l) => s ? `${s}_${l}` : l, v = ee.createInstance({
|
|
491
|
-
name: s,
|
|
492
|
-
storeName: s,
|
|
493
|
-
driver: [
|
|
494
|
-
ee.INDEXEDDB,
|
|
495
|
-
ee.LOCALSTORAGE,
|
|
496
|
-
ee.WEBSQL
|
|
497
|
-
]
|
|
498
|
-
}), y = async (l) => {
|
|
499
|
-
try {
|
|
500
|
-
const c = h(l), g = await v.getItem(c);
|
|
501
|
-
if (g === null) return null;
|
|
502
|
-
try {
|
|
503
|
-
return JSON.parse(g);
|
|
504
|
-
} catch {
|
|
505
|
-
return g;
|
|
506
|
-
}
|
|
507
|
-
} catch (c) {
|
|
508
|
-
return console.error("Error getting value from storage:", c), null;
|
|
509
|
-
}
|
|
510
|
-
}, x = async (l, c) => {
|
|
511
|
-
try {
|
|
512
|
-
const g = h(l), b = typeof c == "string" ? c : JSON.stringify(c);
|
|
513
|
-
await v.setItem(g, b);
|
|
514
|
-
} catch (g) {
|
|
515
|
-
console.error("Error setting value in storage:", g);
|
|
516
|
-
}
|
|
517
|
-
};
|
|
518
|
-
return {
|
|
519
|
-
getStorage: y,
|
|
520
|
-
setStorage: x,
|
|
521
|
-
removeStorage: async (l) => {
|
|
522
|
-
try {
|
|
523
|
-
const c = h(l);
|
|
524
|
-
await v.removeItem(c);
|
|
525
|
-
} catch (c) {
|
|
526
|
-
console.error("Error removing value from storage:", c);
|
|
527
|
-
}
|
|
528
|
-
},
|
|
529
|
-
clearStorage: async () => {
|
|
530
|
-
try {
|
|
531
|
-
await v.clear();
|
|
532
|
-
} catch (l) {
|
|
533
|
-
console.error("Error clearing storage:", l);
|
|
534
|
-
}
|
|
535
|
-
},
|
|
536
|
-
useStorageState: (l, c) => {
|
|
537
|
-
const [g, b] = M(c);
|
|
538
|
-
return G(() => {
|
|
539
|
-
y(l).then((P) => {
|
|
540
|
-
P !== null && b(P);
|
|
541
|
-
});
|
|
542
|
-
}, [l]), G(() => {
|
|
543
|
-
x(l, g);
|
|
544
|
-
}, [l, g]), [g, b];
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
}
|
|
548
|
-
const { getStorage: Ge } = re();
|
|
549
|
-
let ve = "https://sdk.dorylus.chat/apis";
|
|
550
|
-
const Ze = (n) => {
|
|
551
|
-
n && (ve = n);
|
|
552
|
-
}, Oe = qe.create({
|
|
553
|
-
baseURL: ve,
|
|
554
|
-
timeout: 6e4
|
|
555
|
-
});
|
|
556
|
-
Oe.interceptors.request.use(
|
|
557
|
-
async (n) => {
|
|
558
|
-
const s = await Ge("auth");
|
|
559
|
-
return s && (n.headers.Token = (s == null ? void 0 : s.token) || ""), n;
|
|
560
|
-
},
|
|
561
|
-
(n) => Promise.reject(n)
|
|
562
|
-
);
|
|
563
|
-
const ne = async (n, s) => (await Oe.post(n, s)).data, Xe = (n) => {
|
|
564
|
-
const { setStorage: s } = re();
|
|
565
|
-
return n.unique_id || Te.load().then((h) => h.get()).then((h) => {
|
|
566
|
-
const v = h.visitorId;
|
|
567
|
-
n.unique_id = v, s("visitorId", v);
|
|
568
|
-
}), ne("/sdk/sdk_get_token", n);
|
|
569
|
-
}, Qe = (n) => ne("/app/conversation_history", n), et = (n) => ne("/app/upsert_conversation", n), tt = (n) => ne("/app/delete_one_conversation_history", { id: n }), rt = () => {
|
|
570
|
-
const [n, s] = M(null), [h, v] = M(!0), [y, x] = M(null), T = async (_, l, c) => new Promise(async (g, b) => {
|
|
571
|
-
var P;
|
|
572
|
-
try {
|
|
573
|
-
const { getStorage: k } = re(), I = await k("auth"), Y = await fetch(l, {
|
|
574
|
-
method: "POST",
|
|
575
|
-
headers: {
|
|
576
|
-
"Content-Type": "application/json",
|
|
577
|
-
token: (I == null ? void 0 : I.token) || ""
|
|
578
|
-
},
|
|
579
|
-
body: JSON.stringify(_)
|
|
580
|
-
});
|
|
581
|
-
if (!Y.ok)
|
|
582
|
-
throw new Error(`Server responded with status: ${Y.status}`);
|
|
583
|
-
const S = (P = Y.body) == null ? void 0 : P.getReader();
|
|
584
|
-
if (!S)
|
|
585
|
-
throw new Error("Failed to get response reader");
|
|
586
|
-
x(S);
|
|
587
|
-
const f = new TextDecoder();
|
|
588
|
-
let V = "";
|
|
589
|
-
(async () => {
|
|
590
|
-
try {
|
|
591
|
-
for (; ; ) {
|
|
592
|
-
const { done: L, value: $ } = await S.read();
|
|
593
|
-
if (L) {
|
|
594
|
-
v(!1), g();
|
|
595
|
-
break;
|
|
596
|
-
}
|
|
597
|
-
V += f.decode($, { stream: !0 });
|
|
598
|
-
const O = V.split(`
|
|
599
|
-
`);
|
|
600
|
-
V = O.pop() || "";
|
|
601
|
-
for (const A of O)
|
|
602
|
-
try {
|
|
603
|
-
if (A.startsWith("data:")) {
|
|
604
|
-
const U = A.substring(5).trim();
|
|
605
|
-
if (U) {
|
|
606
|
-
const F = JSON.parse(U);
|
|
607
|
-
c(F);
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
} catch (U) {
|
|
611
|
-
console.error("Error parsing message:", U);
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
} catch (L) {
|
|
615
|
-
b(L);
|
|
616
|
-
}
|
|
617
|
-
})();
|
|
618
|
-
} catch (k) {
|
|
619
|
-
s(k), b(k);
|
|
620
|
-
}
|
|
621
|
-
}), w = () => {
|
|
622
|
-
y && (y.cancel(), x(null));
|
|
623
|
-
};
|
|
624
|
-
return G(() => () => {
|
|
625
|
-
w();
|
|
626
|
-
}, []), {
|
|
627
|
-
loading: h,
|
|
628
|
-
error: n,
|
|
629
|
-
connect: T,
|
|
630
|
-
close: w
|
|
631
|
-
};
|
|
632
|
-
}, nt = (n) => n.map((s) => ({
|
|
633
|
-
self: s.is_user,
|
|
634
|
-
content: s.message
|
|
635
|
-
})), ut = ({
|
|
636
|
-
apiKey: n,
|
|
637
|
-
serverUrl: s,
|
|
638
|
-
UserAvatar: h,
|
|
639
|
-
AgentAvatar: v,
|
|
640
|
-
loadingText: y = "AI is thinking...",
|
|
641
|
-
emptyText: x = "No messages yet",
|
|
642
|
-
theme: T = {}
|
|
643
|
-
}) => {
|
|
644
|
-
const [w, _] = M([]), [l, c] = M(""), [g, b] = M(!1), [P, k] = M(!1), [I, Y] = M(""), [S, f] = M(null), V = ye(null), { getStorage: W, setStorage: L } = re(), { connect: $ } = rt(), O = ye(null), A = {
|
|
645
|
-
padding: T.padding || 20,
|
|
646
|
-
borderRadius: T.borderRadius || 20,
|
|
647
|
-
bgColor: T.bgColor || "#151515",
|
|
648
|
-
primary: T.primary || "#AFAFFE",
|
|
649
|
-
textColor: T.textColor || "#fff"
|
|
650
|
-
}, U = (a) => {
|
|
651
|
-
a.type === "text" ? _((p) => {
|
|
652
|
-
const d = [...p], m = S !== null ? S : d.length - 1;
|
|
653
|
-
if (m >= 0 && m < d.length) {
|
|
654
|
-
const N = { ...d[m] };
|
|
655
|
-
N.content.endsWith(a.content) || (N.content += a.content), N.loading && (N.loading = !1, k(!1)), d[m] = N;
|
|
656
|
-
}
|
|
657
|
-
return d;
|
|
658
|
-
}) : a.type === "complete" && (console.log("Message complete"), S !== null && _((p) => {
|
|
659
|
-
const d = [...p], m = { ...d[S] };
|
|
660
|
-
return m.loading = !1, a.content.text || (m.content = x), d[S] = m, d;
|
|
661
|
-
}), f(null), b(!1), k(!1));
|
|
662
|
-
}, F = async () => {
|
|
663
|
-
if (!l.trim()) return;
|
|
664
|
-
b(!0), k(!0), f(null);
|
|
665
|
-
const a = {
|
|
666
|
-
self: !0,
|
|
667
|
-
content: l,
|
|
668
|
-
loading: !1
|
|
669
|
-
}, p = {
|
|
670
|
-
self: !1,
|
|
671
|
-
content: "",
|
|
672
|
-
loading: !0
|
|
673
|
-
};
|
|
674
|
-
_((H) => [...H, a, p]), f(w.length + 1);
|
|
675
|
-
const d = await W("conversation"), m = await W("agent"), N = {
|
|
676
|
-
q: l,
|
|
677
|
-
app_id: (m == null ? void 0 : m.app_id) || "",
|
|
678
|
-
conversation_id: d || "",
|
|
679
|
-
is_debug: !1,
|
|
680
|
-
medias: []
|
|
681
|
-
};
|
|
682
|
-
c("");
|
|
683
|
-
try {
|
|
684
|
-
console.log("Connecting to stream..."), await $(N, `${ve}/app/stream_chat`, U);
|
|
685
|
-
} catch (H) {
|
|
686
|
-
console.error("Error sending message:", H), S !== null && _((Z) => {
|
|
687
|
-
const X = [...Z];
|
|
688
|
-
return X[S].loading = !1, X[S].content = "Error: Failed to get response", X;
|
|
689
|
-
}), f(null), k(!1);
|
|
690
|
-
} finally {
|
|
691
|
-
b(!1);
|
|
692
|
-
}
|
|
693
|
-
}, q = () => {
|
|
694
|
-
var a;
|
|
695
|
-
(a = O.current) == null || a.scrollIntoView({ behavior: "smooth" });
|
|
696
|
-
}, ae = async (a) => {
|
|
697
|
-
const d = await Xe({
|
|
698
|
-
api_key: n,
|
|
699
|
-
unique_id: a
|
|
700
|
-
});
|
|
701
|
-
d.code == 0 && (L("auth", d.data.auth), L("agent", d.data.agent), oe(d.data.agent));
|
|
702
|
-
}, se = async () => {
|
|
703
|
-
const a = await W("conversation");
|
|
704
|
-
a && (await tt(a)).code == 0 && _([]);
|
|
705
|
-
}, Q = async (a) => {
|
|
706
|
-
const p = await W("agent"), d = {
|
|
707
|
-
page: 1,
|
|
708
|
-
pagesize: 2e6,
|
|
709
|
-
app_id: (p == null ? void 0 : p.app_id) || "",
|
|
710
|
-
conversation_id: a || ""
|
|
711
|
-
}, m = await Qe(d);
|
|
712
|
-
m.code == 0 && (_(nt(m.data.list).reverse()), !w.length && (p != null && p.opening_text) && Y(p.opening_text), q());
|
|
713
|
-
}, oe = async (a) => {
|
|
714
|
-
const p = await W("conversation");
|
|
715
|
-
if (p)
|
|
716
|
-
Q(p);
|
|
717
|
-
else {
|
|
718
|
-
const d = {
|
|
719
|
-
id: "",
|
|
720
|
-
app_id: (a == null ? void 0 : a.app_id) || "",
|
|
721
|
-
name: "Unnamed"
|
|
722
|
-
}, m = await et(d);
|
|
723
|
-
m.code == 0 && (await L("conversation", m.data.id || ""), Q(m.data.id || ""));
|
|
724
|
-
}
|
|
725
|
-
};
|
|
726
|
-
return G(() => {
|
|
727
|
-
q(), n && Te.load().then((a) => a.get()).then(async (a) => {
|
|
728
|
-
const p = a.visitorId;
|
|
729
|
-
await L("visitorId", p), ae(p);
|
|
730
|
-
});
|
|
731
|
-
}, []), G(() => {
|
|
732
|
-
Ze(s);
|
|
733
|
-
}, [s]), G(() => {
|
|
734
|
-
q();
|
|
735
|
-
}, [w]), /* @__PURE__ */ C.jsxs(
|
|
736
|
-
"div",
|
|
737
|
-
{
|
|
738
|
-
className: "chat-library",
|
|
739
|
-
style: {
|
|
740
|
-
backgroundColor: A.bgColor,
|
|
741
|
-
color: A.textColor,
|
|
742
|
-
borderRadius: `${A.borderRadius}px`,
|
|
743
|
-
padding: `${A.padding}px`
|
|
744
|
-
},
|
|
745
|
-
children: [
|
|
746
|
-
/* @__PURE__ */ C.jsx("div", { className: "chat-container", ref: V, children: /* @__PURE__ */ C.jsxs("div", { className: "chat-container-list", children: [
|
|
747
|
-
w.map((a, p) => /* @__PURE__ */ C.jsx(
|
|
748
|
-
be,
|
|
749
|
-
{
|
|
750
|
-
self: a.self,
|
|
751
|
-
UserAvatar: h,
|
|
752
|
-
AgentAvatar: v,
|
|
753
|
-
loading: a.loading,
|
|
754
|
-
loadingText: y,
|
|
755
|
-
emptyText: x,
|
|
756
|
-
content: a.content,
|
|
757
|
-
children: /* @__PURE__ */ C.jsx("div", { dangerouslySetInnerHTML: { __html: ze(a.content) } })
|
|
758
|
-
},
|
|
759
|
-
p
|
|
760
|
-
)),
|
|
761
|
-
!w.length && I && /* @__PURE__ */ C.jsx(
|
|
762
|
-
be,
|
|
763
|
-
{
|
|
764
|
-
self: !1,
|
|
765
|
-
AgentAvatar: v,
|
|
766
|
-
loading: !1,
|
|
767
|
-
content: I,
|
|
768
|
-
children: /* @__PURE__ */ C.jsx("div", { dangerouslySetInnerHTML: { __html: I } })
|
|
769
|
-
}
|
|
770
|
-
),
|
|
771
|
-
/* @__PURE__ */ C.jsx("div", { ref: O })
|
|
772
|
-
] }) }),
|
|
773
|
-
/* @__PURE__ */ C.jsxs("div", { className: "chat-bar", children: [
|
|
774
|
-
/* @__PURE__ */ C.jsx(
|
|
775
|
-
"svg",
|
|
776
|
-
{
|
|
777
|
-
onClick: se,
|
|
778
|
-
className: "chat-bar-trash",
|
|
779
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
780
|
-
viewBox: "0 0 24 24",
|
|
781
|
-
children: /* @__PURE__ */ C.jsx(
|
|
782
|
-
"path",
|
|
783
|
-
{
|
|
784
|
-
fill: "none",
|
|
785
|
-
stroke: "currentColor",
|
|
786
|
-
strokeLinecap: "round",
|
|
787
|
-
strokeLinejoin: "round",
|
|
788
|
-
strokeWidth: "2",
|
|
789
|
-
d: "M4 7h16m-10 4v6m4-6v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"
|
|
790
|
-
}
|
|
791
|
-
)
|
|
792
|
-
}
|
|
793
|
-
),
|
|
794
|
-
/* @__PURE__ */ C.jsx(
|
|
795
|
-
"input",
|
|
796
|
-
{
|
|
797
|
-
className: "chat-bar-input",
|
|
798
|
-
disabled: g,
|
|
799
|
-
placeholder: "Ask anything...",
|
|
800
|
-
value: l,
|
|
801
|
-
onChange: (a) => c(a.target.value),
|
|
802
|
-
onKeyUp: (a) => a.key === "Enter" && F()
|
|
803
|
-
}
|
|
804
|
-
),
|
|
805
|
-
/* @__PURE__ */ C.jsx(
|
|
806
|
-
"button",
|
|
807
|
-
{
|
|
808
|
-
className: "chat-bar-send",
|
|
809
|
-
disabled: g,
|
|
810
|
-
style: {
|
|
811
|
-
borderColor: A.primary,
|
|
812
|
-
color: A.primary,
|
|
813
|
-
"--primary-color": A.primary
|
|
814
|
-
},
|
|
815
|
-
onClick: F,
|
|
816
|
-
children: "Send"
|
|
817
|
-
}
|
|
818
|
-
)
|
|
819
|
-
] })
|
|
820
|
-
]
|
|
821
|
-
}
|
|
822
|
-
);
|
|
823
|
-
};
|
|
1
|
+
import { ac as s, ad as r, ac as t } from "./index-DId52aLZ.mjs";
|
|
824
2
|
export {
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
3
|
+
s as ChatLibrary,
|
|
4
|
+
r as MessageItem,
|
|
5
|
+
t as default
|
|
828
6
|
};
|