import{t as H,bd as V,be as Q,G as z,H as M,aQ as T,aK as x,z as c,aS as _,ax as q,l as v,ad as O,P as I,v as G,ae as K,D as j,Q as J,T as B,U as X,E as Y,bg as Z,av as ee,dV as re,L as te,aD as oe,a5 as ne,a4 as $}from"./index-CEmnTf-r.js";var se=function(b){H(a,b);function a(r){var e=b.call(this,r)||this;e.$$id=V(),r.store.setEntered(!!r.show),e.handleSelfClose=e.handleSelfClose.bind(e),e.handleAction=e.handleAction.bind(e),e.handleActionSensor=e.handleActionSensor.bind(e),e.handleDrawerConfirm=e.handleDrawerConfirm.bind(e),e.handleDrawerClose=e.handleDrawerClose.bind(e),e.handleDialogConfirm=e.handleDialogConfirm.bind(e),e.handleDialogClose=e.handleDialogClose.bind(e),e.handleChildFinished=e.handleChildFinished.bind(e),e.handleEntered=e.handleEntered.bind(e),e.handleExited=e.handleExited.bind(e),e.handleFormInit=e.handleFormInit.bind(e),e.handleFormChange=e.handleFormChange.bind(e),e.handleFormSaved=e.handleFormSaved.bind(e);var t=r.store;return e.reaction=Q(function(){return"".concat(t.loading).concat(t.error)},function(){return e.forceUpdate()}),e}return a.prototype.componentWillUnmount=function(){this.reaction&&this.reaction(),clearTimeout(this.clearErrorTimer)},a.prototype.buildActions=function(){var r=this.props,e=r.actions,t=r.confirm,o=r.translate,n=r.testIdBuilder;if(typeof e<"u")return e;var s=[];return s.push({type:"button",testIdBuilder:n==null?void 0:n.getChild("cancel"),actionType:"close",label:o("cancel")}),t&&s.push({type:"button",actionType:"confirm",testIdBuilder:n==null?void 0:n.getChild("confirm"),label:o("confirm"),primary:!0}),s},a.prototype.handleSelfClose=function(){return z(this,void 0,void 0,function(){var r,e,t,o,n;return M(this,function(s){switch(s.label){case 0:return r=this.props,e=r.onClose,t=r.store,o=r.dispatchEvent,t.dialogOpen!==!1||t.drawerOpen!==!1?[2]:[4,o("cancel",this.props.data)];case 1:return n=s.sent(),n!=null&&n.prevented?[2]:n!=null&&n.pendingPromise.length?[4,n.allDone()]:[3,3];case 2:s.sent(),s.label=3;case 3:return t.updateMessage(),e(),[2]}})})},a.prototype.handleActionSensor=function(r){var e=this.props.store,t=e.busying;e.markBusying(!0),e.updateMessage(),r.then(function(){e.markBusying(t)}).catch(function(o){e.updateMessage(o.message,!0),e.markBusying(t)})},a.prototype.handleAction=function(r,e,t){var o=this.props,n=o.onClose,s=o.onAction;e.actionType==="close"||e.actionType==="cancel"?n():s&&s(r,e,t)},a.prototype.handleDrawerConfirm=function(r,e){for(var t=[],o=2;o