@cmmd-center/forge 0.13.6 → 0.13.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/{BunHttpServer-DKvSpNd1.cjs → BunHttpServer-C7-1JJ7b.cjs} +4 -4
  2. package/dist/{BunHttpServer-CDh4Vioe.mjs → BunHttpServer-CVPGkizx.mjs} +4 -4
  3. package/dist/{BunServices-D6PAheqS.mjs → BunServices-CPrZSIfE.mjs} +2 -2
  4. package/dist/{BunServices-DDh7Whyx.cjs → BunServices-Dl-3897e.cjs} +2 -2
  5. package/dist/{Cache-BVilO50s.mjs → Cache-C9cwdCDt.mjs} +2 -2
  6. package/dist/{Cache-DCF22Dfk.cjs → Cache-Cf3ARNaS.cjs} +2 -2
  7. package/dist/{HttpServer-ClsGgAq1.mjs → HttpServer-COaBeM7-.mjs} +2 -2
  8. package/dist/{HttpServer-D1gSU7NX.cjs → HttpServer-CggZzScj.cjs} +3 -3
  9. package/dist/{NodeHttpServer-Dfc7nSMq.cjs → NodeHttpServer-Bi339XFk.cjs} +5 -5
  10. package/dist/{NodeHttpServer-DT0TF8s4.mjs → NodeHttpServer-UQnvZnmu.mjs} +5 -5
  11. package/dist/{NodePTY-loxi8Vku.mjs → NodePTY-B1u6RHXk.mjs} +2 -2
  12. package/dist/{NodePTY-S4tPEwZc.cjs → NodePTY-UOaRyQsj.cjs} +2 -2
  13. package/dist/{NodeServices-Cb0rXFb2.cjs → NodeServices-CKFIZVu5.cjs} +2 -2
  14. package/dist/{NodeServices-DE8jhdcU.cjs → NodeServices-R0BZsZ72.cjs} +1 -1
  15. package/dist/{NodeServices-BahzLhbo.mjs → NodeServices-z1Ac4lEO.mjs} +2 -2
  16. package/dist/{NodeSqliteClient-DqFjB3u_.mjs → NodeSqliteClient-BrzqdOsF.mjs} +4 -4
  17. package/dist/{NodeSqliteClient-qjBWAOGq.cjs → NodeSqliteClient-CyJvo9y9.cjs} +4 -4
  18. package/dist/{NodeTerminal-rYbifme7.cjs → NodeTerminal-B89MobLp.cjs} +2 -2
  19. package/dist/{NodeTerminal-BPw7bktz.mjs → NodeTerminal-pYVVRTiD.mjs} +2 -2
  20. package/dist/{Path-CGCc_dDx.cjs → Path-BunGrE8F.cjs} +72 -1
  21. package/dist/{Path-C851t6sC.mjs → Path-evOm-H0Q.mjs} +61 -2
  22. package/dist/{SqlError-CzB6p9lL.cjs → SqlError-1wIMjXAf.cjs} +2 -2
  23. package/dist/{SqlError-3aqibZrj.mjs → SqlError-CezTFGvr.mjs} +2 -2
  24. package/dist/{SqliteClient-DTWCGkrj.mjs → SqliteClient-D3Yd3ZHn.mjs} +3 -3
  25. package/dist/{SqliteClient-Cq1peWN1.cjs → SqliteClient-bo7iui1t.cjs} +3 -3
  26. package/dist/bin.cjs +4875 -3961
  27. package/dist/bin.mjs +4422 -3514
  28. package/dist/client/assets/{CanvasPanel-BwSV27Ct.js → CanvasPanel-z0F-jdf1.js} +2 -2
  29. package/dist/client/assets/{CompositeItem-CZk3X-ud.js → CompositeItem-P9UVXCKv.js} +2 -2
  30. package/dist/client/assets/DiffPanel-CBfeDIH3.js +64 -0
  31. package/dist/client/assets/{DiffPanel.logic-D-SDgBF9.js → DiffPanel.logic-CZdlskWf.js} +2 -2
  32. package/dist/client/assets/DiffPanelShell-BnSbIo9A.js +2532 -0
  33. package/dist/client/assets/{DiffWorkerPoolProvider-BO_xUE3R.js → DiffWorkerPoolProvider-DC4SN57K.js} +9 -9
  34. package/dist/client/assets/{PullRequestCodePanel-CW4RK1Oa.js → PullRequestCodePanel-DwjjRPkc.js} +3 -3
  35. package/dist/client/assets/Virtualizer-ClYwoP30.js +2 -0
  36. package/dist/client/assets/{canvasStateStore-5DH2Z-PG.js → canvasStateStore-CdQxd2aO.js} +2 -2
  37. package/dist/client/assets/cmmdAuthRedirect-Bp1uQaQ9.js +2 -0
  38. package/dist/client/assets/index-BE83u7Db.css +1 -0
  39. package/dist/client/assets/index-CZhTqk2p.js +153 -0
  40. package/dist/client/assets/{popover-Dxp_1Sz0.js → popover-CUSlb3eK.js} +2 -2
  41. package/dist/client/assets/src-BL-mOkT1.js +3 -0
  42. package/dist/client/assets/{toggle-B-GE6jq_.js → toggle-BREV66nT.js} +2 -2
  43. package/dist/client/index.html +11 -11
  44. package/dist/forge-build.json +1 -1
  45. package/dist/node_modules/@ff-labs/fff-bin-linux-x64-gnu/libfff_c.so +0 -0
  46. package/dist/node_modules/@ff-labs/fff-bin-linux-x64-gnu/package.json +27 -0
  47. package/dist/node_modules/@ff-labs/fff-node/.bun-tag-689ffe3747e13d19 +0 -0
  48. package/dist/node_modules/@ff-labs/fff-node/README.md +126 -0
  49. package/dist/node_modules/@ff-labs/fff-node/dist/src/binary.d.ts +22 -0
  50. package/dist/node_modules/@ff-labs/fff-node/dist/src/binary.js +144 -0
  51. package/dist/node_modules/@ff-labs/fff-node/dist/src/fff-api.d.ts +581 -0
  52. package/dist/node_modules/@ff-labs/fff-node/dist/src/fff-api.js +24 -0
  53. package/dist/node_modules/@ff-labs/fff-node/dist/src/ffi.d.ts +137 -0
  54. package/dist/node_modules/@ff-labs/fff-node/dist/src/ffi.js +1191 -0
  55. package/dist/node_modules/@ff-labs/fff-node/dist/src/finder.d.ts +353 -0
  56. package/dist/node_modules/@ff-labs/fff-node/dist/src/finder.js +488 -0
  57. package/dist/node_modules/@ff-labs/fff-node/dist/src/index.d.ts +47 -0
  58. package/dist/node_modules/@ff-labs/fff-node/dist/src/index.js +47 -0
  59. package/dist/node_modules/@ff-labs/fff-node/dist/src/platform.d.ts +27 -0
  60. package/dist/node_modules/@ff-labs/fff-node/dist/src/platform.js +120 -0
  61. package/dist/node_modules/@ff-labs/fff-node/package.json +76 -0
  62. package/dist/node_modules/@yuuang/ffi-rs-linux-x64-gnu/README.md +794 -0
  63. package/dist/node_modules/@yuuang/ffi-rs-linux-x64-gnu/ffi-rs.linux-x64-gnu.node +0 -0
  64. package/dist/node_modules/@yuuang/ffi-rs-linux-x64-gnu/package.json +21 -0
  65. package/dist/node_modules/ffi-rs/LICENSE +21 -0
  66. package/dist/node_modules/ffi-rs/README.md +794 -0
  67. package/dist/node_modules/ffi-rs/index.d.ts +222 -0
  68. package/dist/node_modules/ffi-rs/index.js +380 -0
  69. package/dist/node_modules/ffi-rs/package.json +76 -0
  70. package/dist/{open-FIgTDosf.mjs → open-D8mGyWmt.mjs} +3 -3
  71. package/package.json +2 -1
  72. package/dist/client/assets/DiffPanel-ixzJ8GwW.js +0 -64
  73. package/dist/client/assets/DiffPanelShell-Dz5Wvcvi.js +0 -2532
  74. package/dist/client/assets/cmmdAuthRedirect-D68LO-sw.js +0 -2
  75. package/dist/client/assets/diffTargetResolution-WqxwJEax.js +0 -2
  76. package/dist/client/assets/index-DivaIsZ4.css +0 -1
  77. package/dist/client/assets/index-UXWCtM6c.js +0 -153
  78. package/dist/client/assets/src-n5cTLVWV.js +0 -3
