"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/extends"),t=require("@babel/runtime/helpers/taggedTemplateLiteral"),r=require("@babel/runtime/helpers/defineProperty"),o=require("@babel/runtime/helpers/objectWithoutProperties"),i=require("react"),n=require("react-transition-group"),a=require("clsx"),l=require("@prom-ui/core/Backdrop"),c=require("@prom-ui/core/Button"),d=require("@prom-ui/core/Icon"),u=require("@prom-ui/core/KeyPress"),s=require("@prom-ui/core/Portal"),p=require("@prom-ui/core/BodyProvider"),m=require("@prom-ui/icons/Close2");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function f(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var y,v=b(e),O=b(t),g=b(r),h=b(o),P=f(i),j=b(a),q={root:"_9vQ1b",closeButton:"_5HA1l",rootContent:"OXp7s",enter:"JQ0Kx",exit:"llwRD",enterActive:"p-g77",exitActive:"mioMB"},w=["isOpen","isRenderPortal","isBodyScrollLock","isShowCloseButton","zIndex","width","height","padding","onClose","className","style","children"];function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){g.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var B=function(e){var t=e.isOpen,r=void 0!==t&&t,o=e.isRenderPortal,i=void 0===o||o,a=e.isBodyScrollLock,b=void 0===a||a,f=e.isShowCloseButton,g=void 0===f||f,E=e.zIndex,B=void 0===E?5e3:E,C=e.width,S=void 0===C?"auto":C,k=e.height,_=void 0===k?"auto":k,D=e.padding,N=void 0===D?36:D,I=e.onClose,R=e.className,z=e.style,T=e.children,A=h.default(e,w),K=p.useBodyStoreTTag().t,L=P.useRef(null);return P.createElement(P.Fragment,null,P.createElement(l.Backdrop,{isOpen:r,zIndex:B,isRenderPortal:i,isBodyScrollLock:b}),P.createElement(n.CSSTransition,{nodeRef:L,in:r,timeout:240,classNames:q,unmountOnExit:!0},P.createElement(s.Portal,{isActive:i},P.createElement(u.KeyPress,{code:"Escape",onKeyDown:I}),P.createElement("div",{ref:L,className:q.root,role:"dialog","aria-modal":!0,"aria-labelledby":void 0,style:{zIndex:B},onClick:function(e){e.target===e.currentTarget&&I(e)},"data-qaid":A["data-qaid"]||"modal","data-testid":A["data-testid"]||"modal"},P.createElement("div",v.default({className:j.default(q.rootContent,R),style:x({width:S,height:_,padding:N},z)},A,{"data-qaid":"modal_content","data-testid":"modal_content"}),T,g&&P.createElement("div",{className:q.closeButton},P.createElement(c.Button,{"button-theme":"black-inherit","button-padding":"xxs",type:"button",onClick:I,"aria-label":K(y||(y=O.default(["Закрыть"]))),"data-qaid":"modal_close_button","data-testid":"modal_close_button"},P.createElement(d.Icon,{"icon-as":m.SvgClose2,style:{width:24,height:24}}))))))))};B.displayName="Modal",exports.Modal=B,require("./style.production.v2.css");
