import{h,Fragment}from"@stencil/core";export class ScBreadcrumbs{constructor(){this.label="Breadcrumb"}getSeparator(){const e=this.el.shadowRoot.querySelector("slot[name=separator]").assignedElements({flatten:!0})[0].cloneNode(!0);return[e,...e.querySelectorAll("[id]")].forEach((e=>e.removeAttribute("id"))),e.slot="separator",e}handleSlotChange(){const e=this.el.shadowRoot.querySelector(".breadcrumb slot").assignedElements().filter((e=>"CE-BREADCRUMB"===e.nodeName));e.forEach(((t,r)=>{null===t.querySelector('[slot="separator"]')&&t.append(this.getSeparator()),r===e.length-1?t.setAttribute("aria-current","page"):t.removeAttribute("aria-current")}))}render(){return h(Fragment,{key:"efed488a3a1f00f843df51343dec5bdee12398fe"},h("nav",{key:"54c3edca833b1b9f629a950b1868807acd36c583",part:"base",class:"breadcrumb","aria-label":this.label},h("slot",{key:"5bd5c9879c27cad98c57458923be5df1c825c05a",onSlotchange:()=>this.handleSlotChange()})),h("div",{key:"3fcdf2ac4a9dde993118ffadbfe06a7390f59820",part:"separator",hidden:!0,"aria-hidden":"true"},h("slot",{key:"48f7a92d1a58d4c61de3ac3c21d51ce4c9653afa",name:"separator"},h("sc-icon",{key:"ef3e0fe72189e8bc6a06a81c5be9864b2945fc1d",name:"chevron-right"}))))}static get is(){return"sc-breadcrumbs"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-breadcrumbs.css"]}}static get styleUrls(){return{$:["sc-breadcrumbs.css"]}}static get properties(){return{label:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"The label to use for the breadcrumb control. This will not be shown, but it will be announced by screen readers and\nother assistive devices."},attribute:"label",reflect:!1,defaultValue:"'Breadcrumb'"}}}static get elementRef(){return"el"}}