https://www.thecignagroup.com/static/www-thecignagroup-com/bundle/accordion-panel-inline-Jlg3N7JG.js
1import{r as u,n as s,c as f,L as v,x as b,e as g}from"./main-DdEGjCiE.js";import{e as r}from"./query-D1pSaKds.js";import{o as h}from"./if-defined-DIE9v4-k.js";import{q as y}from"./query-shadow-root-DVN9YziJ.js";const m=`/*------------------------------------*\\ 2 #RESET 3\\*------------------------------------*/ 4/** 5 * Border-Box http:/paulirish.com/2012/box-sizing-border-box-ftw/ 6 */ 7*, 8::slotted(*), 9*:before, 10*:after { 11 box-sizing: border-box; 12} 13 14:host *, 15:host *::before, 16:host *::after { 17 box-sizing: inherit; 18} 19 20[hidden] { 21 display: none !important; 22} 23 24/*------------------------------------*\\ 25 #ACCORDION-PANEL 26\\*------------------------------------*/ 27:host ::slotted([slot=showHeader]), 28:host ::slotted([slot=hideHeader]) { 29 display: contents; 30 font-size: inherit !important; 31 font-weight: inherit !important; 32 margin: 0; 33 pointer-events: none; 34} 35:host::part(header) { 36 font-family: var(--leaf-typography-body-default-font-family); 37 font-size: var(--leaf-font-size-2); 38 font-weight: var(--leafdcws-font-weight-semibold); 39} 40:host slot:not([name]) { 41 display: inline-block; 42} 43 44.leaf-c-accordion-panel__body { 45 margin: 0; 46 padding: 0; 47 overflow: hidden; 48 visibility: hidden; 49 transition: height var(--leafdcws-anim-fade-quick) var(--leafdcws-anim-ease), visibility var(--leafdcws-anim-fade-quick) var(--leafdcws-anim-ease); 50} 51.leaf-c-accordion-panel.leaf-is-active .leaf-c-accordion-panel__body { 52 visibility: visible; 53} 54 55.leaf-c-accordion-panel__body-inner { 56 display: flex; 57 font-size: var(--leaf-typography-label-default-font-size); 58 margin-top: var(--leaf-spacing-4); 59 padding: 0 0 var(--leaf-spacing-24) 0; 60} 61 62leaf-icon { 63 height: var(--leaf-spacing-24); 64 min-height: var(--leaf-spacing-24); 65 min-width: var(--leaf-spacing-24); 66 transition: transform var(--leafdcws-anim-fade-quick) var(--leafdcws-anim-ease); 67 width: var(--leaf-spacing-24); 68} 69.leaf-c-accordion-panel.leaf-is-active leaf-icon { 70 transform: rotate(180deg); 71} 72 73.leaf-c-accordion-panel__icon { 74 align-items: center; 75 border-radius: 50%; 76 color: inherit; 77 display: flex; 78 height: var(--leaf-spacing-24); 79 justify-content: center; 80 margin-right: var(--leaf-spacing-2); 81 min-height: var(--leaf-spacing-24); 82 min-width: var(--leaf-spacing-24); 83 width: var(--leaf-spacing-24); 84} 85 86.leaf-c-accordion-panel__button { 87 align-items: center; 88 -webkit-appearance: none; 89 -moz-appearance: none; 90 appearance: none; 91 background-color: var(--leaf-color-bg-opacity-transparent); 92 border: none; 93 border-radius: 0; 94 color: var(--leaf-color-content-brand); 95 cursor: pointer; 96 display: flex; 97 padding: 0; 98 overflow: hidden; 99 transition: color var(--leafdcws-anim-fade-quick) var(--leafdcws-anim-ease); 100 width: auto; 101} 102.leaf-c-accordion-panel__button:focus { 103 background-color: var(--leaf-color-content-default); 104 color: var(--leaf-color-content-knockout); 105 outline: none; 106} 107.leaf-c-accordion-panel__button:focus .leaf-c-accordion-panel__icon { 108 color: inherit; 109}`;var _=Object.defineProperty,i=(o,e,t,d)=>{for(var a=void 0,l=o.length-1,c;l>=0;l--)(c=o[l])&&(a=c(e,t,a)||a);return a&&_(e,t,a),a};const p=class extends v{get showTextHeaderSlot(){return this.querySelector('[slot="showHeader"]')}get hideTextHeaderSlot(){return this.querySelector('[slot="hideHeader"]')}constructor(){super(),this.togglePanel=this.togglePanel.bind(this),this.setPanelHeight=this.setPanelHeight.bind(this)}connectedCallback(){super.connectedCallback();const e=Math.floor(Math.random()*9e5)+1e5;this.id=this.id||`leaf-accordion-panel-${e}`,this.ariaLabelledBy=this.ariaLabelledBy||`leaf-accordion-panel-${e}`,this.isActive=this.isActive?this.isActive:location.hash===`#${this.id}`,this.setPanelHeight(),this.isActive&&(this.fullyOpen=!0,this.setPanelHeight())}firstUpdated(){this.setInlineHeader()}toggleFocusableElements(e){const t=e==="open"?0:-1;y(this).forEach(d=>d.tabIndex=t)}async setPanelHeight(){var e,t;await this.updateComplete,this.toggleFocusableElements(this.isActive?"open":""),this.isActive&&!this.fullyOpen||!this.isActive&&this.fullyOpen?this.height=((t=(e=this.shadowRoot)==null?void 0:e.querySelector(".leaf-c-accordion-panel__body-inner"))==null?void 0:t.scrollHeight)+"px":this.isActive&&this.fullyOpen?this.height="auto":!this.isActive&&!this.fullyOpen&&(this.height="0")}togglePanel(){this.isActive=!this.isActive,this.isActive?(this.setPanelHeight(),setTimeout(()=>{this.fullyOpen=!0,this.setPanelHeight()},350)):(this.setPanelHeight(),setTimeout(()=>{this.fullyOpen=!1,this.setPanelHeight()},50)),this.setInlineHeader()}setInlineHeader(){var e,t;(e=this.showTextHeaderSlot)==null||e.setAttribute("aria-hidden",this.isActive?"true":"false"),(t=this.hideTextHeaderSlot)==null||t.setAttribute("aria-hidden",this.isActive?"false":"true"),this.showTextHeader.toggleAttribute("hidden",this.isActive),this.hideTextHeader.toggleAttribute("hidden",!this.isActive)}async updated(){var e,t;await this.updateComplete,(e=this.hideTextHeaderSlot)!=null&&e.textContent&&((t=this.showTextHeaderSlot)!=null&&t.textContent)&&(this.accordionPanelButton.setAttribute("data-element-text",this.isActive?this.hideTextHeaderSlot.textContent:this.showTextHeaderSlot.textContent),this.setAttribute("data-element-text",this.isActive?this.hideTextHeaderSlot.textContent:this.showTextHeaderSlot.textContent))}render(){const e={"leaf-c-accordion-panel":!0,"leaf-is-active":this.isActive===!0};return b` 110 <div class="${g(e)}"> 111 <div class="leaf-c-accordion-panel__header"> 112 <button 113 class="leaf-c-accordion-panel__button ${this.isActive?"leaf-is-active":""}" 114 aria-expanded="${!!this.isActive}" 115 aria-controls="${this.id}-button" 116 aria-label=${h(this.ariaLabeling)} 117 part="button" 118 @click=${this.togglePanel} 119 > 120 <slot name="showHeader" part="header" hidden></slot> 121 <slot name="hideHeader" part="header" hidden></slot> 122 <div class="leaf-c-accordion-panel__icon"> 123 <leaf-icon name="keyboard-arrow-more" part="icon"></leaf-icon> 124 </div> 125 </button> 126 </div> 127 <div 128 class="leaf-c-accordion-panel__body" 129 aria-labelledby="${h(this.ariaLabelledBy)}" 130 aria-hidden="${!this.isActive}" 131 id="${this.id}-button" 132 role="region" 133 part="body" 134 style=${"height: "+this.height} 135 > 136 <div class="leaf-c-accordion-panel__body-inner" part="body-inner"> 137 <slot></slot> 138 </div> 139 </div> 140 </div> 141 `}};p.styles=u(m);let n=p;i([s({type:Boolean,attribute:"is-active"})],n.prototype,"isActive");i([s({attribute:"aria-labelledby"})],n.prototype,"ariaLabelledBy");i([s({reflect:!0,attribute:"arialabeling"})],n.prototype,"ariaLabeling");i([f()],n.prototype,"height");i([f()],n.prototype,"fullyOpen");i([r(".leaf-c-accordion-panel__button")],n.prototype,"accordionPanelButton");i([r('slot[name="showHeader"]')],n.prototype,"showTextHeader");i([r('slot[name="hideHeader"]')],n.prototype,"hideTextHeader");customElements.define("leaf-accordion-panel-inline",n);export{n as LeafAccordionPanelInline}; 142//# sourceMappingURL=accordion-panel-inline-Jlg3N7JG.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.