@tarxemo/customer_support 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/customer_support.css +1 -1
- package/dist/index.es.js +26 -27
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--cs-primary-color: #6366f1;--cs-secondary-color: #8b5cf6;--cs-bg-color: #ffffff;--cs-text-color: #1f2937;--cs-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif;--cs-border-radius: 12px;--cs-button-color: var(--cs-primary-color);--cs-user-message-color: var(--cs-primary-color);--cs-assistant-message-color: #f3f4f6;--cs-header-gradient: linear-gradient(135deg, var(--cs-primary-color), var(--cs-secondary-color));--cs-focus-ring: rgba(
|
|
1
|
+
:root{--cs-primary-color: #6366f1;--cs-secondary-color: #8b5cf6;--cs-bg-color: #ffffff;--cs-text-color: #1f2937;--cs-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif;--cs-border-radius: 12px;--cs-button-color: var(--cs-primary-color);--cs-user-message-color: var(--cs-primary-color);--cs-assistant-message-color: #f3f4f6;--cs-header-gradient: linear-gradient(135deg, var(--cs-primary-color), var(--cs-secondary-color));--cs-focus-ring: rgba(0, 0, 0, .1);--cs-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);--cs-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--cs-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--cs-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)}.cs-widget{position:fixed;z-index:9999;font-family:var(--cs-font-family)}.cs-widget,.cs-widget *{box-sizing:border-box}.cs-widget--bottom-right{bottom:20px;right:20px}.cs-widget--bottom-left{bottom:20px;left:20px}.cs-widget--top-right{top:20px;right:20px}.cs-widget--top-left{top:20px;left:20px}.cs-widget__toggle{position:relative;width:60px;height:60px;border-radius:50%;background:var(--cs-header-gradient);border:none;color:#fff;cursor:pointer;box-shadow:var(--cs-shadow-xl);transition:all .3s cubic-bezier(.4,0,.2,1);display:flex;align-items:center;justify-content:center}.cs-widget__toggle:hover{transform:scale(1.1);box-shadow:0 15px 25px -5px var(--cs-focus-ring)}.cs-widget__toggle:active{transform:scale(.95)}.cs-widget__toggle--open{background:#ef4444}.cs-widget__badge{position:absolute;top:-5px;right:-5px;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;box-shadow:var(--cs-shadow)}.cs-window{position:absolute;bottom:80px;right:0;width:380px;max-width:calc(100vw - 40px);height:600px;max-height:calc(100vh - 120px);background:var(--cs-bg-color);border-radius:var(--cs-border-radius);box-shadow:var(--cs-shadow-xl);display:flex;flex-direction:column;overflow:hidden;animation:slideUp .3s cubic-bezier(.4,0,.2,1)}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.cs-window__header{background:var(--cs-header-gradient);color:#fff;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.cs-window__title{margin:0;font-size:18px;font-weight:600}.cs-window__close{background:#fff3;border:none;color:#fff;width:32px;height:32px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .2s}.cs-window__close:hover{background:#ffffff4d}.cs-window__messages{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:16px;background:#f9fafb}.cs-window__messages::-webkit-scrollbar{width:6px}.cs-window__messages::-webkit-scrollbar-track{background:transparent}.cs-window__messages::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.cs-window__messages::-webkit-scrollbar-thumb:hover{background:#9ca3af}.cs-window__welcome{text-align:center;padding:40px 20px;color:#6b7280}.cs-window__welcome p{margin:0;font-size:16px}.cs-window__typing{display:flex;align-items:center;gap:8px;padding:12px 16px;background:var(--cs-assistant-message-color);border-radius:var(--cs-border-radius);width:fit-content;color:var(--cs-text-color)}.cs-window__typing-icon{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.cs-window__error{background:#fee2e2;border:1px solid #ef4444;color:#991b1b;padding:12px 16px;border-radius:var(--cs-border-radius)}.cs-window__error p{margin:0}.cs-message{display:flex;flex-direction:column;gap:6px;max-width:85%;animation:fadeIn .3s ease-in-out}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.cs-message--user{align-self:flex-end;align-items:flex-end}.cs-message--assistant{align-self:flex-start;align-items:flex-start}.cs-message__content{background:var(--cs-assistant-message-color);padding:12px 16px;border-radius:var(--cs-border-radius);color:var(--cs-text-color);word-wrap:break-word}.cs-message--user .cs-message__content{background:var(--cs-user-message-color);color:#fff}.cs-message__text{margin:0;line-height:1.5;white-space:pre-wrap}.cs-message__time{font-size:11px;color:#9ca3af;padding:0 4px}.cs-message__sources{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}.cs-message__sources-title{margin:0 0 8px;font-size:12px;font-weight:600;color:#6b7280}.cs-message__sources-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}.cs-message__source-item{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}.cs-message__source-link{display:flex;align-items:center;gap:4px;color:var(--cs-primary-color);text-decoration:none;flex:1;min-width:0}.cs-message__source-link:hover{text-decoration:underline}.cs-message__source-link span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cs-message__source-similarity{color:#6b7280;font-size:11px;white-space:nowrap}.cs-window__input-wrapper{padding:16px;background:var(--cs-bg-color);border-top:1px solid #e5e7eb;flex-shrink:0}.cs-input{display:flex;gap:8px;align-items:flex-end}.cs-input__textarea{flex:1;padding:12px 16px;border:1px solid #d1d5db;border-radius:var(--cs-border-radius);font-family:var(--cs-font-family);font-size:14px;resize:none;max-height:120px;min-height:44px;transition:border-color .2s}.cs-input__textarea:focus{outline:none;border-color:var(--cs-primary-color);box-shadow:0 0 0 3px var(--cs-focus-ring);background-color:var(--cs-bg-color)}.cs-input__textarea:disabled{background:#f3f4f6;cursor:not-allowed}.cs-input__button{background:var(--cs-button-color);color:#fff;border:none;width:44px;height:44px;border-radius:var(--cs-border-radius);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;flex-shrink:0}.cs-input__button:hover:not(:disabled){background:var(--cs-secondary-color);transform:scale(1.05)}.cs-input__button:active:not(:disabled){transform:scale(.95)}.cs-input__button:disabled{background:#d1d5db;cursor:not-allowed}@media(max-width:480px){.cs-widget--open{position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;z-index:10000!important;background:var(--cs-bg-color)}.cs-window{position:relative!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;bottom:auto!important;right:auto!important;left:auto!important;top:auto!important;border-radius:0!important;box-shadow:none!important;display:flex!important;flex-direction:column!important;animation:none!important}.cs-widget--open .cs-widget__toggle{display:none!important}.cs-window__messages{padding:16px}.cs-window__header{padding:12px 16px}.cs-window__input-wrapper{padding:12px;padding-bottom:max(12px,env(safe-area-inset-bottom))}.cs-widget__toggle{position:fixed;bottom:20px;right:20px;z-index:10000}.cs-widget--bottom-left .cs-widget__toggle{left:20px;right:auto}.cs-widget--top-right .cs-widget__toggle{top:20px;bottom:auto}.cs-widget--top-left .cs-widget__toggle{top:20px;left:20px;bottom:auto;right:auto}}
|
package/dist/index.es.js
CHANGED
|
@@ -37,7 +37,7 @@ const Pt = ce("string"), C = ce("function"), et = ce("number"), K = (e) => e !==
|
|
|
37
37
|
let t;
|
|
38
38
|
return e && (typeof FormData == "function" && e instanceof FormData || C(e.append) && ((t = ae(e)) === "formdata" || // detect form-data instance
|
|
39
39
|
t === "object" && C(e.toString) && e.toString() === "[object FormData]"));
|
|
40
|
-
},
|
|
40
|
+
}, $t = P("URLSearchParams"), [Mt, Ht, qt, zt] = ["ReadableStream", "Request", "Response", "Headers"].map(P), vt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
41
41
|
function W(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
42
42
|
if (e === null || typeof e > "u")
|
|
43
43
|
return;
|
|
@@ -208,7 +208,7 @@ const ln = (e) => {
|
|
|
208
208
|
isObject: K,
|
|
209
209
|
isPlainObject: ne,
|
|
210
210
|
isEmptyObject: Ft,
|
|
211
|
-
isReadableStream:
|
|
211
|
+
isReadableStream: Mt,
|
|
212
212
|
isRequest: Ht,
|
|
213
213
|
isResponse: qt,
|
|
214
214
|
isHeaders: zt,
|
|
@@ -219,7 +219,7 @@ const ln = (e) => {
|
|
|
219
219
|
isRegExp: nn,
|
|
220
220
|
isFunction: C,
|
|
221
221
|
isStream: It,
|
|
222
|
-
isURLSearchParams:
|
|
222
|
+
isURLSearchParams: $t,
|
|
223
223
|
isTypedArray: Qt,
|
|
224
224
|
isFileList: Bt,
|
|
225
225
|
forEach: W,
|
|
@@ -919,10 +919,10 @@ const oe = (e, t, n = 3) => {
|
|
|
919
919
|
total: e,
|
|
920
920
|
loaded: r
|
|
921
921
|
}), t[1]];
|
|
922
|
-
}, Ie = (e) => (...t) => c.asap(() => e(...t)),
|
|
922
|
+
}, Ie = (e) => (...t) => c.asap(() => e(...t)), $n = A.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, A.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
923
923
|
new URL(A.origin),
|
|
924
924
|
A.navigator && /(msie|trident)/i.test(A.navigator.userAgent)
|
|
925
|
-
) : () => !0,
|
|
925
|
+
) : () => !0, Mn = A.hasStandardBrowserEnv ? (
|
|
926
926
|
// Standard browser envs support document.cookie
|
|
927
927
|
{
|
|
928
928
|
write(e, t, n, r, s, o, i) {
|
|
@@ -962,7 +962,7 @@ function pt(e, t, n) {
|
|
|
962
962
|
return e && (r || n == !1) ? qn(e, t) : t;
|
|
963
963
|
}
|
|
964
964
|
const je = (e) => e instanceof N ? { ...e } : e;
|
|
965
|
-
function
|
|
965
|
+
function $(e, t) {
|
|
966
966
|
t = t || {};
|
|
967
967
|
const n = {};
|
|
968
968
|
function r(u, l, p, b) {
|
|
@@ -1027,7 +1027,7 @@ function M(e, t) {
|
|
|
1027
1027
|
}), n;
|
|
1028
1028
|
}
|
|
1029
1029
|
const mt = (e) => {
|
|
1030
|
-
const t =
|
|
1030
|
+
const t = $({}, e);
|
|
1031
1031
|
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: a } = t;
|
|
1032
1032
|
if (t.headers = i = N.from(i), t.url = ct(pt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
|
|
1033
1033
|
"Authorization",
|
|
@@ -1042,8 +1042,8 @@ const mt = (e) => {
|
|
|
1042
1042
|
});
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
|
-
if (A.hasStandardBrowserEnv && (r && c.isFunction(r) && (r = r(t)), r || r !== !1 &&
|
|
1046
|
-
const d = s && o &&
|
|
1045
|
+
if (A.hasStandardBrowserEnv && (r && c.isFunction(r) && (r = r(t)), r || r !== !1 && $n(t.url))) {
|
|
1046
|
+
const d = s && o && Mn.read(o);
|
|
1047
1047
|
d && i.set(s, d);
|
|
1048
1048
|
}
|
|
1049
1049
|
return t;
|
|
@@ -1156,7 +1156,7 @@ const mt = (e) => {
|
|
|
1156
1156
|
} finally {
|
|
1157
1157
|
await t.cancel();
|
|
1158
1158
|
}
|
|
1159
|
-
},
|
|
1159
|
+
}, $e = (e, t, n, r) => {
|
|
1160
1160
|
const s = Kn(e, t);
|
|
1161
1161
|
let o = 0, i, a = (d) => {
|
|
1162
1162
|
i || (i = !0, r && r(d));
|
|
@@ -1185,7 +1185,7 @@ const mt = (e) => {
|
|
|
1185
1185
|
}, {
|
|
1186
1186
|
highWaterMark: 2
|
|
1187
1187
|
});
|
|
1188
|
-
},
|
|
1188
|
+
}, Me = 64 * 1024, { isFunction: te } = c, Xn = (({ Request: e, Response: t }) => ({
|
|
1189
1189
|
Request: e,
|
|
1190
1190
|
Response: t
|
|
1191
1191
|
}))(c.global), {
|
|
@@ -1270,13 +1270,13 @@ const mt = (e) => {
|
|
|
1270
1270
|
method: "POST",
|
|
1271
1271
|
body: S,
|
|
1272
1272
|
duplex: "half"
|
|
1273
|
-
}),
|
|
1274
|
-
if (c.isFormData(S) && (
|
|
1273
|
+
}), M;
|
|
1274
|
+
if (c.isFormData(S) && (M = k.headers.get("content-type")) && fe.setContentType(M), k.body) {
|
|
1275
1275
|
const [de, Z] = Be(
|
|
1276
1276
|
Ae,
|
|
1277
1277
|
oe(Ie(U))
|
|
1278
1278
|
);
|
|
1279
|
-
S =
|
|
1279
|
+
S = $e(k.body, Me, de, Z);
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
1282
|
c.isString(Q) || (Q = Q ? "include" : "omit");
|
|
@@ -1297,12 +1297,12 @@ const mt = (e) => {
|
|
|
1297
1297
|
["status", "statusText", "headers"].forEach((xe) => {
|
|
1298
1298
|
k[xe] = L[xe];
|
|
1299
1299
|
});
|
|
1300
|
-
const
|
|
1301
|
-
|
|
1300
|
+
const M = c.toFiniteNumber(L.headers.get("content-length")), [de, Z] = T && Be(
|
|
1301
|
+
M,
|
|
1302
1302
|
oe(Ie(T), !0)
|
|
1303
1303
|
) || [];
|
|
1304
1304
|
L = new r(
|
|
1305
|
-
|
|
1305
|
+
$e(L.body, Me, de, () => {
|
|
1306
1306
|
Z && Z(), B && B();
|
|
1307
1307
|
}),
|
|
1308
1308
|
k
|
|
@@ -1310,8 +1310,8 @@ const mt = (e) => {
|
|
|
1310
1310
|
}
|
|
1311
1311
|
x = x || "text";
|
|
1312
1312
|
let gt = await p[c.findKey(p, x) || "text"](L, f);
|
|
1313
|
-
return !Ne && B && B(), await new Promise((k,
|
|
1314
|
-
dt(k,
|
|
1313
|
+
return !Ne && B && B(), await new Promise((k, M) => {
|
|
1314
|
+
dt(k, M, {
|
|
1315
1315
|
data: gt,
|
|
1316
1316
|
headers: N.from(L.headers),
|
|
1317
1317
|
status: L.status,
|
|
@@ -1503,7 +1503,7 @@ let j = class {
|
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
1505
1505
|
_request(t, n) {
|
|
1506
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
1506
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = $(this.defaults, n);
|
|
1507
1507
|
const { transitional: r, paramsSerializer: s, headers: o } = n;
|
|
1508
1508
|
r !== void 0 && se.assertOptions(r, {
|
|
1509
1509
|
silentJSONParsing: F.transitional(F.boolean),
|
|
@@ -1565,14 +1565,14 @@ let j = class {
|
|
|
1565
1565
|
return l;
|
|
1566
1566
|
}
|
|
1567
1567
|
getUri(t) {
|
|
1568
|
-
t =
|
|
1568
|
+
t = $(this.defaults, t);
|
|
1569
1569
|
const n = pt(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1570
1570
|
return ct(n, t.params, t.paramsSerializer);
|
|
1571
1571
|
}
|
|
1572
1572
|
};
|
|
1573
1573
|
c.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1574
1574
|
j.prototype[t] = function(n, r) {
|
|
1575
|
-
return this.request(
|
|
1575
|
+
return this.request($(r || {}, {
|
|
1576
1576
|
method: t,
|
|
1577
1577
|
url: n,
|
|
1578
1578
|
data: (r || {}).data
|
|
@@ -1582,7 +1582,7 @@ c.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1582
1582
|
c.forEach(["post", "put", "patch"], function(t) {
|
|
1583
1583
|
function n(r) {
|
|
1584
1584
|
return function(o, i, a) {
|
|
1585
|
-
return this.request(
|
|
1585
|
+
return this.request($(a || {}, {
|
|
1586
1586
|
method: t,
|
|
1587
1587
|
headers: r ? {
|
|
1588
1588
|
"Content-Type": "multipart/form-data"
|
|
@@ -1752,7 +1752,7 @@ Object.entries(be).forEach(([e, t]) => {
|
|
|
1752
1752
|
function bt(e) {
|
|
1753
1753
|
const t = new j(e), n = Qe(j.prototype.request, t);
|
|
1754
1754
|
return c.extend(n, j.prototype, t, { allOwnKeys: !0 }), c.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1755
|
-
return bt(
|
|
1755
|
+
return bt($(e, s));
|
|
1756
1756
|
}, n;
|
|
1757
1757
|
}
|
|
1758
1758
|
const O = bt(X);
|
|
@@ -1769,7 +1769,7 @@ O.all = function(t) {
|
|
|
1769
1769
|
};
|
|
1770
1770
|
O.spread = nr;
|
|
1771
1771
|
O.isAxiosError = rr;
|
|
1772
|
-
O.mergeConfig =
|
|
1772
|
+
O.mergeConfig = $;
|
|
1773
1773
|
O.AxiosHeaders = N;
|
|
1774
1774
|
O.formToJSON = (e) => ut(c.isHTMLForm(e) ? new FormData(e) : e);
|
|
1775
1775
|
O.getAdapter = wt.getAdapter;
|
|
@@ -2060,9 +2060,8 @@ const lr = ({ message: e }) => {
|
|
|
2060
2060
|
baseUrl: t,
|
|
2061
2061
|
onError: a
|
|
2062
2062
|
}), S = E.useMemo(() => {
|
|
2063
|
-
if (!n) return {};
|
|
2064
2063
|
const y = {};
|
|
2065
|
-
return
|
|
2064
|
+
return y["--cs-primary-color"] = (n == null ? void 0 : n.primaryColor) || "#6366f1", y["--cs-secondary-color"] = (n == null ? void 0 : n.secondaryColor) || (n == null ? void 0 : n.primaryColor) || "#8b5cf6", y["--cs-bg-color"] = (n == null ? void 0 : n.backgroundColor) || "#ffffff", y["--cs-text-color"] = (n == null ? void 0 : n.textColor) || "#1f2937", y["--cs-font-family"] = (n == null ? void 0 : n.fontFamily) || "inherit", y["--cs-border-radius"] = (n == null ? void 0 : n.borderRadius) || "12px", y["--cs-button-color"] = (n == null ? void 0 : n.buttonColor) || (n == null ? void 0 : n.primaryColor) || "#6366f1", y["--cs-user-message-color"] = (n == null ? void 0 : n.userMessageColor) || (n == null ? void 0 : n.primaryColor) || "#6366f1", y["--cs-assistant-message-color"] = (n == null ? void 0 : n.assistantMessageColor) || "#f3f4f6", n != null && n.primaryColor && (y["--cs-focus-ring"] = `${n.primaryColor}33`), y;
|
|
2066
2065
|
}, [n]), R = async (y) => {
|
|
2067
2066
|
if (d == null || d(y), await _(y), !h) {
|
|
2068
2067
|
const T = b[b.length - 1];
|