import{o as e}from"./chunk-jRWAZmH_.js";import{n as t,t as n}from"./jsx-runtime-CEixWuwE.js";import{n as r}from"./axios-v6FV69Ne.js";import{t as i}from"./button-C7b7AmGo.js";import{t as a}from"./popconfirm-CrjlZKtV.js";import{F as o,et as s}from"./index-BqyXv5bE.js";var c=e(r()),l=n(),u=({toolTipTitle:e,children:t})=>e?(0,l.jsx)(o,{title:e,children:t}):t;u.propTypes={toolTipTitle:c.default.string,children:c.default.node.isRequired};var d=e(t()),f=({withModalConfirm:e,withPopConfirm:t,confirmTitle:n,okText:r,cancelText:i,disabled:o,onConfirm:c,children:u})=>{let f=()=>{s.confirm({title:n,okText:r,cancelText:i,onOk:c,centered:!0,width:450})};return e?d.cloneElement(u,{onClick:()=>{o||f()}}):t?(0,l.jsx)(a,{title:n,onConfirm:c,okText:r,cancelText:i,disabled:o,children:u}):u};f.propTypes={withPopConfirm:c.default.bool,withModalConfirm:c.default.bool,confirmTitle:c.default.string,okText:c.default.string,cancelText:c.default.string,disabled:c.default.bool,onConfirm:c.default.func.isRequired,children:c.default.node.isRequired};var p=({icon:e,onClick:t,disabled:n=!1,type:r=`primary`,loading:a=!1,toolTipTitle:o=``,withPopConfirm:s=!1,withModalConfirm:c=!1,confirmTitle:d=`Confirmez-vous cette action ?`,okText:p=`Oui`,cancelText:m=`Annuler`,children:h,...g})=>(0,l.jsx)(u,{toolTipTitle:o,children:(0,l.jsx)(f,{withModalConfirm:c,withPopConfirm:s,confirmTitle:d,okText:p,cancelText:m,disabled:n,onConfirm:t,children:(0,l.jsx)(i,{type:r,icon:e,loading:a,onClick:!s&&!c?t:void 0,disabled:n,...g,children:h})})});p.propTypes={icon:c.default.node,onClick:c.default.func.isRequired,disabled:c.default.bool,type:c.default.string,toolTipTitle:c.default.string,loading:c.default.bool,withConfirm:c.default.bool,withModalConfirm:c.default.bool,confirmTitle:c.default.string,okText:c.default.string,cancelText:c.default.string,children:c.default.node};export{p as t};