@next-bricks/ai-portal 0.20.13 → 0.20.14
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 +13 -13
- package/dist/chunks/{3362.90a6e017.js → 3362.6c6c0c0c.js} +2 -2
- package/dist/chunks/3362.6c6c0c0c.js.map +1 -0
- package/dist/chunks/{8230.e8052bfd.js → 8230.e3b8a575.js} +3 -3
- package/dist/chunks/8230.e3b8a575.js.map +1 -0
- package/dist/chunks/elevo-sidebar.566893c2.js +3 -0
- package/dist/chunks/elevo-sidebar.566893c2.js.map +1 -0
- package/dist/chunks/{main.c5a8080f.js → main.ed728f19.js} +2 -2
- package/dist/chunks/{main.c5a8080f.js.map → main.ed728f19.js.map} +1 -1
- package/dist/examples.json +9 -9
- package/dist/{index.975dc931.js → index.0a56f8fb.js} +2 -2
- package/dist/{index.975dc931.js.map → index.0a56f8fb.js.map} +1 -1
- package/dist/manifest.json +65 -52
- package/dist/types.json +222 -208
- package/dist-types/elevo-sidebar/ChatHistory.d.ts +5 -1
- package/dist-types/elevo-sidebar/index.d.ts +4 -0
- package/package.json +2 -2
- package/dist/chunks/3362.90a6e017.js.map +0 -1
- package/dist/chunks/8230.e8052bfd.js.map +0 -1
- package/dist/chunks/elevo-sidebar.859a89ed.js +0 -3
- package/dist/chunks/elevo-sidebar.859a89ed.js.map +0 -1
- /package/dist/chunks/{8230.e8052bfd.js.LICENSE.txt → 8230.e3b8a575.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{elevo-sidebar.859a89ed.js.LICENSE.txt → elevo-sidebar.566893c2.js.LICENSE.txt} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! For license information please see 8230.
|
|
2
|
-
"use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[8230],{24:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(36758),a=n.n(i),s=n(40935),r=n.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,n)=>{e.exports=n.p+"images/4b299d0b.png"},21411:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(36758),a=n.n(i),s=n(40935),r=n.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,n)=>{n.d(t,{A:()=>o});var i=n(36758),a=n.n(i),s=n(40935),r=n.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,n)=>{n.d(t,{A:()=>p});var i=n(36758),a=n.n(i),s=n(40935),r=n.n(s),o=n(20062),l=n.n(o),c=new URL(n(15733),n.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,n)=>{e.exports=n.p+"images/6336f999.png"},42873:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(36758),a=n.n(i),s=n(40935),r=n.n(s),o=n(20062),l=n.n(o),c=new URL(n(89518),n.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,n)=>{n.d(t,{A:()=>p});var i=n(36758),a=n.n(i),s=n(40935),r=n.n(s),o=n(20062),l=n.n(o),c=new URL(n(91107),n.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,n)=>{n.d(t,{A:()=>o});var i=n(36758),a=n.n(i),s=n(40935),r=n.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()},61408:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(36758),a=n.n(i),s=n(40935),r=n.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;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:23px}.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}.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:not(.active)::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: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()},62339:(e,t,n)=>{var i,a=n(74635),s=n(70918),r=n(26902),o=n(5536),l=n(86121),c=n(70829),d=n(62740),u=n(18769),p=n.n(u),h=n(7921),m=n(11280),g=n(23081),b=(n(65168),n(90079)),v=n(53373),f=n.n(v),x=n(99126),k=n(67566),A=n(8324),E=n(69445),y=n(2460),w=n(32464),N=n(58231),S=n(36494),R=n(97642),T=n(40369),_=n(59533),M=n(34999),C=n(27954),I=n(24388),W=n(56938),z=n(76239),O=n(39295),Y=n(39194),L=n(16854),D=n(55805),U=n(85620),V=n(73349),P=n(62601),j=n(57097),B=n(83490),H=n(54163),F=n(61015),$=n(66653),q=n(62897);let G,K,X,Q,J,Z,ee,te,ne,ie,ae,se,re,oe,le,ce,de,ue,pe,he,me,ge,be,ve,fe,xe,ke,Ae,Ee,ye;(0,b.initializeI18n)(y.NS,y.I);const{defineElement:we,property:Ne,event:Se,method:Re}=(0,h.createDecorators)(),Te=(0,u.memo)(Ke),_e=(0,u.forwardRef)(Ge);let Me;var Ce=new WeakMap,Ie=new WeakMap,We=new WeakMap,ze=new WeakMap,Oe=new WeakMap,Ye=new WeakMap,Le=new WeakMap,De=new WeakSet,Ue=new WeakMap,Ve=new WeakMap,Pe=new WeakMap,je=new WeakMap,Be=new WeakMap,He=new WeakMap,Fe=new WeakMap,$e=new WeakMap;class qe extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,De),(0,s.A)(this,Ce,(G(this),X(this))),(0,s.A)(this,Ie,(Q(this),J(this))),(0,s.A)(this,We,(Z(this),ee(this))),(0,s.A)(this,ze,(te(this),ne(this))),(0,s.A)(this,Oe,(ie(this),ae(this))),(0,s.A)(this,Ye,(se(this),re(this))),(0,s.A)(this,Le,(oe(this),le(this))),(0,s.A)(this,Ue,(ue(this),()=>{(0,o.A)(De,this,ce).emit()})),(0,s.A)(this,Ve,pe(this)),(0,s.A)(this,Pe,(ge(this),()=>{(0,o.A)(De,this,he).emit()})),(0,s.A)(this,je,be(this)),(0,s.A)(this,Be,(xe(this),()=>{(0,o.A)(De,this,ve).emit()})),(0,s.A)(this,He,ke(this)),(0,s.A)(this,Fe,(ye(this),()=>{(0,o.A)(De,this,Ae).emit()})),(0,s.A)(this,$e,(0,u.createRef)())}get taskId(){return(0,c.A)(Ce,this)}set taskId(e){(0,l.A)(Ce,this,e)}get task(){return(0,c.A)(Ie,this)}set task(e){(0,l.A)(Ie,this,e)}get jobs(){return(0,c.A)(We,this)}set jobs(e){(0,l.A)(We,this,e)}get replay(){return(0,c.A)(ze,this)}set replay(e){(0,l.A)(ze,this,e)}get replayDelay(){return(0,c.A)(Oe,this)}set replayDelay(e){(0,l.A)(Oe,this,e)}get supports(){return(0,c.A)(Ye,this)}set supports(e){(0,l.A)(Ye,this,e)}resumed(){var e;null===(e=(0,c.A)($e,this).current)||void 0===e||e.resumed()}render(){return p().createElement(_e,{taskId:this.taskId,jobs:this.jobs,task:this.task,replay:this.replay,replayDelay:this.replayDelay,supports:this.supports,onShare:(0,c.A)(Ue,this),onPause:(0,c.A)(Pe,this),onResume:(0,c.A)(Be,this),onCancel:(0,c.A)(Fe,this),ref:(0,c.A)($e,this)})}}function Ge(e,t){var n;let{taskId:i,task:a,jobs:s,replay:r,replayDelay:o,supports:l,onShare:c,onPause:d,onResume:h,onCancel:m}=e;const b=(0,u.useRef)(null),{task:v,jobs:x,error:y,humanInputRef:C,resumedRef:I,skipToResults:W,watchAgain:z}=(0,T.S)(i,r,o),O=i?v:a,Y=i?x:s,G=null==O?void 0:O.plan,K=(0,_.B)(O,Y),X=null==K?void 0:K.nodes,Q=null==K?void 0:K.edges,J=null==K?void 0:K.nav,Z=null==K?void 0:K.views,ee=null==K?void 0:K.jobLevels,te=null!==(n=null==O?void 0:O.title)&&void 0!==n?n:"",ne=null==O?void 0:O.state,[ie,ae]=(0,u.useState)(null),se=(0,u.useMemo)((()=>{if(ie){const[e,t]=ie.split(":");if("job"===e||"view"===e)return t}return null}),[ie]);(0,u.useImperativeHandle)(t,(()=>({resumed:()=>{var e;return null===(e=I.current)||void 0===e?void 0:e.call(I)}})),[I]);const re=(0,u.useRef)(!1);(0,u.useEffect)((()=>{const e=setTimeout((()=>{re.current=!0}),3e3);return()=>{clearTimeout(e)}}),[]),(0,u.useEffect)((()=>{(0,g.getRuntime)().applyPageTitle(te)}),[te]),(0,u.useEffect)((()=>{y&&(0,g.handleHttpError)(y)}),[y]);const oe=(0,u.useCallback)(((e,t)=>{var n;null===(n=C.current)||void 0===n||n.call(C,e,t)}),[C]),[le,ce]=(0,u.useState)(null),de=(0,u.useCallback)(((e,t)=>{ce((n=>{if(!t){if(!n)return null;const t=new Map(n);return t.delete(e)?t:n}return n?new Map(n).set(e,t):new Map([[e,t]])}))}),[]),{sizeReady:ue,nodes:pe,edges:he}=(0,R.g)({rawNodes:X,rawEdges:Q,state:ne,sizeMap:le}),me=(0,u.useRef)(!1),ge=(0,u.useRef)(!1),[be,ve]=(0,u.useState)(!1),{grabbing:fe,transform:xe,transformRef:ke,zoomer:Ae}=(0,N.f)({rootRef:b,zoomable:ue,scrollable:ue&&!be,pannable:ue,manualScrolledUpRef:ge}),Ee=(0,u.useRef)(!1),ye=(0,u.useMemo)((()=>{let e=null;const t=n=>{const i=ke.current,a="function"==typeof n?n(i):n;if(!a)return;const{transform:s,translateBy:r}=a;let o=(0,k.A)(b.current);var l,c,d,u,p,h;re.current&&0!==a.duration&&(Ee.current=!0,o=o.transition().duration(null!==(l=a.duration)&&void 0!==l?l:300).ease((e=>e*(2-e))).on("end",(()=>{if(Ee.current=!1,e){const n=e;e=null,t(n)}}))),s?Ae.transform(o,new A.uV(null!==(c=s.k)&&void 0!==c?c:i.k,null!==(d=s.x)&&void 0!==d?d:i.x,null!==(u=s.y)&&void 0!==u?u:i.y)):Ae.translateBy(o,null!==(p=r[0])&&void 0!==p?p:0,null!==(h=r[1])&&void 0!==h?h:0)};return n=>{Ee.current?e=n:t(n)}}),[ke,Ae]),{centered:we,setCentered:Ne,reCenterRef:Se}=(0,S.E)({nodes:pe,sizeReady:ue,zoomer:Ae,rootRef:b,pushZoomTransition:ye}),Re=L.QB.includes(null!=ne?ne:"working"),_e=!Re&&2===pe.length,Me=(0,u.useMemo)((()=>new Set(he.map((e=>e.source)))),[he]),Ce=(0,u.useMemo)((()=>{if(!ue)return null;const e=[];for(const t of pe)Me.has(t.id)||e.push(t);return e.length>0?Math.max(...e.map((e=>e.view.y+e.view.height))):null}),[pe,Me,ue]),Ie=(0,u.useRef)(null);(0,u.useEffect)((()=>{Ie.current=Ce}),[Ce]),(0,u.useEffect)((()=>{const e=b.current;!e||null===Ce||me.current&&ge.current||ye((t=>{const{offsetHeight:n}=e,i=Ce*t.k+t.y,a=n-L.xX-i;return a<0?{transform:{y:t.y+a},duration:a>-100?100:a<-500?300:200}:null}))}),[Ce,ye]),(0,u.useEffect)((()=>{const e=Ie.current,t=b.current;if(!t||null===e||Ee.current)return;const{offsetHeight:n}=t,i=e*xe.k+xe.y,a=n-L.xX-i;me.current=a<0}),[xe,Ae]);const We=(0,u.useCallback)((()=>{Se.current=!0,Ne(!1)}),[Se,Ne]),ze=(0,u.useCallback)((e=>{Ae.scaleTo((0,k.A)(b.current),e)}),[Ae]),Oe=(0,u.useMemo)((()=>ue?(0,E.o)(pe.map((e=>e.view))):null),[pe,ue]);(0,u.useEffect)((()=>{if(!Oe)return;const e=b.current;if(!e)return;const{offsetWidth:t,offsetHeight:n}=e,i=t/xe.k,a=n/xe.k,s=-(i-20-Oe.x),r=i-20+(Oe.x+Oe.width),o=-(a-20-Oe.y),l=a-20+(Oe.y+Oe.height);Ae.translateExtent([[s,o],[r,l]])}),[Ae,xe.k,Oe]);const Ye=(0,u.useCallback)((e=>{let{nodeId:t,jobId:n,behavior:i,block:a}=e;const s=b.current,r=pe.filter((e=>{var i;return!(t&&e.id!==t||n&&(null===(i=e.job)||void 0===i?void 0:i.id)!==n)}));if(!s||0===r.length)return;const o=(0,E.o)(r.map((e=>e.view))),{x:l,y:c}=(0,P.D)(o,[s.offsetWidth,s.offsetHeight],[L.RV,L.kq,L.xX,L.bL],ke.current,a);(l||c)&&ye({translateBy:[l,c],duration:"instant"===i?0:void 0})}),[pe,ye,ke]),Le=(0,u.useCallback)(((e,t)=>{const n=b.current;if(!n||!ue)return;let i,a=0,s=0,r=300;const o="left"===e||"right"===e;if("line"===t)i=40*("up"===e||"left"===e?1:-1),r=150;else if("page"===t)i=(n.offsetHeight-L.xX)*("up"===e?-1:1);else{const{y:t,height:a}=(0,E.o)(pe.map((e=>e.view)));if("down"===e){const e=t+a-t+L.xX;i=n.offsetHeight-e-ke.current.y}else i=t+L.RV-ke.current.y}o?a=i:s=i,(a||s)&&ye({translateBy:[a,s],duration:r})}),[pe,ye,ue,ke]),[De,Ue]=(0,u.useState)(null),[Ve,Pe]=(0,u.useState)(null),[je,Be]=p().useState(null),He=(0,u.useMemo)((()=>({humanInput:oe,onShare:c,onPause:d,onResume:h,onCancel:m,onNodeResize:de,activeToolCallJobId:De,setActiveToolCallJobId:Ue,setActiveNodeId:ae,hoverOnScrollableContent:be,setHoverOnScrollableContent:ve,activeExpandedViewJobId:Ve,setActiveExpandedViewJobId:Pe,supports:l,setActiveFile:Be})),[De,be,Ve,de,oe,c,d,h,m,l]),Fe=(0,u.useMemo)((()=>De?null==Y?void 0:Y.find((e=>e.id===De)):null),[De,Y]),$e=(0,u.useCallback)((e=>{for(const t of e.nativeEvent.composedPath()){if(t instanceof HTMLElement&&t.classList.contains(w.A.node))return;if(t===b.current)break}ae(null)}),[]);return(0,u.useEffect)((()=>{const e=b.current;if(!e||Fe||Ve||je)return;const t=t=>{if(document.activeElement&&document.activeElement!==document.body&&document.activeElement!==e)return;const n=(0,j.l)(t,{activeNodeId:ie,nodes:pe});if(!n)return;const{action:i,node:a}=n;if("scroll"===i)Le(n.direction,n.range);else if("enter"===i){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"===i?"view"===a.type?Pe(a.job.id):Ue(a.job.id):"switch-active-node"===i&&(a?(ae(a.id),"job"===a.type||"view"===a.type?Ye({jobId:a.job.id,behavior:"smooth"}):Ye({nodeId:a.id,behavior:"smooth"})):ae(null))};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}),[ie,Fe,Ve,je,pe,Ye,Le]),p().createElement(U.Q.Provider,{value:He},p().createElement("div",{className:f()(w.A.root,{[w.A.loading]:!O}),ref:b,style:{cursor:fe?"grabbing":"grab"},tabIndex:-1,onClick:$e},!O&&p().createElement("div",{className:w.A["loading-icon"]},p().createElement(D.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})),p().createElement("div",{className:f()(w.A.canvas,{[w.A.ready]:ue&&we}),style:{transform:`translate3d(${xe.x}px, ${xe.y}px, 0) scale(${xe.k})`}},p().createElement("svg",{className:w.A.edges},he.map((e=>e.target===L.Jw?null:p().createElement("path",{className:w.A.edge,key:`${e.source}-${e.target}`,d:e.points.map(((e,t)=>{let{x:n,y:i}=e;return`${0===t?"M":"L"}${n},${i}`})).join(" ")})))),pe.map((e=>{var t,n,i;return p().createElement(Te,{key:e.id,id:e.id,type:e.type,content:e.content,job:e.job,state:e.state,startTime:null==O?void 0:O.startTime,taskLoading:_e,instructionLoading:"instruction"===e.type&&!Me.has(e.id)&&!L.QB.includes(null!==(t=e.state)&&void 0!==t?t:"working")&&!L.X4.includes(null!=ne?ne:"working"),edges:he,x:null===(n=e.view)||void 0===n?void 0:n.x,y:null===(i=e.view)||void 0===i?void 0:i.y,active:ie===e.id})})))),p().createElement("div",{className:w.A.widgets},p().createElement(H.s,{nav:J,plan:G,jobs:Y,jobLevels:ee,currentNavId:se,taskState:ne,onClick:e=>{ae(`job:${e}`),Ye({jobId:e,block:"start"})}}),p().createElement(M.l,{scale:xe.k,onScaleChange:ze,onReCenter:We}),r?p().createElement(F.b,{taskDone:Re,skipToResults:W,watchAgain:()=>{z(),Ne(!1)}}):null!=l&&l.chat?p().createElement($.s,{taskState:ne,taskDone:Re}):null),Fe&&p().createElement(V.M,{job:Fe}),Ve&&p().createElement(B.f,{views:Z}),je&&p().createElement(q.d,{file:je}))}function Ke(e){let{id:t,type:n,state:i,job:a,content:s,startTime:r,taskLoading:o,instructionLoading:l,x:c,y:d,active:h}=e;const m=(0,u.useRef)(null),{onNodeResize:g,setActiveNodeId:b}=(0,u.useContext)(U.Q);(0,u.useEffect)((()=>{const e=m.current;if(!e)return;const n=new x.A((()=>{g(t,[e.offsetWidth,e.offsetHeight])}));return n.observe(e),()=>{n.disconnect(),g(t,null)}}),[t,g]),(0,u.useEffect)((()=>{const e=m.current;if(!e)return;const t=e=>{e.stopPropagation()};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}}),[]);const v=(0,u.useCallback)((()=>{"start"!==n&&"instruction"!==n&&b(t)}),[t,b,n]);return p().createElement("div",{className:f()(w.A.node,{[w.A.ready]:null!=c&&null!=d}),ref:m,style:{left:c,top:d},onClick:v},"start"===n?p().createElement(C.H,null):"end"===n?p().createElement(O.s,null):"requirement"===n?p().createElement(I.O,{content:s,startTime:r,loading:o,active:h}):"instruction"===n?p().createElement(W.L,{content:a.instruction,loading:l}):"view"===n?p().createElement(Y.Y,{job:a,active:h}):p().createElement(z.W,{state:i,job:a,active:h}))}i=qe,({e:[X,Q,J,Z,ee,te,ne,ie,ae,se,re,oe,le,ce,de,ue,pe,he,me,ge,be,ve,fe,xe,ke,Ae,Ee,ye,G],c:[Me,K]}=(0,d.A)(i,[we("ai-portal.cruise-canvas",{shadowOptions:!1})],[[Ne(),1,"taskId"],[Ne({attribute:!1}),1,"task"],[Ne({attribute:!1}),1,"jobs"],[Ne({type:Boolean}),1,"replay"],[Ne({type:Number}),1,"replayDelay"],[Ne({attribute:!1}),1,"supports"],[Se({type:"share"}),1,"shareEvent",e=>(0,c.A)(Le,e),(e,t)=>(0,l.A)(Le,e,t)],[Se({type:"pause"}),1,"pauseEvent",e=>(0,c.A)(Ve,e),(e,t)=>(0,l.A)(Ve,e,t)],[Se({type:"resume"}),1,"resumeEvent",e=>(0,c.A)(je,e),(e,t)=>(0,l.A)(je,e,t)],[Se({type:"cancel"}),1,"cancelEvent",e=>(0,c.A)(He,e),(e,t)=>(0,l.A)(He,e,t)],[Re(),2,"resumed"]],0,(e=>$e.has((0,r.A)(e))),m.ReactNextElement)),K();var Xe=n(71451),Qe=n(41030);let Je=function(e){return e.ASK_ANY_THING="ASK_ANYTHING",e.COMMON_TASKS="COMMON_TASKS",e}({});const Ze="bricks/ai-portal/chat-box",et={en:{[Je.ASK_ANY_THING]:"Ask anything",[Je.COMMON_TASKS]:"Common tasks"},zh:{[Je.ASK_ANY_THING]:"询问任何问题",[Je.COMMON_TASKS]:"常用任务"}},tt=b.i18n.getFixedT(null,Ze),nt=n.p+"images/af389fa6.svg";var it,at=n(47008);let st,rt,ot,lt,ct,dt,ut,pt,ht,mt,gt,bt,vt,ft,xt;(0,b.initializeI18n)(Ze,et);const kt=(0,m.wrapBrick)("eo-icon"),{defineElement:At,property:Et,event:yt}=(0,h.createDecorators)();let wt;var Nt=new WeakMap,St=new WeakMap,Rt=new WeakMap,Tt=new WeakMap,_t=new WeakMap,Mt=new WeakMap,Ct=new WeakSet,It=new WeakMap;class Wt extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ct),(0,s.A)(this,Nt,rt(this)),(0,s.A)(this,St,(ot(this),lt(this))),(0,s.A)(this,Rt,(ct(this),dt(this))),(0,s.A)(this,Tt,(ut(this),pt(this))),(0,s.A)(this,_t,(ht(this),mt(this))),(0,s.A)(this,Mt,(gt(this),bt(this))),(0,s.A)(this,It,(xt(this),e=>{(0,o.A)(Ct,this,vt).emit(e)}))}get disabled(){return(0,c.A)(Nt,this)}set disabled(e){(0,l.A)(Nt,this,e)}get placeholder(){return(0,c.A)(St,this)}set placeholder(e){(0,l.A)(St,this,e)}get autoFocus(){return(0,c.A)(Rt,this)}set autoFocus(e){(0,l.A)(Rt,this,e)}get suggestions(){return(0,c.A)(Tt,this)}set suggestions(e){(0,l.A)(Tt,this,e)}get suggestionsLabel(){return(0,c.A)(_t,this)}set suggestionsLabel(e){(0,l.A)(_t,this,e)}render(){return p().createElement(zt,{disabled:this.disabled,placeholder:this.placeholder,autoFocus:this.autoFocus,suggestions:this.suggestions,suggestionsLabel:this.suggestionsLabel,onSubmit:(0,c.A)(It,this)})}}function zt(e){let{disabled:t,placeholder:n,autoFocus:i,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)((()=>{i&&Promise.resolve().then((()=>{var e;null===(e=l.current)||void 0===e||e.focus()}))}),[]);const v=(0,u.useMemo)((()=>null!=a&&a.length?(0,Qe.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(Xe.e,{containerRef:o,ref:l,value:c,minRows:3,paddingSize:62,autoResize:!0,disabled:t,placeholder:null!=n?n:tt(Je.ASK_ANY_THING),submitWhen:"enter-without-shift",onSubmit:m,onChange:g}),p().createElement("button",{className:"btn-send",disabled:!c,onClick:b},p().createElement(kt,{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:nt,width:16,height:16}),p().createElement("span",null,null!=s?s:tt(Je.COMMON_TASKS))),v.map(((e,t)=>p().createElement(Ot,{key:t,suggestions:e,pixelPerSecond:10*(t+2),onSelect:f})))))}function Ot(e){let{suggestions:t,pixelPerSecond:n,onSelect:i}=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 i,r,l,c,d=0;const u=(t.offsetWidth-7)/2+7;function p(e){r=e,void 0===l&&(l=e),void 0!==i&&(d+=e-i,i=void 0),o((e-l-d)/1e3*n%u),c=requestAnimationFrame(p)}c=requestAnimationFrame(p);const h=()=>{cancelAnimationFrame(c),i=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,n]),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:()=>i(e),title:e.content},p().createElement("div",{className:"title"},e.title),p().createElement("div",{className:"content"},e.content)))))))}it=Wt,({e:[rt,ot,lt,ct,dt,ut,pt,ht,mt,gt,bt,vt,ft,xt],c:[wt,st]}=(0,d.A)(it,[At("ai-portal.chat-box",{styleTexts:[at.A]})],[[Et({type:Boolean}),1,"disabled"],[Et(),1,"placeholder"],[Et({type:Boolean}),1,"autoFocus"],[Et({attribute:!1}),1,"suggestions"],[Et(),1,"suggestionsLabel"],[yt({type:"message.submit"}),1,"messageSubmit",e=>(0,c.A)(Mt,e),(e,t)=>(0,l.A)(Mt,e,t)]],0,(e=>It.has((0,r.A)(e))),m.ReactNextElement)),st();var Yt,Lt=n(82165);let Dt;const{defineElement:Ut}=(0,h.createDecorators)();let Vt;class Pt extends m.ReactNextElement{render(){return p().createElement(jt,null)}}function jt(){return p().createElement("slot",null)}Yt=Pt,[Vt,Dt]=(0,d.A)(Yt,[Ut("ai-portal.home-container",{styleTexts:[Lt.A]})],[],0,void 0,m.ReactNextElement).c,Dt();var Bt=n(21302),Ht=n.n(Bt);let Ft=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 $t="bricks/ai-portal/chat-history",qt={en:{[Ft.TODAY]:"Today",[Ft.YESTERDAY]:"Yesterday",[Ft.PREVIOUS_7_DAYS]:"Previous 7 days",[Ft.PREVIOUS_30_DAYS]:"Previous 30 days"},zh:{[Ft.TODAY]:"今天",[Ft.YESTERDAY]:"昨天",[Ft.PREVIOUS_7_DAYS]:"过去7天",[Ft.PREVIOUS_30_DAYS]:"过去30天"}},Gt=b.i18n.getFixedT(null,$t);var Kt,Xt=n(21411);let Qt,Jt,Zt,en,tn,nn,an,sn,rn,on,ln,cn,dn,un,pn;(0,b.initializeI18n)($t,qt);const hn=(0,m.wrapBrick)("eo-icon"),mn=(0,m.wrapBrick)("eo-link"),gn=(0,m.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),{defineElement:bn,property:vn,event:fn}=(0,h.createDecorators)();let xn;var kn=new WeakMap,An=new WeakMap,En=new WeakMap,yn=new WeakMap,wn=new WeakSet,Nn=new WeakMap,Sn=new WeakMap,Rn=new WeakMap;class Tn extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,wn),(0,s.A)(this,kn,Jt(this)),(0,s.A)(this,An,(Zt(this),en(this))),(0,s.A)(this,En,(tn(this),nn(this))),(0,s.A)(this,yn,(an(this),sn(this))),(0,s.A)(this,Nn,(ln(this),e=>{(0,o.A)(wn,this,rn).emit(e)})),(0,s.A)(this,Sn,cn(this)),(0,s.A)(this,Rn,(pn(this),e=>{(0,o.A)(wn,this,dn).emit({nextToken:e})}))}get list(){return(0,c.A)(kn,this)}set list(e){(0,l.A)(kn,this,e)}get actions(){return(0,c.A)(An,this)}set actions(e){(0,l.A)(An,this,e)}get nextToken(){return(0,c.A)(En,this)}set nextToken(e){(0,l.A)(En,this,e)}render(){return p().createElement(_n,{root:this,list:this.list,actions:this.actions,nextToken:this.nextToken,onActionClick:(0,c.A)(Nn,this),onLoadMore:(0,c.A)(Rn,this)})}}function _n(e){let{root:t,list:n,actions:i,nextToken:a,onActionClick:s,onLoadMore:r}=e;const o=(0,u.useMemo)((()=>{const e=new Map,t=Ht()(),i=t.clone().startOf("day"),a=i.clone().subtract(1,"day"),s=i.clone().subtract(7,"days"),r=i.clone().subtract(30,"days"),o=+i/1e3,l=+a/1e3,c=+s/1e3,d=+r/1e3,u=+t.clone().startOf("year")/1e3;for(const t of null!=n?n:[]){let n;n=t.startTime>=o?Gt(Ft.TODAY):t.startTime>=l?Gt(Ft.YESTERDAY):t.startTime>=c?Gt(Ft.PREVIOUS_7_DAYS):t.startTime>=d?Gt(Ft.PREVIOUS_30_DAYS):t.startTime>=u?Ht()(1e3*t.startTime).format("MMMM"):Ht()(1e3*t.startTime).format("YYYY");let i=e.get(n);i||e.set(n,i={title:n,items:[]}),i.items.push(t)}return[...e.values()]}),[n]),[l,c]=(0,u.useState)(null),d=(0,u.useRef)(null);return(0,u.useEffect)((()=>{const e=d.current;if(!e||!a)return;const n=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&r(a)}),{root:t});return n.observe(e),()=>{n.disconnect()}}),[a,r,t]),n?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(mn,{className:f()("item",{active:l===e.id}),url:e.url},p().createElement("div",{className:"item-title",title:e.title},e.title),p().createElement(gn,{className:"actions",actions:i,onActionClick:t=>{s({action:t.detail,item:e})},onVisibleChange:t=>{c(t.detail?e.id:null)}}),!L.QB.includes(e.state)&&p().createElement("div",{className:"working"})))))))))),a&&p().createElement("div",{className:"load-more",ref:d},p().createElement(hn,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))):p().createElement("div",{className:"loading"},p().createElement(hn,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}))}Kt=Tn,({e:[Jt,Zt,en,tn,nn,an,sn,rn,on,ln,cn,dn,un,pn],c:[xn,Qt]}=(0,d.A)(Kt,[bn("ai-portal.chat-history",{styleTexts:[Xt.A]})],[[vn({attribute:!1}),1,"list"],[vn({attribute:!1}),1,"actions"],[vn(),1,"nextToken"],[fn({type:"action.click"}),1,"actionClick",e=>(0,c.A)(yn,e),(e,t)=>(0,l.A)(yn,e,t)],[fn({type:"load.more"}),1,"loadMore",e=>(0,c.A)(Sn,e),(e,t)=>(0,l.A)(Sn,e,t)]],0,(e=>Rn.has((0,r.A)(e))),m.ReactNextElement)),Qt();var Mn,Cn=n(89575),In=n(24);let Wn,zn,On,Yn,Ln,Dn,Un,Vn,Pn,jn,Bn,Hn,Fn,$n,qn,Gn,Kn,Xn,Qn,Jn,Zn;const ei=(0,m.wrapBrick)("eo-mini-line-chart"),{defineElement:ti,property:ni}=(0,h.createDecorators)();let ii;var ai=new WeakMap,si=new WeakMap,ri=new WeakMap,oi=new WeakMap,li=new WeakMap,ci=new WeakMap,di=new WeakMap,ui=new WeakMap,pi=new WeakMap,hi=new WeakMap;class mi extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,ai,zn(this)),(0,s.A)(this,si,(On(this),Yn(this))),(0,s.A)(this,ri,(Ln(this),Dn(this))),(0,s.A)(this,oi,(Un(this),Vn(this))),(0,s.A)(this,li,(Pn(this),jn(this))),(0,s.A)(this,ci,(Bn(this),Hn(this))),(0,s.A)(this,di,(Fn(this),$n(this))),(0,s.A)(this,ui,(qn(this),Gn(this))),(0,s.A)(this,pi,(Kn(this),Xn(this))),(0,s.A)(this,hi,(Qn(this),Jn(this))),Zn(this)}get label(){return(0,c.A)(ai,this)}set label(e){(0,l.A)(ai,this,e)}get value(){return(0,c.A)(si,this)}set value(e){(0,l.A)(si,this,e)}get size(){return(0,c.A)(ri,this)}set size(e){(0,l.A)(ri,this,e)}get lineColor(){return(0,c.A)(oi,this)}set lineColor(e){(0,l.A)(oi,this,e)}get showArea(){return(0,c.A)(li,this)}set showArea(e){(0,l.A)(li,this,e)}get min(){return(0,c.A)(ci,this)}set min(e){(0,l.A)(ci,this,e)}get max(){return(0,c.A)(di,this)}set max(e){(0,l.A)(di,this,e)}get xField(){return(0,c.A)(ui,this)}set xField(e){(0,l.A)(ui,this,e)}get yField(){return(0,c.A)(pi,this)}set yField(e){(0,l.A)(pi,this,e)}get data(){return(0,c.A)(hi,this)}set data(e){(0,l.A)(hi,this,e)}render(){return p().createElement(gi,{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 gi(e){let{label:t,value:n,size:i,...a}=e;return"small"===i?p().createElement("div",{className:"container"},p().createElement("div",{className:"label-and-stat"},p().createElement("div",{className:"label"},t),p().createElement("div",{className:"stat"},n)),p().createElement("div",{className:"chart"},p().createElement(ei,(0,Cn.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(ei,(0,Cn.A)({},a,{lineWidth:2,width:"auto",height:"92"}))),p().createElement("div",{className:"stat"},n)))}Mn=mi,({e:[zn,On,Yn,Ln,Dn,Un,Vn,Pn,jn,Bn,Hn,Fn,$n,qn,Gn,Kn,Xn,Qn,Jn,Zn],c:[ii,Wn]}=(0,d.A)(Mn,[ti("ai-portal.stat-with-mini-chart",{styleTexts:[In.A]})],[[ni(),1,"label"],[ni(),1,"value"],[ni(),1,"size"],[ni(),1,"lineColor"],[ni({type:Boolean}),1,"showArea"],[ni({type:Number}),1,"min"],[ni({type:Number}),1,"max"],[ni(),1,"xField"],[ni(),1,"yField"],[ni({attribute:!1}),1,"data"]],0,void 0,m.ReactNextElement)),Wn();const bi=n.p+"images/7385e5f5.png";var vi,fi=n(31653);let xi;const{defineElement:ki}=(0,h.createDecorators)();let Ai;class Ei extends m.ReactNextElement{render(){return p().createElement(yi,null)}}function yi(){return p().createElement("img",{src:bi,alt:"Elevo",width:95,height:26})}vi=Ei,[Ai,xi]=(0,d.A)(vi,[ki("ai-portal.elevo-logo",{styleTexts:[fi.A]})],[],0,void 0,m.ReactNextElement).c,xi();let wi=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}({});const Ni="bricks/ai-portal/elevo-sidebar",Si={en:{[wi.NEW_CHAT]:"New chat",[wi.LOGOUT]:"Logout",[wi.TODAY]:"Today",[wi.YESTERDAY]:"Yesterday",[wi.PREVIOUS_7_DAYS]:"Previous 7 days",[wi.PREVIOUS_30_DAYS]:"Previous 30 days"},zh:{[wi.NEW_CHAT]:"新对话",[wi.LOGOUT]:"登出",[wi.TODAY]:"今天",[wi.YESTERDAY]:"昨天",[wi.PREVIOUS_7_DAYS]:"过去7天",[wi.PREVIOUS_30_DAYS]:"过去30天"}},Ri=b.i18n.getFixedT(null,Ni);var Ti=n(61408);const _i=(0,m.wrapBrick)("eo-icon"),Mi=(0,m.wrapBrick)("eo-link"),Ci=(0,m.wrapBrick)("eo-dropdown-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),Ii=(0,m.wrapBrick)("eo-easyops-avatar"),Wi=(0,m.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),zi=(0,m.wrapBrick)("ai-portal.icon-button");var Oi=n(57372);const Yi=async(e,t)=>(await Oi.http.post("api/gateway/logic.llm.aiops_service/api/v1/llm/agent/flow/search",e,t)).data;function Li(e){let{activeId:t,actions:n,urlTemplate:i,onActionClick:a,onHistoryClick:s}=e;const r=(0,u.useRef)(null),[o,l]=(0,u.useState)(null),[c,d]=(0,u.useState)(),[h,m]=(0,u.useState)();(0,u.useEffect)((()=>{Promise.all([Yi({next_token:h}),new Promise((e=>setTimeout(e,500)))]).then((e=>{let[t]=e;l((e=>[...null!=e?e:[],...t.data])),d(t.next_token)})).catch((e=>{console.error("Error loading chat history:",e)}))}),[h]);const g=(0,u.useMemo)((()=>{const e=new Map,t=Ht()(),n=t.clone().startOf("day"),i=n.clone().subtract(1,"day"),a=n.clone().subtract(7,"days"),s=n.clone().subtract(30,"days"),r=+n/1e3,l=+i/1e3,c=+a/1e3,d=+s/1e3,u=+t.clone().startOf("year")/1e3;for(const t of null!=o?o:[]){let n;n=t.startTime>=r?Ri(wi.TODAY):t.startTime>=l?Ri(wi.YESTERDAY):t.startTime>=c?Ri(wi.PREVIOUS_7_DAYS):t.startTime>=d?Ri(wi.PREVIOUS_30_DAYS):t.startTime>=u?Ht()(1e3*t.startTime).format("MMMM"):Ht()(1e3*t.startTime).format("YYYY");let i=e.get(n);i||e.set(n,i={title:n,items:[]}),i.items.push(t)}return[...e.values()]}),[o]),[b,v]=(0,u.useState)(null),x=(0,u.useRef)(null);return(0,u.useEffect)((()=>{const e=x.current,t=r.current;if(!e||!c||!t)return;const n=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&m(c)}),{root:t});return n.observe(e),()=>{n.disconnect()}}),[c]),o?p().createElement("div",{className:"history",ref:r},p().createElement("ul",null,g.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(Mi,(0,Cn.A)({className:f()("item",{"actions-active":e.id===b,active:e.id===t}),onClick:s},i?{url:(r=i,o=e,null==r?void 0:r.replace(/{{(.*?)}}/g,((e,t)=>(0,Qe.get)(o,t))))}:null),p().createElement("div",{className:"item-title",title:e.title},e.title),p().createElement(Wi,{className:"actions",actions:n,onActionClick:t=>{a({action:t.detail,item:e})},onVisibleChange:t=>{v(t.detail?e.id:null)}}),!L.QB.includes(e.state)&&p().createElement("div",{className:"working"})));var r,o}))))))),c&&p().createElement("div",{className:"load-more",ref:x},p().createElement(_i,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))):p().createElement("div",{className:"history"},p().createElement("div",{className:"loading"},p().createElement(_i,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})))}var Di;let Ui,Vi,Pi,ji,Bi,Hi,Fi,$i,qi,Gi,Ki,Xi,Qi,Ji,Zi,ea,ta,na,ia,aa,sa,ra,oa;(0,b.initializeI18n)(Ni,Si);const la={lib:"easyops",icon:"sidebar"},ca=[{icon:{lib:"fa",prefix:"fas",icon:"arrow-right-from-bracket"},text:Ri(wi.LOGOUT)}],{defineElement:da,property:ua,event:pa}=(0,h.createDecorators)();let ha;var ma=new WeakMap,ga=new WeakMap,ba=new WeakMap,va=new WeakMap,fa=new WeakMap,xa=new WeakMap,ka=new WeakMap,Aa=new WeakMap,Ea=new WeakSet,ya=new WeakMap,wa=new WeakMap,Na=new WeakMap;class Sa extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ea),(0,s.A)(this,ma,Vi(this)),(0,s.A)(this,ga,(Pi(this),ji(this))),(0,s.A)(this,ba,(Bi(this),Hi(this))),(0,s.A)(this,va,(Fi(this),$i(this))),(0,s.A)(this,fa,(qi(this),Gi(this))),(0,s.A)(this,xa,(Ki(this),Xi(this))),(0,s.A)(this,ka,(Qi(this),Ji(this))),(0,s.A)(this,Aa,(Zi(this),ea(this))),(0,s.A)(this,ya,(ia(this),()=>{(0,o.A)(Ea,this,ta).emit()})),(0,s.A)(this,wa,aa(this)),(0,s.A)(this,Na,(oa(this),e=>{(0,o.A)(Ea,this,sa).emit(e)}))}get userInstanceId(){return(0,c.A)(ma,this)}set userInstanceId(e){(0,l.A)(ma,this,e)}get behavior(){return(0,c.A)(ga,this)}set behavior(e){(0,l.A)(ga,this,e)}get logoUrl(){return(0,c.A)(ba,this)}set logoUrl(e){(0,l.A)(ba,this,e)}get newChatUrl(){return(0,c.A)(va,this)}set newChatUrl(e){(0,l.A)(va,this,e)}get historyActiveId(){return(0,c.A)(fa,this)}set historyActiveId(e){(0,l.A)(fa,this,e)}get historyUrlTemplate(){return(0,c.A)(xa,this)}set historyUrlTemplate(e){(0,l.A)(xa,this,e)}get historyActions(){return(0,c.A)(ka,this)}set historyActions(e){(0,l.A)(ka,this,e)}render(){return p().createElement(Ra,{userInstanceId:this.userInstanceId,behavior:this.behavior,logoUrl:this.logoUrl,newChatUrl:this.newChatUrl,historyActiveId:this.historyActiveId,historyUrlTemplate:this.historyUrlTemplate,historyActions:this.historyActions,onLogout:(0,c.A)(ya,this),onActionClick:(0,c.A)(Na,this)})}}function Ra(e){let{userInstanceId:t,behavior:n,logoUrl:i,newChatUrl:a,historyActiveId:s,historyUrlTemplate:r,historyActions:o,onLogout:l,onActionClick:c}=e;const[d,h]=(0,u.useState)("drawer"===n),m=(0,u.useCallback)((()=>{h(!0)}),[]),g=(0,u.useCallback)((()=>{h(!1)}),[]);(0,u.useEffect)((()=>{"drawer"===n&&h(!0)}),[n]);const b=(0,u.useCallback)((()=>{h(!0)}),[]),v=(0,u.useCallback)((()=>{"drawer"===n&&h(!0)}),[n]);return p().createElement("div",{className:f()("container",{collapsed:d})},"drawer"===n&&!d&&p().createElement("div",{className:"mask",onClick:b}),p().createElement("div",{className:"sidebar"},p().createElement("div",{className:"logo-bar"},p().createElement(Mi,{url:i,className:"logo-link"},p().createElement("img",{className:"logo",alt:"Elevo",src:bi,width:95,height:26})),p().createElement(zi,{icon:la,variant:"light",onClick:m})),p().createElement(Mi,{className:"new-chat",url:a},p().createElement(_i,{className:"new-chat-icon",lib:"easyops",icon:"new-chat"}),Ri(wi.NEW_CHAT)),p().createElement(Li,{activeId:s,urlTemplate:r,actions:o,onActionClick:c,onHistoryClick:v}),p().createElement("div",{className:"footer"},p().createElement(Ci,{className:"dropdown",actions:ca,onActionClick:l},p().createElement("button",{className:"account"},p().createElement(Ii,{nameOrInstanceId:t,showName:!0,size:"xs"}))))),p().createElement("div",{className:"alternative"},p().createElement(zi,{icon:la,variant:"light",onClick:g}),p().createElement(Mi,{className:"new-chat",url:a},p().createElement(_i,{className:"new-chat-icon",lib:"easyops",icon:"new-chat"}),Ri(wi.NEW_CHAT))))}Di=Sa,({e:[Vi,Pi,ji,Bi,Hi,Fi,$i,qi,Gi,Ki,Xi,Qi,Ji,Zi,ea,ta,na,ia,aa,sa,ra,oa],c:[ha,Ui]}=(0,d.A)(Di,[da("ai-portal.elevo-sidebar",{styleTexts:[Ti.A]})],[[ua(),1,"userInstanceId"],[ua(),1,"behavior"],[ua(),1,"logoUrl"],[ua(),1,"newChatUrl"],[ua(),1,"historyActiveId"],[ua(),1,"historyUrlTemplate"],[ua({attribute:!1}),1,"historyActions"],[pa({type:"logout"}),1,"logout",e=>(0,c.A)(Aa,e),(e,t)=>(0,l.A)(Aa,e,t)],[pa({type:"action.click"}),1,"actionClick",e=>(0,c.A)(wa,e),(e,t)=>(0,l.A)(wa,e,t)]],0,(e=>Na.has((0,r.A)(e))),m.ReactNextElement)),Ui();var Ta,_a=n(47338);let Ma,Ca,Ia,Wa,za,Oa,Ya,La,Da;const Ua=(0,m.wrapBrick)("eo-icon"),Va=(0,m.wrapBrick)("eo-tooltip"),{defineElement:Pa,property:ja}=(0,h.createDecorators)();let Ba;var Ha=new WeakMap,Fa=new WeakMap,$a=new WeakMap,qa=new WeakMap;class Ga extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,Ha,Ca(this)),(0,s.A)(this,Fa,(Ia(this),Wa(this))),(0,s.A)(this,$a,(za(this),Oa(this))),(0,s.A)(this,qa,(Ya(this),La(this))),Da(this)}get icon(){return(0,c.A)(Ha,this)}set icon(e){(0,l.A)(Ha,this,e)}get tooltip(){return(0,c.A)(Fa,this)}set tooltip(e){(0,l.A)(Fa,this,e)}get disabled(){return(0,c.A)($a,this)}set disabled(e){(0,l.A)($a,this,e)}get variant(){return(0,c.A)(qa,this)}set variant(e){(0,l.A)(qa,this,e)}render(){return p().createElement(Ka,{icon:this.icon,tooltip:this.tooltip,disabled:this.disabled})}}function Ka(e){let{icon:t,tooltip:n,disabled:i}=e;const a=p().createElement("button",{disabled:i},p().createElement(Ua,t));return n?p().createElement(Va,{content:n},a):a}Ta=Ga,({e:[Ca,Ia,Wa,za,Oa,Ya,La,Da],c:[Ba,Ma]}=(0,d.A)(Ta,[Pa("ai-portal.icon-button",{styleTexts:[_a.A]})],[[ja({attribute:!1}),1,"icon"],[ja(),1,"tooltip"],[ja({type:Boolean}),1,"disabled"],[ja({render:!1}),1,"variant"]],0,void 0,m.ReactNextElement)),Ma();let Xa=function(e){return e.ALL="ALL",e}({});const Qa="bricks/ai-portal/show-cases",Ja={en:{[Xa.ALL]:"All"},zh:{[Xa.ALL]:"全部"}},Za=b.i18n.getFixedT(null,Qa);var es,ts=n(42873);let ns,is,as,ss,rs;(0,b.initializeI18n)(Qa,Ja);const os=(0,m.wrapBrick)("eo-link"),{defineElement:ls,property:cs}=(0,h.createDecorators)();let ds;var us=new WeakMap,ps=new WeakMap;class hs extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,us,is(this)),(0,s.A)(this,ps,(as(this),ss(this))),rs(this)}get list(){return(0,c.A)(us,this)}set list(e){(0,l.A)(us,this,e)}get taskUrlTemplate(){return(0,c.A)(ps,this)}set taskUrlTemplate(e){(0,l.A)(ps,this,e)}render(){return p().createElement(ms,{list:this.list,taskUrlTemplate:this.taskUrlTemplate})}}function ms(e){let{list:t,taskUrlTemplate:n}=e;const i=(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==i?void 0:i.map((e=>p().createElement("li",{key:e,className:"item"},p().createElement("a",{className:f()({active:a===e}),onClick:()=>s(e)},null===e?Za(Xa.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(os,{className:"link",url:(t=n,i=e,null==t?void 0:t.replace(/{{(.*?)}}/g,((e,t)=>(0,Qe.get)(i,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,i})))):null}es=hs,({e:[is,as,ss,rs],c:[ds,ns]}=(0,d.A)(es,[ls("ai-portal.show-cases",{styleTexts:[ts.A]})],[[cs({attribute:!1}),1,"list"],[cs(),1,"taskUrlTemplate"]],0,void 0,m.ReactNextElement)),ns();let gs=function(e){return e.MCP_TOOL_HUB="MCP_TOOL_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 bs="bricks/ai-portal/mcp-tools",vs={en:{[gs.MCP_TOOL_HUB]:"MCP Tool Hub",[gs.ALL]:"All",[gs.SERVER_cmdb]:"CMDB",[gs.SERVER_alert]:"Alert",[gs.SERVER_web_builder]:"View",[gs.SERVER_host_troubleshooting]:"Host Troubleshooting",[gs.SERVER_system_inspection]:"System Inspection"},zh:{[gs.MCP_TOOL_HUB]:"MCP 工具中心",[gs.ALL]:"全部",[gs.SERVER_cmdb]:"CMDB",[gs.SERVER_alert]:"告警",[gs.SERVER_web_builder]:"视图",[gs.SERVER_host_troubleshooting]:"主机故障排查",[gs.SERVER_system_inspection]:"系统巡检"}},fs=b.i18n.getFixedT(null,bs);var xs,ks=n(31748);let As,Es,ys;(0,b.initializeI18n)(bs,vs);const ws={lib:"antd",icon:"tool"},Ns=(0,m.wrapBrick)("eo-icon"),{defineElement:Ss,property:Rs}=(0,h.createDecorators)();let Ts;var _s=new WeakMap;class Ms extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,_s,Es(this)),ys(this)}get list(){return(0,c.A)(_s,this)}set list(e){(0,l.A)(_s,this,e)}render(){return p().createElement(Cs,{list:this.list})}}function Cs(e){let{list:t}=e;const n=(0,u.useMemo)((()=>{const e=new Map;return null==t||t.forEach((t=>{const n=fs(`SERVER_${t.server.id.replaceAll("-","_")}`,t.server.name);let i=e.get(n);i||e.set(n,i=[]),i.push(t)})),e}),[t]),i=(0,u.useMemo)((()=>[null,...n.keys()]),[n]),[a,s]=(0,u.useState)(null),r=(0,u.useMemo)((()=>{const e=[...n];return null===a?e:e.filter((e=>{let[t]=e;return t===a}))}),[a,n]);return p().createElement("div",{className:"container"},p().createElement("h1",null,fs(gs.MCP_TOOL_HUB)),p().createElement("ul",{className:"nav"},null==i?void 0:i.map((e=>p().createElement("li",{key:e,className:"item"},p().createElement("a",{className:f()({active:a===e}),onClick:()=>s(e)},null===e?fs(gs.ALL):e))))),p().createElement("ul",{className:"groups"},null==r?void 0:r.map((e=>{let[t,n]=e;return p().createElement("li",{key:t,className:"group"},p().createElement("h2",null,t),p().createElement("ul",{className:"list"},n.map((e=>{var t;return p().createElement("li",{key:e.name,className:"item"},p().createElement("div",{className:"heading"},p().createElement(Ns,(0,Cn.A)({className:"icon"},null!==(t=e.icon)&&void 0!==t?t:ws,{fallback:ws})),p().createElement("div",{className:"title"},e.title)),p().createElement("div",{className:"description"},e.description))}))))}))))}xs=Ms,({e:[Es,ys],c:[Ts,As]}=(0,d.A)(xs,[Ss("ai-portal.mcp-tools",{styleTexts:[ks.A]})],[[Rs({attribute:!1}),1,"list"]],0,void 0,m.ReactNextElement)),As()},82165:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(36758),a=n.n(i),s=n(40935),r=n.n(s),o=n(20062),l=n.n(o),c=new URL(n(32360),n.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,n)=>{e.exports=n.p+"images/f819b04a.png"},91107:(e,t,n)=>{e.exports=n.p+"images/eef4f2bd.png"}}]);
|
|
3
|
-
//# sourceMappingURL=8230.
|
|
1
|
+
/*! For license information please see 8230.e3b8a575.js.LICENSE.txt */
|
|
2
|
+
"use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[8230],{24:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(36758),a=n.n(i),s=n(40935),r=n.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,n)=>{e.exports=n.p+"images/4b299d0b.png"},21411:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(36758),a=n.n(i),s=n(40935),r=n.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,n)=>{n.d(t,{A:()=>o});var i=n(36758),a=n.n(i),s=n(40935),r=n.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,n)=>{n.d(t,{A:()=>p});var i=n(36758),a=n.n(i),s=n(40935),r=n.n(s),o=n(20062),l=n.n(o),c=new URL(n(15733),n.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,n)=>{e.exports=n.p+"images/6336f999.png"},42873:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(36758),a=n.n(i),s=n(40935),r=n.n(s),o=n(20062),l=n.n(o),c=new URL(n(89518),n.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,n)=>{n.d(t,{A:()=>p});var i=n(36758),a=n.n(i),s=n(40935),r=n.n(s),o=n(20062),l=n.n(o),c=new URL(n(91107),n.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,n)=>{n.d(t,{A:()=>o});var i=n(36758),a=n.n(i),s=n(40935),r=n.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()},61408:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(36758),a=n.n(i),s=n(40935),r=n.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;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:23px}.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}.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:not(.active)::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: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()},62339:(e,t,n)=>{var i,a=n(74635),s=n(70918),r=n(26902),o=n(5536),l=n(86121),c=n(70829),d=n(62740),u=n(18769),p=n.n(u),h=n(7921),m=n(11280),g=n(23081),b=(n(65168),n(90079)),f=n(53373),v=n.n(f),x=n(99126),k=n(67566),A=n(8324),E=n(69445),w=n(2460),y=n(32464),R=n(58231),S=n(36494),N=n(97642),T=n(40369),_=n(59533),M=n(34999),C=n(27954),I=n(24388),W=n(56938),z=n(76239),O=n(39295),L=n(39194),Y=n(16854),D=n(55805),U=n(85620),V=n(73349),P=n(62601),B=n(57097),j=n(83490),H=n(54163),F=n(61015),$=n(66653),q=n(62897);let G,K,X,Q,J,Z,ee,te,ne,ie,ae,se,re,oe,le,ce,de,ue,pe,he,me,ge,be,fe,ve,xe,ke,Ae,Ee,we;(0,b.initializeI18n)(w.NS,w.I);const{defineElement:ye,property:Re,event:Se,method:Ne}=(0,h.createDecorators)(),Te=(0,u.memo)(Ke),_e=(0,u.forwardRef)(Ge);let Me;var Ce=new WeakMap,Ie=new WeakMap,We=new WeakMap,ze=new WeakMap,Oe=new WeakMap,Le=new WeakMap,Ye=new WeakMap,De=new WeakSet,Ue=new WeakMap,Ve=new WeakMap,Pe=new WeakMap,Be=new WeakMap,je=new WeakMap,He=new WeakMap,Fe=new WeakMap,$e=new WeakMap;class qe extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,De),(0,s.A)(this,Ce,(G(this),X(this))),(0,s.A)(this,Ie,(Q(this),J(this))),(0,s.A)(this,We,(Z(this),ee(this))),(0,s.A)(this,ze,(te(this),ne(this))),(0,s.A)(this,Oe,(ie(this),ae(this))),(0,s.A)(this,Le,(se(this),re(this))),(0,s.A)(this,Ye,(oe(this),le(this))),(0,s.A)(this,Ue,(ue(this),()=>{(0,o.A)(De,this,ce).emit()})),(0,s.A)(this,Ve,pe(this)),(0,s.A)(this,Pe,(ge(this),()=>{(0,o.A)(De,this,he).emit()})),(0,s.A)(this,Be,be(this)),(0,s.A)(this,je,(xe(this),()=>{(0,o.A)(De,this,fe).emit()})),(0,s.A)(this,He,ke(this)),(0,s.A)(this,Fe,(we(this),()=>{(0,o.A)(De,this,Ae).emit()})),(0,s.A)(this,$e,(0,u.createRef)())}get taskId(){return(0,c.A)(Ce,this)}set taskId(e){(0,l.A)(Ce,this,e)}get task(){return(0,c.A)(Ie,this)}set task(e){(0,l.A)(Ie,this,e)}get jobs(){return(0,c.A)(We,this)}set jobs(e){(0,l.A)(We,this,e)}get replay(){return(0,c.A)(ze,this)}set replay(e){(0,l.A)(ze,this,e)}get replayDelay(){return(0,c.A)(Oe,this)}set replayDelay(e){(0,l.A)(Oe,this,e)}get supports(){return(0,c.A)(Le,this)}set supports(e){(0,l.A)(Le,this,e)}resumed(){var e;null===(e=(0,c.A)($e,this).current)||void 0===e||e.resumed()}render(){return p().createElement(_e,{taskId:this.taskId,jobs:this.jobs,task:this.task,replay:this.replay,replayDelay:this.replayDelay,supports:this.supports,onShare:(0,c.A)(Ue,this),onPause:(0,c.A)(Pe,this),onResume:(0,c.A)(je,this),onCancel:(0,c.A)(Fe,this),ref:(0,c.A)($e,this)})}}function Ge(e,t){var n;let{taskId:i,task:a,jobs:s,replay:r,replayDelay:o,supports:l,onShare:c,onPause:d,onResume:h,onCancel:m}=e;const b=(0,u.useRef)(null),{task:f,jobs:x,error:w,humanInputRef:C,resumedRef:I,skipToResults:W,watchAgain:z}=(0,T.S)(i,r,o),O=i?f:a,L=i?x:s,G=null==O?void 0:O.plan,K=(0,_.B)(O,L),X=null==K?void 0:K.nodes,Q=null==K?void 0:K.edges,J=null==K?void 0:K.nav,Z=null==K?void 0:K.views,ee=null==K?void 0:K.jobLevels,te=null!==(n=null==O?void 0:O.title)&&void 0!==n?n:"",ne=null==O?void 0:O.state,[ie,ae]=(0,u.useState)(null),se=(0,u.useMemo)((()=>{if(ie){const[e,t]=ie.split(":");if("job"===e||"view"===e)return t}return null}),[ie]);(0,u.useImperativeHandle)(t,(()=>({resumed:()=>{var e;return null===(e=I.current)||void 0===e?void 0:e.call(I)}})),[I]);const re=(0,u.useRef)(!1);(0,u.useEffect)((()=>{const e=setTimeout((()=>{re.current=!0}),3e3);return()=>{clearTimeout(e)}}),[]),(0,u.useEffect)((()=>{(0,g.getRuntime)().applyPageTitle(te)}),[te]),(0,u.useEffect)((()=>{w&&(0,g.handleHttpError)(w)}),[w]);const oe=(0,u.useCallback)(((e,t)=>{var n;null===(n=C.current)||void 0===n||n.call(C,e,t)}),[C]),[le,ce]=(0,u.useState)(null),de=(0,u.useCallback)(((e,t)=>{ce((n=>{if(!t){if(!n)return null;const t=new Map(n);return t.delete(e)?t:n}return n?new Map(n).set(e,t):new Map([[e,t]])}))}),[]),{sizeReady:ue,nodes:pe,edges:he}=(0,N.g)({rawNodes:X,rawEdges:Q,state:ne,sizeMap:le}),me=(0,u.useRef)(!1),ge=(0,u.useRef)(!1),[be,fe]=(0,u.useState)(!1),{grabbing:ve,transform:xe,transformRef:ke,zoomer:Ae}=(0,R.f)({rootRef:b,zoomable:ue,scrollable:ue&&!be,pannable:ue,manualScrolledUpRef:ge}),Ee=(0,u.useRef)(!1),we=(0,u.useMemo)((()=>{let e=null;const t=n=>{const i=ke.current,a="function"==typeof n?n(i):n;if(!a)return;const{transform:s,translateBy:r}=a;let o=(0,k.A)(b.current);var l,c,d,u,p,h;re.current&&0!==a.duration&&(Ee.current=!0,o=o.transition().duration(null!==(l=a.duration)&&void 0!==l?l:300).ease((e=>e*(2-e))).on("end",(()=>{if(Ee.current=!1,e){const n=e;e=null,t(n)}}))),s?Ae.transform(o,new A.uV(null!==(c=s.k)&&void 0!==c?c:i.k,null!==(d=s.x)&&void 0!==d?d:i.x,null!==(u=s.y)&&void 0!==u?u:i.y)):Ae.translateBy(o,null!==(p=r[0])&&void 0!==p?p:0,null!==(h=r[1])&&void 0!==h?h:0)};return n=>{Ee.current?e=n:t(n)}}),[ke,Ae]),{centered:ye,setCentered:Re,reCenterRef:Se}=(0,S.E)({nodes:pe,sizeReady:ue,zoomer:Ae,rootRef:b,pushZoomTransition:we}),Ne=Y.QB.includes(null!=ne?ne:"working"),_e=!Ne&&2===pe.length,Me=(0,u.useMemo)((()=>new Set(he.map((e=>e.source)))),[he]),Ce=(0,u.useMemo)((()=>{if(!ue)return null;const e=[];for(const t of pe)Me.has(t.id)||e.push(t);return e.length>0?Math.max(...e.map((e=>e.view.y+e.view.height))):null}),[pe,Me,ue]),Ie=(0,u.useRef)(null);(0,u.useEffect)((()=>{Ie.current=Ce}),[Ce]),(0,u.useEffect)((()=>{const e=b.current;!e||null===Ce||me.current&&ge.current||we((t=>{const{offsetHeight:n}=e,i=Ce*t.k+t.y,a=n-Y.xX-i;return a<0?{transform:{y:t.y+a},duration:a>-100?100:a<-500?300:200}:null}))}),[Ce,we]),(0,u.useEffect)((()=>{const e=Ie.current,t=b.current;if(!t||null===e||Ee.current)return;const{offsetHeight:n}=t,i=e*xe.k+xe.y,a=n-Y.xX-i;me.current=a<0}),[xe,Ae]);const We=(0,u.useCallback)((()=>{Se.current=!0,Re(!1)}),[Se,Re]),ze=(0,u.useCallback)((e=>{Ae.scaleTo((0,k.A)(b.current),e)}),[Ae]),Oe=(0,u.useMemo)((()=>ue?(0,E.o)(pe.map((e=>e.view))):null),[pe,ue]);(0,u.useEffect)((()=>{if(!Oe)return;const e=b.current;if(!e)return;const{offsetWidth:t,offsetHeight:n}=e,i=t/xe.k,a=n/xe.k,s=-(i-20-Oe.x),r=i-20+(Oe.x+Oe.width),o=-(a-20-Oe.y),l=a-20+(Oe.y+Oe.height);Ae.translateExtent([[s,o],[r,l]])}),[Ae,xe.k,Oe]);const Le=(0,u.useCallback)((e=>{let{nodeId:t,jobId:n,behavior:i,block:a}=e;const s=b.current,r=pe.filter((e=>{var i;return!(t&&e.id!==t||n&&(null===(i=e.job)||void 0===i?void 0:i.id)!==n)}));if(!s||0===r.length)return;const o=(0,E.o)(r.map((e=>e.view))),{x:l,y:c}=(0,P.D)(o,[s.offsetWidth,s.offsetHeight],[Y.RV,Y.kq,Y.xX,Y.bL],ke.current,a);(l||c)&&we({translateBy:[l,c],duration:"instant"===i?0:void 0})}),[pe,we,ke]),Ye=(0,u.useCallback)(((e,t)=>{const n=b.current;if(!n||!ue)return;let i,a=0,s=0,r=300;const o="left"===e||"right"===e;if("line"===t)i=40*("up"===e||"left"===e?1:-1),r=150;else if("page"===t)i=(n.offsetHeight-Y.xX)*("up"===e?-1:1);else{const{y:t,height:a}=(0,E.o)(pe.map((e=>e.view)));if("down"===e){const e=t+a-t+Y.xX;i=n.offsetHeight-e-ke.current.y}else i=t+Y.RV-ke.current.y}o?a=i:s=i,(a||s)&&we({translateBy:[a,s],duration:r})}),[pe,we,ue,ke]),[De,Ue]=(0,u.useState)(null),[Ve,Pe]=(0,u.useState)(null),[Be,je]=p().useState(null),He=(0,u.useMemo)((()=>({humanInput:oe,onShare:c,onPause:d,onResume:h,onCancel:m,onNodeResize:de,activeToolCallJobId:De,setActiveToolCallJobId:Ue,setActiveNodeId:ae,hoverOnScrollableContent:be,setHoverOnScrollableContent:fe,activeExpandedViewJobId:Ve,setActiveExpandedViewJobId:Pe,supports:l,setActiveFile:je})),[De,be,Ve,de,oe,c,d,h,m,l]),Fe=(0,u.useMemo)((()=>De?null==L?void 0:L.find((e=>e.id===De)):null),[De,L]),$e=(0,u.useCallback)((e=>{for(const t of e.nativeEvent.composedPath()){if(t instanceof HTMLElement&&t.classList.contains(y.A.node))return;if(t===b.current)break}ae(null)}),[]);return(0,u.useEffect)((()=>{const e=b.current;if(!e||Fe||Ve||Be)return;const t=t=>{if(document.activeElement&&document.activeElement!==document.body&&document.activeElement!==e)return;const n=(0,B.l)(t,{activeNodeId:ie,nodes:pe});if(!n)return;const{action:i,node:a}=n;if("scroll"===i)Ye(n.direction,n.range);else if("enter"===i){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"===i?"view"===a.type?Pe(a.job.id):Ue(a.job.id):"switch-active-node"===i&&(a?(ae(a.id),"job"===a.type||"view"===a.type?Le({jobId:a.job.id,behavior:"smooth"}):Le({nodeId:a.id,behavior:"smooth"})):ae(null))};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}),[ie,Fe,Ve,Be,pe,Le,Ye]),p().createElement(U.Q.Provider,{value:He},p().createElement("div",{className:v()(y.A.root,{[y.A.loading]:!O}),ref:b,style:{cursor:ve?"grabbing":"grab"},tabIndex:-1,onClick:$e},!O&&p().createElement("div",{className:y.A["loading-icon"]},p().createElement(D.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})),p().createElement("div",{className:v()(y.A.canvas,{[y.A.ready]:ue&&ye}),style:{transform:`translate3d(${xe.x}px, ${xe.y}px, 0) scale(${xe.k})`}},p().createElement("svg",{className:y.A.edges},he.map((e=>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:n,y:i}=e;return`${0===t?"M":"L"}${n},${i}`})).join(" ")})))),pe.map((e=>{var t,n,i;return p().createElement(Te,{key:e.id,id:e.id,type:e.type,content:e.content,job:e.job,state:e.state,startTime:null==O?void 0:O.startTime,taskLoading:_e,instructionLoading:"instruction"===e.type&&!Me.has(e.id)&&!Y.QB.includes(null!==(t=e.state)&&void 0!==t?t:"working")&&!Y.X4.includes(null!=ne?ne:"working"),edges:he,x:null===(n=e.view)||void 0===n?void 0:n.x,y:null===(i=e.view)||void 0===i?void 0:i.y,active:ie===e.id})})))),p().createElement("div",{className:y.A.widgets},p().createElement(H.s,{nav:J,plan:G,jobs:L,jobLevels:ee,currentNavId:se,taskState:ne,onClick:e=>{ae(`job:${e}`),Le({jobId:e,block:"start"})}}),p().createElement(M.l,{scale:xe.k,onScaleChange:ze,onReCenter:We}),r?p().createElement(F.b,{taskDone:Ne,skipToResults:W,watchAgain:()=>{z(),Re(!1)}}):null!=l&&l.chat?p().createElement($.s,{taskState:ne,taskDone:Ne}):null),Fe&&p().createElement(V.M,{job:Fe}),Ve&&p().createElement(j.f,{views:Z}),Be&&p().createElement(q.d,{file:Be}))}function Ke(e){let{id:t,type:n,state:i,job:a,content:s,startTime:r,taskLoading:o,instructionLoading:l,x:c,y:d,active:h}=e;const m=(0,u.useRef)(null),{onNodeResize:g,setActiveNodeId:b}=(0,u.useContext)(U.Q);(0,u.useEffect)((()=>{const e=m.current;if(!e)return;const n=new x.A((()=>{g(t,[e.offsetWidth,e.offsetHeight])}));return n.observe(e),()=>{n.disconnect(),g(t,null)}}),[t,g]),(0,u.useEffect)((()=>{const e=m.current;if(!e)return;const t=e=>{e.stopPropagation()};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}}),[]);const f=(0,u.useCallback)((()=>{"start"!==n&&"instruction"!==n&&b(t)}),[t,b,n]);return p().createElement("div",{className:v()(y.A.node,{[y.A.ready]:null!=c&&null!=d}),ref:m,style:{left:c,top:d},onClick:f},"start"===n?p().createElement(C.H,null):"end"===n?p().createElement(O.s,null):"requirement"===n?p().createElement(I.O,{content:s,startTime:r,loading:o,active:h}):"instruction"===n?p().createElement(W.L,{content:a.instruction,loading:l}):"view"===n?p().createElement(L.Y,{job:a,active:h}):p().createElement(z.W,{state:i,job:a,active:h}))}i=qe,({e:[X,Q,J,Z,ee,te,ne,ie,ae,se,re,oe,le,ce,de,ue,pe,he,me,ge,be,fe,ve,xe,ke,Ae,Ee,we,G],c:[Me,K]}=(0,d.A)(i,[ye("ai-portal.cruise-canvas",{shadowOptions:!1})],[[Re(),1,"taskId"],[Re({attribute:!1}),1,"task"],[Re({attribute:!1}),1,"jobs"],[Re({type:Boolean}),1,"replay"],[Re({type:Number}),1,"replayDelay"],[Re({attribute:!1}),1,"supports"],[Se({type:"share"}),1,"shareEvent",e=>(0,c.A)(Ye,e),(e,t)=>(0,l.A)(Ye,e,t)],[Se({type:"pause"}),1,"pauseEvent",e=>(0,c.A)(Ve,e),(e,t)=>(0,l.A)(Ve,e,t)],[Se({type:"resume"}),1,"resumeEvent",e=>(0,c.A)(Be,e),(e,t)=>(0,l.A)(Be,e,t)],[Se({type:"cancel"}),1,"cancelEvent",e=>(0,c.A)(He,e),(e,t)=>(0,l.A)(He,e,t)],[Ne(),2,"resumed"]],0,(e=>$e.has((0,r.A)(e))),m.ReactNextElement)),K();var Xe=n(71451),Qe=n(41030);let Je=function(e){return e.ASK_ANY_THING="ASK_ANYTHING",e.COMMON_TASKS="COMMON_TASKS",e}({});const Ze="bricks/ai-portal/chat-box",et={en:{[Je.ASK_ANY_THING]:"Ask anything",[Je.COMMON_TASKS]:"Common tasks"},zh:{[Je.ASK_ANY_THING]:"询问任何问题",[Je.COMMON_TASKS]:"常用任务"}},tt=b.i18n.getFixedT(null,Ze),nt=n.p+"images/af389fa6.svg";var it,at=n(47008);let st,rt,ot,lt,ct,dt,ut,pt,ht,mt,gt,bt,ft,vt,xt;(0,b.initializeI18n)(Ze,et);const kt=(0,m.wrapBrick)("eo-icon"),{defineElement:At,property:Et,event:wt}=(0,h.createDecorators)();let yt;var Rt=new WeakMap,St=new WeakMap,Nt=new WeakMap,Tt=new WeakMap,_t=new WeakMap,Mt=new WeakMap,Ct=new WeakSet,It=new WeakMap;class Wt extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ct),(0,s.A)(this,Rt,rt(this)),(0,s.A)(this,St,(ot(this),lt(this))),(0,s.A)(this,Nt,(ct(this),dt(this))),(0,s.A)(this,Tt,(ut(this),pt(this))),(0,s.A)(this,_t,(ht(this),mt(this))),(0,s.A)(this,Mt,(gt(this),bt(this))),(0,s.A)(this,It,(xt(this),e=>{(0,o.A)(Ct,this,ft).emit(e)}))}get disabled(){return(0,c.A)(Rt,this)}set disabled(e){(0,l.A)(Rt,this,e)}get placeholder(){return(0,c.A)(St,this)}set placeholder(e){(0,l.A)(St,this,e)}get autoFocus(){return(0,c.A)(Nt,this)}set autoFocus(e){(0,l.A)(Nt,this,e)}get suggestions(){return(0,c.A)(Tt,this)}set suggestions(e){(0,l.A)(Tt,this,e)}get suggestionsLabel(){return(0,c.A)(_t,this)}set suggestionsLabel(e){(0,l.A)(_t,this,e)}render(){return p().createElement(zt,{disabled:this.disabled,placeholder:this.placeholder,autoFocus:this.autoFocus,suggestions:this.suggestions,suggestionsLabel:this.suggestionsLabel,onSubmit:(0,c.A)(It,this)})}}function zt(e){let{disabled:t,placeholder:n,autoFocus:i,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)((()=>{i&&Promise.resolve().then((()=>{var e;null===(e=l.current)||void 0===e||e.focus()}))}),[]);const f=(0,u.useMemo)((()=>null!=a&&a.length?(0,Qe.chunk)(a,Math.max(2,Math.ceil(a.length/2))):[]),[a]),v=(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(Xe.e,{containerRef:o,ref:l,value:c,minRows:3,paddingSize:62,autoResize:!0,disabled:t,placeholder:null!=n?n:tt(Je.ASK_ANY_THING),submitWhen:"enter-without-shift",onSubmit:m,onChange:g}),p().createElement("button",{className:"btn-send",disabled:!c,onClick:b},p().createElement(kt,{lib:"fa",prefix:"fas",icon:"arrow-up"}))),!(null==f||!f.length)&&p().createElement("div",{className:"suggestions"},p().createElement("div",{className:"heading"},p().createElement("img",{className:"icon",src:nt,width:16,height:16}),p().createElement("span",null,null!=s?s:tt(Je.COMMON_TASKS))),f.map(((e,t)=>p().createElement(Ot,{key:t,suggestions:e,pixelPerSecond:10*(t+2),onSelect:v})))))}function Ot(e){let{suggestions:t,pixelPerSecond:n,onSelect:i}=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 i,r,l,c,d=0;const u=(t.offsetWidth-7)/2+7;function p(e){r=e,void 0===l&&(l=e),void 0!==i&&(d+=e-i,i=void 0),o((e-l-d)/1e3*n%u),c=requestAnimationFrame(p)}c=requestAnimationFrame(p);const h=()=>{cancelAnimationFrame(c),i=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,n]),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:()=>i(e),title:e.content},p().createElement("div",{className:"title"},e.title),p().createElement("div",{className:"content"},e.content)))))))}it=Wt,({e:[rt,ot,lt,ct,dt,ut,pt,ht,mt,gt,bt,ft,vt,xt],c:[yt,st]}=(0,d.A)(it,[At("ai-portal.chat-box",{styleTexts:[at.A]})],[[Et({type:Boolean}),1,"disabled"],[Et(),1,"placeholder"],[Et({type:Boolean}),1,"autoFocus"],[Et({attribute:!1}),1,"suggestions"],[Et(),1,"suggestionsLabel"],[wt({type:"message.submit"}),1,"messageSubmit",e=>(0,c.A)(Mt,e),(e,t)=>(0,l.A)(Mt,e,t)]],0,(e=>It.has((0,r.A)(e))),m.ReactNextElement)),st();var Lt,Yt=n(82165);let Dt;const{defineElement:Ut}=(0,h.createDecorators)();let Vt;class Pt extends m.ReactNextElement{render(){return p().createElement(Bt,null)}}function Bt(){return p().createElement("slot",null)}Lt=Pt,[Vt,Dt]=(0,d.A)(Lt,[Ut("ai-portal.home-container",{styleTexts:[Yt.A]})],[],0,void 0,m.ReactNextElement).c,Dt();var jt=n(21302),Ht=n.n(jt);let Ft=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 $t="bricks/ai-portal/chat-history",qt={en:{[Ft.TODAY]:"Today",[Ft.YESTERDAY]:"Yesterday",[Ft.PREVIOUS_7_DAYS]:"Previous 7 days",[Ft.PREVIOUS_30_DAYS]:"Previous 30 days"},zh:{[Ft.TODAY]:"今天",[Ft.YESTERDAY]:"昨天",[Ft.PREVIOUS_7_DAYS]:"过去7天",[Ft.PREVIOUS_30_DAYS]:"过去30天"}},Gt=b.i18n.getFixedT(null,$t);var Kt,Xt=n(21411);let Qt,Jt,Zt,en,tn,nn,an,sn,rn,on,ln,cn,dn,un,pn;(0,b.initializeI18n)($t,qt);const hn=(0,m.wrapBrick)("eo-icon"),mn=(0,m.wrapBrick)("eo-link"),gn=(0,m.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),{defineElement:bn,property:fn,event:vn}=(0,h.createDecorators)();let xn;var kn=new WeakMap,An=new WeakMap,En=new WeakMap,wn=new WeakMap,yn=new WeakSet,Rn=new WeakMap,Sn=new WeakMap,Nn=new WeakMap;class Tn extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,yn),(0,s.A)(this,kn,Jt(this)),(0,s.A)(this,An,(Zt(this),en(this))),(0,s.A)(this,En,(tn(this),nn(this))),(0,s.A)(this,wn,(an(this),sn(this))),(0,s.A)(this,Rn,(ln(this),e=>{(0,o.A)(yn,this,rn).emit(e)})),(0,s.A)(this,Sn,cn(this)),(0,s.A)(this,Nn,(pn(this),e=>{(0,o.A)(yn,this,dn).emit({nextToken:e})}))}get list(){return(0,c.A)(kn,this)}set list(e){(0,l.A)(kn,this,e)}get actions(){return(0,c.A)(An,this)}set actions(e){(0,l.A)(An,this,e)}get nextToken(){return(0,c.A)(En,this)}set nextToken(e){(0,l.A)(En,this,e)}render(){return p().createElement(_n,{root:this,list:this.list,actions:this.actions,nextToken:this.nextToken,onActionClick:(0,c.A)(Rn,this),onLoadMore:(0,c.A)(Nn,this)})}}function _n(e){let{root:t,list:n,actions:i,nextToken:a,onActionClick:s,onLoadMore:r}=e;const o=(0,u.useMemo)((()=>{const e=new Map,t=Ht()(),i=t.clone().startOf("day"),a=i.clone().subtract(1,"day"),s=i.clone().subtract(7,"days"),r=i.clone().subtract(30,"days"),o=+i/1e3,l=+a/1e3,c=+s/1e3,d=+r/1e3,u=+t.clone().startOf("year")/1e3;for(const t of null!=n?n:[]){let n;n=t.startTime>=o?Gt(Ft.TODAY):t.startTime>=l?Gt(Ft.YESTERDAY):t.startTime>=c?Gt(Ft.PREVIOUS_7_DAYS):t.startTime>=d?Gt(Ft.PREVIOUS_30_DAYS):t.startTime>=u?Ht()(1e3*t.startTime).format("MMMM"):Ht()(1e3*t.startTime).format("YYYY");let i=e.get(n);i||e.set(n,i={title:n,items:[]}),i.items.push(t)}return[...e.values()]}),[n]),[l,c]=(0,u.useState)(null),d=(0,u.useRef)(null);return(0,u.useEffect)((()=>{const e=d.current;if(!e||!a)return;const n=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&r(a)}),{root:t});return n.observe(e),()=>{n.disconnect()}}),[a,r,t]),n?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(mn,{className:v()("item",{active:l===e.id}),url:e.url},p().createElement("div",{className:"item-title",title:e.title},e.title),p().createElement(gn,{className:"actions",actions:i,onActionClick:t=>{s({action:t.detail,item:e})},onVisibleChange:t=>{c(t.detail?e.id:null)}}),!Y.QB.includes(e.state)&&p().createElement("div",{className:"working"})))))))))),a&&p().createElement("div",{className:"load-more",ref:d},p().createElement(hn,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))):p().createElement("div",{className:"loading"},p().createElement(hn,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}))}Kt=Tn,({e:[Jt,Zt,en,tn,nn,an,sn,rn,on,ln,cn,dn,un,pn],c:[xn,Qt]}=(0,d.A)(Kt,[bn("ai-portal.chat-history",{styleTexts:[Xt.A]})],[[fn({attribute:!1}),1,"list"],[fn({attribute:!1}),1,"actions"],[fn(),1,"nextToken"],[vn({type:"action.click"}),1,"actionClick",e=>(0,c.A)(wn,e),(e,t)=>(0,l.A)(wn,e,t)],[vn({type:"load.more"}),1,"loadMore",e=>(0,c.A)(Sn,e),(e,t)=>(0,l.A)(Sn,e,t)]],0,(e=>Nn.has((0,r.A)(e))),m.ReactNextElement)),Qt();var Mn,Cn=n(89575),In=n(24);let Wn,zn,On,Ln,Yn,Dn,Un,Vn,Pn,Bn,jn,Hn,Fn,$n,qn,Gn,Kn,Xn,Qn,Jn,Zn;const ei=(0,m.wrapBrick)("eo-mini-line-chart"),{defineElement:ti,property:ni}=(0,h.createDecorators)();let ii;var ai=new WeakMap,si=new WeakMap,ri=new WeakMap,oi=new WeakMap,li=new WeakMap,ci=new WeakMap,di=new WeakMap,ui=new WeakMap,pi=new WeakMap,hi=new WeakMap;class mi extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,ai,zn(this)),(0,s.A)(this,si,(On(this),Ln(this))),(0,s.A)(this,ri,(Yn(this),Dn(this))),(0,s.A)(this,oi,(Un(this),Vn(this))),(0,s.A)(this,li,(Pn(this),Bn(this))),(0,s.A)(this,ci,(jn(this),Hn(this))),(0,s.A)(this,di,(Fn(this),$n(this))),(0,s.A)(this,ui,(qn(this),Gn(this))),(0,s.A)(this,pi,(Kn(this),Xn(this))),(0,s.A)(this,hi,(Qn(this),Jn(this))),Zn(this)}get label(){return(0,c.A)(ai,this)}set label(e){(0,l.A)(ai,this,e)}get value(){return(0,c.A)(si,this)}set value(e){(0,l.A)(si,this,e)}get size(){return(0,c.A)(ri,this)}set size(e){(0,l.A)(ri,this,e)}get lineColor(){return(0,c.A)(oi,this)}set lineColor(e){(0,l.A)(oi,this,e)}get showArea(){return(0,c.A)(li,this)}set showArea(e){(0,l.A)(li,this,e)}get min(){return(0,c.A)(ci,this)}set min(e){(0,l.A)(ci,this,e)}get max(){return(0,c.A)(di,this)}set max(e){(0,l.A)(di,this,e)}get xField(){return(0,c.A)(ui,this)}set xField(e){(0,l.A)(ui,this,e)}get yField(){return(0,c.A)(pi,this)}set yField(e){(0,l.A)(pi,this,e)}get data(){return(0,c.A)(hi,this)}set data(e){(0,l.A)(hi,this,e)}render(){return p().createElement(gi,{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 gi(e){let{label:t,value:n,size:i,...a}=e;return"small"===i?p().createElement("div",{className:"container"},p().createElement("div",{className:"label-and-stat"},p().createElement("div",{className:"label"},t),p().createElement("div",{className:"stat"},n)),p().createElement("div",{className:"chart"},p().createElement(ei,(0,Cn.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(ei,(0,Cn.A)({},a,{lineWidth:2,width:"auto",height:"92"}))),p().createElement("div",{className:"stat"},n)))}Mn=mi,({e:[zn,On,Ln,Yn,Dn,Un,Vn,Pn,Bn,jn,Hn,Fn,$n,qn,Gn,Kn,Xn,Qn,Jn,Zn],c:[ii,Wn]}=(0,d.A)(Mn,[ti("ai-portal.stat-with-mini-chart",{styleTexts:[In.A]})],[[ni(),1,"label"],[ni(),1,"value"],[ni(),1,"size"],[ni(),1,"lineColor"],[ni({type:Boolean}),1,"showArea"],[ni({type:Number}),1,"min"],[ni({type:Number}),1,"max"],[ni(),1,"xField"],[ni(),1,"yField"],[ni({attribute:!1}),1,"data"]],0,void 0,m.ReactNextElement)),Wn();const bi=n.p+"images/7385e5f5.png";var fi,vi=n(31653);let xi;const{defineElement:ki}=(0,h.createDecorators)();let Ai;class Ei extends m.ReactNextElement{render(){return p().createElement(wi,null)}}function wi(){return p().createElement("img",{src:bi,alt:"Elevo",width:95,height:26})}fi=Ei,[Ai,xi]=(0,d.A)(fi,[ki("ai-portal.elevo-logo",{styleTexts:[vi.A]})],[],0,void 0,m.ReactNextElement).c,xi();let yi=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}({});const Ri="bricks/ai-portal/elevo-sidebar",Si={en:{[yi.NEW_CHAT]:"New chat",[yi.LOGOUT]:"Logout",[yi.TODAY]:"Today",[yi.YESTERDAY]:"Yesterday",[yi.PREVIOUS_7_DAYS]:"Previous 7 days",[yi.PREVIOUS_30_DAYS]:"Previous 30 days"},zh:{[yi.NEW_CHAT]:"新对话",[yi.LOGOUT]:"登出",[yi.TODAY]:"今天",[yi.YESTERDAY]:"昨天",[yi.PREVIOUS_7_DAYS]:"过去7天",[yi.PREVIOUS_30_DAYS]:"过去30天"}},Ni=b.i18n.getFixedT(null,Ri);var Ti=n(61408);const _i=(0,m.wrapBrick)("eo-icon"),Mi=(0,m.wrapBrick)("eo-link"),Ci=(0,m.wrapBrick)("eo-dropdown-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),Ii=(0,m.wrapBrick)("eo-easyops-avatar"),Wi=(0,m.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),zi=(0,m.wrapBrick)("ai-portal.icon-button");var Oi=n(57372);const Li=async(e,t)=>(await Oi.http.post("api/gateway/logic.llm.aiops_service/api/v1/llm/agent/flow/search",e,t)).data,Yi=(0,u.forwardRef)(Di);function Di(e,t){let{activeId:n,actions:i,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([Li({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=Ht()(),n=t.clone().startOf("day"),i=n.clone().subtract(1,"day"),a=n.clone().subtract(7,"days"),s=n.clone().subtract(30,"days"),r=+n/1e3,o=+i/1e3,c=+a/1e3,d=+s/1e3,u=+t.clone().startOf("year")/1e3;for(const t of null!=l?l:[]){let n;n=t.startTime>=r?Ni(yi.TODAY):t.startTime>=o?Ni(yi.YESTERDAY):t.startTime>=c?Ni(yi.PREVIOUS_7_DAYS):t.startTime>=d?Ni(yi.PREVIOUS_30_DAYS):t.startTime>=u?Ht()(1e3*t.startTime).format("MMMM"):Ht()(1e3*t.startTime).format("YYYY");let i=e.get(n);i||e.set(n,i={title:n,items:[]}),i.items.push(t)}return[...e.values()]}),[l]),[f,x]=(0,u.useState)(null),k=(0,u.useRef)(null);(0,u.useEffect)((()=>{const e=k.current,t=o.current;if(!e||!d||!t)return;const n=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&g(d)}),{root:t});return n.observe(e),()=>{n.disconnect()}}),[d]);const A=(0,u.useRef)(0),E=(0,u.useCallback)((async()=>{try{const e=++A.current,t=await Li({},{interceptorParams:{ignoreLoadingBar:!0}});if(e!==A.current)return;c((e=>{const n=null!=e?e:[],i=t.data,a=new Set(i.map((e=>e.id))),s=new Map(i.map((e=>[e.id,e])));let r=!1,o=!1,l=!0;for(const e of n){const t=s.get(e.id);if(!t)break;if(r=!0,o=l&&t!==i[0]||!(0,Qe.isEqual)(t,e),o)break;l=!1}return r?o?[...i,...n.filter((e=>!a.has(e.id)))]:e:(h(t.next_token),i)}))}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(Mi,(0,Cn.A)({className:v()("item",{"actions-active":e.id===f,active:e.id===n}),onClick:r},a?{url:(t=a,o=e,null==t?void 0:t.replace(/{{(.*?)}}/g,((e,t)=>(0,Qe.get)(o,t))))}:null),p().createElement("div",{className:"item-title",title:e.title},e.title),p().createElement(Wi,{className:"actions",actions:i,onActionClick:t=>{s({action:t.detail,item:e})},onVisibleChange:t=>{x(t.detail?e.id:null)}}),!Y.QB.includes(e.state)&&p().createElement("div",{className:"working"})));var t,o}))))))),d&&p().createElement("div",{className:"load-more",ref:k},p().createElement(_i,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))):p().createElement("div",{className:"history"},p().createElement("div",{className:"loading"},p().createElement(_i,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})))}var Ui;let Vi,Pi,Bi,ji,Hi,Fi,$i,qi,Gi,Ki,Xi,Qi,Ji,Zi,ea,ta,na,ia,aa,sa,ra,oa,la,ca;(0,b.initializeI18n)(Ri,Si);const da={lib:"easyops",icon:"sidebar"},ua=[{icon:{lib:"fa",prefix:"fas",icon:"arrow-right-from-bracket"},text:Ni(yi.LOGOUT)}],{defineElement:pa,property:ha,event:ma,method:ga}=(0,h.createDecorators)(),ba=(0,u.forwardRef)(Ia);let fa;var va=new WeakMap,xa=new WeakMap,ka=new WeakMap,Aa=new WeakMap,Ea=new WeakMap,wa=new WeakMap,ya=new WeakMap,Ra=new WeakMap,Sa=new WeakSet,Na=new WeakMap,Ta=new WeakMap,_a=new WeakMap,Ma=new WeakMap;class Ca extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Sa),(0,s.A)(this,va,(Vi(this),Bi(this))),(0,s.A)(this,xa,(ji(this),Hi(this))),(0,s.A)(this,ka,(Fi(this),$i(this))),(0,s.A)(this,Aa,(qi(this),Gi(this))),(0,s.A)(this,Ea,(Ki(this),Xi(this))),(0,s.A)(this,wa,(Qi(this),Ji(this))),(0,s.A)(this,ya,(Zi(this),ea(this))),(0,s.A)(this,Ra,(ta(this),na(this))),(0,s.A)(this,Na,(sa(this),()=>{(0,o.A)(Sa,this,ia).emit()})),(0,s.A)(this,Ta,ra(this)),(0,s.A)(this,_a,(ca(this),e=>{(0,o.A)(Sa,this,oa).emit(e)})),(0,s.A)(this,Ma,(0,u.createRef)())}get userInstanceId(){return(0,c.A)(va,this)}set userInstanceId(e){(0,l.A)(va,this,e)}get behavior(){return(0,c.A)(xa,this)}set behavior(e){(0,l.A)(xa,this,e)}get logoUrl(){return(0,c.A)(ka,this)}set logoUrl(e){(0,l.A)(ka,this,e)}get newChatUrl(){return(0,c.A)(Aa,this)}set newChatUrl(e){(0,l.A)(Aa,this,e)}get historyActiveId(){return(0,c.A)(Ea,this)}set historyActiveId(e){(0,l.A)(Ea,this,e)}get historyUrlTemplate(){return(0,c.A)(wa,this)}set historyUrlTemplate(e){(0,l.A)(wa,this,e)}get historyActions(){return(0,c.A)(ya,this)}set historyActions(e){(0,l.A)(ya,this,e)}pullHistory(e){setTimeout((()=>{var e;null===(e=(0,c.A)(Ma,this).current)||void 0===e||e.pull()}),e)}render(){return p().createElement(ba,{ref:(0,c.A)(Ma,this),userInstanceId:this.userInstanceId,behavior:this.behavior,logoUrl:this.logoUrl,newChatUrl:this.newChatUrl,historyActiveId:this.historyActiveId,historyUrlTemplate:this.historyUrlTemplate,historyActions:this.historyActions,onLogout:(0,c.A)(Na,this),onActionClick:(0,c.A)(_a,this)})}}function Ia(e,t){let{userInstanceId:n,behavior:i,logoUrl:a,newChatUrl:s,historyActiveId:r,historyUrlTemplate:o,historyActions:l,onLogout:c,onActionClick:d}=e;const[h,m]=(0,u.useState)("drawer"===i),g=(0,u.useCallback)((()=>{m(!0)}),[]),b=(0,u.useCallback)((()=>{m(!1)}),[]);(0,u.useEffect)((()=>{"drawer"===i&&m(!0)}),[i]);const f=(0,u.useCallback)((()=>{m(!0)}),[]),x=(0,u.useCallback)((()=>{"drawer"===i&&m(!0)}),[i]);return p().createElement("div",{className:v()("container",{collapsed:h})},"drawer"===i&&!h&&p().createElement("div",{className:"mask",onClick:f}),p().createElement("div",{className:"sidebar"},p().createElement("div",{className:"logo-bar"},p().createElement(Mi,{url:a,className:"logo-link"},p().createElement("img",{className:"logo",alt:"Elevo",src:bi,width:95,height:26})),p().createElement(zi,{icon:da,variant:"light",onClick:g})),p().createElement(Mi,{className:"new-chat",url:s},p().createElement(_i,{className:"new-chat-icon",lib:"easyops",icon:"new-chat"}),Ni(yi.NEW_CHAT)),p().createElement(Yi,{ref:t,activeId:r,urlTemplate:o,actions:l,onActionClick:d,onHistoryClick:x}),p().createElement("div",{className:"footer"},p().createElement(Ci,{className:"dropdown",actions:ua,onActionClick:c},p().createElement("button",{className:"account"},p().createElement(Ii,{nameOrInstanceId:n,showName:!0,size:"xs"}))))),p().createElement("div",{className:"alternative"},p().createElement(zi,{icon:da,variant:"light",onClick:b}),p().createElement(Mi,{className:"new-chat",url:s},p().createElement(_i,{className:"new-chat-icon",lib:"easyops",icon:"new-chat"}),Ni(yi.NEW_CHAT))))}Ui=Ca,({e:[Bi,ji,Hi,Fi,$i,qi,Gi,Ki,Xi,Qi,Ji,Zi,ea,ta,na,ia,aa,sa,ra,oa,la,ca,Vi],c:[fa,Pi]}=(0,d.A)(Ui,[pa("ai-portal.elevo-sidebar",{styleTexts:[Ti.A]})],[[ha(),1,"userInstanceId"],[ha(),1,"behavior"],[ha(),1,"logoUrl"],[ha(),1,"newChatUrl"],[ha(),1,"historyActiveId"],[ha(),1,"historyUrlTemplate"],[ha({attribute:!1}),1,"historyActions"],[ma({type:"logout"}),1,"logout",e=>(0,c.A)(Ra,e),(e,t)=>(0,l.A)(Ra,e,t)],[ma({type:"action.click"}),1,"actionClick",e=>(0,c.A)(Ta,e),(e,t)=>(0,l.A)(Ta,e,t)],[ga(),2,"pullHistory"]],0,(e=>Ma.has((0,r.A)(e))),m.ReactNextElement)),Pi();var Wa,za=n(47338);let Oa,La,Ya,Da,Ua,Va,Pa,Ba,ja;const Ha=(0,m.wrapBrick)("eo-icon"),Fa=(0,m.wrapBrick)("eo-tooltip"),{defineElement:$a,property:qa}=(0,h.createDecorators)();let Ga;var Ka=new WeakMap,Xa=new WeakMap,Qa=new WeakMap,Ja=new WeakMap;class Za extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,Ka,La(this)),(0,s.A)(this,Xa,(Ya(this),Da(this))),(0,s.A)(this,Qa,(Ua(this),Va(this))),(0,s.A)(this,Ja,(Pa(this),Ba(this))),ja(this)}get icon(){return(0,c.A)(Ka,this)}set icon(e){(0,l.A)(Ka,this,e)}get tooltip(){return(0,c.A)(Xa,this)}set tooltip(e){(0,l.A)(Xa,this,e)}get disabled(){return(0,c.A)(Qa,this)}set disabled(e){(0,l.A)(Qa,this,e)}get variant(){return(0,c.A)(Ja,this)}set variant(e){(0,l.A)(Ja,this,e)}render(){return p().createElement(es,{icon:this.icon,tooltip:this.tooltip,disabled:this.disabled})}}function es(e){let{icon:t,tooltip:n,disabled:i}=e;const a=p().createElement("button",{disabled:i},p().createElement(Ha,t));return n?p().createElement(Fa,{content:n},a):a}Wa=Za,({e:[La,Ya,Da,Ua,Va,Pa,Ba,ja],c:[Ga,Oa]}=(0,d.A)(Wa,[$a("ai-portal.icon-button",{styleTexts:[za.A]})],[[qa({attribute:!1}),1,"icon"],[qa(),1,"tooltip"],[qa({type:Boolean}),1,"disabled"],[qa({render:!1}),1,"variant"]],0,void 0,m.ReactNextElement)),Oa();let ts=function(e){return e.ALL="ALL",e}({});const ns="bricks/ai-portal/show-cases",is={en:{[ts.ALL]:"All"},zh:{[ts.ALL]:"全部"}},as=b.i18n.getFixedT(null,ns);var ss,rs=n(42873);let os,ls,cs,ds,us;(0,b.initializeI18n)(ns,is);const ps=(0,m.wrapBrick)("eo-link"),{defineElement:hs,property:ms}=(0,h.createDecorators)();let gs;var bs=new WeakMap,fs=new WeakMap;class vs extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,bs,ls(this)),(0,s.A)(this,fs,(cs(this),ds(this))),us(this)}get list(){return(0,c.A)(bs,this)}set list(e){(0,l.A)(bs,this,e)}get taskUrlTemplate(){return(0,c.A)(fs,this)}set taskUrlTemplate(e){(0,l.A)(fs,this,e)}render(){return p().createElement(xs,{list:this.list,taskUrlTemplate:this.taskUrlTemplate})}}function xs(e){let{list:t,taskUrlTemplate:n}=e;const i=(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==i?void 0:i.map((e=>p().createElement("li",{key:e,className:"item"},p().createElement("a",{className:v()({active:a===e}),onClick:()=>s(e)},null===e?as(ts.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(ps,{className:"link",url:(t=n,i=e,null==t?void 0:t.replace(/{{(.*?)}}/g,((e,t)=>(0,Qe.get)(i,t))))},p().createElement("span",{className:v()("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,i})))):null}ss=vs,({e:[ls,cs,ds,us],c:[gs,os]}=(0,d.A)(ss,[hs("ai-portal.show-cases",{styleTexts:[rs.A]})],[[ms({attribute:!1}),1,"list"],[ms(),1,"taskUrlTemplate"]],0,void 0,m.ReactNextElement)),os();let ks=function(e){return e.MCP_TOOL_HUB="MCP_TOOL_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 As="bricks/ai-portal/mcp-tools",Es={en:{[ks.MCP_TOOL_HUB]:"MCP Tool Hub",[ks.ALL]:"All",[ks.SERVER_cmdb]:"CMDB",[ks.SERVER_alert]:"Alert",[ks.SERVER_web_builder]:"View",[ks.SERVER_host_troubleshooting]:"Host Troubleshooting",[ks.SERVER_system_inspection]:"System Inspection"},zh:{[ks.MCP_TOOL_HUB]:"MCP 工具中心",[ks.ALL]:"全部",[ks.SERVER_cmdb]:"CMDB",[ks.SERVER_alert]:"告警",[ks.SERVER_web_builder]:"视图",[ks.SERVER_host_troubleshooting]:"主机故障排查",[ks.SERVER_system_inspection]:"系统巡检"}},ws=b.i18n.getFixedT(null,As);var ys,Rs=n(31748);let Ss,Ns,Ts;(0,b.initializeI18n)(As,Es);const _s={lib:"antd",icon:"tool"},Ms=(0,m.wrapBrick)("eo-icon"),{defineElement:Cs,property:Is}=(0,h.createDecorators)();let Ws;var zs=new WeakMap;class Os extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,zs,Ns(this)),Ts(this)}get list(){return(0,c.A)(zs,this)}set list(e){(0,l.A)(zs,this,e)}render(){return p().createElement(Ls,{list:this.list})}}function Ls(e){let{list:t}=e;const n=(0,u.useMemo)((()=>{const e=new Map;return null==t||t.forEach((t=>{const n=ws(`SERVER_${t.server.id.replaceAll("-","_")}`,t.server.name);let i=e.get(n);i||e.set(n,i=[]),i.push(t)})),e}),[t]),i=(0,u.useMemo)((()=>[null,...n.keys()]),[n]),[a,s]=(0,u.useState)(null),r=(0,u.useMemo)((()=>{const e=[...n];return null===a?e:e.filter((e=>{let[t]=e;return t===a}))}),[a,n]);return p().createElement("div",{className:"container"},p().createElement("h1",null,ws(ks.MCP_TOOL_HUB)),p().createElement("ul",{className:"nav"},null==i?void 0:i.map((e=>p().createElement("li",{key:e,className:"item"},p().createElement("a",{className:v()({active:a===e}),onClick:()=>s(e)},null===e?ws(ks.ALL):e))))),p().createElement("ul",{className:"groups"},null==r?void 0:r.map((e=>{let[t,n]=e;return p().createElement("li",{key:t,className:"group"},p().createElement("h2",null,t),p().createElement("ul",{className:"list"},n.map((e=>{var t;return p().createElement("li",{key:e.name,className:"item"},p().createElement("div",{className:"heading"},p().createElement(Ms,(0,Cn.A)({className:"icon"},null!==(t=e.icon)&&void 0!==t?t:_s,{fallback:_s})),p().createElement("div",{className:"title"},e.title)),p().createElement("div",{className:"description"},e.description))}))))}))))}ys=Os,({e:[Ns,Ts],c:[Ws,Ss]}=(0,d.A)(ys,[Cs("ai-portal.mcp-tools",{styleTexts:[Rs.A]})],[[Is({attribute:!1}),1,"list"]],0,void 0,m.ReactNextElement)),Ss()},82165:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(36758),a=n.n(i),s=n(40935),r=n.n(s),o=n(20062),l=n.n(o),c=new URL(n(32360),n.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,n)=>{e.exports=n.p+"images/f819b04a.png"},91107:(e,t,n)=>{e.exports=n.p+"images/eef4f2bd.png"}}]);
|
|
3
|
+
//# sourceMappingURL=8230.e3b8a575.js.map
|