"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// packages/block-editor/src/components/link-control/settings-drawer.js
var settings_drawer_exports = {};
__export(settings_drawer_exports, {
  default: () => settings_drawer_default
});
module.exports = __toCommonJS(settings_drawer_exports);
var import_components = require("@wordpress/components");
var import_icons = require("@wordpress/icons");
var import_compose = require("@wordpress/compose");
var import_i18n = require("@wordpress/i18n");
var import_element = require("@wordpress/element");
var import_jsx_runtime = require("react/jsx-runtime");
function LinkSettingsDrawer({ children, settingsOpen, setSettingsOpen }) {
  const prefersReducedMotion = (0, import_compose.useReducedMotion)();
  const MaybeAnimatePresence = prefersReducedMotion ? import_element.Fragment : import_components.__unstableAnimatePresence;
  const MaybeMotionDiv = prefersReducedMotion ? "div" : import_components.__unstableMotion.div;
  const id = (0, import_compose.useInstanceId)(LinkSettingsDrawer);
  const settingsDrawerId = `link-control-settings-drawer-${id}`;
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
      import_components.Button,
      {
        __next40pxDefaultSize: true,
        className: "block-editor-link-control__drawer-toggle",
        "aria-expanded": settingsOpen,
        onClick: () => setSettingsOpen(!settingsOpen),
        icon: (0, import_i18n.isRTL)() ? import_icons.chevronLeftSmall : import_icons.chevronRightSmall,
        "aria-controls": settingsDrawerId,
        children: (0, import_i18n._x)("Advanced", "Additional link settings")
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MaybeAnimatePresence, { children: settingsOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
      MaybeMotionDiv,
      {
        className: "block-editor-link-control__drawer",
        hidden: !settingsOpen,
        id: settingsDrawerId,
        initial: "collapsed",
        animate: "open",
        exit: "collapsed",
        variants: {
          open: { opacity: 1, height: "auto" },
          collapsed: { opacity: 0, height: 0 }
        },
        transition: {
          duration: 0.1
        },
        children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "block-editor-link-control__drawer-inner", children })
      }
    ) })
  ] });
}
var settings_drawer_default = LinkSettingsDrawer;
//# sourceMappingURL=settings-drawer.js.map
