this.primereact=this.primereact||{},this.primereact.dialog=function(e,t,i,n,o,s,a){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=r(t),d=r(a);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i=this.props.minX&&r+t=this.props.minY&&l+nu)&&a.left+lc)&&a.top+d0)if(document.activeElement){var d=l.indexOf(document.activeElement);t.shiftKey?-1===d||0===d?l[l.length-1].focus():l[d-1].focus():-1===d||d===l.length-1?l[0].focus():l[d+1].focus()}else l[0].focus()}}}};var t,n={id:this.state.id,hasBlockScroll:this.props.blockScroll};document.primeDialogParams=document.primeDialogParams?[].concat(c(t=document.primeDialogParams)||p(t)||m(t)||h(),[n]):[n],document.addEventListener("keydown",this.documentKeyDownListener)}},{key:"unbindDocumentKeyDownListener",value:function(){var e=this;this.documentKeyDownListener&&(document.removeEventListener("keydown",this.documentKeyDownListener),document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(t){return t.id!==e.state.id})),this.documentKeyDownListener=null)}},{key:"createStyle",value:function(){if(!this.styleElement){this.styleElement=i.DomHandler.createInlineStyle(d.default.nonce);var e="";for(var t in this.props.breakpoints)e+="\n @media screen and (max-width: ".concat(t,") {\n .p-dialog[").concat(this.attributeSelector,"] {\n width: ").concat(this.props.breakpoints[t]," !important;\n }\n }\n ");this.styleElement.innerHTML=e}}},{key:"componentDidMount",value:function(){var e=this;this.state.id||this.setState({id:i.UniqueComponentId()}),this.props.visible&&this.setState({maskVisible:!0},(function(){i.ZIndexUtils.set("modal",e.mask,d.default.autoZIndex,e.props.baseZIndex||d.default.zIndex.modal),e.setState({visible:!0})})),this.props.breakpoints&&this.createStyle()}},{key:"componentDidUpdate",value:function(e){var t=this;this.props.visible&&!this.state.maskVisible&&this.setState({maskVisible:!0},(function(){i.ZIndexUtils.set("modal",t.mask,d.default.autoZIndex,t.props.baseZIndex||d.default.zIndex.modal)})),this.props.visible!==this.state.visible&&this.state.maskVisible&&this.setState({visible:this.props.visible}),e.maximized!==this.props.maximized&&this.props.onMaximize&&this.changeScrollOnMaximizable()}},{key:"changeScrollOnMaximizable",value:function(){this.props.blockScroll||i.DomHandler[this.maximized?"addClass":"removeClass"](document.body,"p-overflow-hidden")}},{key:"componentWillUnmount",value:function(){this.disableDocumentSettings(),this.styleElement=i.DomHandler.removeInlineStyle(this.styleElement),i.ZIndexUtils.clear(this.mask)}},{key:"renderCloseIcon",value:function(){var e=this;return this.props.closable?l.default.createElement("button",{ref:function(t){return e.closeElement=t},type:"button",className:"p-dialog-header-icon p-dialog-header-close p-link","aria-label":this.props.ariaCloseIconLabel,onClick:this.onClose},l.default.createElement("span",{className:"p-dialog-header-close-icon pi pi-times"}),l.default.createElement(o.Ripple,null)):null}},{key:"renderMaximizeIcon",value:function(){var e=i.classNames("p-dialog-header-maximize-icon pi",{"pi-window-maximize":!this.maximized,"pi-window-minimize":this.maximized});return this.props.maximizable?l.default.createElement("button",{type:"button",className:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:this.toggleMaximize},l.default.createElement("span",{className:e}),l.default.createElement(o.Ripple,null)):null}},{key:"renderHeader",value:function(){var e=this;if(this.props.showHeader){var t=this.renderCloseIcon(),n=this.renderMaximizeIcon(),o=i.ObjectUtils.getJSXElement(this.props.icons,this.props),s=i.ObjectUtils.getJSXElement(this.props.header,this.props);return l.default.createElement("div",{ref:function(t){return e.headerEl=t},className:"p-dialog-header",onMouseDown:this.onDragStart},l.default.createElement("div",{id:this.state.id+"_header",className:"p-dialog-title"},s),l.default.createElement("div",{className:"p-dialog-header-icons"},o,n,t))}return null}},{key:"renderContent",value:function(){var e=this,t=i.classNames("p-dialog-content",this.props.contentClassName);return l.default.createElement("div",{id:this.state.id+"_content",ref:function(t){return e.contentEl=t},className:t,style:this.props.contentStyle},this.props.children)}},{key:"renderFooter",value:function(){var e=this,t=i.ObjectUtils.getJSXElement(this.props.footer,this.props);return t&&l.default.createElement("div",{ref:function(t){return e.footerElement=t},className:"p-dialog-footer"},t)}},{key:"renderResizer",value:function(){return this.props.resizable?l.default.createElement("div",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:this.onResizeStart}):null}},{key:"renderElement",value:function(){var e=this,t=i.classNames("p-dialog p-component",this.props.className,{"p-dialog-rtl":this.props.rtl,"p-dialog-maximized":this.maximized}),o=i.classNames("p-dialog-mask",{"p-component-overlay p-component-overlay-enter":this.props.modal,"p-dialog-visible":this.state.maskVisible,"p-dialog-draggable":this.props.draggable,"p-dialog-resizable":this.props.resizable},this.props.maskClassName,this.getPositionClass()),s=this.renderHeader(),a=this.renderContent(),r=this.renderFooter(),d=this.renderResizer();return l.default.createElement("div",{ref:function(t){return e.mask=t},style:this.props.maskStyle,className:o,onClick:this.onMaskClick},l.default.createElement(n.CSSTransition,{nodeRef:this.dialogRef,classNames:"p-dialog",timeout:{enter:"center"===this.props.position?150:300,exit:"center"===this.props.position?150:300},in:this.state.visible,options:this.props.transitionOptions,unmountOnExit:!0,onEnter:this.onEnter,onEntered:this.onEntered,onExiting:this.onExiting,onExited:this.onExited},l.default.createElement("div",{ref:this.dialogRef,id:this.state.id,className:t,style:this.props.style,onClick:this.props.onClick,role:"dialog","aria-labelledby":this.state.id+"_header","aria-describedby":this.state.id+"_content","aria-modal":this.props.modal},s,a,r,d)))}},{key:"render",value:function(){if(this.state.maskVisible){var e=this.renderElement();return l.default.createElement(s.Portal,{element:e,appendTo:this.props.appendTo,visible:!0})}return null}}])&&f(r.prototype,u),y&&f(r,y),Object.defineProperty(r,"prototype",{writable:!1}),x}(t.Component);return S={id:null,header:null,footer:null,visible:!1,position:"center",draggable:!0,resizable:!0,modal:!0,onHide:null,onShow:null,contentStyle:null,contentClassName:null,closeOnEscape:!0,dismissableMask:!1,rtl:!1,closable:!0,style:null,className:null,maskStyle:null,maskClassName:null,showHeader:!0,appendTo:null,baseZIndex:0,maximizable:!1,blockScroll:!1,icons:null,ariaCloseIconLabel:"Close",focusOnShow:!0,minX:0,minY:0,keepInViewport:!0,maximized:!1,breakpoints:null,transitionOptions:null,onMaximize:null,onDragStart:null,onDrag:null,onDragEnd:null,onResizeStart:null,onResize:null,onResizeEnd:null,onClick:null,onMaskClick:null},(w="defaultProps")in(x=L)?Object.defineProperty(x,w,{value:S,enumerable:!0,configurable:!0,writable:!0}):x[w]=S,e.Dialog=L,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.csstransition,primereact.ripple,primereact.portal,primereact.api);