import"./Bzak7iHL.js";import{t as le,e as ce,a as D,c as H}from"./D7710T35.js";import{p as oe,i as ue,h as fe,a as R,e as de,c as I,n as J,r as Q,f as $}from"./BfGs3WDN.js";import{s as Y}from"./By9q4dnk.js";import{p as G,i as ge,r as ve}from"./CQe9XmLJ.js";import{b as Z}from"./BSLeMsiy.js";var he=/\s+/g,ye=t=>typeof t!="string"||!t?t:t.replace(he," ").trim(),K=(...t)=>{const a=[],n=e=>{if(!e&&e!==0&&e!==0n)return;if(Array.isArray(e)){for(let r=0,h=e.length;r0?ye(a.join(" ")):void 0},P=t=>t===!1?"false":t===!0?"true":t===0?"0":t,v=t=>{if(!t||typeof t!="object")return!0;for(const a in t)return!1;return!0},me=(t,a)=>{if(t===a)return!0;if(!t||!a)return!1;const n=Object.keys(t),e=Object.keys(a);if(n.length!==e.length)return!1;for(let i=0;i{for(const n in a)if(Object.prototype.hasOwnProperty.call(a,n)){const e=a[n];n in t?t[n]=K(t[n],e):t[n]=e}return t},ee=(t,a)=>{for(let n=0;n{const a=[];ee(t,a);const n=[];for(let e=0;e{const n={};for(const e in t){const i=t[e];if(e in a){const r=a[e];Array.isArray(i)||Array.isArray(r)?n[e]=te(r,i):typeof i=="object"&&typeof r=="object"&&i&&r?n[e]=L(i,r):n[e]=r+" "+i}else n[e]=i}for(const e in a)e in t||(n[e]=a[e]);return n},Ce={twMerge:!0,twMergeConfig:{}};function Ve(){let t=null,a={},n=!1;return{get cachedTwMerge(){return t},set cachedTwMerge(e){t=e},get cachedTwMergeConfig(){return a},set cachedTwMergeConfig(e){a=e},get didTwMergeConfigChange(){return n},set didTwMergeConfigChange(e){n=e},reset(){t=null,a={},n=!1}}}var S=Ve(),we=t=>{const a=(e,i)=>{const{extend:r=null,slots:h={},variants:N={},compoundVariants:_=[],compoundSlots:w=[],defaultVariants:j={}}=e,C={...Ce,...i},V=r!=null&&r.base?K(r.base,e==null?void 0:e.base):e==null?void 0:e.base,o=r!=null&&r.variants&&!v(r.variants)?L(N,r.variants):N,k=r!=null&&r.defaultVariants&&!v(r.defaultVariants)?{...r.defaultVariants,...j}:j;!v(C.twMergeConfig)&&!me(C.twMergeConfig,S.cachedTwMergeConfig)&&(S.didTwMergeConfigChange=!0,S.cachedTwMergeConfig=C.twMergeConfig);const y=v(r==null?void 0:r.slots),F=v(h)?{}:{base:K(e==null?void 0:e.base,y&&(r==null?void 0:r.base)),...h},E=y?F:be({...r==null?void 0:r.slots},v(F)?{base:e==null?void 0:e.base}:F),z=v(r==null?void 0:r.compoundVariants)?_:te(r==null?void 0:r.compoundVariants,_),M=d=>{if(v(o)&&v(h)&&y)return t(V,d==null?void 0:d.class,d==null?void 0:d.className)(C);if(z&&!Array.isArray(z))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof z}`);if(w&&!Array.isArray(w))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof w}`);const q=(l,u=o,c=null,s=null)=>{const f=u[l];if(!f||v(f))return null;const g=(s==null?void 0:s[l])??(d==null?void 0:d[l]);if(g===null)return null;const m=P(g);if(typeof m=="object")return null;const x=k==null?void 0:k[l],b=m??P(x);return f[b||"false"]},ae=()=>{if(!o)return null;const l=Object.keys(o),u=[];for(let c=0;c{if(!o||typeof o!="object")return null;const c=[];for(const s in o){const f=q(s,o,l,u),g=l==="base"&&typeof f=="string"?f:f&&f[l];g&&c.push(g)}return c},U={};for(const l in d){const u=d[l];u!==void 0&&(U[l]=u)}const W=(l,u)=>{var s;const c=typeof(d==null?void 0:d[l])=="object"?{[l]:(s=d[l])==null?void 0:s.initial}:{};return{...k,...U,...c,...u}},X=(l=[],u)=>{const c=[],s=l.length;for(let f=0;f{const u=X(z,l);if(!Array.isArray(u))return u;const c={},s=t;for(let f=0;f{if(w.length<1)return null;const u={},c=W(null,l);for(let s=0;s{const f=se(s),g=ie(s);return u(E[c],ne(c,s),f?f[c]:void 0,g?g[c]:void 0,s==null?void 0:s.class,s==null?void 0:s.className)(C)}}return l}return t(V,ae(),X(z),d==null?void 0:d.class,d==null?void 0:d.className)(C)},re=()=>{if(!(!o||typeof o!="object"))return Object.keys(o)};return M.variantKeys=re(),M.extend=r,M.base=V,M.slots=E,M.variants=o,M.defaultVariants=k,M.compoundSlots=w,M.compoundVariants=z,M};return{tv:a,createTV:e=>(i,r)=>a(i,r?L(e,r):e)}},ke=t=>v(t)?le:ce({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}),Me=(t,a)=>{const n=K(t);return!n||!((a==null?void 0:a.twMerge)??!0)?n:((!S.cachedTwMerge||S.didTwMergeConfigChange)&&(S.didTwMergeConfigChange=!1,S.cachedTwMerge=ke(S.cachedTwMergeConfig)),S.cachedTwMerge(n)||void 0)},Te=(...t)=>a=>Me(t,a),{tv:Ae}=we(Te);const p=Ae({base:"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",destructive:"bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs",outline:"bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});var Se=$(""),_e=$("");function je(t,a){oe(a,!0);let n=G(a,"variant",3,"default"),e=G(a,"size",3,"default"),i=G(a,"ref",15,null),r=G(a,"href",3,void 0),h=G(a,"type",3,"button"),N=ve(a,["$$slots","$$events","$$legacy","class","variant","size","ref","href","type","disabled","children"]);var _=ue(),w=fe(_);{var j=V=>{var o=Se();D(o,y=>({"data-slot":"button",class:y,href:a.disabled?void 0:r(),"aria-disabled":a.disabled,role:a.disabled?"link":void 0,tabindex:a.disabled?-1:void 0,...N}),[()=>H(p({variant:n(),size:e()}),a.class)]);var k=I(o);Y(k,()=>a.children??J),Q(o),Z(o,y=>i(y),()=>i()),R(V,o)},C=V=>{var o=_e();D(o,y=>({"data-slot":"button",class:y,type:h(),disabled:a.disabled,...N}),[()=>H(p({variant:n(),size:e()}),a.class)]);var k=I(o);Y(k,()=>a.children??J),Q(o),Z(o,y=>i(y),()=>i()),R(V,o)};ge(w,V=>{r()?V(j):V(C,!1)})}R(t,_),de()}export{je as B};