@gientech/modual 2.2.3-fix.7 → 2.2.3-fix.8
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/assets/{index-BlAyZ4S3.js → index-YHUI3QVz.js} +143 -143
- package/assets/style-Blt3Kyyt.js +196 -0
- package/chat.js +1 -1
- package/chatCompare.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/assets/style-D8ou48dh.js +0 -196
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import{jsx as k,jsxs as Q,Fragment as rt}from"react/jsx-runtime";import*as C0 from"react";import Re,{createElement as mr,PureComponent as Wa,useState as se,useMemo as Ae,createContext as Jn,Children as ja,cloneElement as Va,Component as Ka,useRef as We,useEffect as be,useCallback as Et}from"react";import{c as at,bq as Ga,_ as Xa,aV as Xr,br as ea,H as ta,f as qr,w as i0,J as nt,bs as ra,aH as dr,F as Yr,bp as Ya,T as ct,x as Qa,bt as yr}from"./index-DHK_n74G.js";import{f as Za,r as Ja,c as ei,B as ti,z as ri,d as na,g as aa,a as ia,b as Sr,e as Lr,h as kr,D as ni,T as lr,i as ai,j as Cr,k as ii,l as oi,m as si,G as ui,n as li,W as ci,o as oa,p as di,v as fi,q as xi,u as pi,F as hi,s as Qr,t as Fr,w as Er,x as vi,y as gi,A as mi,E as yi,H as Ci,I as Fi,J as Ei}from"./index-YHUI3QVz.js";import{a as Bi,F as Ai,G as Zr}from"./index-BDc2zBbG.js";import{u as w0}from"./index-CpW6Dhpp.js";import{b as sa,h as Jr,a as bi,e as Di}from"./index-DPA1HCWQ.js";import{D as _i}from"./index-BIEKgWu0.js";import{P as wi}from"./plus-BICgMvz9.js";import{S as Ir}from"./search-CD5YKija.js";import{X as ua}from"./x-DWGzNb9c.js";import{s as we,S as Bt,M as la}from"./index-iOuQJ8vu.js";import{P as Si}from"./index-usBlUHOb.js";import{C as ki,G as ca,c as Ii,r as Ri}from"./GientechStreamReader-r5ZTSZk2.js";import{P as Ni}from"./index-B4k3tK0f.js";/* empty css *//* empty css */import{D as da}from"./index-CzZQWA2P.js";import"../database.js";import"../databaseId.js";import"../databaseTable.js";import"../modelManage.js";import"../sensitive.js";import"../assistantConfig.js";/**
|
|
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 Pi=at("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 Ti=at("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 zi=at("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 qi=at("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 fa=at("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 Li=at("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"}]]),Oi=r=>C0.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},C0.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"}),C0.createElement("path",{d:"M1.33334 8H14.6667",stroke:"currentColor",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),C0.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"}),C0.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"}),C0.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"})),Mi=r=>C0.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},C0.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"}),C0.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"}),C0.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"}),C0.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"})),Y0={actions:[{name:"upload",icon:k(sa,{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(Oi,{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(Mi,{width:16,height:16})}]},Or={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"},Ui={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."},Hi={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"},$i={zh:Or,en:Ui,ja:Hi};function xa(r){return $i[r]??Or}const pa=Re.createContext({locale:"zh",messages:Or});function fr(){return Re.useContext(pa)}function Wi({locale:r,children:u}){const t=Re.useMemo(()=>({locale:r,messages:xa(r)}),[r]);return Re.createElement(pa.Provider,{value:t},u)}function ji(r,u){r.prototype=Object.create(u.prototype),r.prototype.constructor=r,Ga(r,u)}var en=Number.isNaN||function(u){return typeof u=="number"&&u!==u};function Vi(r,u){return!!(r===u||en(r)&&en(u))}function Ki(r,u){if(r.length!==u.length)return!1;for(var t=0;t<r.length;t++)if(!Vi(r[t],u[t]))return!1;return!0}function Br(r,u){u===void 0&&(u=Ki);var t,e=[],h,l=!1;function d(){for(var s=[],p=0;p<arguments.length;p++)s[p]=arguments[p];return l&&t===this&&u(s,e)||(h=r.apply(this,s),l=!0,t=this,e=s),h}return d}var Gi=typeof performance=="object"&&typeof performance.now=="function",tn=Gi?function(){return performance.now()}:function(){return Date.now()};function rn(r){cancelAnimationFrame(r.id)}function Xi(r,u){var t=tn();function e(){tn()-t>=u?r.call(null):h.id=requestAnimationFrame(e)}var h={id:requestAnimationFrame(e)};return h}var Ar=-1;function nn(r){if(r===void 0&&(r=!1),Ar===-1||r){var u=document.createElement("div"),t=u.style;t.width="50px",t.height="50px",t.overflow="scroll",document.body.appendChild(u),Ar=u.offsetWidth-u.clientWidth,document.body.removeChild(u)}return Ar}var Q0=null;function an(r){if(r===void 0&&(r=!1),Q0===null||r){var u=document.createElement("div"),t=u.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";var e=document.createElement("div"),h=e.style;return h.width="100px",h.height="100px",u.appendChild(e),document.body.appendChild(u),u.scrollLeft>0?Q0="positive-descending":(u.scrollLeft=1,u.scrollLeft===0?Q0="negative":Q0="positive-ascending"),document.body.removeChild(u),Q0}return Q0}var Yi=150,Qi=function(u,t){return u};function Zi(r){var u,t=r.getItemOffset,e=r.getEstimatedTotalSize,h=r.getItemSize,l=r.getOffsetForIndexAndAlignment,d=r.getStartIndexForOffset,s=r.getStopIndexForStartIndex,p=r.initInstanceProps,n=r.shouldResetStyleCacheOnItemSizeChange,o=r.validateProps;return u=(function(E){ji(c,E);function c(y){var i;return i=E.call(this,y)||this,i._instanceProps=p(i.props,Xr(i)),i._outerRef=void 0,i._resetIsScrollingTimeoutId=null,i.state={instance:Xr(i),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof i.props.initialScrollOffset=="number"?i.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},i._callOnItemsRendered=void 0,i._callOnItemsRendered=Br(function(a,v,f,x){return i.props.onItemsRendered({overscanStartIndex:a,overscanStopIndex:v,visibleStartIndex:f,visibleStopIndex:x})}),i._callOnScroll=void 0,i._callOnScroll=Br(function(a,v,f){return i.props.onScroll({scrollDirection:a,scrollOffset:v,scrollUpdateWasRequested:f})}),i._getItemStyle=void 0,i._getItemStyle=function(a){var v=i.props,f=v.direction,x=v.itemSize,F=v.layout,_=i._getItemStyleCache(n&&x,n&&F,n&&f),b;if(_.hasOwnProperty(a))b=_[a];else{var I=t(i.props,a,i._instanceProps),N=h(i.props,a,i._instanceProps),z=f==="horizontal"||F==="horizontal",w=f==="rtl",B=z?I:0;_[a]=b={position:"absolute",left:w?void 0:B,right:w?B:void 0,top:z?0:I,height:z?"100%":N,width:z?N:"100%"}}return b},i._getItemStyleCache=void 0,i._getItemStyleCache=Br(function(a,v,f){return{}}),i._onScrollHorizontal=function(a){var v=a.currentTarget,f=v.clientWidth,x=v.scrollLeft,F=v.scrollWidth;i.setState(function(_){if(_.scrollOffset===x)return null;var b=i.props.direction,I=x;if(b==="rtl")switch(an()){case"negative":I=-x;break;case"positive-descending":I=F-f-x;break}return I=Math.max(0,Math.min(I,F-f)),{isScrolling:!0,scrollDirection:_.scrollOffset<I?"forward":"backward",scrollOffset:I,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._onScrollVertical=function(a){var v=a.currentTarget,f=v.clientHeight,x=v.scrollHeight,F=v.scrollTop;i.setState(function(_){if(_.scrollOffset===F)return null;var b=Math.max(0,Math.min(F,x-f));return{isScrolling:!0,scrollDirection:_.scrollOffset<b?"forward":"backward",scrollOffset:b,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._outerRefSetter=function(a){var v=i.props.outerRef;i._outerRef=a,typeof v=="function"?v(a):v!=null&&typeof v=="object"&&v.hasOwnProperty("current")&&(v.current=a)},i._resetIsScrollingDebounced=function(){i._resetIsScrollingTimeoutId!==null&&rn(i._resetIsScrollingTimeoutId),i._resetIsScrollingTimeoutId=Xi(i._resetIsScrolling,Yi)},i._resetIsScrolling=function(){i._resetIsScrollingTimeoutId=null,i.setState({isScrolling:!1},function(){i._getItemStyleCache(-1,null)})},i}c.getDerivedStateFromProps=function(i,a){return Ji(i,a),o(i),null};var m=c.prototype;return m.scrollTo=function(i){i=Math.max(0,i),this.setState(function(a){return a.scrollOffset===i?null:{scrollDirection:a.scrollOffset<i?"forward":"backward",scrollOffset:i,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(i,a){a===void 0&&(a="auto");var v=this.props,f=v.itemCount,x=v.layout,F=this.state.scrollOffset;i=Math.max(0,Math.min(i,f-1));var _=0;if(this._outerRef){var b=this._outerRef;x==="vertical"?_=b.scrollWidth>b.clientWidth?nn():0:_=b.scrollHeight>b.clientHeight?nn():0}this.scrollTo(l(this.props,i,a,F,this._instanceProps,_))},m.componentDidMount=function(){var i=this.props,a=i.direction,v=i.initialScrollOffset,f=i.layout;if(typeof v=="number"&&this._outerRef!=null){var x=this._outerRef;a==="horizontal"||f==="horizontal"?x.scrollLeft=v:x.scrollTop=v}this._callPropsCallbacks()},m.componentDidUpdate=function(){var i=this.props,a=i.direction,v=i.layout,f=this.state,x=f.scrollOffset,F=f.scrollUpdateWasRequested;if(F&&this._outerRef!=null){var _=this._outerRef;if(a==="horizontal"||v==="horizontal")if(a==="rtl")switch(an()){case"negative":_.scrollLeft=-x;break;case"positive-ascending":_.scrollLeft=x;break;default:var b=_.clientWidth,I=_.scrollWidth;_.scrollLeft=I-b-x;break}else _.scrollLeft=x;else _.scrollTop=x}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&rn(this._resetIsScrollingTimeoutId)},m.render=function(){var i=this.props,a=i.children,v=i.className,f=i.direction,x=i.height,F=i.innerRef,_=i.innerElementType,b=i.innerTagName,I=i.itemCount,N=i.itemData,z=i.itemKey,w=z===void 0?Qi:z,B=i.layout,D=i.outerElementType,g=i.outerTagName,q=i.style,U=i.useIsScrolling,G=i.width,Y=this.state.isScrolling,M=f==="horizontal"||B==="horizontal",H=M?this._onScrollHorizontal:this._onScrollVertical,Z=this._getRangeToRender(),P=Z[0],T=Z[1],S=[];if(I>0)for(var R=P;R<=T;R++)S.push(mr(a,{data:N,key:w(R,N),index:R,isScrolling:U?Y:void 0,style:this._getItemStyle(R)}));var $=e(this.props,this._instanceProps);return mr(D||g||"div",{className:v,onScroll:H,ref:this._outerRefSetter,style:Xa({position:"relative",height:x,width:G,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},q)},mr(_||b||"div",{children:S,ref:F,style:{height:M?"100%":$,pointerEvents:Y?"none":void 0,width:M?$:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var i=this.props.itemCount;if(i>0){var a=this._getRangeToRender(),v=a[0],f=a[1],x=a[2],F=a[3];this._callOnItemsRendered(v,f,x,F)}}if(typeof this.props.onScroll=="function"){var _=this.state,b=_.scrollDirection,I=_.scrollOffset,N=_.scrollUpdateWasRequested;this._callOnScroll(b,I,N)}},m._getRangeToRender=function(){var i=this.props,a=i.itemCount,v=i.overscanCount,f=this.state,x=f.isScrolling,F=f.scrollDirection,_=f.scrollOffset;if(a===0)return[0,0,0,0];var b=d(this.props,_,this._instanceProps),I=s(this.props,b,_,this._instanceProps),N=!x||F==="backward"?Math.max(1,v):1,z=!x||F==="forward"?Math.max(1,v):1;return[Math.max(0,b-N),Math.max(0,Math.min(a-1,I+z)),b,I]},c})(Wa),u.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},u}var Ji=function(u,t){u.children,u.direction,u.height,u.layout,u.innerTagName,u.outerTagName,u.width,t.instance},eo=50,et=function(u,t,e){var h=u,l=h.itemSize,d=e.itemMetadataMap,s=e.lastMeasuredIndex;if(t>s){var p=0;if(s>=0){var n=d[s];p=n.offset+n.size}for(var o=s+1;o<=t;o++){var E=l(o);d[o]={offset:p,size:E},p+=E}e.lastMeasuredIndex=t}return d[t]},to=function(u,t,e){var h=t.itemMetadataMap,l=t.lastMeasuredIndex,d=l>0?h[l].offset:0;return d>=e?ha(u,t,l,0,e):ro(u,t,Math.max(0,l),e)},ha=function(u,t,e,h,l){for(;h<=e;){var d=h+Math.floor((e-h)/2),s=et(u,d,t).offset;if(s===l)return d;s<l?h=d+1:s>l&&(e=d-1)}return h>0?h-1:0},ro=function(u,t,e,h){for(var l=u.itemCount,d=1;e<l&&et(u,e,t).offset<h;)e+=d,d*=2;return ha(u,t,Math.min(e,l-1),Math.floor(e/2),h)},on=function(u,t){var e=u.itemCount,h=t.itemMetadataMap,l=t.estimatedItemSize,d=t.lastMeasuredIndex,s=0;if(d>=e&&(d=e-1),d>=0){var p=h[d];s=p.offset+p.size}var n=e-d-1,o=n*l;return s+o},no=Zi({getItemOffset:function(u,t,e){return et(u,t,e).offset},getItemSize:function(u,t,e){return e.itemMetadataMap[t].size},getEstimatedTotalSize:on,getOffsetForIndexAndAlignment:function(u,t,e,h,l,d){var s=u.direction,p=u.height,n=u.layout,o=u.width,E=s==="horizontal"||n==="horizontal",c=E?o:p,m=et(u,t,l),y=on(u,l),i=Math.max(0,Math.min(y-c,m.offset)),a=Math.max(0,m.offset-c+m.size+d);switch(e==="smart"&&(h>=a-c&&h<=i+c?e="auto":e="center"),e){case"start":return i;case"end":return a;case"center":return Math.round(a+(i-a)/2);case"auto":default:return h>=a&&h<=i?h:h<a?a:i}},getStartIndexForOffset:function(u,t,e){return to(u,e,t)},getStopIndexForStartIndex:function(u,t,e,h){for(var l=u.direction,d=u.height,s=u.itemCount,p=u.layout,n=u.width,o=l==="horizontal"||p==="horizontal",E=o?n:d,c=et(u,t,h),m=e+E,y=c.offset+c.size,i=t;i<s-1&&y<m;)i++,y+=et(u,i,h).size;return i},initInstanceProps:function(u,t){var e=u,h=e.estimatedItemSize,l={itemMetadataMap:{},estimatedItemSize:h||eo,lastMeasuredIndex:-1};return t.resetAfterIndex=function(d,s){s===void 0&&(s=!0),l.lastMeasuredIndex=Math.min(l.lastMeasuredIndex,d-1),t._getItemStyleCache(-1),s&&t.forceUpdate()},l},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(u){u.itemSize}});function ao({isActive:r,isNew:u,isDisabled:t,data:e,eventsEmit:h,styles:l={},assistantList:d=[]}){const{messages:s}=fr(),[p,n]=se(!1),o=(l==null?void 0:l.colors)||{},E=Ae(()=>{const v=e==null?void 0:e.configId;if(!v||!d||d.length===0)return s.sidebar.noAssistant;const f=d.find(x=>String(x==null?void 0:x.id)===String(v));if(!f)return s.sidebar.noAssistant;if(f!=null&&f.name)return f.name;try{const x=typeof f.configJson=="string"?JSON.parse(f.configJson):f.configJson;return(x==null?void 0:x.config_name)||s.sidebar.noAssistant}catch{return s.sidebar.noAssistant}},[d,e==null?void 0:e.configId,s.sidebar.noAssistant]),c=[{key:"rename",icon:k(qi,{size:12}),label:s.sidebar.rename,onClick:v=>{v.domEvent.stopPropagation(),h&&h("conversations:rename_icon_clicked",e)}},{key:"delete",icon:k(Li,{size:12}),label:s.sidebar.delete,danger:!0,onClick:v=>{v.domEvent.stopPropagation(),h&&h("conversations:delete_icon_clicked",e)}}],m=r?o.activeItemBg||"#f0f4ff":p?o.itemHoverBg||"#f5f7fa":o.itemBg||"transparent",y=r?o.activeItemText||o.primary||"#0122ff":o.itemText||"#333",i=r?o.activeItemBorder||o.primary||"#0122ff":"transparent",a=v=>{const f=Jr(),x=Jr(v);return f.isSame(x,"day")?x.format("HH:mm"):x.format("MM-DD HH:mm")};return Q("div",{className:"flex relative items-center justify-between mb-2 px-4 py-3 rounded-md transition-colors cursor-pointer select-none",onClick:()=>!t&&h&&h("conversation:item_click",e),onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{minHeight:48,background:m,color:y,border:`1px solid ${i}`,...l.item,opacity:t?.5:1},children:[Q("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:e.label||s.sidebar.unnamedSession,style:{color:y,fontSize:"14px",lineHeight:"1.4"},children:e.label||s.sidebar.unnamedSession}),Q("div",{className:"flex items-center justify-between gap-2",children:[k("span",{className:"text-xs truncate flex-1",style:{color:r?o.activeItemTextSecondary||"#666":o.itemTextSecondary||"#666",fontSize:"12px",lineHeight:"1.3"},children:E}),e.gmtModified&&k("span",{className:"text-xs flex-shrink-0",style:{color:r?o.activeItemTextSecondary||"#999":o.itemTextSecondary||"#999",fontSize:"12px",lineHeight:"1.3"},children:a(e.gmtModified)})]})]}),!t&&p&&!u&&k("div",{className:"absolute top-2 right-3",children:k(_i,{menu:{items:c},trigger:["click"],placement:"bottomRight",children:k(Pi,{size:16,className:"text-gray-600 hover:text-gray-800",style:{cursor:"pointer",color:r?o.activeItemTextSecondary||"#999":o.itemTextSecondary||"#999"},onClick:v=>v.stopPropagation()})})})]})}function io(r,u=[{label:"\u5F53\u5929",dayPeriod:1}]){const t=new Date,e={other:[]};return r.forEach(h=>{const l=new Date(h.gmtModified),d=Math.floor((+t-+l)/(1e3*60*60*24));let s=!1;for(const p of u)if(d<=p.dayPeriod){e[p.label]||(e[p.label]=[]),e[p.label].push(h),s=!0;break}s||e.other.push(h)}),e}/*! @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 Rr(r){if(r.constructor!==Array)throw new TypeError("Expected array.");if(r.length===16)return r;if(r.length===6){var u=it();return u[0]=r[0],u[1]=r[1],u[4]=r[2],u[5]=r[3],u[12]=r[4],u[13]=r[5],u}throw new RangeError("Expected array with either 6 or 16 values.")}function it(){for(var r=[],u=0;u<16;u++)u%5==0?r.push(1):r.push(0);return r}function oo(r,u){for(var t=Rr(r),e=Rr(u),h=[],l=0;l<4;l++)for(var d=[t[l],t[l+4],t[l+8],t[l+12]],s=0;s<4;s++){var p=s*4,n=[e[p],e[p+1],e[p+2],e[p+3]],o=d[0]*n[0]+d[1]*n[1]+d[2]*n[2]+d[3]*n[3];h[l+p]=o}return h}function so(r){if(typeof r=="string"){var u=r.match(/matrix(3d)?\(([^)]+)\)/);if(u){var t=u[2].split(", ").map(parseFloat);return Rr(t)}}return it()}function uo(r){var u=it();return u[0]=r,u}function lo(r){var u=it();return u[5]=r,u}function co(r){var u=it();return u[12]=r,u}function fo(r){var u=it();return u[13]=r,u}var bt=function(r){return typeof r=="number"},va=function(r){return typeof r=="function"},ga=function(r){return Object.prototype.toString.call(r)==="[object Object]"},tt=function(r){return Array.prototype.slice.apply(r)},ma=function(r){var u=r.reduce(function(t,e){return t[e]=(t[e]||0)+1,t},{});return Object.keys(u).filter(function(t){return u[t]>1})};function I0(r){return[].slice.call(arguments,1).forEach(function(u){if(u)for(var t in u)Object.prototype.hasOwnProperty.call(u,t)&&(r[t]=u[t])}),r}var Nr,Pr=function(r,u,t){return r+(u-r)*t},ya={__proto__:null,isNumber:bt,isFunction:va,isObject:ga,toArray:tt,getDuplicateValsAsStrings:ma,assign:I0,tweenProp:Pr},Mr="data-flip-id",Ur="data-inverse-flip-id",Hr="data-portal-key",xo="data-exit-container",At={__proto__:null,DATA_FLIP_ID:Mr,DATA_INVERSE_FLIP_ID:Ur,DATA_FLIP_CONFIG:"data-flip-config",DATA_PORTAL_KEY:Hr},Tr={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}},sn=function(r){return ga(r)?r:Object.keys(Tr).indexOf(r)>-1?Tr[r]:{}};typeof window<"u"&&(Nr=window.requestAnimationFrame);var po=Nr=Nr||function(r){window.setTimeout(r,1e3/60)},ho=Date.now(),vo=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()-ho};function Ca(r,u){var t=r.indexOf(u);t!==-1&&r.splice(t,1)}var go=(function(){function r(){}return r.prototype.run=function(){var u=this;po(function(){u.springSystem.loop(vo())})},r})(),br=function(){this.position=0,this.velocity=0},mo=0,p0=.001,yo=(function(){function r(t){this._id="s"+mo++,this._springSystem=t,this.listeners=[],this._startValue=0,this._currentState=new br,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new br,this._restSpeedThreshold=.001,this._tempState=new br,this._timeAccumulator=0,this._wasAtRest=!0,this._cachedSpringConfig={}}var u=r.prototype;return u.getId=function(){return this._id},u.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this)},u.setSpringConfig=function(t){return this._springConfig=t,this},u.getCurrentValue=function(){return this._currentState.position},u.getDisplacementDistanceForState=function(t){return Math.abs(this._endValue-t.position)},u.setEndValue=function(t){if(t===this._endValue)return this;if(this.prevEndValue=t,this._endValue===t&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=t,this._springSystem.activateSpring(this.getId());for(var e=0,h=this.listeners.length;e<h;e++){var l=this.listeners[e].onSpringEndStateChange;l&&l(this)}return this},u.setVelocity=function(t){return t===this._currentState.velocity||(this._currentState.velocity=t,this._springSystem.activateSpring(this.getId())),this},u.setCurrentValue=function(t){this._startValue=t,this._currentState.position=t;for(var e=0,h=this.listeners.length;e<h;e++){var l=this.listeners[e];l.onSpringUpdate&&l.onSpringUpdate(this)}return this},u.setAtRest=function(){return this._endValue=this._currentState.position,this._tempState.position=this._currentState.position,this._currentState.velocity=0,this},u.setOvershootClampingEnabled=function(t){return this._overshootClampingEnabled=t,this},u.isOvershooting=function(){var t=this._startValue,e=this._endValue;return this._springConfig.tension>0&&(t<e&&this.getCurrentValue()>e||t>e&&this.getCurrentValue()<e)},u.advance=function(t,e){var h=this.isAtRest();if(!h||!this._wasAtRest){var l=e;e>.064&&(l=.064),this._timeAccumulator+=l;for(var d,s,p,n,o,E,c=this._springConfig.tension,m=this._springConfig.friction,y=this._currentState.position,i=this._currentState.velocity,a=this._tempState.position,v=this._tempState.velocity;this._timeAccumulator>=p0;)this._timeAccumulator-=p0,this._timeAccumulator<p0&&(this._previousState.position=y,this._previousState.velocity=i),s=c*(this._endValue-a)-m*i,n=c*(this._endValue-(a=y+(d=i)*p0*.5))-m*(v=i+s*p0*.5),E=c*(this._endValue-(a=y+(p=v)*p0*.5))-m*(v=i+n*p0*.5),a=y+(o=v)*p0,y+=1/6*(d+2*(p+o)+(v=i+E*p0))*p0,i+=1/6*(s+2*(n+E)+(c*(this._endValue-a)-m*v))*p0;this._tempState.position=a,this._tempState.velocity=v,this._currentState.position=y,this._currentState.velocity=i,this._timeAccumulator>0&&this._interpolate(this._timeAccumulator/p0),(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),h=!0);var f=!1;this._wasAtRest&&(this._wasAtRest=!1,f=!0);var x=!1;h&&(this._wasAtRest=!0,x=!0),this.notifyPositionUpdated(f,x)}},u.notifyPositionUpdated=function(t,e){var h=this;this.listeners.filter(Boolean).forEach(function(l){t&&l.onSpringActivate&&!h._onActivateCalled&&(l.onSpringActivate(h),h._onActivateCalled=!0),l.onSpringUpdate&&l.onSpringUpdate(h),e&&l.onSpringAtRest&&l.onSpringAtRest(h)})},u.systemShouldAdvance=function(){return!this.isAtRest()||!this.wasAtRest()},u.wasAtRest=function(){return this._wasAtRest},u.isAtRest=function(){return Math.abs(this._currentState.velocity)<this._restSpeedThreshold&&(this.getDisplacementDistanceForState(this._currentState)<=this._displacementFromRestThreshold||this._springConfig.tension===0)},u._interpolate=function(t){this._currentState.position=this._currentState.position*t+this._previousState.position*(1-t),this._currentState.velocity=this._currentState.velocity*t+this._previousState.velocity*(1-t)},u.addListener=function(t){return this.listeners.push(t),this},u.addOneTimeListener=function(t){var e=this;return Object.keys(t).forEach(function(h){var l;t[h]=(l=t[h],function(){l.apply(void 0,[].slice.call(arguments)),e.removeListener(t)})}),this.listeners.push(t),this},u.removeListener=function(t){return Ca(this.listeners,t),this},r})(),Fa=(function(){function r(t){this.looper=t||new go,this.looper.springSystem=this,this.listeners=[],this._activeSprings=[],this._idleSpringIndices=[],this._isIdle=!0,this._lastTimeMillis=-1,this._springRegistry={}}var u=r.prototype;return u.createSpring=function(t,e){return this.createSpringWithConfig({tension:t,friction:e})},u.createSpringWithConfig=function(t){var e=new yo(this);return this.registerSpring(e),e.setSpringConfig(t),e},u.getIsIdle=function(){return this._isIdle},u.registerSpring=function(t){this._springRegistry[t.getId()]=t},u.deregisterSpring=function(t){Ca(this._activeSprings,t),delete this._springRegistry[t.getId()]},u.advance=function(t,e){for(var h=this;this._idleSpringIndices.length>0;)this._idleSpringIndices.pop();for(this._activeSprings.filter(Boolean).forEach(function(d){d.systemShouldAdvance()?d.advance(t/1e3,e/1e3):h._idleSpringIndices.push(h._activeSprings.indexOf(d))});this._idleSpringIndices.length>0;){var l=this._idleSpringIndices.pop();l>=0&&this._activeSprings.splice(l,1)}},u.loop=function(t){var e;this._lastTimeMillis===-1&&(this._lastTimeMillis=t-1);var h=t-this._lastTimeMillis;this._lastTimeMillis=t;var l=0,d=this.listeners.length;for(l=0;l<d;l++)(e=this.listeners[l]).onBeforeIntegrate&&e.onBeforeIntegrate(this);for(this.advance(t,h),this._activeSprings.length===0&&(this._isIdle=!0,this._lastTimeMillis=-1),l=0;l<d;l++)(e=this.listeners[l]).onAfterIntegrate&&e.onAfterIntegrate(this);this._isIdle||this.looper.run()},u.activateSpring=function(t){var e=this._springRegistry[t];this._activeSprings.indexOf(e)===-1&&this._activeSprings.push(e),this.getIsIdle()&&(this._isIdle=!1,this.looper.run())},r})(),Co=new Fa,Ea=function(r){var u=r.springConfig,t=u.overshootClamping,e=r.getOnUpdateFunc,h=r.onAnimationEnd,l=r.onSpringActivate,d=Co.createSpring(u.stiffness,u.damping);d.setOvershootClampingEnabled(!!t);var s={onSpringActivate:l,onSpringAtRest:function(){d.destroy(),h()},onSpringUpdate:e({spring:d,onAnimationEnd:h})};return d.addListener(s),d},un=function(r){var u=Ea(r);return u.setEndValue(1),u},ln=function(r,u){if(u===void 0&&(u={}),r&&r.length){u.reverse&&r.reverse();var t,e=typeof(t=u.speed)!="number"?1.1:1+Math.min(Math.max(5*t,0),5),h=1/Math.max(Math.min(r.length,100),10),l=r.map(function(d,s){var p=d.getOnUpdateFunc;return d.getOnUpdateFunc=function(n){var o=p(n);return function(E){var c=E.getCurrentValue();(c=c<.01?0:c>.99?1:c)>=h&&l[s+1]&&l[s+1](Math.max(Math.min(c*e,1),0)),o(E)}},d}).map(function(d){var s=Ea(d);if(s)return s.setEndValue.bind(s)}).filter(Boolean);l[0]&&l[0](1)}},cn=function(r){return[0,1,4,5,12,13].map(function(u){return r[u]})},dn=function(r){return r.top<window.innerHeight&&r.bottom>0&&r.left<window.innerWidth&&r.right>0};function fn(r){return JSON.parse(r.dataset.flipConfig||"{}")}var Ba=function(r,u){var t;return I0(r,((t={})[u[0]]=u[1],t))},Aa=function(r,u){return tt(u?document.querySelectorAll("["+Hr+'="'+u+'"]'):r.querySelectorAll("["+Mr+"]"))},ba=function(r){return r.map(function(u){return[u,u.getBoundingClientRect()]})},Fo=function(r){var u=r.cachedOrderedFlipIds,t=u===void 0?[]:u,e=r.inProgressAnimations,h=e===void 0?{}:e,l=r.flippedElementPositionsBeforeUpdate,d=l===void 0?{}:l,s=r.flipCallbacks,p=s===void 0?{}:s,n=r.containerEl,o=r.applyTransformOrigin,E=r.spring,c=r.debug,m=r.portalKey,y=r.staggerConfig,i=y===void 0?{}:y,a=r.decisionData,v=a===void 0?{}:a,f=r.handleEnterUpdateDelete,x=r.onComplete,F=r.onStart;if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var _,b=ba(Aa((_={element:n,portalKey:m}).element,_.portalKey)).map(function(M){var H=M[0],Z=M[1],P=window.getComputedStyle(H);return[H.dataset.flipId,{element:H,rect:Z,opacity:parseFloat(P.opacity),transform:P.transform}]}).reduce(Ba,{}),I=(function(M){var H=M.containerEl,Z=M.portalKey;return Z?(function(P){return function(T){return tt(document.querySelectorAll("["+Hr+'="'+P+'"]'+T))}})(Z):H?(function(P){var T=Math.random().toFixed(5);return P.dataset.flipperId=T,function(S){return tt(P.querySelectorAll('[data-flipper-id="'+T+'"] '+S))}})(H):function(){return[]}})({containerEl:n,portalKey:m}),N=(function(M){return function(H){return M("["+Mr+'="'+H+'"]')[0]}})(I),z=function(M){return d[M]&&b[M]},w=Object.keys(d).concat(Object.keys(b)).filter(function(M){return!z(M)}),B={flipCallbacks:p,getElement:N,flippedElementPositionsBeforeUpdate:d,flippedElementPositionsAfterUpdate:b,inProgressAnimations:h,decisionData:v},D=(function(M){var H,Z=M.unflippedIds,P=M.flipCallbacks,T=M.getElement,S=M.flippedElementPositionsBeforeUpdate,R=M.flippedElementPositionsAfterUpdate,$=M.inProgressAnimations,j=M.decisionData,X=Z.filter(function(ue){return R[ue]}).filter(function(ue){return P[ue]&&P[ue].onAppear}),W=Z.filter(function(ue){return S[ue]&&P[ue]&&P[ue].onExit}),ie=new Promise(function(ue){H=ue}),pe=[],o0=0,Se=W.map(function(ue,ye){var Ce=S[ue].domDataForExitAnimations,Te=Ce.element,Ze=Ce.parent,Je=Ce.childPosition,e0=Je.top,f0=Je.left,ze=Je.width,Ne=Je.height;getComputedStyle(Ze).position==="static"&&(Ze.style.position="relative"),Te.style.transform="matrix(1, 0, 0, 1, 0, 0)",Te.style.position="absolute",Te.style.top=e0+"px",Te.style.left=f0+"px",Te.style.height=Ne+"px",Te.style.width=ze+"px";var ke=pe.filter(function(h0){return h0[0]===Ze})[0];ke||(ke=[Ze,document.createDocumentFragment()],pe.push(ke)),ke[1].appendChild(Te),o0+=1;var Xe=function(){try{Ze.removeChild(Te)}catch{}finally{(o0-=1)==0&&H()}};return $[ue]={stop:Xe},function(){return P[ue].onExit(Te,ye,Xe,j)}});return pe.forEach(function(ue){ue[0].appendChild(ue[1])}),Se.length||H(),{hideEnteringElements:function(){X.forEach(function(ue){var ye=T(ue);ye&&(ye.style.opacity="0")})},animateEnteringElements:function(){X.forEach(function(ue,ye){var Ce=T(ue);Ce&&P[ue].onAppear(Ce,ye,j)})},animateExitingElements:function(){return Se.forEach(function(ue){return ue()}),ie}}})(I0({},B,{unflippedIds:w})),g=D.hideEnteringElements,q=D.animateEnteringElements,U=D.animateExitingElements,G=I0({},B,{containerEl:n,flippedIds:t.filter(z),applyTransformOrigin:o,spring:E,debug:c,staggerConfig:i,scopedSelector:I,onComplete:x});F&&F(n,v);var Y=(function(M){var H,Z=M.flippedIds,P=M.flipCallbacks,T=M.inProgressAnimations,S=M.flippedElementPositionsBeforeUpdate,R=M.flippedElementPositionsAfterUpdate,$=M.applyTransformOrigin,j=M.spring,X=M.getElement,W=M.debug,ie=M.staggerConfig,pe=ie===void 0?{}:ie,o0=M.decisionData,Se=o0===void 0?{}:o0,ue=M.onComplete,ye=M.containerEl,Ce=new Promise(function(V){H=V});if(ue&&Ce.then(function(){return ue(ye,Se)}),!Z.length)return function(){return H([]),Ce};var Te=[],Ze=X(Z[0]),Je=Ze?Ze.ownerDocument.querySelector("body"):document.querySelector("body");ma(Z);var e0=Z.map(function(V){var xe=S[V].rect,De=R[V].rect,Ye=S[V].opacity,N0=R[V].opacity,Ve=De.width<1||De.height<1,he=R[V].element;if(!dn(xe)&&!dn(De)||!he)return!1;var P0,W0,T0,n0=fn(he),z0=(T0=(W0=(P0={flipperSpring:j,flippedSpring:n0.spring})===void 0?{}:P0).flippedSpring,I0({},Tr.noWobble,sn(W0.flipperSpring),sn(T0))),q0=n0.stagger===!0?"default":n0.stagger,L0={element:he,id:V,stagger:q0,springConfig:z0};if(P[V]&&P[V].shouldFlip&&!P[V].shouldFlip(Se.previous,Se.current))return!1;var j0=Math.abs(xe.left-De.left)+Math.abs(xe.top-De.top),ot=Math.abs(xe.width-De.width)+Math.abs(xe.height-De.height),st=Math.abs(N0-Ye);if(xe.height===0&&De.height===0||xe.width===0&&De.width===0||j0<.5&&ot<.5&&st<.01)return!1;var V0=so(R[V].transform),s0={matrix:V0},x0={matrix:[]},F0=[V0];n0.translate&&(F0.push(co(xe.left-De.left)),F0.push(fo(xe.top-De.top))),n0.scale&&(F0.push(uo(Math.max(xe.width,1)/Math.max(De.width,1))),F0.push(lo(Math.max(xe.height,1)/Math.max(De.height,1)))),n0.opacity&&(x0.opacity=Ye,s0.opacity=N0);var E0=[];if(!P[V]||!P[V].shouldInvert||P[V].shouldInvert(Se.previous,Se.current)){var ut=(function(_e,He){return tt(_e.querySelectorAll("["+Ur+'="'+He+'"]'))})(he,V);E0=ut.map(function(_e){return[_e,fn(_e)]})}x0.matrix=cn(F0.reduce(oo)),s0.matrix=cn(s0.matrix);var Le,oe=(function(_e){var He=_e.element,u0=_e.invertedChildren,D0=_e.body;return function(S0){var v0=S0.matrix,O0=S0.opacity,K0=S0.forceMinVals;if(bt(O0)&&(He.style.opacity=O0+""),K0&&(He.style.minHeight="1px",He.style.minWidth="1px"),v0){var G0=(function(M0){return"matrix("+M0.join(", ")+")"})(v0);He.style.transform=G0,u0&&(function(M0){var X0=M0.matrix,hr=M0.body;M0.invertedChildren.forEach(function(dt){var ft=dt[0],xt=dt[1];if(hr.contains(ft)){var pt=X0[0],ht=X0[3],vr=X0[5],l0={translateX:0,translateY:0,scaleX:1,scaleY:1},lt="";xt.translate&&(l0.translateX=-X0[4]/pt,l0.translateY=-vr/ht,lt+="translate("+l0.translateX+"px, "+l0.translateY+"px)"),xt.scale&&(l0.scaleX=1/pt,l0.scaleY=1/ht,lt+=" scale("+l0.scaleX+", "+l0.scaleY+")"),ft.style.transform=lt}})})({invertedChildren:u0,matrix:v0,body:D0})}}})({element:he,invertedChildren:E0,body:Je});if(P[V]&&P[V].onComplete){var b0=P[V].onComplete;Le=function(){return b0(he,Se)}}var Oe=bt(x0.opacity)&&bt(s0.opacity)&&x0.opacity!==s0.opacity,Ke=!1;return I0({},L0,{stagger:q0,springConfig:z0,getOnUpdateFunc:function(_e){var He=_e.spring,u0=_e.onAnimationEnd;return T[V]={destroy:He.destroy.bind(He),onAnimationEnd:u0},function(D0){P[V]&&P[V].onSpringUpdate&&P[V].onSpringUpdate(D0.getCurrentValue()),Ke||(Ke=!0,P[V]&&P[V].onStart&&P[V].onStart(he,Se));var S0=D0.getCurrentValue();if(Je.contains(he)){var v0={matrix:[]};v0.matrix=x0.matrix.map(function(O0,K0){return Pr(O0,s0.matrix[K0],S0)}),Oe&&(v0.opacity=Pr(x0.opacity,s0.opacity,S0)),oe(v0)}else D0.destroy()}},initializeFlip:function(){oe({matrix:x0.matrix,opacity:Oe?x0.opacity:void 0,forceMinVals:Ve}),P[V]&&P[V].onStartImmediate&&P[V].onStartImmediate(he,Se),n0.transformOrigin?he.style.transformOrigin=n0.transformOrigin:$&&(he.style.transformOrigin="0 0"),E0.forEach(function(_e){var He=_e[0],u0=_e[1];u0.transformOrigin?He.style.transformOrigin=u0.transformOrigin:$&&(He.style.transformOrigin="0 0")})},onAnimationEnd:function(_e){delete T[V],va(Le)&&Le(),he.style.transform="",E0.forEach(function(He){He[0].style.transform=""}),Ve&&he&&(he.style.minHeight="",he.style.minWidth=""),_e||(Te.push(V),Te.length>=e0.length&&H(Te))},delayUntil:n0.delayUntil})}).filter(Boolean);if(e0.forEach(function(V){return(0,V.initializeFlip)()}),W)return function(){};var f0=e0.filter(function(V){return V.delayUntil&&(xe=V.delayUntil,e0.filter(function(De){return De.id===xe}).length);var xe}),ze={},Ne={},ke={};f0.forEach(function(V){V.stagger?(ke[V.stagger]=!0,Ne[V.delayUntil]?Ne[V.delayUntil].push(V.stagger):Ne[V.delayUntil]=[V.stagger]):ze[V.delayUntil]?ze[V.delayUntil].push(V):ze[V.delayUntil]=[V]});var Xe=e0.filter(function(V){return V.stagger}).reduce(function(V,xe){return V[xe.stagger]?V[xe.stagger].push(xe):V[xe.stagger]=[xe],V},{}),h0=e0.filter(function(V){return f0.indexOf(V)===-1});return h0.forEach(function(V){V.onSpringActivate=function(){ze[V.id]&&ze[V.id].forEach(un),Ne[V.id]&&Object.keys(Ne[V.id].reduce(function(xe,De){var Ye;return I0(xe,((Ye={})[De]=!0,Ye))},{})).forEach(function(xe){ln(Xe[xe],pe[xe])})}}),function(){return e0.length||H([]),h0.filter(function(V){return!V.stagger}).forEach(un),Object.keys(Xe).forEach(function(V){ke[V]||ln(Xe[V],pe[V])}),Ce}})(G);f?f({hideEnteringElements:g,animateEnteringElements:q,animateExitingElements:U,animateFlippedElements:Y}):(g(),U().then(q),Y())}},Eo=function(r){var u=r.element,t=r.flipCallbacks,e=t===void 0?{}:t,h=r.inProgressAnimations,l=h===void 0?{}:h,d=Aa(u,r.portalKey),s=tt(u.querySelectorAll("["+Ur+"]")),p={},n=[],o={};d.filter(function(m){return e&&e[m.dataset.flipId]&&e[m.dataset.flipId].onExit}).forEach(function(m){var y=m.parentNode;if(m.closest){var i=m.closest("["+xo+"]");i&&(y=i)}var a=n.findIndex(function(v){return v[0]===y});a===-1&&(n.push([y,y.getBoundingClientRect()]),a=n.length-1),p[m.dataset.flipId]=n[a][1],o[m.dataset.flipId]=y});var E=ba(d),c=E.map(function(m){var y=m[0],i=m[1],a={};if(e&&e[y.dataset.flipId]&&e[y.dataset.flipId].onExit){var v=p[y.dataset.flipId];I0(a,{element:y,parent:o[y.dataset.flipId],childPosition:{top:i.top-v.top,left:i.left-v.left,width:i.width,height:i.height}})}return[y.dataset.flipId,{rect:i,opacity:parseFloat(window.getComputedStyle(y).opacity||"1"),domDataForExitAnimations:a}]}).reduce(Ba,{});return(function(m,y){Object.keys(m).forEach(function(i){m[i].destroy&&m[i].destroy(),m[i].onAnimationEnd&&m[i].onAnimationEnd(!0),delete m[i]}),y.forEach(function(i){i.style.transform="",i.style.opacity=""})})(l,d.concat(s)),{flippedElementPositions:c,cachedOrderedFlipIds:E.map(function(m){return m[0].dataset.flipId})}};new Fa;function cr(){return cr=Object.assign?Object.assign.bind():function(r){for(var u=1;u<arguments.length;u++){var t=arguments[u];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])}return r},cr.apply(this,arguments)}function zr(r,u){return zr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zr(r,u)}function Da(r,u){if(r==null)return{};var t,e,h={},l=Object.keys(r);for(e=0;e<l.length;e++)u.indexOf(t=l[e])>=0||(h[t]=r[t]);return h}var _a=Jn({}),wa=Jn("portal"),Sa=(function(r){var u,t;function e(){for(var l,d=arguments.length,s=new Array(d),p=0;p<d;p++)s[p]=arguments[p];return(l=r.call.apply(r,[this].concat(s))||this).inProgressAnimations={},l.flipCallbacks={},l.el=void 0,l}t=r,(u=e).prototype=Object.create(t.prototype),u.prototype.constructor=u,zr(u,t);var h=e.prototype;return h.getSnapshotBeforeUpdate=function(l){return l.flipKey!==this.props.flipKey&&this.el?Eo({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},h.componentDidUpdate=function(l,d,s){this.props.flipKey!==l.flipKey&&this.el&&Fo({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:l.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart})},h.render=function(){var l=this,d=this.props,s=d.portalKey,p=Re.createElement(_a.Provider,{value:this.flipCallbacks},Re.createElement(d.element,{className:d.className,ref:function(n){return l.el=n}},this.props.children));return s&&(p=Re.createElement(wa.Provider,{value:s},p)),p},e})(Ka);Sa.defaultProps={applyTransformOrigin:!0,element:"div"};var Bo=["children","flipId","inverseFlipId","portalKey"],Ao=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],xn=function(r){var u,t=r.children,e=r.flipId,h=r.inverseFlipId,l=r.portalKey,d=Da(r,Bo),s=t,p=(function(o){return typeof o=="function"})(s);if(!p)try{s=ja.only(t)}catch{throw new Error("Each Flipped component must wrap a single child")}d.scale||d.translate||d.opacity||ya.assign(d,{translate:!0,scale:!0,opacity:!0});var n=((u={})[At.DATA_FLIP_CONFIG]=JSON.stringify(d),u);return e!==void 0?n[At.DATA_FLIP_ID]=String(e):h&&(n[At.DATA_INVERSE_FLIP_ID]=String(h)),l!==void 0&&(n[At.DATA_PORTAL_KEY]=l),p?s(n):Va(s,n)},ka=function(r){var u=r.children,t=r.flipId,e=r.shouldFlip,h=r.shouldInvert,l=r.onAppear,d=r.onStart,s=r.onStartImmediate,p=r.onComplete,n=r.onExit,o=r.onSpringUpdate,E=Da(r,Ao);return u?E.inverseFlipId?Re.createElement(xn,cr({},E),u):Re.createElement(wa.Consumer,null,function(c){return Re.createElement(_a.Consumer,null,function(m){return ya.isObject(m)&&t&&(m[t]={shouldFlip:e,shouldInvert:h,onAppear:l,onStart:d,onStartImmediate:s,onComplete:p,onExit:n,onSpringUpdate:o}),Re.createElement(xn,cr({flipId:t},E,{portalKey:c}),u)})}):null};ka.displayName="Flipped";function bo(r){const{data:u,activedItem:t,onChange:e,onDelete:h,sortRules:l=[{label:"\u5F53\u5929",dayPeriod:1}],eventsEmit:d,assistantList:s,height:p=400,styles:n={},hasMore:o=!1,loadingMore:E=!1}=r,c=u.map(z=>z.sessionId+"-"+z.gmtModified).join(","),m=Ae(()=>{const z=l.length>0?l:[{label:"\u5F53\u5929",dayPeriod:1}],w=io(u,z),B=z.every(g=>!w[g.label]||w[g.label].length===0),D=[];return z.forEach(g=>{w[g.label]&&w[g.label].length>0&&(D.push({type:"group",label:g.label}),w[g.label].forEach(q=>D.push({type:"item",data:q})))}),w.other.length>0&&!B&&(D.push({type:"group",label:"\u5176\u4ED6"}),w.other.forEach(g=>D.push({type:"item",data:g}))),B&&w.other.length>0&&w.other.forEach(g=>D.push({type:"item",data:g})),D},[u,l,c]),y=Ae(()=>m.map(z=>z.type==="group"?`g:${z.label}`:`i:${z.data.sessionId}`).join("|"),[m]),i=56,a=14,v=36,f=z=>z===m.length?v:m[z].type==="group"?32:i+a,x=We(null),F=Ae(()=>m.findIndex(z=>{var w;return z.type==="item"&&((w=z.data)==null?void 0:w.sessionId)===t}),[m,t]),_=Ae(()=>m.findIndex(z=>z.type==="item"),[m]),b=We(void 0);be(()=>{const z=b.current;t!==z&&F>-1&&F===_&&x.current&&x.current.scrollToItem(F,"start"),b.current=t},[t,F,_]);const I=We(0);if(be(()=>{if(x.current){const z=I.current,w=m.length;if(I.current=w,w!==z){const D=(z>0?Math.abs(w-z)/z:1)>.5||z<10&&w>20;x.current.resetAfterIndex(0,D)}}},[m.length]),be(()=>{x.current&&x.current.resetAfterIndex(0,!0)},[y]),m.length===0)return k("div",{className:"text-center text-zinc-400 py-8",children:"\u6682\u65E0\u4F1A\u8BDD"});const N=(n==null?void 0:n.colors)||{};return k(Sa,{flipKey:c,spring:{stiffness:180,damping:18},children:k(no,{ref:x,height:p,width:"100%",itemCount:m.length+1,itemSize:f,itemKey:z=>{if(z===m.length)return"footer";const w=m[z];return w.type==="item"?w.data.sessionId:`group-${w.label}`},onItemsRendered:({visibleStopIndex:z})=>{o&&!E&&z>=m.length-1-3&&typeof d=="function"&&d("conversations:load_more")},style:{overflowX:"hidden"},children:({index:z,style:w})=>{if(z===m.length){const D=(n==null?void 0:n.colors)||{};return k("div",{style:{...w,height:v,lineHeight:`${v}px`,textAlign:"center",fontSize:"10px",color:D.textMuted||"#9ca3af",background:D.groupBg||"white"},children:E?"\u52A0\u8F7D\u4E2D...":o?"":"\u6CA1\u6709\u66F4\u591A\u4E86"})}const B=m[z];return B.type==="group"?k("div",{style:{...w,background:N.groupBg||"white",zIndex:1},className:"pt-2 pb-1 px-[28px] py-[2px] text-xs text-gray-400",children:B.label}):k(ka,{flipId:B.data.sessionId,children:k("div",{style:w,className:"px-[12px] py-[2px]",children:k(ao,{isActive:t===B.data.sessionId,isDisabled:!1,isNew:B.data.isNew,data:B.data,eventsEmit:d,assistantList:s,styles:n})})},B.data.sessionId)}})})}const Do=({value:r,eventsEmit:u,setSearch:t,style:e,styles:h={}})=>{const{messages:l}=fr(),d=h.colors||{},s=h.radius||"12px",p=d.border||"#e5e7eb",n=d.primary||"#2563eb",o=h.headerBg||d.sidebarBg||d.background||"#fff",[E,c]=Re.useState(!1),m=Re.useRef(null);Re.useEffect(()=>{E&&m.current&&m.current.focus()},[E]);const y=()=>{c(!1),t("")};return Q("div",{className:"flex items-center gap-2 px-4 py-3 sticky top-0 z-10 min-w-0",style:{...e,background:o,borderTopLeftRadius:s,borderTopRightRadius:s},children:[k("button",{className:"border-none flex items-center justify-center",onClick:()=>{c(!1),u&&u("conversation:create")},title:l.sidebar.newConversation,style:{height:42,borderRadius:"90px",background:n,color:d.buttonText||"#fff",fontWeight:600,boxShadow:h.shadow||"0 2px 8px 0 rgba(0,0,0,0.04)",padding:E?"0 0":"0 14px",minWidth:E?0:180,width:E?0:void 0,opacity:E?0:1,overflow:"hidden",flexShrink:0,transition:"width .22s ease, min-width .22s ease, padding .22s ease, opacity .18s ease",pointerEvents:E?"none":"auto"},children:Q("div",{className:"flex items-center gap-2",children:[k(wi,{size:18}),k("span",{className:"text-sm",children:l.sidebar.newChat})]})}),E?Q("div",{className:"flex-1 min-w-0 relative",children:[k("input",{ref:m,className:"w-full px-3 py-2 pr-10 text-sm transition-all",placeholder:l.sidebar.searchPlaceholder,value:r,onChange:i=>t(i.target.value),onKeyDown:i=>{i.key==="Escape"&&y()},style:{minWidth:0,width:"100%",borderRadius:s,background:d.inputBg||"#f4f4f5",border:`1px solid ${p}`,color:d.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:d.text||"#666",flexShrink:0,position:"absolute",right:"12px",top:"9px"},onClick:y,title:"\u5173\u95ED\u641C\u7D22",onMouseDown:i=>i.preventDefault(),children:k(ua,{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 ${p}`,color:n,flexShrink:0},onClick:()=>c(!0),title:l.sidebar.search,children:k(Ir,{size:18})})]})};function _o(r){const{data:u,sortRules:t,activedItem:e,eventsEmit:h,assistantList:l,styles:d={},hasMore:s=!1,loadingMore:p=!1}=r,{messages:n}=fr(),[o,E]=se(""),c=Ae(()=>o?u.filter(b=>(b.label||n.sidebar.unnamedSession).toLowerCase().includes(o.toLowerCase())):u,[u,o,n.sidebar.unnamedSession]),m=Ae(()=>[...c].sort((b,I)=>new Date(I.gmtModified).getTime()-new Date(b.gmtModified).getTime()),[c]),y=We(null),[i,a]=se(400);be(()=>{function b(){y.current&&a(y.current.clientHeight)}return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);const v=(d==null?void 0:d.colors)||{};d!=null&&d.radius;const f=(d==null?void 0:d.shadow)||"0 4px 24px 0 rgba(0,0,0,0.06)",x=v.border||"#e5e7eb",F=v.sidebarBg||v.background||"#EAEEFF",_=v.text||"#222";return Q("div",{className:"h-full flex flex-col overflow-y-hidden",style:{background:F,color:_,boxShadow:f,border:`1px solid ${x}`,...d.container},children:[k(Do,{value:o,setSearch:E,eventsEmit:h,style:d.header,styles:d}),Q("div",{className:"flex-1 min-h-0 relative",ref:y,style:d.list,children:[k(bo,{eventsEmit:h,data:m,assistantList:l,activedItem:e,sortRules:t,height:i,styles:d,hasMore:s,loadingMore:p}),k("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-3 z-20",style:{background:`linear-gradient(to bottom, ${F}cc, transparent)`}})]})]})}var Dt={exports:{}};/*!
|
|
53
|
+
* clipboard.js v2.0.11
|
|
54
|
+
* https://clipboardjs.com/
|
|
55
|
+
*
|
|
56
|
+
* Licensed MIT © Zeno Rocha
|
|
57
|
+
*/var wo=Dt.exports,pn;function So(){return pn||(pn=1,(function(r,u){(function(e,h){r.exports=h()})(wo,function(){return(function(){var t={686:(function(l,d,s){s.d(d,{default:function(){return P}});var p=s(279),n=s.n(p),o=s(370),E=s.n(o),c=s(817),m=s.n(c);function y(T){try{return document.execCommand(T)}catch{return!1}}var i=function(S){var R=m()(S);return y("cut"),R},a=i;function v(T){var S=document.documentElement.getAttribute("dir")==="rtl",R=document.createElement("textarea");R.style.fontSize="12pt",R.style.border="0",R.style.padding="0",R.style.margin="0",R.style.position="absolute",R.style[S?"right":"left"]="-9999px";var $=window.pageYOffset||document.documentElement.scrollTop;return R.style.top="".concat($,"px"),R.setAttribute("readonly",""),R.value=T,R}var f=function(S,R){var $=v(S);R.container.appendChild($);var j=m()($);return y("copy"),$.remove(),j},x=function(S){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},$="";return typeof S=="string"?$=f(S,R):S instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(S==null?void 0:S.type)?$=f(S.value,R):($=m()(S),y("copy")),$},F=x;function _(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_=function(R){return typeof R}:_=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},_(T)}var b=function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},R=S.action,$=R===void 0?"copy":R,j=S.container,X=S.target,W=S.text;if($!=="copy"&&$!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(X!==void 0)if(X&&_(X)==="object"&&X.nodeType===1){if($==="copy"&&X.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if($==="cut"&&(X.hasAttribute("readonly")||X.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(W)return F(W,{container:j});if(X)return $==="cut"?a(X):F(X,{container:j})},I=b;function N(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?N=function(R){return typeof R}:N=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},N(T)}function z(T,S){if(!(T instanceof S))throw new TypeError("Cannot call a class as a function")}function w(T,S){for(var R=0;R<S.length;R++){var $=S[R];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(T,$.key,$)}}function B(T,S,R){return S&&w(T.prototype,S),R&&w(T,R),T}function D(T,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(S&&S.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),S&&g(T,S)}function g(T,S){return g=Object.setPrototypeOf||function($,j){return $.__proto__=j,$},g(T,S)}function q(T){var S=Y();return function(){var $=M(T),j;if(S){var X=M(this).constructor;j=Reflect.construct($,arguments,X)}else j=$.apply(this,arguments);return U(this,j)}}function U(T,S){return S&&(N(S)==="object"||typeof S=="function")?S:G(T)}function G(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function Y(){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 M(T){return M=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)},M(T)}function H(T,S){var R="data-clipboard-".concat(T);if(S.hasAttribute(R))return S.getAttribute(R)}var Z=(function(T){D(R,T);var S=q(R);function R($,j){var X;return z(this,R),X=S.call(this),X.resolveOptions(j),X.listenClick($),X}return B(R,[{key:"resolveOptions",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof j.action=="function"?j.action:this.defaultAction,this.target=typeof j.target=="function"?j.target:this.defaultTarget,this.text=typeof j.text=="function"?j.text:this.defaultText,this.container=N(j.container)==="object"?j.container:document.body}},{key:"listenClick",value:function(j){var X=this;this.listener=E()(j,"click",function(W){return X.onClick(W)})}},{key:"onClick",value:function(j){var X=j.delegateTarget||j.currentTarget,W=this.action(X)||"copy",ie=I({action:W,container:this.container,target:this.target(X),text:this.text(X)});this.emit(ie?"success":"error",{action:W,text:ie,trigger:X,clearSelection:function(){X&&X.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(j){return H("action",j)}},{key:"defaultTarget",value:function(j){var X=H("target",j);if(X)return document.querySelector(X)}},{key:"defaultText",value:function(j){return H("text",j)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(j){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return F(j,X)}},{key:"cut",value:function(j){return a(j)}},{key:"isSupported",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],X=typeof j=="string"?[j]:j,W=!!document.queryCommandSupported;return X.forEach(function(ie){W=W&&!!document.queryCommandSupported(ie)}),W}}]),R})(n()),P=Z}),828:(function(l){var d=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 p(n,o){for(;n&&n.nodeType!==d;){if(typeof n.matches=="function"&&n.matches(o))return n;n=n.parentNode}}l.exports=p}),438:(function(l,d,s){var p=s(828);function n(c,m,y,i,a){var v=E.apply(this,arguments);return c.addEventListener(y,v,a),{destroy:function(){c.removeEventListener(y,v,a)}}}function o(c,m,y,i,a){return typeof c.addEventListener=="function"?n.apply(null,arguments):typeof y=="function"?n.bind(null,document).apply(null,arguments):(typeof c=="string"&&(c=document.querySelectorAll(c)),Array.prototype.map.call(c,function(v){return n(v,m,y,i,a)}))}function E(c,m,y,i){return function(a){a.delegateTarget=p(a.target,m),a.delegateTarget&&i.call(c,a)}}l.exports=o}),879:(function(l,d){d.node=function(s){return s!==void 0&&s instanceof HTMLElement&&s.nodeType===1},d.nodeList=function(s){var p=Object.prototype.toString.call(s);return s!==void 0&&(p==="[object NodeList]"||p==="[object HTMLCollection]")&&"length"in s&&(s.length===0||d.node(s[0]))},d.string=function(s){return typeof s=="string"||s instanceof String},d.fn=function(s){var p=Object.prototype.toString.call(s);return p==="[object Function]"}}),370:(function(l,d,s){var p=s(879),n=s(438);function o(y,i,a){if(!y&&!i&&!a)throw new Error("Missing required arguments");if(!p.string(i))throw new TypeError("Second argument must be a String");if(!p.fn(a))throw new TypeError("Third argument must be a Function");if(p.node(y))return E(y,i,a);if(p.nodeList(y))return c(y,i,a);if(p.string(y))return m(y,i,a);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function E(y,i,a){return y.addEventListener(i,a),{destroy:function(){y.removeEventListener(i,a)}}}function c(y,i,a){return Array.prototype.forEach.call(y,function(v){v.addEventListener(i,a)}),{destroy:function(){Array.prototype.forEach.call(y,function(v){v.removeEventListener(i,a)})}}}function m(y,i,a){return n(document.body,y,i,a)}l.exports=o}),817:(function(l){function d(s){var p;if(s.nodeName==="SELECT")s.focus(),p=s.value;else if(s.nodeName==="INPUT"||s.nodeName==="TEXTAREA"){var n=s.hasAttribute("readonly");n||s.setAttribute("readonly",""),s.select(),s.setSelectionRange(0,s.value.length),n||s.removeAttribute("readonly"),p=s.value}else{s.hasAttribute("contenteditable")&&s.focus();var o=window.getSelection(),E=document.createRange();E.selectNodeContents(s),o.removeAllRanges(),o.addRange(E),p=o.toString()}return p}l.exports=d}),279:(function(l){function d(){}d.prototype={on:function(s,p,n){var o=this.e||(this.e={});return(o[s]||(o[s]=[])).push({fn:p,ctx:n}),this},once:function(s,p,n){var o=this;function E(){o.off(s,E),p.apply(n,arguments)}return E._=p,this.on(s,E,n)},emit:function(s){var p=[].slice.call(arguments,1),n=((this.e||(this.e={}))[s]||[]).slice(),o=0,E=n.length;for(o;o<E;o++)n[o].fn.apply(n[o].ctx,p);return this},off:function(s,p){var n=this.e||(this.e={}),o=n[s],E=[];if(o&&p)for(var c=0,m=o.length;c<m;c++)o[c].fn!==p&&o[c].fn._!==p&&E.push(o[c]);return E.length?n[s]=E:delete n[s],this}},l.exports=d,l.exports.TinyEmitter=d})},e={};function h(l){if(e[l])return e[l].exports;var d=e[l]={exports:{}};return t[l](d,d.exports,h),d.exports}return(function(){h.n=function(l){var d=l&&l.__esModule?function(){return l.default}:function(){return l};return h.d(d,{a:d}),d}})(),(function(){h.d=function(l,d){for(var s in d)h.o(d,s)&&!h.o(l,s)&&Object.defineProperty(l,s,{enumerable:!0,get:d[s]})}})(),(function(){h.o=function(l,d){return Object.prototype.hasOwnProperty.call(l,d)}})(),h(686)})().default})})(Dt)),Dt.exports}var ko=So();const Io=ea(ko),Ro=(r,u)=>{let t=r&&r.replace(/<think>[\s\S]*?<\/think>/g,"");t=t.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,""),t=t.replace(/<a\s+[^>]*>(.*?)<\/a>/g,""),console.log("_content",t);const e=new Io(u.currentTarget||u.target,{text:()=>t});try{e.on("success",()=>{we.success("\u6587\u672C\u590D\u5236\u6210\u529F",2),e.destroy()}),e.on("error",h=>{we.error("\u590D\u5236\u5931\u8D25",2),e.destroy()}),e.onClick(u)}catch(h){e.destroy(),we.error("\u590D\u5236\u5931\u8D25: "+h,2)}};function No(r){const u=[];for(const t of r){if(t.query){const e=t.query.queryId||t.query.id||t.queryId||t.id||w0(32);u.push({istype:"user",content:t.query.content,time:t.query.gmtCreate,queryId:e,clientSideId:e+"-user",...t.query})}if(t.reply){const e=t.reply.queryId||t.reply.id||t.queryId||t.id||w0(32);u.push({istype:"ai",content:t.reply.content,isDefault:t.reply.isDefault,time:t.time||t.gmtCreate||Date.now(),queryId:e,clientSideId:e+"-ai",...t.reply})}}return u}const Po=""+new URL("defaultWeLogo.svg",import.meta.url).href,To="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==",zo=(r,u)=>{const t={...qr.colors,...r};return`
|
|
58
|
+
.g-welcome-${u} .g-welcome-title {
|
|
59
|
+
background-image: linear-gradient(90deg, #3262FA 0%, #6C18FF 100%);
|
|
60
|
+
-webkit-background-clip: text;
|
|
61
|
+
background-clip: text;
|
|
62
|
+
color: transparent;
|
|
63
|
+
-webkit-text-fill-color: transparent;
|
|
64
|
+
}
|
|
65
|
+
.g-welcome-${u} .g-welcome-subtitle {
|
|
66
|
+
color: ${t.disabled};
|
|
67
|
+
}
|
|
68
|
+
.g-welcome-${u} .g-welcome-btn {
|
|
69
|
+
background-color: #ffffff;
|
|
70
|
+
border-color: ${t.border};
|
|
71
|
+
color: ${t.text};
|
|
72
|
+
height: 36px;
|
|
73
|
+
border-width: 1px;
|
|
74
|
+
box-shadow: 0 1px 2px rgba(31,35,41,0.04);
|
|
75
|
+
}
|
|
76
|
+
.g-welcome-${u} .g-welcome-btn:hover {
|
|
77
|
+
border-color: ${t.primary};
|
|
78
|
+
color: ${t.primary};
|
|
79
|
+
background-color: #ffffff;
|
|
80
|
+
box-shadow: 0 2px 6px rgba(31,35,41,0.08);
|
|
81
|
+
}
|
|
82
|
+
.g-welcome-${u} .g-welcome-btn.active {
|
|
83
|
+
background-image: linear-gradient(90deg, #F1F8FF 0%, #F9F4FF 100%);
|
|
84
|
+
border-color: ${t.primary};
|
|
85
|
+
box-shadow: 0 4px 10px rgba(24, 144, 255, 0.25);
|
|
86
|
+
}
|
|
87
|
+
.g-welcome-${u} .g-welcome-btn .icon-badge {
|
|
88
|
+
width: 24px;
|
|
89
|
+
height: 24px;
|
|
90
|
+
border-radius: 9999px;
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
background: radial-gradient(100% 100% at 50% 0%, #F2F3F5 0%, #FFFFFF 100%);
|
|
95
|
+
box-shadow: inset 0 0 0 1px ${t.border};
|
|
96
|
+
}
|
|
97
|
+
.g-welcome-${u} .g-welcome-pagination-btn {
|
|
98
|
+
background: transparent;
|
|
99
|
+
border: none;
|
|
100
|
+
color: ${t.disabled};
|
|
101
|
+
padding: 6px 10px;
|
|
102
|
+
border-radius: 9999px;
|
|
103
|
+
transition: all 0.2s;
|
|
104
|
+
font-size: 14px;
|
|
105
|
+
line-height: 1;
|
|
106
|
+
min-width: 32px;
|
|
107
|
+
height: 32px;
|
|
108
|
+
display: inline-flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
}
|
|
112
|
+
.g-welcome-${u} .g-welcome-pagination-btn:hover:not(:disabled) {
|
|
113
|
+
color: ${t.text};
|
|
114
|
+
background-color: ${t.border}33;
|
|
115
|
+
}
|
|
116
|
+
.g-welcome-${u} .g-welcome-pagination-btn.active {
|
|
117
|
+
color: ${t.primary};
|
|
118
|
+
background: radial-gradient(100% 100% at 50% 50%, ${t.primary}10 0%, ${t.primary}08 100%);
|
|
119
|
+
box-shadow: 0 2px 10px ${t.primary}12, inset 0 0 0 1px ${t.primary}1A;
|
|
120
|
+
}
|
|
121
|
+
.g-welcome-${u} .g-welcome-pagination-btn:disabled {
|
|
122
|
+
color: ${t.disabled};
|
|
123
|
+
cursor: not-allowed;
|
|
124
|
+
background: transparent;
|
|
125
|
+
}
|
|
126
|
+
.g-welcome-${u} .g-welcome-pagination-text {
|
|
127
|
+
color: ${t.disabled};
|
|
128
|
+
font-size: 14px;
|
|
129
|
+
padding: 0 8px;
|
|
130
|
+
}
|
|
131
|
+
.g-welcome-${u} .g-welcome-pagination-dot {
|
|
132
|
+
width: 6px;
|
|
133
|
+
height: 6px;
|
|
134
|
+
border-radius: 50%;
|
|
135
|
+
background-color: ${t.border};
|
|
136
|
+
transition: all 0.2s;
|
|
137
|
+
}
|
|
138
|
+
.g-welcome-${u} .g-welcome-pagination-dot.active {
|
|
139
|
+
background-color: ${t.primary};
|
|
140
|
+
width: 20px;
|
|
141
|
+
border-radius: 3px;
|
|
142
|
+
}
|
|
143
|
+
.g-welcome-${u} .g-welcome-search-btn {
|
|
144
|
+
background-color: #ffffff;
|
|
145
|
+
border: 1px solid ${t.border};
|
|
146
|
+
color: ${t.text};
|
|
147
|
+
padding: 8px 8px;
|
|
148
|
+
border-radius: 100%;
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
transition: all 0.2s;
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
gap: 6px;
|
|
154
|
+
font-size: 14px;
|
|
155
|
+
box-shadow: 0 1px 2px rgba(31,35,41,0.04);
|
|
156
|
+
}
|
|
157
|
+
.g-welcome-${u} .g-welcome-search-btn:hover {
|
|
158
|
+
border-color: ${t.primary};
|
|
159
|
+
color: ${t.primary};
|
|
160
|
+
box-shadow: 0 2px 6px rgba(31,35,41,0.08);
|
|
161
|
+
}
|
|
162
|
+
.g-welcome-${u} .g-welcome-search-input {
|
|
163
|
+
border: 1px solid ${t.border};
|
|
164
|
+
border-radius: 9999px;
|
|
165
|
+
transition: all 0.2s;
|
|
166
|
+
height: 40px;
|
|
167
|
+
padding: 0 14px;
|
|
168
|
+
}
|
|
169
|
+
.g-welcome-${u} .g-welcome-search-input:focus,
|
|
170
|
+
.g-welcome-${u} .g-welcome-search-input:hover {
|
|
171
|
+
border-color: ${t.primary};
|
|
172
|
+
box-shadow: 0 0 0 2px ${t.primary}1A;
|
|
173
|
+
}
|
|
174
|
+
`};function qo({config:r,styles:u}){if(!r)return null;const t=JSON.parse(r.configJson),e=Ae(()=>{var h;return{...qr.colors,...(h=u==null?void 0:u.theme)==null?void 0:h.colors}},[u]);return Q("div",{className:"w-[340px] rounded-xl p-4 animate-fade-in bg-white",children:[Q("div",{className:"flex items-center mb-2",children:[k("span",{className:"text-md font-bold truncate mr-2",style:{color:e.primary},children:t.config_name||"\u52A9\u624B\u914D\u7F6E"}),k("span",{className:"text-xs truncate rounded px-2 py-0.5",style:{backgroundColor:`${e.primary}1A`,color:e.disabled},children:t.model_name})]}),k("div",{className:"border-b my-2",style:{borderColor:e.border}}),Q("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-700 mb-2",style:{color:e.text},children:[Q("div",{children:["\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570\uFF1A",k("span",{className:"font-semibold",children:t.max_round})]}),Q("div",{children:["\u6700\u5927\u4EE4\u724C\u6570\uFF1A",k("span",{className:"font-semibold",children:t.max_tokens})]}),Q("div",{children:["\u6E29\u5EA6\uFF1A",k("span",{className:"font-semibold",children:t.temperature})]}),Q("div",{children:["\u53EC\u56DE\u6570\uFF1A",k("span",{className:"font-semibold",children:t.top_k})]}),Q("div",{children:["\u591A\u6837\u6027\uFF1A",k("span",{className:"font-semibold",children:t.top_p})]}),Q("div",{children:["\u76F8\u4F3C\u5EA6\u9608\u503C\uFF1A",k("span",{className:"font-semibold",children:t.score_threshold})]})]}),Q("div",{className:"mb-2",children:[k("div",{className:"text-xs text-gray-400 mb-1",style:{color:e.disabled},children:"\u5173\u8054\u77E5\u8BC6\u5E93\uFF1A"}),k("div",{className:"flex flex-wrap gap-1",children:t.knowledge_base_name?t.knowledge_base_name.split(";").map((h,l)=>k("span",{className:"px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${e.primary}1A`,color:e.primary},children:h},l)):k("span",{className:"text-gray-300",style:{color:e.disabled},children:"\u65E0"})})]}),Q("div",{className:"mb-2",children:[k("div",{className:"text-xs text-gray-400 mb-1",style:{color:e.disabled},children:"\u5F00\u542F\u529F\u80FD:"}),Q("div",{className:"flex flex-wrap gap-2 text-xs mt-2",children:[!!t.enabled_faq&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"FAQ"}),!!t.enabled_graph&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u56FE\u8C31"}),!!t.dependOnKb&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u5F3A\u77E5\u8BC6\u4F9D\u8D56"}),!!t.enabled_table_select&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u8868\u683C\u7B5B\u9009"}),!!t.enabled_rerank&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u7CBE\u6392\u6A21\u5F0F"}),!!t.need_trace_source&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u6EAF\u6E90"}),!!t.is_download&&k("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${e.success}1A`,color:e.success},children:"\u4E0B\u8F7D\u6EAF\u6E90"})]})]})]})}function Lo(r,u=[],t=60){const[e,h]=se("");return be(()=>{if(h(""),!r)return;let l=0;const d=setInterval(()=>{h(s=>l>=r.length?(clearInterval(d),s):(l++,r.slice(0,l)))},t);return()=>clearInterval(d)},[r,...u]),e}function Oo(r){const{assistantList:u,eventsEmit:t,styles:e,selectedId:h,onSelectAssistant:l,productLogo:d}=r,{messages:s}=fr(),[p,n]=se(1),[o,E]=se(!1),[c,m]=se(""),y=o||c.trim()?6:12,i=We(),a=We(!1),v=We(null),f=We(null),x=We("");be(()=>{h&&i.current!==h&&(t==null||t("conversation:new_assistant_change",{assistantId:h}),i.current=h)},[h,t]);const F=Ae(()=>w0(),[]);be(()=>{var D;if((D=e==null?void 0:e.theme)!=null&&D.colors){const g=document.createElement("style");return g.innerHTML=zo(e.theme.colors,F),g.id=`g-welcome-styles-${F}`,document.head.appendChild(g),()=>{const q=document.getElementById(g.id);q&&q.remove()}}},[e,F]);const _=Ae(()=>u.find(D=>D.id===h),[u,h]),b=Ae(()=>JSON.parse((_==null?void 0:_.configJson)||"{}"),[_]),I=Ae(()=>{if(!c.trim())return u||[];const D=c.toLowerCase().trim();return(u||[]).filter(g=>{var U,G;const q=((U=g.name)==null?void 0:U.toLowerCase())||"";try{const M=((G=JSON.parse(g.configJson||"{}").config_name)==null?void 0:G.toLowerCase())||"";return q.includes(D)||M.includes(D)}catch{return q.includes(D)}})},[u,c]),N=Math.ceil(((I==null?void 0:I.length)||0)/y),z=(I==null?void 0:I.slice((p-1)*y,p*y))||[];be(()=>{if(h&&h!==f.current){if(a.current&&v.current!==null){f.current=h;return}const D=c.trim()?I:u;if(D&&D.length>0){const g=D.findIndex(q=>q.id===h);if(g!==-1){const q=Math.floor(g/y)+1;n(q),f.current=h}}}},[h,u,I,y,c]),be(()=>{if(c!==x.current){if(a.current&&v.current!==null){n(v.current),a.current=!1,v.current=null,x.current=c;return}if(f.current===h){x.current=c;return}a.current||(c.trim()&&(f.current=null),n(1)),x.current=c}},[c,h]),be(()=>{N>0&&p>N&&n(N)},[N,p]);const w=b.prologue||s.welcome.defaultPrologue,B=Lo(w,[h],30);return Q("div",{className:`flex flex-col relative items-center justify-center h-full w-full g-welcome-${F}`,children:[k("img",{src:d||Po,alt:"logo",className:"mb-4",style:{width:68,height:68}}),k("div",{className:"text-3xl font-bold mb-2 g-welcome-title",children:B}),!h&&k("div",{className:"flex mb-2 g-welcome-subtitle",children:s.welcome.selectAssistant}),Q("div",{style:{maxWidth:"1200px"},className:`flex mt-8 flex-wrap gap-3\r
|
|
175
|
+
max-w-[1200px] px-8 w-full mx-auto justify-center mb-4`,children:[o?k("div",{className:"flex items-center gap-2 px-5 w-full",style:{flexBasis:"100%"},children:k(ta,{className:"g-welcome-search-input w-full",placeholder:s.welcome.searchAssistant,prefix:k(Ir,{size:16}),suffix:k("button",{type:"button",onClick:()=>{E(!1),m("")},style:{background:"transparent",border:"none",cursor:"pointer"},children:k(ua,{size:14})}),value:c,onChange:D=>m(D.target.value),autoFocus:!0})}):k("button",{type:"button",className:"g-welcome-search-btn",onClick:()=>E(!0),children:k(Ir,{size:16})}),z&&z.length>0?k(rt,{children:z.map(D=>{const g=h===D.id;let q=D.icon;try{const U=JSON.parse(D.configJson||"{}");q=q||U.icon||U.avatar||U.logo}catch{}return q=q||To,k(Si,{content:()=>k(qo,{config:u.find(U=>U.id===D.id),styles:e}),trigger:"hover",placement:"bottom",children:Q("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 ${g?"active":""}`,onClick:()=>{l==null||l(D.id);const U=o||c.trim(),Y=(U?u:c.trim()?I:u).findIndex(M=>M.id===D.id);if(Y!==-1){const H=Math.floor(Y/(U?12:y))+1;n(H),f.current=D.id,U&&(v.current=H,a.current=!0,setTimeout(()=>{m(""),E(!1)},100))}},title:D.name,children:[k("span",{className:"icon-badge",children:k("img",{src:q,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"})]}),N>1&&Q("div",{className:"flex items-center gap-2",children:[k("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>n(D=>Math.max(1,D-1)),disabled:p===1,children:k(ki,{size:16})}),k("div",{className:"flex items-center gap-1",children:(()=>{const D=[];if(N<=7)for(let q=1;q<=N;q++)D.push(q);else if(D.push(1),p<=4){for(let q=2;q<=5;q++)D.push(q);D.push("..."),D.push(N)}else if(p>=N-3){D.push("...");for(let q=N-4;q<=N;q++)D.push(q)}else{D.push("...");for(let q=p-1;q<=p+1;q++)D.push(q);D.push("..."),D.push(N)}return D.map((q,U)=>{if(q==="...")return k("span",{className:"g-welcome-pagination-text px-1",children:"..."},`ellipsis-${U}`);const G=q;return k("button",{type:"button",className:`g-welcome-pagination-btn ${p===G?"active":""}`,onClick:()=>n(G),children:G},G)})})()}),k("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>n(D=>Math.min(N,D+1)),disabled:p===N,children:k(bi,{size:16})})]})]})}class Dr extends Error{}let A0=null,_0=null,y0=null,me=[],Z0,J0,_r=new Map;const Mo=({baseUrl:r,token:u,CSRFToken:t,setChatData:e,activeSessionId:h,setAppStatus:l,setConversationList:d})=>{const s=a=>{if(!a)return!1;if(typeof a=="string"){const v=a.trim();return v!==""&&v!=="[]"&&v!=="null"}return!0},p=({content:a,status:v,respTime:f,filePaths:x,reference:F,webReference:_,knowledgeBases:b,graphReference:I,databaseReference:N,llmType:z,resultType:w,queryId:B,tokens:D,chain:g,thoughtChainNodes:q,enableCot:U,chainRespTime:G})=>{e(Y=>{var ie;if(!Y[0])return Y;const M=Y[0],H=M.messages||[],Z=H.length-1;if(Z<0)return Y;const P=H[Z];if(P.istype!=="ai")return Y;let T=H.slice();if(x!=null&&x.length){const pe=H.length-2;if(pe>=0&&((ie=H[pe])==null?void 0:ie.istype)==="user"){const o0={...H[pe],filePaths:x};T[pe]=o0}}const S=B&&B!==P.queryId,R=v===1&&P.status===2,$=S||R?s(I)?I:null:I!==void 0&&s(I)?I:P.graphReference;v===2&&I!==void 0&&console.log("[AichatUseController] reset_chat status=2 \u65F6\u7684 graphReference:",{graphReference:I,isValid:s(I),lastMessageGraphReference:P.graphReference,finalGraphReference:$,isNewQuery:S,isRestart:R});let j;S?j=a:R?j="":v===4||v===2&&!a?j=P.content||"":j=(P.content||"")+a;const X={...P,content:j,status:v,respTime:f,filePaths:x,reference:S||R?F||"[]":F,webReference:S||R?_||"[]":_,knowledgeBases:S||R?b||"[]":b,graphReference:$,databaseReference:S||R?N!==void 0?N:null:N!==void 0?N:P.databaseReference,resultType:w,llmType:z,tokens:D,queryId:B||P.queryId||w0(32),chain:S||R?g!==void 0?g:void 0:g!==void 0?g:P.chain,thoughtChainNodes:S||R?q!==void 0?q:void 0:q!==void 0?q:P.thoughtChainNodes,enableCot:U!==void 0?U:P.enableCot,chainRespTime:G!==void 0?G:P.chainRespTime};return X.clientSideId=X.clientSideId||X.queryId+"-ai",T[Z]=X,[{...M,isNew:!1,messages:T},...Y.slice(1)]})},n=a=>{if(a instanceof Dr)throw l(v=>({...v,display:"error",sender:"ready"})),A0&&(A0.abort(),A0=null),_0=null,y0=null,a};return{updateUserFilesMessage:({currentFiles:a})=>{e(v=>{if(!v[0])return v;const f=v[0],x=f.messages||[];if(!x.length)return v;const F=x.length-2;if(F<0||x[F].istype!=="user")return v;const b=x.slice();return b[F]={...x[F],currentFiles:a},[{...f,messages:b},...v.slice(1)]})},api_startChat_re:(a,v)=>{A0&&A0.abort(),A0=new AbortController,_0=a.sessionId,y0=a.queryId,me=[],Z0=void 0,J0=void 0,_r=new Map;const f=`${r}/qa/ai/question_re`;console.log("data",a);const x={...a};Za(f,{method:"post",signal:A0.signal,headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:u||"","X-CSRF-TOKEN-IN":t||""},openWhenHidden:!0,body:JSON.stringify(x),onopen:async F=>{if(F.status===500)throw new Dr("Internal Server Error");if(!F.ok)throw new Dr(`HTTP error: ${F.status}`)},onmessage:F=>{var R,$,j,X;const _=JSON.parse(F.data);if(_0!==_.sessionId){console.log("[AichatUseController] \u6D41\u5F0F\u8BF7\u6C42\u7684 sessionId \u5DF2\u4E0D\u5339\u914D\uFF0C\u5FFD\u7565\u6570\u636E",{currentStreamSessionId:_0,receivedSessionId:_.sessionId,activeSessionId:h});return}if(h!==_.sessionId)return;const{reply:b,resultType:I,respTime:N,reference:z,webReference:w,graphReference:B,knowledgeBases:D,filePaths:g,status:q,docs:U,llmType:G,databaseReference:Y,businessType:M,nodeStatus:H,enableCot:Z,chainRespTime:P}=_;if(q===4&&M){H===2&&typeof P=="number"&&P>0&&_r.set(M,P);const W=H===2&&typeof P=="number"&&P>0?P:void 0;me=Bi(me,{businessType:M,nodeStatus:H,reply:b,respTime:W,chainRespTime:W}),console.log("[AichatUseController] status=4 \u805A\u5408\u601D\u7EF4\u94FE\u6570\u636E:",{businessType:M,nodeStatus:H,content:(R=b==null?void 0:b.content)==null?void 0:R.substring(0,50),currentThoughtNodesCount:me.length,chainRespTime:H===2?P:void 0})}else q===1&&M&&console.log("[AichatUseController] status=1 \u8DF3\u8FC7\u601D\u7EF4\u94FE\u805A\u5408:",{businessType:M,content:($=b==null?void 0:b.content)==null?void 0:$.substring(0,50),note:"status=1 \u7684\u5185\u5BB9\u5E94\u8BE5\u53BB\u6B63\u6587\uFF0C\u4E0D\u662F\u601D\u7EF4\u94FE"});if(typeof Z=="number"&&(Z0=Z),q===1||q===2){const W=Array.from(_r.values()).reduce((ie,pe)=>ie+pe,0);W>0&&(J0=W)}const T=g?JSON.parse(g):[];q===2&&b&&b.content&&(b.content.includes("\u6A21\u578B\u6682\u65E0\u6CD5\u8FD4\u56DE")||b.content.includes("\u5931\u8D25")||b.content.includes("\u9519\u8BEF")||b.content.includes("\u8BF7\u7A0D\u540E\u518D\u8BD5"))&&l(W=>({...W,display:"ready",sender:"ready"}));const S=s(B)?B:void 0;if(q===2&&console.log("[AichatUseController] status=2 \u65F6\u7684 graphReference:",{graphReference:B,type:typeof B,isValid:s(B),finalGraphReference:S}),q===4){const W=me.length>0?me.map(ie=>({businessType:ie.businessType,nodeStatus:ie.nodeStatus,content:ie.content})):void 0;console.log("[AichatUseController] status=4 \u66F4\u65B0\u601D\u7EF4\u94FE:",{businessType:M,chainLength:(W==null?void 0:W.length)||0,replyContentLength:((j=b==null?void 0:b.content)==null?void 0:j.length)||0,note:"status=4 \u65F6\uFF0Creply.content \u5E94\u8BE5\u805A\u5408\u5230\u601D\u7EF4\u94FE\uFF0C\u4E0D\u66F4\u65B0\u6B63\u6587"}),p({content:"",status:q,respTime:N,filePaths:T,reference:z||U||"",webReference:w||"",knowledgeBases:D||"",graphReference:S,databaseReference:Y,llmType:G,resultType:I,queryId:_.queryId,tokens:_.tokens,chain:W,thoughtChainNodes:me.length>0?[...me]:void 0,enableCot:Z0,chainRespTime:J0})}else if(q===1){me.length>0&&(me=me.map(ie=>({...ie,nodeStatus:2}))),console.log("[AichatUseController] status=1 \u66F4\u65B0\u6B63\u6587:",{businessType:M,content:(X=b==null?void 0:b.content)==null?void 0:X.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 W=me.length>0?me.map(ie=>({businessType:ie.businessType,nodeStatus:ie.nodeStatus,content:ie.content})):void 0;p({content:b.content||"",status:q,respTime:N,filePaths:T,reference:z||U||"",webReference:w||"",graphReference:S,knowledgeBases:D||"",databaseReference:Y??null,llmType:G,resultType:I,queryId:_.queryId,tokens:_.tokens,chain:W??void 0,thoughtChainNodes:me.length>0?[...me]:void 0,enableCot:Z0,chainRespTime:J0})}else if(q===2){me.length>0&&(me=me.map(ie=>({...ie,nodeStatus:2})));const W=me.length>0?me.map(ie=>({businessType:ie.businessType,nodeStatus:ie.nodeStatus,content:ie.content})):void 0;if(p({content:b.content||"",status:2,respTime:N,filePaths:T,reference:z||U||"",webReference:w||"",knowledgeBases:D||"",graphReference:S,databaseReference:Y,llmType:G,resultType:I,queryId:_.queryId,tokens:_.tokens,chain:W,thoughtChainNodes:me.length>0?[...me]:void 0,enableCot:Z0,chainRespTime:J0}),me=[],l(ie=>({...ie,display:"ready",sender:"ready"})),v){const ie=N||Date.now();console.log("[AichatUseController] \u6D88\u606F\u53D1\u9001\u6210\u529F\uFF0CgmtModified:",ie),v(ie)}}else{const W=me.length>0?me.map(ie=>({businessType:ie.businessType,nodeStatus:ie.nodeStatus,content:ie.content,respTime:ie.respTime,chainRespTime:ie.respTime})):void 0;p({content:b.content||"",status:q,respTime:N,filePaths:T,reference:z||U||"",knowledgeBases:D||"",webReference:w||"",graphReference:S,databaseReference:Y,llmType:G,resultType:I,queryId:_.queryId,tokens:_.tokens,chain:W,thoughtChainNodes:me.length>0?[...me]:void 0,enableCot:Z0,chainRespTime:J0})}},onerror:n,onclose:()=>{_0===a.sessionId&&(_0=null,y0=null)}})},addEmptyMessage:({queryId:a,content:v,filePaths:f,currentFiles:x})=>{e(F=>{const _=new Date().toISOString(),b=a||w0(32),I={istype:"user",content:v,time:_,queryId:b,clientSideId:b+"-user",filePaths:f||"",currentFiles:x||[]},N={istype:"ai",content:"",time:new Date(Date.now()+1).toISOString(),streaming:!0,status:0,queryId:b,clientSideId:b+"-ai"},z=F.find(w=>w.id===h);return z?z.messages.push(I,N):console.warn("addEmptyMessage called without an active session."),[...F]})},setLastEmptyMessage:({now:a})=>{e(v=>{if(!v[0])return v;const f=v[0],x=f.messages||[];if(!x.length)return v;const F=x.length-1;if(F<0)return v;const _=x[F];if(_.istype!=="ai")return v;const b=x.slice();return b[F]={..._,istype:"ai",content:"",time:a,streaming:!0,status:0},[{...f,messages:b},...v.slice(1)]})},stopStream:async()=>{if(y0)try{await i0.delete(`${r}/qa/ai/abortStream?queryId=${y0}`,{headers:{Authorization:u||"","X-CSRF-TOKEN-IN":t||""}}),console.log("[AichatUseController] \u5DF2\u8C03\u7528\u540E\u7AEF\u63A5\u53E3\u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42",y0)}catch(a){console.error("[AichatUseController] \u8C03\u7528\u505C\u6B62\u63A5\u53E3\u5931\u8D25",a)}else console.warn("[AichatUseController] \u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42\u65F6\u672A\u627E\u5230 queryId");A0=null,_0=null,y0=null,l(a=>({...a,display:"ready",sender:"ready"}))},cancelStreamBySessionId:async a=>{if(A0&&_0===a){if(console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\uFF0C\u53D6\u6D88\u6B63\u5728\u8FDB\u884C\u7684\u6D41\u5F0F\u8BF7\u6C42",a),y0)try{await i0.delete(`${r}/qa/ai/abortStream?queryId=${y0}`,{headers:{Authorization:u||"","X-CSRF-TOKEN-IN":t||""}}),console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u5DF2\u8C03\u7528\u540E\u7AEF\u63A5\u53E3\u505C\u6B62\u6D41\u5F0F\u8BF7\u6C42",y0)}catch(v){console.error("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u8C03\u7528\u505C\u6B62\u63A5\u53E3\u5931\u8D25",v)}else console.warn("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\u65F6\u672A\u627E\u5230 queryId");return A0=null,_0=null,y0=null,l(v=>({...v,display:"ready",sender:"ready"})),!0}return!1}}},Uo=1e3,Ho=3e3;function $o({url:r,token:u,CSRFToken:t,onError:e,activeSessionId:h}){const[l,d]=se([]),[s,p]=se(()=>({uploadedFiles:[]})),n=We(!1),o=async i=>{var a,v;if(!i)return null;try{const f=await i0.get(`${r}/index/knowledgeBase/file/getFilesBysessionId?sessionId=${i}`,{headers:{Authorization:u}});console.log("[DEBUG] \u83B7\u53D6\u4E34\u65F6\u6587\u4EF6\u5217\u8868 res:",(a=f==null?void 0:f.data)==null?void 0:a.data),p({uploadedFiles:((v=f==null?void 0:f.data)==null?void 0:v.data)||[]})}catch(f){throw console.error("\u83B7\u53D6\u4E34\u65F6\u6587\u4EF6\u5217\u8868\u5931\u8D25:",f),f}},E=Et((i,a)=>{const v=i.join(",");let f=0,x=null;x=()=>{n.current=!0};const F=async()=>{if(!n.current){if(f>=Uo){n.current||a.onFail("\u6587\u4EF6\u89E3\u6790\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");return}f++;try{const _=await i0.get(`${r}/index/knowledgeBase/file/getFileStatusByUids?uids=${v}`,{headers:{Authorization:u}});if(n.current)return;if(_.data.success){const b=_.data.data;n.current||a.onStatusUpdate(b),b.every(N=>{const z=N.fileParseStatus??N.status;return z===3||z===4})?n.current||a.onComplete():n.current||setTimeout(F,Ho)}else n.current||a.onFail(_.data.errorMsg||"\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u5931\u8D25")}catch(_){if(e==null||e(_),n.current)return;a.onFail("\u67E5\u8BE2\u6587\u4EF6\u72B6\u6001\u65F6\u53D1\u751F\u7F51\u7EDC\u9519\u8BEF")}}};return F(),x},[r,u,e]),c=Et(async(i,a)=>{if(!i){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6");return}Ja({url:r,token:u,CSRFToken:t},{uid:i,queryId:a},(v,f)=>{v?(we.success("\u6587\u4EF6\u5DF2\u4ECE\u4E34\u65F6\u77E5\u8BC6\u5E93\u79FB\u9664"),o(h)):(console.log("[DEBUG] removeFilefromTempUpload \u56DE\u8C03 false\uFF0Cres:",f),we.error("\u6587\u4EF6\u79FB\u9664\u5931\u8D25"))})},[r,u,t,h]),m=Et(()=>{n.current=!1},[]),y=Et(()=>{n.current=!0},[]);return{fileManagerData:s,fileStatuses:l,setFileManagerData:p,setFileStatuses:d,pollFileStatus:E,handleRemoveFromTemp:c,resetStopFlag:m,setStopFlag:y,stoppedRef:n,getTempFileList:o}}function Wo({title:r,subtitle:u}){const[t,e]=se(0);return be(()=>{let h;return t<98?h=setTimeout(()=>{e(l=>l+Math.random()*6+1)},80):t<100&&(h=setTimeout(()=>e(100),400)),()=>clearTimeout(h)},[t]),Q("div",{className:"flex flex-col justify-center items-center min-h-screen bg-gradient-to-br from-[#EEF4FF] via-white to-[#F5F8FF]",children:[Q("div",{className:"mb-8 flex flex-col items-center",children:[k("div",{className:"mt-6 text-2xl font-semibold text-[#222222] tracking-wide",children:r||"\u5C0F\u9CB8\u667A\u80FD\u4F1A\u8BDD\u52A9\u624B"}),k("div",{className:"mt-2 text-sm text-[#555555]",children:u||"\u8BA9\u667A\u80FD\u5BF9\u8BDD\u66F4\u7B80\u5355"})]}),Q("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(t,100)}%`}})}),Q("div",{className:"absolute -right-2 top-5 text-sm text-[#555555]",children:[Math.min(Math.round(t),100),"%"]})]}),Q("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 Ia=document.createElement("style");Ia.textContent=`
|
|
176
|
+
.animate-bounce-slow {
|
|
177
|
+
animation: bounce 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
|
|
178
|
+
}
|
|
179
|
+
@keyframes bounce {
|
|
180
|
+
0%, 100% { transform: translateY(0); }
|
|
181
|
+
50% { transform: translateY(-12px); }
|
|
182
|
+
}
|
|
183
|
+
`;document.head.appendChild(Ia);function jo(){return Q("div",{className:"flex flex-col gap-8 p-4 w-full mx-auto",children:[Q("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(Bt,{active:!0,paragraph:{rows:1}})})]}),Q("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(Bt,{active:!0,paragraph:{rows:3}})})]}),Q("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(Bt,{active:!0,paragraph:{rows:1}})})]}),Q("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(Bt,{active:!0,paragraph:{rows:2}})})]})]})}function Vo({msg:r,subMsg:u}){return Q("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(zi,{size:64,className:"text-[#d70016]"})}),k("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:r||"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25"}),k("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:u||"\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(nt,{type:"primary",icon:k(fa,{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 Ko(){return Q("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(Di,{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(nt,{type:"primary",icon:k(fa,{className:"w-4 h-4"}),onClick:()=>window.location.reload(),className:"flex items-center gap-2 bg-gradient-to-r from-[#2B69FF] to-[#8F91FF] border-none hover:opacity-90",children:"\u91CD\u65B0\u52A0\u8F7D"})]})}const Go=({isModalOpen:r,handleOk:u,handleCancel:t,data:e})=>{const h={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}},[l]=ra();return be(()=>{if(!r){l.resetFields();return}l.setFieldValue("new_name",e==null?void 0:e.label)},[e,r]),k(dr,{modal:{styles:h},children:k(la,{title:k("div",{className:"text-[16px]",children:"\u7F16\u8F91\u4F1A\u8BDD\u540D\u79F0"}),closeIcon:null,open:r,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:Q("div",{className:"mt-[16px] flex justify-end",children:[k(nt,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),k(nt,{children:"\u786E\u8BA4",onClick:async()=>{try{const d=await l.validateFields();u("ok_rename",d)}catch(d){console.log(d);return}},type:"primary",className:"border-none"})]}),children:k(Yr,{form:l,children:k(Yr.Item,{name:"new_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"},{max:100,message:"\u6700\u5927\u5B57\u6570\u9650\u5236100"}],children:k(ta,{})})})})})},Xo=({isModalOpen:r,handleOk:u,handleCancel:t,data:e})=>{const h={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}},[l]=ra();return be(()=>{if(!r){l.resetFields();return}l.setFieldValue("new_name",e==null?void 0:e.label)},[e,r]),k(dr,{modal:{styles:h},children:k(la,{title:k("div",{className:"text-[16px]",children:"\u5220\u9664\u4F1A\u8BDD"}),closeIcon:null,open:r,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:Q("div",{className:"mt-[16px] flex justify-end",children:[k(nt,{children:"\u53D6\u6D88",onClick:t,className:"mr-[8px]"}),k(nt,{children:"\u786E\u8BA4",onClick:async()=>{try{const d=await l.validateFields();u("ok_remove",d)}catch(d){console.log(d);return}},type:"primary",className:"border-none"})]}),children:k("div",{children:`\u786E\u5B9A\u8981\u5220\u9664\u4F1A\u8BDD\u300C${e.label}\u300D\u5417\uFF1F\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D\u3002`})})})},Yo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFQSURBVHgBpVMxTsNQDLWTiIYBFG7Q3iCcgLIxQJWxZSpbOxFO0HICOhE2shGxEFCGbvQGcAPCCahgIJHoN/5RaEOUBAJPsmTZ3/aT/T4Co23ZxoYeWVACEjj/UOhx6l2E+RzudQfNNcR79ptQjfD1vbE98yfzbFDTEE1ZrBC1/IIJEhYPEYhPKUs3m1OQyJBOWfFPOQX+CQ1qQu6sATBaCLwNrh2/NgOdjQC2FBVu5PW+MTjoDvrccSdfJNILqQCzdB9WpzckudQlg87hYISIl7I7G2YNAZ75SrtFy1wxIBwLwtPAc8ZQA5qq676II5MAw8A7n+z3hpLW2d2V0/pVA99NlGV/BRJdIDbltqcV91++zwesvm2IOH6AEmkTkfsW6Seb6/EL+0dY9EhKl1mYi1Slq3HCQFCP2WHWZJY2qEL6L5LPJ/gy8BfIJmxt6X8C+32HILvaN+0AAAAASUVORK5CYII=",xr=({title:r,setOpen:u})=>Q("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:r}),k("img",{src:ei,style:{width:"16px",height:"16px",cursor:"pointer"},onClick:()=>u(!1)})]});ti();const Qo=({curFileInfo:r,onClose:u,token:t})=>{var s;const e={title:"",subtitle:"",backgroundColor:"#f8f9fa",showGrid:!1,showLegend:!1,showTooltip:!1,showFullscreen:!1,showMinimap:!1},[h,l]=se({nodeList:[],edgeList:[]});be(()=>{console.log("curFileInfo",r)},[r]);const d=async p=>{if(!(!(p!=null&&p.id)||!(p!=null&&p.cyphers)||!(p!=null&&p.fetchUrl)))try{const{cyphers:n,fetchUrl:o,id:E}=p||{};console.log("getGraphData params",n,o,E);const c=await i0.post(o,{cyphers:n,ontologyId:E},{headers:{Authorization:t}});console.log("getGraphData res",c),l((c==null?void 0:c.data)||{})}catch(n){console.log("error",n)}};return be(()=>{d(r)},[r]),Q("div",{children:[k(xr,{title:r==null?void 0:r.graphName,setOpen:u}),k("div",{style:{width:"100%",height:"calc(100vh - 60px)"},children:k(ri,{centerNode:{vid:(s=r==null?void 0:r.traceNode)==null?void 0:s.vid},data:h,layout:{type:"force",linkDistance:190},title:e.title,subtitle:e.subtitle,backgroundColor:e.backgroundColor,showGrid:e.showGrid,showLegend:e.showLegend,showTooltip:e.showTooltip,showFullscreen:e.showFullscreen,showMinimap:e.showMinimap,customPlugins:{},onReady:p=>{console.log("KnowledgeGraphPreview ready:",p)}})})]})},Zo=({content:r,onClose:u,token:t})=>{const e=d=>{if(!(d!=null&&d.metadata))return;const s=Sr(d,""),{page_number:p,page_size:n,position:o,offset:E,chunk_type:c}=d.metadata;if(s==="markdown_table")return E!=null&&E.length?{annotations:[{id:w0(),offsets:E}],initialPage:1}:{};{if(!n||!o)return console.log("%c\u7F3A\u5C11\u6587\u4EF6size\u6216\u8005\u6587\u4EF6\u5750\u6807","color: red"),{};const m=Array.isArray(n)?n:JSON.parse(n);if(!m.length)return console.log("%c\u7F3A\u5C11\u6587\u4EF6size","color: red"),{};const y=Array.isArray(o)?o:JSON.parse(o);return!y.length||!p?(console.log("%c\u7F3A\u5C11\u6587\u4EF6\u5750\u6807\u6216\u8005\u6587\u4EF6\u9875\u6570","color: red"),{}):{annotations:y.map((a,v)=>({id:w0(),pageNumber:p[v],x:+(a[0][0]/m[0][0]).toFixed(4),y:+(a[0][1]/m[0][1]).toFixed(4),width:+((a[1][0]-a[0][0])/m[0][0]).toFixed(4),height:+((a[2][1]-a[0][1])/m[0][1]).toFixed(4),content:"",color:c==="image"?"#60f74f":"#4FC3F7"})),initialPage:p[0]}}},h=Ae(()=>{var d,s;if(console.log("content88888888888",r),r&&t){console.log("content999",r);const{annotations:p,initialPage:n}=e(r),o={...r,metadata:{source:((d=r==null?void 0:r.metadata)==null?void 0:d.source)||r.parse_url||r.url,page_size:(s=r==null?void 0:r.metadata)==null?void 0:s.page_size}},E=na(aa(o));return{filePath:E,fileName:Lr(o),fileType:Sr(o,E),totalPages:o.pdfPages||0,token:t,annotations:p,initialPage:n,initialZoom:ia(598,o)}}else return{}},[r]),l=Ae(()=>h.filePath?(console.log("curData",h),k(ca,{initialZoom:h.initialZoom||100,convertedFilePath:h.filePath,fileName:h.fileName,fileType:h.fileType,initialPage:h.initialPage,totalPages:h.totalPages,authorization:h.token,annotations:h.annotations,streamApiUrl:"/proxy/index/knowledgeBase/file/stream",eventsEmit:d=>{switch(d){case"viewer:close":u();break}},tools:{close:!0}})):k(rt,{}),[h]);return k("div",{style:{fontFamily:"Source Han Sans CN",fontSize:"12px"},className:"h-full w-full",children:l})},Ra=({curFileInfo:r,onClose:u,token:t})=>{const e=Ae(()=>{var l,d,s;if(r&&t){console.log("content999",r);const p={file_source:r.parse_url||r.parsedFilePath||r.url,file_type:r.file_type,metadata:{source:r.filePath||r.url||((l=r==null?void 0:r.metadata)==null?void 0:l.source)||"",page_size:(d=r==null?void 0:r.metadata)==null?void 0:d.page_size},pdfPages:r.pdfPages},n=na(aa(p));return{filePath:n,fileName:Lr(p),fileType:Sr(p,n),totalPages:p.pdfPages||0,token:t,initialZoom:ia(((s=document.getElementById("pdfBox"))==null?void 0:s.clientWidth)||0,p)}}else return{}},[r]),h=Ae(()=>(console.log("curData",e),e.filePath?k(ca,{initialZoom:e.initialZoom||100,convertedFilePath:e.filePath,fileName:e.fileName,fileType:e.fileType,initialPage:1,totalPages:e.totalPages,authorization:e.token,streamApiUrl:"/proxy/index/knowledgeBase/file/stream",eventsEmit:l=>{switch(l){case"viewer:close":u();break}},tools:{close:!0}}):k(rt,{})),[e]);return k("div",{id:"pdfBox",className:"h-full overflow-y-auto",children:h})},Jo=({curFileInfo:r,token:u,onClose:t})=>{const[e,h]=se(1),[l,d]=se(10),[s,p]=se([]),[n,o]=se([]),[E,c]=se(0);be(()=>{var v;const a=((v=r==null?void 0:r.metadata)==null?void 0:v.fetchUrl)||(r==null?void 0:r.fetchUrl);a&&y(a)},[r,e,l]);const m=async({url:a,params:v})=>{var f;try{const x=await i0.get(`${kr()}${a}?${new URLSearchParams(v).toString()}`,{headers:{Authorization:u}}),F=(f=x==null?void 0:x.data)==null?void 0:f.data;if(F){const{columns:_,dataList:b,totalData:I}=F;p(((_==null?void 0:_.slice(1))||[]).map(N=>({title:N.businessName,dataIndex:N.physicalName,key:N.physicalName}))),o(b||[]),c(I||[])}}catch(x){console.log("error",x)}},y=async a=>{m({url:`${a}`,params:{pageNo:e,pageSize:l}})},i=Ae(()=>{const{databaseName:a,businessTableName:v,tableName:f}=r;return`${a} - ${f||v}`},[r]);return Q("div",{children:[k(xr,{title:i,setOpen:t}),(s==null?void 0:s.length)>0?Q("div",{children:[k("div",{className:"p-4 overflow-auto h-[calc(100vh-120px)]",children:k(Ai,{columns:s,dataSource:n,pagination:!1,scroll:{x:"max-content"},rowKey:"id"})}),k("div",{className:"flex justify-end px-[18px]",children:k(Ni,{current:e,pageSize:l,responsive:!0,simple:!0,total:E,showSizeChanger:!0,showQuickJumper:!0,onChange:(a,v)=>{h(a),d(v||10)},onShowSizeChange:(a,v)=>{h(1),d(v)}})})]}):k(Ya,{})]})},wr=({i:r,item:u,j:t,clickTag:e})=>(console.log("j in tag",t),console.log("i in tag",r),console.log("item in tag",u),k("div",{style:{minWidth:"16px",height:"16px",backgroundColor:ts[u.key],margin:"0 4px",color:rs[u.key],display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"2px",fontSize:"12px",cursor:"pointer"},onClick:()=>e&&e(r,t,u),children:t.index},t.id));function es(r){if(typeof r=="string"){const u=r.trim();if(!u)return"";const t=u.match(/\d{4}-\d{2}-\d{2}/);if(t!=null&&t[0])return t[0];const e=new Date(u);return Number.isNaN(e.getTime())?"":e.toISOString().slice(0,10)}if(r instanceof Date&&!Number.isNaN(r.getTime()))return r.toISOString().slice(0,10);if(typeof r=="number"&&Number.isFinite(r)){const u=new Date(r);if(!Number.isNaN(u.getTime()))return u.toISOString().slice(0,10)}return""}const ts={knowledgeList:"#EAF4FD",searchList:"#E8F7F0",databaseList:"#FFF4E5",graphList:"#E7F8FB"},rs={knowledgeList:"#2072F0",searchList:"#39B83F",databaseList:"#F48C14",graphList:"#10BBD9"},hn=[{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}],vn=({type:r,data:u,token:t,eventsEmit:e,is_download:h})=>{const[l,d]=se(hn),[s,p]=se("mark"),[n,o]=se(!1),[E,c]=se({}),[m,y]=se("knowledgeList"),[i,a]=se(null),[v,f]=se({knowledgeList:[],searchList:[],databaseList:[],graphList:[]}),x=Ae(()=>{const B=4-l.length,D=Array(B).fill(null).map((q,U)=>({name:"",key:100+U})),g=[...l,...D];return console.log("rrrrrr",g),g},[l]),F=B=>{const D=typeof B=="number"?B:Number(String(B).trim());return Number.isFinite(D)?(Math.trunc(D*100)/100).toFixed(2):""},_=B=>{switch(B){case"searchList":return ci;case"databaseList":return li;case"graphList":return ui;default:return""}},b=B=>{const D=(B||"").toLowerCase();return["pdf"].includes(D)?"rag/pdf":["doc","docx"].includes(D)?"rag/word":["csv"].includes(D)?"rag/csv":["xls","xlsx"].includes(D)?"rag/excel":["ppt","pptx","pub"].includes(D)?"rag/ppt":["png","jpg","jpeg","jpge"].includes(D)?"rag/pic":["txt"].includes(D)?"rag/txt":["ofd"].includes(D)?"rag/ofd":["mp4","flv","avi","mkv","video"].includes(D)?"rag/video":"rag/txt"},I=(B,D)=>{if(B==="knowledgeList"){let q=((D==null?void 0:D.file_type)||"").toLowerCase();if(!q||q==="faq"){const U=(D==null?void 0:D.metadata)||{},G=U.folder_path||(D==null?void 0:D.folder_path)||U.file_path||U.source||(D==null?void 0:D.source)||(D==null?void 0:D.file_name)||"",Y=String(G).match(/\.([a-z0-9]+)$/i);Y&&(q=Y[1].toLowerCase())}return k(sa,{type:b(q),size:22,style:{flexShrink:0}})}const g=_(B);return g?k("img",{src:g,style:{width:"22px",height:"22px",flexShrink:0}}):null},N=B=>{if(String((B==null?void 0:B.file_type)||"").toLowerCase()==="video")return!0;const g=String((B==null?void 0:B.file_name)||(B==null?void 0:B.name)||""),q=g.includes(".")?g.split(".").pop():"";return["mp4","flv","avi","mkv"].includes(String(q).toLowerCase())},z=(B,D)=>B==="graphList"?D:B==="knowledgeList"?(console.log("++++++",D),D.map(g=>{const q=g.metadata||{},U=g.score;if(g.type==="faq"){const Y=q.folder_path||g.folder_path||q.knowledge_base_name||g.file_name||q.source||g.source||"",M=String(Y).match(/\.([a-z0-9]+)$/i),H=M?M[1].toLowerCase():"faq";return{...g,file_type:H,name:Y,score:U}}const G=g.sourceFileName||ii(g.source)||g.file_name;return{...g,file_type:oi(g.source)||g.file_type,name:G,score:U}}).sort((g,q)=>(q.score||0)-(g.score||0))):B==="searchList"?D.map(g=>({...g,name:g.sourceFileName||g.file_name})).sort((g,q)=>(q.score||0)-(g.score||0)):B==="databaseList"?D.map(g=>{const q=g.tableName?`${g.databaseName||"\u6570\u636E\u5E93"} - ${g.tableName}`:g.databaseName||g.name||"\u6570\u636E\u5E93";return{...g,name:q,file_name:q,file_type:"database"}}).sort((g,q)=>(q.score||0)-(g.score||0)):D,w=(B,D,g)=>{var q,U;switch(g.key){case"knowledgeList":const{pdfPages:G,parsedFilePath:Y,order_num:M,tags:H}=B||{},Z=D.id||M||"Unknown ID",P=(H||[]).find(W=>W.id===Z);if(B.type==="faq"){c(B),p("faq"),o(!0),e==null||e("retrive_tag:click",{tagInfo:{id:D.id,index:D.index,image_urls:D.image_urls||[]},fromtype:"10",leaf:{id:D.id,fromtype:"10"},referenceDoc:B});return}if(B.type==="video")return console.log("sdgasdgag",{file:{...B,...P}}),e==null?void 0:e("retrive_tag:click",{file:{...B,...P}});if(console.log("click knowledge tag",B,D),!B||!P)return;const{metadata:T}=P,S=T.source.split("/"),R=S[S.length-1]||"",$=R.split("."),j=$.slice(0,-1).join(".")||"Unknown Label",X=$[$.length-1]||"Unknown Type";c({id:Z,title:j,file_name:R,file_type:X,file_source:si(X)?`${lr}${T.source}`:Y,metadata:T,pdfPages:G}),p("mark"),o(!0);break;case"searchList":console.log("click search tag",B,D);break;case"databaseList":console.log("click database tag",B,D),p("database"),c({...B,metadata:B.metadata||{},fetchUrl:B.fetchUrl||((q=B.metadata)==null?void 0:q.fetchUrl)||""}),o(!0);break;case"graphList":console.log("click graph tag",B,D),p("graphPreview"),c({...D,traceNode:(U=(D==null?void 0:D.traceNodes)||[])==null?void 0:U[0]}),o(!0);break}};return be(()=>{if(r!==Na.REFERENCELIST||(console.log("data in reference drawer",u),!u))return;const{graphRefs:B,knowledgeRefs:D,webRefs:g,databaseRefs:q}=u;B!=null&&B.length&&(v.graphList=z("graphList",B)),D!=null&&D.length&&(v.knowledgeList=z("knowledgeList",D)),g!=null&&g.length&&(v.searchList=z("searchList",g)),q!=null&&q.length&&(v.databaseList=z("databaseList",q));const U=hn.filter(G=>{var Y;return(Y=v[G.key])==null?void 0:Y.length}).sort((G,Y)=>{var M,H;return(((M=v[Y.key])==null?void 0:M.length)||0)-(((H=v[G.key])==null?void 0:H.length)||0)});d(U),U!=null&&U.length&&y(U[0].key),f({...v})},[u]),Q(rt,{children:[Q("div",{className:"listWrap w-full h-full",children:[k(xr,{title:"\u77E5\u8BC6\u6EAF\u6E90",setOpen:()=>{const B=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(B)}}),Q("div",{style:{height:"calc(100% - 60px)"},children:[k("div",{className:"tabs",style:{display:"flex",justifyContent:"space-between",padding:"12px 20px"},children:x.map(B=>k("div",{className:"tab-item",style:{padding:"5.5px 12px",backgroundColor:B.name?m===B.key?"#4E6EF2":"#F5F6F9":"transparent",cursor:"pointer",borderRadius:"4px",color:m===B.key?"#FFFFFF":"#4E5969",fontSize:"14px",minWidth:"80px",display:"flex",justifyContent:"center"},onClick:()=>{B.name&&y(B.key)},children:B.name},B.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:l.map(B=>{let D=v[B.key]||[];return m!==B.key?null:k("div",{children:D.map(g=>{var q,U,G,Y,M,H,Z,P,T;return Q("div",{style:{width:"360px",padding:"4px 8px",borderRadius:"4px",margin:"6px 0",cursor:B.key==="knowledgeList"&&g.type==="faq"?"default":"pointer"},className:"listItemBox",onClick:()=>{B.key==="searchList"&&window.open(g.link,"_blank")},children:[Q("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px"},children:[Q("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:I(B.key,g)}),k(ct,{placement:"topLeft",title:((q=g==null?void 0:g.name)==null?void 0:q.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 S;B.key==="knowledgeList"&&g.type==="faq"||(B.key==="knowledgeList"?e==null||e("knowledge_referenceFile_title:click",{data:{...g,file_type:g.file_type,file_name:g.file_name,metadata:g.metadata,parsedFilePath:g.parsedFilePath}}):B.key==="databaseList"&&(p("database"),c({...g,metadata:g.metadata||{},fetchUrl:g.fetchUrl||((S=g.metadata)==null?void 0:S.fetchUrl)||""}),o(!0)))},children:g.name})})]}),!!((U=g==null?void 0:g.tags)!=null&&U.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(S=>k(wr,{i:g,item:B,j:S,clickTag:w},S.id))}),Q("div",{style:{width:"52px",justifyContent:N(g)?"flex-end":"space-between",alignItems:"center",marginRight:"8px",display:B.hideBtns||g.type==="faq"||g.faq_question||g.faq_answer?"none":"flex"},children:[!N(g)&&Q(rt,{children:[k("img",{src:Yo,style:{width:"16px",height:"16px",cursor:"pointer"},onClick:()=>{e==null||e("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:ni,style:{width:"16px",height:"16px",cursor:h?i?"wait":"pointer":"not-allowed",opacity:i?.7:1},onClick:async()=>{var W;if(!h||i)return;const S=((W=((g==null?void 0:g.tags)||[])[0])==null?void 0:W.metadata)||(g==null?void 0:g.metadata)||{},R=(g==null?void 0:g.path)||(S==null?void 0:S.source)||(g==null?void 0:g.source)||(g==null?void 0:g.convertedFilePath)||(g==null?void 0:g.file_source)||(g==null?void 0:g.parsedFilePath)||(g==null?void 0:g.url)||(g==null?void 0:g.filePath)||"",$=Lr({metadata:S,file_name:g==null?void 0:g.file_name})||String(R).split("/").pop()||(g==null?void 0:g.file_name)||"file";if(g.type!=="video"){e==null||e("referenceFile_download",{data:g,filePath:R,fileName:$});return}if(!R)return;const j=String(R).includes("http")?String(R):`${lr}${R}`,X=`reference-download-${$}`;a(X),we.loading({key:X,content:`\u6B63\u5728\u51C6\u5907\u4E0B\u8F7D\uFF1A${$}`,duration:0});try{await ai({filePath:j,fileName:$,token:t}),we.success({key:X,content:`\u4E0B\u8F7D\u5DF2\u5F00\u59CB\uFF1A${$}`})}catch{we.error({key:X,content:`\u4E0B\u8F7D\u5931\u8D25\uFF1A${$}`})}finally{a(null)}}})]})]}),B.key==="knowledgeList"&&g.type==="faq"&&(((G=g.metadata)==null?void 0:G.update_time)||g.score!==void 0||((Y=g==null?void 0:g.tags)==null?void 0:Y.length)&&g.tags.length>0)&&Q("div",{style:{marginTop:"4px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",fontSize:"12px",color:"#4E5969"},children:[Q("span",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:8},children:[g.score!==void 0&&Q("span",{children:["\u5206\u6570: ",F(g.score)]}),((M=g.metadata)==null?void 0:M.update_time)&&k("span",{children:es(g.metadata.update_time)})]}),((H=g==null?void 0:g.tags)==null?void 0:H.length)&&g.tags.length>0&&g.tags.length<=10&&k("span",{style:{display:"flex",alignItems:"center",flexShrink:0,gap:"2px"},children:(g.tags||[]).map(S=>k(wr,{i:g,item:B,j:S,clickTag:g.type==="faq"?void 0:w},S.id))})]}),g.score!==void 0&&!(g.type==="faq"||g.faq_question||g.faq_answer)&&k("div",{style:{display:"flex",alignItems:"center",height:"18px",marginTop:"4px"},children:Q("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:F(g.score)})]})}),k("div",{style:{flex:1,display:"flex",justifyContent:"flex-start",marginTop:"4px"},children:((Z=g==null?void 0:g.tags)!=null&&Z.length&&g.tags.length>10?g.tags:[]).map(S=>k(wr,{i:g,item:B,j:S,clickTag:g.type==="faq"?void 0:w},S.id))}),g.type==="faq"&&(g.faq_question||g.faq_answer)&&Q("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()!==""&&Q("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()!==""&&Q("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()})]})]}),!!((P=g==null?void 0:g.main_source)!=null&&P.length)&&Q("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(ct,{placement:"topLeft",title:((T=Cr(g.main_source[0]))==null?void 0:T.length)>22?Cr(g.main_source[0]):"",children:k("div",{style:{fontSize:"12px",color:"#4E5969",width:"289px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Cr(g.main_source[0])})})]})]},g.id)})},B.key)})})]})]}),k(dr,{drawer:{styles:{body:{padding:0},header:{display:"none"}}},children:Q(da,{autoFocus:!1,onClose:()=>o(!1),open:n,width:m==="graphList"?"100%":720,className:"overflow-x-hidden",destroyOnClose:!0,afterOpenChange:B=>{B||c(null)},children:[s==="graphPreview"&&k(Qo,{curFileInfo:E,onClose:o,token:t}),s==="mark"&&k(Zo,{content:E,onClose:o,token:t}),s==="preview"&&k(Ra,{curFileInfo:E,onClose:o,token:t}),s==="database"&&k(Jo,{curFileInfo:E,onClose:o,token:t}),s==="faq"&&E&&Q("div",{className:"p-4",style:{fontSize:"14px",color:"#1D2129",lineHeight:1.6},children:[E.faq_question!=null&&String(E.faq_question).trim()!==""&&Q("div",{style:{marginBottom:"12px"},children:[k("span",{style:{color:"#4E5969",marginRight:"4px"},children:"Q:"}),k("span",{children:String(E.faq_question).trim()})]}),E.faq_answer!=null&&String(E.faq_answer).trim()!==""&&Q("div",{children:[k("span",{style:{color:"#4E5969",marginRight:"4px"},children:"A:"}),k("span",{children:String(E.faq_answer).replace(/\s*--+[A-Za-z0-9]*\s*$/,"").trim()||String(E.faq_answer).trim()})]})]})]})})]})},ns=({fileData:r,token:u})=>{const[t,e]=se([]);be(()=>{var p;const d=r==null?void 0:r.knowledgeBases;if(!(d!=null&&d.length))return;const s=((p=d[0])==null?void 0:p.treeData)||[];s!=null&&s.length&&e(s)},[r]);const h=We(new Map),l=async(d,s)=>{var p,n;if(!h.current.get(d==null?void 0:d.fetchUrl))try{const o=t[s];o.loading=!0;const E=[...t];e(E);const c=await i0.get(`${di()}/${d.fetchUrl}`,{headers:{Authorization:u}}),m=(n=(p=c==null?void 0:c.data)==null?void 0:p.data)==null?void 0:n.records;if(m){const y=t[s];y.loading=!1,y.children=m;const i=[...t];i[s]=y,e(i),h.current.set(d==null?void 0:d.fetchUrl,!0)}else{const y=t[s];y.loading=!1;const i=[...t];e(i)}}catch{const E=t[s];E.loading=!1;const c=[...t];e(c)}};return Q(rt,{children:[k(xr,{title:"\u77E5\u8BC6\u5E93\u6587\u6863\u76EE\u5F55",setOpen:()=>{const d=new CustomEvent("aichat:right_set",{detail:{collapsed:!0}});window.dispatchEvent(d)}}),k("div",{style:{height:"calc(100% - 60px)",overflowY:"auto",padding:"16px"},children:t.map((d,s)=>{var p;return d.type==="file"?Q("div",{className:"flex",style:{marginTop:"8px"},children:[oa(d),k(ct,{placement:"top",title:((p=d.name)==null?void 0:p.length)>23?d.name:"",children:k("div",{style:{paddingLeft:"6px",width:"346px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default",fontSize:"14px"},children:d.name})})]}):k(as,{item:d,index:s,clickFileItem:l},s)})})]})},as=({item:r,index:u,clickFileItem:t})=>{var l;const[e,h]=se(!1);return Q("div",{style:{marginTop:"8px"},children:[Q("div",{className:"flex cursor-pointer",onClick:()=>{h(!e),!e&&t(r,u)},children:[oa(r),k(ct,{placement:"top",title:((l=r.name)==null?void 0:l.length)>23?r.name:"",children:Q("div",{style:{paddingLeft:"6px",width:"346px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"14px"},children:[r.name," (",r.fileCount||0,")"]})})]},u),k("div",{style:{padding:"2px 0 2px 14px",margin:"8px 0 0 7px",borderLeft:"2px solid #E5E6EB",display:e?"block":"none"},children:(r.children||[]).map((d,s)=>{var p;return Q("div",{className:"flex items-center",children:[k("div",{style:{width:"4px",height:"4px",borderRadius:"2px",background:"black"}}),k(ct,{placement:"top",title:((p=d.name)==null?void 0:p.length)>26?d.name:"",children:k("div",{style:{paddingLeft:"6px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"12px",width:"336px"},children:d.fileName})})]},s)})})]})};var Na=(r=>(r.REFERENCELIST="referencelist",r.ALLFILELIST="allFileList",r))(Na||{});function ju(r=fi){return function({token:t,url:e="http://localhost:8888",styles:h,CSRFToken:l,eventsEmit:d,scrollOld:s,locale:p="zh",messages:n,...o}){const E=Ae(()=>Qa({theme:qr,mode:"light"},h),[h]),[c,m]=se(!1),[y,i]=se(!1),[a,v]=se(null),[f,x]=se(!1),[F,_]=se("mark"),[b,I]=se({url:"",parse_url:"",file_type:"",file_name:""}),[N,z]=se([]),[w,B]=se(1),[D]=se(16),[g,q]=se(0),[U,G]=se(!1),[Y,M]=se([]),[H,Z]=se(void 0),[P,T]=se([]),[S,R]=se([]),[$,j]=se(void 0),[X,W]=se({display:"ready",sender:"ready",app:"initializing"});function ie(A,C){if(!C)return A;const L=Array.isArray(A)?[...A]:{...A};for(const O in C)if(C[O]!==void 0&&C[O]!==null&&Object.prototype.hasOwnProperty.call(C,O))if(O==="actions"&&Array.isArray(A[O])&&Array.isArray(C[O])){const K=new Map;A[O].forEach(J=>{J.name&&K.set(J.name,J)}),C[O].forEach(J=>{J.name&&K.set(J.name,J)}),L[O]=Array.from(K.values())}else typeof A[O]=="object"&&A[O]!==null&&!Array.isArray(A[O])&&typeof C[O]=="object"&&C[O]!==null&&!Array.isArray(C[O])?L[O]=ie(A[O],C[O]):L[O]=C[O];return L}const pe=Ae(()=>xa(p),[p]),o0=Ae(()=>{const A=pe;return{...Y0,switchs:(Y0.switchs??[]).map(L=>({...L,label:L.name==="netSearch"?A.sender.netSearch:A.sender.deepThinking})),actions:(Y0.actions??[]).map(L=>({...L,tip:L.name==="upload"?A.sender.fileUpload:L.tip}))}},[p,pe]),[Se,ue]=se(()=>ie(o0,o.senderConfig));be(()=>{const A=pe,C={...Y0,switchs:(Y0.switchs??[]).map(L=>({...L,label:L.name==="netSearch"?A.sender.netSearch:A.sender.deepThinking})),actions:(Y0.actions??[]).map(L=>({...L,tip:L.name==="upload"?A.sender.fileUpload:L.tip}))};ue(L=>{const O=ie(C,o.senderConfig);return Array.isArray(L.actions)&&Array.isArray(O.actions)&&(O.actions=O.actions.map((K,J)=>{var ee;const ae=(ee=L.actions)==null?void 0:ee[J];return ae&&ae.name===K.name&&ae.badgeCount!==void 0?{...K,badgeCount:ae.badgeCount}:K})),O})},[p,o.senderConfig,pe]);const{fileStatuses:ye,setFileStatuses:Ce,pollFileStatus:Te,handleRemoveFromTemp:Ze,resetStopFlag:Je,setStopFlag:e0,stoppedRef:f0,getTempFileList:ze,setFileManagerData:Ne,fileManagerData:ke}=$o({url:e,token:t,CSRFToken:l,activeSessionId:H}),[Xe,h0]=Re.useState(()=>{var C;if(!S||S.length===0)return;const A=S.find(L=>L.isDefault);return A?A.id:(C=S[0])==null?void 0:C.id});Re.useEffect(()=>{if(!S||S.length===0)return;const A=S.some(C=>C.id===Xe);if(!Xe||!A){const C=S.find(L=>L.isDefault);h0(C?C.id:S[0].id)}},[S]);const[V,xe]=se({}),De=We(void 0),Ye=We(void 0),N0=We(void 0),Ve=We(null),he=We(void 0),P0=We([]),[W0,T0]=se([]),[n0,z0]=se({}),[q0,L0]=se(!1),[j0,ot]=se([]),[st,V0]=se(!1),{api_startChat_re:s0,addEmptyMessage:x0,setLastEmptyMessage:F0,stopStream:E0,cancelStreamBySessionId:ut}=Mo({baseUrl:e,CSRFToken:l,token:t,setChatData:M,activeSessionId:H,setAppStatus:W,setConversationList:z}),Le=Ae(()=>{const A={};return(S||[]).forEach(C=>{A[C.id]=C}),A},[S]),oe=Ae(()=>{const A=Y.find(L=>L.id===H)||{id:H,messages:[]},C=A.configId?Le[A.configId]:null;return{...A,assistantInfo:C}},[Y,H,Le]);be(()=>{console.log("currentChatData",oe)},[oe]);const b0=Ae(()=>{if(oe.configId&&Le){const A=Le[oe.configId];return A!=null&&A.configJson?JSON.parse(A.configJson).is_download:!1}else return!1},[oe.configId,Le]);Ae(()=>{if((oe.configId||$)&&Le){const A=Le[oe.configId];if(A!=null&&A.configJson){const C=JSON.parse(A.configJson);return console.log("is_enableThinking",oe.configId,Le,$),!!C.thinking}else if($){const C=Le[$];if(C!=null&&C.configJson)return!!JSON.parse(C.configJson).thinking}}return!1},[oe.configId,Le,$]),be(()=>{if(De.current&&De.current!==H){const C=De.current,L=N.find(J=>J.sessionId===C&&J.isNew),O=Y.find(J=>J.id===C&&J.isNew),K=O&&O.messages&&O.messages.length>0;L&&!K&&(z(J=>J.filter(ae=>ae.sessionId!==C)),M(J=>J.filter(ae=>ae.id!==C)))}De.current=H;const A=oe.messages&&oe.messages.length>0?oe.messages[oe.messages.length-1].recommendQuestion:[];T(A)},[H,N,Y,oe.messages]);const Oe=async A=>{var C,L,O,K;if(!U){G(!0);try{const J=await i0.get(`${e}/qa/dialogue/list?pageNo=${A}&pageSize=${D}&sysType=INT_SESSION`,{headers:{Authorization:t}}),ae=((L=(C=J==null?void 0:J.data)==null?void 0:C.data)==null?void 0:L.records)||[],ee=((K=(O=J==null?void 0:J.data)==null?void 0:O.data)==null?void 0:K.total)||0;q(ee),z(Be=>{const Fe=new Map;return[...Be,...ae].forEach(qe=>{Fe.set(qe.sessionId,qe)}),Array.from(Fe.values())}),B(A)}catch{}finally{G(!1)}}};be(()=>{W(A=>({...A,app:"initializing"})),i0.get(`${e}/qa/search/config/helper/list?pageNo=1&pageSize=3000`,{headers:{Authorization:t}}).then(A=>{R(A.data.data||[])}).catch(()=>{}),Oe(1).then(()=>{H||G0(),W(A=>({...A,app:"ready"}))}).catch(()=>{W(A=>({...A,app:"error"}))})},[]),be(()=>{H&&(W(A=>({...A,display:"loading"})),ze(H),i0.get(`${e}/qa/dialogue/getDialogBySessionId?sessionId=${H}`,{headers:{Authorization:t}}).then(A=>{var Ge;if(!A.data.data){W(ne=>({...ne,display:"ready"}));return}const C=((Ge=A.data.data)==null?void 0:Ge.queryReplyPairList)||[],L=No(C),{sessionId:O,searchConfigDTO:K,filePath:J,configId:ae,reference:ee,webReference:Be,uploadedFiles:Fe,fileList:qe,currentFiles:Pe}=A.data.data;if(L.length>0){const ne=L.length-1-[...L].reverse().findIndex(Ee=>Ee.istype==="ai");ne>=0&&ne<L.length&&L[ne].istype==="ai"&&(ee&&(L[ne].reference=ee),Be&&(L[ne].webReference=Be))}const re=Pe||qe||Fe;if(re&&L.length>0){const ne=[...L].reverse().findIndex(Ee=>Ee.istype==="user");ne!==-1&&(console.log(L[L.length-1-ne].currentFiles,"filesData"),L[L.length-1-ne].currentFiles=re)}N.find(ne=>ne.sessionId===O)&&z(ne=>ne.map(Ee=>Ee.sessionId===O?{...Ee,searchConfigDTO:K,filePath:J,configId:ae}:Ee));const t0={configId:A.data.data.configId,filePath:A.data.data.filePath,searchConfigDTO:A.data.data.searchConfigDTO||{},sessionId:A.data.data.sessionId,label:A.data.data.label,kbId:A.data.data.kbId};M(ne=>{const Ee=ne.filter(Me=>Me.id!==H);return[{id:H,messages:L,...t0},...Ee]}),W(ne=>({...ne,display:"ready"}))}).catch(A=>{console.error("\u83B7\u53D6\u804A\u5929\u6570\u636E\u5931\u8D25:",A),A.response&&A.response.status===404&&G0(),W(C=>({...C,display:"error"}))}))},[H,e,t]),be(()=>{const A=ke.uploadedFiles.length;ue(C=>{const L=Array.isArray(C.actions)?C.actions:[];return{...C,actions:L.map(K=>K.name==="history"?{...K,badgeCount:A}:K)}})},[ke.uploadedFiles]),be(()=>{xi({url:e,token:t},A=>{ot(A)})},[]),Re.useEffect(()=>{ye.length&&M(A=>{if(!A[0])return A;const{messages:C}=A[0];for(let L=C.length-1;L>=0;L--)if(C[L].istype==="user"){const O=C[L].currentFiles||[];C[L].currentFiles=ye.map(K=>{var ae,ee,Be;const J=O.find(Fe=>Fe.uid===K.uid);return{name:((ae=K.file)==null?void 0:ae.name)||K.name,size:((ee=K.file)==null?void 0:ee.size)||K.size,type:((Be=K.file)==null?void 0:Be.type)||K.type,status:K.status,uid:K.uid,url:K.url||(J==null?void 0:J.url)||""}});break}return[...A]})},[ye]);let Ke=null,_e=null;const He=(A,C,L,O)=>{_e=Te(A,{onStatusUpdate:C,onComplete:L,onFail:O})},u0=(A,C)=>{M(L=>{const O=[...L];return O[0]&&(O[0]={...O[0],messages:O[0].messages.map(K=>K.queryId===A?{...K,feedbackResult:C}:K)}),O})},D0=async A=>{var C,L;if(A)try{const O=(oe==null?void 0:oe.configId)||((C=Le==null?void 0:Le[(oe==null?void 0:oe.configId)||""])==null?void 0:C.id)||"",K=await i0.get(`${e}/qa/ai/recommendQuestion?queryId=${A}&configId=${O||""}`.replace(/\?&/,"?"),{headers:{Authorization:t}});T(((L=K.data)==null?void 0:L.data)||[])}catch{T([])}};function S0(A){const{content:C,audioUrl:L,filePaths:O,queryId:K}=A;if(!H||!K)return;const J=(oe==null?void 0:oe.messages)||[],ae=J.findIndex(re=>(re==null?void 0:re.queryId)===K&&((re==null?void 0:re.istype)==="ai"||(re==null?void 0:re.isUser)===!1));let ee;if(ae>0)for(let re=ae-1;re>=0;re-=1){const te=J[re];if((te==null?void 0:te.istype)==="user"||(te==null?void 0:te.isUser)===!0){ee=te;break}}const Be=(ee==null?void 0:ee.content)??C;if(!Be)return;const Fe=(ee==null?void 0:ee.filePaths)??O,qe=(typeof Fe=="string"&&Fe?JSON.parse(Fe):Fe||[]).map(re=>re.uid),Pe=Date.now();F0({now:Pe}),W(re=>({...re,display:"processing",sender:"processing"})),ae>=0&&J[ae]&&M(re=>{if(!re[0])return re;const te=re[0],t0=te.messages||[];if(ae>=t0.length)return re;const Ge=t0.slice();return Ge[ae]={...Ge[ae],content:Ge[ae].content,reference:"[]",webReference:"[]",graphReference:null,databaseReference:null,status:2,chain:void 0},[{...te,messages:Ge},...re.slice(1)]}),A.clearFn&&A.clearFn(),z(re=>re.map(te=>te.sessionId===H?{...te,gmtModified:Pe}:te)),s0({configId:oe.configId,content:Be,fileUids:qe,lastDate:Pe,name:oe.label||"",queryId:K,sessionId:String(H||""),type:(ee==null?void 0:ee.audioUrl)??L?"audioUrl":"text",audioUrl:((ee==null?void 0:ee.audioUrl)??L)||"",enableThinking:!!V.reasoning,enableWebsearch:!!V.netSearch,qaChannel:V.qaChannel,tempKnowledgeBaseCheck:vt.current},re=>{D0(K)})}async function v0(A,C){if(X.sender!=="ready"){we.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 O=N.find(K=>K.sessionId===H);if(O&&O.isNew){let K=!1;const J=$||O.configId,ae=A&&A.content?A.content.slice(0,20):O.label||"\u672A\u547D\u540D\u4F1A\u8BDD";if(await new Promise((ee,Be)=>{yi({url:e,token:t,CSRFToken:l},{label:ae,sessionId:O.sessionId,sysType:"INT_SESSION",configId:J},Fe=>{Fe&&Fe.data&&Fe.data.sessionId?(z(qe=>qe.map(Pe=>Pe.sessionId===O.sessionId?{...Pe,isNew:!1,configId:J,label:ae}:Pe)),M(qe=>qe.map(Pe=>Pe.id===O.sessionId?{...Pe,isNew:!1,configId:J,label:ae}:Pe)),K=!0,ee()):(we.error("\u521B\u5EFA\u4F1A\u8BDD\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),Be())})}),!K)return;O0(H,A,C,J);return}O0(H,A,C)}function O0(A,C,L,O){const K="query-"+w0(32),J=N.find(re=>re.sessionId===A),ae=O||(J==null?void 0:J.configId)||oe.configId;console.log("\u52A9\u624B\u914D\u7F6E\u8BE6\u60C5",ae);const ee=C.content||C.text||"",Be=typeof ee=="string"?ee:String(ee),Fe=Be?Be.slice(0,20):"\u672A\u547D\u540D\u4F1A\u8BDD";let qe;if(C.files&&C.files.length>0&&(qe=C.files.map(re=>({name:re.file.name,size:re.file.size,type:re.file.type,filePath:re.filePath||"",convertedFilePath:re.convertedFilePath||"",uid:re.uid||""}))),console.log("\u672C\u5730\u6587\u4EF6\u4E0A\u4F20",C.files),x0({content:Be,queryId:K,currentFiles:qe,filePaths:qe?JSON.stringify(qe):void 0}),z(re=>re.map(te=>te.sessionId===A&&te.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&te.isNew?{...te,label:Fe,gmtModified:Date.now(),isNew:!1}:te)),M(re=>re.map(te=>te.id===A&&te.label==="\u672A\u547D\u540D\u4F1A\u8BDD"&&te.isNew?{...te,label:Fe,isNew:!1}:te)),C.files&&C.files.length>0){W(ne=>({...ne,sender:"uploading",display:"uploading"})),Ke=new AbortController,Je();const re=C.files.map(()=>`rc-upload-${Date.now()}-${Math.random().toString(36).slice(2)}`),te=C.files.map((ne,Ee)=>({...ne,uid:re[Ee],status:"uploading"}));Ce(te);const t0=new FormData;C.files.forEach(ne=>{t0.append("files",ne.file)});const Ge=String(A||"");t0.append("sessionId",Ge),t0.append("uids",re.join(",")),i0.post(`${e}/index/knowledgeBase/file/uploadFiles`,t0,{headers:{Authorization:t,"Content-Type":"multipart/form-data"},signal:Ke.signal}).then(ne=>{var g0,gt,mt,yt,Ct,ce,r0,a0,Ie,Qe;if(console.log("\u6587\u4EF6\u4E0A\u4F20\u7684\u6253\u5370\u7ED3\u679C",ne),console.log("\u6587\u4EF6\u4E0A\u4F20\u54CD\u5E94\u8BE6\u60C5:",{status:ne.status,success:(g0=ne.data)==null?void 0:g0.success,dataType:Array.isArray((gt=ne.data)==null?void 0:gt.data)?"array":typeof((mt=ne.data)==null?void 0:mt.data),dataLength:Array.isArray((yt=ne.data)==null?void 0:yt.data)?ne.data.data.length:"N/A",errorMsg:(Ct=ne.data)==null?void 0:Ct.errorMsg,errorCode:(ce=ne.data)==null?void 0:ce.errorCode,fullResponse:ne.data}),f0.current)return;const Ee=(r0=ne.data)==null?void 0:r0.data,c0=((a0=ne.data)==null?void 0:a0.success)===!0,Me=Array.isArray(Ee)&&Ee.length>0;if(c0&&Me){const Ue=Ee,B0=Ue.map(ve=>ve.uid);Ce(ve=>ve.map(fe=>{const ge=Ee.find(le=>le.uid===fe.uid);return ge?{...fe,...ge}:fe})),W(ve=>({...ve,sender:"processing",display:"analyzing"})),Ce(ve=>ve.map(fe=>({...fe,status:"parsing"}))),He(B0,ve=>{if(!ve||!Array.isArray(ve)){console.warn("pollFileStatus \u56DE\u8C03\u8FD4\u56DE\u7684 serverStatuses \u65E0\u6548:",ve);return}if(Ce(ge=>ge.map(le=>{const m0=ve.find(d0=>d0&&d0.uid===le.uid);if(m0)switch(m0.fileParseStatus??m0.status){case 3:return{...le,status:"done"};case 4:return{...le,status:"error"};case 1:case 2:default:return{...le,status:"parsing"}}return le})),Array.isArray(ve)&&ve.length>0&&ve.every(ge=>{if(!ge)return!1;const le=ge.fileParseStatus??ge.status;return le===3||le===4})){Ce([]);const ge=new Map;(ve||[]).forEach(le=>{ge.set(le.id,le)}),Ne(le=>({uploadedFiles:Ei(le.uploadedFiles,Ue).map(d0=>{var U0;return{...d0,pdfPages:((U0=ge.get(d0.id))==null?void 0:U0.pdfPages)||0}})}))}},()=>{L==null||L(),W(fe=>({...fe,sender:"processing",display:"processing"})),Ce(fe=>fe.map(ge=>{const le=Ue.find(m0=>m0.uid===ge.uid);return le?{...ge,...le,url:le.filePath,filePath:le.filePath,name:le.fileName||ge.name,convertedFilePath:le.convertedFilePath||ge.convertedFilePath}:ge})),M(fe=>{if(!fe[0])return fe;const{messages:ge}=fe[0];for(let le=ge.length-1;le>=0;le--)if(ge[le].istype==="user"){const m0=ge[le].currentFiles||[];ge[le].currentFiles=m0.map(d0=>{const U0=Ue.find(gr=>gr.uid===d0.uid);return U0?{...d0,...U0}:d0});break}return[...fe]});const ve=Date.now();s0({configId:ae,content:Be,fileUids:B0,lastDate:ve,name:Fe,queryId:K,sessionId:String(A||""),type:"text",audioUrl:"",enableThinking:!!V.reasoning,enableWebsearch:!!V.netSearch,qaChannel:V.qaChannel,tempKnowledgeBaseCheck:vt.current},fe=>{D0(K)})},ve=>{W(fe=>({...fe,display:"ready",sender:"ready"})),Ce(fe=>fe.map(ge=>({...ge,status:"error",message:ve})))})}else{let Ue="\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25";(Ie=ne.data)!=null&&Ie.errorMsg?Ue=ne.data.errorMsg:c0?Me||(Array.isArray(Ee)?Ee.length===0&&(Ue="\u4E0A\u4F20\u5931\u8D25: \u8FD4\u56DE\u6570\u636E\u4E3A\u7A7A"):Ue=`\u4E0A\u4F20\u5931\u8D25: \u8FD4\u56DE\u6570\u636E\u683C\u5F0F\u9519\u8BEF\uFF0C\u671F\u671B\u6570\u7EC4\uFF0C\u5B9E\u9645\u4E3A ${typeof Ee}`):Ue=`\u4E0A\u4F20\u5931\u8D25: success=${(Qe=ne.data)==null?void 0:Qe.success}`,console.error("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\u8BE6\u60C5:",{errorMsg:Ue,response:ne.data,isSuccess:c0,isValidData:Me}),we.error(Ue),W(B0=>({...B0,display:"error",sender:"ready"})),Ce(B0=>B0.map(ve=>({...ve,status:"error",message:Ue})))}}).catch(ne=>{var Ee,c0;((Ee=ne==null?void 0:ne.response)==null?void 0:Ee.status)===413?(c0=ne==null?void 0:ne.response)!=null&&c0.statusText.includes("Request Entity Too Large")&&we.error("\u6587\u4EF6\u8D85\u8FC7\u6700\u5927\u53EF\u4E0A\u4F20\u9650\u5236"):we.error("\u7F51\u7EDC\u9519\u8BEF"),W(Me=>({...Me,display:"error",sender:"ready"})),Ce(Me=>Me.map(g0=>({...g0,status:"error",message:"\u7F51\u7EDC\u9519\u8BEF"})))});return}W(re=>({...re,display:"processing",sender:"processing"}));const Pe=Date.now();z(re=>re.map(te=>te.sessionId===A?{...te,gmtModified:Pe}:te)),L==null||L(),s0({configId:ae,content:Be,fileUids:[],lastDate:Pe,name:Fe,queryId:K,sessionId:String(A||""),type:"text",audioUrl:"",enableThinking:!!V.reasoning,enableWebsearch:!!V.netSearch,qaChannel:V.qaChannel,tempKnowledgeBaseCheck:vt.current},re=>{D0(K)})}function K0(A){A.restult==1?Fr({url:e,token:t,CSRFToken:l},{queryId:A.queryId},()=>{u0(A.queryId,null)}):Qr({url:e,token:t,CSRFToken:l},{restult:1,queryId:A.queryId},()=>{u0(A.queryId,1)})}function G0(A){const C=w0(32),L={sessionId:C,label:"\u672A\u547D\u540D\u4F1A\u8BDD",gmtModified:Date.now(),searchConfigDTO:{},filePath:"",configId:"",isNew:!0};z(O=>[{...L,messages:[]},...O]),M(O=>[{id:C,messages:[],...L},...O]),Z(C)}function M0(A){if(A!=null&&A.sessionId&&A.sessionId!==H){H&&ut(H),Z(A.sessionId),W(L=>({...L,sender:"ready"}));const C=Y.find(L=>L.id===A.sessionId);if(C&&C.messages&&C.messages.length>0){const L=[...C.messages].reverse().find(O=>O.istype==="ai");L&&L.recommendQuestion?T(L.recommendQuestion):T([])}else T([])}}const X0=async A=>new Promise((C,L)=>{Ci({url:e,token:t,CSRFToken:l},{sessionId:A},O=>{O?(we.success("\u5220\u9664\u6210\u529F!"),C(O)):(we.error("\u5220\u9664\u5931\u8D25!"),L(O))})}),hr=async()=>{try{return z([]),q(0),await Oe(1),[]}catch(A){throw we.error("\u5237\u65B0\u4F1A\u8BDD\u5217\u8868\u5931\u8D25"),A}},dt=async(A,C)=>new Promise((L,O)=>{Fi({url:e,token:t,CSRFToken:l},{label:C,sessionId:A},K=>{if(K){const J=Date.now();z(ae=>ae.map(ee=>ee.sessionId===A?{...ee,label:C,gmtModified:J}:ee)),M(ae=>ae.map(ee=>ee.id===A?{...ee,label:C}:ee)),we.success("\u91CD\u547D\u540D\u6210\u529F!"),L(K)}else we.error("\u91CD\u547D\u540D\u5931\u8D25"),O(K)})}),ft=A=>{z(C=>{const L=C.filter(O=>O.sessionId!==A);return H===A&&(L.length>0?Z(L[0].sessionId):G0()),L})},xt=(A,C)=>{const L=Date.now();z(O=>O.map(K=>K.sessionId===A?{...K,label:C,gmtModified:L}:K)),M(O=>O.map(K=>K.id===A?{...K,label:C}:K))},pt=A=>{Qr({url:e,token:t,CSRFToken:l},{...A,...n0,restult:0},()=>{u0(n0.queryId,0)})},ht=A=>{const C=A.new_name,L=a.data.label;C&&C!==L?a.async_renameConversation(C).then(()=>{a.fn_renameItemInList(C),m(!1)}).catch(()=>{}):m(!1)},vr=A=>{a.async_deleteConversation().then(()=>{a.fn_removeItemFromList(),i(!1)}).catch(()=>{})},l0=(A,C)=>{switch(console.log(A,C),A){case"close_remove":i(!1);break;case"close_rename":m(!1);break;case"ok_rename":ht(C);break;case"ok_remove":vr();break}},lt=async({url:A,params:C,replacePredataFunction:L})=>{var O,K;try{const J=await i0.post(A,C,{headers:{Authorization:t}}),ae=(K=(O=J==null?void 0:J.data)==null?void 0:O.data)==null?void 0:K.data;ae&&L(ae)}catch(J){console.log("error",J)}},La=async A=>{var C;try{const L=await i0.get(`${kr()}/index/knowledgeBase/file/getFileStatusByUids?uids=${A.data.uids}`,{headers:{Authorization:t}});return console.log("resslkdjgalsg",L),(C=L==null?void 0:L.data)==null?void 0:C.data}catch{}},Vr=async A=>{try{const C=await La({data:{uids:A.uid},config:{url:kr(),token:t,enableMock:!1}});if(C!=null&&C.length){const L=C[0];if(Er(L.convertedFilePath)==="pdf"&&!L.pdfPages)return we.warning("\u6587\u4EF6\u8FD8\u672A\u89E3\u6790\u5B8C\u6210,\u8BF7\u7A0D\u540E\u9884\u89C8");if(L.convertedFilePath)I({...A,parse_url:L.convertedFilePath,pdfPages:L.pdfPages}),_("preview"),x(!0);else return we.warning("\u6587\u4EF6\u89E3\u6790\u5931\u8D25")}}catch{}},vt=We(!1),k0=(A,C)=>{var L,O,K,J,ae,ee,Be,Fe,qe,Pe,re,te,t0;switch(console.log(`[Event] ${A}`,C),A){case"TempKnowledgeBase":vt.current=C;break;case"reference_file:click":if(C.file_type==="image")return;const Ge=ce=>{I({...C,file_type:C.type,file_name:C.file,...ce}),_("preview"),x(!0)},ne=Er((C==null?void 0:C.parse_url)||""),Ee=(L=C.metadata)!=null&&L.source?`${lr}${C.metadata.source}`:C.filePath||C.url||C.convertedFilePath||"",c0=Er(Ee),Me=()=>{if(C.uid)Vr(C);else return C.references?void 0:we.warning("\u6587\u4EF6\u8FD8\u672A\u89E3\u6790\u5B8C\u6210,\u8BF7\u7A0D\u540E\u9884\u89C8")};if(vi.includes(c0)){const ce=(O=C.metadata)!=null&&O.source?`${lr}${C.metadata.source}`:C.url||C.convertedFilePath||C.filePath;c0==="pdf"?C.pdfPages?Ge({parse_url:ce}):Me():Ge({parse_url:ce})}else ne==="pdf"?C.pdfPages?Ge():Me():C.parse_url?Ge():Me();break;case"conversations:load_more":{N.length<g&&!U&&Oe(w+1);break}case"retrieve-sql-data:pagingation_click":const{page:g0,pageSize:gt,fetchUrl:mt,source:yt,replacePredataFunction:Ct}=C;lt({url:`${e}${mt}`,replacePredataFunction:Ct,params:{pageNo:g0,pageSize:gt,convertedFilePath:yt,stream:!1}});break;case"web_referenceFile_title:click":if(!((K=C==null?void 0:C.data)!=null&&K.link))return console.error("\u6CA1\u6709\u7F51\u9875\u5730\u5740");window.open(C.data.link,"_blank");break;case"conversation:item_click":M0(C);break;case"files:finished_animation_complete":Ce([]);break;case"conversation:create":G0();break;case"conversation:new_assistant_change":j(C.assistantId);break;case"conversations:rename_icon_clicked":v({data:C,async_renameConversation:ce=>dt(C.sessionId,ce),fn_renameItemInList:ce=>xt(C.sessionId,ce)}),m(!0);break;case"conversations:delete_icon_clicked":v({data:C,async_deleteConversation:()=>X0(C.sessionId),async_refreshConversationList:hr,fn_removeItemFromList:()=>ft(C.sessionId)}),i(!0);break;case"sender:send":v0(C,C.clearFn);break;case"sender:send_recommandQuestion":{const ce=((C==null?void 0:C.content)??"").toString();if(!ce)break;v0({content:ce},()=>{});break}case"chatbox:follow_up_question_click":{const ce=((C==null?void 0:C.question)??(C==null?void 0:C.content)??"").toString();if(!ce)break;v0({content:ce},()=>{});break}case"sender:stop":e0(),Ke&&(Ke.abort(),Ke=null),_e&&(_e(),_e=null),W(ce=>({...ce,display:"ready",sender:"ready"})),Ce([]),E0==null||E0();break;case"sender:clear":(J=C.clearFn)==null||J.call(C);break;case"sender:configChange":C&&C.all&&xe(C.all);break;case"sender:action_upload":Ve.current&&Ve.current.click();break;case"sender:action_history":V0(!0);break;case"uploaded_file:item_click":break;case"action_copy:click":C&&Ro(C.content,C.event);break;case"chatbox:copy":{let ce=(C==null?void 0:C.content)||"";if(!ce)break;ce=ce.replace(/\[retrive-tag[^\]]*\][\s\S]*?\[\/retrive-tag\]/g,"");const r0=async Ie=>{try{return await navigator.clipboard.writeText(Ie),we.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F"),!0}catch{return!1}},a0=Ie=>{const Qe=document.createElement("textarea");Qe.value=Ie,Qe.style.position="fixed",Qe.style.opacity="0",document.body.appendChild(Qe),Qe.focus(),Qe.select();try{document.execCommand("copy"),we.success("\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F")}catch{we.error("\u590D\u5236\u5931\u8D25")}document.body.removeChild(Qe)};r0(ce).then(Ie=>{Ie||a0(ce)});break}case"chatbox:repeat":console.log(C,"sdkflskdjflksdjfklsdjlfkjsdklfjsdklfjlks"),S0(C);break;case"action_thumbsup":K0(C);break;case"chatbox:like":K0({queryId:C==null?void 0:C.queryId,restult:C==null?void 0:C.result});break;case"action_thumbsdown":C.restult===0?Fr({url:e,token:t,CSRFToken:l},{queryId:C.queryId},()=>{u0(C.queryId,null)}):(z0(C),L0(!0));break;case"chatbox:dislike":(C==null?void 0:C.result)===0?Fr({url:e,token:t,CSRFToken:l},{queryId:C.queryId},()=>{u0(C.queryId,null)}):(z0({queryId:C==null?void 0:C.queryId}),L0(!0));break;case"retrive_tag:click":{let ce=(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"&&!ce&&((ae=C==null?void 0:C.leaf)==null?void 0:ae.id)!=null&&((ee=oe==null?void 0:oe.messages)!=null&&ee.length)){const r0=oe.messages;for(let a0=r0.length-1;a0>=0;a0--){const Ie=r0[a0];if((Ie==null?void 0:Ie.istype)!=="ai")continue;const Qe=(Ie==null?void 0:Ie.faqReference)??((Be=Ie==null?void 0:Ie.reply)==null?void 0:Be.faqReference)??(Ie==null?void 0:Ie.reference);if(!Qe)continue;let Ue=[];try{const $e=typeof Qe=="string"?(()=>{const $a=Qe.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($a)})():Qe;Ue=Array.isArray($e)?$e:[$e]}catch{continue}if(Ue.length===0)continue;const B0=String(C.leaf.id);let ve=Ue.findIndex($e=>String(($e==null?void 0:$e.pk)??($e==null?void 0:$e.order_num)??($e==null?void 0:$e.id))===B0);if(ve<0){const $e=Number(B0);Number.isInteger($e)&&$e>=1&&$e<=Ue.length&&(ve=$e-1)}if(ve<0)continue;const fe=Ue[ve],ge=ve+1,le=fe.metadata||{},m0=fe.faq_question||le.sourceFileName||le.source&&String(le.source).split("/").pop()||"FAQ",d0=fe.folder_path||le.folder_path||le.knowledge_base_name||"",U0=d0?`${d0} - ${m0}`:m0,gr=`\u77E5\u8BC6\u5E93${ge}\u540D\uFF1A${U0}`,Ft=String(fe.pk??fe.order_num??fe.id??""),Gr=typeof fe.score=="number"?fe.score:typeof le.score=="number"?le.score:0;ce={knowledgeRefs:[{id:Ft,file_id:Ft,file_name:gr,file_type:"faq",type:"faq",path:"",score:Gr,rrf_score:Gr,tags:[{id:B0,index:ge,image_urls:((Fe=C==null?void 0:C.tagInfo)==null?void 0:Fe.image_urls)||[],metadata:le}],source:fe.folder_path||"",order_num:Ft,pk:Ft,faq_question:fe.faq_question,faq_answer:fe.faq_answer,folder_path:fe.folder_path,metadata:le,faqIndex:ge,...fe}],webRefs:[],graphRefs:[],databaseRefs:[],images:[],raw:{}};break}}if((C==null?void 0:C.fromtype)==="10"&&ce){const r0=new CustomEvent("aichat:right_set_content",{detail:{content:k(vn,{type:"referencelist",data:ce,token:t,eventsEmit:d,is_download:b0})}});window.dispatchEvent(r0);const a0=new CustomEvent("aichat:right_set",{detail:{collapsed:!1}});window.dispatchEvent(a0)}d==null||d("retrive_tag:click",C);break}case"referenceFile_view":d==null||d("referenceFile_view",C);break;case"referenceFile_question":console.log(C,"zhezhhzhzh"),Vr(C.data||C),d==null||d("referenceFile_question",C);break;case"referenceFile_download":d==null||d("referenceFile_download",C);break;case"references:click":case"knowledge_base_view_all:click":{const ce=()=>A==="references:click"?k(vn,{type:"referencelist",data:C,token:t,eventsEmit:d,is_download:b0}):k(ns,{fileData:C,token:t}),r0=new CustomEvent("aichat:right_set_content",{detail:{content:k(ce,{})}});window.dispatchEvent(r0);const a0=new CustomEvent("aichat:right_set",{detail:{collapsed:!1}});window.dispatchEvent(a0);break}case"retrive_tag:click":d==null||d("retrive_tag:click",C);break;case"fileManager:change":{typeof(C==null?void 0:C.setUploadedFiles)=="function"&&(Ye.current=C.setUploadedFiles,N0.current=C.removeFile,he.current=C==null?void 0:C.senderConfig,P0.current=Array.isArray(C==null?void 0:C.uploadedFiles)?C.uploadedFiles:[],Array.isArray(C==null?void 0:C.uploadedFiles)&&T0(C.uploadedFiles),console.log("[DEBUG] fileManager:change \u4E8B\u4EF6\u89E6\u53D1\uFF0CsetUploadedFilesRef \u5DF2\u8BBE\u7F6E",{hasSetUploadedFiles:!!Ye.current,uploadedFilesCount:((qe=C==null?void 0:C.uploadedFiles)==null?void 0:qe.length)||0,pendingFilesCount:((Pe=C==null?void 0:C.uploadedFiles)==null?void 0:Pe.length)||0,hasSenderConfig:!!(C!=null&&C.senderConfig),senderConfig:C==null?void 0:C.senderConfig,upload_number_limit:(re=C==null?void 0:C.senderConfig)==null?void 0:re.upload_number_limit,upload_size_limit:(te=C==null?void 0:C.senderConfig)==null?void 0:te.upload_size_limit}));break}case"uploaded_file:removeFromTemp":{console.log("[DEBUG] mergedEventsEmit uploaded_file:removeFromTemp \u4E8B\u4EF6",C);const ce=(t0=C==null?void 0:C.file)==null?void 0:t0.uid;if(!ce){console.warn("[DEBUG] \u7F3A\u5C11uid\uFF0C\u65E0\u6CD5\u5220\u9664\u4E34\u65F6\u6587\u4EF6",C);break}const r0=[...(oe==null?void 0:oe.messages)||[]].reverse().find(Ie=>Ie.istype==="user"),a0=r0==null?void 0:r0.queryId;Ze(ce,a0);break}case"uploaded_file:remove_batch":break;default:d==null||d(A,C)}},Oa=[{key:"conversations",type:"custom",label:"\u5BF9\u8BDD\u5386\u53F2",icon:k(Ti,{size:16}),enabled:!0,component:k(_o,{data:N,assistantList:S,activedItem:H||"",hasMore:N.length<g,loadingMore:U,sortRules:[{label:"\u5F53\u5929",dayPeriod:1},{label:"3\u5929",dayPeriod:3},{label:"7\u5929",dayPeriod:7},{label:"30\u5929",dayPeriod:30}],eventsEmit:k0,styles:E.theme})}],Kr=Re.useCallback(()=>k(Oo,{eventsEmit:k0,assistantList:S,styles:E,selectedId:Xe,onSelectAssistant:h0,productLogo:o==null?void 0:o.productLogo}),[k0,S,E,Xe,o==null?void 0:o.productLogo]),Ma={...Re.useMemo(()=>({AiChatBox:(A,C)=>{var qe,Pe,re;const L=C===(((qe=oe==null?void 0:oe.messages)==null?void 0:qe.length)||0)-1;let O="ready";if(L)if(A.status!==void 0)switch(A.status){case 0:O="thinking";break;case 1:O="processing";break;case 2:O="ready";break;case 3:O="error";break;case 4:O="thinking";break;default:O=X.display}else O=X.display;let K=[];if(Array.isArray(P))K=P;else if(typeof P=="string")try{K=JSON.parse(P)||[]}catch{K=[]}const J=(()=>{const te=A==null?void 0:A.reference;if(!te)return"[]";if(typeof te=="string")try{return JSON.parse(te),te}catch{return"[]"}try{return JSON.stringify(te)}catch{return"[]"}})(),ae=(()=>{const te=A==null?void 0:A.webReference;if(!te)return"[]";if(typeof te=="string")try{return JSON.parse(te),te}catch{return"[]"}try{return JSON.stringify(te)}catch{return"[]"}})(),ee=(()=>{const te=A==null?void 0:A.graphReference;if(!te)return"[]";if(typeof te=="string")try{return JSON.parse(te),te}catch{return"[]"}try{return JSON.stringify(te)}catch{return"[]"}})(),Be=A==null?void 0:A.databaseReference,Fe=(()=>{var t0,Ge,ne;if(A!=null&&A.chainRespTime||(t0=A==null?void 0:A.reply)!=null&&t0.chainRespTime)return(A==null?void 0:A.chainRespTime)??((Ge=A==null?void 0:A.reply)==null?void 0:Ge.chainRespTime);const te=(A==null?void 0:A.chain)||((ne=A==null?void 0:A.reply)==null?void 0:ne.chain);if(Array.isArray(te)&&te.length>0){const Ee=te.reduce((c0,Me)=>{const g0=(Me==null?void 0:Me.chainRespTime)??(Me==null?void 0:Me.respTime);return g0!=null&&g0>0?c0+g0:c0},0);return Ee>0?Ee:void 0}})();return k(Zr,{...A,token:t,streamUrl:"/proxy/index/knowledgeBase/file/stream",referenceMode:"button",reference:J,webReference:ae,graphReference:ee,databaseReference:Be,contentType:"stream",displayStatus:O,eventsEmit:k0,isLast:L&&(A==null?void 0:A.istype)==="ai",followUpQuestions:L&&(A==null?void 0:A.istype)==="ai"?K:[],defaultAnswer:((Pe=oe==null?void 0:oe.searchConfigDTO)==null?void 0:Pe.defaultAnswer)||"\u4E0D\u77E5\u9053\u4EC0\u4E48\u539F\u56E0\u6211\u4EEC\u6CA1\u80FD\u67E5\u5230\u4F60\u8981\u7684\u95EE\u9898*-*",is_download:b0,styles:E,enableThoughtChain:!0,chain:A==null?void 0:A.chain,thoughtChainNodes:A==null?void 0:A.thoughtChainNodes,thoughtChainStatus:A==null?void 0:A.status,enableCot:(A==null?void 0:A.enableCot)??((re=A==null?void 0:A.reply)==null?void 0:re.enableCot),chainRespTime:Fe},`${(A==null?void 0:A.queryId)||(A==null?void 0:A.id)||C}-${(A==null?void 0:A.istype)||"unknown"}`)},LogoBox:A=>A&&A.LogoBox===null?null:A&&typeof A.LogoBox=="function"?k(A.LogoBox,{}):k("div",{className:"text-2xl w-full text-center font-bold",children:"\u5C0F\u9CB8\u667A\u80FD\u52A9\u624B"}),DisplayLoading:()=>k(jo,{}),DisplayError:()=>k(Ko,{}),AppError:()=>k(Vo,{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 A,C;return k(Wo,{title:(A=o==null?void 0:o.appLoadingConfig)==null?void 0:A.title,subtitle:((C=o==null?void 0:o.appLoadingConfig)==null?void 0:C.subtitle)||""})},UserChatBox:(A,C)=>k(Zr,{token:t,streamUrl:"/proxy/index/knowledgeBase/file/stream",...A,referenceMode:"button",contentType:"plainText",isUser:!0,displayStatus:"ready",eventsEmit:k0,styles:E,fileManagerData:ke,currentFiles:A==null?void 0:A.currentFiles},`${(A==null?void 0:A.queryId)||(A==null?void 0:A.id)||C}-user`),WelcomeComponent:Kr}),[Kr,oe,X.display,k0,E,b0,ke]),...o.CustomComponents||{}};be(()=>{ue(A=>{const C=Array.isArray(A.switchs)?A.switchs.map(L=>L.name==="reasoning"?{...L,enabled:!0}:L):[];return{...A,switchs:C}})},[]);const Ua=Ae(()=>ke.uploadedFiles||[],[ke]),{FileDisplayTools:Ha}=pi({fileManagerData:{uploadedFiles:Ua},styles:E,eventsEmit:k0});return k(Wi,{locale:p,children:Q("div",{style:{height:"100%",minWidth:"1116px",overflow:"hidden"},children:[k("input",{ref:Ve,type:"file",multiple:!0,accept:"image/*,.pdf,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.txt,.md,.json,.csv,.zip,.rar,.7z",style:{display:"none"},onChange:A=>{const C=A.target.files;if(C&&C.length>0){console.log("[DEBUG] handleFileSelect \u89E6\u53D1",{filesCount:C.length,hasSetUploadedFilesRef:!!Ye.current,hasSenderConfig:!!he.current,dynamicSenderConfig:Se,dynamicSenderConfigKeys:Se?Object.keys(Se):[],senderConfigRef:he.current,senderConfigRefKeys:he.current?Object.keys(he.current):[]});const L=Array.from(C);let O=he.current;(!O||O.upload_size_limit===void 0&&O.upload_number_limit===void 0&&(!O.upload_file_type_limit||O.upload_file_type_limit.length===0))&&(O=Se);const K=P0.current||[];console.log("[DEBUG] \u9A8C\u8BC1\u914D\u7F6E\u68C0\u67E5",{configSource:O,upload_number_limit:O==null?void 0:O.upload_number_limit,upload_size_limit:O==null?void 0:O.upload_size_limit,existingFilesCount:K.length,newFilesCount:L.length});const J=O&&(O.upload_size_limit!==void 0||O.upload_number_limit!==void 0&&O.upload_number_limit>0||O.upload_file_type_limit&&O.upload_file_type_limit.length>0);if(console.log("[DEBUG] \u914D\u7F6E\u68C0\u67E5\u7ED3\u679C",{hasUploadLimitConfig:J,upload_number_limit:O==null?void 0:O.upload_number_limit,upload_size_limit:O==null?void 0:O.upload_size_limit,upload_file_type_limit:O==null?void 0:O.upload_file_type_limit}),J){const ae={upload_size_limit:O.upload_size_limit,upload_number_limit:O.upload_number_limit,upload_file_type_limit:O.upload_file_type_limit,upload_limit_message:O.upload_limit_message};console.log("[DEBUG] \u6267\u884C\u6587\u4EF6\u9A8C\u8BC1",{uploadConfig:ae,existingFilesCount:K.length,newFilesCount:L.length,totalCount:K.length+L.length});const ee=gi(L,K,ae);if(console.log("[DEBUG] \u9A8C\u8BC1\u7ED3\u679C",{valid:ee.valid,errors:ee.errors,rejectedFilesCount:ee.rejectedFiles.length}),!ee.valid){mi(ee);const Be=L.filter(Fe=>!ee.rejectedFiles.includes(Fe));if(Be.length===0){Ve.current&&(Ve.current.value="");return}L.splice(0,L.length,...Be)}}if(Ye.current){const ae=L.map(ee=>({file:ee,type:ee.type.startsWith("image/")?"image":"document",status:"pending",name:ee.name}));console.log("[DEBUG] \u901A\u8FC7 setUploadedFilesRef \u8BBE\u7F6E\u6587\u4EF6",ae),Ye.current(ae)}else console.warn("[DEBUG] setUploadedFilesRef \u672A\u8BBE\u7F6E\uFF0C\u5EF6\u8FDF\u91CD\u8BD5"),setTimeout(()=>{if(Ye.current){const ae=L.map(ee=>({file:ee,type:ee.type.startsWith("image/")?"image":"document",status:"pending",name:ee.name}));console.log("[DEBUG] \u5EF6\u8FDF\u540E\u901A\u8FC7 setUploadedFilesRef \u8BBE\u7F6E\u6587\u4EF6",ae),Ye.current(ae)}else console.error("[DEBUG] \u5EF6\u8FDF\u540E setUploadedFilesRef \u4ECD\u672A\u8BBE\u7F6E")},100)}Ve.current&&(Ve.current.value="")}}),k(r,{...o,status:X,chatData:oe,sidebar:Oa,recommandQuestions:[],eventsEmit:k0,styles:E,senderConfig:Se,fileUploadStatus:ye,CustomComponents:Ma,activeSessionId:H,scrollOld:s,rightbarWidth:"400px",locale:p,messages:n,disclaimer:o.disclaimer??pe.disclaimer,chatHeader:{title:(oe==null?void 0:oe.label)||pe.chatHeader.newConversation,tools:Ha}}),k(hi,{open:q0,feedBackList:j0,setOpen:L0,handleConfirm:pt}),k(Go,{isModalOpen:c,handleOk:l0,handleCancel:()=>l0("close_rename"),data:(a==null?void 0:a.data)||{}}),k(Xo,{isModalOpen:y,handleOk:l0,handleCancel:()=>l0("close_remove"),data:(a==null?void 0:a.data)||{}}),k(dr,{drawer:{styles:{body:{padding:0},header:{display:"none"}}},children:k(da,{autoFocus:!1,onClose:()=>x(!1),open:f,width:F==="graphPreview"?"100%":720,className:"overflow-x-hidden",destroyOnClose:!0,children:F==="preview"&&k(Ra,{curFileInfo:b,onClose:x,token:t})})})]})})}}var _t={exports:{}},wt={exports:{}},is=wt.exports,gn;function de(){return gn||(gn=1,(function(r,u){(function(t,e){r.exports=e()})(is,function(){var t=t||(function(e,h){var l;if(typeof window<"u"&&window.crypto&&(l=window.crypto),typeof self<"u"&&self.crypto&&(l=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(l=globalThis.crypto),!l&&typeof window<"u"&&window.msCrypto&&(l=window.msCrypto),!l&&typeof yr<"u"&&yr.crypto&&(l=yr.crypto),!l&&typeof Ii=="function")try{l=Ri}catch{}var d=function(){if(l){if(typeof l.getRandomValues=="function")try{return l.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof l.randomBytes=="function")try{return l.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||(function(){function f(){}return function(x){var F;return f.prototype=x,F=new f,f.prototype=null,F}})(),p={},n=p.lib={},o=n.Base=(function(){return{extend:function(f){var x=s(this);return f&&x.mixIn(f),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var f=this.extend();return f.init.apply(f,arguments),f},init:function(){},mixIn:function(f){for(var x in f)f.hasOwnProperty(x)&&(this[x]=f[x]);f.hasOwnProperty("toString")&&(this.toString=f.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),E=n.WordArray=o.extend({init:function(f,x){f=this.words=f||[],x!=h?this.sigBytes=x:this.sigBytes=f.length*4},toString:function(f){return(f||m).stringify(this)},concat:function(f){var x=this.words,F=f.words,_=this.sigBytes,b=f.sigBytes;if(this.clamp(),_%4)for(var I=0;I<b;I++){var N=F[I>>>2]>>>24-I%4*8&255;x[_+I>>>2]|=N<<24-(_+I)%4*8}else for(var z=0;z<b;z+=4)x[_+z>>>2]=F[z>>>2];return this.sigBytes+=b,this},clamp:function(){var f=this.words,x=this.sigBytes;f[x>>>2]&=4294967295<<32-x%4*8,f.length=e.ceil(x/4)},clone:function(){var f=o.clone.call(this);return f.words=this.words.slice(0),f},random:function(f){for(var x=[],F=0;F<f;F+=4)x.push(d());return new E.init(x,f)}}),c=p.enc={},m=c.Hex={stringify:function(f){for(var x=f.words,F=f.sigBytes,_=[],b=0;b<F;b++){var I=x[b>>>2]>>>24-b%4*8&255;_.push((I>>>4).toString(16)),_.push((I&15).toString(16))}return _.join("")},parse:function(f){for(var x=f.length,F=[],_=0;_<x;_+=2)F[_>>>3]|=parseInt(f.substr(_,2),16)<<24-_%8*4;return new E.init(F,x/2)}},y=c.Latin1={stringify:function(f){for(var x=f.words,F=f.sigBytes,_=[],b=0;b<F;b++){var I=x[b>>>2]>>>24-b%4*8&255;_.push(String.fromCharCode(I))}return _.join("")},parse:function(f){for(var x=f.length,F=[],_=0;_<x;_++)F[_>>>2]|=(f.charCodeAt(_)&255)<<24-_%4*8;return new E.init(F,x)}},i=c.Utf8={stringify:function(f){try{return decodeURIComponent(escape(y.stringify(f)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(f){return y.parse(unescape(encodeURIComponent(f)))}},a=n.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new E.init,this._nDataBytes=0},_append:function(f){typeof f=="string"&&(f=i.parse(f)),this._data.concat(f),this._nDataBytes+=f.sigBytes},_process:function(f){var x,F=this._data,_=F.words,b=F.sigBytes,I=this.blockSize,N=I*4,z=b/N;f?z=e.ceil(z):z=e.max((z|0)-this._minBufferSize,0);var w=z*I,B=e.min(w*4,b);if(w){for(var D=0;D<w;D+=I)this._doProcessBlock(_,D);x=_.splice(0,w),F.sigBytes-=B}return new E.init(x,B)},clone:function(){var f=o.clone.call(this);return f._data=this._data.clone(),f},_minBufferSize:0});n.Hasher=a.extend({cfg:o.extend(),init:function(f){this.cfg=this.cfg.extend(f),this.reset()},reset:function(){a.reset.call(this),this._doReset()},update:function(f){return this._append(f),this._process(),this},finalize:function(f){f&&this._append(f);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(f){return function(x,F){return new f.init(F).finalize(x)}},_createHmacHelper:function(f){return function(x,F){return new v.HMAC.init(f,F).finalize(x)}}});var v=p.algo={};return p})(Math);return t})})(wt)),wt.exports}var St={exports:{}},os=St.exports,mn;function pr(){return mn||(mn=1,(function(r,u){(function(t,e){r.exports=e(de())})(os,function(t){return(function(e){var h=t,l=h.lib,d=l.Base,s=l.WordArray,p=h.x64={};p.Word=d.extend({init:function(n,o){this.high=n,this.low=o}}),p.WordArray=d.extend({init:function(n,o){n=this.words=n||[],o!=e?this.sigBytes=o:this.sigBytes=n.length*8},toX32:function(){for(var n=this.words,o=n.length,E=[],c=0;c<o;c++){var m=n[c];E.push(m.high),E.push(m.low)}return s.create(E,this.sigBytes)},clone:function(){for(var n=d.clone.call(this),o=n.words=this.words.slice(0),E=o.length,c=0;c<E;c++)o[c]=o[c].clone();return n}})})(),t})})(St)),St.exports}var kt={exports:{}},ss=kt.exports,yn;function us(){return yn||(yn=1,(function(r,u){(function(t,e){r.exports=e(de())})(ss,function(t){return(function(){if(typeof ArrayBuffer=="function"){var e=t,h=e.lib,l=h.WordArray,d=l.init,s=l.init=function(p){if(p instanceof ArrayBuffer&&(p=new Uint8Array(p)),(p instanceof Int8Array||typeof Uint8ClampedArray<"u"&&p instanceof Uint8ClampedArray||p instanceof Int16Array||p instanceof Uint16Array||p instanceof Int32Array||p instanceof Uint32Array||p instanceof Float32Array||p instanceof Float64Array)&&(p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength)),p instanceof Uint8Array){for(var n=p.byteLength,o=[],E=0;E<n;E++)o[E>>>2]|=p[E]<<24-E%4*8;d.call(this,o,n)}else d.apply(this,arguments)};s.prototype=l}})(),t.lib.WordArray})})(kt)),kt.exports}var It={exports:{}},ls=It.exports,Cn;function cs(){return Cn||(Cn=1,(function(r,u){(function(t,e){r.exports=e(de())})(ls,function(t){return(function(){var e=t,h=e.lib,l=h.WordArray,d=e.enc;d.Utf16=d.Utf16BE={stringify:function(p){for(var n=p.words,o=p.sigBytes,E=[],c=0;c<o;c+=2){var m=n[c>>>2]>>>16-c%4*8&65535;E.push(String.fromCharCode(m))}return E.join("")},parse:function(p){for(var n=p.length,o=[],E=0;E<n;E++)o[E>>>1]|=p.charCodeAt(E)<<16-E%2*16;return l.create(o,n*2)}},d.Utf16LE={stringify:function(p){for(var n=p.words,o=p.sigBytes,E=[],c=0;c<o;c+=2){var m=s(n[c>>>2]>>>16-c%4*8&65535);E.push(String.fromCharCode(m))}return E.join("")},parse:function(p){for(var n=p.length,o=[],E=0;E<n;E++)o[E>>>1]|=s(p.charCodeAt(E)<<16-E%2*16);return l.create(o,n*2)}};function s(p){return p<<8&4278255360|p>>>8&16711935}})(),t.enc.Utf16})})(It)),It.exports}var Rt={exports:{}},ds=Rt.exports,Fn;function H0(){return Fn||(Fn=1,(function(r,u){(function(t,e){r.exports=e(de())})(ds,function(t){return(function(){var e=t,h=e.lib,l=h.WordArray,d=e.enc;d.Base64={stringify:function(p){var n=p.words,o=p.sigBytes,E=this._map;p.clamp();for(var c=[],m=0;m<o;m+=3)for(var y=n[m>>>2]>>>24-m%4*8&255,i=n[m+1>>>2]>>>24-(m+1)%4*8&255,a=n[m+2>>>2]>>>24-(m+2)%4*8&255,v=y<<16|i<<8|a,f=0;f<4&&m+f*.75<o;f++)c.push(E.charAt(v>>>6*(3-f)&63));var x=E.charAt(64);if(x)for(;c.length%4;)c.push(x);return c.join("")},parse:function(p){var n=p.length,o=this._map,E=this._reverseMap;if(!E){E=this._reverseMap=[];for(var c=0;c<o.length;c++)E[o.charCodeAt(c)]=c}var m=o.charAt(64);if(m){var y=p.indexOf(m);y!==-1&&(n=y)}return s(p,n,E)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(p,n,o){for(var E=[],c=0,m=0;m<n;m++)if(m%4){var y=o[p.charCodeAt(m-1)]<<m%4*2,i=o[p.charCodeAt(m)]>>>6-m%4*2,a=y|i;E[c>>>2]|=a<<24-c%4*8,c++}return l.create(E,c)}})(),t.enc.Base64})})(Rt)),Rt.exports}var Nt={exports:{}},fs=Nt.exports,En;function xs(){return En||(En=1,(function(r,u){(function(t,e){r.exports=e(de())})(fs,function(t){return(function(){var e=t,h=e.lib,l=h.WordArray,d=e.enc;d.Base64url={stringify:function(p,n){n===void 0&&(n=!0);var o=p.words,E=p.sigBytes,c=n?this._safe_map:this._map;p.clamp();for(var m=[],y=0;y<E;y+=3)for(var i=o[y>>>2]>>>24-y%4*8&255,a=o[y+1>>>2]>>>24-(y+1)%4*8&255,v=o[y+2>>>2]>>>24-(y+2)%4*8&255,f=i<<16|a<<8|v,x=0;x<4&&y+x*.75<E;x++)m.push(c.charAt(f>>>6*(3-x)&63));var F=c.charAt(64);if(F)for(;m.length%4;)m.push(F);return m.join("")},parse:function(p,n){n===void 0&&(n=!0);var o=p.length,E=n?this._safe_map:this._map,c=this._reverseMap;if(!c){c=this._reverseMap=[];for(var m=0;m<E.length;m++)c[E.charCodeAt(m)]=m}var y=E.charAt(64);if(y){var i=p.indexOf(y);i!==-1&&(o=i)}return s(p,o,c)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function s(p,n,o){for(var E=[],c=0,m=0;m<n;m++)if(m%4){var y=o[p.charCodeAt(m-1)]<<m%4*2,i=o[p.charCodeAt(m)]>>>6-m%4*2,a=y|i;E[c>>>2]|=a<<24-c%4*8,c++}return l.create(E,c)}})(),t.enc.Base64url})})(Nt)),Nt.exports}var Pt={exports:{}},ps=Pt.exports,Bn;function $0(){return Bn||(Bn=1,(function(r,u){(function(t,e){r.exports=e(de())})(ps,function(t){return(function(e){var h=t,l=h.lib,d=l.WordArray,s=l.Hasher,p=h.algo,n=[];(function(){for(var i=0;i<64;i++)n[i]=e.abs(e.sin(i+1))*4294967296|0})();var o=p.MD5=s.extend({_doReset:function(){this._hash=new d.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(i,a){for(var v=0;v<16;v++){var f=a+v,x=i[f];i[f]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var F=this._hash.words,_=i[a+0],b=i[a+1],I=i[a+2],N=i[a+3],z=i[a+4],w=i[a+5],B=i[a+6],D=i[a+7],g=i[a+8],q=i[a+9],U=i[a+10],G=i[a+11],Y=i[a+12],M=i[a+13],H=i[a+14],Z=i[a+15],P=F[0],T=F[1],S=F[2],R=F[3];P=E(P,T,S,R,_,7,n[0]),R=E(R,P,T,S,b,12,n[1]),S=E(S,R,P,T,I,17,n[2]),T=E(T,S,R,P,N,22,n[3]),P=E(P,T,S,R,z,7,n[4]),R=E(R,P,T,S,w,12,n[5]),S=E(S,R,P,T,B,17,n[6]),T=E(T,S,R,P,D,22,n[7]),P=E(P,T,S,R,g,7,n[8]),R=E(R,P,T,S,q,12,n[9]),S=E(S,R,P,T,U,17,n[10]),T=E(T,S,R,P,G,22,n[11]),P=E(P,T,S,R,Y,7,n[12]),R=E(R,P,T,S,M,12,n[13]),S=E(S,R,P,T,H,17,n[14]),T=E(T,S,R,P,Z,22,n[15]),P=c(P,T,S,R,b,5,n[16]),R=c(R,P,T,S,B,9,n[17]),S=c(S,R,P,T,G,14,n[18]),T=c(T,S,R,P,_,20,n[19]),P=c(P,T,S,R,w,5,n[20]),R=c(R,P,T,S,U,9,n[21]),S=c(S,R,P,T,Z,14,n[22]),T=c(T,S,R,P,z,20,n[23]),P=c(P,T,S,R,q,5,n[24]),R=c(R,P,T,S,H,9,n[25]),S=c(S,R,P,T,N,14,n[26]),T=c(T,S,R,P,g,20,n[27]),P=c(P,T,S,R,M,5,n[28]),R=c(R,P,T,S,I,9,n[29]),S=c(S,R,P,T,D,14,n[30]),T=c(T,S,R,P,Y,20,n[31]),P=m(P,T,S,R,w,4,n[32]),R=m(R,P,T,S,g,11,n[33]),S=m(S,R,P,T,G,16,n[34]),T=m(T,S,R,P,H,23,n[35]),P=m(P,T,S,R,b,4,n[36]),R=m(R,P,T,S,z,11,n[37]),S=m(S,R,P,T,D,16,n[38]),T=m(T,S,R,P,U,23,n[39]),P=m(P,T,S,R,M,4,n[40]),R=m(R,P,T,S,_,11,n[41]),S=m(S,R,P,T,N,16,n[42]),T=m(T,S,R,P,B,23,n[43]),P=m(P,T,S,R,q,4,n[44]),R=m(R,P,T,S,Y,11,n[45]),S=m(S,R,P,T,Z,16,n[46]),T=m(T,S,R,P,I,23,n[47]),P=y(P,T,S,R,_,6,n[48]),R=y(R,P,T,S,D,10,n[49]),S=y(S,R,P,T,H,15,n[50]),T=y(T,S,R,P,w,21,n[51]),P=y(P,T,S,R,Y,6,n[52]),R=y(R,P,T,S,N,10,n[53]),S=y(S,R,P,T,U,15,n[54]),T=y(T,S,R,P,b,21,n[55]),P=y(P,T,S,R,g,6,n[56]),R=y(R,P,T,S,Z,10,n[57]),S=y(S,R,P,T,B,15,n[58]),T=y(T,S,R,P,M,21,n[59]),P=y(P,T,S,R,z,6,n[60]),R=y(R,P,T,S,G,10,n[61]),S=y(S,R,P,T,I,15,n[62]),T=y(T,S,R,P,q,21,n[63]),F[0]=F[0]+P|0,F[1]=F[1]+T|0,F[2]=F[2]+S|0,F[3]=F[3]+R|0},_doFinalize:function(){var i=this._data,a=i.words,v=this._nDataBytes*8,f=i.sigBytes*8;a[f>>>5]|=128<<24-f%32;var x=e.floor(v/4294967296),F=v;a[(f+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,a[(f+64>>>9<<4)+14]=(F<<8|F>>>24)&16711935|(F<<24|F>>>8)&4278255360,i.sigBytes=(a.length+1)*4,this._process();for(var _=this._hash,b=_.words,I=0;I<4;I++){var N=b[I];b[I]=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360}return _},clone:function(){var i=s.clone.call(this);return i._hash=this._hash.clone(),i}});function E(i,a,v,f,x,F,_){var b=i+(a&v|~a&f)+x+_;return(b<<F|b>>>32-F)+a}function c(i,a,v,f,x,F,_){var b=i+(a&f|v&~f)+x+_;return(b<<F|b>>>32-F)+a}function m(i,a,v,f,x,F,_){var b=i+(a^v^f)+x+_;return(b<<F|b>>>32-F)+a}function y(i,a,v,f,x,F,_){var b=i+(v^(a|~f))+x+_;return(b<<F|b>>>32-F)+a}h.MD5=s._createHelper(o),h.HmacMD5=s._createHmacHelper(o)})(Math),t.MD5})})(Pt)),Pt.exports}var Tt={exports:{}},hs=Tt.exports,An;function Pa(){return An||(An=1,(function(r,u){(function(t,e){r.exports=e(de())})(hs,function(t){return(function(){var e=t,h=e.lib,l=h.WordArray,d=h.Hasher,s=e.algo,p=[],n=s.SHA1=d.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(o,E){for(var c=this._hash.words,m=c[0],y=c[1],i=c[2],a=c[3],v=c[4],f=0;f<80;f++){if(f<16)p[f]=o[E+f]|0;else{var x=p[f-3]^p[f-8]^p[f-14]^p[f-16];p[f]=x<<1|x>>>31}var F=(m<<5|m>>>27)+v+p[f];f<20?F+=(y&i|~y&a)+1518500249:f<40?F+=(y^i^a)+1859775393:f<60?F+=(y&i|y&a|i&a)-1894007588:F+=(y^i^a)-899497514,v=a,a=i,i=y<<30|y>>>2,y=m,m=F}c[0]=c[0]+m|0,c[1]=c[1]+y|0,c[2]=c[2]+i|0,c[3]=c[3]+a|0,c[4]=c[4]+v|0},_doFinalize:function(){var o=this._data,E=o.words,c=this._nDataBytes*8,m=o.sigBytes*8;return E[m>>>5]|=128<<24-m%32,E[(m+64>>>9<<4)+14]=Math.floor(c/4294967296),E[(m+64>>>9<<4)+15]=c,o.sigBytes=E.length*4,this._process(),this._hash},clone:function(){var o=d.clone.call(this);return o._hash=this._hash.clone(),o}});e.SHA1=d._createHelper(n),e.HmacSHA1=d._createHmacHelper(n)})(),t.SHA1})})(Tt)),Tt.exports}var zt={exports:{}},vs=zt.exports,bn;function $r(){return bn||(bn=1,(function(r,u){(function(t,e){r.exports=e(de())})(vs,function(t){return(function(e){var h=t,l=h.lib,d=l.WordArray,s=l.Hasher,p=h.algo,n=[],o=[];(function(){function m(v){for(var f=e.sqrt(v),x=2;x<=f;x++)if(!(v%x))return!1;return!0}function y(v){return(v-(v|0))*4294967296|0}for(var i=2,a=0;a<64;)m(i)&&(a<8&&(n[a]=y(e.pow(i,1/2))),o[a]=y(e.pow(i,1/3)),a++),i++})();var E=[],c=p.SHA256=s.extend({_doReset:function(){this._hash=new d.init(n.slice(0))},_doProcessBlock:function(m,y){for(var i=this._hash.words,a=i[0],v=i[1],f=i[2],x=i[3],F=i[4],_=i[5],b=i[6],I=i[7],N=0;N<64;N++){if(N<16)E[N]=m[y+N]|0;else{var z=E[N-15],w=(z<<25|z>>>7)^(z<<14|z>>>18)^z>>>3,B=E[N-2],D=(B<<15|B>>>17)^(B<<13|B>>>19)^B>>>10;E[N]=w+E[N-7]+D+E[N-16]}var g=F&_^~F&b,q=a&v^a&f^v&f,U=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),G=(F<<26|F>>>6)^(F<<21|F>>>11)^(F<<7|F>>>25),Y=I+G+g+o[N]+E[N],M=U+q;I=b,b=_,_=F,F=x+Y|0,x=f,f=v,v=a,a=Y+M|0}i[0]=i[0]+a|0,i[1]=i[1]+v|0,i[2]=i[2]+f|0,i[3]=i[3]+x|0,i[4]=i[4]+F|0,i[5]=i[5]+_|0,i[6]=i[6]+b|0,i[7]=i[7]+I|0},_doFinalize:function(){var m=this._data,y=m.words,i=this._nDataBytes*8,a=m.sigBytes*8;return y[a>>>5]|=128<<24-a%32,y[(a+64>>>9<<4)+14]=e.floor(i/4294967296),y[(a+64>>>9<<4)+15]=i,m.sigBytes=y.length*4,this._process(),this._hash},clone:function(){var m=s.clone.call(this);return m._hash=this._hash.clone(),m}});h.SHA256=s._createHelper(c),h.HmacSHA256=s._createHmacHelper(c)})(Math),t.SHA256})})(zt)),zt.exports}var qt={exports:{}},gs=qt.exports,Dn;function ms(){return Dn||(Dn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),$r())})(gs,function(t){return(function(){var e=t,h=e.lib,l=h.WordArray,d=e.algo,s=d.SHA256,p=d.SHA224=s.extend({_doReset:function(){this._hash=new l.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var n=s._doFinalize.call(this);return n.sigBytes-=4,n}});e.SHA224=s._createHelper(p),e.HmacSHA224=s._createHmacHelper(p)})(),t.SHA224})})(qt)),qt.exports}var Lt={exports:{}},ys=Lt.exports,_n;function Ta(){return _n||(_n=1,(function(r,u){(function(t,e,h){r.exports=e(de(),pr())})(ys,function(t){return(function(){var e=t,h=e.lib,l=h.Hasher,d=e.x64,s=d.Word,p=d.WordArray,n=e.algo;function o(){return s.create.apply(s,arguments)}var E=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],c=[];(function(){for(var y=0;y<80;y++)c[y]=o()})();var m=n.SHA512=l.extend({_doReset:function(){this._hash=new p.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(y,i){for(var a=this._hash.words,v=a[0],f=a[1],x=a[2],F=a[3],_=a[4],b=a[5],I=a[6],N=a[7],z=v.high,w=v.low,B=f.high,D=f.low,g=x.high,q=x.low,U=F.high,G=F.low,Y=_.high,M=_.low,H=b.high,Z=b.low,P=I.high,T=I.low,S=N.high,R=N.low,$=z,j=w,X=B,W=D,ie=g,pe=q,o0=U,Se=G,ue=Y,ye=M,Ce=H,Te=Z,Ze=P,Je=T,e0=S,f0=R,ze=0;ze<80;ze++){var Ne,ke,Xe=c[ze];if(ze<16)ke=Xe.high=y[i+ze*2]|0,Ne=Xe.low=y[i+ze*2+1]|0;else{var h0=c[ze-15],V=h0.high,xe=h0.low,De=(V>>>1|xe<<31)^(V>>>8|xe<<24)^V>>>7,Ye=(xe>>>1|V<<31)^(xe>>>8|V<<24)^(xe>>>7|V<<25),N0=c[ze-2],Ve=N0.high,he=N0.low,P0=(Ve>>>19|he<<13)^(Ve<<3|he>>>29)^Ve>>>6,W0=(he>>>19|Ve<<13)^(he<<3|Ve>>>29)^(he>>>6|Ve<<26),T0=c[ze-7],n0=T0.high,z0=T0.low,q0=c[ze-16],L0=q0.high,j0=q0.low;Ne=Ye+z0,ke=De+n0+(Ne>>>0<Ye>>>0?1:0),Ne=Ne+W0,ke=ke+P0+(Ne>>>0<W0>>>0?1:0),Ne=Ne+j0,ke=ke+L0+(Ne>>>0<j0>>>0?1:0),Xe.high=ke,Xe.low=Ne}var ot=ue&Ce^~ue&Ze,st=ye&Te^~ye&Je,V0=$&X^$&ie^X&ie,s0=j&W^j&pe^W&pe,x0=($>>>28|j<<4)^($<<30|j>>>2)^($<<25|j>>>7),F0=(j>>>28|$<<4)^(j<<30|$>>>2)^(j<<25|$>>>7),E0=(ue>>>14|ye<<18)^(ue>>>18|ye<<14)^(ue<<23|ye>>>9),ut=(ye>>>14|ue<<18)^(ye>>>18|ue<<14)^(ye<<23|ue>>>9),Le=E[ze],oe=Le.high,b0=Le.low,Oe=f0+ut,Ke=e0+E0+(Oe>>>0<f0>>>0?1:0),Oe=Oe+st,Ke=Ke+ot+(Oe>>>0<st>>>0?1:0),Oe=Oe+b0,Ke=Ke+oe+(Oe>>>0<b0>>>0?1:0),Oe=Oe+Ne,Ke=Ke+ke+(Oe>>>0<Ne>>>0?1:0),_e=F0+s0,He=x0+V0+(_e>>>0<F0>>>0?1:0);e0=Ze,f0=Je,Ze=Ce,Je=Te,Ce=ue,Te=ye,ye=Se+Oe|0,ue=o0+Ke+(ye>>>0<Se>>>0?1:0)|0,o0=ie,Se=pe,ie=X,pe=W,X=$,W=j,j=Oe+_e|0,$=Ke+He+(j>>>0<Oe>>>0?1:0)|0}w=v.low=w+j,v.high=z+$+(w>>>0<j>>>0?1:0),D=f.low=D+W,f.high=B+X+(D>>>0<W>>>0?1:0),q=x.low=q+pe,x.high=g+ie+(q>>>0<pe>>>0?1:0),G=F.low=G+Se,F.high=U+o0+(G>>>0<Se>>>0?1:0),M=_.low=M+ye,_.high=Y+ue+(M>>>0<ye>>>0?1:0),Z=b.low=Z+Te,b.high=H+Ce+(Z>>>0<Te>>>0?1:0),T=I.low=T+Je,I.high=P+Ze+(T>>>0<Je>>>0?1:0),R=N.low=R+f0,N.high=S+e0+(R>>>0<f0>>>0?1:0)},_doFinalize:function(){var y=this._data,i=y.words,a=this._nDataBytes*8,v=y.sigBytes*8;i[v>>>5]|=128<<24-v%32,i[(v+128>>>10<<5)+30]=Math.floor(a/4294967296),i[(v+128>>>10<<5)+31]=a,y.sigBytes=i.length*4,this._process();var f=this._hash.toX32();return f},clone:function(){var y=l.clone.call(this);return y._hash=this._hash.clone(),y},blockSize:1024/32});e.SHA512=l._createHelper(m),e.HmacSHA512=l._createHmacHelper(m)})(),t.SHA512})})(Lt)),Lt.exports}var Ot={exports:{}},Cs=Ot.exports,wn;function Fs(){return wn||(wn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),pr(),Ta())})(Cs,function(t){return(function(){var e=t,h=e.x64,l=h.Word,d=h.WordArray,s=e.algo,p=s.SHA512,n=s.SHA384=p.extend({_doReset:function(){this._hash=new d.init([new l.init(3418070365,3238371032),new l.init(1654270250,914150663),new l.init(2438529370,812702999),new l.init(355462360,4144912697),new l.init(1731405415,4290775857),new l.init(2394180231,1750603025),new l.init(3675008525,1694076839),new l.init(1203062813,3204075428)])},_doFinalize:function(){var o=p._doFinalize.call(this);return o.sigBytes-=16,o}});e.SHA384=p._createHelper(n),e.HmacSHA384=p._createHmacHelper(n)})(),t.SHA384})})(Ot)),Ot.exports}var Mt={exports:{}},Es=Mt.exports,Sn;function Bs(){return Sn||(Sn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),pr())})(Es,function(t){return(function(e){var h=t,l=h.lib,d=l.WordArray,s=l.Hasher,p=h.x64,n=p.Word,o=h.algo,E=[],c=[],m=[];(function(){for(var a=1,v=0,f=0;f<24;f++){E[a+5*v]=(f+1)*(f+2)/2%64;var x=v%5,F=(2*a+3*v)%5;a=x,v=F}for(var a=0;a<5;a++)for(var v=0;v<5;v++)c[a+5*v]=v+(2*a+3*v)%5*5;for(var _=1,b=0;b<24;b++){for(var I=0,N=0,z=0;z<7;z++){if(_&1){var w=(1<<z)-1;w<32?N^=1<<w:I^=1<<w-32}_&128?_=_<<1^113:_<<=1}m[b]=n.create(I,N)}})();var y=[];(function(){for(var a=0;a<25;a++)y[a]=n.create()})();var i=o.SHA3=s.extend({cfg:s.cfg.extend({outputLength:512}),_doReset:function(){for(var a=this._state=[],v=0;v<25;v++)a[v]=new n.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(a,v){for(var f=this._state,x=this.blockSize/2,F=0;F<x;F++){var _=a[v+2*F],b=a[v+2*F+1];_=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;var I=f[F];I.high^=b,I.low^=_}for(var N=0;N<24;N++){for(var z=0;z<5;z++){for(var w=0,B=0,D=0;D<5;D++){var I=f[z+5*D];w^=I.high,B^=I.low}var g=y[z];g.high=w,g.low=B}for(var z=0;z<5;z++)for(var q=y[(z+4)%5],U=y[(z+1)%5],G=U.high,Y=U.low,w=q.high^(G<<1|Y>>>31),B=q.low^(Y<<1|G>>>31),D=0;D<5;D++){var I=f[z+5*D];I.high^=w,I.low^=B}for(var M=1;M<25;M++){var w,B,I=f[M],H=I.high,Z=I.low,P=E[M];P<32?(w=H<<P|Z>>>32-P,B=Z<<P|H>>>32-P):(w=Z<<P-32|H>>>64-P,B=H<<P-32|Z>>>64-P);var T=y[c[M]];T.high=w,T.low=B}var S=y[0],R=f[0];S.high=R.high,S.low=R.low;for(var z=0;z<5;z++)for(var D=0;D<5;D++){var M=z+5*D,I=f[M],$=y[M],j=y[(z+1)%5+5*D],X=y[(z+2)%5+5*D];I.high=$.high^~j.high&X.high,I.low=$.low^~j.low&X.low}var I=f[0],W=m[N];I.high^=W.high,I.low^=W.low}},_doFinalize:function(){var a=this._data,v=a.words;this._nDataBytes*8;var f=a.sigBytes*8,x=this.blockSize*32;v[f>>>5]|=1<<24-f%32,v[(e.ceil((f+1)/x)*x>>>5)-1]|=128,a.sigBytes=v.length*4,this._process();for(var F=this._state,_=this.cfg.outputLength/8,b=_/8,I=[],N=0;N<b;N++){var z=F[N],w=z.high,B=z.low;w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,B=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360,I.push(B),I.push(w)}return new d.init(I,_)},clone:function(){for(var a=s.clone.call(this),v=a._state=this._state.slice(0),f=0;f<25;f++)v[f]=v[f].clone();return a}});h.SHA3=s._createHelper(i),h.HmacSHA3=s._createHmacHelper(i)})(Math),t.SHA3})})(Mt)),Mt.exports}var Ut={exports:{}},As=Ut.exports,kn;function bs(){return kn||(kn=1,(function(r,u){(function(t,e){r.exports=e(de())})(As,function(t){/** @preserve
|
|
184
|
+
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
185
|
+
|
|
186
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
187
|
+
|
|
188
|
+
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
189
|
+
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
190
|
+
|
|
191
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
192
|
+
*/return(function(e){var h=t,l=h.lib,d=l.WordArray,s=l.Hasher,p=h.algo,n=d.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=d.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),E=d.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=d.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),m=d.create([0,1518500249,1859775393,2400959708,2840853838]),y=d.create([1352829926,1548603684,1836072691,2053994217,0]),i=p.RIPEMD160=s.extend({_doReset:function(){this._hash=d.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(b,I){for(var N=0;N<16;N++){var z=I+N,w=b[z];b[z]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var B=this._hash.words,D=m.words,g=y.words,q=n.words,U=o.words,G=E.words,Y=c.words,M,H,Z,P,T,S,R,$,j,X;S=M=B[0],R=H=B[1],$=Z=B[2],j=P=B[3],X=T=B[4];for(var W,N=0;N<80;N+=1)W=M+b[I+q[N]]|0,N<16?W+=a(H,Z,P)+D[0]:N<32?W+=v(H,Z,P)+D[1]:N<48?W+=f(H,Z,P)+D[2]:N<64?W+=x(H,Z,P)+D[3]:W+=F(H,Z,P)+D[4],W=W|0,W=_(W,G[N]),W=W+T|0,M=T,T=P,P=_(Z,10),Z=H,H=W,W=S+b[I+U[N]]|0,N<16?W+=F(R,$,j)+g[0]:N<32?W+=x(R,$,j)+g[1]:N<48?W+=f(R,$,j)+g[2]:N<64?W+=v(R,$,j)+g[3]:W+=a(R,$,j)+g[4],W=W|0,W=_(W,Y[N]),W=W+X|0,S=X,X=j,j=_($,10),$=R,R=W;W=B[1]+Z+j|0,B[1]=B[2]+P+X|0,B[2]=B[3]+T+S|0,B[3]=B[4]+M+R|0,B[4]=B[0]+H+$|0,B[0]=W},_doFinalize:function(){var b=this._data,I=b.words,N=this._nDataBytes*8,z=b.sigBytes*8;I[z>>>5]|=128<<24-z%32,I[(z+64>>>9<<4)+14]=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,b.sigBytes=(I.length+1)*4,this._process();for(var w=this._hash,B=w.words,D=0;D<5;D++){var g=B[D];B[D]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}return w},clone:function(){var b=s.clone.call(this);return b._hash=this._hash.clone(),b}});function a(b,I,N){return b^I^N}function v(b,I,N){return b&I|~b&N}function f(b,I,N){return(b|~I)^N}function x(b,I,N){return b&N|I&~N}function F(b,I,N){return b^(I|~N)}function _(b,I){return b<<I|b>>>32-I}h.RIPEMD160=s._createHelper(i),h.HmacRIPEMD160=s._createHmacHelper(i)})(),t.RIPEMD160})})(Ut)),Ut.exports}var Ht={exports:{}},Ds=Ht.exports,In;function Wr(){return In||(In=1,(function(r,u){(function(t,e){r.exports=e(de())})(Ds,function(t){(function(){var e=t,h=e.lib,l=h.Base,d=e.enc,s=d.Utf8,p=e.algo;p.HMAC=l.extend({init:function(n,o){n=this._hasher=new n.init,typeof o=="string"&&(o=s.parse(o));var E=n.blockSize,c=E*4;o.sigBytes>c&&(o=n.finalize(o)),o.clamp();for(var m=this._oKey=o.clone(),y=this._iKey=o.clone(),i=m.words,a=y.words,v=0;v<E;v++)i[v]^=1549556828,a[v]^=909522486;m.sigBytes=y.sigBytes=c,this.reset()},reset:function(){var n=this._hasher;n.reset(),n.update(this._iKey)},update:function(n){return this._hasher.update(n),this},finalize:function(n){var o=this._hasher,E=o.finalize(n);o.reset();var c=o.finalize(this._oKey.clone().concat(E));return c}})})()})})(Ht)),Ht.exports}var $t={exports:{}},_s=$t.exports,Rn;function ws(){return Rn||(Rn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),$r(),Wr())})(_s,function(t){return(function(){var e=t,h=e.lib,l=h.Base,d=h.WordArray,s=e.algo,p=s.SHA256,n=s.HMAC,o=s.PBKDF2=l.extend({cfg:l.extend({keySize:128/32,hasher:p,iterations:25e4}),init:function(E){this.cfg=this.cfg.extend(E)},compute:function(E,c){for(var m=this.cfg,y=n.create(m.hasher,E),i=d.create(),a=d.create([1]),v=i.words,f=a.words,x=m.keySize,F=m.iterations;v.length<x;){var _=y.update(c).finalize(a);y.reset();for(var b=_.words,I=b.length,N=_,z=1;z<F;z++){N=y.finalize(N),y.reset();for(var w=N.words,B=0;B<I;B++)b[B]^=w[B]}i.concat(_),f[0]++}return i.sigBytes=x*4,i}});e.PBKDF2=function(E,c,m){return o.create(m).compute(E,c)}})(),t.PBKDF2})})($t)),$t.exports}var Wt={exports:{}},Ss=Wt.exports,Nn;function R0(){return Nn||(Nn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),Pa(),Wr())})(Ss,function(t){return(function(){var e=t,h=e.lib,l=h.Base,d=h.WordArray,s=e.algo,p=s.MD5,n=s.EvpKDF=l.extend({cfg:l.extend({keySize:128/32,hasher:p,iterations:1}),init:function(o){this.cfg=this.cfg.extend(o)},compute:function(o,E){for(var c,m=this.cfg,y=m.hasher.create(),i=d.create(),a=i.words,v=m.keySize,f=m.iterations;a.length<v;){c&&y.update(c),c=y.update(o).finalize(E),y.reset();for(var x=1;x<f;x++)c=y.finalize(c),y.reset();i.concat(c)}return i.sigBytes=v*4,i}});e.EvpKDF=function(o,E,c){return n.create(c).compute(o,E)}})(),t.EvpKDF})})(Wt)),Wt.exports}var jt={exports:{}},ks=jt.exports,Pn;function je(){return Pn||(Pn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),R0())})(ks,function(t){t.lib.Cipher||(function(e){var h=t,l=h.lib,d=l.Base,s=l.WordArray,p=l.BufferedBlockAlgorithm,n=h.enc;n.Utf8;var o=n.Base64,E=h.algo,c=E.EvpKDF,m=l.Cipher=p.extend({cfg:d.extend(),createEncryptor:function(w,B){return this.create(this._ENC_XFORM_MODE,w,B)},createDecryptor:function(w,B){return this.create(this._DEC_XFORM_MODE,w,B)},init:function(w,B,D){this.cfg=this.cfg.extend(D),this._xformMode=w,this._key=B,this.reset()},reset:function(){p.reset.call(this),this._doReset()},process:function(w){return this._append(w),this._process()},finalize:function(w){w&&this._append(w);var B=this._doFinalize();return B},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function w(B){return typeof B=="string"?z:b}return function(B){return{encrypt:function(D,g,q){return w(g).encrypt(B,D,g,q)},decrypt:function(D,g,q){return w(g).decrypt(B,D,g,q)}}}})()});l.StreamCipher=m.extend({_doFinalize:function(){var w=this._process(!0);return w},blockSize:1});var y=h.mode={},i=l.BlockCipherMode=d.extend({createEncryptor:function(w,B){return this.Encryptor.create(w,B)},createDecryptor:function(w,B){return this.Decryptor.create(w,B)},init:function(w,B){this._cipher=w,this._iv=B}}),a=y.CBC=(function(){var w=i.extend();w.Encryptor=w.extend({processBlock:function(D,g){var q=this._cipher,U=q.blockSize;B.call(this,D,g,U),q.encryptBlock(D,g),this._prevBlock=D.slice(g,g+U)}}),w.Decryptor=w.extend({processBlock:function(D,g){var q=this._cipher,U=q.blockSize,G=D.slice(g,g+U);q.decryptBlock(D,g),B.call(this,D,g,U),this._prevBlock=G}});function B(D,g,q){var U,G=this._iv;G?(U=G,this._iv=e):U=this._prevBlock;for(var Y=0;Y<q;Y++)D[g+Y]^=U[Y]}return w})(),v=h.pad={},f=v.Pkcs7={pad:function(w,B){for(var D=B*4,g=D-w.sigBytes%D,q=g<<24|g<<16|g<<8|g,U=[],G=0;G<g;G+=4)U.push(q);var Y=s.create(U,g);w.concat(Y)},unpad:function(w){var B=w.words[w.sigBytes-1>>>2]&255;w.sigBytes-=B}};l.BlockCipher=m.extend({cfg:m.cfg.extend({mode:a,padding:f}),reset:function(){var w;m.reset.call(this);var B=this.cfg,D=B.iv,g=B.mode;this._xformMode==this._ENC_XFORM_MODE?w=g.createEncryptor:(w=g.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==w?this._mode.init(this,D&&D.words):(this._mode=w.call(g,this,D&&D.words),this._mode.__creator=w)},_doProcessBlock:function(w,B){this._mode.processBlock(w,B)},_doFinalize:function(){var w,B=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(B.pad(this._data,this.blockSize),w=this._process(!0)):(w=this._process(!0),B.unpad(w)),w},blockSize:128/32});var x=l.CipherParams=d.extend({init:function(w){this.mixIn(w)},toString:function(w){return(w||this.formatter).stringify(this)}}),F=h.format={},_=F.OpenSSL={stringify:function(w){var B,D=w.ciphertext,g=w.salt;return g?B=s.create([1398893684,1701076831]).concat(g).concat(D):B=D,B.toString(o)},parse:function(w){var B,D=o.parse(w),g=D.words;return g[0]==1398893684&&g[1]==1701076831&&(B=s.create(g.slice(2,4)),g.splice(0,4),D.sigBytes-=16),x.create({ciphertext:D,salt:B})}},b=l.SerializableCipher=d.extend({cfg:d.extend({format:_}),encrypt:function(w,B,D,g){g=this.cfg.extend(g);var q=w.createEncryptor(D,g),U=q.finalize(B),G=q.cfg;return x.create({ciphertext:U,key:D,iv:G.iv,algorithm:w,mode:G.mode,padding:G.padding,blockSize:w.blockSize,formatter:g.format})},decrypt:function(w,B,D,g){g=this.cfg.extend(g),B=this._parse(B,g.format);var q=w.createDecryptor(D,g).finalize(B.ciphertext);return q},_parse:function(w,B){return typeof w=="string"?B.parse(w,this):w}}),I=h.kdf={},N=I.OpenSSL={execute:function(w,B,D,g,q){if(g||(g=s.random(64/8)),q)var U=c.create({keySize:B+D,hasher:q}).compute(w,g);else var U=c.create({keySize:B+D}).compute(w,g);var G=s.create(U.words.slice(B),D*4);return U.sigBytes=B*4,x.create({key:U,iv:G,salt:g})}},z=l.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:N}),encrypt:function(w,B,D,g){g=this.cfg.extend(g);var q=g.kdf.execute(D,w.keySize,w.ivSize,g.salt,g.hasher);g.iv=q.iv;var U=b.encrypt.call(this,w,B,q.key,g);return U.mixIn(q),U},decrypt:function(w,B,D,g){g=this.cfg.extend(g),B=this._parse(B,g.format);var q=g.kdf.execute(D,w.keySize,w.ivSize,B.salt,g.hasher);g.iv=q.iv;var U=b.decrypt.call(this,w,B,q.key,g);return U}})})()})})(jt)),jt.exports}var Vt={exports:{}},Is=Vt.exports,Tn;function Rs(){return Tn||(Tn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),je())})(Is,function(t){return t.mode.CFB=(function(){var e=t.lib.BlockCipherMode.extend();e.Encryptor=e.extend({processBlock:function(l,d){var s=this._cipher,p=s.blockSize;h.call(this,l,d,p,s),this._prevBlock=l.slice(d,d+p)}}),e.Decryptor=e.extend({processBlock:function(l,d){var s=this._cipher,p=s.blockSize,n=l.slice(d,d+p);h.call(this,l,d,p,s),this._prevBlock=n}});function h(l,d,s,p){var n,o=this._iv;o?(n=o.slice(0),this._iv=void 0):n=this._prevBlock,p.encryptBlock(n,0);for(var E=0;E<s;E++)l[d+E]^=n[E]}return e})(),t.mode.CFB})})(Vt)),Vt.exports}var Kt={exports:{}},Ns=Kt.exports,zn;function Ps(){return zn||(zn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),je())})(Ns,function(t){return t.mode.CTR=(function(){var e=t.lib.BlockCipherMode.extend(),h=e.Encryptor=e.extend({processBlock:function(l,d){var s=this._cipher,p=s.blockSize,n=this._iv,o=this._counter;n&&(o=this._counter=n.slice(0),this._iv=void 0);var E=o.slice(0);s.encryptBlock(E,0),o[p-1]=o[p-1]+1|0;for(var c=0;c<p;c++)l[d+c]^=E[c]}});return e.Decryptor=h,e})(),t.mode.CTR})})(Kt)),Kt.exports}var Gt={exports:{}},Ts=Gt.exports,qn;function zs(){return qn||(qn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),je())})(Ts,function(t){/** @preserve
|
|
193
|
+
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
194
|
+
* derived from CryptoJS.mode.CTR
|
|
195
|
+
* Jan Hruby jhruby.web@gmail.com
|
|
196
|
+
*/return t.mode.CTRGladman=(function(){var e=t.lib.BlockCipherMode.extend();function h(s){if((s>>24&255)===255){var p=s>>16&255,n=s>>8&255,o=s&255;p===255?(p=0,n===255?(n=0,o===255?o=0:++o):++n):++p,s=0,s+=p<<16,s+=n<<8,s+=o}else s+=1<<24;return s}function l(s){return(s[0]=h(s[0]))===0&&(s[1]=h(s[1])),s}var d=e.Encryptor=e.extend({processBlock:function(s,p){var n=this._cipher,o=n.blockSize,E=this._iv,c=this._counter;E&&(c=this._counter=E.slice(0),this._iv=void 0),l(c);var m=c.slice(0);n.encryptBlock(m,0);for(var y=0;y<o;y++)s[p+y]^=m[y]}});return e.Decryptor=d,e})(),t.mode.CTRGladman})})(Gt)),Gt.exports}var Xt={exports:{}},qs=Xt.exports,Ln;function Ls(){return Ln||(Ln=1,(function(r,u){(function(t,e,h){r.exports=e(de(),je())})(qs,function(t){return t.mode.OFB=(function(){var e=t.lib.BlockCipherMode.extend(),h=e.Encryptor=e.extend({processBlock:function(l,d){var s=this._cipher,p=s.blockSize,n=this._iv,o=this._keystream;n&&(o=this._keystream=n.slice(0),this._iv=void 0),s.encryptBlock(o,0);for(var E=0;E<p;E++)l[d+E]^=o[E]}});return e.Decryptor=h,e})(),t.mode.OFB})})(Xt)),Xt.exports}var Yt={exports:{}},Os=Yt.exports,On;function Ms(){return On||(On=1,(function(r,u){(function(t,e,h){r.exports=e(de(),je())})(Os,function(t){return t.mode.ECB=(function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:function(h,l){this._cipher.encryptBlock(h,l)}}),e.Decryptor=e.extend({processBlock:function(h,l){this._cipher.decryptBlock(h,l)}}),e})(),t.mode.ECB})})(Yt)),Yt.exports}var Qt={exports:{}},Us=Qt.exports,Mn;function Hs(){return Mn||(Mn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),je())})(Us,function(t){return t.pad.AnsiX923={pad:function(e,h){var l=e.sigBytes,d=h*4,s=d-l%d,p=l+s-1;e.clamp(),e.words[p>>>2]|=s<<24-p%4*8,e.sigBytes+=s},unpad:function(e){var h=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=h}},t.pad.Ansix923})})(Qt)),Qt.exports}var Zt={exports:{}},$s=Zt.exports,Un;function Ws(){return Un||(Un=1,(function(r,u){(function(t,e,h){r.exports=e(de(),je())})($s,function(t){return t.pad.Iso10126={pad:function(e,h){var l=h*4,d=l-e.sigBytes%l;e.concat(t.lib.WordArray.random(d-1)).concat(t.lib.WordArray.create([d<<24],1))},unpad:function(e){var h=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=h}},t.pad.Iso10126})})(Zt)),Zt.exports}var Jt={exports:{}},js=Jt.exports,Hn;function Vs(){return Hn||(Hn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),je())})(js,function(t){return t.pad.Iso97971={pad:function(e,h){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,h)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971})})(Jt)),Jt.exports}var er={exports:{}},Ks=er.exports,$n;function Gs(){return $n||($n=1,(function(r,u){(function(t,e,h){r.exports=e(de(),je())})(Ks,function(t){return t.pad.ZeroPadding={pad:function(e,h){var l=h*4;e.clamp(),e.sigBytes+=l-(e.sigBytes%l||l)},unpad:function(e){for(var h=e.words,l=e.sigBytes-1,l=e.sigBytes-1;l>=0;l--)if(h[l>>>2]>>>24-l%4*8&255){e.sigBytes=l+1;break}}},t.pad.ZeroPadding})})(er)),er.exports}var tr={exports:{}},Xs=tr.exports,Wn;function Ys(){return Wn||(Wn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),je())})(Xs,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})})(tr)),tr.exports}var rr={exports:{}},Qs=rr.exports,jn;function Zs(){return jn||(jn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),je())})(Qs,function(t){return(function(e){var h=t,l=h.lib,d=l.CipherParams,s=h.enc,p=s.Hex,n=h.format;n.Hex={stringify:function(o){return o.ciphertext.toString(p)},parse:function(o){var E=p.parse(o);return d.create({ciphertext:E})}}})(),t.format.Hex})})(rr)),rr.exports}var nr={exports:{}},Js=nr.exports,Vn;function eu(){return Vn||(Vn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),H0(),$0(),R0(),je())})(Js,function(t){return(function(){var e=t,h=e.lib,l=h.BlockCipher,d=e.algo,s=[],p=[],n=[],o=[],E=[],c=[],m=[],y=[],i=[],a=[];(function(){for(var x=[],F=0;F<256;F++)F<128?x[F]=F<<1:x[F]=F<<1^283;for(var _=0,b=0,F=0;F<256;F++){var I=b^b<<1^b<<2^b<<3^b<<4;I=I>>>8^I&255^99,s[_]=I,p[I]=_;var N=x[_],z=x[N],w=x[z],B=x[I]*257^I*16843008;n[_]=B<<24|B>>>8,o[_]=B<<16|B>>>16,E[_]=B<<8|B>>>24,c[_]=B;var B=w*16843009^z*65537^N*257^_*16843008;m[I]=B<<24|B>>>8,y[I]=B<<16|B>>>16,i[I]=B<<8|B>>>24,a[I]=B,_?(_=N^x[x[x[w^N]]],b^=x[x[b]]):_=b=1}})();var v=[0,1,2,4,8,16,32,64,128,27,54],f=d.AES=l.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var F=this._keyPriorReset=this._key,_=F.words,b=F.sigBytes/4,I=this._nRounds=b+6,N=(I+1)*4,z=this._keySchedule=[],w=0;w<N;w++)w<b?z[w]=_[w]:(x=z[w-1],w%b?b>6&&w%b==4&&(x=s[x>>>24]<<24|s[x>>>16&255]<<16|s[x>>>8&255]<<8|s[x&255]):(x=x<<8|x>>>24,x=s[x>>>24]<<24|s[x>>>16&255]<<16|s[x>>>8&255]<<8|s[x&255],x^=v[w/b|0]<<24),z[w]=z[w-b]^x);for(var B=this._invKeySchedule=[],D=0;D<N;D++){var w=N-D;if(D%4)var x=z[w];else var x=z[w-4];D<4||w<=4?B[D]=x:B[D]=m[s[x>>>24]]^y[s[x>>>16&255]]^i[s[x>>>8&255]]^a[s[x&255]]}}},encryptBlock:function(x,F){this._doCryptBlock(x,F,this._keySchedule,n,o,E,c,s)},decryptBlock:function(x,F){var _=x[F+1];x[F+1]=x[F+3],x[F+3]=_,this._doCryptBlock(x,F,this._invKeySchedule,m,y,i,a,p);var _=x[F+1];x[F+1]=x[F+3],x[F+3]=_},_doCryptBlock:function(x,F,_,b,I,N,z,w){for(var B=this._nRounds,D=x[F]^_[0],g=x[F+1]^_[1],q=x[F+2]^_[2],U=x[F+3]^_[3],G=4,Y=1;Y<B;Y++){var M=b[D>>>24]^I[g>>>16&255]^N[q>>>8&255]^z[U&255]^_[G++],H=b[g>>>24]^I[q>>>16&255]^N[U>>>8&255]^z[D&255]^_[G++],Z=b[q>>>24]^I[U>>>16&255]^N[D>>>8&255]^z[g&255]^_[G++],P=b[U>>>24]^I[D>>>16&255]^N[g>>>8&255]^z[q&255]^_[G++];D=M,g=H,q=Z,U=P}var M=(w[D>>>24]<<24|w[g>>>16&255]<<16|w[q>>>8&255]<<8|w[U&255])^_[G++],H=(w[g>>>24]<<24|w[q>>>16&255]<<16|w[U>>>8&255]<<8|w[D&255])^_[G++],Z=(w[q>>>24]<<24|w[U>>>16&255]<<16|w[D>>>8&255]<<8|w[g&255])^_[G++],P=(w[U>>>24]<<24|w[D>>>16&255]<<16|w[g>>>8&255]<<8|w[q&255])^_[G++];x[F]=M,x[F+1]=H,x[F+2]=Z,x[F+3]=P},keySize:256/32});e.AES=l._createHelper(f)})(),t.AES})})(nr)),nr.exports}var ar={exports:{}},tu=ar.exports,Kn;function ru(){return Kn||(Kn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),H0(),$0(),R0(),je())})(tu,function(t){return(function(){var e=t,h=e.lib,l=h.WordArray,d=h.BlockCipher,s=e.algo,p=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],n=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],o=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],E=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],m=s.DES=d.extend({_doReset:function(){for(var v=this._key,f=v.words,x=[],F=0;F<56;F++){var _=p[F]-1;x[F]=f[_>>>5]>>>31-_%32&1}for(var b=this._subKeys=[],I=0;I<16;I++){for(var N=b[I]=[],z=o[I],F=0;F<24;F++)N[F/6|0]|=x[(n[F]-1+z)%28]<<31-F%6,N[4+(F/6|0)]|=x[28+(n[F+24]-1+z)%28]<<31-F%6;N[0]=N[0]<<1|N[0]>>>31;for(var F=1;F<7;F++)N[F]=N[F]>>>(F-1)*4+3;N[7]=N[7]<<5|N[7]>>>27}for(var w=this._invSubKeys=[],F=0;F<16;F++)w[F]=b[15-F]},encryptBlock:function(v,f){this._doCryptBlock(v,f,this._subKeys)},decryptBlock:function(v,f){this._doCryptBlock(v,f,this._invSubKeys)},_doCryptBlock:function(v,f,x){this._lBlock=v[f],this._rBlock=v[f+1],y.call(this,4,252645135),y.call(this,16,65535),i.call(this,2,858993459),i.call(this,8,16711935),y.call(this,1,1431655765);for(var F=0;F<16;F++){for(var _=x[F],b=this._lBlock,I=this._rBlock,N=0,z=0;z<8;z++)N|=E[z][((I^_[z])&c[z])>>>0];this._lBlock=I,this._rBlock=b^N}var w=this._lBlock;this._lBlock=this._rBlock,this._rBlock=w,y.call(this,1,1431655765),i.call(this,8,16711935),i.call(this,2,858993459),y.call(this,16,65535),y.call(this,4,252645135),v[f]=this._lBlock,v[f+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function y(v,f){var x=(this._lBlock>>>v^this._rBlock)&f;this._rBlock^=x,this._lBlock^=x<<v}function i(v,f){var x=(this._rBlock>>>v^this._lBlock)&f;this._lBlock^=x,this._rBlock^=x<<v}e.DES=d._createHelper(m);var a=s.TripleDES=d.extend({_doReset:function(){var v=this._key,f=v.words;if(f.length!==2&&f.length!==4&&f.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var x=f.slice(0,2),F=f.length<4?f.slice(0,2):f.slice(2,4),_=f.length<6?f.slice(0,2):f.slice(4,6);this._des1=m.createEncryptor(l.create(x)),this._des2=m.createEncryptor(l.create(F)),this._des3=m.createEncryptor(l.create(_))},encryptBlock:function(v,f){this._des1.encryptBlock(v,f),this._des2.decryptBlock(v,f),this._des3.encryptBlock(v,f)},decryptBlock:function(v,f){this._des3.decryptBlock(v,f),this._des2.encryptBlock(v,f),this._des1.decryptBlock(v,f)},keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=d._createHelper(a)})(),t.TripleDES})})(ar)),ar.exports}var ir={exports:{}},nu=ir.exports,Gn;function au(){return Gn||(Gn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),H0(),$0(),R0(),je())})(nu,function(t){return(function(){var e=t,h=e.lib,l=h.StreamCipher,d=e.algo,s=d.RC4=l.extend({_doReset:function(){for(var o=this._key,E=o.words,c=o.sigBytes,m=this._S=[],y=0;y<256;y++)m[y]=y;for(var y=0,i=0;y<256;y++){var a=y%c,v=E[a>>>2]>>>24-a%4*8&255;i=(i+m[y]+v)%256;var f=m[y];m[y]=m[i],m[i]=f}this._i=this._j=0},_doProcessBlock:function(o,E){o[E]^=p.call(this)},keySize:256/32,ivSize:0});function p(){for(var o=this._S,E=this._i,c=this._j,m=0,y=0;y<4;y++){E=(E+1)%256,c=(c+o[E])%256;var i=o[E];o[E]=o[c],o[c]=i,m|=o[(o[E]+o[c])%256]<<24-y*8}return this._i=E,this._j=c,m}e.RC4=l._createHelper(s);var n=d.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var o=this.cfg.drop;o>0;o--)p.call(this)}});e.RC4Drop=l._createHelper(n)})(),t.RC4})})(ir)),ir.exports}var or={exports:{}},iu=or.exports,Xn;function ou(){return Xn||(Xn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),H0(),$0(),R0(),je())})(iu,function(t){return(function(){var e=t,h=e.lib,l=h.StreamCipher,d=e.algo,s=[],p=[],n=[],o=d.Rabbit=l.extend({_doReset:function(){for(var c=this._key.words,m=this.cfg.iv,y=0;y<4;y++)c[y]=(c[y]<<8|c[y]>>>24)&16711935|(c[y]<<24|c[y]>>>8)&4278255360;var i=this._X=[c[0],c[3]<<16|c[2]>>>16,c[1],c[0]<<16|c[3]>>>16,c[2],c[1]<<16|c[0]>>>16,c[3],c[2]<<16|c[1]>>>16],a=this._C=[c[2]<<16|c[2]>>>16,c[0]&4294901760|c[1]&65535,c[3]<<16|c[3]>>>16,c[1]&4294901760|c[2]&65535,c[0]<<16|c[0]>>>16,c[2]&4294901760|c[3]&65535,c[1]<<16|c[1]>>>16,c[3]&4294901760|c[0]&65535];this._b=0;for(var y=0;y<4;y++)E.call(this);for(var y=0;y<8;y++)a[y]^=i[y+4&7];if(m){var v=m.words,f=v[0],x=v[1],F=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,_=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,b=F>>>16|_&4294901760,I=_<<16|F&65535;a[0]^=F,a[1]^=b,a[2]^=_,a[3]^=I,a[4]^=F,a[5]^=b,a[6]^=_,a[7]^=I;for(var y=0;y<4;y++)E.call(this)}},_doProcessBlock:function(c,m){var y=this._X;E.call(this),s[0]=y[0]^y[5]>>>16^y[3]<<16,s[1]=y[2]^y[7]>>>16^y[5]<<16,s[2]=y[4]^y[1]>>>16^y[7]<<16,s[3]=y[6]^y[3]>>>16^y[1]<<16;for(var i=0;i<4;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360,c[m+i]^=s[i]},blockSize:128/32,ivSize:64/32});function E(){for(var c=this._X,m=this._C,y=0;y<8;y++)p[y]=m[y];m[0]=m[0]+1295307597+this._b|0,m[1]=m[1]+3545052371+(m[0]>>>0<p[0]>>>0?1:0)|0,m[2]=m[2]+886263092+(m[1]>>>0<p[1]>>>0?1:0)|0,m[3]=m[3]+1295307597+(m[2]>>>0<p[2]>>>0?1:0)|0,m[4]=m[4]+3545052371+(m[3]>>>0<p[3]>>>0?1:0)|0,m[5]=m[5]+886263092+(m[4]>>>0<p[4]>>>0?1:0)|0,m[6]=m[6]+1295307597+(m[5]>>>0<p[5]>>>0?1:0)|0,m[7]=m[7]+3545052371+(m[6]>>>0<p[6]>>>0?1:0)|0,this._b=m[7]>>>0<p[7]>>>0?1:0;for(var y=0;y<8;y++){var i=c[y]+m[y],a=i&65535,v=i>>>16,f=((a*a>>>17)+a*v>>>15)+v*v,x=((i&4294901760)*i|0)+((i&65535)*i|0);n[y]=f^x}c[0]=n[0]+(n[7]<<16|n[7]>>>16)+(n[6]<<16|n[6]>>>16)|0,c[1]=n[1]+(n[0]<<8|n[0]>>>24)+n[7]|0,c[2]=n[2]+(n[1]<<16|n[1]>>>16)+(n[0]<<16|n[0]>>>16)|0,c[3]=n[3]+(n[2]<<8|n[2]>>>24)+n[1]|0,c[4]=n[4]+(n[3]<<16|n[3]>>>16)+(n[2]<<16|n[2]>>>16)|0,c[5]=n[5]+(n[4]<<8|n[4]>>>24)+n[3]|0,c[6]=n[6]+(n[5]<<16|n[5]>>>16)+(n[4]<<16|n[4]>>>16)|0,c[7]=n[7]+(n[6]<<8|n[6]>>>24)+n[5]|0}e.Rabbit=l._createHelper(o)})(),t.Rabbit})})(or)),or.exports}var sr={exports:{}},su=sr.exports,Yn;function uu(){return Yn||(Yn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),H0(),$0(),R0(),je())})(su,function(t){return(function(){var e=t,h=e.lib,l=h.StreamCipher,d=e.algo,s=[],p=[],n=[],o=d.RabbitLegacy=l.extend({_doReset:function(){var c=this._key.words,m=this.cfg.iv,y=this._X=[c[0],c[3]<<16|c[2]>>>16,c[1],c[0]<<16|c[3]>>>16,c[2],c[1]<<16|c[0]>>>16,c[3],c[2]<<16|c[1]>>>16],i=this._C=[c[2]<<16|c[2]>>>16,c[0]&4294901760|c[1]&65535,c[3]<<16|c[3]>>>16,c[1]&4294901760|c[2]&65535,c[0]<<16|c[0]>>>16,c[2]&4294901760|c[3]&65535,c[1]<<16|c[1]>>>16,c[3]&4294901760|c[0]&65535];this._b=0;for(var a=0;a<4;a++)E.call(this);for(var a=0;a<8;a++)i[a]^=y[a+4&7];if(m){var v=m.words,f=v[0],x=v[1],F=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,_=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,b=F>>>16|_&4294901760,I=_<<16|F&65535;i[0]^=F,i[1]^=b,i[2]^=_,i[3]^=I,i[4]^=F,i[5]^=b,i[6]^=_,i[7]^=I;for(var a=0;a<4;a++)E.call(this)}},_doProcessBlock:function(c,m){var y=this._X;E.call(this),s[0]=y[0]^y[5]>>>16^y[3]<<16,s[1]=y[2]^y[7]>>>16^y[5]<<16,s[2]=y[4]^y[1]>>>16^y[7]<<16,s[3]=y[6]^y[3]>>>16^y[1]<<16;for(var i=0;i<4;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360,c[m+i]^=s[i]},blockSize:128/32,ivSize:64/32});function E(){for(var c=this._X,m=this._C,y=0;y<8;y++)p[y]=m[y];m[0]=m[0]+1295307597+this._b|0,m[1]=m[1]+3545052371+(m[0]>>>0<p[0]>>>0?1:0)|0,m[2]=m[2]+886263092+(m[1]>>>0<p[1]>>>0?1:0)|0,m[3]=m[3]+1295307597+(m[2]>>>0<p[2]>>>0?1:0)|0,m[4]=m[4]+3545052371+(m[3]>>>0<p[3]>>>0?1:0)|0,m[5]=m[5]+886263092+(m[4]>>>0<p[4]>>>0?1:0)|0,m[6]=m[6]+1295307597+(m[5]>>>0<p[5]>>>0?1:0)|0,m[7]=m[7]+3545052371+(m[6]>>>0<p[6]>>>0?1:0)|0,this._b=m[7]>>>0<p[7]>>>0?1:0;for(var y=0;y<8;y++){var i=c[y]+m[y],a=i&65535,v=i>>>16,f=((a*a>>>17)+a*v>>>15)+v*v,x=((i&4294901760)*i|0)+((i&65535)*i|0);n[y]=f^x}c[0]=n[0]+(n[7]<<16|n[7]>>>16)+(n[6]<<16|n[6]>>>16)|0,c[1]=n[1]+(n[0]<<8|n[0]>>>24)+n[7]|0,c[2]=n[2]+(n[1]<<16|n[1]>>>16)+(n[0]<<16|n[0]>>>16)|0,c[3]=n[3]+(n[2]<<8|n[2]>>>24)+n[1]|0,c[4]=n[4]+(n[3]<<16|n[3]>>>16)+(n[2]<<16|n[2]>>>16)|0,c[5]=n[5]+(n[4]<<8|n[4]>>>24)+n[3]|0,c[6]=n[6]+(n[5]<<16|n[5]>>>16)+(n[4]<<16|n[4]>>>16)|0,c[7]=n[7]+(n[6]<<8|n[6]>>>24)+n[5]|0}e.RabbitLegacy=l._createHelper(o)})(),t.RabbitLegacy})})(sr)),sr.exports}var ur={exports:{}},lu=ur.exports,Qn;function cu(){return Qn||(Qn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),H0(),$0(),R0(),je())})(lu,function(t){return(function(){var e=t,h=e.lib,l=h.BlockCipher,d=e.algo;const s=16,p=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],n=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function E(a,v){let f=v>>24&255,x=v>>16&255,F=v>>8&255,_=v&255,b=a.sbox[0][f]+a.sbox[1][x];return b=b^a.sbox[2][F],b=b+a.sbox[3][_],b}function c(a,v,f){let x=v,F=f,_;for(let b=0;b<s;++b)x=x^a.pbox[b],F=E(a,x)^F,_=x,x=F,F=_;return _=x,x=F,F=_,F=F^a.pbox[s],x=x^a.pbox[s+1],{left:x,right:F}}function m(a,v,f){let x=v,F=f,_;for(let b=s+1;b>1;--b)x=x^a.pbox[b],F=E(a,x)^F,_=x,x=F,F=_;return _=x,x=F,F=_,F=F^a.pbox[1],x=x^a.pbox[0],{left:x,right:F}}function y(a,v,f){for(let I=0;I<4;I++){a.sbox[I]=[];for(let N=0;N<256;N++)a.sbox[I][N]=n[I][N]}let x=0;for(let I=0;I<s+2;I++)a.pbox[I]=p[I]^v[x],x++,x>=f&&(x=0);let F=0,_=0,b=0;for(let I=0;I<s+2;I+=2)b=c(a,F,_),F=b.left,_=b.right,a.pbox[I]=F,a.pbox[I+1]=_;for(let I=0;I<4;I++)for(let N=0;N<256;N+=2)b=c(a,F,_),F=b.left,_=b.right,a.sbox[I][N]=F,a.sbox[I][N+1]=_;return!0}var i=d.Blowfish=l.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var a=this._keyPriorReset=this._key,v=a.words,f=a.sigBytes/4;y(o,v,f)}},encryptBlock:function(a,v){var f=c(o,a[v],a[v+1]);a[v]=f.left,a[v+1]=f.right},decryptBlock:function(a,v){var f=m(o,a[v],a[v+1]);a[v]=f.left,a[v+1]=f.right},blockSize:64/32,keySize:128/32,ivSize:64/32});e.Blowfish=l._createHelper(i)})(),t.Blowfish})})(ur)),ur.exports}var du=_t.exports,Zn;function fu(){return Zn||(Zn=1,(function(r,u){(function(t,e,h){r.exports=e(de(),pr(),us(),cs(),H0(),xs(),$0(),Pa(),$r(),ms(),Ta(),Fs(),Bs(),bs(),Wr(),ws(),R0(),je(),Rs(),Ps(),zs(),Ls(),Ms(),Hs(),Ws(),Vs(),Gs(),Ys(),Zs(),eu(),ru(),au(),ou(),uu(),cu())})(du,function(t){return t})})(_t)),_t.exports}var xu=fu();const za=ea(xu);za.enc.Utf8.parse("1234567890123456");za.enc.Utf8.parse("1234567890123456");const jr={login:{usernamePlaceholder:"\u8F93\u5165\u7528\u6237\u540D\u5B57",passwordPlaceholder:"\u8F93\u5165\u5BC6\u7801",verifyCodePlaceholder:"\u8F93\u5165\u9A8C\u8BC1\u7801",usernameRequired:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u5B57",passwordRequired:"\u8BF7\u8F93\u5165\u5BC6\u7801",verifyCodeRequired:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",submit:"\u767B\u5F55",errorFallback:"\u767B\u5F55\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5"},register:{labels:{username:"\u7528\u6237\u540D",phone:"\u624B\u673A\u53F7",email:"\u90AE\u7BB1",password:"\u5BC6\u7801",confirmPassword:"\u786E\u8BA4\u5BC6\u7801",verifyCode:"\u9A8C\u8BC1\u7801"},placeholders:{username:"\u8F93\u5165\u7528\u6237\u540D\u5B57",phone:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",email:"\u8F93\u5165\u90AE\u7BB1",password:"\u8BF7\u8F93\u5165\u5BC6\u7801",confirmPassword:"\u8BF7\u786E\u8BA4\u65B0\u5BC6\u7801",verifyCode:"\u8F93\u5165\u9A8C\u8BC1\u7801"},required:{username:"\u8BF7\u8F93\u5165\u540D\u79F0",phone:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",email:"\u8BF7\u8F93\u5165\u90AE\u7BB1",password:"\u8BF7\u8F93\u5165\u5BC6\u7801",confirmPassword:"\u8BF7\u786E\u8BA4\u65B0\u5BC6\u7801",verifyCode:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"},cancel:"\u53D6\u6D88",submit:"\u6CE8\u518C",passwordConfirmMismatch:"\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4!"}},pu={login:{usernamePlaceholder:"Enter username",passwordPlaceholder:"Enter password",verifyCodePlaceholder:"Enter verification code",usernameRequired:"Please enter username",passwordRequired:"Please enter password",verifyCodeRequired:"Please enter verification code",submit:"Sign in",errorFallback:"Login failed, please try again later."},register:{labels:{username:"Username",phone:"Phone",email:"Email",password:"Password",confirmPassword:"Confirm password",verifyCode:"Verification code"},placeholders:{username:"Enter username",phone:"Enter phone number",email:"Enter email",password:"Enter password",confirmPassword:"Confirm password",verifyCode:"Enter verification code"},required:{username:"Please enter username",phone:"Please enter phone number",email:"Please enter email",password:"Please enter password",confirmPassword:"Please confirm password",verifyCode:"Please enter verification code"},cancel:"Cancel",submit:"Register",passwordConfirmMismatch:"Passwords do not match."}},hu={login:{usernamePlaceholder:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B",passwordPlaceholder:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",verifyCodePlaceholder:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B",usernameRequired:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",passwordRequired:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",verifyCodeRequired:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",submit:"\u30ED\u30B0\u30A4\u30F3",errorFallback:"\u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"},register:{labels:{username:"\u30E6\u30FC\u30B6\u30FC\u540D",phone:"\u96FB\u8A71\u756A\u53F7",email:"\u30E1\u30FC\u30EB",password:"\u30D1\u30B9\u30EF\u30FC\u30C9",confirmPassword:"\u30D1\u30B9\u30EF\u30FC\u30C9\u78BA\u8A8D",verifyCode:"\u8A8D\u8A3C\u30B3\u30FC\u30C9"},placeholders:{username:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B",phone:"\u96FB\u8A71\u756A\u53F7\u3092\u5165\u529B",email:"\u30E1\u30FC\u30EB\u3092\u5165\u529B",password:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",confirmPassword:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u78BA\u8A8D",verifyCode:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B"},required:{username:"\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",phone:"\u96FB\u8A71\u756A\u53F7\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",email:"\u30E1\u30FC\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",password:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",confirmPassword:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",verifyCode:"\u8A8D\u8A3C\u30B3\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",submit:"\u767B\u9332",passwordConfirmMismatch:"\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002"}},vu={zh:jr,en:pu,ja:hu};function gu(r,u){const t=vu[r]??jr;return u?{...t,...u}:t}const qa=Re.createContext({locale:"zh",messages:jr});function Vu(){return Re.useContext(qa)}function Ku({locale:r,messages:u,children:t}){const e=Re.useMemo(()=>({locale:r,messages:gu(r,u)}),[r,u]);return Re.createElement(qa.Provider,{value:e},t)}export{Na as D,Ku as L,qa as a,gu as g,Vu as u,ju as w};
|