/*!
 * Custom elements for Nanopore-Digital Web applications
 */
import{r as t,g as e,a as s}from"./index-BM3Om9WE.js";import{h as n}from"./renderer-DpNDfhNy.js";const o=class{constructor(e){t(this,e)}get host(){return e(this)}show=!1;childrenSelector;maxToShow=3;noHideBtn=!1;get children(){let t;return t=this.childrenSelector?this.host.querySelectorAll(this.childrenSelector):this.host.children,Array.from(t).filter((t=>!t.hasAttribute("slot")))}handleShowHideElements(){this.children.forEach(((t,e)=>{this.show?"none"===t.style.display&&(t.style.display=""):t.style.display=e>=this.maxToShow?"none":""}))}handleClick(t){this.show=!this.show}connectedCallback(){this.handleShowHideElements()}render(){return n(s,{key:"b129148afdc959f912a16d1e2642c3e920a0a381",class:"nano-more-less"},n("slot",{key:"92aa96b6301d14f7b4d9aee9cc4cafbf0ff75431",onSlotchange:()=>this.handleShowHideElements()}),this.children?.length>this.maxToShow&&[n("div",{key:"73a5c457e8243cd8cf8e8ec1e681aa2c62244936",style:{display:this.show?"none":"contents"},class:"button-wrapper",part:"button-wrapper button-wrapper--less",onClick:t=>this.handleClick(t)},n("slot",{key:"48802275120ff78676a19b25f792806dd03db2c1",name:"less"},n("button",{key:"703d054e4560cf22d571a29838dfbd649062f7ca",part:"button button--less"},"Show more (+",this.children.length-this.maxToShow,")"))),this.noHideBtn?"":n("div",{style:{display:this.show?"contents":"none"},class:"button-wrapper",part:"button-wrapper button-wrapper--more",onClick:t=>this.handleClick(t)},n("slot",{name:"more"},n("button",{part:"button button--more"},"Show less (-",this.children.length-this.maxToShow,")")))])}static get watchers(){return{maxToShow:["handleShowHideElements"],show:["handleShowHideElements"],childrenSelector:["handleShowHideElements"]}}};o.style=":host { display: contents; }";export{o as nano_more_less}