import{tS as M,vS as X}from"./cli-0.5.4-mr9aznxx.mjs";import{$8 as B,E$ as K,K$ as L,T$ as W,i9 as V}from"./cli-0.5.4-cbq01zg3.mjs";import{Zma as Q}from"./cli-0.5.4-aacw1src.mjs";async function F(){let b=await M();if(b.length===0)return{availableEnvironments:[],selectedEnvironment:null,selectedEnvironmentSource:null};let z=L()?.remote?.defaultEnvironmentId,H=b.find((x)=>x.kind!=="bridge")??b[0],J=null;if(z){let x=b.find((q)=>q.environment_id===z);if(x){H=x;for(let q=B.length-1;q>=0;q--){let y=B[q];if(!y||y==="flagSettings")continue;if(K(y)?.remote?.defaultEnvironmentId===z){J=y;break}}}}return{availableEnvironments:b,selectedEnvironment:H,selectedEnvironmentSource:J}}var Y=Q(()=>{V();W();X()});
export{F as Gb,Y as Hb};
