import {a}from'./chunk-CWOXTL6A.js';import {ScanditHTMLElement,html,defineCustomElements,css}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';import {Card}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/Card.js';import {CardList}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/CardList.js';var b=(t=>(t.TextForSubmitCardsButton="text-for-submit-cards-button",t.ButtonSidePositionLandscape="button-side-position-landscape",t))(b||{}),i=class i extends ScanditHTMLElement{constructor(){var o;super();this.onButtonContainerClickHandler=this.onButtonContainerClick.bind(this);let t=this.attachShadow({mode:"open"});t.append(i.createStyleElement().cloneNode(true));let e=document.createElement("div");e.id="root",e.innerHTML=html`
      <div class="button-container">
        <slot></slot>
      </div>
      <${CardList.tag}></${CardList.tag}>
    `,t.append(e),this.buttonsContainer=(o=this.shadowRoot)==null?void 0:o.querySelector(".button-container");}get cardsList(){return this.shadowRoot.querySelector(CardList.tag)}get cards(){return Array.from(this.cardsList.querySelectorAll(Card.tag))}get buttonSidePositionIfLandscape(){return this.hasAttribute("button-side-position-landscape")}set buttonSidePositionIfLandscape(t){t?this.setAttribute("button-side-position-landscape",""):this.removeAttribute("button-side-position-landscape");}static create(){return document.createElement(i.tag)}static register(){for(let t of i.deps)t.register();defineCustomElements({[i.tag]:i});}static createStyleElement(){return css`:host #root{align-items:center;display:flex;flex-direction:column;gap:.5rem;height:100%}.button-container{align-items:center;display:flex;flex-direction:row;gap:.5rem;justify-content:space-between;width:100%}.button-container ::slotted(:last-child){margin-left:auto}@media (orientation:landscape){:host([button-side-position-landscape]) .button-container ::slotted(:first-child){position:absolute;transform:translate(-45px,50px);transition:transform .3s ease-in-out}:host(:not([button-side-position-landscape])) .button-container ::slotted(:first-child){position:absolute;transform:translate(0);transition:transform .3s ease-in-out}}`}connectedCallback(){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector(".button-container");t&&t.addEventListener("click",this.onButtonContainerClickHandler);}disconnectedCallback(){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector(".button-container");t&&t.removeEventListener("click",this.onButtonContainerClickHandler);}onButtonContainerClick(t){this.dispatchEvent(new CustomEvent("on-button-container-click",{detail:{event:t}}));}collapse(){return this.cardsList.collapse()}focusCard(t){for(let e of this.cards)e!==t&&(e.style.opacity="0");}unfocusCard(t){for(let e of this.cards)e!==t&&(e.style.opacity="unset");}isCollapsed(){return this.cardsList.collapsed}expand(){return this.cardsList.expand()}toggle(){this.cardsList.collapsed?this.expand():this.collapse();}renderCards(t){this.cardsList.clearCards(),this.cardsList.renderCards(t);}async unshiftCard(t){return this.cardsList.unshift(t)}getCardBySelector(t){return this.cardsList.querySelector(t)}updateHeight(t){var o,s;let e=(s=(o=this.buttonsContainer)==null?void 0:o.clientHeight)!=null?s:0;this.cardsList.style.setProperty("--list-height",`${t}px`),this.cardsList.style.setProperty("--top-offset",`calc(${e===0?32:e}px + 5rem)`);}};i.deps=[CardList,Card,a],i.tag="scandit-label-card-list-container";var c=i;export{b as a,c as b};