import{c as x,o as a,w,e as r,b as y,m as g,T as B,F as u,a as T,f as h,t as f,n as C,r as E}from"./vue.esm-bundler.js?ver=1.3.20";import{_ as v}from"./_plugin-vue_export-helper.js?ver=1.3.20";import{_ as k}from"./DynamicIcon.js?ver=1.3.20";import{S as m}from"./Str.js?ver=1.3.20";import{t}from"./Translator.js?ver=1.3.20";const D={key:0},L={__name:"TransitionAccordion",props:{visible:{type:Boolean,default:!1},duration:{type:Number,default:300}},setup(i){const s=i.duration,l=e=>{e.style.height="0",e.style.opacity="0",e.style.overflow="hidden"},p=(e,c)=>{const o=e.scrollHeight+"px";e.style.transition=`height ${s}ms ease, opacity ${s}ms ease`,requestAnimationFrame(()=>{e.style.height=o,e.style.opacity="1"}),setTimeout(()=>c(),s)},n=e=>{e.style.height="auto",e.style.overflow=""},d=e=>{e.style.height=e.scrollHeight+"px",e.style.opacity="1",e.style.overflow="hidden"},S=(e,c)=>{e.offsetHeight,e.style.transition=`height ${s}ms ease, opacity ${s}ms ease`,e.style.height="0",e.style.opacity="0";const o=()=>{e.style.transition="",e.style.height="",e.style.opacity="",e.style.overflow="",e.removeEventListener("transitionend",o),c()};e.addEventListener("transitionend",o)},b=e=>{};return(e,c)=>(a(),x(B,{onBeforeEnter:l,onEnter:p,onAfterEnter:n,onBeforeLeave:d,onLeave:S,onAfterLeave:b,mode:"in-out"},{default:w(()=>[i.visible?(a(),r("div",D,[g(e.$slots,"default",{},void 0,!0)])):y("",!0)]),_:3}))}},V=v(L,[["__scopeId","data-v-3c33d60d"]]),I={name:"Badge",components:{DynamicIcon:k},props:{status:String,text:{type:String,default:null,required:!1},hideIcon:{type:Boolean,default:!1},size:String,highContrast:{type:Boolean,default:!1},type:String,icon:String},computed:{Str(){return m},computedStatus(){return this.status||this.type},badgeType(){switch(this.computedStatus){case"completed":case"paid":case"active":case"publish":case"shipped":case"success":case"licensed":case"succeeded":return"success";case"failed":case"error":case"canceled":case"expired":return"danger";case"partially_paid":case"intended":return"blue";case"scheduled":case"on-hold":case"pending":case"unpaid":case"warning":case"processing":case"future":return"warning";case"inactive":return"warning";case"dispute":return"warning";default:return"info"}},badgeSize(){return this.size?this.size:""},HighContrast(){return this.highContrast?"is-high-contrast":""}},methods:{getStatusText(){switch(this.computedStatus){case"completed":return t("Completed");case"paid":return t("Paid");case"active":return t("Active");case"publish":return t("Published");case"draft":return t("Draft");case"shipped":return t("Shipped");case"success":return t("Success");case"licensed":return t("Licensed");case"succeeded":return t("Succeeded");case"failed":return t("Failed");case"error":return t("Error");case"canceled":return t("Canceled");case"expired":return t("Expired");case"partially_paid":return t("Partially Paid");case"intended":return t("Intended");case"scheduled":return t("Scheduled");case"on-hold":return t("On Hold");case"pending":return t("Pending");case"unpaid":return t("Unpaid");case"warning":return t("Warning");case"processing":return t("Processing");case"future":return t("Future");case"inactive":return t("Inactive");case"dispute":return t("Dispute");case"disabled":return t("Disabled");case"beta":return t("Beta");default:return m.headline(this.computedStatus)}}}},$={key:0};function z(i,_,s,l,p,n){const d=E("DynamicIcon");return a(),r("span",{class:C(`badge ${n.badgeType} ${n.badgeSize} ${n.HighContrast}`)},[s.status?(a(),r(u,{key:0},[s.icon?(a(),r("span",$,[T(d,{name:s.icon},null,8,["name"])])):y("",!0),s.text?(a(),r(u,{key:1},[h(f(s.text),1)],64)):(a(),r(u,{key:2},[h(f(n.getStatusText()),1)],64))],64)):g(i.$slots,"default",{key:1})],2)}const q=v(I,[["render",z]]);export{q as B,V as T};
