import{a as R,b as v,c as D}from"./chunk-SZLBENDF.js";import{b as C}from"./chunk-4BANWLAR.js";import{I as _,Uh as B,Zc as l,be as S,ea as y,fe as g,ge as E,ia as h,le as b,me as L,n as m,qa as T,rd as d,t as p,vh as c}from"./chunk-5YITAGFP.js";var F=(()=>{class a extends D{_http;_notificationService;_document;_apiBase=c.githubService;constructor(){let n=h(B),t=h(C),e=h(T);super(),this._http=n,this._notificationService=t,this._document=e}appPublicLink(n,t,e,i=!1){let o={"Content-Type":c.githubService.appPublicLink.header.contentType,hideLoadingSpinner:"1","x-callback-url":n??`${window.location.href}`};e&&(o["project-id"]=e),t&&(o["organization-id"]=t);let r=this.getEndpoint(this._apiBase.appPublicLink);return this._http.request(r.method,r.url,{headers:o,responseType:"text"})}selectInstallationAsConnection(n,t,e,i,o=!1){let r={"Content-Type":c.githubService.selectInstallationAsConnection.header.contentType,hideLoadingSpinner:"1"};i&&(r["project-id"]=i),e&&(r["organization-id"]=e);let s=this.getEndpoint(this._apiBase.selectInstallationAsConnection);return this._http.request(s.method,s.url,{headers:r,body:{installationId:`${n}`,installationsKey:`${t}`}})}actionsWorkflows(n,t=!1){let e=this.getEndpoint(this._apiBase.actionsWorkflows);return this._http.request(e.method,e.url,{headers:{"Content-Type":e.header.contentType,hideLoadingSpinner:"1"},params:{fullName:n}}).pipe(p(i=>i.map(o=>l(g,o,{excludeExtraneousValues:!0}))))}actionsWorkflow(n,t,e=!1){let i=this.getEndpoint(this._apiBase.actionsWorkflow);return this._http.request(i.method,i.url,{headers:{"Content-Type":i.header.contentType,hideLoadingSpinner:"1"},params:{fullName:n,path:t}}).pipe(p(o=>l(E,o,{excludeExtraneousValues:!0})))}getUserInfo(n){let t=this.getEndpoint(this._apiBase.userInfo),e={"Content-Type":`${t.header.contentType}`,hideLoadingSpinner:"1"};return n&&(e["git-credentials"]=btoa(JSON.stringify(n))),this._http.request(t.method,t.url,{headers:e}).pipe(p(i=>d.transformToDto(S,i)))}repositoryBranchTree(n,t,e,i,o=!1,r){let s=this.getEndpoint(this._apiBase.repositoryBranchTree),u={"Content-Type":`${s.header.contentType}`,hideLoadingSpinner:"1"};return r&&(u["git-credentials"]=btoa(JSON.stringify(r))),this._http.request(s.method,s.url,{headers:u,params:{cloneUrl:n,branch:t,raw:e,type:i}}).pipe(p(f=>e?d.transformToDtoList(b,f):d.transformToDtoList(L,f)))}deleteRepository(n,t=!1){let e=this.getEndpoint(this._apiBase.deleteRepository);return this._http.request(e.method,e.url,{headers:{"Content-Type":e.header.contentType,hideLoadingSpinner:t?"1":"0"},body:n.map(i=>i.clone_url)})}isBranchProtected(n,t,e){let i=this.getEndpoint(this._apiBase.isBranchProtected),o={"Content-Type":`${i.header.contentType}`,hideLoadingSpinner:"1",hideErrorMessage:"1"};return e&&(o["git-credentials"]=btoa(JSON.stringify(e))),this._http.request(i.method,i.url,{headers:o,params:{cloneUrl:n,branch:t}}).pipe(_(()=>m(!1)))}cleanUp(){this._searchRequest$.next(R),this._searchResponse$.next(v)}static \u0275fac=function(t){return new(t||a)};static \u0275prov=y({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();export{F as a}; //# sourceMappingURL=chunk-FRBUAQBP.js.map