"use strict";const e=require("../common/src/instantiationDecorator.js"),o=require("../common/config.js"),s=require("./props.js"),t=require("../common/utils.js"),i=require("../common/utils.wxs.js"),a=require("../../../../common/vendor.js"),n=`${o.prefix}-button`,r=e.uniComponent({name:n,options:{styleIsolation:"shared"},externalClasses:[`${o.prefix}-class`,`${o.prefix}-class-icon`,`${o.prefix}-class-loading`],components:{TIcon:()=>"../icon/icon.js",TLoading:()=>"../loading/loading.js"},props:{...s.props},emits:["click"],data:()=>({tools:i.tools,prefix:o.prefix,className:"",classPrefix:n,_icon:void 0}),computed:{iconCustomStyle(){return i.tools._style([{fontSize:{"extra-small":"var(--td-button-extra-small-icon-font-size, 18px)",small:"var(--td-button-small-icon-font-size, 18px)",medium:"var(--td-button-medium-icon-font-size, 20px)",large:"var(--td-button-large-icon-font-size, 24px)"}[this.size||"medium"],borderRadius:"var(--td-button-icon-border-radius, 4px)"},this._icon.style||""])},loadingCustomStyle:()=>i.tools._style({display:"flex",alignItems:"center",justifyContent:"center"})},watch:{icon:{handler(e){this._icon=t.calcIcon(e,"")},immediate:!0},theme:"setClass",size:"setClass",plain:"setClass",block:"setClass",shape:"setClass",disabled:"setClass",loading:"setClass",variant:"setClass"},mounted(){this.setClass()},methods:{setClass(){const e=[n,this.tClass,`${n}--${this.variant||"base"}`,`${n}--${this.theme||"default"}`,`${n}--${this.shape||"rectangle"}`,`${n}--size-${this.size||"medium"}`];this.block&&e.push(`${n}--block`),this.disabled&&e.push(`${n}--disabled`),this.ghost&&e.push(`${n}--ghost`),this.className=e.join(" ")},getuserinfo(e){this.$emit("getuserinfo",e)},contact(e){this.$emit("contact",e)},getphonenumber(e){this.$emit("getphonenumber",e)},error(e){this.$emit("error",e)},opensetting(e){this.$emit("opensetting",e)},launchapp(e){this.$emit("launchapp",e)},chooseavatar(e){this.$emit("chooseavatar",e)},agreeprivacyauthorization(e){this.$emit("agreeprivacyauthorization",e)},handleTap(e){this.disabled||this.loading||this.$emit("click",e)}}});if(!Array){(a.resolveComponent("t-icon")+a.resolveComponent("t-loading"))()}Math||((()=>"../icon/icon.js")+(()=>"../loading/loading.js"))();const l=a._export_sfc(r,[["render",function(e,o,s,t,i,n){return a.e({a:e._icon},e._icon?{b:a.o((e=>"handleClose")),c:a.p({"custom-style":e.iconCustomStyle,"t-class":e.classPrefix+"__icon "+e.classPrefix+"__icon--"+(e._icon.activeIdx==e._icon.index?"active ":" ")+e.tClassIcon,prefix:e._icon.prefix,name:e._icon.name||"",size:e._icon.size,color:e._icon.color})}:{},{d:e.loading},e.loading?{e:a.p({delay:e.loadingProps.delay||0,duration:e.loadingProps.duration||800,indicator:e.loadingProps.indicator||!0,"inherit-color":e.loadingProps.inheritColor||!0,layout:e.loadingProps.layout||"horizontal",pause:e.loadingProps.pause||!1,progress:e.loadingProps.progress||0,reverse:e.loadingProps.reverse||!1,size:e.loadingProps.size||"40rpx",text:e.loadingProps.text||"",theme:e.loadingProps.theme||"circular",loading:!0,"t-class":e.classPrefix+"__loading "+e.classPrefix+"__loading--wrapper","t-class-indicator":e.classPrefix+"__loading--indicator "+e.tClassLoading,"custom-style":e.loadingCustomStyle})}:{},{f:e.content},e.content?{g:a.t(e.content)}:{},{h:a.n(e.classPrefix+"__content "+((e._icon&&e._icon.name||e.loading)&&e.content?e.classPrefix+"__content--has-icon":"")),i:e.tId,j:a.s(e.tools._style([e.customStyle])),k:e.customDataset,l:a.n(e.className),m:e.disabled||e.loading?"":e.type,n:e.disabled||e.loading?"":e.openType,o:e.hoverStopPropagation,p:e.hoverStartTime,q:e.hoverStayTime,r:e.lang,s:e.sessionFrom,t:e.disabled||e.loading?"":e.hoverClass||e.classPrefix+"--hover",v:e.sendMessageTitle,w:e.sendMessagePath,x:e.sendMessageImg,y:e.appParameter,z:e.showMessageCard,A:e.ariaLabel,B:a.o(((...o)=>e.handleTap&&e.handleTap(...o))),C:a.o(((...o)=>e.getuserinfo&&e.getuserinfo(...o))),D:a.o(((...o)=>e.contact&&e.contact(...o))),E:a.o(((...o)=>e.getphonenumber&&e.getphonenumber(...o))),F:a.o(((...o)=>e.error&&e.error(...o))),G:a.o(((...o)=>e.opensetting&&e.opensetting(...o))),H:a.o(((...o)=>e.launchapp&&e.launchapp(...o))),I:a.o(((...o)=>e.chooseavatar&&e.chooseavatar(...o))),J:a.o(((...o)=>e.agreeprivacyauthorization&&e.agreeprivacyauthorization(...o)))})}],["__scopeId","data-v-0f6cdf38"]]);wx.createComponent(l);
