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