byt-lingxiao-ai 0.3.3 → 0.3.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/components/AiMessage.vue +5 -5
- package/components/ChatWindow.vue +5 -0
- package/components/ChatWindowDialog.vue +5 -1
- package/components/ChatWindowHeader.vue +7 -3
- package/components/config/index.js +1 -1
- package/components/mixins/audioMixin.js +22 -12
- package/components/mixins/messageMixin.js +6 -5
- package/components/mixins/webSocketMixin.js +13 -0
- package/components/utils/Cookie.js +19 -0
- package/components/utils/StreamParser.js +9 -0
- package/components/utils/Uuid.js +6 -0
- package/components/utils/WorkletSource.js +27 -0
- package/dist/index.common.js +126 -54
- package/dist/index.common.js.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.umd.js +126 -54
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.chat-robot[data-v-ad4ce922]{width:150px;height:200px}.chat-robot.entering[data-v-ad4ce922]{background-image:url(img/entering.4ef198fb.png);background-size:cover}.chat-robot.waiting[data-v-ad4ce922]{background-image:url(img/waiting.460478ef.png);background-size:cover}.chat-robot.speaking[data-v-ad4ce922]{background-image:url(img/speaking.fa87fedb.png);background-size:cover}.chat-ai[data-v-45540794]{display:flex;width:38px;padding:2px 2px 9px 2px;flex-direction:column;align-items:center;gap:6px;border-radius:40px;background:linear-gradient(180deg,#3e5beb,#5ca5f9);box-shadow:0 2px 11.6px 0 rgba(0,0,0,.1);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:box-shadow .2s}.chat-ai[data-v-45540794]:hover{box-shadow:0 4px 16px 0 rgba(0,0,0,.2)}.chat-ai[data-v-45540794]:active{cursor:grabbing}.chat-ai-avater[data-v-45540794]{border-radius:67px;border:1px solid #0f66e4;background:#124087;display:flex;width:34px;height:33px;padding:2px 2px 1px 2px;justify-content:center;align-items:center;background-size:cover;background-position:50%}.chat-ai-avater.normal[data-v-45540794]{background-image:url(img/normal.30197a82.png)}.chat-ai-avater.thinking[data-v-45540794]{background-image:url(img/thinking.21ad5ca5.png)}.chat-ai-avater.output[data-v-45540794]{background-image:url(img/output.1dfa94eb.png)}.chat-ai-text[data-v-45540794]{color:#fff;font-family:PingFang SC;font-size:16px;font-style:normal;font-weight:500;line-height:20px;align-self:stretch;display:flex;align-items:center;width:20px;margin:0 auto;text-align:center}.chat-window-header[data-v-
|
|
1
|
+
.chat-robot[data-v-ad4ce922]{width:150px;height:200px}.chat-robot.entering[data-v-ad4ce922]{background-image:url(img/entering.4ef198fb.png);background-size:cover}.chat-robot.waiting[data-v-ad4ce922]{background-image:url(img/waiting.460478ef.png);background-size:cover}.chat-robot.speaking[data-v-ad4ce922]{background-image:url(img/speaking.fa87fedb.png);background-size:cover}.chat-ai[data-v-45540794]{display:flex;width:38px;padding:2px 2px 9px 2px;flex-direction:column;align-items:center;gap:6px;border-radius:40px;background:linear-gradient(180deg,#3e5beb,#5ca5f9);box-shadow:0 2px 11.6px 0 rgba(0,0,0,.1);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:box-shadow .2s}.chat-ai[data-v-45540794]:hover{box-shadow:0 4px 16px 0 rgba(0,0,0,.2)}.chat-ai[data-v-45540794]:active{cursor:grabbing}.chat-ai-avater[data-v-45540794]{border-radius:67px;border:1px solid #0f66e4;background:#124087;display:flex;width:34px;height:33px;padding:2px 2px 1px 2px;justify-content:center;align-items:center;background-size:cover;background-position:50%}.chat-ai-avater.normal[data-v-45540794]{background-image:url(img/normal.30197a82.png)}.chat-ai-avater.thinking[data-v-45540794]{background-image:url(img/thinking.21ad5ca5.png)}.chat-ai-avater.output[data-v-45540794]{background-image:url(img/output.1dfa94eb.png)}.chat-ai-text[data-v-45540794]{color:#fff;font-family:PingFang SC;font-size:16px;font-style:normal;font-weight:500;line-height:20px;align-self:stretch;display:flex;align-items:center;width:20px;margin:0 auto;text-align:center}.chat-window-header[data-v-90d9b166]{display:flex;align-items:center;border-bottom:1px solid #eaeaea;background:#fff;padding:16px;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chat-window-header-title[data-v-90d9b166]{color:#29414e;font-size:18px;font-weight:900;position:relative;padding-left:36px}.chat-window-header-open[data-v-90d9b166]{width:24px;height:24px;overflow:hidden;margin-left:auto;margin-right:20px;cursor:pointer}.chat-window-header-title[data-v-90d9b166]:before{content:"";position:absolute;left:0;top:50%;transform:translateY(-50%);width:32px;height:32px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAABVlBMVEUAAABIZOyWtvucufuNsvx2nfkxUOhIaOwmReYoSOVcf/KgvvsrSeWvyf2bufeBp/phg/M7Weq/z/9Ma+9Lau5DYO14l/ZDYOtSdPCMsPuLr/tTc/AvT+clReRZevCYuftggfKfwf2oxf01Uuenxv6Xt/s2U+lScetFZepihfQ7WOp+pfp3lvV3lfVafPJafPBegPGYu/2Qsv1mh/OBo/p6n/d7ofp7nvpkg/Ngg+9FZe9GYu+vz/9ojPWAq/yJtf6Fr/2BrPyFrPuFsf1+p/tulPhrkfdihfSMuP+Drv12nvlymvlZe/JUdPF4ovpcfvNObe+RvP+Hs/56o/t9pfpwl/hMae5FYu2Pu/9/qfx0m/lkiPVnhfNWd/JRcfBJZ+5HZe1DYexBXuw/XOs7W+o5Vuo3VemOs/yCqvt8pftojfYvTed3oPp7n/hfgvRegfOCpvkvTeilAxCMAAAAPXRSTlMAIJ9P79/fv6+Ab0BAPyDv798Q7+/v39/Pv7+/v7+vkI9/cGBfX19AMO/f3s/Pr6+Qj4+Ab2BfX0BAMC8QOqPNlAAAAc9JREFUOMvNklVz23AQxB3JHGOYqUmTMnP/JGbJIMnM7ED7/V+aTj2q7CTvubed/e3NzdwGHtucHx1E9qOxxAN2PAME1SiC3jT89B57aVe7qQq2MiZMe9DPLi3631cbdVMEfMUoY+x0O+sXC/nNpqWb4oRXlSLJ/3JbzbX5Hc87LUt/SZ3QH0MFyJZqjtXY8vtP+l23NsxJKHecSnMYDfW6psV9QHjgXpVQnpVJMElzJJ/bMM3rzH8/MW1jxGICR9TPQGAHYokSxSr46gGxHoNlWOa2l/+qZUZGpwAI/AcPiAICuUL6bCbfQ4nmeVs98IA9pmgooVRyJleCh5/UinIZ8YCIoVTsL++CKzOdTIWUwpjZ84A3qs0LtEQOZ/osXRiXCYh6wJEgTMApkpl/R25zZSizTC/mAd9AVRQpiYU7twdQI0gwi5j2b9/bn92Y2kYuTzg6GbwN51HpyhmE/VXQ6roeRJh7kTqWkJQb1txuf64UWw3LqZVYWAh9pk+oV7rV6mTn373WbLkMkrlLlZ+Imm41Nxcqc7He6ToYQ6PCA9GsN1Z/3Klctj9oj0hRsYXqtbbr5f2lCE97oGioAsjEH+h1Ihbdj7x+ex54ZPMHPwRk1/kdiX4AAAAASUVORK5CYII=);background-size:cover}.chat-window-header-close[data-v-90d9b166]{width:24px;height:24px;overflow:hidden;cursor:pointer}.chat-window-message-user[data-v-6a2b6167]{display:flex;justify-content:flex-end}.user-message[data-v-6a2b6167]{max-width:80%;display:flex;padding:8px 12px;justify-content:center;align-items:center;gap:10px;border-radius:12px;background:#e3ecff}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}
|
|
2
2
|
/*!
|
|
3
3
|
Theme: GitHub
|
|
4
4
|
Description: Light theme as seen on github.com
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
Outdated base version: https://github.com/primer/github-syntax-light
|
|
10
10
|
Current colors taken from GitHub's CSS
|
|
11
|
-
*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}.ai-loading[data-v-
|
|
11
|
+
*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}.ai-loading[data-v-2422d7c0]{display:flex;align-items:center;padding:12px 0;height:24px}.dot[data-v-2422d7c0]{width:8px;height:8px;margin-right:6px;background-color:#86909c;border-radius:50%;animation:dot-bounce-2422d7c0 1.4s ease-in-out infinite both}.dot[data-v-2422d7c0]:first-child{animation-delay:-.32s}.dot[data-v-2422d7c0]:nth-child(2){animation-delay:-.16s}.dot[data-v-2422d7c0]:nth-child(3){animation-delay:0s}@keyframes dot-bounce-2422d7c0{0%,80%,to{transform:scale(0);opacity:.5}40%{transform:scale(1);opacity:1}}.chat-window-message-ai[data-v-2422d7c0]{display:flex;gap:12px;align-items:flex-start;max-width:100%;border-radius:12px;background:#f6f8fc;padding:8px 12px}.ai-render[data-v-2422d7c0]{width:100%}.ai-thinking[data-v-2422d7c0]{margin-bottom:8px}.ai-thinking-time[data-v-2422d7c0]{border-radius:9px;background:#ecedf4;color:#86909c;font-family:"Alibaba PuHuiTi 2.0";font-size:16px;font-style:normal;font-weight:500;padding:0 30px 0 30px;height:28px;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer}.ai-thinking-time[data-v-2422d7c0]:before{left:6px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAAAYFBMVEUAAADu8P/u8P/u8P/u8P/u8P/u8P/s7//v8v/s7//v7//t7//v8f/u8P/l6P/Iz/+stv+1v//S1/9Xbf/b3/+/x/+irv/b4P+Zpv9yhP+Pnv+Glv+Qnv99jf9hdf/R1/8RfKwjAAAADXRSTlMA36/vz5CAYF9QEHBvMEqmkAAAAM9JREFUGNNNkIkSgyAMRAG1niEoouDV///LJvFqZmDgkZ0Nq6SazmiA3FTqrTqDq/SDC7nbE39O9iHQA/S0HL0UzEppG3gfpbsmqPnwXcFtsAQ+Zw032ol7A2vBkaRVRsRpOPbN44r8YFTOinmxKbpjjKPMpQAGmCx6R/6+h2gRgCDe0BGcgKEWecQUpzSuMll+Gs07+rR63C+j9hppDoFdHG2VaiQMXMAtsAUx54jeb87yzeoOibwDh2L/Y3qrUFeV+kYZR/Rgk5OD6Rq5/QAhCBJvrLC2lgAAAABJRU5ErkJggg==) no-repeat;background-size:cover}.ai-thinking-time[data-v-2422d7c0]:after,.ai-thinking-time[data-v-2422d7c0]:before{content:"";position:absolute;top:50%;transform:translateY(-50%);width:16px;height:16px}.ai-thinking-time[data-v-2422d7c0]:after{right:6px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEUAAACDj5eGkJyGj5uFj5uGj5uAj5/flAqRAAAAB3RSTlMAIN+ggHAQx7ts8QAAAClJREFUCNdjIBWwCUAZQooQmlHZSAAiYMCsCBFgYAALsRowMDA7kGY8AIDkAfQcVWSDAAAAAElFTkSuQmCC) no-repeat;background-size:cover}.ai-thinking-content[data-v-2422d7c0]{color:#86909c;font-size:14px;padding:8px 0 8px 12px}.ai-content[data-v-2422d7c0],.ai-thinking-content[data-v-2422d7c0]{font-family:"Alibaba PuHuiTi 2.0";font-style:normal;font-weight:400;line-height:24px}.ai-content[data-v-2422d7c0]{color:#4e5969;font-size:16px}.markdown-body[data-v-2422d7c0]{word-wrap:break-word}.markdown-body[data-v-2422d7c0] h1,.markdown-body[data-v-2422d7c0] h2,.markdown-body[data-v-2422d7c0] h3,.markdown-body[data-v-2422d7c0] h4{margin:16px 0 8px 0;font-weight:600;line-height:1.4;color:#1f2937}.markdown-body[data-v-2422d7c0] h1{font-size:24px;border-bottom:2px solid #e5e7eb;padding-bottom:8px}.markdown-body[data-v-2422d7c0] h2{font-size:20px;border-bottom:1px solid #e5e7eb;padding-bottom:6px}.markdown-body[data-v-2422d7c0] h3{font-size:18px}.markdown-body[data-v-2422d7c0] h4{font-size:16px}.markdown-body[data-v-2422d7c0] code{background-color:rgba(175,184,193,.2);border-radius:3px;font-size:85%;margin:0;padding:.2em .4em;font-family:Monaco,Menlo,Consolas,Courier New,monospace;color:#e83e8c}.markdown-body[data-v-2422d7c0] pre{background-color:#f6f8fa;border-radius:6px;padding:16px;overflow:auto;margin:12px 0;border:1px solid #e1e4e8}.markdown-body[data-v-2422d7c0] pre code{background-color:transparent;border:0;display:inline;line-height:inherit;margin:0;overflow:visible;padding:0;word-wrap:normal;color:#24292e;font-size:14px}.markdown-body[data-v-2422d7c0] .table-wrapper{overflow-x:auto;border:1px solid #dfe2e5;margin:12px 0}.markdown-body[data-v-2422d7c0] .markdown-table{border-collapse:collapse;width:100%;font-size:14px;box-shadow:0 1px 3px rgba(0,0,0,.1);overflow:hidden;margin:-1px 0 0 -1px}.markdown-body[data-v-2422d7c0] .table-wrapper::-webkit-scrollbar{height:6px}.markdown-body[data-v-2422d7c0] .table-wrapper::-webkit-scrollbar-track{background-color:#f3f4f6}.markdown-body[data-v-2422d7c0] .table-wrapper::-webkit-scrollbar-thumb{background-color:#d1d5db;border-radius:3px}.markdown-body[data-v-2422d7c0] .table-wrapper::-webkit-scrollbar-thumb:hover{background-color:#9ca3af}.markdown-body[data-v-2422d7c0] .table-cell{min-width:100px;text-align:left}.markdown-body[data-v-2422d7c0] .markdown-table td,.markdown-body[data-v-2422d7c0] .markdown-table th{border:1px solid #dfe2e5;padding:10px 14px;text-align:left}.markdown-body[data-v-2422d7c0] .markdown-table th{background-color:#f3f4f6;font-weight:600;color:#374151}.markdown-body[data-v-2422d7c0] .markdown-table tr:nth-child(2n){background-color:#f9fafb}.markdown-body[data-v-2422d7c0] .markdown-table tr:hover{background-color:#f3f4f6;transition:background-color .2s}.markdown-body[data-v-2422d7c0] ol,.markdown-body[data-v-2422d7c0] ul{padding-left:24px;margin:8px 0}.markdown-body[data-v-2422d7c0] li{margin:4px 0;line-height:1.6}.markdown-body[data-v-2422d7c0] strong{font-weight:600;color:#1f2937}.markdown-body[data-v-2422d7c0] em{font-style:italic}.markdown-body[data-v-2422d7c0] del{text-decoration:line-through;opacity:.7}.markdown-body[data-v-2422d7c0] blockquote{border-left:4px solid #dfe2e5;padding-left:16px;margin:12px 0;color:#6b7280;font-style:italic}.markdown-body[data-v-2422d7c0] a{color:#3b82f6;text-decoration:none}.markdown-body[data-v-2422d7c0] a:hover{text-decoration:underline;color:#2563eb}.markdown-body[data-v-2422d7c0] img{max-width:100%;border-radius:6px;margin:12px 0}.markdown-body[data-v-2422d7c0] hr{border:none;border-top:1px solid #e5e7eb;margin:16px 0}.markdown-body[data-v-2422d7c0] br{line-height:.8em}.chat-window-empty[data-v-dfc4454c]{width:300px;height:300px;background:url(img/empty.f36cb82e.png) no-repeat;background-size:cover;margin:auto}.chat-window-content[data-v-dfc4454c]{flex:1;padding:16px;overflow-y:auto;display:flex;flex-direction:column;gap:8px}.scrollbar-hide[data-v-dfc4454c]::-webkit-scrollbar{display:none}.scrollbar-hide[data-v-dfc4454c]{-ms-overflow-style:none;scrollbar-width:none}[data-v-6f416073] .el-textarea__inner{border:none!important;padding:0 5px;font-family:PingFang SC!important}[data-v-6f416073] .el-textarea__inner::-webkit-scrollbar{width:6px;height:6px}[data-v-6f416073] .el-textarea__inner::-webkit-scrollbar-thumb{background:rgba(0,0,0,.1);border-radius:3px}[data-v-6f416073] .el-textarea__inner::-webkit-scrollbar-track{background:transparent}.chat-window-footer[data-v-6f416073]{padding:16px}.chat-window-textarea[data-v-6f416073]{min-height:99px;max-height:180px;border-radius:8px;border:1px solid #f2f2f2;background:#fff;display:flex;flex-direction:column}.chat-window-input[data-v-6f416073]{padding:10px 12px;font-size:16px;font-family:PingFang SC}.chat-window-bar[data-v-6f416073]{display:flex;justify-content:flex-end;padding:8px}.chat-window-send[data-v-6f416073]{width:70px;height:36px;flex-shrink:0;border-radius:6px;background:rgba(43,128,246,.1);display:flex;align-items:center;justify-content:center;cursor:pointer}.chat-overlay[data-v-23a76780]{position:fixed;top:0;left:0;width:100%;height:100%;background:transparent;z-index:10000}.chat-window[data-v-23a76780]{width:480px;height:740px;border-radius:14px;background:#fff;box-shadow:0 2px 20px 0 rgba(0,0,0,.16);position:absolute;bottom:20px;right:60px;overflow:hidden;display:flex;flex-direction:column}.hidden-audio[data-v-0e3e6d50]{position:absolute;left:-9999px;opacity:0;pointer-events:none}.chat[data-v-0e3e6d50]{position:fixed;bottom:20px;right:10px;z-index:10001}
|
package/dist/index.umd.js
CHANGED
|
@@ -28460,7 +28460,7 @@ if (typeof window !== 'undefined') {
|
|
|
28460
28460
|
var es_iterator_constructor = __webpack_require__(8111);
|
|
28461
28461
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.for-each.js
|
|
28462
28462
|
var es_iterator_for_each = __webpack_require__(7588);
|
|
28463
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindow.vue?vue&type=template&id=
|
|
28463
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindow.vue?vue&type=template&id=0e3e6d50&scoped=true
|
|
28464
28464
|
var render = function render() {
|
|
28465
28465
|
var _vm = this,
|
|
28466
28466
|
_c = _vm._self._c;
|
|
@@ -28494,7 +28494,8 @@ var render = function render() {
|
|
|
28494
28494
|
attrs: {
|
|
28495
28495
|
"messages": _vm.messages,
|
|
28496
28496
|
"input-message": _vm.inputMessage,
|
|
28497
|
-
"think-status": _vm.thinkStatus
|
|
28497
|
+
"think-status": _vm.thinkStatus,
|
|
28498
|
+
"chat-id": _vm.chatId
|
|
28498
28499
|
},
|
|
28499
28500
|
on: {
|
|
28500
28501
|
"update:inputMessage": function ($event) {
|
|
@@ -28751,8 +28752,8 @@ var ChatAvatar_component = normalizeComponent(
|
|
|
28751
28752
|
)
|
|
28752
28753
|
|
|
28753
28754
|
/* harmony default export */ var ChatAvatar = (ChatAvatar_component.exports);
|
|
28754
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindowDialog.vue?vue&type=template&id=
|
|
28755
|
-
var
|
|
28755
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindowDialog.vue?vue&type=template&id=23a76780&scoped=true
|
|
28756
|
+
var ChatWindowDialogvue_type_template_id_23a76780_scoped_true_render = function render() {
|
|
28756
28757
|
var _vm = this,
|
|
28757
28758
|
_c = _vm._self._c;
|
|
28758
28759
|
return _c('div', {
|
|
@@ -28776,6 +28777,9 @@ var ChatWindowDialogvue_type_template_id_1424b8b1_scoped_true_render = function
|
|
|
28776
28777
|
}
|
|
28777
28778
|
}
|
|
28778
28779
|
}, [_c('ChatWindowHeader', {
|
|
28780
|
+
attrs: {
|
|
28781
|
+
"chat-id": _vm.chatId
|
|
28782
|
+
},
|
|
28779
28783
|
on: {
|
|
28780
28784
|
"close": function ($event) {
|
|
28781
28785
|
return _vm.$emit('input', false);
|
|
@@ -28807,10 +28811,10 @@ var ChatWindowDialogvue_type_template_id_1424b8b1_scoped_true_render = function
|
|
|
28807
28811
|
}
|
|
28808
28812
|
})], 1)]);
|
|
28809
28813
|
};
|
|
28810
|
-
var
|
|
28814
|
+
var ChatWindowDialogvue_type_template_id_23a76780_scoped_true_staticRenderFns = [];
|
|
28811
28815
|
|
|
28812
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindowHeader.vue?vue&type=template&id=
|
|
28813
|
-
var
|
|
28816
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindowHeader.vue?vue&type=template&id=90d9b166&scoped=true
|
|
28817
|
+
var ChatWindowHeadervue_type_template_id_90d9b166_scoped_true_render = function render() {
|
|
28814
28818
|
var _vm = this,
|
|
28815
28819
|
_c = _vm._self._c;
|
|
28816
28820
|
return _c('div', {
|
|
@@ -28895,26 +28899,30 @@ var ChatWindowHeadervue_type_template_id_428ec56e_scoped_true_render = function
|
|
|
28895
28899
|
}
|
|
28896
28900
|
})])])]);
|
|
28897
28901
|
};
|
|
28898
|
-
var
|
|
28902
|
+
var ChatWindowHeadervue_type_template_id_90d9b166_scoped_true_staticRenderFns = [];
|
|
28899
28903
|
|
|
28900
28904
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindowHeader.vue?vue&type=script&lang=js
|
|
28901
28905
|
/* harmony default export */ var ChatWindowHeadervue_type_script_lang_js = ({
|
|
28902
28906
|
name: 'ChatWindowHeader',
|
|
28907
|
+
props: {
|
|
28908
|
+
chatId: {
|
|
28909
|
+
type: String,
|
|
28910
|
+
default: ''
|
|
28911
|
+
}
|
|
28912
|
+
},
|
|
28903
28913
|
methods: {
|
|
28904
28914
|
handleOpen() {
|
|
28905
|
-
|
|
28906
|
-
// const baseUrl = window.location.protocol + '//' + window.location.hostname + ':3100/c/' + chatId;
|
|
28907
|
-
const baseUrl = window.location.protocol + '//' + window.location.hostname + ':3100/';
|
|
28915
|
+
const baseUrl = window.location.protocol + '//' + window.location.hostname + ':3100/c/' + this.chatId;
|
|
28908
28916
|
window.open(baseUrl, '_blank');
|
|
28909
28917
|
}
|
|
28910
28918
|
}
|
|
28911
28919
|
});
|
|
28912
28920
|
;// ./components/ChatWindowHeader.vue?vue&type=script&lang=js
|
|
28913
28921
|
/* harmony default export */ var components_ChatWindowHeadervue_type_script_lang_js = (ChatWindowHeadervue_type_script_lang_js);
|
|
28914
|
-
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindowHeader.vue?vue&type=style&index=0&id=
|
|
28922
|
+
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindowHeader.vue?vue&type=style&index=0&id=90d9b166&prod&scoped=true&lang=css
|
|
28915
28923
|
// extracted by mini-css-extract-plugin
|
|
28916
28924
|
|
|
28917
|
-
;// ./components/ChatWindowHeader.vue?vue&type=style&index=0&id=
|
|
28925
|
+
;// ./components/ChatWindowHeader.vue?vue&type=style&index=0&id=90d9b166&prod&scoped=true&lang=css
|
|
28918
28926
|
|
|
28919
28927
|
;// ./components/ChatWindowHeader.vue
|
|
28920
28928
|
|
|
@@ -28927,11 +28935,11 @@ var ChatWindowHeadervue_type_template_id_428ec56e_scoped_true_staticRenderFns =
|
|
|
28927
28935
|
|
|
28928
28936
|
var ChatWindowHeader_component = normalizeComponent(
|
|
28929
28937
|
components_ChatWindowHeadervue_type_script_lang_js,
|
|
28930
|
-
|
|
28931
|
-
|
|
28938
|
+
ChatWindowHeadervue_type_template_id_90d9b166_scoped_true_render,
|
|
28939
|
+
ChatWindowHeadervue_type_template_id_90d9b166_scoped_true_staticRenderFns,
|
|
28932
28940
|
false,
|
|
28933
28941
|
null,
|
|
28934
|
-
"
|
|
28942
|
+
"90d9b166",
|
|
28935
28943
|
null
|
|
28936
28944
|
|
|
28937
28945
|
)
|
|
@@ -29019,8 +29027,8 @@ var UserMessage_component = normalizeComponent(
|
|
|
29019
29027
|
)
|
|
29020
29028
|
|
|
29021
29029
|
/* harmony default export */ var UserMessage = (UserMessage_component.exports);
|
|
29022
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/AiMessage.vue?vue&type=template&id=
|
|
29023
|
-
var
|
|
29030
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/AiMessage.vue?vue&type=template&id=2422d7c0&scoped=true
|
|
29031
|
+
var AiMessagevue_type_template_id_2422d7c0_scoped_true_render = function render() {
|
|
29024
29032
|
var _vm = this,
|
|
29025
29033
|
_c = _vm._self._c;
|
|
29026
29034
|
return _c('div', {
|
|
@@ -29053,7 +29061,7 @@ var AiMessagevue_type_template_id_6e022f2c_scoped_true_render = function render(
|
|
|
29053
29061
|
}
|
|
29054
29062
|
})])]);
|
|
29055
29063
|
};
|
|
29056
|
-
var
|
|
29064
|
+
var AiMessagevue_type_template_id_2422d7c0_scoped_true_staticRenderFns = [];
|
|
29057
29065
|
|
|
29058
29066
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.filter.js
|
|
29059
29067
|
var es_iterator_filter = __webpack_require__(2489);
|
|
@@ -30865,14 +30873,14 @@ function parseMarkdown(text) {
|
|
|
30865
30873
|
html = html.replace(/^\s*\d+\.\s+(.+)$/gm, '<li>$1</li>');
|
|
30866
30874
|
html = html.replace(/^>\s+(.+)$/gm, '<blockquote>$1</blockquote>');
|
|
30867
30875
|
// 解析Markdown链接
|
|
30868
|
-
html = html.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2"
|
|
30876
|
+
html = html.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" aria-current="page">$1</a>');
|
|
30869
30877
|
html = html.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, '<img src="$2" alt="$1" />');
|
|
30870
30878
|
html = html.replace(/^-{3,}$/gm, '<hr>');
|
|
30871
30879
|
// 解析简单URL
|
|
30872
|
-
const simpleUrlRegex = /(https?:\/\/[^\s<>"']+)/g;
|
|
30873
|
-
html = html.replace(simpleUrlRegex, match => {
|
|
30874
|
-
|
|
30875
|
-
});
|
|
30880
|
+
// const simpleUrlRegex = /(https?:\/\/[^\s<>"']+)/g;
|
|
30881
|
+
// html = html.replace(simpleUrlRegex, (match) => {
|
|
30882
|
+
// return `<a href="${match}" aria-current="page">${match}</a>`;
|
|
30883
|
+
// });
|
|
30876
30884
|
|
|
30877
30885
|
// html = html.replace(/\n/g, '<br>');
|
|
30878
30886
|
|
|
@@ -30981,10 +30989,10 @@ function escapeHtml(text) {
|
|
|
30981
30989
|
});
|
|
30982
30990
|
;// ./components/AiMessage.vue?vue&type=script&lang=js
|
|
30983
30991
|
/* harmony default export */ var components_AiMessagevue_type_script_lang_js = (AiMessagevue_type_script_lang_js);
|
|
30984
|
-
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/AiMessage.vue?vue&type=style&index=0&id=
|
|
30992
|
+
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/AiMessage.vue?vue&type=style&index=0&id=2422d7c0&prod&scoped=true&lang=css
|
|
30985
30993
|
// extracted by mini-css-extract-plugin
|
|
30986
30994
|
|
|
30987
|
-
;// ./components/AiMessage.vue?vue&type=style&index=0&id=
|
|
30995
|
+
;// ./components/AiMessage.vue?vue&type=style&index=0&id=2422d7c0&prod&scoped=true&lang=css
|
|
30988
30996
|
|
|
30989
30997
|
;// ./components/AiMessage.vue
|
|
30990
30998
|
|
|
@@ -30997,11 +31005,11 @@ function escapeHtml(text) {
|
|
|
30997
31005
|
|
|
30998
31006
|
var AiMessage_component = normalizeComponent(
|
|
30999
31007
|
components_AiMessagevue_type_script_lang_js,
|
|
31000
|
-
|
|
31001
|
-
|
|
31008
|
+
AiMessagevue_type_template_id_2422d7c0_scoped_true_render,
|
|
31009
|
+
AiMessagevue_type_template_id_2422d7c0_scoped_true_staticRenderFns,
|
|
31002
31010
|
false,
|
|
31003
31011
|
null,
|
|
31004
|
-
"
|
|
31012
|
+
"2422d7c0",
|
|
31005
31013
|
null
|
|
31006
31014
|
|
|
31007
31015
|
)
|
|
@@ -31243,15 +31251,19 @@ var ChatInputBox_component = normalizeComponent(
|
|
|
31243
31251
|
loading: {
|
|
31244
31252
|
type: Boolean,
|
|
31245
31253
|
default: false
|
|
31254
|
+
},
|
|
31255
|
+
chatId: {
|
|
31256
|
+
type: String,
|
|
31257
|
+
default: ''
|
|
31246
31258
|
}
|
|
31247
31259
|
}
|
|
31248
31260
|
});
|
|
31249
31261
|
;// ./components/ChatWindowDialog.vue?vue&type=script&lang=js
|
|
31250
31262
|
/* harmony default export */ var components_ChatWindowDialogvue_type_script_lang_js = (ChatWindowDialogvue_type_script_lang_js);
|
|
31251
|
-
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindowDialog.vue?vue&type=style&index=0&id=
|
|
31263
|
+
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindowDialog.vue?vue&type=style&index=0&id=23a76780&prod&scoped=true&lang=css
|
|
31252
31264
|
// extracted by mini-css-extract-plugin
|
|
31253
31265
|
|
|
31254
|
-
;// ./components/ChatWindowDialog.vue?vue&type=style&index=0&id=
|
|
31266
|
+
;// ./components/ChatWindowDialog.vue?vue&type=style&index=0&id=23a76780&prod&scoped=true&lang=css
|
|
31255
31267
|
|
|
31256
31268
|
;// ./components/ChatWindowDialog.vue
|
|
31257
31269
|
|
|
@@ -31264,11 +31276,11 @@ var ChatInputBox_component = normalizeComponent(
|
|
|
31264
31276
|
|
|
31265
31277
|
var ChatWindowDialog_component = normalizeComponent(
|
|
31266
31278
|
components_ChatWindowDialogvue_type_script_lang_js,
|
|
31267
|
-
|
|
31268
|
-
|
|
31279
|
+
ChatWindowDialogvue_type_template_id_23a76780_scoped_true_render,
|
|
31280
|
+
ChatWindowDialogvue_type_template_id_23a76780_scoped_true_staticRenderFns,
|
|
31269
31281
|
false,
|
|
31270
31282
|
null,
|
|
31271
|
-
"
|
|
31283
|
+
"23a76780",
|
|
31272
31284
|
null
|
|
31273
31285
|
|
|
31274
31286
|
)
|
|
@@ -31295,7 +31307,9 @@ var es_typed_array_with = __webpack_require__(9577);
|
|
|
31295
31307
|
audioContext: null,
|
|
31296
31308
|
microphone: null,
|
|
31297
31309
|
processor: null,
|
|
31298
|
-
audioBuffer: new Float32Array(0)
|
|
31310
|
+
audioBuffer: new Float32Array(0),
|
|
31311
|
+
// 优化
|
|
31312
|
+
int16Buffer: null
|
|
31299
31313
|
};
|
|
31300
31314
|
},
|
|
31301
31315
|
methods: {
|
|
@@ -31314,8 +31328,14 @@ var es_typed_array_with = __webpack_require__(9577);
|
|
|
31314
31328
|
this.audioContext = new AudioContext({
|
|
31315
31329
|
sampleRate: this.SAMPLE_RATE
|
|
31316
31330
|
});
|
|
31331
|
+
|
|
31332
|
+
// 优化 处理 AudioContext 挂起
|
|
31333
|
+
if (this.audioContext.state === 'suspended') {
|
|
31334
|
+
await this.audioContext.resume();
|
|
31335
|
+
}
|
|
31317
31336
|
this.microphone = this.audioContext.createMediaStreamSource(stream);
|
|
31318
31337
|
this.processor = this.audioContext.createScriptProcessor(this.FRAME_SIZE, 1, 1);
|
|
31338
|
+
this.int16Buffer = new Int16Array(this.FRAME_SIZE);
|
|
31319
31339
|
this.processor.onaudioprocess = this.processAudio;
|
|
31320
31340
|
this.microphone.connect(this.processor);
|
|
31321
31341
|
this.processor.connect(this.audioContext.destination);
|
|
@@ -31330,17 +31350,19 @@ var es_typed_array_with = __webpack_require__(9577);
|
|
|
31330
31350
|
processAudio(event) {
|
|
31331
31351
|
if (!this.isRecording) return;
|
|
31332
31352
|
const inputData = event.inputBuffer.getChannelData(0);
|
|
31333
|
-
|
|
31334
|
-
|
|
31335
|
-
|
|
31336
|
-
this.audioBuffer = tempBuffer;
|
|
31337
|
-
while (this.audioBuffer.length >= this.FRAME_SIZE) {
|
|
31338
|
-
const frame = this.audioBuffer.slice(0, this.FRAME_SIZE);
|
|
31339
|
-
this.audioBuffer = this.audioBuffer.slice(this.FRAME_SIZE);
|
|
31340
|
-
const pcmData = this.floatTo16BitPCM(frame);
|
|
31341
|
-
if (this.ws && this.ws.readyState === this.ws.OPEN) {
|
|
31342
|
-
this.ws.send(pcmData);
|
|
31353
|
+
if (this.ws && this.ws.readyState === this.ws.OPEN) {
|
|
31354
|
+
if (inputData.length !== this.int16Buffer.length) {
|
|
31355
|
+
this.int16Buffer = new Int16Array(inputData.length);
|
|
31343
31356
|
}
|
|
31357
|
+
for (let i = 0; i < inputData.length; i++) {
|
|
31358
|
+
let s = inputData[i];
|
|
31359
|
+
// 简单的 clamp
|
|
31360
|
+
s = s < -1 ? -1 : s > 1 ? 1 : s;
|
|
31361
|
+
this.int16Buffer[i] = s < 0 ? s * 0x8000 : s * 0x7FFF;
|
|
31362
|
+
}
|
|
31363
|
+
|
|
31364
|
+
// 4. 发送数据
|
|
31365
|
+
this.ws.send(this.int16Buffer.buffer);
|
|
31344
31366
|
}
|
|
31345
31367
|
},
|
|
31346
31368
|
floatTo16BitPCM(input) {
|
|
@@ -31402,7 +31424,7 @@ var es_typed_array_with = __webpack_require__(9577);
|
|
|
31402
31424
|
const baseUrl = window.location.protocol + '//' + window.location.hostname;
|
|
31403
31425
|
const chatPort = '3100';
|
|
31404
31426
|
console.log(baseUrl, chatPort);
|
|
31405
|
-
const API_URL =
|
|
31427
|
+
const API_URL = `${baseUrl}:${chatPort}/lingxiao-byt/api/v1/mcp/ask`;
|
|
31406
31428
|
const WS_URL = 'ws://192.168.8.9:9999/ai_model/ws/voice-stream';
|
|
31407
31429
|
const AUDIO_URL = '/minio/lingxiaoai/byt.mp3';
|
|
31408
31430
|
const TIME_JUMP_POINTS_URL = '/minio/lingxiaoai/timeJumpPoints.json';
|
|
@@ -31480,11 +31502,22 @@ const TIME_JUMP_POINTS_URL = '/minio/lingxiaoai/timeJumpPoints.json';
|
|
|
31480
31502
|
if (data.type === 'detection') {
|
|
31481
31503
|
console.log('检测到唤醒词');
|
|
31482
31504
|
this.avaterStatus = 'normal';
|
|
31505
|
+
|
|
31506
|
+
// 性能检测起点
|
|
31507
|
+
this.startTime = Date.now(); // <-- 新增计时器
|
|
31508
|
+
console.log(`[Timer] 指令发送开始计时: ${this.startTime}ms`);
|
|
31483
31509
|
} else if (data.type === 'Collecting') {
|
|
31484
31510
|
console.log('状态: 采集中');
|
|
31485
31511
|
this.avaterStatus = 'thinking';
|
|
31486
31512
|
} else if (data.type === 'command') {
|
|
31487
31513
|
console.log('状态: 处理中');
|
|
31514
|
+
|
|
31515
|
+
// 性能检测终点
|
|
31516
|
+
if (this.startTime) {
|
|
31517
|
+
const latency = Date.now() - this.startTime;
|
|
31518
|
+
console.log(`[Latency] 完整命令处理耗时: ${latency}ms`); // 记录端到端延迟
|
|
31519
|
+
this.startTime = null;
|
|
31520
|
+
}
|
|
31488
31521
|
this.analyzeAudioCommand(data.category);
|
|
31489
31522
|
} else {
|
|
31490
31523
|
console.log('状态: 其他');
|
|
@@ -31544,6 +31577,14 @@ class StreamParser {
|
|
|
31544
31577
|
if (this.options.debug) {
|
|
31545
31578
|
console.log('[StreamParser] 收到chunk:', chunk.substring(0, 100));
|
|
31546
31579
|
}
|
|
31580
|
+
if (!this.buffer.includes('data:') && !this.buffer.includes('\n\n')) {
|
|
31581
|
+
// 纯文本流,直接处理
|
|
31582
|
+
if (this.options.debug) {
|
|
31583
|
+
console.log('[StreamParser] 检测到纯文本流');
|
|
31584
|
+
}
|
|
31585
|
+
this.processPlainText(callback);
|
|
31586
|
+
return;
|
|
31587
|
+
}
|
|
31547
31588
|
|
|
31548
31589
|
// 尝试解析为 SSE 格式
|
|
31549
31590
|
if (this.buffer.includes('data:')) {
|
|
@@ -31786,10 +31827,29 @@ class StreamParser {
|
|
|
31786
31827
|
this.reset();
|
|
31787
31828
|
}
|
|
31788
31829
|
}
|
|
31830
|
+
;// ./components/utils/Cookie.js
|
|
31831
|
+
const setCookie = (name, value, days) => {
|
|
31832
|
+
const d = new Date();
|
|
31833
|
+
d.setTime(d.getTime() + days * 24 * 60 * 60 * 1000);
|
|
31834
|
+
const expires = `expires=${d.toUTCString()}`;
|
|
31835
|
+
document.cookie = `${name}=${value}; ${expires}`;
|
|
31836
|
+
};
|
|
31837
|
+
const getCookie = cname => {
|
|
31838
|
+
const name = `${cname}=`;
|
|
31839
|
+
const ca = document.cookie.split(';');
|
|
31840
|
+
for (let i = 0; i < ca.length; i++) {
|
|
31841
|
+
let c = ca[i];
|
|
31842
|
+
while (c.charAt(0) === ' ') c = c.substring(1);
|
|
31843
|
+
if (c.indexOf(name) !== -1) return c.substring(name.length, c.length);
|
|
31844
|
+
}
|
|
31845
|
+
return '';
|
|
31846
|
+
};
|
|
31847
|
+
|
|
31789
31848
|
;// ./components/mixins/messageMixin.js
|
|
31790
31849
|
|
|
31791
31850
|
|
|
31792
31851
|
|
|
31852
|
+
|
|
31793
31853
|
/* harmony default export */ var messageMixin = ({
|
|
31794
31854
|
data() {
|
|
31795
31855
|
return {
|
|
@@ -31845,17 +31905,16 @@ class StreamParser {
|
|
|
31845
31905
|
this.streamParser.reset();
|
|
31846
31906
|
try {
|
|
31847
31907
|
const startTime = Date.now();
|
|
31848
|
-
const
|
|
31849
|
-
const token = `Bearer e298f087-85bc-48c2-afb9-7c69ffc911aa`;
|
|
31908
|
+
const token = getCookie('bonyear-access_token') || `e298f087-85bc-48c2-afb9-7c69ffc911aa`;
|
|
31850
31909
|
const response = await fetch(API_URL, {
|
|
31851
31910
|
method: 'POST',
|
|
31852
|
-
signal: controller.signal,
|
|
31853
31911
|
headers: {
|
|
31854
31912
|
'Content-Type': 'application/json',
|
|
31855
|
-
'Authorization': token
|
|
31913
|
+
'Authorization': `Bearer ${token}`
|
|
31856
31914
|
},
|
|
31857
31915
|
body: JSON.stringify({
|
|
31858
|
-
content: message
|
|
31916
|
+
content: message,
|
|
31917
|
+
chatId: this.chatId
|
|
31859
31918
|
})
|
|
31860
31919
|
});
|
|
31861
31920
|
if (!response.ok) {
|
|
@@ -31956,6 +32015,14 @@ class StreamParser {
|
|
|
31956
32015
|
}
|
|
31957
32016
|
}
|
|
31958
32017
|
});
|
|
32018
|
+
;// ./components/utils/Uuid.js
|
|
32019
|
+
function generateUuid() {
|
|
32020
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
32021
|
+
var r = Math.random() * 16 | 0,
|
|
32022
|
+
v = c === 'x' ? r : r & 0x3 | 0x8;
|
|
32023
|
+
return v.toString(16);
|
|
32024
|
+
});
|
|
32025
|
+
}
|
|
31959
32026
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindow.vue?vue&type=script&lang=js
|
|
31960
32027
|
|
|
31961
32028
|
|
|
@@ -31974,8 +32041,10 @@ class StreamParser {
|
|
|
31974
32041
|
|
|
31975
32042
|
|
|
31976
32043
|
|
|
32044
|
+
|
|
31977
32045
|
const SAMPLE_RATE = 16000;
|
|
31978
32046
|
const FRAME_SIZE = 512;
|
|
32047
|
+
const startTime = null;
|
|
31979
32048
|
/* harmony default export */ var ChatWindowvue_type_script_lang_js = ({
|
|
31980
32049
|
name: 'ChatWindow',
|
|
31981
32050
|
components: {
|
|
@@ -31992,6 +32061,7 @@ const FRAME_SIZE = 512;
|
|
|
31992
32061
|
},
|
|
31993
32062
|
data() {
|
|
31994
32063
|
return {
|
|
32064
|
+
chatId: generateUuid(),
|
|
31995
32065
|
audioSrc: AUDIO_URL,
|
|
31996
32066
|
inputMessage: '',
|
|
31997
32067
|
visible: false,
|
|
@@ -32003,6 +32073,8 @@ const FRAME_SIZE = 512;
|
|
|
32003
32073
|
jumpedTimePoints: new Set(),
|
|
32004
32074
|
SAMPLE_RATE,
|
|
32005
32075
|
FRAME_SIZE,
|
|
32076
|
+
startTime,
|
|
32077
|
+
// 检查性能使用
|
|
32006
32078
|
dragThreshold: 5,
|
|
32007
32079
|
// 拖拽阈值
|
|
32008
32080
|
isDragging: false,
|
|
@@ -32175,10 +32247,10 @@ const FRAME_SIZE = 512;
|
|
|
32175
32247
|
});
|
|
32176
32248
|
;// ./components/ChatWindow.vue?vue&type=script&lang=js
|
|
32177
32249
|
/* harmony default export */ var components_ChatWindowvue_type_script_lang_js = (ChatWindowvue_type_script_lang_js);
|
|
32178
|
-
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindow.vue?vue&type=style&index=0&id=
|
|
32250
|
+
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindow.vue?vue&type=style&index=0&id=0e3e6d50&prod&scoped=true&lang=css
|
|
32179
32251
|
// extracted by mini-css-extract-plugin
|
|
32180
32252
|
|
|
32181
|
-
;// ./components/ChatWindow.vue?vue&type=style&index=0&id=
|
|
32253
|
+
;// ./components/ChatWindow.vue?vue&type=style&index=0&id=0e3e6d50&prod&scoped=true&lang=css
|
|
32182
32254
|
|
|
32183
32255
|
;// ./components/ChatWindow.vue
|
|
32184
32256
|
|
|
@@ -32195,7 +32267,7 @@ var ChatWindow_component = normalizeComponent(
|
|
|
32195
32267
|
staticRenderFns,
|
|
32196
32268
|
false,
|
|
32197
32269
|
null,
|
|
32198
|
-
"
|
|
32270
|
+
"0e3e6d50",
|
|
32199
32271
|
null
|
|
32200
32272
|
|
|
32201
32273
|
)
|