import{M as z,W as I,Q as R,bw as C,bF as w,f as o,bx as D,O as l,S as L,I as N,a3 as O,X as q}from"./index-ojdwC1S2.js";import{L as U}from"./index-SLHq6L4P.js";const[_,a]=R("button"),p=I({},D,{tag:l("button"),text:String,icon:String,type:l("default"),size:l("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:l("button"),loadingSize:L,loadingText:String,loadingType:String,iconPosition:l("left")});var E=z({name:_,props:p,emits:["click"],setup(n,{emit:g,slots:t}){const f=C(),b=()=>t.loading?t.loading():o(U,{size:n.loadingSize,type:n.loadingType,class:a("loading")},null),c=()=>{if(n.loading)return b();if(t.icon)return o("div",{class:a("icon")},[t.icon()]);if(n.icon)return o(N,{name:n.icon,class:a("icon"),classPrefix:n.iconPrefix},null)},m=()=>{let e;if(n.loading?e=n.loadingText:e=t.default?t.default():n.text,e)return o("span",{class:a("text")},[e])},x=()=>{const{color:e,plain:r}=n;if(e){const i={color:r?e:"white"};return r||(i.background=e),e.includes("gradient")?i.border=0:i.borderColor=e,i}},S=e=>{n.loading?O(e):n.disabled||(g("click",e),f())};return()=>{const{tag:e,type:r,size:i,block:y,round:B,plain:P,square:k,loading:T,disabled:s,hairline:d,nativeType:h,iconPosition:u}=n,v=[a([r,i,{plain:P,block:y,round:B,square:k,loading:T,disabled:s,hairline:d}]),{[w]:d}];return o(e,{type:h,class:v,style:x(),disabled:s,onClick:S},{default:()=>[o("div",{class:a("content")},[u==="left"&&c(),m(),u==="right"&&c()])]})}}});const Q=q(E);export{Q as B};
