PageSourceSearch

https://farbi.io/chunk-NOY5DA2L.js

js farbi.io collected 2026-09-28 06:25:58 UTC 2,772 bytes, 1 lines download raw bytes

1import{a as u}from"./chunk-XUFHT4AI.js";import{$ as i,D as h,Dc as b,V as p,Zb as a,da as n,qa as m,r as l}from"./chunk-BWE7QEN6.js";var o=class s{http=n(b);BASE=`${u.apiBase?.replace(/\/$/,"")??""}/api/teams`;listTeams(){return this.http.get(this.BASE)}createTeam(e){return this.http.post(this.BASE,{name:e})}getTeam(e){return this.http.get(`${this.BASE}/${e}`)}renameTeam(e,t){return this.http.patch(`${this.BASE}/${e}`,{name:t})}deleteTeam(e){return this.http.delete(`${this.BASE}/${e}`)}listMembers(e){return this.http.get(`${this.BASE}/${e}/members`)}changeRole(e,t,r){return this.http.patch(`${this.BASE}/${e}/members/${t}`,{role:r})}removeMember(e,t){return this.http.delete(`${this.BASE}/${e}/members/${t}`)}listInvites(e){return this.http.get(`${this.BASE}/${e}/invites`)}invite(e,t,r){return this.http.post(`${this.BASE}/${e}/invites`,{email:t,role:r})}revokeInvite(e,t){return this.http.delete(`${this.BASE}/${e}/invites/${t}`)}acceptInvite(e){return this.http.post(`${this.BASE}/invites/accept`,{token:e})}listKeys(e){return this.http.get(`${this.BASE}/${e}/api-keys`)}createKey(e,t){return this.http.post(`${this.BASE}/${e}/api-keys`,{name:t})}revokeKey(e,t){return this.http.delete(`${this.BASE}/${e}/api-keys/${t}`)}listAudit(e,t=50){return this.http.get(`${this.BASE}/${e}/audit`,{params:{limit:t}})}static \u0275fac=function(t){return new(t||s)};static \u0275prov=i({token:s,factory:s.\u0275fac,providedIn:"root"})};var c="imagehub_workspace",d=class s{teamSvc=n(o);_current=m(this.restore());current=this._current.asReadonly();_teams=m([]);teams=this._teams.asReadonly();isTeam=a(()=>this._current().kind==="team");role=a(()=>{let e=this._current();return e.kind==="team"?e.role:"owner"});canEdit=a(()=>this.role()!=="viewer");canManage=a(()=>this.role()==="owner");headerValue(){let e=this._current();return e.kind==="team"?e.teamId:null}setPersonal(){this._current.set({kind:"personal"}),this.persist()}setTeam(e,t,r){this._current.set({kind:"team",teamId:e,name:t,role:r}),this.persist()}loadTeams(){return this.teamSvc.listTeams().pipe(p(e=>this.setTeams(e)),h(()=>(this._teams.set([]),l([]))))}setTeams(e){this._teams.set(e),this.reconcile(e)}reconcile(e){let t=this._current();if(t.kind!=="team")return;let r=e.find(v=>v.id===t.teamId);if(!r){this.setPersonal();return}(r.name!==t.name||r.role!==t.role)&&this.setTeam(r.id,r.name,r.role)}persist(){try{let e=this._current();e.kind==="team"?localStorage.setItem(c,JSON.stringify(e)):localStorage.removeItem(c)}catch{}}restore(){try{let e=localStorage.getItem(c);if(e){let t=JSON.parse(e);if(t?.kind==="team"&&t.teamId)return t}}catch{}return{kind:"personal"}}static \u0275fac=function(t){return new(t||s)};static \u0275prov=i({token:s,factory:s.\u0275fac,providedIn:"root"})};export{o as a,d as b};

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.