@soba-so/react 0.0.26 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client"
2
- var es={ready:{arc:!0},serving:{arc:!0,slot:"stream"},paused:{arc:!1,slot:"zzz"},thinking:{arc:!1,slot:"dots"},connecting:{arc:!1,slot:"orbit"},attention:{arc:!1,slot:"bang"},gone:{arc:!1,slot:"cross"},snap:{arc:!1,slot:"snap"},listening:{arc:!1,slot:"bars"},permission:{arc:!1,slot:"ring"},ai:{arc:!1,slot:"sparks"}};var ns="105 162 420 420",ts="M407.1 308.9 A158 158 0 1 0 407.1 491.1 A116 116 0 0 1 407.1 308.9 Z",bn="M448.5 320 A110 110 0 0 1 448.5 480";import{Fragment as nt,jsx as P,jsxs as tn}from"react/jsx-runtime";function nn({kind:e,size:n=44,className:t}){let s=es[e];return tn("svg",{className:`bx${t?` ${t}`:""}`,"data-expression":e,viewBox:ns,overflow:"visible",width:n,height:n,"aria-hidden":"true",children:[P("path",{d:ts,fill:"currentColor"}),P("path",{className:"bx-arc",d:bn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"}),s.slot==="stream"&&P(Do,{}),s.slot==="zzz"&&P(Uo,{}),s.slot==="dots"&&P(Fo,{}),s.slot==="bang"&&P(Qo,{}),s.slot==="orbit"&&P(Vo,{}),s.slot==="cross"&&P(Jo,{}),s.slot==="snap"&&P(Yo,{}),s.slot==="bars"&&P(zo,{}),s.slot==="ring"&&P(jo,{}),s.slot==="sparks"&&P(qo,{})]})}function Do(){return P("path",{className:"bx-st",d:"M475.3 290.3 A150 150 0 0 1 475.3 509.7",fill:"none",stroke:"currentColor",strokeWidth:"15",strokeLinecap:"round",strokeDasharray:"0.1 31"})}function Uo(){return tn(nt,{children:[P("g",{className:"bx-z1",children:P("path",{d:"M444 372 H496 L444 436 H496",fill:"none",stroke:"currentColor",strokeWidth:"20",strokeLinecap:"round",strokeLinejoin:"round"})}),P("g",{className:"bx-z2",children:P("path",{d:"M492 300 H522 L492 338 H522",fill:"none",stroke:"currentColor",strokeWidth:"15",strokeLinecap:"round",strokeLinejoin:"round"})})]})}function Fo(){return tn(nt,{children:[P("circle",{className:"bx-th",cx:"463.1",cy:"336.9",r:"21",fill:"currentColor"}),P("circle",{className:"bx-th bx-th2",cx:"483",cy:"400",r:"21",fill:"currentColor"}),P("circle",{className:"bx-th bx-th3",cx:"463.1",cy:"463.1",r:"21",fill:"currentColor"})]})}function Qo(){return tn("g",{className:"bx-at",children:[P("line",{x1:"490",y1:"312",x2:"490",y2:"414",stroke:"currentColor",strokeWidth:"46",strokeLinecap:"round"}),P("circle",{cx:"490",cy:"484",r:"28",fill:"currentColor"})]})}function Vo(){return tn("g",{className:"bx-ob",children:[P("path",{d:bn,fill:"none",stroke:"var(--tile-bg, transparent)",strokeWidth:41,strokeLinecap:"round"}),P("path",{d:bn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"})]})}function Jo(){return tn(nt,{children:[P("path",{className:"bx-xa",d:bn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"}),P("g",{className:"bx-xx",children:P("path",{d:"M442 364 L514 436 M514 364 L442 436",fill:"none",stroke:"currentColor",strokeWidth:"24",strokeLinecap:"round"})})]})}function Yo(){return P("path",{className:"bx-snap",d:bn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"})}function zo(){return tn("g",{stroke:"currentColor",strokeWidth:"17",strokeLinecap:"round",children:[P("line",{className:"bx-vb",x1:"452",y1:"370",x2:"452",y2:"430"}),P("line",{className:"bx-vb bx-vb2",x1:"482",y1:"330",x2:"482",y2:"470"}),P("line",{className:"bx-vb bx-vb3",x1:"512",y1:"355",x2:"512",y2:"445"})]})}function jo(){return P(nt,{children:[[450,366],[474,376],[484,400],[474,424],[450,434],[426,424],[416,400],[426,376]].map(([n,t],s)=>P("circle",{className:"bx-w",cx:n,cy:t,r:"11",fill:"currentColor",style:{animationDelay:`${-1.2+s*.15}s`}},s))})}function qo(){return tn(nt,{children:[P("g",{className:"bx-sp",children:P("path",{d:"M460 300 Q465.4 324.6 490 330 Q465.4 335.4 460 360 Q454.6 335.4 430 330 Q454.6 324.6 460 300 Z",fill:"currentColor"})}),P("g",{className:"bx-sp bx-sp2",children:P("path",{d:"M486 356 Q493.92 392.08 530 400 Q493.92 407.92 486 444 Q478.08 407.92 442 400 Q478.08 392.08 486 356 Z",fill:"currentColor"})}),P("g",{className:"bx-sp bx-sp3",children:P("path",{d:"M460 440 Q465.4 464.6 490 470 Q465.4 475.4 460 500 Q454.6 475.4 430 470 Q454.6 464.6 460 440 Z",fill:"currentColor"})})]})}var Rr={"claude-code":{small:"haiku",large:"opus"}};function Pr(e){return e==="small"||e==="large"}function Er(e,n){return Rr[e]?.[n]}function Et(e){let n=Rr[e];return!!(n?.small||n?.large)}var $l=512*1024;import{useEffect as Dr,useRef as Ca,useState as Wn}from"react";var Tn=class extends Error{status;constructor(n,t){super(n),this.name="ConnectError",this.status=t}},Zo=5*6e4,tt=class{session;baseUrl;doFetch;lastMachines=null;machinesUrl=null;gatewayBackUntil=0;constructor(n){this.session=n.session,this.baseUrl=(n.baseUrl??"").replace(/\/+$/,""),this.doFetch=n.fetchImpl??fetch.bind(globalThis)}async context(){let n=await this.request("GET","/v1/connect");return this.setMachinesUrl(n.machines_url),n}setMachinesUrl(n){typeof n=="string"&&/^https?:\/\//.test(n)&&(this.machinesUrl=n)}async machines(){let n=this.lastMachines,t=n?`?v=${encodeURIComponent(n.version)}`:"",s;if(this.machinesUrl&&Date.now()>=this.gatewayBackUntil)try{s=await this.request("GET",`${this.machinesUrl}${t}`)}catch(a){if(a instanceof Tn&&a.status===401)throw a;this.gatewayBackUntil=Date.now()+Zo}if(s??=await this.request("GET",`/v1/machines${t}`),s.unchanged&&n)return n.machines;let r=Array.isArray(s.machines)?s.machines:[];return this.lastMachines=typeof s.version=="string"?{version:s.version,machines:r}:null,r}async runs(){let n=await this.request("GET","/v1/machines/runs");return Array.isArray(n.runs)?n.runs:[]}async stopRun(n){let t=this.machinesUrl?.replace(/\/v1\/machines$/,"");if(!t)throw new Tn("This page can't stop runs yet: it hasn't been told where Soba's gateway is.",501);await this.request("POST",`${t}/v1/runs/${encodeURIComponent(n)}/stop`,{})}lookup(n){return this.request("GET",`/v1/device/lookup?code=${encodeURIComponent(n)}`)}approve(n){return this.request("POST","/v1/device/approve",{user_code:n})}claim(n){return this.request("POST","/v1/device/claim",{pairing_nonce:n})}deny(n){return this.request("POST","/v1/device/deny",{user_code:n})}plans(){return this.request("GET","/v1/plans")}selectPlan(n){return this.request("POST","/v1/plans/select",{plan:n})}checkoutPlan(n,t){return this.request("POST","/v1/plans/checkout",{plan:n,...t?.successUrl?{success_url:t.successUrl}:{},...t?.cancelUrl?{cancel_url:t.cancelUrl}:{}})}leavePlan(){return this.request("DELETE","/v1/plans/select")}hosted(){return this.request("GET","/v1/hosted")}startHosted(){return this.request("POST","/v1/hosted/start")}disconnectHosted(n){return this.request("DELETE",n?`/v1/hosted?provider=${encodeURIComponent(n)}`:"/v1/hosted")}approveRuntime(n,t){return this.request("POST","/v1/runtimes/approve",{machine_id:n,runtime_id:t})}preferRuntime(n,t){return this.request("POST","/v1/runtimes/prefer",{machine_id:n,runtime_id:t})}async request(n,t,s){let r=await this.doFetch(/^https?:\/\//.test(t)?t:`${this.baseUrl}${t}`,{method:n,headers:{authorization:`Bearer ${this.session}`,...s?{"content-type":"application/json"}:{}},...s?{body:JSON.stringify(s)}:{}}),a={};try{a=await r.json()}catch{}if(!r.ok){let i=typeof a.error=="string"?a.error:`Request failed (${r.status})`;throw new Tn(i,r.status)}return a}};function st(e){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!n?.[1])return"#ffffff";let t=n[1].length===3?[...n[1]].map(a=>a+a).join(""):n[1],s=a=>{let i=Number.parseInt(t.slice(a*2,a*2+2),16)/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4};return .2126*s(0)+.7152*s(1)+.0722*s(2)>.45?"#101012":"#ffffff"}function ss(e){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!n?.[1])return null;let t=n[1].length===3?[...n[1]].map(s=>s+s).join(""):n[1];return[0,1,2].map(s=>Number.parseInt(t.slice(s*2,s*2+2),16))}function Ln(e,n,t){let s=ss(e),r=ss(n);return!s||!r?e:`#${s.map((i,c)=>Math.round(i+(r[c]-i)*t)).map(i=>i.toString(16).padStart(2,"0")).join("")}`}function yn(e,n){if(!ss(e))return{};let t=st(e),s=n?.trim();return{"--sc-ground":e,"--sc-shell":e,"--sc-sheet":Ln(e,t,.07),"--sc-raised":Ln(e,t,.13),"--sc-line":Ln(e,t,.18),"--sc-line-2":Ln(e,t,.28),"--sc-text":t,"--sc-text-2":Ln(t,e,.15),"--sc-muted":Ln(t,e,.38),...s?{"--sc-accent":s,"--sc-accent-fg":st(s)}:{"--sc-accent":t,"--sc-accent-fg":e}}}function Qe(e){return e.authenticated===!0?{tone:"ok",text:"signed in"}:e.authenticated===!1?{tone:"warn",text:e.auth_hint??"signed out on that machine"}:{tone:"unknown",text:"could not tell"}}function rt(e){let{platform:n,arch:t}=e;if(!n)return null;let s=n==="darwin"||n==="macos",r=s?"Mac":n==="win32"||n==="windows"?"Windows PC":"Linux machine";return s?`${t==="aarch64"||t==="arm64"?"Apple silicon ":""}${r}`:r}function wn(e){return e.find(n=>n.state==="offline")??null}function rs(e){return e.state==="busy"?{tone:"busy",text:`serving ${e.active} of ${e.capacity}`}:e.state==="online"?{tone:"ok",text:"connected"}:{tone:"off",text:"asleep or offline"}}function X(e){let n=e.label?.trim(),t=e.name?.trim();return n&&(!t||n!==t)?n:(t??n??"").replace(/\.(local|lan|home|internal)$/i,"").replace(/[-_]+/g," ").trim()||n||"This machine"}function It(e,n){let t=r=>r.state==="busy"?0:r.state==="online"?1:2,s=r=>r.last_seen_at?Date.parse(r.last_seen_at):0;return t(e)-t(n)||s(n)-s(e)}function Ve(e){return[...e].sort(It)[0]??null}function Cn(e){return e?e.state==="busy"?{tone:"busy",word:"Serving"}:e.state==="online"?{tone:"ok",word:"Connected"}:e.pairing_lost?{tone:"off",word:"Not connected"}:{tone:"off",word:"Asleep"}:{tone:"off",word:"No compute"}}function Bn(e){let n=Cn(e);return{label:e?n.word:"Connect compute",ariaLabel:e?e.pairing_lost?`${X(e)} is not connected`:`${n.word} on ${X(e)}`:"Connect compute",connected:e!==null,state:n}}function Ze(e){return e.state==="online"||e.state==="busy"}function ot(e){if(!e)return"never seen";let n=Date.parse(e);if(Number.isNaN(n))return"never seen";let t=Date.now()-n,s=6e4;return t<2*s?"just now":t<60*s?`${Math.floor(t/s)} min ago`:t<24*60*s?`${Math.floor(t/(60*s))} hr ago`:`${Math.floor(t/(24*60*s))} days ago`}function os(e){return e.runtimes.filter(n=>n.id!=="shell")}function ye(e){return e.runtimes.filter(n=>n.id!=="shell"&&!n.quarantined&&!n.absent)}function Se(e){let n=i=>i?e.runtimes.find(c=>c.id===i)??null:null;if(e.requested_runtime)return{by:"app",runtimeId:e.requested_runtime,runtime:n(e.requested_runtime)};let t=ye(e),s=t.find(i=>i.id===e.preferred_runtime);if(s)return{by:"you",runtimeId:s.id,runtime:s};let r=i=>i.id==="claude-code"?0:i.id==="codex"?1:2,a=[...t].sort((i,c)=>r(i)-r(c))[0]??null;return{by:"default",runtimeId:a?.id??null,runtime:a}}var as="soba";function vn(){return`${as}://show`}function at(e,n,t){let s=`${as}://connect?url=${encodeURIComponent(e)}`;return n&&(s+=`&nonce=${encodeURIComponent(n)}`),t&&(s+=`&want=${encodeURIComponent(t)}`),s}function it(){let e=globalThis.crypto;if(!e?.getRandomValues)return null;let n=e.getRandomValues(new Uint8Array(32)),t="";for(let s of n)t+=String.fromCharCode(s);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Xo=1600;function is(e={}){return cs(e)}async function ls(e,n={}){if(typeof window>"u"||typeof document>"u")return"unknown";let t=cs(n);try{window.location.href=at(e,n.nonce,n.want)}catch{return"absent"}return t}async function kn(e={}){if(typeof window>"u"||typeof document>"u")return"unknown";let n=cs(e);try{window.location.href=vn()}catch{return"absent"}return n}async function cs(e){if(typeof window>"u"||typeof document>"u")return"unknown";let n=e.graceMs??Xo,t=document.visibilityState==="visible"&&document.hasFocus(),s=!1,r=()=>{s=!0},a=()=>{document.visibilityState==="hidden"&&(s=!0)};return window.addEventListener("blur",r),window.addEventListener("pagehide",r),document.addEventListener("visibilitychange",a),await new Promise(i=>setTimeout(i,n)),window.removeEventListener("blur",r),window.removeEventListener("pagehide",r),document.removeEventListener("visibilitychange",a),t?s?"opened":"absent":"unknown"}var Ir={"claude-code":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAARGVYSWZNTQAqAAAACAABh2kABAAAAAEAAAAaAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAABAoAMABAAAAAEAAABAAAAAAEZRQrAAAAHLaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmO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4hk6CT86NPg0ttlEi68SPQ19Jg+OUszwD1xSFYOM4FJh2MhDLbkM90Iwa4Sk6ub4Gwp+NYThrDsOISD4WGNKRNW+Tu6gaHxd1wUXaFFlQHMDSdgiHDyuAyyvKHmSiv/2oHbpROzC0wlv5HMEN/IKTy2aGOdWDyAOT8zJzBPMqcayXzD2PGmU2peR0hZT40CMeW4JvjFUmdhTAD9U3dsK/ATHYYo6Aa9i3D0sf9gaBxVDEFAc/kQbHvKoSuRObV/QgNkcwD5jARsuQIWyRUfHgHJWB64dFWAYnun9QnXGRshc1SRcdGGXBTYPyMyn3k5F7v/h8qtgDnL6/wjvBQNWPSchPg1GXgvCWeIr+GjXj44OIn2Oo2e4z7u9oJo1qTXeWuHGJXQ91vI+YW5NAQrbWT9czryZ/OB3LdmMDFUGiPQm85+OMP6Ul+i323zeItTiodoFLQBcWTXwGzxn0BijiYgzGcTQWguIgdoz8sWQSMR3A0hMCPb5owh4whw+YR7MJ6ktMo+EciiobYAFJqDE4zPhtDRKVwF5DSuQcnOKR2AP8Cui93e4Bz9uMXV0/FBGGZ/BaqmGMFGWMFNw7QyOZML4XaHNc3OnIDZkE7cOUzf5QfCGN8C6GkgqwSeXP8HIxHP4MmOI/a321n07gV9IjNBy7QnyZrED37ivv4/PQyO8w10e8KcphEWKSNuIPY8QfKrR4Ye+yCnB3kPeGZiJkLwBzq+EZK2GxGe7nRW12PSGeADM/EmtjG4qej4OQ90YuRN/rYcWzMU8ZPuWbyCHPgbYT3vQ4Pp0/OM7QYx6VGXgMbdGN/AVNIT3cAadkl50K7+QtmgFGBskwuuGBL+EfnaxNQFH3ihDqM12j6lTyyVn4H4E6hAx4NkYwy1G0DlAmsUN8ESX6/+H/GpiUBv4FSyLhydRRp0cAAAAASUVORK5CYII="};import{useEffect as Or,useRef as Ko}from"react";import{Fragment as ea,jsx as Re,jsxs as us}from"react/jsx-runtime";function lt({anchor:e,label:n,options:t,current:s,onClose:r,onPick:a}){let i=Ko(null);return Or(()=>{let o=i.current,l=e.current;if(!o||!l)return;try{typeof o.showPopover=="function"&&o.showPopover()}catch{}let u=l.getBoundingClientRect();u.width>o.offsetWidth&&(o.style.width=`${Math.round(u.width)}px`);let d=o.offsetWidth,g=o.offsetHeight,f=u.width>248?u.left:u.right-d,h=Math.max(8,Math.min(f,window.innerWidth-d-8)),y=u.bottom+6,S=y+g>window.innerHeight-8&&u.top-6-g>8?u.top-6-g:y;o.style.left=`${Math.round(h)}px`,o.style.top=`${Math.round(S)}px`,o.querySelector('[aria-checked="true"]')?.focus()},[e]),Or(()=>{let o=l=>{let u=l.target;!u||i.current?.contains(u)||e.current?.contains(u)||r()};return document.addEventListener("pointerdown",o,!0),()=>document.removeEventListener("pointerdown",o,!0)},[e,r]),Re("div",{ref:i,role:"menu","aria-label":n,className:"sc-menu",popover:"manual",onKeyDown:o=>{let l=[...i.current?.querySelectorAll("[role=menuitemradio]")??[]],u=l.indexOf(document.activeElement);if(o.key==="Escape")o.stopPropagation(),o.nativeEvent.stopImmediatePropagation(),r(),e.current?.focus();else if(o.key==="ArrowDown"||o.key==="ArrowUp"){o.preventDefault();let d=o.key==="ArrowDown"?1:-1;l[(u+d+l.length)%l.length]?.focus()}else o.key==="Tab"&&r()},children:t.map(o=>Re(_o,{option:o,checked:s===o.id,onClose:r,onPick:a},o.id??""))})}function _o({option:e,checked:n,onClose:t,onPick:s}){return us(ea,{children:[e.heading?Re("div",{className:"sc-menu-head",role:"presentation",children:e.heading}):e.rule?Re("div",{className:"sc-menu-sep"}):null,us("button",{type:"button",role:"menuitemradio","aria-checked":n,className:"sc-menu-item",onClick:()=>{e.onChoose?(e.onChoose(),t()):n?t():s(e.id)},children:[e.glyph,us("span",{className:"sc-menu-text",children:[Re("span",{className:"sc-menu-label",children:e.label}),e.note&&Re("span",{className:"sc-menu-note",children:e.note})]}),e.trailing?Re("span",{className:"sc-menu-act",children:e.trailing}):n&&Re($o,{})]})]})}function $o(){return Re("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-menu-check",children:Re("path",{d:"M5 12.5l4.5 4.5L19 7.5",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Nn({open:e}){return Re("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e?"sc-chev sc-chev-open":"sc-chev",children:Re("path",{d:"M9 6l6 6-6 6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{useRef as sa,useState as ra}from"react";var na={haiku:"Haiku",sonnet:"Sonnet",opus:"Opus",fable:"Fable"};function Xe(e){return na[e]??e}function ct(e){let n=[...e].sort(It),t=Ve([...e]),s=t?Se(t):null,a=[{id:"auto",kind:"auto",label:"Automatic",model:"auto",...s?.runtime?{note:s.runtime.default_model?`Uses ${Xe(s.runtime.default_model)}`:`Uses ${s.runtime.display_name}`}:{}}];n.some(u=>ye(u).some(d=>Et(d.id)))&&a.push({id:"small",kind:"size",label:"Fast",note:"quick and cheap",model:"small"},{id:"large",kind:"size",label:"Best",note:"the most capable",model:"large"});let c=new Map;for(let u of n)for(let d of ye(u))for(let g of d.models){if(!g)continue;let f=`${d.id}/${g}`,h=c.get(f);if(h){h.machines.add(X(u));continue}c.set(f,{option:{id:f,kind:"named",label:Xe(g),model:g,runtime:d.id,runtimeName:d.display_name,costClass:d.cost_class},machines:new Set([X(u)])})}let o=new Set;for(let{machines:u}of c.values())for(let d of u)o.add(d);let l=o.size>1;for(let{option:u,machines:d}of c.values()){let g=l&&d.size===1?[...d][0]:void 0;a.push(g?{...u,machine:g}:u)}return a}function ut(e){let n=[],t=[];for(let s of e){if(s.kind!=="named"){n.push(s);continue}let r=s.runtimeName??s.runtime??"",a=t.find(i=>i.heading===r);a?a.options.push(s):t.push({heading:r,options:[s]})}return n.length?[{heading:null,options:n},...t]:t}function ds(e,n){let t=e.find(r=>r.kind==="auto")??{id:"auto",kind:"auto",label:"Automatic",model:"auto"};if(!n||n==="auto")return{selected:t,unavailable:null};let s=e.find(r=>r.id===n);return s?{selected:s,unavailable:null}:{selected:t,unavailable:n}}function ps(e){return e.runtime?{model:e.model,runtime:e.runtime}:{model:e.model}}function sn(e){return e.length>1}var ta={opus:"Most capable. Best for hard, multi-step work.",sonnet:"Balanced speed and quality for everyday runs.",haiku:"Fastest. Best for quick, simple runs."};function ms(e){if(e.kind==="auto"){let t=e.note?.replace(/^Uses /,"");return t?`Soba picks the model for each run. Currently using ${t}.`:"Soba picks the model for each run."}if(e.kind==="size")return e.id==="small"?"Quick and cheap. Whichever small model the agent serving has.":"The most capable model the agent serving has.";let n=ta[e.model];return n?e.machine?`${n} On ${e.machine}.`:n:e.machine?`On ${e.machine}.`:void 0}import{jsx as Ot,jsxs as Lr}from"react/jsx-runtime";function dt({options:e,selected:n,onPick:t,caption:s,onOpen:r,disabled:a,className:i}){let[c,o]=ra(!1),l=sa(null);if(!sn(e))return null;let u=i?`sc-mp ${i}`:"sc-mp";return Lr("span",{className:u,children:[s&&Ot("span",{className:"sc-mp-cap",children:s}),Lr("button",{ref:l,type:"button",className:"sc-mp-btn",...r?{}:{"aria-haspopup":"menu","aria-expanded":c},"aria-label":`Model: ${n.label}. Change`,disabled:a,onClick:r??(()=>o(d=>!d)),children:[Ot("span",{className:"sc-mp-label",children:n.label}),Ot(Nn,{open:!r})]}),c&&!r&&Ot(lt,{anchor:l,label:"Which model answers",options:oa(e),current:n.id,onClose:()=>o(!1),onPick:d=>{o(!1),d&&t(d)}})]})}function oa(e){let n=[];for(let t of ut(e))t.options.forEach((s,r)=>{let a=aa(s);n.push({id:s.id,label:s.label,...a?{note:a}:{},...t.heading&&r===0?{heading:t.heading}:{},...!t.heading&&s.kind==="size"&&r===1?{rule:!0}:{}})});return n}function aa(e){return e.kind!=="named"?e.note:e.machine?`on ${e.machine}`:void 0}import{useEffect as ia,useRef as la}from"react";import{jsx as he,jsxs as Lt}from"react/jsx-runtime";function hs({options:e,selected:n,onPick:t,onClose:s,busy:r}){let a=la(null);return ia(()=>{(a.current?.querySelector('[aria-checked="true"]')??a.current?.querySelector("[role=radio]"))?.focus()},[]),Lt("div",{className:"sc-tray sc-screen",onKeyDown:o=>{o.key==="Escape"&&(o.stopPropagation(),s())},children:[Lt("div",{className:"sc-screen-head",children:[he("button",{type:"button",className:"sc-back","aria-label":"Back",onClick:s,disabled:r,children:he(ca,{})}),he("h2",{className:"sc-screen-title",children:"Model"})]}),he("div",{ref:a,role:"radiogroup","aria-label":"Model",className:"sc-group-card sc-mopts",onKeyDown:o=>{if(!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft"].includes(o.key)||r)return;o.preventDefault();let u=e.findIndex(f=>f.id===n),d=o.key==="ArrowDown"||o.key==="ArrowRight"?1:-1,g=e[((u<0?0:u)+d+e.length)%e.length];g&&t(g.id)},children:e.map(o=>{let l=o.id===n,u=ms(o);return Lt("button",{type:"button",role:"radio","aria-checked":l,tabIndex:l?0:-1,className:"sc-mopt",disabled:r,onClick:()=>t(o.id),children:[Lt("span",{className:"sc-mopt-say",children:[he("span",{className:"sc-mopt-name",children:o.label}),u&&he("span",{className:"sc-mopt-desc",children:u})]}),he("span",{className:l?"sc-ring sc-ring-on":"sc-ring","aria-hidden":"true",children:l&&he(ua,{})})]},o.id)})}),he("p",{className:"sc-screen-foot",children:"Applies to new runs. Runs already in progress keep the model they started with."}),he("button",{type:"button",className:"sc-act-go",onClick:s,disabled:r,children:"Done"})]})}function ca(){return he("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-back-glyph",children:he("path",{d:"M15 6l-6 6 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ua(){return he("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:"sc-ring-tick",children:he("path",{d:"M5 10.5l3.2 3.2L15 6.5",fill:"none",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as Pe,jsxs as pa}from"react/jsx-runtime";function ae({className:e}){return pa("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:[Pe("path",{d:"M18.125 7.039A8.6 8.6 0 1 0 18.125 16.961A6 6 0 0 1 18.125 7.039Z",fill:"currentColor"}),Pe("path",{d:"M19.925 7.039A8.6 8.6 0 0 1 19.925 16.961A6 6 0 0 0 19.925 7.039Z",fill:"currentColor"})]})}function Tr({className:e}){return Pe("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Pe("path",{fill:"currentColor",d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"})})}function xn({className:e}){return Pe("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Pe("path",{fill:"currentColor",d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})})}function Tt({className:e}){return Pe("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Pe("path",{d:"M4 5h16v11H4zM9 20h6M12 16v4",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function da({className:e}){return Pe("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Pe("path",{d:"M5 7l5 5-5 5M12 18h7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function fs({className:e}){return Pe("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Pe("path",{d:"M5 6h14v10H5zM2.5 19.5h19",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var rn={claude:Tr,chatgpt:xn,local:Tt},Br={shell:da};function Wr(e,n){return n<2*6e4?e:n<10*6e4?Math.max(e,6e4):n<30*6e4?Math.max(e,3*6e4):Math.max(e,10*6e4)}var ma=3e3,ha=2*6e4,Bt=Date.now(),Gt=new Set,Gr=!1;function fa(){if(Gr||typeof window>"u")return;Gr=!0;let e=()=>{let t=Bt;if(Bt=Date.now(),Bt-t>ha)for(let s of Gt)s()};for(let t of["pointerdown","keydown","wheel","touchstart"])window.addEventListener(t,e,{capture:!0,passive:!0});let n=()=>{if(!document.hidden)for(let t of Gt)t()};window.addEventListener("focus",n),document.addEventListener("visibilitychange",n)}function Ee(e,n,t={}){fa();let s,r=t.immediate===!1?Date.now():0,a=!1,i=!1,c=()=>{i||(s=setTimeout(o,t.idle===!1?n:Wr(n,Date.now()-Bt)))},o=async()=>{if(clearTimeout(s),!(i||a)){if(typeof document>"u"||!document.hidden){a=!0,r=Date.now();try{await e()}catch{}finally{a=!1}}c()}},l=()=>{Date.now()-r>Math.min(n,ma)&&o()};return Gt.add(l),t.immediate===!1?c():o(),()=>{i=!0,clearTimeout(s),Gt.delete(l)}}import{useEffect as ga,useRef as Aa,useState as ba}from"react";function Gn(e){if(e.label)return e.label;if(e.task){let n=e.task.replace(/[_-]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}return"A run"}function Wt(e){if(e.status==="queued")return"Waiting for a free slot";if(e.step)return e.step;switch(e.phase?.kind){case"thinking":return"Thinking";case"writing":return"Writing";case"tool":return e.phase.tool?`Using ${e.phase.tool}`:"Using a tool";case"approval":return e.phase.tool?`Waiting for you to allow ${e.phase.tool}`:"Waiting for your approval";default:return e.first_output_at?"Working":"Starting"}}function pt(e){let n=Math.max(0,Math.round((Date.now()-new Date(e).getTime())/1e3));if(n<60)return`${n}s`;let t=Math.floor(n/60);return t<60?`${t}m ${String(n%60).padStart(2,"0")}s`:`${Math.floor(t/60)}h ${String(t%60).padStart(2,"0")}m`}function gs(e){let n=new Date(e);return Number.isNaN(n.getTime())?"\u2014":n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}import{jsx as B,jsxs as te}from"react/jsx-runtime";function bs({run:e,machine:n,appName:t,onClose:s,onStop:r,busy:a}){let i=Aa(null),[c,o]=ba(!1);ga(()=>{i.current?.focus()},[]);let l=y=>{y.key==="Escape"&&(y.stopPropagation(),s())},u=async()=>{o(!0);try{await r?.(e.id)}catch{o(!1)}},d=Gn(e),g=e.status==="running"&&!c,h=[n?.runtimes.find(y=>y.id===e.runtime_id)?.display_name??e.runtime_id,n?X(n):null].filter(Boolean).join(", ");return te("div",{className:"sc-tray sc-screen",onKeyDown:l,children:[te("div",{className:"sc-screen-head",children:[B("button",{ref:i,type:"button",className:"sc-back","aria-label":"Back to active runs",onClick:s,children:B(wa,{})}),B("span",{className:"sc-screen-from",children:"Active runs"})]}),te("div",{className:"sc-rd-head",children:[B("h2",{className:"sc-rd-name",children:d}),te("p",{className:"sc-rd-state",children:[B("span",{className:g?"sc-rd-dot sc-rd-dot-live":"sc-rd-dot","aria-hidden":"true"}),c?"Stopping\u2026":e.status==="queued"?`Queued for ${pt(e.started_at)}`:`Running for ${pt(e.started_at)}`]})]}),te("div",{className:"sc-group-card sc-rd-facts",children:[t&&te("p",{className:"sc-rd-fact",children:[B("span",{className:"sc-rd-key",children:"Source"}),B("span",{className:"sc-rd-val",children:t})]}),te("p",{className:"sc-rd-fact",children:[B("span",{className:"sc-rd-key",children:"Model"}),B("span",{className:"sc-rd-val",children:ya(e.model)})]}),h&&te("p",{className:"sc-rd-fact",children:[B("span",{className:"sc-rd-key",children:"Runs on"}),B("span",{className:"sc-rd-val",children:h})]})]}),te("section",{className:"sc-group",children:[B("div",{className:"sc-group-cap",children:B("p",{className:"sc-group-title",children:"Activity"})}),te("div",{className:"sc-group-card sc-rd-steps",children:[te("p",{className:"sc-rd-step",children:[B(As,{state:"done"}),B("span",{className:"sc-rd-say",children:"Started"}),B("span",{className:"sc-rd-when",children:gs(e.started_at)})]}),te("p",{className:"sc-rd-step",children:[B(As,{state:e.first_output_at?"done":"todo"}),B("span",{className:e.first_output_at?"sc-rd-say":"sc-rd-say sc-rd-wait",children:"First output"}),B("span",{className:"sc-rd-when",children:e.first_output_at?gs(e.first_output_at):"Not yet"})]}),te("p",{className:"sc-rd-step",children:[B(As,{state:g?"now":"todo"}),B("span",{className:"sc-rd-say",children:c?"Stopping":Wt(e)})]})]})]}),te("div",{className:"sc-acts",children:[r&&B("button",{type:"button",className:"sc-act-stop",onClick:()=>void u(),disabled:a||c,children:c?"Stopping\u2026":"Stop run"}),B("a",{className:"sc-act-quiet",href:vn(),children:"Open Soba"})]})]})}function ya(e){return!e||e==="auto"?"Automatic":e==="small"?"Fast":e==="large"?"Best":Xe(e)}function As({state:e}){return e==="done"?te("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:"sc-rd-mark sc-rd-mark-done",children:[B("circle",{cx:"10",cy:"10",r:"9",fill:"currentColor"}),B("path",{d:"M5.8 10.3l2.8 2.8 5.6-5.8",fill:"none",stroke:"var(--sc-tray-card, #ffffff)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}):e==="now"?te("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:"sc-rd-mark sc-rd-mark-now",children:[B("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:"var(--sc-line-2, #dcdce0)",strokeWidth:"2.4"}),B("path",{d:"M10 2a8 8 0 018 8",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round"})]}):B("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:"sc-rd-mark",children:B("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:"currentColor",strokeWidth:"2"})})}function wa(){return B("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-back-glyph",children:B("path",{d:"M15 6l-6 6 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}var we=[{id:"claude",costClass:"user-subscription",short:"Claude Code",label:"Continue with Claude",title:"The Claude plan you already pay for",cost:"Nothing beyond the plan",prerequisite:"Claude Code installed and signed in",hint:"Install it from claude.ai/code, then run `claude` once and sign in.",install:"https://claude.com/product/claude-code",expects:["claude-code"]},{id:"chatgpt",costClass:"user-subscription",short:"Codex",label:"Continue with ChatGPT",title:"The ChatGPT plan you already pay for",cost:"Nothing beyond the plan",prerequisite:"Codex installed and signed in",hint:"Install Codex, then run `codex` once and sign in.",install:"https://learn.chatgpt.com/codex/cli",expects:["codex"]},{id:"local",costClass:"user-hardware",short:"Local models",label:"Use a model on this machine",title:"A model on your own machine",cost:"Free. You bought the hardware",prerequisite:"Ollama running, with a model pulled",hint:"Install Ollama, then `ollama pull` a model before pairing.",install:"https://ollama.com",expects:["ollama","openai-api"]}],Hr=["claude","chatgpt"];function ys(){return we.filter(e=>Hr.includes(e.id))}function ws(e){return we.filter(n=>n.costClass===e)}function Cs(e){return we.find(n=>n.expects.includes(e))??null}import{Fragment as Hn,jsx as p,jsxs as v}from"react/jsx-runtime";function Mn({machines:e,hosted:n=[],onApproveRuntime:t,onPreferRuntime:s,onDisconnectHosted:r,onPair:a,onWake:i,onOpenApp:c,onRefresh:o,refreshing:l,busy:u,appName:d,model:g,onPickModel:f,error:h,runs:y,loadRuns:S,loading:I,machineMenu:E,machineNote:G,onReconnect:Y,openApp:L=!0,children:T,onStopRun:O}){let w=Ve(e),de=e.filter(R=>R.id!==w?.id),K=w?.state==="online",[ve,_]=Wn(()=>K?[]:null),[Ie,He]=Wn("no"),[fe,Oe]=Wn(!1),[z,ee]=Wn(null),ze=y===void 0&&!!S,q=ze?ve:y??(K?[]:null),ge=y!==void 0||!!S;Dr(()=>{z&&q&&!q.some(R=>R.id===z)&&ee(null)},[z,q]);let ke=!!(w&&Ze(w));Dr(()=>{if(!ze||!S||!ke)return;let R=!0,$e=Ee(async()=>{let pe=await S();R&&_(pe)},3e3);return()=>{R=!1,$e()}},[ze,S,ke]);let De=(w?os(w):[]).filter(R=>R.quarantined&&!R.absent),Z=Ns(w,g).runtime,se=Z?.cost_class==="user-hardware"?Z:null,$=se?Ga(Ba(se,g)):null,Ae=!!w&&!Ze(w),Ne=(()=>{if(!w||Ae||!Z||Qe(Z).tone!=="warn")return null;let $e=X(w);return{title:`${Z.display_name} is signed out`,detail:`Sign in on ${$e} so Soba can start runs.`}})(),Ue=()=>{c?.(),He("going"),kn().then(R=>He(R==="absent"?"absent":"no"))},ne=()=>{Ue(),i?.()},Q={label:Ie==="going"?"Opening Soba\u2026":"Open Soba",onPress:Ue,spin:Ie==="going"},x=w?Q:a?{label:"Connect to Soba",onPress:a}:null,C=!!w&&x===Q,Le=C&&!!o,Fe=o&&p("button",{type:"button",className:"sc-disc",onClick:o,disabled:l,"aria-label":"Refresh",title:"Refresh",children:p(Ua,{spinning:!!l})});if(!w&&n.length===0&&!a)return p("p",{className:"sc-note",children:"Nothing connected yet."});if(fe&&w&&g&&f){let R=Qr(w,g);if(sn(R.options))return p(hs,{options:R.options,selected:g.id,onPick:f,onClose:()=>Oe(!1),...u?{busy:u}:{}})}let re=z?q?.find(R=>R.id===z):void 0;return re?p(bs,{run:re,onClose:()=>ee(null),...w?{machine:w}:{},...d?{appName:d}:{},...O?{onStop:O}:{},...u?{busy:u}:{}}):v("div",{className:"sc-tray",children:[w&&v(Be,{title:"This machine",action:(o&&!Le||L||E)&&v("span",{className:"sc-cap-acts",children:[!Le&&Fe,L&&p(Pa,{}),E]}),children:[p(va,{machine:w}),G]}),w&&Ae&&!w.pairing_lost&&p(Be,{title:"Soba",children:v("div",{className:"sc-away",children:[p("span",{className:"sc-away-mark","aria-hidden":"true",children:p(nn,{kind:"paused",size:30})}),v("span",{className:"sc-away-say",children:[p("span",{className:"sc-away-title",children:"Wake it up"}),v("span",{className:"sc-away-body",children:["Soba on ",X(w)," is not answering. Waking it opens the app there."]})]}),p("button",{type:"button",className:"sc-away-go",onClick:ne,disabled:u||Ie==="going",children:Ie==="going"?"Waking\u2026":"Wake"})]})}),w?.pairing_lost&&!Ze(w)&&p(Be,{title:"Soba",children:v("div",{className:"sc-away",children:[p("span",{className:"sc-away-mark","aria-hidden":"true",children:p(nn,{kind:"gone",size:30})}),v("span",{className:"sc-away-say",children:[p("span",{className:"sc-away-title",children:"Connect it again"}),p("span",{className:"sc-away-body",children:"Its pairing has ended, so it cannot take runs until it is connected again."})]}),Y&&p("button",{type:"button",className:"sc-away-go",onClick:Y,disabled:u,children:"Connect"})]})}),w&&!Ae&&p(Be,{title:"Runs on",children:Z?p(Oa,{machine:w,appName:d,busy:u,...g?{model:g}:{},...f?{onPickModel:f,onOpenModels:()=>Oe(!0)}:{},...s?{onPick:R=>s(w.id,R)}:{},...t?{onApprove:R=>t(w.id,R)}:{}}):v("div",{className:"sc-blank",children:[p("span",{className:"sc-blank-mark","aria-hidden":"true",children:p(xa,{})}),v("span",{className:"sc-blank-say",children:[p("span",{className:"sc-blank-title",children:I?"Looking\u2026":"No agent on this machine"}),p("span",{className:"sc-blank-body",children:I?"Reading what it can run.":"Install Claude Code, Codex or Ollama there and it will appear here."})]}),!I&&L&&v("a",{className:"sc-blank-act",href:vn(),children:[p("span",{children:"Add agents"}),p(vs,{})]})]})}),w&&(Ne||$)&&v(Be,{title:"Needs attention",children:[Ne&&v("div",{className:"sc-alarm",children:[p("span",{className:"sc-alarm-mark","aria-hidden":"true",children:p(Ur,{})}),v("span",{className:"sc-alarm-say",children:[p("span",{className:"sc-alarm-title",children:Ne.title}),p("span",{className:"sc-alarm-body",children:Ne.detail})]})]}),$&&v("div",{className:"sc-alarm sc-alarm-warn",children:[p("span",{className:"sc-alarm-mark","aria-hidden":"true",children:p(Ur,{})}),v("span",{className:"sc-alarm-say",children:[p("span",{className:"sc-alarm-title",children:"A large model on this computer"}),v("span",{className:"sc-alarm-body",children:["Your ",$," model can take all this computer's memory while it answers."]})]})]})]}),w&&ge&&!Ae&&p(Na,{machine:w,runs:q,onOpen:R=>ee(R),...O?{onStop:O}:{}}),w&&p(Hn,{children:De.length>0&&!Ae&&!(s&&t&&Se(w).by!=="app")&&p(Be,{title:"New on this machine",children:De.map(R=>p(Ia,{runtime:R,...t?{onApprove:()=>t(w.id,R.id)}:{}},R.id))})}),n.length>0&&p(Be,{title:n.length>1?"Connected plans":"Connected plan",children:n.map(R=>p(Ha,{credential:R,appName:d,busy:u,...r?{onDisconnect:()=>r(R.provider)}:{}},R.provider))}),de.length>0&&p(Be,{title:"Your other machines",children:de.map(R=>p(Ea,{machine:R},R.id))}),!w&&a&&p(Be,{title:"Your machines",children:v("button",{type:"button",className:"sc-pair",onClick:a,children:[p("span",{className:"sc-otile","aria-hidden":"true",children:p(Da,{})}),p("span",{className:"sc-oname",children:"Connect a machine"})]})}),x&&v("div",{className:"sc-acts",children:[C&&x?v("div",{className:"sc-acts-row",children:[Le?Fe:p("span",{}),v("button",{type:"button",className:"sc-act-small",onClick:x.onPress,disabled:u||x.spin,"data-spin":x.spin?"true":void 0,children:[x.spin&&p(Fr,{}),x.label,!x.spin&&p(vs,{})]})]}):x&&v("button",{type:"button",className:"sc-act-go",onClick:x.onPress,disabled:u||x.spin,"data-spin":x.spin?"true":void 0,children:[x.spin&&p(Fr,{}),x.label]}),Ie==="absent"&&v("p",{className:"sc-act-miss",children:["Nothing opened here. ",w?X(w):"That machine"," may be a different computer, or the Soba app is not installed on this one."]})]}),T,h&&p("p",{className:"sc-error sc-tray-error",children:h})]})}function Be({title:e,action:n,children:t}){return v("section",{className:"sc-group",children:[v("div",{className:"sc-group-cap",children:[p("p",{className:"sc-group-title",children:e}),n]}),p("div",{className:"sc-group-card",children:t})]})}function va({machine:e,onToggle:n,open:t}){let s=Ze(e),r=[s?null:e.pairing_lost?"Not connected to Soba":"Soba is asleep",s?rt(e):null,e.always_on?"always on":null].filter(Boolean),a=s&&e.capacity>0?e.active>0?`${e.active} of ${e.capacity} running`:null:ot(e.last_seen_at),i=v(Hn,{children:[v("span",{className:"sc-mtile","aria-hidden":"true",children:[p(Vr,{}),p("span",{className:`sc-mbadge sc-mbadge-${s?Cn(e).tone:e.pairing_lost?"off":"away"}`})]}),v("span",{className:"sc-mid",children:[p("span",{className:"sc-mname",children:X(e)}),v("span",{className:"sc-mmeta",children:[p("span",{className:"sc-mmeta-is",children:r.map((c,o)=>v("span",{children:[o>0&&p("span",{className:"sc-mmeta-sep",children:"\xB7"}),c]},c))}),a&&p("span",{className:"sc-mmeta-now",children:a})]})]})]});return!n||!s?p("div",{className:"sc-mrow",children:i}):v("button",{type:"button",className:"sc-mrow sc-mrow-btn",onClick:n,"aria-expanded":!!t,title:t?"Hide what it is running":"See what it is running",children:[i,p(Nn,{open:!!t})]})}function ka(e,n){return e.filter(t=>t.machine_id===n.id||t.machine_id===null)}function Na({machine:e,runs:n,onStop:t,onOpen:s}){let r=n?ka(n,e):[],[a,i]=Wn(new Set),c=async l=>{i(u=>new Set(u).add(l));try{await t?.(l)}catch{i(u=>{let d=new Set(u);return d.delete(l),d})}},o=()=>{for(let l of r)c(l.id)};return p(Be,{title:"Active runs",...t&&r.length>1?{action:p("button",{type:"button",className:"sc-cap-link",onClick:o,children:"Stop all"})}:{},children:n===null?p("p",{className:"sc-row-note",children:"Looking\u2026"}):r.length===0?v("p",{className:"sc-nilrow",children:[p("span",{className:"sc-nilrow-mark","aria-hidden":"true",children:p(Ma,{})}),"Nothing running"]}):r.map(l=>p(Sa,{run:l,stopping:a.has(l.id),...t?{onStop:()=>void c(l.id)}:{},...s?{onOpen:()=>s(l.id)}:{}},l.id))})}function xa(){return v("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-blank-glyph",children:[p("rect",{x:"3",y:"4.5",width:"18",height:"15",rx:"2.5",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),p("path",{d:"M7.5 10l2.5 2.2-2.5 2.2M12.5 14.6h4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ma(){return v("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-blank-glyph",children:[p("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),p("path",{d:"M9 12.5l2.2 2.2L15.5 9.8",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Sa({run:e,stopping:n,onStop:t,onOpen:s}){let r=v(Hn,{children:[p("span",{className:n?"sc-rdot":"sc-rdot sc-rdot-live","aria-hidden":"true"}),v("span",{className:"sc-mid",children:[p("span",{className:"sc-rtitle",children:Gn(e)}),p("span",{className:"sc-rstep",children:n?"Stopping\u2026":`${Wt(e)} \xB7 ${pt(e.started_at)}`})]})]});return v("div",{className:"sc-rrow",children:[s?v("button",{type:"button",className:"sc-rgo",onClick:s,"aria-label":`${Gn(e)} \u2014 open this run`,children:[r,p(Nn,{open:!1})]}):r,t&&p("button",{type:"button",className:"sc-rstop",onClick:t,disabled:n,"aria-label":`Stop ${Gn(e)}`,children:p("span",{className:"sc-rstop-ring",children:p(Fa,{})})})]})}function Ra(e){let n=Cs(e);return(n?rn[n.id]:null)??Br[e]??null}function Pa(){return p("a",{className:"sc-disc sc-open-app",href:vn(),"aria-label":"Open Soba App",title:"Open Soba App",children:p(vs,{})})}function vs(){return p("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-dglyph",children:p("path",{d:"M14 4h6v6M20 4l-8.5 8.5M18 14.5V19a1 1 0 01-1 1H5a1 1 0 01-1-1V7a1 1 0 011-1h4.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ea({machine:e}){let n=Cn(e);return v("div",{className:"sc-orow",children:[p("span",{className:"sc-otile","aria-hidden":"true",children:p(Vr,{})}),p("span",{className:"sc-oname",children:X(e)}),p("span",{className:"sc-oword",children:n.word}),p("span",{className:`sc-dot sc-dot-${n.tone}`,"aria-hidden":"true"})]})}function Ia({runtime:e,onApprove:n}){return v("div",{className:"sc-mrow",children:[p("span",{className:"sc-mtile sc-atile","aria-hidden":"true",children:p(Ht,{id:e.id,name:e.display_name})}),v("span",{className:"sc-mid",children:[p("span",{className:"sc-mname",children:e.display_name}),p("span",{className:"sc-mmeta",children:e.version??"waiting to be let in"})]}),n?p("button",{type:"button",className:"sc-row-act",onClick:n,children:"Let it serve"}):p("span",{className:"sc-averdict sc-tone-warn",children:"not serving yet"})]})}function ks({id:e,name:n}){return p("span",{className:"sc-runtime-tile","aria-hidden":"true",children:p(Ht,{id:e,...n?{name:n}:{}})})}function Ht({id:e,name:n}){if(!e)return null;let t=Ir[e];if(t)return p("img",{src:t,alt:"",className:"sc-runtime-logo"});let s=Ra(e);return s?p(s,{className:"sc-runtime-mark"}):n?p("span",{className:"sc-runtime-letter",children:n.slice(0,1).toUpperCase()}):null}function Qr(e,n){if(!n)return{options:[]};let t=Ns(e,n),s=t.runtime?.id??t.runtimeId,r=ct([e]).filter(c=>c.kind==="named"?c.runtime===s:c.kind==="size"?!!s&&Et(s):!0),a=t.runtime?.default_model;if(n.kind!=="auto"||!a)return{options:r,shown:n};let i=Xe(a);return{options:r,shown:{...n,label:i.length>16?i:`${n.label} \xB7 ${i}`}}}function Oa({machine:e,appName:n,busy:t,onPick:s,model:r,onPickModel:a,onOpenModels:i,onApprove:c}){let o=Ns(e,r),l=ye(e),u=c?e.runtimes.filter(O=>O.quarantined&&!O.absent):[],[d,g]=Wn(!1),f=Ca(null);if(o.by!=="app"&&l.length===0)return null;let h=O=>O?p(ks,{id:O.id,name:O.display_name}):null,y=o.runtime?.display_name??o.runtimeId??"\u2014",S=o.by!=="app"&&o.by!=="model"&&!!s&&(l.length>=2||u.length>0),I=o.runtime?.id??o.runtimeId,E=!Ze(e),G=o.runtime&&Qe(o.runtime).tone==="warn"?"Signed out":null,{options:Y,shown:L}=Qr(e,r),T=o.by==="app"?`Set by ${n??"the app"}`:o.runtime?Ta(o.runtime):null;return v(Hn,{children:[S?v("button",{ref:f,type:"button",className:E?"sc-runs-agent sc-runs-dim":"sc-runs-agent","aria-haspopup":"menu","aria-expanded":d,"aria-label":`Runs go to ${y}. Change`,disabled:t,onClick:()=>g(O=>!O),children:[p("span",{className:"sc-runs-tile","aria-hidden":"true",children:p(Ht,{id:I??null,name:y})}),v("span",{className:"sc-runs-said-name",children:[p("span",{className:"sc-runs-name",children:y}),G&&p("span",{className:"sc-runs-ill",children:G})]}),p(Nn,{open:!1})]}):v("span",{className:E?"sc-runs-agent sc-runs-fixed sc-runs-dim":"sc-runs-agent sc-runs-fixed",children:[p("span",{className:"sc-runs-tile","aria-hidden":"true",children:p(Ht,{id:I??null,name:y})}),v("span",{className:"sc-runs-said-name",children:[p("span",{className:"sc-runs-name",children:y}),G&&p("span",{className:"sc-runs-ill",children:G})]}),o.by==="app"&&v("span",{className:"sc-runs-told",children:["set by ",n??"the app"]}),o.by==="model"&&p("span",{className:"sc-runs-told",children:"set by the model"})]}),L&&a&&sn(Y)?v(Hn,{children:[p("span",{className:"sc-runs-rule","aria-hidden":"true"}),p(dt,{options:Y,selected:L,onPick:a,caption:"Model",...i?{onOpen:i}:{},className:E?"sc-runs-model sc-runs-dim":"sc-runs-model",...t?{disabled:t}:{}})]}):T&&v(Hn,{children:[p("span",{className:"sc-runs-rule","aria-hidden":"true"}),v("span",{className:"sc-runs-said",children:[p("span",{className:"sc-runs-key",children:"Model"}),p("span",{className:"sc-runs-val",children:T})]})]}),d&&s&&p(La,{anchor:f,machine:e,tile:h,waiting:u,...c?{onApprove:c}:{},onClose:()=>g(!1),onPick:O=>{g(!1),s(O)}})]})}function La({anchor:e,machine:n,tile:t,waiting:s,onApprove:r,onClose:a,onPick:i}){let c=Se(n),o=Se({...n,preferred_runtime:null}).runtime,l=c.by==="you"?c.runtimeId:null,u=[{id:null,label:"Automatic",...o?{note:`Uses ${o.display_name}`}:{},glyph:t(o)},...ye(n).map((d,g)=>{let f=Wa(d);return{id:d.id,label:d.display_name,glyph:t(d),...f?{note:f}:{},...g===0?{rule:!0}:{}}}),...r?s.map((d,g)=>({id:`waiting:${d.id}`,label:d.display_name,glyph:t(d),...d.version?{note:d.version}:{},trailing:"Let it serve",onChoose:()=>r(d.id),...g===0?{heading:"New on this machine"}:{}})):[]];return p(lt,{anchor:e,label:"Which agent runs go to",options:u,current:l,onClose:a,onPick:i})}function Ta(e){let n=Qe(e);return n.tone==="warn"?n.text:e.default_model?Xe(e.default_model):"Automatic"}function Ns(e,n){if(!e)return{by:"default",runtimeId:null,runtime:null};let t=Se(e);if(t.by==="app"||n?.kind!=="named"||!n.runtime)return t;let s=ye(e).find(r=>r.id===n.runtime);return!s||s.id===t.runtimeId?t:{by:"model",runtimeId:s.id,runtime:s}}function Ba(e,n){return!n||n.kind==="auto"?e.default_model:n.kind==="size"?(Pr(n.model)?Er(e.id,n.model):void 0)??e.default_model:n.runtime===e.id?n.model:e.default_model}function Ga(e){if(!e)return null;let n=/(\d+(?:\.\d+)?)\s*b\b/i.exec(e),t=n?.[1]?Number(n[1]):Number.NaN;return!Number.isFinite(t)||t<20?null:`${n?.[1]}B`}function Wa(e){let n=Qe(e);return n.tone==="warn"?n.text:e.default_model?Xe(e.default_model):e.cost_class==="user-hardware"?"In this machine's memory":n.tone!=="ok"?n.text:e.version??void 0}function Ha({credential:e,appName:n,busy:t,onDisconnect:s}){return v("div",{className:"sc-hrow",children:[v("div",{className:"sc-orow",children:[p("span",{className:"sc-otile","aria-hidden":"true",children:p(xn,{className:"sc-omark"})}),v("span",{className:"sc-mid",children:[p("span",{className:"sc-oname",children:e.provider==="openai-chatgpt"?"ChatGPT plan":e.provider}),p("span",{className:"sc-mmeta",children:e.account_label??"signed in"})]}),s&&p("button",{type:"button",className:"sc-row-act",onClick:s,disabled:t,children:"Disconnect"})]}),s&&v("p",{className:"sc-row-note",children:[n??"This app"," stops using it. To withdraw the grant entirely, remove it in your OpenAI settings."]})]})}function Vr(){return v("svg",{viewBox:"0 0 32 24","aria-hidden":"true",focusable:"false",className:"sc-mglyph",children:[p("rect",{x:"4",y:"1.5",width:"24",height:"15",rx:"2.5",fill:"var(--sc-sheet, #ffffff)",stroke:"currentColor",strokeWidth:"2"}),p("rect",{x:"1",y:"19.5",width:"30",height:"2.5",rx:"1.25",fill:"currentColor"})]})}function Da(){return p("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-oglyph",children:p("path",{d:"M12 5v14M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function Ur(){return v("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-hglyph",children:[p("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"2"}),p("path",{d:"M12 7.5v5.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),p("circle",{cx:"12",cy:"16.5",r:"1.15",fill:"currentColor"})]})}function Fr(){return v("svg",{className:"sc-act-glyph sc-spin",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[p("circle",{cx:"8",cy:"8",r:"6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),p("path",{d:"M8 1.8a6.2 6.2 0 0 1 6.2 6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function Ua({spinning:e}){return p("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e?"sc-dglyph sc-spin":"sc-dglyph",children:p("path",{d:"M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Fa(){return p("svg",{className:"sc-dglyph",viewBox:"0 0 14 14","aria-hidden":"true",children:p("rect",{x:"2",y:"2",width:"10",height:"10",rx:"2",fill:"currentColor"})})}import{jsx as Qa}from"react/jsx-runtime";function xs({machines:e,onApproveRuntime:n,model:t,onPickModel:s}){return Qa(Mn,{machines:e,...n?{onApproveRuntime:n}:{},...t?{model:t}:{},...s?{onPickModel:s}:{}})}import{useCallback as ie,useEffect as Ce,useId as za,useMemo as on,useRef as Dn,useState as j}from"react";var mt=[{slug:"mac-arm",label:"macOS, Apple silicon"},{slug:"mac-intel",label:"macOS, Intel"},{slug:"windows",label:"Windows"},{slug:"linux",label:"Linux"}];function ht(e){if(!e)return"";try{return new URL(e).origin}catch{return""}}var Jr="soba.connect.choice",Va=180*24*60*60*1e3;function Ms(e){let n=2166136261;for(let t=0;t<e.length;t++)n^=e.charCodeAt(t),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function Ss(e,n){return e?n?`${Jr}.${e}.${Ms(n)}`:`${Jr}.${e}`:null}function Rs(e){if(!e||typeof localStorage>"u")return null;try{let n=localStorage.getItem(e);if(!n)return null;let t=JSON.parse(n);if(Date.now()-Date.parse(t.at)>Va)return null;let s=we.find(r=>r.id===t.choice);return s?s.id:null}catch{return null}}function Ps(e,n){if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify({choice:n,at:new Date().toISOString()}))}catch{}}var Yr="soba.connect.model",Ja=180*24*60*60*1e3;function Es(e,n){return e?n?`${Yr}.${e}.${Ms(n)}`:`${Yr}.${e}`:null}function Dt(e){if(!e||typeof localStorage>"u")return null;try{let n=localStorage.getItem(e);if(!n)return null;let t=JSON.parse(n);if(Date.now()-Date.parse(t.at)>Ja)return null;let s=t.choice;return typeof s!="string"||!s||s.length>120?null:/^[\w.:@+-]+(\/[\w.:@+-]+)?$/.test(s)?s:null}catch{return null}}function Is(e,n){if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify({choice:n,at:new Date().toISOString()}))}catch{}}var zr="soba.connect.dismissed",Ya=30*24*60*60*1e3;function Os(e,n){return e?n?`${zr}.${e}.${Ms(n)}`:`${zr}.${e}`:null}function Ls(e){if(!e||typeof localStorage>"u")return!1;try{let n=localStorage.getItem(e);if(!n)return!1;let t=JSON.parse(n);return Date.now()-Date.parse(t.at)<Ya}catch{return!1}}function Ts(e){if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify({at:new Date().toISOString()}))}catch{}}import{Fragment as Fn,jsx as m,jsxs as M}from"react/jsx-runtime";var Bs=2e3,ja=1e4,qa=9e4,Za=6e4;function Gs(e,n,t,s=[],r){return e?"code":n&&(t.length>0||s.length>0)?"manage":r?"launch":"choose"}function jr(e){return Ze(e)&&!e.pairing_lost}function Ut(e){return new Map(e.map(n=>[n.id,jr(n)]))}function Xa(e){let n=Math.max(0,Math.round(e/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function Ds({client:e,initialCode:n,initialChoice:t,onConnected:s,showStatus:r=!0,initialContext:a=null,initialMachines:i,onClose:c,headingId:o,theme:l,reason:u,active:d=!0}){let g=!!a&&i!==void 0,[f,h]=j(g?Gs(n,r,i??[],[],t):"loading"),[y,S]=j(a),[I,E]=j(i??[]),[G,Y]=j(n??""),[L,T]=j(null),[O,w]=j(null),[de,K]=j(!1),[ve,_]=j(0),[Ie,He]=j("app"),[fe,Oe]=j(()=>Date.now()),[z,ee]=j(null),[ze,q]=j(!1),[ge,ke]=j(!1),[je,De]=j("browser"),[Z,se]=j(null),[$,Ae]=j([]),[Ne,Ue]=j(0),[ne,Q]=j(null),x=Dn(null),[C,Le]=j(t??null),[Fe,re]=j(null),R=on(()=>{let A=y?.accent?.trim(),N=y?.background?.trim();if(!(!A&&!N))return N?{...yn(N,A),background:N,borderRadius:"inherit"}:{"--sc-accent":A,"--sc-accent-fg":st(A)}},[y?.accent,y?.background]),$e=za(),pe=o??$e,un=Dn(null);Ce(()=>{if(!e||g)return;let A=!0;return Promise.all([e.context(),e.machines()]).then(([N,U])=>{A&&(S(N),E(U),h(Gs(n,r,U)))}).catch(N=>{A&&(w(N.message),h("choose"))}),()=>{A=!1}},[e,n,r,g]),Ce(()=>{f!=="loading"||!g||h(Gs(n,r,i??[]))},[f,g,n,r,i]),Ce(()=>{i&&E(i)},[i]),Ce(()=>{a&&S(a)},[a]);let en=Dn(!1),dn=Dn(f);dn.current=f;let Xn=Dn($);Xn.current=$;let pn=!!y?.hosted_available;Ce(()=>{!r&&dn.current==="manage"&&h("choose")},[r]),Ce(()=>{if(!e||!d||f!=="manage")return;let A=!0,N=Ee(async()=>{try{let U=await e.machines();if(!A)return;E(U);let J=!pn||en.current;U.length===0&&Xn.current.length===0&&J&&dn.current==="manage"&&h("choose")}catch{}},ja,{immediate:!1});return()=>{A=!1,N()}},[f,e,pn,d]);let mn=Ss(y?.publishable_key??null);Ce(()=>{re(Rs(mn))},[mn]),Ce(()=>{if(!e||!pn)return;let A=!0;return e.hosted().then(N=>{A&&(Ae(N.credentials),!en.current&&(en.current=!0,N.credentials.length>0&&r&&dn.current==="choose"&&h("manage")))}).catch(()=>{}),()=>{A=!1}},[e,pn,r]),Ce(()=>{if(!e||!d||f!=="hosted")return;let A=!0,N=async()=>{try{let Me=await e.hosted();if(!A)return!1;if(Ae(Me.credentials),Me.credentials.length>0)return h("hosted_connected"),Q(null),!0}catch{}return!1},U=async()=>{x.current?.closed&&(x.current=null,!await N()&&A&&h("choose"))},J=Ee(N,Bs,{immediate:!1}),gn=setInterval(U,400),An=Me=>{let $n=Me.data;$n?.source==="soba"&&$n.type==="hosted_result"&&N()};return window.addEventListener("message",An),()=>{A=!1,J(),clearInterval(gn),window.removeEventListener("message",An),x.current=null}},[e,f,d]);let Xt=ie(()=>{if(!e)return;let A=window.open("","soba-connect-plan","width=520,height=760,noopener=no");x.current=A,h("hosted"),Ue(Date.now()),Q(null),w(null),e.startHosted().then(({url:N})=>{if(A&&!A.closed){A.location.href=N;return}Q(N)}).catch(N=>{A?.close(),x.current=null,w(N.message),h("choose")})},[e]),In=ie(async A=>{if(e){K(!0);try{await e.disconnectHosted(A),Ae((await e.hosted()).credentials)}catch(N){w(N.message)}finally{K(!1)}}},[e]);Ce(()=>{if(!e||!d||f!=="waiting")return;let A=!0,N=Ee(async()=>{try{let U=await e.machines();if(!A)return;E(U);let J=un.current;if(!J)return;let gn=U.filter(Me=>!J.has(Me.id)||J.get(Me.id)===!1&&jr(Me)),An=gn.find(Me=>Me.state!=="offline")??gn[0];if(An){se(An.id),C&&Ps(mn,C);let Me=we.find($t=>$t.id===C)?.expects??[],$n=ye(An).find($t=>Me.includes($t.id));$n&&e.preferRuntime(An.id,$n.id).catch(()=>{}),h("connected"),s?.(U)}}catch{}},Bs,{immediate:!1});return()=>{A=!1,N()}},[f,e,s,C,mn,d]);let St=ie(async()=>{if(e){w(null),K(!0);try{let A=await e.lookup(G);T(A),h("confirm")}catch(A){w(A.message)}finally{K(!1)}}},[e,G]),Kn=ie(async()=>{if(e){w(null),K(!0);try{try{un.current=Ut(await e.machines())}catch{un.current=Ut(I)}await e.approve(G),He("code"),h("waiting"),_(Date.now())}catch(A){w(A.message)}finally{K(!1)}}},[e,G,I]),Rt=ie(async()=>{if(e){K(!0);try{await e.deny(G),De("browser"),h("denied")}catch(A){w(A.message)}finally{K(!1)}}},[e,G]),V=on(()=>y?.connect_url??null,[y]),[be,_n]=j(()=>it()),Kt=on(()=>V?at(V,be??void 0,C??void 0):null,[V,be,C]),k=on(()=>ht(V),[V]),oe=ie(A=>{if(I.length===0)return null;let N=we.find(J=>J.id===A);if(!N)return null;let U=I.flatMap(J=>J.runtimes??[]).filter(J=>N.expects.includes(J.id));return U.length===0?{tone:"dim",text:"not installed"}:U.some(J=>J.authenticated===!0)?{tone:"ok",text:"ready"}:U.every(J=>J.authenticated===!1)?{tone:"warn",text:"needs signing in"}:{tone:"dim",text:"installed"}},[I]),xe=ie((A=null)=>{Le(A),w(null),ee(null),q(!1),ke(!1),On.current=!1,_n(it()),h("launch")},[]),On=Dn(!!t);Ce(()=>{f!=="launch"||!V||On.current||(On.current=!0,q(!0),ls(V,{...be?{nonce:be}:{},...C?{want:C}:{}}).then(ee))},[f,V,be,C]);let Te=ie(()=>{q(!0),is().then(ee)},[]),_t=ie(A=>{if(ge){let N=it();ke(!1),_n(N),V&&(A.preventDefault(),window.location.href=at(V,N??void 0,C??void 0))}Te()},[ge,Te,V,C]),qe=on(()=>{let A=y?.runtimes;return A?we.filter(N=>A.includes(N.id)):ys()},[y?.runtimes]),me=on(()=>{let A=we.find(N=>N.id===C);return A?{choice:A,Mark:rn[A.id]??null}:null},[C]),hn=on(()=>I.find(A=>A.id===Z),[I,Z]),Pt=ie(()=>{h("manage"),c?.()},[c]);Ce(()=>{let A=be;if(!e||!d||f!=="launch"||!A)return;let N=!1,U=Date.now()+15e4,J=()=>{};return J=Ee(async()=>{if(Date.now()>U){J(),ke(!0);return}try{let gn=await e.claim(A);if(N)return;if(gn.declined){J(),ee(null),De("machine"),h("denied");return}if(!gn.claimed)return;J();try{un.current=Ut(await e.machines())}catch{un.current=Ut(I)}He("app"),h("waiting"),_(Date.now())}catch{}},Bs,{immediate:!1,idle:!1}),()=>{N=!0,J()}},[e,f,I,be,d]);let fn=on(()=>{if(!L)return null;if(L.approved||L.denied)return"answered";let A=L.expires_at?Date.parse(L.expires_at):Number.NaN;return Number.isFinite(A)&&A<=fe?"expired":"live"},[L,fe]);Ce(()=>{if(!(f==="confirm"&&fn==="live"||f==="waiting"||f==="hosted"))return;let N=setInterval(()=>Oe(Date.now()),1e3);return()=>clearInterval(N)},[f,fn]);let Wo=ie(async(A,N)=>{if(e)try{await e.approveRuntime(A,N),E(await e.machines())}catch(U){w(U.message)}},[e]),Ho=ie(async(A,N)=>{if(e)try{await e.preferRuntime(A,N),E(await e.machines())}catch(U){w(U.message)}},[e]);return f==="loading"?m("div",{className:"soba-connect",...l?{"data-theme":l}:{},style:R,children:m("div",{className:"sc-card",children:m("p",{className:"sc-note",children:"Loading\u2026"})})}):M("div",{className:"soba-connect",...l?{"data-theme":l}:{},style:R,children:[c&&m("button",{type:"button",className:"sc-modal-close",onClick:c,"aria-label":"Close",children:"\xD7"}),f==="manage"&&M("div",{className:"sc-card",children:[m("h2",{className:"sc-title",id:pe,children:"Your compute"}),M("p",{className:"sc-sub",children:[m(Ft,{context:y})," ",I.length>0&&$.length>0?"runs on your connected plan, and on these machines while they are awake.":$.length>0?"runs on the plan you connected. Nothing here is charged to you.":"runs on these machines, while they are awake."]}),m(Mn,{machines:I,hosted:$,onApproveRuntime:Wo,onPreferRuntime:(A,N)=>void Ho(A,N),onDisconnectHosted:A=>void In(A),onPair:()=>h("choose"),busy:de,...y?.app.name?{appName:y.app.name}:{}}),O&&m("p",{className:"sc-error",children:O})]}),f==="choose"&&M("div",{className:"sc-card",children:[m(_a,{context:y}),m("h2",{className:"sc-h",id:pe,children:u==="payment_required"?"Carry on with your own AI":u==="no_compute"?"This run needs a machine":"Connect your AI"}),m("p",{className:"sc-p",children:"Use compute you already have."}),V&&qe.length>0&&M(Fn,{children:[m("div",{className:"sc-opts",children:qe.map(A=>{let N=rn[A.id];return M("button",{type:"button",className:"sc-opt",onClick:()=>xe(A.id),children:[m("span",{className:"sc-opt-tile","aria-hidden":"true",children:N&&m(N,{className:"sc-opt-mark"})}),m("span",{className:"sc-opt-text",children:m("span",{className:"sc-opt-label",children:A.label})}),(()=>{let U=oe(A.id);return U?m("span",{className:`sc-opt-has sc-opt-has-${U.tone}`,children:U.text}):Fe===A.id?m("span",{className:"sc-opt-last",children:"last used"}):m(Ws,{className:"sc-opt-go"})})()]},A.id)})}),M("p",{className:"sc-opt-note",children:["Your accounts stay there. ",qr(y)," never sees them."]})]}),(!V||qe.length===0)&&m("p",{className:"sc-error",style:{marginTop:16},children:"This app has no publishable key yet, so there is nothing to pair against."}),O&&m("p",{className:"sc-error",children:O}),V&&y?.show_code===!0&&m("div",{className:"sc-opt-alt",children:m("button",{type:"button",className:"sc-alt-link",onClick:()=>h("code"),children:"I have a code"})})]}),f==="launch"&&M("div",{className:"sc-card",children:[M("div",{className:"sc-head",children:[m(Un,{onClick:()=>h("choose")}),m("p",{className:"sc-head-title",children:"Soba App"})]}),m(Qt,{mark:me?.Mark??ae,still:ge||!ze&&z===null}),m("h2",{className:"sc-h",id:pe,children:ge?"No answer from this machine":z==="absent"?"Nothing opened":z===null?"Opening Soba App\u2026":"Approve it on this machine"}),ge?m("p",{className:"sc-p",children:"The Soba app did not answer. It may not be open, or nobody was there. Try again when you are ready."}):z==="absent"?m("p",{className:"sc-p",children:"Nothing opened on this machine. Open it yourself below, or install it if it is not here yet."}):m("p",{className:"sc-p",children:z===null?"Approve it there and this page does the rest.":"This page finishes on its own."}),me&&M("p",{className:"sc-prereq",children:[me.Mark&&m(me.Mark,{className:"sc-rt-mark"}),"Needs ",me.choice.prerequisite]}),M("div",{className:"sc-stack",style:{marginTop:18},children:[m("a",{className:z==="absent"||ge?"sc-btn sc-btn-primary":"sc-btn",href:Kt??"#",onClick:_t,children:ge?"Try again":z==="absent"?"Open Soba App":"Open it again"}),m("p",{className:"sc-note",children:z===null?"Your browser will ask permission first.":"Your browser asks permission the first time."}),me&&z==="absent"&&m("p",{className:"sc-note",children:m(ei,{text:me.choice.hint})}),M("div",{className:"sc-foot-strip",children:[m("span",{children:"Not installed on this machine?"}),M("button",{type:"button",className:"sc-foot-go",onClick:()=>h("get"),children:["Get it",m(Ws,{})]})]})]})]}),f==="get"&&M("div",{className:"sc-card",children:[M("div",{className:"sc-head",children:[m(Un,{onClick:()=>h("launch")}),m("p",{className:"sc-head-title",children:"Get Soba App"})]}),m("div",{className:"sc-opts",children:mt.map(A=>M("a",{className:"sc-opt",href:`${k}/download/${A.slug}`,target:"_blank",rel:"noreferrer noopener",children:[m("span",{className:"sc-opt-tile","aria-hidden":"true",children:m(fs,{className:"sc-opt-mark"})}),m("span",{className:"sc-opt-text",children:m("span",{className:"sc-opt-label",children:A.label})}),m(Ws,{className:"sc-opt-go"})]},A.slug))}),m("p",{className:"sc-opt-note",children:"Install it, then come back here and press the row you started with."})]}),f==="code"&&M("div",{className:"sc-card",children:[M("div",{className:"sc-head",children:[m(Un,{onClick:()=>h("choose")}),m("p",{className:"sc-head-title",children:"Soba App"})]}),m("h2",{className:"sc-h",id:pe,children:"Enter the code from that machine"}),m("p",{className:"sc-p",children:"Eight characters, shown by the Soba app once you paste the link."}),M("form",{className:"sc-stack",style:{marginTop:16},onSubmit:A=>{A.preventDefault(),St()},children:[m("input",{className:"sc-input",value:G,onChange:A=>Y(A.target.value),placeholder:"ACDE-F234",autoComplete:"off",autoFocus:!0,"aria-label":"Pairing code"}),O&&m("p",{className:"sc-error",children:O}),m("button",{type:"submit",className:"sc-btn sc-btn-primary",disabled:de||G.length<8,children:de?"Checking\u2026":"Continue"})]})]}),f==="confirm"&&L&&M("div",{className:"sc-card",children:[M("div",{className:"sc-head",children:[m(Un,{onClick:()=>h("code")}),m("p",{className:"sc-head-title",children:"Soba App"})]}),m("h2",{className:"sc-title",children:"Attach this machine to your account?"}),M("p",{className:"sc-sub",children:[m(Ft,{context:y})," may send your runs to it once you approve. It can never see the account or the keys on it."]}),M("ul",{className:"sc-facts",children:[m(ft,{k:"Code",v:L.user_code}),m(ft,{k:"Machine",v:L.hostname??"not stated"}),m(ft,{k:"System",v:[L.platform,L.arch].filter(Boolean).join(" / ")||"not stated"}),m(ft,{k:"Asked by",v:L.client??"not stated"}),L.labels.length>0&&m(ft,{k:"Labels",v:L.labels.join(", ")})]}),m("p",{className:"sc-note",style:{marginTop:12},children:"Every line above is what that machine said about itself. If none of it looks like a computer of yours, say no."}),fn==="expired"&&m("p",{className:"sc-error",children:"That code has expired. Ask the machine for a new one. It prints a fresh code each time it starts."}),fn==="answered"&&m("p",{className:"sc-error",children:"That code has already been answered. If it was not you, deny the next one."}),O&&m("p",{className:"sc-error",children:O}),M("div",{className:"sc-row",style:{marginTop:16},children:[m("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>void Kn(),disabled:de||fn!=="live",children:"Approve"}),m("button",{type:"button",className:"sc-btn",onClick:()=>void Rt(),disabled:de||fn==="answered",children:"No, deny it"})]}),fn==="live"&&L.expires_at&&M("p",{className:"sc-note",style:{marginTop:10},children:["This code expires in ",Xa(Date.parse(L.expires_at)-fe),"."]})]}),f==="waiting"&&M("div",{className:"sc-card",children:[M("div",{className:"sc-head",children:[m(Un,{onClick:()=>h("choose")}),m("p",{className:"sc-head-title",children:me?.choice.short??"Soba App"})]}),m(Qt,{mark:me?.Mark??ae}),m("h2",{className:"sc-h",id:pe,children:"Approved. Waiting for it to connect"}),m("p",{className:"sc-p",children:"Nothing more to do here. This page changes when it arrives."}),ve>0&&fe-ve>qa&&M("ol",{className:"sc-stall",children:[Ie==="app"?M(Fn,{children:[m(Vt,{done:!0,title:"Soba Connect opened",line:"On this machine"}),m(Vt,{done:!0,title:"You approved it",line:"In Soba Connect"})]}):m(Vt,{done:!0,title:"You approved the code",line:"On this page"}),m(Vt,{title:`Still nothing from ${L?.hostname??"that machine"}`,line:"Look at Soba Connect on that machine: it says what it is doing. This keeps watching either way.",children:m("button",{type:"button",className:"sc-btn sc-stall-act",onClick:()=>void kn(),children:"Open Soba Connect"})})]})]}),f==="connected"&&M("div",{className:"sc-card",children:[m(Hs,{tone:"ok"}),m("h2",{className:"sc-h",id:pe,children:hn?.label?`${hn.label} is connected`:"Connected"}),M("p",{className:"sc-p",children:[m(Ft,{context:y})," will use ",hn?.label?"it":"this machine"," from now on, while it is awake."]}),r&&M(Fn,{children:[hn&&m($a,{machine:hn}),m("button",{type:"button",className:"sc-btn sc-btn-primary sc-btn-wide",style:{marginTop:14},onClick:Pt,children:"Done"})]})]}),f==="hosted"&&M("div",{className:"sc-card",children:[M("div",{className:"sc-head",children:[m(Un,{onClick:()=>h("choose")}),m("p",{className:"sc-head-title",children:"ChatGPT"})]}),ne?m(Qt,{mark:xn,still:!0}):m(Qt,{mark:xn}),m("h2",{className:"sc-h",id:pe,children:ne?"Your browser blocked the window":"Finish signing in to ChatGPT"}),m("p",{className:"sc-p",children:ne?"Nothing opened. Open the sign-in yourself below. A link you click is allowed where a window we open is not.":"Approve it in the window that opened."}),M("div",{className:"sc-stack",style:{marginTop:18},children:[ne&&m("a",{className:"sc-btn sc-btn-primary",href:ne,target:"soba-connect-plan",rel:"noreferrer",children:"Open the ChatGPT sign-in"}),O&&m("p",{className:"sc-error",children:O}),Ne>0&&fe-Ne>Za&&m("p",{className:"sc-note sc-tone-warn",children:"Still nothing. The window may have been closed before it finished, or the sign-in may have been declined. This keeps watching either way."})]})]}),f==="hosted_connected"&&M("div",{className:"sc-card",children:[m(Hs,{tone:"ok"}),m("h2",{className:"sc-h",id:pe,children:"ChatGPT is connected"}),M("p",{className:"sc-p",children:[m(Ft,{context:y})," will run on your ChatGPT plan",$[0]?.account_label?` (${$[0].account_label})`:"",". Nothing more to pay, nothing to install."]}),m("p",{className:"sc-opt-note",style:{textAlign:"center"},children:"It runs on our side, so it has no access to your files or your terminal."}),r&&M(Fn,{children:[m("button",{type:"button",className:"sc-btn sc-btn-wide",style:{marginTop:16},onClick:Pt,children:"Done"}),m("div",{className:"sc-opt-alt",children:m("button",{type:"button",className:"sc-alt-link",onClick:()=>h("choose"),children:"Connect a machine too"})})]})]}),f==="denied"&&M("div",{className:"sc-card",children:[m(Hs,{tone:"off"}),m("h2",{className:"sc-h",id:pe,children:"Declined"}),m("p",{className:"sc-p",children:je==="machine"?"Nothing was connected. You can ask again whenever you like.":"That machine was not attached to your account, and the terminal has been told so."}),m("button",{type:"button",className:"sc-btn sc-btn-wide",style:{marginTop:16},onClick:()=>h("choose"),children:"Back to the start"})]})]})}function qr(e){return e?.app.name??"this app"}function Ka(e){let n=e?.app.icon_urls;if(n?.length)return n;let t=e?.app.icon_url;return t?[t]:[]}function Zr(e){let n=Ka(e),[t,s]=j([]),r=ie(c=>{c&&s(o=>o.includes(c)?o:[...o,c])},[]),a=ie(c=>r(c.currentTarget.getAttribute("src")),[r]),i=ie(c=>{c?.complete&&c.naturalWidth===0&&r(c.getAttribute("src"))},[r]);return{icon:n.find(c=>!t.includes(c)),onError:a,ref:i}}function _a({context:e}){let{icon:n,onError:t,ref:s}=Zr(e);return e?.app.mark==="soba"?m(ae,{className:"sc-app-mark"}):n?m("img",{className:"sc-app-mark",src:n,alt:"","aria-hidden":"true",ref:s,onError:t}):null}function Ft({context:e}){let{icon:n,onError:t,ref:s}=Zr(e),r=e?.app.mark==="soba";return M("span",{className:"sc-app",children:[r&&m(ae,{className:"sc-app-icon"}),!r&&n&&m("img",{className:"sc-app-icon",src:n,alt:"",ref:s,onError:t}),qr(e)]})}function Un({onClick:e}){return m("button",{type:"button",className:"sc-head-back",onClick:e,"aria-label":"Back",children:m("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:m("path",{d:"M15 5 8 12l7 7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Ws({className:e}){return m("svg",{className:e,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:m("path",{d:"M9 5l7 7-7 7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Qt({mark:e,still:n}){return M("span",{className:"sc-waiting","aria-hidden":"true",children:[!n&&m("svg",{className:"sc-waiting-orbit",viewBox:"0 0 100 100","aria-hidden":"true",focusable:"false",children:m("circle",{className:"sc-waiting-arc",cx:"50",cy:"50",r:"46"})}),m(e,{className:"sc-waiting-mark"})]})}function Hs({tone:e}){return m("span",{className:`sc-result sc-result-${e}`,"aria-hidden":"true",children:m(nn,{kind:e==="ok"?"snap":"gone",size:84})})}function $a({machine:e}){let{runtime:n}=Se(e);if(!n)return null;let t=Qe(n);return M("div",{className:"sc-arrived",children:[m(ks,{id:n.id,name:n.display_name}),m("span",{className:"sc-arrived-name",children:n.display_name}),M("span",{className:`sc-arrived-auth${t.tone==="warn"?" sc-tone-warn":""}`,children:[t.tone==="ok"&&m("i",{className:"sc-arrived-dot","aria-hidden":"true"}),t.tone==="ok"?"Signed in":t.tone==="warn"?"Signed out":"Could not tell"]})]})}function Vt({done:e,title:n,line:t,children:s}){return M("li",{className:"sc-stall-step",children:[M("svg",{viewBox:"0 0 20 20",className:e?"sc-stall-ok":"sc-stall-open","aria-hidden":"true",children:[m("circle",{cx:"10",cy:"10",r:"9"}),e?m("path",{d:"M6 10.3 8.7 13 14 7.5"}):M(Fn,{children:[m("path",{d:"M10 5.5v5.5"}),m("circle",{className:"sc-stall-pt",cx:"10",cy:"14.3",r:"1.2"})]})]}),m("span",{className:"sc-stall-title",children:n}),m("span",{className:"sc-stall-line",children:t}),s&&m("span",{className:"sc-stall-more",children:s})]})}function ei({text:e}){return m(Fn,{children:e.split("`").map((n,t)=>t%2===1?m("code",{className:"sc-inline-code",children:n},t):n)})}function ft({k:e,v:n}){return M("li",{className:"sc-fact",children:[m("span",{className:"sc-fact-key",children:e}),m("span",{children:n})]})}import{forwardRef as ni}from"react";import{jsx as Us,jsxs as Fs}from"react/jsx-runtime";var Qs=ni(function({machine:n,className:t,...s},r){if(!n)return null;let{ariaLabel:a,state:i}=Bn(n);return Fs("button",{ref:r,type:"button","aria-label":a,className:["sc-btn","sc-btn-connected",t].filter(Boolean).join(" "),...s,children:[Us("span",{className:"sc-pill-tile","aria-hidden":"true",children:Us(nn,{kind:i.tone==="busy"?"serving":i.tone==="ok"?"ready":n.pairing_lost?"gone":"paused",size:16,className:"sc-pill-mark"})}),Fs("span",{className:"sc-btn-connected-text",children:[i.word,!n.pairing_lost&&Fs("span",{className:"sc-btn-connected-where",children:[" on ",X(n)]})]}),Us("i",{className:`sc-dot sc-dot-${i.tone}`,"aria-hidden":"true"})]})});import{useEffect as ti,useRef as Js}from"react";var Jt=0,Vs=null;function Xr(){if(typeof document>"u")return()=>{};Jt===0&&(Vs=document.body.style.overflow,document.body.style.overflow="hidden"),Jt+=1;let e=!1;return()=>{e||(e=!0,Jt-=1,Jt===0&&(document.body.style.overflow=Vs??"",Vs=null))}}import{jsx as Kr}from"react/jsx-runtime";function gt({open:e,onClose:n,labelledBy:t,theme:s,style:r,children:a}){let i=Js(null),c=Js(null),o=Js(null);return ti(()=>{let l=i.current;if(l){if(!e){l.open&&l.close();return}return l.open||l.showModal(),document.activeElement===l&&c.current?.focus(),Xr()}},[e]),Kr("dialog",{ref:i,className:"soba-connect sc-modal","aria-labelledby":t,...s?{"data-theme":s}:{},style:r,onCancel:l=>{l.preventDefault(),n()},onPointerDown:l=>{o.current=l.target},onClick:l=>{l.target===l.currentTarget&&o.current===l.currentTarget&&n()},children:Kr("div",{className:"sc-modal-sheet",ref:c,tabIndex:-1,children:a})})}import{useEffect as Ys,useRef as si}from"react";import{jsx as ri}from"react/jsx-runtime";var Sn=8;function zs({open:e,onClose:n,anchor:t,label:s,theme:r,style:a,children:i}){let c=si(null);return Ys(()=>{let o=c.current;if(!(!o||!(typeof o.showPopover=="function")))try{e?o.showPopover():o.hidePopover()}catch{}},[e]),Ys(()=>{if(!e)return;let o=()=>{let u=c.current,d=t.current;if(!u||!d)return;let g=d.getBoundingClientRect(),f=u.offsetWidth,h=u.offsetHeight,y=window.innerWidth-f-Sn,S=Math.max(Sn,Math.min(g.right-f,Math.max(Sn,y))),I=g.bottom+Sn,E=g.top-Sn-h,G=I+h>window.innerHeight-Sn&&E>Sn?E:I;u.style.left=`${Math.round(S)}px`,u.style.top=`${Math.round(G)}px`};o();let l=requestAnimationFrame(o);return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{cancelAnimationFrame(l),window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[e,t]),Ys(()=>{if(!e)return;let o=u=>{u.key==="Escape"&&n()},l=u=>{let d=u.target;d&&(c.current?.contains(d)||t.current?.contains(d)||n())};return document.addEventListener("keydown",o),document.addEventListener("pointerdown",l,!0),()=>{document.removeEventListener("keydown",o),document.removeEventListener("pointerdown",l,!0)}},[e,n,t]),ri("div",{ref:c,role:"dialog","aria-label":s,className:"soba-connect sc-pop",...r?{"data-theme":r}:{},popover:"manual",hidden:!e,style:a,children:i})}var At=new Map,Qn=new Map,_r=!1;function oi(){_r||typeof window>"u"||(_r=!0,window.addEventListener("storage",e=>{!e.key||!At.has(e.key)||(Qn.set(e.key,Dt(e.key)),js(e.key))}))}function js(e){for(let n of At.get(e)??[])n()}function bt(e){return e??""}function qs(e,n){let t=bt(e);oi();let s=At.get(t)??new Set;return s.add(n),At.set(t,s),()=>{s.delete(n),s.size===0&&At.delete(t)}}function Yt(e){let n=bt(e),t=Qn.get(n);if(t!==void 0)return t;let s=e?Dt(e):null;return Qn.set(n,s),s}function Zs(){return null}function Xs(e,n){Yt(e)===null&&(Qn.set(bt(e),n),js(bt(e)))}function Ks(e,n){let t=bt(e);Qn.get(t)!==n&&(Qn.set(t,n),Is(e,n),js(t))}function Ke(e){let n=`${e.unit}s`;return e.reward==="unlimited"?`Unlimited ${n} on your own AI`:e.reward==="included"&&e.includedUnits!==null?`${ii(e.includedUnits)} ${n} a month once you connect`:e.reward==="credit"&&e.creditMicros>0?`${ai(e.creditMicros)} back each month you stay connected`:null}function _e(e){return e==="unlimited"||e==="included"}var eo=new Set(["user-hardware","user-subscription"]),$r=new Set(["open-weights","frontier"]);function Ge(e){return e===null||e.length===0?!1:e.every(n=>eo.has(n))}var ai=e=>(e/1e6).toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}),ii=e=>e.toLocaleString("en-US");function _s(e,n){if(!(n===null||n.some(a=>$r.has(a))))return!1;let s=e.findIndex(a=>eo.has(a));if(s===-1)return!1;let r=e.findIndex(a=>$r.has(a));return r===-1||s<r}import{createContext as no,useContext as to}from"react";var $s=no(null);function Vn(){return to($s)}var er=no({context:null,machines:void 0,theme:"light"});function H(){return to(er)}import{useMemo as ui}from"react";import{createContext as li,useContext as ci}from"react";var nr=li(null);function F(){let e=ci(nr);if(!e)throw new Error("useSoba() must be used inside a <SobaProvider>.");return e}function yt(){let{compute:e}=F();return ui(()=>{let n=e.machines,t=[...n].sort((a,i)=>Ve([a,i])===a?-1:1).map(di),s=Ve([...n]),r=wn(n);return{view:t.length?"machines":e.loading?"loading":e.error?"error":"empty",machines:t,primary:s?t.find(a=>a.machine.id===s.id)??null:null,connected:e.connected,online:e.online,stalled:e.connected&&!e.online&&r?t.find(a=>a.machine.id===r.id)??null:null,loading:e.loading,error:e.error,refresh:e.refresh}},[e])}function di(e){let n=Se(e);return{machine:e,name:X(e),state:Cn(e),status:rs(e),hardware:rt(e),lastSeen:e.state==="offline"?ot(e.last_seen_at):null,runtimes:ye(e).map(t=>({runtime:t,name:t.display_name,auth:Qe(t),quarantined:!!t.quarantined})),runsOn:{by:n.by,name:n.runtime?.display_name??null}}}import{useCallback as tr,useEffect as pi,useMemo as sr,useSyncExternalStore as mi}from"react";function Rn(e={}){let{compute:n,connect:t}=F(),{value:s,onChange:r,defaultValue:a,remember:i=!0,user:c}=e,o=s!==void 0,l=i&&!o?Es(t.publishableKey,c):null,u=tr(E=>qs(l,E),[l]),d=mi(u,tr(()=>Yt(l),[l]),Zs),g=sr(()=>ct(n.machines),[n.machines]),f=sr(()=>ut(g),[g]);pi(()=>{o||!a||Xs(l,a)},[o,a,l]);let h=o?s:d??a??null,{selected:y,unavailable:S}=sr(()=>ds(g,h??null),[g,h]),I=tr(E=>{o||Ks(l,E),r?.(E)},[o,l,r]);return{options:g,groups:f,selected:y,select:I,run:ps(y),unavailable:S,pickable:sn(g),loading:n.loading&&!n.machines.length}}import{jsx as wt}from"react/jsx-runtime";function hi({className:e}){let{theme:n}=H(),t=e?`soba-connect ${e}`:"soba-connect";return wt("div",{className:t,"data-theme":n,children:wt(rr,{})})}function rr(){let e=yt(),n=Rn();return e.view==="loading"?wt("p",{className:"sc-note",children:"Loading\u2026"}):e.view==="error"?wt("p",{className:"sc-error",children:e.error?.message}):wt(xs,{machines:e.machines.map(t=>t.machine),model:n.selected,onPickModel:n.select})}import{useCallback as vt,useEffect as lr,useMemo as vi,useRef as cr,useState as Yn}from"react";import{useId as fi}from"react";import{jsx as Jn,jsxs as zt}from"react/jsx-runtime";function Ct({open:e,onOpenChange:n,initialCode:t,onConnected:s,showStatus:r,reason:a}){let{error:i}=F(),c=Vn(),o=H(),l=()=>n(!1),u=fi(),d=o.context?.background?.trim(),g=d?yn(d,o.context?.accent):void 0;return zt(gt,{open:e,onClose:l,labelledBy:u,theme:o.theme,style:g,children:[i?zt("div",{className:"sc-card",children:[Jn("h2",{className:"sc-title",id:u,children:"Could not start"}),Jn("p",{className:"sc-error",children:i.message})]}):!c&&!o.context?zt("div",{className:"sc-card",children:[Jn("h2",{className:"sc-title",id:u,children:"One moment"}),Jn("p",{className:"sc-note",children:"Getting your compute\u2026"})]}):Jn(Ds,{client:c,active:e,onClose:l,headingId:u,theme:o.theme,initialContext:o.context,...o.machines!==void 0?{initialMachines:o.machines}:{},...t?{initialCode:t}:{},...s?{onConnected:s}:{},...r===void 0?{}:{showStatus:r},...a?{reason:a}:{}}),zt("p",{className:"sc-modal-foot",children:[Jn(ae,{className:"sc-foot-mark"}),"Secured by Soba"]})]})}import{forwardRef as gi}from"react";import{jsx as Ai}from"react/jsx-runtime";var or=gi(function(n,t){let{theme:s}=H();return Ai(Qs,{ref:t,"data-theme":s,...n})});import{useCallback as bi}from"react";function yi(){let{connect:e}=F(),n=yt(),t=bi(()=>e.open("manual"),[e]);return{...Bn(n.primary?.machine??null),machine:n.primary,open:t,canOpen:e.hasModal,loading:n.view==="loading"}}function ar(e){return Bn(e)}import{useCallback as so,useEffect as wi,useState as Ci}from"react";function ir({enabled:e=!0,intervalMs:n=3e3}={}){let t=Vn(),[s,r]=Ci(null),a=so(async()=>{t&&r(await t.runs())},[t]);wi(()=>{if(!e||!t)return;let c=!0,o=Ee(async()=>{let l=await t.runs();c&&r(l)},n);return()=>{c=!1,o()}},[e,t,n]);let i=so(async c=>{if(!t)throw new Error("Stopping a run needs <SobaProvider>.");await t.stopRun(c),await a().catch(()=>{})},[t,a]);return{runs:s,refresh:a,stop:i}}import{Fragment as ro,jsx as zn,jsxs as oo}from"react/jsx-runtime";function Pn({children:e,variant:n,className:t,initialCode:s,onConnected:r,defaultOpen:a,open:i,onOpenChange:c,showConnected:o=!0}){let{compute:l,connect:u}=F(),d=H(),{theme:g}=d,f=Vn(),[h,y]=Yn(a??!!s),S=cr(null),I=i!==void 0,E=!I&&!a&&!s&&u.hasModal,G=I?i:E?u.isOpen:h,Y=x=>{E?x?u.open("manual"):u.close():I||y(x),c?.(x)},L=cr(G);lr(()=>{L.current&&!G&&S.current?.focus(),L.current=G},[G]);let[T,O]=Yn(!1),{runs:w,stop:de}=ir({enabled:T}),K=Rn(),ve=vi(()=>T&&w?ki(l.machines,w):l.machines,[l.machines,T,w]),_=Ve(ve),Ie=o&&ar(_).connected,He=vt(()=>O(!1),[]),[fe,Oe]=Yn(!1),z=vt(async()=>{Oe(!0);try{await l.refresh()}finally{Oe(!1)}},[l]),ee=cr(z);ee.current=z,lr(()=>{T&&ee.current()},[T]);let[ze,q]=Yn(!1),[ge,ke]=Yn([]),je=!!d.context?.hosted_available;lr(()=>{if(!T||!f||!je)return;let x=!0;return f.hosted().then(C=>{x&&ke(C.credentials)}).catch(()=>{}),()=>{x=!1}},[T,f,je]);let[De,Z]=Yn(null),se=vt(async(x,C)=>{if(f){Z(null);try{await f.approveRuntime(x,C),await l.refresh()}catch(Le){Z(Le.message)}}},[f,l]),$=vt(async(x,C)=>{if(f){Z(null);try{await f.preferRuntime(x,C),await l.refresh()}catch(Le){Z(Le.message)}}},[f,l]),Ae=vt(async x=>{if(f){Z(null);try{await f.disconnectHosted(x),ke((await f.hosted()).credentials)}catch(C){Z(C.message)}}},[f]),Ne=d.context?.background?.trim(),Ue=Ne?yn(Ne,d.context?.accent):void 0,ne=Ie&&!e,Q=()=>{if(ne&&!I&&!a&&!s){O(x=>!x);return}Y(!0)};return oo(ro,{children:[ne?zn(or,{ref:S,machine:_,"aria-haspopup":"dialog","aria-expanded":T,onClick:Q,...t?{className:t}:{}}):zn("button",{ref:S,type:"button","data-theme":g,className:["sc-btn","sc-btn-icon",n==="primary"?"sc-btn-primary":"",t].filter(Boolean).join(" "),onClick:Q,children:e??oo(ro,{children:[zn(ae,{className:"sc-btn-mark"}),"Connect compute"]})}),zn(zs,{open:T,onClose:He,anchor:S,label:"Your compute",theme:g,...Ue?{style:Ue}:{},children:zn(Mn,{machines:ve,hosted:ge,onApproveRuntime:(x,C)=>void se(x,C),onPreferRuntime:(x,C)=>void $(x,C),onDisconnectHosted:x=>void Ae(x),onRefresh:()=>void z(),refreshing:fe,model:K.selected,onPickModel:K.select,error:De,runs:w,onStopRun:async x=>{Z(null);try{await de(x)}catch(C){throw Z(C.message),C}},onPair:()=>{O(!1),E?u.open("pair"):(q(!0),Y(!0))},...d.context?.app.name?{appName:d.context.app.name}:{}})}),!E&&zn(Ct,{open:G,onOpenChange:x=>{x||q(!1),Y(x)},...ze?{showStatus:!1}:{},...s?{initialCode:s}:{},...r?{onConnected:r}:{}})]})}function ki(e,n){return e.map(t=>{if(t.state==="offline")return t;let s=n.filter(r=>r.machine_id===t.id).length;return{...t,active:s,state:s>0?"busy":"online"}})}import{jsx as ur,jsxs as xi}from"react/jsx-runtime";function Ni({initialCode:e,onConnected:n,className:t,showStatus:s=!0}){let{theme:r}=H();return xi("div",{className:t?`soba-connect ${t}`:"soba-connect","data-theme":r,children:[s&&ur(rr,{}),ur("div",{className:"sc-compute-act",children:ur(Pn,{...e?{initialCode:e}:{},...n?{onConnected:n}:{}})})]})}import{useId as Wi,useState as Hi}from"react";import{useCallback as pr,useEffect as uo,useState as po}from"react";import{useCallback as Mi,useState as Si}from"react";function kt(){let[e,n]=Si(null);return{open:Mi(()=>{n(null),kn().then(n)},[]),launch:e,note:e==="absent"?"Nothing opened here. That machine may be a different computer, or asleep.":null}}import{useCallback as ao,useMemo as io}from"react";function En(e){if(!e)return null;if(typeof e=="string")return e;if(typeof Response<"u"&&e instanceof Response)return lo(e.status);let n=e,t=n.error;return typeof t?.code=="string"?t.code:typeof t?.type=="string"?t.type:typeof n.code=="string"?n.code:typeof n.status=="number"?lo(n.status):n.cause&&n.cause!==e?En(n.cause):null}function lo(e){return e===402?"payment_required":e===409?"no_compute":null}function dr(...e){let[n,t]=e,{plan:s,compute:r,connect:a}=F(),i=t?.predict??e.length===0,c=Pi(Ri(n),r)??(i?Ei(s,r):null),o=s.plan,l=s.plans,u=io(()=>{if(c!=="payment_required")return null;let h=o?.price??0,y=o?.included_units??0;return l.find(S=>S.id!==o?.id&&S.price>h&&(S.included_units===null||S.included_units>y))??null},[c,l,o]),d=ao(async()=>{if(!u)return;if(u.selectable){await s.select(u.id);return}let h=await s.checkout(u.id);window.location.assign(h)},[u,s]),g=a.open,f=ao(()=>{c&&g(c)},[g,c]);return io(()=>{if(!c)return null;let h=o?Ke({unit:o.unit,reward:o.connected_reward,includedUnits:o.connected_included_units,creditMicros:o.connected_credit*1e6}):null,y=o&&_e(o.connected_reward)?h:null;return{reason:c,...Ii(c,{connectOffer:y,connected:r.connected,online:r.online,machine:wn(r.machines)?.label??null,unit:o?.unit??"message",interval:o?.interval??"month",upgrade:u!==null,resets:s.current?.period_end??null}),connectOffer:y,upgradeTo:u,connect:f,upgrade:d}},[c,o,r,u,f,d,s.current?.period_end])}function Ri(e){let n=En(e);return n==="payment_required"||n==="no_compute"?n:null}function Pi(e,n){return e==="no_compute"&&n.connected&&n.online?null:e}function Ei(e,n){let t=e.plan;return!t||n.loading?null:Ge(t.route_allow)&&!n.online?"no_compute":e.remaining===0&&t.overage==="stop"?"payment_required":null}function Ii(e,n){if(e==="payment_required"){let t=`No ${n.unit}s left this ${n.interval}`;return n.connectOffer&&!n.connected?{title:t,body:`${n.connectOffer}. Connecting takes a minute and costs nothing.`}:n.connectOffer&&!n.online?{title:t,body:`${n.connectOffer}. Waking ${n.machine??"your machine"} is enough.`}:n.upgrade?{title:t,body:n.resets?`A larger plan carries on now. This one comes back on ${co(n.resets)}.`:"A larger plan carries on now, or wait for this one to renew."}:{title:t,body:n.resets?`Your allowance comes back on ${co(n.resets)}.`:"Your allowance comes back at the start of the next period."}}return n.connected&&!n.online?{title:`${n.machine??"Your machine"} can't be reached`,body:"This run needs it awake and connected. Open Soba App on that machine, or connect another one."}:{title:"Nothing connected yet",body:"This app runs on AI you already pay for, on a machine of your own. Connect one and this run has somewhere to go."}}function co(e){let n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function Oi(e){let{plan:n,allowance:t,connected:s,online:r,quiet:a,error:i,predict:c,at:o,waved:l}=e;if(!n)return null;let u=e.allow!==void 0?e.allow:n.route_allow;if(s){if(r)return null;let y=Ge(u);return{reason:"stalled",title:`${a??"Your machine"} can\u2019t be reached`,detail:y?"The Soba app there has stopped reporting in, so runs have nowhere to go until it is back.":"The Soba app there has stopped reporting in, so nothing will run on your own AI until it is back.",meter:null,dismissible:!1,atTheWall:!1,ownCompute:y}}let d=En(i),g=d==="payment_required"||d==="no_compute",f=n.ask_to_connect!==!1&&_s(n.route_prefer,u);if(!c&&!g&&!f)return null;let h=Ge(u)?Li(n.unit,Ge(n.route_allow)):_e(n.connected_reward)?Bi(t,n,o):f?Ti(n.unit):null;return!h||h.dismissible&&l?null:{...h,dismissible:!!h.dismissible,ownCompute:!1,atTheWall:!h.dismissible&&(!c||h.meter!==null&&h.meter.left===0)}}function mr(e={}){let{at:n=.25,error:t,allow:s}=e,r=e.predict??!(e.errorGiven??t!==void 0),{plan:a,compute:i,connect:c}=F(),o=Os(c.publishableKey),[l,u]=po(!1);uo(()=>{u(Ls(o))},[o]);let d=pr(()=>{u(!0),Ts(o)},[o]),g=pr(()=>c.open("manual"),[c]),f=pr(()=>c.open("no_compute"),[c]),h=kt(),[y,S]=po(!1),{refresh:I}=i,{launch:E}=h;uo(()=>{if(E===null||E==="absent")return;S(!1);let O=setInterval(()=>void I(),3e3),w=setTimeout(()=>{clearInterval(O),S(!0)},2e4);return()=>{clearInterval(O),clearTimeout(w)}},[E,I]);let G=Gi(c.app?.name,ht(c.connectUrl)),Y=a.loading||i.loading,L=wn(i.machines),T=Y?null:Oi({plan:a.plan,allowance:{remaining:a.remaining,included:a.included},connected:i.connected,online:i.online,quiet:L?X(L):null,error:t,predict:r,...s!==void 0?{allow:s}:{},at:n,waved:l});return{reason:T?.reason??null,visible:T!==null,title:T?.title??null,detail:T?.detail??null,meter:T?.meter??null,dismissible:T?.dismissible??!1,dismissed:l,dismiss:d,open:g,atTheWall:T?.atTheWall??!1,steps:G,stalled:T?.reason==="stalled"?{machine:L?X(L):null,ownCompute:T.ownCompute,wake:h.open,launch:h.launch,note:h.note,stuck:y,connectAnother:f}:null,loading:Y}}function Li(e,n){return{reason:"needed",title:n?"This plan runs on your own AI.":`These ${e}s run on your own AI.`,detail:`Connect a machine and your ${e}s run there, free, on access you already have.`,meter:null}}function Ti(e){return{reason:"preferred",title:"This plan prefers your own AI.",detail:`Connect a machine and your ${e}s run there instead, on access you already have.`,meter:null,dismissible:!0}}function Bi(e,n,t){let{remaining:s,included:r}=e;if(s===null||r===null||r===0||s>Math.ceil(r*t))return null;let a=Ke({unit:n.unit,reward:n.connected_reward,includedUnits:n.connected_included_units,creditMicros:n.connected_credit*1e6});return a?{reason:"running",title:s===0?`No ${n.unit}s left this month.`:`${s} ${n.unit}${s===1?"":"s"} left this month.`,detail:`${a}.`,meter:{left:s,of:r}}:null}function Gi(e,n){return[{lead:"Download Soba App",detail:"",...n?{linksLead:"Get it for"}:{},links:n?mt.map(t=>({label:t.label,href:`${n}/download/${t.slug}`})):[]},{lead:"Connect compute",detail:"Press this, then approve the pairing when the app asks.",opens:!0,links:[]},{lead:"Let your AIs serve",detail:`It finds what is installed on that machine. Allow one, and ${e??"this app"} sends every run there.`,linksLead:"Nothing on it yet?",links:we.map(t=>({label:t.short,href:t.install}))}]}import{Fragment as ho,jsx as W,jsxs as an}from"react/jsx-runtime";function Di(e){let{className:n,fallback:t=null}=e,s=mr({...e.at===void 0?{}:{at:e.at},...e.predict===void 0?{}:{predict:e.predict},...e.allow===void 0?{}:{allow:e.allow},error:e.error,errorGiven:"error"in e}),{connect:r}=F(),{theme:a}=H(),[i,c]=Hi(null),o=Wi(),l=W(ho,{children:t});if(!s.visible)return l;if(s.stalled)return W(mo,{className:n,theme:a,stalled:!0,children:W(Ui,{title:s.title??"",detail:s.detail??"",stalled:s.stalled})});let u=i??s.atTheWall;return an(mo,{className:n,theme:a,children:[an("div",{className:"sc-nudge-top",children:[an("div",{className:"sc-nudge-say",children:[W("p",{className:"sc-nudge-title",children:s.title}),W("p",{className:"sc-nudge-detail",children:s.detail}),an("button",{type:"button",className:"sc-btn sc-btn-quiet sc-nudge-more","aria-expanded":u,"aria-controls":o,onClick:()=>c(!u),children:[u?"Hide the details":"How it works",W(Qi,{})]})]}),s.dismissible?W("button",{type:"button",className:"sc-nudge-dismiss","aria-label":"Dismiss",title:"Dismiss",onClick:s.dismiss,children:W(Fi,{})}):null]}),u?W("ol",{className:"sc-nudge-steps",id:o,children:s.steps.map(d=>an("li",{children:[d.opens?W("button",{type:"button",className:"sc-step-lead",onClick:()=>r.open("manual"),children:d.lead}):W("strong",{children:d.lead}),d.detail?W("span",{children:d.detail}):null,d.links.length>0?an("span",{className:"sc-step-links",children:[d.linksLead,d.links.map(g=>W("a",{href:g.href,target:"_blank",rel:"noreferrer noopener",children:g.label},g.href))]}):null]},d.lead))}):null,W(Pn,{variant:"primary"})]})}function mo({className:e,theme:n,stalled:t,children:s}){return W("div",{className:e?`soba-connect sc-fill ${e}`:"soba-connect sc-fill","data-theme":n,children:W("div",{className:t?"sc-nudge sc-nudge-stalled":"sc-nudge",children:s})})}function Ui({title:e,detail:n,stalled:t}){return an(ho,{children:[W("div",{className:"sc-nudge-top",children:an("div",{className:"sc-nudge-say",children:[W("p",{className:"sc-nudge-title",children:e}),W("p",{className:"sc-nudge-detail",children:n}),t.note&&W("p",{className:"sc-nudge-note",children:t.note}),t.stuck&&W("p",{className:"sc-nudge-note",children:"The Soba app is open, but this machine still isn\u2019t reporting in. It may no longer be connected to this app."}),(t.launch==="absent"||t.stuck)&&W("button",{type:"button",className:"sc-btn sc-btn-quiet sc-nudge-more",onClick:t.connectAnother,children:t.stuck?"Connect it again":"Connect another machine"})]})}),W("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:t.wake,children:"Open Soba App"})]})}function Fi(){return W("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",className:"sc-nudge-x",children:W("path",{d:"m4.8 4.8 6.4 6.4M11.2 4.8l-6.4 6.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function Qi(){return W("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",className:"sc-nudge-chev",children:W("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}var Vi=new Set(["delta","thinking","status","done","error"]);function jn(e){let n;try{n=JSON.parse(e)}catch{return null}if(!n||typeof n!="object")return null;let t=n,s=t.type==="event"?t.event:t;if(!s||typeof s!="object")return null;let r=s;if(typeof r.type!="string"||!Vi.has(r.type))return null;let a={type:r.type};return typeof r.text=="string"&&(a.text=r.text),typeof r.message=="string"&&(a.message=r.message),typeof r.tool=="string"&&(a.tool=r.tool),typeof r.tier=="string"&&(a.tier=r.tier),r.usage&&typeof r.usage=="object"&&(a.usage=r.usage),typeof r.session=="string"&&(a.session=r.session),typeof r.toolInput=="string"&&(a.toolInput=r.toolInput),r.git&&typeof r.git=="object"&&(a.git=r.git),r.turn&&typeof r.turn=="object"&&typeof r.turn.text=="string"&&(a.turn={text:r.turn.text}),typeof r.reason=="string"&&(a.reason=r.reason),typeof r.retryable=="boolean"&&(a.retryable=r.retryable),(r.state==="interrupted"||r.state==="resumed")&&(a.state=r.state),a}async function*hr(e){let n=e.body;if(!n)throw new Error("That run response had no body to stream.");let t=(e.headers.get("content-type")??"").includes("ndjson"),s=n.getReader(),r=new TextDecoder,a="",i=[];try{for(;;){let o=await s.read();if(o.done)break;for(a+=r.decode(o.value,{stream:!0});;){let l=a.indexOf(`
3
- `);if(l===-1)break;let u=go(a.slice(0,l));if(a=a.slice(l+1),t){let d=u.trim()?jn(u):null;d&&(yield d);continue}if(u===""){let d=i.join(`
4
- `);if(i=[],d==="[DONE]")return;let g=d?jn(d):null;g&&(yield g);continue}fo(u,i)}}!t&&a&&fo(go(a),i);let c=t?a.trim():i.join(`
5
- `);if(c&&c!=="[DONE]"){let o=jn(c);o&&(yield o)}}finally{s.cancel().catch(()=>{})}}function fo(e,n){if(!e||e.startsWith(":"))return;let t=e.indexOf(":");if(t===-1||e.slice(0,t)!=="data")return;let s=e.slice(t+1);n.push(s.startsWith(" ")?s.slice(1):s)}function go(e){return e.endsWith("\r")?e.slice(0,-1):e}async function Ji(e){let n="";for await(let t of e)if(t.type==="delta"&&t.text&&(n+=t.text),t.type==="error")throw new Error(t.message??"The run ended with an error.");return n}import{jsx as Ao}from"react/jsx-runtime";function Yi({caption:e,disabled:n,className:t,...s}){let{theme:r}=H(),{options:a,selected:i,select:c,pickable:o}=Rn(s);return o?Ao("span",{className:"soba-connect sc-inline","data-theme":r,children:Ao(dt,{options:a,selected:i,onPick:c,...e?{caption:e}:{},...n?{disabled:n}:{},...t?{className:t}:{}})}):null}import{useEffect as zi}from"react";var bo="data-soba-react",yo=!1;function Nt(){if(yo||typeof document>"u"||(yo=!0,document.querySelector(`style[${bo}]`)))return;let e=document.createElement("style");e.setAttribute(bo,""),e.textContent=`.soba-connect {
2
+ var yr={ready:{arc:!0},serving:{arc:!0,slot:"stream"},paused:{arc:!1,slot:"zzz"},thinking:{arc:!1,slot:"dots"},connecting:{arc:!1,slot:"orbit"},attention:{arc:!1,slot:"bang"},gone:{arc:!1,slot:"cross"},snap:{arc:!1,slot:"snap"},listening:{arc:!1,slot:"bars"},permission:{arc:!1,slot:"ring"},ai:{arc:!1,slot:"sparks"}};var wr="105 162 420 420",vr="M407.1 308.9 A158 158 0 1 0 407.1 491.1 A116 116 0 0 1 407.1 308.9 Z",Pn="M448.5 320 A110 110 0 0 1 448.5 480";import{Fragment as mt,jsx as F,jsxs as fn}from"react/jsx-runtime";function mn({kind:e,size:n=44,className:t}){let r=yr[e];return fn("svg",{className:`bx${t?` ${t}`:""}`,"data-expression":e,viewBox:wr,overflow:"visible",width:n,height:n,"aria-hidden":"true",children:[F("path",{d:vr,fill:"currentColor"}),F("path",{className:"bx-arc",d:Pn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"}),r.slot==="stream"&&F(wa,{}),r.slot==="zzz"&&F(va,{}),r.slot==="dots"&&F(ka,{}),r.slot==="bang"&&F(Ca,{}),r.slot==="orbit"&&F(Ma,{}),r.slot==="cross"&&F(Na,{}),r.slot==="snap"&&F(xa,{}),r.slot==="bars"&&F(Sa,{}),r.slot==="ring"&&F(Pa,{}),r.slot==="sparks"&&F(Ra,{})]})}function wa(){return F("path",{className:"bx-st",d:"M475.3 290.3 A150 150 0 0 1 475.3 509.7",fill:"none",stroke:"currentColor",strokeWidth:"15",strokeLinecap:"round",strokeDasharray:"0.1 31"})}function va(){return fn(mt,{children:[F("g",{className:"bx-z1",children:F("path",{d:"M444 372 H496 L444 436 H496",fill:"none",stroke:"currentColor",strokeWidth:"20",strokeLinecap:"round",strokeLinejoin:"round"})}),F("g",{className:"bx-z2",children:F("path",{d:"M492 300 H522 L492 338 H522",fill:"none",stroke:"currentColor",strokeWidth:"15",strokeLinecap:"round",strokeLinejoin:"round"})})]})}function ka(){return fn(mt,{children:[F("circle",{className:"bx-th",cx:"463.1",cy:"336.9",r:"21",fill:"currentColor"}),F("circle",{className:"bx-th bx-th2",cx:"483",cy:"400",r:"21",fill:"currentColor"}),F("circle",{className:"bx-th bx-th3",cx:"463.1",cy:"463.1",r:"21",fill:"currentColor"})]})}function Ca(){return fn("g",{className:"bx-at",children:[F("line",{x1:"490",y1:"312",x2:"490",y2:"414",stroke:"currentColor",strokeWidth:"46",strokeLinecap:"round"}),F("circle",{cx:"490",cy:"484",r:"28",fill:"currentColor"})]})}function Ma(){return fn("g",{className:"bx-ob",children:[F("path",{d:Pn,fill:"none",stroke:"var(--tile-bg, transparent)",strokeWidth:41,strokeLinecap:"round"}),F("path",{d:Pn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"})]})}function Na(){return fn(mt,{children:[F("path",{className:"bx-xa",d:Pn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"}),F("g",{className:"bx-xx",children:F("path",{d:"M442 364 L514 436 M514 364 L442 436",fill:"none",stroke:"currentColor",strokeWidth:"24",strokeLinecap:"round"})})]})}function xa(){return F("path",{className:"bx-snap",d:Pn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"})}function Sa(){return fn("g",{stroke:"currentColor",strokeWidth:"17",strokeLinecap:"round",children:[F("line",{className:"bx-vb",x1:"452",y1:"370",x2:"452",y2:"430"}),F("line",{className:"bx-vb bx-vb2",x1:"482",y1:"330",x2:"482",y2:"470"}),F("line",{className:"bx-vb bx-vb3",x1:"512",y1:"355",x2:"512",y2:"445"})]})}function Pa(){return F(mt,{children:[[450,366],[474,376],[484,400],[474,424],[450,434],[426,424],[416,400],[426,376]].map(([n,t],r)=>F("circle",{className:"bx-w",cx:n,cy:t,r:"11",fill:"currentColor",style:{animationDelay:`${-1.2+r*.15}s`}},r))})}function Ra(){return fn(mt,{children:[F("g",{className:"bx-sp",children:F("path",{d:"M460 300 Q465.4 324.6 490 330 Q465.4 335.4 460 360 Q454.6 335.4 430 330 Q454.6 324.6 460 300 Z",fill:"currentColor"})}),F("g",{className:"bx-sp bx-sp2",children:F("path",{d:"M486 356 Q493.92 392.08 530 400 Q493.92 407.92 486 444 Q478.08 407.92 442 400 Q478.08 392.08 486 356 Z",fill:"currentColor"})}),F("g",{className:"bx-sp bx-sp3",children:F("path",{d:"M460 440 Q465.4 464.6 490 470 Q465.4 475.4 460 500 Q454.6 475.4 430 470 Q454.6 464.6 460 440 Z",fill:"currentColor"})})]})}var os={"claude-code":{small:"haiku",large:"opus"}};function ss(e){return e==="small"||e==="large"}function as(e,n){return os[e]?.[n]}function Zt(e){let n=os[e];return!!(n?.small||n?.large)}var jc=512*1024;import{useEffect as ys,useRef as ai,useState as _n}from"react";var qn=class extends Error{status;constructor(n,t){super(n),this.name="ConnectError",this.status=t}},Ea=5*6e4,ft=class{session;baseUrl;doFetch;lastMachines=null;lastModelOptions=null;machinesUrl=null;gatewayBackUntil=0;constructor(n){this.session=n.session,this.baseUrl=(n.baseUrl??"").replace(/\/+$/,""),this.doFetch=n.fetchImpl??fetch.bind(globalThis)}async context(){let n=await this.request("GET","/v1/connect");return this.setMachinesUrl(n.machines_url),n}setMachinesUrl(n){typeof n=="string"&&/^https?:\/\//.test(n)&&(this.machinesUrl=n)}async machines(){let n=this.lastMachines,t=n?`?v=${encodeURIComponent(n.version)}`:"",r;if(this.machinesUrl&&Date.now()>=this.gatewayBackUntil)try{r=await this.request("GET",`${this.machinesUrl}${t}`)}catch(a){if(a instanceof qn&&a.status===401)throw a;this.gatewayBackUntil=Date.now()+Ea}if(r??=await this.request("GET",`/v1/machines${t}`),r.unchanged&&n)return n.machines;let o=Array.isArray(r.machines)?r.machines:[];return this.lastMachines=typeof r.version=="string"?{version:r.version,machines:o}:null,o}async modelOptions(){let n=this.machinesUrl?.replace(/\/v1\/machines$/,"");if(!n)return null;let t=this.lastModelOptions,r=t?`?v=${encodeURIComponent(t.version)}`:"",o=await this.request("GET",`${n}/v1/model-options${r}`);if(o.unchanged&&t)return t.options;let a={route:o.route??{allow:[],prefer:[]},providers:Array.isArray(o.providers)?o.providers:[],names:Array.isArray(o.names)?o.names:[],layout:o.layout??"providers"};return this.lastModelOptions=typeof o.version=="string"?{version:o.version,options:a}:null,a}async runs(){let n=await this.request("GET","/v1/machines/runs");return Array.isArray(n.runs)?n.runs:[]}async stopRun(n){let t=this.machinesUrl?.replace(/\/v1\/machines$/,"");if(!t)throw new qn("This page can't stop runs yet: it hasn't been told where Soba's gateway is.",501);await this.request("POST",`${t}/v1/runs/${encodeURIComponent(n)}/stop`,{})}lookup(n){return this.request("GET",`/v1/device/lookup?code=${encodeURIComponent(n)}`)}approve(n){return this.request("POST","/v1/device/approve",{user_code:n})}claim(n){return this.request("POST","/v1/device/claim",{pairing_nonce:n})}deny(n){return this.request("POST","/v1/device/deny",{user_code:n})}plans(){return this.request("GET","/v1/plans")}selectPlan(n){return this.request("POST","/v1/plans/select",{plan:n})}checkoutPlan(n,t){return this.request("POST","/v1/plans/checkout",{plan:n,...t?.successUrl?{success_url:t.successUrl}:{},...t?.cancelUrl?{cancel_url:t.cancelUrl}:{}})}leavePlan(){return this.request("DELETE","/v1/plans/select")}hosted(){return this.request("GET","/v1/hosted")}startHosted(){return this.request("POST","/v1/hosted/start")}disconnectHosted(n){return this.request("DELETE",n?`/v1/hosted?provider=${encodeURIComponent(n)}`:"/v1/hosted")}approveRuntime(n,t){return this.request("POST","/v1/runtimes/approve",{machine_id:n,runtime_id:t})}preferRuntime(n,t){return this.request("POST","/v1/runtimes/prefer",{machine_id:n,runtime_id:t})}async request(n,t,r){let o=await this.doFetch(/^https?:\/\//.test(t)?t:`${this.baseUrl}${t}`,{method:n,headers:{authorization:`Bearer ${this.session}`,...r?{"content-type":"application/json"}:{}},...r?{body:JSON.stringify(r)}:{}}),a={};try{a=await o.json()}catch{}if(!o.ok){let s=typeof a.error=="string"?a.error:`Request failed (${o.status})`;throw new qn(s,o.status)}return a}};function ht(e){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!n?.[1])return"#ffffff";let t=n[1].length===3?[...n[1]].map(a=>a+a).join(""):n[1],r=a=>{let s=Number.parseInt(t.slice(a*2,a*2+2),16)/255;return s<=.04045?s/12.92:((s+.055)/1.055)**2.4};return .2126*r(0)+.7152*r(1)+.0722*r(2)>.45?"#101012":"#ffffff"}function kr(e){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!n?.[1])return null;let t=n[1].length===3?[...n[1]].map(r=>r+r).join(""):n[1];return[0,1,2].map(r=>Number.parseInt(t.slice(r*2,r*2+2),16))}function jn(e,n,t){let r=kr(e),o=kr(n);return!r||!o?e:`#${r.map((s,c)=>Math.round(s+(o[c]-s)*t)).map(s=>s.toString(16).padStart(2,"0")).join("")}`}function Rn(e,n){if(!kr(e))return{};let t=ht(e),r=n?.trim();return{"--sc-ground":e,"--sc-shell":e,"--sc-sheet":jn(e,t,.07),"--sc-raised":jn(e,t,.13),"--sc-line":jn(e,t,.18),"--sc-line-2":jn(e,t,.28),"--sc-text":t,"--sc-text-2":jn(t,e,.15),"--sc-muted":jn(t,e,.38),...r?{"--sc-accent":r,"--sc-accent-fg":ht(r)}:{"--sc-accent":t,"--sc-accent-fg":e}}}function Ke(e){return e.authenticated===!0?{tone:"ok",text:"signed in"}:e.authenticated===!1?{tone:"warn",text:e.auth_hint??"signed out on that machine"}:{tone:"unknown",text:"could not tell"}}function gt(e){let{platform:n,arch:t}=e;if(!n)return null;let r=n==="darwin"||n==="macos",o=r?"Mac":n==="win32"||n==="windows"?"Windows PC":"Linux machine";return r?`${t==="aarch64"||t==="arm64"?"Apple silicon ":""}${o}`:o}function En(e){return e.find(n=>n.state==="offline")??null}function Cr(e){return e.state==="busy"?{tone:"busy",text:`serving ${e.active} of ${e.capacity}`}:e.state==="online"?{tone:"ok",text:"connected"}:{tone:"off",text:"asleep or offline"}}function le(e){let n=e.label?.trim(),t=e.name?.trim();return n&&(!t||n!==t)?n:(t??n??"").replace(/\.(local|lan|home|internal)$/i,"").replace(/[-_]+/g," ").trim()||n||"This machine"}function Zn(e,n){let t=o=>o.state==="busy"?0:o.state==="online"?1:2,r=o=>o.last_seen_at?Date.parse(o.last_seen_at):0;return t(e)-t(n)||r(n)-r(e)}function _e(e){return[...e].sort(Zn)[0]??null}function In(e){return e?e.state==="busy"?{tone:"busy",word:"Serving"}:e.state==="online"?{tone:"ok",word:"Connected"}:e.pairing_lost?{tone:"off",word:"Not connected"}:{tone:"off",word:"Asleep"}:{tone:"off",word:"No compute"}}function Xn(e){let n=In(e);return{label:e?n.word:"Connect compute",ariaLabel:e?e.pairing_lost?`${le(e)} is not connected`:`${n.word} on ${le(e)}`:"Connect compute",connected:e!==null,state:n}}function on(e){return e.state==="online"||e.state==="busy"}function bt(e){if(!e)return"never seen";let n=Date.parse(e);if(Number.isNaN(n))return"never seen";let t=Date.now()-n,r=6e4;return t<2*r?"just now":t<60*r?`${Math.floor(t/r)} min ago`:t<24*60*r?`${Math.floor(t/(60*r))} hr ago`:`${Math.floor(t/(24*60*r))} days ago`}function Mr(e){return e.runtimes.filter(n=>n.id!=="shell")}function we(e){return e.runtimes.filter(n=>n.id!=="shell"&&!n.quarantined&&!n.absent)}function Fe(e){let n=s=>s?e.runtimes.find(c=>c.id===s)??null:null;if(e.requested_runtime)return{by:"app",runtimeId:e.requested_runtime,runtime:n(e.requested_runtime)};let t=we(e),r=t.find(s=>s.id===e.preferred_runtime);if(r)return{by:"you",runtimeId:r.id,runtime:r};let o=s=>s.id==="claude-code"?0:s.id==="codex"?1:2,a=[...t].sort((s,c)=>o(s)-o(c))[0]??null;return{by:"default",runtimeId:a?.id??null,runtime:a}}var Nr="soba";function Ln(){return`${Nr}://show`}function At(e,n,t){let r=`${Nr}://connect?url=${encodeURIComponent(e)}`;return n&&(r+=`&nonce=${encodeURIComponent(n)}`),t&&(r+=`&want=${encodeURIComponent(t)}`),r}function yt(){let e=globalThis.crypto;if(!e?.getRandomValues)return null;let n=e.getRandomValues(new Uint8Array(32)),t="";for(let r of n)t+=String.fromCharCode(r);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Ia=1600;function xr(e={}){return Pr(e)}async function Sr(e,n={}){if(typeof window>"u"||typeof document>"u")return"unknown";let t=Pr(n);try{window.location.href=At(e,n.nonce,n.want)}catch{return"absent"}return t}async function On(e={}){if(typeof window>"u"||typeof document>"u")return"unknown";let n=Pr(e);try{window.location.href=Ln()}catch{return"absent"}return n}async function Pr(e){if(typeof window>"u"||typeof document>"u")return"unknown";let n=e.graceMs??Ia,t=document.visibilityState==="visible"&&document.hasFocus(),r=!1,o=()=>{r=!0},a=()=>{document.visibilityState==="hidden"&&(r=!0)};return window.addEventListener("blur",o),window.addEventListener("pagehide",o),document.addEventListener("visibilitychange",a),await new Promise(s=>setTimeout(s,n)),window.removeEventListener("blur",o),window.removeEventListener("pagehide",o),document.removeEventListener("visibilitychange",a),t?r?"opened":"absent":"unknown"}var $e={"claude-code":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAARGVYSWZNTQAqAAAACAABh2kABAAAAAEAAAAaAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAABAoAMABAAAAAEAAABAAAAAAEZRQrAAAAHLaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4yNTY8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MjU2PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CuYattQAABdYSURBVHgB7VpplF1Vld73vqmqXs1VqaQqEwFCiAjYytiCpqFBBVwiTSCsBmVpQ69mob3Qpl3dy9Wy+oc03T/8IYqNA4LaC8OgMgQJCDIKSBjDFAkhqaQ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7v/h8qtgDnL6/wjvBQNWPSchPg1GXgvCWeIr+GjXj44OIn2Oo2e4z7u9oJo1qTXeWuHGJXQ91vI+YW5NAQrbWT9czryZ/OB3LdmMDFUGiPQm85+OMP6Ul+i323zeItTiodoFLQBcWTXwGzxn0BijiYgzGcTQWguIgdoz8sWQSMR3A0hMCPb5owh4whw+YR7MJ6ktMo+EciiobYAFJqDE4zPhtDRKVwF5DSuQcnOKR2AP8Cui93e4Bz9uMXV0/FBGGZ/BaqmGMFGWMFNw7QyOZML4XaHNc3OnIDZkE7cOUzf5QfCGN8C6GkgqwSeXP8HIxHP4MmOI/a321n07gV9IjNBy7QnyZrED37ivv4/PQyO8w10e8KcphEWKSNuIPY8QfKrR4Ye+yCnB3kPeGZiJkLwBzq+EZK2GxGe7nRW12PSGeADM/EmtjG4qej4OQ90YuRN/rYcWzMU8ZPuWbyCHPgbYT3vQ4Pp0/OM7QYx6VGXgMbdGN/AVNIT3cAadkl50K7+QtmgFGBskwuuGBL+EfnaxNQFH3ihDqM12j6lTyyVn4H4E6hAx4NkYwy1G0DlAmsUN8ESX6/+H/GpiUBv4FSyLhydRRp0cAAAAASUVORK5CYII="};import{useEffect as is,useRef as La}from"react";import{Fragment as Ta,jsx as Ge,jsxs as Rr}from"react/jsx-runtime";function Er({anchor:e,label:n,options:t,current:r,onClose:o,onPick:a}){let s=La(null);return is(()=>{let i=s.current,l=e.current;if(!i||!l)return;try{typeof i.showPopover=="function"&&i.showPopover()}catch{}let d=l.getBoundingClientRect();d.width>i.offsetWidth&&(i.style.width=`${Math.round(d.width)}px`);let g=i.offsetWidth,b=i.offsetHeight,y=d.width>248?d.left:d.right-g,f=Math.max(8,Math.min(y,window.innerWidth-g-8)),v=d.bottom+6,A=v+b>window.innerHeight-8&&d.top-6-b>8?d.top-6-b:v;i.style.left=`${Math.round(f)}px`,i.style.top=`${Math.round(A)}px`,i.querySelector('[aria-checked="true"]')?.focus()},[e]),is(()=>{let i=l=>{let d=l.target;!d||s.current?.contains(d)||e.current?.contains(d)||o()};return document.addEventListener("pointerdown",i,!0),()=>document.removeEventListener("pointerdown",i,!0)},[e,o]),Ge("div",{ref:s,role:"menu","aria-label":n,className:"sc-menu",popover:"manual",onKeyDown:i=>{let l=[...s.current?.querySelectorAll("[role=menuitemradio]")??[]],d=l.indexOf(document.activeElement);if(i.key==="Escape")i.stopPropagation(),i.nativeEvent.stopImmediatePropagation(),o(),e.current?.focus();else if(i.key==="ArrowDown"||i.key==="ArrowUp"){i.preventDefault();let g=i.key==="ArrowDown"?1:-1;l[(d+g+l.length)%l.length]?.focus()}else i.key==="Tab"&&o()},children:t.map(i=>Ge(Oa,{option:i,checked:r===i.id,onClose:o,onPick:a},i.id??""))})}function Oa({option:e,checked:n,onClose:t,onPick:r}){return Rr(Ta,{children:[e.heading?Ge("div",{className:"sc-menu-head",role:"presentation",children:e.heading}):e.rule?Ge("div",{className:"sc-menu-sep"}):null,Rr("button",{type:"button",role:"menuitemradio","aria-checked":n,className:"sc-menu-item",onClick:()=>{e.onChoose?(e.onChoose(),t()):n?t():r(e.id)},children:[e.glyph,Rr("span",{className:"sc-menu-text",children:[Ge("span",{className:"sc-menu-label",children:e.label}),e.note&&Ge("span",{className:"sc-menu-note",children:e.note})]}),e.trailing?Ge("span",{className:"sc-menu-act",children:e.trailing}):n&&Ge(Ir,{})]})]})}function Ir(){return Ge("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-menu-check",children:Ge("path",{d:"M5 12.5l4.5 4.5L19 7.5",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function hn({open:e}){return Ge("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e?"sc-chev sc-chev-open":"sc-chev",children:Ge("path",{d:"M9 6l6 6-6 6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{useEffect as Xt,useId as Wa,useLayoutEffect as Da,useMemo as Kt,useRef as kt,useState as Ct}from"react";var ls={haiku:"Haiku",sonnet:"Sonnet",opus:"Opus",fable:"Fable"};function en(e){return ls[e]??e}function wt(e,n=[],t=[],r){let o=A=>!r||r.includes(A.cost_class),a=[...e].sort(Zn),s=_e([...e]),c=s?Fe(s):null,l=[{id:"auto",kind:"auto",label:"Automatic",model:"auto",...c?.runtime?{note:c.runtime.default_model?`Uses ${en(c.runtime.default_model)}`:`Uses ${c.runtime.display_name}`}:{}}];a.some(A=>we(A).some(k=>o(k)&&Zt(k.id)))&&l.push({id:"small",kind:"size",label:"Fast",note:"quick and cheap",model:"small"},{id:"large",kind:"size",label:"Best",note:"the most capable",model:"large"});let g=new Map,y=new Set(a.flatMap(A=>we(A).filter(o).map(k=>k.id))).size>1||n.some(A=>A.models.length>0);for(let A of a)for(let k of we(A))if(o(k)){!k.models.some(Boolean)&&y&&!g.has(`${k.id}/auto`)?g.set(`${k.id}/auto`,{option:{id:`${k.id}/auto`,kind:"named",label:k.display_name,note:k.default_model?`Uses ${en(k.default_model)}`:"its default model",model:"auto",runtime:k.id,runtimeName:k.display_name,costClass:k.cost_class},machines:new Set([le(A)])}):g.has(`${k.id}/auto`)&&g.get(`${k.id}/auto`)?.machines.add(le(A));for(let S of k.models){if(!S)continue;let W=`${k.id}/${S}`,L=g.get(W);if(L){L.machines.add(le(A));continue}g.set(W,{option:{id:W,kind:"named",label:en(S),model:S,runtime:k.id,runtimeName:k.display_name,costClass:k.cost_class},machines:new Set([le(A)])})}}let f=new Set;for(let{machines:A}of g.values())for(let k of A)f.add(k);let v=f.size>1;for(let{option:A,machines:k}of g.values()){let S=v&&k.size===1?[...k][0]:void 0;l.push(S?{...A,machine:S}:A)}for(let A of n)for(let{model:k}of A.models)k&&l.push({id:`@${A.id}/${k}`,kind:"provider",label:k,model:k,costClass:A.cost_class,providerId:A.id,providerName:A.name,...A.provider?{providerMark:A.provider}:{},...A.locked?{locked:A.locked}:{}});for(let A of t)!A.alias||!A.cost_classes.length||l.push({id:`alias:${A.alias}`,kind:"provider",label:A.label,...A.note?{note:A.note}:{},...A.icon?{icon:A.icon}:{},model:A.alias,costClass:A.cost_classes[0],costClasses:A.cost_classes,...A.provider?{providerMark:A.provider}:{},...A.locked?{locked:A.locked}:{},choice:A.alias});return l}function cs(e,n){let t=[];for(let r of n){let o=r.provider?.toLowerCase(),a=e.filter(l=>l.model!==r.model?!1:r.runtime?l.kind==="named"&&l.runtime===r.runtime:l.kind!=="provider"?!1:!o||l.providerMark===o||l.providerId?.toLowerCase()===o||l.providerName?.toLowerCase()===o),s=a.find(l=>!l.locked)??a[0];if(!s)continue;let{machine:c,...i}=s;t.push({...i,id:`choice:${r.id}`,label:r.label,...r.note?{note:r.note}:{},choice:r.id})}return t}function Lr(e,n,t=[]){if(n==="automatic")return e.filter(c=>c.kind==="auto"||c.kind==="size");if(n!=="choices")return[...e];let r=e.filter(c=>c.choice),o=cs(e.filter(c=>!c.choice),t),a=e.filter(c=>c.kind!=="provider");return[...a.filter(c=>c.kind==="auto"||c.kind==="size"),...r,...o,...a.filter(c=>c.kind==="named")]}function Or(e,n){return e.filter(t=>t.kind!=="size"||(t.model==="small"?n?.fast!==!1:n?.best!==!1))}function Tr(e,n,t){return t?.auto!==!1||n==="automatic"?[...e]:e.filter(r=>r.kind!=="auto")}function vt(e,n="providers",t=!1){let r=[],o=[],a=new Map;for(let s of e){if(s.kind!=="named"&&s.kind!=="provider"||s.choice){r.push(s);continue}if(n==="models"&&(s.kind==="provider"||t)){let l=a.get("@models");if(l)l.options.push(s);else{let d={heading:"Models",options:[s]};a.set("@models",d),o.push(d)}continue}let c=s.runtime??`@${s.providerId}`,i=a.get(c);if(i)i.options.push(s);else{let l={heading:s.runtimeName??s.providerName??s.runtime??"",options:[s]};a.set(c,l),o.push(l)}}for(let s of o)s.options.some(c=>c.model in ls)||s!==a.get("@models")&&s.options.sort((c,i)=>c.label.localeCompare(i.label,void 0,{numeric:!0,sensitivity:"base"}));return r.length?[{heading:null,options:r},...o]:o}function Br(e,n){let t=e.find(o=>o.kind==="auto")??{id:"auto",kind:"auto",label:"Automatic",model:"auto"};if(!n||n==="auto")return{selected:t,unavailable:null};let r=e.find(o=>o.id===n);return r&&!r.locked?{selected:r,unavailable:null}:{selected:t,unavailable:n}}function Gr(e){return e.kind==="provider"&&e.costClass?{model:e.model,route:{allow:e.costClasses??[e.costClass]}}:e.runtime?{model:e.model,runtime:e.runtime}:{model:e.model}}function gn(e){return e.length>1}var Ba={opus:"Most capable. Best for hard, multi-step work.",sonnet:"Balanced speed and quality for everyday runs.",haiku:"Fastest. Best for quick, simple runs."};function Wr(e){if(e.kind==="auto"){let t=e.note?.replace(/^Uses /,"");return t?`Soba picks the model for each run. Currently using ${t}.`:"Soba picks the model for each run."}if(e.kind==="size")return e.id==="small"?"Quick and cheap. Whichever small model the agent serving has.":"The most capable model the agent serving has.";if(e.kind==="provider")return e.locked==="plan"?"Not included in your plan.":e.locked==="allowance"?"Your plan's allowance is used up.":e.providerName?`Through ${e.providerName}. Counts toward your plan.`:void 0;let n=Ba[e.model];return n?e.machine?`${n} On ${e.machine}.`:n:e.machine?`On ${e.machine}.`:void 0}var Dr={openai:{viewBox:"0 0 24 24",mono:!0,svg:'<path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path>'},anthropic:{viewBox:"0 0 24 24",mono:!0,svg:'<path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path>'},gemini:{viewBox:"0 0 24 24",mono:!1,svg:'<path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="#3186FF"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#gemini-soba-pm-gemini-0)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#gemini-soba-pm-gemini-1)"></path><path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" fill="url(#gemini-soba-pm-gemini-2)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="gemini-soba-pm-gemini-0" x1="7" x2="11" y1="15.5" y2="12"><stop stop-color="#08B962"></stop><stop offset="1" stop-color="#08B962" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="gemini-soba-pm-gemini-1" x1="8" x2="11.5" y1="5.5" y2="11"><stop stop-color="#F94543"></stop><stop offset="1" stop-color="#F94543" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="gemini-soba-pm-gemini-2" x1="3.5" x2="17.5" y1="13.5" y2="12"><stop stop-color="#FABC12"></stop><stop offset=".46" stop-color="#FABC12" stop-opacity="0"></stop></linearGradient></defs>'},azure:{viewBox:"0 0 24 24",mono:!1,svg:'<path d="M7.242 1.613A1.11 1.11 0 018.295.857h6.977L8.03 22.316a1.11 1.11 0 01-1.052.755h-5.43a1.11 1.11 0 01-1.053-1.466L7.242 1.613z" fill="url(#azure-soba-pm-azure-0)"></path><path d="M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z" fill="#0078D4"></path><path d="M15.272.857H7.497L0 23.071h7.775l1.596-4.73 5.068 4.73h6.665l-2.707-7.775h-7.998L15.272.857z" fill="url(#azure-soba-pm-azure-1)"></path><path d="M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z" fill="url(#azure-soba-pm-azure-2)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="azure-soba-pm-azure-0" x1="8.247" x2="1.002" y1="1.626" y2="23.03"><stop stop-color="#114A8B"></stop><stop offset="1" stop-color="#0669BC"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="azure-soba-pm-azure-1" x1="14.042" x2="12.324" y1="15.302" y2="15.888"><stop stop-opacity=".3"></stop><stop offset=".071" stop-opacity=".2"></stop><stop offset=".321" stop-opacity=".1"></stop><stop offset=".623" stop-opacity=".05"></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="azure-soba-pm-azure-2" x1="12.841" x2="20.793" y1="1.626" y2="22.814"><stop stop-color="#3CCBF4"></stop><stop offset="1" stop-color="#2892DF"></stop></linearGradient></defs>'},openrouter:{viewBox:"0 0 24 24",mono:!0,svg:'<path d="M18.654 3.87a5.087 5.087 0 110 10.174L23.7 19.09c.64.641.187 1.737-.72 1.737H8.48a8.479 8.479 0 010-16.958h10.175zM8.479 7.26a5.087 5.087 0 100 10.176 5.087 5.087 0 000-10.175z"></path>'},groq:{viewBox:"0 0 24 24",mono:!0,svg:'<path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path>'},together:{viewBox:"0 0 24 24",mono:!1,svg:'<path d="M23.197 4.503A6 6 0 0015 2.307a5.973 5.973 0 00-2.995 4.933l5.996.008v.515h-5.996c.039.937.298 1.87.8 2.74a6 6 0 1010.39-6z" fill="#EF2CC1"></path><path d="M.805 4.5A6 6 0 003 12.697a5.972 5.972 0 005.77.127L5.779 7.627l.446-.257 2.997 5.192A6 6 0 10.804 4.5z" fill="#CAAEF5"></path><path d="M12 23.894a6 6 0 005.999-6c0-2.13-1.1-3.996-2.775-5.06l-3.005 5.189-.444-.258 2.997-5.192A6 6 0 1012 23.894z" fill="#FC4C02"></path>'},fireworks:{viewBox:"0 0 24 24",mono:!1,svg:'<path clip-rule="evenodd" d="M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z" fill="#5019C5" fill-rule="evenodd"></path>'}};import{jsx as Ga}from"react/jsx-runtime";function Tn({provider:e,className:n}){let t=Dr[e];return t?Ga("svg",{className:n,viewBox:t.viewBox,fill:t.mono?"currentColor":void 0,fillRule:"evenodd","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:t.svg}}):null}import{Fragment as ms,jsx as z,jsxs as We}from"react/jsx-runtime";function Mt({options:e,layout:n="providers",ownInList:t=!1,search:r=!0,selected:o,appName:a,onPick:s,caption:c,onOpen:i,disabled:l,className:d}){let[g,b]=Ct(!1),y=kt(null);if(!gn(e))return null;let f=d?`sc-mp ${d}`:"sc-mp";return We("span",{className:f,children:[c&&z("span",{className:"sc-mp-cap",children:c}),We("button",{ref:y,type:"button",className:"sc-mp-btn",...i?{}:{"aria-haspopup":"dialog","aria-expanded":g},"aria-label":`Model: ${o.label}. Change`,title:o.label,disabled:l,onClick:i??(()=>b(v=>!v)),children:[z("span",{className:"sc-mp-label",children:o.label}),z(hn,{open:!i})]}),g&&!i&&z(Ua,{anchor:y,options:e,layout:n,ownInList:t,search:r,appName:a,current:o.id,onClose:()=>b(!1),onPick:v=>{b(!1),v!==o.id&&s(v)}})]})}var Ha=9,_t=6,bn=8,us=380;var Hr=220;function Ua({anchor:e,options:n,layout:t,ownInList:r,search:o,current:a,inline:s=!1,appName:c,onClose:i,onPick:l}){let d=kt(null),g=kt(null),b=kt(null),y=Wa(),[f,v]=Ct(""),A=f.trim().length>0,k=kt(!1),S=o&&n.length>=Ha,W=Kt(()=>vt(n,t,r),[n,t,r]),L=Kt(()=>{let u=[];for(let P of W){let I=Ur(P),J=P.options.length===1&&P.options[0]?.model==="auto";if(I==="head"||I==="@models"||J||t==="models"&&I.startsWith("@"))for(let B of P.options)u.push({kind:"option",key:B.id,option:B});else u.push({kind:"group",key:`g:${I}`,group:P,section:I.startsWith("@")?"providers":"agents"})}return u},[W,t]),D=Kt(()=>Qa(W,f),[W,f]),O=Kt(()=>D.flatMap(u=>u.options),[D]),U=u=>u.kind==="group"&&u.group.options.some(P=>P.id===a),[w,K]=Ct(()=>L.find(u=>u.kind==="option"?u.option.id===a:U(u))?.key??"auto"),[j,$]=Ct(null),[ae,me]=Ct(null);Xt(()=>{A&&O.length&&!O.some(u=>u.id===w)&&K(O[0]?.id??a)},[O,w,a,A]),Da(()=>{let u=d.current,P=e.current;if(!u||!P||s)return;try{typeof u.showPopover=="function"&&u.showPopover()}catch{}let I=P.getBoundingClientRect(),J=window.innerHeight-I.bottom-_t-bn,B=I.top-_t-bn,ne=J<Math.min(us,u.scrollHeight)&&B>J,N=Math.min(us,ne?B:J);u.style.maxHeight=`${Math.max(160,Math.round(N))}px`;let H=u.offsetWidth,ie=Math.max(bn,Math.min(I.left,window.innerWidth-H-bn));u.style.left=`${Math.round(ie)}px`,ne?(u.style.top="auto",u.style.bottom=`${Math.round(window.innerHeight-I.top+_t)}px`):(u.style.bottom="auto",u.style.top=`${Math.round(I.bottom+_t)}px`),(b.current??u).focus({preventScroll:!0})},[e,s]),Xt(()=>{k.current&&(k.current=!1,g.current?.querySelector(`[data-id="${CSS.escape(w)}"]`)?.scrollIntoView({block:"nearest"}))},[w]),Xt(()=>{if(s)return;let u=P=>{let I=P.target;!I||d.current?.contains(I)||e.current?.contains(I)||i()};return document.addEventListener("pointerdown",u,!0),()=>document.removeEventListener("pointerdown",u,!0)},[e,i,s]),Xt(()=>{if(!j)return;let u=P=>{P.target instanceof Element&&P.target.closest(".sc-mm-flyout")||$(null)};return window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}},[j]);let fe=(u,P=!1)=>{let I=g.current?.querySelector(`[data-id="${CSS.escape(u)}"]`),J=d.current;if(!I||!J)return;let B=I.getBoundingClientRect(),ne=J.getBoundingClientRect(),N=ne.right+4+Hr<=window.innerWidth-bn,H=Math.max(bn,Math.min(B.top-5,window.innerHeight-bn-160));$({key:u,top:H,left:N?ne.right+4:ne.left-4-Hr,maxHeight:Math.min(320,window.innerHeight-H-bn)});let ie=L.find(Ee=>Ee.key===u);ie?.kind==="group"&&me(P?ie.group.options.find(Ee=>Ee.id===a)?.id??ie.group.options[0]?.id??null:null)},R=j?L.find(u=>u.key===j.key):void 0,q=R?.kind==="group"?R.group.options:[],V=u=>{let P=L[(u+L.length)%L.length];P&&(k.current=!0,K(P.key),$(null))},Z=u=>{let P=O[(u+O.length)%O.length];P&&(k.current=!0,K(P.id))},be=u=>{if(u.key==="Escape"){if(u.preventDefault(),u.stopPropagation(),u.nativeEvent.stopImmediatePropagation(),j){$(null);return}i(),e.current?.focus();return}if(u.key==="Tab"){i();return}if(j&&ae!==null){let J=q.findIndex(B=>B.id===ae);if(u.key==="ArrowDown"||u.key==="ArrowUp"){u.preventDefault();let B=u.key==="ArrowDown"?1:-1;me(q[(J+B+q.length)%q.length]?.id??null)}else if(u.key==="ArrowLeft")u.preventDefault(),$(null);else if(u.key==="Enter"){u.preventDefault();let B=q[J];B&&!B.locked&&l(B.id)}return}if(A){let J=O.findIndex(B=>B.id===w);u.key==="ArrowDown"||u.key==="ArrowUp"?(u.preventDefault(),Z(J+(u.key==="ArrowDown"?1:-1))):u.key==="Enter"&&(u.preventDefault(),O.some(B=>B.id===w&&!B.locked)&&l(w));return}let P=L.findIndex(J=>J.key===w),I=L[P];switch(u.key){case"ArrowDown":u.preventDefault(),V(P+1);return;case"ArrowUp":u.preventDefault(),V(P-1);return;case"ArrowRight":I?.kind==="group"&&(u.preventDefault(),fe(I.key,!0));return;case"Enter":u.preventDefault(),I?.kind==="group"?fe(I.key,!0):I&&!I.option.locked&&l(I.option.id);return;default:if(!S&&u.key.length===1&&!u.metaKey&&!u.ctrlKey){let J=u.key.toLowerCase(),B=ie=>(ie.kind==="option"?ie.option.label:ie.group.heading??"").toLowerCase(),ne=L.findIndex((ie,Ee)=>Ee>P&&B(ie).startsWith(J)),N=L.findIndex(ie=>B(ie).startsWith(J)),H=ne>=0?ne:N;H>=0&&V(H)}}},Y=u=>`${y}-${u}`,he=L.filter(u=>u.kind==="group"&&u.section==="agents"||u.kind==="option"&&u.option.kind==="named"),Ae=L.filter(u=>u.kind==="group"&&u.section==="providers"),Te=L.filter(u=>u.kind==="group"||!(u.option.choice||u.option.kind==="auto"||u.option.kind==="size")),Re=L.some(u=>u.kind==="option"&&u.option.kind==="provider"&&!u.option.choice),ee=(u,P,I,J=!1)=>We("div",{id:Y(u.id),"data-id":u.id,role:"option","aria-selected":u.id===a,...u.locked?{"aria-disabled":!0}:{},"data-active":u.id===P||void 0,"data-locked":u.locked,className:"sc-mm-item",onPointerMove:I,onPointerDown:B=>B.preventDefault(),onClick:()=>!u.locked&&l(u.id),children:[z(za,{option:u,bare:J}),z("span",{className:"sc-mm-label",children:u.label}),u.locked?!J&&z("span",{className:"sc-mm-pill",children:ds[u.locked]}):ps(u)&&u.id!==a&&z("span",{className:"sc-mm-note",children:ps(u)}),u.id===a&&z(Ir,{})]},u.id),de=u=>{let P=u.group.options[0],I=u.group.options.every(B=>B.locked)?P?.locked:void 0,J=P?.runtime?$e[P.runtime]:void 0;return We("div",{id:Y(u.key),"data-id":u.key,role:"option","aria-selected":!1,"data-active":u.key===w||void 0,"data-locked":I,className:"sc-mm-item sc-mm-sub",onPointerMove:()=>{w!==u.key&&K(u.key),j?.key!==u.key&&fe(u.key)},onPointerDown:B=>B.preventDefault(),onClick:()=>fe(u.key),children:[J?z("img",{className:"sc-mm-tile",src:J,alt:"","aria-hidden":"true"}):z("span",{className:"sc-mm-tile sc-mm-tile-box","aria-hidden":"true",children:P?.providerMark&&z(Tn,{provider:P.providerMark,className:"sc-mm-tile-glyph"})}),z("span",{className:"sc-mm-label",children:u.group.heading}),I&&z("span",{className:"sc-mm-pill",children:ds[I]}),U(u)&&z("span",{className:"sc-mm-dot","aria-hidden":"true",title:"In use"}),z(hn,{open:!1})]},u.key)};return We("div",{ref:d,role:"dialog","aria-label":"Choose a model",className:s?"sc-mm sc-mm-inline":"sc-mm",...s?{}:{popover:"manual"},tabIndex:-1,onKeyDown:be,onPointerLeave:()=>!s&&$(null),...S?{}:{"aria-activedescendant":Y(w)},children:[S&&We("div",{className:"sc-mm-search",children:[z(Ja,{}),z("input",{ref:b,type:"text",role:"combobox","aria-expanded":"true","aria-controls":`${y}-list`,"aria-activedescendant":Y(w),"aria-autocomplete":"list",placeholder:"Search models",autoComplete:"off",spellCheck:!1,value:f,onChange:u=>{v(u.target.value),$(null)}})]}),z("div",{ref:g,id:`${y}-list`,role:"listbox","aria-label":"Models",className:"sc-mm-list",onScroll:()=>$(null),children:A?We(ms,{children:[D.map((u,P)=>We("div",{role:"group",...u.heading?{"aria-labelledby":`${y}-g${P}`}:{},className:"sc-mm-group",children:[u.heading&&z(Va,{id:`${y}-g${P}`,group:u}),u.options.map(I=>ee(I,w,()=>I.id!==w&&K(I.id),!!u.heading))]},Ur(u))),!O.length&&We("div",{className:"sc-mm-empty",children:["No models match \u201C",f.trim(),"\u201D"]})]}):We(ms,{children:[L.filter(u=>u.kind==="option"&&(u.option.choice||u.option.kind==="auto"||u.option.kind==="size")).map(u=>u.kind==="option"?ee(u.option,w,()=>{w!==u.key&&K(u.key),$(null)}):null),r&&Te.length>0&&z("div",{className:"sc-mm-rule",role:"presentation"}),r&&Te.map(u=>u.kind==="group"?de(u):ee(u.option,w,()=>{w!==u.key&&K(u.key),$(null)})),!r&&he.length>0&&z("div",{className:"sc-mm-rule",role:"presentation"}),!r&&he.length>0&&z("div",{className:"sc-mm-label-row",role:"presentation",children:"Your own AI"}),(r?[]:he).map(u=>u.kind==="group"?de(u):ee(u.option,w,()=>{w!==u.key&&K(u.key),$(null)})),!r&&(Ae.length>0||Re)&&z("div",{className:"sc-mm-rule",role:"presentation"}),!r&&(Ae.length>0||Re)&&z("div",{className:"sc-mm-label-row",role:"presentation",children:c?`${c} models`:"Included models"}),(r?[]:Ae).map(u=>u.kind==="group"?de(u):null),(r?[]:L).filter(u=>u.kind==="option"&&u.option.kind==="provider"&&!u.option.choice).map(u=>u.kind==="option"?ee(u.option,w,()=>{w!==u.key&&K(u.key),$(null)}):null)]})}),j&&q.length>0&&z("div",{role:"listbox","aria-label":R?.kind==="group"?R.group.heading??"Models":"Models",className:"sc-mm-flyout",style:{top:j.top,left:j.left,width:Hr,maxHeight:j.maxHeight},children:q.map(u=>ee(u,ae,()=>u.id!==ae&&me(u.id),!0))})]})}var ds={plan:"Upgrade",allowance:"Limit reached"},Fa={auto:"M8 1c.5 3.6 2 5 7 7-5 2-6.5 3.4-7 7-.5-3.6-2-5-7-7 5-2 6.5-3.4 7-7Z",fast:"M9.4.5 2.6 9.1c-.3.4 0 .9.4.9H7l-.9 5.1c-.1.5.5.8.8.4l6.8-8.6c.3-.4 0-.9-.4-.9H9.3l.9-5.1c.1-.5-.5-.8-.8-.4Z",best:"M4.5 2h7l3.5 4.2L8 14.5 1 6.2Z"};function za({option:e,bare:n=!1}){if(e.icon)return/^https?:\/\//.test(e.icon)?z("img",{className:"sc-mm-tile",src:e.icon,alt:"","aria-hidden":"true"}):z("span",{className:"sc-mm-tile sc-mm-tile-box sc-mm-emoji","aria-hidden":"true",children:e.icon});if(e.kind==="named"&&e.runtime&&!n){let t=$e[e.runtime];return t?z("img",{className:"sc-mm-tile",src:t,alt:"","aria-hidden":"true"}):null}return e.kind==="auto"||e.kind==="size"?z("span",{className:"sc-mm-tile sc-mm-tile-box","aria-hidden":"true",children:z("svg",{viewBox:"0 0 16 16",className:"sc-mm-tile-glyph",fill:"currentColor","aria-hidden":"true",focusable:"false",children:z("path",{d:Fa[e.kind==="auto"?"auto":e.id==="small"?"fast":"best"]})})}):e.kind==="provider"&&e.providerMark&&!n?z("span",{className:e.locked?"sc-mm-tile sc-mm-tile-box sc-mm-tile-dim":"sc-mm-tile sc-mm-tile-box","aria-hidden":"true",children:z(Tn,{provider:e.providerMark,className:"sc-mm-tile-glyph"})}):null}function Ur(e){let n=e.options[0];return!n||n.choice||n.kind==="auto"||n.kind==="size"?"head":n.runtime&&e.options.every(t=>t.runtime===n.runtime)?n.runtime:!n.runtime&&e.options.every(t=>t.providerId===n.providerId)?`@${n.providerId}`:"@models"}function Va({id:e,group:n}){let t=n.options[0],r=Ur(n),o=t?.runtime&&r===t.runtime?$e[t.runtime]:void 0,a=r.startsWith("@")&&r!=="@models"?t?.providerMark:void 0;return We("div",{id:e,className:"sc-mm-head",role:"presentation",children:[o&&z("img",{className:"sc-mm-logo",src:o,alt:"","aria-hidden":"true"}),a&&z(Tn,{provider:a,className:"sc-mm-logo"}),n.heading]})}function Qa(e,n){let t=n.trim().toLowerCase();if(!t)return e;let r=[];for(let o of e){let s=o.heading?.toLowerCase().includes(t)?o.options:o.options.filter(c=>[c.label,c.model,c.note??""].some(i=>i.toLowerCase().includes(t)));s.length&&r.push({...o,options:s})}return r}function ps(e){return e.kind==="provider"?e.locked==="plan"?"Upgrade":e.locked==="allowance"?"Limit reached":e.choice?e.note:void 0:e.kind!=="named"?e.note:e.machine?`on ${e.machine}`:e.model==="auto"?e.note:void 0}function Ja(){return We("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-mm-find",children:[z("circle",{cx:"11",cy:"11",r:"6.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),z("path",{d:"M16 16l4 4",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}import{useEffect as Ya,useRef as ja}from"react";import{jsx as Pe,jsxs as $t}from"react/jsx-runtime";function Fr({options:e,selected:n,onPick:t,onClose:r,busy:o}){let a=ja(null);return Ya(()=>{(a.current?.querySelector('[aria-checked="true"]')??a.current?.querySelector("[role=radio]"))?.focus()},[]),$t("div",{className:"sc-tray sc-screen",onKeyDown:i=>{i.key==="Escape"&&(i.stopPropagation(),r())},children:[$t("div",{className:"sc-screen-head",children:[Pe("button",{type:"button",className:"sc-back","aria-label":"Back",onClick:r,disabled:o,children:Pe(qa,{})}),Pe("h2",{className:"sc-screen-title",children:"Model"})]}),Pe("div",{ref:a,role:"radiogroup","aria-label":"Model",className:"sc-group-card sc-mopts",onKeyDown:i=>{if(!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft"].includes(i.key)||o)return;i.preventDefault();let d=e.findIndex(y=>y.id===n),g=i.key==="ArrowDown"||i.key==="ArrowRight"?1:-1,b=e[((d<0?0:d)+g+e.length)%e.length];b&&t(b.id)},children:e.map(i=>{let l=i.id===n,d=Wr(i);return $t("button",{type:"button",role:"radio","aria-checked":l,tabIndex:l?0:-1,className:"sc-mopt",disabled:o,onClick:()=>t(i.id),children:[$t("span",{className:"sc-mopt-say",children:[Pe("span",{className:"sc-mopt-name",children:i.label}),d&&Pe("span",{className:"sc-mopt-desc",children:d})]}),Pe("span",{className:l?"sc-ring sc-ring-on":"sc-ring","aria-hidden":"true",children:l&&Pe(Za,{})})]},i.id)})}),Pe("p",{className:"sc-screen-foot",children:"Applies to new runs. Runs already in progress keep the model they started with."}),Pe("button",{type:"button",className:"sc-act-go",onClick:r,disabled:o,children:"Done"})]})}function qa(){return Pe("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-back-glyph",children:Pe("path",{d:"M15 6l-6 6 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Za(){return Pe("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:"sc-ring-tick",children:Pe("path",{d:"M5 10.5l3.2 3.2L15 6.5",fill:"none",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as De,jsxs as Ka}from"react/jsx-runtime";function Me({className:e}){return Ka("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:[De("path",{d:"M18.125 7.039A8.6 8.6 0 1 0 18.125 16.961A6 6 0 0 1 18.125 7.039Z",fill:"currentColor"}),De("path",{d:"M19.925 7.039A8.6 8.6 0 0 1 19.925 16.961A6 6 0 0 0 19.925 7.039Z",fill:"currentColor"})]})}function fs({className:e}){return De("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:De("path",{fill:"currentColor",d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"})})}function Bn({className:e}){return De("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:De("path",{fill:"currentColor",d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})})}function er({className:e}){return De("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:De("path",{d:"M4 5h16v11H4zM9 20h6M12 16v4",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Xa({className:e}){return De("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:De("path",{d:"M5 7l5 5-5 5M12 18h7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function zr({className:e}){return De("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:De("path",{d:"M5 6h14v10H5zM2.5 19.5h19",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var An={claude:fs,chatgpt:Bn,local:er},hs={shell:Xa};function bs(e,n){return n<2*6e4?e:n<10*6e4?Math.max(e,6e4):n<30*6e4?Math.max(e,3*6e4):Math.max(e,10*6e4)}var _a=3e3,$a=2*6e4,nr=Date.now(),tr=new Set,gs=!1;function ei(){if(gs||typeof window>"u")return;gs=!0;let e=()=>{let t=nr;if(nr=Date.now(),nr-t>$a)for(let r of tr)r()};for(let t of["pointerdown","keydown","wheel","touchstart"])window.addEventListener(t,e,{capture:!0,passive:!0});let n=()=>{if(!document.hidden)for(let t of tr)t()};window.addEventListener("focus",n),document.addEventListener("visibilitychange",n)}function He(e,n,t={}){ei();let r,o=t.immediate===!1?Date.now():0,a=!1,s=!1,c=()=>{s||(r=setTimeout(i,t.idle===!1?n:bs(n,Date.now()-nr)))},i=async()=>{if(clearTimeout(r),!(s||a)){if(typeof document>"u"||!document.hidden){a=!0,o=Date.now();try{await e()}catch{}finally{a=!1}}c()}},l=()=>{Date.now()-o>Math.min(n,_a)&&i()};return tr.add(l),t.immediate===!1?c():i(),()=>{s=!0,clearTimeout(r),tr.delete(l)}}import{useEffect as ni,useRef as ti,useState as ri}from"react";function Kn(e){if(e.label)return e.label;if(e.task){let n=e.task.replace(/[_-]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}return"A run"}function rr(e){if(e.status==="queued")return"Waiting for a free slot";if(e.step)return e.step;switch(e.phase?.kind){case"thinking":return"Thinking";case"writing":return"Writing";case"tool":return e.phase.tool?`Using ${e.phase.tool}`:"Using a tool";case"approval":return e.phase.tool?`Waiting for you to allow ${e.phase.tool}`:"Waiting for your approval";default:return e.first_output_at?"Working":"Starting"}}function Nt(e){let n=Math.max(0,Math.round((Date.now()-new Date(e).getTime())/1e3));if(n<60)return`${n}s`;let t=Math.floor(n/60);return t<60?`${t}m ${String(n%60).padStart(2,"0")}s`:`${Math.floor(t/60)}h ${String(t%60).padStart(2,"0")}m`}function Vr(e){let n=new Date(e);return Number.isNaN(n.getTime())?"\u2014":n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}import{jsx as X,jsxs as ve}from"react/jsx-runtime";function Jr({run:e,machine:n,appName:t,onClose:r,onStop:o,busy:a}){let s=ti(null),[c,i]=ri(!1);ni(()=>{s.current?.focus()},[]);let l=v=>{v.key==="Escape"&&(v.stopPropagation(),r())},d=async()=>{i(!0);try{await o?.(e.id)}catch{i(!1)}},g=Kn(e),b=e.status==="running"&&!c,f=[n?.runtimes.find(v=>v.id===e.runtime_id)?.display_name??e.runtime_id,n?le(n):null].filter(Boolean).join(", ");return ve("div",{className:"sc-tray sc-screen",onKeyDown:l,children:[ve("div",{className:"sc-screen-head",children:[X("button",{ref:s,type:"button",className:"sc-back","aria-label":"Back to active runs",onClick:r,children:X(si,{})}),X("span",{className:"sc-screen-from",children:"Active runs"})]}),ve("div",{className:"sc-rd-head",children:[X("h2",{className:"sc-rd-name",children:g}),ve("p",{className:"sc-rd-state",children:[X("span",{className:b?"sc-rd-dot sc-rd-dot-live":"sc-rd-dot","aria-hidden":"true"}),c?"Stopping\u2026":e.status==="queued"?`Queued for ${Nt(e.started_at)}`:`Running for ${Nt(e.started_at)}`]})]}),ve("div",{className:"sc-group-card sc-rd-facts",children:[t&&ve("p",{className:"sc-rd-fact",children:[X("span",{className:"sc-rd-key",children:"Source"}),X("span",{className:"sc-rd-val",children:t})]}),ve("p",{className:"sc-rd-fact",children:[X("span",{className:"sc-rd-key",children:"Model"}),X("span",{className:"sc-rd-val",children:oi(e.model)})]}),f&&ve("p",{className:"sc-rd-fact",children:[X("span",{className:"sc-rd-key",children:"Runs on"}),X("span",{className:"sc-rd-val",children:f})]})]}),ve("section",{className:"sc-group",children:[X("div",{className:"sc-group-cap",children:X("p",{className:"sc-group-title",children:"Activity"})}),ve("div",{className:"sc-group-card sc-rd-steps",children:[ve("p",{className:"sc-rd-step",children:[X(Qr,{state:"done"}),X("span",{className:"sc-rd-say",children:"Started"}),X("span",{className:"sc-rd-when",children:Vr(e.started_at)})]}),ve("p",{className:"sc-rd-step",children:[X(Qr,{state:e.first_output_at?"done":"todo"}),X("span",{className:e.first_output_at?"sc-rd-say":"sc-rd-say sc-rd-wait",children:"First output"}),X("span",{className:"sc-rd-when",children:e.first_output_at?Vr(e.first_output_at):"Not yet"})]}),ve("p",{className:"sc-rd-step",children:[X(Qr,{state:b?"now":"todo"}),X("span",{className:"sc-rd-say",children:c?"Stopping":rr(e)})]})]})]}),ve("div",{className:"sc-acts",children:[o&&X("button",{type:"button",className:"sc-act-stop",onClick:()=>void d(),disabled:a||c,children:c?"Stopping\u2026":"Stop run"}),X("a",{className:"sc-act-quiet",href:Ln(),children:"Open Soba"})]})]})}function oi(e){return!e||e==="auto"?"Automatic":e==="small"?"Fast":e==="large"?"Best":en(e)}function Qr({state:e}){return e==="done"?ve("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:"sc-rd-mark sc-rd-mark-done",children:[X("circle",{cx:"10",cy:"10",r:"9",fill:"currentColor"}),X("path",{d:"M5.8 10.3l2.8 2.8 5.6-5.8",fill:"none",stroke:"var(--sc-tray-card, #ffffff)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}):e==="now"?ve("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:"sc-rd-mark sc-rd-mark-now",children:[X("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:"var(--sc-line-2, #dcdce0)",strokeWidth:"2.4"}),X("path",{d:"M10 2a8 8 0 018 8",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round"})]}):X("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:"sc-rd-mark",children:X("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:"currentColor",strokeWidth:"2"})})}function si(){return X("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-back-glyph",children:X("path",{d:"M15 6l-6 6 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}var Ie=[{id:"claude",costClass:"user-subscription",short:"Claude Code",label:"Continue with Claude",title:"The Claude plan you already pay for",cost:"Nothing beyond the plan",prerequisite:"Claude Code installed and signed in",hint:"Install it from claude.ai/code, then run `claude` once and sign in.",install:"https://claude.com/product/claude-code",expects:["claude-code"]},{id:"chatgpt",costClass:"user-subscription",short:"Codex",label:"Continue with ChatGPT",title:"The ChatGPT plan you already pay for",cost:"Nothing beyond the plan",prerequisite:"Codex installed and signed in",hint:"Install Codex, then run `codex` once and sign in.",install:"https://learn.chatgpt.com/codex/cli",expects:["codex"]},{id:"local",costClass:"user-hardware",short:"Local models",label:"Use a model on this machine",title:"A model on your own machine",cost:"Free. You bought the hardware",prerequisite:"Ollama running, with a model pulled",hint:"Install Ollama, then `ollama pull` a model before pairing.",install:"https://ollama.com",expects:["ollama","openai-api"]}],As=["claude","chatgpt"];function Yr(){return Ie.filter(e=>As.includes(e.id))}function jr(e){return Ie.filter(n=>n.costClass===e)}function qr(e){return Ie.find(n=>n.expects.includes(e))??null}import{Fragment as $n,jsx as m,jsxs as x}from"react/jsx-runtime";function Gn({machines:e,hosted:n=[],onApproveRuntime:t,onPreferRuntime:r,onDisconnectHosted:o,onPair:a,onWake:s,onOpenApp:c,onRefresh:i,refreshing:l,busy:d,appName:g,model:b,onPickModel:y,error:f,runs:v,loadRuns:A,loading:k,machineMenu:S,machineNote:W,onReconnect:L,openApp:D=!0,children:O,onStopRun:U}){let w=_e(e),K=e.filter(E=>E.id!==w?.id),j=w?.state==="online",[$,ae]=_n(()=>j?[]:null),[me,fe]=_n("no"),[R,q]=_n(!1),[V,Z]=_n(null),be=v===void 0&&!!A,Y=be?$:v??(j?[]:null),he=v!==void 0||!!A;ys(()=>{V&&Y&&!Y.some(E=>E.id===V)&&Z(null)},[V,Y]);let Ae=!!(w&&on(w));ys(()=>{if(!be||!A||!Ae)return;let E=!0,kn=He(async()=>{let G=await A();E&&ae(G)},3e3);return()=>{E=!1,kn()}},[be,A,Ae]);let Re=(w?Mr(w):[]).filter(E=>E.quarantined&&!E.absent),ee=sr(w,b).runtime,de=ee?.cost_class==="user-hardware"?ee:null,u=de?vi(wi(de,b)):null,P=!!w&&!on(w),I=(()=>{if(!w||P||!ee||Ke(ee).tone!=="warn")return null;let kn=le(w);return{title:`${ee.display_name} is signed out`,detail:`Sign in on ${kn} so Soba can start runs.`}})(),J=()=>{c?.(),fe("going"),On().then(E=>fe(E==="absent"?"absent":"no"))},B=()=>{J(),s?.()},ne={label:me==="going"?"Opening Soba\u2026":"Open Soba",onPress:J,spin:me==="going"},N=w?ne:a?{label:"Connect to Soba",onPress:a}:null,H=!!w&&N===ne,ie=H&&!!i,Ee=i&&m("button",{type:"button",className:"sc-disc",onClick:i,disabled:l,"aria-label":"Refresh",title:"Refresh",children:m(Ni,{spinning:!!l})});if(!w&&n.length===0&&!a)return m("p",{className:"sc-note",children:"Nothing connected yet."});if(R&&w&&b&&y){let E=ks(w,b);if(gn(E.options))return m(Fr,{options:E.options,selected:b.id,onPick:y,onClose:()=>q(!1),...d?{busy:d}:{}})}let je=V?Y?.find(E=>E.id===V):void 0;return je?m(Jr,{run:je,onClose:()=>Z(null),...w?{machine:w}:{},...g?{appName:g}:{},...U?{onStop:U}:{},...d?{busy:d}:{}}):x("div",{className:"sc-tray",children:[w&&x(ze,{title:"This machine",action:(i&&!ie||D||S)&&x("span",{className:"sc-cap-acts",children:[!ie&&Ee,D&&m(fi,{}),S]}),children:[m(ii,{machine:w}),W]}),w&&P&&!w.pairing_lost&&m(ze,{title:"Soba",children:x("div",{className:"sc-away",children:[m("span",{className:"sc-away-mark","aria-hidden":"true",children:m(mn,{kind:"paused",size:30})}),x("span",{className:"sc-away-say",children:[m("span",{className:"sc-away-title",children:"Wake it up"}),x("span",{className:"sc-away-body",children:["Soba on ",le(w)," is not answering. Waking it opens the app there."]})]}),m("button",{type:"button",className:"sc-away-go",onClick:B,disabled:d||me==="going",children:me==="going"?"Waking\u2026":"Wake"})]})}),w?.pairing_lost&&!on(w)&&m(ze,{title:"Soba",children:x("div",{className:"sc-away",children:[m("span",{className:"sc-away-mark","aria-hidden":"true",children:m(mn,{kind:"gone",size:30})}),x("span",{className:"sc-away-say",children:[m("span",{className:"sc-away-title",children:"Connect it again"}),m("span",{className:"sc-away-body",children:"Its pairing has ended, so it cannot take runs until it is connected again."})]}),L&&m("button",{type:"button",className:"sc-away-go",onClick:L,disabled:d,children:"Connect"})]})}),w&&!P&&m(ze,{title:"Runs on",children:ee?m(bi,{machine:w,appName:g,busy:d,...b?{model:b}:{},...y?{onPickModel:y,onOpenModels:()=>q(!0)}:{},...r?{onPick:E=>r(w.id,E)}:{},...t?{onApprove:E=>t(w.id,E)}:{}}):x("div",{className:"sc-blank",children:[m("span",{className:"sc-blank-mark","aria-hidden":"true",children:m(ui,{})}),x("span",{className:"sc-blank-say",children:[m("span",{className:"sc-blank-title",children:k?"Looking\u2026":"No agent on this machine"}),m("span",{className:"sc-blank-body",children:k?"Reading what it can run.":"Install Claude Code, Codex or Ollama there and it will appear here."})]}),!k&&D&&x("a",{className:"sc-blank-act",href:Ln(),children:[m("span",{children:"Add agents"}),m(Zr,{})]})]})}),w&&(I||u)&&x(ze,{title:"Needs attention",children:[I&&x("div",{className:"sc-alarm",children:[m("span",{className:"sc-alarm-mark","aria-hidden":"true",children:m(ws,{})}),x("span",{className:"sc-alarm-say",children:[m("span",{className:"sc-alarm-title",children:I.title}),m("span",{className:"sc-alarm-body",children:I.detail})]})]}),u&&x("div",{className:"sc-alarm sc-alarm-warn",children:[m("span",{className:"sc-alarm-mark","aria-hidden":"true",children:m(ws,{})}),x("span",{className:"sc-alarm-say",children:[m("span",{className:"sc-alarm-title",children:"A large model on this computer"}),x("span",{className:"sc-alarm-body",children:["Your ",u," model can take all this computer's memory while it answers."]})]})]})]}),w&&he&&!P&&m(ci,{machine:w,runs:Y,onOpen:E=>Z(E),...U?{onStop:U}:{}}),w&&m($n,{children:Re.length>0&&!P&&!(r&&t&&!["app","model"].includes(sr(w,b).by))&&m(ze,{title:"New on this machine",children:Re.map(E=>m(gi,{runtime:E,...t?{onApprove:()=>t(w.id,E.id)}:{}},E.id))})}),n.length>0&&m(ze,{title:n.length>1?"Connected plans":"Connected plan",children:n.map(E=>m(Ci,{credential:E,appName:g,busy:d,...o?{onDisconnect:()=>o(E.provider)}:{}},E.provider))}),K.length>0&&m(ze,{title:"Your other machines",children:K.map(E=>m(hi,{machine:E},E.id))}),!w&&a&&m(ze,{title:"Your machines",children:x("button",{type:"button",className:"sc-pair",onClick:a,children:[m("span",{className:"sc-otile","aria-hidden":"true",children:m(Mi,{})}),m("span",{className:"sc-oname",children:"Connect a machine"})]})}),N&&x("div",{className:"sc-acts",children:[H&&N?x("div",{className:"sc-acts-row",children:[ie?Ee:m("span",{}),x("button",{type:"button",className:"sc-act-small",onClick:N.onPress,disabled:d||N.spin,"data-spin":N.spin?"true":void 0,children:[N.spin&&m(vs,{}),N.label,!N.spin&&m(Zr,{})]})]}):N&&x("button",{type:"button",className:"sc-act-go",onClick:N.onPress,disabled:d||N.spin,"data-spin":N.spin?"true":void 0,children:[N.spin&&m(vs,{}),N.label]}),me==="absent"&&x("p",{className:"sc-act-miss",children:["Nothing opened here. ",w?le(w):"That machine"," may be a different computer, or the Soba app is not installed on this one."]})]}),O,f&&m("p",{className:"sc-error sc-tray-error",children:f})]})}function ze({title:e,action:n,children:t}){return x("section",{className:"sc-group",children:[x("div",{className:"sc-group-cap",children:[m("p",{className:"sc-group-title",children:e}),n]}),m("div",{className:"sc-group-card",children:t})]})}function ii({machine:e,onToggle:n,open:t}){let r=on(e),o=[r?null:e.pairing_lost?"Not connected to Soba":"Soba is asleep",r?gt(e):null,e.always_on?"always on":null].filter(Boolean),a=r&&e.capacity>0?e.active>0?`${e.active} of ${e.capacity} running`:null:bt(e.last_seen_at),s=x($n,{children:[x("span",{className:"sc-mtile","aria-hidden":"true",children:[m(Cs,{}),m("span",{className:`sc-mbadge sc-mbadge-${r?In(e).tone:e.pairing_lost?"off":"away"}`})]}),x("span",{className:"sc-mid",children:[m("span",{className:"sc-mname",children:le(e)}),x("span",{className:"sc-mmeta",children:[m("span",{className:"sc-mmeta-is",children:o.map((c,i)=>x("span",{children:[i>0&&m("span",{className:"sc-mmeta-sep",children:"\xB7"}),c]},c))}),a&&m("span",{className:"sc-mmeta-now",children:a})]})]})]});return!n||!r?m("div",{className:"sc-mrow",children:s}):x("button",{type:"button",className:"sc-mrow sc-mrow-btn",onClick:n,"aria-expanded":!!t,title:t?"Hide what it is running":"See what it is running",children:[s,m(hn,{open:!!t})]})}function li(e,n){return e.filter(t=>t.machine_id===n.id||t.machine_id===null)}function ci({machine:e,runs:n,onStop:t,onOpen:r}){let o=n?li(n,e):[],[a,s]=_n(new Set),c=async l=>{s(d=>new Set(d).add(l));try{await t?.(l)}catch{s(d=>{let g=new Set(d);return g.delete(l),g})}},i=()=>{for(let l of o)c(l.id)};return m(ze,{title:"Active runs",...t&&o.length>1?{action:m("button",{type:"button",className:"sc-cap-link",onClick:i,children:"Stop all"})}:{},children:n===null?m("p",{className:"sc-row-note",children:"Looking\u2026"}):o.length===0?x("p",{className:"sc-nilrow",children:[m("span",{className:"sc-nilrow-mark","aria-hidden":"true",children:m(di,{})}),"Nothing running"]}):o.map(l=>m(pi,{run:l,stopping:a.has(l.id),...t?{onStop:()=>void c(l.id)}:{},...r?{onOpen:()=>r(l.id)}:{}},l.id))})}function ui(){return x("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-blank-glyph",children:[m("rect",{x:"3",y:"4.5",width:"18",height:"15",rx:"2.5",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),m("path",{d:"M7.5 10l2.5 2.2-2.5 2.2M12.5 14.6h4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function di(){return x("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-blank-glyph",children:[m("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),m("path",{d:"M9 12.5l2.2 2.2L15.5 9.8",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function pi({run:e,stopping:n,onStop:t,onOpen:r}){let o=x($n,{children:[m("span",{className:n?"sc-rdot":"sc-rdot sc-rdot-live","aria-hidden":"true"}),x("span",{className:"sc-mid",children:[m("span",{className:"sc-rtitle",children:Kn(e)}),m("span",{className:"sc-rstep",children:n?"Stopping\u2026":`${rr(e)} \xB7 ${Nt(e.started_at)}`})]})]});return x("div",{className:"sc-rrow",children:[r?x("button",{type:"button",className:"sc-rgo",onClick:r,"aria-label":`${Kn(e)} \u2014 open this run`,children:[o,m(hn,{open:!1})]}):o,t&&m("button",{type:"button",className:"sc-rstop",onClick:t,disabled:n,"aria-label":`Stop ${Kn(e)}`,children:m("span",{className:"sc-rstop-ring",children:m(xi,{})})})]})}function mi(e){let n=qr(e);return(n?An[n.id]:null)??hs[e]??null}function fi(){return m("a",{className:"sc-disc sc-open-app",href:Ln(),"aria-label":"Open Soba",title:"Open Soba",children:m(Zr,{})})}function Zr(){return m("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-dglyph",children:m("path",{d:"M14 4h6v6M20 4l-8.5 8.5M18 14.5V19a1 1 0 01-1 1H5a1 1 0 01-1-1V7a1 1 0 011-1h4.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function hi({machine:e}){let n=In(e);return x("div",{className:"sc-orow",children:[m("span",{className:"sc-otile","aria-hidden":"true",children:m(Cs,{})}),m("span",{className:"sc-oname",children:le(e)}),m("span",{className:"sc-oword",children:n.word}),m("span",{className:`sc-dot sc-dot-${n.tone}`,"aria-hidden":"true"})]})}function gi({runtime:e,onApprove:n}){return x("div",{className:"sc-mrow",children:[m("span",{className:"sc-mtile sc-atile","aria-hidden":"true",children:m(or,{id:e.id,name:e.display_name})}),x("span",{className:"sc-mid",children:[m("span",{className:"sc-mname",children:e.display_name}),m("span",{className:"sc-mmeta",children:e.version??"waiting to be let in"})]}),n?m("button",{type:"button",className:"sc-row-act",onClick:n,children:"Let it serve"}):m("span",{className:"sc-averdict sc-tone-warn",children:"not serving yet"})]})}function Xr({id:e,name:n}){return m("span",{className:"sc-runtime-tile","aria-hidden":"true",children:m(or,{id:e,...n?{name:n}:{}})})}function or({id:e,name:n}){if(!e)return null;let t=$e[e];if(t)return m("img",{src:t,alt:"",className:"sc-runtime-logo"});let r=mi(e);return r?m(r,{className:"sc-runtime-mark"}):n?m("span",{className:"sc-runtime-letter",children:n.slice(0,1).toUpperCase()}):null}function ks(e,n){if(!n)return{options:[]};let t=sr(e,n),r=t.runtime?.id??t.runtimeId,o=wt([e]).filter(c=>c.kind==="named"?c.runtime===r:c.kind==="size"?!!r&&Zt(r):!0),a=t.runtime?.default_model;if(n.kind!=="auto"||!a)return{options:o,shown:n};let s=en(a);return{options:o,shown:{...n,label:s.length>16?s:`${n.label} \xB7 ${s}`}}}function bi({machine:e,appName:n,busy:t,onPick:r,model:o,onPickModel:a,onOpenModels:s,onApprove:c}){let i=sr(e,o),l=we(e),d=c?e.runtimes.filter(U=>U.quarantined&&!U.absent):[],[g,b]=_n(!1),y=ai(null);if(i.by!=="app"&&l.length===0)return null;let f=U=>U?m(Xr,{id:U.id,name:U.display_name}):null,v=i.runtime?.display_name??i.runtimeId??"\u2014",A=i.by!=="app"&&i.by!=="model"&&!!r&&(l.length>=2||d.length>0),k=i.runtime?.id??i.runtimeId,S=!on(e),W=i.runtime&&Ke(i.runtime).tone==="warn"?"Signed out":null,{options:L,shown:D}=ks(e,o),O=i.by==="app"?`Set by ${n??"the app"}`:i.runtime?yi(i.runtime):null;return x($n,{children:[A?x("button",{ref:y,type:"button",className:S?"sc-runs-agent sc-runs-dim":"sc-runs-agent","aria-haspopup":"menu","aria-expanded":g,"aria-label":`Runs go to ${v}. Change`,disabled:t,onClick:()=>b(U=>!U),children:[m("span",{className:"sc-runs-tile","aria-hidden":"true",children:m(or,{id:k??null,name:v})}),x("span",{className:"sc-runs-said-name",children:[m("span",{className:"sc-runs-name",children:v}),W&&m("span",{className:"sc-runs-ill",children:W})]}),m(hn,{open:!1})]}):x("span",{className:S?"sc-runs-agent sc-runs-fixed sc-runs-dim":"sc-runs-agent sc-runs-fixed",children:[m("span",{className:"sc-runs-tile","aria-hidden":"true",children:m(or,{id:k??null,name:v})}),x("span",{className:"sc-runs-said-name",children:[m("span",{className:"sc-runs-name",children:v}),W&&m("span",{className:"sc-runs-ill",children:W})]}),i.by==="app"&&x("span",{className:"sc-runs-told",children:["set by ",n??"the app"]}),i.by==="model"&&m("span",{className:"sc-runs-told",children:"set by the model"})]}),D&&a&&gn(L)?x($n,{children:[m("span",{className:"sc-runs-rule","aria-hidden":"true"}),m(Mt,{options:L,selected:D,onPick:a,caption:"Model",...s?{onOpen:s}:{},className:S?"sc-runs-model sc-runs-dim":"sc-runs-model",...t?{disabled:t}:{}})]}):O&&x($n,{children:[m("span",{className:"sc-runs-rule","aria-hidden":"true"}),x("span",{className:"sc-runs-said",children:[m("span",{className:"sc-runs-key",children:"Model"}),m("span",{className:"sc-runs-val",children:O})]})]}),g&&r&&m(Ai,{anchor:y,machine:e,tile:f,waiting:d,...c?{onApprove:c}:{},onClose:()=>b(!1),onPick:U=>{b(!1),r(U)}})]})}function Ai({anchor:e,machine:n,tile:t,waiting:r,onApprove:o,onClose:a,onPick:s}){let c={...n,requested_runtime:null},i=Fe(c),l=Fe({...c,preferred_runtime:null}).runtime,d=i.by==="you"?i.runtimeId:null,g=[{id:null,label:"Automatic",...l?{note:`Uses ${l.display_name}`}:{},glyph:t(l)},...we(n).map((b,y)=>{let f=ki(b);return{id:b.id,label:b.display_name,glyph:t(b),...f?{note:f}:{},...y===0?{rule:!0}:{}}}),...o?r.map((b,y)=>({id:`waiting:${b.id}`,label:b.display_name,glyph:t(b),...b.version?{note:b.version}:{},trailing:"Let it serve",onChoose:()=>o(b.id),...y===0?{heading:"New on this machine"}:{}})):[]];return m(Er,{anchor:e,label:"Which agent runs go to",options:g,current:d,onClose:a,onPick:s})}function yi(e){let n=Ke(e);return n.tone==="warn"?n.text:e.default_model?en(e.default_model):"Automatic"}function sr(e,n){if(!e)return{by:"default",runtimeId:null,runtime:null};let t=Fe(n?{...e,requested_runtime:null}:e);if(t.by==="app"||n?.kind!=="named"||!n.runtime)return t;let r=we(e).find(o=>o.id===n.runtime);return!r||r.id===t.runtimeId?t:{by:"model",runtimeId:r.id,runtime:r}}function wi(e,n){return!n||n.kind==="auto"?e.default_model:n.kind==="size"?(ss(n.model)?as(e.id,n.model):void 0)??e.default_model:n.runtime===e.id?n.model:e.default_model}function vi(e){if(!e)return null;let n=/(\d+(?:\.\d+)?)\s*b\b/i.exec(e),t=n?.[1]?Number(n[1]):Number.NaN;return!Number.isFinite(t)||t<20?null:`${n?.[1]}B`}function ki(e){let n=Ke(e);return n.tone==="warn"?n.text:e.default_model?en(e.default_model):e.cost_class==="user-hardware"?"In this machine's memory":n.tone!=="ok"?n.text:e.version??void 0}function Ci({credential:e,appName:n,busy:t,onDisconnect:r}){return x("div",{className:"sc-hrow",children:[x("div",{className:"sc-orow",children:[m("span",{className:"sc-otile","aria-hidden":"true",children:m(Bn,{className:"sc-omark"})}),x("span",{className:"sc-mid",children:[m("span",{className:"sc-oname",children:e.provider==="openai-chatgpt"?"ChatGPT plan":e.provider}),m("span",{className:"sc-mmeta",children:e.account_label??"signed in"})]}),r&&m("button",{type:"button",className:"sc-row-act",onClick:r,disabled:t,children:"Disconnect"})]}),r&&x("p",{className:"sc-row-note",children:[n??"This app"," stops using it. To withdraw the grant entirely, remove it in your OpenAI settings."]})]})}function Cs(){return x("svg",{viewBox:"0 0 32 24","aria-hidden":"true",focusable:"false",className:"sc-mglyph",children:[m("rect",{x:"4",y:"1.5",width:"24",height:"15",rx:"2.5",fill:"var(--sc-sheet, #ffffff)",stroke:"currentColor",strokeWidth:"2"}),m("rect",{x:"1",y:"19.5",width:"30",height:"2.5",rx:"1.25",fill:"currentColor"})]})}function Mi(){return m("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-oglyph",children:m("path",{d:"M12 5v14M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function ws(){return x("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-hglyph",children:[m("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"2"}),m("path",{d:"M12 7.5v5.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),m("circle",{cx:"12",cy:"16.5",r:"1.15",fill:"currentColor"})]})}function vs(){return x("svg",{className:"sc-act-glyph sc-spin",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[m("circle",{cx:"8",cy:"8",r:"6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),m("path",{d:"M8 1.8a6.2 6.2 0 0 1 6.2 6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function Ni({spinning:e}){return m("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e?"sc-dglyph sc-spin":"sc-dglyph",children:m("path",{d:"M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function xi(){return m("svg",{className:"sc-dglyph",viewBox:"0 0 14 14","aria-hidden":"true",children:m("rect",{x:"2",y:"2",width:"10",height:"10",rx:"2",fill:"currentColor"})})}import{jsx as Si}from"react/jsx-runtime";function Kr({machines:e,onApproveRuntime:n,model:t,onPickModel:r}){return Si(Gn,{machines:e,...n?{onApproveRuntime:n}:{},...t?{model:t}:{},...r?{onPickModel:r}:{}})}import{useCallback as Ne,useEffect as Le,useId as Ii,useMemo as yn,useRef as et,useState as ce}from"react";var xt=[{slug:"mac-arm",label:"macOS, Apple silicon"},{slug:"mac-intel",label:"macOS, Intel"},{slug:"windows",label:"Windows"},{slug:"linux",label:"Linux"}];function St(e){if(!e)return"";try{return new URL(e).origin}catch{return""}}var Ms="soba.connect.choice",Pi=180*24*60*60*1e3;function _r(e){let n=2166136261;for(let t=0;t<e.length;t++)n^=e.charCodeAt(t),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function $r(e,n){return e?n?`${Ms}.${e}.${_r(n)}`:`${Ms}.${e}`:null}function eo(e){if(!e||typeof localStorage>"u")return null;try{let n=localStorage.getItem(e);if(!n)return null;let t=JSON.parse(n);if(Date.now()-Date.parse(t.at)>Pi)return null;let r=Ie.find(o=>o.id===t.choice);return r?r.id:null}catch{return null}}function no(e,n){if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify({choice:n,at:new Date().toISOString()}))}catch{}}var Ns="soba.connect.model",Ri=180*24*60*60*1e3;function to(e,n){return e?n?`${Ns}.${e}.${_r(n)}`:`${Ns}.${e}`:null}function ar(e){if(!e||typeof localStorage>"u")return null;try{let n=localStorage.getItem(e);if(!n)return null;let t=JSON.parse(n);if(Date.now()-Date.parse(t.at)>Ri)return null;let r=t.choice;return typeof r!="string"||!r||r.length>120?null:/^[\w.:@+-]+(\/[\w.:@+-]+)?$/.test(r)?r:null}catch{return null}}function ro(e,n){if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify({choice:n,at:new Date().toISOString()}))}catch{}}var xs="soba.connect.dismissed",Ei=30*24*60*60*1e3;function oo(e,n){return e?n?`${xs}.${e}.${_r(n)}`:`${xs}.${e}`:null}function so(e){if(!e||typeof localStorage>"u")return!1;try{let n=localStorage.getItem(e);if(!n)return!1;let t=JSON.parse(n);return Date.now()-Date.parse(t.at)<Ei}catch{return!1}}function ao(e){if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify({at:new Date().toISOString()}))}catch{}}import{Fragment as tt,jsx as h,jsxs as T}from"react/jsx-runtime";var io=2e3,Li=1e4,Oi=9e4,Ti=6e4;function lo(e,n,t,r=[],o){return e?"code":n&&(t.length>0||r.length>0)?"manage":o?"launch":"choose"}function Ss(e){return on(e)&&!e.pairing_lost}function ir(e){return new Map(e.map(n=>[n.id,Ss(n)]))}function Bi(e){let n=Math.max(0,Math.round(e/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function po({client:e,initialCode:n,initialChoice:t,onConnected:r,showStatus:o=!0,initialContext:a=null,initialMachines:s,onClose:c,headingId:i,theme:l,reason:d,active:g=!0}){let b=!!a&&s!==void 0,[y,f]=ce(b?lo(n,o,s??[],[],t):"loading"),[v,A]=ce(a),[k,S]=ce(s??[]),[W,L]=ce(n??""),[D,O]=ce(null),[U,w]=ce(null),[K,j]=ce(!1),[$,ae]=ce(0),[me,fe]=ce("app"),[R,q]=ce(()=>Date.now()),[V,Z]=ce(null),[be,Y]=ce(!1),[he,Ae]=ce(!1),[Te,Re]=ce("browser"),[ee,de]=ce(null),[u,P]=ce([]),[I,J]=ce(0),[B,ne]=ce(null),N=et(null),[H,ie]=ce(t??null),[Ee,je]=ce(null),E=yn(()=>{let p=v?.accent?.trim(),M=v?.background?.trim();if(!(!p&&!M))return M?{...Rn(M,p),background:M,borderRadius:"inherit"}:{"--sc-accent":p,"--sc-accent-fg":ht(p)}},[v?.accent,v?.background]),kn=Ii(),G=i??kn,cn=et(null);Le(()=>{if(!e||b)return;let p=!0;return Promise.all([e.context(),e.machines()]).then(([M,Q])=>{p&&(A(M),S(Q),f(lo(n,o,Q)))}).catch(M=>{p&&(w(M.message),f("choose"))}),()=>{p=!1}},[e,n,o,b]),Le(()=>{y!=="loading"||!b||f(lo(n,o,s??[]))},[y,b,n,o,s]),Le(()=>{s&&S(s)},[s]),Le(()=>{a&&A(a)},[a]);let tn=et(!1),ke=et(y);ke.current=y;let Cn=et(u);Cn.current=u;let Mn=!!v?.hosted_available;Le(()=>{!o&&ke.current==="manage"&&f("choose")},[o]),Le(()=>{if(!e||!g||y!=="manage")return;let p=!0,M=He(async()=>{try{let Q=await e.machines();if(!p)return;S(Q);let oe=!Mn||tn.current;Q.length===0&&Cn.current.length===0&&oe&&ke.current==="manage"&&f("choose")}catch{}},Li,{immediate:!1});return()=>{p=!1,M()}},[y,e,Mn,g]);let Nn=$r(v?.publishable_key??null);Le(()=>{je(eo(Nn))},[Nn]),Le(()=>{if(!e||!Mn)return;let p=!0;return e.hosted().then(M=>{p&&(P(M.credentials),!tn.current&&(tn.current=!0,M.credentials.length>0&&o&&ke.current==="choose"&&f("manage")))}).catch(()=>{}),()=>{p=!1}},[e,Mn,o]),Le(()=>{if(!e||!g||y!=="hosted")return;let p=!0,M=async()=>{try{let pe=await e.hosted();if(!p)return!1;if(P(pe.credentials),pe.credentials.length>0)return f("hosted_connected"),ne(null),!0}catch{}return!1},Q=async()=>{N.current?.closed&&(N.current=null,!await M()&&p&&f("choose"))},oe=He(M,io,{immediate:!1}),ye=setInterval(Q,400),rn=pe=>{let Xe=pe.data;Xe?.source==="soba"&&Xe.type==="hosted_result"&&M()};return window.addEventListener("message",rn),()=>{p=!1,oe(),clearInterval(ye),window.removeEventListener("message",rn),N.current=null}},[e,y,g]);let ts=Ne(()=>{if(!e)return;let p=window.open("","soba-connect-plan","width=520,height=760,noopener=no");N.current=p,f("hosted"),J(Date.now()),ne(null),w(null),e.startHosted().then(({url:M})=>{if(p&&!p.closed){p.location.href=M;return}ne(M)}).catch(M=>{p?.close(),N.current=null,w(M.message),f("choose")})},[e]),un=Ne(async p=>{if(e){j(!0);try{await e.disconnectHosted(p),P((await e.hosted()).credentials)}catch(M){w(M.message)}finally{j(!1)}}},[e]);Le(()=>{if(!e||!g||y!=="waiting")return;let p=!0,M=He(async()=>{try{let Q=await e.machines();if(!p)return;S(Q);let oe=cn.current;if(!oe)return;let ye=Q.filter(pe=>!oe.has(pe.id)||oe.get(pe.id)===!1&&Ss(pe)),rn=ye.find(pe=>pe.state!=="offline")??ye[0];if(rn){de(rn.id),H&&no(Nn,H);let pe=Ie.find(dt=>dt.id===H)?.expects??[],Xe=we(rn).find(dt=>pe.includes(dt.id));Xe&&e.preferRuntime(rn.id,Xe.id).catch(()=>{}),f("connected"),r?.(Q)}}catch{}},io,{immediate:!1});return()=>{p=!1,M()}},[y,e,r,H,Nn,g]);let Vt=Ne(async()=>{if(e){w(null),j(!0);try{let p=await e.lookup(W);O(p),f("confirm")}catch(p){w(p.message)}finally{j(!1)}}},[e,W]),dn=Ne(async()=>{if(e){w(null),j(!0);try{try{cn.current=ir(await e.machines())}catch{cn.current=ir(k)}await e.approve(W),fe("code"),f("waiting"),ae(Date.now())}catch(p){w(p.message)}finally{j(!1)}}},[e,W,k]),Qn=Ne(async()=>{if(e){j(!0);try{await e.deny(W),Re("browser"),f("denied")}catch(p){w(p.message)}finally{j(!1)}}},[e,W]),ge=yn(()=>v?.connect_url??null,[v]),[qe,ut]=ce(()=>yt()),Jn=yn(()=>ge?At(ge,qe??void 0,H??void 0):null,[ge,qe,H]),Qt=yn(()=>St(ge),[ge]),Jt=Ne(p=>{if(k.length===0)return null;let M=Ie.find(oe=>oe.id===p);if(!M)return null;let Q=k.flatMap(oe=>oe.runtimes??[]).filter(oe=>M.expects.includes(oe.id));return Q.length===0?{tone:"dim",text:"not installed"}:Q.some(oe=>oe.authenticated===!0)?{tone:"ok",text:"ready"}:Q.every(oe=>oe.authenticated===!1)?{tone:"warn",text:"needs signing in"}:{tone:"dim",text:"installed"}},[k]),Yt=Ne((p=null)=>{ie(p),w(null),Z(null),Y(!1),Ae(!1),Yn.current=!1,ut(yt()),f("launch")},[]),Yn=et(!!t);Le(()=>{y!=="launch"||!ge||Yn.current||(Yn.current=!0,Y(!0),Sr(ge,{...qe?{nonce:qe}:{},...H?{want:H}:{}}).then(Z))},[y,ge,qe,H]);let xn=Ne(()=>{Y(!0),xr().then(Z)},[]),jt=Ne(p=>{if(he){let M=yt();Ae(!1),ut(M),ge&&(p.preventDefault(),window.location.href=At(ge,M??void 0,H??void 0))}xn()},[he,xn,ge,H]),Sn=yn(()=>{let p=v?.runtimes;return p?Ie.filter(M=>p.includes(M.id)):Yr()},[v?.runtimes]),Be=yn(()=>{let p=Ie.find(M=>M.id===H);return p?{choice:p,Mark:An[p.id]??null}:null},[H]),Ce=yn(()=>k.find(p=>p.id===ee),[k,ee]),pn=Ne(()=>{f("manage"),c?.()},[c]);Le(()=>{let p=qe;if(!e||!g||y!=="launch"||!p)return;let M=!1,Q=Date.now()+15e4,oe=()=>{};return oe=He(async()=>{if(Date.now()>Q){oe(),Ae(!0);return}try{let ye=await e.claim(p);if(M)return;if(ye.declined){oe(),Z(null),Re("machine"),f("denied");return}if(!ye.claimed)return;oe();try{cn.current=ir(await e.machines())}catch{cn.current=ir(k)}fe("app"),f("waiting"),ae(Date.now())}catch{}},io,{immediate:!1,idle:!1}),()=>{M=!0,oe()}},[e,y,k,qe,g]);let Ze=yn(()=>{if(!D)return null;if(D.approved||D.denied)return"answered";let p=D.expires_at?Date.parse(D.expires_at):Number.NaN;return Number.isFinite(p)&&p<=R?"expired":"live"},[D,R]);Le(()=>{if(!(y==="confirm"&&Ze==="live"||y==="waiting"||y==="hosted"))return;let M=setInterval(()=>q(Date.now()),1e3);return()=>clearInterval(M)},[y,Ze]);let qt=Ne(async(p,M)=>{if(e)try{await e.approveRuntime(p,M),S(await e.machines())}catch(Q){w(Q.message)}},[e]),Ar=Ne(async(p,M)=>{if(e)try{await e.preferRuntime(p,M),S(await e.machines())}catch(Q){w(Q.message)}},[e]);return y==="loading"?h("div",{className:"soba-connect",...l?{"data-theme":l}:{},style:E,children:h("div",{className:"sc-card",children:h("p",{className:"sc-note",children:"Loading\u2026"})})}):T("div",{className:"soba-connect",...l?{"data-theme":l}:{},style:E,children:[c&&h("button",{type:"button",className:"sc-modal-close",onClick:c,"aria-label":"Close",children:"\xD7"}),y==="manage"&&T("div",{className:"sc-card",children:[h("h2",{className:"sc-title",id:G,children:"Your compute"}),T("p",{className:"sc-sub",children:[h(lr,{context:v})," ",k.length>0&&u.length>0?"runs on your connected plan, and on these machines while they are awake.":u.length>0?"runs on the plan you connected. Nothing here is charged to you.":"runs on these machines, while they are awake."]}),h(Gn,{machines:k,hosted:u,onApproveRuntime:qt,onPreferRuntime:(p,M)=>void Ar(p,M),onDisconnectHosted:p=>void un(p),onPair:()=>f("choose"),busy:K,...v?.app.name?{appName:v.app.name}:{}}),U&&h("p",{className:"sc-error",children:U})]}),y==="choose"&&T("div",{className:"sc-card",children:[h(Wi,{context:v}),h("h2",{className:"sc-h",id:G,children:d==="payment_required"?"Carry on with your own AI":d==="no_compute"?"This run needs a machine":"Connect your AI"}),h("p",{className:"sc-p",children:"Use compute you already have."}),ge&&Sn.length>0&&T(tt,{children:[h("div",{className:"sc-opts",children:Sn.map(p=>{let M=An[p.id];return T("button",{type:"button",className:"sc-opt",onClick:()=>Yt(p.id),children:[h("span",{className:"sc-opt-tile","aria-hidden":"true",children:M&&h(M,{className:"sc-opt-mark"})}),h("span",{className:"sc-opt-text",children:h("span",{className:"sc-opt-label",children:p.label})}),(()=>{let Q=Jt(p.id);return Q?h("span",{className:`sc-opt-has sc-opt-has-${Q.tone}`,children:Q.text}):Ee===p.id?h("span",{className:"sc-opt-last",children:"last used"}):h(co,{className:"sc-opt-go"})})()]},p.id)})}),T("p",{className:"sc-opt-note",children:["Your accounts stay there. ",Ps(v)," never sees them."]})]}),(!ge||Sn.length===0)&&h("p",{className:"sc-error",style:{marginTop:16},children:"This app has no publishable key yet, so there is nothing to pair against."}),U&&h("p",{className:"sc-error",children:U}),ge&&v?.show_code===!0&&h("div",{className:"sc-opt-alt",children:h("button",{type:"button",className:"sc-alt-link",onClick:()=>f("code"),children:"I have a code"})})]}),y==="launch"&&T("div",{className:"sc-card",children:[T("div",{className:"sc-head",children:[h(nt,{onClick:()=>f("choose")}),h("p",{className:"sc-head-title",children:"Soba"})]}),h(cr,{mark:Be?.Mark??Me,still:he||!be&&V===null}),h("h2",{className:"sc-h",id:G,children:he?"No answer from this machine":V==="absent"?"Nothing opened":V===null?"Opening Soba\u2026":"Approve it on this machine"}),he?h("p",{className:"sc-p",children:"The Soba app did not answer. It may not be open, or nobody was there. Try again when you are ready."}):V==="absent"?h("p",{className:"sc-p",children:"Nothing opened on this machine. Open it yourself below, or install it if it is not here yet."}):h("p",{className:"sc-p",children:V===null?"Approve it there and this page does the rest.":"This page finishes on its own."}),Be&&T("p",{className:"sc-prereq",children:[Be.Mark&&h(Be.Mark,{className:"sc-rt-mark"}),"Needs ",Be.choice.prerequisite]}),T("div",{className:"sc-stack",style:{marginTop:18},children:[h("a",{className:V==="absent"||he?"sc-btn sc-btn-primary":"sc-btn",href:Jn??"#",onClick:jt,children:he?"Try again":V==="absent"?"Open Soba":"Open it again"}),h("p",{className:"sc-note",children:V===null?"Your browser will ask permission first.":"Your browser asks permission the first time."}),Be&&V==="absent"&&h("p",{className:"sc-note",children:h(Hi,{text:Be.choice.hint})}),T("div",{className:"sc-foot-strip",children:[h("span",{children:"Not installed on this machine?"}),T("button",{type:"button",className:"sc-foot-go",onClick:()=>f("get"),children:["Get it",h(co,{})]})]})]})]}),y==="get"&&T("div",{className:"sc-card",children:[T("div",{className:"sc-head",children:[h(nt,{onClick:()=>f("launch")}),h("p",{className:"sc-head-title",children:"Get Soba"})]}),h("div",{className:"sc-opts",children:xt.map(p=>T("a",{className:"sc-opt",href:`${Qt}/download/${p.slug}`,target:"_blank",rel:"noreferrer noopener",children:[h("span",{className:"sc-opt-tile","aria-hidden":"true",children:h(zr,{className:"sc-opt-mark"})}),h("span",{className:"sc-opt-text",children:h("span",{className:"sc-opt-label",children:p.label})}),h(co,{className:"sc-opt-go"})]},p.slug))}),h("p",{className:"sc-opt-note",children:"Install it, then come back here and press the row you started with."})]}),y==="code"&&T("div",{className:"sc-card",children:[T("div",{className:"sc-head",children:[h(nt,{onClick:()=>f("choose")}),h("p",{className:"sc-head-title",children:"Soba"})]}),h("h2",{className:"sc-h",id:G,children:"Enter the code from that machine"}),h("p",{className:"sc-p",children:"Eight characters, shown by the Soba app once you paste the link."}),T("form",{className:"sc-stack",style:{marginTop:16},onSubmit:p=>{p.preventDefault(),Vt()},children:[h("input",{className:"sc-input",value:W,onChange:p=>L(p.target.value),placeholder:"ACDE-F234",autoComplete:"off",autoFocus:!0,"aria-label":"Pairing code"}),U&&h("p",{className:"sc-error",children:U}),h("button",{type:"submit",className:"sc-btn sc-btn-primary",disabled:K||W.length<8,children:K?"Checking\u2026":"Continue"})]})]}),y==="confirm"&&D&&T("div",{className:"sc-card",children:[T("div",{className:"sc-head",children:[h(nt,{onClick:()=>f("code")}),h("p",{className:"sc-head-title",children:"Soba"})]}),h("h2",{className:"sc-title",children:"Attach this machine to your account?"}),T("p",{className:"sc-sub",children:[h(lr,{context:v})," may send your runs to it once you approve. It can never see the account or the keys on it."]}),T("ul",{className:"sc-facts",children:[h(Pt,{k:"Code",v:D.user_code}),h(Pt,{k:"Machine",v:D.hostname??"not stated"}),h(Pt,{k:"System",v:[D.platform,D.arch].filter(Boolean).join(" / ")||"not stated"}),h(Pt,{k:"Asked by",v:D.client??"not stated"}),D.labels.length>0&&h(Pt,{k:"Labels",v:D.labels.join(", ")})]}),h("p",{className:"sc-note",style:{marginTop:12},children:"Every line above is what that machine said about itself. If none of it looks like a computer of yours, say no."}),Ze==="expired"&&h("p",{className:"sc-error",children:"That code has expired. Ask the machine for a new one. It prints a fresh code each time it starts."}),Ze==="answered"&&h("p",{className:"sc-error",children:"That code has already been answered. If it was not you, deny the next one."}),U&&h("p",{className:"sc-error",children:U}),T("div",{className:"sc-row",style:{marginTop:16},children:[h("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>void dn(),disabled:K||Ze!=="live",children:"Approve"}),h("button",{type:"button",className:"sc-btn",onClick:()=>void Qn(),disabled:K||Ze==="answered",children:"No, deny it"})]}),Ze==="live"&&D.expires_at&&T("p",{className:"sc-note",style:{marginTop:10},children:["This code expires in ",Bi(Date.parse(D.expires_at)-R),"."]})]}),y==="waiting"&&T("div",{className:"sc-card",children:[T("div",{className:"sc-head",children:[h(nt,{onClick:()=>f("choose")}),h("p",{className:"sc-head-title",children:Be?.choice.short??"Soba"})]}),h(cr,{mark:Be?.Mark??Me}),h("h2",{className:"sc-h",id:G,children:"Approved. Waiting for it to connect"}),h("p",{className:"sc-p",children:"Nothing more to do here. This page changes when it arrives."}),$>0&&R-$>Oi&&T("ol",{className:"sc-stall",children:[me==="app"?T(tt,{children:[h(ur,{done:!0,title:"Soba Connect opened",line:"On this machine"}),h(ur,{done:!0,title:"You approved it",line:"In Soba Connect"})]}):h(ur,{done:!0,title:"You approved the code",line:"On this page"}),h(ur,{title:`Still nothing from ${D?.hostname??"that machine"}`,line:"Look at Soba Connect on that machine: it says what it is doing. This keeps watching either way.",children:h("button",{type:"button",className:"sc-btn sc-stall-act",onClick:()=>void On(),children:"Open Soba Connect"})})]})]}),y==="connected"&&T("div",{className:"sc-card",children:[h(uo,{tone:"ok"}),h("h2",{className:"sc-h",id:G,children:Ce?.label?`${Ce.label} is connected`:"Connected"}),T("p",{className:"sc-p",children:[h(lr,{context:v})," will use ",Ce?.label?"it":"this machine"," from now on, while it is awake."]}),o&&T(tt,{children:[Ce&&h(Di,{machine:Ce}),h("button",{type:"button",className:"sc-btn sc-btn-primary sc-btn-wide",style:{marginTop:14},onClick:pn,children:"Done"})]})]}),y==="hosted"&&T("div",{className:"sc-card",children:[T("div",{className:"sc-head",children:[h(nt,{onClick:()=>f("choose")}),h("p",{className:"sc-head-title",children:"ChatGPT"})]}),B?h(cr,{mark:Bn,still:!0}):h(cr,{mark:Bn}),h("h2",{className:"sc-h",id:G,children:B?"Your browser blocked the window":"Finish signing in to ChatGPT"}),h("p",{className:"sc-p",children:B?"Nothing opened. Open the sign-in yourself below. A link you click is allowed where a window we open is not.":"Approve it in the window that opened."}),T("div",{className:"sc-stack",style:{marginTop:18},children:[B&&h("a",{className:"sc-btn sc-btn-primary",href:B,target:"soba-connect-plan",rel:"noreferrer",children:"Open the ChatGPT sign-in"}),U&&h("p",{className:"sc-error",children:U}),I>0&&R-I>Ti&&h("p",{className:"sc-note sc-tone-warn",children:"Still nothing. The window may have been closed before it finished, or the sign-in may have been declined. This keeps watching either way."})]})]}),y==="hosted_connected"&&T("div",{className:"sc-card",children:[h(uo,{tone:"ok"}),h("h2",{className:"sc-h",id:G,children:"ChatGPT is connected"}),T("p",{className:"sc-p",children:[h(lr,{context:v})," will run on your ChatGPT plan",u[0]?.account_label?` (${u[0].account_label})`:"",". Nothing more to pay, nothing to install."]}),h("p",{className:"sc-opt-note",style:{textAlign:"center"},children:"It runs on our side, so it has no access to your files or your terminal."}),o&&T(tt,{children:[h("button",{type:"button",className:"sc-btn sc-btn-wide",style:{marginTop:16},onClick:pn,children:"Done"}),h("div",{className:"sc-opt-alt",children:h("button",{type:"button",className:"sc-alt-link",onClick:()=>f("choose"),children:"Connect a machine too"})})]})]}),y==="denied"&&T("div",{className:"sc-card",children:[h(uo,{tone:"off"}),h("h2",{className:"sc-h",id:G,children:"Declined"}),h("p",{className:"sc-p",children:Te==="machine"?"Nothing was connected. You can ask again whenever you like.":"That machine was not attached to your account, and the terminal has been told so."}),h("button",{type:"button",className:"sc-btn sc-btn-wide",style:{marginTop:16},onClick:()=>f("choose"),children:"Back to the start"})]})]})}function Ps(e){return e?.app.name??"this app"}function Gi(e){let n=e?.app.icon_urls;if(n?.length)return n;let t=e?.app.icon_url;return t?[t]:[]}function Rs(e){let n=Gi(e),[t,r]=ce([]),o=Ne(c=>{c&&r(i=>i.includes(c)?i:[...i,c])},[]),a=Ne(c=>o(c.currentTarget.getAttribute("src")),[o]),s=Ne(c=>{c?.complete&&c.naturalWidth===0&&o(c.getAttribute("src"))},[o]);return{icon:n.find(c=>!t.includes(c)),onError:a,ref:s}}function Wi({context:e}){let{icon:n,onError:t,ref:r}=Rs(e);return e?.app.mark==="soba"?h(Me,{className:"sc-app-mark"}):n?h("img",{className:"sc-app-mark",src:n,alt:"","aria-hidden":"true",ref:r,onError:t}):null}function lr({context:e}){let{icon:n,onError:t,ref:r}=Rs(e),o=e?.app.mark==="soba";return T("span",{className:"sc-app",children:[o&&h(Me,{className:"sc-app-icon"}),!o&&n&&h("img",{className:"sc-app-icon",src:n,alt:"",ref:r,onError:t}),Ps(e)]})}function nt({onClick:e}){return h("button",{type:"button",className:"sc-head-back",onClick:e,"aria-label":"Back",children:h("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:h("path",{d:"M15 5 8 12l7 7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}function co({className:e}){return h("svg",{className:e,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:h("path",{d:"M9 5l7 7-7 7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function cr({mark:e,still:n}){return T("span",{className:"sc-waiting","aria-hidden":"true",children:[!n&&h("svg",{className:"sc-waiting-orbit",viewBox:"0 0 100 100","aria-hidden":"true",focusable:"false",children:h("circle",{className:"sc-waiting-arc",cx:"50",cy:"50",r:"46"})}),h(e,{className:"sc-waiting-mark"})]})}function uo({tone:e}){return h("span",{className:`sc-result sc-result-${e}`,"aria-hidden":"true",children:h(mn,{kind:e==="ok"?"snap":"gone",size:84})})}function Di({machine:e}){let{runtime:n}=Fe(e);if(!n)return null;let t=Ke(n);return T("div",{className:"sc-arrived",children:[h(Xr,{id:n.id,name:n.display_name}),h("span",{className:"sc-arrived-name",children:n.display_name}),T("span",{className:`sc-arrived-auth${t.tone==="warn"?" sc-tone-warn":""}`,children:[t.tone==="ok"&&h("i",{className:"sc-arrived-dot","aria-hidden":"true"}),t.tone==="ok"?"Signed in":t.tone==="warn"?"Signed out":"Could not tell"]})]})}function ur({done:e,title:n,line:t,children:r}){return T("li",{className:"sc-stall-step",children:[T("svg",{viewBox:"0 0 20 20",className:e?"sc-stall-ok":"sc-stall-open","aria-hidden":"true",children:[h("circle",{cx:"10",cy:"10",r:"9"}),e?h("path",{d:"M6 10.3 8.7 13 14 7.5"}):T(tt,{children:[h("path",{d:"M10 5.5v5.5"}),h("circle",{className:"sc-stall-pt",cx:"10",cy:"14.3",r:"1.2"})]})]}),h("span",{className:"sc-stall-title",children:n}),h("span",{className:"sc-stall-line",children:t}),r&&h("span",{className:"sc-stall-more",children:r})]})}function Hi({text:e}){return h(tt,{children:e.split("`").map((n,t)=>t%2===1?h("code",{className:"sc-inline-code",children:n},t):n)})}function Pt({k:e,v:n}){return T("li",{className:"sc-fact",children:[h("span",{className:"sc-fact-key",children:e}),h("span",{children:n})]})}import{forwardRef as Ui}from"react";import{jsx as mo,jsxs as fo}from"react/jsx-runtime";var ho=Ui(function({machine:n,className:t,...r},o){if(!n)return null;let{ariaLabel:a,state:s}=Xn(n);return fo("button",{ref:o,type:"button","aria-label":a,className:["sc-btn","sc-btn-connected",t].filter(Boolean).join(" "),...r,children:[mo("span",{className:"sc-pill-tile","aria-hidden":"true",children:mo(mn,{kind:s.tone==="busy"?"serving":s.tone==="ok"?"ready":n.pairing_lost?"gone":"paused",size:16,className:"sc-pill-mark"})}),fo("span",{className:"sc-btn-connected-text",children:[s.word,!n.pairing_lost&&fo("span",{className:"sc-btn-connected-where",children:[" on ",le(n)]})]}),mo("i",{className:`sc-dot sc-dot-${s.tone}`,"aria-hidden":"true"})]})});function Es(e){if(e.type==="boolean")return e.name;if(e.type==="text")return`${e.name}: ${String(e.value??"").trim()}`;let n=e.unit?.trim()||e.name.toLowerCase();if(e.price){let r=Fi(e.price.amountMicros),o=n.endsWith("s")?n.slice(0,-1):n,a=e.price.included>0?`${e.price.included.toLocaleString("en-US")} ${n} included, then ${r} per ${o}`:`${r} per ${o}`;return e.value===null?a:`${a}, up to ${e.value.toLocaleString("en-US")}`}let t=e.resets==="month"?" a month":"";return e.value===null?`Unlimited ${n}${t}`:`${e.value.toLocaleString("en-US")} ${n}${t}`}var Fi=e=>(e/1e6).toLocaleString("en-US",{style:"currency",currency:"USD"});function dr(e){let n=[];for(let t of e??[])!t.name?.trim()&&!t.unit?.trim()||n.push({text:Es(t),included:!(t.type==="boolean"&&t.value!==!0)});return n}function go(e,n,t=1){let r=e.quantities?.[n]??0,o=(i,l=null)=>({feature:n,allowed:!1,reason:i,limit:l,used:r,remaining:l===null?null:Math.max(0,l-r),unlimited:!1});if(e.features===null)return o("no_plan");if(e.ended)return o("plan_ended",0);if(!(n in e.features))return o("not_included");let a=e.features[n];if(typeof a=="string")return a.trim()?{feature:n,allowed:!0,reason:null,limit:null,used:0,remaining:null,unlimited:!1}:o("not_included");if(typeof a=="boolean")return a?{feature:n,allowed:!0,reason:null,limit:null,used:0,remaining:null,unlimited:!1}:o("not_included");if(a==null)return{feature:n,allowed:!0,reason:null,limit:null,used:r,remaining:null,unlimited:!0};let s=Math.max(0,t),c=Math.max(0,a-r);return a===0?o("not_included",0):r+s>a?o("limit_reached",a):{feature:n,allowed:!0,reason:null,limit:a,used:r,remaining:c,unlimited:!1}}import{useEffect as zi,useRef as Ao}from"react";var pr=0,bo=null;function Is(){if(typeof document>"u")return()=>{};pr===0&&(bo=document.body.style.overflow,document.body.style.overflow="hidden"),pr+=1;let e=!1;return()=>{e||(e=!0,pr-=1,pr===0&&(document.body.style.overflow=bo??"",bo=null))}}import{jsx as Ls}from"react/jsx-runtime";function Rt({open:e,onClose:n,labelledBy:t,theme:r,style:o,children:a}){let s=Ao(null),c=Ao(null),i=Ao(null);return zi(()=>{let l=s.current;if(l){if(!e){l.open&&l.close();return}return l.open||l.showModal(),document.activeElement===l&&c.current?.focus(),Is()}},[e]),Ls("dialog",{ref:s,className:"soba-connect sc-modal","aria-labelledby":t,...r?{"data-theme":r}:{},style:o,onCancel:l=>{l.preventDefault(),n()},onPointerDown:l=>{i.current=l.target},onClick:l=>{l.target===l.currentTarget&&i.current===l.currentTarget&&n()},children:Ls("div",{className:"sc-modal-sheet",ref:c,tabIndex:-1,children:a})})}import{useEffect as yo,useRef as Vi}from"react";import{jsx as Qi}from"react/jsx-runtime";var Wn=8;function wo({open:e,onClose:n,anchor:t,label:r,theme:o,style:a,children:s}){let c=Vi(null);return yo(()=>{let i=c.current;if(!(!i||!(typeof i.showPopover=="function")))try{e?i.showPopover():i.hidePopover()}catch{}},[e]),yo(()=>{if(!e)return;let i=()=>{let d=c.current,g=t.current;if(!d||!g)return;let b=g.getBoundingClientRect(),y=d.offsetWidth,f=d.offsetHeight,v=window.innerWidth-y-Wn,A=Math.max(Wn,Math.min(b.right-y,Math.max(Wn,v))),k=b.bottom+Wn,S=b.top-Wn-f,W=k+f>window.innerHeight-Wn&&S>Wn?S:k;d.style.left=`${Math.round(A)}px`,d.style.top=`${Math.round(W)}px`};i();let l=requestAnimationFrame(i);return window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{cancelAnimationFrame(l),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[e,t]),yo(()=>{if(!e)return;let i=d=>{d.key==="Escape"&&n()},l=d=>{let g=d.target;g&&(c.current?.contains(g)||t.current?.contains(g)||n())};return document.addEventListener("keydown",i),document.addEventListener("pointerdown",l,!0),()=>{document.removeEventListener("keydown",i),document.removeEventListener("pointerdown",l,!0)}},[e,n,t]),Qi("div",{ref:c,role:"dialog","aria-label":r,className:"soba-connect sc-pop",...o?{"data-theme":o}:{},popover:"manual",hidden:!e,style:a,children:s})}var Et=new Map,rt=new Map,Os=!1;function Ji(){Os||typeof window>"u"||(Os=!0,window.addEventListener("storage",e=>{!e.key||!Et.has(e.key)||(rt.set(e.key,ar(e.key)),vo(e.key))}))}function vo(e){for(let n of Et.get(e)??[])n()}function It(e){return e??""}function ko(e,n){let t=It(e);Ji();let r=Et.get(t)??new Set;return r.add(n),Et.set(t,r),()=>{r.delete(n),r.size===0&&Et.delete(t)}}function mr(e){let n=It(e),t=rt.get(n);if(t!==void 0)return t;let r=e?ar(e):null;return rt.set(n,r),r}function Co(){return null}function Mo(e,n){mr(e)===null&&(rt.set(It(e),n),vo(It(e)))}function No(e,n){let t=It(e);rt.get(t)!==n&&(rt.set(t,n),ro(e,n),vo(t))}var Yi=e=>e.toLocaleString("en-US");function Oe(e,n){if(e==="cost")return`${(n/1e4).toLocaleString("en-US",{style:"currency",currency:"USD"})} of usage`;let t=e==="token"?"token":e;return`${Yi(n)} ${t}${n===1?"":"s"}`}function Dn(e){return e==="token"?"1M tokens":e==="cost"?"$1 of usage":e==="credit"?"1,000 credits":e}function Lt(e){return e==="cost"?"usage":`${e}s`}function Ot(e,n,t){let r=t?.trim();if(!r||e!=="run"&&e!=="task"&&e!=="message")return Oe(e,n);let o=r.endsWith("s")?r.slice(0,-1):r;return`${n.toLocaleString("en-US")} ${n===1?o:r}`}function sn(e){return e.reward==="included"&&e.includedUnits!==null?`${Oe(e.unit,e.includedUnits)} a month once you connect`:e.reward==="credit"&&e.creditMicros>0?`${ji(e.creditMicros)} back each month you stay connected`:null}function an(e){return e==="included"}function Hn(e){return e.routePrefer.some(n=>xo.has(n)||n==="user-api-key")?e.ownIncludedUnits===null?e.includedUnits!==null?`Unlimited ${e.unit==="cost"?"usage":(e.unit==="run"||e.unit==="task")&&e.taskNoun?.trim()?e.taskNoun.trim():`${e.unit}s`} on your own AI`:null:`${Ot(e.unit,e.ownIncludedUnits,e.taskNoun)} a month on your own AI`:null}var xo=new Set(["user-hardware","user-subscription"]),Ts=new Set(["open-weights","frontier"]);function Ve(e){return e===null||e.length===0?!1:e.every(n=>xo.has(n))}var ji=e=>(e/1e6).toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2});function So(e,n){if(!(n===null||n.some(a=>Ts.has(a))))return!1;let r=e.findIndex(a=>xo.has(a));if(r===-1)return!1;let o=e.findIndex(a=>Ts.has(a));return o===-1||r<o}import{createContext as Bs,useContext as Gs}from"react";var Po=Bs(null);function ot(){return Gs(Po)}var Ro=Bs({context:null,machines:void 0,theme:"light"});function te(){return Gs(Ro)}import{useMemo as Xi}from"react";import{createContext as qi,useContext as Zi}from"react";var Eo=qi(null);function _(){let e=Zi(Eo);if(!e)throw new Error("useSoba() must be used inside a <SobaProvider>.");return e}function Tt(){let{compute:e}=_();return Xi(()=>{let n=e.machines,t=[...n].sort((a,s)=>_e([a,s])===a?-1:1).map(Ki),r=_e([...n]),o=En(n);return{view:t.length?"machines":e.loading?"loading":e.error?"error":"empty",machines:t,primary:r?t.find(a=>a.machine.id===r.id)??null:null,connected:e.connected,online:e.online,stalled:e.connected&&!e.online&&o?t.find(a=>a.machine.id===o.id)??null:null,loading:e.loading,error:e.error,refresh:e.refresh}},[e])}function Ki(e){let n=Fe(e);return{machine:e,name:le(e),state:In(e),status:Cr(e),hardware:gt(e),lastSeen:e.state==="offline"?bt(e.last_seen_at):null,runtimes:we(e).map(t=>({runtime:t,name:t.display_name,auth:Ke(t),quarantined:!!t.quarantined})),runsOn:{by:n.by,name:n.runtime?.display_name??null}}}import{useCallback as Io,useEffect as _i,useMemo as Qe,useSyncExternalStore as $i}from"react";function Un(e={}){let{compute:n,connect:t,models:r}=_(),{value:o,onChange:a,defaultValue:s,remember:c=!0,user:i}=e,l=e.layout??(e.choices?.length?"choices":r.layout??"providers"),d=JSON.stringify(e.choices??[]),g=o!==void 0,b=c&&!g?to(t.publishableKey,i):null,y=Io(R=>ko(b,R),[b]),f=$i(y,Io(()=>mr(b),[b]),Co),v=Qe(()=>r.rowsByLayout[l]??(r.sizes===!1?{auto:!0,fast:!1,best:!1}:void 0),[r.rowsByLayout,r.sizes,l]),A=Qe(()=>Or(wt(n.machines,r.providers,r.names,r.route?.allow),v),[n.machines,r.providers,r.names,r.route,v]),k=Qe(()=>Lr(A,l,JSON.parse(d)),[A,l,d]),S=Qe(()=>Tr(k,l,v),[k,l,v]),W=l==="models"&&v?.own===!0,L=Qe(()=>vt(S,l,W),[S,l,W]),D=Qe(()=>[...A,...k.filter(R=>!A.some(q=>q.id===R.id))],[A,k]),O=Qe(()=>{let R=[];for(let V of[...n.machines].sort(Zn))for(let Z of we(V)){if(R.some(Y=>Y.id===Z.id)||r.route&&!r.route.allow.includes(Z.cost_class))continue;let be=$e[Z.id];R.push({id:Z.id,name:Z.display_name,...be?{logo:be}:{},options:S.filter(Y=>Y.kind==="named"&&Y.runtime===Z.id)})}let q=L.flatMap(V=>V.options.map(Z=>Z.id));for(let V of R)V.options.sort((Z,be)=>q.indexOf(Z.id)-q.indexOf(be.id));return R},[n.machines,S,L,r.route]),U=Qe(()=>r.providers.map(R=>{let q=`@${R.id}/`;return{id:R.id,name:R.name,...R.provider?{mark:R.provider}:{},costClass:R.cost_class,...R.locked?{locked:R.locked}:{},options:A.filter(V=>V.id.startsWith(q))}}),[r.providers,A]);_i(()=>{g||!s||Mo(b,s)},[g,s,b]);let w=Qe(()=>{let R=r.names.find(q=>q.default);if(R&&l==="choices")return`alias:${R.alias}`;for(let q of r.providers){let V=q.models.find(Z=>Z.default);if(V&&l!=="choices")return`@${q.id}/${V.model}`}return null},[r.names,r.providers,l]),K=g?o:l==="automatic"?s??null:f??s??w,j=Qe(()=>S.some(R=>R.kind==="auto")?null:L.flatMap(R=>R.options).find(R=>!R.locked)?.id??null,[S,L]),$=!K||K==="auto"?j??K:K,{selected:ae,unavailable:me}=Qe(()=>Br(D,$??null),[D,$]),fe=Io(R=>{g||No(b,R),a?.(R)},[g,b,a]);return{options:S,groups:L,selected:ae,select:fe,agents:O,providers:U,models:A.filter(R=>R.kind==="provider"),choices:S.filter(R=>R.choice!==void 0),layout:l,ownInList:W,search:v?.search!==!1,run:Gr(ae),unavailable:me,pickable:gn(S),loading:n.loading&&!n.machines.length||r.loading&&!r.providers.length&&!n.machines.length}}function el(e){return e.runtime?$e[e.runtime]:void 0}import{jsx as Bt}from"react/jsx-runtime";function nl({className:e}){let{theme:n}=te(),t=e?`soba-connect ${e}`:"soba-connect";return Bt("div",{className:t,"data-theme":n,children:Bt(Lo,{})})}function Lo(){let e=Tt(),n=Un();return e.view==="loading"?Bt("p",{className:"sc-note",children:"Loading\u2026"}):e.view==="error"?Bt("p",{className:"sc-error",children:e.error?.message}):Bt(Kr,{machines:e.machines.map(t=>t.machine),model:n.selected,onPickModel:n.select})}import{useCallback as Wt,useEffect as Go,useMemo as cl,useRef as Wo,useState as at}from"react";import{useId as tl}from"react";import{jsx as st,jsxs as fr}from"react/jsx-runtime";function Gt({open:e,onOpenChange:n,initialCode:t,onConnected:r,showStatus:o,reason:a}){let{error:s}=_(),c=ot(),i=te(),l=()=>n(!1),d=tl(),g=i.context?.background?.trim(),b=g?Rn(g,i.context?.accent):void 0;return fr(Rt,{open:e,onClose:l,labelledBy:d,theme:i.theme,style:b,children:[s?fr("div",{className:"sc-card",children:[st("h2",{className:"sc-title",id:d,children:"Could not start"}),st("p",{className:"sc-error",children:s.message})]}):!c&&!i.context?fr("div",{className:"sc-card",children:[st("h2",{className:"sc-title",id:d,children:"One moment"}),st("p",{className:"sc-note",children:"Getting your compute\u2026"})]}):st(po,{client:c,active:e,onClose:l,headingId:d,theme:i.theme,initialContext:i.context,...i.machines!==void 0?{initialMachines:i.machines}:{},...t?{initialCode:t}:{},...r?{onConnected:r}:{},...o===void 0?{}:{showStatus:o},...a?{reason:a}:{}}),fr("p",{className:"sc-modal-foot",children:[st(Me,{className:"sc-foot-mark"}),"Secured by Soba"]})]})}import{forwardRef as rl}from"react";import{jsx as ol}from"react/jsx-runtime";var Oo=rl(function(n,t){let{theme:r}=te();return ol(ho,{ref:t,"data-theme":r,...n})});import{useCallback as sl}from"react";function al(){let{connect:e}=_(),n=Tt(),t=sl(()=>e.open("manual"),[e]);return{...Xn(n.primary?.machine??null),machine:n.primary,open:t,canOpen:e.hasModal,loading:n.view==="loading"}}function To(e){return Xn(e)}import{useCallback as Ws,useEffect as il,useState as ll}from"react";function Bo({enabled:e=!0,intervalMs:n=3e3}={}){let t=ot(),[r,o]=ll(null),a=Ws(async()=>{t&&o(await t.runs())},[t]);il(()=>{if(!e||!t)return;let c=!0,i=He(async()=>{let l=await t.runs();c&&o(l)},n);return()=>{c=!1,i()}},[e,t,n]);let s=Ws(async c=>{if(!t)throw new Error("Stopping a run needs <SobaProvider>.");await t.stopRun(c),await a().catch(()=>{})},[t,a]);return{runs:r,refresh:a,stop:s}}import{Fragment as Ds,jsx as it,jsxs as Hs}from"react/jsx-runtime";function Fn({children:e,variant:n,className:t,initialCode:r,onConnected:o,defaultOpen:a,open:s,onOpenChange:c,showConnected:i=!0}){let{compute:l,connect:d}=_(),g=te(),{theme:b}=g,y=ot(),[f,v]=at(a??!!r),A=Wo(null),k=s!==void 0,S=!k&&!a&&!r&&d.hasModal,W=k?s:S?d.isOpen:f,L=N=>{S?N?d.open("manual"):d.close():k||v(N),c?.(N)},D=Wo(W);Go(()=>{D.current&&!W&&A.current?.focus(),D.current=W},[W]);let[O,U]=at(!1),{runs:w,stop:K}=Bo({enabled:O}),j=Un(),$=cl(()=>O&&w?ul(l.machines,w):l.machines,[l.machines,O,w]),ae=_e($),me=i&&To(ae).connected,fe=Wt(()=>U(!1),[]),[R,q]=at(!1),V=Wt(async()=>{q(!0);try{await l.refresh()}finally{q(!1)}},[l]),Z=Wo(V);Z.current=V,Go(()=>{O&&Z.current()},[O]);let[be,Y]=at(!1),[he,Ae]=at([]),Te=!!g.context?.hosted_available;Go(()=>{if(!O||!y||!Te)return;let N=!0;return y.hosted().then(H=>{N&&Ae(H.credentials)}).catch(()=>{}),()=>{N=!1}},[O,y,Te]);let[Re,ee]=at(null),de=Wt(async(N,H)=>{if(y){ee(null);try{await y.approveRuntime(N,H),await l.refresh()}catch(ie){ee(ie.message)}}},[y,l]),u=Wt(async(N,H)=>{if(y){ee(null);try{await y.preferRuntime(N,H),await l.refresh()}catch(ie){ee(ie.message)}}},[y,l]),P=Wt(async N=>{if(y){ee(null);try{await y.disconnectHosted(N),Ae((await y.hosted()).credentials)}catch(H){ee(H.message)}}},[y]),I=g.context?.background?.trim(),J=I?Rn(I,g.context?.accent):void 0,B=me&&!e,ne=()=>{if(B&&!k&&!a&&!r){U(N=>!N);return}L(!0)};return Hs(Ds,{children:[B?it(Oo,{ref:A,machine:ae,"aria-haspopup":"dialog","aria-expanded":O,onClick:ne,...t?{className:t}:{}}):it("button",{ref:A,type:"button","data-theme":b,className:["sc-btn","sc-btn-icon",n==="primary"?"sc-btn-primary":"",t].filter(Boolean).join(" "),onClick:ne,children:e??Hs(Ds,{children:[it(Me,{className:"sc-btn-mark"}),"Connect compute"]})}),it(wo,{open:O,onClose:fe,anchor:A,label:"Your compute",theme:b,...J?{style:J}:{},children:it(Gn,{machines:$,hosted:he,onApproveRuntime:(N,H)=>void de(N,H),onPreferRuntime:(N,H)=>void u(N,H),onDisconnectHosted:N=>void P(N),onRefresh:()=>void V(),refreshing:R,model:j.selected,onPickModel:j.select,error:Re,runs:w,onStopRun:async N=>{ee(null);try{await K(N)}catch(H){throw ee(H.message),H}},onPair:()=>{U(!1),S?d.open("pair"):(Y(!0),L(!0))},...g.context?.app.name?{appName:g.context.app.name}:{}})}),!S&&it(Gt,{open:W,onOpenChange:N=>{N||Y(!1),L(N)},...be?{showStatus:!1}:{},...r?{initialCode:r}:{},...o?{onConnected:o}:{}})]})}function ul(e,n){return e.map(t=>{if(t.state==="offline")return t;let r=n.filter(o=>o.machine_id===t.id).length;return{...t,active:r,state:r>0?"busy":"online"}})}import{jsx as Do,jsxs as pl}from"react/jsx-runtime";function dl({initialCode:e,onConnected:n,className:t,showStatus:r=!0}){let{theme:o}=te();return pl("div",{className:t?`soba-connect ${t}`:"soba-connect","data-theme":o,children:[r&&Do(Lo,{}),Do("div",{className:"sc-compute-act",children:Do(Fn,{...e?{initialCode:e}:{},...n?{onConnected:n}:{}})})]})}import{useId as Ml,useState as Nl}from"react";import{useCallback as Uo,useEffect as Qs,useState as Js}from"react";import{useCallback as ml,useState as fl}from"react";function Dt(){let[e,n]=fl(null);return{open:ml(()=>{n(null),On().then(n)},[]),launch:e,note:e==="absent"?"Nothing opened here. That machine may be a different computer, or asleep.":null}}import{useCallback as Us,useMemo as Fs}from"react";function zn(e){if(!e)return null;if(typeof e=="string")return e;if(typeof Response<"u"&&e instanceof Response)return zs(e.status);let n=e,t=n.error;return typeof t?.code=="string"?t.code:typeof t?.type=="string"?t.type:typeof n.code=="string"?n.code:typeof n.status=="number"?zs(n.status):n.cause&&n.cause!==e?zn(n.cause):null}function zs(e){return e===402?"payment_required":e===409?"no_compute":null}function Ho(...e){let[n,t]=e,{plan:r,compute:o,connect:a}=_(),s=t?.predict??e.length===0,c=gl(hl(n),o)??(s?bl(r,o):null),i=r.plan,l=r.plans,d=Fs(()=>{if(c!=="payment_required")return null;let f=i?.price??0,v=i?.included_units??0;return l.find(A=>A.id!==i?.id&&A.price>f&&(A.included_units===null||A.included_units>v))??null},[c,l,i]),g=Us(async()=>{if(!d)return;if(d.selectable){await r.select(d.id);return}let f=await r.checkout(d.id);window.location.assign(f)},[d,r]),b=a.open,y=Us(()=>{c&&b(c)},[b,c]);return Fs(()=>{if(!c)return null;let f=i?sn({unit:i.unit,reward:i.connected_reward,includedUnits:i.connected_included_units,creditMicros:i.connected_credit*1e6}):null,v=i?an(i.connected_reward)?f:Hn({unit:i.unit,includedUnits:i.included_units,ownIncludedUnits:i.own_included_units??null,routePrefer:i.route_prefer}):null;return{reason:c,...Al(c,{connectOffer:v,connected:o.connected,online:o.online,machine:En(o.machines)?.label??null,unit:i?.unit??"message",interval:i?.interval??"month",upgrade:d!==null,resets:r.current?.period_end??null}),connectOffer:v,upgradeTo:d,connect:y,upgrade:g}},[c,i,o,d,y,g,r.current?.period_end])}function hl(e){let n=zn(e);return n==="payment_required"||n==="no_compute"?n:null}function gl(e,n){return e==="no_compute"&&n.connected&&n.online?null:e}function bl(e,n){let t=e.plan;return!t||n.loading?null:Ve(t.route_allow)&&!n.online?"no_compute":e.remaining===0&&t.overage==="stop"?"payment_required":null}function Al(e,n){if(e==="payment_required"){let t=`No ${Lt(n.unit)} left this ${n.interval}`;return n.connectOffer&&!n.connected?{title:t,body:`${n.connectOffer}. Connecting takes a minute and costs nothing.`}:n.connectOffer&&!n.online?{title:t,body:`${n.connectOffer}. Waking ${n.machine??"your machine"} is enough.`}:n.upgrade?{title:t,body:n.resets?`A larger plan carries on now. This one comes back on ${Vs(n.resets)}.`:"A larger plan carries on now, or wait for this one to renew."}:{title:t,body:n.resets?`Your allowance comes back on ${Vs(n.resets)}.`:"Your allowance comes back at the start of the next period."}}return n.connected&&!n.online?{title:`${n.machine??"Your machine"} can't be reached`,body:"This run needs it awake and connected. Open Soba on that machine, or connect another one."}:{title:"Nothing connected yet",body:"This app runs on AI you already pay for, on a machine of your own. Connect one and this run has somewhere to go."}}function Vs(e){let n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function yl(e){let{plan:n,allowance:t,connected:r,online:o,quiet:a,error:s,predict:c,at:i,waved:l}=e;if(!n)return null;let d=e.allow!==void 0?e.allow:n.route_allow;if(r){if(o)return null;let v=Ve(d);return{reason:"stalled",title:`${a??"Your machine"} can\u2019t be reached`,detail:v?"The Soba app there has stopped reporting in, so runs have nowhere to go until it is back.":"The Soba app there has stopped reporting in, so nothing will run on your own AI until it is back.",meter:null,dismissible:!1,atTheWall:!1,ownCompute:v}}let g=zn(s),b=g==="payment_required"||g==="no_compute",y=n.ask_to_connect!==!1&&So(n.route_prefer,d);if(!c&&!b&&!y)return null;let f=Ve(d)?wl(n.unit,Ve(n.route_allow)):an(n.connected_reward)||Ys(n,t.included)!==null?kl(t,n,i):y?vl(n.unit):null;return!f||f.dismissible&&l?null:{...f,dismissible:!!f.dismissible,ownCompute:!1,atTheWall:!f.dismissible&&(!c||f.meter!==null&&f.meter.left===0)}}function Fo(e={}){let{at:n=.25,error:t,allow:r}=e,o=e.predict??!(e.errorGiven??t!==void 0),{plan:a,compute:s,connect:c}=_(),i=oo(c.publishableKey),[l,d]=Js(!1);Qs(()=>{d(so(i))},[i]);let g=Uo(()=>{d(!0),ao(i)},[i]),b=Uo(()=>c.open("manual"),[c]),y=Uo(()=>c.open("no_compute"),[c]),f=Dt(),[v,A]=Js(!1),{refresh:k}=s,{launch:S}=f;Qs(()=>{if(S===null||S==="absent")return;A(!1);let U=setInterval(()=>void k(),3e3),w=setTimeout(()=>{clearInterval(U),A(!0)},2e4);return()=>{clearInterval(U),clearTimeout(w)}},[S,k]);let W=Cl(c.app?.name,St(c.connectUrl)),L=a.loading||s.loading,D=En(s.machines),O=L?null:yl({plan:a.plan,allowance:{remaining:a.remaining,included:a.included},connected:s.connected,online:s.online,quiet:D?le(D):null,error:t,predict:o,...r!==void 0?{allow:r}:{},at:n,waved:l});return{reason:O?.reason??null,visible:O!==null,title:O?.title??null,detail:O?.detail??null,meter:O?.meter??null,dismissible:O?.dismissible??!1,dismissed:l,dismiss:g,open:b,atTheWall:O?.atTheWall??!1,steps:W,stalled:O?.reason==="stalled"?{machine:D?le(D):null,ownCompute:O.ownCompute,wake:f.open,launch:f.launch,note:f.note,stuck:v,connectAnother:y}:null,loading:L}}function wl(e,n){return{reason:"needed",title:n?"This plan runs on your own AI.":`These ${e}s run on your own AI.`,detail:`Connect a machine and your ${e}s run there, free, on access you already have.`,meter:null}}function vl(e){return{reason:"preferred",title:"This plan prefers your own AI.",detail:`Connect a machine and your ${e}s run there instead, on access you already have.`,meter:null,dismissible:!0}}function Ys(e,n){return Hn({unit:e.unit,includedUnits:n,ownIncludedUnits:e.own_included_units??null,routePrefer:e.route_prefer})}function kl(e,n,t){let{remaining:r,included:o}=e;if(r===null||o===null||o===0||r>Math.ceil(o*t))return null;let a=sn({unit:n.unit,reward:n.connected_reward,includedUnits:n.connected_included_units,creditMicros:n.connected_credit*1e6})??Ys(n,o);return a?{reason:"running",title:r===0?`No ${Lt(n.unit)} left this month.`:`${Oe(n.unit,r)} left this month.`,detail:`${a}.`,meter:{left:r,of:o}}:null}function Cl(e,n){return[{lead:"Download Soba",detail:"",...n?{linksLead:"Get it for"}:{},links:n?xt.map(t=>({label:t.label,href:`${n}/download/${t.slug}`})):[]},{lead:"Connect compute",detail:"Press this, then approve the pairing when the app asks.",opens:!0,links:[]},{lead:"Let your AIs serve",detail:`It finds what is installed on that machine. Allow one, and ${e??"this app"} sends every run there.`,linksLead:"Nothing on it yet?",links:Ie.map(t=>({label:t.short,href:t.install}))}]}import{Fragment as qs,jsx as re,jsxs as wn}from"react/jsx-runtime";function xl(e){let{className:n,fallback:t=null}=e,r=Fo({...e.at===void 0?{}:{at:e.at},...e.predict===void 0?{}:{predict:e.predict},...e.allow===void 0?{}:{allow:e.allow},error:e.error,errorGiven:"error"in e}),{connect:o}=_(),{theme:a}=te(),[s,c]=Nl(null),i=Ml(),l=re(qs,{children:t});if(!r.visible)return l;if(r.stalled)return re(js,{className:n,theme:a,stalled:!0,children:re(Sl,{title:r.title??"",detail:r.detail??"",stalled:r.stalled})});let d=s??r.atTheWall;return wn(js,{className:n,theme:a,children:[wn("div",{className:"sc-nudge-top",children:[wn("div",{className:"sc-nudge-say",children:[re("p",{className:"sc-nudge-title",children:r.title}),re("p",{className:"sc-nudge-detail",children:r.detail}),wn("button",{type:"button",className:"sc-btn sc-btn-quiet sc-nudge-more","aria-expanded":d,"aria-controls":i,onClick:()=>c(!d),children:[d?"Hide the details":"How it works",re(Rl,{})]})]}),r.dismissible?re("button",{type:"button",className:"sc-nudge-dismiss","aria-label":"Dismiss",title:"Dismiss",onClick:r.dismiss,children:re(Pl,{})}):null]}),d?re("ol",{className:"sc-nudge-steps",id:i,children:r.steps.map(g=>wn("li",{children:[g.opens?re("button",{type:"button",className:"sc-step-lead",onClick:()=>o.open("manual"),children:g.lead}):re("strong",{children:g.lead}),g.detail?re("span",{children:g.detail}):null,g.links.length>0?wn("span",{className:"sc-step-links",children:[g.linksLead,g.links.map(b=>re("a",{href:b.href,target:"_blank",rel:"noreferrer noopener",children:b.label},b.href))]}):null]},g.lead))}):null,re(Fn,{variant:"primary"})]})}function js({className:e,theme:n,stalled:t,children:r}){return re("div",{className:e?`soba-connect sc-fill ${e}`:"soba-connect sc-fill","data-theme":n,children:re("div",{className:t?"sc-nudge sc-nudge-stalled":"sc-nudge",children:r})})}function Sl({title:e,detail:n,stalled:t}){return wn(qs,{children:[re("div",{className:"sc-nudge-top",children:wn("div",{className:"sc-nudge-say",children:[re("p",{className:"sc-nudge-title",children:e}),re("p",{className:"sc-nudge-detail",children:n}),t.note&&re("p",{className:"sc-nudge-note",children:t.note}),t.stuck&&re("p",{className:"sc-nudge-note",children:"The Soba app is open, but this machine still isn\u2019t reporting in. It may no longer be connected to this app."}),(t.launch==="absent"||t.stuck)&&re("button",{type:"button",className:"sc-btn sc-btn-quiet sc-nudge-more",onClick:t.connectAnother,children:t.stuck?"Connect it again":"Connect another machine"})]})}),re("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:t.wake,children:"Open Soba"})]})}function Pl(){return re("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",className:"sc-nudge-x",children:re("path",{d:"m4.8 4.8 6.4 6.4M11.2 4.8l-6.4 6.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function Rl(){return re("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",className:"sc-nudge-chev",children:re("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}var El=new Set(["delta","thinking","status","done","error"]);function lt(e){let n;try{n=JSON.parse(e)}catch{return null}if(!n||typeof n!="object")return null;let t=n,r=t.type==="event"?t.event:t;if(!r||typeof r!="object")return null;let o=r;if(typeof o.type!="string"||!El.has(o.type))return null;let a={type:o.type};return typeof o.text=="string"&&(a.text=o.text),typeof o.message=="string"&&(a.message=o.message),typeof o.tool=="string"&&(a.tool=o.tool),typeof o.tier=="string"&&(a.tier=o.tier),o.usage&&typeof o.usage=="object"&&(a.usage=o.usage),typeof o.session=="string"&&(a.session=o.session),typeof o.toolInput=="string"&&(a.toolInput=o.toolInput),o.git&&typeof o.git=="object"&&(a.git=o.git),o.turn&&typeof o.turn=="object"&&typeof o.turn.text=="string"&&(a.turn={text:o.turn.text}),typeof o.reason=="string"&&(a.reason=o.reason),typeof o.retryable=="boolean"&&(a.retryable=o.retryable),(o.state==="interrupted"||o.state==="resumed")&&(a.state=o.state),a}async function*zo(e){let n=e.body;if(!n)throw new Error("That run response had no body to stream.");let t=(e.headers.get("content-type")??"").includes("ndjson"),r=n.getReader(),o=new TextDecoder,a="",s=[];try{for(;;){let i=await r.read();if(i.done)break;for(a+=o.decode(i.value,{stream:!0});;){let l=a.indexOf(`
3
+ `);if(l===-1)break;let d=Xs(a.slice(0,l));if(a=a.slice(l+1),t){let g=d.trim()?lt(d):null;g&&(yield g);continue}if(d===""){let g=s.join(`
4
+ `);if(s=[],g==="[DONE]")return;let b=g?lt(g):null;b&&(yield b);continue}Zs(d,s)}}!t&&a&&Zs(Xs(a),s);let c=t?a.trim():s.join(`
5
+ `);if(c&&c!=="[DONE]"){let i=lt(c);i&&(yield i)}}finally{r.cancel().catch(()=>{})}}function Zs(e,n){if(!e||e.startsWith(":"))return;let t=e.indexOf(":");if(t===-1||e.slice(0,t)!=="data")return;let r=e.slice(t+1);n.push(r.startsWith(" ")?r.slice(1):r)}function Xs(e){return e.endsWith("\r")?e.slice(0,-1):e}async function Il(e){let n="";for await(let t of e)if(t.type==="delta"&&t.text&&(n+=t.text),t.type==="error")throw new Error(t.message??"The run ended with an error.");return n}import{jsx as Ks}from"react/jsx-runtime";function Ll({caption:e,disabled:n,className:t,...r}){let{theme:o}=te(),{options:a,selected:s,select:c,pickable:i,layout:l,ownInList:d,search:g}=Un(r),b=_().connect.app;return i?Ks("span",{className:"soba-connect sc-inline","data-theme":o,children:Ks(Mt,{options:a,layout:l,ownInList:d,search:g,selected:s,onPick:c,...b?.name?{appName:b.name}:{},...e?{caption:e}:{},...n?{disabled:n}:{},...t?{className:t}:{}})}):null}import{jsx as Tl}from"react/jsx-runtime";function Ol(e){return Tl(Tn,{...e})}import{useEffect as Bl}from"react";var _s="data-soba-react",$s=!1;function Ht(){if($s||typeof document>"u"||($s=!0,document.querySelector(`style[${_s}]`)))return;let e=document.createElement("style");e.setAttribute(_s,""),e.textContent=`.soba-connect {
6
6
  --sc-ground: #ffffff;
7
7
  --sc-sheet: #ffffff;
8
8
  --sc-raised: #f6f6f7;
@@ -1537,6 +1537,7 @@ a.sc-btn {
1537
1537
 
1538
1538
  .sc-mp-label {
1539
1539
  min-width: 0;
1540
+ max-width: 24ch;
1540
1541
  overflow: hidden;
1541
1542
  text-overflow: ellipsis;
1542
1543
  white-space: nowrap;
@@ -1548,6 +1549,274 @@ a.sc-btn {
1548
1549
  color: var(--sc-faint, #a1a1aa);
1549
1550
  }
1550
1551
 
1552
+ .sc-mm {
1553
+ position: fixed;
1554
+ inset: auto;
1555
+ z-index: 2147483647;
1556
+ display: flex;
1557
+ flex-direction: column;
1558
+ min-width: calc(240px * var(--sc-scale, 1));
1559
+ max-width: min(calc(340px * var(--sc-scale, 1)), calc(100vw - 16px));
1560
+ width: max-content;
1561
+ margin: 0;
1562
+ padding: 0;
1563
+ overflow: hidden;
1564
+ border: 1px solid var(--sc-line, #e9e9eb);
1565
+ border-radius: calc(12px * var(--sc-scale, 1));
1566
+ background: var(--sc-tray-card, #ffffff);
1567
+ box-shadow:
1568
+ 0 12px 32px rgba(0, 0, 0, 0.12),
1569
+ 0 2px 6px rgba(0, 0, 0, 0.06);
1570
+ color: var(--sc-text, #1a1a1c);
1571
+ font-size: var(--sc-fs-small, 13px);
1572
+ line-height: 1.3;
1573
+ outline: none;
1574
+ }
1575
+
1576
+ .sc-mm-search {
1577
+ display: flex;
1578
+ flex: none;
1579
+ align-items: center;
1580
+ gap: 8px;
1581
+ padding: 0 12px;
1582
+ border-bottom: 1px solid var(--sc-line, #e9e9eb);
1583
+ color: var(--sc-faint, #a1a1aa);
1584
+ }
1585
+
1586
+ .sc-mm-find {
1587
+ flex: none;
1588
+ width: 14px;
1589
+ height: 14px;
1590
+ }
1591
+
1592
+ .sc-mm-search input {
1593
+ flex: 1;
1594
+ min-width: 0;
1595
+ height: calc(38px * var(--sc-scale, 1));
1596
+ padding: 0;
1597
+ border: 0;
1598
+ background: transparent;
1599
+ font: inherit;
1600
+
1601
+ font-size: max(16px, var(--sc-fs-small, 13px));
1602
+ color: var(--sc-text, #1a1a1c);
1603
+ outline: none;
1604
+ }
1605
+ @media (pointer: fine) {
1606
+ .sc-mm-search input {
1607
+ font-size: inherit;
1608
+ }
1609
+ }
1610
+ .sc-mm-search input::placeholder {
1611
+ color: var(--sc-faint, #a1a1aa);
1612
+ }
1613
+
1614
+ .sc-mm-list {
1615
+ flex: 1;
1616
+ min-height: 0;
1617
+ padding: 4px;
1618
+ overflow-y: auto;
1619
+ overscroll-behavior: contain;
1620
+ scroll-padding-block: 4px;
1621
+ }
1622
+
1623
+ .sc-menu,
1624
+ .sc-mm-list,
1625
+ .sc-mm-flyout {
1626
+ scrollbar-width: none;
1627
+ }
1628
+ .sc-menu::-webkit-scrollbar,
1629
+ .sc-mm-list::-webkit-scrollbar,
1630
+ .sc-mm-flyout::-webkit-scrollbar {
1631
+ display: none;
1632
+ }
1633
+
1634
+ .sc-mm-group + .sc-mm-group {
1635
+ margin-top: 4px;
1636
+ padding-top: 4px;
1637
+ border-top: 1px solid var(--sc-line, #e9e9eb);
1638
+ }
1639
+
1640
+ .sc-mm-head {
1641
+ display: flex;
1642
+ align-items: center;
1643
+ gap: 6px;
1644
+ padding: 8px 8px 4px;
1645
+ font-size: var(--sc-fs-label);
1646
+ font-weight: 500;
1647
+ color: var(--sc-muted, #6b6b73);
1648
+ }
1649
+
1650
+ .sc-mm-logo {
1651
+ flex: none;
1652
+ width: 14px;
1653
+ height: 14px;
1654
+ border-radius: 3px;
1655
+ }
1656
+
1657
+ .sc-mm-emoji {
1658
+ display: inline-grid;
1659
+ place-items: center;
1660
+ font-size: 12px;
1661
+ line-height: 1;
1662
+ }
1663
+
1664
+ .sc-mm-item {
1665
+ display: flex;
1666
+ align-items: center;
1667
+ gap: 8px;
1668
+ min-height: calc(32px * var(--sc-scale, 1));
1669
+ padding: 0 8px;
1670
+ border-radius: calc(7px * var(--sc-scale, 1));
1671
+ cursor: pointer;
1672
+ user-select: none;
1673
+ }
1674
+
1675
+ .sc-mm-item[data-active] {
1676
+ background: var(--sc-tray-sunk, #f4f4f5);
1677
+ }
1678
+
1679
+ .sc-mm-inline {
1680
+ position: static;
1681
+ z-index: auto;
1682
+ max-height: 380px;
1683
+ }
1684
+
1685
+ .sc-mm-item[data-locked] {
1686
+ cursor: default;
1687
+ }
1688
+
1689
+ .sc-mm-item[data-locked] .sc-mm-label {
1690
+ color: var(--sc-muted, #6b6b73);
1691
+ }
1692
+
1693
+ .sc-mm-label {
1694
+ flex: none;
1695
+ max-width: 100%;
1696
+ overflow: hidden;
1697
+ text-overflow: ellipsis;
1698
+ white-space: nowrap;
1699
+ }
1700
+
1701
+ .sc-mm-item[aria-selected="true"] .sc-mm-label {
1702
+ font-weight: 500;
1703
+ }
1704
+
1705
+ .sc-mm-note {
1706
+ flex: 1;
1707
+ min-width: 0;
1708
+ overflow: hidden;
1709
+ text-overflow: ellipsis;
1710
+ white-space: nowrap;
1711
+ color: var(--sc-muted, #6b6b73);
1712
+ }
1713
+
1714
+ .sc-mm-item .sc-menu-check {
1715
+ margin-left: auto;
1716
+ width: 14px;
1717
+ height: 14px;
1718
+ }
1719
+
1720
+ .sc-mm-empty {
1721
+ padding: 16px 8px;
1722
+ text-align: center;
1723
+ color: var(--sc-muted, #6b6b73);
1724
+ }
1725
+
1726
+ .sc-mm-tile {
1727
+ flex: none;
1728
+ width: 16px;
1729
+ height: 16px;
1730
+ border-radius: 4px;
1731
+ object-fit: cover;
1732
+ }
1733
+ .sc-mm-tile-box {
1734
+ display: inline-grid;
1735
+ place-items: center;
1736
+ background: color-mix(in srgb, currentColor 6%, transparent);
1737
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 10%, transparent);
1738
+ color: var(--sc-text, #1a1a1c);
1739
+ }
1740
+ .sc-mm-tile-glyph {
1741
+ width: 11px;
1742
+ height: 11px;
1743
+ }
1744
+ .sc-mm-tile-dim {
1745
+ opacity: 0.5;
1746
+ filter: grayscale(1);
1747
+ }
1748
+ .sc-mm-tile.sc-mm-emoji {
1749
+ font-size: 11px;
1750
+ }
1751
+
1752
+ .sc-mm-sub .sc-chev {
1753
+ flex: none;
1754
+ width: 14px;
1755
+ height: 14px;
1756
+ margin-left: auto;
1757
+ color: var(--sc-muted, #6b6b73);
1758
+ }
1759
+ .sc-mm-sub .sc-mm-label {
1760
+ flex: 1;
1761
+ min-width: 0;
1762
+ }
1763
+ .sc-mm-sub[data-locked] .sc-mm-tile {
1764
+ opacity: 0.5;
1765
+ filter: grayscale(1);
1766
+ }
1767
+
1768
+ .sc-mm-pill {
1769
+ flex: none;
1770
+ margin-left: auto;
1771
+ padding: 1px 6px;
1772
+ border-radius: 999px;
1773
+ box-shadow: inset 0 0 0 1px var(--sc-line, #e9e9eb);
1774
+ font-size: 10px;
1775
+ font-weight: 500;
1776
+ letter-spacing: 0.02em;
1777
+ color: var(--sc-muted, #6b6b73);
1778
+ }
1779
+ .sc-mm-sub .sc-mm-pill {
1780
+ margin-left: 0;
1781
+ }
1782
+
1783
+ .sc-mm-dot {
1784
+ flex: none;
1785
+ width: 6px;
1786
+ height: 6px;
1787
+ border-radius: 999px;
1788
+ background: color-mix(in srgb, var(--sc-text, #1a1a1c) 60%, transparent);
1789
+ }
1790
+
1791
+ .sc-mm-rule {
1792
+ height: 1px;
1793
+ margin: 4px -4px;
1794
+ background: var(--sc-line, #e9e9eb);
1795
+ }
1796
+ .sc-mm-label-row {
1797
+ padding: 6px 8px 4px;
1798
+ font-size: var(--sc-fs-label, 12px);
1799
+ color: var(--sc-muted, #6b6b73);
1800
+ }
1801
+
1802
+ .sc-mm-flyout {
1803
+ position: fixed;
1804
+ z-index: 1;
1805
+ padding: 4px;
1806
+ overflow-y: auto;
1807
+ overscroll-behavior: contain;
1808
+ border: 1px solid var(--sc-line, #e9e9eb);
1809
+ border-radius: calc(12px * var(--sc-scale, 1));
1810
+ background: var(--sc-tray-card, #ffffff);
1811
+ box-shadow:
1812
+ 0 12px 32px rgba(0, 0, 0, 0.12),
1813
+ 0 2px 6px rgba(0, 0, 0, 0.06);
1814
+ }
1815
+ .sc-mm-inline {
1816
+ position: relative;
1817
+ overflow: visible;
1818
+ }
1819
+
1551
1820
  .sc-atile .sc-runtime-logo {
1552
1821
  width: calc(25px * var(--sc-scale, 1));
1553
1822
  height: calc(25px * var(--sc-scale, 1));
@@ -1940,6 +2209,19 @@ a.sc-btn {
1940
2209
  color: var(--sc-muted, #6b6b73);
1941
2210
  }
1942
2211
 
2212
+ .sc-plan-feature::before {
2213
+ content: "\u2713 ";
2214
+ color: var(--sc-text, currentColor);
2215
+ }
2216
+
2217
+ .sc-plan-feature-absent {
2218
+ text-decoration: line-through;
2219
+ opacity: 0.6;
2220
+ }
2221
+ .sc-plan-feature-absent::before {
2222
+ content: "\u2715 ";
2223
+ }
2224
+
1943
2225
  .sc-plan-badge {
1944
2226
  font-size: var(--sc-fs-label, 11px);
1945
2227
  padding: 2px 6px;
@@ -4187,7 +4469,7 @@ li.sc-plan-row.sc-plan-current {
4187
4469
  transform: none;
4188
4470
  }
4189
4471
  }
4190
- `,document.head.appendChild(e)}import{jsx as Je,jsxs as xt}from"react/jsx-runtime";function wo(e){if(!e)return null;let n=En(e);if(n==="payment_required"||n==="no_compute")return null;if(typeof e=="string")return e||null;let t=e,s=t.error?.message;return typeof s=="string"&&s?s:typeof t.message=="string"&&t.message?t.message:"The run ended with an error."}function ji(){return xt("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[Je("path",{d:"M8 5v4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),Je("circle",{cx:"8",cy:"11.6",r:"0.9",fill:"currentColor"}),Je("circle",{cx:"8",cy:"8",r:"6.4",stroke:"currentColor",strokeWidth:"1.3"})]})}function qi({error:e,onRetry:n,onDismiss:t,title:s,className:r}){let a=wo(e),i=H();return zi(()=>Nt(),[]),a?Je("div",{className:r?`soba-connect ${r}`:"soba-connect","data-theme":i.theme,role:"alert",children:xt("div",{className:"sc-card sc-limit sc-run-error",children:[xt("div",{className:"sc-limit-head",children:[Je("span",{className:"sc-limit-mark sc-run-error-mark","aria-hidden":"true",children:Je(ji,{})}),xt("div",{children:[Je("h2",{className:"sc-limit-title",children:s??"That run did not finish"}),Je("p",{className:"sc-limit-body sc-run-error-message",children:a})]})]}),(t||n)&&xt("div",{className:"sc-limit-actions",children:[t&&Je("button",{type:"button",className:"sc-btn sc-btn-quiet",onClick:t,children:"Dismiss"}),n&&Je("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:n,children:"Try again"})]})]})}):null}import{useId as Zi,useState as Co}from"react";import{jsx as le,jsxs as jt}from"react/jsx-runtime";function Xi({reason:e}){return le("span",{className:"sc-limit-mark","aria-hidden":"true",children:e==="no_compute"?le(Tt,{}):le(ae,{})})}function Ki(e){let{error:n,variant:t="card",onDismiss:s,className:r}=e,a=dr(n,{predict:e.predict??!("error"in e)}),i=Zi(),c=H();if(!a)return null;let o=le(_i,{offer:a,headingId:i,onDismiss:s});return t==="dialog"?le(gt,{open:!0,onClose:()=>s?.(),labelledBy:i,theme:c.theme,children:o}):le("div",{className:r?`soba-connect ${r}`:"soba-connect","data-theme":c.theme,children:o})}function _i({offer:e,headingId:n,onDismiss:t}){let{compute:s}=F(),[r,a]=Co(!1),[i,c]=Co(null),o=e.reason==="no_compute"&&s.connected&&!s.online,l=o||e.connectOffer!==null||!s.connected,u=kt();async function d(){a(!0),c(null);try{await e.upgrade()}catch(g){c(g.message)}finally{a(!1)}}return jt("div",{className:"sc-card sc-limit",children:[jt("div",{className:"sc-limit-head",children:[le(Xi,{reason:e.reason}),jt("div",{children:[le("h2",{className:"sc-limit-title",id:n,children:e.title}),le("p",{className:"sc-limit-body",children:e.body})]})]}),i&&le("p",{className:"sc-error",children:i}),o&&u.note&&le("p",{className:"sc-limit-note",children:u.note}),jt("div",{className:"sc-limit-actions",children:[t&&le("button",{type:"button",className:"sc-btn sc-btn-quiet",onClick:t,disabled:r,children:"Not now"}),e.upgradeTo&&le("button",{type:"button",className:l?"sc-btn":"sc-btn sc-btn-primary",onClick:()=>void d(),disabled:r,children:r?"Opening\u2026":e.upgradeTo.selectable?`Switch to ${e.upgradeTo.name}`:`${e.upgradeTo.name} for $${e.upgradeTo.price.toLocaleString()}/${e.upgradeTo.interval}`}),l&&le("button",{type:"button",className:o?"sc-btn":"sc-btn sc-btn-primary",onClick:e.connect,disabled:r,children:o?"Connect another machine":"Connect compute"}),o&&le("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:u.open,disabled:r,children:"Open Soba App"})]})]})}import{useMemo as $i}from"react";function Mt(){let{plan:e,compute:n,connect:t}=F();return $i(()=>{let s=e.plan,r=e.current,a={plan:s,assignment:r,loading:e.loading,error:e.error,periodEnd:r?.period_end?new Date(r.period_end):null};if(!s)return{...a,state:"none",trialDaysLeft:null,ceiling:null,raised:!1,uncounted:!1,used:0,remaining:null,percent:null,unlimited:!1,reward:null,summary:"Nothing is assigned to this account, so runs are bounded by whatever the app allows."};let i=tl(r?.trial_ends_at??null),c=s.connected_reward==="included"&&n.connected&&s.connected_included_units!==null,o=c?s.connected_included_units:s.included_units,l=s.connected_reward==="unlimited"&&n.connected,u=o===null,d=e.used??0,g=o===null?null:Math.max(0,o-d),f=o&&o>0?Math.min(100,Math.round(d/o*100)):null,h=o!==null&&d>=o,y=i!==null?"trial":u?"unlimited":h?s.overage==="meter"?"metered":"spent":"within";return{...a,state:y,trialDaysLeft:i,ceiling:o,raised:c,uncounted:l,used:d,remaining:g,percent:f,unlimited:u,reward:el(s,c||l,n.connected,()=>t.open("manual")),summary:nl({plan:s,assignment:r,used:d,ceiling:o,trialDaysLeft:i,raised:c,uncounted:l,state:y})}},[e,n.connected,t])}function el(e,n,t,s){let r=Ke({unit:e.unit,reward:e.connected_reward,includedUnits:e.connected_included_units,creditMicros:e.connected_credit*1e6});return r?{line:r,inForce:n,required:!1,connected:t,actionable:_e(e.connected_reward)&&!t,open:s}:Ge(e.route_allow)&&!t?{line:"Nothing connected yet, so nothing can run.",inForce:!1,required:!0,connected:t,actionable:!0,open:s}:null}function nl(e){let{plan:n,assignment:t,used:s,ceiling:r,trialDaysLeft:a,raised:i,uncounted:c,state:o}=e,l=`${n.unit}${s===1?"":"s"}`,u=c?" Runs your own AI serves do not count toward it.":"";if(o==="trial"&&a!==null){let f=n.price===0?"it continues free":`it is $${n.price.toLocaleString()} a ${n.interval}`;return`${a} ${a===1?"day":"days"} left of your trial, then ${f}.`}if(o==="unlimited")return`${s.toLocaleString()} ${l} this period. No ceiling on this plan.`;if(o==="metered"){let f=s-(r??0);return n.overage_per_unit>0?`${f.toLocaleString()} past the allowance, billed at $${n.overage_per_unit} a ${n.unit}.${u}`:`${f.toLocaleString()} past the allowance.${u}`}if(o==="spent")return t?.period_end?`Allowance spent. It comes back on ${vo(t.period_end)}.${u}`:`Allowance spent. It comes back at the start of the next period.${u}`;let d=Math.max(0,(r??0)-s),g=i?` Raised from ${(n.included_units??0).toLocaleString()} while your own AI is connected.`:t?.period_end?` Resets ${vo(t.period_end)}.`:"";return`${d.toLocaleString()} of ${(r??0).toLocaleString()} ${n.unit}s left.${g}${u}`}function tl(e){if(!e)return null;let n=new Date(e).getTime()-Date.now();return Number.isNaN(n)||n<=0?null:Math.max(1,Math.ceil(n/864e5))}function vo(e){let n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString(void 0,{day:"numeric",month:"long"})}import{Fragment as rl,jsx as ce,jsxs as We}from"react/jsx-runtime";function fr({heading:e="Current plan",showUsage:n=!0,showName:t=!0,className:s}){let r=Mt(),{theme:a}=H(),i=g=>ce("section",{className:s?`soba-connect sc-fill ${s}`:"soba-connect sc-fill","data-theme":a,children:We("div",{className:"sc-card sc-current",children:[e&&ce("h2",{className:"sc-section-title",children:e}),g]})});if(r.error)return i(ce("p",{className:"sc-error",children:r.error.message}));if(r.loading)return i(ce("p",{className:"sc-note",children:"Loading\u2026"}));if(!r.plan)return i(We("div",{className:"sc-current-main",children:[ce("p",{className:"sc-current-name",children:"No plan"}),ce("p",{className:"sc-sub",children:r.summary})]}));let{plan:c,trialDaysLeft:o,percent:l,unlimited:u,reward:d}=r;return i(We(rl,{children:[We("div",{className:"sc-current-grid",children:[(t||o!==null)&&We("div",{className:"sc-current-main",children:[t?We("p",{className:"sc-current-name",children:[c.name,o!==null&&We("span",{className:"sc-trial-badge",children:[o," ",o===1?"day":"days"," left"]})]}):o!==null&&ce("p",{className:"sc-current-trial",children:We("span",{className:"sc-trial-badge",children:[o," ",o===1?"day":"days"," left"]})}),t&&c.description&&ce("p",{className:"sc-sub",children:c.description})]}),n&&We("div",{className:"sc-usage",children:[We("div",{className:"sc-row-between",children:[ce("span",{className:"sc-fact-key",children:"Usage"}),ce("span",{className:l!==null&&l>=100?"sc-usage-figure sc-usage-over":"sc-usage-figure",children:u?"Unlimited":l===null?"Metered":`${l}% used`})]}),l!==null&&ce("div",{className:"sc-meter",role:"presentation",children:l>0&&ce("span",{className:l>=100?"sc-meter-fill sc-meter-full":"sc-meter-fill",style:{width:`${l}%`}})}),ce("p",{className:"sc-usage-line",children:r.summary})]})]}),d&&We("div",{className:"sc-current-foot",children:[ce("p",{className:d.required?"sc-plan-reward-line sc-plan-reward-need":d.inForce?"sc-plan-reward-line":"sc-plan-reward-line sc-plan-reward-open",children:d.required?d.line:d.inForce?`In force: ${sl(d.line)}.`:d.line}),(d.actionable||d.connected)&&ce(Pn,{})]})]}))}var sl=e=>e.charAt(0).toLowerCase()+e.slice(1);import{useCallback as ol,useMemo as al,useState as ko}from"react";var il={"user-hardware":"your own machine","user-subscription":"your own AI subscription","open-weights":"open models we host",frontier:"frontier models"},ll=new Set(["user-hardware","user-subscription"]);function gr(e={}){let{plan:n,compute:t,connect:s}=F(),[r,a]=ko(null),[i,c]=ko(null),{featured:o,onSelect:l,successUrl:u,cancelUrl:d}=e,g=ol(async h=>{a(h.id),c(null);try{if(h.selectable)await n.select(h.id);else if(l)l(h);else{let y=await n.checkout(h.id,{...u?{successUrl:u}:{},...d?{cancelUrl:d}:{}});window.location.assign(y);return}}catch(y){throw c(y.message),y}finally{(h.selectable||l)&&a(null)}},[n,l,u,d]),f=al(()=>n.plans.map(h=>{let y=n.current?.plan_id===h.id;return{plan:h,current:y,featured:o===h.id&&!y,price:cl(h),allowance:h.included_units===null?`Unlimited ${h.unit}s`:`${h.included_units.toLocaleString()} ${h.unit}${h.included_units===1?"":"s"}`,allowanceNote:ul(h),computeLabel:h.route_allow===null?"any compute":h.route_allow.length===0?"no compute":null,compute:(h.route_allow??[]).map(S=>({costClass:S,label:il[S]??S,owned:ll.has(S),runtimes:ws(S).map(I=>I.id)})),connect:dl(h,y,t.connected,()=>s.open("manual")),cta:{label:pl(h,y,r===h.id),disabled:y||r!==null,busy:r===h.id,take:()=>g(h)}}}),[n.plans,n.current,o,t.connected,s,r,g]);return{offers:f,current:f.find(h=>h.current)??null,loading:n.loading,error:n.error,failed:i}}function cl(e){return e.price===0?{amount:"Free",interval:null,free:!0}:{amount:`$${e.price.toLocaleString()}`,interval:e.interval,free:!1}}function ul(e){let n=[];return e.included_units===null?n.push("No ceiling on this plan"):(n.push(`Included each ${e.interval}`),e.overage==="meter"&&e.overage_per_unit>0?n.push(`then $${e.overage_per_unit} a ${e.unit}`):e.included_units>0&&n.push(`then ${e.unit}s stop`)),e.trial_days>0&&n.push(`${e.trial_days}-day trial`),n.join(" \xB7 ")}function dl(e,n,t,s){let r=Ke({unit:e.unit,reward:e.connected_reward,includedUnits:e.connected_included_units,creditMicros:e.connected_credit*1e6}),a=Ge(e.route_allow)&&!t;if(!r&&!a)return null;let i=_e(e.connected_reward);return{key:r?"Connect your own":"To use this",line:r??(n?"Nothing connected yet, so nothing can run.":"Runs only on compute you connect."),reward:r!==null,actionable:n&&(i||a)&&!t,open:s}}function pl(e,n,t){return n?"Your plan":t?e.selectable?"Switching\u2026":"Opening\u2026":e.selectable?"Choose":`Subscribe for $${e.price.toLocaleString()}/${e.interval}`}import{jsx as b,jsxs as D}from"react/jsx-runtime";function qt(e){return e?`soba-connect sc-fill ${e}`:"soba-connect sc-fill"}function Ar({onSelect:e,successUrl:n,cancelUrl:t,showCompute:s=!0,showConnect:r=!1,variant:a="cards",featured:i,className:c}){let{offers:o,loading:l,error:u,failed:d}=gr({...i?{featured:i}:{},...e?{onSelect:e}:{},...n?{successUrl:n}:{},...t?{cancelUrl:t}:{}}),{theme:g}=H();if(u)return b("div",{className:qt(c),"data-theme":g,children:b("div",{className:"sc-card",children:b("p",{className:"sc-error",children:u.message})})});if(l)return b("div",{className:qt(c),"data-theme":g,children:b("div",{className:"sc-card",children:b("p",{className:"sc-note",children:"Loading plans\u2026"})})});if(o.length===0)return b("div",{className:qt(c),"data-theme":g,children:b("div",{className:"sc-card",children:b("p",{className:"sc-note",children:"This app has no plans yet."})})});let f={showCompute:s,showConnect:r};return D("div",{className:qt(c),"data-theme":g,"data-variant":a,children:[a==="rows"?b(hl,{offers:o,shelf:f}):a==="table"?b(fl,{offers:o,shelf:f}):b(ml,{offers:o,shelf:f}),d&&b("p",{className:"sc-error",children:d})]})}function ml({offers:e,shelf:n}){return b("div",{className:"sc-plans",children:e.map(t=>D("div",{className:No("sc-plan",t),children:[D("div",{className:"sc-row-between",children:[b("span",{className:"sc-title",children:t.plan.name}),b(br,{offer:t})]}),b("p",{className:"sc-sub",children:t.plan.description}),b(yr,{price:t.price,free:"forever"}),b(vr,{offer:t,shelf:n}),b(xo,{offer:t}),b("div",{className:"sc-plan-band",children:n.showCompute&&b(Cr,{offer:t})}),b("div",{className:"sc-plan-band",children:b(wr,{offer:t})})]},t.plan.id))})}function hl({offers:e,shelf:n}){return b("ul",{className:"sc-plan-rows",children:e.map(t=>D("li",{className:No("sc-plan-row",t),children:[D("div",{className:"sc-row-main",children:[D("span",{className:"sc-row-name",children:[b("span",{className:"sc-title",children:t.plan.name}),b(br,{offer:t})]}),t.plan.description&&b("p",{className:"sc-sub",children:t.plan.description}),b(xo,{offer:t}),n.showCompute&&b(Cr,{offer:t,inline:!0}),b(wr,{offer:t,inline:!0})]}),D("div",{className:"sc-row-side",children:[b(yr,{price:t.price,free:"forever",small:!0}),b(vr,{offer:t,shelf:n})]})]},t.plan.id))})}function fl({offers:e,shelf:n}){let t=e.some(i=>i.plan.overage_per_unit>0),s=e.some(i=>i.plan.trial_days>0),r=e.some(i=>i.connect!==null),a=i=>[i.current?"sc-col-current":"",i.featured?"sc-col-featured":""].filter(Boolean).join(" ")||void 0;return b("div",{className:"sc-table-scroll",children:D("table",{className:"sc-plan-table",children:[b("thead",{children:D("tr",{children:[b("td",{}),e.map(i=>D("th",{scope:"col",className:a(i),children:[D("span",{className:"sc-row-name",children:[b("span",{className:"sc-title",children:i.plan.name}),b(br,{offer:i})]}),b(yr,{price:i.price,small:!0})]},i.plan.id))]})}),D("tbody",{children:[D("tr",{children:[b("th",{scope:"row",children:"Included"}),e.map(i=>b("td",{className:a(i),children:i.allowance},i.plan.id))]}),t&&D("tr",{children:[b("th",{scope:"row",children:"Then"}),e.map(i=>b("td",{className:a(i),children:i.plan.overage_per_unit>0?`$${i.plan.overage_per_unit} / ${i.plan.unit}`:b("span",{className:"sc-muted-cell",children:"Stops"})},i.plan.id))]}),s&&D("tr",{children:[b("th",{scope:"row",children:"Trial"}),e.map(i=>b("td",{className:a(i),children:i.plan.trial_days>0?`${i.plan.trial_days} days`:b("span",{className:"sc-muted-cell",children:"None"})},i.plan.id))]}),n.showCompute&&D("tr",{children:[b("th",{scope:"row",children:"Runs on"}),e.map(i=>b("td",{className:a(i),children:b(Cr,{offer:i,bare:!0})},i.plan.id))]}),r&&D("tr",{children:[b("th",{scope:"row",children:"Connect your own"}),e.map(i=>b("td",{className:a(i),children:b(wr,{offer:i,bare:!0})},i.plan.id))]}),D("tr",{className:"sc-table-buy",children:[b("td",{}),e.map(i=>b("td",{className:a(i),children:b(vr,{offer:i,shelf:n})},i.plan.id))]})]})]})})}function No(e,n){return[e,n.current?"sc-plan-current":"",n.featured?"sc-plan-featured":""].filter(Boolean).join(" ")}function br({offer:e}){return e.current?b("span",{className:"sc-plan-badge",children:"Current"}):e.featured?b("span",{className:"sc-plan-badge-soft",children:"Recommended"}):null}function yr({price:e,small:n,free:t}){return D("p",{className:n?"sc-plan-price sc-plan-price-sm":"sc-plan-price",children:[b("span",{className:"sc-plan-amount",children:e.amount}),e.interval?D("span",{className:"sc-plan-interval",children:["/",e.interval]}):t&&b("span",{className:"sc-plan-interval sc-plan-after",children:t})]})}function xo({offer:e}){return D("p",{className:"sc-plan-allowance",children:[b("span",{className:"sc-plan-figure",children:e.allowance}),b("span",{className:"sc-plan-qualifier",children:e.allowanceNote})]})}function wr({offer:e,inline:n,bare:t}){let s=e.connect;if(!s)return t?b("span",{className:"sc-muted-cell",children:"None"}):null;let r=s.reward?"sc-plan-reward-line":"sc-plan-reward-line sc-plan-reward-need",a=s.actionable?D("button",{type:"button",className:`${r} sc-plan-reward-act`,"aria-label":"Connect compute",onClick:s.open,children:[b("span",{className:"sc-reward-said",children:s.line}),D("span",{className:"sc-reward-do","aria-hidden":!0,children:[b(ae,{className:"sc-reward-mark"}),"Connect compute"]})]}):b("p",{className:r,children:s.line});return t?a:b("div",{className:n?"sc-plan-reward sc-plan-reward-inline":"sc-plan-reward",children:a})}function Cr({offer:e,inline:n,bare:t}){let s=e.computeLabel?b("ul",{className:n?"sc-compute sc-compute-inline":"sc-compute",children:b("li",{children:e.computeLabel})}):b("ul",{className:n?"sc-compute sc-compute-inline":"sc-compute",children:e.compute.map(r=>D("li",{className:r.owned?"sc-compute-own":void 0,children:[r.label,b(gl,{runtimes:r.runtimes})]},r.costClass))});return t?s:D("div",{className:n?"sc-plan-compute sc-plan-compute-inline":"sc-plan-compute",children:[b("span",{className:"sc-fact-key",children:"Runs on"}),s]})}function vr({offer:e,shelf:n}){let t=e.connect;return n.showConnect&&t?.actionable?D("button",{type:"button",className:"sc-btn sc-btn-primary sc-btn-icon",onClick:t.open,children:[b(ae,{className:"sc-btn-mark"}),"Connect compute"]}):b("button",{type:"button",className:e.current?"sc-btn":"sc-btn sc-btn-primary",disabled:e.cta.disabled,onClick:()=>void e.cta.take().catch(()=>{}),children:e.cta.label})}function gl({runtimes:e}){return e.length===0?null:b("span",{className:"sc-compute-marks",children:e.map(n=>{let t=rn[n];return t?b(t,{className:"sc-rt-mark"},n):null})})}import{jsx as kr,jsxs as Mo}from"react/jsx-runtime";function Al({heading:e,plansHeading:n,showUsage:t=!0,showName:s=!0,className:r,...a}){let{plan:i,loading:c}=Mt(),{theme:o}=H(),l=n??(c?"Plans":i?"Change plan":"Choose a plan");return Mo("div",{className:r?`soba-connect sc-fill sc-billing ${r}`:"soba-connect sc-fill sc-billing","data-theme":o,children:[kr(fr,{...e===void 0?{}:{heading:e},showUsage:t,showName:s}),Mo("section",{className:"sc-billing-plans",children:[l&&kr("h2",{className:"sc-section-title",children:l}),kr(Ar,{...a})]})]})}import{useCallback as So,useState as Ro}from"react";function Nr({plan:e,successUrl:n,cancelUrl:t,label:s}){let{plan:r}=F(),[a,i]=Ro(!1),[c,o]=Ro(null),l=So(()=>r.checkout(e.id,{...n?{successUrl:n}:{},...t?{cancelUrl:t}:{}}),[r,e.id,n,t]),u=So(async()=>{i(!0),o(null);try{window.location.assign(await l())}catch(d){o(d.message),i(!1)}},[l]);return{label:a?"Opening\u2026":s??`Subscribe for $${e.price.toLocaleString()}/${e.interval}`,busy:a,error:c,buy:u,session:l}}import{jsx as Po,jsxs as yl}from"react/jsx-runtime";function bl({plan:e,successUrl:n,cancelUrl:t,label:s,className:r}){let{theme:a}=H(),i=Nr({plan:e,...n?{successUrl:n}:{},...t?{cancelUrl:t}:{},...s?{label:s}:{}});return yl("div",{className:r?`soba-connect ${r}`:"soba-connect","data-theme":a,children:[Po("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:i.busy,onClick:()=>void i.buy(),children:i.label}),i.error&&Po("p",{className:"sc-error",children:i.error})]})}import{useCallback as Ye,useEffect as ln,useMemo as Zn,useRef as cn,useState as ue}from"react";var wl="soba.session:";function Eo(e){return!e.cacheKey||!e.endpoint?null:wl+JSON.stringify([e.endpoint,e.user??null,e.cacheKey])}function Cl(e){try{let n=globalThis.localStorage?.getItem(e);if(!n)return null;let t=JSON.parse(n);return typeof t.token!="string"||typeof t.expiresAt!="number"?null:{token:t.token,expiresAt:t.expiresAt}}catch{return null}}function vl(e,n){try{n?globalThis.localStorage?.setItem(e,JSON.stringify(n)):globalThis.localStorage?.removeItem(e)}catch{}}var Io=6e4,kl=1e4,Zt=class{#e;#n=null;#s=null;#t;#r=new Set;constructor(n){this.#t=n,this.#e=n.token??null;let t=Eo(n),s=t&&!this.#e?Cl(t):null;s&&s.expiresAt-Io>Date.now()&&(this.#e=s.token,this.#n=s.expiresAt)}get token(){return this.#e}get expiresAt(){return this.#n}get canRefresh(){return!!this.#t.endpoint}get refreshAt(){return!this.canRefresh||this.#n===null?null:Math.max(Date.now()+kl,this.#n-Io)}subscribe(n){return this.#r.add(n),()=>this.#r.delete(n)}async ensure(){return this.#e?this.#e:this.refresh()}async refresh(){if(this.#s)return this.#s;let n=this.#t.endpoint;if(!n)throw new Error("This Soba session cannot be refreshed. Pass `sessionEndpoint` so the provider can mint a new one.");let t=this.#t.fetchImpl??fetch.bind(globalThis);this.#s=(async()=>{let s=await t(n,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(this.#t.user?{user:this.#t.user}:{})});if(!s.ok)throw new Error(`Could not start a Soba session (${s.status} from ${n}).`);let r=await s.json(),a=r.session??r.token;if(!a)throw new Error(`${n} answered without a \`session\`. See @soba-so/react's README.`);let i=r.expires_in??r.expiresIn;this.#e=a,this.#n=typeof i=="number"?Date.now()+i*1e3:null;let c=Eo(this.#t);c&&vl(c,this.#n===null?null:{token:a,expiresAt:this.#n});for(let o of this.#r)o();return a})();try{return await this.#s}finally{this.#s=null}}},qn=new Map,Oo=new WeakMap,Nl=1;function xl(e){if(e.token||!e.endpoint)return null;let n=0;return e.fetchImpl&&(n=Oo.get(e.fetchImpl)??Nl++,Oo.set(e.fetchImpl,n)),JSON.stringify([e.endpoint,e.user??null,n,e.cacheKey??null])}function Lo(e){let n=xl(e);if(!n)return new Zt(e);let t=qn.get(n)??{holder:new Zt(e),users:0};return qn.set(n,t),t.holder}function To(e){for(let n of qn.values())n.holder===e&&n.users++}function Bo(e){for(let[n,t]of qn)if(t.holder===e){setTimeout(()=>{--t.users<=0&&qn.get(n)===t&&qn.delete(n)},0);return}}function Go(e,n=fetch.bind(globalThis)){return async(t,s)=>{let r=await n(t,s);if(r.status!==401||!e.canRefresh)return r;let a;try{a=await e.refresh()}catch{return r}return n(t,Ml(s,a))}}function Ml(e,n){let t=new Headers(e?.headers);return t.set("authorization",`Bearer ${n}`),{...e,headers:t}}import{jsx as xr,jsxs as El}from"react/jsx-runtime";var Sl="https://soba.so",Rl=3e4;function Pl(e){let{children:n,session:t,sessionEndpoint:s,user:r,sessionCacheKey:a,runEndpoint:i,theme:c,initialMachines:o,initialConnect:l=null,initialPlans:u,initialCurrentPlan:d=null,baseUrl:g=Sl,pollMs:f=Rl,injectStyles:h=!0,modal:y=!0,fetchImpl:S,onError:I}=e,[E,G]=ue(t??null),[Y,L]=ue(null),[T,O]=ue(l),[w,de]=ue(null),[K,ve]=ue(l===null),[_,Ie]=ue(o??[]),[He,fe]=ue(null),[Oe,z]=ue(o===void 0),[ee,ze]=ue(u??[]),[q,ge]=ue(d),[ke,je]=ue(null),[De,Z]=ue(u===void 0),[se,$]=ue(null),[Ae,Ne]=ue(!1),Ue=cn(I);Ue.current=I;let ne=Ye(k=>{L(k),Ue.current?.(k)},[]);ln(()=>{h&&Nt()},[h]);let Q=Zn(()=>Lo({...t?{token:t}:{},...s?{endpoint:s}:{},...r?{user:r}:{},...S?{fetchImpl:S}:{},...a?{cacheKey:a}:{}}),[t,s,r,S,a]);ln(()=>{let k=!0;To(Q);let oe=Q.subscribe(()=>{k&&G(Q.token)});return!Q.token&&!Q.canRefresh?ne(new Error("<SobaProvider> needs a `session` or a `sessionEndpoint`. A browser cannot mint one: that takes your secret key.")):Q.ensure().then(()=>k&&G(Q.token),xe=>k&&ne(xe)),()=>{k=!1,oe(),Bo(Q)}},[Q,ne]),ln(()=>{Y&&(ve(!1),z(!1),Z(!1),de(k=>k??Y),fe(k=>k??Y),je(k=>k??Y))},[Y]),ln(()=>{let k=Q.refreshAt;if(k===null)return;let oe=()=>{Q.refresh().catch(Te=>ne(Te))},xe=()=>{document.hidden||(document.removeEventListener("visibilitychange",xe),oe())},On=setTimeout(()=>{typeof document<"u"&&document.hidden?document.addEventListener("visibilitychange",xe):oe()},Math.max(0,k-Date.now()));return()=>{clearTimeout(On),typeof document<"u"&&document.removeEventListener("visibilitychange",xe)}},[Q,ne,E]);let x=cn(l?.machines_url??null),C=Zn(()=>{if(!E)return null;let k=new tt({session:E,baseUrl:g,fetchImpl:Go(Q,S??fetch.bind(globalThis))});return k.setMachinesUrl(x.current),k},[E,g,Q,S]),Le=cn(l!==null);ln(()=>{if(!C||Le.current)return;let k=!0;return ve(!0),C.context().then(oe=>{k&&(O(oe),de(null),ve(!1))},oe=>{k&&(de(oe),ve(!1))}),()=>{k=!1}},[C]);let Fe=Ye(async()=>{if(C)try{let k=await C.machines();Ie(Array.isArray(k)?k:[]),fe(null)}catch(k){fe(k)}finally{z(!1)}},[C]),re=Ye(async()=>{if(C)try{let k=await C.plans();ze(k.plans),ge(k.current),je(null)}catch(k){je(k)}finally{Z(!1)}},[C]),R=cn(!1),[$e,pe]=ue(!1),un=cn(u!==void 0),en=cn(!1),dn=Ye(()=>{R.current||(R.current=!0,en.current&&queueMicrotask(()=>{en.current&&pe(!0)}))},[]);ln(()=>(en.current=!0,R.current&&pe(!0),()=>{en.current=!1}),[]),ln(()=>{!C||!$e||un.current||re()},[C,$e,re]);let Xn=Ye(async k=>{if(!C)throw new Error("No session yet.");await C.selectPlan(k),await re()},[C,re]),pn=Ye(async(k,oe)=>{if(!C)throw new Error("No session yet.");let xe=await C.checkoutPlan(k,oe);if(!xe.url)throw new Error("Checkout could not be started.");return xe.url},[C]),mn=Ye(async()=>{if(!C)throw new Error("No session yet.");await C.leavePlan(),await re()},[C,re]),Xt=cn(o!==void 0);ln(()=>{if(!C)return;let k=Ee(Fe,f,{immediate:!Xt.current});return Xt.current=!1,k},[C,Fe,f]);let In=Ye((k="manual")=>{y&&(Ne(!0),$(k))},[y]),St=Ye(()=>$(null),[]),Kn=cn(_);Kn.current=_;let Rt=Ye(async k=>{if(!i)throw new Error("Pass `runEndpoint` to <SobaProvider> to start runs from the browser. It is your own route: it holds your secret key, calls soba.run(), and forwards the stream.");let{signal:oe,...xe}=k,Te=await(S??fetch.bind(globalThis))(i,{method:"POST",headers:{"content-type":"application/json",accept:"text/event-stream"},credentials:"same-origin",body:JSON.stringify(xe),...oe?{signal:oe}:{}});if(!Te.ok){let qe=await Te.json().catch(()=>null),me=new Error(qe?.error?.message??`${i} answered ${Te.status}.`);me.status=Te.status,qe?.error?.code&&(me.code=qe.error.code),qe?.error&&(me.error=qe.error);let hn=Kn.current.length>0&&!Kn.current.some(Pt=>Pt.state!=="offline");throw Te.status===409&&hn&&In("no_compute"),me}let _t=hr(Te);return async function*(){try{yield*_t}finally{R.current&&re()}}()},[i,S,re,In]),V=Zn(()=>q?ee.find(k=>k.id===q.plan_id)??null:null,[ee,q]),be=Zn(()=>V?V.connected_reward==="included"&&_.length>0&&V.connected_included_units!==null?V.connected_included_units:V.included_units:null,[V,_]),_n=Zn(()=>({plans:ee,current:q,plan:V,used:q?.units_used??null,included:be,remaining:be!==null&&q?Math.max(0,be-q.units_used):null,unlimited:V!==null&&be===null,loading:De,error:ke,select:Xn,checkout:pn,leave:mn,refresh:re}),[ee,q,V,be,De,ke,Xn,pn,mn,re]),Kt=Zn(()=>({session:E,client:C,error:Y,get plan(){return dn(),_n},compute:{machines:_,connected:_.length>0,online:_.some(k=>k.state!=="offline"),loading:Oe,error:He,refresh:Fe},connect:{app:T?.app??null,command:T?.command??null,connectUrl:T?.connect_url??null,publishableKey:T?.publishable_key??null,loading:K,error:w,open:In,close:St,isOpen:se!==null,hasModal:y},run:Rt}),[E,C,Y,_n,dn,se,In,St,y,_,Oe,He,Fe,T,K,w,Rt]);return xr($s.Provider,{value:C,children:xr(er.Provider,{value:{context:T,machines:Oe?void 0:_,theme:c??T?.theme??"light"},children:El(nr.Provider,{value:Kt,children:[n,y&&Ae&&xr(Ct,{open:se!==null,onOpenChange:k=>$(k?se??"manual":null),onConnected:()=>{Fe()},...se==="payment_required"||se==="no_compute"?{reason:se}:{},...se==="pair"?{showStatus:!1}:{}})]})})})}function Il(e){return e?Ol[e]??e:null}var Ol={"user-hardware":"your own computer","user-subscription":"your own AI plan","user-api-key":"your own API key","open-weights":"open models we host",frontier:"a frontier model we pay for"};async function Ll(e,n,t){let s=n.local;if(!s?.session||n.after)return null;let r=/\/v1\/runs\/([^/]+)\/events/.exec(e.url)?.[1];if(!r)return null;let a=`http://127.0.0.1:${s.port??47321}/v1/runs/${r}/events`,i=new AbortController,c=()=>i.abort();n.signal?.addEventListener("abort",c);let o=setTimeout(()=>i.abort(),s.timeoutMs??3e3);try{let l=await t(a,{headers:{authorization:`Bearer ${s.session}`,accept:"text/event-stream"},signal:i.signal});return l.ok?{url:a,bearer:s.session,open:l}:null}catch{return null}finally{clearTimeout(o),n.signal?.removeEventListener("abort",c)}}async function*Tl(e){let n=e.body;if(!n)return;let t=n.getReader(),s=new TextDecoder,r="",a=null,i=[];try{for(;;){let c=await t.read();if(c.done)return;r+=s.decode(c.value,{stream:!0});for(let o=r.indexOf(`
4191
- `);o!==-1;o=r.indexOf(`
4192
- `)){let l=r.slice(0,o).replace(/\r$/,"");if(r=r.slice(o+1),l==="")i.length&&(yield{id:a,data:i.join(`
4193
- `)}),a=null,i=[];else if(l.startsWith("id:")){let u=Number(l.slice(3).trim());a=Number.isFinite(u)?u:null}else if(l.startsWith("data:")){let u=l.slice(5);i.push(u.startsWith(" ")?u.slice(1):u)}}}}finally{t.cancel().catch(()=>{})}}var Mr=(e,n)=>new Promise(t=>{let s=setTimeout(t,e);n?.addEventListener("abort",()=>{clearTimeout(s),t()})});async function*Bl(e,n={}){let t=n.fetchImpl??fetch.bind(globalThis),s=await Ll(e,n,t)??{url:e.url,bearer:e.token,open:null},r=n.maxRetries??6,a=n.after??0,i=0;for(;;){if(n.signal?.aborted)return;let c;try{c=s.open??await t(s.url,{headers:{authorization:`Bearer ${s.bearer}`,accept:"text/event-stream",...a?{"last-event-id":String(a)}:{}},...n.signal?{signal:n.signal}:{}}),s.open=null}catch(o){if(n.signal?.aborted)return;if(++i>r)throw o;await Mr(1e3*i,n.signal);continue}if(c.status===503&&i<r){i++,await Mr(Number(c.headers.get("retry-after")??3)*1e3,n.signal);continue}if(!c.ok){let o=`Could not read this run (${c.status}).`;try{let l=await c.json();l.error?.message&&(o=l.error.message)}catch{}throw new Error(o)}for await(let o of Tl(c)){o.id!==null&&(a=o.id),i=0;let l=jn(o.data);if(l&&(yield l,l.type==="done"||l.type==="error"))return}if(n.signal?.aborted)return;if(++i>r)throw new Error("Lost this run's stream and could not get it back.");await Mr(1e3*i,n.signal)}}export{hi as ComputeStatus,Pn as ConnectButton,Ni as ConnectCompute,Ct as ConnectModal,Di as ConnectNudge,or as ConnectPill,Yi as ModelPicker,qi as RunError,Ki as RunLimit,Al as SobaBilling,bl as SobaCheckout,fr as SobaCurrentPlan,Ar as SobaPlans,Pl as SobaProvider,Ji as collectText,ar as connectSays,Nt as injectStyles,jn as parseEvent,hr as readEvents,wo as runErrorMessage,En as sobaErrorCode,Il as tierLabel,Nr as useCheckout,yt as useCompute,yi as useConnectButton,mr as useConnectNudge,Mt as useCurrentPlan,ir as useMachineRuns,Rn as useModel,kt as useOpenSobaConnect,gr as usePlans,dr as useRunLimit,F as useSoba,Bl as watchRun};
4472
+ `,document.head.appendChild(e)}import{jsx as nn,jsxs as Ut}from"react/jsx-runtime";function ea(e){if(!e)return null;let n=zn(e);if(n==="payment_required"||n==="no_compute")return null;if(typeof e=="string")return e||null;let t=e,r=t.error?.message;return typeof r=="string"&&r?r:typeof t.message=="string"&&t.message?t.message:"The run ended with an error."}function Gl(){return Ut("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[nn("path",{d:"M8 5v4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),nn("circle",{cx:"8",cy:"11.6",r:"0.9",fill:"currentColor"}),nn("circle",{cx:"8",cy:"8",r:"6.4",stroke:"currentColor",strokeWidth:"1.3"})]})}function Wl({error:e,onRetry:n,onDismiss:t,title:r,className:o}){let a=ea(e),s=te();return Bl(()=>Ht(),[]),a?nn("div",{className:o?`soba-connect ${o}`:"soba-connect","data-theme":s.theme,role:"alert",children:Ut("div",{className:"sc-card sc-limit sc-run-error",children:[Ut("div",{className:"sc-limit-head",children:[nn("span",{className:"sc-limit-mark sc-run-error-mark","aria-hidden":"true",children:nn(Gl,{})}),Ut("div",{children:[nn("h2",{className:"sc-limit-title",children:r??"That run did not finish"}),nn("p",{className:"sc-limit-body sc-run-error-message",children:a})]})]}),(t||n)&&Ut("div",{className:"sc-limit-actions",children:[t&&nn("button",{type:"button",className:"sc-btn sc-btn-quiet",onClick:t,children:"Dismiss"}),n&&nn("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:n,children:"Try again"})]})]})}):null}import{useId as Dl,useState as na}from"react";import{jsx as xe,jsxs as hr}from"react/jsx-runtime";function Hl({reason:e}){return xe("span",{className:"sc-limit-mark","aria-hidden":"true",children:e==="no_compute"?xe(er,{}):xe(Me,{})})}function Ul(e){let{error:n,variant:t="card",onDismiss:r,className:o}=e,a=Ho(n,{predict:e.predict??!("error"in e)}),s=Dl(),c=te();if(!a)return null;let i=xe(Fl,{offer:a,headingId:s,onDismiss:r});return t==="dialog"?xe(Rt,{open:!0,onClose:()=>r?.(),labelledBy:s,theme:c.theme,children:i}):xe("div",{className:o?`soba-connect ${o}`:"soba-connect","data-theme":c.theme,children:i})}function Fl({offer:e,headingId:n,onDismiss:t}){let{compute:r}=_(),[o,a]=na(!1),[s,c]=na(null),i=e.reason==="no_compute"&&r.connected&&!r.online,l=i||e.connectOffer!==null||!r.connected,d=Dt();async function g(){a(!0),c(null);try{await e.upgrade()}catch(b){c(b.message)}finally{a(!1)}}return hr("div",{className:"sc-card sc-limit",children:[hr("div",{className:"sc-limit-head",children:[xe(Hl,{reason:e.reason}),hr("div",{children:[xe("h2",{className:"sc-limit-title",id:n,children:e.title}),xe("p",{className:"sc-limit-body",children:e.body})]})]}),s&&xe("p",{className:"sc-error",children:s}),i&&d.note&&xe("p",{className:"sc-limit-note",children:d.note}),hr("div",{className:"sc-limit-actions",children:[t&&xe("button",{type:"button",className:"sc-btn sc-btn-quiet",onClick:t,disabled:o,children:"Not now"}),e.upgradeTo&&xe("button",{type:"button",className:l?"sc-btn":"sc-btn sc-btn-primary",onClick:()=>void g(),disabled:o,children:o?"Opening\u2026":e.upgradeTo.selectable?`Switch to ${e.upgradeTo.name}`:`${e.upgradeTo.name} for $${e.upgradeTo.price.toLocaleString()}/${e.upgradeTo.interval}`}),l&&xe("button",{type:"button",className:i?"sc-btn":"sc-btn sc-btn-primary",onClick:e.connect,disabled:o,children:i?"Connect another machine":"Connect compute"}),i&&xe("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:d.open,disabled:o,children:"Open Soba"})]})]})}import{useMemo as zl}from"react";function Vl(e){let n={};for(let t of e??[])n[t.id]=t.value;return n}function Ft(){let{plan:e,compute:n,connect:t}=_();return zl(()=>{let r=e.plan,o=e.current,a={plan:r,assignment:o,loading:e.loading,error:e.error,periodEnd:o?.period_end?new Date(o.period_end):null,features:o?.features??Vl(r?.features)};if(!r)return{...a,state:"none",trialDaysLeft:null,ceiling:null,raised:!1,uncounted:!1,used:0,remaining:null,percent:null,unlimited:!1,reward:null,summary:"Nothing is assigned to this account, so runs are bounded by whatever the app allows."};let s=Yl(o?.trial_ends_at??null),c=r.connected_reward==="included"&&n.connected&&r.connected_included_units!==null,i=c?r.connected_included_units:r.included_units,l=n.connected,d=i===null,g=e.used??0,b=i===null?null:Math.max(0,i-g),y=i&&i>0?Math.min(100,Math.round(g/i*100)):null,f=i!==null&&g>=i,v=s!==null?"trial":d?"unlimited":f?r.overage==="meter"?"metered":"spent":"within";return{...a,state:v,trialDaysLeft:s,ceiling:i,raised:c,uncounted:l,used:g,remaining:b,percent:y,unlimited:d,reward:Ql(r,c,n.connected,()=>t.open("manual")),summary:Jl({plan:r,assignment:o,used:g,ceiling:i,trialDaysLeft:s,raised:c,uncounted:l,state:v})}},[e,n.connected,t])}function Ql(e,n,t,r){let o=sn({unit:e.unit,reward:e.connected_reward,includedUnits:e.connected_included_units,creditMicros:e.connected_credit*1e6});return o?{line:o,inForce:n,required:!1,connected:t,actionable:an(e.connected_reward)&&!t,open:r}:Ve(e.route_allow)&&!t?{line:"Nothing connected yet, so nothing can run.",inForce:!1,required:!0,connected:t,actionable:!0,open:r}:null}function Jl(e){let{plan:n,assignment:t,used:r,ceiling:o,trialDaysLeft:a,raised:s,uncounted:c,state:i}=e,l=c?" Runs your own AI serves do not count toward it.":"";if(i==="trial"&&a!==null){let b=n.price===0?"it continues free":`it is $${n.price.toLocaleString()} a ${n.interval}`;return`${a} ${a===1?"day":"days"} left of your trial, then ${b}.`}if(i==="unlimited")return`${Oe(n.unit,r)} this period. No ceiling on this plan.`;if(i==="metered"){let b=r-(o??0);return n.overage_per_unit>0?`${Oe(n.unit,b)} past the allowance, billed at $${n.overage_per_unit} per ${Dn(n.unit)}.${l}`:`${Oe(n.unit,b)} past the allowance.${l}`}if(i==="spent")return t?.period_end?`Allowance spent. It comes back on ${ta(t.period_end)}.${l}`:`Allowance spent. It comes back at the start of the next period.${l}`;let d=Math.max(0,(o??0)-r),g=s?` Raised from ${Oe(n.unit,n.included_units??0)} while your own AI is connected.`:t?.period_end?` Resets ${ta(t.period_end)}.`:"";return`${Oe(n.unit,d)} of ${Oe(n.unit,o??0)} left.${g}${l}`}function Yl(e){if(!e)return null;let n=new Date(e).getTime()-Date.now();return Number.isNaN(n)||n<=0?null:Math.max(1,Math.ceil(n/864e5))}function ta(e){let n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString(void 0,{day:"numeric",month:"long"})}import{Fragment as ql,jsx as Se,jsxs as Je}from"react/jsx-runtime";function Vo({heading:e="Current plan",showUsage:n=!0,showName:t=!0,className:r}){let o=Ft(),{theme:a}=te(),s=b=>Se("section",{className:r?`soba-connect sc-fill ${r}`:"soba-connect sc-fill","data-theme":a,children:Je("div",{className:"sc-card sc-current",children:[e&&Se("h2",{className:"sc-section-title",children:e}),b]})});if(o.error)return s(Se("p",{className:"sc-error",children:o.error.message}));if(o.loading)return s(Se("p",{className:"sc-note",children:"Loading\u2026"}));if(!o.plan)return s(Je("div",{className:"sc-current-main",children:[Se("p",{className:"sc-current-name",children:"No plan"}),Se("p",{className:"sc-sub",children:o.summary})]}));let{plan:c,trialDaysLeft:i,percent:l,unlimited:d,reward:g}=o;return s(Je(ql,{children:[Je("div",{className:"sc-current-grid",children:[(t||i!==null)&&Je("div",{className:"sc-current-main",children:[t?Je("p",{className:"sc-current-name",children:[c.name,i!==null&&Je("span",{className:"sc-trial-badge",children:[i," ",i===1?"day":"days"," left"]})]}):i!==null&&Se("p",{className:"sc-current-trial",children:Je("span",{className:"sc-trial-badge",children:[i," ",i===1?"day":"days"," left"]})}),t&&c.description&&Se("p",{className:"sc-sub",children:c.description})]}),n&&Je("div",{className:"sc-usage",children:[Je("div",{className:"sc-row-between",children:[Se("span",{className:"sc-fact-key",children:"Usage"}),Se("span",{className:l!==null&&l>=100?"sc-usage-figure sc-usage-over":"sc-usage-figure",children:d?"Unlimited":l===null?"Metered":`${l}% used`})]}),l!==null&&Se("div",{className:"sc-meter",role:"presentation",children:l>0&&Se("span",{className:l>=100?"sc-meter-fill sc-meter-full":"sc-meter-fill",style:{width:`${l}%`}})}),Se("p",{className:"sc-usage-line",children:o.summary})]})]}),g&&Je("div",{className:"sc-current-foot",children:[Se("p",{className:g.required?"sc-plan-reward-line sc-plan-reward-need":g.inForce?"sc-plan-reward-line":"sc-plan-reward-line sc-plan-reward-open",children:g.required?g.line:g.inForce?`In force: ${jl(g.line)}.`:g.line}),(g.actionable||g.connected)&&Se(Fn,{})]})]}))}var jl=e=>e.charAt(0).toLowerCase()+e.slice(1);import{useCallback as Zl,useMemo as Xl,useState as ra}from"react";var Kl={"user-hardware":"your own machine","user-subscription":"your own AI subscription","open-weights":"open models we host",frontier:"frontier models"},_l=new Set(["user-hardware","user-subscription"]);function Qo(e={}){let{plan:n,compute:t,connect:r}=_(),[o,a]=ra(null),[s,c]=ra(null),{featured:i,onSelect:l,successUrl:d,cancelUrl:g}=e,b=Zl(async f=>{a(f.id),c(null);try{if(f.contact_url)f.contact_url.startsWith("mailto:")?window.location.assign(f.contact_url):window.open(f.contact_url,"_blank","noopener");else if(f.selectable)await n.select(f.id);else if(l)l(f);else{let v=await n.checkout(f.id,{...d?{successUrl:d}:{},...g?{cancelUrl:g}:{}});window.location.assign(v);return}}catch(v){throw c(v.message),v}finally{(f.selectable||l||f.contact_url)&&a(null)}},[n,l,d,g]),y=Xl(()=>n.plans.map(f=>{let v=n.current?.plan_id===f.id;return{plan:f,current:v,featured:i===f.id&&!v,price:$l(f),allowance:f.included_units===null?`Unlimited ${f.unit==="cost"?"usage":(f.unit==="run"||f.unit==="task")&&f.task_noun?f.task_noun:`${f.unit}s`}`:Ot(f.unit,f.included_units,f.task_noun),allowanceNote:ec(f),features:(()=>{let A=f.features_from?n.plans.find(k=>k.id===f.features_from):void 0;return A&&f.features_own?[{text:`Everything in ${A.name}`,included:!0},...dr(f.features_own)]:dr(f.features)})(),ownAllowance:Hn({unit:f.unit,includedUnits:f.included_units,ownIncludedUnits:f.own_included_units??null,routePrefer:f.route_prefer,taskNoun:f.task_noun}),computeLabel:f.route_allow===null?"any compute":f.route_allow.length===0?"no compute":null,compute:(f.route_allow??[]).map(A=>({costClass:A,label:Kl[A]??A,owned:_l.has(A),runtimes:jr(A).map(k=>k.id)})),connect:nc(f,v,t.connected,()=>r.open("manual")),cta:{label:tc(f,v,o===f.id),disabled:v||o!==null,busy:o===f.id,take:()=>b(f)}}}),[n.plans,n.current,i,t.connected,r,o,b]);return{offers:y,current:y.find(f=>f.current)??null,loading:n.loading,error:n.error,failed:s}}function $l(e){return e.contact_url?{amount:"Talk to us",interval:null,free:!1}:{amount:`$${e.price.toLocaleString()}`,interval:e.interval,free:e.price===0}}function ec(e){let n=[];return e.included_units===null?n.push("No ceiling on this plan"):(n.push(`Included each ${e.interval}`),e.estimated_tasks&&n.push(`about ${e.estimated_tasks.toLocaleString("en-US")} ${e.task_noun??"runs"}`),e.overage==="meter"&&e.overage_per_unit>0?n.push(`then $${e.overage_per_unit} per ${Dn(e.unit)}`):e.included_units>0&&n.push("then it stops")),e.trial_days>0&&n.push(`${e.trial_days}-day trial`),n.join(" \xB7 ")}function nc(e,n,t,r){let o=sn({unit:e.unit,reward:e.connected_reward,includedUnits:e.connected_included_units,creditMicros:e.connected_credit*1e6}),a=Ve(e.route_allow)&&!t;if(!o&&!a)return null;let s=an(e.connected_reward);return{key:o?"Connect your own":"To use this",line:o??(n?"Nothing connected yet, so nothing can run.":"Runs only on compute you connect."),reward:o!==null,actionable:n&&(s||a)&&!t,open:r}}function tc(e,n,t){return n?"Your plan":e.contact_url?"Talk to us":t?e.selectable?"Switching\u2026":"Opening\u2026":e.selectable?"Choose":`Subscribe for $${e.price.toLocaleString()}/${e.interval}`}import{jsx as C,jsxs as se}from"react/jsx-runtime";function gr(e){return e?`soba-connect sc-fill ${e}`:"soba-connect sc-fill"}function zt({onSelect:e,successUrl:n,cancelUrl:t,showCompute:r=!0,showConnect:o=!1,variant:a="cards",featured:s,className:c}){let{offers:i,loading:l,error:d,failed:g}=Qo({...s?{featured:s}:{},...e?{onSelect:e}:{},...n?{successUrl:n}:{},...t?{cancelUrl:t}:{}}),{theme:b}=te();if(d)return C("div",{className:gr(c),"data-theme":b,children:C("div",{className:"sc-card",children:C("p",{className:"sc-error",children:d.message})})});if(l)return C("div",{className:gr(c),"data-theme":b,children:C("div",{className:"sc-card",children:C("p",{className:"sc-note",children:"Loading plans\u2026"})})});if(i.length===0)return C("div",{className:gr(c),"data-theme":b,children:C("div",{className:"sc-card",children:C("p",{className:"sc-note",children:"This app has no plans yet."})})});let y={showCompute:r,showConnect:o};return se("div",{className:gr(c),"data-theme":b,"data-variant":a,children:[a==="rows"?C(oc,{offers:i,shelf:y}):a==="table"?C(sc,{offers:i,shelf:y}):C(rc,{offers:i,shelf:y}),g&&C("p",{className:"sc-error",children:g})]})}function rc({offers:e,shelf:n}){return C("div",{className:"sc-plans",children:e.map(t=>se("div",{className:oa("sc-plan",t),children:[se("div",{className:"sc-row-between",children:[C("span",{className:"sc-title",children:t.plan.name}),C(Jo,{offer:t})]}),C("p",{className:"sc-sub",children:t.plan.description}),C(Yo,{price:t.price,free:"forever"}),C(Zo,{offer:t,shelf:n}),C(sa,{offer:t}),C("div",{className:"sc-plan-band",children:n.showCompute&&C(qo,{offer:t})}),C("div",{className:"sc-plan-band",children:C(jo,{offer:t})})]},t.plan.id))})}function oc({offers:e,shelf:n}){return C("ul",{className:"sc-plan-rows",children:e.map(t=>se("li",{className:oa("sc-plan-row",t),children:[se("div",{className:"sc-row-main",children:[se("span",{className:"sc-row-name",children:[C("span",{className:"sc-title",children:t.plan.name}),C(Jo,{offer:t})]}),t.plan.description&&C("p",{className:"sc-sub",children:t.plan.description}),C(sa,{offer:t}),n.showCompute&&C(qo,{offer:t,inline:!0}),C(jo,{offer:t,inline:!0})]}),se("div",{className:"sc-row-side",children:[C(Yo,{price:t.price,free:"forever",small:!0}),C(Zo,{offer:t,shelf:n})]})]},t.plan.id))})}function sc({offers:e,shelf:n}){let t=e.some(s=>s.plan.overage_per_unit>0),r=e.some(s=>s.plan.trial_days>0),o=e.some(s=>s.connect!==null),a=s=>[s.current?"sc-col-current":"",s.featured?"sc-col-featured":""].filter(Boolean).join(" ")||void 0;return C("div",{className:"sc-table-scroll",children:se("table",{className:"sc-plan-table",children:[C("thead",{children:se("tr",{children:[C("td",{}),e.map(s=>se("th",{scope:"col",className:a(s),children:[se("span",{className:"sc-row-name",children:[C("span",{className:"sc-title",children:s.plan.name}),C(Jo,{offer:s})]}),C(Yo,{price:s.price,small:!0})]},s.plan.id))]})}),se("tbody",{children:[se("tr",{children:[C("th",{scope:"row",children:"Included"}),e.map(s=>C("td",{className:a(s),children:s.allowance},s.plan.id))]}),t&&se("tr",{children:[C("th",{scope:"row",children:"Then"}),e.map(s=>C("td",{className:a(s),children:s.plan.overage_per_unit>0?`$${s.plan.overage_per_unit} / ${Dn(s.plan.unit)}`:C("span",{className:"sc-muted-cell",children:"Stops"})},s.plan.id))]}),r&&se("tr",{children:[C("th",{scope:"row",children:"Trial"}),e.map(s=>C("td",{className:a(s),children:s.plan.trial_days>0?`${s.plan.trial_days} days`:C("span",{className:"sc-muted-cell",children:"None"})},s.plan.id))]}),n.showCompute&&se("tr",{children:[C("th",{scope:"row",children:"Runs on"}),e.map(s=>C("td",{className:a(s),children:C(qo,{offer:s,bare:!0})},s.plan.id))]}),o&&se("tr",{children:[C("th",{scope:"row",children:"Connect your own"}),e.map(s=>C("td",{className:a(s),children:C(jo,{offer:s,bare:!0})},s.plan.id))]}),se("tr",{className:"sc-table-buy",children:[C("td",{}),e.map(s=>C("td",{className:a(s),children:C(Zo,{offer:s,shelf:n})},s.plan.id))]})]})]})})}function oa(e,n){return[e,n.current?"sc-plan-current":"",n.featured?"sc-plan-featured":""].filter(Boolean).join(" ")}function Jo({offer:e}){return e.current?C("span",{className:"sc-plan-badge",children:"Current"}):e.featured?C("span",{className:"sc-plan-badge-soft",children:"Recommended"}):null}function Yo({price:e,small:n,free:t}){return se("p",{className:n?"sc-plan-price sc-plan-price-sm":"sc-plan-price",children:[C("span",{className:"sc-plan-amount",children:e.amount}),e.interval?se("span",{className:"sc-plan-interval",children:["/",e.interval]}):t&&C("span",{className:"sc-plan-interval sc-plan-after",children:t})]})}function sa({offer:e}){return se("p",{className:"sc-plan-allowance",children:[C("span",{className:"sc-plan-figure",children:e.allowance}),C("span",{className:"sc-plan-qualifier",children:e.allowanceNote}),e.ownAllowance&&C("span",{className:"sc-plan-qualifier",children:e.ownAllowance}),e.features.map(n=>C("span",{className:n.included?"sc-plan-qualifier sc-plan-feature":"sc-plan-qualifier sc-plan-feature sc-plan-feature-absent",children:n.text},n.text))]})}function jo({offer:e,inline:n,bare:t}){let r=e.connect;if(!r)return t?C("span",{className:"sc-muted-cell",children:"None"}):null;let o=r.reward?"sc-plan-reward-line":"sc-plan-reward-line sc-plan-reward-need",a=r.actionable?se("button",{type:"button",className:`${o} sc-plan-reward-act`,"aria-label":"Connect compute",onClick:r.open,children:[C("span",{className:"sc-reward-said",children:r.line}),se("span",{className:"sc-reward-do","aria-hidden":!0,children:[C(Me,{className:"sc-reward-mark"}),"Connect compute"]})]}):C("p",{className:o,children:r.line});return t?a:C("div",{className:n?"sc-plan-reward sc-plan-reward-inline":"sc-plan-reward",children:a})}function qo({offer:e,inline:n,bare:t}){let r=e.computeLabel?C("ul",{className:n?"sc-compute sc-compute-inline":"sc-compute",children:C("li",{children:e.computeLabel})}):C("ul",{className:n?"sc-compute sc-compute-inline":"sc-compute",children:e.compute.map(o=>se("li",{className:o.owned?"sc-compute-own":void 0,children:[o.label,C(ac,{runtimes:o.runtimes})]},o.costClass))});return t?r:se("div",{className:n?"sc-plan-compute sc-plan-compute-inline":"sc-plan-compute",children:[C("span",{className:"sc-fact-key",children:"Runs on"}),r]})}function Zo({offer:e,shelf:n}){let t=e.connect;return n.showConnect&&t?.actionable?se("button",{type:"button",className:"sc-btn sc-btn-primary sc-btn-icon",onClick:t.open,children:[C(Me,{className:"sc-btn-mark"}),"Connect compute"]}):C("button",{type:"button",className:e.current?"sc-btn":"sc-btn sc-btn-primary",disabled:e.cta.disabled,onClick:()=>void e.cta.take().catch(()=>{}),children:e.cta.label})}function ac({runtimes:e}){return e.length===0?null:C("span",{className:"sc-compute-marks",children:e.map(n=>{let t=An[n];return t?C(t,{className:"sc-rt-mark"},n):null})})}import{jsx as Xo,jsxs as aa}from"react/jsx-runtime";function ic({heading:e,plansHeading:n,showUsage:t=!0,showName:r=!0,className:o,...a}){let{plan:s,loading:c}=Ft(),{theme:i}=te(),l=n??(c?"Plans":s?"Change plan":"Choose a plan");return aa("div",{className:o?`soba-connect sc-fill sc-billing ${o}`:"soba-connect sc-fill sc-billing","data-theme":i,children:[Xo(Vo,{...e===void 0?{}:{heading:e},showUsage:t,showName:r}),aa("section",{className:"sc-billing-plans",children:[l&&Xo("h2",{className:"sc-section-title",children:l}),Xo(zt,{...a})]})]})}import{useCallback as ia,useState as la}from"react";function Ko({plan:e,successUrl:n,cancelUrl:t,label:r}){let{plan:o}=_(),[a,s]=la(!1),[c,i]=la(null),l=ia(()=>o.checkout(e.id,{...n?{successUrl:n}:{},...t?{cancelUrl:t}:{}}),[o,e.id,n,t]),d=ia(async()=>{s(!0),i(null);try{window.location.assign(await l())}catch(g){i(g.message),s(!1)}},[l]);return{label:a?"Opening\u2026":r??`Subscribe for $${e.price.toLocaleString()}/${e.interval}`,busy:a,error:c,buy:d,session:l}}import{jsx as ca,jsxs as cc}from"react/jsx-runtime";function lc({plan:e,successUrl:n,cancelUrl:t,label:r,className:o}){let{theme:a}=te(),s=Ko({plan:e,...n?{successUrl:n}:{},...t?{cancelUrl:t}:{},...r?{label:r}:{}});return cc("div",{className:o?`soba-connect ${o}`:"soba-connect","data-theme":a,children:[ca("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:s.busy,onClick:()=>void s.buy(),children:s.label}),s.error&&ca("p",{className:"sc-error",children:s.error})]})}import{useState as dc}from"react";import{useMemo as uc}from"react";function _o(e,n={}){let{plan:t}=_(),r=n.use??1;return uc(()=>{let o=t.current,a=t.plan?.features?.find(i=>i.id===e),s=o?o.features??Object.fromEntries((t.plan?.features??[]).map(i=>[i.id,i.value])):null,c=go({features:s,quantities:o?.quantities??{},ended:o?.ended??!1},e,r);return{...c,allowed:t.loading?!1:c.allowed,name:a?.name??e,unit:a?.unit??null,loading:t.loading,error:t.error,refresh:t.refresh}},[t.current,t.plan,t.loading,t.error,t.refresh,e,r])}import{Fragment as $o,jsx as vn,jsxs as ua}from"react/jsx-runtime";function pc({feature:e,use:n=1,children:t,fallback:r,loading:o=null,className:a}){let s=_o(e,{use:n});return s.loading?vn($o,{children:o}):s.allowed?vn($o,{children:t}):r!==void 0?vn($o,{children:typeof r=="function"?r(s):r}):vn(mc,{view:s,className:a})}function da(e){let n=e.unit||e.name.toLowerCase();switch(e.reason){case"no_plan":return`Pick a plan to use ${e.name.toLowerCase()}.`;case"plan_ended":return"Your plan has ended. Pick a plan to keep going.";case"limit_reached":return`Your plan includes ${e.limit} ${n}, and all ${e.limit} are in use.`;default:return`${e.name} isn't included in your plan.`}}function mc({view:e,className:n}){let{theme:t}=te(),[r,o]=dc(!1);return ua("section",{className:n?`soba-connect sc-fill ${n}`:"soba-connect sc-fill","data-theme":t,children:[ua("div",{className:"sc-card",children:[vn("p",{className:"sc-title",children:e.reason==="plan_ended"?"Plan ended":"Upgrade to continue"}),vn("p",{className:"sc-sub",children:da(e)}),!r&&vn("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>o(!0),children:"See plans"})]}),r&&vn(zt,{})]})}import{useCallback as Ue,useEffect as Ye,useMemo as Vn,useRef as ln,useState as ue}from"react";var fc="soba.session:";function pa(e){return!e.cacheKey||!e.endpoint?null:fc+JSON.stringify([e.endpoint,e.user??null,e.cacheKey])}function hc(e){try{let n=globalThis.localStorage?.getItem(e);if(!n)return null;let t=JSON.parse(n);return typeof t.token!="string"||typeof t.expiresAt!="number"?null:{token:t.token,expiresAt:t.expiresAt}}catch{return null}}function gc(e,n){try{n?globalThis.localStorage?.setItem(e,JSON.stringify(n)):globalThis.localStorage?.removeItem(e)}catch{}}var ma=6e4,bc=1e4,br=class{#e;#n=null;#r=null;#t;#o=new Set;constructor(n){this.#t=n,this.#e=n.token??null;let t=pa(n),r=t&&!this.#e?hc(t):null;r&&r.expiresAt-ma>Date.now()&&(this.#e=r.token,this.#n=r.expiresAt)}get token(){return this.#e}get expiresAt(){return this.#n}get canRefresh(){return!!this.#t.endpoint}get refreshAt(){return!this.canRefresh||this.#n===null?null:Math.max(Date.now()+bc,this.#n-ma)}subscribe(n){return this.#o.add(n),()=>this.#o.delete(n)}async ensure(){return this.#e?this.#e:this.refresh()}async refresh(){if(this.#r)return this.#r;let n=this.#t.endpoint;if(!n)throw new Error("This Soba session cannot be refreshed. Pass `sessionEndpoint` so the provider can mint a new one.");let t=this.#t.fetchImpl??fetch.bind(globalThis);this.#r=(async()=>{let r=await t(n,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(this.#t.user?{user:this.#t.user}:{})});if(!r.ok)throw new Error(`Could not start a Soba session (${r.status} from ${n}).`);let o=await r.json(),a=o.session??o.token;if(!a)throw new Error(`${n} answered without a \`session\`. See @soba-so/react's README.`);let s=o.expires_in??o.expiresIn;this.#e=a,this.#n=typeof s=="number"?Date.now()+s*1e3:null;let c=pa(this.#t);c&&gc(c,this.#n===null?null:{token:a,expiresAt:this.#n});for(let i of this.#o)i();return a})();try{return await this.#r}finally{this.#r=null}}},ct=new Map,fa=new WeakMap,Ac=1;function yc(e){if(e.token||!e.endpoint)return null;let n=0;return e.fetchImpl&&(n=fa.get(e.fetchImpl)??Ac++,fa.set(e.fetchImpl,n)),JSON.stringify([e.endpoint,e.user??null,n,e.cacheKey??null])}function ha(e){let n=yc(e);if(!n)return new br(e);let t=ct.get(n)??{holder:new br(e),users:0};return ct.set(n,t),t.holder}function ga(e){for(let n of ct.values())n.holder===e&&n.users++}function ba(e){for(let[n,t]of ct)if(t.holder===e){setTimeout(()=>{--t.users<=0&&ct.get(n)===t&&ct.delete(n)},0);return}}function Aa(e,n=fetch.bind(globalThis)){return async(t,r)=>{let o=await n(t,r);if(o.status!==401||!e.canRefresh)return o;let a;try{a=await e.refresh()}catch{return o}return n(t,wc(r,a))}}function wc(e,n){let t=new Headers(e?.headers);return t.set("authorization",`Bearer ${n}`),{...e,headers:t}}import{jsx as es,jsxs as Mc}from"react/jsx-runtime";var vc="https://soba.so",kc=3e4;function Cc(e){let{children:n,session:t,sessionEndpoint:r,user:o,sessionCacheKey:a,runEndpoint:s,theme:c,initialMachines:i,initialConnect:l=null,initialPlans:d,initialCurrentPlan:g=null,baseUrl:b=vc,pollMs:y=kc,injectStyles:f=!0,modal:v=!0,fetchImpl:A,onError:k}=e,[S,W]=ue(t??null),[L,D]=ue(null),[O,U]=ue(l),[w,K]=ue(null),[j,$]=ue(l===null),[ae,me]=ue(i??[]),[fe,R]=ue(null),[q,V]=ue(i===void 0),[Z,be]=ue(d??[]),[Y,he]=ue(g),[Ae,Te]=ue(null),[Re,ee]=ue(d===void 0),[de,u]=ue(null),[P,I]=ue(null),[J,B]=ue(!0),[ne,N]=ue(null),[H,ie]=ue(!1),Ee=ln(k);Ee.current=k;let je=Ue(p=>{D(p),Ee.current?.(p)},[]);Ye(()=>{f&&Ht()},[f]);let E=Vn(()=>ha({...t?{token:t}:{},...r?{endpoint:r}:{},...o?{user:o}:{},...A?{fetchImpl:A}:{},...a?{cacheKey:a}:{}}),[t,r,o,A,a]);Ye(()=>{let p=!0;ga(E);let M=E.subscribe(()=>{p&&W(E.token)});return!E.token&&!E.canRefresh?je(new Error("<SobaProvider> needs a `session` or a `sessionEndpoint`. A browser cannot mint one: that takes your secret key.")):E.ensure().then(()=>p&&W(E.token),Q=>p&&je(Q)),()=>{p=!1,M(),ba(E)}},[E,je]),Ye(()=>{L&&($(!1),V(!1),ee(!1),B(!1),K(p=>p??L),R(p=>p??L),Te(p=>p??L))},[L]),Ye(()=>{let p=E.refreshAt;if(p===null)return;let M=()=>{E.refresh().catch(ye=>je(ye))},Q=()=>{document.hidden||(document.removeEventListener("visibilitychange",Q),M())},oe=setTimeout(()=>{typeof document<"u"&&document.hidden?document.addEventListener("visibilitychange",Q):M()},Math.max(0,p-Date.now()));return()=>{clearTimeout(oe),typeof document<"u"&&document.removeEventListener("visibilitychange",Q)}},[E,je,S]);let kn=ln(l?.machines_url??null),G=Vn(()=>{if(!S)return null;let p=new ft({session:S,baseUrl:b,fetchImpl:Aa(E,A??fetch.bind(globalThis))});return p.setMachinesUrl(kn.current),p},[S,b,E,A]),cn=ln(l!==null);Ye(()=>{if(!G||cn.current)return;let p=!0;return $(!0),G.context().then(M=>{p&&(U(M),K(null),$(!1))},M=>{p&&(K(M),$(!1))}),()=>{p=!1}},[G]);let tn=Ue(async()=>{if(G)try{let p=await G.machines();me(Array.isArray(p)?p:[]),R(null)}catch(p){R(p)}finally{V(!1)}},[G]),ke=Ue(async()=>{if(G)try{let p=await G.plans();be(p.plans),he(p.current),Te(null)}catch(p){Te(p)}finally{ee(!1)}},[G]),Cn=ln(!1),[Mn,Nn]=ue(!1),ts=ln(d!==void 0),un=ln(!1),Vt=Ue(()=>{Cn.current||(Cn.current=!0,un.current&&queueMicrotask(()=>{un.current&&Nn(!0)}))},[]);Ye(()=>(un.current=!0,Cn.current&&Nn(!0),()=>{un.current=!1}),[]),Ye(()=>{!G||!Mn||ts.current||ke()},[G,Mn,ke]);let dn=Ue(async()=>{if(G)try{u(await G.modelOptions()),I(null)}catch(p){I(p)}finally{B(!1)}},[G]),Qn=ln(!1),[ge,qe]=ue(!1),ut=Ue(()=>{Qn.current||(Qn.current=!0,un.current&&queueMicrotask(()=>{un.current&&qe(!0)}))},[]);Ye(()=>{Qn.current&&qe(!0)},[]);let Jn=cn.current||O!==null;Ye(()=>{w&&!Jn&&B(!1)},[w,Jn]),Ye(()=>{!G||!ge||!Jn||dn()},[G,ge,Jn,dn,Y?.plan_id]);let Qt=Ue(async p=>{if(!G)throw new Error("No session yet.");await G.selectPlan(p),await ke()},[G,ke]),Jt=Ue(async(p,M)=>{if(!G)throw new Error("No session yet.");let Q=await G.checkoutPlan(p,M);if(!Q.url)throw new Error("Checkout could not be started.");return Q.url},[G]),Yt=Ue(async()=>{if(!G)throw new Error("No session yet.");await G.leavePlan(),await ke()},[G,ke]),Yn=ln(i!==void 0);Ye(()=>{if(!G)return;let p=He(tn,y,{immediate:!Yn.current});return Yn.current=!1,p},[G,tn,y]);let xn=Ue((p="manual")=>{v&&(ie(!0),N(p))},[v]),jt=Ue(()=>N(null),[]),Sn=ln(ae);Sn.current=ae;let Be=Ue(async p=>{if(!s)throw new Error("Pass `runEndpoint` to <SobaProvider> to start runs from the browser. It is your own route: it holds your secret key, calls soba.run(), and forwards the stream.");let{signal:M,...Q}=p,ye=await(A??fetch.bind(globalThis))(s,{method:"POST",headers:{"content-type":"application/json",accept:"text/event-stream"},credentials:"same-origin",body:JSON.stringify(Q),...M?{signal:M}:{}});if(!ye.ok){let pe=await ye.json().catch(()=>null),Xe=new Error(pe?.error?.message??`${s} answered ${ye.status}.`);Xe.status=ye.status,pe?.error?.code&&(Xe.code=pe.error.code),pe?.error&&(Xe.error=pe.error);let dt=Sn.current.length>0&&!Sn.current.some(ya=>ya.state!=="offline");throw ye.status===409&&dt&&xn("no_compute"),Xe}let rn=zo(ye);return async function*(){try{yield*rn}finally{Cn.current&&ke(),Qn.current&&dn()}}()},[s,A,ke,dn,xn]),Ce=Vn(()=>Y?Z.find(p=>p.id===Y.plan_id)??null:null,[Z,Y]),pn=Vn(()=>Ce?Ce.connected_reward==="included"&&ae.length>0&&Ce.connected_included_units!==null?Ce.connected_included_units:Ce.included_units:null,[Ce,ae]),Ze=Vn(()=>({plans:Z,current:Y,plan:Ce,used:Y?.units_used??null,included:pn,remaining:pn!==null&&Y?Math.max(0,pn-Y.units_used):null,unlimited:Ce!==null&&pn===null,loading:Re,error:Ae,select:Qt,checkout:Jt,leave:Yt,refresh:ke}),[Z,Y,Ce,pn,Re,Ae,Qt,Jt,Yt,ke]),qt=Vn(()=>({providers:de?.providers??[],names:de?.names??[],layout:de?.layout??null,sizes:de?.sizes!==!1,rowsByLayout:de?.rowsByLayout??{},route:de?.route??null,loading:J,error:P,refresh:dn}),[de,J,P,dn]),Ar=Vn(()=>({session:S,client:G,error:L,get plan(){return Vt(),Ze},get models(){return ut(),qt},compute:{machines:ae,connected:ae.length>0,online:ae.some(p=>p.state!=="offline"),loading:q,error:fe,refresh:tn},connect:{app:O?.app??null,command:O?.command??null,connectUrl:O?.connect_url??null,publishableKey:O?.publishable_key??null,loading:j,error:w,open:xn,close:jt,isOpen:ne!==null,hasModal:v},run:Be}),[S,G,L,Ze,Vt,qt,ut,ne,xn,jt,v,ae,q,fe,tn,O,j,w,Be]);return es(Po.Provider,{value:G,children:es(Ro.Provider,{value:{context:O,machines:q?void 0:ae,theme:c??O?.theme??"light"},children:Mc(Eo.Provider,{value:Ar,children:[n,v&&H&&es(Gt,{open:ne!==null,onOpenChange:p=>N(p?ne??"manual":null),onConnected:()=>{tn()},...ne==="payment_required"||ne==="no_compute"?{reason:ne}:{},...ne==="pair"?{showStatus:!1}:{}})]})})})}function Nc(e){return e?xc[e]??e:null}var xc={"user-hardware":"your own computer","user-subscription":"your own AI plan","user-api-key":"your own API key","open-weights":"open models we host",frontier:"a frontier model we pay for"};async function Sc(e,n,t){let r=n.local;if(!r?.session||n.after)return null;let o=/\/v1\/runs\/([^/]+)\/events/.exec(e.url)?.[1];if(!o)return null;let a=`http://127.0.0.1:${r.port??47321}/v1/runs/${o}/events`,s=new AbortController,c=()=>s.abort();n.signal?.addEventListener("abort",c);let i=setTimeout(()=>s.abort(),r.timeoutMs??3e3);try{let l=await t(a,{headers:{authorization:`Bearer ${r.session}`,accept:"text/event-stream"},signal:s.signal});return l.ok?{url:a,bearer:r.session,open:l}:null}catch{return null}finally{clearTimeout(i),n.signal?.removeEventListener("abort",c)}}async function*Pc(e){let n=e.body;if(!n)return;let t=n.getReader(),r=new TextDecoder,o="",a=null,s=[];try{for(;;){let c=await t.read();if(c.done)return;o+=r.decode(c.value,{stream:!0});for(let i=o.indexOf(`
4473
+ `);i!==-1;i=o.indexOf(`
4474
+ `)){let l=o.slice(0,i).replace(/\r$/,"");if(o=o.slice(i+1),l==="")s.length&&(yield{id:a,data:s.join(`
4475
+ `)}),a=null,s=[];else if(l.startsWith("id:")){let d=Number(l.slice(3).trim());a=Number.isFinite(d)?d:null}else if(l.startsWith("data:")){let d=l.slice(5);s.push(d.startsWith(" ")?d.slice(1):d)}}}}finally{t.cancel().catch(()=>{})}}var ns=(e,n)=>new Promise(t=>{let r=setTimeout(t,e);n?.addEventListener("abort",()=>{clearTimeout(r),t()})});async function*Rc(e,n={}){let t=n.fetchImpl??fetch.bind(globalThis),r=await Sc(e,n,t)??{url:e.url,bearer:e.token,open:null},o=n.maxRetries??6,a=n.after??0,s=0;for(;;){if(n.signal?.aborted)return;let c;try{c=r.open??await t(r.url,{headers:{authorization:`Bearer ${r.bearer}`,accept:"text/event-stream",...a?{"last-event-id":String(a)}:{}},...n.signal?{signal:n.signal}:{}}),r.open=null}catch(i){if(n.signal?.aborted)return;if(++s>o)throw i;await ns(1e3*s,n.signal);continue}if(c.status===503&&s<o){s++,await ns(Number(c.headers.get("retry-after")??3)*1e3,n.signal);continue}if(!c.ok){let i=`Could not read this run (${c.status}).`;try{let l=await c.json();l.error?.message&&(i=l.error.message)}catch{}throw new Error(i)}for await(let i of Pc(c)){i.id!==null&&(a=i.id),s=0;let l=lt(i.data);if(l&&(yield l,l.type==="done"||l.type==="error"))return}if(n.signal?.aborted)return;if(++s>o)throw new Error("Lost this run's stream and could not get it back.");await ns(1e3*s,n.signal)}}export{nl as ComputeStatus,Fn as ConnectButton,dl as ConnectCompute,Gt as ConnectModal,xl as ConnectNudge,Oo as ConnectPill,Ll as ModelPicker,Ol as ProviderMark,Wl as RunError,Ul as RunLimit,ic as SobaBilling,lc as SobaCheckout,Vo as SobaCurrentPlan,pc as SobaGate,zt as SobaPlans,Cc as SobaProvider,Il as collectText,To as connectSays,da as gateMessage,Ht as injectStyles,el as modelLogo,lt as parseEvent,zo as readEvents,ea as runErrorMessage,zn as sobaErrorCode,Nc as tierLabel,Ko as useCheckout,Tt as useCompute,al as useConnectButton,Fo as useConnectNudge,Ft as useCurrentPlan,_o as useFeature,Bo as useMachineRuns,Un as useModel,Dt as useOpenSobaConnect,Qo as usePlans,Ho as useRunLimit,_ as useSoba,Rc as watchRun};