@gientech/modual 2.2.38 → 2.2.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/chat.js CHANGED
@@ -1 +1,256 @@
1
- import"react/jsx-runtime";import"react";import"axios";import"@mxmweb/aichat";import"@mxmweb/rtext";import"antd";import"./assets/index-CpW6Dhpp.js";import"@mxmweb/zui";import{D as B,w as C}from"./assets/style-BDkhdoE4.js";import"./assets/index-BrQsYGxa.js";/* empty css *//* empty css */import{registerPDFWorker as G}from"@mxmweb/fviewer";import"./assets/index-Bz8GGyJk.js";import"styled-components";import"dayjs";import"./assets/createLucideIcon-Bj5DlX2s.js";import"./assets/search-CEuIa9-_.js";import"./assets/plus-B679mjyt.js";import"./assets/x-CdZQbi--.js";import"react-dom";import"./assets/GientechStreamReader-_ih9ja1B.js";import"./database.js";import"@mxmweb/xviewer";import"./databaseId.js";import"./assets/triangle-alert-LqO4u4ts.js";import"./assets/loader-circle-C1Oa97Sz.js";import"./databaseTable.js";import"./modelManage.js";import"./sensitive.js";import"./assets/circle-plus-RlDPoPkb.js";import"./assets/index-CVBBj_Pf.js";export{B as DrawerType,C as default,G as registerPDFWorker};
1
+ import{jsx as k,jsxs as te,Fragment as Tr}from"react/jsx-runtime";import*as I from"react";import ye,{createElement as Fi,PureComponent as cc,useState as le,useMemo as ze,createContext as di,Children as uc,cloneElement as dc,Component as fc,useRef as Le,useEffect as _e,useContext as ln,isValidElement as pc,version as hc,useLayoutEffect as gc,useCallback as $r}from"react";import At from"axios";import{AiChat as mc,validateFileUpload as vc,showValidationErrors as yc}from"@mxmweb/aichat";import{mergeLiveChunkToNodes as bc,ChatMessageAdapter as Qa}from"@mxmweb/rtext";import{Dropdown as Cc,Input as Cs,Popover as xc,message as yt,Skeleton as Br,Button as tr,ConfigProvider as fi,Modal as xs,Form as Za,Table as wc,Pagination as Fc,Empty as Sc,Tooltip as wr,Drawer as ws}from"antd";import{u as an}from"./assets/index-CpW6Dhpp.js";import{Icon as Ec,defaultTheme as Oa,useTheme as Ac,deepMergeTheme as eo}from"@mxmweb/zui";import{_ as Ra,a as wt,b as Ce,w as pn,c as Fe,d as Ft,e as St,f as N,h as Fs,i as Gi,j as _c,k as fe,l as kc,m as An,n as G,o as ce,u as Yn,r as Ss,p as Ic,q as Tc,s as Pc,t as Dc,F as xt,v as ai,x as Si,y as Ei,z as ar,A as En,B as on,I as Oc,C as Mn,D as _t,E as or,g as Rc}from"./assets/AntdIcon-BRbA9Wz8.js";import to from"dayjs";import{c as sr}from"./assets/createLucideIcon-Bj5DlX2s.js";import{P as Mc}from"./assets/plus-B679mjyt.js";import{S as Ki}from"./assets/search-CEuIa9-_.js";import{X as Es}from"./assets/x-CdZQbi--.js";import*as Nc from"react-dom";import no,{createPortal as Lc}from"react-dom";import{i as $c,r as Bc,C as Vc,c as jc,z as zc,B as qc,j as As,k as _s,l as ks,n as Xi,o as Ma,f as Ji,D as Uc,p as Hc,T as Yi,g as Ai,q as Wc,s as Gc,N as Kc,t as Xc,G as Jc,a as Yc,W as Qc,v as Is,e as Zc,b as eu,u as tu,F as nu,h as ro,d as _i,w as ru,x as iu,y as au,A as ou,m as su}from"./assets/index-Ck0T7V1d.js";import{a as lu,C as cu,G as Ts}from"./assets/index-_ih9ja1B.js";/* empty css *//* empty css */import{registerPDFWorker as uv}from"@mxmweb/fviewer";import"styled-components";/**
2
+ * @license lucide-react v0.456.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const uu=sr("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
+ * @license lucide-react v0.456.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const du=sr("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"}]]);/**
12
+ * @license lucide-react v0.456.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const fu=sr("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"}]]);/**
17
+ * @license lucide-react v0.456.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const pu=sr("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"}]]);/**
22
+ * @license lucide-react v0.456.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Ps=sr("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"}]]);/**
27
+ * @license lucide-react v0.456.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const hu=sr("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"}]]),gu=n=>I.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},I.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 14.6666C11.6819 14.6666 14.6667 11.6819 14.6667 7.99998C14.6667 4.31808 11.6819 1.33331 8 1.33331C4.3181 1.33331 1.33334 4.31808 1.33334 7.99998C1.33334 11.6819 4.3181 14.6666 8 14.6666Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M1.33334 8H14.6667",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 14.6666C9.47277 14.6666 10.6667 11.6819 10.6667 7.99998C10.6667 4.31808 9.47277 1.33331 8 1.33331C6.52724 1.33331 5.33334 4.31808 5.33334 7.99998C5.33334 11.6819 6.52724 14.6666 8 14.6666Z",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M3.28597 3.38068C4.4924 4.58711 6.15907 5.33331 8 5.33331C9.84097 5.33331 11.5076 4.58711 12.7141 3.38068",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M12.7141 12.6193C11.5076 11.4129 9.84097 10.6667 8 10.6667C6.15907 10.6667 4.4924 11.4129 3.28597 12.6193",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"})),mu=n=>I.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},I.createElement("path",{d:"M1.73633 1.57642C2.53848 0.774265 3.74473 0.714862 4.87207 1.03052C6.02182 1.35245 7.24885 2.09683 8.3125 3.1604C9.37624 4.22414 10.1204 5.45195 10.4424 6.60181C10.758 7.72909 10.6986 8.93446 9.89648 9.73657C9.09439 10.5387 7.88901 10.5981 6.76172 10.2825C5.61186 9.96051 4.38405 9.21632 3.32031 8.15259C2.25674 7.08894 1.51236 5.86191 1.19043 4.71216C0.874775 3.58481 0.934176 2.37857 1.73633 1.57642Z",stroke:"#4E6EF2",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M6.76172 5.41479C7.88883 5.09929 9.09442 5.15888 9.89648 5.96069C10.6986 6.76284 10.758 7.96909 10.4424 9.09644C10.1204 10.2462 9.37617 11.4732 8.3125 12.5369C7.24882 13.6005 6.02187 14.3448 4.87207 14.6667C3.74472 14.9824 2.53848 14.923 1.73633 14.1208C0.934528 13.3188 0.874922 12.1132 1.19043 10.9861C1.51239 9.83623 2.25659 8.60841 3.32031 7.54468C4.38405 6.48096 5.61186 5.73675 6.76172 5.41479Z",stroke:"#4E6EF2",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M11.1282 1.03052C12.2553 0.715012 13.4609 0.774612 14.263 1.57642C15.0651 2.37857 15.1246 3.58481 14.8089 4.71216C14.4869 5.86196 13.7427 7.08892 12.679 8.15259C11.6153 9.21627 10.3884 9.96048 9.23859 10.2825C8.11124 10.5981 6.90499 10.5387 6.10284 9.73657C5.30106 8.9345 5.24144 7.72892 5.55695 6.60181C5.8789 5.45195 6.62311 4.22414 7.68683 3.1604C8.75056 2.09668 9.97838 1.35248 11.1282 1.03052Z",stroke:"#4E6EF2",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M6.10284 5.96069C6.90499 5.15855 8.11124 5.09914 9.23859 5.41479C10.3883 5.73673 11.6154 6.48111 12.679 7.54468C13.7427 8.60841 14.4869 9.83623 14.8089 10.9861C15.1245 12.1134 15.0651 13.3188 14.263 14.1208C13.4609 14.9229 12.2555 14.9823 11.1282 14.6667C9.97838 14.3448 8.75055 13.6006 7.68683 12.5369C6.62325 11.4732 5.87888 10.2462 5.55695 9.09644C5.24129 7.96909 5.3007 6.76284 6.10284 5.96069Z",stroke:"#4E6EF2",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})),jn={actions:[{name:"upload",icon:k(Ec,{type:"wenda/shangchuanwenjian",color:"#000",size:20}),tip:"\u6587\u4EF6\u4E0A\u4F20"}],switchs:[{label:"\u8054\u7F51\u641C\u7D22",name:"netSearch",type:"switch",defaultValue:!1,enabled:!0,icon:k(gu,{width:16,height:16,className:"aichat-netsearch-icon",style:{color:"#4B8CF7"}})},{label:"\u6DF1\u5EA6\u601D\u8003",name:"reasoning",type:"switch",defaultValue:!0,enabled:!0,icon:k(mu,{width:16,height:16})}]},Na={sidebar:{newChat:"\u65B0\u5EFA\u5BF9\u8BDD",newConversation:"\u65B0\u5EFA\u4F1A\u8BDD",unnamedSession:"\u672A\u547D\u540D\u4F1A\u8BDD",noAssistant:"\u672A\u9009\u62E9\u52A9\u624B",searchPlaceholder:"\u641C\u7D22\u5386\u53F2\u8BB0\u5F55",search:"\u641C\u7D22",rename:"\u91CD\u547D\u540D",delete:"\u5220\u9664"},welcome:{defaultPrologue:"\u60A8\u597D\uFF0C\u6B22\u8FCE\u4F7F\u7528\u5C0F\u9CB8\u667A\u80FD\u95EE\u7B54",selectAssistant:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u667A\u80FD\u52A9\u624B",searchAssistant:"\u641C\u7D22\u52A9\u624B\u540D\u79F0"},sender:{netSearch:"\u8054\u7F51\u641C\u7D22",deepThinking:"\u6DF1\u5EA6\u601D\u8003",fileUpload:"\u6587\u4EF6\u4E0A\u4F20"},chatHeader:{newConversation:"\u65B0\u5BF9\u8BDD"},disclaimer:"\u5185\u5BB9\u7531AI\u751F\u6210\uFF0C\u4EC5\u4F9B\u53C2\u8003\uFF0C\u4E0D\u4EE3\u8868\u672C\u516C\u53F8\u89C2\u70B9\u3002"},vu={sidebar:{newChat:"New chat",newConversation:"New conversation",unnamedSession:"Unnamed",noAssistant:"No assistant",searchPlaceholder:"Search history",search:"Search",rename:"Rename",delete:"Delete"},welcome:{defaultPrologue:"Hello, welcome to Smart Q&A",selectAssistant:"Please select an assistant",searchAssistant:"Search assistants"},sender:{netSearch:"Web search",deepThinking:"Deep thinking",fileUpload:"Upload file"},chatHeader:{newConversation:"New conversation"},disclaimer:"Content is AI-generated and for reference only."},yu={sidebar:{newChat:"\u65B0\u898F\u4F1A\u8A71",newConversation:"\u65B0\u898F\u4F1A\u8A71",unnamedSession:"\u540D\u524D\u306A\u3057",noAssistant:"\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u672A\u9078\u629E",searchPlaceholder:"\u5C65\u6B74\u3092\u691C\u7D22",search:"\u691C\u7D22",rename:"\u540D\u524D\u3092\u5909\u66F4",delete:"\u524A\u9664"},welcome:{defaultPrologue:"\u3053\u3093\u306B\u3061\u306F\u3001\u30B9\u30DE\u30FC\u30C8Q&A\u3078\u3088\u3046\u3053\u305D",selectAssistant:"\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",searchAssistant:"\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u3092\u691C\u7D22"},sender:{netSearch:"\u30CD\u30C3\u30C8\u691C\u7D22",deepThinking:"\u6DF1\u304F\u8003\u3048\u308B",fileUpload:"\u30D5\u30A1\u30A4\u30EB\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9"},chatHeader:{newConversation:"\u65B0\u898F\u4F1A\u8A71"},disclaimer:"AI\u306B\u3088\u308A\u751F\u6210\u3055\u308C\u305F\u5185\u5BB9\u3067\u3059\u3002\u53C2\u8003\u3068\u3057\u3066\u3054\u5229\u7528\u304F\u3060\u3055\u3044\u3002"},bu={zh:Na,en:vu,ja:yu};function Ds(n){return bu[n]??Na}const Os=ye.createContext({locale:"zh",messages:Na});function pi(){return ye.useContext(Os)}function Cu({locale:n,children:t}){const e=ye.useMemo(()=>({locale:n,messages:Ds(n)}),[n]);return ye.createElement(Os.Provider,{value:e},t)}function xu(n,t){n.prototype=Object.create(t.prototype),n.prototype.constructor=n,Ra(n,t)}var io=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function wu(n,t){return!!(n===t||io(n)&&io(t))}function Fu(n,t){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(!wu(n[e],t[e]))return!1;return!0}function ki(n,t){t===void 0&&(t=Fu);var e,r=[],i,a=!1;function o(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return a&&e===this&&t(s,r)||(i=n.apply(this,s),a=!0,e=this,r=s),i}return o}var Su=typeof performance=="object"&&typeof performance.now=="function",ao=Su?function(){return performance.now()}:function(){return Date.now()};function oo(n){cancelAnimationFrame(n.id)}function Eu(n,t){var e=ao();function r(){ao()-e>=t?n.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var Ii=-1;function so(n){if(n===void 0&&(n=!1),Ii===-1||n){var t=document.createElement("div"),e=t.style;e.width="50px",e.height="50px",e.overflow="scroll",document.body.appendChild(t),Ii=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ii}var zn=null;function lo(n){if(n===void 0&&(n=!1),zn===null||n){var t=document.createElement("div"),e=t.style;e.width="50px",e.height="50px",e.overflow="scroll",e.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?zn="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?zn="negative":zn="positive-ascending"),document.body.removeChild(t),zn}return zn}var Au=150,_u=function(t,e){return t};function ku(n){var t,e=n.getItemOffset,r=n.getEstimatedTotalSize,i=n.getItemSize,a=n.getOffsetForIndexAndAlignment,o=n.getStartIndexForOffset,s=n.getStopIndexForStartIndex,l=n.initInstanceProps,c=n.shouldResetStyleCacheOnItemSizeChange,u=n.validateProps;return t=(function(h){xu(p,h);function p(v){var f;return f=h.call(this,v)||this,f._instanceProps=l(f.props,Ce(f)),f._outerRef=void 0,f._resetIsScrollingTimeoutId=null,f.state={instance:Ce(f),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof f.props.initialScrollOffset=="number"?f.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},f._callOnItemsRendered=void 0,f._callOnItemsRendered=ki(function(d,m,y,F){return f.props.onItemsRendered({overscanStartIndex:d,overscanStopIndex:m,visibleStartIndex:y,visibleStopIndex:F})}),f._callOnScroll=void 0,f._callOnScroll=ki(function(d,m,y){return f.props.onScroll({scrollDirection:d,scrollOffset:m,scrollUpdateWasRequested:y})}),f._getItemStyle=void 0,f._getItemStyle=function(d){var m=f.props,y=m.direction,F=m.itemSize,_=m.layout,S=f._getItemStyleCache(c&&F,c&&_,c&&y),A;if(S.hasOwnProperty(d))A=S[d];else{var T=e(f.props,d,f._instanceProps),E=i(f.props,d,f._instanceProps),w=y==="horizontal"||_==="horizontal",g=y==="rtl",O=w?T:0;S[d]=A={position:"absolute",left:g?void 0:O,right:g?O:void 0,top:w?0:T,height:w?"100%":E,width:w?E:"100%"}}return A},f._getItemStyleCache=void 0,f._getItemStyleCache=ki(function(d,m,y){return{}}),f._onScrollHorizontal=function(d){var m=d.currentTarget,y=m.clientWidth,F=m.scrollLeft,_=m.scrollWidth;f.setState(function(S){if(S.scrollOffset===F)return null;var A=f.props.direction,T=F;if(A==="rtl")switch(lo()){case"negative":T=-F;break;case"positive-descending":T=_-y-F;break}return T=Math.max(0,Math.min(T,_-y)),{isScrolling:!0,scrollDirection:S.scrollOffset<T?"forward":"backward",scrollOffset:T,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._onScrollVertical=function(d){var m=d.currentTarget,y=m.clientHeight,F=m.scrollHeight,_=m.scrollTop;f.setState(function(S){if(S.scrollOffset===_)return null;var A=Math.max(0,Math.min(_,F-y));return{isScrolling:!0,scrollDirection:S.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._outerRefSetter=function(d){var m=f.props.outerRef;f._outerRef=d,typeof m=="function"?m(d):m!=null&&typeof m=="object"&&m.hasOwnProperty("current")&&(m.current=d)},f._resetIsScrollingDebounced=function(){f._resetIsScrollingTimeoutId!==null&&oo(f._resetIsScrollingTimeoutId),f._resetIsScrollingTimeoutId=Eu(f._resetIsScrolling,Au)},f._resetIsScrolling=function(){f._resetIsScrollingTimeoutId=null,f.setState({isScrolling:!1},function(){f._getItemStyleCache(-1,null)})},f}p.getDerivedStateFromProps=function(f,d){return Iu(f,d),u(f),null};var b=p.prototype;return b.scrollTo=function(f){f=Math.max(0,f),this.setState(function(d){return d.scrollOffset===f?null:{scrollDirection:d.scrollOffset<f?"forward":"backward",scrollOffset:f,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},b.scrollToItem=function(f,d){d===void 0&&(d="auto");var m=this.props,y=m.itemCount,F=m.layout,_=this.state.scrollOffset;f=Math.max(0,Math.min(f,y-1));var S=0;if(this._outerRef){var A=this._outerRef;F==="vertical"?S=A.scrollWidth>A.clientWidth?so():0:S=A.scrollHeight>A.clientHeight?so():0}this.scrollTo(a(this.props,f,d,_,this._instanceProps,S))},b.componentDidMount=function(){var f=this.props,d=f.direction,m=f.initialScrollOffset,y=f.layout;if(typeof m=="number"&&this._outerRef!=null){var F=this._outerRef;d==="horizontal"||y==="horizontal"?F.scrollLeft=m:F.scrollTop=m}this._callPropsCallbacks()},b.componentDidUpdate=function(){var f=this.props,d=f.direction,m=f.layout,y=this.state,F=y.scrollOffset,_=y.scrollUpdateWasRequested;if(_&&this._outerRef!=null){var S=this._outerRef;if(d==="horizontal"||m==="horizontal")if(d==="rtl")switch(lo()){case"negative":S.scrollLeft=-F;break;case"positive-ascending":S.scrollLeft=F;break;default:var A=S.clientWidth,T=S.scrollWidth;S.scrollLeft=T-A-F;break}else S.scrollLeft=F;else S.scrollTop=F}this._callPropsCallbacks()},b.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&oo(this._resetIsScrollingTimeoutId)},b.render=function(){var f=this.props,d=f.children,m=f.className,y=f.direction,F=f.height,_=f.innerRef,S=f.innerElementType,A=f.innerTagName,T=f.itemCount,E=f.itemData,w=f.itemKey,g=w===void 0?_u:w,O=f.layout,D=f.outerElementType,R=f.outerTagName,P=f.style,W=f.useIsScrolling,U=f.width,q=this.state.isScrolling,z=y==="horizontal"||O==="horizontal",J=z?this._onScrollHorizontal:this._onScrollVertical,H=this._getRangeToRender(),K=H[0],B=H[1],V=[];if(T>0)for(var M=K;M<=B;M++)V.push(Fi(d,{data:E,key:g(M,E),index:M,isScrolling:W?q:void 0,style:this._getItemStyle(M)}));var j=r(this.props,this._instanceProps);return Fi(D||R||"div",{className:m,onScroll:J,ref:this._outerRefSetter,style:wt({position:"relative",height:F,width:U,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:y},P)},Fi(S||A||"div",{children:V,ref:_,style:{height:z?"100%":j,pointerEvents:q?"none":void 0,width:z?j:"100%"}}))},b._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var f=this.props.itemCount;if(f>0){var d=this._getRangeToRender(),m=d[0],y=d[1],F=d[2],_=d[3];this._callOnItemsRendered(m,y,F,_)}}if(typeof this.props.onScroll=="function"){var S=this.state,A=S.scrollDirection,T=S.scrollOffset,E=S.scrollUpdateWasRequested;this._callOnScroll(A,T,E)}},b._getRangeToRender=function(){var f=this.props,d=f.itemCount,m=f.overscanCount,y=this.state,F=y.isScrolling,_=y.scrollDirection,S=y.scrollOffset;if(d===0)return[0,0,0,0];var A=o(this.props,S,this._instanceProps),T=s(this.props,A,S,this._instanceProps),E=!F||_==="backward"?Math.max(1,m):1,w=!F||_==="forward"?Math.max(1,m):1;return[Math.max(0,A-E),Math.max(0,Math.min(d-1,T+w)),A,T]},p})(cc),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Iu=function(t,e){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,e.instance},Tu=50,Gn=function(t,e,r){var i=t,a=i.itemSize,o=r.itemMetadataMap,s=r.lastMeasuredIndex;if(e>s){var l=0;if(s>=0){var c=o[s];l=c.offset+c.size}for(var u=s+1;u<=e;u++){var h=a(u);o[u]={offset:l,size:h},l+=h}r.lastMeasuredIndex=e}return o[e]},Pu=function(t,e,r){var i=e.itemMetadataMap,a=e.lastMeasuredIndex,o=a>0?i[a].offset:0;return o>=r?Rs(t,e,a,0,r):Du(t,e,Math.max(0,a),r)},Rs=function(t,e,r,i,a){for(;i<=r;){var o=i+Math.floor((r-i)/2),s=Gn(t,o,e).offset;if(s===a)return o;s<a?i=o+1:s>a&&(r=o-1)}return i>0?i-1:0},Du=function(t,e,r,i){for(var a=t.itemCount,o=1;r<a&&Gn(t,r,e).offset<i;)r+=o,o*=2;return Rs(t,e,Math.min(r,a-1),Math.floor(r/2),i)},co=function(t,e){var r=t.itemCount,i=e.itemMetadataMap,a=e.estimatedItemSize,o=e.lastMeasuredIndex,s=0;if(o>=r&&(o=r-1),o>=0){var l=i[o];s=l.offset+l.size}var c=r-o-1,u=c*a;return s+u},Ou=ku({getItemOffset:function(t,e,r){return Gn(t,e,r).offset},getItemSize:function(t,e,r){return r.itemMetadataMap[e].size},getEstimatedTotalSize:co,getOffsetForIndexAndAlignment:function(t,e,r,i,a,o){var s=t.direction,l=t.height,c=t.layout,u=t.width,h=s==="horizontal"||c==="horizontal",p=h?u:l,b=Gn(t,e,a),v=co(t,a),f=Math.max(0,Math.min(v-p,b.offset)),d=Math.max(0,b.offset-p+b.size+o);switch(r==="smart"&&(i>=d-p&&i<=f+p?r="auto":r="center"),r){case"start":return f;case"end":return d;case"center":return Math.round(d+(f-d)/2);case"auto":default:return i>=d&&i<=f?i:i<d?d:f}},getStartIndexForOffset:function(t,e,r){return Pu(t,r,e)},getStopIndexForStartIndex:function(t,e,r,i){for(var a=t.direction,o=t.height,s=t.itemCount,l=t.layout,c=t.width,u=a==="horizontal"||l==="horizontal",h=u?c:o,p=Gn(t,e,i),b=r+h,v=p.offset+p.size,f=e;f<s-1&&v<b;)f++,v+=Gn(t,f,i).size;return f},initInstanceProps:function(t,e){var r=t,i=r.estimatedItemSize,a={itemMetadataMap:{},estimatedItemSize:i||Tu,lastMeasuredIndex:-1};return e.resetAfterIndex=function(o,s){s===void 0&&(s=!0),a.lastMeasuredIndex=Math.min(a.lastMeasuredIndex,o-1),e._getItemStyleCache(-1),s&&e.forceUpdate()},a},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){t.itemSize}});function Ru({isActive:n,isNew:t,isDisabled:e,data:r,eventsEmit:i,styles:a={},assistantList:o=[]}){const{messages:s}=pi(),[l,c]=le(!1),u=(a==null?void 0:a.colors)||{},h=ze(()=>{const m=r==null?void 0:r.configId;if(!m||!o||o.length===0)return s.sidebar.noAssistant;const y=o.find(F=>String(F==null?void 0:F.id)===String(m));if(!y)return s.sidebar.noAssistant;if(y!=null&&y.name)return y.name;try{const F=typeof y.configJson=="string"?JSON.parse(y.configJson):y.configJson;return(F==null?void 0:F.config_name)||s.sidebar.noAssistant}catch{return s.sidebar.noAssistant}},[o,r==null?void 0:r.configId,s.sidebar.noAssistant]),p=[{key:"rename",icon:k(pu,{size:12}),label:s.sidebar.rename,onClick:m=>{m.domEvent.stopPropagation(),i&&i("conversations:rename_icon_clicked",r)}},{key:"delete",icon:k(hu,{size:12}),label:s.sidebar.delete,danger:!0,onClick:m=>{m.domEvent.stopPropagation(),i&&i("conversations:delete_icon_clicked",r)}}],b=n?u.activeItemBg||"#f0f4ff":l?u.itemHoverBg||"#f5f7fa":u.itemBg||"transparent",v=n?u.activeItemText||u.primary||"#0122ff":u.itemText||"#333",f=n?u.activeItemBorder||u.primary||"#0122ff":"transparent",d=m=>{const y=to(),F=to(m);return y.isSame(F,"day")?F.format("HH:mm"):F.format("MM-DD HH:mm")};return te("div",{className:"flex relative items-center justify-between mb-2 px-4 py-3 rounded-md transition-colors cursor-pointer select-none",onClick:()=>!e&&i&&i("conversation:item_click",r),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{minHeight:48,background:b,color:v,border:`1px solid ${f}`,...a.item,opacity:e?.5:1},children:[te("div",{className:"flex flex-col gap-y-2 flex-1 min-w-0",children:[k("span",{className:"truncate text-sm max-w-[160px] font-medium",title:r.label||s.sidebar.unnamedSession,style:{color:v,fontSize:"14px",lineHeight:"1.4"},children:r.label||s.sidebar.unnamedSession}),te("div",{className:"flex items-center justify-between gap-2",children:[k("span",{className:"text-xs truncate flex-1",style:{color:n?u.activeItemTextSecondary||"#666":u.itemTextSecondary||"#666",fontSize:"12px",lineHeight:"1.3"},children:h}),r.gmtModified&&k("span",{className:"text-xs flex-shrink-0",style:{color:n?u.activeItemTextSecondary||"#999":u.itemTextSecondary||"#999",fontSize:"12px",lineHeight:"1.3"},children:d(r.gmtModified)})]})]}),!e&&l&&!t&&k("div",{className:"absolute top-2 right-3",children:k(Cc,{menu:{items:p},trigger:["click"],placement:"bottomRight",children:k(uu,{size:16,className:"text-gray-600 hover:text-gray-800",style:{cursor:"pointer",color:n?u.activeItemTextSecondary||"#999":u.itemTextSecondary||"#999"},onClick:m=>m.stopPropagation()})})})]})}function Mu(n,t=[{label:"\u5F53\u5929",dayPeriod:1}]){const e=new Date,r={other:[]};return n.forEach(i=>{const a=new Date(i.gmtModified),o=Math.floor((+e-+a)/(1e3*60*60*24));let s=!1;for(const l of t)if(o<=l.dayPeriod){r[l.label]||(r[l.label]=[]),r[l.label].push(i),s=!0;break}s||r.other.push(i)}),r}/*! @license Rematrix v0.2.2
32
+
33
+ Copyright 2018 Fisssion LLC.
34
+
35
+ Permission is hereby granted, free of charge, to any person obtaining a copy
36
+ of this software and associated documentation files (the "Software"), to deal
37
+ in the Software without restriction, including without limitation the rights
38
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39
+ copies of the Software, and to permit persons to whom the Software is
40
+ furnished to do so, subject to the following conditions:
41
+
42
+ The above copyright notice and this permission notice shall be included in
43
+ all copies or substantial portions of the Software.
44
+
45
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
51
+ THE SOFTWARE.
52
+ */function Qi(n){if(n.constructor!==Array)throw new TypeError("Expected array.");if(n.length===16)return n;if(n.length===6){var t=lr();return t[0]=n[0],t[1]=n[1],t[4]=n[2],t[5]=n[3],t[12]=n[4],t[13]=n[5],t}throw new RangeError("Expected array with either 6 or 16 values.")}function lr(){for(var n=[],t=0;t<16;t++)t%5==0?n.push(1):n.push(0);return n}function Nu(n,t){for(var e=Qi(n),r=Qi(t),i=[],a=0;a<4;a++)for(var o=[e[a],e[a+4],e[a+8],e[a+12]],s=0;s<4;s++){var l=s*4,c=[r[l],r[l+1],r[l+2],r[l+3]],u=o[0]*c[0]+o[1]*c[1]+o[2]*c[2]+o[3]*c[3];i[a+l]=u}return i}function Lu(n){if(typeof n=="string"){var t=n.match(/matrix(3d)?\(([^)]+)\)/);if(t){var e=t[2].split(", ").map(parseFloat);return Qi(e)}}return lr()}function $u(n){var t=lr();return t[0]=n,t}function Bu(n){var t=lr();return t[5]=n,t}function Vu(n){var t=lr();return t[12]=n,t}function ju(n){var t=lr();return t[13]=n,t}var Jr=function(n){return typeof n=="number"},Ms=function(n){return typeof n=="function"},Ns=function(n){return Object.prototype.toString.call(n)==="[object Object]"},Qn=function(n){return Array.prototype.slice.apply(n)},Ls=function(n){var t=n.reduce(function(e,r){return e[r]=(e[r]||0)+1,e},{});return Object.keys(t).filter(function(e){return t[e]>1})};function wn(n){return[].slice.call(arguments,1).forEach(function(t){if(t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}),n}var Zi,ea=function(n,t,e){return n+(t-n)*e},$s={__proto__:null,isNumber:Jr,isFunction:Ms,isObject:Ns,toArray:Qn,getDuplicateValsAsStrings:Ls,assign:wn,tweenProp:ea},La="data-flip-id",$a="data-inverse-flip-id",Ba="data-portal-key",zu="data-exit-container",Vr={__proto__:null,DATA_FLIP_ID:La,DATA_INVERSE_FLIP_ID:$a,DATA_FLIP_CONFIG:"data-flip-config",DATA_PORTAL_KEY:Ba},ta={noWobble:{stiffness:200,damping:26},gentle:{stiffness:120,damping:14},veryGentle:{stiffness:130,damping:17},wobbly:{stiffness:180,damping:12},stiff:{stiffness:260,damping:26}},uo=function(n){return Ns(n)?n:Object.keys(ta).indexOf(n)>-1?ta[n]:{}};typeof window<"u"&&(Zi=window.requestAnimationFrame);var qu=Zi=Zi||function(n){window.setTimeout(n,1e3/60)},Uu=Date.now(),Hu=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()-Uu};function Bs(n,t){var e=n.indexOf(t);e!==-1&&n.splice(e,1)}var Wu=(function(){function n(){}return n.prototype.run=function(){var t=this;qu(function(){t.springSystem.loop(Hu())})},n})(),Ti=function(){this.position=0,this.velocity=0},Gu=0,Lt=.001,Ku=(function(){function n(e){this._id="s"+Gu++,this._springSystem=e,this.listeners=[],this._startValue=0,this._currentState=new Ti,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new Ti,this._restSpeedThreshold=.001,this._tempState=new Ti,this._timeAccumulator=0,this._wasAtRest=!0,this._cachedSpringConfig={}}var t=n.prototype;return t.getId=function(){return this._id},t.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this)},t.setSpringConfig=function(e){return this._springConfig=e,this},t.getCurrentValue=function(){return this._currentState.position},t.getDisplacementDistanceForState=function(e){return Math.abs(this._endValue-e.position)},t.setEndValue=function(e){if(e===this._endValue)return this;if(this.prevEndValue=e,this._endValue===e&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=e,this._springSystem.activateSpring(this.getId());for(var r=0,i=this.listeners.length;r<i;r++){var a=this.listeners[r].onSpringEndStateChange;a&&a(this)}return this},t.setVelocity=function(e){return e===this._currentState.velocity||(this._currentState.velocity=e,this._springSystem.activateSpring(this.getId())),this},t.setCurrentValue=function(e){this._startValue=e,this._currentState.position=e;for(var r=0,i=this.listeners.length;r<i;r++){var a=this.listeners[r];a.onSpringUpdate&&a.onSpringUpdate(this)}return this},t.setAtRest=function(){return this._endValue=this._currentState.position,this._tempState.position=this._currentState.position,this._currentState.velocity=0,this},t.setOvershootClampingEnabled=function(e){return this._overshootClampingEnabled=e,this},t.isOvershooting=function(){var e=this._startValue,r=this._endValue;return this._springConfig.tension>0&&(e<r&&this.getCurrentValue()>r||e>r&&this.getCurrentValue()<r)},t.advance=function(e,r){var i=this.isAtRest();if(!i||!this._wasAtRest){var a=r;r>.064&&(a=.064),this._timeAccumulator+=a;for(var o,s,l,c,u,h,p=this._springConfig.tension,b=this._springConfig.friction,v=this._currentState.position,f=this._currentState.velocity,d=this._tempState.position,m=this._tempState.velocity;this._timeAccumulator>=Lt;)this._timeAccumulator-=Lt,this._timeAccumulator<Lt&&(this._previousState.position=v,this._previousState.velocity=f),s=p*(this._endValue-d)-b*f,c=p*(this._endValue-(d=v+(o=f)*Lt*.5))-b*(m=f+s*Lt*.5),h=p*(this._endValue-(d=v+(l=m)*Lt*.5))-b*(m=f+c*Lt*.5),d=v+(u=m)*Lt,v+=1/6*(o+2*(l+u)+(m=f+h*Lt))*Lt,f+=1/6*(s+2*(c+h)+(p*(this._endValue-d)-b*m))*Lt;this._tempState.position=d,this._tempState.velocity=m,this._currentState.position=v,this._currentState.velocity=f,this._timeAccumulator>0&&this._interpolate(this._timeAccumulator/Lt),(this.isAtRest()||this._overshootClampingEnabled&&this.isOvershooting())&&(this._springConfig.tension>0?(this._startValue=this._endValue,this._currentState.position=this._endValue):(this._endValue=this._currentState.position,this._startValue=this._endValue),this.setVelocity(0),i=!0);var y=!1;this._wasAtRest&&(this._wasAtRest=!1,y=!0);var F=!1;i&&(this._wasAtRest=!0,F=!0),this.notifyPositionUpdated(y,F)}},t.notifyPositionUpdated=function(e,r){var i=this;this.listeners.filter(Boolean).forEach(function(a){e&&a.onSpringActivate&&!i._onActivateCalled&&(a.onSpringActivate(i),i._onActivateCalled=!0),a.onSpringUpdate&&a.onSpringUpdate(i),r&&a.onSpringAtRest&&a.onSpringAtRest(i)})},t.systemShouldAdvance=function(){return!this.isAtRest()||!this.wasAtRest()},t.wasAtRest=function(){return this._wasAtRest},t.isAtRest=function(){return Math.abs(this._currentState.velocity)<this._restSpeedThreshold&&(this.getDisplacementDistanceForState(this._currentState)<=this._displacementFromRestThreshold||this._springConfig.tension===0)},t._interpolate=function(e){this._currentState.position=this._currentState.position*e+this._previousState.position*(1-e),this._currentState.velocity=this._currentState.velocity*e+this._previousState.velocity*(1-e)},t.addListener=function(e){return this.listeners.push(e),this},t.addOneTimeListener=function(e){var r=this;return Object.keys(e).forEach(function(i){var a;e[i]=(a=e[i],function(){a.apply(void 0,[].slice.call(arguments)),r.removeListener(e)})}),this.listeners.push(e),this},t.removeListener=function(e){return Bs(this.listeners,e),this},n})(),Vs=(function(){function n(e){this.looper=e||new Wu,this.looper.springSystem=this,this.listeners=[],this._activeSprings=[],this._idleSpringIndices=[],this._isIdle=!0,this._lastTimeMillis=-1,this._springRegistry={}}var t=n.prototype;return t.createSpring=function(e,r){return this.createSpringWithConfig({tension:e,friction:r})},t.createSpringWithConfig=function(e){var r=new Ku(this);return this.registerSpring(r),r.setSpringConfig(e),r},t.getIsIdle=function(){return this._isIdle},t.registerSpring=function(e){this._springRegistry[e.getId()]=e},t.deregisterSpring=function(e){Bs(this._activeSprings,e),delete this._springRegistry[e.getId()]},t.advance=function(e,r){for(var i=this;this._idleSpringIndices.length>0;)this._idleSpringIndices.pop();for(this._activeSprings.filter(Boolean).forEach(function(o){o.systemShouldAdvance()?o.advance(e/1e3,r/1e3):i._idleSpringIndices.push(i._activeSprings.indexOf(o))});this._idleSpringIndices.length>0;){var a=this._idleSpringIndices.pop();a>=0&&this._activeSprings.splice(a,1)}},t.loop=function(e){var r;this._lastTimeMillis===-1&&(this._lastTimeMillis=e-1);var i=e-this._lastTimeMillis;this._lastTimeMillis=e;var a=0,o=this.listeners.length;for(a=0;a<o;a++)(r=this.listeners[a]).onBeforeIntegrate&&r.onBeforeIntegrate(this);for(this.advance(e,i),this._activeSprings.length===0&&(this._isIdle=!0,this._lastTimeMillis=-1),a=0;a<o;a++)(r=this.listeners[a]).onAfterIntegrate&&r.onAfterIntegrate(this);this._isIdle||this.looper.run()},t.activateSpring=function(e){var r=this._springRegistry[e];this._activeSprings.indexOf(r)===-1&&this._activeSprings.push(r),this.getIsIdle()&&(this._isIdle=!1,this.looper.run())},n})(),Xu=new Vs,js=function(n){var t=n.springConfig,e=t.overshootClamping,r=n.getOnUpdateFunc,i=n.onAnimationEnd,a=n.onSpringActivate,o=Xu.createSpring(t.stiffness,t.damping);o.setOvershootClampingEnabled(!!e);var s={onSpringActivate:a,onSpringAtRest:function(){o.destroy(),i()},onSpringUpdate:r({spring:o,onAnimationEnd:i})};return o.addListener(s),o},fo=function(n){var t=js(n);return t.setEndValue(1),t},po=function(n,t){if(t===void 0&&(t={}),n&&n.length){t.reverse&&n.reverse();var e,r=typeof(e=t.speed)!="number"?1.1:1+Math.min(Math.max(5*e,0),5),i=1/Math.max(Math.min(n.length,100),10),a=n.map(function(o,s){var l=o.getOnUpdateFunc;return o.getOnUpdateFunc=function(c){var u=l(c);return function(h){var p=h.getCurrentValue();(p=p<.01?0:p>.99?1:p)>=i&&a[s+1]&&a[s+1](Math.max(Math.min(p*r,1),0)),u(h)}},o}).map(function(o){var s=js(o);if(s)return s.setEndValue.bind(s)}).filter(Boolean);a[0]&&a[0](1)}},ho=function(n){return[0,1,4,5,12,13].map(function(t){return n[t]})},go=function(n){return n.top<window.innerHeight&&n.bottom>0&&n.left<window.innerWidth&&n.right>0};function mo(n){return JSON.parse(n.dataset.flipConfig||"{}")}var zs=function(n,t){var e;return wn(n,((e={})[t[0]]=t[1],e))},qs=function(n,t){return Qn(t?document.querySelectorAll("["+Ba+'="'+t+'"]'):n.querySelectorAll("["+La+"]"))},Us=function(n){return n.map(function(t){return[t,t.getBoundingClientRect()]})},Ju=function(n){var t=n.cachedOrderedFlipIds,e=t===void 0?[]:t,r=n.inProgressAnimations,i=r===void 0?{}:r,a=n.flippedElementPositionsBeforeUpdate,o=a===void 0?{}:a,s=n.flipCallbacks,l=s===void 0?{}:s,c=n.containerEl,u=n.applyTransformOrigin,h=n.spring,p=n.debug,b=n.portalKey,v=n.staggerConfig,f=v===void 0?{}:v,d=n.decisionData,m=d===void 0?{}:d,y=n.handleEnterUpdateDelete,F=n.onComplete,_=n.onStart;if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var S,A=Us(qs((S={element:c,portalKey:b}).element,S.portalKey)).map(function(z){var J=z[0],H=z[1],K=window.getComputedStyle(J);return[J.dataset.flipId,{element:J,rect:H,opacity:parseFloat(K.opacity),transform:K.transform}]}).reduce(zs,{}),T=(function(z){var J=z.containerEl,H=z.portalKey;return H?(function(K){return function(B){return Qn(document.querySelectorAll("["+Ba+'="'+K+'"]'+B))}})(H):J?(function(K){var B=Math.random().toFixed(5);return K.dataset.flipperId=B,function(V){return Qn(K.querySelectorAll('[data-flipper-id="'+B+'"] '+V))}})(J):function(){return[]}})({containerEl:c,portalKey:b}),E=(function(z){return function(J){return z("["+La+'="'+J+'"]')[0]}})(T),w=function(z){return o[z]&&A[z]},g=Object.keys(o).concat(Object.keys(A)).filter(function(z){return!w(z)}),O={flipCallbacks:l,getElement:E,flippedElementPositionsBeforeUpdate:o,flippedElementPositionsAfterUpdate:A,inProgressAnimations:i,decisionData:m},D=(function(z){var J,H=z.unflippedIds,K=z.flipCallbacks,B=z.getElement,V=z.flippedElementPositionsBeforeUpdate,M=z.flippedElementPositionsAfterUpdate,j=z.inProgressAnimations,X=z.decisionData,Z=H.filter(function(de){return M[de]}).filter(function(de){return K[de]&&K[de].onAppear}),he=H.filter(function(de){return V[de]&&K[de]&&K[de].onExit}),ee=new Promise(function(de){J=de}),ne=[],Ee=0,Se=he.map(function(de,$e){var He=V[de].domDataForExitAnimations,me=He.element,ft=He.parent,pt=He.childPosition,at=pt.top,vt=pt.left,Te=pt.width,Pe=pt.height;getComputedStyle(ft).position==="static"&&(ft.style.position="relative"),me.style.transform="matrix(1, 0, 0, 1, 0, 0)",me.style.position="absolute",me.style.top=at+"px",me.style.left=vt+"px",me.style.height=Pe+"px",me.style.width=Te+"px";var Ye=ne.filter(function(Ge){return Ge[0]===ft})[0];Ye||(Ye=[ft,document.createDocumentFragment()],ne.push(Ye)),Ye[1].appendChild(me),Ee+=1;var We=function(){try{ft.removeChild(me)}catch{}finally{(Ee-=1)==0&&J()}};return j[de]={stop:We},function(){return K[de].onExit(me,$e,We,X)}});return ne.forEach(function(de){de[0].appendChild(de[1])}),Se.length||J(),{hideEnteringElements:function(){Z.forEach(function(de){var $e=B(de);$e&&($e.style.opacity="0")})},animateEnteringElements:function(){Z.forEach(function(de,$e){var He=B(de);He&&K[de].onAppear(He,$e,X)})},animateExitingElements:function(){return Se.forEach(function(de){return de()}),ee}}})(wn({},O,{unflippedIds:g})),R=D.hideEnteringElements,P=D.animateEnteringElements,W=D.animateExitingElements,U=wn({},O,{containerEl:c,flippedIds:e.filter(w),applyTransformOrigin:u,spring:h,debug:p,staggerConfig:f,scopedSelector:T,onComplete:F});_&&_(c,m);var q=(function(z){var J,H=z.flippedIds,K=z.flipCallbacks,B=z.inProgressAnimations,V=z.flippedElementPositionsBeforeUpdate,M=z.flippedElementPositionsAfterUpdate,j=z.applyTransformOrigin,X=z.spring,Z=z.getElement,he=z.debug,ee=z.staggerConfig,ne=ee===void 0?{}:ee,Ee=z.decisionData,Se=Ee===void 0?{}:Ee,de=z.onComplete,$e=z.containerEl,He=new Promise(function(Y){J=Y});if(de&&He.then(function(){return de($e,Se)}),!H.length)return function(){return J([]),He};var me=[],ft=Z(H[0]),pt=ft?ft.ownerDocument.querySelector("body"):document.querySelector("body");Ls(H);var at=H.map(function(Y){var xe=V[Y].rect,nt=M[Y].rect,Ot=V[Y].opacity,Rt=M[Y].opacity,Nn=nt.width<1||nt.height<1,Ke=M[Y].element;if(!go(xe)&&!go(nt)||!Ke)return!1;var zt,_n,fr,kt=mo(Ke),kn=(fr=(_n=(zt={flipperSpring:X,flippedSpring:kt.spring})===void 0?{}:zt).flippedSpring,wn({},ta.noWobble,uo(_n.flipperSpring),uo(fr))),In=kt.stagger===!0?"default":kt.stagger,pr={element:Ke,id:Y,stagger:In,springConfig:kn};if(K[Y]&&K[Y].shouldFlip&&!K[Y].shouldFlip(Se.previous,Se.current))return!1;var Tn=Math.abs(xe.left-nt.left)+Math.abs(xe.top-nt.top),hr=Math.abs(xe.width-nt.width)+Math.abs(xe.height-nt.height),gr=Math.abs(Rt-Ot);if(xe.height===0&&nt.height===0||xe.width===0&&nt.width===0||Tn<.5&&hr<.5&&gr<.01)return!1;var mr=Lu(M[Y].transform),qt={matrix:mr},bt={matrix:[]},Mt=[mr];kt.translate&&(Mt.push(Vu(xe.left-nt.left)),Mt.push(ju(xe.top-nt.top))),kt.scale&&(Mt.push($u(Math.max(xe.width,1)/Math.max(nt.width,1))),Mt.push(Bu(Math.max(xe.height,1)/Math.max(nt.height,1)))),kt.opacity&&(bt.opacity=Ot,qt.opacity=Rt);var Ut=[];if(!K[Y]||!K[Y].shouldInvert||K[Y].shouldInvert(Se.previous,Se.current)){var cn=(function(be,et){return Qn(be.querySelectorAll("["+$a+'="'+et+'"]'))})(Ke,Y);Ut=cn.map(function(be){return[be,mo(be)]})}bt.matrix=ho(Mt.reduce(Nu)),qt.matrix=ho(qt.matrix);var un,Ze=(function(be){var et=be.element,Ht=be.invertedChildren,Ie=be.body;return function(Re){var ot=Re.matrix,ct=Re.opacity,Wt=Re.forceMinVals;if(Jr(ct)&&(et.style.opacity=ct+""),Wt&&(et.style.minHeight="1px",et.style.minWidth="1px"),ot){var Ln=(function(It){return"matrix("+It.join(", ")+")"})(ot);et.style.transform=Ln,Ht&&(function(It){var Zt=It.matrix,$n=It.body;It.invertedChildren.forEach(function(Bn){var Vn=Bn[0],Et=Bn[1];if($n.contains(Vn)){var Mr=Zt[0],Nr=Zt[3],wi=Zt[5],en={translateX:0,translateY:0,scaleX:1,scaleY:1},mn="";Et.translate&&(en.translateX=-Zt[4]/Mr,en.translateY=-wi/Nr,mn+="translate("+en.translateX+"px, "+en.translateY+"px)"),Et.scale&&(en.scaleX=1/Mr,en.scaleY=1/Nr,mn+=" scale("+en.scaleX+", "+en.scaleY+")"),Vn.style.transform=mn}})})({invertedChildren:Ht,matrix:ot,body:Ie})}}})({element:Ke,invertedChildren:Ut,body:pt});if(K[Y]&&K[Y].onComplete){var oe=K[Y].onComplete;un=function(){return oe(Ke,Se)}}var Qt=Jr(bt.opacity)&&Jr(qt.opacity)&&bt.opacity!==qt.opacity,gn=!1;return wn({},pr,{stagger:In,springConfig:kn,getOnUpdateFunc:function(be){var et=be.spring,Ht=be.onAnimationEnd;return B[Y]={destroy:et.destroy.bind(et),onAnimationEnd:Ht},function(Ie){K[Y]&&K[Y].onSpringUpdate&&K[Y].onSpringUpdate(Ie.getCurrentValue()),gn||(gn=!0,K[Y]&&K[Y].onStart&&K[Y].onStart(Ke,Se));var Re=Ie.getCurrentValue();if(pt.contains(Ke)){var ot={matrix:[]};ot.matrix=bt.matrix.map(function(ct,Wt){return ea(ct,qt.matrix[Wt],Re)}),Qt&&(ot.opacity=ea(bt.opacity,qt.opacity,Re)),Ze(ot)}else Ie.destroy()}},initializeFlip:function(){Ze({matrix:bt.matrix,opacity:Qt?bt.opacity:void 0,forceMinVals:Nn}),K[Y]&&K[Y].onStartImmediate&&K[Y].onStartImmediate(Ke,Se),kt.transformOrigin?Ke.style.transformOrigin=kt.transformOrigin:j&&(Ke.style.transformOrigin="0 0"),Ut.forEach(function(be){var et=be[0],Ht=be[1];Ht.transformOrigin?et.style.transformOrigin=Ht.transformOrigin:j&&(et.style.transformOrigin="0 0")})},onAnimationEnd:function(be){delete B[Y],Ms(un)&&un(),Ke.style.transform="",Ut.forEach(function(et){et[0].style.transform=""}),Nn&&Ke&&(Ke.style.minHeight="",Ke.style.minWidth=""),be||(me.push(Y),me.length>=at.length&&J(me))},delayUntil:kt.delayUntil})}).filter(Boolean);if(at.forEach(function(Y){return(0,Y.initializeFlip)()}),he)return function(){};var vt=at.filter(function(Y){return Y.delayUntil&&(xe=Y.delayUntil,at.filter(function(nt){return nt.id===xe}).length);var xe}),Te={},Pe={},Ye={};vt.forEach(function(Y){Y.stagger?(Ye[Y.stagger]=!0,Pe[Y.delayUntil]?Pe[Y.delayUntil].push(Y.stagger):Pe[Y.delayUntil]=[Y.stagger]):Te[Y.delayUntil]?Te[Y.delayUntil].push(Y):Te[Y.delayUntil]=[Y]});var We=at.filter(function(Y){return Y.stagger}).reduce(function(Y,xe){return Y[xe.stagger]?Y[xe.stagger].push(xe):Y[xe.stagger]=[xe],Y},{}),Ge=at.filter(function(Y){return vt.indexOf(Y)===-1});return Ge.forEach(function(Y){Y.onSpringActivate=function(){Te[Y.id]&&Te[Y.id].forEach(fo),Pe[Y.id]&&Object.keys(Pe[Y.id].reduce(function(xe,nt){var Ot;return wn(xe,((Ot={})[nt]=!0,Ot))},{})).forEach(function(xe){po(We[xe],ne[xe])})}}),function(){return at.length||J([]),Ge.filter(function(Y){return!Y.stagger}).forEach(fo),Object.keys(We).forEach(function(Y){Ye[Y]||po(We[Y],ne[Y])}),He}})(U);y?y({hideEnteringElements:R,animateEnteringElements:P,animateExitingElements:W,animateFlippedElements:q}):(R(),W().then(P),q())}},Yu=function(n){var t=n.element,e=n.flipCallbacks,r=e===void 0?{}:e,i=n.inProgressAnimations,a=i===void 0?{}:i,o=qs(t,n.portalKey),s=Qn(t.querySelectorAll("["+$a+"]")),l={},c=[],u={};o.filter(function(b){return r&&r[b.dataset.flipId]&&r[b.dataset.flipId].onExit}).forEach(function(b){var v=b.parentNode;if(b.closest){var f=b.closest("["+zu+"]");f&&(v=f)}var d=c.findIndex(function(m){return m[0]===v});d===-1&&(c.push([v,v.getBoundingClientRect()]),d=c.length-1),l[b.dataset.flipId]=c[d][1],u[b.dataset.flipId]=v});var h=Us(o),p=h.map(function(b){var v=b[0],f=b[1],d={};if(r&&r[v.dataset.flipId]&&r[v.dataset.flipId].onExit){var m=l[v.dataset.flipId];wn(d,{element:v,parent:u[v.dataset.flipId],childPosition:{top:f.top-m.top,left:f.left-m.left,width:f.width,height:f.height}})}return[v.dataset.flipId,{rect:f,opacity:parseFloat(window.getComputedStyle(v).opacity||"1"),domDataForExitAnimations:d}]}).reduce(zs,{});return(function(b,v){Object.keys(b).forEach(function(f){b[f].destroy&&b[f].destroy(),b[f].onAnimationEnd&&b[f].onAnimationEnd(!0),delete b[f]}),v.forEach(function(f){f.style.transform="",f.style.opacity=""})})(a,o.concat(s)),{flippedElementPositions:p,cachedOrderedFlipIds:h.map(function(b){return b[0].dataset.flipId})}};new Vs;function oi(){return oi=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},oi.apply(this,arguments)}function na(n,t){return na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},na(n,t)}function Hs(n,t){if(n==null)return{};var e,r,i={},a=Object.keys(n);for(r=0;r<a.length;r++)t.indexOf(e=a[r])>=0||(i[e]=n[e]);return i}var Ws=di({}),Gs=di("portal"),Ks=(function(n){var t,e;function r(){for(var a,o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return(a=n.call.apply(n,[this].concat(s))||this).inProgressAnimations={},a.flipCallbacks={},a.el=void 0,a}e=n,(t=r).prototype=Object.create(e.prototype),t.prototype.constructor=t,na(t,e);var i=r.prototype;return i.getSnapshotBeforeUpdate=function(a){return a.flipKey!==this.props.flipKey&&this.el?Yu({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},i.componentDidUpdate=function(a,o,s){this.props.flipKey!==a.flipKey&&this.el&&Ju({flippedElementPositionsBeforeUpdate:s.flippedElementPositions,cachedOrderedFlipIds:s.cachedOrderedFlipIds,containerEl:this.el,inProgressAnimations:this.inProgressAnimations,flipCallbacks:this.flipCallbacks,applyTransformOrigin:this.props.applyTransformOrigin,spring:this.props.spring,debug:this.props.debug,portalKey:this.props.portalKey,staggerConfig:this.props.staggerConfig,handleEnterUpdateDelete:this.props.handleEnterUpdateDelete,decisionData:{previous:a.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart})},i.render=function(){var a=this,o=this.props,s=o.portalKey,l=ye.createElement(Ws.Provider,{value:this.flipCallbacks},ye.createElement(o.element,{className:o.className,ref:function(c){return a.el=c}},this.props.children));return s&&(l=ye.createElement(Gs.Provider,{value:s},l)),l},r})(fc);Ks.defaultProps={applyTransformOrigin:!0,element:"div"};var Qu=["children","flipId","inverseFlipId","portalKey"],Zu=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],vo=function(n){var t,e=n.children,r=n.flipId,i=n.inverseFlipId,a=n.portalKey,o=Hs(n,Qu),s=e,l=(function(u){return typeof u=="function"})(s);if(!l)try{s=uc.only(e)}catch{throw new Error("Each Flipped component must wrap a single child")}o.scale||o.translate||o.opacity||$s.assign(o,{translate:!0,scale:!0,opacity:!0});var c=((t={})[Vr.DATA_FLIP_CONFIG]=JSON.stringify(o),t);return r!==void 0?c[Vr.DATA_FLIP_ID]=String(r):i&&(c[Vr.DATA_INVERSE_FLIP_ID]=String(i)),a!==void 0&&(c[Vr.DATA_PORTAL_KEY]=a),l?s(c):dc(s,c)},Xs=function(n){var t=n.children,e=n.flipId,r=n.shouldFlip,i=n.shouldInvert,a=n.onAppear,o=n.onStart,s=n.onStartImmediate,l=n.onComplete,c=n.onExit,u=n.onSpringUpdate,h=Hs(n,Zu);return t?h.inverseFlipId?ye.createElement(vo,oi({},h),t):ye.createElement(Gs.Consumer,null,function(p){return ye.createElement(Ws.Consumer,null,function(b){return $s.isObject(b)&&e&&(b[e]={shouldFlip:r,shouldInvert:i,onAppear:a,onStart:o,onStartImmediate:s,onComplete:l,onExit:c,onSpringUpdate:u}),ye.createElement(vo,oi({flipId:e},h,{portalKey:p}),t)})}):null};Xs.displayName="Flipped";function ed(n){const{data:t,activedItem:e,onChange:r,onDelete:i,sortRules:a=[{label:"\u5F53\u5929",dayPeriod:1}],eventsEmit:o,assistantList:s,height:l=400,styles:c={},hasMore:u=!1,loadingMore:h=!1}=n,p=t.map(w=>w.sessionId+"-"+w.gmtModified).join(","),b=ze(()=>{const w=a.length>0?a:[{label:"\u5F53\u5929",dayPeriod:1}],g=Mu(t,w),O=w.every(R=>!g[R.label]||g[R.label].length===0),D=[];return w.forEach(R=>{g[R.label]&&g[R.label].length>0&&(D.push({type:"group",label:R.label}),g[R.label].forEach(P=>D.push({type:"item",data:P})))}),g.other.length>0&&!O&&(D.push({type:"group",label:"\u5176\u4ED6"}),g.other.forEach(R=>D.push({type:"item",data:R}))),O&&g.other.length>0&&g.other.forEach(R=>D.push({type:"item",data:R})),D},[t,a,p]),v=ze(()=>b.map(w=>w.type==="group"?`g:${w.label}`:`i:${w.data.sessionId}`).join("|"),[b]),f=56,d=14,m=36,y=w=>w===b.length?m:b[w].type==="group"?32:f+d,F=Le(null),_=ze(()=>b.findIndex(w=>{var g;return w.type==="item"&&((g=w.data)==null?void 0:g.sessionId)===e}),[b,e]),S=ze(()=>b.findIndex(w=>w.type==="item"),[b]),A=Le(void 0);_e(()=>{const w=A.current;e!==w&&_>-1&&_===S&&F.current&&F.current.scrollToItem(_,"start"),A.current=e},[e,_,S]);const T=Le(0);if(_e(()=>{if(F.current){const w=T.current,g=b.length;if(T.current=g,g!==w){const D=(w>0?Math.abs(g-w)/w:1)>.5||w<10&&g>20;F.current.resetAfterIndex(0,D)}}},[b.length]),_e(()=>{F.current&&F.current.resetAfterIndex(0,!0)},[v]),b.length===0)return k("div",{className:"text-center text-zinc-400 py-8",children:"\u6682\u65E0\u4F1A\u8BDD"});const E=(c==null?void 0:c.colors)||{};return k(Ks,{flipKey:p,spring:{stiffness:180,damping:18},children:k(Ou,{ref:F,height:l,width:"100%",itemCount:b.length+1,itemSize:y,itemKey:w=>{if(w===b.length)return"footer";const g=b[w];return g.type==="item"?g.data.sessionId:`group-${g.label}`},onItemsRendered:({visibleStopIndex:w})=>{u&&!h&&w>=b.length-1-3&&typeof o=="function"&&o("conversations:load_more")},style:{overflowX:"hidden"},children:({index:w,style:g})=>{if(w===b.length){const D=(c==null?void 0:c.colors)||{};return k("div",{style:{...g,height:m,lineHeight:`${m}px`,textAlign:"center",fontSize:"10px",color:D.textMuted||"#9ca3af",background:D.groupBg||"white"},children:h?"\u52A0\u8F7D\u4E2D...":u?"":"\u6CA1\u6709\u66F4\u591A\u4E86"})}const O=b[w];return O.type==="group"?k("div",{style:{...g,background:E.groupBg||"white",zIndex:1},className:"pt-2 pb-1 px-[28px] py-[2px] text-xs text-gray-400",children:O.label}):k(Xs,{flipId:O.data.sessionId,children:k("div",{style:g,className:"px-[12px] py-[2px]",children:k(Ru,{isActive:e===O.data.sessionId,isDisabled:!1,isNew:O.data.isNew,data:O.data,eventsEmit:o,assistantList:s,styles:c})})},O.data.sessionId)}})})}const td=({value:n,eventsEmit:t,setSearch:e,style:r,styles:i={}})=>{const{messages:a}=pi(),o=i.colors||{},s=i.radius||"12px",l=o.border||"#e5e7eb",c=o.primary||"#2563eb",u=i.headerBg||o.sidebarBg||o.background||"#fff",[h,p]=ye.useState(!1),b=ye.useRef(null);ye.useEffect(()=>{h&&b.current&&b.current.focus()},[h]);const v=()=>{p(!1),e("")};return te("div",{className:"flex items-center gap-2 px-4 py-3 sticky top-0 z-10 min-w-0",style:{...r,background:u,borderTopLeftRadius:s,borderTopRightRadius:s},children:[k("button",{className:"border-none flex items-center justify-center",onClick:()=>{p(!1),t&&t("conversation:create")},title:a.sidebar.newConversation,style:{height:42,borderRadius:"90px",background:c,color:o.buttonText||"#fff",fontWeight:600,boxShadow:i.shadow||"0 2px 8px 0 rgba(0,0,0,0.04)",padding:h?"0 0":"0 14px",minWidth:h?0:180,width:h?0:void 0,opacity:h?0:1,overflow:"hidden",flexShrink:0,transition:"width .22s ease, min-width .22s ease, padding .22s ease, opacity .18s ease",pointerEvents:h?"none":"auto"},children:te("div",{className:"flex items-center gap-2",children:[k(Mc,{size:18}),k("span",{className:"text-sm",children:a.sidebar.newChat})]})}),h?te("div",{className:"flex-1 min-w-0 relative",children:[k("input",{ref:b,className:"w-full px-3 py-2 pr-10 text-sm transition-all",placeholder:a.sidebar.searchPlaceholder,value:n,onChange:f=>e(f.target.value),onKeyDown:f=>{f.key==="Escape"&&v()},style:{minWidth:0,width:"100%",borderRadius:s,background:o.inputBg||"#f4f4f5",border:`1px solid ${l}`,color:o.text||"#222",outline:"none",paddingRight:40}}),k("button",{className:"absolute right-3 flex items-center justify-center transition-colors hover:bg-gray-200 rounded-full",style:{width:20,height:20,color:o.text||"#666",flexShrink:0,position:"absolute",right:"12px",top:"9px"},onClick:v,title:"\u5173\u95ED\u641C\u7D22",onMouseDown:f=>f.preventDefault(),children:k(Es,{size:16})})]}):k("button",{className:"ml-auto flex items-center justify-center transition-colors hover:bg-gray-50",style:{width:36,height:36,borderRadius:"90px",border:`1px solid ${l}`,color:c,flexShrink:0},onClick:()=>p(!0),title:a.sidebar.search,children:k(Ki,{size:18})})]})};function nd(n){const{data:t,sortRules:e,activedItem:r,eventsEmit:i,assistantList:a,styles:o={},hasMore:s=!1,loadingMore:l=!1}=n,{messages:c}=pi(),[u,h]=le(""),p=ze(()=>u?t.filter(A=>(A.label||c.sidebar.unnamedSession).toLowerCase().includes(u.toLowerCase())):t,[t,u,c.sidebar.unnamedSession]),b=ze(()=>[...p].sort((A,T)=>new Date(T.gmtModified).getTime()-new Date(A.gmtModified).getTime()),[p]),v=Le(null),[f,d]=le(400);_e(()=>{function A(){v.current&&d(v.current.clientHeight)}return A(),window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]);const m=(o==null?void 0:o.colors)||{};o!=null&&o.radius;const y=(o==null?void 0:o.shadow)||"0 4px 24px 0 rgba(0,0,0,0.06)",F=m.border||"#e5e7eb",_=m.sidebarBg||m.background||"#EAEEFF",S=m.text||"#222";return te("div",{className:"h-full flex flex-col overflow-y-hidden",style:{background:_,color:S,boxShadow:y,border:`1px solid ${F}`,...o.container},children:[k(td,{value:u,setSearch:h,eventsEmit:i,style:o.header,styles:o}),te("div",{className:"flex-1 min-h-0 relative",ref:v,style:o.list,children:[k(ed,{eventsEmit:i,data:b,assistantList:a,activedItem:r,sortRules:e,height:f,styles:o,hasMore:s,loadingMore:l}),k("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-3 z-20",style:{background:`linear-gradient(to bottom, ${_}cc, transparent)`}})]})]})}const rd=ye.createContext({});function Fr(n){for(var t=0,e,r=0,i=n.length;i>=4;++r,i-=4)e=n.charCodeAt(r)&255|(n.charCodeAt(++r)&255)<<8|(n.charCodeAt(++r)&255)<<16|(n.charCodeAt(++r)&255)<<24,e=(e&65535)*1540483477+((e>>>16)*59797<<16),e^=e>>>24,t=(e&65535)*1540483477+((e>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(n.charCodeAt(r+2)&255)<<16;case 2:t^=(n.charCodeAt(r+1)&255)<<8;case 1:t^=n.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}function Js(n,t,e){var r=I.useRef({});return(!("value"in r.current)||e(r.current.condition,t))&&(r.current.value=n(),r.current.condition=t),r.current.value}function ra(n,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function i(a,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=r.has(a);if(pn(!l,"Warning: There may be circular references"),l)return!1;if(a===o)return!0;if(e&&s>1)return!1;r.add(a);var c=s+1;if(Array.isArray(a)){if(!Array.isArray(o)||a.length!==o.length)return!1;for(var u=0;u<a.length;u++)if(!i(a[u],o[u],c))return!1;return!0}if(a&&o&&Fe(a)==="object"&&Fe(o)==="object"){var h=Object.keys(a);return h.length!==Object.keys(o).length?!1:h.every(function(p){return i(a[p],o[p],c)})}return!1}return i(n,t)}var id="%";function ia(n){return n.join(id)}var ad=(function(){function n(t){St(this,n),N(this,"instanceId",void 0),N(this,"cache",new Map),N(this,"extracted",new Set),this.instanceId=t}return Ft(n,[{key:"get",value:function(e){return this.opGet(ia(e))}},{key:"opGet",value:function(e){return this.cache.get(e)||null}},{key:"update",value:function(e,r){return this.opUpdate(ia(e),r)}},{key:"opUpdate",value:function(e,r){var i=this.cache.get(e),a=r(i);a===null?this.cache.delete(e):this.cache.set(e,a)}}]),n})(),Sr="data-token-hash",sn="data-css-hash",Fn="__cssinjs_instance__";function od(){var n=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(sn,"]"))||[],e=document.head.firstChild;Array.from(t).forEach(function(i){i[Fn]=i[Fn]||n,i[Fn]===n&&document.head.insertBefore(i,e)});var r={};Array.from(document.querySelectorAll("style[".concat(sn,"]"))).forEach(function(i){var a=i.getAttribute(sn);if(r[a]){if(i[Fn]===n){var o;(o=i.parentNode)===null||o===void 0||o.removeChild(i)}}else r[a]=!0})}return new ad(n)}var Pr=I.createContext({hashPriority:"low",cache:od(),defaultCache:!0});function cr(n){var t=Fs();return function(){var e,r=Gi(n);if(t){var i=Gi(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return _c(this,e)}}function sd(n,t){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(n[e]!==t[e])return!1;return!0}var Va=(function(){function n(){St(this,n),N(this,"cache",void 0),N(this,"keys",void 0),N(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return Ft(n,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(e){var r,i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o={map:this.cache};return e.forEach(function(s){if(!o)o=void 0;else{var l;o=(l=o)===null||l===void 0||(l=l.map)===null||l===void 0?void 0:l.get(s)}}),(r=o)!==null&&r!==void 0&&r.value&&a&&(o.value[1]=this.cacheCallTimes++),(i=o)===null||i===void 0?void 0:i.value}},{key:"get",value:function(e){var r;return(r=this.internalGet(e,!0))===null||r===void 0?void 0:r[0]}},{key:"has",value:function(e){return!!this.internalGet(e)}},{key:"set",value:function(e,r){var i=this;if(!this.has(e)){if(this.size()+1>n.MAX_CACHE_SIZE+n.MAX_CACHE_OFFSET){var a=this.keys.reduce(function(c,u){var h=fe(c,2),p=h[1];return i.internalGet(u)[1]<p?[u,i.internalGet(u)[1]]:c},[this.keys[0],this.cacheCallTimes]),o=fe(a,1),s=o[0];this.delete(s)}this.keys.push(e)}var l=this.cache;e.forEach(function(c,u){if(u===e.length-1)l.set(c,{value:[r,i.cacheCallTimes++]});else{var h=l.get(c);h?h.map||(h.map=new Map):l.set(c,{map:new Map}),l=l.get(c).map}})}},{key:"deleteByPath",value:function(e,r){var i=e.get(r[0]);if(r.length===1){var a;return i.map?e.set(r[0],{map:i.map}):e.delete(r[0]),(a=i.value)===null||a===void 0?void 0:a[0]}var o=this.deleteByPath(i.map,r.slice(1));return(!i.map||i.map.size===0)&&!i.value&&e.delete(r[0]),o}},{key:"delete",value:function(e){if(this.has(e))return this.keys=this.keys.filter(function(r){return!sd(r,e)}),this.deleteByPath(this.cache,e)}}]),n})();N(Va,"MAX_CACHE_SIZE",20);N(Va,"MAX_CACHE_OFFSET",5);var yo=0,Ys=(function(){function n(t){St(this,n),N(this,"derivatives",void 0),N(this,"id",void 0),this.derivatives=Array.isArray(t)?t:[t],this.id=yo,t.length===0&&kc(t.length>0),yo+=1}return Ft(n,[{key:"getDerivativeToken",value:function(e){return this.derivatives.reduce(function(r,i){return i(e,r)},void 0)}}]),n})(),Pi=new Va;function aa(n){var t=Array.isArray(n)?n:[n];return Pi.has(t)||Pi.set(t,new Ys(t)),Pi.get(t)}var ld=new WeakMap,Di={};function cd(n,t){for(var e=ld,r=0;r<t.length;r+=1){var i=t[r];e.has(i)||e.set(i,new WeakMap),e=e.get(i)}return e.has(Di)||e.set(Di,n()),e.get(Di)}var bo=new WeakMap;function Cr(n){var t=bo.get(n)||"";return t||(Object.keys(n).forEach(function(e){var r=n[e];t+=e,r instanceof Ys?t+=r.id:r&&Fe(r)==="object"?t+=Cr(r):t+=r}),t=Fr(t),bo.set(n,t)),t}function Co(n,t){return Fr("".concat(t,"_").concat(Cr(n)))}var oa=An();function xo(n){return typeof n=="number"?"".concat(n,"px"):n}var Yr=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(e?"".concat(e,"-"):"").concat(t).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},ud=function(t,e,r){return Object.keys(t).length?".".concat(e).concat(r!=null&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(t).map(function(i){var a=fe(i,2),o=a[0],s=a[1];return"".concat(o,":").concat(s,";")}).join(""),"}"):""},Qs=function(t,e,r){var i={},a={};return Object.entries(t).forEach(function(o){var s,l,c=fe(o,2),u=c[0],h=c[1];if(r!=null&&(s=r.preserve)!==null&&s!==void 0&&s[u])a[u]=h;else if((typeof h=="string"||typeof h=="number")&&!(r!=null&&(l=r.ignore)!==null&&l!==void 0&&l[u])){var p,b=Yr(u,r==null?void 0:r.prefix);i[b]=typeof h=="number"&&!(r!=null&&(p=r.unitless)!==null&&p!==void 0&&p[u])?"".concat(h,"px"):String(h),a[u]="var(".concat(b,")")}}),[a,ud(i,e,{scope:r==null?void 0:r.scope})]},wo=An()?I.useLayoutEffect:I.useEffect,dd=function(t,e){var r=I.useRef(!0);wo(function(){return t(r.current)},e),wo(function(){return r.current=!1,function(){r.current=!0}},[])},fd=G({},I),Fo=fd.useInsertionEffect,pd=function(t,e,r){I.useMemo(t,r),dd(function(){return e(!0)},r)},hd=Fo?function(n,t,e){return Fo(function(){return n(),t()},e)}:pd,gd=G({},I),md=gd.useInsertionEffect,vd=function(t){var e=[],r=!1;function i(a){r||e.push(a)}return I.useEffect(function(){return r=!1,function(){r=!0,e.length&&e.forEach(function(a){return a()})}},t),i},yd=function(){return function(t){t()}},bd=typeof md<"u"?vd:yd;function ja(n,t,e,r,i){var a=I.useContext(Pr),o=a.cache,s=[n].concat(ce(t)),l=ia(s),c=bd([l]),u=function(v){o.opUpdate(l,function(f){var d=f||[void 0,void 0],m=fe(d,2),y=m[0],F=y===void 0?0:y,_=m[1],S=_,A=S||e(),T=[F,A];return v?v(T):T})};I.useMemo(function(){u()},[l]);var h=o.opGet(l),p=h[1];return hd(function(){i==null||i(p)},function(b){return u(function(v){var f=fe(v,2),d=f[0],m=f[1];return b&&d===0&&(i==null||i(p)),[d+1,m]}),function(){o.opUpdate(l,function(v){var f=v||[],d=fe(f,2),m=d[0],y=m===void 0?0:m,F=d[1],_=y-1;return _===0?(c(function(){(b||!o.opGet(l))&&(r==null||r(F,!1))}),null):[y-1,F]})}},[l]),p}var Cd={},xd="css",Pn=new Map;function wd(n){Pn.set(n,(Pn.get(n)||0)+1)}function Fd(n,t){if(typeof document<"u"){var e=document.querySelectorAll("style[".concat(Sr,'="').concat(n,'"]'));e.forEach(function(r){if(r[Fn]===t){var i;(i=r.parentNode)===null||i===void 0||i.removeChild(r)}})}}var Sd=0;function Ed(n,t){Pn.set(n,(Pn.get(n)||0)-1);var e=new Set;Pn.forEach(function(r,i){r<=0&&e.add(i)}),Pn.size-e.size>Sd&&e.forEach(function(r){Fd(r,t),Pn.delete(r)})}var Ad=function(t,e,r,i){var a=r.getDerivativeToken(t),o=G(G({},a),e);return i&&(o=i(o)),o},_d="token";function kd(n,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=ln(Pr),i=r.cache.instanceId,a=r.container,o=e.salt,s=o===void 0?"":o,l=e.override,c=l===void 0?Cd:l,u=e.formatToken,h=e.getComputedToken,p=e.cssVar,b=cd(function(){return Object.assign.apply(Object,[{}].concat(ce(t)))},t),v=Cr(b),f=Cr(c),d=p?Cr(p):"",m=ja(_d,[s,n.id,v,f,d],function(){var y,F=h?h(b,c,n):Ad(b,c,n,u),_=G({},F),S="";if(p){var A=Qs(F,p.key,{prefix:p.prefix,ignore:p.ignore,unitless:p.unitless,preserve:p.preserve}),T=fe(A,2);F=T[0],S=T[1]}var E=Co(F,s);F._tokenKey=E,_._tokenKey=Co(_,s);var w=(y=p==null?void 0:p.key)!==null&&y!==void 0?y:E;F._themeKey=w,wd(w);var g="".concat(xd,"-").concat(Fr(E));return F._hashId=g,[F,g,_,S,(p==null?void 0:p.key)||""]},function(y){Ed(y[0]._themeKey,i)},function(y){var F=fe(y,4),_=F[0],S=F[3];if(p&&S){var A=Yn(S,Fr("css-variables-".concat(_._themeKey)),{mark:sn,prepend:"queue",attachTo:a,priority:-999});A[Fn]=i,A.setAttribute(Sr,_._themeKey)}});return m}var Id={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Zs="comm",el="rule",tl="decl",Td="@import",Pd="@namespace",Dd="@keyframes",Od="@layer",nl=Math.abs,za=String.fromCharCode;function rl(n){return n.trim()}function Qr(n,t,e){return n.replace(t,e)}function Rd(n,t,e){return n.indexOf(t,e)}function Zn(n,t){return n.charCodeAt(t)|0}function nr(n,t,e){return n.slice(t,e)}function nn(n){return n.length}function Md(n){return n.length}function jr(n,t){return t.push(n),n}var hi=1,rr=1,il=0,jt=0,lt=0,ur="";function qa(n,t,e,r,i,a,o,s){return{value:n,root:t,parent:e,type:r,props:i,children:a,line:hi,column:rr,length:o,return:"",siblings:s}}function Nd(){return lt}function Ld(){return lt=jt>0?Zn(ur,--jt):0,rr--,lt===10&&(rr=1,hi--),lt}function Yt(){return lt=jt<il?Zn(ur,jt++):0,rr++,lt===10&&(rr=1,hi++),lt}function Sn(){return Zn(ur,jt)}function Zr(){return jt}function gi(n,t){return nr(ur,n,t)}function Er(n){switch(n){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $d(n){return hi=rr=1,il=nn(ur=n),jt=0,[]}function Bd(n){return ur="",n}function Oi(n){return rl(gi(jt-1,sa(n===91?n+2:n===40?n+1:n)))}function Vd(n){for(;(lt=Sn())&&lt<33;)Yt();return Er(n)>2||Er(lt)>3?"":" "}function jd(n,t){for(;--t&&Yt()&&!(lt<48||lt>102||lt>57&&lt<65||lt>70&&lt<97););return gi(n,Zr()+(t<6&&Sn()==32&&Yt()==32))}function sa(n){for(;Yt();)switch(lt){case n:return jt;case 34:case 39:n!==34&&n!==39&&sa(lt);break;case 40:n===41&&sa(n);break;case 92:Yt();break}return jt}function zd(n,t){for(;Yt()&&n+lt!==57;)if(n+lt===84&&Sn()===47)break;return"/*"+gi(t,jt-1)+"*"+za(n===47?n:Yt())}function qd(n){for(;!Er(Sn());)Yt();return gi(n,jt)}function Ud(n){return Bd(ei("",null,null,null,[""],n=$d(n),0,[0],n))}function ei(n,t,e,r,i,a,o,s,l){for(var c=0,u=0,h=o,p=0,b=0,v=0,f=1,d=1,m=1,y=0,F="",_=i,S=a,A=r,T=F;d;)switch(v=y,y=Yt()){case 40:if(v!=108&&Zn(T,h-1)==58){Rd(T+=Qr(Oi(y),"&","&\f"),"&\f",nl(c?s[c-1]:0))!=-1&&(m=-1);break}case 34:case 39:case 91:T+=Oi(y);break;case 9:case 10:case 13:case 32:T+=Vd(v);break;case 92:T+=jd(Zr()-1,7);continue;case 47:switch(Sn()){case 42:case 47:jr(Hd(zd(Yt(),Zr()),t,e,l),l),(Er(v||1)==5||Er(Sn()||1)==5)&&nn(T)&&nr(T,-1,void 0)!==" "&&(T+=" ");break;default:T+="/"}break;case 123*f:s[c++]=nn(T)*m;case 125*f:case 59:case 0:switch(y){case 0:case 125:d=0;case 59+u:m==-1&&(T=Qr(T,/\f/g,"")),b>0&&(nn(T)-h||f===0&&v===47)&&jr(b>32?Eo(T+";",r,e,h-1,l):Eo(Qr(T," ","")+";",r,e,h-2,l),l);break;case 59:T+=";";default:if(jr(A=So(T,t,e,c,u,i,s,F,_=[],S=[],h,a),a),y===123)if(u===0)ei(T,t,A,A,_,a,h,s,S);else{switch(p){case 99:if(Zn(T,3)===110)break;case 108:if(Zn(T,2)===97)break;default:u=0;case 100:case 109:case 115:}u?ei(n,A,A,r&&jr(So(n,A,A,0,0,i,s,F,i,_=[],h,S),S),i,S,h,s,r?_:S):ei(T,A,A,A,[""],S,0,s,S)}}c=u=b=0,f=m=1,F=T="",h=o;break;case 58:h=1+nn(T),b=v;default:if(f<1){if(y==123)--f;else if(y==125&&f++==0&&Ld()==125)continue}switch(T+=za(y),y*f){case 38:m=u>0?1:(T+="\f",-1);break;case 44:s[c++]=(nn(T)-1)*m,m=1;break;case 64:Sn()===45&&(T+=Oi(Yt())),p=Sn(),u=h=nn(F=T+=qd(Zr())),y++;break;case 45:v===45&&nn(T)==2&&(f=0)}}return a}function So(n,t,e,r,i,a,o,s,l,c,u,h){for(var p=i-1,b=i===0?a:[""],v=Md(b),f=0,d=0,m=0;f<r;++f)for(var y=0,F=nr(n,p+1,p=nl(d=o[f])),_=n;y<v;++y)(_=rl(d>0?b[y]+" "+F:Qr(F,/&\f/g,b[y])))&&(l[m++]=_);return qa(n,t,e,i===0?el:s,l,c,u,h)}function Hd(n,t,e,r){return qa(n,t,e,Zs,za(Nd()),nr(n,2,-2),0,r)}function Eo(n,t,e,r,i){return qa(n,t,e,tl,nr(n,0,r),nr(n,r+1,-1),r,i)}function la(n,t){for(var e="",r=0;r<n.length;r++)e+=t(n[r],r,n,t)||"";return e}function Wd(n,t,e,r){switch(n.type){case Od:if(n.children.length)break;case Td:case Pd:case tl:return n.return=n.return||n.value;case Zs:return"";case Dd:return n.return=n.value+"{"+la(n.children,r)+"}";case el:if(!nn(n.value=n.props.join(",")))return""}return nn(e=la(n.children,r))?n.return=n.value+"{"+e+"}":""}var Ao="data-ant-cssinjs-cache-path",al="_FILE_STYLE__",Rn,ol=!0;function Gd(){if(!Rn&&(Rn={},An())){var n=document.createElement("div");n.className=Ao,n.style.position="fixed",n.style.visibility="hidden",n.style.top="-9999px",document.body.appendChild(n);var t=getComputedStyle(n).content||"";t=t.replace(/^"/,"").replace(/"$/,""),t.split(";").forEach(function(i){var a=i.split(":"),o=fe(a,2),s=o[0],l=o[1];Rn[s]=l});var e=document.querySelector("style[".concat(Ao,"]"));if(e){var r;ol=!1,(r=e.parentNode)===null||r===void 0||r.removeChild(e)}document.body.removeChild(n)}}function Kd(n){return Gd(),!!Rn[n]}function Xd(n){var t=Rn[n],e=null;if(t&&An())if(ol)e=al;else{var r=document.querySelector("style[".concat(sn,'="').concat(Rn[n],'"]'));r?e=r.innerHTML:delete Rn[n]}return[e,t]}var Jd="_skip_check_",sl="_multi_value_";function Ri(n){var t=la(Ud(n),Wd);return t.replace(/\{%%%\:[^;];}/g,";")}function Yd(n){return Fe(n)==="object"&&n&&(Jd in n||sl in n)}function _o(n,t,e){if(!t)return n;var r=".".concat(t),i=e==="low"?":where(".concat(r,")"):r,a=n.split(",").map(function(o){var s,l=o.trim().split(/\s+/),c=l[0]||"",u=((s=c.match(/^\w+/))===null||s===void 0?void 0:s[0])||"";return c="".concat(u).concat(i).concat(c.slice(u.length)),[c].concat(ce(l.slice(1))).join(" ")});return a.join(",")}var Qd=function n(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},i=r.root,a=r.injectHash,o=r.parentSelectors,s=e.hashId,l=e.layer;e.path;var c=e.hashPriority,u=e.transformers,h=u===void 0?[]:u;e.linters;var p="",b={};function v(m){var y=m.getName(s);if(!b[y]){var F=n(m.style,e,{root:!1,parentSelectors:o}),_=fe(F,1),S=_[0];b[y]="@keyframes ".concat(m.getName(s)).concat(S)}}function f(m){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return m.forEach(function(F){Array.isArray(F)?f(F,y):F&&y.push(F)}),y}var d=f(Array.isArray(t)?t:[t]);return d.forEach(function(m){var y=typeof m=="string"&&!i?{}:m;if(typeof y=="string")p+="".concat(y,`
53
+ `);else if(y._keyframe)v(y);else{var F=h.reduce(function(_,S){var A;return(S==null||(A=S.visit)===null||A===void 0?void 0:A.call(S,_))||_},y);Object.keys(F).forEach(function(_){var S=F[_];if(Fe(S)==="object"&&S&&(_!=="animationName"||!S._keyframe)&&!Yd(S)){var A=!1,T=_.trim(),E=!1;(i||a)&&s?T.startsWith("@")?A=!0:T==="&"?T=_o("",s,c):T=_o(_,s,c):i&&!s&&(T==="&"||T==="")&&(T="",E=!0);var w=n(S,e,{root:E,injectHash:A,parentSelectors:[].concat(ce(o),[T])}),g=fe(w,2),O=g[0],D=g[1];b=G(G({},b),D),p+="".concat(T).concat(O)}else{let W=function(U,q){var z=U.replace(/[A-Z]/g,function(H){return"-".concat(H.toLowerCase())}),J=q;!Id[U]&&typeof J=="number"&&J!==0&&(J="".concat(J,"px")),U==="animationName"&&q!==null&&q!==void 0&&q._keyframe&&(v(q),J=q.getName(s)),p+="".concat(z,":").concat(J,";")};var R,P=(R=S==null?void 0:S.value)!==null&&R!==void 0?R:S;Fe(S)==="object"&&S!==null&&S!==void 0&&S[sl]&&Array.isArray(P)?P.forEach(function(U){W(_,U)}):W(_,P)}})}}),i?l&&(p&&(p="@layer ".concat(l.name," {").concat(p,"}")),l.dependencies&&(b["@layer ".concat(l.name)]=l.dependencies.map(function(m){return"@layer ".concat(m,", ").concat(l.name,";")}).join(`
54
+ `))):p="{".concat(p,"}"),[p,b]};function ll(n,t){return Fr("".concat(n.join("%")).concat(t))}function Zd(){return null}var ef="style";function ca(n,t){var e=n.token,r=n.path,i=n.hashId,a=n.layer,o=n.nonce,s=n.clientOnly,l=n.order,c=l===void 0?0:l,u=I.useContext(Pr),h=u.autoClear;u.mock;var p=u.defaultCache,b=u.hashPriority,v=u.container,f=u.ssrInline,d=u.transformers,m=u.linters,y=u.cache,F=u.layer,_=e._tokenKey,S=[_];F&&S.push("layer"),S.push.apply(S,ce(r));var A=oa,T=ja(ef,S,function(){var D=S.join("|");if(Kd(D)){var R=Xd(D),P=fe(R,2),W=P[0],U=P[1];if(W)return[W,_,U,{},s,c]}var q=t(),z=Qd(q,{hashId:i,hashPriority:b,layer:F?a:void 0,path:r.join("-"),transformers:d,linters:m}),J=fe(z,2),H=J[0],K=J[1],B=Ri(H),V=ll(S,B);return[B,_,V,K,s,c]},function(D,R){var P=fe(D,3),W=P[2];(R||h)&&oa&&Ss(W,{mark:sn,attachTo:v})},function(D){var R=fe(D,4),P=R[0];R[1];var W=R[2],U=R[3];if(A&&P!==al){var q={mark:sn,prepend:F?!1:"queue",attachTo:v,priority:c},z=typeof o=="function"?o():o;z&&(q.csp={nonce:z});var J=[],H=[];Object.keys(U).forEach(function(B){B.startsWith("@layer")?J.push(B):H.push(B)}),J.forEach(function(B){Yn(Ri(U[B]),"_layer-".concat(B),G(G({},q),{},{prepend:!0}))});var K=Yn(P,W,q);K[Fn]=y.instanceId,K.setAttribute(Sr,_),H.forEach(function(B){Yn(Ri(U[B]),"_effect-".concat(B),q)})}}),E=fe(T,3),w=E[0],g=E[1],O=E[2];return function(D){var R;return!f||A||!p?R=I.createElement(Zd,null):R=I.createElement("style",wt({},N(N({},Sr,g),sn,O),{dangerouslySetInnerHTML:{__html:w}})),I.createElement(I.Fragment,null,R,D)}}var tf="cssVar",nf=function(t,e){var r=t.key,i=t.prefix,a=t.unitless,o=t.ignore,s=t.token,l=t.scope,c=l===void 0?"":l,u=ln(Pr),h=u.cache.instanceId,p=u.container,b=s._tokenKey,v=[].concat(ce(t.path),[r,c,b]),f=ja(tf,v,function(){var d=e(),m=Qs(d,r,{prefix:i,unitless:a,ignore:o,scope:c}),y=fe(m,2),F=y[0],_=y[1],S=ll(v,_);return[F,_,S,r]},function(d){var m=fe(d,3),y=m[2];oa&&Ss(y,{mark:sn,attachTo:p})},function(d){var m=fe(d,3),y=m[1],F=m[2];if(y){var _=Yn(y,F,{mark:sn,prepend:"queue",attachTo:p,priority:-999});_[Fn]=h,_.setAttribute(Sr,r)}});return f},ko=(function(){function n(t,e){St(this,n),N(this,"name",void 0),N(this,"style",void 0),N(this,"_keyframe",!0),this.name=t,this.style=e}return Ft(n,[{key:"getName",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return e?"".concat(e,"-").concat(this.name):this.name}}]),n})();function rf(n){return Ic(n)||Tc(n)||Pc(n)||Dc()}function rn(n,t){for(var e=n,r=0;r<t.length;r+=1){if(e==null)return;e=e[t[r]]}return e}function cl(n,t,e,r){if(!t.length)return e;var i=rf(t),a=i[0],o=i.slice(1),s;return!n&&typeof a=="number"?s=[]:Array.isArray(n)?s=ce(n):s=G({},n),r&&e===void 0&&o.length===1?delete s[a][o[0]]:s[a]=cl(s[a],o,e,r),s}function Xt(n,t,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return t.length&&r&&e===void 0&&!rn(n,t.slice(0,-1))?n:cl(n,t,e,r)}function af(n){return Fe(n)==="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype}function Io(n){return Array.isArray(n)?[]:{}}var of=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function Kn(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];var r=Io(t[0]);return t.forEach(function(i){function a(o,s){var l=new Set(s),c=rn(i,o),u=Array.isArray(c);if(u||af(c)){if(!l.has(c)){l.add(c);var h=rn(r,o);u?r=Xt(r,o,[]):(!h||Fe(h)!=="object")&&(r=Xt(r,o,Io(c))),of(c).forEach(function(p){a([].concat(ce(o),[p]),l)})}}else r=Xt(r,o,c)}a([])}),r}const sf=I.createContext({}),lf=di(void 0),Tt="${label} is not a valid ${type}",mi={Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:Tt,method:Tt,array:Tt,object:Tt,number:Tt,date:Tt,boolean:Tt,integer:Tt,float:Tt,regexp:Tt,email:Tt,url:Tt,hex:Tt},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}}};Object.assign({},mi.Modal);let ti=[];const To=()=>ti.reduce((n,t)=>Object.assign(Object.assign({},n),t),mi.Modal);function cf(n){if(n){const t=Object.assign({},n);return ti.push(t),To(),()=>{ti=ti.filter(e=>e!==t),To()}}Object.assign({},mi.Modal)}const ul=di(void 0),uf="internalMark",df=n=>{const{locale:t={},children:e,_ANT_MARK__:r}=n;I.useEffect(()=>cf(t==null?void 0:t.Modal),[t]);const i=I.useMemo(()=>Object.assign(Object.assign({},t),{exist:!0}),[t]);return I.createElement(ul.Provider,{value:i},e)},dl={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},Ar=Object.assign(Object.assign({},dl),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
55
+ 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
56
+ 'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});function ff(n,{generateColorPalettes:t,generateNeutralColorPalettes:e}){const{colorSuccess:r,colorWarning:i,colorError:a,colorInfo:o,colorPrimary:s,colorBgBase:l,colorTextBase:c}=n,u=t(s),h=t(r),p=t(i),b=t(a),v=t(o),f=e(l,c),d=n.colorLink||n.colorInfo,m=t(d),y=new xt(b[1]).mix(new xt(b[3]),50).toHexString();return Object.assign(Object.assign({},f),{colorPrimaryBg:u[1],colorPrimaryBgHover:u[2],colorPrimaryBorder:u[3],colorPrimaryBorderHover:u[4],colorPrimaryHover:u[5],colorPrimary:u[6],colorPrimaryActive:u[7],colorPrimaryTextHover:u[8],colorPrimaryText:u[9],colorPrimaryTextActive:u[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:b[1],colorErrorBgHover:b[2],colorErrorBgFilledHover:y,colorErrorBgActive:b[3],colorErrorBorder:b[3],colorErrorBorderHover:b[4],colorErrorHover:b[5],colorError:b[6],colorErrorActive:b[7],colorErrorTextHover:b[8],colorErrorText:b[9],colorErrorTextActive:b[10],colorWarningBg:p[1],colorWarningBgHover:p[2],colorWarningBorder:p[3],colorWarningBorderHover:p[4],colorWarningHover:p[4],colorWarning:p[6],colorWarningActive:p[7],colorWarningTextHover:p[8],colorWarningText:p[9],colorWarningTextActive:p[10],colorInfoBg:v[1],colorInfoBgHover:v[2],colorInfoBorder:v[3],colorInfoBorderHover:v[4],colorInfoHover:v[4],colorInfo:v[6],colorInfoActive:v[7],colorInfoTextHover:v[8],colorInfoText:v[9],colorInfoTextActive:v[10],colorLinkHover:m[4],colorLink:m[6],colorLinkActive:m[7],colorBgMask:new xt("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}const pf=n=>{let t=n,e=n,r=n,i=n;return n<6&&n>=5?t=n+1:n<16&&n>=6?t=n+2:n>=16&&(t=16),n<7&&n>=5?e=4:n<8&&n>=7?e=5:n<14&&n>=8?e=6:n<16&&n>=14?e=7:n>=16&&(e=8),n<6&&n>=2?r=1:n>=6&&(r=2),n>4&&n<8?i=4:n>=8&&(i=6),{borderRadius:n,borderRadiusXS:r,borderRadiusSM:e,borderRadiusLG:t,borderRadiusOuter:i}};function hf(n){const{motionUnit:t,motionBase:e,borderRadius:r,lineWidth:i}=n;return Object.assign({motionDurationFast:`${(e+t).toFixed(1)}s`,motionDurationMid:`${(e+t*2).toFixed(1)}s`,motionDurationSlow:`${(e+t*3).toFixed(1)}s`,lineWidthBold:i+1},pf(r))}const gf=n=>{const{controlHeight:t}=n;return{controlHeightSM:t*.75,controlHeightXS:t*.5,controlHeightLG:t*1.25}};function mf(n){return(n+8)/n}function vf(n){const t=Array.from({length:10}).map((e,r)=>{const i=r-1,a=n*Math.pow(Math.E,i/5),o=r>1?Math.floor(a):Math.ceil(a);return Math.floor(o/2)*2});return t[1]=n,t.map(e=>({size:e,lineHeight:mf(e)}))}const yf=n=>{const t=vf(n),e=t.map(u=>u.size),r=t.map(u=>u.lineHeight),i=e[1],a=e[0],o=e[2],s=r[1],l=r[0],c=r[2];return{fontSizeSM:a,fontSize:i,fontSizeLG:o,fontSizeXL:e[3],fontSizeHeading1:e[6],fontSizeHeading2:e[5],fontSizeHeading3:e[4],fontSizeHeading4:e[3],fontSizeHeading5:e[2],lineHeight:s,lineHeightLG:c,lineHeightSM:l,fontHeight:Math.round(s*i),fontHeightLG:Math.round(c*o),fontHeightSM:Math.round(l*a),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};function bf(n){const{sizeUnit:t,sizeStep:e}=n;return{sizeXXL:t*(e+8),sizeXL:t*(e+4),sizeLG:t*(e+2),sizeMD:t*(e+1),sizeMS:t*e,size:t*e,sizeSM:t*(e-1),sizeXS:t*(e-2),sizeXXS:t*(e-3)}}const $t=(n,t)=>new xt(n).setA(t).toRgbString(),yr=(n,t)=>new xt(n).darken(t).toHexString(),Cf=n=>{const t=ai(n);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},xf=(n,t)=>{const e=n||"#fff",r=t||"#000";return{colorBgBase:e,colorTextBase:r,colorText:$t(r,.88),colorTextSecondary:$t(r,.65),colorTextTertiary:$t(r,.45),colorTextQuaternary:$t(r,.25),colorFill:$t(r,.15),colorFillSecondary:$t(r,.06),colorFillTertiary:$t(r,.04),colorFillQuaternary:$t(r,.02),colorBgSolid:$t(r,1),colorBgSolidHover:$t(r,.75),colorBgSolidActive:$t(r,.95),colorBgLayout:yr(e,4),colorBgContainer:yr(e,0),colorBgElevated:yr(e,0),colorBgSpotlight:$t(r,.85),colorBgBlur:"transparent",colorBorder:yr(e,15),colorBorderSecondary:yr(e,6)}};function wf(n){Si.pink=Si.magenta,Ei.pink=Ei.magenta;const t=Object.keys(dl).map(e=>{const r=n[e]===Si[e]?Ei[e]:ai(n[e]);return Array.from({length:10},()=>1).reduce((i,a,o)=>(i[`${e}-${o+1}`]=r[o],i[`${e}${o+1}`]=r[o],i),{})}).reduce((e,r)=>(e=Object.assign(Object.assign({},e),r),e),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),t),ff(n,{generateColorPalettes:Cf,generateNeutralColorPalettes:xf})),yf(n.fontSize)),bf(n)),gf(n)),hf(n))}const fl=aa(wf),ua={token:Ar,override:{override:Ar},hashed:!0},pl=ye.createContext(ua),da="ant",vi="anticon",Ff=(n,t)=>t||(n?`${da}-${n}`:da),hn=I.createContext({getPrefixCls:Ff,iconPrefixCls:vi}),{Consumer:ov}=hn,Sf=`-ant-${Date.now()}-${Math.random()}`;function Ef(n,t){const e={},r=(o,s)=>{let l=o.clone();return l=(s==null?void 0:s(l))||l,l.toRgbString()},i=(o,s)=>{const l=new xt(o),c=ai(l.toRgbString());e[`${s}-color`]=r(l),e[`${s}-color-disabled`]=c[1],e[`${s}-color-hover`]=c[4],e[`${s}-color-active`]=c[6],e[`${s}-color-outline`]=l.clone().setA(.2).toRgbString(),e[`${s}-color-deprecated-bg`]=c[0],e[`${s}-color-deprecated-border`]=c[2]};if(t.primaryColor){i(t.primaryColor,"primary");const o=new xt(t.primaryColor),s=ai(o.toRgbString());s.forEach((c,u)=>{e[`primary-${u+1}`]=c}),e["primary-color-deprecated-l-35"]=r(o,c=>c.lighten(35)),e["primary-color-deprecated-l-20"]=r(o,c=>c.lighten(20)),e["primary-color-deprecated-t-20"]=r(o,c=>c.tint(20)),e["primary-color-deprecated-t-50"]=r(o,c=>c.tint(50)),e["primary-color-deprecated-f-12"]=r(o,c=>c.setA(c.a*.12));const l=new xt(s[0]);e["primary-color-active-deprecated-f-30"]=r(l,c=>c.setA(c.a*.3)),e["primary-color-active-deprecated-d-02"]=r(l,c=>c.darken(2))}return t.successColor&&i(t.successColor,"success"),t.warningColor&&i(t.warningColor,"warning"),t.errorColor&&i(t.errorColor,"error"),t.infoColor&&i(t.infoColor,"info"),`
57
+ :root {
58
+ ${Object.keys(e).map(o=>`--${n}-${o}: ${e[o]};`).join(`
59
+ `)}
60
+ }
61
+ `.trim()}function Af(n,t){const e=Ef(n,t);An()&&Yn(e,`${Sf}-dynamic-theme`)}const fa=I.createContext(!1),_f=({children:n,disabled:t})=>{const e=I.useContext(fa);return I.createElement(fa.Provider,{value:t??e},n)},_r=I.createContext(void 0),kf=({children:n,size:t})=>{const e=I.useContext(_r);return I.createElement(_r.Provider,{value:t||e},n)};function If(){const n=ln(fa),t=ln(_r);return{componentDisabled:n,componentSize:t}}var hl=Ft(function n(){St(this,n)}),gl="CALC_UNIT",Tf=new RegExp(gl,"g");function Mi(n){return typeof n=="number"?"".concat(n).concat(gl):n}var Pf=(function(n){ar(e,n);var t=cr(e);function e(r,i){var a;St(this,e),a=t.call(this),N(Ce(a),"result",""),N(Ce(a),"unitlessCssVar",void 0),N(Ce(a),"lowPriority",void 0);var o=Fe(r);return a.unitlessCssVar=i,r instanceof e?a.result="(".concat(r.result,")"):o==="number"?a.result=Mi(r):o==="string"&&(a.result=r),a}return Ft(e,[{key:"add",value:function(i){return i instanceof e?this.result="".concat(this.result," + ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," + ").concat(Mi(i))),this.lowPriority=!0,this}},{key:"sub",value:function(i){return i instanceof e?this.result="".concat(this.result," - ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," - ").concat(Mi(i))),this.lowPriority=!0,this}},{key:"mul",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof e?this.result="".concat(this.result," * ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," * ").concat(i)),this.lowPriority=!1,this}},{key:"div",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof e?this.result="".concat(this.result," / ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," / ").concat(i)),this.lowPriority=!1,this}},{key:"getResult",value:function(i){return this.lowPriority||i?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(i){var a=this,o=i||{},s=o.unit,l=!0;return typeof s=="boolean"?l=s:Array.from(this.unitlessCssVar).some(function(c){return a.result.includes(c)})&&(l=!1),this.result=this.result.replace(Tf,l?"px":""),typeof this.lowPriority<"u"?"calc(".concat(this.result,")"):this.result}}]),e})(hl),Df=(function(n){ar(e,n);var t=cr(e);function e(r){var i;return St(this,e),i=t.call(this),N(Ce(i),"result",0),r instanceof e?i.result=r.result:typeof r=="number"&&(i.result=r),i}return Ft(e,[{key:"add",value:function(i){return i instanceof e?this.result+=i.result:typeof i=="number"&&(this.result+=i),this}},{key:"sub",value:function(i){return i instanceof e?this.result-=i.result:typeof i=="number"&&(this.result-=i),this}},{key:"mul",value:function(i){return i instanceof e?this.result*=i.result:typeof i=="number"&&(this.result*=i),this}},{key:"div",value:function(i){return i instanceof e?this.result/=i.result:typeof i=="number"&&(this.result/=i),this}},{key:"equal",value:function(){return this.result}}]),e})(hl),Of=function(t,e){var r=t==="css"?Pf:Df;return function(i){return new r(i,e)}},Po=function(t,e){return"".concat([e,t.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function si(n){var t=I.useRef();t.current=n;var e=I.useCallback(function(){for(var r,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return(r=t.current)===null||r===void 0?void 0:r.call.apply(r,[t].concat(a))},[]);return e}function pa(n){var t=I.useRef(!1),e=I.useState(n),r=fe(e,2),i=r[0],a=r[1];I.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]);function o(s,l){l&&t.current||a(s)}return[i,o]}var Ni={exports:{}},De={};/**
62
+ * @license React
63
+ * react-is.production.min.js
64
+ *
65
+ * Copyright (c) Facebook, Inc. and its affiliates.
66
+ *
67
+ * This source code is licensed under the MIT license found in the
68
+ * LICENSE file in the root directory of this source tree.
69
+ */var Do;function Rf(){if(Do)return De;Do=1;var n=Symbol.for("react.element"),t=Symbol.for("react.portal"),e=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),v;v=Symbol.for("react.module.reference");function f(d){if(typeof d=="object"&&d!==null){var m=d.$$typeof;switch(m){case n:switch(d=d.type,d){case e:case i:case r:case c:case u:return d;default:switch(d=d&&d.$$typeof,d){case s:case o:case l:case p:case h:case a:return d;default:return m}}case t:return m}}}return De.ContextConsumer=o,De.ContextProvider=a,De.Element=n,De.ForwardRef=l,De.Fragment=e,De.Lazy=p,De.Memo=h,De.Portal=t,De.Profiler=i,De.StrictMode=r,De.Suspense=c,De.SuspenseList=u,De.isAsyncMode=function(){return!1},De.isConcurrentMode=function(){return!1},De.isContextConsumer=function(d){return f(d)===o},De.isContextProvider=function(d){return f(d)===a},De.isElement=function(d){return typeof d=="object"&&d!==null&&d.$$typeof===n},De.isForwardRef=function(d){return f(d)===l},De.isFragment=function(d){return f(d)===e},De.isLazy=function(d){return f(d)===p},De.isMemo=function(d){return f(d)===h},De.isPortal=function(d){return f(d)===t},De.isProfiler=function(d){return f(d)===i},De.isStrictMode=function(d){return f(d)===r},De.isSuspense=function(d){return f(d)===c},De.isSuspenseList=function(d){return f(d)===u},De.isValidElementType=function(d){return typeof d=="string"||typeof d=="function"||d===e||d===i||d===r||d===c||d===u||d===b||typeof d=="object"&&d!==null&&(d.$$typeof===p||d.$$typeof===h||d.$$typeof===a||d.$$typeof===o||d.$$typeof===l||d.$$typeof===v||d.getModuleId!==void 0)},De.typeOf=f,De}var Oo;function Mf(){return Oo||(Oo=1,Ni.exports=Rf()),Ni.exports}var Li=Mf(),Nf=Symbol.for("react.element"),Lf=Symbol.for("react.transitional.element"),$f=Symbol.for("react.fragment");function ml(n){return n&&Fe(n)==="object"&&(n.$$typeof===Nf||n.$$typeof===Lf)&&n.type===$f}var Bf=Number(hc.split(".")[0]),Vf=function(t,e){typeof t=="function"?t(e):Fe(t)==="object"&&t&&"current"in t&&(t.current=e)},jf=function(t){var e,r;if(!t)return!1;if(vl(t)&&Bf>=19)return!0;var i=Li.isMemo(t)?t.type.type:t.type;return!(typeof i=="function"&&!((e=i.prototype)!==null&&e!==void 0&&e.render)&&i.$$typeof!==Li.ForwardRef||typeof t=="function"&&!((r=t.prototype)!==null&&r!==void 0&&r.render)&&t.$$typeof!==Li.ForwardRef)};function vl(n){return pc(n)&&!ml(n)}var zf=function(t){if(t&&vl(t)){var e=t;return e.props.propertyIsEnumerable("ref")?e.props.ref:e.ref}return null};function Ro(n,t,e,r){var i=G({},t[n]);if(r!=null&&r.deprecatedTokens){var a=r.deprecatedTokens;a.forEach(function(s){var l=fe(s,2),c=l[0],u=l[1];if(i!=null&&i[c]||i!=null&&i[u]){var h;(h=i[u])!==null&&h!==void 0||(i[u]=i==null?void 0:i[c])}})}var o=G(G({},e),i);return Object.keys(o).forEach(function(s){o[s]===t[s]&&delete o[s]}),o}var yl=typeof CSSINJS_STATISTIC<"u",ha=!0;function Ua(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];if(!yl)return Object.assign.apply(Object,[{}].concat(t));ha=!1;var r={};return t.forEach(function(i){if(Fe(i)==="object"){var a=Object.keys(i);a.forEach(function(o){Object.defineProperty(r,o,{configurable:!0,enumerable:!0,get:function(){return i[o]}})})}}),ha=!0,r}var Mo={};function qf(){}var Uf=function(t){var e,r=t,i=qf;return yl&&typeof Proxy<"u"&&(e=new Set,r=new Proxy(t,{get:function(o,s){if(ha){var l;(l=e)===null||l===void 0||l.add(s)}return o[s]}}),i=function(o,s){var l;Mo[o]={global:Array.from(e),component:G(G({},(l=Mo[o])===null||l===void 0?void 0:l.component),s)}}),{token:r,keys:e,flush:i}};function No(n,t,e){if(typeof e=="function"){var r;return e(Ua(t,(r=t[n])!==null&&r!==void 0?r:{}))}return e??{}}function Hf(n){return n==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return"max(".concat(r.map(function(a){return xo(a)}).join(","),")")},min:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return"min(".concat(r.map(function(a){return xo(a)}).join(","),")")}}}var Wf=1e3*60*10,Gf=(function(){function n(){St(this,n),N(this,"map",new Map),N(this,"objectIDMap",new WeakMap),N(this,"nextID",0),N(this,"lastAccessBeat",new Map),N(this,"accessBeat",0)}return Ft(n,[{key:"set",value:function(e,r){this.clear();var i=this.getCompositeKey(e);this.map.set(i,r),this.lastAccessBeat.set(i,Date.now())}},{key:"get",value:function(e){var r=this.getCompositeKey(e),i=this.map.get(r);return this.lastAccessBeat.set(r,Date.now()),this.accessBeat+=1,i}},{key:"getCompositeKey",value:function(e){var r=this,i=e.map(function(a){return a&&Fe(a)==="object"?"obj_".concat(r.getObjectID(a)):"".concat(Fe(a),"_").concat(a)});return i.join("|")}},{key:"getObjectID",value:function(e){if(this.objectIDMap.has(e))return this.objectIDMap.get(e);var r=this.nextID;return this.objectIDMap.set(e,r),this.nextID+=1,r}},{key:"clear",value:function(){var e=this;if(this.accessBeat>1e4){var r=Date.now();this.lastAccessBeat.forEach(function(i,a){r-i>Wf&&(e.map.delete(a),e.lastAccessBeat.delete(a))}),this.accessBeat=0}}}]),n})(),Lo=new Gf;function Kf(n,t){return ye.useMemo(function(){var e=Lo.get(t);if(e)return e;var r=n();return Lo.set(t,r),r},t)}var Xf=function(){return{}};function Jf(n){var t=n.useCSP,e=t===void 0?Xf:t,r=n.useToken,i=n.usePrefix,a=n.getResetStyles,o=n.getCommonStyle,s=n.getCompUnitless;function l(p,b,v,f){var d=Array.isArray(p)?p[0]:p;function m(E){return"".concat(String(d)).concat(E.slice(0,1).toUpperCase()).concat(E.slice(1))}var y=(f==null?void 0:f.unitless)||{},F=typeof s=="function"?s(p):{},_=G(G({},F),{},N({},m("zIndexPopup"),!0));Object.keys(y).forEach(function(E){_[m(E)]=y[E]});var S=G(G({},f),{},{unitless:_,prefixToken:m}),A=u(p,b,v,S),T=c(d,v,S);return function(E){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:E,g=A(E,w),O=fe(g,2),D=O[1],R=T(w),P=fe(R,2),W=P[0],U=P[1];return[W,D,U]}}function c(p,b,v){var f=v.unitless,d=v.injectStyle,m=d===void 0?!0:d,y=v.prefixToken,F=v.ignore,_=function(T){var E=T.rootCls,w=T.cssVar,g=w===void 0?{}:w,O=r(),D=O.realToken;return nf({path:[p],prefix:g.prefix,key:g.key,unitless:f,ignore:F,token:D,scope:E},function(){var R=No(p,D,b),P=Ro(p,D,R,{deprecatedTokens:v==null?void 0:v.deprecatedTokens});return Object.keys(R).forEach(function(W){P[y(W)]=P[W],delete P[W]}),P}),null},S=function(T){var E=r(),w=E.cssVar;return[function(g){return m&&w?ye.createElement(ye.Fragment,null,ye.createElement(_,{rootCls:T,cssVar:w,component:p}),g):g},w==null?void 0:w.key]};return S}function u(p,b,v){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},d=Array.isArray(p)?p:[p,p],m=fe(d,1),y=m[0],F=d.join("-"),_=n.layer||{name:"antd"};return function(S){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S,T=r(),E=T.theme,w=T.realToken,g=T.hashId,O=T.token,D=T.cssVar,R=i(),P=R.rootPrefixCls,W=R.iconPrefixCls,U=e(),q=D?"css":"js",z=Kf(function(){var M=new Set;return D&&Object.keys(f.unitless||{}).forEach(function(j){M.add(Yr(j,D.prefix)),M.add(Yr(j,Po(y,D.prefix)))}),Of(q,M)},[q,y,D==null?void 0:D.prefix]),J=Hf(q),H=J.max,K=J.min,B={theme:E,token:O,hashId:g,nonce:function(){return U.nonce},clientOnly:f.clientOnly,layer:_,order:f.order||-999};typeof a=="function"&&ca(G(G({},B),{},{clientOnly:!1,path:["Shared",P]}),function(){return a(O,{prefix:{rootPrefixCls:P,iconPrefixCls:W},csp:U})});var V=ca(G(G({},B),{},{path:[F,S,W]}),function(){if(f.injectStyle===!1)return[];var M=Uf(O),j=M.token,X=M.flush,Z=No(y,w,v),he=".".concat(S),ee=Ro(y,w,Z,{deprecatedTokens:f.deprecatedTokens});D&&Z&&Fe(Z)==="object"&&Object.keys(Z).forEach(function(de){Z[de]="var(".concat(Yr(de,Po(y,D.prefix)),")")});var ne=Ua(j,{componentCls:he,prefixCls:S,iconCls:".".concat(W),antCls:".".concat(P),calc:z,max:H,min:K},D?Z:ee),Ee=b(ne,{hashId:g,prefixCls:S,rootPrefixCls:P,iconPrefixCls:W});X(y,ee);var Se=typeof o=="function"?o(ne,S,A,f.resetFont):null;return[f.resetStyle===!1?null:Se,Ee]});return[V,g]}}function h(p,b,v){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},d=u(p,b,v,G({resetStyle:!1,order:-998},f)),m=function(F){var _=F.prefixCls,S=F.rootCls,A=S===void 0?_:S;return d(_,A),null};return m}return{genStyleHooks:l,genSubStyleComponent:h,genComponentStyleHook:u}}const Yf="5.28.0";function $i(n){return n>=0&&n<=255}function zr(n,t){const{r:e,g:r,b:i,a}=new xt(n).toRgb();if(a<1)return n;const{r:o,g:s,b:l}=new xt(t).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((e-o*(1-c))/c),h=Math.round((r-s*(1-c))/c),p=Math.round((i-l*(1-c))/c);if($i(u)&&$i(h)&&$i(p))return new xt({r:u,g:h,b:p,a:Math.round(c*100)/100}).toRgbString()}return new xt({r:e,g:r,b:i,a:1}).toRgbString()}var Qf=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function bl(n){const{override:t}=n,e=Qf(n,["override"]),r=Object.assign({},t);Object.keys(Ar).forEach(p=>{delete r[p]});const i=Object.assign(Object.assign({},e),r),a=480,o=576,s=768,l=992,c=1200,u=1600;return i.motion===!1&&(i.motionDurationFast="0s",i.motionDurationMid="0s",i.motionDurationSlow="0s"),Object.assign(Object.assign(Object.assign({},i),{colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:zr(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:zr(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:zr(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:i.lineWidth*3,lineWidth:i.lineWidth,controlOutlineWidth:i.lineWidth*2,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:zr(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:`
70
+ 0 6px 16px 0 rgba(0, 0, 0, 0.08),
71
+ 0 3px 6px -4px rgba(0, 0, 0, 0.12),
72
+ 0 9px 28px 8px rgba(0, 0, 0, 0.05)
73
+ `,boxShadowSecondary:`
74
+ 0 6px 16px 0 rgba(0, 0, 0, 0.08),
75
+ 0 3px 6px -4px rgba(0, 0, 0, 0.12),
76
+ 0 9px 28px 8px rgba(0, 0, 0, 0.05)
77
+ `,boxShadowTertiary:`
78
+ 0 1px 2px 0 rgba(0, 0, 0, 0.03),
79
+ 0 1px 6px -1px rgba(0, 0, 0, 0.02),
80
+ 0 2px 4px 0 rgba(0, 0, 0, 0.02)
81
+ `,screenXS:a,screenXSMin:a,screenXSMax:o-1,screenSM:o,screenSMMin:o,screenSMMax:s-1,screenMD:s,screenMDMin:s,screenMDMax:l-1,screenLG:l,screenLGMin:l,screenLGMax:c-1,screenXL:c,screenXLMin:c,screenXLMax:u-1,screenXXL:u,screenXXLMin:u,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:`
82
+ 0 1px 2px -2px ${new xt("rgba(0, 0, 0, 0.16)").toRgbString()},
83
+ 0 3px 6px 0 ${new xt("rgba(0, 0, 0, 0.12)").toRgbString()},
84
+ 0 5px 12px 4px ${new xt("rgba(0, 0, 0, 0.09)").toRgbString()}
85
+ `,boxShadowDrawerRight:`
86
+ -6px 0 16px 0 rgba(0, 0, 0, 0.08),
87
+ -3px 0 6px -4px rgba(0, 0, 0, 0.12),
88
+ -9px 0 28px 8px rgba(0, 0, 0, 0.05)
89
+ `,boxShadowDrawerLeft:`
90
+ 6px 0 16px 0 rgba(0, 0, 0, 0.08),
91
+ 3px 0 6px -4px rgba(0, 0, 0, 0.12),
92
+ 9px 0 28px 8px rgba(0, 0, 0, 0.05)
93
+ `,boxShadowDrawerUp:`
94
+ 0 6px 16px 0 rgba(0, 0, 0, 0.08),
95
+ 0 3px 6px -4px rgba(0, 0, 0, 0.12),
96
+ 0 9px 28px 8px rgba(0, 0, 0, 0.05)
97
+ `,boxShadowDrawerDown:`
98
+ 0 -6px 16px 0 rgba(0, 0, 0, 0.08),
99
+ 0 -3px 6px -4px rgba(0, 0, 0, 0.12),
100
+ 0 -9px 28px 8px rgba(0, 0, 0, 0.05)
101
+ `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var $o=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};const Cl={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},Zf={motionBase:!0,motionUnit:!0},ep={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},xl=(n,t,e)=>{const r=e.getDerivativeToken(n),{override:i}=t,a=$o(t,["override"]);let o=Object.assign(Object.assign({},r),{override:i});return o=bl(o),a&&Object.entries(a).forEach(([s,l])=>{const{theme:c}=l,u=$o(l,["theme"]);let h=u;c&&(h=xl(Object.assign(Object.assign({},o),u),{override:u},c)),o[s]=h}),o};function yi(){const{token:n,hashed:t,theme:e,override:r,cssVar:i}=ye.useContext(pl),a=`${Yf}-${t||""}`,o=e||fl,[s,l,c]=kd(o,[Ar,n],{salt:a,override:r,getComputedToken:xl,formatToken:bl,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:Cl,ignore:Zf,preserve:ep}});return[o,c,t?l:"",s,i]}const tp=(n,t=!1)=>({boxSizing:"border-box",margin:0,padding:0,color:n.colorText,fontSize:n.fontSize,lineHeight:n.lineHeight,listStyle:"none",fontFamily:t?"inherit":n.fontFamily}),np=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),rp=n=>({a:{color:n.colorLink,textDecoration:n.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${n.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:n.colorLinkHover},"&:active":{color:n.colorLinkActive},"&:active, &:hover":{textDecoration:n.linkHoverDecoration,outline:0},"&:focus":{textDecoration:n.linkFocusDecoration,outline:0},"&[disabled]":{color:n.colorTextDisabled,cursor:"not-allowed"}}}),ip=(n,t,e,r)=>{const i=`[class^="${t}"], [class*=" ${t}"]`,a=e?`.${e}`:i,o={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let s={};return r!==!1&&(s={fontFamily:n.fontFamily,fontSize:n.fontSize}),{[a]:Object.assign(Object.assign(Object.assign({},s),o),{[i]:o})}},wl=n=>({[`.${n}`]:Object.assign(Object.assign({},np()),{[`.${n} .${n}-icon`]:{display:"block"}})}),{genStyleHooks:ap}=Jf({usePrefix:()=>{const{getPrefixCls:n,iconPrefixCls:t}=ln(hn);return{rootPrefixCls:n(),iconPrefixCls:t}},useToken:()=>{const[n,t,e,r,i]=yi();return{theme:n,realToken:t,hashId:e,token:r,cssVar:i}},useCSP:()=>{const{csp:n}=ln(hn);return n??{}},getResetStyles:(n,t)=>{var e;const r=rp(n);return[r,{"&":r},wl((e=t==null?void 0:t.prefix.iconPrefixCls)!==null&&e!==void 0?e:vi)]},getCommonStyle:ip,getCompUnitless:()=>Cl}),op=(n,t)=>{const[e,r]=yi();return ca({token:r,hashId:"",path:["ant-design-icons",n],nonce:()=>t==null?void 0:t.nonce,layer:{name:"antd"}},()=>wl(n))},sp=Object.assign({},I),{useId:Bo}=sp,lp=()=>"",cp=typeof Bo>"u"?lp:Bo;function up(n,t,e){var r;const i=n||{},a=i.inherit===!1||!t?Object.assign(Object.assign({},ua),{hashed:(r=t==null?void 0:t.hashed)!==null&&r!==void 0?r:ua.hashed,cssVar:t==null?void 0:t.cssVar}):t,o=cp();return Js(()=>{var s,l;if(!n)return t;const c=Object.assign({},a.components);Object.keys(n.components||{}).forEach(p=>{c[p]=Object.assign(Object.assign({},c[p]),n.components[p])});const u=`css-var-${o.replace(/:/g,"")}`,h=((s=i.cssVar)!==null&&s!==void 0?s:a.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:e==null?void 0:e.prefixCls},typeof a.cssVar=="object"?a.cssVar:{}),typeof i.cssVar=="object"?i.cssVar:{}),{key:typeof i.cssVar=="object"&&((l=i.cssVar)===null||l===void 0?void 0:l.key)||u});return Object.assign(Object.assign(Object.assign({},a),i),{token:Object.assign(Object.assign({},a.token),i.token),components:c,cssVar:h})},[i,a],(s,l)=>s.some((c,u)=>{const h=l[u];return!ra(c,h,!0)}))}function Vo(n){return n instanceof HTMLElement||n instanceof SVGElement}function Fl(n){return n&&Fe(n)==="object"&&Vo(n.nativeElement)?n.nativeElement:Vo(n)?n:null}function dp(n){var t=Fl(n);if(t)return t;if(n instanceof ye.Component){var e;return(e=no.findDOMNode)===null||e===void 0?void 0:e.call(no,n)}return null}var fp=["children"],Sl=I.createContext({});function pp(n){var t=n.children,e=En(n,fp);return I.createElement(Sl.Provider,{value:e},t)}var hp=(function(n){ar(e,n);var t=cr(e);function e(){return St(this,e),t.apply(this,arguments)}return Ft(e,[{key:"render",value:function(){return this.props.children}}]),e})(I.Component);function gp(n){var t=I.useReducer(function(s){return s+1},0),e=fe(t,2),r=e[1],i=I.useRef(n),a=si(function(){return i.current}),o=si(function(s){i.current=typeof s=="function"?s(i.current):s,r()});return[a,o]}var xn="none",qr="appear",Ur="enter",Hr="leave",jo="none",Jt="prepare",Xn="start",Jn="active",Ha="end",El="prepared";function zo(n,t){var e={};return e[n.toLowerCase()]=t.toLowerCase(),e["Webkit".concat(n)]="webkit".concat(t),e["Moz".concat(n)]="moz".concat(t),e["ms".concat(n)]="MS".concat(t),e["O".concat(n)]="o".concat(t.toLowerCase()),e}function mp(n,t){var e={animationend:zo("Animation","AnimationEnd"),transitionend:zo("Transition","TransitionEnd")};return n&&("AnimationEvent"in t||delete e.animationend.animation,"TransitionEvent"in t||delete e.transitionend.transition),e}var vp=mp(An(),typeof window<"u"?window:{}),Al={};if(An()){var yp=document.createElement("div");Al=yp.style}var Wr={};function _l(n){if(Wr[n])return Wr[n];var t=vp[n];if(t)for(var e=Object.keys(t),r=e.length,i=0;i<r;i+=1){var a=e[i];if(Object.prototype.hasOwnProperty.call(t,a)&&a in Al)return Wr[n]=t[a],Wr[n]}return""}var kl=_l("animationend"),Il=_l("transitionend"),Tl=!!(kl&&Il),qo=kl||"animationend",Uo=Il||"transitionend";function Ho(n,t){if(!n)return null;if(Fe(n)==="object"){var e=t.replace(/-\w/g,function(r){return r[1].toUpperCase()});return n[e]}return"".concat(n,"-").concat(t)}const bp=(function(n){var t=Le();function e(i){i&&(i.removeEventListener(Uo,n),i.removeEventListener(qo,n))}function r(i){t.current&&t.current!==i&&e(t.current),i&&i!==t.current&&(i.addEventListener(Uo,n),i.addEventListener(qo,n),t.current=i)}return I.useEffect(function(){return function(){e(t.current)}},[]),[r,e]});var Pl=An()?gc:_e,Dl=function(t){return+setTimeout(t,16)},Ol=function(t){return clearTimeout(t)};typeof window<"u"&&"requestAnimationFrame"in window&&(Dl=function(t){return window.requestAnimationFrame(t)},Ol=function(t){return window.cancelAnimationFrame(t)});var Wo=0,Wa=new Map;function Rl(n){Wa.delete(n)}var ga=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Wo+=1;var r=Wo;function i(a){if(a===0)Rl(r),t();else{var o=Dl(function(){i(a-1)});Wa.set(r,o)}}return i(e),r};ga.cancel=function(n){var t=Wa.get(n);return Rl(n),Ol(t)};const Cp=(function(){var n=I.useRef(null);function t(){ga.cancel(n.current)}function e(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var a=ga(function(){i<=1?r({isCanceled:function(){return a!==n.current}}):e(r,i-1)});n.current=a}return I.useEffect(function(){return function(){t()}},[]),[e,t]});var xp=[Jt,Xn,Jn,Ha],wp=[Jt,El],Ml=!1,Fp=!0;function Nl(n){return n===Jn||n===Ha}const Sp=(function(n,t,e){var r=pa(jo),i=fe(r,2),a=i[0],o=i[1],s=Cp(),l=fe(s,2),c=l[0],u=l[1];function h(){o(Jt,!0)}var p=t?wp:xp;return Pl(function(){if(a!==jo&&a!==Ha){var b=p.indexOf(a),v=p[b+1],f=e(a);f===Ml?o(v,!0):v&&c(function(d){function m(){d.isCanceled()||o(v,!0)}f===!0?m():Promise.resolve(f).then(m)})}},[n,a]),I.useEffect(function(){return function(){u()}},[]),[h,a]});function Ep(n,t,e,r){var i=r.motionEnter,a=i===void 0?!0:i,o=r.motionAppear,s=o===void 0?!0:o,l=r.motionLeave,c=l===void 0?!0:l,u=r.motionDeadline,h=r.motionLeaveImmediately,p=r.onAppearPrepare,b=r.onEnterPrepare,v=r.onLeavePrepare,f=r.onAppearStart,d=r.onEnterStart,m=r.onLeaveStart,y=r.onAppearActive,F=r.onEnterActive,_=r.onLeaveActive,S=r.onAppearEnd,A=r.onEnterEnd,T=r.onLeaveEnd,E=r.onVisibleChanged,w=pa(),g=fe(w,2),O=g[0],D=g[1],R=gp(xn),P=fe(R,2),W=P[0],U=P[1],q=pa(null),z=fe(q,2),J=z[0],H=z[1],K=W(),B=Le(!1),V=Le(null);function M(){return e()}var j=Le(!1);function X(){U(xn),H(null,!0)}var Z=si(function(Te){var Pe=W();if(Pe!==xn){var Ye=M();if(!(Te&&!Te.deadline&&Te.target!==Ye)){var We=j.current,Ge;Pe===qr&&We?Ge=S==null?void 0:S(Ye,Te):Pe===Ur&&We?Ge=A==null?void 0:A(Ye,Te):Pe===Hr&&We&&(Ge=T==null?void 0:T(Ye,Te)),We&&Ge!==!1&&X()}}}),he=bp(Z),ee=fe(he,1),ne=ee[0],Ee=function(Pe){switch(Pe){case qr:return N(N(N({},Jt,p),Xn,f),Jn,y);case Ur:return N(N(N({},Jt,b),Xn,d),Jn,F);case Hr:return N(N(N({},Jt,v),Xn,m),Jn,_);default:return{}}},Se=I.useMemo(function(){return Ee(K)},[K]),de=Sp(K,!n,function(Te){if(Te===Jt){var Pe=Se[Jt];return Pe?Pe(M()):Ml}if(me in Se){var Ye;H(((Ye=Se[me])===null||Ye===void 0?void 0:Ye.call(Se,M(),null))||null)}return me===Jn&&K!==xn&&(ne(M()),u>0&&(clearTimeout(V.current),V.current=setTimeout(function(){Z({deadline:!0})},u))),me===El&&X(),Fp}),$e=fe(de,2),He=$e[0],me=$e[1],ft=Nl(me);j.current=ft;var pt=Le(null);Pl(function(){if(!(B.current&&pt.current===t)){D(t);var Te=B.current;B.current=!0;var Pe;!Te&&t&&s&&(Pe=qr),Te&&t&&a&&(Pe=Ur),(Te&&!t&&c||!Te&&h&&!t&&c)&&(Pe=Hr);var Ye=Ee(Pe);Pe&&(n||Ye[Jt])?(U(Pe),He()):U(xn),pt.current=t}},[t]),_e(function(){(K===qr&&!s||K===Ur&&!a||K===Hr&&!c)&&U(xn)},[s,a,c]),_e(function(){return function(){B.current=!1,clearTimeout(V.current)}},[]);var at=I.useRef(!1);_e(function(){O&&(at.current=!0),O!==void 0&&K===xn&&((at.current||O)&&(E==null||E(O)),at.current=!0)},[O,K]);var vt=J;return Se[Jt]&&me===Xn&&(vt=G({transition:"none"},vt)),[K,me,vt,O??t]}function Ap(n){var t=n;Fe(n)==="object"&&(t=n.transitionSupport);function e(i,a){return!!(i.motionName&&t&&a!==!1)}var r=I.forwardRef(function(i,a){var o=i.visible,s=o===void 0?!0:o,l=i.removeOnLeave,c=l===void 0?!0:l,u=i.forceRender,h=i.children,p=i.motionName,b=i.leavedClassName,v=i.eventProps,f=I.useContext(Sl),d=f.motion,m=e(i,d),y=Le(),F=Le();function _(){try{return y.current instanceof HTMLElement?y.current:dp(F.current)}catch{return null}}var S=Ep(m,s,_,i),A=fe(S,4),T=A[0],E=A[1],w=A[2],g=A[3],O=I.useRef(g);g&&(O.current=!0);var D=I.useCallback(function(z){y.current=z,Vf(a,z)},[a]),R,P=G(G({},v),{},{visible:s});if(!h)R=null;else if(T===xn)g?R=h(G({},P),D):!c&&O.current&&b?R=h(G(G({},P),{},{className:b}),D):u||!c&&!b?R=h(G(G({},P),{},{style:{display:"none"}}),D):R=null;else{var W;E===Jt?W="prepare":Nl(E)?W="active":E===Xn&&(W="start");var U=Ho(p,"".concat(T,"-").concat(W));R=h(G(G({},P),{},{className:on(Ho(p,T),N(N({},U,U&&W),p,typeof p=="string")),style:w}),D)}if(I.isValidElement(R)&&jf(R)){var q=zf(R);q||(R=I.cloneElement(R,{ref:D}))}return I.createElement(hp,{ref:F},R)});return r.displayName="CSSMotion",r}const _p=Ap(Tl);var ma="add",va="keep",ya="remove",Bi="removed";function kp(n){var t;return n&&Fe(n)==="object"&&"key"in n?t=n:t={key:n},G(G({},t),{},{key:String(t.key)})}function ba(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return n.map(kp)}function Ip(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=[],r=0,i=t.length,a=ba(n),o=ba(t);a.forEach(function(c){for(var u=!1,h=r;h<i;h+=1){var p=o[h];if(p.key===c.key){r<h&&(e=e.concat(o.slice(r,h).map(function(b){return G(G({},b),{},{status:ma})})),r=h),e.push(G(G({},p),{},{status:va})),r+=1,u=!0;break}}u||e.push(G(G({},c),{},{status:ya}))}),r<i&&(e=e.concat(o.slice(r).map(function(c){return G(G({},c),{},{status:ma})})));var s={};e.forEach(function(c){var u=c.key;s[u]=(s[u]||0)+1});var l=Object.keys(s).filter(function(c){return s[c]>1});return l.forEach(function(c){e=e.filter(function(u){var h=u.key,p=u.status;return h!==c||p!==ya}),e.forEach(function(u){u.key===c&&(u.status=va)})}),e}var Tp=["component","children","onVisibleChanged","onAllRemoved"],Pp=["status"],Dp=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Op(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_p,e=(function(r){ar(a,r);var i=cr(a);function a(){var o;St(this,a);for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return o=i.call.apply(i,[this].concat(l)),N(Ce(o),"state",{keyEntities:[]}),N(Ce(o),"removeKey",function(u){o.setState(function(h){var p=h.keyEntities.map(function(b){return b.key!==u?b:G(G({},b),{},{status:Bi})});return{keyEntities:p}},function(){var h=o.state.keyEntities,p=h.filter(function(b){var v=b.status;return v!==Bi}).length;p===0&&o.props.onAllRemoved&&o.props.onAllRemoved()})}),o}return Ft(a,[{key:"render",value:function(){var s=this,l=this.state.keyEntities,c=this.props,u=c.component,h=c.children,p=c.onVisibleChanged;c.onAllRemoved;var b=En(c,Tp),v=u||I.Fragment,f={};return Dp.forEach(function(d){f[d]=b[d],delete b[d]}),delete b.keys,I.createElement(v,b,l.map(function(d,m){var y=d.status,F=En(d,Pp),_=y===ma||y===va;return I.createElement(t,wt({},f,{key:F.key,visible:_,eventProps:F,onVisibleChanged:function(A){p==null||p(A,{key:F.key}),A||s.removeKey(F.key)}}),function(S,A){return h(G(G({},S),{},{index:m}),A)})}))}}],[{key:"getDerivedStateFromProps",value:function(s,l){var c=s.keys,u=l.keyEntities,h=ba(c),p=Ip(u,h);return{keyEntities:p.filter(function(b){var v=u.find(function(f){var d=f.key;return b.key===d});return!(v&&v.status===Bi&&b.status===ya)})}}}]),a})(I.Component);return N(e,"defaultProps",{component:"div"}),e}const Rp=Op(Tl),Go=I.createContext(!0);function Mp(n){const t=I.useContext(Go),{children:e}=n,[,r]=yi(),{motion:i}=r,a=I.useRef(!1);return a.current||(a.current=t!==i),a.current?I.createElement(Go.Provider,{value:i},I.createElement(pp,{motion:i},e)):e}const Np=()=>null;var Lp=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};const $p=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let li,Ll,$l,Bl;function ni(){return li||da}function Bp(){return Ll||vi}function Vp(n){return Object.keys(n).some(t=>t.endsWith("Color"))}const jp=n=>{const{prefixCls:t,iconPrefixCls:e,theme:r,holderRender:i}=n;t!==void 0&&(li=t),e!==void 0&&(Ll=e),"holderRender"in n&&(Bl=i),r&&(Vp(r)?Af(ni(),r):$l=r)},zp=()=>({getPrefixCls:(n,t)=>t||(n?`${ni()}-${n}`:ni()),getIconPrefixCls:Bp,getRootPrefixCls:()=>li||ni(),getTheme:()=>$l,holderRender:Bl}),qp=n=>{const{children:t,csp:e,autoInsertSpaceInButton:r,alert:i,anchor:a,form:o,locale:s,componentSize:l,direction:c,space:u,splitter:h,virtual:p,dropdownMatchSelectWidth:b,popupMatchSelectWidth:v,popupOverflow:f,legacyLocale:d,parentContext:m,iconPrefixCls:y,theme:F,componentDisabled:_,segmented:S,statistic:A,spin:T,calendar:E,carousel:w,cascader:g,collapse:O,typography:D,checkbox:R,descriptions:P,divider:W,drawer:U,skeleton:q,steps:z,image:J,layout:H,list:K,mentions:B,modal:V,progress:M,result:j,slider:X,breadcrumb:Z,menu:he,pagination:ee,input:ne,textArea:Ee,empty:Se,badge:de,radio:$e,rate:He,switch:me,transfer:ft,avatar:pt,message:at,tag:vt,table:Te,card:Pe,tabs:Ye,timeline:We,timePicker:Ge,upload:Y,notification:xe,tree:nt,colorPicker:Ot,datePicker:Rt,rangePicker:Nn,flex:Ke,wave:zt,dropdown:_n,warning:fr,tour:kt,tooltip:kn,popover:In,popconfirm:pr,floatButton:Tn,floatButtonGroup:hr,variant:gr,inputNumber:mr,treeSelect:qt}=n,bt=I.useCallback((Ie,Re)=>{const{prefixCls:ot}=n;if(Re)return Re;const ct=ot||m.getPrefixCls("");return Ie?`${ct}-${Ie}`:ct},[m.getPrefixCls,n.prefixCls]),Mt=y||m.iconPrefixCls||vi,Ut=e||m.csp;op(Mt,Ut);const cn=up(F,m.theme,{prefixCls:bt("")}),un={csp:Ut,autoInsertSpaceInButton:r,alert:i,anchor:a,locale:s||d,direction:c,space:u,splitter:h,virtual:p,popupMatchSelectWidth:v??b,popupOverflow:f,getPrefixCls:bt,iconPrefixCls:Mt,theme:cn,segmented:S,statistic:A,spin:T,calendar:E,carousel:w,cascader:g,collapse:O,typography:D,checkbox:R,descriptions:P,divider:W,drawer:U,skeleton:q,steps:z,image:J,input:ne,textArea:Ee,layout:H,list:K,mentions:B,modal:V,progress:M,result:j,slider:X,breadcrumb:Z,menu:he,pagination:ee,empty:Se,badge:de,radio:$e,rate:He,switch:me,transfer:ft,avatar:pt,message:at,tag:vt,table:Te,card:Pe,tabs:Ye,timeline:We,timePicker:Ge,upload:Y,notification:xe,tree:nt,colorPicker:Ot,datePicker:Rt,rangePicker:Nn,flex:Ke,wave:zt,dropdown:_n,warning:fr,tour:kt,tooltip:kn,popover:In,popconfirm:pr,floatButton:Tn,floatButtonGroup:hr,variant:gr,inputNumber:mr,treeSelect:qt},Ze=Object.assign({},m);Object.keys(un).forEach(Ie=>{un[Ie]!==void 0&&(Ze[Ie]=un[Ie])}),$p.forEach(Ie=>{const Re=n[Ie];Re&&(Ze[Ie]=Re)}),typeof r<"u"&&(Ze.button=Object.assign({autoInsertSpace:r},Ze.button));const oe=Js(()=>Ze,Ze,(Ie,Re)=>{const ot=Object.keys(Ie),ct=Object.keys(Re);return ot.length!==ct.length||ot.some(Wt=>Ie[Wt]!==Re[Wt])}),{layer:Qt}=I.useContext(Pr),gn=I.useMemo(()=>({prefixCls:Mt,csp:Ut,layer:Qt?"antd":void 0}),[Mt,Ut,Qt]);let be=I.createElement(I.Fragment,null,I.createElement(Np,{dropdownMatchSelectWidth:b}),t);const et=I.useMemo(()=>{var Ie,Re,ot,ct;return Kn(((Ie=mi.Form)===null||Ie===void 0?void 0:Ie.defaultValidateMessages)||{},((ot=(Re=oe.locale)===null||Re===void 0?void 0:Re.Form)===null||ot===void 0?void 0:ot.defaultValidateMessages)||{},((ct=oe.form)===null||ct===void 0?void 0:ct.validateMessages)||{},(o==null?void 0:o.validateMessages)||{})},[oe,o==null?void 0:o.validateMessages]);Object.keys(et).length>0&&(be=I.createElement(lf.Provider,{value:et},be)),s&&(be=I.createElement(df,{locale:s,_ANT_MARK__:uf},be)),be=I.createElement(Oc.Provider,{value:gn},be),l&&(be=I.createElement(kf,{size:l},be)),be=I.createElement(Mp,null,be);const Ht=I.useMemo(()=>{const Ie=cn||{},{algorithm:Re,token:ot,components:ct,cssVar:Wt}=Ie,Ln=Lp(Ie,["algorithm","token","components","cssVar"]),It=Re&&(!Array.isArray(Re)||Re.length>0)?aa(Re):fl,Zt={};Object.entries(ct||{}).forEach(([Bn,Vn])=>{const Et=Object.assign({},Vn);"algorithm"in Et&&(Et.algorithm===!0?Et.theme=It:(Array.isArray(Et.algorithm)||typeof Et.algorithm=="function")&&(Et.theme=aa(Et.algorithm)),delete Et.algorithm),Zt[Bn]=Et});const $n=Object.assign(Object.assign({},Ar),ot);return Object.assign(Object.assign({},Ln),{theme:It,token:$n,components:Zt,override:Object.assign({override:$n},Zt),cssVar:Wt})},[cn]);return F&&(be=I.createElement(pl.Provider,{value:Ht},be)),oe.warning&&(be=I.createElement(sf.Provider,{value:oe.warning},be)),_!==void 0&&(be=I.createElement(_f,{disabled:_},be)),I.createElement(hn.Provider,{value:oe},be)},dr=n=>{const t=I.useContext(hn),e=I.useContext(ul);return I.createElement(qp,Object.assign({parentContext:t,legacyLocale:e},n))};dr.ConfigContext=hn;dr.SizeContext=_r;dr.config=jp;dr.useConfig=If;Object.defineProperty(dr,"SizeContext",{get:()=>_r});var Dr=G({},Nc),Up=Dr.version,Vi=Dr.render,Hp=Dr.unmountComponentAtNode,bi;try{var Wp=Number((Up||"").split(".")[0]);Wp>=18&&(bi=Dr.createRoot)}catch{}function Ko(n){var t=Dr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&Fe(t)==="object"&&(t.usingClientEntryPoint=n)}var ci="__rc_react_root__";function Gp(n,t){Ko(!0);var e=t[ci]||bi(t);Ko(!1),e.render(n),t[ci]=e}function Kp(n,t){Vi==null||Vi(n,t)}function Xp(n,t){if(bi){Gp(n,t);return}Kp(n,t)}function Jp(n){return Ca.apply(this,arguments)}function Ca(){return Ca=Mn(_t().mark(function n(t){return _t().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.resolve().then(function(){var i;(i=t[ci])===null||i===void 0||i.unmount(),delete t[ci]}));case 1:case"end":return r.stop()}},n)})),Ca.apply(this,arguments)}function Yp(n){Hp(n)}function Qp(n){return xa.apply(this,arguments)}function xa(){return xa=Mn(_t().mark(function n(t){return _t().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(bi===void 0){r.next=2;break}return r.abrupt("return",Jp(t));case 2:Yp(t);case 3:case"end":return r.stop()}},n)})),xa.apply(this,arguments)}const Zp=(n,t)=>(Xp(n,t),()=>Qp(t));let eh=Zp;function th(n){return eh}var nh={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},rh=function(t,e){return I.createElement(or,wt({},t,{ref:e,icon:nh}))},ih=I.forwardRef(rh),ah={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},oh=function(t,e){return I.createElement(or,wt({},t,{ref:e,icon:ah}))},sh=I.forwardRef(oh),lh={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},ch=function(t,e){return I.createElement(or,wt({},t,{ref:e,icon:lh}))},uh=I.forwardRef(ch),dh={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},fh=function(t,e){return I.createElement(or,wt({},t,{ref:e,icon:dh}))},ph=I.forwardRef(fh),hh={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},gh=function(t,e){return I.createElement(or,wt({},t,{ref:e,icon:hh}))},mh=I.forwardRef(gh),vh={ENTER:13},yh=`accept acceptCharset accessKey action allowFullScreen allowTransparency
102
+ alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
103
+ charSet checked classID className colSpan cols content contentEditable contextMenu
104
+ controls coords crossOrigin data dateTime default defer dir disabled download draggable
105
+ encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
106
+ headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
107
+ is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
108
+ mediaGroup method min minLength multiple muted name noValidate nonce open
109
+ optimum pattern placeholder poster preload radioGroup readOnly rel required
110
+ reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
111
+ shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
112
+ summary tabIndex target title type useMap value width wmode wrap`,bh=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
113
+ onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
114
+ onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
115
+ onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
116
+ onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
117
+ onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
118
+ onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Ch="".concat(yh," ").concat(bh).split(/[\s\n]+/),xh="aria-",wh="data-";function Xo(n,t){return n.indexOf(t)===0}function Fh(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,e;t===!1?e={aria:!0,data:!0,attr:!0}:t===!0?e={aria:!0}:e=G({},t);var r={};return Object.keys(n).forEach(function(i){(e.aria&&(i==="role"||Xo(i,xh))||e.data&&Xo(i,wh)||e.attr&&Ch.includes(i))&&(r[i]=n[i])}),r}var Vl=I.forwardRef(function(n,t){var e=n.prefixCls,r=n.style,i=n.className,a=n.duration,o=a===void 0?4.5:a,s=n.showProgress,l=n.pauseOnHover,c=l===void 0?!0:l,u=n.eventKey,h=n.content,p=n.closable,b=n.closeIcon,v=b===void 0?"x":b,f=n.props,d=n.onClick,m=n.onNoticeClose,y=n.times,F=n.hovering,_=I.useState(!1),S=fe(_,2),A=S[0],T=S[1],E=I.useState(0),w=fe(E,2),g=w[0],O=w[1],D=I.useState(0),R=fe(D,2),P=R[0],W=R[1],U=F||A,q=o>0&&s,z=function(){m(u)},J=function(j){(j.key==="Enter"||j.code==="Enter"||j.keyCode===vh.ENTER)&&z()};I.useEffect(function(){if(!U&&o>0){var M=Date.now()-P,j=setTimeout(function(){z()},o*1e3-P);return function(){c&&clearTimeout(j),W(Date.now()-M)}}},[o,U,y]),I.useEffect(function(){if(!U&&q&&(c||P===0)){var M=performance.now(),j,X=function Z(){cancelAnimationFrame(j),j=requestAnimationFrame(function(he){var ee=he+P-M,ne=Math.min(ee/(o*1e3),1);O(ne*100),ne<1&&Z()})};return X(),function(){c&&cancelAnimationFrame(j)}}},[o,P,U,q,y]);var H=I.useMemo(function(){return Fe(p)==="object"&&p!==null?p:p?{closeIcon:v}:{}},[p,v]),K=Fh(H,!0),B=100-(!g||g<0?0:g>100?100:g),V="".concat(e,"-notice");return I.createElement("div",wt({},f,{ref:t,className:on(V,i,N({},"".concat(V,"-closable"),p)),style:r,onMouseEnter:function(j){var X;T(!0),f==null||(X=f.onMouseEnter)===null||X===void 0||X.call(f,j)},onMouseLeave:function(j){var X;T(!1),f==null||(X=f.onMouseLeave)===null||X===void 0||X.call(f,j)},onClick:d}),I.createElement("div",{className:"".concat(V,"-content")},h),p&&I.createElement("a",wt({tabIndex:0,className:"".concat(V,"-close"),onKeyDown:J,"aria-label":"Close"},K,{onClick:function(j){j.preventDefault(),j.stopPropagation(),z()}}),H.closeIcon),q&&I.createElement("progress",{className:"".concat(V,"-progress"),max:"100",value:B},B+"%"))}),jl=ye.createContext({}),Sh=function(t){var e=t.children,r=t.classNames;return ye.createElement(jl.Provider,{value:{classNames:r}},e)},Jo=8,Yo=3,Qo=16,Eh=function(t){var e={offset:Jo,threshold:Yo,gap:Qo};if(t&&Fe(t)==="object"){var r,i,a;e.offset=(r=t.offset)!==null&&r!==void 0?r:Jo,e.threshold=(i=t.threshold)!==null&&i!==void 0?i:Yo,e.gap=(a=t.gap)!==null&&a!==void 0?a:Qo}return[!!t,e]},Ah=["className","style","classNames","styles"],_h=function(t){var e=t.configList,r=t.placement,i=t.prefixCls,a=t.className,o=t.style,s=t.motion,l=t.onAllNoticeRemoved,c=t.onNoticeClose,u=t.stack,h=ln(jl),p=h.classNames,b=Le({}),v=le(null),f=fe(v,2),d=f[0],m=f[1],y=le([]),F=fe(y,2),_=F[0],S=F[1],A=e.map(function(U){return{config:U,key:String(U.key)}}),T=Eh(u),E=fe(T,2),w=E[0],g=E[1],O=g.offset,D=g.threshold,R=g.gap,P=w&&(_.length>0||A.length<=D),W=typeof s=="function"?s(r):s;return _e(function(){w&&_.length>1&&S(function(U){return U.filter(function(q){return A.some(function(z){var J=z.key;return q===J})})})},[_,A,w]),_e(function(){var U;if(w&&b.current[(U=A[A.length-1])===null||U===void 0?void 0:U.key]){var q;m(b.current[(q=A[A.length-1])===null||q===void 0?void 0:q.key])}},[A,w]),ye.createElement(Rp,wt({key:r,className:on(i,"".concat(i,"-").concat(r),p==null?void 0:p.list,a,N(N({},"".concat(i,"-stack"),!!w),"".concat(i,"-stack-expanded"),P)),style:o,keys:A,motionAppear:!0},W,{onAllRemoved:function(){l(r)}}),function(U,q){var z=U.config,J=U.className,H=U.style,K=U.index,B=z,V=B.key,M=B.times,j=String(V),X=z,Z=X.className,he=X.style,ee=X.classNames,ne=X.styles,Ee=En(X,Ah),Se=A.findIndex(function(We){return We.key===j}),de={};if(w){var $e=A.length-1-(Se>-1?Se:K-1),He=r==="top"||r==="bottom"?"-50%":"0";if($e>0){var me,ft,pt;de.height=P?(me=b.current[j])===null||me===void 0?void 0:me.offsetHeight:d==null?void 0:d.offsetHeight;for(var at=0,vt=0;vt<$e;vt++){var Te;at+=((Te=b.current[A[A.length-1-vt].key])===null||Te===void 0?void 0:Te.offsetHeight)+R}var Pe=(P?at:$e*O)*(r.startsWith("top")?1:-1),Ye=!P&&d!==null&&d!==void 0&&d.offsetWidth&&(ft=b.current[j])!==null&&ft!==void 0&&ft.offsetWidth?((d==null?void 0:d.offsetWidth)-O*2*($e<3?$e:3))/((pt=b.current[j])===null||pt===void 0?void 0:pt.offsetWidth):1;de.transform="translate3d(".concat(He,", ").concat(Pe,"px, 0) scaleX(").concat(Ye,")")}else de.transform="translate3d(".concat(He,", 0, 0)")}return ye.createElement("div",{ref:q,className:on("".concat(i,"-notice-wrapper"),J,ee==null?void 0:ee.wrapper),style:G(G(G({},H),de),ne==null?void 0:ne.wrapper),onMouseEnter:function(){return S(function(Ge){return Ge.includes(j)?Ge:[].concat(ce(Ge),[j])})},onMouseLeave:function(){return S(function(Ge){return Ge.filter(function(Y){return Y!==j})})}},ye.createElement(Vl,wt({},Ee,{ref:function(Ge){Se>-1?b.current[j]=Ge:delete b.current[j]},prefixCls:i,classNames:ee,styles:ne,className:on(Z,p==null?void 0:p.notice),style:he,times:M,key:V,eventKey:V,onNoticeClose:c,hovering:w&&_.length>0})))})},kh=I.forwardRef(function(n,t){var e=n.prefixCls,r=e===void 0?"rc-notification":e,i=n.container,a=n.motion,o=n.maxCount,s=n.className,l=n.style,c=n.onAllRemoved,u=n.stack,h=n.renderNotifications,p=I.useState([]),b=fe(p,2),v=b[0],f=b[1],d=function(w){var g,O=v.find(function(D){return D.key===w});O==null||(g=O.onClose)===null||g===void 0||g.call(O),f(function(D){return D.filter(function(R){return R.key!==w})})};I.useImperativeHandle(t,function(){return{open:function(w){f(function(g){var O=ce(g),D=O.findIndex(function(W){return W.key===w.key}),R=G({},w);if(D>=0){var P;R.times=(((P=g[D])===null||P===void 0?void 0:P.times)||0)+1,O[D]=R}else R.times=0,O.push(R);return o>0&&O.length>o&&(O=O.slice(-o)),O})},close:function(w){d(w)},destroy:function(){f([])}}});var m=I.useState({}),y=fe(m,2),F=y[0],_=y[1];I.useEffect(function(){var E={};v.forEach(function(w){var g=w.placement,O=g===void 0?"topRight":g;O&&(E[O]=E[O]||[],E[O].push(w))}),Object.keys(F).forEach(function(w){E[w]=E[w]||[]}),_(E)},[v]);var S=function(w){_(function(g){var O=G({},g),D=O[w]||[];return D.length||delete O[w],O})},A=I.useRef(!1);if(I.useEffect(function(){Object.keys(F).length>0?A.current=!0:A.current&&(c==null||c(),A.current=!1)},[F]),!i)return null;var T=Object.keys(F);return Lc(I.createElement(I.Fragment,null,T.map(function(E){var w=F[E],g=I.createElement(_h,{key:E,configList:w,placement:E,prefixCls:r,className:s==null?void 0:s(E),style:l==null?void 0:l(E),motion:a,onNoticeClose:d,onAllNoticeRemoved:S,stack:u});return h?h(g,{prefixCls:r,key:E}):g})),i)}),Ih=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],Th=function(){return document.body},Zo=0;function Ph(){for(var n={},t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.forEach(function(i){i&&Object.keys(i).forEach(function(a){var o=i[a];o!==void 0&&(n[a]=o)})}),n}function Dh(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=n.getContainer,e=t===void 0?Th:t,r=n.motion,i=n.prefixCls,a=n.maxCount,o=n.className,s=n.style,l=n.onAllRemoved,c=n.stack,u=n.renderNotifications,h=En(n,Ih),p=I.useState(),b=fe(p,2),v=b[0],f=b[1],d=I.useRef(),m=I.createElement(kh,{container:v,ref:d,prefixCls:i,motion:r,maxCount:a,className:o,style:s,onAllRemoved:l,stack:c,renderNotifications:u}),y=I.useState([]),F=fe(y,2),_=F[0],S=F[1],A=si(function(E){var w=Ph(h,E);(w.key===null||w.key===void 0)&&(w.key="rc-notification-".concat(Zo),Zo+=1),S(function(g){return[].concat(ce(g),[{type:"open",config:w}])})}),T=I.useMemo(function(){return{open:A,close:function(w){S(function(g){return[].concat(ce(g),[{type:"close",key:w}])})},destroy:function(){S(function(w){return[].concat(ce(w),[{type:"destroy"}])})}}},[]);return I.useEffect(function(){f(e())}),I.useEffect(function(){if(d.current&&_.length){_.forEach(function(g){switch(g.type){case"open":d.current.open(g.config);break;case"close":d.current.close(g.key);break;case"destroy":d.current.destroy();break}});var E,w;S(function(g){return(E!==g||!w)&&(E=g,w=g.filter(function(O){return!_.includes(O)})),w})}},[_]),[T,m]}const zl=n=>{const[,,,,t]=yi();return t?`${n}-css-var`:""};var Oh={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},Rh=function(t,e){return I.createElement(or,wt({},t,{ref:e,icon:Oh}))},Mh=I.forwardRef(Rh);const Nh=100,Lh=10,$h=Nh*Lh,Bh=n=>{const{componentCls:t,iconCls:e,boxShadow:r,colorText:i,colorSuccess:a,colorError:o,colorWarning:s,colorInfo:l,fontSizeLG:c,motionEaseInOutCirc:u,motionDurationSlow:h,marginXS:p,paddingXS:b,borderRadiusLG:v,zIndexPopup:f,contentPadding:d,contentBg:m}=n,y=`${t}-notice`,F=new ko("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:b,transform:"translateY(0)",opacity:1}}),_=new ko("MessageMoveOut",{"0%":{maxHeight:n.height,padding:b,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),S={padding:b,textAlign:"center",[`${t}-custom-content`]:{display:"flex",alignItems:"center"},[`${t}-custom-content > ${e}`]:{marginInlineEnd:p,fontSize:c},[`${y}-content`]:{display:"inline-block",padding:d,background:m,borderRadius:v,boxShadow:r,pointerEvents:"all"},[`${t}-success > ${e}`]:{color:a},[`${t}-error > ${e}`]:{color:o},[`${t}-warning > ${e}`]:{color:s},[`${t}-info > ${e},
119
+ ${t}-loading > ${e}`]:{color:l}};return[{[t]:Object.assign(Object.assign({},tp(n)),{color:i,position:"fixed",top:p,width:"100%",pointerEvents:"none",zIndex:f,[`${t}-move-up`]:{animationFillMode:"forwards"},[`
120
+ ${t}-move-up-appear,
121
+ ${t}-move-up-enter
122
+ `]:{animationName:F,animationDuration:h,animationPlayState:"paused",animationTimingFunction:u},[`
123
+ ${t}-move-up-appear${t}-move-up-appear-active,
124
+ ${t}-move-up-enter${t}-move-up-enter-active
125
+ `]:{animationPlayState:"running"},[`${t}-move-up-leave`]:{animationName:_,animationDuration:h,animationPlayState:"paused",animationTimingFunction:u},[`${t}-move-up-leave${t}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[t]:{[`${y}-wrapper`]:Object.assign({},S)}},{[`${t}-notice-pure-panel`]:Object.assign(Object.assign({},S),{padding:0,textAlign:"start"})}]},Vh=n=>({zIndexPopup:n.zIndexPopupBase+$h+10,contentBg:n.colorBgElevated,contentPadding:`${(n.controlHeightLG-n.fontSize*n.lineHeight)/2}px ${n.paddingSM}px`}),ql=ap("Message",n=>{const t=Ua(n,{height:150});return Bh(t)},Vh);var jh=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};const zh={info:I.createElement(ph,null),success:I.createElement(ih,null),error:I.createElement(sh,null),warning:I.createElement(uh,null),loading:I.createElement(mh,null)},Ul=({prefixCls:n,type:t,icon:e,children:r})=>I.createElement("div",{className:on(`${n}-custom-content`,`${n}-${t}`)},e||zh[t],I.createElement("span",null,r)),qh=n=>{const{prefixCls:t,className:e,type:r,icon:i,content:a}=n,o=jh(n,["prefixCls","className","type","icon","content"]),{getPrefixCls:s}=I.useContext(hn),l=t||s("message"),c=zl(l),[u,h,p]=ql(l,c);return u(I.createElement(Vl,Object.assign({},o,{prefixCls:l,className:on(e,h,`${l}-notice-pure-panel`,p,c),eventKey:"pure",duration:null,content:I.createElement(Ul,{prefixCls:l,type:r,icon:i},a)})))};function Uh(n,t){return{motionName:t??`${n}-move-up`}}function Ga(n){let t;const e=new Promise(i=>{t=n(()=>{i(!0)})}),r=()=>{t==null||t()};return r.then=(i,a)=>e.then(i,a),r.promise=e,r}var Hh=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};const Wh=8,Gh=3,Kh=({children:n,prefixCls:t})=>{const e=zl(t),[r,i,a]=ql(t,e);return r(I.createElement(Sh,{classNames:{list:on(i,a,e)}},n))},Xh=(n,{prefixCls:t,key:e})=>I.createElement(Kh,{prefixCls:t,key:e},n),Jh=I.forwardRef((n,t)=>{const{top:e,prefixCls:r,getContainer:i,maxCount:a,duration:o=Gh,rtl:s,transitionName:l,onAllRemoved:c}=n,{getPrefixCls:u,getPopupContainer:h,message:p,direction:b}=I.useContext(hn),v=r||u("message"),f=()=>({left:"50%",transform:"translateX(-50%)",top:e??Wh}),d=()=>on({[`${v}-rtl`]:s??b==="rtl"}),m=()=>Uh(v,l),y=I.createElement("span",{className:`${v}-close-x`},I.createElement(Mh,{className:`${v}-close-icon`})),[F,_]=Dh({prefixCls:v,style:f,className:d,motion:m,closable:!1,closeIcon:y,duration:o,getContainer:()=>(i==null?void 0:i())||(h==null?void 0:h())||document.body,maxCount:a,onAllRemoved:c,renderNotifications:Xh});return I.useImperativeHandle(t,()=>Object.assign(Object.assign({},F),{prefixCls:v,message:p})),_});let es=0;function Hl(n){const t=I.useRef(null);return[I.useMemo(()=>{const r=l=>{var c;(c=t.current)===null||c===void 0||c.close(l)},i=l=>{if(!t.current){const A=()=>{};return A.then=()=>{},A}const{open:c,prefixCls:u,message:h}=t.current,p=`${u}-notice`,{content:b,icon:v,type:f,key:d,className:m,style:y,onClose:F}=l,_=Hh(l,["content","icon","type","key","className","style","onClose"]);let S=d;return S==null&&(es+=1,S=`antd-message-${es}`),Ga(A=>(c(Object.assign(Object.assign({},_),{key:S,content:I.createElement(Ul,{prefixCls:u,type:f,icon:v},b),placement:"top",className:on(f&&`${p}-${f}`,m,h==null?void 0:h.className),style:Object.assign(Object.assign({},h==null?void 0:h.style),y),onClose:()=>{F==null||F(),A()}})),()=>{r(S)}))},o={open:i,destroy:l=>{var c;l!==void 0?r(l):(c=t.current)===null||c===void 0||c.destroy()}};return["info","success","warning","error","loading"].forEach(l=>{const c=(u,h,p)=>{let b;u&&typeof u=="object"&&"content"in u?b=u:b={content:u};let v,f;typeof h=="function"?f=h:(v=h,f=p);const d=Object.assign(Object.assign({onClose:f,duration:v},b),{type:l});return i(d)};o[l]=c}),o},[]),I.createElement(Jh,Object.assign({key:"message-holder"},n,{ref:t}))]}function Yh(n){return Hl(n)}let Vt=null,Dn=n=>n(),kr=[],Ir={};function ts(){const{getContainer:n,duration:t,rtl:e,maxCount:r,top:i}=Ir,a=(n==null?void 0:n())||document.body;return{getContainer:()=>a,duration:t,rtl:e,maxCount:r,top:i}}const Qh=ye.forwardRef((n,t)=>{const{messageConfig:e,sync:r}=n,{getPrefixCls:i}=ln(hn),a=Ir.prefixCls||i("message"),o=ln(rd),[s,l]=Hl(Object.assign(Object.assign(Object.assign({},e),{prefixCls:a}),o.message));return ye.useImperativeHandle(t,()=>{const c=Object.assign({},s);return Object.keys(c).forEach(u=>{c[u]=(...h)=>(r(),s[u].apply(s,h))}),{instance:c,sync:r}}),l}),Zh=ye.forwardRef((n,t)=>{const[e,r]=ye.useState(ts),i=()=>{r(ts)};ye.useEffect(i,[]);const a=zp(),o=a.getRootPrefixCls(),s=a.getIconPrefixCls(),l=a.getTheme(),c=ye.createElement(Qh,{ref:t,sync:i,messageConfig:e});return ye.createElement(dr,{prefixCls:o,iconPrefixCls:s,theme:l},a.holderRender?a.holderRender(c):c)}),Ci=()=>{if(!Vt){const n=document.createDocumentFragment(),t={fragment:n};Vt=t,Dn(()=>{th()(ye.createElement(Zh,{ref:r=>{const{instance:i,sync:a}=r||{};Promise.resolve().then(()=>{!t.instance&&i&&(t.instance=i,t.sync=a,Ci())})}}),n)});return}Vt.instance&&(kr.forEach(n=>{const{type:t,skipped:e}=n;if(!e)switch(t){case"open":{Dn(()=>{const r=Vt.instance.open(Object.assign(Object.assign({},Ir),n.config));r==null||r.then(n.resolve),n.setCloseFn(r)});break}case"destroy":Dn(()=>{Vt==null||Vt.instance.destroy(n.key)});break;default:Dn(()=>{var r;const i=(r=Vt.instance)[t].apply(r,ce(n.args));i==null||i.then(n.resolve),n.setCloseFn(i)})}}),kr=[])};function eg(n){Ir=Object.assign(Object.assign({},Ir),n),Dn(()=>{var t;(t=Vt==null?void 0:Vt.sync)===null||t===void 0||t.call(Vt)})}function tg(n){const t=Ga(e=>{let r;const i={type:"open",config:n,resolve:e,setCloseFn:a=>{r=a}};return kr.push(i),()=>{r?Dn(()=>{r()}):i.skipped=!0}});return Ci(),t}function ng(n,t){const e=Ga(r=>{let i;const a={type:n,args:t,resolve:r,setCloseFn:o=>{i=o}};return kr.push(a),()=>{i?Dn(()=>{i()}):a.skipped=!0}});return Ci(),e}const rg=n=>{kr.push({type:"destroy",key:n}),Ci()},ig=["success","info","warning","error","loading"],ag={open:tg,destroy:rg,config:eg,useMessage:Yh,_InternalPanelDoNotUseOrYouWillBeFired:qh},ri=ag;ig.forEach(n=>{ri[n]=(...t)=>ng(n,t)});var ii={exports:{}};/*!
126
+ * clipboard.js v2.0.11
127
+ * https://clipboardjs.com/
128
+ *
129
+ * Licensed MIT © Zeno Rocha
130
+ */var og=ii.exports,ns;function sg(){return ns||(ns=1,(function(n,t){(function(r,i){n.exports=i()})(og,function(){return(function(){var e={686:(function(a,o,s){s.d(o,{default:function(){return K}});var l=s(279),c=s.n(l),u=s(370),h=s.n(u),p=s(817),b=s.n(p);function v(B){try{return document.execCommand(B)}catch{return!1}}var f=function(V){var M=b()(V);return v("cut"),M},d=f;function m(B){var V=document.documentElement.getAttribute("dir")==="rtl",M=document.createElement("textarea");M.style.fontSize="12pt",M.style.border="0",M.style.padding="0",M.style.margin="0",M.style.position="absolute",M.style[V?"right":"left"]="-9999px";var j=window.pageYOffset||document.documentElement.scrollTop;return M.style.top="".concat(j,"px"),M.setAttribute("readonly",""),M.value=B,M}var y=function(V,M){var j=m(V);M.container.appendChild(j);var X=b()(j);return v("copy"),j.remove(),X},F=function(V){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},j="";return typeof V=="string"?j=y(V,M):V instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(V==null?void 0:V.type)?j=y(V.value,M):(j=b()(V),v("copy")),j},_=F;function S(B){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?S=function(M){return typeof M}:S=function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},S(B)}var A=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=V.action,j=M===void 0?"copy":M,X=V.container,Z=V.target,he=V.text;if(j!=="copy"&&j!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Z!==void 0)if(Z&&S(Z)==="object"&&Z.nodeType===1){if(j==="copy"&&Z.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(j==="cut"&&(Z.hasAttribute("readonly")||Z.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(he)return _(he,{container:X});if(Z)return j==="cut"?d(Z):_(Z,{container:X})},T=A;function E(B){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?E=function(M){return typeof M}:E=function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},E(B)}function w(B,V){if(!(B instanceof V))throw new TypeError("Cannot call a class as a function")}function g(B,V){for(var M=0;M<V.length;M++){var j=V[M];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(B,j.key,j)}}function O(B,V,M){return V&&g(B.prototype,V),M&&g(B,M),B}function D(B,V){if(typeof V!="function"&&V!==null)throw new TypeError("Super expression must either be null or a function");B.prototype=Object.create(V&&V.prototype,{constructor:{value:B,writable:!0,configurable:!0}}),V&&R(B,V)}function R(B,V){return R=Object.setPrototypeOf||function(j,X){return j.__proto__=X,j},R(B,V)}function P(B){var V=q();return function(){var j=z(B),X;if(V){var Z=z(this).constructor;X=Reflect.construct(j,arguments,Z)}else X=j.apply(this,arguments);return W(this,X)}}function W(B,V){return V&&(E(V)==="object"||typeof V=="function")?V:U(B)}function U(B){if(B===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function z(B){return z=Object.setPrototypeOf?Object.getPrototypeOf:function(M){return M.__proto__||Object.getPrototypeOf(M)},z(B)}function J(B,V){var M="data-clipboard-".concat(B);if(V.hasAttribute(M))return V.getAttribute(M)}var H=(function(B){D(M,B);var V=P(M);function M(j,X){var Z;return w(this,M),Z=V.call(this),Z.resolveOptions(X),Z.listenClick(j),Z}return O(M,[{key:"resolveOptions",value:function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof X.action=="function"?X.action:this.defaultAction,this.target=typeof X.target=="function"?X.target:this.defaultTarget,this.text=typeof X.text=="function"?X.text:this.defaultText,this.container=E(X.container)==="object"?X.container:document.body}},{key:"listenClick",value:function(X){var Z=this;this.listener=h()(X,"click",function(he){return Z.onClick(he)})}},{key:"onClick",value:function(X){var Z=X.delegateTarget||X.currentTarget,he=this.action(Z)||"copy",ee=T({action:he,container:this.container,target:this.target(Z),text:this.text(Z)});this.emit(ee?"success":"error",{action:he,text:ee,trigger:Z,clearSelection:function(){Z&&Z.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(X){return J("action",X)}},{key:"defaultTarget",value:function(X){var Z=J("target",X);if(Z)return document.querySelector(Z)}},{key:"defaultText",value:function(X){return J("text",X)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(X){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return _(X,Z)}},{key:"cut",value:function(X){return d(X)}},{key:"isSupported",value:function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Z=typeof X=="string"?[X]:X,he=!!document.queryCommandSupported;return Z.forEach(function(ee){he=he&&!!document.queryCommandSupported(ee)}),he}}]),M})(c()),K=H}),828:(function(a){var o=9;if(typeof Element<"u"&&!Element.prototype.matches){var s=Element.prototype;s.matches=s.matchesSelector||s.mozMatchesSelector||s.msMatchesSelector||s.oMatchesSelector||s.webkitMatchesSelector}function l(c,u){for(;c&&c.nodeType!==o;){if(typeof c.matches=="function"&&c.matches(u))return c;c=c.parentNode}}a.exports=l}),438:(function(a,o,s){var l=s(828);function c(p,b,v,f,d){var m=h.apply(this,arguments);return p.addEventListener(v,m,d),{destroy:function(){p.removeEventListener(v,m,d)}}}function u(p,b,v,f,d){return typeof p.addEventListener=="function"?c.apply(null,arguments):typeof v=="function"?c.bind(null,document).apply(null,arguments):(typeof p=="string"&&(p=document.querySelectorAll(p)),Array.prototype.map.call(p,function(m){return c(m,b,v,f,d)}))}function h(p,b,v,f){return function(d){d.delegateTarget=l(d.target,b),d.delegateTarget&&f.call(p,d)}}a.exports=u}),879:(function(a,o){o.node=function(s){return s!==void 0&&s instanceof HTMLElement&&s.nodeType===1},o.nodeList=function(s){var l=Object.prototype.toString.call(s);return s!==void 0&&(l==="[object NodeList]"||l==="[object HTMLCollection]")&&"length"in s&&(s.length===0||o.node(s[0]))},o.string=function(s){return typeof s=="string"||s instanceof String},o.fn=function(s){var l=Object.prototype.toString.call(s);return l==="[object Function]"}}),370:(function(a,o,s){var l=s(879),c=s(438);function u(v,f,d){if(!v&&!f&&!d)throw new Error("Missing required arguments");if(!l.string(f))throw new TypeError("Second argument must be a String");if(!l.fn(d))throw new TypeError("Third argument must be a Function");if(l.node(v))return h(v,f,d);if(l.nodeList(v))return p(v,f,d);if(l.string(v))return b(v,f,d);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function h(v,f,d){return v.addEventListener(f,d),{destroy:function(){v.removeEventListener(f,d)}}}function p(v,f,d){return Array.prototype.forEach.call(v,function(m){m.addEventListener(f,d)}),{destroy:function(){Array.prototype.forEach.call(v,function(m){m.removeEventListener(f,d)})}}}function b(v,f,d){return c(document.body,v,f,d)}a.exports=u}),817:(function(a){function o(s){var l;if(s.nodeName==="SELECT")s.focus(),l=s.value;else if(s.nodeName==="INPUT"||s.nodeName==="TEXTAREA"){var c=s.hasAttribute("readonly");c||s.setAttribute("readonly",""),s.select(),s.setSelectionRange(0,s.value.length),c||s.removeAttribute("readonly"),l=s.value}else{s.hasAttribute("contenteditable")&&s.focus();var u=window.getSelection(),h=document.createRange();h.selectNodeContents(s),u.removeAllRanges(),u.addRange(h),l=u.toString()}return l}a.exports=o}),279:(function(a){function o(){}o.prototype={on:function(s,l,c){var u=this.e||(this.e={});return(u[s]||(u[s]=[])).push({fn:l,ctx:c}),this},once:function(s,l,c){var u=this;function h(){u.off(s,h),l.apply(c,arguments)}return h._=l,this.on(s,h,c)},emit:function(s){var l=[].slice.call(arguments,1),c=((this.e||(this.e={}))[s]||[]).slice(),u=0,h=c.length;for(u;u<h;u++)c[u].fn.apply(c[u].ctx,l);return this},off:function(s,l){var c=this.e||(this.e={}),u=c[s],h=[];if(u&&l)for(var p=0,b=u.length;p<b;p++)u[p].fn!==l&&u[p].fn._!==l&&h.push(u[p]);return h.length?c[s]=h:delete c[s],this}},a.exports=o,a.exports.TinyEmitter=o})},r={};function i(a){if(r[a])return r[a].exports;var o=r[a]={exports:{}};return e[a](o,o.exports,i),o.exports}return(function(){i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,{a:o}),o}})(),(function(){i.d=function(a,o){for(var s in o)i.o(o,s)&&!i.o(a,s)&&Object.defineProperty(a,s,{enumerable:!0,get:o[s]})}})(),(function(){i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)}})(),i(686)})().default})})(ii)),ii.exports}var lg=sg();const cg=Rc(lg),ug=(n,t)=>{let e=n&&n.replace(/<think>[\s\S]*?<\/think>/g,"");e=e.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,""),e=e.replace(/<a\s+[^>]*>(.*?)<\/a>/g,""),console.log("_content",e);const r=new cg(t.currentTarget||t.target,{text:()=>e});try{r.on("success",()=>{ri.success("\u6587\u672C\u590D\u5236\u6210\u529F",2),r.destroy()}),r.on("error",i=>{ri.error("\u590D\u5236\u5931\u8D25",2),r.destroy()}),r.onClick(t)}catch(i){r.destroy(),ri.error("\u590D\u5236\u5931\u8D25: "+i,2)}};function dg(n){const t=[];for(const e of n){if(e.query){const r=e.query.queryId||e.query.id||e.queryId||e.id||an(32);t.push({istype:"user",content:e.query.content,time:e.query.gmtCreate,queryId:r,clientSideId:r+"-user",...e.query})}if(e.reply){const r=e.reply.queryId||e.reply.id||e.queryId||e.id||an(32);t.push({istype:"ai",content:e.reply.content,isDefault:e.reply.isDefault,time:e.time||e.gmtCreate||Date.now(),queryId:r,clientSideId:r+"-ai",...e.reply})}}return t}const fg=""+new URL("assets/defaultWeLogo.svg",import.meta.url).href,pg="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==",hg=(n,t)=>{const e={...Oa.colors,...n};return`
131
+ .g-welcome-${t} .g-welcome-title {
132
+ background-image: linear-gradient(90deg, #3262FA 0%, #6C18FF 100%);
133
+ -webkit-background-clip: text;
134
+ background-clip: text;
135
+ color: transparent;
136
+ -webkit-text-fill-color: transparent;
137
+ }
138
+ .g-welcome-${t} .g-welcome-subtitle {
139
+ color: ${e.disabled};
140
+ }
141
+ .g-welcome-${t} .g-welcome-btn {
142
+ background-color: #ffffff;
143
+ border-color: ${e.border};
144
+ color: ${e.text};
145
+ height: 36px;
146
+ border-width: 1px;
147
+ box-shadow: 0 1px 2px rgba(31,35,41,0.04);
148
+ }
149
+ .g-welcome-${t} .g-welcome-btn:hover {
150
+ border-color: ${e.primary};
151
+ color: ${e.primary};
152
+ background-color: #ffffff;
153
+ box-shadow: 0 2px 6px rgba(31,35,41,0.08);
154
+ }
155
+ .g-welcome-${t} .g-welcome-btn.active {
156
+ background-image: linear-gradient(90deg, #F1F8FF 0%, #F9F4FF 100%);
157
+ border-color: ${e.primary};
158
+ box-shadow: 0 4px 10px rgba(24, 144, 255, 0.25);
159
+ }
160
+ .g-welcome-${t} .g-welcome-btn .icon-badge {
161
+ width: 24px;
162
+ height: 24px;
163
+ border-radius: 9999px;
164
+ display: inline-flex;
165
+ align-items: center;
166
+ justify-content: center;
167
+ background: radial-gradient(100% 100% at 50% 0%, #F2F3F5 0%, #FFFFFF 100%);
168
+ box-shadow: inset 0 0 0 1px ${e.border};
169
+ }
170
+ .g-welcome-${t} .g-welcome-pagination-btn {
171
+ background: transparent;
172
+ border: none;
173
+ color: ${e.disabled};
174
+ padding: 6px 10px;
175
+ border-radius: 9999px;
176
+ transition: all 0.2s;
177
+ font-size: 14px;
178
+ line-height: 1;
179
+ min-width: 32px;
180
+ height: 32px;
181
+ display: inline-flex;
182
+ align-items: center;
183
+ justify-content: center;
184
+ }
185
+ .g-welcome-${t} .g-welcome-pagination-btn:hover:not(:disabled) {
186
+ color: ${e.text};
187
+ background-color: ${e.border}33;
188
+ }
189
+ .g-welcome-${t} .g-welcome-pagination-btn.active {
190
+ color: ${e.primary};
191
+ background: radial-gradient(100% 100% at 50% 50%, ${e.primary}10 0%, ${e.primary}08 100%);
192
+ box-shadow: 0 2px 10px ${e.primary}12, inset 0 0 0 1px ${e.primary}1A;
193
+ }
194
+ .g-welcome-${t} .g-welcome-pagination-btn:disabled {
195
+ color: ${e.disabled};
196
+ cursor: not-allowed;
197
+ background: transparent;
198
+ }
199
+ .g-welcome-${t} .g-welcome-pagination-text {
200
+ color: ${e.disabled};
201
+ font-size: 14px;
202
+ padding: 0 8px;
203
+ }
204
+ .g-welcome-${t} .g-welcome-pagination-dot {
205
+ width: 6px;
206
+ height: 6px;
207
+ border-radius: 50%;
208
+ background-color: ${e.border};
209
+ transition: all 0.2s;
210
+ }
211
+ .g-welcome-${t} .g-welcome-pagination-dot.active {
212
+ background-color: ${e.primary};
213
+ width: 20px;
214
+ border-radius: 3px;
215
+ }
216
+ .g-welcome-${t} .g-welcome-search-btn {
217
+ background-color: #ffffff;
218
+ border: 1px solid ${e.border};
219
+ color: ${e.text};
220
+ padding: 8px 8px;
221
+ border-radius: 100%;
222
+ cursor: pointer;
223
+ transition: all 0.2s;
224
+ display: flex;
225
+ align-items: center;
226
+ gap: 6px;
227
+ font-size: 14px;
228
+ box-shadow: 0 1px 2px rgba(31,35,41,0.04);
229
+ }
230
+ .g-welcome-${t} .g-welcome-search-btn:hover {
231
+ border-color: ${e.primary};
232
+ color: ${e.primary};
233
+ box-shadow: 0 2px 6px rgba(31,35,41,0.08);
234
+ }
235
+ .g-welcome-${t} .g-welcome-search-input {
236
+ border: 1px solid ${e.border};
237
+ border-radius: 9999px;
238
+ transition: all 0.2s;
239
+ height: 40px;
240
+ padding: 0 14px;
241
+ }
242
+ .g-welcome-${t} .g-welcome-search-input:focus,
243
+ .g-welcome-${t} .g-welcome-search-input:hover {
244
+ border-color: ${e.primary};
245
+ box-shadow: 0 0 0 2px ${e.primary}1A;
246
+ }
247
+ `};function gg({config:n,styles:t}){if(!n)return null;const e=JSON.parse(n.configJson),r=ze(()=>{var i;return{...Oa.colors,...(i=t==null?void 0:t.theme)==null?void 0:i.colors}},[t]);return te("div",{className:"w-[340px] rounded-xl p-4 animate-fade-in bg-white",children:[te("div",{className:"flex items-center mb-2",children:[k("span",{className:"text-md font-bold truncate mr-2",style:{color:r.primary},children:e.config_name||"\u52A9\u624B\u914D\u7F6E"}),k("span",{className:"text-xs truncate rounded px-2 py-0.5",style:{backgroundColor:`${r.primary}1A`,color:r.disabled},children:e.model_name})]}),k("div",{className:"border-b my-2",style:{borderColor:r.border}}),te("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-700 mb-2",style:{color:r.text},children:[te("div",{children:["\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570\uFF1A",k("span",{className:"font-semibold",children:e.max_round})]}),te("div",{children:["\u6700\u5927\u4EE4\u724C\u6570\uFF1A",k("span",{className:"font-semibold",children:e.max_tokens})]}),te("div",{children:["\u6E29\u5EA6\uFF1A",k("span",{className:"font-semibold",children:e.temperature})]}),te("div",{children:["\u53EC\u56DE\u6570\uFF1A",k("span",{className:"font-semibold",children:e.top_k})]}),te("div",{children:["\u591A\u6837\u6027\uFF1A",k("span",{className:"font-semibold",children:e.top_p})]}),te("div",{children:["\u76F8\u4F3C\u5EA6\u9608\u503C\uFF1A",k("span",{className:"font-semibold",children:e.score_threshold})]})]}),te("div",{className:"mb-2",children:[k("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5173\u8054\u77E5\u8BC6\u5E93\uFF1A"}),k("div",{className:"flex flex-wrap gap-1",children:e.knowledge_base_name?e.knowledge_base_name.split(";").map((i,a)=>k("span",{className:"px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${r.primary}1A`,color:r.primary},children:i},a)):k("span",{className:"text-gray-300",style:{color:r.disabled},children:"\u65E0"})})]}),te("div",{className:"mb-2",children:[k("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5F00\u542F\u529F\u80FD:"}),te("div",{className:"flex flex-wrap gap-2 text-xs mt-2",children:[!!e.enabled_faq&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"FAQ"}),!!e.enabled_graph&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u56FE\u8C31"}),!!e.dependOnKb&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u5F3A\u77E5\u8BC6\u4F9D\u8D56"}),!!e.enabled_table_select&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u8868\u683C\u7B5B\u9009"}),!!e.enabled_rerank&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u7CBE\u6392\u6A21\u5F0F"}),!!e.need_trace_source&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u6EAF\u6E90"}),!!e.is_download&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u4E0B\u8F7D\u6EAF\u6E90"})]})]})]})}function mg(n,t=[],e=60){const[r,i]=le("");return _e(()=>{if(i(""),!n)return;let a=0;const o=setInterval(()=>{i(s=>a>=n.length?(clearInterval(o),s):(a++,n.slice(0,a)))},e);return()=>clearInterval(o)},[n,...t]),r}function vg(n){const{assistantList:t,eventsEmit:e,styles:r,selectedId:i,onSelectAssistant:a,productLogo:o}=n,{messages:s}=pi(),[l,c]=le(1),[u,h]=le(!1),[p,b]=le(""),v=u||p.trim()?6:12,f=Le(),d=Le(!1),m=Le(null),y=Le(null),F=Le("");_e(()=>{i&&f.current!==i&&(e==null||e("conversation:new_assistant_change",{assistantId:i}),f.current=i)},[i,e]);const _=ze(()=>an(),[]);_e(()=>{var D;if((D=r==null?void 0:r.theme)!=null&&D.colors){const R=document.createElement("style");return R.innerHTML=hg(r.theme.colors,_),R.id=`g-welcome-styles-${_}`,document.head.appendChild(R),()=>{const P=document.getElementById(R.id);P&&P.remove()}}},[r,_]);const S=ze(()=>t.find(D=>D.id===i),[t,i]),A=ze(()=>JSON.parse((S==null?void 0:S.configJson)||"{}"),[S]),T=ze(()=>{if(!p.trim())return t||[];const D=p.toLowerCase().trim();return(t||[]).filter(R=>{var W,U;const P=((W=R.name)==null?void 0:W.toLowerCase())||"";try{const z=((U=JSON.parse(R.configJson||"{}").config_name)==null?void 0:U.toLowerCase())||"";return P.includes(D)||z.includes(D)}catch{return P.includes(D)}})},[t,p]),E=Math.ceil(((T==null?void 0:T.length)||0)/v),w=(T==null?void 0:T.slice((l-1)*v,l*v))||[];_e(()=>{if(i&&i!==y.current){if(d.current&&m.current!==null){y.current=i;return}const D=p.trim()?T:t;if(D&&D.length>0){const R=D.findIndex(P=>P.id===i);if(R!==-1){const P=Math.floor(R/v)+1;c(P),y.current=i}}}},[i,t,T,v,p]),_e(()=>{if(p!==F.current){if(d.current&&m.current!==null){c(m.current),d.current=!1,m.current=null,F.current=p;return}if(y.current===i){F.current=p;return}d.current||(p.trim()&&(y.current=null),c(1)),F.current=p}},[p,i]),_e(()=>{E>0&&l>E&&c(E)},[E,l]);const g=A.prologue||s.welcome.defaultPrologue,O=mg(g,[i],30);return te("div",{className:`flex flex-col relative items-center justify-center h-full w-full g-welcome-${_}`,children:[k("img",{src:o||fg,alt:"logo",className:"mb-4",style:{width:68,height:68}}),k("div",{className:"text-3xl font-bold mb-2 g-welcome-title",children:O}),!i&&k("div",{className:"flex mb-2 g-welcome-subtitle",children:s.welcome.selectAssistant}),te("div",{style:{maxWidth:"1200px"},className:`flex mt-8 flex-wrap gap-3
248
+ max-w-[1200px] px-8 w-full mx-auto justify-center mb-4`,children:[u?k("div",{className:"flex items-center gap-2 px-5 w-full",style:{flexBasis:"100%"},children:k(Cs,{className:"g-welcome-search-input w-full",placeholder:s.welcome.searchAssistant,prefix:k(Ki,{size:16}),suffix:k("button",{type:"button",onClick:()=>{h(!1),b("")},style:{background:"transparent",border:"none",cursor:"pointer"},children:k(Es,{size:14})}),value:p,onChange:D=>b(D.target.value),autoFocus:!0})}):k("button",{type:"button",className:"g-welcome-search-btn",onClick:()=>h(!0),children:k(Ki,{size:16})}),w&&w.length>0?k(Tr,{children:w.map(D=>{const R=i===D.id;let P=D.icon;try{const W=JSON.parse(D.configJson||"{}");P=P||W.icon||W.avatar||W.logo}catch{}return P=P||pg,k(xc,{content:()=>k(gg,{config:t.find(W=>W.id===D.id),styles:r}),trigger:"hover",placement:"bottom",children:te("button",{type:"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 ${R?"active":""}`,onClick:()=>{a==null||a(D.id);const W=u||p.trim(),q=(W?t:p.trim()?T:t).findIndex(z=>z.id===D.id);if(q!==-1){const J=Math.floor(q/(W?12:v))+1;c(J),y.current=D.id,W&&(m.current=J,d.current=!0,setTimeout(()=>{b(""),h(!1)},100))}},title:D.name,children:[k("span",{className:"icon-badge",children:k("img",{src:P,alt:"icon",style:{width:16,height:16,borderRadius:4}})}),k("span",{className:"truncate max-w-[180px]",children:D.name})]})},D.id)})}):k("div",{className:"g-welcome-subtitle",children:"\u6682\u65E0\u53EF\u7528\u52A9\u624B"})]}),E>1&&te("div",{className:"flex items-center gap-2",children:[k("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>c(D=>Math.max(1,D-1)),disabled:l===1,children:k(lu,{size:16})}),k("div",{className:"flex items-center gap-1",children:(()=>{const D=[];if(E<=7)for(let P=1;P<=E;P++)D.push(P);else if(D.push(1),l<=4){for(let P=2;P<=5;P++)D.push(P);D.push("..."),D.push(E)}else if(l>=E-3){D.push("...");for(let P=E-4;P<=E;P++)D.push(P)}else{D.push("...");for(let P=l-1;P<=l+1;P++)D.push(P);D.push("..."),D.push(E)}return D.map((P,W)=>{if(P==="...")return k("span",{className:"g-welcome-pagination-text px-1",children:"..."},`ellipsis-${W}`);const U=P;return k("button",{type:"button",className:`g-welcome-pagination-btn ${l===U?"active":""}`,onClick:()=>c(U),children:U},U)})})()}),k("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>c(D=>Math.min(E,D+1)),disabled:l===E,children:k(cu,{size:16})})]})]})}class ji extends Error{}let tn=null,fn=null,Kt=null,Me=[],qn,Un,zi=new Map;const yg=({baseUrl:n,token:t,CSRFToken:e,setChatData:r,activeSessionId:i,setAppStatus:a,setConversationList:o})=>{const s=d=>{if(!d)return!1;if(typeof d=="string"){const m=d.trim();return m!==""&&m!=="[]"&&m!=="null"}return!0},l=({content:d,status:m,respTime:y,filePaths:F,reference:_,webReference:S,knowledgeBases:A,graphReference:T,databaseReference:E,llmType:w,resultType:g,queryId:O,tokens:D,chain:R,thoughtChainNodes:P,enableCot:W,chainRespTime:U,faqReference:q})=>{r(z=>{var ne;if(!z[0])return z;const J=z[0],H=J.messages||[],K=H.length-1;if(K<0)return z;const B=H[K];if(B.istype!=="ai")return z;let V=H.slice();if(F!=null&&F.length){const Ee=H.length-2;if(Ee>=0&&((ne=H[Ee])==null?void 0:ne.istype)==="user"){const Se={...H[Ee],filePaths:F};V[Ee]=Se}}const M=O&&O!==B.queryId,j=m===1&&B.status===2,X=M||j?s(T)?T:null:T!==void 0&&s(T)?T:B.graphReference;m===2&&T!==void 0&&console.log("[AichatUseController] reset_chat status=2 \u65F6\u7684 graphReference:",{graphReference:T,isValid:s(T),lastMessageGraphReference:B.graphReference,finalGraphReference:X,isNewQuery:M,isRestart:j});let Z;M?Z=d:j?Z="":m===4||m===2&&!d?Z=B.content||"":Z=(B.content||"")+d;const he={...B,content:Z,status:m,respTime:y,filePaths:F,reference:M||j?_||"[]":_,webReference:M||j?S||"[]":S,knowledgeBases:M||j?A||"[]":A,graphReference:X,databaseReference:M||j?E!==void 0?E:null:E!==void 0?E:B.databaseReference,resultType:g,llmType:w,tokens:D,queryId:O||B.queryId||an(32),chain:M||j?R!==void 0?R:void 0:R!==void 0?R:B.chain,thoughtChainNodes:M||j?P!==void 0?P:void 0:P!==void 0?P:B.thoughtChainNodes,enableCot:W!==void 0?W:B.enableCot,chainRespTime:U!==void 0?U:B.chainRespTime,faqReference:M||j?q!==void 0?q:null:q!==void 0?q:B.faqReference};return he.clientSideId=he.clientSideId||he.queryId+"-ai",V[K]=he,[{...J,isNew:!1,messages:V},...z.slice(1)]})},c=d=>{if(d instanceof ji)throw a(m=>({...m,display:"error",sender:"ready"})),tn&&(tn.abort(),tn=null),fn=null,Kt=null,d};return{updateUserFilesMessage:({currentFiles:d})=>{r(m=>{if(!m[0])return m;const y=m[0],F=y.messages||[];if(!F.length)return m;const _=F.length-2;if(_<0||F[_].istype!=="user")return m;const A=F.slice();return A[_]={...F[_],currentFiles:d},[{...y,messages:A},...m.slice(1)]})},api_startChat_re:(d,m)=>{tn&&tn.abort(),tn=new AbortController,fn=d.sessionId,Kt=d.queryId,Me=[],qn=void 0,Un=void 0,zi=new Map;const y=`${n}/qa/ai/question_re`;console.log("data",d);const F={...d};$c(y,{method:"post",signal:tn.signal,headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:t||"","X-CSRF-TOKEN-IN":e||""},openWhenHidden:!0,body:JSON.stringify(F),onopen:async _=>{if(_.status===500)throw new ji("Internal Server Error");if(!_.ok)throw new ji(`HTTP error: ${_.status}`)},onmessage:_=>{var j,X,Z,he;const S=JSON.parse(_.data);if(fn!==S.sessionId){console.log("[AichatUseController] \u6D41\u5F0F\u8BF7\u6C42\u7684 sessionId \u5DF2\u4E0D\u5339\u914D\uFF0C\u5FFD\u7565\u6570\u636E",{currentStreamSessionId:fn,receivedSessionId:S.sessionId,activeSessionId:i});return}if(i!==S.sessionId)return;const{reply:A,resultType:T,respTime:E,reference:w,webReference:g,graphReference:O,knowledgeBases:D,filePaths:R,status:P,docs:W,llmType:U,databaseReference:q,businessType:z,nodeStatus:J,enableCot:H,chainRespTime:K,faqReference:B}=S;if(P===4&&z){J===2&&typeof K=="number"&&K>0&&zi.set(z,K);const ee=J===2&&typeof K=="number"&&K>0?K:void 0;Me=bc(Me,{businessType:z,nodeStatus:J,reply:A,respTime:ee,chainRespTime:ee}),console.log("[AichatUseController] status=4 \u805A\u5408\u601D\u7EF4\u94FE\u6570\u636E:",{businessType:z,nodeStatus:J,content:(j=A==null?void 0:A.content)==null?void 0:j.substring(0,50),currentThoughtNodesCount:Me.length,chainRespTime:J===2?K:void 0})}else P===1&&z&&console.log("[AichatUseController] status=1 \u8DF3\u8FC7\u601D\u7EF4\u94FE\u805A\u5408:",{businessType:z,content:(X=A==null?void 0:A.content)==null?void 0:X.substring(0,50),note:"status=1 \u7684\u5185\u5BB9\u5E94\u8BE5\u53BB\u6B63\u6587\uFF0C\u4E0D\u662F\u601D\u7EF4\u94FE"});if(typeof H=="number"&&(qn=H),P===1||P===2){const ee=Array.from(zi.values()).reduce((ne,Ee)=>ne+Ee,0);ee>0&&(Un=ee)}const V=R?JSON.parse(R):[];P===2&&A&&A.content&&(A.content.includes("\u6A21\u578B\u6682\u65E0\u6CD5\u8FD4\u56DE")||A.content.includes("\u5931\u8D25")||A.content.includes("\u9519\u8BEF")||A.content.includes("\u8BF7\u7A0D\u540E\u518D\u8BD5"))&&a(ee=>({...ee,display:"ready",sender:"ready"}));const M=s(O)?O:void 0;if(P===2&&console.log("[AichatUseController] status=2 \u65F6\u7684 graphReference:",{graphReference:O,type:typeof O,isValid:s(O),finalGraphReference:M}),P===4){const ee=Me.length>0?Me.map(ne=>({businessType:ne.businessType,nodeStatus:ne.nodeStatus,content:ne.content})):void 0;console.log("[AichatUseController] status=4 \u66F4\u65B0\u601D\u7EF4\u94FE:",{businessType:z,chainLength:(ee==null?void 0:ee.length)||0,replyContentLength:((Z=A==null?void 0:A.content)==null?void 0:Z.length)||0,note:"status=4 \u65F6\uFF0Creply.content \u5E94\u8BE5\u805A\u5408\u5230\u601D\u7EF4\u94FE\uFF0C\u4E0D\u66F4\u65B0\u6B63\u6587"}),l({content:"",status:P,respTime:E,filePaths:V,reference:w||W||"",webReference:g||"",knowledgeBases:D||"",graphReference:M,databaseReference:q,llmType:U,resultType:T,queryId:S.queryId,tokens:S.tokens,chain:ee,thoughtChainNodes:Me.length>0?[...Me]:void 0,enableCot:qn,chainRespTime:Un,faqReference:B})}else if(P===1){Me.length>0&&(Me=Me.map(ne=>({...ne,nodeStatus:2}))),console.log("[AichatUseController] status=1 \u66F4\u65B0\u6B63\u6587:",{businessType:z,content:(he=A==null?void 0:A.content)==null?void 0:he.substring(0,50),thoughtNodesCount:Me.length,note:"status=1 \u65F6\uFF0Creply.content \u5E94\u8BE5\u53BB\u6B63\u6587\uFF0C\u601D\u7EF4\u94FE\u8282\u70B9\u72B6\u6001\u66F4\u65B0\u4E3A\u5B8C\u6210"});const ee=Me.length>0?Me.map(ne=>({businessType:ne.businessType,nodeStatus:ne.nodeStatus,content:ne.content})):void 0;l({content:A.content||"",status:P,respTime:E,filePaths:V,reference:w||W||"",webReference:g||"",graphReference:M,knowledgeBases:D||"",databaseReference:q??null,llmType:U,resultType:T,queryId:S.queryId,tokens:S.tokens,chain:ee??void 0,thoughtChainNodes:Me.length>0?[...Me]:void 0,enableCot:qn,chainRespTime:Un,faqReference:B})}else if(P===2){Me.length>0&&(Me=Me.map(ne=>({...ne,nodeStatus:2})));const ee=Me.length>0?Me.map(ne=>({businessType:ne.businessType,nodeStatus:ne.nodeStatus,content:ne.content})):void 0;if(l({content:A.content||"",status:2,respTime:E,filePaths:V,reference:w||W||"",webReference:g||"",knowledgeBases:D||"",graphReference:M,databaseReference:q,llmType:U,resultType:T,queryId:S.queryId,tokens:S.tokens,chain:ee,thoughtChainNodes:Me.length>0?[...Me]:void 0,enableCot:qn,chainRespTime:Un,faqReference:B}),Me=[],a(ne=>({...ne,display:"ready",sender:"ready"})),m){const ne=E||Date.now();console.log("[AichatUseController] \u6D88\u606F\u53D1\u9001\u6210\u529F\uFF0CgmtModified:",ne),m(ne)}}else{const ee=Me.length>0?Me.map(ne=>({businessType:ne.businessType,nodeStatus:ne.nodeStatus,content:ne.content,respTime:ne.respTime,chainRespTime:ne.respTime})):void 0;l({content:A.content||"",status:P,respTime:E,filePaths:V,reference:w||W||"",knowledgeBases:D||"",webReference:g||"",graphReference:M,databaseReference:q,llmType:U,resultType:T,queryId:S.queryId,tokens:S.tokens,chain:ee,thoughtChainNodes:Me.length>0?[...Me]:void 0,enableCot:qn,chainRespTime:Un})}},onerror:c,onclose:()=>{fn===d.sessionId&&(fn=null,Kt=null)}})},addEmptyMessage:({queryId:d,content:m,filePaths:y,currentFiles:F})=>{r(_=>{const S=new Date().toISOString(),A=d||an(32),T={istype:"user",content:m,time:S,queryId:A,clientSideId:A+"-user",filePaths:y||"",currentFiles:F||[]},E={istype:"ai",content:"",time:new Date(Date.now()+1).toISOString(),streaming:!0,status:0,queryId:A,clientSideId:A+"-ai"},w=_.find(g=>g.id===i);return w?w.messages.push(T,E):console.warn("addEmptyMessage called without an active session."),[..._]})},setLastEmptyMessage:({now:d})=>{r(m=>{if(!m[0])return m;const y=m[0],F=y.messages||[];if(!F.length)return m;const _=F.length-1;if(_<0)return m;const S=F[_];if(S.istype!=="ai")return m;const A=F.slice();return A[_]={...S,istype:"ai",content:"",time:d,streaming:!0,status:0},[{...y,messages:A},...m.slice(1)]})},stopStream:async()=>{if(Kt)try{await At.delete(`${n}/qa/ai/abortStream?queryId=${Kt}`,{headers:{Authorization:t||"","X-CSRF-TOKEN-IN":e||""}}),console.log("[AichatUseController] \u5DF2\u8C03\u7528\u540E\u7AEF\u63A5\u53E3\u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42",Kt)}catch(d){console.error("[AichatUseController] \u8C03\u7528\u505C\u6B62\u63A5\u53E3\u5931\u8D25",d)}else console.warn("[AichatUseController] \u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42\u65F6\u672A\u627E\u5230 queryId");tn=null,fn=null,Kt=null,a(d=>({...d,display:"ready",sender:"ready"}))},cancelStreamBySessionId:async d=>{if(tn&&fn===d){if(console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\uFF0C\u53D6\u6D88\u6B63\u5728\u8FDB\u884C\u7684\u6D41\u5F0F\u8BF7\u6C42",d),Kt)try{await At.delete(`${n}/qa/ai/abortStream?queryId=${Kt}`,{headers:{Authorization:t||"","X-CSRF-TOKEN-IN":e||""}}),console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u5DF2\u8C03\u7528\u540E\u7AEF\u63A5\u53E3\u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42",Kt)}catch(m){console.error("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u8C03\u7528\u505C\u6B62\u63A5\u53E3\u5931\u8D25",m)}else console.warn("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u672A\u627E\u5230 queryId");return tn=null,fn=null,Kt=null,a(m=>({...m,display:"ready",sender:"ready"})),!0}return!1}}},bg=1e3,Cg=3e3;function xg({url:n,token:t,CSRFToken:e,onError:r,activeSessionId:i}){const[a,o]=le([]),[s,l]=le(()=>({uploadedFiles:[]})),c=Le(!1),u=async f=>{var d,m;if(!f)return null;try{const y=await At.get(`${n}/index/knowledgeBase/file/getFilesBysessionId?sessionId=${f}`,{headers:{Authorization:t}});console.log("[DEBUG] \u83B7\u53D6\u4E34\u65F6\u6587\u4EF6\u5217\u8868 res:",(d=y==null?void 0:y.data)==null?void 0:d.data),l({uploadedFiles:((m=y==null?void 0:y.data)==null?void 0:m.data)||[]})}catch(y){throw console.error("\u83B7\u53D6\u4E34\u65F6\u6587\u4EF6\u5217\u8868\u5931\u8D25:",y),y}},h=$r((f,d)=>{const m=f.join(",");let y=0,F=null;F=()=>{c.current=!0};const _=async()=>{if(!c.current){if(y>=bg){c.current||d.onFail("\u6587\u4EF6\u89E3\u6790\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");return}y++;try{const S=await At.get(`${n}/index/knowledgeBase/file/getFileStatusByUids?uids=${m}`,{headers:{Authorization:t}});if(c.current)return;if(S.data.success){const A=S.data.data;c.current||d.onStatusUpdate(A),A.every(E=>{const w=E.fileParseStatus??E.status;return w===3||w===4})?c.current||d.onComplete():c.current||setTimeout(_,Cg)}else c.current||d.onFail(S.data.errorMsg||"\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u5931\u8D25")}catch(S){if(r==null||r(S),c.current)return;d.onFail("\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u65F6\u53D1\u751F\u7F51\u7EDC\u9519\u8BEF")}}};return _(),F},[n,t,r]),p=$r(async(f,d)=>{if(!f){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6");return}Bc({url:n,token:t,CSRFToken:e},{uid:f,queryId:d},(m,y)=>{m?(yt.success("\u6587\u4EF6\u5DF2\u4ECE\u4E34\u65F6\u77E5\u8BC6\u5E93\u79FB\u9664"),u(i)):(console.log("[DEBUG] removeFilefromTempUpload \u56DE\u8C03 false\uFF0Cres:",y),yt.error("\u6587\u4EF6\u79FB\u9664\u5931\u8D25"))})},[n,t,e,i]),b=$r(()=>{c.current=!1},[]),v=$r(()=>{c.current=!0},[]);return{fileManagerData:s,fileStatuses:a,setFileManagerData:l,setFileStatuses:o,pollFileStatus:h,handleRemoveFromTemp:p,resetStopFlag:b,setStopFlag:v,stoppedRef:c,getTempFileList:u}}function wg({title:n,subtitle:t}){const[e,r]=le(0);return _e(()=>{let i;return e<98?i=setTimeout(()=>{r(a=>a+Math.random()*6+1)},80):e<100&&(i=setTimeout(()=>r(100),400)),()=>clearTimeout(i)},[e]),te("div",{className:"flex flex-col justify-center items-center min-h-screen bg-gradient-to-br from-[#EEF4FF] via-white to-[#F5F8FF]",children:[te("div",{className:"mb-8 flex flex-col items-center",children:[k("div",{className:"mt-6 text-2xl font-semibold text-[#222222] tracking-wide",children:n||"\u5C0F\u9CB8\u667A\u80FD\u4F1A\u8BDD\u52A9\u624B"}),k("div",{className:"mt-2 text-sm text-[#555555]",children:t||"\u8BA9\u667A\u80FD\u5BF9\u8BDD\u66F4\u7B80\u5355"})]}),te("div",{className:"relative w-80 max-w-sm",children:[k("div",{className:"w-full h-2 bg-[#EEF4FF] rounded-full overflow-hidden shadow-inner",children:k("div",{className:"h-full bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] transition-all duration-300 ease-out",style:{width:`${Math.min(e,100)}%`}})}),te("div",{className:"absolute -right-2 top-5 text-sm text-[#555555]",children:[Math.min(Math.round(e),100),"%"]})]}),te("div",{className:"mt-8 flex flex-col items-center gap-2",children:[k("div",{className:"text-sm text-[#555555] animate-pulse",children:"\u6B63\u5728\u521D\u59CB\u5316\u5E94\u7528"}),k("div",{className:"text-xs text-[#888888]",children:"\u9996\u6B21\u52A0\u8F7D\u53EF\u80FD\u9700\u8981\u4E00\u4E9B\u65F6\u95F4\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85"})]})]})}const Wl=document.createElement("style");Wl.textContent=`
249
+ .animate-bounce-slow {
250
+ animation: bounce 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
251
+ }
252
+ @keyframes bounce {
253
+ 0%, 100% { transform: translateY(0); }
254
+ 50% { transform: translateY(-12px); }
255
+ }
256
+ `;document.head.appendChild(Wl);function Fg(){return te("div",{className:"flex flex-col gap-8 p-4 w-full mx-auto",children:[te("div",{className:"flex items-start gap-4",children:[k("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),k("div",{className:"flex-1",children:k(Br,{active:!0,paragraph:{rows:1}})})]}),te("div",{className:"flex items-start gap-4",children:[k("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),k("div",{className:"flex-1",children:k(Br,{active:!0,paragraph:{rows:3}})})]}),te("div",{className:"flex items-start gap-4",children:[k("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),k("div",{className:"flex-1",children:k(Br,{active:!0,paragraph:{rows:1}})})]}),te("div",{className:"flex items-start gap-4",children:[k("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),k("div",{className:"flex-1",children:k(Br,{active:!0,paragraph:{rows:2}})})]})]})}function Sg({msg:n,subMsg:t}){return te("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-white/80 backdrop-blur-sm",children:[k("div",{className:"mb-6 animate-bounce",children:k(fu,{size:64,className:"text-[#d70016]"})}),k("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:n||"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25"}),k("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"}),k(tr,{type:"primary",icon:k(Ps,{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 Eg(){return te("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-transparent! backdrop-blur-sm",children:[k("div",{className:"mb-6 animate-bounce",children:k(Vc,{size:64,className:"text-[#d70016]"})}),k("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:"\u62B1\u6B49\uFF0C\u9047\u5230\u4E86\u4E00\u4E9B\u95EE\u9898"}),k("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:"\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"}),k(tr,{type:"primary",icon:k(Ps,{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 wa(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=[];return ye.Children.forEach(n,function(r){r==null&&!t.keepEmpty||(Array.isArray(r)?e=e.concat(wa(r)):ml(r)&&r.props?e=e.concat(wa(r.props.children,t)):e.push(r))}),e}var On="RC_FORM_INTERNAL_HOOKS",Ne=function(){pn(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},ir=I.createContext({getFieldValue:Ne,getFieldsValue:Ne,getFieldError:Ne,getFieldWarning:Ne,getFieldsError:Ne,isFieldsTouched:Ne,isFieldTouched:Ne,isFieldValidating:Ne,isFieldsValidating:Ne,resetFields:Ne,setFields:Ne,setFieldValue:Ne,setFieldsValue:Ne,validateFields:Ne,submit:Ne,getInternalHooks:function(){return Ne(),{dispatch:Ne,initEntityValue:Ne,registerField:Ne,useSubscribe:Ne,setInitialValues:Ne,destroyForm:Ne,setCallbacks:Ne,registerWatch:Ne,getFields:Ne,setValidateMessages:Ne,setPreserve:Ne,getInitialValue:Ne}}}),ui=I.createContext(null);function Fa(n){return n==null?[]:Array.isArray(n)?n:[n]}function Ag(n){return n&&!!n._init}function Sa(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var Ea=Sa();function _g(n){try{return Function.toString.call(n).indexOf("[native code]")!==-1}catch{return typeof n=="function"}}function kg(n,t,e){if(Fs())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(n.bind.apply(n,r));return e&&Ra(i,e.prototype),i}function Aa(n){var t=typeof Map=="function"?new Map:void 0;return Aa=function(r){if(r===null||!_g(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return kg(r,arguments,Gi(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ra(i,r)},Aa(n)}var Ig=/%[sdj%]/g,Tg=function(){};function _a(n){if(!n||!n.length)return null;var t={};return n.forEach(function(e){var r=e.field;t[r]=t[r]||[],t[r].push(e)}),t}function Dt(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];var i=0,a=e.length;if(typeof n=="function")return n.apply(null,e);if(typeof n=="string"){var o=n.replace(Ig,function(s){if(s==="%%")return"%";if(i>=a)return s;switch(s){case"%s":return String(e[i++]);case"%d":return Number(e[i++]);case"%j":try{return JSON.stringify(e[i++])}catch{return"[Circular]"}break;default:return s}});return o}return n}function Pg(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}function dt(n,t){return!!(n==null||t==="array"&&Array.isArray(n)&&!n.length||Pg(t)&&typeof n=="string"&&!n)}function Dg(n,t,e){var r=[],i=0,a=n.length;function o(s){r.push.apply(r,ce(s||[])),i++,i===a&&e(r)}n.forEach(function(s){t(s,o)})}function rs(n,t,e){var r=0,i=n.length;function a(o){if(o&&o.length){e(o);return}var s=r;r=r+1,s<i?t(n[s],a):e([])}a([])}function Og(n){var t=[];return Object.keys(n).forEach(function(e){t.push.apply(t,ce(n[e]||[]))}),t}var is=(function(n){ar(e,n);var t=cr(e);function e(r,i){var a;return St(this,e),a=t.call(this,"Async Validation Error"),N(Ce(a),"errors",void 0),N(Ce(a),"fields",void 0),a.errors=r,a.fields=i,a}return Ft(e)})(Aa(Error));function Rg(n,t,e,r,i){if(t.first){var a=new Promise(function(p,b){var v=function(m){return r(m),m.length?b(new is(m,_a(m))):p(i)},f=Og(n);rs(f,e,v)});return a.catch(function(p){return p}),a}var o=t.firstFields===!0?Object.keys(n):t.firstFields||[],s=Object.keys(n),l=s.length,c=0,u=[],h=new Promise(function(p,b){var v=function(d){if(u.push.apply(u,d),c++,c===l)return r(u),u.length?b(new is(u,_a(u))):p(i)};s.length||(r(u),p(i)),s.forEach(function(f){var d=n[f];o.indexOf(f)!==-1?rs(d,e,v):Dg(d,e,v)})});return h.catch(function(p){return p}),h}function Mg(n){return!!(n&&n.message!==void 0)}function Ng(n,t){for(var e=n,r=0;r<t.length;r++){if(e==null)return e;e=e[t[r]]}return e}function as(n,t){return function(e){var r;return n.fullFields?r=Ng(t,n.fullFields):r=t[e.field||n.fullField],Mg(e)?(e.field=e.field||n.fullField,e.fieldValue=r,e):{message:typeof e=="function"?e():e,fieldValue:r,field:e.field||n.fullField}}}function os(n,t){if(t){for(var e in t)if(t.hasOwnProperty(e)){var r=t[e];Fe(r)==="object"&&Fe(n[e])==="object"?n[e]=G(G({},n[e]),r):n[e]=r}}return n}var Hn="enum",Lg=function(t,e,r,i,a){t[Hn]=Array.isArray(t[Hn])?t[Hn]:[],t[Hn].indexOf(e)===-1&&i.push(Dt(a.messages[Hn],t.fullField,t[Hn].join(", ")))},$g=function(t,e,r,i,a){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(e)||i.push(Dt(a.messages.pattern.mismatch,t.fullField,e,t.pattern));else if(typeof t.pattern=="string"){var o=new RegExp(t.pattern);o.test(e)||i.push(Dt(a.messages.pattern.mismatch,t.fullField,e,t.pattern))}}},Bg=function(t,e,r,i,a){var o=typeof t.len=="number",s=typeof t.min=="number",l=typeof t.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=e,h=null,p=typeof e=="number",b=typeof e=="string",v=Array.isArray(e);if(p?h="number":b?h="string":v&&(h="array"),!h)return!1;v&&(u=e.length),b&&(u=e.replace(c,"_").length),o?u!==t.len&&i.push(Dt(a.messages[h].len,t.fullField,t.len)):s&&!l&&u<t.min?i.push(Dt(a.messages[h].min,t.fullField,t.min)):l&&!s&&u>t.max?i.push(Dt(a.messages[h].max,t.fullField,t.max)):s&&l&&(u<t.min||u>t.max)&&i.push(Dt(a.messages[h].range,t.fullField,t.min,t.max))},Gl=function(t,e,r,i,a,o){t.required&&(!r.hasOwnProperty(t.field)||dt(e,o||t.type))&&i.push(Dt(a.messages.required,t.fullField))},Gr;const Vg=(function(){if(Gr)return Gr;var n="[a-fA-F\\d:]",t=function(A){return A&&A.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(n,")|(?<=").concat(n,")(?=\\s|$))"):""},e="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(e,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(e,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(e,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(e,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(e,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(e,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(e,"|(?::").concat(r,"){1,7}|:))")],a="(?:%[0-9a-zA-Z]{1,})?",o="(?:".concat(i.join("|"),")").concat(a),s=new RegExp("(?:^".concat(e,"$)|(?:^").concat(o,"$)")),l=new RegExp("^".concat(e,"$")),c=new RegExp("^".concat(o,"$")),u=function(A){return A&&A.exact?s:new RegExp("(?:".concat(t(A)).concat(e).concat(t(A),")|(?:").concat(t(A)).concat(o).concat(t(A),")"),"g")};u.v4=function(S){return S&&S.exact?l:new RegExp("".concat(t(S)).concat(e).concat(t(S)),"g")},u.v6=function(S){return S&&S.exact?c:new RegExp("".concat(t(S)).concat(o).concat(t(S)),"g")};var h="(?:(?:[a-z]+:)?//)",p="(?:\\S+(?::\\S*)?@)?",b=u.v4().source,v=u.v6().source,f="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",d="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",m="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",y="(?::\\d{2,5})?",F='(?:[/?#][^\\s"]*)?',_="(?:".concat(h,"|www\\.)").concat(p,"(?:localhost|").concat(b,"|").concat(v,"|").concat(f).concat(d).concat(m,")").concat(y).concat(F);return Gr=new RegExp("(?:^".concat(_,"$)"),"i"),Gr});var ss={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},br={integer:function(t){return br.number(t)&&parseInt(t,10)===t},float:function(t){return br.number(t)&&!br.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return Fe(t)==="object"&&!br.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(ss.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(Vg())},hex:function(t){return typeof t=="string"&&!!t.match(ss.hex)}},jg=function(t,e,r,i,a){if(t.required&&e===void 0){Gl(t,e,r,i,a);return}var o=["integer","float","array","regexp","object","method","email","number","date","url","hex"],s=t.type;o.indexOf(s)>-1?br[s](e)||i.push(Dt(a.messages.types[s],t.fullField,t.type)):s&&Fe(e)!==t.type&&i.push(Dt(a.messages.types[s],t.fullField,t.type))},zg=function(t,e,r,i,a){(/^\s+$/.test(e)||e==="")&&i.push(Dt(a.messages.whitespace,t.fullField))};const we={required:Gl,whitespace:zg,type:jg,range:Bg,enum:Lg,pattern:$g};var qg=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(dt(e)&&!t.required)return r();we.required(t,e,i,o,a)}r(o)},Ug=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(e==null&&!t.required)return r();we.required(t,e,i,o,a,"array"),e!=null&&(we.type(t,e,i,o,a),we.range(t,e,i,o,a))}r(o)},Hg=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(dt(e)&&!t.required)return r();we.required(t,e,i,o,a),e!==void 0&&we.type(t,e,i,o,a)}r(o)},Wg=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(dt(e,"date")&&!t.required)return r();if(we.required(t,e,i,o,a),!dt(e,"date")){var l;e instanceof Date?l=e:l=new Date(e),we.type(t,l,i,o,a),l&&we.range(t,l.getTime(),i,o,a)}}r(o)},Gg="enum",Kg=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(dt(e)&&!t.required)return r();we.required(t,e,i,o,a),e!==void 0&&we[Gg](t,e,i,o,a)}r(o)},Xg=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(dt(e)&&!t.required)return r();we.required(t,e,i,o,a),e!==void 0&&(we.type(t,e,i,o,a),we.range(t,e,i,o,a))}r(o)},Jg=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(dt(e)&&!t.required)return r();we.required(t,e,i,o,a),e!==void 0&&(we.type(t,e,i,o,a),we.range(t,e,i,o,a))}r(o)},Yg=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(dt(e)&&!t.required)return r();we.required(t,e,i,o,a),e!==void 0&&we.type(t,e,i,o,a)}r(o)},Qg=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(e===""&&(e=void 0),dt(e)&&!t.required)return r();we.required(t,e,i,o,a),e!==void 0&&(we.type(t,e,i,o,a),we.range(t,e,i,o,a))}r(o)},Zg=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(dt(e)&&!t.required)return r();we.required(t,e,i,o,a),e!==void 0&&we.type(t,e,i,o,a)}r(o)},em=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(dt(e,"string")&&!t.required)return r();we.required(t,e,i,o,a),dt(e,"string")||we.pattern(t,e,i,o,a)}r(o)},tm=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(dt(e)&&!t.required)return r();we.required(t,e,i,o,a),dt(e)||we.type(t,e,i,o,a)}r(o)},nm=function(t,e,r,i,a){var o=[],s=Array.isArray(e)?"array":Fe(e);we.required(t,e,i,o,a,s),r(o)},rm=function(t,e,r,i,a){var o=[],s=t.required||!t.required&&i.hasOwnProperty(t.field);if(s){if(dt(e,"string")&&!t.required)return r();we.required(t,e,i,o,a,"string"),dt(e,"string")||(we.type(t,e,i,o,a),we.range(t,e,i,o,a),we.pattern(t,e,i,o,a),t.whitespace===!0&&we.whitespace(t,e,i,o,a))}r(o)},qi=function(t,e,r,i,a){var o=t.type,s=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(dt(e,o)&&!t.required)return r();we.required(t,e,i,s,a,o),dt(e,o)||we.type(t,e,i,s,a)}r(s)};const xr={string:rm,method:Yg,number:Qg,boolean:Hg,regexp:tm,integer:Jg,float:Xg,array:Ug,object:Zg,enum:Kg,pattern:em,date:Wg,url:qi,hex:qi,email:qi,required:nm,any:qg};var Or=(function(){function n(t){St(this,n),N(this,"rules",null),N(this,"_messages",Ea),this.define(t)}return Ft(n,[{key:"define",value:function(e){var r=this;if(!e)throw new Error("Cannot configure a schema with no rules");if(Fe(e)!=="object"||Array.isArray(e))throw new Error("Rules must be an object");this.rules={},Object.keys(e).forEach(function(i){var a=e[i];r.rules[i]=Array.isArray(a)?a:[a]})}},{key:"messages",value:function(e){return e&&(this._messages=os(Sa(),e)),this._messages}},{key:"validate",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},o=e,s=i,l=a;if(typeof s=="function"&&(l=s,s={}),!this.rules||Object.keys(this.rules).length===0)return l&&l(null,o),Promise.resolve(o);function c(v){var f=[],d={};function m(F){if(Array.isArray(F)){var _;f=(_=f).concat.apply(_,ce(F))}else f.push(F)}for(var y=0;y<v.length;y++)m(v[y]);f.length?(d=_a(f),l(f,d)):l(null,o)}if(s.messages){var u=this.messages();u===Ea&&(u=Sa()),os(u,s.messages),s.messages=u}else s.messages=this.messages();var h={},p=s.keys||Object.keys(this.rules);p.forEach(function(v){var f=r.rules[v],d=o[v];f.forEach(function(m){var y=m;typeof y.transform=="function"&&(o===e&&(o=G({},o)),d=o[v]=y.transform(d),d!=null&&(y.type=y.type||(Array.isArray(d)?"array":Fe(d)))),typeof y=="function"?y={validator:y}:y=G({},y),y.validator=r.getValidationMethod(y),y.validator&&(y.field=v,y.fullField=y.fullField||v,y.type=r.getType(y),h[v]=h[v]||[],h[v].push({rule:y,value:d,source:o,field:v}))})});var b={};return Rg(h,s,function(v,f){var d=v.rule,m=(d.type==="object"||d.type==="array")&&(Fe(d.fields)==="object"||Fe(d.defaultField)==="object");m=m&&(d.required||!d.required&&v.value),d.field=v.field;function y(T,E){return G(G({},E),{},{fullField:"".concat(d.fullField,".").concat(T),fullFields:d.fullFields?[].concat(ce(d.fullFields),[T]):[T]})}function F(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],E=Array.isArray(T)?T:[T];!s.suppressWarning&&E.length&&n.warning("async-validator:",E),E.length&&d.message!==void 0&&(E=[].concat(d.message));var w=E.map(as(d,o));if(s.first&&w.length)return b[d.field]=1,f(w);if(!m)f(w);else{if(d.required&&!v.value)return d.message!==void 0?w=[].concat(d.message).map(as(d,o)):s.error&&(w=[s.error(d,Dt(s.messages.required,d.field))]),f(w);var g={};d.defaultField&&Object.keys(v.value).map(function(R){g[R]=d.defaultField}),g=G(G({},g),v.rule.fields);var O={};Object.keys(g).forEach(function(R){var P=g[R],W=Array.isArray(P)?P:[P];O[R]=W.map(y.bind(null,R))});var D=new n(O);D.messages(s.messages),v.rule.options&&(v.rule.options.messages=s.messages,v.rule.options.error=s.error),D.validate(v.value,v.rule.options||s,function(R){var P=[];w&&w.length&&P.push.apply(P,ce(w)),R&&R.length&&P.push.apply(P,ce(R)),f(P.length?P:null)})}}var _;if(d.asyncValidator)_=d.asyncValidator(d,v.value,F,v.source,s);else if(d.validator){try{_=d.validator(d,v.value,F,v.source,s)}catch(T){var S,A;(S=(A=console).error)===null||S===void 0||S.call(A,T),s.suppressValidatorError||setTimeout(function(){throw T},0),F(T.message)}_===!0?F():_===!1?F(typeof d.message=="function"?d.message(d.fullField||d.field):d.message||"".concat(d.fullField||d.field," fails")):_ instanceof Array?F(_):_ instanceof Error&&F(_.message)}_&&_.then&&_.then(function(){return F()},function(T){return F(T)})},function(v){c(v)},o)}},{key:"getType",value:function(e){if(e.type===void 0&&e.pattern instanceof RegExp&&(e.type="pattern"),typeof e.validator!="function"&&e.type&&!xr.hasOwnProperty(e.type))throw new Error(Dt("Unknown rule type %s",e.type));return e.type||"string"}},{key:"getValidationMethod",value:function(e){if(typeof e.validator=="function")return e.validator;var r=Object.keys(e),i=r.indexOf("message");return i!==-1&&r.splice(i,1),r.length===1&&r[0]==="required"?xr.required:xr[this.getType(e)]||void 0}}]),n})();N(Or,"register",function(t,e){if(typeof e!="function")throw new Error("Cannot register a validator by type, validator is not a function");xr[t]=e});N(Or,"warning",Tg);N(Or,"messages",Ea);N(Or,"validators",xr);var Pt="'${name}' is not a valid ${type}",Kl={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:Pt,method:Pt,array:Pt,object:Pt,number:Pt,date:Pt,boolean:Pt,integer:Pt,float:Pt,regexp:Pt,email:Pt,url:Pt,hex:Pt},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},ls=Or;function im(n,t){return n.replace(/\\?\$\{\w+\}/g,function(e){if(e.startsWith("\\"))return e.slice(1);var r=e.slice(2,-1);return t[r]})}var cs="CODE_LOGIC_ERROR";function ka(n,t,e,r,i){return Ia.apply(this,arguments)}function Ia(){return Ia=Mn(_t().mark(function n(t,e,r,i,a){var o,s,l,c,u,h,p,b,v;return _t().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return o=G({},r),delete o.ruleIndex,ls.warning=function(){},o.validator&&(s=o.validator,o.validator=function(){try{return s.apply(void 0,arguments)}catch(m){return console.error(m),Promise.reject(cs)}}),l=null,o&&o.type==="array"&&o.defaultField&&(l=o.defaultField,delete o.defaultField),c=new ls(N({},t,[o])),u=Kn(Kl,i.validateMessages),c.messages(u),h=[],d.prev=10,d.next=13,Promise.resolve(c.validate(N({},t,e),G({},i)));case 13:d.next=18;break;case 15:d.prev=15,d.t0=d.catch(10),d.t0.errors&&(h=d.t0.errors.map(function(m,y){var F=m.message,_=F===cs?u.default:F;return I.isValidElement(_)?I.cloneElement(_,{key:"error_".concat(y)}):_}));case 18:if(!(!h.length&&l&&Array.isArray(e)&&e.length>0)){d.next=23;break}return d.next=21,Promise.all(e.map(function(m,y){return ka("".concat(t,".").concat(y),m,l,i,a)}));case 21:return p=d.sent,d.abrupt("return",p.reduce(function(m,y){return[].concat(ce(m),ce(y))},[]));case 23:return b=G(G({},r),{},{name:t,enum:(r.enum||[]).join(", ")},a),v=h.map(function(m){return typeof m=="string"?im(m,b):m}),d.abrupt("return",v);case 26:case"end":return d.stop()}},n,null,[[10,15]])})),Ia.apply(this,arguments)}function am(n,t,e,r,i,a){var o=n.join("."),s=e.map(function(u,h){var p=u.validator,b=G(G({},u),{},{ruleIndex:h});return p&&(b.validator=function(v,f,d){var m=!1,y=function(){for(var S=arguments.length,A=new Array(S),T=0;T<S;T++)A[T]=arguments[T];Promise.resolve().then(function(){pn(!m,"Your validator function has already return a promise. `callback` will be ignored."),m||d.apply(void 0,A)})},F=p(v,f,y);m=F&&typeof F.then=="function"&&typeof F.catch=="function",pn(m,"`callback` is deprecated. Please return a promise instead."),m&&F.then(function(){d()}).catch(function(_){d(_||" ")})}),b}).sort(function(u,h){var p=u.warningOnly,b=u.ruleIndex,v=h.warningOnly,f=h.ruleIndex;return!!p==!!v?b-f:p?1:-1}),l;if(i===!0)l=new Promise((function(){var u=Mn(_t().mark(function h(p,b){var v,f,d;return _t().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:v=0;case 1:if(!(v<s.length)){y.next=12;break}return f=s[v],y.next=5,ka(o,t,f,r,a);case 5:if(d=y.sent,!d.length){y.next=9;break}return b([{errors:d,rule:f}]),y.abrupt("return");case 9:v+=1,y.next=1;break;case 12:p([]);case 13:case"end":return y.stop()}},h)}));return function(h,p){return u.apply(this,arguments)}})());else{var c=s.map(function(u){return ka(o,t,u,r,a).then(function(h){return{errors:h,rule:u}})});l=(i?sm(c):om(c)).then(function(u){return Promise.reject(u)})}return l.catch(function(u){return u}),l}function om(n){return Ta.apply(this,arguments)}function Ta(){return Ta=Mn(_t().mark(function n(t){return _t().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.all(t).then(function(i){var a,o=(a=[]).concat.apply(a,ce(i));return o}));case 1:case"end":return r.stop()}},n)})),Ta.apply(this,arguments)}function sm(n){return Pa.apply(this,arguments)}function Pa(){return Pa=Mn(_t().mark(function n(t){var e;return _t().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return e=0,i.abrupt("return",new Promise(function(a){t.forEach(function(o){o.then(function(s){s.errors.length&&a([s]),e+=1,e===t.length&&a([])})})}));case 2:case"end":return i.stop()}},n)})),Pa.apply(this,arguments)}function it(n){return Fa(n)}function us(n,t){var e={};return t.forEach(function(r){var i=rn(n,r);e=Xt(e,r,i)}),e}function er(n,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return n&&n.some(function(r){return Xl(t,r,e)})}function Xl(n,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!n||!t||!e&&n.length!==t.length?!1:t.every(function(r,i){return n[i]===r})}function lm(n,t){if(n===t)return!0;if(!n&&t||n&&!t||!n||!t||Fe(n)!=="object"||Fe(t)!=="object")return!1;var e=Object.keys(n),r=Object.keys(t),i=new Set([].concat(e,r));return ce(i).every(function(a){var o=n[a],s=t[a];return typeof o=="function"&&typeof s=="function"?!0:o===s})}function cm(n){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&Fe(t.target)==="object"&&n in t.target?t.target[n]:t}function ds(n,t,e){var r=n.length;if(t<0||t>=r||e<0||e>=r)return n;var i=n[t],a=t-e;return a>0?[].concat(ce(n.slice(0,e)),[i],ce(n.slice(e,t)),ce(n.slice(t+1,r))):a<0?[].concat(ce(n.slice(0,t)),ce(n.slice(t+1,e+1)),[i],ce(n.slice(e+1,r))):n}var um=["name"],Bt=[];function Ui(n,t,e,r,i,a){return typeof n=="function"?n(t,e,"source"in a?{source:a.source}:{}):r!==i}var Ka=(function(n){ar(e,n);var t=cr(e);function e(r){var i;if(St(this,e),i=t.call(this,r),N(Ce(i),"state",{resetCount:0}),N(Ce(i),"cancelRegisterFunc",null),N(Ce(i),"mounted",!1),N(Ce(i),"touched",!1),N(Ce(i),"dirty",!1),N(Ce(i),"validatePromise",void 0),N(Ce(i),"prevValidating",void 0),N(Ce(i),"errors",Bt),N(Ce(i),"warnings",Bt),N(Ce(i),"cancelRegister",function(){var l=i.props,c=l.preserve,u=l.isListField,h=l.name;i.cancelRegisterFunc&&i.cancelRegisterFunc(u,c,it(h)),i.cancelRegisterFunc=null}),N(Ce(i),"getNamePath",function(){var l=i.props,c=l.name,u=l.fieldContext,h=u.prefixName,p=h===void 0?[]:h;return c!==void 0?[].concat(ce(p),ce(c)):[]}),N(Ce(i),"getRules",function(){var l=i.props,c=l.rules,u=c===void 0?[]:c,h=l.fieldContext;return u.map(function(p){return typeof p=="function"?p(h):p})}),N(Ce(i),"refresh",function(){i.mounted&&i.setState(function(l){var c=l.resetCount;return{resetCount:c+1}})}),N(Ce(i),"metaCache",null),N(Ce(i),"triggerMetaEvent",function(l){var c=i.props.onMetaChange;if(c){var u=G(G({},i.getMeta()),{},{destroy:l});ra(i.metaCache,u)||c(u),i.metaCache=u}else i.metaCache=null}),N(Ce(i),"onStoreChange",function(l,c,u){var h=i.props,p=h.shouldUpdate,b=h.dependencies,v=b===void 0?[]:b,f=h.onReset,d=u.store,m=i.getNamePath(),y=i.getValue(l),F=i.getValue(d),_=c&&er(c,m);switch(u.type==="valueUpdate"&&u.source==="external"&&!ra(y,F)&&(i.touched=!0,i.dirty=!0,i.validatePromise=null,i.errors=Bt,i.warnings=Bt,i.triggerMetaEvent()),u.type){case"reset":if(!c||_){i.touched=!1,i.dirty=!1,i.validatePromise=void 0,i.errors=Bt,i.warnings=Bt,i.triggerMetaEvent(),f==null||f(),i.refresh();return}break;case"remove":{if(p&&Ui(p,l,d,y,F,u)){i.reRender();return}break}case"setField":{var S=u.data;if(_){"touched"in S&&(i.touched=S.touched),"validating"in S&&!("originRCField"in S)&&(i.validatePromise=S.validating?Promise.resolve([]):null),"errors"in S&&(i.errors=S.errors||Bt),"warnings"in S&&(i.warnings=S.warnings||Bt),i.dirty=!0,i.triggerMetaEvent(),i.reRender();return}else if("value"in S&&er(c,m,!0)){i.reRender();return}if(p&&!m.length&&Ui(p,l,d,y,F,u)){i.reRender();return}break}case"dependenciesUpdate":{var A=v.map(it);if(A.some(function(T){return er(u.relatedFields,T)})){i.reRender();return}break}default:if(_||(!v.length||m.length||p)&&Ui(p,l,d,y,F,u)){i.reRender();return}break}p===!0&&i.reRender()}),N(Ce(i),"validateRules",function(l){var c=i.getNamePath(),u=i.getValue(),h=l||{},p=h.triggerName,b=h.validateOnly,v=b===void 0?!1:b,f=Promise.resolve().then(Mn(_t().mark(function d(){var m,y,F,_,S,A,T;return _t().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(i.mounted){w.next=2;break}return w.abrupt("return",[]);case 2:if(m=i.props,y=m.validateFirst,F=y===void 0?!1:y,_=m.messageVariables,S=m.validateDebounce,A=i.getRules(),p&&(A=A.filter(function(g){return g}).filter(function(g){var O=g.validateTrigger;if(!O)return!0;var D=Fa(O);return D.includes(p)})),!(S&&p)){w.next=10;break}return w.next=8,new Promise(function(g){setTimeout(g,S)});case 8:if(i.validatePromise===f){w.next=10;break}return w.abrupt("return",[]);case 10:return T=am(c,u,A,l,F,_),T.catch(function(g){return g}).then(function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bt;if(i.validatePromise===f){var O;i.validatePromise=null;var D=[],R=[];(O=g.forEach)===null||O===void 0||O.call(g,function(P){var W=P.rule.warningOnly,U=P.errors,q=U===void 0?Bt:U;W?R.push.apply(R,ce(q)):D.push.apply(D,ce(q))}),i.errors=D,i.warnings=R,i.triggerMetaEvent(),i.reRender()}}),w.abrupt("return",T);case 13:case"end":return w.stop()}},d)})));return v||(i.validatePromise=f,i.dirty=!0,i.errors=Bt,i.warnings=Bt,i.triggerMetaEvent(),i.reRender()),f}),N(Ce(i),"isFieldValidating",function(){return!!i.validatePromise}),N(Ce(i),"isFieldTouched",function(){return i.touched}),N(Ce(i),"isFieldDirty",function(){if(i.dirty||i.props.initialValue!==void 0)return!0;var l=i.props.fieldContext,c=l.getInternalHooks(On),u=c.getInitialValue;return u(i.getNamePath())!==void 0}),N(Ce(i),"getErrors",function(){return i.errors}),N(Ce(i),"getWarnings",function(){return i.warnings}),N(Ce(i),"isListField",function(){return i.props.isListField}),N(Ce(i),"isList",function(){return i.props.isList}),N(Ce(i),"isPreserve",function(){return i.props.preserve}),N(Ce(i),"getMeta",function(){i.prevValidating=i.isFieldValidating();var l={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath(),validated:i.validatePromise===null};return l}),N(Ce(i),"getOnlyChild",function(l){if(typeof l=="function"){var c=i.getMeta();return G(G({},i.getOnlyChild(l(i.getControlled(),c,i.props.fieldContext))),{},{isFunction:!0})}var u=wa(l);return u.length!==1||!I.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}}),N(Ce(i),"getValue",function(l){var c=i.props.fieldContext.getFieldsValue,u=i.getNamePath();return rn(l||c(!0),u)}),N(Ce(i),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=i.props,u=c.name,h=c.trigger,p=c.validateTrigger,b=c.getValueFromEvent,v=c.normalize,f=c.valuePropName,d=c.getValueProps,m=c.fieldContext,y=p!==void 0?p:m.validateTrigger,F=i.getNamePath(),_=m.getInternalHooks,S=m.getFieldsValue,A=_(On),T=A.dispatch,E=i.getValue(),w=d||function(P){return N({},f,P)},g=l[h],O=u!==void 0?w(E):{},D=G(G({},l),O);D[h]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var P,W=arguments.length,U=new Array(W),q=0;q<W;q++)U[q]=arguments[q];b?P=b.apply(void 0,U):P=cm.apply(void 0,[f].concat(U)),v&&(P=v(P,E,S(!0))),P!==E&&T({type:"updateValue",namePath:F,value:P}),g&&g.apply(void 0,U)};var R=Fa(y||[]);return R.forEach(function(P){var W=D[P];D[P]=function(){W&&W.apply(void 0,arguments);var U=i.props.rules;U&&U.length&&T({type:"validateField",namePath:F,triggerName:P})}}),D}),r.fieldContext){var a=r.fieldContext.getInternalHooks,o=a(On),s=o.initEntityValue;s(Ce(i))}return i}return Ft(e,[{key:"componentDidMount",value:function(){var i=this.props,a=i.shouldUpdate,o=i.fieldContext;if(this.mounted=!0,o){var s=o.getInternalHooks,l=s(On),c=l.registerField;this.cancelRegisterFunc=c(this)}a===!0&&this.reRender()}},{key:"componentWillUnmount",value:function(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}},{key:"reRender",value:function(){this.mounted&&this.forceUpdate()}},{key:"render",value:function(){var i=this.state.resetCount,a=this.props.children,o=this.getOnlyChild(a),s=o.child,l=o.isFunction,c;return l?c=s:I.isValidElement(s)?c=I.cloneElement(s,this.getControlled(s.props)):(pn(!s,"`children` of Field is not validate ReactElement."),c=s),I.createElement(I.Fragment,{key:i},c)}}]),e})(I.Component);N(Ka,"contextType",ir);N(Ka,"defaultProps",{trigger:"onChange",valuePropName:"value"});function Jl(n){var t,e=n.name,r=En(n,um),i=I.useContext(ir),a=I.useContext(ui),o=e!==void 0?it(e):void 0,s=(t=r.isListField)!==null&&t!==void 0?t:!!a,l="keep";return s||(l="_".concat((o||[]).join("_"))),I.createElement(Ka,wt({key:l,name:o,isListField:s},r,{fieldContext:i}))}function dm(n){var t=n.name,e=n.initialValue,r=n.children,i=n.rules,a=n.validateTrigger,o=n.isListField,s=I.useContext(ir),l=I.useContext(ui),c=I.useRef({keys:[],id:0}),u=c.current,h=I.useMemo(function(){var f=it(s.prefixName)||[];return[].concat(ce(f),ce(it(t)))},[s.prefixName,t]),p=I.useMemo(function(){return G(G({},s),{},{prefixName:h})},[s,h]),b=I.useMemo(function(){return{getKey:function(d){var m=h.length,y=d[m];return[u.keys[y],d.slice(m+1)]}}},[h]);if(typeof r!="function")return pn(!1,"Form.List only accepts function as children."),null;var v=function(d,m,y){var F=y.source;return F==="internal"?!1:d!==m};return I.createElement(ui.Provider,{value:b},I.createElement(ir.Provider,{value:p},I.createElement(Jl,{name:[],shouldUpdate:v,rules:i,validateTrigger:a,initialValue:e,isList:!0,isListField:o??!!l},function(f,d){var m=f.value,y=m===void 0?[]:m,F=f.onChange,_=s.getFieldValue,S=function(){var w=_(h||[]);return w||[]},A={add:function(w,g){var O=S();g>=0&&g<=O.length?(u.keys=[].concat(ce(u.keys.slice(0,g)),[u.id],ce(u.keys.slice(g))),F([].concat(ce(O.slice(0,g)),[w],ce(O.slice(g))))):(u.keys=[].concat(ce(u.keys),[u.id]),F([].concat(ce(O),[w]))),u.id+=1},remove:function(w){var g=S(),O=new Set(Array.isArray(w)?w:[w]);O.size<=0||(u.keys=u.keys.filter(function(D,R){return!O.has(R)}),F(g.filter(function(D,R){return!O.has(R)})))},move:function(w,g){if(w!==g){var O=S();w<0||w>=O.length||g<0||g>=O.length||(u.keys=ds(u.keys,w,g),F(ds(O,w,g)))}}},T=y||[];return Array.isArray(T)||(T=[]),r(T.map(function(E,w){var g=u.keys[w];return g===void 0&&(u.keys[w]=u.id,g=u.keys[w],u.id+=1),{name:w,key:g,isListField:!0}}),A,d)})))}function fm(n){var t=!1,e=n.length,r=[];return n.length?new Promise(function(i,a){n.forEach(function(o,s){o.catch(function(l){return t=!0,l}).then(function(l){e-=1,r[s]=l,!(e>0)&&(t&&a(r),i(r))})})}):Promise.resolve([])}var Yl="__@field_split__";function Hi(n){return n.map(function(t){return"".concat(Fe(t),":").concat(t)}).join(Yl)}var Wn=(function(){function n(){St(this,n),N(this,"kvs",new Map)}return Ft(n,[{key:"set",value:function(e,r){this.kvs.set(Hi(e),r)}},{key:"get",value:function(e){return this.kvs.get(Hi(e))}},{key:"update",value:function(e,r){var i=this.get(e),a=r(i);a?this.set(e,a):this.delete(e)}},{key:"delete",value:function(e){this.kvs.delete(Hi(e))}},{key:"map",value:function(e){return ce(this.kvs.entries()).map(function(r){var i=fe(r,2),a=i[0],o=i[1],s=a.split(Yl);return e({key:s.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=fe(c,3),h=u[1],p=u[2];return h==="number"?Number(p):p}),value:o})})}},{key:"toJSON",value:function(){var e={};return this.map(function(r){var i=r.key,a=r.value;return e[i.join(".")]=a,null}),e}}]),n})(),pm=["name"],hm=Ft(function n(t){var e=this;St(this,n),N(this,"formHooked",!1),N(this,"forceRootUpdate",void 0),N(this,"subscribable",!0),N(this,"store",{}),N(this,"fieldEntities",[]),N(this,"initialValues",{}),N(this,"callbacks",{}),N(this,"validateMessages",null),N(this,"preserve",null),N(this,"lastValidatePromise",null),N(this,"getForm",function(){return{getFieldValue:e.getFieldValue,getFieldsValue:e.getFieldsValue,getFieldError:e.getFieldError,getFieldWarning:e.getFieldWarning,getFieldsError:e.getFieldsError,isFieldsTouched:e.isFieldsTouched,isFieldTouched:e.isFieldTouched,isFieldValidating:e.isFieldValidating,isFieldsValidating:e.isFieldsValidating,resetFields:e.resetFields,setFields:e.setFields,setFieldValue:e.setFieldValue,setFieldsValue:e.setFieldsValue,validateFields:e.validateFields,submit:e.submit,_init:!0,getInternalHooks:e.getInternalHooks}}),N(this,"getInternalHooks",function(r){return r===On?(e.formHooked=!0,{dispatch:e.dispatch,initEntityValue:e.initEntityValue,registerField:e.registerField,useSubscribe:e.useSubscribe,setInitialValues:e.setInitialValues,destroyForm:e.destroyForm,setCallbacks:e.setCallbacks,setValidateMessages:e.setValidateMessages,getFields:e.getFields,setPreserve:e.setPreserve,getInitialValue:e.getInitialValue,registerWatch:e.registerWatch}):(pn(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),N(this,"useSubscribe",function(r){e.subscribable=r}),N(this,"prevWithoutPreserves",null),N(this,"setInitialValues",function(r,i){if(e.initialValues=r||{},i){var a,o=Kn(r,e.store);(a=e.prevWithoutPreserves)===null||a===void 0||a.map(function(s){var l=s.key;o=Xt(o,l,rn(r,l))}),e.prevWithoutPreserves=null,e.updateStore(o)}}),N(this,"destroyForm",function(r){if(r)e.updateStore({});else{var i=new Wn;e.getFieldEntities(!0).forEach(function(a){e.isMergedPreserve(a.isPreserve())||i.set(a.getNamePath(),!0)}),e.prevWithoutPreserves=i}}),N(this,"getInitialValue",function(r){var i=rn(e.initialValues,r);return r.length?Kn(i):i}),N(this,"setCallbacks",function(r){e.callbacks=r}),N(this,"setValidateMessages",function(r){e.validateMessages=r}),N(this,"setPreserve",function(r){e.preserve=r}),N(this,"watchList",[]),N(this,"registerWatch",function(r){return e.watchList.push(r),function(){e.watchList=e.watchList.filter(function(i){return i!==r})}}),N(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(e.watchList.length){var i=e.getFieldsValue(),a=e.getFieldsValue(!0);e.watchList.forEach(function(o){o(i,a,r)})}}),N(this,"timeoutId",null),N(this,"warningUnhooked",function(){}),N(this,"updateStore",function(r){e.store=r}),N(this,"getFieldEntities",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?e.fieldEntities.filter(function(i){return i.getNamePath().length}):e.fieldEntities}),N(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new Wn;return e.getFieldEntities(r).forEach(function(a){var o=a.getNamePath();i.set(o,a)}),i}),N(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return e.getFieldEntities(!0);var i=e.getFieldsMap(!0);return r.map(function(a){var o=it(a);return i.get(o)||{INVALIDATE_NAME_PATH:it(a)}})}),N(this,"getFieldsValue",function(r,i){e.warningUnhooked();var a,o,s;if(r===!0||Array.isArray(r)?(a=r,o=i):r&&Fe(r)==="object"&&(s=r.strict,o=r.filter),a===!0&&!o)return e.store;var l=e.getFieldEntitiesForNamePathList(Array.isArray(a)?a:null),c=[];return l.forEach(function(u){var h,p,b="INVALIDATE_NAME_PATH"in u?u.INVALIDATE_NAME_PATH:u.getNamePath();if(s){var v,f;if((v=(f=u).isList)!==null&&v!==void 0&&v.call(f))return}else if(!a&&(h=(p=u).isListField)!==null&&h!==void 0&&h.call(p))return;if(!o)c.push(b);else{var d="getMeta"in u?u.getMeta():null;o(d)&&c.push(b)}}),us(e.store,c.map(it))}),N(this,"getFieldValue",function(r){e.warningUnhooked();var i=it(r);return rn(e.store,i)}),N(this,"getFieldsError",function(r){e.warningUnhooked();var i=e.getFieldEntitiesForNamePathList(r);return i.map(function(a,o){return a&&!("INVALIDATE_NAME_PATH"in a)?{name:a.getNamePath(),errors:a.getErrors(),warnings:a.getWarnings()}:{name:it(r[o]),errors:[],warnings:[]}})}),N(this,"getFieldError",function(r){e.warningUnhooked();var i=it(r),a=e.getFieldsError([i])[0];return a.errors}),N(this,"getFieldWarning",function(r){e.warningUnhooked();var i=it(r),a=e.getFieldsError([i])[0];return a.warnings}),N(this,"isFieldsTouched",function(){e.warningUnhooked();for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=i[0],s=i[1],l,c=!1;i.length===0?l=null:i.length===1?Array.isArray(o)?(l=o.map(it),c=!1):(l=null,c=o):(l=o.map(it),c=s);var u=e.getFieldEntities(!0),h=function(d){return d.isFieldTouched()};if(!l)return c?u.every(function(f){return h(f)||f.isList()}):u.some(h);var p=new Wn;l.forEach(function(f){p.set(f,[])}),u.forEach(function(f){var d=f.getNamePath();l.forEach(function(m){m.every(function(y,F){return d[F]===y})&&p.update(m,function(y){return[].concat(ce(y),[f])})})});var b=function(d){return d.some(h)},v=p.map(function(f){var d=f.value;return d});return c?v.every(b):v.some(b)}),N(this,"isFieldTouched",function(r){return e.warningUnhooked(),e.isFieldsTouched([r])}),N(this,"isFieldsValidating",function(r){e.warningUnhooked();var i=e.getFieldEntities();if(!r)return i.some(function(o){return o.isFieldValidating()});var a=r.map(it);return i.some(function(o){var s=o.getNamePath();return er(a,s)&&o.isFieldValidating()})}),N(this,"isFieldValidating",function(r){return e.warningUnhooked(),e.isFieldsValidating([r])}),N(this,"resetWithFieldInitialValue",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new Wn,a=e.getFieldEntities(!0);a.forEach(function(l){var c=l.props.initialValue,u=l.getNamePath();if(c!==void 0){var h=i.get(u)||new Set;h.add({entity:l,value:c}),i.set(u,h)}});var o=function(c){c.forEach(function(u){var h=u.props.initialValue;if(h!==void 0){var p=u.getNamePath(),b=e.getInitialValue(p);if(b!==void 0)pn(!1,"Form already set 'initialValues' with path '".concat(p.join("."),"'. Field can not overwrite it."));else{var v=i.get(p);if(v&&v.size>1)pn(!1,"Multiple Field with path '".concat(p.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(v){var f=e.getFieldValue(p),d=u.isListField();!d&&(!r.skipExist||f===void 0)&&e.updateStore(Xt(e.store,p,ce(v)[0].value))}}}})},s;r.entities?s=r.entities:r.namePathList?(s=[],r.namePathList.forEach(function(l){var c=i.get(l);if(c){var u;(u=s).push.apply(u,ce(ce(c).map(function(h){return h.entity})))}})):s=a,o(s)}),N(this,"resetFields",function(r){e.warningUnhooked();var i=e.store;if(!r){e.updateStore(Kn(e.initialValues)),e.resetWithFieldInitialValue(),e.notifyObservers(i,null,{type:"reset"}),e.notifyWatch();return}var a=r.map(it);a.forEach(function(o){var s=e.getInitialValue(o);e.updateStore(Xt(e.store,o,s))}),e.resetWithFieldInitialValue({namePathList:a}),e.notifyObservers(i,a,{type:"reset"}),e.notifyWatch(a)}),N(this,"setFields",function(r){e.warningUnhooked();var i=e.store,a=[];r.forEach(function(o){var s=o.name,l=En(o,pm),c=it(s);a.push(c),"value"in l&&e.updateStore(Xt(e.store,c,l.value)),e.notifyObservers(i,[c],{type:"setField",data:o})}),e.notifyWatch(a)}),N(this,"getFields",function(){var r=e.getFieldEntities(!0),i=r.map(function(a){var o=a.getNamePath(),s=a.getMeta(),l=G(G({},s),{},{name:o,value:e.getFieldValue(o)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return i}),N(this,"initEntityValue",function(r){var i=r.props.initialValue;if(i!==void 0){var a=r.getNamePath(),o=rn(e.store,a);o===void 0&&e.updateStore(Xt(e.store,a,i))}}),N(this,"isMergedPreserve",function(r){var i=r!==void 0?r:e.preserve;return i??!0}),N(this,"registerField",function(r){e.fieldEntities.push(r);var i=r.getNamePath();if(e.notifyWatch([i]),r.props.initialValue!==void 0){var a=e.store;e.resetWithFieldInitialValue({entities:[r],skipExist:!0}),e.notifyObservers(a,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(o,s){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.fieldEntities=e.fieldEntities.filter(function(h){return h!==r}),!e.isMergedPreserve(s)&&(!o||l.length>1)){var c=o?void 0:e.getInitialValue(i);if(i.length&&e.getFieldValue(i)!==c&&e.fieldEntities.every(function(h){return!Xl(h.getNamePath(),i)})){var u=e.store;e.updateStore(Xt(u,i,c,!0)),e.notifyObservers(u,[i],{type:"remove"}),e.triggerDependenciesUpdate(u,i)}}e.notifyWatch([i])}}),N(this,"dispatch",function(r){switch(r.type){case"updateValue":{var i=r.namePath,a=r.value;e.updateValue(i,a);break}case"validateField":{var o=r.namePath,s=r.triggerName;e.validateFields([o],{triggerName:s});break}}}),N(this,"notifyObservers",function(r,i,a){if(e.subscribable){var o=G(G({},a),{},{store:e.getFieldsValue(!0)});e.getFieldEntities().forEach(function(s){var l=s.onStoreChange;l(r,i,o)})}else e.forceRootUpdate()}),N(this,"triggerDependenciesUpdate",function(r,i){var a=e.getDependencyChildrenFields(i);return a.length&&e.validateFields(a),e.notifyObservers(r,a,{type:"dependenciesUpdate",relatedFields:[i].concat(ce(a))}),a}),N(this,"updateValue",function(r,i){var a=it(r),o=e.store;e.updateStore(Xt(e.store,a,i)),e.notifyObservers(o,[a],{type:"valueUpdate",source:"internal"}),e.notifyWatch([a]);var s=e.triggerDependenciesUpdate(o,a),l=e.callbacks.onValuesChange;if(l){var c=us(e.store,[a]);l(c,e.getFieldsValue())}e.triggerOnFieldsChange([a].concat(ce(s)))}),N(this,"setFieldsValue",function(r){e.warningUnhooked();var i=e.store;if(r){var a=Kn(e.store,r);e.updateStore(a)}e.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),e.notifyWatch()}),N(this,"setFieldValue",function(r,i){e.setFields([{name:r,value:i,errors:[],warnings:[]}])}),N(this,"getDependencyChildrenFields",function(r){var i=new Set,a=[],o=new Wn;e.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var h=it(u);o.update(h,function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return p.add(l),p})})});var s=function l(c){var u=o.get(c)||new Set;u.forEach(function(h){if(!i.has(h)){i.add(h);var p=h.getNamePath();h.isFieldDirty()&&p.length&&(a.push(p),l(p))}})};return s(r),a}),N(this,"triggerOnFieldsChange",function(r,i){var a=e.callbacks.onFieldsChange;if(a){var o=e.getFields();if(i){var s=new Wn;i.forEach(function(c){var u=c.name,h=c.errors;s.set(u,h)}),o.forEach(function(c){c.errors=s.get(c.name)||c.errors})}var l=o.filter(function(c){var u=c.name;return er(r,u)});l.length&&a(l,o)}}),N(this,"validateFields",function(r,i){e.warningUnhooked();var a,o;Array.isArray(r)||typeof r=="string"||typeof i=="string"?(a=r,o=i):o=r;var s=!!a,l=s?a.map(it):[],c=[],u=String(Date.now()),h=new Set,p=o||{},b=p.recursive,v=p.dirty;e.getFieldEntities(!0).forEach(function(y){if(s||l.push(y.getNamePath()),!(!y.props.rules||!y.props.rules.length)&&!(v&&!y.isFieldDirty())){var F=y.getNamePath();if(h.add(F.join(u)),!s||er(l,F,b)){var _=y.validateRules(G({validateMessages:G(G({},Kl),e.validateMessages)},o));c.push(_.then(function(){return{name:F,errors:[],warnings:[]}}).catch(function(S){var A,T=[],E=[];return(A=S.forEach)===null||A===void 0||A.call(S,function(w){var g=w.rule.warningOnly,O=w.errors;g?E.push.apply(E,ce(O)):T.push.apply(T,ce(O))}),T.length?Promise.reject({name:F,errors:T,warnings:E}):{name:F,errors:T,warnings:E}}))}}});var f=fm(c);e.lastValidatePromise=f,f.catch(function(y){return y}).then(function(y){var F=y.map(function(_){var S=_.name;return S});e.notifyObservers(e.store,F,{type:"validateFinish"}),e.triggerOnFieldsChange(F,y)});var d=f.then(function(){return e.lastValidatePromise===f?Promise.resolve(e.getFieldsValue(l)):Promise.reject([])}).catch(function(y){var F=y.filter(function(_){return _&&_.errors.length});return Promise.reject({values:e.getFieldsValue(l),errorFields:F,outOfDate:e.lastValidatePromise!==f})});d.catch(function(y){return y});var m=l.filter(function(y){return h.has(y.join(u))});return e.triggerOnFieldsChange(m),d}),N(this,"submit",function(){e.warningUnhooked(),e.validateFields().then(function(r){var i=e.callbacks.onFinish;if(i)try{i(r)}catch(a){console.error(a)}}).catch(function(r){var i=e.callbacks.onFinishFailed;i&&i(r)})}),this.forceRootUpdate=t});function Xa(n){var t=I.useRef(),e=I.useState({}),r=fe(e,2),i=r[1];if(!t.current)if(n)t.current=n;else{var a=function(){i({})},o=new hm(a);t.current=o.getForm()}return[t.current]}var Da=I.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),gm=function(t){var e=t.validateMessages,r=t.onFormChange,i=t.onFormFinish,a=t.children,o=I.useContext(Da),s=I.useRef({});return I.createElement(Da.Provider,{value:G(G({},o),{},{validateMessages:G(G({},o.validateMessages),e),triggerFormChange:function(c,u){r&&r(c,{changedFields:u,forms:s.current}),o.triggerFormChange(c,u)},triggerFormFinish:function(c,u){i&&i(c,{values:u,forms:s.current}),o.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(s.current=G(G({},s.current),{},N({},c,u))),o.registerForm(c,u)},unregisterForm:function(c){var u=G({},s.current);delete u[c],s.current=u,o.unregisterForm(c)}})},a)},mm=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],vm=function(t,e){var r=t.name,i=t.initialValues,a=t.fields,o=t.form,s=t.preserve,l=t.children,c=t.component,u=c===void 0?"form":c,h=t.validateMessages,p=t.validateTrigger,b=p===void 0?"onChange":p,v=t.onValuesChange,f=t.onFieldsChange,d=t.onFinish,m=t.onFinishFailed,y=t.clearOnDestroy,F=En(t,mm),_=I.useRef(null),S=I.useContext(Da),A=Xa(o),T=fe(A,1),E=T[0],w=E.getInternalHooks(On),g=w.useSubscribe,O=w.setInitialValues,D=w.setCallbacks,R=w.setValidateMessages,P=w.setPreserve,W=w.destroyForm;I.useImperativeHandle(e,function(){return G(G({},E),{},{nativeElement:_.current})}),I.useEffect(function(){return S.registerForm(r,E),function(){S.unregisterForm(r)}},[S,E,r]),R(G(G({},S.validateMessages),h)),D({onValuesChange:v,onFieldsChange:function(M){if(S.triggerFormChange(r,M),f){for(var j=arguments.length,X=new Array(j>1?j-1:0),Z=1;Z<j;Z++)X[Z-1]=arguments[Z];f.apply(void 0,[M].concat(X))}},onFinish:function(M){S.triggerFormFinish(r,M),d&&d(M)},onFinishFailed:m}),P(s);var U=I.useRef(null);O(i,!U.current),U.current||(U.current=!0),I.useEffect(function(){return function(){return W(y)}},[]);var q,z=typeof l=="function";if(z){var J=E.getFieldsValue(!0);q=l(J,E)}else q=l;g(!z);var H=I.useRef();I.useEffect(function(){lm(H.current||[],a||[])||E.setFields(a||[]),H.current=a},[a,E]);var K=I.useMemo(function(){return G(G({},E),{},{validateTrigger:b})},[E,b]),B=I.createElement(ui.Provider,{value:null},I.createElement(ir.Provider,{value:K},q));return u===!1?B:I.createElement(u,wt({},F,{ref:_,onSubmit:function(M){M.preventDefault(),M.stopPropagation(),E.submit()},onReset:function(M){var j;M.preventDefault(),E.resetFields(),(j=F.onReset)===null||j===void 0||j.call(F,M)}}),B)};function fs(n){try{return JSON.stringify(n)}catch{return Math.random()}}function ym(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];var r=t[0],i=t[1],a=i===void 0?{}:i,o=Ag(a)?{form:a}:a,s=o.form,l=le(),c=fe(l,2),u=c[0],h=c[1],p=ze(function(){return fs(u)},[u]),b=Le(p);b.current=p;var v=ln(ir),f=s||v,d=f&&f._init,m=it(r),y=Le(m);return y.current=m,_e(function(){if(d){var F=f.getFieldsValue,_=f.getInternalHooks,S=_(On),A=S.registerWatch,T=function(O,D){var R=o.preserve?D:O;return typeof r=="function"?r(R):rn(R,y.current)},E=A(function(g,O){var D=T(g,O),R=fs(D);b.current!==R&&(b.current=R,h(D))}),w=T(F(),F(!0));return u!==w&&h(w),E}},[d]),u}var bm=I.forwardRef(vm),Rr=bm;Rr.FormProvider=gm;Rr.Field=Jl;Rr.List=dm;Rr.useForm=Xa;Rr.useWatch=ym;const ps=n=>typeof n=="object"&&n!=null&&n.nodeType===1,hs=(n,t)=>(!t||n!=="hidden")&&n!=="visible"&&n!=="clip",Kr=(n,t)=>{if(n.clientHeight<n.scrollHeight||n.clientWidth<n.scrollWidth){const e=getComputedStyle(n,null);return hs(e.overflowY,t)||hs(e.overflowX,t)||(r=>{const i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(n)}return!1},Xr=(n,t,e,r,i,a,o,s)=>a<n&&o>t||a>n&&o<t?0:a<=n&&s<=e||o>=t&&s>=e?a-n-r:o>t&&s<e||a<n&&s>e?o-t+i:0,Cm=n=>{const t=n.parentElement;return t??(n.getRootNode().host||null)},gs=(n,t)=>{var e,r,i,a;if(typeof document>"u")return[];const{scrollMode:o,block:s,inline:l,boundary:c,skipOverflowHiddenElements:u}=t,h=typeof c=="function"?c:U=>U!==c;if(!ps(n))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,b=[];let v=n;for(;ps(v)&&h(v);){if(v=Cm(v),v===p){b.push(v);break}v!=null&&v===document.body&&Kr(v)&&!Kr(document.documentElement)||v!=null&&Kr(v,u)&&b.push(v)}const f=(r=(e=window.visualViewport)==null?void 0:e.width)!=null?r:innerWidth,d=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,{scrollX:m,scrollY:y}=window,{height:F,width:_,top:S,right:A,bottom:T,left:E}=n.getBoundingClientRect(),{top:w,right:g,bottom:O,left:D}=(U=>{const q=window.getComputedStyle(U);return{top:parseFloat(q.scrollMarginTop)||0,right:parseFloat(q.scrollMarginRight)||0,bottom:parseFloat(q.scrollMarginBottom)||0,left:parseFloat(q.scrollMarginLeft)||0}})(n);let R=s==="start"||s==="nearest"?S-w:s==="end"?T+O:S+F/2-w+O,P=l==="center"?E+_/2-D+g:l==="end"?A+g:E-D;const W=[];for(let U=0;U<b.length;U++){const q=b[U],{height:z,width:J,top:H,right:K,bottom:B,left:V}=q.getBoundingClientRect();if(o==="if-needed"&&S>=0&&E>=0&&T<=d&&A<=f&&(q===p&&!Kr(q)||S>=H&&T<=B&&E>=V&&A<=K))return W;const M=getComputedStyle(q),j=parseInt(M.borderLeftWidth,10),X=parseInt(M.borderTopWidth,10),Z=parseInt(M.borderRightWidth,10),he=parseInt(M.borderBottomWidth,10);let ee=0,ne=0;const Ee="offsetWidth"in q?q.offsetWidth-q.clientWidth-j-Z:0,Se="offsetHeight"in q?q.offsetHeight-q.clientHeight-X-he:0,de="offsetWidth"in q?q.offsetWidth===0?0:J/q.offsetWidth:0,$e="offsetHeight"in q?q.offsetHeight===0?0:z/q.offsetHeight:0;if(p===q)ee=s==="start"?R:s==="end"?R-d:s==="nearest"?Xr(y,y+d,d,X,he,y+R,y+R+F,F):R-d/2,ne=l==="start"?P:l==="center"?P-f/2:l==="end"?P-f:Xr(m,m+f,f,j,Z,m+P,m+P+_,_),ee=Math.max(0,ee+y),ne=Math.max(0,ne+m);else{ee=s==="start"?R-H-X:s==="end"?R-B+he+Se:s==="nearest"?Xr(H,B,z,X,he+Se,R,R+F,F):R-(H+z/2)+Se/2,ne=l==="start"?P-V-j:l==="center"?P-(V+J/2)+Ee/2:l==="end"?P-K+Z+Ee:Xr(V,K,J,j,Z+Ee,P,P+_,_);const{scrollLeft:He,scrollTop:me}=q;ee=$e===0?0:Math.max(0,Math.min(me+ee/$e,q.scrollHeight-z/$e+Se)),ne=de===0?0:Math.max(0,Math.min(He+ne/de,q.scrollWidth-J/de+Ee)),R+=me-ee,P+=He-ne}W.push({el:q,top:ee,left:ne})}return W},xm=n=>n===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(n)?n:{block:"start",inline:"nearest"};function wm(n,t){if(!n.isConnected||!(i=>{let a=i;for(;a&&a.parentNode;){if(a.parentNode===document)return!0;a=a.parentNode instanceof ShadowRoot?a.parentNode.host:a.parentNode}return!1})(n))return;const e=(i=>{const a=window.getComputedStyle(i);return{top:parseFloat(a.scrollMarginTop)||0,right:parseFloat(a.scrollMarginRight)||0,bottom:parseFloat(a.scrollMarginBottom)||0,left:parseFloat(a.scrollMarginLeft)||0}})(n);if((i=>typeof i=="object"&&typeof i.behavior=="function")(t))return t.behavior(gs(n,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:i,top:a,left:o}of gs(n,xm(t))){const s=a-e.top+e.bottom,l=o-e.left+e.right;i.scroll({top:s,left:l,behavior:r})}}const Fm=["parentNode"],Sm="form_item";function Ql(n){return n===void 0||n===!1?[]:Array.isArray(n)?n:[n]}function Em(n,t){if(!n.length)return;const e=n.join("_");return t?`${t}_${e}`:Fm.includes(e)?`${Sm}_${e}`:e}var Am=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function ms(n){return Ql(n).join("_")}function vs(n,t){const e=t.getFieldInstance(n),r=Fl(e);if(r)return r;const i=Em(Ql(n),t.__INTERNAL__.name);if(i)return document.getElementById(i)}function Zl(n){const[t]=Xa(),e=I.useRef({}),r=I.useMemo(()=>Object.assign(Object.assign({},t),{__INTERNAL__:{itemRef:i=>a=>{const o=ms(i);a?e.current[o]=a:delete e.current[o]}},scrollToField:(i,a={})=>{const{focus:o}=a,s=Am(a,["focus"]),l=vs(i,r);l&&(wm(l,Object.assign({scrollMode:"if-needed",block:"nearest"},s)),o&&r.focusField(i))},focusField:i=>{var a,o;const s=r.getFieldInstance(i);typeof(s==null?void 0:s.focus)=="function"?s.focus():(o=(a=vs(i,r))===null||a===void 0?void 0:a.focus)===null||o===void 0||o.call(a)},getFieldInstance:i=>{const a=ms(i);return e.current[a]}}),[n,t]);return[r]}const _m=({isModalOpen:n,handleOk:t,handleCancel:e,data:r})=>{const i={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]=Zl();return _e(()=>{if(!n){a.resetFields();return}a.setFieldValue("new_name",r==null?void 0:r.label)},[r,n]),k(fi,{modal:{styles:i},children:k(xs,{title:k("div",{className:"text-[16px]",children:"\u7F16\u8F91\u4F1A\u8BDD\u540D\u79F0"}),closeIcon:null,open:n,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:te("div",{className:"mt-[16px] flex justify-end",children:[k(tr,{children:"\u53D6\u6D88",onClick:e,className:"mr-[8px]"}),k(tr,{children:"\u786E\u8BA4",onClick:async()=>{try{const o=await a.validateFields();t("ok_rename",o)}catch(o){console.log(o);return}},type:"primary",className:"border-none"})]}),children:k(Za,{form:a,children:k(Za.Item,{name:"new_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"},{max:100,message:"\u6700\u5927\u5B57\u6570\u9650\u5236100"}],children:k(Cs,{})})})})})},km=({isModalOpen:n,handleOk:t,handleCancel:e,data:r})=>{const i={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]=Zl();return _e(()=>{if(!n){a.resetFields();return}a.setFieldValue("new_name",r==null?void 0:r.label)},[r,n]),k(fi,{modal:{styles:i},children:k(xs,{title:k("div",{className:"text-[16px]",children:"\u5220\u9664\u4F1A\u8BDD"}),closeIcon:null,open:n,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:te("div",{className:"mt-[16px] flex justify-end",children:[k(tr,{children:"\u53D6\u6D88",onClick:e,className:"mr-[8px]"}),k(tr,{children:"\u786E\u8BA4",onClick:async()=>{try{const o=await a.validateFields();t("ok_remove",o)}catch(o){console.log(o);return}},type:"primary",className:"border-none"})]}),children:k("div",{children:`\u786E\u5B9A\u8981\u5220\u9664\u4F1A\u8BDD\u300C${r.label}\u300D\u5417\uFF1F\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D\u3002`})})})},Im="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFQSURBVHgBpVMxTsNQDLWTiIYBFG7Q3iCcgLIxQJWxZSpbOxFO0HICOhE2shGxEFCGbvQGcAPCCahgIJHoN/5RaEOUBAJPsmTZ3/aT/T4Co23ZxoYeWVACEjj/UOhx6l2E+RzudQfNNcR79ptQjfD1vbE98yfzbFDTEE1ZrBC1/IIJEhYPEYhPKUs3m1OQyJBOWfFPOQX+CQ1qQu6sATBaCLwNrh2/NgOdjQC2FBVu5PW+MTjoDvrccSdfJNILqQCzdB9WpzckudQlg87hYISIl7I7G2YNAZ75SrtFy1wxIBwLwtPAc8ZQA5qq676II5MAw8A7n+z3hpLW2d2V0/pVA99NlGV/BRJdIDbltqcV91++zwesvm2IOH6AEmkTkfsW6Seb6/EL+0dY9EhKl1mYi1Slq3HCQFCP2WHWZJY2qEL6L5LPJ/gy8BfIJmxt6X8C+32HILvaN+0AAAAASUVORK5CYII=",xi=({title:n,setOpen:t})=>te("div",{style:{width:"100%",height:"60px",borderBottom:"1px solid #EBEBEB",padding:"20px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"16px",fontWeight:600},children:[k("div",{children:n}),k("img",{src:jc,style:{width:"16px",height:"16px",cursor:"pointer"},onClick:()=>t(!1)})]});qc();const Tm=({curFileInfo:n,onClose:t,token:e})=>{var s;const r={title:"",subtitle:"",backgroundColor:"#f8f9fa",showGrid:!1,showLegend:!1,showTooltip:!1,showFullscreen:!1,showMinimap:!1},[i,a]=le({nodeList:[],edgeList:[]});_e(()=>{console.log("curFileInfo",n)},[n]);const o=async l=>{if(!(!(l!=null&&l.id)||!(l!=null&&l.cyphers)||!(l!=null&&l.fetchUrl)))try{const{cyphers:c,fetchUrl:u,id:h}=l||{};console.log("getGraphData params",c,u,h);const p=await At.post(u,{cyphers:c,ontologyId:h},{headers:{Authorization:e}});console.log("getGraphData res",p),a((p==null?void 0:p.data)||{})}catch(c){console.log("error",c)}};return _e(()=>{o(n)},[n]),te("div",{children:[k(xi,{title:n==null?void 0:n.graphName,setOpen:t}),k("div",{style:{width:"100%",height:"calc(100vh - 60px)"},children:k(zc,{centerNode:{vid:(s=n==null?void 0:n.traceNode)==null?void 0:s.vid},data:i,layout:{type:"force",linkDistance:190},title:r.title,subtitle:r.subtitle,backgroundColor:r.backgroundColor,showGrid:r.showGrid,showLegend:r.showLegend,showTooltip:r.showTooltip,showFullscreen:r.showFullscreen,showMinimap:r.showMinimap,customPlugins:{},onReady:l=>{console.log("KnowledgeGraphPreview ready:",l)}})})]})},Pm=({content:n,onClose:t,token:e})=>{const r=o=>{if(!(o!=null&&o.metadata))return;const s=Xi(o,""),{page_number:l,page_size:c,position:u,offset:h,chunk_type:p}=o.metadata;if(s==="markdown_table")return h!=null&&h.length?{annotations:[{id:an(),offsets:h}],initialPage:1}:{};{if(!c||!u)return console.log("%c\u7F3A\u5C11\u6587\u4EF6size\u6216\u8005\u6587\u4EF6\u5750\u6807","color: red"),{};const b=Array.isArray(c)?c:JSON.parse(c);if(!b.length)return console.log("%c\u7F3A\u5C11\u6587\u4EF6size","color: red"),{};const v=Array.isArray(u)?u:JSON.parse(u);return!v.length||!l?(console.log("%c\u7F3A\u5C11\u6587\u4EF6\u5750\u6807\u6216\u8005\u6587\u4EF6\u9875\u6570","color: red"),{}):{annotations:v.map((d,m)=>({id:an(),pageNumber:l[m],x:+(d[0][0]/b[0][0]).toFixed(4),y:+(d[0][1]/b[0][1]).toFixed(4),width:+((d[1][0]-d[0][0])/b[0][0]).toFixed(4),height:+((d[2][1]-d[0][1])/b[0][1]).toFixed(4),content:"",color:p==="image"?"#60f74f":"#4FC3F7"})),initialPage:l[0]}}},i=ze(()=>{var o,s;if(console.log("content88888888888",n),n&&e){console.log("content999",n);const{annotations:l,initialPage:c}=r(n),u={...n,metadata:{source:((o=n==null?void 0:n.metadata)==null?void 0:o.source)||n.parse_url||n.url,page_size:(s=n==null?void 0:n.metadata)==null?void 0:s.page_size}},h=As(_s(u));return{filePath:h,fileName:Ma(u),fileType:Xi(u,h),totalPages:u.pdfPages||0,token:e,annotations:l,initialPage:c,initialZoom:ks(598,u)}}else return{}},[n]),a=ze(()=>i.filePath?(console.log("curData",i),k(Ts,{initialZoom:i.initialZoom||100,convertedFilePath:i.filePath,fileName:i.fileName,fileType:i.fileType,initialPage:i.initialPage,totalPages:i.totalPages,authorization:i.token,annotations:i.annotations,streamApiUrl:"/proxy/index/knowledgeBase/file/stream",eventsEmit:o=>{switch(o){case"viewer:close":t();break}},tools:{close:!0}})):k(Tr,{}),[i]);return k("div",{style:{fontFamily:"Source Han Sans CN",fontSize:"12px"},className:"h-full w-full",children:a})},ec=({curFileInfo:n,onClose:t,token:e})=>{const r=ze(()=>{var a,o,s;if(n&&e){console.log("content999",n);const l={file_source:n.parse_url||n.parsedFilePath||n.url,file_type:n.file_type,metadata:{source:n.filePath||n.url||((a=n==null?void 0:n.metadata)==null?void 0:a.source)||"",page_size:(o=n==null?void 0:n.metadata)==null?void 0:o.page_size},pdfPages:n.pdfPages},c=As(_s(l));return{filePath:c,fileName:Ma(l),fileType:Xi(l,c),totalPages:l.pdfPages||0,token:e,initialZoom:ks(((s=document.getElementById("pdfBox"))==null?void 0:s.clientWidth)||0,l)}}else return{}},[n]),i=ze(()=>(console.log("curData",r),r.filePath?k(Ts,{initialZoom:r.initialZoom||100,convertedFilePath:r.filePath,fileName:r.fileName,fileType:r.fileType,initialPage:1,totalPages:r.totalPages,authorization:r.token,streamApiUrl:"/proxy/index/knowledgeBase/file/stream",eventsEmit:a=>{switch(a){case"viewer:close":t();break}},tools:{close:!0}}):k(Tr,{})),[r]);return k("div",{id:"pdfBox",className:"h-full overflow-y-auto",children:i})},Dm=({curFileInfo:n,token:t,onClose:e})=>{const[r,i]=le(1),[a,o]=le(10),[s,l]=le([]),[c,u]=le([]),[h,p]=le(0);_e(()=>{var m;const d=((m=n==null?void 0:n.metadata)==null?void 0:m.fetchUrl)||(n==null?void 0:n.fetchUrl);d&&v(d)},[n,r,a]);const b=async({url:d,params:m})=>{var y;try{const F=await At.get(`${Ji()}${d}?${new URLSearchParams(m).toString()}`,{headers:{Authorization:t}}),_=(y=F==null?void 0:F.data)==null?void 0:y.data;if(_){const{columns:S,dataList:A,totalData:T}=_;l(((S==null?void 0:S.slice(1))||[]).map(E=>({title:E.businessName,dataIndex:E.physicalName,key:E.physicalName}))),u(A||[]),p(T||[])}}catch(F){console.log("error",F)}},v=async d=>{b({url:`${d}`,params:{pageNo:r,pageSize:a}})},f=ze(()=>{const{databaseName:d,businessTableName:m,tableName:y}=n;return`${d} - ${y||m}`},[n]);return te("div",{children:[k(xi,{title:f,setOpen:e}),(s==null?void 0:s.length)>0?te("div",{children:[k("div",{className:"p-4 overflow-auto h-[calc(100vh-120px)]",children:k(wc,{columns:s,dataSource:c,pagination:!1,scroll:{x:"max-content"},rowKey:"id"})}),k("div",{className:"flex justify-end px-[18px]",children:k(Fc,{current:r,pageSize:a,responsive:!0,simple:!0,total:h,showSizeChanger:!0,showQuickJumper:!0,onChange:(d,m)=>{i(d),o(m||10)},onShowSizeChange:(d,m)=>{i(1),o(m)}})})]}):k(Sc,{})]})},Wi=({i:n,item:t,j:e,clickTag:r})=>{const i=(e==null?void 0:e.name)!=null&&e.name!==""?String(e.name):(e==null?void 0:e.label)!=null&&e.label!==""?String(e.label):(e==null?void 0:e.content)!=null&&e.content!==""?String(e.content):(e==null?void 0:e.index)!=null?String(e.index):"";return k("div",{style:{minWidth:"16px",maxWidth:"80px",height:"16px",padding:"0 4px",backgroundColor:Rm[t.key],margin:"0 4px",color:Mm[t.key],display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"2px",fontSize:"12px",cursor:r?"pointer":"default",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},onClick:()=>r&&r(n,e,t),title:i,children:i},e.id)};function Om(n){if(typeof n=="string"){const t=n.trim();if(!t)return"";const e=t.match(/\d{4}-\d{2}-\d{2}/);if(e!=null&&e[0])return e[0];const r=new Date(t);return Number.isNaN(r.getTime())?"":r.toISOString().slice(0,10)}if(n instanceof Date&&!Number.isNaN(n.getTime()))return n.toISOString().slice(0,10);if(typeof n=="number"&&Number.isFinite(n)){const t=new Date(n);if(!Number.isNaN(t.getTime()))return t.toISOString().slice(0,10)}return""}const Rm={knowledgeList:"#EAF4FD",searchList:"#E8F7F0",databaseList:"#FFF4E5",graphList:"#E7F8FB"},Mm={knowledgeList:"#2072F0",searchList:"#39B83F",databaseList:"#F48C14",graphList:"#10BBD9"},ys=[{key:"knowledgeList",name:"\u77E5\u8BC6\u5E93\u6587\u6863"},{key:"searchList",name:"\u8054\u7F51\u641C\u7D22",hideBtns:!0},{key:"databaseList",name:"\u6570\u636E\u5E93",hideBtns:!0},{key:"graphList",name:"\u77E5\u8BC6\u56FE\u8C31",hideBtns:!0}],bs=({type:n,data:t,token:e,eventsEmit:r,is_download:i})=>{const[a,o]=le(ys),[s,l]=le("mark"),[c,u]=le(!1),[h,p]=le({}),[b,v]=le("knowledgeList"),[f,d]=le({knowledgeList:[],searchList:[],databaseList:[],graphList:[]}),m=ze(()=>{const E=4-a.length,w=Array(E).fill(null).map((O,D)=>({name:"",key:100+D})),g=[...a,...w];return console.log("rrrrrr",g),g},[a]),y=E=>isNaN(E)?"":(+E).toFixed(2),F=E=>{switch(E){case"searchList":return Qc;case"databaseList":return Yc;case"graphList":return Jc;default:return""}},_=E=>{const w=(E||"").toLowerCase();return["pdf"].includes(w)?"rag/pdf":["doc","docx"].includes(w)?"rag/word":["csv"].includes(w)?"rag/csv":["xls","xlsx"].includes(w)?"rag/excel":["ppt","pptx","pub"].includes(w)?"rag/ppt":["png","jpg","jpeg","jpge"].includes(w)?"rag/pic":(["txt"].includes(w),"rag/txt")},S=(E,w)=>{if(E==="knowledgeList"){let O=((w==null?void 0:w.file_type)||"").toLowerCase();if(!O||O==="faq"){const D=(w==null?void 0:w.metadata)||{},R=D.folder_path||(w==null?void 0:w.folder_path)||D.file_path||D.source||(w==null?void 0:w.source)||(w==null?void 0:w.file_name)||"",P=String(R).match(/\.([a-z0-9]+)$/i);P&&(O=P[1].toLowerCase())}return k(Kc,{type:_(O),size:22,style:{flexShrink:0}})}const g=F(E);return g?k("img",{src:g,style:{width:"22px",height:"22px",flexShrink:0}}):null},A=(E,w)=>E==="graphList"?w.map(g=>({...g,name:g.graphName})).sort((g,O)=>(O.score||0)-(g.score||0)):E==="knowledgeList"?w.map(g=>{const O=g.metadata||{},D=typeof g.score=="number"?g.score:typeof g.rrf_score=="number"?g.rrf_score:typeof O.score=="number"?O.score:0;if(g.type==="faq"){const P=O.folder_path||g.folder_path||O.knowledge_base_name||g.file_name||O.source||g.source||"",W=String(P).match(/\.([a-z0-9]+)$/i),U=W?W[1].toLowerCase():"faq";return{...g,file_type:U,name:P,score:D}}const R=g.sourceFileName||Wc(g.source)||g.file_name;return{...g,file_type:Gc(g.source)||g.file_type,name:R,score:D}}).sort((g,O)=>(O.score||0)-(g.score||0)):E==="searchList"?w.map(g=>({...g,name:g.sourceFileName||g.file_name})).sort((g,O)=>(O.score||0)-(g.score||0)):E==="databaseList"?w.map(g=>{const O=g.tableName?`${g.databaseName||"\u6570\u636E\u5E93"} - ${g.tableName}`:g.databaseName||g.name||"\u6570\u636E\u5E93";return{...g,name:O,file_name:O,file_type:"database"}}).sort((g,O)=>(O.score||0)-(g.score||0)):w,T=(E,w,g)=>{var O;switch(g.key){case"knowledgeList":const{pdfPages:D,parsedFilePath:R,order_num:P,tags:W}=E||{},U=w.id||P||"Unknown ID",q=(W||[]).find(M=>M.id===U);if(E.type==="faq"){p(E),l("faq"),u(!0),r==null||r("retrive_tag:click",{tagInfo:{id:w.id,index:w.index,image_urls:w.image_urls||[]},fromtype:"10",leaf:{id:w.id,fromtype:"10"},referenceDoc:E});return}if(E.type==="video")return console.log("sdgasdgag",{file:{...E,...q}}),r==null?void 0:r("retrive_tag:click",{file:{...E,...q}});if(console.log("click knowledge tag",E,w),!E||!q)return;const{metadata:z}=q,J=z.source.split("/"),H=J[J.length-1]||"",K=H.split("."),B=K.slice(0,-1).join(".")||"Unknown Label",V=K[K.length-1]||"Unknown Type";p({id:U,title:B,file_name:H,file_type:V,file_source:Xc(V)?`${Yi}${z.source}`:R,metadata:z,pdfPages:D}),l("mark"),u(!0);break;case"searchList":console.log("click search tag",E,w);break;case"databaseList":console.log("click database tag",E,w),l("database"),p({...E,metadata:E.metadata||{},fetchUrl:E.fetchUrl||((O=E.metadata)==null?void 0:O.fetchUrl)||""}),u(!0);break;case"graphList":console.log("click graph tag",E,w),l("graphPreview"),p({...E,traceNode:((t==null?void 0:t.traceNode)||[]).find(M=>M.id===w.id)}),u(!0);break}};return _e(()=>{if(n!==tc.REFERENCELIST||(console.log("data in reference drawer",t),!t))return;const{graphRefs:E,knowledgeRefs:w,webRefs:g,databaseRefs:O}=t;E!=null&&E.length&&(f.graphList=A("graphList",E)),w!=null&&w.length&&(f.knowledgeList=A("knowledgeList",w)),g!=null&&g.length&&(f.searchList=A("searchList",g)),O!=null&&O.length&&(f.databaseList=A("databaseList",O));const D=ys.filter(R=>{var P;return(P=f[R.key])==null?void 0:P.length}).sort((R,P)=>{var W,U;return(((W=f[P.key])==null?void 0:W.length)||0)-(((U=f[R.key])==null?void 0:U.length)||0)});o(D),D!=null&&D.length&&v(D[0].key),d({...f})},[t]),te(Tr,{children:[te("div",{className:"listWrap w-full h-full",children:[k(xi,{title:"\u77E5\u8BC6\u6EAF\u6E90",setOpen:()=>{const E=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(E)}}),te("div",{style:{height:"calc(100% - 60px)"},children:[k("div",{className:"tabs",style:{display:"flex",justifyContent:"space-between",padding:"12px 20px"},children:m.map(E=>k("div",{className:"tab-item",style:{padding:"5.5px 12px",backgroundColor:E.name?b===E.key?"#4E6EF2":"#F5F6F9":"transparent",cursor:"pointer",borderRadius:"4px",color:b===E.key?"#FFFFFF":"#4E5969",fontSize:"14px",minWidth:"80px",display:"flex",justifyContent:"center"},onClick:()=>{E.name&&v(E.key)},children:E.name},E.key))}),k("div",{className:"listBox",style:{height:"calc(100% - 66px)",overflowY:"auto",display:"flex",flexDirection:"column",alignItems:"center",willChange:"scroll-position",transform:"translateZ(0)"},children:a.map(E=>{let w=f[E.key]||[];return b!==E.key?null:k("div",{children:w.map(g=>{var O,D,R,P,W,U,q,z,J;return te("div",{style:{width:"360px",padding:"4px 8px",borderRadius:"4px",margin:"6px 0",cursor:E.key==="knowledgeList"&&g.type==="faq"?"default":"pointer"},className:"listItemBox",onClick:()=>{E.key==="searchList"&&window.open(g.link,"_blank")},children:[te("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px"},children:[te("div",{style:{flex:1,minWidth:0,fontSize:"14px",color:"#1D2129",fontWeight:"700",display:"flex",alignItems:"center"},children:[k("div",{style:{width:22,height:22,marginRight:2,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:S(E.key,g)}),k(wr,{placement:"topLeft",title:((O=g==null?void 0:g.name)==null?void 0:O.length)>17?g.name:"",children:k("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.4,wordBreak:"break-all"},onClick:()=>{var H;E.key==="knowledgeList"&&g.type==="faq"||(E.key==="knowledgeList"?r==null||r("knowledge_referenceFile_title:click",{data:{...g,file_type:g.file_type,file_name:g.file_name,metadata:g.metadata,parsedFilePath:g.parsedFilePath}}):E.key==="databaseList"&&(l("database"),p({...g,metadata:g.metadata||{},fetchUrl:g.fetchUrl||((H=g.metadata)==null?void 0:H.fetchUrl)||""}),u(!0)))},children:g.name})})]}),((D=g==null?void 0:g.tags)==null?void 0:D.length)&&g.tags.length>0&&g.tags.length<=10&&g.type!=="faq"&&k("div",{style:{display:"flex",alignItems:"center",flexShrink:0,gap:"2px"},children:(g.tags||[]).map(H=>k(Wi,{i:g,item:E,j:H,clickTag:T},H.id))}),te("div",{style:{width:"52px",justifyContent:"space-between",alignItems:"center",marginRight:"8px",display:E.hideBtns||g.type==="video"||g.type==="faq"||g.faq_question||g.faq_answer?"none":"flex"},children:[k("img",{src:Im,style:{width:"16px",height:"16px",cursor:"pointer"},onClick:()=>{r==null||r("referenceFile_filechat",{data:{...g,file_type:g.file_type,file_name:g.file_name,metadata:g.metadata,parsedFilePath:g.parsedFilePath}})}}),k("div",{style:{borderRight:"1px solid #E5E6EB",height:"14px"}}),k("img",{src:Uc,style:{width:"16px",height:"16px",cursor:i?"pointer":"not-allowed"},onClick:()=>{var K,B,V;if(!((K=g==null?void 0:g.tags)!=null&&K.length)&&!((B=g==null?void 0:g.metadata)!=null&&B.source)||!i)return;const H=((V=((g==null?void 0:g.tags)||[])[0])==null?void 0:V.metadata)||(g==null?void 0:g.metadata);Hc({filePath:`${Yi}${H.source}`,fileName:Ma({metadata:H}),token:e})}})]})]}),E.key==="knowledgeList"&&g.type==="faq"&&(((R=g.metadata)==null?void 0:R.update_time)||typeof g.score=="number"||typeof g.score=="string"||((P=g==null?void 0:g.tags)==null?void 0:P.length)&&g.tags.length>0)&&te("div",{style:{marginTop:"4px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",fontSize:"12px",color:"#4E5969"},children:[te("span",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:8},children:[(typeof g.score=="string"||typeof g.score=="number")&&te("span",{children:["\u5206\u6570: ",y(g.score)]}),((W=g.metadata)==null?void 0:W.update_time)&&k("span",{children:Om(g.metadata.update_time)})]}),((U=g==null?void 0:g.tags)==null?void 0:U.length)&&g.tags.length>0&&g.tags.length<=10&&k("span",{style:{display:"flex",alignItems:"center",flexShrink:0,gap:"2px"},children:(g.tags||[]).map(H=>k(Wi,{i:g,item:E,j:H,clickTag:g.type==="faq"?void 0:T},H.id))})]}),(typeof g.score=="string"||typeof g.score=="number")&&!(g.type==="faq"||g.faq_question||g.faq_answer)&&k("div",{style:{display:"flex",alignItems:"center",height:"18px",marginTop:"4px"},children:te("div",{style:{backgroundColor:"#F2F2FB",borderRadius:"4px",padding:"2px 3px",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"12px"},children:[k("span",{style:{color:"#4E5969",marginRight:"6px"},children:"\u5206\u6570:"}),k("span",{style:{color:"#1D2129"},children:y(g.score)})]})}),k("div",{style:{flex:1,display:"flex",justifyContent:"flex-start",marginTop:"4px"},children:((q=g==null?void 0:g.tags)!=null&&q.length&&g.tags.length>10?g.tags:[]).map(H=>k(Wi,{i:g,item:E,j:H,clickTag:g.type==="faq"?void 0:T},H.id))}),g.type==="faq"&&(g.faq_question||g.faq_answer)&&te("div",{style:{marginTop:"8px",padding:"8px 10px",background:"#EAF4FD",borderRadius:"4px",fontSize:"12px",color:"#1D2129",lineHeight:1.5},children:[g.faq_question!=null&&String(g.faq_question).trim()!==""&&te("div",{style:{marginBottom:"4px",display:"flex"},children:[k("span",{style:{color:"#4E5969",flexShrink:0},children:"Q: "}),k("span",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:String(g.faq_question).trim()})]}),g.faq_answer!=null&&String(g.faq_answer).trim()!==""&&te("div",{style:{display:"flex"},children:[k("span",{style:{color:"#4E5969",flexShrink:0},children:"A: "}),k("span",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:String(g.faq_answer).replace(/\s*--+[A-Za-z0-9]*\s*$/,"").trim()||String(g.faq_answer).trim()})]})]}),!!((z=g==null?void 0:g.main_source)!=null&&z.length)&&te("div",{style:{flex:1,display:"flex",alignItems:"flex-start",marginTop:"4px"},children:[k("div",{style:{fontSize:"12px",color:"#4E5969",width:"60px"},children:"\u5173\u8054\u6587\u6863:"}),k(wr,{placement:"topLeft",title:((J=Ai(g.main_source[0]))==null?void 0:J.length)>22?Ai(g.main_source[0]):"",children:k("div",{style:{fontSize:"12px",color:"#4E5969",width:"289px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ai(g.main_source[0])})})]})]},g.id)})},E.key)})})]})]}),k(fi,{drawer:{styles:{body:{padding:0},header:{display:"none"}}},children:te(ws,{autoFocus:!1,onClose:()=>u(!1),open:c,width:b==="graphList"?"100%":720,className:"overflow-x-hidden",destroyOnClose:!0,afterOpenChange:E=>{E||p(null)},children:[s==="graphPreview"&&k(Tm,{curFileInfo:h,onClose:u,token:e}),s==="mark"&&k(Pm,{content:h,onClose:u,token:e}),s==="preview"&&k(ec,{curFileInfo:h,onClose:u,token:e}),s==="database"&&k(Dm,{curFileInfo:h,onClose:u,token:e}),s==="faq"&&h&&te("div",{className:"p-4",style:{fontSize:"14px",color:"#1D2129",lineHeight:1.6},children:[h.faq_question!=null&&String(h.faq_question).trim()!==""&&te("div",{style:{marginBottom:"12px"},children:[k("span",{style:{color:"#4E5969",marginRight:"4px"},children:"Q:"}),k("span",{children:String(h.faq_question).trim()})]}),h.faq_answer!=null&&String(h.faq_answer).trim()!==""&&te("div",{children:[k("span",{style:{color:"#4E5969",marginRight:"4px"},children:"A:"}),k("span",{children:String(h.faq_answer).replace(/\s*--+[A-Za-z0-9]*\s*$/,"").trim()||String(h.faq_answer).trim()})]})]})]})})]})},Nm=({fileData:n,token:t})=>{const[e,r]=le([]);_e(()=>{var l;const o=n==null?void 0:n.knowledgeBases;if(!(o!=null&&o.length))return;const s=((l=o[0])==null?void 0:l.treeData)||[];s!=null&&s.length&&r(s)},[n]);const i=Le(new Map),a=async(o,s)=>{var l,c;if(!i.current.get(o==null?void 0:o.fetchUrl))try{const u=e[s];u.loading=!0;const h=[...e];r(h);const p=await At.get(`${Zc()}/${o.fetchUrl}`,{headers:{Authorization:t}}),b=(c=(l=p==null?void 0:p.data)==null?void 0:l.data)==null?void 0:c.records;if(b){const v=e[s];v.loading=!1,v.children=b;const f=[...e];f[s]=v,r(f),i.current.set(o==null?void 0:o.fetchUrl,!0)}else{const v=e[s];v.loading=!1;const f=[...e];r(f)}}catch{const h=e[s];h.loading=!1;const p=[...e];r(p)}};return te(Tr,{children:[k(xi,{title:"\u77E5\u8BC6\u5E93\u6587\u6863\u76EE\u5F55",setOpen:()=>{const o=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(o)}}),k("div",{style:{height:"calc(100% - 60px)",overflowY:"auto",padding:"16px"},children:e.map((o,s)=>{var l;return o.type==="file"?te("div",{className:"flex",style:{marginTop:"8px"},children:[Is(o),k(wr,{placement:"top",title:((l=o.name)==null?void 0:l.length)>23?o.name:"",children:k("div",{style:{paddingLeft:"6px",width:"346px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default",fontSize:"14px"},children:o.name})})]}):k(Lm,{item:o,index:s,clickFileItem:a},s)})})]})},Lm=({item:n,index:t,clickFileItem:e})=>{var a;const[r,i]=le(!1);return te("div",{style:{marginTop:"8px"},children:[te("div",{className:"flex cursor-pointer",onClick:()=>{i(!r),!r&&e(n,t)},children:[Is(n),k(wr,{placement:"top",title:((a=n.name)==null?void 0:a.length)>23?n.name:"",children:te("div",{style:{paddingLeft:"6px",width:"346px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"14px"},children:[n.name," (",n.fileCount||0,")"]})})]},t),k("div",{style:{padding:"2px 0 2px 14px",margin:"8px 0 0 7px",borderLeft:"2px solid #E5E6EB",display:r?"block":"none"},children:(n.children||[]).map((o,s)=>{var l;return te("div",{className:"flex items-center",children:[k("div",{style:{width:"4px",height:"4px",borderRadius:"2px",background:"black"}}),k(wr,{placement:"top",title:((l=o.name)==null?void 0:l.length)>26?o.name:"",children:k("div",{style:{paddingLeft:"6px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"12px",width:"336px"},children:o.fileName})})]},s)})})]})};var tc=(n=>(n.REFERENCELIST="referencelist",n.ALLFILELIST="allFileList",n))(tc||{});function sv(n=mc){return function({token:e,url:r="http://localhost:8888",styles:i,CSRFToken:a,eventsEmit:o,scrollOld:s,locale:l="zh",messages:c,...u}){const h=Ac(),p=ze(()=>{const C=eo({theme:Oa,mode:"light"},h||{});return eo(C,i||{})},[h,i]),[b,v]=le(!1),[f,d]=le(!1),[m,y]=le(null),[F,_]=le(!1),[S,A]=le("mark"),[T,E]=le({url:"",parse_url:"",file_type:"",file_name:""}),[w,g]=le([]),[O,D]=le(1),[R]=le(16),[P,W]=le(0),[U,q]=le(!1),[z,J]=le([]),[H,K]=le(void 0),[B,V]=le([]),[M,j]=le([]),[X,Z]=le(void 0),[he,ee]=le({display:"ready",sender:"ready",app:"initializing"});function ne(x,C){if(!C)return x;const L=Array.isArray(x)?[...x]:{...x};for(const $ in C)if(C[$]!==void 0&&C[$]!==null&&Object.prototype.hasOwnProperty.call(C,$))if($==="actions"&&Array.isArray(x[$])&&Array.isArray(C[$])){const Q=new Map;x[$].forEach(re=>{re.name&&Q.set(re.name,re)}),C[$].forEach(re=>{re.name&&Q.set(re.name,re)}),L[$]=Array.from(Q.values())}else typeof x[$]=="object"&&x[$]!==null&&!Array.isArray(x[$])&&typeof C[$]=="object"&&C[$]!==null&&!Array.isArray(C[$])?L[$]=ne(x[$],C[$]):L[$]=C[$];return L}const Ee=ze(()=>Ds(l),[l]),Se=ze(()=>{const x=Ee;return{...jn,placeholder:x.sender.placeholder,switchs:(jn.switchs??[]).map(L=>({...L,label:L.name==="netSearch"?x.sender.netSearch:x.sender.deepThinking})),actions:(jn.actions??[]).map(L=>({...L,tip:L.name==="upload"?x.sender.fileUpload:L.tip}))}},[l,Ee]),[de,$e]=le(()=>ne(Se,u.senderConfig));_e(()=>{const x=Ee,C={...jn,placeholder:x.sender.placeholder,switchs:(jn.switchs??[]).map(L=>({...L,label:L.name==="netSearch"?x.sender.netSearch:x.sender.deepThinking})),actions:(jn.actions??[]).map(L=>({...L,tip:L.name==="upload"?x.sender.fileUpload:L.tip}))};$e(L=>{const $=ne(C,u.senderConfig);return Array.isArray(L.actions)&&Array.isArray($.actions)&&($.actions=$.actions.map((Q,re)=>{var ae;const se=(ae=L.actions)==null?void 0:ae[re];return se&&se.name===Q.name&&se.badgeCount!==void 0?{...Q,badgeCount:se.badgeCount}:Q})),$})},[l,u.senderConfig,Ee]);const{fileStatuses:He,setFileStatuses:me,pollFileStatus:ft,handleRemoveFromTemp:pt,resetStopFlag:at,setStopFlag:vt,stoppedRef:Te,getTempFileList:Pe,setFileManagerData:Ye,fileManagerData:We}=xg({url:r,token:e,CSRFToken:a,activeSessionId:H}),[Ge,Y]=ye.useState(()=>{var C;if(!M||M.length===0)return;const x=M.find(L=>L.isDefault);return x?x.id:(C=M[0])==null?void 0:C.id});ye.useEffect(()=>{if(!M||M.length===0)return;const x=M.some(C=>C.id===Ge);if(!Ge||!x){const C=M.find(L=>L.isDefault);Y(C?C.id:M[0].id)}},[M]);const[xe,nt]=le({}),Ot=Le(void 0),Rt=Le(void 0),Nn=Le(void 0),Ke=Le(null),zt=Le(void 0),_n=Le([]),[fr,kt]=le([]),[kn,In]=le({}),[pr,Tn]=le(!1),[hr,gr]=le([]),[mr,qt]=le(!1),{api_startChat_re:bt,addEmptyMessage:Mt,setLastEmptyMessage:Ut,stopStream:cn,cancelStreamBySessionId:un}=yg({baseUrl:r,CSRFToken:a,token:e,setChatData:J,activeSessionId:H,setAppStatus:ee,setConversationList:g}),Ze=ze(()=>{const x={};return(M||[]).forEach(C=>{x[C.id]=C}),x},[M]),oe=ze(()=>{const x=z.find(L=>L.id===H)||{id:H,messages:[]},C=x.configId?Ze[x.configId]:null;return{...x,assistantInfo:C}},[z,H,Ze]);_e(()=>{console.log("currentChatData",oe)},[oe]);const Qt=ze(()=>{if(oe.configId&&Ze){const x=Ze[oe.configId];return x!=null&&x.configJson?JSON.parse(x.configJson).is_download:!1}else return!1},[oe.configId,Ze]);ze(()=>{if((oe.configId||X)&&Ze){const x=Ze[oe.configId];if(x!=null&&x.configJson){const C=JSON.parse(x.configJson);return console.log("is_enableThinking",oe.configId,Ze,X),!!C.thinking}else if(X){const C=Ze[X];if(C!=null&&C.configJson)return!!JSON.parse(C.configJson).thinking}}return!1},[oe.configId,Ze,X]),_e(()=>{if(Ot.current&&Ot.current!==H){const C=Ot.current,L=w.find(re=>re.sessionId===C&&re.isNew),$=z.find(re=>re.id===C&&re.isNew),Q=$&&$.messages&&$.messages.length>0;L&&!Q&&(g(re=>re.filter(se=>se.sessionId!==C)),J(re=>re.filter(se=>se.id!==C)))}Ot.current=H;const x=oe.messages&&oe.messages.length>0?oe.messages[oe.messages.length-1].recommendQuestion:[];V(x)},[H,w,z,oe.messages]);const gn=async x=>{var C,L,$,Q;if(!U){q(!0);try{const re=await At.get(`${r}/qa/dialogue/list?pageNo=${x}&pageSize=${R}&sysType=INT_SESSION`,{headers:{Authorization:e}}),se=((L=(C=re==null?void 0:re.data)==null?void 0:C.data)==null?void 0:L.records)||[],ae=((Q=($=re==null?void 0:re.data)==null?void 0:$.data)==null?void 0:Q.total)||0;W(ae),g(qe=>{const Be=new Map;return[...qe,...se].forEach(rt=>{Be.set(rt.sessionId,rt)}),Array.from(Be.values())}),D(x)}catch{}finally{q(!1)}}};_e(()=>{ee(x=>({...x,app:"initializing"})),At.get(`${r}/qa/search/config/helper/list?pageNo=1&pageSize=3000`,{headers:{Authorization:e}}).then(x=>{j(x.data.data||[])}).catch(()=>{}),gn(1).then(()=>{H||It(),ee(x=>({...x,app:"ready"}))}).catch(()=>{ee(x=>({...x,app:"error"}))})},[]),_e(()=>{H&&(ee(x=>({...x,display:"loading"})),Pe(H),At.get(`${r}/qa/dialogue/getDialogBySessionId?sessionId=${H}`,{headers:{Authorization:e}}).then(x=>{var mt;if(!x.data.data){ee(ie=>({...ie,display:"ready"}));return}const C=((mt=x.data.data)==null?void 0:mt.queryReplyPairList)||[],L=dg(C),{sessionId:$,searchConfigDTO:Q,filePath:re,configId:se,reference:ae,webReference:qe,uploadedFiles:Be,fileList:rt,currentFiles:tt}=x.data.data;if(L.length>0){const ie=L.length-1-[...L].reverse().findIndex(ke=>ke.istype==="ai");ie>=0&&ie<L.length&&L[ie].istype==="ai"&&(ae&&(L[ie].reference=ae),qe&&(L[ie].webReference=qe))}const Ae=tt||rt||Be;if(Ae&&L.length>0){const ie=[...L].reverse().findIndex(ke=>ke.istype==="user");ie!==-1&&(console.log(L[L.length-1-ie].currentFiles,"filesData"),L[L.length-1-ie].currentFiles=Ae)}w.find(ie=>ie.sessionId===$)&&g(ie=>ie.map(ke=>ke.sessionId===$?{...ke,searchConfigDTO:Q,filePath:re,configId:se}:ke));const pe={configId:x.data.data.configId,filePath:x.data.data.filePath,searchConfigDTO:x.data.data.searchConfigDTO||{},sessionId:x.data.data.sessionId,label:x.data.data.label,kbId:x.data.data.kbId};J(ie=>{const ke=ie.filter(Ue=>Ue.id!==H);return[{id:H,messages:L,...pe},...ke]}),ee(ie=>({...ie,display:"ready"}))}).catch(x=>{console.error("\u83B7\u53D6\u804A\u5929\u6570\u636E\u5931\u8D25:",x),x.response&&x.response.status===404&&It(),ee(C=>({...C,display:"error"}))}))},[H,r,e]),_e(()=>{const x=We.uploadedFiles.length;$e(C=>{const L=Array.isArray(C.actions)?C.actions:[];return{...C,actions:L.map(Q=>Q.name==="history"?{...Q,badgeCount:x}:Q)}})},[We.uploadedFiles]),_e(()=>{eu({url:r,token:e},x=>{gr(x)})},[]),ye.useEffect(()=>{He.length&&J(x=>{if(!x[0])return x;const{messages:C}=x[0];for(let L=C.length-1;L>=0;L--)if(C[L].istype==="user"){const $=C[L].currentFiles||[];C[L].currentFiles=He.map(Q=>{var se,ae,qe;const re=$.find(Be=>Be.uid===Q.uid);return{name:((se=Q.file)==null?void 0:se.name)||Q.name,size:((ae=Q.file)==null?void 0:ae.size)||Q.size,type:((qe=Q.file)==null?void 0:qe.type)||Q.type,status:Q.status,uid:Q.uid,url:Q.url||(re==null?void 0:re.url)||""}});break}return[...x]})},[He]);let be=null,et=null;const Ht=(x,C,L,$)=>{et=ft(x,{onStatusUpdate:C,onComplete:L,onFail:$})},Ie=(x,C)=>{J(L=>{const $=[...L];return $[0]&&($[0]={...$[0],messages:$[0].messages.map(Q=>Q.queryId===x?{...Q,feedbackResult:C}:Q)}),$})},Re=async x=>{var C,L;if(x)try{const $=(oe==null?void 0:oe.configId)||((C=Ze==null?void 0:Ze[(oe==null?void 0:oe.configId)||""])==null?void 0:C.id)||"",Q=await At.get(`${r}/qa/ai/recommendQuestion?queryId=${x}&configId=${$||""}`.replace(/\?&/,"?"),{headers:{Authorization:e}});V(((L=Q.data)==null?void 0:L.data)||[])}catch{V([])}};function ot(x){const{content:C,audioUrl:L,filePaths:$,queryId:Q}=x;if(!H||!Q)return;const re=(oe==null?void 0:oe.messages)||[],se=re.findIndex(ue=>(ue==null?void 0:ue.queryId)===Q&&((ue==null?void 0:ue.istype)==="ai"||(ue==null?void 0:ue.isUser)===!1));let ae;if(se>0)for(let ue=se-1;ue>=0;ue-=1){const pe=re[ue];if((pe==null?void 0:pe.istype)==="user"||(pe==null?void 0:pe.isUser)===!0){ae=pe;break}}const qe=(ae==null?void 0:ae.content)??C;if(!qe)return;const Be=(ae==null?void 0:ae.filePaths)??$,rt=(typeof Be=="string"&&Be?JSON.parse(Be):Be||[]).map(ue=>ue.uid),tt=Date.now();Ut({now:tt}),ee(ue=>({...ue,display:"processing",sender:"processing"}));const Ae="query-"+an(32);se>=0&&re[se]&&J(ue=>{if(!ue[0])return ue;const pe=ue[0],mt=pe.messages||[];if(se>=mt.length)return ue;const ie=mt.slice();return ie[se]={...ie[se],queryId:Ae,content:ie[se].content,reference:"[]",webReference:"[]",graphReference:null,databaseReference:null,status:2,chain:void 0},[{...pe,messages:ie},...ue.slice(1)]}),x.clearFn&&x.clearFn(),g(ue=>ue.map(pe=>pe.sessionId===H?{...pe,gmtModified:tt}:pe)),bt({configId:oe.configId,content:qe,fileUids:rt,lastDate:tt,name:oe.label||"",queryId:Ae,sessionId:String(H||""),type:(ae==null?void 0:ae.audioUrl)??L?"audioUrl":"text",audioUrl:((ae==null?void 0:ae.audioUrl)??L)||"",enableThinking:!!xe.reasoning,enableWebsearch:!!xe.netSearch,qaChannel:xe.qaChannel,tempKnowledgeBaseCheck:Lr.current},ue=>{Re(Ae)})}async function ct(x,C){if(he.sender!=="ready"){yt.warning("\u5F53\u524D\u5BF9\u8BDD\u6B63\u5728\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u518D\u53D1\u9001\u65B0\u7684\u95EE\u9898");return}if(!H)return;const L=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(L);const $=w.find(Q=>Q.sessionId===H);if($&&$.isNew){let Q=!1;const re=X||$.configId,se=x&&x.content?x.content.slice(0,20):$.label||"\u672A\u547D\u540D\u4F1A\u8BDD";if(await new Promise((ae,qe)=>{ru({url:r,token:e,CSRFToken:a},{label:se,sessionId:$.sessionId,sysType:"INT_SESSION",configId:re},Be=>{Be&&Be.data&&Be.data.sessionId?(g(rt=>rt.map(tt=>tt.sessionId===$.sessionId?{...tt,isNew:!1,configId:re,label:se}:tt)),J(rt=>rt.map(tt=>tt.id===$.sessionId?{...tt,isNew:!1,configId:re,label:se}:tt)),Q=!0,ae()):(yt.error("\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),qe())})}),!Q)return;Wt(H,x,C,re);return}Wt(H,x,C)}function Wt(x,C,L,$){const Q="query-"+an(32),re=w.find(Ae=>Ae.sessionId===x),se=$||(re==null?void 0:re.configId)||oe.configId;console.log("\u52A9\u624B\u914D\u7F6E\u8BE6\u60C5",se);const ae=C.content||C.text||"",qe=typeof ae=="string"?ae:String(ae),Be=qe?qe.slice(0,20):"\u672A\u547D\u540D\u4F1A\u8BDD";let rt;if(C.files&&C.files.length>0&&(rt=C.files.map(Ae=>({name:Ae.file.name,size:Ae.file.size,type:Ae.file.type,filePath:Ae.filePath||"",convertedFilePath:Ae.convertedFilePath||"",uid:Ae.uid||""}))),console.log("\u672C\u5730\u6587\u4EF6\u4E0A\u4F20",C.files),Mt({content:qe,queryId:Q,currentFiles:rt,filePaths:rt?JSON.stringify(rt):void 0}),g(Ae=>Ae.map(ue=>ue.sessionId===x&&ue.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&ue.isNew?{...ue,label:Be,gmtModified:Date.now(),isNew:!1}:ue)),J(Ae=>Ae.map(ue=>ue.id===x&&ue.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&ue.isNew?{...ue,label:Be,isNew:!1}:ue)),C.files&&C.files.length>0){ee(ie=>({...ie,sender:"uploading",display:"uploading"})),be=new AbortController,at();const Ae=C.files.map(()=>`rc-upload-${Date.now()}-${Math.random().toString(36).slice(2)}`),ue=C.files.map((ie,ke)=>({...ie,uid:Ae[ke],status:"uploading"}));me(ue);const pe=new FormData;C.files.forEach(ie=>{pe.append("files",ie.file)});const mt=String(x||"");pe.append("sessionId",mt),pe.append("uids",Ae.join(",")),At.post(`${r}/index/knowledgeBase/file/uploadFiles`,pe,{headers:{Authorization:e,"Content-Type":"multipart/form-data"},signal:be.signal}).then(ie=>{var Xe,ge,st,ut,dn,Gt,ht,yn,gt,bn;if(console.log("\u6587\u4EF6\u4E0A\u4F20\u7684\u6253\u5370\u7ED3\u679C",ie),console.log("\u6587\u4EF6\u4E0A\u4F20\u54CD\u5E94\u8BE6\u60C5:",{status:ie.status,success:(Xe=ie.data)==null?void 0:Xe.success,dataType:Array.isArray((ge=ie.data)==null?void 0:ge.data)?"array":typeof((st=ie.data)==null?void 0:st.data),dataLength:Array.isArray((ut=ie.data)==null?void 0:ut.data)?ie.data.data.length:"N/A",errorMsg:(dn=ie.data)==null?void 0:dn.errorMsg,errorCode:(Gt=ie.data)==null?void 0:Gt.errorCode,fullResponse:ie.data}),Te.current)return;const ke=(ht=ie.data)==null?void 0:ht.data,ve=((yn=ie.data)==null?void 0:yn.success)===!0,Ue=Array.isArray(ke)&&ke.length>0;if(ve&&Ue){const Ct=ke,Cn=Ct.map(Qe=>Qe.uid);me(Qe=>Qe.map(Je=>{const Ve=ke.find(Oe=>Oe.uid===Je.uid);return Ve?{...Je,...Ve}:Je})),ee(Qe=>({...Qe,sender:"processing",display:"analyzing"})),me(Qe=>Qe.map(Je=>({...Je,status:"parsing"}))),Ht(Cn,Qe=>{if(!Qe||!Array.isArray(Qe)){console.warn("pollFileStatus \u56DE\u8C03\u8FD4\u56DE\u7684 serverStatuses \u65E0\u6548:",Qe);return}if(me(Ve=>Ve.map(Oe=>{const je=Qe.find(Nt=>Nt&&Nt.uid===Oe.uid);if(je)switch(je.fileParseStatus??je.status){case 3:return{...Oe,status:"done"};case 4:return{...Oe,status:"error"};case 1:case 2:default:return{...Oe,status:"parsing"}}return Oe})),Array.isArray(Qe)&&Qe.length>0&&Qe.every(Ve=>{if(!Ve)return!1;const Oe=Ve.fileParseStatus??Ve.status;return Oe===3||Oe===4})){me([]);const Ve=new Map;(Qe||[]).forEach(Oe=>{Ve.set(Oe.id,Oe)}),Ye(Oe=>({uploadedFiles:su(Oe.uploadedFiles,Ct).map(Nt=>{var vr;return{...Nt,pdfPages:((vr=Ve.get(Nt.id))==null?void 0:vr.pdfPages)||0}})}))}},()=>{L==null||L(),ee(Je=>({...Je,sender:"processing",display:"processing"})),me(Je=>Je.map(Ve=>{const Oe=Ct.find(je=>je.uid===Ve.uid);return Oe?{...Ve,...Oe,url:Oe.filePath,filePath:Oe.filePath,name:Oe.fileName||Ve.name,convertedFilePath:Oe.convertedFilePath||Ve.convertedFilePath}:Ve})),J(Je=>{if(!Je[0])return Je;const{messages:Ve}=Je[0];for(let Oe=Ve.length-1;Oe>=0;Oe--)if(Ve[Oe].istype==="user"){const je=Ve[Oe].currentFiles||[];Ve[Oe].currentFiles=je.map(Nt=>{const vr=Ct.find(lc=>lc.uid===Nt.uid);return vr?{...Nt,...vr}:Nt});break}return[...Je]});const Qe=Date.now();bt({configId:se,content:qe,fileUids:Cn,lastDate:Qe,name:Be,queryId:Q,sessionId:String(x||""),type:"text",audioUrl:"",enableThinking:!!xe.reasoning,enableWebsearch:!!xe.netSearch,qaChannel:xe.qaChannel,tempKnowledgeBaseCheck:Lr.current},Je=>{Re(Q)})},Qe=>{ee(Je=>({...Je,display:"ready",sender:"ready"})),me(Je=>Je.map(Ve=>({...Ve,status:"error",message:Qe})))})}else{let Ct="\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25";(gt=ie.data)!=null&&gt.errorMsg?Ct=ie.data.errorMsg:ve?Ue||(Array.isArray(ke)?ke.length===0&&(Ct="\u4E0A\u4F20\u5931\u8D25: \u8FD4\u56DE\u6570\u636E\u4E3A\u7A7A"):Ct=`\u4E0A\u4F20\u5931\u8D25: \u8FD4\u56DE\u6570\u636E\u683C\u5F0F\u9519\u8BEF\uFF0C\u671F\u671B\u6570\u7EC4\uFF0C\u5B9E\u9645\u4E3A ${typeof ke}`):Ct=`\u4E0A\u4F20\u5931\u8D25: success=${(bn=ie.data)==null?void 0:bn.success}`,console.error("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\u8BE6\u60C5:",{errorMsg:Ct,response:ie.data,isSuccess:ve,isValidData:Ue}),yt.error(Ct),ee(Cn=>({...Cn,display:"error",sender:"ready"})),me(Cn=>Cn.map(Qe=>({...Qe,status:"error",message:Ct})))}}).catch(ie=>{var ke,ve;((ke=ie==null?void 0:ie.response)==null?void 0:ke.status)===413?(ve=ie==null?void 0:ie.response)!=null&&ve.statusText.includes("Request Entity Too Large")&&yt.error("\u6587\u4EF6\u8D85\u8FC7\u6700\u5927\u53EF\u4E0A\u4F20\u9650\u5236"):yt.error("\u7F51\u7EDC\u9519\u8BEF"),ee(Ue=>({...Ue,display:"error",sender:"ready"})),me(Ue=>Ue.map(Xe=>({...Xe,status:"error",message:"\u7F51\u7EDC\u9519\u8BEF"})))});return}ee(Ae=>({...Ae,display:"processing",sender:"processing"}));const tt=Date.now();g(Ae=>Ae.map(ue=>ue.sessionId===x?{...ue,gmtModified:tt}:ue)),L==null||L(),bt({configId:se,content:qe,fileUids:[],lastDate:tt,name:Be,queryId:Q,sessionId:String(x||""),type:"text",audioUrl:"",enableThinking:!!xe.reasoning,enableWebsearch:!!xe.netSearch,qaChannel:xe.qaChannel,tempKnowledgeBaseCheck:Lr.current},Ae=>{Re(Q)})}function Ln(x){x.restult==1?_i({url:r,token:e,CSRFToken:a},{queryId:x.queryId},()=>{Ie(x.queryId,null)}):ro({url:r,token:e,CSRFToken:a},{restult:1,queryId:x.queryId},()=>{Ie(x.queryId,1)})}function It(x){const C=an(32),L={sessionId:C,label:"\u672A\u547D\u540D\u4F1A\u8BDD",gmtModified:Date.now(),searchConfigDTO:{},filePath:"",configId:"",isNew:!0};g($=>[{...L,messages:[]},...$]),J($=>[{id:C,messages:[],...L},...$]),K(C)}function Zt(x){if(x!=null&&x.sessionId&&x.sessionId!==H){H&&un(H),K(x.sessionId),ee(L=>({...L,sender:"ready"}));const C=z.find(L=>L.id===x.sessionId);if(C&&C.messages&&C.messages.length>0){const L=[...C.messages].reverse().find($=>$.istype==="ai");L&&L.recommendQuestion?V(L.recommendQuestion):V([])}else V([])}}const $n=async x=>new Promise((C,L)=>{iu({url:r,token:e,CSRFToken:a},{sessionId:x},$=>{$?(yt.success("\u5220\u9664\u6210\u529F!"),C($)):(yt.error("\u5220\u9664\u5931\u8D25!"),L($))})}),Bn=async()=>{try{return g([]),W(0),await gn(1),[]}catch(x){throw yt.error("\u5237\u65B0\u4F1A\u8BDD\u5217\u8868\u5931\u8D25"),x}},Vn=async(x,C)=>new Promise((L,$)=>{au({url:r,token:e,CSRFToken:a},{label:C,sessionId:x},Q=>{if(Q){const re=Date.now();g(se=>se.map(ae=>ae.sessionId===x?{...ae,label:C,gmtModified:re}:ae)),J(se=>se.map(ae=>ae.id===x?{...ae,label:C}:ae)),yt.success("\u91CD\u547D\u540D\u6210\u529F!"),L(Q)}else yt.error("\u91CD\u547D\u540D\u5931\u8D25"),$(Q)})}),Et=x=>{g(C=>{const L=C.filter($=>$.sessionId!==x);return H===x&&(L.length>0?K(L[0].sessionId):It()),L})},Mr=(x,C)=>{const L=Date.now();g($=>$.map(Q=>Q.sessionId===x?{...Q,label:C,gmtModified:L}:Q)),J($=>$.map(Q=>Q.id===x?{...Q,label:C}:Q))},Nr=x=>{ro({url:r,token:e,CSRFToken:a},{...x,...kn,restult:0},()=>{Ie(kn.queryId,0)})},wi=x=>{const C=x.new_name,L=m.data.label;C&&C!==L?m.async_renameConversation(C).then(()=>{m.fn_renameItemInList(C),v(!1)}).catch(()=>{}):v(!1)},en=x=>{m.async_deleteConversation().then(()=>{m.fn_removeItemFromList(),d(!1)}).catch(()=>{})},mn=(x,C)=>{switch(console.log(x,C),x){case"close_remove":d(!1);break;case"close_rename":v(!1);break;case"ok_rename":wi(C);break;case"ok_remove":en();break}},nc=async({url:x,params:C,replacePredataFunction:L})=>{var $,Q;try{const re=await At.post(x,C,{headers:{Authorization:e}}),se=(Q=($=re==null?void 0:re.data)==null?void 0:$.data)==null?void 0:Q.data;se&&L(se)}catch(re){console.log("error",re)}},rc=async x=>{var C;try{const L=await At.get(`${Ji()}/index/knowledgeBase/file/getFileStatusByUids?uids=${x.data.uids}`,{headers:{Authorization:e}});return console.log("resslkdjgalsg",L),(C=L==null?void 0:L.data)==null?void 0:C.data}catch{}},Ja=async x=>{var C;if(ou.includes(x.file_type)){const L=(C=x.metadata)!=null&&C.source?`${Yi}${x.metadata.source}`:x.url||x.convertedFilePath||x.filePath;E({...x,parse_url:L}),A("preview"),_(!0);return}try{const L=await rc({data:{uids:x.uid},config:{url:Ji(),token:e,enableMock:!1}});if(L!=null&&L.length){const $=L[0];E({...x,parse_url:$.convertedFilePath}),A("preview"),_(!0)}}catch{}},Lr=Le(!1),vn=(x,C)=>{var L,$,Q,re,se,ae,qe,Be,rt,tt,Ae;switch(console.log(`[Event] ${x}`,C),x){case"TempKnowledgeBase":Lr.current=C;break;case"reference_file:click":if(C.file_type==="image")return;if(!C.parse_url){if(!C.uid)return C.references?void 0:yt.warning("\u6587\u4EF6\u8FD8\u672A\u89E3\u6790\u5B8C\u6210,\u8BF7\u7A0D\u540E\u9884\u89C8");Ja(C);return}E({...C,file_type:C.type,file_name:C.file}),A("preview"),_(!0);break;case"conversations:load_more":{w.length<P&&!U&&gn(O+1);break}case"retrieve-sql-data:pagingation_click":const{page:ue,pageSize:pe,fetchUrl:mt,source:ie,replacePredataFunction:ke}=C;nc({url:`${r}${mt}`,replacePredataFunction:ke,params:{pageNo:ue,pageSize:pe,convertedFilePath:ie,stream:!1}});break;case"web_referenceFile_title:click":if(!((L=C==null?void 0:C.data)!=null&&L.link))return console.error("\u6CA1\u6709\u7F51\u9875\u5730\u5740");window.open(C.data.link,"_blank");break;case"conversation:item_click":Zt(C);break;case"files:finished_animation_complete":me([]);break;case"conversation:create":It();break;case"conversation:new_assistant_change":Z(C.assistantId);break;case"conversations:rename_icon_clicked":y({data:C,async_renameConversation:ve=>Vn(C.sessionId,ve),fn_renameItemInList:ve=>Mr(C.sessionId,ve)}),v(!0);break;case"conversations:delete_icon_clicked":y({data:C,async_deleteConversation:()=>$n(C.sessionId),async_refreshConversationList:Bn,fn_removeItemFromList:()=>Et(C.sessionId)}),d(!0);break;case"sender:send":ct(C,C.clearFn);break;case"sender:send_recommandQuestion":{const ve=((C==null?void 0:C.content)??"").toString();if(!ve)break;ct({content:ve},()=>{});break}case"chatbox:follow_up_question_click":{const ve=((C==null?void 0:C.question)??(C==null?void 0:C.content)??"").toString();if(!ve)break;ct({content:ve},()=>{});break}case"sender:stop":vt(),be&&(be.abort(),be=null),et&&(et(),et=null),ee(ve=>({...ve,display:"ready",sender:"ready"})),me([]),cn==null||cn();break;case"sender:clear":($=C.clearFn)==null||$.call(C);break;case"sender:configChange":C&&C.all&&nt(C.all);break;case"sender:action_upload":Ke.current&&Ke.current.click();break;case"sender:action_history":qt(!0);break;case"uploaded_file:item_click":break;case"action_copy:click":C&&ug(C.content,C.event);break;case"chatbox:copy":{let ve=(C==null?void 0:C.content)||"";if(!ve)break;ve=ve.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,"");const Ue=async ge=>{try{return await navigator.clipboard.writeText(ge),yt.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F"),!0}catch{return!1}},Xe=ge=>{const st=document.createElement("textarea");st.value=ge,st.style.position="fixed",st.style.opacity="0",document.body.appendChild(st),st.focus(),st.select();try{document.execCommand("copy"),yt.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F")}catch{yt.error("\u590D\u5236\u5931\u8D25")}document.body.removeChild(st)};Ue(ve).then(ge=>{ge||Xe(ve)});break}case"chatbox:repeat":console.log(C,"sdkflskdjflksdjfklsdjlfkjsdklfjsdklfjlks"),ot(C);break;case"action_thumbsup":Ln(C);break;case"chatbox:like":Ln({queryId:C==null?void 0:C.queryId,restult:C==null?void 0:C.result});break;case"action_thumbsdown":C.restult===0?_i({url:r,token:e,CSRFToken:a},{queryId:C.queryId},()=>{Ie(C.queryId,null)}):(In(C),Tn(!0));break;case"chatbox:dislike":(C==null?void 0:C.result)===0?_i({url:r,token:e,CSRFToken:a},{queryId:C.queryId},()=>{Ie(C.queryId,null)}):(In({queryId:C==null?void 0:C.queryId}),Tn(!0));break;case"action_retrive_tag":o==null||o("action_retrive_tag",C);break;case"referenceFile_view":o==null||o("referenceFile_view",C);break;case"referenceFile_question":console.log(C,"zhezhhzhzh"),Ja(C.data||C),o==null||o("referenceFile_question",C);break;case"referenceFile_download":o==null||o("referenceFile_download",C);break;case"references:click":case"knowledge_base_view_all:click":{const ve=()=>x==="references:click"?k(bs,{type:"referencelist",data:C,token:e,eventsEmit:o,is_download:Qt}):k(Nm,{fileData:C,token:e}),Ue=new CustomEvent("aichat:right_set_content",{detail:{content:k(ve,{})}});window.dispatchEvent(Ue);const Xe=new CustomEvent("aichat:right_set",{detail:{collapsed:!1}});window.dispatchEvent(Xe);break}case"retrive_tag:click":{let ve=(C==null?void 0:C.referencesPayloadSingle)||((C==null?void 0:C.fromtype)==="10"&&(C!=null&&C.referenceDoc)?{knowledgeRefs:[C.referenceDoc],webRefs:[],graphRefs:[],databaseRefs:[],images:[],raw:{}}:null);if((C==null?void 0:C.fromtype)==="10"&&!ve&&((Q=C==null?void 0:C.leaf)==null?void 0:Q.id)!=null&&((re=oe==null?void 0:oe.messages)!=null&&re.length)){const Ue=oe.messages;for(let Xe=Ue.length-1;Xe>=0;Xe--){const ge=Ue[Xe];if((ge==null?void 0:ge.istype)!=="ai")continue;const st=(ge==null?void 0:ge.faqReference)??((se=ge==null?void 0:ge.reply)==null?void 0:se.faqReference)??(ge==null?void 0:ge.reference);if(!st)continue;let ut=[];try{const je=typeof st=="string"?(()=>{const Nt=st.replace(/"pk":\s*(\d+)/g,'"pk":"$1"').replace(/"order_num":\s*(\d+)/g,'"order_num":"$1"').replace(/"related_pk":\s*(\d+)/g,'"related_pk":"$1"');return JSON.parse(Nt)})():st;ut=Array.isArray(je)?je:[je]}catch{continue}if(ut.length===0)continue;const dn=String(C.leaf.id);let Gt=ut.findIndex(je=>String((je==null?void 0:je.pk)??(je==null?void 0:je.order_num)??(je==null?void 0:je.id))===dn);if(Gt<0){const je=Number(dn);Number.isInteger(je)&&je>=1&&je<=ut.length&&(Gt=je-1)}if(Gt<0)continue;const ht=ut[Gt],yn=Gt+1,gt=ht.metadata||{},bn=ht.faq_question||gt.sourceFileName||gt.source&&String(gt.source).split("/").pop()||"FAQ",Ct=ht.folder_path||gt.folder_path||gt.knowledge_base_name||"",Cn=Ct?`${Ct} - ${bn}`:bn,Qe=`\u77E5\u8BC6\u5E93${yn}\u540D\uFF1A${Cn}`,Je=String(ht.pk??ht.order_num??ht.id??""),Ve=typeof ht.score=="number"?ht.score:typeof gt.score=="number"?gt.score:0;ve={knowledgeRefs:[{id:Je,file_id:Je,file_name:Qe,file_type:"faq",type:"faq",path:"",score:Ve,rrf_score:Ve,tags:[{id:dn,index:yn,image_urls:((ae=C==null?void 0:C.tagInfo)==null?void 0:ae.image_urls)||[],metadata:gt}],source:ht.folder_path||"",order_num:Je,pk:Je,faq_question:ht.faq_question,faq_answer:ht.faq_answer,folder_path:ht.folder_path,metadata:gt,faqIndex:yn,...ht}],webRefs:[],graphRefs:[],databaseRefs:[],images:[],raw:{}};break}}if((C==null?void 0:C.fromtype)==="10"&&ve){const Ue=new CustomEvent("aichat:right_set_content",{detail:{content:k(bs,{type:"referencelist",data:ve,token:e,eventsEmit:o,is_download:Qt})}});window.dispatchEvent(Ue);const Xe=new CustomEvent("aichat:right_set",{detail:{collapsed:!1}});window.dispatchEvent(Xe)}o==null||o("retrive_tag:click",C);break}case"fileManager:change":{typeof(C==null?void 0:C.setUploadedFiles)=="function"&&(Rt.current=C.setUploadedFiles,Nn.current=C.removeFile,zt.current=C==null?void 0:C.senderConfig,_n.current=Array.isArray(C==null?void 0:C.uploadedFiles)?C.uploadedFiles:[],Array.isArray(C==null?void 0:C.uploadedFiles)&&kt(C.uploadedFiles),console.log("[DEBUG] fileManager:change \u4E8B\u4EF6\u89E6\u53D1\uFF0CsetUploadedFilesRef \u5DF2\u8BBE\u7F6E",{hasSetUploadedFiles:!!Rt.current,uploadedFilesCount:((qe=C==null?void 0:C.uploadedFiles)==null?void 0:qe.length)||0,pendingFilesCount:((Be=C==null?void 0:C.uploadedFiles)==null?void 0:Be.length)||0,hasSenderConfig:!!(C!=null&&C.senderConfig),senderConfig:C==null?void 0:C.senderConfig,upload_number_limit:(rt=C==null?void 0:C.senderConfig)==null?void 0:rt.upload_number_limit,upload_size_limit:(tt=C==null?void 0:C.senderConfig)==null?void 0:tt.upload_size_limit}));break}case"uploaded_file:removeFromTemp":{console.log("[DEBUG] mergedEventsEmit uploaded_file:removeFromTemp \u4E8B\u4EF6",C);const ve=(Ae=C==null?void 0:C.file)==null?void 0:Ae.uid;if(!ve){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6",C);break}const Ue=[...(oe==null?void 0:oe.messages)||[]].reverse().find(ge=>ge.istype==="user"),Xe=Ue==null?void 0:Ue.queryId;pt(ve,Xe);break}case"uploaded_file:remove_batch":break;default:o==null||o(x,C)}},ic=[{key:"conversations",type:"custom",label:"\u5BF9\u8BDD\u5386\u53F2",icon:k(du,{size:16}),enabled:!0,component:k(nd,{data:w,assistantList:M,activedItem:H||"",hasMore:w.length<P,loadingMore:U,sortRules:[{label:"\u5F53\u5929",dayPeriod:1},{label:"3\u5929",dayPeriod:3},{label:"7\u5929",dayPeriod:7},{label:"30\u5929",dayPeriod:30}],eventsEmit:vn,styles:p.theme})}],Ya=ye.useCallback(()=>k(vg,{eventsEmit:vn,assistantList:M,styles:p,selectedId:Ge,onSelectAssistant:Y,productLogo:u==null?void 0:u.productLogo}),[vn,M,p,Ge,u==null?void 0:u.productLogo]),ac={...ye.useMemo(()=>({AiChatBox:(x,C)=>{var rt,tt,Ae,ue;const L=C===(((rt=oe==null?void 0:oe.messages)==null?void 0:rt.length)||0)-1;let $="ready";if(L)if(x.status!==void 0)switch(x.status){case 0:$="thinking";break;case 1:$="processing";break;case 2:$="ready";break;case 3:$="error";break;case 4:$="thinking";break;default:$=he.display}else $=he.display;let Q=[];if(Array.isArray(B))Q=B;else if(typeof B=="string")try{Q=JSON.parse(B)||[]}catch{Q=[]}const re=(()=>{var ie;const pe=x==null?void 0:x.reference;if(pe){if(typeof pe=="string")try{return JSON.parse(pe),pe}catch{return"[]"}try{return JSON.stringify(pe)}catch{return"[]"}}const mt=(x==null?void 0:x.faqReference)??((ie=x==null?void 0:x.reply)==null?void 0:ie.faqReference)??void 0;if(!mt)return"[]";try{const ke=typeof mt=="string"?(()=>{const ge=mt.replace(/"pk":\s*(\d+)/g,'"pk":"$1"').replace(/"order_num":\s*(\d+)/g,'"order_num":"$1"').replace(/"related_pk":\s*(\d+)/g,'"related_pk":"$1"');return JSON.parse(ge)})():mt,ve=Array.isArray(ke)?ke:[ke];if(!ve.length)return"[]";const Xe={knowledgeRefs:ve.map((ge,st)=>{const ut=ge.metadata||{},dn=ge.faq_question||ut.sourceFileName||ut.source&&String(ut.source).split("/").pop()||"FAQ",Gt=ge.folder_path||ut.folder_path||ut.knowledge_base_name||"",ht=Gt?`${Gt} - ${dn}`:dn,yn=`\u77E5\u8BC6\u5E93${st+1}\u540D\uFF1A${ht}`,gt=String(ge.pk??ge.order_num??ge.id??""),bn=typeof ge.score=="number"?ge.score:typeof ut.score=="number"?ut.score:0;return{id:gt,file_id:gt,file_name:yn,file_type:"faq",type:"faq",path:"",score:bn,rrf_score:bn,tags:[{id:gt,index:st+1,image_urls:[],metadata:ut}],source:ge.folder_path||"",order_num:gt,pk:gt,faq_question:ge.faq_question,faq_answer:ge.faq_answer,folder_path:ge.folder_path,metadata:ut,faqIndex:st+1,...ge}}),webRefs:[],graphRefs:[],databaseRefs:[],images:[],raw:{}};return JSON.stringify(Xe)}catch{return"[]"}})(),se=(()=>{const pe=x==null?void 0:x.webReference;if(!pe)return"[]";if(typeof pe=="string")try{return JSON.parse(pe),pe}catch{return"[]"}try{return JSON.stringify(pe)}catch{return"[]"}})(),ae=(()=>{const pe=x==null?void 0:x.graphReference;if(!pe)return"[]";if(typeof pe=="string")try{return JSON.parse(pe),pe}catch{return"[]"}try{return JSON.stringify(pe)}catch{return"[]"}})(),qe=x==null?void 0:x.databaseReference,Be=(()=>{var mt,ie,ke;if(x!=null&&x.chainRespTime||(mt=x==null?void 0:x.reply)!=null&&mt.chainRespTime)return(x==null?void 0:x.chainRespTime)??((ie=x==null?void 0:x.reply)==null?void 0:ie.chainRespTime);const pe=(x==null?void 0:x.chain)||((ke=x==null?void 0:x.reply)==null?void 0:ke.chain);if(Array.isArray(pe)&&pe.length>0){const ve=pe.reduce((Ue,Xe)=>{const ge=(Xe==null?void 0:Xe.chainRespTime)??(Xe==null?void 0:Xe.respTime);return ge!=null&&ge>0?Ue+ge:Ue},0);return ve>0?ve:void 0}})();return k(Qa,{...x,enablePrism:!1,token:e,streamUrl:"/proxy/index/knowledgeBase/file/stream",referenceMode:"button",reference:re,webReference:se,graphReference:ae,faqReference:(x==null?void 0:x.faqReference)??((tt=x==null?void 0:x.reply)==null?void 0:tt.faqReference),databaseReference:qe,contentType:"stream",displayStatus:$,eventsEmit:vn,isLast:L&&(x==null?void 0:x.istype)==="ai",followUpQuestions:L&&(x==null?void 0:x.istype)==="ai"?Q:[],defaultAnswer:((Ae=oe==null?void 0:oe.searchConfigDTO)==null?void 0:Ae.defaultAnswer)||"\u4E0D\u77E5\u9053\u4EC0\u4E48\u539F\u56E0\u6211\u4EEC\u6CA1\u80FD\u67E5\u5230\u4F60\u8981\u7684\u95EE\u9898*-*",is_download:Qt,styles:p,enableThoughtChain:!0,chain:x==null?void 0:x.chain,thoughtChainNodes:x==null?void 0:x.thoughtChainNodes,thoughtChainStatus:x==null?void 0:x.status,enableCot:(x==null?void 0:x.enableCot)??((ue=x==null?void 0:x.reply)==null?void 0:ue.enableCot),chainRespTime:Be},`${(x==null?void 0:x.queryId)||(x==null?void 0:x.id)||C}-${(x==null?void 0:x.istype)||"unknown"}`)},LogoBox:x=>x&&x.LogoBox===null?null:x&&typeof x.LogoBox=="function"?k(x.LogoBox,{}):k("div",{className:"text-2xl w-full text-center font-bold",children:"\u5C0F\u9CB8\u667A\u80FD\u52A9\u624B"}),DisplayLoading:()=>k(Fg,{}),DisplayError:()=>k(Eg,{}),AppError:()=>k(Sg,{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 x,C;return k(wg,{title:(x=u==null?void 0:u.appLoadingConfig)==null?void 0:x.title,subtitle:((C=u==null?void 0:u.appLoadingConfig)==null?void 0:C.subtitle)||""})},UserChatBox:(x,C)=>k(Qa,{enablePrism:!1,token:e,streamUrl:"/proxy/index/knowledgeBase/file/stream",...x,referenceMode:"button",contentType:"plainText",isUser:!0,displayStatus:"ready",eventsEmit:vn,styles:p,fileManagerData:We,currentFiles:x==null?void 0:x.currentFiles},`${(x==null?void 0:x.queryId)||(x==null?void 0:x.id)||C}-user`),WelcomeComponent:Ya}),[Ya,oe,he.display,vn,p,Qt,We]),...u.CustomComponents||{}};_e(()=>{$e(x=>{const C=Array.isArray(x.switchs)?x.switchs.map(L=>L.name==="reasoning"?{...L,enabled:!0}:L):[];return{...x,switchs:C}})},[]);const oc=ze(()=>We.uploadedFiles||[],[We]),{FileDisplayTools:sc}=tu({fileManagerData:{uploadedFiles:oc},styles:p,eventsEmit:vn});return k(Cu,{locale:l,children:te("div",{style:{height:"100%",minWidth:"1116px",overflow:"hidden"},children:[k("input",{ref:Ke,type:"file",multiple:!0,accept:"image/*,.pdf,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.txt,.md,.json,.csv,.zip,.rar,.7z",style:{display:"none"},onChange:x=>{const C=x.target.files;if(C&&C.length>0){console.log("[DEBUG] handleFileSelect \u89E6\u53D1",{filesCount:C.length,hasSetUploadedFilesRef:!!Rt.current,hasSenderConfig:!!zt.current,dynamicSenderConfig:de,dynamicSenderConfigKeys:de?Object.keys(de):[],senderConfigRef:zt.current,senderConfigRefKeys:zt.current?Object.keys(zt.current):[]});const L=Array.from(C);let $=zt.current;(!$||$.upload_size_limit===void 0&&$.upload_number_limit===void 0&&(!$.upload_file_type_limit||$.upload_file_type_limit.length===0))&&($=de);const Q=_n.current||[];console.log("[DEBUG] \u9A8C\u8BC1\u914D\u7F6E\u68C0\u67E5",{configSource:$,upload_number_limit:$==null?void 0:$.upload_number_limit,upload_size_limit:$==null?void 0:$.upload_size_limit,existingFilesCount:Q.length,newFilesCount:L.length});const re=$&&($.upload_size_limit!==void 0||$.upload_number_limit!==void 0&&$.upload_number_limit>0||$.upload_file_type_limit&&$.upload_file_type_limit.length>0);if(console.log("[DEBUG] \u914D\u7F6E\u68C0\u67E5\u7ED3\u679C",{hasUploadLimitConfig:re,upload_number_limit:$==null?void 0:$.upload_number_limit,upload_size_limit:$==null?void 0:$.upload_size_limit,upload_file_type_limit:$==null?void 0:$.upload_file_type_limit}),re){const se={upload_size_limit:$.upload_size_limit,upload_number_limit:$.upload_number_limit,upload_file_type_limit:$.upload_file_type_limit,upload_limit_message:$.upload_limit_message};console.log("[DEBUG] \u6267\u884C\u6587\u4EF6\u9A8C\u8BC1",{uploadConfig:se,existingFilesCount:Q.length,newFilesCount:L.length,totalCount:Q.length+L.length});const ae=vc(L,Q,se);if(console.log("[DEBUG] \u9A8C\u8BC1\u7ED3\u679C",{valid:ae.valid,errors:ae.errors,rejectedFilesCount:ae.rejectedFiles.length}),!ae.valid){yc(ae);const qe=L.filter(Be=>!ae.rejectedFiles.includes(Be));if(qe.length===0){Ke.current&&(Ke.current.value="");return}L.splice(0,L.length,...qe)}}if(Rt.current){const se=L.map(ae=>({file:ae,type:ae.type.startsWith("image/")?"image":"document",status:"pending",name:ae.name}));console.log("[DEBUG] \u901A\u8FC7 setUploadedFilesRef \u8BBE\u7F6E\u6587\u4EF6",se),Rt.current(se)}else console.warn("[DEBUG] setUploadedFilesRef \u672A\u8BBE\u7F6E\uFF0C\u5EF6\u8FDF\u91CD\u8BD5"),setTimeout(()=>{if(Rt.current){const se=L.map(ae=>({file:ae,type:ae.type.startsWith("image/")?"image":"document",status:"pending",name:ae.name}));console.log("[DEBUG] \u5EF6\u8FDF\u540E\u901A\u8FC7 setUploadedFilesRef \u8BBE\u7F6E\u6587\u4EF6",se),Rt.current(se)}else console.error("[DEBUG] \u5EF6\u8FDF\u540E setUploadedFilesRef \u4ECD\u672A\u8BBE\u7F6E")},100)}Ke.current&&(Ke.current.value="")}}),k(n,{...u,status:he,chatData:oe,sidebar:ic,recommandQuestions:[],eventsEmit:vn,styles:p,senderConfig:de,fileUploadStatus:He,CustomComponents:ac,activeSessionId:H,scrollOld:s,rightbarWidth:"400px",locale:l,messages:c,disclaimer:u.disclaimer??Ee.disclaimer,chatHeader:{title:(oe==null?void 0:oe.label)||Ee.chatHeader.newConversation,tools:sc}}),k(nu,{open:pr,feedBackList:hr,setOpen:Tn,handleConfirm:Nr}),k(_m,{isModalOpen:b,handleOk:mn,handleCancel:()=>mn("close_rename"),data:(m==null?void 0:m.data)||{}}),k(km,{isModalOpen:f,handleOk:mn,handleCancel:()=>mn("close_remove"),data:(m==null?void 0:m.data)||{}}),k(fi,{drawer:{styles:{body:{padding:0},header:{display:"none"}}},children:k(ws,{autoFocus:!1,onClose:()=>_(!1),open:F,width:S==="graphPreview"?"100%":720,className:"overflow-x-hidden",destroyOnClose:!0,children:S==="preview"&&k(ec,{curFileInfo:T,onClose:_,token:e})})})]})})}}export{tc as DrawerType,sv as default,uv as registerPDFWorker};