!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={6989:e=>{e.exports=require("@mui/material/Box")},6368:e=>{e.exports=require("@mui/material/Button")},7413:e=>{e.exports=require("@mui/material/Divider")},909:e=>{e.exports=require("@mui/material/IconButton")},785:e=>{e.exports=require("@mui/material/Typography")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},2015:e=>{e.exports=require("react")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};r.r(o),r.d(o,{default:()=>U});var n=r(2015),i=r.n(n),a=r(6842),l=r.n(a);const s=require("@mui/material/styles");var u=r(6989),m=r.n(u),c=r(6368),p=r.n(c),d=r(7413),x=r.n(d),y=r(909),f=r.n(y);const v=require("@mui/material/ListItemIcon");var g=r.n(v);const h=require("@mui/material/ListItemText");var E=r.n(h);const b=require("@mui/material/Menu");var q=r.n(b);const S=require("@mui/material/MenuItem");var z=r.n(S),P=r(785),O=r.n(P);const j=require("@mui/icons-material/AccountCircle");var k=r.n(j);const L=require("@mui/icons-material/Logout");var T=r.n(L);const C=require("@mui/icons-material/Person");var I=r.n(C);const M=require("@mui/icons-material/Settings");var _=r.n(M);const w="UD7OIFgwF1LOfPJP234A",W="jWfqKg10xvcVZqMUgbLQ",U=({isLoggedUser:e,doLogin:t,initLogOut:r,profileEmail:o,profileName:a})=>{var u,c,d,y,v,h;const b=(0,s.useTheme)(),S=(0,n.useRef)(null),[P,j]=(0,n.useState)(!1),L=(null==b||null===(u=b.custom)||void 0===u||null===(c=u.menu)||void 0===c?void 0:c.fontSize)||"1.4rem",C=(null==b||null===(d=b.custom)||void 0===d||null===(y=d.menu)||void 0===y?void 0:y.lineHeight)||"2rem",M=(null==b||null===(v=b.custom)||void 0===v||null===(h=v.menu)||void 0===h?void 0:h.icon)||b.palette.text.secondary,U=()=>{j(!0)},B=()=>{j(!1)};return e?i().createElement(m(),{className:w},i().createElement(f(),{"aria-controls":P?"user-menu":void 0,"aria-expanded":P?"true":void 0,"aria-haspopup":"true",onClick:U,size:"medium","data-testid":"user-menu-button",sx:{color:b.palette.text.primary,p:0,width:28,height:28},ref:S},i().createElement(k(),{sx:{fontSize:28}})),i().createElement(q(),{id:"user-menu",anchorEl:S.current,open:P,onClose:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{mt:1.5,minWidth:260,borderRadius:2,overflow:"hidden",boxShadow:"0 16px 40px rgba(0, 0, 0, 0.18)"}},list:{disablePadding:!0,sx:{py:0}}}},i().createElement(m(),{sx:{px:3,py:2.5}},i().createElement(O(),{variant:"body1",sx:{fontSize:L,lineHeight:C,color:b.palette.text.primary,mb:.5}},a||"User"),i().createElement(O(),{variant:"body2",sx:{fontSize:L,lineHeight:C,color:b.palette.text.secondary}},o||"")),i().createElement(x(),null),i().createElement(z(),{onClick:B,sx:{py:1.5,px:3,gap:1.5}},i().createElement(g(),{sx:{minWidth:32,color:M}},i().createElement(_(),{sx:{fontSize:24}})),i().createElement(E(),{primary:l().translate("general.settings"),primaryTypographyProps:{sx:{fontSize:L,color:b.palette.text.primary}}})),i().createElement(z(),{onClick:B,sx:{py:1.5,px:3,gap:1.5}},i().createElement(g(),{sx:{minWidth:32,color:M}},i().createElement(I(),{sx:{fontSize:24}})),i().createElement(E(),{primary:l().translate("general.profile"),primaryTypographyProps:{sx:{fontSize:L,color:b.palette.text.primary}}})),i().createElement(x(),null),i().createElement(z(),{onClick:()=>{B(),r()},sx:{py:1.5,px:3,gap:1.5}},i().createElement(g(),{sx:{minWidth:32,color:M}},i().createElement(T(),{sx:{fontSize:24}})),i().createElement(E(),{primary:l().translate("buttons.sign_out"),primaryTypographyProps:{sx:{fontSize:L,color:b.palette.text.primary}}})))):i().createElement(m(),{className:W},i().createElement(p(),{variant:"contained",size:"small",color:"secondary",onClick:()=>{t()}},l().translate("buttons.log_in")))};return o})()));
//# sourceMappingURL=auth-button.js.map