PageSourceSearch

https://gg.givingcompass.org/_nuxt/B8XLYBZ4.js

js givingcompass.org collected 2026-09-24 09:19:42 UTC 9,255 bytes, 1 lines download raw bytes

1import{_ as e}from"./DpWTXjFB.js";import{P as a}from"./CrK_MUeO.js";import{r as t,e as s,V as o,p as i,_ as r}from"#entry";import{u as l}from"./inpFMjNm.js";import{u as n}from"./Bqe6jgkV.js";import{V as m}from"./B9goy8s8.js";import{V as d}from"./DS5vur34.js";import{V as c}from"./369w539r.js";import{V as u}from"./Ch9sftxZ.js";import{V as p,a as g,b as f,c as v}from"./BWrehKB2.js";import{V as h}from"./CVi8ooJQ.js";import{V as y}from"./Bpq7MrYI.js";import{V as b}from"./BWNBbf6k.js";import{V as j}from"./D-JenzQK.js";import{V as k}from"./BzdmcfQK.js";import{B as C,r as _,d as x,c as V,x as w,aG as E,ay as A,aw as z,R as $,av as O,$ as S,C as U,az as N,aq as P,aH as T,i as G}from"./nX7w3--X.js";import"./CzuCJjyz.js";import"./CNAuE06t.js";import"./C-u_YpPl.js";import"./CtG27aky.js";import"./CzdGDBjF.js";import"./D7YexoFe.js";import"./7ukZPocg.js";import"./egkXgMqP.js";import"./DeYW9Fiz.js";import"./gjBqqy30.js";import"./m8SgQgoF.js";import"./Bs0o2c6W.js";import"./Boy9wtnx.js";import"./C2U5VtnP.js";import"./DZ6T0PiR.js";import"./BCcckLnV.js";import"./CnLvr--j.js";import"./DG_9ismW.js";import"./CFQTgrnx.js";const I={class:"page-top"},M={class:"page-intro"},R={class:"intro-actions"},D={key:0,class:"loading-state"},L={key:1,class:"error-state"}
1,F={key:2,class:"empty-state"},Z={key:3,class:"orgs-content"},q={class:"seats-text"},W={class:"date-text"},Y={class:"date-text"},B={class:"actions-cell"},H=r(C({__name:"index",setup(r){const{setSEO:C}=l();C({title:"Admin - Enterprise Orgs",description:"Manage enterprise seat organizations.",noIndex:!0});const H=n(),J=t();function Q(e){if(!e)return"—";const a=new Date(e.endsWith("Z")?e:`${e}Z`);return isNaN(a.getTime())?e:a.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function X(e,a){const t=e?.data?.detail;return"string"==typeof t?t:Array.isArray(t)?t.map((e=>e.msg)).join("; "):e?.message||a}const K=_([]),ee=_(!0),ae=_(!1),te=_(null);async function se(){ee.value=!0,te.value=null;const{data:e,error:a}=await H.listOrgs();ee.value=!1,ae.value=!0,a?te.value=X(a,"Failed to load enterprise orgs"):e&&(K.value=e)}const oe=_(!1),ie=_(!1),re=_(null),le=x({name:"",seatCount:"",adminEmails:""}),ne=V((()=>{return e=le.adminEmails,[...new Set(e.split(/[\s,;]+/).map((e=>e.trim().toLowerCase())).filter((e=>e.includes("@"))))];var e}));function me(){le.name="",le.seatCount="",le.adminEmails="",re.value=null,oe.value=!0}async function de(){if(re.value=null,!le.name.trim())return void(re.value="Name is required.");const e=parseInt(le.seatCount,10);if(isNaN(e)||e<1)return void(re.value="Seat count must be a whole number ≥ 1.");const a=ne.value;if(e<a.length)return void(re.value=`Admins are seated automatically — seat count must be at least ${a.length}.`);ie.value=!0;const{data:t,error:s}=await H.createOrg({name:le.name.trim(),seatCount:e,adminEmails:a});ie.value=!1,s?re.value=X(s,"Failed to create the org."):(t&&K.value.unshift(t),J.showSnackbar({message:"Enterprise org created.",color:"success",timeout:3e3}),oe.value=!1)}return w((()=>{se()})),(t,r)=>{const l=e;return z(),E(a,{title:"Admin - Enterprise Orgs",subtitle:"Create and administer enterprise seat pools"},{default:A((()=>[$("div",I,[$("div",M,[r[8]||(r[8]=$("p",{class:"intro-text"},' An enterprise org gives a customer a pool of GC Pro seats. Its enterprise admins invite and revoke members themselves from their "Manage seats" page; seat members are full GC Pro users. ',-1)),$("div",R,[S(s,{icon:"",variant:"text",size:"small",color:"grey",loading:U(ee),onClick:se},{default:A((()=>[S(o,{icon:"mdi-refresh",size:"20"}),S(m,{activator:"parent",location:"top"},{default:A((()=>[...r[6]||(r[6]=[N("Refresh",-1)])])),_:1})])),_:1},8,["loading"]),S(s,{color:"primary",variant:"flat",size:"small",class:"text-none",onClick:me},{default:A((()=>[S(o,{icon:"mdi-plus",size:"18",start:""}),r[7]||(r[7]=N(" Add Org ",-1))])),_:1})])])]),U(ee)||!U(ae)?(z(),O("div",D,[S(i,{indeterminate:"",color:"primary",size:"48"}),r[9]||(r[9]=$("p",null,"Loading enterprise orgs...",-1))])):U(te)?(z(),O("div",L,[S(o,{icon:"mdi-alert-circle",size:"48",color:"error"}),r[11]||(r[11]=$("h3",null,"Unable to Load Enterprise Orgs",-1)),$("p",null,P(U(te)),1),S(s,{onClick:se,color:"primary",variant:"outlined",class:"text-none"},{default:A((()=>[S(o,{icon:"mdi-refresh",start:""}),r[10]||(r[10]=N(" Try Again ",-1))])),_:1})])):0===U(K).length?(z(),O("div",F,[S(o,{icon:"mdi-office-building-outline",size:"64",color:"grey"}),r[13]||(r[13]=$("h3",null,"No Enterprise Orgs",-1)),r[14]||(r[14]=$("p",null,"Create an org to give a customer a pool of GC Pro seats their admins manage themselves.",-1)),S(s,{color:"primary",variant:"flat",class:"text-none",onClick:me},{default:A((()=>[S(o,{icon:"mdi-plus",start:""}),r[12]||(r[12]=N(" Add Org ",-1))])),_:1})])):(z(),O("div",Z,[S(d,{headers:[{title:"Name",key:"name",sortable:!0},{title:"Seats",key:"seatsUsed",sortable:!0},{title:"Pending",key:"seatsPending",sortable:!0},{title:"Available",key:"seatsAvailable",sortable:!0},{title:"Admins",key:"adminEmails",sortable:!1},{title:"Status",key:"enabled",sortable:!0},{title:"Created",key:"createdAt",sortable:!0},{title:"Actions",key:"actions",sortable:!1,align:"end"}],items:U(K),"items-per-page":25,"item-value":"id",density:"comfortable",class:"orgs-table"},{"item.name":A((({item:e})=>[S(l,{to:`/gc-admin/enterprise-orgs/${e.id}`,class:"name-link"},{default:A((()=>[N(P(e.name),1)])),_:2},1032,["to"])])),"item.seatsUsed":A((({item:e})=>[$("span",q,P(e.seatsUsed)+" / "+P(e.seatCount),1)])),"item.adminEmails":A((({item:e})=>[$("span",W,[N(P(e.adminEmails.length)+" ",1),e.adminEmails.length?(z(),E(m,{key:0,activator:"parent",location:"top"},{default:A((()=>[N(P(e.adminEmails.join(", ")),1)])),_:2},1024)):T("",!0)])])),"item.enabled":A((({item:e})=>[S(c,{color:e.enabled?"success":"grey",size:"small",variant:"tonal"},{default:A((()=>[N(P(e.enabled?"Enabled":"Disabled"),1)])),_:2},1032,["color"])])),"item.createdAt":A((({item:e})=>[$("span",Y,P(Q(e.createdAt)),1)])),"item.actions":A((({item:e})=>
1[$("div",B,[S(s,{icon:"",variant:"text",size:"x-small",to:`/gc-admin/enterprise-orgs/${e.id}`},{default:A((()=>[S(o,{icon:"mdi-pencil-outline",size:"20"}),S(m,{activator:"parent",location:"top"},{default:A((()=>[...r[15]||(r[15]=[N("Manage",-1)])])),_:1})])),_:1},8,["to"]),S(s,{icon:"",variant:"text",size:"x-small",color:"error",onClick:a=>async function(e){if(!(await J.showModal({title:"Close this org?",message:`Close "${e.name}"? Every seat (${e.seatsUsed} in use) is revoked immediately and the org is disabled. The org is kept for history, but re-enabling it later will NOT restore the revoked seats.`,confirmText:"Close org",cancelText:"Cancel"})))return;const{data:a,error:t}=await H.closeOrg(e.id);t?J.showSnackbar({message:X(t,"Failed to close the org."),color:"error",timeout:5e3}):(J.showSnackbar({message:`"${e.name}" closed — ${a?.seatsRevoked??0} seat${1===a?.seatsRevoked?"":"s"} revoked.`,color:"success",timeout:4e3}),await se())}(e)},{default:A((()=>[S(o,{icon:"mdi-close-octagon-outline",size:"20"}),S(m,{activator:"parent",location:"top"},{default:A((()=>[...r[16]||(r[16]=[N("Close org (revokes all seats)",-1)])])),_:1})])),_:1},8,["onClick"])])])),_:1},8,["items"])])),S(u,{modelValue:U(oe),"onUpdate:modelValue":r[5]||(r[5]=e=>G(oe)?oe.value=e:null),"max-width":"560",persistent:""},{default:A((()=>[S(p,{rounded:"xl"},{default:A((()=>[S(g,{class:"modal-header"},{default:A((()=>[r[17]||(r[17]=$("span",{class:"modal-title"},"New Enterprise Org",-1)),S(s,{icon:"mdi-close",variant:"text",size:"small",onClick:r[0]||(r[0]=e=>oe.value=!1)})])),_:1}),S(h),S(f,{class:"modal-body"},{default:A((()=>[U(re)?(z(),E(y,{key:0,type:"error",variant:"tonal",density:"compact",class:"mb-4"},{default:A((()=>[N(P(U(re)),1)])),_:1})):T("",!0),S(b,{modelValue:U(le).name,"onUpdate:modelValue":r[1]||(r[1]=e=>U(le).name=e),label:"Name",placeholder:"e.g., Acme Philanthropy",variant:"outlined",density:"comfortable",class:"mb-3","hide-details":""},null,8,["modelValue"]),S(b,{modelValue:U(le).seatCount,"onUpdate:modelValue":r[2]||(r[2]=e=>U(le).seatCount=e),label:"Seat count",type:"number",min:"1",variant:"outlined",density:"comfortable",class:"mb-3",hint:"Total GC Pro seats in the pool. Admins are seated automatically, so this must cover them.","persistent-hint":""},null,8,["modelValue"]),S(j,{modelValue:U(le).adminEmails,"onUpdate:modelValue":r[3]||(r[3]=e=>U(le).adminEmails=e),label:"Enterprise admin emails",placeholder:"[email protected]",variant:"outlined",density:"comfortable",rows:"2","auto-grow":"",hint:`${U(ne).length} admin${1===U(ne).length?"":"s"} — they manage the org's seats and each gets a seat. Admins who haven't signed up yet get role + seat at first login.`,"persistent-hint":""},null,8,["modelValue","hint"])])),_:1}),S(h),S(v,{class:"modal-actions"},{default:A((()=>[S(k),S(s,{variant:"text",class:"text-none",onClick:r[4]||(r[4]=e=>oe.value=!1)},{default:A((()=>[...r[18]||(r[18]=[N(" Cancel ",-1)])])),_:1}),S(s,{color:"primary",variant:"flat",class:"text-none",loading:U(ie),onClick:de},{default:A((()=>[...r[19]||(r[19]=[N(" Create ",-1)])])),_:1},8,["loading"])])),_:1})])),_:1})])),_:1},8,["modelValue"])])),_:1})}}}),[["__scopeId","data-v-b6fe234c"]]);export{H 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.