PageSourceSearch

https://shen.zone/packs/js/features/notifications_v1-58cae6a6f4ea12b60783.chunk.js

js shen.zone collected 2026-10-07 08:40:50 UTC 8,535 bytes, 2 lines download raw bytes

1(window.webpackJsonp=window.webpackJsonp||[]).push([[478],{1560:function(t,e,i){"use strict";i.r(e);var o=i(0),s=i(2),a=i(55),n=i.n(a),l=(i(35),i(1)),c=i(7),d=i(23),r=i(77),h=i(108),b=i(83),f=i(5),p=i(11),u=i(535),g=i(268),m=i(34),O=i(12),j=i(405),v=i(37),M=i(116),k=i(74),I=i(42),C=i(182),w=i(181),N=i(275),P=i(238),y=i(391),T=i(545),L=i(537),_=i(185),F=i(276),S=i(241),x=i(88),A=i(196),R=i(152);const U=Object(c.d)({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"},statuses:{id:"notifications.filter.statuses",defaultMessage:"Updates from people you follow"}});class q extends l.PureComponent{onClick(t){return()=>this.props.selectFilter(t)}render(){const{selectedFilter:t,advancedMode:e,intl:i}=this.props;return e?Object(o.a)("div",{className:"notification__filter-bar"},void 0,Object(o.a)("button",{className:"all"===t?"active":"",onClick:this.onClick("all")},void 0,Object(o.a)(d.a,{id:"notifications.filter.all",defaultMessage:"All"})),Object(o.a)("button",{className:"mention"===t?"active":"",onClick:this.onClick("mention"),title:i.formatMessage(U.mentions)},void 0,Object(o.a)(O.a,{id:"reply-all",icon:A.a})),Object(o.a)("button",{className:"favourite"===t?"active":"",onClick:this.onClick("favourite"),title:i.formatMessage(U.favourites)},void 0,Object(o.a)(O.a,{id:"star",icon:R.a})),Object(o.a)("button",{className:"reblog"===t?"active":"",onClick:this.onClick("reblog"),title:i.formatMessage(U.boosts)},void 0,Object(o.a)(O.a,{id:"retweet",icon:x.a})),Object(o.a)("button",{className:"poll"===t?"active":"",onClick:this.onClick("poll"),title:i.formatMessage(U.polls)},void 0,Object(o.a)(O.a,{id:"tasks",icon:F.a})),Object(o.a)("button",{className:"status"===t?"active":"",onClick:this.onClick("status"),title:i.formatMessage(U.statuses)},void 0,Object(o.a)(O.a,{id:"home",icon:_.a})),Object(o.a)("button",{className:"follow"===t?"active":"",onClick:this.onClick("follow"),title:i.formatMessage(U.follows)},void 0,Object(o.a)(O.a,{id:"user-plus",icon:S.a}))):Object(o.a)("div",{className:"notification__filter-bar"},void 0,Object(o.a)("button",{className:"all"===t?"active":"",onClick:this.onClick("all")},void 0,Object(o.a)(d.a,{id:"notifications.filter.all",defaultMessage:"All"})),Object(o.a)("button",{className:"mention"===t?"active":"",onClick:this.onClick("mention")},void 0,Object(o.a)(d.a,{id:"notifications.filter.mentions",defaultMessage:"Mentions"})))}}var D=Object(r.c)(q);var z=Object(p.connect)((t=>({selectedFilter:t.getIn(["settings","notifications","quickFilter","active"]),advancedMode:t.getIn(["settings","notifications","quickFilter","advanced"])})),(t=>({selectFilter(e){t(Object(I.s)(e))}})))(D),H=i(1412),B=i(4);const W=Object(c.d)({title:{id:"column.notifications",defaultMessage:"Notifications"},markAsRead:{id:"notifications.mark_as_read",defaultMessage:"Mark every notification as read"}}),G=Object(b.a)([t=>t.getIn(["settings","notifications","shows"])],(t=>Object(f.List)(t.filter((t=>!t)).keys()))),J=Object(b.a)([t=>t.getIn(["settings","notifications","quickFilter","show"]),t=>t.getIn(["settings","notifications","quickFilter","active"]),G,t=>t.getIn(["notifications","items"])],((t,e,i,o)=>t&&"all"!==e?o.filter((t=>null===t||e===t.get("type"))):o.filterNot((t=>null!==t&&i.includes(t.get("type"))))));class V extends l.PureComponent{constructor(){super(...arguments),Object(s.a)(this,"handleLoadGap",(t=>{this.props.dispatch(Object(I.l)({maxId:t}))})),Object(s.a)(this,"handleLoadOlder",n()((()=>{const t=this.props.notifications.last();this.props.dispatch(Object(I.l)({maxId:t&&t.get("id")}))}),300,{leading:!0})),Object(s.a)(this,"handleLoadPending",(()=>{this.props.dispatch(Object(I.m)())})),Object(s.a)(this,"handleScrollToTop",n()((()=>{this.props.dispatch(Object(I.r)(!0))}),100)),Object(s.a)(this,"handleScroll",n()((()=>{this.props.dispatch(Object(I.r)(!1))}),100)),Object(s.a)(this,"handlePin",(()=>{const{columnId:t,dispatch:e}=this.props;e(t?Object(M.h)(t):Object(M.e)("NOTIFICATIONS",{}))})),Object(s.a)(this,"handleMove",(t=>
1{const{columnId:e,dispatch:i}=this.props;i(Object(M.g)(e,t))})),Object(s.a)(this,"handleHeaderClick",(()=>{this.column.scrollTop()})),Object(s.a)(this,"setColumnRef",(t=>{this.column=t})),Object(s.a)(this,"handleMoveUp",(t=>{const e=this.props.notifications.findIndex((e=>null!==e&&e.get("id")===t))-1;this._selectChild(e,!0)})),Object(s.a)(this,"handleMoveDown",(t=>{const e=this.props.notifications.findIndex((e=>null!==e&&e.get("id")===t))+1;this._selectChild(e,!1)})),Object(s.a)(this,"handleMarkAsRead",(()=>{this.props.dispatch(Object(I.n)()),this.props.dispatch(Object(k.b)({immediate:!0}))}))}UNSAFE_componentWillMount(){this.props.dispatch(Object(I.o)())}componentWillUnmount(){this.handleLoadOlder.cancel(),this.handleScrollToTop.cancel(),this.handleScroll.cancel(),this.props.dispatch(Object(I.r)(!1)),this.props.dispatch(Object(I.u)())}_selectChild(t,e){const i=this.column.node,o=i.querySelector(`article:nth-of-type(${t+1}) .focusable`);o&&(e&&i.scrollTop>o.offsetTop?o.scrollIntoView(!0):!e&&i.scrollTop+i.clientHeight<o.offsetTop+o.offsetHeight&&o.scrollIntoView(!1),o.focus())}render(){const{intl:t,notifications:e,isLoading:i,isUnread:s,columnId:a,multiColumn:n,hasMore:l,numPending:c,lastReadId:r,canMarkAsRead:b,needsNotificationPermission:f}=this.props,p=!!a,v=Object(o.a)(d.a,{id:"empty_column.notifications",defaultMessage:"You don't have any notifications yet. When other people interact with you, you will see it here."}),{signedIn:M}=this.props.identity;let k=null;const I=M?Object(o.a)(z,{}):null;let _;k=i&&this.scrollableContent?this.scrollableContent:e.size>0||l?e.map(((t,s)=>null===t?Object(o.a)(N.a,{disabled:i,param:s>0?e.getIn([s-1,"id"]):null,onClick:this.handleLoadGap},"gap:"+e.getIn([s+1,"id"])):Object(o.a)(H.a,{notification:t,accountId:t.get("account"),onMoveUp:this.handleMoveUp,onMoveDown:this.handleMoveDown,unread:"0"!==r&&Object(m.a)(t.get("id"),r)>0},t.get("id")))):null,this.scrollableContent=k;const F=Object(B.jsxs)(B.Fragment,{children:[f&&Object(o.a)(T.a,{}),Object(o.a)(y.a,{})]});_=M?Object(o.a)(P.a,{scrollKey:`notifications-${a}`,trackScroll:!p,isLoading:i,showLoading:i&&0===e.size,hasMore:l,numPending:c,prepend:F,alwaysPrepend:!0,emptyMessage:v,onLoadMore:this.handleLoadOlder,onLoadPending:this.handleLoadPending,onScrollToTop:this.handleScrollToTop,onScroll:this.handleScroll,bindToDocument:!n},void 0,k):Object(o.a)(j.a,{});const S=Object(B.jsxs)(B.Fragment,{children:[Object(o.a)(y.b,{className:"column-header__button"}),b&&Object(o.a)("button",{"aria-label":t.formatMessage(W.markAsRead),title:t.formatMessage(W.markAsRead),onClick:this.handleMarkAsRead,className:"column-header__button"},void 0,Object(o.a)(O.a,{id:"done-all",icon:u.a}))]});return Object(B.jsxs)(C.a,{bindToDocument:!n,ref:this.setColumnRef,label:t.formatMessage(W.title),children:[Object(o.a)(w.b,{icon:"bell",iconComponent:g.a,active:s,title:t.formatMessage(W.title),onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:p,multiColumn:n,extraButton:S},void 0,Object(o.a)(L.a,{})),I,_,Object(o.a)(h.a,{},void 0,Object(o.a)("title",{},void 0,t.formatMessage(W.title)),Object(o.a)("meta",{name:"robots",content:"noindex"}))]})}}Object(s.a)(V,"defaultProps",{trackScroll:!0});e.default=Object(p.connect)((t=>({notifications:J(t),isLoading:t.getIn(["notifications","isLoading"],0)>0,isUnread:t.getIn(["notifications","unread"])>0||t.getIn(["notifications","pendingItems"]).size>0,hasMore:t.getIn(["notifications","hasMore"]),numPending:t.getIn(["notifications","pendingItems"],Object(f.List)()).size,lastReadId:t.getIn(["settings","notifications","showUnread"])?t.getIn(["notifications","readMarkerId"]):"0",canMarkAsRead:t.getIn(["settings","notifications","showUnread"])&&"0"!==t.getIn(["notifications","readMarkerId"])&&J(t).some((e=>null!==e&&Object(m.a)(e.get("id"),t.getIn(["notifications","readMarkerId"]))>0)),needsNotificationPermission:t.getIn(["settings","notifications","alerts"]).includes(!0)&&t.getIn(["notifications","browserSupport"])&&"default"===t.getIn(["notifications","browserPermission"])&&!t.getIn(["settings","notifications","dismissPermissionBanner"])})))(Object(v.e)(Object(r.c)(V)))}}]);
2//# sourceMappingURL=notifications_v1-58cae6a6f4ea12b60783.chunk.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.