!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("luxon"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","luxon"],t);else{var r="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("luxon")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx,e.luxon);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(self,(e,t,r,i,o,a,s,n,d)=>(()=>{"use strict";var l,c={7540(e,t,r){r.r(t),r.d(t,{CardState:()=>m,CardV2:()=>u}),r(5983),r(1821),r(9613);var i=r(9609),o=r(4084),a=r(7161),s=r(429),n=r(5125),d=r(5796),l=r(513),c=function(e,t,r,i){var o,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(s=(a<3?o(s):a>3?o(t,r,s):o(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s};const p="hh:mm:ss";var m,u;!function(e){e.DEFAULT="default",e.ACTIVE="active",e.INACTIVE="inactive"}(m||(m={})),function(e){let t=class extends a.LitElement{constructor(){super(...arguments),this.state=m.DEFAULT,this.identifier=void 0,this.header=void 0,this.info=void 0,this.data=void 0,this.createdTime=0,this.active=!1,this.expandable=!1,this.expandAriaLabel="Expand for more details",this.renderedData=""}connectedCallback(){super.connectedCallback(),this.checkForExtraInfoSlot()}disconnectedCallback(){super.disconnectedCallback(),this.clearInterval()}clearInterval(){this.interval&&(clearInterval(this.interval),this.interval=void 0)}static get styles(){return[o.A,l.A]}get isCardActive(){return this.state===m.ACTIVE}willUpdate(e){super.willUpdate(e),(e.has("active")||e.has("data")||e.has("createdTime"))&&this.calculateRenderedData()}expandCardToggled(){var e;this.state=this.isCardActive?m.DEFAULT:m.ACTIVE,this.dispatchEvent(new CustomEvent("expand-card-toggled",{detail:{identifier:null!==(e=this.identifier)&&void 0!==e?e:"",active:this.isCardActive},bubbles:!0,composed:!0}))}checkForExtraInfoSlot(){var e;(null===(e=this.extraInfoSlot)||void 0===e?void 0:e.assignedNodes().length)>0?this.setAttribute("has-extra-info",""):this.removeAttribute("has-extra-info")}handleExtraInfoSlotChange(e){this.checkForExtraInfoSlot()}get cardClassMap(){return{"md-card-v2":!0,[`md-card--${this.state}`]:!0}}get contentClassMap(){return{"md-card-v2-content":!0,inactive:this.state===m.INACTIVE}}get footerExpandClassMap(){return{"md-card-v2-footer-expand":!0,hidden:!this.expandable}}get expandCardHandler(){return this.expandable?this.expandCardToggled:null}renderHeader(){return a.html`
        <div class="md-card-v2-header-title">
          <h3>${this.header}</h3>
          ${this.info?a.html`
                <md-tooltip message="${this.info}" placement="top">
                  <md-button ariaLabel="${this.header}, ${this.data}, ${this.info}" size="20" variant="ghost" circle>
                    <md-icon slot="icon" name="info-badge-filled" iconSet="momentumDesign"></md-icon>
                  </md-button>
                </md-tooltip>
              `:a.nothing}
        </div>
      `}renderExpandButton(){return a.html`
        <div class="${(0,n.classMap)(this.footerExpandClassMap)}">
          <md-button ariaLabel="${this.expandAriaLabel}" circle size="28">
            <md-icon
              slot="icon"
              iconSet="momentumDesign"
              name=${this.isCardActive?"arrow-circle-up-bold":"arrow-circle-down-bold"}
              size="18"
            ></md-icon>
          </md-button>
        </div>
      `}renderFooter(){return a.html`
        <div class="md-card-v2-footer">
          <div class="md-card-v2-footer-content">
            <slot name="card-footer-content"></slot>
          </div>
          ${this.renderExpandButton()}
        </div>
      `}calculateRenderedData(){this.clearInterval(),!this.active&&this.data?this.renderedData=this.data:this.active&&this.createdTime>0&&(this.renderedData=d.Duration.fromMillis(Date.now()-this.createdTime).toFormat(p),this.interval=window.setInterval(()=>{this.renderedData=d.Duration.fromMillis(Date.now()-this.createdTime).toFormat(p)},1e3))}render(){return a.html`
        <div class="${(0,n.classMap)(this.cardClassMap)}" @click=${this.expandCardHandler}>
          <div class="md-card-v2-header">${this.renderHeader()}</div>
          <div class="${(0,n.classMap)(this.contentClassMap)}">
            <h2>${this.renderedData}</h2>
            <div class="md-card-v2-content-extra-info">
              <slot name="card-extra-info" @slotchange=${this.handleExtraInfoSlotChange}></slot>
            </div>
          </div>
          ${this.renderFooter()}
        </div>
      `}};c([(0,s.property)({type:String})],t.prototype,"state",void 0),c([(0,s.property)({type:String})],t.prototype,"identifier",void 0),c([(0,s.property)({type:String})],t.prototype,"header",void 0),c([(0,s.property)({type:String})],t.prototype,"info",void 0),c([(0,s.property)({type:String})],t.prototype,"data",void 0),c([(0,s.property)({type:Number})],t.prototype,"createdTime",void 0),c([(0,s.property)({type:Boolean})],t.prototype,"active",void 0),c([(0,s.property)({type:Boolean,reflect:!0})],t.prototype,"expandable",void 0),c([(0,s.property)({type:String,attribute:"expand-aria-label"})],t.prototype,"expandAriaLabel",void 0),c([(0,s.query)('slot[name="card-extra-info"]')],t.prototype,"extraInfoSlot",void 0),c([(0,s.state)()],t.prototype,"interval",void 0),c([(0,s.state)()],t.prototype,"renderedData",void 0),t=c([(0,i.w)("md-card-v2")],t),e.ELEMENT=t}(u||(u={}))},2022(e){e.exports=a},554(e){e.exports=s},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=r},291(e){e.exports=o},318(e){e.exports=i},5796(e){e.exports=d},5314(e){e.exports=n}},p={};function m(e){var t=p[e];if(void 0!==t)return t.exports;var r=p[e]={exports:{}};return c[e](r,r.exports,m),r.exports}m.m=c,l=[],m.O=(e,t,r,i)=>{if(!t){var o=1/0;for(d=0;d<l.length;d++){for(var[t,r,i]=l[d],a=!0,s=0;s<t.length;s++)(!1&i||o>=i)&&Object.keys(m.O).every(e=>m.O[e](t[s]))?t.splice(s--,1):(a=!1,i<o&&(o=i));if(a){l.splice(d--,1);var n=r();void 0!==n&&(e=n)}}return e}i=i||0;for(var d=l.length;d>0&&l[d-1][2]>i;d--)l[d]=l[d-1];l[d]=[t,r,i]},m.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return m.d(t,{a:t}),t},m.d=(e,t)=>{for(var r in t)m.o(t,r)&&!m.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},m.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={1521:0};m.O.j=t=>0===e[t];var t=(t,r)=>{var i,o,[a,s,n]=r,d=0;if(a.some(t=>0!==e[t])){for(i in s)m.o(s,i)&&(m.m[i]=s[i]);if(n)var l=n(m)}for(t&&t(r);d<a.length;d++)o=a[d],m.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return m.O(l)},r=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var u=m.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5584,8227,2900,2050,6343,7582,9613,5323,513],()=>m(7540));return m.O(u)})());