import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{u as t}from"./lucide-C4oWPzu4.js";import{p as n,t as r}from"./utils-Bs-0X7qI.js";import{r as i}from"./bundle-mjs-C4g7ASB5.js";import{t as a}from"./react-dom-DA2kpOcl.js";import{t as o}from"./button-B-NlEi4h.js";var s=n(),c=e(a(),1),l=i();function u(e){let n=(0,s.c)(34),{open:i,onOpenChange:a,title:u,children:d,footer:f,container:p}=e;if(!i)return null;let m=!!p,h=m?`absolute inset-0`:`fixed inset-0`,g;n[0]===h?g=n[1]:(g=r(`z-40 bg-black/20`,h),n[0]=h,n[1]=g);let _;n[2]===a?_=n[3]:(_=()=>a(!1),n[2]=a,n[3]=_);let v;n[4]!==g||n[5]!==_?(v=(0,l.jsx)(`div`,{className:g,"aria-hidden":!0,onClick:_}),n[4]=g,n[5]=_,n[6]=v):v=n[6];let y=m?`absolute top-1/2 right-4 -translate-y-1/2`:`fixed top-1/2 right-10 -translate-y-1/2`,b;n[7]===y?b=n[8]:(b=r(`bg-background border-border z-50 flex h-full max-h-[85vh] w-[420px] flex-col rounded-xl border shadow-xl`,y),n[7]=y,n[8]=b);let x;n[9]===u?x=n[10]:(x=(0,l.jsx)(`h2`,{id:`right-floating-panel-title`,className:`text-base font-semibold`,children:u}),n[9]=u,n[10]=x);let S;n[11]===a?S=n[12]:(S=()=>a(!1),n[11]=a,n[12]=S);let C;n[13]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,l.jsx)(t,{className:`size-4`}),n[13]=C):C=n[13];let w;n[14]===S?w=n[15]:(w=(0,l.jsx)(o,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8`,onClick:S,"aria-label":`关闭`,children:C}),n[14]=S,n[15]=w);let T;n[16]!==w||n[17]!==x?(T=(0,l.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between px-4 py-3`,children:[x,w]}),n[16]=w,n[17]=x,n[18]=T):T=n[18];let E;n[19]===d?E=n[20]:(E=(0,l.jsx)(`div`,{className:`chat-scroll flex h-full min-h-0 flex-col`,children:(0,l.jsx)(`div`,{className:`h-full min-h-0`,children:d})}),n[19]=d,n[20]=E);let D;n[21]===f?D=n[22]:(D=f?(0,l.jsx)(`div`,{className:`bg-muted shrink-0 rounded-b-xl px-4 py-3`,children:f}):null,n[21]=f,n[22]=D);let O;n[23]!==T||n[24]!==E||n[25]!==D||n[26]!==b?(O=(0,l.jsxs)(`div`,{className:b,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`right-floating-panel-title`,children:[T,E,D]}),n[23]=T,n[24]=E,n[25]=D,n[26]=b,n[27]=O):O=n[27];let k;n[28]!==O||n[29]!==v?(k=(0,l.jsxs)(l.Fragment,{children:[v,O]}),n[28]=O,n[29]=v,n[30]=k):k=n[30];let A=k,j=p??document.body,M;return n[31]!==A||n[32]!==j?(M=(0,c.createPortal)(A,j),n[31]=A,n[32]=j,n[33]=M):M=n[33],M}export{u as t};