import{r as O}from"./chunk-ZCJMLMGS-CqnQxwq0.js";import{_ as w,H as m}from"./main-BWZZ-Tkl.js";import"./index-HScKmzDa.js";var y=w({"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js"(h,_){var a=Object.defineProperty,k=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,d=(e,r)=>{for(var o in r)a(e,o,{get:r[o],enumerable:!0})},u=(e,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of l(r))!s.call(e,i)&&i!==o&&a(e,i,{get:()=>r[i],enumerable:!(n=k(r,i))||n.enumerable});return e},f=e=>u(a({},"__esModule",{value:!0}),e),p={};d(p,{refreshToken:()=>v}),_.exports=f(p);var c=m(),t=O();async function v(){const{projectId:e,teamId:r}=(0,t.findProjectInfo)();let o=(0,t.loadToken)(e);if(!o||(0,t.isExpired)((0,t.getTokenPayload)(o.token))){const n=await(0,t.getVercelCliToken)();if(!n)throw new c.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");if(!e)throw new c.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");if(o=await(0,t.getVercelOidcToken)(n,e,r),!o)throw new c.VercelOidcTokenError("Failed to refresh OIDC token");(0,t.saveToken)(o,e)}o.token}}}),j=y();export{j as default};
