@redocly/openapi-docs 3.24.0-next.7 → 3.24.0-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{redocly-openapi-docs.min.AiChatProvider-gAsQoX30.js → redocly-openapi-docs.min.AiChatProvider-D8o94qvX.js} +1 -1
- package/dist/{redocly-openapi-docs.min.AiChatSqliteDBStorage-CnYt8ojK.js → redocly-openapi-docs.min.AiChatSqliteDBStorage-BLTom3F-.js} +1 -1
- package/dist/{redocly-openapi-docs.min.AiPanel-Bvkd__SH.js → redocly-openapi-docs.min.AiPanel-DloIzPy9.js} +184 -165
- package/dist/{redocly-openapi-docs.min.SqliteDBStorage-C6xTN7YJ.js → redocly-openapi-docs.min.SqliteDBStorage-CksbFVf-.js} +1 -1
- package/dist/{redocly-openapi-docs.min.ai-chat-mappers-3WKBUVis.js → redocly-openapi-docs.min.ai-chat-mappers-Dza6UMVG.js} +1 -1
- package/dist/{redocly-openapi-docs.min.external-resolver-4BBxclf5.js → redocly-openapi-docs.min.external-resolver-Cm8qMSH6.js} +1 -1
- package/dist/{redocly-openapi-docs.min.index-DswpnLh3.js → redocly-openapi-docs.min.index-CVScN5cj.js} +1251 -1229
- package/dist/{redocly-openapi-docs.min.index-C4nhoQHY.js → redocly-openapi-docs.min.index-DQKkHTdL.js} +1 -1
- package/dist/{redocly-openapi-docs.min.index-IvDdPWpQ.js → redocly-openapi-docs.min.index-DWPYSZX6.js} +1 -1
- package/dist/redocly-openapi-docs.min.js +1 -1
- package/dist/{redocly-openapi-docs.min.lint-DxrZW_dt.js → redocly-openapi-docs.min.lint-B0W-5WwE.js} +2 -2
- package/dist/{redocly-openapi-docs.min.lint-graphql-BJaf-iso.js → redocly-openapi-docs.min.lint-graphql-y6yM0_Y_.js} +1 -1
- package/dist/{redocly-openapi-docs.min.respect-run-BxLhw6rg.js → redocly-openapi-docs.min.respect-run-C77Wul9G.js} +1 -1
- package/dist/{redocly-openapi-docs.min.standalone-DYNn4rpC.js → redocly-openapi-docs.min.standalone-BFWv5fnd.js} +3 -3
- package/dist/{redocly-openapi-docs.min.tauri-path-DkXXjCOS.js → redocly-openapi-docs.min.tauri-path-Dc9-nUUG.js} +1 -1
- package/dist/{redocly-openapi-docs.min.useAiChatQueries-DA3WodeG.js → redocly-openapi-docs.min.useAiChatQueries-B9Y_hT0w.js} +35 -33
- package/package.json +2 -2
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{g as
|
|
1
|
+
import{g as q,a as l,j as r,f as ae,B as _,r as h,e as ct,U as dt,ai as ut,D as pt,h as ft,m as me,n as ht,aD as xt,aE as gt,ah as R,ae as U,d as mt}from"./redocly-openapi-docs.min.standalone-BFWv5fnd.js";import{f as J,z as ve,B as vt,e as yt,q as ye,m as wt,n as jt,C as bt,E as Ct,F as se,G as le,H as kt,J as It,S as $,K as ce,L as Tt,M as _t,N as we,O as St,P as At,R as de,Q as Ot,U as ue,V as je,W as be,t as Ce,X as pe,Y as L,Z as Bt,_ as Vt,$ as zt,a0 as Ft,a1 as Mt}from"./redocly-openapi-docs.min.index-CVScN5cj.js";import{B as $t,C as Et,E as Rt,F as Lt,G as Nt,H as Dt,I as Pt,J as ke,K as C,L as Ie,M as Ut,N as Ht,O as H,P as Gt,Q as Kt,R as Wt,S as V,U as Zt,V as N}from"./redocly-openapi-docs.min.useAiChatQueries-B9Y_hT0w.js";function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Yt=45e3,qt=e=>r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:r.jsx("path",{d:"M12 7.5H4V8.5H12V7.5Z"})}),Jt=l(qt).attrs({"data-component-name":"icons/SubtractIcon/SubtractIcon"})`
|
|
2
2
|
path {
|
|
3
|
-
fill: ${({color:e})=>
|
|
3
|
+
fill: ${({color:e})=>q(e)};
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
height: ${({size:e})=>e||"16px"};
|
|
7
7
|
width: ${({size:e})=>e||"16px"};
|
|
8
8
|
`,Qt=e=>r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:r.jsx("path",{d:"M13.0094 7.61066L3.38435 2.79816C3.30892 2.76043 3.22418 2.74532 3.14035 2.75463C3.05652 2.76394 2.97717 2.79729 2.91186 2.85066C2.84948 2.90294 2.80292 2.97158 2.77742 3.04886C2.75191 3.12615 2.74847 3.20902 2.76748 3.28816L3.92685 7.56253H8.87498V8.43753H3.92685L2.74998 12.6988C2.73214 12.7649 2.73006 12.8342 2.7439 12.9013C2.75774 12.9683 2.78712 13.0312 2.82968 13.0848C2.87223 13.1384 2.92677 13.1813 2.98891 13.21C3.05106 13.2387 3.11907 13.2524 3.18748 13.25C3.25597 13.2496 3.3234 13.2331 3.38435 13.2019L13.0094 8.38941C13.081 8.35269 13.1412 8.29692 13.1832 8.22821C13.2252 8.15951 13.2474 8.08055 13.2474 8.00003C13.2474 7.91951 13.2252 7.84056 13.1832 7.77185C13.1412 7.70315 13.081 7.64737 13.0094 7.61066Z",fill:"white"})}),Xt=l(Qt).attrs({"data-component-name":"icons/SendIcon/SendIcon"})`
|
|
9
9
|
path {
|
|
10
|
-
fill: ${({color:e})=>
|
|
10
|
+
fill: ${({color:e})=>q(e)};
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
height: ${({size:e})=>e||"16px"};
|
|
14
14
|
width: ${({size:e})=>e||"16px"};
|
|
15
15
|
`,en=e=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",...e,children:r.jsx("path",{d:"M10.5 3.5V10.5H3.5V3.5H10.5ZM10.5 2.625H3.5C3.26794 2.625 3.04538 2.71719 2.88128 2.88128C2.71719 3.04538 2.625 3.26794 2.625 3.5V10.5C2.625 10.7321 2.71719 10.9546 2.88128 11.1187C3.04538 11.2828 3.26794 11.375 3.5 11.375H10.5C10.7321 11.375 10.9546 11.2828 11.1187 11.1187C11.2828 10.9546 11.375 10.7321 11.375 10.5V3.5C11.375 3.26794 11.2828 3.04538 11.1187 2.88128C10.9546 2.71719 10.7321 2.625 10.5 2.625Z"})}),tn=l(en).attrs({"data-component-name":"icons/StopIcon/StopIcon"})`
|
|
16
16
|
path {
|
|
17
|
-
fill: ${({color:e})=>
|
|
17
|
+
fill: ${({color:e})=>q(e)};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
height: ${({size:e})=>e||"16px"};
|
|
@@ -24,69 +24,12 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
24
24
|
width: ${({size:e})=>e||"16px"};
|
|
25
25
|
`;function on(e){return r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[r.jsx("path",{fill:"currentColor",d:"M11.375 11.375H2.625V2.625H7V1.75H2.625C2.39301 1.75023 2.17058 1.84249 2.00654 2.00654C1.84249 2.17058 1.75023 2.39301 1.75 2.625V11.375C1.75023 11.607 1.84249 11.8294 2.00654 11.9935C2.17058 12.1575 2.39301 12.2498 2.625 12.25H11.375C11.607 12.2498 11.8294 12.1575 11.9935 11.9935C12.1575 11.8294 12.2498 11.607 12.25 11.375V7H11.375V11.375Z"}),r.jsx("path",{fill:"currentColor",d:"M11.375 2.625V0.875H10.5V2.625H8.75V3.5H10.5V5.25H11.375V3.5H13.125V2.625H11.375Z"})]})}const an=l(on).attrs({"data-component-name":"icons/NewChatIcon/NewChatIcon"})`
|
|
26
26
|
path {
|
|
27
|
-
fill: ${({color:e})=>
|
|
27
|
+
fill: ${({color:e})=>q(e)};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
height: ${({size:e="14px"})=>e};
|
|
31
31
|
width: ${({size:e="14px"})=>e};
|
|
32
|
-
|
|
33
|
-
width: var(--search-ai-thinking-dot-size);
|
|
34
|
-
height: var(--search-ai-thinking-dot-size);
|
|
35
|
-
border-radius: 50%;
|
|
36
|
-
background: var(--search-ai-thinking-dot-color);
|
|
37
|
-
animation: bounce 1.4s infinite ease-in-out;
|
|
38
|
-
|
|
39
|
-
&:nth-child(1) {
|
|
40
|
-
animation-delay: -0.32s;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&:nth-child(2) {
|
|
44
|
-
animation-delay: -0.16s;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&:nth-child(3) {
|
|
48
|
-
animation-delay: 0s;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@keyframes bounce {
|
|
52
|
-
0%,
|
|
53
|
-
80%,
|
|
54
|
-
100% {
|
|
55
|
-
opacity: 0.2;
|
|
56
|
-
transform: scale(0.8);
|
|
57
|
-
}
|
|
58
|
-
40% {
|
|
59
|
-
opacity: 1;
|
|
60
|
-
transform: scale(1);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
`,je=280;function be(){const[e,t]=h.useState(()=>fe().getIndexingActivityState().inProgress);return h.useEffect(()=>fe().subscribe("indexing-activity",n=>{t(n.inProgress)}),[]),r.jsx(sn,{$open:e,children:r.jsx(ln,{children:r.jsx(cn,{$open:e,"aria-hidden":!e,children:r.jsx(E,{tip:"We're building a search index of your project. Until it's ready, the assistant may need more context in each reply to stay accurate, which can use more tokens.",placement:"top",width:"240px",arrowPosition:"left",children:r.jsxs(dn,{role:"status","aria-live":"polite","aria-label":"Indexing in progress...",children:[r.jsx("div",{children:r.jsx(q,{})}),r.jsx(un,{children:"Indexing in progress..."})]})})})})})}const sn=l.div`
|
|
64
|
-
display: grid;
|
|
65
|
-
grid-template-rows: ${({$open:e})=>e?"1fr":"0fr"};
|
|
66
|
-
transition: grid-template-rows ${je}ms ease-out;
|
|
67
|
-
`,ln=l.div`
|
|
68
|
-
min-height: 0;
|
|
69
|
-
overflow: hidden;
|
|
70
|
-
`,cn=l.div`
|
|
71
|
-
opacity: ${({$open:e})=>e?1:0};
|
|
72
|
-
transition: opacity ${je}ms ease-out;
|
|
73
|
-
pointer-events: ${({$open:e})=>e?"auto":"none"};
|
|
74
|
-
padding: var(--spacing-xs);
|
|
75
|
-
padding-top: var(--spacing-xxs);
|
|
76
|
-
`,dn=l.div`
|
|
77
|
-
width: 100%;
|
|
78
|
-
display: flex;
|
|
79
|
-
align-items: center;
|
|
80
|
-
gap: var(--spacing-xxs);
|
|
81
|
-
background: var(--layer-color);
|
|
82
|
-
padding: var(--spacing-xs) var(--spacing-sm);
|
|
83
|
-
border-radius: var(--border-radius);
|
|
84
|
-
font-size: var(--font-size-sm);
|
|
85
|
-
line-height: var(--line-height-sm);
|
|
86
|
-
`,un=l.div`
|
|
87
|
-
flex: 1;
|
|
88
|
-
min-width: 0;
|
|
89
|
-
`;function pn({placeholder:e="Ask anything...",className:t,disabled:n,isStreaming:i=!1,onStop:o,modelSelector:a,value:s,onValueChange:c,onSubmit:d,textareaRef:u}){const p=s.trim(),f=!n&&p.length>0&&!i,x=!n&&p.length>0,g=w=>{c(w.target.value)},v=()=>{!p||n||i||d()},j=()=>{!i||!o||o()},y=w=>{w.key==="Enter"&&!w.shiftKey&&!w.nativeEvent.isComposing&&(w.preventDefault(),i&&o?j():v())};return r.jsxs(fn,{className:t,$isActive:x,children:[r.jsx(hn,{ref:u,rows:1,maxLength:Yt,placeholder:e,value:s,disabled:n,spellCheck:!1,onChange:g,onKeyDown:y}),r.jsxs(xn,{children:[a,i&&o?r.jsx(mn,{type:"button",size:"small","aria-label":"Stop generating",icon:r.jsx(tn,{color:"var(--icon-color-on-color)"}),onClick:j}):r.jsx(gn,{type:"button",size:"small","aria-label":"Send message",icon:r.jsx(Xt,{color:"var(--icon-color-on-color)"}),onClick:v,disabled:!f})]})]})}const fn=l.div`
|
|
32
|
+
`;function sn({placeholder:e="Ask anything...",className:t,disabled:n,isStreaming:i=!1,onStop:o,modelSelector:a,value:s,onValueChange:c,onSubmit:d,textareaRef:u}){const f=s.trim(),p=!n&&f.length>0&&!i,x=!n&&f.length>0,g=w=>{c(w.target.value)},v=()=>{!f||n||i||d()},j=()=>{!i||!o||o()},y=w=>{w.key==="Enter"&&!w.shiftKey&&!w.nativeEvent.isComposing&&(w.preventDefault(),i&&o?j():v())};return r.jsxs(ln,{className:t,$isActive:x,children:[r.jsx(cn,{ref:u,rows:1,maxLength:Yt,placeholder:e,value:s,disabled:n,spellCheck:!1,onChange:g,onKeyDown:y}),r.jsxs(dn,{children:[a,i&&o?r.jsx(pn,{type:"button",size:"small","aria-label":"Stop generating",icon:r.jsx(tn,{color:"var(--icon-color-on-color)"}),onClick:j}):r.jsx(un,{type:"button",size:"small","aria-label":"Send message",icon:r.jsx(Xt,{color:"var(--icon-color-on-color)"}),onClick:v,disabled:!p})]})]})}const ln=l.div`
|
|
90
33
|
display: flex;
|
|
91
34
|
flex-direction: column;
|
|
92
35
|
gap: var(--spacing-xs);
|
|
@@ -105,13 +48,13 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
105
48
|
var(--replay-ai-gradient-soft) border-box;
|
|
106
49
|
}
|
|
107
50
|
|
|
108
|
-
${({$isActive:e})=>e&&
|
|
51
|
+
${({$isActive:e})=>e&&ae`
|
|
109
52
|
border-color: transparent;
|
|
110
53
|
background:
|
|
111
54
|
linear-gradient(var(--layer-color), var(--layer-color)) padding-box,
|
|
112
55
|
var(--replay-ai-gradient-soft) border-box;
|
|
113
56
|
`}
|
|
114
|
-
`,
|
|
57
|
+
`,cn=l.textarea`
|
|
115
58
|
max-height: 150px;
|
|
116
59
|
min-height: var(--search-ai-conversation-input-min-height);
|
|
117
60
|
|
|
@@ -131,12 +74,12 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
131
74
|
color: var(--text-color-helper);
|
|
132
75
|
text-indent: 2px;
|
|
133
76
|
}
|
|
134
|
-
`,
|
|
77
|
+
`,dn=l.div`
|
|
135
78
|
display: flex;
|
|
136
79
|
justify-content: space-between;
|
|
137
80
|
align-items: center;
|
|
138
81
|
gap: var(--spacing-xs);
|
|
139
|
-
`,
|
|
82
|
+
`,un=l(_)`
|
|
140
83
|
box-sizing: border-box;
|
|
141
84
|
background: var(--search-ai-gradient);
|
|
142
85
|
|
|
@@ -146,17 +89,17 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
146
89
|
width: 24px;
|
|
147
90
|
height: 24px;
|
|
148
91
|
}
|
|
149
|
-
`,
|
|
92
|
+
`,pn=l(_)`
|
|
150
93
|
box-sizing: border-box;
|
|
151
94
|
background: var(--color-warm-grey-9);
|
|
152
95
|
border-radius: var(--border-radius-xxl);
|
|
153
|
-
`,
|
|
96
|
+
`,fn=new Set(["collection","workflow","step","operation","workflow-run"]);function Te(e){return`replay://step?${new URLSearchParams({collectionId:e.collectionId.trim(),workflowId:e.workflowId.trim(),stepId:e.stepId.trim()}).toString()}`}function z(e,t){const n=e.get(t);if(n==null)return null;const i=n.trim();return i.length>0?i:null}function hn(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="replay:")return null;const n=t.hostname.toLowerCase();if(!fn.has(n))return null;const i=t.searchParams;switch(n){case"collection":{const o=z(i,"collectionId");return o?{kind:"collection",collectionId:o}:null}case"workflow":{const o=z(i,"collectionId"),a=z(i,"workflowId");return!o||!a?null:{kind:"workflow",collectionId:o,workflowId:a}}case"step":{const o=z(i,"collectionId"),a=z(i,"workflowId"),s=z(i,"stepId");return!o||!a||!s?null:{kind:"step",collectionId:o,workflowId:a,stepId:s}}case"operation":{const o=z(i,"operationId");return o?{kind:"operation",operationId:o}:null}case"workflow-run":{const o=z(i,"collectionId"),a=z(i,"workflowId");if(!o||!a)return null;const s=z(i,"historyId"),c=s==="null"||s==="undefined"?null:s;return{kind:"workflow-run",collectionId:o,workflowId:a,...c?{historyId:c}:{}}}default:return null}}function xn(e,t,n){return e.tabsState.tabs.get({noproxy:!0}).findIndex(({data:i})=>vt(i,yt.WorkflowRun)&&i.collectionId===t&&i.workflowId===n)}function gn(e,t,n,i={}){switch(n.kind){case"collection":t.openCollectionTab({collectionId:n.collectionId,activeTabName:ve.COLLECTION_SETTINGS});break;case"workflow":t.openWorkflowTab({collectionId:n.collectionId,workflowId:n.workflowId,activeTabName:ve.WORKFLOW_SETTINGS});break;case"step":t.openStepTabFromCollection({collectionId:n.collectionId,workflowId:n.workflowId,stepId:n.stepId,state:J.Normal});break;case"workflow-run":{const o=i.workflowRunHistoryIds?.[Lt(n.collectionId,n.workflowId)]??[],a=n.historyId&&o.includes(n.historyId)?n.historyId:o.at(-1)??n.historyId;if(a){t.openWorkflowRunTabFromHistory(a,{state:J.Normal});break}const s=xn(e,n.collectionId,n.workflowId);if(s!==-1){e.tabsState.tabs.get({noproxy:!0})[s].state===J.Preview&&t.changeTabState(s,J.Normal),t.handleTabChange(s);break}t.openWorkflowRunTab({collectionId:n.collectionId,workflowId:n.workflowId});break}case"operation":{const o=$t(e,n.operationId);if(!o.ok){console.warn("[executeReplayChatLink] Operation not resolved",{operationId:n.operationId,message:o.message});return}Et(e,Rt(o.value),t);break}}}function mn(e,t,n,i={}){const o=hn(n);o&&gn(e,t,o,i)}function _e({workflowRunHistoryIds:e}={}){const t=ye(),{getApiOperation:n}=wt(),{handleTabChange:i,addNewTab:o,openCollectionTab:a,openWorkflowTab:s,openStepTabFromCollection:c,openWorkflowRunTab:d,openWorkflowRunTabFromHistory:u,changeTabState:f}=jt();return h.useCallback(p=>{const x=p.target;if(!(x instanceof Element))return;const g=x.closest("a[href]");if(!(g instanceof HTMLAnchorElement))return;const v=g.getAttribute("href");v?.startsWith("replay:")&&(p.preventDefault(),p.stopPropagation(),mn(t,{getApiOperation:n,handleTabChange:i,addNewTab:o,openCollectionTab:a,openWorkflowTab:s,openStepTabFromCollection:c,openWorkflowRunTab:d,openWorkflowRunTabFromHistory:u,changeTabState:f},v,{workflowRunHistoryIds:e}))},[e,t,n,i,o,a,s,c,d,u,f])}class vn{diff(t,n,i={}){let o;typeof i=="function"?(o=i,i={}):"callback"in i&&(o=i.callback);const a=this.castInput(t,i),s=this.castInput(n,i),c=this.removeEmpty(this.tokenize(a,i)),d=this.removeEmpty(this.tokenize(s,i));return this.diffWithOptionsObj(c,d,i,o)}diffWithOptionsObj(t,n,i,o){var a;const s=m=>{if(m=this.postProcess(m,i),o){setTimeout(function(){o(m)},0);return}else return m},c=n.length,d=t.length;let u=1,f=c+d;i.maxEditLength!=null&&(f=Math.min(f,i.maxEditLength));const p=(a=i.timeout)!==null&&a!==void 0?a:1/0,x=Date.now()+p,g=[{oldPos:-1,lastComponent:void 0}];let v=this.extractCommon(g[0],n,t,0,i);if(g[0].oldPos+1>=d&&v+1>=c)return s(this.buildValues(g[0].lastComponent,n,t));let j=-1/0,y=1/0;const w=()=>{for(let m=Math.max(j,-u);m<=Math.min(y,u);m+=2){let T;const O=g[m-1],S=g[m+1];O&&(g[m-1]=void 0);let M=!1;if(S){const Y=S.oldPos-m;M=S&&0<=Y&&Y<c}const Z=O&&O.oldPos+1<d;if(!M&&!Z){g[m]=void 0;continue}if(!Z||M&&O.oldPos<S.oldPos?T=this.addToPath(S,!0,!1,0,i):T=this.addToPath(O,!1,!0,1,i),v=this.extractCommon(T,n,t,m,i),T.oldPos+1>=d&&v+1>=c)return s(this.buildValues(T.lastComponent,n,t))||!0;g[m]=T,T.oldPos+1>=d&&(y=Math.min(y,m-1)),v+1>=c&&(j=Math.max(j,m+1))}u++};if(o)(function m(){setTimeout(function(){if(u>f||Date.now()>x)return o(void 0);w()||m()},0)})();else for(;u<=f&&Date.now()<=x;){const m=w();if(m)return m}}addToPath(t,n,i,o,a){const s=t.lastComponent;return s&&!a.oneChangePerToken&&s.added===n&&s.removed===i?{oldPos:t.oldPos+o,lastComponent:{count:s.count+1,added:n,removed:i,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:i,previousComponent:s}}}extractCommon(t,n,i,o,a){const s=n.length,c=i.length;let d=t.oldPos,u=d-o,f=0;for(;u+1<s&&d+1<c&&this.equals(i[d+1],n[u+1],a);)u++,d++,f++,a.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return f&&!a.oneChangePerToken&&(t.lastComponent={count:f,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=d,u}equals(t,n,i){return i.comparator?i.comparator(t,n):t===n||!!i.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,i){const o=[];let a;for(;t;)o.push(t),a=t.previousComponent,delete t.previousComponent,t=a;o.reverse();const s=o.length;let c=0,d=0,u=0;for(;c<s;c++){const f=o[c];if(f.removed)f.value=this.join(i.slice(u,u+f.count)),u+=f.count;else{if(!f.added&&this.useLongestToken){let p=n.slice(d,d+f.count);p=p.map(function(x,g){const v=i[u+g];return v.length>x.length?v:x}),f.value=this.join(p)}else f.value=this.join(n.slice(d,d+f.count));d+=f.count,f.added||(u+=f.count)}}return o}}class yn extends vn{constructor(){super(...arguments),this.tokenize=bn}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
|
|
154
97
|
`))&&(t=t.trim()),(!i.newlineIsToken||!n.includes(`
|
|
155
98
|
`))&&(n=n.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(t.endsWith(`
|
|
156
99
|
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
|
157
|
-
`)&&(n=n.slice(0,-1))),super.equals(t,n,i)}}const
|
|
158
|
-
`));const n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let o=0;o<i.length;o++){const a=i[o];o%2&&!t.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n}const
|
|
159
|
-
`);return n.length>1&&n[n.length-1]===""&&n.pop(),n.map(i=>({type:t,text:i}))}const
|
|
100
|
+
`)&&(n=n.slice(0,-1))),super.equals(t,n,i)}}const wn=new yn;function jn(e,t,n){return wn.diff(e,t,n)}function bn(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
101
|
+
`));const n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let o=0;o<i.length;o++){const a=i[o];o%2&&!t.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n}const Cn=500;function kn(e,t){const n=In(e,t);if(n.length===0)return[];const i=[];let o=0;for(;o<n.length;){let a=o;const s=n[o].type==="context";for(;a<n.length&&n[a].type==="context"===s;)a++;const c=n.slice(o,a);i.push({start:o,end:a,rows:c,hasAdditions:c.some(d=>d.type==="add"),hasRemovals:c.some(d=>d.type==="remove")}),o=a}return i}function In(e,t){if(e===void 0)return t===void 0?[]:D(t,"add");if(t===void 0)return D(e,"remove");if(e===t)return D(t,"context");const n=Tn(e,t);return n?n.flatMap(i=>D(i.value,i.added?"add":i.removed?"remove":"context")):[...D(e,"remove"),...D(t,"add")]}function Tn(e,t){try{return jn(e,t,{timeout:Cn})}catch{return}}function D(e,t){const n=e.split(`
|
|
102
|
+
`);return n.length>1&&n[n.length-1]===""&&n.pop(),n.map(i=>({type:t,text:i}))}const Se=1,Ae=e=>e&&e.hasAdditions!==e.hasRemovals,Oe=e=>e&&(e.hasAdditions||e.hasRemovals);function _n(e,t,n){if(e.hasAdditions||e.hasRemovals)return X(e.rows);const i=n[t-1],o=n[t+1],a=Ae(i)?Se:0,s=Ae(o)?Se:0;if(a+s>=e.rows.length)return X(e.rows);const c=e.rows.slice(0,a),d=s>0?e.rows.slice(-s):[],u=[];return u.push(...X(c)),Oe(i)&&Oe(o)&&u.push({kind:"separator"}),u.push(...X(d)),u}function X(e){return e.map(t=>({kind:"row",row:t}))}const Sn=200;function Be({oldValue:e,newValue:t}){const n=h.useMemo(()=>kn(e,t),[e,t]),i=h.useMemo(()=>n.flatMap(_n),[n]);return h.useMemo(()=>n.some(o=>o.hasAdditions||o.hasRemovals),[n])?r.jsx(On,{$maxHeight:Sn,children:i.map((o,a)=>{if(o.kind==="separator")return r.jsx(Mn,{children:r.jsx(Ve,{children:"\xB7\xB7\xB7"})},a);const{row:s}=o,c=An(s.type);return r.jsxs(c,{children:[r.jsxs(Fn,{children:[s.type==="remove"&&r.jsx(Jt,{size:"12px"}),s.type==="add"&&r.jsx(bt,{size:"12px"})]}),r.jsx(Ve,{children:s.text===""?" ":s.text})]},a)})}):null}function An(e){return e==="remove"?Bn:e==="add"?Vn:zn}const On=l.div`
|
|
160
103
|
display: flex;
|
|
161
104
|
flex-direction: column;
|
|
162
105
|
width: 100%;
|
|
@@ -167,29 +110,29 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
167
110
|
&::-webkit-scrollbar-track {
|
|
168
111
|
margin: var(--spacing-xxs) 0;
|
|
169
112
|
}
|
|
170
|
-
`,
|
|
113
|
+
`,ee=l.div`
|
|
171
114
|
display: flex;
|
|
172
115
|
font-size: var(--font-size-sm);
|
|
173
116
|
line-height: var(--line-height-sm);
|
|
174
117
|
font-weight: var(--font-weight-regular);
|
|
175
118
|
padding-right: var(--spacing-xxs);
|
|
176
|
-
|
|
119
|
+
`,Bn=l(ee)`
|
|
177
120
|
background: var(--admonition-danger-bg-color);
|
|
178
121
|
color: var(--color-raspberry-7);
|
|
179
|
-
`,
|
|
122
|
+
`,Vn=l(ee)`
|
|
180
123
|
background: var(--admonition-success-bg-color);
|
|
181
124
|
color: var(--color-green-7);
|
|
182
|
-
`,
|
|
125
|
+
`,zn=l(ee)`
|
|
183
126
|
background: transparent;
|
|
184
127
|
color: var(--text-color-secondary);
|
|
185
|
-
`,
|
|
128
|
+
`,Fn=l.span`
|
|
186
129
|
display: flex;
|
|
187
130
|
align-items: center;
|
|
188
131
|
justify-content: center;
|
|
189
132
|
min-width: 16px;
|
|
190
133
|
height: 20px;
|
|
191
134
|
flex-shrink: 0;
|
|
192
|
-
`,
|
|
135
|
+
`,Ve=l.span`
|
|
193
136
|
width: 100%;
|
|
194
137
|
min-width: 0;
|
|
195
138
|
line-height: var(--line-height-sm);
|
|
@@ -197,9 +140,9 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
197
140
|
font-weight: var(--font-weight-regular);
|
|
198
141
|
white-space: pre-wrap;
|
|
199
142
|
word-break: break-all;
|
|
200
|
-
`,
|
|
143
|
+
`,Mn=l(ee)`
|
|
201
144
|
user-select: none;
|
|
202
|
-
|
|
145
|
+
`,$n=e=>typeof e!="object"||e===null?!1:"kind"in e&&e.kind==="batch"?"changes"in e?Array.isArray(e.changes)&&e.changes.every(ze):!1:ze(e);function ze(e){return typeof e!="object"||e===null||!("id"in e)||!("target"in e)||!("included"in e)||!("kind"in e)?!1:e.kind==="single"}const En={approveLabel:"Approve",denyLabel:"Deny"};function Rn(e,t){const n=k(t,"action");if(n){const o=Nt[n];if(o)return o}return Dt[e]||En}function k(e,t){if(!e||typeof e!="object")return null;const n=e.payload;if(!n||typeof n!="object")return null;const i=n[t];return typeof i!="string"?null:i.trim()||null}function te(e,t){if(!(typeof t>"u"))return e?`${e}: ${t}`:t}function Ln(e){return e?"changes"in e?Array.isArray(e.changes)?e.changes.map(t=>!t||typeof t!="object"||!("approved"in t)?!1:t.approved===!0):[]:[]:[]}function Nn(e,t){if(!e||typeof e!="object")return;const n=ne(e,se),i=ne(n,le);if(!(t in i))return;const o=i[t];if(Array.isArray(o)&&o.length!==0&&o.every($n))return o}function Fe(e,t){return Pt(e)&&ke(e)&&e.toolCallId===t}function Dn(e,t,n){const i=e.parts.map(c=>Fe(c,t)?{...c,input:Pn(c.input,n)}:c),o=e.metadata&&typeof e.metadata=="object"?e.metadata:{},a=ne(o,se),s={...ne(a,le),[t]:Ct(n)};return{...e,parts:i,metadata:{...o,[se]:{...a,[le]:s}}}}function ne(e,t){const n=e[t];return typeof n=="object"&&n!==null?n:{}}function Pn(e,t){if(!e||!("changes"in e)||!Array.isArray(e.changes))return e;const{changes:n,...i}=e;return{...i,changes:n.map((o,a)=>({...o,approved:t[a]?.included??!1}))}}function Un({preview:e,isIncluded:t,onToggle:n,readOnly:i}){const{primaryLabel:o,categoryLabel:a,diffLineKey:s}=Hn(e.target);return r.jsx(Gn,{isIncluded:t,onToggle:n,readOnly:i,primaryLabel:o,categoryLabel:a,children:e.kind==="batch"?r.jsx(nr,{children:e.changes.map(c=>r.jsx(Be,{oldValue:te(c.target.key,c.oldValue),newValue:te(c.target.key,c.newValue)},c.id))}):r.jsx(Be,{oldValue:te(s,e.oldValue),newValue:te(s,e.newValue)})})}function Hn(e){const t=e.schemeId??e.type;return e.stepId||e.schemeId?{primaryLabel:e.stepId??t,categoryLabel:e.stepId?t:void 0,diffLineKey:e.key}:{primaryLabel:e.key??e.type,categoryLabel:e.key?e.type:void 0,diffLineKey:void 0}}function Gn({isIncluded:e,onToggle:t,readOnly:n,primaryLabel:i,categoryLabel:o,children:a}){return r.jsxs(Kn,{$dimmed:n&&!e,children:[r.jsxs(Wn,{children:[n?r.jsx(Xn,{children:e?r.jsx(er,{size:"16px"}):r.jsx(tr,{size:"16px"})}):r.jsxs(Jn,{children:[r.jsx(qn,{checked:e}),r.jsx(Qn,{type:"checkbox",checked:e,onChange:t})]}),r.jsx(Zn,{children:i}),o?r.jsx(Yn,{children:o}):null]}),a]})}const Kn=l.div`
|
|
203
146
|
display: flex;
|
|
204
147
|
flex-direction: column;
|
|
205
148
|
gap: var(--spacing-xs);
|
|
@@ -211,12 +154,12 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
211
154
|
&:last-child {
|
|
212
155
|
border-bottom: none;
|
|
213
156
|
}
|
|
214
|
-
`,
|
|
157
|
+
`,Wn=l.div`
|
|
215
158
|
display: flex;
|
|
216
159
|
align-items: center;
|
|
217
160
|
gap: var(--spacing-xs);
|
|
218
161
|
min-width: 0;
|
|
219
|
-
`,
|
|
162
|
+
`,Zn=l.span`
|
|
220
163
|
flex: 1;
|
|
221
164
|
min-width: 0;
|
|
222
165
|
color: var(--text-color-primary);
|
|
@@ -226,24 +169,24 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
226
169
|
overflow: hidden;
|
|
227
170
|
text-overflow: ellipsis;
|
|
228
171
|
white-space: nowrap;
|
|
229
|
-
`,
|
|
172
|
+
`,Yn=l.span`
|
|
230
173
|
flex-shrink: 0;
|
|
231
174
|
font-family: var(--code-block-font-family, var(--font-family-monospace, monospace));
|
|
232
175
|
font-size: var(--font-size-sm);
|
|
233
176
|
font-weight: var(--font-weight-regular);
|
|
234
177
|
line-height: var(--line-height-sm);
|
|
235
178
|
color: var(--text-color-secondary);
|
|
236
|
-
`,
|
|
179
|
+
`,qn=l(It).attrs({"aria-hidden":!0})`
|
|
237
180
|
--checkbox-border-color: var(--color-blueberry-6);
|
|
238
181
|
--checkbox-box-color: var(--color-blueberry-6);
|
|
239
182
|
--checkbox-box-color-active: var(--color-blueberry-6);
|
|
240
|
-
`,
|
|
183
|
+
`,Jn=l.span`
|
|
241
184
|
position: relative;
|
|
242
185
|
display: inline-flex;
|
|
243
186
|
flex-shrink: 0;
|
|
244
187
|
width: 16px;
|
|
245
188
|
height: 16px;
|
|
246
|
-
`,
|
|
189
|
+
`,Qn=l.input`
|
|
247
190
|
position: absolute;
|
|
248
191
|
inset: 0;
|
|
249
192
|
width: 16px;
|
|
@@ -251,26 +194,26 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
251
194
|
margin: 0;
|
|
252
195
|
opacity: 0;
|
|
253
196
|
cursor: pointer;
|
|
254
|
-
`,
|
|
197
|
+
`,Xn=l.span`
|
|
255
198
|
display: inline-flex;
|
|
256
199
|
flex-shrink: 0;
|
|
257
200
|
width: 16px;
|
|
258
201
|
height: 16px;
|
|
259
202
|
align-items: center;
|
|
260
203
|
justify-content: center;
|
|
261
|
-
`,
|
|
204
|
+
`,er=l(ct)`
|
|
262
205
|
color: var(--color-success-base);
|
|
263
|
-
`,
|
|
206
|
+
`,tr=l(kt)`
|
|
264
207
|
color: var(--text-color-description);
|
|
265
|
-
`,
|
|
208
|
+
`,nr=l.div`
|
|
266
209
|
display: flex;
|
|
267
210
|
flex-direction: column;
|
|
268
211
|
gap: var(--spacing-xxs);
|
|
269
212
|
min-width: 0;
|
|
270
|
-
`;function Me({previews:e,handleToggle:t,readOnly:n}){return e.length===0?null:r.jsx(
|
|
213
|
+
`;function Me({previews:e,handleToggle:t,readOnly:n}){return e.length===0?null:r.jsx(rr,{children:e.map((i,o)=>r.jsx(Un,{preview:i,isIncluded:i.included,onToggle:t?()=>t(o):void 0,readOnly:n},i.id))})}const rr=l.div`
|
|
271
214
|
display: flex;
|
|
272
215
|
flex-direction: column;
|
|
273
|
-
`,
|
|
216
|
+
`,ir={update_step:sr,update_security:lr,run_request:pr,web_search:fr,manage_environment:dr,manage_collection:ur};function or(e,t){const n=ir[e];return n?n(t):ar(e)}function ar(e){return[{kind:"text",text:e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}]}function sr(e){return $e(e,"Update step")}function lr(e){const t=cr(e);if(t.size>1)return I("Update security");const[n]=t;return $e(e,"Update security",n)}function cr(e){const t=e&&"changes"in e?e.changes:void 0;if(!Array.isArray(t))return new Set;const n=G(e,"stepId"),i=t.map(o=>G(o,"stepId")??n);return new Set(i.filter(o=>!!o))}function $e(e,t,n){const{collectionId:i,workflowId:o,stepId:a}=hr(e),s=n??a;return!i||!o||!s?I(t):Ee(`${t} `,Te({collectionId:i,workflowId:o,stepId:s}),s)}function I(e){return[{kind:"text",text:e}]}function A(e,t){return t?`${e} "${t}"`:e}function Ee(e,t,n){return[{kind:"text",text:e},{kind:"link",href:t,label:n}]}function dr(e){const t=k(e,"action"),n=k(e,"environment"),i=n?` in environment "${n}"`:"";switch(t){case"add_environment":return I(A("Add environment",n));case"set_active_environment":return I(n?`Switch active environment to ${n}`:"Switch active environment");case"upsert_input":return I(A("Set input",k(e,"name"))+i);case"remove_input":return I(A("Remove input",k(e,"inputName"))+i);case"upsert_server":return I(A("Set server",k(e,"apiId"))+i);case"remove_server":return I(A("Remove server",k(e,"apiId"))+i);default:return I("Manage environment")}}function ur(e){switch(k(e,"action")){case"create_collection":return I(A("Create collection",k(e,"title")));case"delete_collection":return I(A("Delete collection",k(e,"collectionId")));case"create_workflow":return I(A("Create workflow",k(e,"name")));case"delete_workflow":return I(A("Delete workflow",k(e,"workflowId")));case"create_step":return I(A("Create step",k(e,"stepName")));case"delete_step":{const t=k(e,"collectionId"),n=k(e,"workflowId"),i=k(e,"stepId");return!t||!n||!i?I("Delete step"):Ee("Delete step ",Te({collectionId:t,workflowId:n,stepId:i}),i)}case"save_tab_to_collection":return I(A("Save tab as step",k(e,"newStepName")));default:return I("Manage collection")}}function pr(){return[{kind:"text",text:"Run current request"}]}function fr(e){return[{kind:"text",text:"Search the web at "},{kind:"link",href:e.url,label:e.url}]}function hr(e){return{collectionId:G(e,"collectionId"),workflowId:G(e,"workflowId"),stepId:G(e,"stepId")}}function G(e,t){if(typeof e!="object"||e===null||!(t in e))return null;const n=e[t];return typeof n=="string"&&n.trim()||null}function Re({toolName:e,input:t}){const n=or(e,t),i=_e();return r.jsx(xr,{onClick:i,children:r.jsx(gr,{children:n.map((o,a)=>o.kind==="text"?r.jsx("span",{children:o.text},a):r.jsx(mr,{href:o.href,children:o.label},a))})})}const xr=l.div`
|
|
274
217
|
display: flex;
|
|
275
218
|
flex-direction: column;
|
|
276
219
|
gap: 0;
|
|
@@ -280,13 +223,13 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
280
223
|
&:not(:last-child) {
|
|
281
224
|
border-bottom: 1px solid var(--border-color-secondary);
|
|
282
225
|
}
|
|
283
|
-
`,
|
|
226
|
+
`,gr=l.span`
|
|
284
227
|
font-family: var(--font-family-base);
|
|
285
228
|
font-size: var(--font-size-sm);
|
|
286
229
|
font-weight: var(--font-weight-regular);
|
|
287
230
|
line-height: var(--line-height-sm);
|
|
288
231
|
color: var(--text-color-primary);
|
|
289
|
-
`,
|
|
232
|
+
`,mr=l.a`
|
|
290
233
|
color: var(--link-color-primary);
|
|
291
234
|
cursor: pointer;
|
|
292
235
|
text-decoration: none;
|
|
@@ -294,7 +237,7 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
294
237
|
&:hover {
|
|
295
238
|
color: var(--link-color-primary, var(--text-color-link));
|
|
296
239
|
}
|
|
297
|
-
`;function b({id:e,targetType:t,targetKey:n,
|
|
240
|
+
`;function Le(e,t,n){const i={type:e};return t!==void 0&&(i.key=t),n&&(i.stepId=n),i}function b({id:e,targetType:t,targetKey:n,targetStepId:i,oldValue:o,newValue:a}){return{kind:"single",id:e,target:Le(t,n,i),oldValue:o,newValue:a,included:!0}}function E(e,t,n){return b({id:e,targetType:t,targetStepId:n,oldValue:void 0,newValue:void 0})}function P({data:e,baseId:t,targetType:n,batchTargetKey:i,targetStepId:o,getOldValue:a,getNewValue:s=(d,u)=>String(u??""),resolveTargetKey:c=d=>d}){const d=Object.entries(e).filter(([,p])=>p!==void 0);if(d.length===0)return E(t,n,o);if(d.length>=2){const p=d.map(([x,g])=>b({id:`${t}:${x}`,targetType:n,targetKey:c(x),oldValue:a(x),newValue:s(x,g)}));return{kind:"batch",id:t,target:Le(n,i,o),changes:p,included:!0}}const[u,f]=d[0];return b({id:t,targetType:n,targetKey:c(u),targetStepId:o,oldValue:a(u),newValue:s(u,f)})}function vr({store:e,input:t}){if(!yr(t))return[];const n=new Map,i=o=>{const a=n.get(o);if(a)return a;const s=Ie(e,t.collectionId,t.workflowId,o),c=s.ok?s.value:null,d=c?Array.from(c.security.get({noproxy:!0})):[];return n.set(o,d),d};return t.changes.map((o,a)=>{const s=o.stepId?.trim(),c=s||t.stepId;return wr(i(c),o,a,s)})}function yr(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.collectionId=="string"&&typeof t.workflowId=="string"&&typeof t.stepId=="string"&&Array.isArray(t.changes)&&t.changes.length>0}function wr(e,t,n,i){const o=`security[${n}]`;switch(t.action){case C.ADD:{const{type:a,schemeId:s,data:c}=t;return!c||Object.keys(c).length===0?K(b({id:o,targetType:a,targetStepId:i,oldValue:void 0,newValue:a}),s):K(P({data:c,baseId:o,targetType:a,targetStepId:i,getOldValue:()=>{}}),s)}case C.UPDATE:{const{type:a,data:s}=t,c=t.index!==void 0?e[t.index]:void 0,d=t.schemeId||fe(c);return!s||Object.keys(s).length===0?K(b({id:o,targetType:a,targetStepId:i,oldValue:De(c),newValue:a}),d):K(P({data:s,baseId:o,targetType:a,targetStepId:i,getOldValue:u=>c?jr(c,u):void 0}),d)}case C.REMOVE:{const a=Ut(e,t),s=a.ok?a.entry:void 0;return K(b({id:o,targetType:s?.securityType??"Security",targetStepId:i,oldValue:De(s),newValue:void 0}),fe(s))}}}function K(e,t){return t?{...e,target:{...e.target,schemeId:t}}:e}function jr(e,t){switch(e.securityType){case $.NoAuth:return;case $.OAuth2:return Ne(e[$.OAuth2],t);case $.OpenIDConnect:{const n=e[$.OpenIDConnect];return t==="openIdConnectUrl"?n.openIdConnectUrl||void 0:t==="userInfoUrl"?n.userInfoUrl||void 0:Ne(n,t)}case $.APIKey:{const n=e[$.APIKey];return t==="location"?re(n,t)?.toLowerCase():re(n,t)}default:{const n=e[e.securityType];return re(n,t)}}}function Ne(e,t){if(t==="grantType")return e.grantType||void 0;if(!e.grantType)return;const n=e[e.grantType];return re(n,t)}function re(e,t){const n=e[t];return n!==void 0&&n!==""?String(n):void 0}function De(e){if(!e||e.securityType===$.NoAuth)return;const t=fe(e);return t?`${e.securityType} (${t})`:e.securityType}function fe(e){return!e||e.securityType===$.NoAuth?void 0:e[e.securityType]?.schemeName||void 0}function br({store:e,input:t}){if(!Cr(t))return[];const n=Ie(e,t.collectionId,t.workflowId,t.stepId),i=n.ok?n.value:null;return t.changes.map((o,a)=>kr(i,o,a))}function Cr(e){return typeof e!="object"||e===null?!1:"collectionId"in e&&"workflowId"in e&&"stepId"in e&&"changes"in e&&Array.isArray(e.changes)&&e.changes.length>0&&typeof e.collectionId=="string"&&typeof e.workflowId=="string"&&typeof e.stepId=="string"}function kr(e,t,n){const i=t.id??`${t.field}[${n}]`;switch(t.field){case"method":case"url":case"description":return Ir(e,t,i);case"parameters":return Tr(e,t,i);case"outputs":return _r(e,t,i);case"body":return Sr(e,t,i);case"successCriteria":return Ar(e,t,i)}}function Ir(e,t,n){const i=Q(t.field);switch(t.action){case C.ADD:return b({id:n,targetType:i,oldValue:void 0,newValue:t.data});case C.UPDATE:return b({id:n,targetType:i,oldValue:Pe(e,t.field),newValue:t.data});case C.REMOVE:return b({id:n,targetType:i,oldValue:Pe(e,t.field),newValue:void 0})}}function Tr(e,t,n){switch(t.action){case C.ADD:{if(!t.data)return E(n,"parameter");const{in:i,name:o,value:a}=t.data;return b({id:n,targetType:Q(i),targetKey:o,oldValue:void 0,newValue:a})}case C.UPDATE:{if(!t.id&&!t.data?.name)return E(n,"parameter");const i=Ue(e,t),o=t.data?.in??i?.in??"parameter";return b({id:n,targetType:Q(o),targetKey:t.data?.name??i?.key,oldValue:i?i.value??"":void 0,newValue:t.data?.value})}case C.REMOVE:{if(!t.id&&!t.data?.name)return E(n,"parameter");const i=Ue(e,t),o=t.data?.in??i?.in??"parameter";return b({id:n,targetType:Q(o),targetKey:i?.key??t.data?.name,oldValue:i?i.value??"":void 0,newValue:void 0})}}}function _r(e,t,n){switch(t.action){case C.ADD:return t.data?b({id:n,targetType:"Output",targetKey:t.data.name,oldValue:void 0,newValue:t.data.expression}):b({id:n,targetType:"Output",oldValue:void 0,newValue:void 0});case C.UPDATE:{if(!t.data)return b({id:n,targetType:"Output",oldValue:void 0,newValue:void 0});const i=t.id&&e?We(e,t.id):void 0;return b({id:n,targetType:"Output",targetKey:t.data.name,oldValue:i?.value,newValue:t.data.expression})}case C.REMOVE:{if(!t.id&&!t.data?.name)return E(n,"Output");let i=t.id&&e?We(e,t.id):void 0;return!i&&e&&t.data?.name&&(i=Vr(e,t.data.name)),b({id:n,targetType:"Output",targetKey:i?.key??t.data?.name,oldValue:i?.value,newValue:void 0})}}}function Sr(e,t,n){const{data:i}=t;switch(t.action){case C.ADD:return P({data:i,baseId:n,targetType:"Body",getOldValue:()=>{},getNewValue:o=>o==="content"?he(i.content,i.contentType):oe(i[o]),resolveTargetKey:o=>o==="content"?void 0:o});case C.UPDATE:{const o=e?.requestBody.type.get(),a=i.contentType??o;return P({data:i,baseId:n,targetType:"Body",getOldValue:s=>{if(e){if(s==="content")return he(e.requestBody.content.get(),o)||void 0;if(s==="contentType")return o}},getNewValue:s=>s==="content"?he(i.content,a):oe(i[s]),resolveTargetKey:s=>s==="content"?void 0:s})}case C.REMOVE:{const o=e?ce({contentType:e.requestBody.type.get(),content:e.requestBody.content.get()}):void 0;return b({id:n,targetType:"Body",oldValue:o,newValue:void 0})}}}function Ar(e,t,n){switch(t.action){case C.ADD:return t.data?P({data:t.data,baseId:n,targetType:"successCriteria",getOldValue:()=>{},getNewValue:i=>oe(t.data[i])}):E(n,"successCriteria");case C.UPDATE:{if(!t.data)return E(n,"successCriteria");const i=typeof t.id=="string"&&e?Ge(e,t.id):void 0;return P({data:t.data,baseId:n,targetType:"successCriteria",getOldValue:o=>{if(i){if(o==="condition")return i.condition;if(o==="context")return i.context??void 0;if(o==="type")return i.type}},getNewValue:o=>oe(t.data[o])})}case C.REMOVE:{if(typeof t.id!="string")return E(n,"successCriteria");const i=e?Ge(e,t.id):void 0;return b({id:n,targetType:"successCriteria",targetKey:i?.condition,oldValue:i?ce(i):void 0,newValue:void 0})}}}function Pe(e,t){if(e)switch(t){case"method":return e.xOperation.ornull?.method.get();case"url":return e.xOperation.ornull?.url.get();case"description":return e.description.get()}}function Ue(e,t){let n=t.id&&e?Or(e,t.id):null;return!n&&e&&t.data?.name&&(n=Br(e,t.data.name)),n}function He(e,t){for(const n of["path","query","header","cookie"]){const i=e.parameters[Ht[n]].get().find(o=>Tt(o)&&t(o));if(i)return i}return null}function Or(e,t){return He(e,n=>n.id===t)}function Br(e,t){return He(e,n=>n.key===t)}function Ge(e,t){return e.successCriteria.get().find(n=>n.condition===t)}function Ke(e,t){for(const n of e.outputs.get())if(t(n))return{key:ie(n.key),value:ie(n.value)}}function We(e,t){return Ke(e,n=>ie(n.id)===t)}function Vr(e,t){return Ke(e,n=>ie(n.key)===t)}function ie(e){return typeof e=="string"?e:e.get()}function oe(e){return e==null?"":typeof e=="string"?e:ce(e)}function he(e,t){if(!e||t!==_t.JSON)return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const zr={update_security:vr,update_step:br};function Ze(e,t){const n=ye(),i=h.useMemo(()=>{const d=e?zr[e]:void 0;if(!d)return[];try{return d({store:n,input:t})}catch(u){return console.error("Unable to build change previews",u),[]}},[e,n,t]),[o,a]=h.useState(()=>Object.fromEntries(i.map(d=>[d.id,d.included]))),s=h.useMemo(()=>i.map(d=>({...d,included:o[d.id]??d.included})),[i,o]),c=h.useCallback(d=>{a(typeof d=="function"?u=>{const f=i.map(p=>({...p,included:u[p.id]??p.included}));return Object.fromEntries(d(f).map(p=>[p.id,p.included]))}:Object.fromEntries(d.map(u=>[u.id,u.included])))},[i]);return{previews:s,setPreviews:c}}function Fr({toolCallId:e,toolName:t,input:n,onApprove:i,onDeny:o}){const{updateMessages:a}=H(),{previews:s,setPreviews:c}=Ze(t,n),{includedCount:d,totalCount:u}=h.useMemo(()=>({includedCount:s.filter(v=>v.included).length,totalCount:s.length}),[s]),{approveLabel:f,denyLabel:p}=h.useMemo(()=>Rn(t,n),[t,n]),x=h.useCallback(()=>{a(v=>{const j=[];for(let y=0;y<v.length;y++){const w=v[y],{parts:m}=w,T=w.role==="assistant",O=m.some(S=>Fe(S,e));if(T&&O){const S=Dn(w,e,s);j.push({index:y,message:S})}}return j}),i()},[s,i,a,e]),g=h.useCallback(v=>{c(j=>j.map((y,w)=>w===v?{...y,included:!y.included}:y))},[c]);return r.jsxs(Mr,{children:[r.jsx(Re,{toolName:t,input:n}),s.length?r.jsx($r,{children:r.jsx(Me,{previews:s,handleToggle:g})}):null,s.length?r.jsx(we,{}):null,r.jsxs(Er,{children:[u>1?r.jsxs(Rr,{children:[d," of ",u," selected"]}):null,r.jsx(Lr,{size:"small",variant:"secondary",onClick:o,children:p}),r.jsx(Nr,{size:"small",variant:"primary",onClick:x,disabled:u>0?d===0:!1,children:f})]})]})}const Mr=l.div`
|
|
298
241
|
display: flex;
|
|
299
242
|
color: var(--text-color-primary);
|
|
300
243
|
flex-direction: column;
|
|
@@ -305,34 +248,34 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
305
248
|
border: 1px solid var(--border-color-secondary);
|
|
306
249
|
background: var(--layer-color);
|
|
307
250
|
line-height: var(--line-height-sm);
|
|
308
|
-
|
|
251
|
+
`,$r=l.div`
|
|
309
252
|
display: flex;
|
|
310
253
|
flex-direction: column;
|
|
311
254
|
gap: var(--spacing-xs);
|
|
312
255
|
min-width: 0;
|
|
313
|
-
`,
|
|
256
|
+
`,Er=l.div`
|
|
314
257
|
display: flex;
|
|
315
258
|
flex-wrap: wrap;
|
|
316
259
|
justify-content: flex-end;
|
|
317
260
|
align-items: center;
|
|
318
261
|
padding: 0 var(--spacing-sm) var(--spacing-xs) var(--spacing-sm);
|
|
319
262
|
gap: var(--spacing-xxs);
|
|
320
|
-
`,
|
|
263
|
+
`,Rr=l.span`
|
|
321
264
|
flex: 1;
|
|
322
265
|
font-size: var(--font-size-sm);
|
|
323
266
|
font-weight: var(--font-weight-regular);
|
|
324
267
|
line-height: var(--line-height-sm);
|
|
325
268
|
color: var(--text-color-secondary);
|
|
326
|
-
`,
|
|
269
|
+
`,Lr=l(_)`
|
|
327
270
|
background: none;
|
|
328
|
-
`,
|
|
271
|
+
`,Nr=l(_)`
|
|
329
272
|
border: 1px solid var(--button-bg-color);
|
|
330
273
|
padding-top: 0;
|
|
331
274
|
padding-bottom: 0;
|
|
332
275
|
&:disabled {
|
|
333
276
|
border: 1px solid var(--button-border-color-disabled);
|
|
334
277
|
}
|
|
335
|
-
`;function
|
|
278
|
+
`;function Dr({approvalId:e,toolCallId:t,toolName:n,input:i}){const{addToolApprovalResponse:o}=H(),a=h.useCallback(()=>{o({id:e,approved:!0})},[e,o]),s=h.useCallback(()=>{o({id:e,approved:!1})},[e,o]);return r.jsx(Fr,{onApprove:a,onDeny:s,toolCallId:t,toolName:n,input:i})}function Pr({toolName:e,toolCallId:t,input:n,isDenied:i,messageMetadata:o,onUndo:a}){const s=h.useMemo(()=>Nn(o,t),[o,t]),{previews:c}=Ze(s?void 0:e,n),d=h.useMemo(()=>{const p=s??c;if(i)return p.map(g=>({...g,included:!1}));const x=Ln(n);return p.map((g,v)=>({...g,included:x[v]??g.included}))},[s,c,n,i]);if(d.length===0)return null;const u=d.filter(p=>p.included).length,f=u===0?"Nothing applied":`${u} ${u===1?"change":"changes"} applied`;return r.jsxs(Ur,{children:[r.jsx(Re,{toolName:e,input:n}),r.jsx(Hr,{children:r.jsx(Me,{previews:d,readOnly:!0})}),r.jsx(we,{}),r.jsxs(Gr,{children:[r.jsx(Kr,{children:f}),a?r.jsx(Wr,{size:"small",variant:"outlined",onClick:a,children:"Undo"}):null]})]})}const Ur=l.div`
|
|
336
279
|
display: flex;
|
|
337
280
|
color: var(--text-color-primary);
|
|
338
281
|
flex-direction: column;
|
|
@@ -342,46 +285,46 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
342
285
|
border: 1px solid var(--border-color-secondary);
|
|
343
286
|
background: var(--layer-color);
|
|
344
287
|
line-height: var(--line-height-sm);
|
|
345
|
-
`,
|
|
288
|
+
`,Hr=l.div`
|
|
346
289
|
display: flex;
|
|
347
290
|
flex-direction: column;
|
|
348
291
|
min-width: 0;
|
|
349
|
-
`,
|
|
292
|
+
`,Gr=l.div`
|
|
350
293
|
display: flex;
|
|
351
294
|
justify-content: space-between;
|
|
352
295
|
align-items: center;
|
|
353
296
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
354
297
|
gap: var(--spacing-xs);
|
|
355
|
-
`,
|
|
298
|
+
`,Kr=l.span`
|
|
356
299
|
font-size: var(--font-size-sm);
|
|
357
300
|
font-weight: var(--font-weight-regular);
|
|
358
301
|
line-height: var(--line-height-sm);
|
|
359
302
|
color: var(--text-color-secondary);
|
|
360
|
-
`,
|
|
303
|
+
`,Wr=l(_)`
|
|
361
304
|
padding-top: 0;
|
|
362
305
|
padding-bottom: 0;
|
|
363
|
-
`;function
|
|
306
|
+
`;function Zr({items:e,isLast:t}){const[n,i]=h.useState(t),o=h.useCallback(()=>{i(s=>!s)},[]),a=h.useMemo(()=>e.filter(s=>s.kind==="action"),[e]);return r.jsxs(qr,{children:[r.jsxs(Jr,{type:"button",onClick:o,"aria-expanded":n,children:[r.jsx(Qr,{children:n?r.jsx(dt,{size:"12px",color:"var(--icon-color-additional)"}):r.jsx(ut,{size:"12px",color:"var(--icon-color-additional)"})}),r.jsxs(Xr,{children:[a.length," ",a.length===1?"action":"actions"]})]}),n&&r.jsx(ei,{children:a.map((s,c)=>r.jsx(Yr,{text:s.text},c))})]})}function Yr({text:e}){return r.jsxs(ti,{children:[r.jsxs(ni,{children:[r.jsx(ri,{"aria-hidden":!0}),r.jsx(ii,{children:r.jsx(oi,{"aria-hidden":!0})}),r.jsx(Ye,{"aria-hidden":!0})]}),r.jsx(ai,{children:e})]})}const qr=l.div`
|
|
364
307
|
display: flex;
|
|
365
308
|
flex-direction: column;
|
|
366
309
|
width: 100%;
|
|
367
310
|
min-width: 0;
|
|
368
|
-
`,
|
|
311
|
+
`,Jr=l.button`
|
|
369
312
|
display: flex;
|
|
370
313
|
align-items: center;
|
|
371
314
|
cursor: pointer;
|
|
372
315
|
user-select: none;
|
|
373
316
|
width: fit-content;
|
|
374
317
|
padding: 0;
|
|
375
|
-
`,
|
|
318
|
+
`,Qr=l.span`
|
|
376
319
|
display: flex;
|
|
377
320
|
align-items: center;
|
|
378
321
|
flex-shrink: 0;
|
|
379
|
-
`,
|
|
322
|
+
`,Xr=l.span`
|
|
380
323
|
font-size: var(--font-size-sm);
|
|
381
324
|
font-weight: var(--font-weight-regular);
|
|
382
325
|
line-height: var(--line-height-sm);
|
|
383
326
|
color: var(--text-color-description);
|
|
384
|
-
`,
|
|
327
|
+
`,ei=l.div`
|
|
385
328
|
display: flex;
|
|
386
329
|
flex-direction: column;
|
|
387
330
|
gap: 0;
|
|
@@ -393,7 +336,7 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
393
336
|
background: var(--border-color-secondary);
|
|
394
337
|
flex: 1 1 auto;
|
|
395
338
|
min-height: 8px;
|
|
396
|
-
`,
|
|
339
|
+
`,ti=l.div`
|
|
397
340
|
display: flex;
|
|
398
341
|
flex-direction: row;
|
|
399
342
|
align-items: stretch;
|
|
@@ -405,7 +348,7 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
405
348
|
display: none;
|
|
406
349
|
}
|
|
407
350
|
}
|
|
408
|
-
`,
|
|
351
|
+
`,ni=l.div`
|
|
409
352
|
display: flex;
|
|
410
353
|
flex-direction: column;
|
|
411
354
|
align-items: center;
|
|
@@ -414,14 +357,14 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
414
357
|
flex: 0 0 auto;
|
|
415
358
|
align-self: stretch;
|
|
416
359
|
min-height: 0;
|
|
417
|
-
`,
|
|
360
|
+
`,ri=l.span`
|
|
418
361
|
display: block;
|
|
419
362
|
width: 1px;
|
|
420
363
|
height: 4px;
|
|
421
364
|
flex: 0 0 auto;
|
|
422
365
|
flex-shrink: 0;
|
|
423
366
|
background: var(--border-color-secondary);
|
|
424
|
-
`,
|
|
367
|
+
`,ii=l.div`
|
|
425
368
|
width: 12px;
|
|
426
369
|
height: 12px;
|
|
427
370
|
flex: 0 0 auto;
|
|
@@ -429,7 +372,7 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
429
372
|
display: flex;
|
|
430
373
|
align-items: center;
|
|
431
374
|
justify-content: center;
|
|
432
|
-
`,
|
|
375
|
+
`,oi=l.span`
|
|
433
376
|
width: 4px;
|
|
434
377
|
height: 4px;
|
|
435
378
|
flex-shrink: 0;
|
|
@@ -437,7 +380,7 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
437
380
|
box-sizing: border-box;
|
|
438
381
|
border: 1px solid var(--border-color-secondary);
|
|
439
382
|
background: transparent;
|
|
440
|
-
`,
|
|
383
|
+
`,ai=l.span`
|
|
441
384
|
flex: 1;
|
|
442
385
|
min-width: 0;
|
|
443
386
|
align-self: flex-start;
|
|
@@ -445,11 +388,11 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
445
388
|
font-weight: var(--font-weight-regular);
|
|
446
389
|
line-height: var(--line-height-sm);
|
|
447
390
|
color: var(--text-color-helper);
|
|
448
|
-
`;function
|
|
391
|
+
`;function si({items:e,messageMetadata:t}){return r.jsx(ci,{children:e.map((n,i)=>{if(n.kind==="reasoning-block"){const s=i===e.length-1;return r.jsx(Zr,{items:n.items,isLast:s},n.key)}if(n.kind==="text")return r.jsx(li,{rawMarkdown:n.text,workflowRunHistoryIds:n.workflowRunHistoryIds},n.key);const{part:o}=n,a=Gt(o.type);return a&&ke(o)?r.jsx(Dr,{approvalId:o.approval.id,toolCallId:o.toolCallId,toolName:a,input:o.input},n.key):a&&Kt(o)?r.jsx(Pr,{toolName:a,toolCallId:o.toolCallId,input:o.input,isDenied:o.state==="output-denied",messageMetadata:t},n.key):null})})}function li({rawMarkdown:e,workflowRunHistoryIds:t}){const n=_e({workflowRunHistoryIds:t});return r.jsx(di,{onClick:n,children:r.jsx(St,{rawMarkdown:e,parser:At})})}const ci=l.div`
|
|
449
392
|
display: flex;
|
|
450
393
|
flex-direction: column;
|
|
451
394
|
gap: var(--spacing-xs);
|
|
452
|
-
`,
|
|
395
|
+
`,di=l.div`
|
|
453
396
|
white-space: normal;
|
|
454
397
|
|
|
455
398
|
max-width: 100%;
|
|
@@ -467,22 +410,53 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
467
410
|
font-size: var(--font-size-sm);
|
|
468
411
|
line-height: var(--line-height-sm);
|
|
469
412
|
color: var(--text-color-primary);
|
|
470
|
-
|
|
413
|
+
`,W=l.div`
|
|
414
|
+
width: var(--search-ai-thinking-dot-size);
|
|
415
|
+
height: var(--search-ai-thinking-dot-size);
|
|
416
|
+
border-radius: 50%;
|
|
417
|
+
background: var(--search-ai-thinking-dot-color);
|
|
418
|
+
animation: bounce 1.4s infinite ease-in-out;
|
|
419
|
+
|
|
420
|
+
&:nth-child(1) {
|
|
421
|
+
animation-delay: -0.32s;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
&:nth-child(2) {
|
|
425
|
+
animation-delay: -0.16s;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
&:nth-child(3) {
|
|
429
|
+
animation-delay: 0s;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
@keyframes bounce {
|
|
433
|
+
0%,
|
|
434
|
+
80%,
|
|
435
|
+
100% {
|
|
436
|
+
opacity: 0.2;
|
|
437
|
+
transform: scale(0.8);
|
|
438
|
+
}
|
|
439
|
+
40% {
|
|
440
|
+
opacity: 1;
|
|
441
|
+
transform: scale(1);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
`;function ui(){return r.jsxs(pi,{children:[r.jsx(W,{}),r.jsx(W,{}),r.jsx(W,{})]})}const pi=l.div`
|
|
471
445
|
display: flex;
|
|
472
446
|
align-items: center;
|
|
473
447
|
justify-content: space-between;
|
|
474
448
|
width: 24px;
|
|
475
449
|
height: 24px;
|
|
476
|
-
`;function
|
|
450
|
+
`;function fi(){return r.jsxs(hi,{children:[r.jsx(ui,{}),r.jsx(xi,{children:"Thinking"})]})}const hi=l.div`
|
|
477
451
|
display: flex;
|
|
478
452
|
align-items: center;
|
|
479
453
|
gap: var(--spacing-xxs);
|
|
480
|
-
`,
|
|
454
|
+
`,xi=l.span`
|
|
481
455
|
font-family: var(--font-family-base);
|
|
482
456
|
font-size: var(--font-size-sm);
|
|
483
457
|
line-height: var(--line-height-sm);
|
|
484
458
|
color: var(--text-color-helper);
|
|
485
|
-
`;function
|
|
459
|
+
`;function gi({items:e}){return r.jsx(h.Fragment,{children:e.map(t=>t.kind!=="text"?null:r.jsx(qe,{children:t.text},t.key))})}const mi="Something went wrong. Please try again.";function vi(e){return e?.message?.trim()||mi}function yi({message:e,isLastMessage:t}){const{chatStatus:n,chatError:i}=H(),{role:o,parts:a}=e,s=o===V.ASSISTANT,c=h.useMemo(()=>Wt(a),[a]),d=c.length>0,u=n==="error"&&t&&s&&!d;return!d&&!u?null:r.jsx(Je,{$role:o,children:r.jsx(ji,{isFailedEmptyAssistant:u,chatError:i,isAssistant:s,contentItems:c,messageMetadata:e.metadata})})}function wi(){return r.jsx(Je,{$role:V.ASSISTANT,children:r.jsx(xe,{children:r.jsx(fi,{})})})}function ji({isFailedEmptyAssistant:e,chatError:t,isAssistant:n,contentItems:i,messageMetadata:o}){return e?r.jsx(xe,{children:r.jsx(qe,{children:vi(t)})}):r.jsx(xe,{children:n?r.jsx(si,{items:i,messageMetadata:o}):r.jsx(gi,{items:i})})}const Je=l.div`
|
|
486
460
|
display: flex;
|
|
487
461
|
flex-direction: column;
|
|
488
462
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
@@ -497,13 +471,13 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
497
471
|
word-wrap: break-word;
|
|
498
472
|
white-space: pre-wrap;
|
|
499
473
|
max-width: 100%;
|
|
500
|
-
`,
|
|
474
|
+
`,xe=l.div`
|
|
501
475
|
display: flex;
|
|
502
476
|
flex-direction: column;
|
|
503
477
|
gap: var(--spacing-xxs);
|
|
504
478
|
min-width: 0;
|
|
505
479
|
width: 100%;
|
|
506
|
-
`;function
|
|
480
|
+
`;function bi(){const{messages:e,isStreaming:t}=H(),n=e.at(-1),i=h.useMemo(()=>{const o=n?.role===V.ASSISTANT,a=n?.parts.at(-1)?.type==="text";return t&&!(o&&a)},[t,n?.parts,n?.role]);return r.jsxs(Ci,{children:[e.map((o,a)=>r.jsx(Qe,{$role:o.role,children:r.jsx(Xe,{$role:o.role,children:r.jsx(yi,{message:o,isLastMessage:a===e.length-1})})},o.id)),i&&r.jsx(Qe,{$role:V.ASSISTANT,children:r.jsx(Xe,{$role:V.ASSISTANT,children:r.jsx(wi,{})})})]})}const Ci=l.div`
|
|
507
481
|
display: flex;
|
|
508
482
|
flex-direction: column;
|
|
509
483
|
gap: var(--spacing-xs);
|
|
@@ -520,17 +494,17 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
520
494
|
min-width: 0;
|
|
521
495
|
width: 100%;
|
|
522
496
|
max-width: 100%;
|
|
523
|
-
`;function
|
|
497
|
+
`;function ki(e){const t=h.useRef(void 0);return h.useEffect(()=>{t.current=e}),t.current}const et=l.div`
|
|
524
498
|
display: flex;
|
|
525
499
|
flex-direction: column;
|
|
526
500
|
flex: 1;
|
|
527
501
|
width: 100%;
|
|
528
502
|
overflow: auto;
|
|
529
503
|
padding: var(--spacing-xs);
|
|
530
|
-
`,
|
|
504
|
+
`,Ii=e=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",...e,children:[r.jsx("path",{d:"M12.1683 8.65224C13.4439 7.91782 13.4439 6.08176 12.1683 5.34733L8.48891 3.22903L5.13033 6.57817C5.03961 6.66863 5.03961 6.8153 5.13033 6.90577L8.81674 10.5818L12.1683 8.65224Z",fill:"url(#replay-icon-gradient)"}),r.jsx("path",{d:"M7.56707 11.3013L3.81522 13.4613C2.53957 14.1957 0.945007 13.2777 0.945007 11.8088L0.945008 2.19072C0.945008 0.721872 2.53957 -0.196157 3.81522 0.538267L7.23924 2.50957L4.14475 5.59536C3.5097 6.22861 3.5097 7.25532 4.14475 7.88858L7.56707 11.3013Z",fill:"url(#replay-icon-gradient)"}),r.jsx("defs",{children:r.jsxs("linearGradient",{id:"replay-icon-gradient",x1:"12.0947",y1:"10.9627",x2:"1.65018",y2:"0.120816",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#C361FF"}),r.jsx("stop",{offset:"0.411322",stopColor:"#9461FF"}),r.jsx("stop",{offset:"0.73777",stopColor:"#207DFF"}),r.jsx("stop",{offset:"1",stopColor:"#1DA8F6"})]})})]}),Ti=l(Ii)`
|
|
531
505
|
height: ${({size:e})=>e||"14px"};
|
|
532
506
|
width: ${({size:e})=>e||"14px"};
|
|
533
|
-
`;function
|
|
507
|
+
`;function _i(e){const t="var(--font-size-base)";switch(e){case de:return r.jsx(Ti,{size:t});case ue.OPENAI:return r.jsx(gt,{size:t,color:"var(--text-color-primary)"});case ue.GEMINI:return r.jsx(rn,{size:t});case ue.ANTHROPIC:return r.jsx(xt,{size:t,color:"var(--replay-claude-icon-color)"})}}function Si({models:e,selectedModelId:t,placement:n,onModelSelect:i,onSettingsOpen:o}){const a=e.find(p=>p.id===t),s=a?.label??"Replay AI",c=a?.id,d=e.filter(p=>p.provider===de),u=e.filter(p=>p.provider!==de),f=d.length>0&&u.length>0;return r.jsx(Vi,{children:r.jsx(zi,{trigger:r.jsx(Ai,{label:s}),placement:n,alignment:"start",withArrow:!0,children:r.jsxs(Fi,{children:[r.jsxs(Ei,{children:[d.map(p=>r.jsx(tt,{model:p,activeModelId:c,onModelSelect:i},p.id)),f&&r.jsx(nt,{"aria-hidden":!0}),u.length>0&&r.jsx(r.Fragment,{children:u.map(p=>r.jsx(tt,{model:p,activeModelId:c,onModelSelect:i},p.id))})]}),o&&e.length>0&&r.jsx(nt,{"aria-hidden":!0}),o&&r.jsx(Ri,{prefix:r.jsx(Ot,{size:"var(--font-size-base)",color:"var(--text-color-secondary)"}),content:"Manage models",onAction:()=>o("ai-providers")})]})})})}function Ai({label:e,icon:t,onClick:n,onKeyDown:i}){return r.jsxs(Oi,{onClick:n,onKeyDown:i,children:[r.jsx(Bi,{children:e}),t]})}function tt({model:e,activeModelId:t,onModelSelect:n}){const i=e.id===t;return r.jsx(me,{prefix:_i(e.provider),suffix:i?r.jsx($i,{size:"var(--font-size-base)",color:"var(--text-color-primary)"}):void 0,onAction:()=>n(e.id),active:i,children:r.jsx(Mi,{children:e.label})})}const Oi=l.div`
|
|
534
508
|
display: flex;
|
|
535
509
|
align-items: center;
|
|
536
510
|
min-width: 0;
|
|
@@ -545,7 +519,7 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
545
519
|
&:hover {
|
|
546
520
|
background: var(--layer-color-active);
|
|
547
521
|
}
|
|
548
|
-
`,
|
|
522
|
+
`,Bi=l.span`
|
|
549
523
|
overflow: hidden;
|
|
550
524
|
text-overflow: ellipsis;
|
|
551
525
|
font-family: var(--font-family-base);
|
|
@@ -554,13 +528,13 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
554
528
|
line-height: var(--line-height-base);
|
|
555
529
|
color: var(--text-color-primary);
|
|
556
530
|
white-space: nowrap;
|
|
557
|
-
`,
|
|
531
|
+
`,Vi=l.div`
|
|
558
532
|
--dropdown-menu-padding-top: 0;
|
|
559
533
|
|
|
560
534
|
min-width: 0;
|
|
561
535
|
flex: 1;
|
|
562
536
|
position: relative;
|
|
563
|
-
`,
|
|
537
|
+
`,zi=l(pt)`
|
|
564
538
|
width: 100%;
|
|
565
539
|
min-width: 0;
|
|
566
540
|
flex: 1;
|
|
@@ -569,7 +543,7 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
569
543
|
width: 100%;
|
|
570
544
|
max-width: 200px;
|
|
571
545
|
}
|
|
572
|
-
|
|
546
|
+
`,Fi=l(ft)`
|
|
573
547
|
--dropdown-menu-item-gap: calc(var(--spacing-unit) / 2);
|
|
574
548
|
--dropdown-menu-item-padding-vertical: var(--spacing-xxs);
|
|
575
549
|
--dropdown-menu-item-padding-horizontal: var(--spacing-xs);
|
|
@@ -578,13 +552,13 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
578
552
|
margin: 5px 0;
|
|
579
553
|
border-radius: var(--border-radius-lg);
|
|
580
554
|
background: var(--bg-color);
|
|
581
|
-
`,
|
|
555
|
+
`,Mi=l.span`
|
|
582
556
|
flex: 1;
|
|
583
557
|
min-width: 0;
|
|
584
558
|
overflow: hidden;
|
|
585
559
|
text-overflow: ellipsis;
|
|
586
560
|
white-space: nowrap;
|
|
587
|
-
|
|
561
|
+
`,$i=l(ht)`
|
|
588
562
|
margin-left: var(--spacing-xxs);
|
|
589
563
|
`,nt=l.li`
|
|
590
564
|
flex-shrink: 0;
|
|
@@ -593,16 +567,52 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
593
567
|
height: 1px;
|
|
594
568
|
margin: 0;
|
|
595
569
|
background: var(--border-color-secondary);
|
|
596
|
-
`,
|
|
570
|
+
`,Ei=l.li`
|
|
597
571
|
display: flex;
|
|
598
572
|
flex-direction: column;
|
|
599
573
|
gap: var(--dropdown-menu-item-gap);
|
|
600
574
|
list-style: none;
|
|
601
575
|
min-height: 0;
|
|
602
576
|
overflow-y: auto;
|
|
603
|
-
`,
|
|
577
|
+
`,Ri=l(me)`
|
|
604
578
|
flex-shrink: 0;
|
|
605
|
-
|
|
579
|
+
`,Li=280;function rt({pinToBottom:e=!1}){const[t,n]=h.useState(()=>je().getIndexingActivityState().inProgress);return h.useEffect(()=>je().subscribe("indexing-activity",i=>{n(i.inProgress)}),[]),r.jsx(Ni,{$open:t,$pinToBottom:e,"aria-hidden":!t,children:r.jsx(R,{tip:"We're building a search index of your project. Until it's ready, the assistant may need more context in each reply to stay accurate, which can use more tokens.",placement:"top",width:"240px",arrowPosition:"left",children:r.jsxs(Di,{role:"status","aria-live":"polite","aria-label":"Indexing in progress...",children:[r.jsx("div",{children:r.jsx(W,{})}),r.jsx(Pi,{children:"Indexing in progress..."})]})})})}const Ni=l.div`
|
|
580
|
+
width: 100%;
|
|
581
|
+
display: block;
|
|
582
|
+
|
|
583
|
+
${({$pinToBottom:e})=>e?ae`
|
|
584
|
+
order: 1;
|
|
585
|
+
margin-top: auto;
|
|
586
|
+
`:ae`
|
|
587
|
+
position: absolute;
|
|
588
|
+
left: 0;
|
|
589
|
+
right: 0;
|
|
590
|
+
bottom: 100%;
|
|
591
|
+
z-index: 1;
|
|
592
|
+
margin-bottom: 4px;
|
|
593
|
+
`}
|
|
594
|
+
|
|
595
|
+
opacity: ${({$open:e})=>e?1:0};
|
|
596
|
+
transition: opacity ${Li}ms ease-out;
|
|
597
|
+
pointer-events: ${({$open:e})=>e?"auto":"none"};
|
|
598
|
+
|
|
599
|
+
${W} {
|
|
600
|
+
animation-play-state: ${({$open:e})=>e?"running":"paused"};
|
|
601
|
+
}
|
|
602
|
+
`,Di=l.div`
|
|
603
|
+
width: 100%;
|
|
604
|
+
display: flex;
|
|
605
|
+
align-items: center;
|
|
606
|
+
gap: var(--spacing-xxs);
|
|
607
|
+
background: var(--layer-color);
|
|
608
|
+
padding: 2px var(--spacing-sm);
|
|
609
|
+
border-radius: 4px;
|
|
610
|
+
font-size: var(--font-size-sm);
|
|
611
|
+
line-height: 12px;
|
|
612
|
+
`,Pi=l.div`
|
|
613
|
+
flex: 1;
|
|
614
|
+
min-width: 0;
|
|
615
|
+
`;function Ui(){const{chatId:e,isLoading:t,pendingComposerPreset:n,clearPendingComposerPreset:i,availableModels:o,selectedModelId:a,selectModel:s,onSettingsOpen:c}=be(),{messages:d,isStreaming:u,sendMessage:f,stopGeneration:p}=H(),{isOpen:x}=Ce(),[g,v]=h.useState(""),j=h.useRef(null),y=h.useRef(null),w=h.useRef(!0),m=d.length>0,T=t||m,O=ki(d.length),S=O!==void 0&&O>0&&!m,M=h.useCallback((B="smooth")=>{y.current&&y.current.scrollTo({top:y.current.scrollHeight,behavior:B})},[]),Z=h.useCallback(()=>{const B=y.current;B&&B.scrollHeight-B.scrollTop-B.clientHeight<50&&(w.current=!0)},[]);h.useEffect(()=>{const B=y.current;if(!B)return;const ge=lt=>{lt.deltaY<0&&(w.current=!1)};return B.addEventListener("wheel",ge,{passive:!0}),()=>B.removeEventListener("wheel",ge)},[]);const Y=h.useCallback(async()=>{g&&(v(""),w.current=!0,await f(g),j.current&&requestAnimationFrame(()=>j.current?.focus()))},[f,g]);h.useEffect(()=>{x&&(j.current&&j.current.focus(),w.current=!0,M())},[x,d.length,M]),h.useEffect(()=>{u&&w.current&&M()}),h.useEffect(function(){x&&j.current&&(j.current.focus(),M("instant"))},[e,x,M]),h.useEffect(function(){!x||n===null||(v(n),i())},[x,n,i]);const st=r.jsx(sn,{value:g,onValueChange:v,onSubmit:Y,isStreaming:u,onStop:p,textareaRef:j,modelSelector:r.jsx(Si,{models:o,selectedModelId:a,placement:m?"top":"bottom",onModelSelect:s,onSettingsOpen:c})});return r.jsxs(et,{children:[r.jsx(Hi,{ref:y,$isExpanded:T,$isAnimated:u||S,onScroll:Z,children:t?r.jsx(Ki,{children:r.jsx(pe,{size:"20px"})}):r.jsx(bi,{})}),r.jsxs(Gi,{$isExpanded:!T,children:[r.jsx(rt,{pinToBottom:!T}),st]})]})}const Hi=l.div`
|
|
606
616
|
flex: ${({$isExpanded:e})=>e?1:0};
|
|
607
617
|
width: 100%;
|
|
608
618
|
overflow: auto;
|
|
@@ -610,48 +620,54 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
610
620
|
transition-property: flex;
|
|
611
621
|
transition-duration: ${e=>e.$isAnimated?"var(--replay-transition-duration)":"0s"};
|
|
612
622
|
transition-timing-function: var(--replay-transition-timing-function);
|
|
613
|
-
`,
|
|
623
|
+
`,Gi=l.div`
|
|
624
|
+
position: relative;
|
|
625
|
+
display: flex;
|
|
626
|
+
flex-direction: column;
|
|
627
|
+
width: 100%;
|
|
628
|
+
flex: ${({$isExpanded:e})=>e?1:0};
|
|
629
|
+
`,Ki=l.div`
|
|
614
630
|
display: flex;
|
|
615
631
|
justify-content: center;
|
|
616
632
|
height: 100%;
|
|
617
633
|
padding-top: var(--spacing-lg);
|
|
618
|
-
`,
|
|
634
|
+
`,F={TODAY:"today",YESTERDAY:"yesterday",LAST_WEEK:"last_week",LAST_MONTH:"last_month",OLDER:"older"},Wi={[F.TODAY]:"Today",[F.YESTERDAY]:"Yesterday",[F.LAST_WEEK]:"Last 7 days",[F.LAST_MONTH]:"Last 30 days",[F.OLDER]:"Older"};function Zi(e,t=Date.now()){const n=L(e).startOf("day"),i=L(t).startOf("day"),o=L(t).subtract(1,"day").startOf("day"),a=L(t).subtract(7,"day").startOf("day"),s=L(t).subtract(30,"day").startOf("day");return n.isSame(i,"day")?F.TODAY:n.isSame(o,"day")?F.YESTERDAY:!n.isBefore(a,"day")&&n.isBefore(o,"day")?F.LAST_WEEK:!n.isBefore(s,"day")&&n.isBefore(a,"day")?F.LAST_MONTH:F.OLDER}function Yi(e){const t=[];for(const n of e){const i=Zi(n.updatedAt),o=t[t.length-1];!o||o.bucket!==i?t.push({bucket:i,chats:[n]}):o.chats.push(n)}return t}function qi(e){const{scrollRef:t,sentinelRef:n,hasNextPage:i,isFetchingNextPage:o,fetchNextPage:a,observerResetKey:s}=e;h.useLayoutEffect(()=>{const c=t.current,d=n.current;if(!c||!d)return;const u=new IntersectionObserver(f=>{const p=f[0];p&&p.isIntersecting&&i&&(o||a())},{root:c,rootMargin:"80px"});return u.observe(d),()=>{u.disconnect()}},[s,a,i,o,t,n])}const it=l(et)`
|
|
619
635
|
gap: var(--spacing-xxs);
|
|
620
636
|
user-select: none;
|
|
621
|
-
`,
|
|
637
|
+
`,Ji=l.div`
|
|
622
638
|
display: flex;
|
|
623
639
|
flex-direction: column;
|
|
624
640
|
gap: var(--spacing-xs);
|
|
625
|
-
`,
|
|
641
|
+
`,Qi=l.div`
|
|
626
642
|
display: flex;
|
|
627
643
|
flex-direction: column;
|
|
628
644
|
gap: var(--spacing-xxs);
|
|
629
|
-
`,
|
|
645
|
+
`,Xi=l(it)`
|
|
630
646
|
display: flex;
|
|
631
647
|
flex-grow: 1;
|
|
632
648
|
align-items: center;
|
|
633
649
|
flex-direction: column;
|
|
634
650
|
padding: var(--spacing-md);
|
|
635
|
-
`,
|
|
651
|
+
`,eo=l.div`
|
|
636
652
|
display: flex;
|
|
637
653
|
flex-grow: 1;
|
|
638
654
|
align-items: center;
|
|
639
655
|
justify-content: center;
|
|
640
|
-
`,
|
|
656
|
+
`,to=l.div`
|
|
641
657
|
display: flex;
|
|
642
658
|
flex-direction: column;
|
|
643
659
|
align-items: center;
|
|
644
660
|
max-width: 75%;
|
|
645
661
|
gap: var(--spacing-xxs);
|
|
646
|
-
`,
|
|
662
|
+
`,no=l.div`
|
|
647
663
|
display: flex;
|
|
648
664
|
justify-content: center;
|
|
649
665
|
padding: var(--spacing-xs);
|
|
650
|
-
`,
|
|
666
|
+
`,ro=l(U)`
|
|
651
667
|
padding-left: var(--spacing-xs);
|
|
652
668
|
font-size: var(--font-size-sm);
|
|
653
669
|
color: var(--color-warm-grey-7);
|
|
654
|
-
`,
|
|
670
|
+
`,io=l.div`
|
|
655
671
|
display: flex;
|
|
656
672
|
flex-grow: 1;
|
|
657
673
|
|
|
@@ -659,7 +675,7 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
659
675
|
flex-grow: 1;
|
|
660
676
|
min-width: 0;
|
|
661
677
|
}
|
|
662
|
-
`,
|
|
678
|
+
`,oo=l.div`
|
|
663
679
|
display: flex;
|
|
664
680
|
align-items: center;
|
|
665
681
|
justify-content: space-between;
|
|
@@ -670,7 +686,7 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
670
686
|
gap: calc(var(--spacing-xxs) * 2.5);
|
|
671
687
|
cursor: pointer;
|
|
672
688
|
|
|
673
|
-
${
|
|
689
|
+
${_} {
|
|
674
690
|
display: none;
|
|
675
691
|
}
|
|
676
692
|
|
|
@@ -678,23 +694,23 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
678
694
|
&:hover {
|
|
679
695
|
background-color: var(--color-hover-base);
|
|
680
696
|
|
|
681
|
-
${
|
|
697
|
+
${_} {
|
|
682
698
|
display: inline-flex;
|
|
683
699
|
}
|
|
684
700
|
}
|
|
685
|
-
`,
|
|
701
|
+
`,ao=l(U)`
|
|
686
702
|
overflow: hidden;
|
|
687
703
|
white-space: nowrap;
|
|
688
704
|
text-overflow: ellipsis;
|
|
689
|
-
`,
|
|
705
|
+
`,so=l.div`
|
|
690
706
|
height: 1px;
|
|
691
707
|
flex-shrink: 0;
|
|
692
|
-
`;function
|
|
708
|
+
`;function lo(e){const{chat:t,onSelect:n,onRemove:i}=e;return r.jsx(io,{children:r.jsx(R,{tip:L(t.updatedAt).format("MMM DD, YYYY, hh:mm:ss A"),className:"expanded",children:r.jsxs(oo,{role:"button",onClick:()=>n?.(t.id),children:[r.jsx(ao,{children:t.title??"New chat"}),r.jsx(_,{variant:"ghost",size:"small",tone:"danger",icon:r.jsx(Bt,{}),onClick:o=>{o.stopPropagation(),i?.(t.id)}})]})})})}function co(e){const{group:t,onChatSelect:n,onChatRemove:i}=e;return r.jsxs(Qi,{children:[r.jsx(ro,{children:Wi[t.bucket]}),t.chats.map(o=>r.jsx(lo,{chat:o,onSelect:n,onRemove:i},o.id))]})}function uo(){return r.jsx(eo,{children:r.jsxs(to,{children:[r.jsx(U,{textAlign:"center",fontWeight:"var(--font-weight-semibold)",children:"No chat history"}),r.jsx(U,{textAlign:"center",children:"Ask questions or let the assistant take action for you."})]})})}function po(){return r.jsx(Xi,{children:r.jsx(pe,{})})}const fo=50;function ho(e){const{onChatSelect:t,onChatRemove:n}=e,i=h.useRef(null),o=h.useRef(null),{data:a,isPending:s,hasNextPage:c,isFetchingNextPage:d,fetchNextPage:u}=Zt(fo),f=h.useMemo(()=>(a?.pages??[]).flatMap(x=>x.items),[a?.pages]),p=h.useMemo(()=>Yi(f),[f]);return qi({scrollRef:i,sentinelRef:o,hasNextPage:c,isFetchingNextPage:d,fetchNextPage:u,observerResetKey:a?.pages.length}),s&&!a?r.jsx(po,{}):f.length===0?r.jsx(uo,{}):r.jsxs(it,{ref:i,children:[r.jsx(Ji,{children:p.map(x=>r.jsx(co,{group:x,onChatSelect:t,onChatRemove:n},`${x.bucket}-${x.chats[0]?.id??""}`))}),c&&r.jsx(so,{ref:o,"aria-hidden":!0}),d&&r.jsx(no,{children:r.jsx(pe,{})})]})}function xo(){const e=h.useRef(null),[t,n]=h.useState(!1);return h.useLayoutEffect(()=>{if(!e.current)return;const i=e.current;function o(){n(i.scrollWidth>i.clientWidth)}o();const a=new ResizeObserver(o);return a.observe(i),()=>a.disconnect()},[]),{ref:e,value:t}}function go(e){const{ref:t,value:n}=xo();return r.jsx(mo,{children:r.jsx(R,{tip:e.value,className:"no-overflow",disabled:!n,children:r.jsx(vo,{ref:t,children:e.value})})})}const mo=l.div`
|
|
693
709
|
overflow: hidden;
|
|
694
710
|
.tooltip-no-overflow {
|
|
695
711
|
overflow: hidden;
|
|
696
712
|
}
|
|
697
|
-
`,
|
|
713
|
+
`,vo=l.div`
|
|
698
714
|
color: var(--text-color-primary);
|
|
699
715
|
font-size: var(--font-size-base);
|
|
700
716
|
line-height: var(--line-height-base);
|
|
@@ -702,7 +718,7 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
702
718
|
white-space: nowrap;
|
|
703
719
|
text-overflow: ellipsis;
|
|
704
720
|
user-select: none;
|
|
705
|
-
`;function
|
|
721
|
+
`;function ot(e){const{children:t,buttons:n}=e;return r.jsxs(yo,{children:[r.jsx(wo,{children:t}),n&&r.jsx(jo,{children:n})]})}const yo=l.div`
|
|
706
722
|
display: flex;
|
|
707
723
|
flex-direction: row;
|
|
708
724
|
align-items: center;
|
|
@@ -710,28 +726,28 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
710
726
|
gap: var(--spacing-xs);
|
|
711
727
|
width: 100%;
|
|
712
728
|
flex-shrink: 0;
|
|
713
|
-
`,
|
|
729
|
+
`,wo=l.div`
|
|
714
730
|
display: flex;
|
|
715
731
|
align-items: center;
|
|
716
732
|
gap: var(--spacing-xs);
|
|
717
733
|
min-width: 0;
|
|
718
734
|
flex: 1;
|
|
719
|
-
`,
|
|
735
|
+
`,jo=l.div`
|
|
720
736
|
display: flex;
|
|
721
737
|
align-items: center;
|
|
722
738
|
gap: 2px;
|
|
723
|
-
`;function
|
|
739
|
+
`;function bo(e){const{title:t,onCreateNewChat:n,onViewHistory:i,onClose:o}=e,a=r.jsxs(r.Fragment,{children:[r.jsx(R,{tip:"New chat",children:r.jsx(_,{size:"small",variant:"text","aria-label":"Create new chat",onClick:n,icon:r.jsx(an,{})})}),r.jsx(R,{tip:"Chat history",children:r.jsx(_,{size:"small",variant:"text","aria-label":"View chat history",onClick:i,icon:r.jsx(zt,{})})}),r.jsx(ko,{children:r.jsx(Ft,{})}),r.jsx(R,{tip:"Close",arrowPosition:"left",children:r.jsx(_,{variant:"text",size:"small","aria-label":"Close panel",icon:r.jsx(mt,{}),onClick:o})})]});return r.jsxs(ot,{buttons:a,children:[r.jsx(Co,{children:r.jsx(Vt,{size:"14px"})}),r.jsx(go,{value:t})]})}const Co=l.div`
|
|
724
740
|
display: flex;
|
|
725
|
-
`,
|
|
741
|
+
`,ko=l.div`
|
|
726
742
|
display: flex;
|
|
727
743
|
height: 14px;
|
|
728
|
-
`;function
|
|
744
|
+
`;function Io(e){const{onReturnFromHistory:t}=e;return r.jsxs(ot,{children:[r.jsx(_,{size:"small",variant:"text","aria-label":"Return to chat",onClick:t,icon:r.jsx(Mt,{})}),r.jsx(To,{children:r.jsx(U,{children:"Chat history"})})]})}const To=l.div`
|
|
729
745
|
user-select: none;
|
|
730
|
-
`;function
|
|
746
|
+
`;function _o(){const[e,t]=h.useState(N.CHAT),n=Ce(),i=be(),o=()=>{t(N.HISTORY)},a=()=>{t(N.CHAT)},s=async c=>{i.selectChat(c),t(N.CHAT)};return r.jsxs(So,{children:[r.jsxs(at,{isActive:e===N.CHAT,children:[r.jsx(bo,{title:i.title,onCreateNewChat:i.createNewChat,onViewHistory:o,onClose:n.closePanel}),r.jsx(Ui,{})]}),r.jsxs(at,{isActive:e===N.HISTORY,isSliding:!0,children:[r.jsx(Io,{onReturnFromHistory:a}),r.jsx(ho,{onChatSelect:s,onChatRemove:i.removeChat}),r.jsx(Oo,{children:r.jsx(rt,{pinToBottom:!0})})]})]})}function at(e){const{children:t,isActive:n,isSliding:i=!1}=e,o=r.jsx(Ao,{inert:!n,children:t});return i?r.jsx(Bo,{$isExpanded:n,children:o}):o}const So=l.div`
|
|
731
747
|
position: relative;
|
|
732
748
|
height: 100%;
|
|
733
749
|
overflow: clip;
|
|
734
|
-
`,
|
|
750
|
+
`,Ao=l.div`
|
|
735
751
|
display: flex;
|
|
736
752
|
height: 100%;
|
|
737
753
|
flex-direction: column;
|
|
@@ -739,7 +755,12 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
739
755
|
border-radius: var(--border-radius-md);
|
|
740
756
|
background: var(--bg-color);
|
|
741
757
|
margin-left: var(--spacing-xxs);
|
|
742
|
-
`,
|
|
758
|
+
`,Oo=l.div`
|
|
759
|
+
display: flex;
|
|
760
|
+
flex-direction: column;
|
|
761
|
+
width: 100%;
|
|
762
|
+
padding: 0 var(--spacing-xs) var(--spacing-xs);
|
|
763
|
+
`,Bo=l.div`
|
|
743
764
|
position: absolute;
|
|
744
765
|
inset: 0;
|
|
745
766
|
transform: translateX(${e=>e.$isExpanded?"0%":"100%"});
|
|
@@ -749,6 +770,4 @@ import{g as W,a as l,j as r,r as h,ah as E,f as lt,B as A,e as ct,U as dt,ai as
|
|
|
749
770
|
@media (prefers-reduced-motion: reduce) {
|
|
750
771
|
transition-duration: 0ms;
|
|
751
772
|
}
|
|
752
|
-
|
|
753
|
-
width: 100%;
|
|
754
|
-
`;export{ko as AiPanel};
|
|
773
|
+
`;export{_o as AiPanel};
|