import{M as C}from"./index-kQIztB-E.js";import{m as H}from"./Button-DbnN1LyR.js";import{c as f,d as _,W as z,o as $,a0 as k,b as I,n as S,ad as P,r as W,u as l,H as b,E as w,A as j,aq as B,M as E,j as M,e as L,h as V}from"./lucide-BsOfcLnq.js";import{K as D,d as O}from"./vuetify-DHCm6MV9.js";import{_ as q}from"./index-CyXUjyDM.js";const A=e=>{const u=f(()=>{const{variant:t,width:d,height:o,staticWidth:n,staticHeight:a,maxWidth:c,maxHeight:r,minWidth:i,minHeight:x,badge:y,...h}=e,m={...h,size:e.size||n||void 0||a||void 0||(e.maxHeight?e.maxHeight:void 0)||(e.maxWidth?e.maxWidth:void 0)||"24px"};return C(t).with("button",()=>({...m,class:e.class?`icon-button ${e.class}`:"icon-button"})).with("responsive",()=>({...m,class:e.class?`icon-responsive ${e.class}`:"icon-responsive"})).with("default",()=>({...m,class:e.class?`icon-default ${e.class}`:"icon-default"})).otherwise(()=>({...m,class:e.class?`icon-default ${e.class}`:"icon-default"}))}),s=f(()=>{const t={};if(e.staticWidth?t.width=e.staticWidth:e.width&&(t.width=e.width),e.staticHeight?t.height=e.staticHeight:e.height&&(t.height=e.height),e.maxWidth&&(t.maxWidth=e.maxWidth),e.maxHeight&&(t.maxHeight=e.maxHeight),e.minWidth&&(t.minWidth=e.minWidth),e.minHeight&&(t.minHeight=e.minHeight),typeof e.style=="object")Object.assign(t,e.style);else if(typeof e.style=="string"){const d=e.style.split(";").reduce((o,n)=>{const[a,c]=n.split(":").map(r=>r.trim());return a&&c&&(o[a]=c),o},{});Object.assign(t,d)}return t}),g=f(()=>H("icon-container",e.variant&&`icon-container--${e.variant}`,e.disabled&&"icon-container--disabled")),v=f(()=>H("icon",e.variant&&`icon--${e.variant}`));return{iconProps:u,containerStyle:s,containerClasses:g,iconClasses:v}},K={variant:"default",minWidth:"24px",minHeight:"24px",badge:!1,disabled:!1},N=_({__name:"Icon",props:z({variant:{},width:{},height:{},staticWidth:{},staticHeight:{},maxWidth:{},maxHeight:{},minWidth:{},minHeight:{},icon:{},color:{},disabled:{type:Boolean},size:{},badge:{type:Boolean},class:{},style:{}},K),emits:["click"],setup(e,{emit:u}){const s=e,g=u,{iconProps:v,containerStyle:t,containerClasses:d,iconClasses:o}=A(s),n=W(),a=W(),c=async()=>{if(!(s.variant!=="responsive"||!n.value||!a.value)){await M();try{const i=n.value.offsetWidth,x=n.value.offsetHeight,y=Math.min(i,x);a.value.$el&&(a.value.$el.style.fontSize=`${y}px`)}catch(i){console.error("Icon sizing adjustment failed:",i)}}},r=i=>{if(s.disabled){i.preventDefault(),i.stopPropagation();return}g("click",i)};return $(()=>{s.variant==="responsive"&&(c(),window.addEventListener("resize",c))}),k(()=>{s.variant==="responsive"&&window.removeEventListener("resize",c)}),(i,x)=>(L(),I("div",{ref_key:"iconContainer",ref:n,class:P(l(d)),style:S(l(t)),onClick:r},[b(D,{"model-value":e.badge===!0,color:"error",dot:""},{default:w(()=>[b(l(O),j({ref_key:"iconElement",ref:a},l(v),{class:l(o)}),B({_:2},[E(i.$slots,(y,h)=>({name:h,fn:w(()=>[V(i.$slots,h,{},void 0,!0)])}))]),1040,["class"])]),_:3},8,["model-value"])],6))}}),Q=q(N,[["__scopeId","data-v-3db51b10"]]);export{Q as I};
