import{a as j}from"./chunk-UXXY3WLS.mjs";import{a as w}from"./chunk-GO4IDWUK.mjs";import{a as N}from"./chunk-OOONPYJM.mjs";import{a as O}from"./chunk-E7WAJD3M.mjs";import{Suspense as Z,useState as oo}from"react";import{varHover as ro}from"@baseapp-frontend/design-system/components/web/animate";import{NotificationBellIcon as B}from"@baseapp-frontend/design-system/components/web/icons";import{useResponsive as eo}from"@baseapp-frontend/design-system/hooks/web";import{Badge as to,Drawer as io}from"@mui/material";import D from"@mui/material/IconButton";import{m as no}from"framer-motion";import{useFragment as ao,useLazyLoadQuery as lo}from"react-relay";import{jsx as a,Fragment as so,jsxs as co}from"react/jsx-runtime";function p(o){"@babel/helpers - typeof";return p=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},p(o)}var U=["onClose"];function S(o,r){var e=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);r&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),e.push.apply(e,t)}return e}function l(o){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?S(Object(e),!0).forEach(function(t){W(o,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(e)):S(Object(e)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(e,t))})}return o}function W(o,r,e){return(r=z(r))in o?Object.defineProperty(o,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[r]=e,o}function z(o){var r=K(o,"string");return p(r)=="symbol"?r:r+""}function K(o,r){if(p(o)!="object"||!o)return o;var e=o[Symbol.toPrimitive];if(e!==void 0){var t=e.call(o,r||"default");if(p(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(o)}function R(o,r){if(o==null)return{};var e,t,i=q(o,r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);for(t=0;t<n.length;t++)e=n[t],r.indexOf(e)===-1&&{}.propertyIsEnumerable.call(o,e)&&(i[e]=o[e])}return i}function q(o,r){if(o==null)return{};var e={};for(var t in o)if({}.hasOwnProperty.call(o,t)){if(r.indexOf(t)!==-1)continue;e[t]=o[t]}return e}function G(o,r){return Y(o)||X(o,r)||V(o,r)||J()}function J(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V(o,r){if(o){if(typeof o=="string")return _(o,r);var e={}.toString.call(o).slice(8,-1);return e==="Object"&&o.constructor&&(e=o.constructor.name),e==="Map"||e==="Set"?Array.from(o):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?_(o,r):void 0}}function _(o,r){(r==null||r>o.length)&&(r=o.length);for(var e=0,t=Array(r);e<r;e++)t[e]=o[e];return t}function X(o,r){var e=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(e!=null){var t,i,n,c,f=[],s=!0,d=!1;try{if(n=(e=e.call(o)).next,r===0){if(Object(e)!==e)return;s=!1}else for(;!(s=(t=n.call(e)).done)&&(f.push(t.value),f.length!==r);s=!0);}catch(m){d=!0,i=m}finally{try{if(!s&&e.return!=null&&(c=e.return(),Object(c)!==c))return}finally{if(d)throw i}}return f}}function Y(o){if(Array.isArray(o))return o}var uo=function(r){var e=r.Drawer,t=e===void 0?io:e,i=r.DrawerProps,n=i===void 0?{}:i,c=r.Badge,f=c===void 0?to:c,s=r.BadgeProps,d=s===void 0?{}:s,m=r.NotificationBellIcon,I=m===void 0?B:m,b=r.NotificationBellIconProps,L=b===void 0?{}:b,P=r.NotificationsList,x=P===void 0?j:P,g=r.NotificationsListProps,$=g===void 0?{}:g,A=oo(!1),h=G(A,2),C=h[0],y=h[1],T=lo(w,{},{fetchPolicy:"store-and-network"}),k=T.me,u=ao(O,k);N(u?.id);var E=eo("down","sm"),v=n.onClose,F=R(n,U);return co(so,{children:[a(D,{component:no.button,whileTap:"tap",whileHover:"hover",variants:ro(1.05),onClick:function(){return y(!0)},"aria-label":"see notifications",children:a(f,l(l({badgeContent:u?.notificationsUnreadCount,color:"error"},d),{},{children:a(I,l({color:"secondary"},L))}))}),a(t,l(l({anchor:E?"bottom":"right",open:C,onClose:function(M,Q){y(!1),v?.(M,Q)},sx:{"& .MuiDrawer-paper":{height:"100vh"}},PaperProps:{sx:{width:{xs:"100%",sm:390,md:420}}}},F),{},{children:a(x,l({setIsDrawerOpened:y},$))}))]})},fo=function(r){var e=r.NotificationBellIcon,t=e===void 0?B:e,i=r.NotificationBellIconProps,n=i===void 0?{}:i;return a(Z,{fallback:a(D,{disabled:!0,children:a(t,l({color:"secondary"},n))}),children:a(uo,l({},r))})},jo=fo;export{jo as a};
//# sourceMappingURL=chunk-VRH4MVR3.mjs.map