{"ast":null,"code":"\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport useClosable, { pickClosable } from '../_util/hooks/useClosable';\nimport { ConfigContext } from '../config-provider';\nconst DrawerPanel = props => {\n  var _a, _b;\n  const {\n    prefixCls,\n    title,\n    footer,\n    extra,\n    onClose,\n    headerStyle,\n    bodyStyle,\n    footerStyle,\n    children,\n    classNames: drawerClassNames,\n    styles: drawerStyles\n  } = props;\n  const {\n    drawer: drawerContext\n  } = React.useContext(ConfigContext);\n  const customCloseIconRender = React.useCallback(icon => ( /*#__PURE__*/React.createElement(\"button\", {\n    type: \"button\",\n    onClick: onClose,\n    \"aria-label\": \"Close\",\n    className: `${prefixCls}-close`\n  }, icon)), [onClose]);\n  const [mergedClosable, mergedCloseIcon] = useClosable(pickClosable(props), pickClosable(drawerContext), {\n    closable: true,\n    closeIconRender: customCloseIconRender\n  });\n  const headerNode = React.useMemo(() => {\n    var _a, _b;\n    if (!title && !mergedClosable) {\n      return null;\n    }\n    return /*#__PURE__*/React.createElement(\"div\", {\n      style: Object.assign(Object.assign(Object.assign({}, (_a = drawerContext === null || drawerContext === void 0 ? void 0 : drawerContext.styles) === null || _a === void 0 ? void 0 : _a.header), headerStyle), drawerStyles === null || drawerStyles === void 0 ? void 0 : drawerStyles.header),\n      className: classNames(`${prefixCls}-header`, {\n        [`${prefixCls}-header-close-only`]: mergedClosable && !title && !extra\n      }, (_b = drawerContext === null || drawerContext === void 0 ? void 0 : drawerContext.classNames) === null || _b === void 0 ? void 0 : _b.header, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.header)\n    }, /*#__PURE__*/React.createElement(\"div\", {\n      className: `${prefixCls}-header-title`\n    }, mergedCloseIcon, title && /*#__PURE__*/React.createElement(\"div\", {\n      className: `${prefixCls}-title`\n    }, title)), extra && /*#__PURE__*/React.createElement(\"div\", {\n      className: `${prefixCls}-extra`\n    }, extra));\n  }, [mergedClosable, mergedCloseIcon, extra, headerStyle, prefixCls, title]);\n  const footerNode = React.useMemo(() => {\n    var _a, _b;\n    if (!footer) {\n      return null;\n    }\n    const footerClassName = `${prefixCls}-footer`;\n    return /*#__PURE__*/React.createElement(\"div\", {\n      className: classNames(footerClassName, (_a = drawerContext === null || drawerContext === void 0 ? void 0 : drawerContext.classNames) === null || _a === void 0 ? void 0 : _a.footer, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.footer),\n      style: Object.assign(Object.assign(Object.assign({}, (_b = drawerContext === null || drawerContext === void 0 ? void 0 : drawerContext.styles) === null || _b === void 0 ? void 0 : _b.footer), footerStyle), drawerStyles === null || drawerStyles === void 0 ? void 0 : drawerStyles.footer)\n    }, footer);\n  }, [footer, footerStyle, prefixCls]);\n  return /*#__PURE__*/React.createElement(React.Fragment, null, headerNode, /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(`${prefixCls}-body`, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.body, (_a = drawerContext === null || drawerContext === void 0 ? void 0 : drawerContext.classNames) === null || _a === void 0 ? void 0 : _a.body),\n    style: Object.assign(Object.assign(Object.assign({}, (_b = drawerContext === null || drawerContext === void 0 ? void 0 : drawerContext.styles) === null || _b === void 0 ? void 0 : _b.body), bodyStyle), drawerStyles === null || drawerStyles === void 0 ? void 0 : drawerStyles.body)\n  }, children), footerNode);\n};\nexport default DrawerPanel;","map":{"version":3,"names":["React","classNames","useClosable","pickClosable","ConfigContext","DrawerPanel","props","_a","_b","prefixCls","title","footer","extra","onClose","headerStyle","bodyStyle","footerStyle","children","drawerClassNames","styles","drawerStyles","drawer","drawerContext","useContext","customCloseIconRender","useCallback","icon","createElement","type","onClick","className","mergedClosable","mergedCloseIcon","closable","closeIconRender","headerNode","useMemo","style","Object","assign","header","footerNode","footerClassName","Fragment","body"],"sources":["D:/Project/UC_Trains_Voice/react-demo/node_modules/antd/es/drawer/DrawerPanel.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport useClosable, { pickClosable } from '../_util/hooks/useClosable';\nimport { ConfigContext } from '../config-provider';\nconst DrawerPanel = props => {\n  var _a, _b;\n  const {\n    prefixCls,\n    title,\n    footer,\n    extra,\n    onClose,\n    headerStyle,\n    bodyStyle,\n    footerStyle,\n    children,\n    classNames: drawerClassNames,\n    styles: drawerStyles\n  } = props;\n  const {\n    drawer: drawerContext\n  } = React.useContext(ConfigContext);\n  const customCloseIconRender = React.useCallback(icon => ( /*#__PURE__*/React.createElement(\"button\", {\n    type: \"button\",\n    onClick: onClose,\n    \"aria-label\": \"Close\",\n    className: `${prefixCls}-close`\n  }, icon)), [onClose]);\n  const [mergedClosable, mergedCloseIcon] = useClosable(pickClosable(props), pickClosable(drawerContext), {\n    closable: true,\n    closeIconRender: customCloseIconRender\n  });\n  const headerNode = React.useMemo(() => {\n    var _a, _b;\n    if (!title && !mergedClosable) {\n      return null;\n    }\n    return /*#__PURE__*/React.createElement(\"div\", {\n      style: Object.assign(Object.assign(Object.assign({}, (_a = drawerContext === null || drawerContext === void 0 ? void 0 : drawerContext.styles) === null || _a === void 0 ? void 0 : _a.header), headerStyle), drawerStyles === null || drawerStyles === void 0 ? void 0 : drawerStyles.header),\n      className: classNames(`${prefixCls}-header`, {\n        [`${prefixCls}-header-close-only`]: mergedClosable && !title && !extra\n      }, (_b = drawerContext === null || drawerContext === void 0 ? void 0 : drawerContext.classNames) === null || _b === void 0 ? void 0 : _b.header, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.header)\n    }, /*#__PURE__*/React.createElement(\"div\", {\n      className: `${prefixCls}-header-title`\n    }, mergedCloseIcon, title && /*#__PURE__*/React.createElement(\"div\", {\n      className: `${prefixCls}-title`\n    }, title)), extra && /*#__PURE__*/React.createElement(\"div\", {\n      className: `${prefixCls}-extra`\n    }, extra));\n  }, [mergedClosable, mergedCloseIcon, extra, headerStyle, prefixCls, title]);\n  const footerNode = React.useMemo(() => {\n    var _a, _b;\n    if (!footer) {\n      return null;\n    }\n    const footerClassName = `${prefixCls}-footer`;\n    return /*#__PURE__*/React.createElement(\"div\", {\n      className: classNames(footerClassName, (_a = drawerContext === null || drawerContext === void 0 ? void 0 : drawerContext.classNames) === null || _a === void 0 ? void 0 : _a.footer, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.footer),\n      style: Object.assign(Object.assign(Object.assign({}, (_b = drawerContext === null || drawerContext === void 0 ? void 0 : drawerContext.styles) === null || _b === void 0 ? void 0 : _b.footer), footerStyle), drawerStyles === null || drawerStyles === void 0 ? void 0 : drawerStyles.footer)\n    }, footer);\n  }, [footer, footerStyle, prefixCls]);\n  return /*#__PURE__*/React.createElement(React.Fragment, null, headerNode, /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(`${prefixCls}-body`, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.body, (_a = drawerContext === null || drawerContext === void 0 ? void 0 : drawerContext.classNames) === null || _a === void 0 ? void 0 : _a.body),\n    style: Object.assign(Object.assign(Object.assign({}, (_b = drawerContext === null || drawerContext === void 0 ? void 0 : drawerContext.styles) === null || _b === void 0 ? void 0 : _b.body), bodyStyle), drawerStyles === null || drawerStyles === void 0 ? void 0 : drawerStyles.body)\n  }, children), footerNode);\n};\nexport default DrawerPanel;"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,WAAW,IAAIC,YAAY,QAAQ,4BAA4B;AACtE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,MAAMC,WAAW,GAAGC,KAAK,IAAI;EAC3B,IAAIC,EAAE,EAAEC,EAAE;EACV,MAAM;IACJC,SAAS;IACTC,KAAK;IACLC,MAAM;IACNC,KAAK;IACLC,OAAO;IACPC,WAAW;IACXC,SAAS;IACTC,WAAW;IACXC,QAAQ;IACRhB,UAAU,EAAEiB,gBAAgB;IAC5BC,MAAM,EAAEC;EACV,CAAC,GAAGd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