@next-bricks/ai-portal 0.22.3 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +15 -14
- package/dist/chunks/3561.79095c66.js +3 -0
- package/dist/chunks/3561.79095c66.js.map +1 -0
- package/dist/chunks/ai-employees.b5da4b83.js +3 -0
- package/dist/chunks/ai-employees.b5da4b83.js.LICENSE.txt +5 -0
- package/dist/chunks/ai-employees.b5da4b83.js.map +1 -0
- package/dist/chunks/{main.1391ad2c.js → main.80b0c68f.js} +2 -2
- package/dist/chunks/{main.1391ad2c.js.map → main.80b0c68f.js.map} +1 -1
- package/dist/examples.json +12 -9
- package/dist/images/0cbe181e.png +0 -0
- package/dist/images/4215203f.png +0 -0
- package/dist/images/5e54ffc5.png +0 -0
- package/dist/images/87c8a33b.png +0 -0
- package/dist/images/8c2cf79e.png +0 -0
- package/dist/images/8e5c445f.png +0 -0
- package/dist/images/dd5fc700.png +0 -0
- package/dist/images/f542faa9.png +0 -0
- package/dist/index.431f28b5.js +2 -0
- package/dist/index.431f28b5.js.map +1 -0
- package/dist/manifest.json +82 -62
- package/dist/types.json +87 -2
- package/dist-types/ai-employees/i18n.d.ts +15 -0
- package/dist-types/ai-employees/index.d.ts +21 -0
- package/dist-types/ai-employees/index.spec.d.ts +1 -0
- package/dist-types/bootstrap.d.ts +1 -0
- package/docs/ai-employees.md +11 -0
- package/package.json +2 -2
- package/dist/chunks/9543.929397fe.js +0 -3
- package/dist/chunks/9543.929397fe.js.map +0 -1
- package/dist/index.fbf870e3.js +0 -2
- package/dist/index.fbf870e3.js.map +0 -1
- /package/dist/chunks/{9543.929397fe.js.LICENSE.txt → 3561.79095c66.js.LICENSE.txt} +0 -0
package/dist/bricks.json
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
"id": "bricks/ai-portal",
|
|
3
3
|
"bricks": [
|
|
4
4
|
"ai-portal.chat-box",
|
|
5
|
-
"ai-portal.cruise-canvas",
|
|
6
5
|
"ai-portal.chat-history",
|
|
7
|
-
"ai-portal.elevo-logo",
|
|
8
|
-
"ai-portal.stat-with-mini-chart",
|
|
9
6
|
"ai-portal.home-container",
|
|
7
|
+
"ai-portal.cruise-canvas",
|
|
8
|
+
"ai-portal.stat-with-mini-chart",
|
|
9
|
+
"ai-portal.elevo-logo",
|
|
10
10
|
"ai-portal.elevo-sidebar",
|
|
11
|
+
"ai-portal.icon-button",
|
|
11
12
|
"ai-portal.show-cases",
|
|
12
13
|
"ai-portal.mcp-tools",
|
|
13
|
-
"ai-portal.
|
|
14
|
+
"ai-portal.ai-employees",
|
|
14
15
|
"ai-portal.chat-stream"
|
|
15
16
|
],
|
|
16
17
|
"elements": [],
|
|
@@ -20,6 +21,11 @@
|
|
|
20
21
|
"ai-portal.chat-box": [
|
|
21
22
|
"eo-icon"
|
|
22
23
|
],
|
|
24
|
+
"ai-portal.chat-history": [
|
|
25
|
+
"eo-icon",
|
|
26
|
+
"eo-link",
|
|
27
|
+
"eo-mini-actions"
|
|
28
|
+
],
|
|
23
29
|
"ai-portal.cruise-canvas": [
|
|
24
30
|
"eo-icon",
|
|
25
31
|
"eo-button",
|
|
@@ -32,11 +38,6 @@
|
|
|
32
38
|
"basic.copy-to-clipboard",
|
|
33
39
|
"eo-easyops-avatar"
|
|
34
40
|
],
|
|
35
|
-
"ai-portal.chat-history": [
|
|
36
|
-
"eo-icon",
|
|
37
|
-
"eo-link",
|
|
38
|
-
"eo-mini-actions"
|
|
39
|
-
],
|
|
40
41
|
"ai-portal.stat-with-mini-chart": [
|
|
41
42
|
"eo-mini-line-chart"
|
|
42
43
|
],
|
|
@@ -48,16 +49,16 @@
|
|
|
48
49
|
"eo-mini-actions",
|
|
49
50
|
"ai-portal.icon-button"
|
|
50
51
|
],
|
|
52
|
+
"ai-portal.icon-button": [
|
|
53
|
+
"eo-icon",
|
|
54
|
+
"eo-tooltip"
|
|
55
|
+
],
|
|
51
56
|
"ai-portal.show-cases": [
|
|
52
57
|
"eo-link"
|
|
53
58
|
],
|
|
54
59
|
"ai-portal.mcp-tools": [
|
|
55
60
|
"eo-icon"
|
|
56
61
|
],
|
|
57
|
-
"ai-portal.icon-button": [
|
|
58
|
-
"eo-icon",
|
|
59
|
-
"eo-tooltip"
|
|
60
|
-
],
|
|
61
62
|
"ai-portal.chat-stream": [
|
|
62
63
|
"eo-icon",
|
|
63
64
|
"eo-button",
|
|
@@ -70,5 +71,5 @@
|
|
|
70
71
|
"basic.copy-to-clipboard"
|
|
71
72
|
]
|
|
72
73
|
},
|
|
73
|
-
"filePath": "bricks/ai-portal/dist/index.
|
|
74
|
+
"filePath": "bricks/ai-portal/dist/index.431f28b5.js"
|
|
74
75
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 3561.79095c66.js.LICENSE.txt */
|
|
2
|
+
"use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[3561],{24:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s)()(a());r.push([e.id,':host{display:block;white-space:nowrap}.container{border-radius:var(--elevo-border-radius)}:host([hidden]){display:none}*{box-sizing:border-box}.label{font-weight:500;overflow:hidden;text-overflow:ellipsis}.stat{font-weight:600}.chart{min-width:0}.chart > *{display:block}:host(:not([size="small"])) .container{background:linear-gradient(164deg,rgba(105,153,253,0) 40%,rgba(105,153,253,0.05) 60%,rgba(105,153,253,0.32) 100%),#fff;padding:22px}:host(:not([size="small"])) .label{font-size:14px;height:22px;margin-bottom:16px}:host(:not([size="small"])) .stat-and-chart{display:flex;align-items:center;justify-content:end;position:relative}:host(:not([size="small"])) .stat{font-size:36px;color:#1d212a;position:absolute;left:0}:host(:not([size="small"])) .chart{width:calc(100% - 160px)}:host([size="small"]) .container{padding:11px 15px;display:flex;align-items:center;justify-content:end;position:relative;background:var(--elevo-component-background);-webkit-backdrop-filter:var(--elevo-component-backdrop-filter);backdrop-filter:var(--elevo-component-backdrop-filter)}:host([size="small"]) .label-and-stat{position:absolute;left:15px}:host([size="small"]) .label{font-size:12px;color:#8c8c8c;line-height:17px;height:17px;margin-bottom:7px}:host([size="small"]) .stat{font-size:20px;color:#262626;line-height:24px}:host([size="small"]) .chart{width:calc(100% - 90px)}',""]);const o=r.toString()},15733:(e,t,i)=>{e.exports=i.p+"images/4b299d0b.png"},21411:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s)()(a());r.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}ul{list-style:none;margin:0;padding:0}.loading{display:flex;justify-content:center;padding:8px}.group + .group{margin-top:15px}.group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.item{display:block}.item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.item::part(link):hover{background:rgba(0,0,0,0.04)}.item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.actions{cursor:auto}.item:not(:hover):not(.active) .actions{display:none}.working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.item:hover .working,\n.item.active .working{display:none}.load-more{display:flex;justify-content:center;align-items:center;height:36px}",""]);const o=r.toString()},31653:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s)()(a());r.push([e.id,":host{display:inline-block;padding:3px 0}:host([hidden]){display:none}img{display:block}",""]);const o=r.toString()},31748:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s),o=i(20062),l=i.n(o),c=new URL(i(15733),i.b),d=r()(a()),u=l()(c);d.push([e.id,`:host{display:block;position:relative;width:100%;height:100%;overflow:hidden;background-color:rgb(205,206,207);background-image:url(${u});background-size:cover;background-repeat:no-repeat;background-position:center;background-attachment:fixed;color:#262626;padding:48px 24px;overflow-y:auto}:host([hidden]){display:none}*{box-sizing:border-box}.container{max-width:1400px;margin:0 auto}h1,\nh2{font-weight:500;margin:0}h1{font-size:20px;line-height:28px}h2{font-size:16px;line-height:22px}.nav,\n.groups,\n.list{list-style:none;margin:0;padding:0}.nav{display:flex;font-size:16px;margin-top:17px}.nav .item + .item{margin-left:32px}.nav .item a{color:rgba(38,38,38,0.65);cursor:pointer}.nav .item a.active{color:#262626;font-weight:500}.nav .item a.active::after{content:"";display:block;width:100%;height:4px;background-color:currentColor;border-radius:2px}.groups{margin-top:27px}.group + .group{margin-top:32px}.list{margin-top:16px;display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:24px}.list .item{background:rgba(255,255,255,0.9);box-shadow:0px 2px 5px 0px rgba(0,0,0,0.08);border-radius:12px;padding:20px 26px}.heading{display:flex;align-items:center}.icon{font-size:24px;color:#333;margin-right:8px}.title{font-size:15px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.description{margin-top:13px;font-size:13px;color:rgba(0,0,0,0.45);line-height:18px;height:54px;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}`,""]);const p=d.toString()},32360:(e,t,i)=>{e.exports=i.p+"images/6336f999.png"},42873:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s),o=i(20062),l=i.n(o),c=new URL(i(89518),i.b),d=r()(a()),u=l()(c);d.push([e.id,`:host{display:flex;flex-direction:column;align-items:center;max-width:1200px;width:100%}:host([hidden]){display:none}*{box-sizing:border-box}.nav,\n.cases{list-style:none;padding:0;margin:0}.nav{display:flex;font-size:16px}.nav .item + .item{margin-left:32px}.nav .item a{color:rgba(38,38,38,0.65);cursor:pointer}.nav .item a.active{color:#262626;font-weight:500}.nav .item a.active::after{content:"";display:block;width:100%;height:4px;background-color:currentColor;border-radius:2px}.cases{display:grid;width:100%;grid-template-columns:repeat(auto-fill,minmax(276px,1fr));gap:24px;margin-top:2em}.link{background:#fefefe;border:1px solid #e8e9ec;border-radius:12px;overflow:hidden;display:block}.link::part(link){display:flex;gap:0;flex-direction:column;height:218px}.title{width:100%;height:76px;padding:16px 16px 15px;color:#262626;border-top:1px solid #e8e9ec;font-weight:500;font-size:15px;line-height:22px}.title span{display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.placeholder{width:100%;height:142px;background:linear-gradient(308deg,#dee9fc 0%,#fcfbfd 100%,#fbf9fe 100%);overflow:hidden}.summary{color:rgba(0,0,0,0.65);padding:27px 0 0 24px}.thumbnail span{display:block;width:100%;height:100%;background-size:cover;background-position:center;background-repeat:no-repeat}.link:hover{box-shadow:0px 4px 12px 0px rgba(0,0,0,0.06)}.link:hover .title{color:var(--elevo-color-brand)}.summary-1{display:block;background-image:url(${u});background-size:237px 115px;background-repeat:no-repeat;background-position:0 0;padding:10px 0 0 10px}.summary-2{display:block;background:linear-gradient(90deg,#ffffff 0%,#e4ecfc 100%);padding:12px 15px 5px 15px;border-top-left-radius:12px}.summary-2 span{display:-webkit-box;-webkit-line-clamp:4;line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;font-size:15px;color:#525971;line-height:22px;height:88px}`,""]);const p=d.toString()},47008:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s),o=i(20062),l=i.n(o),c=new URL(i(91107),i.b),d=r()(a()),u=l()(c);d.push([e.id,`:host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.root{color:#262626;background-color:#e1e3ec;background-image:url(${u});background-size:694px 144px;background-position:top left;background-repeat:no-repeat;box-shadow:inset 0px 2px 5px 1px rgba(42,46,59,0.1);border-radius:20px;padding:12px}.container{position:relative}textarea{display:block;width:100%;padding:10px 16px 52px;color:var(--antd-input-color);background:rgba(255,255,255,0.8);border-radius:14px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,0.5);font-size:14px;line-height:22px;height:130px}textarea::placeholder{color:rgba(0,0,0,0.4)}.btn-send:focus,\ntextarea:focus{outline:none}.btn-send{position:absolute;bottom:14px;right:14px;width:28px;height:28px;display:flex;align-items:center;justify-content:center;background:var(--elevo-color-brand);border:none;border-radius:8px;color:#fff}.btn-send[disabled]{background:rgba(0,0,0,0.15)}.btn-send:not([disabled]){cursor:pointer}.btn-send:not([disabled]):hover{background:#5166ff}.btn-send:not([disabled]):active{background:#1e33cc}.suggestions{margin-top:19px}.heading{display:flex;align-items:center;padding:0 5px;margin-bottom:8px}.icon{margin-right:5px}.carousel{overflow:hidden}.carousel + .carousel{margin-top:7px}.list{display:flex;width:max-content;list-style:none;margin:0;padding:0;font-size:12px}.item{background:rgba(255,255,255,0.4);border-radius:12px;border:1px solid #dcdee6;padding:12px;max-width:330px;cursor:pointer}.item:hover{background:rgba(255,255,255,0.5);border:1px solid rgba(37,64,255,0.3)}.list > li + li{margin-left:7px}.title{margin-bottom:4px}.content{color:rgba(0,0,0,0.45);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tooltip{display:block}`,""]);const p=d.toString()},47338:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s)()(a());r.push([e.id,':host{display:inline-block}:host([hidden]){display:none}:host,\neo-tooltip{vertical-align:middle}button{width:28px;height:28px;font-size:18px;border-radius:8px;display:flex;align-items:center;justify-content:center;border:none;background:none;color:#333}button:disabled{color:#8c8c8c}button:not(:disabled){cursor:pointer}button:focus{outline:none}button:not(:disabled):hover{background:rgba(0,0,0,0.04)}button:not(:disabled):active{background:rgba(0,0,0,0.08)}:host([variant="light"]) button{color:#595959}:host([variant="mini"]) button{width:24px;height:24px;font-size:16px;border-radius:4px}',""]);const o=r.toString()},50858:(e,t,i)=>{var n,a=i(74635),s=i(70918),r=i(26902),o=i(5536),l=i(86121),c=i(70829),d=i(62740),u=i(18769),p=i.n(u),h=i(7921),m=i(11280),g=i(23081),b=(i(65168),i(90079)),v=i(53373),f=i.n(v),k=i(99126),A=i(67566),x=i(8324),E=i(69445),w=i(2460),y=i(32464),N=i(58231),S=i(36494),R=i(97642),M=i(40369),T=i(59533),_=i(34999),C=i(27954),I=i(24388),W=i(56938),z=i(25718),D=i(39295),L=i(83888),Y=i(16854),U=i(97907),O=i(44394),P=i(85620),V=i(73349),H=i(62601),j=i(57097),F=i(85011),B=i(54163),G=i(65023),J=i(92449),$=i(62897),q=i(82770),K=i(31918),X=i(48680);let Q,Z,ee,te,ie,ne,ae,se,re,oe,le,ce,de,ue,pe,he,me,ge,be,ve,fe,ke,Ae,xe,Ee,we,ye,Ne,Se,Re,Me,Te,_e,Ce,Ie,We,ze,De;(0,b.initializeI18n)(w.NS,w.I);const{defineElement:Le,property:Ye,event:Ue,method:Oe}=(0,h.createDecorators)(),Pe=(0,u.memo)(ut),Ve=(0,u.forwardRef)(dt);let He;var je=new WeakMap,Fe=new WeakMap,Be=new WeakMap,Ge=new WeakMap,Je=new WeakMap,$e=new WeakMap,qe=new WeakMap,Ke=new WeakMap,Xe=new WeakMap,Qe=new WeakSet,Ze=new WeakMap,et=new WeakMap,tt=new WeakMap,it=new WeakMap,nt=new WeakMap,at=new WeakMap,st=new WeakMap,rt=new WeakMap,ot=new WeakMap,lt=new WeakMap;class ct extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Qe),(0,s.A)(this,je,(Q(this),ee(this))),(0,s.A)(this,Fe,(te(this),ie(this))),(0,s.A)(this,Be,(ne(this),ae(this))),(0,s.A)(this,Ge,(se(this),re(this))),(0,s.A)(this,Je,(oe(this),le(this))),(0,s.A)(this,$e,(ce(this),de(this))),(0,s.A)(this,qe,(ue(this),pe(this))),(0,s.A)(this,Ke,(he(this),me(this))),(0,s.A)(this,Xe,(ge(this),be(this))),(0,s.A)(this,Ze,(ke(this),()=>{(0,o.A)(Qe,this,ve).emit()})),(0,s.A)(this,et,Ae(this)),(0,s.A)(this,tt,(we(this),()=>{(0,o.A)(Qe,this,xe).emit()})),(0,s.A)(this,it,ye(this)),(0,s.A)(this,nt,(Re(this),()=>{(0,o.A)(Qe,this,Ne).emit()})),(0,s.A)(this,at,Me(this)),(0,s.A)(this,st,(Ce(this),()=>{(0,o.A)(Qe,this,Te).emit()})),(0,s.A)(this,rt,Ie(this)),(0,s.A)(this,ot,(De(this),e=>{(0,o.A)(Qe,this,We).emit(e)})),(0,s.A)(this,lt,(0,u.createRef)())}get taskId(){return(0,c.A)(je,this)}set taskId(e){(0,l.A)(je,this,e)}get task(){return(0,c.A)(Fe,this)}set task(e){(0,l.A)(Fe,this,e)}get jobs(){return(0,c.A)(Be,this)}set jobs(e){(0,l.A)(Be,this,e)}get replay(){return(0,c.A)(Ge,this)}set replay(e){(0,l.A)(Ge,this,e)}get replayDelay(){return(0,c.A)(Je,this)}set replayDelay(e){(0,l.A)(Je,this,e)}get supports(){return(0,c.A)($e,this)}set supports(e){(0,l.A)($e,this,e)}get showHiddenJobs(){return(0,c.A)(qe,this)}set showHiddenJobs(e){(0,l.A)(qe,this,e)}get showFeedback(){return(0,c.A)(Ke,this)}set showFeedback(e){(0,l.A)(Ke,this,e)}resumed(){var e;null===(e=(0,c.A)(lt,this).current)||void 0===e||e.resumed()}feedbackSubmitDone(){var e;null===(e=(0,c.A)(lt,this).current)||void 0===e||e.feedbackSubmitDone()}feedbackSubmitFailed(){var e;null===(e=(0,c.A)(lt,this).current)||void 0===e||e.feedbackSubmitFailed()}render(){return p().createElement(Ve,{taskId:this.taskId,jobs:this.jobs,task:this.task,replay:this.replay,replayDelay:this.replayDelay,supports:this.supports,showHiddenJobs:this.showHiddenJobs,showFeedback:this.showFeedback,onShare:(0,c.A)(Ze,this),onPause:(0,c.A)(tt,this),onResume:(0,c.A)(nt,this),onCancel:(0,c.A)(st,this),onSubmitFeedback:(0,c.A)(ot,this),ref:(0,c.A)(lt,this)})}}function dt(e,t){var i;let{taskId:n,task:a,jobs:s,replay:r,replayDelay:o,supports:l,showHiddenJobs:c,showFeedback:d,onShare:h,onPause:m,onResume:b,onCancel:v,onSubmitFeedback:k}=e;const w=(0,u.useRef)(null),{task:C,jobs:I,error:W,humanInputRef:z,resumedRef:D,skipToResults:L,watchAgain:q}=(0,M.S)(n,r,o),X=n?C:a,Q=n?I:s,Z=null==X?void 0:X.plan,ee=(0,T.B)(X,Q,{showHiddenJobs:c}),te=null==ee?void 0:ee.nodes,ie=null==ee?void 0:ee.edges,ne=null==ee?void 0:ee.nav,ae=null==ee?void 0:ee.views,se=null==ee?void 0:ee.jobLevels,re=null!==(i=null==X?void 0:X.title)&&void 0!==i?i:"",oe=null==X?void 0:X.state,[le,ce]=(0,u.useState)(null),de=(0,u.useMemo)((()=>{if(le){const[e,t]=le.split(":");if("job"===e||"view"===e)return t}return null}),[le]),[ue,pe]=(0,u.useState)(!1),[he,me]=(0,u.useState)(!1),[ge,be]=(0,u.useState)(!!d);(0,u.useEffect)((()=>{be(!!d)}),[d]);const ve=(0,u.useCallback)((e=>{pe(!0),k(e)}),[k]);(0,u.useImperativeHandle)(t,(()=>({resumed:()=>{var e;return null===(e=D.current)||void 0===e?void 0:e.call(D)},feedbackSubmitDone:()=>{me(!0),setTimeout((()=>{be(!1)}),3e3)},feedbackSubmitFailed:()=>{pe(!1)}})),[D]);const fe=(0,u.useRef)(!1);(0,u.useEffect)((()=>{const e=setTimeout((()=>{fe.current=!0}),3e3);return()=>{clearTimeout(e)}}),[]),(0,u.useEffect)((()=>{(0,g.getRuntime)().applyPageTitle(re)}),[re]),(0,u.useEffect)((()=>{W&&(0,g.handleHttpError)(W)}),[W]);const ke=(0,u.useCallback)(((e,t)=>{var i;null===(i=z.current)||void 0===i||i.call(z,e,t)}),[z]),[Ae,xe]=(0,u.useState)(null),Ee=(0,u.useCallback)(((e,t)=>{xe((i=>{if(!t){if(!i)return null;const t=new Map(i);return t.delete(e)?t:i}return i?new Map(i).set(e,t):new Map([[e,t]])}))}),[]),{sizeReady:we,nodes:ye,edges:Ne}=(0,R.g)({rawNodes:te,rawEdges:ie,state:oe,sizeMap:Ae,showFeedback:ge}),Se=(0,u.useRef)(!1),Re=(0,u.useRef)(!1),[Me,Te]=(0,u.useState)(!1),{grabbing:_e,transform:Ce,transformRef:Ie,zoomer:We}=(0,N.f)({rootRef:w,zoomable:we,scrollable:we&&!Me,pannable:we,manualScrolledUpRef:Re}),ze=(0,u.useRef)(!1),De=(0,u.useMemo)((()=>{let e=null;const t=i=>{const n=Ie.current,a="function"==typeof i?i(n):i;if(!a)return;const{transform:s,translateBy:r}=a;let o=(0,A.A)(w.current);var l,c,d,u,p,h;fe.current&&0!==a.duration&&(ze.current=!0,o=o.transition().duration(null!==(l=a.duration)&&void 0!==l?l:300).ease((e=>e*(2-e))).on("end",(()=>{if(ze.current=!1,e){const i=e;e=null,t(i)}}))),s?We.transform(o,new x.uV(null!==(c=s.k)&&void 0!==c?c:n.k,null!==(d=s.x)&&void 0!==d?d:n.x,null!==(u=s.y)&&void 0!==u?u:n.y)):We.translateBy(o,null!==(p=r[0])&&void 0!==p?p:0,null!==(h=r[1])&&void 0!==h?h:0)};return i=>{ze.current?e=i:t(i)}}),[Ie,We]),{centered:Le,setCentered:Ye,reCenterRef:Ue}=(0,S.E)({nodes:ye,sizeReady:we,zoomer:We,rootRef:w,pushZoomTransition:De}),Oe=U.QB.includes(oe),Ve=(0,u.useMemo)((()=>new Set(Ne.map((e=>e.source)))),[Ne]),He=(0,u.useMemo)((()=>{if(!we)return null;const e=[];for(const t of ye)Ve.has(t.id)||e.push(t);return e.length>0?Math.max(...e.map((e=>e.view.y+e.view.height))):null}),[ye,Ve,we]),je=(0,u.useRef)(null);(0,u.useEffect)((()=>{je.current=He}),[He]),(0,u.useEffect)((()=>{const e=w.current;!e||null===He||Se.current&&Re.current||De((t=>{const{offsetHeight:i}=e,n=He*t.k+t.y,a=i-Y.xX-n;return a<0?{transform:{y:t.y+a},duration:a>-100?100:a<-500?300:200}:null}))}),[He,De]),(0,u.useEffect)((()=>{const e=je.current,t=w.current;if(!t||null===e||ze.current)return;const{offsetHeight:i}=t,n=e*Ce.k+Ce.y,a=i-Y.xX-n;Se.current=a<0}),[Ce,We]);const Fe=(0,u.useCallback)((()=>{Ue.current=!0,Ye(!1)}),[Ue,Ye]),Be=(0,u.useCallback)((e=>{We.scaleTo((0,A.A)(w.current),e)}),[We]),Ge=(0,u.useMemo)((()=>we?(0,E.o)(ye.map((e=>e.view))):null),[ye,we]);(0,u.useEffect)((()=>{if(!Ge)return;const e=w.current;if(!e)return;const{offsetWidth:t,offsetHeight:i}=e,n=t/Ce.k,a=i/Ce.k,s=-(n-20-Ge.x),r=n-20+(Ge.x+Ge.width),o=-(a-20-Ge.y),l=a-20+(Ge.y+Ge.height);We.translateExtent([[s,o],[r,l]])}),[We,Ce.k,Ge]);const Je=(0,u.useCallback)((e=>{let{nodeId:t,jobId:i,behavior:n,block:a}=e;const s=w.current,r=ye.filter((e=>{var n;return!(t&&e.id!==t||i&&(null===(n=e.job)||void 0===n?void 0:n.id)!==i)}));if(!s||0===r.length)return;const o=(0,E.o)(r.map((e=>e.view))),{x:l,y:c}=(0,H.D)(o,[s.offsetWidth,s.offsetHeight],[Y.RV,Y.kq,Y.xX,Y.bL],Ie.current,a);(l||c)&&De({translateBy:[l,c],duration:"instant"===n?0:void 0})}),[ye,De,Ie]),$e=(0,u.useCallback)(((e,t)=>{const i=w.current;if(!i||!we)return;let n,a=0,s=0,r=300;const o="left"===e||"right"===e;if("line"===t)n=40*("up"===e||"left"===e?1:-1),r=150;else if("page"===t)n=(i.offsetHeight-Y.xX)*("up"===e?-1:1);else{const{y:t,height:a}=(0,E.o)(ye.map((e=>e.view)));if("down"===e){const e=t+a-t+Y.xX;n=i.offsetHeight-e-Ie.current.y}else n=t+Y.RV-Ie.current.y}o?a=n:s=n,(a||s)&&De({translateBy:[a,s],duration:r})}),[ye,De,we,Ie]),[qe,Ke]=(0,u.useState)(null),[Xe,Qe]=(0,u.useState)(null),[Ze,et]=p().useState(null),tt=(0,u.useMemo)((()=>({humanInput:ke,onShare:h,onPause:m,onResume:b,onCancel:v,supports:l,activeExpandedViewJobId:Xe,setActiveExpandedViewJobId:Qe,activeToolCallJobId:qe,setActiveToolCallJobId:Ke})),[ke,v,m,b,h,l,Xe,qe]),it=(0,u.useMemo)((()=>({onNodeResize:Ee,onSubmitFeedback:ve,setActiveNodeId:ce,hoverOnScrollableContent:Me,setHoverOnScrollableContent:Te,setActiveFile:et,setShowFeedback:be,submittingFeedback:ue,submittedFeedback:he})),[Me,Ee,ve,ue,he]),nt=(0,u.useMemo)((()=>qe?null==Q?void 0:Q.find((e=>e.id===qe)):null),[qe,Q]),at=(0,u.useCallback)((e=>{for(const t of e.nativeEvent.composedPath()){if(t instanceof HTMLElement&&t.classList.contains(y.A.node))return;if(t===w.current)break}ce(null)}),[]);return(0,u.useEffect)((()=>{const e=w.current;if(!e||nt||Xe||Ze)return;const t=t=>{if(document.activeElement&&document.activeElement!==document.body&&document.activeElement!==e)return;const i=(0,j.l)(t,{activeNodeId:le,nodes:ye});if(!i)return;const{action:n,node:a}=i;if("scroll"===n)$e(i.direction,i.range);else if("enter"===n){var s,r;if("job"!==a.type&&"view"!==a.type)return;const e="ask_human"===(null===(s=a.job.toolCall)||void 0===s?void 0:s.name),t="ask_human_confirming_plan"===(null===(r=a.job.toolCall)||void 0===r?void 0:r.name);if(e||t)return}t.preventDefault(),t.stopPropagation(),"enter"===n?"view"===a.type?Qe(a.job.id):Ke(a.job.id):"switch-active-node"===n&&(a?(ce(a.id),"job"===a.type||"view"===a.type?Je({jobId:a.job.id,behavior:"smooth"}):Je({nodeId:a.id,behavior:"smooth"})):ce(null))};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}),[le,nt,Xe,Ze,ye,Je,$e]),p().createElement(K.j.Provider,{value:tt},p().createElement(P.Q.Provider,{value:it},p().createElement("div",{className:f()(y.A.root,{[y.A.loading]:!X}),ref:w,style:{cursor:_e?"grabbing":"grab"},tabIndex:-1,onClick:at},!X&&p().createElement("div",{className:y.A["loading-icon"]},p().createElement(O.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})),p().createElement("div",{className:f()(y.A.canvas,{[y.A.ready]:we&&Le}),style:{transform:`translate3d(${Ce.x}px, ${Ce.y}px, 0) scale(${Ce.k})`}},p().createElement("svg",{className:y.A.edges},Ne.map((e=>e.source===Y.Jw||e.target===Y.Jw?null:p().createElement("path",{className:y.A.edge,key:`${e.source}-${e.target}`,d:e.points.map(((e,t)=>{let{x:i,y:n}=e;return`${0===t?"M":"L"}${i},${n}`})).join(" ")})))),ye.map((e=>{var t,i;return p().createElement(Pe,{key:e.id,id:e.id,type:e.type,content:e.content,job:e.job,state:e.state,startTime:null==X?void 0:X.startTime,instructionLoading:"instruction"===e.type&&!Ve.has(e.id)&&!U.QB.includes(e.state)&&!U.X4.includes(oe),edges:Ne,x:null===(t=e.view)||void 0===t?void 0:t.x,y:null===(i=e.view)||void 0===i?void 0:i.y,active:le===e.id})})))),p().createElement("div",{className:y.A.widgets},p().createElement(B.s,{nav:ne,plan:Z,jobs:Q,jobLevels:se,currentNavId:de,taskState:oe,onClick:e=>{ce(`job:${e}`),Je({jobId:e,block:"start"})}}),p().createElement(_.l,{scale:Ce.k,onScaleChange:Be,onReCenter:Fe}),r?p().createElement("div",{className:y.A["footer-container"]},p().createElement(G.b,{taskDone:Oe,skipToResults:L,watchAgain:()=>{q(),Ye(!1)}})):null!=l&&l.chat?p().createElement("div",{className:y.A["footer-container"]},p().createElement(J.s,{taskState:oe,taskDone:Oe})):null),nt&&p().createElement(V.M,{job:nt}),Xe&&p().createElement(F.f,{views:ae}),Ze&&p().createElement($.d,{file:Ze})))}function ut(e){let{id:t,type:i,state:n,job:a,content:s,startTime:r,instructionLoading:o,x:l,y:c,active:d}=e;const h=(0,u.useRef)(null),{onNodeResize:m,setActiveNodeId:g}=(0,u.useContext)(P.Q);(0,u.useEffect)((()=>{const e=h.current;if(!e)return;const i=new k.A((()=>{m(t,[e.offsetWidth,e.offsetHeight])}));return i.observe(e),()=>{i.disconnect(),m(t,null)}}),[t,m]),(0,u.useEffect)((()=>{const e=h.current;if(!e)return;const t=e=>{e.stopPropagation()};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}}),[]);const b=(0,u.useCallback)((()=>{"start"!==i&&"instruction"!==i&&g(t)}),[t,g,i]);return p().createElement("div",{className:f()(y.A.node,{[y.A.ready]:null!=l&&null!=c}),ref:h,style:{left:l,top:c},onClick:b},"start"===i?p().createElement(C.H,null):"end"===i?p().createElement(D.s,null):"feedback"===i?p().createElement(q.k,null):"requirement"===i?p().createElement(I.O,{content:s,startTime:r,active:d}):"loading"===i?p().createElement(X.V,null):"instruction"===i?p().createElement(W.L,{content:a.instruction,loading:o}):"view"===i?p().createElement(L.Y,{job:a,active:d}):p().createElement(z.W,{state:n,job:a,active:d}))}n=ct,({e:[ee,te,ie,ne,ae,se,re,oe,le,ce,de,ue,pe,he,me,ge,be,ve,fe,ke,Ae,xe,Ee,we,ye,Ne,Se,Re,Me,Te,_e,Ce,Ie,We,ze,De,Q],c:[He,Z]}=(0,d.A)(n,[Le("ai-portal.cruise-canvas",{shadowOptions:!1})],[[Ye(),1,"taskId"],[Ye({attribute:!1}),1,"task"],[Ye({attribute:!1}),1,"jobs"],[Ye({type:Boolean}),1,"replay"],[Ye({type:Number}),1,"replayDelay"],[Ye({attribute:!1}),1,"supports"],[Ye({type:Boolean}),1,"showHiddenJobs"],[Ye({type:Boolean}),1,"showFeedback"],[Ue({type:"share"}),1,"shareEvent",e=>(0,c.A)(Xe,e),(e,t)=>(0,l.A)(Xe,e,t)],[Ue({type:"pause"}),1,"pauseEvent",e=>(0,c.A)(et,e),(e,t)=>(0,l.A)(et,e,t)],[Ue({type:"resume"}),1,"resumeEvent",e=>(0,c.A)(it,e),(e,t)=>(0,l.A)(it,e,t)],[Ue({type:"cancel"}),1,"cancelEvent",e=>(0,c.A)(at,e),(e,t)=>(0,l.A)(at,e,t)],[Ue({type:"feedback.submit"}),1,"feedbackSubmitEvent",e=>(0,c.A)(rt,e),(e,t)=>(0,l.A)(rt,e,t)],[Oe(),2,"resumed"],[Oe(),2,"feedbackSubmitDone"],[Oe(),2,"feedbackSubmitFailed"]],0,(e=>lt.has((0,r.A)(e))),m.ReactNextElement)),Z();var pt=i(71451),ht=i(41030);let mt=function(e){return e.ASK_ANY_THING="ASK_ANYTHING",e.COMMON_TASKS="COMMON_TASKS",e}({});const gt="bricks/ai-portal/chat-box",bt={en:{[mt.ASK_ANY_THING]:"Ask anything",[mt.COMMON_TASKS]:"Common tasks"},zh:{[mt.ASK_ANY_THING]:"询问任何问题",[mt.COMMON_TASKS]:"常用任务"}},vt=b.i18n.getFixedT(null,gt),ft=i.p+"images/af389fa6.svg";var kt,At=i(47008);let xt,Et,wt,yt,Nt,St,Rt,Mt,Tt,_t,Ct,It,Wt,zt,Dt;(0,b.initializeI18n)(gt,bt);const Lt=(0,m.wrapBrick)("eo-icon"),{defineElement:Yt,property:Ut,event:Ot}=(0,h.createDecorators)();let Pt;var Vt=new WeakMap,Ht=new WeakMap,jt=new WeakMap,Ft=new WeakMap,Bt=new WeakMap,Gt=new WeakMap,Jt=new WeakSet,$t=new WeakMap;class qt extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Jt),(0,s.A)(this,Vt,Et(this)),(0,s.A)(this,Ht,(wt(this),yt(this))),(0,s.A)(this,jt,(Nt(this),St(this))),(0,s.A)(this,Ft,(Rt(this),Mt(this))),(0,s.A)(this,Bt,(Tt(this),_t(this))),(0,s.A)(this,Gt,(Ct(this),It(this))),(0,s.A)(this,$t,(Dt(this),e=>{(0,o.A)(Jt,this,Wt).emit(e)}))}get disabled(){return(0,c.A)(Vt,this)}set disabled(e){(0,l.A)(Vt,this,e)}get placeholder(){return(0,c.A)(Ht,this)}set placeholder(e){(0,l.A)(Ht,this,e)}get autoFocus(){return(0,c.A)(jt,this)}set autoFocus(e){(0,l.A)(jt,this,e)}get suggestions(){return(0,c.A)(Ft,this)}set suggestions(e){(0,l.A)(Ft,this,e)}get suggestionsLabel(){return(0,c.A)(Bt,this)}set suggestionsLabel(e){(0,l.A)(Bt,this,e)}render(){return p().createElement(Kt,{disabled:this.disabled,placeholder:this.placeholder,autoFocus:this.autoFocus,suggestions:this.suggestions,suggestionsLabel:this.suggestionsLabel,onSubmit:(0,c.A)($t,this)})}}function Kt(e){let{disabled:t,placeholder:i,autoFocus:n,suggestions:a,suggestionsLabel:s,onSubmit:r}=e;const o=(0,u.useRef)(null),l=(0,u.useRef)(null),[c,d]=(0,u.useState)(""),h=(0,u.useRef)(""),m=(0,u.useCallback)((e=>{e.currentTarget.value&&(null==r||r(e.currentTarget.value))}),[r]),g=(0,u.useCallback)((e=>{h.current=e.target.value,d(e.target.value)}),[]),b=(0,u.useCallback)((()=>{null==r||r(h.current)}),[r]);(0,u.useEffect)((()=>{n&&Promise.resolve().then((()=>{var e;null===(e=l.current)||void 0===e||e.focus()}))}),[]);const v=(0,u.useMemo)((()=>null!=a&&a.length?(0,ht.chunk)(a,Math.max(2,Math.ceil(a.length/2))):[]),[a]),f=(0,u.useCallback)((e=>{h.current=e.content,d(e.content),setTimeout((()=>{var e;null===(e=l.current)||void 0===e||e.focus()}))}),[]);return p().createElement("div",{className:"root"},p().createElement("div",{className:"container",ref:o},p().createElement(pt.e,{containerRef:o,ref:l,value:c,minRows:3,paddingSize:62,autoResize:!0,disabled:t,placeholder:null!=i?i:vt(mt.ASK_ANY_THING),submitWhen:"enter-without-shift",onSubmit:m,onChange:g}),p().createElement("button",{className:"btn-send",disabled:!c,onClick:b},p().createElement(Lt,{lib:"fa",prefix:"fas",icon:"arrow-up"}))),!(null==v||!v.length)&&p().createElement("div",{className:"suggestions"},p().createElement("div",{className:"heading"},p().createElement("img",{className:"icon",src:ft,width:16,height:16}),p().createElement("span",null,null!=s?s:vt(mt.COMMON_TASKS))),v.map(((e,t)=>p().createElement(Xt,{key:t,suggestions:e,pixelPerSecond:10*(t+2),onSelect:f})))))}function Xt(e){let{suggestions:t,pixelPerSecond:i,onSelect:n}=e;const a=(0,u.useRef)(null),s=(0,u.useRef)(null),[r,o]=(0,u.useState)(0);return(0,u.useEffect)((()=>{const e=a.current,t=s.current;if(!e||!t)return;let n,r,l,c,d=0;const u=(t.offsetWidth-7)/2+7;function p(e){r=e,void 0===l&&(l=e),void 0!==n&&(d+=e-n,n=void 0),o((e-l-d)/1e3*i%u),c=requestAnimationFrame(p)}c=requestAnimationFrame(p);const h=()=>{cancelAnimationFrame(c),n=r},m=()=>{c=requestAnimationFrame(p)};return e.addEventListener("mouseenter",h),e.addEventListener("mouseleave",m),()=>{cancelAnimationFrame(c),e.removeEventListener("mouseenter",h),e.removeEventListener("mouseleave",m)}}),[t,i]),p().createElement("div",{className:"carousel",ref:a},p().createElement("ul",{className:"list",ref:s,style:{transform:`translateX(${-r}px)`}},[...t,...t].map(((e,t)=>p().createElement("li",{key:t},p().createElement("div",{className:"item",onClick:()=>n(e),title:e.content},p().createElement("div",{className:"title"},e.title),p().createElement("div",{className:"content"},e.content)))))))}kt=qt,({e:[Et,wt,yt,Nt,St,Rt,Mt,Tt,_t,Ct,It,Wt,zt,Dt],c:[Pt,xt]}=(0,d.A)(kt,[Yt("ai-portal.chat-box",{styleTexts:[At.A]})],[[Ut({type:Boolean}),1,"disabled"],[Ut(),1,"placeholder"],[Ut({type:Boolean}),1,"autoFocus"],[Ut({attribute:!1}),1,"suggestions"],[Ut(),1,"suggestionsLabel"],[Ot({type:"message.submit"}),1,"messageSubmit",e=>(0,c.A)(Gt,e),(e,t)=>(0,l.A)(Gt,e,t)]],0,(e=>$t.has((0,r.A)(e))),m.ReactNextElement)),xt();var Qt,Zt=i(82165);let ei;const{defineElement:ti}=(0,h.createDecorators)();let ii;class ni extends m.ReactNextElement{render(){return p().createElement(ai,null)}}function ai(){return p().createElement("slot",null)}Qt=ni,[ii,ei]=(0,d.A)(Qt,[ti("ai-portal.home-container",{styleTexts:[Zt.A]})],[],0,void 0,m.ReactNextElement).c,ei();var si=i(21302),ri=i.n(si);let oi=function(e){return e.TODAY="TODAY",e.YESTERDAY="YESTERDAY",e.PREVIOUS_7_DAYS="PREVIOUS_7_DAYS",e.PREVIOUS_30_DAYS="PREVIOUS_30_DAYS",e}({});const li="bricks/ai-portal/chat-history",ci={en:{[oi.TODAY]:"Today",[oi.YESTERDAY]:"Yesterday",[oi.PREVIOUS_7_DAYS]:"Previous 7 days",[oi.PREVIOUS_30_DAYS]:"Previous 30 days"},zh:{[oi.TODAY]:"今天",[oi.YESTERDAY]:"昨天",[oi.PREVIOUS_7_DAYS]:"过去7天",[oi.PREVIOUS_30_DAYS]:"过去30天"}},di=b.i18n.getFixedT(null,li);var ui,pi=i(21411);let hi,mi,gi,bi,vi,fi,ki,Ai,xi,Ei,wi,yi,Ni,Si,Ri;(0,b.initializeI18n)(li,ci);const Mi=(0,m.wrapBrick)("eo-icon"),Ti=(0,m.wrapBrick)("eo-link"),_i=(0,m.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),{defineElement:Ci,property:Ii,event:Wi}=(0,h.createDecorators)();let zi;var Di=new WeakMap,Li=new WeakMap,Yi=new WeakMap,Ui=new WeakMap,Oi=new WeakSet,Pi=new WeakMap,Vi=new WeakMap,Hi=new WeakMap;class ji extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Oi),(0,s.A)(this,Di,mi(this)),(0,s.A)(this,Li,(gi(this),bi(this))),(0,s.A)(this,Yi,(vi(this),fi(this))),(0,s.A)(this,Ui,(ki(this),Ai(this))),(0,s.A)(this,Pi,(wi(this),e=>{(0,o.A)(Oi,this,xi).emit(e)})),(0,s.A)(this,Vi,yi(this)),(0,s.A)(this,Hi,(Ri(this),e=>{(0,o.A)(Oi,this,Ni).emit({nextToken:e})}))}get list(){return(0,c.A)(Di,this)}set list(e){(0,l.A)(Di,this,e)}get actions(){return(0,c.A)(Li,this)}set actions(e){(0,l.A)(Li,this,e)}get nextToken(){return(0,c.A)(Yi,this)}set nextToken(e){(0,l.A)(Yi,this,e)}render(){return p().createElement(Fi,{root:this,list:this.list,actions:this.actions,nextToken:this.nextToken,onActionClick:(0,c.A)(Pi,this),onLoadMore:(0,c.A)(Hi,this)})}}function Fi(e){let{root:t,list:i,actions:n,nextToken:a,onActionClick:s,onLoadMore:r}=e;const o=(0,u.useMemo)((()=>{const e=new Map,t=ri()(),n=t.clone().startOf("day"),a=n.clone().subtract(1,"day"),s=n.clone().subtract(7,"days"),r=n.clone().subtract(30,"days"),o=+n/1e3,l=+a/1e3,c=+s/1e3,d=+r/1e3,u=+t.clone().startOf("year")/1e3;for(const t of null!=i?i:[]){let i;i=t.startTime>=o?di(oi.TODAY):t.startTime>=l?di(oi.YESTERDAY):t.startTime>=c?di(oi.PREVIOUS_7_DAYS):t.startTime>=d?di(oi.PREVIOUS_30_DAYS):t.startTime>=u?ri()(1e3*t.startTime).format("MMMM"):ri()(1e3*t.startTime).format("YYYY");let n=e.get(i);n||e.set(i,n={title:i,items:[]}),n.items.push(t)}return[...e.values()]}),[i]),[l,c]=(0,u.useState)(null),d=(0,u.useRef)(null);return(0,u.useEffect)((()=>{const e=d.current;if(!e||!a)return;const i=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&r(a)}),{root:t});return i.observe(e),()=>{i.disconnect()}}),[a,r,t]),i?p().createElement(p().Fragment,null,p().createElement("ul",null,o.map((e=>p().createElement("li",{key:e.title,className:"group"},p().createElement("div",{className:"group-title"},e.title),p().createElement("ul",{className:"items"},e.items.map((e=>p().createElement("li",{key:e.id},p().createElement(Ti,{className:f()("item",{active:l===e.id}),url:e.url},p().createElement("div",{className:"item-title",title:e.title},e.title),p().createElement(_i,{className:"actions",actions:n,onActionClick:t=>{s({action:t.detail,item:e})},onVisibleChange:t=>{c(t.detail?e.id:null)}}),!U.QB.includes(e.state)&&p().createElement("div",{className:"working"})))))))))),a&&p().createElement("div",{className:"load-more",ref:d},p().createElement(Mi,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))):p().createElement("div",{className:"loading"},p().createElement(Mi,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}))}ui=ji,({e:[mi,gi,bi,vi,fi,ki,Ai,xi,Ei,wi,yi,Ni,Si,Ri],c:[zi,hi]}=(0,d.A)(ui,[Ci("ai-portal.chat-history",{styleTexts:[pi.A]})],[[Ii({attribute:!1}),1,"list"],[Ii({attribute:!1}),1,"actions"],[Ii(),1,"nextToken"],[Wi({type:"action.click"}),1,"actionClick",e=>(0,c.A)(Ui,e),(e,t)=>(0,l.A)(Ui,e,t)],[Wi({type:"load.more"}),1,"loadMore",e=>(0,c.A)(Vi,e),(e,t)=>(0,l.A)(Vi,e,t)]],0,(e=>Hi.has((0,r.A)(e))),m.ReactNextElement)),hi();var Bi,Gi=i(89575),Ji=i(24);let $i,qi,Ki,Xi,Qi,Zi,en,tn,nn,an,sn,rn,on,ln,cn,dn,un,pn,hn,mn,gn;const bn=(0,m.wrapBrick)("eo-mini-line-chart"),{defineElement:vn,property:fn}=(0,h.createDecorators)();let kn;var An=new WeakMap,xn=new WeakMap,En=new WeakMap,wn=new WeakMap,yn=new WeakMap,Nn=new WeakMap,Sn=new WeakMap,Rn=new WeakMap,Mn=new WeakMap,Tn=new WeakMap;class _n extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,An,qi(this)),(0,s.A)(this,xn,(Ki(this),Xi(this))),(0,s.A)(this,En,(Qi(this),Zi(this))),(0,s.A)(this,wn,(en(this),tn(this))),(0,s.A)(this,yn,(nn(this),an(this))),(0,s.A)(this,Nn,(sn(this),rn(this))),(0,s.A)(this,Sn,(on(this),ln(this))),(0,s.A)(this,Rn,(cn(this),dn(this))),(0,s.A)(this,Mn,(un(this),pn(this))),(0,s.A)(this,Tn,(hn(this),mn(this))),gn(this)}get label(){return(0,c.A)(An,this)}set label(e){(0,l.A)(An,this,e)}get value(){return(0,c.A)(xn,this)}set value(e){(0,l.A)(xn,this,e)}get size(){return(0,c.A)(En,this)}set size(e){(0,l.A)(En,this,e)}get lineColor(){return(0,c.A)(wn,this)}set lineColor(e){(0,l.A)(wn,this,e)}get showArea(){return(0,c.A)(yn,this)}set showArea(e){(0,l.A)(yn,this,e)}get min(){return(0,c.A)(Nn,this)}set min(e){(0,l.A)(Nn,this,e)}get max(){return(0,c.A)(Sn,this)}set max(e){(0,l.A)(Sn,this,e)}get xField(){return(0,c.A)(Rn,this)}set xField(e){(0,l.A)(Rn,this,e)}get yField(){return(0,c.A)(Mn,this)}set yField(e){(0,l.A)(Mn,this,e)}get data(){return(0,c.A)(Tn,this)}set data(e){(0,l.A)(Tn,this,e)}render(){return p().createElement(Cn,{label:this.label,value:this.value,size:this.size,lineColor:this.lineColor,showArea:this.showArea,min:this.min,max:this.max,xField:this.xField,yField:this.yField,data:this.data})}}function Cn(e){let{label:t,value:i,size:n,...a}=e;return"small"===n?p().createElement("div",{className:"container"},p().createElement("div",{className:"label-and-stat"},p().createElement("div",{className:"label"},t),p().createElement("div",{className:"stat"},i)),p().createElement("div",{className:"chart"},p().createElement(bn,(0,Gi.A)({},a,{lineWidth:1.5,width:"auto",height:"55"})))):p().createElement("div",{className:"container"},p().createElement("div",{className:"label"},t),p().createElement("div",{className:"stat-and-chart"},p().createElement("div",{className:"chart"},p().createElement(bn,(0,Gi.A)({},a,{lineWidth:2,width:"auto",height:"92"}))),p().createElement("div",{className:"stat"},i)))}Bi=_n,({e:[qi,Ki,Xi,Qi,Zi,en,tn,nn,an,sn,rn,on,ln,cn,dn,un,pn,hn,mn,gn],c:[kn,$i]}=(0,d.A)(Bi,[vn("ai-portal.stat-with-mini-chart",{styleTexts:[Ji.A]})],[[fn(),1,"label"],[fn(),1,"value"],[fn(),1,"size"],[fn(),1,"lineColor"],[fn({type:Boolean}),1,"showArea"],[fn({type:Number}),1,"min"],[fn({type:Number}),1,"max"],[fn(),1,"xField"],[fn(),1,"yField"],[fn({attribute:!1}),1,"data"]],0,void 0,m.ReactNextElement)),$i();const In=i.p+"images/7385e5f5.png";var Wn,zn=i(31653);let Dn;const{defineElement:Ln}=(0,h.createDecorators)();let Yn;class Un extends m.ReactNextElement{render(){return p().createElement(On,null)}}function On(){return p().createElement("img",{src:In,alt:"Elevo",width:95,height:26})}Wn=Un,[Yn,Dn]=(0,d.A)(Wn,[Ln("ai-portal.elevo-logo",{styleTexts:[zn.A]})],[],0,void 0,m.ReactNextElement).c,Dn();let Pn=function(e){return e.NEW_CHAT="NEW_CHAT",e.LOGOUT="LOGOUT",e.TODAY="TODAY",e.YESTERDAY="YESTERDAY",e.PREVIOUS_7_DAYS="PREVIOUS_7_DAYS",e.PREVIOUS_30_DAYS="PREVIOUS_30_DAYS",e.SWITCH_LANGUAGE="SWITCH_LANGUAGE",e}({});const Vn="bricks/ai-portal/elevo-sidebar",Hn={en:{[Pn.NEW_CHAT]:"New chat",[Pn.LOGOUT]:"Logout",[Pn.TODAY]:"Today",[Pn.YESTERDAY]:"Yesterday",[Pn.PREVIOUS_7_DAYS]:"Previous 7 days",[Pn.PREVIOUS_30_DAYS]:"Previous 30 days",[Pn.SWITCH_LANGUAGE]:"中文"},zh:{[Pn.NEW_CHAT]:"新对话",[Pn.LOGOUT]:"登出",[Pn.TODAY]:"今天",[Pn.YESTERDAY]:"昨天",[Pn.PREVIOUS_7_DAYS]:"过去7天",[Pn.PREVIOUS_30_DAYS]:"过去30天",[Pn.SWITCH_LANGUAGE]:"English"}},jn=b.i18n.getFixedT(null,Vn);var Fn=i(61408);const Bn=(0,m.wrapBrick)("eo-icon"),Gn=(0,m.wrapBrick)("eo-link"),Jn=(0,m.wrapBrick)("eo-dropdown-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),$n=(0,m.wrapBrick)("eo-easyops-avatar"),qn=(0,m.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),Kn=(0,m.wrapBrick)("ai-portal.icon-button");var Xn=i(57372);const Qn=async(e,t)=>(await Xn.http.post("api/gateway/logic.llm.aiops_service/api/v1/llm/agent/flow/search",e,t)).data,Zn=(0,u.forwardRef)(ea);function ea(e,t){let{activeId:i,actions:n,urlTemplate:a,onActionClick:s,onHistoryClick:r}=e;const o=(0,u.useRef)(null),[l,c]=(0,u.useState)(null),[d,h]=(0,u.useState)(),[m,g]=(0,u.useState)();(0,u.useEffect)((()=>{Promise.all([Qn({next_token:m},{interceptorParams:{ignoreLoadingBar:!0}}),new Promise((e=>setTimeout(e,500)))]).then((e=>{let[t]=e;c((e=>[...null!=e?e:[],...t.data])),h(t.next_token)})).catch((e=>{console.error("Error loading chat history:",e)}))}),[m]);const b=(0,u.useMemo)((()=>{const e=new Map,t=ri()(),i=t.clone().startOf("day"),n=i.clone().subtract(1,"day"),a=i.clone().subtract(7,"days"),s=i.clone().subtract(30,"days"),r=+i/1e3,o=+n/1e3,c=+a/1e3,d=+s/1e3,u=+t.clone().startOf("year")/1e3;for(const t of null!=l?l:[]){let i;i=t.startTime>=r?jn(Pn.TODAY):t.startTime>=o?jn(Pn.YESTERDAY):t.startTime>=c?jn(Pn.PREVIOUS_7_DAYS):t.startTime>=d?jn(Pn.PREVIOUS_30_DAYS):t.startTime>=u?ri()(1e3*t.startTime).format("MMMM"):ri()(1e3*t.startTime).format("YYYY");let n=e.get(i);n||e.set(i,n={title:i,items:[]}),n.items.push(t)}return[...e.values()]}),[l]),[v,k]=(0,u.useState)(null),A=(0,u.useRef)(null);(0,u.useEffect)((()=>{const e=A.current,t=o.current;if(!e||!d||!t)return;const i=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&g(d)}),{root:t});return i.observe(e),()=>{i.disconnect()}}),[d]);const x=(0,u.useRef)(0),E=(0,u.useCallback)((async()=>{try{const e=++x.current,t=await Qn({},{interceptorParams:{ignoreLoadingBar:!0}});if(e!==x.current)return;c((e=>{const i=null!=e?e:[],n=t.data,a=new Set(n.map((e=>e.id))),s=new Map(n.map((e=>[e.id,e])));let r=!1,o=!1,l=!0;for(const e of i){const t=s.get(e.id);if(!t)break;if(r=!0,o=l&&t!==n[0]||!(0,ht.isEqual)(t,e),o)break;l=!1}return r?o?[...n,...i.filter((e=>!a.has(e.id)))]:e:(h(t.next_token),n)}))}catch(e){console.error("Error pulling chat history:",e)}}),[]);return(0,u.useImperativeHandle)(t,(()=>({pull:E})),[E]),l?p().createElement("div",{className:"history",ref:o},p().createElement("ul",null,b.map((e=>p().createElement("li",{key:e.title,className:"group"},p().createElement("div",{className:"group-title"},e.title),p().createElement("ul",{className:"items"},e.items.map((e=>{return p().createElement("li",{key:e.id},p().createElement(Gn,(0,Gi.A)({className:f()("item",{"actions-active":e.id===v,active:e.id===i}),onClick:r},a?{url:(t=a,o=e,null==t?void 0:t.replace(/{{(.*?)}}/g,((e,t)=>(0,ht.get)(o,t))))}:null),p().createElement("div",{className:"item-title",title:e.title},e.title),p().createElement(qn,{className:"actions",actions:n,onActionClick:t=>{s({action:t.detail,item:e})},onVisibleChange:t=>{k(t.detail?e.id:null)}}),!U.QB.includes(e.state)&&p().createElement("div",{className:"working"})));var t,o}))))))),d&&p().createElement("div",{className:"load-more",ref:A},p().createElement(Bn,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))):p().createElement("div",{className:"history"},p().createElement("div",{className:"loading"},p().createElement(Bn,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})))}var ta;let ia,na,aa,sa,ra,oa,la,ca,da,ua,pa,ha,ma,ga,ba,va,fa,ka,Aa,xa,Ea,wa,ya,Na,Sa,Ra;(0,b.initializeI18n)(Vn,Hn);const Ma={lib:"easyops",icon:"sidebar"},{defineElement:Ta,property:_a,event:Ca,method:Ia}=(0,h.createDecorators)(),Wa=(0,u.forwardRef)(Ka);let za;var Da=new WeakMap,La=new WeakMap,Ya=new WeakMap,Ua=new WeakMap,Oa=new WeakMap,Pa=new WeakMap,Va=new WeakMap,Ha=new WeakMap,ja=new WeakMap,Fa=new WeakSet,Ba=new WeakMap,Ga=new WeakMap,Ja=new WeakMap,$a=new WeakMap;class qa extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Fa),(0,s.A)(this,Da,(ia(this),aa(this))),(0,s.A)(this,La,(sa(this),ra(this))),(0,s.A)(this,Ya,(oa(this),la(this))),(0,s.A)(this,Ua,(ca(this),da(this))),(0,s.A)(this,Oa,(ua(this),pa(this))),(0,s.A)(this,Pa,(ha(this),ma(this))),(0,s.A)(this,Va,(ga(this),ba(this))),(0,s.A)(this,Ha,(va(this),fa(this))),(0,s.A)(this,ja,(ka(this),Aa(this))),(0,s.A)(this,Ba,(wa(this),()=>{(0,o.A)(Fa,this,xa).emit()})),(0,s.A)(this,Ga,ya(this)),(0,s.A)(this,Ja,(Ra(this),e=>{(0,o.A)(Fa,this,Na).emit(e)})),(0,s.A)(this,$a,(0,u.createRef)())}get userInstanceId(){return(0,c.A)(Da,this)}set userInstanceId(e){(0,l.A)(Da,this,e)}get behavior(){return(0,c.A)(La,this)}set behavior(e){(0,l.A)(La,this,e)}get logoUrl(){return(0,c.A)(Ya,this)}set logoUrl(e){(0,l.A)(Ya,this,e)}get newChatUrl(){return(0,c.A)(Ua,this)}set newChatUrl(e){(0,l.A)(Ua,this,e)}get historyActiveId(){return(0,c.A)(Oa,this)}set historyActiveId(e){(0,l.A)(Oa,this,e)}get historyUrlTemplate(){return(0,c.A)(Pa,this)}set historyUrlTemplate(e){(0,l.A)(Pa,this,e)}get historyActions(){return(0,c.A)(Va,this)}set historyActions(e){(0,l.A)(Va,this,e)}get links(){return(0,c.A)(Ha,this)}set links(e){(0,l.A)(Ha,this,e)}pullHistory(e){setTimeout((()=>{var e;null===(e=(0,c.A)($a,this).current)||void 0===e||e.pull()}),e)}render(){return p().createElement(Wa,{ref:(0,c.A)($a,this),userInstanceId:this.userInstanceId,behavior:this.behavior,logoUrl:this.logoUrl,newChatUrl:this.newChatUrl,historyActiveId:this.historyActiveId,historyUrlTemplate:this.historyUrlTemplate,historyActions:this.historyActions,links:this.links,onLogout:(0,c.A)(Ba,this),onActionClick:(0,c.A)(Ja,this)})}}function Ka(e,t){let{userInstanceId:i,behavior:n,logoUrl:a,newChatUrl:s,historyActiveId:r,historyUrlTemplate:o,historyActions:l,links:c,onLogout:d,onActionClick:h}=e;const[m,v]=(0,u.useState)("drawer"===n),k=(0,u.useCallback)((()=>{v(!0)}),[]),A=(0,u.useCallback)((()=>{v(!1)}),[]);(0,u.useEffect)((()=>{"drawer"===n&&v(!0)}),[n]);const x=(0,u.useCallback)((()=>{v(!0)}),[]),E=(0,u.useCallback)((()=>{"drawer"===n&&v(!0)}),[n]),w=(0,u.useMemo)((()=>[{key:"logout",icon:{lib:"fa",prefix:"fas",icon:"arrow-right-from-bracket"},text:jn(Pn.LOGOUT)},{key:"switch-language",icon:{lib:"easyops",icon:"language"},text:jn(Pn.SWITCH_LANGUAGE)}]),[]);return p().createElement("div",{className:f()("container",{collapsed:m})},"drawer"===n&&!m&&p().createElement("div",{className:"mask",onClick:x}),p().createElement("div",{className:"sidebar"},p().createElement("div",{className:"logo-bar"},p().createElement(Gn,{url:a,className:"logo-link"},p().createElement("img",{className:"logo",alt:"Elevo",src:In,width:95,height:26})),p().createElement(Kn,{icon:Ma,variant:"light",onClick:k})),p().createElement(Gn,{className:"new-chat",url:s},p().createElement(Bn,{className:"new-chat-icon",lib:"easyops",icon:"new-chat"}),jn(Pn.NEW_CHAT)),null!=c&&c.length?p().createElement("div",{className:"links"},c.map(((e,t)=>p().createElement(Gn,{className:"link",key:t,url:e.url},p().createElement(Bn,(0,Gi.A)({className:"icon"},e.icon)),p().createElement("span",{className:"title"},e.title))))):null,p().createElement(Zn,{ref:t,activeId:r,urlTemplate:o,actions:l,onActionClick:h,onHistoryClick:E}),p().createElement("div",{className:"footer"},p().createElement(Jn,{className:"dropdown",actions:w,onActionClick:async e=>{"logout"===e.detail.key?d():(await b.i18n.changeLanguage(b.i18n.language&&"en"===b.i18n.language.split("-")[0]?"zh":"en"),(0,g.getHistory)().reload())}},p().createElement("button",{className:"account"},p().createElement($n,{nameOrInstanceId:i,showName:!0,size:"xs"}))))),p().createElement("div",{className:"alternative"},p().createElement(Kn,{icon:Ma,variant:"light",onClick:A}),p().createElement(Gn,{className:"new-chat",url:s},p().createElement(Bn,{className:"new-chat-icon",lib:"easyops",icon:"new-chat"}),jn(Pn.NEW_CHAT))))}ta=qa,({e:[aa,sa,ra,oa,la,ca,da,ua,pa,ha,ma,ga,ba,va,fa,ka,Aa,xa,Ea,wa,ya,Na,Sa,Ra,ia],c:[za,na]}=(0,d.A)(ta,[Ta("ai-portal.elevo-sidebar",{styleTexts:[Fn.A]})],[[_a(),1,"userInstanceId"],[_a(),1,"behavior"],[_a(),1,"logoUrl"],[_a(),1,"newChatUrl"],[_a(),1,"historyActiveId"],[_a(),1,"historyUrlTemplate"],[_a({attribute:!1}),1,"historyActions"],[_a({attribute:!1}),1,"links"],[Ca({type:"logout"}),1,"logout",e=>(0,c.A)(ja,e),(e,t)=>(0,l.A)(ja,e,t)],[Ca({type:"action.click"}),1,"actionClick",e=>(0,c.A)(Ga,e),(e,t)=>(0,l.A)(Ga,e,t)],[Ia(),2,"pullHistory"]],0,(e=>$a.has((0,r.A)(e))),m.ReactNextElement)),na();var Xa,Qa=i(47338);let Za,es,ts,is,ns,as,ss,rs,os;const ls=(0,m.wrapBrick)("eo-icon"),cs=(0,m.wrapBrick)("eo-tooltip"),{defineElement:ds,property:us}=(0,h.createDecorators)();let ps;var hs=new WeakMap,ms=new WeakMap,gs=new WeakMap,bs=new WeakMap;class vs extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,hs,es(this)),(0,s.A)(this,ms,(ts(this),is(this))),(0,s.A)(this,gs,(ns(this),as(this))),(0,s.A)(this,bs,(ss(this),rs(this))),os(this)}get icon(){return(0,c.A)(hs,this)}set icon(e){(0,l.A)(hs,this,e)}get tooltip(){return(0,c.A)(ms,this)}set tooltip(e){(0,l.A)(ms,this,e)}get disabled(){return(0,c.A)(gs,this)}set disabled(e){(0,l.A)(gs,this,e)}get variant(){return(0,c.A)(bs,this)}set variant(e){(0,l.A)(bs,this,e)}render(){return p().createElement(fs,{icon:this.icon,tooltip:this.tooltip,disabled:this.disabled})}}function fs(e){let{icon:t,tooltip:i,disabled:n}=e;const a=p().createElement("button",{disabled:n},p().createElement(ls,t));return i?p().createElement(cs,{content:i},a):a}Xa=vs,({e:[es,ts,is,ns,as,ss,rs,os],c:[ps,Za]}=(0,d.A)(Xa,[ds("ai-portal.icon-button",{styleTexts:[Qa.A]})],[[us({attribute:!1}),1,"icon"],[us(),1,"tooltip"],[us({type:Boolean}),1,"disabled"],[us({render:!1}),1,"variant"]],0,void 0,m.ReactNextElement)),Za();let ks=function(e){return e.ALL="ALL",e}({});const As="bricks/ai-portal/show-cases",xs={en:{[ks.ALL]:"All"},zh:{[ks.ALL]:"全部"}},Es=b.i18n.getFixedT(null,As);var ws,ys=i(42873);let Ns,Ss,Rs,Ms,Ts;(0,b.initializeI18n)(As,xs);const _s=(0,m.wrapBrick)("eo-link"),{defineElement:Cs,property:Is}=(0,h.createDecorators)();let Ws;var zs=new WeakMap,Ds=new WeakMap;class Ls extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,zs,Ss(this)),(0,s.A)(this,Ds,(Rs(this),Ms(this))),Ts(this)}get list(){return(0,c.A)(zs,this)}set list(e){(0,l.A)(zs,this,e)}get taskUrlTemplate(){return(0,c.A)(Ds,this)}set taskUrlTemplate(e){(0,l.A)(Ds,this,e)}render(){return p().createElement(Ys,{list:this.list,taskUrlTemplate:this.taskUrlTemplate})}}function Ys(e){let{list:t,taskUrlTemplate:i}=e;const n=(0,u.useMemo)((()=>[null,...new Set(null==t?void 0:t.map((e=>e.scenario)).filter(Boolean))]),[t]),[a,s]=(0,u.useState)(null),r=(0,u.useMemo)((()=>a?null==t?void 0:t.filter((e=>e.scenario===a)):t),[a,t]);return null!=t&&t.length?p().createElement(p().Fragment,null,p().createElement("ul",{className:"nav"},null==n?void 0:n.map((e=>p().createElement("li",{key:e,className:"item"},p().createElement("a",{className:f()({active:a===e}),onClick:()=>s(e)},null===e?Es(ks.ALL):e))))),p().createElement("ul",{className:"cases"},null==r?void 0:r.map((e=>{return p().createElement("li",{key:e.taskId,className:"item"},p().createElement(_s,{className:"link",url:(t=i,n=e,null==t?void 0:t.replace(/{{(.*?)}}/g,((e,t)=>(0,ht.get)(n,t))))},p().createElement("span",{className:f()("placeholder",e.thumbUrl?"thumbnail":"summary")},e.thumbUrl?p().createElement("span",{style:{backgroundImage:`url(${(0,g.getBasePath)()}${e.thumbUrl})`}}):p().createElement("span",{className:"summary-1"},p().createElement("span",{className:"summary-2"},p().createElement("span",null,e.summary)))),p().createElement("span",{className:"title"},p().createElement("span",null,e.title))));var t,n})))):null}ws=Ls,({e:[Ss,Rs,Ms,Ts],c:[Ws,Ns]}=(0,d.A)(ws,[Cs("ai-portal.show-cases",{styleTexts:[ys.A]})],[[Is({attribute:!1}),1,"list"],[Is(),1,"taskUrlTemplate"]],0,void 0,m.ReactNextElement)),Ns();let Us=function(e){return e.MCP_HUB="MCP_HUB",e.ALL="ALL",e.SERVER_cmdb="SERVER_cmdb",e.SERVER_alert="SERVER_alert",e.SERVER_web_builder="SERVER_web_builder",e.SERVER_host_troubleshooting="SERVER_host_troubleshooting",e.SERVER_system_inspection="SERVER_system_inspection",e}({});const Os="bricks/ai-portal/mcp-tools",Ps={en:{[Us.MCP_HUB]:"MCP Hub",[Us.ALL]:"All",[Us.SERVER_cmdb]:"CMDB",[Us.SERVER_alert]:"Alert",[Us.SERVER_web_builder]:"View",[Us.SERVER_host_troubleshooting]:"Host Troubleshooting",[Us.SERVER_system_inspection]:"System Inspection"},zh:{[Us.MCP_HUB]:"MCP 中心",[Us.ALL]:"全部",[Us.SERVER_cmdb]:"CMDB",[Us.SERVER_alert]:"告警",[Us.SERVER_web_builder]:"视图",[Us.SERVER_host_troubleshooting]:"主机故障排查",[Us.SERVER_system_inspection]:"系统巡检"}},Vs=b.i18n.getFixedT(null,Os);var Hs,js=i(31748);let Fs,Bs,Gs;(0,b.initializeI18n)(Os,Ps);const Js={lib:"antd",icon:"tool"},$s=(0,m.wrapBrick)("eo-icon"),{defineElement:qs,property:Ks}=(0,h.createDecorators)();let Xs;var Qs=new WeakMap;class Zs extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,Qs,Bs(this)),Gs(this)}get list(){return(0,c.A)(Qs,this)}set list(e){(0,l.A)(Qs,this,e)}render(){return p().createElement(er,{list:this.list})}}function er(e){let{list:t}=e;const i=(0,u.useMemo)((()=>{const e=new Map;return null==t||t.forEach((t=>{const i=Vs(`SERVER_${t.server.id.replaceAll("-","_")}`,t.server.name);let n=e.get(i);n||e.set(i,n=[]),n.push(t)})),e}),[t]),n=(0,u.useMemo)((()=>[null,...i.keys()]),[i]),[a,s]=(0,u.useState)(null),r=(0,u.useMemo)((()=>{const e=[...i];return null===a?e:e.filter((e=>{let[t]=e;return t===a}))}),[a,i]);return p().createElement("div",{className:"container"},p().createElement("h1",null,Vs(Us.MCP_HUB)),p().createElement("ul",{className:"nav"},null==n?void 0:n.map((e=>p().createElement("li",{key:e,className:"item"},p().createElement("a",{className:f()({active:a===e}),onClick:()=>s(e)},null===e?Vs(Us.ALL):e))))),p().createElement("ul",{className:"groups"},null==r?void 0:r.map((e=>{let[t,i]=e;return p().createElement("li",{key:t,className:"group"},p().createElement("h2",null,t),p().createElement("ul",{className:"list"},i.map((e=>{var t;return p().createElement("li",{key:e.name,className:"item"},p().createElement("div",{className:"heading"},p().createElement($s,(0,Gi.A)({className:"icon"},null!==(t=e.icon)&&void 0!==t?t:Js,{fallback:Js})),p().createElement("div",{className:"title"},e.title)),p().createElement("div",{className:"description"},e.description))}))))}))))}Hs=Zs,({e:[Bs,Gs],c:[Xs,Fs]}=(0,d.A)(Hs,[qs("ai-portal.mcp-tools",{styleTexts:[js.A]})],[[Ks({attribute:!1}),1,"list"]],0,void 0,m.ReactNextElement)),Fs();var tr,ir=i(92914),nr=i(80413),ar=i(22025),sr=i(13183),rr=i(30578),or=i(17911);let lr,cr,dr,ur,pr,hr,mr,gr,br,vr,fr,kr,Ar,xr,Er,wr,yr,Nr,Sr,Rr,Mr,Tr,_r,Cr,Ir;(0,b.initializeI18n)(ir.NS,ir.I);const Wr={lib:"easyops",icon:"share"},{defineElement:zr,property:Dr,event:Lr}=(0,h.createDecorators)();let Yr;var Ur=new WeakMap,Or=new WeakMap,Pr=new WeakMap,Vr=new WeakMap,Hr=new WeakMap,jr=new WeakSet,Fr=new WeakMap,Br=new WeakMap,Gr=new WeakMap,Jr=new WeakMap,$r=new WeakMap,qr=new WeakMap,Kr=new WeakMap;class Xr extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,jr),(0,s.A)(this,Ur,cr(this)),(0,s.A)(this,Or,(dr(this),ur(this))),(0,s.A)(this,Pr,(pr(this),hr(this))),(0,s.A)(this,Vr,(mr(this),gr(this))),(0,s.A)(this,Hr,(br(this),vr(this))),(0,s.A)(this,Fr,(Ar(this),()=>{(0,o.A)(jr,this,fr).emit()})),(0,s.A)(this,Br,xr(this)),(0,s.A)(this,Gr,(yr(this),()=>{(0,o.A)(jr,this,Er).emit()})),(0,s.A)(this,Jr,Nr(this)),(0,s.A)(this,$r,(Mr(this),()=>{(0,o.A)(jr,this,Sr).emit()})),(0,s.A)(this,qr,Tr(this)),(0,s.A)(this,Kr,(Ir(this),()=>{(0,o.A)(jr,this,_r).emit()}))}get taskId(){return(0,c.A)(Ur,this)}set taskId(e){(0,l.A)(Ur,this,e)}get replay(){return(0,c.A)(Or,this)}set replay(e){(0,l.A)(Or,this,e)}get replayDelay(){return(0,c.A)(Pr,this)}set replayDelay(e){(0,l.A)(Pr,this,e)}get supports(){return(0,c.A)(Vr,this)}set supports(e){(0,l.A)(Vr,this,e)}render(){return p().createElement(Qr,{taskId:this.taskId,replay:this.replay,replayDelay:this.replayDelay,supports:this.supports,onShare:(0,c.A)(Fr,this),onPause:(0,c.A)(Gr,this),onResume:(0,c.A)($r,this),onCancel:(0,c.A)(Kr,this)})}}function Qr(e){var t;let{taskId:i,replay:n,replayDelay:a,supports:s,onShare:r,onPause:o,onResume:l,onCancel:c}=e;const{task:d,jobs:h,error:m,humanInputRef:b,skipToResults:v,watchAgain:A}=(0,M.S)(i,n,a),x=null!==(t=null==d?void 0:d.title)&&void 0!==t?t:"",E=null==d?void 0:d.state,w=U.QB.includes(E),{messages:y,inputRequiredJobId:N}=(0,nr.e)(d,h),S=(0,u.useMemo)((()=>null==h?void 0:h.flatMap((e=>e.generatedView?{id:e.id,view:e.generatedView}:[]))),[h]),[R,T]=(0,u.useState)(null),[_,C]=(0,u.useState)(null);(0,u.useEffect)((()=>{(0,g.getRuntime)().applyPageTitle(x)}),[x]),(0,u.useEffect)((()=>{m&&(0,g.handleHttpError)(m)}),[m]);const I=(0,u.useCallback)(((e,t)=>{var i;null===(i=b.current)||void 0===i||i.call(b,e,t)}),[b]),W=(0,u.useMemo)((()=>({humanInput:I,onShare:r,onPause:o,onResume:l,onCancel:c,supports:s,activeExpandedViewJobId:R,setActiveExpandedViewJobId:T,activeToolCallJobId:_,setActiveToolCallJobId:C})),[I,r,o,l,c,s,R,_]),z=(0,u.useRef)(!1),D=(0,u.useRef)(!1),L=(0,u.useRef)(null),Y=!!d;(0,u.useEffect)((()=>{const e=L.current,t=null==e?void 0:e.firstElementChild;if(D.current||!e||!t)return;const i=()=>{z.current&&(D.current=e.scrollTop+e.clientHeight+6<e.scrollHeight)};let n;e.addEventListener("scroll",i);const a=new k.A((()=>{D.current||(z.current=!1,e.scrollTo({top:t.scrollHeight,behavior:"instant"}),clearTimeout(n),n=setTimeout((()=>{z.current=!0}),100))}));return a.observe(t),()=>{a.disconnect(),e.removeEventListener("scroll",i)}}),[Y]);const P=(0,u.useMemo)((()=>_?null==h?void 0:h.find((e=>e.id===_)):null),[_,h]);return p().createElement(K.j.Provider,{value:W},p().createElement("div",{className:ar.A.container},p().createElement("div",{className:ar.A.header},p().createElement("div",{className:ar.A.left}),p().createElement("h1",null,x),p().createElement("div",{className:ar.A.right},p().createElement(O.Py,{icon:Wr,variant:"mini",onClick:r}))),Y?p().createElement("div",{className:ar.A.main,ref:L},p().createElement("div",{className:ar.A.narrow},null==y?void 0:y.map(((e,t,i)=>p().createElement("div",{className:ar.A.message,key:t},"user"===e.role?p().createElement(sr.R,{content:e.content}):p().createElement(rr.G,{jobs:e.jobs,taskState:E,isLatest:t===i.length-1})))))):p().createElement("div",{className:ar.A["loading-icon"]},p().createElement(O.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})),n||null!=s&&s.chat?p().createElement("div",{className:ar.A.footer},p().createElement("div",{className:ar.A.narrow},n?p().createElement(G.b,{taskDone:w,skipToResults:v,watchAgain:A}):p().createElement(J.s,{taskState:E,taskDone:w,inputRequiredJobId:N}))):null),p().createElement("div",{className:f()(ar.A.aside,{[ar.A.expanded]:!!_})},_&&p().createElement(or.n,{job:P})),R&&p().createElement(F.f,{views:S}))}tr=Xr,({e:[cr,dr,ur,pr,hr,mr,gr,br,vr,fr,kr,Ar,xr,Er,wr,yr,Nr,Sr,Rr,Mr,Tr,_r,Cr,Ir],c:[Yr,lr]}=(0,d.A)(tr,[zr("ai-portal.chat-stream",{shadowOptions:!1})],[[Dr(),1,"taskId"],[Dr({type:Boolean}),1,"replay"],[Dr({type:Number}),1,"replayDelay"],[Dr({attribute:!1}),1,"supports"],[Lr({type:"share"}),1,"shareEvent",e=>(0,c.A)(Hr,e),(e,t)=>(0,l.A)(Hr,e,t)],[Lr({type:"pause"}),1,"pauseEvent",e=>(0,c.A)(Br,e),(e,t)=>(0,l.A)(Br,e,t)],[Lr({type:"resume"}),1,"resumeEvent",e=>(0,c.A)(Jr,e),(e,t)=>(0,l.A)(Jr,e,t)],[Lr({type:"cancel"}),1,"cancelEvent",e=>(0,c.A)(qr,e),(e,t)=>(0,l.A)(qr,e,t)]],0,(e=>Kr.has((0,r.A)(e))),m.ReactNextElement)),lr();const Zr=i.p+"images/8c2cf79e.png",eo=i.p+"images/0cbe181e.png",to=i.p+"images/87c8a33b.png",io=i.p+"images/f542faa9.png",no=i.p+"images/8e5c445f.png",ao=i.p+"images/dd5fc700.png",so=i.p+"images/4215203f.png",ro=i.p+"images/5e54ffc5.png";let oo=function(e){return e.AI_EMPLOYEES="AI_EMPLOYEES",e}({});const lo="bricks/ai-portal/ai-employees",co=b.i18n.getFixedT(null,lo);var uo,po=i(98036);let ho,mo,go,bo,vo;(0,b.initializeI18n)(lo,{en:{AI_EMPLOYEES:"AI Employees"},zh:{AI_EMPLOYEES:"AI 数字人"}});const fo=[Zr,eo,to,io,no,ao,so,ro],{defineElement:ko,property:Ao}=(0,h.createDecorators)();let xo;var Eo=new WeakMap,wo=new WeakMap;class yo extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,Eo,mo(this)),(0,s.A)(this,wo,(go(this),bo(this))),vo(this)}get list(){return(0,c.A)(Eo,this)}set list(e){(0,l.A)(Eo,this,e)}get industries(){return(0,c.A)(wo,this)}set industries(e){(0,l.A)(wo,this,e)}render(){return p().createElement(No,{list:this.list,industries:this.industries})}}function No(e){let{list:t,industries:i}=e;const n=(0,u.useMemo)((()=>[...new Set([...null!=i?i:[],...(null!=t?t:[]).map((e=>e.industry))])]),[i,t]),[a,s]=(0,u.useState)(n[0]),r=(0,u.useMemo)((()=>{const e=new Map;return null==t||t.forEach((t=>{if(t.industry!==a)return;let i=e.get(t.role);i||e.set(t.role,i=[]),i.push(t)})),[...e.entries()]}),[a,t]);return p().createElement("div",{className:"container"},p().createElement("h1",null,co(oo.AI_EMPLOYEES)),p().createElement("ul",{className:"nav"},n.map((e=>p().createElement("li",{key:e,className:"item"},p().createElement("a",{className:f()({active:e===a}),onClick:()=>s(e)},e))))),p().createElement("ul",{className:"groups"},null==r?void 0:r.map((e=>{let[t,i]=e;return p().createElement("li",{key:t,className:"group"},p().createElement("h2",null,t),p().createElement("ul",{className:"list"},i.map(((e,t)=>p().createElement("li",{key:e.name,className:"item"},p().createElement("div",{className:"heading"},p().createElement("div",{className:"avatar"},p().createElement("img",{src:fo[t%fo.length]})),p().createElement("div",{className:"title"},e.name)),p().createElement("div",{className:"description"},e.description))))))}))))}uo=yo,({e:[mo,go,bo,vo],c:[xo,ho]}=(0,d.A)(uo,[ko("ai-portal.ai-employees",{styleTexts:[po.A]})],[[Ao({attribute:!1}),1,"list"],[Ao({attribute:!1}),1,"industries"]],0,void 0,m.ReactNextElement)),ho()},61408:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s)()(a());r.push([e.id,':host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;width:261px;height:100%;background:#f6f7f9;border-right:1px solid #e3e5eb;padding:26px 16px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -16px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:8px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:1;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:261px;height:100%;transition:width 0.3s ease-in-out}.collapsed{width:0;overflow:visible}.collapsed .sidebar{transform:translateX(-100%)}.collapsed .alternative{opacity:1}:host([behavior="drawer"]){z-index:1;width:0}:host(:not([behavior="drawer"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.links{border-bottom:1px solid rgba(0,0,0,0.06);padding-bottom:16px;margin-bottom:16px}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 13px;border-radius:8px;color:#000}.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -16px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .loading{display:flex;justify-content:center;padding:8px}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}',""]);const o=r.toString()},82165:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s),o=i(20062),l=i.n(o),c=new URL(i(32360),i.b),d=r()(a()),u=l()(c);d.push([e.id,`:host{display:block;background-color:#fff;background-image:url(${u});background-position:center;background-size:cover;background-repeat:no-repeat;background-attachment:fixed}:host([hidden]){display:none}`,""]);const p=d.toString()},89518:(e,t,i)=>{e.exports=i.p+"images/f819b04a.png"},91107:(e,t,i)=>{e.exports=i.p+"images/eef4f2bd.png"},98036:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s),o=i(20062),l=i.n(o),c=new URL(i(15733),i.b),d=r()(a()),u=l()(c);d.push([e.id,`:host{display:block;position:relative;width:100%;height:100%;overflow:hidden;background-color:rgb(205,206,207);background-image:url(${u});background-size:cover;background-repeat:no-repeat;background-position:center;background-attachment:fixed;color:#262626;padding:48px 24px;overflow-y:auto}:host([hidden]){display:none}*{box-sizing:border-box}.container{max-width:1400px;margin:0 auto}h1,\nh2{font-weight:500;margin:0}h1{font-size:20px;line-height:28px}h2{font-size:16px;line-height:22px}.nav,\n.groups,\n.list{list-style:none;margin:0;padding:0}.nav{display:flex;font-size:16px;margin-top:17px}.nav .item + .item{margin-left:32px}.nav .item a{color:rgba(38,38,38,0.65);cursor:pointer}.nav .item a.active{color:#262626;font-weight:500}.nav .item a.active::after{content:"";display:block;width:100%;height:4px;background-color:currentColor;border-radius:2px}.groups{margin-top:27px}.group + .group{margin-top:32px}.list{margin-top:16px;display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:24px}.list .item{background:rgba(255,255,255,0.9);box-shadow:0px 2px 5px 0px rgba(0,0,0,0.08);border-radius:12px;padding:20px 26px}.heading{display:flex;align-items:center}.avatar{width:48px;height:48px;border-radius:12px;margin-right:16px;background-color:#d5d6e6}.title{font-size:16px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.description{margin-top:13px;font-size:13px;color:rgba(0,0,0,0.45);line-height:18px;height:54px;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}`,""]);const p=d.toString()}}]);
|
|
3
|
+
//# sourceMappingURL=3561.79095c66.js.map
|