"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("../tslib.es6-C4EgNkz1.js"),i=require("react"),c=require("classnames"),g=require("../dialog-previous-button-aXPjyhOT.js");require("../icon-button-AJ6dtyvc.js");require("../icon-I30uh1Ov.js");const p=require("../button-xYFMCdP0.js"),n="confirm-dialog",E=d=>{var r,t,l,a,{a11yCloseText:y="Close Dialog",confirmText:m,rejectText:u,confirm:o,reject:e,onReject:f=()=>{},onConfirm:C=()=>{}}=d,s=j.__rest(d,["a11yCloseText","confirmText","rejectText","confirm","reject","onReject","onConfirm"]);const v=i.useRef(null),_="confirm-dialog-confirm",b="confirm-dialog-main";if(!m&&!o)throw new Error('EbayConfirmDialog: A "confirmText" or a "confirm" component needs to be passed');if(!u&&!e)throw new Error('EbayConfirmDialog: A "rejectText" or a "reject" component needs to be passed');return i.createElement(g.DialogBaseWithState,Object.assign({focus:v},s,{a11yCloseText:y,role:"dialog",mainId:b,classPrefix:n,className:c(s.className,`${n}--mask-fade`),windowClass:`${n}__window ${n}__window--animate`,buttonPosition:"hidden",onCloseBtnClick:f}),s.children,i.createElement(g.EbayDialogFooter,null,i.createElement(p.EbayButton,Object.assign({onClick:f},e?.props,{className:c("confirm-dialog__reject",(r=e?.props)===null||r===void 0?void 0:r.className)}),((t=e?.props)===null||t===void 0?void 0:t.children)||u),i.createElement(p.EbayButton,Object.assign({id:_,onClick:C,priority:"primary"},o?.props,{ref:v,"aria-describedby":b,className:c("confirm-dialog__confirm",(l=o?.props)===null||l===void 0?void 0:l.className)}),((a=o?.props)===null||a===void 0?void 0:a.children)||m)))};exports.EbayConfirmDialog=E;
