@redocly/openapi-docs 3.25.0-next.4 → 3.25.0-next.6

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.
Files changed (42) hide show
  1. package/dist/{redocly-openapi-docs.min.AiChatProvider-BtZYXzQL.js → redocly-openapi-docs.min.AiChatProvider-6YPcWs0H.js} +8 -8
  2. package/dist/{redocly-openapi-docs.min.AiChatSqliteDBStorage-CMWIhurV.js → redocly-openapi-docs.min.AiChatSqliteDBStorage-B83b3g85.js} +1 -1
  3. package/dist/{redocly-openapi-docs.min.AiPanel-CzVBo_SJ.js → redocly-openapi-docs.min.AiPanel-C2qfX9uL.js} +120 -120
  4. package/dist/redocly-openapi-docs.min.FileWatcher-BqldveuP.js +1 -0
  5. package/dist/redocly-openapi-docs.min.SemanticSearchService-WMOhwmFs.js +1 -0
  6. package/dist/{redocly-openapi-docs.min.SqliteDBStorage-DicEB6xf.js → redocly-openapi-docs.min.SqliteDBStorage-C1P1898p.js} +1 -1
  7. package/dist/redocly-openapi-docs.min.TauriFileSystemAdapter-dQrMcpdl.js +1 -0
  8. package/dist/redocly-openapi-docs.min.TauriRootStorage-Xs8U5nWO.js +1 -0
  9. package/dist/{redocly-openapi-docs.min.ai-chat-mappers-BfCwakK5.js → redocly-openapi-docs.min.ai-chat-mappers-CJR-cboS.js} +1 -1
  10. package/dist/{redocly-openapi-docs.min.external-resolver-DftxHgbt.js → redocly-openapi-docs.min.external-resolver-B_BGsIqk.js} +1 -1
  11. package/dist/redocly-openapi-docs.min.index-A1jwxgMY.js +7843 -0
  12. package/dist/redocly-openapi-docs.min.index-CzgAKyvP.js +1 -0
  13. package/dist/redocly-openapi-docs.min.index-DYtjK7I1.js +1 -0
  14. package/dist/redocly-openapi-docs.min.index-zM-C-d58.js +1 -0
  15. package/dist/redocly-openapi-docs.min.js +1 -1
  16. package/dist/{redocly-openapi-docs.min.lint-jyJiMT1p.js → redocly-openapi-docs.min.lint-CFL7cUUQ.js} +2 -2
  17. package/dist/{redocly-openapi-docs.min.lint-graphql-BLIlXit9.js → redocly-openapi-docs.min.lint-graphql-UDOPvcZk.js} +1 -1
  18. package/dist/redocly-openapi-docs.min.periodic-revalidation-DkSoAMSp.js +1 -0
  19. package/dist/{redocly-openapi-docs.min.respect-run-CTD2qNkS.js → redocly-openapi-docs.min.respect-run-BGASIC7w.js} +1 -1
  20. package/dist/{redocly-openapi-docs.min.standalone-CS00-kVE.js → redocly-openapi-docs.min.standalone-DlNPBIhk.js} +1228 -1148
  21. package/dist/redocly-openapi-docs.min.tauri-path-B2ySzLGM.js +1 -0
  22. package/dist/{redocly-openapi-docs.min.useAiChatQueries-BH1oro3k.js → redocly-openapi-docs.min.useAiChatQueries-DvhVIF-L.js} +103 -103
  23. package/lib/components/PropertyDetails/FieldDetail.js +3 -3
  24. package/lib/components/Replay/Replay.js +1 -1
  25. package/lib/components/Security/styled.js +3 -3
  26. package/lib/components/Tabs/Tabs.js +1 -1
  27. package/lib/components/TagItem/Breadcrumbs.js +2 -2
  28. package/lib/components/TagItem/OperationNavigationItems.js +1 -1
  29. package/lib/components/common/Fields/fields-layout.js +1 -1
  30. package/lib/components/common/Fields/fields.js +2 -2
  31. package/lib/components/common/styled.js +1 -1
  32. package/package.json +14 -5
  33. package/dist/redocly-openapi-docs.min.FileWatcher-DjTW24VD.js +0 -1
  34. package/dist/redocly-openapi-docs.min.SemanticSearchService-BdbJAsUF.js +0 -1
  35. package/dist/redocly-openapi-docs.min.TauriFileSystemAdapter-Bzf6nZVE.js +0 -1
  36. package/dist/redocly-openapi-docs.min.TauriRootStorage-Cg1lmYY7.js +0 -1
  37. package/dist/redocly-openapi-docs.min.index-BXAn8eur.js +0 -7837
  38. package/dist/redocly-openapi-docs.min.index-BnxwvVhR.js +0 -1
  39. package/dist/redocly-openapi-docs.min.index-CHKNddXa.js +0 -1
  40. package/dist/redocly-openapi-docs.min.index-U6ORLz-U.js +0 -1
  41. package/dist/redocly-openapi-docs.min.periodic-revalidation-Dsp-n7ui.js +0 -1
  42. package/dist/redocly-openapi-docs.min.tauri-path-Dw7ZXd_2.js +0 -1
