You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/93172.9130b4c2.async.js

952 lines
46 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[93172],{
/***/ 93172:
/*!******************************************************!*\
!*** ./src/components/ChatBox/index.tsx + 7 modules ***!
\******************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ ChatBox; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
var toConsumableArray = __webpack_require__(37205);
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var es_message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
var upload = __webpack_require__(53326);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/drawer/index.js + 9 modules
var drawer = __webpack_require__(43428);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
var row = __webpack_require__(95237);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = __webpack_require__(24650);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(63350);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(39647);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
// EXTERNAL MODULE: ./node_modules/_react-markdown@9.0.1@react-markdown/lib/index.js + 129 modules
var lib = __webpack_require__(67050);
// EXTERNAL MODULE: ./node_modules/_react-syntax-highlighter@15.5.0@react-syntax-highlighter/dist/esm/prism.js + 5 modules
var prism = __webpack_require__(50457);
// EXTERNAL MODULE: ./node_modules/_react-syntax-highlighter@15.5.0@react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.js
var vsc_dark_plus = __webpack_require__(59455);
// EXTERNAL MODULE: ./node_modules/_react-copy-to-clipboard@5.0.2@react-copy-to-clipboard/lib/index.js
var _react_copy_to_clipboard_5_0_2_react_copy_to_clipboard_lib = __webpack_require__(56102);
;// CONCATENATED MODULE: ./src/components/ChatBox/components/answer.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var answermodules = ({"wrp":"wrp___H70W8","file-list":"file-list___S5XYJ","ExtraEdit":"ExtraEdit___K6Xf2","btn":"btn___Yiu8q"});
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
var col = __webpack_require__(43604);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/FileWordOutlined.js + 1 modules
var FileWordOutlined = __webpack_require__(63217);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/ChatBox/components/answer.tsx
var _excluded = ["node", "inline", "className", "children"];
var TypingCodeComponent = function TypingCodeComponent(_ref) {
var onCallback = _ref.onCallback,
scrollBox = _ref.scrollBox,
Data = _ref.Data,
extraEdit = _ref.extraEdit;
var _Data$allowCopy = Data.allowCopy,
allowCopy = _Data$allowCopy === void 0 ? false : _Data$allowCopy,
fileList = Data.fileList,
_Data$hideTextEffect = Data.hideTextEffect,
hideTextEffect = _Data$hideTextEffect === void 0 ? false : _Data$hideTextEffect,
_Data$text = Data.text,
text = _Data$text === void 0 ? "" : _Data$text;
var _useState = (0,_react_17_0_2_react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
content = _useState2[0],
setContent = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(true),
_useState4 = slicedToArray_default()(_useState3, 2),
isTyping = _useState4[0],
setIsTyping = _useState4[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (!text) return;
setIsTyping(true);
var typeContent = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var i;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
i = 0;
case 1:
if (!(i < text.length)) {
_context.next = 8;
break;
}
setContent(text.substring(0, i + 1) + (text.length - 1 > i ? ' __' : ""));
_context.next = 5;
return new Promise(function (resolve) {
return setTimeout(resolve, 30);
});
case 5:
i++;
_context.next = 1;
break;
case 8:
setIsTyping(false);
onCallback === null || onCallback === void 0 || onCallback(Data);
case 10:
case "end":
return _context.stop();
}
}, _callee);
}));
return function typeContent() {
return _ref2.apply(this, arguments);
};
}();
if (hideTextEffect) {
setContent(text);
} else {
typeContent();
}
return function () {
return setContent('');
};
}, []);
(0,_react_17_0_2_react.useEffect)(function () {
if (scrollBox.current) {
scrollBox.current.scrollTo({
top: scrollBox.current.scrollHeight,
behavior: "smooth"
});
}
}, [content]);
var bytesToSize = function bytesToSize(bytes) {
if (bytes === 0) return '0 B';
var k = 1024;
var sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
var i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(answermodules.wrp, " fadeIn animated"),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(lib/* Markdown */.U, {
components: {
code: function code(_ref3) {
var node = _ref3.node,
inline = _ref3.inline,
className = _ref3.className,
children = _ref3.children,
props = objectWithoutProperties_default()(_ref3, _excluded);
var match = /language-(\w+)/.exec(className || '');
return !inline && match ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
position: 'relative'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(_react_copy_to_clipboard_5_0_2_react_copy_to_clipboard_lib.CopyToClipboard, {
text: String(children).replace(/\n$/, ''),
onCopy: function onCopy() {
return es_message/* default */.ZP.success({
content: '复制成功',
key: "copy"
});
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("button", {
style: {
position: 'absolute',
top: 0,
right: 0,
padding: '4px 8px',
borderRadius: '0 0 0 5px',
border: 'none',
backgroundColor: '#007bff',
color: '#fff',
cursor: 'pointer',
fontSize: "12px"
},
children: "\u590D\u5236"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(prism/* default */.Z, objectSpread2_default()(objectSpread2_default()({
style: vsc_dark_plus/* default */.Z,
language: match[1],
PreTag: "div",
showLineNumbers: true,
lineNumberStyle: {
minWidth: '40px'
}
}, props), {}, {
children: String(children || "").replace(/\n$/, '')
}))]
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("code", objectSpread2_default()(objectSpread2_default()({
className: className
}, props), {}, {
children: children
}));
}
},
children: content
}), fileList && !isTyping && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
className: "".concat(answermodules["file-list"], " animated fadeIn"),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(FileWordOutlined/* default */.Z, {
className: "font20 mr10"
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
children: [fileList === null || fileList === void 0 ? void 0 : fileList.name, /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), bytesToSize(fileList === null || fileList === void 0 ? void 0 : fileList.size)]
})]
}), !isTyping && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: answermodules.ExtraEdit,
children: [extraEdit === null || extraEdit === void 0 ? void 0 : extraEdit(Data), allowCopy && /*#__PURE__*/(0,jsx_runtime.jsx)(_react_copy_to_clipboard_5_0_2_react_copy_to_clipboard_lib.CopyToClipboard, {
text: String(content).replace(/\n$/, ''),
onCopy: function onCopy() {
return es_message/* default */.ZP.success({
content: '复制成功',
key: "copy"
});
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: answermodules.btn,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-fuzhi3 mr5"
}), "\u590D\u5236"]
})
})]
})]
});
};
/* harmony default export */ var answer = (TypingCodeComponent);
;// CONCATENATED MODULE: ./src/components/ChatBox/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ChatBoxmodules = ({"flex_box_center":"flex_box_center___GmElr","flex_space_between":"flex_space_between____pbWi","flex_box_vertical_center":"flex_box_vertical_center___COMWd","flex_box_center_end":"flex_box_center_end___lmAQf","flex_box_column":"flex_box_column___OJb7M","ai-wrp":"ai-wrp___AEGoS","loading-wanx":"loading-wanx___GtiUv","dot-flashing":"dot-flashing___xJNVn","dot-fade":"dot-fade___KWn1a","footer-container":"footer-container___HTy33","input-container":"input-container___M88BT","upload-btn":"upload-btn___fKRCG","send-btn":"send-btn___yOKG5","chat-container":"chat-container___pNTrU","chat-message":"chat-message___isXl8","title":"title___hXSVA","answerWrp":"answerWrp___COjAb","li":"li___PjMV3","img":"img___wZqEA","content":"content___OlYYG","user":"user___rbSU1","container":"container___hZAxN","item":"item___Z9j46"});
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(57964);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(80348);
;// CONCATENATED MODULE: ./src/components/ChatBox/components/icon.tsx
var DraggableImage = function DraggableImage(_ref) {
var src = _ref.src,
onClick = _ref.onClick;
var imgRef = (0,_react_17_0_2_react.useRef)(null);
var _useState = (0,_react_17_0_2_react.useState)(false),
_useState2 = slicedToArray_default()(_useState, 2),
isDragging = _useState2[0],
setIsDragging = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)({
x: 20,
y: window.innerHeight * 0.62
}),
_useState4 = slicedToArray_default()(_useState3, 2),
position = _useState4[0],
setPosition = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)({
x: 20,
y: window.innerHeight * 0.62
}),
_useState6 = slicedToArray_default()(_useState5, 2),
startPosition = _useState6[0],
setStartPosition = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)({
x: 20,
y: window.innerHeight * 0.62
}),
_useState8 = slicedToArray_default()(_useState7, 2),
mouseStart = _useState8[0],
setMouseStart = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(false),
_useState10 = slicedToArray_default()(_useState9, 2),
hasDragged = _useState10[0],
setHasDragged = _useState10[1];
(0,_react_17_0_2_react.useEffect)(function () {
var handleMouseMove = function handleMouseMove(e) {
if (isDragging) {
var _imgRef$current;
var deltaY = e.clientY - mouseStart.y;
var newY = startPosition.y + deltaY;
var maxY = window.innerHeight - (((_imgRef$current = imgRef.current) === null || _imgRef$current === void 0 ? void 0 : _imgRef$current.offsetHeight) || 0) - 50;
var minY = 50;
if (newY < minY) newY = minY;
if (newY > maxY) newY = maxY;
requestAnimationFrame(function () {
setPosition({
x: 20,
y: newY
});
});
setHasDragged(true);
}
};
var handleMouseUp = function handleMouseUp() {
setIsDragging(false);
};
document.addEventListener('mousemove', handleMouseMove);
document.addEventListener('mouseup', handleMouseUp);
return function () {
document.removeEventListener('mousemove', handleMouseMove);
document.removeEventListener('mouseup', handleMouseUp);
};
}, [isDragging, mouseStart, startPosition]);
var handleMouseDown = function handleMouseDown(e) {
setIsDragging(true);
setMouseStart({
x: e.clientX,
y: e.clientY
});
setStartPosition(position);
setHasDragged(false);
};
var handleMouseUp = function handleMouseUp(e) {
setIsDragging(false);
if (!hasDragged && onClick) {
onClick(e);
}
};
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
position: 'fixed',
top: position.y,
right: position.x,
zIndex: 2,
cursor: isDragging ? 'grabbing' : 'grab'
},
onMouseDown: handleMouseDown,
onMouseUp: handleMouseUp,
ref: imgRef,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: src || "/images/ai_teacher.png",
width: 60,
draggable: "false"
})
});
};
/* harmony default export */ var icon = (DraggableImage);
;// CONCATENATED MODULE: ./src/components/ChatBox/imgs/a.png
var a_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAYCAYAAAD+vg1LAAAAAXNSR0IArs4c6QAAA1FJREFUSEuVlctvVVUYxX/f7UNCkYdMHDA0caCJMcaQXB4VLX2IRJCgRtGg+EpMHJOIiQ8mxqF/AQOdmKJNqy0EJVrkWLWi8piYQIxNHAAhaINy4XxLzzl737t7uTV4Jvve7HPWXt/61re2vXJaHwi24ZgAORSrq1pVrKr+F48X++XGwv3wTi7x9uh6e89ePq2rcnrjhxEoXctDAnA8JIJ7JBMOQhwf3WDr7KVTasjpaTKKIAnTWEnJONmPv2NlZRVGdnC91e3Fk2pI9DTLDWUvYJ5I0qmiVDIg+3ij1e2Fn9XwAFxK6PyKKkmb+obfBaNS44J6YC7R5+L25oGQjfVb3fb8pIZ7xVjGJwfute1Vm27u2Tqupd0ruVT0KfQhG3vA6vbcjy0pwqkXSymjJJF5YHqDFLBEzq0p4/FNBfCJwLhdxwSwo2PCftnAwhqt77OJh6xuu39oafxfjalET1wRHBK1TiyZfVoAPztbSRE/7OSG1GILfJzYL5VicsDq9sz3bcBwXoUrFpu8fEHZBeE+d5YlA5RNbra67fqu1Txg4sO1tvXm/FC9NXJUayznt+YQGdlUAfz0t4nGhYpizhPGiV8X5kj0MSyXsyqpMDs8ZHV7qgCOPo7lL26t5tAs1mhEdnjY6vbkN4mPU8t1Am+3pHFJOUfcmMNZ7WIQce7ISAC+gXFrXFuRmTQzjPy7XSvZf+Es6lvFHbpGfmWec0uX0//5sE3ZE1nQOOSsxHwzwFo6opxewS3Blq9Nbrb3Bw9pL7BXYkWZIcYZOc8f3WIztvN4KzYNJkY3dHbF0JRu6+rmgmB6csD6Bw9pH+KdZnRWWTMv53dyHradX1fNC2Obu/ilzO54S8RKKPNgDcauv7oY621w3p0l0Q2IP2rG0HXnVYm/bcexinG8jtKxTaapOc44d8tY7c6XgnGJR1zM18SwGyOes0/ipD023Zq8jhZqm8A85y7VWGbOjBvDOHdizEoMeM6boYJjtn1aV71oTIfLsUNEYsaeFZc5cLGPuaJpVmNHfp37Jd6Kl4PVeN0e/Uof4WxzqOHhNk7s1uG2PvPFDPc8uJYt7hyU6G4LrhM9DTba/8mF9nc3faZ1+TXe+Ffr+wR/mhi90mD/7ON2+R9W5V2x0b6OvQAAAABJRU5ErkJggg==";
;// CONCATENATED MODULE: ./src/components/ChatBox/imgs/b.png
var b_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAYCAYAAAD6S912AAAAAXNSR0IArs4c6QAAA6VJREFUSEuVlVtoXGUUhdc6SbQmRFPb2pDLdCaN0D6oIFpSiAgqUkWhbxbEWiQ+iA8iFCWQUoo22mCxL4JUYkJBSalWEHshXqLRqSYiSkHQJp2ZtEKrpMVC0Gb+y9IzZ850TpwUHJiHc/k/1t5r7X2I6/zeaNPqunrsdcBWKzU58lTRY2DPb5xe7hiXezC8Ws0LjZg20gZHwABwACy4aIEHXzvHbK2zywLfTKnfSYMhzJZA5T8BD07tm2PP/wLu79QJS22JQSV1FTh1mWgcLfDqUmhJ4W4o2AP66of7Un7SAvdFZVbDouuAXHmgwD/jMzGDI2mtKDp95MmvnjvH1+MXBlP61FK95b7BQgmwCdh6MMcr4fvb2tSpG3Vc4k6+s04Z4/G1gdo9OPDiee59ZZ02SrjXEs3lki8UgYIHNofmeMIZIteZx2e5LnQYrwlLdHlqqFTyWx3qXiQmLNVhwW8d0GMhxj1zYLZIHAtNCu/FbTDADw681UIZT+0/mq/bWXF5qFPrHXHKQLct7VsINCEQGqx2PE6AI4eO5vhyKK4CFMRXU7hsoZZrbkYG1AJWu+48H/h4jhMJ4GC7Vi3Waf5amVXZC5g1ihTWct2JzxwvcCQJ7Naav4z+SIS4HBkXMGuJY9aXS64KezkFfeN5DieA/d1aoypgtRLHSKEt93Dp9Diw7/MYuDullywQeKLJQANRz5JhjoGOocs876BZI7RacIOl6MW+L2PgQMpbS9RVIDWmwpPZIjAi4vcPcvwkDv9DXbrDAu/+C387GwP7U3rMABTQUqQO1TIlVHg4z94QtGW9tjn5hx2DBUOM+jrMWIO7pnL8JtHDFzJaa7wuJiJTCTGzH+bZ+2jGjTngCUuWRtGB1pLPfneWo7HqSg5D4N/SxaUuRwaUSj7goSPRpIRzHUEtuRA0MD39Cy8lFG5v16r6Bs3X3C5k1gI/OfjnK6DEfgweOX2WJxPA8OLptL9ggdbqsssTkXXiF4baFVUQbZ44Pl7Bpp9z/D6pMKNNDhq3wi3/yRmZdcKThjht4G9OLtvSrnx/ZjbYDjA8CuxIq8dAJx3R7KD3DLjVory6ImOyE7mgd3O37rdeI5bIRKYEJxy01kB3uwBjczPBU9yRVhjOKSs2OaDvSIGjj7ep0d+EjYsOzbY+/IbgyuQsf4ycVHBnBrdfbcClM2c4n0ppJW7QuIXuccAww9X9awYHBUwezvPQ9T6ryz1rSatlRb3GTMBd/wBBRVUxXeSVgwAAAABJRU5ErkJggg==";
;// CONCATENATED MODULE: ./src/components/ChatBox/imgs/c.png
var c_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAYCAYAAAARfGZ1AAAAAXNSR0IArs4c6QAABD9JREFUSEvNlG1MU2cUx/+3hVJKoZQCKTIGTBw6ZB1CNmg/MHkNoqAJe9fhDMvWkhZcjG4fMdnMkm2Ei4Diy8IyEUPUGCNDjSxx2XgHCxN0sooI0spLQ2lpe1vuXe5d1oFNVkj8sPPlSe4553fOc87/PgTWYIcPnwl2OJzfi8WiXJvN0cvjMaXV1eopX6mErwDWr9PVf5Wfr/xcpVIQIyMGpqXlxgWSVL/nK3eN8LpWtfrtkqiocNjtThw7drafJDVpzwVeUVH3Tmxs9HmlUkEMDT1g7t4d+6KmRvP1c4H/PZoTOwC6EcBRktSwp0/zGsvBg98Fut3BMn9/ysvncuESn4+PeTzMrSS7XALG6aTnGxs/WVr53QM4cuSkxG5frpdIxG+Fh4f4E2vaxr+omRmLy2KxXuLxHJrq6s/mWY8HodM13NyzR5mdmZlMUJQbLpfb57WfDbh16w7T0aH/hSTVmR54ZeXJbQkJ8v7y8iKYzVZYrXaYTGZYLEuIiAhFaGiQVyHWx8aIxYGQy8PA3pTNu3q1C1NTsyqSLP+N61yna3g3NzflfE5OCqan59HW1oPxBQoCaQgo0yxSN2+ASpXkKdDbex+d+kcQyCPgtlgRFQDs2pUOilpGZ+cIo9cbPiJJTRMH12obPigoSP1RqXwF16714J6DhzBVKnh+fqCdFIxtHcjbFodNm6IxMfEUV26PImpnDvgiIRj3Msx9Q4ilFpGevgXd3aPMwIChrLZWfdYL/s23FxG+twQZchGmKWCSAmwPHyPoziCKijJw/Xo/ZuMToEhJgJsBJpzgGpg81Yz9+7J9wyPL3kdYgB8cDEAzwMKkEcLuHhQXZ6C9vQ/mLUmIS3yR85ndwDLD4HH9D9i/N2s1vLKy7jWGIXbk56d9yY6FXYhBGAqZMpWbMZ9NvHIDb74cgc2JMRgfN6Gt7yGiSwpB8HkIIABT/++QmyahVCZx8MHBsaM0TV8kKirqW2ga8QUFaa+z8Lm5Ra6AkfFDQIQM9okpJMdIkZn5qmehXV2j6PvDiMDYF0CZFyCjbCguVsLlWkZXFwfvJwhi2GvmrMRYe/JkDgsLS4iMlEAmC/GSIitZo9GM4GAhoqPDQRAErFbHf8/8H/i6/yCwOv8/wfX6P5GYGAOhUICBgTFs3RoHgcCPnS2n65W27s5bW28jLy8VEkkQmpt/xu7dGRCJhDh9+ieUlRWsgrMj7e29/+xPdKIkKyu5dft2BfeerLTLl39FdnYKQkJEYAsVFr4BkSgATU03UVqa6wmlaRqzsxb2dszw8KN9tbXqc5xaDh06FS+Vih8cOJDHdzpdKx/LNeyV4SS4uLjEne3tffTMjDnp+HHtPc+Tq9XW1WzcuEGrULxEBAUJ1wBdHWKzOTA0ZGAMBmNjTY3601XvOduuTlevAfAhQRByVrfrMZqmTQBzTip9WltVVUWzuX8BL+8z38bSCP4AAAAASUVORK5CYII=";
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(88499);
;// CONCATENATED MODULE: ./src/components/ChatBox/index.tsx
var ChatBox_TypingCodeComponent = function TypingCodeComponent(_ref) {
var _taskData$challenge, _taskData$challenge2, _taskData$challenge3, _fileList$2, _fileList$3, _fileList$4;
var title = _ref.title,
description = _ref.description,
placeholder = _ref.placeholder,
hideUpload = _ref.hideUpload,
hideInputBox = _ref.hideInputBox,
aiIcon = _ref.aiIcon,
userIcon = _ref.userIcon,
children = _ref.children,
taskData = _ref.taskData,
name = _ref.name,
code = _ref.code,
globalSetting = _ref.globalSetting,
authority = _ref.authority,
_ref$isShowComponent = _ref.isShowComponent,
isShowComponent = _ref$isShowComponent === void 0 ? true : _ref$isShowComponent,
_ref$DrawerProps = _ref.DrawerProps,
DrawerProps = _ref$DrawerProps === void 0 ? {} : _ref$DrawerProps,
_ref$FetchUrl = _ref.FetchUrl,
FetchUrl = _ref$FetchUrl === void 0 ? 'https://ai-data.educoder.net/v1/chat-messages' : _ref$FetchUrl,
_ref$FetchData = _ref.FetchData,
FetchData = _ref$FetchData === void 0 ? {} : _ref$FetchData,
_ref$defaultGetData = _ref.defaultGetData,
defaultGetData = _ref$defaultGetData === void 0 ? false : _ref$defaultGetData,
_ref$extraEdit = _ref.extraEdit,
extraEdit = _ref$extraEdit === void 0 ? function () {
return null;
} : _ref$extraEdit,
_ref$isShowDefuatTips = _ref.isShowDefuatTips,
isShowDefuatTips = _ref$isShowDefuatTips === void 0 ? true : _ref$isShowDefuatTips,
isReview = _ref.isReview,
onOpen = _ref.onOpen,
loadingOption = _ref.loadingOption;
var _useState = (0,_react_17_0_2_react.useState)(['daiao', 'pu428f3pz', 'wangwei10061', 'pucmnw7fs', 'mlty7uhjf', 'pyf8v9u3c', "a411763600"]),
_useState2 = slicedToArray_default()(_useState, 2),
lookAiUser = _useState2[0],
setLookAiUser = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(null),
_useState4 = slicedToArray_default()(_useState3, 2),
student_work_id = _useState4[0],
setStudent_work_id = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(false),
_useState6 = slicedToArray_default()(_useState5, 2),
open = _useState6[0],
setOpen = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
fileList = _useState8[0],
setFileList = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(false),
_useState10 = slicedToArray_default()(_useState9, 2),
loading = _useState10[0],
setIsLoading = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)([]),
_useState12 = slicedToArray_default()(_useState11, 2),
chatData = _useState12[0],
setChatData = _useState12[1];
var chatDataRef = (0,_react_17_0_2_react.useRef)(chatData);
var conversationIdRef = (0,_react_17_0_2_react.useRef)();
var scrollBox = (0,_react_17_0_2_react.useRef)();
var _useState13 = (0,_react_17_0_2_react.useState)(''),
_useState14 = slicedToArray_default()(_useState13, 2),
message = _useState14[0],
setMessage = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)(["".concat(taskData === null || taskData === void 0 || (_taskData$challenge = taskData.challenge) === null || _taskData$challenge === void 0 ? void 0 : _taskData$challenge.task_pass, "\uFF0C\u8BF7\u7ED9\u51FA\u7B54\u9898\u601D\u8003\u65B9\u5411\u3002\\n\\n\u4E0D\u8981\u7ED9\u51FA\u5B66\u751F\u6B63\u786E\u7B54\u6848\uFF0C\u4E0D\u8981\u7ED9\u51FA\u4EFB\u4F55\u4EE3\u7801")]),
_useState16 = slicedToArray_default()(_useState15, 2),
queryData = _useState16[0],
setQueryData = _useState16[1];
// const Authorization = ["Bearer app-Z8HFAfducmnrr3zO9961jqgB", `Bearer app-Z8HFAfducmnrr3zO9961jqgB`, `Bearer app-Z8HFAfducmnrr3zO9961jqgB`];
// const names = ["智能审题", `代码诊断`, `AI辅导`];
// const [inputs, setInputs] = useState<any>(["", taskData?.challenge?.task_pass, taskData?.challenge?.task_pass])
var isTpiAi = !!taskData;
var fastBtnItem = [{
img: a_namespaceObject,
name: '智能审题',
des: '快速智能拆解任务,提供解题思路',
Authorization: "Bearer app-Z8HFAfducmnrr3zO9961jqgB",
inputs: ""
}, {
img: b_namespaceObject,
name: '代码诊断',
des: '系统智能代码分析,提供修正建议',
Authorization: "Bearer app-Z8HFAfducmnrr3zO9961jqgB",
inputs: taskData === null || taskData === void 0 || (_taskData$challenge2 = taskData.challenge) === null || _taskData$challenge2 === void 0 ? void 0 : _taskData$challenge2.task_pass
}, {
img: c_namespaceObject,
name: 'AI辅导',
des: "为学生提供个性化智能学习辅导",
// des: '为学生提供个性化、智能化的学习辅导体验',
Authorization: "Bearer app-Z8HFAfducmnrr3zO9961jqgB",
inputs: taskData === null || taskData === void 0 || (_taskData$challenge3 = taskData.challenge) === null || _taskData$challenge3 === void 0 ? void 0 : _taskData$challenge3.task_pass
}];
var handleChange = function handleChange(_ref2) {
var newFileList = _ref2.fileList;
console.log(":newFileList:", newFileList);
setFileList(newFileList);
};
var UploadPorops = {
action: "https://ai-data.educoder.net/v1/datasets/dc9e6c03-a629-4e9e-bd81-06fb93c29aa1/document/create_by_file",
fileList: toConsumableArray_default()(fileList),
maxCount: 1,
onChange: handleChange,
showUploadList: false,
accept: ".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
beforeUpload: function beforeUpload(file) {
var allowedTypes = ['application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
// Word
'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
// Excel
'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation']; // PowerPoint
var isOfficeFile = allowedTypes.includes(file.type);
if (!isOfficeFile) {
message.error('只能上传Office文档');
return Promise.reject();
}
return isOfficeFile;
},
headers: {
'Authorization': 'Bearer dataset-xBnNgFqcMjLGAXz7pFgXzGwY'
},
data: {
'data': JSON.stringify({
"indexing_technique": "high_quality",
"process_rule": {
"rules": {
"pre_processing_rules": [{
"id": "remove_extra_spaces",
"enabled": true
}, {
"id": "remove_urls_emails",
"enabled": true
}],
"segmentation": {
"separator": "###",
"max_tokens": 500
}
},
"mode": "custom"
}
})
}
};
var UploadReview = {
maxCount: 1,
showUploadList: false,
accept: ".doc,.docx,.md,.txt,.pdf",
beforeUpload: function beforeUpload(file) {
var _file$name;
var fileType = file === null || file === void 0 || (_file$name = file.name) === null || _file$name === void 0 || (_file$name = _file$name.split(".")) === null || _file$name === void 0 || (_file$name = _file$name.slice(-1)) === null || _file$name === void 0 || (_file$name = _file$name[0]) === null || _file$name === void 0 ? void 0 : _file$name.toLowerCase();
var allowedTypes = ["doc", "docx", "md", "pdf", "txt"];
var allowFile = allowedTypes.includes(fileType);
if (file.size == 0) {
es_message/* default */.ZP.warning('文件内容不能为空');
return upload/* default */.Z.LIST_IGNORE;
}
if (!allowFile) {
es_message/* default */.ZP.warning('目前支持txt、md、doc、docx、pdf文件');
return upload/* default */.Z.LIST_IGNORE;
}
return allowFile;
},
onChange: function onChange(_ref3) {
var newFileList = _ref3.fileList;
setFileList((newFileList === null || newFileList === void 0 ? void 0 : newFileList.filter(function (item) {
return (item === null || item === void 0 ? void 0 : item.status) === "done";
})) || []);
},
action: "".concat(env/* default */.Z === null || env/* default */.Z === void 0 ? void 0 : env/* default */.Z.API_SERVER, "/api/attachments.json")
};
(0,_react_17_0_2_react.useEffect)(function () {
chatDataRef.current = chatData;
}, [chatData]);
(0,_react_17_0_2_react.useEffect)(function () {
if (globalSetting !== null && globalSetting !== void 0 && globalSetting.setting) {
var _globalSetting$settin;
setLookAiUser([].concat(toConsumableArray_default()(lookAiUser), toConsumableArray_default()((globalSetting === null || globalSetting === void 0 || (_globalSetting$settin = globalSetting.setting) === null || _globalSetting$settin === void 0 ? void 0 : _globalSetting$settin.big_model_users) || [])));
}
}, [globalSetting === null || globalSetting === void 0 ? void 0 : globalSetting.setting]);
(0,_react_17_0_2_react.useEffect)(function () {
var _taskData$challenge4;
setQueryData(["".concat(taskData === null || taskData === void 0 || (_taskData$challenge4 = taskData.challenge) === null || _taskData$challenge4 === void 0 ? void 0 : _taskData$challenge4.task_pass), "".concat(code), "".concat(code)]);
}, [code]);
(0,_react_17_0_2_react.useEffect)(function () {
if (!(defaultGetData && (DrawerProps !== null && DrawerProps !== void 0 && DrawerProps.open || open) && FetchData !== null && FetchData !== void 0 && FetchData.student_work_id)) {
return;
}
if (student_work_id !== (FetchData === null || FetchData === void 0 ? void 0 : FetchData.student_work_id)) {
setChatData([{
text: '',
done: false,
loading: true,
key: Date.now(),
sender: "AI",
allowCopy: true
}]);
} else {
if (!!chatData.length) {
return;
}
setChatData([].concat(toConsumableArray_default()(chatData), [{
text: '',
done: false,
loading: true,
key: Date.now(),
sender: "AI",
allowCopy: true
}]));
}
getData();
setStudent_work_id(FetchData === null || FetchData === void 0 ? void 0 : FetchData.student_work_id);
}, [defaultGetData, open, chatData, DrawerProps === null || DrawerProps === void 0 ? void 0 : DrawerProps.open, FetchData === null || FetchData === void 0 ? void 0 : FetchData.student_work_id]);
var showDrawer = function showDrawer() {
setOpen(true);
};
var onClose = function onClose() {
setOpen(false);
};
var getData = /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _fileList$filter;
var mes,
response,
_args = arguments;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
mes = _args.length > 0 && _args[0] !== undefined ? _args[0] : "";
_context.next = 3;
return (0,fetch/* default */.ZP)(FetchUrl, {
method: "post",
body: objectSpread2_default()({
"inputs": {
description: "",
name: name
},
query: mes,
"response_mode": "blocking",
"conversation_id": conversationIdRef.current || "",
"user": "abc",
"files": (fileList === null || fileList === void 0 || (_fileList$filter = fileList.filter(function (item) {
return (item === null || item === void 0 ? void 0 : item.status) == "done";
})) === null || _fileList$filter === void 0 ? void 0 : _fileList$filter.map(function (item) {
var _item$response;
return item === null || item === void 0 || (_item$response = item.response) === null || _item$response === void 0 ? void 0 : _item$response.id;
})) || []
}, FetchData),
mode: "cors",
headers: {
'Content-Type': 'application/json',
'Authorization': "Bearer app-Z8HFAfducmnrr3zO9961jqgB"
}
});
case 3:
response = _context.sent;
setIsLoading(false);
chatDataRef.current[chatDataRef.current.length - 1].text = response === null || response === void 0 ? void 0 : response.answer;
chatDataRef.current[chatDataRef.current.length - 1].loading = false;
chatDataRef.current[chatDataRef.current.length - 1].response = response;
conversationIdRef.current = response === null || response === void 0 ? void 0 : response.conversation_id;
setChatData(toConsumableArray_default()(chatDataRef.current));
case 10:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData() {
return _ref4.apply(this, arguments);
};
}();
var getTpiAiData = /*#__PURE__*/function () {
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(Data, num) {
var response;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (!loading) {
_context2.next = 2;
break;
}
return _context2.abrupt("return");
case 2:
setIsLoading(true);
setChatData([].concat(toConsumableArray_default()(chatData), [{
text: message,
done: false,
loading: true,
key: Date.now(),
sender: "AI",
allowCopy: true,
name: Data === null || Data === void 0 ? void 0 : Data.name
}]));
setTimeout(function () {
scrollBox.current.scrollTo({
top: scrollBox.current.scrollHeight,
behavior: "smooth"
});
});
_context2.next = 7;
return (0,fetch/* default */.ZP)(FetchUrl, {
method: "post",
body: {
"inputs": {
description: Data === null || Data === void 0 ? void 0 : Data.inputs,
name: Data === null || Data === void 0 ? void 0 : Data.name
// type: num
},
query: queryData[num],
// "query": `${taskData?.challenge?.task_pass}请根据这个描述内容,给出解题思路,请勿提供任何代码`,
"response_mode": "blocking",
// "conversation_id": conversationIdRef.current,
"user": "abc",
"files": []
},
mode: "cors",
headers: {
'Content-Type': 'application/json',
'Authorization': Data === null || Data === void 0 ? void 0 : Data.Authorization
}
});
case 7:
response = _context2.sent;
if (response !== null && response !== void 0 && response.answer) {
setIsLoading(false);
chatDataRef.current[chatDataRef.current.length - 1].text = response === null || response === void 0 ? void 0 : response.answer;
chatDataRef.current[chatDataRef.current.length - 1].loading = false;
chatDataRef.current[chatDataRef.current.length - 1].response = response;
conversationIdRef.current = response === null || response === void 0 ? void 0 : response.conversation_id;
setChatData(toConsumableArray_default()(chatDataRef.current));
}
case 9:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function getTpiAiData(_x, _x2) {
return _ref5.apply(this, arguments);
};
}();
var handleMessageChange = function handleMessageChange(e) {
setMessage(e.target.value);
};
var handleSendMessage = function handleSendMessage() {
if (message.trim() !== '') {
setMessage('');
setFileList([]);
setChatData([].concat(toConsumableArray_default()(chatData), [{
text: message,
done: false,
key: Date.now(),
sender: "user",
fileList: fileList[0]
}, {
text: message,
done: false,
loading: true,
key: Date.now(),
sender: "AI",
allowCopy: true
}]));
setIsLoading(true);
setTimeout(function () {
return getData(message);
}, 300);
}
};
var handleKeyPress = function handleKeyPress(e) {
if (e.key === 'Enter') {
var _fileList$;
e.preventDefault();
if (!!(fileList !== null && fileList !== void 0 && fileList.length) && (fileList === null || fileList === void 0 || (_fileList$ = fileList[0]) === null || _fileList$ === void 0 ? void 0 : _fileList$.status) !== "done" || loading) return;
handleSendMessage();
}
};
// // 用户都没有权限了,这块可以直接隐藏掉,就可以不需要做下面的任何事情了
// if (!isShowComponent || !(authority || lookAiUser.includes(userInfo()?.login))) { return <></> }
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [children ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
onClick: onOpen || showDrawer,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Outlet, {}), children]
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(icon, {
onClick: onOpen || showDrawer
}), /*#__PURE__*/(0,jsx_runtime.jsx)(drawer/* default */.Z, {
className: "".concat(DrawerProps !== null && DrawerProps !== void 0 && DrawerProps.open || open ? "body-overflow-hidden" : "", " ").concat(ChatBoxmodules.answerWrp),
width: (DrawerProps === null || DrawerProps === void 0 ? void 0 : DrawerProps.width) || 860,
title: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: ChatBoxmodules.title,
children: title || "头歌AI"
}),
onClose: (DrawerProps === null || DrawerProps === void 0 ? void 0 : DrawerProps.onClose) || onClose,
open: (DrawerProps === null || DrawerProps === void 0 ? void 0 : DrawerProps.open) || open,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ChatBoxmodules["ai-wrp"],
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
ref: scrollBox,
className: ChatBoxmodules["chat-container"],
children: [isShowDefuatTips && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ChatBoxmodules.li,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: ChatBoxmodules.img,
src: aiIcon || "/images/ai_icon.png"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ChatBoxmodules.content,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "c-grey-333 font22",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "mr5",
children: "\uD83D\uDC4B"
}), "\u55E8\uFF0C\u6211\u662F\u5934\u6B4C", isTpiAi ? title : '智能助教', "\uFF0C\u60A8\u7684\u6559\u5B66\u597D\u5E2E\u624B\u3002"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "font16 mt20",
style: {
color: '#434D6C'
},
children: description || '我可以阅读您上传的教案,书籍等教学资料,并根据您的要求为您自动生成任务要求。'
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "font16 mt20",
style: {
color: '#434D6C'
},
children: "\u5FEB\u6765\u8BD5\u4E00\u4E0B\u5427\uFF5E"
}), isTpiAi && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ChatBoxmodules.container,
children: fastBtnItem.map(function (e, i) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
onClick: function onClick() {
return getTpiAiData(e, i);
},
className: ChatBoxmodules.item,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: "mr10",
src: e.img
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#232B40',
fontSize: 16,
fontWeight: 600
},
children: e.name
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt10",
style: {
color: "#434D6C"
},
children: e.des
})]
}, i);
})
})]
})]
}), chatData === null || chatData === void 0 ? void 0 : chatData.map(function (item, i) {
var _chatData;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ChatBoxmodules.li,
style: item.sender === 'AI' && ((_chatData = chatData[i + 1]) === null || _chatData === void 0 ? void 0 : _chatData.sender) !== 'user' ? {
marginBottom: 50
} : {},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: ChatBoxmodules.img,
src: item.sender === "AI" ? aiIcon || "/images/ai_icon.png" : userIcon || "/images/ai_user.png"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(ChatBoxmodules.content, " ").concat(item.sender === "AI" ? '' : ChatBoxmodules.user),
children: item.loading ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ChatBoxmodules["loading-wanx"],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ChatBoxmodules["dot-flashing"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ChatBoxmodules["dot-flashing"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ChatBoxmodules["dot-flashing"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
marginTop: 10,
color: '#9096A3'
},
children: (loadingOption === null || loadingOption === void 0 ? void 0 : loadingOption.text) || "请耐心等待,目前高峰期体验人数过多,我们已记录下您的需求,稍后将自动为您生成答案。"
})]
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [!!item.name && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mb10 font18",
style: {
color: '#232B40',
fontWeight: 600
},
children: item === null || item === void 0 ? void 0 : item.name
}), /*#__PURE__*/(0,jsx_runtime.jsx)(answer, {
scrollBox: scrollBox,
Data: item,
extraEdit: extraEdit
})]
})
})]
}, i);
})]
}), !hideInputBox && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(ChatBoxmodules['footer-container'], " ").concat(fileList.length >= 1 && ChatBoxmodules['has-file']),
children: [!!fileList.length && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
className: "pb5 pt5",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
title: fileList === null || fileList === void 0 || (_fileList$2 = fileList[0]) === null || _fileList$2 === void 0 ? void 0 : _fileList$2.name,
className: "mr10",
children: (0,util/* cutFileName */.tP)(fileList === null || fileList === void 0 || (_fileList$3 = fileList[0]) === null || _fileList$3 === void 0 ? void 0 : _fileList$3.name, 40)
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
onClick: function onClick() {
return setFileList([]);
},
className: "iconfont current icon-shanchu15 delete-hover c-red-ee4 font14"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: fileList.length ? {
paddingLeft: 0
} : {},
className: ChatBoxmodules['input-container'],
children: [!hideUpload && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ChatBoxmodules['footer-container-upload'],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, isReview ? UploadReview : UploadPorops), {}, {
children: !!(fileList !== null && fileList !== void 0 && fileList.length) ? null : /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: ChatBoxmodules['upload-btn'],
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-shangchuan4 c-white"
})
})
}))
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
rows: 1,
placeholder: placeholder || "在这里输入你问题吧~",
value: message,
bordered: false,
onChange: handleMessageChange,
onKeyPress: handleKeyPress
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: ChatBoxmodules['send-btn'],
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-fasong2 c-white"
}),
disabled: !!(fileList !== null && fileList !== void 0 && fileList.length) && (fileList === null || fileList === void 0 || (_fileList$4 = fileList[0]) === null || _fileList$4 === void 0 ? void 0 : _fileList$4.status) !== "done" || loading,
onClick: handleSendMessage
})]
})]
})]
})
})]
});
};
/* harmony default export */ var ChatBox = ((0,_umi_production_exports.connect)(function (_ref6) {
var globalSetting = _ref6.globalSetting;
return {
globalSetting: globalSetting
};
})(ChatBox_TypingCodeComponent));
/***/ })
}]);