"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./query-assigned-elements-8EurZY45.js"),i=require("./property-DYTC_2-m.js"),p=require("./class-map-DTzB8z-1.js"),g=".cv-badge{background-color:var(--cv-theme-negative);border-radius:11px;box-sizing:border-box;color:var(--cv-theme-on-negative);display:inline-block;font-family:var(--mdc-typography-caption-font-family);font-size:var(--mdc-typography-caption-font-size);font-weight:var(--mdc-typography-caption-font-weight);line-height:var(--mdc-typography-caption-line-height);height:16px;min-width:16px;padding:0 4px;position:absolute;text-align:center}.cv-badge.small{height:2px;padding:2px;min-width:2px}.cv-badge.top-right{top:var(--cv-badge-position-y, -2px);right:var(--cv-badge-position-x, -2px)}.cv-badge.top-left{top:var(--cv-badge-position-y, -2px);left:var(--cv-badge-position-x, -2px)}.cv-badge.bottom-right{bottom:var(--cv-badge-position-y, -2px);right:var(--cv-badge-position-x, -2px)}.cv-badge.bottom-left{bottom:var(--cv-badge-position-y, -2px);left:var(--cv-badge-position-x, -2px)}.cv-badge.isolated{position:relative;top:0;right:0;bottom:0;left:0}.cv-badge-container{position:relative;display:inline-flex}.wrapped-content{flex-grow:1}.hidden{display:none}";var c=Object.defineProperty,v=Object.getOwnPropertyDescriptor,a=(l,e,t,s)=>{for(var n=s>1?void 0:s?v(e,t):e,o=l.length-1,d;o>=0;o--)(d=l[o])&&(n=(s?d(e,t,n):d(n))||n);return s&&n&&c(e,t,n),n};exports.CovalentBadge=class extends r.s{constructor(){super(...arguments),this.max=100,this.size="large",this.hideBadge=!1,this.verticalAlignment="top",this.horizontalAlignment="right"}firstUpdated(){var t;const e=this.renderRoot.querySelector("slot");if(e&&!e.assignedNodes({flatten:!0}).filter(o=>o.nodeType===Node.ELEMENT_NODE).length){const o=this.renderRoot.querySelector("#badge-content");(t=o==null?void 0:o.classList)==null||t.add("isolated")}}getContent(){let e=this.content;const t=Number(e);return this.showZero&&e==0?e=e.toString():!isNaN(t)&&this.max&&(e=t>this.max?`${this.max}+`:t),e||""}render(){const e={"cv-badge":!0,small:this.size==="small",hidden:!!this.hideBadge||!this.showZero&&this.content==0};return e[`${this.verticalAlignment}-${this.horizontalAlignment}`]=!0,r.x`
      <div class="cv-badge-container">
        <slot class="wrapped-content"></slot>
        <span id="badge-content" class="${p.o(e)}">
          ${this.size!=="small"?this.getContent():""}
        </span>
      </div>
    `}};exports.CovalentBadge.styles=[r.i`
      ${r.r(g)}
    `];a([i.n()],exports.CovalentBadge.prototype,"content",2);a([i.n()],exports.CovalentBadge.prototype,"max",2);a([i.n()],exports.CovalentBadge.prototype,"size",2);a([i.n({type:Boolean,reflect:!0})],exports.CovalentBadge.prototype,"hideBadge",2);a([i.n()],exports.CovalentBadge.prototype,"verticalAlignment",2);a([i.n()],exports.CovalentBadge.prototype,"horizontalAlignment",2);a([i.n({type:Boolean,reflect:!0})],exports.CovalentBadge.prototype,"showZero",2);exports.CovalentBadge=a([r.e("cv-badge")],exports.CovalentBadge);const h=exports.CovalentBadge;exports.default=h;
