{"version":3,"sources":["jsdelivr-header.js","/npm/react-native-css-vh-vw@1.0.5/src/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNS,eAAkB,eAE3B,OAAO,QAAU,CAOf,GAAK,IACH,MAAM,EAAiB,WAAW,IAAI,UAAU,OAC1C,EAAuB,IAAb,EAWhB,OAVA,EAAa,SAAS,EAAY,KAGjB,IACf,EAAa,KAEX,EAAa,MACf,EAAa,KAGR,KAAK,MAAM,EAAiB,EAAQ,EAQ7C,GAAK,IACH,MAAM,EAAgB,WAAW,IAAI,UAAU,MACzC,EAAuB,IAAb,EAWhB,OAVA,EAAa,SAAS,EAAY,KAGjB,IACf,EAAa,KAEX,EAAa,MACf,EAAa,KAGR,KAAK,MAAM,EAAgB,EAAQ","file":"/npm/react-native-css-vh-vw@1.0.5/src/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-native-css-vh-vw@1.0.5/src/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { Dimensions } from 'react-native';\n\nmodule.exports = {\n  /**\n   * CSS vh ditto. Returns in pixels a fraction of the viewport height.\n   * \n   * @param {Number} percentage\n   * @return {Number} percentage of the window view height in value of pixels.\n  */\n  vh: (percentage) => {\n    const viewportHeight = Dimensions.get('window').height;\n    const decimal = percentage * .01;\n    percentage = parseInt(percentage, 10);\n\n    // Hard limits\n    if (percentage < 0) {\n      percentage = 100;\n    }\n    if (percentage > 1000) {\n      percentage = 1000;\n    }\n\n    return Math.round(viewportHeight * decimal);\n  },\n  /**\n   * CSS vw ditto. Returns in pixels a fraction of the viewport width.\n   * \n   * @param {Number} percentage\n   * @return {Number} percentage of the window view width in value of pixels.\n  */\n  vw: (percentage) => {\n    const viewportWidth = Dimensions.get('window').width;\n    const decimal = percentage * .01;\n    percentage = parseInt(percentage, 10);\n\n    // Hard limits\n    if (percentage < 0) {\n      percentage = 100;\n    }\n    if (percentage > 1000) {\n      percentage = 1000;\n    }\n\n    return Math.round(viewportWidth * decimal);\n  }\n}"]}