import{r as e,t}from"./jsx-runtime-DAs1UGHr.js";import{l as n}from"./matchContext-DoIVbOYX.js";import{Ct as r,J as i,Nt as a,Q as o,St as s,Tt as c,bt as l,ct as u,et as d,gt as f,jt as p,kt as m,nt as h,pt as g,rt as _,ut as v,vt as y,z as b}from"./preload-helper-D7v3KC5t.js";import{t as x}from"./checkbox-CWANiedi-Dqh5g87e.js";import{v as S}from"./index-DJyJEBBo.js";var C=t(),w=e(n(),1),T={variant:{default:{classes:``,description:`Default dropdown item appearance`},danger:{classes:`text-kumo-danger data-highlighted:bg-kumo-danger/5 data-highlighted:text-kumo-danger`,description:`Destructive action item`}}},E={variant:`default`};function D({variant:e=E.variant}={}){return a(T.variant[e].classes)}var O=w.forwardRef(({className:e,inset:t,children:n,icon:r,...i},o)=>(0,C.jsxs)(b,{ref:o,className:a(`flex cursor-default items-center rounded-sm text-base outline-hidden select-none`,`px-2 py-1.5`,`focus:bg-kumo-tint`,`data-[state=open]:bg-kumo-tint`,t&&`pl-8`,e),...i,children:[r&&(0,C.jsx)(r,{className:`mr-2 h-4 w-4`}),n,(0,C.jsx)(S,{className:`ml-auto h-4 w-4`})]}));O.displayName=b.displayName;var k=w.forwardRef(({className:e,sideOffset:t=8,children:n,...r},o)=>(0,C.jsx)(u,{children:(0,C.jsx)(s,{ref:o,sideOffset:t,...r,children:(0,C.jsx)(i,{className:a(`z-50 overflow-hidden bg-kumo-control text-kumo-default`,`rounded-lg shadow-lg ring ring-kumo-line`,`min-w-36 p-1.5`,`data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2`,`data-[side=left]:slide-in-from-right-2`,`data-[side=right]:slide-in-from-left-2`,`data-[side=top]:slide-in-from-bottom-2`,`data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),children:n})})})),A=e=>e?w.isValidElement(e)?e:(0,C.jsx)(e,{className:`mr-2 h-4 w-4`}):null,j=w.forwardRef(({className:e,inset:t,icon:n,children:r,selected:i,render:o,href:s,variant:c=`default`,...u},d)=>{let f=m(),h=w.useMemo(()=>{let e=(0,C.jsxs)(C.Fragment,{children:[n&&A(n),r,i&&(0,C.jsx)(`span`,{className:`inline-flex`,children:(0,C.jsx)(p,{})})]});if(!s)return e;let t=s.startsWith(`https://`),o=a(`flex items-center`,c===`danger`&&`text-kumo-danger data-highlighted:bg-kumo-danger/5 data-highlighted:text-kumo-danger`);return t?(0,C.jsx)(`a`,{className:a(o,`w-full text-inherit! no-underline!`),href:s,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),children:e}):(0,C.jsx)(f,{className:a(o,`w-full text-inherit! no-underline!`),href:s,to:s,onClick:e=>e.stopPropagation(),children:e})},[s,n,r,i,c,f]),g=s||o;return(0,C.jsx)(l,{ref:d,className:a(`relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none focus:text-kumo-default data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-overlay`,t&&`pl-8`,D({variant:c}),e),render:s?h:o,...u,children:g?void 0:r})});j.displayName=l.displayName;var M=w.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,C.jsxs)(o,{ref:i,className:a(`relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-base outline-hidden transition-colors select-none focus:bg-kumo-tint focus:text-kumo-default data-disabled:pointer-events-none data-disabled:opacity-50`,e),checked:n,...r,children:[(0,C.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center text-inherit`,children:(0,C.jsx)(x,{checked:n})}),t]}));M.displayName=o.displayName;var N=w.forwardRef(({className:e,inset:t,...n},r)=>(0,C.jsx)(y,{ref:r,className:a(`px-2 py-1.5 text-base font-semibold`,t&&`pl-8`,e),...n}));N.displayName=y.displayName;var P=w.forwardRef(({className:e,...t},n)=>(0,C.jsx)(r,{ref:n,className:a(`-mx-1 my-1 h-px bg-kumo-line`,e),...t}));P.displayName=r.displayName;var F=({className:e,...t})=>(0,C.jsx)(`span`,{className:a(`ml-auto text-xs tracking-widest opacity-60`,e),...t});F.displayName=`DropdownMenuShortcut`;var I=w.forwardRef(({className:e,children:t,inset:n,icon:r,...i},o)=>(0,C.jsxs)(v,{ref:o,className:a(`relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none`,`data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-tint`,n&&`pl-8`,e),...i,children:[r&&A(r),t]}));I.displayName=`DropdownMenuRadioItem`;var L=w.forwardRef(({className:e,children:t,...n},r)=>(0,C.jsx)(h,{ref:r,className:a(`ml-auto`,e),...n,children:t??(0,C.jsx)(p,{className:`h-4 w-4`})}));L.displayName=`DropdownMenuRadioItemIndicator`;var R=w.forwardRef(({children:e,render:t,...n},r)=>{let i=w.isValidElement(e)?e:null,a=t??i;return(0,C.jsx)(_,{ref:r,...n,...a&&{render:a},children:i?void 0:e})});R.displayName=`DropdownMenuTrigger`;var z=Object.assign(c,{Trigger:R,Portal:u,Sub:f,SubTrigger:O,SubContent:k,Content:k,Item:j,CheckboxItem:M,RadioGroup:d,RadioItem:I,RadioItemIndicator:L,Label:N,Separator:P,Shortcut:F,Group:g});export{z as t};