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 { mergeProps as _mergeProps, createVNode as _createVNode } from "vue";
import { objectType, omit } from "@antdv/pro-utils";
import { Drawer } from "ant-design-vue";
import { defineComponent, ref, watch } from "vue";
import { ProHelpPanel, propHelpPanelProps } from "./ProHelpPanel.mjs";
const proHelpDrawerProps = __spreadValues({
  drawerProps: objectType()
}, omit(propHelpPanelProps, ["onClose"]));
const ProHelpDrawer = defineComponent({
  name: "ProHelpDrawer",
  props: proHelpDrawerProps,
  emits: {
    "update:drawerProps": (val) => true
  },
  setup(props, {
    emit
  }) {
    var _a, _b;
    const drawerOpen = ref((_b = (_a = props.drawerProps) == null ? void 0 : _a.open) != null ? _b : false);
    watch(() => {
      var _a2;
      return (_a2 = props.drawerProps) == null ? void 0 : _a2.open;
    }, () => {
      var _a2, _b2;
      drawerOpen.value = (_b2 = (_a2 = props.drawerProps) == null ? void 0 : _a2.open) != null ? _b2 : false;
    });
    return () => {
      return _createVNode(Drawer, _mergeProps({
        "width": 720,
        "closeIcon": null,
        "headerStyle": {
          display: "none"
        },
        "bodyStyle": {
          padding: 0
        },
        "maskClosable": true
      }, omit(props.drawerProps || {}, ["open", "onAfterOpenChange"]), {
        "open": drawerOpen.value,
        "onClose": () => drawerOpen.value = false,
        "onAfterOpenChange": (open) => {
          var _a2, _b2;
          drawerOpen.value = open;
          emit("update:drawerProps", __spreadProps(__spreadValues({}, props.drawerProps), {
            open
          }));
          (_b2 = (_a2 = props.drawerProps) == null ? void 0 : _a2.onAfterOpenChange) == null ? void 0 : _b2.call(_a2, open);
        }
      }), {
        default: () => [_createVNode(ProHelpPanel, _mergeProps(props, {
          "onClose": () => drawerOpen.value = false,
          "bordered": false
        }), null)]
      });
    };
  }
});
export {
  ProHelpDrawer,
  proHelpDrawerProps
};
