import{r as a,j as m,z as V}from"./index-C-9v46qO.js";import{a as j,c as R}from"./utils-BQHNewu7.js";function b(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function C(...e){return n=>{let t=!1;const i=e.map(r=>{const o=b(r,n);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let r=0;r<i.length;r++){const o=i[r];typeof o=="function"?o():b(e[r],null)}}}}function F(...e){return a.useCallback(C(...e),e)}var N=Symbol.for("react.lazy"),y=V[" use ".trim().toString()];function w(e){return typeof e=="object"&&e!==null&&"then"in e}function _(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===N&&"_payload"in e&&w(e._payload)}function O(e){const n=k(e),t=a.forwardRef((i,r)=>{let{children:o,...u}=i;_(o)&&typeof y=="function"&&(o=y(o._payload));const l=a.Children.toArray(o),f=l.find($);if(f){const s=f.props.children,c=l.map(d=>d===f?a.Children.count(s)>1?a.Children.only(null):a.isValidElement(s)?s.props.children:null:d);return m.jsx(n,{...u,ref:r,children:a.isValidElement(s)?a.cloneElement(s,void 0,c):null})}return m.jsx(n,{...u,ref:r,children:o})});return t.displayName=`${e}.Slot`,t}var P=O("Slot");function k(e){const n=a.forwardRef((t,i)=>{let{children:r,...o}=t;if(_(r)&&typeof y=="function"&&(r=y(r._payload)),a.isValidElement(r)){const u=T(r),l=z(o,r.props);return r.type!==a.Fragment&&(l.ref=i?C(i,u):u),a.cloneElement(r,l)}return a.Children.count(r)>1?a.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var A=Symbol("radix.slottable");function $(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===A}function z(e,n){const t={...n};for(const i in n){const r=e[i],o=n[i];/^on[A-Z]/.test(i)?r&&o?t[i]=(...l)=>{const f=o(...l);return r(...l),f}:r&&(t[i]=r):i==="style"?t[i]={...r,...o}:i==="className"&&(t[i]=[r,o].filter(Boolean).join(" "))}return{...e,...t}}function T(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}const h=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,x=j,W=(e,n)=>t=>{var i;if(n?.variants==null)return x(e,t?.class,t?.className);const{variants:r,defaultVariants:o}=n,u=Object.keys(r).map(s=>{const c=t?.[s],d=o?.[s];if(c===null)return null;const p=h(c)||h(d);return r[s][p]}),l=t&&Object.entries(t).reduce((s,c)=>{let[d,p]=c;return p===void 0||(s[d]=p),s},{}),f=n==null||(i=n.compoundVariants)===null||i===void 0?void 0:i.reduce((s,c)=>{let{class:d,className:p,...E}=c;return Object.entries(E).every(S=>{let[g,v]=S;return Array.isArray(v)?v.includes({...o,...l}[g]):{...o,...l}[g]===v})?[...s,d,p]:s},[]);return x(e,u,f,t?.class,t?.className)},B=W("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),I=a.forwardRef(({className:e,variant:n,size:t,asChild:i=!1,...r},o)=>{const u=i?P:"button";return m.jsx(u,{className:R(B({variant:n,size:t,className:e})),ref:o,...r})});I.displayName="Button";export{I as B,O as a,W as b,C as c,B as d,F as u};
