(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[824],{30926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{callServer:function(){return r.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}});let r=n(41209),a=n(85153),i=n(77197)},89478:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,52619,23)),Promise.resolve().then(n.bind(n,95828))},95828:(e,t,n)=>{"use strict";n.d(t,{SessionActions:()=>s});var r=n(95155),a=n(12115),i=n(30926);let c=(0,i.createServerReference)("409df161bd853257579b553d81125acb8a9b5b40c8",i.callServer,void 0,i.findSourceMapURL,"generateContextAction");function s(e){let{sessionId:t,provider:n,cwd:i,hasLlmKey:s,cachedContext:o}=e,[l,d]=(0,a.useState)(!1),[u,x]=(0,a.useState)(o),[f,m]=(0,a.useState)(!1),[b,p]=(0,a.useState)(null),[v,h]=(0,a.useState)(null),[S,y]=(0,a.useTransition)(),g=function(e,t,n){let r='cd "'.concat(t,'"');return"claude"===e?"".concat(r," && claude --resume ").concat(n):"codex"===e?"".concat(r," && codex resume ").concat(n):r}(n,i,t),k=async()=>{await navigator.clipboard.writeText(g),d(!0),setTimeout(()=>d(!1),1800)};return(0,r.jsxs)("div",{className:"flex flex-col items-end gap-1.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:k,className:"btn",title:g,children:l?"✓ Copied":"⟲ Resume session"}),(0,r.jsx)("button",{onClick:()=>{p(null),y(async()=>{if(u){await navigator.clipboard.writeText(u),m(!0),setTimeout(()=>m(!1),1800);return}let e=await c(t);if(!e.ok)return void p(e.error);x(e.context),h(e.costUsd),await navigator.clipboard.writeText(e.context),m(!0),setTimeout(()=>m(!1),1800)})},disabled:!s||S,title:s?"Generate a short primer for a fresh chat":"Add an API key in Settings to enable",className:"btn ".concat(s?"btn-primary":""," disabled:opacity-50 disabled:cursor-not-allowed"),children:S?"… generating":f?"✓ Copied":u?"⎘ Copy context":"✶ Generate & copy context"})]}),b&&(0,r.jsx)("div",{className:"text-body-sm text-error",children:b}),null!==v&&v>0&&(0,r.jsxs)("div",{className:"text-[10px] font-mono text-ink-mute",children:["cost: $",v.toFixed(4)]}),!s&&(0,r.jsxs)("div",{className:"text-[11px] text-ink-mute",children:["“Copy context” needs an API key —"," ",(0,r.jsx)("a",{href:"/settings",className:"text-primary hover:underline",children:"add one in Settings"})]})]})}}},e=>{e.O(0,[619,441,255,358],()=>e(e.s=89478)),_N_E=e.O()}]);