import{a as b}from"./chunk-ZYWQRMBI.mjs";import{a as d}from"./chunk-NAS5LN2B.mjs";import{useCurrentProfile as D}from"@baseapp-frontend/authentication";import{AvatarWithPlaceholder as M}from"@baseapp-frontend/design-system/components/web/avatars";import{CheckMarkIcon as E}from"@baseapp-frontend/design-system/components/web/icons";import{Box as W,Typography as P}from"@mui/material";import{useFragment as A}from"react-relay";import{jsx as a,jsxs as g}from"react/jsx-runtime";function l(e){"@babel/helpers - typeof";return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},l(e)}function h(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function $(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?h(Object(t),!0).forEach(function(o){C(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function C(e,r,t){return(r=I(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function I(e){var r=k(e,"string");return l(r)=="symbol"?r:r+""}function k(e,r){if(l(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var o=t.call(e,r||"default");if(l(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var F=function(r){var t,o,n,f,u,j=r.profileRef,O=r.onProfileChange,p=r.avatarProps,w=p===void 0?{}:p,m=r.width,x=m===void 0?36:m,s=r.height,S=s===void 0?36:s,_=D(),c=_.currentProfile,i=A(d,j);if(!i)return null;var v=(t=i.urlPath)===null||t===void 0?void 0:t.path,y=i.id===c?.id;return g(b,{tabIndex:0,active:y,onClick:function(){return O(i)},"aria-label":"Switch to ".concat((o=i.name)!==null&&o!==void 0?o:"this profile"),children:[a(M,$({width:x,height:S,src:(n=(f=i.image)===null||f===void 0?void 0:f.url)!==null&&n!==void 0?n:"",alt:"Profile avatar",color:"secondary"},w)),g(W,{display:"flex",flexDirection:"column",flexGrow:1,overflow:"hidden",children:[a(P,{component:"p",variant:"subtitle2",noWrap:!0,children:(u=i.name)!==null&&u!==void 0?u:""}),v&&a(P,{variant:"subtitle2",sx:{color:"text.secondary"},noWrap:!0,children:v})]}),y&&a(E,{sx:{fontSize:24}})]})},H=F;export{H as a};
//# sourceMappingURL=chunk-BCDOL5MA.mjs.map