PageSourceSearch

https://reporting.happy-or-not.com/assets/AlertsForCategoryPage-BReCbIJi.js

js happy-or-not.com collected 2026-09-24 17:47:37 UTC 4,638 bytes, 15 lines download raw bytes

1import{ac as f,r as l,j as a,K as j}from"./main-DyjxXpTK.js";import{hW as v,gB as P,cy as R,dV as U,dW as b,d_ as D,d$ as O,eg as A,hX as B,dh as _,e8 as m,hY as M,hZ as k,aJ as W,cP as g,eb as q,aD as $,h_ as w,aw as Z,cY as H}from"./App-V_-BsQ0z.js";import{A as Y}from"./AlertsTopNavigation-DQPT2QAe.js";import{A as z}from"./AlertDetailsHeader-vUjAXveK.js";import{AlertDetailsListItem as K}from"./AlertDetailsPage-CNlCn7Mq.js";import{C as V}from"./ContentPageTemplate-B3zrlMfb.js";import{a as G}from"./useDataPollingLoop-BLTJnXfS.js";import{B as J}from"./BellThin-CXEW12HF.js";import"./ToggleNotificationsButton-4ibjYOhS.js";import"./BellOff-ChLk2aR_.js";import"./MoreVertical-77tyo5jK.js";import"./TableLikeListingContent-sB5XxB2h.js";import"./ForwardChevron-C4bTIGaB.js";import"./Table-C66vHri0.js";import"./ChevronDown-yzzOW2OC.js";import"./ListWithExpandableItems-B6MruSM0.js";import"./MessageSquare-DymLQLxr.js";import"./useWidth-m6sZpHpP.js";import"./InfoTooltip-DPMzvBJo.js";import"./usePrevious-Bi1CWbeH.js";import"./ModifiedByAiBadge-C4FEBY2H.js";import"./ResultTooltip-C6eVrlBE.js";import"./Smileys-_UC-jsL7.js";import"./useIsGuardedProfaneFeedbackCheck-Bsq8j3y4.js";import"./generateCategoricalChart-DCzYJ1M3.js";import"./ComposedChart-Di97pvTf.js";import"./YAxis-7z7XdME-.js";import"./MapPin-DTuFTGgx.js";import"./HONTab-B3g7H2fW.js";import"./Tabs-DvtxSWv2.js";import"./KeyboardArrowRight-BGR9k-mx.js";import"./useOpenFeedbackTagVisibilityToggle-BX4K04YL.js";import"./Shield-DpEFchAS.js";import"./DropdownArrow-BfM1_YAx.js";import"./HONDialogBackButton-DB2NXDGq.js";import"./BackwardChevron-DH08CylC.js";import"./useUiLocale-D9EzYlMm.js";function X(e){const{category:t}=e,{id:r,name:s}=t;G(()=>e.fetchAlertsForCategory(r,!0));const n=_(),[d,E]=l.useState(!1),[u,p]=l.useState(void 0),[h,T]=l.useState(!1),[C,F]=l.useState(!1),I=e.isLoading||!d||!C;l.useEffect(()=>(m(y()),e.fetchAlertsForCategory(r).then(o=>{const i=o.find(c=>!M(c.alertSearchResult.alert));p(!!i&&i.alertSearchResult.alert.id||void 0)}).catch(o=>{}),k().then(()=>E(!0)),()=>{m()}),[]),l.useEffect(()=>{s.length&&!C&&(W("Alerts page viewed",{"Mode of access":"Category","Category ID":r,"Category name":s}),F(!0))},[t]),l.useEffect(()=>{e.alertsWithLatestCommentsForCategory&&m(y())},[e.alertsWithLatestCommentsForCategory]);function y(){const o=n.formatMessage({id:g.SideMenu.alerts}),i=x(e.alertsWithLatestCommentsForCategory),c=i.length>0?`, ${i}`:"";return`${o}${c}`}const L=o=>o.alertSearchResult.alert.id===u,S=()=>a.jsx("div",{className:"loading",children:a.jsx(j,{})}),N=o=>{const i=o!==u?o:void 0;p(i),T(h||i!==void 0)};return a.jsx(q,{className:e.className,customTopNavigation:Y,children:a.jsxs("div",{className:"alertsForCategory",children:[e.isError&&a.jsx($,{id:g.Filters.error}),I?S():e.alertsWithLatestCommentsForCategory&&a.jsx(Q,{alertsWithLatestComments:e.alertsWithLatestCommentsForCategory,alertExpandedByUserAtLeastOnce:h,isAlertExpanded:L,expandOrCollapseAlert:N})]})})}function Q(e){const{alertsWithLatestComments:t,expandOrCollapseAlert:r}=e;return 0<t.length?a.jsxs(V,{headerIcon:J,header:{id:g.SideMenu.alerts},hideHeader:!0,children:[a.jsx(Z,{sx:{m:2},children:a.jsx(H,{variant:"h5",children:x(t)})}),t.map((s,n)=>a.jsx("div",{children:e.isAlertExpanded(s)?a.jsx(K,{index:n,alertId:s.alertSearchResult.alert.id,onClick:r,isExpandedByUser:e.alertExpandedByUserAtLeastOnce}):a.jsx(te,{alert:s.alertSearchResult.alert,onClick:r,seen:s.alertSearchResult.seen,latestComment:s.latestComment})},n))]}):null}function x(e){return e&&0<e.length?w(e[0].alertSearchResult.alert):""}function ee(e){return parseInt(e.match.params.id,10)}const te=e=>{const{alert:t}=e;return a.jsx(ne,{children:a.jsx(z,{alert:t,expanded:!1,seen:e.seen,latestComment:e.latestComment,onClick:e.onClick})})},re=v((e,t)=>{const r=P(e,t);return{id:e,name:r?r.name:""}}),ae=(e,t)=>{const r=e.tree.request,s=ee(t),n=e.alertsForCategory.alertsForCategory,d=U(e.authenticatedUser.request.data,b.AUTO_UPDATE_INTERVAL_IN_SECONDS);return{category:r.data?re(s,r.data):{id:s,name:""},alertsWithLatestCommentsForCategory:n.data,isLoading:A.isFetching(n)&&!e.alertsForCategory.isLoadingAutoUp
1date,isError:A.isError(n),autoUpdateIntervalInMilliseconds:O(d),isAutoUpdateEnabled:D(d)}},se=e=>({fetchAlertsForCategory:(t,r)=>e(B(t,r))}),oe=R(ae,se)(X),Ze=f(oe)`
2  .alertsForCategory {
3    .loading {
4      margin-top: 8px;
5      display: flex;
6      justify-content: center;
7      align-items: center;
8    }
9  }
10`,ne=f.div`
11  border-color: ${e=>e.theme.honExtensions.borderColors.medium};
12  border-width: 1px;
13  border-bottom-style: solid;
14  overflow: auto;
15`;export{Ze as default};

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.