/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
import{K as e}from"./p-B-D7Cfki.js";import"./p-of4jy1ch.js";import"./p-COLHV2ym.js";import"./p-C8IsBmNU.js";const o="ionKeyboardDidShow",t="ionKeyboardDidHide";let i={},s={},d=!1;const p=()=>{i={},s={},d=!1},r=o=>{if(e.getEngine())a(o);else{if(!o.visualViewport)return;s=w(o.visualViewport),o.visualViewport.onresize=()=>{j(o),h()||m(o)?f(o):c(o)&&n(o)}}},a=e=>{e.addEventListener("keyboardDidShow",(o=>f(e,o))),e.addEventListener("keyboardDidHide",(()=>n(e)))},f=(e,o)=>{y(e,o),d=!0},n=e=>{b(e),d=!1},h=()=>!d&&i.width===s.width&&(i.height-s.height)*s.scale>150,m=e=>d&&!c(e),c=e=>d&&s.height===e.innerHeight,y=(e,t)=>{const i=new CustomEvent(o,{detail:{keyboardHeight:t?t.keyboardHeight:e.innerHeight-s.height}});e.dispatchEvent(i)},b=e=>{const o=new CustomEvent(t);e.dispatchEvent(o)},j=e=>{i=Object.assign({},s),s=w(e.visualViewport)},w=e=>({width:Math.round(e.width),height:Math.round(e.height),offsetTop:e.offsetTop,offsetLeft:e.offsetLeft,pageTop:e.pageTop,pageLeft:e.pageLeft,scale:e.scale});export{t as KEYBOARD_DID_CLOSE,o as KEYBOARD_DID_OPEN,w as copyVisualViewport,c as keyboardDidClose,h as keyboardDidOpen,m as keyboardDidResize,p as resetKeyboardAssist,n as setKeyboardClose,f as setKeyboardOpen,r as startKeyboardAssist,j as trackViewportChanges}