import { unrefElement as O } from "../../../../../@vueuse/core/index.mjs";
import { isClient as f } from "../../../../../@vueuse/shared/index.mjs";
const u = (e, t = []) => {
  const { placement: n, strategy: o, popperOptions: i } = e, r = {
    placement: n,
    strategy: o,
    ...i,
    modifiers: [...p(e), ...t]
  };
  return l(r, i == null ? void 0 : i.modifiers), r;
}, c = (e) => {
  if (f)
    return O(e);
};
function p(e) {
  const { offset: t, gpuAcceleration: n, fallbackPlacements: o } = e;
  return [
    {
      name: "offset",
      options: {
        offset: [0, t ?? 12]
      }
    },
    {
      name: "preventOverflow",
      options: {
        padding: {
          top: 2,
          bottom: 2,
          left: 5,
          right: 5
        }
      }
    },
    {
      name: "flip",
      options: {
        padding: 5,
        fallbackPlacements: o
      }
    },
    {
      name: "computeStyles",
      options: {
        gpuAcceleration: n
      }
    }
  ];
}
function l(e, t) {
  t && (e.modifiers = [...e.modifiers, ...t ?? []]);
}
export {
  u as buildPopperOptions,
  c as unwrapMeasurableEl
};
