"use strict";const e=require("react/jsx-runtime"),v=require("@mui/material/Tabs"),H=require("@mui/material/Tab"),d=require("@mui/material/Box"),T=require("@mui/material/IconButton"),z=require("@mui/icons-material/Close"),S=require("@mui/icons-material/Add");function g({tabs:s,value:a,onChange:t,variant:r="line",size:o="md",closable:f=!1,onClose:x,scrollable:m=!1,addButton:b=!1,onAdd:h,sx:l}){const u={xs:{fontSize:"0.6875rem",minHeight:28,py:.25},sm:{fontSize:"0.75rem",minHeight:32,py:.5},md:{fontSize:"0.8125rem",minHeight:40,py:1},lg:{fontSize:"0.875rem",minHeight:48,py:1.5},xl:{fontSize:"1rem",minHeight:56,py:2}},n=u[o]||u.md,y={line:{},pill:{"& .MuiTabs-indicator":{display:"none"},"& .MuiTab-root":{borderRadius:"999px",minHeight:n.minHeight,"&.Mui-selected":{bgcolor:"var(--ov-accent-subtle)",color:"var(--ov-accent-fg)"}}},segmented:{bgcolor:"var(--ov-bg-surface-inset)",borderRadius:"8px",p:.5,minHeight:"auto","& .MuiTabs-indicator":{display:"none"},"& .MuiTab-root":{borderRadius:"6px",minHeight:n.minHeight-8,"&.Mui-selected":{bgcolor:"var(--ov-bg-surface)",color:"var(--ov-fg-base)",boxShadow:"var(--ov-shadow-sm)"}}}};return e.jsxs(d,{sx:{display:"flex",alignItems:"center",...typeof l=="object"&&!Array.isArray(l)?l:{}},children:[e.jsx(v,{value:a,onChange:(i,c)=>t(c),variant:m?"scrollable":"standard",scrollButtons:m?"auto":!1,sx:{minHeight:n.minHeight,...y[r]},children:s.map(i=>e.jsx(H,{value:i.key,label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:.5},children:[i.icon,e.jsx("span",{children:i.label}),f&&e.jsx(z,{sx:{fontSize:14,ml:.5,opacity:.6,"&:hover":{opacity:1}},onClick:c=>{c.stopPropagation(),x?.(i.key)}})]}),disabled:i.disabled,sx:{fontSize:n.fontSize,minHeight:n.minHeight,py:n.py,textTransform:"none",color:"var(--ov-fg-default)"}},i.key))}),b&&e.jsx(T,{size:"small",onClick:h,sx:{ml:.5},children:e.jsx(S,{fontSize:"small"})})]})}g.displayName="Tabs";function p({value:s,activeValue:a,children:t,keepMounted:r=!1}){const o=s===a;return!o&&!r?null:e.jsx(d,{role:"tabpanel",hidden:!o,sx:{display:o?void 0:"none"},children:t})}p.displayName="TabPanel";exports.TabPanel=p;exports.Tabs=g;
