{"ast":null,"code":"import { useTransform } from './use-transform.mjs';\nimport { invariant, warning } from '../utils/errors.mjs';\nimport { useMotionValue } from './use-motion-value.mjs';\nimport { MotionContext } from '../context/MotionContext/index.mjs';\nimport { useContext } from 'react';\n\n// Keep things reasonable and avoid scale: Infinity. In practise we might need\n// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]\n// to simply hide content at unreasonable scales.\nconst maxScale = 100000;\nconst invertScale = scale => scale > 0.001 ? 1 / scale : maxScale;\nlet hasWarned = false;\n/**\n * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse\n * of their respective parent scales.\n *\n * This is useful for undoing the distortion of content when scaling a parent component.\n *\n * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent.\n * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output\n * of those instead.\n *\n * ```jsx\n * const MyComponent = () => {\n *   const { scaleX, scaleY } = useInvertedScale()\n *   return <motion.div style={{ scaleX, scaleY }} />\n * }\n * ```\n *\n * @deprecated\n */\nfunction useInvertedScale(scale) {\n  let parentScaleX = useMotionValue(1);\n  let parentScaleY = useMotionValue(1);\n  const {\n    visualElement\n  } = useContext(MotionContext);\n  invariant(!!(scale || visualElement), \"If no scale values are provided, useInvertedScale must be used within a child of another motion component.\");\n  warning(hasWarned, \"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead.\");\n  hasWarned = true;\n  if (scale) {\n    parentScaleX = scale.scaleX || parentScaleX;\n    parentScaleY = scale.scaleY || parentScaleY;\n  } else if (visualElement) {\n    parentScaleX = visualElement.getValue(\"scaleX\", 1);\n    parentScaleY = visualElement.getValue(\"scaleY\", 1);\n  }\n  const scaleX = useTransform(parentScaleX, invertScale);\n  const scaleY = useTransform(parentScaleY, invertScale);\n  return {\n    scaleX,\n    scaleY\n  };\n}\nexport { invertScale, useInvertedScale };","map":{"version":3,"names":["useTransform","invariant","warning","useMotionValue","MotionContext","useContext","maxScale","invertScale","scale","hasWarned","useInvertedScale","parentScaleX","parentScaleY","visualElement","scaleX","scaleY","getValue"],"sources":["/opt/bitnami/minigames/frasle/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs"],"sourcesContent":["import { useTransform } from './use-transform.mjs';\nimport { invariant, warning } from '../utils/errors.mjs';\nimport { useMotionValue } from './use-motion-value.mjs';\nimport { MotionContext } from '../context/MotionContext/index.mjs';\nimport { useContext } from 'react';\n\n// Keep things reasonable and avoid scale: Infinity. In practise we might need\n// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]\n// to simply hide content at unreasonable scales.\nconst maxScale = 100000;\nconst invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale;\nlet hasWarned = false;\n/**\n * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse\n * of their respective parent scales.\n *\n * This is useful for undoing the distortion of content when scaling a parent component.\n *\n * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent.\n * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output\n * of those instead.\n *\n * ```jsx\n * const MyComponent = () => {\n *   const { scaleX, scaleY } = useInvertedScale()\n *   return <motion.div style={{ scaleX, scaleY }} />\n * }\n * ```\n *\n * @deprecated\n */\nfunction useInvertedScale(scale) {\n    let parentScaleX = useMotionValue(1);\n    let parentScaleY = useMotionValue(1);\n    const { visualElement } = useContext(MotionContext);\n    invariant(!!(scale || visualElement), \"If no scale values are provided, useInvertedScale must be used within a child of another motion component.\");\n    warning(hasWarned, \"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead.\");\n    hasWarned = true;\n    if (scale) {\n        parentScaleX = scale.scaleX || parentScaleX;\n        parentScaleY = scale.scaleY || parentScaleY;\n    }\n    else if (visualElement) {\n        parentScaleX = visualElement.getValue(\"scaleX\", 1);\n        parentScaleY = visualElement.getValue(\"scaleY\", 1);\n    }\n    const scaleX = useTransform(parentScaleX, invertScale);\n    const scaleY = useTransform(parentScaleY,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