var t,e,i={4882(t,e,i){i.d(e,{I:()=>o,v:()=>m}),i(5983),i(2583),i(1821);var o,r=i(9609),s=i(4084),a=i(2927),n=i(8899),l=i(4955),p=i(7137),d=function(t,e,i,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};!function(t){t.CRITICAL="critical",t.MEDIUM="medium"}(o||(o={}));const h={[o.CRITICAL]:{icon:"flag-filled",color:"negative"},[o.MEDIUM]:{icon:"warning-filled",color:"warning"}},c={dismiss:"Dismiss",justNow:"Just now",minutesAgo:t=>`${t} ${1===t?"min":"mins"} ago`,hoursAgo:t=>`${t} ${1===t?"hour":"hours"} ago`,daysAgo:t=>`${t} ${1===t?"day":"days"} ago`};var m;!function(t){let e=class extends a.LitElement{constructor(){super(...arguments),this.severity="",this.category="",this.timestamp="",this.title="",this.queueName="",this.details=[],this.insight="",this.primaryActionLabel="Click",this.primaryActionDropdown=!1,this.detailsHeading="",this.showDismiss=!1,this.expanded=!1,this.relativeTime=""}static get styles(){return[s.A,p.A]}get normalizedSeverity(){var t;const e=(null!==(t=this.severity)&&void 0!==t?t:"").toLowerCase();return Object.values(o).includes(e)?e:void 0}get severityIcon(){return this.normalizedSeverity?h[this.normalizedSeverity].icon:"info-circle-filled"}get severityColor(){return this.normalizedSeverity?h[this.normalizedSeverity].color:"neutral"}get hasInsight(){var t;return(null!==(t=this.insight)&&void 0!==t?t:"").trim().length>0}get detailRows(){return Array.isArray(this.details)?this.details:[]}updateRelativeTime(){this.timestamp&&(this.relativeTime=this.formatRelativeTime(this.timestamp))}startTimer(){this.stopTimer(),this.timestamp&&(this.updateRelativeTime(),this.timerInterval=setInterval(()=>this.updateRelativeTime(),6e4))}stopTimer(){this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=void 0)}willUpdate(t){t.has("timestamp")&&this.startTimer()}disconnectedCallback(){super.disconnectedCallback(),this.stopTimer()}formatRelativeTime(t){const e=this.constructor.locale,i=Date.now(),o="number"==typeof t?t:new Date(t).getTime();if(isNaN(o))return"";const r=i-o;if(r<0)return e.justNow;const s=Math.floor(r/6e4);if(s<1)return e.justNow;if(s<60)return e.minutesAgo(s);const a=Math.floor(s/60);if(a<24)return e.hoursAgo(a);const n=Math.floor(a/24);return e.daysAgo(n)}handlePrimaryAction(){this.dispatchEvent(new CustomEvent("primary-action-clicked",{bubbles:!0,composed:!0}))}handleDismiss(){this.dispatchEvent(new CustomEvent("dismiss-clicked",{bubbles:!0,composed:!0}))}renderTimestamp(){return this.relativeTime?a.html`<span class="md-card-alert-timestamp">${this.relativeTime}</span>`:a.nothing}renderHeader(){return this.severity||this.category||this.timestamp?a.html`
        <div class="md-card-alert-header">
          <div class="md-card-alert-chips">
            ${this.severity?a.html`
                  <md-chip color=${this.severityColor} small>
                    <md-icon
                      name=${this.severityIcon}
                      size="14"
                      iconSet="momentumDesign"
                      slot="custom-left-content"
                    ></md-icon>
                  </md-chip>
                `:a.nothing}
            ${this.category?a.html`<md-chip value=${this.category} color="neutral" small></md-chip>`:a.nothing}
          </div>
          ${this.renderTimestamp()}
        </div>
      `:a.nothing}renderTitleSection(){return this.title||this.queueName?a.html`
        <div class="md-card-alert-title-section">
          ${this.title?a.html`<h3 class="md-card-alert-title">${this.title}</h3>`:a.nothing}
          ${this.queueName?a.html`
                <p class="md-card-alert-subtitle">
                  <md-icon
                    name="queue-contact-bold"
                    size="16"
                    iconSet="momentumDesign"
                    class="md-card-alert-subtitle-icon"
                  ></md-icon>
                  ${this.queueName}
                </p>
              `:a.nothing}
        </div>
      `:a.nothing}renderDetails(){return 0===this.detailRows.length?a.nothing:a.html`
        <div class="md-card-alert-details">
          <span class="md-card-alert-details-heading">${this.detailsHeading}</span>
          ${this.detailRows.map(t=>a.html`
              <div class="md-card-alert-detail-row">
                <span class="md-card-alert-detail-label">${t.label}</span>
                <span
                  class=${(0,l.classMap)({"md-card-alert-detail-value":!0,"md-card-alert-detail-value--highlighted":!!t.highlighted})}
                  >${t.value}</span
                >
              </div>
            `)}
        </div>
      `}renderInsight(){return this.hasInsight?a.html`
        <div class="md-card-alert-insight">
          <md-icon name="sparkle-filled" iconSet="momentumDesign" class="md-card-alert-insight-icon"></md-icon>
          <span class="md-card-alert-insight-text">${this.insight}</span>
        </div>
      `:a.nothing}renderActions(){return a.html`
        <div class="md-card-alert-actions">
          <md-button
            size="32"
            variant="primary"
            class="md-card-alert-primary-action"
            ariaLabel=${this.primaryActionLabel}
            @click=${this.handlePrimaryAction}
          >
            <span slot="text">${this.primaryActionLabel}</span>
            ${this.primaryActionDropdown?a.html`<md-icon
                  name=${this.expanded?"arrow-up-bold":"arrow-down-bold"}
                  size="12"
                  iconSet="momentumDesign"
                ></md-icon>`:a.nothing}
          </md-button>
          ${this.showDismiss?a.html`
                <md-button
                  size="32"
                  variant="secondary"
                  outline
                  class="md-card-alert-dismiss"
                  ariaLabel=${this.constructor.locale.dismiss}
                  @click=${this.handleDismiss}
                >
                  <span slot="text">${this.constructor.locale.dismiss}</span>
                </md-button>
              `:a.nothing}
        </div>
      `}render(){return a.html`
        <div
          class=${(0,l.classMap)({"md-card-alert":!0,"md-card-alert--no-insight":!this.hasInsight})}
          part="card"
          tabindex="0"
        >
          ${this.renderHeader()} ${this.renderTitleSection()} ${this.renderDetails()} ${this.renderInsight()}
          ${this.renderActions()}
        </div>
      `}};e.locale=Object.assign({},c),d([(0,n.property)({type:String})],e.prototype,"severity",void 0),d([(0,n.property)({type:String})],e.prototype,"category",void 0),d([(0,n.property)({type:String})],e.prototype,"timestamp",void 0),d([(0,n.property)({type:String})],e.prototype,"title",void 0),d([(0,n.property)({type:String})],e.prototype,"queueName",void 0),d([(0,n.property)({type:Array})],e.prototype,"details",void 0),d([(0,n.property)({type:String})],e.prototype,"insight",void 0),d([(0,n.property)({type:String})],e.prototype,"primaryActionLabel",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"primaryActionDropdown",void 0),d([(0,n.property)({type:String})],e.prototype,"detailsHeading",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"showDismiss",void 0),d([(0,n.property)({type:Boolean})],e.prototype,"expanded",void 0),d([(0,n.state)()],e.prototype,"relativeTime",void 0),e=d([(0,r.w)("md-card-alert")],e),t.ELEMENT=e}(m||(m={}))},2583(t,e,i){i(2708),i(9613);var o,r=i(2900),s=i(9609),a=i(4084),n=i(2927),l=i(8899),p=i(4955),d=i(3517),h=i(9558),c=function(t,e,i,o){var r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.color="",this.bgColor="",this.textColor="",this.height="",this.icon="",this.iconColor="",this.iconSize="",this.role="group",this.id="",this.small=!1,this.readonly=!1,this.selected=!1,this.disabled=!1,this.determinateProgress=0,this.indeterminateProgress=!1,this.tooltipText="",this.tooltipPlacement="auto",this.iconSet="momentumUI",this.suppressDefaultMaxWidth=!1,this.decorative=!1,this.shouldTruncateValue=!0,this.value="",this.textOverflow=!1,this.renderedText="",this.MAXWIDTH=115,this.selectionChange=t=>{this.dispatchEvent(new CustomEvent("chip-selected",{composed:!0,bubbles:!0,detail:{selected:t}}))},this.handleClear=t=>{this.dispatchEvent(new CustomEvent("chip-deleted",{composed:!0,bubbles:!0,detail:{id:t}}))},this.handleSelect=()=>{this.disabled||(this.selected=!0,this.selectionChange(!0))},this.handleDeSelect=()=>{this.selected=!1,this.selectionChange(!1)},this.renderBgColor=()=>this.bgColor?`background-color: ${this.bgColor};`:n.nothing,this.renderTextColor=()=>this.textColor?`color: ${this.textColor};`:n.nothing,this.renderHeight=()=>this.height?`height: ${this.height};`:n.nothing,this.getStyles=()=>this.bgColor||this.textColor||this.height?n.html`
          <style>
            :host .md-chip {
              ${this.renderBgColor()};
              ${this.renderTextColor()};
              ${this.renderHeight()};
            }
          </style>
        `:n.nothing}connectedCallback(){super.connectedCallback(),this.truncStringPortion(this.value),this.setAttribute("role",this.role)}willUpdate(t){super.willUpdate(t),(t.has("value")||t.has("shouldTruncateValue"))&&this.truncStringPortion(this.value)}getTextWidth(t,e){const i=null!=e?e:getComputedStyle(this).font,o=document.createElement("canvas").getContext("2d");return o?(o.font=i,o.measureText(t).width):0}truncStringPortion(t){const e=this.getTextWidth(t);if(!this.shouldTruncateValue||e<this.MAXWIDTH)return this.renderedText=t,void(this.textOverflow=!1);const i=Array.from(t);let o=Math.min(4,i.length),r=Math.min(5,Math.max(0,i.length-o-1)),s=i.slice(0,o).join(""),a=i.slice(-r).join(""),n=`${s}…${a}`;if(this.getTextWidth(n)>this.MAXWIDTH)return this.renderedText=n,void(this.textOverflow=!0);for(;o+r<i.length;){let t=!1;if(o+r<i.length){const e=s+i[o],r=`${e}…${a}`;this.getTextWidth(r)<=this.MAXWIDTH&&(s=e,o+=1,n=r,t=!0)}if(o+r<i.length){const e=i[i.length-r-1]+a,o=`${s}…${e}`;this.getTextWidth(o)<=this.MAXWIDTH&&(a=e,r+=1,n=o,t=!0)}if(!t)break}this.renderedText=n,this.textOverflow=!0}handleClick(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("md-tooltip");null==e||e.dispatchEvent(new CustomEvent("tooltip-destroy",{bubbles:!0,composed:!0,detail:{placement:null==e?void 0:e.placement,reference:null==e?void 0:e.reference,popper:null==e?void 0:e.popper}})),this.dispatchEvent(new CustomEvent("chip-interaction",{composed:!0,bubbles:!0,detail:{id:this.id}}))}handleKeydown(t){switch(t.code){case r.Uz.Space:case r.Uz.Enter:this.handleSelect(),this.handleClick()}}static get styles(){return[a.A,h.A]}loadingTemplate(){return this.determinateProgress||this.indeterminateProgress?this.determinateProgress?n.html`
              <md-progress-bar
                class="md-chip--loading"
                type="determinate"
                value="${this.determinateProgress}"
                displayFormat="none"
              >
              </md-progress-bar>
            `:n.html`
              <md-progress-bar class="md-chip--loading" type="indeterminate" displayFormat="none"></md-progress-bar>
            `:n.nothing}iconTemplate(){const t=this.disabled?"":this.iconColor;return this.icon?n.html`
            <md-icon
              class="md-chip--icon"
              part="chip-icon"
              name="${this.icon}"
              color="${t}"
              iconSet=${(0,d.ifDefined)(this.iconSet)}
              size="${(0,d.ifDefined)(this.iconSize)}"
            >
            </md-icon>
          `:n.nothing}getToolTipContent(){return this.tooltipText&&this.textOverflow?this.value===this.tooltipText?this.tooltipText:`${this.value}, ${this.tooltipText}`:this.tooltipText?this.tooltipText:this.value}get textContentClassMap(){return{"md-chip--textcontent":!0,"md-chip--suppress-default-max-width":this.suppressDefaultMaxWidth}}get textContentTemplate(){return n.html`<span part="text-content" class=${(0,p.classMap)(this.textContentClassMap)}> ${this.renderedText}</span>`}render(){const t={"md-chip--small":this.small,"md-chip--disabled":this.disabled,[`md-chip--${this.color}`]:this.color,"suppress-max-width":this.suppressDefaultMaxWidth,"md-chip--interactive":!this.decorative},e=this.decorative?void 0:this.selected?"true":"false";return n.html`
        ${this.getStyles()}
        <md-tooltip
          ?disabled=${!this.tooltipText&&!this.textOverflow}
          message="${this.getToolTipContent()}"
          part="tooltip"
          placement="${this.tooltipPlacement}"
        >
          <span
            role=${(0,d.ifDefined)(this.decorative?void 0:"button")}
            tabindex="0"
            class="md-chip ${(0,p.classMap)(t)}"
            part="chip"
            aria-pressed=${(0,d.ifDefined)(e)}
            @click=${this.decorative?void 0:()=>this.handleClick()}
            @keydown=${this.decorative?void 0:t=>this.handleKeydown(t)}
          >
            ${this.loadingTemplate()} ${this.iconTemplate()}
            <slot name="custom-left-content" part="chip-left"> </slot>
            ${this.renderedText?this.textContentTemplate:n.nothing}
            <slot name="custom-right-content" part="chip-right"> </slot>
          </span>
        </md-tooltip>
      `}};c([(0,l.property)({type:String})],e.prototype,"color",void 0),c([(0,l.property)({type:String})],e.prototype,"bgColor",void 0),c([(0,l.property)({type:String})],e.prototype,"textColor",void 0),c([(0,l.property)({type:String})],e.prototype,"height",void 0),c([(0,l.property)({type:String})],e.prototype,"icon",void 0),c([(0,l.property)({type:String})],e.prototype,"iconColor",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSize",void 0),c([(0,l.property)({type:String})],e.prototype,"role",void 0),c([(0,l.property)({type:String,reflect:!0})],e.prototype,"id",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"small",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"readonly",void 0),c([(0,l.property)({type:Boolean,reflect:!0})],e.prototype,"selected",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"disabled",void 0),c([(0,l.property)({type:Number})],e.prototype,"determinateProgress",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"indeterminateProgress",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipText",void 0),c([(0,l.property)({type:String})],e.prototype,"tooltipPlacement",void 0),c([(0,l.property)({type:String})],e.prototype,"iconSet",void 0),c([(0,l.property)({type:Boolean,attribute:"suppress-default-max-width"})],e.prototype,"suppressDefaultMaxWidth",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"decorative",void 0),c([(0,l.property)({type:Boolean})],e.prototype,"shouldTruncateValue",void 0),c([(0,l.property)({type:String,hasChanged:(t,e)=>t!==e})],e.prototype,"value",void 0),c([(0,l.state)({hasChanged:(t,e)=>t!==e})],e.prototype,"textOverflow",void 0),c([(0,l.state)()],e.prototype,"renderedText",void 0),e=c([(0,s.w)("md-chip")],e),t.ELEMENT=e}(o||(o={}))}},o={};function r(t){var e=o[t];if(void 0!==e)return e.exports;var s=o[t]={exports:{}};return i[t](s,s.exports,r),s.exports}r.m=i,t=[],r.O=(e,i,o,s)=>{if(!i){var a=1/0;for(d=0;d<t.length;d++){for(var[i,o,s]=t[d],n=!0,l=0;l<i.length;l++)(!1&s||a>=s)&&Object.keys(r.O).every(t=>r.O[t](i[l]))?i.splice(l--,1):(n=!1,s<a&&(a=s));if(n){t.splice(d--,1);var p=o();void 0!==p&&(e=p)}}return e}s=s||0;for(var d=t.length;d>0&&t[d-1][2]>s;d--)t[d]=t[d-1];t[d]=[i,o,s]},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{r as __webpack_require__};e={2583:0,8619:0},r.C=t=>{var i,o,{__webpack_esm_ids__:s,__webpack_esm_modules__:a,__webpack_esm_runtime__:n}=t,l=0;for(i in a)r.o(a,i)&&(r.m[i]=a[i]);for(n&&n(r);l<s.length;l++)o=s[l],r.o(e,o)&&e[o]&&e[o][0](),e[s[l]]=0;r.O()},r.O.j=t=>0===e[t];import*as s from"../9609.js";r.C(s);import*as a from"../4084.js";r.C(a);import*as n from"../4955.js";r.C(n);import*as l from"../3517.js";r.C(l);import*as p from"../1156.js";r.C(p);import*as d from"../3305.js";r.C(d);import*as h from"../4739.js";r.C(h);import*as c from"../7154.js";r.C(c);import*as m from"../9773.js";r.C(m);import*as y from"../5983.js";r.C(y);import*as u from"../7755.js";r.C(u);import*as v from"../1821.js";r.C(v);import*as g from"../2364.js";r.C(g);import*as f from"../4980.js";r.C(f);import*as C from"../5308.js";r.C(C);import*as b from"../9938.js";r.C(b);import*as $ from"../9500.js";r.C($);import*as x from"../4781.js";r.C(x);import*as T from"../5584.js";r.C(T);import*as w from"../8227.js";r.C(w);import*as S from"../2900.js";r.C(S);import*as j from"../2050.js";r.C(j);import*as A from"../1280.js";r.C(A);import*as D from"../6343.js";r.C(D);import*as I from"../7582.js";r.C(I);import*as M from"../9613.js";r.C(M);import*as O from"../5323.js";r.C(O);import*as E from"../6631.js";r.C(E);import*as P from"../9558.js";r.C(P);import*as k from"../2708.js";r.C(k);import*as _ from"../7137.js";r.C(_);var R=r.O(void 0,[9609,4084,4955,3517,1156,3305,4739,7154,9773,5983,7755,1821,2364,4980,5308,9938,9500,4781,5584,8227,2900,2050,1280,6343,7582,9613,5323,6631,9558,2708,7137],()=>r(4882));const z=(R=r.O(R)).v,W=R.I;export{z as CardAlert,W as CardAlertSeverity};