PageSourceSearch

https://app.sxconsent.com/assets/index-C2FuYEX6.js

js sxconsent.com collected 2026-10-02 00:57:18 UTC 6,723 bytes, 1 lines download raw bytes

1import{u as A,B as G,r as u,Q as U,k as O,V as P,W as T,X as M,j as e,t as a,L as C,m as z,a4 as F,a5 as J,a6 as Q,a7 as q}from"./index-CUa0k95W.js";import{P as D,B as y,N as b,C as H,a as S}from"./ui-DhdXE8jM.js";import{u as K,i as V,U as W}from"./UnresolvedSessionGate-DoT8rGJT.js";import{p as h}from"./participant-display-BylZ4Hh9.js";const X="sx.consent.recentInvites";function Y(){if(typeof window>"u")return[];try{return JSON.parse(window.sessionStorage.getItem(X)||"[]")}catch{return[]}}function Z(s){if(Array.isArray(s))return s;if(s&&typeof s=="object"){const r=s;for(const t of["items","invites","data","results"])if(Array.isArray(r[t]))return r[t]}return[]}function I(s,r){const t=(s.status??"").toLowerCase(),i=(s.active_session_status??"").toLowerCase(),m=(s.unresolved_lifecycle_status??"").toLowerCase();return m==="closed_after_final_evidence"||m==="final_evidence_sealed"||i==="final_evidence_sealed"||i==="ended"||i==="closed"||i==="completed"||i==="closure_completed"||t==="evidence_sealed_closed"?"closed_sealed":i==="closure_pending"||i==="withdrawal_pending"||t==="closure_pending"?"closure_pending":i==="active"||i==="paused"||i==="resumed"?"active":t==="declined"||t==="cancelled"||t==="canceled"||t==="expired"?"ended":t==="completed"||t==="closed"||t==="closure_completed"?"closed":t==="accepted"||t==="agreement_created"||t==="pending_signatures"||t==="signed"||t==="evidence_sealed"||t==="requires_review"?"accepted":t==="pending"&&r==="invitee"?"needs_my_action":"pending"}function ee(s){return a(`inv.group.${s}`)}const se=["needs_my_action","active","closure_pending","accepted","pending","closed_
1sealed","closed","ended"];function te(s,r,t){const i=s.session_id??s.id??"";return t==="needs_my_action"?{label:a("inv.action.accept"),to:`/invites/${i}/accept`}:t==="pending"&&r==="inviter"?{label:a("inv.action.waiting"),disabled:!0}:t==="pending"?{label:a("inv.action.pending"),disabled:!0}:t==="ended"?{label:a("inv.action.closed"),disabled:!0}:{label:a("inv.action.historical"),disabled:!0}}function ce(){A();const s=G("unknown"),r=K(),t=V(r)&&r.status!=="loading",[i,m]=u.useState(null),[N,w]=u.useState(null),[_,d]=u.useState("loading"),[o,x]=u.useState(null),[p,f]=u.useState(null),[k,E]=u.useState(null),$=Y(),B=s.status==="loading"||s.status==="redirecting"||s.status==="unavailable"||s.status==="ready"&&s.locked,g=u.useCallback(()=>{U.list().then(n=>{w(n),m(Z(n)),d("200"),x(null)}).catch(n=>{x(n.friendly),d(String(n.status))})},[]);if(u.useEffect(()=>{let n=!0;return g(),O.me().then(c=>{n&&(f(P(c)),E(T(c)))}).catch(()=>{}),()=>{n=!1}},[g]),M(g,{intervalMs:15e3}),B)return e.jsx("p",{className:"text-sm text-muted-foreground",children:a("inv.checking")});function v(n){return F(n,k,p)}const j={needs_my_action:[],pending:[],accepted:[],active:[],closure_pending:[],closed_sealed:[],closed:[],ended:[]};if(i){const n=new Set;for(const c of i){const l=c.session_id??c.id??"";l&&n.has(l)||(l&&n.add(l),j[I(c,v(c))].push(c))}}const L=$.filter(n=>{const c=n.session_id??n.id;return c&&!(i??[]).some(l=>(l.session_id??l.id)===c)});return e.jsxs(e.Fragment,{children:[e.jsx(D,{title:a("inv.title"),subtitle:a("inv.subtitle"),back:"/dashboard"}),r.status!=="clear"&&r.status!=="loading"&&e.jsx("div",{className:"mb-3",children:e.jsx(W,{state:r,compact:!0})}),e.jsx("div",{className:"mb-3",children:t?e.jsx(y,{disabled:!0,children:a("inv.createBlocked")}):e.jsx(C,{to:"/invites/create",children:e.jsx(y,{children:a("inv.createNew")})})}),e.jsx(b,{tone:"info",children:a("inv.oneAtATime")}),o&&e.jsx(b,{tone:"warn",children:o}),!i&&e.jsx("p",{className:"text-sm text-muted-foreground",children:a("inv.loading")}),L.length>0&&e.jsxs("section",{className:"mt-3 mb-3",children:[e.jsx("h2",{className:"text-sm font-semibold mb-2",children:a("inv.recentTitle")}),e.jsx("ul",{className:"space-y-2",children:L.map((n,c)=>e.jsx("li",{children:e.jsx(R,{i:n,role:v(n),group:I(n,v(n))})},(n.session_id??n.id??"r")+c))}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a("inv.recentNote")})]}),i&&se.map(n=>j[n].length>0&&e.jsxs("section",{className:"mt-4",children:[e.jsx("h2",{className:"text-sm font-semibold mb-2",children:ee(n)}),e.jsx("ul",{className:"space-y-2",children:j[n].map(c=>{const l=c.session_id??c.id??"";return e.jsx("li",{children:e.jsx(R,{i:c,role:v(c),group:n})},l)})})]},n)),i&&i.length===0&&e.jsx(b,{tone:"info",children:a("inv.noneReturned")}),z()&&e.jsxs("details",{className:"mt-4 text-xs",children:[e.jsx("summary",{className:"cursor-pointer text-muted-foreground",children:"Internal debug"}),e.jsxs("div",{className:"mt-2 space-y-1",children:[e.jsxs("p",{children:["GET /session-invites status: ",_]}),e.jsxs("p",{children:["invite count: ",i?.length??"—"]}),e.jsxs("p",{children:["current user email: ",p??"(unknown)"]}),e.jsxs("p",{children:["current user id: ",k??"(unknown)"]}),e.jsx("pre",{className:"overflow-x-auto rounded bg-muted p-2 text-[10px]",children:JSON.stringify(N,null,2)})]})]})]})}function R({i:s,role:r,group:t}){const i=s.session_id??s.id??"",m=(s.status??"pending").toLowerCase(),_=t==="active"?"success":t==="closure_pending"?"warn":m==="declined"||m==="expired"?"safety":"neutral",d=te(s,r,t),o=A(),x=r==="invitee"?`${a("accept.invitedBy")}: ${h(s,"inviter",o)}`:r==="inviter"?`${a("inv.to")}: ${h(s,"invitee",o)}`:s.inviter_email?`${a("inv.from")}: ${h(s,"inviter",o)}`:s.invitee_email?`${a("inv.to")}: ${h(s,"invitee",o)}`:a("inv.invite"),p=J(s.invitation_invitation_type,o),f=[s.proposed_session_date,s.proposed_start_time].filter(Boolean).join(" ");return e.jsxs(H,{className:"hover:border-primary/40",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm font-medium break-all",children:x}),e.jsxs("div",{className:"flex items-center gap-2",children:[r!=="unknown"&&e.jsx(S,{tone:"neutral",children:Q(r,o)}),e.jsx(S,{tone:_,children:q(s.active_session_status??s.status,o)})]})]}),p&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[a("inv.purpose"),": ",p]}),s.proposed_location_label&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s.proposed_location_label}),f&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[a("inv.when"),": ",f]}),i&&e.jsxs("p",{className:"text-[10px] text-muted-foreground mt-1 font-mono break-all",children:["session_id: ",i]}),i&&e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:d.disabled||!d.to?e.jsx(y,{variant:"secondary",disabled:!0,children:d.label}):e.jsx(C,{to:d.to,className:"inline-flex items-center justify-center rounded-md px-3 py-2 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90",children:d.label})})]})}export{ce as component};

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.