"use strict";const c=require("react/jsx-runtime"),E=require("@mui/material/Button"),O=require("@mui/material/CircularProgress"),t=require("./types.cjs");function u({children:i,color:a="neutral",emphasis:d="ghost",size:n="sm",shape:b="rounded",loading:r=!1,loadingPosition:e="center",disabled:l,startIcon:m,startAdornment:I,icon:v,endIcon:y,endAdornment:B,fullWidth:S,onClick:j,type:p="button",href:q,sx:s}){const x=m??I??v,z=y??B,f=t.toMuiColor(a),h=t.toMuiVariant(d),C=t.toMuiSize(n),M=t.sizeOverrideSx(n),o=c.jsx(O,{size:n==="xs"?12:16,color:"inherit"}),R=r&&e==="start"?o:x,A=r&&e==="end"?o:z;return c.jsx(E,{color:f,variant:h,size:C,disabled:l||r&&e==="center",startIcon:R,endIcon:A,fullWidth:S,onClick:j,type:p,href:q,sx:{borderRadius:t.toBorderRadius(b),...M,...typeof s=="object"&&!Array.isArray(s)?s:{}},children:r&&e==="center"?o:i})}u.displayName="Button";exports.Button=u;
