text: var __defProp = Object.defineProperty;
  var __defProps = Object.defineProperties;
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
  var __hasOwnProp = Object.prototype.hasOwnProperty;
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  var __spreadValues = (a, b) => {
    for (var prop in b || (b = {}))
      if (__hasOwnProp.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    if (__getOwnPropSymbols)
      for (var prop of __getOwnPropSymbols(b)) {
        if (__propIsEnum.call(b, prop))
          __defNormalProp(a, prop, b[prop]);
      }
    return a;
  };
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
  import maxSizeModifier from "popper-max-size-modifier";
  function getPopoverModifiers(props) {
    const {
      allowedAutoPlacements,
      arrow,
      arrowElement,
      boundaryElement,
      constrainSize,
      distance,
      fallbackPlacements,
      margins,
      matchReferenceWidth,
      open,
      preventOverflow,
      skidding,
      tether,
      tetherOffset
    } = props;
    if (!open) {
      return [];
    }
    const detectOverflowOptions = {
      altAxis: true,
      boundary: boundaryElement || void 0,
      padding: 8,
      tether,
      tetherOffset
    };
    return [
      constrainSize && __spreadProps(__spreadValues({}, maxSizeModifier), {
        options: detectOverflowOptions
      }),
      constrainSize && {
        name: "applyMaxSize",
        enabled: true,
        phase: "beforeWrite",
        requires: ["maxSize"],
        fn({ state }) {
          const { width, height } = state.modifiersData.maxSize;
          state.styles.popper = __spreadProps(__spreadValues({}, state.styles.popper), {
            maxWidth: `${width}px`,
            maxHeight: `${height}px`
          });
        }
      },
      arrow && {
        name: "arrow",
        options: {
          element: arrowElement,
          padding: 4
        }
      },
      (constrainSize || preventOverflow) && {
        name: "preventOverflow",
        options: detectOverflowOptions
      },
      {
        name: "offset",
        options: {
          offset: [skidding, distance]
        }
      },
      margins && {
        name: "margins",
        enabled: true,
        phase: "beforeRead",
        fn: ({ state }) => {
          const { rects } = state;
          if (rects.reference) {
            rects.reference.x += margins[3];
            rects.reference.y += margins[1];
            rects.reference.width -= margins[1] + margins[3];
            rects.reference.height -= margins[0] + margins[2];
          }
        }
      },
      {
        name: "flip",
        options: {
          allowedAutoPlacements,
          boundary: boundaryElement || void 0,
          fallbackPlacements,
          padding: 8
        }
      },
      matchReferenceWidth && {
        name: "matchWidth",
        enabled: true,
        phase: "beforeWrite",
        requires: ["computeStyles"],
        fn({ state }) {
          const { width } = state.rects.reference;
          state.styles.popper.width = `${width}px`;
        },
        effect: ({ state }) => {
          const refElement = state.elements.reference;
          if (refElement instanceof HTMLElement) {
            state.elements.popper.style.width = `${refElement.offsetWidth - (margins ? margins[1] + margins[3] : 0)}px`;
          }
        }
      }
    ].filter(Boolean);
  }
  export {
    getPopoverModifiers
  };
  