chat-customer-47net 1.2.3 → 1.2.5
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/chat-customer-47net.es.js +280 -78
- package/chat-customer-47net.umd.js +547 -406
- package/package.json +1 -1
- package/style.css +1 -1
|
@@ -834,6 +834,7 @@ var timezoneExports = timezone$1.exports;
|
|
|
834
834
|
const timezone = /* @__PURE__ */getDefaultExportFromCjs(timezoneExports);
|
|
835
835
|
dayjs.extend(utc);
|
|
836
836
|
dayjs.extend(timezone);
|
|
837
|
+
const version = "1.2.5";
|
|
837
838
|
const publicDateFormat = "MM/DD/YY";
|
|
838
839
|
const serverLocal = "America/New_York";
|
|
839
840
|
const getTime = dateTime => {
|
|
@@ -995,7 +996,9 @@ var render$8 = function () {
|
|
|
995
996
|
return _vm.handleTouchEnd(e, "handleStartNewConversation");
|
|
996
997
|
}
|
|
997
998
|
}
|
|
998
|
-
}, [_vm._v(" Start
|
|
999
|
+
}, [_vm._v(" Start New Conversation 💬 ")]) : _vm._e()], 2), _c("div", {
|
|
1000
|
+
staticClass: "consult-47this-version"
|
|
1001
|
+
}, [_vm._v("v" + _vm._s(_vm.version))])]);
|
|
999
1002
|
};
|
|
1000
1003
|
var staticRenderFns$7 = [function () {
|
|
1001
1004
|
var _vm = this;
|
|
@@ -1059,7 +1062,8 @@ const __vue2_script$7 = {
|
|
|
1059
1062
|
data() {
|
|
1060
1063
|
return {
|
|
1061
1064
|
touchStartTime: 0,
|
|
1062
|
-
chatShowDateTime
|
|
1065
|
+
chatShowDateTime,
|
|
1066
|
+
version
|
|
1063
1067
|
};
|
|
1064
1068
|
},
|
|
1065
1069
|
methods: {
|
|
@@ -1098,7 +1102,7 @@ const __vue2_script$7 = {
|
|
|
1098
1102
|
}
|
|
1099
1103
|
};
|
|
1100
1104
|
const __cssModules$7 = {};
|
|
1101
|
-
var __component__$7 = /* @__PURE__ */normalizeComponent(__vue2_script$7, render$8, staticRenderFns$7, false, __vue2_injectStyles$7, "
|
|
1105
|
+
var __component__$7 = /* @__PURE__ */normalizeComponent(__vue2_script$7, render$8, staticRenderFns$7, false, __vue2_injectStyles$7, "81517c80", null, null);
|
|
1102
1106
|
function __vue2_injectStyles$7(context) {
|
|
1103
1107
|
for (let o in __cssModules$7) {
|
|
1104
1108
|
this[o] = __cssModules$7[o];
|
|
@@ -1284,7 +1288,7 @@ var render$6 = function () {
|
|
|
1284
1288
|
return _vm.handleTouchEnd(e, "new");
|
|
1285
1289
|
}
|
|
1286
1290
|
}
|
|
1287
|
-
}, [_vm._v(" Start
|
|
1291
|
+
}, [_vm._v(" Start New Conversation 💬 ")])])]);
|
|
1288
1292
|
};
|
|
1289
1293
|
var staticRenderFns$5 = [];
|
|
1290
1294
|
const ConsultConversations_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
@@ -1332,7 +1336,7 @@ const __vue2_script$5 = {
|
|
|
1332
1336
|
}
|
|
1333
1337
|
};
|
|
1334
1338
|
const __cssModules$5 = {};
|
|
1335
|
-
var __component__$5 = /* @__PURE__ */normalizeComponent(__vue2_script$5, render$6, staticRenderFns$5, false, __vue2_injectStyles$5, "
|
|
1339
|
+
var __component__$5 = /* @__PURE__ */normalizeComponent(__vue2_script$5, render$6, staticRenderFns$5, false, __vue2_injectStyles$5, "61a191ac", null, null);
|
|
1336
1340
|
function __vue2_injectStyles$5(context) {
|
|
1337
1341
|
for (let o in __cssModules$5) {
|
|
1338
1342
|
this[o] = __cssModules$5[o];
|
|
@@ -5498,17 +5502,17 @@ const validators$1 = {};
|
|
|
5498
5502
|
};
|
|
5499
5503
|
});
|
|
5500
5504
|
const deprecatedWarnings = {};
|
|
5501
|
-
validators$1.transitional = function transitional(validator2,
|
|
5505
|
+
validators$1.transitional = function transitional(validator2, version2, message) {
|
|
5502
5506
|
function formatMessage(opt, desc) {
|
|
5503
5507
|
return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
5504
5508
|
}
|
|
5505
5509
|
return (value, opt, opts) => {
|
|
5506
5510
|
if (validator2 === false) {
|
|
5507
|
-
throw new AxiosError(formatMessage(opt, " has been removed" + (
|
|
5511
|
+
throw new AxiosError(formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")), AxiosError.ERR_DEPRECATED);
|
|
5508
5512
|
}
|
|
5509
|
-
if (
|
|
5513
|
+
if (version2 && !deprecatedWarnings[opt]) {
|
|
5510
5514
|
deprecatedWarnings[opt] = true;
|
|
5511
|
-
console.warn(formatMessage(opt, " has been deprecated since v" +
|
|
5515
|
+
console.warn(formatMessage(opt, " has been deprecated since v" + version2 + " and will be removed in the near future"));
|
|
5512
5516
|
}
|
|
5513
5517
|
return validator2 ? validator2(value, opt, opts) : true;
|
|
5514
5518
|
};
|
|
@@ -6127,7 +6131,7 @@ var render$5 = function () {
|
|
|
6127
6131
|
}, [_c("b", {
|
|
6128
6132
|
staticClass: "markdown-body",
|
|
6129
6133
|
domProps: {
|
|
6130
|
-
"innerHTML": _vm._s(_vm.
|
|
6134
|
+
"innerHTML": _vm._s(_vm.displayedHtml)
|
|
6131
6135
|
}
|
|
6132
6136
|
}), _c("span", {
|
|
6133
6137
|
staticClass: "time"
|
|
@@ -6148,16 +6152,30 @@ var render$5 = function () {
|
|
|
6148
6152
|
on: {
|
|
6149
6153
|
"click": _vm.handleLinkClick
|
|
6150
6154
|
}
|
|
6151
|
-
}, [_c("b", {
|
|
6155
|
+
}, [_vm.chatType === "ai-thinking" ? _c("b", {
|
|
6156
|
+
staticClass: "thinking-dot",
|
|
6157
|
+
attrs: {
|
|
6158
|
+
"aria-hidden": "true"
|
|
6159
|
+
}
|
|
6160
|
+
}, [_vm._v(" thinking "), _c("i", {
|
|
6161
|
+
staticClass: "dot"
|
|
6162
|
+
}), _c("i", {
|
|
6163
|
+
staticClass: "dot"
|
|
6164
|
+
}), _c("i", {
|
|
6165
|
+
staticClass: "dot"
|
|
6166
|
+
})]) : _c("b", {
|
|
6152
6167
|
staticClass: "markdown-body",
|
|
6153
6168
|
domProps: {
|
|
6154
|
-
"innerHTML": _vm._s(_vm.
|
|
6169
|
+
"innerHTML": _vm._s(_vm.displayedHtml)
|
|
6155
6170
|
}
|
|
6156
|
-
}), _vm.chatType === "ai" && _vm.chatAction === "human agent" ? _c("i", {
|
|
6171
|
+
}), _vm.chatType === "ai" && _vm.chatAction === "human agent" && !_vm.isTyping ? _c("i", {
|
|
6157
6172
|
staticClass: "to-human"
|
|
6158
6173
|
}, [_c("i", {
|
|
6159
6174
|
on: {
|
|
6160
|
-
"click":
|
|
6175
|
+
"click": function ($event) {
|
|
6176
|
+
$event.stopPropagation();
|
|
6177
|
+
return _vm.changeByHumanAgent.apply(null, arguments);
|
|
6178
|
+
}
|
|
6161
6179
|
}
|
|
6162
6180
|
}, [_vm._v("Connect with an Agent")])]) : _vm._e(), _c("span", {
|
|
6163
6181
|
staticClass: "time"
|
|
@@ -6279,6 +6297,7 @@ var staticRenderFns$4 = [function () {
|
|
|
6279
6297
|
const ConsultChatItem_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
6280
6298
|
const ConsultChatItem_vue_vue_type_style_index_1_lang = "";
|
|
6281
6299
|
const hexToRgb = hex => {
|
|
6300
|
+
if (!hex || hex[0] !== "#") return "0, 0, 0";
|
|
6282
6301
|
const r = parseInt(hex.slice(1, 3), 16);
|
|
6283
6302
|
const g = parseInt(hex.slice(3, 5), 16);
|
|
6284
6303
|
const b = parseInt(hex.slice(5, 7), 16);
|
|
@@ -6287,13 +6306,13 @@ const hexToRgb = hex => {
|
|
|
6287
6306
|
const render$4 = new marked.Renderer();
|
|
6288
6307
|
marked.setOptions({
|
|
6289
6308
|
renderer: render$4,
|
|
6290
|
-
// 这是必填项
|
|
6291
6309
|
gfm: true,
|
|
6292
|
-
pedantic: false
|
|
6310
|
+
pedantic: false,
|
|
6311
|
+
breaks: true,
|
|
6312
|
+
sanitize: false
|
|
6293
6313
|
});
|
|
6294
6314
|
const __vue2_script$4 = {
|
|
6295
6315
|
name: "ConsultChatItem",
|
|
6296
|
-
components: {},
|
|
6297
6316
|
props: {
|
|
6298
6317
|
item: {
|
|
6299
6318
|
type: Object,
|
|
@@ -6362,15 +6381,39 @@ const __vue2_script$4 = {
|
|
|
6362
6381
|
socket: {
|
|
6363
6382
|
type: Object,
|
|
6364
6383
|
default: () => ({})
|
|
6384
|
+
},
|
|
6385
|
+
// 强制打开打字机(父组件可传)
|
|
6386
|
+
stream: {
|
|
6387
|
+
type: Boolean,
|
|
6388
|
+
default: false
|
|
6389
|
+
},
|
|
6390
|
+
// 调速相关
|
|
6391
|
+
typeSpeed: {
|
|
6392
|
+
type: Number,
|
|
6393
|
+
default: 20
|
|
6394
|
+
},
|
|
6395
|
+
chunk: {
|
|
6396
|
+
type: Number,
|
|
6397
|
+
default: 1
|
|
6398
|
+
},
|
|
6399
|
+
charsPerRender: {
|
|
6400
|
+
type: Number,
|
|
6401
|
+
default: 3
|
|
6365
6402
|
}
|
|
6366
6403
|
},
|
|
6367
6404
|
data() {
|
|
6368
|
-
var _a2, _b
|
|
6405
|
+
var _a2, _b;
|
|
6369
6406
|
return {
|
|
6370
6407
|
email: ((_a2 = this.initData.user) == null ? void 0 : _a2.email) || "",
|
|
6371
6408
|
clientEmail: ((_b = this.initData.user) == null ? void 0 : _b.email) || "",
|
|
6372
|
-
clientName:
|
|
6373
|
-
|
|
6409
|
+
// clientName: this.initData.user?.name || '',
|
|
6410
|
+
clientName: "",
|
|
6411
|
+
clientQuestion: "",
|
|
6412
|
+
displayedHtml: "",
|
|
6413
|
+
_typeController: null,
|
|
6414
|
+
isTyping: false,
|
|
6415
|
+
// 标记组件已挂载:只有当 _hasMounted 为 true 时,新的 message 才会触发打字机
|
|
6416
|
+
_hasMounted: false
|
|
6374
6417
|
};
|
|
6375
6418
|
},
|
|
6376
6419
|
computed: {
|
|
@@ -6380,30 +6423,201 @@ const __vue2_script$4 = {
|
|
|
6380
6423
|
userId() {
|
|
6381
6424
|
return getClientId();
|
|
6382
6425
|
},
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
const renderer = new marked.Renderer();
|
|
6386
|
-
renderer.link = href => {
|
|
6387
|
-
const currentDomain = window.location.hostname;
|
|
6388
|
-
const targetDomain = new URL(href.href).hostname;
|
|
6389
|
-
if (targetDomain === currentDomain) {
|
|
6390
|
-
return `<a href="${href.href}" data-internal-link="true">${href.text}</a>`;
|
|
6391
|
-
}
|
|
6392
|
-
return `<a href="${href.href}" target="_blank" rel="noopener noreferrer">${href.text}</a>`;
|
|
6393
|
-
};
|
|
6394
|
-
marked.setOptions({
|
|
6395
|
-
breaks: true,
|
|
6396
|
-
sanitize: false,
|
|
6397
|
-
renderer
|
|
6398
|
-
});
|
|
6399
|
-
return marked(text);
|
|
6426
|
+
_shouldType() {
|
|
6427
|
+
return this.stream || this.chatType === "ai" && this.userOrOther !== "user";
|
|
6400
6428
|
}
|
|
6401
6429
|
},
|
|
6430
|
+
watch: {
|
|
6431
|
+
message(newVal, oldVal) {
|
|
6432
|
+
this.stopTypewriter();
|
|
6433
|
+
if (this._shouldType && newVal && this._hasMounted && this.item.source === "socket") {
|
|
6434
|
+
this.isTyping = true;
|
|
6435
|
+
this._typeController = this.typewriterRender2(newVal, {
|
|
6436
|
+
speed: this.typeSpeed,
|
|
6437
|
+
chunk: this.chunk,
|
|
6438
|
+
charsPerRender: this.charsPerRender,
|
|
6439
|
+
onUpdate: html2 => {
|
|
6440
|
+
this.displayedHtml = html2;
|
|
6441
|
+
},
|
|
6442
|
+
onComplete: () => {
|
|
6443
|
+
this.isTyping = false;
|
|
6444
|
+
this.$nextTick(() => {
|
|
6445
|
+
this.$emit("toBottom");
|
|
6446
|
+
});
|
|
6447
|
+
}
|
|
6448
|
+
});
|
|
6449
|
+
} else {
|
|
6450
|
+
this.displayedHtml = this.renderFull(newVal || "");
|
|
6451
|
+
this.isTyping = false;
|
|
6452
|
+
}
|
|
6453
|
+
}
|
|
6454
|
+
},
|
|
6455
|
+
mounted() {
|
|
6456
|
+
this.displayedHtml = this.renderFull(this.message || "");
|
|
6457
|
+
this.isTyping = false;
|
|
6458
|
+
this.$nextTick(() => {
|
|
6459
|
+
this._hasMounted = true;
|
|
6460
|
+
});
|
|
6461
|
+
},
|
|
6462
|
+
beforeDestroy() {
|
|
6463
|
+
this.stopTypewriter();
|
|
6464
|
+
},
|
|
6402
6465
|
methods: {
|
|
6403
|
-
|
|
6404
|
-
|
|
6466
|
+
renderFull(src) {
|
|
6467
|
+
const text = (src || "").replace(/ {2,}/g, match => " ".repeat(match.length));
|
|
6468
|
+
return marked(text);
|
|
6469
|
+
},
|
|
6470
|
+
typewriterRender(message, opts = {}) {
|
|
6471
|
+
const speed = typeof opts.speed === "number" ? opts.speed : 40;
|
|
6472
|
+
const chunk = Math.max(1, typeof opts.chunk === "number" ? opts.chunk : 1);
|
|
6473
|
+
const charsPerRender = Math.max(1, typeof opts.charsPerRender === "number" ? opts.charsPerRender : 3);
|
|
6474
|
+
const onUpdate = typeof opts.onUpdate === "function" ? opts.onUpdate : html2 => {
|
|
6475
|
+
this.displayedHtml = html2;
|
|
6476
|
+
};
|
|
6477
|
+
const onComplete = typeof opts.onComplete === "function" ? opts.onComplete : () => {};
|
|
6478
|
+
if (!message) {
|
|
6479
|
+
onUpdate("");
|
|
6480
|
+
onComplete();
|
|
6481
|
+
return {
|
|
6482
|
+
stop() {}
|
|
6483
|
+
};
|
|
6484
|
+
}
|
|
6485
|
+
const preprocess = s => (s || "").replace(/ {2,}/g, m => " ".repeat(m.length));
|
|
6486
|
+
const src = preprocess(message);
|
|
6487
|
+
const len = src.length;
|
|
6488
|
+
let index = 0;
|
|
6489
|
+
let stopped = false;
|
|
6490
|
+
let timer = null;
|
|
6491
|
+
const step = () => {
|
|
6492
|
+
if (stopped) return;
|
|
6493
|
+
index = Math.min(len, index + chunk);
|
|
6494
|
+
if (index % charsPerRender === 0 || index === len) {
|
|
6495
|
+
try {
|
|
6496
|
+
const html2 = marked(src.slice(0, index));
|
|
6497
|
+
onUpdate(html2);
|
|
6498
|
+
} catch (err) {
|
|
6499
|
+
onUpdate(marked(src));
|
|
6500
|
+
stopped = true;
|
|
6501
|
+
onComplete();
|
|
6502
|
+
return;
|
|
6503
|
+
}
|
|
6504
|
+
}
|
|
6505
|
+
if (index >= len) {
|
|
6506
|
+
stopped = true;
|
|
6507
|
+
onComplete();
|
|
6508
|
+
return;
|
|
6509
|
+
}
|
|
6510
|
+
timer = setTimeout(step, speed);
|
|
6511
|
+
};
|
|
6512
|
+
timer = setTimeout(step, speed);
|
|
6513
|
+
return {
|
|
6514
|
+
stop() {
|
|
6515
|
+
stopped = true;
|
|
6516
|
+
if (timer) {
|
|
6517
|
+
clearTimeout(timer);
|
|
6518
|
+
timer = null;
|
|
6519
|
+
}
|
|
6520
|
+
}
|
|
6521
|
+
};
|
|
6522
|
+
},
|
|
6523
|
+
// 避免打出a标签
|
|
6524
|
+
typewriterRender2(message, {
|
|
6525
|
+
speed = 40,
|
|
6526
|
+
chunk = 1,
|
|
6527
|
+
charsPerRender = 3,
|
|
6528
|
+
onUpdate
|
|
6529
|
+
}) {
|
|
6530
|
+
const preprocess = s => (s || "").replace(/ {2,}/g, m => " ".repeat(m.length));
|
|
6531
|
+
const fullHtml = marked(preprocess(message));
|
|
6532
|
+
const temp = document.createElement("div");
|
|
6533
|
+
temp.innerHTML = fullHtml;
|
|
6534
|
+
const textNodes = [],
|
|
6535
|
+
originals = [];
|
|
6536
|
+
(function walk(node) {
|
|
6537
|
+
node.childNodes.forEach(n => {
|
|
6538
|
+
if (n.nodeType === Node.TEXT_NODE) {
|
|
6539
|
+
textNodes.push(n);
|
|
6540
|
+
originals.push(n.data || "");
|
|
6541
|
+
} else {
|
|
6542
|
+
walk(n);
|
|
6543
|
+
}
|
|
6544
|
+
});
|
|
6545
|
+
})(temp);
|
|
6546
|
+
textNodes.forEach(n => n.data = "");
|
|
6547
|
+
const shown = new Array(textNodes.length).fill(0);
|
|
6548
|
+
let nodeIndex = 0,
|
|
6549
|
+
totalShown = 0,
|
|
6550
|
+
stopped = false,
|
|
6551
|
+
timer = null;
|
|
6552
|
+
const step = () => {
|
|
6553
|
+
if (stopped) return;
|
|
6554
|
+
let rem = chunk;
|
|
6555
|
+
while (rem > 0 && nodeIndex < textNodes.length) {
|
|
6556
|
+
const full = originals[nodeIndex];
|
|
6557
|
+
const cur = shown[nodeIndex];
|
|
6558
|
+
const add = Math.min(rem, full.length - cur);
|
|
6559
|
+
if (add > 0) {
|
|
6560
|
+
shown[nodeIndex] = cur + add;
|
|
6561
|
+
textNodes[nodeIndex].data = full.slice(0, shown[nodeIndex]);
|
|
6562
|
+
rem -= add;
|
|
6563
|
+
totalShown += add;
|
|
6564
|
+
if (shown[nodeIndex] >= full.length) nodeIndex++;
|
|
6565
|
+
} else nodeIndex++;
|
|
6566
|
+
}
|
|
6567
|
+
if (totalShown % charsPerRender === 0 || nodeIndex >= textNodes.length) {
|
|
6568
|
+
onUpdate(temp.innerHTML);
|
|
6569
|
+
}
|
|
6570
|
+
if (nodeIndex >= textNodes.length) {
|
|
6571
|
+
stopped = true;
|
|
6572
|
+
return;
|
|
6573
|
+
}
|
|
6574
|
+
timer = setTimeout(step, speed);
|
|
6575
|
+
};
|
|
6576
|
+
timer = setTimeout(step, speed);
|
|
6577
|
+
return {
|
|
6578
|
+
stop() {
|
|
6579
|
+
stopped = true;
|
|
6580
|
+
if (timer) clearTimeout(timer);
|
|
6581
|
+
}
|
|
6582
|
+
};
|
|
6583
|
+
},
|
|
6584
|
+
stopTypewriter() {
|
|
6585
|
+
if (this._typeController && typeof this._typeController.stop === "function") {
|
|
6586
|
+
this._typeController.stop();
|
|
6587
|
+
}
|
|
6588
|
+
this._typeController = null;
|
|
6589
|
+
this.isTyping = false;
|
|
6590
|
+
},
|
|
6591
|
+
// 点击消息:若正在打字则跳过,直接显示完整内容
|
|
6592
|
+
handleLinkClick(e) {
|
|
6593
|
+
if (e.target.tagName === "A") {
|
|
6594
|
+
e.preventDefault();
|
|
6595
|
+
const href = e.target.getAttribute("href");
|
|
6596
|
+
this.handleInternalLink(href);
|
|
6405
6597
|
return;
|
|
6406
6598
|
}
|
|
6599
|
+
if (this._typeController) {
|
|
6600
|
+
this.stopTypewriter();
|
|
6601
|
+
this.displayedHtml = this.renderFull(this.message || "");
|
|
6602
|
+
}
|
|
6603
|
+
},
|
|
6604
|
+
handleInternalLink(href) {
|
|
6605
|
+
try {
|
|
6606
|
+
const currentDomain = window.location.hostname;
|
|
6607
|
+
const targetDomain = new URL(href).hostname;
|
|
6608
|
+
if (targetDomain === currentDomain) {
|
|
6609
|
+
const path = new URL(href).pathname + new URL(href).search + new URL(href).hash;
|
|
6610
|
+
if (this.$router) this.$router.push(path);else window.location.href = href;
|
|
6611
|
+
} else {
|
|
6612
|
+
window.open(href, "_blank");
|
|
6613
|
+
}
|
|
6614
|
+
} catch (err) {
|
|
6615
|
+
window.open(href, "_blank");
|
|
6616
|
+
}
|
|
6617
|
+
},
|
|
6618
|
+
async changeByHumanAgent() {
|
|
6619
|
+
var _a2;
|
|
6620
|
+
if ((_a2 = this.activeItem) == null ? void 0 : _a2.assigned) return;
|
|
6407
6621
|
this.$emit("changeTopToast", "Searching for agent");
|
|
6408
6622
|
try {
|
|
6409
6623
|
await updateRoomByHumanAgent({
|
|
@@ -6430,7 +6644,7 @@ const __vue2_script$4 = {
|
|
|
6430
6644
|
}
|
|
6431
6645
|
return;
|
|
6432
6646
|
}
|
|
6433
|
-
if (this.email && !this.email.match(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((
|
|
6647
|
+
if (this.email && !this.email.match(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/)) {
|
|
6434
6648
|
if (this.$sweetalert) {
|
|
6435
6649
|
this.$sweetalert.insert({
|
|
6436
6650
|
title: "Something went wrong",
|
|
@@ -6462,7 +6676,7 @@ const __vue2_script$4 = {
|
|
|
6462
6676
|
}
|
|
6463
6677
|
return;
|
|
6464
6678
|
}
|
|
6465
|
-
if (this.clientEmail && !this.clientEmail.match(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((
|
|
6679
|
+
if (this.clientEmail && !this.clientEmail.match(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/)) {
|
|
6466
6680
|
if (this.$sweetalert) {
|
|
6467
6681
|
this.$sweetalert.insert({
|
|
6468
6682
|
title: "Something went wrong",
|
|
@@ -6507,32 +6721,11 @@ const __vue2_script$4 = {
|
|
|
6507
6721
|
question: this.clientQuestion,
|
|
6508
6722
|
updateTime: this.updateTime
|
|
6509
6723
|
});
|
|
6510
|
-
},
|
|
6511
|
-
handleLinkClick(e) {
|
|
6512
|
-
if (e.target.tagName === "A") {
|
|
6513
|
-
e.preventDefault();
|
|
6514
|
-
const href = e.target.getAttribute("href");
|
|
6515
|
-
this.handleInternalLink(href);
|
|
6516
|
-
}
|
|
6517
|
-
},
|
|
6518
|
-
handleInternalLink(href) {
|
|
6519
|
-
const currentDomain = window.location.hostname;
|
|
6520
|
-
const targetDomain = new URL(href).hostname;
|
|
6521
|
-
if (targetDomain === currentDomain) {
|
|
6522
|
-
const path = new URL(href).pathname + new URL(href).search + new URL(href).hash;
|
|
6523
|
-
if (this.$router) {
|
|
6524
|
-
this.$router.push(path);
|
|
6525
|
-
} else {
|
|
6526
|
-
window.location.href = href;
|
|
6527
|
-
}
|
|
6528
|
-
} else {
|
|
6529
|
-
window.open(href, "_blank");
|
|
6530
|
-
}
|
|
6531
6724
|
}
|
|
6532
6725
|
}
|
|
6533
6726
|
};
|
|
6534
6727
|
const __cssModules$4 = {};
|
|
6535
|
-
var __component__$4 = /* @__PURE__ */normalizeComponent(__vue2_script$4, render$5, staticRenderFns$4, false, __vue2_injectStyles$4, "
|
|
6728
|
+
var __component__$4 = /* @__PURE__ */normalizeComponent(__vue2_script$4, render$5, staticRenderFns$4, false, __vue2_injectStyles$4, "595d5dd5", null, null);
|
|
6536
6729
|
function __vue2_injectStyles$4(context) {
|
|
6537
6730
|
for (let o in __cssModules$4) {
|
|
6538
6731
|
this[o] = __cssModules$4[o];
|
|
@@ -6588,7 +6781,8 @@ var render$3 = function () {
|
|
|
6588
6781
|
on: {
|
|
6589
6782
|
"submitEmail": _vm.submitEmail,
|
|
6590
6783
|
"sendLeaveMessage": _vm.sendLeaveMessage,
|
|
6591
|
-
"changeTopToast": _vm.changeTopToast
|
|
6784
|
+
"changeTopToast": _vm.changeTopToast,
|
|
6785
|
+
"toBottom": _vm.scrollToBottom
|
|
6592
6786
|
}
|
|
6593
6787
|
});
|
|
6594
6788
|
}), 1)], 1), _vm.activeItem.status === "3" ? _c("div", {
|
|
@@ -6803,7 +6997,7 @@ const __vue2_script$3 = {
|
|
|
6803
6997
|
}
|
|
6804
6998
|
};
|
|
6805
6999
|
const __cssModules$3 = {};
|
|
6806
|
-
var __component__$3 = /* @__PURE__ */normalizeComponent(__vue2_script$3, render$3, staticRenderFns$3, false, __vue2_injectStyles$3, "
|
|
7000
|
+
var __component__$3 = /* @__PURE__ */normalizeComponent(__vue2_script$3, render$3, staticRenderFns$3, false, __vue2_injectStyles$3, "07011d53", null, null);
|
|
6807
7001
|
function __vue2_injectStyles$3(context) {
|
|
6808
7002
|
for (let o in __cssModules$3) {
|
|
6809
7003
|
this[o] = __cssModules$3[o];
|
|
@@ -6930,7 +7124,8 @@ const __vue2_script$2 = {
|
|
|
6930
7124
|
avatar: item.avatar || "",
|
|
6931
7125
|
time: chatShowDateTime(item.updateTime),
|
|
6932
7126
|
updateTime: item.updateTime,
|
|
6933
|
-
type: item.type || 1
|
|
7127
|
+
type: item.type || 1,
|
|
7128
|
+
source: item.source || ""
|
|
6934
7129
|
};
|
|
6935
7130
|
});
|
|
6936
7131
|
return list2;
|
|
@@ -6995,7 +7190,7 @@ const __vue2_script$2 = {
|
|
|
6995
7190
|
onListenMessage() {
|
|
6996
7191
|
this.socket.on("message", message => {
|
|
6997
7192
|
if (message.roomId === this.onRoomId) {
|
|
6998
|
-
this.pushChat(message);
|
|
7193
|
+
this.pushChat(message, "socket");
|
|
6999
7194
|
this.scrollToBottom();
|
|
7000
7195
|
if (message.type === 7 && this.$refs.dialogComponent) {
|
|
7001
7196
|
this.$refs.dialogComponent.changePauseConversation(true);
|
|
@@ -7120,7 +7315,7 @@ const __vue2_script$2 = {
|
|
|
7120
7315
|
logOut() {
|
|
7121
7316
|
this.socket.emit("logOut");
|
|
7122
7317
|
},
|
|
7123
|
-
pushChat(data) {
|
|
7318
|
+
pushChat(data, source) {
|
|
7124
7319
|
const {
|
|
7125
7320
|
userId,
|
|
7126
7321
|
message,
|
|
@@ -7132,14 +7327,18 @@ const __vue2_script$2 = {
|
|
|
7132
7327
|
type
|
|
7133
7328
|
} = data;
|
|
7134
7329
|
if (data.chatType === "ai") {
|
|
7135
|
-
const
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
this.chats.chatList
|
|
7330
|
+
const thinkingIndex = this.chats.chatList.findIndex(item => item.chatType === "ai-thinking" && item.thinkingCode === data.thinkingCode);
|
|
7331
|
+
const waitingIndex = this.chats.chatList.findIndex(item => item.chatType === "ai-thinking-waiting" && item.thinkingCode === data.thinkingCode);
|
|
7332
|
+
if (thinkingIndex !== -1) {
|
|
7333
|
+
const exist = this.chats.chatList[thinkingIndex];
|
|
7334
|
+
this.chats.chatList.splice(thinkingIndex, 1, {
|
|
7139
7335
|
...data,
|
|
7140
|
-
updateTime:
|
|
7141
|
-
|
|
7336
|
+
updateTime: exist.updateTime,
|
|
7337
|
+
source: source || ""
|
|
7142
7338
|
});
|
|
7339
|
+
if (waitingIndex !== -1 && waitingIndex !== thinkingIndex) {
|
|
7340
|
+
this.chats.chatList.splice(waitingIndex, 1);
|
|
7341
|
+
}
|
|
7143
7342
|
return;
|
|
7144
7343
|
}
|
|
7145
7344
|
}
|
|
@@ -7153,7 +7352,8 @@ const __vue2_script$2 = {
|
|
|
7153
7352
|
chatAction,
|
|
7154
7353
|
roomId,
|
|
7155
7354
|
thinkingCode: data.thinkingCode || "",
|
|
7156
|
-
type
|
|
7355
|
+
type,
|
|
7356
|
+
source: source || ""
|
|
7157
7357
|
});
|
|
7158
7358
|
},
|
|
7159
7359
|
handleSend(message) {
|
|
@@ -7274,7 +7474,7 @@ const __vue2_script$2 = {
|
|
|
7274
7474
|
}
|
|
7275
7475
|
};
|
|
7276
7476
|
const __cssModules$2 = {};
|
|
7277
|
-
var __component__$2 = /* @__PURE__ */normalizeComponent(__vue2_script$2, render$2, staticRenderFns$2, false, __vue2_injectStyles$2, "
|
|
7477
|
+
var __component__$2 = /* @__PURE__ */normalizeComponent(__vue2_script$2, render$2, staticRenderFns$2, false, __vue2_injectStyles$2, "253fc2e7", null, null);
|
|
7278
7478
|
function __vue2_injectStyles$2(context) {
|
|
7279
7479
|
for (let o in __cssModules$2) {
|
|
7280
7480
|
this[o] = __cssModules$2[o];
|
|
@@ -7646,8 +7846,10 @@ const __vue2_script = {
|
|
|
7646
7846
|
this.updateOpenView(false);
|
|
7647
7847
|
}
|
|
7648
7848
|
if (route === "dialog") {
|
|
7649
|
-
|
|
7650
|
-
|
|
7849
|
+
setTimeout(() => {
|
|
7850
|
+
this.updateOpenView(true);
|
|
7851
|
+
this.clearClinetUnRead();
|
|
7852
|
+
}, 300);
|
|
7651
7853
|
}
|
|
7652
7854
|
},
|
|
7653
7855
|
initAudio() {
|