Skip to content

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

118 KB
Raw Blame
import{A as e,N as t,_ as n,b as r,c as i,d as a,f as o,j as s,k as c,l,p as u,r as d,s as f,u as p,y as m}from"./served-from-8DzM0VAM.js";import{$ as h,H as g,I as _,J as v,L as y,N as b,O as x,P as S,R as C,V as w,X as T,at as E,h as D,l as ee,rt as O,t as k,tt as te,x as A}from"./local-source-emarjVnA.js";import{t as j}from"./focus-overview-CQWF43T3.js";import{A as ne,F as re,H as ie,I as ae,K as oe,M as se,N as M,O as ce,P as N,W as le,b as ue,i as de,j as fe,w as pe,y as me}from"./parse-sse-frame-DXl4zDFf.js";import{i as he,n as ge,r as _e,t as ve}from"./data-goals-M40Vf9Yw.js";var P=t(s(),1),ye=t(e(),1),F=c(),be=[`system`,`light`,`dark`],xe=`claude-mem-theme`;function Se(e){return be.includes(e)}function Ce(e,t){return e===`system`?t?`dark`:`light`:e}function we(e){try{let t=(e??localStorage).getItem(xe);return Se(t)?t:null}catch(e){return console.warn(`The saved theme could not be read, so the page follows the system theme:`,e instanceof Error?e.message:String(e)),null}}function Te(e,t){try{(t??localStorage).setItem(xe,e)}catch(e){console.warn(`The theme could not be saved, so it lasts only while this page is open:`,e instanceof Error?e.message:String(e))}}var Ee=`claude-mem:my-work:preferences`,De=`system`;function Oe(e){try{let{version:t,state:n}=JSON.parse((e??localStorage).getItem(`claude-mem:my-work:preferences`)??`null`)??{};return t!==void 0&&t>=1&&t<=2&&Se(n?.theme)?n.theme:null}catch(e){return console.warn(`[my-work] The theme saved in the display preferences could not be read:`,e instanceof Error?e.message:String(e)),null}}function ke(e){let t=we(e);if(t)return t;let n=Oe(e);return n?(Te(n,e),n):De}var Ae=[`all`],je=`more`;function Me(e){let t=(e,t)=>oe(t)-oe(e);return[...e.filter(ie)].sort(t)[0]??[...e].sort(t)[0]}function Ne(e,t,n){let r=ue(t);return n.filter(t=>r(t.focusAreaId)===e)}function Pe(e,t){let n=t.filter(e=>!e.closed),r=t.filter(e=>!!e.closed),i=(e?.subFocuses??[]).flatMap(e=>{let t=n.filter(t=>t.subFocusId===e.id);return t.length<2?[]:[{subFocus:e,members:t,lead:Me(t),working:t.filter(ie).length,needYou:t.filter(le).length}]});if(i.length<2)return{open:n,closed:r,cards:[],more:[]};let a=new Set(i.map(e=>e.subFocus.id));return{open:n,closed:r,cards:i,more:n.filter(e=>!e.subFocusId||!a.has(e.subFocusId))}}function Fe(e,t,n){let r=new Set(t.cards.map(e=>e.subFocus.id)),i=(e.subFocuses??[]).filter(e=>e.id!==n).map(e=>({subFocus:e,open:t.open.filter(t=>t.subFocusId===e.id).length}));return[...i.filter(e=>r.has(e.subFocus.id)),...i.filter(e=>!r.has(e.subFocus.id))]}function Ie(e,t,n){let r=n?e.closed:e.open;if(t.kind===`area`)return r;if(t.kind===`sub`)return r.filter(e=>e.subFocusId===t.card.subFocus.id);let i=new Set(e.cards.map(e=>e.subFocus.id));return r.filter(e=>!e.subFocusId||!i.has(e.subFocusId))}function Le(e,t,n,r,i){let a=e===`other`?null:t.find(t=>t.id===e)??null,o=Pe(a,Ne(e,t,n)),s=(i!==null&&i!==`more`?o.cards.find(e=>e.subFocus.id===i)??null:null)??(i===`more`&&o.more.length>0?`more`:null),c=s===null&&o.cards.length>0?r:null,l=a!==null&&o.open.length===0&&o.closed.length===0;return{area:a,requests:o,tab:c,sub:s,list:s!==null||(o.cards.length>0?c!==null:!l)}}var Re=e=>e===null||e===`more`?e:e.subFocus.id;function ze(e){return[...e.quotes].sort((e,t)=>t.at.localeCompare(e.at))[0]?.quote.trim()||e.title}var Be=Object.defineProperty,Ve=(e,t)=>Be(e,`name`,{value:t,configurable:!0}),He=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ue=P.forwardRef(Ve(function(e,t){return(0,F.jsx)(u.span,{...e,ref:t,style:{...He,...e.style}})},`VisuallyHidden`)),We=Object.defineProperty,Ge=(e,t)=>We(e,`name`,{value:t,configurable:!0});function Ke(e){let[t,n]=P.useState(void 0);return a(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}Ge(Ke,`useSize`);var qe=[`top`,`right`,`bottom`,`left`],Je=Math.min,I=Math.max,Ye=Math.round,Xe=Math.floor,L=e=>({x:e,y:e}),Ze={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Qe(e,t,n){return I(e,Je(t,n))}function $e(e,t){return typeof e==`function`?e(t):e}function et(e){return e.split(`-`)[0]}function tt(e){return e.split(`-`)[1]}function nt(e){return e===`x`?`y`:`x`}function rt(e){return e===`y`?`height`:`width`}function R(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function it(e){return nt(R(e))}function at(e,t,n){n===void 0&&(n=!1);let r=tt(e),i=it(e),a=rt(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=mt(o)),[o,mt(o)]}function ot(e){let t=mt(e);return[st(e),t,st(t)]}function st(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ct=[`left`,`right`],lt=[`right`,`left`],ut=[`top`,`bottom`],dt=[`bottom`,`top`];function ft(e,t,n){switch(e){case`top`:case`bottom`:return n?t?lt:ct:t?ct:lt;case`left`:case`right`:return t?ut:dt;default:return[]}}function pt(e,t,n,r){let i=tt(e),a=ft(et(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(st)))),a}function mt(e){let t=et(e);return Ze[t]+e.slice(t.length)}function ht(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function gt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ht(e)}function _t(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function vt(e,t,n){let{reference:r,floating:i}=e,a=R(t),o=it(t),s=rt(o),c=et(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=tt(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function yt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=$e(t,e),p=gt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=_t(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=_t(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var bt=50,xt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:yt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=vt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<bt&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=vt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},St=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=$e(e,t)||{};if(l==null)return{};let d=gt(u),f={x:n,y:r},p=it(i),m=rt(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Je(d[_],T),D=Je(d[v],T),ee=C-h[m]-D,O=C/2-h[m]/2+w,k=Qe(E,O,ee),te=!c.arrow&&tt(i)!=null&&O!==k&&a.reference[m]/2-(O<E?E:D)-h[m]/2<0,A=te?O<E?O-E:O-ee:0;return{[p]:f[p]+A,data:{[p]:k,centerOffset:O-k-A,...te&&{alignmentOffset:A}},reset:te}}}),Ct=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=$e(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=et(r),_=R(o),v=et(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[mt(o)]:ot(o)),x=p!==`none`;!d&&x&&b.push(...pt(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=at(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===R(t)||T.every(e=>R(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=R(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function wt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Tt(e){return qe.some(t=>e[t]>=0)}var Et=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=$e(e,t);switch(i){case`referenceHidden`:{let e=wt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Tt(e)}}}case`escaped`:{let e=wt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Tt(e)}}}default:return{}}}}},Dt=new Set([`left`,`top`]);async function Ot(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=et(n),s=tt(n),c=R(n)===`y`,l=Dt.has(o)?-1:1,u=a&&c?-1:1,d=$e(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var kt=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ot(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},At=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=$e(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=R(i),p=nt(f),m=u[p],h=u[f],g=(e,t)=>Qe(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},jt=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=$e(e,t),u={x:n,y:r},d=R(i),f=nt(d),p=u[f],m=u[d],h=$e(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Dt.has(et(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Mt=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=$e(e,t),c=await i.detectOverflow(t,s),l=et(n),u=tt(n),d=R(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Je(p-c[m],g),y=Je(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*I(c.left,c.right):S=p-2*I(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Nt(){return typeof window<`u`}function Pt(e){return Ft(e)?(e.nodeName||``).toLowerCase():`#document`}function z(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function B(e){return((Ft(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ft(e){return Nt()?e instanceof Node||e instanceof z(e).Node:!1}function V(e){return Nt()?e instanceof Element||e instanceof z(e).Element:!1}function It(e){return Nt()?e instanceof HTMLElement||e instanceof z(e).HTMLElement:!1}function Lt(e){return!Nt()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof z(e).ShadowRoot}function Rt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=H(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function zt(e){return/^(table|td|th)$/.test(Pt(e))}function Bt(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Vt=/transform|translate|scale|rotate|perspective|filter/,Ht=/paint|layout|strict|content/,Ut=e=>!!e&&e!==`none`,Wt;function Gt(e){let t=V(e)?H(e):e;return Ut(t.transform)||Ut(t.translate)||Ut(t.scale)||Ut(t.rotate)||Ut(t.perspective)||!qt()&&(Ut(t.backdropFilter)||Ut(t.filter))||Vt.test(t.willChange||``)||Ht.test(t.contain||``)}function Kt(e){let t=Xt(e);for(;It(t)&&!Jt(t);){if(Gt(t))return t;if(Bt(t))return null;t=Xt(t)}return null}function qt(){return Wt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Wt}function Jt(e){return/^(html|body|#document)$/.test(Pt(e))}function H(e){return z(e).getComputedStyle(e)}function Yt(e){return V(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xt(e){if(Pt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Lt(e)&&e.host||B(e);return Lt(t)?t.host:t}function Zt(e){let t=Xt(e);return Jt(t)?(e.ownerDocument||e).body:It(t)&&Rt(t)?t:Zt(t)}function Qt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Zt(e),i=r===e.ownerDocument?.body,a=z(r);if(i){let e=$t(a);return t.concat(a,a.visualViewport||[],Rt(r)?r:[],e&&n?Qt(e):[])}return t.concat(r,Qt(r,[],n))}function $t(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function en(e){let t=H(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=It(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ye(n)!==a||Ye(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function tn(e){return V(e)?e:e.contextElement}function nn(e){let t=tn(e);if(!It(t))return L(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=en(t),o=(a?Ye(n.width):n.width)/r,s=(a?Ye(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var rn=L(0);function an(e){let t=z(e);return!qt()||!t.visualViewport?rn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function on(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===z(e)}function sn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=tn(e),o=L(1);t&&(r?V(r)&&(o=nn(r)):o=nn(e));let s=on(a,n,r)?an(a):L(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=z(a),t=V(r)?z(r):r,n=e,i=$t(n);for(;i&&t!==n;){let e=nn(i),t=i.getBoundingClientRect(),r=H(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=z(i),i=$t(n)}}return _t({width:u,height:d,x:c,y:l})}function cn(e,t){let n=Yt(e).scrollLeft;return t?t.left+n:sn(B(e)).left+n}function ln(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-cn(e,n),y:n.top+t.scrollTop}}function un(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=B(r),s=t?Bt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=L(1),u=L(0),d=It(r);if((d||!a)&&((Pt(r)!==`body`||Rt(o))&&(c=Yt(r)),d)){let e=sn(r);l=nn(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ln(o,c):L(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function dn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function fn(e){let t=Yt(e),n=e.ownerDocument.body,r=I(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=I(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+cn(e),o=-t.scrollTop;return H(n).direction===`rtl`&&(a+=I(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var pn=25;function mn(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=z(e),a=B(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!qt()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(cn(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=pn&&(s-=o)}return{width:s,height:c,x:l,y:u}}function hn(e,t){let n=sn(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=nn(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function gn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=mn(e,n,t);else if(t===`document`)r=fn(B(e));else if(V(t))r=hn(t,n);else{let n=an(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return _t(r)}function _n(e,t){let n=t.get(e);if(n)return n;let r=Qt(e,[],!1).filter(e=>V(e)&&Pt(e)!==`body`),i=null,a=H(e).position===`fixed`,o=a?Xt(e):e;for(;V(o)&&!Jt(o);){let e=H(o),t=Gt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Xt(o)}return t.set(e,r),r}function vn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Bt(t)?[]:_n(t,this._c):[].concat(n),r],o=gn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=gn(t,a[e],i);s=I(n.top,s),c=Je(n.right,c),l=Je(n.bottom,l),u=I(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function yn(e){let{width:t,height:n}=en(e);return{width:t,height:n}}function bn(e,t,n){let r=It(t),i=B(t),a=n===`fixed`,o=sn(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=L(0);if((r||!a)&&((Pt(t)!==`body`||Rt(i))&&(s=Yt(t)),r)){let e=sn(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=cn(i));let l=i&&!r&&!a?ln(i,s):L(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function xn(e){return H(e).position===`static`}function Sn(e,t){if(!It(e)||H(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return B(e)===n&&(n=n.ownerDocument.body),n}function Cn(e,t){let n=z(e);if(Bt(e))return n;if(!It(e)){let t=Xt(e);for(;t&&!Jt(t);){if(V(t)&&!xn(t))return t;t=Xt(t)}return n}let r=Sn(e,t);for(;r&&zt(r)&&xn(r);)r=Sn(r,t);return r&&Jt(r)&&xn(r)&&!Gt(r)?n:r||Kt(e)||n}var wn=async function(e){let t=this.getOffsetParent||Cn,n=this.getDimensions,r=await n(e.floating);return{reference:bn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Tn(e){return H(e).direction===`rtl`}var En={convertOffsetParentRelativeRectToViewportRelativeRect:un,getDocumentElement:B,getClippingRect:vn,getOffsetParent:Cn,getElementRects:wn,getClientRects:dn,getDimensions:yn,getScale:nn,isElement:V,isRTL:Tn};function Dn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function On(e,t,n){let r=null,i,a=B(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Xe(d),h=Xe(a.clientWidth-(u+f)),g=Xe(a.clientHeight-(d+p)),_=Xe(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:I(0,Je(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Dn(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=z(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function kn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=tn(e),u=i||a?[...l?Qt(l):[],...t?Qt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?On(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?sn(e):null;c&&g();function g(){let t=sn(e);h&&!Dn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var An=kt,jn=At,Mn=Ct,Nn=Mt,Pn=Et,Fn=St,In=jt,Ln=(e,t,n)=>{let r=new Map,i=n??{},a={...En,...i.platform,_c:r};return xt(e,t,{...i,platform:a})},Rn=typeof document<`u`?P.useLayoutEffect:function(){};function zn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!zn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!zn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Bn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vn(e,t){let n=Bn(e);return Math.round(t*n)/n}function Hn(e){let t=P.useRef(e);return Rn(()=>{t.current=e}),t}function Un(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=P.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=P.useState(r);zn(f,r)||p(r);let[m,h]=P.useState(null),[g,_]=P.useState(null),v=P.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=P.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=P.useRef(null),C=P.useRef(null),w=P.useRef(u),T=c!=null,E=Hn(c),D=Hn(i),ee=Hn(l),O=P.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Ln(S.current,C.current,e).then(e=>{let t={...e,isPositioned:ee.current!==!1};k.current&&!zn(w.current,t)&&(w.current=t,ye.flushSync(()=>{d(t)}))})},[f,t,n,D,ee]);Rn(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=P.useRef(!1);Rn(()=>(k.current=!0,()=>{k.current=!1}),[]),Rn(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let te=P.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),A=P.useMemo(()=>({reference:b,floating:x}),[b,x]),j=P.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=Vn(A.floating,u.x),r=Vn(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Bn(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:O,refs:te,elements:A,floatingStyles:j}),[u,O,te,A,j])}var Wn=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Fn({element:r.current,padding:i}).fn(n):r?Fn({element:r,padding:i}).fn(n):{}}}},Gn=(e,t)=>{let n=An(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kn=(e,t)=>{let n=jn(e);return{name:n.name,fn:n.fn,options:[e,t]}},qn=(e,t)=>({fn:In(e).fn,options:[e,t]}),Jn=(e,t)=>{let n=Mn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yn=(e,t)=>{let n=Nn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xn=(e,t)=>{let n=Pn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zn=(e,t)=>{let n=Wn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qn=Object.defineProperty,$n=P.forwardRef(((e,t)=>Qn(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,F.jsx)(u.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,F.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),er=Object.defineProperty,U=(e,t)=>er(e,`name`,{value:t,configurable:!0}),tr={Partial:`partial`,Always:`always`},nr={Optimized:`optimized`,Always:`always`},rr=`Popper`,[ir,ar]=o(rr),[or,sr]=ir(rr),cr=U(e=>{let{__scopePopper:t,children:n}=e,[r,i]=P.useState(null),[a,o]=P.useState(void 0);return(0,F.jsx)(or,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),lr=`PopperAnchor`,ur=P.forwardRef(U(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=sr(lr,n),o=P.useRef(null),s=a.onAnchorChange,c=P.useCallback(e=>{o.current=e,e&&s(e)},[s]),l=m(t,c),d=P.useRef(null);P.useEffect(()=>{if(!r)return;let e=d.current;d.current=r.current,e!==d.current&&s(d.current)});let f=a.placementState&&br(a.placementState),p=f?.[0],h=f?.[1];return r?null:(0,F.jsx)(u.div,{"data-radix-popper-side":p,"data-radix-popper-align":h,...i,ref:l})},`PopperAnchor`)),dr=`PopperContent`,[fr,pr]=ir(dr),mr=P.forwardRef(U(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:o=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=tr.Partial,hideWhenDetached:h=!1,updatePositionStrategy:g=nr.Optimized,onPlaced:_,...v}=e,y=sr(dr,n),[b,x]=P.useState(null),S=m(t,x),[C,w]=P.useState(null),T=Ke(C),E=T?.width??0,D=T?.height??0,ee=r+(o===`center`?``:`-`+o),k=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},te=Array.isArray(d)?d:[d],A=te.length>0,j={padding:k,boundary:te.filter(vr),altBoundary:A},{refs:ne,floatingStyles:re,placement:ie,isPositioned:ae,middlewareData:oe}=Un({strategy:`fixed`,placement:ee,whileElementsMounted:U((...e)=>kn(...e,{animationFrame:g===nr.Always}),`whileElementsMounted`),elements:{reference:y.anchor},middleware:[Gn({mainAxis:i+D,alignmentAxis:s}),l&&Kn({mainAxis:!0,crossAxis:!1,...p===tr.Partial?{limiter:qn()}:{},...j}),l&&Jn({...j}),Yn({...j,apply:U(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),C&&Zn({element:C,padding:c}),yr({arrowWidth:E,arrowHeight:D}),h&&Xn(A?{strategy:`referenceHidden`,...j}:{strategy:`referenceHidden`,padding:j.padding,altBoundary:j.altBoundary})]}),se=y.setPlacementState;a(()=>(se(ie),()=>{se(void 0)}),[ie,se]);let[M,ce]=br(ie),N=O(_);a(()=>{ae&&N?.()},[ae,N]);let le=oe.arrow?.x,ue=oe.arrow?.y,de=oe.arrow?.centerOffset!==0,[fe,pe]=P.useState();return a(()=>{b&&pe(window.getComputedStyle(b).zIndex)},[b]),(0,F.jsx)(`div`,{ref:ne.setFloating,"data-radix-popper-content-wrapper":``,style:{...re,transform:ae?re.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:fe,"--radix-popper-transform-origin":[oe.transformOrigin?.x,oe.transformOrigin?.y].join(` `),...oe.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,F.jsx)(fr,{scope:n,placedSide:M,placedAlign:ce,onArrowChange:w,arrowX:le,arrowY:ue,shouldHideArrow:de,children:(0,F.jsx)(u.div,{"data-side":M,"data-align":ce,...v,ref:S,style:{...v.style,animation:ae?v.style?.animation:`none`}})})})},`PopperContent`)),hr=`PopperArrow`,gr={top:`bottom`,right:`left`,bottom:`top`,left:`right`},_r=P.forwardRef(U(function(e,t){let{__scopePopper:n,...r}=e,i=pr(hr,n),a=gr[i.placedSide];return(0,F.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,F.jsx)($n,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function vr(e){return e!==null}U(vr,`isNotNull`);var yr=U(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=br(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function br(e){let[t,n=`center`]=e.split(`-`);return[t,n]}U(br,`getSideAndAlignFromPlacement`);var xr=Object.defineProperty,W=(e,t)=>xr(e,`name`,{value:t,configurable:!0}),[Sr,Cr]=o(`Tooltip`,[ar]),wr=ar(),Tr=`TooltipProvider`,Er=700,Dr=`tooltip.open`,[Or,kr]=Sr(Tr),Ar=W(e=>{let{__scopeTooltip:t,delayDuration:n=Er,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=P.useRef(!0),s=P.useRef(!1),c=P.useRef(0);return P.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,F.jsx)(Or,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:P.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:P.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:P.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),jr=`Tooltip`,[Mr,Nr]=Sr(jr),Pr=W(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=kr(jr,e.__scopeTooltip),u=wr(t),[d,p]=P.useState(null),[m,h]=P.useState(void 0),g=f(),_=P.useRef(0),v=o??c.disableHoverableContent,y=s??c.delayDuration,b=P.useRef(!1),[x,S]=l({prop:r,defaultProp:i??!1,onChange:W(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Dr))):c.onClose(),a?.(e)},`onChange`),caller:jr}),C=P.useMemo(()=>x?b.current?`delayed-open`:`instant-open`:`closed`,[x]),w=P.useCallback(()=>{window.clearTimeout(_.current),_.current=0,b.current=!1,S(!0)},[S]),T=P.useCallback(()=>{window.clearTimeout(_.current),_.current=0,S(!1)},[S]),E=P.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{b.current=!0,S(!0),_.current=0},y)},[y,S]);P.useEffect(()=>()=>{_.current&&=(window.clearTimeout(_.current),0)},[]);let D=m??g;return(0,F.jsx)(cr,{...u,children:(0,F.jsx)(Mr,{scope:t,contentId:D,setContentId:h,open:x,stateAttribute:C,trigger:d,onTriggerChange:p,onTriggerEnter:P.useCallback(()=>{c.isOpenDelayedRef.current?E():w()},[c.isOpenDelayedRef,E,w]),onTriggerLeave:P.useCallback(()=>{v?T():(window.clearTimeout(_.current),_.current=0)},[T,v]),onOpen:w,onClose:T,disableHoverableContent:v,children:n})})},`Tooltip`),Fr=`TooltipTrigger`,Ir=P.forwardRef(W(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=Nr(Fr,n),o=kr(Fr,n),s=wr(n),c=P.useRef(null),l=m(t,c,a.onTriggerChange),d=P.useRef(!1),f=P.useRef(!1),h=P.useCallback(()=>d.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener(`pointerup`,h),[h]),(0,F.jsx)(ur,{asChild:!0,...s,children:(0,F.jsx)(u.button,{"aria-describedby":a.open?$r(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:l,onPointerMove:p(e.onPointerMove,e=>{e.pointerType!==`touch`&&!f.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),f.current=!0)}),onPointerLeave:p(e.onPointerLeave,()=>{a.onTriggerLeave(),f.current=!1}),onPointerDown:p(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener(`pointerup`,h,{once:!0})}),onFocus:p(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:p(e.onBlur,a.onClose),onClick:p(e.onClick,a.onClose)})})},`TooltipTrigger`)),Lr=`TooltipPortal`,[Rr,zr]=Sr(Lr,{forceMount:void 0}),Br=W(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,o=Nr(Lr,t);return(0,F.jsx)(Rr,{scope:t,forceMount:n,children:(0,F.jsx)(i,{present:n||o.open,children:(0,F.jsx)(T,{asChild:!0,container:a,children:r})})})},`TooltipPortal`),Vr=`TooltipContent`,Hr=P.forwardRef(W(function(e,t){let n=zr(Vr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a=`top`,...o}=e,s=Nr(Vr,e.__scopeTooltip);return(0,F.jsx)(i,{present:r||s.open,children:s.disableHoverableContent?(0,F.jsx)(Gr,{side:a,...o,ref:t}):(0,F.jsx)(Ur,{side:a,...o,ref:t})})},`TooltipContent`)),Ur=P.forwardRef(W(function(e,t){let n=Nr(Vr,e.__scopeTooltip),r=kr(Vr,e.__scopeTooltip),i=P.useRef(null),a=m(t,i),[o,s]=P.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=P.useCallback(()=>{s(null),d(!1)},[d]),p=P.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Jr(r,qr(r,n.getBoundingClientRect())),a=Yr(t.getBoundingClientRect()),o=Zr([...i,...a]);s(o),d(!0)},[d]);return P.useEffect(()=>()=>f(),[f]),P.useEffect(()=>{if(c&&u){let e=W(e=>p(e,u),`handleTriggerLeave`),t=W(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),P.useEffect(()=>{if(o){let e=W(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Xr(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,F.jsx)(Gr,{...e,ref:a})},`TooltipContentHoverable`)),Wr=n(`TooltipContent`),Gr=P.forwardRef(W(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:o,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=Nr(Vr,n),d=wr(n),{onClose:f}=u,[p,g]=P.useState(null),_=m(t,g);h(p),P.useEffect(()=>(document.addEventListener(Dr,f),()=>document.removeEventListener(Dr,f)),[f]),P.useEffect(()=>{if(u.trigger){let e=W(e=>{e.target instanceof Node&&e.target.contains(u.trigger)&&f()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[u.trigger,f]);let{setContentId:v}=u;return a(()=>(v(o),()=>{v(void 0)}),[o,v]),(0,F.jsx)(te,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,F.jsxs)(mr,{"data-state":u.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:u.contentId,...d,...l,ref:_,style:{...l.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,F.jsx)(Wr,{children:r}),i?(0,F.jsx)(Ue,{id:u.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Kr=P.forwardRef(W(function(e,t){let{__scopeTooltip:n,...r}=e,i=wr(n);return(0,F.jsx)(_r,{...i,...r,ref:t})},`TooltipArrow`));function qr(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}W(qr,`getExitSideFromRect`);function Jr(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}W(Jr,`getPaddedExitPoints`);function Yr(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}W(Yr,`getPointsFromRect`);function Xr(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}W(Xr,`isPointInPolygon`);function Zr(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Qr(t)}W(Zr,`getHull`);function Qr(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}W(Qr,`getHullPresorted`);function $r(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}W($r,`concatAriaDescribedby`);function ei({delayDuration:e=0,...t}){return(0,F.jsx)(Ar,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}var ti=P.createContext(null);function ni({open:e,defaultOpen:t,onOpenChange:n,...r}){let[i,a]=l({prop:e,defaultProp:t??!1,onChange:n,caller:`Tooltip`}),o=P.useRef(!1),s=P.useCallback(e=>{e&&o.current||a(e)},[a]),c=P.useCallback(()=>{o.current=!0,queueMicrotask(()=>{o.current=!1})},[]),u=P.useMemo(()=>({open:i,setOpen:a,ignoreOpenFromThisEvent:c}),[i,a,c]);return(0,F.jsx)(ti.Provider,{value:u,children:(0,F.jsx)(Pr,{"data-slot":`tooltip`,open:i,onOpenChange:s,...r})})}function ri({className:e,ref:t,tabIndex:n,onFocus:i,onPointerDown:a,onClick:o,...s}){let c=P.useContext(ti);if(!c)throw Error(`TooltipTrigger must be inside a Tooltip`);let l=v(c.open,c.setOpen,c.ignoreOpenFromThisEvent,{ref:t,tabIndex:n,onFocus:i,onPointerDown:a,onClick:o});return(0,F.jsx)(Ir,{"data-slot":`tooltip-trigger`,className:r(g,e),...l,...s})}function ii({className:e,sideOffset:t=0,children:n,...i}){let a=P.useContext(ti)?.open??!1,[o,s]=P.useState(!1);return!a&&o&&s(!1),P.useEffect(()=>{if(!a)return;let e=requestAnimationFrame(()=>s(!0));return()=>cancelAnimationFrame(e)},[a]),a&&!o?null:(0,F.jsx)(Br,{children:(0,F.jsxs)(Hr,{"data-slot":`tooltip-content`,sideOffset:t,className:r(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-lg bg-foreground px-3 py-1.5 text-xs text-background shadow-popover has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm motion-safe:data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 motion-safe:data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 motion-safe:data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...i,children:[n,(0,F.jsx)(Kr,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var ai=e=>Symbol.iterator in e,oi=e=>`entries`in e,si=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},ci=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function li(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:ai(e)&&ai(t)?oi(e)&&oi(t)?si(e,t):ci(e,t):si({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function ui(e){let t=P.useRef(void 0);return n=>{let r=e(n);return li(t.current,r)?t.current:t.current=r}}var G={loaded:!1,connected:!1,shares:{},commentCounts:{}},di=0,fi=0,pi=0,mi=new Map;function hi(e,t){let n=(mi.get(e)??Promise.resolve()).then(t,t),r=n.catch(()=>void 0);return mi.set(e,r),r.then(()=>{mi.get(e)===r&&mi.delete(e)}),n}var gi=new Set,_i=e=>{G={...G,...e},gi.forEach(e=>e())},vi=e=>(gi.add(e),()=>gi.delete(e)),yi=()=>G;function bi(){return(0,P.useSyncExternalStore)(vi,yi)}var xi=null;function Si(e){xi=e}var Ci=()=>xi!==null;async function wi(e,t){if(xi)return await xi(e,t);let n=await fetch(e,t?{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t.body)}:void 0),r=null;try{r=await n.json()}catch{}if(!n.ok){let e=r?.error,t=Error(typeof e==`string`?e:`The worker answered ${n.status}.`);throw t.status=n.status,t}return r}async function Ti(){let e=di,t=++fi;try{let n=await wi(`/api/work-view/focus/shares`);if(e!==di||t<pi)return;pi=t,_i({loaded:!0,connected:n.connected,shares:n.shares??{}})}catch{_i({loaded:!0})}}function Ei(e){di++;let{[e]:t,...n}=G.shares,{[e]:r,...i}=G.commentCounts;_i({shares:n,commentCounts:i})}function Di(e){return hi(e,async()=>{let t=await wi(`/api/work-view/focus/share`,{method:`POST`,body:{focusAreaId:e}}),n={url:t.url,sharedAt:t.sharedAt,publishedAt:t.publishedAt,publishError:null};return di++,_i({shares:{...G.shares,[e]:n}}),n})}function Oi(e){return hi(e,async()=>{await wi(`/api/work-view/focus/share/stop`,{method:`POST`,body:{focusAreaId:e}}),Ei(e)})}async function ki(e){let t=G.shares[e]?.url,n=()=>t!==void 0&&G.shares[e]?.url===t;try{let t=await wi(`/api/work-view/focus/share/comments?focusAreaId=${encodeURIComponent(e)}`);return n()&&_i({commentCounts:{...G.commentCounts,[e]:t.comments.length}}),t.comments}catch(t){if(n()){if(t.status===410)Ei(e);else if(e in G.commentCounts){let{[e]:t,...n}=G.commentCounts;_i({commentCounts:n})}}throw t}}async function Ai(e,t){return(await wi(`/api/work-view/focus/share/comments`,{method:`POST`,body:{focusAreaId:e,body:t}})).comment}var ji=6e4,Mi=6e4;function Ni(e,t){let n=bi().commentCounts[e];return(0,P.useEffect)(()=>{if(!t)return;let n=()=>void ki(e).catch(t=>{console.warn(`[my-work] Could not count the comments on the shared page of focus area ${e}; its mark shows no number until a read answers:`,t)}),r=setTimeout(n,0),i=setInterval(n,Mi);return()=>{clearTimeout(r),clearInterval(i)}},[e,t]),n??null}function Pi(e){(0,P.useEffect)(()=>{if(!e)return;let t=setTimeout(()=>void Ti(),0),n=setInterval(()=>void Ti(),ji);return()=>{clearTimeout(t),clearInterval(n)}},[e])}var Fi=[`keep`,`rename`,`edit-goal`,`merge`,`dismiss`,`done`,`reorder`,`move-request`,`restore-suggestion`,`rename-sub-focus`,`merge-sub-focus`,`move-to-sub-focus`],Ii=Object.freeze([`my focus`,`my work`,`my rules`,`other`,`suggested`,`past focus`,`focus areas`,`review stack`]);function Li(e){let t=` ${String(e??``).toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join(` `)} `;return Ii.find(e=>t.includes(` ${e} `))??null}function Ri({statusBefore:e,doneAtBefore:t,statusAfter:n,changedAt:r}){return n===`done`?e===`done`?t:r:null}var zi=new Map,K=[..._],Bi=[...C],Vi=0,Hi=e=>fe.find(t=>t.id===e).name;function Ui({action:e,ruleId:t,rule:n}){let r=K.findIndex(e=>e.id===t),i=K[r];if(e!==`add`&&!i)throw Error(`No sample rule ${t}`);let a=i?.scopeId??`everywhere`;if(n){let e=n.scopeTier===`everywhere`?`Everywhere`:n.scopeName.trim(),t=Bi.find(t=>t.tier===n.scopeTier&&t.name===e);a=t?.id??`${n.scopeTier}:${e}`,t||(Bi=[...Bi,{id:a,tier:n.scopeTier,name:e}])}let o=n?{scopeId:a,when:n.when.trim(),then:n.then.trim()}:{},s=()=>({id:`added-${Vi++}`,scopeId:a,setBy:`owner`,when:``,then:``,...o,quotes:[],timesSeen:1,latestAt:`today`,latestDaysAgo:0,source:`you`,status:`on`,records:[{kind:`Instructions`,label:`Written in My Rules`,at:`today`}]}),c=e=>{K=K.map((t,n)=>n===r?e:t)};if(e===`add`)K=[...K,s()];else if(e===`replace`){let e=s();c({...i,status:`replaced`,replacedBy:{ruleId:e.id,at:`today`}}),K=[...K,e]}else e===`approve`?c({...i,...o,setBy:i.setBy===`learned`?`approved`:i.setBy,status:`on`}):e===`edit`?c({...i,...o}):e===`turn-on`||e===`turn-off`?c({...i,status:e===`turn-on`?`on`:`off`}):e===`dismiss`?i.source===`you`?K=K.filter(e=>e.id!==t):c({...i,status:`dismissed`}):c({..._.find(e=>e.id===t)??(()=>{throw Error(`Sample rule ${t} was never a suggestion`)})(),scopeId:i.scopeId,when:i.when,then:i.then,setBy:`learned`,status:`suggested`})}var Wi=[...ge].sort(me),Gi=80,Ki=300;function qi({action:e,focusAreaId:t,subFocusId:n,intoSubFocusId:r,name:i,goal:a,intoFocusAreaId:o,focusAreaIds:s,requestId:c}){if(!Fi.includes(e))throw Error(`Unknown focus change: ${String(e)}`);let l=i?.trim(),u=a?.trim();if(l!==void 0&&(!l||l.length>Gi)||u!==void 0&&(!u||u.length>Ki))throw Error(`ValidationError`);let d=new Map(Wi.map(e=>[e.id,e])),f=(e,t)=>{Wi=Wi.map(n=>{if(n.id!==e)return n;let r={...n,...t};return{...r,doneAt:Ri({statusBefore:n.status,doneAtBefore:n.doneAt??null,statusAfter:r.status,changedAt:new Date().toISOString()})}}).sort(me)},p=e=>!!e&&e.status!==`dismissed`&&!e.mergedInto;if(e===`reorder`){if(!s)throw Error(`List the focus areas in the order you want.`);if(new Set(s).size!==s.length)throw Error(`Each focus area can appear once in the order.`);if(s.some(e=>!d.has(e)))throw Error(`That focus area is not in your focus areas.`);let e=Wi.filter(e=>e.status===`kept`&&!e.mergedInto).map(e=>e.id);if(s.length!==e.length||!e.every(e=>s.includes(e)))throw Error(`List every kept focus area, each once, in the order you want.`);s.forEach((e,t)=>f(e,{ownerRank:t+1}));return}if(e===`move-request`){if(!c||!t)throw Error(`Choose the request and the focus area to move it to.`);let e=M.findIndex(e=>e.id===c);if(e<0)throw Error(`That request is not in your work.`);if(t!==`other`){if(!d.has(t))throw Error(`That focus area is not in your focus areas.`);if(!p(d.get(t)))throw Error(`Move it to an area that is still in your focus.`)}M[e]={...M[e],focusAreaId:t};return}if(e===`rename-sub-focus`||e===`merge-sub-focus`){let t=Wi.find(e=>p(e)&&e.subFocuses?.some(e=>e.id===n)),i=t?.subFocuses?.find(e=>e.id===n);if(!t?.subFocuses||!i)throw Error(`That sub focus is not in your focus areas.`);if(e===`rename-sub-focus`){if(!l)throw Error(`Write the new name before saving it.`);f(t.id,{subFocuses:t.subFocuses.map(e=>e.id===i.id?{...e,name:l,decidedBy:`owner`}:e)});return}if(!r)throw Error(`Choose the sub focus to merge it into.`);if(r===i.id)throw Error(`A sub focus cannot be merged into itself.`);if(!t.subFocuses.some(e=>e.id===r))throw Error(`Merge it into a sub focus of the same focus area.`);f(t.id,{subFocuses:t.subFocuses.filter(e=>e.id!==i.id)}),M.forEach((e,t)=>{e.subFocusId===i.id&&(M[t]={...e,subFocusId:r})});return}if(e===`move-to-sub-focus`){if(!c||n===void 0)throw Error(`Choose the request and the sub focus to move it to.`);let e=M.findIndex(e=>e.id===c);if(e<0)throw Error(`That request is not in your work.`);let t=pe(M[e].focusAreaId,Wi),r=t&&t!==`other`?d.get(t):void 0;if(!r)throw Error(`Put this request in a focus area before choosing its sub focus.`);if(n!==null&&!r.subFocuses?.some(e=>e.id===n))throw Error(`Move it to a sub focus of the area it is in.`);let{subFocusId:i,...a}=M[e];M[e]=n===null?a:{...a,subFocusId:n};return}let m=t?d.get(t):void 0;if(!m)throw Error(`That focus area is not in your focus areas.`);if(m.mergedInto&&e!==`restore-suggestion`)throw Error(`This area was merged into another. Undo the merge first.`);if(e===`keep`)f(m.id,{status:`kept`});else if(e===`dismiss`)f(m.id,{status:`dismissed`});else if(e===`done`)f(m.id,{status:`done`});else if(e===`rename`){if(!l)throw Error(`Write the new name before saving it.`);let e=Li(l);if(e)throw Error(`"${l}" reuses the nav word "${e}". Pick a name that means only this area.`);f(m.id,{name:l})}else if(e===`edit-goal`){if(!u)throw Error(`Write the goal before saving it.`);f(m.id,{goal:u})}else if(e===`merge`){if(!o)throw Error(`Choose the area to merge it into.`);if(o===m.id)throw Error(`An area cannot be merged into itself.`);let e=d.get(o);if(!e)throw Error(`That focus area is not in your focus areas.`);if(!p(e))throw Error(`Merge it into an area that is still in your focus.`);f(m.id,{mergedInto:e.id})}else if(e===`restore-suggestion`){if(m.source===`owner`)throw Error(`Only a suggested area can go back to being a suggestion.`);f(m.id,{status:`suggested`,mergedInto:null})}else throw Error(`Unknown focus change: ${String(e)}`)}var Ji=[`rules-unreadable`,`refresh-failed`,`rule-saves-fail`,`months-unreadable`,`read-errors`,`subagents`,`reply-card`,`check-save-waits`,`check-save-fails`,`focus-saves-fail`,`area-shared`,`share-comments-unreadable`];function Yi(){let e=globalThis.location?.search;if(e===void 0)return null;let t=new URLSearchParams(e).get(`sample-state`);return Ji.find(e=>e===t)??null}var Xi=`Rule "Keep scratch files inside the project." is in a scope the worker did not list: project:retired-repo`,Zi={state:`failed`,finishedAt:`Oct 20 at 2:11 pm`,error:`Claude Code: story (raw answer: ~/.claude-mem/failed-answers/2026-10-20T21-11-12.521Z-story-claude-code.txt): preferences[3].preference is 229 characters; it must be 1–200.`},Qi=`The rule change was not saved: SQLITE_BUSY: database is locked (work_state.write rules/autonomy)`,$i=`Loading the rules was not saved: EACCES: permission denied, open '~/.claude/CLAUDE.md'`,ea=`owner-goals/2026-10-18 is unreadable: Unexpected token '}' in JSON at position 2214`,ta=[{requestId:`r-unreadable-1`,title:`Move the release notes into the docs site`,reason:`Request r-unreadable-1 is inconsistent: a working request has an agent next step and is not finished`,evidenceHref:null},{requestId:`r-unreadable-2`,title:null,reason:`Request r-unreadable-2 is inconsistent: shipped requests are 100% with a completion date`,evidenceHref:null}],na=(e,t,n,r,i)=>({id:e,tool:t.tool,name:t.name,role:t.role,deviceId:t.deviceId,status:n,canMarkFinished:n!==`finished`,...n===`finished`?{finishedAtIso:`2026-10-20T13:40:00-07:00`}:{},...r?{parentId:t.id}:{},...i?{launchDescription:i}:{}}),ra=[na(`claude-subagent-1`,ne[0],`working`,!0,`Check the List rows at 768px`),na(`claude-subagent-2`,ne[0],`finished`,!0,`Measure the By agent folds`),na(`claude-subagent-3`,ne[0],`quiet`,!0),na(`claude-sync-subagent-1`,ne[1],`quiet`,!1,`Read the sync queue`)],ia=new Map,aa=e=>e===`subagents`?[...ne,...ra.map(e=>{let t=ia.get(e.id);return t?{...e,status:`finished`,finishedAtIso:t,canMarkFinished:!1}:e})]:ne,oa=`This request has not been reported complete.`,sa=`r5`,q={running:`a17c0001-5e2d-4c3b-9a10-5f6e7d8c9b01`,cannotContinue:`b28d0002-6f3e-4d4c-8b21-6a7f8e9dac02`,readFails:`c39e0003-7a4f-4e5d-9c32-7b8a9faebd03`,ready:`d4af0004-8b5a-4f6e-8d43-8c9bafbfce04`},ca=[{tool:`Claude Code`,at:`Oct 20, 12:40 pm`,title:`Price page: usage table first`,platform:`claude`,conversationSessionId:q.running},{tool:`Codex`,at:de,title:null,platform:`codex`,conversationSessionId:q.cannotContinue},{tool:`Claude Code`,at:`Oct 20, 1:05 pm`,title:`Forecast drafts`,platform:`claude`,conversationSessionId:q.readFails},{tool:`Claude Code`,at:`Oct 20, 1:22 pm`,title:`Scaling estimates below`,platform:`claude`,conversationSessionId:q.ready}],la=`~/work/admin-pricing`,ua={[q.running]:{target:{canContinue:!0,recordedFolder:la,runsInFolder:la,recordedFolderIsGone:!1,opensInAppNamed:null},exchanges:[{exchangeId:1,platform:`claude`,conversationSessionId:q.running,state:`replied`,ownerMessage:`Which forecast reads better at a glance?`,replyText:`The usage-based one: it starts from what you spend today.`,startedAtEpochMs:1e3,endedAtEpochMs:2e3,ranInFolder:la},{exchangeId:2,platform:`claude`,conversationSessionId:q.running,state:`running`,ownerMessage:`Keep the usage-based forecast and remove the other draft.`,startedAtEpochMs:3e3,ranInFolder:la}]},[q.cannotContinue]:{target:{canContinue:!1,refusalText:`No folder was recorded for this Codex conversation, so it can’t be continued from here.`,recordedFolder:null},exchanges:[]},[q.ready]:{target:{canContinue:!0,recordedFolder:`~/work/admin-pricing-scaling`,runsInFolder:`~/work`,recordedFolderIsGone:!0,opensInAppNamed:null},exchanges:[]}},da=`Could not read this conversation: the worker answered 503 Service Unavailable.`,fa={async loadConversationContinuation(e,t){let n=ua[t];if(!n)throw Error(da);return structuredClone(n)},async continueConversation(){throw Error(`Sample conversations are a demonstration: nothing was sent.`)},async stopConversationContinuation(e,t){let n=ua[t]?.exchanges.find(e=>e.state===`running`);if(!n)throw Error(`Nothing sent from here is running in this conversation.`);return structuredClone(n)},subscribeToConversationContinuations:()=>()=>{}},pa=`The focus change was not saved: SQLITE_BUSY: database is locked (work_state.write my-focus)`,ma=`fa-viewer`,ha=e=>({url:`https://example.com/focus/sample-${e}`,sharedAt:`2026-10-19T09:00:00-07:00`,publishedAt:`2026-10-20T13:50:00-07:00`,publishError:null}),ga=new Map([[ma,ha(ma)]]),_a=[{id:`sample-comment-1`,authorKind:`person`,authorName:`Sam`,agentName:null,isOwner:!1,body:`Is the live indicator next, after the list sorting?`,createdAt:`2026-10-20T11:05:00-07:00`},{id:`sample-comment-2`,authorKind:`agent`,authorName:`Priya`,agentName:`Claude`,isOwner:!1,body:`The list sorting shipped in the live monitor request; the live indicator is still an ask.`,createdAt:`2026-10-20T12:40:00-07:00`}],va=`cmem.ai answered 503 Service Unavailable while reading the comments.`;function ya(){return async(e,t)=>{let n=e.split(`?`)[0],r=t?t.body.focusAreaId:new URLSearchParams(e.split(`?`)[1]??``).get(`focusAreaId`)??``;if(!t&&n===`/api/work-view/focus/shares`)return{connected:!0,shares:Object.fromEntries(ga)};if(!t&&n===`/api/work-view/focus/share/comments`){if(Yi()===`share-comments-unreadable`)throw Error(va);return{comments:ga.has(r)?structuredClone(_a):[]}}if(t&&n===`/api/work-view/focus/share/comments`)throw Error(`Sample comments are a demonstration: nothing was posted.`);if(t&&n===`/api/work-view/focus/share`){let e=ha(r);return ga.set(r,e),{url:e.url,sharedAt:e.sharedAt,publishedAt:e.publishedAt,sent:!1}}if(t&&n===`/api/work-view/focus/share/stop`)return ga.delete(r),{stopped:!0};throw Error(`The sample has no answer for ${t?`POST`:`GET`} ${n}`)}}var ba=e=>({sourceKind:`sample`,requests:e===`reply-card`?M.map(e=>e.id===sa?{...e,conversations:ca}:e):[...M],requestReadErrors:e===`read-errors`?ta:[],agents:aa(e),devices:fe,people:se,unlinkedWorkCount:0,focusAreas:Wi,otherAsks:_e,currentPeriod:e===`months-unreadable`?null:ve,pastPeriods:e===`months-unreadable`?[]:he,goalsReadError:e===`months-unreadable`?ea:null,rules:e===`rules-unreadable`?[]:K,ruleScopes:Bi,rulesLearning:y,buildStory:{recap:`The spec moved to a wireframe, embeddings moved to their own table, and cloud sync shipped.`,paragraphs:[`Monday started with the work viewer: cards came back, live updates landed, and the list gained sorting. Midweek went to cloud sync, after write stalls traced back to vector indexes…`],writtenAt:N.progress.lastRunAt},rulesFile:{path:`~/.claude-mem/MY-RULES.md`,approvedCount:K.filter(w).length,loadedInClaudeCode:e!==`rule-saves-fail`},rulesReadError:e===`rules-unreadable`?Xi:null,lastRuns:{goals:e===`months-unreadable`?null:{label:N.goals.label,lastRunAt:N.goals.lastRunAt,deviceName:Hi(N.goals.deviceId)},progress:{label:N.progress.label,lastRunAt:N.progress.lastRunAt,deviceName:Hi(N.progress.deviceId)}},refresh:e===`refresh-failed`?Zi:null,sourceHealth:{connected:!0,error:null},connection:x({now:0})}),xa=async()=>ba(Yi()),Sa={sourceKind:`sample`,loadWorkModel:xa,subscribeToLiveUpdates:()=>()=>{},async saveRuleChange(e){if(Yi()===`rule-saves-fail`)throw Error(Qi);return Ui(e),{model:await xa(),savedRuleId:null}},async saveFocusChange(e){if(Yi()===`focus-saves-fail`)throw Error(pa);return qi(e),xa()},async loadRulesInClaudeCode(){if(Yi()===`rule-saves-fail`)throw Error($i);return xa()},refreshWork:async()=>({state:`idle`}),async markAgentFinished(e){let t=ra.find(t=>t.id===e);if(Yi()!==`subagents`||!t?.canMarkFinished)throw Error(`Sample agents have no recorded state to change.`);return ia.set(e,new Date().toISOString()),xa()},async setRequestChecked(e,t,n){let r=Yi();if(r===`check-save-waits`)return new Promise(()=>{});if(r===`check-save-fails`)return{outcome:`refused`,serverMessage:oa,model:await xa()};let i=M.findIndex(t=>t.id===e);if(i<0)throw Error(`No sample request ${e}`);if(n){let t=M[i];zi.set(e,t),M[i]=ae({...t,state:`your-move`,checkedAt:`just now`,next:{who:`human`,kind:`ship`}})}else{let t=zi.get(e);if(!t)throw Error(`Sample request ${e} has no check to undo`);M[i]=t,zi.delete(e)}return{outcome:`saved`,model:await xa()}}};function Ca(){let e=Yi();return(e===`area-shared`||e===`share-comments-unreadable`)&&Si(ya()),e===`reply-card`?{...Sa,...fa}:Sa}var wa=`/api/work-view/usage`;function Ta(e,t){return t===null?{event:`opened`,view:e}:t===e?null:{event:`switched`,view:e,previousView:t}}var Ea=!1;function Da(e,t){return e?e.event===`opened`?Ea?null:(Ea=!0,t?[{event:`pageview`},e]:[e]):[e]:null}function Oa(e,t){try{fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),keepalive:!0}).catch(()=>void 0)}catch{}}function ka(e){let t=Da(e,!1);if(t)for(let e of t)Oa(wa,e)}function Aa(e){let t=Da(e,!0);if(t)for(let e of t)Oa(`/api/viewer-usage`,e)}function ja(e){return e?{event:`view_hosted_plans`,cloudSyncOffer:e}:{event:`view_hosted_plans`}}function Ma(e){Oa(wa,ja(e))}var Na=Symbol.for(`immer-nothing`),Pa=Symbol.for(`immer-draftable`),J=Symbol.for(`immer-state`);function Y(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Fa=Object.getPrototypeOf;function Ia(e){return!!e&&!!e[J]}function X(e){return e?za(e)||Array.isArray(e)||!!e[Pa]||!!e.constructor?.[Pa]||Ga(e)||Ka(e):!1}var La=Object.prototype.constructor.toString(),Ra=new WeakMap;function za(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;if(n===Object)return!0;if(typeof n!=`function`)return!1;let r=Ra.get(n);return r===void 0&&(r=Function.toString.call(n),Ra.set(n,r)),r===La}function Ba(e,t,n=!0){Va(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Va(e){let t=e[J];return t?t.type_:Array.isArray(e)?1:Ga(e)?2:Ka(e)?3:0}function Ha(e,t){return Va(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ua(e,t,n){let r=Va(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Wa(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function Ga(e){return e instanceof Map}function Ka(e){return e instanceof Set}function Z(e){return e.copy_||e.base_}function qa(e,t){if(Ga(e))return new Map(e);if(Ka(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=za(e);if(t===!0||t===`class_only`&&!n){let t=Object.getOwnPropertyDescriptors(e);delete t[J];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(Fa(e),t)}{let t=Fa(e);if(t!==null&&n)return{...e};let r=Object.create(t);return Object.assign(r,e)}}function Ja(e,t=!1){return Za(e)||Ia(e)||!X(e)||(Va(e)>1&&Object.defineProperties(e,{set:Xa,add:Xa,clear:Xa,delete:Xa}),Object.freeze(e),t&&Object.values(e).forEach(e=>Ja(e,!0))),e}function Ya(){Y(2)}var Xa={value:Ya};function Za(e){return typeof e!=`object`||!e||Object.isFrozen(e)}var Qa={};function $a(e){let t=Qa[e];return t||Y(0,e),t}function eo(e,t){Qa[e]||(Qa[e]=t)}var to;function no(){return to}function ro(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function io(e,t){t&&($a(`Patches`),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ao(e){oo(e),e.drafts_.forEach(co),e.drafts_=null}function oo(e){e===to&&(to=e.parent_)}function so(e){return to=ro(to,e)}function co(e){let t=e[J];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function lo(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[J].modified_&&(ao(t),Y(4)),X(e)&&(e=uo(t,e),t.parent_||po(t,e)),t.patches_&&$a(`Patches`).generateReplacementPatches_(n[J].base_,e,t.patches_,t.inversePatches_)):e=uo(t,n,[]),ao(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Na?void 0:e}function uo(e,t,n){if(Za(t))return t;let r=e.immer_.shouldUseStrictIteration(),i=t[J];if(!i)return Ba(t,(r,a)=>fo(e,i,t,r,a,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return po(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let t=i.copy_,a=t,o=!1;i.type_===3&&(a=new Set(t),t.clear(),o=!0),Ba(a,(r,a)=>fo(e,i,t,r,a,n,o),r),po(e,t,!1),n&&e.patches_&&$a(`Patches`).generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function fo(e,t,n,r,i,a,o){if(i==null||typeof i!=`object`&&!o)return;let s=Za(i);if(!s||o){if(Ia(i)){let o=uo(e,i,a&&t&&t.type_!==3&&!Ha(t.assigned_,r)?a.concat(r):void 0);if(Ua(n,r,o),Ia(o))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(X(i)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&s)return;uo(e,i),(!t||!t.scope_.parent_)&&typeof r!=`symbol`&&(Ga(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&po(e,i)}}}function po(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ja(t,n)}function mo(e,t){let n=Array.isArray(e),r={type_:+!!n,scope_:t?t.scope_:no(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,a=ho;n&&(i=[r],a=go);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}var ho={get(e,t){if(t===J)return e;let n=Z(e);if(!Ha(n,t))return vo(e,n,t);let r=n[t];return e.finalized_||!X(r)?r:r===_o(e.base_,t)?(bo(e),e.copy_[t]=So(r,e)):r},has(e,t){return t in Z(e)},ownKeys(e){return Reflect.ownKeys(Z(e))},set(e,t,n){let r=yo(Z(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=_o(Z(e),t),i=r?.[J];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Wa(n,r)&&(n!==void 0||Ha(e.base_,t)))return!0;bo(e),Q(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return _o(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,bo(e),Q(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Z(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!==`length`,enumerable:r.enumerable,value:n[t]}},defineProperty(){Y(11)},getPrototypeOf(e){return Fa(e.base_)},setPrototypeOf(){Y(12)}},go={};Ba(ho,(e,t)=>{go[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),go.deleteProperty=function(e,t){return go.set.call(this,e,t,void 0)},go.set=function(e,t,n){return ho.set.call(this,e[0],t,n,e[0])};function _o(e,t){let n=e[J];return(n?Z(n):e)[t]}function vo(e,t,n){let r=yo(t,n);return r?`value`in r?r.value:r.get?.call(e.draft_):void 0}function yo(e,t){if(!(t in e))return;let n=Fa(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Fa(n)}}function Q(e){e.modified_||(e.modified_=!0,e.parent_&&Q(e.parent_))}function bo(e){e.copy_||=qa(e.base_,e.scope_.immer_.useStrictShallowCopy_)}var xo=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if(typeof e==`function`&&typeof t!=`function`){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}typeof t!=`function`&&Y(6),n!==void 0&&typeof n!=`function`&&Y(7);let r;if(X(e)){let i=so(this),a=So(e,void 0),o=!0;try{r=t(a),o=!1}finally{o?ao(i):oo(i)}return io(i,n),lo(r,i)}if(!e||typeof e!=`object`){if(r=t(e),r===void 0&&(r=e),r===Na&&(r=void 0),this.autoFreeze_&&Ja(r,!0),n){let t=[],i=[];$a(`Patches`).generateReplacementPatches_(e,r,t,i),n(t,i)}return r}Y(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e==`function`)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},typeof e?.autoFreeze==`boolean`&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy==`boolean`&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration==`boolean`&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){X(e)||Y(8),Ia(e)&&(e=Co(e));let t=so(this),n=So(e,void 0);return n[J].isManual_=!0,oo(t),n}finishDraft(e,t){let n=e&&e[J];(!n||!n.isManual_)&&Y(9);let{scope_:r}=n;return io(r,t),lo(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=$a(`Patches`).applyPatches_;return Ia(e)?r(e,t):this.produce(e,e=>r(e,t))}};function So(e,t){let n=Ga(e)?$a(`MapSet`).proxyMap_(e,t):Ka(e)?$a(`MapSet`).proxySet_(e,t):mo(e,t);return(t?t.scope_:no()).drafts_.push(n),n}function Co(e){return Ia(e)||Y(10,e),wo(e)}function wo(e){if(!X(e)||Za(e))return e;let t=e[J],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=qa(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=qa(e,!0);return Ba(n,(e,t)=>{Ua(n,e,wo(t))},r),t&&(t.finalized_=!1),n}function To(){class e extends Map{constructor(e,t){super(),this[J]={type_:2,parent_:t,scope_:t?t.scope_:no(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:e,draft_:this,isManual_:!1,revoked_:!1}}get size(){return Z(this[J]).size}has(e){return Z(this[J]).has(e)}set(e,t){let r=this[J];return o(r),(!Z(r).has(e)||Z(r).get(e)!==t)&&(n(r),Q(r),r.assigned_.set(e,!0),r.copy_.set(e,t),r.assigned_.set(e,!0)),this}delete(e){if(!this.has(e))return!1;let t=this[J];return o(t),n(t),Q(t),t.base_.has(e)?t.assigned_.set(e,!1):t.assigned_.delete(e),t.copy_.delete(e),!0}clear(){let e=this[J];o(e),Z(e).size&&(n(e),Q(e),e.assigned_=new Map,Ba(e.base_,t=>{e.assigned_.set(t,!1)}),e.copy_.clear())}forEach(e,t){let n=this[J];Z(n).forEach((n,r,i)=>{e.call(t,this.get(r),r,this)})}get(e){let t=this[J];o(t);let r=Z(t).get(e);if(t.finalized_||!X(r)||r!==t.base_.get(e))return r;let i=So(r,t);return n(t),t.copy_.set(e,i),i}keys(){return Z(this[J]).keys()}values(){let e=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{let t=e.next();return t.done?t:{done:!1,value:this.get(t.value)}}}}entries(){let e=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{let t=e.next();if(t.done)return t;let n=this.get(t.value);return{done:!1,value:[t.value,n]}}}}[Symbol.iterator](){return this.entries()}}function t(t,n){return new e(t,n)}function n(e){e.copy_||=(e.assigned_=new Map,new Map(e.base_))}class r extends Set{constructor(e,t){super(),this[J]={type_:3,parent_:t,scope_:t?t.scope_:no(),modified_:!1,finalized_:!1,copy_:void 0,base_:e,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return Z(this[J]).size}has(e){let t=this[J];return o(t),t.copy_?!!(t.copy_.has(e)||t.drafts_.has(e)&&t.copy_.has(t.drafts_.get(e))):t.base_.has(e)}add(e){let t=this[J];return o(t),this.has(e)||(a(t),Q(t),t.copy_.add(e)),this}delete(e){if(!this.has(e))return!1;let t=this[J];return o(t),a(t),Q(t),t.copy_.delete(e)||(t.drafts_.has(e)?t.copy_.delete(t.drafts_.get(e)):!1)}clear(){let e=this[J];o(e),Z(e).size&&(a(e),Q(e),e.copy_.clear())}values(){let e=this[J];return o(e),a(e),e.copy_.values()}entries(){let e=this[J];return o(e),a(e),e.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(e,t){let n=this.values(),r=n.next();for(;!r.done;)e.call(t,r.value,r.value,this),r=n.next()}}function i(e,t){return new r(e,t)}function a(e){e.copy_||(e.copy_=new Set,e.base_.forEach(t=>{if(X(t)){let n=So(t,e);e.drafts_.set(t,n),e.copy_.add(n)}else e.copy_.add(t)}))}function o(e){e.revoked_&&Y(3,JSON.stringify(Z(e)))}eo(`MapSet`,{proxyMap_:t,proxySet_:i})}var Eo=new xo,Do=Eo.produce,Oo=Eo.setAutoFreeze.bind(Eo),ko=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Ao=(e=>e?ko(e):ko),jo=e=>e;function Mo(e,t=jo){let n=P.useSyncExternalStore(e.subscribe,P.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return P.useDebugValue(n),n}var No=e=>{let t=Ao(e),n=e=>Mo(t,e);return Object.assign(n,t),n},Po=(e=>e?No(e):No),Fo=e=>!!e.dispatchFromDevtools&&typeof e.dispatch==`function`,Io=new Map,Lo=e=>{let t=Io.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},Ro=(e,t,n)=>{if(e===void 0)return{type:`untracked`,connection:t.connect(n)};let r=Io.get(n.name);if(r)return{type:`tracked`,store:e,...r};let i={connection:t.connect(n),stores:{}};return Io.set(n.name,i),{type:`tracked`,store:e,...i}},zo=(e,t,n)=>{if(t===void 0)return;let r=Io.get(e);r?.stores[t]===n&&(delete r.stores[t],Object.keys(r.stores).length===0&&Io.delete(e))},Bo=/^at (?:new |async )?(.+?) \(/,Vo=/^([^@]+)@/;function Ho(e){if(!e)return;let t=e.split(`
`),n=t.findIndex(e=>e.includes(`api.setState`));if(n<0)return;let r=t[n+1]?.trim()||``;return Bo.exec(r)?.[1]||Vo.exec(r)?.[1]}var Uo=(e,t={})=>(n,r,i)=>{let{enabled:a,anonymousActionType:o,store:s,...c}=t,l;try{l=(a??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return e(n,r,i);let{connection:u,...d}=Ro(s,l,c),f=!0;i.setState=((e,t,a)=>{let l=n(e,t);if(!f)return l;let d=a===void 0?{type:o||Ho(Error().stack)||`anonymous`}:typeof a==`string`?{type:a}:a;return s===void 0?(u?.send(d,r()),l):(u?.send({...d,type:`${s}/${d.type}`},{...Lo(c.name),[s]:i.getState()}),l)});let p;i.devtools={cleanup:()=>{p?.(),p=void 0,zo(c.name,s,i),(s===void 0||!Io.has(c.name))&&u&&typeof u.unsubscribe==`function`&&u.unsubscribe()}};let m=(...e)=>{let t=f;f=!1,n(...e),f=t},h=e(i.setState,r,i);if(d.type===`untracked`?u?.init(h):(d.stores[d.store]=i,u?.init(Object.fromEntries(Object.entries(d.stores).map(([e,t])=>[e,e===d.store?h:t.getState()])))),Fo(i)){let e=i.dispatch;i.dispatch=(...t)=>{e(...t)}}return p=u.subscribe(e=>{let t=typeof c.serialize==`object`?c.serialize.reviver:void 0;switch(e.type){case`ACTION`:if(typeof e.payload!=`string`){console.error(`[zustand devtools middleware] Unsupported action format`);return}return Wo(e.payload,t,e=>{if(e.type===`__setState`){if(s===void 0){m(e.state);return}Object.keys(e.state).length!==1&&console.error(`
                    [zustand devtools middleware] Unsupported __setState action format.
                    When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
                    and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
                    `);let t=e.state[s];if(t==null)return;JSON.stringify(i.getState())!==JSON.stringify(t)&&m(t)}else Fo(i)&&i.dispatch(e)});case`DISPATCH`:switch(e.payload.type){case`RESET`:return m(h),s===void 0?u?.init(i.getState()):u?.init(Lo(c.name));case`COMMIT`:if(s===void 0){u?.init(i.getState());return}return u?.init(Lo(c.name));case`ROLLBACK`:return Wo(e.state,t,e=>{s===void 0?(m(e),u?.init(i.getState())):(m(e[s]),u?.init(Lo(c.name)))});case`JUMP_TO_STATE`:case`JUMP_TO_ACTION`:return Wo(e.state,t,e=>{s===void 0?m(e):JSON.stringify(i.getState())!==JSON.stringify(e[s])&&m(e[s])});case`IMPORT_STATE`:{let{nextLiftedState:t}=e.payload,n=t.computedStates.slice(-1)[0]?.state;if(!n)return;m(s===void 0?n:n[s]),u?.send(null,t);return}case`PAUSE_RECORDING`:return f=!f}return}}),h},Wo=(e,t,n)=>{let r;try{r=JSON.parse(e,t)}catch(e){console.error(`[zustand devtools middleware] Could not parse the received json`,e)}r!==void 0&&n(r)};function Go(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var Ko=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return Ko(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return Ko(t)(e)}}}},qo=(e,t)=>(n,r,i)=>{let a={storage:Go(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(...e)=>(f(...e),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return Ko(u.getItem.bind(u))(a.name).then(e=>{if(e){if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state]}return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{++s,u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p},Jo=e=>(t,n,r)=>(r.setState=(e,n,...r)=>t(typeof e==`function`?Do(e):e,n,...r),e(r.setState,n,r)),Yo=`This focus changed since your edit. Review its current version before changing it again.`,Xo=e=>`id`in e?e.id:e.focusAreaId,Zo=e=>`id`in e?e.id:e.subFocusId;function Qo(e,t,n){if(e.action===`reorder`){let e=t.filter(e=>e.status===`kept`&&!e.mergedInto).map(e=>[Xo(e),e.ownerRank,e.priorityRank]).sort((e,t)=>e[0]<t[0]?-1:+(e[0]>t[0]));return JSON.stringify(e)}if(e.action===`move-request`){let t=n.find(t=>t.id===e.requestId);return t?JSON.stringify([t.id,t.focusAreaId??null]):null}if(e.action===`move-to-sub-focus`){let t=n.find(t=>t.id===e.requestId);return t?JSON.stringify([t.id,t.focusAreaId??null,t.subFocusId??null]):null}if(e.action===`rename-sub-focus`||e.action===`merge-sub-focus`){for(let n of t){let t=n.subFocuses?.find(t=>Zo(t)===e.subFocusId);if(t)return JSON.stringify([Zo(t),t.name,Xo(n)])}return null}let r=t.find(t=>Xo(t)===e.focusAreaId);return r?JSON.stringify([Xo(r),r.name,r.goal,r.about??null,r.status,r.ownerRank,r.priorityRank,r.source,r.mergedInto]):null}var $o=e=>e instanceof Error?e.message:String(e);function es(e,t){if(!e?.length)return null;let n=[];for(let r of e){let e=Qo(r,t.focusAreas,t.requests);if(e===null)return null;n.push(e)}return n}var ts=(e,t)=>{let n=async(n,r)=>{if(t().focus.saving)return!1;let i=r();e(e=>{e.focus.saving=!0,e.focus.failed=null});try{return await n(),!0}catch(t){if(!i)throw t;return e(e=>{e.focus.failed={...i,reason:$o(t)}}),!1}finally{e(e=>{e.focus.saving=!1})}};return{focus:{history:[],saving:!1,failed:null},applyFocusChange:(r,i,{words:a,place:o})=>n(async()=>{let n=await t().saveFocusChange(r);i&&e(e=>{e.focus.history.push({...i,expectedVersions:es(i.undo,n)})})},()=>({attempt:{kind:`change`,change:r,record:i},words:a,place:o})),forgetFailedFocusSave:n=>{t().focus.failed?.place===n&&e(e=>{e.focus.failed=null})},undoLastFocusChange:r=>n(async()=>{let n=t().focus.history.at(-1)?.undo;if(n){for(let r=0;r<n.length;r++){let i=t().focus.history.at(-1),a=t().work.load,o=i.expectedVersions,s=a.state===`loaded`?es(i.undo,a.model):null;if(!o?.length||!s||o.length!==s.length||o.some((e,t)=>e!==s[t]))throw Error(Yo);let c=await t().saveFocusChange({...n[r],expectedVersion:o[0]}),l=n.slice(r+1);l.length&&e(e=>{let t=e.focus.history.at(-1);t.undo=l,t.expectedVersions=es(l,c)})}e(e=>{e.focus.history.pop()})}},()=>{let e=t().focus.history.at(-1);return e?.undo?{attempt:{kind:`undo`},words:e,place:r}:null})}},ns=e=>e instanceof Error?e.message:String(e),rs=`This rule changed since your edit. Review its current version before changing it again.`,is=(e,t)=>({rules:{savedDecisions:{},history:[],changedIds:[],saving:!1,saveError:null},runRuleSave:async(n,r)=>{if(t().rules.saving)return null;e(e=>{e.rules.saving=!0,e.rules.saveError=null});try{let i=await t().saveRuleChange(n),a=r(i),o=e=>e?S(i.model.rules.find(t=>t.id===e)):null;return e(e=>{if(a.decision){let{ruleId:t,decision:n}=a.decision,r=o(t);n&&r?e.rules.savedDecisions[t]={decision:n,version:r}:delete e.rules.savedDecisions[t],n===`approved`&&!e.rules.changedIds.includes(t)&&e.rules.changedIds.push(t)}if(a.change){e.rules.history.push({...a.change,expectedVersion:o(a.change.ruleId)});let{ruleId:t}=a.change;t&&!e.rules.changedIds.includes(t)&&e.rules.changedIds.push(t)}}),i.model.rules}finally{e(e=>{e.rules.saving=!1})}},undoLastRuleChange:async()=>{let n=t().rules.history.at(-1);if(!n?.undo||!n.ruleId||t().rules.saving)return;let r=t().work.load,i=r.state===`loaded`?r.model.rules:[];if(!b(n.ruleId,n.expectedVersion,i)){e(e=>{e.rules.saveError=rs});return}let{ruleId:a,undo:o}=n;e(e=>{e.rules.saving=!0,e.rules.saveError=null});try{await t().saveRuleChange(o),e(e=>{o.action===`restore-suggestion`&&delete e.rules.savedDecisions[a],e.rules.history.pop()})}catch(t){e(e=>{e.rules.saveError=ns(t)})}finally{e(e=>{e.rules.saving=!1})}},setRuleSaveError:t=>e(e=>{e.rules.saveError=t})}),as={"your-move":!1,"needs-check":!1,working:!1,idle:!0,shipped:!0},os=(e,t,n,r)=>{let i=as[n[0]];if(n.some(e=>as[e]!==i))throw Error(`Card group ${e} mixes folding and open states`);return{id:e,label:t,states:n,dot:r,folds:i}},ss=[os(`needs-you`,`Needs you`,[`your-move`,`needs-check`],`bg-attention-foreground`),os(`working`,`Working`,[`working`],`bg-working-foreground`),os(`idle`,`Idle`,[`idle`],`bg-idle-foreground`),os(`shipped`,`Shipped`,[`shipped`],`bg-shipped-foreground`)],cs=e=>ss.some(t=>t.id===e),ls=e=>t=>e===null||ss.some(n=>n.id===e&&n.states.includes(t.state));function us(e){return ss.map(t=>({group:t,members:e.filter(e=>t.states.includes(e.state))})).filter(e=>e.members.length>0)}function ds(e,t){let n=Math.min(e,Math.max(0,t)*50);return{shown:n,left:e-n}}function fs(e){return e.deliverable===!0||![`Commit`,`Branch`].includes(e.kind)}var ps=/^https:\/\/github\.com\/[^/]+\/([^/]+)\/pull\/(\d+)/,ms=/^https:\/\/github\.com\/[^/]+\/([^/]+)\/commit\/([0-9a-f]{7,40})/,hs=/^https:\/\/github\.com\/[^/]+\/([^/]+)\/releases\/tag\/([^/?#]+)/,gs=7,_s=/^\$(?:[A-Za-z_{(]|\d)/,vs=/^\$(?:[A-Za-z_][A-Za-z0-9_]*|\{[^}]*\}|\d+)?$/,ys=e=>e.kind!==`Branch`||!vs.test(e.label);function bs(e){try{return decodeURIComponent(e)}catch{return e}}function xs(e){let t=e.href??``,n=/^https?:\/\/([^/?#]+)/.exec(t)?.[1],r=n!==void 0&&(e.label===n||e.label===n.replace(/^www\./,``)),i=ps.exec(t);if(i){let[,t,n]=i;return r||e.label===`#${n}`||e.label===`PR #${n}`||_s.test(e.label)?`${t} #${n}`:`#${n} · ${e.label}`}if(!r)return e.label;let a=ms.exec(t);if(a)return`${a[1]} @${a[2].slice(0,gs)}`;let o=hs.exec(t);return o?`${o[1]} ${bs(o[2])}`:e.label}var Ss={PR:`code`,Commit:`code`,Branch:`code`,Page:`docs-and-pages`,Deck:`docs-and-pages`,Doc:`docs-and-pages`,File:`docs-and-pages`,Link:`docs-and-pages`},Cs={PR:0,Page:1,Deck:2,Doc:3,File:4,Link:5,Branch:6,Commit:7};function ws(e){let t=e=>[+(e.kind===`Commit`),+!e.href,Cs[e.kind]];return e.map((e,n)=>({product:e,index:n,rank:t(e)})).sort((e,t)=>e.rank[0]-t.rank[0]||e.rank[1]-t.rank[1]||e.rank[2]-t.rank[2]||e.index-t.index).map(({product:e})=>e)}var Ts=[`conversation`,`records`,`deliverables`],Es=e=>Ts.includes(e),Ds=e=>e.workProduct.filter(fs),Os=e=>e.workProduct.filter(e=>!fs(e)&&ys(e)),ks=e=>e.recordsAtLimit===!0||e.granular.length>=40;function As(e){let t=Ds(e).length>0,n=Ts.filter(e=>e!==`deliverables`||t);return e.state===`shipped`?[...n.filter(e=>e===`deliverables`),...n.filter(e=>e!==`deliverables`)]:n}function js(e,t,n){let r=pe(e.focusAreaId,t);if(r===`other`)return{kind:`other`};let i=r===null?void 0:t.find(e=>e.id===r);if(!i)return{kind:`not-sorted`};let a=e.subFocusId?Le(i.id,t,n,null,e.subFocusId).sub:null;return{kind:`area`,area:i,subFocus:a===null||a===`more`?null:a.subFocus}}function Ms(e,t){return t===null?null:e.conversations.find(e=>D(e)===t)??null}function Ns(e){let t=e.latestRecordConversation;return t?Ms(e,D(t)):null}var Ps=[`in-use`,`suggestions`,`dismissed`],[Fs]=Ps,Is=e=>Ps.includes(e),Ls={"in-use":e=>e(`In use`),suggestions:e=>e(`Suggestions`),dismissed:e=>e(`Dismissed`)},Rs={on:`in-use`,off:`in-use`,suggested:`suggestions`,dismissed:`dismissed`,replaced:null},zs=(e,t)=>e.filter(e=>Rs[e.status]===t);function Bs(e){let t=Object.fromEntries(Ps.map(e=>[e,0]));for(let n of e){let e=Rs[n.status];e!==null&&t[e]++}return t}var Vs=[`newest`,`busiest`];function Hs(e,t,n){let r=[e,...t];return n===`newest`?r:[...r].sort((e,t)=>t.promptCount-e.promptCount)}function Us(e){let t=e=>{let t=Date.parse(e.doneAt??``);return Number.isFinite(t)?t:null};return e.filter(e=>e.status===`done`&&!e.mergedInto).sort((e,n)=>{let[r,i]=[t(e),t(n)];return r!==null&&i!==null?i-r||e.name.localeCompare(n.name):r===null?i===null?e.name.localeCompare(n.name):1:-1})}var Ws=`not-sorted`;function Gs(e){let t=ue(e);return e=>t(e.focusAreaId)??`not-sorted`}function Ks(e,t){let n=Gs(t),r=new Set(e.map(n));return[...t.map(e=>e.id),ce,Ws].filter(e=>r.has(e))}var qs=[`work`,`focus`,`requests`,`review-stack`,`rules`],Js={work:{label:`My Work`,shortLabel:`My Work`,address:`/`},focus:{label:`Focus areas`,shortLabel:`Focus`,address:`/?view=focus`},requests:{label:`Requests`,shortLabel:`Requests`,address:`/?view=requests`},"review-stack":{label:`Review Stack`,shortLabel:`Review`,address:`/?view=review-stack`},rules:{label:`My Rules`,shortLabel:`My Rules`,address:`/?view=rules`}},Ys=e=>({id:e,...Js[e]}),Xs=qs.map(Ys),Zs={label:`Memory`,address:`/viewer`},Qs=`${Zs.address}#/settings`,$s=e=>`${Zs.address}#/?find=${encodeURIComponent(e)}`,ec=[...qs,`suggested`,`past-focus`,`build-story`,`workspace`,`machine`,`find`];[...ec];var tc=(e,t)=>e.includes(t),nc=[`agent`],$={requestsStatus:null,requestsArea:null,requestsClosed:!1,requestsWords:null},rc=`1`;function ic(e,t,n){if(e===`work`&&t!==null){let{requestsStatus:e,requestsClosed:t,requestsWords:r}=n;return{...$,requestsStatus:e,requestsClosed:t,requestsWords:r,requestsBy:null}}if(e!==`requests`)return{...$,requestsBy:null};if(n.requestsBy!==null)return{...$,requestsBy:n.requestsBy};let{requestsStatus:r,requestsArea:i,requestsClosed:a,requestsWords:o}=n;return{requestsStatus:r,requestsArea:i,requestsClosed:a,requestsWords:o,requestsBy:null}}var ac={focusAreasWords:null,focusAreasOrder:null,monthsOrder:null},oc={areaTab:null,areaSub:null};function sc(e,t,{areaTab:n,areaSub:r}){return e!==`work`||t===null?oc:r===null?{areaTab:n,areaSub:null}:{areaTab:null,areaSub:r}}var cc={requestPart:null,requestSession:null};function lc(e,{requestPart:t,requestSession:n}){return!e||t===null?cc:{requestPart:t,requestSession:t===`conversation`?n:null}}var uc={rulesTab:null,rulesWords:null};function dc(e,{rulesTab:t,rulesWords:n}){if(e!==`rules`)return uc;let r=t===Fs?null:t;return{rulesTab:r,rulesWords:r===null?n:null}}var fc={focusChoice:null,findQuery:null,...$,requestsBy:null,...ac,...oc,...cc,...uc},pc={openRequest:null,...cc};function mc(e,{by:t=null,status:n,area:r,closed:i}){let a=e.section===`requests`&&e.requestsBy===null?e:$;return{...fc,section:`requests`,...ic(`requests`,null,{requestsBy:t,requestsStatus:n===void 0?a.requestsStatus:n,requestsArea:r===void 0?a.requestsArea:r,requestsClosed:i??a.requestsClosed,requestsWords:a.requestsWords})}}function hc(e,{status:t,closed:n}){return{requestsStatus:t===void 0?e.requestsStatus:t,requestsClosed:n??e.requestsClosed}}var gc={"#focus-areas":`focus`,"#all-requests":`requests`},_c={to:`top`};function vc(e){let t=e.searchParams.get(`view`),n=!t&&!e.searchParams.get(`focus`)?gc[e.hash]??null:null,r=t&&ec.includes(t)?t:n??`work`,i=r===`work`&&e.searchParams.get(`focus`)||null,a=e.searchParams.get(`theme`),o=e.searchParams.get(`by`),s=e.searchParams.get(`status`),c=e.searchParams.get(`order`),l=e.searchParams.get(`tab`),u=e.searchParams.get(`part`),d=e.searchParams.get(`session`),f=e.searchParams.get(`request`)||null;return{page:e.searchParams.get(`setup`)===`1`?`setup`:`app`,section:r,focusChoice:i,requestId:f,theme:Se(a)?a:null,findQuery:r===`find`&&e.searchParams.get(`q`)||null,...ic(r,i,{requestsBy:tc(nc,o)?o:null,requestsStatus:cs(s)?s:null,requestsArea:e.searchParams.get(`area`)||null,requestsClosed:e.searchParams.get(`closed`)===rc,requestsWords:e.searchParams.get(`q`)||null}),focusAreasWords:r===`focus`&&e.searchParams.get(`q`)||null,focusAreasOrder:r===`focus`&&tc(j,c)?c:null,monthsOrder:r===`past-focus`&&tc(Vs,c)?c:null,...sc(r,i,{areaTab:tc(Ae,l)?l:null,areaSub:e.searchParams.get(`sub`)||null}),...lc(f!==null,{requestPart:Es(u)?u:null,requestSession:A(d)?d:null}),...dc(r,{rulesTab:Is(l)?l:null,rulesWords:e.searchParams.get(`q`)||null})}}function yc(e,t){let n=new URL(e),r=(e,t)=>{t?n.searchParams.set(e,t):n.searchParams.delete(e)};r(`view`,t.section===`work`?null:t.section),r(`focus`,t.section===`work`?t.focusChoice:null);let i=ic(t.section,t.focusChoice,t);r(`status`,i.requestsStatus),r(`by`,i.requestsBy),r(`area`,i.requestsArea),r(`closed`,i.requestsClosed?rc:null),r(`request`,t.openRequest?.id??null);let a=dc(t.section,t);r(`q`,t.section===`find`?t.findQuery:t.section===`focus`?t.focusAreasWords:t.section===`rules`?a.rulesWords:i.requestsWords),r(`order`,t.section===`focus`?t.focusAreasOrder:t.section===`past-focus`?t.monthsOrder:null);let o=sc(t.section,t.focusChoice,t);r(`tab`,t.section===`rules`?a.rulesTab:o.areaTab),r(`sub`,o.areaSub);let s=lc(t.openRequest!==null,t);return r(`part`,s.requestPart),r(`session`,s.requestSession),n.hash=``,n}var bc={work:`work`,focus:`focus`,suggested:`focus`,"past-focus":`focus`,"build-story":`focus`,requests:`requests`,"review-stack":`review-stack`,rules:`rules`,workspace:null,machine:null,find:null};function xc(e){return e.openRequest?`requests`:e.section===`work`&&e.focusChoice?`focus`:bc[e.section]}var Sc=e=>(t,n)=>{let r=vc(new URL(e.href())),i=!1,a=0,o=e=>({sequence:++a,target:e}),s=e.savedScrollY(),c=s===null?null:{to:`position`,y:s},l=(r,{replace:i=!1,scroll:a}={})=>{let s=n().view.section;t(e=>{Object.assign(e.view,r),a&&(e.view.scrollAsk=o(a))});let c=n().view.section;e.reportsUsage&&c!==s&&e.sendUsage(Ta(c,s));let l=new URL(e.href()),u=yc(l,n().view);u.href!==l.href&&e.writeUrl(u,i)},u=e=>{let t=n().work.load;return t.state===`loaded`?t.model.requests.find(t=>t.id===e)??null:null};return{view:{page:r.page,section:r.section,focusChoice:r.focusChoice,openRequest:r.requestId?{id:r.requestId,fromLiveFeed:null,fallback:null}:null,requestPart:r.requestPart,requestSession:r.requestSession,findQuery:r.findQuery,requestsStatus:r.requestsStatus,requestsBy:r.requestsBy,requestsArea:r.requestsArea,requestsClosed:r.requestsClosed,requestsWords:r.requestsWords,focusAreasWords:r.focusAreasWords,focusAreasOrder:r.focusAreasOrder,monthsOrder:r.monthsOrder,areaTab:r.areaTab,areaSub:r.areaSub,rulesTab:r.rulesTab,rulesWords:r.rulesWords,scrollAsk:c?o(c):null,workspace:{mode:`home`,team:!1,connected:!1},showSpec:!1,theme:ke(e.storage??void 0),themeForThisVisit:r.theme,sort:`attention`,focusArtwork:`compact`},goToPage:(e,t)=>l({section:e,...fc,...pc},{scroll:t?.elementId?{to:`element`,elementId:t.elementId}:_c}),goToFocus:(e,t)=>{l({section:`work`,...fc,...pc,focusChoice:e,areaSub:t?.sub??null},{scroll:_c}),t?.sub&&n().reconcileFocusChoice()},showRequests:e=>{let{section:t,requestsBy:r}=n().view,i=t===`requests`&&r===(e.by??null);l({...mc(n().view,e),...pc},i?{}:{scroll:{to:`top`}})},setFindQuery:e=>l({findQuery:e===``?null:e},{replace:!0}),setRequestsWords:e=>l({requestsWords:e===``?null:e},{replace:!0}),setFocusAreasWords:e=>l({focusAreasWords:e===``?null:e},{replace:!0}),setFocusAreasOrder:e=>l({focusAreasOrder:e}),setMonthsOrder:e=>l({monthsOrder:e}),showAreaTab:e=>l({areaTab:e,areaSub:null,...$}),showRulesTab:(e,t)=>{let r=n().view.section!==`rules`||n().view.openRequest!==null;l({section:`rules`,...fc,...pc,...dc(`rules`,{rulesTab:e,rulesWords:null})},t?.elementId?{scroll:{to:`element`,elementId:t.elementId}}:r?{scroll:_c}:{})},setRulesWords:e=>l({rulesWords:e===``?null:e},{replace:!0}),showSubFocus:(e,t)=>{l({areaSub:e,areaTab:null,...$},{scroll:_c,replace:t?.replace??!1}),n().reconcileFocusChoice()},showAreaList:e=>l(hc(n().view,e)),openRequestPage:e=>{let t={id:e.id,fromLiveFeed:u(e.id)!==null,fallback:e};l({openRequest:t,...cc},{scroll:_c})},showRequestPart:(e,t=null,r)=>l(lc(n().view.openRequest!==null,{requestPart:e,requestSession:t}),{scroll:_c,replace:r?.replace??!1}),reconcileOpenRequest:()=>{let e=n().view.openRequest;if(!e||n().work.load.state!==`loaded`)return;let r=u(e.id);r&&e.fromLiveFeed!==!0?t(t=>{t.view.openRequest={...e,fromLiveFeed:!0}}):!r&&e.fromLiveFeed!==!1&&l(pc,{replace:!0})},reconcileFocusChoice:()=>{let{section:e,focusChoice:t,areaTab:r,areaSub:i,requestsStatus:a,requestsClosed:o,requestsWords:s}=n().view,c=n().work.load;if(c.state!==`loaded`||t===null)return;let u=wc({section:e,focusChoice:t},c.model.focusAreas);if(u===null){l({focusChoice:null,...oc,...$},{replace:!0});return}let d=a!==null||o||s!==null;if(r===null&&i===null&&!d)return;let f=Le(u,c.model.focusAreas,c.model.requests,r,i),p=f.tab!==r||Re(f.sub)!==i,m=d&&(p||!f.list);(p||m)&&l({areaTab:f.tab,areaSub:Re(f.sub),...m?$:{}},{replace:!0})},reconcileRequestsDetails:()=>{let{section:r,requestsArea:i}=n().view;if(r!==`requests`)return;let a=n().work.load;a.state===`loaded`&&i!==null&&!Ks(a.model.requests,a.model.focusAreas).includes(i)&&t(e=>{e.view.requestsArea=null});let o=new URL(e.href()),s=yc(o,n().view);s.search!==o.search&&(s.hash=o.hash,e.writeUrl(s,!0))},showUrl:()=>{let r=vc(new URL(e.href())),i=e.savedScrollY(),a=n().view.openRequest,s=n().view.section;t(e=>{e.view.section=r.section,e.view.focusChoice=r.focusChoice,e.view.openRequest=r.requestId?a?.id===r.requestId?a:{id:r.requestId,fromLiveFeed:null,fallback:null}:null,e.view.requestPart=r.requestPart,e.view.requestSession=r.requestSession,e.view.findQuery=r.findQuery,e.view.requestsStatus=r.requestsStatus,e.view.requestsBy=r.requestsBy,e.view.requestsArea=r.requestsArea,e.view.requestsClosed=r.requestsClosed,e.view.requestsWords=r.requestsWords,e.view.focusAreasWords=r.focusAreasWords,e.view.focusAreasOrder=r.focusAreasOrder,e.view.monthsOrder=r.monthsOrder,e.view.areaTab=r.areaTab,e.view.areaSub=r.areaSub,e.view.rulesTab=r.rulesTab,e.view.rulesWords=r.rulesWords,i!==null&&(e.view.scrollAsk=o({to:`position`,y:i}))}),e.reportsUsage&&r.section!==s&&e.sendUsage(Ta(r.section,s)),n().reconcileOpenRequest(),n().reconcileFocusChoice(),n().reconcileRequestsDetails()},startSetup:()=>{let r=new URL(e.href());r.searchParams.set(`setup`,`1`),e.writeUrl(r,!0),e.reportsUsage&&e.sendUsage(Ta(`setup`,n().view.section)),t(e=>{e.view.page=`setup`})},finishSetup:()=>{let n=new URL(e.href());n.searchParams.delete(`setup`),e.writeUrl(n,!0),e.scrollToTop(),e.reportsUsage&&e.sendUsage(Ta(`work`,`setup`)),t(e=>{e.view.page=`app`,e.view.section=`work`})},reportOpen:()=>{if(!e.reportsUsage||i)return;i=!0;let{page:t,section:r}=n().view;e.sendUsage(Ta(t===`setup`?`setup`:r,null))},setWorkspace:e=>t(t=>{Object.assign(t.view.workspace,e)}),setShowSpec:e=>t(t=>{t.view.showSpec=e}),setTheme:n=>{let r=new URL(e.href());r.searchParams.has(`theme`)&&(r.searchParams.delete(`theme`),e.writeUrl(r,!0)),Te(n,e.storage??void 0),t(e=>{e.view.theme=n,e.view.themeForThisVisit=null})},setSort:e=>t(t=>{t.view.sort=e}),setFocusArtwork:e=>t(t=>{t.view.focusArtwork=e})}};function Cc(e){return e.themeForThisVisit??e.theme}function wc(e,t){return e.section===`work`?e.focusChoice===`other`?e.focusChoice:pe(e.focusChoice,t):null}function Tc(e,t){let n=new Map(e.map(e=>[e.id,e.contentFingerprint]));return t.filter(e=>!n.has(e.id)||n.get(e.id)!==e.contentFingerprint).map(e=>e.id)}var Ec=e=>e.title??e.resolvesTo?.title??`New request, title being written`,Dc=(e,t)=>t.state===`idle`&&e.contentFingerprint===t.contentFingerprint;function Oc(e,t,n){let r=new Map(e.map(e=>[e.id,e])),i=[];for(let e of t){let t=r.get(e.id),a=Ec(e);t?t.state!==e.state&&!Dc(t,e)?i.push({kind:`state`,requestId:e.id,title:a,from:t.state,to:e.state,at:n}):e.progress.percent!==null&&e.progress.percent>(t.progress.percent??-1)&&i.push({kind:`progress`,requestId:e.id,title:a,from:t.progress.percent,to:e.progress.percent,at:n}):e.closed||i.push({kind:`new`,requestId:e.id,title:a,at:n})}return i}var kc=4e3,Ac=7e3,jc=e=>e instanceof Error?e.message:String(e),Mc=(e,t)=>{let n=null,r=0,i=0,a,o=n=>{let r=t().work.load,o=r.state===`loaded`?new Set(Tc(r.model.requests,n.requests)):new Set,s=r.state===`loaded`?Oc(r.model.requests,n.requests,Date.now()):[];for(let e of s)o.add(e.requestId);i++,e(e=>{e.work.load={state:`loaded`,model:n},e.work.connection=n.connection,o.size>0&&(e.work.freshlyUpdatedIds=o);let t=s[0]??e.work.latestChange,r=t&&n.requests.some(e=>e.id===t.requestId)?t:null;r!==e.work.latestChange&&(e.work.latestChange=r)}),o.size>0&&(clearTimeout(a),a=setTimeout(()=>e(e=>{e.work.freshlyUpdatedIds=new Set}),kc)),t().reconcileOpenRequest(),t().reconcileFocusChoice(),t().reconcileRequestsDetails()},s=e=>{if(!n)throw Error(`No data source to ${e}`);return n},c=async()=>{let n=s(`read work from`),a=r,c=i;try{let s=await n.loadWorkModel();return r===a&&(i===c&&o(s),t().work.readAfterSaveFailure!==null&&e(e=>{e.work.readAfterSaveFailure=null})),{read:!0}}catch(n){return r===a&&t().work.load.state!==`loaded`&&e(e=>{e.work.load={state:`failed`,error:jc(n)}}),{read:!1,error:jc(n)}}},l=async(t,n)=>{if(i===n){o(t),e(e=>{e.work.readAfterSaveFailure=null});return}let a=r,c=i;try{let t=await s(`read work from`).loadWorkModel();if(r!==a)return;i===c&&o(t),e(e=>{e.work.readAfterSaveFailure=null})}catch(t){if(r!==a)return;e(e=>{e.work.readAfterSaveFailure=jc(t)})}},u=async(e,t,n)=>{let a=s(e),c=r,u=i,d;try{d=await t(a)}catch(e){throw e instanceof re&&r===c&&o(e.model),e}let f=n(d);return f&&r===c&&await l(f,u),d};return{work:{load:{state:`loading`},connection:null,freshlyUpdatedIds:new Set,latestChange:null,sourceKind:null,readAfterSaveFailure:null},startWorkSource:i=>{let o=++r;n=i,e(e=>{e.work.sourceKind=i.sourceKind});let s=()=>r===o,l=i.subscribeToLiveUpdates(e=>{s()&&t().receiveWorkModel(e)},e=>{s()&&t().receiveConnection(e)});return c(),()=>{l(),s()&&(r++,clearTimeout(a))}},retryWorkRead:async()=>(t().work.load.state===`failed`&&e(e=>{e.work.load={state:`loading`}}),c()),loadRequestDetail:(e,t)=>{let n=s(`read request detail from`);return e.detailLoaded!==!1||!n.loadRequestDetail?Promise.resolve(e):n.loadRequestDetail(e.id,e.detailRevision??e.contentFingerprint,t)},receiveWorkModel:n=>{o(n),t().work.readAfterSaveFailure!==null&&e(e=>{e.work.readAfterSaveFailure=null})},receiveConnection:n=>{let r=t().work.connection,i=r?.sync?.state===n.sync?.state&&r?.sync?.label===n.sync?.label&&r?.sync?.detail===n.sync?.detail&&r?.sync?.tone===n.sync?.tone;r&&i&&r.state===n.state&&r.label===n.label&&r.detail===n.detail&&r.tooltip===n.tooltip||e(e=>{e.work.connection=n})},setRequestChecked:(e,t,n,r)=>u(`save the check to`,i=>i.setRequestChecked(e,n??``,t,r),e=>`model`in e?e.model:null),answerRequestSuggestion:(e,t)=>u(`answer the suggestion in`,n=>{if(!n.answerRequestSuggestion)throw Error(`Request suggestions are unavailable in this viewer.`);return n.answerRequestSuggestion(e,t)},e=>e.model),saveRuleChange:e=>u(`save the rule change to`,t=>t.saveRuleChange(e),e=>e.model),saveFocusChange:e=>u(`save the focus change to`,t=>t.saveFocusChange(e),e=>e),markAgentFinished:async e=>{await u(`save the agent to`,t=>t.markAgentFinished(e),e=>e)},loadRulesInClaudeCode:async()=>{await u(`load the rules from`,e=>e.loadRulesInClaudeCode(),e=>e)},refreshWork:()=>s(`start a refresh on`).refreshWork(),conversationContinuationSource:()=>{let e=s(`continue a conversation from`);return ee(e)?e:null},updateSampleRequest:(e,n)=>{let r=t().work.load;if(r.state!==`loaded`)throw Error(`Sample request ${e} changed before the work model loaded`);if(r.model.sourceKind!==`sample`)throw Error(`updateSampleRequest edits sample data only; ${r.model.sourceKind} requests change through their data source`);let i=M.findIndex(t=>t.id===e);if(i<0)throw Error(`No request ${e}`);M[i]=ae(n(M[i])),o({...r.model,requests:[...M]})},playSampleDemo:()=>{let e=setTimeout(()=>t().updateSampleRequest(`r1`,e=>({...e,state:`needs-check`,stage:`Reviewing`,progress:{...e.progress,percent:100,readings:4,reviewedAt:`2:04 pm`,history:[30,55,70,100]},estimate:null,next:{who:`human`,text:`Check the wireframe against the spec`},workstreams:e.workstreams.map(e=>({...e,tasks:e.tasks.map(e=>({...e,done:!0}))})),granular:[{kind:`work`,text:`Wireframe: My Rules screens done`,at:`2:03 pm`},...e.granular],story:e.story.map(e=>({...e,status:`complete`})),activityWord:``})),Ac);return()=>clearTimeout(e)}}};To(),Oo(!1);var Nc=[`attention`,`started`,`progress`],Pc=[`full`,`compact`,`off`];function Fc(e){let t=e??{},n={};return Nc.includes(t.sort)&&(n.sort=t.sort),Pc.includes(t.focusArtwork)&&(n.focusArtwork=t.focusArtwork),n}var Ic=2;function Lc(e,t){if(t<1||t>2)return{};let{focusArtwork:n,...r}=Fc(e);return t<Ic&&n===`full`?r:n?{...r,focusArtwork:n}:r}function Rc(e){return Po()(qo(Uo(Jo((...t)=>({...Mc(...t),...Sc(e)(...t),...is(...t),...ts(...t)})),{name:`claude-mem-my-work`}),{name:Ee,version:2,migrate:Lc,...e.storage?{storage:Go(()=>e.storage)}:{},partialize:({view:{sort:e,focusArtwork:t}})=>({sort:e,focusArtwork:t}),merge:(e,t)=>({...t,view:{...t.view,...Fc(e)}})}))}var zc=e=>{let t=e;t.use={};for(let e of Object.keys(t.getState()))t.use[e]=()=>t(t=>t[e]);return t},Bc=E(),Vc=!Bc&&new URLSearchParams(window.location.search).get(`source`)===`sample`?Ca():k;function Hc(){let e;try{e=window.localStorage,e.getItem(Ee)}catch{let t=new Map;e={getItem:e=>t.get(e)??null,setItem:(e,n)=>{t.set(e,n)},removeItem:e=>{t.delete(e)}}}return{getItem:t=>e.getItem(t),setItem:(t,n)=>{e.getItem(t)!==n&&e.setItem(t,n)},removeItem:t=>e.removeItem(t)}}var Uc=`claude-mem:my-work:left-scrolled`;function Wc(){window.history.scrollRestoration=`manual`;let e=0,t=()=>`${performance.timeOrigin}:${++e}`,n=()=>window.history.state??{},r=new Map,i=n().entryId,a=typeof i==`string`?i:t(),o=e=>window.history.replaceState({...n(),entryId:a,...e?{scrollY:window.scrollY}:{}},``);o(!1);try{let{entryId:e,scrollY:t}=JSON.parse(window.sessionStorage.getItem(Uc)??`null`)??{};e===a&&typeof t==`number`&&r.set(a,t)}catch{}return window.addEventListener(`pagehide`,()=>{try{window.sessionStorage.setItem(Uc,JSON.stringify({entryId:a,scrollY:window.scrollY}))}catch{}}),{writeUrl:(e,n)=>{n?window.history.replaceState(window.history.state,``,e):(r.set(a,window.scrollY),o(!0),a=t(),window.history.pushState({entryId:a},``,e))},arrived:()=>{r.set(a,window.scrollY);let e=n().entryId;a=typeof e==`string`?e:t(),typeof e!=`string`&&o(!1)},savedScrollY:()=>{let e=n().scrollY;return r.get(a)??(typeof e==`number`?e:null)}}}var Gc=Wc(),Kc=zc(Rc({href:()=>window.location.href,writeUrl:Gc.writeUrl,storage:Hc(),reportsUsage:!Bc&&Vc===k,sendUsage:d(window.location.hostname)?Aa:ka,scrollToTop:()=>window.scrollTo(0,0),savedScrollY:Gc.savedScrollY}));window.addEventListener(`popstate`,()=>{Gc.arrived(),Kc.getState().showUrl()});function qc(){let e=Kc.getState().work.load;if(e.state!==`loaded`)throw Error(`Work model read before it loaded (${e.state})`);return e.model}function Jc(){let e=Kc(e=>e.work.load);if(e.state!==`loaded`)throw Error(`useWorkModel() before the work model loaded (${e.state})`);return e.model}function Yc(){let e=Kc(e=>e.work.connection);if(!e)throw Error(`useConnection() before the work model loaded`);return e}var Xc=e=>Kc(t=>t.work.freshlyUpdatedIds.has(e));function Zc(){return Kc(ui(e=>{let{mode:t,team:n,connected:r}=e.view.workspace,{sourceKind:i}=e.work;return{mode:i===`sample`||i===null?t:i===`cloud`?`web`:`home`,team:n,connected:r}}))}var Qc=e=>qc().requests.find(t=>t.id===e)??null;function $c(e){let t=qc().agents.find(t=>t.id===e);if(!t)throw Error(`No agent ${e}`);return t}function el(e){let t=qc().devices.find(t=>t.id===e);if(!t)throw Error(`No device ${e}`);return t}var tl=new Map([{id:`R1.1`,section:`1`,kind:`ui`,text:`Human layer at a glance: what I asked for, who is on it, where it stands, what is next, what came out of it.`},{id:`R2.1`,section:`2`,kind:`ui`,text:`Every line is a human-understandable request; everything under it discloses more as you go deeper.`},{id:`R2.2`,section:`2`,kind:`ui`,text:`Requests come from my prompts; prompts that are not requests live underneath as work for one.`},{id:`R2.3`,section:`2`,kind:`backend`,text:`The tracker decides whether a new prompt is a new request or belongs to an open one.`,wireframe:`Request detail shows prompts the tracker attached to the request.`},{id:`R2.4`,section:`2`,kind:`backend`,text:`The tracker owns the human-facing display text.`},{id:`R2.5`,section:`2`,kind:`ui`,text:`One request survives /clear, tool switches and days: it groups every conversation that served it.`},{id:`R2.6`,section:`2`,kind:`ui`,text:`Human titles: no jargon, short, not 1:1 with granular records.`},{id:`R2.7`,section:`2`,kind:`process`,text:`Title generation cost is visible.`,wireframe:`Owner dropped generation-cost display on Oct 20, 2026: the spend is tiny next to the value. Not shown in the GUI.`},{id:`R2.8`,section:`2`,kind:`ui`,text:`A conversation behind a request can be continued from the request page: the owner's message is sent to that same conversation and its reply is shown there.`},{id:`R3.1`,section:`3`,kind:`retired`,text:`Retired 2026-10-27 (My Focus): the layer order is now focus areas (with Other), then requests, then request detail, then granular records. Replaced by R16.1 and R16.2.`},{id:`R3.2`,section:`3`,kind:`ui`,text:`Overall request: progress meter, dates, completion and the build story behind it.`},{id:`R3.3`,section:`3`,kind:`ui`,text:`My Work is the live inbox of requests: Requests lists every one, as it arrives.`,wireframe:`Reworded 2026-11-28 (My Work design pass, Phase 8): the request cards left with the focus area page’s old board; every request is a row on Requests (Phase 5).`},{id:`R3.4`,section:`3`,kind:`ui`,text:`Request detail has sub-cards for the workstreams under one request.`},{id:`R3.5`,section:`3`,kind:`ui`,text:`Granular records are a small truncated list of work-state updates and observations together, secondary, rolling in live.`},{id:`R3.6`,section:`3`,kind:`ui`,text:`Detail pages stay simple.`},{id:`R3.7`,section:`3`,kind:`retired`,text:`Retired 2026-10-27 (My Focus): the goals page is gone; focus areas sit in the MY FOCUS rail above the pages. Replaced by R16.1.`},{id:`R4.1`,section:`4`,kind:`retired`,text:`Retired 2026-11-28 (My Work design pass, Phase 8): the Cards view left with the focus area page’s old board. An area opens into sub focus cards (Codex D04), and each request is one row (Requests, and an area’s lists).`},{id:`R4.2`,section:`4`,kind:`ui`,text:`List view with sorting.`},{id:`R4.3`,section:`4`,kind:`ui`,text:`By agent view: a card per agent with its icon and what it is working on, an outer view to the list.`},{id:`R4.4`,section:`4, 15.2`,kind:`ui`,text:`A request’s status on the Team board’s rows is a line of split-flap tiles, as wide as its label, that flips when the status changes, like a train departures board.`,wireframe:`Reworded 2026-11-28 (My Work design pass, Phase 8): the List and its table left with the focus area page’s old board; the Team board’s rows keep the split-flap status.`},{id:`R4.5`,section:`4`,kind:`retired`,text:`Retired 2026-10-27 (My Focus): the month-by-month report moved to Past focus. Replaced by R16.7.`},{id:`R4.6`,section:`4`,kind:`ui`,text:`My Rules page: how I like to work, as if-then blocks.`},{id:`R5.1`,section:`5`,kind:`ui`,text:`Icon of the agent doing the work.`},{id:`R5.2`,section:`5`,kind:`ui`,text:`Who asked (essential in team mode).`},{id:`R5.3`,section:`5`,kind:`ui`,text:`When it started.`},{id:`R5.4`,section:`5`,kind:`retired`,text:`Retired 2026-11-28 (My Work design pass, Phase 9): a request is a page now, and its details say when it started and, once shipped, when it shipped, with no running time (Codex D07 takes elapsed time out from ahead of the next step; Phase 6 took the timers off Home’s rows).`},{id:`R5.5`,section:`5`,kind:`ui`,text:`What stage it is in.`},{id:`R5.6`,section:`5, 15.3`,kind:`ui`,text:`Ship estimate, only from measured pace ("at this pace, about Oct 24"), otherwise empty.`},{id:`R5.7`,section:`5, 15.4`,kind:`ui`,text:`After ship: Shipped state with follow-ups tagged Docs, Promo or Other; open follow-ups stay visible.`},{id:`R5.8`,section:`5`,kind:`ui`,text:`What's next, and whose move: bot icon or human icon.`},{id:`R5.9`,section:`5`,kind:`retired`,text:`Retired 2026-11-28 (My Work design pass, Phase 9): the progress meter left with the request drawer (the card left in Phase 8). A request is a page now, and its details give the percent its memory review read and when (R5.11), with when it started (R5.3) and, once shipped, when (Codex D07).`},{id:`R5.10`,section:`5`,kind:`ui`,text:`Work product attached as links (decks, PRs, pages), viewable from the request and goals.`},{id:`R5.11`,section:`5`,kind:`ui`,text:`Progress comes from a memory review, not guesses, and shows its evidence.`},{id:`R5.12`,section:`5`,kind:`ui`,text:`Deliverables (decks, reports, pages, files the agent made) are linked on the front of the card, one click to open; claude-mem keeps a copy in the project bucket.`},{id:`R6.1`,section:`6`,kind:`ui`,text:`Runs live off work-state updates.`},{id:`R6.2`,section:`6`,kind:`ui`,text:`States you can tell apart at a glance: working, done but not yet checked, and so on.`},{id:`R6.3`,section:`6`,kind:`ui`,text:`Space for people to pick up work.`},{id:`R6.4`,section:`6`,kind:`ui`,text:`A real indicator of what is live and what is not.`},{id:`R7.1`,section:`7`,kind:`ui`,text:`Performance and shipping velocity, in human terms, not a raw index.`},{id:`R7.2`,section:`7`,kind:`ui`,text:`A real narrative of the build story.`},{id:`R7.3`,section:`7`,kind:`ui`,text:`Preferences extracted for how I like to work feed self-learning (My Rules).`},{id:`R7.4`,section:`7`,kind:`retired`,text:`Retired 2026-11-28 (My Work design pass, Phase 8): the recap left the focus area page (its hero image was a sample placeholder; no daily image is made from real records). The build story is its own page (Phase 7).`},{id:`R8.1`,section:`8`,kind:`ui`,text:`Replaces the localhost:377** viewer; fully local and live.`},{id:`R8.2`,section:`8`,kind:`retired`,text:`Retired 2026-11-28 (My Work design pass, Phase 8): the sample’s Connect Claude.ai / Connect ChatGPT buttons sat in the area page’s recap, which left. The Cloud Sync offer and Workspace’s account link are the way to cloud sync.`},{id:`R8.3`,section:`8`,kind:`process`,text:`Ships as the flagship claude-mem 14.0.0+ open-source release.`},{id:`R8.4`,section:`8`,kind:`backend`,text:`PostHog telemetry on how agents adhere to work state.`},{id:`R9.1`,section:`9`,kind:`ui`,text:`TeamBrain is a natural extension of the same GUI, not a separate app.`},{id:`R9.2`,section:`9`,kind:`ui`,text:`Team work-state board: work collisions, roles, delegation, everyone in sync.`},{id:`R9.3`,section:`9`,kind:`ui`,text:`"Who asked" is essential in team mode.`},{id:`R9.4`,section:`9`,kind:`ui`,text:`Self-serve PLG: buy the team plan from inside the product.`},{id:`R9.5`,section:`9`,kind:`process`,text:`Quality bar: no "colorful mess"; real design attention.`,wireframe:`Grayscale wireframe; color decisions belong to the mockup pass.`},{id:`R10.1`,section:`10`,kind:`process`,text:`Clarity like Basecamp and Patreon; AI SDK Agents patterns as reference.`,wireframe:`AI Elements and the AI SDK Agents patterns are a design reference, not a required kit; Aceternity components sit alongside them.`},{id:`R10.2`,section:`10`,kind:`ui`,text:`Subtle drop shadows that give surfaces texture, not one on everything; nothing harsh.`},{id:`R10.3`,section:`10`,kind:`ui`,text:`React on a real UI kit, not plain HTML.`},{id:`R10.4`,section:`10`,kind:`ui`,text:`Agent icons on their work; the cmem brain mark is the only logo.`},{id:`R10.5`,section:`10`,kind:`ui`,text:`Clean, uncluttered text.`},{id:`R11.1`,section:`11`,kind:`ui`,text:`Mobile designed for human eyes and thumbs.`},{id:`R11.2`,section:`11`,kind:`process`,text:`Visual design goes through image mockups with the UI Redesign skill, run by Codex.`,wireframe:`Superseded on Oct 26, 2026: the owner asked for Aceternity components built straight into the React app, any of them, skeuomorphic included.`},{id:`R12.1`,section:`12`,kind:`ui`,text:`Real data only, never simulated; empty states instead of invented numbers.`},{id:`R12.2`,section:`12`,kind:`ui`,text:`Show what a person needs to decide, not raw counts.`},{id:`R12.3`,section:`12`,kind:`ui`,text:`Lead with what matters to the reader.`},{id:`R13.1`,section:`13`,kind:`ui`,text:`The same UI runs at home (localhost) and on the go (cmem.ai).`},{id:`R13.2`,section:`13`,kind:`ui`,text:`Other machines' agents show alongside local ones, already synced.`},{id:`R13.3`,section:`13.1`,kind:`backend`,text:`Replay rows in write order, then source device and row.`},{id:`R13.4`,section:`13.2`,kind:`ui`,text:`Say which agent and machine did the work; device name when the agent is unknown.`},{id:`R13.5`,section:`13.3`,kind:`backend`,text:`Groupings, titles, goals runs and rules sync as append-only records.`},{id:`R13.6`,section:`13.4`,kind:`backend`,text:`Turn work-state sync on, accounting for clients before 13.29.`},{id:`R13.7`,section:`13.5`,kind:`ui`,text:`Changes made on the web are written from a "web" device and pulled down by every machine.`},{id:`R13.8`,section:`13.6`,kind:`retired`,text:`Retired 2026-11-28 (My Work design pass, Phase 10): the per-machine freshness list ("MacBook, synced 4 min ago") was the sample's, in My Rules' right rail, which went (Claude D13). Real data records only this computer; Machine and sync shows it and cloud sync.`},{id:`R14.1`,section:`14`,kind:`retired`,text:`Retired 2026-10-27 (My Focus): the nav is MY FOCUS (areas, Other, Suggested), then My Work, then My Rules. Replaced by R16.1.`},{id:`R14.2`,section:`14`,kind:`ui`,text:`Learned rules not yet approved wait on My Rules' Suggestions tab, one at a time with their scope, until the owner decides them.`,wireframe:`Reworded 2026-11-28 (My Work design pass, Phase 10): suggestions left each scope for a tab of their own (Codex D10); the strength chips went (Claude D15).`},{id:`R14.3`,section:`14`,kind:`ui`,text:`Rule block: When, Then, Why (dated quotes), Strength, Status.`},{id:`R14.4`,section:`14`,kind:`ui`,text:`Replaced rules stay reachable: the rule that replaced them lists them, with the date each was replaced, under Earlier versions.`,wireframe:`Reworded 2026-11-28 (My Work design pass, Phase 10): In use is one row per rule in use (Claude D16), so a replaced rule shows in the opened row of the rule that replaced it.`},{id:`R14.5`,section:`14`,kind:`ui`,text:`Grouped by scope: everywhere, then per product or project, then per situation.`},{id:`R14.6`,section:`14`,kind:`ui`,text:`Within a scope, rules the owner wrote or approved come first, grouped apart from learned ones.`},{id:`R14.7`,section:`14`,kind:`ui`,text:`Then sorted by strength (times seen × recency); newer wins a conflict.`},{id:`R14.8`,section:`14`,kind:`ui`,text:`Rules merge request-progress preferences and owner-goals "how they want work done"; source is shown.`},{id:`R14.9`,section:`14`,kind:`ui`,text:`Owner can approve, edit, turn off or add a rule.`},{id:`R14.10`,section:`14`,kind:`ui`,text:`Machine and sync’s Focus review shows when the owner-goals and request-progress runs last finished, on which machine, the review’s progress, and Review now.`,wireframe:`Reworded 2026-11-28 (My Work design pass, Phase 4): the refresh buttons on My Goals and My Rules became the one Focus review on Machine and sync. Cost part dropped by the owner on Oct 20, 2026.`},{id:`R14.11`,section:`14`,kind:`ui`,text:`On the web, Refresh queues a run for the next online machine.`},{id:`R14.12`,section:`14`,kind:`ui`,text:`request-progress gets a Refresh button too.`},{id:`R14.13`,section:`14`,kind:`ui`,text:`At home, Refresh runs on the local worker, which reads the Claude Code and Codex transcripts; the web cannot.`},{id:`R14.14`,section:`14`,kind:`ui`,text:`Strength reads in human terms: times seen, latest date, and whether the owner set it or it was learned.`},{id:`D1`,section:`15.1`,kind:`retired`,text:`Retired 2026-10-27 (My Focus): the combined-progress rule (reviewed requests only) now applies to the area header, and the card chip names the area, Other, or Sorting…. Replaced by R16.2 and R16.5.`},{id:`D5`,section:`15.5`,kind:`retired`,text:`Retired 2026-11-28 (My Work design pass, Phase 8): the request card that played an agent-only request’s lines into its human title left with the focus area page’s old board. A request still being named reads "New request, title being written" on its row (R2.6).`},{id:`D6`,section:`15.6`,kind:`process`,text:`Each Refresh shows its last run cost; My Rules shows the week’s title cost.`,wireframe:`Owner dropped generation-cost display on Oct 20, 2026: the spend is tiny next to the value. Not shown in the GUI.`},{id:`D7`,section:`15.7`,kind:`ui`,text:`Approved rules are written to ~/.claude-mem/MY-RULES.md and loaded with user-level instructions; never project files; approved only.`},{id:`R3.8`,section:`3`,kind:`retired`,text:`Retired 2026-10-27 (My Focus): mined focus areas become suggested areas, and asks show as Not started rows under their area, each with dated quotes. Replaced by R16.2 and R16.4.`},{id:`R3.9`,section:`3`,kind:`retired`,text:`Retired 2026-10-27 (My Focus): request progress rolls up into its focus area header; goals are one sentence on an area. Replaced by R16.2.`},{id:`R16.1`,section:`16`,kind:`retired`,text:`Retired 2026-11-27 (My Work design pass, Phase 3): the MY FOCUS rail and its phone chip row are gone. One bar holds the places (src/ui/app-places.ts); focus areas, Other and Suggested are reached from Focus areas.`},{id:`R16.2`,section:`16`,kind:`ui`,text:`A focus area’s page: its name, goal sentence and picture; its sub focus cards (or its list); asks with no work yet as Not started rows with the day asked and Copy prompt; "About this area" (why it is here, how often and when I asked, what shipped, sharing); and "Area options" to Rename, Edit goal, Merge into…, reorder, Share and mark Done.`,wireframe:`Reworded 2026-11-28 (My Work design pass, Phase 8; Claude D10, Codex D04): the combined progress, its footnote and "N of N requests reviewed" are gone, and the header’s words, sharing and menu moved to the page’s foot.`},{id:`R16.3`,section:`16`,kind:`ui`,text:`Other is a permanent bucket for requests that fit no area, with its own header; it is never an area.`},{id:`R16.4`,section:`16`,kind:`ui`,text:`Suggested areas wait in a decision queue with Keep, Rename, Merge and Dismiss; each decision can be undone, and a refresh never overrides it.`},{id:`R16.5`,section:`16`,kind:`ui`,text:`Each request shows its area chip: the area's name, Other, or "Sorting…" until a refresh places it.`},{id:`R16.6`,section:`16`,kind:`ui`,text:`Move to… on a request puts it in another area or Other; my move wins over any later automatic placement.`},{id:`R16.7`,section:`16`,kind:`ui`,text:`Past focus holds areas marked done and what I asked for most, month by month.`},{id:`R17.1`,section:`17`,kind:`ui`,text:`Share a focus area as a page by link (cmem.ai/focus/…), from the area menu; the area shows that it is shared.`},{id:`R17.2`,section:`17`,kind:`ui`,text:`People and agents can comment on the shared page; the owner reads and answers the comments from My Work.`},{id:`R17.3`,section:`17`,kind:`ui`,text:`When shared, it keeps updating and adding what belongs to the area, but nothing new and unrelated that the people it is shared with would not want to see (situational awareness): only requests placed in that area, never other areas or Other.`},{id:`R17.4`,section:`17`,kind:`ui`,text:`Stop sharing at any time; the link stops working for everyone, and sharing again makes a new link.`},{id:`R17.5`,section:`17`,kind:`backend`,text:`The shared page carries display text only: no prompts, quotes, transcripts, evidence links, files or machine names.`,wireframe:`to-shared-focus.ts builds the page; cmem.ai keeps only the shared shape (claude-mem-pro src/lib/focus-share/snapshot.ts).`},{id:`R18.1`,section:`18`,kind:`ui`,text:`On the cloud viewer only, the Workspace page (the bar’s "…") links "Account & billing" to cmem.ai/account. My Work served from this computer shows no such link.`}].map(e=>[e.id,e]));function nl({ids:e,children:t,className:n}){let i=Kc(e=>e.view.showSpec);for(let t of e)if(!tl.has(t))throw Error(`Unknown requirement id ${t}`);return i?(0,F.jsxs)(`div`,{className:r(`relative rounded-md outline outline-1 outline-dashed outline-sky-500/70`,n),"data-req":e.join(` `),children:[(0,F.jsx)(`div`,{className:`absolute -top-2.5 right-1 z-20 flex gap-0.5`,children:e.map(e=>(0,F.jsxs)(ni,{children:[(0,F.jsx)(ri,{asChild:!0,children:(0,F.jsx)(`span`,{className:`cursor-help rounded bg-sky-600 px-1 font-mono text-[10px] leading-4 text-white`,children:e})}),(0,F.jsxs)(ii,{className:`max-w-72`,children:[`§`,tl.get(e).section,`: `,tl.get(e).text]})]},e))}),t]}):(0,F.jsx)(F.Fragment,{children:t})}export{Ma as $,Us as A,Ce as At,ks as B,qs as C,Le as Ct,Ks as D,Fe as Dt,Ws as E,Ie as Et,Ls as F,Ss as G,As as H,zs as I,ss as J,xs as K,Bs as L,Fs as M,Ps as N,Gs as O,be as Ot,Rs as P,rs as Q,Ds as R,Xs as S,je as St,Ys as T,ze as Tt,js as U,Os as V,Ms as W,us as X,ds as Y,ls as Z,wc as _,mr as _t,Qc as a,Di as at,Zs as b,He as bt,Kc as c,bi as ct,pc as d,ni as dt,Li as et,fc as f,ii as ft,mc as g,ur as gt,hc as h,cr as ht,el as i,ki as it,Hs as j,Vs as k,Se as kt,Jc as l,Pi as lt,xc as m,ri as mt,Vc as n,Ti as nt,Yc as o,Oi as ot,$ as p,ei as pt,ws as q,$c as r,Ai as rt,Xc as s,Ni as st,nl as t,Ci as tt,Zc as u,ui as ut,Cc as v,ar as vt,$s as w,Re as wt,Qs as x,Ae as xt,yc as y,Ke as yt,Ns as z};