@av-pi-studio/web-client 0.0.108 → 0.0.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web/assets/{BinaryFallbackViewer-CETZBSFn.js → BinaryFallbackViewer-DpOfwwlU.js} +1 -1
- package/dist/web/assets/ChatPanel-8dn4l9xC.js +8 -0
- package/dist/web/assets/ChatPanel-C49fPd0n.css +1 -0
- package/dist/web/assets/{CodeView-Ll6fG3qP.js → CodeView-LdafEiaJ.js} +1 -1
- package/dist/web/assets/{FilePanel-DEo396Lk.js → FilePanel-D94WKsxH.js} +1 -1
- package/dist/web/assets/{HtmlViewer-CJ9W44fj.js → HtmlViewer-CRFlnCxG.js} +1 -1
- package/dist/web/assets/{ImageViewer-aE8UjQHQ.js → ImageViewer-lKcoFTgn.js} +1 -1
- package/dist/web/assets/{MarkdownFileViewer-CQ0UwCPR.js → MarkdownFileViewer-D6LqyXG0.js} +1 -1
- package/dist/web/assets/ModelProvidersPanel-CNeSw_fU.js +1 -0
- package/dist/web/assets/{MoleculeViewerPanel-BDi_0OgB.js → MoleculeViewerPanel-BytUdaiR.js} +1 -1
- package/dist/web/assets/{SettingsDialog-CR8pWXdE.js → SettingsDialog-B1J5u_Ns.js} +6 -6
- package/dist/web/assets/{TerminalPanel-BT5ai_QP.js → TerminalPanel-BWwDblXt.js} +1 -1
- package/dist/web/assets/{TextViewer-BEtDY7QZ.js → TextViewer-DsQWUVeF.js} +1 -1
- package/dist/web/assets/{VideoViewer-DsNLEt3Q.js → VideoViewer-lRbB3YI1.js} +1 -1
- package/dist/web/assets/{ViewersPanel-BQDubxVN.js → ViewersPanel-DEMFfqRy.js} +1 -1
- package/dist/web/assets/{href-resolution-mWbiAWb5.js → href-resolution-CfEJwBz3.js} +1 -1
- package/dist/web/assets/{index-C_17Gn7C.css → index-D0vOQcoX.css} +1 -1
- package/dist/web/assets/index-UMN9kelm.js +19 -0
- package/dist/web/assets/{markdown-D1SSpG2J.js → markdown-CB3yWTpJ.js} +1 -1
- package/dist/web/assets/{use-file-download-hogFXJ1-.js → use-file-download-uF5qOkxO.js} +1 -1
- package/dist/web/assets/{use-file-watch-RCm9-VVB.js → use-file-watch-Ct-kCO-0.js} +1 -1
- package/dist/web/assets/{use-provider-auth-list-Dlczxxvd.js → use-provider-auth-list-4Hw9XtBB.js} +1 -1
- package/dist/web/assets/vendor-overlays-3MkedLFU.js +1 -0
- package/dist/web/index.html +3 -3
- package/package.json +3 -3
- package/dist/web/assets/ChatPanel-B8AiSd3V.css +0 -1
- package/dist/web/assets/ChatPanel-CirFvAuS.js +0 -8
- package/dist/web/assets/ModelProvidersPanel-BKWs9cUE.js +0 -1
- package/dist/web/assets/index-T-iCQirw.js +0 -19
- package/dist/web/assets/vendor-overlays-ar75LZPp.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-IS9aUP88.js","assets/vendor-DaF96HbP.js","assets/vendor-react-DQUAl2K8.js","assets/vendor-CEK31ho9.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as L}from"./vendor-DaF96HbP.js";import{r as m,j as s}from"./vendor-react-DQUAl2K8.js";import{e as N,u as _,w as H,x as P,t as $,o as b,S as F,y as I,z as E,A as R}from"./index-
|
|
2
|
+
import{_ as L}from"./vendor-DaF96HbP.js";import{r as m,j as s}from"./vendor-react-DQUAl2K8.js";import{e as N,u as _,w as H,x as P,t as $,o as b,S as F,y as I,z as E,A as R}from"./index-UMN9kelm.js";import{c as D}from"./vendor-highlight-Ddi_n-Jh.js";import{r as y}from"./href-resolution-CfEJwBz3.js";import{M as V,r as A,a as U,b as O}from"./vendor-markdown-DJUOT8ep.js";const M="github-dark";let k=null;const j=new Set(["plaintext"]);function B(){return k||(k=D({themes:[M],langs:["plaintext"]})),k}async function z(r,e){if(j.has(e))return e;try{return await r.loadLanguage(e),j.add(e),e}catch{return"plaintext"}}async function G(r,e){const t=await B(),n=await z(t,e);return t.codeToHtml(r,{lang:n,theme:M})}const v={background:"--pi-color-surface1",primaryColor:"--pi-color-surface2",primaryTextColor:"--pi-color-foreground",primaryBorderColor:"--pi-color-surface3",lineColor:"--pi-color-foregroundMuted",secondaryColor:"--pi-color-surface3",secondaryTextColor:"--pi-color-foreground",secondaryBorderColor:"--pi-color-surface4",tertiaryColor:"--pi-color-surface1",tertiaryTextColor:"--pi-color-foreground",tertiaryBorderColor:"--pi-color-surface3",textColor:"--pi-color-foreground"};function K(r){var t;const e={};for(const[n,a]of Object.entries(v)){const o=(t=r[a])==null?void 0:t.trim();o&&(e[n]=o)}return e}function Y(){const r=getComputedStyle(document.documentElement),e={};for(const t of Object.values(v))e[t]=r.getPropertyValue(t);return K(e)}const Z="_prose_1697a_1",q="_streaming_1697a_26",W="_inlineCode_1697a_87",J="_mermaid_1697a_105",Q="_mermaidError_1697a_114",X="_mermaidErrorMessage_1697a_117",ee="_inlineImage_1697a_148",te="_inlineImageSkeleton_1697a_157",re="_inlineImageFallback_1697a_168",d={prose:Z,streaming:q,inlineCode:W,mermaid:J,mermaidError:Q,mermaidErrorMessage:X,inlineImage:ee,inlineImageSkeleton:te,inlineImageFallback:re},ne={"http:":!0,"https:":!0,"data:":!0,"blob:":!0},ae=/^([a-zA-Z][a-zA-Z0-9+.-]*):/;function oe(r,e,t){const n=r.trim();if(!n)return{kind:"unresolvable"};const a=n.split(/[?#]/,1)[0];if(!a)return{kind:"unresolvable"};const o=ae.exec(a);if(o)return`${o[1].toLowerCase()}:`in ne?{kind:"remote"}:{kind:"unresolvable"};const i=y(r,e,t);return i?N(i)!=="image"?{kind:"unresolvable"}:{kind:"local",path:i}:{kind:"unresolvable"}}function se(r,e,t,n){return r.kind==="remote"?{kind:"remote",src:t||"",alt:n}:r.kind==="unresolvable"?{kind:"unresolvable",fallbackText:n||t||"(image)"}:e.status==="loading"||e.status==="idle"?{kind:"loading"}:e.status==="ready"?{kind:"ready",objectUrl:e.objectUrl,alt:n,path:r.path}:{kind:"error",fallbackText:n||r.path||"(image)"}}function C(r,e,t){return{workspaceCwd:t??(r||"~"),targetPaneId:e??void 0}}function ie(r,e,t){if(!r||!e){t({status:"idle"});return}let n=!1;return t({status:"loading"}),H(r,e).then(a=>{n||t({status:"ready",objectUrl:a.objectUrl})}).catch(a=>{n||t({status:"error",message:a instanceof Error?a.message:String(a)})}),()=>{n=!0,P(r)}}function le(r){const e=_(o=>o.client),t=_(o=>o.daemon),[n,a]=m.useState({status:"idle"});return m.useEffect(()=>ie(r,e&&t?i=>$(t).download(i):null,a),[e,t,r]),n}const ce=m.memo(function({src:e,alt:t,assetBase:n,owningPaneId:a,workspaceCwd:o}){const i=b(),u=m.useMemo(()=>oe(e||"",n,i),[e,n,i]),c=le(u.kind==="local"?u.path:null),l=se(u,c,e,t);if(l.kind==="remote")return s.jsx("img",{src:l.src,alt:l.alt,className:d.inlineImage});if(l.kind==="unresolvable"||l.kind==="error")return s.jsx("code",{className:d.inlineImageFallback,children:l.fallbackText});if(l.kind==="loading")return s.jsx("div",{className:d.inlineImageSkeleton,children:s.jsx(F,{size:"sm"})});const g=C(n,a??null,o??null),p=()=>{E(l.path,g.workspaceCwd,g.targetPaneId)};return s.jsx("img",{src:l.objectUrl,alt:l.alt,className:d.inlineImage,title:l.path,draggable:!0,onDragStart:I(l.path),onClick:p,style:{cursor:"pointer"}})});function ue(r,e,t){const n=r.trim();if(!n)return{kind:"external"};if(n.startsWith("#"))return{kind:"external"};const a=y(r,e,t);return a?{kind:"local",path:a}:{kind:"external"}}function de({href:r,children:e,assetBase:t,owningPaneId:n,workspaceCwd:a}){const o=b(),i=ue(r??"",t,o);if(i.kind==="external")return s.jsx("a",{href:r,children:e});const u=i.path,c=C(t,n,a);return s.jsx("a",{href:r,draggable:!0,onDragStart:I(u),onClick:l=>{l.preventDefault(),E(u,c.workspaceCwd,c.targetPaneId)},children:e})}const S=/^ {0,3}([-*+]|\d{1,9}[.)])(\s|$)/,me=/^(\s*)(`{3,}|~{3,})(.*)$/;function fe(r){return S.test(r[0]??"")}function ge(r,e){for(let t=e;t<r.length;t++)if((r[t]??"").trim()!=="")return t;return-1}function pe(r){if(!r)return{blocks:[],tail:""};const e=r.split(`
|
|
3
3
|
`),t=[];let n=[],a=null,o=!1,i=!1;const u=()=>{const c=n.join(`
|
|
4
4
|
`).trim();c&&t.push(c),n=[]};for(let c=0;c<e.length;c++){const l=e[c]??"",g=l.trim();if(a!==null){if(n.push(l),a.test(g)){const f=o;a=null,o=!1,f&&u()}continue}const p=me.exec(l);if(p&&!i){const f=p[2];a=new RegExp(`^[${f[0]}]{${f.length},}$`),o=p[1]==="",n.push(l);continue}if(g===""&&n.length===0)continue;if((g.split("$$").length-1)%2===1&&(i=!i),g===""&&!i){const f=ge(e,c+1),h=f===-1?null:e[f]??"",w=h!==null&&!/^\s/.test(h),T=h!==null&&S.test(h)&&fe(n);if(w&&!T){u(),c=f-1;continue}}n.push(l)}return{blocks:t,tail:n.join(`
|
|
5
5
|
`)}}function he({language:r,code:e}){const[t,n]=m.useState(null);return m.useEffect(()=>{let a=!1;return G(e,r).then(o=>{a||n(o)}),()=>{a=!0}},[e,r]),t?s.jsx("div",{className:d.prose,dangerouslySetInnerHTML:{__html:t}}):s.jsx("pre",{children:s.jsx("code",{children:e})})}function ke({code:r}){const[e]=m.useState(()=>`mermaid-${R()}`),[t,n]=m.useState({status:"pending"});return m.useEffect(()=>{let a=!1;return(async()=>{try{const{default:o}=await L(async()=>{const{default:u}=await import("./mermaid.core-IS9aUP88.js").then(c=>c.b0);return{default:u}},__vite__mapDeps([0,1,2,3]));o.initialize({startOnLoad:!1,theme:"base",themeVariables:Y(),securityLevel:"strict",fontFamily:"var(--pi-font-ui)"});const{svg:i}=await o.render(e,r);a||n({status:"ready",svg:i})}catch(o){a||n({status:"error",message:o instanceof Error?o.message:"Failed to render diagram"})}})(),()=>{a=!0}},[e,r]),t.status==="ready"?s.jsx("div",{className:d.mermaid,dangerouslySetInnerHTML:{__html:t.svg}}):t.status==="error"?s.jsxs("div",{className:d.mermaidError,children:[s.jsxs("p",{className:d.mermaidErrorMessage,children:["Failed to render diagram: ",t.message]}),s.jsx("pre",{children:s.jsx("code",{children:r})})]}):s.jsx("pre",{children:s.jsx("code",{children:r})})}function xe({className:r,children:e,...t}){const n=/language-(\w+)/.exec(r??""),a=!!n,o=String(e).replace(/\n$/,"");if(a&&n){const i=n[1]??"plaintext";return i==="mermaid"?s.jsx(ke,{code:o}):s.jsx(he,{language:i,code:o})}return s.jsx("code",{className:d.inlineCode,...t,children:e})}function _e({className:r,children:e,...t}){return/language-(\w+)/.test(r??"")?s.jsx("pre",{children:s.jsx("code",{children:String(e).replace(/\n$/,"")})}):s.jsx("code",{className:d.inlineCode,...t,children:e})}const je=[U,O],be=[A],Ie=[],x=m.memo(function({text:e,assetBase:t=null,owningPaneId:n=null,workspaceCwd:a=null,lean:o=!1}){return s.jsx(V,{remarkPlugins:je,rehypePlugins:o?Ie:be,components:{code:o?_e:xe,img:i=>s.jsx(ce,{...i,assetBase:t,owningPaneId:n,workspaceCwd:a}),a:i=>s.jsx(de,{...i,assetBase:t,owningPaneId:n,workspaceCwd:a})},children:e})});function Te({text:r,assetBase:e,owningPaneId:t,workspaceCwd:n}){return s.jsx("div",{className:d.prose,children:s.jsx(x,{text:r,assetBase:e,owningPaneId:t,workspaceCwd:n})})}function Le({text:r,assetBase:e,owningPaneId:t,workspaceCwd:n}){const{blocks:a,tail:o}=m.useMemo(()=>pe(r),[r]);return s.jsxs("div",{className:`${d.prose} ${d.streaming}`,children:[a.map((i,u)=>s.jsx(x,{text:i,assetBase:e,owningPaneId:t,workspaceCwd:n},u)),o!==""&&s.jsx(x,{text:o,lean:!0,assetBase:e,owningPaneId:t,workspaceCwd:n})]})}export{Te as M,Le as S,C as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./vendor-react-DQUAl2K8.js";import{u as f}from"./vendor-query-i7fr__Xm.js";import{u as i,t as m,r as y}from"./index-
|
|
1
|
+
import{r as a}from"./vendor-react-DQUAl2K8.js";import{u as f}from"./vendor-query-i7fr__Xm.js";import{u as i,t as m,r as y}from"./index-UMN9kelm.js";function p(o,s=!0){var u;const l=i(e=>e.client),n=i(e=>e.daemon),c=f({queryKey:y.fileDownload(o),queryFn:async()=>{if(!l||!n)throw new Error("not connected");const e=await m(n).download(o),t=new Blob([Uint8Array.from(e.bytes)],{type:e.mimeType||"application/octet-stream"});return{objectUrl:URL.createObjectURL(t),mimeType:e.mimeType,fileName:e.fileName}},enabled:!!l&&!!n&&!!o&&s,staleTime:1/0,gcTime:0}),r=a.useRef(null);return a.useEffect(()=>{var t;const e=((t=c.data)==null?void 0:t.objectUrl)??null;e&&r.current&&r.current!==e&&URL.revokeObjectURL(r.current),r.current=e},[(u=c.data)==null?void 0:u.objectUrl]),a.useEffect(()=>()=>{r.current&&URL.revokeObjectURL(r.current)},[]),c}export{p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./vendor-react-DQUAl2K8.js";import{u as w}from"./index-
|
|
1
|
+
import{r as a}from"./vendor-react-DQUAl2K8.js";import{u as w}from"./index-UMN9kelm.js";function b(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="file_changed"&&"path"in e&&typeof e.path=="string"}const l=new WeakMap;function p(e,t,i){let s=l.get(e);s||(s=new Map,l.set(e,s));let o=s.get(t);if(!o){const r={count:0,resolvedPath:null,listeners:new Set,dispose:()=>{}},f=e.connection.onSessionMessage(c=>{const n=c;if(!b(n)||n.path!==t&&n.path!==r.resolvedPath)return;const d=Date.now();for(const h of r.listeners)h(d)});e.connection.request("file_watch_subscribe",{path:t}).then(c=>{const n=c;if((n==null?void 0:n.ok)===!1){console.warn(`watchFile: ${n.error??"subscribe failed"} for "${t}"`);return}typeof(n==null?void 0:n.path)=="string"&&(r.resolvedPath=n.path)}).catch(()=>{}),r.dispose=()=>{f(),e.connection.request("file_watch_unsubscribe",{path:t}).catch(()=>{})},o=r,s.set(t,o)}o.count++,o.listeners.add(i);let u=!1;return()=>{if(u)return;u=!0;const r=s.get(t);r&&(r.listeners.delete(i),r.count--,r.count===0&&(s.delete(t),r.dispose()))}}function v(e){const t=w(o=>o.client),[i,s]=a.useState(null);return a.useEffect(()=>{if(!(!t||!e))return p(t,e,s)},[t,e]),{changedAt:i}}export{v as u};
|
package/dist/web/assets/{use-provider-auth-list-Dlczxxvd.js → use-provider-auth-list-4Hw9XtBB.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o}from"./vendor-query-i7fr__Xm.js";import{u as n,r as u}from"./index-
|
|
1
|
+
import{u as o}from"./vendor-query-i7fr__Xm.js";import{u as n,r as u}from"./index-UMN9kelm.js";function c(e=!0){const r=n(t=>t.client);return o({queryKey:u.providerAuthList(),queryFn:()=>{if(!r)throw new Error("not connected");return r.listProviderAuth()},enabled:!!r&&e})}export{c as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,j as g,R as Fe,a as At}from"./vendor-react-DQUAl2K8.js";import{h as Ot,R as _t}from"./vendor-DaF96HbP.js";function S(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function on(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function lr(...e){return t=>{let n=!1;const o=e.map(r=>{const s=on(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<o.length;r++){const s=o[r];typeof s=="function"?s():on(e[r],null)}}}}function B(...e){return a.useCallback(lr(...e),e)}function ve(e,t=[]){let n=[];function o(s,i){const c=a.createContext(i);c.displayName=s+"Context";const u=n.length;n=[...n,i];const d=l=>{var x;const{scope:m,children:p,...h}=l,v=((x=m==null?void 0:m[e])==null?void 0:x[u])||c,w=a.useMemo(()=>h,Object.values(h));return g.jsx(v.Provider,{value:w,children:p})};d.displayName=s+"Provider";function f(l,m){var v;const p=((v=m==null?void 0:m[e])==null?void 0:v[u])||c,h=a.useContext(p);if(h)return h;if(i!==void 0)return i;throw new Error(`\`${l}\` must be used within \`${s}\``)}return[d,f]}const r=()=>{const s=n.map(i=>a.createContext(i));return function(c){const u=(c==null?void 0:c[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return r.scopeName=e,[o,fr(r,...t)]}function fr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=o.reduce((c,{useScope:u,scopeName:d})=>{const l=u(s)[`__scope${d}`];return{...c,...l}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var ee=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},rn=Fe[" useEffectEvent ".trim().toString()],sn=Fe[" useInsertionEffect ".trim().toString()];function dr(e){if(typeof rn=="function")return rn(e);const t=a.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof sn=="function"?sn(()=>{t.current=e}):ee(()=>{t.current=e}),a.useMemo(()=>((...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)}),[])}var pr=Fe[" useInsertionEffect ".trim().toString()]||ee;function tt({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,i]=mr({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:r;{const f=a.useRef(e!==void 0);a.useEffect(()=>{const l=f.current;l!==c&&console.warn(`${o} is changing from ${l?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,o])}const d=a.useCallback(f=>{var l;if(c){const m=hr(f)?f(e):f;m!==e&&((l=i.current)==null||l.call(i,m))}else s(f)},[c,e,s,i]);return[u,d]}function mr({defaultProp:e,onChange:t}){const[n,o]=a.useState(e),r=a.useRef(n),s=a.useRef(t);return pr(()=>{s.current=t},[t]),a.useEffect(()=>{var i;r.current!==n&&((i=s.current)==null||i.call(s,n),r.current=n)},[n,r]),[n,o,s]}function hr(e){return typeof e=="function"}function Re(e){const t=a.forwardRef((n,o)=>{let{children:r,...s}=n,i=null,c=!1;const u=[];cn(r)&&typeof Ke=="function"&&(r=Ke(r._payload)),a.Children.forEach(r,m=>{var p;if(yr(m)){c=!0;const h=m;let v="child"in h.props?h.props.child:h.props.children;cn(v)&&typeof Ke=="function"&&(v=Ke(v._payload)),i=vr(h,v),u.push((p=i==null?void 0:i.props)==null?void 0:p.children)}else u.push(m)}),i?i=a.cloneElement(i,void 0,u):!c&&a.Children.count(r)===1&&a.isValidElement(r)&&(i=r);const d=i?xr(i):void 0,f=B(o,d);if(!i){if(r||r===0)throw new Error(c?br(e):Er(e));return r}const l=wr(s,i.props??{});return i.type!==a.Fragment&&(l.ref=o?f:d),a.cloneElement(i,l)});return t.displayName=`${e}.Slot`,t}var gr=Symbol.for("radix.slottable"),vr=(e,t)=>{if("child"in e.props){const n=e.props.child;return a.isValidElement(n)?a.cloneElement(n,void 0,e.props.children(n.props.children)):null}return a.isValidElement(t)?t:null};function wr(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const u=s(...c);return r(...c),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function xr(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function yr(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gr}var Rr=Symbol.for("react.lazy");function cn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Rr&&"_payload"in e&&Cr(e._payload)}function Cr(e){return typeof e=="object"&&e!==null&&"then"in e}var Er=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,br=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Ke=Fe[" use ".trim().toString()],Pr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],k=Pr.reduce((e,t)=>{const n=Re(`Primitive.${t}`),o=a.forwardRef((r,s)=>{const{asChild:i,...c}=r,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(u,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function An(e,t){e&&At.flushSync(()=>e.dispatchEvent(t))}function On(e){const t=e+"CollectionProvider",[n,o]=ve(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:w,children:x}=v,R=a.useRef(null),y=a.useRef(new Map).current;return g.jsx(r,{scope:w,itemMap:y,collectionRef:R,children:x})};i.displayName=t;const c=e+"CollectionSlot",u=Re(c),d=a.forwardRef((v,w)=>{const{scope:x,children:R}=v,y=s(c,x),C=B(w,y.collectionRef);return g.jsx(u,{ref:C,children:R})});d.displayName=c;const f=e+"CollectionItemSlot",l="data-radix-collection-item",m=Re(f),p=a.forwardRef((v,w)=>{const{scope:x,children:R,...y}=v,C=a.useRef(null),b=B(w,C),P=s(f,x);return a.useEffect(()=>(P.itemMap.set(C,{ref:C,...y}),()=>void P.itemMap.delete(C))),g.jsx(m,{[l]:"",ref:b,children:R})});p.displayName=f;function h(v){const w=s(e+"CollectionConsumer",v);return a.useCallback(()=>{const R=w.collectionRef.current;if(!R)return[];const y=Array.from(R.querySelectorAll(`[${l}]`));return Array.from(w.itemMap.values()).sort((P,O)=>y.indexOf(P.ref.current)-y.indexOf(O.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:i,Slot:d,ItemSlot:p},h,o]}var Sr=a.createContext(void 0);function _n(e){const t=a.useContext(Sr);return e||t||"ltr"}function ue(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>((...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)}),[])}var Mr="DismissableLayer",Ct="dismissableLayer.update",Ar="dismissableLayer.pointerDownOutside",Or="dismissableLayer.focusOutside",an,Dt=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nt=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,onDismiss:u,...d}=e,f=a.useContext(Dt),[l,m]=a.useState(null),p=(l==null?void 0:l.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=a.useState({}),v=B(t,m),w=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),R=w.indexOf(x),y=l?w.indexOf(l):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,b=y>=R,P=a.useRef(!1),O=Tr(A=>{const F=A.target;if(!(F instanceof Node))return;const N=[...f.branches].some(I=>I.contains(F));!b||N||(s==null||s(A),c==null||c(A),A.defaultPrevented||u==null||u())},{ownerDocument:p,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:P,dismissableSurfaces:f.dismissableSurfaces}),_=Nr(A=>{if(o&&P.current)return;const F=A.target;[...f.branches].some(I=>I.contains(F))||(i==null||i(A),c==null||c(A),A.defaultPrevented||u==null||u())},p),L=l?y===w.length-1:!1,T=dr(A=>{A.key==="Escape"&&(r==null||r(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))});return a.useEffect(()=>{if(L)return p.addEventListener("keydown",T,{capture:!0}),()=>p.removeEventListener("keydown",T,{capture:!0})},[p,L]),a.useEffect(()=>{if(l)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(an=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(l)),f.layers.add(l),un(),()=>{n&&(f.layersWithOutsidePointerEventsDisabled.delete(l),f.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=an))}},[l,p,n,f]),a.useEffect(()=>()=>{l&&(f.layers.delete(l),f.layersWithOutsidePointerEventsDisabled.delete(l),un())},[l,f]),a.useEffect(()=>{const A=()=>h({});return document.addEventListener(Ct,A),()=>document.removeEventListener(Ct,A)},[]),g.jsx(k.div,{...d,ref:v,style:{pointerEvents:C?b?"auto":"none":void 0,...e.style},onFocusCapture:S(e.onFocusCapture,_.onFocusCapture),onBlurCapture:S(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:S(e.onPointerDownCapture,O.onPointerDownCapture)})});nt.displayName=Mr;var _r="DismissableLayerBranch",Dr=a.forwardRef((e,t)=>{const n=a.useContext(Dt),o=a.useRef(null),r=B(t,o);return a.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),g.jsx(k.div,{...e,ref:r})});Dr.displayName=_r;function Ir(){const e=a.useContext(Dt),[t,n]=a.useState(null);return a.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function Tr(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s}=t,i=ue(e),c=a.useRef(!1),u=a.useRef(!1),d=a.useRef(new Map),f=a.useRef(()=>{});return a.useEffect(()=>{function l(){u.current=!1,r.current=!1,d.current.clear()}function m(){return Array.from(d.current.values()).some(Boolean)}function p(R){if(!u.current)return;const y=R.target;y instanceof Node&&[...s].some(b=>b.contains(y))||d.current.set(R.type,!0),R.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}function h(R){u.current&&d.current.set(R.type,!1)}const v=R=>{if(R.target&&!c.current){let y=function(){n.removeEventListener("click",f.current);const b=m();l(),b||Dn(Ar,i,C,{discrete:!0})};const C={originalEvent:R};u.current=!0,r.current=o&&R.button===0,d.current.clear(),!o||R.button!==0?y():(n.removeEventListener("click",f.current),f.current=y,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),l();c.current=!1},w=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const R of w)n.addEventListener(R,p,!0),n.addEventListener(R,h);const x=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(x),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const R of w)n.removeEventListener(R,p,!0),n.removeEventListener(R,h)}},[n,i,o,r,s]),{onPointerDownCapture:()=>c.current=!0}}function Nr(e,t=globalThis==null?void 0:globalThis.document){const n=ue(e),o=a.useRef(!1);return a.useEffect(()=>{const r=s=>{s.target&&!o.current&&Dn(Or,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function un(){const e=new CustomEvent(Ct);document.dispatchEvent(e)}function Dn(e,t,n,{discrete:o}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?An(r,s):r.dispatchEvent(s)}var Ge=0,J=null;function It(){a.useEffect(()=>{J||(J={start:ln(),end:ln()});const{start:e,end:t}=J;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Ge++,()=>{Ge===1&&(J==null||J.start.remove(),J==null||J.end.remove(),J=null),Ge=Math.max(0,Ge-1)}},[])}function ln(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var gt="focusScope.autoFocusOnMount",vt="focusScope.autoFocusOnUnmount",fn={bubbles:!1,cancelable:!0},Fr="FocusScope",ot=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...i}=e,[c,u]=a.useState(null),d=ue(r),f=ue(s),l=a.useRef(null),m=B(t,u),p=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let v=function(y){if(p.paused||!c)return;const C=y.target;c.contains(C)?l.current=C:ae(l.current,{select:!0})},w=function(y){if(p.paused||!c)return;const C=y.relatedTarget;C!==null&&(c.contains(C)||ae(l.current,{select:!0}))},x=function(y){if(document.activeElement===document.body)for(const b of y)b.removedNodes.length>0&&ae(c)};document.addEventListener("focusin",v),document.addEventListener("focusout",w);const R=new MutationObserver(x);return c&&R.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),R.disconnect()}}},[o,c,p.paused]),a.useEffect(()=>{if(c){pn.add(p);const v=document.activeElement;if(!c.contains(v)){const x=new CustomEvent(gt,fn);c.addEventListener(gt,d),c.dispatchEvent(x),x.defaultPrevented||(Lr(Ur(In(c)),{select:!0}),document.activeElement===v&&ae(c))}return()=>{c.removeEventListener(gt,d),setTimeout(()=>{const x=new CustomEvent(vt,fn);c.addEventListener(vt,f),c.dispatchEvent(x),x.defaultPrevented||ae(v??document.body,{select:!0}),c.removeEventListener(vt,f),pn.remove(p)},0)}}},[c,d,f,p]);const h=a.useCallback(v=>{if(!n&&!o||p.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(w&&x){const R=v.currentTarget,[y,C]=jr(R);y&&C?!v.shiftKey&&x===C?(v.preventDefault(),n&&ae(y,{select:!0})):v.shiftKey&&x===y&&(v.preventDefault(),n&&ae(C,{select:!0})):x===R&&v.preventDefault()}},[n,o,p.paused]);return g.jsx(k.div,{tabIndex:-1,...i,ref:m,onKeyDown:h})});ot.displayName=Fr;function Lr(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ae(o,{select:t}),document.activeElement!==n)return}function jr(e){const t=In(e),n=dn(t,e),o=dn(t.reverse(),e);return[n,o]}function In(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dn(e,t){for(const n of e)if(!kr(n,{upTo:t}))return n}function kr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function $r(e){return e instanceof HTMLInputElement&&"select"in e}function ae(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&$r(e)&&t&&e.select()}}var pn=Br();function Br(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=mn(e,t),e.unshift(t)},remove(t){var n;e=mn(e,t),(n=e[0])==null||n.resume()}}}function mn(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Ur(e){return e.filter(t=>t.tagName!=="A")}var Wr=Fe[" useId ".trim().toString()]||(()=>{}),Kr=0;function he(e){const[t,n]=a.useState(Wr());return ee(()=>{n(o=>o??String(Kr++))},[e]),e||(t?`radix-${t}`:"")}const Gr=["top","right","bottom","left"],le=Math.min,V=Math.max,Ye=Math.round,Ve=Math.floor,te=e=>({x:e,y:e}),Vr={left:"right",right:"left",bottom:"top",top:"bottom"};function Et(e,t,n){return V(e,le(t,n))}function re(e,t){return typeof e=="function"?e(t):e}function se(e){return e.split("-")[0]}function Pe(e){return e.split("-")[1]}function Tt(e){return e==="x"?"y":"x"}function Nt(e){return e==="y"?"height":"width"}function Q(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ft(e){return Tt(Q(e))}function Hr(e,t,n){n===void 0&&(n=!1);const o=Pe(e),r=Ft(e),s=Nt(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Xe(i)),[i,Xe(i)]}function zr(e){const t=Xe(e);return[bt(e),t,bt(t)]}function bt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const hn=["left","right"],gn=["right","left"],Yr=["top","bottom"],Xr=["bottom","top"];function Zr(e,t,n){switch(e){case"top":case"bottom":return n?t?gn:hn:t?hn:gn;case"left":case"right":return t?Yr:Xr;default:return[]}}function qr(e,t,n,o){const r=Pe(e);let s=Zr(se(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(bt)))),s}function Xe(e){const t=se(e);return Vr[t]+e.slice(t.length)}function Jr(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tn(e){return typeof e!="number"?Jr(e):{top:e,right:e,bottom:e,left:e}}function Ze(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function vn(e,t,n){let{reference:o,floating:r}=e;const s=Q(t),i=Ft(t),c=Nt(i),u=se(t),d=s==="y",f=o.x+o.width/2-r.width/2,l=o.y+o.height/2-r.height/2,m=o[c]/2-r[c]/2;let p;switch(u){case"top":p={x:f,y:o.y-r.height};break;case"bottom":p={x:f,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:l};break;case"left":p={x:o.x-r.width,y:l};break;default:p={x:o.x,y:o.y}}switch(Pe(t)){case"start":p[i]-=m*(n&&d?-1:1);break;case"end":p[i]+=m*(n&&d?-1:1);break}return p}async function Qr(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:l="floating",altBoundary:m=!1,padding:p=0}=re(t,e),h=Tn(p),w=c[m?l==="floating"?"reference":"floating":l],x=Ze(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:f,strategy:u})),R=l==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),C=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},b=Ze(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:R,offsetParent:y,strategy:u}):R);return{top:(x.top-b.top+h.top)/C.y,bottom:(b.bottom-x.bottom+h.bottom)/C.y,left:(x.left-b.left+h.left)/C.x,right:(b.right-x.right+h.right)/C.x}}const es=50,ts=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:Qr},u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:l}=vn(d,o,u),m=o,p=0;const h={};for(let v=0;v<s.length;v++){const w=s[v];if(!w)continue;const{name:x,fn:R}=w,{x:y,y:C,data:b,reset:P}=await R({x:f,y:l,initialPlacement:o,placement:m,strategy:r,middlewareData:h,rects:d,platform:c,elements:{reference:e,floating:t}});f=y??f,l=C??l,h[x]={...h[x],...b},P&&p<es&&(p++,typeof P=="object"&&(P.placement&&(m=P.placement),P.rects&&(d=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):P.rects),{x:f,y:l}=vn(d,m,u)),v=-1)}return{x:f,y:l,placement:m,strategy:r,middlewareData:h}},ns=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:u}=t,{element:d,padding:f=0}=re(e,t)||{};if(d==null)return{};const l=Tn(f),m={x:n,y:o},p=Ft(r),h=Nt(p),v=await i.getDimensions(d),w=p==="y",x=w?"top":"left",R=w?"bottom":"right",y=w?"clientHeight":"clientWidth",C=s.reference[h]+s.reference[p]-m[p]-s.floating[h],b=m[p]-s.reference[p],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let O=P?P[y]:0;(!O||!await(i.isElement==null?void 0:i.isElement(P)))&&(O=c.floating[y]||s.floating[h]);const _=C/2-b/2,L=O/2-v[h]/2-1,T=le(l[x],L),A=le(l[R],L),F=T,N=O-v[h]-A,I=O/2-v[h]/2+_,U=Et(F,I,N),D=!u.arrow&&Pe(r)!=null&&I!==U&&s.reference[h]/2-(I<F?T:A)-v[h]/2<0,$=D?I<F?I-F:I-N:0;return{[p]:m[p]+$,data:{[p]:U,centerOffset:I-U-$,...D&&{alignmentOffset:$}},reset:D}}}),os=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:l=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...w}=re(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=se(r),R=Q(c),y=se(c)===c,C=await(u.isRTL==null?void 0:u.isRTL(d.floating)),b=m||(y||!v?[Xe(c)]:zr(c)),P=h!=="none";!m&&P&&b.push(...qr(c,v,h,C));const O=[c,...b],_=await u.detectOverflow(t,w),L=[];let T=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&L.push(_[x]),l){const I=Hr(r,i,C);L.push(_[I[0]],_[I[1]])}if(T=[...T,{placement:r,overflows:L}],!L.every(I=>I<=0)){var A,F;const I=(((A=s.flip)==null?void 0:A.index)||0)+1,U=O[I];if(U&&(!(l==="alignment"?R!==Q(U):!1)||T.every(M=>Q(M.placement)===R?M.overflows[0]>0:!0)))return{data:{index:I,overflows:T},reset:{placement:U}};let D=(F=T.filter($=>$.overflows[0]<=0).sort(($,M)=>$.overflows[1]-M.overflows[1])[0])==null?void 0:F.placement;if(!D)switch(p){case"bestFit":{var N;const $=(N=T.filter(M=>{if(P){const E=Q(M.placement);return E===R||E==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(E=>E>0).reduce((E,j)=>E+j,0)]).sort((M,E)=>M[1]-E[1])[0])==null?void 0:N[0];$&&(D=$);break}case"initialPlacement":D=c;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function wn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xn(e){return Gr.some(t=>e[t]>=0)}const rs=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=re(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=wn(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:xn(c)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),c=wn(i,n.floating);return{data:{escapedOffsets:c,escaped:xn(c)}}}default:return{}}}}},Nn=new Set(["left","top"]);async function ss(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=se(n),c=Pe(n),u=Q(n)==="y",d=Nn.has(i)?-1:1,f=s&&u?-1:1,l=re(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:h}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return c&&typeof h=="number"&&(p=c==="end"?h*-1:h),u?{x:p*f,y:m*d}:{x:m*d,y:p*f}}const is=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,u=await ss(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+u.x,y:s+u.y,data:{...u,placement:i}}}}},cs=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:u={fn:x=>{let{x:R,y}=x;return{x:R,y}}},...d}=re(e,t),f={x:n,y:o},l=await s.detectOverflow(t,d),m=Q(se(r)),p=Tt(m);let h=f[p],v=f[m];if(i){const x=p==="y"?"top":"left",R=p==="y"?"bottom":"right",y=h+l[x],C=h-l[R];h=Et(y,h,C)}if(c){const x=m==="y"?"top":"left",R=m==="y"?"bottom":"right",y=v+l[x],C=v-l[R];v=Et(y,v,C)}const w=u.fn({...t,[p]:h,[m]:v});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[p]:i,[m]:c}}}}}},as=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=re(e,t),f={x:n,y:o},l=Q(r),m=Tt(l);let p=f[m],h=f[l];const v=re(c,t),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const y=m==="y"?"height":"width",C=s.reference[m]-s.floating[y]+w.mainAxis,b=s.reference[m]+s.reference[y]-w.mainAxis;p<C?p=C:p>b&&(p=b)}if(d){var x,R;const y=m==="y"?"width":"height",C=Nn.has(se(r)),b=s.reference[l]-s.floating[y]+(C&&((x=i.offset)==null?void 0:x[l])||0)+(C?0:w.crossAxis),P=s.reference[l]+s.reference[y]+(C?0:((R=i.offset)==null?void 0:R[l])||0)-(C?w.crossAxis:0);h<b?h=b:h>P&&(h=P)}return{[m]:p,[l]:h}}}},us=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:c}=t,{apply:u=()=>{},...d}=re(e,t),f=await i.detectOverflow(t,d),l=se(r),m=Pe(r),p=Q(r)==="y",{width:h,height:v}=s.floating;let w,x;l==="top"||l==="bottom"?(w=l,x=m===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(x=l,w=m==="end"?"top":"bottom");const R=v-f.top-f.bottom,y=h-f.left-f.right,C=le(v-f[w],R),b=le(h-f[x],y),P=!t.middlewareData.shift;let O=C,_=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=y),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(O=R),P&&!m){const T=V(f.left,0),A=V(f.right,0),F=V(f.top,0),N=V(f.bottom,0);p?_=h-2*(T!==0||A!==0?T+A:V(f.left,f.right)):O=v-2*(F!==0||N!==0?F+N:V(f.top,f.bottom))}await u({...t,availableWidth:_,availableHeight:O});const L=await i.getDimensions(c.floating);return h!==L.width||v!==L.height?{reset:{rects:!0}}:{}}}};function rt(){return typeof window<"u"}function Se(e){return Fn(e)?(e.nodeName||"").toLowerCase():"#document"}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ne(e){var t;return(t=(Fn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Fn(e){return rt()?e instanceof Node||e instanceof H(e).Node:!1}function X(e){return rt()?e instanceof Element||e instanceof H(e).Element:!1}function ie(e){return rt()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function yn(e){return!rt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function Le(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Z(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function ls(e){return/^(table|td|th)$/.test(Se(e))}function st(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const fs=/transform|translate|scale|rotate|perspective|filter/,ds=/paint|layout|strict|content/,me=e=>!!e&&e!=="none";let wt;function Lt(e){const t=X(e)?Z(e):e;return me(t.transform)||me(t.translate)||me(t.scale)||me(t.rotate)||me(t.perspective)||!jt()&&(me(t.backdropFilter)||me(t.filter))||fs.test(t.willChange||"")||ds.test(t.contain||"")}function ps(e){let t=fe(e);for(;ie(t)&&!Ce(t);){if(Lt(t))return t;if(st(t))return null;t=fe(t)}return null}function jt(){return wt==null&&(wt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wt}function Ce(e){return/^(html|body|#document)$/.test(Se(e))}function Z(e){return H(e).getComputedStyle(e)}function it(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fe(e){if(Se(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yn(e)&&e.host||ne(e);return yn(t)?t.host:t}function Ln(e){const t=fe(e);return Ce(t)?e.ownerDocument?e.ownerDocument.body:e.body:ie(t)&&Le(t)?t:Ln(t)}function Ie(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Ln(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=H(r);if(s){const c=Pt(i);return t.concat(i,i.visualViewport||[],Le(r)?r:[],c&&n?Ie(c):[])}else return t.concat(r,Ie(r,[],n))}function Pt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jn(e){const t=Z(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ie(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=Ye(n)!==s||Ye(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function kt(e){return X(e)?e:e.contextElement}function ye(e){const t=kt(e);if(!ie(t))return te(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=jn(t);let i=(s?Ye(n.width):n.width)/o,c=(s?Ye(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const ms=te(0);function kn(e){const t=H(e);return!jt()||!t.visualViewport?ms:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==H(e)?!1:t}function ge(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=kt(e);let i=te(1);t&&(o?X(o)&&(i=ye(o)):i=ye(e));const c=hs(s,n,o)?kn(s):te(0);let u=(r.left+c.x)/i.x,d=(r.top+c.y)/i.y,f=r.width/i.x,l=r.height/i.y;if(s){const m=H(s),p=o&&X(o)?H(o):o;let h=m,v=Pt(h);for(;v&&o&&p!==h;){const w=ye(v),x=v.getBoundingClientRect(),R=Z(v),y=x.left+(v.clientLeft+parseFloat(R.paddingLeft))*w.x,C=x.top+(v.clientTop+parseFloat(R.paddingTop))*w.y;u*=w.x,d*=w.y,f*=w.x,l*=w.y,u+=y,d+=C,h=H(v),v=Pt(h)}}return Ze({width:f,height:l,x:u,y:d})}function ct(e,t){const n=it(e).scrollLeft;return t?t.left+n:ge(ne(e)).left+n}function $n(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-ct(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function gs(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=ne(o),c=t?st(t.floating):!1;if(o===i||c&&s)return n;let u={scrollLeft:0,scrollTop:0},d=te(1);const f=te(0),l=ie(o);if((l||!l&&!s)&&((Se(o)!=="body"||Le(i))&&(u=it(o)),l)){const p=ge(o);d=ye(o),f.x=p.x+o.clientLeft,f.y=p.y+o.clientTop}const m=i&&!l&&!s?$n(i,u):te(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-u.scrollTop*d.y+f.y+m.y}}function vs(e){return Array.from(e.getClientRects())}function ws(e){const t=ne(e),n=it(e),o=e.ownerDocument.body,r=V(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=V(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+ct(e);const c=-n.scrollTop;return Z(o).direction==="rtl"&&(i+=V(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const Rn=25;function xs(e,t){const n=H(e),o=ne(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,u=0;if(r){s=r.width,i=r.height;const f=jt();(!f||f&&t==="fixed")&&(c=r.offsetLeft,u=r.offsetTop)}const d=ct(o);if(d<=0){const f=o.ownerDocument,l=f.body,m=getComputedStyle(l),p=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(o.clientWidth-l.clientWidth-p);h<=Rn&&(s-=h)}else d<=Rn&&(s+=d);return{width:s,height:i,x:c,y:u}}function ys(e,t){const n=ge(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=ie(e)?ye(e):te(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,u=r*s.x,d=o*s.y;return{width:i,height:c,x:u,y:d}}function Cn(e,t,n){let o;if(t==="viewport")o=xs(e,n);else if(t==="document")o=ws(ne(e));else if(X(t))o=ys(t,n);else{const r=kn(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ze(o)}function Bn(e,t){const n=fe(e);return n===t||!X(n)||Ce(n)?!1:Z(n).position==="fixed"||Bn(n,t)}function Rs(e,t){const n=t.get(e);if(n)return n;let o=Ie(e,[],!1).filter(c=>X(c)&&Se(c)!=="body"),r=null;const s=Z(e).position==="fixed";let i=s?fe(e):e;for(;X(i)&&!Ce(i);){const c=Z(i),u=Lt(i);!u&&c.position==="fixed"&&(r=null),(s?!u&&!r:!u&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Le(i)&&!u&&Bn(e,i))?o=o.filter(f=>f!==i):r=c,i=fe(i)}return t.set(e,o),o}function Cs(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?st(t)?[]:Rs(t,this._c):[].concat(n),o],c=Cn(t,i[0],r);let u=c.top,d=c.right,f=c.bottom,l=c.left;for(let m=1;m<i.length;m++){const p=Cn(t,i[m],r);u=V(p.top,u),d=le(p.right,d),f=le(p.bottom,f),l=V(p.left,l)}return{width:d-l,height:f-u,x:l,y:u}}function Es(e){const{width:t,height:n}=jn(e);return{width:t,height:n}}function bs(e,t,n){const o=ie(t),r=ne(t),s=n==="fixed",i=ge(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=te(0);function d(){u.x=ct(r)}if(o||!o&&!s)if((Se(t)!=="body"||Le(r))&&(c=it(t)),o){const p=ge(t,!0,s,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else r&&d();s&&!o&&r&&d();const f=r&&!o&&!s?$n(r,c):te(0),l=i.left+c.scrollLeft-u.x-f.x,m=i.top+c.scrollTop-u.y-f.y;return{x:l,y:m,width:i.width,height:i.height}}function xt(e){return Z(e).position==="static"}function En(e,t){if(!ie(e)||Z(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ne(e)===n&&(n=n.ownerDocument.body),n}function Un(e,t){const n=H(e);if(st(e))return n;if(!ie(e)){let r=fe(e);for(;r&&!Ce(r);){if(X(r)&&!xt(r))return r;r=fe(r)}return n}let o=En(e,t);for(;o&&ls(o)&&xt(o);)o=En(o,t);return o&&Ce(o)&&xt(o)&&!Lt(o)?n:o||ps(e)||n}const Ps=async function(e){const t=this.getOffsetParent||Un,n=this.getDimensions,o=await n(e.floating);return{reference:bs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ss(e){return Z(e).direction==="rtl"}const Ms={convertOffsetParentRelativeRectToViewportRelativeRect:gs,getDocumentElement:ne,getClippingRect:Cs,getOffsetParent:Un,getElementRects:Ps,getClientRects:vs,getDimensions:Es,getScale:ye,isElement:X,isRTL:Ss};function Wn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function As(e,t){let n=null,o;const r=ne(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:f,top:l,width:m,height:p}=d;if(c||t(),!m||!p)return;const h=Ve(l),v=Ve(r.clientWidth-(f+m)),w=Ve(r.clientHeight-(l+p)),x=Ve(f),y={rootMargin:-h+"px "+-v+"px "+-w+"px "+-x+"px",threshold:V(0,le(1,u))||1};let C=!0;function b(P){const O=P[0].intersectionRatio;if(O!==u){if(!C)return i();O?i(!1,O):o=setTimeout(()=>{i(!1,1e-7)},1e3)}O===1&&!Wn(d,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(b,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(b,y)}n.observe(e)}return i(!0),s}function Os(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,d=kt(e),f=r||s?[...d?Ie(d):[],...t?Ie(t):[]]:[];f.forEach(x=>{r&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const l=d&&c?As(d,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(x=>{let[R]=x;R&&R.target===d&&p&&t&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),n()}),d&&!u&&p.observe(d),t&&p.observe(t));let h,v=u?ge(e):null;u&&w();function w(){const x=ge(e);v&&!Wn(v,x)&&n(),v=x,h=requestAnimationFrame(w)}return n(),()=>{var x;f.forEach(R=>{r&&R.removeEventListener("scroll",n),s&&R.removeEventListener("resize",n)}),l==null||l(),(x=p)==null||x.disconnect(),p=null,u&&cancelAnimationFrame(h)}}const _s=is,Ds=cs,Is=os,Ts=us,Ns=rs,bn=ns,Fs=as,Ls=(e,t,n)=>{const o=new Map,r={platform:Ms,...n},s={...r.platform,_c:o};return ts(e,t,{...r,platform:s})};var js=typeof document<"u",ks=function(){},ze=js?a.useLayoutEffect:ks;function qe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!qe(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!qe(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Kn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pn(e,t){const n=Kn(e);return Math.round(t*n)/n}function yt(e){const t=a.useRef(e);return ze(()=>{t.current=e}),t}function $s(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,l]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=a.useState(o);qe(m,o)||p(o);const[h,v]=a.useState(null),[w,x]=a.useState(null),R=a.useCallback(M=>{M!==P.current&&(P.current=M,v(M))},[]),y=a.useCallback(M=>{M!==O.current&&(O.current=M,x(M))},[]),C=s||h,b=i||w,P=a.useRef(null),O=a.useRef(null),_=a.useRef(f),L=u!=null,T=yt(u),A=yt(r),F=yt(d),N=a.useCallback(()=>{if(!P.current||!O.current)return;const M={placement:t,strategy:n,middleware:m};A.current&&(M.platform=A.current),Ls(P.current,O.current,M).then(E=>{const j={...E,isPositioned:F.current!==!1};I.current&&!qe(_.current,j)&&(_.current=j,At.flushSync(()=>{l(j)}))})},[m,t,n,A,F]);ze(()=>{d===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,l(M=>({...M,isPositioned:!1})))},[d]);const I=a.useRef(!1);ze(()=>(I.current=!0,()=>{I.current=!1}),[]),ze(()=>{if(C&&(P.current=C),b&&(O.current=b),C&&b){if(T.current)return T.current(C,b,N);N()}},[C,b,N,T,L]);const U=a.useMemo(()=>({reference:P,floating:O,setReference:R,setFloating:y}),[R,y]),D=a.useMemo(()=>({reference:C,floating:b}),[C,b]),$=a.useMemo(()=>{const M={position:n,left:0,top:0};if(!D.floating)return M;const E=Pn(D.floating,f.x),j=Pn(D.floating,f.y);return c?{...M,transform:"translate("+E+"px, "+j+"px)",...Kn(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:E,top:j}},[n,c,D.floating,f.x,f.y]);return a.useMemo(()=>({...f,update:N,refs:U,elements:D,floatingStyles:$}),[f,N,U,D,$])}const Bs=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?bn({element:o.current,padding:r}).fn(n):{}:o?bn({element:o,padding:r}).fn(n):{}}}},Us=(e,t)=>{const n=_s(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ws=(e,t)=>{const n=Ds(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ks=(e,t)=>({fn:Fs(e).fn,options:[e,t]}),Gs=(e,t)=>{const n=Is(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vs=(e,t)=>{const n=Ts(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hs=(e,t)=>{const n=Ns(e);return{name:n.name,fn:n.fn,options:[e,t]}},zs=(e,t)=>{const n=Bs(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Ys="Arrow",Gn=a.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return g.jsx(k.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});Gn.displayName=Ys;var Xs=Gn;function Zs(e){const[t,n]=a.useState(void 0);return ee(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,c;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,c=d.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var $t="Popper",[Vn,at]=ve($t),[qs,Hn]=Vn($t),zn=e=>{const{__scopePopper:t,children:n}=e,[o,r]=a.useState(null),[s,i]=a.useState(void 0);return g.jsx(qs,{scope:t,anchor:o,onAnchorChange:r,placementState:s,setPlacementState:i,children:n})};zn.displayName=$t;var Yn="PopperAnchor",Xn=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Hn(Yn,n),i=a.useRef(null),c=s.onAnchorChange,u=a.useCallback(h=>{i.current=h,h&&c(h)},[c]),d=B(t,u),f=a.useRef(null);a.useEffect(()=>{if(!o)return;const h=f.current;f.current=o.current,h!==f.current&&c(f.current)});const l=s.placementState&&Ut(s.placementState),m=l==null?void 0:l[0],p=l==null?void 0:l[1];return o?null:g.jsx(k.div,{"data-radix-popper-side":m,"data-radix-popper-align":p,...r,ref:d})});Xn.displayName=Yn;var Bt="PopperContent",[Js,Qs]=Vn(Bt),Zn=a.forwardRef((e,t)=>{var Oe,z,_e,Qt,en,tn;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:l="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:h,...v}=e,w=Hn(Bt,n),[x,R]=a.useState(null),y=B(t,R),[C,b]=a.useState(null),P=Zs(C),O=(P==null?void 0:P.width)??0,_=(P==null?void 0:P.height)??0,L=o+(s!=="center"?"-"+s:""),T=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],F=A.length>0,N={padding:T,boundary:A.filter(ti),altBoundary:F},{refs:I,floatingStyles:U,placement:D,isPositioned:$,middlewareData:M}=$s({strategy:"fixed",placement:L,whileElementsMounted:(...ht)=>Os(...ht,{animationFrame:p==="always"}),elements:{reference:w.anchor},middleware:[Us({mainAxis:r+_,alignmentAxis:i}),u&&Ws({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?Ks():void 0,...N}),u&&Gs({...N}),Vs({...N,apply:({elements:ht,rects:nn,availableWidth:ir,availableHeight:cr})=>{const{width:ar,height:ur}=nn.reference,We=ht.floating.style;We.setProperty("--radix-popper-available-width",`${ir}px`),We.setProperty("--radix-popper-available-height",`${cr}px`),We.setProperty("--radix-popper-anchor-width",`${ar}px`),We.setProperty("--radix-popper-anchor-height",`${ur}px`)}}),C&&zs({element:C,padding:c}),ni({arrowWidth:O,arrowHeight:_}),m&&Hs({strategy:"referenceHidden",...N,boundary:F?N.boundary:void 0})]}),E=w.setPlacementState;ee(()=>(E(D),()=>{E(void 0)}),[D,E]);const[j,K]=Ut(D),G=ue(h);ee(()=>{$&&(G==null||G())},[$,G]);const Me=(Oe=M.arrow)==null?void 0:Oe.x,Ae=(z=M.arrow)==null?void 0:z.y,Ue=((_e=M.arrow)==null?void 0:_e.centerOffset)!==0,[pe,ce]=a.useState();return ee(()=>{x&&ce(window.getComputedStyle(x).zIndex)},[x]),g.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:$?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[(Qt=M.transformOrigin)==null?void 0:Qt.x,(en=M.transformOrigin)==null?void 0:en.y].join(" "),...((tn=M.hide)==null?void 0:tn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(Js,{scope:n,placedSide:j,placedAlign:K,onArrowChange:b,arrowX:Me,arrowY:Ae,shouldHideArrow:Ue,children:g.jsx(k.div,{"data-side":j,"data-align":K,...v,ref:y,style:{...v.style,animation:$?void 0:"none"}})})})});Zn.displayName=Bt;var qn="PopperArrow",ei={top:"bottom",right:"left",bottom:"top",left:"right"},Jn=a.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=Qs(qn,o),i=ei[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(Xs,{...r,ref:n,style:{...r.style,display:"block"}})})});Jn.displayName=qn;function ti(e){return e!==null}var ni=e=>({name:"transformOrigin",options:e,fn(t){var w,x,R;const{placement:n,rects:o,middlewareData:r}=t,i=((w=r.arrow)==null?void 0:w.centerOffset)!==0,c=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[d,f]=Ut(n),l={start:"0%",center:"50%",end:"100%"}[f],m=(((x=r.arrow)==null?void 0:x.x)??0)+c/2,p=(((R=r.arrow)==null?void 0:R.y)??0)+u/2;let h="",v="";return d==="bottom"?(h=i?l:`${m}px`,v=`${-u}px`):d==="top"?(h=i?l:`${m}px`,v=`${o.floating.height+u}px`):d==="right"?(h=`${-u}px`,v=i?l:`${p}px`):d==="left"&&(h=`${o.floating.width+u}px`,v=i?l:`${p}px`),{data:{x:h,y:v}}}});function Ut(e){const[t,n="center"]=e.split("-");return[t,n]}var Qn=zn,Wt=Xn,eo=Zn,to=Jn,oi="Portal",ut=a.forwardRef((e,t)=>{var c;const{container:n,...o}=e,[r,s]=a.useState(!1);ee(()=>s(!0),[]);const i=n||r&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return i?At.createPortal(g.jsx(k.div,{...o,ref:t}),i):null});ut.displayName=oi;function ri(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var oe=e=>{const{present:t,children:n}=e,o=si(t),r=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),s=ii(o.ref,ci(r));return typeof n=="function"||o.isPresent?a.cloneElement(r,{ref:s}):null};oe.displayName="Presence";function si(e){const[t,n]=a.useState(),o=a.useRef(null),r=a.useRef(e),s=a.useRef("none"),i=e?"mounted":"unmounted",[c,u]=ri(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const d=He(o.current);s.current=c==="mounted"?d:"none"},[c]),ee(()=>{const d=o.current,f=r.current;if(f!==e){const m=s.current,p=He(d);e?u("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),ee(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,l=p=>{const v=He(o.current).includes(CSS.escape(p.animationName));if(p.target===t&&v&&(u("ANIMATION_END"),!r.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},m=p=>{p.target===t&&(s.current=He(o.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(d=>{o.current=d?getComputedStyle(d):null,n(d)},[])}}function Sn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ii(...e){const t=a.useRef(e);return t.current=e,a.useCallback(n=>{const o=t.current;let r=!1;const s=o.map(i=>{const c=Sn(i,n);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let i=0;i<s.length;i++){const c=s[i];typeof c=="function"?c():Sn(o[i],null)}}},[])}function He(e){return(e==null?void 0:e.animationName)||"none"}function ci(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Rt="rovingFocusGroup.onEntryFocus",ai={bubbles:!1,cancelable:!0},je="RovingFocusGroup",[St,no,ui]=On(je),[li,oo]=ve(je,[ui]),[fi,di]=li(je),ro=a.forwardRef((e,t)=>g.jsx(St.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(St.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(pi,{...e,ref:t})})}));ro.displayName=je;var pi=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...l}=e,m=a.useRef(null),p=B(t,m),h=_n(s),[v,w]=tt({prop:i,defaultProp:c??null,onChange:u,caller:je}),[x,R]=a.useState(!1),y=ue(d),C=no(n),b=a.useRef(!1),[P,O]=a.useState(0);return a.useEffect(()=>{const _=m.current;if(_)return _.addEventListener(Rt,y),()=>_.removeEventListener(Rt,y)},[y]),g.jsx(fi,{scope:n,orientation:o,dir:h,loop:r,currentTabStopId:v,onItemFocus:a.useCallback(_=>w(_),[w]),onItemShiftTab:a.useCallback(()=>R(!0),[]),onFocusableItemAdd:a.useCallback(()=>O(_=>_+1),[]),onFocusableItemRemove:a.useCallback(()=>O(_=>_-1),[]),children:g.jsx(k.div,{tabIndex:x||P===0?-1:0,"data-orientation":o,...l,ref:p,style:{outline:"none",...e.style},onMouseDown:S(e.onMouseDown,()=>{b.current=!0}),onFocus:S(e.onFocus,_=>{const L=!b.current;if(_.target===_.currentTarget&&L&&!x){const T=new CustomEvent(Rt,ai);if(_.currentTarget.dispatchEvent(T),!T.defaultPrevented){const A=C().filter(D=>D.focusable),F=A.find(D=>D.active),N=A.find(D=>D.id===v),U=[F,N,...A].filter(Boolean).map(D=>D.ref.current);co(U,f)}}b.current=!1}),onBlur:S(e.onBlur,()=>R(!1))})})}),so="RovingFocusGroupItem",io=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:i,...c}=e,u=he(),d=s||u,f=di(so,n),l=f.currentTabStopId===d,m=no(n),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:v}=f;return a.useEffect(()=>{if(o)return p(),()=>h()},[o,p,h]),g.jsx(St.ItemSlot,{scope:n,id:d,focusable:o,active:r,children:g.jsx(k.span,{tabIndex:l?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:S(e.onMouseDown,w=>{o?f.onItemFocus(d):w.preventDefault()}),onFocus:S(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:S(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=gi(w,f.orientation,f.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let y=m().filter(C=>C.focusable).map(C=>C.ref.current);if(x==="last")y.reverse();else if(x==="prev"||x==="next"){x==="prev"&&y.reverse();const C=y.indexOf(w.currentTarget);y=f.loop?vi(y,C+1):y.slice(C+1)}setTimeout(()=>co(y))}}),children:typeof i=="function"?i({isCurrentTabStop:l,hasTabStop:v!=null}):i})})});io.displayName=so;var mi={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hi(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function gi(e,t,n){const o=hi(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return mi[o]}function co(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function vi(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var wi=ro,xi=io,Mt=["Enter"," "],yi=["ArrowDown","PageUp","Home"],ao=["ArrowUp","PageDown","End"],Ri=[...yi,...ao],Ci={ltr:[...Mt,"ArrowRight"],rtl:[...Mt,"ArrowLeft"]},Ei={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ke="Menu",[Te,bi,Pi]=On(ke),[we,uo]=ve(ke,[Pi,at,oo]),lt=at(),lo=oo(),[Si,xe]=we(ke),[Mi,$e]=we(ke),fo=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:s,modal:i=!0}=e,c=lt(t),[u,d]=a.useState(null),f=a.useRef(!1),l=ue(s),m=_n(r);return a.useEffect(()=>{const p=()=>{f.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>f.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),a.useEffect(()=>{if(!n)return;const p=()=>l(!1);return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[n,l]),g.jsx(Qn,{...c,children:g.jsx(Si,{scope:t,open:n,onOpenChange:l,content:u,onContentChange:d,children:g.jsx(Mi,{scope:t,onClose:a.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:f,dir:m,modal:i,children:o})})})};fo.displayName=ke;var Ai="MenuAnchor",Kt=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=lt(n);return g.jsx(Wt,{...r,...o,ref:t})});Kt.displayName=Ai;var Gt="MenuPortal",[Oi,po]=we(Gt,{forceMount:void 0}),mo=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,s=xe(Gt,t);return g.jsx(Oi,{scope:t,forceMount:n,children:g.jsx(oe,{present:n||s.open,children:g.jsx(ut,{asChild:!0,container:r,children:o})})})};mo.displayName=Gt;var Y="MenuContent",[_i,Vt]=we(Y),ho=a.forwardRef((e,t)=>{const n=po(Y,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,s=xe(Y,e.__scopeMenu),i=$e(Y,e.__scopeMenu);return g.jsx(Te.Provider,{scope:e.__scopeMenu,children:g.jsx(oe,{present:o||s.open,children:g.jsx(Te.Slot,{scope:e.__scopeMenu,children:i.modal?g.jsx(Di,{...r,ref:t}):g.jsx(Ii,{...r,ref:t})})})})}),Di=a.forwardRef((e,t)=>{const n=xe(Y,e.__scopeMenu),o=a.useRef(null),r=B(t,o);return a.useEffect(()=>{const s=o.current;if(s)return Ot(s)},[]),g.jsx(Ht,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:S(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ii=a.forwardRef((e,t)=>{const n=xe(Y,e.__scopeMenu);return g.jsx(Ht,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Ti=Re("MenuContent.ScrollLock"),Ht=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:m,onDismiss:p,disableOutsideScroll:h,...v}=e,w=xe(Y,n),x=$e(Y,n),R=lt(n),y=lo(n),C=bi(n),[b,P]=a.useState(null),O=a.useRef(null),_=B(t,O,w.onContentChange),L=a.useRef(0),T=a.useRef(""),A=a.useRef(0),F=a.useRef(null),N=a.useRef("right"),I=a.useRef(0),U=h?_t:a.Fragment,D=h?{as:Ti,allowPinchZoom:!0}:void 0,$=E=>{var ce,Oe;const j=T.current+E,K=C().filter(z=>!z.disabled),G=document.activeElement,Me=(ce=K.find(z=>z.ref.current===G))==null?void 0:ce.textValue,Ae=K.map(z=>z.textValue),Ue=Vi(Ae,j,Me),pe=(Oe=K.find(z=>z.textValue===Ue))==null?void 0:Oe.ref.current;(function z(_e){T.current=_e,window.clearTimeout(L.current),_e!==""&&(L.current=window.setTimeout(()=>z(""),1e3))})(j),pe&&setTimeout(()=>pe.focus())};a.useEffect(()=>()=>window.clearTimeout(L.current),[]),It();const M=a.useCallback(E=>{var K,G;return N.current===((K=F.current)==null?void 0:K.side)&&zi(E,(G=F.current)==null?void 0:G.area)},[]);return g.jsx(_i,{scope:n,searchRef:T,onItemEnter:a.useCallback(E=>{M(E)&&E.preventDefault()},[M]),onItemLeave:a.useCallback(E=>{var j;M(E)||((j=O.current)==null||j.focus(),P(null))},[M]),onTriggerLeave:a.useCallback(E=>{M(E)&&E.preventDefault()},[M]),pointerGraceTimerRef:A,onPointerGraceIntentChange:a.useCallback(E=>{F.current=E},[]),children:g.jsx(U,{...D,children:g.jsx(ot,{asChild:!0,trapped:r,onMountAutoFocus:S(s,E=>{var j;E.preventDefault(),(j=O.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:g.jsx(nt,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:m,onDismiss:p,children:g.jsx(wi,{asChild:!0,...y,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:b,onCurrentTabStopIdChange:P,onEntryFocus:S(u,E=>{x.isUsingKeyboardRef.current||E.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(eo,{role:"menu","aria-orientation":"vertical","data-state":Do(w.open),"data-radix-menu-content":"",dir:x.dir,...R,...v,ref:_,style:{outline:"none",...v.style},onKeyDown:S(v.onKeyDown,E=>{const K=E.target.closest("[data-radix-menu-content]")===E.currentTarget,G=E.ctrlKey||E.altKey||E.metaKey,Me=E.key.length===1;K&&(E.key==="Tab"&&E.preventDefault(),!G&&Me&&$(E.key));const Ae=O.current;if(E.target!==Ae||!Ri.includes(E.key))return;E.preventDefault();const pe=C().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);ao.includes(E.key)&&pe.reverse(),Ki(pe)}),onBlur:S(e.onBlur,E=>{E.currentTarget.contains(E.target)||(window.clearTimeout(L.current),T.current="")}),onPointerMove:S(e.onPointerMove,Ne(E=>{const j=E.target,K=I.current!==E.clientX;if(E.currentTarget.contains(j)&&K){const G=E.clientX>I.current?"right":"left";N.current=G,I.current=E.clientX}}))})})})})})})});ho.displayName=Y;var Ni="MenuGroup",zt=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return g.jsx(k.div,{role:"group",...o,ref:t})});zt.displayName=Ni;var Fi="MenuLabel",go=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return g.jsx(k.div,{...o,ref:t})});go.displayName=Fi;var Je="MenuItem",Mn="menu.itemSelect",ft=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,s=a.useRef(null),i=$e(Je,e.__scopeMenu),c=Vt(Je,e.__scopeMenu),u=B(t,s),d=a.useRef(!1),f=()=>{const l=s.current;if(!n&&l){const m=new CustomEvent(Mn,{bubbles:!0,cancelable:!0});l.addEventListener(Mn,p=>o==null?void 0:o(p),{once:!0}),An(l,m),m.defaultPrevented?d.current=!1:i.onClose()}};return g.jsx(vo,{...r,ref:u,disabled:n,onClick:S(e.onClick,f),onPointerDown:l=>{var m;(m=e.onPointerDown)==null||m.call(e,l),d.current=!0},onPointerUp:S(e.onPointerUp,l=>{var m;d.current||(m=l.currentTarget)==null||m.click()}),onKeyDown:S(e.onKeyDown,l=>{const m=c.searchRef.current!=="";n||m&&l.key===" "||Mt.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});ft.displayName=Je;var vo=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...s}=e,i=Vt(Je,n),c=lo(n),u=a.useRef(null),d=B(t,u),[f,l]=a.useState(!1),[m,p]=a.useState("");return a.useEffect(()=>{const h=u.current;h&&p((h.textContent??"").trim())},[s.children]),g.jsx(Te.ItemSlot,{scope:n,disabled:o,textValue:r??m,children:g.jsx(xi,{asChild:!0,...c,focusable:!o,children:g.jsx(k.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:d,onPointerMove:S(e.onPointerMove,Ne(h=>{o?i.onItemLeave(h):(i.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:S(e.onPointerLeave,Ne(h=>i.onItemLeave(h))),onFocus:S(e.onFocus,()=>l(!0)),onBlur:S(e.onBlur,()=>l(!1))})})})}),Li="MenuCheckboxItem",wo=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return g.jsx(Eo,{scope:e.__scopeMenu,checked:n,children:g.jsx(ft,{role:"menuitemcheckbox","aria-checked":Qe(n)?"mixed":n,...r,ref:t,"data-state":Xt(n),onSelect:S(r.onSelect,()=>o==null?void 0:o(Qe(n)?!0:!n),{checkForDefaultPrevented:!1})})})});wo.displayName=Li;var xo="MenuRadioGroup",[ji,ki]=we(xo,{value:void 0,onValueChange:()=>{}}),yo=a.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,s=ue(o);return g.jsx(ji,{scope:e.__scopeMenu,value:n,onValueChange:s,children:g.jsx(zt,{...r,ref:t})})});yo.displayName=xo;var Ro="MenuRadioItem",Co=a.forwardRef((e,t)=>{const{value:n,...o}=e,r=ki(Ro,e.__scopeMenu),s=n===r.value;return g.jsx(Eo,{scope:e.__scopeMenu,checked:s,children:g.jsx(ft,{role:"menuitemradio","aria-checked":s,...o,ref:t,"data-state":Xt(s),onSelect:S(o.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,n)},{checkForDefaultPrevented:!1})})})});Co.displayName=Ro;var Yt="MenuItemIndicator",[Eo,$i]=we(Yt,{checked:!1}),bo=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,s=$i(Yt,n);return g.jsx(oe,{present:o||Qe(s.checked)||s.checked===!0,children:g.jsx(k.span,{...r,ref:t,"data-state":Xt(s.checked)})})});bo.displayName=Yt;var Bi="MenuSeparator",Po=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return g.jsx(k.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});Po.displayName=Bi;var Ui="MenuArrow",So=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=lt(n);return g.jsx(to,{...r,...o,ref:t})});So.displayName=Ui;var Wi="MenuSub",[na,Mo]=we(Wi),De="MenuSubTrigger",Ao=a.forwardRef((e,t)=>{const n=xe(De,e.__scopeMenu),o=$e(De,e.__scopeMenu),r=Mo(De,e.__scopeMenu),s=Vt(De,e.__scopeMenu),i=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},f=a.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);a.useEffect(()=>f,[f]),a.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const l=B(t,r.onTriggerChange);return g.jsx(Kt,{asChild:!0,...d,children:g.jsx(vo,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":n.open?r.contentId:void 0,"data-state":Do(n.open),...e,ref:l,onClick:m=>{var p;(p=e.onClick)==null||p.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:S(e.onPointerMove,Ne(m=>{s.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:S(e.onPointerLeave,Ne(m=>{var h,v;f();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const w=(v=n.content)==null?void 0:v.dataset.side,x=w==="right",R=x?-5:5,y=p[x?"left":"right"],C=p[x?"right":"left"];s.onPointerGraceIntentChange({area:[{x:m.clientX+R,y:m.clientY},{x:y,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:y,y:p.bottom}],side:w}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(m),m.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:S(e.onKeyDown,m=>{var h;const p=s.searchRef.current!=="";e.disabled||p&&m.key===" "||Ci[o.dir].includes(m.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),m.preventDefault())})})})});Ao.displayName=De;var Oo="MenuSubContent",_o=a.forwardRef((e,t)=>{const n=po(Y,e.__scopeMenu),{forceMount:o=n.forceMount,align:r="start",...s}=e,i=xe(Y,e.__scopeMenu),c=$e(Y,e.__scopeMenu),u=Mo(Oo,e.__scopeMenu),d=a.useRef(null),f=B(t,d);return g.jsx(Te.Provider,{scope:e.__scopeMenu,children:g.jsx(oe,{present:o||i.open,children:g.jsx(Te.Slot,{scope:e.__scopeMenu,children:g.jsx(Ht,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:f,align:r,side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:l=>{var m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),l.preventDefault()},onCloseAutoFocus:l=>l.preventDefault(),onFocusOutside:S(e.onFocusOutside,l=>{l.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:S(e.onEscapeKeyDown,l=>{c.onClose(),l.preventDefault()}),onKeyDown:S(e.onKeyDown,l=>{var h;const m=l.currentTarget.contains(l.target),p=Ei[c.dir].includes(l.key);m&&p&&(i.onOpenChange(!1),(h=u.trigger)==null||h.focus(),l.preventDefault())})})})})})});_o.displayName=Oo;function Do(e){return e?"open":"closed"}function Qe(e){return e==="indeterminate"}function Xt(e){return Qe(e)?"indeterminate":e?"checked":"unchecked"}function Ki(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Gi(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function Vi(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Gi(e,Math.max(s,0));r.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return u!==n?u:void 0}function Hi(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const c=t[s],u=t[i],d=c.x,f=c.y,l=u.x,m=u.y;f>o!=m>o&&n<(l-d)*(o-f)/(m-f)+d&&(r=!r)}return r}function zi(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Hi(n,t)}function Ne(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Yi=fo,Xi=Kt,Zi=mo,qi=ho,Ji=zt,Qi=go,ec=ft,tc=wo,nc=yo,oc=Co,rc=bo,sc=Po,ic=So,cc=Ao,ac=_o,dt="DropdownMenu",[uc]=ve(dt,[uo]),W=uo(),[lc,Io]=uc(dt),To=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:s,onOpenChange:i,modal:c=!0}=e,u=W(t),d=a.useRef(null),[f,l]=tt({prop:r,defaultProp:s??!1,onChange:i,caller:dt});return g.jsx(lc,{scope:t,triggerId:he(),triggerRef:d,contentId:he(),open:f,onOpenChange:l,onOpenToggle:a.useCallback(()=>l(m=>!m),[l]),modal:c,children:g.jsx(Yi,{...u,open:f,onOpenChange:l,dir:o,modal:c,children:n})})};To.displayName=dt;var No="DropdownMenuTrigger",Fo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,s=Io(No,n),i=W(n),c=B(t,s.triggerRef);return g.jsx(Xi,{asChild:!0,...i,children:g.jsx(k.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:c,onPointerDown:S(e.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(s.onOpenToggle(),s.open||u.preventDefault())}),onKeyDown:S(e.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&s.onOpenToggle(),u.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});Fo.displayName=No;var fc="DropdownMenuPortal",Lo=e=>{const{__scopeDropdownMenu:t,...n}=e,o=W(t);return g.jsx(Zi,{...o,...n})};Lo.displayName=fc;var jo="DropdownMenuContent",ko=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Io(jo,n),s=W(n),i=a.useRef(!1);return g.jsx(qi,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...o,ref:t,onCloseAutoFocus:S(e.onCloseAutoFocus,c=>{var u;i.current||(u=r.triggerRef.current)==null||u.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:S(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!r.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ko.displayName=jo;var dc="DropdownMenuGroup",$o=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=W(n);return g.jsx(Ji,{...r,...o,ref:t})});$o.displayName=dc;var pc="DropdownMenuLabel",Bo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=W(n);return g.jsx(Qi,{...r,...o,ref:t})});Bo.displayName=pc;var mc="DropdownMenuItem",Uo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=W(n);return g.jsx(ec,{...r,...o,ref:t})});Uo.displayName=mc;var hc="DropdownMenuCheckboxItem",gc=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=W(n);return g.jsx(tc,{...r,...o,ref:t})});gc.displayName=hc;var vc="DropdownMenuRadioGroup",wc=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=W(n);return g.jsx(nc,{...r,...o,ref:t})});wc.displayName=vc;var xc="DropdownMenuRadioItem",yc=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=W(n);return g.jsx(oc,{...r,...o,ref:t})});yc.displayName=xc;var Rc="DropdownMenuItemIndicator",Cc=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=W(n);return g.jsx(rc,{...r,...o,ref:t})});Cc.displayName=Rc;var Ec="DropdownMenuSeparator",Wo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=W(n);return g.jsx(sc,{...r,...o,ref:t})});Wo.displayName=Ec;var bc="DropdownMenuArrow",Pc=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=W(n);return g.jsx(ic,{...r,...o,ref:t})});Pc.displayName=bc;var Sc="DropdownMenuSubTrigger",Mc=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=W(n);return g.jsx(cc,{...r,...o,ref:t})});Mc.displayName=Sc;var Ac="DropdownMenuSubContent",Oc=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=W(n);return g.jsx(ac,{...r,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Oc.displayName=Ac;var oa=To,ra=Fo,sa=Lo,ia=ko,ca=$o,aa=Bo,ua=Uo,la=Wo,pt="Dialog",[Ko]=ve(pt),[_c,q]=Ko(pt),Dc=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,c=a.useRef(null),u=a.useRef(null),[d,f]=tt({prop:o,defaultProp:r??!1,onChange:s,caller:pt});return g.jsx(_c,{scope:t,triggerRef:c,contentRef:u,contentId:he(),titleId:he(),descriptionId:he(),open:d,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(l=>!l),[f]),modal:i,children:n})};Dc.displayName=pt;var Go="DialogTrigger",Ic=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=q(Go,n),s=B(t,r.triggerRef);return g.jsx(k.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":qt(r.open),...o,ref:s,onClick:S(e.onClick,r.onOpenToggle)})});Ic.displayName=Go;var Zt="DialogPortal",[Tc,Vo]=Ko(Zt,{forceMount:void 0}),Nc=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,s=q(Zt,t);return g.jsx(Tc,{scope:t,forceMount:n,children:a.Children.map(o,i=>g.jsx(oe,{present:n||s.open,children:g.jsx(ut,{asChild:!0,container:r,children:i})}))})};Nc.displayName=Zt;var et="DialogOverlay",Fc=a.forwardRef((e,t)=>{const n=Vo(et,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=q(et,e.__scopeDialog);return s.modal?g.jsx(oe,{present:o||s.open,children:g.jsx(jc,{...r,ref:t})}):null});Fc.displayName=et;var Lc=Re("DialogOverlay.RemoveScroll"),jc=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=q(et,n),s=Ir(),i=B(t,s);return g.jsx(_t,{as:Lc,allowPinchZoom:!0,shards:[r.contentRef],children:g.jsx(k.div,{"data-state":qt(r.open),...o,ref:i,style:{pointerEvents:"auto",...o.style}})})}),Ee="DialogContent",kc=a.forwardRef((e,t)=>{const n=Vo(Ee,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=q(Ee,e.__scopeDialog);return g.jsx(oe,{present:o||s.open,children:s.modal?g.jsx($c,{...r,ref:t}):g.jsx(Bc,{...r,ref:t})})});kc.displayName=Ee;var $c=a.forwardRef((e,t)=>{const n=q(Ee,e.__scopeDialog),o=a.useRef(null),r=B(t,n.contentRef,o);return a.useEffect(()=>{const s=o.current;if(s)return Ot(s)},[]),g.jsx(Ho,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:S(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:S(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&s.preventDefault()}),onFocusOutside:S(e.onFocusOutside,s=>s.preventDefault())})}),Bc=a.forwardRef((e,t)=>{const n=q(Ee,e.__scopeDialog),o=a.useRef(!1),r=a.useRef(!1);return g.jsx(Ho,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,c;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(o.current||(c=n.triggerRef.current)==null||c.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),Ho=a.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,...i}=e,c=q(Ee,n);return It(),g.jsx(g.Fragment,{children:g.jsx(ot,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:g.jsx(nt,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":qt(c.open),...i,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),zo="DialogTitle",Uc=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=q(zo,n);return g.jsx(k.h2,{id:r.titleId,...o,ref:t})});Uc.displayName=zo;var Yo="DialogDescription",Wc=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=q(Yo,n);return g.jsx(k.p,{id:r.descriptionId,...o,ref:t})});Wc.displayName=Yo;var Xo="DialogClose",Kc=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=q(Xo,n);return g.jsx(k.button,{type:"button",...o,ref:t,onClick:S(e.onClick,()=>r.onOpenChange(!1))})});Kc.displayName=Xo;function qt(e){return e?"open":"closed"}var mt="Popover",[Zo]=ve(mt,[at]),Be=at(),[Gc,de]=Zo(mt),qo=e=>{const{__scopePopover:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!1}=e,c=Be(t),u=a.useRef(null),[d,f]=a.useState(!1),[l,m]=tt({prop:o,defaultProp:r??!1,onChange:s,caller:mt});return g.jsx(Qn,{...c,children:g.jsx(Gc,{scope:t,contentId:he(),triggerRef:u,open:l,onOpenChange:m,onOpenToggle:a.useCallback(()=>m(p=>!p),[m]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:i,children:n})})};qo.displayName=mt;var Jo="PopoverAnchor",Vc=a.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=de(Jo,n),s=Be(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=r;return a.useEffect(()=>(i(),()=>c()),[i,c]),g.jsx(Wt,{...s,...o,ref:t})});Vc.displayName=Jo;var Qo="PopoverTrigger",er=a.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=de(Qo,n),s=Be(n),i=B(t,r.triggerRef),c=g.jsx(k.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":sr(r.open),...o,ref:i,onClick:S(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?c:g.jsx(Wt,{asChild:!0,...s,children:c})});er.displayName=Qo;var Jt="PopoverPortal",[Hc,zc]=Zo(Jt,{forceMount:void 0}),tr=e=>{const{__scopePopover:t,forceMount:n,children:o,container:r}=e,s=de(Jt,t);return g.jsx(Hc,{scope:t,forceMount:n,children:g.jsx(oe,{present:n||s.open,children:g.jsx(ut,{asChild:!0,container:r,children:o})})})};tr.displayName=Jt;var be="PopoverContent",nr=a.forwardRef((e,t)=>{const n=zc(be,e.__scopePopover),{forceMount:o=n.forceMount,...r}=e,s=de(be,e.__scopePopover);return g.jsx(oe,{present:o||s.open,children:s.modal?g.jsx(Xc,{...r,ref:t}):g.jsx(Zc,{...r,ref:t})})});nr.displayName=be;var Yc=Re("PopoverContent.RemoveScroll"),Xc=a.forwardRef((e,t)=>{const n=de(be,e.__scopePopover),o=a.useRef(null),r=B(t,o),s=a.useRef(!1);return a.useEffect(()=>{const i=o.current;if(i)return Ot(i)},[]),g.jsx(_t,{as:Yc,allowPinchZoom:!0,children:g.jsx(or,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:S(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),s.current||(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:S(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:S(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Zc=a.forwardRef((e,t)=>{const n=de(be,e.__scopePopover),o=a.useRef(!1),r=a.useRef(!1);return g.jsx(or,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,c;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(o.current||(c=n.triggerRef.current)==null||c.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),or=a.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...l}=e,m=de(be,n),p=Be(n);return It(),g.jsx(ot,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:g.jsx(nt,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:g.jsx(eo,{"data-state":sr(m.open),role:"dialog",id:m.contentId,...p,...l,ref:t,style:{...l.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),rr="PopoverClose",qc=a.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=de(rr,n);return g.jsx(k.button,{type:"button",...o,ref:t,onClick:S(e.onClick,()=>r.onOpenChange(!1))})});qc.displayName=rr;var Jc="PopoverArrow",Qc=a.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Be(n);return g.jsx(to,{...r,...o,ref:t})});Qc.displayName=Jc;function sr(e){return e?"open":"closed"}var fa=qo,da=er,pa=tr,ma=nr;export{ia as C,Dc as D,ca as G,ua as I,aa as L,sa as P,oa as R,la as S,ra as T,Nc as a,Fc as b,kc as c,Uc as d,Kc as e,fa as f,da as g,pa as h,ma as i};
|
package/dist/web/index.html
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<title>Pi-Studio</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-UMN9kelm.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-DQUAl2K8.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/vendor-query-i7fr__Xm.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/vendor-DaF96HbP.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/vendor-icons-K8oF_80Q.js">
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-overlays-
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-overlays-3MkedLFU.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/vendor-dnd-CayJj8TC.js">
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/vendor-CEK31ho9.css">
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D0vOQcoX.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@av-pi-studio/web-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.110",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"!dist/**/*.map",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@av-pi-studio/client": "^0.0.
|
|
20
|
-
"@av-pi-studio/protocol": "^0.0.
|
|
19
|
+
"@av-pi-studio/client": "^0.0.110",
|
|
20
|
+
"@av-pi-studio/protocol": "^0.0.110",
|
|
21
21
|
"@codemirror/language": "^6.12.4",
|
|
22
22
|
"@codemirror/language-data": "^6.5.2",
|
|
23
23
|
"@codemirror/state": "^6.7.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._shellRow_1kabp_2{display:flex;gap:var(--pi-spacing-12)}._rail_1kabp_10{width:20px;flex:none;display:flex;flex-direction:column;align-items:center}._disc_1kabp_18{width:18px;height:18px;flex:none;border-radius:var(--pi-radius-full);display:flex;align-items:center;justify-content:center}._connector_1kabp_28{flex:1;width:var(--pi-border-width-2);background:var(--pi-color-surface3)}._content_1kabp_2{flex:1;min-width:0;padding-bottom:var(--pi-spacing-8)}._metaLine_1kabp_40{display:flex;align-items:center;gap:var(--pi-spacing-7);font-size:var(--pi-font-size-3xs);color:var(--pi-color-foregroundMuted);margin-bottom:var(--pi-spacing-3)}._metaTime_1kabp_52{opacity:.55;transition:opacity .12s ease}._shellRow_1kabp_2:hover ._metaTime_1kabp_52{opacity:1}._forkButton_1kabp_66{position:relative;opacity:0;transition:opacity .12s ease-out}._shellRow_1kabp_2:hover ._forkButton_1kabp_66,._shellRow_1kabp_2:focus-within ._forkButton_1kabp_66{opacity:1}@media(max-width:575px),(hover:none){._forkButton_1kabp_66{opacity:.55}._forkButton_1kabp_66:active{opacity:1}._forkButton_1kabp_66:after{content:"";position:absolute;inset:50% auto auto 50%;width:44px;height:44px;transform:translate(-50%,-50%)}}@media(prefers-reduced-motion:reduce){._forkButton_1kabp_66{transition:none}}@media(prefers-reduced-motion:reduce){._metaTime_1kabp_52{transition:none}}._askDisc_ffqf1_5{background:color-mix(in srgb,var(--pi-color-statusWarning) 20%,var(--pi-color-surface3))}._card_ffqf1_9{position:relative;overflow:hidden;border-radius:var(--pi-radius-lg);background:var(--pi-color-surface1);border:var(--pi-border-width-1) solid var(--pi-color-border);padding:var(--pi-spacing-8) var(--pi-spacing-12);display:flex;flex-direction:column;gap:var(--pi-spacing-8)}._card_ffqf1_9:focus-within{border-color:color-mix(in srgb,var(--pi-color-statusWarning) 45%,transparent);box-shadow:0 0 0 3px color-mix(in srgb,var(--pi-color-statusWarning) 18%,transparent)}._cardInert_ffqf1_41{opacity:.55;border-color:var(--pi-color-border)}._askDiscInert_ffqf1_47{background:var(--pi-color-surface3)}._reconnectingNote_ffqf1_52{display:flex;align-items:center;gap:var(--pi-spacing-7);margin:0;font-size:var(--pi-font-size-3xs);color:var(--pi-color-foregroundMuted)}._reconnectingDot_ffqf1_61{width:8px;height:8px;border-radius:var(--pi-radius-full);background:var(--pi-color-foregroundMuted);flex:none}._deadlineBar_ffqf1_71{position:absolute;top:0;left:0;height:2px;background:var(--pi-color-statusWarning);transition:width 1s linear}._deadlineApproximate_ffqf1_80{opacity:.7}._header_ffqf1_85{display:flex;align-items:center;gap:var(--pi-spacing-7)}._askBadge_ffqf1_16{font-size:var(--pi-font-size-4xs);font-weight:700;letter-spacing:.06em;border-radius:var(--pi-radius-base);padding:0 var(--pi-spacing-5);color:var(--pi-color-statusWarning);background:color-mix(in srgb,var(--pi-color-statusWarning) 18%,transparent)}._methodName_ffqf1_101{font-family:var(--pi-font-mono);font-size:var(--pi-font-size-3xs);color:var(--pi-color-foregroundMuted)}._title_ffqf1_107{font-size:var(--pi-font-size-xs);line-height:1.5;color:var(--pi-color-foreground);white-space:pre-line;overflow-wrap:break-word}._titleEmphasised_ffqf1_115{font-weight:600}._message_ffqf1_119{font-size:var(--pi-font-size-xs);line-height:1.5;color:var(--pi-color-foregroundMuted);white-space:pre-line;overflow-wrap:break-word}._emptyOptionsNote_ffqf1_127{font-size:var(--pi-font-size-xs);font-style:italic;color:var(--pi-color-foregroundMuted)}._controls_ffqf1_133{display:flex;align-items:center;gap:var(--pi-spacing-8);flex-wrap:wrap;row-gap:var(--pi-spacing-8)}._controlsStack_ffqf1_141{flex-direction:column;align-items:stretch;flex-wrap:nowrap}._controlsScroll_ffqf1_148{max-height:208px;overflow-y:auto}._optionButton_ffqf1_153{text-align:left;justify-content:flex-start;white-space:normal;height:auto;min-height:28px}._field_ffqf1_161{flex:1;min-width:0;font-family:var(--pi-font-mono);font-size:var(--pi-font-size-code)}._editorField_ffqf1_168{font-family:var(--pi-font-mono);font-size:var(--pi-font-size-code);line-height:1.55;resize:none;overflow-y:auto}._rawPayload_ffqf1_176{margin:0;padding:var(--pi-spacing-6) var(--pi-spacing-8);border-radius:var(--pi-radius-base);background:var(--pi-color-surface0);color:var(--pi-color-foregroundMuted);font-family:var(--pi-font-mono);font-size:var(--pi-font-size-3xs);white-space:pre;overflow-x:auto}._resolvedCard_ffqf1_190{display:flex;align-items:center;gap:var(--pi-spacing-8);padding:var(--pi-spacing-8) var(--pi-spacing-12);border-radius:var(--pi-radius-lg);background:var(--pi-color-surface1);border:var(--pi-border-width-1) solid var(--pi-color-border);font-size:var(--pi-font-size-3xs)}._askBadgeNeutral_ffqf1_204{color:var(--pi-color-foregroundMuted);background:var(--pi-color-surface3)}._resolvedMethodName_ffqf1_209{flex:1;font-family:var(--pi-font-mono);color:var(--pi-color-foregroundMuted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._outcome_ffqf1_218{display:flex;align-items:center;gap:var(--pi-spacing-3);flex:none;max-width:40%;color:var(--pi-color-foregroundMuted)}._outcomeSuccess_ffqf1_229{color:var(--pi-color-statusSuccess)}._outcomeText_ffqf1_233{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media(prefers-reduced-motion:reduce){._deadlineBar_ffqf1_71{transition:none}}._hint_ffqf1_255{display:flex;visibility:hidden;align-items:center;flex-wrap:wrap;gap:var(--pi-spacing-6);font-size:var(--pi-font-size-3xs);color:var(--pi-color-foregroundMuted)}._card_ffqf1_9:focus-within~._hint_ffqf1_255{visibility:visible}._hintKey_ffqf1_270{font-family:var(--pi-font-mono);border:var(--pi-border-width-1) solid var(--pi-color-border);border-radius:4px;padding:0 4px;background:var(--pi-color-surface2)}._hintSep_ffqf1_278{opacity:.5}._recoveredChip_ffqf1_285{margin-left:auto;flex:none;font-size:var(--pi-font-size-4xs);color:var(--pi-color-foregroundMuted);border:var(--pi-border-width-1) solid var(--pi-color-border);border-radius:var(--pi-radius-base);padding:0 var(--pi-spacing-5)}._collapsedPendingCard_ffqf1_297{border-color:color-mix(in srgb,var(--pi-color-statusWarning) 45%,transparent)}._moreRow_ffqf1_303{display:flex;align-items:center;justify-content:center;width:100%;padding:var(--pi-spacing-6) var(--pi-spacing-12);border:none;border-radius:var(--pi-radius-base);background:none;color:var(--pi-color-foregroundMuted);font-size:var(--pi-font-size-3xs);cursor:pointer}._moreRow_ffqf1_303:hover{color:var(--pi-color-foreground);background:color-mix(in srgb,var(--pi-color-surface1) 85%,var(--pi-color-foreground) 15%)}._queuedBadge_mdmbp_8{display:inline-flex;align-items:center;gap:var(--pi-spacing-2);padding:0 var(--pi-spacing-4);border:var(--pi-border-width-1) solid var(--pi-color-border);border-radius:var(--pi-radius-sm);font-size:var(--pi-font-size-4xs);font-weight:600;color:var(--pi-color-foregroundMuted)}._finalChip_mdmbp_20{padding:0 var(--pi-spacing-4);border:var(--pi-border-width-1) solid var(--pi-color-border);border-radius:var(--pi-radius-sm);font-size:var(--pi-font-size-4xs);color:var(--pi-color-foregroundMuted)}._userDisc_mdmbp_30{background:color-mix(in srgb,var(--pi-color-statusSuccess) 65%,var(--pi-color-surface3))}._userAligned_mdmbp_34{display:flex;flex-direction:column;align-items:flex-end}._userPendingRow_mdmbp_40{opacity:.6}._userBubble_mdmbp_44{display:inline-block;max-width:100%;padding:var(--pi-spacing-6) var(--pi-spacing-10);border-radius:var(--pi-radius-lg);background:color-mix(in srgb,var(--pi-color-accent) 20%,var(--pi-color-surface1));border:var(--pi-border-width-1) solid color-mix(in srgb,var(--pi-color-accent) 45%,transparent);color:var(--pi-color-foreground);font-size:var(--pi-font-size-sm);line-height:1.5;white-space:pre-wrap;word-break:break-word}._userBubbleFailed_mdmbp_58{background:color-mix(in srgb,var(--pi-color-destructive) 20%,var(--pi-color-surface1));border-color:color-mix(in srgb,var(--pi-color-destructive) 45%,transparent)}._userImages_mdmbp_63{display:flex;gap:var(--pi-spacing-6);flex-wrap:wrap;margin-top:var(--pi-spacing-6)}._userImage_mdmbp_63{max-width:200px;max-height:150px;border-radius:var(--pi-radius-base);display:block;object-fit:cover;cursor:pointer}._imageDialog_mdmbp_79{max-width:90vw}._imageDialogPreview_mdmbp_83{display:block;max-width:90vw;max-height:80vh;object-fit:contain}._assistantDisc_mdmbp_93{background:var(--pi-color-accent)}._assistantBody_mdmbp_97{padding:var(--pi-spacing-6) var(--pi-spacing-10);border-radius:var(--pi-radius-lg);background:var(--pi-color-surface2);border:var(--pi-border-width-1) solid var(--pi-color-surface3);font-size:var(--pi-font-size-sm);line-height:1.5}._reasoningDisc_mdmbp_108{background:var(--pi-color-surface3)}._reasoningBody_mdmbp_112{color:color-mix(in srgb,var(--pi-color-foregroundMuted) 82%,transparent);font-style:italic;font-size:var(--pi-font-size-2xs);line-height:1.5}._toolDisc_mdmbp_123{background:var(--pi-color-surface3)}._toolCardBody_mdmbp_127{border:var(--pi-border-width-1) solid var(--pi-color-border);border-radius:var(--pi-radius-lg);background:var(--pi-color-surface1);overflow:hidden}._toolCardBodyRunning_mdmbp_134{border-color:color-mix(in srgb,var(--pi-color-accent) 45%,transparent)}._toolCardBodyCompleted_mdmbp_138{border-color:color-mix(in srgb,var(--pi-color-statusSuccess) 45%,transparent)}._toolCardBodyError_mdmbp_142{border-color:color-mix(in srgb,var(--pi-color-destructive) 45%,transparent)}._toolHeader_mdmbp_146{display:flex;align-items:center;gap:var(--pi-spacing-8);width:100%;padding:var(--pi-spacing-7) var(--pi-spacing-12);font-size:var(--pi-font-size-2xs);cursor:pointer;-webkit-user-select:none;user-select:none}._toolHeader_mdmbp_146[aria-disabled=true]{cursor:default}._toolHeader_mdmbp_146:hover:not([aria-disabled=true]){background:color-mix(in srgb,var(--pi-color-surface1) 85%,var(--pi-color-foreground) 15%)}._toolHeader_mdmbp_146._toolHeaderRunning_mdmbp_172:hover:not([aria-disabled=true]){background:color-mix(in srgb,var(--pi-color-accent) 16%,transparent)}._toolHeaderRunning_mdmbp_172{background:color-mix(in srgb,var(--pi-color-accent) 10%,transparent)}._toolChevron_mdmbp_182{flex-shrink:0;color:var(--pi-color-foregroundMuted);transition:transform .12s ease}._toolChevronOpen_mdmbp_188{transform:rotate(90deg)}._kindBadge_mdmbp_192{flex-shrink:0;font-size:var(--pi-font-size-4xs);font-weight:var(--pi-font-weight-bold);letter-spacing:.06em;border-radius:var(--pi-radius-base);padding:0 var(--pi-spacing-5);color:var(--kindToken);background:color-mix(in srgb,var(--kindToken) 20%,transparent);border:var(--pi-border-width-1) solid color-mix(in srgb,var(--kindToken) 48%,transparent)}._toolPath_mdmbp_204{flex:1;min-width:0;font-family:var(--pi-font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._toolTrailing_mdmbp_213{flex-shrink:0;display:flex;align-items:center;gap:var(--pi-spacing-6);font-size:var(--pi-font-size-3xs)}._toolStatusRunning_mdmbp_221{display:flex;align-items:center;gap:var(--pi-spacing-4);color:var(--pi-color-accentBright)}._toolStatusSuccess_mdmbp_228{color:var(--pi-color-statusSuccess)}._toolStatusError_mdmbp_232{color:var(--pi-color-destructive)}._toolStatusUnknown_mdmbp_236{color:var(--pi-color-foregroundMuted)}._toolDiffAdded_mdmbp_240{color:var(--pi-color-statusSuccess)}._toolDiffRemoved_mdmbp_244{color:var(--pi-color-destructive)}._toolOpenButton_mdmbp_248{flex-shrink:0;display:inline-flex;align-items:center;gap:var(--pi-spacing-2);padding:0;border:none;background:none;color:var(--pi-color-foregroundMuted);font:inherit;font-size:var(--pi-font-size-3xs);cursor:pointer}._toolOpenButton_mdmbp_248:hover{color:var(--pi-color-foreground)}._toolBody_mdmbp_266{border-top:1px solid var(--pi-color-border);max-height:420px;overflow:auto}._toolCode_mdmbp_272{margin:0;padding:var(--pi-spacing-8) var(--pi-spacing-12);font-family:var(--pi-font-mono);font-size:var(--pi-font-size-xs);line-height:1.5;white-space:pre-wrap;word-break:break-word;color:var(--pi-color-foreground)}._toolOutputStrip_mdmbp_283{border-top:var(--pi-border-width-1) solid color-mix(in srgb,var(--pi-color-border) 60%,transparent);padding:var(--pi-spacing-6) var(--pi-spacing-12);background:var(--pi-color-surface0);font-family:var(--pi-font-mono);font-size:var(--pi-font-size-3xs);color:var(--pi-color-foregroundMuted)}._toolDiffPreview_mdmbp_293{border-top:var(--pi-border-width-1) solid color-mix(in srgb,var(--pi-color-border) 60%,transparent);padding:var(--pi-spacing-3) 0;font-family:var(--pi-font-mono);font-size:var(--pi-font-size-3xs)}._toolDiffPreviewLine_mdmbp_301{padding:var(--pi-spacing-1) var(--pi-spacing-12)}._toolDiffPreviewAdd_mdmbp_305{color:var(--pi-color-statusSuccess);background:color-mix(in srgb,var(--pi-color-statusSuccess) 9%,transparent)}._toolDiffPreviewDel_mdmbp_310{color:var(--pi-color-destructive);background:color-mix(in srgb,var(--pi-color-destructive) 9%,transparent)}._toolDiffPreviewMore_mdmbp_315{padding:var(--pi-spacing-1) var(--pi-spacing-12);color:var(--pi-color-foregroundMuted)}._errorDisc_mdmbp_322{background:color-mix(in srgb,var(--pi-color-destructive) 25%,var(--pi-color-surface3))}._errorCard_mdmbp_326{border:var(--pi-border-width-1) solid color-mix(in srgb,var(--pi-color-destructive) 45%,transparent);border-radius:var(--pi-radius-lg);background:color-mix(in srgb,var(--pi-color-destructive) 10%,var(--pi-color-surface1));padding:var(--pi-spacing-7) var(--pi-spacing-12);font-size:var(--pi-font-size-2xs)}._errorLead_mdmbp_335{color:var(--pi-color-destructive);font-weight:var(--pi-font-weight-bold)}._systemRow_mdmbp_342{text-align:center;color:var(--pi-color-foregroundMuted);font-size:var(--pi-font-size-3xs);padding:var(--pi-spacing-4) 0}._root_1xg4h_6{position:relative;flex:1 1 auto;min-height:0;display:flex}._viewport_1xg4h_13{flex:1 1 auto;overflow-y:auto;min-height:0;padding:var(--pi-spacing-16) var(--pi-spacing-20)}._inner_1xg4h_20{position:relative;width:100%}._rowWrap_1xg4h_25{position:absolute;top:0;left:0;width:100%;display:flex;flex-direction:column;padding-bottom:var(--pi-spacing-4)}._empty_1xg4h_35{display:flex;align-items:center;justify-content:center;height:100%;color:var(--pi-color-foregroundMuted);font-size:var(--pi-font-size-sm)}._nudge_1xg4h_47{flex-direction:column;height:100%;width:100%;font-size:var(--pi-font-size-sm)}._jumpToLatest_1xg4h_56{position:absolute;right:var(--pi-spacing-20);bottom:var(--pi-spacing-16);width:32px;height:32px;display:flex;align-items:center;justify-content:center;padding:0;border:1px solid var(--pi-color-border);border-radius:var(--pi-radius-full);background:var(--pi-color-surface2);color:var(--pi-color-foreground);box-shadow:var(--pi-shadow-md);cursor:pointer;animation:_jumpToLatestIn_1xg4h_1 .12s ease-out}._jumpToLatest_1xg4h_56:hover{background:var(--pi-color-surface3)}._jumpToLatest_1xg4h_56:focus-visible{outline:2px solid var(--pi-color-accent);outline-offset:2px}@keyframes _jumpToLatestIn_1xg4h_1{0%{opacity:0;transform:translateY(var(--pi-spacing-4))}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){._jumpToLatest_1xg4h_56{animation:none}}._strip_nzfk5_4{display:flex;gap:var(--pi-spacing-6);flex-wrap:wrap;padding:var(--pi-spacing-6) 0 0}._thumb_nzfk5_11{position:relative;width:48px;height:48px;border-radius:var(--pi-radius-base);overflow:hidden;border:1px solid var(--pi-color-border);flex-shrink:0}._thumb_nzfk5_11 img{width:100%;height:100%;object-fit:cover;display:block}._remove_nzfk5_28{position:absolute;top:-2px;right:-2px;width:16px;height:16px;background:var(--pi-color-statusDanger);color:#fff;border:none;border-radius:50%;font-size:var(--pi-font-size-3xs);line-height:16px;text-align:center;cursor:pointer;padding:0}._picker_11c3i_4{display:flex;flex-direction:column;gap:var(--pi-spacing-4)}._search_11c3i_10{width:100%;box-sizing:border-box;padding:var(--pi-spacing-6) var(--pi-spacing-8);border-radius:var(--pi-radius-md);border:1px solid var(--pi-color-border);background:var(--pi-color-surface2);color:var(--pi-color-foreground);font-size:var(--pi-font-size-xs);outline:none}._search_11c3i_10::placeholder{color:var(--pi-color-foregroundMuted)}._search_11c3i_10:focus{border-color:var(--pi-color-accent)}._list_11c3i_28{max-height:320px;overflow-y:auto}._item_11c3i_33{display:flex;align-items:center;gap:var(--pi-spacing-6);padding:var(--pi-spacing-6) var(--pi-spacing-8);border-radius:var(--pi-radius-base);font-size:var(--pi-font-size-sm);cursor:pointer;outline:none;scroll-margin-top:var(--pi-spacing-24)}._item_11c3i_33:hover,._item_11c3i_33[data-highlighted],._item_11c3i_33._itemActive_11c3i_50{background:color-mix(in srgb,var(--pi-color-surface1) 85%,var(--pi-color-foreground) 15%)}._checkSlot_11c3i_54{width:var(--pi-icon-size-md);flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;color:var(--pi-color-foreground)}._label_11c3i_63{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._modelId_11c3i_69{color:var(--pi-color-foregroundMuted);margin-left:var(--pi-spacing-4);font-size:var(--pi-font-size-xs);white-space:nowrap}._state_11c3i_76{display:flex;align-items:center;justify-content:center;padding:var(--pi-spacing-12);color:var(--pi-color-foregroundMuted);font-size:var(--pi-font-size-xs)}._stateError_11c3i_85{padding:var(--pi-spacing-8);color:var(--pi-color-statusDanger);font-size:var(--pi-font-size-xs)}._commandContent_11c3i_95{max-width:420px}._commandList_11c3i_98{display:flex;flex-direction:column;gap:var(--pi-spacing-2)}._commandItem_11c3i_103{flex-direction:column;align-items:stretch;gap:var(--pi-spacing-4);padding:var(--pi-spacing-8) var(--pi-spacing-10)}._commandItem_11c3i_103:hover{background:color-mix(in srgb,var(--pi-color-foreground) 10%,transparent)}._commandItem_11c3i_103._itemActive_11c3i_50{background:var(--pi-color-surface0);box-shadow:inset 2px 0 0 var(--pi-color-accent);border-radius:var(--pi-radius-none)}._commandItemHeader_11c3i_135{display:flex;align-items:center;justify-content:space-between;gap:var(--pi-spacing-8);width:100%}._commandItemHeader_11c3i_135 ._label_11c3i_63{flex:1;min-width:0;font-size:var(--pi-font-size-sm);font-weight:600;color:var(--pi-color-foreground)}._commandKindBadge_11c3i_149{flex-shrink:0;display:inline-flex;align-items:center;padding:0 var(--pi-spacing-4);border-radius:var(--pi-radius-full);border:1px solid var(--pi-color-border);background:var(--pi-color-surface2);color:var(--pi-color-foregroundMuted);font-size:var(--pi-font-size-4xs);font-weight:600;text-transform:uppercase;letter-spacing:.02em;white-space:nowrap;line-height:1.5}._commandKindExtension_11c3i_168{background:color-mix(in srgb,var(--pi-color-accent) 18%,transparent);border-color:color-mix(in srgb,var(--pi-color-accent) 45%,transparent);color:var(--pi-color-accent)}._commandKindPrompt_11c3i_173{background:color-mix(in srgb,var(--pi-color-statusSuccess) 18%,transparent);border-color:color-mix(in srgb,var(--pi-color-statusSuccess) 45%,transparent);color:var(--pi-color-statusSuccess)}._commandKindSkill_11c3i_178{background:color-mix(in srgb,var(--pi-color-statusMerged) 18%,transparent);border-color:color-mix(in srgb,var(--pi-color-statusMerged) 45%,transparent);color:var(--pi-color-statusMerged)}._commandDescription_11c3i_183{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;text-overflow:ellipsis;white-space:normal;line-height:1.4;font-size:var(--pi-font-size-xs);color:var(--pi-color-foregroundMuted)}._composer_afpks_4{padding:var(--pi-spacing-8) var(--pi-spacing-16) var(--pi-spacing-12);border-top:1px solid var(--pi-color-border);background:var(--pi-color-surface1);flex-shrink:0}._card_afpks_13{display:flex;flex-direction:column;gap:var(--pi-spacing-4);padding:var(--pi-spacing-6);border:1px solid var(--pi-color-border);border-radius:var(--pi-radius-xl);background:var(--pi-color-surface2);transition:border-color .12s ease}._card_afpks_13._flash_afpks_27{border-color:color-mix(in srgb,var(--pi-color-accentBright) 45%,var(--pi-color-border) 55%)}@media(prefers-reduced-motion:reduce){._card_afpks_13._flash_afpks_27{transition:none}}._note_afpks_41{margin-top:var(--pi-spacing-4);font-size:var(--pi-font-size-3xs);color:var(--pi-color-foregroundMuted)}._card_afpks_13:has(._textarea_afpks_49:focus){border-color:var(--pi-color-accent)}._textarea_afpks_49{resize:none;min-height:38px;max-height:160px;overflow-y:auto;font-size:var(--pi-font-size-md)}._card_afpks_13 ._textarea_afpks_49{background:transparent;border-color:transparent}._card_afpks_13 ._textarea_afpks_49:focus{border-color:transparent;outline:none}._textareaWrap_afpks_73{position:relative;display:flex;min-width:0}._textareaWrap_afpks_73 ._textarea_afpks_49{position:relative}._highlightLayer_afpks_61{position:absolute;top:0;right:0;bottom:0;left:0;padding:var(--pi-spacing-8) var(--pi-spacing-12);border:1px solid transparent;box-sizing:border-box;font-size:var(--pi-font-size-md);font-family:var(--pi-font-ui);line-height:normal;white-space:pre-wrap;overflow-wrap:break-word;overflow:hidden;color:transparent;pointer-events:none}._commandMark_afpks_96{background:color-mix(in srgb,var(--pi-color-accent) 24%,transparent);color:transparent;border-radius:var(--pi-radius-base);box-shadow:0 0 0 1px color-mix(in srgb,var(--pi-color-accent) 55%,transparent),0 0 0 3px color-mix(in srgb,var(--pi-color-accent) 24%,transparent)}._hiddenFileInput_afpks_121{display:none}._toolbar_afpks_127{display:flex;align-items:center;gap:var(--pi-spacing-2);min-width:0}._toolbarRight_afpks_134{display:flex;align-items:center;gap:var(--pi-spacing-6);margin-left:auto;min-width:0}._toolBtn_afpks_142{flex-shrink:0}._card_afpks_13 ._roundBtn_afpks_148{border-radius:var(--pi-radius-full);flex-shrink:0}._modelBtn_afpks_153{display:flex;align-items:center;gap:var(--pi-spacing-2);min-width:0;max-width:340px;padding:var(--pi-spacing-4) var(--pi-spacing-6);border:none;border-radius:var(--pi-radius-md);background:transparent;color:var(--pi-color-foregroundMuted);font-family:var(--pi-font-ui);font-size:var(--pi-font-size-sm);cursor:pointer}._modelBtn_afpks_153:hover:not(:disabled),._modelBtn_afpks_153[data-state=open]{background:var(--pi-color-surface3);color:var(--pi-color-foreground)}._modelBtn_afpks_153:disabled{cursor:default;opacity:.6}._modelLabel_afpks_183{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-color-foreground)}._modelId_afpks_181{flex-shrink:8;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pi-color-foregroundMuted);font-size:var(--pi-font-size-xs)}._modelChevron_afpks_201{flex-shrink:0;transition:transform .15s ease}._modelBtn_afpks_153[data-state=open] ._modelChevron_afpks_201{transform:rotate(180deg)}._track_oxvl6_2{position:absolute;inset-inline:0;top:0;z-index:1;height:3px;background:color-mix(in srgb,var(--pi-color-accent) 22%,transparent);overflow:hidden}._sweep_oxvl6_24{position:absolute;inset-block:0;width:38%;left:-38%;background:linear-gradient(90deg,transparent,var(--pi-color-accent) 35%,color-mix(in srgb,var(--pi-color-accent) 75%,var(--pi-color-accentBright)) 50%,var(--pi-color-accent) 65%,transparent);animation:_sweep_oxvl6_24 1.5s linear infinite}@keyframes _sweep_oxvl6_24{0%{left:-38%}to{left:100%}}@media(prefers-reduced-motion:reduce){._sweep_oxvl6_24{animation:none;width:100%;left:0;opacity:var(--pi-opacity-50)}}._visuallyHidden_oxvl6_64{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}._panel_1tq06_1{position:relative}._empty_1tq06_5{display:flex;align-items:center;justify-content:center;height:100%;color:var(--pi-color-foregroundMuted);font-size:var(--pi-font-size-sm)}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{r as h,j as t}from"./vendor-react-DQUAl2K8.js";import{a as jt,b as bt,m as yt,u as ve}from"./vendor-query-i7fr__Xm.js";import{D as xe,F as L,u as W,G as Nt,I as q,H as St,J as Ct,B as E,K as wt,M as Ge,S as je,z as Dt,N as Bt,O as Tt,o as Et,n as At,Q as Rt,R as It,U as Lt,m as Ot,W as Pt,E as Mt,X as de,r as be,Y as ye,Z as Ft,_ as ce,h as qt,$ as Kt,A as zt,P as Fe}from"./index-T-iCQirw.js";import{L as Ht,G as $t,S as Wt,a as Ut,P as Gt,E as Vt,T as Ve,C as me,b as Ne,B as Yt,c as Ye,d as Jt,A as Qt,e as Xt,f as Zt,U as en,g as tn,h as nn,i as sn,j as on,k as rn,l as qe,m as an,N as cn,n as ln}from"./vendor-icons-K8oF_80Q.js";import{u as dn}from"./use-provider-auth-list-Dlczxxvd.js";import{N as C}from"./vendor-DaF96HbP.js";import{S as Je,M as Qe,r as un}from"./markdown-D1SSpG2J.js";import{D as mn,p as fn}from"./DiffView-D1TsZBGe.js";import{R as Se,T as Ce,I as Xe}from"./vendor-overlays-ar75LZPp.js";import"./vendor-dnd-CayJj8TC.js";import"./vendor-highlight-Ddi_n-Jh.js";import"./vendor-markdown-DJUOT8ep.js";import"./href-resolution-mWbiAWb5.js";function Ze(e,s){if(s.trim()==="")return e;const n=s.toLowerCase();return e.filter(o=>o.label.toLowerCase().includes(n)||o.description!==void 0&&o.description.toLowerCase().includes(n))}const pn={shell:Ve,read:Vt,edit:Gt,write:Ut,search:Wt,fetch:$t,task:Ht};function hn(e){return pn[e.kind]??Ve}function et(e){switch(e.kind){case"read":case"write":case"edit":return e.path??null;default:return null}}function gn(e){return e.kind==="write"||e.kind==="edit"||e.kind==="shell"}function _n(e){const s=[];if(e.kind==="edit"&&e.diff)s.push({kind:"diff",patch:e.diff});else{const n=xe(e);n&&s.push({kind:"code",text:n})}return e.output&&s.push({kind:"code",text:e.output}),s}const Ke={shell:{label:"SHELL",token:"statusInfo"},read:{label:"READ",token:"statusInfo"},write:{label:"WRITE",token:"statusSuccess"},edit:{label:"EDIT",token:"statusWarning"},search:{label:"SEARCH",token:"statusInfo"},fetch:{label:"FETCH",token:"statusInfo"},task:{label:"TASK",token:"foregroundMuted"}};function xn(e){return Ke[e.kind]??Ke.task}function kn(e){if(!e)return{added:0,removed:0};let s=0,n=0;for(const o of e.split(`
|
|
2
|
-
`))o.startsWith("+++")||o.startsWith("---")||(o.startsWith("+")?s++:o.startsWith("-")&&n++);return{added:s,removed:n}}function vn(e){return e?(e.endsWith(`
|
|
3
|
-
`)?e.slice(0,-1):e).split(`
|
|
4
|
-
`).length:0}const jn=500;let pe;function bn(e,s,n,o){clearTimeout(pe),pe=setTimeout(()=>{pe=void 0,e.invalidateQueries({queryKey:["file"]}),e.invalidateQueries({queryKey:["explorer"]}),s&&n&&s.connection.request("checkout_refresh_request",{cwd:n}).catch(()=>{})},jn)}function yn({sessionId:e,event:s,timestamp:n,client:o,queryClient:r}){const a=L.getState();switch(a.applyStreamEvent(e,s,n),s.kind){case"turn_started":a.setStatus(e,"running");break;case"turn_completed":a.setStatus(e,"idle");break;case"turn_failed":a.setStatus(e,"error");break;case"turn_canceled":a.setStatus(e,"idle");break;case"tool_call":{if(s.status==="completed"&&gn(s.tool)){const c=a.sessions[e],l=(c==null?void 0:c.cwd)||null;bn(r,o,l,et(s.tool))}break}}}function Nn(e){const s=W(r=>r.client),n=L(r=>{var a;return((a=r.sessions[e])==null?void 0:a.agentId)??null}),o=jt();h.useEffect(()=>!s||!n?void 0:s.agent(n).timeline.subscribe((a,c)=>{const l=typeof c.timestamp=="number"?new Date(c.timestamp).toISOString():c.timestamp;yn({sessionId:e,event:a,timestamp:l,client:s,queryClient:o})}),[s,n,e,o])}const tt=64;function he(e){return e.clientHeight>0}function Sn(e,s,n,o=tt){switch(s.kind){case"scroll":return he(n)?n.scrollHeight-n.scrollTop-n.clientHeight<=o?{pinned:!0,stick:!1}:{pinned:s.gesture?!1:e,stick:!1}:{pinned:e,stick:!1};case"tail":return{pinned:e,stick:e&&he(n)};case"shown":return{pinned:e,stick:e};case"pin":return{pinned:!0,stick:he(n)}}}function Cn(e){const s=e[e.length-1];return(s==null?void 0:s.kind)==="user"?s.id:null}const wn="_shellRow_1kabp_2",Dn="_rail_1kabp_10",Bn="_disc_1kabp_18",Tn="_connector_1kabp_28",En="_content_1kabp_2",An="_metaLine_1kabp_40",Rn="_metaTime_1kabp_52",In="_forkButton_1kabp_66",O={shellRow:wn,rail:Dn,disc:Bn,connector:Tn,content:En,metaLine:An,metaTime:Rn,forkButton:In};function K({disc:e,discClassName:s,connector:n,meta:o,metaTrailing:r,className:a,children:c}){return t.jsxs("div",{className:O.shellRow,children:[t.jsxs("div",{className:O.rail,children:[t.jsx("span",{className:C(O.disc,s),children:e}),n&&t.jsx("span",{className:O.connector})]}),t.jsxs("div",{className:C(O.content,a),children:[o&&t.jsxs("div",{className:O.metaLine,children:[o,r]}),c]})]})}function ze(e){return typeof e=="number"?e:Date.parse(e)}function Ln(e,s){const n=ze(e.entry.createdAt),o=ze(s.entry.createdAt);return n!==o?n-o:e.entry.requestId<s.entry.requestId?-1:e.entry.requestId>s.entry.requestId?1:0}function On(e,s){return[...e.map(o=>({kind:"pending",entry:o})),...s.map(o=>({kind:"resolved",entry:o}))].toSorted(Ln)}function Pn(e){return e.entry.requestId}function nt(e){return e.receivedAt===void 0}const Mn=4;function Fn(e,s){let n=0;const o=e.map(l=>l.kind!=="pending"?{item:l,collapsed:!1}:(n++,{item:l,collapsed:!s&&n>Mn})),r=o.filter(l=>l.collapsed).length,a=o.findIndex(l=>l.collapsed),c=[];return o.forEach((l,m)=>{m===a&&c.push({kind:"more",count:r}),c.push({kind:"card",item:l.item,collapsed:l.collapsed})}),c}function qn(e,s){if(e.timeoutMs===void 0)return{show:!1,fraction:0,approximate:!1};const n=Nt(e,s)??0;return{show:!0,fraction:Math.max(0,Math.min(1,n/e.timeoutMs)),approximate:e.receivedAt===void 0}}function st(e){return e==="editor"}const Kn="Esc again to dismiss — the extension gets an empty answer";function zn(e,s){return s?{kind:"warning",text:Kn}:{kind:"keys",segments:[{key:st(e)?"⇧↵":"↵",label:"submit"},{key:"Esc",label:"dismiss"}]}}function Hn(e){return e?{armed:!1,resolve:!0}:{armed:!0,resolve:!1}}const $n=5,Wn=40,Un=6;function Gn(e){return{mode:e.length>=$n||e.some(n=>n.length>Wn)?"stack":"row",scrolls:e.length>Un}}function ke(e){const s=e.split(`
|
|
5
|
-
`),n=[];let o=!1;for(const r of s)if(r===""){if(o)continue;o=!0,n.push("")}else o=!1,n.push(r);return n}function Vn(e,s){return{title:ke(e),...s!==void 0?{message:ke(s)}:{}}}const Yn="_askDisc_ffqf1_5",Jn="_card_ffqf1_9",Qn="_cardInert_ffqf1_41",Xn="_askDiscInert_ffqf1_47",Zn="_reconnectingNote_ffqf1_52",es="_reconnectingDot_ffqf1_61",ts="_deadlineBar_ffqf1_71",ns="_deadlineApproximate_ffqf1_80",ss="_header_ffqf1_85",os="_askBadge_ffqf1_16",rs="_methodName_ffqf1_101",as="_title_ffqf1_107",is="_titleEmphasised_ffqf1_115",cs="_message_ffqf1_119",ls="_emptyOptionsNote_ffqf1_127",ds="_controls_ffqf1_133",us="_controlsStack_ffqf1_141",ms="_controlsScroll_ffqf1_148",fs="_optionButton_ffqf1_153",ps="_field_ffqf1_161",hs="_editorField_ffqf1_168",gs="_rawPayload_ffqf1_176",_s="_resolvedCard_ffqf1_190",xs="_askBadgeNeutral_ffqf1_204",ks="_resolvedMethodName_ffqf1_209",vs="_outcome_ffqf1_218",js="_outcomeSuccess_ffqf1_229",bs="_outcomeText_ffqf1_233",ys="_hint_ffqf1_255",Ns="_hintKey_ffqf1_270",Ss="_hintSep_ffqf1_278",Cs="_recoveredChip_ffqf1_285",ws="_collapsedPendingCard_ffqf1_297",Ds="_moreRow_ffqf1_303",p={askDisc:Yn,card:Jn,cardInert:Qn,askDiscInert:Xn,reconnectingNote:Zn,reconnectingDot:es,deadlineBar:ts,deadlineApproximate:ns,header:ss,askBadge:os,methodName:rs,title:as,titleEmphasised:is,message:cs,emptyOptionsNote:ls,controls:ds,controlsStack:us,controlsScroll:ms,optionButton:fs,field:ps,editorField:hs,rawPayload:gs,resolvedCard:_s,askBadgeNeutral:xs,resolvedMethodName:ks,outcome:vs,outcomeSuccess:js,outcomeText:bs,hint:ys,hintKey:Ns,hintSep:Ss,recoveredChip:Cs,collapsedPendingCard:ws,moreRow:Ds},Bs=250,Ts=320;function J(e,s){const n=e[s];return typeof n=="string"?n:void 0}function Es(e,s){const n=e[s];return Array.isArray(n)?n.filter(o=>typeof o=="string"):[]}function As({item:e,connector:s,collapsed:n=!1,autoFocus:o=!1,sessionTitle:r}){return e.kind==="resolved"?t.jsx(Ls,{entry:e.entry,connector:s}):n?t.jsx(Rs,{entry:e.entry,connector:s}):t.jsx(Ps,{entry:e.entry,connector:s,autoFocus:o,sessionTitle:r})}function ot(){return t.jsx("span",{className:p.recoveredChip,children:"still waiting"})}function Rs({entry:e,connector:s}){return t.jsx(K,{disc:t.jsx(q,{icon:me,size:"xs",color:"var(--pi-color-statusWarning)"}),discClassName:p.askDisc,connector:s,children:t.jsxs("div",{className:C(p.resolvedCard,p.collapsedPendingCard),children:[t.jsx("span",{className:p.askBadge,children:"ASK"}),t.jsx("span",{className:p.resolvedMethodName,children:e.method}),nt(e)&&t.jsx(ot,{})]})})}function Is({count:e,connector:s,onExpand:n}){return t.jsx(K,{disc:t.jsx(q,{icon:me,size:"xs",color:"var(--pi-color-foregroundMuted)"}),discClassName:p.askDiscInert,connector:s,children:t.jsxs("button",{type:"button",className:p.moreRow,onClick:n,children:[e," more waiting"]})})}function Ls({entry:e,connector:s}){const n=St(e);return t.jsx(K,{disc:t.jsx(q,{icon:me,size:"xs",color:"var(--pi-color-foregroundMuted)"}),discClassName:p.askDiscInert,connector:s,children:t.jsxs("div",{className:p.resolvedCard,children:[t.jsx("span",{className:C(p.askBadge,p.askBadgeNeutral),children:"ASK"}),t.jsx("span",{className:p.resolvedMethodName,children:e.method}),t.jsxs("span",{className:C(p.outcome,n.tone==="success"&&p.outcomeSuccess),children:[n.glyph==="check"&&t.jsx(Ne,{size:11,"aria-hidden":!0}),t.jsx("span",{className:C(n.truncate&&p.outcomeText),children:n.text})]})]})})}function U(e,s){return e.answerable?e.submitting?s?{loading:!0,style:{opacity:1}}:{disabled:!0}:{}:{disabled:!0,style:{opacity:1}}}function Os({hint:e}){return e.kind==="warning"?t.jsx("p",{className:p.hint,children:e.text}):t.jsx("p",{className:p.hint,children:e.segments.map((s,n)=>t.jsxs(h.Fragment,{children:[n>0&&t.jsx("span",{className:p.hintSep,children:"·"}),t.jsx("span",{className:p.hintKey,children:s.key}),s.label]},s.label))})}function Ps({entry:e,connector:s,autoFocus:n=!1,sessionTitle:o}){const[r,a]=h.useState(()=>Date.now()),c=qn(e,r),[l,m]=h.useState(!1),d=h.useRef(null),f=h.useRef(null),u=h.useRef(null);h.useEffect(()=>{if(!c.show)return;const v=setInterval(()=>a(Date.now()),Bs);return()=>clearInterval(v)},[e.requestId,e.timeoutMs,c.show]),h.useEffect(()=>{var y,A;if(!n||!e.answerable)return;const v=document.activeElement;(v instanceof HTMLTextAreaElement||v instanceof HTMLInputElement)&&v.value.length>0&&!((y=d.current)!=null&&y.contains(v))||(A=f.current)==null||A.focus()},[n,e.answerable]);function x(v){var _,y;e.answerable&&(v.target.closest("button, input, textarea, a, select")||(_=d.current)!=null&&_.contains(document.activeElement)||(y=d.current)==null||y.focus())}function B(v){Ct(e.requestId,v)}function P(v){var y;if(v.key!=="Escape"||!e.answerable)return;v.preventDefault(),v.stopPropagation();const _=Hn(l);if(m(_.armed),!_.resolve){(y=u.current)==null||y.focus();return}u.current?u.current.click():B({cancelled:!0})}function R(v){v.currentTarget.contains(v.relatedTarget)||m(!1)}return t.jsxs(K,{disc:t.jsx(q,{icon:me,size:"xs",color:e.answerable?"var(--pi-color-statusWarning)":"var(--pi-color-foregroundMuted)"}),discClassName:e.answerable?p.askDisc:p.askDiscInert,connector:s,children:[t.jsxs("div",{ref:d,className:C(p.card,!e.answerable&&p.cardInert),role:"group","aria-label":`Question in ${o}`,tabIndex:-1,onKeyDown:P,onMouseDown:x,onBlur:R,children:[c.show&&t.jsx("div",{className:C(p.deadlineBar,c.approximate&&p.deadlineApproximate),style:{width:`${c.fraction*100}%`}}),t.jsxs("div",{className:p.header,children:[t.jsx("span",{className:C(p.askBadge,!e.answerable&&p.askBadgeNeutral),"aria-hidden":"true",children:"ASK"}),t.jsx("span",{className:p.methodName,children:e.method}),nt(e)&&t.jsx(ot,{})]}),t.jsx(Ms,{entry:e,onSubmit:B,primaryRef:f,dismissRef:u})]}),t.jsx(Os,{hint:zn(e.method,l)}),!e.answerable&&t.jsxs("p",{className:p.reconnectingNote,children:[t.jsx("span",{className:p.reconnectingDot}),"Reconnecting — you can answer again in a moment"]})]})}function Ms({entry:e,onSubmit:s,primaryRef:n,dismissRef:o}){const{method:r,payload:a}=e;return r==="select"?t.jsx(Fs,{entry:e,payload:a,onSubmit:s,primaryRef:n,dismissRef:o}):r==="confirm"?t.jsx(qs,{entry:e,payload:a,onSubmit:s,primaryRef:n,dismissRef:o}):r==="input"?t.jsx(Ks,{entry:e,payload:a,onSubmit:s,primaryRef:n}):r==="editor"?t.jsx(zs,{entry:e,payload:a,onSubmit:s,primaryRef:n,dismissRef:o}):t.jsx(Hs,{entry:e,method:r,payload:a,onSubmit:s,primaryRef:n,dismissRef:o})}function ue({text:e}){return t.jsx("div",{className:p.title,children:ke(e).join(`
|
|
6
|
-
`)})}function Fs({entry:e,payload:s,onSubmit:n,primaryRef:o,dismissRef:r}){const a=J(s,"title")??"",c=Es(s,"options"),[l,m]=h.useState(null);if(c.length===0){const f=U(e,l===0);return t.jsxs(t.Fragment,{children:[t.jsx(ue,{text:a}),t.jsx("p",{className:p.emptyOptionsNote,children:"The extension offered no options."}),t.jsx("div",{className:p.controls,children:t.jsx(E,{ref:u=>{o.current=u,r.current=u},size:"xs",variant:"secondary",onClick:()=>{m(0),n({cancelled:!0})},...f,children:"Cancel"})})]})}const d=Gn(c);return t.jsxs(t.Fragment,{children:[t.jsx(ue,{text:a}),t.jsx("div",{className:C(p.controls,d.mode==="stack"&&p.controlsStack,d.scrolls&&p.controlsScroll),children:c.map((f,u)=>t.jsx(E,{ref:u===0?x=>{o.current=x}:void 0,size:"xs",variant:"secondary",className:p.optionButton,onClick:()=>{m(u),n({value:f})},...U(e,l===u),children:f},u))})]})}function qs({entry:e,payload:s,onSubmit:n,primaryRef:o,dismissRef:r}){const a=J(s,"title")??"",c=J(s,"message"),l=Vn(a,c),[m,d]=h.useState(null);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:C(p.title,l.message&&p.titleEmphasised),children:l.title.join(`
|
|
7
|
-
`)}),l.message&&t.jsx("div",{className:p.message,children:l.message.join(`
|
|
8
|
-
`)}),t.jsxs("div",{className:p.controls,children:[t.jsx(E,{ref:f=>{o.current=f},size:"xs",variant:"default",onClick:()=>{d("yes"),n({confirmed:!0})},...U(e,m==="yes"),children:"Yes"}),t.jsx(E,{ref:f=>{r.current=f},size:"xs",variant:"secondary",onClick:()=>{d("no"),n({confirmed:!1})},...U(e,m==="no"),children:"No"})]})]})}function Ks({entry:e,payload:s,onSubmit:n,primaryRef:o}){const r=J(s,"title")??"",a=J(s,"placeholder"),[c,l]=h.useState(""),m=U(e,e.submitting===!0),d=m.disabled===!0||m.loading===!0;return t.jsxs(t.Fragment,{children:[t.jsx(ue,{text:r}),t.jsxs("div",{className:p.controls,children:[t.jsx(wt,{ref:f=>{o.current=f},className:p.field,value:c,placeholder:a,disabled:d,onChange:f=>l(f.target.value),onKeyDown:f=>{f.key!=="Enter"||d||(f.preventDefault(),f.stopPropagation(),n({value:c}))}}),t.jsx(E,{size:"xs",variant:"default",onClick:()=>n({value:c}),...m,children:"Submit"})]})]})}function zs({entry:e,payload:s,onSubmit:n,primaryRef:o,dismissRef:r}){const a=J(s,"title")??"",c=J(s,"prefill")??"",[l,m]=h.useState(c),[d,f]=h.useState(null);return t.jsxs(t.Fragment,{children:[t.jsx(ue,{text:a}),t.jsx(Ge,{ref:u=>{o.current=u},className:p.editorField,rows:3,value:l,disabled:!e.answerable||e.submitting,onChange:u=>{m(u.target.value);const x=u.target;x.style.height="auto",x.style.height=`${Math.min(x.scrollHeight,Ts)}px`},onKeyDown:u=>{u.key!=="Enter"||u.shiftKey!==st(e.method)||(u.preventDefault(),u.stopPropagation(),f("submit"),n({value:l}))}}),t.jsxs("div",{className:p.controls,children:[t.jsx(E,{size:"xs",variant:"default",onClick:()=>{f("submit"),n({value:l})},...U(e,d==="submit"),children:"Submit"}),t.jsx(E,{ref:u=>{r.current=u},size:"xs",variant:"secondary",onClick:()=>{f("cancel"),n({cancelled:!0})},...U(e,d==="cancel"),children:"Cancel"})]})]})}function Hs({entry:e,method:s,payload:n,onSubmit:o,primaryRef:r,dismissRef:a}){const c={method:s,...n},l=U(e,e.submitting===!0);return t.jsxs(t.Fragment,{children:[t.jsx("p",{className:p.title,children:"This extension asked something this version of Pi-Studio can't display."}),t.jsx("pre",{className:p.rawPayload,children:JSON.stringify(c,null,2)}),t.jsx("div",{className:p.controls,children:t.jsx(E,{ref:m=>{r.current=m,a.current=m},size:"xs",variant:"secondary",onClick:()=>o({cancelled:!0}),...l,children:"Cancel"})})]})}function He(e){if(e===void 0)return null;const s=typeof e=="number"?e:Date.parse(e);return Number.isNaN(s)?null:s}function $s(e,s,n,o){if(s.length===0)return e.map(n);const r=[];let a=0;const c=l=>{for(;a<e.length;){const m=e[a];if(m===void 0)break;if(l!==null){const d=He(m.timestamp);if(d!==null&&d>l)break}r.push(n(m)),a++}};for(const l of s){if(l.kind==="more"){r.push(o(l));continue}c(He(l.item.entry.createdAt)),r.push(o(l))}for(;a<e.length;a++){const l=e[a];l!==void 0&&r.push(n(l))}return r}function Ws(e,s){return!e||s===void 0?!1:s.every(n=>n.configured===!1)}const Us=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function $e(e){return String(e).padStart(2,"0")}function we(e){if(!e)return;const s=new Date(e);if(!Number.isNaN(s.getTime()))return`${Us[s.getMonth()]} ${s.getDate()}, ${$e(s.getHours())}:${$e(s.getMinutes())}`}const Gs="_queuedBadge_mdmbp_8",Vs="_finalChip_mdmbp_20",Ys="_userDisc_mdmbp_30",Js="_userAligned_mdmbp_34",Qs="_userPendingRow_mdmbp_40",Xs="_userBubble_mdmbp_44",Zs="_userBubbleFailed_mdmbp_58",eo="_userImages_mdmbp_63",to="_userImage_mdmbp_63",no="_imageDialog_mdmbp_79",so="_imageDialogPreview_mdmbp_83",oo="_assistantDisc_mdmbp_93",ro="_assistantBody_mdmbp_97",ao="_reasoningDisc_mdmbp_108",io="_reasoningBody_mdmbp_112",co="_toolDisc_mdmbp_123",lo="_toolCardBody_mdmbp_127",uo="_toolCardBodyRunning_mdmbp_134",mo="_toolCardBodyCompleted_mdmbp_138",fo="_toolCardBodyError_mdmbp_142",po="_toolHeader_mdmbp_146",ho="_toolHeaderRunning_mdmbp_172",go="_toolChevron_mdmbp_182",_o="_toolChevronOpen_mdmbp_188",xo="_kindBadge_mdmbp_192",ko="_toolPath_mdmbp_204",vo="_toolTrailing_mdmbp_213",jo="_toolStatusRunning_mdmbp_221",bo="_toolStatusSuccess_mdmbp_228",yo="_toolStatusError_mdmbp_232",No="_toolStatusUnknown_mdmbp_236",So="_toolDiffAdded_mdmbp_240",Co="_toolDiffRemoved_mdmbp_244",wo="_toolOpenButton_mdmbp_248",Do="_toolBody_mdmbp_266",Bo="_toolCode_mdmbp_272",To="_toolOutputStrip_mdmbp_283",Eo="_toolDiffPreview_mdmbp_293",Ao="_toolDiffPreviewLine_mdmbp_301",Ro="_toolDiffPreviewAdd_mdmbp_305",Io="_toolDiffPreviewDel_mdmbp_310",Lo="_toolDiffPreviewMore_mdmbp_315",Oo="_errorDisc_mdmbp_322",Po="_errorCard_mdmbp_326",Mo="_errorLead_mdmbp_335",Fo="_systemRow_mdmbp_342",g={queuedBadge:Gs,finalChip:Vs,userDisc:Ys,userAligned:Js,userPendingRow:Qs,userBubble:Xs,userBubbleFailed:Zs,userImages:eo,userImage:to,imageDialog:no,imageDialogPreview:so,assistantDisc:oo,assistantBody:ro,reasoningDisc:ao,reasoningBody:io,toolDisc:co,toolCardBody:lo,toolCardBodyRunning:uo,toolCardBodyCompleted:mo,toolCardBodyError:fo,toolHeader:po,toolHeaderRunning:ho,toolChevron:go,toolChevronOpen:_o,kindBadge:xo,toolPath:ko,toolTrailing:vo,toolStatusRunning:jo,toolStatusSuccess:bo,toolStatusError:yo,toolStatusUnknown:No,toolDiffAdded:So,toolDiffRemoved:Co,toolOpenButton:wo,toolBody:Do,toolCode:Bo,toolOutputStrip:To,toolDiffPreview:Eo,toolDiffPreviewLine:Ao,toolDiffPreviewAdd:Ro,toolDiffPreviewDel:Io,toolDiffPreviewMore:Lo,errorDisc:Oo,errorCard:Po,errorLead:Mo,systemRow:Fo};function qo({row:e,assetBase:s=null,owningPaneId:n=null,workspaceCwd:o=null,connector:r}){const a=we(e.timestamp);return t.jsx(K,{disc:t.jsx(q,{icon:Yt,size:"xs",color:"var(--pi-color-accentForeground)"}),discClassName:g.assistantDisc,connector:r,meta:t.jsxs(t.Fragment,{children:["Assistant",a&&t.jsxs("span",{className:O.metaTime,children:[" · ",a]})]}),children:t.jsx("div",{className:g.assistantBody,children:e.streaming?t.jsx(Je,{text:e.text,assetBase:s,owningPaneId:n,workspaceCwd:o}):t.jsx(Qe,{text:e.text,assetBase:s,owningPaneId:n,workspaceCwd:o})})})}function Ko({row:e,owningPaneId:s=null,workspaceCwd:n=null,connector:o}){const r=we(e.timestamp);return t.jsx(K,{disc:t.jsx(q,{icon:Ye,size:"xs",color:"var(--pi-color-foregroundMuted)"}),discClassName:g.reasoningDisc,connector:o,meta:t.jsxs(t.Fragment,{children:["Reasoning",r&&t.jsxs("span",{className:O.metaTime,children:[" · ",r]})]}),metaTrailing:!e.streaming&&t.jsx("span",{className:g.finalChip,children:"final"}),children:t.jsx("div",{className:g.reasoningBody,children:e.streaming?t.jsx(Je,{text:e.text,owningPaneId:s,workspaceCwd:n}):t.jsx(Qe,{text:e.text,owningPaneId:s,workspaceCwd:n})})})}function zo(e){const s=fn(e).filter(o=>o.kind==="add"||o.kind==="del"),n=s[0];return n?{text:n.text,kind:n.kind,moreCount:s.length-1}:null}function Ho(e){return e.status==="completed"?t.jsx("span",{className:g.toolStatusSuccess,children:"✓ completed"}):e.status==="error"?t.jsx("span",{className:g.toolStatusError,children:e.statusText||"error"}):e.statusText&&e.statusText!=="running"?t.jsx("span",{className:g.toolStatusUnknown,children:e.statusText}):t.jsxs("span",{className:g.toolStatusRunning,children:[t.jsx(je,{size:"xs",color:"var(--pi-color-accentBright)"}),"running"]})}function $o({row:e,assetBase:s=null,owningPaneId:n=null,workspaceCwd:o=null,connector:r}){const[a,c]=h.useState(!1),l=xn(e.tool),m=_n(e.tool),d=m.length>0,f=vn(e.tool.output),u=e.tool.kind==="edit"||e.tool.kind==="write"?et(e.tool):null,x=e.tool.kind==="edit"?kn(e.tool.diff):null,B=e.tool.kind==="edit"&&e.tool.diff&&!a?zo(e.tool.diff):null;function P(){d&&c(_=>!_)}function R(_){_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),P())}function v(_){if(_.stopPropagation(),!u)return;const y=un(s,n,o);Dt(u,y.workspaceCwd,y.targetPaneId)}return t.jsx(K,{disc:t.jsx(q,{icon:hn(e.tool),size:"xs",color:"var(--pi-color-foregroundMuted)"}),discClassName:g.toolDisc,connector:r,children:t.jsxs("div",{className:C(g.toolCardBody,e.status==="running"&&g.toolCardBodyRunning,e.status==="completed"&&g.toolCardBodyCompleted,e.status==="error"&&g.toolCardBodyError),children:[t.jsxs("div",{role:"button",tabIndex:d?0:-1,"aria-expanded":d?a:void 0,"aria-disabled":!d,className:C(g.toolHeader,e.status==="running"&&g.toolHeaderRunning),onClick:P,onKeyDown:R,children:[d&&t.jsx(Jt,{size:12,className:C(g.toolChevron,a&&g.toolChevronOpen)}),t.jsx("span",{className:g.kindBadge,style:{"--kindToken":`var(--pi-color-${l.token})`},children:l.label}),t.jsx("span",{className:g.toolPath,title:xe(e.tool),children:xe(e.tool)}),t.jsxs("span",{className:g.toolTrailing,children:[x&&(x.added>0||x.removed>0)&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:g.toolDiffAdded,children:["+",x.added]}),t.jsxs("span",{className:g.toolDiffRemoved,children:["−",x.removed]})]}),Ho(e),u&&t.jsxs("button",{type:"button",className:g.toolOpenButton,onClick:v,onKeyDown:_=>_.stopPropagation(),children:["Open",t.jsx(Qt,{size:10})]})]})]}),f>0&&t.jsxs("div",{className:g.toolOutputStrip,children:["output · ",f," lines"]}),B&&t.jsxs("div",{className:g.toolDiffPreview,children:[t.jsx("div",{className:C(g.toolDiffPreviewLine,B.kind==="add"?g.toolDiffPreviewAdd:g.toolDiffPreviewDel),children:B.text}),B.moreCount>0&&t.jsxs("div",{className:g.toolDiffPreviewMore,children:["… ",B.moreCount," more lines"]})]}),a&&d&&t.jsx("div",{className:g.toolBody,children:m.map((_,y)=>_.kind==="diff"?t.jsx(mn,{patch:_.patch},y):t.jsx("pre",{className:g.toolCode,children:_.text},y))})]})})}const Wo="Fork from here",Uo="Fork conversation from this message";function Go({row:e,connector:s,onFork:n}){const[o,r]=h.useState(null),a=we(e.timestamp);return t.jsxs(K,{disc:t.jsx(q,{icon:en,size:"xs",color:"var(--pi-color-successForeground)"}),discClassName:g.userDisc,connector:s,className:C(g.userAligned,e.pending&&g.userPendingRow),meta:t.jsxs(t.Fragment,{children:["You",a&&t.jsxs("span",{className:O.metaTime,children:[" · ",a]}),e.failed&&" · failed to send"]}),metaTrailing:t.jsxs(t.Fragment,{children:[e.queued&&!e.failed&&t.jsxs("span",{className:g.queuedBadge,children:[t.jsx(Xt,{size:9}),"queued"]}),n&&t.jsx(Tt,{className:O.forkButton,hoverBase:"var(--pi-color-surface3)",title:Wo,"aria-label":Uo,onClick:n,children:t.jsx(Zt,{size:13,strokeWidth:1.8,"aria-hidden":"true"})})]}),children:[t.jsx("span",{className:C(g.userBubble,e.failed&&g.userBubbleFailed),children:e.text}),e.images&&e.images.length>0&&t.jsx("div",{className:g.userImages,children:e.images.map((c,l)=>{const m=`data:${c.mimeType??"image/png"};base64,${c.data??""}`;return t.jsx("img",{className:g.userImage,src:m,alt:"",role:"button",tabIndex:0,onClick:()=>r(m),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&r(m)}},l)})}),t.jsx(Bt,{open:o!==null,onOpenChange:c=>{c||r(null)},title:"Image",width:"auto",bare:!0,className:g.imageDialog,children:o&&t.jsx("img",{className:g.imageDialogPreview,src:o,alt:""})})]})}function Vo({row:e,connector:s}){return t.jsx(K,{disc:t.jsx(q,{icon:tn,size:"xs",color:"var(--pi-color-destructive)"}),discClassName:g.errorDisc,connector:s,children:t.jsxs("div",{className:g.errorCard,children:[t.jsx("span",{className:g.errorLead,children:"Error"})," · ",e.text]})})}function Yo({row:e}){return t.jsx("div",{className:g.systemRow,children:e.text})}const Jo=500;function Qo(e,s){const n=h.useRef(!0),[o,r]=h.useState(!0),a=h.useRef(0),c=h.useCallback(d=>{const f=s.current,u=f?{scrollTop:f.scrollTop,scrollHeight:f.scrollHeight,clientHeight:f.clientHeight}:{scrollTop:0,scrollHeight:0,clientHeight:0},x=Sn(n.current,d,u);x.pinned!==n.current&&(n.current=x.pinned,r(x.pinned)),x.stick&&e.options.count>0&&e.scrollToEnd({behavior:"auto"})},[s,e]);h.useEffect(()=>{const d=s.current;if(!d)return;const f=()=>{a.current=performance.now()},u=()=>{c({kind:"scroll",gesture:performance.now()-a.current<Jo})};d.addEventListener("scroll",u,{passive:!0}),d.addEventListener("wheel",f,{passive:!0}),d.addEventListener("touchmove",f,{passive:!0}),d.addEventListener("pointerdown",f,{passive:!0}),d.addEventListener("keydown",f,{passive:!0});const x=new ResizeObserver(()=>{d.clientHeight>0&&c({kind:"shown"})});return x.observe(d),()=>{x.disconnect(),d.removeEventListener("scroll",u),d.removeEventListener("wheel",f),d.removeEventListener("touchmove",f),d.removeEventListener("pointerdown",f),d.removeEventListener("keydown",f)}},[c,s]);const l=h.useCallback(()=>c({kind:"tail"}),[c]),m=h.useCallback(()=>c({kind:"pin"}),[c]);return{pinned:o,followTail:l,pinToBottom:m}}const Xo="_root_1xg4h_6",Zo="_viewport_1xg4h_13",er="_inner_1xg4h_20",tr="_rowWrap_1xg4h_25",nr="_empty_1xg4h_35",sr="_nudge_1xg4h_47",or="_jumpToLatest_1xg4h_56",Y={root:Xo,viewport:Zo,inner:er,rowWrap:tr,empty:nr,nudge:sr,jumpToLatest:or},rr=160;function ar(e){return e.kind==="ask"?`ask:${Pn(e.item)}`:e.kind==="ask-more"?"ask-more":e.row.id}function ir(e,s,n,o,r,a){switch(e.kind){case"user":{const c=a.ordinalByRowId.get(e.id),l=c!==void 0?()=>a.onForkFromRow(c):null;return t.jsx(Go,{row:e,connector:!s,onFork:l})}case"assistant":return t.jsx(qo,{row:e,assetBase:n,owningPaneId:o,workspaceCwd:r,connector:!s});case"reasoning":return t.jsx(Ko,{row:e,owningPaneId:o,workspaceCwd:r,connector:!s});case"tool":return t.jsx($o,{row:e,assetBase:n,owningPaneId:o,workspaceCwd:r,connector:!s});case"error":return t.jsx(Vo,{row:e,connector:!s});case"system":return t.jsx(Yo,{row:e})}}function cr(e,s,n,o,r,a,c,l,m){return e.kind==="ask"?t.jsx(As,{item:e.item,collapsed:e.collapsed,connector:!s,autoFocus:e.item.kind==="pending"&&e.item.entry.requestId===c,sessionTitle:l}):e.kind==="ask-more"?t.jsx(Is,{count:e.count,connector:!s,onExpand:a}):ir(e.row,s,n,o,r,m)}function lr({session:e,owningPaneId:s,workspaceCwd:n}){var H,ne;const o=e.timeline.rows,r=e.status==="running",a=Et(),c=At(e.cwd,a),l=h.useRef(null),m=Rt(e),d=It(e.agentId??""),f=Lt(e.agentId??""),[u,x]=h.useState(!1),B=L(N=>N.activeSessionId===e.id),P=Ot(N=>{var D;return((D=N.layouts[n])==null?void 0:D.focusedPaneId)===s}),R=B&&P?((H=d[0])==null?void 0:H.requestId)??null:null,v=h.useMemo(()=>{const N=Fn(On(d,f),u);return $s(o,N,D=>({kind:"row",row:D}),D=>D.kind==="more"?{kind:"ask-more",count:D.count}:{kind:"ask",item:D.item,collapsed:D.collapsed})},[o,d,f,u]),_=W(N=>N.status==="open"),y=W(N=>N.serverInfo),A=!!((ne=y==null?void 0:y.features)!=null&&ne.providerAuth),G=Pt(N=>N.openSettings),{data:Q}=dn(o.length===0&&_&&A),w=Ws(A,Q),T=bt({count:v.length,getScrollElement:()=>l.current,estimateSize:()=>rr,overscan:8,getItemKey:N=>{const D=v[N];return D?ar(D):N},measureElement:(N,D,$)=>{if(N.offsetParent!==null)return yt(N,D,$);const se=$.indexFromElement(N),ae=$.options.getItemKey(se);return $.itemSizeCache.get(ae)??$.options.estimateSize(se)},anchorTo:"end",scrollEndThreshold:tt}),{pinned:fe,followTail:z,pinToBottom:X}=Qo(T,l),M=Cn(o);return h.useEffect(()=>{z()},[v.length,z]),h.useEffect(()=>{M!==null&&X()},[M,X]),t.jsxs("div",{className:Y.root,children:[t.jsx("div",{className:Y.viewport,ref:l,children:v.length===0?!r&&(w?t.jsxs(Mt,{className:Y.nudge,children:[t.jsx("span",{children:"No messages yet — connect a model provider to get started."}),t.jsx(E,{size:"xs",variant:"secondary",onClick:()=>G(),children:"Connect a model provider"})]}):t.jsx("div",{className:Y.empty,children:"No messages yet — say something to start."})):t.jsx("div",{className:Y.inner,style:{height:T.getTotalSize()},children:T.getVirtualItems().map(N=>{const D=v[N.index];return D?t.jsx("div",{ref:T.measureElement,"data-index":N.index,className:Y.rowWrap,style:{transform:`translateY(${N.start}px)`},children:cr(D,N.index===v.length-1,c,s,n,()=>x(!0),R,e.title,m)},N.key):null})})}),!fe&&v.length>0&&t.jsx("button",{type:"button",className:Y.jumpToLatest,onClick:X,title:"Jump to latest","aria-label":"Jump to latest",children:t.jsx(nn,{size:16,"aria-hidden":"true"})})]})}function dr(e,s=!0){const n=W(o=>o.client);return ve({queryKey:be.agentCommands(e),queryFn:async()=>{if(!n)throw new Error("not connected");const o=await de(n,e),{commands:r}=await n.agent(o).listCommands();return r},enabled:!!n&&!!e&&s})}function rt(e,s=!0){const n=W(o=>o.client);return ve({queryKey:be.providerModels(e),queryFn:async()=>{if(!n)throw new Error("not connected");return(await n.providers.listModels(e)).models},enabled:!!n&&!!e&&s})}function ur(e,s,n=!0){const o=W(r=>r.client);return ve({queryKey:be.thinkingLevels(e??"",s),queryFn:async()=>{if(!o||!e)throw new Error("not connected");return(await o.agent(e).listThinkingLevels()).levels},enabled:!!o&&!!e&&n,retry:!1})}const mr="_strip_nzfk5_4",fr="_thumb_nzfk5_11",pr="_remove_nzfk5_28",ge={strip:mr,thumb:fr,remove:pr};function hr({images:e,onRemove:s}){return e.length===0?null:t.jsx("div",{className:ge.strip,children:e.map((n,o)=>t.jsxs("div",{className:ge.thumb,children:[t.jsx("img",{src:n.thumbUrl,alt:""}),t.jsx("button",{type:"button",className:ge.remove,title:"Remove",onClick:()=>s(o),children:"×"})]},o))})}function gr(e){const{promise:s,resolve:n,reject:o}=Promise.withResolvers(),r=new FileReader;return r.onload=()=>{const a=r.result;if(typeof a!="string"){o(new Error("Unexpected FileReader result"));return}const c=a.indexOf(","),l=c>=0?a.slice(c+1):a;n({mimeType:e.type,data:l,thumbUrl:a})},r.onerror=()=>o(r.error??new Error("Failed to read file")),r.readAsDataURL(e),s}function _r(e,s,n){return e?n:s}const xr="_picker_11c3i_4",kr="_search_11c3i_10",vr="_list_11c3i_28",jr="_item_11c3i_33",br="_itemActive_11c3i_50",yr="_checkSlot_11c3i_54",Nr="_label_11c3i_63",Sr="_modelId_11c3i_69",Cr="_state_11c3i_76",wr="_stateError_11c3i_85",Dr="_commandContent_11c3i_95",Br="_commandList_11c3i_98",Tr="_commandItem_11c3i_103",Er="_commandItemHeader_11c3i_135",Ar="_commandKindBadge_11c3i_149",Rr="_commandKindExtension_11c3i_168",Ir="_commandKindPrompt_11c3i_173",Lr="_commandKindSkill_11c3i_178",Or="_commandDescription_11c3i_183",b={picker:xr,search:kr,list:vr,item:jr,itemActive:br,checkSlot:yr,label:Nr,modelId:Sr,state:Cr,stateError:wr,commandContent:Dr,commandList:Br,commandItem:Tr,commandItemHeader:Er,commandKindBadge:Ar,commandKindExtension:Rr,commandKindPrompt:Ir,commandKindSkill:Lr,commandDescription:Or},Pr={onOpenAutoFocus:e=>e.preventDefault()};function Mr(e){switch(e){case"extension":return b.commandKindExtension;case"prompt":return b.commandKindPrompt;case"skill":return b.commandKindSkill;default:return}}function Fr({open:e,onOpenChange:s,options:n,highlightedIndex:o,onSelect:r,isLoading:a,isError:c,errorMessage:l,hiddenExtensionCount:m,renderTrigger:d}){const f=h.useRef(null);return h.useEffect(()=>{var u,x;e&&((x=(u=f.current)==null?void 0:u.querySelector('[aria-selected="true"]'))==null||x.scrollIntoView({block:"nearest"}))},[e,o]),t.jsxs(Se,{open:e,onOpenChange:s,modal:!1,children:[t.jsx(Ce,{asChild:!0,children:d()}),t.jsxs(ye,{className:C(b.picker,b.commandContent),side:"top",sideOffset:4,...Pr,onCloseAutoFocus:u=>u.preventDefault(),children:[a&&t.jsx("div",{className:b.state,children:t.jsx(je,{size:"sm"})}),!a&&c&&t.jsx("div",{className:b.stateError,children:l??"Failed to load commands"}),!a&&!c&&n.length===0&&t.jsx("div",{className:b.state,children:"No commands found"}),!a&&!c&&n.length>0&&t.jsx("div",{ref:f,className:C(b.list,b.commandList),children:n.map((u,x)=>t.jsxs("div",{role:"option","aria-selected":x===o,className:C(b.item,b.commandItem,x===o&&b.itemActive),title:u.description,onMouseDown:B=>{B.preventDefault(),r(u.value)},children:[t.jsxs("div",{className:b.commandItemHeader,children:[t.jsx("span",{className:b.label,children:u.label}),u.kind&&t.jsx("span",{className:C(b.commandKindBadge,Mr(u.kind)),children:u.kind})]}),u.description&&t.jsx("div",{className:b.commandDescription,children:u.description})]},u.value))}),!a&&!c&&m>0&&t.jsxs("div",{className:b.state,children:[m," extension command(s) unavailable while the agent is running"]})]})]})}function qr(e,s={}){const n=new Map;for(const m of e){const d=m.group??"",f=n.get(d);f?f.push(m):n.set(d,[m])}const o=n.get("");n.delete("");const r=[...n.keys()],{priorityGroup:a,ungroupedLabel:c}=s;a!==void 0&&n.has(a)&&(r.splice(r.indexOf(a),1),r.unshift(a));const l=r.map(m=>({key:m,label:m,options:n.get(m)??[]}));return o&&l.push({key:"",label:c,options:o}),l}function Kr(e,s,n){if(!s)return e;const o=e.filter(a=>a.id===s),r=(n===void 0?void 0:o.find(a=>a.provider===n))??o[0];return r?[r,...e.filter(a=>a!==r)]:e}function zr(e){const s=new Set;return e.filter(n=>{const o=`${n.provider??""}/${n.id}`;return s.has(o)?!1:(s.add(o),!0)})}function Hr({currentModel:e,currentModelProvider:s,provider:n,onSelect:o,renderTrigger:r}){const[a,c]=h.useState(!1),[l,m]=h.useState(""),d=h.useRef(null),{data:f=[],isLoading:u,isError:x,error:B}=rt(n,a||e!==void 0);h.useEffect(()=>{var w;a&&(m(""),(w=d.current)==null||w.focus())},[a]);const R=zr(Kr(f,e,s)).map(w=>({value:w.id,label:w.label??w.id,description:w.id,group:w.provider})),v=R[0],_=(v==null?void 0:v.value)===e?v:void 0,y=qr(Ze(R,l),{priorityGroup:s,ungroupedLabel:"Other"}),A=y.length>1,G=B instanceof Error?B.message:"Failed to load models";function Q(w){w.stopPropagation(),w.key==="Escape"&&c(!1)}return t.jsxs(Se,{open:a,onOpenChange:c,modal:!1,children:[t.jsx(Ce,{asChild:!0,children:r(e,_==null?void 0:_.label)}),t.jsxs(ye,{minWidth:240,align:"end",sideOffset:6,className:b.picker,children:[t.jsx("input",{ref:d,className:b.search,placeholder:"Search models…",value:l,onChange:w=>m(w.target.value),onKeyDown:Q}),u&&t.jsx("div",{className:b.state,children:t.jsx(je,{size:"sm"})}),!u&&x&&t.jsx("div",{className:b.stateError,children:G}),!u&&!x&&y.length===0&&t.jsx("div",{className:b.state,children:"No models found"}),!u&&!x&&y.length>0&&t.jsx("div",{className:b.list,children:y.map(w=>t.jsx(Ft,{label:A?w.label:void 0,children:w.options.map(T=>t.jsxs(Xe,{className:b.item,onSelect:()=>o(T.value,T.group),children:[t.jsx("span",{className:b.checkSlot,"aria-hidden":!0,children:T===_&&t.jsx(Ne,{size:14})}),t.jsx("span",{className:b.label,children:T.label}),t.jsxs("span",{className:b.modelId,children:["(",T.value,")"]})]},`${T.group??""}/${T.value}`))},w.key))})]})]})}function $r({currentLevel:e,levels:s,open:n,onOpenChange:o,onSelect:r,renderTrigger:a}){return t.jsxs(Se,{open:n,onOpenChange:o,modal:!1,children:[t.jsx(Ce,{asChild:!0,children:a(e)}),t.jsx(ye,{minWidth:140,align:"end",side:"top",sideOffset:6,className:b.picker,children:s.length===0?t.jsx("div",{className:b.state,children:"Loading levels…"}):t.jsx("div",{className:b.list,children:s.map(c=>t.jsxs(Xe,{className:b.item,onSelect:()=>r(c),children:[t.jsx("span",{className:b.checkSlot,"aria-hidden":!0,children:c===e&&t.jsx(Ne,{size:14})}),t.jsx("span",{className:b.label,children:c})]},c))})})]})}const We=["off","minimal","low","medium","high","xhigh","max"];function Wr(e,s){if(!e)return We;const n=s==null?void 0:s.find(o=>o.id===e);return n!=null&&n.thinkingLevels&&n.thinkingLevels.length>0?n.thinkingLevels:We}function De(e){if(!e.startsWith("/"))return null;const s=/^\/(\S*)/.exec(e),n=(s==null?void 0:s[1])??"",o=1+n.length,r=/\S/.test(e.slice(o));return{name:n,end:o,hasArgs:r}}function Ur(e){return/^\/\S*$/.test(e)}function Gr(e,s){let n=0;const o=[];for(const r of e){if(s.running&&r.source==="extension"){n+=1;continue}o.push({value:r.name,label:`/${r.name}`,description:r.description,kind:r.source})}return{options:o,hiddenExtensionCount:n}}function Vr(e,s,n){return n<=0?0:(e+s+n)%n}function Yr(e,s){const n=De(e);return n?n.hasArgs?`/${s}${e.slice(n.end)}`:`/${s} `:`/${s} ${e}`}function Jr(e,s){const n=De(e);return!n||!s.includes(n.name)?null:{end:n.end}}const Qr="_composer_afpks_4",Xr="_card_afpks_13",Zr="_flash_afpks_27",ea="_note_afpks_41",ta="_textarea_afpks_49",na="_textareaWrap_afpks_73",sa="_highlightLayer_afpks_61",oa="_commandMark_afpks_96",ra="_hiddenFileInput_afpks_121",aa="_toolbar_afpks_127",ia="_toolbarRight_afpks_134",ca="_toolBtn_afpks_142",la="_roundBtn_afpks_148",da="_modelBtn_afpks_153",ua="_modelLabel_afpks_183",ma="_modelId_afpks_181",fa="_modelChevron_afpks_201",S={composer:Qr,card:Xr,flash:Zr,note:ea,textarea:ta,textareaWrap:na,highlightLayer:sa,commandMark:oa,hiddenFileInput:ra,toolbar:aa,toolbarRight:ia,toolBtn:ca,roundBtn:la,modelBtn:da,modelLabel:ua,modelId:ma,modelChevron:fa},pa=160;function le(e){e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,pa)}px`}function ha(e){return typeof e=="object"&&e!==null&&"ok"in e&&e.ok===!1}function ga(){return typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function _a({sessionId:e}){var Pe;const s=W(i=>i.client),n=L(i=>i.sessions[e]),o=L(i=>i.addOptimisticUserMessage),r=L(i=>i.markUserMessageFailed),a=L(i=>i.setCwd),c=L(i=>i.setModel),l=L(i=>i.setThinkingLevel),m=W(i=>i.serverInfo),[d,f]=h.useState(!1),u=!!((Pe=m==null?void 0:m.features)!=null&&Pe.thinkingLevels),{data:x}=ur(n==null?void 0:n.agentId,n==null?void 0:n.model,d&&!!(n!=null&&n.agentId)&&((n==null?void 0:n.userMessageCount)??0)>0),{data:B}=rt("pi"),P=Wr(n==null?void 0:n.model,B),R=x!==void 0&&x.length>0?x:P,v=u&&!(x!==void 0&&x.length===0),_=ce(i=>i.drafts[e]??""),y=ce(i=>i.setDraft),[A,G]=h.useState([]),[Q,w]=h.useState(!1),[T,fe]=h.useState(!1),z=h.useRef(null),X=h.useRef(null),[M,H]=h.useState(!1),[ne,N]=h.useState(0),D=qt(Kt.chat(e)),$=ce(i=>i.pendingFeedback[e]),[se,ae]=h.useState(null),[at,Be]=h.useState(!1),oe=h.useRef(null),re=h.useRef(null);h.useEffect(()=>{if(!D||$===void 0)return;const i=ce.getState().consumeFeedback(e);if(!i)return;ae(i.copy==="filled"?"Your message was filled in":"Your draft was replaced"),oe.current!==null&&window.clearTimeout(oe.current),oe.current=window.setTimeout(()=>ae(null),4e3);const k=z.current;k&&k.setSelectionRange(k.value.length,k.value.length),i.flash&&(Be(!0),re.current!==null&&window.clearTimeout(re.current),re.current=window.setTimeout(()=>Be(!1),ga()?1e3:400))},[D,$,e]),h.useEffect(()=>()=>{oe.current!==null&&window.clearTimeout(oe.current),re.current!==null&&window.clearTimeout(re.current)},[]);const F=(n==null?void 0:n.status)==="running",it=_r(F,Q,T),ct=!!s&&!it&&(_.trim().length>0||A.length>0),{data:Te=[],isLoading:lt,isError:dt,error:Ee}=dr(e,M),{options:Ae,hiddenExtensionCount:ut}=Gr(Te,{running:F}),Re=De(_),ie=Re?Ze(Ae,Re.name):Ae,mt=Te.map(i=>i.name),Z=Jr(_,mt);async function Ie(i){if(i.type.startsWith("image/"))try{const k=await gr(i);G(j=>[...j,k])}catch{}}function ft(i){for(const k of i.target.files??[])Ie(k);i.target.value=""}function pt(i){for(const k of i.clipboardData.items)if(k.type.startsWith("image/")){i.preventDefault();const j=k.getAsFile();j&&Ie(j)}}function ht(i){G(k=>k.filter((j,I)=>I!==i))}function gt(i){const k=i.target.value;y(e,k),le(i.target);const j=Ur(k);j!==M&&H(j),j&&N(0)}function _t(i){var k;if(!M&&Z&&i.key==="Backspace"){const j=i.currentTarget,I=j.selectionStart;if(I!==null&&I===j.selectionEnd){const ee=Z.end+(_[Z.end]===" "?1:0);if(I>0&&I<=ee){i.preventDefault();const V=_.slice(ee);y(e,V),j.setSelectionRange(0,0),le(j);return}}}if(M&&ie.length>0){if(i.key==="ArrowDown"||i.key==="ArrowUp"){i.preventDefault(),N(j=>Vr(j,i.key==="ArrowDown"?1:-1,ie.length));return}if(i.key==="Enter"&&!i.shiftKey||i.key==="Tab"){i.preventDefault();const j=(k=ie[ne])==null?void 0:k.value;j&&Le(j);return}}if(M&&i.key==="Escape"){i.preventDefault(),H(!1);return}i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),Oe(F?"steer":"send"))}function Le(i){const k=Yr(_,i);y(e,k),H(!1),N(0);const j=z.current;j&&(j.focus(),j.setSelectionRange(k.length,k.length),le(j))}async function Oe(i){if(!s||!n||(i==="steer"?T:Q)||i==="steer"&&!n.agentId)return;const k=_.trim();if(!k&&A.length===0)return;y(e,""),H(!1),z.current&&le(z.current);const j=A;G([]);const I=k||"Describe this image",ee=j.length>0?j.map(te=>({mimeType:te.mimeType,data:te.data})):void 0,V=zt();o(e,V,I,ee,i==="steer");const Me=i==="steer"?fe:w;Me(!0);try{if(i==="steer"){const te=await s.agent(n.agentId).steer(I,{clientMessageId:V,images:ee});ha(te)&&r(e,V)}else{n.agentId||a(e,n.cwd||"~");const te=await de(s,e);await s.agent(te).send(I,{clientMessageId:V,images:ee})}}catch{r(e,V)}finally{Me(!1)}}function xt(){n!=null&&n.agentId&&(s==null||s.agent(n.agentId).interrupt())}function kt(i,k){c(e,i,k),!(!s||!k)&&(async()=>{const j=await de(s,e);await s.agent(j).setModel(k,i)})().catch(()=>{})}function vt(i){l(e,i),s&&(async()=>{const k=await de(s,e),j=await s.agent(k).setThinking(i);l(e,j.level)})().catch(()=>{})}return t.jsxs("div",{className:S.composer,children:[t.jsxs("div",{className:C(S.card,at&&S.flash),children:[t.jsxs("div",{className:S.textareaWrap,children:[t.jsx("div",{className:S.highlightLayer,"aria-hidden":!0,children:Z?t.jsxs(t.Fragment,{children:[t.jsx("mark",{className:S.commandMark,children:_.slice(0,Z.end)}),_.slice(Z.end)]}):_}),t.jsx(Ge,{ref:z,className:S.textarea,rows:1,value:_,placeholder:F?"Steer the running turn… ⏎ steer · ⇧⏎ newline":"Ask anything… ⏎ send · ⇧⏎ newline · / commands",onChange:gt,onKeyDown:_t,onPaste:pt,"data-session-id":e})]}),t.jsx(hr,{images:A,onRemove:ht}),t.jsxs("div",{className:S.toolbar,children:[t.jsx(E,{className:S.toolBtn,variant:"ghost",size:"sm",iconOnly:!0,title:"Attach image","aria-label":"Attach image",onClick:()=>{var i;return(i=X.current)==null?void 0:i.click()},children:t.jsx(sn,{size:16})}),t.jsx(Fr,{open:M,onOpenChange:H,options:ie,highlightedIndex:ne,onSelect:Le,isLoading:lt,isError:dt,errorMessage:Ee instanceof Error?Ee.message:void 0,hiddenExtensionCount:ut,renderTrigger:()=>t.jsx(E,{className:S.toolBtn,variant:"ghost",size:"sm",iconOnly:!0,title:"Slash commands","aria-label":"Slash commands",children:t.jsx(on,{size:16})})}),t.jsxs("div",{className:S.toolbarRight,children:[t.jsx(Hr,{currentModel:n==null?void 0:n.model,currentModelProvider:n==null?void 0:n.modelProvider,provider:"pi",onSelect:kt,renderTrigger:(i,k)=>{const j=k!==void 0&&k!==i;return t.jsxs("button",{type:"button",className:S.modelBtn,disabled:!s,title:i?`Model: ${k??i}${j?` (${i})`:""}`:"Select model",children:[t.jsx(rn,{size:14,"aria-hidden":"true"}),t.jsx("span",{className:S.modelLabel,children:k??i??"Model"}),j&&t.jsxs("span",{className:S.modelId,children:["(",i,")"]}),t.jsx(qe,{size:13,className:S.modelChevron,"aria-hidden":"true"})]})}}),v&&t.jsx($r,{currentLevel:n==null?void 0:n.thinkingLevel,levels:R,open:d,onOpenChange:f,onSelect:vt,renderTrigger:i=>t.jsxs("button",{type:"button",className:S.modelBtn,disabled:!s,title:i?`Thinking: ${i}`:"Thinking level",children:[t.jsx(Ye,{size:14,"aria-hidden":"true"}),t.jsx("span",{className:S.modelLabel,children:i??"Thinking"}),t.jsx(qe,{size:13,className:S.modelChevron,"aria-hidden":"true"})]})}),F&&t.jsx(E,{className:S.roundBtn,variant:"destructive",size:"sm",iconOnly:!0,title:"Stop the running turn","aria-label":"Stop",onClick:xt,children:t.jsx(an,{size:14})}),t.jsx(E,{className:S.roundBtn,size:"sm",iconOnly:!0,disabled:!ct,title:F?"Steer the running turn":"Send","aria-label":F?"Steer":"Send",onClick:()=>void Oe(F?"steer":"send"),children:F?t.jsx(cn,{size:16}):t.jsx(ln,{size:18})})]})]})]}),se!==null&&t.jsx("div",{className:S.note,children:se}),t.jsx("input",{ref:X,className:S.hiddenFileInput,type:"file",accept:"image/*",multiple:!0,onChange:ft})]})}const xa="_track_oxvl6_2",ka="_sweep_oxvl6_24",va="_visuallyHidden_oxvl6_64",_e={track:xa,sweep:ka,visuallyHidden:va};function ja({running:e}){return e?t.jsxs("div",{className:_e.track,role:"progressbar","aria-label":"Turn in progress",children:[t.jsx("div",{className:_e.sweep,"aria-hidden":"true"}),t.jsx("span",{className:_e.visuallyHidden,role:"status","aria-live":"polite",children:"Agent is working…"})]}):null}const ba="_panel_1tq06_1",ya="_empty_1tq06_5",Ue={panel:ba,empty:ya};function Pa({tab:e,owningPaneId:s}){const{sessionId:n}=e.data,o=L(r=>r.sessions[n]);return Nn(n),o?t.jsxs(Fe,{className:Ue.panel,children:[t.jsx(ja,{running:o.status==="running"}),t.jsx(lr,{session:o,owningPaneId:s,workspaceCwd:e.workspaceCwd}),t.jsx(_a,{sessionId:o.id})]}):t.jsx(Fe,{children:t.jsx("div",{className:Ue.empty,children:"Session not found."})})}export{Pa as ChatPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as b,j as t}from"./vendor-react-DQUAl2K8.js";import{a as A}from"./vendor-query-i7fr__Xm.js";import{u as E,E as u,S as P,B as x,r as C}from"./index-T-iCQirw.js";import{S as v}from"./StatusBadge-BMKAPA9O.js";import{u as R}from"./use-provider-auth-list-Dlczxxvd.js";import{u as y}from"./provider-auth-store-9hsJ07X1.js";import"./vendor-DaF96HbP.js";import"./vendor-icons-K8oF_80Q.js";import"./vendor-overlays-ar75LZPp.js";import"./vendor-dnd-CayJj8TC.js";const N="env:";function I(e){var i;return e.configured==="unknown"?{label:"Unknown",variant:"warning"}:e.configured===!1?{label:"Not configured",variant:"muted"}:(i=e.configuredSource)!=null&&i.startsWith(N)?{label:`env: ${e.configuredSource.slice(N.length)}`,variant:"success"}:e.configuredType==="oauth"?{label:"OAuth",variant:"success"}:{label:"API key",variant:"success"}}function M(e){const i=e.configured===!0?"Re-login":"Log in";if(e.authTypes.length<=1){const s=e.authTypes[0]??"api_key";return[{authType:s,label:s==="oauth"?e.oauthLoginLabel??i:i}]}return e.authTypes.map(s=>s==="oauth"?{authType:s,label:e.oauthLoginLabel??"Log in with OAuth"}:{authType:s,label:"API key"})}const O="_list_vm1k7_1",T="_row_vm1k7_7",q="_rowMain_vm1k7_18",B="_name_vm1k7_25",z="_tag_vm1k7_33",F="_rowActions_vm1k7_37",U="_pendingNote_vm1k7_44",K="_note_vm1k7_49",Q="_errorState_vm1k7_55",a={list:O,row:T,rowMain:q,name:B,tag:z,rowActions:F,pendingNote:U,note:K,errorState:Q};function nn(){const e=E(n=>n.client),i=A(),s=y(n=>n.pendingLogin),j=y(n=>n.requestLogin),[d,g]=b.useState(null),[k,m]=b.useState({}),{data:r,isLoading:L,isError:S,error:h}=R();async function p(n){if(e&&window.confirm(`Log out of ${n.name}? Running agents keep working until their current credential use fails.`)){m(o=>({...o,[n.id]:""})),g(n.id);try{const o=await e.logoutProvider(n.id);m(l=>({...l,[n.id]:o.stillConfigured?"Removed the stored credential — still configured via an environment variable.":""})),await i.invalidateQueries({queryKey:C.providerAuthList()})}finally{g(null)}}}return L?t.jsxs(u,{children:[t.jsx(P,{size:"sm"})," Loading providers…"]}):S?t.jsx(u,{className:a.errorState,children:h instanceof Error?h.message:"Failed to load providers."}):!r||r.length===0?t.jsx(u,{children:"No providers available."}):t.jsx("div",{className:a.list,children:r.map(n=>{const o=I(n),l=M(n),f=(s==null?void 0:s.provider)===n.id,_=s!==null&&!f,w=k[n.id];return t.jsxs("div",{className:a.row,children:[t.jsxs("div",{className:a.rowMain,children:[t.jsx("span",{className:a.name,children:n.name}),n.oauthIsSubscription&&t.jsx(v,{label:"Subscription",variant:"muted",className:a.tag}),t.jsx(v,{label:o.label,variant:o.variant,className:a.tag})]}),t.jsx("div",{className:a.rowActions,children:f?t.jsx("span",{className:a.pendingNote,children:"Logging in…"}):t.jsxs(t.Fragment,{children:[l.map(c=>t.jsx(x,{size:"xs",variant:"secondary",disabled:_,onClick:()=>j(n.id,n.name,c.authType),children:c.label},c.authType)),n.configured!==!1&&t.jsx(x,{size:"xs",variant:"ghost",disabled:_||d===n.id,loading:d===n.id,onClick:()=>void p(n),children:"Log out"})]})}),w&&t.jsx("div",{className:a.note,children:w})]},n.id)})})}export{nn as ModelProvidersPanel};
|