@@ -1,25 +1,18 @@
1
- import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as pt,$ as ft,a0 as ye,x as ht,az as xt,aA as gt,ac as E,a8 as U,e as mt}from"./redocly-openapi-docs.min.standalone-CS00-kVE.js";import{f as J,O as we,Q as vt,e as yt,q as je,m as wt,n as jt,U as bt,E as Ct,V as se,W as le,X as kt,Y as It,Z as F,_ as ce,$ as Tt,a0 as _t,a1 as be,a2 as St,a3 as At,R as de,a4 as Ot,a5 as ue,a6 as Ce,t as ke,a7 as pe,a8 as L,a9 as Bt,aa as Vt,ab as zt,ac as Mt,ad as $t}from"./redocly-openapi-docs.min.index-BXAn8eur.js";import{B as Ft,C as Rt,E as Et,F as Lt,G as Nt,H as Dt,I as Pt,J as Ie,K as k,L as Te,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-BH1oro3k.js";import{g as _e}from"./redocly-openapi-docs.min.SemanticSearchService-BdbJAsUF.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"})`
1
+ import{g as q,a as l,j as r,h as oe,B as _,r as f,f as lt,k as me,A as ct,af as dt,a2 as ut,a4 as pt,a5 as ve,y as ft,aE as ht,aF as xt,ae as E,aa as U,e as gt}from"./redocly-openapi-docs.min.standalone-DlNPBIhk.js";import{f as ye,J as we,K as mt,L as vt,v as yt,M as wt,N as jt,O as ie,P as ae,Q as bt,S as Ct,U as $,V as se,W as kt,X as It,i as Tt,Y as _t,Z as je,_ as St,$ as At,R as le,a0 as Ot,a1 as ce,a2 as be,C as Ce,a3 as de,a4 as L,a5 as Bt,a6 as Vt,a7 as Mt,a8 as zt,a9 as Ft}from"./redocly-openapi-docs.min.index-A1jwxgMY.js";import{B as $t,C as Rt,E as Et,F as Lt,G as Nt,H as Dt,I as Pt,J as ke,K as k,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-DvhVIF-L.js";import{g as Te}from"./redocly-openapi-docs.min.SemanticSearchService-WMOhwmFs.js";function J(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:"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"})}),Jt=l(qt).attrs({"data-component-name":"icons/SendIcon/SendIcon"})`
2
2
  path {
3
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
- `,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"})`
8
+ `,Qt=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"})}),Xt=l(Qt).attrs({"data-component-name":"icons/StopIcon/StopIcon"})`
9
9
  path {
10
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
- `,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
- path {
17
- fill: ${({color:e})=>q(e)};
18
- }
19
-
20
- height: ${({size:e})=>e||"16px"};
21
- width: ${({size:e})=>e||"16px"};
22
- `;function nn({placeholder:e="Ask anything...",className:t,disabled:n,isStreaming:o=!1,onStop:i,modelSelector:a,value:s,onValueChange:c,onSubmit:d,textareaRef:u}){const f=s.trim(),p=!n&&f.length>0&&!o,x=!n&&f.length>0,g=w=>{c(w.target.value)},v=()=>{!f||n||o||d()},b=()=>{!o||!i||i()},y=w=>{w.key==="Enter"&&!w.shiftKey&&!w.nativeEvent.isComposing&&(w.preventDefault(),o&&i?b():v())};return r.jsxs(rn,{className:t,$isActive:x,children:[r.jsx(on,{ref:u,rows:1,maxLength:Yt,placeholder:e,value:s,disabled:n,spellCheck:!1,onChange:g,onKeyDown:y}),r.jsxs(an,{children:[a,o&&i?r.jsx(ln,{type:"button",size:"small","aria-label":"Stop generating",icon:r.jsx(tn,{color:"var(--icon-color-on-color)"}),onClick:b}):r.jsx(sn,{type:"button",size:"small","aria-label":"Send message",icon:r.jsx(Xt,{color:"var(--icon-color-on-color)"}),onClick:v,disabled:!p})]})]})}const rn=l.div`
15
+ `;function en({placeholder:e="Ask anything...",className:t,disabled:n,isStreaming:o=!1,onStop:i,modelSelector:a,value:s,onValueChange:c,onSubmit:u,textareaRef:d}){const p=s.trim(),h=!n&&p.length>0&&!o,x=!n&&p.length>0,g=w=>{c(w.target.value)},v=()=>{!p||n||o||u()},b=()=>{!o||!i||i()},y=w=>{w.key==="Enter"&&!w.shiftKey&&!w.nativeEvent.isComposing&&(w.preventDefault(),o&&i?b():v())};return r.jsxs(tn,{className:t,$isActive:x,children:[r.jsx(nn,{ref:d,rows:1,maxLength:Yt,placeholder:e,value:s,disabled:n,spellCheck:!1,onChange:g,onKeyDown:y}),r.jsxs(rn,{children:[a,o&&i?r.jsx(an,{type:"button",size:"small","aria-label":"Stop generating",icon:r.jsx(Xt,{color:"var(--icon-color-on-color)"}),onClick:b}):r.jsx(on,{type:"button",size:"small","aria-label":"Send message",icon:r.jsx(Jt,{color:"var(--icon-color-on-color)"}),onClick:v,disabled:!h})]})]})}const tn=l.div`
23
16
  display: flex;
24
17
  flex-direction: column;
25
18
  gap: var(--spacing-xs);
@@ -38,13 +31,13 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
38
31
  var(--replay-ai-gradient-soft) border-box;
39
32
  }
40
33
 
41
- ${({$isActive:e})=>e&&ae`
34
+ ${({$isActive:e})=>e&&oe`
42
35
  border-color: transparent;
43
36
  background:
44
37
  linear-gradient(var(--layer-color), var(--layer-color)) padding-box,
45
38
  var(--replay-ai-gradient-soft) border-box;
46
39
  `}
47
- `,on=l.textarea`
40
+ `,nn=l.textarea`
48
41
  max-height: 150px;
49
42
  min-height: var(--search-ai-conversation-input-min-height);
50
43
 
@@ -64,12 +57,12 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
64
57
  color: var(--text-color-helper);
65
58
  text-indent: 2px;
66
59
  }
67
- `,an=l.div`
60
+ `,rn=l.div`
68
61
  display: flex;
69
62
  justify-content: space-between;
70
63
  align-items: center;
71
64
  gap: var(--spacing-xs);
72
- `,sn=l(_)`
65
+ `,on=l(_)`
73
66
  box-sizing: border-box;
74
67
  background: var(--search-ai-gradient);
75
68
 
@@ -79,17 +72,24 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
79
72
  width: 24px;
80
73
  height: 24px;
81
74
  }
82
- `,ln=l(_)`
75
+ `,an=l(_)`
83
76
  box-sizing: border-box;
84
77
  background: var(--color-warm-grey-9);
85
78
  border-radius: var(--border-radius-xxl);
86
- `,cn=new Set(["collection","workflow","step","operation","workflow-run"]);function fe(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 o=n.trim();return o.length>0?o:null}function dn(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="replay:")return null;const n=t.hostname.toLowerCase();if(!cn.has(n))return null;const o=t.searchParams;switch(n){case"collection":{const i=z(o,"collectionId");return i?{kind:"collection",collectionId:i}:null}case"workflow":{const i=z(o,"collectionId"),a=z(o,"workflowId");return!i||!a?null:{kind:"workflow",collectionId:i,workflowId:a}}case"step":{const i=z(o,"collectionId"),a=z(o,"workflowId"),s=z(o,"stepId");return!i||!a||!s?null:{kind:"step",collectionId:i,workflowId:a,stepId:s}}case"operation":{const i=z(o,"operationId");return i?{kind:"operation",operationId:i}:null}case"workflow-run":{const i=z(o,"collectionId"),a=z(o,"workflowId");if(!i||!a)return null;const s=z(o,"historyId"),c=s==="null"||s==="undefined"?null:s;return{kind:"workflow-run",collectionId:i,workflowId:a,...c?{historyId:c}:{}}}default:return null}}function un(e,t,n){return e.tabsState.tabs.get({noproxy:!0}).findIndex(({data:o})=>vt(o,yt.WorkflowRun)&&o.collectionId===t&&o.workflowId===n)}function pn(e,t,n,o={}){switch(n.kind){case"collection":t.openCollectionTab({collectionId:n.collectionId,activeTabName:we.COLLECTION_SETTINGS});break;case"workflow":t.openWorkflowTab({collectionId:n.collectionId,workflowId:n.workflowId,activeTabName:we.WORKFLOW_SETTINGS});break;case"step":t.openStepTabFromCollection({collectionId:n.collectionId,workflowId:n.workflowId,stepId:n.stepId,state:J.Normal});break;case"workflow-run":{const i=o.workflowRunHistoryIds?.[Lt(n.collectionId,n.workflowId)]??[],a=n.historyId&&i.includes(n.historyId)?n.historyId:i.at(-1)??n.historyId;if(a){t.openWorkflowRunTabFromHistory(a,{state:J.Normal});break}const s=un(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 i=Ft(e,n.operationId);if(!i.ok){console.warn("[executeReplayChatLink] Operation not resolved",{operationId:n.operationId,message:i.message});return}Rt(e,Et(i.value),t);break}}}function fn(e,t,n,o={}){const i=dn(n);i&&pn(e,t,i,o)}function Se({workflowRunHistoryIds:e}={}){const t=je(),{getApiOperation:n}=wt(),{handleTabChange:o,addNewTab:i,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(),fn(t,{getApiOperation:n,handleTabChange:o,addNewTab:i,openCollectionTab:a,openWorkflowTab:s,openStepTabFromCollection:c,openWorkflowRunTab:d,openWorkflowRunTabFromHistory:u,changeTabState:f},v,{workflowRunHistoryIds:e}))},[e,t,n,o,i,a,s,c,d,u,f])}class hn{diff(t,n,o={}){let i;typeof o=="function"?(i=o,o={}):"callback"in o&&(i=o.callback);const a=this.castInput(t,o),s=this.castInput(n,o),c=this.removeEmpty(this.tokenize(a,o)),d=this.removeEmpty(this.tokenize(s,o));return this.diffWithOptionsObj(c,d,o,i)}diffWithOptionsObj(t,n,o,i){var a;const s=m=>{if(m=this.postProcess(m,o),i){setTimeout(function(){i(m)},0);return}else return m},c=n.length,d=t.length;let u=1,f=c+d;o.maxEditLength!=null&&(f=Math.min(f,o.maxEditLength));const p=(a=o.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,o);if(g[0].oldPos+1>=d&&v+1>=c)return s(this.buildValues(g[0].lastComponent,n,t));let b=-1/0,y=1/0;const w=()=>{for(let m=Math.max(b,-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 $=!1;if(S){const Y=S.oldPos-m;$=S&&0<=Y&&Y<c}const Z=O&&O.oldPos+1<d;if(!$&&!Z){g[m]=void 0;continue}if(!Z||$&&O.oldPos<S.oldPos?T=this.addToPath(S,!0,!1,0,o):T=this.addToPath(O,!1,!0,1,o),v=this.extractCommon(T,n,t,m,o),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&&(b=Math.max(b,m+1))}u++};if(i)(function m(){setTimeout(function(){if(u>f||Date.now()>x)return i(void 0);w()||m()},0)})();else for(;u<=f&&Date.now()<=x;){const m=w();if(m)return m}}addToPath(t,n,o,i,a){const s=t.lastComponent;return s&&!a.oneChangePerToken&&s.added===n&&s.removed===o?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:o,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:o,previousComponent:s}}}extractCommon(t,n,o,i,a){const s=n.length,c=o.length;let d=t.oldPos,u=d-i,f=0;for(;u+1<s&&d+1<c&&this.equals(o[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,o){return o.comparator?o.comparator(t,n):t===n||!!o.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let o=0;o<t.length;o++)t[o]&&n.push(t[o]);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,o){const i=[];let a;for(;t;)i.push(t),a=t.previousComponent,delete t.previousComponent,t=a;i.reverse();const s=i.length;let c=0,d=0,u=0;for(;c<s;c++){const f=i[c];if(f.removed)f.value=this.join(o.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=o[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 i}}class xn extends hn{constructor(){super(...arguments),this.tokenize=vn}equals(t,n,o){return o.ignoreWhitespace?((!o.newlineIsToken||!t.includes(`
79
+ `,sn=new Set(["collection","workflow","step","operation","workflow-run"]);function ue(e){return`replay://step?${new URLSearchParams({collectionId:e.collectionId.trim(),workflowId:e.workflowId.trim(),stepId:e.stepId.trim()}).toString()}`}function M(e,t){const n=e.get(t);if(n==null)return null;const o=n.trim();return o.length>0?o:null}function ln(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="replay:")return null;const n=t.hostname.toLowerCase();if(!sn.has(n))return null;const o=t.searchParams;switch(n){case"collection":{const i=M(o,"collectionId");return i?{kind:"collection",collectionId:i}:null}case"workflow":{const i=M(o,"collectionId"),a=M(o,"workflowId");return!i||!a?null:{kind:"workflow",collectionId:i,workflowId:a}}case"step":{const i=M(o,"collectionId"),a=M(o,"workflowId"),s=M(o,"stepId");return!i||!a||!s?null:{kind:"step",collectionId:i,workflowId:a,stepId:s}}case"operation":{const i=M(o,"operationId");return i?{kind:"operation",operationId:i}:null}case"workflow-run":{const i=M(o,"collectionId"),a=M(o,"workflowId");if(!i||!a)return null;const s=M(o,"historyId"),c=s==="null"||s==="undefined"?null:s;return{kind:"workflow-run",collectionId:i,workflowId:a,...c?{historyId:c}:{}}}default:return null}}function cn(e,t,n={}){switch(t.kind){case"collection":e.openCollectionTab({collectionId:t.collectionId,activeTabName:we.COLLECTION_SETTINGS});break;case"workflow":e.openWorkflowTab({collectionId:t.collectionId,workflowId:t.workflowId,activeTabName:we.WORKFLOW_SETTINGS});break;case"step":e.openStepTabFromCollection({collectionId:t.collectionId,workflowId:t.workflowId,stepId:t.stepId,state:ye.Normal});break;case"workflow-run":{const o=n.workflowRunHistoryIds?.[Lt(t.collectionId,t.workflowId)]??[],i=t.historyId&&o.includes(t.historyId)?t.historyId:o.at(-1)??t.historyId;if(i){e.openWorkflowRunTabFromHistory(i,{state:ye.Normal});break}e.focusWorkflowRunTab({collectionId:t.collectionId,workflowId:t.workflowId})||e.openWorkflowRunTab({collectionId:t.collectionId,workflowId:t.workflowId});break}case"operation":{const o=$t(e.apis,t.operationId);if(!o.ok){console.warn("[executeReplayChatLink] Operation not resolved",{operationId:t.operationId,message:o.message});return}Rt(Et(o.value),e);break}}}function dn(e,t,n={}){const o=ln(t);o&&cn(e,o,n)}function _e({workflowRunHistoryIds:e}={}){const t=mt(),{getApiOperation:n}=vt(),{focusOperationTab:o,addNewTab:i,openCollectionTab:a,openWorkflowTab:s,openStepTabFromCollection:c,openWorkflowRunTab:u,openWorkflowRunTabFromHistory:d,focusWorkflowRunTab:p}=yt();return f.useCallback(h=>{const x=h.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:")&&(h.preventDefault(),h.stopPropagation(),dn({apis:t,getApiOperation:n,focusOperationTab:o,addNewTab:i,openCollectionTab:a,openWorkflowTab:s,openStepTabFromCollection:c,openWorkflowRunTab:u,openWorkflowRunTabFromHistory:d,focusWorkflowRunTab:p},v,{workflowRunHistoryIds:e}))},[e,t,n,o,i,a,s,c,u,d,p])}const un=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"})}),pn=l(un).attrs({"data-component-name":"icons/SubtractIcon/SubtractIcon"})`
80
+ path {
81
+ fill: ${({color:e})=>q(e)};
82
+ }
83
+
84
+ height: ${({size:e})=>e||"16px"};
85
+ width: ${({size:e})=>e||"16px"};
86
+ `;class fn{diff(t,n,o={}){let i;typeof o=="function"?(i=o,o={}):"callback"in o&&(i=o.callback);const a=this.castInput(t,o),s=this.castInput(n,o),c=this.removeEmpty(this.tokenize(a,o)),u=this.removeEmpty(this.tokenize(s,o));return this.diffWithOptionsObj(c,u,o,i)}diffWithOptionsObj(t,n,o,i){var a;const s=m=>{if(m=this.postProcess(m,o),i){setTimeout(function(){i(m)},0);return}else return m},c=n.length,u=t.length;let d=1,p=c+u;o.maxEditLength!=null&&(p=Math.min(p,o.maxEditLength));const h=(a=o.timeout)!==null&&a!==void 0?a:1/0,x=Date.now()+h,g=[{oldPos:-1,lastComponent:void 0}];let v=this.extractCommon(g[0],n,t,0,o);if(g[0].oldPos+1>=u&&v+1>=c)return s(this.buildValues(g[0].lastComponent,n,t));let b=-1/0,y=1/0;const w=()=>{for(let m=Math.max(b,-d);m<=Math.min(y,d);m+=2){let T;const O=g[m-1],S=g[m+1];O&&(g[m-1]=void 0);let F=!1;if(S){const Y=S.oldPos-m;F=S&&0<=Y&&Y<c}const Z=O&&O.oldPos+1<u;if(!F&&!Z){g[m]=void 0;continue}if(!Z||F&&O.oldPos<S.oldPos?T=this.addToPath(S,!0,!1,0,o):T=this.addToPath(O,!1,!0,1,o),v=this.extractCommon(T,n,t,m,o),T.oldPos+1>=u&&v+1>=c)return s(this.buildValues(T.lastComponent,n,t))||!0;g[m]=T,T.oldPos+1>=u&&(y=Math.min(y,m-1)),v+1>=c&&(b=Math.max(b,m+1))}d++};if(i)(function m(){setTimeout(function(){if(d>p||Date.now()>x)return i(void 0);w()||m()},0)})();else for(;d<=p&&Date.now()<=x;){const m=w();if(m)return m}}addToPath(t,n,o,i,a){const s=t.lastComponent;return s&&!a.oneChangePerToken&&s.added===n&&s.removed===o?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:o,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:o,previousComponent:s}}}extractCommon(t,n,o,i,a){const s=n.length,c=o.length;let u=t.oldPos,d=u-i,p=0;for(;d+1<s&&u+1<c&&this.equals(o[u+1],n[d+1],a);)d++,u++,p++,a.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return p&&!a.oneChangePerToken&&(t.lastComponent={count:p,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=u,d}equals(t,n,o){return o.comparator?o.comparator(t,n):t===n||!!o.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let o=0;o<t.length;o++)t[o]&&n.push(t[o]);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,o){const i=[];let a;for(;t;)i.push(t),a=t.previousComponent,delete t.previousComponent,t=a;i.reverse();const s=i.length;let c=0,u=0,d=0;for(;c<s;c++){const p=i[c];if(p.removed)p.value=this.join(o.slice(d,d+p.count)),d+=p.count;else{if(!p.added&&this.useLongestToken){let h=n.slice(u,u+p.count);h=h.map(function(x,g){const v=o[d+g];return v.length>x.length?v:x}),p.value=this.join(h)}else p.value=this.join(n.slice(u,u+p.count));u+=p.count,p.added||(d+=p.count)}}return i}}class hn extends fn{constructor(){super(...arguments),this.tokenize=mn}equals(t,n,o){return o.ignoreWhitespace?((!o.newlineIsToken||!t.includes(`
87
87
  `))&&(t=t.trim()),(!o.newlineIsToken||!n.includes(`
88
88
  `))&&(n=n.trim())):o.ignoreNewlineAtEof&&!o.newlineIsToken&&(t.endsWith(`
89
89
  `)&&(t=t.slice(0,-1)),n.endsWith(`
90
- `)&&(n=n.slice(0,-1))),super.equals(t,n,o)}}const gn=new xn;function mn(e,t,n){return gn.diff(e,t,n)}function vn(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
91
- `));const n=[],o=e.split(/(\n|\r\n)/);o[o.length-1]||o.pop();for(let i=0;i<o.length;i++){const a=o[i];i%2&&!t.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n}const yn=500;function wn(e,t){const n=jn(e,t);if(n.length===0)return[];const o=[];let i=0;for(;i<n.length;){let a=i;const s=n[i].type==="context";for(;a<n.length&&n[a].type==="context"===s;)a++;const c=n.slice(i,a);o.push({start:i,end:a,rows:c,hasAdditions:c.some(d=>d.type==="add"),hasRemovals:c.some(d=>d.type==="remove")}),i=a}return o}function jn(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=bn(e,t);return n?n.flatMap(o=>D(o.value,o.added?"add":o.removed?"remove":"context")):[...D(e,"remove"),...D(t,"add")]}function bn(e,t){try{return mn(e,t,{timeout:yn})}catch{return}}function D(e,t){const n=e.split(`
92
- `);return n.length>1&&n[n.length-1]===""&&n.pop(),n.map(o=>({type:t,text:o}))}const Ae=1,Oe=e=>e&&e.hasAdditions!==e.hasRemovals,Be=e=>e&&(e.hasAdditions||e.hasRemovals);function Cn(e,t,n){if(e.hasAdditions||e.hasRemovals)return X(e.rows);const o=n[t-1],i=n[t+1],a=Oe(o)?Ae:0,s=Oe(i)?Ae: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)),Be(o)&&Be(i)&&u.push({kind:"separator"}),u.push(...X(d)),u}function X(e){return e.map(t=>({kind:"row",row:t}))}const kn=200;function Ve({oldValue:e,newValue:t}){const n=h.useMemo(()=>wn(e,t),[e,t]),o=h.useMemo(()=>n.flatMap(Cn),[n]);return h.useMemo(()=>n.some(i=>i.hasAdditions||i.hasRemovals),[n])?r.jsx(Tn,{$maxHeight:kn,children:o.map((i,a)=>{if(i.kind==="separator")return r.jsx(Bn,{children:r.jsx(ze,{children:"\xB7\xB7\xB7"})},a);const{row:s}=i,c=In(s.type);return r.jsxs(c,{children:[r.jsxs(On,{children:[s.type==="remove"&&r.jsx(Jt,{size:"12px"}),s.type==="add"&&r.jsx(bt,{size:"12px"})]}),r.jsx(ze,{children:s.text===""?" ":s.text})]},a)})}):null}function In(e){return e==="remove"?_n:e==="add"?Sn:An}const Tn=l.div`
90
+ `)&&(n=n.slice(0,-1))),super.equals(t,n,o)}}const xn=new hn;function gn(e,t,n){return xn.diff(e,t,n)}function mn(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
91
+ `));const n=[],o=e.split(/(\n|\r\n)/);o[o.length-1]||o.pop();for(let i=0;i<o.length;i++){const a=o[i];i%2&&!t.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n}const vn=500;function yn(e,t){const n=wn(e,t);if(n.length===0)return[];const o=[];let i=0;for(;i<n.length;){let a=i;const s=n[i].type==="context";for(;a<n.length&&n[a].type==="context"===s;)a++;const c=n.slice(i,a);o.push({start:i,end:a,rows:c,hasAdditions:c.some(u=>u.type==="add"),hasRemovals:c.some(u=>u.type==="remove")}),i=a}return o}function wn(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=jn(e,t);return n?n.flatMap(o=>D(o.value,o.added?"add":o.removed?"remove":"context")):[...D(e,"remove"),...D(t,"add")]}function jn(e,t){try{return gn(e,t,{timeout:vn})}catch{return}}function D(e,t){const n=e.split(`
92
+ `);return n.length>1&&n[n.length-1]===""&&n.pop(),n.map(o=>({type:t,text:o}))}const Se=1,Ae=e=>e&&e.hasAdditions!==e.hasRemovals,Oe=e=>e&&(e.hasAdditions||e.hasRemovals);function bn(e,t,n){if(e.hasAdditions||e.hasRemovals)return Q(e.rows);const o=n[t-1],i=n[t+1],a=Ae(o)?Se:0,s=Ae(i)?Se:0;if(a+s>=e.rows.length)return Q(e.rows);const c=e.rows.slice(0,a),u=s>0?e.rows.slice(-s):[],d=[];return d.push(...Q(c)),Oe(o)&&Oe(i)&&d.push({kind:"separator"}),d.push(...Q(u)),d}function Q(e){return e.map(t=>({kind:"row",row:t}))}const Cn=200;function Be({oldValue:e,newValue:t}){const n=f.useMemo(()=>yn(e,t),[e,t]),o=f.useMemo(()=>n.flatMap(bn),[n]);return f.useMemo(()=>n.some(i=>i.hasAdditions||i.hasRemovals),[n])?r.jsx(In,{$maxHeight:Cn,children:o.map((i,a)=>{if(i.kind==="separator")return r.jsx(On,{children:r.jsx(Ve,{children:"\xB7\xB7\xB7"})},a);const{row:s}=i,c=kn(s.type);return r.jsxs(c,{children:[r.jsxs(An,{children:[s.type==="remove"&&r.jsx(pn,{size:"12px"}),s.type==="add"&&r.jsx(wt,{size:"12px"})]}),r.jsx(Ve,{children:s.text===""?" ":s.text})]},a)})}):null}function kn(e){return e==="remove"?Tn:e==="add"?_n:Sn}const In=l.div`
93
93
  display: flex;
94
94
  flex-direction: column;
95
95
  width: 100%;
@@ -100,29 +100,29 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
100
100
  &::-webkit-scrollbar-track {
101
101
  margin: var(--spacing-xxs) 0;
102
102
  }
103
- `,ee=l.div`
103
+ `,X=l.div`
104
104
  display: flex;
105
105
  font-size: var(--font-size-sm);
106
106
  line-height: var(--line-height-sm);
107
107
  font-weight: var(--font-weight-regular);
108
108
  padding-right: var(--spacing-xxs);
109
- `,_n=l(ee)`
109
+ `,Tn=l(X)`
110
110
  background: var(--admonition-danger-bg-color);
111
111
  color: var(--color-raspberry-7);
112
- `,Sn=l(ee)`
112
+ `,_n=l(X)`
113
113
  background: var(--admonition-success-bg-color);
114
114
  color: var(--color-green-7);
115
- `,An=l(ee)`
115
+ `,Sn=l(X)`
116
116
  background: transparent;
117
117
  color: var(--text-color-secondary);
118
- `,On=l.span`
118
+ `,An=l.span`
119
119
  display: flex;
120
120
  align-items: center;
121
121
  justify-content: center;
122
122
  min-width: 16px;
123
123
  height: 20px;
124
124
  flex-shrink: 0;
125
- `,ze=l.span`
125
+ `,Ve=l.span`
126
126
  width: 100%;
127
127
  min-width: 0;
128
128
  line-height: var(--line-height-sm);
@@ -130,9 +130,9 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
130
130
  font-weight: var(--font-weight-regular);
131
131
  white-space: pre-wrap;
132
132
  word-break: break-all;
133
- `,Bn=l(ee)`
133
+ `,On=l(X)`
134
134
  user-select: none;
135
- `,Vn=e=>typeof e!="object"||e===null?!1:"kind"in e&&e.kind==="batch"?"changes"in e?Array.isArray(e.changes)&&e.changes.every(Me):!1:Me(e);function Me(e){return typeof e!="object"||e===null||!("id"in e)||!("target"in e)||!("included"in e)||!("kind"in e)?!1:e.kind==="single"}const zn={approveLabel:"Approve",denyLabel:"Deny"};function Mn(e,t){const n=j(t,"action");if(n){const i=Nt[n];if(i)return i}return Dt[e]||zn}function j(e,t){if(!e||typeof e!="object")return null;const n=e.payload;if(!n||typeof n!="object")return null;const o=n[t];return typeof o!="string"?null:o.trim()||null}function te(e,t){if(!(typeof t>"u"))return e?`${e}: ${t}`:t}function $n(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 Fn(e,t){if(!e||typeof e!="object")return;const n=ne(e,se),o=ne(n,le);if(!(t in o))return;const i=o[t];if(Array.isArray(i)&&i.length!==0&&i.every(Vn))return i}function $e(e,t){return Pt(e)&&Ie(e)&&e.toolCallId===t}function Rn(e,t,n){const o=e.parts.map(c=>$e(c,t)?{...c,input:En(c.input,n)}:c),i=e.metadata&&typeof e.metadata=="object"?e.metadata:{},a=ne(i,se),s={...ne(a,le),[t]:Ct(n)};return{...e,parts:o,metadata:{...i,[se]:{...a,[le]:s}}}}function ne(e,t){const n=e[t];return typeof n=="object"&&n!==null?n:{}}function En(e,t){if(!e||!("changes"in e)||!Array.isArray(e.changes))return e;const{changes:n,...o}=e;return{...o,changes:n.map((i,a)=>({...i,approved:t[a]?.included??!1}))}}function Ln({preview:e,isIncluded:t,onToggle:n,readOnly:o}){const{primaryLabel:i,categoryLabel:a,diffLineKey:s}=Nn(e.target);return r.jsx(Dn,{isIncluded:t,onToggle:n,readOnly:o,primaryLabel:i,categoryLabel:a,children:e.kind==="batch"?r.jsx(Qn,{children:e.changes.map(c=>r.jsx(Ve,{oldValue:te(c.target.key,c.oldValue),newValue:te(c.target.key,c.newValue)},c.id))}):r.jsx(Ve,{oldValue:te(s,e.oldValue),newValue:te(s,e.newValue)})})}function Nn(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 Dn({isIncluded:e,onToggle:t,readOnly:n,primaryLabel:o,categoryLabel:i,children:a}){return r.jsxs(Pn,{$dimmed:n&&!e,children:[r.jsxs(Un,{children:[n?r.jsx(Yn,{children:e?r.jsx(qn,{size:"16px"}):r.jsx(Jn,{size:"16px"})}):r.jsxs(Wn,{children:[r.jsx(Kn,{checked:e}),r.jsx(Zn,{type:"checkbox",checked:e,onChange:t})]}),r.jsx(Hn,{children:o}),i?r.jsx(Gn,{children:i}):null]}),a]})}const Pn=l.div`
135
+ `,Bn=e=>typeof e!="object"||e===null?!1:"kind"in e&&e.kind==="batch"?"changes"in e?Array.isArray(e.changes)&&e.changes.every(Me):!1:Me(e);function Me(e){return typeof e!="object"||e===null||!("id"in e)||!("target"in e)||!("included"in e)||!("kind"in e)?!1:e.kind==="single"}const Vn={approveLabel:"Approve",denyLabel:"Deny"};function Mn(e,t){const n=j(t,"action");if(n){const i=Nt[n];if(i)return i}return Dt[e]||Vn}function j(e,t){if(!e||typeof e!="object")return null;const n=e.payload;if(!n||typeof n!="object")return null;const o=n[t];return typeof o!="string"?null:o.trim()||null}function ee(e,t){if(!(typeof t>"u"))return e?`${e}: ${t}`:t}function zn(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 Fn(e,t){if(!e||typeof e!="object")return;const n=te(e,ie),o=te(n,ae);if(!(t in o))return;const i=o[t];if(Array.isArray(i)&&i.length!==0&&i.every(Bn))return i}function ze(e,t){return Pt(e)&&ke(e)&&e.toolCallId===t}function $n(e,t,n){const o=e.parts.map(c=>ze(c,t)?{...c,input:Rn(c.input,n)}:c),i=e.metadata&&typeof e.metadata=="object"?e.metadata:{},a=te(i,ie),s={...te(a,ae),[t]:jt(n)};return{...e,parts:o,metadata:{...i,[ie]:{...a,[ae]:s}}}}function te(e,t){const n=e[t];return typeof n=="object"&&n!==null?n:{}}function Rn(e,t){if(!e||!("changes"in e)||!Array.isArray(e.changes))return e;const{changes:n,...o}=e;return{...o,changes:n.map((i,a)=>({...i,approved:t[a]?.included??!1}))}}function En({preview:e,isIncluded:t,onToggle:n,readOnly:o}){const{primaryLabel:i,categoryLabel:a,diffLineKey:s}=Ln(e.target);return r.jsx(Nn,{isIncluded:t,onToggle:n,readOnly:o,primaryLabel:i,categoryLabel:a,children:e.kind==="batch"?r.jsx(Jn,{children:e.changes.map(c=>r.jsx(Be,{oldValue:ee(c.target.key,c.oldValue),newValue:ee(c.target.key,c.newValue)},c.id))}):r.jsx(Be,{oldValue:ee(s,e.oldValue),newValue:ee(s,e.newValue)})})}function Ln(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 Nn({isIncluded:e,onToggle:t,readOnly:n,primaryLabel:o,categoryLabel:i,children:a}){return r.jsxs(Dn,{$dimmed:n&&!e,children:[r.jsxs(Pn,{children:[n?r.jsx(Zn,{children:e?r.jsx(Yn,{size:"16px"}):r.jsx(qn,{size:"16px"})}):r.jsxs(Kn,{children:[r.jsx(Gn,{checked:e}),r.jsx(Wn,{type:"checkbox",checked:e,onChange:t})]}),r.jsx(Un,{children:o}),i?r.jsx(Hn,{children:i}):null]}),a]})}const Dn=l.div`
136
136
  display: flex;
137
137
  flex-direction: column;
138
138
  gap: var(--spacing-xs);
@@ -144,12 +144,12 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
144
144
  &:last-child {
145
145
  border-bottom: none;
146
146
  }
147
- `,Un=l.div`
147
+ `,Pn=l.div`
148
148
  display: flex;
149
149
  align-items: center;
150
150
  gap: var(--spacing-xs);
151
151
  min-width: 0;
152
- `,Hn=l.span`
152
+ `,Un=l.span`
153
153
  flex: 1;
154
154
  min-width: 0;
155
155
  color: var(--text-color-primary);
@@ -159,24 +159,24 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
159
159
  overflow: hidden;
160
160
  text-overflow: ellipsis;
161
161
  white-space: nowrap;
162
- `,Gn=l.span`
162
+ `,Hn=l.span`
163
163
  flex-shrink: 0;
164
164
  font-family: var(--code-block-font-family, var(--font-family-monospace, monospace));
165
165
  font-size: var(--font-size-sm);
166
166
  font-weight: var(--font-weight-regular);
167
167
  line-height: var(--line-height-sm);
168
168
  color: var(--text-color-secondary);
169
- `,Kn=l(It).attrs({"aria-hidden":!0})`
169
+ `,Gn=l(Ct).attrs({"aria-hidden":!0})`
170
170
  --checkbox-border-color: var(--color-blueberry-6);
171
171
  --checkbox-box-color: var(--color-blueberry-6);
172
172
  --checkbox-box-color-active: var(--color-blueberry-6);
173
- `,Wn=l.span`
173
+ `,Kn=l.span`
174
174
  position: relative;
175
175
  display: inline-flex;
176
176
  flex-shrink: 0;
177
177
  width: 16px;
178
178
  height: 16px;
179
- `,Zn=l.input`
179
+ `,Wn=l.input`
180
180
  position: absolute;
181
181
  inset: 0;
182
182
  width: 16px;
@@ -184,26 +184,26 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
184
184
  margin: 0;
185
185
  opacity: 0;
186
186
  cursor: pointer;
187
- `,Yn=l.span`
187
+ `,Zn=l.span`
188
188
  display: inline-flex;
189
189
  flex-shrink: 0;
190
190
  width: 16px;
191
191
  height: 16px;
192
192
  align-items: center;
193
193
  justify-content: center;
194
- `,qn=l(ct)`
194
+ `,Yn=l(lt)`
195
195
  color: var(--color-success-base);
196
- `,Jn=l(kt)`
196
+ `,qn=l(bt)`
197
197
  color: var(--text-color-description);
198
- `,Qn=l.div`
198
+ `,Jn=l.div`
199
199
  display: flex;
200
200
  flex-direction: column;
201
201
  gap: var(--spacing-xxs);
202
202
  min-width: 0;
203
- `;function Fe({previews:e,handleToggle:t,readOnly:n}){return e.length===0?null:r.jsx(Xn,{children:e.map((o,i)=>r.jsx(Ln,{preview:o,isIncluded:o.included,onToggle:t?()=>t(i):void 0,readOnly:n},o.id))})}const Xn=l.div`
203
+ `;function Fe({previews:e,handleToggle:t,readOnly:n}){return e.length===0?null:r.jsx(Qn,{children:e.map((o,i)=>r.jsx(En,{preview:o,isIncluded:o.included,onToggle:t?()=>t(i):void 0,readOnly:n},o.id))})}const Qn=l.div`
204
204
  display: flex;
205
205
  flex-direction: column;
206
- `,er={update_step:rr,update_security:or,run_request:lr,web_search:cr,manage_environment:ar,manage_collection:sr};function tr(e,t){const n=er[e];return n?n(t):nr(e)}function nr(e){return[{kind:"text",text:e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}]}function rr(e){return Re(e,"Update step")}function or(e){const t=ir(e);if(t.size>1)return I("Update security");const[n]=t;return Re(e,"Update security",n)}function ir(e){const t=e&&"changes"in e?e.changes:void 0;if(!Array.isArray(t))return new Set;const n=G(e,"stepId"),o=t.map(i=>G(i,"stepId")??n);return new Set(o.filter(i=>!!i))}function Re(e,t,n){const{collectionId:o,workflowId:i,stepId:a}=dr(e),s=n??a;return!o||!i||!s?I(t):he(`${t} `,fe({collectionId:o,workflowId:i,stepId:s}),s)}function I(e){return[{kind:"text",text:e}]}function A(e,t){return t?`${e} "${t}"`:e}function he(e,t,n){return[{kind:"text",text:e},{kind:"link",href:t,label:n}]}function ar(e){const t=j(e,"action"),n=j(e,"environment"),o=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",j(e,"name"))+o);case"remove_input":return I(A("Remove input",j(e,"inputName"))+o);case"upsert_server":return I(A("Set server",j(e,"apiId"))+o);case"remove_server":return I(A("Remove server",j(e,"apiId"))+o);default:return I("Manage environment")}}function sr(e){switch(j(e,"action")){case"create_collection":return I(A("Create collection",j(e,"title")));case"delete_collection":return I(A("Delete collection",j(e,"collectionId")));case"create_workflow":return I(A("Create workflow",j(e,"name")));case"delete_workflow":return I(A("Delete workflow",j(e,"workflowId")));case"create_step":return I(A("Create step",j(e,"stepName")));case"delete_step":{const t=j(e,"collectionId"),n=j(e,"workflowId"),o=j(e,"stepId");return!t||!n||!o?I("Delete step"):he("Delete step ",fe({collectionId:t,workflowId:n,stepId:o}),o)}case"move_step":{const t=j(e,"collectionId"),n=j(e,"workflowId"),o=j(e,"stepId");return!t||!n||!o?I("Move step"):he("Move step ",fe({collectionId:t,workflowId:n,stepId:o}),o)}case"save_tab_to_collection":return I(A("Save tab as step",j(e,"newStepName")));default:return I("Manage collection")}}function lr(){return[{kind:"text",text:"Run current request"}]}function cr(e){return[{kind:"text",text:"Search the web at "},{kind:"link",href:e.url,label:e.url}]}function dr(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 Ee({toolName:e,input:t}){const n=tr(e,t),o=Se();return r.jsx(ur,{onClick:o,children:r.jsx(pr,{children:n.map((i,a)=>i.kind==="text"?r.jsx("span",{children:i.text},a):r.jsx(fr,{href:i.href,children:i.label},a))})})}const ur=l.div`
206
+ `,Xn={update_step:nr,update_security:rr,run_request:sr,web_search:lr,manage_environment:ir,manage_collection:ar};function er(e,t){const n=Xn[e];return n?n(t):tr(e)}function tr(e){return[{kind:"text",text:e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}]}function nr(e){return $e(e,"Update step")}function rr(e){const t=or(e);if(t.size>1)return I("Update security");const[n]=t;return $e(e,"Update security",n)}function or(e){const t=e&&"changes"in e?e.changes:void 0;if(!Array.isArray(t))return new Set;const n=G(e,"stepId"),o=t.map(i=>G(i,"stepId")??n);return new Set(o.filter(i=>!!i))}function $e(e,t,n){const{collectionId:o,workflowId:i,stepId:a}=cr(e),s=n??a;return!o||!i||!s?I(t):pe(`${t} `,ue({collectionId:o,workflowId:i,stepId:s}),s)}function I(e){return[{kind:"text",text:e}]}function A(e,t){return t?`${e} "${t}"`:e}function pe(e,t,n){return[{kind:"text",text:e},{kind:"link",href:t,label:n}]}function ir(e){const t=j(e,"action"),n=j(e,"environment"),o=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",j(e,"name"))+o);case"remove_input":return I(A("Remove input",j(e,"inputName"))+o);case"upsert_server":return I(A("Set server",j(e,"apiId"))+o);case"remove_server":return I(A("Remove server",j(e,"apiId"))+o);default:return I("Manage environment")}}function ar(e){switch(j(e,"action")){case"create_collection":return I(A("Create collection",j(e,"title")));case"delete_collection":return I(A("Delete collection",j(e,"collectionId")));case"create_workflow":return I(A("Create workflow",j(e,"name")));case"delete_workflow":return I(A("Delete workflow",j(e,"workflowId")));case"create_step":return I(A("Create step",j(e,"stepName")));case"delete_step":{const t=j(e,"collectionId"),n=j(e,"workflowId"),o=j(e,"stepId");return!t||!n||!o?I("Delete step"):pe("Delete step ",ue({collectionId:t,workflowId:n,stepId:o}),o)}case"move_step":{const t=j(e,"collectionId"),n=j(e,"workflowId"),o=j(e,"stepId");return!t||!n||!o?I("Move step"):pe("Move step ",ue({collectionId:t,workflowId:n,stepId:o}),o)}case"save_tab_to_collection":return I(A("Save tab as step",j(e,"newStepName")));default:return I("Manage collection")}}function sr(){return[{kind:"text",text:"Run current request"}]}function lr(e){return[{kind:"text",text:"Search the web at "},{kind:"link",href:e.url,label:e.url}]}function cr(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=er(e,t),o=_e();return r.jsx(dr,{onClick:o,children:r.jsx(ur,{children:n.map((i,a)=>i.kind==="text"?r.jsx("span",{children:i.text},a):r.jsx(pr,{href:i.href,children:i.label},a))})})}const dr=l.div`
207
207
  display: flex;
208
208
  flex-direction: column;
209
209
  gap: 0;
@@ -213,13 +213,13 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
213
213
  &:not(:last-child) {
214
214
  border-bottom: 1px solid var(--border-color-secondary);
215
215
  }
216
- `,pr=l.span`
216
+ `,ur=l.span`
217
217
  font-family: var(--font-family-base);
218
218
  font-size: var(--font-size-sm);
219
219
  font-weight: var(--font-weight-regular);
220
220
  line-height: var(--line-height-sm);
221
221
  color: var(--text-color-primary);
222
- `,fr=l.a`
222
+ `,pr=l.a`
223
223
  color: var(--link-color-primary);
224
224
  cursor: pointer;
225
225
  text-decoration: none;
@@ -227,7 +227,7 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
227
227
  &:hover {
228
228
  color: var(--link-color-primary, var(--text-color-link));
229
229
  }
230
- `;function Le(e,t,n){const o={type:e};return t!==void 0&&(o.key=t),n&&(o.stepId=n),o}function C({id:e,targetType:t,targetKey:n,targetStepId:o,oldValue:i,newValue:a}){return{kind:"single",id:e,target:Le(t,n,o),oldValue:i,newValue:a,included:!0}}function R(e,t,n){return C({id:e,targetType:t,targetStepId:n,oldValue:void 0,newValue:void 0})}function P({data:e,baseId:t,targetType:n,batchTargetKey:o,targetStepId:i,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 R(t,n,i);if(d.length>=2){const p=d.map(([x,g])=>C({id:`${t}:${x}`,targetType:n,targetKey:c(x),oldValue:a(x),newValue:s(x,g)}));return{kind:"batch",id:t,target:Le(n,o,i),changes:p,included:!0}}const[u,f]=d[0];return C({id:t,targetType:n,targetKey:c(u),targetStepId:i,oldValue:a(u),newValue:s(u,f)})}function hr({store:e,input:t}){if(!xr(t))return[];const n=new Map,o=i=>{const a=n.get(i);if(a)return a;const s=Te(e,t.collectionId,t.workflowId,i),c=s.ok?s.value:null,d=c?Array.from(c.security.get({noproxy:!0})):[];return n.set(i,d),d};return t.changes.map((i,a)=>{const s=i.stepId?.trim(),c=s||t.stepId;return gr(o(c),i,a,s)})}function xr(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 gr(e,t,n,o){const i=`security[${n}]`;switch(t.action){case k.ADD:{const{type:a,schemeId:s,data:c}=t;return!c||Object.keys(c).length===0?K(C({id:i,targetType:a,targetStepId:o,oldValue:void 0,newValue:a}),s):K(P({data:c,baseId:i,targetType:a,targetStepId:o,getOldValue:()=>{}}),s)}case k.UPDATE:{const{type:a,data:s}=t,c=t.index!==void 0?e[t.index]:void 0,d=t.schemeId||xe(c);return!s||Object.keys(s).length===0?K(C({id:i,targetType:a,targetStepId:o,oldValue:De(c),newValue:a}),d):K(P({data:s,baseId:i,targetType:a,targetStepId:o,getOldValue:u=>c?mr(c,u):void 0}),d)}case k.REMOVE:{const a=Ut(e,t),s=a.ok?a.entry:void 0;return K(C({id:i,targetType:s?.securityType??"Security",targetStepId:o,oldValue:De(s),newValue:void 0}),xe(s))}}}function K(e,t){return t?{...e,target:{...e.target,schemeId:t}}:e}function mr(e,t){switch(e.securityType){case F.NoAuth:return;case F.OAuth2:return Ne(e[F.OAuth2],t);case F.OpenIDConnect:{const n=e[F.OpenIDConnect];return t==="openIdConnectUrl"?n.openIdConnectUrl||void 0:t==="userInfoUrl"?n.userInfoUrl||void 0:Ne(n,t)}case F.APIKey:{const n=e[F.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===F.NoAuth)return;const t=xe(e);return t?`${e.securityType} (${t})`:e.securityType}function xe(e){return!e||e.securityType===F.NoAuth?void 0:e[e.securityType]?.schemeName||void 0}function vr({store:e,input:t}){if(!yr(t))return[];const n=Te(e,t.collectionId,t.workflowId,t.stepId),o=n.ok?n.value:null;return t.changes.map((i,a)=>wr(o,i,a))}function yr(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 wr(e,t,n){const o=t.id??`${t.field}[${n}]`;switch(t.field){case"method":case"url":case"description":return jr(e,t,o);case"parameters":return br(e,t,o);case"outputs":return Cr(e,t,o);case"body":return kr(e,t,o);case"successCriteria":return Ir(e,t,o)}}function jr(e,t,n){const o=Q(t.field);switch(t.action){case k.ADD:return C({id:n,targetType:o,oldValue:void 0,newValue:t.data});case k.UPDATE:return C({id:n,targetType:o,oldValue:Pe(e,t.field),newValue:t.data});case k.REMOVE:return C({id:n,targetType:o,oldValue:Pe(e,t.field),newValue:void 0})}}function br(e,t,n){switch(t.action){case k.ADD:{if(!t.data)return R(n,"parameter");const{in:o,name:i,value:a}=t.data;return C({id:n,targetType:Q(o),targetKey:i,oldValue:void 0,newValue:a})}case k.UPDATE:{if(!t.id&&!t.data?.name)return R(n,"parameter");const o=Ue(e,t),i=t.data?.in??o?.in??"parameter";return C({id:n,targetType:Q(i),targetKey:t.data?.name??o?.key,oldValue:o?o.value??"":void 0,newValue:t.data?.value})}case k.REMOVE:{if(!t.id&&!t.data?.name)return R(n,"parameter");const o=Ue(e,t),i=t.data?.in??o?.in??"parameter";return C({id:n,targetType:Q(i),targetKey:o?.key??t.data?.name,oldValue:o?o.value??"":void 0,newValue:void 0})}}}function Cr(e,t,n){switch(t.action){case k.ADD:return t.data?C({id:n,targetType:"Output",targetKey:t.data.name,oldValue:void 0,newValue:t.data.expression}):C({id:n,targetType:"Output",oldValue:void 0,newValue:void 0});case k.UPDATE:{if(!t.data)return C({id:n,targetType:"Output",oldValue:void 0,newValue:void 0});const o=t.id&&e?We(e,t.id):void 0;return C({id:n,targetType:"Output",targetKey:t.data.name,oldValue:o?.value,newValue:t.data.expression})}case k.REMOVE:{if(!t.id&&!t.data?.name)return R(n,"Output");let o=t.id&&e?We(e,t.id):void 0;return!o&&e&&t.data?.name&&(o=Sr(e,t.data.name)),C({id:n,targetType:"Output",targetKey:o?.key??t.data?.name,oldValue:o?.value,newValue:void 0})}}}function kr(e,t,n){const{data:o}=t;switch(t.action){case k.ADD:return P({data:o,baseId:n,targetType:"Body",getOldValue:()=>{},getNewValue:i=>i==="content"?ge(o.content,o.contentType):ie(o[i]),resolveTargetKey:i=>i==="content"?void 0:i});case k.UPDATE:{const i=e?.requestBody.type.get(),a=o.contentType??i;return P({data:o,baseId:n,targetType:"Body",getOldValue:s=>{if(e){if(s==="content")return ge(e.requestBody.content.get(),i)||void 0;if(s==="contentType")return i}},getNewValue:s=>s==="content"?ge(o.content,a):ie(o[s]),resolveTargetKey:s=>s==="content"?void 0:s})}case k.REMOVE:{const i=e?ce({contentType:e.requestBody.type.get(),content:e.requestBody.content.get()}):void 0;return C({id:n,targetType:"Body",oldValue:i,newValue:void 0})}}}function Ir(e,t,n){switch(t.action){case k.ADD:return t.data?P({data:t.data,baseId:n,targetType:"successCriteria",getOldValue:()=>{},getNewValue:o=>ie(t.data[o])}):R(n,"successCriteria");case k.UPDATE:{if(!t.data)return R(n,"successCriteria");const o=typeof t.id=="string"&&e?Ge(e,t.id):void 0;return P({data:t.data,baseId:n,targetType:"successCriteria",getOldValue:i=>{if(o){if(i==="condition")return o.condition;if(i==="context")return o.context??void 0;if(i==="type")return o.type}},getNewValue:i=>ie(t.data[i])})}case k.REMOVE:{if(typeof t.id!="string")return R(n,"successCriteria");const o=e?Ge(e,t.id):void 0;return C({id:n,targetType:"successCriteria",targetKey:o?.condition,oldValue:o?ce(o):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?Tr(e,t.id):null;return!n&&e&&t.data?.name&&(n=_r(e,t.data.name)),n}function He(e,t){for(const n of["path","query","header","cookie"]){const o=e.parameters[Ht[n]].get().find(i=>Tt(i)&&t(i));if(o)return o}return null}function Tr(e,t){return He(e,n=>n.id===t)}function _r(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:oe(n.key),value:oe(n.value)}}function We(e,t){return Ke(e,n=>oe(n.id)===t)}function Sr(e,t){return Ke(e,n=>oe(n.key)===t)}function oe(e){return typeof e=="string"?e:e.get()}function ie(e){return e==null?"":typeof e=="string"?e:ce(e)}function ge(e,t){if(!e||t!==_t.JSON)return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const Ar={update_security:hr,update_step:vr};function Ze(e,t){const n=je(),o=h.useMemo(()=>{const d=e?Ar[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]),[i,a]=h.useState(()=>Object.fromEntries(o.map(d=>[d.id,d.included]))),s=h.useMemo(()=>o.map(d=>({...d,included:i[d.id]??d.included})),[o,i]),c=h.useCallback(d=>{a(typeof d=="function"?u=>{const f=o.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])))},[o]);return{previews:s,setPreviews:c}}function Or({toolCallId:e,toolName:t,input:n,onApprove:o,onDeny:i}){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(()=>Mn(t,n),[t,n]),x=h.useCallback(()=>{a(v=>{const b=[];for(let y=0;y<v.length;y++){const w=v[y],{parts:m}=w,T=w.role==="assistant",O=m.some(S=>$e(S,e));if(T&&O){const S=Rn(w,e,s);b.push({index:y,message:S})}}return b}),o()},[s,o,a,e]),g=h.useCallback(v=>{c(b=>b.map((y,w)=>w===v?{...y,included:!y.included}:y))},[c]);return r.jsxs(Br,{children:[r.jsx(Ee,{toolName:t,input:n}),s.length?r.jsx(Vr,{children:r.jsx(Fe,{previews:s,handleToggle:g})}):null,s.length?r.jsx(be,{}):null,r.jsxs(zr,{children:[u>1?r.jsxs(Mr,{children:[d," of ",u," selected"]}):null,r.jsx($r,{size:"small",variant:"secondary",onClick:i,children:p}),r.jsx(Fr,{size:"small",variant:"primary",onClick:x,disabled:u>0?d===0:!1,children:f})]})]})}const Br=l.div`
230
+ `;function Ee(e,t,n){const o={type:e};return t!==void 0&&(o.key=t),n&&(o.stepId=n),o}function C({id:e,targetType:t,targetKey:n,targetStepId:o,oldValue:i,newValue:a}){return{kind:"single",id:e,target:Ee(t,n,o),oldValue:i,newValue:a,included:!0}}function R(e,t,n){return C({id:e,targetType:t,targetStepId:n,oldValue:void 0,newValue:void 0})}function P({data:e,baseId:t,targetType:n,batchTargetKey:o,targetStepId:i,getOldValue:a,getNewValue:s=(u,d)=>String(d??""),resolveTargetKey:c=u=>u}){const u=Object.entries(e).filter(([,h])=>h!==void 0);if(u.length===0)return R(t,n,i);if(u.length>=2){const h=u.map(([x,g])=>C({id:`${t}:${x}`,targetType:n,targetKey:c(x),oldValue:a(x),newValue:s(x,g)}));return{kind:"batch",id:t,target:Ee(n,o,i),changes:h,included:!0}}const[d,p]=u[0];return C({id:t,targetType:n,targetKey:c(d),targetStepId:i,oldValue:a(d),newValue:s(d,p)})}function fr({collections:e,activeTab:t,input:n}){if(!hr(n))return[];const o=new Map,i=a=>{const s=o.get(a);if(s)return s;const c=Ie(e,t,n.collectionId,n.workflowId,a),u=c.ok?Array.from(c.value.step.security):[];return o.set(a,u),u};return n.changes.map((a,s)=>{const c=a.stepId?.trim(),u=c||n.stepId;return xr(i(u),a,s,c)})}function hr(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 xr(e,t,n,o){const i=`security[${n}]`;switch(t.action){case k.ADD:{const{type:a,schemeId:s,data:c}=t;return!c||Object.keys(c).length===0?K(C({id:i,targetType:a,targetStepId:o,oldValue:void 0,newValue:a}),s):K(P({data:c,baseId:i,targetType:a,targetStepId:o,getOldValue:()=>{}}),s)}case k.UPDATE:{const{type:a,data:s}=t,c=t.index!==void 0?e[t.index]:void 0,u=t.schemeId||fe(c);return!s||Object.keys(s).length===0?K(C({id:i,targetType:a,targetStepId:o,oldValue:Ne(c),newValue:a}),u):K(P({data:s,baseId:i,targetType:a,targetStepId:o,getOldValue:d=>c?gr(c,d):void 0}),u)}case k.REMOVE:{const a=Ut(e,t),s=a.ok?a.entry:void 0;return K(C({id:i,targetType:s?.securityType??"Security",targetStepId:o,oldValue:Ne(s),newValue:void 0}),fe(s))}}}function K(e,t){return t?{...e,target:{...e.target,schemeId:t}}:e}function gr(e,t){switch(e.securityType){case $.NoAuth:return;case $.OAuth2:return Le(e[$.OAuth2],t);case $.OpenIDConnect:{const n=e[$.OpenIDConnect];return t==="openIdConnectUrl"?n.openIdConnectUrl||void 0:t==="userInfoUrl"?n.userInfoUrl||void 0:Le(n,t)}case $.APIKey:{const n=e[$.APIKey];return t==="location"?ne(n,t)?.toLowerCase():ne(n,t)}default:{const n=e[e.securityType];return ne(n,t)}}}function Le(e,t){if(t==="grantType")return e.grantType||void 0;if(!e.grantType)return;const n=e[e.grantType];return ne(n,t)}function ne(e,t){const n=e[t];return n!==void 0&&n!==""?String(n):void 0}function Ne(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 mr({collections:e,activeTab:t,input:n}){if(!vr(n))return[];const o=Ie(e,t,n.collectionId,n.workflowId,n.stepId),i=o.ok?o.value.step:null;return n.changes.map((a,s)=>yr(i,a,s))}function vr(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 yr(e,t,n){const o=t.id??`${t.field}[${n}]`;switch(t.field){case"method":case"url":case"description":return wr(e,t,o);case"parameters":return jr(e,t,o);case"outputs":return br(e,t,o);case"body":return Cr(e,t,o);case"successCriteria":return kr(e,t,o)}}function wr(e,t,n){const o=J(t.field);switch(t.action){case k.ADD:return C({id:n,targetType:o,oldValue:void 0,newValue:t.data});case k.UPDATE:return C({id:n,targetType:o,oldValue:De(e,t.field),newValue:t.data});case k.REMOVE:return C({id:n,targetType:o,oldValue:De(e,t.field),newValue:void 0})}}function jr(e,t,n){switch(t.action){case k.ADD:{if(!t.data)return R(n,"parameter");const{in:o,name:i,value:a}=t.data;return C({id:n,targetType:J(o),targetKey:i,oldValue:void 0,newValue:a})}case k.UPDATE:{if(!t.id&&!t.data?.name)return R(n,"parameter");const o=Pe(e,t),i=t.data?.in??o?.in??"parameter";return C({id:n,targetType:J(i),targetKey:t.data?.name??o?.key,oldValue:o?o.value??"":void 0,newValue:t.data?.value})}case k.REMOVE:{if(!t.id&&!t.data?.name)return R(n,"parameter");const o=Pe(e,t),i=t.data?.in??o?.in??"parameter";return C({id:n,targetType:J(i),targetKey:o?.key??t.data?.name,oldValue:o?o.value??"":void 0,newValue:void 0})}}}function br(e,t,n){switch(t.action){case k.ADD:return t.data?C({id:n,targetType:"Output",targetKey:t.data.name,oldValue:void 0,newValue:t.data.expression}):C({id:n,targetType:"Output",oldValue:void 0,newValue:void 0});case k.UPDATE:{if(!t.data)return C({id:n,targetType:"Output",oldValue:void 0,newValue:void 0});const o=t.id&&e?Ke(e,t.id):void 0;return C({id:n,targetType:"Output",targetKey:t.data.name,oldValue:o?.value,newValue:t.data.expression})}case k.REMOVE:{if(!t.id&&!t.data?.name)return R(n,"Output");let o=t.id&&e?Ke(e,t.id):void 0;return!o&&e&&t.data?.name&&(o=_r(e,t.data.name)),C({id:n,targetType:"Output",targetKey:o?.key??t.data?.name,oldValue:o?.value,newValue:void 0})}}}function Cr(e,t,n){const{data:o}=t;switch(t.action){case k.ADD:return P({data:o,baseId:n,targetType:"Body",getOldValue:()=>{},getNewValue:i=>i==="content"?he(o.content,o.contentType):re(o[i]),resolveTargetKey:i=>i==="content"?void 0:i});case k.UPDATE:{const i=e?.requestBody.type,a=o.contentType??i;return P({data:o,baseId:n,targetType:"Body",getOldValue:s=>{if(e){if(s==="content")return he(e.requestBody.content,i)||void 0;if(s==="contentType")return i}},getNewValue:s=>s==="content"?he(o.content,a):re(o[s]),resolveTargetKey:s=>s==="content"?void 0:s})}case k.REMOVE:{const i=e?se({contentType:e.requestBody.type,content:e.requestBody.content}):void 0;return C({id:n,targetType:"Body",oldValue:i,newValue:void 0})}}}function kr(e,t,n){switch(t.action){case k.ADD:return t.data?P({data:t.data,baseId:n,targetType:"successCriteria",getOldValue:()=>{},getNewValue:o=>re(t.data[o])}):R(n,"successCriteria");case k.UPDATE:{if(!t.data)return R(n,"successCriteria");const o=typeof t.id=="string"&&e?He(e,t.id):void 0;return P({data:t.data,baseId:n,targetType:"successCriteria",getOldValue:i=>{if(o){if(i==="condition")return o.condition;if(i==="context")return o.context??void 0;if(i==="type")return o.type}},getNewValue:i=>re(t.data[i])})}case k.REMOVE:{if(typeof t.id!="string")return R(n,"successCriteria");const o=e?He(e,t.id):void 0;return C({id:n,targetType:"successCriteria",targetKey:o?.condition,oldValue:o?se(o):void 0,newValue:void 0})}}}function De(e,t){if(e)switch(t){case"method":return e.xOperation?.method;case"url":return e.xOperation?.url;case"description":return e.description}}function Pe(e,t){let n=t.id&&e?Ir(e,t.id):null;return!n&&e&&t.data?.name&&(n=Tr(e,t.data.name)),n}function Ue(e,t){for(const n of["path","query","header","cookie"]){const o=e.parameters[Ht[n]].find(i=>kt(i)&&t(i));if(o)return o}return null}function Ir(e,t){return Ue(e,n=>n.id===t)}function Tr(e,t){return Ue(e,n=>n.key===t)}function He(e,t){return e.successCriteria.find(n=>n.condition===t)}function Ge(e,t){for(const n of e.outputs)if(t(n))return{key:n.key,value:n.value}}function Ke(e,t){return Ge(e,n=>n.id===t)}function _r(e,t){return Ge(e,n=>n.key===t)}function re(e){return e==null?"":typeof e=="string"?e:se(e)}function he(e,t){if(!e||t!==It.JSON)return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const Sr={update_security:fr,update_step:mr};function We(e,t){const n=me(Tt),o=me(_t),i=f.useMemo(()=>{const d=e?Sr[e]:void 0;if(!d)return[];try{return d({collections:n,activeTab:o,input:t})}catch(p){return console.error("Unable to build change previews",p),[]}},[e,n,o,t]),[a,s]=f.useState(()=>Object.fromEntries(i.map(d=>[d.id,d.included]))),c=f.useMemo(()=>i.map(d=>({...d,included:a[d.id]??d.included})),[i,a]),u=f.useCallback(d=>{s(typeof d=="function"?p=>{const h=i.map(x=>({...x,included:p[x.id]??x.included}));return Object.fromEntries(d(h).map(x=>[x.id,x.included]))}:Object.fromEntries(d.map(p=>[p.id,p.included])))},[i]);return{previews:c,setPreviews:u}}function Ar({toolCallId:e,toolName:t,input:n,onApprove:o,onDeny:i}){const{updateMessages:a}=H(),{previews:s,setPreviews:c}=We(t,n),{includedCount:u,totalCount:d}=f.useMemo(()=>({includedCount:s.filter(v=>v.included).length,totalCount:s.length}),[s]),{approveLabel:p,denyLabel:h}=f.useMemo(()=>Mn(t,n),[t,n]),x=f.useCallback(()=>{a(v=>{const b=[];for(let y=0;y<v.length;y++){const w=v[y],{parts:m}=w,T=w.role==="assistant",O=m.some(S=>ze(S,e));if(T&&O){const S=$n(w,e,s);b.push({index:y,message:S})}}return b}),o()},[s,o,a,e]),g=f.useCallback(v=>{c(b=>b.map((y,w)=>w===v?{...y,included:!y.included}:y))},[c]);return r.jsxs(Or,{children:[r.jsx(Re,{toolName:t,input:n}),s.length?r.jsx(Br,{children:r.jsx(Fe,{previews:s,handleToggle:g})}):null,s.length?r.jsx(je,{}):null,r.jsxs(Vr,{children:[d>1?r.jsxs(Mr,{children:[u," of ",d," selected"]}):null,r.jsx(zr,{size:"small",variant:"secondary",onClick:i,children:h}),r.jsx(Fr,{size:"small",variant:"primary",onClick:x,disabled:d>0?u===0:!1,children:p})]})]})}const Or=l.div`
231
231
  display: flex;
232
232
  color: var(--text-color-primary);
233
233
  flex-direction: column;
@@ -238,12 +238,12 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
238
238
  border: 1px solid var(--border-color-secondary);
239
239
  background: var(--layer-color);
240
240
  line-height: var(--line-height-sm);
241
- `,Vr=l.div`
241
+ `,Br=l.div`
242
242
  display: flex;
243
243
  flex-direction: column;
244
244
  gap: var(--spacing-xs);
245
245
  min-width: 0;
246
- `,zr=l.div`
246
+ `,Vr=l.div`
247
247
  display: flex;
248
248
  flex-wrap: wrap;
249
249
  justify-content: flex-end;
@@ -256,7 +256,7 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
256
256
  font-weight: var(--font-weight-regular);
257
257
  line-height: var(--line-height-sm);
258
258
  color: var(--text-color-secondary);
259
- `,$r=l(_)`
259
+ `,zr=l(_)`
260
260
  background: none;
261
261
  `,Fr=l(_)`
262
262
  border: 1px solid var(--button-bg-color);
@@ -265,7 +265,7 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
265
265
  &:disabled {
266
266
  border: 1px solid var(--button-border-color-disabled);
267
267
  }
268
- `;function Rr({approvalId:e,toolCallId:t,toolName:n,input:o}){const{addToolApprovalResponse:i}=H(),a=h.useCallback(()=>{i({id:e,approved:!0})},[e,i]),s=h.useCallback(()=>{i({id:e,approved:!1})},[e,i]);return r.jsx(Or,{onApprove:a,onDeny:s,toolCallId:t,toolName:n,input:o})}function Er({toolName:e,toolCallId:t,input:n,isDenied:o,messageMetadata:i,onUndo:a}){const s=h.useMemo(()=>Fn(i,t),[i,t]),{previews:c}=Ze(s?void 0:e,n),d=h.useMemo(()=>{const p=s??c;if(o)return p.map(g=>({...g,included:!1}));const x=$n(n);return p.map((g,v)=>({...g,included:x[v]??g.included}))},[s,c,n,o]);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(Lr,{children:[r.jsx(Ee,{toolName:e,input:n}),r.jsx(Nr,{children:r.jsx(Fe,{previews:d,readOnly:!0})}),r.jsx(be,{}),r.jsxs(Dr,{children:[r.jsx(Pr,{children:f}),a?r.jsx(Ur,{size:"small",variant:"outlined",onClick:a,children:"Undo"}):null]})]})}const Lr=l.div`
268
+ `;function $r({approvalId:e,toolCallId:t,toolName:n,input:o}){const{addToolApprovalResponse:i}=H(),a=f.useCallback(()=>{i({id:e,approved:!0})},[e,i]),s=f.useCallback(()=>{i({id:e,approved:!1})},[e,i]);return r.jsx(Ar,{onApprove:a,onDeny:s,toolCallId:t,toolName:n,input:o})}function Rr({toolName:e,toolCallId:t,input:n,isDenied:o,messageMetadata:i,onUndo:a}){const s=f.useMemo(()=>Fn(i,t),[i,t]),{previews:c}=We(s?void 0:e,n),u=f.useMemo(()=>{const h=s??c;if(o)return h.map(g=>({...g,included:!1}));const x=zn(n);return h.map((g,v)=>({...g,included:x[v]??g.included}))},[s,c,n,o]);if(u.length===0)return null;const d=u.filter(h=>h.included).length,p=d===0?"Nothing applied":`${d} ${d===1?"change":"changes"} applied`;return r.jsxs(Er,{children:[r.jsx(Re,{toolName:e,input:n}),r.jsx(Lr,{children:r.jsx(Fe,{previews:u,readOnly:!0})}),r.jsx(je,{}),r.jsxs(Nr,{children:[r.jsx(Dr,{children:p}),a?r.jsx(Pr,{size:"small",variant:"outlined",onClick:a,children:"Undo"}):null]})]})}const Er=l.div`
269
269
  display: flex;
270
270
  color: var(--text-color-primary);
271
271
  flex-direction: column;
@@ -275,50 +275,50 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
275
275
  border: 1px solid var(--border-color-secondary);
276
276
  background: var(--layer-color);
277
277
  line-height: var(--line-height-sm);
278
- `,Nr=l.div`
278
+ `,Lr=l.div`
279
279
  display: flex;
280
280
  flex-direction: column;
281
281
  min-width: 0;
282
- `,Dr=l.div`
282
+ `,Nr=l.div`
283
283
  display: flex;
284
284
  justify-content: space-between;
285
285
  align-items: center;
286
286
  padding: var(--spacing-xs) var(--spacing-sm);
287
287
  gap: var(--spacing-xs);
288
- `,Pr=l.span`
288
+ `,Dr=l.span`
289
289
  font-size: var(--font-size-sm);
290
290
  font-weight: var(--font-weight-regular);
291
291
  line-height: var(--line-height-sm);
292
292
  color: var(--text-color-secondary);
293
- `,Ur=l(_)`
293
+ `,Pr=l(_)`
294
294
  padding-top: 0;
295
295
  padding-bottom: 0;
296
- `;function Hr({items:e,isLast:t}){const[n,o]=h.useState(t),i=h.useCallback(()=>{o(s=>!s)},[]),a=h.useMemo(()=>e.filter(s=>s.kind==="action"),[e]);return r.jsxs(Kr,{children:[r.jsxs(Wr,{type:"button",onClick:i,"aria-expanded":n,children:[r.jsx(Zr,{children:n?r.jsx(dt,{size:"12px",color:"var(--icon-color-additional)"}):r.jsx(ut,{size:"12px",color:"var(--icon-color-additional)"})}),r.jsxs(Yr,{children:[a.length," ",a.length===1?"action":"actions"]})]}),n&&r.jsx(qr,{children:a.map((s,c)=>r.jsx(Gr,{text:s.text},c))})]})}function Gr({text:e}){return r.jsxs(Jr,{children:[r.jsxs(Qr,{children:[r.jsx(Xr,{"aria-hidden":!0}),r.jsx(eo,{children:r.jsx(to,{"aria-hidden":!0})}),r.jsx(Ye,{"aria-hidden":!0})]}),r.jsx(no,{children:e})]})}const Kr=l.div`
296
+ `;function Ur({items:e,isLast:t}){const[n,o]=f.useState(t),i=f.useCallback(()=>{o(s=>!s)},[]),a=f.useMemo(()=>e.filter(s=>s.kind==="action"),[e]);return r.jsxs(Gr,{children:[r.jsxs(Kr,{type:"button",onClick:i,"aria-expanded":n,children:[r.jsx(Wr,{children:n?r.jsx(ct,{size:"12px",color:"var(--icon-color-additional)"}):r.jsx(dt,{size:"12px",color:"var(--icon-color-additional)"})}),r.jsxs(Zr,{children:[a.length," ",a.length===1?"action":"actions"]})]}),n&&r.jsx(Yr,{children:a.map((s,c)=>r.jsx(Hr,{text:s.text},c))})]})}function Hr({text:e}){return r.jsxs(qr,{children:[r.jsxs(Jr,{children:[r.jsx(Qr,{"aria-hidden":!0}),r.jsx(Xr,{children:r.jsx(eo,{"aria-hidden":!0})}),r.jsx(Ze,{"aria-hidden":!0})]}),r.jsx(to,{children:e})]})}const Gr=l.div`
297
297
  display: flex;
298
298
  flex-direction: column;
299
299
  width: 100%;
300
300
  min-width: 0;
301
- `,Wr=l.button`
301
+ `,Kr=l.button`
302
302
  display: flex;
303
303
  align-items: center;
304
304
  cursor: pointer;
305
305
  user-select: none;
306
306
  width: fit-content;
307
307
  padding: 0;
308
- `,Zr=l.span`
308
+ `,Wr=l.span`
309
309
  display: flex;
310
310
  align-items: center;
311
311
  flex-shrink: 0;
312
- `,Yr=l.span`
312
+ `,Zr=l.span`
313
313
  font-size: var(--font-size-sm);
314
314
  font-weight: var(--font-weight-regular);
315
315
  line-height: var(--line-height-sm);
316
316
  color: var(--text-color-description);
317
- `,qr=l.div`
317
+ `,Yr=l.div`
318
318
  display: flex;
319
319
  flex-direction: column;
320
320
  gap: 0;
321
- `,Ye=l.span`
321
+ `,Ze=l.span`
322
322
  display: block;
323
323
  width: 1px;
324
324
  flex-shrink: 0;
@@ -326,7 +326,7 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
326
326
  background: var(--border-color-secondary);
327
327
  flex: 1 1 auto;
328
328
  min-height: 8px;
329
- `,Jr=l.div`
329
+ `,qr=l.div`
330
330
  display: flex;
331
331
  flex-direction: row;
332
332
  align-items: stretch;
@@ -334,11 +334,11 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
334
334
  min-width: 0;
335
335
 
336
336
  &:last-child {
337
- ${Ye} {
337
+ ${Ze} {
338
338
  display: none;
339
339
  }
340
340
  }
341
- `,Qr=l.div`
341
+ `,Jr=l.div`
342
342
  display: flex;
343
343
  flex-direction: column;
344
344
  align-items: center;
@@ -347,14 +347,14 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
347
347
  flex: 0 0 auto;
348
348
  align-self: stretch;
349
349
  min-height: 0;
350
- `,Xr=l.span`
350
+ `,Qr=l.span`
351
351
  display: block;
352
352
  width: 1px;
353
353
  height: 4px;
354
354
  flex: 0 0 auto;
355
355
  flex-shrink: 0;
356
356
  background: var(--border-color-secondary);
357
- `,eo=l.div`
357
+ `,Xr=l.div`
358
358
  width: 12px;
359
359
  height: 12px;
360
360
  flex: 0 0 auto;
@@ -362,7 +362,7 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
362
362
  display: flex;
363
363
  align-items: center;
364
364
  justify-content: center;
365
- `,to=l.span`
365
+ `,eo=l.span`
366
366
  width: 4px;
367
367
  height: 4px;
368
368
  flex-shrink: 0;
@@ -370,7 +370,7 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
370
370
  box-sizing: border-box;
371
371
  border: 1px solid var(--border-color-secondary);
372
372
  background: transparent;
373
- `,no=l.span`
373
+ `,to=l.span`
374
374
  flex: 1;
375
375
  min-width: 0;
376
376
  align-self: flex-start;
@@ -378,11 +378,11 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
378
378
  font-weight: var(--font-weight-regular);
379
379
  line-height: var(--line-height-sm);
380
380
  color: var(--text-color-helper);
381
- `;function ro({items:e,messageMetadata:t}){return r.jsx(io,{children:e.map((n,o)=>{if(n.kind==="reasoning-block"){const s=o===e.length-1;return r.jsx(Hr,{items:n.items,isLast:s},n.key)}if(n.kind==="text")return r.jsx(oo,{rawMarkdown:n.text,workflowRunHistoryIds:n.workflowRunHistoryIds},n.key);const{part:i}=n,a=Gt(i.type);return a&&Ie(i)?r.jsx(Rr,{approvalId:i.approval.id,toolCallId:i.toolCallId,toolName:a,input:i.input},n.key):a&&Kt(i)?r.jsx(Er,{toolName:a,toolCallId:i.toolCallId,input:i.input,isDenied:i.state==="output-denied",messageMetadata:t},n.key):null})})}function oo({rawMarkdown:e,workflowRunHistoryIds:t}){const n=Se({workflowRunHistoryIds:t});return r.jsx(ao,{onClick:n,children:r.jsx(St,{rawMarkdown:e,parser:At})})}const io=l.div`
381
+ `;function no({items:e,messageMetadata:t}){return r.jsx(oo,{children:e.map((n,o)=>{if(n.kind==="reasoning-block"){const s=o===e.length-1;return r.jsx(Ur,{items:n.items,isLast:s},n.key)}if(n.kind==="text")return r.jsx(ro,{rawMarkdown:n.text,workflowRunHistoryIds:n.workflowRunHistoryIds},n.key);const{part:i}=n,a=Gt(i.type);return a&&ke(i)?r.jsx($r,{approvalId:i.approval.id,toolCallId:i.toolCallId,toolName:a,input:i.input},n.key):a&&Kt(i)?r.jsx(Rr,{toolName:a,toolCallId:i.toolCallId,input:i.input,isDenied:i.state==="output-denied",messageMetadata:t},n.key):null})})}function ro({rawMarkdown:e,workflowRunHistoryIds:t}){const n=_e({workflowRunHistoryIds:t});return r.jsx(io,{onClick:n,children:r.jsx(St,{rawMarkdown:e,parser:At})})}const oo=l.div`
382
382
  display: flex;
383
383
  flex-direction: column;
384
384
  gap: var(--spacing-xs);
385
- `,ao=l.div`
385
+ `,io=l.div`
386
386
  white-space: normal;
387
387
 
388
388
  max-width: 100%;
@@ -395,7 +395,7 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
395
395
  p:last-child {
396
396
  margin-bottom: 0;
397
397
  }
398
- `,qe=l.div`
398
+ `,Ye=l.div`
399
399
  font-family: var(--font-family-base);
400
400
  font-size: var(--font-size-sm);
401
401
  line-height: var(--line-height-sm);
@@ -431,22 +431,22 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
431
431
  transform: scale(1);
432
432
  }
433
433
  }
