"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-transition-group"),r=require("clsx"),o=require("@prom-ui/core/Backdrop"),n=require("@prom-ui/core/Button"),i=require("@prom-ui/core/Icon"),a=require("@prom-ui/core/KeyPress"),c=require("@prom-ui/core/Portal"),l=require("@prom-ui/core/useBodyTTag"),u=require("@prom-ui/icons/Close");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(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 p=d(e),f=s(r);function b(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 m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){y(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function y(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},v.apply(this,arguments)}function O(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var g,j={root:"_9vQ1b",closeButton:"_5HA1l",rootContent:"OXp7s",enter:"JQ0Kx",exit:"llwRD",enterActive:"p-g77",exitActive:"mioMB"},h=["isOpen","isRenderPortal","isBodyScrollLock","isShowCloseButton","zIndex","width","height","padding","onClose","className","style","children"],P=function(e){var r,s,d=e.isOpen,b=void 0!==d&&d,y=e.isRenderPortal,P=void 0===y||y,w=e.isBodyScrollLock,E=void 0===w||w,x=e.isShowCloseButton,S=void 0===x||x,q=e.zIndex,B=void 0===q?5e3:q,k=e.width,C=void 0===k?"auto":k,_=e.height,N=void 0===_?"auto":_,z=e.padding,D=void 0===z?36:z,I=e.onClose,T=e.className,A=e.style,K=e.children,M=O(e,h),R=l.useBodyTTag().t;return p.createElement(p.Fragment,null,p.createElement(o.Backdrop,{isOpen:b,zIndex:B,isRenderPortal:P,isBodyScrollLock:E}),p.createElement(t.CSSTransition,{in:b,timeout:240,classNames:j,unmountOnExit:!0},p.createElement(c.Portal,{isActive:P},p.createElement(a.KeyPress,{code:"Escape",onKeyDown:I}),p.createElement("div",{className:j.root,role:"dialog","aria-modal":!0,"aria-labelledby":void 0,style:{zIndex:B},onClick:function(e){e.target===e.currentTarget&&I(e)},"data-qaid":"modal","data-testid":"modal"},p.createElement("div",v({className:f.default(j.rootContent,T),style:m({width:C,height:N,padding:D},A)},M,{"data-qaid":"modal_content","data-testid":"modal_content"}),K,S&&p.createElement("div",{className:j.closeButton},p.createElement(n.Button,{"button-theme":"black-inherit","button-padding":"xxs",type:"button",onClick:I,"aria-label":R(g||(r=["Закрыть"],s||(s=r.slice(0)),g=Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(s)}})))),"data-qaid":"modal_close_button","data-testid":"modal_close_button"},p.createElement(i.Icon,{"icon-as":u.SvgClose,style:{width:24,height:24}}))))))))};P.displayName="Modal",exports.Modal=P,require("./style.production.v2.css");
