PageSourceSearch

https://haystack.sh/assets/OrgMembersPage-DQteqOIL.js

js haystack.sh collected 2026-10-10 02:25:37 UTC 13,985 bytes, 30 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a1235e-1555-74b2-a305-77a28220c502")}catch(e){}}();import{i as ee,d as se,r,j as e}from"./vendor-react-5EL95cED.js";import{a6 as te,a7 as ae,I as re}from"./main-CuxdyMiW.js";import{h as l,L as o,H as ne,R as ie,C as le,X as ce}from"./App-CQqKVdRi.js";import{A as oe,U as I}from"./users-DV3Xonas.js";import{G as de}from"./github-BeSo10UO.js";import{C as L}from"./check-BGHzWqPG.js";import{L as xe}from"./link-2-BYh9gNB9.js";import{U as me}from"./user-plus-IIQ7Ozo4.js";import{U as d}from"./user-DkO8zEFu.js";import{S as R}from"./shield-vrwqvmPG.js";import{T as ge}from"./trash-2-fcZMW7gx.js";import"./oauthScopeStore-tUyMl6WJ.js";/**
2 * @license lucide-react v0.563.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const ue=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],he=l("crown",ue);/**
7 * @license lucide-react v0.563.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const pe=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],ye=l("ellipsis-vertical",pe);/**
12 * @license lucide-react v0.563.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const fe=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],je=l("mail",fe);/**
17 * @license lucide-react v0.563.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const ve=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],be=l("user-minus",ve);/**
22 * @license lucide-react v0.563.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const Ne=[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M22 19h-6",key:"vcuq98"}]],we=l("user-round-plus",Ne);function Ee(){const{slug:i}=ee(),$=se();te();const n=ae(),{viewedOrg:t,viewedOrgMembers:x,pendingSync:m,isLoadingOrg:A,isLoadingMembers:P,isLoadingPendingSync:_e,error:p,fetchOrg:y,fetchOrgMembers:f,fetchPendingSync:j,approvePendingSync:H,dismissPendingSync:O,inviteMember:E,updateMemberRole:U,removeMember:G,syncGitHub:D,clearError:q}=re(),[g,v]=r.useState(""),[b,z]=r.useState("member"),[N,w]=r.useState(!1),[_,k]=r.useState(!1),[F,u]=r.useState(!1),[C,h]=r.useState(null),[T,c]=r.useState(null),[B,S]=r.useState(!1);r.useEffect(()=>{if(i){if(t&&t.slug===i)return;y(i)}},[i,t,y]),r.useEffect(()=>{t&&(f(t.org_id),n&&j(t.org_id))},[t,f,j,n]);const V=async s=>{if(s.preventDefault(),!(!t||!g.trim())){q(),w(!0);try{const a=await E(t.org_id,{email:g.trim(),role:b});v(""),u(!1),a.warning&&alert(a.warning)}catch{}finally{w(!1)}}},M=async(s,a)=>{if(t){h(null);try{await U(t.org_id,s.user_id,a)}catch{}}},X=async s=>{if(t&&confirm(`Remove ${s.name||s.email} from the team?`)){h(null);try{const a=await G(t.org_id,s.user_id);a.warning&&alert(a.warning)}catch{}}},J=async()=>{if(t){k(!0);try{const s=await D(t.org_id);let a=`Sync complete: ${s.added} added, ${s.removed} removed`;s.warning&&(a+=`
27
28⚠️ ${s.warning}`),alert(a)}catch{}finally{k(!1)}}},K=async()=>{if(!(t!=null&&t.invite_link_token))return;const s=`${window.location.origin}/join/${t.invite_link_token}`;await navigator.clipboard.writeText(s),S(!0),setTimeout(()=>S(!1),2e3)},Q=async s=>{if(t){c(s.sync_id);try{await H(t.org_id,s.sync_id)}catch{}finally{c(null)}}},W=async s=>{if(t){c(s.sync_id);try{await O(t.org_id,s.sync_id)}catch{}finally{c(null)}}},Y=s=>{switch(s){case"owner":return e.jsx(he,{className:"w-4 h-4 text-yellow-400"});case"admin":return e.jsx(R,{className:"w-4 h-4 text-purple-400"});default:return e.jsx(d,{className:"w-4 h-4 text-gray-400"})}},Z=s=>{const a={owner:"bg-yellow-900/30 text-yellow-400",admin:"bg-purple-900/30 text-purple-400",member:"bg-gray-800 text-gray-400"};return a[s]||a.member};return A||P?e.jsx("div",{className:"h-screen flex items-center justify-center",style:{backgroundColor:"#13131a"},children:e.jsx(o,{className:"w-6 h-6 animate-spin text-gray-400"})}):t?e.jsx("div",{className:"h-screen",style:{backgroundColor:"#13131a"},children:e.jsx(ne,{children:e.jsx("div",{className:"py-8 px-4",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>$(`/org/${i}/settings`),className:"p-2 text-gray-400 hover:text-gray-200",children:e.jsx(oe,{className:"w-5 h-5"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-5 h-5 text-purple-400"}),e.jsx("h1",{className:"text-xl font-semibold text-white",children:"Team Members"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t.github_org_login&&n&&e.jsxs("button",{onClick:J,disabled:_,className:"flex items-center gap-2 px-3 py-1.5 text-sm text-gray-400 hover:text-gray-200 hover:bg-gray-800 rounded-lg transition-colors",children:[_?e.jsx(o,{className:"w-4 h-4 animate-spin"}):e.jsx(ie,{className:"w-4 h-4"}),e.jsx(de,{className:"w-4 h-4"}),"Sync"]}),n&&t.invite_link_token&&e.jsx("button",{onClick:K,className:"flex items-center gap-2 px-3 py-1.5 text-sm text-gray-400 hover:text-gray-200 hover:bg-gray-800 rounded-lg transition-colors",children:B?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"w-4 h-4 text-green-400"}),e.jsx("span",{className:"text-green-400",children:"Copied!"})]}):e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"w-4 h-4"}),"Copy Link"]})}),n&&e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-2 px-3 py-1.5 text-sm bg-purple-600 hover:bg-purple-700 text-white rounded-lg transition-colors",children:[e.jsx(me,{className:"w-4 h-4"}),"Invite"]})]})]}),p&&e.jsx("div",{className:"mb-4 p-3 bg-red-900/20 border border-red-800 rounded-lg text-sm text-red-400",children:p}),F&&e.jsx("div",{className:"mb-6 rounded-xl border border-gray-700 p-4",style:{backgroundColor:"#171717"},children:e.jsxs("form",{onSubmit:V,className:"flex items-end gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1",children:"Email Address"}),e.jsx("input",{type:"email",value:g,onChange:s=>v(s.target.value),placeholder:"[email protected]",className:"w-full px-3 py-2 rounded-lg border border-gray-700 bg-gray-800 text-gray-100 placeholder-gray-500 focus:ring-2 focus:ring-purple-500 focus:border-transparent",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1",children:"Role"}),e.jsxs("select",{value:b,onChange:s=>
28z(s.target.value),className:"px-3 py-2 rounded-lg border border-gray-700 bg-gray-800 text-gray-100",children:[e.jsx("option",{value:"member",children:"Member"}),e.jsx("option",{value:"admin",children:"Admin"})]})]}),e.jsx("button",{type:"submit",disabled:N,className:"px-4 py-2 bg-purple-600 hover:bg-purple-700 disabled:bg-purple-400 text-white rounded-lg transition-colors",children:N?e.jsx(o,{className:"w-4 h-4 animate-spin"}):"Send Invite"}),e.jsx("button",{type:"button",onClick:()=>u(!1),className:"px-4 py-2 text-gray-400 hover:bg-gray-800 rounded-lg transition-colors",children:"Cancel"})]})}),n&&m.length>0&&e.jsxs("div",{className:"mb-6 rounded-xl border border-blue-800/50 bg-blue-900/20 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(le,{className:"w-5 h-5 text-blue-400"}),e.jsx("h3",{className:"text-sm font-medium text-blue-300",children:"GitHub Org Changes Detected"}),e.jsxs("span",{className:"px-2 py-0.5 text-xs bg-blue-800/50 text-blue-300 rounded-full",children:[m.length," pending"]})]}),e.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Members have been added or removed from your linked GitHub organization. Review and approve these changes to sync your team."}),e.jsx("ul",{className:"space-y-2",children:m.map(s=>e.jsxs("li",{className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[s.action==="member_added"?e.jsx("div",{className:"w-8 h-8 rounded-full bg-green-900/30 flex items-center justify-center",children:e.jsx(we,{className:"w-4 h-4 text-green-400"})}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-red-900/30 flex items-center justify-center",children:e.jsx(be,{className:"w-4 h-4 text-red-400"})}),s.github_avatar_url||s.github_username?e.jsx("img",{src:s.github_avatar_url||`https://avatars.githubusercontent.com/${s.github_username}`,alt:"",className:"w-8 h-8 rounded-full"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-700 flex items-center justify-center",children:e.jsx(d,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"font-medium text-white",children:["@",s.github_username]}),e.jsxs("span",{className:`text-xs px-1.5 py-0.5 rounded ${s.action==="member_added"?"bg-green-900/30 text-green-400":"bg-red-900/30 text-red-400"}`,children:[s.action==="member_added"?"joined":"left"," GitHub org"]})]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[new Date(s.created_at*1e3).toLocaleDateString()," via @",s.triggered_by_username]})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:T===s.sync_id?e.jsx(o,{className:"w-4 h-4 animate-spin text-gray-400"}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>Q(s),className:"flex items-center gap-1.5 px-3 py-1.5 text-sm bg-green-600 hover:bg-green-700 text-white rounded-lg transition-colors",title:s.action==="member_added"?"Add to Haystack team":"Remove from Haystack team",children:[e.jsx(L,{className:"w-4 h-4"}),s.action==="member_added"?"Add":"Remove"]}),e.jsxs("button",{onClick:()=>W(s),className:"flex items-center gap-1.5 px-3 py-1.5 text-sm text-gray-400 hover:bg-gray-700 rounded-lg transition-colors",title:"Dismiss without action",children:[e.jsx(ce,{className:"w-4 h-4"}),"Ignore"]})]})})]},s.sync_id))})]}),e.jsxs("div",{className:"mb-4 text-sm text-gray-400",children:[x.filter(s=>s.status==="active").length," of ",t.seat_limit," ","seats used"]}),e.jsx("div",{className:"rounded-xl border border-gray-700",style:{backgroundColor:"#171717"},children:x.length===0?e.jsxs("div",{className:"p-8 text-center text-gray-500",children:[e.jsx(I,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No members yet"})]}):e.jsx("ul",{className:"divide-y divide-gray-800",children:x.map(s=>e.jsxs("li",{className:"flex items-center justify-between px-4 py-3 hover:bg-gray-800/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[s.avatar_url||s.github_username?e.jsx("img",{src:s.avatar_url||`https://avatars.githubusercontent.com/${s.github_username}`,alt:"",className:"w-9 h-9 rounded-full"}):e.jsx("div",{className:"w-9 h-9 rounded-full bg-gray-700 flex items-center justify-center",children:e.jsx(d,{className:"w-5 h-5 text-gray-400"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-white",children:s.name||s.github_username||s.email||s.invite_email}),s.status==="pending"&&e.jsxs("span",{className:"flex items-center gap-1 text-xs text-orange-400",children:[e.jsx(je,{className:"w-3 h-3"}),"Pending"]})]}),e.jsx("div",{className:"text-sm text-gray-400",children:s.email||s.invite_email||s.github_username&&`@${s.github_username}`})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:`flex items-center gap-1.5 px-2 py-0.5 text-xs font-medium rounded-full ${Z(s.role)}`,children:[Y(s.role),s.role.charAt(0).toUpperCase()+s.role.slice(1)]}),n&&s.role!=="owner"&&e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>
28h(C===s.user_id?null:s.user_id),className:"p-1 text-gray-500 hover:text-gray-300 rounded",children:e.jsx(ye,{className:"w-4 h-4"})}),C===s.user_id&&e.jsxs("div",{className:"absolute right-0 mt-1 w-40 bg-gray-900 border border-gray-700 rounded-lg shadow-lg z-10 overflow-hidden",children:[s.role==="admin"?e.jsxs("button",{onClick:()=>M(s,"member"),className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-300 text-left hover:bg-gray-800",children:[e.jsx(d,{className:"w-4 h-4"}),"Make Member"]}):e.jsxs("button",{onClick:()=>M(s,"admin"),className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-300 text-left hover:bg-gray-800",children:[e.jsx(R,{className:"w-4 h-4"}),"Make Admin"]}),e.jsxs("button",{onClick:()=>X(s),className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-left text-red-400 hover:bg-red-900/20",children:[e.jsx(ge,{className:"w-4 h-4"}),"Remove"]})]})]})]})]},s.user_id||s.invite_token||s.email||s.invite_email))})})]})})})}):e.jsx("div",{className:"h-screen flex items-center justify-center",style:{backgroundColor:"#13131a"},children:e.jsx("p",{className:"text-gray-500",children:"Organization not found"})})}export{Ee as OrgMembersPage};
29
30//# chunkId=01a1235e-1555-74b2-a305-77a28220c502

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.