import{r as oe}from"./jsx-runtime-B2SNG7MK.js";import{c as ae,g as ie,e as se,t as B}from"./chunk-BYWORP66-BBQ1VaOa.js";var ue=ae(ie);function F(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=F(e[t]))&&(i&&(i+=" "),i+=r);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function ve(...e){for(var t=0,r,i,y="";t<e.length;)(r=e[t++])&&(i=F(r))&&(y&&(y+=" "),y+=i);return y}var be=e=>e.charAt(0).toUpperCase()+e.slice(1);function ge(...e){return function(r){e.some(i=>(i==null||i(r),r==null?void 0:r.defaultPrevented))}}function he(e){return`${e}-${Math.floor(Math.random()*1e6)}`}function Ae(e){for(const t in e)t.startsWith("on")&&delete e[t];return e}function me(e){if(!e||typeof e!="object")return"";try{return JSON.stringify(e)}catch{return""}}function we(e){return oe.forwardRef(e)}var je=(e,t,r=!0)=>{if(!t)return[e,{}];const i=t.reduce((y,u)=>u in e?{...y,[u]:e[u]}:y,{});return r?[Object.keys(e).filter(u=>!t.includes(u)).reduce((u,v)=>({...u,[v]:e[v]}),{}),i]:[e,i]},H=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,A=e=>!e||typeof e!="object"||Object.keys(e).length===0,fe=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function L(e,t){e.forEach(function(r){Array.isArray(r)?L(r,t):t.push(r)})}function Z(e){let t=[];return L(e,t),t}var K=(...e)=>Z(e).filter(Boolean),Q=(e,t)=>{let r={},i=Object.keys(e),y=Object.keys(t);for(let u of i)if(y.includes(u)){let v=e[u],w=t[u];typeof v=="object"&&typeof w=="object"?r[u]=Q(v,w):Array.isArray(v)||Array.isArray(w)?r[u]=K(w,v):r[u]=w+" "+v}else r[u]=e[u];for(let u of y)i.includes(u)||(r[u]=t[u]);return r},I=e=>!e||typeof e!="string"?e:e.replace(/\s+/g," ").trim(),ce={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},X=e=>e||void 0,k=(...e)=>X(Z(e).filter(Boolean).join(" ")),G=null,T={},J=!1,O=(...e)=>t=>t.twMerge?((!G||J)&&(J=!1,G=A(T)?ue:se(T)),X(G(k(e)))):k(e),W=(e,t)=>{for(let r in t)e.hasOwnProperty(r)?e[r]=k(e[r],t[r]):e[r]=t[r];return e},de=(e,t)=>{let{extend:r=null,slots:i={},variants:y={},compoundVariants:u=[],compoundSlots:v=[],defaultVariants:w={}}=e,g={...ce,...t},S=r!=null&&r.base?k(r.base,e==null?void 0:e.base):e==null?void 0:e.base,h=r!=null&&r.variants&&!A(r.variants)?Q(y,r.variants):y,C=r!=null&&r.defaultVariants&&!A(r.defaultVariants)?{...r.defaultVariants,...w}:w;!A(g.twMergeConfig)&&!fe(g.twMergeConfig,T)&&(J=!0,T=g.twMergeConfig);let N=A(r==null?void 0:r.slots),E=A(i)?{}:{base:k(e==null?void 0:e.base,N&&(r==null?void 0:r.base)),...i},M=N?E:W({...r==null?void 0:r.slots},A(E)?{base:e==null?void 0:e.base}:E),m=p=>{if(A(h)&&A(i)&&N)return O(S,p==null?void 0:p.class,p==null?void 0:p.className)(g);if(u&&!Array.isArray(u))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof u}`);if(v&&!Array.isArray(v))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof v}`);let x=(n,o,l=[],s)=>{let a=l;if(typeof o=="string")a=a.concat(I(o).split(" ").map(f=>`${n}:${f}`));else if(Array.isArray(o))a=a.concat(o.reduce((f,c)=>f.concat(`${n}:${c}`),[]));else if(typeof o=="object"&&typeof s=="string"){for(let f in o)if(o.hasOwnProperty(f)&&f===s){let c=o[f];if(c&&typeof c=="string"){let d=I(c);a[s]?a[s]=a[s].concat(d.split(" ").map(b=>`${n}:${b}`)):a[s]=d.split(" ").map(b=>`${n}:${b}`)}else Array.isArray(c)&&c.length>0&&(a[s]=c.reduce((d,b)=>d.concat(`${n}:${b}`),[]))}}return a},R=(n,o=h,l=null,s=null)=>{var a;let f=o[n];if(!f||A(f))return null;let c=(a=s==null?void 0:s[n])!=null?a:p==null?void 0:p[n];if(c===null)return null;let d=H(c),b=Array.isArray(g.responsiveVariants)&&g.responsiveVariants.length>0||g.responsiveVariants===!0,V=C==null?void 0:C[n],j=[];if(typeof d=="object"&&b)for(let[D,z]of Object.entries(d)){let le=f[z];if(D==="initial"){V=z;continue}Array.isArray(g.responsiveVariants)&&!g.responsiveVariants.includes(D)||(j=x(D,le,j,l))}let P=f[d]||f[H(V)];return typeof j=="object"&&typeof l=="string"&&j[l]?W(j,P):j.length>0?(j.push(P),j):P},ee=()=>h?Object.keys(h).map(n=>R(n,h)):null,re=(n,o)=>{if(!h||typeof h!="object")return null;let l=new Array;for(let s in h){let a=R(s,h,n,o),f=n==="base"&&typeof a=="string"?a:a&&a[n];f&&(l[l.length]=f)}return l},_={};for(let n in p)p[n]!==void 0&&(_[n]=p[n]);let $=(n,o)=>{var l;let s=typeof(p==null?void 0:p[n])=="object"?{[n]:(l=p[n])==null?void 0:l.initial}:{};return{...C,..._,...s,...o}},U=(n=[],o)=>{let l=[];for(let{class:s,className:a,...f}of n){let c=!0;for(let[d,b]of Object.entries(f)){let V=$(d,o);if(Array.isArray(b)){if(!b.includes(V[d])){c=!1;break}}else if(V[d]!==b){c=!1;break}}c&&(s&&l.push(s),a&&l.push(a))}return l},q=n=>{let o=U(u,n),l=U(r==null?void 0:r.compoundVariants,n);return K(l,o)},te=n=>{let o=q(n);if(!Array.isArray(o))return o;let l={};for(let s of o)if(typeof s=="string"&&(l.base=O(l.base,s)(g)),typeof s=="object")for(let[a,f]of Object.entries(s))l[a]=O(l[a],f)(g);return l},ne=n=>{if(v.length<1)return null;let o={};for(let{slots:l=[],class:s,className:a,...f}of v){if(!A(f)){let c=!0;for(let d of Object.keys(f)){let b=$(d,n)[d];if(b===void 0||(Array.isArray(f[d])?!f[d].includes(b):f[d]!==b)){c=!1;break}}if(!c)continue}for(let c of l)o[c]=o[c]||[],o[c].push([s,a])}return o};if(!A(i)||!N){let n={};if(typeof M=="object"&&!A(M))for(let o of Object.keys(M))n[o]=l=>{var s,a;return O(M[o],re(o,l),((s=te(l))!=null?s:[])[o],((a=ne(l))!=null?a:[])[o],l==null?void 0:l.class,l==null?void 0:l.className)(g)};return n}return O(S,ee(),q(),p==null?void 0:p.class,p==null?void 0:p.className)(g)},Y=()=>{if(!(!h||typeof h!="object"))return Object.keys(h)};return m.variantKeys=Y(),m.extend=r,m.base=S,m.slots=M,m.variants=h,m.defaultVariants=C,m.compoundSlots=v,m.compoundVariants=u,m},Me=(e,t)=>{var r,i,y;return de(e,{...t,twMerge:(r=t==null?void 0:t.twMerge)!=null?r:!0,twMergeConfig:{...t==null?void 0:t.twMergeConfig,theme:{...(i=t==null?void 0:t.twMergeConfig)==null?void 0:i.theme,...B.theme},classGroups:{...(y=t==null?void 0:t.twMergeConfig)==null?void 0:y.classGroups,...B.classGroups}}})};export{be as a,ge as b,ve as c,ue as d,we as f,he as g,je as m,me as o,Ae as r,Me as t};
