@gientech/modual 1.8.3 → 1.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +643 -643
- package/assets/{GientechStreamReader-COjGWi_s.js → GientechStreamReader-C7an1QrK.js} +1 -1
- package/assets/{mysql.svg → MySQL.svg} +14 -14
- package/assets/database.svg +11 -11
- package/assets/database_add.svg +53 -53
- package/assets/database_connect.svg +66 -66
- package/assets/database_upload.svg +29 -29
- package/assets/databse.svg +6 -6
- package/assets/defaultWeLogo.svg +14 -14
- package/assets/graph.svg +4 -4
- package/assets/{index-NBU1h9MU.js → index-6Ox5f3GI.js} +1 -1
- package/assets/index-8usKJjKH.js +157 -0
- package/assets/{index-BQWU6aA6.js → index-B0fJUyM7.js} +1 -1
- package/assets/{index-CTXs951x.js → index-BmVOh6oe.js} +1 -1
- package/assets/{index-6rZwr24p.js → index-CFqsgVcx.js} +1 -1
- package/assets/index-D4NnOWbo.js +576 -0
- package/assets/{index-BtzZe0dg.js → index-DhczpnL_.js} +256 -115
- package/assets/{index-B16gaAst.js → index-Di5Ga230.js} +2 -2
- package/assets/{index-C0f77Ai0.js → index-OjluyvX1.js} +2 -2
- package/assets/index-tplNfcnA.js +11 -0
- package/assets/knowledge.svg +4 -4
- package/assets/{plus-CrrWzgTO.js → plus-Dbo_i_9Z.js} +1 -1
- package/assets/sensitive.svg +5 -5
- package/assets/{index-D1PtBLCr.js → style-bUXwVVWZ.js} +1 -1
- package/assets/style.css +1 -1
- package/assets/style3.css +1 -1
- package/assets/style4.css +1 -0
- package/assets/{x-B50yFeY5.js → x-C7NWGGXn.js} +1 -1
- package/assistantConfig.js +1 -1
- package/chat.js +6 -6
- package/database.js +2 -2
- package/databaseId.d.ts +1 -0
- package/databaseId.js +1 -1
- package/databaseTable.js +2 -2
- package/index.js +1 -1
- package/modelManage.js +1 -1
- package/package.json +6 -6
- package/sensitive.js +1 -1
- package/streamFilesReader.js +1 -1
- package/worker/pdf.worker.min.js +21 -21
- package/assets/index-BU3ahTSx.js +0 -157
- package/assets/index-Cqand6Yl.js +0 -585
- package/assets/index-DNf62wMu.js +0 -11
package/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as Z,jsxs as et,Fragment as hp}from"react/jsx-runtime";import*as C from"react";import ke,{useRef as tt,useEffect as vt,Component as AC,forwardRef as Ai,createElement as Jl,createContext as fs,version as $H,useMemo as Vt,useContext as or,useState as at,Children as aI,useCallback as o3,useImperativeHandle as Sc,useLayoutEffect as sI,cloneElement as lI,isValidElement as cI,PureComponent as AH}from"react";import{c as Ji,g as OC,au as uI,
|
|
1
|
+
import{jsx as Z,jsxs as et,Fragment as hp}from"react/jsx-runtime";import*as C from"react";import ke,{useRef as tt,useEffect as vt,Component as AC,forwardRef as Ai,createElement as Jl,createContext as fs,version as $H,useMemo as Vt,useContext as or,useState as at,Children as aI,useCallback as o3,useImperativeHandle as Sc,useLayoutEffect as sI,cloneElement as lI,isValidElement as cI,PureComponent as AH}from"react";import{c as Ji,g as OC,au as uI,j as $c,an as dI,aN as fI,B as So,aB as OH,e as sr,u as hI,a3 as pI,aF as NC,E as NH,aE as MH,ad as ql,G as r2,w as gI,y as Yi,bT as o2,T as MC,m as mI,r as vI,h as xo,K as i2,b5 as DH,av as TH,ay as PH,aw as IH,bU as FH,ac as xd,A as RH,bV as La,bW as eo,_ as Fi,bz as yI,bA as bI,aW as xI,H as Er,bN as Lr,aV as EI,z as BH,aJ as wI,bh as CI,bX as i3,bC as _H,bY as jH,n as kI,bu as LH,bE as zH,ap as HH,l as a3,at as s3,aZ as WH,bZ as VH,aP as SI,a as Ur,I as Wu,i as DC,F as Ra,aK as pp,b_ as $I,bR as GH,a5 as qH,b$ as sm}from"./assets/index-OjluyvX1.js";import{I as ar,d as l3,C as AI,T as UH,b as YH}from"./assets/index-DhczpnL_.js";import*as XH from"react-dom";import c3,{flushSync as Vu,createPortal as OI,unstable_batchedUpdates as KH}from"react-dom";import{D as ZH,T as QH,F as JH,q as u3}from"./assets/index-CFqsgVcx.js";import{u as pa}from"./assets/index-CpW6Dhpp.js";/* empty css */import{A as eW,i as tW,s as rr,M as gp,S as Xd}from"./assets/style-bUXwVVWZ.js";import{P as NI}from"./assets/plus-Dbo_i_9Z.js";import{S as a2}from"./assets/index-8usKJjKH.js";import{X as mp}from"./assets/x-C7NWGGXn.js";import{g as d3,P as nW,a as MI}from"./assets/index-tplNfcnA.js";import{C as rW,G as DI,c as oW,r as iW}from"./assets/GientechStreamReader-C7an1QrK.js";import{B as oCe}from"./assets/GientechStreamReader-C7an1QrK.js";import{P as aW}from"./assets/index-Di5Ga230.js";import"./database.js";import"./databaseTable.js";import"./modelManage.js";import"./sensitive.js";import{D as sW}from"./assets/index-6Ox5f3GI.js";import"./assets/index-B0fJUyM7.js";import"./assets/index-D4NnOWbo.js";import"./assets/index-BmVOh6oe.js";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -482,7 +482,7 @@ ${v.substring(Y)}`;y(J),requestAnimationFrame(()=>{U.selectionStart=U.selectionE
|
|
|
482
482
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
483
483
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
484
484
|
THE SOFTWARE.
|
|
485
|
-
*/function Sw(e){if(e.constructor!==Array)throw new TypeError("Expected array.");if(e.length===16)return e;if(e.length===6){var t=_c();return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}throw new RangeError("Expected array with either 6 or 16 values.")}function _c(){for(var e=[],t=0;t<16;t++)t%5==0?e.push(1):e.push(0);return e}function xae(e,t){for(var n=Sw(e),r=Sw(t),o=[],i=0;i<4;i++)for(var a=[n[i],n[i+4],n[i+8],n[i+12]],s=0;s<4;s++){var l=s*4,c=[r[l],r[l+1],r[l+2],r[l+3]],u=a[0]*c[0]+a[1]*c[1]+a[2]*c[2]+a[3]*c[3];o[i+l]=u}return o}function Eae(e){if(typeof e=="string"){var t=e.match(/matrix(3d)?\(([^)]+)\)/);if(t){var n=t[2].split(", ").map(parseFloat);return Sw(n)}}return _c()}function wae(e){var t=_c();return t[0]=e,t}function Cae(e){var t=_c();return t[5]=e,t}function kae(e){var t=_c();return t[12]=e,t}function Sae(e){var t=_c();return t[13]=e,t}var gh=function(e){return typeof e=="number"},Z_=function(e){return typeof e=="function"},Q_=function(e){return Object.prototype.toString.call(e)==="[object Object]"},rc=function(e){return Array.prototype.slice.apply(e)},J_=function(e){var t=e.reduce(function(n,r){return n[r]=(n[r]||0)+1,n},{});return Object.keys(t).filter(function(n){return t[n]>1})};function Ba(e){return[].slice.call(arguments,1).forEach(function(t){if(t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}),e}var $w,Aw=function(e,t,n){return e+(t-e)*n},e9={__proto__:null,isNumber:gh,isFunction:Z_,isObject:Q_,toArray:rc,getDuplicateValsAsStrings:J_,assign:Ba,tweenProp:Aw},Uk="data-flip-id",Yk="data-inverse-flip-id",Xk="data-portal-key",$ae="data-exit-container",yf={__proto__:null,DATA_FLIP_ID:Uk,DATA_INVERSE_FLIP_ID:Yk,DATA_FLIP_CONFIG:"data-flip-config",DATA_PORTAL_KEY:Xk},Ow={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}},p6=function(e){return Q_(e)?e:Object.keys(Ow).indexOf(e)>-1?Ow[e]:{}};typeof window<"u"&&($w=window.requestAnimationFrame);var Aae=$w=$w||function(e){window.setTimeout(e,1e3/60)},Oae=Date.now(),Nae=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()-Oae};function t9(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1)}var Mae=(function(){function e(){}return e.prototype.run=function(){var t=this;Aae(function(){t.springSystem.loop(Nae())})},e})(),tv=function(){this.position=0,this.velocity=0},Dae=0,qo=.001,Tae=(function(){function e(n){this._id="s"+Dae++,this._springSystem=n,this.listeners=[],this._startValue=0,this._currentState=new tv,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new tv,this._restSpeedThreshold=.001,this._tempState=new tv,this._timeAccumulator=0,this._wasAtRest=!0,this._cachedSpringConfig={}}var t=e.prototype;return t.getId=function(){return this._id},t.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this)},t.setSpringConfig=function(n){return this._springConfig=n,this},t.getCurrentValue=function(){return this._currentState.position},t.getDisplacementDistanceForState=function(n){return Math.abs(this._endValue-n.position)},t.setEndValue=function(n){if(n===this._endValue)return this;if(this.prevEndValue=n,this._endValue===n&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=n,this._springSystem.activateSpring(this.getId());for(var r=0,o=this.listeners.length;r<o;r++){var i=this.listeners[r].onSpringEndStateChange;i&&i(this)}return this},t.setVelocity=function(n){return n===this._currentState.velocity||(this._currentState.velocity=n,this._springSystem.activateSpring(this.getId())),this},t.setCurrentValue=function(n){this._startValue=n,this._currentState.position=n;for(var r=0,o=this.listeners.length;r<o;r++){var i=this.listeners[r];i.onSpringUpdate&&i.onSpringUpdate(this)}return this},t.setAtRest=function(){return this._endValue=this._currentState.position,this._tempState.position=this._currentState.position,this._currentState.velocity=0,this},t.setOvershootClampingEnabled=function(n){return this._overshootClampingEnabled=n,this},t.isOvershooting=function(){var n=this._startValue,r=this._endValue;return this._springConfig.tension>0&&(n<r&&this.getCurrentValue()>r||n>r&&this.getCurrentValue()<r)},t.advance=function(n,r){var o=this.isAtRest();if(!o||!this._wasAtRest){var i=r;r>.064&&(i=.064),this._timeAccumulator+=i;for(var a,s,l,c,u,d,f=this._springConfig.tension,h=this._springConfig.friction,m=this._currentState.position,g=this._currentState.velocity,p=this._tempState.position,v=this._tempState.velocity;this._timeAccumulator>=qo;)this._timeAccumulator-=qo,this._timeAccumulator<qo&&(this._previousState.position=m,this._previousState.velocity=g),s=f*(this._endValue-p)-h*g,c=f*(this._endValue-(p=m+(a=g)*qo*.5))-h*(v=g+s*qo*.5),d=f*(this._endValue-(p=m+(l=v)*qo*.5))-h*(v=g+c*qo*.5),p=m+(u=v)*qo,m+=1/6*(a+2*(l+u)+(v=g+d*qo))*qo,g+=1/6*(s+2*(c+d)+(f*(this._endValue-p)-h*v))*qo;this._tempState.position=p,this._tempState.velocity=v,this._currentState.position=m,this._currentState.velocity=g,this._timeAccumulator>0&&this._interpolate(this._timeAccumulator/qo),(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),o=!0);var y=!1;this._wasAtRest&&(this._wasAtRest=!1,y=!0);var b=!1;o&&(this._wasAtRest=!0,b=!0),this.notifyPositionUpdated(y,b)}},t.notifyPositionUpdated=function(n,r){var o=this;this.listeners.filter(Boolean).forEach(function(i){n&&i.onSpringActivate&&!o._onActivateCalled&&(i.onSpringActivate(o),o._onActivateCalled=!0),i.onSpringUpdate&&i.onSpringUpdate(o),r&&i.onSpringAtRest&&i.onSpringAtRest(o)})},t.systemShouldAdvance=function(){return!this.isAtRest()||!this.wasAtRest()},t.wasAtRest=function(){return this._wasAtRest},t.isAtRest=function(){return Math.abs(this._currentState.velocity)<this._restSpeedThreshold&&(this.getDisplacementDistanceForState(this._currentState)<=this._displacementFromRestThreshold||this._springConfig.tension===0)},t._interpolate=function(n){this._currentState.position=this._currentState.position*n+this._previousState.position*(1-n),this._currentState.velocity=this._currentState.velocity*n+this._previousState.velocity*(1-n)},t.addListener=function(n){return this.listeners.push(n),this},t.addOneTimeListener=function(n){var r=this;return Object.keys(n).forEach(function(o){var i;n[o]=(i=n[o],function(){i.apply(void 0,[].slice.call(arguments)),r.removeListener(n)})}),this.listeners.push(n),this},t.removeListener=function(n){return t9(this.listeners,n),this},e})(),n9=(function(){function e(n){this.looper=n||new Mae,this.looper.springSystem=this,this.listeners=[],this._activeSprings=[],this._idleSpringIndices=[],this._isIdle=!0,this._lastTimeMillis=-1,this._springRegistry={}}var t=e.prototype;return t.createSpring=function(n,r){return this.createSpringWithConfig({tension:n,friction:r})},t.createSpringWithConfig=function(n){var r=new Tae(this);return this.registerSpring(r),r.setSpringConfig(n),r},t.getIsIdle=function(){return this._isIdle},t.registerSpring=function(n){this._springRegistry[n.getId()]=n},t.deregisterSpring=function(n){t9(this._activeSprings,n),delete this._springRegistry[n.getId()]},t.advance=function(n,r){for(var o=this;this._idleSpringIndices.length>0;)this._idleSpringIndices.pop();for(this._activeSprings.filter(Boolean).forEach(function(a){a.systemShouldAdvance()?a.advance(n/1e3,r/1e3):o._idleSpringIndices.push(o._activeSprings.indexOf(a))});this._idleSpringIndices.length>0;){var i=this._idleSpringIndices.pop();i>=0&&this._activeSprings.splice(i,1)}},t.loop=function(n){var r;this._lastTimeMillis===-1&&(this._lastTimeMillis=n-1);var o=n-this._lastTimeMillis;this._lastTimeMillis=n;var i=0,a=this.listeners.length;for(i=0;i<a;i++)(r=this.listeners[i]).onBeforeIntegrate&&r.onBeforeIntegrate(this);for(this.advance(n,o),this._activeSprings.length===0&&(this._isIdle=!0,this._lastTimeMillis=-1),i=0;i<a;i++)(r=this.listeners[i]).onAfterIntegrate&&r.onAfterIntegrate(this);this._isIdle||this.looper.run()},t.activateSpring=function(n){var r=this._springRegistry[n];this._activeSprings.indexOf(r)===-1&&this._activeSprings.push(r),this.getIsIdle()&&(this._isIdle=!1,this.looper.run())},e})(),Pae=new n9,r9=function(e){var t=e.springConfig,n=t.overshootClamping,r=e.getOnUpdateFunc,o=e.onAnimationEnd,i=e.onSpringActivate,a=Pae.createSpring(t.stiffness,t.damping);a.setOvershootClampingEnabled(!!n);var s={onSpringActivate:i,onSpringAtRest:function(){a.destroy(),o()},onSpringUpdate:r({spring:a,onAnimationEnd:o})};return a.addListener(s),a},g6=function(e){var t=r9(e);return t.setEndValue(1),t},m6=function(e,t){if(t===void 0&&(t={}),e&&e.length){t.reverse&&e.reverse();var n,r=typeof(n=t.speed)!="number"?1.1:1+Math.min(Math.max(5*n,0),5),o=1/Math.max(Math.min(e.length,100),10),i=e.map(function(a,s){var l=a.getOnUpdateFunc;return a.getOnUpdateFunc=function(c){var u=l(c);return function(d){var f=d.getCurrentValue();(f=f<.01?0:f>.99?1:f)>=o&&i[s+1]&&i[s+1](Math.max(Math.min(f*r,1),0)),u(d)}},a}).map(function(a){var s=r9(a);if(s)return s.setEndValue.bind(s)}).filter(Boolean);i[0]&&i[0](1)}},v6=function(e){return[0,1,4,5,12,13].map(function(t){return e[t]})},y6=function(e){return e.top<window.innerHeight&&e.bottom>0&&e.left<window.innerWidth&&e.right>0};function b6(e){return JSON.parse(e.dataset.flipConfig||"{}")}var o9=function(e,t){var n;return Ba(e,((n={})[t[0]]=t[1],n))},i9=function(e,t){return rc(t?document.querySelectorAll("["+Xk+'="'+t+'"]'):e.querySelectorAll("["+Uk+"]"))},a9=function(e){return e.map(function(t){return[t,t.getBoundingClientRect()]})},Iae=function(e){var t=e.cachedOrderedFlipIds,n=t===void 0?[]:t,r=e.inProgressAnimations,o=r===void 0?{}:r,i=e.flippedElementPositionsBeforeUpdate,a=i===void 0?{}:i,s=e.flipCallbacks,l=s===void 0?{}:s,c=e.containerEl,u=e.applyTransformOrigin,d=e.spring,f=e.debug,h=e.portalKey,m=e.staggerConfig,g=m===void 0?{}:m,p=e.decisionData,v=p===void 0?{}:p,y=e.handleEnterUpdateDelete,b=e.onComplete,E=e.onStart;if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var x,w=a9(i9((x={element:c,portalKey:h}).element,x.portalKey)).map(function(j){var z=j[0],V=j[1],L=window.getComputedStyle(z);return[z.dataset.flipId,{element:z,rect:V,opacity:parseFloat(L.opacity),transform:L.transform}]}).reduce(o9,{}),k=(function(j){var z=j.containerEl,V=j.portalKey;return V?(function(L){return function(_){return rc(document.querySelectorAll("["+Xk+'="'+L+'"]'+_))}})(V):z?(function(L){var _=Math.random().toFixed(5);return L.dataset.flipperId=_,function(F){return rc(L.querySelectorAll('[data-flipper-id="'+_+'"] '+F))}})(z):function(){return[]}})({containerEl:c,portalKey:h}),S=(function(j){return function(z){return j("["+Uk+'="'+z+'"]')[0]}})(k),O=function(j){return a[j]&&w[j]},$=Object.keys(a).concat(Object.keys(w)).filter(function(j){return!O(j)}),A={flipCallbacks:l,getElement:S,flippedElementPositionsBeforeUpdate:a,flippedElementPositionsAfterUpdate:w,inProgressAnimations:o,decisionData:v},N=(function(j){var z,V=j.unflippedIds,L=j.flipCallbacks,_=j.getElement,F=j.flippedElementPositionsBeforeUpdate,T=j.flippedElementPositionsAfterUpdate,B=j.inProgressAnimations,H=j.decisionData,G=V.filter(function(X){return T[X]}).filter(function(X){return L[X]&&L[X].onAppear}),W=V.filter(function(X){return F[X]&&L[X]&&L[X].onExit}),U=new Promise(function(X){z=X}),q=[],Y=0,J=W.map(function(X,oe){var ie=F[X].domDataForExitAnimations,ee=ie.element,ae=ie.parent,pe=ie.childPosition,ye=pe.top,Ne=pe.left,xe=pe.width,Oe=pe.height;getComputedStyle(ae).position==="static"&&(ae.style.position="relative"),ee.style.transform="matrix(1, 0, 0, 1, 0, 0)",ee.style.position="absolute",ee.style.top=ye+"px",ee.style.left=Ne+"px",ee.style.height=Oe+"px",ee.style.width=xe+"px";var ce=q.filter(function(Pe){return Pe[0]===ae})[0];ce||(ce=[ae,document.createDocumentFragment()],q.push(ce)),ce[1].appendChild(ee),Y+=1;var me=function(){try{ae.removeChild(ee)}catch{}finally{(Y-=1)==0&&z()}};return B[X]={stop:me},function(){return L[X].onExit(ee,oe,me,H)}});return q.forEach(function(X){X[0].appendChild(X[1])}),J.length||z(),{hideEnteringElements:function(){G.forEach(function(X){var oe=_(X);oe&&(oe.style.opacity="0")})},animateEnteringElements:function(){G.forEach(function(X,oe){var ie=_(X);ie&&L[X].onAppear(ie,oe,H)})},animateExitingElements:function(){return J.forEach(function(X){return X()}),U}}})(Ba({},A,{unflippedIds:$})),M=N.hideEnteringElements,D=N.animateEnteringElements,P=N.animateExitingElements,I=Ba({},A,{containerEl:c,flippedIds:n.filter(O),applyTransformOrigin:u,spring:d,debug:f,staggerConfig:g,scopedSelector:k,onComplete:b});E&&E(c,v);var R=(function(j){var z,V=j.flippedIds,L=j.flipCallbacks,_=j.inProgressAnimations,F=j.flippedElementPositionsBeforeUpdate,T=j.flippedElementPositionsAfterUpdate,B=j.applyTransformOrigin,H=j.spring,G=j.getElement,W=j.debug,U=j.staggerConfig,q=U===void 0?{}:U,Y=j.decisionData,J=Y===void 0?{}:Y,X=j.onComplete,oe=j.containerEl,ie=new Promise(function(le){z=le});if(X&&ie.then(function(){return X(oe,J)}),!V.length)return function(){return z([]),ie};var ee=[],ae=G(V[0]),pe=ae?ae.ownerDocument.querySelector("body"):document.querySelector("body");J_(V);var ye=V.map(function(le){var _e=F[le].rect,de=T[le].rect,Se=F[le].opacity,Ie=T[le].opacity,Ee=de.width<1||de.height<1,he=T[le].element;if(!y6(_e)&&!y6(de)||!he)return!1;var we,$e,Re,Me=b6(he),fe=(Re=($e=(we={flipperSpring:H,flippedSpring:Me.spring})===void 0?{}:we).flippedSpring,Ba({},Ow.noWobble,p6($e.flipperSpring),p6(Re))),Ye=Me.stagger===!0?"default":Me.stagger,Ke={element:he,id:le,stagger:Ye,springConfig:fe};if(L[le]&&L[le].shouldFlip&&!L[le].shouldFlip(J.previous,J.current))return!1;var st=Math.abs(_e.left-de.left)+Math.abs(_e.top-de.top),bt=Math.abs(_e.width-de.width)+Math.abs(_e.height-de.height),Le=Math.abs(Ie-Se);if(_e.height===0&&de.height===0||_e.width===0&&de.width===0||st<.5&&bt<.5&&Le<.01)return!1;var Xe=Eae(T[le].transform),qe={matrix:Xe},ut={matrix:[]},dt=[Xe];Me.translate&&(dt.push(kae(_e.left-de.left)),dt.push(Sae(_e.top-de.top))),Me.scale&&(dt.push(wae(Math.max(_e.width,1)/Math.max(de.width,1))),dt.push(Cae(Math.max(_e.height,1)/Math.max(de.height,1)))),Me.opacity&&(ut.opacity=Se,qe.opacity=Ie);var Pt=[];if(!L[le]||!L[le].shouldInvert||L[le].shouldInvert(J.previous,J.current)){var Lt=(function(De,We){return rc(De.querySelectorAll("["+Yk+'="'+We+'"]'))})(he,le);Pt=Lt.map(function(De){return[De,b6(De)]})}ut.matrix=v6(dt.reduce(xae)),qe.matrix=v6(qe.matrix);var lt,kt=(function(De){var We=De.element,ft=De.invertedChildren,xt=De.body;return function(Dt){var zt=Dt.matrix,Jt=Dt.opacity,It=Dt.forceMinVals;if(gh(Jt)&&(We.style.opacity=Jt+""),It&&(We.style.minHeight="1px",We.style.minWidth="1px"),zt){var En=(function(fn){return"matrix("+fn.join(", ")+")"})(zt);We.style.transform=En,ft&&(function(fn){var Yt=fn.matrix,Sn=fn.body;fn.invertedChildren.forEach(function(te){var re=te[0],se=te[1];if(Sn.contains(re)){var ge=Yt[0],ve=Yt[3],Ce=Yt[5],Ue={translateX:0,translateY:0,scaleX:1,scaleY:1},ht="";se.translate&&(Ue.translateX=-Yt[4]/ge,Ue.translateY=-Ce/ve,ht+="translate("+Ue.translateX+"px, "+Ue.translateY+"px)"),se.scale&&(Ue.scaleX=1/ge,Ue.scaleY=1/ve,ht+=" scale("+Ue.scaleX+", "+Ue.scaleY+")"),re.style.transform=ht}})})({invertedChildren:ft,matrix:zt,body:xt})}}})({element:he,invertedChildren:Pt,body:pe});if(L[le]&&L[le].onComplete){var Rt=L[le].onComplete;lt=function(){return Rt(he,J)}}var je=gh(ut.opacity)&&gh(qe.opacity)&&ut.opacity!==qe.opacity,Fe=!1;return Ba({},Ke,{stagger:Ye,springConfig:fe,getOnUpdateFunc:function(De){var We=De.spring,ft=De.onAnimationEnd;return _[le]={destroy:We.destroy.bind(We),onAnimationEnd:ft},function(xt){L[le]&&L[le].onSpringUpdate&&L[le].onSpringUpdate(xt.getCurrentValue()),Fe||(Fe=!0,L[le]&&L[le].onStart&&L[le].onStart(he,J));var Dt=xt.getCurrentValue();if(pe.contains(he)){var zt={matrix:[]};zt.matrix=ut.matrix.map(function(Jt,It){return Aw(Jt,qe.matrix[It],Dt)}),je&&(zt.opacity=Aw(ut.opacity,qe.opacity,Dt)),kt(zt)}else xt.destroy()}},initializeFlip:function(){kt({matrix:ut.matrix,opacity:je?ut.opacity:void 0,forceMinVals:Ee}),L[le]&&L[le].onStartImmediate&&L[le].onStartImmediate(he,J),Me.transformOrigin?he.style.transformOrigin=Me.transformOrigin:B&&(he.style.transformOrigin="0 0"),Pt.forEach(function(De){var We=De[0],ft=De[1];ft.transformOrigin?We.style.transformOrigin=ft.transformOrigin:B&&(We.style.transformOrigin="0 0")})},onAnimationEnd:function(De){delete _[le],Z_(lt)&<(),he.style.transform="",Pt.forEach(function(We){We[0].style.transform=""}),Ee&&he&&(he.style.minHeight="",he.style.minWidth=""),De||(ee.push(le),ee.length>=ye.length&&z(ee))},delayUntil:Me.delayUntil})}).filter(Boolean);if(ye.forEach(function(le){return(0,le.initializeFlip)()}),W)return function(){};var Ne=ye.filter(function(le){return le.delayUntil&&(_e=le.delayUntil,ye.filter(function(de){return de.id===_e}).length);var _e}),xe={},Oe={},ce={};Ne.forEach(function(le){le.stagger?(ce[le.stagger]=!0,Oe[le.delayUntil]?Oe[le.delayUntil].push(le.stagger):Oe[le.delayUntil]=[le.stagger]):xe[le.delayUntil]?xe[le.delayUntil].push(le):xe[le.delayUntil]=[le]});var me=ye.filter(function(le){return le.stagger}).reduce(function(le,_e){return le[_e.stagger]?le[_e.stagger].push(_e):le[_e.stagger]=[_e],le},{}),Pe=ye.filter(function(le){return Ne.indexOf(le)===-1});return Pe.forEach(function(le){le.onSpringActivate=function(){xe[le.id]&&xe[le.id].forEach(g6),Oe[le.id]&&Object.keys(Oe[le.id].reduce(function(_e,de){var Se;return Ba(_e,((Se={})[de]=!0,Se))},{})).forEach(function(_e){m6(me[_e],q[_e])})}}),function(){return ye.length||z([]),Pe.filter(function(le){return!le.stagger}).forEach(g6),Object.keys(me).forEach(function(le){ce[le]||m6(me[le],q[le])}),ie}})(I);y?y({hideEnteringElements:M,animateEnteringElements:D,animateExitingElements:P,animateFlippedElements:R}):(M(),P().then(D),R())}},Fae=function(e){var t=e.element,n=e.flipCallbacks,r=n===void 0?{}:n,o=e.inProgressAnimations,i=o===void 0?{}:o,a=i9(t,e.portalKey),s=rc(t.querySelectorAll("["+Yk+"]")),l={},c=[],u={};a.filter(function(h){return r&&r[h.dataset.flipId]&&r[h.dataset.flipId].onExit}).forEach(function(h){var m=h.parentNode;if(h.closest){var g=h.closest("["+$ae+"]");g&&(m=g)}var p=c.findIndex(function(v){return v[0]===m});p===-1&&(c.push([m,m.getBoundingClientRect()]),p=c.length-1),l[h.dataset.flipId]=c[p][1],u[h.dataset.flipId]=m});var d=a9(a),f=d.map(function(h){var m=h[0],g=h[1],p={};if(r&&r[m.dataset.flipId]&&r[m.dataset.flipId].onExit){var v=l[m.dataset.flipId];Ba(p,{element:m,parent:u[m.dataset.flipId],childPosition:{top:g.top-v.top,left:g.left-v.left,width:g.width,height:g.height}})}return[m.dataset.flipId,{rect:g,opacity:parseFloat(window.getComputedStyle(m).opacity||"1"),domDataForExitAnimations:p}]}).reduce(o9,{});return(function(h,m){Object.keys(h).forEach(function(g){h[g].destroy&&h[g].destroy(),h[g].onAnimationEnd&&h[g].onAnimationEnd(!0),delete h[g]}),m.forEach(function(g){g.style.transform="",g.style.opacity=""})})(i,a.concat(s)),{flippedElementPositions:f,cachedOrderedFlipIds:d.map(function(h){return h[0].dataset.flipId})}};new n9;function O0(){return O0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O0.apply(this,arguments)}function Nw(e,t){return Nw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Nw(e,t)}function s9(e,t){if(e==null)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}var l9=fs({}),c9=fs("portal"),u9=(function(e){var t,n;function r(){for(var i,a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return(i=e.call.apply(e,[this].concat(s))||this).inProgressAnimations={},i.flipCallbacks={},i.el=void 0,i}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Nw(t,n);var o=r.prototype;return o.getSnapshotBeforeUpdate=function(i){return i.flipKey!==this.props.flipKey&&this.el?Fae({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},o.componentDidUpdate=function(i,a,s){this.props.flipKey!==i.flipKey&&this.el&&Iae({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:i.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart})},o.render=function(){var i=this,a=this.props,s=a.portalKey,l=ke.createElement(l9.Provider,{value:this.flipCallbacks},ke.createElement(a.element,{className:a.className,ref:function(c){return i.el=c}},this.props.children));return s&&(l=ke.createElement(c9.Provider,{value:s},l)),l},r})(AC);u9.defaultProps={applyTransformOrigin:!0,element:"div"};var Rae=["children","flipId","inverseFlipId","portalKey"],Bae=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],x6=function(e){var t,n=e.children,r=e.flipId,o=e.inverseFlipId,i=e.portalKey,a=s9(e,Rae),s=n,l=(function(u){return typeof u=="function"})(s);if(!l)try{s=aI.only(n)}catch{throw new Error("Each Flipped component must wrap a single child")}a.scale||a.translate||a.opacity||e9.assign(a,{translate:!0,scale:!0,opacity:!0});var c=((t={})[yf.DATA_FLIP_CONFIG]=JSON.stringify(a),t);return r!==void 0?c[yf.DATA_FLIP_ID]=String(r):o&&(c[yf.DATA_INVERSE_FLIP_ID]=String(o)),i!==void 0&&(c[yf.DATA_PORTAL_KEY]=i),l?s(c):lI(s,c)},d9=function(e){var t=e.children,n=e.flipId,r=e.shouldFlip,o=e.shouldInvert,i=e.onAppear,a=e.onStart,s=e.onStartImmediate,l=e.onComplete,c=e.onExit,u=e.onSpringUpdate,d=s9(e,Bae);return t?d.inverseFlipId?ke.createElement(x6,O0({},d),t):ke.createElement(c9.Consumer,null,function(f){return ke.createElement(l9.Consumer,null,function(h){return e9.isObject(h)&&n&&(h[n]={shouldFlip:r,shouldInvert:o,onAppear:i,onStart:a,onStartImmediate:s,onComplete:l,onExit:c,onSpringUpdate:u}),ke.createElement(x6,O0({flipId:n},d,{portalKey:f}),t)})}):null};d9.displayName="Flipped";function _ae(e){const{data:t,activedItem:n,onChange:r,onDelete:o,sortRules:i=[{label:"\u5F53\u5929",dayPeriod:1}],eventsEmit:a,assistantList:s,height:l=400,styles:c={},hasMore:u=!1,loadingMore:d=!1}=e,f=t.map(O=>O.sessionId+"-"+O.gmtModified).join(","),h=Vt(()=>{const O=i.length>0?i:[{label:"\u5F53\u5929",dayPeriod:1}],$=bae(t,O),A=O.every(M=>!$[M.label]||$[M.label].length===0),N=[];return O.forEach(M=>{$[M.label]&&$[M.label].length>0&&(N.push({type:"group",label:M.label}),$[M.label].forEach(D=>N.push({type:"item",data:D})))}),$.other.length>0&&!A&&(N.push({type:"group",label:"\u5176\u4ED6"}),$.other.forEach(M=>N.push({type:"item",data:M}))),A&&$.other.length>0&&$.other.forEach(M=>N.push({type:"item",data:M})),N},[t,i,f]),m=Vt(()=>h.map(O=>O.type==="group"?`g:${O.label}`:`i:${O.data.sessionId}`).join("|"),[h]),g=56,p=14,v=36,y=O=>O===h.length?v:h[O].type==="group"?32:g+p,b=tt(null),E=Vt(()=>h.findIndex(O=>{var $;return O.type==="item"&&(($=O.data)==null?void 0:$.sessionId)===n}),[h,n]),x=Vt(()=>h.findIndex(O=>O.type==="item"),[h]),w=tt(void 0);vt(()=>{const O=w.current;n!==O&&E>-1&&E===x&&b.current&&b.current.scrollToItem(E,"start"),w.current=n},[n,E,x]);const k=tt(0);if(vt(()=>{if(b.current){const O=k.current,$=h.length;if(k.current=$,$!==O){const N=(O>0?Math.abs($-O)/O:1)>.5||O<10&&$>20;b.current.resetAfterIndex(0,N)}}},[h.length]),vt(()=>{b.current&&b.current.resetAfterIndex(0,!0)},[m]),h.length===0)return Z("div",{className:"text-center text-zinc-400 py-8",children:"\u6682\u65E0\u4F1A\u8BDD"});const S=(c==null?void 0:c.colors)||{};return Z(u9,{flipKey:f,spring:{stiffness:180,damping:18},children:Z(vae,{ref:b,height:l,width:"100%",itemCount:h.length+1,itemSize:y,itemKey:O=>{if(O===h.length)return"footer";const $=h[O];return $.type==="item"?$.data.sessionId:`group-${$.label}`},onItemsRendered:({visibleStopIndex:O})=>{u&&!d&&O>=h.length-1-3&&typeof a=="function"&&a("conversations:load_more")},style:{overflowX:"hidden"},children:({index:O,style:$})=>{if(O===h.length){const N=(c==null?void 0:c.colors)||{};return Z("div",{style:{...$,height:v,lineHeight:`${v}px`,textAlign:"center",fontSize:"10px",color:N.textMuted||"#9ca3af",background:N.groupBg||"white"},children:d?"\u52A0\u8F7D\u4E2D...":u?"":"\u6CA1\u6709\u66F4\u591A\u4E86"})}const A=h[O];return A.type==="group"?Z("div",{style:{...$,background:S.groupBg||"white",zIndex:1},className:"pt-2 pb-1 px-[28px] py-[2px] text-xs text-gray-400",children:A.label}):Z(d9,{flipId:A.data.sessionId,children:Z("div",{style:$,className:"px-[12px] py-[2px]",children:Z(yae,{isActive:n===A.data.sessionId,isDisabled:!1,isNew:A.data.isNew,data:A.data,eventsEmit:a,assistantList:s,styles:c})})},A.data.sessionId)}})})}const jae=({value:e,eventsEmit:t,setSearch:n,style:r,styles:o={}})=>{const i=o.colors||{},a=o.radius||"12px",s=i.border||"#e5e7eb",l=i.primary||"#2563eb",c=o.headerBg||i.sidebarBg||i.background||"#fff",[u,d]=ke.useState(!1),f=ke.useRef(null);ke.useEffect(()=>{u&&f.current&&f.current.focus()},[u]);const h=()=>{d(!1),n("")};return et("div",{className:"flex items-center gap-2 px-4 py-3 sticky top-0 z-10 min-w-0",style:{...r,background:c,borderTopLeftRadius:a,borderTopRightRadius:a},children:[Z("button",{className:"border-none flex items-center justify-center",onClick:()=>{d(!1),t&&t("conversation:create")},title:"\u65B0\u5EFA\u4F1A\u8BDD",style:{height:42,borderRadius:"90px",background:l,color:i.buttonText||"#fff",fontWeight:600,boxShadow:o.shadow||"0 2px 8px 0 rgba(0,0,0,0.04)",padding:u?"0 0":"0 14px",minWidth:u?0:180,width:u?0:void 0,opacity:u?0:1,overflow:"hidden",flexShrink:0,transition:"width .22s ease, min-width .22s ease, padding .22s ease, opacity .18s ease",pointerEvents:u?"none":"auto"},children:et("div",{className:"flex items-center gap-2",children:[Z(NI,{size:18}),Z("span",{className:"text-sm",children:"\u65B0\u5EFA\u5BF9\u8BDD"})]})}),u?et("div",{className:"flex-1 min-w-0 relative",children:[Z("input",{ref:f,className:"w-full px-3 py-2 pr-10 text-sm transition-all",placeholder:"\u641C\u7D22\u5386\u53F2\u8BB0\u5F55",value:e,onChange:m=>n(m.target.value),onKeyDown:m=>{m.key==="Escape"&&h()},style:{minWidth:0,width:"100%",borderRadius:a,background:i.inputBg||"#f4f4f5",border:`1px solid ${s}`,color:i.text||"#222",outline:"none",paddingRight:40}}),Z("button",{className:"absolute right-3 flex items-center justify-center transition-colors hover:bg-gray-200 rounded-full",style:{width:20,height:20,color:i.text||"#666",flexShrink:0,position:"absolute",right:"12px",top:"9px"},onClick:h,title:"\u5173\u95ED\u641C\u7D22",onMouseDown:m=>m.preventDefault(),children:Z(gp,{size:16})})]}):Z("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 ${s}`,color:l,flexShrink:0},onClick:()=>d(!0),title:"\u641C\u7D22",children:Z(a2,{size:18})})]})};function Lae(e){const{data:t,sortRules:n,activedItem:r,eventsEmit:o,assistantList:i,styles:a={},hasMore:s=!1,loadingMore:l=!1}=e,[c,u]=at(""),d=Vt(()=>c?t.filter(x=>(x.label||"\u672A\u547D\u540D\u4F1A\u8BDD").toLowerCase().includes(c.toLowerCase())):t,[t,c]),f=Vt(()=>[...d].sort((x,w)=>new Date(w.gmtModified).getTime()-new Date(x.gmtModified).getTime()),[d]),h=tt(null),[m,g]=at(400);vt(()=>{function x(){h.current&&g(h.current.clientHeight)}return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]);const p=(a==null?void 0:a.colors)||{};a!=null&&a.radius;const v=(a==null?void 0:a.shadow)||"0 4px 24px 0 rgba(0,0,0,0.06)",y=p.border||"#e5e7eb",b=p.sidebarBg||p.background||"#EAEEFF",E=p.text||"#222";return et("div",{className:"h-full flex flex-col overflow-y-hidden",style:{background:b,color:E,boxShadow:v,border:`1px solid ${y}`,...a.container},children:[Z(jae,{value:c,setSearch:u,eventsEmit:o,style:a.header,styles:a}),et("div",{className:"flex-1 min-h-0 relative",ref:h,style:a.list,children:[Z(_ae,{eventsEmit:o,data:f,assistantList:i,activedItem:r,sortRules:n,height:m,styles:a,hasMore:s,loadingMore:l}),Z("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-3 z-20",style:{background:`linear-gradient(to bottom, ${b}cc, transparent)`}})]})]})}var mh={exports:{}};/*!
|
|
485
|
+
*/function Sw(e){if(e.constructor!==Array)throw new TypeError("Expected array.");if(e.length===16)return e;if(e.length===6){var t=_c();return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}throw new RangeError("Expected array with either 6 or 16 values.")}function _c(){for(var e=[],t=0;t<16;t++)t%5==0?e.push(1):e.push(0);return e}function xae(e,t){for(var n=Sw(e),r=Sw(t),o=[],i=0;i<4;i++)for(var a=[n[i],n[i+4],n[i+8],n[i+12]],s=0;s<4;s++){var l=s*4,c=[r[l],r[l+1],r[l+2],r[l+3]],u=a[0]*c[0]+a[1]*c[1]+a[2]*c[2]+a[3]*c[3];o[i+l]=u}return o}function Eae(e){if(typeof e=="string"){var t=e.match(/matrix(3d)?\(([^)]+)\)/);if(t){var n=t[2].split(", ").map(parseFloat);return Sw(n)}}return _c()}function wae(e){var t=_c();return t[0]=e,t}function Cae(e){var t=_c();return t[5]=e,t}function kae(e){var t=_c();return t[12]=e,t}function Sae(e){var t=_c();return t[13]=e,t}var gh=function(e){return typeof e=="number"},Z_=function(e){return typeof e=="function"},Q_=function(e){return Object.prototype.toString.call(e)==="[object Object]"},rc=function(e){return Array.prototype.slice.apply(e)},J_=function(e){var t=e.reduce(function(n,r){return n[r]=(n[r]||0)+1,n},{});return Object.keys(t).filter(function(n){return t[n]>1})};function Ba(e){return[].slice.call(arguments,1).forEach(function(t){if(t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}),e}var $w,Aw=function(e,t,n){return e+(t-e)*n},e9={__proto__:null,isNumber:gh,isFunction:Z_,isObject:Q_,toArray:rc,getDuplicateValsAsStrings:J_,assign:Ba,tweenProp:Aw},Uk="data-flip-id",Yk="data-inverse-flip-id",Xk="data-portal-key",$ae="data-exit-container",yf={__proto__:null,DATA_FLIP_ID:Uk,DATA_INVERSE_FLIP_ID:Yk,DATA_FLIP_CONFIG:"data-flip-config",DATA_PORTAL_KEY:Xk},Ow={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}},p6=function(e){return Q_(e)?e:Object.keys(Ow).indexOf(e)>-1?Ow[e]:{}};typeof window<"u"&&($w=window.requestAnimationFrame);var Aae=$w=$w||function(e){window.setTimeout(e,1e3/60)},Oae=Date.now(),Nae=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()-Oae};function t9(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1)}var Mae=(function(){function e(){}return e.prototype.run=function(){var t=this;Aae(function(){t.springSystem.loop(Nae())})},e})(),tv=function(){this.position=0,this.velocity=0},Dae=0,qo=.001,Tae=(function(){function e(n){this._id="s"+Dae++,this._springSystem=n,this.listeners=[],this._startValue=0,this._currentState=new tv,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new tv,this._restSpeedThreshold=.001,this._tempState=new tv,this._timeAccumulator=0,this._wasAtRest=!0,this._cachedSpringConfig={}}var t=e.prototype;return t.getId=function(){return this._id},t.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this)},t.setSpringConfig=function(n){return this._springConfig=n,this},t.getCurrentValue=function(){return this._currentState.position},t.getDisplacementDistanceForState=function(n){return Math.abs(this._endValue-n.position)},t.setEndValue=function(n){if(n===this._endValue)return this;if(this.prevEndValue=n,this._endValue===n&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=n,this._springSystem.activateSpring(this.getId());for(var r=0,o=this.listeners.length;r<o;r++){var i=this.listeners[r].onSpringEndStateChange;i&&i(this)}return this},t.setVelocity=function(n){return n===this._currentState.velocity||(this._currentState.velocity=n,this._springSystem.activateSpring(this.getId())),this},t.setCurrentValue=function(n){this._startValue=n,this._currentState.position=n;for(var r=0,o=this.listeners.length;r<o;r++){var i=this.listeners[r];i.onSpringUpdate&&i.onSpringUpdate(this)}return this},t.setAtRest=function(){return this._endValue=this._currentState.position,this._tempState.position=this._currentState.position,this._currentState.velocity=0,this},t.setOvershootClampingEnabled=function(n){return this._overshootClampingEnabled=n,this},t.isOvershooting=function(){var n=this._startValue,r=this._endValue;return this._springConfig.tension>0&&(n<r&&this.getCurrentValue()>r||n>r&&this.getCurrentValue()<r)},t.advance=function(n,r){var o=this.isAtRest();if(!o||!this._wasAtRest){var i=r;r>.064&&(i=.064),this._timeAccumulator+=i;for(var a,s,l,c,u,d,f=this._springConfig.tension,h=this._springConfig.friction,m=this._currentState.position,g=this._currentState.velocity,p=this._tempState.position,v=this._tempState.velocity;this._timeAccumulator>=qo;)this._timeAccumulator-=qo,this._timeAccumulator<qo&&(this._previousState.position=m,this._previousState.velocity=g),s=f*(this._endValue-p)-h*g,c=f*(this._endValue-(p=m+(a=g)*qo*.5))-h*(v=g+s*qo*.5),d=f*(this._endValue-(p=m+(l=v)*qo*.5))-h*(v=g+c*qo*.5),p=m+(u=v)*qo,m+=1/6*(a+2*(l+u)+(v=g+d*qo))*qo,g+=1/6*(s+2*(c+d)+(f*(this._endValue-p)-h*v))*qo;this._tempState.position=p,this._tempState.velocity=v,this._currentState.position=m,this._currentState.velocity=g,this._timeAccumulator>0&&this._interpolate(this._timeAccumulator/qo),(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),o=!0);var y=!1;this._wasAtRest&&(this._wasAtRest=!1,y=!0);var b=!1;o&&(this._wasAtRest=!0,b=!0),this.notifyPositionUpdated(y,b)}},t.notifyPositionUpdated=function(n,r){var o=this;this.listeners.filter(Boolean).forEach(function(i){n&&i.onSpringActivate&&!o._onActivateCalled&&(i.onSpringActivate(o),o._onActivateCalled=!0),i.onSpringUpdate&&i.onSpringUpdate(o),r&&i.onSpringAtRest&&i.onSpringAtRest(o)})},t.systemShouldAdvance=function(){return!this.isAtRest()||!this.wasAtRest()},t.wasAtRest=function(){return this._wasAtRest},t.isAtRest=function(){return Math.abs(this._currentState.velocity)<this._restSpeedThreshold&&(this.getDisplacementDistanceForState(this._currentState)<=this._displacementFromRestThreshold||this._springConfig.tension===0)},t._interpolate=function(n){this._currentState.position=this._currentState.position*n+this._previousState.position*(1-n),this._currentState.velocity=this._currentState.velocity*n+this._previousState.velocity*(1-n)},t.addListener=function(n){return this.listeners.push(n),this},t.addOneTimeListener=function(n){var r=this;return Object.keys(n).forEach(function(o){var i;n[o]=(i=n[o],function(){i.apply(void 0,[].slice.call(arguments)),r.removeListener(n)})}),this.listeners.push(n),this},t.removeListener=function(n){return t9(this.listeners,n),this},e})(),n9=(function(){function e(n){this.looper=n||new Mae,this.looper.springSystem=this,this.listeners=[],this._activeSprings=[],this._idleSpringIndices=[],this._isIdle=!0,this._lastTimeMillis=-1,this._springRegistry={}}var t=e.prototype;return t.createSpring=function(n,r){return this.createSpringWithConfig({tension:n,friction:r})},t.createSpringWithConfig=function(n){var r=new Tae(this);return this.registerSpring(r),r.setSpringConfig(n),r},t.getIsIdle=function(){return this._isIdle},t.registerSpring=function(n){this._springRegistry[n.getId()]=n},t.deregisterSpring=function(n){t9(this._activeSprings,n),delete this._springRegistry[n.getId()]},t.advance=function(n,r){for(var o=this;this._idleSpringIndices.length>0;)this._idleSpringIndices.pop();for(this._activeSprings.filter(Boolean).forEach(function(a){a.systemShouldAdvance()?a.advance(n/1e3,r/1e3):o._idleSpringIndices.push(o._activeSprings.indexOf(a))});this._idleSpringIndices.length>0;){var i=this._idleSpringIndices.pop();i>=0&&this._activeSprings.splice(i,1)}},t.loop=function(n){var r;this._lastTimeMillis===-1&&(this._lastTimeMillis=n-1);var o=n-this._lastTimeMillis;this._lastTimeMillis=n;var i=0,a=this.listeners.length;for(i=0;i<a;i++)(r=this.listeners[i]).onBeforeIntegrate&&r.onBeforeIntegrate(this);for(this.advance(n,o),this._activeSprings.length===0&&(this._isIdle=!0,this._lastTimeMillis=-1),i=0;i<a;i++)(r=this.listeners[i]).onAfterIntegrate&&r.onAfterIntegrate(this);this._isIdle||this.looper.run()},t.activateSpring=function(n){var r=this._springRegistry[n];this._activeSprings.indexOf(r)===-1&&this._activeSprings.push(r),this.getIsIdle()&&(this._isIdle=!1,this.looper.run())},e})(),Pae=new n9,r9=function(e){var t=e.springConfig,n=t.overshootClamping,r=e.getOnUpdateFunc,o=e.onAnimationEnd,i=e.onSpringActivate,a=Pae.createSpring(t.stiffness,t.damping);a.setOvershootClampingEnabled(!!n);var s={onSpringActivate:i,onSpringAtRest:function(){a.destroy(),o()},onSpringUpdate:r({spring:a,onAnimationEnd:o})};return a.addListener(s),a},g6=function(e){var t=r9(e);return t.setEndValue(1),t},m6=function(e,t){if(t===void 0&&(t={}),e&&e.length){t.reverse&&e.reverse();var n,r=typeof(n=t.speed)!="number"?1.1:1+Math.min(Math.max(5*n,0),5),o=1/Math.max(Math.min(e.length,100),10),i=e.map(function(a,s){var l=a.getOnUpdateFunc;return a.getOnUpdateFunc=function(c){var u=l(c);return function(d){var f=d.getCurrentValue();(f=f<.01?0:f>.99?1:f)>=o&&i[s+1]&&i[s+1](Math.max(Math.min(f*r,1),0)),u(d)}},a}).map(function(a){var s=r9(a);if(s)return s.setEndValue.bind(s)}).filter(Boolean);i[0]&&i[0](1)}},v6=function(e){return[0,1,4,5,12,13].map(function(t){return e[t]})},y6=function(e){return e.top<window.innerHeight&&e.bottom>0&&e.left<window.innerWidth&&e.right>0};function b6(e){return JSON.parse(e.dataset.flipConfig||"{}")}var o9=function(e,t){var n;return Ba(e,((n={})[t[0]]=t[1],n))},i9=function(e,t){return rc(t?document.querySelectorAll("["+Xk+'="'+t+'"]'):e.querySelectorAll("["+Uk+"]"))},a9=function(e){return e.map(function(t){return[t,t.getBoundingClientRect()]})},Iae=function(e){var t=e.cachedOrderedFlipIds,n=t===void 0?[]:t,r=e.inProgressAnimations,o=r===void 0?{}:r,i=e.flippedElementPositionsBeforeUpdate,a=i===void 0?{}:i,s=e.flipCallbacks,l=s===void 0?{}:s,c=e.containerEl,u=e.applyTransformOrigin,d=e.spring,f=e.debug,h=e.portalKey,m=e.staggerConfig,g=m===void 0?{}:m,p=e.decisionData,v=p===void 0?{}:p,y=e.handleEnterUpdateDelete,b=e.onComplete,E=e.onStart;if(!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var x,w=a9(i9((x={element:c,portalKey:h}).element,x.portalKey)).map(function(j){var z=j[0],V=j[1],L=window.getComputedStyle(z);return[z.dataset.flipId,{element:z,rect:V,opacity:parseFloat(L.opacity),transform:L.transform}]}).reduce(o9,{}),k=(function(j){var z=j.containerEl,V=j.portalKey;return V?(function(L){return function(_){return rc(document.querySelectorAll("["+Xk+'="'+L+'"]'+_))}})(V):z?(function(L){var _=Math.random().toFixed(5);return L.dataset.flipperId=_,function(F){return rc(L.querySelectorAll('[data-flipper-id="'+_+'"] '+F))}})(z):function(){return[]}})({containerEl:c,portalKey:h}),S=(function(j){return function(z){return j("["+Uk+'="'+z+'"]')[0]}})(k),O=function(j){return a[j]&&w[j]},$=Object.keys(a).concat(Object.keys(w)).filter(function(j){return!O(j)}),A={flipCallbacks:l,getElement:S,flippedElementPositionsBeforeUpdate:a,flippedElementPositionsAfterUpdate:w,inProgressAnimations:o,decisionData:v},N=(function(j){var z,V=j.unflippedIds,L=j.flipCallbacks,_=j.getElement,F=j.flippedElementPositionsBeforeUpdate,T=j.flippedElementPositionsAfterUpdate,B=j.inProgressAnimations,H=j.decisionData,G=V.filter(function(X){return T[X]}).filter(function(X){return L[X]&&L[X].onAppear}),W=V.filter(function(X){return F[X]&&L[X]&&L[X].onExit}),U=new Promise(function(X){z=X}),q=[],Y=0,J=W.map(function(X,oe){var ie=F[X].domDataForExitAnimations,ee=ie.element,ae=ie.parent,pe=ie.childPosition,ye=pe.top,Ne=pe.left,xe=pe.width,Oe=pe.height;getComputedStyle(ae).position==="static"&&(ae.style.position="relative"),ee.style.transform="matrix(1, 0, 0, 1, 0, 0)",ee.style.position="absolute",ee.style.top=ye+"px",ee.style.left=Ne+"px",ee.style.height=Oe+"px",ee.style.width=xe+"px";var ce=q.filter(function(Pe){return Pe[0]===ae})[0];ce||(ce=[ae,document.createDocumentFragment()],q.push(ce)),ce[1].appendChild(ee),Y+=1;var me=function(){try{ae.removeChild(ee)}catch{}finally{(Y-=1)==0&&z()}};return B[X]={stop:me},function(){return L[X].onExit(ee,oe,me,H)}});return q.forEach(function(X){X[0].appendChild(X[1])}),J.length||z(),{hideEnteringElements:function(){G.forEach(function(X){var oe=_(X);oe&&(oe.style.opacity="0")})},animateEnteringElements:function(){G.forEach(function(X,oe){var ie=_(X);ie&&L[X].onAppear(ie,oe,H)})},animateExitingElements:function(){return J.forEach(function(X){return X()}),U}}})(Ba({},A,{unflippedIds:$})),M=N.hideEnteringElements,D=N.animateEnteringElements,P=N.animateExitingElements,I=Ba({},A,{containerEl:c,flippedIds:n.filter(O),applyTransformOrigin:u,spring:d,debug:f,staggerConfig:g,scopedSelector:k,onComplete:b});E&&E(c,v);var R=(function(j){var z,V=j.flippedIds,L=j.flipCallbacks,_=j.inProgressAnimations,F=j.flippedElementPositionsBeforeUpdate,T=j.flippedElementPositionsAfterUpdate,B=j.applyTransformOrigin,H=j.spring,G=j.getElement,W=j.debug,U=j.staggerConfig,q=U===void 0?{}:U,Y=j.decisionData,J=Y===void 0?{}:Y,X=j.onComplete,oe=j.containerEl,ie=new Promise(function(le){z=le});if(X&&ie.then(function(){return X(oe,J)}),!V.length)return function(){return z([]),ie};var ee=[],ae=G(V[0]),pe=ae?ae.ownerDocument.querySelector("body"):document.querySelector("body");J_(V);var ye=V.map(function(le){var _e=F[le].rect,de=T[le].rect,Se=F[le].opacity,Ie=T[le].opacity,Ee=de.width<1||de.height<1,he=T[le].element;if(!y6(_e)&&!y6(de)||!he)return!1;var we,$e,Re,Me=b6(he),fe=(Re=($e=(we={flipperSpring:H,flippedSpring:Me.spring})===void 0?{}:we).flippedSpring,Ba({},Ow.noWobble,p6($e.flipperSpring),p6(Re))),Ye=Me.stagger===!0?"default":Me.stagger,Ke={element:he,id:le,stagger:Ye,springConfig:fe};if(L[le]&&L[le].shouldFlip&&!L[le].shouldFlip(J.previous,J.current))return!1;var st=Math.abs(_e.left-de.left)+Math.abs(_e.top-de.top),bt=Math.abs(_e.width-de.width)+Math.abs(_e.height-de.height),Le=Math.abs(Ie-Se);if(_e.height===0&&de.height===0||_e.width===0&&de.width===0||st<.5&&bt<.5&&Le<.01)return!1;var Xe=Eae(T[le].transform),qe={matrix:Xe},ut={matrix:[]},dt=[Xe];Me.translate&&(dt.push(kae(_e.left-de.left)),dt.push(Sae(_e.top-de.top))),Me.scale&&(dt.push(wae(Math.max(_e.width,1)/Math.max(de.width,1))),dt.push(Cae(Math.max(_e.height,1)/Math.max(de.height,1)))),Me.opacity&&(ut.opacity=Se,qe.opacity=Ie);var Pt=[];if(!L[le]||!L[le].shouldInvert||L[le].shouldInvert(J.previous,J.current)){var Lt=(function(De,We){return rc(De.querySelectorAll("["+Yk+'="'+We+'"]'))})(he,le);Pt=Lt.map(function(De){return[De,b6(De)]})}ut.matrix=v6(dt.reduce(xae)),qe.matrix=v6(qe.matrix);var lt,kt=(function(De){var We=De.element,ft=De.invertedChildren,xt=De.body;return function(Dt){var zt=Dt.matrix,Jt=Dt.opacity,It=Dt.forceMinVals;if(gh(Jt)&&(We.style.opacity=Jt+""),It&&(We.style.minHeight="1px",We.style.minWidth="1px"),zt){var En=(function(fn){return"matrix("+fn.join(", ")+")"})(zt);We.style.transform=En,ft&&(function(fn){var Yt=fn.matrix,Sn=fn.body;fn.invertedChildren.forEach(function(te){var re=te[0],se=te[1];if(Sn.contains(re)){var ge=Yt[0],ve=Yt[3],Ce=Yt[5],Ue={translateX:0,translateY:0,scaleX:1,scaleY:1},ht="";se.translate&&(Ue.translateX=-Yt[4]/ge,Ue.translateY=-Ce/ve,ht+="translate("+Ue.translateX+"px, "+Ue.translateY+"px)"),se.scale&&(Ue.scaleX=1/ge,Ue.scaleY=1/ve,ht+=" scale("+Ue.scaleX+", "+Ue.scaleY+")"),re.style.transform=ht}})})({invertedChildren:ft,matrix:zt,body:xt})}}})({element:he,invertedChildren:Pt,body:pe});if(L[le]&&L[le].onComplete){var Rt=L[le].onComplete;lt=function(){return Rt(he,J)}}var je=gh(ut.opacity)&&gh(qe.opacity)&&ut.opacity!==qe.opacity,Fe=!1;return Ba({},Ke,{stagger:Ye,springConfig:fe,getOnUpdateFunc:function(De){var We=De.spring,ft=De.onAnimationEnd;return _[le]={destroy:We.destroy.bind(We),onAnimationEnd:ft},function(xt){L[le]&&L[le].onSpringUpdate&&L[le].onSpringUpdate(xt.getCurrentValue()),Fe||(Fe=!0,L[le]&&L[le].onStart&&L[le].onStart(he,J));var Dt=xt.getCurrentValue();if(pe.contains(he)){var zt={matrix:[]};zt.matrix=ut.matrix.map(function(Jt,It){return Aw(Jt,qe.matrix[It],Dt)}),je&&(zt.opacity=Aw(ut.opacity,qe.opacity,Dt)),kt(zt)}else xt.destroy()}},initializeFlip:function(){kt({matrix:ut.matrix,opacity:je?ut.opacity:void 0,forceMinVals:Ee}),L[le]&&L[le].onStartImmediate&&L[le].onStartImmediate(he,J),Me.transformOrigin?he.style.transformOrigin=Me.transformOrigin:B&&(he.style.transformOrigin="0 0"),Pt.forEach(function(De){var We=De[0],ft=De[1];ft.transformOrigin?We.style.transformOrigin=ft.transformOrigin:B&&(We.style.transformOrigin="0 0")})},onAnimationEnd:function(De){delete _[le],Z_(lt)&<(),he.style.transform="",Pt.forEach(function(We){We[0].style.transform=""}),Ee&&he&&(he.style.minHeight="",he.style.minWidth=""),De||(ee.push(le),ee.length>=ye.length&&z(ee))},delayUntil:Me.delayUntil})}).filter(Boolean);if(ye.forEach(function(le){return(0,le.initializeFlip)()}),W)return function(){};var Ne=ye.filter(function(le){return le.delayUntil&&(_e=le.delayUntil,ye.filter(function(de){return de.id===_e}).length);var _e}),xe={},Oe={},ce={};Ne.forEach(function(le){le.stagger?(ce[le.stagger]=!0,Oe[le.delayUntil]?Oe[le.delayUntil].push(le.stagger):Oe[le.delayUntil]=[le.stagger]):xe[le.delayUntil]?xe[le.delayUntil].push(le):xe[le.delayUntil]=[le]});var me=ye.filter(function(le){return le.stagger}).reduce(function(le,_e){return le[_e.stagger]?le[_e.stagger].push(_e):le[_e.stagger]=[_e],le},{}),Pe=ye.filter(function(le){return Ne.indexOf(le)===-1});return Pe.forEach(function(le){le.onSpringActivate=function(){xe[le.id]&&xe[le.id].forEach(g6),Oe[le.id]&&Object.keys(Oe[le.id].reduce(function(_e,de){var Se;return Ba(_e,((Se={})[de]=!0,Se))},{})).forEach(function(_e){m6(me[_e],q[_e])})}}),function(){return ye.length||z([]),Pe.filter(function(le){return!le.stagger}).forEach(g6),Object.keys(me).forEach(function(le){ce[le]||m6(me[le],q[le])}),ie}})(I);y?y({hideEnteringElements:M,animateEnteringElements:D,animateExitingElements:P,animateFlippedElements:R}):(M(),P().then(D),R())}},Fae=function(e){var t=e.element,n=e.flipCallbacks,r=n===void 0?{}:n,o=e.inProgressAnimations,i=o===void 0?{}:o,a=i9(t,e.portalKey),s=rc(t.querySelectorAll("["+Yk+"]")),l={},c=[],u={};a.filter(function(h){return r&&r[h.dataset.flipId]&&r[h.dataset.flipId].onExit}).forEach(function(h){var m=h.parentNode;if(h.closest){var g=h.closest("["+$ae+"]");g&&(m=g)}var p=c.findIndex(function(v){return v[0]===m});p===-1&&(c.push([m,m.getBoundingClientRect()]),p=c.length-1),l[h.dataset.flipId]=c[p][1],u[h.dataset.flipId]=m});var d=a9(a),f=d.map(function(h){var m=h[0],g=h[1],p={};if(r&&r[m.dataset.flipId]&&r[m.dataset.flipId].onExit){var v=l[m.dataset.flipId];Ba(p,{element:m,parent:u[m.dataset.flipId],childPosition:{top:g.top-v.top,left:g.left-v.left,width:g.width,height:g.height}})}return[m.dataset.flipId,{rect:g,opacity:parseFloat(window.getComputedStyle(m).opacity||"1"),domDataForExitAnimations:p}]}).reduce(o9,{});return(function(h,m){Object.keys(h).forEach(function(g){h[g].destroy&&h[g].destroy(),h[g].onAnimationEnd&&h[g].onAnimationEnd(!0),delete h[g]}),m.forEach(function(g){g.style.transform="",g.style.opacity=""})})(i,a.concat(s)),{flippedElementPositions:f,cachedOrderedFlipIds:d.map(function(h){return h[0].dataset.flipId})}};new n9;function O0(){return O0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O0.apply(this,arguments)}function Nw(e,t){return Nw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Nw(e,t)}function s9(e,t){if(e==null)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}var l9=fs({}),c9=fs("portal"),u9=(function(e){var t,n;function r(){for(var i,a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return(i=e.call.apply(e,[this].concat(s))||this).inProgressAnimations={},i.flipCallbacks={},i.el=void 0,i}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Nw(t,n);var o=r.prototype;return o.getSnapshotBeforeUpdate=function(i){return i.flipKey!==this.props.flipKey&&this.el?Fae({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},o.componentDidUpdate=function(i,a,s){this.props.flipKey!==i.flipKey&&this.el&&Iae({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:i.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart})},o.render=function(){var i=this,a=this.props,s=a.portalKey,l=ke.createElement(l9.Provider,{value:this.flipCallbacks},ke.createElement(a.element,{className:a.className,ref:function(c){return i.el=c}},this.props.children));return s&&(l=ke.createElement(c9.Provider,{value:s},l)),l},r})(AC);u9.defaultProps={applyTransformOrigin:!0,element:"div"};var Rae=["children","flipId","inverseFlipId","portalKey"],Bae=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],x6=function(e){var t,n=e.children,r=e.flipId,o=e.inverseFlipId,i=e.portalKey,a=s9(e,Rae),s=n,l=(function(u){return typeof u=="function"})(s);if(!l)try{s=aI.only(n)}catch{throw new Error("Each Flipped component must wrap a single child")}a.scale||a.translate||a.opacity||e9.assign(a,{translate:!0,scale:!0,opacity:!0});var c=((t={})[yf.DATA_FLIP_CONFIG]=JSON.stringify(a),t);return r!==void 0?c[yf.DATA_FLIP_ID]=String(r):o&&(c[yf.DATA_INVERSE_FLIP_ID]=String(o)),i!==void 0&&(c[yf.DATA_PORTAL_KEY]=i),l?s(c):lI(s,c)},d9=function(e){var t=e.children,n=e.flipId,r=e.shouldFlip,o=e.shouldInvert,i=e.onAppear,a=e.onStart,s=e.onStartImmediate,l=e.onComplete,c=e.onExit,u=e.onSpringUpdate,d=s9(e,Bae);return t?d.inverseFlipId?ke.createElement(x6,O0({},d),t):ke.createElement(c9.Consumer,null,function(f){return ke.createElement(l9.Consumer,null,function(h){return e9.isObject(h)&&n&&(h[n]={shouldFlip:r,shouldInvert:o,onAppear:i,onStart:a,onStartImmediate:s,onComplete:l,onExit:c,onSpringUpdate:u}),ke.createElement(x6,O0({flipId:n},d,{portalKey:f}),t)})}):null};d9.displayName="Flipped";function _ae(e){const{data:t,activedItem:n,onChange:r,onDelete:o,sortRules:i=[{label:"\u5F53\u5929",dayPeriod:1}],eventsEmit:a,assistantList:s,height:l=400,styles:c={},hasMore:u=!1,loadingMore:d=!1}=e,f=t.map(O=>O.sessionId+"-"+O.gmtModified).join(","),h=Vt(()=>{const O=i.length>0?i:[{label:"\u5F53\u5929",dayPeriod:1}],$=bae(t,O),A=O.every(M=>!$[M.label]||$[M.label].length===0),N=[];return O.forEach(M=>{$[M.label]&&$[M.label].length>0&&(N.push({type:"group",label:M.label}),$[M.label].forEach(D=>N.push({type:"item",data:D})))}),$.other.length>0&&!A&&(N.push({type:"group",label:"\u5176\u4ED6"}),$.other.forEach(M=>N.push({type:"item",data:M}))),A&&$.other.length>0&&$.other.forEach(M=>N.push({type:"item",data:M})),N},[t,i,f]),m=Vt(()=>h.map(O=>O.type==="group"?`g:${O.label}`:`i:${O.data.sessionId}`).join("|"),[h]),g=56,p=14,v=36,y=O=>O===h.length?v:h[O].type==="group"?32:g+p,b=tt(null),E=Vt(()=>h.findIndex(O=>{var $;return O.type==="item"&&(($=O.data)==null?void 0:$.sessionId)===n}),[h,n]),x=Vt(()=>h.findIndex(O=>O.type==="item"),[h]),w=tt(void 0);vt(()=>{const O=w.current;n!==O&&E>-1&&E===x&&b.current&&b.current.scrollToItem(E,"start"),w.current=n},[n,E,x]);const k=tt(0);if(vt(()=>{if(b.current){const O=k.current,$=h.length;if(k.current=$,$!==O){const N=(O>0?Math.abs($-O)/O:1)>.5||O<10&&$>20;b.current.resetAfterIndex(0,N)}}},[h.length]),vt(()=>{b.current&&b.current.resetAfterIndex(0,!0)},[m]),h.length===0)return Z("div",{className:"text-center text-zinc-400 py-8",children:"\u6682\u65E0\u4F1A\u8BDD"});const S=(c==null?void 0:c.colors)||{};return Z(u9,{flipKey:f,spring:{stiffness:180,damping:18},children:Z(vae,{ref:b,height:l,width:"100%",itemCount:h.length+1,itemSize:y,itemKey:O=>{if(O===h.length)return"footer";const $=h[O];return $.type==="item"?$.data.sessionId:`group-${$.label}`},onItemsRendered:({visibleStopIndex:O})=>{u&&!d&&O>=h.length-1-3&&typeof a=="function"&&a("conversations:load_more")},style:{overflowX:"hidden"},children:({index:O,style:$})=>{if(O===h.length){const N=(c==null?void 0:c.colors)||{};return Z("div",{style:{...$,height:v,lineHeight:`${v}px`,textAlign:"center",fontSize:"10px",color:N.textMuted||"#9ca3af",background:N.groupBg||"white"},children:d?"\u52A0\u8F7D\u4E2D...":u?"":"\u6CA1\u6709\u66F4\u591A\u4E86"})}const A=h[O];return A.type==="group"?Z("div",{style:{...$,background:S.groupBg||"white",zIndex:1},className:"pt-2 pb-1 px-[28px] py-[2px] text-xs text-gray-400",children:A.label}):Z(d9,{flipId:A.data.sessionId,children:Z("div",{style:$,className:"px-[12px] py-[2px]",children:Z(yae,{isActive:n===A.data.sessionId,isDisabled:!1,isNew:A.data.isNew,data:A.data,eventsEmit:a,assistantList:s,styles:c})})},A.data.sessionId)}})})}const jae=({value:e,eventsEmit:t,setSearch:n,style:r,styles:o={}})=>{const i=o.colors||{},a=o.radius||"12px",s=i.border||"#e5e7eb",l=i.primary||"#2563eb",c=o.headerBg||i.sidebarBg||i.background||"#fff",[u,d]=ke.useState(!1),f=ke.useRef(null);ke.useEffect(()=>{u&&f.current&&f.current.focus()},[u]);const h=()=>{d(!1),n("")};return et("div",{className:"flex items-center gap-2 px-4 py-3 sticky top-0 z-10 min-w-0",style:{...r,background:c,borderTopLeftRadius:a,borderTopRightRadius:a},children:[Z("button",{className:"border-none flex items-center justify-center",onClick:()=>{d(!1),t&&t("conversation:create")},title:"\u65B0\u5EFA\u4F1A\u8BDD",style:{height:42,borderRadius:"90px",background:l,color:i.buttonText||"#fff",fontWeight:600,boxShadow:o.shadow||"0 2px 8px 0 rgba(0,0,0,0.04)",padding:u?"0 0":"0 14px",minWidth:u?0:180,width:u?0:void 0,opacity:u?0:1,overflow:"hidden",flexShrink:0,transition:"width .22s ease, min-width .22s ease, padding .22s ease, opacity .18s ease",pointerEvents:u?"none":"auto"},children:et("div",{className:"flex items-center gap-2",children:[Z(NI,{size:18}),Z("span",{className:"text-sm",children:"\u65B0\u5EFA\u5BF9\u8BDD"})]})}),u?et("div",{className:"flex-1 min-w-0 relative",children:[Z("input",{ref:f,className:"w-full px-3 py-2 pr-10 text-sm transition-all",placeholder:"\u641C\u7D22\u5386\u53F2\u8BB0\u5F55",value:e,onChange:m=>n(m.target.value),onKeyDown:m=>{m.key==="Escape"&&h()},style:{minWidth:0,width:"100%",borderRadius:a,background:i.inputBg||"#f4f4f5",border:`1px solid ${s}`,color:i.text||"#222",outline:"none",paddingRight:40}}),Z("button",{className:"absolute right-3 flex items-center justify-center transition-colors hover:bg-gray-200 rounded-full",style:{width:20,height:20,color:i.text||"#666",flexShrink:0,position:"absolute",right:"12px",top:"9px"},onClick:h,title:"\u5173\u95ED\u641C\u7D22",onMouseDown:m=>m.preventDefault(),children:Z(mp,{size:16})})]}):Z("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 ${s}`,color:l,flexShrink:0},onClick:()=>d(!0),title:"\u641C\u7D22",children:Z(a2,{size:18})})]})};function Lae(e){const{data:t,sortRules:n,activedItem:r,eventsEmit:o,assistantList:i,styles:a={},hasMore:s=!1,loadingMore:l=!1}=e,[c,u]=at(""),d=Vt(()=>c?t.filter(x=>(x.label||"\u672A\u547D\u540D\u4F1A\u8BDD").toLowerCase().includes(c.toLowerCase())):t,[t,c]),f=Vt(()=>[...d].sort((x,w)=>new Date(w.gmtModified).getTime()-new Date(x.gmtModified).getTime()),[d]),h=tt(null),[m,g]=at(400);vt(()=>{function x(){h.current&&g(h.current.clientHeight)}return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]);const p=(a==null?void 0:a.colors)||{};a!=null&&a.radius;const v=(a==null?void 0:a.shadow)||"0 4px 24px 0 rgba(0,0,0,0.06)",y=p.border||"#e5e7eb",b=p.sidebarBg||p.background||"#EAEEFF",E=p.text||"#222";return et("div",{className:"h-full flex flex-col overflow-y-hidden",style:{background:b,color:E,boxShadow:v,border:`1px solid ${y}`,...a.container},children:[Z(jae,{value:c,setSearch:u,eventsEmit:o,style:a.header,styles:a}),et("div",{className:"flex-1 min-h-0 relative",ref:h,style:a.list,children:[Z(_ae,{eventsEmit:o,data:f,assistantList:i,activedItem:r,sortRules:n,height:m,styles:a,hasMore:s,loadingMore:l}),Z("div",{className:"pointer-events-none absolute left-0 right-0 top-0 h-3 z-20",style:{background:`linear-gradient(to bottom, ${b}cc, transparent)`}})]})]})}var mh={exports:{}};/*!
|
|
486
486
|
* clipboard.js v2.0.11
|
|
487
487
|
* https://clipboardjs.com/
|
|
488
488
|
*
|
|
@@ -604,9 +604,9 @@ ${v.substring(Y)}`;y(J),requestAnimationFrame(()=>{U.selectionStart=U.selectionE
|
|
|
604
604
|
border-color: ${n.primary};
|
|
605
605
|
box-shadow: 0 0 0 2px ${n.primary}1A;
|
|
606
606
|
}
|
|
607
|
-
`};function tse({config:e,styles:t}){if(!e)return null;const n=JSON.parse(e.configJson),r=Vt(()=>{var o;return{...DC.colors,...(o=t==null?void 0:t.theme)==null?void 0:o.colors}},[t]);return et("div",{className:"w-[340px] rounded-xl p-4 animate-fade-in bg-white",children:[et("div",{className:"flex items-center mb-2",children:[Z("span",{className:"text-md font-bold truncate mr-2",style:{color:r.primary},children:n.config_name||"\u52A9\u624B\u914D\u7F6E"}),Z("span",{className:"text-xs truncate rounded px-2 py-0.5",style:{backgroundColor:`${r.primary}1A`,color:r.disabled},children:n.model_name})]}),Z("div",{className:"border-b my-2",style:{borderColor:r.border}}),et("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-700 mb-2",style:{color:r.text},children:[et("div",{children:["\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570\uFF1A",Z("span",{className:"font-semibold",children:n.max_round})]}),et("div",{children:["\u6700\u5927\u4EE4\u724C\u6570\uFF1A",Z("span",{className:"font-semibold",children:n.max_tokens})]}),et("div",{children:["\u6E29\u5EA6\uFF1A",Z("span",{className:"font-semibold",children:n.temperature})]}),et("div",{children:["\u53EC\u56DE\u6570\uFF1A",Z("span",{className:"font-semibold",children:n.top_k})]}),et("div",{children:["\u591A\u6837\u6027\uFF1A",Z("span",{className:"font-semibold",children:n.top_p})]}),et("div",{children:["\u76F8\u4F3C\u5EA6\u9608\u503C\uFF1A",Z("span",{className:"font-semibold",children:n.score_threshold})]})]}),et("div",{className:"mb-2",children:[Z("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5173\u8054\u77E5\u8BC6\u5E93\uFF1A"}),Z("div",{className:"flex flex-wrap gap-1",children:n.knowledge_base_name?n.knowledge_base_name.split(";").map((o,i)=>Z("span",{className:"px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${r.primary}1A`,color:r.primary},children:o},i)):Z("span",{className:"text-gray-300",style:{color:r.disabled},children:"\u65E0"})})]}),et("div",{className:"mb-2",children:[Z("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5F00\u542F\u529F\u80FD:"}),et("div",{className:"flex flex-wrap gap-2 text-xs mt-2",children:[!!n.enabled_faq&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"FAQ"}),!!n.enabled_graph&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u56FE\u8C31"}),!!n.dependOnKb&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u5F3A\u77E5\u8BC6\u4F9D\u8D56"}),!!n.enabled_table_select&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u8868\u683C\u7B5B\u9009"}),!!n.enabled_rerank&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u7CBE\u6392\u6A21\u5F0F"}),!!n.need_trace_source&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u6EAF\u6E90"}),!!n.is_download&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u4E0B\u8F7D\u6EAF\u6E90"})]})]})]})}function nse(e,t=[],n=60){const[r,o]=at("");return vt(()=>{o("");let i=0;const a=setInterval(()=>{o(s=>i>=e.length?(clearInterval(a),s):(i++,e.slice(0,i)))},n);return()=>clearInterval(a)},[e,...t]),r}function rse(e){const{assistantList:t,eventsEmit:n,styles:r,selectedId:o,onSelectAssistant:i,productLogo:a}=e,[s,l]=at(1),[c,u]=at(!1),[d,f]=at(""),h=c||d.trim()?6:12,m=tt(),g=tt(!1),p=tt(null),v=tt(null),y=tt("");vt(()=>{o&&m.current!==o&&(n==null||n("conversation:new_assistant_change",{assistantId:o}),m.current=o)},[o,n]);const b=Vt(()=>pa(),[]);vt(()=>{var A;if((A=r==null?void 0:r.theme)!=null&&A.colors){const N=document.createElement("style");return N.innerHTML=ese(r.theme.colors,b),N.id=`g-welcome-styles-${b}`,document.head.appendChild(N),()=>{const M=document.getElementById(N.id);M&&M.remove()}}},[r,b]);const E=Vt(()=>t.find(A=>A.id===o),[t,o]),x=Vt(()=>JSON.parse((E==null?void 0:E.configJson)||"{}"),[E]),w=Vt(()=>{if(!d.trim())return t||[];const A=d.toLowerCase().trim();return(t||[]).filter(N=>{var D,P;const M=((D=N.name)==null?void 0:D.toLowerCase())||"";try{const R=((P=JSON.parse(N.configJson||"{}").config_name)==null?void 0:P.toLowerCase())||"";return M.includes(A)||R.includes(A)}catch{return M.includes(A)}})},[t,d]),k=Math.ceil(((w==null?void 0:w.length)||0)/h),S=(w==null?void 0:w.slice((s-1)*h,s*h))||[];vt(()=>{if(o&&o!==v.current){if(g.current&&p.current!==null){v.current=o;return}const A=d.trim()?w:t;if(A&&A.length>0){const N=A.findIndex(M=>M.id===o);if(N!==-1){const M=Math.floor(N/h)+1;l(M),v.current=o}}}},[o,t,w,h,d]),vt(()=>{if(d!==y.current){if(g.current&&p.current!==null){l(p.current),g.current=!1,p.current=null,y.current=d;return}if(v.current===o){y.current=d;return}g.current||(d.trim()&&(v.current=null),l(1)),y.current=d}},[d,o]),vt(()=>{k>0&&s>k&&l(k)},[k,s]);const O=x.prologue||"\u60A8\u597D\uFF0C\u6B22\u8FCE\u4F7F\u7528\u5C0F\u9CB8\u667A\u80FD\u95EE\u7B54",$=nse(O,[o],30);return et("div",{className:`flex flex-col relative items-center justify-center h-full w-full g-welcome-${b}`,children:[Z("img",{src:a||Qae,alt:"logo",className:"mb-4",style:{width:68,height:68}}),Z("div",{className:"text-3xl font-bold mb-2 g-welcome-title",children:$}),!o&&Z("div",{className:"flex mb-2 g-welcome-subtitle",children:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u667A\u80FD\u52A9\u624B"}),et("div",{style:{maxWidth:"1200px"},className:`flex mt-8 flex-wrap gap-3
|
|
608
|
-
max-w-[1200px] px-8 w-full mx-auto justify-center mb-4`,children:[c?Z("div",{className:"flex items-center gap-2 px-5 w-full",style:{flexBasis:"100%"},children:Z(Wu,{className:"g-welcome-search-input w-full",placeholder:"\u641C\u7D22\u52A9\u624B\u540D\u79F0",prefix:Z(a2,{size:16}),suffix:Z("button",{type:"button",onClick:()=>{u(!1),f("")},style:{background:"transparent",border:"none",cursor:"pointer"},children:Z(
|
|
609
|
-
`+u:u;break;case"event":r.event=u;break;case"id":e(r.id=u);break;case"retry":const d=parseInt(u,10);isNaN(d)||t(r.retry=d);break}}}}function sse(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function k6(){return{data:"",event:"",id:"",retry:void 0}}var lse=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const Mw="text/event-stream",cse=1e3,S6="last-event-id";function use(e,t){var{signal:n,headers:r,onopen:o,onmessage:i,onclose:a,onerror:s,openWhenHidden:l,fetch:c}=t,u=lse(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((d,f)=>{const h=Object.assign({},r);h.accept||(h.accept=Mw);let m;function g(){m.abort(),document.hidden||x()}l||document.addEventListener("visibilitychange",g);let p=cse,v=0;function y(){document.removeEventListener("visibilitychange",g),window.clearTimeout(v),m.abort()}n==null||n.addEventListener("abort",()=>{y(),d()});const b=c??window.fetch,E=o??dse;async function x(){var w;m=new AbortController;try{const k=await b(e,Object.assign(Object.assign({},u),{headers:h,signal:m.signal}));await E(k),await ose(k.body,ise(ase(S=>{S?h[S6]=S:delete h[S6]},S=>{p=S},i))),a==null||a(),y(),d()}catch(k){if(!m.signal.aborted)try{const S=(w=s==null?void 0:s(k))!==null&&w!==void 0?w:p;window.clearTimeout(v),v=window.setTimeout(x,S)}catch(S){y(),f(S)}}}x()})}function dse(e){const t=e.headers.get("content-type");if(!(t!=null&&t.startsWith(Mw)))throw new Error(`Expected content-type to be ${Mw}, Actual: ${t}`)}class rv extends Error{}let Po=null,ia=null;const fse=({baseUrl:e,token:t,CSRFToken:n,setChatData:r,activeSessionId:o,setAppStatus:i,setConversationList:a})=>{const s=p=>{if(!p)return!1;if(typeof p=="string"){const v=p.trim();return v!==""&&v!=="[]"&&v!=="null"}return!0},l=({content:p,status:v,respTime:y,filePaths:b,reference:E,webReference:x,graphReference:w,databaseReference:k,llmType:S,resultType:O,queryId:$,tokens:A})=>{r(N=>{var L;if(!N[0])return N;const M=N[0],D=M.messages||[],P=D.length-1;if(P<0)return N;const I=D[P];if(I.istype!=="ai")return N;let R=D.slice();if(b!=null&&b.length){const _=D.length-2;if(_>=0&&((L=D[_])==null?void 0:L.istype)==="user"){const F={...D[_],filePaths:b};R[_]=F}}const j=w!==void 0&&s(w)?w:I.graphReference;v===2&&w!==void 0&&console.log("[AichatUseController] reset_chat status=2 \u65F6\u7684 graphReference:",{graphReference:w,isValid:s(w),lastMessageGraphReference:I.graphReference,finalGraphReference:j});const z={...I,content:(I.content||"")+p,status:v,respTime:y,filePaths:b,reference:E,webReference:x,graphReference:j,databaseReference:k??I.databaseReference,resultType:O,llmType:S,tokens:A,queryId:$||I.queryId||pa(32)};return z.clientSideId=z.clientSideId||z.queryId+"-ai",R[P]=z,[{...M,isNew:!1,messages:R},...N.slice(1)]})},c=p=>{if(p instanceof rv)throw i(v=>({...v,display:"error",sender:"ready"})),Po&&(Po.abort(),Po=null),ia=null,p};return{updateUserFilesMessage:({currentFiles:p})=>{r(v=>{if(!v[0])return v;const y=v[0],b=y.messages||[];if(!b.length)return v;const E=b.length-2;if(E<0||b[E].istype!=="user")return v;const w=b.slice();return w[E]={...b[E],currentFiles:p},[{...y,messages:w},...v.slice(1)]})},api_startChat_re:(p,v)=>{Po&&Po.abort(),Po=new AbortController,ia=p.sessionId;const y=`${e}/qa/ai/question_re`;console.log("data",p);const b={...p};use(y,{method:"post",signal:Po.signal,headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:t||"","X-CSRF-TOKEN-IN":n||""},openWhenHidden:!0,body:JSON.stringify(b),onopen:async E=>{if(E.status===500)throw new rv("Internal Server Error");if(!E.ok)throw new rv(`HTTP error: ${E.status}`)},onmessage:E=>{const x=JSON.parse(E.data);if(ia!==x.sessionId){console.log("[AichatUseController] \u6D41\u5F0F\u8BF7\u6C42\u7684 sessionId \u5DF2\u4E0D\u5339\u914D\uFF0C\u5FFD\u7565\u6570\u636E",{currentStreamSessionId:ia,receivedSessionId:x.sessionId,activeSessionId:o});return}if(o!==x.sessionId)return;const{reply:w,resultType:k,respTime:S,reference:O,webReference:$,graphReference:A,filePaths:N,status:M,docs:D,llmType:P,databaseReference:I}=x,R=N?JSON.parse(N):[];M===2&&w&&w.content&&(w.content.includes("\u6A21\u578B\u6682\u65E0\u6CD5\u8FD4\u56DE")||w.content.includes("\u5931\u8D25")||w.content.includes("\u9519\u8BEF")||w.content.includes("\u8BF7\u7A0D\u540E\u518D\u8BD5"))&&i(z=>({...z,display:"ready",sender:"ready"}));const j=s(A)?A:void 0;if(M===2&&console.log("[AichatUseController] status=2 \u65F6\u7684 graphReference:",{graphReference:A,type:typeof A,isValid:s(A),finalGraphReference:j}),M===2){if(l({content:w.content||"",status:2,respTime:S,filePaths:R,reference:O||D||"",webReference:$||"",graphReference:j,databaseReference:I,llmType:P,resultType:k,queryId:x.queryId,tokens:x.tokens}),i(z=>({...z,display:"ready",sender:"ready"})),v){const z=S||Date.now();console.log("[AichatUseController] \u6D88\u606F\u53D1\u9001\u6210\u529F\uFF0CgmtModified:",z),v(z)}}else l({content:w.content||"",status:M,respTime:S,filePaths:R,reference:O||D||"",webReference:$||"",graphReference:j,databaseReference:I,llmType:P,resultType:k,queryId:x.queryId,tokens:x.tokens})},onerror:c,onclose:()=>{ia===p.sessionId&&(ia=null)}})},addEmptyMessage:({queryId:p,content:v,filePaths:y,currentFiles:b})=>{r(E=>{const x=new Date().toISOString(),w=p||pa(32),k={istype:"user",content:v,time:x,queryId:w,clientSideId:w+"-user",filePaths:y||"",currentFiles:b||[]},S={istype:"ai",content:"",time:new Date(Date.now()+1).toISOString(),streaming:!0,status:0,queryId:w,clientSideId:w+"-ai"},O=E.find($=>$.id===o);return O?O.messages.push(k,S):console.warn("addEmptyMessage called without an active session."),[...E]})},setLastEmptyMessage:({now:p})=>{r(v=>{if(!v[0])return v;const y=v[0],b=y.messages||[];if(!b.length)return v;const E=b.length-1;if(E<0)return v;const x=b[E];if(x.istype!=="ai")return v;const w=b.slice();return w[E]={...x,istype:"ai",content:"",time:p,streaming:!0,status:0},[{...y,messages:w},...v.slice(1)]})},stopStream:()=>{Po&&(Po.abort(),Po=null),ia=null,i(p=>({...p,display:"ready",sender:"ready"}))},cancelStreamBySessionId:p=>Po&&ia===p?(console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\uFF0C\u53D6\u6D88\u6B63\u5728\u8FDB\u884C\u7684\u6D41\u5F0F\u8BF7\u6C42",p),Po.abort(),Po=null,ia=null,i(v=>({...v,display:"ready",sender:"ready"})),!0):!1}},hse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACRSURBVHgB7ZJBCsQgDEWTmQvMncT7dOuqmY3iai6kMN31UmIjdNFFKuk+DwKahP9ABDAMQyTnvHCtT/ZjjIs0e0nN1hr03kkjGTu8+0PEjzR/S81a6+6cQz6S9x5KKdsknLi+IQRSC07JfybRhE8FM4k2fICgIKVE/MYrF427NlwtuEpOgSr8MUNy9x0Nw7jnAFsnZ7Uu5CkqAAAAAElFTkSuQmCC",{TextArea:$6}=Wu,{useForm:pse}=Ra,f9={\u56DE\u7B54\u4E0D\u4F73:"ansPoor",\u683C\u5F0F\u95EE\u9898:"formatError",\u7406\u89E3\u95EE\u9898\u6709\u8BEF:"harmfulInfo",\u5176\u4ED6:"othres"},gse=({open:e,setOpen:t,feedBackList:n,handleConfirm:r})=>{const o={header:{padding:"20px 24px",borderBottom:"1px solid #F0F0F0",margin:0},body:{padding:"16px 24px 20px 24px",borderBottom:"1px solid #F0F0F0"},mask:{},footer:{padding:"16px 24px",margin:0},content:{padding:0,borderRadius:"4px",width:"563px"}},[i]=pse(),[a,s]=at({}),l=async()=>{try{const c=await i.validateFields();t(!1);const u={...c};Object.entries(a||{}).forEach(d=>{const[f,h]=d;h&&(u[f9[f]]=h)}),r(u)}catch(c){console.log(c);return}};return vt(()=>{e||(i.resetFields(),s(null))},[e]),Z(pp,{modal:{styles:o},children:et(mp,{open:e,onCancel:()=>t(!1),title:Z("div",{className:"text-[16px] text-[#2A2A2A] font-bold leading-[1]",children:"\u611F\u8C22\u60A8\u7684\u53CD\u9988\uFF01\u8FD9\u5C06\u5E2E\u52A9\u6211\u4EEC\u4E0D\u65AD\u4F18\u5316\u4E0E\u63D0\u5347\u3002"}),footer:et("div",{children:[Z(So,{className:"mr-[16px] w-[76px]",onClick:()=>{t(!1)},children:"\u53D6\u6D88"}),Z(So,{type:"primary",className:"w-[76px] border-none",onClick:l,children:"\u786E\u8BA4"})]}),children:[Z(mse,{feedBackList:n,treeSelectResult:a,setTreeSelectResult:s}),et(Ra,{form:i,layout:"vertical",children:[Z(Ra.Item,{name:"supplementExplain",label:"\u8865\u5145\u63CF\u8FF0",children:Z($6,{})})," ",Z(Ra.Item,{name:"idealAnswer",label:"\u60A8\u89C9\u5F97\u66F4\u597D\u7684\u56DE\u7B54\u662F\u4EC0\u4E48\uFF1F",children:Z($6,{})}),Z(Ra.Item,{name:"userPhone",label:"\u8054\u7CFB\u7535\u8BDD",children:Z(Wu,{})}),Z(Ra.Item,{name:"deptName",label:"\u90E8\u95E8",children:Z(Wu,{})})]})]})})},mse=({feedBackList:e,treeSelectResult:t,setTreeSelectResult:n})=>{const[r,o]=at(!1),[i,a]=at([]),[s,l]=at([]),[c,u]=at([]),[d,f]=at(null),h=Vt(()=>(l([]),d!=null&&d.items?[{title:"\u5168\u9009",key:"\u5168\u9009",children:d.items.map(g=>({title:g,key:g}))}]:[]),[d]),m=g=>{u(p=>Array.isArray(p)&&Array.isArray(s)?Object.entries(t).reduce((y,b)=>{const[E,x]=b,k=(x?x.split(";"):[]).filter(S=>S!==g);return n(S=>({...S||{},[E]:k.join(";")})),[...y,...k]},[]):p)};return vt(()=>{if(a(["\u5168\u9009"]),!t||!(d!=null&&d.que_name))return;const g=t[d.que_name]||"",p=g?g.split(";"):[];l(p)},[h,r]),vt(()=>{t===null&&(u([]),f(null),l([]))},[t]),vt(()=>{console.log("treeSelectResult",t),console.log("selectedValue",c),console.log("feedBackList",e),console.log("pKey",f9),console.log("selectedParent",d)},[t,c]),et("div",{className:"relative mb-[24px] z-20",children:[et("div",{className:"absolute w-full z-10",children:[et("div",{className:"h-[32px] box-border flex items-center justify-between border-[1px] border-solid border-[#D9D9D9] rounded-[4px] cursor-pointer",onClick:()=>o(!r),children:[Z("div",{className:"ml-[16px]",children:"\u95EE\u9898\u7C7B\u578B"}),Z("img",{src:hse,width:24,height:24,className:"mr-[16px]"})]}),et("div",{style:{display:r?"":"none"},className:"h-[288px] rounded-[4px] shadow-md mt-[4px] bg-white",children:[et("div",{className:"h-[248px] flex",style:{borderBottom:"1px solid #F0F0F0"},children:[Z("div",{className:"w-[203px] px-[8px] py-[8px]",style:{borderRight:"1px solid #F0F0F0"},children:e.map((g,p)=>{var v;return et("div",{className:"rounded-[4px] h-[32px] cursor-pointer flex items-center",style:{backgroundColor:(d==null?void 0:d.que_name)===g.que_name?"#E6F4FF":""},children:[Z("div",{className:"h-full w-full leading-[32px]",onClick:()=>{f(g)},children:et("div",{className:"ml-[8px] text-[14px] text-[#2A2A2A]",children:[g.que_name,"(",t&&t[g.que_name]?t[g.que_name].split(";").length:0,"/",(v=g==null?void 0:g.items)==null?void 0:v.length,")"]})}),Z(AI,{className:"mr-[8px] w-3 h-3 text-[rgba(0,0,0,0.45)]"})]},p)})}),Z("div",{className:"selfTree h-full flex-1 mt-[8px] ml-[16px]",children:Z(QH,{checkable:!0,defaultSelectedKeys:["0-1"],treeData:h,blockNode:!0,checkedKeys:s,expandedKeys:i,onCheck:g=>{Array.isArray(g)&&n(p=>({...p||{},[(d==null?void 0:d.que_name)||""]:(g||[]).filter(v=>v!=="\u5168\u9009").join(";")})),l(g)}})})]}),et("div",{className:"flex justify-end h-[40px] items-center",children:[Z(So,{size:"small",className:"mr-[8px]",onClick:()=>o(!1),children:"\u53D6\u6D88"}),Z(So,{size:"small",type:"primary",className:"border-none mr-[16px]",onClick:()=>{u(g=>Array.isArray(g)&&Array.isArray(s)?Object.values(t).reduce((v,y)=>[...v,...y?y.split(";"):[]],[]):g),o(!1)},children:"\u786E\u8BA4"})]})]})]}),Z("div",{className:"h-[32px]"}),!!(c!=null&&c.length)&&et("div",{children:[et("div",{className:"mt-[5px] text-[12px] text-[#555555]",children:["\u5DF2\u9009\u62E9 ",c.length," \u4E2A"]}),(c||[]).map(g=>{let p="";return Object.entries(t||{}).forEach(v=>{const[y,b]=v;b.indexOf(g)>-1&&(p=y)}),et(UH,{closable:!0,className:"mt-[5px]",onClose:()=>m(g),children:[p,"\uFF08",g,"\uFF09"]},g)})]})]})},A6=e=>e?Array.isArray(e)?e.map(r=>"/minio/"+r.split("/").slice(3).join("/")):"/minio/"+e.split("/").slice(3).join("/"):"",O6="http://10.15.12.13:9000/",vse=e=>{if(typeof e=="string"){const t=e.split(".");return t.length?t[t.length-1]:""}else return""},yse=e=>{var x,w,k,S,O,$,A,N;const{file_type:t,file_name:n,url:r,parse_url:o,retrieve_tags:i,file_id:a,parsed_file_type:s,onlyDownloadTypes:l,references:c,eventsEmit:u,styles:d,isUploadFile:f,type:h,collectionItems:m,pdfPages:g=0,fileManagerData:p}=e;if(h==="collection"&&Array.isArray(m)){const P=`calc(90% - ${.5}px)`,I=m.slice(0,4),R=m.length>4,j="\u6253\u5F00\u5408\u96C6",z=()=>{if(p&&t==="pdf"&&!e.pdfPages){const V=((p==null?void 0:p.uploadedFiles)||[]).find(L=>{var _;return((L==null?void 0:L.name)||((_=L==null?void 0:L.file)==null?void 0:_.name))===n});if(!(V!=null&&V.pdfPages)){rr.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}u==null||u("reference_file:click",{...e,pdfPages:(V==null?void 0:V.pdfPages)||0})}else u==null||u("reference_file:click",e)};return et("div",{className:"user-file relative group flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all bg-white shadow",style:{width:94,height:94,minWidth:94,minHeight:94,borderColor:(w=(x=d==null?void 0:d.theme)==null?void 0:x.colors)==null?void 0:w.border},onClick:z,children:[Z("div",{className:"grid grid-cols-2 items-center justify-center grid-rows-2 gap-1 w-full h-full",style:{width:"100%",height:"100%",gap:1},children:I.map((V,L)=>{var T,B,H,G;if(R&&L===3)return Z("div",{className:"flex items-center justify-center bg-gray-100 rounded",style:{width:P,height:P},children:Z("span",{className:"text-xl text-gray-300 font-bold scale-75",children:"..."})},"ellipsis");if(V.file_type==="image"||V.file_type==="jpg"||V.file_type==="jpeg"||V.file_type==="png"||V.file_type==="gif"||V.file_type==="bmp"||V.file_type==="webp")return Z("div",{className:"relative flex items-center justify-center bg-white rounded-lg border overflow-hidden",style:{width:P,height:P,borderColor:(B=(T=d==null?void 0:d.theme)==null?void 0:T.colors)==null?void 0:B.border},children:Z("div",{className:"flex items-center justify-center w-full h-full scale-75",children:Z("img",{src:String(V.url||V.file_path||""),alt:V.file_name||"",className:"object-contain max-w-full max-h-full"})})},V.file_name||L);const F=Dw(String(V.file_type||""),d);return Z("div",{className:"user-file flex flex-col items-center justify-center rounded-lg border bg-gray-50 p-1 text-sm",title:V.file_name,style:{width:P,height:P,borderColor:(G=(H=d==null?void 0:d.theme)==null?void 0:H.colors)==null?void 0:G.border},children:Z("div",{className:"flex items-center justify-center w-full h-full scale-75",children:F})},V.file_name||L)})}),Z("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg pointer-events-none",children:et("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[Z(lm,{size:20,className:"mb-1 text-white"}),Z("span",{className:"text-white text-center",style:{fontSize:12},children:j})]})})]})}const v=()=>{if(console.log(o,"parse_url",r,"url"),p&&t==="pdf"&&!g){const M=((p==null?void 0:p.uploadedFiles)||[]).find(D=>{var P;return((D==null?void 0:D.name)||((P=D==null?void 0:D.file)==null?void 0:P.name))===(n||"").replace(/\s+/g,"")});if(!(M!=null&&M.pdfPages)){rr.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}u==null||u("reference_file:click",{file:n,file_type:t,url:r,parse_url:o,retrieve_tags:i,file_id:a,parsed_file_type:s,references:c,type:y,isUploadFile:f,pdfPages:M.pdfPages||0})}else u==null||u("reference_file:click",{file:n,file_type:t,url:r,parse_url:o,retrieve_tags:i,file_id:a,parsed_file_type:s,references:c,type:y,isUploadFile:f,pdfPages:g})},y=Vt(()=>(n||"").split(".").pop()||"",[n]),b=Dw(y,d),E=async()=>{if(r){const M=A6(r.indexOf("http")>-1?r:`${O6}/${r}`);if(y.toLowerCase()==="json"){try{const I=await fetch(M);if(!I.ok)throw new Error("\u4E0B\u8F7D\u5931\u8D25");const R=await I.blob(),j=document.createElement("a");j.href=URL.createObjectURL(R),j.download=n||"",document.body.appendChild(j),j.click(),document.body.removeChild(j),setTimeout(()=>URL.revokeObjectURL(j.href),1e3)}catch{alert("\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25")}return}const P=document.createElement("a");P.href=M,P.download=n||"",document.body.appendChild(P),P.click(),document.body.removeChild(P)}};return l&&l.includes(y.toLowerCase())?et("div",{className:"user-file relative group w-24 h-24 flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all",title:n,onClick:E,style:{borderColor:(S=(k=d==null?void 0:d.theme)==null?void 0:k.colors)==null?void 0:S.border},children:[b,Z("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:n}),Z("div",{className:"absolute text-center inset-0 cursor-pointer bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg",children:et("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[Z(lm,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),Z("div",{className:"text-white text-center",style:{fontSize:10},children:"\u4E0B\u8F7D\u6587\u4EF6"})]})})]},n):y==="image"||y==="jpg"||y==="jpeg"||y==="png"||y==="gif"||y==="bmp"||y==="webp"?et("div",{className:"relative group w-24 h-24 cursor-pointer flex items-center justify-center",onClick:()=>v(),children:[r?Z("img",{src:String(A6(r&&r.indexOf("http")>-1?r:`${O6}/${r}`)||""),alt:n||"",className:"w-full h-full object-cover rounded-md border",style:{borderColor:($=(O=d==null?void 0:d.theme)==null?void 0:O.colors)==null?void 0:$.border}}):Z("div",{className:"w-full h-full flex items-center justify-center",children:Z("span",{className:"animate-spin rounded-full border-2 border-gray-300 border-t-blue-500 w-8 h-8 inline-block"})}),Z("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-md",children:et("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[Z(cW,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),Z("div",{className:"text-white text-center",children:"\u67E5\u770B\u56FE\u7247"})]})})]},n):et("div",{className:"user-file relative group w-24 h-24 flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all",title:n,onClick:v,style:{borderColor:(N=(A=d==null?void 0:d.theme)==null?void 0:A.colors)==null?void 0:N.border},children:[b,Z("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:n}),Z("div",{className:"absolute text-center inset-0 cursor-pointer bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg",children:et("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[Z(lm,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),Z("div",{className:"text-white text-center",style:{fontSize:10},children:"\u6253\u5F00\u6587\u4EF6"})]})})]},n)},bse=e=>e?e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`:"",xse=({fileName:e,fileSize:t,icon:n,statusText:r,statusColor:o="text-gray-400",statusIcon:i,onRemove:a,themeColors:s={},cardId:l,showRemove:c=!0,disabledRemove:u=!1,onRemoveWithAnim:d,extra:f,style:h})=>et("div",{id:l,className:"group gap-x-2.5 items-center file-display-card relative flex w-[210px] bg-white border border-gray-200 rounded-md shadow-sm px-2 py-1 transition-all hover:shadow-md hover:border-blue-300",style:h,children:[Z("div",{className:"pt-1",children:n}),et("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[et("div",{className:"flex items-center justify-between gap-1",children:[Z("span",{className:"text-[12px] font-medium truncate max-w-[120px]",title:e,children:e}),Z("span",{className:"ml-1 text-[11px] text-gray-400",children:bse(t)})]}),et("div",{className:`text-[10px] mt-0.5 flex items-center gap-3 ${o}`,children:[i,Z("span",{children:r})]})]}),f,c&&!u&&Z("button",{className:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 transition-opacity text-gray-300 hover:text-red-400 text-xs p-0.5 rounded-full bg-white shadow-sm z-10",onClick:()=>{d&&l?d(l):a&&a()},title:"\u79FB\u9664",style:{lineHeight:0,color:s.error||"#FF0000"},children:Z(gp,{className:"w-3.5 h-3.5"})})]});function Dw(e,t){var r;const n=((r=t==null?void 0:t.theme)==null?void 0:r.icons)||{};switch(e.toLowerCase()){case"docx":case"doc":return n.docx?Z("img",{src:n.docx,alt:"docx",style:{width:20,height:20}}):Z(ar,{type:"rag/word",size:18});case"image":case"jpg":case"jpeg":case"png":case"gif":case"bmp":case"webp":case"svg":case"ico":return n.image?Z("img",{src:n.image,alt:"image",style:{width:20,height:20}}):Z(ar,{type:"rag/pic",size:18});case"pptx":case"ppt":return n.pptx?Z("img",{src:n.pptx,alt:"pptx",style:{width:20,height:20}}):Z(ar,{type:"rag/ppt",size:18});case"sheets":case"excel":case"xls":case"csv":case"xlsx":case"xlsm":case"xlsb":case"xltx":case"xltm":case"xlt":case"xlam":return n.sheets?Z("img",{src:n.sheets,alt:"sheets",style:{width:20,height:20}}):Z(ar,{type:"rag/excel",size:18});case"pdf":return n.pdf?Z("img",{src:n.pdf,alt:"pdf",style:{width:20,height:20}}):Z(ar,{type:"rag/pdf",size:18});case"txt":return n.txt?Z("img",{src:n.txt,alt:"txt",style:{width:20,height:20}}):Z(ar,{type:"rag/txt",size:18});case"md":return n.md?Z("img",{src:n.md,alt:"txt",style:{width:20,height:20}}):Z(ar,{type:"rag/document",size:18});case"json":return n.json?Z("img",{src:n.json,alt:"json",style:{width:20,height:20}}):Z(ar,{type:"rag/json",size:18});case"html":case"htm":return n.html?Z("img",{src:n.html,alt:"html",style:{width:20,height:20}}):Z(ar,{type:"rag/url",size:18});case"xml":default:return Z(ar,{type:"rag/file",size:18})}}const Ese=[{file:{name:"\u4EA7\u54C1\u9700\u6C42\u6587\u6863.pdf",size:1024*1024*2.5,type:"application/pdf"},type:"pdf",status:"uploaded",url:"https://example.com/file1.pdf"},{file:{name:"\u6570\u636E\u5206\u6790\u62A5\u544A.xlsx",size:1024*1024*1.2,type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},type:"excel",status:"uploaded",url:"https://example.com/file3.xlsx"},{file:{name:"\u7CFB\u7EDF\u67B6\u6784\u56FE.png",size:1024*512,type:"image/png"},type:"image",status:"uploaded",url:"https://example.com/file2.png"}];function wse({open:e,onCancel:t,files:n=Ese,currentFiles:r=[],onUpload:o,onRemoveFile:i,styles:a,eventsEmit:s}){const l={pending:"\u5F85\u4E0A\u4F20",uploading:"\u4E0A\u4F20\u4E2D",uploaded:"\u5DF2\u4E0A\u4F20",analyzing:"\u89E3\u6790\u4E2D",analyze_failed:"\u89E3\u6790\u5931\u8D25",error:"\u5931\u8D25"},[c,u]=at([]),d=(g,p)=>{s&&s("uploaded_file:removeFromTemp",{file:g,idx:p})},f=a&&a.theme&&a.theme.colors?a.theme.colors:{primary:"#007bff",secondary:"#6c757d",success:"#008000",warning:"#FFA500",error:"#FF0000",info:"#0000FF",background:"#f8f9fa",text:"#343a40",border:"#dee2e6",disabled:"#808080",disabledBackground:"#F5F5F5",disabledText:"#808080",shadow:"#000000",appBackground:"#fff"},h=n.map((g,p)=>et("div",{className:"relative flex flex-col gap-2.5 items-center justify-center",children:[Z("div",{className:"absolute right-1 top-1 z-10",children:Z(FI,{title:"\u786E\u8BA4\u4ECE\u4E34\u65F6\u5BF9\u8BDD\u77E5\u8BC6\u5E93\u79FB\u9664\u8BE5\u6587\u4EF6\uFF1F",onConfirm:()=>d(g,p),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",children:Z("button",{className:"bg-white cursor-pointer rounded-full p-0.5",style:{lineHeight:0,color:f&&f.text?f.text:"#FF0000",transition:"background 0.2s, color 0.2s"},onMouseOver:v=>{v.currentTarget.style.color=f&&f.error?f.error:"#FF0000"},onMouseOut:v=>{v.currentTarget.style.color=f.text},title:"\u79FB\u9664",children:Z(gp,{className:"w-3 h-3"})})})}),Z(yse,{file_type:vse(g.file.name||g.name),file_name:g.name||g.file.name,url:g.url,retrieve_tags:[],styles:a,isUploadFile:!0,eventsEmit:s,parse_url:g.convertedFilePath,pdfPages:g.pdfPages||0})]},g.file.name+p)),m=r.map((g,p)=>{const v=g.file.name.split(".").pop()||"",y=Dw(v,a);return Z(xse,{cardId:`pending-file-card-${p}`,fileName:g.file.name,fileSize:g.file.size,icon:y,statusText:l[g.status||"pending"],statusColor:"text-gray-400",showRemove:!0,onRemove:()=>i&&i(g,p,"pending"),themeColors:f,style:{boxShadow:"none",height:55,background:"#f8fafc"}},g.file.name+p)});return c.length>0?(f&&f.error&&f.error,f&&f.error&&f.error+"",f&&f.error&&f.error):(f&&f.disabledText&&f.disabledText,f&&f.disabledBackground&&f.disabledBackground,f&&f.disabledText&&f.disabledText),et(mp,{open:e,onCancel:t,footer:null,title:"\u5BF9\u8BDD\u4E34\u65F6\u6587\u4EF6\u77E5\u8BC6\u5E93",closable:!1,width:800,styles:{body:{padding:"0",maxHeight:"70vh",overflow:"auto"}},children:[et("div",{className:"file-manager-modal space-y-6 px-4 py-4",children:[et("div",{className:"",children:[Z("div",{className:"flex items-center mb-2 justify-between",children:et("div",{className:"flex items-center",children:[Z("span",{className:"text-xs font-semibold text-gray-700",children:"\u5DF2\u4E0A\u4F20\u6587\u4EF6"}),et("span",{className:"ml-2 text-xs text-gray-400",children:[n.length," \u4E2A"]})]})}),Z("div",{className:"w-full relative min-h-[200px] max-h-[260px] p-2 overflow-y-auto",style:{overflowX:"hidden"},children:Z("div",{className:"flex flex-wrap gap-1",children:h.length>0?h:Z("div",{className:"flex items-center w-full h-full py-10 justify-center text-gray-400 text-sm",children:"\u6682\u65E0\u5DF2\u4E0A\u4F20\u6587\u4EF6"})})})]}),et("div",{children:[et("div",{className:"flex items-center mb-2",children:[Z("span",{className:"text-xs font-semibold text-gray-700",children:"\u5F85\u4E0A\u4F20\u6587\u4EF6"}),et("span",{className:"ml-2 text-xs text-gray-400",children:[r.length," \u4E2A"]})]}),et("div",{className:"flex gap-2 overflow-x-auto pb-2",children:[m,Z(TC.Dragger,{multiple:!0,showUploadList:!1,beforeUpload:(g,p)=>(g===p[0]&&(o==null||o(p)),!1),className:"!bg-gray-50 !border-dashed !border-gray-300 hover:!border-blue-400 cursor-pointer min-w-[160px] max-w-[220px] flex flex-row items-center justify-center border-2 rounded-lg transition-all",style:{height:45,boxShadow:"none",padding:0},children:et("div",{className:"flex flex-row items-center pb-8 justify-center",children:[Z(NI,{size:20,className:"text-blue-400 mr-2"}),Z("div",{className:"text-xs text-gray-500",children:"\u4E0A\u4F20\u6587\u4EF6"})]})})]})]}),Z("div",{className:"flex justify-end gap-2",children:Z(So,{type:"primary",onClick:t,children:"\u786E\u8BA4"})})]}),Z("style",{children:`
|
|
607
|
+
`};function tse({config:e,styles:t}){if(!e)return null;const n=JSON.parse(e.configJson),r=Vt(()=>{var o;return{...DC.colors,...(o=t==null?void 0:t.theme)==null?void 0:o.colors}},[t]);return et("div",{className:"w-[340px] rounded-xl p-4 animate-fade-in bg-white",children:[et("div",{className:"flex items-center mb-2",children:[Z("span",{className:"text-md font-bold truncate mr-2",style:{color:r.primary},children:n.config_name||"\u52A9\u624B\u914D\u7F6E"}),Z("span",{className:"text-xs truncate rounded px-2 py-0.5",style:{backgroundColor:`${r.primary}1A`,color:r.disabled},children:n.model_name})]}),Z("div",{className:"border-b my-2",style:{borderColor:r.border}}),et("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-700 mb-2",style:{color:r.text},children:[et("div",{children:["\u4E0A\u4E0B\u6587\u6700\u5927\u8F6E\u6570\uFF1A",Z("span",{className:"font-semibold",children:n.max_round})]}),et("div",{children:["\u6700\u5927\u4EE4\u724C\u6570\uFF1A",Z("span",{className:"font-semibold",children:n.max_tokens})]}),et("div",{children:["\u6E29\u5EA6\uFF1A",Z("span",{className:"font-semibold",children:n.temperature})]}),et("div",{children:["\u53EC\u56DE\u6570\uFF1A",Z("span",{className:"font-semibold",children:n.top_k})]}),et("div",{children:["\u591A\u6837\u6027\uFF1A",Z("span",{className:"font-semibold",children:n.top_p})]}),et("div",{children:["\u76F8\u4F3C\u5EA6\u9608\u503C\uFF1A",Z("span",{className:"font-semibold",children:n.score_threshold})]})]}),et("div",{className:"mb-2",children:[Z("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5173\u8054\u77E5\u8BC6\u5E93\uFF1A"}),Z("div",{className:"flex flex-wrap gap-1",children:n.knowledge_base_name?n.knowledge_base_name.split(";").map((o,i)=>Z("span",{className:"px-2 py-0.5 rounded-full text-xs",style:{backgroundColor:`${r.primary}1A`,color:r.primary},children:o},i)):Z("span",{className:"text-gray-300",style:{color:r.disabled},children:"\u65E0"})})]}),et("div",{className:"mb-2",children:[Z("div",{className:"text-xs text-gray-400 mb-1",style:{color:r.disabled},children:"\u5F00\u542F\u529F\u80FD:"}),et("div",{className:"flex flex-wrap gap-2 text-xs mt-2",children:[!!n.enabled_faq&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"FAQ"}),!!n.enabled_graph&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u56FE\u8C31"}),!!n.dependOnKb&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u5F3A\u77E5\u8BC6\u4F9D\u8D56"}),!!n.enabled_table_select&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u8868\u683C\u7B5B\u9009"}),!!n.enabled_rerank&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u7CBE\u6392\u6A21\u5F0F"}),!!n.need_trace_source&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u6EAF\u6E90"}),!!n.is_download&&Z("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`${r.success}1A`,color:r.success},children:"\u4E0B\u8F7D\u6EAF\u6E90"})]})]})]})}function nse(e,t=[],n=60){const[r,o]=at("");return vt(()=>{o("");let i=0;const a=setInterval(()=>{o(s=>i>=e.length?(clearInterval(a),s):(i++,e.slice(0,i)))},n);return()=>clearInterval(a)},[e,...t]),r}function rse(e){const{assistantList:t,eventsEmit:n,styles:r,selectedId:o,onSelectAssistant:i,productLogo:a}=e,[s,l]=at(1),[c,u]=at(!1),[d,f]=at(""),h=c||d.trim()?6:12,m=tt(),g=tt(!1),p=tt(null),v=tt(null),y=tt("");vt(()=>{o&&m.current!==o&&(n==null||n("conversation:new_assistant_change",{assistantId:o}),m.current=o)},[o,n]);const b=Vt(()=>pa(),[]);vt(()=>{var A;if((A=r==null?void 0:r.theme)!=null&&A.colors){const N=document.createElement("style");return N.innerHTML=ese(r.theme.colors,b),N.id=`g-welcome-styles-${b}`,document.head.appendChild(N),()=>{const M=document.getElementById(N.id);M&&M.remove()}}},[r,b]);const E=Vt(()=>t.find(A=>A.id===o),[t,o]),x=Vt(()=>JSON.parse((E==null?void 0:E.configJson)||"{}"),[E]),w=Vt(()=>{if(!d.trim())return t||[];const A=d.toLowerCase().trim();return(t||[]).filter(N=>{var D,P;const M=((D=N.name)==null?void 0:D.toLowerCase())||"";try{const R=((P=JSON.parse(N.configJson||"{}").config_name)==null?void 0:P.toLowerCase())||"";return M.includes(A)||R.includes(A)}catch{return M.includes(A)}})},[t,d]),k=Math.ceil(((w==null?void 0:w.length)||0)/h),S=(w==null?void 0:w.slice((s-1)*h,s*h))||[];vt(()=>{if(o&&o!==v.current){if(g.current&&p.current!==null){v.current=o;return}const A=d.trim()?w:t;if(A&&A.length>0){const N=A.findIndex(M=>M.id===o);if(N!==-1){const M=Math.floor(N/h)+1;l(M),v.current=o}}}},[o,t,w,h,d]),vt(()=>{if(d!==y.current){if(g.current&&p.current!==null){l(p.current),g.current=!1,p.current=null,y.current=d;return}if(v.current===o){y.current=d;return}g.current||(d.trim()&&(v.current=null),l(1)),y.current=d}},[d,o]),vt(()=>{k>0&&s>k&&l(k)},[k,s]);const O=x.prologue||"\u60A8\u597D\uFF0C\u6B22\u8FCE\u4F7F\u7528\u5C0F\u9CB8\u667A\u80FD\u95EE\u7B54",$=nse(O,[o],30);return et("div",{className:`flex flex-col relative items-center justify-center h-full w-full g-welcome-${b}`,children:[Z("img",{src:a||Qae,alt:"logo",className:"mb-4",style:{width:68,height:68}}),Z("div",{className:"text-3xl font-bold mb-2 g-welcome-title",children:$}),!o&&Z("div",{className:"flex mb-2 g-welcome-subtitle",children:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u667A\u80FD\u52A9\u624B"}),et("div",{style:{maxWidth:"1200px"},className:`flex mt-8 flex-wrap gap-3
|
|
608
|
+
max-w-[1200px] px-8 w-full mx-auto justify-center mb-4`,children:[c?Z("div",{className:"flex items-center gap-2 px-5 w-full",style:{flexBasis:"100%"},children:Z(Wu,{className:"g-welcome-search-input w-full",placeholder:"\u641C\u7D22\u52A9\u624B\u540D\u79F0",prefix:Z(a2,{size:16}),suffix:Z("button",{type:"button",onClick:()=>{u(!1),f("")},style:{background:"transparent",border:"none",cursor:"pointer"},children:Z(mp,{size:14})}),value:d,onChange:A=>f(A.target.value),autoFocus:!0})}):Z("button",{type:"button",className:"g-welcome-search-btn",onClick:()=>u(!0),children:Z(a2,{size:16})}),S&&S.length>0?Z(hp,{children:S.map(A=>{const N=o===A.id;let M=A.icon;try{const D=JSON.parse(A.configJson||"{}");M=M||D.icon||D.avatar||D.logo}catch{}return M=M||Jae,Z(MI,{content:()=>Z(tse,{config:t.find(D=>D.id===A.id),styles:r}),trigger:"hover",placement:"bottom",children:et("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 ${N?"active":""}`,onClick:()=>{i==null||i(A.id);const D=c||d.trim(),I=(D?t:d.trim()?w:t).findIndex(R=>R.id===A.id);if(I!==-1){const j=Math.floor(I/(D?12:h))+1;l(j),v.current=A.id,D&&(p.current=j,g.current=!0,setTimeout(()=>{f(""),u(!1)},100))}},title:A.name,children:[Z("span",{className:"icon-badge",children:Z("img",{src:M,alt:"icon",style:{width:16,height:16,borderRadius:4}})}),Z("span",{className:"truncate max-w-[180px]",children:A.name})]})},A.id)})}):Z("div",{className:"g-welcome-subtitle",children:"\u6682\u65E0\u53EF\u7528\u52A9\u624B"})]}),k>1&&et("div",{className:"flex items-center gap-2",children:[Z("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>l(A=>Math.max(1,A-1)),disabled:s===1,children:Z(rW,{size:16})}),Z("div",{className:"flex items-center gap-1",children:(()=>{const A=[];if(k<=7)for(let M=1;M<=k;M++)A.push(M);else if(A.push(1),s<=4){for(let M=2;M<=5;M++)A.push(M);A.push("..."),A.push(k)}else if(s>=k-3){A.push("...");for(let M=k-4;M<=k;M++)A.push(M)}else{A.push("...");for(let M=s-1;M<=s+1;M++)A.push(M);A.push("..."),A.push(k)}return A.map((M,D)=>{if(M==="...")return Z("span",{className:"g-welcome-pagination-text px-1",children:"..."},`ellipsis-${D}`);const P=M;return Z("button",{type:"button",className:`g-welcome-pagination-btn ${s===P?"active":""}`,onClick:()=>l(P),children:P},P)})})()}),Z("button",{type:"button",className:"g-welcome-pagination-btn",onClick:()=>l(A=>Math.min(k,A+1)),disabled:s===k,children:Z(AI,{size:16})})]})]})}async function ose(e,t){const n=e.getReader();let r;for(;!(r=await n.read()).done;)t(r.value)}function ise(e){let t,n,r,o=!1;return function(a){t===void 0?(t=a,n=0,r=-1):t=sse(t,a);const s=t.length;let l=0;for(;n<s;){o&&(t[n]===10&&(l=++n),o=!1);let c=-1;for(;n<s&&c===-1;++n)switch(t[n]){case 58:r===-1&&(r=n-l);break;case 13:o=!0;case 10:c=n;break}if(c===-1)break;e(t.subarray(l,c),r),l=n,r=-1}l===s?t=void 0:l!==0&&(t=t.subarray(l),n-=l)}}function ase(e,t,n){let r=k6();const o=new TextDecoder;return function(a,s){if(a.length===0)n==null||n(r),r=k6();else if(s>0){const l=o.decode(a.subarray(0,s)),c=s+(a[s+1]===32?2:1),u=o.decode(a.subarray(c));switch(l){case"data":r.data=r.data?r.data+`
|
|
609
|
+
`+u:u;break;case"event":r.event=u;break;case"id":e(r.id=u);break;case"retry":const d=parseInt(u,10);isNaN(d)||t(r.retry=d);break}}}}function sse(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function k6(){return{data:"",event:"",id:"",retry:void 0}}var lse=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const Mw="text/event-stream",cse=1e3,S6="last-event-id";function use(e,t){var{signal:n,headers:r,onopen:o,onmessage:i,onclose:a,onerror:s,openWhenHidden:l,fetch:c}=t,u=lse(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((d,f)=>{const h=Object.assign({},r);h.accept||(h.accept=Mw);let m;function g(){m.abort(),document.hidden||x()}l||document.addEventListener("visibilitychange",g);let p=cse,v=0;function y(){document.removeEventListener("visibilitychange",g),window.clearTimeout(v),m.abort()}n==null||n.addEventListener("abort",()=>{y(),d()});const b=c??window.fetch,E=o??dse;async function x(){var w;m=new AbortController;try{const k=await b(e,Object.assign(Object.assign({},u),{headers:h,signal:m.signal}));await E(k),await ose(k.body,ise(ase(S=>{S?h[S6]=S:delete h[S6]},S=>{p=S},i))),a==null||a(),y(),d()}catch(k){if(!m.signal.aborted)try{const S=(w=s==null?void 0:s(k))!==null&&w!==void 0?w:p;window.clearTimeout(v),v=window.setTimeout(x,S)}catch(S){y(),f(S)}}}x()})}function dse(e){const t=e.headers.get("content-type");if(!(t!=null&&t.startsWith(Mw)))throw new Error(`Expected content-type to be ${Mw}, Actual: ${t}`)}class rv extends Error{}let Po=null,ia=null;const fse=({baseUrl:e,token:t,CSRFToken:n,setChatData:r,activeSessionId:o,setAppStatus:i,setConversationList:a})=>{const s=p=>{if(!p)return!1;if(typeof p=="string"){const v=p.trim();return v!==""&&v!=="[]"&&v!=="null"}return!0},l=({content:p,status:v,respTime:y,filePaths:b,reference:E,webReference:x,graphReference:w,databaseReference:k,llmType:S,resultType:O,queryId:$,tokens:A})=>{r(N=>{var L;if(!N[0])return N;const M=N[0],D=M.messages||[],P=D.length-1;if(P<0)return N;const I=D[P];if(I.istype!=="ai")return N;let R=D.slice();if(b!=null&&b.length){const _=D.length-2;if(_>=0&&((L=D[_])==null?void 0:L.istype)==="user"){const F={...D[_],filePaths:b};R[_]=F}}const j=w!==void 0&&s(w)?w:I.graphReference;v===2&&w!==void 0&&console.log("[AichatUseController] reset_chat status=2 \u65F6\u7684 graphReference:",{graphReference:w,isValid:s(w),lastMessageGraphReference:I.graphReference,finalGraphReference:j});const z={...I,content:(I.content||"")+p,status:v,respTime:y,filePaths:b,reference:E,webReference:x,graphReference:j,databaseReference:k??I.databaseReference,resultType:O,llmType:S,tokens:A,queryId:$||I.queryId||pa(32)};return z.clientSideId=z.clientSideId||z.queryId+"-ai",R[P]=z,[{...M,isNew:!1,messages:R},...N.slice(1)]})},c=p=>{if(p instanceof rv)throw i(v=>({...v,display:"error",sender:"ready"})),Po&&(Po.abort(),Po=null),ia=null,p};return{updateUserFilesMessage:({currentFiles:p})=>{r(v=>{if(!v[0])return v;const y=v[0],b=y.messages||[];if(!b.length)return v;const E=b.length-2;if(E<0||b[E].istype!=="user")return v;const w=b.slice();return w[E]={...b[E],currentFiles:p},[{...y,messages:w},...v.slice(1)]})},api_startChat_re:(p,v)=>{Po&&Po.abort(),Po=new AbortController,ia=p.sessionId;const y=`${e}/qa/ai/question_re`;console.log("data",p);const b={...p};use(y,{method:"post",signal:Po.signal,headers:{"Content-Type":"application/json",Accept:"text/event-stream",Authorization:t||"","X-CSRF-TOKEN-IN":n||""},openWhenHidden:!0,body:JSON.stringify(b),onopen:async E=>{if(E.status===500)throw new rv("Internal Server Error");if(!E.ok)throw new rv(`HTTP error: ${E.status}`)},onmessage:E=>{const x=JSON.parse(E.data);if(ia!==x.sessionId){console.log("[AichatUseController] \u6D41\u5F0F\u8BF7\u6C42\u7684 sessionId \u5DF2\u4E0D\u5339\u914D\uFF0C\u5FFD\u7565\u6570\u636E",{currentStreamSessionId:ia,receivedSessionId:x.sessionId,activeSessionId:o});return}if(o!==x.sessionId)return;const{reply:w,resultType:k,respTime:S,reference:O,webReference:$,graphReference:A,filePaths:N,status:M,docs:D,llmType:P,databaseReference:I}=x,R=N?JSON.parse(N):[];M===2&&w&&w.content&&(w.content.includes("\u6A21\u578B\u6682\u65E0\u6CD5\u8FD4\u56DE")||w.content.includes("\u5931\u8D25")||w.content.includes("\u9519\u8BEF")||w.content.includes("\u8BF7\u7A0D\u540E\u518D\u8BD5"))&&i(z=>({...z,display:"ready",sender:"ready"}));const j=s(A)?A:void 0;if(M===2&&console.log("[AichatUseController] status=2 \u65F6\u7684 graphReference:",{graphReference:A,type:typeof A,isValid:s(A),finalGraphReference:j}),M===2){if(l({content:w.content||"",status:2,respTime:S,filePaths:R,reference:O||D||"",webReference:$||"",graphReference:j,databaseReference:I,llmType:P,resultType:k,queryId:x.queryId,tokens:x.tokens}),i(z=>({...z,display:"ready",sender:"ready"})),v){const z=S||Date.now();console.log("[AichatUseController] \u6D88\u606F\u53D1\u9001\u6210\u529F\uFF0CgmtModified:",z),v(z)}}else l({content:w.content||"",status:M,respTime:S,filePaths:R,reference:O||D||"",webReference:$||"",graphReference:j,databaseReference:I,llmType:P,resultType:k,queryId:x.queryId,tokens:x.tokens})},onerror:c,onclose:()=>{ia===p.sessionId&&(ia=null)}})},addEmptyMessage:({queryId:p,content:v,filePaths:y,currentFiles:b})=>{r(E=>{const x=new Date().toISOString(),w=p||pa(32),k={istype:"user",content:v,time:x,queryId:w,clientSideId:w+"-user",filePaths:y||"",currentFiles:b||[]},S={istype:"ai",content:"",time:new Date(Date.now()+1).toISOString(),streaming:!0,status:0,queryId:w,clientSideId:w+"-ai"},O=E.find($=>$.id===o);return O?O.messages.push(k,S):console.warn("addEmptyMessage called without an active session."),[...E]})},setLastEmptyMessage:({now:p})=>{r(v=>{if(!v[0])return v;const y=v[0],b=y.messages||[];if(!b.length)return v;const E=b.length-1;if(E<0)return v;const x=b[E];if(x.istype!=="ai")return v;const w=b.slice();return w[E]={...x,istype:"ai",content:"",time:p,streaming:!0,status:0},[{...y,messages:w},...v.slice(1)]})},stopStream:()=>{Po&&(Po.abort(),Po=null),ia=null,i(p=>({...p,display:"ready",sender:"ready"}))},cancelStreamBySessionId:p=>Po&&ia===p?(console.log("[AichatUseController] \u5207\u6362\u4F1A\u8BDD\uFF0C\u53D6\u6D88\u6B63\u5728\u8FDB\u884C\u7684\u6D41\u5F0F\u8BF7\u6C42",p),Po.abort(),Po=null,ia=null,i(v=>({...v,display:"ready",sender:"ready"})),!0):!1}},hse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACRSURBVHgB7ZJBCsQgDEWTmQvMncT7dOuqmY3iai6kMN31UmIjdNFFKuk+DwKahP9ABDAMQyTnvHCtT/ZjjIs0e0nN1hr03kkjGTu8+0PEjzR/S81a6+6cQz6S9x5KKdsknLi+IQRSC07JfybRhE8FM4k2fICgIKVE/MYrF427NlwtuEpOgSr8MUNy9x0Nw7jnAFsnZ7Uu5CkqAAAAAElFTkSuQmCC",{TextArea:$6}=Wu,{useForm:pse}=Ra,f9={\u56DE\u7B54\u4E0D\u4F73:"ansPoor",\u683C\u5F0F\u95EE\u9898:"formatError",\u7406\u89E3\u95EE\u9898\u6709\u8BEF:"harmfulInfo",\u5176\u4ED6:"othres"},gse=({open:e,setOpen:t,feedBackList:n,handleConfirm:r})=>{const o={header:{padding:"20px 24px",borderBottom:"1px solid #F0F0F0",margin:0},body:{padding:"16px 24px 20px 24px",borderBottom:"1px solid #F0F0F0"},mask:{},footer:{padding:"16px 24px",margin:0},content:{padding:0,borderRadius:"4px",width:"563px"}},[i]=pse(),[a,s]=at({}),l=async()=>{try{const c=await i.validateFields();t(!1);const u={...c};Object.entries(a||{}).forEach(d=>{const[f,h]=d;h&&(u[f9[f]]=h)}),r(u)}catch(c){console.log(c);return}};return vt(()=>{e||(i.resetFields(),s(null))},[e]),Z(pp,{modal:{styles:o},children:et(gp,{open:e,onCancel:()=>t(!1),title:Z("div",{className:"text-[16px] text-[#2A2A2A] font-bold leading-[1]",children:"\u611F\u8C22\u60A8\u7684\u53CD\u9988\uFF01\u8FD9\u5C06\u5E2E\u52A9\u6211\u4EEC\u4E0D\u65AD\u4F18\u5316\u4E0E\u63D0\u5347\u3002"}),footer:et("div",{children:[Z(So,{className:"mr-[16px] w-[76px]",onClick:()=>{t(!1)},children:"\u53D6\u6D88"}),Z(So,{type:"primary",className:"w-[76px] border-none",onClick:l,children:"\u786E\u8BA4"})]}),children:[Z(mse,{feedBackList:n,treeSelectResult:a,setTreeSelectResult:s}),et(Ra,{form:i,layout:"vertical",children:[Z(Ra.Item,{name:"supplementExplain",label:"\u8865\u5145\u63CF\u8FF0",children:Z($6,{})})," ",Z(Ra.Item,{name:"idealAnswer",label:"\u60A8\u89C9\u5F97\u66F4\u597D\u7684\u56DE\u7B54\u662F\u4EC0\u4E48\uFF1F",children:Z($6,{})}),Z(Ra.Item,{name:"userPhone",label:"\u8054\u7CFB\u7535\u8BDD",children:Z(Wu,{})}),Z(Ra.Item,{name:"deptName",label:"\u90E8\u95E8",children:Z(Wu,{})})]})]})})},mse=({feedBackList:e,treeSelectResult:t,setTreeSelectResult:n})=>{const[r,o]=at(!1),[i,a]=at([]),[s,l]=at([]),[c,u]=at([]),[d,f]=at(null),h=Vt(()=>(l([]),d!=null&&d.items?[{title:"\u5168\u9009",key:"\u5168\u9009",children:d.items.map(g=>({title:g,key:g}))}]:[]),[d]),m=g=>{u(p=>Array.isArray(p)&&Array.isArray(s)?Object.entries(t).reduce((y,b)=>{const[E,x]=b,k=(x?x.split(";"):[]).filter(S=>S!==g);return n(S=>({...S||{},[E]:k.join(";")})),[...y,...k]},[]):p)};return vt(()=>{if(a(["\u5168\u9009"]),!t||!(d!=null&&d.que_name))return;const g=t[d.que_name]||"",p=g?g.split(";"):[];l(p)},[h,r]),vt(()=>{t===null&&(u([]),f(null),l([]))},[t]),vt(()=>{console.log("treeSelectResult",t),console.log("selectedValue",c),console.log("feedBackList",e),console.log("pKey",f9),console.log("selectedParent",d)},[t,c]),et("div",{className:"relative mb-[24px] z-20",children:[et("div",{className:"absolute w-full z-10",children:[et("div",{className:"h-[32px] box-border flex items-center justify-between border-[1px] border-solid border-[#D9D9D9] rounded-[4px] cursor-pointer",onClick:()=>o(!r),children:[Z("div",{className:"ml-[16px]",children:"\u95EE\u9898\u7C7B\u578B"}),Z("img",{src:hse,width:24,height:24,className:"mr-[16px]"})]}),et("div",{style:{display:r?"":"none"},className:"h-[288px] rounded-[4px] shadow-md mt-[4px] bg-white",children:[et("div",{className:"h-[248px] flex",style:{borderBottom:"1px solid #F0F0F0"},children:[Z("div",{className:"w-[203px] px-[8px] py-[8px]",style:{borderRight:"1px solid #F0F0F0"},children:e.map((g,p)=>{var v;return et("div",{className:"rounded-[4px] h-[32px] cursor-pointer flex items-center",style:{backgroundColor:(d==null?void 0:d.que_name)===g.que_name?"#E6F4FF":""},children:[Z("div",{className:"h-full w-full leading-[32px]",onClick:()=>{f(g)},children:et("div",{className:"ml-[8px] text-[14px] text-[#2A2A2A]",children:[g.que_name,"(",t&&t[g.que_name]?t[g.que_name].split(";").length:0,"/",(v=g==null?void 0:g.items)==null?void 0:v.length,")"]})}),Z(AI,{className:"mr-[8px] w-3 h-3 text-[rgba(0,0,0,0.45)]"})]},p)})}),Z("div",{className:"selfTree h-full flex-1 mt-[8px] ml-[16px]",children:Z(QH,{checkable:!0,defaultSelectedKeys:["0-1"],treeData:h,blockNode:!0,checkedKeys:s,expandedKeys:i,onCheck:g=>{Array.isArray(g)&&n(p=>({...p||{},[(d==null?void 0:d.que_name)||""]:(g||[]).filter(v=>v!=="\u5168\u9009").join(";")})),l(g)}})})]}),et("div",{className:"flex justify-end h-[40px] items-center",children:[Z(So,{size:"small",className:"mr-[8px]",onClick:()=>o(!1),children:"\u53D6\u6D88"}),Z(So,{size:"small",type:"primary",className:"border-none mr-[16px]",onClick:()=>{u(g=>Array.isArray(g)&&Array.isArray(s)?Object.values(t).reduce((v,y)=>[...v,...y?y.split(";"):[]],[]):g),o(!1)},children:"\u786E\u8BA4"})]})]})]}),Z("div",{className:"h-[32px]"}),!!(c!=null&&c.length)&&et("div",{children:[et("div",{className:"mt-[5px] text-[12px] text-[#555555]",children:["\u5DF2\u9009\u62E9 ",c.length," \u4E2A"]}),(c||[]).map(g=>{let p="";return Object.entries(t||{}).forEach(v=>{const[y,b]=v;b.indexOf(g)>-1&&(p=y)}),et(UH,{closable:!0,className:"mt-[5px]",onClose:()=>m(g),children:[p,"\uFF08",g,"\uFF09"]},g)})]})]})},A6=e=>e?Array.isArray(e)?e.map(r=>"/minio/"+r.split("/").slice(3).join("/")):"/minio/"+e.split("/").slice(3).join("/"):"",O6="http://10.15.12.13:9000/",vse=e=>{if(typeof e=="string"){const t=e.split(".");return t.length?t[t.length-1]:""}else return""},yse=e=>{var x,w,k,S,O,$,A,N;const{file_type:t,file_name:n,url:r,parse_url:o,retrieve_tags:i,file_id:a,parsed_file_type:s,onlyDownloadTypes:l,references:c,eventsEmit:u,styles:d,isUploadFile:f,type:h,collectionItems:m,pdfPages:g=0,fileManagerData:p}=e;if(h==="collection"&&Array.isArray(m)){const P=`calc(90% - ${.5}px)`,I=m.slice(0,4),R=m.length>4,j="\u6253\u5F00\u5408\u96C6",z=()=>{if(p&&t==="pdf"&&!e.pdfPages){const V=((p==null?void 0:p.uploadedFiles)||[]).find(L=>{var _;return((L==null?void 0:L.name)||((_=L==null?void 0:L.file)==null?void 0:_.name))===n});if(!(V!=null&&V.pdfPages)){rr.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}u==null||u("reference_file:click",{...e,pdfPages:(V==null?void 0:V.pdfPages)||0})}else u==null||u("reference_file:click",e)};return et("div",{className:"user-file relative group flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all bg-white shadow",style:{width:94,height:94,minWidth:94,minHeight:94,borderColor:(w=(x=d==null?void 0:d.theme)==null?void 0:x.colors)==null?void 0:w.border},onClick:z,children:[Z("div",{className:"grid grid-cols-2 items-center justify-center grid-rows-2 gap-1 w-full h-full",style:{width:"100%",height:"100%",gap:1},children:I.map((V,L)=>{var T,B,H,G;if(R&&L===3)return Z("div",{className:"flex items-center justify-center bg-gray-100 rounded",style:{width:P,height:P},children:Z("span",{className:"text-xl text-gray-300 font-bold scale-75",children:"..."})},"ellipsis");if(V.file_type==="image"||V.file_type==="jpg"||V.file_type==="jpeg"||V.file_type==="png"||V.file_type==="gif"||V.file_type==="bmp"||V.file_type==="webp")return Z("div",{className:"relative flex items-center justify-center bg-white rounded-lg border overflow-hidden",style:{width:P,height:P,borderColor:(B=(T=d==null?void 0:d.theme)==null?void 0:T.colors)==null?void 0:B.border},children:Z("div",{className:"flex items-center justify-center w-full h-full scale-75",children:Z("img",{src:String(V.url||V.file_path||""),alt:V.file_name||"",className:"object-contain max-w-full max-h-full"})})},V.file_name||L);const F=Dw(String(V.file_type||""),d);return Z("div",{className:"user-file flex flex-col items-center justify-center rounded-lg border bg-gray-50 p-1 text-sm",title:V.file_name,style:{width:P,height:P,borderColor:(G=(H=d==null?void 0:d.theme)==null?void 0:H.colors)==null?void 0:G.border},children:Z("div",{className:"flex items-center justify-center w-full h-full scale-75",children:F})},V.file_name||L)})}),Z("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg pointer-events-none",children:et("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[Z(lm,{size:20,className:"mb-1 text-white"}),Z("span",{className:"text-white text-center",style:{fontSize:12},children:j})]})})]})}const v=()=>{if(console.log(o,"parse_url",r,"url"),p&&t==="pdf"&&!g){const M=((p==null?void 0:p.uploadedFiles)||[]).find(D=>{var P;return((D==null?void 0:D.name)||((P=D==null?void 0:D.file)==null?void 0:P.name))===(n||"").replace(/\s+/g,"")});if(!(M!=null&&M.pdfPages)){rr.warning("\u8BE5PDF\u6587\u4EF6\u672A\u89E3\u6790\u5B8C\u6210\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}u==null||u("reference_file:click",{file:n,file_type:t,url:r,parse_url:o,retrieve_tags:i,file_id:a,parsed_file_type:s,references:c,type:y,isUploadFile:f,pdfPages:M.pdfPages||0})}else u==null||u("reference_file:click",{file:n,file_type:t,url:r,parse_url:o,retrieve_tags:i,file_id:a,parsed_file_type:s,references:c,type:y,isUploadFile:f,pdfPages:g})},y=Vt(()=>(n||"").split(".").pop()||"",[n]),b=Dw(y,d),E=async()=>{if(r){const M=A6(r.indexOf("http")>-1?r:`${O6}/${r}`);if(y.toLowerCase()==="json"){try{const I=await fetch(M);if(!I.ok)throw new Error("\u4E0B\u8F7D\u5931\u8D25");const R=await I.blob(),j=document.createElement("a");j.href=URL.createObjectURL(R),j.download=n||"",document.body.appendChild(j),j.click(),document.body.removeChild(j),setTimeout(()=>URL.revokeObjectURL(j.href),1e3)}catch{alert("\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25")}return}const P=document.createElement("a");P.href=M,P.download=n||"",document.body.appendChild(P),P.click(),document.body.removeChild(P)}};return l&&l.includes(y.toLowerCase())?et("div",{className:"user-file relative group w-24 h-24 flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all",title:n,onClick:E,style:{borderColor:(S=(k=d==null?void 0:d.theme)==null?void 0:k.colors)==null?void 0:S.border},children:[b,Z("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:n}),Z("div",{className:"absolute text-center inset-0 cursor-pointer bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg",children:et("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[Z(lm,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),Z("div",{className:"text-white text-center",style:{fontSize:10},children:"\u4E0B\u8F7D\u6587\u4EF6"})]})})]},n):y==="image"||y==="jpg"||y==="jpeg"||y==="png"||y==="gif"||y==="bmp"||y==="webp"?et("div",{className:"relative group w-24 h-24 cursor-pointer flex items-center justify-center",onClick:()=>v(),children:[r?Z("img",{src:String(A6(r&&r.indexOf("http")>-1?r:`${O6}/${r}`)||""),alt:n||"",className:"w-full h-full object-cover rounded-md border",style:{borderColor:($=(O=d==null?void 0:d.theme)==null?void 0:O.colors)==null?void 0:$.border}}):Z("div",{className:"w-full h-full flex items-center justify-center",children:Z("span",{className:"animate-spin rounded-full border-2 border-gray-300 border-t-blue-500 w-8 h-8 inline-block"})}),Z("div",{className:"absolute inset-0 bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-md",children:et("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[Z(cW,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),Z("div",{className:"text-white text-center",children:"\u67E5\u770B\u56FE\u7247"})]})})]},n):et("div",{className:"user-file relative group w-24 h-24 flex flex-col items-center justify-center cursor-pointer backdrop-blur-sm rounded-lg border p-2 text-sm transition-all",title:n,onClick:v,style:{borderColor:(N=(A=d==null?void 0:d.theme)==null?void 0:A.colors)==null?void 0:N.border},children:[b,Z("span",{className:"file-name font-medium truncate text-center px-2 pt-1",style:{fontSize:10,maxWidth:"5.5rem"},children:n}),Z("div",{className:"absolute text-center inset-0 cursor-pointer bg-transparent group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center rounded-lg",children:et("div",{className:"flex flex-col items-center text-xs justify-center text-white opacity-0 group-hover:opacity-100 transition-opacity",children:[Z(lm,{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity mx-auto"}),Z("div",{className:"text-white text-center",style:{fontSize:10},children:"\u6253\u5F00\u6587\u4EF6"})]})})]},n)},bse=e=>e?e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`:"",xse=({fileName:e,fileSize:t,icon:n,statusText:r,statusColor:o="text-gray-400",statusIcon:i,onRemove:a,themeColors:s={},cardId:l,showRemove:c=!0,disabledRemove:u=!1,onRemoveWithAnim:d,extra:f,style:h})=>et("div",{id:l,className:"group gap-x-2.5 items-center file-display-card relative flex w-[210px] bg-white border border-gray-200 rounded-md shadow-sm px-2 py-1 transition-all hover:shadow-md hover:border-blue-300",style:h,children:[Z("div",{className:"pt-1",children:n}),et("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[et("div",{className:"flex items-center justify-between gap-1",children:[Z("span",{className:"text-[12px] font-medium truncate max-w-[120px]",title:e,children:e}),Z("span",{className:"ml-1 text-[11px] text-gray-400",children:bse(t)})]}),et("div",{className:`text-[10px] mt-0.5 flex items-center gap-3 ${o}`,children:[i,Z("span",{children:r})]})]}),f,c&&!u&&Z("button",{className:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 transition-opacity text-gray-300 hover:text-red-400 text-xs p-0.5 rounded-full bg-white shadow-sm z-10",onClick:()=>{d&&l?d(l):a&&a()},title:"\u79FB\u9664",style:{lineHeight:0,color:s.error||"#FF0000"},children:Z(mp,{className:"w-3.5 h-3.5"})})]});function Dw(e,t){var r;const n=((r=t==null?void 0:t.theme)==null?void 0:r.icons)||{};switch(e.toLowerCase()){case"docx":case"doc":return n.docx?Z("img",{src:n.docx,alt:"docx",style:{width:20,height:20}}):Z(ar,{type:"rag/word",size:18});case"image":case"jpg":case"jpeg":case"png":case"gif":case"bmp":case"webp":case"svg":case"ico":return n.image?Z("img",{src:n.image,alt:"image",style:{width:20,height:20}}):Z(ar,{type:"rag/pic",size:18});case"pptx":case"ppt":return n.pptx?Z("img",{src:n.pptx,alt:"pptx",style:{width:20,height:20}}):Z(ar,{type:"rag/ppt",size:18});case"sheets":case"excel":case"xls":case"csv":case"xlsx":case"xlsm":case"xlsb":case"xltx":case"xltm":case"xlt":case"xlam":return n.sheets?Z("img",{src:n.sheets,alt:"sheets",style:{width:20,height:20}}):Z(ar,{type:"rag/excel",size:18});case"pdf":return n.pdf?Z("img",{src:n.pdf,alt:"pdf",style:{width:20,height:20}}):Z(ar,{type:"rag/pdf",size:18});case"txt":return n.txt?Z("img",{src:n.txt,alt:"txt",style:{width:20,height:20}}):Z(ar,{type:"rag/txt",size:18});case"md":return n.md?Z("img",{src:n.md,alt:"txt",style:{width:20,height:20}}):Z(ar,{type:"rag/document",size:18});case"json":return n.json?Z("img",{src:n.json,alt:"json",style:{width:20,height:20}}):Z(ar,{type:"rag/json",size:18});case"html":case"htm":return n.html?Z("img",{src:n.html,alt:"html",style:{width:20,height:20}}):Z(ar,{type:"rag/url",size:18});case"xml":default:return Z(ar,{type:"rag/file",size:18})}}const Ese=[{file:{name:"\u4EA7\u54C1\u9700\u6C42\u6587\u6863.pdf",size:1024*1024*2.5,type:"application/pdf"},type:"pdf",status:"uploaded",url:"https://example.com/file1.pdf"},{file:{name:"\u6570\u636E\u5206\u6790\u62A5\u544A.xlsx",size:1024*1024*1.2,type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},type:"excel",status:"uploaded",url:"https://example.com/file3.xlsx"},{file:{name:"\u7CFB\u7EDF\u67B6\u6784\u56FE.png",size:1024*512,type:"image/png"},type:"image",status:"uploaded",url:"https://example.com/file2.png"}];function wse({open:e,onCancel:t,files:n=Ese,currentFiles:r=[],onUpload:o,onRemoveFile:i,styles:a,eventsEmit:s}){const l={pending:"\u5F85\u4E0A\u4F20",uploading:"\u4E0A\u4F20\u4E2D",uploaded:"\u5DF2\u4E0A\u4F20",analyzing:"\u89E3\u6790\u4E2D",analyze_failed:"\u89E3\u6790\u5931\u8D25",error:"\u5931\u8D25"},[c,u]=at([]),d=(g,p)=>{s&&s("uploaded_file:removeFromTemp",{file:g,idx:p})},f=a&&a.theme&&a.theme.colors?a.theme.colors:{primary:"#007bff",secondary:"#6c757d",success:"#008000",warning:"#FFA500",error:"#FF0000",info:"#0000FF",background:"#f8f9fa",text:"#343a40",border:"#dee2e6",disabled:"#808080",disabledBackground:"#F5F5F5",disabledText:"#808080",shadow:"#000000",appBackground:"#fff"},h=n.map((g,p)=>et("div",{className:"relative flex flex-col gap-2.5 items-center justify-center",children:[Z("div",{className:"absolute right-1 top-1 z-10",children:Z(FI,{title:"\u786E\u8BA4\u4ECE\u4E34\u65F6\u5BF9\u8BDD\u77E5\u8BC6\u5E93\u79FB\u9664\u8BE5\u6587\u4EF6\uFF1F",onConfirm:()=>d(g,p),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",children:Z("button",{className:"bg-white cursor-pointer rounded-full p-0.5",style:{lineHeight:0,color:f&&f.text?f.text:"#FF0000",transition:"background 0.2s, color 0.2s"},onMouseOver:v=>{v.currentTarget.style.color=f&&f.error?f.error:"#FF0000"},onMouseOut:v=>{v.currentTarget.style.color=f.text},title:"\u79FB\u9664",children:Z(mp,{className:"w-3 h-3"})})})}),Z(yse,{file_type:vse(g.file.name||g.name),file_name:g.name||g.file.name,url:g.url,retrieve_tags:[],styles:a,isUploadFile:!0,eventsEmit:s,parse_url:g.convertedFilePath,pdfPages:g.pdfPages||0})]},g.file.name+p)),m=r.map((g,p)=>{const v=g.file.name.split(".").pop()||"",y=Dw(v,a);return Z(xse,{cardId:`pending-file-card-${p}`,fileName:g.file.name,fileSize:g.file.size,icon:y,statusText:l[g.status||"pending"],statusColor:"text-gray-400",showRemove:!0,onRemove:()=>i&&i(g,p,"pending"),themeColors:f,style:{boxShadow:"none",height:55,background:"#f8fafc"}},g.file.name+p)});return c.length>0?(f&&f.error&&f.error,f&&f.error&&f.error+"",f&&f.error&&f.error):(f&&f.disabledText&&f.disabledText,f&&f.disabledBackground&&f.disabledBackground,f&&f.disabledText&&f.disabledText),et(gp,{open:e,onCancel:t,footer:null,title:"\u5BF9\u8BDD\u4E34\u65F6\u6587\u4EF6\u77E5\u8BC6\u5E93",closable:!1,width:800,styles:{body:{padding:"0",maxHeight:"70vh",overflow:"auto"}},children:[et("div",{className:"file-manager-modal space-y-6 px-4 py-4",children:[et("div",{className:"",children:[Z("div",{className:"flex items-center mb-2 justify-between",children:et("div",{className:"flex items-center",children:[Z("span",{className:"text-xs font-semibold text-gray-700",children:"\u5DF2\u4E0A\u4F20\u6587\u4EF6"}),et("span",{className:"ml-2 text-xs text-gray-400",children:[n.length," \u4E2A"]})]})}),Z("div",{className:"w-full relative min-h-[200px] max-h-[260px] p-2 overflow-y-auto",style:{overflowX:"hidden"},children:Z("div",{className:"flex flex-wrap gap-1",children:h.length>0?h:Z("div",{className:"flex items-center w-full h-full py-10 justify-center text-gray-400 text-sm",children:"\u6682\u65E0\u5DF2\u4E0A\u4F20\u6587\u4EF6"})})})]}),et("div",{children:[et("div",{className:"flex items-center mb-2",children:[Z("span",{className:"text-xs font-semibold text-gray-700",children:"\u5F85\u4E0A\u4F20\u6587\u4EF6"}),et("span",{className:"ml-2 text-xs text-gray-400",children:[r.length," \u4E2A"]})]}),et("div",{className:"flex gap-2 overflow-x-auto pb-2",children:[m,Z(TC.Dragger,{multiple:!0,showUploadList:!1,beforeUpload:(g,p)=>(g===p[0]&&(o==null||o(p)),!1),className:"!bg-gray-50 !border-dashed !border-gray-300 hover:!border-blue-400 cursor-pointer min-w-[160px] max-w-[220px] flex flex-row items-center justify-center border-2 rounded-lg transition-all",style:{height:45,boxShadow:"none",padding:0},children:et("div",{className:"flex flex-row items-center pb-8 justify-center",children:[Z(NI,{size:20,className:"text-blue-400 mr-2"}),Z("div",{className:"text-xs text-gray-500",children:"\u4E0A\u4F20\u6587\u4EF6"})]})})]})]}),Z("div",{className:"flex justify-end gap-2",children:Z(So,{type:"primary",onClick:t,children:"\u786E\u8BA4"})})]}),Z("style",{children:`
|
|
610
610
|
.file-manager-modal .ant-upload-wrapper,
|
|
611
611
|
.file-manager-modal .ant-upload-drag,
|
|
612
612
|
.file-manager-modal .ant-upload-drag-container {
|
|
@@ -622,7 +622,7 @@ ${v.substring(Y)}`;y(J),requestAnimationFrame(()=>{U.selectionStart=U.selectionE
|
|
|
622
622
|
0%, 100% { transform: translateY(0); }
|
|
623
623
|
50% { transform: translateY(-12px); }
|
|
624
624
|
}
|
|
625
|
-
`;document.head.appendChild(h9);function kse(){return et("div",{className:"flex flex-col gap-8 p-4 w-full mx-auto",children:[et("div",{className:"flex items-start gap-4",children:[Z("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),Z("div",{className:"flex-1",children:Z(Xd,{active:!0,paragraph:{rows:1}})})]}),et("div",{className:"flex items-start gap-4",children:[Z("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),Z("div",{className:"flex-1",children:Z(Xd,{active:!0,paragraph:{rows:3}})})]}),et("div",{className:"flex items-start gap-4",children:[Z("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),Z("div",{className:"flex-1",children:Z(Xd,{active:!0,paragraph:{rows:1}})})]}),et("div",{className:"flex items-start gap-4",children:[Z("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),Z("div",{className:"flex-1",children:Z(Xd,{active:!0,paragraph:{rows:2}})})]})]})}function Sse({msg:e,subMsg:t}){return et("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-white/80 backdrop-blur-sm",children:[Z("div",{className:"mb-6 animate-bounce",children:Z(fW,{size:64,className:"text-[#d70016]"})}),Z("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:e||"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25"}),Z("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:t||"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),Z(So,{type:"primary",icon:Z(TI,{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 $se(){return et("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-transparent! backdrop-blur-sm",children:[Z("div",{className:"mb-6 animate-bounce",children:Z(YH,{size:64,className:"text-[#d70016]"})}),Z("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:"\u62B1\u6B49\uFF0C\u9047\u5230\u4E86\u4E00\u4E9B\u95EE\u9898"}),Z("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:"\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"}),Z(So,{type:"primary",icon:Z(TI,{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 Ase=1e3,Ose=3e3,Nse=({isModalOpen:e,handleOk:t,handleCancel:n,data:r})=>{const o={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[i]=$I();return vt(()=>{if(!e){i.resetFields();return}i.setFieldValue("new_name",r==null?void 0:r.label)},[r,e]),Z(pp,{modal:{styles:o},children:Z(
|
|
625
|
+
`;document.head.appendChild(h9);function kse(){return et("div",{className:"flex flex-col gap-8 p-4 w-full mx-auto",children:[et("div",{className:"flex items-start gap-4",children:[Z("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),Z("div",{className:"flex-1",children:Z(Xd,{active:!0,paragraph:{rows:1}})})]}),et("div",{className:"flex items-start gap-4",children:[Z("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),Z("div",{className:"flex-1",children:Z(Xd,{active:!0,paragraph:{rows:3}})})]}),et("div",{className:"flex items-start gap-4",children:[Z("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),Z("div",{className:"flex-1",children:Z(Xd,{active:!0,paragraph:{rows:1}})})]}),et("div",{className:"flex items-start gap-4",children:[Z("div",{className:"w-10 h-10 rounded-full bg-muted/80 animate-pulse"}),Z("div",{className:"flex-1",children:Z(Xd,{active:!0,paragraph:{rows:2}})})]})]})}function Sse({msg:e,subMsg:t}){return et("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-white/80 backdrop-blur-sm",children:[Z("div",{className:"mb-6 animate-bounce",children:Z(fW,{size:64,className:"text-[#d70016]"})}),Z("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:e||"\u5E94\u7528\u521D\u59CB\u5316\u5931\u8D25"}),Z("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:t||"\u65E0\u6CD5\u5B8C\u6210\u5E94\u7528\u521D\u59CB\u5316\uFF0C\u8FD9\u53EF\u80FD\u662F\u7531\u4E8E\u7F51\u7EDC\u8FDE\u63A5\u95EE\u9898\u6216\u670D\u52A1\u914D\u7F6E\u9519\u8BEF\u5BFC\u81F4\u7684\u3002\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u8FDE\u63A5\u5E76\u91CD\u8BD5\u3002"}),Z(So,{type:"primary",icon:Z(TI,{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 $se(){return et("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center bg-transparent! backdrop-blur-sm",children:[Z("div",{className:"mb-6 animate-bounce",children:Z(YH,{size:64,className:"text-[#d70016]"})}),Z("h2",{className:"text-[20px] font-medium text-[#222222] mb-3",children:"\u62B1\u6B49\uFF0C\u9047\u5230\u4E86\u4E00\u4E9B\u95EE\u9898"}),Z("p",{className:"text-[14px] text-[#555555] mb-8 max-w-[400px]",children:"\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"}),Z(So,{type:"primary",icon:Z(TI,{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 Ase=1e3,Ose=3e3,Nse=({isModalOpen:e,handleOk:t,handleCancel:n,data:r})=>{const o={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[i]=$I();return vt(()=>{if(!e){i.resetFields();return}i.setFieldValue("new_name",r==null?void 0:r.label)},[r,e]),Z(pp,{modal:{styles:o},children:Z(gp,{title:Z("div",{className:"text-[16px]",children:"\u7F16\u8F91\u4F1A\u8BDD\u540D\u79F0"}),closeIcon:null,open:e,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:et("div",{className:"mt-[16px] flex justify-end",children:[Z(So,{children:"\u53D6\u6D88",onClick:n,className:"mr-[8px]"}),Z(So,{children:"\u786E\u8BA4",onClick:async()=>{try{const a=await i.validateFields();t("ok_rename",a)}catch(a){console.log(a);return}},type:"primary",className:"border-none"})]}),children:Z(Ra,{form:i,children:Z(Ra.Item,{name:"new_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"},{max:100,message:"\u6700\u5927\u5B57\u6570\u9650\u5236100"}],children:Z(Wu,{})})})})})},Mse=({isModalOpen:e,handleOk:t,handleCancel:n,data:r})=>{const o={header:{height:"60px",borderBottom:"1px solid #F0F0F0",display:"flex",paddingLeft:"24px",alignItems:"center",marginBottom:"16px"},title:{fontSize:"16px"},body:{padding:"0 24px"},mask:{},footer:{marginTop:"0px",padding:"0 24px 16px 24px"},content:{padding:0}},[i]=$I();return vt(()=>{if(!e){i.resetFields();return}i.setFieldValue("new_name",r==null?void 0:r.label)},[r,e]),Z(pp,{modal:{styles:o},children:Z(gp,{title:Z("div",{className:"text-[16px]",children:"\u5220\u9664\u4F1A\u8BDD"}),closeIcon:null,open:e,width:520,centered:!0,className:"[&:[.ant-modal-content]]:bg-red",footer:et("div",{className:"mt-[16px] flex justify-end",children:[Z(So,{children:"\u53D6\u6D88",onClick:n,className:"mr-[8px]"}),Z(So,{children:"\u786E\u8BA4",onClick:async()=>{try{const a=await i.validateFields();t("ok_remove",a)}catch(a){console.log(a);return}},type:"primary",className:"border-none"})]}),children:Z("div",{children:`\u786E\u5B9A\u8981\u5220\u9664\u4F1A\u8BDD\u300C${r.label}\u300D\u5417\uFF1F\u5220\u9664\u540E\u65E0\u6CD5\u6062\u590D\u3002`})})})},Dse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFQSURBVHgBpVMxTsNQDLWTiIYBFG7Q3iCcgLIxQJWxZSpbOxFO0HICOhE2shGxEFCGbvQGcAPCCahgIJHoN/5RaEOUBAJPsmTZ3/aT/T4Co23ZxoYeWVACEjj/UOhx6l2E+RzudQfNNcR79ptQjfD1vbE98yfzbFDTEE1ZrBC1/IIJEhYPEYhPKUs3m1OQyJBOWfFPOQX+CQ1qQu6sATBaCLwNrh2/NgOdjQC2FBVu5PW+MTjoDvrccSdfJNILqQCzdB9WpzckudQlg87hYISIl7I7G2YNAZ75SrtFy1wxIBwLwtPAc8ZQA5qq676II5MAw8A7n+z3hpLW2d2V0/pVA99NlGV/BRJdIDbltqcV91++zwesvm2IOH6AEmkTkfsW6Seb6/EL+0dY9EhKl1mYi1Slq3HCQFCP2WHWZJY2qEL6L5LPJ/gy8BfIJmxt6X8C+32HILvaN+0AAAAASUVORK5CYII=",Tse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADSSURBVHgBzVExDoJAENw9MdiY8AQqY6xs7CmNQTkLE6i0MYFKnsAT/IE+gR+ovY2FibHyCZQWhnXpkHhHYSFT3G1m5+YyuwD/RkvXdINI9gaj/v16vqk0hs5AEEkUQFymSg38iAYbSD+0ObyVE1lFrdIph5gLESORB4jwIrwwlYAOk8V6OK785AXRYRZExzLnyNhy/dCBaoSWYaRt7pfFaJpzXuWqzHU7TykQd7URCqT7bcZXptN8GCDiZuqHS90D1tjfDYgSPm2EGhCdeDsPaAzeC5syIi5vRS4AAAAASUVORK5CYII=",Pse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAGTSURBVHgBrVJBTgJBEKyZgajxslyMoNHlBzxheQH4AFnnB/AS9AULfEB4gfxAfAGbSMR4YT2YkMjM2DOsAu5y0j5Nerqrqqsb+GOwn1f0HECIGhQbQpbj3Opo6kEc3ECtYsiLoU3x9cesBlGIYOBT5mEvHT98hNE+RLGLaB5sAAQPYNQIYaUNxjzHlGFfeE5veN52tVxvAaijHphoYDCfpkyNLPuScgQ+eF24Ws17ux44lrm/VkRjWBbGL12TUU+uSaEOLBPIaoKMidsxeCGZCMFZByuRkNwITPfRqtxmhOUCMEYStcR1eQx5MgE3HRgT5JXmA2j9TnNsjFypxI2SEwXkh2WlVc0kYDxw3qVh+3mFv0y06zumPat7aryjTJO8IHYzIbEhtLoCPuOsidZ9e0Aslal43c2+A/5Gx6bpyGg8www0bYQuNj0k0ySoMVqnJVeAjyQrthjTH2gTPikauR58m8jYhKQG6M9oTYQuq3GmX5askUla06CyeANg18V1hw4nXh/LnnB/BMJBKz4b4j/iC810lwIQoQuHAAAAAElFTkSuQmCC",Ise="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAQDSURBVHgB7VddUttIEO4eicBullrfYKUEjN9WOQH2CQInCJwgpgKp2iebp60FU5AThJwA7wlMToB42TI/WxIniB+SSkjk6XTP+N+ykUPekq/K1kjz981099czAD86cJbGS1f7RVS0hkqtckePP+U6VS3+hVrrc9JYv17eOc06ZiYCheu9DXKwws09yASKdZt2r5ZeHt/VciqBQvS3p8E9QcCg07yFoF9x4RQgiZv+X7F89aLD3AIkQVvjmlL4lAl4XSIISanbbiYC+ZvaM9RwBGabkQfSm00/29YWooMNAqgIERLztGHzcmm7nplA/vqfNXScE/Oi4dWtcqqxv9WCGRDwrnzU7SooeC7vpGDj8o/tN3cSkG0nmDvjYg417TYf71ThHihE+1UCrMhOKPjyZNQcarQDgduQyWXl951cwGaryli80pyGuZPR+iEC4u3W0zGWbYfvhF/MWOJHECybOfoYMsFKtB8JAQ24eeW/OIYMyEcH4mwBWk2o34LzJs1f2BRFNkVDIuPC3/HHCCxxA8c0QG7wwr9rYi+q5ubhN9nSItvtnAduAeKqTHAL7pM0EitR7R2IbyVUanbEqmcCh2NYnlrTv5ABC7Ao7YsSnhePtoOLRztcppLs4AOdlNP6EJBoCLSVnWuIAJf+tESoDhnQZBM5oNmr+2rX0YkQkXclBcoIGD8VrA5868Go3SfXDWECZNsfX9d67P/zX4bsN+XlaC8YaDZFL9xY/snmkTECJrFME5wH8LDhOnBSiA7NAPkbcUA8VIBFeRcy/ChqVMdp/Zv+VixP7CexcR2YBAlRmxNoSwZa+X+/zEJVFbFirz4SARMyvLowawSNEjAr98xA4yBHPQOitzKZvDuKTg2ZjliJwvHk65/BKcEEiDybsQbM5A7Ux9JmIXG9TnkciL93i2J/foTLl3vBVd6U4dLfnurA7zljcqgDEp13v/V3QMNb81DpHswhJPVBgQ8l3W+SMdWcOhtVt0nohTphOEaATzqWvcLnaZ1/BfdIRIpcbLCgNPJR7YzT9bGY5Yszlyl0QdFTS6Qf6iNSfBBJDh9UqkGIDW8h2dAEspIWx3tokk0G2FOVej2qtEME7EGCXk+T02+Ble2HZ2l5ZigMm7YilIbzkFTgO2EeFivdLDsaomM6gOCsgwkTLNtMdz9YsaKyPU+q0vh8KeibQkBHbI7dWc1ht32xM7mJ/fW0MJ18KI1qa1wpJHKzHLMFcn9wXOmLnl15e2swaWUiIBDNJ9CNwWO2pGu5fCTuhzD2qz31dFnAlCsXFrPiruKFik3azQEzE+gT6R+zIRMw1gC7WXLCTFczOVaZywdSwMrF5wfqZDVssSDdsD6cco6oZ70//ITgK/Em0VGPKx5xAAAAAElFTkSuQmCC",Fse="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAALcSURBVHgB7VddTttAEP7GUFqpD/gGmBPgG7BwgXKD8lKphUqkJyicgFQqtFIfoDeg7wiWE9ScoOYGfubH22/WNiXJJg5JpL5kJGfj7O7sN7vfNzsB5vafTdoGmPcuiSIYfk35LDtBwklJaKwDcnEo+PW6dMhwj9z+kAzPBcBFDRfdYu9bvsYj5t/U7cqwAc4RFGDLEgf2u+StAMyuO4yATv1aMKxrthpFVmpbogg58nM7LsYtkoUIiSv9jhmusP5kSPfiSD4NBfC4OFHz+VK+xKntSoEpTEFFt343P6M6uh4QPQA2d13OZqV8wOqwKKcAkkR3+KPBXRzLavN7FBosCzgx71yKGZlySu5wEupbDP3IbTGyhN8buy4jq6/IaDsOo58smNBJGgkMVbMulYIwHgA9f+CAz7YogSpHe1jyR6QjcpVbwFcslWKSvmDU5xU/T/my3w6AxjM61Ql6bgv3SMloA41CvPOheaC2G0ovkwpkVi7hrCEyA9gfC0BjnJijcnTW3+e3+am9ojwnUMwgABmZeP6Bm0wlywB6QIZUEJN8l7NWgfpEIKvOVTBXQUgFifngOvabdEdNfK4KeNHp1a7Xdj4aAI21wOHGjttzyoU7ZOOSb2BRLWYEWy7CGyV2aEwIgK8BpGLvSU2+gmBUEdeodJyHl/Tc0Chj7qRBLbtHIgrW2gGwpCIJjdlxKZPEFqqiYk2q1mB8K/yiESz92PMjsfV13wKgNnvst/1x6xXQYoSYpVVCx/FAxtRaUFBIhOLhnsc2JkeCqVjPrt9BDWhiU0mTTy2pWLzcYkZxyYi3fY03pamPTaqKBUmTin/1Ltlnmx9dl9u517yTfLZOx77Mxmum5CF697nhAXH0wqfe1FXcSdHcAawzya/OSAA16oSI99mpFW2C4ZbX7agxSsaflPbZ+Vex/Z3tf0xIvqbM5m6kUkksCQ7mPeL/B4g/54yEtbMubuc2c/sLg9ZbCNLMNG0AAAAASUVORK5CYII=";var Rse=Object.defineProperty,Bse=(e,t,n)=>t in e?Rse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yn=(e,t,n)=>Bse(e,typeof t!="symbol"?t+"":t,n),bf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function p9(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var N6={exports:{}},ru={};/**
|
|
626
626
|
* @license React
|
|
627
627
|
* react-jsx-runtime.production.min.js
|
|
628
628
|
*
|
package/database.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as L,jsx as n,Fragment as de}from"react/jsx-runtime";import{useState as F,useMemo as W,useRef as q,useEffect as De}from"react";import{J as R,i as me,m as be}from"./assets/index-BtzZe0dg.js";import{a as ye,T as Fe,W as Ie}from"./assets/index-C0f77Ai0.js";import{M as $}from"./assets/index-Cqand6Yl.js";/* empty css */import{M as K,s as J}from"./assets/index-D1PtBLCr.js";import"react-dom";const Ee=({url:m,token:v,role:B,eventsEmit:E})=>{const c=ye.create({baseURL:m,timeout:1e6});return c.interceptors.request.use(e=>{let t=v;return!t&&!["user/login","user/kaptcha","user/regist"].some(u=>e.url.includes(u))?(E&&E("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(e.headers.Authorization=t||"",e.headers.userName=B==="\u672A\u767B\u5F55\u7528\u6237"?"":B,e)}),c.interceptors.response.use(e=>{const t=["user/kaptcha"],i=e.data;if(t.some(g=>e.config.url&&e.config.url.includes(g))||i.size&&i.type)return i;const{success:u,errorMsg:b,errorCode:D}=i;return u?i:(E&&E("request:error_business",{errorCode:D,errorMsg:b||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:i}),!1)},async e=>{var t,i,u,b,D,g,C,h,w;if(e.message==="canceled")return Promise.reject(e);if(E){let d="request:error_network",j={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:e};((t=e==null?void 0:e.response)==null?void 0:t.status)===401?(d="request:error_auth",j={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:e,redirect:"/login"}):(((u=(i=e==null?void 0:e.response)==null?void 0:i.data)==null?void 0:u.errorCode)==="30013"||((D=(b=e==null?void 0:e.response)==null?void 0:b.data)==null?void 0:D.errorCode)==="30023")&&(d="request:error_business",j={errorCode:(C=(g=e==null?void 0:e.response)==null?void 0:g.data)==null?void 0:C.errorCode,errorMsg:((w=(h=e==null?void 0:e.response)==null?void 0:h.data)==null?void 0:w.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:e}),E(d,j)}return console.log("Error occurs",e),Promise.reject(e)}),{getDatabaseList:async e=>{try{const t=await c.get(`/queryPageDBList?${new URLSearchParams(e).toString()}`),{success:i,data:u}=t;if(i)return u}catch(t){console.log("getDatabaseList error:",t)}},getShareDatabaseList:async e=>{try{const t=await c.get(`/queryShareDBList?${new URLSearchParams(e).toString()}`),{success:i,data:u}=t;if(i)return u}catch(t){console.log("getShareDatabaseList error:",t)}},delDatabaseById:async(e,t)=>{const i=O(t);try{const u=await c.delete(`/${i}/deleteDB/${e}`),{success:b,data:D}=u;if(b)return D}catch(u){console.log("delDatabaseById error:",u)}},saveDatabase:async(e,t)=>{const i=O(t);try{const u=await c.post(`/${i}/saveDBInfo`,e),{success:b,data:D}=u;if(b)return D}catch(u){console.log("saveDatabase error:",u)}},testConnection:async e=>{try{const t=await c.post("/directDB/testConnect",e),{success:i,data:u}=t;if(i)return u}catch(t){console.log("testConnection error:",t)}},syncSchema:async e=>{try{const t=await c.get(`/directDB/syncSchema/${e}`),{success:i,data:u}=t;if(i)return u}catch(t){console.log("syncSchema error:",t)}}}},O=m=>m=="DataTable"?"dataTable":"directDB",ge="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCAzNiAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xNCAxMkMxNCAxMC44OTU0IDE0Ljg5NTQgMTAgMTYgMTBIMjlDMzEuMjA5MSAxMCAzMyAxMS43OTA5IDMzIDE0VjI2QzMzIDMwLjQxODMgMjkuNDE4MyAzNCAyNSAzNEgxNkMxNC44OTU0IDM0IDE0IDMzLjEwNDYgMTQgMzJWMTJaIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfNDQ3Ml8xODA1MikiLz4NCjxmb3JlaWduT2JqZWN0IHg9Ii0xIiB5PSItMSIgd2lkdGg9IjMyIiBoZWlnaHQ9IjM2Ij48ZGl2IHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIiBzdHlsZT0iYmFja2Ryb3AtZmlsdGVyOmJsdXIoMnB4KTtjbGlwLXBhdGg6dXJsKCNiZ2JsdXJfMF80NDcyXzE4MDUyX2NsaXBfcGF0aCk7aGVpZ2h0OjEwMCU7d2lkdGg6MTAwJSI+PC9kaXY+PC9mb3JlaWduT2JqZWN0PjxnIGRhdGEtZmlnbWEtYmctYmx1ci1yYWRpdXM9IjQiPg0KPHBhdGggZD0iTTMgN0MzIDQuNzkwODYgNC43OTA4NiAzIDcgM0gyM0MyNS4yMDkxIDMgMjcgNC43OTA4NiAyNyA3VjE5QzI3IDI1LjYyNzQgMjEuNjI3NCAzMSAxNSAzMUg3QzQuNzkwODYgMzEgMyAyOS4yMDkxIDMgMjdWN1oiIGZpbGw9IndoaXRlIiBmaWxsLW9wYWNpdHk9IjAuNDYiLz4NCjxwYXRoIGQ9Ik03IDMuMjVIMjNDMjUuMDcxMSAzLjI1IDI2Ljc1IDQuOTI4OTMgMjYuNzUgN1YxOUMyNi43NSAyNS40ODkzIDIxLjQ4OTMgMzAuNzUgMTUgMzAuNzVIN0M0LjkyODkzIDMwLjc1IDMuMjUgMjkuMDcxMSAzLjI1IDI3VjdDMy4yNSA0LjkyODkzIDQuOTI4OTMgMy4yNSA3IDMuMjVaIiBzdHJva2U9IndoaXRlIiBzdHJva2Utb3BhY2l0eT0iMC4zNCIgc3Ryb2tlLXdpZHRoPSIwLjUiLz4NCjwvZz4NCjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIxX2RfNDQ3Ml8xODA1MikiPg0KPHBhdGggZD0iTTE0IDE5VjExLjY2NjciIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMS44Mzk3MiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+DQo8cGF0aCBkPSJNMTEgMTRMMTIgMTNMMTQgMTFMMTYgMTNMMTcgMTQiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+DQo8cGF0aCBkPSJNMTAgMjJIMTgiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+DQo8L2c+DQo8ZGVmcz4NCjxjbGlwUGF0aCBpZD0iYmdibHVyXzBfNDQ3Ml8xODA1Ml9jbGlwX3BhdGgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiPjxwYXRoIGQ9Ik0zIDdDMyA0Ljc5MDg2IDQuNzkwODYgMyA3IDNIMjNDMjUuMjA5MSAzIDI3IDQuNzkwODYgMjcgN1YxOUMyNyAyNS42Mjc0IDIxLjYyNzQgMzEgMTUgMzFIN0M0Ljc5MDg2IDMxIDMgMjkuMjA5MSAzIDI3VjdaIi8+DQo8L2NsaXBQYXRoPjxmaWx0ZXIgaWQ9ImZpbHRlcjFfZF80NDcyXzE4MDUyIiB4PSI1IiB5PSI2IiB3aWR0aD0iMTgiIGhlaWdodD0iMjEiIGZpbHRlclVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj4NCjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+DQo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4NCjxmZU9mZnNldC8+DQo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIyIi8+DQo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4NCjxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwLjM5NjA3OCAwIDAgMCAwIDAuOTg0MzE0IDAgMCAwIDAuNCAwIi8+DQo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd180NDcyXzE4MDUyIi8+DQo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd180NDcyXzE4MDUyIiByZXN1bHQ9InNoYXBlIi8+DQo8L2ZpbHRlcj4NCjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl80NDcyXzE4MDUyIiB4MT0iMjMuNSIgeTE9IjEwIiB4Mj0iMjMuNSIgeTI9IjM0IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+DQo8c3RvcCBzdG9wLWNvbG9yPSIjNjRBMEZEIi8+DQo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMTVBRkYiLz4NCjwvbGluZWFyR3JhZGllbnQ+DQo8L2RlZnM+DQo8L3N2Zz4NCg==",Me=""+new URL("assets/database_connect.svg",import.meta.url).href,pe=""+new URL("assets/mysql.svg",import.meta.url).href,fe=""+new URL("assets/SQLServer.png",import.meta.url).href,Ae=""+new URL("assets/PostgreSQL.png",import.meta.url).href,Ce=""+new URL("assets/Doris.png",import.meta.url).href,he=[{label:"MySQL",value:"MySQL",icon:pe},{label:"PostgreSQL",value:"PostgreSQL",icon:Ae},{label:"SQLServer",value:"SQLServer",icon:fe},{label:"Doris",value:"Doris",icon:Ce}],Be=({drawerTitle:m,drawerVisible:v,isConnectSuccess:B,handleDrawerClose:E,dbInfo:c,dbType:l,eventsEmit:p})=>{const[Q,V]=F(!1),[G,N]=F(!1),[e,t]=F({}),[i,u]=F(!1),b=W(()=>({id:l,layout:"vertical",formWidth:"500px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",counter:150,required:!1,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""}]}),[l,c]),D=W(()=>({id:l,layout:"vertical",formWidth:"470px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",required:!1,counter:150,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""},{id:"db-info",label:"\u76F4\u8FDE\u6570\u636E\u6E90\u4FE1\u606F",type:"title",level:2},{id:"dbType",name:"dbType",label:"\u6570\u636E\u6E90\u7C7B\u578B",type:"select",disabled:!!c,required:!0,options:he.map(a=>{const{label:r,value:M,icon:k}=a;return{label:r,value:M,render:()=>L("div",{className:"flex items-center gap-2",children:[n("img",{src:k,width:24}),n("span",{children:r})]})}})},{id:"dbHost",name:"dbHost",label:"\u4E3B\u673A\u5730\u5740",type:"input",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165IP\u5730\u5740\u6216\u8005\u57DF\u540D"},{id:"dbPort",name:"dbPort",label:"\u7AEF\u53E3\u53F7",type:"number",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7AEF\u53E3\u540D\u79F0"},{id:"dbDatabase",name:"dbDatabase",label:"\u8FDE\u63A5\u6570\u636E\u5E93\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u8FDE\u63A5\u6570\u636E\u5E93\u540D",required:!0,type:"input"},{type:"col",children:[{id:"dbUser",type:"input",name:"dbUser",label:"\u7528\u6237\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",required:!0},{id:"dbPassword",type:"password",name:"dbPassword",label:"\u5BC6\u7801",placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801",required:!0,disabled:i?!1:!!c}]}]}),[l,c,i]),g=q(null),C=(a,r,M)=>{switch(console.log("[Form] eventsEmit:",a,r,M),a){case"form:ready":r.formRef&&(g.current=r.formRef);break;case"form_field_change":console.log("\u5B57\u6BB5\u503C\u53D8\u5316:",r),t(k=>({...k,[r.fieldId]:r.value}));break;case"form_validation_error":console.log("\u8868\u5355\u9A8C\u8BC1\u9519\u8BEF:",r);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",a,r)}p==null||p(a,r,M)},h=async()=>{try{V(!0);const a=await g.current.getAllData();a.isValid&&(console.log(a,"==="),l=="DirectDB"&&m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!i&&(a.fields=a.fields.filter(r=>r.name=="name"||r.name=="description")),await p("form_submitted",a,void 0),u(!1))}catch(a){console.error("\u274C \u63D0\u4EA4\u8868\u5355\u6570\u636E\u5931\u8D25:",a)}finally{V(!1)}},w=async()=>{try{N(!0);const a=await g.current.getAllData();if(a.isValid){const r=a.fields.reduce((M,k)=>(M[k.name]=k.value,M),{});await p("form:connect_test",r,void 0)}}catch{N(!1)}finally{N(!1)}},d=W(()=>{const a=l=="DataTable"?b:D;return{label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:a.id,model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:a.id,type:"form",size:"md",formWidth:a.formWidth,formConfig:{layout:a.layout,showReset:!1,showSubmit:!1,formWidth:a.formWidth,getFormData:()=>({...e,timestamp:new Date().toISOString(),formId:a.id}),onFieldChange:(r,M)=>{C("form_field_change",{fieldId:r,value:M},void 0)},onValidationError:r=>{C("form_validation_error",r,void 0)}}}],dataSource:[{id:a.id,fields:a.fields,defaultValues:{...c}}],eventsEmit:C}},[l,b,D,v,c]),j=W(()=>l=="DirectDB"?c?i&&!B:!B:!1,[l,B,i,v]);return L(K,{title:m,width:620,onCancel:()=>{E(),u(!1)},open:v,destroyOnHidden:!0,footer:L("div",{className:"flex justify-end gap-3",children:[n(R,{mode:"default",label:"\u53D6\u6D88",onClick:()=>{E(),u(!1)}}),n(R,{mode:"primary",label:"\u786E\u8BA4",loading:Q,disabled:j,onClick:h})]}),children:[n($,{...d},"example-form"),l==="DirectDB"&&n(de,{children:m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!i?n(R,{mode:"primary",className:"mt-[10px]",label:"\u4FEE\u6539\u5BC6\u7801",onClick:()=>{u(!0),g.current.setValues({dbPassword:void 0})}}):n(Fe,{title:"\u9700\u901A\u8FC7\u6D4B\u8BD5\u624D\u53EF\u521B\u5EFA\u6210\u529F",children:n(R,{mode:"primary",className:"mt-[10px]",label:"\u8FDE\u63A5\u6D4B\u8BD5",loading:G,onClick:w})})})]})},Ne=""+new URL("assets/empty.png",import.meta.url).href,{confirm:we}=K,je=Ie.div`
|
|
1
|
+
import{jsxs as Z,jsx as l,Fragment as de}from"react/jsx-runtime";import{useState as y,useMemo as T,useRef as q,useEffect as De}from"react";import{J as Q,i as me,m as ge}from"./assets/index-DhczpnL_.js";import{a as be,T as ye,d as Ee}from"./assets/index-OjluyvX1.js";import{E as K}from"./assets/index-D4NnOWbo.js";import{M as $,s as H}from"./assets/style-bUXwVVWZ.js";/* empty css */import"react-dom";const Fe=({url:m,token:z,role:B,eventsEmit:F})=>{const c=be.create({baseURL:m,timeout:1e6});return c.interceptors.request.use(e=>{let t=z;return!t&&!["user/login","user/kaptcha","user/regist"].some(u=>e.url.includes(u))?(F&&F("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(e.headers.Authorization=t||"",e.headers.userName=B==="\u672A\u767B\u5F55\u7528\u6237"?"":B,e)}),c.interceptors.response.use(e=>{const t=["user/kaptcha"],r=e.data;if(t.some(p=>e.config.url&&e.config.url.includes(p))||r.size&&r.type)return r;const{success:u,errorMsg:g,errorCode:D}=r;return u?r:(F&&F("request:error_business",{errorCode:D,errorMsg:g||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:r}),!1)},async e=>{var t,r,u,g,D,p,A,h,N;if(e.message==="canceled")return Promise.reject(e);if(F){let d="request:error_network",v={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:e};((t=e==null?void 0:e.response)==null?void 0:t.status)===401?(d="request:error_auth",v={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:e,redirect:"/login"}):(((u=(r=e==null?void 0:e.response)==null?void 0:r.data)==null?void 0:u.errorCode)==="30013"||((D=(g=e==null?void 0:e.response)==null?void 0:g.data)==null?void 0:D.errorCode)==="30023")&&(d="request:error_business",v={errorCode:(A=(p=e==null?void 0:e.response)==null?void 0:p.data)==null?void 0:A.errorCode,errorMsg:((N=(h=e==null?void 0:e.response)==null?void 0:h.data)==null?void 0:N.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:e}),F(d,v)}return console.log("Error occurs",e),Promise.reject(e)}),{getDatabaseList:async e=>{try{const t=await c.get(`/queryPageDBList?${new URLSearchParams(e).toString()}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("getDatabaseList error:",t)}},getShareDatabaseList:async e=>{try{const t=await c.get(`/queryShareDBList?${new URLSearchParams(e).toString()}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("getShareDatabaseList error:",t)}},delDatabaseById:async(e,t)=>{const r=O(t);try{const u=await c.delete(`/${r}/deleteDB/${e}`),{success:g,data:D}=u;if(g)return D}catch(u){console.log("delDatabaseById error:",u)}},saveDatabase:async(e,t)=>{const r=O(t);try{const u=await c.post(`/${r}/saveDBInfo`,e),{success:g,data:D}=u;if(g)return D}catch(u){console.log("saveDatabase error:",u)}},testConnection:async e=>{try{const t=await c.post("/directDB/testConnect",e),{success:r,data:u}=t;if(r)return u}catch(t){console.log("testConnection error:",t)}},syncSchema:async e=>{try{const t=await c.get(`/directDB/syncSchema/${e}`),{success:r,data:u}=t;if(r)return u}catch(t){console.log("syncSchema error:",t)}}}},O=m=>m=="DataTable"?"dataTable":"directDB",pe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCAzNiAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE0IDEyQzE0IDEwLjg5NTQgMTQuODk1NCAxMCAxNiAxMEgyOUMzMS4yMDkxIDEwIDMzIDExLjc5MDkgMzMgMTRWMjZDMzMgMzAuNDE4MyAyOS40MTgzIDM0IDI1IDM0SDE2QzE0Ljg5NTQgMzQgMTQgMzMuMTA0NiAxNCAzMlYxMloiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl80NDcyXzE4MDUyKSIvPgo8Zm9yZWlnbk9iamVjdCB4PSItMSIgeT0iLTEiIHdpZHRoPSIzMiIgaGVpZ2h0PSIzNiI+PGRpdiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCIgc3R5bGU9ImJhY2tkcm9wLWZpbHRlcjpibHVyKDJweCk7Y2xpcC1wYXRoOnVybCgjYmdibHVyXzBfNDQ3Ml8xODA1Ml9jbGlwX3BhdGgpO2hlaWdodDoxMDAlO3dpZHRoOjEwMCUiPjwvZGl2PjwvZm9yZWlnbk9iamVjdD48ZyBkYXRhLWZpZ21hLWJnLWJsdXItcmFkaXVzPSI0Ij4KPHBhdGggZD0iTTMgN0MzIDQuNzkwODYgNC43OTA4NiAzIDcgM0gyM0MyNS4yMDkxIDMgMjcgNC43OTA4NiAyNyA3VjE5QzI3IDI1LjYyNzQgMjEuNjI3NCAzMSAxNSAzMUg3QzQuNzkwODYgMzEgMyAyOS4yMDkxIDMgMjdWN1oiIGZpbGw9IndoaXRlIiBmaWxsLW9wYWNpdHk9IjAuNDYiLz4KPHBhdGggZD0iTTcgMy4yNUgyM0MyNS4wNzExIDMuMjUgMjYuNzUgNC45Mjg5MyAyNi43NSA3VjE5QzI2Ljc1IDI1LjQ4OTMgMjEuNDg5MyAzMC43NSAxNSAzMC43NUg3QzQuOTI4OTMgMzAuNzUgMy4yNSAyOS4wNzExIDMuMjUgMjdWN0MzLjI1IDQuOTI4OTMgNC45Mjg5MyAzLjI1IDcgMy4yNVoiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS1vcGFjaXR5PSIwLjM0IiBzdHJva2Utd2lkdGg9IjAuNSIvPgo8L2c+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIxX2RfNDQ3Ml8xODA1MikiPgo8cGF0aCBkPSJNMTQgMTlWMTEuNjY2NyIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxLjgzOTcyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTExIDE0TDEyIDEzTDE0IDExTDE2IDEzTDE3IDE0IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTAgMjJIMTgiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iYmdibHVyXzBfNDQ3Ml8xODA1Ml9jbGlwX3BhdGgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiPjxwYXRoIGQ9Ik0zIDdDMyA0Ljc5MDg2IDQuNzkwODYgMyA3IDNIMjNDMjUuMjA5MSAzIDI3IDQuNzkwODYgMjcgN1YxOUMyNyAyNS42Mjc0IDIxLjYyNzQgMzEgMTUgMzFIN0M0Ljc5MDg2IDMxIDMgMjkuMjA5MSAzIDI3VjdaIi8+CjwvY2xpcFBhdGg+PGZpbHRlciBpZD0iZmlsdGVyMV9kXzQ0NzJfMTgwNTIiIHg9IjUiIHk9IjYiIHdpZHRoPSIxOCIgaGVpZ2h0PSIyMSIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlT2Zmc2V0Lz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMiIvPgo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAuMzk2MDc4IDAgMCAwIDAgMC45ODQzMTQgMCAwIDAgMC40IDAiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfNDQ3Ml8xODA1MiIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd180NDcyXzE4MDUyIiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfNDQ3Ml8xODA1MiIgeDE9IjIzLjUiIHkxPSIxMCIgeDI9IjIzLjUiIHkyPSIzNCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjNjRBMEZEIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxNUFGRiIvPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo=",Ie=""+new URL("assets/database_connect.svg",import.meta.url).href,Me=""+new URL("assets/MySQL.svg",import.meta.url).href,fe=""+new URL("assets/SQLServer.png",import.meta.url).href,Ce=""+new URL("assets/PostgreSQL.png",import.meta.url).href,Ae=""+new URL("assets/Doris.png",import.meta.url).href,he=[{label:"MySQL",value:"MySQL",icon:Me},{label:"PostgreSQL",value:"PostgreSQL",icon:Ce},{label:"SQLServer",value:"SQLServer",icon:fe},{label:"Doris",value:"Doris",icon:Ae}],Be=({drawerTitle:m,drawerVisible:z,isConnectSuccess:B,handleDrawerClose:F,dbInfo:c,dbType:n,eventsEmit:M})=>{const[G,W]=y(!1),[R,w]=y(!1),[e,t]=y({}),[r,u]=y(!1),g=T(()=>({id:n,layout:"vertical",formWidth:"500px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",counter:150,required:!1,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""}]}),[n,c]),D=T(()=>({id:n,layout:"vertical",formWidth:"470px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",required:!1,counter:150,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""},{id:"db-info",label:"\u76F4\u8FDE\u6570\u636E\u6E90\u4FE1\u606F",type:"title",level:2},{id:"dbType",name:"dbType",label:"\u6570\u636E\u6E90\u7C7B\u578B",type:"select",disabled:!!c,required:!0,options:he.map(a=>{const{label:i,value:I,icon:x}=a;return{label:i,value:I,render:()=>Z("div",{className:"flex items-center gap-2",children:[l("img",{src:x,width:24}),l("span",{children:i})]})}})},{id:"dbHost",name:"dbHost",label:"\u4E3B\u673A\u5730\u5740",type:"input",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165IP\u5730\u5740\u6216\u8005\u57DF\u540D"},{id:"dbPort",name:"dbPort",label:"\u7AEF\u53E3\u53F7",type:"number",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7AEF\u53E3\u540D\u79F0"},{id:"dbDatabase",name:"dbDatabase",label:"\u8FDE\u63A5\u6570\u636E\u5E93\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u8FDE\u63A5\u6570\u636E\u5E93\u540D",required:!0,type:"input"},{type:"col",children:[{id:"dbUser",type:"input",name:"dbUser",label:"\u7528\u6237\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",required:!0},{id:"dbPassword",type:"password",name:"dbPassword",label:"\u5BC6\u7801",placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801",required:!0,disabled:r?!1:!!c}]}]}),[n,c,r]),p=q(null),A=(a,i,I)=>{switch(console.log("[Form] eventsEmit:",a,i,I),a){case"form:ready":i.formRef&&(p.current=i.formRef);break;case"form_field_change":console.log("\u5B57\u6BB5\u503C\u53D8\u5316:",i),t(x=>({...x,[i.fieldId]:i.value}));break;case"form_validation_error":console.log("\u8868\u5355\u9A8C\u8BC1\u9519\u8BEF:",i);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",a,i)}M==null||M(a,i,I)},h=async()=>{try{W(!0);const a=await p.current.getAllData();a.isValid&&(console.log(a,"==="),n=="DirectDB"&&m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!r&&(a.fields=a.fields.filter(i=>i.name=="name"||i.name=="description")),await M("form_submitted",a,void 0),u(!1))}catch(a){console.error("\u274C \u63D0\u4EA4\u8868\u5355\u6570\u636E\u5931\u8D25:",a)}finally{W(!1)}},N=async()=>{try{w(!0);const a=await p.current.getAllData();if(a.isValid){const i=a.fields.reduce((I,x)=>(I[x.name]=x.value,I),{});await M("form:connect_test",i,void 0)}}catch{w(!1)}finally{w(!1)}},d=T(()=>{const a=n=="DataTable"?g:D;return{label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:a.id,model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:a.id,type:"form",size:"md",formWidth:a.formWidth,formConfig:{layout:a.layout,showReset:!1,showSubmit:!1,formWidth:a.formWidth,getFormData:()=>({...e,timestamp:new Date().toISOString(),formId:a.id}),onFieldChange:(i,I)=>{A("form_field_change",{fieldId:i,value:I},void 0)},onValidationError:i=>{A("form_validation_error",i,void 0)}}}],dataSource:[{id:a.id,fields:a.fields,defaultValues:{...c}}],eventsEmit:A}},[n,g,D,z,c]),v=T(()=>n=="DirectDB"?c?r&&!B:!B:!1,[n,B,r,z]);return Z($,{title:m,width:620,onCancel:()=>{F(),u(!1)},open:z,destroyOnHidden:!0,footer:Z("div",{className:"flex justify-end gap-3",style:{justifyContent:"end"},children:[l(Q,{mode:"default",label:"\u53D6\u6D88",onClick:()=>{F(),u(!1)}}),l(Q,{mode:"primary",label:"\u786E\u8BA4",loading:G,disabled:v,onClick:h})]}),children:[l(K,{...d},"example-form"),n==="DirectDB"&&l(de,{children:m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!r?l(Q,{mode:"primary",className:"mt-[10px]",label:"\u4FEE\u6539\u5BC6\u7801",onClick:()=>{u(!0),p.current.setValues({dbPassword:void 0})}}):l(ye,{title:"\u9700\u901A\u8FC7\u6D4B\u8BD5\u624D\u53EF\u521B\u5EFA\u6210\u529F",children:l(Q,{mode:"primary",className:"mt-[10px]",label:"\u8FDE\u63A5\u6D4B\u8BD5",loading:R,onClick:N})})})]})},we=""+new URL("assets/empty.png",import.meta.url).href,{confirm:Ne}=$,ve=Ee.div`
|
|
2
2
|
width: 282px;
|
|
3
3
|
height: 81px;
|
|
4
4
|
display: flex;
|
|
@@ -17,4 +17,4 @@ import{jsxs as L,jsx as n,Fragment as de}from"react/jsx-runtime";import{useState
|
|
|
17
17
|
background-color: #F1F5FF;
|
|
18
18
|
};
|
|
19
19
|
border: 1px solid #EBEBEB
|
|
20
|
-
`,
|
|
20
|
+
`,xe=[{key:"add_file_db",label:"\u4E0A\u4F20\u6570\u636E\u5E93",dsc:"\u901A\u8FC7\u4E0A\u4F20Excel\u3001csv\u7B49\u683C\u5F0F\u6570\u636E\u8868\u521B\u5EFA\u6570\u636E\u5E93\u3002",icon:pe},{key:"add_direct_db",label:"\u76F4\u8FDE\u6570\u636E\u5E93",dsc:"\u901A\u8FC7\u4E0E\u5DF2\u6709\u4E1A\u52A1\u5EFA\u7ACB\u8FDE\u63A5\u521B\u5EFA\u6570\u636E\u5E93\u3002",icon:Ie}],We=m=>{const{url:z,token:B,role:F,CustomComponents:c,getBtnDisabled:n}=m,[M,G]=y("my-db"),[W,R]=y({app:"ready",container:"ready",content:"ready"}),[w,e]=y(!1),[t,r]=y([{id:"my-db",data:[]},{id:"shared-db",data:[]}]),u=q(null),[g,D]=y(!1),[p,A]=y(""),[h,N]=y("DataTable"),[d,v]=y(),[a,i]=y(!1),{getDatabaseList:I,delDatabaseById:x,saveDatabase:ee,testConnection:ue,getShareDatabaseList:te,syncSchema:ae}=Fe({url:z,token:B,role:F,eventsEmit:m.eventsEmit}),J=T(()=>[{label:"\u6211\u7684\u6570\u636E\u5E93",id:"my-db",type:"card",cardType:"database",rowHeight:220,viewPageSize:12,viewBehavior:"pagination",actions:[{label:"\u7F16\u8F91",key:"edit"},{label:"\u5220\u9664",key:"delete"}],toolbar:[{type:"customized",key:"add",render:()=>l(me,{mode:"primary",label:"\u521B\u5EFA\u6570\u636E\u5E93",actions:xe.map(o=>({key:o.key,component:l(ve,{children:Z("div",{className:"flex flex-grow",children:[l("div",{className:"mr-[6px]",children:l("img",{src:o.icon})}),Z("div",{children:[l("div",{className:"text-base font-bold mb-1 text-[14px]",children:o.label}),l("div",{className:"text-[#888] text-[10px]",children:o.dsc})]})]})},o.key)})),eventEmit:_})},{type:"fuzzy_search",key:"search",label:"\u8F93\u5165\u540D\u79F0\u641C\u7D22",searchKeys:["name","description"],position:"right"}]},{label:"\u5171\u4EAB\u6570\u636E\u5E93",id:"shared-db",type:"card",cardType:"database",rowHeight:240,toolbar:[{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",position:"right"}],actions:[{label:"\u7F16\u8F91",key:"edit"},{label:"\u5220\u9664",key:"delete"}]}],[t]);De(()=>{R(o=>({...o,content:"loading"})),se()},[]);const se=async()=>{var o,s,f,b;try{const[C,j]=await Promise.allSettled([I({pageNo:1,pageSize:999}),te({pageNo:1,pageSize:999})]);let L=[];if(C.status==="fulfilled"&&C.value&&(o=C.value)!=null&&o.records){const S=Y((s=C.value)==null?void 0:s.records);L.push({id:"my-db",data:S||[]})}if(j.status==="fulfilled"&&j.value&&(f=j.value)!=null&&f.records){const S=Y((b=j.value)==null?void 0:b.records);L.push({id:"shared-db",data:S||[]})}r(L),R(S=>({...S,content:"ready"}))}catch(C){console.log("[DatabaseApiError] getDatabaseList:",C)}},Y=o=>(o||[]).map(s=>{const f=U("shared-db").map((b,C)=>({...b,key:b.type==="divider"?`${b.key}_${s.id}`:b.key,disabled:n&&n(b.key=="edit"?7:4,s.permission)}));return s.datasourceType=="DirectDB"&&f.push({label:"\u540C\u6B65\u8868\u7ED3\u6784",key:"sync_schema",disabled:n&&n(7,s.permission)}),console.log("[DatabaseViewAdopter] actions:",f),{...s,actions:f||[]}}),re="admin",ie=()=>Z("div",{className:"flex flex-col items-center justify-center h-full",children:[l("div",{className:"text-xl font-semibold mb-3",style:{color:"#374151"},children:l("img",{src:we,width:120})}),l("div",{className:"text-base mb-6",style:{color:"#6b7280"},children:"\u6682\u65E0\u6570\u636E\uFF0C\u8BF7\u5148\u6DFB\u52A0\u6570\u636E\u5E93"})]}),U=o=>{const s=J.find(b=>b.id===o);return(s==null?void 0:s.actions)||[]},oe=T(()=>{var s;const o=((s=t==null?void 0:t.find(f=>f.id===M))==null?void 0:s.data)||[];return w?[]:o},[M,t,w]),X=()=>{D(!1),i(!1),v(void 0)},ce=async o=>{console.log("[DatabaseViewAdopter] \u6D4B\u8BD5\u8FDE\u63A5:",o);const s=await ue(o);return s&&(i(!0),H.success("\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F\uFF01")),s};async function _(o,s,f){var b,C,j,L,S;switch(console.log("[DatabaseViewAdopter] mergedEventsEmit",o,s),o){case"card_delete":Ne({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\u5E93\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5E93\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await x(s.id,s.datasourceType)&&(u!=null&&u.current)&&(u==null||u.current.appFn.removeItem(s.id))},onCancel(){console.log("Cancel")}});break;case"card_edit":A("\u7F16\u8F91\u6570\u636E\u5E93"),D(!0),N(s.datasourceType),delete s.render,v(s);break;case"select":G(s.id);break;case"filesDir_clicked":G(s.id);break;case"dropdown_action":A("\u521B\u5EFA\u6570\u636E\u5E93"),D(!0),s.key=="add_file_db"?N("DataTable"):N("DirectDB");break;case"form_submitted":try{const k=s.fields.reduce((P,E)=>(P[E.name]=E.value,P),{}),le=d?{id:d==null?void 0:d.id,...k}:k,V=await ee(le,h);if(V){if(d){const P={...d,...k,datasourceType:h,actions:U("my-db").map((E,ne)=>({...E,key:E.type==="divider"?`${E.key}_${V}`:E.key,allow:!0}))};(C=(b=u==null?void 0:u.current)==null?void 0:b.appFn)==null||C.updateItem(P,d==null?void 0:d.id),H.success("\u6570\u636E\u5E93\u7F16\u8F91\u6210\u529F\uFF01")}else{const P={...k,...V,createBy:re,datasourceType:h,actions:U("my-db").map((E,ne)=>({...E,key:E.type==="divider"?`${E.key}_${V}`:E.key,allow:!0}))};(L=(j=u==null?void 0:u.current)==null?void 0:j.appFn)==null||L.addItem(P,{animate:!0,position:"start"}),H.success("\u6570\u636E\u5E93\u521B\u5EFA\u6210\u529F\uFF01")}return V}}catch(k){console.error("\u4FDD\u5B58\u5931\u8D25\uFF01",k)}finally{X()}break;case"form:connect_test":return await ce(s);case"toolbar_test_empty":console.log("[DatabaseViewAdopter] toolbar_test_empty \u4E8B\u4EF6\u89E6\u53D1"),e(!w);break;case"card_sync_schema":await ae(s.id)&&(i(!0),H.success("\u540C\u6B65\u8868\u7ED3\u6784\u6210\u529F\uFF01"));break;default:(S=m.eventsEmit)==null||S.call(m,o,s);break}}return Z(ge,{title:"\u6570\u636E\u5E93\u7BA1\u7406",children:[l(K,{ref:u,label:"",model:"tabs",defaultActiveId:M,views:J,dataSource:oe,eventsEmit:_,status:W,CustomComponents:{EmptyData:ie,...c},styles:m.styles},"db"),l(Be,{drawerTitle:p,drawerVisible:g,isConnectSuccess:a,dbType:h,dbInfo:d,handleDrawerClose:X,eventsEmit:_})]})};export{We as default};
|
package/databaseId.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare interface DatabaseViewAdopterProps {
|
|
|
12
12
|
id: string;
|
|
13
13
|
styles?: Styles;
|
|
14
14
|
dbType: 'DataTable' | 'DirectDB';
|
|
15
|
+
uploadUrl: string;
|
|
15
16
|
CustomComponents?: CustomComponents;
|
|
16
17
|
eventsEmit?: (name: string, data: any) => void;
|
|
17
18
|
getBtnDisabled?: (type: OPT_BTN, permission: number) => boolean;
|
package/databaseId.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"react/jsx-runtime";import"react";import"./assets/index-CpW6Dhpp.js";import"./assets/index-
|
|
1
|
+
import"react/jsx-runtime";import"react";import"./assets/index-CpW6Dhpp.js";import"./assets/index-DhczpnL_.js";import"./assets/index-OjluyvX1.js";import"./assets/index-D4NnOWbo.js";/* empty css */import"./assets/style-bUXwVVWZ.js";import{D as g}from"./assets/index-tplNfcnA.js";import"react-dom";import"./assets/index-CFqsgVcx.js";import"./assets/index-Di5Ga230.js";import"./assets/index-B0fJUyM7.js";import"./assets/index-6Ox5f3GI.js";import"./assets/x-C7NWGGXn.js";import"./assets/index-BmVOh6oe.js";export{g as default};
|