{"version":3,"sources":["../node_modules/@ionic/core/dist/esm-es5/index-120c8c20.js"],"names":["KEYBOARD_DID_OPEN","KEYBOARD_DID_CLOSE","previousVisualViewport","currentVisualViewport","previousLayoutViewport","currentLayoutViewport","keyboardOpen","resetKeyboardAssist","startKeyboardAssist","win","startNativeListeners","visualViewport","copyVisualViewport","copyLayoutViewport","onresize","trackViewportChanges","keyboardDidOpen","keyboardDidResize","setKeyboardOpen","keyboardDidClose","setKeyboardClose","addEventListener","ev","fireKeyboardOpenEvent","fireKeyboardCloseEvent","scaledHeightDifference","height","scale","width","layoutViewportDidChange","innerHeight","nativeEv","keyboardHeight","CustomEvent","detail","dispatchEvent","Object","assign","Math","round","offsetTop","offsetLeft","pageTop","pageLeft","innerWidth"],"mappings":"wGAAA,umBAAIA,EAAoB,qBACpBC,EAAqB,qBAErBC,EAAyB,GACzBC,EAAwB,GACxBC,EAAyB,GACzBC,EAAwB,GACxBC,GAAe,EAIfC,EAAsB,WACtBL,EAAyB,GACzBC,EAAwB,GACxBC,EAAyB,GACzBC,EAAwB,GACxBC,GAAe,GAEfE,EAAsB,SAAUC,GAChCC,EAAqBD,GAChBA,EAAIE,iBAGTR,EAAwBS,EAAmBH,EAAIE,gBAC/CN,EAAwBQ,EAAmBJ,GAC3CA,EAAIE,eAAeG,SAAW,WAC1BC,EAAqBN,GACjBO,KAAqBC,EAAkBR,GACvCS,EAAgBT,GAEXU,EAAiBV,IACtBW,EAAiBX,MASzBC,EAAuB,SAAUD,GACjCA,EAAIY,iBAAiB,mBAAmB,SAAUC,GAAM,OAAOJ,EAAgBT,EAAKa,MACpFb,EAAIY,iBAAiB,mBAAmB,WAAc,OAAOD,EAAiBX,OAE9ES,EAAkB,SAAUT,EAAKa,GACjCC,EAAsBd,EAAKa,GAC3BhB,GAAe,GAEfc,EAAmB,SAAUX,GAC7Be,EAAuBf,GACvBH,GAAe,GAcfU,EAAkB,WAClB,IAAIS,GAA0BvB,EAAuBwB,OAASvB,EAAsBuB,QAAU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ar currentVisualViewport = {};\nvar previousLayoutViewport = {};\nvar currentLayoutViewport = {};\nvar keyboardOpen = false;\n/**\n * This is only used for tests\n */\nvar resetKeyboardAssist = function () {\n previousVisualViewport = {};\n currentVisualViewport = {};\n previousLayoutViewport = {};\n currentLayoutViewport = {};\n keyboardOpen = false;\n};\nvar startKeyboardAssist = function (win) {\n startNativeListeners(win);\n if (!win.visualViewport) {\n return;\n }\n currentVisualViewport = copyVisualViewport(win.visualViewport);\n currentLayoutViewport = copyLayoutViewport(win);\n win.visualViewport.onresize = function () {\n trackViewportChanges(win);\n if (keyboardDidOpen() || keyboardDidResize(win)) {\n setKeyboardOpen(win);\n }\n else if (keyboardDidClose(win)) {\n setKeyboardClose(win);\n }\n };\n};\n/**\n * Listen for events fired by native keyboard plugin\n * in Capacitor/Cordova so devs only need to listen\n * in one place.\n */\nvar startNativeListeners = function (win) {\n win.addEventListener('keyboardDidShow', function (ev) { return setKeyboardOpen(win, ev); });\n win.addEventListener('keyboardDidHide', function () { return setKeyboardClose(win); });\n};\nvar setKeyboardOpen = function (win, ev) {\n fireKeyboardOpenEvent(win, ev);\n keyboardOpen = true;\n};\nvar setKeyboardClose = function (win) {\n fireKeyboardCloseEvent(win);\n keyboardOpen = false;\n};\n/**\n * Returns `true` if the `keyboardOpen` flag is not\n * set, the previous visual viewport width equal the current\n * visual viewport width, and if the scaled difference\n * of the previous visual viewport height minus the current\n * visual viewport height is greater than KEYBOARD_THRESHOLD\n *\n * We need to be able to accomodate users who have zooming\n * enabled in their browser (or have zoomed in manually) which\n * is why we take into account the current visual viewport's\n * scale value.\n */\nvar keyboardDidOpen = function () {\n var scaledHeightDifference = (previousVisualViewport.height - currentVisualViewport.height) * currentVisualViewport.scale;\n return (!keyboardOpen &&\n previousVisualViewport.width === currentVisualViewport.width &&\n scaledHeightDifference > KEYBOARD_THRESHOLD &&\n !layoutViewportDidChange());\n};\n/**\n * Returns `true` if the keyboard is open,\n * but the keyboard did not close\n */\nvar keyboardDidResize = function (win) {\n return keyboardOpen && !keyboardDidClose(win);\n};\n/**\n * Determine if the keyboard was closed\n * Returns `true` if the `keyboardOpen` flag is set and\n * the current visual viewport height equals the\n * layout viewport height.\n */\nvar keyboardDidClose = function (win) {\n return keyboardOpen && currentVisualViewport.height === win.innerHeight;\n};\n/**\n * Determine if the layout viewport has\n * changed since the last visual viewport change.\n * It is rare that a layout viewport change is not\n * associated with a visual viewport change so we\n * want to make sure we don't get any false positives.\n */\nvar layoutViewportDidChange = function () {\n return (currentLayoutViewport.width !== previousLayoutViewport.width ||\n currentLayoutViewport.height !== previousLayoutViewport.height);\n};\n/**\n * Dispatch a keyboard open event\n */\nvar fireKeyboardOpenEvent = function (win, nativeEv) {\n var keyboardHeight = nativeEv ? nativeEv.keyboardHeight : win.innerHeight - currentVisualViewport.height;\n var ev = new CustomEvent(KEYBOARD_DID_OPEN, {\n detail: { keyboardHeight: keyboardHeight }\n });\n win.dispatchEvent(ev);\n};\n/**\n * Dispatch a keyboard close event\n */\nvar fireKeyboardCloseEvent = function (win) {\n var ev = new CustomEvent(KEYBOARD_DID_CLOSE);\n win.dispatchEvent(ev);\n};\n/**\n * Given a window object, create a copy of\n * the current visual and layout viewport states\n * while also preserving the previous visual and\n * layout viewport states\n */\nvar trackViewportChanges = function (win) {\n previousVisualViewport = Object.assign({}, currentVisualViewport);\n currentVisualViewport = copyVisualViewport(win.visualViewport);\n previousLayoutViewport = Object.assign({}, currentLayoutViewport);\n currentLayoutViewport = copyLayoutViewport(win);\n};\n/**\n * Creates a deep copy of the visual viewport\n * at a given state\n */\nvar copyVisualViewport = function (visualViewport) {\n return {\n width: Math.round(visualViewport.width),\n height: Math.round(visualViewport.height),\n offsetTop: visualViewport.offsetTop,\n offsetLeft: visualViewport.offsetLeft,\n pageTop: visualViewport.pageTop,\n pageLeft: visualViewport.pageLeft,\n scale: visualViewport.scale\n };\n};\n/**\n * Creates a deep copy of the layout viewport\n * at a given state\n */\nvar copyLayoutViewport = function (win) {\n return {\n width: win.innerWidth,\n height: win.innerHeight\n };\n};\nexport { KEYBOARD_DID_CLOSE, KEYBOARD_DID_OPEN, copyLayoutViewport, copyVisualViewport, keyboardDidClose, keyboardDidOpen, keyboardDidResize, resetKeyboardAssist, setKeyboardClose, setKeyboardOpen, startKeyboardAssist, trackViewportChanges };\n"],"sourceRoot":""}