@gientech/modual 1.4.3 → 1.4.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/dist/assets/AppLoading-mci3gLZt.js +414 -0
- package/dist/assets/{GientechStreamReader-A8zHypyu.js → GientechStreamReader-4496nAm0.js} +2 -2
- package/dist/assets/{index-B7u9FawR.js → index-7rZAt9P3.js} +1 -1
- package/dist/assets/index-BVENTW1Q.js +13 -0
- package/dist/assets/index-Bb8_WB-l.js +1 -0
- package/dist/assets/{index-rydP_SDR.js → index-BpJ9Bm5x.js} +6 -6
- package/dist/assets/index-CNxDI4h-.js +1078 -0
- package/dist/assets/{index-EcdpegTC.js → index-CWzpBU29.js} +1 -1
- package/dist/assets/{index-DiQ4Me9J.js → index-D1m34Ij7.js} +124 -124
- package/dist/assets/{index-CFlRqq2H.js → index-_gBtdXQV.js} +2 -2
- package/dist/assets/{plus-ufD39rmY.js → plus-CrtEUXaQ.js} +1 -1
- package/dist/assets/style3.css +1 -1
- package/dist/assets/{x-_1-UpSBt.js → x-Dr3EBTzJ.js} +1 -1
- package/dist/chat.d.ts +5 -1
- package/dist/chat.js +69 -78
- package/dist/database.js +2 -2
- package/dist/databaseId.js +2 -2
- package/dist/databaseTable.js +2 -14
- package/dist/index.js +3 -3
- package/dist/modelManage.js +1 -1
- package/dist/package.json +1 -1
- package/dist/sensitive.js +1 -1
- package/dist/streamFilesReader.js +1 -1
- package/package.json +3 -3
- package/scripts/README.md +133 -133
- package/scripts/build-demo.js +88 -88
- package/scripts/demo-selector.js +216 -216
- package/scripts/preview-demo.js +130 -130
- package/scripts/run-demo.bat +34 -34
- package/src/examples/Demo/index.tsx +12 -0
- package/src/examples/chat/index.tsx +8 -21
- package/src/examples/chat/logo03.png +0 -0
- package/src/main.tsx +2 -2
- package/src/main.tsx.backup +2 -2
- package/src/modules/chat/index.tsx +87 -4
- package/src/utils/gientechCommon/components/AppLoading.tsx +10 -10
- package/src/utils/testconfigs/index.ts +1 -1
- package/stats.html +1 -1
- package/dist/assets/AppLoading-BCu9TPs5.js +0 -414
- package/dist/assets/LeftOutlined-BdBZ6FSD.js +0 -1
- package/dist/assets/index-CNJZ9j4J.js +0 -1
- package/dist/assets/index-DfSHCQcq.js +0 -1289
package/dist/chat.js
CHANGED
|
@@ -1,125 +1,99 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as d,jsxs as R,Fragment as $n}from"react/jsx-runtime";import*as F from"react";import Ge,{useRef as Le,useEffect as Se,Component as Mr,createElement as Rt,PureComponent as An,useState as ue,useMemo as Ae}from"react";import{c as Ye,g as rr,az as jr,C as mt,ar as Rr,aR as zr,H as Xe,aG as Nn,h as Ce,u as Lr,k as qr,aK as nr,S as kn,aJ as On,ah as pt,U as Gt,L as Ur,N as Je,aV as Yt,T as Wr,b as Hr,r as Vr,t as Re,q as Qt,aW as Bn,aA as _n,aD as Tn,aB as Pn,aX as Mn,ag as wt,Q as jn,aY as rt,aZ as Oe,_ as Ve,a_ as Xr,a$ as Jr,b0 as Kr,V as Ee,b1 as $e,b2 as Gr,O as Rn,aO as Yr,b3 as Qr,b4 as cr,b5 as zn,b6 as Ln,w as Zr,b7 as qn,b8 as Un,au as Wn,o as ur,ay as dr,b9 as Hn,ab as ze,ba as Vn,bb as pr,a as je,aU as or,bc as Xn,bd as en,ad as tn,F as fr,I as Jn,be as Kn}from"./assets/index-D1m34Ij7.js";import{h as Gn,v as Yn,C as Qn,H as Zn,A as eo,F as to}from"./assets/AppLoading-mci3gLZt.js";import{D as ro,z as mr}from"./assets/index-CNxDI4h-.js";import{u as it}from"./assets/index-CpW6Dhpp.js";/* empty css */import{P as rn}from"./assets/plus-CrtEUXaQ.js";import{X as ar}from"./assets/x-Dr3EBTzJ.js";import{A as no,i as oo,s as be,M as sr,S as It}from"./assets/index-BpJ9Bm5x.js";import{g as gr,a as ao,P as nn}from"./assets/index-CWzpBU29.js";import{flushSync as hr}from"react-dom";import"./assets/index-BVENTW1Q.js";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const so=Ye("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
7
7
|
* @license lucide-react v0.456.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const
|
|
11
|
+
*/const io=Ye("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
12
12
|
* @license lucide-react v0.456.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const
|
|
16
|
+
*/const zt=Ye("FolderUp",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);/**
|
|
17
17
|
* @license lucide-react v0.456.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const lo=Ye("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
|
22
22
|
* @license lucide-react v0.456.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const
|
|
26
|
+
*/const co=Ye("OctagonX",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
27
27
|
* @license lucide-react v0.456.0 - ISC
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const
|
|
31
|
+
*/const uo=Ye("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
|
|
32
32
|
* @license lucide-react v0.456.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const
|
|
36
|
+
*/const on=Ye("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
37
37
|
* @license lucide-react v0.456.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const
|
|
41
|
+
*/const po=Ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
42
42
|
* @license lucide-react v0.456.0 - ISC
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const Ni=Pt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var Oi=vt.ESC,Di=vt.TAB;function Pi(e){var n=e.visible,t=e.triggerRef,r=e.onVisibleChange,o=e.autoFocus,a=e.overlayRef,i=l.useRef(!1),s=function(){if(n){var m,h;(m=t.current)===null||m===void 0||(h=m.focus)===null||h===void 0||h.call(m),r==null||r(!1)}},u=function(){var m;return(m=a.current)!==null&&m!==void 0&&m.focus?(a.current.focus(),i.current=!0,!0):!1},d=function(m){switch(m.keyCode){case Oi:s();break;case Di:{var h=!1;i.current||(h=u()),h?m.preventDefault():s();break}}};l.useEffect(function(){return n?(window.addEventListener("keydown",d),o&&Xt(u,3),function(){window.removeEventListener("keydown",d),i.current=!1}):function(){i.current=!1}},[n])}var Ai=br(function(e,n){var t=e.overlay,r=e.arrow,o=e.prefixCls,a=Ge(function(){var s;return typeof t=="function"?s=t():s=t,s},[t]),i=ko(n,yr(a));return Be.createElement(Be.Fragment,null,r&&Be.createElement("div",{className:"".concat(o,"-arrow")}),Be.cloneElement(a,{ref:Mo(a)?i:void 0}))}),Ut={adjustX:1,adjustY:1},Wt=[0,0],ki={topLeft:{points:["bl","tl"],overflow:Ut,offset:[0,-4],targetOffset:Wt},top:{points:["bc","tc"],overflow:Ut,offset:[0,-4],targetOffset:Wt},topRight:{points:["br","tr"],overflow:Ut,offset:[0,-4],targetOffset:Wt},bottomLeft:{points:["tl","bl"],overflow:Ut,offset:[0,4],targetOffset:Wt},bottom:{points:["tc","bc"],overflow:Ut,offset:[0,4],targetOffset:Wt},bottomRight:{points:["tr","br"],overflow:Ut,offset:[0,4],targetOffset:Wt}},Mi=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function Ri(e,n){var t,r=e.arrow,o=r===void 0?!1:r,a=e.prefixCls,i=a===void 0?"rc-dropdown":a,s=e.transitionName,u=e.animation,d=e.align,f=e.placement,m=f===void 0?"bottomLeft":f,h=e.placements,x=h===void 0?ki:h,w=e.getPopupContainer,c=e.showAction,p=e.hideAction,C=e.overlayClassName,b=e.overlayStyle,I=e.visible,S=e.trigger,y=S===void 0?["hover"]:S,F=e.autoFocus,D=e.overlay,O=e.children,N=e.onVisibleChange,E=ot(e,Mi),_=Be.useState(),T=Ke(_,2),k=T[0],M=T[1],B="visible"in e?I:k,V=Be.useRef(null),j=Be.useRef(null),U=Be.useRef(null);Be.useImperativeHandle(n,function(){return V.current});var K=function(Q){M(Q),N==null||N(Q)};Pi({visible:B,triggerRef:U,onVisibleChange:K,autoFocus:F,overlayRef:j});var L=function(Q){var ie=e.onOverlayClick;M(!1),ie&&ie(Q)},q=function(){return Be.createElement(Ai,{ref:j,overlay:D,prefixCls:i,arrow:o})},ee=function(){return typeof D=="function"?q:q()},R=function(){var Q=e.minOverlayWidthMatchTrigger,ie=e.alignPoint;return"minOverlayWidthMatchTrigger"in e?Q:!ie},W=function(){var Q=e.openClassName;return Q!==void 0?Q:"".concat(i,"-open")},J=Be.cloneElement(O,{className:Z((t=O.props)===null||t===void 0?void 0:t.className,B&&W()),ref:Mo(O)?ko(U,yr(O)):void 0}),oe=p;return!oe&&y.indexOf("contextMenu")!==-1&&(oe=["click"]),Be.createElement(Ro,De({builtinPlacements:x},E,{prefixCls:i,ref:V,popupClassName:Z(C,re({},"".concat(i,"-show-arrow"),o)),popupStyle:b,action:y,showAction:c,hideAction:oe,popupPlacement:m,popupAlign:d,popupTransitionName:s,popupAnimation:u,popupVisible:B,stretch:R()?"minWidth":"",popup:ee(),onPopupVisibleChange:K,onPopupClick:L,getPopupContainer:w}),J)}const Bi=Be.forwardRef(Ri),Ti=e=>typeof e!="object"&&typeof e!="function"||e===null;var Yo=l.createContext(null);function Qo(e,n){return e===void 0?null:"".concat(e,"-").concat(n)}function Zo(e){var n=l.useContext(Yo);return Qo(n,e)}var _i=["children","locked"],ht=l.createContext(null);function zi(e,n){var t=ze({},e);return Object.keys(n).forEach(function(r){var o=n[r];o!==void 0&&(t[r]=o)}),t}function ln(e){var n=e.children,t=e.locked,r=ot(e,_i),o=l.useContext(ht),a=Oa(function(){return zi(o,r)},[o,r],function(i,s){return!t&&(i[0]!==s[0]||!Bo(i[1],s[1],!0))});return l.createElement(ht.Provider,{value:a},n)}var ji=[],ea=l.createContext(null);function Dn(){return l.useContext(ea)}var ta=l.createContext(ji);function Yt(e){var n=l.useContext(ta);return l.useMemo(function(){return e!==void 0?[].concat(Ye(n),[e]):n},[n,e])}var na=l.createContext(null),kr=l.createContext({});function Yr(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Da(e)){var t=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(t)||e.isContentEditable||t==="a"&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),a=Number(o),i=null;return o&&!Number.isNaN(a)?i=a:r&&i===null&&(i=0),r&&e.disabled&&(i=null),i!==null&&(i>=0||n&&i<0)}return!1}function Li(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=Ye(e.querySelectorAll("*")).filter(function(r){return Yr(r,n)});return Yr(e,n)&&t.unshift(e),t}var cr=vt.LEFT,ur=vt.RIGHT,dr=vt.UP,Cn=vt.DOWN,xn=vt.ENTER,ra=vt.ESC,en=vt.HOME,tn=vt.END,Qr=[dr,Cn,cr,ur];function Hi(e,n,t,r){var o,a="prev",i="next",s="children",u="parent";if(e==="inline"&&r===xn)return{inlineTrigger:!0};var d=re(re({},dr,a),Cn,i),f=re(re(re(re({},cr,t?i:a),ur,t?a:i),Cn,s),xn,s),m=re(re(re(re(re(re({},dr,a),Cn,i),xn,s),ra,u),cr,t?s:u),ur,t?u:s),h={inline:d,horizontal:f,vertical:m,inlineSub:d,horizontalSub:m,verticalSub:m},x=(o=h["".concat(e).concat(n?"":"Sub")])===null||o===void 0?void 0:o[r];switch(x){case a:return{offset:-1,sibling:!0};case i:return{offset:1,sibling:!0};case u:return{offset:-1,sibling:!1};case s:return{offset:1,sibling:!1};default:return null}}function qi(e){for(var n=e;n;){if(n.getAttribute("data-menu-list"))return n;n=n.parentElement}return null}function Ui(e,n){for(var t=e||document.activeElement;t;){if(n.has(t))return t;t=t.parentElement}return null}function Mr(e,n){var t=Li(e,!0);return t.filter(function(r){return n.has(r)})}function Zr(e,n,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var o=Mr(e,n),a=o.length,i=o.findIndex(function(s){return t===s});return r<0?i===-1?i=a-1:i-=1:r>0&&(i+=1),i=(i+a)%a,o[i]}var pr=function(n,t){var r=new Set,o=new Map,a=new Map;return n.forEach(function(i){var s=document.querySelector("[data-menu-id='".concat(Qo(t,i),"']"));s&&(r.add(s),a.set(s,i),o.set(i,s))}),{elements:r,key2element:o,element2key:a}};function Wi(e,n,t,r,o,a,i,s,u,d){var f=l.useRef(),m=l.useRef();m.current=n;var h=function(){Xt.cancel(f.current)};return l.useEffect(function(){return function(){h()}},[]),function(x){var w=x.which;if([].concat(Qr,[xn,ra,en,tn]).includes(w)){var c=a(),p=pr(c,r),C=p,b=C.elements,I=C.key2element,S=C.element2key,y=I.get(n),F=Ui(y,b),D=S.get(F),O=Hi(e,i(D,!0).length===1,t,w);if(!O&&w!==en&&w!==tn)return;(Qr.includes(w)||[en,tn].includes(w))&&x.preventDefault();var N=function(j){if(j){var U=j,K=j.querySelector("a");K!=null&&K.getAttribute("href")&&(U=K);var L=S.get(j);s(L),h(),f.current=Xt(function(){m.current===L&&U.focus()})}};if([en,tn].includes(w)||O.sibling||!F){var E;!F||e==="inline"?E=o.current:E=qi(F);var _,T=Mr(E,b);w===en?_=T[0]:w===tn?_=T[T.length-1]:_=Zr(E,b,F,O.offset),N(_)}else if(O.inlineTrigger)u(D);else if(O.offset>0)u(D,!0),h(),f.current=Xt(function(){p=pr(c,r);var V=F.getAttribute("aria-controls"),j=document.getElementById(V),U=Zr(j,p.elements);N(U)},5);else if(O.offset<0){var k=i(D,!0),M=k[k.length-2],B=I.get(M);u(M,!1),N(B)}}d==null||d(x)}}function Vi(e){Promise.resolve().then(e)}var Rr="__RC_UTIL_PATH_SPLIT__",eo=function(n){return n.join(Rr)},Ki=function(n){return n.split(Rr)},mr="rc-menu-more";function Xi(){var e=l.useState({}),n=Ke(e,2),t=n[1],r=Xe(new Map),o=Xe(new Map),a=l.useState([]),i=Ke(a,2),s=i[0],u=i[1],d=Xe(0),f=Xe(!1),m=function(){f.current||t({})},h=qt(function(I,S){var y=eo(S);o.current.set(y,I),r.current.set(I,y),d.current+=1;var F=d.current;Vi(function(){F===d.current&&m()})},[]),x=qt(function(I,S){var y=eo(S);o.current.delete(y),r.current.delete(I)},[]),w=qt(function(I){u(I)},[]),c=qt(function(I,S){var y=r.current.get(I)||"",F=Ki(y);return S&&s.includes(F[0])&&F.unshift(mr),F},[s]),p=qt(function(I,S){return I.filter(function(y){return y!==void 0}).some(function(y){var F=c(y,!0);return F.includes(S)})},[c]),C=function(){var S=Ye(r.current.keys());return s.length&&S.push(mr),S},b=qt(function(I){var S="".concat(r.current.get(I)).concat(Rr),y=new Set;return Ye(o.current.keys()).forEach(function(F){F.startsWith(S)&&y.add(o.current.get(F))}),y},[]);return l.useEffect(function(){return function(){f.current=!0}},[]),{registerPath:h,unregisterPath:x,refreshOverflowKeys:w,isSubPathKey:p,getKeyPath:c,getKeys:C,getSubPathKeys:b}}function nn(e){var n=l.useRef(e);n.current=e;var t=l.useCallback(function(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(r=n.current)===null||r===void 0?void 0:r.call.apply(r,[n].concat(a))},[]);return e?t:void 0}var Gi=Math.random().toFixed(5).toString().slice(2),to=0;function Ji(e){var n=Lt(e,{value:e}),t=Ke(n,2),r=t[0],o=t[1];return l.useEffect(function(){to+=1;var a="".concat(Gi,"-").concat(to);o("rc-menu-uuid-".concat(a))},[]),r}function oa(e,n,t,r){var o=l.useContext(ht),a=o.activeKey,i=o.onActive,s=o.onInactive,u={active:a===e};return n||(u.onMouseEnter=function(d){t==null||t({key:e,domEvent:d}),i(e)},u.onMouseLeave=function(d){r==null||r({key:e,domEvent:d}),s(e)}),u}function aa(e){var n=l.useContext(ht),t=n.mode,r=n.rtl,o=n.inlineIndent;if(t!=="inline")return null;var a=e;return r?{paddingRight:a*o}:{paddingLeft:a*o}}function ia(e){var n=e.icon,t=e.props,r=e.children,o;return n===null||n===!1?null:(typeof n=="function"?o=l.createElement(n,ze({},t)):typeof n!="boolean"&&(o=n),o||r||null)}var Yi=["item"];function In(e){var n=e.item,t=ot(e,Yi);return Object.defineProperty(t,"item",{get:function(){return Cr(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),n}}),t}var Qi=["title","attribute","elementRef"],Zi=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],es=["active"],ts=(function(e){xr(t,e);var n=wr(t);function t(){return $r(this,t),n.apply(this,arguments)}return Ir(t,[{key:"render",value:function(){var o=this.props,a=o.title,i=o.attribute,s=o.elementRef,u=ot(o,Qi),d=xt(u,["eventKey","popupClassName","popupOffset","onTitleClick"]);return Cr(!i,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),l.createElement(an.Item,De({},i,{title:typeof a=="string"?a:void 0},d,{ref:s}))}}]),t})(l.Component),ns=l.forwardRef(function(e,n){var t=e.style,r=e.className,o=e.eventKey;e.warnKey;var a=e.disabled,i=e.itemIcon,s=e.children,u=e.role,d=e.onMouseEnter,f=e.onMouseLeave,m=e.onClick,h=e.onKeyDown,x=e.onFocus,w=ot(e,Zi),c=Zo(o),p=l.useContext(ht),C=p.prefixCls,b=p.onItemClick,I=p.disabled,S=p.overflowDisabled,y=p.itemIcon,F=p.selectedKeys,D=p.onActive,O=l.useContext(kr),N=O._internalRenderMenuItem,E="".concat(C,"-item"),_=l.useRef(),T=l.useRef(),k=I||a,M=To(n,T),B=Yt(o),V=function(ie){return{key:o,keyPath:Ye(B).reverse(),item:_.current,domEvent:ie}},j=i||y,U=oa(o,k,d,f),K=U.active,L=ot(U,es),q=F.includes(o),ee=aa(B.length),R=function(ie){if(!k){var Ce=V(ie);m==null||m(In(Ce)),b(Ce)}},W=function(ie){if(h==null||h(ie),ie.which===vt.ENTER){var Ce=V(ie);m==null||m(In(Ce)),b(Ce)}},J=function(ie){D(o),x==null||x(ie)},oe={};e.role==="option"&&(oe["aria-selected"]=q);var ae=l.createElement(ts,De({ref:_,elementRef:M,role:u===null?"none":u||"menuitem",tabIndex:a?null:-1,"data-menu-id":S&&c?null:c},xt(w,["extra"]),L,oe,{component:"li","aria-disabled":a,style:ze(ze({},ee),t),className:Z(E,re(re(re({},"".concat(E,"-active"),K),"".concat(E,"-selected"),q),"".concat(E,"-disabled"),k),r),onClick:R,onKeyDown:W,onFocus:J}),s,l.createElement(ia,{props:ze(ze({},e),{},{isSelected:q}),icon:j}));return N&&(ae=N(ae,e,{selected:q})),ae});function rs(e,n){var t=e.eventKey,r=Dn(),o=Yt(t);return l.useEffect(function(){if(r)return r.registerPath(t,o),function(){r.unregisterPath(t,o)}},[o]),r?null:l.createElement(ns,De({},e,{ref:n}))}const Pn=l.forwardRef(rs);var os=["className","children"],as=function(n,t){var r=n.className,o=n.children,a=ot(n,os),i=l.useContext(ht),s=i.prefixCls,u=i.mode,d=i.rtl;return l.createElement("ul",De({className:Z(s,d&&"".concat(s,"-rtl"),"".concat(s,"-sub"),"".concat(s,"-").concat(u==="inline"?"inline":"vertical"),r),role:"menu"},a,{"data-menu-list":!0,ref:t}),o)},Br=l.forwardRef(as);Br.displayName="SubMenuList";function Tr(e,n){return Sr(e).map(function(t,r){if(l.isValidElement(t)){var o,a,i=t.key,s=(o=(a=t.props)===null||a===void 0?void 0:a.eventKey)!==null&&o!==void 0?o:i,u=s==null;u&&(s="tmp_key-".concat([].concat(Ye(n),[r]).join("-")));var d={key:s,eventKey:s};return l.cloneElement(t,d)}return t})}var Ze={adjustX:1,adjustY:1},is={topLeft:{points:["bl","tl"],overflow:Ze},topRight:{points:["br","tr"],overflow:Ze},bottomLeft:{points:["tl","bl"],overflow:Ze},bottomRight:{points:["tr","br"],overflow:Ze},leftTop:{points:["tr","tl"],overflow:Ze},leftBottom:{points:["br","bl"],overflow:Ze},rightTop:{points:["tl","tr"],overflow:Ze},rightBottom:{points:["bl","br"],overflow:Ze}},ss={topLeft:{points:["bl","tl"],overflow:Ze},topRight:{points:["br","tr"],overflow:Ze},bottomLeft:{points:["tl","bl"],overflow:Ze},bottomRight:{points:["tr","br"],overflow:Ze},rightTop:{points:["tr","tl"],overflow:Ze},rightBottom:{points:["br","bl"],overflow:Ze},leftTop:{points:["tl","tr"],overflow:Ze},leftBottom:{points:["bl","br"],overflow:Ze}};function sa(e,n,t){if(n)return n;if(t)return t[e]||t.other}var ls={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function cs(e){var n=e.prefixCls,t=e.visible,r=e.children,o=e.popup,a=e.popupStyle,i=e.popupClassName,s=e.popupOffset,u=e.disabled,d=e.mode,f=e.onVisibleChange,m=l.useContext(ht),h=m.getPopupContainer,x=m.rtl,w=m.subMenuOpenDelay,c=m.subMenuCloseDelay,p=m.builtinPlacements,C=m.triggerSubMenuAction,b=m.forceSubMenuRender,I=m.rootClassName,S=m.motion,y=m.defaultMotions,F=l.useState(!1),D=Ke(F,2),O=D[0],N=D[1],E=x?ze(ze({},ss),p):ze(ze({},is),p),_=ls[d],T=sa(d,S,y),k=l.useRef(T);d!=="inline"&&(k.current=T);var M=ze(ze({},k.current),{},{leavedClassName:"".concat(n,"-hidden"),removeOnLeave:!1,motionAppear:!0}),B=l.useRef();return l.useEffect(function(){return B.current=Xt(function(){N(t)}),function(){Xt.cancel(B.current)}},[t]),l.createElement(Ro,{prefixCls:n,popupClassName:Z("".concat(n,"-popup"),re({},"".concat(n,"-rtl"),x),i,I),stretch:d==="horizontal"?"minWidth":null,getPopupContainer:h,builtinPlacements:E,popupPlacement:_,popupVisible:O,popup:o,popupStyle:a,popupAlign:s&&{offset:s},action:u?[]:[C],mouseEnterDelay:w,mouseLeaveDelay:c,onPopupVisibleChange:f,forceRender:b,popupMotion:M,fresh:!0},r)}function us(e){var n=e.id,t=e.open,r=e.keyPath,o=e.children,a="inline",i=l.useContext(ht),s=i.prefixCls,u=i.forceSubMenuRender,d=i.motion,f=i.defaultMotions,m=i.mode,h=l.useRef(!1);h.current=m===a;var x=l.useState(!h.current),w=Ke(x,2),c=w[0],p=w[1],C=h.current?t:!1;l.useEffect(function(){h.current&&p(!1)},[m]);var b=ze({},sa(a,d,f));r.length>1&&(b.motionAppear=!1);var I=b.onVisibleChanged;return b.onVisibleChanged=function(S){return!h.current&&!S&&p(!0),I==null?void 0:I(S)},c?null:l.createElement(ln,{mode:a,locked:!h.current},l.createElement(Er,De({visible:C},b,{forceRender:u,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(S){var y=S.className,F=S.style;return l.createElement(Br,{id:n,className:y,style:F},o)}))}var ds=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],ps=["active"],ms=l.forwardRef(function(e,n){var t=e.style,r=e.className,o=e.title,a=e.eventKey;e.warnKey;var i=e.disabled,s=e.internalPopupClose,u=e.children,d=e.itemIcon,f=e.expandIcon,m=e.popupClassName,h=e.popupOffset,x=e.popupStyle,w=e.onClick,c=e.onMouseEnter,p=e.onMouseLeave,C=e.onTitleClick,b=e.onTitleMouseEnter,I=e.onTitleMouseLeave,S=ot(e,ds),y=Zo(a),F=l.useContext(ht),D=F.prefixCls,O=F.mode,N=F.openKeys,E=F.disabled,_=F.overflowDisabled,T=F.activeKey,k=F.selectedKeys,M=F.itemIcon,B=F.expandIcon,V=F.onItemClick,j=F.onOpenChange,U=F.onActive,K=l.useContext(kr),L=K._internalRenderSubMenuItem,q=l.useContext(na),ee=q.isSubPathKey,R=Yt(),W="".concat(D,"-submenu"),J=E||i,oe=l.useRef(),ae=l.useRef(),Q=d??M,ie=f??B,Ce=N.includes(a),xe=!_&&Ce,we=ee(k,a),Te=oa(a,J,b,I),Je=Te.active,Le=ot(Te,ps),ve=l.useState(!1),me=Ke(ve,2),ct=me[0],mt=me[1],$t=function(G){J||mt(G)},It=function(G){$t(!0),c==null||c({key:a,domEvent:G})},At=function(G){$t(!1),p==null||p({key:a,domEvent:G})},et=l.useMemo(function(){return Je||(O!=="inline"?ct||ee([T],a):!1)},[O,Je,T,ct,a,ee]),qe=aa(R.length),St=function(G){J||(C==null||C({key:a,domEvent:G}),O==="inline"&&j(a,!Ce))},kt=nn(function(We){w==null||w(In(We)),V(We)}),Mt=function(G){O!=="inline"&&j(a,G)},Et=function(){U(a)},Ae=y&&"".concat(y,"-popup"),ce=l.useMemo(function(){return l.createElement(ia,{icon:O!=="horizontal"?ie:void 0,props:ze(ze({},e),{},{isOpen:xe,isSubMenu:!0})},l.createElement("i",{className:"".concat(W,"-arrow")}))},[O,ie,e,xe,W]),nt=l.createElement("div",De({role:"menuitem",style:qe,className:"".concat(W,"-title"),tabIndex:J?null:-1,ref:oe,title:typeof o=="string"?o:null,"data-menu-id":_&&y?null:y,"aria-expanded":xe,"aria-haspopup":!0,"aria-controls":Ae,"aria-disabled":J,onClick:St,onFocus:Et},Le),o,ce),ut=l.useRef(O);if(O!=="inline"&&R.length>1?ut.current="vertical":ut.current=O,!_){var ft=ut.current;nt=l.createElement(cs,{mode:ft,prefixCls:W,visible:!s&&xe&&O!=="inline",popupClassName:m,popupOffset:h,popupStyle:x,popup:l.createElement(ln,{mode:ft==="horizontal"?"vertical":ft},l.createElement(Br,{id:Ae,ref:ae},u)),disabled:J,onVisibleChange:Mt},nt)}var Ue=l.createElement(an.Item,De({ref:n,role:"none"},S,{component:"li",style:t,className:Z(W,"".concat(W,"-").concat(O),r,re(re(re(re({},"".concat(W,"-open"),xe),"".concat(W,"-active"),et),"".concat(W,"-selected"),we),"".concat(W,"-disabled"),J)),onMouseEnter:It,onMouseLeave:At}),nt,!_&&l.createElement(us,{id:Ae,open:xe,keyPath:R},u));return L&&(Ue=L(Ue,e,{selected:we,active:et,open:xe,disabled:J})),l.createElement(ln,{onItemClick:kt,mode:O==="horizontal"?"vertical":O,itemIcon:Q,expandIcon:ie},Ue)}),An=l.forwardRef(function(e,n){var t=e.eventKey,r=e.children,o=Yt(t),a=Tr(r,o),i=Dn();l.useEffect(function(){if(i)return i.registerPath(t,o),function(){i.unregisterPath(t,o)}},[o]);var s;return i?s=a:s=l.createElement(ms,De({ref:n},e),a),l.createElement(ta.Provider,{value:o},s)});function _r(e){var n=e.className,t=e.style,r=l.useContext(ht),o=r.prefixCls,a=Dn();return a?null:l.createElement("li",{role:"separator",className:Z("".concat(o,"-item-divider"),n),style:t})}var fs=["className","title","eventKey","children"],gs=l.forwardRef(function(e,n){var t=e.className,r=e.title;e.eventKey;var o=e.children,a=ot(e,fs),i=l.useContext(ht),s=i.prefixCls,u="".concat(s,"-item-group");return l.createElement("li",De({ref:n,role:"presentation"},a,{onClick:function(f){return f.stopPropagation()},className:Z(u,t)}),l.createElement("div",{role:"presentation",className:"".concat(u,"-title"),title:typeof r=="string"?r:void 0},r),l.createElement("ul",{role:"group",className:"".concat(u,"-list")},o))}),zr=l.forwardRef(function(e,n){var t=e.eventKey,r=e.children,o=Yt(t),a=Tr(r,o),i=Dn();return i?a:l.createElement(gs,De({ref:n},xt(e,["warnKey"])),a)}),hs=["label","children","key","type","extra"];function fr(e,n,t){var r=n.item,o=n.group,a=n.submenu,i=n.divider;return(e||[]).map(function(s,u){if(s&&jt(s)==="object"){var d=s,f=d.label,m=d.children,h=d.key,x=d.type,w=d.extra,c=ot(d,hs),p=h??"tmp-".concat(u);return m||x==="group"?x==="group"?l.createElement(o,De({key:p},c,{title:f}),fr(m,n,t)):l.createElement(a,De({key:p},c,{title:f}),fr(m,n,t)):x==="divider"?l.createElement(i,De({key:p},c)):l.createElement(r,De({key:p},c,{extra:w}),f,(!!w||w===0)&&l.createElement("span",{className:"".concat(t,"-item-extra")},w))}return null}).filter(function(s){return s})}function no(e,n,t,r,o){var a=e,i=ze({divider:_r,item:Pn,group:zr,submenu:An},r);return n&&(a=fr(n,i,o)),Tr(a,t)}var vs=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],zt=[],bs=l.forwardRef(function(e,n){var t,r=e,o=r.prefixCls,a=o===void 0?"rc-menu":o,i=r.rootClassName,s=r.style,u=r.className,d=r.tabIndex,f=d===void 0?0:d,m=r.items,h=r.children,x=r.direction,w=r.id,c=r.mode,p=c===void 0?"vertical":c,C=r.inlineCollapsed,b=r.disabled,I=r.disabledOverflow,S=r.subMenuOpenDelay,y=S===void 0?.1:S,F=r.subMenuCloseDelay,D=F===void 0?.1:F,O=r.forceSubMenuRender,N=r.defaultOpenKeys,E=r.openKeys,_=r.activeKey,T=r.defaultActiveFirst,k=r.selectable,M=k===void 0?!0:k,B=r.multiple,V=B===void 0?!1:B,j=r.defaultSelectedKeys,U=r.selectedKeys,K=r.onSelect,L=r.onDeselect,q=r.inlineIndent,ee=q===void 0?24:q,R=r.motion,W=r.defaultMotions,J=r.triggerSubMenuAction,oe=J===void 0?"hover":J,ae=r.builtinPlacements,Q=r.itemIcon,ie=r.expandIcon,Ce=r.overflowedIndicator,xe=Ce===void 0?"...":Ce,we=r.overflowedIndicatorPopupClassName,Te=r.getPopupContainer,Je=r.onClick,Le=r.onOpenChange,ve=r.onKeyDown;r.openAnimation,r.openTransitionName;var me=r._internalRenderMenuItem,ct=r._internalRenderSubMenuItem,mt=r._internalComponents,$t=ot(r,vs),It=l.useMemo(function(){return[no(h,m,zt,mt,a),no(h,m,zt,{},a)]},[h,m,mt]),At=Ke(It,2),et=At[0],qe=At[1],St=l.useState(!1),kt=Ke(St,2),Mt=kt[0],Et=kt[1],Ae=l.useRef(),ce=Ji(w),nt=x==="rtl",ut=Lt(N,{value:E,postState:function(Ee){return Ee||zt}}),ft=Ke(ut,2),Ue=ft[0],We=ft[1],G=function(Ee){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function it(){We(Ee),Le==null||Le(Ee)}Me?lr(it):it()},pe=l.useState(Ue),Fe=Ke(pe,2),se=Fe[0],be=Fe[1],_e=l.useRef(!1),at=l.useMemo(function(){return(p==="inline"||p==="vertical")&&C?["vertical",C]:[p,!1]},[p,C]),dt=Ke(at,2),tt=dt[0],Ft=dt[1],pn=tt==="inline",Rn=l.useState(tt),mn=Ke(Rn,2),bt=mn[0],Bn=mn[1],Tn=l.useState(Ft),fn=Ke(Tn,2),_n=fn[0],zn=fn[1];l.useEffect(function(){Bn(tt),zn(Ft),_e.current&&(pn?We(se):G(zt))},[tt,Ft]);var jn=l.useState(0),gn=Ke(jn,2),Nt=gn[0],Ln=gn[1],gt=Nt>=et.length-1||bt!=="horizontal"||I;l.useEffect(function(){pn&&be(Ue)},[Ue]),l.useEffect(function(){return _e.current=!0,function(){_e.current=!1}},[]);var Ot=Xi(),Qt=Ot.registerPath,Hn=Ot.unregisterPath,qn=Ot.refreshOverflowKeys,v=Ot.isSubPathKey,g=Ot.getKeyPath,P=Ot.getKeys,A=Ot.getSubPathKeys,H=l.useMemo(function(){return{registerPath:Qt,unregisterPath:Hn}},[Qt,Hn]),X=l.useMemo(function(){return{isSubPathKey:v}},[v]);l.useEffect(function(){qn(gt?zt:et.slice(Nt+1).map(function(ke){return ke.key}))},[Nt,gt]);var ge=Lt(_||T&&((t=et[0])===null||t===void 0?void 0:t.key),{value:_}),te=Ke(ge,2),he=te[0],Se=te[1],z=nn(function(ke){Se(ke)}),ye=nn(function(){Se(void 0)});Po(n,function(){return{list:Ae.current,focus:function(Ee){var Me,it=P(),st=pr(it,ce),hn=st.elements,Un=st.key2element,Ia=st.element2key,Lr=Mr(Ae.current,hn),Hr=he??(Lr[0]?Ia.get(Lr[0]):(Me=et.find(function(Sa){return!Sa.props.disabled}))===null||Me===void 0?void 0:Me.key),Zt=Un.get(Hr);if(Hr&&Zt){var Wn;Zt==null||(Wn=Zt.focus)===null||Wn===void 0||Wn.call(Zt,Ee)}}}});var fe=Lt(j||[],{value:U,postState:function(Ee){return Array.isArray(Ee)?Ee:Ee==null?zt:[Ee]}}),Ne=Ke(fe,2),le=Ne[0],He=Ne[1],ue=function(Ee){if(M){var Me=Ee.key,it=le.includes(Me),st;V?it?st=le.filter(function(Un){return Un!==Me}):st=[].concat(Ye(le),[Me]):st=[Me],He(st);var hn=ze(ze({},Ee),{},{selectedKeys:st});it?L==null||L(hn):K==null||K(hn)}!V&&Ue.length&&bt!=="inline"&&G(zt)},de=nn(function(ke){Je==null||Je(In(ke)),ue(ke)}),$e=nn(function(ke,Ee){var Me=Ue.filter(function(st){return st!==ke});if(Ee)Me.push(ke);else if(bt!=="inline"){var it=A(ke);Me=Me.filter(function(st){return!it.has(st)})}Bo(Ue,Me,!0)||G(Me,!0)}),Pe=function(Ee,Me){var it=Me??!Ue.includes(Ee);$e(Ee,it)},Oe=Wi(bt,he,nt,ce,Ae,P,g,Se,Pe,ve);l.useEffect(function(){Et(!0)},[]);var Dt=l.useMemo(function(){return{_internalRenderMenuItem:me,_internalRenderSubMenuItem:ct}},[me,ct]),yt=bt!=="horizontal"||I?et:et.map(function(ke,Ee){return l.createElement(ln,{key:ke.key,overflowDisabled:Ee>Nt},ke)}),_t=l.createElement(an,De({id:w,ref:Ae,prefixCls:"".concat(a,"-overflow"),component:"ul",itemComponent:Pn,className:Z(a,"".concat(a,"-root"),"".concat(a,"-").concat(bt),u,re(re({},"".concat(a,"-inline-collapsed"),_n),"".concat(a,"-rtl"),nt),i),dir:x,style:s,role:"menu",tabIndex:f,data:yt,renderRawItem:function(Ee){return Ee},renderRawRest:function(Ee){var Me=Ee.length,it=Me?et.slice(-Me):null;return l.createElement(An,{eventKey:mr,title:xe,disabled:gt,internalPopupClose:Me===0,popupClassName:we},it)},maxCount:bt!=="horizontal"||I?an.INVALIDATE:an.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Ee){Ln(Ee)},onKeyDown:Oe},$t));return l.createElement(kr.Provider,{value:Dt},l.createElement(Yo.Provider,{value:ce},l.createElement(ln,{prefixCls:a,rootClassName:i,mode:bt,openKeys:Ue,rtl:nt,disabled:b,motion:Mt?R:null,defaultMotions:Mt?W:null,activeKey:he,onActive:z,onInactive:ye,selectedKeys:le,inlineIndent:ee,subMenuOpenDelay:y,subMenuCloseDelay:D,forceSubMenuRender:O,builtinPlacements:ae,triggerSubMenuAction:oe,getPopupContainer:Te,itemIcon:Q,expandIcon:ie,onItemClick:de,onOpenChange:$e},l.createElement(na.Provider,{value:X},_t),l.createElement("div",{style:{display:"none"},"aria-hidden":!0},l.createElement(ea.Provider,{value:H},qe)))))}),un=bs;un.Item=Pn;un.SubMenu=An;un.ItemGroup=zr;un.Divider=_r;const la=l.createContext({});var ys={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},Cs=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:ys}))},ca=l.forwardRef(Cs);const Sn=Fa({prefixCls:"",firstLevel:!0,inlineCollapsed:!1});var xs=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const ua=e=>{const{prefixCls:n,className:t,dashed:r}=e,o=xs(e,["prefixCls","className","dashed"]),{getPrefixCls:a}=l.useContext(wt),i=a("menu",n),s=Z({[`${i}-item-divider-dashed`]:!!r},t);return l.createElement(_r,Object.assign({className:s},o))},da=e=>{var n;const{className:t,children:r,icon:o,title:a,danger:i,extra:s}=e,{prefixCls:u,firstLevel:d,direction:f,disableMenuItemTitleTooltip:m,inlineCollapsed:h}=l.useContext(Sn),x=I=>{const S=r==null?void 0:r[0],y=l.createElement("span",{className:Z(`${u}-title-content`,{[`${u}-title-content-with-extra`]:!!s||s===0})},r);return(!o||l.isValidElement(r)&&r.type==="span")&&r&&I&&d&&typeof S=="string"?l.createElement("div",{className:`${u}-inline-collapsed-noicon`},S.charAt(0)):y},{siderCollapsed:w}=l.useContext(la);let c=a;typeof a>"u"?c=d?r:"":a===!1&&(c="");const p={title:c};!w&&!h&&(p.title=null,p.open=!1);const C=Sr(r).length;let b=l.createElement(Pn,Object.assign({},xt(e,["title","icon","danger"]),{className:Z({[`${u}-item-danger`]:i,[`${u}-item-only-child`]:(o?C+1:C)===1},t),title:typeof a=="string"?a:void 0}),Gt(o,{className:Z(l.isValidElement(o)?(n=o.props)===null||n===void 0?void 0:n.className:void 0,`${u}-item-icon`)}),x(h));return m||(b=l.createElement(Fr,Object.assign({},p,{placement:f==="rtl"?"left":"right",classNames:{root:`${u}-inline-collapsed-tooltip`}}),b)),b};var ws=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const En=l.createContext(null),$s=l.forwardRef((e,n)=>{const{children:t}=e,r=ws(e,["children"]),o=l.useContext(En),a=l.useMemo(()=>Object.assign(Object.assign({},o),r),[o,r.prefixCls,r.mode,r.selectable,r.rootClassName]),i=Pa(t),s=To(n,i?yr(t):null);return l.createElement(En.Provider,{value:a},l.createElement(Aa,{space:!0},i?l.cloneElement(t,{ref:s}):t))}),Is=e=>{const{componentCls:n,motionDurationSlow:t,horizontalLineHeight:r,colorSplit:o,lineWidth:a,lineType:i,itemPaddingInline:s}=e;return{[`${n}-horizontal`]:{lineHeight:r,border:0,borderBottom:`${ne(a)} ${i} ${o}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${n}-item, ${n}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:s},[`> ${n}-item:hover,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
${
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
${n}-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
&-inline ${t}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${ne(c)})`},"&::after":{transform:`rotate(45deg) translateX(${ne(e.calc(c).mul(-1).equal())})`}},[`${t}-submenu-open${t}-submenu-inline > ${t}-submenu-title > ${t}-submenu-arrow`]:{transform:`translateY(${ne(e.calc(w).mul(.2).mul(-1).equal())})`,"&::after":{transform:`rotate(-45deg) translateX(${ne(e.calc(c).mul(-1).equal())})`},"&::before":{transform:`rotate(45deg) translateX(${ne(c)})`}}})},{[`${n}-layout-header`]:{[t]:{lineHeight:"inherit"}}}]},Ns=e=>{var n,t,r;const{colorPrimary:o,colorError:a,colorTextDisabled:i,colorErrorBg:s,colorText:u,colorTextDescription:d,colorBgContainer:f,colorFillAlter:m,colorFillContent:h,lineWidth:x,lineWidthBold:w,controlItemBgActive:c,colorBgTextHover:p,controlHeightLG:C,lineHeight:b,colorBgElevated:I,marginXXS:S,padding:y,fontSize:F,controlHeightSM:D,fontSizeLG:O,colorTextLightSolid:N,colorErrorHover:E}=e,_=(n=e.activeBarWidth)!==null&&n!==void 0?n:0,T=(t=e.activeBarBorderWidth)!==null&&t!==void 0?t:x,k=(r=e.itemMarginInline)!==null&&r!==void 0?r:e.marginXXS,M=new or(N).setA(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:u,itemColor:u,colorItemTextHover:u,itemHoverColor:u,colorItemTextHoverHorizontal:o,horizontalItemHoverColor:o,colorGroupTitle:d,groupTitleColor:d,colorItemTextSelected:o,itemSelectedColor:o,subMenuItemSelectedColor:o,colorItemTextSelectedHorizontal:o,horizontalItemSelectedColor:o,colorItemBg:f,itemBg:f,colorItemBgHover:p,itemHoverBg:p,colorItemBgActive:h,itemActiveBg:c,colorSubItemBg:m,subMenuItemBg:m,colorItemBgSelected:c,itemSelectedBg:c,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:_,colorActiveBarHeight:w,activeBarHeight:w,colorActiveBarBorderSize:x,activeBarBorderWidth:T,colorItemTextDisabled:i,itemDisabledColor:i,colorDangerItemText:a,dangerItemColor:a,colorDangerItemTextHover:a,dangerItemHoverColor:a,colorDangerItemTextSelected:a,dangerItemSelectedColor:a,colorDangerItemBgActive:s,dangerItemActiveBg:s,colorDangerItemBgSelected:s,dangerItemSelectedBg:s,itemMarginInline:k,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:C,groupTitleLineHeight:b,collapsedWidth:C*2,popupBg:I,itemMarginBlock:S,itemPaddingInline:y,horizontalLineHeight:`${C*1.15}px`,iconSize:F,iconMarginInlineEnd:D-F,collapsedIconSize:O,groupTitleFontSize:F,darkItemDisabledColor:new or(N).setA(.25).toRgbString(),darkItemColor:M,darkDangerItemColor:a,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:N,darkItemSelectedBg:o,darkDangerItemSelectedBg:a,darkItemHoverBg:"transparent",darkGroupTitleColor:M,darkItemHoverColor:N,darkDangerItemHoverColor:E,darkDangerItemSelectedColor:N,darkDangerItemActiveBg:a,itemWidth:_?`calc(100% + ${T}px)`:`calc(100% - ${k*2}px)`}},Os=(e,n=e,t=!0)=>cn("Menu",o=>{const{colorBgElevated:a,controlHeightLG:i,fontSize:s,darkItemColor:u,darkDangerItemColor:d,darkItemBg:f,darkSubMenuItemBg:m,darkItemSelectedColor:h,darkItemSelectedBg:x,darkDangerItemSelectedBg:w,darkItemHoverBg:c,darkGroupTitleColor:p,darkItemHoverColor:C,darkItemDisabledColor:b,darkDangerItemHoverColor:I,darkDangerItemSelectedColor:S,darkDangerItemActiveBg:y,popupBg:F,darkPopupBg:D}=o,O=o.calc(s).div(7).mul(5).equal(),N=sn(o,{menuArrowSize:O,menuHorizontalHeight:o.calc(i).mul(1.15).equal(),menuArrowOffset:o.calc(O).mul(.25).equal(),menuSubMenuBg:a,calc:o.calc,popupBg:F}),E=sn(N,{itemColor:u,itemHoverColor:C,groupTitleColor:p,itemSelectedColor:h,subMenuItemSelectedColor:h,itemBg:f,popupBg:D,subMenuItemBg:m,itemActiveBg:"transparent",itemSelectedBg:x,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:c,itemDisabledColor:b,dangerItemColor:d,dangerItemHoverColor:I,dangerItemSelectedColor:S,dangerItemActiveBg:y,dangerItemSelectedBg:w,menuSubMenuBg:m,horizontalItemSelectedColor:h,horizontalItemSelectedBg:x});return[Fs(N),Is(N),Es(N),oo(N,"light"),oo(E,"dark"),Ss(N),_o(N),wn(N,"slide-up"),wn(N,"slide-down"),zo(N,"zoom-big")]},Ns,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:t,unitless:{groupTitleLineHeight:!0}})(e,n),pa=e=>{var n;const{popupClassName:t,icon:r,title:o,theme:a}=e,i=l.useContext(Sn),{prefixCls:s,inlineCollapsed:u,theme:d}=i,f=Yt();let m;if(!r)m=u&&!f.length&&o&&typeof o=="string"?l.createElement("div",{className:`${s}-inline-collapsed-noicon`},o.charAt(0)):l.createElement("span",{className:`${s}-title-content`},o);else{const w=l.isValidElement(o)&&o.type==="span";m=l.createElement(l.Fragment,null,Gt(r,{className:Z(l.isValidElement(r)?(n=r.props)===null||n===void 0?void 0:n.className:void 0,`${s}-item-icon`)}),w?o:l.createElement("span",{className:`${s}-title-content`},o))}const h=l.useMemo(()=>Object.assign(Object.assign({},i),{firstLevel:!1}),[i]),[x]=jo("Menu");return l.createElement(Sn.Provider,{value:h},l.createElement(An,Object.assign({},xt(e,["icon"]),{title:m,popupClassName:Z(s,t,`${s}-${a||d}`),popupStyle:Object.assign({zIndex:x},e.popupStyle)})))};var Ds=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};function Xn(e){return e===null||e===!1}const Ps={item:da,submenu:pa,divider:ua},As=br((e,n)=>{var t;const r=l.useContext(En),o=r||{},{getPrefixCls:a,getPopupContainer:i,direction:s,menu:u}=l.useContext(wt),d=a(),{prefixCls:f,className:m,style:h,theme:x="light",expandIcon:w,_internalDisableMenuItemTitleTooltip:c,inlineCollapsed:p,siderCollapsed:C,rootClassName:b,mode:I,selectable:S,onClick:y,overflowedIndicatorPopupClassName:F}=e,D=Ds(e,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),O=xt(D,["collapsedWidth"]);(t=o.validator)===null||t===void 0||t.call(o,{mode:I});const N=ar((...ee)=>{var R;y==null||y.apply(void 0,ee),(R=o.onClick)===null||R===void 0||R.call(o)}),E=o.mode||I,_=S??o.selectable,T=p??C,k={horizontal:{motionName:`${d}-slide-up`},inline:Ho(d),other:{motionName:`${d}-zoom-big`}},M=a("menu",f||o.prefixCls),B=Lo(M),[V,j,U]=Os(M,B,!r),K=Z(`${M}-${x}`,u==null?void 0:u.className,m),L=l.useMemo(()=>{var ee,R;if(typeof w=="function"||Xn(w))return w||null;if(typeof o.expandIcon=="function"||Xn(o.expandIcon))return o.expandIcon||null;if(typeof(u==null?void 0:u.expandIcon)=="function"||Xn(u==null?void 0:u.expandIcon))return(u==null?void 0:u.expandIcon)||null;const W=(ee=w??(o==null?void 0:o.expandIcon))!==null&&ee!==void 0?ee:u==null?void 0:u.expandIcon;return Gt(W,{className:Z(`${M}-submenu-expand-icon`,l.isValidElement(W)?(R=W.props)===null||R===void 0?void 0:R.className:void 0)})},[w,o==null?void 0:o.expandIcon,u==null?void 0:u.expandIcon,M]),q=l.useMemo(()=>({prefixCls:M,inlineCollapsed:T||!1,direction:s,firstLevel:!0,theme:x,mode:E,disableMenuItemTitleTooltip:c}),[M,T,s,c,x]);return V(l.createElement(En.Provider,{value:null},l.createElement(Sn.Provider,{value:q},l.createElement(un,Object.assign({getPopupContainer:i,overflowedIndicator:l.createElement(ca,null),overflowedIndicatorPopupClassName:Z(M,`${M}-${x}`,F),mode:E,selectable:_,onClick:N},O,{inlineCollapsed:T,style:Object.assign(Object.assign({},u==null?void 0:u.style),h),className:K,prefixCls:M,direction:s,defaultMotions:k,expandIcon:L,ref:n,rootClassName:Z(b,j,o.rootClassName,U,B),_internalComponents:Ps})))))}),dn=br((e,n)=>{const t=Xe(null),r=l.useContext(la);return Po(n,()=>({menu:t.current,focus:o=>{var a;(a=t.current)===null||a===void 0||a.focus(o)}})),l.createElement(As,Object.assign({ref:t},e,r))});dn.Item=da;dn.SubMenu=pa;dn.Divider=ua;dn.ItemGroup=zr;const ks=e=>{const{componentCls:n,menuCls:t,colorError:r,colorTextLightSolid:o}=e,a=`${t}-item`;return{[`${n}, ${n}-menu-submenu`]:{[`${t} ${a}`]:{[`&${a}-danger:not(${a}-disabled)`]:{color:r,"&:hover":{color:o,backgroundColor:r}}}}}},Ms=e=>{const{componentCls:n,menuCls:t,zIndexPopup:r,dropdownArrowDistance:o,sizePopupArrow:a,antCls:i,iconCls:s,motionDurationMid:u,paddingBlock:d,fontSize:f,dropdownEdgeChildPadding:m,colorTextDisabled:h,fontSizeIcon:x,controlPaddingHorizontal:w,colorBgElevated:c}=e;return[{[n]:{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:r,display:"block","&::before":{position:"absolute",insetBlock:e.calc(a).div(2).sub(o).equal(),zIndex:-9999,opacity:1e-4,content:'""'},"&-menu-vertical":{maxHeight:"100vh",overflowY:"auto"},[`&-trigger${i}-btn`]:{[`& > ${s}-down, & > ${i}-btn-icon > ${s}-down`]:{fontSize:x}},[`${n}-wrap`]:{position:"relative",[`${i}-btn > ${s}-down`]:{fontSize:x},[`${s}-down::before`]:{transition:`transform ${u}`}},[`${n}-wrap-open`]:{[`${s}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${i}-slide-down-enter${i}-slide-down-enter-active${n}-placement-bottomLeft,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
&${i}-slide-up-appear${i}-slide-up-appear-active${n}-placement-top,
|
|
67
|
-
|
|
68
|
-
&${i}-slide-up-appear${i}-slide-up-appear-active${n}-placement-topRight`]:{animationName:Ta},[`&${i}-slide-down-leave${i}-slide-down-leave-active${n}-placement-bottomLeft,
|
|
69
|
-
&${i}-slide-down-leave${i}-slide-down-leave-active${n}-placement-bottom,
|
|
70
|
-
&${i}-slide-down-leave${i}-slide-down-leave-active${n}-placement-bottomRight`]:{animationName:Ba},[`&${i}-slide-up-leave${i}-slide-up-leave-active${n}-placement-topLeft,
|
|
71
|
-
&${i}-slide-up-leave${i}-slide-up-leave-active${n}-placement-top,
|
|
72
|
-
&${i}-slide-up-leave${i}-slide-up-leave-active${n}-placement-topRight`]:{animationName:Ra}}},za(e,c,{arrowPlacement:{top:!0,bottom:!0}}),{[`${n} ${t}`]:{position:"relative",margin:0},[`${t}-submenu-popup`]:{position:"absolute",zIndex:r,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${n}, ${n}-menu-submenu`]:Object.assign(Object.assign({},On(e)),{[t]:Object.assign(Object.assign({padding:m,listStyleType:"none",backgroundColor:c,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary},Ur(e)),{"&:empty":{padding:0,boxShadow:"none"},[`${t}-item-group-title`]:{padding:`${ne(d)} ${ne(w)}`,color:e.colorTextDescription,transition:`all ${u}`},[`${t}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${t}-item-icon`]:{minWidth:f,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},[`${t}-title-content`]:{flex:"auto","&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},"> a":{color:"inherit",transition:`all ${u}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}},[`${t}-item-extra`]:{paddingInlineStart:e.padding,marginInlineStart:"auto",fontSize:e.fontSizeSM,color:e.colorTextDescription}},[`${t}-item, ${t}-submenu-title`]:Object.assign(Object.assign({display:"flex",margin:0,padding:`${ne(d)} ${ne(w)}`,color:e.colorText,fontWeight:"normal",fontSize:f,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${u}`,borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},Ur(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:h,cursor:"not-allowed","&:hover":{color:h,backgroundColor:c,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${ne(e.marginXXS)} 0`,overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},[`${n}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:e.paddingXS,[`${n}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:e.colorIcon,fontSize:x,fontStyle:"normal"}}}),[`${t}-item-group-list`]:{margin:`0 ${ne(e.marginXS)}`,padding:0,listStyle:"none"},[`${t}-submenu-title`]:{paddingInlineEnd:e.calc(w).add(e.fontSizeSM).equal()},[`${t}-submenu-vertical`]:{position:"relative"},[`${t}-submenu${t}-submenu-disabled ${n}-menu-submenu-title`]:{[`&, ${n}-menu-submenu-arrow-icon`]:{color:h,backgroundColor:c,cursor:"not-allowed"}},[`${t}-submenu-selected ${n}-menu-submenu-title`]:{color:e.colorPrimary}})})},[wn(e,"slide-up"),wn(e,"slide-down"),qr(e,"move-up"),qr(e,"move-down"),zo(e,"zoom-big")]]},Rs=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2},ja({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0})),La(e)),Bs=cn("Dropdown",e=>{const{marginXXS:n,sizePopupArrow:t,paddingXXS:r,componentCls:o}=e,a=sn(e,{menuCls:`${o}-menu`,dropdownArrowDistance:e.calc(t).div(2).add(n).equal(),dropdownEdgeChildPadding:r});return[Ms(a),ks(a)]},Rs,{resetStyle:!1}),kn=e=>{var n;const{menu:t,arrow:r,prefixCls:o,children:a,trigger:i,disabled:s,dropdownRender:u,popupRender:d,getPopupContainer:f,overlayClassName:m,rootClassName:h,overlayStyle:x,open:w,onOpenChange:c,visible:p,onVisibleChange:C,mouseEnterDelay:b=.15,mouseLeaveDelay:I=.1,autoAdjustOverflow:S=!0,placement:y="",overlay:F,transitionName:D,destroyOnHidden:O,destroyPopupOnHide:N}=e,{getPopupContainer:E,getPrefixCls:_,direction:T,dropdown:k}=l.useContext(wt),M=d||u;Ha();const B=l.useMemo(()=>{const me=_();return D!==void 0?D:y.includes("top")?`${me}-slide-down`:`${me}-slide-up`},[_,y,D]),V=l.useMemo(()=>y?y.includes("Center")?y.slice(0,y.indexOf("Center")):y:T==="rtl"?"bottomRight":"bottomLeft",[y,T]),j=_("dropdown",o),U=Lo(j),[K,L,q]=Bs(j,U),[,ee]=qa(),R=l.Children.only(Ti(a)?l.createElement("span",null,a):a),W=Gt(R,{className:Z(`${j}-trigger`,{[`${j}-rtl`]:T==="rtl"},R.props.className),disabled:(n=R.props.disabled)!==null&&n!==void 0?n:s}),J=s?[]:i,oe=!!(J!=null&&J.includes("contextMenu")),[ae,Q]=Lt(!1,{value:w??p}),ie=ar(me=>{c==null||c(me,{source:"trigger"}),C==null||C(me),Q(me)}),Ce=Z(m,h,L,q,U,k==null?void 0:k.className,{[`${j}-rtl`]:T==="rtl"}),xe=Ua({arrowPointAtCenter:typeof r=="object"&&r.pointAtCenter,autoAdjustOverflow:S,offset:ee.marginXXS,arrowWidth:r?ee.sizePopupArrow:0,borderRadius:ee.borderRadius}),we=ar(()=>{t!=null&&t.selectable&&(t!=null&&t.multiple)||(c==null||c(!1,{source:"menu"}),Q(!1))}),Te=()=>{let me;return t!=null&&t.items?me=l.createElement(dn,Object.assign({},t)):typeof F=="function"?me=F():me=F,M&&(me=M(me)),me=l.Children.only(typeof me=="string"?l.createElement("span",null,me):me),l.createElement($s,{prefixCls:`${j}-menu`,rootClassName:Z(q,U),expandIcon:l.createElement("span",{className:`${j}-menu-submenu-arrow`},T==="rtl"?l.createElement(vi,{className:`${j}-menu-submenu-arrow-icon`}):l.createElement(bi,{className:`${j}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:we,validator:({mode:ct})=>{}},me)},[Je,Le]=jo("Dropdown",x==null?void 0:x.zIndex);let ve=l.createElement(Bi,Object.assign({alignPoint:oe},xt(e,["rootClassName"]),{mouseEnterDelay:b,mouseLeaveDelay:I,visible:ae,builtinPlacements:xe,arrow:!!r,overlayClassName:Ce,prefixCls:j,getPopupContainer:f||E,transitionName:B,trigger:J,overlay:Te,placement:V,onVisibleChange:ie,overlayStyle:Object.assign(Object.assign(Object.assign({},k==null?void 0:k.style),x),{zIndex:Je}),autoDestroy:O??N}),W);return Je&&(ve=l.createElement(Wa.Provider,{value:Le},ve)),K(ve)},Ts=Va(kn,"align",void 0,"dropdown",e=>e),_s=e=>l.createElement(Ts,Object.assign({},e),l.createElement("span",null));kn._InternalPanelDoNotUseOrYouWillBeFired=_s;function lo(e){return["small","middle","large"].includes(e)}function co(e){return e?typeof e=="number"&&!Number.isNaN(e):!1}const ma=Be.createContext({latestIndex:0}),zs=ma.Provider,js=({className:e,index:n,children:t,split:r,style:o})=>{const{latestIndex:a}=l.useContext(ma);return t==null?null:l.createElement(l.Fragment,null,l.createElement("div",{className:e,style:o},t),n<a&&r&&l.createElement("span",{className:`${e}-split`},r))};var Ls=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const Hs=l.forwardRef((e,n)=>{var t;const{getPrefixCls:r,direction:o,size:a,className:i,style:s,classNames:u,styles:d}=Or("space"),{size:f=a??"small",align:m,className:h,rootClassName:x,children:w,direction:c="horizontal",prefixCls:p,split:C,style:b,wrap:I=!1,classNames:S,styles:y}=e,F=Ls(e,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[D,O]=Array.isArray(f)?f:[f,f],N=lo(O),E=lo(D),_=co(O),T=co(D),k=Sr(w,{keepEmpty:!0}),M=m===void 0&&c==="horizontal"?"center":m,B=r("space",p),[V,j,U]=Ka(B),K=Z(B,i,j,`${B}-${c}`,{[`${B}-rtl`]:o==="rtl",[`${B}-align-${M}`]:M,[`${B}-gap-row-${O}`]:N,[`${B}-gap-col-${D}`]:E},h,x,U),L=Z(`${B}-item`,(t=S==null?void 0:S.item)!==null&&t!==void 0?t:u.item),q=Object.assign(Object.assign({},d.item),y==null?void 0:y.item),ee=k.map((J,oe)=>{const ae=(J==null?void 0:J.key)||`${L}-${oe}`;return l.createElement(js,{className:L,key:ae,index:oe,split:C,style:q},J)}),R=l.useMemo(()=>({latestIndex:k.reduce((oe,ae,Q)=>ae!=null?Q:oe,0)}),[k]);if(k.length===0)return null;const W={};return I&&(W.flexWrap="wrap"),!E&&T&&(W.columnGap=D),!N&&_&&(W.rowGap=O),V(l.createElement("div",Object.assign({ref:n,className:K,style:Object.assign(Object.assign(Object.assign({},W),s),b)},F),l.createElement(zs,{value:R},ee)))}),fa=Hs;fa.Compact=Xa;var qs=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const ga=e=>{const{getPopupContainer:n,getPrefixCls:t,direction:r}=l.useContext(wt),{prefixCls:o,type:a="default",danger:i,disabled:s,loading:u,onClick:d,htmlType:f,children:m,className:h,menu:x,arrow:w,autoFocus:c,overlay:p,trigger:C,align:b,open:I,onOpenChange:S,placement:y,getPopupContainer:F,href:D,icon:O=l.createElement(ca,null),title:N,buttonsRender:E=xe=>xe,mouseEnterDelay:_,mouseLeaveDelay:T,overlayClassName:k,overlayStyle:M,destroyOnHidden:B,destroyPopupOnHide:V,dropdownRender:j,popupRender:U}=e,K=qs(e,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyOnHidden","destroyPopupOnHide","dropdownRender","popupRender"]),L=t("dropdown",o),q=`${L}-button`,R={menu:x,arrow:w,autoFocus:c,align:b,disabled:s,trigger:s?[]:C,onOpenChange:S,getPopupContainer:F||n,mouseEnterDelay:_,mouseLeaveDelay:T,overlayClassName:k,overlayStyle:M,destroyOnHidden:B,popupRender:U||j},{compactSize:W,compactItemClassnames:J}=Ga(L,r),oe=Z(q,J,h);"destroyPopupOnHide"in e&&(R.destroyPopupOnHide=V),"overlay"in e&&(R.overlay=p),"open"in e&&(R.open=I),"placement"in e?R.placement=y:R.placement=r==="rtl"?"bottomLeft":"bottomRight";const ae=l.createElement(pt,{type:a,danger:i,disabled:s,loading:u,onClick:d,htmlType:f,href:D,title:N},m),Q=l.createElement(pt,{type:a,danger:i,icon:O}),[ie,Ce]=E([ae,Q]);return l.createElement(fa.Compact,Object.assign({className:oe,size:W,block:!0},K),ie,l.createElement(kn,Object.assign({},R),Ce))};ga.__ANT_BUTTON=!0;const ha=kn;ha.Button=ga;const Us=e=>{const{componentCls:n,iconCls:t,antCls:r,zIndexPopup:o,colorText:a,colorWarning:i,marginXXS:s,marginXS:u,fontSize:d,fontWeightStrong:f,colorTextHeading:m}=e;return{[n]:{zIndex:o,[`&${r}-popover`]:{fontSize:d},[`${n}-message`]:{marginBottom:u,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${n}-message-icon ${t}`]:{color:i,fontSize:d,lineHeight:1,marginInlineEnd:u},[`${n}-title`]:{fontWeight:f,color:m,"&:only-child":{fontWeight:"normal"}},[`${n}-description`]:{marginTop:s,color:a}},[`${n}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:u}}}}},Ws=e=>{const{zIndexPopupBase:n}=e;return{zIndexPopup:n+60}},va=cn("Popconfirm",e=>Us(e),Ws,{resetStyle:!1});var Vs=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const ba=e=>{const{prefixCls:n,okButtonProps:t,cancelButtonProps:r,title:o,description:a,cancelText:i,okText:s,okType:u="primary",icon:d=l.createElement(qo,null),showCancel:f=!0,close:m,onConfirm:h,onCancel:x,onPopupClick:w}=e,{getPrefixCls:c}=l.useContext(wt),[p]=Uo("Popconfirm",Wo.Popconfirm),C=Jr(o),b=Jr(a);return l.createElement("div",{className:`${n}-inner-content`,onClick:w},l.createElement("div",{className:`${n}-message`},d&&l.createElement("span",{className:`${n}-message-icon`},d),l.createElement("div",{className:`${n}-message-text`},C&&l.createElement("div",{className:`${n}-title`},C),b&&l.createElement("div",{className:`${n}-description`},b))),l.createElement("div",{className:`${n}-buttons`},f&&l.createElement(pt,Object.assign({onClick:x,size:"small"},r),i||(p==null?void 0:p.cancelText)),l.createElement(yi,{buttonProps:Object.assign(Object.assign({size:"small"},Ja(u)),t),actionFn:h,close:m,prefixCls:c("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},s||(p==null?void 0:p.okText))))},Ks=e=>{const{prefixCls:n,placement:t,className:r,style:o}=e,a=Vs(e,["prefixCls","placement","className","style"]),{getPrefixCls:i}=l.useContext(wt),s=i("popconfirm",n),[u]=va(s);return u(l.createElement(xi,{placement:t,className:Z(s,r),style:o,content:l.createElement(ba,Object.assign({prefixCls:s},a))}))};var Xs=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const Gs=l.forwardRef((e,n)=>{var t,r;const{prefixCls:o,placement:a="top",trigger:i="click",okType:s="primary",icon:u=l.createElement(qo,null),children:d,overlayClassName:f,onOpenChange:m,onVisibleChange:h,overlayStyle:x,styles:w,classNames:c}=e,p=Xs(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:C,className:b,style:I,classNames:S,styles:y}=Or("popconfirm"),[F,D]=Lt(!1,{value:(t=e.open)!==null&&t!==void 0?t:e.visible,defaultValue:(r=e.defaultOpen)!==null&&r!==void 0?r:e.defaultVisible}),O=(j,U)=>{D(j,!0),h==null||h(j),m==null||m(j,U)},N=j=>{O(!1,j)},E=j=>{var U;return(U=e.onConfirm)===null||U===void 0?void 0:U.call(void 0,j)},_=j=>{var U;O(!1,j),(U=e.onCancel)===null||U===void 0||U.call(void 0,j)},T=(j,U)=>{const{disabled:K=!1}=e;K||O(j,U)},k=C("popconfirm",o),M=Z(k,b,f,S.root,c==null?void 0:c.root),B=Z(S.body,c==null?void 0:c.body),[V]=va(k);return V(l.createElement(Go,Object.assign({},xt(p,["title"]),{trigger:i,placement:a,onOpenChange:T,open:F,ref:n,classNames:{root:M,body:B},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},y.root),I),x),w==null?void 0:w.root),body:Object.assign(Object.assign({},y.body),w==null?void 0:w.body)},content:l.createElement(ba,Object.assign({okType:s,icon:u},e,{prefixCls:k,close:N,onConfirm:E,onCancel:_})),"data-popover-inject":!0}),d))}),ya=Gs;ya._InternalPanelDoNotUseOrYouWillBeFired=Ks;var Js={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},Ys=function(){var n=Xe([]),t=Xe(null);return je(function(){var r=Date.now(),o=!1;n.current.forEach(function(a){if(a){o=!0;var i=a.style;i.transitionDuration=".3s, .3s, .3s, .06s",t.current&&r-t.current<100&&(i.transitionDuration="0s, 0s")}}),o&&(t.current=Date.now())}),n.current},uo=0,Qs=Ya();function Zs(){var e;return Qs?(e=uo,uo+=1):e="TEST_OR_SSR",e}const el=(function(e){var n=l.useState(),t=Ke(n,2),r=t[0],o=t[1];return l.useEffect(function(){o("rc_progress_".concat(Zs()))},[]),e||r});var po=function(n){var t=n.bg,r=n.children;return l.createElement("div",{style:{width:"100%",height:"100%",background:t}},r)};function mo(e,n){return Object.keys(e).map(function(t){var r=parseFloat(t),o="".concat(Math.floor(r*n),"%");return"".concat(e[t]," ").concat(o)})}var tl=l.forwardRef(function(e,n){var t=e.prefixCls,r=e.color,o=e.gradientId,a=e.radius,i=e.style,s=e.ptg,u=e.strokeLinecap,d=e.strokeWidth,f=e.size,m=e.gapDegree,h=r&&jt(r)==="object",x=h?"#FFF":void 0,w=f/2,c=l.createElement("circle",{className:"".concat(t,"-circle-path"),r:a,cx:w,cy:w,stroke:x,strokeLinecap:u,strokeWidth:d,opacity:s===0?0:1,style:i,ref:n});if(!h)return c;var p="".concat(o,"-conic"),C=m?"".concat(180+m/2,"deg"):"0deg",b=mo(r,(360-m)/360),I=mo(r,1),S="conic-gradient(from ".concat(C,", ").concat(b.join(", "),")"),y="linear-gradient(to ".concat(m?"bottom":"top",", ").concat(I.join(", "),")");return l.createElement(l.Fragment,null,l.createElement("mask",{id:p},c),l.createElement("foreignObject",{x:0,y:0,width:f,height:f,mask:"url(#".concat(p,")")},l.createElement(po,{bg:y},l.createElement(po,{bg:S}))))}),rn=100,Gn=function(n,t,r,o,a,i,s,u,d,f){var m=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,h=r/100*360*((360-i)/360),x=i===0?0:{bottom:0,top:180,left:90,right:-90}[s],w=(100-o)/100*t;d==="round"&&o!==100&&(w+=f/2,w>=t&&(w=t-.01));var c=rn/2;return{stroke:typeof u=="string"?u:void 0,strokeDasharray:"".concat(t,"px ").concat(n),strokeDashoffset:w+m,transform:"rotate(".concat(a+h+x,"deg)"),transformOrigin:"".concat(c,"px ").concat(c,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},nl=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function fo(e){var n=e??[];return Array.isArray(n)?n:[n]}var rl=function(n){var t=ze(ze({},Js),n),r=t.id,o=t.prefixCls,a=t.steps,i=t.strokeWidth,s=t.trailWidth,u=t.gapDegree,d=u===void 0?0:u,f=t.gapPosition,m=t.trailColor,h=t.strokeLinecap,x=t.style,w=t.className,c=t.strokeColor,p=t.percent,C=ot(t,nl),b=rn/2,I=el(r),S="".concat(I,"-gradient"),y=b-i/2,F=Math.PI*2*y,D=d>0?90+d/2:-90,O=F*((360-d)/360),N=jt(a)==="object"?a:{count:a,gap:2},E=N.count,_=N.gap,T=fo(p),k=fo(c),M=k.find(function(q){return q&&jt(q)==="object"}),B=M&&jt(M)==="object",V=B?"butt":h,j=Gn(F,O,0,100,D,d,f,m,V,i),U=Ys(),K=function(){var ee=0;return T.map(function(R,W){var J=k[W]||k[k.length-1],oe=Gn(F,O,ee,R,D,d,f,J,V,i);return ee+=R,l.createElement(tl,{key:W,color:J,ptg:R,radius:y,prefixCls:o,gradientId:S,style:oe,strokeLinecap:V,strokeWidth:i,gapDegree:d,ref:function(Q){U[W]=Q},size:rn})}).reverse()},L=function(){var ee=Math.round(E*(T[0]/100)),R=100/E,W=0;return new Array(E).fill(null).map(function(J,oe){var ae=oe<=ee-1?k[0]:m,Q=ae&&jt(ae)==="object"?"url(#".concat(S,")"):void 0,ie=Gn(F,O,W,R,D,d,f,ae,"butt",i,_);return W+=(O-ie.strokeDashoffset+_)*100/O,l.createElement("circle",{key:oe,className:"".concat(o,"-circle-path"),r:y,cx:b,cy:b,stroke:Q,strokeWidth:i,opacity:1,style:ie,ref:function(xe){U[oe]=xe}})})};return l.createElement("svg",De({className:Z("".concat(o,"-circle"),w),viewBox:"0 0 ".concat(rn," ").concat(rn),style:x,id:r,role:"presentation"},C),!E&&l.createElement("circle",{className:"".concat(o,"-circle-trail"),r:y,cx:b,cy:b,stroke:m,strokeLinecap:V,strokeWidth:s||i,style:j}),E?L():K())};function Tt(e){return!e||e<0?0:e>100?100:e}function Fn({success:e,successPercent:n}){let t=n;return e&&"progress"in e&&(t=e.progress),e&&"percent"in e&&(t=e.percent),t}const ol=({percent:e,success:n,successPercent:t})=>{const r=Tt(Fn({success:n,successPercent:t}));return[r,Tt(Tt(e)-r)]},al=({success:e={},strokeColor:n})=>{const{strokeColor:t}=e;return[t||ir.green,n||null]},Mn=(e,n,t)=>{var r,o,a,i;let s=-1,u=-1;if(n==="step"){const d=t.steps,f=t.strokeWidth;typeof e=="string"||typeof e>"u"?(s=e==="small"?2:14,u=f??8):typeof e=="number"?[s,u]=[e,e]:[s=14,u=8]=Array.isArray(e)?e:[e.width,e.height],s*=d}else if(n==="line"){const d=t==null?void 0:t.strokeWidth;typeof e=="string"||typeof e>"u"?u=d||(e==="small"?6:8):typeof e=="number"?[s,u]=[e,e]:[s=-1,u=8]=Array.isArray(e)?e:[e.width,e.height]}else(n==="circle"||n==="dashboard")&&(typeof e=="string"||typeof e>"u"?[s,u]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[s,u]=[e,e]:Array.isArray(e)&&(s=(o=(r=e[0])!==null&&r!==void 0?r:e[1])!==null&&o!==void 0?o:120,u=(i=(a=e[0])!==null&&a!==void 0?a:e[1])!==null&&i!==void 0?i:120));return[s,u]},il=3,sl=e=>il/e*100,ll=e=>{const{prefixCls:n,trailColor:t=null,strokeLinecap:r="round",gapPosition:o,gapDegree:a,width:i=120,type:s,children:u,success:d,size:f=i,steps:m}=e,[h,x]=Mn(f,"circle");let{strokeWidth:w}=e;w===void 0&&(w=Math.max(sl(h),6));const c={width:h,height:x,fontSize:h*.15+6},p=l.useMemo(()=>{if(a||a===0)return a;if(s==="dashboard")return 75},[a,s]),C=ol(e),b=o||s==="dashboard"&&"bottom"||void 0,I=Object.prototype.toString.call(e.strokeColor)==="[object Object]",S=al({success:d,strokeColor:e.strokeColor}),y=Z(`${n}-inner`,{[`${n}-circle-gradient`]:I}),F=l.createElement(rl,{steps:m,percent:m?C[1]:C,strokeWidth:w,trailWidth:w,strokeColor:m?S[1]:S,strokeLinecap:r,trailColor:t,prefixCls:n,gapDegree:p,gapPosition:b}),D=h<=20,O=l.createElement("div",{className:y,style:c},F,!D&&u);return D?l.createElement(Fr,{title:u},O):O},Nn="--progress-line-stroke-color",Ca="--progress-percent",go=e=>{const n=e?"100%":"-100%";return new sr(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${n}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${n}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},cl=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:Object.assign(Object.assign({},On(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${n}-outer`]:{display:"inline-flex",alignItems:"center",width:"100%"},[`${n}-inner`]:{position:"relative",display:"inline-block",width:"100%",flex:1,overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${n}-inner:not(${n}-circle-gradient)`]:{[`${n}-circle-path`]:{stroke:e.defaultColor}},[`${n}-success-bg, ${n}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${n}-layout-bottom`]:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[`${n}-text`]:{width:"max-content",marginInlineStart:0,marginTop:e.marginXXS}},[`${n}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${Nn})`]},height:"100%",width:`calc(1 / var(${Ca}) * 100%)`,display:"block"},[`&${n}-bg-inner`]:{minWidth:"max-content","&::after":{content:"none"},[`${n}-text-inner`]:{color:e.colorWhite,[`&${n}-text-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}},[`${n}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${n}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,width:"2em",whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[t]:{fontSize:e.fontSize},[`&${n}-text-outer`]:{width:"max-content"},[`&${n}-text-outer${n}-text-start`]:{width:"max-content",marginInlineStart:0,marginInlineEnd:e.marginXS}},[`${n}-text-inner`]:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",marginInlineStart:0,padding:`0 ${ne(e.paddingXXS)}`,[`&${n}-text-start`]:{justifyContent:"start"},[`&${n}-text-end`]:{justifyContent:"end"}},[`&${n}-status-active`]:{[`${n}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:go(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${n}-rtl${n}-status-active`]:{[`${n}-bg::before`]:{animationName:go(!0)}},[`&${n}-status-exception`]:{[`${n}-bg`]:{backgroundColor:e.colorError},[`${n}-text`]:{color:e.colorError}},[`&${n}-status-exception ${n}-inner:not(${n}-circle-gradient)`]:{[`${n}-circle-path`]:{stroke:e.colorError}},[`&${n}-status-success`]:{[`${n}-bg`]:{backgroundColor:e.colorSuccess},[`${n}-text`]:{color:e.colorSuccess}},[`&${n}-status-success ${n}-inner:not(${n}-circle-gradient)`]:{[`${n}-circle-path`]:{stroke:e.colorSuccess}}})}},ul=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:{[`${n}-circle-trail`]:{stroke:e.remainingColor},[`&${n}-circle ${n}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${n}-circle ${n}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[t]:{fontSize:e.circleIconFontSize}},[`${n}-circle&-status-exception`]:{[`${n}-text`]:{color:e.colorError}},[`${n}-circle&-status-success`]:{[`${n}-text`]:{color:e.colorSuccess}}},[`${n}-inline-circle`]:{lineHeight:1,[`${n}-inner`]:{verticalAlign:"bottom"}}}},dl=e=>{const{componentCls:n}=e;return{[n]:{[`${n}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},pl=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:{[`${n}-small&-line, ${n}-small&-line ${n}-text ${t}`]:{fontSize:e.fontSizeSM}}}},ml=e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}),fl=cn("Progress",e=>{const n=e.calc(e.marginXXS).div(2).equal(),t=sn(e,{progressStepMarginInlineEnd:n,progressStepMinWidth:n,progressActiveMotionDuration:"2.4s"});return[cl(t),ul(t),dl(t),pl(t)]},ml);var gl=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const hl=e=>{let n=[];return Object.keys(e).forEach(t=>{const r=Number.parseFloat(t.replace(/%/g,""));Number.isNaN(r)||n.push({key:r,value:e[t]})}),n=n.sort((t,r)=>t.key-r.key),n.map(({key:t,value:r})=>`${r} ${t}%`).join(", ")},vl=(e,n)=>{const{from:t=ir.blue,to:r=ir.blue,direction:o=n==="rtl"?"to left":"to right"}=e,a=gl(e,["from","to","direction"]);if(Object.keys(a).length!==0){const s=hl(a),u=`linear-gradient(${o}, ${s})`;return{background:u,[Nn]:u}}const i=`linear-gradient(${o}, ${t}, ${r})`;return{background:i,[Nn]:i}},bl=e=>{const{prefixCls:n,direction:t,percent:r,size:o,strokeWidth:a,strokeColor:i,strokeLinecap:s="round",children:u,trailColor:d=null,percentPosition:f,success:m}=e,{align:h,type:x}=f,w=i&&typeof i!="string"?vl(i,t):{[Nn]:i,background:i},c=s==="square"||s==="butt"?0:void 0,p=o??[-1,a||(o==="small"?6:8)],[C,b]=Mn(p,"line",{strokeWidth:a}),I={backgroundColor:d||void 0,borderRadius:c},S=Object.assign(Object.assign({width:`${Tt(r)}%`,height:b,borderRadius:c},w),{[Ca]:Tt(r)/100}),y=Fn(e),F={width:`${Tt(y)}%`,height:b,borderRadius:c,backgroundColor:m==null?void 0:m.strokeColor},D={width:C<0?"100%":C},O=l.createElement("div",{className:`${n}-inner`,style:I},l.createElement("div",{className:Z(`${n}-bg`,`${n}-bg-${x}`),style:S},x==="inner"&&u),y!==void 0&&l.createElement("div",{className:`${n}-success-bg`,style:F})),N=x==="outer"&&h==="start",E=x==="outer"&&h==="end";return x==="outer"&&h==="center"?l.createElement("div",{className:`${n}-layout-bottom`},O,u):l.createElement("div",{className:`${n}-outer`,style:D},N&&u,O,E&&u)},yl=e=>{const{size:n,steps:t,rounding:r=Math.round,percent:o=0,strokeWidth:a=8,strokeColor:i,trailColor:s=null,prefixCls:u,children:d}=e,f=r(t*(o/100)),h=n??[n==="small"?2:14,a],[x,w]=Mn(h,"step",{steps:t,strokeWidth:a}),c=x/t,p=Array.from({length:t});for(let C=0;C<t;C++){const b=Array.isArray(i)?i[C]:i;p[C]=l.createElement("div",{key:C,className:Z(`${u}-steps-item`,{[`${u}-steps-item-active`]:C<=f-1}),style:{backgroundColor:C<=f-1?b:s,width:c,height:w}})}return l.createElement("div",{className:`${u}-steps-outer`},p,d)};var Cl=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const xl=["normal","exception","active","success"],wl=l.forwardRef((e,n)=>{const{prefixCls:t,className:r,rootClassName:o,steps:a,strokeColor:i,percent:s=0,size:u="default",showInfo:d=!0,type:f="line",status:m,format:h,style:x,percentPosition:w={}}=e,c=Cl(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:p="end",type:C="outer"}=w,b=Array.isArray(i)?i[0]:i,I=typeof i=="string"||Array.isArray(i)?i:void 0,S=l.useMemo(()=>{if(b){const K=typeof b=="string"?b:Object.values(b)[0];return new or(K).isLight()}return!1},[i]),y=l.useMemo(()=>{var K,L;const q=Fn(e);return Number.parseInt(q!==void 0?(K=q??0)===null||K===void 0?void 0:K.toString():(L=s??0)===null||L===void 0?void 0:L.toString(),10)},[s,e.success,e.successPercent]),F=l.useMemo(()=>!xl.includes(m)&&y>=100?"success":m||"normal",[m,y]),{getPrefixCls:D,direction:O,progress:N}=l.useContext(wt),E=D("progress",t),[_,T,k]=fl(E),M=f==="line",B=M&&!a,V=l.useMemo(()=>{if(!d)return null;const K=Fn(e);let L;const q=h||(R=>`${R}%`),ee=M&&S&&C==="inner";return C==="inner"||h||F!=="exception"&&F!=="success"?L=q(Tt(s),Tt(K)):F==="exception"?L=M?l.createElement(Qa,null):l.createElement(Za,null):F==="success"&&(L=M?l.createElement(ei,null):l.createElement(ti,null)),l.createElement("span",{className:Z(`${E}-text`,{[`${E}-text-bright`]:ee,[`${E}-text-${p}`]:B,[`${E}-text-${C}`]:B}),title:typeof L=="string"?L:void 0},L)},[d,s,y,F,f,E,h]);let j;f==="line"?j=a?l.createElement(yl,Object.assign({},e,{strokeColor:I,prefixCls:E,steps:typeof a=="object"?a.count:a}),V):l.createElement(bl,Object.assign({},e,{strokeColor:b,prefixCls:E,direction:O,percentPosition:{align:p,type:C}}),V):(f==="circle"||f==="dashboard")&&(j=l.createElement(ll,Object.assign({},e,{strokeColor:b,prefixCls:E,progressStatus:F}),V));const U=Z(E,`${E}-status-${F}`,{[`${E}-${f==="dashboard"&&"circle"||f}`]:f!=="line",[`${E}-inline-circle`]:f==="circle"&&Mn(u,"circle")[0]<=20,[`${E}-line`]:B,[`${E}-line-align-${p}`]:B,[`${E}-line-position-${C}`]:B,[`${E}-steps`]:a,[`${E}-show-info`]:d,[`${E}-${u}`]:typeof u=="string",[`${E}-rtl`]:O==="rtl"},N==null?void 0:N.className,r,o,T,k);return _(l.createElement("div",Object.assign({ref:n,style:Object.assign(Object.assign({},N==null?void 0:N.style),x),className:U,role:"progressbar","aria-valuenow":y,"aria-valuemin":0,"aria-valuemax":100},xt(c,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),j))});var $l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},Il=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:$l}))},Sl=l.forwardRef(Il);const Jn=(function(e,n){if(e&&n){var t=Array.isArray(n)?n:n.split(","),r=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return t.some(function(i){var s=i.trim();if(/^\*(\/\*)?$/.test(i))return!0;if(s.charAt(0)==="."){var u=r.toLowerCase(),d=s.toLowerCase(),f=[d];return(d===".jpg"||d===".jpeg")&&(f=[".jpg",".jpeg"]),f.some(function(m){return u.endsWith(m)})}return/\/\*$/.test(s)?a===s.replace(/\/.*$/,""):o===s?!0:/^\w+$/.test(s)?(Cr(!1,"Upload takes an invalidate 'accept' type '".concat(s,"'.Skip for check.")),!0):!1})}return!0});function El(e,n){var t="cannot ".concat(e.method," ").concat(e.action," ").concat(n.status,"'"),r=new Error(t);return r.status=n.status,r.method=e.method,r.url=e.action,r}function ho(e){var n=e.responseText||e.response;if(!n)return n;try{return JSON.parse(n)}catch{return n}}function vo(e){var n=new XMLHttpRequest;e.onProgress&&n.upload&&(n.upload.onprogress=function(a){a.total>0&&(a.percent=a.loaded/a.total*100),e.onProgress(a)});var t=new FormData;e.data&&Object.keys(e.data).forEach(function(o){var a=e.data[o];if(Array.isArray(a)){a.forEach(function(i){t.append("".concat(o,"[]"),i)});return}t.append(o,a)}),e.file instanceof Blob?t.append(e.filename,e.file,e.file.name):t.append(e.filename,e.file),n.onerror=function(a){e.onError(a)},n.onload=function(){return n.status<200||n.status>=300?e.onError(El(e,n),ho(n)):e.onSuccess(ho(n),n)},n.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);var r=e.headers||{};return r["X-Requested-With"]!==null&&n.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach(function(o){r[o]!==null&&n.setRequestHeader(o,r[o])}),n.send(t),{abort:function(){n.abort()}}}var Fl=(function(){var e=Bt(Qe().mark(function n(t,r){var o,a,i,s,u,d,f,m;return Qe().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:d=function(){return d=Bt(Qe().mark(function c(p){return Qe().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.abrupt("return",new Promise(function(I){p.file(function(S){r(S)?(p.fullPath&&!S.webkitRelativePath&&(Object.defineProperties(S,{webkitRelativePath:{writable:!0}}),S.webkitRelativePath=p.fullPath.replace(/^\//,""),Object.defineProperties(S,{webkitRelativePath:{writable:!1}})),I(S)):I(null)})}));case 1:case"end":return b.stop()}},c)})),d.apply(this,arguments)},u=function(c){return d.apply(this,arguments)},s=function(){return s=Bt(Qe().mark(function c(p){var C,b,I,S,y;return Qe().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:C=p.createReader(),b=[];case 2:return D.next=5,new Promise(function(O){C.readEntries(O,function(){return O([])})});case 5:if(I=D.sent,S=I.length,S){D.next=9;break}return D.abrupt("break",12);case 9:for(y=0;y<S;y++)b.push(I[y]);D.next=2;break;case 12:return D.abrupt("return",b);case 13:case"end":return D.stop()}},c)})),s.apply(this,arguments)},i=function(c){return s.apply(this,arguments)},o=[],a=[],t.forEach(function(w){return a.push(w.webkitGetAsEntry())}),f=(function(){var w=Bt(Qe().mark(function c(p,C){var b,I;return Qe().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(p){y.next=2;break}return y.abrupt("return");case 2:if(p.path=C||"",!p.isFile){y.next=10;break}return y.next=6,u(p);case 6:b=y.sent,b&&o.push(b),y.next=15;break;case 10:if(!p.isDirectory){y.next=15;break}return y.next=13,i(p);case 13:I=y.sent,a.push.apply(a,Ye(I));case 15:case"end":return y.stop()}},c)}));return function(p,C){return w.apply(this,arguments)}})(),m=0;case 9:if(!(m<a.length)){x.next=15;break}return x.next=12,f(a[m]);case 12:m++,x.next=9;break;case 15:return x.abrupt("return",o);case 16:case"end":return x.stop()}},n)}));return function(t,r){return e.apply(this,arguments)}})(),Nl=+new Date,Ol=0;function Yn(){return"rc-upload-".concat(Nl,"-").concat(++Ol)}var Dl=["component","prefixCls","className","classNames","disabled","id","name","style","styles","multiple","accept","capture","children","directory","folder","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],Pl=(function(e){xr(t,e);var n=wr(t);function t(){var r;$r(this,t);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=n.call.apply(n,[this].concat(a)),re(Ve(r),"state",{uid:Yn()}),re(Ve(r),"reqs",{}),re(Ve(r),"fileInput",void 0),re(Ve(r),"_isMounted",void 0),re(Ve(r),"onChange",function(s){var u=r.props,d=u.accept,f=u.directory,m=s.target.files,h=Ye(m).filter(function(x){return!f||Jn(x,d)});r.uploadFiles(h),r.reset()}),re(Ve(r),"onClick",function(s){var u=r.fileInput;if(u){var d=s.target,f=r.props.onClick;if(d&&d.tagName==="BUTTON"){var m=u.parentNode;m.focus(),d.blur()}u.click(),f&&f(s)}}),re(Ve(r),"onKeyDown",function(s){s.key==="Enter"&&r.onClick(s)}),re(Ve(r),"onDataTransferFiles",(function(){var s=Bt(Qe().mark(function u(d,f){var m,h,x,w,c,p,C;return Qe().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(m=r.props,h=m.multiple,x=m.accept,w=m.directory,c=Ye(d.items||[]),p=Ye(d.files||[]),(p.length>0||c.some(function(S){return S.kind==="file"}))&&(f==null||f()),!w){I.next=11;break}return I.next=7,Fl(Array.prototype.slice.call(c),function(S){return Jn(S,r.props.accept)});case 7:p=I.sent,r.uploadFiles(p),I.next=14;break;case 11:C=Ye(p).filter(function(S){return Jn(S,x)}),h===!1&&(C=p.slice(0,1)),r.uploadFiles(C);case 14:case"end":return I.stop()}},u)}));return function(u,d){return s.apply(this,arguments)}})()),re(Ve(r),"onFilePaste",(function(){var s=Bt(Qe().mark(function u(d){var f,m;return Qe().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(f=r.props.pastable,f){x.next=3;break}return x.abrupt("return");case 3:if(d.type!=="paste"){x.next=6;break}return m=d.clipboardData,x.abrupt("return",r.onDataTransferFiles(m,function(){d.preventDefault()}));case 6:case"end":return x.stop()}},u)}));return function(u){return s.apply(this,arguments)}})()),re(Ve(r),"onFileDragOver",function(s){s.preventDefault()}),re(Ve(r),"onFileDrop",(function(){var s=Bt(Qe().mark(function u(d){var f;return Qe().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(d.preventDefault(),d.type!=="drop"){h.next=4;break}return f=d.dataTransfer,h.abrupt("return",r.onDataTransferFiles(f));case 4:case"end":return h.stop()}},u)}));return function(u){return s.apply(this,arguments)}})()),re(Ve(r),"uploadFiles",function(s){var u=Ye(s),d=u.map(function(f){return f.uid=Yn(),r.processFile(f,u)});Promise.all(d).then(function(f){var m=r.props.onBatchStart;m==null||m(f.map(function(h){var x=h.origin,w=h.parsedFile;return{file:x,parsedFile:w}})),f.filter(function(h){return h.parsedFile!==null}).forEach(function(h){r.post(h)})})}),re(Ve(r),"processFile",(function(){var s=Bt(Qe().mark(function u(d,f){var m,h,x,w,c,p,C,b,I;return Qe().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(m=r.props.beforeUpload,h=d,!m){y.next=14;break}return y.prev=3,y.next=6,m(d,f);case 6:h=y.sent,y.next=12;break;case 9:y.prev=9,y.t0=y.catch(3),h=!1;case 12:if(h!==!1){y.next=14;break}return y.abrupt("return",{origin:d,parsedFile:null,action:null,data:null});case 14:if(x=r.props.action,typeof x!="function"){y.next=21;break}return y.next=18,x(d);case 18:w=y.sent,y.next=22;break;case 21:w=x;case 22:if(c=r.props.data,typeof c!="function"){y.next=29;break}return y.next=26,c(d);case 26:p=y.sent,y.next=30;break;case 29:p=c;case 30:return C=(jt(h)==="object"||typeof h=="string")&&h?h:d,C instanceof File?b=C:b=new File([C],d.name,{type:d.type}),I=b,I.uid=d.uid,y.abrupt("return",{origin:d,data:p,parsedFile:I,action:w});case 35:case"end":return y.stop()}},u,null,[[3,9]])}));return function(u,d){return s.apply(this,arguments)}})()),re(Ve(r),"saveFileInput",function(s){r.fileInput=s}),r}return Ir(t,[{key:"componentDidMount",value:function(){this._isMounted=!0;var o=this.props.pastable;o&&document.addEventListener("paste",this.onFilePaste)}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort(),document.removeEventListener("paste",this.onFilePaste)}},{key:"componentDidUpdate",value:function(o){var a=this.props.pastable;a&&!o.pastable?document.addEventListener("paste",this.onFilePaste):!a&&o.pastable&&document.removeEventListener("paste",this.onFilePaste)}},{key:"post",value:function(o){var a=this,i=o.data,s=o.origin,u=o.action,d=o.parsedFile;if(this._isMounted){var f=this.props,m=f.onStart,h=f.customRequest,x=f.name,w=f.headers,c=f.withCredentials,p=f.method,C=s.uid,b=h||vo,I={action:u,filename:x,data:i,file:d,headers:w,withCredentials:c,method:p||"post",onProgress:function(y){var F=a.props.onProgress;F==null||F(y,d)},onSuccess:function(y,F){var D=a.props.onSuccess;D==null||D(y,d,F),delete a.reqs[C]},onError:function(y,F){var D=a.props.onError;D==null||D(y,F,d),delete a.reqs[C]}};m(s),this.reqs[C]=b(I,{defaultRequest:vo})}}},{key:"reset",value:function(){this.setState({uid:Yn()})}},{key:"abort",value:function(o){var a=this.reqs;if(o){var i=o.uid?o.uid:o;a[i]&&a[i].abort&&a[i].abort(),delete a[i]}else Object.keys(a).forEach(function(s){a[s]&&a[s].abort&&a[s].abort(),delete a[s]})}},{key:"render",value:function(){var o=this.props,a=o.component,i=o.prefixCls,s=o.className,u=o.classNames,d=u===void 0?{}:u,f=o.disabled,m=o.id,h=o.name,x=o.style,w=o.styles,c=w===void 0?{}:w,p=o.multiple,C=o.accept,b=o.capture,I=o.children,S=o.directory,y=o.folder,F=o.openFileDialogOnClick,D=o.onMouseEnter,O=o.onMouseLeave,N=o.hasControlInside,E=ot(o,Dl),_=Z(re(re(re({},i,!0),"".concat(i,"-disabled"),f),s,s)),T=S||y?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},k=f?{}:{onClick:F?this.onClick:function(){},onKeyDown:F?this.onKeyDown:function(){},onMouseEnter:D,onMouseLeave:O,onDrop:this.onFileDrop,onDragOver:this.onFileDragOver,tabIndex:N?void 0:"0"};return Be.createElement(a,De({},k,{className:_,role:N?void 0:"button",style:x}),Be.createElement("input",De({},ni(E,{aria:!0,data:!0}),{id:m,name:h,disabled:f,type:"file",ref:this.saveFileInput,onClick:function(B){return B.stopPropagation()},key:this.state.uid,style:ze({display:"none"},c.input),className:d.input,accept:C},T,{multiple:p,onChange:this.onChange},b!=null?{capture:b}:{})),I)}}]),t})(Ao);function Qn(){}var gr=(function(e){xr(t,e);var n=wr(t);function t(){var r;$r(this,t);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=n.call.apply(n,[this].concat(a)),re(Ve(r),"uploader",void 0),re(Ve(r),"saveUploader",function(s){r.uploader=s}),r}return Ir(t,[{key:"abort",value:function(o){this.uploader.abort(o)}},{key:"render",value:function(){return Be.createElement(Pl,De({},this.props,{ref:this.saveUploader}))}}]),t})(Ao);re(gr,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Qn,onError:Qn,onSuccess:Qn,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});const Al=e=>{const{componentCls:n,iconCls:t}=e;return{[`${n}-wrapper`]:{[`${n}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:`${ne(e.lineWidth)} dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[n]:{padding:e.padding},[`${n}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none",borderRadius:e.borderRadiusLG,"&:focus-visible":{outline:`${ne(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`}},[`${n}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`
|
|
73
|
-
&:not(${n}-disabled):hover,
|
|
74
|
-
&-hover:not(${n}-disabled)
|
|
75
|
-
`]:{borderColor:e.colorPrimaryHover},[`p${n}-drag-icon`]:{marginBottom:e.margin,[t]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},[`p${n}-text`]:{margin:`0 0 ${ne(e.marginXXS)}`,color:e.colorTextHeading,fontSize:e.fontSizeLG},[`p${n}-hint`]:{color:e.colorTextDescription,fontSize:e.fontSize},[`&${n}-disabled`]:{[`p${n}-drag-icon ${t},
|
|
76
|
-
p${n}-text,
|
|
77
|
-
p${n}-hint
|
|
78
|
-
`]:{color:e.colorTextDisabled}}}}}},kl=e=>{const{componentCls:n,iconCls:t,fontSize:r,lineHeight:o,calc:a}=e,i=`${n}-list-item`,s=`${i}-actions`,u=`${i}-action`;return{[`${n}-wrapper`]:{[`${n}-list`]:Object.assign(Object.assign({},$n()),{lineHeight:e.lineHeight,[i]:{position:"relative",height:a(e.lineHeight).mul(r).equal(),marginTop:e.marginXS,fontSize:r,display:"flex",alignItems:"center",transition:`background-color ${e.motionDurationSlow}`,borderRadius:e.borderRadiusSM,"&:hover":{backgroundColor:e.controlItemBgHover},[`${i}-name`]:Object.assign(Object.assign({},Nr),{padding:`0 ${ne(e.paddingXS)}`,lineHeight:o,flex:"auto",transition:`all ${e.motionDurationSlow}`}),[s]:{whiteSpace:"nowrap",[u]:{opacity:0},[t]:{color:e.actionsColor,transition:`all ${e.motionDurationSlow}`},[`
|
|
79
|
-
${u}:focus-visible,
|
|
80
|
-
&.picture ${u}
|
|
81
|
-
`]:{opacity:1}},[`${n}-icon ${t}`]:{color:e.colorIcon,fontSize:r},[`${i}-progress`]:{position:"absolute",bottom:e.calc(e.uploadProgressOffset).mul(-1).equal(),width:"100%",paddingInlineStart:a(r).add(e.paddingXS).equal(),fontSize:r,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${i}:hover ${u}`]:{opacity:1},[`${i}-error`]:{color:e.colorError,[`${i}-name, ${n}-icon ${t}`]:{color:e.colorError},[s]:{[`${t}, ${t}:hover`]:{color:e.colorError},[u]:{opacity:1}}},[`${n}-list-item-container`]:{transition:`opacity ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},Ml=e=>{const{componentCls:n}=e,t=new sr("uploadAnimateInlineIn",{from:{width:0,height:0,padding:0,opacity:0,margin:e.calc(e.marginXS).div(-2).equal()}}),r=new sr("uploadAnimateInlineOut",{to:{width:0,height:0,padding:0,opacity:0,margin:e.calc(e.marginXS).div(-2).equal()}}),o=`${n}-animate-inline`;return[{[`${n}-wrapper`]:{[`${o}-appear, ${o}-enter, ${o}-leave`]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},[`${o}-appear, ${o}-enter`]:{animationName:t},[`${o}-leave`]:{animationName:r}}},{[`${n}-wrapper`]:Ci(e)},t,r]},Rl=e=>{const{componentCls:n,iconCls:t,uploadThumbnailSize:r,uploadProgressOffset:o,calc:a}=e,i=`${n}-list`,s=`${i}-item`;return{[`${n}-wrapper`]:{[`
|
|
82
|
-
${i}${i}-picture,
|
|
83
|
-
${i}${i}-picture-card,
|
|
84
|
-
${i}${i}-picture-circle
|
|
85
|
-
`]:{[s]:{position:"relative",height:a(r).add(a(e.lineWidth).mul(2)).add(a(e.paddingXS).mul(2)).equal(),padding:e.paddingXS,border:`${ne(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusLG,"&:hover":{background:"transparent"},[`${s}-thumbnail`]:Object.assign(Object.assign({},Nr),{width:r,height:r,lineHeight:ne(a(r).add(e.paddingSM).equal()),textAlign:"center",flex:"none",[t]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${s}-progress`]:{bottom:o,width:`calc(100% - ${ne(a(e.paddingSM).mul(2).equal())})`,marginTop:0,paddingInlineStart:a(r).add(e.paddingXS).equal()}},[`${s}-error`]:{borderColor:e.colorError,[`${s}-thumbnail ${t}`]:{[`svg path[fill='${Wr[0]}']`]:{fill:e.colorErrorBg},[`svg path[fill='${Wr.primary}']`]:{fill:e.colorError}}},[`${s}-uploading`]:{borderStyle:"dashed",[`${s}-name`]:{marginBottom:o}}},[`${i}${i}-picture-circle ${s}`]:{[`&, &::before, ${s}-thumbnail`]:{borderRadius:"50%"}}}}},Bl=e=>{const{componentCls:n,iconCls:t,fontSizeLG:r,colorTextLightSolid:o,calc:a}=e,i=`${n}-list`,s=`${i}-item`,u=e.uploadPicCardSize;return{[`
|
|
86
|
-
${n}-wrapper${n}-picture-card-wrapper,
|
|
87
|
-
${n}-wrapper${n}-picture-circle-wrapper
|
|
88
|
-
`]:Object.assign(Object.assign({},$n()),{display:"block",[`${n}${n}-select`]:{width:u,height:u,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:`${ne(e.lineWidth)} dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[`> ${n}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${n}-disabled):hover`]:{borderColor:e.colorPrimary}},[`${i}${i}-picture-card, ${i}${i}-picture-circle`]:{display:"flex",flexWrap:"wrap","@supports not (gap: 1px)":{"& > *":{marginBlockEnd:e.marginXS,marginInlineEnd:e.marginXS}},"@supports (gap: 1px)":{gap:e.marginXS},[`${i}-item-container`]:{display:"inline-block",width:u,height:u,verticalAlign:"top"},"&::after":{display:"none"},"&::before":{display:"none"},[s]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${ne(a(e.paddingXS).mul(2).equal())})`,height:`calc(100% - ${ne(a(e.paddingXS).mul(2).equal())})`,backgroundColor:e.colorBgMask,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'" "'}},[`${s}:hover`]:{[`&::before, ${s}-actions`]:{opacity:1}},[`${s}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${e.motionDurationSlow}`,[`
|
|
89
|
-
${t}-eye,
|
|
90
|
-
${t}-download,
|
|
91
|
-
${t}-delete
|
|
92
|
-
`]:{zIndex:10,width:r,margin:`0 ${ne(e.marginXXS)}`,fontSize:r,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:o,"&:hover":{color:o},svg:{verticalAlign:"baseline"}}},[`${s}-thumbnail, ${s}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${s}-name`]:{display:"none",textAlign:"center"},[`${s}-file + ${s}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${ne(a(e.paddingXS).mul(2).equal())})`},[`${s}-uploading`]:{[`&${s}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${t}-eye, ${t}-download, ${t}-delete`]:{display:"none"}},[`${s}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${ne(a(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${n}-wrapper${n}-picture-circle-wrapper`]:{[`${n}${n}-select`]:{borderRadius:"50%"}}}},Tl=e=>{const{componentCls:n}=e;return{[`${n}-rtl`]:{direction:"rtl"}}},_l=e=>{const{componentCls:n,colorTextDisabled:t}=e;return{[`${n}-wrapper`]:Object.assign(Object.assign({},On(e)),{[n]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${n}-select`]:{display:"inline-block"},[`${n}-hidden`]:{display:"none"},[`${n}-disabled`]:{color:t,cursor:"not-allowed"}})}},zl=e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55}),jl=cn("Upload",e=>{const{fontSizeHeading3:n,fontHeight:t,lineWidth:r,pictureCardSize:o,calc:a}=e,i=sn(e,{uploadThumbnailSize:a(n).mul(2).equal(),uploadProgressOffset:a(a(t).div(2)).add(r).equal(),uploadPicCardSize:o});return[_l(i),Al(i),Rl(i),Bl(i),kl(i),Ml(i),Tl(i),_o(i)]},zl);var Ll={icon:function(n,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:t}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:n}}]}},name:"file",theme:"twotone"},Hl=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:Ll}))},ql=l.forwardRef(Hl),Ul={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},Wl=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:Ul}))},Vl=l.forwardRef(Wl),Kl={icon:function(n,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:n}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:t}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:t}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:t}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:n}}]}},name:"picture",theme:"twotone"},Xl=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:Kl}))},Gl=l.forwardRef(Xl);function bn(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function yn(e,n){const t=Ye(n),r=t.findIndex(({uid:o})=>o===e.uid);return r===-1?t.push(e):t[r]=e,t}function Zn(e,n){const t=e.uid!==void 0?"uid":"name";return n.filter(r=>r[t]===e[t])[0]}function Jl(e,n){const t=e.uid!==void 0?"uid":"name",r=n.filter(o=>o[t]!==e[t]);return r.length===n.length?null:r}const Yl=(e="")=>{const n=e.split("/"),r=n[n.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},xa=e=>e.indexOf("image/")===0,Ql=e=>{if(e.type&&!e.thumbUrl)return xa(e.type);const n=e.thumbUrl||e.url||"",t=Yl(n);return/^data:image\//.test(n)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(t)?!0:!(/^data:/.test(n)||t)},Rt=200;function Zl(e){return new Promise(n=>{if(!e.type||!xa(e.type)){n("");return}const t=document.createElement("canvas");t.width=Rt,t.height=Rt,t.style.cssText=`position: fixed; left: 0; top: 0; width: ${Rt}px; height: ${Rt}px; z-index: 9999; display: none;`,document.body.appendChild(t);const r=t.getContext("2d"),o=new Image;if(o.onload=()=>{const{width:a,height:i}=o;let s=Rt,u=Rt,d=0,f=0;a>i?(u=i*(Rt/a),f=-(u-s)/2):(s=a*(Rt/i),d=-(s-u)/2),r.drawImage(o,d,f,s,u);const m=t.toDataURL();document.body.removeChild(t),window.URL.revokeObjectURL(o.src),n(m)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const a=new FileReader;a.onload=()=>{a.result&&typeof a.result=="string"&&(o.src=a.result)},a.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const a=new FileReader;a.onload=()=>{a.result&&n(a.result)},a.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var ec={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},tc=function(n,t){return l.createElement(Jt,De({},n,{ref:t,icon:ec}))},nc=l.forwardRef(tc);const rc=l.forwardRef(({prefixCls:e,className:n,style:t,locale:r,listType:o,file:a,items:i,progress:s,iconRender:u,actionIconRender:d,itemRender:f,isImgUrl:m,showPreviewIcon:h,showRemoveIcon:x,showDownloadIcon:w,previewIcon:c,removeIcon:p,downloadIcon:C,extra:b,onPreview:I,onDownload:S,onClose:y},F)=>{var D,O;const{status:N}=a,[E,_]=l.useState(N);l.useEffect(()=>{N!=="removed"&&_(N)},[N]);const[T,k]=l.useState(!1);l.useEffect(()=>{const we=setTimeout(()=>{k(!0)},300);return()=>{clearTimeout(we)}},[]);const M=u(a);let B=l.createElement("div",{className:`${e}-icon`},M);if(o==="picture"||o==="picture-card"||o==="picture-circle")if(E==="uploading"||!a.thumbUrl&&!a.url){const we=Z(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:E!=="uploading"});B=l.createElement("div",{className:we},M)}else{const we=m!=null&&m(a)?l.createElement("img",{src:a.thumbUrl||a.url,alt:a.name,className:`${e}-list-item-image`,crossOrigin:a.crossOrigin}):M,Te=Z(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:m&&!m(a)});B=l.createElement("a",{className:Te,onClick:Je=>I(a,Je),href:a.url||a.thumbUrl,target:"_blank",rel:"noopener noreferrer"},we)}const V=Z(`${e}-list-item`,`${e}-list-item-${E}`),j=typeof a.linkProps=="string"?JSON.parse(a.linkProps):a.linkProps,U=(typeof x=="function"?x(a):x)?d((typeof p=="function"?p(a):p)||l.createElement(Sl,null),()=>y(a),e,r.removeFile,!0):null,K=(typeof w=="function"?w(a):w)&&E==="done"?d((typeof C=="function"?C(a):C)||l.createElement(nc,null),()=>S(a),e,r.downloadFile):null,L=o!=="picture-card"&&o!=="picture-circle"&&l.createElement("span",{key:"download-delete",className:Z(`${e}-list-item-actions`,{picture:o==="picture"})},K,U),q=typeof b=="function"?b(a):b,ee=q&&l.createElement("span",{className:`${e}-list-item-extra`},q),R=Z(`${e}-list-item-name`),W=a.url?l.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:R,title:a.name},j,{href:a.url,onClick:we=>I(a,we)}),a.name,ee):l.createElement("span",{key:"view",className:R,onClick:we=>I(a,we),title:a.name},a.name,ee),J=(typeof h=="function"?h(a):h)&&(a.url||a.thumbUrl)?l.createElement("a",{href:a.url||a.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:we=>I(a,we),title:r.previewFile},typeof c=="function"?c(a):c||l.createElement(ri,null)):null,oe=(o==="picture-card"||o==="picture-circle")&&E!=="uploading"&&l.createElement("span",{className:`${e}-list-item-actions`},J,E==="done"&&K,U),{getPrefixCls:ae}=l.useContext(wt),Q=ae(),ie=l.createElement("div",{className:V},B,W,L,oe,T&&l.createElement(Er,{motionName:`${Q}-fade`,visible:E==="uploading",motionDeadline:2e3},({className:we})=>{const Te="percent"in a?l.createElement(wl,Object.assign({type:"line",percent:a.percent,"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"]},s)):null;return l.createElement("div",{className:Z(`${e}-list-item-progress`,we)},Te)})),Ce=a.response&&typeof a.response=="string"?a.response:((D=a.error)===null||D===void 0?void 0:D.statusText)||((O=a.error)===null||O===void 0?void 0:O.message)||r.uploadError,xe=E==="error"?l.createElement(Fr,{title:Ce,getPopupContainer:we=>we.parentNode},ie):ie;return l.createElement("div",{className:Z(`${e}-list-item-container`,n),style:t,ref:F},f?f(xe,a,i,{download:S.bind(null,a),preview:I.bind(null,a),remove:y.bind(null,a)}):xe)}),oc=(e,n)=>{const{listType:t="text",previewFile:r=Zl,onPreview:o,onDownload:a,onRemove:i,locale:s,iconRender:u,isImageUrl:d=Ql,prefixCls:f,items:m=[],showPreviewIcon:h=!0,showRemoveIcon:x=!0,showDownloadIcon:w=!1,removeIcon:c,previewIcon:p,downloadIcon:C,extra:b,progress:I={size:[-1,2],showInfo:!1},appendAction:S,appendActionVisible:y=!0,itemRender:F,disabled:D}=e,[,O]=oi(),[N,E]=l.useState(!1),_=["picture-card","picture-circle"].includes(t);l.useEffect(()=>{t.startsWith("picture")&&(m||[]).forEach(R=>{!(R.originFileObj instanceof File||R.originFileObj instanceof Blob)||R.thumbUrl!==void 0||(R.thumbUrl="",r==null||r(R.originFileObj).then(W=>{R.thumbUrl=W||"",O()}))})},[t,m,r]),l.useEffect(()=>{E(!0)},[]);const T=(R,W)=>{if(o)return W==null||W.preventDefault(),o(R)},k=R=>{typeof a=="function"?a(R):R.url&&window.open(R.url)},M=R=>{i==null||i(R)},B=R=>{if(u)return u(R,t);const W=R.status==="uploading";if(t.startsWith("picture")){const J=t==="picture"?l.createElement(Vr,null):s.uploading,oe=d!=null&&d(R)?l.createElement(Gl,null):l.createElement(ql,null);return W?J:oe}return W?l.createElement(Vr,null):l.createElement(Vl,null)},V=(R,W,J,oe,ae)=>{const Q={type:"text",size:"small",title:oe,onClick:ie=>{var Ce,xe;W(),l.isValidElement(R)&&((xe=(Ce=R.props).onClick)===null||xe===void 0||xe.call(Ce,ie))},className:`${J}-list-item-action`,disabled:ae?D:!1};return l.isValidElement(R)?l.createElement(pt,Object.assign({},Q,{icon:Gt(R,Object.assign(Object.assign({},R.props),{onClick:()=>{}}))})):l.createElement(pt,Object.assign({},Q),l.createElement("span",null,R))};l.useImperativeHandle(n,()=>({handlePreview:T,handleDownload:k}));const{getPrefixCls:j}=l.useContext(wt),U=j("upload",f),K=j(),L=Z(`${U}-list`,`${U}-list-${t}`),q=l.useMemo(()=>xt(Ho(K),["onAppearEnd","onEnterEnd","onLeaveEnd"]),[K]),ee=Object.assign(Object.assign({},_?{}:q),{motionDeadline:2e3,motionName:`${U}-${_?"animate-inline":"animate"}`,keys:Ye(m.map(R=>({key:R.uid,file:R}))),motionAppear:N});return l.createElement("div",{className:L},l.createElement(ai,Object.assign({},ee,{component:!1}),({key:R,file:W,className:J,style:oe})=>l.createElement(rc,{key:R,locale:s,prefixCls:U,className:J,style:oe,file:W,items:m,progress:I,listType:t,isImgUrl:d,showPreviewIcon:h,showRemoveIcon:x,showDownloadIcon:w,removeIcon:c,previewIcon:p,downloadIcon:C,extra:b,iconRender:B,actionIconRender:V,itemRender:F,onPreview:T,onDownload:k,onClose:M})),S&&l.createElement(Er,Object.assign({},ee,{visible:y,forceRender:!0}),({className:R,style:W})=>Gt(S,J=>({className:Z(J.className,R),style:Object.assign(Object.assign(Object.assign({},W),{pointerEvents:R?"none":void 0}),J.style)}))))},ac=l.forwardRef(oc);var ic=function(e,n,t,r){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(f){try{d(r.next(f))}catch(m){i(m)}}function u(f){try{d(r.throw(f))}catch(m){i(m)}}function d(f){f.done?a(f.value):o(f.value).then(s,u)}d((r=r.apply(e,[])).next())})};const on=`__LIST_IGNORE_${Date.now()}__`,sc=(e,n)=>{const t=Or("upload"),{fileList:r,defaultFileList:o,onRemove:a,showUploadList:i=!0,listType:s="text",onPreview:u,onDownload:d,onChange:f,onDrop:m,previewFile:h,disabled:x,locale:w,iconRender:c,isImageUrl:p,progress:C,prefixCls:b,className:I,type:S="select",children:y,style:F,itemRender:D,maxCount:O,data:N={},multiple:E=!1,hasControlInside:_=!0,action:T="",accept:k="",supportServerRender:M=!0,rootClassName:B}=e,V=l.useContext(ii),j=x??V,U=e.customRequest||t.customRequest,[K,L]=Lt(o||[],{value:r,postState:G=>G??[]}),[q,ee]=l.useState("drop"),R=l.useRef(null),W=l.useRef(null);l.useMemo(()=>{const G=Date.now();(r||[]).forEach((pe,Fe)=>{!pe.uid&&!Object.isFrozen(pe)&&(pe.uid=`__AUTO__${G}_${Fe}__`)})},[r]);const J=(G,pe,Fe)=>{let se=Ye(pe),be=!1;O===1?se=se.slice(-1):O&&(be=se.length>O,se=se.slice(0,O)),lr(()=>{L(se)});const _e={file:G,fileList:se};Fe&&(_e.event=Fe),(!be||G.status==="removed"||se.some(at=>at.uid===G.uid))&&lr(()=>{f==null||f(_e)})},oe=(G,pe)=>ic(void 0,void 0,void 0,function*(){const{beforeUpload:Fe,transformFile:se}=e;let be=G;if(Fe){const _e=yield Fe(G,pe);if(_e===!1)return!1;if(delete G[on],_e===on)return Object.defineProperty(G,on,{value:!0,configurable:!0}),!1;typeof _e=="object"&&_e&&(be=_e)}return se&&(be=yield se(be)),be}),ae=G=>{const pe=G.filter(be=>!be.file[on]);if(!pe.length)return;const Fe=pe.map(be=>bn(be.file));let se=Ye(K);Fe.forEach(be=>{se=yn(be,se)}),Fe.forEach((be,_e)=>{let at=be;if(pe[_e].parsedFile)be.status="uploading";else{const{originFileObj:dt}=be;let tt;try{tt=new File([dt],dt.name,{type:dt.type})}catch{tt=new Blob([dt],{type:dt.type}),tt.name=dt.name,tt.lastModifiedDate=new Date,tt.lastModified=new Date().getTime()}tt.uid=be.uid,at=tt}J(at,se)})},Q=(G,pe,Fe)=>{try{typeof G=="string"&&(G=JSON.parse(G))}catch{}if(!Zn(pe,K))return;const se=bn(pe);se.status="done",se.percent=100,se.response=G,se.xhr=Fe;const be=yn(se,K);J(se,be)},ie=(G,pe)=>{if(!Zn(pe,K))return;const Fe=bn(pe);Fe.status="uploading",Fe.percent=G.percent;const se=yn(Fe,K);J(Fe,se,G)},Ce=(G,pe,Fe)=>{if(!Zn(Fe,K))return;const se=bn(Fe);se.error=G,se.response=pe,se.status="error";const be=yn(se,K);J(se,be)},xe=G=>{let pe;Promise.resolve(typeof a=="function"?a(G):a).then(Fe=>{var se;if(Fe===!1)return;const be=Jl(G,K);be&&(pe=Object.assign(Object.assign({},G),{status:"removed"}),K==null||K.forEach(_e=>{const at=pe.uid!==void 0?"uid":"name";_e[at]===pe[at]&&!Object.isFrozen(_e)&&(_e.status="removed")}),(se=R.current)===null||se===void 0||se.abort(pe),J(pe,be))})},we=G=>{ee(G.type),G.type==="drop"&&(m==null||m(G))};l.useImperativeHandle(n,()=>({onBatchStart:ae,onSuccess:Q,onProgress:ie,onError:Ce,fileList:K,upload:R.current,nativeElement:W.current}));const{getPrefixCls:Te,direction:Je,upload:Le}=l.useContext(wt),ve=Te("upload",b),me=Object.assign(Object.assign({onBatchStart:ae,onError:Ce,onProgress:ie,onSuccess:Q},e),{customRequest:U,data:N,multiple:E,action:T,accept:k,supportServerRender:M,prefixCls:ve,disabled:j,beforeUpload:oe,onChange:void 0,hasControlInside:_});delete me.className,delete me.style,(!y||j)&&delete me.id;const ct=`${ve}-wrapper`,[mt,$t,It]=jl(ve,ct),[At]=Uo("Upload",Wo.Upload),{showRemoveIcon:et,showPreviewIcon:qe,showDownloadIcon:St,removeIcon:kt,previewIcon:Mt,downloadIcon:Et,extra:Ae}=typeof i=="boolean"?{}:i,ce=typeof et>"u"?!j:et,nt=(G,pe)=>i?l.createElement(ac,{prefixCls:ve,listType:s,items:K,previewFile:h,onPreview:u,onDownload:d,onRemove:xe,showRemoveIcon:ce,showPreviewIcon:qe,showDownloadIcon:St,removeIcon:kt,previewIcon:Mt,downloadIcon:Et,iconRender:c,extra:Ae,locale:Object.assign(Object.assign({},At),w),isImageUrl:p,progress:C,appendAction:G,appendActionVisible:pe,itemRender:D,disabled:j}):G,ut=Z(ct,I,B,$t,It,Le==null?void 0:Le.className,{[`${ve}-rtl`]:Je==="rtl",[`${ve}-picture-card-wrapper`]:s==="picture-card",[`${ve}-picture-circle-wrapper`]:s==="picture-circle"}),ft=Object.assign(Object.assign({},Le==null?void 0:Le.style),F);if(S==="drag"){const G=Z($t,ve,`${ve}-drag`,{[`${ve}-drag-uploading`]:K.some(pe=>pe.status==="uploading"),[`${ve}-drag-hover`]:q==="dragover",[`${ve}-disabled`]:j,[`${ve}-rtl`]:Je==="rtl"});return mt(l.createElement("span",{className:ut,ref:W},l.createElement("div",{className:G,style:ft,onDrop:we,onDragOver:we,onDragLeave:we},l.createElement(gr,Object.assign({},me,{ref:R,className:`${ve}-btn`}),l.createElement("div",{className:`${ve}-drag-container`},y))),nt()))}const Ue=Z(ve,`${ve}-select`,{[`${ve}-disabled`]:j,[`${ve}-hidden`]:!y}),We=l.createElement("div",{className:Ue,style:ft},l.createElement(gr,Object.assign({},me,{ref:R})));return mt(s==="picture-card"||s==="picture-circle"?l.createElement("span",{className:ut,ref:W},nt(We,!!y)):l.createElement("span",{className:ut,ref:W},We,nt()))},wa=l.forwardRef(sc);var lc=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const cc=l.forwardRef((e,n)=>{const{style:t,height:r,hasControlInside:o=!1,children:a}=e,i=lc(e,["style","height","hasControlInside","children"]),s=Object.assign(Object.assign({},t),{height:r});return l.createElement(wa,Object.assign({ref:n,hasControlInside:o},i,{style:s,type:"drag"}),a)}),jr=wa;jr.Dragger=cc;jr.LIST_IGNORE=on;const bo={actions:[{icon:$(lt,{type:"rag/folder",size:18}),name:"history",badgeCount:0}],switchs:[{label:"\u8054\u7F51\u641C\u7D22",name:"netSearch",type:"checkbox",defaultValue:!1,enabled:!0,icon:$(lt,{type:"rag/url",size:12})},{label:"\u63A8\u7406\u601D\u8003",name:"reasoning",type:"checkbox",defaultValue:!1,enabled:!0,icon:$(lt,{type:"rag/think",size:12})}]};function uc(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,si(e,n)}var yo=Number.isNaN||function(n){return typeof n=="number"&&n!==n};function dc(e,n){return!!(e===n||yo(e)&&yo(n))}function pc(e,n){if(e.length!==n.length)return!1;for(var t=0;t<e.length;t++)if(!dc(e[t],n[t]))return!1;return!0}function er(e,n){n===void 0&&(n=pc);var t,r=[],o,a=!1;function i(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return a&&t===this&&n(s,r)||(o=e.apply(this,s),a=!0,t=this,r=s),o}return i}var mc=typeof performance=="object"&&typeof performance.now=="function",Co=mc?function(){return performance.now()}:function(){return Date.now()};function xo(e){cancelAnimationFrame(e.id)}function fc(e,n){var t=Co();function r(){Co()-t>=n?e.call(null):o.id=requestAnimationFrame(r)}var o={id:requestAnimationFrame(r)};return o}var tr=-1;function wo(e){if(e===void 0&&(e=!1),tr===-1||e){var n=document.createElement("div"),t=n.style;t.width="50px",t.height="50px",t.overflow="scroll",document.body.appendChild(n),tr=n.offsetWidth-n.clientWidth,document.body.removeChild(n)}return tr}var Vt=null;function $o(e){if(e===void 0&&(e=!1),Vt===null||e){var n=document.createElement("div"),t=n.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",n.appendChild(r),document.body.appendChild(n),n.scrollLeft>0?Vt="positive-descending":(n.scrollLeft=1,n.scrollLeft===0?Vt="negative":Vt="positive-ascending"),document.body.removeChild(n),Vt}return Vt}var gc=150,hc=function(n,t){return n};function vc(e){var n,t=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,i=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,u=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,f=e.validateProps;return n=(function(m){uc(h,m);function h(w){var c;return c=m.call(this,w)||this,c._instanceProps=u(c.props,Ve(c)),c._outerRef=void 0,c._resetIsScrollingTimeoutId=null,c.state={instance:Ve(c),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof c.props.initialScrollOffset=="number"?c.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},c._callOnItemsRendered=void 0,c._callOnItemsRendered=er(function(p,C,b,I){return c.props.onItemsRendered({overscanStartIndex:p,overscanStopIndex:C,visibleStartIndex:b,visibleStopIndex:I})}),c._callOnScroll=void 0,c._callOnScroll=er(function(p,C,b){return c.props.onScroll({scrollDirection:p,scrollOffset:C,scrollUpdateWasRequested:b})}),c._getItemStyle=void 0,c._getItemStyle=function(p){var C=c.props,b=C.direction,I=C.itemSize,S=C.layout,y=c._getItemStyleCache(d&&I,d&&S,d&&b),F;if(y.hasOwnProperty(p))F=y[p];else{var D=t(c.props,p,c._instanceProps),O=o(c.props,p,c._instanceProps),N=b==="horizontal"||S==="horizontal",E=b==="rtl",_=N?D:0;y[p]=F={position:"absolute",left:E?void 0:_,right:E?_:void 0,top:N?0:D,height:N?"100%":O,width:N?O:"100%"}}return F},c._getItemStyleCache=void 0,c._getItemStyleCache=er(function(p,C,b){return{}}),c._onScrollHorizontal=function(p){var C=p.currentTarget,b=C.clientWidth,I=C.scrollLeft,S=C.scrollWidth;c.setState(function(y){if(y.scrollOffset===I)return null;var F=c.props.direction,D=I;if(F==="rtl")switch($o()){case"negative":D=-I;break;case"positive-descending":D=S-b-I;break}return D=Math.max(0,Math.min(D,S-b)),{isScrolling:!0,scrollDirection:y.scrollOffset<D?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},c._resetIsScrollingDebounced)},c._onScrollVertical=function(p){var C=p.currentTarget,b=C.clientHeight,I=C.scrollHeight,S=C.scrollTop;c.setState(function(y){if(y.scrollOffset===S)return null;var F=Math.max(0,Math.min(S,I-b));return{isScrolling:!0,scrollDirection:y.scrollOffset<F?"forward":"backward",scrollOffset:F,scrollUpdateWasRequested:!1}},c._resetIsScrollingDebounced)},c._outerRefSetter=function(p){var C=c.props.outerRef;c._outerRef=p,typeof C=="function"?C(p):C!=null&&typeof C=="object"&&C.hasOwnProperty("current")&&(C.current=p)},c._resetIsScrollingDebounced=function(){c._resetIsScrollingTimeoutId!==null&&xo(c._resetIsScrollingTimeoutId),c._resetIsScrollingTimeoutId=fc(c._resetIsScrolling,gc)},c._resetIsScrolling=function(){c._resetIsScrollingTimeoutId=null,c.setState({isScrolling:!1},function(){c._getItemStyleCache(-1,null)})},c}h.getDerivedStateFromProps=function(c,p){return bc(c,p),f(c),null};var x=h.prototype;return x.scrollTo=function(c){c=Math.max(0,c),this.setState(function(p){return p.scrollOffset===c?null:{scrollDirection:p.scrollOffset<c?"forward":"backward",scrollOffset:c,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},x.scrollToItem=function(c,p){p===void 0&&(p="auto");var C=this.props,b=C.itemCount,I=C.layout,S=this.state.scrollOffset;c=Math.max(0,Math.min(c,b-1));var y=0;if(this._outerRef){var F=this._outerRef;I==="vertical"?y=F.scrollWidth>F.clientWidth?wo():0:y=F.scrollHeight>F.clientHeight?wo():0}this.scrollTo(a(this.props,c,p,S,this._instanceProps,y))},x.componentDidMount=function(){var c=this.props,p=c.direction,C=c.initialScrollOffset,b=c.layout;if(typeof C=="number"&&this._outerRef!=null){var I=this._outerRef;p==="horizontal"||b==="horizontal"?I.scrollLeft=C:I.scrollTop=C}this._callPropsCallbacks()},x.componentDidUpdate=function(){var c=this.props,p=c.direction,C=c.layout,b=this.state,I=b.scrollOffset,S=b.scrollUpdateWasRequested;if(S&&this._outerRef!=null){var y=this._outerRef;if(p==="horizontal"||C==="horizontal")if(p==="rtl")switch($o()){case"negative":y.scrollLeft=-I;break;case"positive-ascending":y.scrollLeft=I;break;default:var F=y.clientWidth,D=y.scrollWidth;y.scrollLeft=D-F-I;break}else y.scrollLeft=I;else y.scrollTop=I}this._callPropsCallbacks()},x.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&xo(this._resetIsScrollingTimeoutId)},x.render=function(){var c=this.props,p=c.children,C=c.className,b=c.direction,I=c.height,S=c.innerRef,y=c.innerElementType,F=c.innerTagName,D=c.itemCount,O=c.itemData,N=c.itemKey,E=N===void 0?hc:N,_=c.layout,T=c.outerElementType,k=c.outerTagName,M=c.style,B=c.useIsScrolling,V=c.width,j=this.state.isScrolling,U=b==="horizontal"||_==="horizontal",K=U?this._onScrollHorizontal:this._onScrollVertical,L=this._getRangeToRender(),q=L[0],ee=L[1],R=[];if(D>0)for(var W=q;W<=ee;W++)R.push(Vn(p,{data:O,key:E(W,O),index:W,isScrolling:B?j:void 0,style:this._getItemStyle(W)}));var J=r(this.props,this._instanceProps);return Vn(T||k||"div",{className:C,onScroll:K,ref:this._outerRefSetter,style:De({position:"relative",height:I,width:V,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},M)},Vn(y||F||"div",{children:R,ref:S,style:{height:U?"100%":J,pointerEvents:j?"none":void 0,width:U?J:"100%"}}))},x._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var c=this.props.itemCount;if(c>0){var p=this._getRangeToRender(),C=p[0],b=p[1],I=p[2],S=p[3];this._callOnItemsRendered(C,b,I,S)}}if(typeof this.props.onScroll=="function"){var y=this.state,F=y.scrollDirection,D=y.scrollOffset,O=y.scrollUpdateWasRequested;this._callOnScroll(F,D,O)}},x._getRangeToRender=function(){var c=this.props,p=c.itemCount,C=c.overscanCount,b=this.state,I=b.isScrolling,S=b.scrollDirection,y=b.scrollOffset;if(p===0)return[0,0,0,0];var F=i(this.props,y,this._instanceProps),D=s(this.props,F,y,this._instanceProps),O=!I||S==="backward"?Math.max(1,C):1,N=!I||S==="forward"?Math.max(1,C):1;return[Math.max(0,F-O),Math.max(0,Math.min(p-1,D+N)),F,D]},h})(Na),n.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},n}var bc=function(n,t){n.children,n.direction,n.height,n.layout,n.innerTagName,n.outerTagName,n.width,t.instance},yc=50,Kt=function(n,t,r){var o=n,a=o.itemSize,i=r.itemMetadataMap,s=r.lastMeasuredIndex;if(t>s){var u=0;if(s>=0){var d=i[s];u=d.offset+d.size}for(var f=s+1;f<=t;f++){var m=a(f);i[f]={offset:u,size:m},u+=m}r.lastMeasuredIndex=t}return i[t]},Cc=function(n,t,r){var o=t.itemMetadataMap,a=t.lastMeasuredIndex,i=a>0?o[a].offset:0;return i>=r?$a(n,t,a,0,r):xc(n,t,Math.max(0,a),r)},$a=function(n,t,r,o,a){for(;o<=r;){var i=o+Math.floor((r-o)/2),s=Kt(n,i,t).offset;if(s===a)return i;s<a?o=i+1:s>a&&(r=i-1)}return o>0?o-1:0},xc=function(n,t,r,o){for(var a=n.itemCount,i=1;r<a&&Kt(n,r,t).offset<o;)r+=i,i*=2;return $a(n,t,Math.min(r,a-1),Math.floor(r/2),o)},Io=function(n,t){var r=n.itemCount,o=t.itemMetadataMap,a=t.estimatedItemSize,i=t.lastMeasuredIndex,s=0;if(i>=r&&(i=r-1),i>=0){var u=o[i];s=u.offset+u.size}var d=r-i-1,f=d*a;return s+f},wc=vc({getItemOffset:function(n,t,r){return Kt(n,t,r).offset},getItemSize:function(n,t,r){return r.itemMetadataMap[t].size},getEstimatedTotalSize:Io,getOffsetForIndexAndAlignment:function(n,t,r,o,a,i){var s=n.direction,u=n.height,d=n.layout,f=n.width,m=s==="horizontal"||d==="horizontal",h=m?f:u,x=Kt(n,t,a),w=Io(n,a),c=Math.max(0,Math.min(w-h,x.offset)),p=Math.max(0,x.offset-h+x.size+i);switch(r==="smart"&&(o>=p-h&&o<=c+h?r="auto":r="center"),r){case"start":return c;case"end":return p;case"center":return Math.round(p+(c-p)/2);case"auto":default:return o>=p&&o<=c?o:o<p?p:c}},getStartIndexForOffset:function(n,t,r){return Cc(n,r,t)},getStopIndexForStartIndex:function(n,t,r,o){for(var a=n.direction,i=n.height,s=n.itemCount,u=n.layout,d=n.width,f=a==="horizontal"||u==="horizontal",m=f?d:i,h=Kt(n,t,o),x=r+m,w=h.offset+h.size,c=t;c<s-1&&w<x;)c++,w+=Kt(n,c,o).size;return c},initInstanceProps:function(n,t){var r=n,o=r.estimatedItemSize,a={itemMetadataMap:{},estimatedItemSize:o||yc,lastMeasuredIndex:-1};return t.resetAfterIndex=function(i,s){s===void 0&&(s=!0),a.lastMeasuredIndex=Math.min(a.lastMeasuredIndex,i-1),t._getItemStyleCache(-1),s&&t.forceUpdate()},a},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(n){n.itemSize}});function $c({isActive:e,isNew:n,isDisabled:t,data:r,eventsEmit:o,styles:a={},assistantList:i=[]}){const[s,u]=Ie(!1),d=(a==null?void 0:a.colors)||{},f=Ge(()=>{const p=r==null?void 0:r.configId;if(!p||!i||i.length===0)return"\u672A\u9009\u62E9\u52A9\u624B";const C=i.find(b=>String(b==null?void 0:b.id)===String(p));if(!C)return"\u672A\u9009\u62E9\u52A9\u624B";if(C!=null&&C.name)return C.name;try{const b=typeof C.configJson=="string"?JSON.parse(C.configJson):C.configJson;return(b==null?void 0:b.config_name)||"\u672A\u9009\u62E9\u52A9\u624B"}catch{return"\u672A\u9009\u62E9\u52A9\u624B"}},[i,r==null?void 0:r.configId]),m=[{key:"rename",icon:$(Ei,{size:12}),label:"\u91CD\u547D\u540D",onClick:p=>{p.domEvent.stopPropagation(),o&&o("conversations:rename_icon_clicked",r)}},{key:"delete",icon:$(Ni,{size:12}),label:"\u5220\u9664",danger:!0,onClick:p=>{p.domEvent.stopPropagation(),o&&o("conversations:delete_icon_clicked",r)}}],h=e?d.activeItemBg||"#f0f4ff":s?d.itemHoverBg||"#f5f7fa":d.itemBg||"transparent",x=e?d.activeItemText||d.primary||"#0122ff":d.itemText||"#333",w=e?d.activeItemBorder||d.primary||"#0122ff":"transparent",c=p=>{const C=Kr(),b=Kr(p);return C.isSame(b,"day")?b.format("HH:mm"):b.format("MM-DD HH:mm")};return Y("div",{className:"flex relative items-center justify-between mb-2 px-4 py-3 rounded-md transition-colors cursor-pointer select-none",onClick:()=>!t&&o&&o("conversation:item_click",r),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),style:{minHeight:48,background:h,color:x,border:`1px solid ${w}`,...a.item,opacity:t?.5:1},children:[Y("div",{className:"flex flex-col gap-y-2 flex-1 min-w-0",children:[$("span",{className:"truncate text-sm max-w-[160px] font-medium",title:r.label||"\u672A\u547D\u540D\u4F1A\u8BDD",style:{color:x,fontSize:"14px",lineHeight:"1.4"},children:r.label||"\u672A\u547D\u540D\u4F1A\u8BDD"}),Y("div",{className:"flex items-center justify-between gap-2",children:[$("span",{className:"text-xs truncate flex-1",style:{color:e?d.activeItemTextSecondary||"#666":d.itemTextSecondary||"#666",fontSize:"12px",lineHeight:"1.3"},children:f}),r.gmtModified&&$("span",{className:"text-xs flex-shrink-0",style:{color:e?d.activeItemTextSecondary||"#999":d.itemTextSecondary||"#999",fontSize:"12px",lineHeight:"1.3"},children:c(r.gmtModified)})]})]}),!t&&s&&!n&&$("div",{className:"absolute top-2 right-3",children:$(ha,{menu:{items:m},trigger:["click"],placement:"bottomRight",children:$(wi,{size:16,className:"text-gray-600 hover:text-gray-800",style:{cursor:"pointer",color:e?d.activeItemTextSecondary||"#999":d.itemTextSecondary||"#999"},onClick:p=>p.stopPropagation()})})})]})}function Ic(e,n=[{label:"\u5F53\u5929",dayPeriod:1}]){const t=new Date,r={other:[]};return e.forEach(o=>{const a=new Date(o.gmtModified),i=Math.floor((+t-+a)/(1e3*60*60*24));let s=!1;for(const u of n)if(i<=u.dayPeriod){r[u.label]||(r[u.label]=[]),r[u.label].push(o),s=!0;break}s||r.other.push(o)}),r}function Sc(e){const{data:n,activedItem:t,onChange:r,onDelete:o,sortRules:a=[{label:"\u5F53\u5929",dayPeriod:1}],eventsEmit:i,assistantList:s,height:u=400,styles:d={},hasMore:f=!1,loadingMore:m=!1}=e,h=n.map(N=>N.sessionId+"-"+N.gmtModified).join(","),x=Ge(()=>{const N=a.length>0?a:[{label:"\u5F53\u5929",dayPeriod:1}],E=Ic(n,N),_=N.every(k=>!E[k.label]||E[k.label].length===0),T=[];return N.forEach(k=>{E[k.label]&&E[k.label].length>0&&(T.push({type:"group",label:k.label}),E[k.label].forEach(M=>T.push({type:"item",data:M})))}),E.other.length>0&&!_&&(T.push({type:"group",label:"\u5176\u4ED6"}),E.other.forEach(k=>T.push({type:"item",data:k}))),_&&E.other.length>0&&E.other.forEach(k=>T.push({type:"item",data:k})),T},[n,a,h]),w=Ge(()=>x.map(N=>N.type==="group"?`g:${N.label}`:`i:${N.data.sessionId}`).join("|"),[x]),c=56,p=14,C=36,b=N=>N===x.length?C:x[N].type==="group"?32:c+p,I=Xe(null),S=Ge(()=>x.findIndex(N=>{var E;return N.type==="item"&&((E=N.data)==null?void 0:E.sessionId)===t}),[x,t]),y=Ge(()=>x.findIndex(N=>N.type==="item"),[x]),F=Xe(void 0);je(()=>{const N=F.current;t!==N&&S>-1&&S===y&&I.current&&I.current.scrollToItem(S,"start"),F.current=t},[t,S,y]);const D=Xe(0);if(je(()=>{if(I.current){const N=D.current,E=x.length;D.current=E,E!==N&&I.current.resetAfterIndex(Math.max(0,Math.min(N,E)-1),!1)}},[x.length]),je(()=>{I.current&&I.current.resetAfterIndex(0,!1)},[w]),x.length===0)return $("div",{className:"text-center text-zinc-400 py-8",children:"\u6682\u65E0\u4F1A\u8BDD"});const O=(d==null?void 0:d.colors)||{};return $(di,{flipKey:h,spring:{stiffness:180,damping:18},children:$(wc,{ref:I,height:u,width:"100%",itemCount:x.length+1,itemSize:b,itemKey:N=>{if(N===x.length)return"footer";const E=x[N];return E.type==="item"?E.data.sessionId:`group-${E.label}`},onItemsRendered:({visibleStopIndex:N})=>{f&&!m&&N>=x.length-1-3&&typeof i=="function"&&i("conversations:load_more")},style:{overflowX:"hidden"},children:({index:N,style:E})=>{if(N===x.length){const T=(d==null?void 0:d.colors)||{};return $("div",{style:{...E,height:C,lineHeight:`${C}px`,textAlign:"center",fontSize:"10px",color:T.textMuted||"#9ca3af",background:T.groupBg||"white"},children:m?"\u52A0\u8F7D\u4E2D...":f?"":"\u6CA1\u6709\u66F4\u591A\u4E86"})}const _=x[N];return _.type==="group"?$("div",{style:{...E,background:O.groupBg||"white",zIndex:1},className:"pt-2 pb-1 px-[28px] py-[2px] text-xs text-gray-400",children:_.label}):$(pi,{flipId:_.data.sessionId,children:$("div",{style:E,className:"px-[12px] py-[2px]",children:$($c,{isActive:t===_.data.sessionId,isDisabled:!1,isNew:_.data.isNew,data:_.data,eventsEmit:i,assistantList:s,styles:d})})},_.data.sessionId)}})})}const Ec=({value:e,eventsEmit:n,setSearch:t,style:r,styles:o={}})=>{const a=o.colors||{},i=o.radius||"12px",s=a.border||"#e5e7eb",u=a.primary||"#2563eb",d=o.headerBg||a.sidebarBg||a.background||"#fff",[f,m]=Be.useState(!1);return Y("div",{className:"flex items-center gap-2 px-4 py-3 sticky top-0 z-10 min-w-0",style:{...r,background:d,borderTopLeftRadius:i,borderTopRightRadius:i},children:[$("button",{className:"border-none flex items-center justify-center",onClick:()=>{m(!1),n&&n("conversation:create")},title:"\u65B0\u5EFA\u4F1A\u8BDD",style:{height:42,borderRadius:"90px",background:u,color:a.buttonText||"#fff",fontWeight:600,boxShadow:o.shadow||"0 2px 8px 0 rgba(0,0,0,0.04)",padding:f?"0 0":"0 14px",minWidth:f?0:180,width:f?0:void 0,opacity:f?0:1,overflow:"hidden",flexShrink:0,transition:"width .22s ease, min-width .22s ease, padding .22s ease, opacity .18s ease"},children:Y("div",{className:"flex items-center gap-2",children:[$(Xo,{size:18}),$("span",{className:"text-sm",children:"\u65B0\u5EFA\u5BF9\u8BDD"})]})}),f?Y("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[$("input",{className:"flex-1 px-3 py-2 text-sm transition-all",placeholder:"\u641C\u7D22\u4F1A\u8BDD...",value:e,onChange:h=>t(h.target.value),onBlur:()=>m(!1),onKeyDown:h=>{h.key==="Enter"&&m(!1)},style:{minWidth:0,width:"100%",maxWidth:"100%",borderRadius:i,background:a.inputBg||"#f4f4f5",border:`1px solid ${s}`,color:a.text||"#222",outline:"none"}}),$("button",{className:"flex items-center justify-center transition-colors",style:{width:36,height:36,borderRadius:"90px",border:`1px solid ${s}`,color:a.text||"#222",flexShrink:0},onClick:()=>m(!1),title:"\u6536\u8D77\u641C\u7D22",children:$(Pr,{size:16})})]}):$("button",{className:"ml-auto flex items-center justify-center transition-colors",style:{width:36,height:36,borderRadius:"90px",border:`1px solid ${s}`,color:u,flexShrink:0},onClick:()=>m(!0),title:"\u641C\u7D22",children:$(Fi,{size:18})})]})};function Fc(e){const{data:n,sortRules:t,activedItem:r,eventsEmit:o,assistantList:a,styles:i={},hasMore:s=!1,loadingMore:u=!1}=e,[d,f]=Ie(""),m=Ge(()=>d?n.filter(y=>(y.label||"\u672A\u547D\u540D\u4F1A\u8BDD").toLowerCase().includes(d.toLowerCase())):n,[n,d]),h=Ge(()=>[...m].sort((y,F)=>new Date(F.gmtModified).getTime()-new Date(y.gmtModified).getTime()),[m]),x=Xe(null),[w,c]=Ie(400);je(()=>{function y(){x.current&&c(x.current.clientHeight)}return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]);const p=(i==null?void 0:i.colors)||{};i!=null&&i.radius;const C=(i==null?void 0:i.shadow)||"0 4px 24px 0 rgba(0,0,0,0.06)",b=p.border||"#e5e7eb",I=p.sidebarBg||p.background||"#EAEEFF",S=p.text||"#222";return Y("div",{className:"h-full flex flex-col overflow-y-hidden",style:{background:I,color:S,boxShadow:C,border:`1px solid ${b}`,...i.container},children:[$(Ec,{value:d,setSearch:f,eventsEmit:o,style:i.header,styles:i}),Y("div",{className:"flex-1 min-h-0 relative",ref:x,style:i.list,children:[$(Sc,{eventsEmit:o,data:h,assistantList:a,activedItem:r,sortRules:t,height:w,styles:i,hasMore:s,loadingMore:u}),$("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-3 z-20",style:{background:`linear-gradient(to bottom, ${I}cc, transparent)`}})]})]})}const Nc=(e,n)=>{let t=e&&e.replace(/<think>[\s\S]*?<\/think>/g,"");t=t.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,""),t=t.replace(/<a\s+[^>]*>(.*?)<\/a>/g,""),console.log("_content",t);const r=new mi(n.currentTarget||n.target,{text:()=>t});try{r.on("success",()=>{Re.success("\u6587\u672C\u590D\u5236\u6210\u529F",2),r.destroy()}),r.on("error",o=>{Re.error("\u590D\u5236\u5931\u8D25",2),r.destroy()}),r.onClick(n)}catch(o){r.destroy(),Re.error("\u590D\u5236\u5931\u8D25: "+o,2)}},So=e=>{const n=e.toLowerCase().split(".").pop()||"";return/^(jpg|jpeg|png|gif|bmp|webp)$/.test(n)?"image":/^(doc|docx)$/.test(n)?"word":/^(xls|xlsx|csv)$/.test(n)?"excel":/^(ppt|pptx)$/.test(n)?"ppt":n==="pdf"?"pdf":/^(txt|json|md|markdown)$/.test(n)?"text":/^(zip|rar|7z)$/.test(n)?"archive":"file"};function Oc(e){const n=[];for(const t of e){if(t.query){const r=t.query.queryId||t.query.id||t.queryId||t.id||Ht(32);n.push({istype:"user",content:t.query.content,time:t.query.gmtCreate,queryId:r,clientSideId:r+"-user",...t.query})}if(t.reply){const r=t.reply.queryId||t.reply.id||t.queryId||t.id||Ht(32);n.push({istype:"ai",content:t.reply.content,isDefault:t.reply.isDefault,time:t.time||t.gmtCreate||Date.now(),queryId:r,clientSideId:r+"-ai",...t.reply})}}return n}const Eo=async(e,n,t)=>{try{rt.post(`${e.url}/qa/feedback`,n,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success&&t&&t()})}catch(r){console.log("error",r)}},nr=async(e,n,t)=>{try{rt.delete(`${e.url}/qa/feedback/cancel?queryId=${n.queryId}`,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success&&t&&t()})}catch(r){console.log("error",r)}},Dc=(e,n)=>{try{rt.get(`${e.url}/qa/feedback/que/list`,{headers:{Authorization:e.token}}).then(t=>{t.data.success&&n&&n(t.data.data)})}catch(t){console.log("error",t)}},Pc=async(e,n,t)=>{try{rt.post(`${e.url}/qa/dialogue/reName`,n,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success?t&&t(r):Re.error("\u7F16\u8F91\u540D\u5B57\u5931\u8D25")}).catch(r=>{var o,a;(a=(o=r==null?void 0:r.response)==null?void 0:o.data)!=null&&a.errorMsg&&Re.error(r.response.data.errorMsg)})}catch(r){console.log("error",r)}},Ac=async(e,n,t)=>{try{rt.delete(`${e.url}/qa/dialogue/delete?sessionId=${n.sessionId}`,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success&&t&&t(r.data)})}catch(r){console.log("error",r)}},kc=async(e,n,t)=>{console.log("[DEBUG] handleCreateConversation \u8BF7\u6C42",{url:e.url,token:e.token,data:n});try{rt.post(`${e.url}/qa/dialogue/create`,n,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(r=>{r.data.success?t&&t(r.data):Re.error(r.data.errorMsg||"\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25")}).catch(r=>{var o,a;(a=(o=r==null?void 0:r.response)==null?void 0:o.data)!=null&&a.errorMsg&&Re.error(r.response.data.errorMsg)})}catch(r){console.log("error",r)}},Mc=async(e,n,t)=>{try{const{uid:r,queryId:o}=n;let a=`${e.url}/index/knowledgeBase/file/deleteByUid?uid=${r}`;o&&(a+=`&queryId=${o}`),rt.delete(a,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(i=>{i.data.success?t&&t(!0,i):t&&t(!1,i)}).catch(i=>{t&&t(!1,i)})}catch(r){t&&t(!1,r)}},Rc=""+new URL("assets/defaultWeLogo.svg",import.meta.url).href,Bc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAOkSURBVHgBxZRbTBxlFMd/c2EvXBbZLbsCVhcKaAyh2BKTWrX12RhNmxa1IVp98FEJVGNMY2KItSZtqGjaROMlaDSVxiZeqiRa0FBpIlSkhgK15WoLu7AL3V1md25+7CpUojzYB7/km5OZc+Z35pzz/wb+l3X7PotNL9tvd1yIc8OrYp9pWXZ6JXXdfLOtbdNa4fJazoZdu9xVNUE5petIVS9h/npRfkDKefg/A+OaJuUGvIz3DzD14R6uHv/WCmzbcuNlj7S+3z7+5Xepno7TLeJWWiv2n5zyTcEaT/TJlrfwljxCTm42lgHRmIHDqaIqIsTE43NS7FHCBXKkIzw4eGKkYcdnwmGvBspSy+DpxlrffXtqC6WeqM3+CZ3wnAZLOyXAlsXfOjU7D6EYHLw7zVKvgykcG+r98YmKjdG5BK3nw7w7YQuATdAJWR4IJ2UiswKoiC39+S0+4QjNL0NWgDU7y57ZVlLd2n+FO/Kd7BxxcPOpMKGrCSxNTNm2kVUZ2e1g+5YCxh4q4IW+cAactYTZLi6dxgqw4dUjj+UgfXpSJRAaY9Lt4dZAkoW5YWSXyKwo6ZYbhsFCciPe9hgHtDiB+kqe6huF6jknv2As9/Dj3mv2se4Yh5RhEr4SbD2FpMjomkZ0eoaunl5yxXwqKsspKwsiOVzYqST143k8Xe7gvaN17tHOTi0D/D6U3DqhO7oNNxOlU6heD0cOH2frg/dSU1ywMgRhRmMpvvjoG55t3I0RWWDvuST9iy5q64qtr2/LV9Ill/aNOsb9fnC48a+zGYzF6R/opefsGU59sl88d6V5tpagqekNFg2LgeHN3F/pJS9rET2l4v15Ruav1PHLEdsUJYpXcNjXKA54iCd11gf9ONUkLqeVtu4ciQUjwcCF3wjc4sUlJbhouyjOVek6O2kvT3kGV3e9P/uetlmhi4VpCsU0Wz5o5i6/kIehY8UjyHlLpVt8daKZc1d0qt3zaV2ex09LjYvnhsx3rj8pEq90N1QU+Q+9WJVgbzBPpFIzIrZNsYWVlYyVhJXVtFys6UHWf76O36NDu3nt0fbVJ0Wm6Sedomx5hzPCwYpJygvdkOMVQhbKFjrEFG2JRQjPTHH4Uh4HoptFfy2T5+9clt/qo6fS9MMYilqEL1dCyCQtQsnKhC51yUyCkBLz4qeT77Np3KCme/EvwJVndUcfl0qr6uzKwAb8biemqTCjmYS0RUKhM1zuep2TzZfIpFlefwDISXe8s31UTQAAAABJRU5ErkJggg==",Tc=(e,n)=>{const t={...Dr.colors,...e};return`
|
|
93
|
-
.g-welcome-${n} .g-welcome-title {
|
|
46
|
+
*/const fo=Ye("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),mo=e=>{const{componentCls:t,iconCls:r,antCls:n,zIndexPopup:o,colorText:a,colorWarning:s,marginXXS:c,marginXS:p,fontSize:m,fontWeightStrong:y,colorTextHeading:v}=e;return{[t]:{zIndex:o,[`&${n}-popover`]:{fontSize:m},[`${t}-message`]:{marginBottom:p,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${t}-message-icon ${r}`]:{color:s,fontSize:m,lineHeight:1,marginInlineEnd:p},[`${t}-title`]:{fontWeight:y,color:v,"&:only-child":{fontWeight:"normal"}},[`${t}-description`]:{marginTop:c,color:a}},[`${t}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:p}}}}},go=e=>{const{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},an=rr("Popconfirm",e=>mo(e),go,{resetStyle:!1});var ho=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const sn=e=>{const{prefixCls:t,okButtonProps:r,cancelButtonProps:n,title:o,description:a,cancelText:s,okText:c,okType:p="primary",icon:m=F.createElement(jr,null),showCancel:y=!0,close:v,onConfirm:x,onCancel:w,onPopupClick:C}=e,{getPrefixCls:i}=F.useContext(mt),[f]=Rr("Popconfirm",zr.Popconfirm),g=gr(o),h=gr(a);return F.createElement("div",{className:`${t}-inner-content`,onClick:C},F.createElement("div",{className:`${t}-message`},m&&F.createElement("span",{className:`${t}-message-icon`},m),F.createElement("div",{className:`${t}-message-text`},g&&F.createElement("div",{className:`${t}-title`},g),h&&F.createElement("div",{className:`${t}-description`},h))),F.createElement("div",{className:`${t}-buttons`},y&&F.createElement(Xe,Object.assign({onClick:w,size:"small"},n),s||(f==null?void 0:f.cancelText)),F.createElement(no,{buttonProps:Object.assign(Object.assign({size:"small"},Nn(p)),r),actionFn:x,close:v,prefixCls:i("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},c||(f==null?void 0:f.okText))))},yo=e=>{const{prefixCls:t,placement:r,className:n,style:o}=e,a=ho(e,["prefixCls","placement","className","style"]),{getPrefixCls:s}=F.useContext(mt),c=s("popconfirm",t),[p]=an(c);return p(F.createElement(ao,{placement:r,className:Ce(c,n),style:o,content:F.createElement(sn,Object.assign({prefixCls:c},a))}))};var vo=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const bo=F.forwardRef((e,t)=>{var r,n;const{prefixCls:o,placement:a="top",trigger:s="click",okType:c="primary",icon:p=F.createElement(jr,null),children:m,overlayClassName:y,onOpenChange:v,onVisibleChange:x,overlayStyle:w,styles:C,classNames:i}=e,f=vo(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:g,className:h,style:E,classNames:D,styles:b}=Lr("popconfirm"),[A,k]=qr(!1,{value:(r=e.open)!==null&&r!==void 0?r:e.visible,defaultValue:(n=e.defaultOpen)!==null&&n!==void 0?n:e.defaultVisible}),T=(U,V)=>{k(U,!0),x==null||x(U),v==null||v(U,V)},N=U=>{T(!1,U)},$=U=>{var V;return(V=e.onConfirm)===null||V===void 0?void 0:V.call(void 0,U)},_=U=>{var V;T(!1,U),(V=e.onCancel)===null||V===void 0||V.call(void 0,U)},H=(U,V)=>{const{disabled:X=!1}=e;X||T(U,V)},z=g("popconfirm",o),L=Ce(z,h,y,D.root,i==null?void 0:i.root),M=Ce(D.body,i==null?void 0:i.body),[Q]=an(z);return Q(F.createElement(nn,Object.assign({},nr(f,["title"]),{trigger:s,placement:a,onOpenChange:H,open:A,ref:t,classNames:{root:L,body:M},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},b.root),E),w),C==null?void 0:C.root),body:Object.assign(Object.assign({},b.body),C==null?void 0:C.body)},content:F.createElement(sn,Object.assign({okType:c,icon:p},e,{prefixCls:z,close:N,onConfirm:$,onCancel:_})),"data-popover-inject":!0}),m))}),ln=bo;ln._InternalPanelDoNotUseOrYouWillBeFired=yo;var xo={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},Fo=function(){var t=Le([]),r=Le(null);return Se(function(){var n=Date.now(),o=!1;t.current.forEach(function(a){if(a){o=!0;var s=a.style;s.transitionDuration=".3s, .3s, .3s, .06s",r.current&&n-r.current<100&&(s.transitionDuration="0s, 0s")}}),o&&(r.current=Date.now())}),t.current},yr=0,Co=On();function wo(){var e;return Co?(e=yr,yr+=1):e="TEST_OR_SSR",e}const Eo=(function(e){var t=F.useState(),r=kn(t,2),n=r[0],o=r[1];return F.useEffect(function(){o("rc_progress_".concat(wo()))},[]),e||n});var vr=function(t){var r=t.bg,n=t.children;return F.createElement("div",{style:{width:"100%",height:"100%",background:r}},n)};function br(e,t){return Object.keys(e).map(function(r){var n=parseFloat(r),o="".concat(Math.floor(n*t),"%");return"".concat(e[r]," ").concat(o)})}var So=F.forwardRef(function(e,t){var r=e.prefixCls,n=e.color,o=e.gradientId,a=e.radius,s=e.style,c=e.ptg,p=e.strokeLinecap,m=e.strokeWidth,y=e.size,v=e.gapDegree,x=n&&pt(n)==="object",w=x?"#FFF":void 0,C=y/2,i=F.createElement("circle",{className:"".concat(r,"-circle-path"),r:a,cx:C,cy:C,stroke:w,strokeLinecap:p,strokeWidth:m,opacity:c===0?0:1,style:s,ref:t});if(!x)return i;var f="".concat(o,"-conic"),g=v?"".concat(180+v/2,"deg"):"0deg",h=br(n,(360-v)/360),E=br(n,1),D="conic-gradient(from ".concat(g,", ").concat(h.join(", "),")"),b="linear-gradient(to ".concat(v?"bottom":"top",", ").concat(E.join(", "),")");return F.createElement(F.Fragment,null,F.createElement("mask",{id:f},i),F.createElement("foreignObject",{x:0,y:0,width:y,height:y,mask:"url(#".concat(f,")")},F.createElement(vr,{bg:b},F.createElement(vr,{bg:D}))))}),Ft=100,Lt=function(t,r,n,o,a,s,c,p,m,y){var v=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,x=n/100*360*((360-s)/360),w=s===0?0:{bottom:0,top:180,left:90,right:-90}[c],C=(100-o)/100*r;m==="round"&&o!==100&&(C+=y/2,C>=r&&(C=r-.01));var i=Ft/2;return{stroke:typeof p=="string"?p:void 0,strokeDasharray:"".concat(r,"px ").concat(t),strokeDashoffset:C+v,transform:"rotate(".concat(a+x+w,"deg)"),transformOrigin:"".concat(i,"px ").concat(i,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},Do=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function xr(e){var t=e??[];return Array.isArray(t)?t:[t]}var Io=function(t){var r=Gt(Gt({},xo),t),n=r.id,o=r.prefixCls,a=r.steps,s=r.strokeWidth,c=r.trailWidth,p=r.gapDegree,m=p===void 0?0:p,y=r.gapPosition,v=r.trailColor,x=r.strokeLinecap,w=r.style,C=r.className,i=r.strokeColor,f=r.percent,g=Ur(r,Do),h=Ft/2,E=Eo(n),D="".concat(E,"-gradient"),b=h-s/2,A=Math.PI*2*b,k=m>0?90+m/2:-90,T=A*((360-m)/360),N=pt(a)==="object"?a:{count:a,gap:2},$=N.count,_=N.gap,H=xr(f),z=xr(i),L=z.find(function(ee){return ee&&pt(ee)==="object"}),M=L&&pt(L)==="object",Q=M?"butt":x,U=Lt(A,T,0,100,k,m,y,v,Q,s),V=Fo(),X=function(){var Y=0;return H.map(function(j,K){var le=z[K]||z[z.length-1],we=Lt(A,T,Y,j,k,m,y,le,Q,s);return Y+=j,F.createElement(So,{key:K,color:le,ptg:j,radius:b,prefixCls:o,gradientId:D,style:we,strokeLinecap:Q,strokeWidth:s,gapDegree:m,ref:function(Ne){V[K]=Ne},size:Ft})}).reverse()},q=function(){var Y=Math.round($*(H[0]/100)),j=100/$,K=0;return new Array($).fill(null).map(function(le,we){var Ie=we<=Y-1?z[0]:v,Ne=Ie&&pt(Ie)==="object"?"url(#".concat(D,")"):void 0,xe=Lt(A,T,K,j,k,m,y,Ie,"butt",s,_);return K+=(T-xe.strokeDashoffset+_)*100/T,F.createElement("circle",{key:we,className:"".concat(o,"-circle-path"),r:b,cx:h,cy:h,stroke:Ne,strokeWidth:s,opacity:1,style:xe,ref:function(_e){V[we]=_e}})})};return F.createElement("svg",Je({className:Ce("".concat(o,"-circle"),C),viewBox:"0 0 ".concat(Ft," ").concat(Ft),style:w,id:n,role:"presentation"},g),!$&&F.createElement("circle",{className:"".concat(o,"-circle-trail"),r:b,cx:h,cy:h,stroke:v,strokeLinecap:Q,strokeWidth:c||s,style:U}),$?q():X())};function nt(e){return!e||e<0?0:e>100?100:e}function Nt({success:e,successPercent:t}){let r=t;return e&&"progress"in e&&(r=e.progress),e&&"percent"in e&&(r=e.percent),r}const $o=({percent:e,success:t,successPercent:r})=>{const n=nt(Nt({success:t,successPercent:r}));return[n,nt(nt(e)-n)]},Ao=({success:e={},strokeColor:t})=>{const{strokeColor:r}=e;return[r||Yt.green,t||null]},Ot=(e,t,r)=>{var n,o,a,s;let c=-1,p=-1;if(t==="step"){const m=r.steps,y=r.strokeWidth;typeof e=="string"||typeof e>"u"?(c=e==="small"?2:14,p=y??8):typeof e=="number"?[c,p]=[e,e]:[c=14,p=8]=Array.isArray(e)?e:[e.width,e.height],c*=m}else if(t==="line"){const m=r==null?void 0:r.strokeWidth;typeof e=="string"||typeof e>"u"?p=m||(e==="small"?6:8):typeof e=="number"?[c,p]=[e,e]:[c=-1,p=8]=Array.isArray(e)?e:[e.width,e.height]}else(t==="circle"||t==="dashboard")&&(typeof e=="string"||typeof e>"u"?[c,p]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[c,p]=[e,e]:Array.isArray(e)&&(c=(o=(n=e[0])!==null&&n!==void 0?n:e[1])!==null&&o!==void 0?o:120,p=(s=(a=e[0])!==null&&a!==void 0?a:e[1])!==null&&s!==void 0?s:120));return[c,p]},No=3,ko=e=>No/e*100,Oo=e=>{const{prefixCls:t,trailColor:r=null,strokeLinecap:n="round",gapPosition:o,gapDegree:a,width:s=120,type:c,children:p,success:m,size:y=s,steps:v}=e,[x,w]=Ot(y,"circle");let{strokeWidth:C}=e;C===void 0&&(C=Math.max(ko(x),6));const i={width:x,height:w,fontSize:x*.15+6},f=F.useMemo(()=>{if(a||a===0)return a;if(c==="dashboard")return 75},[a,c]),g=$o(e),h=o||c==="dashboard"&&"bottom"||void 0,E=Object.prototype.toString.call(e.strokeColor)==="[object Object]",D=Ao({success:m,strokeColor:e.strokeColor}),b=Ce(`${t}-inner`,{[`${t}-circle-gradient`]:E}),A=F.createElement(Io,{steps:v,percent:v?g[1]:g,strokeWidth:C,trailWidth:C,strokeColor:v?D[1]:D,strokeLinecap:n,trailColor:r,prefixCls:t,gapDegree:f,gapPosition:h}),k=x<=20,T=F.createElement("div",{className:b,style:i},A,!k&&p);return k?F.createElement(Wr,{title:p},T):T},kt="--progress-line-stroke-color",cn="--progress-percent",Fr=e=>{const t=e?"100%":"-100%";return new Qt(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},Bo=e=>{const{componentCls:t,iconCls:r}=e;return{[t]:Object.assign(Object.assign({},Vr(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${t}-outer`]:{display:"inline-flex",alignItems:"center",width:"100%"},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",flex:1,overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-layout-bottom`]:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[`${t}-text`]:{width:"max-content",marginInlineStart:0,marginTop:e.marginXXS}},[`${t}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${kt})`]},height:"100%",width:`calc(1 / var(${cn}) * 100%)`,display:"block"},[`&${t}-bg-inner`]:{minWidth:"max-content","&::after":{content:"none"},[`${t}-text-inner`]:{color:e.colorWhite,[`&${t}-text-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,width:"2em",whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[r]:{fontSize:e.fontSize},[`&${t}-text-outer`]:{width:"max-content"},[`&${t}-text-outer${t}-text-start`]:{width:"max-content",marginInlineStart:0,marginInlineEnd:e.marginXS}},[`${t}-text-inner`]:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",marginInlineStart:0,padding:`0 ${Re(e.paddingXXS)}`,[`&${t}-text-start`]:{justifyContent:"start"},[`&${t}-text-end`]:{justifyContent:"end"}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:Fr(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:Fr(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},_o=e=>{const{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.remainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[r]:{fontSize:e.circleIconFontSize}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}},To=e=>{const{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},Po=e=>{const{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${r}`]:{fontSize:e.fontSizeSM}}}},Mo=e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}),jo=rr("Progress",e=>{const t=e.calc(e.marginXXS).div(2).equal(),r=Hr(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[Bo(r),_o(r),To(r),Po(r)]},Mo);var Ro=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const zo=e=>{let t=[];return Object.keys(e).forEach(r=>{const n=Number.parseFloat(r.replace(/%/g,""));Number.isNaN(n)||t.push({key:n,value:e[r]})}),t=t.sort((r,n)=>r.key-n.key),t.map(({key:r,value:n})=>`${n} ${r}%`).join(", ")},Lo=(e,t)=>{const{from:r=Yt.blue,to:n=Yt.blue,direction:o=t==="rtl"?"to left":"to right"}=e,a=Ro(e,["from","to","direction"]);if(Object.keys(a).length!==0){const c=zo(a),p=`linear-gradient(${o}, ${c})`;return{background:p,[kt]:p}}const s=`linear-gradient(${o}, ${r}, ${n})`;return{background:s,[kt]:s}},qo=e=>{const{prefixCls:t,direction:r,percent:n,size:o,strokeWidth:a,strokeColor:s,strokeLinecap:c="round",children:p,trailColor:m=null,percentPosition:y,success:v}=e,{align:x,type:w}=y,C=s&&typeof s!="string"?Lo(s,r):{[kt]:s,background:s},i=c==="square"||c==="butt"?0:void 0,f=o??[-1,a||(o==="small"?6:8)],[g,h]=Ot(f,"line",{strokeWidth:a}),E={backgroundColor:m||void 0,borderRadius:i},D=Object.assign(Object.assign({width:`${nt(n)}%`,height:h,borderRadius:i},C),{[cn]:nt(n)/100}),b=Nt(e),A={width:`${nt(b)}%`,height:h,borderRadius:i,backgroundColor:v==null?void 0:v.strokeColor},k={width:g<0?"100%":g},T=F.createElement("div",{className:`${t}-inner`,style:E},F.createElement("div",{className:Ce(`${t}-bg`,`${t}-bg-${w}`),style:D},w==="inner"&&p),b!==void 0&&F.createElement("div",{className:`${t}-success-bg`,style:A})),N=w==="outer"&&x==="start",$=w==="outer"&&x==="end";return w==="outer"&&x==="center"?F.createElement("div",{className:`${t}-layout-bottom`},T,p):F.createElement("div",{className:`${t}-outer`,style:k},N&&p,T,$&&p)},Uo=e=>{const{size:t,steps:r,rounding:n=Math.round,percent:o=0,strokeWidth:a=8,strokeColor:s,trailColor:c=null,prefixCls:p,children:m}=e,y=n(r*(o/100)),x=t??[t==="small"?2:14,a],[w,C]=Ot(x,"step",{steps:r,strokeWidth:a}),i=w/r,f=Array.from({length:r});for(let g=0;g<r;g++){const h=Array.isArray(s)?s[g]:s;f[g]=F.createElement("div",{key:g,className:Ce(`${p}-steps-item`,{[`${p}-steps-item-active`]:g<=y-1}),style:{backgroundColor:g<=y-1?h:c,width:i,height:C}})}return F.createElement("div",{className:`${p}-steps-outer`},f,m)};var Wo=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const Ho=["normal","exception","active","success"],Vo=F.forwardRef((e,t)=>{const{prefixCls:r,className:n,rootClassName:o,steps:a,strokeColor:s,percent:c=0,size:p="default",showInfo:m=!0,type:y="line",status:v,format:x,style:w,percentPosition:C={}}=e,i=Wo(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:f="end",type:g="outer"}=C,h=Array.isArray(s)?s[0]:s,E=typeof s=="string"||Array.isArray(s)?s:void 0,D=F.useMemo(()=>{if(h){const X=typeof h=="string"?h:Object.values(h)[0];return new Bn(X).isLight()}return!1},[s]),b=F.useMemo(()=>{var X,q;const ee=Nt(e);return Number.parseInt(ee!==void 0?(X=ee??0)===null||X===void 0?void 0:X.toString():(q=c??0)===null||q===void 0?void 0:q.toString(),10)},[c,e.success,e.successPercent]),A=F.useMemo(()=>!Ho.includes(v)&&b>=100?"success":v||"normal",[v,b]),{getPrefixCls:k,direction:T,progress:N}=F.useContext(mt),$=k("progress",r),[_,H,z]=jo($),L=y==="line",M=L&&!a,Q=F.useMemo(()=>{if(!m)return null;const X=Nt(e);let q;const ee=x||(j=>`${j}%`),Y=L&&D&&g==="inner";return g==="inner"||x||A!=="exception"&&A!=="success"?q=ee(nt(c),nt(X)):A==="exception"?q=L?F.createElement(_n,null):F.createElement(Tn,null):A==="success"&&(q=L?F.createElement(Pn,null):F.createElement(Mn,null)),F.createElement("span",{className:Ce(`${$}-text`,{[`${$}-text-bright`]:Y,[`${$}-text-${f}`]:M,[`${$}-text-${g}`]:M}),title:typeof q=="string"?q:void 0},q)},[m,c,b,A,y,$,x]);let U;y==="line"?U=a?F.createElement(Uo,Object.assign({},e,{strokeColor:E,prefixCls:$,steps:typeof a=="object"?a.count:a}),Q):F.createElement(qo,Object.assign({},e,{strokeColor:h,prefixCls:$,direction:T,percentPosition:{align:f,type:g}}),Q):(y==="circle"||y==="dashboard")&&(U=F.createElement(Oo,Object.assign({},e,{strokeColor:h,prefixCls:$,progressStatus:A}),Q));const V=Ce($,`${$}-status-${A}`,{[`${$}-${y==="dashboard"&&"circle"||y}`]:y!=="line",[`${$}-inline-circle`]:y==="circle"&&Ot(p,"circle")[0]<=20,[`${$}-line`]:M,[`${$}-line-align-${f}`]:M,[`${$}-line-position-${g}`]:M,[`${$}-steps`]:a,[`${$}-show-info`]:m,[`${$}-${p}`]:typeof p=="string",[`${$}-rtl`]:T==="rtl"},N==null?void 0:N.className,n,o,H,z);return _(F.createElement("div",Object.assign({ref:t,style:Object.assign(Object.assign({},N==null?void 0:N.style),w),className:V,role:"progressbar","aria-valuenow":b,"aria-valuemin":0,"aria-valuemax":100},nr(i,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),U))});var Xo={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},Jo=function(t,r){return F.createElement(wt,Je({},t,{ref:r,icon:Xo}))},Ko=F.forwardRef(Jo);const qt=(function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return r.some(function(s){var c=s.trim();if(/^\*(\/\*)?$/.test(s))return!0;if(c.charAt(0)==="."){var p=n.toLowerCase(),m=c.toLowerCase(),y=[m];return(m===".jpg"||m===".jpeg")&&(y=[".jpg",".jpeg"]),y.some(function(v){return p.endsWith(v)})}return/\/\*$/.test(c)?a===c.replace(/\/.*$/,""):o===c?!0:/^\w+$/.test(c)?(jn(!1,"Upload takes an invalidate 'accept' type '".concat(c,"'.Skip for check.")),!0):!1})}return!0});function Go(e,t){var r="cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"),n=new Error(r);return n.status=t.status,n.method=e.method,n.url=e.action,n}function Cr(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch{return t}}function wr(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(a){a.total>0&&(a.percent=a.loaded/a.total*100),e.onProgress(a)});var r=new FormData;e.data&&Object.keys(e.data).forEach(function(o){var a=e.data[o];if(Array.isArray(a)){a.forEach(function(s){r.append("".concat(o,"[]"),s)});return}r.append(o,a)}),e.file instanceof Blob?r.append(e.filename,e.file,e.file.name):r.append(e.filename,e.file),t.onerror=function(a){e.onError(a)},t.onload=function(){return t.status<200||t.status>=300?e.onError(Go(e,t),Cr(t)):e.onSuccess(Cr(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var n=e.headers||{};return n["X-Requested-With"]!==null&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(n).forEach(function(o){n[o]!==null&&t.setRequestHeader(o,n[o])}),t.send(r),{abort:function(){t.abort()}}}var Yo=(function(){var e=rt(Oe().mark(function t(r,n){var o,a,s,c,p,m,y,v;return Oe().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:m=function(){return m=rt(Oe().mark(function i(f){return Oe().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.abrupt("return",new Promise(function(E){f.file(function(D){n(D)?(f.fullPath&&!D.webkitRelativePath&&(Object.defineProperties(D,{webkitRelativePath:{writable:!0}}),D.webkitRelativePath=f.fullPath.replace(/^\//,""),Object.defineProperties(D,{webkitRelativePath:{writable:!1}})),E(D)):E(null)})}));case 1:case"end":return h.stop()}},i)})),m.apply(this,arguments)},p=function(i){return m.apply(this,arguments)},c=function(){return c=rt(Oe().mark(function i(f){var g,h,E,D,b;return Oe().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:g=f.createReader(),h=[];case 2:return k.next=5,new Promise(function(T){g.readEntries(T,function(){return T([])})});case 5:if(E=k.sent,D=E.length,D){k.next=9;break}return k.abrupt("break",12);case 9:for(b=0;b<D;b++)h.push(E[b]);k.next=2;break;case 12:return k.abrupt("return",h);case 13:case"end":return k.stop()}},i)})),c.apply(this,arguments)},s=function(i){return c.apply(this,arguments)},o=[],a=[],r.forEach(function(C){return a.push(C.webkitGetAsEntry())}),y=(function(){var C=rt(Oe().mark(function i(f,g){var h,E;return Oe().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(f){b.next=2;break}return b.abrupt("return");case 2:if(f.path=g||"",!f.isFile){b.next=10;break}return b.next=6,p(f);case 6:h=b.sent,h&&o.push(h),b.next=15;break;case 10:if(!f.isDirectory){b.next=15;break}return b.next=13,s(f);case 13:E=b.sent,a.push.apply(a,Ve(E));case 15:case"end":return b.stop()}},i)}));return function(f,g){return C.apply(this,arguments)}})(),v=0;case 9:if(!(v<a.length)){w.next=15;break}return w.next=12,y(a[v]);case 12:v++,w.next=9;break;case 15:return w.abrupt("return",o);case 16:case"end":return w.stop()}},t)}));return function(r,n){return e.apply(this,arguments)}})(),Qo=+new Date,Zo=0;function Ut(){return"rc-upload-".concat(Qo,"-").concat(++Zo)}var ea=["component","prefixCls","className","classNames","disabled","id","name","style","styles","multiple","accept","capture","children","directory","folder","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],ta=(function(e){Xr(r,e);var t=Jr(r);function r(){var n;Kr(this,r);for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return n=t.call.apply(t,[this].concat(a)),Ee($e(n),"state",{uid:Ut()}),Ee($e(n),"reqs",{}),Ee($e(n),"fileInput",void 0),Ee($e(n),"_isMounted",void 0),Ee($e(n),"onChange",function(c){var p=n.props,m=p.accept,y=p.directory,v=c.target.files,x=Ve(v).filter(function(w){return!y||qt(w,m)});n.uploadFiles(x),n.reset()}),Ee($e(n),"onClick",function(c){var p=n.fileInput;if(p){var m=c.target,y=n.props.onClick;if(m&&m.tagName==="BUTTON"){var v=p.parentNode;v.focus(),m.blur()}p.click(),y&&y(c)}}),Ee($e(n),"onKeyDown",function(c){c.key==="Enter"&&n.onClick(c)}),Ee($e(n),"onDataTransferFiles",(function(){var c=rt(Oe().mark(function p(m,y){var v,x,w,C,i,f,g;return Oe().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(v=n.props,x=v.multiple,w=v.accept,C=v.directory,i=Ve(m.items||[]),f=Ve(m.files||[]),(f.length>0||i.some(function(D){return D.kind==="file"}))&&(y==null||y()),!C){E.next=11;break}return E.next=7,Yo(Array.prototype.slice.call(i),function(D){return qt(D,n.props.accept)});case 7:f=E.sent,n.uploadFiles(f),E.next=14;break;case 11:g=Ve(f).filter(function(D){return qt(D,w)}),x===!1&&(g=f.slice(0,1)),n.uploadFiles(g);case 14:case"end":return E.stop()}},p)}));return function(p,m){return c.apply(this,arguments)}})()),Ee($e(n),"onFilePaste",(function(){var c=rt(Oe().mark(function p(m){var y,v;return Oe().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(y=n.props.pastable,y){w.next=3;break}return w.abrupt("return");case 3:if(m.type!=="paste"){w.next=6;break}return v=m.clipboardData,w.abrupt("return",n.onDataTransferFiles(v,function(){m.preventDefault()}));case 6:case"end":return w.stop()}},p)}));return function(p){return c.apply(this,arguments)}})()),Ee($e(n),"onFileDragOver",function(c){c.preventDefault()}),Ee($e(n),"onFileDrop",(function(){var c=rt(Oe().mark(function p(m){var y;return Oe().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(m.preventDefault(),m.type!=="drop"){x.next=4;break}return y=m.dataTransfer,x.abrupt("return",n.onDataTransferFiles(y));case 4:case"end":return x.stop()}},p)}));return function(p){return c.apply(this,arguments)}})()),Ee($e(n),"uploadFiles",function(c){var p=Ve(c),m=p.map(function(y){return y.uid=Ut(),n.processFile(y,p)});Promise.all(m).then(function(y){var v=n.props.onBatchStart;v==null||v(y.map(function(x){var w=x.origin,C=x.parsedFile;return{file:w,parsedFile:C}})),y.filter(function(x){return x.parsedFile!==null}).forEach(function(x){n.post(x)})})}),Ee($e(n),"processFile",(function(){var c=rt(Oe().mark(function p(m,y){var v,x,w,C,i,f,g,h,E;return Oe().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(v=n.props.beforeUpload,x=m,!v){b.next=14;break}return b.prev=3,b.next=6,v(m,y);case 6:x=b.sent,b.next=12;break;case 9:b.prev=9,b.t0=b.catch(3),x=!1;case 12:if(x!==!1){b.next=14;break}return b.abrupt("return",{origin:m,parsedFile:null,action:null,data:null});case 14:if(w=n.props.action,typeof w!="function"){b.next=21;break}return b.next=18,w(m);case 18:C=b.sent,b.next=22;break;case 21:C=w;case 22:if(i=n.props.data,typeof i!="function"){b.next=29;break}return b.next=26,i(m);case 26:f=b.sent,b.next=30;break;case 29:f=i;case 30:return g=(pt(x)==="object"||typeof x=="string")&&x?x:m,g instanceof File?h=g:h=new File([g],m.name,{type:m.type}),E=h,E.uid=m.uid,b.abrupt("return",{origin:m,data:f,parsedFile:E,action:C});case 35:case"end":return b.stop()}},p,null,[[3,9]])}));return function(p,m){return c.apply(this,arguments)}})()),Ee($e(n),"saveFileInput",function(c){n.fileInput=c}),n}return Gr(r,[{key:"componentDidMount",value:function(){this._isMounted=!0;var o=this.props.pastable;o&&document.addEventListener("paste",this.onFilePaste)}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort(),document.removeEventListener("paste",this.onFilePaste)}},{key:"componentDidUpdate",value:function(o){var a=this.props.pastable;a&&!o.pastable?document.addEventListener("paste",this.onFilePaste):!a&&o.pastable&&document.removeEventListener("paste",this.onFilePaste)}},{key:"post",value:function(o){var a=this,s=o.data,c=o.origin,p=o.action,m=o.parsedFile;if(this._isMounted){var y=this.props,v=y.onStart,x=y.customRequest,w=y.name,C=y.headers,i=y.withCredentials,f=y.method,g=c.uid,h=x||wr,E={action:p,filename:w,data:s,file:m,headers:C,withCredentials:i,method:f||"post",onProgress:function(b){var A=a.props.onProgress;A==null||A(b,m)},onSuccess:function(b,A){var k=a.props.onSuccess;k==null||k(b,m,A),delete a.reqs[g]},onError:function(b,A){var k=a.props.onError;k==null||k(b,A,m),delete a.reqs[g]}};v(c),this.reqs[g]=h(E,{defaultRequest:wr})}}},{key:"reset",value:function(){this.setState({uid:Ut()})}},{key:"abort",value:function(o){var a=this.reqs;if(o){var s=o.uid?o.uid:o;a[s]&&a[s].abort&&a[s].abort(),delete a[s]}else Object.keys(a).forEach(function(c){a[c]&&a[c].abort&&a[c].abort(),delete a[c]})}},{key:"render",value:function(){var o=this.props,a=o.component,s=o.prefixCls,c=o.className,p=o.classNames,m=p===void 0?{}:p,y=o.disabled,v=o.id,x=o.name,w=o.style,C=o.styles,i=C===void 0?{}:C,f=o.multiple,g=o.accept,h=o.capture,E=o.children,D=o.directory,b=o.folder,A=o.openFileDialogOnClick,k=o.onMouseEnter,T=o.onMouseLeave,N=o.hasControlInside,$=Ur(o,ea),_=Ce(Ee(Ee(Ee({},s,!0),"".concat(s,"-disabled"),y),c,c)),H=D||b?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},z=y?{}:{onClick:A?this.onClick:function(){},onKeyDown:A?this.onKeyDown:function(){},onMouseEnter:k,onMouseLeave:T,onDrop:this.onFileDrop,onDragOver:this.onFileDragOver,tabIndex:N?void 0:"0"};return Ge.createElement(a,Je({},z,{className:_,role:N?void 0:"button",style:w}),Ge.createElement("input",Je({},Rn($,{aria:!0,data:!0}),{id:v,name:x,disabled:y,type:"file",ref:this.saveFileInput,onClick:function(M){return M.stopPropagation()},key:this.state.uid,style:Gt({display:"none"},i.input),className:m.input,accept:g},H,{multiple:f,onChange:this.onChange},h!=null?{capture:h}:{})),E)}}]),r})(Mr);function Wt(){}var Zt=(function(e){Xr(r,e);var t=Jr(r);function r(){var n;Kr(this,r);for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return n=t.call.apply(t,[this].concat(a)),Ee($e(n),"uploader",void 0),Ee($e(n),"saveUploader",function(c){n.uploader=c}),n}return Gr(r,[{key:"abort",value:function(o){this.uploader.abort(o)}},{key:"render",value:function(){return Ge.createElement(ta,Je({},this.props,{ref:this.saveUploader}))}}]),r})(Mr);Ee(Zt,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Wt,onError:Wt,onSuccess:Wt,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});const ra=e=>{const{componentCls:t,iconCls:r}=e;return{[`${t}-wrapper`]:{[`${t}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:`${Re(e.lineWidth)} dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[t]:{padding:e.padding},[`${t}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none",borderRadius:e.borderRadiusLG,"&:focus-visible":{outline:`${Re(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`}},[`${t}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`
|
|
47
|
+
&:not(${t}-disabled):hover,
|
|
48
|
+
&-hover:not(${t}-disabled)
|
|
49
|
+
`]:{borderColor:e.colorPrimaryHover},[`p${t}-drag-icon`]:{marginBottom:e.margin,[r]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},[`p${t}-text`]:{margin:`0 0 ${Re(e.marginXXS)}`,color:e.colorTextHeading,fontSize:e.fontSizeLG},[`p${t}-hint`]:{color:e.colorTextDescription,fontSize:e.fontSize},[`&${t}-disabled`]:{[`p${t}-drag-icon ${r},
|
|
50
|
+
p${t}-text,
|
|
51
|
+
p${t}-hint
|
|
52
|
+
`]:{color:e.colorTextDisabled}}}}}},na=e=>{const{componentCls:t,iconCls:r,fontSize:n,lineHeight:o,calc:a}=e,s=`${t}-list-item`,c=`${s}-actions`,p=`${s}-action`;return{[`${t}-wrapper`]:{[`${t}-list`]:Object.assign(Object.assign({},Yr()),{lineHeight:e.lineHeight,[s]:{position:"relative",height:a(e.lineHeight).mul(n).equal(),marginTop:e.marginXS,fontSize:n,display:"flex",alignItems:"center",transition:`background-color ${e.motionDurationSlow}`,borderRadius:e.borderRadiusSM,"&:hover":{backgroundColor:e.controlItemBgHover},[`${s}-name`]:Object.assign(Object.assign({},Qr),{padding:`0 ${Re(e.paddingXS)}`,lineHeight:o,flex:"auto",transition:`all ${e.motionDurationSlow}`}),[c]:{whiteSpace:"nowrap",[p]:{opacity:0},[r]:{color:e.actionsColor,transition:`all ${e.motionDurationSlow}`},[`
|
|
53
|
+
${p}:focus-visible,
|
|
54
|
+
&.picture ${p}
|
|
55
|
+
`]:{opacity:1}},[`${t}-icon ${r}`]:{color:e.colorIcon,fontSize:n},[`${s}-progress`]:{position:"absolute",bottom:e.calc(e.uploadProgressOffset).mul(-1).equal(),width:"100%",paddingInlineStart:a(n).add(e.paddingXS).equal(),fontSize:n,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${s}:hover ${p}`]:{opacity:1},[`${s}-error`]:{color:e.colorError,[`${s}-name, ${t}-icon ${r}`]:{color:e.colorError},[c]:{[`${r}, ${r}:hover`]:{color:e.colorError},[p]:{opacity:1}}},[`${t}-list-item-container`]:{transition:`opacity ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},oa=e=>{const{componentCls:t}=e,r=new Qt("uploadAnimateInlineIn",{from:{width:0,height:0,padding:0,opacity:0,margin:e.calc(e.marginXS).div(-2).equal()}}),n=new Qt("uploadAnimateInlineOut",{to:{width:0,height:0,padding:0,opacity:0,margin:e.calc(e.marginXS).div(-2).equal()}}),o=`${t}-animate-inline`;return[{[`${t}-wrapper`]:{[`${o}-appear, ${o}-enter, ${o}-leave`]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},[`${o}-appear, ${o}-enter`]:{animationName:r},[`${o}-leave`]:{animationName:n}}},{[`${t}-wrapper`]:oo(e)},r,n]},aa=e=>{const{componentCls:t,iconCls:r,uploadThumbnailSize:n,uploadProgressOffset:o,calc:a}=e,s=`${t}-list`,c=`${s}-item`;return{[`${t}-wrapper`]:{[`
|
|
56
|
+
${s}${s}-picture,
|
|
57
|
+
${s}${s}-picture-card,
|
|
58
|
+
${s}${s}-picture-circle
|
|
59
|
+
`]:{[c]:{position:"relative",height:a(n).add(a(e.lineWidth).mul(2)).add(a(e.paddingXS).mul(2)).equal(),padding:e.paddingXS,border:`${Re(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusLG,"&:hover":{background:"transparent"},[`${c}-thumbnail`]:Object.assign(Object.assign({},Qr),{width:n,height:n,lineHeight:Re(a(n).add(e.paddingSM).equal()),textAlign:"center",flex:"none",[r]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${c}-progress`]:{bottom:o,width:`calc(100% - ${Re(a(e.paddingSM).mul(2).equal())})`,marginTop:0,paddingInlineStart:a(n).add(e.paddingXS).equal()}},[`${c}-error`]:{borderColor:e.colorError,[`${c}-thumbnail ${r}`]:{[`svg path[fill='${cr[0]}']`]:{fill:e.colorErrorBg},[`svg path[fill='${cr.primary}']`]:{fill:e.colorError}}},[`${c}-uploading`]:{borderStyle:"dashed",[`${c}-name`]:{marginBottom:o}}},[`${s}${s}-picture-circle ${c}`]:{[`&, &::before, ${c}-thumbnail`]:{borderRadius:"50%"}}}}},sa=e=>{const{componentCls:t,iconCls:r,fontSizeLG:n,colorTextLightSolid:o,calc:a}=e,s=`${t}-list`,c=`${s}-item`,p=e.uploadPicCardSize;return{[`
|
|
60
|
+
${t}-wrapper${t}-picture-card-wrapper,
|
|
61
|
+
${t}-wrapper${t}-picture-circle-wrapper
|
|
62
|
+
`]:Object.assign(Object.assign({},Yr()),{display:"block",[`${t}${t}-select`]:{width:p,height:p,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:`${Re(e.lineWidth)} dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[`> ${t}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimary}},[`${s}${s}-picture-card, ${s}${s}-picture-circle`]:{display:"flex",flexWrap:"wrap","@supports not (gap: 1px)":{"& > *":{marginBlockEnd:e.marginXS,marginInlineEnd:e.marginXS}},"@supports (gap: 1px)":{gap:e.marginXS},[`${s}-item-container`]:{display:"inline-block",width:p,height:p,verticalAlign:"top"},"&::after":{display:"none"},"&::before":{display:"none"},[c]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${Re(a(e.paddingXS).mul(2).equal())})`,height:`calc(100% - ${Re(a(e.paddingXS).mul(2).equal())})`,backgroundColor:e.colorBgMask,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'" "'}},[`${c}:hover`]:{[`&::before, ${c}-actions`]:{opacity:1}},[`${c}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${e.motionDurationSlow}`,[`
|
|
63
|
+
${r}-eye,
|
|
64
|
+
${r}-download,
|
|
65
|
+
${r}-delete
|
|
66
|
+
`]:{zIndex:10,width:n,margin:`0 ${Re(e.marginXXS)}`,fontSize:n,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:o,"&:hover":{color:o},svg:{verticalAlign:"baseline"}}},[`${c}-thumbnail, ${c}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${c}-name`]:{display:"none",textAlign:"center"},[`${c}-file + ${c}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${Re(a(e.paddingXS).mul(2).equal())})`},[`${c}-uploading`]:{[`&${c}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${r}-eye, ${r}-download, ${r}-delete`]:{display:"none"}},[`${c}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${Re(a(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:"50%"}}}},ia=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},la=e=>{const{componentCls:t,colorTextDisabled:r}=e;return{[`${t}-wrapper`]:Object.assign(Object.assign({},Vr(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${t}-select`]:{display:"inline-block"},[`${t}-hidden`]:{display:"none"},[`${t}-disabled`]:{color:r,cursor:"not-allowed"}})}},ca=e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55}),ua=rr("Upload",e=>{const{fontSizeHeading3:t,fontHeight:r,lineWidth:n,pictureCardSize:o,calc:a}=e,s=Hr(e,{uploadThumbnailSize:a(t).mul(2).equal(),uploadProgressOffset:a(a(r).div(2)).add(n).equal(),uploadPicCardSize:o});return[la(s),ra(s),aa(s),sa(s),na(s),oa(s),ia(s),zn(s)]},ca);var da={icon:function(t,r){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:r}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:t}}]}},name:"file",theme:"twotone"},pa=function(t,r){return F.createElement(wt,Je({},t,{ref:r,icon:da}))},fa=F.forwardRef(pa),ma={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},ga=function(t,r){return F.createElement(wt,Je({},t,{ref:r,icon:ma}))},ha=F.forwardRef(ga),ya={icon:function(t,r){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:t}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:r}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:r}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:r}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:t}}]}},name:"picture",theme:"twotone"},va=function(t,r){return F.createElement(wt,Je({},t,{ref:r,icon:ya}))},ba=F.forwardRef(va);function $t(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function At(e,t){const r=Ve(t),n=r.findIndex(({uid:o})=>o===e.uid);return n===-1?r.push(e):r[n]=e,r}function Ht(e,t){const r=e.uid!==void 0?"uid":"name";return t.filter(n=>n[r]===e[r])[0]}function xa(e,t){const r=e.uid!==void 0?"uid":"name",n=t.filter(o=>o[r]!==e[r]);return n.length===t.length?null:n}const Fa=(e="")=>{const t=e.split("/"),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[""])[0]},un=e=>e.indexOf("image/")===0,Ca=e=>{if(e.type&&!e.thumbUrl)return un(e.type);const t=e.thumbUrl||e.url||"",r=Fa(t);return/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(r)?!0:!(/^data:/.test(t)||r)},tt=200;function wa(e){return new Promise(t=>{if(!e.type||!un(e.type)){t("");return}const r=document.createElement("canvas");r.width=tt,r.height=tt,r.style.cssText=`position: fixed; left: 0; top: 0; width: ${tt}px; height: ${tt}px; z-index: 9999; display: none;`,document.body.appendChild(r);const n=r.getContext("2d"),o=new Image;if(o.onload=()=>{const{width:a,height:s}=o;let c=tt,p=tt,m=0,y=0;a>s?(p=s*(tt/a),y=-(p-c)/2):(c=a*(tt/s),m=-(c-p)/2),n.drawImage(o,m,y,c,p);const v=r.toDataURL();document.body.removeChild(r),window.URL.revokeObjectURL(o.src),t(v)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const a=new FileReader;a.onload=()=>{a.result&&typeof a.result=="string"&&(o.src=a.result)},a.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const a=new FileReader;a.onload=()=>{a.result&&t(a.result)},a.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var Ea={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},Sa=function(t,r){return F.createElement(wt,Je({},t,{ref:r,icon:Ea}))},Da=F.forwardRef(Sa);const Ia=F.forwardRef(({prefixCls:e,className:t,style:r,locale:n,listType:o,file:a,items:s,progress:c,iconRender:p,actionIconRender:m,itemRender:y,isImgUrl:v,showPreviewIcon:x,showRemoveIcon:w,showDownloadIcon:C,previewIcon:i,removeIcon:f,downloadIcon:g,extra:h,onPreview:E,onDownload:D,onClose:b},A)=>{var k,T;const{status:N}=a,[$,_]=F.useState(N);F.useEffect(()=>{N!=="removed"&&_(N)},[N]);const[H,z]=F.useState(!1);F.useEffect(()=>{const he=setTimeout(()=>{z(!0)},300);return()=>{clearTimeout(he)}},[]);const L=p(a);let M=F.createElement("div",{className:`${e}-icon`},L);if(o==="picture"||o==="picture-card"||o==="picture-circle")if($==="uploading"||!a.thumbUrl&&!a.url){const he=Ce(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:$!=="uploading"});M=F.createElement("div",{className:he},L)}else{const he=v!=null&&v(a)?F.createElement("img",{src:a.thumbUrl||a.url,alt:a.name,className:`${e}-list-item-image`,crossOrigin:a.crossOrigin}):L,Qe=Ce(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:v&&!v(a)});M=F.createElement("a",{className:Qe,onClick:Pe=>E(a,Pe),href:a.url||a.thumbUrl,target:"_blank",rel:"noopener noreferrer"},he)}const Q=Ce(`${e}-list-item`,`${e}-list-item-${$}`),U=typeof a.linkProps=="string"?JSON.parse(a.linkProps):a.linkProps,V=(typeof w=="function"?w(a):w)?m((typeof f=="function"?f(a):f)||F.createElement(Ko,null),()=>b(a),e,n.removeFile,!0):null,X=(typeof C=="function"?C(a):C)&&$==="done"?m((typeof g=="function"?g(a):g)||F.createElement(Da,null),()=>D(a),e,n.downloadFile):null,q=o!=="picture-card"&&o!=="picture-circle"&&F.createElement("span",{key:"download-delete",className:Ce(`${e}-list-item-actions`,{picture:o==="picture"})},X,V),ee=typeof h=="function"?h(a):h,Y=ee&&F.createElement("span",{className:`${e}-list-item-extra`},ee),j=Ce(`${e}-list-item-name`),K=a.url?F.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:j,title:a.name},U,{href:a.url,onClick:he=>E(a,he)}),a.name,Y):F.createElement("span",{key:"view",className:j,onClick:he=>E(a,he),title:a.name},a.name,Y),le=(typeof x=="function"?x(a):x)&&(a.url||a.thumbUrl)?F.createElement("a",{href:a.url||a.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:he=>E(a,he),title:n.previewFile},typeof i=="function"?i(a):i||F.createElement(Ln,null)):null,we=(o==="picture-card"||o==="picture-circle")&&$!=="uploading"&&F.createElement("span",{className:`${e}-list-item-actions`},le,$==="done"&&X,V),{getPrefixCls:Ie}=F.useContext(mt),Ne=Ie(),xe=F.createElement("div",{className:Q},M,K,q,we,H&&F.createElement(Zr,{motionName:`${Ne}-fade`,visible:$==="uploading",motionDeadline:2e3},({className:he})=>{const Qe="percent"in a?F.createElement(Vo,Object.assign({type:"line",percent:a.percent,"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"]},c)):null;return F.createElement("div",{className:Ce(`${e}-list-item-progress`,he)},Qe)})),Be=a.response&&typeof a.response=="string"?a.response:((k=a.error)===null||k===void 0?void 0:k.statusText)||((T=a.error)===null||T===void 0?void 0:T.message)||n.uploadError,_e=$==="error"?F.createElement(Wr,{title:Be,getPopupContainer:he=>he.parentNode},xe):xe;return F.createElement("div",{className:Ce(`${e}-list-item-container`,t),style:r,ref:A},y?y(_e,a,s,{download:D.bind(null,a),preview:E.bind(null,a),remove:b.bind(null,a)}):_e)}),$a=(e,t)=>{const{listType:r="text",previewFile:n=wa,onPreview:o,onDownload:a,onRemove:s,locale:c,iconRender:p,isImageUrl:m=Ca,prefixCls:y,items:v=[],showPreviewIcon:x=!0,showRemoveIcon:w=!0,showDownloadIcon:C=!1,removeIcon:i,previewIcon:f,downloadIcon:g,extra:h,progress:E={size:[-1,2],showInfo:!1},appendAction:D,appendActionVisible:b=!0,itemRender:A,disabled:k}=e,[,T]=qn(),[N,$]=F.useState(!1),_=["picture-card","picture-circle"].includes(r);F.useEffect(()=>{r.startsWith("picture")&&(v||[]).forEach(j=>{!(j.originFileObj instanceof File||j.originFileObj instanceof Blob)||j.thumbUrl!==void 0||(j.thumbUrl="",n==null||n(j.originFileObj).then(K=>{j.thumbUrl=K||"",T()}))})},[r,v,n]),F.useEffect(()=>{$(!0)},[]);const H=(j,K)=>{if(o)return K==null||K.preventDefault(),o(j)},z=j=>{typeof a=="function"?a(j):j.url&&window.open(j.url)},L=j=>{s==null||s(j)},M=j=>{if(p)return p(j,r);const K=j.status==="uploading";if(r.startsWith("picture")){const le=r==="picture"?F.createElement(dr,null):c.uploading,we=m!=null&&m(j)?F.createElement(ba,null):F.createElement(fa,null);return K?le:we}return K?F.createElement(dr,null):F.createElement(ha,null)},Q=(j,K,le,we,Ie)=>{const Ne={type:"text",size:"small",title:we,onClick:xe=>{var Be,_e;K(),F.isValidElement(j)&&((_e=(Be=j.props).onClick)===null||_e===void 0||_e.call(Be,xe))},className:`${le}-list-item-action`,disabled:Ie?k:!1};return F.isValidElement(j)?F.createElement(Xe,Object.assign({},Ne,{icon:ur(j,Object.assign(Object.assign({},j.props),{onClick:()=>{}}))})):F.createElement(Xe,Object.assign({},Ne),F.createElement("span",null,j))};F.useImperativeHandle(t,()=>({handlePreview:H,handleDownload:z}));const{getPrefixCls:U}=F.useContext(mt),V=U("upload",y),X=U(),q=Ce(`${V}-list`,`${V}-list-${r}`),ee=F.useMemo(()=>nr(Un(X),["onAppearEnd","onEnterEnd","onLeaveEnd"]),[X]),Y=Object.assign(Object.assign({},_?{}:ee),{motionDeadline:2e3,motionName:`${V}-${_?"animate-inline":"animate"}`,keys:Ve(v.map(j=>({key:j.uid,file:j}))),motionAppear:N});return F.createElement("div",{className:q},F.createElement(Wn,Object.assign({},Y,{component:!1}),({key:j,file:K,className:le,style:we})=>F.createElement(Ia,{key:j,locale:c,prefixCls:V,className:le,style:we,file:K,items:v,progress:E,listType:r,isImgUrl:m,showPreviewIcon:x,showRemoveIcon:w,showDownloadIcon:C,removeIcon:i,previewIcon:f,downloadIcon:g,extra:h,iconRender:M,actionIconRender:Q,itemRender:A,onPreview:H,onDownload:z,onClose:L})),D&&F.createElement(Zr,Object.assign({},Y,{visible:b,forceRender:!0}),({className:j,style:K})=>ur(D,le=>({className:Ce(le.className,j),style:Object.assign(Object.assign(Object.assign({},K),{pointerEvents:j?"none":void 0}),le.style)}))))},Aa=F.forwardRef($a);var Na=function(e,t,r,n){function o(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function c(y){try{m(n.next(y))}catch(v){s(v)}}function p(y){try{m(n.throw(y))}catch(v){s(v)}}function m(y){y.done?a(y.value):o(y.value).then(c,p)}m((n=n.apply(e,[])).next())})};const Ct=`__LIST_IGNORE_${Date.now()}__`,ka=(e,t)=>{const r=Lr("upload"),{fileList:n,defaultFileList:o,onRemove:a,showUploadList:s=!0,listType:c="text",onPreview:p,onDownload:m,onChange:y,onDrop:v,previewFile:x,disabled:w,locale:C,iconRender:i,isImageUrl:f,progress:g,prefixCls:h,className:E,type:D="select",children:b,style:A,itemRender:k,maxCount:T,data:N={},multiple:$=!1,hasControlInside:_=!0,action:H="",accept:z="",supportServerRender:L=!0,rootClassName:M}=e,Q=F.useContext(Hn),U=w??Q,V=e.customRequest||r.customRequest,[X,q]=qr(o||[],{value:n,postState:J=>J??[]}),[ee,Y]=F.useState("drop"),j=F.useRef(null),K=F.useRef(null);F.useMemo(()=>{const J=Date.now();(n||[]).forEach((ne,de)=>{!ne.uid&&!Object.isFrozen(ne)&&(ne.uid=`__AUTO__${J}_${de}__`)})},[n]);const le=(J,ne,de)=>{let te=Ve(ne),ae=!1;T===1?te=te.slice(-1):T&&(ae=te.length>T,te=te.slice(0,T)),hr(()=>{q(te)});const De={file:J,fileList:te};de&&(De.event=de),(!ae||J.status==="removed"||te.some(Ke=>Ke.uid===J.uid))&&hr(()=>{y==null||y(De)})},we=(J,ne)=>Na(void 0,void 0,void 0,function*(){const{beforeUpload:de,transformFile:te}=e;let ae=J;if(de){const De=yield de(J,ne);if(De===!1)return!1;if(delete J[Ct],De===Ct)return Object.defineProperty(J,Ct,{value:!0,configurable:!0}),!1;typeof De=="object"&&De&&(ae=De)}return te&&(ae=yield te(ae)),ae}),Ie=J=>{const ne=J.filter(ae=>!ae.file[Ct]);if(!ne.length)return;const de=ne.map(ae=>$t(ae.file));let te=Ve(X);de.forEach(ae=>{te=At(ae,te)}),de.forEach((ae,De)=>{let Ke=ae;if(ne[De].parsedFile)ae.status="uploading";else{const{originFileObj:Ue}=ae;let We;try{We=new File([Ue],Ue.name,{type:Ue.type})}catch{We=new Blob([Ue],{type:Ue.type}),We.name=Ue.name,We.lastModifiedDate=new Date,We.lastModified=new Date().getTime()}We.uid=ae.uid,Ke=We}le(Ke,te)})},Ne=(J,ne,de)=>{try{typeof J=="string"&&(J=JSON.parse(J))}catch{}if(!Ht(ne,X))return;const te=$t(ne);te.status="done",te.percent=100,te.response=J,te.xhr=de;const ae=At(te,X);le(te,ae)},xe=(J,ne)=>{if(!Ht(ne,X))return;const de=$t(ne);de.status="uploading",de.percent=J.percent;const te=At(de,X);le(de,te,J)},Be=(J,ne,de)=>{if(!Ht(de,X))return;const te=$t(de);te.error=J,te.response=ne,te.status="error";const ae=At(te,X);le(te,ae)},_e=J=>{let ne;Promise.resolve(typeof a=="function"?a(J):a).then(de=>{var te;if(de===!1)return;const ae=xa(J,X);ae&&(ne=Object.assign(Object.assign({},J),{status:"removed"}),X==null||X.forEach(De=>{const Ke=ne.uid!==void 0?"uid":"name";De[Ke]===ne[Ke]&&!Object.isFrozen(De)&&(De.status="removed")}),(te=j.current)===null||te===void 0||te.abort(ne),le(ne,ae))})},he=J=>{Y(J.type),J.type==="drop"&&(v==null||v(J))};F.useImperativeHandle(t,()=>({onBatchStart:Ie,onSuccess:Ne,onProgress:xe,onError:Be,fileList:X,upload:j.current,nativeElement:K.current}));const{getPrefixCls:Qe,direction:Pe,upload:Ze}=F.useContext(mt),ye=Qe("upload",h),qe=Object.assign(Object.assign({onBatchStart:Ie,onError:Be,onProgress:xe,onSuccess:Ne},e),{customRequest:V,data:N,multiple:$,action:H,accept:z,supportServerRender:L,prefixCls:ye,disabled:U,beforeUpload:we,onChange:void 0,hasControlInside:_});delete qe.className,delete qe.style,(!b||U)&&delete qe.id;const ot=`${ye}-wrapper`,[lt,gt,Bt]=ua(ye,ot),[ht]=Rr("Upload",zr.Upload),{showRemoveIcon:Et,showPreviewIcon:_t,showDownloadIcon:Me,removeIcon:yt,previewIcon:Tt,downloadIcon:Pt,extra:vt}=typeof s=="boolean"?{}:s,Te=typeof Et>"u"?!U:Et,Z=(J,ne)=>s?F.createElement(Aa,{prefixCls:ye,listType:c,items:X,previewFile:x,onPreview:p,onDownload:m,onRemove:_e,showRemoveIcon:Te,showPreviewIcon:_t,showDownloadIcon:Me,removeIcon:yt,previewIcon:Tt,downloadIcon:Pt,iconRender:i,extra:vt,locale:Object.assign(Object.assign({},ht),C),isImageUrl:f,progress:g,appendAction:J,appendActionVisible:ne,itemRender:k,disabled:U}):J,ct=Ce(ot,E,M,gt,Bt,Ze==null?void 0:Ze.className,{[`${ye}-rtl`]:Pe==="rtl",[`${ye}-picture-card-wrapper`]:c==="picture-card",[`${ye}-picture-circle-wrapper`]:c==="picture-circle"}),bt=Object.assign(Object.assign({},Ze==null?void 0:Ze.style),A);if(D==="drag"){const J=Ce(gt,ye,`${ye}-drag`,{[`${ye}-drag-uploading`]:X.some(ne=>ne.status==="uploading"),[`${ye}-drag-hover`]:ee==="dragover",[`${ye}-disabled`]:U,[`${ye}-rtl`]:Pe==="rtl"});return lt(F.createElement("span",{className:ct,ref:K},F.createElement("div",{className:J,style:bt,onDrop:he,onDragOver:he,onDragLeave:he},F.createElement(Zt,Object.assign({},qe,{ref:j,className:`${ye}-btn`}),F.createElement("div",{className:`${ye}-drag-container`},b))),Z()))}const Mt=Ce(ye,`${ye}-select`,{[`${ye}-disabled`]:U,[`${ye}-hidden`]:!b}),ut=F.createElement("div",{className:Mt,style:bt},F.createElement(Zt,Object.assign({},qe,{ref:j})));return lt(c==="picture-card"||c==="picture-circle"?F.createElement("span",{className:ct,ref:K},Z(ut,!!b)):F.createElement("span",{className:ct,ref:K},ut,Z()))},dn=F.forwardRef(ka);var Oa=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const Ba=F.forwardRef((e,t)=>{const{style:r,height:n,hasControlInside:o=!1,children:a}=e,s=Oa(e,["style","height","hasControlInside","children"]),c=Object.assign(Object.assign({},r),{height:n});return F.createElement(dn,Object.assign({ref:t,hasControlInside:o},s,{style:c,type:"drag"}),a)}),ir=dn;ir.Dragger=Ba;ir.LIST_IGNORE=Ct;const Er={actions:[{icon:d(ze,{type:"rag/folder",size:18}),name:"history",badgeCount:0}],switchs:[{label:"\u8054\u7F51\u641C\u7D22",name:"netSearch",type:"checkbox",defaultValue:!1,enabled:!0,icon:d(ze,{type:"rag/url",size:12})},{label:"\u63A8\u7406\u601D\u8003",name:"reasoning",type:"checkbox",defaultValue:!1,enabled:!0,icon:d(ze,{type:"rag/think",size:12})}]};function _a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Vn(e,t)}var Sr=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Ta(e,t){return!!(e===t||Sr(e)&&Sr(t))}function Pa(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!Ta(e[r],t[r]))return!1;return!0}function Vt(e,t){t===void 0&&(t=Pa);var r,n=[],o,a=!1;function s(){for(var c=[],p=0;p<arguments.length;p++)c[p]=arguments[p];return a&&r===this&&t(c,n)||(o=e.apply(this,c),a=!0,r=this,n=c),o}return s}var Ma=typeof performance=="object"&&typeof performance.now=="function",Dr=Ma?function(){return performance.now()}:function(){return Date.now()};function Ir(e){cancelAnimationFrame(e.id)}function ja(e,t){var r=Dr();function n(){Dr()-r>=t?e.call(null):o.id=requestAnimationFrame(n)}var o={id:requestAnimationFrame(n)};return o}var Xt=-1;function $r(e){if(e===void 0&&(e=!1),Xt===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Xt=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Xt}var dt=null;function Ar(e){if(e===void 0&&(e=!1),dt===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?dt="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?dt="negative":dt="positive-ascending"),document.body.removeChild(t),dt}return dt}var Ra=150,za=function(t,r){return t};function La(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,c=e.getStopIndexForStartIndex,p=e.initInstanceProps,m=e.shouldResetStyleCacheOnItemSizeChange,y=e.validateProps;return t=(function(v){_a(x,v);function x(C){var i;return i=v.call(this,C)||this,i._instanceProps=p(i.props,$e(i)),i._outerRef=void 0,i._resetIsScrollingTimeoutId=null,i.state={instance:$e(i),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof i.props.initialScrollOffset=="number"?i.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},i._callOnItemsRendered=void 0,i._callOnItemsRendered=Vt(function(f,g,h,E){return i.props.onItemsRendered({overscanStartIndex:f,overscanStopIndex:g,visibleStartIndex:h,visibleStopIndex:E})}),i._callOnScroll=void 0,i._callOnScroll=Vt(function(f,g,h){return i.props.onScroll({scrollDirection:f,scrollOffset:g,scrollUpdateWasRequested:h})}),i._getItemStyle=void 0,i._getItemStyle=function(f){var g=i.props,h=g.direction,E=g.itemSize,D=g.layout,b=i._getItemStyleCache(m&&E,m&&D,m&&h),A;if(b.hasOwnProperty(f))A=b[f];else{var k=r(i.props,f,i._instanceProps),T=o(i.props,f,i._instanceProps),N=h==="horizontal"||D==="horizontal",$=h==="rtl",_=N?k:0;b[f]=A={position:"absolute",left:$?void 0:_,right:$?_:void 0,top:N?0:k,height:N?"100%":T,width:N?T:"100%"}}return A},i._getItemStyleCache=void 0,i._getItemStyleCache=Vt(function(f,g,h){return{}}),i._onScrollHorizontal=function(f){var g=f.currentTarget,h=g.clientWidth,E=g.scrollLeft,D=g.scrollWidth;i.setState(function(b){if(b.scrollOffset===E)return null;var A=i.props.direction,k=E;if(A==="rtl")switch(Ar()){case"negative":k=-E;break;case"positive-descending":k=D-h-E;break}return k=Math.max(0,Math.min(k,D-h)),{isScrolling:!0,scrollDirection:b.scrollOffset<k?"forward":"backward",scrollOffset:k,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._onScrollVertical=function(f){var g=f.currentTarget,h=g.clientHeight,E=g.scrollHeight,D=g.scrollTop;i.setState(function(b){if(b.scrollOffset===D)return null;var A=Math.max(0,Math.min(D,E-h));return{isScrolling:!0,scrollDirection:b.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._outerRefSetter=function(f){var g=i.props.outerRef;i._outerRef=f,typeof g=="function"?g(f):g!=null&&typeof g=="object"&&g.hasOwnProperty("current")&&(g.current=f)},i._resetIsScrollingDebounced=function(){i._resetIsScrollingTimeoutId!==null&&Ir(i._resetIsScrollingTimeoutId),i._resetIsScrollingTimeoutId=ja(i._resetIsScrolling,Ra)},i._resetIsScrolling=function(){i._resetIsScrollingTimeoutId=null,i.setState({isScrolling:!1},function(){i._getItemStyleCache(-1,null)})},i}x.getDerivedStateFromProps=function(i,f){return qa(i,f),y(i),null};var w=x.prototype;return w.scrollTo=function(i){i=Math.max(0,i),this.setState(function(f){return f.scrollOffset===i?null:{scrollDirection:f.scrollOffset<i?"forward":"backward",scrollOffset:i,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},w.scrollToItem=function(i,f){f===void 0&&(f="auto");var g=this.props,h=g.itemCount,E=g.layout,D=this.state.scrollOffset;i=Math.max(0,Math.min(i,h-1));var b=0;if(this._outerRef){var A=this._outerRef;E==="vertical"?b=A.scrollWidth>A.clientWidth?$r():0:b=A.scrollHeight>A.clientHeight?$r():0}this.scrollTo(a(this.props,i,f,D,this._instanceProps,b))},w.componentDidMount=function(){var i=this.props,f=i.direction,g=i.initialScrollOffset,h=i.layout;if(typeof g=="number"&&this._outerRef!=null){var E=this._outerRef;f==="horizontal"||h==="horizontal"?E.scrollLeft=g:E.scrollTop=g}this._callPropsCallbacks()},w.componentDidUpdate=function(){var i=this.props,f=i.direction,g=i.layout,h=this.state,E=h.scrollOffset,D=h.scrollUpdateWasRequested;if(D&&this._outerRef!=null){var b=this._outerRef;if(f==="horizontal"||g==="horizontal")if(f==="rtl")switch(Ar()){case"negative":b.scrollLeft=-E;break;case"positive-ascending":b.scrollLeft=E;break;default:var A=b.clientWidth,k=b.scrollWidth;b.scrollLeft=k-A-E;break}else b.scrollLeft=E;else b.scrollTop=E}this._callPropsCallbacks()},w.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Ir(this._resetIsScrollingTimeoutId)},w.render=function(){var i=this.props,f=i.children,g=i.className,h=i.direction,E=i.height,D=i.innerRef,b=i.innerElementType,A=i.innerTagName,k=i.itemCount,T=i.itemData,N=i.itemKey,$=N===void 0?za:N,_=i.layout,H=i.outerElementType,z=i.outerTagName,L=i.style,M=i.useIsScrolling,Q=i.width,U=this.state.isScrolling,V=h==="horizontal"||_==="horizontal",X=V?this._onScrollHorizontal:this._onScrollVertical,q=this._getRangeToRender(),ee=q[0],Y=q[1],j=[];if(k>0)for(var K=ee;K<=Y;K++)j.push(Rt(f,{data:T,key:$(K,T),index:K,isScrolling:M?U:void 0,style:this._getItemStyle(K)}));var le=n(this.props,this._instanceProps);return Rt(H||z||"div",{className:g,onScroll:X,ref:this._outerRefSetter,style:Je({position:"relative",height:E,width:Q,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:h},L)},Rt(b||A||"div",{children:j,ref:D,style:{height:V?"100%":le,pointerEvents:U?"none":void 0,width:V?le:"100%"}}))},w._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var i=this.props.itemCount;if(i>0){var f=this._getRangeToRender(),g=f[0],h=f[1],E=f[2],D=f[3];this._callOnItemsRendered(g,h,E,D)}}if(typeof this.props.onScroll=="function"){var b=this.state,A=b.scrollDirection,k=b.scrollOffset,T=b.scrollUpdateWasRequested;this._callOnScroll(A,k,T)}},w._getRangeToRender=function(){var i=this.props,f=i.itemCount,g=i.overscanCount,h=this.state,E=h.isScrolling,D=h.scrollDirection,b=h.scrollOffset;if(f===0)return[0,0,0,0];var A=s(this.props,b,this._instanceProps),k=c(this.props,A,b,this._instanceProps),T=!E||D==="backward"?Math.max(1,g):1,N=!E||D==="forward"?Math.max(1,g):1;return[Math.max(0,A-T),Math.max(0,Math.min(f-1,k+N)),A,k]},x})(An),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var qa=function(t,r){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,r.instance},Ua=50,ft=function(t,r,n){var o=t,a=o.itemSize,s=n.itemMetadataMap,c=n.lastMeasuredIndex;if(r>c){var p=0;if(c>=0){var m=s[c];p=m.offset+m.size}for(var y=c+1;y<=r;y++){var v=a(y);s[y]={offset:p,size:v},p+=v}n.lastMeasuredIndex=r}return s[r]},Wa=function(t,r,n){var o=r.itemMetadataMap,a=r.lastMeasuredIndex,s=a>0?o[a].offset:0;return s>=n?pn(t,r,a,0,n):Ha(t,r,Math.max(0,a),n)},pn=function(t,r,n,o,a){for(;o<=n;){var s=o+Math.floor((n-o)/2),c=ft(t,s,r).offset;if(c===a)return s;c<a?o=s+1:c>a&&(n=s-1)}return o>0?o-1:0},Ha=function(t,r,n,o){for(var a=t.itemCount,s=1;n<a&&ft(t,n,r).offset<o;)n+=s,s*=2;return pn(t,r,Math.min(n,a-1),Math.floor(n/2),o)},Nr=function(t,r){var n=t.itemCount,o=r.itemMetadataMap,a=r.estimatedItemSize,s=r.lastMeasuredIndex,c=0;if(s>=n&&(s=n-1),s>=0){var p=o[s];c=p.offset+p.size}var m=n-s-1,y=m*a;return c+y},Va=La({getItemOffset:function(t,r,n){return ft(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:Nr,getOffsetForIndexAndAlignment:function(t,r,n,o,a,s){var c=t.direction,p=t.height,m=t.layout,y=t.width,v=c==="horizontal"||m==="horizontal",x=v?y:p,w=ft(t,r,a),C=Nr(t,a),i=Math.max(0,Math.min(C-x,w.offset)),f=Math.max(0,w.offset-x+w.size+s);switch(n==="smart"&&(o>=f-x&&o<=i+x?n="auto":n="center"),n){case"start":return i;case"end":return f;case"center":return Math.round(f+(i-f)/2);case"auto":default:return o>=f&&o<=i?o:o<f?f:i}},getStartIndexForOffset:function(t,r,n){return Wa(t,n,r)},getStopIndexForStartIndex:function(t,r,n,o){for(var a=t.direction,s=t.height,c=t.itemCount,p=t.layout,m=t.width,y=a==="horizontal"||p==="horizontal",v=y?m:s,x=ft(t,r,o),w=n+v,C=x.offset+x.size,i=r;i<c-1&&C<w;)i++,C+=ft(t,i,o).size;return i},initInstanceProps:function(t,r){var n=t,o=n.estimatedItemSize,a={itemMetadataMap:{},estimatedItemSize:o||Ua,lastMeasuredIndex:-1};return r.resetAfterIndex=function(s,c){c===void 0&&(c=!0),a.lastMeasuredIndex=Math.min(a.lastMeasuredIndex,s-1),r._getItemStyleCache(-1),c&&r.forceUpdate()},a},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){t.itemSize}});function Xa({isActive:e,isNew:t,isDisabled:r,data:n,eventsEmit:o,styles:a={},assistantList:s=[]}){const[c,p]=ue(!1),m=(a==null?void 0:a.colors)||{},y=Ae(()=>{const f=n==null?void 0:n.configId;if(!f||!s||s.length===0)return"\u672A\u9009\u62E9\u52A9\u624B";const g=s.find(h=>String(h==null?void 0:h.id)===String(f));if(!g)return"\u672A\u9009\u62E9\u52A9\u624B";if(g!=null&&g.name)return g.name;try{const h=typeof g.configJson=="string"?JSON.parse(g.configJson):g.configJson;return(h==null?void 0:h.config_name)||"\u672A\u9009\u62E9\u52A9\u624B"}catch{return"\u672A\u9009\u62E9\u52A9\u624B"}},[s,n==null?void 0:n.configId]),v=[{key:"rename",icon:d(uo,{size:12}),label:"\u91CD\u547D\u540D",onClick:f=>{f.domEvent.stopPropagation(),o&&o("conversations:rename_icon_clicked",n)}},{key:"delete",icon:d(fo,{size:12}),label:"\u5220\u9664",danger:!0,onClick:f=>{f.domEvent.stopPropagation(),o&&o("conversations:delete_icon_clicked",n)}}],x=e?m.activeItemBg||"#f0f4ff":c?m.itemHoverBg||"#f5f7fa":m.itemBg||"transparent",w=e?m.activeItemText||m.primary||"#0122ff":m.itemText||"#333",C=e?m.activeItemBorder||m.primary||"#0122ff":"transparent",i=f=>{const g=pr(),h=pr(f);return g.isSame(h,"day")?h.format("HH:mm"):h.format("MM-DD HH:mm")};return R("div",{className:"flex relative items-center justify-between mb-2 px-4 py-3 rounded-md transition-colors cursor-pointer select-none",onClick:()=>!r&&o&&o("conversation:item_click",n),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),style:{minHeight:48,background:x,color:w,border:`1px solid ${C}`,...a.item,opacity:r?.5:1},children:[R("div",{className:"flex flex-col gap-y-2 flex-1 min-w-0",children:[d("span",{className:"truncate text-sm max-w-[160px] font-medium",title:n.label||"\u672A\u547D\u540D\u4F1A\u8BDD",style:{color:w,fontSize:"14px",lineHeight:"1.4"},children:n.label||"\u672A\u547D\u540D\u4F1A\u8BDD"}),R("div",{className:"flex items-center justify-between gap-2",children:[d("span",{className:"text-xs truncate flex-1",style:{color:e?m.activeItemTextSecondary||"#666":m.itemTextSecondary||"#666",fontSize:"12px",lineHeight:"1.3"},children:y}),n.gmtModified&&d("span",{className:"text-xs flex-shrink-0",style:{color:e?m.activeItemTextSecondary||"#999":m.itemTextSecondary||"#999",fontSize:"12px",lineHeight:"1.3"},children:i(n.gmtModified)})]})]}),!r&&c&&!t&&d("div",{className:"absolute top-2 right-3",children:d(ro,{menu:{items:v},trigger:["click"],placement:"bottomRight",children:d(so,{size:16,className:"text-gray-600 hover:text-gray-800",style:{cursor:"pointer",color:e?m.activeItemTextSecondary||"#999":m.itemTextSecondary||"#999"},onClick:f=>f.stopPropagation()})})})]})}function Ja(e,t=[{label:"\u5F53\u5929",dayPeriod:1}]){const r=new Date,n={other:[]};return e.forEach(o=>{const a=new Date(o.gmtModified),s=Math.floor((+r-+a)/(1e3*60*60*24));let c=!1;for(const p of t)if(s<=p.dayPeriod){n[p.label]||(n[p.label]=[]),n[p.label].push(o),c=!0;break}c||n.other.push(o)}),n}function Ka(e){const{data:t,activedItem:r,onChange:n,onDelete:o,sortRules:a=[{label:"\u5F53\u5929",dayPeriod:1}],eventsEmit:s,assistantList:c,height:p=400,styles:m={},hasMore:y=!1,loadingMore:v=!1}=e,x=t.map(N=>N.sessionId+"-"+N.gmtModified).join(","),w=Ae(()=>{const N=a.length>0?a:[{label:"\u5F53\u5929",dayPeriod:1}],$=Ja(t,N),_=N.every(z=>!$[z.label]||$[z.label].length===0),H=[];return N.forEach(z=>{$[z.label]&&$[z.label].length>0&&(H.push({type:"group",label:z.label}),$[z.label].forEach(L=>H.push({type:"item",data:L})))}),$.other.length>0&&!_&&(H.push({type:"group",label:"\u5176\u4ED6"}),$.other.forEach(z=>H.push({type:"item",data:z}))),_&&$.other.length>0&&$.other.forEach(z=>H.push({type:"item",data:z})),H},[t,a,x]),C=Ae(()=>w.map(N=>N.type==="group"?`g:${N.label}`:`i:${N.data.sessionId}`).join("|"),[w]),i=56,f=14,g=36,h=N=>N===w.length?g:w[N].type==="group"?32:i+f,E=Le(null),D=Ae(()=>w.findIndex(N=>{var $;return N.type==="item"&&(($=N.data)==null?void 0:$.sessionId)===r}),[w,r]),b=Ae(()=>w.findIndex(N=>N.type==="item"),[w]),A=Le(void 0);Se(()=>{const N=A.current;r!==N&&D>-1&&D===b&&E.current&&E.current.scrollToItem(D,"start"),A.current=r},[r,D,b]);const k=Le(0);if(Se(()=>{if(E.current){const N=k.current,$=w.length;k.current=$,$!==N&&E.current.resetAfterIndex(Math.max(0,Math.min(N,$)-1),!1)}},[w.length]),Se(()=>{E.current&&E.current.resetAfterIndex(0,!1)},[C]),w.length===0)return d("div",{className:"text-center text-zinc-400 py-8",children:"\u6682\u65E0\u4F1A\u8BDD"});const T=(m==null?void 0:m.colors)||{};return d(Gn,{flipKey:x,spring:{stiffness:180,damping:18},children:d(Va,{ref:E,height:p,width:"100%",itemCount:w.length+1,itemSize:h,itemKey:N=>{if(N===w.length)return"footer";const $=w[N];return $.type==="item"?$.data.sessionId:`group-${$.label}`},onItemsRendered:({visibleStopIndex:N})=>{y&&!v&&N>=w.length-1-3&&typeof s=="function"&&s("conversations:load_more")},style:{overflowX:"hidden"},children:({index:N,style:$})=>{if(N===w.length){const H=(m==null?void 0:m.colors)||{};return d("div",{style:{...$,height:g,lineHeight:`${g}px`,textAlign:"center",fontSize:"10px",color:H.textMuted||"#9ca3af",background:H.groupBg||"white"},children:v?"\u52A0\u8F7D\u4E2D...":y?"":"\u6CA1\u6709\u66F4\u591A\u4E86"})}const _=w[N];return _.type==="group"?d("div",{style:{...$,background:T.groupBg||"white",zIndex:1},className:"pt-2 pb-1 px-[28px] py-[2px] text-xs text-gray-400",children:_.label}):d(Yn,{flipId:_.data.sessionId,children:d("div",{style:$,className:"px-[12px] py-[2px]",children:d(Xa,{isActive:r===_.data.sessionId,isDisabled:!1,isNew:_.data.isNew,data:_.data,eventsEmit:s,assistantList:c,styles:m})})},_.data.sessionId)}})})}const Ga=({value:e,eventsEmit:t,setSearch:r,style:n,styles:o={}})=>{const a=o.colors||{},s=o.radius||"12px",c=a.border||"#e5e7eb",p=a.primary||"#2563eb",m=o.headerBg||a.sidebarBg||a.background||"#fff",[y,v]=Ge.useState(!1);return R("div",{className:"flex items-center gap-2 px-4 py-3 sticky top-0 z-10 min-w-0",style:{...n,background:m,borderTopLeftRadius:s,borderTopRightRadius:s},children:[d("button",{className:"border-none flex items-center justify-center",onClick:()=>{v(!1),t&&t("conversation:create")},title:"\u65B0\u5EFA\u4F1A\u8BDD",style:{height:42,borderRadius:"90px",background:p,color:a.buttonText||"#fff",fontWeight:600,boxShadow:o.shadow||"0 2px 8px 0 rgba(0,0,0,0.04)",padding:y?"0 0":"0 14px",minWidth:y?0:180,width:y?0:void 0,opacity:y?0:1,overflow:"hidden",flexShrink:0,transition:"width .22s ease, min-width .22s ease, padding .22s ease, opacity .18s ease"},children:R("div",{className:"flex items-center gap-2",children:[d(rn,{size:18}),d("span",{className:"text-sm",children:"\u65B0\u5EFA\u5BF9\u8BDD"})]})}),y?R("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[d("input",{className:"flex-1 px-3 py-2 text-sm transition-all",placeholder:"\u641C\u7D22\u4F1A\u8BDD...",value:e,onChange:x=>r(x.target.value),onBlur:()=>v(!1),onKeyDown:x=>{x.key==="Enter"&&v(!1)},style:{minWidth:0,width:"100%",maxWidth:"100%",borderRadius:s,background:a.inputBg||"#f4f4f5",border:`1px solid ${c}`,color:a.text||"#222",outline:"none"}}),d("button",{className:"flex items-center justify-center transition-colors",style:{width:36,height:36,borderRadius:"90px",border:`1px solid ${c}`,color:a.text||"#222",flexShrink:0},onClick:()=>v(!1),title:"\u6536\u8D77\u641C\u7D22",children:d(ar,{size:16})})]}):d("button",{className:"ml-auto flex items-center justify-center transition-colors",style:{width:36,height:36,borderRadius:"90px",border:`1px solid ${c}`,color:p,flexShrink:0},onClick:()=>v(!0),title:"\u641C\u7D22",children:d(po,{size:18})})]})};function Ya(e){const{data:t,sortRules:r,activedItem:n,eventsEmit:o,assistantList:a,styles:s={},hasMore:c=!1,loadingMore:p=!1}=e,[m,y]=ue(""),v=Ae(()=>m?t.filter(b=>(b.label||"\u672A\u547D\u540D\u4F1A\u8BDD").toLowerCase().includes(m.toLowerCase())):t,[t,m]),x=Ae(()=>[...v].sort((b,A)=>new Date(A.gmtModified).getTime()-new Date(b.gmtModified).getTime()),[v]),w=Le(null),[C,i]=ue(400);Se(()=>{function b(){w.current&&i(w.current.clientHeight)}return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);const f=(s==null?void 0:s.colors)||{};s!=null&&s.radius;const g=(s==null?void 0:s.shadow)||"0 4px 24px 0 rgba(0,0,0,0.06)",h=f.border||"#e5e7eb",E=f.sidebarBg||f.background||"#EAEEFF",D=f.text||"#222";return R("div",{className:"h-full flex flex-col overflow-y-hidden",style:{background:E,color:D,boxShadow:g,border:`1px solid ${h}`,...s.container},children:[d(Ga,{value:m,setSearch:y,eventsEmit:o,style:s.header,styles:s}),R("div",{className:"flex-1 min-h-0 relative",ref:w,style:s.list,children:[d(Ka,{eventsEmit:o,data:x,assistantList:a,activedItem:n,sortRules:r,height:C,styles:s,hasMore:c,loadingMore:p}),d("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-3 z-20",style:{background:`linear-gradient(to bottom, ${E}cc, transparent)`}})]})]})}const Qa=(e,t)=>{let r=e&&e.replace(/<think>[\s\S]*?<\/think>/g,"");r=r.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,""),r=r.replace(/<a\s+[^>]*>(.*?)<\/a>/g,""),console.log("_content",r);const n=new Qn(t.currentTarget||t.target,{text:()=>r});try{n.on("success",()=>{be.success("\u6587\u672C\u590D\u5236\u6210\u529F",2),n.destroy()}),n.on("error",o=>{be.error("\u590D\u5236\u5931\u8D25",2),n.destroy()}),n.onClick(t)}catch(o){n.destroy(),be.error("\u590D\u5236\u5931\u8D25: "+o,2)}},kr=e=>{const t=e.toLowerCase().split(".").pop()||"";return/^(jpg|jpeg|png|gif|bmp|webp)$/.test(t)?"image":/^(doc|docx)$/.test(t)?"word":/^(xls|xlsx|csv)$/.test(t)?"excel":/^(ppt|pptx)$/.test(t)?"ppt":t==="pdf"?"pdf":/^(txt|json|md|markdown)$/.test(t)?"text":/^(zip|rar|7z)$/.test(t)?"archive":"file"};function Za(e){const t=[];for(const r of e){if(r.query){const n=r.query.queryId||r.query.id||r.queryId||r.id||it(32);t.push({istype:"user",content:r.query.content,time:r.query.gmtCreate,queryId:n,clientSideId:n+"-user",...r.query})}if(r.reply){const n=r.reply.queryId||r.reply.id||r.queryId||r.id||it(32);t.push({istype:"ai",content:r.reply.content,isDefault:r.reply.isDefault,time:r.time||r.gmtCreate||Date.now(),queryId:n,clientSideId:n+"-ai",...r.reply})}}return t}const Or=async(e,t,r)=>{try{je.post(`${e.url}/qa/feedback`,t,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(n=>{n.data.success&&r&&r()})}catch(n){console.log("error",n)}},Jt=async(e,t,r)=>{try{je.delete(`${e.url}/qa/feedback/cancel?queryId=${t.queryId}`,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(n=>{n.data.success&&r&&r()})}catch(n){console.log("error",n)}},es=(e,t)=>{try{je.get(`${e.url}/qa/feedback/que/list`,{headers:{Authorization:e.token}}).then(r=>{r.data.success&&t&&t(r.data.data)})}catch(r){console.log("error",r)}},ts=async(e,t,r)=>{try{je.post(`${e.url}/qa/dialogue/reName`,t,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(n=>{n.data.success?r&&r(n):be.error("\u7F16\u8F91\u540D\u5B57\u5931\u8D25")}).catch(n=>{var o,a;(a=(o=n==null?void 0:n.response)==null?void 0:o.data)!=null&&a.errorMsg&&be.error(n.response.data.errorMsg)})}catch(n){console.log("error",n)}},rs=async(e,t,r)=>{try{je.delete(`${e.url}/qa/dialogue/delete?sessionId=${t.sessionId}`,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(n=>{n.data.success&&r&&r(n.data)})}catch(n){console.log("error",n)}},ns=async(e,t,r)=>{console.log("[DEBUG] handleCreateConversation \u8BF7\u6C42",{url:e.url,token:e.token,data:t});try{je.post(`${e.url}/qa/dialogue/create`,t,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(n=>{n.data.success?r&&r(n.data):be.error(n.data.errorMsg||"\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25")}).catch(n=>{var o,a;(a=(o=n==null?void 0:n.response)==null?void 0:o.data)!=null&&a.errorMsg&&be.error(n.response.data.errorMsg)})}catch(n){console.log("error",n)}},os=async(e,t,r)=>{try{const{uid:n,queryId:o}=t;let a=`${e.url}/index/knowledgeBase/file/deleteByUid?uid=${n}`;o&&(a+=`&queryId=${o}`),je.delete(a,{headers:{Authorization:e.token,"X-CSRF-TOKEN-IN":e.CSRFToken||""}}).then(s=>{s.data.success?r&&r(!0,s):r&&r(!1,s)}).catch(s=>{r&&r(!1,s)})}catch(n){r&&r(!1,n)}},as=""+new URL("assets/defaultWeLogo.svg",import.meta.url).href,ss="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAOkSURBVHgBxZRbTBxlFMd/c2EvXBbZLbsCVhcKaAyh2BKTWrX12RhNmxa1IVp98FEJVGNMY2KItSZtqGjaROMlaDSVxiZeqiRa0FBpIlSkhgK15WoLu7AL3V1md25+7CpUojzYB7/km5OZc+Z35pzz/wb+l3X7PotNL9tvd1yIc8OrYp9pWXZ6JXXdfLOtbdNa4fJazoZdu9xVNUE5petIVS9h/npRfkDKefg/A+OaJuUGvIz3DzD14R6uHv/WCmzbcuNlj7S+3z7+5Xepno7TLeJWWiv2n5zyTcEaT/TJlrfwljxCTm42lgHRmIHDqaIqIsTE43NS7FHCBXKkIzw4eGKkYcdnwmGvBspSy+DpxlrffXtqC6WeqM3+CZ3wnAZLOyXAlsXfOjU7D6EYHLw7zVKvgykcG+r98YmKjdG5BK3nw7w7YQuATdAJWR4IJ2UiswKoiC39+S0+4QjNL0NWgDU7y57ZVlLd2n+FO/Kd7BxxcPOpMKGrCSxNTNm2kVUZ2e1g+5YCxh4q4IW+cAactYTZLi6dxgqw4dUjj+UgfXpSJRAaY9Lt4dZAkoW5YWSXyKwo6ZYbhsFCciPe9hgHtDiB+kqe6huF6jknv2As9/Dj3mv2se4Yh5RhEr4SbD2FpMjomkZ0eoaunl5yxXwqKsspKwsiOVzYqST143k8Xe7gvaN17tHOTi0D/D6U3DqhO7oNNxOlU6heD0cOH2frg/dSU1ywMgRhRmMpvvjoG55t3I0RWWDvuST9iy5q64qtr2/LV9Ill/aNOsb9fnC48a+zGYzF6R/opefsGU59sl88d6V5tpagqekNFg2LgeHN3F/pJS9rET2l4v15Ruav1PHLEdsUJYpXcNjXKA54iCd11gf9ONUkLqeVtu4ciQUjwcCF3wjc4sUlJbhouyjOVek6O2kvT3kGV3e9P/uetlmhi4VpCsU0Wz5o5i6/kIehY8UjyHlLpVt8daKZc1d0qt3zaV2ex09LjYvnhsx3rj8pEq90N1QU+Q+9WJVgbzBPpFIzIrZNsYWVlYyVhJXVtFys6UHWf76O36NDu3nt0fbVJ0Wm6Sedomx5hzPCwYpJygvdkOMVQhbKFjrEFG2JRQjPTHH4Uh4HoptFfy2T5+9clt/qo6fS9MMYilqEL1dCyCQtQsnKhC51yUyCkBLz4qeT77Np3KCme/EvwJVndUcfl0qr6uzKwAb8biemqTCjmYS0RUKhM1zuep2TzZfIpFlefwDISXe8s31UTQAAAABJRU5ErkJggg==",is=(e,t)=>{const r={...or.colors,...e};return`
|
|
67
|
+
.g-welcome-${t} .g-welcome-title {
|
|
94
68
|
background-image: linear-gradient(90deg, #3262FA 0%, #6C18FF 100%);
|
|
95
69
|
-webkit-background-clip: text;
|
|
96
70
|
background-clip: text;
|
|
97
71
|
color: transparent;
|
|
98
72
|
-webkit-text-fill-color: transparent;
|
|
99
73
|
}
|
|
100
|
-
.g-welcome-${
|
|
101
|
-
color: ${
|
|
74
|
+
.g-welcome-${t} .g-welcome-subtitle {
|
|
75
|
+
color: ${r.disabled};
|
|
102
76
|
}
|
|
103
|
-
.g-welcome-${
|
|
77
|
+
.g-welcome-${t} .g-welcome-btn {
|
|
104
78
|
background-color: #ffffff;
|
|
105
|
-
border-color: ${
|
|
106
|
-
color: ${
|
|
79
|
+
border-color: ${r.border};
|
|
80
|
+
color: ${r.text};
|
|
107
81
|
height: 36px;
|
|
108
82
|
border-width: 1px;
|
|
109
83
|
box-shadow: 0 1px 2px rgba(31,35,41,0.04);
|
|
110
84
|
}
|
|
111
|
-
.g-welcome-${
|
|
112
|
-
border-color: ${
|
|
113
|
-
color: ${
|
|
85
|
+
.g-welcome-${t} .g-welcome-btn:hover {
|
|
86
|
+
border-color: ${r.primary};
|
|
87
|
+
color: ${r.primary};
|
|
114
88
|
background-color: #ffffff;
|
|
115
89
|
box-shadow: 0 2px 6px rgba(31,35,41,0.08);
|
|
116
90
|
}
|
|
117
|
-
.g-welcome-${
|
|
91
|
+
.g-welcome-${t} .g-welcome-btn.active {
|
|
118
92
|
background-image: linear-gradient(90deg, #F1F8FF 0%, #F9F4FF 100%);
|
|
119
|
-
border-color: ${
|
|
93
|
+
border-color: ${r.primary};
|
|
120
94
|
box-shadow: 0 4px 10px rgba(24, 144, 255, 0.25);
|
|
121
95
|
}
|
|
122
|
-
.g-welcome-${
|
|
96
|
+
.g-welcome-${t} .g-welcome-btn .icon-badge {
|
|
123
97
|
width: 24px;
|
|
124
98
|
height: 24px;
|
|
125
99
|
border-radius: 9999px;
|
|
@@ -127,20 +101,20 @@ import{jsx as $,jsxs as Y,Fragment as Ea}from"react/jsx-runtime";import*as l fro
|
|
|
127
101
|
align-items: center;
|
|
128
102
|
justify-content: center;
|
|
129
103
|
background: radial-gradient(100% 100% at 50% 0%, #F2F3F5 0%, #FFFFFF 100%);
|
|
130
|
-
box-shadow: inset 0 0 0 1px ${
|
|
104
|
+
box-shadow: inset 0 0 0 1px ${r.border};
|
|
131
105
|
}
|
|
132
|
-
.g-welcome-${
|
|
133
|
-
color: ${
|
|
106
|
+
.g-welcome-${t} .g-welcome-pagination-btn {
|
|
107
|
+
color: ${r.primary};
|
|
134
108
|
}
|
|
135
|
-
.g-welcome-${
|
|
136
|
-
color: ${
|
|
109
|
+
.g-welcome-${t} .g-welcome-pagination-btn:disabled {
|
|
110
|
+
color: ${r.disabled};
|
|
137
111
|
cursor: not-allowed;
|
|
138
112
|
}
|
|
139
|
-
.g-welcome-${
|
|
140
|
-
color: ${
|
|
113
|
+
.g-welcome-${t} .g-welcome-pagination-text {
|
|
114
|
+
color: ${r.text};
|
|
141
115
|
}
|
|
142
|
-
`};function
|
|
143
|
-
`+f:f;break;case"event":r.event=f;break;case"id":e(r.id=f);break;case"retry":const m=parseInt(f,10);isNaN(m)||n(r.retry=m);break}}}}function Uc(e,n){const t=new Uint8Array(e.length+n.length);return t.set(e),t.set(n,e.length),t}function Fo(){return{data:"",event:"",id:"",retry:void 0}}var Wc=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t};const hr="text/event-stream",Vc=1e3,No="last-event-id";function Kc(e,n){var{signal:t,headers:r,onopen:o,onmessage:a,onclose:i,onerror:s,openWhenHidden:u,fetch:d}=n,f=Wc(n,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((m,h)=>{const x=Object.assign({},r);x.accept||(x.accept=hr);let w;function c(){w.abort(),document.hidden||y()}u||document.addEventListener("visibilitychange",c);let p=Vc,C=0;function b(){document.removeEventListener("visibilitychange",c),window.clearTimeout(C),w.abort()}t==null||t.addEventListener("abort",()=>{b(),m()});const I=d??window.fetch,S=o??Xc;async function y(){var F;w=new AbortController;try{const D=await I(e,Object.assign(Object.assign({},f),{headers:x,signal:w.signal}));await S(D),await Lc(D.body,Hc(qc(O=>{O?x[No]=O:delete x[No]},O=>{p=O},a))),i==null||i(),b(),m()}catch(D){if(!w.signal.aborted)try{const O=(F=s==null?void 0:s(D))!==null&&F!==void 0?F:p;window.clearTimeout(C),C=window.setTimeout(y,O)}catch(O){b(),h(O)}}}y()})}function Xc(e){const n=e.headers.get("content-type");if(!(n!=null&&n.startsWith(hr)))throw new Error(`Expected content-type to be ${hr}, Actual: ${n}`)}class rr extends Error{}let Ct=null;const Gc=({baseUrl:e,token:n,CSRFToken:t,setChatData:r,activeSessionId:o,setAppStatus:a,setConversationList:i})=>{const s=({content:w,status:c,respTime:p,filePaths:C,reference:b,webReference:I,graphReference:S,databaseReference:y,llmType:F,resultType:D,queryId:O,tokens:N})=>{r(E=>{var U;if(!E[0])return E;const _=E[0],T=_.messages||[],k=T.length-1;if(k<0)return E;const M=T[k];if(M.istype!=="ai")return E;let B=T.slice();if(C!=null&&C.length){const K=T.length-2;if(K>=0&&((U=T[K])==null?void 0:U.istype)==="user"){const L={...T[K],filePaths:C};B[K]=L}}const V={...M,content:(M.content||"")+w,status:c,respTime:p,filePaths:C,reference:b,webReference:I,graphReference:S??M.graphReference,databaseReference:y??M.databaseReference,resultType:D,llmType:F,tokens:N,queryId:O||M.queryId||Ht(32)};return V.clientSideId=V.clientSideId||V.queryId+"-ai",B[k]=V,[{..._,isNew:!1,messages:B},...E.slice(1)]})},u=w=>{if(w instanceof rr)throw a(c=>({...c,display:"error",sender:"ready"})),Ct&&(Ct.abort(),Ct=null),w};return{updateUserFilesMessage:({currentFiles:w})=>{r(c=>{if(!c[0])return c;const p=c[0],C=p.messages||[];if(!C.length)return c;const b=C.length-2;if(b<0||C[b].istype!=="user")return c;const S=C.slice();return S[b]={...C[b],currentFiles:w},[{...p,messages:S},...c.slice(1)]})},api_startChat_re:(w,c)=>{Ct&&Ct.abort(),Ct=new AbortController;const p=`${e}/qa/ai/question_re`;console.log("data",w);const C={...w};Kc(p,{method:"post",signal:Ct.signal,headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:n||"","X-CSRF-TOKEN-IN":t||""},openWhenHidden:!0,body:JSON.stringify(C),onopen:async b=>{if(b.status===500)throw new rr("Internal Server Error");if(!b.ok)throw new rr(`HTTP error: ${b.status}`)},onmessage:b=>{const I=JSON.parse(b.data);if(o!==I.sessionId)return;const{reply:S,resultType:y,respTime:F,reference:D,webReference:O,graphReference:N,filePaths:E,status:_,docs:T,llmType:k,databaseReference:M}=I,B=E?JSON.parse(E):[];if(_===2&&S&&S.content&&(S.content.includes("\u6A21\u578B\u6682\u65E0\u6CD5\u8FD4\u56DE")||S.content.includes("\u5931\u8D25")||S.content.includes("\u9519\u8BEF")||S.content.includes("\u8BF7\u7A0D\u540E\u518D\u8BD5"))&&a(V=>({...V,display:"ready",sender:"ready"})),_===2){if(s({content:S.content||"",status:2,respTime:F,filePaths:B,reference:D||T||"",webReference:O||"",graphReference:N||null,databaseReference:M,llmType:k,resultType:y,queryId:I.queryId,tokens:I.tokens}),a(V=>({...V,display:"ready",sender:"ready"})),c){const V=F||Date.now();console.log("[AichatUseController] \u6D88\u606F\u53D1\u9001\u6210\u529F\uFF0CgmtModified:",V),c(V)}}else s({content:S.content||"",status:_,respTime:F,filePaths:B,reference:D||T||"",webReference:O||"",graphReference:N||null,databaseReference:M,llmType:k,resultType:y,queryId:I.queryId,tokens:I.tokens})},onerror:u})},addEmptyMessage:({queryId:w,content:c,filePaths:p,currentFiles:C})=>{r(b=>{const I=new Date().toISOString(),S=w||Ht(32),y={istype:"user",content:c,time:I,queryId:S,clientSideId:S+"-user",filePaths:p||"",currentFiles:C||[]},F={istype:"ai",content:"",time:new Date(Date.now()+1).toISOString(),streaming:!0,status:0,queryId:S,clientSideId:S+"-ai"},D=b.find(O=>O.id===o);return D?D.messages.push(y,F):console.warn("addEmptyMessage called without an active session."),[...b]})},setLastEmptyMessage:({now:w})=>{r(c=>{if(!c[0])return c;const p=c[0],C=p.messages||[];if(!C.length)return c;const b=C.length-1;if(b<0)return c;const I=C[b];if(I.istype!=="ai")return c;const S=C.slice();return S[b]={...I,istype:"ai",content:"",time:w,streaming:!0,status:0},[{...p,messages:S},...c.slice(1)]})},stopStream:()=>{Ct&&(Ct.abort(),Ct=null),a(w=>({...w,display:"ready",sender:"ready"}))}}},Oo=e=>e?Array.isArray(e)?e.map(r=>"/minio/"+r.split("/").slice(3).join("/")):"/minio/"+e.split("/").slice(3).join("/"):"",Do="http://10.15.12.13:9000/",Jc=e=>{if(typeof e=="string"){const n=e.split(".");return n.length?n[n.length-1]:""}else return""},Yc=e=>{var y,F,D,O,N,E,_,T;const{file_type:n,file_name:t,url:r,parse_url:o,retrieve_tags:a,file_id:i,parsed_file_type:s,onlyDownloadTypes:u,references:d,eventsEmit:f,styles:m,isUploadFile:h,type:x,collectionItems:w,pdfPages:c=0,fileManagerData:p}=e;if(x==="collection"&&Array.isArray(w)){const B=`calc(90% - ${.5}px)`,V=w.slice(0,4),j=w.length>4,U="\u6253\u5F00\u5408\u96C6",K=()=>{if(p&&n==="pdf"&&!e.pdfPages){const L=((p==null?void 0:p.uploadedFiles)||[]).find(q=>{var ee;return((q==null?void 0:q.name)||((ee=q==null?void 0:q.file)==null?void 0:ee.name))===t});if(!(L!=null&&L.pdfPages)){Re.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}f==null||f("reference_file:click",{...e,pdfPages:(L==null?void 0:L.pdfPages)||0})}else f==null||f("reference_file:click",e)};return Y("div",{className:"user-file relative group flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all bg-white shadow",style:{width:94,height:94,minWidth:94,minHeight:94,borderColor:(F=(y=m==null?void 0:m.theme)==null?void 0:y.colors)==null?void 0:F.border},onClick:K,children:[$("div",{className:"grid grid-cols-2 items-center justify-center grid-rows-2 gap-1 w-full h-full",style:{width:"100%",height:"100%",gap:1},children:V.map((L,q)=>{var W,J,oe,ae;if(j&&q===3)return $("div",{className:"flex items-center justify-center bg-gray-100 rounded",style:{width:B,height:B},children:$("span",{className:"text-xl text-gray-300 font-bold scale-75",children:"..."})},"ellipsis");if(L.file_type==="image"||L.file_type==="jpg"||L.file_type==="jpeg"||L.file_type==="png"||L.file_type==="gif"||L.file_type==="bmp"||L.file_type==="webp")return $("div",{className:"relative flex items-center justify-center bg-white rounded-lg border overflow-hidden",style:{width:B,height:B,borderColor:(J=(W=m==null?void 0:m.theme)==null?void 0:W.colors)==null?void 0:J.border},children:$("div",{className:"flex items-center justify-center w-full h-full scale-75",children:$("img",{src:String(L.url||L.file_path||""),alt:L.file_name||"",className:"object-contain max-w-full max-h-full"})})},L.file_name||q);const R=vr(String(L.file_type||""),m);return $("div",{className:"user-file flex flex-col items-center justify-center rounded-lg border bg-gray-50 p-1 text-sm",title:L.file_name,style:{width:B,height:B,borderColor:(ae=(oe=m==null?void 0:m.theme)==null?void 0:oe.colors)==null?void 0:ae.border},children:$("div",{className:"flex items-center justify-center w-full h-full scale-75",children:R})},L.file_name||q)})}),$("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg pointer-events-none",children:Y("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[$(Kn,{size:20,className:"mb-1 text-white"}),$("span",{className:"text-white text-center",style:{fontSize:12},children:U})]})})]})}const C=()=>{if(console.log(o,"parse_url",r,"url"),p&&n==="pdf"&&!c){const k=((p==null?void 0:p.uploadedFiles)||[]).find(M=>{var B;return((M==null?void 0:M.name)||((B=M==null?void 0:M.file)==null?void 0:B.name))===(t||"").replace(/\s+/g,"")});if(!(k!=null&&k.pdfPages)){Re.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}f==null||f("reference_file:click",{file:t,file_type:n,url:r,parse_url:o,retrieve_tags:a,file_id:i,parsed_file_type:s,references:d,type:b,isUploadFile:h,pdfPages:k.pdfPages||0})}else f==null||f("reference_file:click",{file:t,file_type:n,url:r,parse_url:o,retrieve_tags:a,file_id:i,parsed_file_type:s,references:d,type:b,isUploadFile:h,pdfPages:c})},b=Ge(()=>(t||"").split(".").pop()||"",[t]),I=vr(b,m),S=async()=>{if(r){const k=Oo(r.indexOf("http")>-1?r:`${Do}/${r}`);if(b.toLowerCase()==="json"){try{const V=await fetch(k);if(!V.ok)throw new Error("\u4E0B\u8F7D\u5931\u8D25");const j=await V.blob(),U=document.createElement("a");U.href=URL.createObjectURL(j),U.download=t||"",document.body.appendChild(U),U.click(),document.body.removeChild(U),setTimeout(()=>URL.revokeObjectURL(U.href),1e3)}catch{alert("\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25")}return}const B=document.createElement("a");B.href=k,B.download=t||"",document.body.appendChild(B),B.click(),document.body.removeChild(B)}};return u&&u.includes(b.toLowerCase())?Y("div",{className:"user-file relative group w-24 h-24 flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all",title:t,onClick:S,style:{borderColor:(O=(D=m==null?void 0:m.theme)==null?void 0:D.colors)==null?void 0:O.border},children:[I,$("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:t}),$("div",{className:"absolute text-center inset-0 cursor-pointer bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg",children:Y("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[$(Kn,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),$("div",{className:"text-white text-center",style:{fontSize:10},children:"\u4E0B\u8F7D\u6587\u4EF6"})]})})]},t):b==="image"||b==="jpg"||b==="jpeg"||b==="png"||b==="gif"||b==="bmp"||b==="webp"?Y("div",{className:"relative group w-24 h-24 cursor-pointer flex items-center justify-center",onClick:()=>C(),children:[r?$("img",{src:String(Oo(r&&r.indexOf("http")>-1?r:`${Do}/${r}`)||""),alt:t||"",className:"w-full h-full object-cover rounded-md border",style:{borderColor:(E=(N=m==null?void 0:m.theme)==null?void 0:N.colors)==null?void 0:E.border}}):$("div",{className:"w-full h-full flex items-center justify-center",children:$("span",{className:"animate-spin rounded-full border-2 border-gray-300 border-t-blue-500 w-8 h-8 inline-block"})}),$("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-md",children:Y("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[$($i,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),$("div",{className:"text-white text-center",children:"\u67E5\u770B\u56FE\u7247"})]})})]},t):Y("div",{className:"user-file relative group w-24 h-24 flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all",title:t,onClick:C,style:{borderColor:(T=(_=m==null?void 0:m.theme)==null?void 0:_.colors)==null?void 0:T.border},children:[I,$("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:t}),$("div",{className:"absolute text-center inset-0 cursor-pointer bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg",children:Y("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[$(Kn,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),$("div",{className:"text-white text-center",style:{fontSize:10},children:"\u6253\u5F00\u6587\u4EF6"})]})})]},t)},Qc=e=>e?e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`:"",Zc=({fileName:e,fileSize:n,icon:t,statusText:r,statusColor:o="text-gray-400",statusIcon:a,onRemove:i,themeColors:s={},cardId:u,showRemove:d=!0,disabledRemove:f=!1,onRemoveWithAnim:m,extra:h,style:x})=>Y("div",{id:u,className:"group gap-x-2.5 items-center file-display-card relative flex w-[210px] bg-white border border-gray-200 rounded-md shadow-sm px-2 py-1 transition-all hover:shadow-md hover:border-blue-300",style:x,children:[$("div",{className:"pt-1",children:t}),Y("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[Y("div",{className:"flex items-center justify-between gap-1",children:[$("span",{className:"text-[12px] font-medium truncate max-w-[120px]",title:e,children:e}),$("span",{className:"ml-1 text-[11px] text-gray-400",children:Qc(n)})]}),Y("div",{className:`text-[10px] mt-0.5 flex items-center gap-3 ${o}`,children:[a,$("span",{children:r})]})]}),h,d&&!f&&$("button",{className:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 transition-opacity text-gray-300 hover:text-red-400 text-xs p-0.5 rounded-full bg-white shadow-sm z-10",onClick:()=>{m&&u?m(u):i&&i()},title:"\u79FB\u9664",style:{lineHeight:0,color:s.error||"#FF0000"},children:$(Pr,{className:"w-3.5 h-3.5"})})]});function vr(e,n){var r;const t=((r=n==null?void 0:n.theme)==null?void 0:r.icons)||{};switch(e.toLowerCase()){case"docx":case"doc":return t.docx?$("img",{src:t.docx,alt:"docx",style:{width:20,height:20}}):$(lt,{type:"rag/word",size:18});case"image":case"jpg":case"jpeg":case"png":case"gif":case"bmp":case"webp":case"svg":case"ico":return t.image?$("img",{src:t.image,alt:"image",style:{width:20,height:20}}):$(lt,{type:"rag/pic",size:18});case"pptx":case"ppt":return t.pptx?$("img",{src:t.pptx,alt:"pptx",style:{width:20,height:20}}):$(lt,{type:"rag/ppt",size:18});case"sheets":case"excel":case"xls":case"csv":case"xlsx":case"xlsm":case"xlsb":case"xltx":case"xltm":case"xlt":case"xlam":return t.sheets?$("img",{src:t.sheets,alt:"sheets",style:{width:20,height:20}}):$(lt,{type:"rag/excel",size:18});case"pdf":return t.pdf?$("img",{src:t.pdf,alt:"pdf",style:{width:20,height:20}}):$(lt,{type:"rag/pdf",size:18});case"txt":return t.txt?$("img",{src:t.txt,alt:"txt",style:{width:20,height:20}}):$(lt,{type:"rag/txt",size:18});case"md":return t.md?$("img",{src:t.md,alt:"txt",style:{width:20,height:20}}):$(lt,{type:"rag/document",size:18});case"json":return t.json?$("img",{src:t.json,alt:"json",style:{width:20,height:20}}):$(lt,{type:"rag/json",size:18});case"html":case"htm":return t.html?$("img",{src:t.html,alt:"html",style:{width:20,height:20}}):$(lt,{type:"rag/url",size:18});case"xml":default:return $(lt,{type:"rag/file",size:18})}}const eu=[{file:{name:"\u4EA7\u54C1\u9700\u6C42\u6587\u6863.pdf",size:1024*1024*2.5,type:"application/pdf"},type:"pdf",status:"uploaded",url:"https://example.com/file1.pdf"},{file:{name:"\u6570\u636E\u5206\u6790\u62A5\u544A.xlsx",size:1024*1024*1.2,type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},type:"excel",status:"uploaded",url:"https://example.com/file3.xlsx"},{file:{name:"\u7CFB\u7EDF\u67B6\u6784\u56FE.png",size:1024*512,type:"image/png"},type:"image",status:"uploaded",url:"https://example.com/file2.png"}];function tu({open:e,onCancel:n,files:t=eu,currentFiles:r=[],onUpload:o,onRemoveFile:a,styles:i,eventsEmit:s}){const u={pending:"\u5F85\u4E0A\u4F20",uploading:"\u4E0A\u4F20\u4E2D",uploaded:"\u5DF2\u4E0A\u4F20",analyzing:"\u89E3\u6790\u4E2D",analyze_failed:"\u89E3\u6790\u5931\u8D25",error:"\u5931\u8D25"},[d,f]=Ie([]),m=(c,p)=>{s&&s("uploaded_file:removeFromTemp",{file:c,idx:p})},h=i&&i.theme&&i.theme.colors?i.theme.colors:{primary:"#007bff",secondary:"#6c757d",success:"#008000",warning:"#FFA500",error:"#FF0000",info:"#0000FF",background:"#f8f9fa",text:"#343a40",border:"#dee2e6",disabled:"#808080",disabledBackground:"#F5F5F5",disabledText:"#808080",shadow:"#000000",appBackground:"#fff"},x=t.map((c,p)=>Y("div",{className:"relative flex flex-col gap-2.5 items-center justify-center",children:[$("div",{className:"absolute right-1 top-1 z-10",children:$(ya,{title:"\u786E\u8BA4\u4ECE\u4E34\u65F6\u5BF9\u8BDD\u77E5\u8BC6\u5E93\u79FB\u9664\u8BE5\u6587\u4EF6\uFF1F",onConfirm:()=>m(c,p),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",children:$("button",{className:"bg-white cursor-pointer rounded-full p-0.5",style:{lineHeight:0,color:h&&h.text?h.text:"#FF0000",transition:"background 0.2s, color 0.2s"},onMouseOver:C=>{C.currentTarget.style.color=h&&h.error?h.error:"#FF0000"},onMouseOut:C=>{C.currentTarget.style.color=h.text},title:"\u79FB\u9664",children:$(Pr,{className:"w-3 h-3"})})})}),$(Yc,{file_type:Jc(c.file.name||c.name),file_name:c.name||c.file.name,url:c.url,retrieve_tags:[],styles:i,isUploadFile:!0,eventsEmit:s,parse_url:c.convertedFilePath,pdfPages:c.pdfPages||0})]},c.file.name+p)),w=r.map((c,p)=>{const C=c.file.name.split(".").pop()||"",b=vr(C,i);return $(Zc,{cardId:`pending-file-card-${p}`,fileName:c.file.name,fileSize:c.file.size,icon:b,statusText:u[c.status||"pending"],statusColor:"text-gray-400",showRemove:!0,onRemove:()=>a&&a(c,p,"pending"),themeColors:h,style:{boxShadow:"none",height:55,background:"#f8fafc"}},c.file.name+p)});return d.length>0?(h&&h.error&&h.error,h&&h.error&&h.error+"",h&&h.error&&h.error):(h&&h.disabledText&&h.disabledText,h&&h.disabledBackground&&h.disabledBackground,h&&h.disabledText&&h.disabledText),Y(Ar,{open:e,onCancel:n,footer:null,title:"\u5BF9\u8BDD\u4E34\u65F6\u6587\u4EF6\u77E5\u8BC6\u5E93",closable:!1,width:800,styles:{body:{padding:"0",maxHeight:"70vh",overflow:"auto"}},children:[Y("div",{className:"file-manager-modal space-y-6 px-4 py-4",children:[Y("div",{className:"",children:[$("div",{className:"flex items-center mb-2 justify-between",children:Y("div",{className:"flex items-center",children:[$("span",{className:"text-xs font-semibold text-gray-700",children:"\u5DF2\u4E0A\u4F20\u6587\u4EF6"}),Y("span",{className:"ml-2 text-xs text-gray-400",children:[t.length," \u4E2A"]})]})}),$("div",{className:"w-full relative min-h-[200px] max-h-[260px] p-2 overflow-y-auto",style:{overflowX:"hidden"},children:$("div",{className:"flex flex-wrap gap-1",children:x.length>0?x:$("div",{className:"flex items-center w-full h-full py-10 justify-center text-gray-400 text-sm",children:"\u6682\u65E0\u5DF2\u4E0A\u4F20\u6587\u4EF6"})})})]}),Y("div",{children:[Y("div",{className:"flex items-center mb-2",children:[$("span",{className:"text-xs font-semibold text-gray-700",children:"\u5F85\u4E0A\u4F20\u6587\u4EF6"}),Y("span",{className:"ml-2 text-xs text-gray-400",children:[r.length," \u4E2A"]})]}),Y("div",{className:"flex gap-2 overflow-x-auto pb-2",children:[w,$(jr.Dragger,{multiple:!0,showUploadList:!1,beforeUpload:(c,p)=>(c===p[0]&&(o==null||o(p)),!1),className:"!bg-gray-50 !border-dashed !border-gray-300 hover:!border-blue-400 cursor-pointer min-w-[160px] max-w-[220px] flex flex-row items-center justify-center border-2 rounded-lg transition-all",style:{height:45,boxShadow:"none",padding:0},children:Y("div",{className:"flex flex-row items-center pb-8 justify-center",children:[$(Xo,{size:20,className:"text-blue-400 mr-2"}),$("div",{className:"text-xs text-gray-500",children:"\u4E0A\u4F20\u6587\u4EF6"})]})})]})]}),$("div",{className:"flex justify-end gap-2",children:$(pt,{type:"primary",onClick:n,children:"\u786E\u8BA4"})})]}),$("style",{children:`
|
|
116
|
+
`};function ls({config:e,styles:t}){if(!e)return null;const r=JSON.parse(e.configJson),n=Ae(()=>{var o;return{...or.colors,...(o=t==null?void 0:t.theme)==null?void 0:o.colors}},[t]);return R("div",{className:"w-[340px] rounded-xl p-4 animate-fade-in bg-white",children:[R("div",{className:"flex items-center mb-2",children:[d("span",{className:"text-md font-bold truncate mr-2",style:{color:n.primary},children:r.config_name||"\u52A9\u624B\u914D\u7F6E"}),d("span",{className:"text-xs truncate rounded px-2 py-0.5",style:{backgroundColor:`${n.primary}1A`,color:n.disabled},children:r.model_name})]}),d("div",{className:"border-b my-2",style:{borderColor:n.border}}),R("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-700 mb-2",style:{color:n.text},children:[R("div",{children:["\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570\uFF1A",d("span",{className:"font-semibold",children:r.max_round})]}),R("div",{children:["\u6700\u5927\u4EE4\u724C\u6570\uFF1A",d("span",{className:"font-semibold",children:r.max_tokens})]}),R("div",{children:["\u6E29\u5EA6\uFF1A",d("span",{className:"font-semibold",children:r.temperature})]}),R("div",{children:["\u53EC\u56DE\u6570\uFF1A",d("span",{className:"font-semibold",children:r.top_k})]}),R("div",{children:["\u591A\u6837\u6027\uFF1A",d("span",{className:"font-semibold",children:r.top_p})]}),R("div",{children:["\u76F8\u4F3C\u5EA6\u9608\u503C\uFF1A",d("span",{className:"font-semibold",children:r.score_threshold})]})]}),R("div",{className:"mb-2",children:[d("div",{className:"text-xs text-gray-400 mb-1",style:{color:n.disabled},children:"\u5173\u8054\u77E5\u8BC6\u5E93\uFF1A"}),d("div",{className:"flex flex-wrap gap-1",children:r.knowledge_base_name?r.knowledge_base_name.split(";").map((o,a)=>d("span",{className:"px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${n.primary}1A`,color:n.primary},children:o},a)):d("span",{className:"text-gray-300",style:{color:n.disabled},children:"\u65E0"})})]}),R("div",{className:"mb-2",children:[d("div",{className:"text-xs text-gray-400 mb-1",style:{color:n.disabled},children:"\u5F00\u542F\u529F\u80FD:"}),R("div",{className:"flex flex-wrap gap-2 text-xs mt-2",children:[!!r.enabled_faq&&d("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${n.success}1A`,color:n.success},children:"FAQ"}),!!r.enabled_graph&&d("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${n.success}1A`,color:n.success},children:"\u56FE\u8C31"}),!!r.dependOnKb&&d("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${n.success}1A`,color:n.success},children:"\u5F3A\u77E5\u8BC6\u4F9D\u8D56"}),!!r.enabled_table_select&&d("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${n.success}1A`,color:n.success},children:"\u8868\u683C\u7B5B\u9009"}),!!r.enabled_rerank&&d("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${n.success}1A`,color:n.success},children:"\u7CBE\u6392\u6A21\u5F0F"}),!!r.need_trace_source&&d("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${n.success}1A`,color:n.success},children:"\u6EAF\u6E90"}),!!r.is_download&&d("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${n.success}1A`,color:n.success},children:"\u4E0B\u8F7D\u6EAF\u6E90"})]})]})]})}function cs(e,t=[],r=60){const[n,o]=ue("");return Se(()=>{o("");let a=0;const s=setInterval(()=>{o(c=>a>=e.length?(clearInterval(s),c):(a++,e.slice(0,a)))},r);return()=>clearInterval(s)},[e,...t]),n}function us(e){const{assistantList:t,eventsEmit:r,styles:n,selectedId:o,onSelectAssistant:a,productLogo:s}=e,[c,p]=ue(1),m=12,y=Le();Se(()=>{o&&y.current!==o&&(r==null||r("conversation:new_assistant_change",{assistantId:o}),y.current=o)},[o,r]);const v=Ae(()=>it(),[]);Se(()=>{var h;if((h=n==null?void 0:n.theme)!=null&&h.colors){const E=document.createElement("style");return E.innerHTML=is(n.theme.colors,v),E.id=`g-welcome-styles-${v}`,document.head.appendChild(E),()=>{const D=document.getElementById(E.id);D&&D.remove()}}},[n,v]);const x=Ae(()=>t.find(h=>h.id===o),[t,o]),w=Ae(()=>JSON.parse((x==null?void 0:x.configJson)||"{}"),[x]),C=Math.ceil(((t==null?void 0:t.length)||0)/m),i=(t==null?void 0:t.slice((c-1)*m,c*m))||[];Se(()=>{if(o&&t){const h=t.findIndex(E=>E.id===o);if(h!==-1){const E=Math.floor(h/m)+1;p(E)}}},[o,t,m]);const f=w.prologue||"\u60A8\u597D\uFF0C\u6B22\u8FCE\u4F7F\u7528\u5C0F\u9CB8\u667A\u80FD\u95EE\u7B54",g=cs(f,[o],30);return R("div",{className:`flex flex-col items-center justify-center h-full w-full g-welcome-${v}`,children:[d("img",{src:s||as,alt:"logo",className:"mb-4",style:{width:100,height:100}}),d("div",{className:"text-3xl font-bold mb-2 g-welcome-title",children:g}),d("div",{className:"text-sm text-gray-500 mb-20",children:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u667A\u80FD\u52A9\u624B\uFF0C\u5F00\u59CB\u4F60\u7684\u667A\u80FD\u95EE\u7B54\u4E4B\u65C5"}),!o&&d("div",{className:"flex mb-2 g-welcome-subtitle",children:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u667A\u80FD\u52A9\u624B"}),d("div",{className:"flex flex-wrap gap-3 px-5 justify-center mb-4",children:i&&i.length>0?i.map(h=>{const E=o===h.id;let D=h.icon;try{const b=JSON.parse(h.configJson||"{}");D=D||b.icon||b.avatar||b.logo}catch{}return D=D||ss,d(nn,{content:()=>d(ls,{config:t.find(b=>b.id===h.id),styles:n}),trigger:"hover",placement:"bottom",children:R("button",{className:`g-welcome-btn px-3 cursor-pointer rounded-full border font-medium min-w-[160px] text-sm transition-all flex items-center gap-2 ${E?"active":""}`,onClick:()=>a==null?void 0:a(h.id),title:h.name,children:[d("span",{className:"icon-badge",children:d("img",{src:D,alt:"icon",style:{width:16,height:16,borderRadius:4}})}),d("span",{className:"truncate max-w-[180px]",children:h.name})]})},h.id)}):d("div",{className:"g-welcome-subtitle",children:"\u6682\u65E0\u53EF\u7528\u52A9\u624B"})}),C>1&&R("div",{className:"flex items-center gap-3 text-sm",children:[d("button",{className:"g-welcome-pagination-btn px-3 py-1 rounded transition-colors",onClick:()=>p(h=>Math.max(1,h-1)),disabled:c===1,children:"\u4E0A\u4E00\u9875"}),R("span",{className:"g-welcome-pagination-text",children:[c," / ",C]}),d("button",{className:"g-welcome-pagination-btn px-3 py-1 rounded transition-colors",onClick:()=>p(h=>Math.min(C,h+1)),disabled:c===C,children:"\u4E0B\u4E00\u9875"})]})]})}async function ds(e,t){const r=e.getReader();let n;for(;!(n=await r.read()).done;)t(n.value)}function ps(e){let t,r,n,o=!1;return function(s){t===void 0?(t=s,r=0,n=-1):t=ms(t,s);const c=t.length;let p=0;for(;r<c;){o&&(t[r]===10&&(p=++r),o=!1);let m=-1;for(;r<c&&m===-1;++r)switch(t[r]){case 58:n===-1&&(n=r-p);break;case 13:o=!0;case 10:m=r;break}if(m===-1)break;e(t.subarray(p,m),n),p=r,n=-1}p===c?t=void 0:p!==0&&(t=t.subarray(p),r-=p)}}function fs(e,t,r){let n=Br();const o=new TextDecoder;return function(s,c){if(s.length===0)r==null||r(n),n=Br();else if(c>0){const p=o.decode(s.subarray(0,c)),m=c+(s[c+1]===32?2:1),y=o.decode(s.subarray(m));switch(p){case"data":n.data=n.data?n.data+`
|
|
117
|
+
`+y:y;break;case"event":n.event=y;break;case"id":e(n.id=y);break;case"retry":const v=parseInt(y,10);isNaN(v)||t(n.retry=v);break}}}}function ms(e,t){const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function Br(){return{data:"",event:"",id:"",retry:void 0}}var gs=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const er="text/event-stream",hs=1e3,_r="last-event-id";function ys(e,t){var{signal:r,headers:n,onopen:o,onmessage:a,onclose:s,onerror:c,openWhenHidden:p,fetch:m}=t,y=gs(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((v,x)=>{const w=Object.assign({},n);w.accept||(w.accept=er);let C;function i(){C.abort(),document.hidden||b()}p||document.addEventListener("visibilitychange",i);let f=hs,g=0;function h(){document.removeEventListener("visibilitychange",i),window.clearTimeout(g),C.abort()}r==null||r.addEventListener("abort",()=>{h(),v()});const E=m??window.fetch,D=o??vs;async function b(){var A;C=new AbortController;try{const k=await E(e,Object.assign(Object.assign({},y),{headers:w,signal:C.signal}));await D(k),await ds(k.body,ps(fs(T=>{T?w[_r]=T:delete w[_r]},T=>{f=T},a))),s==null||s(),h(),v()}catch(k){if(!C.signal.aborted)try{const T=(A=c==null?void 0:c(k))!==null&&A!==void 0?A:f;window.clearTimeout(g),g=window.setTimeout(b,T)}catch(T){h(),x(T)}}}b()})}function vs(e){const t=e.headers.get("content-type");if(!(t!=null&&t.startsWith(er)))throw new Error(`Expected content-type to be ${er}, Actual: ${t}`)}class Kt extends Error{}let He=null;const bs=({baseUrl:e,token:t,CSRFToken:r,setChatData:n,activeSessionId:o,setAppStatus:a,setConversationList:s})=>{const c=({content:C,status:i,respTime:f,filePaths:g,reference:h,webReference:E,graphReference:D,databaseReference:b,llmType:A,resultType:k,queryId:T,tokens:N})=>{n($=>{var V;if(!$[0])return $;const _=$[0],H=_.messages||[],z=H.length-1;if(z<0)return $;const L=H[z];if(L.istype!=="ai")return $;let M=H.slice();if(g!=null&&g.length){const X=H.length-2;if(X>=0&&((V=H[X])==null?void 0:V.istype)==="user"){const q={...H[X],filePaths:g};M[X]=q}}const Q={...L,content:(L.content||"")+C,status:i,respTime:f,filePaths:g,reference:h,webReference:E,graphReference:D??L.graphReference,databaseReference:b??L.databaseReference,resultType:k,llmType:A,tokens:N,queryId:T||L.queryId||it(32)};return Q.clientSideId=Q.clientSideId||Q.queryId+"-ai",M[z]=Q,[{..._,isNew:!1,messages:M},...$.slice(1)]})},p=C=>{if(C instanceof Kt)throw a(i=>({...i,display:"error",sender:"ready"})),He&&(He.abort(),He=null),C};return{updateUserFilesMessage:({currentFiles:C})=>{n(i=>{if(!i[0])return i;const f=i[0],g=f.messages||[];if(!g.length)return i;const h=g.length-2;if(h<0||g[h].istype!=="user")return i;const D=g.slice();return D[h]={...g[h],currentFiles:C},[{...f,messages:D},...i.slice(1)]})},api_startChat_re:(C,i)=>{He&&He.abort(),He=new AbortController;const f=`${e}/qa/ai/question_re`;console.log("data",C);const g={...C};ys(f,{method:"post",signal:He.signal,headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:t||"","X-CSRF-TOKEN-IN":r||""},openWhenHidden:!0,body:JSON.stringify(g),onopen:async h=>{if(h.status===500)throw new Kt("Internal Server Error");if(!h.ok)throw new Kt(`HTTP error: ${h.status}`)},onmessage:h=>{const E=JSON.parse(h.data);if(o!==E.sessionId)return;const{reply:D,resultType:b,respTime:A,reference:k,webReference:T,graphReference:N,filePaths:$,status:_,docs:H,llmType:z,databaseReference:L}=E,M=$?JSON.parse($):[];if(_===2&&D&&D.content&&(D.content.includes("\u6A21\u578B\u6682\u65E0\u6CD5\u8FD4\u56DE")||D.content.includes("\u5931\u8D25")||D.content.includes("\u9519\u8BEF")||D.content.includes("\u8BF7\u7A0D\u540E\u518D\u8BD5"))&&a(Q=>({...Q,display:"ready",sender:"ready"})),_===2){if(c({content:D.content||"",status:2,respTime:A,filePaths:M,reference:k||H||"",webReference:T||"",graphReference:N||null,databaseReference:L,llmType:z,resultType:b,queryId:E.queryId,tokens:E.tokens}),a(Q=>({...Q,display:"ready",sender:"ready"})),i){const Q=A||Date.now();console.log("[AichatUseController] \u6D88\u606F\u53D1\u9001\u6210\u529F\uFF0CgmtModified:",Q),i(Q)}}else c({content:D.content||"",status:_,respTime:A,filePaths:M,reference:k||H||"",webReference:T||"",graphReference:N||null,databaseReference:L,llmType:z,resultType:b,queryId:E.queryId,tokens:E.tokens})},onerror:p})},addEmptyMessage:({queryId:C,content:i,filePaths:f,currentFiles:g})=>{n(h=>{const E=new Date().toISOString(),D=C||it(32),b={istype:"user",content:i,time:E,queryId:D,clientSideId:D+"-user",filePaths:f||"",currentFiles:g||[]},A={istype:"ai",content:"",time:new Date(Date.now()+1).toISOString(),streaming:!0,status:0,queryId:D,clientSideId:D+"-ai"},k=h.find(T=>T.id===o);return k?k.messages.push(b,A):console.warn("addEmptyMessage called without an active session."),[...h]})},setLastEmptyMessage:({now:C})=>{n(i=>{if(!i[0])return i;const f=i[0],g=f.messages||[];if(!g.length)return i;const h=g.length-1;if(h<0)return i;const E=g[h];if(E.istype!=="ai")return i;const D=g.slice();return D[h]={...E,istype:"ai",content:"",time:C,streaming:!0,status:0},[{...f,messages:D},...i.slice(1)]})},stopStream:()=>{He&&(He.abort(),He=null),a(C=>({...C,display:"ready",sender:"ready"}))}}},Tr=e=>e?Array.isArray(e)?e.map(n=>"/minio/"+n.split("/").slice(3).join("/")):"/minio/"+e.split("/").slice(3).join("/"):"",Pr="http://10.15.12.13:9000/",xs=e=>{if(typeof e=="string"){const t=e.split(".");return t.length?t[t.length-1]:""}else return""},Fs=e=>{var b,A,k,T,N,$,_,H;const{file_type:t,file_name:r,url:n,parse_url:o,retrieve_tags:a,file_id:s,parsed_file_type:c,onlyDownloadTypes:p,references:m,eventsEmit:y,styles:v,isUploadFile:x,type:w,collectionItems:C,pdfPages:i=0,fileManagerData:f}=e;if(w==="collection"&&Array.isArray(C)){const M=`calc(90% - ${.5}px)`,Q=C.slice(0,4),U=C.length>4,V="\u6253\u5F00\u5408\u96C6",X=()=>{if(f&&t==="pdf"&&!e.pdfPages){const q=((f==null?void 0:f.uploadedFiles)||[]).find(ee=>{var Y;return((ee==null?void 0:ee.name)||((Y=ee==null?void 0:ee.file)==null?void 0:Y.name))===r});if(!(q!=null&&q.pdfPages)){be.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}y==null||y("reference_file:click",{...e,pdfPages:(q==null?void 0:q.pdfPages)||0})}else y==null||y("reference_file:click",e)};return R("div",{className:"user-file relative group flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all bg-white shadow",style:{width:94,height:94,minWidth:94,minHeight:94,borderColor:(A=(b=v==null?void 0:v.theme)==null?void 0:b.colors)==null?void 0:A.border},onClick:X,children:[d("div",{className:"grid grid-cols-2 items-center justify-center grid-rows-2 gap-1 w-full h-full",style:{width:"100%",height:"100%",gap:1},children:Q.map((q,ee)=>{var K,le,we,Ie;if(U&&ee===3)return d("div",{className:"flex items-center justify-center bg-gray-100 rounded",style:{width:M,height:M},children:d("span",{className:"text-xl text-gray-300 font-bold scale-75",children:"..."})},"ellipsis");if(q.file_type==="image"||q.file_type==="jpg"||q.file_type==="jpeg"||q.file_type==="png"||q.file_type==="gif"||q.file_type==="bmp"||q.file_type==="webp")return d("div",{className:"relative flex items-center justify-center bg-white rounded-lg border overflow-hidden",style:{width:M,height:M,borderColor:(le=(K=v==null?void 0:v.theme)==null?void 0:K.colors)==null?void 0:le.border},children:d("div",{className:"flex items-center justify-center w-full h-full scale-75",children:d("img",{src:String(q.url||q.file_path||""),alt:q.file_name||"",className:"object-contain max-w-full max-h-full"})})},q.file_name||ee);const j=tr(String(q.file_type||""),v);return d("div",{className:"user-file flex flex-col items-center justify-center rounded-lg border bg-gray-50 p-1 text-sm",title:q.file_name,style:{width:M,height:M,borderColor:(Ie=(we=v==null?void 0:v.theme)==null?void 0:we.colors)==null?void 0:Ie.border},children:d("div",{className:"flex items-center justify-center w-full h-full scale-75",children:j})},q.file_name||ee)})}),d("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg pointer-events-none",children:R("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[d(zt,{size:20,className:"mb-1 text-white"}),d("span",{className:"text-white text-center",style:{fontSize:12},children:V})]})})]})}const g=()=>{if(console.log(o,"parse_url",n,"url"),f&&t==="pdf"&&!i){const z=((f==null?void 0:f.uploadedFiles)||[]).find(L=>{var M;return((L==null?void 0:L.name)||((M=L==null?void 0:L.file)==null?void 0:M.name))===(r||"").replace(/\s+/g,"")});if(!(z!=null&&z.pdfPages)){be.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}y==null||y("reference_file:click",{file:r,file_type:t,url:n,parse_url:o,retrieve_tags:a,file_id:s,parsed_file_type:c,references:m,type:h,isUploadFile:x,pdfPages:z.pdfPages||0})}else y==null||y("reference_file:click",{file:r,file_type:t,url:n,parse_url:o,retrieve_tags:a,file_id:s,parsed_file_type:c,references:m,type:h,isUploadFile:x,pdfPages:i})},h=Ae(()=>(r||"").split(".").pop()||"",[r]),E=tr(h,v),D=async()=>{if(n){const z=Tr(n.indexOf("http")>-1?n:`${Pr}/${n}`);if(h.toLowerCase()==="json"){try{const Q=await fetch(z);if(!Q.ok)throw new Error("\u4E0B\u8F7D\u5931\u8D25");const U=await Q.blob(),V=document.createElement("a");V.href=URL.createObjectURL(U),V.download=r||"",document.body.appendChild(V),V.click(),document.body.removeChild(V),setTimeout(()=>URL.revokeObjectURL(V.href),1e3)}catch{alert("\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25")}return}const M=document.createElement("a");M.href=z,M.download=r||"",document.body.appendChild(M),M.click(),document.body.removeChild(M)}};return p&&p.includes(h.toLowerCase())?R("div",{className:"user-file relative group w-24 h-24 flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all",title:r,onClick:D,style:{borderColor:(T=(k=v==null?void 0:v.theme)==null?void 0:k.colors)==null?void 0:T.border},children:[E,d("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:r}),d("div",{className:"absolute text-center inset-0 cursor-pointer bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg",children:R("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[d(zt,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),d("div",{className:"text-white text-center",style:{fontSize:10},children:"\u4E0B\u8F7D\u6587\u4EF6"})]})})]},r):h==="image"||h==="jpg"||h==="jpeg"||h==="png"||h==="gif"||h==="bmp"||h==="webp"?R("div",{className:"relative group w-24 h-24 cursor-pointer flex items-center justify-center",onClick:()=>g(),children:[n?d("img",{src:String(Tr(n&&n.indexOf("http")>-1?n:`${Pr}/${n}`)||""),alt:r||"",className:"w-full h-full object-cover rounded-md border",style:{borderColor:($=(N=v==null?void 0:v.theme)==null?void 0:N.colors)==null?void 0:$.border}}):d("div",{className:"w-full h-full flex items-center justify-center",children:d("span",{className:"animate-spin rounded-full border-2 border-gray-300 border-t-blue-500 w-8 h-8 inline-block"})}),d("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-md",children:R("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[d(io,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),d("div",{className:"text-white text-center",children:"\u67E5\u770B\u56FE\u7247"})]})})]},r):R("div",{className:"user-file relative group w-24 h-24 flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all",title:r,onClick:g,style:{borderColor:(H=(_=v==null?void 0:v.theme)==null?void 0:_.colors)==null?void 0:H.border},children:[E,d("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:r}),d("div",{className:"absolute text-center inset-0 cursor-pointer bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg",children:R("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[d(zt,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),d("div",{className:"text-white text-center",style:{fontSize:10},children:"\u6253\u5F00\u6587\u4EF6"})]})})]},r)},Cs=e=>e?e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`:"",ws=({fileName:e,fileSize:t,icon:r,statusText:n,statusColor:o="text-gray-400",statusIcon:a,onRemove:s,themeColors:c={},cardId:p,showRemove:m=!0,disabledRemove:y=!1,onRemoveWithAnim:v,extra:x,style:w})=>R("div",{id:p,className:"group gap-x-2.5 items-center file-display-card relative flex w-[210px] bg-white border border-gray-200 rounded-md shadow-sm px-2 py-1 transition-all hover:shadow-md hover:border-blue-300",style:w,children:[d("div",{className:"pt-1",children:r}),R("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[R("div",{className:"flex items-center justify-between gap-1",children:[d("span",{className:"text-[12px] font-medium truncate max-w-[120px]",title:e,children:e}),d("span",{className:"ml-1 text-[11px] text-gray-400",children:Cs(t)})]}),R("div",{className:`text-[10px] mt-0.5 flex items-center gap-3 ${o}`,children:[a,d("span",{children:n})]})]}),x,m&&!y&&d("button",{className:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 transition-opacity text-gray-300 hover:text-red-400 text-xs p-0.5 rounded-full bg-white shadow-sm z-10",onClick:()=>{v&&p?v(p):s&&s()},title:"\u79FB\u9664",style:{lineHeight:0,color:c.error||"#FF0000"},children:d(ar,{className:"w-3.5 h-3.5"})})]});function tr(e,t){var n;const r=((n=t==null?void 0:t.theme)==null?void 0:n.icons)||{};switch(e.toLowerCase()){case"docx":case"doc":return r.docx?d("img",{src:r.docx,alt:"docx",style:{width:20,height:20}}):d(ze,{type:"rag/word",size:18});case"image":case"jpg":case"jpeg":case"png":case"gif":case"bmp":case"webp":case"svg":case"ico":return r.image?d("img",{src:r.image,alt:"image",style:{width:20,height:20}}):d(ze,{type:"rag/pic",size:18});case"pptx":case"ppt":return r.pptx?d("img",{src:r.pptx,alt:"pptx",style:{width:20,height:20}}):d(ze,{type:"rag/ppt",size:18});case"sheets":case"excel":case"xls":case"csv":case"xlsx":case"xlsm":case"xlsb":case"xltx":case"xltm":case"xlt":case"xlam":return r.sheets?d("img",{src:r.sheets,alt:"sheets",style:{width:20,height:20}}):d(ze,{type:"rag/excel",size:18});case"pdf":return r.pdf?d("img",{src:r.pdf,alt:"pdf",style:{width:20,height:20}}):d(ze,{type:"rag/pdf",size:18});case"txt":return r.txt?d("img",{src:r.txt,alt:"txt",style:{width:20,height:20}}):d(ze,{type:"rag/txt",size:18});case"md":return r.md?d("img",{src:r.md,alt:"txt",style:{width:20,height:20}}):d(ze,{type:"rag/document",size:18});case"json":return r.json?d("img",{src:r.json,alt:"json",style:{width:20,height:20}}):d(ze,{type:"rag/json",size:18});case"html":case"htm":return r.html?d("img",{src:r.html,alt:"html",style:{width:20,height:20}}):d(ze,{type:"rag/url",size:18});case"xml":default:return d(ze,{type:"rag/file",size:18})}}const Es=[{file:{name:"\u4EA7\u54C1\u9700\u6C42\u6587\u6863.pdf",size:1024*1024*2.5,type:"application/pdf"},type:"pdf",status:"uploaded",url:"https://example.com/file1.pdf"},{file:{name:"\u6570\u636E\u5206\u6790\u62A5\u544A.xlsx",size:1024*1024*1.2,type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},type:"excel",status:"uploaded",url:"https://example.com/file3.xlsx"},{file:{name:"\u7CFB\u7EDF\u67B6\u6784\u56FE.png",size:1024*512,type:"image/png"},type:"image",status:"uploaded",url:"https://example.com/file2.png"}];function Ss({open:e,onCancel:t,files:r=Es,currentFiles:n=[],onUpload:o,onRemoveFile:a,styles:s,eventsEmit:c}){const p={pending:"\u5F85\u4E0A\u4F20",uploading:"\u4E0A\u4F20\u4E2D",uploaded:"\u5DF2\u4E0A\u4F20",analyzing:"\u89E3\u6790\u4E2D",analyze_failed:"\u89E3\u6790\u5931\u8D25",error:"\u5931\u8D25"},[m,y]=ue([]),v=(i,f)=>{c&&c("uploaded_file:removeFromTemp",{file:i,idx:f})},x=s&&s.theme&&s.theme.colors?s.theme.colors:{primary:"#007bff",secondary:"#6c757d",success:"#008000",warning:"#FFA500",error:"#FF0000",info:"#0000FF",background:"#f8f9fa",text:"#343a40",border:"#dee2e6",disabled:"#808080",disabledBackground:"#F5F5F5",disabledText:"#808080",shadow:"#000000",appBackground:"#fff"},w=r.map((i,f)=>R("div",{className:"relative flex flex-col gap-2.5 items-center justify-center",children:[d("div",{className:"absolute right-1 top-1 z-10",children:d(ln,{title:"\u786E\u8BA4\u4ECE\u4E34\u65F6\u5BF9\u8BDD\u77E5\u8BC6\u5E93\u79FB\u9664\u8BE5\u6587\u4EF6\uFF1F",onConfirm:()=>v(i,f),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",children:d("button",{className:"bg-white cursor-pointer rounded-full p-0.5",style:{lineHeight:0,color:x&&x.text?x.text:"#FF0000",transition:"background 0.2s, color 0.2s"},onMouseOver:g=>{g.currentTarget.style.color=x&&x.error?x.error:"#FF0000"},onMouseOut:g=>{g.currentTarget.style.color=x.text},title:"\u79FB\u9664",children:d(ar,{className:"w-3 h-3"})})})}),d(Fs,{file_type:xs(i.file.name||i.name),file_name:i.name||i.file.name,url:i.url,retrieve_tags:[],styles:s,isUploadFile:!0,eventsEmit:c,parse_url:i.convertedFilePath,pdfPages:i.pdfPages||0})]},i.file.name+f)),C=n.map((i,f)=>{const g=i.file.name.split(".").pop()||"",h=tr(g,s);return d(ws,{cardId:`pending-file-card-${f}`,fileName:i.file.name,fileSize:i.file.size,icon:h,statusText:p[i.status||"pending"],statusColor:"text-gray-400",showRemove:!0,onRemove:()=>a&&a(i,f,"pending"),themeColors:x,style:{boxShadow:"none",height:55,background:"#f8fafc"}},i.file.name+f)});return m.length>0?(x&&x.error&&x.error,x&&x.error&&x.error+"",x&&x.error&&x.error):(x&&x.disabledText&&x.disabledText,x&&x.disabledBackground&&x.disabledBackground,x&&x.disabledText&&x.disabledText),R(sr,{open:e,onCancel:t,footer:null,title:"\u5BF9\u8BDD\u4E34\u65F6\u6587\u4EF6\u77E5\u8BC6\u5E93",closable:!1,width:800,styles:{body:{padding:"0",maxHeight:"70vh",overflow:"auto"}},children:[R("div",{className:"file-manager-modal space-y-6 px-4 py-4",children:[R("div",{className:"",children:[d("div",{className:"flex items-center mb-2 justify-between",children:R("div",{className:"flex items-center",children:[d("span",{className:"text-xs font-semibold text-gray-700",children:"\u5DF2\u4E0A\u4F20\u6587\u4EF6"}),R("span",{className:"ml-2 text-xs text-gray-400",children:[r.length," \u4E2A"]})]})}),d("div",{className:"w-full relative min-h-[200px] max-h-[260px] p-2 overflow-y-auto",style:{overflowX:"hidden"},children:d("div",{className:"flex flex-wrap gap-1",children:w.length>0?w:d("div",{className:"flex items-center w-full h-full py-10 justify-center text-gray-400 text-sm",children:"\u6682\u65E0\u5DF2\u4E0A\u4F20\u6587\u4EF6"})})})]}),R("div",{children:[R("div",{className:"flex items-center mb-2",children:[d("span",{className:"text-xs font-semibold text-gray-700",children:"\u5F85\u4E0A\u4F20\u6587\u4EF6"}),R("span",{className:"ml-2 text-xs text-gray-400",children:[n.length," \u4E2A"]})]}),R("div",{className:"flex gap-2 overflow-x-auto pb-2",children:[C,d(ir.Dragger,{multiple:!0,showUploadList:!1,beforeUpload:(i,f)=>(i===f[0]&&(o==null||o(f)),!1),className:"!bg-gray-50 !border-dashed !border-gray-300 hover:!border-blue-400 cursor-pointer min-w-[160px] max-w-[220px] flex flex-row items-center justify-center border-2 rounded-lg transition-all",style:{height:45,boxShadow:"none",padding:0},children:R("div",{className:"flex flex-row items-center pb-8 justify-center",children:[d(rn,{size:20,className:"text-blue-400 mr-2"}),d("div",{className:"text-xs text-gray-500",children:"\u4E0A\u4F20\u6587\u4EF6"})]})})]})]}),d("div",{className:"flex justify-end gap-2",children:d(Xe,{type:"primary",onClick:t,children:"\u786E\u8BA4"})})]}),d("style",{children:`
|
|
144
118
|
.file-manager-modal .ant-upload-wrapper,
|
|
145
119
|
.file-manager-modal .ant-upload-drag,
|
|
146
120
|
.file-manager-modal .ant-upload-drag-container {
|
|
@@ -148,4 +122,21 @@ import{jsx as $,jsxs as Y,Fragment as Ea}from"react/jsx-runtime";import*as l fro
|
|
|
148
122
|
height: 55px !important;
|
|
149
123
|
padding: 0 !important;
|
|
150
124
|
}
|
|
151
|
-
`})]})}function nu(){return Y("div",{className:"flex flex-col gap-8 p-4 w-full mx-auto",children:[Y("div",{className:"flex items-start gap-4",children:[$("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),$("div",{className:"flex-1",children:$(vn,{active:!0,paragraph:{rows:1}})})]}),Y("div",{className:"flex items-start gap-4",children:[$("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),$("div",{className:"flex-1",children:$(vn,{active:!0,paragraph:{rows:3}})})]}),Y("div",{className:"flex items-start gap-4",children:[$("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),$("div",{className:"flex-1",children:$(vn,{active:!0,paragraph:{rows:1}})})]}),Y("div",{className:"flex items-start gap-4",children:[$("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),$("div",{className:"flex-1",children:$(vn,{active:!0,paragraph:{rows:2}})})]})]})}function ru({msg:e,subMsg:n}){return Y("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-white/80 backdrop-blur-sm",children:[$("div",{className:"mb-6 animate-bounce",children:$(Si,{size:64,className:"text-[#d70016]"})}),$("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:e||"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25"}),$("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:n||"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),$(pt,{type:"primary",icon:$(Jo,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}function ou(){return Y("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-transparent! backdrop-blur-sm",children:[$("div",{className:"mb-6 animate-bounce",children:$(li,{size:64,className:"text-[#d70016]"})}),$("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:"\u62B1\u6B49\uFF0C\u9047\u5230\u4E86\u4E00\u4E9B\u95EE\u9898"}),$("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:"\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"}),$(pt,{type:"primary",icon:$(Jo,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}const au=1e3,iu=3e3,su=({isModalOpen:e,handleOk:n,handleCancel:t,data:r})=>{const o={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[a]=Vo();return je(()=>{if(!e){a.resetFields();return}a.setFieldValue("new_name",r==null?void 0:r.label)},[r,e]),$(Ko,{modal:{styles:o},children:$(Ar,{title:$("div",{className:"text-[16px]",children:"\u7F16\u8F91\u4F1A\u8BDD\u540D\u79F0"}),closeIcon:null,open:e,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:Y("div",{className:"mt-[16px] flex justify-end",children:[$(pt,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),$(pt,{children:"\u786E\u8BA4",onClick:async()=>{try{const i=await a.validateFields();n("ok_rename",i)}catch(i){console.log(i);return}},type:"primary",className:"border-none"})]}),children:$(Xr,{form:a,children:$(Xr.Item,{name:"new_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"},{max:100,message:"\u6700\u5927\u5B57\u6570\u9650\u5236100"}],children:$(ci,{})})})})})},lu=({isModalOpen:e,handleOk:n,handleCancel:t,data:r})=>{const o={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[a]=Vo();return je(()=>{if(!e){a.resetFields();return}a.setFieldValue("new_name",r==null?void 0:r.label)},[r,e]),$(Ko,{modal:{styles:o},children:$(Ar,{title:$("div",{className:"text-[16px]",children:"\u5220\u9664\u4F1A\u8BDD"}),closeIcon:null,open:e,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:Y("div",{className:"mt-[16px] flex justify-end",children:[$(pt,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),$(pt,{children:"\u786E\u8BA4",onClick:async()=>{try{const i=await a.validateFields();n("ok_remove",i)}catch(i){console.log(i);return}},type:"primary",className:"border-none"})]}),children:$("div",{children:`\u786E\u5B9A\u8981\u5220\u9664\u4F1A\u8BDD\u300C${r.label}\u300D\u5417\uFF1F\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D\u3002`})})})};function wu(e=fi){return function({token:t,url:r="http://localhost:8888",styles:o,CSRFToken:a,eventsEmit:i,...s}){const u=Ge(()=>ui({theme:Dr,mode:"light"},o),[o]),[d,f]=Ie(!1),[m,h]=Ie(!1),[x,w]=Ie(null),[c,p]=Ie([]),[C,b]=Ie(1),[I]=Ie(16),[S,y]=Ie(0),[F,D]=Ie(!1),[O,N]=Ie([]),[E,_]=Ie(void 0),[T,k]=Ie([]),[M,B]=Ie([]),[V,j]=Ie(void 0),[U,K]=Ie(!1),[L,q]=Ie({display:"ready",sender:"ready",app:"initializing"}),[ee,R]=Ie([]);function W(v,g){if(!g)return v;const P=Array.isArray(v)?[...v]:{...v};for(const A in g)g[A]!==void 0&&g[A]!==null&&Object.prototype.hasOwnProperty.call(g,A)&&(typeof v[A]=="object"&&v[A]!==null&&!Array.isArray(v[A])&&typeof g[A]=="object"&&g[A]!==null&&!Array.isArray(g[A])?P[A]=W(v[A],g[A]):P[A]=g[A]);return P}const[J,oe]=Ie(()=>W(bo,s.senderConfig));je(()=>{s.senderConfig&&oe(W(bo,s.senderConfig))},[s.senderConfig]);const[ae,Q]=Ie([]),[ie,Ce]=Ie(()=>({uploadedFiles:[]}));je(()=>{if(!E)return;const v=O.find(A=>A.id===E);let g=[],P=!1;if(v&&v.messages){const A=[...v.messages||[]].reverse().find(H=>H.istype==="ai");if(A!=null&&A.reference&&A.resultType===5){P=!0;try{g=JSON.parse(A.reference).map(X=>Ue(X))}catch{}}}P&&Ce({uploadedFiles:g})},[O]),je(()=>{Ce({uploadedFiles:[]})},[E]);const[xe,we]=Be.useState(()=>{var g;if(!M||M.length===0)return;const v=M.find(P=>P.isDefault);return v?v.id:(g=M[0])==null?void 0:g.id});Be.useEffect(()=>{if(!M||M.length===0)return;const v=M.some(g=>g.id===xe);if(!xe||!v){const g=M.find(P=>P.isDefault);we(g?g.id:M[0].id)}},[M]);const[Te,Je]=Ie({}),Le=Xe(void 0),ve=Xe(void 0),me=Xe(void 0);Xe({sessionId:""}),Xe(null);const[ct,mt]=Ie({}),[$t,It]=Ie(!1),[At,et]=Ie([]),qe=Xe(!1),{api_startChat_re:St,addEmptyMessage:kt,setLastEmptyMessage:Mt,stopStream:Et}=Gc({baseUrl:r,CSRFToken:a,token:t,setChatData:N,activeSessionId:E,setAppStatus:q,setConversationList:p}),Ae=Ge(()=>{const v={};return(M||[]).forEach(g=>{v[g.id]=g}),v},[M]),ce=Ge(()=>{const v=O.find(P=>P.id===E)||{id:E,messages:[]},g=v.configId?Ae[v.configId]:null;return{...v,assistantInfo:g}},[O,E,Ae]),nt=Ge(()=>{if(ce.configId&&Ae){const v=Ae[ce.configId];return v!=null&&v.configJson?JSON.parse(v.configJson).is_download:!1}else return!1},[ce.configId,Ae]),ut=Ge(()=>{if((ce.configId||V)&&Ae){const v=Ae[ce.configId];if(v!=null&&v.configJson){const g=JSON.parse(v.configJson);return console.log("is_enableThinking",ce.configId,Ae,V),!!g.thinking}else if(V){const g=Ae[V];if(g!=null&&g.configJson)return!!JSON.parse(g.configJson).thinking}}return!1},[ce.configId,Ae,V]);function ft(v,g){const P=new Map;return v.forEach(A=>P.set(A.uid,Ue(A))),g.forEach(A=>P.set(A.uid,Ue(A))),Array.from(P.values())}function Ue(v){if(!v||v.file&&v.file.name)return v;const g=v.name||v.fileName||"";return{...v,url:v.filePath||"",uid:v.uid||"",file:{name:g,size:typeof v.size=="string"&&v.size.endsWith("MB")?Number(v.size.replace("MB",""))*1024*1024:v.size||0,type:v.type||""},name:g}}je(()=>{if(Le.current&&Le.current!==E){const g=Le.current,P=c.find(X=>X.sessionId===g&&X.isNew),A=O.find(X=>X.id===g&&X.isNew),H=A&&A.messages&&A.messages.length>0;P&&!H&&(p(X=>X.filter(ge=>ge.sessionId!==g)),N(X=>X.filter(ge=>ge.id!==g)))}Le.current=E;const v=ce.messages&&ce.messages.length>0?ce.messages[ce.messages.length-1].recommendQuestion:[];k(v)},[E,c,O,ce.messages]);const We=async v=>{var g,P,A,H;if(!F){D(!0);try{const X=await rt.get(`${r}/qa/dialogue/list?pageNo=${v}&pageSize=${I}&sysType=INT_SESSION`,{headers:{Authorization:t}}),ge=((P=(g=X==null?void 0:X.data)==null?void 0:g.data)==null?void 0:P.records)||[],te=((H=(A=X==null?void 0:X.data)==null?void 0:A.data)==null?void 0:H.total)||0;y(te),p(he=>{const Se=new Map;return[...he,...ge].forEach(z=>{Se.set(z.sessionId,z)}),Array.from(Se.values())}),b(v)}catch{}finally{D(!1)}}};je(()=>{q(v=>({...v,app:"initializing"})),rt.get(`${r}/qa/search/config/helper/list?pageNo=1&pageSize=3000`,{headers:{Authorization:t}}).then(v=>{B(v.data.data||[])}).catch(()=>{}),We(1).then(()=>{E||Ft(),q(v=>({...v,app:"ready"}))}).catch(()=>{q(v=>({...v,app:"error"}))})},[r,t]),je(()=>{E&&(q(v=>({...v,display:"loading"})),rt.get(`${r}/qa/dialogue/getDialogBySessionId?sessionId=${E}`,{headers:{Authorization:t}}).then(v=>{var He;if(!v.data.data){q(ue=>({...ue,display:"ready"}));return}const g=((He=v.data.data)==null?void 0:He.queryReplyPairList)||[],P=Oc(g),{sessionId:A,searchConfigDTO:H,filePath:X,configId:ge,reference:te,webReference:he,uploadedFiles:Se,fileList:z,currentFiles:ye}=v.data.data;if(P.length>0){const ue=P.length-1-[...P].reverse().findIndex(de=>de.istype==="ai");ue>=0&&ue<P.length&&P[ue].istype==="ai"&&(te&&(P[ue].reference=te),he&&(P[ue].webReference=he))}const fe=ye||z||Se;if(fe&&P.length>0){const ue=[...P].reverse().findIndex(de=>de.istype==="user");ue!==-1&&(console.log(P[P.length-1-ue].currentFiles,"filesData"),P[P.length-1-ue].currentFiles=fe)}c.find(ue=>ue.sessionId===A)&&p(ue=>ue.map(de=>de.sessionId===A?{...de,searchConfigDTO:H,filePath:X,configId:ge}:de));const le={configId:v.data.data.configId,filePath:v.data.data.filePath,searchConfigDTO:v.data.data.searchConfigDTO||{},sessionId:v.data.data.sessionId,label:v.data.data.label,kbId:v.data.data.kbId};N(ue=>{const de=ue.filter(Pe=>Pe.id!==E);return[{id:E,messages:P,...le},...de]}),q(ue=>({...ue,display:"ready"}))}).catch(v=>{console.error("\u83B7\u53D6\u804A\u5929\u6570\u636E\u5931\u8D25:",v),v.response&&v.response.status===404&&Ft(),q(g=>({...g,display:"error"}))}))},[E,r,t]),je(()=>{const v=ie.uploadedFiles.length;oe(g=>{const P=Array.isArray(g.actions)?g.actions:[];return{...g,actions:P.map(H=>H.name==="history"?{...H,badgeCount:v}:H)}})},[ie.uploadedFiles]),je(()=>{Dc({url:r,token:t},v=>{et(v)})},[]),Be.useEffect(()=>{ae.length&&N(v=>{if(!v[0])return v;const{messages:g}=v[0];for(let P=g.length-1;P>=0;P--)if(g[P].istype==="user"){const A=g[P].currentFiles||[];g[P].currentFiles=ae.map(H=>{var ge,te,he;const X=A.find(Se=>Se.uid===H.uid);return{name:((ge=H.file)==null?void 0:ge.name)||H.name,size:((te=H.file)==null?void 0:te.size)||H.size,type:((he=H.file)==null?void 0:he.type)||H.type,status:H.status,uid:H.uid,url:H.url||(X==null?void 0:X.url)||""}});break}return[...v]})},[ae]);let G=null,pe=null;const Fe=(v,g,P,A)=>{const H=v.join(",");let X=0;pe=()=>{qe.current=!0};const ge=async()=>{if(!qe.current){if(X>=au){qe.current||A("\u6587\u4EF6\u89E3\u6790\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");return}X++;try{const te=await rt.get(`${r}/index/knowledgeBase/file/getFileStatusByUids?uids=${H}`,{headers:{Authorization:t}});if(qe.current)return;if(te.data.success){const he=te.data.data;qe.current||g(he),he.every(z=>z.status===3)?qe.current||P():qe.current||setTimeout(ge,iu)}else qe.current||A(te.data.errorMsg||"\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u5931\u8D25")}catch{if(qe.current)return;A("\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u65F6\u53D1\u751F\u7F51\u7EDC\u9519\u8BEF")}}};ge()},se=(v,g)=>{N(P=>{const A=[...P];return A[0]&&(A[0]={...A[0],messages:A[0].messages.map(H=>H.queryId===v?{...H,feedbackResult:g}:H)}),A})},be=async v=>{var g,P;if(v)try{const A=(ce==null?void 0:ce.configId)||((g=Ae==null?void 0:Ae[(ce==null?void 0:ce.configId)||""])==null?void 0:g.id)||"",H=await rt.get(`${r}/qa/ai/recommendQuestion?queryId=${v}&configId=${A||""}`.replace(/\?&/,"?"),{headers:{Authorization:t}});k(((P=H.data)==null?void 0:P.data)||[])}catch{k([])}};function _e(v){const{content:g,audioUrl:P,filePaths:A,queryId:H}=v;if(!E||!H)return;const X=(ce==null?void 0:ce.messages)||[],ge=X.findIndex(fe=>(fe==null?void 0:fe.queryId)===H&&((fe==null?void 0:fe.istype)==="ai"||(fe==null?void 0:fe.isUser)===!1));let te;if(ge>0)for(let fe=ge-1;fe>=0;fe-=1){const Ne=X[fe];if((Ne==null?void 0:Ne.istype)==="user"||(Ne==null?void 0:Ne.isUser)===!0){te=Ne;break}}const he=(te==null?void 0:te.content)??g;if(!he)return;const Se=(te==null?void 0:te.filePaths)??A,z=(typeof Se=="string"&&Se?JSON.parse(Se):Se||[]).map(fe=>fe.uid),ye=Date.now();Mt({now:ye}),q(fe=>({...fe,display:"processing",sender:"processing"})),v.clearFn&&v.clearFn(),p(fe=>fe.map(Ne=>Ne.sessionId===E?{...Ne,gmtModified:ye}:Ne)),St({configId:ce.configId,content:he,fileUids:z,lastDate:ye,name:ce.label||"",queryId:H,sessionId:String(E||""),type:(te==null?void 0:te.audioUrl)??P?"audioUrl":"text",audioUrl:((te==null?void 0:te.audioUrl)??P)||"",enableThinking:!!Te.reasoning,enableWebsearch:!!Te.netSearch,qaChannel:Te.qaChannel},fe=>{be(H)})}async function at(v,g){if(!E)return;const P=c.find(A=>A.sessionId===E);if(P&&P.isNew){let A=!1;const H=V||P.configId,X=v&&v.content?v.content.slice(0,20):P.label||"\u672A\u547D\u540D\u4F1A\u8BDD";if(await new Promise((ge,te)=>{kc({url:r,token:t,CSRFToken:a},{label:X,sessionId:P.sessionId,sysType:"INT_SESSION",configId:H},he=>{he&&he.data&&he.data.sessionId?(p(Se=>Se.map(z=>z.sessionId===P.sessionId?{...z,isNew:!1,configId:H,label:X}:z)),N(Se=>Se.map(z=>z.id===P.sessionId?{...z,isNew:!1,configId:H,label:X}:z)),A=!0,ge()):(Re.error("\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),te())})}),!A)return;dt(E,v,g,H);return}dt(E,v,g)}function dt(v,g,P,A){const H="query-"+Ht(32),X=c.find(z=>z.sessionId===v),ge=A||(X==null?void 0:X.configId)||ce.configId;console.log("\u52A9\u624B\u914D\u7F6E\u8BE6\u60C5",ge);const te=g&&g.content?g.content.slice(0,20):"\u672A\u547D\u540D\u4F1A\u8BDD";let he;if(g.files&&g.files.length>0&&(he=g.files.map(z=>({name:z.file.name,size:z.file.size,type:z.file.type,filePath:z.filePath||"",convertedFilePath:z.convertedFilePath||"",uid:z.uid||""}))),console.log("\u672C\u5730\u6587\u4EF6\u4E0A\u4F20",g.files),kt({content:g.content||g.text||"",queryId:H,currentFiles:he,filePaths:he?JSON.stringify(he):void 0}),p(z=>z.map(ye=>ye.sessionId===v&&ye.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&ye.isNew?{...ye,label:te,gmtModified:Date.now(),isNew:!1}:ye)),N(z=>z.map(ye=>ye.id===v&&ye.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&ye.isNew?{...ye,label:te,isNew:!1}:ye)),g.files&&g.files.length>0){q(le=>({...le,sender:"uploading",display:"uploading"})),G=new AbortController,qe.current=!1;const z=g.files.map(()=>`rc-upload-${Date.now()}-${Math.random().toString(36).slice(2)}`),ye=g.files.map((le,He)=>({...le,uid:z[He],status:"uploading"}));Q(ye);const fe=new FormData;g.files.forEach(le=>{fe.append("files",le.file)});const Ne=String(v||"");fe.append("sessionId",Ne),fe.append("uids",z.join(",")),rt.post(`${r}/index/knowledgeBase/file/uploadFiles`,fe,{headers:{Authorization:t,"Content-Type":"multipart/form-data"},signal:G.signal}).then(le=>{if(console.log("\u6587\u4EF6\u4E0A\u4F20\u7684\u6253\u5370\u7ED3\u679C",le),!qe.current)if(le.data.success&&Array.isArray(le.data.data)&&le.data.data.length>0){Q(de=>de.map($e=>{const Pe=le.data.data.find(Oe=>Oe.uid===$e.uid);return Pe?{...$e,...Pe}:$e})),q(de=>({...de,sender:"processing",display:"analyzing"})),Q(de=>de.map($e=>({...$e,status:"parsing"})));const He=le.data.data,ue=He.map(de=>de.uid);Fe(ue,de=>{if(Q(Pe=>Pe.map(Oe=>{const Dt=de.find(yt=>yt.uid===Oe.uid);if(Dt)switch(Dt.status){case 3:return{...Oe,status:"done"};case 4:return{...Oe,status:"error"};case 1:case 2:default:return{...Oe,status:"parsing"}}return Oe})),de.length>0&&de.every(Pe=>Pe.status===3)){Q([]);const Pe=new Map;(de||[]).forEach(Oe=>{Pe.set(Oe.id,Oe)}),Ce(Oe=>({uploadedFiles:ft(Oe.uploadedFiles,He).map(yt=>{var _t;return{...yt,pdfPages:((_t=Pe.get(yt.id))==null?void 0:_t.pdfPages)||0}})}))}},()=>{P==null||P(),q($e=>({...$e,sender:"processing",display:"processing"})),Q($e=>$e.map(Pe=>{const Oe=He.find(Dt=>Dt.uid===Pe.uid);return Oe?{...Pe,...Oe,url:Oe.filePath,filePath:Oe.filePath,name:Oe.fileName||Pe.name,convertedFilePath:Oe.convertedFilePath||Pe.convertedFilePath}:Pe})),N($e=>{if(!$e[0])return $e;const{messages:Pe}=$e[0];for(let Oe=Pe.length-1;Oe>=0;Oe--)if(Pe[Oe].istype==="user"){const Dt=Pe[Oe].currentFiles||[];Pe[Oe].currentFiles=Dt.map(yt=>{const _t=He.find(ke=>ke.uid===yt.uid);return _t?{...yt,..._t}:yt});break}return[...$e]});const de=Date.now();St({configId:ge,content:g.content||g.text||"",fileUids:ue,lastDate:de,name:te,queryId:H,sessionId:String(v||""),type:"text",audioUrl:"",enableThinking:!!Te.reasoning,enableWebsearch:!!Te.netSearch,qaChannel:Te.qaChannel},$e=>{be(H)})},de=>{q($e=>({...$e,display:"ready",sender:"ready"})),Q($e=>$e.map(Pe=>({...Pe,status:"error",message:de})))})}else{const He=le.data.errorMsg||"\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25";q(ue=>({...ue,display:"error",sender:"ready"})),Q(ue=>ue.map(de=>({...de,status:"error",message:He})))}}).catch(le=>{var He,ue;((He=le==null?void 0:le.response)==null?void 0:He.status)===413?(ue=le==null?void 0:le.response)!=null&&ue.statusText.includes("Request Entity Too Large")&&Re.error("\u6587\u4EF6\u8D85\u8FC7\u6700\u5927\u53EF\u4E0A\u4F20\u9650\u5236"):Re.error("\u7F51\u7EDC\u9519\u8BEF"),q(de=>({...de,display:"error",sender:"ready"})),Q(de=>de.map($e=>({...$e,status:"error",message:"\u7F51\u7EDC\u9519\u8BEF"})))});return}q(z=>({...z,display:"processing",sender:"processing"}));const Se=Date.now();p(z=>z.map(ye=>ye.sessionId===v?{...ye,gmtModified:Se}:ye)),P==null||P(),St({configId:ge,content:g.content||g.text||"",fileUids:[],lastDate:Se,name:te,queryId:H,sessionId:String(v||""),type:"text",audioUrl:"",enableThinking:!!Te.reasoning,enableWebsearch:!!Te.netSearch,qaChannel:Te.qaChannel},z=>{be(H)})}function tt(v){v.restult==1?nr({url:r,token:t,CSRFToken:a},{queryId:v.queryId},()=>{se(v.queryId,null)}):Eo({url:r,token:t,CSRFToken:a},{restult:1,queryId:v.queryId},()=>{se(v.queryId,1)})}function Ft(v){const g=Ht(32),P={sessionId:g,label:"\u672A\u547D\u540D\u4F1A\u8BDD",gmtModified:Date.now(),searchConfigDTO:{},filePath:"",configId:"",isNew:!0};p(A=>[{...P,messages:[]},...A]),N(A=>[{id:g,messages:[],...P},...A]),_(g)}const pn=v=>{var H;const g=new Set([...ie.uploadedFiles.map(X=>X.file.name),...ee.map(X=>X.file.name)]),P=[],A=new Set;Array.from(v).forEach(X=>{g.has(X.name)?A.add(X.name):(P.push({file:X,type:So(X.name),status:"pending",preview:X.type.startsWith("image")?URL.createObjectURL(X):void 0}),g.add(X.name))}),A.size>0&&Re.warning(`\u4E0D\u80FD\u4E0A\u4F20\u540C\u540D\u6587\u4EF6: ${Array.from(A).join(", ")}`),P.length>0&&(R(X=>[...X,...P]),(H=ve.current)==null||H.call(ve,P))},Rn=(v,g,P)=>{var A;(A=me.current)==null||A.call(me,v,g,P)};function mn(v){if(v!=null&&v.sessionId&&v.sessionId!==E){_(v.sessionId),q(P=>({...P,sender:"ready"}));const g=O.find(P=>P.id===v.sessionId);if(g&&g.messages&&g.messages.length>0){const P=[...g.messages].reverse().find(A=>A.istype==="ai");P&&P.recommendQuestion?k(P.recommendQuestion):k([])}else k([])}}const bt=async v=>new Promise((g,P)=>{Ac({url:r,token:t,CSRFToken:a},{sessionId:v},A=>{A?(Re.success("\u5220\u9664\u6210\u529F!"),g(A)):(Re.error("\u5220\u9664\u5931\u8D25!"),P(A))})}),Bn=async()=>{try{return p([]),y(0),await We(1),[]}catch(v){throw Re.error("\u5237\u65B0\u4F1A\u8BDD\u5217\u8868\u5931\u8D25"),v}},Tn=async(v,g)=>new Promise((P,A)=>{Pc({url:r,token:t,CSRFToken:a},{label:g,sessionId:v},H=>{if(H){const X=Date.now();p(ge=>ge.map(te=>te.sessionId===v?{...te,label:g,gmtModified:X}:te)),Re.success("\u91CD\u547D\u540D\u6210\u529F!"),P(H)}else Re.error("\u91CD\u547D\u540D\u5931\u8D25"),A(H)})}),fn=v=>{p(g=>{const P=g.filter(A=>A.sessionId!==v);return E===v&&(P.length>0?_(P[0].sessionId):Ft()),P})},_n=(v,g)=>{const P=Date.now();p(A=>A.map(H=>H.sessionId===v?{...H,label:g,gmtModified:P}:H))},zn=v=>{Eo({url:r,token:t,CSRFToken:a},{...v,...ct,restult:0},()=>{se(ct.queryId,0)})},jn=v=>{const g=v.new_name,P=x.data.label;g&&g!==P?x.async_renameConversation(g).then(()=>{x.fn_renameItemInList(g),f(!1)}).catch(()=>{}):f(!1)},gn=v=>{x.async_deleteConversation().then(()=>{x.fn_removeItemFromList(),h(!1)}).catch(()=>{})},Nt=(v,g)=>{switch(console.log(v,g),v){case"close_remove":h(!1);break;case"close_rename":f(!1);break;case"ok_rename":jn(g);break;case"ok_remove":gn();break}},Ln=async({url:v,params:g,replacePredataFunction:P})=>{var A,H;try{const X=await rt.post(v,g,{headers:{Authorization:t}}),ge=(H=(A=X==null?void 0:X.data)==null?void 0:A.data)==null?void 0:H.data;ge&&P(ge)}catch(X){console.log("error",X)}},gt=(v,g)=>{var P,A,H;switch(console.log(`[Event] ${v}`,g),v){case"conversations:load_more":{c.length<S&&!F&&We(C+1);break}case"retrieve-sql-data:pagingation_click":const{page:X,pageSize:ge,fetchUrl:te,source:he,replacePredataFunction:Se}=g;Ln({url:`${r}${te}`,replacePredataFunction:Se,params:{pageNo:X,pageSize:ge,convertedFilePath:he,stream:!1}});break;case"web_referenceFile_title:click":if(!((P=g==null?void 0:g.data)!=null&&P.link))return console.error("\u6CA1\u6709\u7F51\u9875\u5730\u5740");window.open(g.data.link,"_blank");break;case"conversation:item_click":mn(g);break;case"files:finished_animation_complete":Q([]);break;case"conversation:create":Ft();break;case"conversation:new_assistant_change":j(g.assistantId);break;case"conversations:rename_icon_clicked":w({data:g,async_renameConversation:z=>Tn(g.sessionId,z),fn_renameItemInList:z=>_n(g.sessionId,z)}),f(!0);break;case"conversations:delete_icon_clicked":w({data:g,async_deleteConversation:()=>bt(g.sessionId),async_refreshConversationList:Bn,fn_removeItemFromList:()=>fn(g.sessionId)}),h(!0);break;case"sender:send":at(g,g.clearFn);break;case"sender:send_recommandQuestion":{const z=((g==null?void 0:g.content)??"").toString();if(!z)break;at({content:z},()=>{});break}case"chatbox:follow_up_question_click":{const z=((g==null?void 0:g.question)??(g==null?void 0:g.content)??"").toString();if(!z)break;at({content:z},()=>{});break}case"sender:action_history":K(!0);break;case"sender:stop":qe.current=!0,G&&(G.abort(),G=null),pe&&(pe(),pe=null),q(z=>({...z,display:"ready",sender:"ready"})),Q([]),Et==null||Et();break;case"sender:clear":(A=g.clearFn)==null||A.call(g);break;case"sender:configChange":g&&g.all&&Je(g.all);break;case"action_copy:click":g&&Nc(g.content,g.event);break;case"chatbox:copy":{const z=(g==null?void 0:g.content)||"";if(!z)break;const ye=async Ne=>{try{return await navigator.clipboard.writeText(Ne),Re.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F"),!0}catch{return!1}},fe=Ne=>{const le=document.createElement("textarea");le.value=Ne,le.style.position="fixed",le.style.opacity="0",document.body.appendChild(le),le.focus(),le.select();try{document.execCommand("copy"),Re.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F")}catch{Re.error("\u590D\u5236\u5931\u8D25")}document.body.removeChild(le)};ye(z).then(Ne=>{Ne||fe(z)});break}case"chatbox:repeat":console.log(g,"sdkflskdjflksdjfklsdjlfkjsdklfjsdklfjlks"),_e(g);break;case"action_thumbsup":tt(g);break;case"chatbox:like":tt({queryId:g==null?void 0:g.queryId,restult:g==null?void 0:g.result});break;case"action_thumbsdown":g.restult===0?nr({url:r,token:t,CSRFToken:a},{queryId:g.queryId},()=>{se(g.queryId,null)}):(mt(g),It(!0));break;case"chatbox:dislike":(g==null?void 0:g.result)===0?nr({url:r,token:t,CSRFToken:a},{queryId:g.queryId},()=>{se(g.queryId,null)}):(mt({queryId:g==null?void 0:g.queryId}),It(!0));break;case"action_retrive_tag":i==null||i("action_retrive_tag",g);break;case"referenceFile_view":i==null||i("referenceFile_view",g);break;case"referenceFile_question":console.log(g,"zhezhhzhzh"),i==null||i("referenceFile_question",g);break;case"referenceFile_download":i==null||i("referenceFile_download",g);break;case"retrive_tag:click":i==null||i("retrive_tag:click",g);break;case"fileManager:change":{const z=Array.isArray(g==null?void 0:g.uploadedFiles)?g.uploadedFiles:[];R(z),typeof(g==null?void 0:g.setUploadedFiles)=="function"&&(ve.current=g.setUploadedFiles,me.current=g.removeFile);break}case"uploaded_file:removeFromTemp":{console.log("[DEBUG] mergedEventsEmit uploaded_file:removeFromTemp \u4E8B\u4EF6",g);const z=(H=g==null?void 0:g.file)==null?void 0:H.uid;if(!z){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6",g);break}const ye=[...ce.messages||[]].reverse().find(Ne=>Ne.istype==="user"),fe=ye==null?void 0:ye.queryId;Mc({url:r,token:t,CSRFToken:a},{uid:z,queryId:fe},(Ne,le)=>{if(Ne){if(Re.success("\u6587\u4EF6\u5DF2\u4ECE\u4E34\u65F6\u77E5\u8BC6\u5E93\u79FB\u9664"),le&&Array.isArray(le.data&&le.data.data)){const He=le.data.data.map(ue=>{var $e;const de=ue.name||ue.fileName||"";return{file:{name:de,size:Number(($e=ue.size)==null?void 0:$e.replace("MB",""))*1024*1024||0,type:ue.type},type:So(de),status:"uploaded",url:ue.filePath,convertedFilePath:ue.convertedFilePath,uid:ue.uid,preview:ue.type==="image"?ue.filePath:void 0}});Ce({uploadedFiles:He})}}else console.log("[DEBUG] removeFilefromTempUpload \u56DE\u8C03 false\uFF0Cres:",le),Re.error("\u6587\u4EF6\u79FB\u9664\u5931\u8D25")});break}case"uploaded_file:remove_batch":break;default:i==null||i(v,g)}},Ot=[{key:"conversations",type:"custom",label:"\u5BF9\u8BDD\u5386\u53F2",icon:$(Ii,{size:16}),enabled:!0,component:$(Fc,{data:c,assistantList:M,activedItem:E||"",hasMore:c.length<S,loadingMore:F,sortRules:[{label:"\u5F53\u5929",dayPeriod:1},{label:"3\u5929",dayPeriod:3},{label:"7\u5929",dayPeriod:7},{label:"30\u5929",dayPeriod:30}],eventsEmit:gt,styles:u.theme})}],Qt=Be.useMemo(()=>()=>$(jc,{eventsEmit:gt,assistantList:M,styles:u,selectedId:xe,onSelectAssistant:we}),[xe]),qn={...Be.useMemo(()=>({AiChatBox:(v,g)=>{var he,Se;const P=g===(((he=ce==null?void 0:ce.messages)==null?void 0:he.length)||0)-1;let A="ready";if(P)if(v.status!==void 0)switch(v.status){case 0:A="thinking";break;case 1:A="processing";break;case 2:A="ready";break;case 3:A="error";break;default:A=L.display}else A=L.display;let H=[];if(Array.isArray(T))H=T;else if(typeof T=="string")try{H=JSON.parse(T)||[]}catch{H=[]}const X=(()=>{const z=v==null?void 0:v.reference;if(!z)return"[]";if(typeof z=="string")try{return JSON.parse(z),z}catch{return"[]"}try{return JSON.stringify(z)}catch{return"[]"}})(),ge=(()=>{const z=v==null?void 0:v.webReference;if(!z)return"[]";if(typeof z=="string")try{return JSON.parse(z),z}catch{return"[]"}try{return JSON.stringify(z)}catch{return"[]"}})(),te=(()=>{const z=v==null?void 0:v.graphReference;if(!z)return"[]";if(typeof z=="string")try{return JSON.parse(z),z}catch{return"[]"}try{return JSON.stringify(z)}catch{return"[]"}})();return $(Gr,{...v,reference:X,webReference:ge,graphReference:te,contentType:"stream",displayStatus:A,eventsEmit:gt,isLast:P&&(v==null?void 0:v.istype)==="ai",followUpQuestions:P&&(v==null?void 0:v.istype)==="ai"?H:[],defaultAnswer:((Se=ce==null?void 0:ce.searchConfigDTO)==null?void 0:Se.defaultAnswer)||"\u4E0D\u77E5\u9053\u4EC0\u4E48\u539F\u56E0\u6211\u4EEC\u6CA1\u80FD\u67E5\u5230\u4F60\u8981\u7684\u95EE\u9898*-*",is_download:nt,styles:u},`${(v==null?void 0:v.queryId)||(v==null?void 0:v.id)||g}-${(v==null?void 0:v.istype)||"unknown"}`)},LogoBox:v=>v&&v.LogoBox===null?null:v&&typeof v.LogoBox=="function"?$(v.LogoBox,{}):$("div",{className:"text-2xl w-full text-center font-bold",children:"\u5C0F\u9CB8\u667A\u80FD\u52A9\u624B"}),DisplayLoading:()=>$(nu,{}),DisplayError:()=>$(ou,{}),AppError:()=>$(ru,{msg:"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25",subMsg:"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),AppLoading:()=>$(gi,{}),UserChatBox:(v,g)=>$(Gr,{...v,contentType:"plainText",isUser:!0,displayStatus:"ready",eventsEmit:gt,styles:u,fileManagerData:ie},`${(v==null?void 0:v.queryId)||(v==null?void 0:v.id)||g}-user`),WelcomeComponent:Qt}),[Qt,ce,L.display,gt,u,nt,ie]),...s.CustomComponents||{}};return je(()=>{oe(v=>{const g=Array.isArray(v.switchs)?v.switchs.map(P=>P.name==="reasoning"?{...P,enabled:ut}:P):[];return{...v,switchs:g}})},[ut]),Y(Ea,{children:[$(tu,{open:U,onCancel:()=>K(!1),files:ie.uploadedFiles,currentFiles:ee,onUpload:pn,onRemoveFile:Rn,styles:u,eventsEmit:gt}),$(e,{...s,status:L,chatData:ce,sidebar:Ot,recommandQuestions:[],eventsEmit:gt,styles:u,senderConfig:J,fileUploadStatus:ae,CustomComponents:qn,activeSessionId:E}),$(hi,{open:$t,feedBackList:At,setOpen:It,handleConfirm:zn}),$(su,{isModalOpen:d,handleOk:Nt,handleCancel:()=>Nt("close_rename"),data:(x==null?void 0:x.data)||{}}),$(lu,{isModalOpen:m,handleOk:Nt,handleCancel:()=>Nt("close_remove"),data:(x==null?void 0:x.data)||{}})]})}}export{wu as default};
|
|
125
|
+
`})]})}function Ds(){return R("div",{className:"flex flex-col gap-8 p-4 w-full mx-auto",children:[R("div",{className:"flex items-start gap-4",children:[d("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),d("div",{className:"flex-1",children:d(It,{active:!0,paragraph:{rows:1}})})]}),R("div",{className:"flex items-start gap-4",children:[d("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),d("div",{className:"flex-1",children:d(It,{active:!0,paragraph:{rows:3}})})]}),R("div",{className:"flex items-start gap-4",children:[d("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),d("div",{className:"flex-1",children:d(It,{active:!0,paragraph:{rows:1}})})]}),R("div",{className:"flex items-start gap-4",children:[d("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),d("div",{className:"flex-1",children:d(It,{active:!0,paragraph:{rows:2}})})]})]})}function Is({msg:e,subMsg:t}){return R("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-white/80 backdrop-blur-sm",children:[d("div",{className:"mb-6 animate-bounce",children:d(co,{size:64,className:"text-[#d70016]"})}),d("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:e||"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25"}),d("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:t||"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),d(Xe,{type:"primary",icon:d(on,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}function $s(){return R("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-transparent! backdrop-blur-sm",children:[d("div",{className:"mb-6 animate-bounce",children:d(Xn,{size:64,className:"text-[#d70016]"})}),d("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:"\u62B1\u6B49\uFF0C\u9047\u5230\u4E86\u4E00\u4E9B\u95EE\u9898"}),d("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:"\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"}),d(Xe,{type:"primary",icon:d(on,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}const As=1e3,Ns=3e3,ks=({isModalOpen:e,handleOk:t,handleCancel:r,data:n})=>{const o={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[a]=en();return Se(()=>{if(!e){a.resetFields();return}a.setFieldValue("new_name",n==null?void 0:n.label)},[n,e]),d(tn,{modal:{styles:o},children:d(sr,{title:d("div",{className:"text-[16px]",children:"\u7F16\u8F91\u4F1A\u8BDD\u540D\u79F0"}),closeIcon:null,open:e,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:R("div",{className:"mt-[16px] flex justify-end",children:[d(Xe,{children:"\u53D6\u6D88",onClick:r,className:"mr-[8px]"}),d(Xe,{children:"\u786E\u8BA4",onClick:async()=>{try{const s=await a.validateFields();t("ok_rename",s)}catch(s){console.log(s);return}},type:"primary",className:"border-none"})]}),children:d(fr,{form:a,children:d(fr.Item,{name:"new_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"},{max:100,message:"\u6700\u5927\u5B57\u6570\u9650\u5236100"}],children:d(Jn,{})})})})})},Os=({isModalOpen:e,handleOk:t,handleCancel:r,data:n})=>{const o={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[a]=en();return Se(()=>{if(!e){a.resetFields();return}a.setFieldValue("new_name",n==null?void 0:n.label)},[n,e]),d(tn,{modal:{styles:o},children:d(sr,{title:d("div",{className:"text-[16px]",children:"\u5220\u9664\u4F1A\u8BDD"}),closeIcon:null,open:e,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:R("div",{className:"mt-[16px] flex justify-end",children:[d(Xe,{children:"\u53D6\u6D88",onClick:r,className:"mr-[8px]"}),d(Xe,{children:"\u786E\u8BA4",onClick:async()=>{try{const s=await a.validateFields();t("ok_remove",s)}catch(s){console.log(s);return}},type:"primary",className:"border-none"})]}),children:d("div",{children:`\u786E\u5B9A\u8981\u5220\u9664\u4F1A\u8BDD\u300C${n.label}\u300D\u5417\uFF1F\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D\u3002`})})})};function Xs(e=Zn){return function({token:r,url:n="http://localhost:8888",styles:o,CSRFToken:a,eventsEmit:s,scrollOld:c,...p}){const m=Ae(()=>Kn({theme:or,mode:"light"},o),[o]),[y,v]=ue(!1),[x,w]=ue(!1),[C,i]=ue(null),[f,g]=ue([]),[h,E]=ue(1),[D]=ue(16),[b,A]=ue(0),[k,T]=ue(!1),[N,$]=ue([]),[_,H]=ue(void 0),[z,L]=ue([]),[M,Q]=ue([]),[U,V]=ue(void 0),[X,q]=ue(!1),[ee,Y]=ue({display:"ready",sender:"ready",app:"initializing"}),[j,K]=ue([]);function le(u,l){if(!l)return u;const I=Array.isArray(u)?[...u]:{...u};for(const S in l)l[S]!==void 0&&l[S]!==null&&Object.prototype.hasOwnProperty.call(l,S)&&(typeof u[S]=="object"&&u[S]!==null&&!Array.isArray(u[S])&&typeof l[S]=="object"&&l[S]!==null&&!Array.isArray(l[S])?I[S]=le(u[S],l[S]):I[S]=l[S]);return I}const[we,Ie]=ue(()=>le(Er,p.senderConfig));Se(()=>{p.senderConfig&&Ie(le(Er,p.senderConfig))},[p.senderConfig]);const[Ne,xe]=ue([]),[Be,_e]=ue(()=>({uploadedFiles:[]}));Se(()=>{if(!_)return;const u=N.find(S=>S.id===_);let l=[],I=!1;if(u&&u.messages){const S=[...u.messages||[]].reverse().find(B=>B.istype==="ai");if(S!=null&&S.reference&&S.resultType===5){I=!0;try{l=JSON.parse(S.reference).map(P=>ut(P))}catch{}}}I&&_e({uploadedFiles:l})},[N]),Se(()=>{_e({uploadedFiles:[]})},[_]);const[he,Qe]=Ge.useState(()=>{var l;if(!M||M.length===0)return;const u=M.find(I=>I.isDefault);return u?u.id:(l=M[0])==null?void 0:l.id});Ge.useEffect(()=>{if(!M||M.length===0)return;const u=M.some(l=>l.id===he);if(!he||!u){const l=M.find(I=>I.isDefault);Qe(l?l.id:M[0].id)}},[M]);const[Pe,Ze]=ue({}),ye=Le(void 0),qe=Le(void 0),ot=Le(void 0);Le({sessionId:""}),Le(null);const[lt,gt]=ue({}),[Bt,ht]=ue(!1),[Et,_t]=ue([]),Me=Le(!1),{api_startChat_re:yt,addEmptyMessage:Tt,setLastEmptyMessage:Pt,stopStream:vt}=bs({baseUrl:n,CSRFToken:a,token:r,setChatData:$,activeSessionId:_,setAppStatus:Y,setConversationList:g}),Te=Ae(()=>{const u={};return(M||[]).forEach(l=>{u[l.id]=l}),u},[M]),Z=Ae(()=>{const u=N.find(I=>I.id===_)||{id:_,messages:[]},l=u.configId?Te[u.configId]:null;return{...u,assistantInfo:l}},[N,_,Te]),ct=Ae(()=>{if(Z.configId&&Te){const u=Te[Z.configId];return u!=null&&u.configJson?JSON.parse(u.configJson).is_download:!1}else return!1},[Z.configId,Te]),bt=Ae(()=>{if((Z.configId||U)&&Te){const u=Te[Z.configId];if(u!=null&&u.configJson){const l=JSON.parse(u.configJson);return console.log("is_enableThinking",Z.configId,Te,U),!!l.thinking}else if(U){const l=Te[U];if(l!=null&&l.configJson)return!!JSON.parse(l.configJson).thinking}}return!1},[Z.configId,Te,U]);function Mt(u,l){const I=new Map;return u.forEach(S=>I.set(S.uid,ut(S))),l.forEach(S=>I.set(S.uid,ut(S))),Array.from(I.values())}function ut(u){if(!u||u.file&&u.file.name)return u;const l=u.name||u.fileName||"";return{...u,url:u.filePath||"",uid:u.uid||"",file:{name:l,size:typeof u.size=="string"&&u.size.endsWith("MB")?Number(u.size.replace("MB",""))*1024*1024:u.size||0,type:u.type||""},name:l}}Se(()=>{if(ye.current&&ye.current!==_){const l=ye.current,I=f.find(P=>P.sessionId===l&&P.isNew),S=N.find(P=>P.id===l&&P.isNew),B=S&&S.messages&&S.messages.length>0;I&&!B&&(g(P=>P.filter(se=>se.sessionId!==l)),$(P=>P.filter(se=>se.id!==l)))}ye.current=_;const u=Z.messages&&Z.messages.length>0?Z.messages[Z.messages.length-1].recommendQuestion:[];L(u)},[_,f,N,Z.messages]);const J=async u=>{var l,I,S,B;if(!k){T(!0);try{const P=await je.get(`${n}/qa/dialogue/list?pageNo=${u}&pageSize=${D}&sysType=INT_SESSION`,{headers:{Authorization:r}}),se=((I=(l=P==null?void 0:P.data)==null?void 0:l.data)==null?void 0:I.records)||[],G=((B=(S=P==null?void 0:P.data)==null?void 0:S.data)==null?void 0:B.total)||0;A(G),g(pe=>{const ge=new Map;return[...pe,...se].forEach(O=>{ge.set(O.sessionId,O)}),Array.from(ge.values())}),E(u)}catch{}finally{T(!1)}}};Se(()=>{Y(u=>({...u,app:"initializing"})),je.get(`${n}/qa/search/config/helper/list?pageNo=1&pageSize=3000`,{headers:{Authorization:r}}).then(u=>{Q(u.data.data||[])}).catch(()=>{}),J(1).then(()=>{_||St(),Y(u=>({...u,app:"ready"}))}).catch(()=>{Y(u=>({...u,app:"error"}))})},[n,r]),Se(()=>{_&&(Y(u=>({...u,display:"loading"})),je.get(`${n}/qa/dialogue/getDialogBySessionId?sessionId=${_}`,{headers:{Authorization:r}}).then(u=>{var Fe;const l={data:{data:{queryReplyPairList:[{query:{id:27665,gmtCreate:"2025-11-06T06:31:05.000+00:00",content:"\u63A7\u5236\u5668\u8D77\u4E0D\u6765\uFF08\u63A7\u5236\u5668\u53F3\u4E0A\u89D2RDY\u706F\u4E0D\u4EAE\uFF09",type:"text",queryId:"query-2532b3d4510867288e5ac5cb38338870",audioUrl:"",filePaths:null,currentFiles:null},reply:{id:27638,gmtCreate:"2025-11-06T06:31:15.000+00:00",content:`<think>
|
|
126
|
+
\u597D\u7684\uFF0C\u6211\u73B0\u5728\u9700\u8981\u56DE\u7B54\u7528\u6237\u7684\u95EE\u9898\uFF1A\u201C\u63A7\u5236\u5668\u8D77\u4E0D\u6765\uFF08\u63A7\u5236\u5668\u53F3\u4E0A\u89D2RDY\u706F\u4E0D\u4EAE\uFF09\u201D\u3002\u9996\u5148\uFF0C\u6211\u8981\u67E5\u770B\u63D0\u4F9B\u7684\u53C2\u8003\u8D44\u6599\uFF0C\u770B\u770B\u662F\u5426\u6709\u76F8\u5173\u4FE1\u606F\u3002
|
|
127
|
+
|
|
128
|
+
\u53C2\u8003\u8D44\u65990\u63D0\u5230\u4E86\u73B0\u8C61\u201C\u63A7\u5236\u5668\u8D77\u4E0D\u6765\uFF08\u63A7\u5236\u5668\u53F3\u4E0A\u89D2RDY\u706F\u4E0D\u4EAE\uFF09\u201D\uFF0C\u5E76\u5173\u8054\u5230\u201C\u5305\u542B\u201D\u548C\u201C\u4EA7\u751F\u201D\u5173\u7CFB\uFF0C\u4F46\u6CA1\u6709\u63D0\u4F9B\u5904\u7406\u65B9\u6CD5\u3002\u53C2\u8003\u8D44\u65991\u548C2\u90FD\u8BE6\u7EC6\u63CF\u8FF0\u4E86\u8FD9\u4E2A\u73B0\u8C61\uFF0C\u5E76\u4E14\u90FD\u7ED9\u51FA\u4E86\u5904\u7406\u65B9\u6CD5\uFF1A\u68C0\u67E5NT255\u6A21\u5757\u662F\u5426\u62A5\u7EA2\uFF0C\u66F4\u6362\u6A21\u5757\uFF0C\u5E76\u7279\u522B\u63D0\u5230\u673A\u8231\u68C0\u67E5FS211/N\u6A21\u5757\u3002\u8FD9\u4E9B\u5904\u7406\u65B9\u6CD5\u7684ID\u90FD\u662F10001\uFF0C\u8BF4\u660E\u662F\u540C\u4E00\u4E2A\u89E3\u51B3\u65B9\u6848\u3002
|
|
129
|
+
|
|
130
|
+
\u7528\u6237\u7684\u95EE\u9898\u6CA1\u6709\u6307\u5B9A\u7248\u672C\uFF0C\u6839\u636E\u89C4\u52192\uFF0C\u6211\u5E94\u8BE5\u4F7F\u7528\u6700\u65B0\u7684\u7248\u672C\u4FE1\u606F\u3002\u4E0D\u8FC7\uFF0C\u53C2\u8003\u8D44\u6599\u4E2D\u6CA1\u6709\u660E\u786E\u7684\u7248\u672C\u65E5\u671F\uFF0C\u6240\u4EE5\u53EA\u80FD\u5047\u8BBE\u5B83\u4EEC\u90FD\u662F\u6700\u65B0\u7684\u3002\u56E0\u6B64\uFF0C\u6211\u5E94\u8BE5\u7EFC\u5408\u6240\u6709\u53C2\u8003\u8D44\u6599\u7684\u4FE1\u606F\uFF0C\u63D0\u4F9B\u5904\u7406\u65B9\u6CD5\u3002
|
|
131
|
+
|
|
132
|
+
\u6700\u540E\uFF0C\u6211\u9700\u8981\u6309\u7167\u8981\u6C42\uFF0C\u7528\u7B80\u6D01\u7684\u8BED\u8A00\u56DE\u7B54\uFF0C\u5E76\u6807\u6CE8\u6765\u6E90\u3002\u7531\u4E8E\u5904\u7406\u65B9\u6CD5\u5728\u53C2\u8003\u8D44\u65991\u548C2\u4E2D\u90FD\u6709\uFF0C\u6211\u4F1A\u5F15\u7528\u8FD9\u4E24\u4E2A\u6765\u6E90\u3002
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
</think>
|
|
136
|
+
|
|
137
|
+
\u63A7\u5236\u5668\u8D77\u4E0D\u6765\uFF08\u63A7\u5236\u5668\u53F3\u4E0A\u89D2RDY\u706F\u4E0D\u4EAE\uFF09\u7684\u5904\u7406\u65B9\u6CD5\u5982\u4E0B\uFF1A
|
|
138
|
+
|
|
139
|
+
1. \u68C0\u67E5NT255\u6A21\u5757\u662F\u5426\u62A5\u7EA2\uFF08ERR\u706F\u662F\u5426\u4EAE\u7EA2\uFF09[retrive-tag id="2290607639633892359" image_urls="" fromType="2"][1][/retrive-tag][retrive-tag id="439368868506707299" image_urls="" fromType="2"][2][/retrive-tag]\u3002
|
|
140
|
+
2. \u66F4\u6362NT255\u6A21\u5757\uFF08\u6CE8\uFF1A\u673A\u8231\u68C0\u67E5FS211/N\u6A21\u5757\uFF09[retrive-tag id="2290607639633892359" image_urls="" fromType="2"][1][/retrive-tag][retrive-tag id="439368868506707299" image_urls="" fromType="2"][2][/retrive-tag]\u3002
|
|
141
|
+
|
|
142
|
+
\u8FD9\u4E9B\u6B65\u9AA4\u53EF\u4EE5\u5E2E\u52A9\u89E3\u51B3\u63A7\u5236\u5668\u65E0\u6CD5\u542F\u52A8\u7684\u95EE\u9898\u3002`,type:"text",reference:"[]",webReference:"[]",graphReference:'[{"cyphers":["match (n:`\u7EC4\u4EF6`)-[e]-(m) where id(n) == \\"\u7EC4\u4EF6101\\" return n,e,m;","match (n:`\u73B0\u8C61`)-[e]-(m) where id(n) == \\"\u73B0\u8C611001\\" return n,e,m;","match (n:`\u73B0\u8C61`)-[e]-(m) where id(n) == \\"\u73B0\u8C611001\\" return n,e,m;"],"fetchUrl":"https://10.160.33.150:30001/jinxin_graph/proxy/search/graph/search/cypherSearch4Rag","graphName":"\u6545\u969C\u5904\u7406\u56FE\u8C31","id":"1952195957278367755","traceNodes":[{"graphId":"1952195957278367755","id":"3484145002858895870","name":"\u63A7\u5236\u5668","nodeType":"\u7EC4\u4EF6","vid":"\u7EC4\u4EF6101"},{"graphId":"1952195957278367755","id":"2290607639633892359","name":"\u63A7\u5236\u5668\u8D77\u4E0D\u6765\uFF08\u63A7\u5236\u5668\u53F3\u4E0A\u89D2RDY\u706F\u4E0D\u4EAE\uFF09","nodeType":"\u73B0\u8C61","vid":"\u73B0\u8C611001"},{"graphId":"1952195957278367755","id":"439368868506707299","name":"\u63A7\u5236\u5668\u8D77\u4E0D\u6765\uFF08\u63A7\u5236\u5668\u53F3\u4E0A\u89D2RDY\u706F\u4E0D\u4EAE\uFF09","nodeType":"\u73B0\u8C61","vid":"\u73B0\u8C611001"}]}]',queryId:"query-2532b3d4510867288e5ac5cb38338870",feedbackResult:null,feedbackId:null,parsedFilePaths:null,recommendQuestion:'["\u5728\u68C0\u67E5NT255\u6A21\u5757\u65F6\uFF0CERR\u706F\u4EAE\u7EA2\u53EF\u80FD\u8868\u793A\u54EA\u4E9B\u5177\u4F53\u95EE\u9898\uFF1F","\u66F4\u6362NT255\u6A21\u5757\u65F6\u9700\u8981\u6CE8\u610F\u54EA\u4E9B\u6B65\u9AA4\u6216\u6CE8\u610F\u4E8B\u9879\uFF1F","\u9664\u4E86\u68C0\u67E5\u548C\u66F4\u6362NT255\u6A21\u5757\uFF0C\u8FD8\u6709\u54EA\u4E9B\u65B9\u6CD5\u53EF\u4EE5\u6392\u67E5\u63A7\u5236\u5668\u65E0\u6CD5\u542F\u52A8\u7684\u95EE\u9898\uFF1F"]',llmType:1,resultType:1,respTime:32453,tokens:824}}]}}};if(!l.data.data){Y(W=>({...W,display:"ready"}));return}const I=((Fe=l.data.data)==null?void 0:Fe.queryReplyPairList)||[],S=Za(I),{sessionId:B,searchConfigDTO:P,filePath:se,configId:G,reference:pe,webReference:ge,uploadedFiles:O,fileList:ce,currentFiles:ie}=u.data.data;if(S.length>0){const W=S.length-1-[...S].reverse().findIndex(oe=>oe.istype==="ai");W>=0&&W<S.length&&S[W].istype==="ai"&&(pe&&(S[W].reference=pe),ge&&(S[W].webReference=ge))}const me=ie||ce||O;if(me&&S.length>0){const W=[...S].reverse().findIndex(oe=>oe.istype==="user");W!==-1&&(console.log(S[S.length-1-W].currentFiles,"filesData"),S[S.length-1-W].currentFiles=me)}f.find(W=>W.sessionId===B)&&g(W=>W.map(oe=>oe.sessionId===B?{...oe,searchConfigDTO:P,filePath:se,configId:G}:oe));const ke={configId:u.data.data.configId,filePath:u.data.data.filePath,searchConfigDTO:u.data.data.searchConfigDTO||{},sessionId:u.data.data.sessionId,label:u.data.data.label,kbId:u.data.data.kbId};$(W=>{const oe=W.filter(fe=>fe.id!==_);return[{id:_,messages:S,...ke},...oe]}),Y(W=>({...W,display:"ready"}))}).catch(u=>{console.error("\u83B7\u53D6\u804A\u5929\u6570\u636E\u5931\u8D25:",u),u.response&&u.response.status===404&&St(),Y(l=>({...l,display:"error"}))}))},[_,n,r]),Se(()=>{const u=Be.uploadedFiles.length;Ie(l=>{const I=Array.isArray(l.actions)?l.actions:[];return{...l,actions:I.map(B=>B.name==="history"?{...B,badgeCount:u}:B)}})},[Be.uploadedFiles]),Se(()=>{es({url:n,token:r},u=>{_t(u)})},[]),Ge.useEffect(()=>{Ne.length&&$(u=>{if(!u[0])return u;const{messages:l}=u[0];for(let I=l.length-1;I>=0;I--)if(l[I].istype==="user"){const S=l[I].currentFiles||[];l[I].currentFiles=Ne.map(B=>{var se,G,pe;const P=S.find(ge=>ge.uid===B.uid);return{name:((se=B.file)==null?void 0:se.name)||B.name,size:((G=B.file)==null?void 0:G.size)||B.size,type:((pe=B.file)==null?void 0:pe.type)||B.type,status:B.status,uid:B.uid,url:B.url||(P==null?void 0:P.url)||""}});break}return[...u]})},[Ne]);let ne=null,de=null;const te=(u,l,I,S)=>{const B=u.join(",");let P=0;de=()=>{Me.current=!0};const se=async()=>{if(!Me.current){if(P>=As){Me.current||S("\u6587\u4EF6\u89E3\u6790\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");return}P++;try{const G=await je.get(`${n}/index/knowledgeBase/file/getFileStatusByUids?uids=${B}`,{headers:{Authorization:r}});if(Me.current)return;if(G.data.success){const pe=G.data.data;Me.current||l(pe),pe.every(O=>O.status===3)?Me.current||I():Me.current||setTimeout(se,Ns)}else Me.current||S(G.data.errorMsg||"\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u5931\u8D25")}catch{if(Me.current)return;S("\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u65F6\u53D1\u751F\u7F51\u7EDC\u9519\u8BEF")}}};se()},ae=(u,l)=>{$(I=>{const S=[...I];return S[0]&&(S[0]={...S[0],messages:S[0].messages.map(B=>B.queryId===u?{...B,feedbackResult:l}:B)}),S})},De=async u=>{var l,I;if(u)try{const S=(Z==null?void 0:Z.configId)||((l=Te==null?void 0:Te[(Z==null?void 0:Z.configId)||""])==null?void 0:l.id)||"",B=await je.get(`${n}/qa/ai/recommendQuestion?queryId=${u}&configId=${S||""}`.replace(/\?&/,"?"),{headers:{Authorization:r}});L(((I=B.data)==null?void 0:I.data)||[])}catch{L([])}};function Ke(u){const{content:l,audioUrl:I,filePaths:S,queryId:B}=u;if(!_||!B)return;const P=(Z==null?void 0:Z.messages)||[],se=P.findIndex(ie=>(ie==null?void 0:ie.queryId)===B&&((ie==null?void 0:ie.istype)==="ai"||(ie==null?void 0:ie.isUser)===!1));let G;if(se>0)for(let ie=se-1;ie>=0;ie-=1){const me=P[ie];if((me==null?void 0:me.istype)==="user"||(me==null?void 0:me.isUser)===!0){G=me;break}}const pe=(G==null?void 0:G.content)??l;if(!pe)return;const ge=(G==null?void 0:G.filePaths)??S,O=(typeof ge=="string"&&ge?JSON.parse(ge):ge||[]).map(ie=>ie.uid),ce=Date.now();Pt({now:ce}),Y(ie=>({...ie,display:"processing",sender:"processing"})),u.clearFn&&u.clearFn(),g(ie=>ie.map(me=>me.sessionId===_?{...me,gmtModified:ce}:me)),yt({configId:Z.configId,content:pe,fileUids:O,lastDate:ce,name:Z.label||"",queryId:B,sessionId:String(_||""),type:(G==null?void 0:G.audioUrl)??I?"audioUrl":"text",audioUrl:((G==null?void 0:G.audioUrl)??I)||"",enableThinking:!!Pe.reasoning,enableWebsearch:!!Pe.netSearch,qaChannel:Pe.qaChannel},ie=>{De(B)})}async function Ue(u,l){if(!_)return;const I=f.find(S=>S.sessionId===_);if(I&&I.isNew){let S=!1;const B=U||I.configId,P=u&&u.content?u.content.slice(0,20):I.label||"\u672A\u547D\u540D\u4F1A\u8BDD";if(await new Promise((se,G)=>{ns({url:n,token:r,CSRFToken:a},{label:P,sessionId:I.sessionId,sysType:"INT_SESSION",configId:B},pe=>{pe&&pe.data&&pe.data.sessionId?(g(ge=>ge.map(O=>O.sessionId===I.sessionId?{...O,isNew:!1,configId:B,label:P}:O)),$(ge=>ge.map(O=>O.id===I.sessionId?{...O,isNew:!1,configId:B,label:P}:O)),S=!0,se()):(be.error("\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),G())})}),!S)return;We(_,u,l,B);return}We(_,u,l)}function We(u,l,I,S){const B="query-"+it(32),P=f.find(O=>O.sessionId===u),se=S||(P==null?void 0:P.configId)||Z.configId;console.log("\u52A9\u624B\u914D\u7F6E\u8BE6\u60C5",se);const G=l&&l.content?l.content.slice(0,20):"\u672A\u547D\u540D\u4F1A\u8BDD";let pe;if(l.files&&l.files.length>0&&(pe=l.files.map(O=>({name:O.file.name,size:O.file.size,type:O.file.type,filePath:O.filePath||"",convertedFilePath:O.convertedFilePath||"",uid:O.uid||""}))),console.log("\u672C\u5730\u6587\u4EF6\u4E0A\u4F20",l.files),Tt({content:l.content||l.text||"",queryId:B,currentFiles:pe,filePaths:pe?JSON.stringify(pe):void 0}),g(O=>O.map(ce=>ce.sessionId===u&&ce.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&ce.isNew?{...ce,label:G,gmtModified:Date.now(),isNew:!1}:ce)),$(O=>O.map(ce=>ce.id===u&&ce.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&ce.isNew?{...ce,label:G,isNew:!1}:ce)),l.files&&l.files.length>0){Y(re=>({...re,sender:"uploading",display:"uploading"})),ne=new AbortController,Me.current=!1;const O=l.files.map(()=>`rc-upload-${Date.now()}-${Math.random().toString(36).slice(2)}`),ce=l.files.map((re,ke)=>({...re,uid:O[ke],status:"uploading"}));xe(ce);const ie=new FormData;l.files.forEach(re=>{ie.append("files",re.file)});const me=String(u||"");ie.append("sessionId",me),ie.append("uids",O.join(",")),je.post(`${n}/index/knowledgeBase/file/uploadFiles`,ie,{headers:{Authorization:r,"Content-Type":"multipart/form-data"},signal:ne.signal}).then(re=>{if(console.log("\u6587\u4EF6\u4E0A\u4F20\u7684\u6253\u5370\u7ED3\u679C",re),!Me.current)if(re.data.success&&Array.isArray(re.data.data)&&re.data.data.length>0){xe(W=>W.map(oe=>{const ve=re.data.data.find(fe=>fe.uid===oe.uid);return ve?{...oe,...ve}:oe})),Y(W=>({...W,sender:"processing",display:"analyzing"})),xe(W=>W.map(oe=>({...oe,status:"parsing"})));const ke=re.data.data,Fe=ke.map(W=>W.uid);te(Fe,W=>{if(xe(ve=>ve.map(fe=>{const st=W.find(et=>et.uid===fe.uid);if(st)switch(st.status){case 3:return{...fe,status:"done"};case 4:return{...fe,status:"error"};case 1:case 2:default:return{...fe,status:"parsing"}}return fe})),W.length>0&&W.every(ve=>ve.status===3)){xe([]);const ve=new Map;(W||[]).forEach(fe=>{ve.set(fe.id,fe)}),_e(fe=>({uploadedFiles:Mt(fe.uploadedFiles,ke).map(et=>{var xt;return{...et,pdfPages:((xt=ve.get(et.id))==null?void 0:xt.pdfPages)||0}})}))}},()=>{I==null||I(),Y(oe=>({...oe,sender:"processing",display:"processing"})),xe(oe=>oe.map(ve=>{const fe=ke.find(st=>st.uid===ve.uid);return fe?{...ve,...fe,url:fe.filePath,filePath:fe.filePath,name:fe.fileName||ve.name,convertedFilePath:fe.convertedFilePath||ve.convertedFilePath}:ve})),$(oe=>{if(!oe[0])return oe;const{messages:ve}=oe[0];for(let fe=ve.length-1;fe>=0;fe--)if(ve[fe].istype==="user"){const st=ve[fe].currentFiles||[];ve[fe].currentFiles=st.map(et=>{const xt=ke.find(In=>In.uid===et.uid);return xt?{...et,...xt}:et});break}return[...oe]});const W=Date.now();yt({configId:se,content:l.content||l.text||"",fileUids:Fe,lastDate:W,name:G,queryId:B,sessionId:String(u||""),type:"text",audioUrl:"",enableThinking:!!Pe.reasoning,enableWebsearch:!!Pe.netSearch,qaChannel:Pe.qaChannel},oe=>{De(B)})},W=>{Y(oe=>({...oe,display:"ready",sender:"ready"})),xe(oe=>oe.map(ve=>({...ve,status:"error",message:W})))})}else{const ke=re.data.errorMsg||"\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25";Y(Fe=>({...Fe,display:"error",sender:"ready"})),xe(Fe=>Fe.map(W=>({...W,status:"error",message:ke})))}}).catch(re=>{var ke,Fe;((ke=re==null?void 0:re.response)==null?void 0:ke.status)===413?(Fe=re==null?void 0:re.response)!=null&&Fe.statusText.includes("Request Entity Too Large")&&be.error("\u6587\u4EF6\u8D85\u8FC7\u6700\u5927\u53EF\u4E0A\u4F20\u9650\u5236"):be.error("\u7F51\u7EDC\u9519\u8BEF"),Y(W=>({...W,display:"error",sender:"ready"})),xe(W=>W.map(oe=>({...oe,status:"error",message:"\u7F51\u7EDC\u9519\u8BEF"})))});return}Y(O=>({...O,display:"processing",sender:"processing"}));const ge=Date.now();g(O=>O.map(ce=>ce.sessionId===u?{...ce,gmtModified:ge}:ce)),I==null||I(),yt({configId:se,content:l.content||l.text||"",fileUids:[],lastDate:ge,name:G,queryId:B,sessionId:String(u||""),type:"text",audioUrl:"",enableThinking:!!Pe.reasoning,enableWebsearch:!!Pe.netSearch,qaChannel:Pe.qaChannel},O=>{De(B)})}function jt(u){u.restult==1?Jt({url:n,token:r,CSRFToken:a},{queryId:u.queryId},()=>{ae(u.queryId,null)}):Or({url:n,token:r,CSRFToken:a},{restult:1,queryId:u.queryId},()=>{ae(u.queryId,1)})}function St(u){const l=it(32),I={sessionId:l,label:"\u672A\u547D\u540D\u4F1A\u8BDD",gmtModified:Date.now(),searchConfigDTO:{},filePath:"",configId:"",isNew:!0};g(S=>[{...I,messages:[]},...S]),$(S=>[{id:l,messages:[],...I},...S]),H(l)}const fn=u=>{var B;const l=new Set([...Be.uploadedFiles.map(P=>P.file.name),...j.map(P=>P.file.name)]),I=[],S=new Set;Array.from(u).forEach(P=>{l.has(P.name)?S.add(P.name):(I.push({file:P,type:kr(P.name),status:"pending",preview:P.type.startsWith("image")?URL.createObjectURL(P):void 0}),l.add(P.name))}),S.size>0&&be.warning(`\u4E0D\u80FD\u4E0A\u4F20\u540C\u540D\u6587\u4EF6: ${Array.from(S).join(", ")}`),I.length>0&&(K(P=>[...P,...I]),(B=qe.current)==null||B.call(qe,I))},mn=(u,l,I)=>{var S;(S=ot.current)==null||S.call(ot,u,l,I)};function gn(u){if(u!=null&&u.sessionId&&u.sessionId!==_){H(u.sessionId),Y(I=>({...I,sender:"ready"}));const l=N.find(I=>I.id===u.sessionId);if(l&&l.messages&&l.messages.length>0){const I=[...l.messages].reverse().find(S=>S.istype==="ai");I&&I.recommendQuestion?L(I.recommendQuestion):L([])}else L([])}}const hn=async u=>new Promise((l,I)=>{rs({url:n,token:r,CSRFToken:a},{sessionId:u},S=>{S?(be.success("\u5220\u9664\u6210\u529F!"),l(S)):(be.error("\u5220\u9664\u5931\u8D25!"),I(S))})}),yn=async()=>{try{return g([]),A(0),await J(1),[]}catch(u){throw be.error("\u5237\u65B0\u4F1A\u8BDD\u5217\u8868\u5931\u8D25"),u}},vn=async(u,l)=>new Promise((I,S)=>{ts({url:n,token:r,CSRFToken:a},{label:l,sessionId:u},B=>{if(B){const P=Date.now();g(se=>se.map(G=>G.sessionId===u?{...G,label:l,gmtModified:P}:G)),be.success("\u91CD\u547D\u540D\u6210\u529F!"),I(B)}else be.error("\u91CD\u547D\u540D\u5931\u8D25"),S(B)})}),bn=u=>{g(l=>{const I=l.filter(S=>S.sessionId!==u);return _===u&&(I.length>0?H(I[0].sessionId):St()),I})},xn=(u,l)=>{const I=Date.now();g(S=>S.map(B=>B.sessionId===u?{...B,label:l,gmtModified:I}:B))},Fn=u=>{Or({url:n,token:r,CSRFToken:a},{...u,...lt,restult:0},()=>{ae(lt.queryId,0)})},Cn=u=>{const l=u.new_name,I=C.data.label;l&&l!==I?C.async_renameConversation(l).then(()=>{C.fn_renameItemInList(l),v(!1)}).catch(()=>{}):v(!1)},wn=u=>{C.async_deleteConversation().then(()=>{C.fn_removeItemFromList(),w(!1)}).catch(()=>{})},Dt=(u,l)=>{switch(console.log(u,l),u){case"close_remove":w(!1);break;case"close_rename":v(!1);break;case"ok_rename":Cn(l);break;case"ok_remove":wn();break}},En=async({url:u,params:l,replacePredataFunction:I})=>{var S,B;try{const P=await je.post(u,l,{headers:{Authorization:r}}),se=(B=(S=P==null?void 0:P.data)==null?void 0:S.data)==null?void 0:B.data;se&&I(se)}catch(P){console.log("error",P)}},at=(u,l)=>{var I,S,B;switch(console.log(`[Event] ${u}`,l),u){case"conversations:load_more":{f.length<b&&!k&&J(h+1);break}case"retrieve-sql-data:pagingation_click":const{page:P,pageSize:se,fetchUrl:G,source:pe,replacePredataFunction:ge}=l;En({url:`${n}${G}`,replacePredataFunction:ge,params:{pageNo:P,pageSize:se,convertedFilePath:pe,stream:!1}});break;case"web_referenceFile_title:click":if(!((I=l==null?void 0:l.data)!=null&&I.link))return console.error("\u6CA1\u6709\u7F51\u9875\u5730\u5740");window.open(l.data.link,"_blank");break;case"conversation:item_click":gn(l);break;case"files:finished_animation_complete":xe([]);break;case"conversation:create":St();break;case"conversation:new_assistant_change":V(l.assistantId);break;case"conversations:rename_icon_clicked":i({data:l,async_renameConversation:O=>vn(l.sessionId,O),fn_renameItemInList:O=>xn(l.sessionId,O)}),v(!0);break;case"conversations:delete_icon_clicked":i({data:l,async_deleteConversation:()=>hn(l.sessionId),async_refreshConversationList:yn,fn_removeItemFromList:()=>bn(l.sessionId)}),w(!0);break;case"sender:send":Ue(l,l.clearFn);break;case"sender:send_recommandQuestion":{const O=((l==null?void 0:l.content)??"").toString();if(!O)break;Ue({content:O},()=>{});break}case"chatbox:follow_up_question_click":{const O=((l==null?void 0:l.question)??(l==null?void 0:l.content)??"").toString();if(!O)break;Ue({content:O},()=>{});break}case"sender:action_history":q(!0);break;case"sender:stop":Me.current=!0,ne&&(ne.abort(),ne=null),de&&(de(),de=null),Y(O=>({...O,display:"ready",sender:"ready"})),xe([]),vt==null||vt();break;case"sender:clear":(S=l.clearFn)==null||S.call(l);break;case"sender:configChange":l&&l.all&&Ze(l.all);break;case"action_copy:click":l&&Qa(l.content,l.event);break;case"chatbox:copy":{const O=(l==null?void 0:l.content)||"";if(!O)break;const ce=async me=>{try{return await navigator.clipboard.writeText(me),be.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F"),!0}catch{return!1}},ie=me=>{const re=document.createElement("textarea");re.value=me,re.style.position="fixed",re.style.opacity="0",document.body.appendChild(re),re.focus(),re.select();try{document.execCommand("copy"),be.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F")}catch{be.error("\u590D\u5236\u5931\u8D25")}document.body.removeChild(re)};ce(O).then(me=>{me||ie(O)});break}case"chatbox:repeat":console.log(l,"sdkflskdjflksdjfklsdjlfkjsdklfjsdklfjlks"),Ke(l);break;case"action_thumbsup":jt(l);break;case"chatbox:like":jt({queryId:l==null?void 0:l.queryId,restult:l==null?void 0:l.result});break;case"action_thumbsdown":l.restult===0?Jt({url:n,token:r,CSRFToken:a},{queryId:l.queryId},()=>{ae(l.queryId,null)}):(gt(l),ht(!0));break;case"chatbox:dislike":(l==null?void 0:l.result)===0?Jt({url:n,token:r,CSRFToken:a},{queryId:l.queryId},()=>{ae(l.queryId,null)}):(gt({queryId:l==null?void 0:l.queryId}),ht(!0));break;case"action_retrive_tag":s==null||s("action_retrive_tag",l);break;case"referenceFile_view":s==null||s("referenceFile_view",l);break;case"referenceFile_question":console.log(l,"zhezhhzhzh"),s==null||s("referenceFile_question",l);break;case"referenceFile_download":s==null||s("referenceFile_download",l);break;case"retrive_tag:click":s==null||s("retrive_tag:click",l);break;case"fileManager:change":{const O=Array.isArray(l==null?void 0:l.uploadedFiles)?l.uploadedFiles:[];K(O),typeof(l==null?void 0:l.setUploadedFiles)=="function"&&(qe.current=l.setUploadedFiles,ot.current=l.removeFile);break}case"uploaded_file:removeFromTemp":{console.log("[DEBUG] mergedEventsEmit uploaded_file:removeFromTemp \u4E8B\u4EF6",l);const O=(B=l==null?void 0:l.file)==null?void 0:B.uid;if(!O){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6",l);break}const ce=[...Z.messages||[]].reverse().find(me=>me.istype==="user"),ie=ce==null?void 0:ce.queryId;os({url:n,token:r,CSRFToken:a},{uid:O,queryId:ie},(me,re)=>{if(me){if(be.success("\u6587\u4EF6\u5DF2\u4ECE\u4E34\u65F6\u77E5\u8BC6\u5E93\u79FB\u9664"),re&&Array.isArray(re.data&&re.data.data)){const ke=re.data.data.map(Fe=>{var oe;const W=Fe.name||Fe.fileName||"";return{file:{name:W,size:Number((oe=Fe.size)==null?void 0:oe.replace("MB",""))*1024*1024||0,type:Fe.type},type:kr(W),status:"uploaded",url:Fe.filePath,convertedFilePath:Fe.convertedFilePath,uid:Fe.uid,preview:Fe.type==="image"?Fe.filePath:void 0}});_e({uploadedFiles:ke})}}else console.log("[DEBUG] removeFilefromTempUpload \u56DE\u8C03 false\uFF0Cres:",re),be.error("\u6587\u4EF6\u79FB\u9664\u5931\u8D25")});break}case"uploaded_file:remove_batch":break;default:s==null||s(u,l)}},Sn=[{key:"conversations",type:"custom",label:"\u5BF9\u8BDD\u5386\u53F2",icon:d(lo,{size:16}),enabled:!0,component:d(Ya,{data:f,assistantList:M,activedItem:_||"",hasMore:f.length<b,loadingMore:k,sortRules:[{label:"\u5F53\u5929",dayPeriod:1},{label:"3\u5929",dayPeriod:3},{label:"7\u5929",dayPeriod:7},{label:"30\u5929",dayPeriod:30}],eventsEmit:at,styles:m.theme})}],lr=Ge.useMemo(()=>()=>d(us,{eventsEmit:at,assistantList:M,styles:m,selectedId:he,onSelectAssistant:Qe,productLogo:p==null?void 0:p.productLogo}),[he]),Dn={...Ge.useMemo(()=>({AiChatBox:(u,l)=>{var pe,ge;const I=l===(((pe=Z==null?void 0:Z.messages)==null?void 0:pe.length)||0)-1;let S="ready";if(I)if(u.status!==void 0)switch(u.status){case 0:S="thinking";break;case 1:S="processing";break;case 2:S="ready";break;case 3:S="error";break;default:S=ee.display}else S=ee.display;let B=[];if(Array.isArray(z))B=z;else if(typeof z=="string")try{B=JSON.parse(z)||[]}catch{B=[]}const P=(()=>{const O=u==null?void 0:u.reference;if(!O)return"[]";if(typeof O=="string")try{return JSON.parse(O),O}catch{return"[]"}try{return JSON.stringify(O)}catch{return"[]"}})(),se=(()=>{const O=u==null?void 0:u.webReference;if(!O)return"[]";if(typeof O=="string")try{return JSON.parse(O),O}catch{return"[]"}try{return JSON.stringify(O)}catch{return"[]"}})(),G=(()=>{const O=u==null?void 0:u.graphReference;if(!O)return"[]";if(typeof O=="string")try{return JSON.parse(O),O}catch{return"[]"}try{return JSON.stringify(O)}catch{return"[]"}})();return d(mr,{...u,reference:P,webReference:se,graphReference:G,contentType:"stream",displayStatus:S,eventsEmit:at,isLast:I&&(u==null?void 0:u.istype)==="ai",followUpQuestions:I&&(u==null?void 0:u.istype)==="ai"?B:[],defaultAnswer:((ge=Z==null?void 0:Z.searchConfigDTO)==null?void 0:ge.defaultAnswer)||"\u4E0D\u77E5\u9053\u4EC0\u4E48\u539F\u56E0\u6211\u4EEC\u6CA1\u80FD\u67E5\u5230\u4F60\u8981\u7684\u95EE\u9898*-*",is_download:ct,styles:m},`${(u==null?void 0:u.queryId)||(u==null?void 0:u.id)||l}-${(u==null?void 0:u.istype)||"unknown"}`)},LogoBox:u=>u&&u.LogoBox===null?null:u&&typeof u.LogoBox=="function"?d(u.LogoBox,{}):d("div",{className:"text-2xl w-full text-center font-bold",children:"\u5C0F\u9CB8\u667A\u80FD\u52A9\u624B"}),DisplayLoading:()=>d(Ds,{}),DisplayError:()=>d($s,{}),AppError:()=>d(Is,{msg:"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25",subMsg:"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),AppLoading:()=>{var u,l;return d(eo,{title:(u=p==null?void 0:p.appLoadingConfig)==null?void 0:u.title,subtitle:((l=p==null?void 0:p.appLoadingConfig)==null?void 0:l.subtitle)||""})},UserChatBox:(u,l)=>d(mr,{...u,contentType:"plainText",isUser:!0,displayStatus:"ready",eventsEmit:at,styles:m,fileManagerData:Be},`${(u==null?void 0:u.queryId)||(u==null?void 0:u.id)||l}-user`),WelcomeComponent:lr}),[lr,Z,ee.display,at,m,ct,Be]),...p.CustomComponents||{}};return Se(()=>{Ie(u=>{const l=Array.isArray(u.switchs)?u.switchs.map(I=>I.name==="reasoning"?{...I,enabled:bt}:I):[];return{...u,switchs:l}})},[bt]),R($n,{children:[d(Ss,{open:X,onCancel:()=>q(!1),files:Be.uploadedFiles,currentFiles:j,onUpload:fn,onRemoveFile:mn,styles:m,eventsEmit:at}),d(e,{...p,status:ee,chatData:Z,sidebar:Sn,recommandQuestions:[],eventsEmit:at,styles:m,senderConfig:we,fileUploadStatus:Ne,CustomComponents:Dn,activeSessionId:_,scrollOld:c}),d(to,{open:Bt,feedBackList:Et,setOpen:ht,handleConfirm:Fn}),d(ks,{isModalOpen:y,handleOk:Dt,handleCancel:()=>Dt("close_rename"),data:(C==null?void 0:C.data)||{}}),d(Os,{isModalOpen:x,handleOk:Dt,handleCancel:()=>Dt("close_remove"),data:(C==null?void 0:C.data)||{}})]})}}export{Xs as default};
|