{"version":3,"sources":["./node_modules/@ionic/core/dist/esm/focus-visible-f4ad4f1a.js"],"names":["ION_FOCUSED","FOCUS_KEYS","startFocusVisible","currentFocus","keyboardMode","doc","document","setFocus","elements","forEach","el","classList","remove","add","pointerDown","addEventListener","ev","includes","key","composedPath","toFocus","filter","contains","activeElement","body"],"mappings":"4FAAA,6DAAMA,EAAc,cAEdC,EAAa,CAAC,MAAO,YAAa,QAAS,SAAU,IAAK,QAAS,QAAS,YAAa,aAAc,WACvGC,EAAoB,KACxB,IAAIC,EAAe,GACfC,GAAe,EACnB,MAAMC,EAAMC,SACNC,EAAYC,IAChBL,EAAaM,QAAQC,GAAMA,EAAGC,UAAUC,OAAOZ,IAC/CQ,EAASC,QAAQC,GAAMA,EAAGC,UAAUE,IAAIb,IACxCG,EAAeK,GAEXM,EAAc,KAClBV,GAAe,EACfG,EAAS,KAEXF,EAAIU,iBAAiB,UAAWC,IAC9BZ,EAAeH,EAAWgB,SAASD,EAAGE,KACjCd,GACHG,EAAS,MAGbF,EAAIU,iBAAiB,UAAWC,IAC9B,GAAIZ,GAAgBY,EAAGG,aAAc,CACnC,MAAMC,EAAUJ,EAAGG,eAAeE,OAAQX,KACpCA,EAAGC,WACED,EAAGC,UAAUW,SAzBR,kBA6BhBf,EAASa,MAGbf,EAAIU,iBAAiB,WAAY,KAC3BV,EAAIkB,gBAAkBlB,EAAImB,MAC5BjB,EAAS,MAGbF,EAAIU,iBAAiB,aAAcD,GACnCT,EAAIU,iBAAiB,YAAaD","file":"15.2ca6c640f872c2796234.js","sourcesContent":["const ION_FOCUSED = 'ion-focused';\nconst ION_FOCUSABLE = 'ion-focusable';\nconst FOCUS_KEYS = ['Tab', 'ArrowDown', 'Space', 'Escape', ' ', 'Shift', 'Enter', 'ArrowLeft', 'ArrowRight', 'ArrowUp'];\nconst startFocusVisible = () => {\n let currentFocus = [];\n let keyboardMode = true;\n const doc = document;\n const setFocus = (elements) => {\n currentFocus.forEach(el => el.classList.remove(ION_FOCUSED));\n elements.forEach(el => el.classList.add(ION_FOCUSED));\n currentFocus = elements;\n };\n const pointerDown = () => {\n keyboardMode = false;\n setFocus([]);\n };\n doc.addEventListener('keydown', ev => {\n keyboardMode = FOCUS_KEYS.includes(ev.key);\n if (!keyboardMode) {\n setFocus([]);\n }\n });\n doc.addEventListener('focusin', ev => {\n if (keyboardMode && ev.composedPath) {\n const toFocus = ev.composedPath().filter((el) => {\n if (el.classList) {\n return el.classList.contains(ION_FOCUSABLE);\n }\n return false;\n });\n setFocus(toFocus);\n }\n });\n doc.addEventListener('focusout', () => {\n if (doc.activeElement === doc.body) {\n setFocus([]);\n }\n });\n doc.addEventListener('touchstart', pointerDown);\n doc.addEventListener('mousedown', pointerDown);\n};\n\nexport { startFocusVisible };\n"],"sourceRoot":"webpack:///"}