434
- `;function so(){return r.jsxs(lo,{children:[r.jsx(W,{}),r.jsx(W,{}),r.jsx(W,{})]})}const lo=l.div`
434
+ `;function ao(){return r.jsxs(so,{children:[r.jsx(W,{}),r.jsx(W,{}),r.jsx(W,{})]})}const so=l.div`
435
435
  display: flex;
436
436
  align-items: center;
437
437
  justify-content: space-between;
438
438
  width: 24px;
439
439
  height: 24px;
440
- `;function co(){return r.jsxs(uo,{children:[r.jsx(so,{}),r.jsx(po,{children:"Thinking"})]})}const uo=l.div`
440
+ `;function lo(){return r.jsxs(co,{children:[r.jsx(ao,{}),r.jsx(uo,{children:"Thinking"})]})}const co=l.div`
441
441
  display: flex;
442
442
  align-items: center;
443
443
  gap: var(--spacing-xxs);
444
- `,po=l.span`
444
+ `,uo=l.span`
445
445
  font-family: var(--font-family-base);
446
446
  font-size: var(--font-size-sm);
447
447
  line-height: var(--line-height-sm);
448
448
  color: var(--text-color-helper);
449
- `;function fo({items:e}){return r.jsx(h.Fragment,{children:e.map(t=>t.kind!=="text"?null:r.jsx(qe,{children:t.text},t.key))})}const ho="Something went wrong. Please try again.";function xo(e){return e?.message?.trim()||ho}function go({message:e,isLastMessage:t}){const{chatStatus:n,chatError:o}=H(),{role:i,parts:a}=e,s=i===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:i,children:r.jsx(vo,{isFailedEmptyAssistant:u,chatError:o,isAssistant:s,contentItems:c,messageMetadata:e.metadata})})}function mo(){return r.jsx(Je,{$role:V.ASSISTANT,children:r.jsx(me,{children:r.jsx(co,{})})})}function vo({isFailedEmptyAssistant:e,chatError:t,isAssistant:n,contentItems:o,messageMetadata:i}){return e?r.jsx(me,{children:r.jsx(qe,{children:xo(t)})}):r.jsx(me,{children:n?r.jsx(ro,{items:o,messageMetadata:i}):r.jsx(fo,{items:o})})}const Je=l.div`
449
+ `;function po({items:e}){return r.jsx(f.Fragment,{children:e.map(t=>t.kind!=="text"?null:r.jsx(Ye,{children:t.text},t.key))})}const fo="Something went wrong. Please try again.";function ho(e){return e?.message?.trim()||fo}function xo({message:e,isLastMessage:t}){const{chatStatus:n,chatError:o}=H(),{role:i,parts:a}=e,s=i===V.ASSISTANT,c=f.useMemo(()=>Wt(a),[a]),u=c.length>0,d=n==="error"&&t&&s&&!u;return!u&&!d?null:r.jsx(qe,{$role:i,children:r.jsx(mo,{isFailedEmptyAssistant:d,chatError:o,isAssistant:s,contentItems:c,messageMetadata:e.metadata})})}function go(){return r.jsx(qe,{$role:V.ASSISTANT,children:r.jsx(xe,{children:r.jsx(lo,{})})})}function mo({isFailedEmptyAssistant:e,chatError:t,isAssistant:n,contentItems:o,messageMetadata:i}){return e?r.jsx(xe,{children:r.jsx(Ye,{children:ho(t)})}):r.jsx(xe,{children:n?r.jsx(no,{items:o,messageMetadata:i}):r.jsx(po,{items:o})})}const qe=l.div`
450
450
  display: flex;
