1import{o as e}from"./chunk-CMxvf4Kt.js";import{n as t,t as n}from"./jsx-runtime-SsSjplwM.js";import{a as r,c as i,s as a}from"./react-intl-Cop388b4.js";import{b as o}from"./prop-types-BTvjt2rf.js";import{$ as s,A as c,D as l,E as u,J as d,M as f,P as p,Q as m,S as h,Y as g,m as _,n as ee,rt as v,s as y,x as b}from"./poll-quu7nqu0.js";import{$i as te,$n as ne,An as x,Ft as S,Gi as C,Gn as re,Gr as ie,H as ae,Ji as w,Jn as oe,Kn as se,Nn as T,Pi as E,Qn as D,V as O,Wn as ce,Yr as k,Zi as le,ar as A,ea as j,er as M,gt as ue,ha as de,ht as fe,ir as pe,ji as N,ki as me,pa as he,pt as ge,qn as _e,rr as ve,sr as ye,tr as be}from"./render-CHiIZYnD.js";import{s as xe}from"./react-router-BzQH59UT.js";import{t as Se}from"./defineProperty-ClgyJMzY.js";import{l as Ce,n as we,o as P,s as F}from"./typed_functions-CyAHd4bl.js";import{t as Te}from"./helmet-DcyqcM0_.js";import{n as I,t as Ee}from"./short_number-Coj2vPT7.js";import{a as De,cn as Oe,n as ke,sn as Ae,un as L}from"./status_quoted-CwxV3dOE.js";import{t as je}from"./classnames-CYxIelk8.js";import{i as Me}from"./skip_links-yojFi5rh.js";import{t as Ne}from"./intl-5El_RLKu.js";import{t as Pe}from"./avatar_group-7CbKPGWb.js";import{_ as Fe,m as Ie}from"./account-DbeGfCXM.js";import{d as Le,l as R,u as Re}from"./card-3cGmny69.js";import{_ as ze,c as z,d as Be,f as Ve,l as He,m as Ue,p as We,s as Ge,y as Ke}from"./navigation_panel-Cjycl1GS.js";import{a as qe,o as Je}from"./columns_area-ggvZP-9f.js";import{t as Ye}from"./category-DL5xfcEw.js";import{C as Xe,E as Ze,a as B}from"./compose_form_container-Dhanlzat.js";import{t as Qe}from"./embedded_status-BYhEsl6d.js";import{t as $e}from"./load_gap-Dh_XA8cz.js";import{t as et}from"./scrollable_list-B85Vgg8c.js";import{t as V}from"./index.module-3tq1TBjm.js";import{t as tt}from"./notifications_active-fill-CD61Kgr2.js";import{n as nt}from"./collection_list_item-Djm3z7Ib.js";import{t as rt}from"./not_signed_in_indicator-DCvbcXhc.js";import{n as it}
1from"./revoke_collection_inclusion_modal-Dfiw8r6w.js";import{t as H}from"./setting_toggle-DYdrKPPe.js";import{t as at}from"./isEqual-CYQaU6Fh.js";import{t as U}from"./inventory_2-BfEcTEHS.js";import{i as ot,n as st,r as ct,t as lt}from"./relationships_severance_event-Bkb6mtFS.js";import{t as ut}from"./policy_controls-LhFSbP06.js";var W=e(at()),G=e(t()),K=n(),dt=e=>(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,K.jsx)(`path`,{d:`M268-240 42-466l57-56 170 170 56 56-57 56Zm226 0L268-466l56-57 170 170 368-368 56 57-424 424Zm0-226-57-56 198-198 57 56-198 198Z`})}),ft=a({filteredNotifications:{id:`notification_requests.title`,defaultMessage:`Filtered notifications`}}),pt=({className:e})=>{let t=i(),n=xe(),r=F(e=>e.notificationPolicy),a=F(ve),o=(0,G.useCallback)(()=>{n.push(`/notifications/requests`)},[n]);return r===null||r.summary.pending_requests_count<=0||!a?null:(0,K.jsx)(`button`,{"aria-label":t.formatMessage(ft.filteredNotifications),title:t.formatMessage(ft.filteredNotifications),onClick:o,className:e,type:`button`,children:(0,K.jsx)(s,{id:`filtered-notifications`,icon:U})})},mt=()=>{let e=P(),t=F(e=>e.notificationPolicy),n=F(ve);return(0,G.useEffect)(()=>{e(S());let t=setInterval(()=>{e(S())},12e4);return()=>{clearInterval(t)}},[e]),t===null||t.summary.pending_requests_count<=0||n?null:(0,K.jsxs)(I,{className:`filtered-notifications-banner`,to:`/notifications/requests`,children:[(0,K.jsx)(`div`,{className:`notification-group__icon`,children:(0,K.jsx)(s,{icon:U,id:`filtered-notifications`})}),(0,K.jsxs)(`div`,{className:`filtered-notifications-banner__text`,children:[(0,K.jsx)(`strong`,{children:(0,K.jsx)(r,{id:`filtered_notifications_banner.title`,defaultMessage:`Filtered notifications`})}),(0,K.jsx)(`span`,{children:(0,K.jsx)(r,{id:`filtered_notifications_banner.pending_requests`,defaultMessage:`From {count, plural, =0 {no one} one {one person} other {# people}} you may know`,values:{count:t.summary.pending_requests_count}})})]})]})},ht=a({close:{id:`lightbox.close`,defaultMessage:`Close`}}),gt=()=>{let e=i(),t=P(),n=(0,G.useCallback)(()=>{t(C())},[t]);return(0,K.jsxs)(`div`,{className:`notifications-permission-banner`,children:[(0,K.jsx)(`div`,{className:`notifications-permission-banner__close`,children:(0,K.jsx)(m,{icon:`times`,iconComponent:v,onClick:(0,G.useCallback)(()=>{t(N([`notifications`,`dismissPermissionBanner`],!0))},[t]),title:e.formatMessage(ht.close)})}),(0,K.jsx)(`h2`,{children:(0,K.jsx)(r,{id:`notifications_permission_banner.title`,defaultMessage:`Never miss a thing`})}),(0,K.jsx)(`p`,{children:(0,K.jsx)(r,{id:`notifications_permission_banner.how_to_control`,defaultMessage:`To receive notifications when Mastodon isn't open, enable desktop notifications. You can control precisely which types of interactions generate desktop notifications through the {icon} button above once they're enabled.`,values:{icon:(0,K.jsx)(s,{id:`sliders`,icon:Ze,"aria-label":e.formatMessage(Je.show)})}})}),(0,K.jsx)(Oe,{onClick:n,children:(0,K.jsx)(r,{id:`notifications_permission_banner.enable`,defaultMessage:`Enable desktop notifications`})})]})};ee();var _t=e=>(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,K.jsx)(`path`,{d:`m376-300 104-104 104 104 56-56-104-104 104-104-56-56-104 104-104-104-56 56 104 104-104 104 56 56Zm-96 180q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520Zm-400 0v520-520Z`})}),vt=class extends G.PureComponent{render(){return(0,K.jsxs)(`button`,{className:`text-btn column-header__setting-btn`,tabIndex:0,onClick:this.props.onClick,children:[(0,K.jsx)(s,{id:`eraser`,icon:_t}),` `,(0,K.jsx)(r,{id:`notifications.clear`,defaultMessage:`Clear notifications`})]})}},yt=class extends G.PureComponent{render(){return(0,K.jsx)(`button`,{className:`text-btn column-header__permission-btn`,tabIndex:0,onClick:this.props.onClick,children:(0,K.jsx)(r,{id:`notifications.grant_permission`,defaultMessage:`Grant permission.`})})}},bt=we([e=>e.settings.get(`notifications`),e=>e.notifications.get(`browserPermission`),e=>e.push_notifications],(e,t,n)=>({settings:e,browserPermission:t!==`denied`,pushSettings:n,showPushSettings:n.get(`supported`)&&n.get(`enabled`)})),xt=a({permissionDenied:{id:`notifications.permission_denied_alert`,defaultMessage:`Desktop notifications can't be enabled, as browser permission has been denied before`}}),St=({label:e,type:t})=>{let{settings:n,browserPermission:i,pushSettings:a,showPushSettings:o}=F(bt),s=P(),c=(0,G.useCallback)((e,t)=>{e[0]===`alerts`&&t&&window.Notification!==void 0&&Notification.permission!==`granted`?s(C(n=>{s(n===`granted`?N([`notifications`,...e],t):E({message:xt.permissionDenied}))})):s(N([`notifications`,...e],t))},[s]),l=(0,G.useCallback)((e,t)=>{t&&window.Notification!==void 0&&Notification.permission!==`granted`?s(C(n=>{s(n===`granted`?w(e,t):E({message:xt.permissionDenied}))})):s(w(e,t))},[s]);return(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-${t}`,children:[(0,K.jsx)(`h3`,{id:`notifications-${t}`,children:e}),(0,K.jsxs)(`div`,{className:`column-settings__row`,children:[(0,K.jsx)(H,{disabled:!i,prefix:`notifications_desktop`,settings:n,settingPath:[`alerts`,t],onChange:c,label:(0,K.jsx)(r,{id:`notifications.column_settings.alert`,defaultMessage:`Desktop notifications`})}),o&&(0,K.jsx)(H,{prefix:`notifications_push`,settings:a,settingPath:[`alerts`,t],onChange:l,label:(0,K.jsx)(r,{id:`notifications.column_settings.push`,defaultMessage:`Push n
1otifications`})}),(0,K.jsx)(H,{prefix:`notifications`,settings:n,settingPath:[`shows`,t],onChange:c,label:(0,K.jsx)(r,{id:`notifications.column_settings.show`,defaultMessage:`Show in column`})}),(0,K.jsx)(H,{prefix:`notifications`,settings:n,settingPath:[`sounds`,t],onChange:c,label:(0,K.jsx)(r,{id:`notifications.column_settings.sound`,defaultMessage:`Play sound`})})]})]})},Ct=g(class extends G.PureComponent{constructor(...e){super(...e),Se(this,`onPushChange`,(e,t)=>{this.props.onChange([`push`,...e],t)})}render(){let{settings:e,pushSettings:t,onChange:n,onClear:i,alertsEnabled:a,browserSupport:o,browserPermission:s,onRequestNotificationPermission:c}=this.props,l=(0,K.jsx)(r,{id:`notifications.column_settings.filter_bar.advanced`,defaultMessage:`Display all categories`}),u=(0,K.jsx)(r,{id:`notifications.column_settings.unread_notifications.highlight`,defaultMessage:`Highlight unread notifications`}),d=(0,K.jsx)(r,{id:`notifications.column_settings.alert`,defaultMessage:`Desktop notifications`}),f=(0,K.jsx)(r,{id:`notifications.column_settings.show`,defaultMessage:`Show in column`}),p=(0,K.jsx)(r,{id:`notifications.column_settings.sound`,defaultMessage:`Play sound`}),m=(0,K.jsx)(r,{id:`notifications.column_settings.group`,defaultMessage:`Group`}),h=t.get(`browserSupport`)&&t.get(`isSubscribed`),g=h&&(0,K.jsx)(r,{id:`notifications.column_settings.push`,defaultMessage:`Push notifications`});return(0,K.jsxs)(`div`,{className:`column-settings`,children:[(0,K.jsx)(`section`,{children:(0,K.jsx)(vt,{onClick:i})}),a&&o&&s===`denied`&&(0,K.jsx)(`section`,{children:(0,K.jsx)(`span`,{className:`warning-hint`,children:(0,K.jsx)(r,{id:`notifications.permission_denied`,defaultMessage:`Desktop notifications are unavailable due to previously denied browser permissions request`})})}),a&&o&&s==="default"&&(0,K.jsx)(`section`,{children:(0,K.jsxs)(`span`,{className:`warning-hint`,children:[(0,K.jsx)(r,{id:`notifications.permission_required`,defaultMessage:`Desktop notifications are unavailable because the required permission has not been granted.`}),` `,(0,K.jsx)(yt,{onClick:c})]})}),(0,K.jsx)(ut,{}),(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-unread-markers`,children:[(0,K.jsx)(`h3`,{id:`notifications-unread-markers`,children:(0,K.jsx)(r,{id:`notifications.column_settings.unread_notifications.category`,defaultMessage:`Unread notifications`})}),(0,K.jsx)(`div`,{className:`column-settings__row`,children:(0,K.jsx)(H,{id:`unread-notification-markers`,prefix:`notifications`,settings:e,settingPath:[`showUnread`],onChange:n,label:u})})]}),(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-filter-bar`,children:[(0,K.jsx)(`h3`,{id:`notifications-filter-bar`,children:(0,K.jsx)(r,{id:`notifications.column_settings.filter_bar.category`,defaultMessage:`Quick filter bar`})}),(0,K.jsx)(`div`,{className:`column-settings__row`,children:(0,K.jsx)(H,{id:`advanced-filter-bar`,prefix:`notifications`,settings:e,settingPath:[`quickFilter`,`advanced`],onChange:n,label:l})})]}),(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-follow`,children:[(0,K.jsx)(`h3`,{id:`notifications-follow`,children:(0,K.jsx)(r,{id:`notifications.column_settings.follow`,defaultMessage:`New followers:`})}),(0,K.jsxs)(`div`,{className:`column-settings__row`,children:[(0,K.jsx)(H,{disabled:s===`denied`,prefix:`notifications_desktop`,settings:e,settingPath:[`alerts`,`follow`],onChange:n,label:d}),h&&(0,K.jsx)(H,{prefix:`notifications_push`,settings:t,settingPath:[`alerts`,`follow`],onChange:this.onPushChange,label:g}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`shows`,`follow`],onChange:n,label:f}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`sounds`,`follow`],onChange:n,label:p}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`group`,`follow`],onChange:n,label:m})]})]}),(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-follow-request`,children:[(0,K.jsx)(`h3`,{id:`notifications-follow-request`,children:(0,K.jsx)(r,{id:`notifications.column_settings.follow_request`,defaultMessage:`New follow requests:`})}),(0,K.jsxs)(`div`,{className:`column-settings__row`,children:[(0,K.jsx)(H,{disabled:s===`denied`,prefix:`notifications_desktop`,settings:e,settingPath:[`alerts`,`follow_request`],onChange:n,label:d}),h&&(0,K.jsx)(H,{prefix:`notifications_push`,settings:t,settingPath:[`alerts`,`follow_request`],onChange:this.onPushChange,label:g}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`shows`,`follow_request`],onChange:n,label:f}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`sounds`,`follow_request`],onChange:n,label:p})]})]}),(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-favourite`,children:[(0,K.jsx)(`h3`,{id:`notifications-favourite`,children:(0,K.jsx)(r,{id:`notifications.column_settings.favourite`,defaultMessage:`Favorites:`})}),(0,K.jsxs)(`div`,{className:`column-settings__row`,children:[(0,K.jsx)(H,{disabled:s===`denied`,prefix:`notifications_desktop`,settings:e,settingPath:[`alerts`,`favourite`],onChange:n,label:d}),h&&(0,K.jsx)(H,{prefix:`notifications_push`,settings:t,settingPath:[`alerts`,`favourite`],onChange:this.onPushChange,label:g}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`shows`,`favourite`],onChange:n,label:f}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`sounds`,`favourite`],onChange:n,label:p})]})]}),(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-mention`,children:[(0,K.jsx)(`h3`,{id:`notifications-mention`,children:(0,K.jsx)(r,{id:`notifications.column_settings.mention`,defaultMessage:`Mentions:`})}),(0,K.jsxs)(`div`,{className:`column-settings__row`,children:[(0,K.jsx)(H,{disabled:s===`denied`,prefix:`notifications_desktop`,settings:e,settingPath:[`alerts`,`mention`],onChange:n,label:d}),h&&(0,K.jsx)(H,{prefix:`notifications_push`,settings:t,settingPath:[`alerts`,`mention`],onChange:this.onPushChange,label:g}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`shows`,`mention`],onChange:n,label:f}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`sounds`,`mention`],onChange:n,label:p})]})]}),(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-reblog`,children:[(0,K.jsx)(`h3`,{id:`notifications-reblog`,children:(0,K.jsx)(r,{id:`notifications.column_settings.reblog`,defaultMessage:`Boosts:`})}),(0,K.jsxs)(`div`,{className:`column-settings__row`,children:[(0,K.jsx)(H,{disabled:s===`denied`,prefix:`notifications_desktop`,settings:e,settingPath:[`alerts`,`reblog`],onChange:n,label:d}),h&&(0,K.jsx)(H,{prefix:`notifications_push`,settings:t,settingPath:[`alerts`,`reblog`],onChange:this.onPushChange,label:g}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`shows`,`reblog`],onChange:n,label:f}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`sounds`,`reblog`],onChange:n,label:p})]})]}),(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-quote`,children:[(0,K.jsx)(`h3`,{id:`notifications-quote`,children:(0,K.jsx)(r,{id:`notifications.column_settings.quote`,defaultMessage:`Quotes:`})}),(0,K.jsxs)(`div`,{className:`column-settings__row`,children:[(0,K.jsx)(H,{disabled:s===`denied`,prefix:`notifications_desktop`,settings:e,settingPath:[`alerts`,`quote`],onChange:n,label:d}),h&&(0,K.jsx)(H,{prefix:`notifications_push`,settings:t,settingPath:[`alerts`,`quote`],onChange:this.onPushChange,label:g}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`shows`,`quote`],onChange:n,label:f}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`sounds`,`quote`],onChange:n,label:p})]})]}),(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-poll`,children:[(0,K.jsx)(`h3`,{id:`notifications-poll`,children:(0,K.jsx)(r,{id:`notifications.column_settings.poll`,defaultMessage:`Poll results:`})}),(0,K.jsxs)(`div`,{className:`column-settings__row`,children:[(0,K.jsx)(H,{disabled:s===`denied`,prefix:`notifications_desktop`,settings:e,settingPath:[`alerts`,`poll`],onChange:n,label:d}),h&&(0,K.jsx)(H,{prefix:`notifications_push`,settings:t,settingPath:[`alerts`,`poll`],onChange:this.onPushChange,label:g}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`shows`,`poll`],onChange:n,label:f}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`sounds`,`poll`],onChange:n,label:p})]})]}),(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-status`,children:[(0,K.jsx)(`h3`,{id:`notifications-status`,children:(0,K.jsx)(r,{id:`notifications.column_settings.status`,defaultMessage:`New posts:`})}),(0,K.jsxs)(`div`,{className:`column-settings__row`,children:[(0,K.jsx)(H,{disabled:s===`denied`,prefix:`notifications_desktop`,settings:e,settingPath:[`alerts`,`status`],onChange:n,label:d}),h&&(0,K.jsx)(H,{prefix:`notifications_push`,settings:t,settingPath:[`alerts`,`status`],onChange:this.onPushChange,label:g}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`shows`,`status`],onChange:n,label:f}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`sounds`,`status`],onChange:n,label:p})]})]}),(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-update`,children:[(0,K.jsx)(`h3`,{id:`notifications-update`,children:(0,K.jsx)(r,{id:`notifications.column_settings.update`,defaultMessage:`Edits:`})}),(0,K.jsxs)(`div`,{className:`column-settings__row`,children:[(0,K.jsx)(H,{disabled:s===`denied`,prefix:`notifications_desktop`,settings:e,settingPath:[`alerts`,`update`],onChange:n,label:d}),h&&(0,K.jsx)(H,{prefix:`notifications_push`,settings:t,settingPath:[`alerts`,`update`],onChange:this.onPushChange,label:g}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`shows`,`update`],onChange:n,label:f}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`sounds`,`update`],onChange:n,label:p})]})]}),(0,K.jsx)(St,{type:`collections`,label:(0,K.jsx)(r,{id:`notifications.column_settings.collections`,defaultMessage:`Collections:`})}),(this.props.identity.permissions&1024)==1024&&(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-admin-sign-up`,children:[(0,K.jsx)(`h3`,{id:`notifications-status`,children:(0,K.jsx)(r,{id:`notifications.column_settings.admin.sign_up`,defaultMessage:`New sign-ups:`})}),(0,K.jsxs)(`div`,{className:`column-settings__row`,children:[(0,K.jsx)(H,{disabled:s===`denied`,prefix:`notifications_desktop`,settings:e,settingPath:[`alerts`,`admin.sign_up`],onChange:n,label:d}),h&&(0,K.jsx)(H,{prefix:`notifications_push`,settings:t,settingPath:[`alerts`,`admin.sign_up`],onChange:this.onPushChange,label:g}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`shows`,`admin.sign_up`],onChange:n,label:f}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`sounds`,`admin.sign_up`],onChange:n,label:p})]})]}),(this.props.identity.permissions&16)==16&&(0,K.jsxs)(`section`,{role:`group`,"aria-labelledby":`notifications-admin-report`,children:[(0,K.jsx)(`h3`,{id:`notifications-status`,children:(0,K.jsx)(r,{id:`notifications.column_settings.admin.report`,defaultMessage:`New reports:`})}),(0,K.jsxs)(`div`,{className:`column-settings__row`,children:[(0,K.jsx)(H,{disabled:s===`denied`,prefix:`notifications_desktop`,settings:e,settingPath:[`alerts`,`admin.report`],onChange:n,label:d}),h&&(0,K.jsx)(H,{prefix:`notifications_push`,settings:t,settingPath:[`alerts`,`admin.report`],onChange:this.onPushChange,label:g}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`shows`,`admin.report`],onChange:n,label:f}),(0,K.jsx)(H,{prefix:`notifications`,settings:e,settingPath:[`sounds`,`admin.report`],onChange:n,label:p})]})]})]})}}),wt=a({permissionDenied:{id:`notifications.permission_denied_alert`,defaultMessage:`Desktop notifications can't be enabled, as browser permission has been denied before`}}),Tt=Ne(Ce(e=>({settings:e.getIn([`settings`,`notifications`]),pushSettings:e.get(`push_notifications`),alertsEnabled:e.getIn([`settings`,`notifications`,`alerts`]).includes(!0),browserSupport:e.getIn([`notifications`,`browserSupport`]),browserPermission:e.getIn([`notifications`,`browserPermission`])}),e=>
1({onChange(t,n){t[0]===`push`?n&&window.Notification!==void 0&&Notification.permission!==`granted`?e(C(r=>{e(r===`granted`?w(t.slice(1),n):E({message:wt.permissionDenied}))})):e(w(t.slice(1),n)):t[0]===`quickFilter`?(e(N([`notifications`,...t],n)),e(D(`all`))):t[0]===`alerts`&&n&&window.Notification!==void 0&&Notification.permission!==`granted`?n&&window.Notification!==void 0&&Notification.permission!==`granted`?e(C(r=>{e(r===`granted`?N([`notifications`,...t],n):E({message:wt.permissionDenied}))})):e(N([`notifications`,...t],n)):(e(N([`notifications`,...t],n)),t[0]===`group`&&t[1]===`follow`&&e(ce()))},onClear(){e(me({modalType:`CONFIRM_CLEAR_NOTIFICATIONS`}))},onRequestNotificationPermission(){e(C())}}))(Ct)),q=e(je()),Et=a({other:{id:`report_notification.categories.other_sentence`,defaultMessage:`other`},spam:{id:`report_notification.categories.spam_sentence`,defaultMessage:`spam`},legal:{id:`report_notification.categories.legal_sentence`,defaultMessage:`illegal content`},violation:{id:`report_notification.categories.violation_sentence`,defaultMessage:`rule violation`}}),Dt=({notification:e,notification:{report:t},unread:n})=>{let a=i(),o=F(e=>e.accounts.get(t.targetAccountId)),c=F(t=>t.accounts.get(e.sampleAccountIds[0]??`0`));if(!c||!o)return null;let l={name:(0,K.jsx)(u,{account:c,variant:`simple`}),target:(0,K.jsx)(u,{account:o,variant:`simple`}),category:a.formatMessage(Et[t.category]),count:t.status_ids.length},d;return d=t.status_ids.length>0?t.category===`other`?(0,K.jsx)(r,{id:`notification.admin.report_account_other`,defaultMessage:`{name} reported {count, plural, one {one post} other {# posts}} from {target}`,values:l}):(0,K.jsx)(r,{id:`notification.admin.report_account`,defaultMessage:`{name} reported {count, plural, one {one post} other {# posts}} from {target} for {category}`,values:l}):t.category===`other`?(0,K.jsx)(r,{id:`notification.admin.report_statuses_other`,defaultMessage:`{name} reported {target}`,values:l}):(0,K.jsx)(r,{id:`notification.admin.report_statuses`,defaultMessage:`{name} reported {target} for {category}`,values:l}),(0,K.jsxs)(`a`,{href:`/admin/reports/${t.id}`,target:`_blank`,rel:`noopener noreferrer`,className:(0,q.default)(`notification-group notification-group--link notification-group--admin-report focusable`,{"notification-group--unread":n}),children:[(0,K.jsx)(`div`,{className:`notification-group__icon`,children:(0,K.jsx)(s,{id:`flag`,icon:ot})}),(0,K.jsxs)(`div`,{className:`notification-group__main`,children:[(0,K.jsx)(`div`,{className:`notification-group__main__header`,children:(0,K.jsxs)(`h2`,{className:`notification-group__main__header__label`,children:[d,(0,K.jsx)(y,{timestamp:t.created_at})]})}),t.comment.length>0&&(0,K.jsxs)(`div`,{className:`notification-group__embedded-status__content`,children:[`â`,t.comment,`â`]})]})]})},J=28,Ot=({accountId:e})=>{let t=F(t=>t.accounts.get(e));return t?(0,K.jsx)(c,{withLink:!0,account:t,size:J}):null},Y=({icon:e,iconId:t,timestamp:n,accountIds:r,actions:i,count:a,statusId:o,labelRenderer:c,labelSeeMoreHref:u,type:d,unread:f,additionalContent:p})=>{let m=P(),h=F(e=>e.accounts.get(r.at(0)??``)),g=(0,G.useMemo)(()=>c((0,K.jsx)(l,{displayProps:{account:h,variant:`simple`}}),a,u),[c,h,a,u]),_=F(e=>e.statuses.getIn([o,`visibility`])===`direct`);return(0,K.jsx)(L,{handlers:(0,G.useMemo)(()=>({open:()=>{m(x(o))},reply:()=>{m(k(o))}}),[m,o]),children:(0,K.jsxs)(`div`,{role:`button`,className:(0,q.default)(`notification-group focusable notification-group--${d}`,{"notification-group--unread":f,"notification-group--direct":_}),tabIndex:0,children:[(0,K.jsx)(`div`,{className:`notification-group__icon`,children:(0,K.jsx)(s,{icon:e,id:t})}),(0,K.jsxs)(`div`,{className:`notification-group__main`,children:[(0,K.jsxs)(`div`,{className:`notification-group__main__header`,children:[(0,K.jsxs)(`div`,{className:`notification-group__main__header__wrapper`,children:[(0,K.jsx)(Pe,{avatarHeight:J,children:r.slice(0,8).map(e=>(0,K.jsx)(Ot,{accountId:e},e))}),i&&(0,K.jsx)(`div`,{className:`notification-group__actions`,children:i})]}),(0,K.jsxs)(`h2`,{className:`notification-group__main__header__label`,children:[(0,K.jsx)(`span`,{children:g}),n&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`notification-group__main__header__label-separator`,children:`·`}),(0,K.jsx)(y,{timestamp:n})]})]})]}),o&&(0,K.jsx)(`div`,{className:`notification-group__main__status`,children:(0,K.jsx)(Qe,{statusId:o})}),p&&(0,K.jsx)(`div`,{className:`notification-group__main__additional-content`,children:p})]})]})})},kt=(e,t)=>
1t===1?(0,K.jsx)(r,{id:`notification.admin.sign_up`,defaultMessage:`{name} signed up`,values:{name:e}}):(0,K.jsx)(r,{id:`notification.admin.sign_up.name_and_others`,defaultMessage:`{name} and {count, plural, one {# other} other {# others}} signed up`,values:{name:e,count:t-1}}),At=({notification:e,unread:t})=>(0,K.jsx)(Y,{type:`admin-sign-up`,icon:z,iconId:`person-add`,accountIds:e.sampleAccountIds,timestamp:e.latest_page_notification_at,count:e.notifications_count,labelRenderer:kt,unread:t}),jt=e=>(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,K.jsx)(`path`,{d:`m80-80 200-560 360 360L80-80Zm132-132 282-100-182-182-100 282Zm370-246-42-42 224-224q32-32 77-32t77 32l24 24-42 42-24-24q-14-14-35-14t-35 14L582-458ZM422-618l-42-42 24-24q14-14 14-34t-14-34l-26-26 42-42 26 26q32 32 32 76t-32 76l-24 24Zm80 80-42-42 144-144q14-14 14-35t-14-35l-64-64 42-42 64 64q32 32 32 77t-32 77L502-538Zm160 160-42-42 64-64q32-32 77-32t77 32l64 64-42 42-64-64q-14-14-35-14t-35 14l-64 64ZM212-212Z`})}),Mt=({notification:{annualReport:e},unread:t})=>{let n=P(),i=e.year,a=(0,G.useCallback)(()=>{n(me({modalType:`ANNUAL_REPORT`,modalProps:{year:i}}))},[n,i]);return(0,K.jsxs)(`div`,{role:`button`,className:(0,q.default)(`notification-group notification-group--link notification-group--annual-report focusable`,{"notification-group--unread":t}),tabIndex:0,children:[(0,K.jsx)(`div`,{className:`notification-group__icon`,children:(0,K.jsx)(s,{id:`celebration`,icon:jt})}),(0,K.jsxs)(`div`,{className:`notification-group__main`,children:[(0,K.jsx)(`p`,{children:(0,K.jsx)(r,{id:`notification.annual_report.message`,defaultMessage:`Your {year} #Wrapstodon awaits! Unveil your year's highlights and memorable moments on Mastodon!`,values:{year:i}})}),(0,K.jsx)(`button`,{onClick:a,className:`link-button`,type:`button`,children:(0,K.jsx)(r,{id:`notification.annual_report.view`,defaultMessage:`View #Wrapstodon`})})]})]})},Nt={actions:`_notifications_v2_components_notification_collection__actions`,menuButton:`_notifications_v2_components_notification_collection__menuButton`},Pt=({notification:e,unread:t})=>{let{collection:n,type:i}=e,a=f(n?.account_id),o=it(n);return n?(0,K.jsxs)(`div`,{className:(0,q.default)(`notification-group`,`notification-group--${i}`,{"notification-group--unread":t}),children:[(0,K.jsx)(`div`,{className:`notification-group__icon`,children:(0,K.jsx)(s,{id:`collection`,icon:He})}),(0,K.jsxs)(`div`,{className:`notification-group__main`,children:[(0,K.jsx)(`div`,{className:`notification-group__main__header`,children:(0,K.jsxs)(`h2`,{className:`notification-group__main__header__label`,children:[i===`added_to_collection`&&(0,K.jsx)(r,{id:`notification.added_to_collection`,defaultMessage:`{name} added you to a collection`,values:{name:(0,K.jsx)(l,{displayProps:{variant:`simple`,account:a}})}}),i===`collection_update`&&(0,K.jsx)(r,{id:`notification.collection_update`,defaultMessage:`{name} edited a collection youâre in`,values:{name:(0,K.jsx)(l,{displayProps:{variant:`simple`,account:a}})}})]})}),(0,K.jsx)(De,{collection:n}),(0,K.jsxs)(`div`,{className:Nt.actions,children:[(0,K.jsx)(Oe,{compact:!0,secondary:!0,className:`button--destructive`,onClick:o,children:(0,K.jsx)(r,{id:`collections.detail.revoke_inclusion`,defaultMessage:`Remove me`})}),(0,K.jsx)(nt,{context:`notifications`,collection:n,className:Nt.menuButton})]})]})]}):null},Ft=(e,t,n)=>t===1?(0,K.jsx)(r,{id:`notification.favourite`,defaultMessage:`{name} favorited your post`,values:{name:e}}):(0,K.jsx)(r,{id:`notification.favourite.name_and_others_with_link`,defaultMessage:`{name} and <a>{count, plural, one {# other} other {# others}}</a> favorited your post`,values:{name:e,count:t-1,a:e=>n?(0,K.jsx)(I,{to:n,children:e}):e}}),It=(e,t,n)=>t===1?(0,K.jsx)(r,{id:`notification.favourite_pm`,defaultMessage:`{name} favorited your private mention`,values:{name:e}}):(0,K.jsx)(r,{id:`notification.favourite_pm.name_and_others_with_link`,defaultMessage:`{name} and <a>{count, plural, one {# other} other {# others}}</a> favorited your private mention`,values:{name:e,count:t-1,a:e=>n?(0,K.jsx)(I,{to:n,children:e}):e}}),Lt=({notification:e,unread:t})=>{let{statusId:n}=e,r=F(e=>e.accounts.get(e.statuses.getIn([n,`account`]))?.acct),i=F(e=>e.statuses.getIn([n,`visibility`])===`direct`);return(0,K.jsx)(Y,{type:`favourite`,icon:h,iconId:`star`,accountIds:e.sampleAccountIds,statusId:e.statusId,timestamp:e.latest_page_notification_at,count:e.notifications_count,labelRenderer:i?It:Ft,labelSeeMoreHref:r?`/@${r}/${n}/favourites`:void 0,unread:t})}
1,Rt=(e,t,n)=>t===1?(0,K.jsx)(r,{id:`notification.follow`,defaultMessage:`{name} followed you`,values:{name:e}}):(0,K.jsx)(r,{id:`notification.follow.name_and_others`,defaultMessage:`{name} and <a>{count, plural, one {# other} other {# others}}</a> followed you`,values:{name:e,count:t-1,a:e=>n?(0,K.jsx)(I,{to:n,children:e}):e}}),zt=({accountId:e})=>{let t=F(t=>t.accounts.get(e));return t?(0,K.jsx)(Ee,{value:t.followers_count,renderer:Fe}):null},Bt=({notification:e,unread:t})=>{let n=F(e=>e.accounts.getIn([o,`username`])),r,i;if(e.sampleAccountIds.length===1){let t=e.sampleAccountIds[0];t&&(r=(0,K.jsx)(Ie,{compact:!0,accountId:e.sampleAccountIds[0]}),i=(0,K.jsx)(zt,{accountId:t}))}return(0,K.jsx)(Y,{type:`follow`,icon:z,iconId:`person-add`,accountIds:e.sampleAccountIds,timestamp:e.latest_page_notification_at,count:e.notifications_count,labelRenderer:Rt,labelSeeMoreHref:`/@${n}/followers`,unread:t,actions:r,additionalContent:i})},Vt=a({authorize:{id:`follow_request.authorize`,defaultMessage:`Authorize`},reject:{id:`follow_request.reject`,defaultMessage:`Reject`}}),Ht=(e,t)=>t===1?(0,K.jsx)(r,{id:`notification.follow_request`,defaultMessage:`{name} has requested to follow you`,values:{name:e}}):(0,K.jsx)(r,{id:`notification.follow_request.name_and_others`,defaultMessage:`{name} and {count, plural, one {# other} other {# others}} has requested to follow you`,values:{name:e,count:t-1}}),Ut=({notification:e,unread:t})=>{let n=i(),r=P(),a=(0,G.useCallback)(()=>{r(j(e.sampleAccountIds[0]))},[r,e.sampleAccountIds]),o=(0,G.useCallback)(()=>{r(de(e.sampleAccountIds[0]))},[r,e.sampleAccountIds]),s=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(m,{title:n.formatMessage(Vt.authorize),icon:`check`,iconComponent:p,onClick:a}),(0,K.jsx)(m,{title:n.formatMessage(Vt.reject),icon:`times`,iconComponent:v,onClick:o})]});return(0,K.jsx)(Y,{type:`follow-request`,icon:z,iconId:`person-add`,accountIds:e.sampleAccountIds,timestamp:e.latest_page_notification_at,count:e.notifications_count,labelRenderer:Ht,actions:s,unread:t})},Wt=e=>(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:24,viewBox:`0 -960 960 960`,width:24,...e,children:(0,K.jsx)(`path`,{d:`M760-200v-160q0-50-35-85t-85-35H273l144 144-57 56-240-240 240-240 57 56-144 144h367q83 0 141.5 58.5T840-360v160h-80Z`})}),X=({icon:e,iconId:t,accountIds:n,statusId:r,count:i,labelRenderer:a,type:o,unread:c})=>{let u=P(),d=F(e=>e.accounts.get(n.at(0)??``)),f=(0,G.useMemo)(()=>a((0,K.jsx)(l,{displayProps:{account:d,variant:`simple`}}),i),[a,d,i]),p=F(e=>e.statuses.getIn([r,`visibility`])===`direct`),m=F(e=>r&&_(e,{id:r,contextType:`notifications`})),h=(0,G.useMemo)(()=>({open:()=>{u(x(r))},reply:()=>{u(k(r))},boost:()=>{u(ae(r))},favourite:()=>{u(O(r))},toggleHidden:()=>{u(T(r))}}),[u,r]);return!r||m?null:(0,K.jsx)(L,{handlers:h,children:(0,K.jsxs)(`div`,{role:`button`,className:(0,q.default)(`notification-ungrouped focusable notification-ungrouped--${o}`,{"notification-ungrouped--unread":c,"notification-ungrouped--direct":p}),tabIndex:0,children:[(0,K.jsxs)(`h2`,{className:`notification-ungrouped__header`,children:[(0,K.jsx)(`div`,{className:`notification-ungrouped__header__icon`,children:(0,K.jsx)(s,{icon:e,id:t})}),(0,K.jsx)(`span`,{children:f})]}),(0,K.jsx)(ke,{id:r,contextType:`notifications`,withDismiss:!0,skipPrepend:!0,avatarSize:40,unfocusable:!0})]})})},Gt=()=>(0,K.jsx)(r,{id:`notification.label.mention`,defaultMessage:`Mention`}),Kt=()=>(0,K.jsx)(r,{id:`notification.label.private_mention`,defaultMessage:`Private mention`}),qt=()=>(0,K.jsx)(r,{id:`notification.label.reply`,defaultMessage:`Reply`}),Jt=()=>(0,K.jsx)(r,{id:`notification.label.private_reply`,defaultMessage:`Private reply`}),Yt=({notification:e,unread:t})=>{let[n,r]=F(t=>{let n=e.statusId?t.statuses.get(e.statusId):void 0;return n?[n.get(`visibility`)===`direct`,n.get(`in_reply_to_account_id`)===o]:[!1,!1]},W.default),i=Gt;return r&&n?i=Jt:r?i=qt:n&&(i=Kt),(0,K.jsx)(X,{type:`mention`,icon:r?Wt:Ae,iconId:`reply`,accountIds:e.sampleAccountIds,count:e.notifications_count,statusId:e.statusId,labelRenderer:i,unread:t})},Xt=({notification:{moderationWarning:e},unread:t})=>(0,K.jsx)(st,{action:e.action,id:e.id,unread:t}),Zt=()=>(0,K.jsx)(r,{id:`notification.poll`,defaultMessage:`A poll you voted in has ended`}),Qt=()=>(0,K.jsx)(r,{id:`notification.own_poll`,defaultMessage:`Your poll has ended`}),$t=({notification:e,unread:t})=>(0,K.jsx)(X,{type:`poll`,icon:Xe,iconId:`bar-chart-4-bars`,accountIds:e.sampleAccountIds,count:e.notifications_count,statusId:e.statusId,labelRenderer:e.sampleAccountIds[0]===o?Qt:Zt,unread:t}),en=e=>(0,K.jsx)(r,{id:`notification.label.quote`,defaultMessage:`{name} quoted your post`,values:{name:e}}),tn=({notification:e,unread:t})=>(0,K.jsx)(X,{type:`quote`,icon:Re,iconId:`quote`,accountIds:e.sampleAccountIds,count:e.notifications_count,statusId:e.statusId,labelRenderer:en,unread:t}),nn=e=>(0,K.jsx)(r,{id:`notification.quoted_update`,defaultMessage:`{name} edited a post you have quoted`,values:{name:e}}),rn=({notification:e,unread:t})=>(0,K.jsx)(X,{type:`update`,icon:B,iconId:`edit`,accountIds:e.sampleAccountIds,count:e.notifications_count,statusId:e.statusId,labelRenderer:nn,unread:t}),an=(e,t,n)=>t===1?(0,K.jsx)(r,{id:`notification.reblog`,defaultMessage:`{name} boosted your post`,values:{name:e}}):(0,K.jsx)(r,{id:`notification.reblog.name_and_others_with_link`,defaultMessage:`{name} and <a>{count, plural, one {# other} other {# others}}</a> boosted your post`,values:{name:e,count:t-1,a:e=>n?(0,K.jsx)(I,{to:n,children:e}):e}}),on=({notification:e,unread:t})=>{let{statusId:n}=e,r=F(e=>e.accounts.get(e.statuses.getIn([n,`account`]))?.acct);return(0,K.jsx)(Y,{type:`reblog`,icon:R,iconId:`repeat`,accountIds:e.sampleAccountIds,statusId:e.statusId,timestamp:e.latest_page_notification_at,count:e.notifications_count,labelRenderer:an,labelSeeMoreHref:r?`/@${r}/${n}/reblogs`:void 0,unread:t})},sn=({notification:{event:e},unread:t})=>(0,K.jsx)(lt,{type:e.type,target:e.target_name,followersCount:e.followers_count,followingCount:e.following_count,unread:t}),cn=e=>(0,K.jsx)(r,{id:`notification.status`,defaultMessage:`{name} just posted`,values:{name:e}}),ln=({notification:e,unread:t})=>(0,K.jsx)(X,{type:`status`,icon:tt,iconId:`notifications-active`,accountIds:e.sampleAccountIds,count:e.notifications_count,statusId:e.statusId,labelRenderer:cn,unread:t}),un=e=>(0,K.jsx)(r,{id:`notification.update`,defaultMessage:`{name} edited a post`,values:{name:e}}),dn=({notification:e,unread:t})=>(0,K.jsx)(X,{type:`update`,icon:B,iconId:`edit`,accountIds:e.sampleAccountIds,count:e.notifications_count,statusId:e.statusId,labelRenderer:un,unread:t}),fn=({notificationGroupId:e,unread:t})=>{let n=F(t=>t.notificationGroups.groups.find(t=>t.type!==`gap`&&t.group_key===e)),r=P(),i=n?.type===`gap`?void 0:n?.sampleAccountIds[0],a=(0,G.useMemo)(()=>({openProfile:()=>{i&&r(he(i))},mention:()=>{i&&r(ie(i))}}),[r,i]);if(!n||n.type===`gap`)return null;let o;switch(n.type){case`reblog`:o=(0,K.jsx)(on,{unread:t,notification:n});break;case`favourite`:o=(0,K.jsx)(Lt,{unread:t,notification:n});break;case`severed_relationships`:o=(0,K.jsx)(sn,{unread:t,notification:n});break;case`mention`:o=(0,K.jsx)(Yt,{unread:t,notification:n});break;case`quote`:o=(0,K.jsx)(tn,{unread:t,notification:n});break;case`follow`:o=(0,K.jsx)(Bt,{unread:t,notification:n});break;case`follow_request`:o=(0,K.jsx)(Ut,{unread:t,notification:n});break;case`poll`:o=(0,K.jsx)($t,{unread:t,notification:n});break;case`status`:o=(0,K.jsx)(ln,{unread:t,notification:n});break;case`update`:o=(0,K.jsx)(dn,{unread:t,notification:n});break;case`quoted_update`:o=(0,K.jsx)(rn,{unread:t,notification:n});break;case`admin.sign_up`:o=(0,K.jsx)(At,{unread:t,notification:n});break;case`admin.report`:o=(0,K.jsx)(Dt,{unread:t,notification:n});break;case`moderation_warning`:o=(0,K.jsx)(Xt,{unread:t,notification:n});break;case`annual_report`:o=(0,K.jsx)(Mt,{unread:t,notification:n});break;case`added_to_collection`:case`collection_update`:o=(0,K.jsx)(Pt,{unread:t,notification:n});break;default:return null}return(0,K.jsx)(L,{handlers:a,children:o})},Z=a({mentions:{id:`notifications.filter.mentions`,defaultMessage:`Mentions`},favourites:{id:`notifications.filter.favourites`,defaultMessage:`Favorites`},boosts:{id:`notifications.filter.boosts`,defaultMessage:`Boosts`},polls:{id:`notifications.filter.polls`,defaultMessage:`Poll results`},follows:{id:`notifications.filter.follows`,defaultMessage:`Follows`},collections:{id:`notifications.filter.collections`,defaultMessage:`Collections`},statuses:{id:`notifications.filter.statuses`,defaultMessage:`Updates from people you follow`}}),Q=({selectedFilter:e,type:t,title:n,children:r})=>{let i=P(),a=(0,G.useCallback)(()=>{i(D({filterType:t}))},[i,t]);return(0,K.jsx)(`button`,{className:e===t?`active`:``,onClick:a,title:n,type:`button`,children:r})},pn=()=>{let e=i(),t=F(pe);return F(A)?(0,K.jsxs)(`div`,{className:`notification__filter-bar`,children:[(0,K.jsx)(Q,{selectedFilter:t,type:`all`,children:(0,K.jsx)(r,{id:`notifications.filter.all`,defaultMessage:`All`})},`all`),(0,K.jsx)(Q,{selectedFilter:t,type:`mention`,title:e.formatMessage(Z.mentions),children:(0,K.jsx)(s,{id:`reply-all`,icon:Le})},`mention`),(0,K.jsx)(Q,{selectedFilter:t,type:`favourite`,title:e.formatMessage(Z.favourites),children:(0,K.jsx)(s,{id:`star`,icon:b})},`favourite`),(0,K.jsx)(Q,{selectedFilter:t,type:`reblog`,title:e.formatMessage(Z.boosts),children:(0,K.jsx)(s,{id:`retweet`,icon:R})},`reblog`),(0,K.jsx)(Q,{selectedFilter:t,type:`poll`,title:e.formatMessage(Z.polls),children:(0,K.jsx)(s,{id:`tasks`,icon:ct})},`poll`),(0,K.jsx)(Q,{selectedFilter:t,type:`status`,title:e.formatMessage(Z.statuses),children:(0,K.jsx)(s,{id:`home`,icon:Ke})},`status`),(0,K.jsx)(Q,{selectedFilter:t,type:`follow`,title:e.formatMessage(Z.follows),children:(0,K.jsx)(s,{id:`user-plus`,icon:Ge})},`follow`),(0,K.jsx)(Q,{selectedFilter:t,type:`collection`,title:e.formatMessage(Z.collections),children:(0,K.jsx)(s,{id:`collections`,icon:Ye})},`collection`)]}):(0,K.jsxs)(`div`,{className:`notification__filter-bar`,children:[(0,K.jsx)(Q,{selectedFilter:t,type:`all`,children:(0,K.jsx)(r,{id:`notifications.filter.all`,defaultMessage:`All`})},`all`),(0,K.jsx)(Q,{selectedFilter:t,type:`mention`,children:(0,K.jsx)(r,{id:`notifications.filter.mentions`,defaultMessage:`Mentions`})},`mention`)]})},$=a({title:{id:`column.notifications`,defaultMessage:`Notifications`},markAsRead:{id:`notifications.mark_as_read`,defaultMessage:`Mark every notification as read`}}),mn=({columnId:e,multiColumn:t})=>{let n=i(),a=F(Ve,W.default),o=P(),c=F(e=>e.notificationGroups.isLoading),l=a.at(-1)?.type===`gap`,u=F(e=>
1ye(e)?e.notificationGroups.readMarkerId:`0`),f=F(We),p=F(Ue),m=F(Be),h=F(e=>e.notificationGroups.mergedNotifications===`needs-reload`),g=p>0||h,_=F(ye)&&m,ee=F(be),v=(0,G.useRef)(null);(0,G.useEffect)(()=>(o(oe()),()=>{o(ne()),o(M({top:!1}))}),[o]);let y=(0,G.useCallback)(e=>{o(re({gap:e}))},[o]),b=V(()=>{let e=a.at(-1);e?.type===`gap`&&o(re({gap:e}))},300,{leading:!0}),x=(0,G.useCallback)(()=>{o(se())},[o]),S=V(()=>{o(M({top:!0}))},100),C=V(()=>{o(M({top:!1}))},100);(0,G.useEffect)(()=>()=>{b.cancel(),S.cancel(),C.cancel()},[b,S,C]);let ie=(0,G.useCallback)(()=>{o(e?ue(e):ge(`NOTIFICATIONS`,{}))},[e,o]),ae=(0,G.useCallback)(t=>{o(fe(e,t))},[o,e]),w=(0,G.useCallback)(()=>{v.current?.scrollTop()},[]),T=(0,G.useCallback)(()=>{o(_e()),o(le({immediate:!0}))},[o]),E=!!e,D=(0,K.jsx)(r,{id:`empty_column.notifications`,defaultMessage:`You don't have any notifications yet. When other people interact with you, you will see it here.`}),{signedIn:O}=d(),ce=O?(0,K.jsx)(pn,{}):null,k=(0,G.useMemo)(()=>a.length===0&&!l?null:a.map(e=>e.type===`gap`?(0,K.jsx)($e,{disabled:c,param:e,onClick:y},`${e.maxId}-${e.sinceId}`):(0,K.jsx)(fn,{notificationGroupId:e.group_key,unread:u!==`0`&&!!e.page_max_id&&te(e.page_max_id,u)>0},e.group_key)),[a,c,l,u,y]),A=(0,K.jsxs)(K.Fragment,{children:[ee&&(0,K.jsx)(gt,{}),(0,K.jsx)(mt,{})]}),j=O?(0,K.jsx)(et,{scrollKey:`notifications-${e}`,trackScroll:!E,isLoading:c,showLoading:c&&a.length===0,hasMore:l,numPending:f,prepend:A,alwaysPrepend:!0,emptyMessage:D,onLoadMore:b,onLoadPending:x,onScrollToTop:S,onScroll:C,bindToDocument:!t,children:k}):(0,K.jsx)(rt,{}),de=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(pt,{className:`column-header__button`}),_&&(0,K.jsx)(`button`,{"aria-label":n.formatMessage($.markAsRead),title:n.formatMessage($.markAsRead),onClick:T,className:`column-header__button`,type:`button`,children:(0,K.jsx)(s,{id:`done-all`,icon:dt})})]});return(0,K.jsxs)(Me,{bindToDocument:!t,ref:v,label:n.formatMessage($.title),children:[(0,K.jsx)(qe,{icon:`bell`,iconComponent:ze,active:g,title:n.formatMessage($.title),onPin:ie,onMove:ae,onClick:w,pinned:E,multiColumn:t,extraButton:de,children:(0,K.jsx)(Tt,{})}),ce,j,(0,K.jsxs)(Te,{children:[(0,K.jsx)(`title`,{children:n.formatMessage($.title)}),(0,K.jsx)(`meta`,{name:`robots`,content:`noindex`})]})]})};export{mn as Notifications,mn as default}; 2//# sourceMappingURL=notifications_v2-R43FjsHL.js.map
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.