{"version":3,"file":"utils.mjs","sources":["../../../../../../../../node_modules/react-popper/lib/esm/utils.js"],"sourcesContent":["import * as React from 'react';\n\n/**\n * Takes an argument and if it's an array, returns the first item in the array,\n * otherwise returns the argument. Used for Preact compatibility.\n */\nexport var unwrapArray = function unwrapArray(arg) {\n  return Array.isArray(arg) ? arg[0] : arg;\n};\n/**\n * Takes a maybe-undefined function and arbitrary args and invokes the function\n * only if it is defined.\n */\n\nexport var safeInvoke = function safeInvoke(fn) {\n  if (typeof fn === 'function') {\n    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n\n    return fn.apply(void 0, args);\n  }\n};\n/**\n * Sets a ref using either a ref callback or a ref object\n */\n\nexport var setRef = function setRef(ref, node) {\n  // if its a function call it\n  if (typeof ref === 'function') {\n    return safeInvoke(ref, node);\n  } // otherwise we should treat it as a ref object\n  else if (ref != null) {\n      ref.current = node;\n    }\n};\n/**\n * Simple ponyfill for Object.fromEntries\n */\n\nexport var fromEntries = function fromEntries(entries) {\n  return entries.reduce(function (acc, _ref) {\n    var key = _ref[0],\n        value = _ref[1];\n    acc[key] = value;\n    return acc;\n  }, {});\n};\n/**\n * Small wrapper around `useLayoutEffect` to get rid of the warning on SSR envs\n */\n\nexport var useIsomorphicLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? React.useLayoutEffect : React.useEffect;"],"names":[],"mappings":";;AAoCA;AACA;AACA;AACA;AACU,IAAC,WAAW,GAAG,SAAS,WAAW,CAAC,OAAO,EAAE;AACvD,EAAE,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,GAAG,EAAE,IAAI,EAAE;AAC7C,IAAI,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC;AACrB,QAAQ,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACxB,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACrB,IAAI,OAAO,GAAG,CAAC;AACf,GAAG,EAAE,EAAE,CAAC,CAAC;AACT,EAAE;AACF;AACA;AACA;AACA;AACU,IAAC,yBAAyB,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,aAAa,GAAG,KAAK,CAAC,eAAe,GAAG,KAAK,CAAC;;;;","x_google_ignoreList":[0]}