451
451
  flex-direction: column;
452
452
  padding: var(--spacing-xs) var(--spacing-sm);
@@ -461,22 +461,22 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
461
461
  word-wrap: break-word;
462
462
  white-space: pre-wrap;
463
463
  max-width: 100%;
464
- `,me=l.div`
464
+ `,xe=l.div`
465
465
  display: flex;
466
466
  flex-direction: column;
467
467
  gap: var(--spacing-xxs);
468
468
  min-width: 0;
469
469
  width: 100%;
470
- `;function yo(){const{messages:e,isStreaming:t}=H(),n=e.at(-1),o=h.useMemo(()=>{const i=n?.role===V.ASSISTANT,a=n?.parts.at(-1)?.type==="text";return t&&!(i&&a)},[t,n?.parts,n?.role]);return r.jsxs(wo,{children:[e.map((i,a)=>r.jsx(Qe,{$role:i.role,children:r.jsx(Xe,{$role:i.role,children:r.jsx(go,{message:i,isLastMessage:a===e.length-1})})},i.id)),o&&r.jsx(Qe,{$role:V.ASSISTANT,children:r.jsx(Xe,{$role:V.ASSISTANT,children:r.jsx(mo,{})})})]})}const wo=l.div`
470
+ `;function vo(){const{messages:e,isStreaming:t}=H(),n=e.at(-1),o=f.useMemo(()=>{const i=n?.role===V.ASSISTANT,a=n?.parts.at(-1)?.type==="text";return t&&!(i&&a)},[t,n?.parts,n?.role]);return r.jsxs(yo,{children:[e.map((i,a)=>r.jsx(Je,{$role:i.role,children:r.jsx(Qe,{$role:i.role,children:r.jsx(xo,{message:i,isLastMessage:a===e.length-1})})},i.id)),o&&r.jsx(Je,{$role:V.ASSISTANT,children:r.jsx(Qe,{$role:V.ASSISTANT,children:r.jsx(go,{})})})]})}const yo=l.div`
471
471
  display: flex;
