const g=(r,l)=>d[l](r[l]);function k(r,l){const e=l.reduce((a,t)=>(r[t]===void 0||!d[t]?a[t]=" ":a[t]=` ${g(r,t)} `,a),{});return e.classes=` ${Object.values(e).join(" ").replace(/\s+/g," ").trim()} `,e}const d={rounded(r){let l=Array.isArray(r)?r:u(r);return b(l,"!rounded-",["tl","tr","br","bl"],["lg","none"])},border(r){let l=Array.isArray(r)?r:u(r);return b(l,"!border-",["t","r","b","l"],[!1,"0"])},margin(r){let l=Array.isArray(r)?r:u(r);return b(l,"!m",["t","r","b","l"],[!1,"0"])},container(r){return r?"":"!p-0 !m-0 !border-0 !shadow-none !overflow-visible !bg-transparent"},label_container(r){return r?"":"!border-0 !shadow-none !overflow-visible !bg-transparent"},grid(r){let l=["","sm:","md:","lg:","xl:","2xl:"],e=Array.isArray(r)?r:[r];return[0,0,0,0,0,0].map((a,t)=>`${l[t]}grid-cols-${e?.[t]||e?.[e?.length-1]}`).join(" ")},height(r){return r==="auto"?"auto":""},full_width(r){return r?"!w-full":""},equal_height(r){return r?"":"unequal-height"},mobile_collapse(r){return r?"flex-col":"mobile-row"},visible(r){return r?"":"!hidden"},item_container(r){return r?"":"!border-none"}};function u(r){return r?[!0,!0,!0,!0]:[!1,!1,!1,!1]}function b(r,l="",e,a){const[t,s]=a;return r.map((o,n)=>{if(!t&&o)return"";if(!s&&!o)return"";const p=a[0]&&o?a[0]:a[1];return`${l}${e[n]}-${p}`}).join(" ").replace(/\s+/g," ").trim()}const f=(r,l="")=>{let e=[],a={};if(l==="")a=r;else for(const t in r)if(t.startsWith(l+"_")){const s=t.substring(t.indexOf("_")+1);a[s]=r[t]}if(a.hasOwnProperty("margin")){Array.isArray(a.margin)||(a.margin=a.margin?[!0,!0,!0,!0]:[!1,!1,!1,!1]);let t=["t","r","b","l"];a.margin.forEach((s,o)=>{s||e.push(`!m${t[o]}-0`)})}if(a.hasOwnProperty("border")){Array.isArray(a.border)||(a.border=a.border?[!0,!0,!0,!0]:[!1,!1,!1,!1]);let t=["t","r","b","l"];a.border.forEach((s,o)=>{s||e.push(`!border-${t[o]}-0`)})}switch(a.rounded){case!0:e.push("!rounded-lg");break;case!1:e.push("!rounded-none");break}switch(a.full_width){case!0:e.push("!w-full");break}switch(a.text_color){case"red":e.push("!text-red-500","dark:text-red-100");break;case"yellow":e.push("!text-yellow-500","dark:text-yellow-100");break;case"green":e.push("!text-green-500","dark:text-green-100");break;case"blue":e.push("!text-blue-500","dark:text-blue-100");break;case"purple":e.push("!text-purple-500","dark:text-purple-100");break;case"black":e.push("!text-gray-700","dark:text-gray-50");break}switch(a.bg_color){case"red":e.push("!bg-red-100 !from-red-100 !to-red-200 !border-red-300","dark:!bg-red-700 dark:!from-red-700 dark:!to-red-800 dark:!border-red-900");break;case"yellow":e.push("!bg-yellow-100 !from-yellow-100 !to-yellow-200 !border-yellow-300","dark:!bg-yellow-700 dark:!from-yellow-700 dark:!to-yellow-800 dark:!border-yellow-900");break;case"green":e.push("!bg-green-100 !from-green-100 !to-green-200 !border-green-300","dark:!bg-green-700 dark:!from-green-700 dark:!to-green-800 dark:!border-green-900  !text-gray-800");break;case"blue":e.push("!bg-blue-100 !from-blue-100 !to-blue-200 !border-blue-300","dark:!bg-blue-700 dark:!from-blue-700 dark:!to-blue-800 dark:!border-blue-900");break;case"purple":e.push("!bg-purple-100 !from-purple-100 !to-purple-200 !border-purple-300","dark:!bg-purple-700 dark:!from-purple-700 dark:!to-purple-800 dark:!border-purple-900");break;case"black":e.push("!bg-gray-100 !from-gray-100 !to-gray-200 !border-gray-300","dark:!bg-gray-700 dark:!from-gray-700 dark:!to-gray-800 dark:!border-gray-900");case"pink":e.push("!bg-pink-100 !from-pink-100 !to-pink-200 !border-pink-300","dark:!bg-pink-700 dark:!from-pink-700 dark:!to-pink-800 dark:!border-pink-900 !text-gray-800");break}return" "+e.join(" ")};export{f as c,k as g};
