import{x as v,W as u,a6 as B,z as S,d as y,i as t,J as T,B as I,K as A}from"./index.afa1b71c.js";const[C,e,P]=v("submit-bar"),h={tip:String,label:String,price:Number,tipIcon:String,loading:Boolean,currency:u("\xA5"),disabled:Boolean,textAlign:String,buttonText:String,buttonType:u("danger"),buttonColor:String,suffixLabel:String,decimalLength:B(2),safeAreaInsetBottom:S};var k=y({name:C,props:h,emits:["submit"],setup(n,{emit:d,slots:a}){const b=()=>{const{price:i,label:r,currency:l,textAlign:g,suffixLabel:o,decimalLength:c}=n;if(typeof i=="number"){const s=(i/100).toFixed(+c).split("."),x=c?`.${s[1]}`:"";return t("div",{class:e("text"),style:{textAlign:g}},[t("span",null,[r||P("label")]),t("span",{class:e("price")},[l,t("span",{class:e("price-integer")},[s[0]]),x]),o&&t("span",{class:e("suffix-label")},[o])])}},m=()=>{var i;const{tip:r,tipIcon:l}=n;if(a.tip||r)return t("div",{class:e("tip")},[l&&t(T,{class:e("tip-icon"),name:l},null),r&&t("span",{class:e("tip-text")},[r]),(i=a.tip)==null?void 0:i.call(a)])},p=()=>d("submit"),f=()=>a.button?a.button():t(I,{round:!0,type:n.buttonType,text:n.buttonText,class:e("button",n.buttonType),color:n.buttonColor,loading:n.loading,disabled:n.disabled,onClick:p},null);return()=>{var i,r;return t("div",{class:[e(),{"van-safe-area-bottom":n.safeAreaInsetBottom}]},[(i=a.top)==null?void 0:i.call(a),m(),t("div",{class:e("bar")},[(r=a.default)==null?void 0:r.call(a),b(),f()])])}}});const N=A(k);export{N as S};