472
472
  flex-direction: column;
473
473
  gap: var(--spacing-xs);
474
474
  width: 100%;
475
- `,Qe=l.div`
475
+ `,Je=l.div`
476
476
  display: flex;
477
477
  width: 100%;
478
478
  justify-content: ${({$role:e})=>e===V.USER?"flex-end":"flex-start"};
479
- `,Xe=l.div`
479
+ `,Qe=l.div`
480
480
  display: flex;
481
481
  flex-direction: column;
482
482
  align-items: ${({$role:e})=>e===V.USER?"flex-end":"stretch"};
@@ -484,20 +484,20 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
484
484
  min-width: 0;
485
485
  width: 100%;
486
486
  max-width: 100%;
487
- `;function jo(e){const t=h.useRef(void 0);return h.useEffect(()=>{t.current=e}),t.current}const et=l.div`
487
+ `;function wo(e){const t=f.useRef(void 0);return f.useEffect(()=>{t.current=e}),t.current}const Xe=l.div`
488
488
  display: flex;
489
489
  flex-direction: column;
490
490
  flex: 1;
491
491
  width: 100%;
492
492
  overflow: auto;
493
493
  padding: var(--spacing-xs);
494
- `,bo=e=>r.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[r.jsxs("g",{clipPath:"url(#clip0_5333_7017)",children:[r.jsxs("mask",{id:"mask0_5333_7017",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"14",height:"14",children:[r.jsx("path",{d:"M6.98858 0.876221C7.11667 0.876221 7.22837 0.96381 7.25964 1.08813C7.3552 1.46837 7.48112 1.84033 7.63618 2.20043C8.04154 3.14225 8.59778 3.96654 9.30396 4.67271C10.0105 5.37908 10.8346 5.93532 11.7763 6.34069C12.1364 6.4957 12.5085 6.62162 12.8887 6.71723C13.0131 6.7485 13.1005 6.86001 13.1005 6.9881C13.1005 7.11618 13.0131 7.22788 12.8885 7.25915C12.5083 7.35471 12.1363 7.48063 11.7763 7.63569C10.8344 8.04106 10.0103 8.5973 9.30396 9.30348C8.59778 10.01 8.04154 10.8341 7.63618 11.7758C7.48109 12.1359 7.35511 12.508 7.25945 12.8882C7.24431 12.9487 7.20945 13.0023 7.16038 13.0406C7.11132 13.079 7.05086 13.0999 6.98858 13.1C6.8605 13.1 6.74898 13.0126 6.71772 12.8881C6.62209 12.5078 6.49611 12.1359 6.34099 11.7758C5.93581 10.8339 5.37976 10.0098 4.6732 9.30348C3.96684 8.5973 3.14274 8.04106 2.20091 7.63569C1.8408 7.48062 1.46885 7.35464 1.08862 7.25896C1.02821 7.24387 0.974561 7.20905 0.936177 7.16002C0.897792 7.11099 0.876864 7.05055 0.876709 6.98828C0.876709 6.8602 0.964299 6.74868 1.08862 6.71742C1.46887 6.6218 1.84082 6.49582 2.20091 6.34069C3.14274 5.93551 3.96702 5.37927 4.6732 4.6729C5.37957 3.96672 5.93581 3.14244 6.34117 2.20061C6.49619 1.8405 6.62211 1.46854 6.71772 1.08832C6.73278 1.02784 6.76762 0.97413 6.81669 0.935705C6.86576 0.89728 6.92626 0.876345 6.98858 0.876221Z",fill:"black"}),r.jsx("path",{d:"M6.98858 0.876221C7.11667 0.876221 7.22837 0.96381 7.25964 1.08813C7.3552 1.46837 7.48112 1.84033 7.63618 2.20043C8.04154 3.14225 8.59778 3.96654 9.30396 4.67271C10.0105 5.37908 10.8346 5.93532 11.7763 6.34069C12.1364 6.4957 12.5085 6.62162 12.8887 6.71723C13.0131 6.7485 13.1005 6.86001 13.1005 6.9881C13.1005 7.11618 13.0131 7.22788 12.8885 7.25915C12.5083 7.35471 12.1363 7.48063 11.7763 7.63569C10.8344 8.04106 10.0103 8.5973 9.30396 9.30348C8.59778 10.01 8.04154 10.8341 7.63618 11.7758C7.48109 12.1359 7.35511 12.508 7.25945 12.8882C7.24431 12.9487 7.20945 13.0023 7.16038 13.0406C7.11132 13.079 7.05086 13.0999 6.98858 13.1C6.8605 13.1 6.74898 13.0126 6.71772 12.8881C6.62209 12.5078 6.49611 12.1359 6.34099 11.7758C5.93581 10.8339 5.37976 10.0098 4.6732 9.30348C3.96684 8.5973 3.14274 8.04106 2.20091 7.63569C1.8408 7.48062 1.46885 7.35464 1.08862 7.25896C1.02821 7.24387 0.974561 7.20905 0.936177 7.16002C0.897792 7.11099 0.876864 7.05055 0.876709 6.98828C0.876709 6.8602 0.964299 6.74868 1.08862 6.71742C1.46887 6.6218 1.84082 6.49582 2.20091 6.34069C3.14274 5.93551 3.96702 5.37927 4.6732 4.6729C5.37957 3.96672 5.93581 3.14244 6.34117 2.20061C6.49619 1.8405 6.62211 1.46854 6.71772 1.08832C6.73278 1.02784 6.76762 0.97413 6.81669 0.935705C6.86576 0.89728 6.92626 0.876345 6.98858 0.876221Z",fill:"url(#paint0_linear_5333_7017)"})]}),r.jsxs("g",{mask:"url(#mask0_5333_7017)",children:[r.jsx("g",{filter:"url(#filter0_f_5333_7017)",children:r.jsx("path",{d:"M-0.227015 10.4326C1.18534 10.9342 2.80867 9.99369 3.39882 8.33193C3.98897 6.67037 3.32234 4.91669 1.90998 4.41507C0.497625 3.91346 -1.1257 4.85396 -1.71604 6.51553C-2.306 8.17729 -1.63937 9.93096 -0.227015 10.4326Z",fill:"#FFE432"})}),r.jsx("g",{filter:"url(#filter1_f_5333_7017)",children:r.jsx("path",{d:"M6.04409 4.95442C7.98425 4.95442 9.55728 3.34672 9.55728 1.3638C9.55728 -0.619301 7.98443 -2.22681 6.04409 -2.22681C4.10374 -2.22681 2.53052 -0.619113 2.53052 1.3638C2.53052 3.34672 4.10355 4.95442 6.04409 4.95442Z",fill:"#FC413D"})}),r.jsx("g",{filter:"url(#filter2_f_5333_7017)",children:r.jsx("path",{d:"M4.67843 16.4367C6.70392 16.3378 8.24192 14.1304 8.11364 11.5065C7.98556 8.88254 6.23941 6.83558 4.21393 6.93466C2.18844 7.03374 0.650439 9.241 0.778715 11.8649C0.906992 14.4888 2.65295 16.5358 4.67843 16.4367Z",fill:"#00B95C"})}),r.jsx("g",{filter:"url(#filter3_f_5333_7017)",children:r.jsx("path",{d:"M4.67843 16.4367C6.70392 16.3378 8.24192 14.1304 8.11364 11.5065C7.98556 8.88254 6.23941 6.83558 4.21393 6.93466C2.18844 7.03374 0.650439 9.241 0.778715 11.8649C0.906992 14.4888 2.65295 16.5358 4.67843 16.4367Z",fill:"#00B95C"})}),r.jsx("g",{filter:"url(#filter4_f_5333_7017)",children:r.jsx("path",{d:"M6.70714 14.8494C8.40506 13.8162 8.85958 11.4634 7.72223 9.59402C6.58489 7.7245 4.28627 7.04658 2.58816 8.07957C0.890051 9.11294 0.435527 11.4658 1.57287 13.3353C2.7106 15.2047 5.00903 15.8826 6.70714 14.8494Z",fill:"#00B95C"})}),r.jsx("g",{filter:"url(#filter5_f_5333_7017)",children:r.jsx("path",{d:"M13.5707 8.97502C15.4792 8.97502 17.0265 7.48505 17.0265 5.64736C17.0265 3.80949 15.4792 2.31952 13.5707 2.31952C11.6622 2.31952 10.115 3.80949 10.115 5.64736C10.115 7.48524 11.6622 8.97502 13.5707 8.97502Z",fill:"#3186FF"})}),r.jsx("g",{filter:"url(#filter6_f_5333_7017)",children:r.jsx("path",{d:"M-1.5844 8.58873C0.17304 9.92499 2.74027 9.50587 4.1498 7.65218C5.55933 5.79867 5.27754 3.2126 3.5201 1.87634C1.76265 0.539895 -0.804385 0.959007 -2.21411 2.81271C-3.62364 4.66622 -3.34166 7.25247 -1.5844 8.58873Z",fill:"#FBBC04"})}),r.jsx("g",{filter:"url(#filter7_f_5333_7017)",children:r.jsx("path",{d:"M7.42033 10.5639C9.51777 12.006 12.2982 11.6044 13.6303 9.66653C14.9626 7.72883 14.3422 4.98906 12.2445 3.54694C10.1469 2.10444 7.36664 2.50641 6.03434 4.44393C4.70222 6.38183 5.32251 9.12159 7.42014 10.5639H7.42033Z",fill:"#3186FF"})}),r.jsx("g",{filter:"url(#filter8_f_5333_7017)",children:r.jsx("path",{d:"M11.2336 0.436156C11.7673 1.16174 11.0814 2.57221 9.70202 3.58694C8.32243 4.60166 6.77163 4.83598 6.23799 4.11059C5.70435 3.38482 6.39 1.97416 7.76939 0.959622C9.14898 -0.0550994 10.7 -0.289425 11.2334 0.435968L11.2336 0.436156Z",fill:"#749BFF"})}),r.jsx("g",{filter:"url(#filter9_f_5333_7017)",children:r.jsx("path",{d:"M6.85291 3.9097C8.98633 1.93074 9.7185 -0.748558 8.48848 -2.07465C7.25846 -3.40074 4.53169 -2.87181 2.39827 -0.892846C0.264845 1.08612 -0.467518 3.76542 0.762693 5.09151C1.99272 6.41759 4.71949 5.88867 6.85291 3.9097Z",fill:"#FC413D"})}),r.jsx("g",{filter:"url(#filter10_f_5333_7017)",children:r.jsx("path",{d:"M2.47959 11.0173C3.74766 11.9248 5.20334 12.0627 5.73114 11.3254C6.25894 10.588 5.65881 9.25455 4.39074 8.34701C3.12285 7.43947 1.66698 7.30159 1.13937 8.03885C0.611574 8.77629 1.21152 10.1097 2.47959 11.0173Z",fill:"#FFEE48"})})]})]}),r.jsxs("defs",{children:[r.jsxs("filter",{id:"filter0_f_5333_7017",x:"-2.85766",y:"3.3534",width:"7.39819",height:"8.14086",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"0.463378",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter1_f_5333_7017",x:"-1.94918",y:"-6.7065",width:"15.9862",height:"16.1406",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"2.23985",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter2_f_5333_7017",x:"-3.03712",y:"3.12285",width:"14.9666",height:"17.1257",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.90418",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter3_f_5333_7017",x:"-3.03712",y:"3.12285",width:"14.9666",height:"17.1257",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.90418",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter4_f_5333_7017",x:"-2.86183",y:"3.78807",width:"15.0188",height:"15.3529",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.90418",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter5_f_5333_7017",x:"6.49612",y:"-1.29935",width:"14.1491",height:"13.8932",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.80943",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter6_f_5333_7017",x:"-6.39114",y:"-2.1852",width:"14.7181",height:"14.8353",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.6399",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter7_f_5333_7017",x:"2.40345",y:"-0.247677",width:"14.8579",height:"14.606",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.46454",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter8_f_5333_7017",x:"3.43598",y:"-2.60638",width:"10.5997",height:"9.75933",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.31045",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter9_f_5333_7017",x:"-2.04789",y:"-5.01896",width:"13.3468",height:"13.0548",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.10683",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter10_f_5333_7017",x:"-1.7922",y:"4.82486",width:"10.455",height:"9.71453",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.36998",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("linearGradient",{id:"paint0_linear_5333_7017",x1:"4.35148",y1:"9.05502",x2:"10.7005",y2:"3.70245",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#4893FC"}),r.jsx("stop",{offset:"0.27",stopColor:"#4893FC"}),r.jsx("stop",{offset:"0.777",stopColor:"#969DFF"}),r.jsx("stop",{offset:"1",stopColor:"#BD99FE"})]}),r.jsx("clipPath",{id:"clip0_5333_7017",children:r.jsx("rect",{width:"14",height:"14",fill:"white"})})]})]}),Co=l(bo).attrs({"data-component-name":"icons/GeminiIcon/GeminiIcon"})`
494
+ `,jo=e=>r.jsxs("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[r.jsxs("g",{clipPath:"url(#clip0_5333_7017)",children:[r.jsxs("mask",{id:"mask0_5333_7017",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"14",height:"14",children:[r.jsx("path",{d:"M6.98858 0.876221C7.11667 0.876221 7.22837 0.96381 7.25964 1.08813C7.3552 1.46837 7.48112 1.84033 7.63618 2.20043C8.04154 3.14225 8.59778 3.96654 9.30396 4.67271C10.0105 5.37908 10.8346 5.93532 11.7763 6.34069C12.1364 6.4957 12.5085 6.62162 12.8887 6.71723C13.0131 6.7485 13.1005 6.86001 13.1005 6.9881C13.1005 7.11618 13.0131 7.22788 12.8885 7.25915C12.5083 7.35471 12.1363 7.48063 11.7763 7.63569C10.8344 8.04106 10.0103 8.5973 9.30396 9.30348C8.59778 10.01 8.04154 10.8341 7.63618 11.7758C7.48109 12.1359 7.35511 12.508 7.25945 12.8882C7.24431 12.9487 7.20945 13.0023 7.16038 13.0406C7.11132 13.079 7.05086 13.0999 6.98858 13.1C6.8605 13.1 6.74898 13.0126 6.71772 12.8881C6.62209 12.5078 6.49611 12.1359 6.34099 11.7758C5.93581 10.8339 5.37976 10.0098 4.6732 9.30348C3.96684 8.5973 3.14274 8.04106 2.20091 7.63569C1.8408 7.48062 1.46885 7.35464 1.08862 7.25896C1.02821 7.24387 0.974561 7.20905 0.936177 7.16002C0.897792 7.11099 0.876864 7.05055 0.876709 6.98828C0.876709 6.8602 0.964299 6.74868 1.08862 6.71742C1.46887 6.6218 1.84082 6.49582 2.20091 6.34069C3.14274 5.93551 3.96702 5.37927 4.6732 4.6729C5.37957 3.96672 5.93581 3.14244 6.34117 2.20061C6.49619 1.8405 6.62211 1.46854 6.71772 1.08832C6.73278 1.02784 6.76762 0.97413 6.81669 0.935705C6.86576 0.89728 6.92626 0.876345 6.98858 0.876221Z",fill:"black"}),r.jsx("path",{d:"M6.98858 0.876221C7.11667 0.876221 7.22837 0.96381 7.25964 1.08813C7.3552 1.46837 7.48112 1.84033 7.63618 2.20043C8.04154 3.14225 8.59778 3.96654 9.30396 4.67271C10.0105 5.37908 10.8346 5.93532 11.7763 6.34069C12.1364 6.4957 12.5085 6.62162 12.8887 6.71723C13.0131 6.7485 13.1005 6.86001 13.1005 6.9881C13.1005 7.11618 13.0131 7.22788 12.8885 7.25915C12.5083 7.35471 12.1363 7.48063 11.7763 7.63569C10.8344 8.04106 10.0103 8.5973 9.30396 9.30348C8.59778 10.01 8.04154 10.8341 7.63618 11.7758C7.48109 12.1359 7.35511 12.508 7.25945 12.8882C7.24431 12.9487 7.20945 13.0023 7.16038 13.0406C7.11132 13.079 7.05086 13.0999 6.98858 13.1C6.8605 13.1 6.74898 13.0126 6.71772 12.8881C6.62209 12.5078 6.49611 12.1359 6.34099 11.7758C5.93581 10.8339 5.37976 10.0098 4.6732 9.30348C3.96684 8.5973 3.14274 8.04106 2.20091 7.63569C1.8408 7.48062 1.46885 7.35464 1.08862 7.25896C1.02821 7.24387 0.974561 7.20905 0.936177 7.16002C0.897792 7.11099 0.876864 7.05055 0.876709 6.98828C0.876709 6.8602 0.964299 6.74868 1.08862 6.71742C1.46887 6.6218 1.84082 6.49582 2.20091 6.34069C3.14274 5.93551 3.96702 5.37927 4.6732 4.6729C5.37957 3.96672 5.93581 3.14244 6.34117 2.20061C6.49619 1.8405 6.62211 1.46854 6.71772 1.08832C6.73278 1.02784 6.76762 0.97413 6.81669 0.935705C6.86576 0.89728 6.92626 0.876345 6.98858 0.876221Z",fill:"url(#paint0_linear_5333_7017)"})]}),r.jsxs("g",{mask:"url(#mask0_5333_7017)",children:[r.jsx("g",{filter:"url(#filter0_f_5333_7017)",children:r.jsx("path",{d:"M-0.227015 10.4326C1.18534 10.9342 2.80867 9.99369 3.39882 8.33193C3.98897 6.67037 3.32234 4.91669 1.90998 4.41507C0.497625 3.91346 -1.1257 4.85396 -1.71604 6.51553C-2.306 8.17729 -1.63937 9.93096 -0.227015 10.4326Z",fill:"#FFE432"})}),r.jsx("g",{filter:"url(#filter1_f_5333_7017)",children:r.jsx("path",{d:"M6.04409 4.95442C7.98425 4.95442 9.55728 3.34672 9.55728 1.3638C9.55728 -0.619301 7.98443 -2.22681 6.04409 -2.22681C4.10374 -2.22681 2.53052 -0.619113 2.53052 1.3638C2.53052 3.34672 4.10355 4.95442 6.04409 4.95442Z",fill:"#FC413D"})}),r.jsx("g",{filter:"url(#filter2_f_5333_7017)",children:r.jsx("path",{d:"M4.67843 16.4367C6.70392 16.3378 8.24192 14.1304 8.11364 11.5065C7.98556 8.88254 6.23941 6.83558 4.21393 6.93466C2.18844 7.03374 0.650439 9.241 0.778715 11.8649C0.906992 14.4888 2.65295 16.5358 4.67843 16.4367Z",fill:"#00B95C"})}),r.jsx("g",{filter:"url(#filter3_f_5333_7017)",children:r.jsx("path",{d:"M4.67843 16.4367C6.70392 16.3378 8.24192 14.1304 8.11364 11.5065C7.98556 8.88254 6.23941 6.83558 4.21393 6.93466C2.18844 7.03374 0.650439 9.241 0.778715 11.8649C0.906992 14.4888 2.65295 16.5358 4.67843 16.4367Z",fill:"#00B95C"})}),r.jsx("g",{filter:"url(#filter4_f_5333_7017)",children:r.jsx("path",{d:"M6.70714 14.8494C8.40506 13.8162 8.85958 11.4634 7.72223 9.59402C6.58489 7.7245 4.28627 7.04658 2.58816 8.07957C0.890051 9.11294 0.435527 11.4658 1.57287 13.3353C2.7106 15.2047 5.00903 15.8826 6.70714 14.8494Z",fill:"#00B95C"})}),r.jsx("g",{filter:"url(#filter5_f_5333_7017)",children:r.jsx("path",{d:"M13.5707 8.97502C15.4792 8.97502 17.0265 7.48505 17.0265 5.64736C17.0265 3.80949 15.4792 2.31952 13.5707 2.31952C11.6622 2.31952 10.115 3.80949 10.115 5.64736C10.115 7.48524 11.6622 8.97502 13.5707 8.97502Z",fill:"#3186FF"})}),r.jsx("g",{filter:"url(#filter6_f_5333_7017)",children:r.jsx("path",{d:"M-1.5844 8.58873C0.17304 9.92499 2.74027 9.50587 4.1498 7.65218C5.55933 5.79867 5.27754 3.2126 3.5201 1.87634C1.76265 0.539895 -0.804385 0.959007 -2.21411 2.81271C-3.62364 4.66622 -3.34166 7.25247 -1.5844 8.58873Z",fill:"#FBBC04"})}),r.jsx("g",{filter:"url(#filter7_f_5333_7017)",children:r.jsx("path",{d:"M7.42033 10.5639C9.51777 12.006 12.2982 11.6044 13.6303 9.66653C14.9626 7.72883 14.3422 4.98906 12.2445 3.54694C10.1469 2.10444 7.36664 2.50641 6.03434 4.44393C4.70222 6.38183 5.32251 9.12159 7.42014 10.5639H7.42033Z",fill:"#3186FF"})}),r.jsx("g",{filter:"url(#filter8_f_5333_7017)",children:r.jsx("path",{d:"M11.2336 0.436156C11.7673 1.16174 11.0814 2.57221 9.70202 3.58694C8.32243 4.60166 6.77163 4.83598 6.23799 4.11059C5.70435 3.38482 6.39 1.97416 7.76939 0.959622C9.14898 -0.0550994 10.7 -0.289425 11.2334 0.435968L11.2336 0.436156Z",fill:"#749BFF"})}),r.jsx("g",{filter:"url(#filter9_f_5333_7017)",children:r.jsx("path",{d:"M6.85291 3.9097C8.98633 1.93074 9.7185 -0.748558 8.48848 -2.07465C7.25846 -3.40074 4.53169 -2.87181 2.39827 -0.892846C0.264845 1.08612 -0.467518 3.76542 0.762693 5.09151C1.99272 6.41759 4.71949 5.88867 6.85291 3.9097Z",fill:"#FC413D"})}),r.jsx("g",{filter:"url(#filter10_f_5333_7017)",children:r.jsx("path",{d:"M2.47959 11.0173C3.74766 11.9248 5.20334 12.0627 5.73114 11.3254C6.25894 10.588 5.65881 9.25455 4.39074 8.34701C3.12285 7.43947 1.66698 7.30159 1.13937 8.03885C0.611574 8.77629 1.21152 10.1097 2.47959 11.0173Z",fill:"#FFEE48"})})]})]}),r.jsxs("defs",{children:[r.jsxs("filter",{id:"filter0_f_5333_7017",x:"-2.85766",y:"3.3534",width:"7.39819",height:"8.14086",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"0.463378",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter1_f_5333_7017",x:"-1.94918",y:"-6.7065",width:"15.9862",height:"16.1406",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"2.23985",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter2_f_5333_7017",x:"-3.03712",y:"3.12285",width:"14.9666",height:"17.1257",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.90418",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter3_f_5333_7017",x:"-3.03712",y:"3.12285",width:"14.9666",height:"17.1257",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.90418",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter4_f_5333_7017",x:"-2.86183",y:"3.78807",width:"15.0188",height:"15.3529",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.90418",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter5_f_5333_7017",x:"6.49612",y:"-1.29935",width:"14.1491",height:"13.8932",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.80943",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter6_f_5333_7017",x:"-6.39114",y:"-2.1852",width:"14.7181",height:"14.8353",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.6399",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter7_f_5333_7017",x:"2.40345",y:"-0.247677",width:"14.8579",height:"14.606",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.46454",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter8_f_5333_7017",x:"3.43598",y:"-2.60638",width:"10.5997",height:"9.75933",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.31045",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter9_f_5333_7017",x:"-2.04789",y:"-5.01896",width:"13.3468",height:"13.0548",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.10683",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("filter",{id:"filter10_f_5333_7017",x:"-1.7922",y:"4.82486",width:"10.455",height:"9.71453",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[r.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),r.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),r.jsx("feGaussianBlur",{stdDeviation:"1.36998",result:"effect1_foregroundBlur_5333_7017"})]}),r.jsxs("linearGradient",{id:"paint0_linear_5333_7017",x1:"4.35148",y1:"9.05502",x2:"10.7005",y2:"3.70245",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#4893FC"}),r.jsx("stop",{offset:"0.27",stopColor:"#4893FC"}),r.jsx("stop",{offset:"0.777",stopColor:"#969DFF"}),r.jsx("stop",{offset:"1",stopColor:"#BD99FE"})]}),r.jsx("clipPath",{id:"clip0_5333_7017",children:r.jsx("rect",{width:"14",height:"14",fill:"white"})})]})]}),bo=l(jo).attrs({"data-component-name":"icons/GeminiIcon/GeminiIcon"})`
495
495
  height: ${({size:e})=>e||"16px"};
