"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/extends"),t=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/objectWithoutProperties"),o=require("react"),n=require("clsx"),i=require("react-transition-group"),c=require("@prom-ui/core/Portal"),u=require("@prom-ui/core/useForwardRef");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(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 l=a(e),f=a(t),p=a(r),d=s(o),b=a(n),m={root:"KYIW0",content:"F8zNR","root_position_top-center":"I5Lmf","root_position_bottom-center":"QB4Ps","root_position_top-left":"QJETh","root_position_top-right":"vHlAp","root_position_bottom-left":"cU3cS","root_position_bottom-right":"dlDmS",enterActive:"mLVVo",exitActive:"_5JFKS",enter:"Rlx0S",exit:"B32cZ"},y=["isOpen","onClose","onOpened","onClosed","children","className","style","position","zIndex","padding","autoCloseDelay","isRenderPortal"];function O(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 v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){f.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j=d.forwardRef((function(e,t){var r=e.isOpen,o=e.onClose,n=e.onOpened,a=e.onClosed,s=e.children,f=e.className,O=e.style,j=e.position,P=void 0===j?"bottom-center":j,g=e.zIndex,_=void 0===g?5e3:g,h=e.padding,x=void 0===h?"12px 16px":h,E=e.autoCloseDelay,q=void 0===E?2e3:E,w=e.isRenderPortal,R=void 0===w||w,S=p.default(e,y),C=u.useForwardRef(t,null),D=d.useRef(!1),N=d.useRef(void 0),k=P?m["root_position_".concat(P)]:void 0,z=function(){clearTimeout(N.current)},A=function(){D.current=!1,z(),q>0&&(N.current=setTimeout((function(){D.current=!0,"function"==typeof o&&o()}),q))},I=function(){z()},B=function(){"function"==typeof n&&n(),A()};return d.useEffect((function(){return r&&B(),function(){I()}}),[]),d.createElement(i.CSSTransition,{nodeRef:C,in:r,timeout:125,classNames:m,unmountOnExit:!0,onEntered:B,onExit:I,onExited:function(){"function"==typeof a&&a({isAutoClose:D.current})}},d.createElement(c.Portal,{isActive:R},d.createElement("div",l.default({className:b.default(m.root,k),ref:C,style:{zIndex:_},role:"presentation","data-testid":"snackbar","data-qaid":"snackbar","data-pds-color-scheme":"light"},S),d.createElement("div",{className:b.default(m.content,f),style:v({padding:x},O),role:"alert",onMouseEnter:z,onMouseLeave:A},s))))}));j.displayName="SnackBar",exports.SnackBar=j,require("./style.production.v2.css");