@@ -1,2 +0,0 @@
1
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{Wa as n}from"./Stream-mUTFnSY9.js";import{a as r,c as i,l as a,n as o,o as s,r as c,s as l}from"./atomRegistry-C1yW8tyM.js";import{En as ee,pt as te}from"./src-n5cTLVWV.js";var u=t(n(),1),d=new WeakMap;function ne(e,t){let n=d.get(e);n===void 0&&(n=new WeakMap,d.set(e,n));let i=n.get(t);if(i!==void 0)return i;let a={subscribe(n){return e.subscribe(t,n)},snapshot(){return e.get(t)},getServerSnapshot(){return r(t,e)}};return n.set(t,a),a}function f(e,t){let n=ne(e,t);return u.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}var p=(e,t)=>{let n=u.useContext(c);return t?f(n,u.useMemo(()=>i(e,t),[e,t])):f(n,e)},re=(e,t,n)=>{let r=u.useContext(c);u.useEffect(()=>r.subscribe(e,t,n),[r,e,t,n?.immediate])},ie=new Set([`localhost`,`127.0.0.1`,`::1`]);function ae(e){return e.trim().toLowerCase().replace(/^\[(.*)\]$/,`$1`)}function m(e){let t=ae(e);return ie.has(t)||t.endsWith(`.localhost`)}function oe(e){try{return m(new URL(e).hostname)}catch{return!1}}function se(e){let t=e.split(`.`).map(e=>Number(e));if(t.length!==4||t.some(e=>!Number.isInteger(e)||e<0||e>255))return!1;let[n,r]=t;return n===10||n===172&&r>=16&&r<=31||n===192&&r===168}var ce=`/api/dev/local-web/bootstrap`,le=3e3,h=null,g=null,_=null;function v(){return _!==null&&Date.now()-_<le}function ue(e){try{return ee(te)(e)}catch{return null}}function de(){return!1}function y(){return typeof window>`u`?null:window.desktopBridge?.getLocalEnvironmentBootstrap()??h}async function fe(){if(!de()||window.desktopBridge)return h=null,y();let e;try{e=await fetch(new URL(ce,window.location.origin),{credentials:`include`})}catch{return h=null,_=Date.now(),null}if(e.status===204||e.status===404||!e.ok)return h=null,_=Date.now(),null;let t=ue(await e.json().catch(()=>null));return h=t,_=null,t}async function pe(){let e=typeof window>`u`?null:window.desktopBridge?.getLocalEnvironmentBootstrap();return e?(h=null,e):h||(v()?null:g||(g=fe().finally(()=>{g=null}),g))}function b(){return y()}var me=`forge_backend_mode`,he=`forge_apex_url`;function x(){return b()}function S(e){return new URL(e,window.location.origin).toString()}function ge(e,t){let n=new URL(e);return`${n.pathname.endsWith(`/`)?n.pathname.slice(0,-1):n.pathname}${t.startsWith(`/`)?t:`/${t}`}`}function C(e){let t;try{t=new URL(window.location.href)}catch{return e}let n=new URL(e);return(t.protocol===`http:`||t.protocol===`https:`)&&t.port!==``&&n.port!==``&&t.origin!==n.origin&&m(t.hostname)&&m(n.hostname),e}function _e(){return null}function ve(){let e=S(window.location.origin),t=new URL(e);if(t.protocol===`http:`)t.protocol=`ws:`;else if(t.protocol===`https:`)t.protocol=`wss:`;else throw Error(`Unsupported HTTP base URL protocol: ${t.protocol}`);return t.pathname=`/ws`,{source:`window-origin`,target:{httpBaseUrl:e,wsBaseUrl:t.toString()}}}function ye(){try{if(localStorage.getItem(me)!==`apex`)return null;let e=localStorage.getItem(he)?.trim()??void 0??``;if(!e)return null;let t=S(e),n=new URL(t);return n.protocol=t.startsWith(`https:`)?`wss:`:`ws:`,{source:`configured`,target:{httpBaseUrl:t,wsBaseUrl:n.toString()}}}catch{return null}}function be(){let e=x();return!e||e.primaryMode!==`cloud`||!e.bearerToken?null:{source:`paired-bearer`,target:{httpBaseUrl:S(e.httpBaseUrl),wsBaseUrl:S(e.wsBaseUrl)},bearerToken:e.bearerToken}}function xe(){let e=x();if(!e||e.primaryMode===`cloud`||!e.httpBaseUrl&&!e.wsBaseUrl)return null;if(!e.httpBaseUrl||!e.wsBaseUrl)throw Error(`Desktop bootstrap must provide both httpBaseUrl and wsBaseUrl for the local environment.`);return{source:`desktop-managed`,target:{httpBaseUrl:S(e.httpBaseUrl),wsBaseUrl:S(e.wsBaseUrl)},...e.bearerToken?{bearerToken:e.bearerToken}:{}}}function w(e,t){let n=T();if(!n)throw Error(`Unable to resolve the primary environment HTTP base URL.`);let r=new URL(C(n.target.httpBaseUrl));return r.pathname=ge(r.toString(),e),t&&(r.search=new URLSearchParams(t).toString()),r.toString()}function T(){return be()??ye()??xe()??_e()??ve()}function E(e={}){let t=T(),n=t?.bearerToken;return!t||!n||!D(t)?e:{...e,credentials:`omit`,headers:{...e.headers,Authorization:`Bearer ${n}`}}}function D(e){if(e.source!==`desktop-managed`||typeof window>`u`)return!0;try{return new URL(C(e.target.httpBaseUrl)).origin!==window.location.origin}catch{return!0}}async function O(e,t){return await e.text()||t}async function k(){let e=w(`/api/auth/logout`),t=await fetch(e,E({credentials:`include`,method:`POST`}));if(!t.ok)throw Error(await O(t,`Failed to logout authenticated session (${t.status}).`))}var A=1e3,j=2,M=64e3,Se=Object.freeze({attemptCount:0,closeCode:null,closeReason:null,connectedAt:null,disconnectedAt:null,hasConnected:!1,lastError:null,lastErrorAt:null,nextRetryAt:null,online:typeof navigator>`u`||navigator.onLine!==!1,phase:`idle`,reconnectAttemptCount:0,reconnectMaxAttempts:11,reconnectPhase:`idle`,socketUrl:null}),N=l(Se).pipe(s,a(`ws-connection-status`)),P=Object.freeze({status:`ok`}),F=l(P).pipe(s,a(`cloud-auth-failure`));function Ce(e){o.get(F).status!==`expired`&&o.set(F,{status:`expired`,detectedAt:new Date().toISOString(),source:e})}function I(){o.set(F,P)}function we(){return o.get(F)}function L(){return new Date().toISOString()}function R(e){let t=e(z());return o.set(N,t),t}function z(){return o.get(N)}function Te(e){return e.phase===`connected`||e.hasConnected&&e.disconnectedAt===null&&e.phase===`connecting`?`connected`:!e.online&&(e.disconnectedAt!==null||e.phase===`disconnected`)?`offline`:e.hasConnected?`reconnecting`:e.phase===`disconnected`?`error`:`connecting`}function Ee(e){return R(t=>({...t,attemptCount:t.attemptCount+1,nextRetryAt:null,phase:`connecting`,reconnectAttemptCount:t.phase===`connected`?1:t.reconnectAttemptCount+1,reconnectPhase:`attempting`,socketUrl:e}))}function De(){return R(e=>({...e,closeCode:null,closeReason:null,connectedAt:L(),disconnectedAt:null,hasConnected:!0,nextRetryAt:null,phase:`connected`,reconnectAttemptCount:0,reconnectPhase:`idle`}))}function Oe(e){return R(t=>V(t,{lastError:e?.trim()?e:t.lastError,lastErrorAt:L()}))}function ke(e){return R(t=>t.hasConnected&&Ae(e)?t:V(t,{closeCode:e?.code??t.closeCode,closeReason:e?.reason?.trim()?e.reason:t.closeReason}))}function Ae(e){return(e?.reason?.trim()??``).length===0&&(e?.code===1e3||e?.code===1001)}function je(e){return R(t=>({...t,online:e}))}function Me(){return R(e=>({...e,nextRetryAt:null,reconnectAttemptCount:0,reconnectPhase:`idle`}))}function Ne(){return p(N)}function B(e){return!Number.isInteger(e)||e<0||e>=10?null:Math.min(Math.round(A*j**e),M)}function V(e,t){let n=e.disconnectedAt??L(),r=e.nextRetryAt!==null||e.reconnectPhase===`exhausted`?null:B(Math.max(0,e.reconnectAttemptCount-1));return{...e,...t,disconnectedAt:n,nextRetryAt:r===null?e.nextRetryAt:new Date(Date.now()+r).toISOString(),phase:`disconnected`,reconnectPhase:e.reconnectPhase===`waiting`||e.reconnectPhase===`exhausted`?e.reconnectPhase:r===null?`exhausted`:`waiting`}}var H=class extends Error{constructor(e=`Session has expired. Please re-login.`){super(e),this.name=`ForgeAuthExpiredError`}};function Pe(e){return e instanceof H||e instanceof Error&&e.name===`ForgeAuthExpiredError`}var U=`forge_auth_expired_reason`,Fe=`session-expired`,W=`reason`,G=`cmmd-auth-expired`,K={"session-expired":`Session has expired. Please re-login.`,"desktop-session-required":`Forge Desktop needs a CMMD sign-in before this device can host or control runtimes.`,"desktop-principal-mismatch":`Forge Desktop and the local Forge session are signed in to different CMMD accounts. Sign in again to reconcile them.`,"desktop-state-unavailable":`Forge Desktop could not verify its native CMMD session. Restart Forge or sign in again.`};function Ie(e){if(!(e===null||!(e in K)))return K[e]}function q(e){if(!(typeof window>`u`))try{window.sessionStorage.setItem(U,e)}catch{}}function J(){if(typeof window>`u`)return null;try{return new URL(window.location.href).searchParams.getAll(W).includes(G)?Fe:null}catch{return null}}function Y(){if(!(typeof window>`u`))try{let e=new URL(window.location.href),t=e.searchParams.getAll(W);if(!t.includes(G))return;e.searchParams.delete(W);for(let n of t)n!==G&&e.searchParams.append(W,n);window.history.replaceState({},typeof document>`u`?``:document.title,e.toString())}catch{}}function X(){let e=J();return e!==null&&Y(),e}function Le(){if(!(typeof window>`u`)){try{window.sessionStorage.removeItem(U)}catch{}Y()}}function Re(){if(typeof window>`u`)return null;try{let e=window.sessionStorage.getItem(U);return Y(),e}catch{return Y(),null}}function ze(){if(typeof window>`u`)return null;try{let e=window.sessionStorage.getItem(U);return e===null?X():(window.sessionStorage.removeItem(U),Y(),e)}catch{return X()}}async function Z(){await k().catch(()=>void 0),I(),q(`session-expired`);let e=new URL(w(`/login`));window.location.assign(e.toString())}var Be=e({handleCmmdAuthExpired:()=>$}),Q=null;async function $(e){if((e===void 0||e===401)&&!(typeof window>`u`))return Q||(Q=Z().finally(()=>{Q=null}),Q)}export{b as A,je as C,E as D,k as E,re as F,p as I,m as M,oe as N,T as O,se as P,Me as S,Ne as T,B as _,Le as a,Oe as b,Z as c,ze as d,I as f,Te as g,z as h,H as i,pe as j,w as k,Ie as l,we as m,$ as n,Pe as o,F as p,U as r,Re as s,Be as t,q as u,Ee as v,Ce as w,De as x,ke as y};
2
- //# sourceMappingURL=cmmdAuthRedirect-D68LO-sw.js.map
@@ -1,2 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Ha as t,Ua as n,Wa as r}from"./Stream-mUTFnSY9.js";import{Gr as i,Gt as a,Ln as o,Xt as s,Zt as c,ar as l,kc as u,qr as d}from"./DiffPanelShell-Dz5Wvcvi.js";import{$ as f,E as p,Et as m,M as h,O as g,Q as _,Tn as v,_ as y,a as b,c as x,d as S,dn as C,f as w,fn as T,gn as E,j as D,k as O,l as k,m as A,n as j,o as M,p as N,pn as P,s as F,x as I,y as L}from"./CompositeItem-CZk3X-ud.js";import{At as R}from"./src-n5cTLVWV.js";import{n as z,t as B}from"./toggle-B-GE6jq_.js";function ee(e){return u({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}var te=E(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),ne=E(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),V=e(r(),1),H=t(),U=n();function re(e){let t=(0,H.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`horizontal`:i,o;t[4]===n?o=t[5]:(o=v(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,U.jsx)(d,{className:o,"data-slot":`separator`,orientation:a,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function W(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function ie(e,t){return e==null||t==null?e===t:e.top===t.top&&e.bottom===t.bottom}var G=1e3,ae=G*4,oe=[0,1e-6,.99999,1],se={overscrollSize:G,intersectionObserverMargin:ae,resizeDebugging:!1},K=0,ce=-1,le=class e{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++ce}`;config;type=`simple`;intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;reconcileQueue=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(e){this.config={...se,...e}}setup(t,n){if(this.root==null){this.root=t,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:oe,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:e.__lastScrollPosition}),c(this.computeRenderRangeAndEmit)):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)};for(let[e,t]of this.connectQueue.entries())this.connect(e,t);this.connectQueue.clear(),this.markDOMDirty(),c(this.computeRenderRangeAndEmit)}}instanceChanged(e,t){this.instancesChanged.add(e),t&&this.markDOMDirty(),c(this.computeRenderRangeAndEmit)}requestHeightReconcile(e){this.reconcileQueue.add(e),c(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=a({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}getRoot(){return this.root}isInstanceVisible(e,t){let n=this.getScrollTop(),r=this.getHeight(),i=this.config.intersectionObserverMargin,a=n-i,o=n+r+i;return!(e<a-t||e>o)}handleContainerResize=e=>{if(this.root==null)return;let t=!1;for(let n of e){let e=n.borderBoxSize[0].blockSize;this.root instanceof Document?e!==this.scrollHeight&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log(`Virtualizer: content size change`,this.__id,{sizeChange:e-K,newSize:e}),K=e)):n.target===this.root?e!==this.height&&(this.heightDirty=!0,t=!0):n.target===this.contentContainer&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log(`Virtualizer: scroller size change`,this.__id,{sizeChange:e-K,newSize:e}),K=e))}t&&c(this.computeRenderRangeAndEmit)};setupWindow(){if(this.root==null||!(this.root instanceof Document))throw Error(`Virtualizer.setupWindow: Invalid setup method`);window.addEventListener(`scroll`,this.handleWindowScroll,{passive:!0}),window.addEventListener(`resize`,this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(e){if(this.root==null||this.root instanceof Document)throw Error(`Virtualizer.setupElement: Invalid setup method`);this.root.addEventListener(`scroll`,this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),e??=this.root.firstElementChild??void 0,e instanceof HTMLElement&&(this.contentContainer=e,this.resizeObserver?.observe(e))}cleanUp(){s(this.computeRenderRangeAndEmit),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleElementScroll),window.removeEventListener(`scroll`,this.handleWindowScroll),window.removeEventListener(`resize`,this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.reconcileQueue.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.scrollHeightDirty=!0}getOffsetInScrollContainer(e){return this.getScrollTop()+q(e,this.getScrollContainerElement())}connect(e,t){if(this.observers.has(e))throw Error(`Virtualizer.connect: instance is already connected...`);return this.intersectionObserver==null?this.connectQueue.set(e,t):(this.intersectionObserver.observe(e),this.observers.set(e,t),this.instancesChanged.add(t),this.markDOMDirty(),c(this.computeRenderRangeAndEmit)),()=>this.disconnect(e)}disconnect(e){let t=this.observers.get(e);this.connectQueue.delete(e),t!=null&&(this.intersectionObserver?.unobserve(e),this.observers.delete(e),this.instancesChanged.delete(t),this.reconcileQueue.delete(t),this.visibleInstances.delete(e)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),c(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{e.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,c(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{e.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,c(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{e.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,c(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(e.__STOP)return;let t=this.heightDirty||this.scrollHeightDirty,n=this.instancesChanged.size>0;if(this.instancesChanged.size===0){let e=a({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!t&&ie(this.windowSpecs,e)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.reconcileQueue.size===0)return;this.windowSpecs=e}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;let r=this.getScrollAnchor(this.height),i=new Set;for(let e of t?this.observers.values():this.visibleInstances.values())e.onRender(t)&&i.add(e);for(let e of this.instancesChanged)i.has(e)||e.onRender(t)&&i.add(e);this.scrollFix(r);for(let e of i)this.reconcileQueue.delete(e),e.reconcileHeights();for(let e of this.reconcileQueue)e.reconcileHeights()&&(n=!0);this.reconcileQueue.clear(),n||=this.instancesChanged.size>0,n&&this.markDOMDirty(),(n||t)&&c(this.computeRenderRangeAndEmit),i.clear(),this.instancesChanged.clear()};scrollFix(e){if(e==null)return;let t=this.getScrollContainerElement(),{lineIndex:n,lineOffset:r,fileElement:i,fileOffset:a,fileTypeOffset:o}=e;if(n!=null&&r!=null){let e=i.shadowRoot?.querySelector(`[data-line][data-line-index="${n}"]`);if(e instanceof HTMLElement){let n=q(e,t);if(n!==r){let e=n-r;this.applyScrollFix(e)}return}}let s=q(i,t);if(o===`top`)s!==a&&this.applyScrollFix(s-a);else{let e=s+i.getBoundingClientRect().height;e!==a&&this.applyScrollFix(e-a)}}applyScrollFix(e){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+e,behavior:`instant`}):this.root.scrollTo({top:this.root.scrollTop+e,behavior:`instant`}),this.markDOMDirty()}getScrollAnchor(e){let t=this.getScrollContainerElement(),n;for(let[r]of this.visibleInstances.entries()){let i=q(r,t),a=i+r.offsetHeight,o,s;a<=0?(o=a,s=`bottom`):(o=i,s=`top`);let c,l;if(a>0&&i<e)for(let e of r.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`)??[]){if(!(e instanceof HTMLElement))continue;let n=e.dataset.lineIndex;if(n==null)continue;let r=q(e,t);if(!(r<0)){c=n,l=r;break}}if(n?.lineOffset!=null&&l==null)continue;let u=!1;(n==null||l!=null&&(n.lineOffset==null||l<n.lineOffset)||l==null&&n.lineOffset==null&&(o>=0&&(n.fileOffset<0||o<n.fileOffset)||o<0&&n.fileOffset<0&&o>n.fileOffset))&&(u=!0),u&&(n={fileElement:r,fileTypeOffset:s,fileOffset:o,lineIndex:c,lineOffset:l})}return n}handleIntersectionChange=e=>{this.scrollDirty=!0;for(let{target:t,isIntersecting:n}of e){if(!(t instanceof HTMLElement))throw Error(`Virtualizer.handleIntersectionChange: target not an HTMLElement`);let e=this.observers.get(t);e!=null&&(n&&!this.visibleInstances.has(t)?(e.setVisibility(!0),this.visibleInstances.set(t,e),this.visibleInstancesDirty=!0):!n&&this.visibleInstances.has(t)&&(e.setVisibility(!1),this.visibleInstances.delete(t),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&c(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return e=this.clampScrollTop(e),this.scrollTop=e,e}scrollTo({top:e,behavior:t=`auto`}){let{root:n}=this;if(n==null)return;let r=this.clampScrollTop(e);n instanceof Document?window.scrollTo({top:r,behavior:t}):n.scrollTo({top:r,behavior:t}),this.scrollDirty=!0,c(this.computeRenderRangeAndEmit)}clampScrollTop(e){return Math.max(0,Math.min(e,this.getScrollHeight()-this.getHeight()))}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}};function q(e,t){let n=e.getBoundingClientRect(),r=t?.getBoundingClientRect().top??0;return n.top-r}var ue=o.filter(e=>e!==`file`&&e!==`pull-request`);function J(e){return e===`1`||e===1||e===!0}function de(e){return e===`0`||e===0||e===!1}function Y(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function X(e){return typeof e==`string`&&ue.includes(e)}function Z(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function fe(e){if(Array.isArray(e))return Z(e.filter(X));if(typeof e!=`string`)return[];let t=e.trim();if(t.startsWith(`[`)&&t.endsWith(`]`))try{let e=JSON.parse(t);return Array.isArray(e)?Z(e.filter(X)):[]}catch{return[]}return Z(t.split(`,`).map(e=>e.trim()).filter(X))}function pe(e){if(J(e.canvas))return`canvas`;if(J(e.preview))return`preview`;if(J(e.diff))return`diff`}function me(e,t){let n=fe(e.rightPanelTabs),r=Z(t&&!n.includes(t)?[...n,t]:n),i=Y(e.rightPanelTabs)!==void 0,a=J(e.rightPanelOpen),o=de(e.rightPanelOpen);return{rightPanelOpen:a?!0:!o&&i,rightPanelTabs:r,stated:a||o||i,hasExplicitTabs:i}}function he(e,t){if(t===`preview`){let t=Y(e.previewTabId);return t?{previewTabId:t}:{}}if(t!==`diff`)return{};let n=Y(e.diffTurnId);if(!n)return{};let r=R.make(n),i=Y(e.diffFilePath);return i?{diffTurnId:r,diffFilePath:i}:{diffTurnId:r}}function ge(e){let t=(X(e.rightPanel)?e.rightPanel:void 0)??pe(e),n=me(e,t);return{...n.stated?{rightPanelOpen:n.rightPanelOpen}:{},...t?{rightPanel:t}:{},...n.hasExplicitTabs&&n.rightPanelTabs.length>0?{rightPanelTabs:n.rightPanelTabs}:{},...he(e,t)}}function _e(e){let t=(0,H.c)(6),n;bb0:{if(!e){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0],n=e;break bb0}n=e.turnDiffSummaries}let r=n,i,a;t[1]===r?a=t[2]:(a=l(r),t[1]=r,t[2]=a),i=a;let o=i,s;return t[3]!==o||t[4]!==r?(s={turnDiffSummaries:r,inferredCheckpointTurnCountByTurnId:o},t[3]=o,t[4]=r,t[5]=s):s=t[5],s}var ve=[];function ye(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:v=ve}=e,[y,S]=V.useState(0),T=r!=null,E=V.useRef(null),A=f(E,c),j=V.useRef([]),P=V.useRef(!1),I=o??y,L=_((e,t=!1)=>{if((s??S)(e),t){let t=j.current[e];N(E.current,t,a,n)}}),R=_(e=>{if(e.size===0||P.current)return;P.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)L(i);else if(h(t,I,d)){let e=p(t,{disabledIndices:d});D(t,e)||L(e)}N(E.current,r,a,n)});C(()=>{if(d==null||o!=null||!P.current)return;let e=j.current;if(h(e,I,d)){let t=p(e,{disabledIndices:d});D(e,t)||L(t)}},[d,o,I,j,L]);let z=_((e,t,n)=>i?i(e,t,n,j):n),B=_(e=>{let o=e.key===`Home`||e.key===`End`;if(!k.has(e.key)||!l&&o||be(e,v)||!E.current)return;let s=a===`rtl`,c=s?M:F,f=s?F:M,h=n===`vertical`?b:c,_=n===`vertical`?x:f,y=m(e.nativeEvent);if(y!=null&&w(y)&&!W(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==h&&t>0)return}let S=I,C=O(j,d),A=g(j,d);r!=null&&(S=r({disabledIndices:d,elementsRef:j,event:e,highlightedIndex:I,loopFocus:t,maxIndex:A,minIndex:C,onLoop:z,orientation:n,rtl:s}));let N=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,P=n!==`vertical`&&e.key===f||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?S=C:e.key===`End`&&(S=A)),S===I&&(N||P)&&(t&&S===A&&N?(S=C,i&&(S=i(e,I,S,j))):t&&S===C&&P?(S=A,i&&(S=i(e,I,S,j))):S=p(j.current,{startingIndex:S,decrement:P,disabledIndices:d})),S!==I&&!D(j.current,S)&&(u&&e.stopPropagation(),(T||o||N||P)&&e.preventDefault(),L(S,!0),queueMicrotask(()=>{j.current[S]?.focus()}))});return{props:{ref:A,onFocus(e){let t=E.current,n=m(e.nativeEvent);!t||n==null||!w(n)||n.setSelectionRange(0,n.value.length)},onKeyDown:B},highlightedIndex:I,onHighlightedIndexChange:L,elementsRef:j,onMapChange:R,relayKeyboardEvent:B}}function be(e,t){for(let n of S)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function xe(e){let{render:t,className:n,style:r,refs:a=T,props:o=T,state:s=P,stateAttributesMapping:c,highlightedIndex:l,onHighlightedIndexChange:u,orientation:d,grid:f,loopFocus:p,onLoop:m,enableHomeAndEndKeys:h,onMapChange:g,stopEventPropagation:_=!0,rootRef:v,disabledIndices:b,modifierKeys:x,highlightItemOnHover:S=!1,tag:C=`div`,...w}=e,{props:E,highlightedIndex:D,onHighlightedIndexChange:O,elementsRef:k,onMapChange:A,relayKeyboardEvent:j}=ye({grid:f,loopFocus:p,onLoop:m,orientation:d,highlightedIndex:l,onHighlightedIndexChange:u,rootRef:v,stopEventPropagation:_,enableHomeAndEndKeys:h,direction:L(),disabledIndices:b,modifierKeys:x}),M=I(C,e,{state:s,ref:a,props:[E,...o,w],stateAttributesMapping:c}),N=V.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:O,highlightItemOnHover:S,relayKeyboardEvent:j}),[D,O,S,j]);return(0,U.jsx)(y.Provider,{value:N,children:(0,U.jsx)(i,{elementsRef:k,onMapChange:e=>{g?.(e),A(e)},children:M})})}var Se=V.createContext(void 0);function Ce(){return V.useContext(Se)}var we=V.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:o=`horizontal`,multiple:s=!1,value:c,className:l,render:u,style:d,...f}=e,p=j(!0),m=Ce(),h=c!==void 0||n!==void 0,g=(p?.disabled??!1)||(m?.disabled??!1)||r,[v,y]=A({controlled:c,default:c===void 0?n??T:void 0,name:`ToggleGroup`,state:`value`}),b=_((e,t,n)=>{let r;s?(r=v.slice(),t?r.push(e):r.splice(v.indexOf(e),1)):r=t?[e]:[],a?.(r,n),!n.isCanceled&&y(r)}),x={disabled:g,multiple:s,orientation:o},S=V.useMemo(()=>({disabled:g,setGroupValue:b,value:v,isValueInitialized:h}),[g,b,v,h]),C={role:`group`},w=I(`div`,e,{enabled:!!p,state:x,ref:t,props:[C,f]});return(0,U.jsx)(z.Provider,{value:S,children:p?w:(0,U.jsx)(xe,{render:u,className:l,style:d,state:x,refs:[t],props:[C,f],loopFocus:i,enableHomeAndEndKeys:!0,orientation:o})})}),Q=V.createContext({size:`default`,variant:`default`});function Te({className:e,variant:t=`default`,size:n=t===`segmented`?`segmented`:`default`,orientation:r=`horizontal`,children:i,...a}){let o=V.useMemo(()=>({size:n,variant:t}),[n,t]);return(0,U.jsx)(we,{className:v(`flex w-fit *:focus-visible:z-10 dark:*:[[data-slot=separator]:has(+[data-slot=toggle]:hover)]:before:bg-input/64 dark:*:[[data-slot=separator]:has(+[data-slot=toggle][data-pressed])]:before:bg-input dark:*:[[data-slot=toggle]:hover+[data-slot=separator]]:before:bg-input/64 dark:*:[[data-slot=toggle][data-pressed]+[data-slot=separator]]:before:bg-input`,r===`horizontal`?`*:pointer-coarse:after:min-w-auto`:`*:pointer-coarse:after:min-h-auto`,t===`segmented`?`gap-0.5 rounded-lg bg-input/40 p-0.5`:t==="default"?`gap-0.5`:r===`horizontal`?`*:not-first:not-data-[slot=separator]:before:-start-[0.5px] *:not-last:not-data-[slot=separator]:before:-end-[0.5px] *:not-first:rounded-s-none *:not-last:rounded-e-none *:not-first:border-s-0 *:not-last:border-e-0 *:not-first:before:rounded-s-none *:not-last:before:rounded-e-none`:`*:not-first:not-data-[slot=separator]:before:-top-[0.5px] *:not-last:not-data-[slot=separator]:before:-bottom-[0.5px] flex-col *:not-first:rounded-t-none *:not-last:rounded-b-none *:not-first:border-t-0 *:not-last:border-b-0 *:not-first:before:rounded-t-none *:not-last:before:rounded-b-none *:data-[slot=toggle]:not-last:before:hidden dark:*:last:before:hidden dark:*:first:before:block`,e),"data-size":n,"data-slot":`toggle-group`,"data-variant":t,orientation:r,...a,children:(0,U.jsx)(Q.Provider,{value:o,children:i})})}function Ee(e){let t=(0,H.c)(12),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,variant:o,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=V.useContext(Q),c=o??s.variant,l=a??s.size,u;return t[6]!==n||t[7]!==r||t[8]!==i||t[9]!==l||t[10]!==c?(u=(0,U.jsx)(B,{className:r,"data-size":l,"data-variant":c,size:l,variant:c,...i,children:n}),t[6]=n,t[7]=r,t[8]=i,t[9]=l,t[10]=c,t[11]=u):u=t[11],u}function De(e,t){return typeof window>`u`&&t!=null?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t}}),e]}):(0,U.jsx)(U.Fragment,{children:e})}var $=(0,V.createContext)(void 0);function Oe({children:e,config:t,className:n,style:r,contentClassName:i,contentStyle:a}){let[o]=(0,V.useState)(()=>typeof window<`u`?new le(t):void 0),s=(0,V.useCallback)(e=>{e==null?o?.cleanUp():o?.setup(e)},[o]);return(0,U.jsx)($.Provider,{value:o,children:(0,U.jsx)(`div`,{className:n,style:r,ref:s,children:(0,U.jsx)(`div`,{className:i,style:a,children:e})})})}function ke(){return(0,V.useContext)($)}function Ae(e){return e.threadWorktreePath??e.projectCwd??void 0}function je(e){return e?.isRepo??!0}export{De as a,_e as c,re as d,ne as f,ke as i,ge as l,ee as m,je as n,Ee as o,te as p,Oe as r,Te as s,Ae as t,W as u};
2
- //# sourceMappingURL=diffTargetResolution-WqxwJEax.js.map