496
496
  width: ${({size:e})=>e||"16px"};
497
- `,ko=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"})]})})]}),Io=l(ko)`
497
+ `,Co=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"})]})})]}),ko=l(Co)`
498
498
  height: ${({size:e})=>e||"14px"};
499
499
  width: ${({size:e})=>e||"14px"};
500
- `;function To(e){const t="var(--font-size-base)";switch(e){case de:return r.jsx(Io,{size:t});case ue.OPENAI:return r.jsx(gt,{size:t,color:"var(--text-color-primary)"});case ue.GEMINI:return r.jsx(Co,{size:t});case ue.ANTHROPIC:return r.jsx(xt,{size:t,color:"var(--replay-claude-icon-color)"})}}function _o({models:e,selectedModelId:t,placement:n,onModelSelect:o,onSettingsOpen:i}){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(Bo,{children:r.jsx(Vo,{trigger:r.jsx(So,{label:s}),placement:n,alignment:"start",withArrow:!0,children:r.jsxs(zo,{children:[r.jsxs(Fo,{children:[d.map(p=>r.jsx(tt,{model:p,activeModelId:c,onModelSelect:o},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:o},p.id))})]}),i&&e.length>0&&r.jsx(nt,{"aria-hidden":!0}),i&&r.jsx(Ro,{prefix:r.jsx(Ot,{size:"var(--font-size-base)",color:"var(--text-color-secondary)"}),content:"Manage models",onAction:()=>i("ai-providers")})]})})})}function So({label:e,icon:t,onClick:n,onKeyDown:o}){return r.jsxs(Ao,{onClick:n,onKeyDown:o,children:[r.jsx(Oo,{children:e}),t]})}function tt({model:e,activeModelId:t,onModelSelect:n}){const o=e.id===t;return r.jsx(ye,{prefix:To(e.provider),suffix:o?r.jsx($o,{size:"var(--font-size-base)",color:"var(--text-color-primary)"}):void 0,onAction:()=>n(e.id),active:o,children:r.jsx(Mo,{children:e.label})})}const Ao=l.div`
500
+ `;function Io(e){const t="var(--font-size-base)";switch(e){case le:return r.jsx(ko,{size:t});case ce.OPENAI:return r.jsx(xt,{size:t,color:"var(--text-color-primary)"});case ce.GEMINI:return r.jsx(bo,{size:t});case ce.ANTHROPIC:return r.jsx(ht,{size:t,color:"var(--replay-claude-icon-color)"})}}function To({models:e,selectedModelId:t,placement:n,onModelSelect:o,onSettingsOpen:i}){const a=e.find(h=>h.id===t),s=a?.label??"Replay AI",c=a?.id,u=e.filter(h=>h.provider===le),d=e.filter(h=>h.provider!==le),p=u.length>0&&d.length>0;return r.jsx(Oo,{children:r.jsx(Bo,{trigger:r.jsx(_o,{label:s}),placement:n,alignment:"start",withArrow:!0,children:r.jsxs(Vo,{children:[r.jsxs(Fo,{children:[u.map(h=>r.jsx(et,{model:h,activeModelId:c,onModelSelect:o},h.id)),p&&r.jsx(tt,{"aria-hidden":!0}),d.length>0&&r.jsx(r.Fragment,{children:d.map(h=>r.jsx(et,{model:h,activeModelId:c,onModelSelect:o},h.id))})]}),i&&e.length>0&&r.jsx(tt,{"aria-hidden":!0}),i&&r.jsx($o,{prefix:r.jsx(Ot,{size:"var(--font-size-base)",color:"var(--text-color-secondary)"}),content:"Manage models",onAction:()=>i("ai-providers")})]})})})}function _o({label:e,icon:t,onClick:n,onKeyDown:o}){return r.jsxs(So,{onClick:n,onKeyDown:o,children:[r.jsx(Ao,{children:e}),t]})}function et({model:e,activeModelId:t,onModelSelect:n}){const o=e.id===t;return r.jsx(ve,{prefix:Io(e.provider),suffix:o?r.jsx(zo,{size:"var(--font-size-base)",color:"var(--text-color-primary)"}):void 0,onAction:()=>n(e.id),active:o,children:r.jsx(Mo,{children:e.label})})}const So=l.div`
501
501
  display: flex;
