import{a4 as z,r as l,T as h,bU as B,W as E,am as W,b4 as R,bV as S,B as X,bW as H,bX as L,bY as N,al as A,P as D,V as F}from"./index-CKIL6d0V.js";const U=e=>{const{componentCls:n,iconCls:a,antCls:t,zIndexPopup:o,colorText:p,colorWarning:f,marginXXS:c,marginXS:i,fontSize:u,fontWeightStrong:C,colorTextHeading:d}=e;return{[n]:{zIndex:o,[`&${t}-popover`]:{fontSize:u},[`${n}-message`]:{marginBottom:i,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${n}-message-icon ${a}`]:{color:f,fontSize:u,lineHeight:1,marginInlineEnd:i},[`${n}-title`]:{fontWeight:C,color:d,"&:only-child":{fontWeight:"normal"}},[`${n}-description`]:{marginTop:c,color:p}},[`${n}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:i}}}}},Y=e=>{const{zIndexPopupBase:n}=e;return{zIndexPopup:n+60}},$=z("Popconfirm",e=>U(e),Y,{resetStyle:!1});var q=function(e,n){var a={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(a[t[o]]=e[t[o]]);return a};const j=e=>{const{prefixCls:n,okButtonProps:a,cancelButtonProps:t,title:o,description:p,cancelText:f,okText:c,okType:i="primary",icon:u=l.createElement(N,null),showCancel:C=!0,close:d,onConfirm:v,onCancel:y,onPopupClick:b}=e,{getPrefixCls:P}=l.useContext(h),[m]=W("Popconfirm",R.Popconfirm),g=S(o),x=S(p);return l.createElement("div",{className:`${n}-inner-content`,onClick:b},l.createElement("div",{className:`${n}-message`},u&&l.createElement("span",{className:`${n}-message-icon`},u),l.createElement("div",{className:`${n}-message-text`},g&&l.createElement("div",{className:E(`${n}-title`)},g),x&&l.createElement("div",{className:`${n}-description`},x))),l.createElement("div",{className:`${n}-buttons`},C&&l.createElement(X,Object.assign({onClick:y,size:"small"},t),f||(m==null?void 0:m.cancelText)),l.createElement(H,{buttonProps:Object.assign(Object.assign({size:"small"},L(i)),a),actionFn:v,close:d,prefixCls:P("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},c||(m==null?void 0:m.okText))))},M=e=>{const{prefixCls:n,placement:a,className:t,style:o}=e,p=q(e,["prefixCls","placement","className","style"]),{getPrefixCls:f}=l.useContext(h),c=f("popconfirm",n),[i]=$(c);return i(l.createElement(B,{placement:a,className:E(c,t),style:o,content:l.createElement(j,Object.assign({prefixCls:c},p))}))};var G=function(e,n){var a={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(a[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(a[t[o]]=e[t[o]]);return a};const J=l.forwardRef((e,n)=>{var a,t;const{prefixCls:o,placement:p="top",trigger:f="click",okType:c="primary",icon:i=l.createElement(N,null),children:u,overlayClassName:C,onOpenChange:d,onVisibleChange:v}=e,y=G(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange"]),{getPrefixCls:b}=l.useContext(h),[P,m]=A(!1,{value:(a=e.open)!==null&&a!==void 0?a:e.visible,defaultValue:(t=e.defaultOpen)!==null&&t!==void 0?t:e.defaultVisible}),g=(r,s)=>{m(r,!0),v==null||v(r),d==null||d(r,s)},x=r=>{g(!1,r)},w=r=>{var s;return(s=e.onConfirm)===null||s===void 0?void 0:s.call(void 0,r)},I=r=>{var s;g(!1,r),(s=e.onCancel)===null||s===void 0||s.call(void 0,r)},T=(r,s)=>{const{disabled:_=!1}=e;_||g(r,s)},O=b("popconfirm",o),k=E(O,C),[V]=$(O);return V(l.createElement(D,Object.assign({},F(y,["title"]),{trigger:f,placement:p,onOpenChange:T,open:P,ref:n,overlayClassName:k,content:l.createElement(j,Object.assign({okType:c,icon:i},e,{prefixCls:O,close:x,onConfirm:w,onCancel:I})),"data-popover-inject":!0}),u))}),K=J;K._InternalPanelDoNotUseOrYouWillBeFired=M;export{K as P};
