/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
import{r as i,c as t,f as o,h as e,d as s,g as n}from"./p-C8IsBmNU.js";import{c as a}from"./p-W-2TssC9.js";const l="split-pane-main",r="split-pane-side",d={xs:"(min-width: 0px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",never:""},p=class{constructor(o){i(this,o),this.ionSplitPaneVisible=t(this,"ionSplitPaneVisible",7),this.visible=!1,this.disabled=!1,this.when=d.lg}visibleChanged(i){this.ionSplitPaneVisible.emit({visible:i})}async isVisible(){return Promise.resolve(this.visible)}async connectedCallback(){"undefined"!=typeof customElements&&null!=customElements&&await customElements.whenDefined("ion-split-pane"),this.styleMainElement(),this.updateState()}disconnectedCallback(){this.rmL&&(this.rmL(),this.rmL=void 0)}updateState(){if(this.rmL&&(this.rmL(),this.rmL=void 0),this.disabled)return void(this.visible=!1);const i=this.when;if("boolean"==typeof i)return void(this.visible=i);const t=d[i]||i;if(0===t.length)return void(this.visible=!1);const o=i=>{this.visible=i.matches},e=window.matchMedia(t);e.addListener(o),this.rmL=()=>e.removeListener(o),this.visible=e.matches}styleMainElement(){const i=this.contentId,t=this.el.children,e=this.el.childElementCount;let s=!1;for(let n=0;n<e;n++){const e=t[n],a=void 0!==i&&e.id===i;if(a){if(s)return void o("[ion-split-pane] - Cannot have more than one main node.");h(e,a),s=!0}}s||o("[ion-split-pane] - Does not have a specified main node.")}render(){const i=a(this);return e(s,{key:"9d0c67f1f81b09bb9a6f14a66053e5cc7431a286",class:{[i]:!0,[`split-pane-${i}`]:!0,"split-pane-visible":this.visible}},e("slot",{key:"ab7b3050d3c5484bd00949cf57efa4396b4d5bc3"}))}get el(){return n(this)}static get watchers(){return{visible:["visibleChanged"],disabled:["updateState"],when:["updateState"]}}},h=(i,t)=>{let o,e;t?(o=l,e=r):(o=r,e=l);const s=i.classList;s.add(o),s.remove(e)};p.style={ionic:":host{--side-width:100%;right:0;left:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;contain:strict}:host(.split-pane-visible) ::slotted(.split-pane-main){right:0;left:0;top:0;bottom:0;position:relative;-ms-flex:1;flex:1;-webkit-box-shadow:none;box-shadow:none;overflow:hidden;z-index:0}::slotted(.split-pane-side:not(ion-menu)){display:none}:host{--border:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));--side-min-width:270px;--side-max-width:28%}",ios:":host{--side-width:100%;right:0;left:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;contain:strict}:host(.split-pane-visible) ::slotted(.split-pane-main){right:0;left:0;top:0;bottom:0;position:relative;-ms-flex:1;flex:1;-webkit-box-shadow:none;box-shadow:none;overflow:hidden;z-index:0}::slotted(.split-pane-side:not(ion-menu)){display:none}:host{--border:0.55px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, var(--ion-background-color-step-250, #c8c7cc))));--side-min-width:270px;--side-max-width:28%}",md:":host{--side-width:100%;right:0;left:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;contain:strict}:host(.split-pane-visible) ::slotted(.split-pane-main){right:0;left:0;top:0;bottom:0;position:relative;-ms-flex:1;flex:1;-webkit-box-shadow:none;box-shadow:none;overflow:hidden;z-index:0}::slotted(.split-pane-side:not(ion-menu)){display:none}:host{--border:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));--side-min-width:270px;--side-max-width:28%}"};export{p as ion_split_pane}