import{s as j,b7 as ee,b8 as te,E as P,G as _,aG as x,aH as O,ap as L,aK as I,y as c,f as m,O as R,t as oe,ad as N,L as z,K as W,ae as re,b9 as H,z as U,P as ne,Q as F,T as se,D as ae,ba as ie,an as le,av as de,a5 as ce,a3 as $}from"./index-DT8qTvyx.js";var pe=function(T){j(a,T);function a(t){var e=T.call(this,t)||this;e.isDead=!1,e.$$id=ee(),t.store.setEntered(!!t.show),e.handleSelfClose=e.handleSelfClose.bind(e),e.handleAction=e.handleAction.bind(e),e.handleActionSensor=e.handleActionSensor.bind(e),e.handleDialogConfirm=e.handleDialogConfirm.bind(e),e.handleDialogClose=e.handleDialogClose.bind(e),e.handleDrawerConfirm=e.handleDrawerConfirm.bind(e),e.handleDrawerClose=e.handleDrawerClose.bind(e),e.handleEntered=e.handleEntered.bind(e),e.handleExited=e.handleExited.bind(e),e.handleFormInit=e.handleFormInit.bind(e),e.handleFormSaved=e.handleFormSaved.bind(e),e.handleFormChange=e.handleFormChange.bind(e),e.handleChildFinished=e.handleChildFinished.bind(e);var o=t.store;return e.reaction=te(function(){return"".concat(o.loading).concat(o.error)},function(){return e.forceUpdate()}),e}return a.prototype.componentWillUnmount=function(){this.reaction&&this.reaction(),this.isDead=!0},a.prototype.buildActions=function(){var t=this.props,e=t.actions,o=t.confirm,r=t.translate,n=t.testIdBuilder;if(typeof e<"u")return e;var s=[];return s.push({type:"button",testIdBuilder:n==null?void 0:n.getChild("cancel"),actionType:"cancel",label:r("cancel")}),o&&s.push({type:"button",testIdBuilder:n==null?void 0:n.getChild("confirm"),actionType:"confirm",label:r("confirm"),primary:!0}),s},a.prototype.handleSelfClose=function(t,e){return P(this,void 0,void 0,function(){var o,r,n,s,l;return _(this,function(d){switch(d.label){case 0:return o=this.props,r=o.onClose,n=o.store,s=o.dispatchEvent,[4,s("cancel",this.props.data)];case 1:return l=d.sent(),l!=null&&l.prevented?[2]:l!=null&&l.pendingPromise.length?[4,l.allDone()]:[3,3];case 2:d.sent(),d.label=3;case 3:return n.updateMessage(),r(e),[2]}})})},a.prototype.handleActionSensor=function(t){var e=this,o=this.props.store,r=o.busying;o.markBusying(!0),o.updateMessage(),t.then(function(){o.markBusying(r)}).catch(function(n){e.isDead||(o.updateMessage(n.message,!0),o.markBusying(r))})},a.prototype.handleAction=function(t,e,o){var r=this.props,n=r.store,s=r.onAction;e.type==="reset"?n.reset():e.actionType==="cancel"?this.handleSelfClose():s&&s(t,e,o)},a.prototype.handleDialogConfirm=function(t,e){for(var o=[],r=2;r