/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
import{w as o,d as i}from"./p-COLHV2ym.js";import{e as r}from"./p-C8IsBmNU.js";import{K as e,a as l}from"./p-B-D7Cfki.js";const n=o=>{if(void 0===i||o===l.None||void 0===o)return null;const e=r.get("appRootSelector","ion-app"),n=i.querySelector(e);return null!=n?n:i.body},s=o=>{const i=n(o);return null===i?0:i.clientHeight},t=async i=>{let r,l,t,a;const d=async()=>{const i=await e.getResizeMode(),n=void 0===i?void 0:i.mode;r=()=>{void 0===a&&(a=s(n)),t=!0,u(t,n)},l=()=>{t=!1,u(t,n)},null==o||o.addEventListener("keyboardWillShow",r),null==o||o.addEventListener("keyboardWillHide",l)},u=(o,r)=>{i&&i(o,c(r))},c=o=>{if(0===a||a===s(o))return;const i=n(o);return null!==i?new Promise((o=>{const r=new ResizeObserver((()=>{i.clientHeight===a&&(r.disconnect(),o())}));r.observe(i)})):void 0};return await d(),{init:d,destroy:()=>{null==o||o.removeEventListener("keyboardWillShow",r),null==o||o.removeEventListener("keyboardWillHide",l),r=l=void 0},isKeyboardVisible:()=>t}};export{t as c}