1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fa65c4af-17e3-4a05-bffe-93985816497d",e._sentryDebugIdIdentifier="sentry-dbid-fa65c4af-17e3-4a05-bffe-93985816497d")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[768],{20669:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/threads",function(){return n(2084)}])},62634:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(31134).Z)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},13761:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(31134).Z)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]])},12895:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(31134).Z)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},56761:function(e,t,n){"use strict";n.d(t,{D:function(){return s}});var r=n(85893);n(67294);var a=n(56578);let l={full:"w-full",form:"w-full max-w-form"};function s(e){let{title:t,purpose:n,actions:s,breadcrumb:i,header:o,tabs:c,filters:d,width:u="full",loading:h=!1,error:f,onRetry:m,empty:p,children:y}=e,x=o||(i?{title:t,context:i.label}:null),b=y;return h?b=(0,r.jsx)(a.oY,{rows:4}):f?b=(0,r.jsx)(a.Te,{onRetry:m,children:f}):p&&(b=(0,r.jsx)(a.ub,{label:p.label,action:p.action,children:p.message})),(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-main-gap",children:[x&&!h?(0,r.jsx)(a.mr,{title:x.title,context:x.context}):null,i?(0,r.jsx)(a.aG,{href:i.href,label:i.label,trail:function(e){if(!e)return null;let t=(Array.isArray(e)?e:[e]).filter(e=>!!e);return t.length>0?t.join(" / "):null}(i.trail)}):null,(0,r.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-x-6 gap-y-3",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,r.jsx)("h1",{className:"type-display-m text-content-primary",children:t}),n?(0,r.jsx)("p",{className:"type-body text-content-secondary",children:n}):null]}),s?(0,r.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:s}):null]}),c?(0,r.jsx)(a.Yb,{...c}):null,d?(0,r.jsx)("div",{className:"sticky top-header-h z-20 flex flex-wrap items-center gap-2 bg-surface-page py-2",children:d}):null,(0,r.jsx)("div",{className:["flex min-w-0 flex-col gap-main-gap",l[u]].join(" "),children:b})]})}},94626:function(e,t,n){"use strict";n.d(t,{E5:function(){return f},Ex:function(){return d},Z6:function(){return m},hs:function(){return h},z0:function(){return u}});var r=n(85893),a=n(67294),l=n(73935),s=n(11163),i=n(62190),o=n(56578),c=n(45621);function d(){let e=(0,s.useRouter)(),t=e.query.open,n="string"==typeof t&&t?t:null,r=(0,a.useRef)(!1),l=(0,a.useCallback)(t=>{let n={};return Object.keys(e.query).forEach(t=>{let r=e.query[t];void 0!==r&&"open"!==t&&(n[t]=r)}),t&&(n.open=t),{pathname:e.pathname,query:n}},[e]),i=(0,a.useCallback)(t=>{if(n){e.replace(l(t),void 0,{shallow:!0,scroll:!1});return}r.current=!0,e.push(l(t),void 0,{shallow:!0,scroll:!1})},[e,l,n]),o=(0,a.useCallback)(()=>{if(r.current){r.current=!1,e.back();return}e.replace(l(null),void 0,{shallow:!0,scroll:!1})},[e,l]);return(0,a.useEffect)(()=>{n||(r.current=!1)},[n]),{openId:n,open:i,close:o}}function u(e,t){let n=(0,a.useRef)(null);return(e&&t&&(n.current={id:t,record:e}),e)?e:n.current&&n.current.id===t?n.current.record:void 0}function h(e){let t,{open:n,onClose:d,kind:u,title:h,subtitle:f,loading:m=!1,error:p,onRetry:y,facts:x,actions:b,links:w,notice:v,children:j}=e,{mayOpen:g}=(0,c.a)(),k=(0,s.useRouter)(),N=(0,a.useRef)(null),A=(0,a.useRef)(!1);n&&"string"==typeof k.query.open&&k.query.open&&(N.current=k.query.open);let q=(0,a.useRef)(null),T=(0,a.useRef)(null),E=(0,a.useRef)(null),C=(0,a.useRef)(d);C.current=d;let D=(0,a.useId)(),[R,_]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{_(!0)},[]),(0,a.useEffect)(()=>{var e;if(!n)return;E.current=document.activeElement||null,null===(e=T.current)||void 0===e||e.focus();let t=e=>{if("Escape"===e.key){e.preventDefault(),C.current();return}if("Tab"!==e.key||!q.current)return;let t=Array.from(q.current.querySelectorAll('a[href],button:not([disabled]),input
1:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])'));if(0===t.length)return;let n=t[0],r=t[t.length-1],a=document.activeElement;e.shiftKey&&(a===n||!q.current.contains(a))?(e.preventDefault(),r.focus()):e.shiftKey||a!==r&&q.current.contains(a)||(e.preventDefault(),n.focus())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n]),(0,a.useEffect)(()=>{if(n){A.current=!0;return}A.current&&(A.current=!1,function(e,t){if(e&&e!==document.body&&document.contains(e)){e.focus();return}let n=t?Array.from(document.querySelectorAll("[data-row-key]")).filter(e=>e.getAttribute("data-row-key")===t)[0]:void 0;if(n){n.focus();return}let r=document.querySelector("[data-admin-table]");r&&r.focus()}(E.current,N.current),E.current=null,N.current=null)},[n]),!n||!R)return null;let S=(w||[]).filter(e=>!e.route||g(e.route));return t=p?(0,r.jsx)(o.Te,{onRetry:y,children:p}):m?(0,r.jsx)(o.oY,{rows:4,label:"Loading this ".concat(u.toLowerCase())}):(0,r.jsxs)(r.Fragment,{children:[v?(0,r.jsx)("p",{role:"error"===v.tone?"alert":"status",className:["rounded-a-btn px-3 py-2 type-body-s","error"===v.tone?"bg-feedback-error-surface text-feedback-error":"bg-feedback-success-surface text-content-on-accent"].join(" "),children:v.text}):null,x&&x.length>0?(0,r.jsx)("dl",{className:"grid grid-cols-[minmax(0,2fr)_minmax(0,3fr)] gap-x-4 gap-y-2",children:x.map(e=>(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("dt",{className:"type-meta text-content-meta",children:e.label}),(0,r.jsx)("dd",{className:"min-w-0 break-words type-body-s text-content-primary",children:e.value})]},e.label))}):null,j,b?(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-2 border-t border-border-hairline pt-4",children:b}):null]}),(0,l.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex justify-end",children:[(0,r.jsx)("div",{"aria-hidden":"true",className:"absolute inset-0 bg-content-primary/25",onClick:()=>C.current()}),(0,r.jsxs)("div",{ref:q,role:"dialog","aria-modal":"true","aria-labelledby":D,className:"relative flex h-full w-side-panel-w max-w-full flex-col border-l border-border-hairline bg-surface-card",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3 border-b border-border-hairline px-card-pad py-4",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,r.jsx)("p",{className:"type-label text-content-meta",children:u}),(0,r.jsx)("h2",{id:D,className:"type-title-s break-words text-content-primary",children:h}),f?(0,r.jsx)("p",{className:"type-body-s text-content-secondary",children:f}):null]}),(0,r.jsx)(o.zx,{ref:T,variant:"quiet",size:"sm",onClick:()=>C.current(),"aria-label":"Close",children:(0,r.jsx)(i.Z,{"aria-hidden":"true",className:"h-icon-l w-icon-l"})})]}),(0,r.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-card-pad py-4",children:t}),S.length>0?(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-2 border-t border-border-hairline px-card-pad py-3",children:S.map((e,t)=>(0,r.jsx)(o.zx,{href:e.href,variant:0===t?"secondary":"quiet",size:"sm",children:e.label},e.href))}):null]})]}),document.body)}function f(e){let{label:t,api:n,onClick:a,variant:l="secondary",loading:s,disabled:i}=e,{mayCall:d}=(0,c.a)();return d(n.path,n.method)?(0,r.jsx)(o.zx,{variant:l,size:"sm",onClick:a,loading:s,disabled:i,children:t}):null}function m(e){let{sentence:t,confirmLabel:n,onConfirm:l,...s}=e,[i,d]=(0,a.useState)(!1),{mayCall:u}=(0,c.a)();return u(s.api.path,s.api.method)?i?(0,r.jsxs)("div",{className:"flex w-full flex-wrap items-center gap-2 rounded-a-btn bg-surface-quiet p-3",children:[(0,r.jsx)("p",{className:"w-full type-body-s text-content-primary",children:t}),(0,r.jsx)(f,{...s,label:n,variant:"primary",onClick:l}),(0,r.jsx)(o.zx,{variant:"quiet",size:"sm",onClick:()=>d(!1),disabled:s.loading,children:"Keep it as it is"})]}):(0,r.jsx)(f,{...s,onClick:()=>d(!0)}):null}},2084:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return x}});var r=n(85893),a=n(67294),l=n(9008),s=n.n(l),i=n(56578),o=n(56761),c=n(91713),d=n(94626),u=n(28026),h=n(37231),f=n(49803);function m(e,t){return"".concat((0,f.xA)(e,t),", ").concat((0,f.D4)(e,t))}function p(e,t){return e?Math.max(0,Math.floor((t-new Date(e).getTime())/36e5)):0}function y(e,t){if(!e)return"";let n=p(e,t);return n<1?"Less than an hour":n<48?"".concat(n," ").concat(1===n?"hour":"hours"):"".concat(Math.floor(n/24)," days")}function x(){let e=(0,h.a)(),t=(0,c.VR)(),{openId:n,open:l,close:x}=(0,d.Ex)(),b="answered"===t.get("view"),[w,v]=(0,a.useState)(null),[j,g]=(0,a.useState)(null),[k]=(0,a.useState)(()=>Date.now()),N=(0,a.useCallback)(async()=>{g(null);try{let e=await fetch("/api/admin/threads"),t=await e.json().catch(()=>({}));
1if(!e.ok)throw Error(t.error||"The queue did not load.");v(t)}catch(e){g(e instanceof Error?e.message:"The queue did not load.")}},[]);(0,a.useEffect)(()=>{N()},[N]);let A=[{id:"question",header:"Question",sortValue:e=>e.question,cell:e=>(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"type-body-strong",children:e.question}),(0,r.jsx)("p",{className:"type-meta text-content-meta",children:e.competencies.length>0?e.competencies.join(", "):"No competency chosen"})]})},{id:"asker",header:"Asked by",sortValue:e=>e.asker.name,cell:e=>(0,r.jsxs)("span",{className:"flex flex-wrap items-center gap-1",children:[e.asker.name,e.anonymous?(0,r.jsx)(i.Af,{variant:"outline",children:"Anonymous to members"}):null]})},{id:"overdue",header:"Overdue by",sortValue:e=>p(e.answerDueAt,k),cell:e=>(0,r.jsx)("span",{className:"type-body-strong",children:y(e.answerDueAt,k)})}],q=[{id:"question",header:"Question",sortValue:e=>e.question,cell:e=>(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"type-body-strong",children:e.question}),(0,r.jsxs)("p",{className:"line-clamp-1 type-meta text-content-meta",children:["DONT_KNOW"===e.kind?"We do not know. ":"",e.lead]})]})},{id:"writer",header:"Written by",sortValue:e=>e.writtenBy,cell:e=>e.writtenBy},{id:"helped",header:"Did it help",sortValue:e=>e.notHelpedAt?0:1,cell:e=>e.notHelpedAt?(0,r.jsx)(i.Af,{variant:"solid",children:"Did not help"}):"Nobody said no"},{id:"written",header:"Written",sortValue:e=>e.createdAt,cell:t=>(0,f.xA)(t.createdAt,e)}],T=!b&&n&&w?w.waiting.find(e=>e.id===n):void 0,E=b&&n&&w?w.answered.find(e=>e.id===n):void 0;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s(),{children:(0,r.jsx)("title",{children:"Threads Nobody Answered | Admin"})}),(0,r.jsxs)(o.D,{title:"Threads",purpose:"A question lands here when two days pass with no reply from a member. Nobody was emailed when it did. Whatever you publish is signed by the Athena team, never by you, and the asker gets one email.",filters:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.jT,{label:"Search threads",placeholder:"Look for a question",query:t}),(0,r.jsx)(i.Nz,{pressed:!b,onClick:()=>t.set({view:null,sort:null}),children:w?"Waiting (".concat(w.waiting.length,")"):"Waiting"}),(0,r.jsx)(i.Nz,{pressed:b,onClick:()=>t.set({view:"answered",sort:null}),children:"Answered"})]}),children:[b?(0,r.jsx)(c.wQ,{noun:{one:"answer",many:"answers"},columns:q,rows:w?w.answered:null,rowKey:e=>e.id,query:t,searchText:e=>"".concat(e.question," ").concat(e.lead," ").concat(e.writtenBy),error:j,onRetry:N,empty:{label:"No answers yet",message:"The team has not answered a thread yet."},onOpen:e=>l(e.id),openKey:n,rowMuted:e=>!!e.hiddenAt}):(0,r.jsx)(c.wQ,{noun:{one:"question",many:"questions"},columns:A,rows:w?w.waiting:null,rowKey:e=>e.id,query:t,searchText:e=>"".concat(e.question," ").concat(e.asker.name," ").concat(e.asker.email," ").concat(e.competencies.join(" ")),error:j,onRetry:N,empty:{label:"Nothing waiting",message:"Every question has a reply from a member or an answer from the team. New ones arrive within the hour after two quiet days."},onOpen:e=>l(e.id),openKey:n}),(0,r.jsx)(d.hs,{open:!!n,onClose:x,kind:b?"Answered thread":"Waiting thread",title:T?T.question:E?E.question:"Thread",loading:null===w&&!j,error:null===w||T||E?null:"This thread is not in this list any more.",facts:T?[{label:"Overdue by",value:y(T.answerDueAt,k)},{label:"Asked by",value:"".concat(T.asker.name," (").concat(T.asker.email,")").concat(T.asker.company?", ".concat(T.asker.company):"")},{label:"Her name",value:T.anonymous?"She asked without it. Members see the thread as anonymous; only staff see this.":"Shown to members"},{label:"Sent",value:T.sentAt?m(T.sentAt,e):"Not recorded"},{label:"Routed",value:T.routedToEveryone?"To everybody":"To ".concat(T.routedCount)},{label:"Widened",value:T.widenedAt?m(T.widenedAt,e):"No"},{label:"Competencies",value:T.competencies.length>0?T.competencies.join(", "):"None chosen"}]:E?[{label:"Kind",value:"DONT_KNOW"===E.kind?"We do not know":"Answer"},{label:"Written",value:"".concat(m(E.createdAt,e)," by ").concat(E.writtenBy)},{label:"Did it help",value:E.notHelpedAt?"The asker said it did not, ".concat(m(E.notHelpedAt,e)):"Nobody has said it did not"},{label:"Replies since",value:E.memberRepliedSince?"A member has replied":"None"},{label:"From the card",value:E.askedFromCard>0?"Sent to ".concat(E.askedFromCard):"Not sent"},{label:"Hidden",value:E.hiddenAt?"".concat(m(E.hiddenAt,e)).concat(E.hiddenBy?" by ".concat(E.hiddenBy):""):"No"},{label:"What it says",value:(0,r.jsx)("span",{className:"whitespace-pre-wrap",children:E.lead})}]:[],links:T?[{label:"Write the answer",href:"/admin/threads/".concat(encodeURIComponent(T.id)),route:"/admin/threads/[id]"},{label:"See it as a member",href:(0,u.ct)(T.id)}]:E?[{label:"Open the thread",href:"/admin/threads/".concat(encodeURIComponent(E.threadId)),route:"/admin/threads/[id]"},{label:"See it as a member",href:(0,u.ct)(E.threadId)}]:[],children:(0,r.jsx)("p",{className:"type-body-s text-content-secondary",children:"Members see every answer signed by the Athena team. The asker gets one email when it is published."})})]})]})}}},function(e){e.O(0,[6040,2888,9774,179],function(){return e(e.s=20669)}),_N_E=e.O()}]);
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.