import{d as g,s as i,r as p}from"./jwt-decode.esm-2WRMmv_p.js";import"./router-IuLubLUz.js";import{B as w,a as m}from"./build-MMP8bNBC.js";import{a as S}from"./project-D0kM52L9.js";import"./tables-Gjgiloy7.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="3f1cac67-c100-4ab4-8e1a-330c8d36b371",t._sentryDebugIdIdentifier="sentry-dbid-3f1cac67-c100-4ab4-8e1a-330c8d36b371")}catch{}})();const x=g("build",()=>{const t=i([]),n=i([]),s=p(!1);let u=null;const l=new Map;async function c(e){const a=await w.list(e);return u===e&&(t.value=a),a}async function o(e){const a=await S.getStatus(e);return u===e&&(n.value=a),a}async function f(e){s.value=!0;try{const[a,r]=await Promise.all([c(e),o(e)]);return{builds:a,statuses:r}}finally{s.value=!1}}async function d(e){const a=l.get(e);if(a!==void 0)return a;const r=await m.get(e);return l.set(e,r),r}function y(){return t.value.find(e=>e.latest)}function b(e){u!==e&&(u=e,t.value=[],n.value=[],l.clear())}function v(){u=null,t.value=[],n.value=[],l.clear(),s.value=!1}return{builds:t,deployStatuses:n,loading:s,fetchBuilds:c,fetchDeployStatuses:o,fetchAll:f,fetchBuildSpec:d,getLatestBuild:y,setProjectContext:b,resetStore:v}});export{x as u};
//# sourceMappingURL=buildStore-yJKrjih4.js.map
