{"ast":null,"code":"import * as React from 'react';\nimport { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';\nimport View from \"../View\";\nimport StyleSheet from \"../StyleSheet\";\nvar ModalContent = React.forwardRef(function (props, forwardedRef) {\n  var active = props.active,\n      children = props.children,\n      onRequestClose = props.onRequestClose,\n      transparent = props.transparent;\n  React.useEffect(function () {\n    if (canUseDOM) {\n      var closeOnEscape = function closeOnEscape(e) {\n        if (active && e.key === 'Escape') {\n          e.stopPropagation();\n\n          if (onRequestClose) {\n            onRequestClose();\n          }\n        }\n      };\n\n      document.addEventListener('keyup', closeOnEscape, false);\n      return function () {\n        return document.removeEventListener('keyup', closeOnEscape, false);\n      };\n    }\n  }, [active, onRequestClose]);\n  var style = React.useMemo(function () {\n    return [styles.modal, transparent ? styles.modalTransparent : styles.modalOpaque];\n  }, [transparent]);\n  return React.createElement(View, {\n    accessibilityRole: active ? 'dialog' : null,\n    \"aria-modal\": true,\n    ref: forwardedRef,\n    style: style\n  }, React.createElement(View, {\n    style: styles.container\n  }, children));\n});\nvar styles = StyleSheet.create({\n  modal: {\n    position: 'fixed',\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0\n  },\n  modalTransparent: {\n    backgroundColor: 'transparent'\n  },\n  modalOpaque: {\n    backgroundColor: 'white'\n  },\n  container: {\n    top: 0,\n    flex: 1\n  }\n});\nexport default ModalContent;","map":{"version":3,"sources":["/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/node_modules/react-native-web/dist/exports/Modal/ModalContent.js"],"names":["React","canUseDOM","View","StyleSheet","ModalContent","forwardRef","props","forwardedRef","active","children","onRequestClose","transparent","useEffect","closeOnEscape","e","key","stopPropagation","document","addEventListener","removeEventListener","style","useMemo","styles","modal","modalTransparent","modalOpaque","createElement","accessibilityRole","ref","container","create","position","top","right","bottom","left","backgroundColor","flex"],"mappings":"AASA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,SAAT,QAA0B,+BAA1B;AACA,O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B,YAHuC;AAI5Ca,IAAAA,KAAK,EAAEA;AAJqC,GAA1B,EAKJpB,KAAK,CAAC0B,aAAN,CAAoBxB,IAApB,EAA0B;AACxCkB,IAAAA,KAAK,EAAEE,MAAM,CAACO;AAD0B,GAA1B,EAEbpB,QAFa,CALI,CAApB;AAQD,CAlC+B,CAAhC;AAmCA,IAAIa,MAAM,GAAGnB,UAAU,CAAC2B,MAAX,CAAkB;AAC7BP,EAAAA,KAAK,EAAE;AACLQ,IAAAA,QAAQ,EAAE,OADL;AAELC,IAAAA,GAAG,EAAE,CAFA;AAGLC,IAAAA,KAAK,EAAE,CAHF;AAILC,IAAAA,MAAM,EAAE,CAJH;AAKLC,IAAAA,IAAI,EAAE;AALD,GADsB;AAQ7BX,EAAAA,gBAAgB,EAAE;AAChBY,IAAAA,eAAe,EAAE;AADD,GARW;AAW7BX,EAAAA,WAAW,EAAE;AACXW,IAAAA,eAAe,EAAE;AADN,GAXgB;AAc7BP,EAAAA,SAAS,EAAE;AACTG,IAAAA,GAAG,EAAE,CADI;AAETK,IAAAA,IAAI,EAAE;AAFG;AAdkB,CAAlB,CAAb;AAmBA,eAAejC,YAAf","sourcesContent":["/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport * as React from 'react';\nimport { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';\nimport View from '../View';\nimport StyleSheet from '../StyleSheet';\nvar ModalContent = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {\n  var active = props.active,\n      children = props.children,\n      onRequestClose = props.onRequestClose,\n      transparent = props.transparent;\n  React.useEffect(function () {\n    if (canUseDOM) {\n      var closeOnEscape = function closeOnEscape(e) {\n        if (active && e.key === 'Escape') {\n          e.stopPropagation();\n\n          if (onRequestClose) {\n            onRequestClose();\n          }\n        }\n      };\n\n      document.addEventListener('keyup', closeOnEscape, false);\n      return function () {\n        return document.removeEventListener('keyup', closeOnEscape, false);\n      };\n    }\n  }, [active, onRequestClose]);\n  var style = React.useMemo(function () {\n    return [styles.modal, transparent ? styles.modalTransparent : styles.modalOpaque];\n  }, [transparent]);\n  return /*#__PURE__*/React.createElement(View, {\n    accessibilityRole: active ? 'dialog' : null,\n    \"aria-modal\": true,\n    ref: forwardedRef,\n    style: style\n  }, /*#__PURE__*/React.createElement(View, {\n    style: styles.container\n  }, children));\n});\nvar styles = StyleSheet.create({\n  modal: {\n    position: 'fixed',\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0\n  },\n  modalTransparent: {\n    backgroundColor: 'transparent'\n  },\n  modalOpaque: {\n    backgroundColor: 'white'\n  },\n  container: {\n    top: 0,\n    flex: 1\n  }\n});\nexport default ModalContent;"]},"metadata":{},"sourceType":"module"}