{"ast":null,"code":"import { useTransform } from './use-transform.js';\nimport { invariant, warning } from 'hey-listen';\nimport { useMotionValue } from './use-motion-value.js';\nimport { useVisualElementContext } from '../context/MotionContext/index.js';\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.\nvar maxScale = 100000;\nvar invertScale = function invertScale(scale) {\n  return scale > 0.001 ? 1 / scale : maxScale;\n};\nvar 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 * @motion\n *\n * ```jsx\n * const MyComponent = () => {\n *   const { scaleX, scaleY } = useInvertedScale()\n *   return <motion.div style={{ scaleX, scaleY }} />\n * }\n * ```\n *\n * @library\n *\n * ```jsx\n * function MyComponent() {\n *   const { scaleX, scaleY } = useInvertedScale()\n *   return <Frame scaleX={scaleX} scaleY={scaleY} />\n * }\n * ```\n *\n * @deprecated\n * @internal\n */\nfunction useInvertedScale(scale) {\n  var parentScaleX = useMotionValue(1);\n  var parentScaleY = useMotionValue(1);\n  var visualElement = useVisualElementContext();\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  var scaleX = useTransform(parentScaleX, invertScale);\n  var scaleY = useTransform(parentScaleY, invertScale);\n  return {\n    scaleX: scaleX,\n    scaleY: scaleY\n  };\n}\nexport { invertScale, useInvertedScale };","map":{"version":3,"names":["useTransform","invariant","warning","useMotionValue","useVisualElementContext","maxScale","invertScale","scale","hasWarned","useInvertedScale","parentScaleX","parentScaleY","visualElement","scaleX","scaleY","getValue"],"sources":["C:/ldt/LDT/management/node_modules/framer-motion/dist/es/value/use-inverted-scale.js"],"sourcesContent":["import { useTransform } from './use-transform.js';\nimport { invariant, warning } from 'hey-listen';\nimport { useMotionValue } from './use-motion-value.js';\nimport { useVisualElementContext } from '../context/MotionContext/index.js';\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.\nvar maxScale = 100000;\nvar invertScale = function (scale) {\n    return scale > 0.001 ? 1 / scale : maxScale;\n};\nvar 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 * @motion\n *\n * ```jsx\n * const MyComponent = () => {\n *   const { scaleX, scaleY } = useInvertedScale()\n *   return <motion.div style={{ scaleX, scaleY }} />\n * }\n * ```\n *\n * @library\n *\n * ```jsx\n * function MyComponent() {\n *   const { scaleX, scaleY } = useInvertedScale()\n *   return <Frame scaleX={scaleX} scaleY={scaleY} />\n * }\n * ```\n *\n * @deprecated\n * @internal\n */\nfunction useInvertedScale(scale) {\n    var parentScaleX = useMotionValue(1);\n    var parentScaleY = useMotionValue(1);\n    var visualElement = useVisualElementContext();\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    var scaleX = useTransform(parentScaleX, invertScale);\n    var scaleY = useTransform(parentScaleY, invertScale);\n    return { scaleX: scaleX, scaleY: scaleY };\n}\n\nexport { invertScale, useInvertedScale };\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,oBAAoB;AACjD,SAASC,SAAS,EAAEC,OAAO,QAAQ,YAAY;AAC/C,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,uBAAuB,QAAQ,mCAAmC;;AAE3E;AACA;AACA;AACA,IAAIC,QAAQ,GAAG,MAAM;AACrB,IAAIC,WAAW,GAAG,SAAdA,WAAWA,CAAaC,KAAK,EAAE;EAC/B,OAAOA,KAAK,GAAG,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAGF,QAAQ;AAC/C,CAAC;AACD,IAAIG,SAAS,GAAG,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAACF,KAAK,EAAE;EAC7B,IAAIG,YAAY,GAAGP,cAAc,CAAC,CAAC,CAAC;EACpC,IAAIQ,YAAY,GAAGR,cAAc,CAAC,CAAC,CAAC;EACpC,IAAIS,aAAa,GAAGR,uBAAuB,CAAC,CAAC;EAC7CH,SAAS,CAAC,CAAC,EAAEM,KAAK,IAAIK,aAAa,CAAC,EAAE,4GAA4G,CAAC;EACnJV,OAAO,CAACM,SAAS,EAAE,yFAAyF,CAAC;EAC7GA,SAAS,GAAG,IAAI;EAChB,IAAID,KAAK,EAAE;IACPG,YAAY,GAAGH,KAAK,CAACM,MAAM,IAA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