import{a as e,n as t}from"./react-dom-stZKkA6x.js";import{M as n,O as r}from"./theme-DNlqAiGO.js";import{Hn as i,Mn as a,Mr as o,Rn as s,Ut as c,Wn as l,Yt as u,bn as d,kt as f,zn as p}from"./jsx-runtime-dm82oUI8.js";import{E as m,T as h,w as g}from"./index-CBPGvhVC.js";var _=e(t()),v=e(o()),y=e=>{let{componentCls:t,iconCls:n,antCls:r,zIndexPopup:i,colorText:a,colorWarning:o,marginXXS:s,marginXS:c,fontSize:l,fontWeightStrong:u,colorTextHeading:d}=e;return{[t]:{zIndex:i,[`&${r}-popover`]:{fontSize:l},[`${t}-message`]:{marginBottom:c,display:`flex`,flexWrap:`nowrap`,alignItems:`start`,[`> ${t}-message-icon ${n}`]:{color:o,fontSize:l,lineHeight:1,marginInlineEnd:c},[`${t}-title`]:{fontWeight:u,color:d,"&:only-child":{fontWeight:`normal`}},[`${t}-description`]:{marginTop:s,color:a}},[`${t}-buttons`]:{textAlign:`end`,whiteSpace:`nowrap`,button:{marginInlineStart:c}}}}},b=d(`Popconfirm`,e=>y(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1}),x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},S=e=>{let{prefixCls:t,okButtonProps:a,cancelButtonProps:o,title:u,description:d,cancelText:p,okText:h,okType:g=`primary`,icon:v=_.createElement(n,null),showCancel:y=!0,close:b,onConfirm:x,onCancel:S,onPopupClick:C}=e,{getPrefixCls:w}=_.useContext(s),[T]=i(`Popconfirm`,l.Popconfirm),E=m(u),D=m(d);return _.createElement(`div`,{className:`${t}-inner-content`,onClick:C},_.createElement(`div`,{className:`${t}-message`},v&&_.createElement(`span`,{className:`${t}-message-icon`},v),_.createElement(`div`,{className:`${t}-message-text`},E&&_.createElement(`div`,{className:`${t}-title`},E),D&&_.createElement(`div`,{className:`${t}-description`},D))),_.createElement(`div`,{className:`${t}-buttons`},y&&_.createElement(f,Object.assign({onClick:S,size:`small`},o),p||T?.cancelText),_.createElement(r,{buttonProps:Object.assign(Object.assign({size:`small`},c(g)),a),actionFn:x,close:b,prefixCls:w(`btn`),quitOnNullishReturnValue:!0,emitEvent:!0},h||T?.okText)))},C=e=>{let{prefixCls:t,placement:n,className:r,style:i}=e,a=x(e,[`prefixCls`,`placement`,`className`,`style`]),{getPrefixCls:o}=_.useContext(s),c=o(`popconfirm`,t),[l]=b(c);return l(_.createElement(h,{placement:n,className:(0,v.default)(c,r),style:i,content:_.createElement(S,Object.assign({prefixCls:c},a))}))},w=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},T=_.forwardRef((e,t)=>{let{prefixCls:r,placement:i=`top`,trigger:o=`click`,okType:s=`primary`,icon:c=_.createElement(n,null),children:l,overlayClassName:d,onOpenChange:f,onVisibleChange:m,overlayStyle:h,styles:y,classNames:x}=e,C=w(e,[`prefixCls`,`placement`,`trigger`,`okType`,`icon`,`children`,`overlayClassName`,`onOpenChange`,`onVisibleChange`,`overlayStyle`,`styles`,`classNames`]),{getPrefixCls:T,className:E,style:D,classNames:O,styles:k}=p(`popconfirm`),[A,j]=a(!1,{value:e.open??e.visible,defaultValue:e.defaultOpen??e.defaultVisible}),M=(e,t)=>{j(e,!0),m?.(e),f?.(e,t)},N=e=>{M(!1,e)},P=t=>e.onConfirm?.call(void 0,t),F=t=>{var n;M(!1,t),(n=e.onCancel)==null||n.call(void 0,t)},I=(t,n)=>{let{disabled:r=!1}=e;r||M(t,n)},L=T(`popconfirm`,r),R=(0,v.default)(L,E,d,O.root,x?.root),z=(0,v.default)(O.body,x?.body),[B]=b(L);return B(_.createElement(g,Object.assign({},u(C,[`title`]),{trigger:o,placement:i,onOpenChange:I,open:A,ref:t,classNames:{root:R,body:z},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},k.root),D),h),y?.root),body:Object.assign(Object.assign({},k.body),y?.body)},content:_.createElement(S,Object.assign({okType:s,icon:c},e,{prefixCls:L,close:N,onConfirm:P,onCancel:F})),"data-popover-inject":!0}),l))});T._InternalPanelDoNotUseOrYouWillBeFired=C;export{T as t};