import{a as s}from"./chunk.LHSR56PH.js";import{a as l,b as d}from"./chunk.NL7YFV4O.js";import{a as f}from"./chunk.VAM5SM3O.js";import{a}from"./chunk.UFTAQNZB.js";import{a as u,b as i,d as b,h as n}from"./chunk.XJAJO727.js";import{b as h}from"./chunk.OBAEIKIV.js";import{e as r}from"./chunk.6EV4YU6C.js";var e=class extends n{constructor(){super(...arguments);this.localize=new f(this);this.size="lg";this.selected=!1;this.toggleable=!1;this.removable=!1;this.disabled=!1;this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleRemove(){this.emit("sd-remove")}isLink(){return!!this.href}click(){this.tag.click()}focus(t){this.tag.focus(t)}blur(){this.tag.blur()}async hide(){this.emit("sd-hide"),this.style.opacity="0",await new Promise(t=>setTimeout(t,this.token("--sd-duration-fast",150))),this.hidden=!0,this.emit("sd-after-hide")}render(){let t=this.isLink(),o=this.removable&&!this.selected&&!this.toggleable,c=t?l`a`:o?l`div`:l`button`;return d`<${c} part="base" type="${s(t?void 0:"button")}" href="${s(t?this.href:void 0)}" rel="${s(t&&this.target?"noreferrer noopener":void 0)}" target="${s(t?this.target:void 0)}" download="${s(t?this.download:void 0)}" ?disabled="${s(t?void 0:this.disabled)}" aria-labelledby="content" aria-disabled="${this.disabled?"true":"false"}" aria-pressed="${s(this.toggleable?this.selected:void 0)}" tabindex="${this.disabled||o?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" class="${a("flex border box-border sd-tag-border-radius items-center leading-none whitespace-nowrap transition-colors duration-fast ease-in-out focus-visible:focus-outline",{lg:"h-8 sd-tag-font-weight sd-tag--size-lg-font-size gap-2",sm:"h-6 sd-tag-font-weight sd-tag--size-sm-font-size gap-1"}[this.size],{lg:o?"pl-4 pr-3 py-2":"px-4 py-2",sm:o?"pl-3 pr-2 py-2":"px-3 py-[5px]"}[this.size],this.disabled?a(!t&&"cursor-not-allowed",this.selected&&"bg-neutral-500 text-white","sd-tag--disabled-color-border sd-tag--disabled-color-text"):this.selected?"sd-tag--selected-border-width sd-tag--selected--default-color-background sd-tag--selected--default-color-border sd-tag--selected--default-color-text hover:sd-tag--selected--hover-color-background hover:sd-tag--selected--hover-color-border hover:sd-tag--selected--hover-color-text":a("sd-tag--default-color-border sd-tag--default-color-text",o?"sd-tag--default-color-background has-[button:hover]:border-primary-500 has-[button:hover]:text-primary-500":"sd-tag--default-color-background hover:border-primary-500 hover:text-primary-500 hover:sd-tag--default--hover-color-background"))}"><slot name="icon-left" class="${a("flex-shrink-0",this.size==="lg"?"text-base":"text-[0.75rem]")}"></slot><slot id="content" part="content"></slot>${o&&!t?d`<button class="sd-interactive flex items-center" type="button" @click="${this.handleRemove}" ?disabled="${s(t?void 0:this.disabled)}"><slot part="removable-indicator" name="removable-indicator" class="${a(this.disabled&&"sd-tag--disabled-color-text")}"><sd-icon library="_internal" name="close" label="${this.localize.term("remove")}"></sd-icon></slot></button>`:""}</${c}>`}};e.styles=[...n.styles,h`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */@layer properties;@layer theme,base,components,utilities;
:host{display:inline-block;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4,0,.2,1)));transition-duration:var(--tw-duration,var(--default-transition-duration,150ms));--tw-duration:var(--sd-duration-fast, 150ms);transition-duration:var(--sd-duration-fast,150ms);--tw-ease:var(--ease-in-out, cubic-bezier(0.4, 0, 0.2, 1));transition-timing-function:var(--ease-in-out,cubic-bezier(.4,0,.2,1))}:host([size=lg])::part(removable-indicator){font-size:var(--sd-text-base);line-height:var(--tw-leading,var(--text-base--line-height,calc(1.5 / 1)))}:host([size=sm])::part(removable-indicator){font-size:.75rem}.sd-tag--disabled-color-border{border-color:rgb(var(--sd-tag--disabled-color-border))}.sd-tag-font-weight{font-weight:var(--sd-tag-font-weight)}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}`],r([b("a, button, div")],e.prototype,"tag",2),r([i({type:String,reflect:!0})],e.prototype,"size",2),r([i({type:Boolean,reflect:!0})],e.prototype,"selected",2),r([i({type:Boolean,reflect:!0})],e.prototype,"toggleable",2),r([i({type:Boolean,reflect:!0})],e.prototype,"removable",2),r([i({type:Boolean,reflect:!0})],e.prototype,"disabled",2),r([i({type:String,reflect:!0})],e.prototype,"href",2),r([i({type:String,reflect:!0})],e.prototype,"target",2),r([i({reflect:!0})],e.prototype,"download",2),e=r([u("sd-tag")],e);export{e as a};
