{"version":3,"file":"useFocusGuards-D8NatX5Y.js","sources":["../../node_modules/reka-ui/dist/shared/useFocusGuards.js"],"sourcesContent":["import { isClient } from '@vueuse/shared';\nimport { watchEffect } from 'vue';\n\nlet count = 0;\nfunction useFocusGuards() {\n watchEffect((cleanupFn) => {\n if (!isClient)\n return;\n const edgeGuards = document.querySelectorAll(\"[data-reka-focus-guard]\");\n document.body.insertAdjacentElement(\n \"afterbegin\",\n edgeGuards[0] ?? createFocusGuard()\n );\n document.body.insertAdjacentElement(\n \"beforeend\",\n edgeGuards[1] ?? createFocusGuard()\n );\n count++;\n cleanupFn(() => {\n if (count === 1) {\n document.querySelectorAll(\"[data-reka-focus-guard]\").forEach((node) => node.remove());\n }\n count--;\n });\n });\n}\nfunction createFocusGuard() {\n const element = document.createElement(\"span\");\n element.setAttribute(\"data-reka-focus-guard\", \"\");\n element.tabIndex = 0;\n element.style.outline = \"none\";\n element.style.opacity = \"0\";\n element.style.position = \"fixed\";\n element.style.pointerEvents = \"none\";\n return element;\n}\n\nexport { useFocusGuards as u };\n//# sourceMappingURL=useFocusGuards.js.map\n"],"names":["count","useFocusGuards","watchEffect","cleanupFn","isClient","edgeGuards","createFocusGuard","node","element"],"mappings":"gDAGA,IAAIA,EAAQ,EACZ,SAASC,GAAiB,CACxBC,EAAaC,GAAc,CACzB,GAAI,CAACC,EACH,OACF,MAAMC,EAAa,SAAS,iBAAiB,yBAAyB,EACtE,SAAS,KAAK,sBACZ,aACAA,EAAW,CAAC,GAAKC,EAAgB,CAClC,EACD,SAAS,KAAK,sBACZ,YACAD,EAAW,CAAC,GAAKC,EAAgB,CAClC,EACDN,IACAG,EAAU,IAAM,CACVH,IAAU,GACZ,SAAS,iBAAiB,yBAAyB,EAAE,QAASO,GAASA,EAAK,QAAQ,EAEtFP,GACN,CAAK,CACL,CAAG,CACH,CACA,SAASM,GAAmB,CAC1B,MAAME,EAAU,SAAS,cAAc,MAAM,EAC7C,OAAAA,EAAQ,aAAa,wBAAyB,EAAE,EAChDA,EAAQ,SAAW,EACnBA,EAAQ,MAAM,QAAU,OACxBA,EAAQ,MAAM,QAAU,IACxBA,EAAQ,MAAM,SAAW,QACzBA,EAAQ,MAAM,cAAgB,OACvBA,CACT","x_google_ignoreList":[0]}