502
502
  align-items: center;
503
503
  min-width: 0;
@@ -512,7 +512,7 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
512
512
  &:hover {
513
513
  background: var(--layer-color-active);
514
514
  }
515
- `,Oo=l.span`
515
+ `,Ao=l.span`
516
516
  overflow: hidden;
517
517
  text-overflow: ellipsis;
518
518
  font-family: var(--font-family-base);
@@ -521,13 +521,13 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
521
521
  line-height: var(--line-height-base);
522
522
  color: var(--text-color-primary);
523
523
  white-space: nowrap;
524
- `,Bo=l.div`
524
+ `,Oo=l.div`
525
525
  --dropdown-menu-padding-top: 0;
526
526
 
527
527
  min-width: 0;
528
528
  flex: 1;
529
529
  position: relative;
530
- `,Vo=l(pt)`
530
+ `,Bo=l(ut)`
531
531
  width: 100%;
532
532
  min-width: 0;
533
533
  flex: 1;
@@ -536,7 +536,7 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
536
536
  width: 100%;
537
537
  max-width: 200px;
538
538
  }
539
- `,zo=l(ft)`
539
+ `,Vo=l(pt)`
540
540
  --dropdown-menu-item-gap: calc(var(--spacing-unit) / 2);
541
541
  --dropdown-menu-item-padding-vertical: var(--spacing-xxs);
542
542
  --dropdown-menu-item-padding-horizontal: var(--spacing-xs);
@@ -551,9 +551,9 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
551
551
  overflow: hidden;
552
552
  text-overflow: ellipsis;
553
553
  white-space: nowrap;
554
- `,$o=l(ht)`
554
+ `,zo=l(ft)`
555
555
  margin-left: var(--spacing-xxs);
556
- `,nt=l.li`
556
+ `,tt=l.li`
557
557
  flex-shrink: 0;
558
558
  list-style: none;
559
559
  width: 100%;
@@ -567,16 +567,16 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
567
567
  list-style: none;
568
568
  min-height: 0;
569
569
  overflow-y: auto;
570
- `,Ro=l(ye)`
570
+ `,$o=l(ve)`
571
571
  flex-shrink: 0;
572
- `,Eo=280;function rt({pinToBottom:e=!1}){const[t,n]=h.useState(()=>_e().getIndexingActivityState().inProgress);return h.useEffect(()=>_e().subscribe("indexing-activity",o=>{n(o.inProgress)}),[]),r.jsx(Lo,{$open:t,$pinToBottom:e,"aria-hidden":!t,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(No,{role:"status","aria-live":"polite","aria-label":"Indexing in progress...",children:[r.jsx("div",{children:r.jsx(W,{})}),r.jsx(Do,{children:"Indexing in progress..."})]})})})}const Lo=l.div`
572
+ `,Ro=280;function nt({pinToBottom:e=!1}){const[t,n]=f.useState(()=>Te().getIndexingActivityState().inProgress);return f.useEffect(()=>Te().subscribe("indexing-activity",o=>{n(o.inProgress)}),[]),r.jsx(Eo,{$open:t,$pinToBottom:e,"aria-hidden":!t,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(Lo,{role:"status","aria-live":"polite","aria-label":"Indexing in progress...",children:[r.jsx("div",{children:r.jsx(W,{})}),r.jsx(No,{children:"Indexing in progress..."})]})})})}const Eo=l.div`
573
573
  width: 100%;
574
574
  display: block;
575
575
 
