import{B5 as _,C5 as w,x5 as Z}from"./cli-0.5.3-dyhbm5kp.mjs";import{$6 as U,Caa as W,Faa as V,K7 as T,Q8 as D,Yaa as j,_6 as Y,k7 as $,u8 as k}from"./cli-0.5.3-t65dek0m.mjs";import{Nfa as N,Qfa as M}from"./cli-0.5.3-n3cxyxpg.mjs";import{gma as O,via as X}from"./cli-0.5.3-qrvd6cmy.mjs";O();j();M();w();D();U();T();import{realpath as v}from"fs/promises";async function b(){try{let q=await Z();if(!q){N("Not in a GitHub repository, skipping path mapping update");return}let A=X(),z=$(A)??A,B;try{B=(await v(z)).normalize("NFC")}catch{B=z}let J=q.toLowerCase(),L=V().githubRepoPaths?.[J]??[];if(L[0]===B){N(`Path ${B} already tracked for repo ${J}`);return}let E=L.filter((S)=>S!==B),H=[B,...E];W((S)=>({...S,githubRepoPaths:{...S.githubRepoPaths,[J]:H}})),N(`Added ${B} to tracked paths for repo ${J}`)}catch(q){N(`Error updating repo path mapping: ${q}`)}}function y(q){let A=V(),I=q.toLowerCase();return A.githubRepoPaths?.[I]??[]}async function P(q){let A=await Promise.all(q.map(k));return q.filter((I,z)=>A[z])}async function d(q,A){try{let I=await Y(q);if(!I)return!1;let z=_(I);if(!z)return!1;return z.toLowerCase()===A.toLowerCase()}catch{return!1}}function c(q,A){let I=V(),z=q.toLowerCase(),B=I.githubRepoPaths?.[z]??[],J=B.filter((L)=>L!==A);if(J.length===B.length)return;let Q={...I.githubRepoPaths};if(J.length===0)delete Q[z];else Q[z]=J;W((L)=>({...L,githubRepoPaths:Q})),N(`Removed ${A} from tracked paths for repo ${z}`)}
export{b as _,y as $,P as aa,d as ba,c as ca};
