{"version":3,"file":"FocusGuard.js","names":[],"sources":["esm/FocusGuard.js"],"sourcesContent":["import * as React from \"react\";\nlet count = 0;\nfunction FocusGuards(props) {\n  useFocusGuards();\n  return props.children;\n}\nfunction useFocusGuards() {\n  React.useEffect(() => {\n    const edgeGuards = document.querySelectorAll(\"[data-tamagui-focus-guard]\");\n    document.body.insertAdjacentElement(\"afterbegin\", edgeGuards[0] ?? createFocusGuard());\n    document.body.insertAdjacentElement(\"beforeend\", edgeGuards[1] ?? createFocusGuard());\n    count++;\n    return () => {\n      if (count === 1) {\n        document.querySelectorAll(\"[data-tamagui-focus-guard]\").forEach((node) => node.remove());\n      }\n      count--;\n    };\n  }, []);\n}\nfunction createFocusGuard() {\n  const element = document.createElement(\"span\");\n  element.setAttribute(\"data-tamagui-focus-guard\", \"\");\n  element.tabIndex = 0;\n  element.style.cssText = \"outline: none; opacity: 0; position: fixed; pointer-events: none\";\n  return element;\n}\nconst Root = FocusGuards;\nexport {\n  FocusGuards,\n  Root,\n  useFocusGuards\n};\n//# sourceMappingURL=FocusGuard.js.map\n"],"mappings":";;;AACA,IAAI,QAAQ;AACZ,SAAS,YAAY,OAAO;CAC1B,eAAe;CACf,OAAO,MAAM;AACf;AACA,SAAS,iBAAiB;CACxB,MAAM,gBAAgB;EACpB,MAAM,aAAa,SAAS,iBAAiB,4BAA4B;EACzE,SAAS,KAAK,sBAAsB,cAAc,WAAW,MAAM,iBAAiB,CAAC;EACrF,SAAS,KAAK,sBAAsB,aAAa,WAAW,MAAM,iBAAiB,CAAC;EACpF;EACA,aAAa;GACX,IAAI,UAAU,GAAG;IACf,SAAS,iBAAiB,4BAA4B,CAAC,CAAC,SAAS,SAAS,KAAK,OAAO,CAAC;GACzF;GACA;EACF;CACF,GAAG,CAAC,CAAC;AACP;AACA,SAAS,mBAAmB;CAC1B,MAAM,UAAU,SAAS,cAAc,MAAM;CAC7C,QAAQ,aAAa,4BAA4B,EAAE;CACnD,QAAQ,WAAW;CACnB,QAAQ,MAAM,UAAU;CACxB,OAAO;AACT;AACA,MAAM,OAAO"}