1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4455,6067,4708],{37631:function(e,t,r){r.d(t,{U:function(){return a}});var i=r(57437),n=r(60033),o=r(45964);function a(e){let t,r,{date:a,title:l,showJustDate:s=!1,showTime:d=!0,formatStyle:c="medium",timeFormat:u="24h",position:p="center",className:x=""}=e,h=()=>{try{let{getCurrentLanguage:e}=(0,n.i)(),t=e();return({en:"en-US",es:"es-ES",fr:"fr-FR",de:"de-DE",it:"it-IT",pt:"pt-BR",ru:"ru-RU",zh:"zh-CN",ja:"ja-JP",ko:"ko-KR",ar:"ar-SA",hi:"hi-IN"})[t]||t||"en-US"}catch(e){if("undefined"!=typeof navigator&&navigator.language)return navigator.language;return"en-US"}},m=()=>{let e={year:"numeric",month:"short"===c?"2-digit":"long",day:"2-digit"};switch(d&&!s&&(e.hour="2-digit",e.minute="2-digit",e.hour12="12h"===u,"full"===c&&(e.second="2-digit")),c){case"short":return{year:"2-digit",month:"2-digit",day:"2-digit",...d&&!s&&{hour:"2-digit",minute:"2-digit",hour12:"12h"===u}};case"medium":default:return e;case"long":return{...e,weekday:"long",...d&&!s&&{hour:"2-digit",minute:"2-digit",hour12:"12h"===u}};case"full":return{...e,weekday:"long",...d&&!s&&{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:"12h"===u}}}},f=e=>e.startsWith("en"),g=h();return a&&(f(g)?(t=(e=>{try{let t=new Date(e);if(Number.isNaN(t.getTime()))return"Invalid Date";return new Intl.DateTimeFormat("en",{day:"2-digit",month:"short",year:"numeric"}).format(t)}catch(e){return"Invalid Date"}})(a),d&&!s&&(r=(e=>{try{let t=new Date(e);if(Number.isNaN(t.getTime()))return"Invalid Date";return new Intl.DateTimeFormat("en",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(t)}catch(e){return"Invalid Date"}})(a))):t=(e=>{try{let t=new Date(e);if(Number.isNaN(t.getTime()))return"Invalid Date";let r=h(),i=m();return new Intl.DateTimeFormat(r,i).format(t)}catch(e){return"Invalid Date"}})(a)),(0,i.jsxs)("section",{className:"flex w-full flex-col sm:flex-row content-center items-center justify-".concat(p," gap-1"),children:[l&&(0,i.jsxs)(o.Z,{className:"agents-label ".concat(x),children:[l,":"]}),a&&f(g)?(0,i.jsx)("div",{className:"flex flex-row ".concat(x," bg-[#232b3b] border border-[#232b3b] rounded-lg overflow-hidden p-0"),children:(0,i.jsxs)(o.Z,{className:"agents-label !bg-transparent !border-none !rounded-none !m-0 !px-3 !py-1 flex items-center",children:[d&&!s&&r?"".concat(r," "):"",t]})}):a&&(0,i.jsx)(o.Z,{className:"agents-label ".concat(x),children:t})]})}},45964:function(e,t,r){r.d(t,{Z:function(){return c}});var i=r(57437),n=r(2265),o=r(1899),a=r(31691),l=r(16210),s=r(88064);let d=(0,l.ZP)(o.Z)(e=>{let{theme:t,ownerState:r}=e,i="light"===t.palette.mode,n="filled"===r.variant,o="outlined"===r.variant,a="soft"===r.variant,l={..."default"===r.color&&{...n&&{color:i?t.palette.common.white:t.palette.grey[800],backgroundColor:t.palette.text.primary},...o&&{backgroundColor:"transparent",color:t.palette.text.primary,border:"2px solid ".concat(t.palette.text.primary)},...a&&{color:t.palette.text.secondary,backgroundColor:(0,s.Fq)(t.palette.grey[500],.16)}}},d={..."default"!==r.color&&{...n&&{color:t.palette[r.color].contrastText,backgroundColor:t.palette[r.color].main},...o&&{backgroundColor:"transparent",color:t.palette[r.color].main,border:"2px solid ".concat(t.palette[r.color].main)},...a&&{color:t.palette[r.color][i?"dark":"light"],backgroundColor:(0,s.Fq)(t.palette[r.color].main,.16)}}};return{height:24,minWidth:24,lineHeight:0,borderRadius:6,cursor:"default",alignItems:"center",whiteSpace:"nowrap",display:"inline-flex",justifyContent:"center",textTransform:"capitalize",padding:t.spacing(0,.75),fontSize:t.typography.pxToRem(12),fontWeight:t.typography.fontWeightBold,transition:t.transitions.create("all",{duration:t.transitions.duration.shorter}),...l,...d}});var c=(0,n.forwardRef)((e,t)=>{let{children:r,color:n="default",variant:l="soft",startIcon:s,endIcon:c,sx:u,...p}=e,x=(0,a.Z)(),h={width:16,height:16,"& svg, img":{width:1,height:1,objectFit:"cover"}};return(0,i.jsxs)(d,{ref:t,component:"span",ownerState:{color:n,variant:l},sx:{...s&&{pl:.75},...c&&{pr:.75},...u},theme:x,...p,children:[s&&(0,i.jsxs)(o.Z,{sx:{mr:.75,...h},children:[" ",s," "]}),r,c&&(0,i.jsxs)(o.Z,{sx:{ml:.75,...h},children:[" ",c," "]})]})})},54455:function(e,t,r){r.r(t),r.d(t,{DockedNotificationsDrawer:function(){return ee},default:function(){return et}});var i=r(57437),n=r(60033),o=r(2265),a=r(29827),l=r(36767),s=r(70203),d=r
1(33833),c=r(50290),u=r(59062),p=r(19643),x=r(63242),h=r(31691),m=r(95576),f=r(82156),g=r(46387),v=r(1899),y=r(8350),b=r(76975),j=r(16539);let w=e=>{let{drawerContent:t,heading:r,append:n,onClose:o,open:a,isChat:l=!1}=e,s=(0,h.Z)(),d=(0,f.Z)(s.breakpoints.up("sm")),c=(0,f.Z)("(max-width:640px)"),u=d?j.pG:"100%";return(0,i.jsxs)(x.ZP,{sx:{width:u,flexShrink:0,...d&&{position:"fixed",left:a?0:-j.pG,top:0},"& .MuiDrawer-paper":{width:u,display:"flex",flexDirection:"column"}},variant:"persistent",anchor:"right",open:a,children:[(0,i.jsxs)(p.Z,{direction:"row",alignItems:"center",justifyContent:"flex-start",padding:s.spacing(0,1),paddingY:l?1:0,sx:{height:d?"".concat(j.yf.H_DESKTOP,"px"):"".concat(j.yf.H_MOBILE,"px")},children:[(0,i.jsx)(g.Z,{variant:"h3",ml:1,children:r}),n&&(0,i.jsx)(v.Z,{ml:1,mr:"auto",children:n}),(0,i.jsx)(m.Z,{onClick:o,children:(0,i.jsx)(b.Z,{width:30,icon:"solar:close-circle-linear"})})]}),(0,i.jsx)(y.Z,{}),(0,i.jsx)(v.Z,{sx:{flex:1,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:t}),c?(0,i.jsx)(v.Z,{"aria-hidden":!0,sx:{flexShrink:0,pb:"max(8px, env(safe-area-inset-bottom, 0px))"}}):null]})};var Z=r(81457),C=r(81380),k=r(16210),N=r(10207),S=r(73904);let I=(0,k.ZP)(N.Z)(e=>{let{theme:t}=e;return{borderRadius:t.shape.borderRadius,textTransform:"none",minHeight:0,padding:"5px","&.Mui-selected":{backgroundColor:t.palette.secondary.main,color:t.palette.common.white},"&:not(.Mui-selected)":{border:"2px solid ".concat(t.palette.secondary.main),color:t.palette.grey[400]}}});var E=e=>{var t,r;let{value:a,handleTabChange:l}=e,{t:s}=(0,n.i)(),{onUpdate:d}=(0,u.K$)(),{data:c}=(0,Z.kN)({type:"platform",filter:"all"}),{data:p}=(0,Z.kN)({type:"personal",filter:"all"}),[x,h]=(0,o.useState)(!1),m=null!==(t=null==c?void 0:c.unreadCount)&&void 0!==t?t:0,f=null!==(r=null==p?void 0:p.unreadCount)&&void 0!==r?r:0;(0,o.useEffect)(()=>{let e=m>0||f>0;e!==x&&(h(e),d("hasUnreadNotification",e))},[m,f,x,d]);let g=0===m?"":"(".concat(m,")"),y=0===f?"":"(".concat(f,")");return(0,i.jsx)(v.Z,{sx:{display:"flex",justifyContent:"space-around"},children:(0,i.jsxs)(S.Z,{value:a,onChange:l,TabIndicatorProps:{style:{display:"none"}},children:[(0,i.jsx)(I,{label:"".concat(s("notifications.platform")).concat(g&&g),value:"1"}),(0,i.jsx)(I,{label:"".concat(s("notifications.personal")).concat(y&&y),value:"2"})]})})},T=r(68621),D=r(47080),P=r(743),O=r(33145),R=r(68575),W=r(37631),A=r(83442),_=r(57871),L=r(89902),F=r(73053),z=r(97312),H=r(36067);let K=e=>{var t,r,l,s,d,c,u,x,h;let{notification:m,type:f,templatesMap:y,requestExpandSystemNo:j,onExpandRequestConsumed:w}=e,{t:C,getLang:k}=(0,n.i)(),{mutate:N}=(0,Z.YK)(),{showMessage:S}=(0,H.useSnackbar)(),I=(0,a.NL)(),[E,T]=(0,o.useState)(!1),D=(0,o.useRef)(null),P=(0,o.useRef)(!1),K=k(),M=!!m.templateId,U=(0,R.v9)(e=>e.user.data),q=(0,R.v9)(e=>e.userCurrencies),B=M?y.get(null!==(t=m.templateId)&&void 0!==t?t:""):void 0,{data:V,isLoading:Q,needsFetch:$}=(0,A.P)(m,{enabled:E,locale:K}),X=function(e){var t,r,i;if(!(null==e?void 0:e.attributes.coverImage))return null;let n=e.attributes.coverImage;return"string"==typeof n?n:null!==(i=null===(r=n.data)||void 0===r?void 0:null===(t=r.attributes)||void 0===t?void 0:t.url)&&void 0!==i?i:null}(B)||"https://img.xyes.com/uploads/Private_notification_dc6785c211.png",G=B?B.attributes.details:null!==(r=m.content)&&void 0!==r?r:"",Y=null!==(l=null==B?void 0:B.attributes.title)&&void 0!==l?l:m.title,J=M&&m.templateProperties?m.templateProperties:void 0,ee={"First.Name":null!==(d=null!==(s=null==U?void 0:U.name)&&void 0!==s?s:null==U?void 0:U.memberUsername)&&void 0!==d?d:"",Email:null!==(c=null==U?void 0:U.email)&&void 0!==c?c:"","USD.Exchange.nextValue":null!==(u=null==U?void 0:U.settings.view_in_fiat_object.currency)&&void 0!==u?u:"USD"},et={templateProperties:J,transaction:$&&V?V:void 0,mergeTags:ee,currencyList:q,userData:U||void 0},er=(0,_.Es)(Y,et),ei=(0,_.Es)(G,et),en=!m.isRead,eo=null!==(h=null!==(x=m.publishedAt)&&void 0!==x?x:m.createdAt)&&void 0!==h?h:"",ea=(0,o.useCallback)(()=>{let e=!E;T(e),e&&en&&(N({notificationSystemNo:m.systemNo,type:f},{onError:()=>{S(C("errors.anErrorOccurred"),"error")}}),I.invalidateQueries({queryKey:["notificationsV2"]}))},[E,en,N,m.systemNo,f,S,C,I]);(0,o.useEffect)(()=>
1{if(!j){P.current=!1;return}String(j)===String(m.systemNo)&&(P.current||(P.current=!0,T(!0),en&&(N({notificationSystemNo:m.systemNo,type:f},{onError:()=>{S(C("errors.anErrorOccurred"),"error")}}),I.invalidateQueries({queryKey:["notificationsV2"]})),requestAnimationFrame(()=>{var e;null===(e=D.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"})}),null==w||w()))},[j,m.systemNo,en,N,f,S,C,I,w]);let el=async()=>{en&&(N({notificationSystemNo:m.systemNo,type:f},{onError:()=>{S(C("errors.anErrorOccurred"),"error")}}),I.invalidateQueries({queryKey:["notificationsV2"]}))};return M&&!B?null:(0,i.jsxs)(p.Z,{ref:D,direction:"column",sx:{width:"100%",boxSizing:"border-box",borderRadius:2,overflow:"hidden",border:"1px solid",borderColor:"divider",bgcolor:"background.paper",transition:"all 0.3s","&:hover":{borderColor:"primary.main",boxShadow:"0 0 20px rgba(249,115,22,0.08)"},...en&&{borderLeft:"2px solid",borderLeftColor:"primary.main"}},children:[(0,i.jsxs)(v.Z,{component:"div",onClick:ea,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),ea())},role:"button",tabIndex:0,"aria-expanded":E,"aria-label":E?C("notifications.collapse"):C("notifications.details"),sx:{position:"relative",aspectRatio:"16/6",width:"100%",overflow:"hidden",cursor:"pointer",bgcolor:X?"transparent":"grey.800"},children:[X?(0,i.jsx)(O.default,{src:X,alt:er,fill:!0,style:{objectFit:"cover",transition:"transform 0.5s"},sizes:"(max-width: 400px) 100vw, 400px"}):null,(0,i.jsx)(v.Z,{sx:{position:"absolute",inset:0,background:"linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%)"}}),en&&(0,i.jsx)(L.Z,{label:C("notifications.new"),color:"primary",size:"small",sx:{position:"absolute",top:12,right:12,fontWeight:600,boxShadow:"0 2px 8px rgba(249,115,22,0.25)"}}),(0,i.jsx)(v.Z,{sx:{position:"absolute",bottom:0,left:0,right:0,p:2},children:(0,i.jsx)(g.Z,{variant:"subtitle1",sx:{color:"white",fontWeight:600,lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textShadow:"0 1px 2px rgba(0,0,0,0.5)"},children:er})})]}),(0,i.jsxs)(p.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{px:1.5,py:.75,bgcolor:"action.hover"},children:[(0,i.jsxs)(p.Z,{direction:"row",alignItems:"center",spacing:.75,children:[(0,i.jsx)(b.Z,{icon:"solar:clock-circle-linear",width:12,sx:{color:"text.secondary"}}),(0,i.jsx)(g.Z,{variant:"caption",color:"text.secondary",sx:{fontSize:"0.7rem"},children:(0,i.jsx)(W.U,{date:eo,formatStyle:"short",showJustDate:!0})})]}),(0,i.jsx)(v.Z,{component:"button",type:"button",onClick:ea,sx:{display:"inline-flex",alignItems:"center",gap:.5,borderRadius:"9999px",px:1,py:.375,minHeight:26,height:26,fontSize:"0.6875rem",fontWeight:500,lineHeight:1,fontFamily:"inherit",border:"1px solid",borderColor:"primary.main",color:E?"primary.contrastText":"primary.main",bgcolor:E?"primary.main":"transparent",cursor:"pointer","&:hover":{borderColor:"primary.dark",bgcolor:"primary.main",color:"primary.contrastText"}},children:E?C("notifications.collapse"):C("notifications.details")})]}),(0,i.jsx)(v.Z,{sx:{maxHeight:E?"none":0,overflow:E?"visible":"hidden",overflowX:"hidden",opacity:E?1:0,transition:"opacity 0.25s ease-in-out"},children:(0,i.jsxs)(v.Z,{sx:{px:1.5,py:1.25,borderTop:"1px solid",borderColor:"divider"},children:[$&&Q?(0,i.jsxs)(p.Z,{alignItems:"center",justifyContent:"center",sx:{py:2},spacing:2,children:[(0,i.jsx)(F.Z,{size:32,color:"primary"}),(0,i.jsx)(g.Z,{variant:"body2",color:"text.secondary",children:C("general.loading")})]}):ei&&(0,i.jsx)(v.Z,{sx:{fontSize:"14px",color:"text.secondary",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word","& > *":{maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word"},"& p, & div, & span, & pre":{maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"pre-wrap"}},children:(0,i.jsx)(_.lR,{content:ei,mergeTags:ee})}),!Q&&(0,i.jsx)(p.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{mt:1.25},children:m.link&&(0,i.jsxs)(z.Z,{href:m.link,sx:{display:"flex",alignItems:"center"},color:"info.main",onClick:el,children:[C("notifications.joinBattle"),(0,i.jsx)(b.Z,{icon:"material-symbols:chevron-right"})]})})]})})]},m.systemNo)},M=e=>{let{type:t}=e,{t:r}=(0,n.i)();return(0,i.jsx)(g.Z,{component:"div",variant:"body2",sx:{width:"100%",position:"absolute",top:"40%",left:"50%",transform:"translateX(-50%)",textAlign:"center",display:"flex",gap:1,alignItems:"start",justifyContent:"center",px:4,color:"grey.500"},children:r("notifications.empty",{type:t})})};
1var U=r(44811);let q=e=>{let{type:t,refetch:r}=e,{t:o}=(0,n.i)();return(0,i.jsx)(v.Z,{sx:{display:"block"},children:(0,i.jsxs)(g.Z,{component:"div",variant:"body2",sx:{width:"100%",position:"absolute",top:"40%",left:"50%",transform:"translateX(-50%)",textAlign:"center",display:"grid",gap:1,alignItems:"start",justifyContent:"center",px:4,color:"grey.500"},children:[o("notifications.errorLoadingNotifications"),(0,i.jsx)(U.Z,{size:"small",onClick:()=>r(),color:"inherit",variant:"outlined",startIcon:(0,i.jsx)(b.Z,{icon:"material-symbols:refresh"}),sx:{fontSize:"12px",height:"30px"},children:o("actions.retry")})]})})},B=e=>{switch(e){case"unread":return"unread";case"read":return"read";default:return"all"}},V=e=>{var t;let{type:r,selectedOption:i,page:n=1,limit:a=20}=e,l=B(i),{data:s,isSuccess:d,error:c,refetch:u,isLoading:p}=(0,Z.kN)({type:r,page:n,limit:a,filter:l});return{filteredNotifications:(0,o.useMemo)(()=>{var e;return null!==(e=null==s?void 0:s.notifications)&&void 0!==e?e:[]},[s]),pagination:(0,o.useMemo)(()=>s?{page:s.page,limit:s.limit,totalPages:s.totalPages,totalDocuments:s.totalDocuments,unreadCount:s.unreadCount,readCount:s.readCount}:null,[s]),isSuccess:d,error:c,refetch:u,isLoadingNotifications:p,unreadCount:null!==(t=null==s?void 0:s.unreadCount)&&void 0!==t?t:0}},Q=()=>(0,i.jsx)(p.Z,{direction:"column",spacing:3,children:[1,2,3].map(e=>(0,i.jsxs)(v.Z,{sx:{borderRadius:2,overflow:"hidden"},children:[(0,i.jsx)(D.Z,{variant:"rectangular",height:120,animation:"wave"}),(0,i.jsxs)(v.Z,{sx:{px:2,py:1.5,display:"flex",justifyContent:"space-between"},children:[(0,i.jsx)(D.Z,{variant:"text",width:120}),(0,i.jsx)(D.Z,{variant:"rounded",width:80,height:28})]})]},e))});var $=e=>{let{selectedOption:t,page:r,onPageChange:n,templatesMap:s,isLoadingTemplates:d,expandPersonalSystemNo:c}=e,{onUpdate:x}=(0,u.K$)(),h=(0,o.useCallback)(()=>{x("notificationsExpandSystemNo",void 0)},[x]),{filteredNotifications:m,pagination:f,isSuccess:g,error:v,refetch:y,isLoadingNotifications:b}=V({type:"personal",selectedOption:t,page:r,limit:20}),j=d||b,w=(0,a.NL)(),{lastMessage:Z}=(0,l.useWebSocketContext)();return(0,o.useEffect)(()=>{n(1)},[t,n]),(0,o.useEffect)(()=>{var e,t;(null==Z?void 0:Z.type)==="NOTIFICATION"&&(null===(t=Z.payload)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.type)==="PRIVATE"&&(y(),w.invalidateQueries({queryKey:["cmsAllNotificationTemplates"]}))},[Z,y,w]),(0,o.useEffect)(()=>{var e;!c||j||!g||m.some(e=>String(e.systemNo)===String(c))||(r<(null!==(e=null==f?void 0:f.totalPages)&&void 0!==e?e:1)?n(r+1):x("notificationsExpandSystemNo",void 0))},[c,m,j,g,r,null==f?void 0:f.totalPages,n,x]),(0,i.jsxs)(T.Z,{value:"2",children:[v&&(0,i.jsx)(q,{type:"personal",refetch:y}),!v&&j&&(0,i.jsx)(Q,{}),!v&&!j&&g&&m.length>0&&(0,i.jsxs)(p.Z,{direction:"column",spacing:3,children:[m.map(e=>{var t;return(0,i.jsx)(K,{notification:e,type:"personal",templatesMap:s,requestExpandSystemNo:c,onExpandRequestConsumed:h},null!==(t=e._id)&&void 0!==t?t:String(e.systemNo))}),f&&f.totalPages>1&&(0,i.jsx)(p.Z,{alignItems:"center",sx:{py:2},children:(0,i.jsx)(P.Z,{count:f.totalPages,page:r,onChange:(e,t)=>
1n(t),color:"primary"})})]}),!v&&!j&&g&&0===m.length&&(0,i.jsx)(M,{type:"personal"})]})};let X=()=>(0,i.jsx)(p.Z,{direction:"column",spacing:3,children:[1,2,3].map(e=>(0,i.jsxs)(v.Z,{sx:{borderRadius:2,overflow:"hidden"},children:[(0,i.jsx)(D.Z,{variant:"rectangular",height:120,animation:"wave"}),(0,i.jsxs)(v.Z,{sx:{px:2,py:1.5,display:"flex",justifyContent:"space-between"},children:[(0,i.jsx)(D.Z,{variant:"text",width:120}),(0,i.jsx)(D.Z,{variant:"rounded",width:80,height:28})]})]},e))});var G=e=>{let{selectedOption:t,page:r,onPageChange:n,templatesMap:s,isLoadingTemplates:d}=e,{filteredNotifications:c,pagination:x,isSuccess:h,error:m,refetch:f,unreadCount:g,isLoadingNotifications:v}=V({type:"platform",selectedOption:t,page:r,limit:20}),y=d||v,b=(0,a.NL)(),{onUpdate:j}=(0,u.K$)(),{lastMessage:w}=(0,l.useWebSocketContext)();return(0,o.useEffect)(()=>{n(1)},[t,n]),(0,o.useEffect)(()=>{j("hasUnreadNotification",g>0)},[g,j]),(0,o.useEffect)(()=>{var e,t;(null==w?void 0:w.type)==="NOTIFICATION"&&(null===(t=w.payload)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.type)==="PUBLIC"&&(f(),b.invalidateQueries({queryKey:["cmsAllNotificationTemplates"]}))},[w,f,b]),(0,i.jsxs)(T.Z,{value:"1",children:[m&&(0,i.jsx)(q,{type:"platform",refetch:f}),!m&&y&&(0,i.jsx)(X,{}),!m&&!y&&h&&c.length>0&&(0,i.jsxs)(p.Z,{direction:"column",spacing:3,children:[c.map(e=>{var t;return(0,i.jsx)(K,{notification:e,type:"platform",templatesMap:s},null!==(t=e._id)&&void 0!==t?t:String(e.systemNo))}),x&&x.totalPages>1&&(0,i.jsx)(p.Z,{alignItems:"center",sx:{py:2},children:(0,i.jsx)(P.Z,{count:x.totalPages,page:r,onChange:(e,t)=>
1n(t),color:"primary"})})]}),!m&&!y&&h&&0===c.length&&(0,i.jsx)(M,{type:"platform"})]})},Y=r(97631),J=e=>{let{selectedOption:t,initialTab:r,onTabSynced:a,expandPersonalSystemNo:l}=e,{getLang:s}=(0,n.i)(),{templatesMap:d,isLoading:c}=(0,C.L)({locale:s(),fallbackLocale:"en"}),[u,p]=(0,o.useState)(null!=r?r:"1"),[x,h]=(0,o.useState)(1),{t:m}=(0,n.i)(),{showMessage:f}=(0,H.useSnackbar)(),{mutate:j}=(0,Z.si)();(0,o.useEffect)(()=>{"2"===r&&(p("2"),h(1),null==a||a())},[r,a]),(0,o.useEffect)(()=>{l&&(p("2"),h(1))},[l]);let w=async()=>{j({type:"1"===u?"platform":"personal"},{onError:()=>{f(m("errors.anErrorOccurred"),"error")}})};return(0,i.jsx)(v.Z,{sx:{width:"100%",height:"100%",position:"relative",py:2},overflow:"hidden",children:(0,i.jsxs)(Y.ZP,{value:u,children:[(0,i.jsx)(E,{value:u,handleTabChange:(e,t)=>{p(t),h(1)}}),(0,i.jsx)(v.Z,{height:"calc(100% - ".concat(112,"px)"),sx:{overflowY:"auto",overflowX:"hidden","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{backgroundColor:"#f0f0f0",borderRadius:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#888888",borderRadius:"8px"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:"#555"}},children:"1"===u?(0,i.jsx)(G,{selectedOption:t,page:x,onPageChange:h,templatesMap:d,isLoadingTemplates:c}):(0,i.jsx)($,{selectedOption:t,page:x,onPageChange:h,templatesMap:d,isLoadingTemplates:c,expandPersonalSystemNo:l})}),(0,i.jsx)(y.Z,{"aria-hidden":!0,orientation:"horizontal",flexItem:!0,variant:"fullWidth",sx:{mt:2,mb:1}}),(0,i.jsx)(v.Z,{component:"div",sx:{display:"flex",justifyContent:"center",py:1},children:(0,i.jsx)(U.Z,{variant:"outlined",sx:{border:"none","&:hover":{border:"none"}},color:"inherit",size:"small",onClick:w,children:(0,i.jsxs)(g.Z,{component:"div",sx:{display:"flex",alignItems:"center"},variant:"body2",color:"grey.400",ml:"auto",children:[m("notifications.markAllAsRead"),(0,i.jsx)(b.Z,{icon:"charm:tick-double",sx:{ml:.5}})]})})})]})})};let ee=()=>{let{isNotificationsDrawerOpen:e,onUpdate:t,notificationsDrawerOpenWith:r,notificationsExpandSystemNo:p}=(0,u.K$)(),[x,h]=(0,o.useState)("viewAll"),[m,f]=(0,o.useState)("1"),{t:g}=(0,n.i)(),v=(0,a.NL)(),{lastMessage:y}=(0,l.useWebSocketContext)();(0,o.useEffect)(()=>{((null==y?void 0:y.type)==="NOTIFICATION"||(null==y?void 0:y.type)==="POPUPNOTIFICATION")&&v.invalidateQueries({queryKey:["notificationsV2"]})},[y,v]),(0,o.useEffect)(()=>{e&&r&&("personal_unread"===r?h("unread"):"personal_viewall"===r&&h("viewAll"),f("2"),t("notificationsDrawerOpenWith",void 0))},[e,r,t]),(0,o.useEffect)(()=>{e&&p&&h("viewAll")},[e,p]);let b=(0,i.jsx)(s.Z,{fullWidth:!0,children:(0,i.jsxs)(d.Z,{value:x,onChange:e=>{h(e.target.value)},sx:{"& .MuiSelect-select":{padding:"6px 16px"}},children:[(0,i.jsx)(c.Z,{value:"viewAll",children:g("notifications.viewAll")}),(0,i.jsx)(c.Z,{value:"unread",children:g("notifications.unread")}),(0,i.jsx)(c.Z,{value:"read",children:g("notifications.read")})]})});return(0,i.jsx)(w,{drawerContent:(0,i.jsx)(J,{selectedOption:x,initialTab:m,onTabSynced:()=>f("1"),expandPersonalSystemNo:p}),append:b,onClose:()=>{t("notificationsExpandSystemNo",void 0),t("isRightDrawerOpen",!1),t("isNotificationsDrawerOpen",!1)},open:e,heading:g("notifications.notifications")})};var et=ee},36067:function(e,t,r){r.r(t),r.d(t,{SnackbarProvider:function(){return c},useSnackbar:function(){return u}});var i=r(57437),n=r(2265),o=r(60033),a=r(73986),l=r(73126);let s=n.createContext(void 0),d=n.forwardRef((e,t)=>(0,i.jsx)(l.Z,{elevation:6,ref:t,variant:"filled",...e})),c=e=>{let{children:t}=e,[r,l]=n.useState({open:!1,message:"",type:"success",position:{vertical:"top",horizontal:"center"},autoHideDuration:3e3}),{t:c}=(0,o.i)(),u=n.useCallback(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"success",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{vertical:"top",horizontal:"center"},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e3;l({open:!0,message:e,type:t,position:r,autoHideDuration:i})},[]),p=()=>{l(e=>({...e,open:!1}))},x=n.useMemo(()=>({showMessage:u}),[u]);return(0,i.jsxs)(s.Provider,{value:x,children:[t,(0,i.jsx)(a.Z,{open:r.open,autoHideDuration:r.autoHideDuration,onClose:p,anchorOrigin:r.position,children:(0,i.jsx)(d,{onClose:p,severity:r.type,sx:{backgroundColor:"info"===r.type?"#2196F3":void 0},children:c(r.message)})})]})},u=()=>{let e=n.useContext(s);if(!e)throw Error("useSnackbar must be used within a SnackbarProvider");return e}},16539:function(e,t,r){r.d(t,{pG:function(){return o},w$:function(){return n},yf:function(){return i}});let i={H_MOBILE:54,H_TABLET:70,H_DESKTOP:70,H_DESKTOP_OFFSET:62},n={W_VERTICAL:260,W_MINI:88},o=350}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.