!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={3081:(e,r,t)=>{t.d(r,{A:()=>a,o:()=>s});var o=t(2015);const n=(0,o.createContext)(null),s=()=>(0,o.useContext)(n),a=n},5097:(e,r,t)=>{t(1116),t(6842),t(9087),t(9558),t(2183)},2183:(e,r,t)=>{t(9558),t(5812),t(806);const o=require("browser-tabs-lock");var n=t.n(o);require("js-cookie");t(8041),t(9891),t(5097),t(8853);new(n())},9087:(e,r,t)=>{t.d(r,{clearSnackbarMessage:()=>a});t(2462),t(1116),t(806);var o=t(8041),n=t.n(o);t(9236),t(6842),t(9558),t(5097),t(2183),t(3209);n().escapeQuerySpace=!1;const s=e=>r=>({type:e,payload:r}),a=(s("RESET_LOADING"),s("START_LOADING"),s("STOP_LOADING"),()=>e=>{e(s("CLEAR_SNACKBAR_MESSAGE")({}))})},3209:(e,r,t)=>{t.d(r,{UE:()=>o});const o=2e3},8853:()=>{require("spark-md5"),require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto)},9558:(e,r,t)=>{t.d(r,{empty:()=>o});t(5812),t(8041);const o=e=>null==e||("string"==typeof e?0===e.trim().length:Array.isArray(e)?0===e.length:"object"==typeof e&&0===Object.keys(e).length)},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8177:e=>{e.exports=require("@mui/icons-material/CheckCircle")},1519:e=>{e.exports=require("@mui/icons-material/Error")},8619:e=>{e.exports=require("@mui/material")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9891:e=>{e.exports=require("idtoken-verifier")},5812:e=>{e.exports=require("moment-timezone")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")},2544:e=>{e.exports=require("react-redux")},806:e=>{e.exports=require("superagent/lib/client")},9236:e=>{e.exports=require("sweetalert2")},8041:e=>{e.exports=require("urijs")}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var s=r[o]={exports:{}};return e[o](s,s.exports,t),s.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};t.r(o),t.d(o,{default:()=>h,useSnackbarMessage:()=>m.o});var n=t(2015),s=t.n(n),a=t(2544),i=t(9825),c=t.n(i),u=t(8619),p=t(8177),l=t.n(p),d=t(1519),y=t.n(d),m=t(3081),b=t(3209),f=t(9558),g=t(9087);const x=({children:e,snackbarMessage:r,clearSnackbarMessage:t})=>{const[o,a]=(0,n.useState)(!1),[i,c]=(0,n.useState)({}),p=e=>c({html:e,type:"success"}),d=e=>c({html:e,type:"warning"}),g=(0,n.useMemo)((()=>({successMessage:p,errorMessage:d})),[]),x=()=>{a(!1)};return(0,n.useEffect)((()=>{(0,f.empty)(i.html)||a(!0)}),[i]),(0,n.useEffect)((()=>{(0,f.empty)(null==r?void 0:r.html)||c(r)}),[r]),s().createElement(m.A.Provider,{value:g},s().createElement(u.Snackbar,{open:o,onClose:x,slotProps:{transition:{onExited:()=>{(()=>{t(),c({})})()}}},anchorOrigin:{vertical:"top",horizontal:"center"},autoHideDuration:b.UE},s().createElement(u.Alert,{onClose:x,severity:i.type,variant:"filled",sx:{width:"100%",backgroundColor:`${i.type}.light`},iconMapping:{success:s().createElement(l(),{fontSize:"inherit"}),error:s().createElement(y(),{fontSize:"inherit"})}},s().createElement(u.Typography,{variant:"body1",component:"div",dangerouslySetInnerHTML:{__html:i.html}}))),e)};x.propTypes={children:c().node,snackbarMessage:c().object};const h=(0,a.connect)((({baseState:e})=>({snackbarMessage:e.snackbarMessage})),{clearSnackbarMessage:g.clearSnackbarMessage})(x);return o})()));
//# sourceMappingURL=snackbar-notification.js.map