{"ast":null,"code":"import { __read } from 'tslib';\nimport { useRef, useState } from 'react';\nimport { wrap } from 'popmotion';\n\n/**\n * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.\n *\n * @library\n *\n * ```jsx\n * import * as React from \"react\"\n * import { Frame, useCycle } from \"framer\"\n *\n * export function MyComponent() {\n *   const [x, cycleX] = useCycle(0, 50, 100)\n *\n *   return (\n *     <Frame\n *       animate={{ x: x }}\n *       onTap={() => cycleX()}\n *      />\n *    )\n * }\n * ```\n *\n * @motion\n *\n * An index value can be passed to the returned `cycle` function to cycle to a specific index.\n *\n * ```jsx\n * import * as React from \"react\"\n * import { motion, useCycle } from \"framer-motion\"\n *\n * export const MyComponent = () => {\n *   const [x, cycleX] = useCycle(0, 50, 100)\n *\n *   return (\n *     <motion.div\n *       animate={{ x: x }}\n *       onTap={() => cycleX()}\n *      />\n *    )\n * }\n * ```\n *\n * @param items - items to cycle through\n * @returns [currentState, cycleState]\n *\n * @public\n */\nfunction useCycle() {\n  var items = [];\n  for (var _i = 0; _i < arguments.length; _i++) {\n    items[_i] = arguments[_i];\n  }\n  var index = useRef(0);\n  var _a = __read(useState(items[index.current]), 2),\n    item = _a[0],\n    setItem = _a[1];\n  return [item, function (next) {\n    index.current = typeof next !== \"number\" ? wrap(0, items.length, index.current + 1) : next;\n    setItem(items[index.current]);\n  }];\n}\nexport { useCycle };","map":{"version":3,"names":["__read","useRef","useState","wrap","useCycle","items","_i","arguments","length","index","_a","current","item","setItem","next"],"sources":["C:/LDT/DSP_Management/node_modules/framer-motion/dist/es/utils/use-cycle.js"],"sourcesContent":["import { __read } from 'tslib';\nimport { useRef, useState } from 'react';\nimport { wrap } from 'popmotion';\n\n/**\n * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.\n *\n * @library\n *\n * ```jsx\n * import * as React from \"react\"\n * import { Frame, useCycle } from \"framer\"\n *\n * export function MyComponent() {\n *   const [x, cycleX] = useCycle(0, 50, 100)\n *\n *   return (\n *     <Frame\n *       animate={{ x: x }}\n *       onTap={() => cycleX()}\n *      />\n *    )\n * }\n * ```\n *\n * @motion\n *\n * An index value can be passed to the returned `cycle` function to cycle to a specific index.\n *\n * ```jsx\n * import * as React from \"react\"\n * import { motion, useCycle } from \"framer-motion\"\n *\n * export const MyComponent = () => {\n *   const [x, cycleX] = useCycle(0, 50, 100)\n *\n *   return (\n *     <motion.div\n *       animate={{ x: x }}\n *       onTap={() => cycleX()}\n *      />\n *    )\n * }\n * ```\n *\n * @param items - items to cycle through\n * @returns [currentState, cycleState]\n *\n * @public\n */\nfunction useCycle() {\n    var items = [];\n    for (var _i = 0; _i < arguments.length; _i++) {\n        items[_i] = arguments[_i];\n    }\n    var index = useRef(0);\n    var _a = __read(useState(items[index.current]), 2), item = _a[0], setItem = _a[1];\n    return [\n        item,\n        function (next) {\n            index.current =\n                typeof next !== \"number\"\n                    ? wrap(0, items.length, index.current + 1)\n                    : next;\n            setItem(items[index.current]);\n        },\n    ];\n}\n\nexport { useCycle };\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,OAAO;AAC9B,SAASC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,WAAW;;AAEhC;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,QAAQA,CAAA,EAAG;EAChB,IAAIC,KAAK,GAAG,EAAE;EACd,KAAK,IAAIC,EAAE,GAAG,CAAC,EAAEA,EAAE,GAAGC,SAAS,CAACC,MAAM,EAAEF,EAAE,EAAE,EAAE;IAC1CD,KAAK,CAACC,EAAE,CAAC,GAAGC,SAAS,CAACD,EAAE,CAAC;EAC7B;EACA,IAAIG,KAAK,GAAGR,MAAM,CAAC,CAAC,CAAC;EACrB,IAAIS,EAAE,GAAGV,MAAM,CAACE,QAAQ,CAACG,KAAK,CAACI,KAAK,CAACE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAAEC,IAAI,GAAGF,EAAE,CAAC,CAAC,CAAC;IAAEG,OAAO,GAAGH,EAAE,CAAC,CAAC,CAAC;EACjF,OAAO,CACHE,IAAI,EACJ,UAAUE,IAAI,EAAE;IACZL,KAAK,CAACE,OAAO,GACT,OAAOG,IAAI,KAAK,QAAQ,GAClBX,IAAI,CAAC,CAAC,EAAEE,KAAK,CAACG,MAAM,EAAEC,KAAK,CAACE,OAAO,GAAG,CAAC,CAAC,GACxCG,IAAI;IACdD,OAAO,CAACR,KAAK,CAACI,KAAK,CAACE,OAAO,CAAC,CAAC;EACjC,CAAC,CACJ;AACL;AAEA,SAASP,QAAQ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}