1import{_ as h,aU as f,aX as g,bo as b,ak as _,al as k}from"./index.474d7b13.js";import{N as v,_ as T,D as i,W as C,U as S,E as s,R as o,Q as n,S as y,G as p,$ as w,f as x,a1 as l,H as z,a3 as B}from"./vue.00f7c436.js";import"./sentry.09480738.js";const N={name:"TmlTag",inject:["theme"],inheritAttrs:!1,compatConfig:{INSTANCE_LISTENERS:!1},props:{disabled:Boolean,href:String,avatar:[Object,String],colorThumbnail:String,background:String,border:String,textColor:String,small:Boolean,borderRadius:Number,whiteSpace:{type:String,default:"nowrap",validator:e=>["nowrap","normal","pre-wrap"].includes(e)}},data(){return{faTimes:f.faTimes,color:null}},computed:{internalStyles(){return g({"--tag-background-color":this.background||this.theme().get("tag.background.color"),"--tag-border-color":this.border||this.theme().get("tag.border.color"),"--tag-text-color":this.color||this.theme().get("tag.text.color"),"--tag-size":`${(this.size||1)*1.8}em`,"--tag-font-size":`${this.size||1}em`,"--tag-padding":`${.25*(this.size||1)}em ${.75*this.size||1}em`,"--tag-icon-padding":`0 ${.75*this.size||1}em 0 0`,"--tag-border-radius":`${this.internalBorderRadius}px`},b)},internalBorderRadius(){return this.avatar||this.colorThumbnail?9999:typeof this.borderRadius=="number"?this.borderRadius:9999},size(){return this.small?.9:1}},watch:{background:{immediate:!0,handler(e,a){if(!e||e===a||this.textColor!==void 0)return;_(k(e))<.65&&(this.color="#ffffff")}},textColor:{immediate:!0,handler(e,a){!e||e===a||(this.color=e)}}},methods:{onClick(e){if(this.disabled){this.$emit("disabled",e);return}this.$emit("click",e)},onClose(e){if(this.disabled){this.$emit("disabled",e);return}this.$emit("close",e)}}},R=["src"];function E(e,a,t,D,c,r){const d=v("font-awesome-icon"),m=T("tml-touch-mouse");return i(),C(B(t.href?"tml-anchor":"div"),{class:z(["tml-tag inline-flex items-center",{"cursor-pointer":e.$attrs.onClick,disabled:t.disabled,avatar:t.avatar,bordered:t.border,"color-thumbnail h-full":t.colorThumbnail}]),style:o(r.internalStyles),href:t.href,onClick:r.onClick},{default:S(()=>[t.avatar?(i(),s("img",{key:0,class:"avatar",src:t.avatar,alt:"alt"},null,8,R)):t.colorThumbnail?(i(),s("div",{key:1,class:"color-thumbnail",style:o({background:t.colorThumbnail})},null,4)):n("",!0),y("div",{class:"content",style:o({whiteSpace:t.whiteSpace})},[p(e.$slots,"default",{},void 0,!0)],4),e.$attrs.onClose&&!t.disabled?w((i(),s("span",{key:2,class:"icon flex justify-center items-center",onMouseup:a[0]||(a[0]=l(u=>r.onClose(u),["stop","prevent"])),onTouchend:a[1]||(a[1]=l(()=>{},["stop","prevent"]))},[x(d,{class:"tag-icon",icon:c.faTimes},null,8,["icon"])],32)),[[m]]):n("",!0)]),_:3},8,["style","href","class","onClick"])}const V=h(N,[["render",E],["__scopeId","data-v-18238585"]]);export{V as default}; 2//# sourceMappingURL=TmlTag.d83dee31.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.