import{h}from"@stencil/core";import{isRtl}from"../../../functions/page-align";export class ScStackedListRow{constructor(){this.href=void 0,this.target="_self",this.mobileSize=600,this.width=void 0,this.hasPrefix=!1,this.hasSuffix=!1}componentDidLoad(){"ResizeObserver"in window&&new window.ResizeObserver((e=>{e.forEach((e=>{this.width=e.contentRect.width}))})).observe(this.el)}handleSlotChange(){this.hasPrefix=!!Array.from(this.el.children).some((e=>"prefix"===e.slot)),this.hasSuffix=!!Array.from(this.el.children).some((e=>"suffix"===e.slot))}render(){const e=this.href?"a":"div";return h(e,{key:"a29c6848cd4263d25cd5a80c0d4ac68110fa6552",href:this.href,target:this.target,part:"base",class:{"list-row":!0,"list-row--has-prefix":this.hasPrefix,"list-row--has-suffix":this.hasSuffix,"breakpoint-lg":this.width>=this.mobileSize,"list-row--is-rtl":isRtl()}},h("span",{key:"cd57cf1db635599185f3e5aa639bf7cb6c843b20",class:"list-row__prefix"},h("slot",{key:"26191fe44d914e803be6ccb9db29388145d9923f",name:"prefix",onSlotchange:()=>this.handleSlotChange()})),h("slot",{key:"db6347a154d549a4f763d3de1fc71dd5db60adfd",onSlotchange:()=>this.handleSlotChange()}),h("span",{key:"47767c55c5565ad31eb23a4e61affd76419c4633",class:"list-row__suffix"},h("slot",{key:"4d691811eaf61b1837ada49dd9afd38f7b30146d",name:"suffix",onSlotchange:()=>this.handleSlotChange()})))}static get is(){return"sc-stacked-list-row"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-stacked-list-row.scss"]}}static get styleUrls(){return{$:["sc-stacked-list-row.css"]}}static get properties(){return{href:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"href",reflect:!1},target:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"target",reflect:!1,defaultValue:"'_self'"},mobileSize:{type:"number",mutable:!1,complexType:{original:"number",resolved:"number",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"mobile-size",reflect:!1,defaultValue:"600"}}}static get states(){return{width:{},hasPrefix:{},hasSuffix:{}}}static get elementRef(){return"el"}}