import*as e from"lit/directives/style-map.js";import*as t from"lit";import*as o from"@momentum-ui/utils/lib/getColorValue";import*as s from"lit/directives/if-defined.js";import*as r from"lit/directives/class-map.js";import*as i from"mobx";import*as a from"lit/decorators.js";import*as d from"@momentum-ui/icons/data/momentumUiIconsNames.json";var n,l,p={1156(t,o,s){var r,i;t.exports=(r={styleMap:()=>e.styleMap},i={},s.d(i,r),i)},2927(e,o,s){var r,i;e.exports=(r={LitElement:()=>t.LitElement,css:()=>t.css,html:()=>t.html,nothing:()=>t.nothing},i={},s.d(i,r),i)},3496(e,t,s){var r,i;e.exports=(r={default:()=>o.default},i={},s.d(i,r),i)},3517(e,t,o){var r,i;e.exports=(r={ifDefined:()=>s.ifDefined},i={},o.d(i,r),i)},4466(e,t,o){o.d(t,{A:()=>s}),o(1821);var s,r=o(7704),i=o(9609),a=o(93),d=o(4084),n=o(2927),l=o(8899),p=o(3517),m=o(742),c=function(e,t,o,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,s);else for(var d=e.length-1;d>=0;d--)(r=e[d])&&(a=(i<3?r(a):i>3?r(t,o,a):r(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a};!function(e){let t=class extends((0,r.yC)(n.LitElement)){constructor(){super(...arguments),this._expanded=!1,this._level=3,this.uniqueId=(0,a.O)("accordion-item"),this.label="",this.disabled=!1}get expanded(){return this._expanded}set expanded(e){const t=this._expanded;this._expanded=e,e?(this.notifyAccordionFocus(),this.notifyExpandedHeader()):this.notifyCollapsedHeader(),this.requestUpdate("expanded",t)}get level(){return this._level}set level(e){const t=this.level;e<1||e>6?(console.warn("Please set appropriate section heading level"),this._level=3):this._level=e,this.requestUpdate("level",t)}notifyExpandedHeader(){this.dispatchEvent(new CustomEvent("accordion-item-expanded",{composed:!0,bubbles:!0,detail:{id:this.uniqueId}}))}notifyCollapsedHeader(){this.dispatchEvent(new CustomEvent("accordion-item-collapsed",{composed:!0,bubbles:!0,detail:{id:this.uniqueId}}))}notifyAccordionFocus(){this.dispatchEvent(new CustomEvent("focus-visible",{composed:!0,bubbles:!0}))}firstUpdated(e){super.firstUpdated(e),this.setAttribute("id",this.uniqueId)}static get styles(){return[d.A,m.A]}handleMouseDown(e){this.disabled||this.dispatchEvent(new CustomEvent("accordion-item-click",{detail:{srcEvent:e},composed:!0,bubbles:!0}))}handleKeyDown(e){this.disabled||this.dispatchEvent(new CustomEvent("accordion-item-keydown",{detail:{srcEvent:e},bubbles:!0,composed:!0}))}render(){return n.html`
        <div class="md-accordion-item">
          <div role="heading" aria-level=${this.level} class="md-accordion-header" part="accordion-header">
            <button
              type="button"
              aria-expanded=${this.expanded}
              class="md-accordion-expander"
              aria-label=${(0,p.ifDefined)(this.label||void 0)}
              aria-controls="panel-${this.uniqueId}"
              aria-disabled=${this.disabled}
              ?disabled=${this.disabled}
              id="header-${this.uniqueId}"
              part="accordion-button"
              tabindex=${(0,p.ifDefined)(this.disabled?-1:void 0)}
              @mousedown=${this.handleMouseDown}
              @keydown=${this.handleKeyDown}
            >
              <slot name="header-content">
                <span class="md-accordion-expander-label">${this.label}</span>
              </slot>
              <md-icon iconSet=${"momentumDesign"} size="14" name="arrow-down-bold"></md-icon>
            </button>
          </div>
          <div
            role="region"
            id="panel-${this.uniqueId}"
            aria-labelledby="header-${this.uniqueId}"
            class="md-accordion-panel"
            part="accordion-panel"
          >
            <slot></slot>
          </div>
        </div>
      `}};c([(0,l.property)({type:String})],t.prototype,"label",void 0),c([(0,l.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",void 0),c([(0,l.property)({type:Boolean,reflect:!0})],t.prototype,"expanded",null),c([(0,l.property)({type:Number,reflect:!0})],t.prototype,"level",null),c([(0,l.query)(".md-accordion-expander")],t.prototype,"header",void 0),t=c([(0,i.w)("md-accordion-item")],t),e.ELEMENT=t}(s||(s={}))},4955(e,t,o){var s,i;e.exports=(s={classMap:()=>r.classMap},i={},o.d(i,s),i)},4980(e,t,o){var s,r;e.exports=(s={action:()=>i.action,observable:()=>i.observable},r={},o.d(r,s),r)},8899(e,t,o){var s,r;e.exports=(s={property:()=>a.property,query:()=>a.query,state:()=>a.state},r={},o.d(r,s),r)},9500(e,t,o){var s,r;e.exports=(s={default:()=>d.default},r={},o.d(r,s),r)}},m={};function c(e){var t=m[e];if(void 0!==t)return t.exports;var o=m[e]={exports:{}};return p[e](o,o.exports,c),o.exports}c.m=p,n=[],c.O=(e,t,o,s)=>{if(!t){var r=1/0;for(l=0;l<n.length;l++){for(var[t,o,s]=n[l],i=!0,a=0;a<t.length;a++)(!1&s||r>=s)&&Object.keys(c.O).every(e=>c.O[e](t[a]))?t.splice(a--,1):(i=!1,s<r&&(r=s));if(i){n.splice(l--,1);var d=o();void 0!==d&&(e=d)}}return e}s=s||0;for(var l=n.length;l>0&&n[l-1][2]>s;l--)n[l]=n[l-1];n[l]=[t,o,s]},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{c as __webpack_require__};l={502:0,1745:0,2330:0,4545:0,4928:0,5369:0,6060:0,6920:0,8111:0,8442:0},c.C=e=>{var t,o,{__webpack_esm_ids__:s,__webpack_esm_modules__:r,__webpack_esm_runtime__:i}=e,a=0;for(t in r)c.o(r,t)&&(c.m[t]=r[t]);for(i&&i(c);a<s.length;a++)o=s[a],c.o(l,o)&&l[o]&&l[o][0](),l[s[a]]=0;c.O()},c.O.j=e=>0===l[e];import*as u from"../9609.js";c.C(u);import*as f from"../4084.js";c.C(f);import*as h from"../3305.js";c.C(h);import*as v from"../4739.js";c.C(v);import*as b from"../7154.js";c.C(b);import*as y from"../9773.js";c.C(y);import*as x from"../5983.js";c.C(x);import*as j from"../9488.js";c.C(j);import*as C from"../1821.js";c.C(C);import*as _ from"../2364.js";c.C(_);import*as w from"../9938.js";c.C(w);import*as E from"../4781.js";c.C(E);import*as g from"../5201.js";c.C(g);import*as O from"../5584.js";c.C(O);import*as $ from"../8227.js";c.C($);import*as q from"../2900.js";c.C(q);import*as D from"../7704.js";c.C(D);import*as I from"../93.js";c.C(I);import*as A from"../742.js";c.C(A);var k=c.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5201,5584,8227,2900,7704,93,742],()=>c(4466));const M=(k=c.O(k)).A;export{M as AccordionItem};