import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{Dd as s,Tu as r,vi as a}from"./shared-0-C4kdVF7Y.js";import{Mi as o,ki as t}from"./vendor-frame-CwiylG4Y.js";import{Mh as n,Xf as i,oi as c}from"./shared-1-3-6x7RKF.js";import{S as m,b as d,x as f,y as l}from"./shared-17-YFu3JFq7.js";import{qt as u}from"./vendor-all-1-BfXMvJfI.js";import{sr as p}from"./c360a9e1c-DrYIyI47.js";import{f as j,zt as g}from"./shared-6-Cf_fMhRZ.js";import{rn as h}from"./vendor-all-2-BJdkbLSj.js";import{a as x,c as b,l as v,n as y,o as C,r as k,s as w,t as z,u as E}from"./c705e2e19-vtldHFDC.js";import{zd as M}from"./shared-4-6CEyRAHb.js";import{zr as P}from"./shared-9-D_WZeX6S.js";import{dr as _}from"./index-C9LAU4f-.js";import{t as S}from"./c11959232-CTpY_LXk.js";import{a as D,r as L}from"./c7ac369c8-XBkxhzPQ.js";import{t as R}from"./ca82bcec9-k3KT_G-E.js";var q=e(o()),B=t(),F=(0,q.memo)(function(){const{eligible:e}=l(),s=d();return e||s?(0,B.jsx)(H,{}):null});function H(){const e=f(),s=m(e=>e.setConfig),r=m(e=>e.clear);return(0,q.useEffect)(()=>{s(e)},[e,s]),(0,q.useEffect)(()=>()=>r(),[r]),null}function I(e){return"/epitaxy/apps"===e.pathname}function K(){const e=h(),o=s(),t=a(),{addError:m}=n(),d=r(),f=c(),l=j(I),x=!o||!0===t.enabled||l,b=o&&null===t.enabled,v=D(L);R({variant:"ccd",settled:x,configBlocking:x&&v.enabled&&"blocking"===v.severity}),g(!0===t.enabled);const{unsupportedCode:y}=t,{description:C}=i(e,"Code",y??"no_entitlement"),k=y?C:e.formatMessage({defaultMessage:"Claude Code isn\u2019t available for this account.",id:"PHd+sx3yIc"}),w=(0,q.useRef)(!1);return(0,q.useEffect)(()=>{if(b||x||w.current)return;w.current=!0;const e=new URLSearchParams(window.location.search);m(k,{messageForLogging:"Claude Code unavailable, redirected away from /epitaxy.",errorContext:{tags:{source:"epitaxy_entitlement_redirect",code:y??"none",deeplink_intent:String(_.some(s=>e.has(s)))}}}),d.replace(f)},[b,x,f,d,m,k,y]),b||!x?(0,B.jsx)(M,{}):(0,B.jsxs)(p,{sidePanePersistKey:P,children:[!0===t.enabled&&(0,B.jsx)(F,{}),(0,B.jsx)(u,{})]})}var T=S;export{P as EPITAXY_SIDE_PANE_PERSIST_KEY,z as EpitaxyAppsRoute,y as EpitaxyArtifactRoute,k as EpitaxyDevRoute,K as EpitaxyGroupLayoutRoute,x as EpitaxyProjectRoute,C as EpitaxyProjectsBrowseRoute,T as EpitaxyRoute,w as EpitaxyScheduledDetailRoute,b as EpitaxyScheduledNewRoute,v as EpitaxyScheduledRoute,E as EpitaxyTasksRoute};