576
- ${({$pinToBottom:e})=>e?ae`
576
+ ${({$pinToBottom:e})=>e?oe`
577
577
  order: 1;
578
578
  margin-top: auto;
579
- `:ae`
579
+ `:oe`
580
580
  position: absolute;
581
581
  left: 0;
582
582
  right: 0;
@@ -586,13 +586,13 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
586
586
  `}
587
587
 
588
588
  opacity: ${({$open:e})=>e?1:0};
589
- transition: opacity ${Eo}ms ease-out;
589
+ transition: opacity ${Ro}ms ease-out;
590
590
  pointer-events: ${({$open:e})=>e?"auto":"none"};
591
591
 
592
592
  ${W} {
593
593
  animation-play-state: ${({$open:e})=>e?"running":"paused"};
594
594
  }
595
- `,No=l.div`
595
+ `,Lo=l.div`
596
596
  width: 100%;
597
597
  display: flex;
598
598
  align-items: center;
@@ -602,10 +602,10 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
602
602
  border-radius: 4px;
603
603
  font-size: var(--font-size-sm);
604
604
  line-height: 12px;
605
- `,Do=l.div`
605
+ `,No=l.div`
606
606
  flex: 1;
607
607
  min-width: 0;
608
- `;function Po(){const{chatId:e,isLoading:t,pendingComposerPreset:n,clearPendingComposerPreset:o,availableModels:i,selectedModelId:a,selectModel:s,onSettingsOpen:c}=Ce(),{messages:d,isStreaming:u,sendMessage:f,stopGeneration:p}=H(),{isOpen:x}=ke(),[g,v]=h.useState(""),b=h.useRef(null),y=h.useRef(null),w=h.useRef(!0),m=d.length>0,T=t||m,O=jo(d.length),S=O!==void 0&&O>0&&!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 ve=lt=>{lt.deltaY<0&&(w.current=!1)};return B.addEventListener("wheel",ve,{passive:!0}),()=>B.removeEventListener("wheel",ve)},[]);const Y=h.useCallback(async()=>{g&&(v(""),w.current=!0,await f(g),b.current&&requestAnimationFrame(()=>b.current?.focus()))},[f,g]);h.useEffect(()=>{x&&(b.current&&b.current.focus(),w.current=!0,$())},[x,d.length,$]),h.useEffect(()=>{u&&w.current&&$()}),h.useEffect(function(){x&&b.current&&(b.current.focus(),$("instant"))},[e,x,$]),h.useEffect(function(){!x||n===null||(v(n),o())},[x,n,o]);const st=r.jsx(nn,{value:g,onValueChange:v,onSubmit:Y,isStreaming:u,onStop:p,textareaRef:b,modelSelector:r.jsx(_o,{models:i,selectedModelId:a,placement:m?"top":"bottom",onModelSelect:s,onSettingsOpen:c})});return r.jsxs(et,{children:[r.jsx(Uo,{ref:y,$isExpanded:T,$isAnimated:u||S,onScroll:Z,children:t?r.jsx(Go,{children:r.jsx(pe,{size:"20px"})}):r.jsx(yo,{})}),r.jsxs(Ho,{$isExpanded:!T,children:[r.jsx(rt,{pinToBottom:!T}),st]})]})}const Uo=l.div`
608
+ `;function Do(){const{chatId:e,isLoading:t,pendingComposerPreset:n,clearPendingComposerPreset:o,availableModels:i,selectedModelId:a,selectModel:s,onSettingsOpen:c}=be(),{messages:u,isStreaming:d,sendMessage:p,stopGeneration:h}=H(),{isOpen:x}=Ce(),[g,v]=f.useState(""),b=f.useRef(null),y=f.useRef(null),w=f.useRef(!0),m=u.length>0,T=t||m,O=wo(u.length),S=O!==void 0&&O>0&&!m,F=f.useCallback((B="smooth")=>{y.current&&y.current.scrollTo({top:y.current.scrollHeight,behavior:B})},[]),Z=f.useCallback(()=>{const B=y.current;B&&B.scrollHeight-B.scrollTop-B.clientHeight<50&&(w.current=!0)},[]);f.useEffect(()=>{const B=y.current;if(!B)return;const ge=st=>{st.deltaY<0&&(w.current=!1)};return B.addEventListener("wheel",ge,{passive:!0}),()=>B.removeEventListener("wheel",ge)},[]);const Y=f.useCallback(async()=>{g&&(v(""),w.current=!0,await p(g),b.current&&requestAnimationFrame(()=>b.current?.focus()))},[p,g]);f.useEffect(()=>{x&&(b.current&&b.current.focus(),w.current=!0,F())},[x,u.length,F]),f.useEffect(()=>{d&&w.current&&F()}),f.useEffect(function(){x&&b.current&&(b.current.focus(),F("instant"))},[e,x,F]),f.useEffect(function(){!x||n===null||(v(n),o())},[x,n,o]);const at=r.jsx(en,{value:g,onValueChange:v,onSubmit:Y,isStreaming:d,onStop:h,textareaRef:b,modelSelector:r.jsx(To,{models:i,selectedModelId:a,placement:m?"top":"bottom",onModelSelect:s,onSettingsOpen:c})});return r.jsxs(Xe,{children:[r.jsx(Po,{ref:y,$isExpanded:T,$isAnimated:d||S,onScroll:Z,children:t?r.jsx(Ho,{children:r.jsx(de,{size:"20px"})}):r.jsx(vo,{})}),r.jsxs(Uo,{$isExpanded:!T,children:[r.jsx(nt,{pinToBottom:!T}),at]})]})}const Po=l.div`
609
609
  flex: ${({$isExpanded:e})=>e?1:0};
610
610
  width: 100%;
611
611
  overflow: auto;
@@ -613,54 +613,54 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
613
613
  transition-property: flex;
614
614
  transition-duration: ${e=>e.$isAnimated?"var(--replay-transition-duration)":"0s"};
615
615
  transition-timing-function: var(--replay-transition-timing-function);
616
- `,Ho=l.div`
616
+ `,Uo=l.div`
617
617
  position: relative;
618
618
  display: flex;
619
619
  flex-direction: column;
620
620
  width: 100%;
621
621
  flex: ${({$isExpanded:e})=>e?1:0};
622
- `,Go=l.div`
622
+ `,Ho=l.div`
623
623
  display: flex;
624
624
  justify-content: center;
625
625
  height: 100%;
626
626
  padding-top: var(--spacing-lg);
627
- `,M={TODAY:"today",YESTERDAY:"yesterday",LAST_WEEK:"last_week",LAST_MONTH:"last_month",OLDER:"older"},Ko={[M.TODAY]:"Today",[M.YESTERDAY]:"Yesterday",[M.LAST_WEEK]:"Last 7 days",[M.LAST_MONTH]:"Last 30 days",[M.OLDER]:"Older"};function Wo(e,t=Date.now()){const n=L(e).startOf("day"),o=L(t).startOf("day"),i=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(o,"day")?M.TODAY:n.isSame(i,"day")?M.YESTERDAY:!n.isBefore(a,"day")&&n.isBefore(i,"day")?M.LAST_WEEK:!n.isBefore(s,"day")&&n.isBefore(a,"day")?M.LAST_MONTH:M.OLDER}function Zo(e){const t=[];for(const n of e){const o=Wo(n.updatedAt),i=t[t.length-1];!i||i.bucket!==o?t.push({bucket:o,chats:[n]}):i.chats.push(n)}return t}function Yo(e){const{scrollRef:t,sentinelRef:n,hasNextPage:o,isFetchingNextPage:i,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&&o&&(i||a())},{root:c,rootMargin:"80px"});return u.observe(d),()=>{u.disconnect()}},[s,a,o,i,t,n])}const ot=l(et)`
627
+ `,z={TODAY:"today",YESTERDAY:"yesterday",LAST_WEEK:"last_week",LAST_MONTH:"last_month",OLDER:"older"},Go={[z.TODAY]:"Today",[z.YESTERDAY]:"Yesterday",[z.LAST_WEEK]:"Last 7 days",[z.LAST_MONTH]:"Last 30 days",[z.OLDER]:"Older"};function Ko(e,t=Date.now()){const n=L(e).startOf("day"),o=L(t).startOf("day"),i=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(o,"day")?z.TODAY:n.isSame(i,"day")?z.YESTERDAY:!n.isBefore(a,"day")&&n.isBefore(i,"day")?z.LAST_WEEK:!n.isBefore(s,"day")&&n.isBefore(a,"day")?z.LAST_MONTH:z.OLDER}function Wo(e){const t=[];for(const n of e){const o=Ko(n.updatedAt),i=t[t.length-1];!i||i.bucket!==o?t.push({bucket:o,chats:[n]}):i.chats.push(n)}return t}function Zo(e){const{scrollRef:t,sentinelRef:n,hasNextPage:o,isFetchingNextPage:i,fetchNextPage:a,observerResetKey:s}=e;f.useLayoutEffect(()=>{const c=t.current,u=n.current;if(!c||!u)return;const d=new IntersectionObserver(p=>{const h=p[0];h&&h.isIntersecting&&o&&(i||a())},{root:c,rootMargin:"80px"});return d.observe(u),()=>{d.disconnect()}},[s,a,o,i,t,n])}const rt=l(Xe)`
628
628
  gap: var(--spacing-xxs);
629
629
  user-select: none;
630
- `,qo=l.div`
630
+ `,Yo=l.div`
631
631
  display: flex;
632
632
  flex-direction: column;
633
633
  gap: var(--spacing-xs);
634
- `,Jo=l.div`
634
+ `,qo=l.div`
635
635
  display: flex;
636
636
  flex-direction: column;
637
637
  gap: var(--spacing-xxs);
638
- `,Qo=l(ot)`
638
+ `,Jo=l(rt)`
639
639
  display: flex;
640
640
  flex-grow: 1;
641
641
  align-items: center;
642
642
  flex-direction: column;
643
643
  padding: var(--spacing-md);
644
- `,Xo=l.div`
644
+ `,Qo=l.div`
645
645
  display: flex;
646
646
  flex-grow: 1;
647
647
  align-items: center;
648
648
  justify-content: center;
649
- `,ei=l.div`
649
+ `,Xo=l.div`
650
650
  display: flex;
651
651
  flex-direction: column;
652
652
  align-items: center;
653
653
  max-width: 75%;
654
654
  gap: var(--spacing-xxs);
655
- `,ti=l.div`
655
+ `,ei=l.div`
656
656
  display: flex;
657
657
  justify-content: center;
658
658
  padding: var(--spacing-xs);
659
- `,ni=l(U)`
659
+ `,ti=l(U)`
660
660
  padding-left: var(--spacing-xs);
661
661
  font-size: var(--font-size-sm);
662
662
  color: var(--color-warm-grey-7);
663
- `,ri=l.div`
663
+ `,ni=l.div`
664
664
  display: flex;
665
665
  flex-grow: 1;
666
666
 
@@ -668,7 +668,7 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
668
668
  flex-grow: 1;
669
669
  min-width: 0;
670
670
  }
671
- `,oi=l.div`
671
+ `,ri=l.div`
672
672
  display: flex;
673
673
  align-items: center;
674
674
  justify-content: space-between;
@@ -691,26 +691,26 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
691
691
  display: inline-flex;
692
692
  }
693
693
  }
694
- `,ii=l(U)`
694
+ `,oi=l(U)`
695
695
  overflow: hidden;
696
696
  white-space: nowrap;
697
697
  text-overflow: ellipsis;
698
- `,ai=l.div`
698
+ `,ii=l.div`
699
699
  height: 1px;
700
700
  flex-shrink: 0;
701
- `;function si(e){const{chat:t,onSelect:n,onRemove:o}=e;return r.jsx(ri,{children:r.jsx(E,{tip:L(t.updatedAt).format("MMM DD, YYYY, hh:mm:ss A"),className:"expanded",children:r.jsxs(oi,{role:"button",onClick:()=>n?.(t.id),children:[r.jsx(ii,{children:t.title??"New chat"}),r.jsx(_,{variant:"ghost",size:"small",tone:"danger",icon:r.jsx(Bt,{}),onClick:i=>{i.stopPropagation(),o?.(t.id)}})]})})})}function li(e){const{group:t,onChatSelect:n,onChatRemove:o}=e;return r.jsxs(Jo,{children:[r.jsx(ni,{children:Ko[t.bucket]}),t.chats.map(i=>r.jsx(si,{chat:i,onSelect:n,onRemove:o},i.id))]})}function ci(){return r.jsx(Xo,{children:r.jsxs(ei,{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 di(){return r.jsx(Qo,{children:r.jsx(pe,{})})}const ui=50;function pi(e){const{onChatSelect:t,onChatRemove:n}=e,o=h.useRef(null),i=h.useRef(null),{data:a,isPending:s,hasNextPage:c,isFetchingNextPage:d,fetchNextPage:u}=Zt(ui),f=h.useMemo(()=>(a?.pages??[]).flatMap(x=>x.items),[a?.pages]),p=h.useMemo(()=>Zo(f),[f]);return Yo({scrollRef:o,sentinelRef:i,hasNextPage:c,isFetchingNextPage:d,fetchNextPage:u,observerResetKey:a?.pages.length}),s&&!a?r.jsx(di,{}):f.length===0?r.jsx(ci,{}):r.jsxs(ot,{ref:o,children:[r.jsx(qo,{children:p.map(x=>r.jsx(li,{group:x,onChatSelect:t,onChatRemove:n},`${x.bucket}-${x.chats[0]?.id??""}`))}),c&&r.jsx(ai,{ref:i,"aria-hidden":!0}),d&&r.jsx(ti,{children:r.jsx(pe,{})})]})}function fi(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 hi=l(fi).attrs({"data-component-name":"icons/NewChatIcon/NewChatIcon"})`
701
+ `;function ai(e){const{chat:t,onSelect:n,onRemove:o}=e;return r.jsx(ni,{children:r.jsx(E,{tip:L(t.updatedAt).format("MMM DD, YYYY, hh:mm:ss A"),className:"expanded",children:r.jsxs(ri,{role:"button",onClick:()=>n?.(t.id),children:[r.jsx(oi,{children:t.title??"New chat"}),r.jsx(_,{variant:"ghost",size:"small",tone:"danger",icon:r.jsx(Bt,{}),onClick:i=>{i.stopPropagation(),o?.(t.id)}})]})})})}function si(e){const{group:t,onChatSelect:n,onChatRemove:o}=e;return r.jsxs(qo,{children:[r.jsx(ti,{children:Go[t.bucket]}),t.chats.map(i=>r.jsx(ai,{chat:i,onSelect:n,onRemove:o},i.id))]})}function li(){return r.jsx(Qo,{children:r.jsxs(Xo,{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 ci(){return r.jsx(Jo,{children:r.jsx(de,{})})}const di=50;function ui(e){const{onChatSelect:t,onChatRemove:n}=e,o=f.useRef(null),i=f.useRef(null),{data:a,isPending:s,hasNextPage:c,isFetchingNextPage:u,fetchNextPage:d}=Zt(di),p=f.useMemo(()=>(a?.pages??[]).flatMap(x=>x.items),[a?.pages]),h=f.useMemo(()=>Wo(p),[p]);return Zo({scrollRef:o,sentinelRef:i,hasNextPage:c,isFetchingNextPage:u,fetchNextPage:d,observerResetKey:a?.pages.length}),s&&!a?r.jsx(ci,{}):p.length===0?r.jsx(li,{}):r.jsxs(rt,{ref:o,children:[r.jsx(Yo,{children:h.map(x=>r.jsx(si,{group:x,onChatSelect:t,onChatRemove:n},`${x.bucket}-${x.chats[0]?.id??""}`))}),c&&r.jsx(ii,{ref:i,"aria-hidden":!0}),u&&r.jsx(ei,{children:r.jsx(de,{})})]})}function pi(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 fi=l(pi).attrs({"data-component-name":"icons/NewChatIcon/NewChatIcon"})`
702
702
  path {
703
703
  fill: ${({color:e})=>q(e)};
704
704
  }
705
705
 
706
706
  height: ${({size:e="14px"})=>e};
707
707
  width: ${({size:e="14px"})=>e};
708
- `;function xi(){const e=h.useRef(null),[t,n]=h.useState(!1);return h.useLayoutEffect(()=>{if(!e.current)return;const o=e.current;function i(){n(o.scrollWidth>o.clientWidth)}i();const a=new ResizeObserver(i);return a.observe(o),()=>a.disconnect()},[]),{ref:e,value:t}}function gi(e){const{ref:t,value:n}=xi();return r.jsx(mi,{children:r.jsx(E,{tip:e.value,className:"no-overflow",disabled:!n,children:r.jsx(vi,{ref:t,children:e.value})})})}const mi=l.div`
708
+ `;function hi(){const e=f.useRef(null),[t,n]=f.useState(!1);return f.useLayoutEffect(()=>{if(!e.current)return;const o=e.current;function i(){n(o.scrollWidth>o.clientWidth)}i();const a=new ResizeObserver(i);return a.observe(o),()=>a.disconnect()},[]),{ref:e,value:t}}function xi(e){const{ref:t,value:n}=hi();return r.jsx(gi,{children:r.jsx(E,{tip:e.value,className:"no-overflow",disabled:!n,children:r.jsx(mi,{ref:t,children:e.value})})})}const gi=l.div`
709
709
  overflow: hidden;
710
710
  .tooltip-no-overflow {
711
711
  overflow: hidden;
712
712
  }
713
- `,vi=l.div`
713
+ `,mi=l.div`
714
714
  color: var(--text-color-primary);
715
715
  font-size: var(--font-size-base);
716
716
  line-height: var(--line-height-base);
@@ -718,7 +718,7 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
718
718
  white-space: nowrap;
719
719
  text-overflow: ellipsis;
720
720
  user-select: none;
721
- `;function it(e){const{children:t,buttons:n}=e;return r.jsxs(yi,{children:[r.jsx(wi,{children:t}),n&&r.jsx(ji,{children:n})]})}const yi=l.div`
721
+ `;function ot(e){const{children:t,buttons:n}=e;return r.jsxs(vi,{children:[r.jsx(yi,{children:t}),n&&r.jsx(wi,{children:n})]})}const vi=l.div`
722
722
  display: flex;
723
723
  flex-direction: row;
724
724
  align-items: center;
@@ -726,28 +726,28 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
726
726
  gap: var(--spacing-xs);
727
727
  width: 100%;
728
728
  flex-shrink: 0;
729
- `,wi=l.div`
729
+ `,yi=l.div`
730
730
  display: flex;
731
731
  align-items: center;
732
732
  gap: var(--spacing-xs);
733
733
  min-width: 0;
734
734
  flex: 1;
735
- `,ji=l.div`
735
+ `,wi=l.div`
736
736
  display: flex;
737
737
  align-items: center;
738
738
  gap: 2px;
739
- `;function bi(e){const{title:t,onCreateNewChat:n,onViewHistory:o,onClose:i}=e,a=r.jsxs(r.Fragment,{children:[r.jsx(E,{tip:"New chat",children:r.jsx(_,{size:"small",variant:"text","aria-label":"Create new chat",onClick:n,icon:r.jsx(hi,{})})}),r.jsx(E,{tip:"Chat history",children:r.jsx(_,{size:"small",variant:"text","aria-label":"View chat history",onClick:o,icon:r.jsx(zt,{})})}),r.jsx(ki,{children:r.jsx(Mt,{})}),r.jsx(E,{tip:"Close",arrowPosition:"left",children:r.jsx(_,{variant:"text",size:"small","aria-label":"Close panel",icon:r.jsx(mt,{}),onClick:i})})]});return r.jsxs(it,{buttons:a,children:[r.jsx(Ci,{children:r.jsx(Vt,{size:"14px"})}),r.jsx(gi,{value:t})]})}const Ci=l.div`
739
+ `;function ji(e){const{title:t,onCreateNewChat:n,onViewHistory:o,onClose:i}=e,a=r.jsxs(r.Fragment,{children:[r.jsx(E,{tip:"New chat",children:r.jsx(_,{size:"small",variant:"text","aria-label":"Create new chat",onClick:n,icon:r.jsx(fi,{})})}),r.jsx(E,{tip:"Chat history",children:r.jsx(_,{size:"small",variant:"text","aria-label":"View chat history",onClick:o,icon:r.jsx(Mt,{})})}),r.jsx(Ci,{children:r.jsx(zt,{})}),r.jsx(E,{tip:"Close",arrowPosition:"left",children:r.jsx(_,{variant:"text",size:"small","aria-label":"Close panel",icon:r.jsx(gt,{}),onClick:i})})]});return r.jsxs(ot,{buttons:a,children:[r.jsx(bi,{children:r.jsx(Vt,{size:"14px"})}),r.jsx(xi,{value:t})]})}const bi=l.div`
740
740
  display: flex;
741
- `,ki=l.div`
741
+ `,Ci=l.div`
742
742
  display: flex;
743
743
  height: 14px;
744
- `;function Ii(e){const{onReturnFromHistory:t}=e;return r.jsxs(it,{children:[r.jsx(_,{size:"small",variant:"text","aria-label":"Return to chat",onClick:t,icon:r.jsx($t,{})}),r.jsx(Ti,{children:r.jsx(U,{children:"Chat history"})})]})}const Ti=l.div`
744
+ `;function ki(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(Ft,{})}),r.jsx(Ii,{children:r.jsx(U,{children:"Chat history"})})]})}const Ii=l.div`
745
745
  user-select: none;
746
- `;function _i(){const[e,t]=h.useState(N.CHAT),n=ke(),o=Ce(),i=()=>{t(N.HISTORY)},a=()=>{t(N.CHAT)},s=async c=>{o.selectChat(c),t(N.CHAT)};return r.jsxs(Si,{children:[r.jsxs(at,{isActive:e===N.CHAT,children:[r.jsx(bi,{title:o.title,onCreateNewChat:o.createNewChat,onViewHistory:i,onClose:n.closePanel}),r.jsx(Po,{})]}),r.jsxs(at,{isActive:e===N.HISTORY,isSliding:!0,children:[r.jsx(Ii,{onReturnFromHistory:a}),r.jsx(pi,{onChatSelect:s,onChatRemove:o.removeChat}),r.jsx(Oi,{children:r.jsx(rt,{pinToBottom:!0})})]})]})}function at(e){const{children:t,isActive:n,isSliding:o=!1}=e,i=r.jsx(Ai,{inert:!n,children:t});return o?r.jsx(Bi,{$isExpanded:n,children:i}):i}const Si=l.div`
746
+ `;function Ti(){const[e,t]=f.useState(N.CHAT),n=Ce(),o=be(),i=()=>{t(N.HISTORY)},a=()=>{t(N.CHAT)},s=async c=>{o.selectChat(c),t(N.CHAT)};return r.jsxs(_i,{children:[r.jsxs(it,{isActive:e===N.CHAT,children:[r.jsx(ji,{title:o.title,onCreateNewChat:o.createNewChat,onViewHistory:i,onClose:n.closePanel}),r.jsx(Do,{})]}),r.jsxs(it,{isActive:e===N.HISTORY,isSliding:!0,children:[r.jsx(ki,{onReturnFromHistory:a}),r.jsx(ui,{onChatSelect:s,onChatRemove:o.removeChat}),r.jsx(Ai,{children:r.jsx(nt,{pinToBottom:!0})})]})]})}function it(e){const{children:t,isActive:n,isSliding:o=!1}=e,i=r.jsx(Si,{inert:!n,children:t});return o?r.jsx(Oi,{$isExpanded:n,children:i}):i}const _i=l.div`
747
747
  position: relative;
748
748
  height: 100%;
749
749
  overflow: clip;
750
- `,Ai=l.div`
750
+ `,Si=l.div`
751
751
  display: flex;
752
752
  height: 100%;
753
753
  flex-direction: column;
@@ -755,12 +755,12 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
755
755
  border-radius: var(--border-radius-md);
756
756
  background: var(--bg-color);
757
757
  margin-left: var(--spacing-xxs);
758
- `,Oi=l.div`
758
+ `,Ai=l.div`
759
759
  display: flex;
760
760
  flex-direction: column;
761
761
  width: 100%;
762
762
  padding: 0 var(--spacing-xs) var(--spacing-xs);
763
- `,Bi=l.div`
763
+ `,Oi=l.div`
764
764
  position: absolute;
765
765
  inset: 0;
766
766
  transform: translateX(${e=>e.$isExpanded?"0%":"100%"});
@@ -770,4 +770,4 @@ import{g as q,a as l,j as r,h as ae,B as _,r as h,f as ct,z as dt,ad as ut,Z as
770
770
  @media (prefers-reduced-motion: reduce) {
771
771
  transition-duration: 0ms;
772
772
  }
773
- `;export{_i as AiPanel};
773
+ `;export{Ti as AiPanel};