@puddle-code/cli 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -13
- package/README.md +33 -23
- package/dist/host-control.mjs +2 -2
- package/dist/index.js +501 -312
- package/dist/install-cli.sh +167 -0
- package/dist/install.sh +7 -10
- package/dist/public/assets/{App-C2IQg_6K.js → App-CzuHShdO.js} +2 -2
- package/dist/public/assets/{Dashboard-DUFOyL1_.js → Dashboard-B5qWtmwb.js} +1 -1
- package/dist/public/assets/{EditorTabClose-C3wpMhYL.js → EditorTabClose-uxuNJdgx.js} +1 -1
- package/dist/public/assets/{FindWidget-Dt1gfA70.js → FindWidget-lUpiYZJG.js} +1 -1
- package/dist/public/assets/{LazyTerminal-B9HzmRBx.js → LazyTerminal-BYbPpGEI.js} +2 -2
- package/dist/public/assets/{ModelRefcount-CxzQ3w05.js → ModelRefcount-N0Xh_Y-_.js} +1 -1
- package/dist/public/assets/{NewProjectDialog-Cq_1po_h.js → NewProjectDialog-D3bNK3u_.js} +1 -1
- package/dist/public/assets/{PaneEditorBody-zS2BI5Fn.js → PaneEditorBody-DrSiMzrp.js} +4 -4
- package/dist/public/assets/{PdfViewer-ckjWE_TR.js → PdfViewer-BhqrWfmb.js} +2 -2
- package/dist/public/assets/{SettingsDialog-Cb2fdV1D.js → SettingsDialog-CamnF91I.js} +1 -1
- package/dist/public/assets/{Terminal-BqbjwcMi.js → Terminal-Ds17sCF_.js} +1 -1
- package/dist/public/assets/{Workspace-BVDgHkML.js → Workspace-BmtA0kYQ.js} +4 -4
- package/dist/public/assets/{abnfDiagram-VCTEODGH-JZdwYDGF.js → abnfDiagram-VCTEODGH-B4ZtDUXi.js} +1 -1
- package/dist/public/assets/architecture-7GRP2DOG-D0iH6Lxl.js +1 -0
- package/dist/public/assets/{architectureDiagram-5GKGNRK7-CYoRlLvs.js → architectureDiagram-5GKGNRK7-Cyzuyzwl.js} +1 -1
- package/dist/public/assets/{blockDiagram-I7D4REHJ-DjPQ4-5b.js → blockDiagram-I7D4REHJ-BN00JnNl.js} +1 -1
- package/dist/public/assets/{buffer-store-GUPJI8Wy.js → buffer-store--4yU4YqM.js} +2 -2
- package/dist/public/assets/{button-CKes3Qwq.js → button-DehrlYw7.js} +1 -1
- package/dist/public/assets/{c4Diagram-7LVT6UL2-BvwPGpk0.js → c4Diagram-7LVT6UL2-DpUKodBy.js} +1 -1
- package/dist/public/assets/channel-DT2izo70.js +1 -0
- package/dist/public/assets/{chunk-2E4U76K2-DcsuTdxj.js → chunk-2E4U76K2-BksaqXZU.js} +1 -1
- package/dist/public/assets/{chunk-4HAMMTFA-BGEaVxkg.js → chunk-4HAMMTFA-D01k6w0A.js} +1 -1
- package/dist/public/assets/{chunk-75Z2AOVW-BOvbyaVc.js → chunk-75Z2AOVW-DJJjslyX.js} +1 -1
- package/dist/public/assets/{chunk-CLGD4ZFX-8fG7spZS.js → chunk-CLGD4ZFX-CX1B9i6H.js} +1 -1
- package/dist/public/assets/{chunk-DU6HZSFF-C94gDWXH.js → chunk-DU6HZSFF-Bx2ELCn-.js} +1 -1
- package/dist/public/assets/{chunk-F27PBJKO-CZD-A2b3.js → chunk-F27PBJKO-CCDhODx8.js} +1 -1
- package/dist/public/assets/{chunk-GMAD6QVW-C7KK3kiY.js → chunk-GMAD6QVW-C1evXXZi.js} +1 -1
- package/dist/public/assets/{chunk-GVQU2GXP-CDFKc0sW.js → chunk-GVQU2GXP-C1iphgLK.js} +1 -1
- package/dist/public/assets/{chunk-IMKFNOWR-BWQiE1Cp.js → chunk-IMKFNOWR-5wMdkmsQ.js} +1 -1
- package/dist/public/assets/{chunk-L3NEJ4N5-DqP3WOXV.js → chunk-L3NEJ4N5-B-aXfMpF.js} +1 -1
- package/dist/public/assets/{chunk-OSK3NFVY-BlmYDJRN.js → chunk-OSK3NFVY-Bm2MaFOc.js} +1 -1
- package/dist/public/assets/{chunk-P2QGCYS3-v7eQ-UQT.js → chunk-P2QGCYS3-H02JaAun.js} +1 -1
- package/dist/public/assets/{chunk-POPQ4Y6H-D_gxItFL.js → chunk-POPQ4Y6H-Dmm46Beg.js} +1 -1
- package/dist/public/assets/{chunk-PWAF6VOD-Ds90M0Eb.js → chunk-PWAF6VOD-CRt8Ete5.js} +1 -1
- package/dist/public/assets/{chunk-SHT3W25Y-B8oepiFw.js → chunk-SHT3W25Y-w4aNK54y.js} +1 -1
- package/dist/public/assets/{chunk-SVP7TREG-DjFxplBp.js → chunk-SVP7TREG-Cl3QpMDs.js} +1 -1
- package/dist/public/assets/{chunk-TICWLB2K-GEeYOgw4.js → chunk-TICWLB2K-BpBbot9h.js} +1 -1
- package/dist/public/assets/{chunk-TLUHSLCS-CEnN9wOB.js → chunk-TLUHSLCS-BOnIB6P6.js} +2 -2
- package/dist/public/assets/classDiagram-ZZMXUADV-BSshJUxJ.js +1 -0
- package/dist/public/assets/classDiagram-v2-VYDZK3BY-BSshJUxJ.js +1 -0
- package/dist/public/assets/{context-menu-CmSSwq3B.js → context-menu-BT88Vgia.js} +1 -1
- package/dist/public/assets/{cssMode-BEaREsxj.js → cssMode-gXT_K4po.js} +1 -1
- package/dist/public/assets/{cynefin-OW5HDTMX-C_sl2wZ-.js → cynefin-OW5HDTMX-CJakxaH8.js} +1 -1
- package/dist/public/assets/{cynefinDiagram-5FMLGOSQ-CPpFUPl3.js → cynefinDiagram-5FMLGOSQ-BJ_fVnC9.js} +1 -1
- package/dist/public/assets/{dagre-GXQ25YYZ-BryapOat.js → dagre-GXQ25YYZ-CjflcbuS.js} +1 -1
- package/dist/public/assets/{diagram-S7CK7UJ4-dIdCar-k.js → diagram-S7CK7UJ4-g8pKIWrY.js} +1 -1
- package/dist/public/assets/{diagram-UQ7AKVKN-EcAWwfjf.js → diagram-UQ7AKVKN-Dm5Pg4rY.js} +1 -1
- package/dist/public/assets/{diagram-VSXAHHWV-Dpl4gvkd.js → diagram-VSXAHHWV-DV5CVAXg.js} +1 -1
- package/dist/public/assets/{diagram-VX7I27RA-CJtemv3e.js → diagram-VX7I27RA-Be9qCk-h.js} +1 -1
- package/dist/public/assets/{diagram-Z3DM3KII-CPSnQEgD.js → diagram-Z3DM3KII-C3-xDrxs.js} +1 -1
- package/dist/public/assets/{dialog-Dam8WdmS.js → dialog-CAMTxigV.js} +1 -1
- package/dist/public/assets/{disclosure-Ex-68BU4.js → disclosure-DvM7-z38.js} +1 -1
- package/dist/public/assets/{dist-CxMnSex-.js → dist-3tmIo7Ja.js} +1 -1
- package/dist/public/assets/{dist-ByY6lqkl.js → dist-sLs_LTiG.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-PWID7BFC-uXsUC0ll.js → ebnfDiagram-PWID7BFC-Bq92n7k-.js} +1 -1
- package/dist/public/assets/{erDiagram-RLTQ6QDP-D5vJ6ZLT.js → erDiagram-RLTQ6QDP-C5I2bKnS.js} +1 -1
- package/dist/public/assets/eventmodeling-NTZA5JFV-CWxfOZuS.js +1 -0
- package/dist/public/assets/flowDiagram-HODETNUW-ddOOBXlS.js +1 -0
- package/dist/public/assets/{ganttDiagram-EL5Y4UJY-C6yTyvpx.js → ganttDiagram-EL5Y4UJY-qUaBgbbK.js} +1 -1
- package/dist/public/assets/{gitGraph-4MIJSDKK-C7nVbcZ1.js → gitGraph-4MIJSDKK-CUfoq3Sa.js} +1 -1
- package/dist/public/assets/{gitGraphDiagram-WWUBYQGX-DByBzF_5.js → gitGraphDiagram-WWUBYQGX-kj34Cchu.js} +1 -1
- package/dist/public/assets/{hotkeys-MSGaeY2m.js → hotkeys-DbIEec2f.js} +1 -1
- package/dist/public/assets/{htmlMode-DirKEo5j.js → htmlMode-C_uC6TDH.js} +1 -1
- package/dist/public/assets/{index-C1a3rCk2.js → index-BLx1AR0-.js} +2 -2
- package/dist/public/assets/index-uKreLbru.css +2 -0
- package/dist/public/assets/{info-A6RAGUB7-BCEGc_J2.js → info-A6RAGUB7-C938EzS-.js} +1 -1
- package/dist/public/assets/{infoDiagram-27XIBGKW-DDVeVGK9.js → infoDiagram-27XIBGKW-BoTxIjdn.js} +1 -1
- package/dist/public/assets/{input-i-kiT55N.js → input-DXYRmAFr.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-5VMMS53U-CTZvKcdI.js → ishikawaDiagram-5VMMS53U-j98L6THV.js} +1 -1
- package/dist/public/assets/{journeyDiagram-3NMN7TZE-CwFCP_8e.js → journeyDiagram-3NMN7TZE-DI-XCC2F.js} +1 -1
- package/dist/public/assets/{jsonMode-BLMO7T1W.js → jsonMode-BQ3590Ds.js} +1 -1
- package/dist/public/assets/{kanban-definition-UXKFOSKX-BCdCN6ov.js → kanban-definition-UXKFOSKX-BCTvFJTJ.js} +1 -1
- package/dist/public/assets/{line-e7ifLbsv.js → line-hE2Okp1W.js} +1 -1
- package/dist/public/assets/{media-refresh-store-d6Ihz_Yj.js → media-refresh-store-CxqhHl8x.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-DfmtQ5si.js → mermaid-parser.core-n0Wb6T7Q.js} +3 -3
- package/dist/public/assets/{mermaid.core-B0Ceo892.js → mermaid.core-Cb0bw4D8.js} +3 -3
- package/dist/public/assets/{mindmap-definition-YA3MSWOX-BKWZ0hGZ.js → mindmap-definition-YA3MSWOX-92LM1OuK.js} +1 -1
- package/dist/public/assets/{notification-permission-DThcB8rO.js → notification-permission-CG2r3Oi8.js} +1 -1
- package/dist/public/assets/{packet-AYTQ26CC-C_WSBR7W.js → packet-AYTQ26CC-_HBkwHYp.js} +1 -1
- package/dist/public/assets/{pdf-CW6jyF4i.js → pdf-DABk-fGs.js} +1 -1
- package/dist/public/assets/{pegDiagram-XKGWAZYB-CQw-vxyv.js → pegDiagram-XKGWAZYB-B-fG_WHS.js} +1 -1
- package/dist/public/assets/{pie-WAS4IAKB-CyAolSkk.js → pie-WAS4IAKB-ByxJto7v.js} +1 -1
- package/dist/public/assets/{pieDiagram-E7YTZNPT-fEikc7gQ.js → pieDiagram-E7YTZNPT-Ci8ZSq4L.js} +1 -1
- package/dist/public/assets/{project-abbrev-0K47Phcy.js → project-abbrev-BU2DBpdq.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-AXDQQJYC-BLZF9CN6.js → quadrantDiagram-AXDQQJYC-B97Yoxpb.js} +1 -1
- package/dist/public/assets/{radar-RG4KPBEZ-DZj09Z3T.js → radar-RG4KPBEZ-BT2qdAqW.js} +1 -1
- package/dist/public/assets/{railroad-74A4TZTK-DrrM4RhH.js → railroad-74A4TZTK-Buny6l3B.js} +1 -1
- package/dist/public/assets/railroad-abnf-HS5TGJTU-C_aUf3vj.js +1 -0
- package/dist/public/assets/railroad-ebnf-LZEXJU2U-BGUVD_Qq.js +1 -0
- package/dist/public/assets/railroad-peg-WCYAUIDC-CGdTjBGv.js +1 -0
- package/dist/public/assets/{railroadDiagram-O6MQD6OU-BjnjeLPo.js → railroadDiagram-O6MQD6OU-BktpI6J7.js} +1 -1
- package/dist/public/assets/{requirementDiagram-BXWQKSXE-CJnHoVjp.js → requirementDiagram-BXWQKSXE-DYy_YKmd.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-P5KCCOFB-BFBAycgU.js → sankeyDiagram-P5KCCOFB-BeKH_sFV.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-WJ2MYXX4-IgIUmdp2.js → sequenceDiagram-WJ2MYXX4-DD8okFGM.js} +1 -1
- package/dist/public/assets/{stateDiagram-D77RDMKH-C8ragRoI.js → stateDiagram-D77RDMKH-Bfk3E3Oa.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-MP3YSRHH-DCg8-XDy.js +1 -0
- package/dist/public/assets/{swimlanes-42K2YHIH-mm0BJE0h.js → swimlanes-42K2YHIH-OVNrzhfn.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-VR7AAH4N-DAqvbP32.js +8 -0
- package/dist/public/assets/{switch-TfZl8YQu.js → switch-CN9NW-du.js} +1 -1
- package/dist/public/assets/{timeline-definition-24CTP7MA-CLtACXsf.js → timeline-definition-24CTP7MA-C78a8EdU.js} +1 -1
- package/dist/public/assets/{treeView-Q6P3EWNA-B_s8YnCD.js → treeView-Q6P3EWNA-Cl5tCoga.js} +1 -1
- package/dist/public/assets/{treemap-WGGIJYW6-CiyeynoG.js → treemap-WGGIJYW6-4YVcjSz9.js} +1 -1
- package/dist/public/assets/{tsMode-BJ9DHdAB.js → tsMode-CmGZ7MCT.js} +1 -1
- package/dist/public/assets/{use-ui-state-2bNBLDPU.js → use-ui-state-CzR7YpWb.js} +1 -1
- package/dist/public/assets/{vennDiagram-4TSXK5OY-C9rcT-1u.js → vennDiagram-4TSXK5OY-Lih9MwBs.js} +1 -1
- package/dist/public/assets/{wardley-WFR3VGLG-D_hqUvOM.js → wardley-WFR3VGLG-CcU7I6bt.js} +1 -1
- package/dist/public/assets/{wardleyDiagram-VM6X3IG4-Dfn7mGAc.js → wardleyDiagram-VM6X3IG4-DxHrszj8.js} +1 -1
- package/dist/public/assets/{ws-CDXqi1pN.js → ws-C-kvwpeD.js} +1 -1
- package/dist/public/assets/{xychartDiagram-S5SC5T6Z-vwVJPUe2.js → xychartDiagram-S5SC5T6Z-DpLvvdIG.js} +1 -1
- package/dist/public/index.html +2 -2
- package/package.json +1 -1
- package/dist/public/assets/architecture-7GRP2DOG-RMEcXYv9.js +0 -1
- package/dist/public/assets/channel-BheYsxDc.js +0 -1
- package/dist/public/assets/classDiagram-ZZMXUADV-CDDLBiV5.js +0 -1
- package/dist/public/assets/classDiagram-v2-VYDZK3BY-CDDLBiV5.js +0 -1
- package/dist/public/assets/eventmodeling-NTZA5JFV-WlMCgowE.js +0 -1
- package/dist/public/assets/flowDiagram-HODETNUW-DJ99l88N.js +0 -1
- package/dist/public/assets/index-Ctw2P0rY.css +0 -2
- package/dist/public/assets/railroad-abnf-HS5TGJTU-lXe6u3FO.js +0 -1
- package/dist/public/assets/railroad-ebnf-LZEXJU2U-C7R4jvUV.js +0 -1
- package/dist/public/assets/railroad-peg-WCYAUIDC-B24HGcGJ.js +0 -1
- package/dist/public/assets/stateDiagram-v2-MP3YSRHH-AU0bFC0Z.js +0 -1
- package/dist/public/assets/swimlanesDiagram-VR7AAH4N-cBVuNXB5.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./mermaid-parser.core-DfmtQ5si.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n,p as r}from"./src-_wZywoZs.js";import{H as i,K as a,U as o,Y as s,a as c,b as l,f as u,s as d,v as f,w as p,x as m,y as h}from"./chunk-DU6HZSFF-C94gDWXH.js";import{g,i as _,m as v}from"./chunk-75Z2AOVW-BOvbyaVc.js";import{t as y}from"./chunk-JWPE2WC7-DVXcaiue.js";import{t as b}from"./chunk-2Q5K7J3B-C1jixKkw.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},ee=u.gitGraph,S=t(()=>_({...ee,...l().gitGraph}),`getConfig`),C=new b(()=>{let e=S(),t=e.mainBranchName,n=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:n}]]),branches:new Map([[t,null]]),currBranch:t,direction:`LR`,seq:0,options:{}}});function w(){return v({length:7})}t(w,`getID`);function T(e,t){let n=Object.create(null);return e.reduce((e,r)=>{let i=t(r);return n[i]||(n[i]=!0,e.push(r)),e},[])}t(T,`uniqBy`);var te=t(function(e){C.records.direction=e},`setDirection`),ne=t(function(e){n.debug(`options str`,e),e=e?.trim(),e||=`{}`;try{C.records.options=JSON.parse(e)}catch(e){n.error(`error while parsing gitGraph options`,e.message)}},`setOptions`),re=t(function(){return C.records.options},`getOptions`),ie=t(function(e){let t=e.msg,r=e.id,i=e.type,a=e.tags;n.info(`commit`,t,r,i,a),n.debug(`Entering commit:`,t,r,i,a);let o=S();r=d.sanitizeText(r,o),t=d.sanitizeText(t,o),a=a?.map(e=>d.sanitizeText(e,o));let s={id:r||C.records.seq+`-`+w(),message:t,seq:C.records.seq++,type:i??x.NORMAL,tags:a??[],parents:C.records.head==null?[]:[C.records.head.id],branch:C.records.currBranch};C.records.head=s,n.info(`main branch`,o.mainBranchName),C.records.commits.has(s.id)&&n.warn(`Commit ID ${s.id} already exists`),C.records.commits.set(s.id,s),C.records.branches.set(C.records.currBranch,s.id),n.debug(`in pushCommit `+s.id)},`commit`),ae=t(function(e){let t=e.name,r=e.order;if(t=d.sanitizeText(t,S()),C.records.branches.has(t))throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${t}")`);C.records.branches.set(t,C.records.head==null?null:C.records.head.id),C.records.branchConfig.set(t,{name:t,order:r}),E(t),n.debug(`in createBranch`)},`branch`),oe=t(e=>{let t=e.branch,r=e.id,i=e.type,a=e.tags,o=S();t=d.sanitizeText(t,o),r&&=d.sanitizeText(r,o);let s=C.records.branches.get(C.records.currBranch),c=C.records.branches.get(t),l=s?C.records.commits.get(s):void 0,u=c?C.records.commits.get(c):void 0;if(l&&u&&l.branch===t)throw Error(`Cannot merge branch '${t}' into itself.`);if(C.records.currBranch===t){let e=Error(`Incorrect usage of "merge". Cannot merge a branch to itself`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(l===void 0||!l){let e=Error(`Incorrect usage of "merge". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`commit`]},e}if(!C.records.branches.has(t)){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) does not exist`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},e}if(u===void 0||!u){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`"commit"`]},e}if(l===u){let e=Error(`Incorrect usage of "merge". Both branches have same head`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(r&&C.records.commits.has(r)){let e=Error(`Incorrect usage of "merge". Commit with id:`+r+` already exists, use different custom id`);throw e.hash={text:`merge ${t} ${r} ${i} ${a?.join(` `)}`,token:`merge ${t} ${r} ${i} ${a?.join(` `)}`,expected:[`merge ${t} ${r}_UNIQUE ${i} ${a?.join(` `)}`]},e}let f=c||``,p={id:r||`${C.records.seq}-${w()}`,message:`merged branch ${t} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,f],branch:C.records.currBranch,type:x.MERGE,customType:i,customId:!!r,tags:a??[]};C.records.head=p,C.records.commits.set(p.id,p),C.records.branches.set(C.records.currBranch,p.id),n.debug(C.records.branches),n.debug(`in mergeBranch`)},`merge`),se=t(function(e){let t=e.id,r=e.targetId,i=e.tags,a=e.parent;n.debug(`Entering cherryPick:`,t,r,i);let o=S();if(t=d.sanitizeText(t,o),r=d.sanitizeText(r,o),i=i?.map(e=>d.sanitizeText(e,o)),a=d.sanitizeText(a,o),!t||!C.records.commits.has(t)){let e=Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);throw e.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:[`cherry-pick abc`]},e}let s=C.records.commits.get(t);if(s===void 0||!s)throw Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);if(a&&!(Array.isArray(s.parents)&&s.parents.includes(a)))throw Error(`Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.`);let c=s.branch;if(s.type===x.MERGE&&!a)throw Error(`Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.`);if(!r||!C.records.commits.has(r)){if(c===C.records.currBranch){let e=Error(`Incorrect usage of "cherryPick". Source commit is already on current branch`);throw e.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:[`cherry-pick abc`]},e}let e=C.records.branches.get(C.records.currBranch);if(e===void 0||!e){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:[`cherry-pick abc`]},e}let o=C.records.commits.get(e);if(o===void 0||!o){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:[`cherry-pick abc`]},e}let l={id:C.records.seq+`-`+w(),message:`cherry-picked ${s?.message} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,s.id],branch:C.records.currBranch,type:x.CHERRY_PICK,tags:i?i.filter(Boolean):[`cherry-pick:${s.id}${s.type===x.MERGE?`|parent:${a}`:``}`]};C.records.head=l,C.records.commits.set(l.id,l),C.records.branches.set(C.records.currBranch,l.id),n.debug(C.records.branches),n.debug(`in cherryPick`)}},`cherryPick`),E=t(function(e){if(e=d.sanitizeText(e,S()),C.records.branches.has(e)){C.records.currBranch=e;let t=C.records.branches.get(C.records.currBranch);t===void 0||!t?C.records.head=null:C.records.head=C.records.commits.get(t)??null}else{let t=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw t.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},t}},`checkout`);function D(e,t,n){let r=e.indexOf(t);r===-1?e.push(n):e.splice(r,1,n)}t(D,`upsert`);function O(e){let t=e.reduce((e,t)=>e.seq>t.seq?e:t,e[0]),r=``;e.forEach(function(e){e===t?r+=` *`:r+=` |`});let i=[r,t.id,t.seq];for(let e in C.records.branches)C.records.branches.get(e)===t.id&&i.push(e);if(n.debug(i.join(` `)),t.parents&&t.parents.length==2&&t.parents[0]&&t.parents[1]){let n=C.records.commits.get(t.parents[0]);D(e,t,n),t.parents[1]&&e.push(C.records.commits.get(t.parents[1]))}else if(t.parents.length==0)return;else if(t.parents[0]){let n=C.records.commits.get(t.parents[0]);D(e,t,n)}e=T(e,e=>e.id),O(e)}t(O,`prettyPrintCommitHistory`);var ce=t(function(){n.debug(C.records.commits);let e=k()[0];O([e])},`prettyPrint`),le=t(function(){C.reset(),c()},`clear`),ue=t(function(){return[...C.records.branchConfig.values()].map((e,t)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}))},`getBranchesAsObjArray`),de=t(function(){return C.records.branches},`getBranches`),fe=t(function(){return C.records.commits},`getCommits`),k=t(function(){let e=[...C.records.commits.values()];return e.forEach(function(e){n.debug(e.id)}),e.sort((e,t)=>e.seq-t.seq),e},`getCommitsArray`),A={commitType:x,getConfig:S,setDirection:te,setOptions:ne,getOptions:re,commit:ie,branch:ae,merge:oe,cherryPick:se,checkout:E,prettyPrint:ce,clear:le,getBranchesAsObjArray:ue,getBranches:de,getCommits:fe,getCommitsArray:k,getCurrentBranch:t(function(){return C.records.currBranch},`getCurrentBranch`),getDirection:t(function(){return C.records.direction},`getDirection`),getHead:t(function(){return C.records.head},`getHead`),setAccTitle:o,getAccTitle:h,getAccDescription:f,setAccDescription:i,setDiagramTitle:a,getDiagramTitle:p},pe=t((e,t)=>{y(e,t),e.dir&&t.setDirection(e.dir);for(let n of e.statements)me(n,t)},`populate`),me=t((e,r)=>{let i={Commit:t(e=>r.commit(he(e)),`Commit`),Branch:t(e=>r.branch(ge(e)),`Branch`),Merge:t(e=>r.merge(_e(e)),`Merge`),Checkout:t(e=>r.checkout(ve(e)),`Checkout`),CherryPicking:t(e=>r.cherryPick(ye(e)),`CherryPicking`)}[e.$type];i?i(e):n.error(`Unknown statement type: ${e.$type}`)},`parseStatement`),he=t(e=>({id:e.id,msg:e.message??``,type:e.type===void 0?x.NORMAL:x[e.type],tags:e.tags??void 0}),`parseCommit`),ge=t(e=>({name:e.name,order:e.order??0}),`parseBranch`),_e=t(e=>({branch:e.branch,id:e.id??``,type:e.type===void 0?void 0:x[e.type],tags:e.tags??void 0}),`parseMerge`),ve=t(e=>e.branch,`parseCheckout`),ye=t(e=>({id:e.id,targetId:``,tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),`parseCherryPicking`),be={parse:t(async t=>{let r=await e(`gitGraph`,t);n.debug(r),pe(r,A)},`parse`)},j=10,M=40,N=4,P=2,F=8,I=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),L=12,R=new Set([`redux-color`,`redux-dark-color`]),xe=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),z=t((e,t,n=!1)=>n&&e>0?(e-1)%(t-1)+1:e%t,`calcColorIndex`),B=new Map,V=new Map,H=30,U=new Map,W=[],G=0,K=`LR`,Se=t(()=>{B.clear(),V.clear(),U.clear(),G=0,W=[],K=`LR`},`clear`),q=t(e=>{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);return(typeof e==`string`?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(e=>{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);n.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`),n.setAttribute(`dy`,`1em`),n.setAttribute(`x`,`0`),n.setAttribute(`class`,`row`),n.textContent=e.trim(),t.appendChild(n)}),t},`drawText`),J=t(e=>{let n,r,i;return K===`BT`?(r=t((e,t)=>e<=t,`comparisonFunc`),i=1/0):(r=t((e,t)=>e>=t,`comparisonFunc`),i=0),e.forEach(e=>{let t=K===`TB`||K==`BT`?V.get(e)?.y:V.get(e)?.x;t!==void 0&&r(t,i)&&(n=e,i=t)}),n},`findClosestParent`),Ce=t(e=>{let t=``,n=1/0;return e.forEach(e=>{let r=V.get(e).y;r<=n&&(t=e,n=r)}),t||void 0},`findClosestParentBT`),we=t((e,t,n)=>{let r=n,i=n,a=[];e.forEach(e=>{let n=t.get(e);if(!n)throw Error(`Commit not found for key ${e}`);n.parents.length?(r=Ee(n),i=Math.max(r,i)):a.push(n),De(n,r)}),r=i,a.forEach(e=>{Oe(e,r,n)}),e.forEach(e=>{let n=t.get(e);if(n?.parents.length){let e=Ce(n.parents);r=V.get(e).y-M,r<=i&&(i=r);let t=B.get(n.branch).pos,a=r-j;V.set(n.id,{x:t,y:a})}})},`setParallelBTPos`),Te=t(e=>{let t=J(e.parents.filter(e=>e!==null));if(!t)throw Error(`Closest parent not found for commit ${e.id}`);let n=V.get(t)?.y;if(n===void 0)throw Error(`Closest parent position not found for commit ${e.id}`);return n},`findClosestParentPos`),Ee=t(e=>Te(e)+M,`calculateCommitPosition`),De=t((e,t)=>{let n=B.get(e.branch);if(!n)throw Error(`Branch not found for commit ${e.id}`);let r=n.pos,i=t+j;return V.set(e.id,{x:r,y:i}),{x:r,y:i}},`setCommitPosition`),Oe=t((e,t,n)=>{let r=B.get(e.branch);if(!r)throw Error(`Branch not found for commit ${e.id}`);let i=t+n,a=r.pos;V.set(e.id,{x:a,y:i})},`setRootPosition`),ke=t((e,t,n,r,i,a)=>{let{theme:o}=m(),s=I.has(o??``),c=R.has(o??``),l=xe.has(o??``);if(a===x.HIGHLIGHT)e.append(`rect`).attr(`x`,n.x-10+(s?3:0)).attr(`y`,n.y-10+(s?3:0)).attr(`width`,s?14:20).attr(`height`,s?14:20).attr(`class`,`commit ${t.id} commit-highlight${z(i,F,c)} ${r}-outer`),e.append(`rect`).attr(`x`,n.x-6+(s?2:0)).attr(`y`,n.y-6+(s?2:0)).attr(`width`,s?8:12).attr(`height`,s?8:12).attr(`class`,`commit ${t.id} commit${z(i,F,c)} ${r}-inner`);else if(a===x.CHERRY_PICK)e.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,s?7:10).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x-3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x+3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x+3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x-3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`);else{let o=e.append(`circle`);if(o.attr(`cx`,n.x),o.attr(`cy`,n.y),o.attr(`r`,s?7:10),o.attr(`class`,`commit ${t.id} commit${z(i,F,c)}`),a===x.MERGE){let a=e.append(`circle`);a.attr(`cx`,n.x),a.attr(`cy`,n.y),a.attr(`r`,s?5:6),a.attr(`class`,`commit ${r} ${t.id} commit${z(i,F,c)}`)}if(a===x.REVERSE){let a=e.append(`path`),o=s?4:5;a.attr(`d`,`M ${n.x-o},${n.y-o}L${n.x+o},${n.y+o}M${n.x-o},${n.y+o}L${n.x+o},${n.y-o}`).attr(`class`,`commit ${r} ${t.id} commit${z(i,F,c)}`)}}},`drawCommitBullet`),Ae=t((e,t,n,r,i)=>{if(t.type!==x.CHERRY_PICK&&(t.customId&&t.type===x.MERGE||t.type!==x.MERGE)&&i.showCommitLabel){let a=e.append(`g`),o=a.insert(`rect`).attr(`class`,`commit-label-bkg`),s=a.append(`text`).attr(`x`,r).attr(`y`,n.y+25).attr(`class`,`commit-label`).text(t.id),c=s.node()?.getBBox();if(c&&(o.attr(`x`,n.posWithOffset-c.width/2-P).attr(`y`,n.y+13.5).attr(`width`,c.width+2*P).attr(`height`,c.height+2*P),K===`TB`||K===`BT`?(o.attr(`x`,n.x-(c.width+4*N+5)).attr(`y`,n.y-12),s.attr(`x`,n.x-(c.width+4*N)).attr(`y`,n.y+c.height-12)):s.attr(`x`,n.posWithOffset-c.width/2),i.rotateCommitLabel))if(K===`TB`||K===`BT`)s.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`),o.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`);else{let e=-7.5-(c.width+10)/25*9.5,t=10+c.width/25*8.5;a.attr(`transform`,`translate(`+e+`, `+t+`) rotate(-45, `+r+`, `+n.y+`)`)}}},`drawCommitLabel`),je=t((e,t,n,r)=>{if(t.tags.length>0){let i=0,a=0,o=0,s=[];for(let r of t.tags.reverse()){let t=e.insert(`polygon`),c=e.append(`circle`),l=e.append(`text`).attr(`y`,n.y-16-i).attr(`class`,`tag-label`).text(r),u=l.node()?.getBBox();if(!u)throw Error(`Tag bbox not found`);a=Math.max(a,u.width),o=Math.max(o,u.height),l.attr(`x`,n.posWithOffset-u.width/2),s.push({tag:l,hole:c,rect:t,yOffset:i}),i+=20}for(let{tag:e,hole:t,rect:i,yOffset:c}of s){let s=o/2,l=n.y-19.2-c;if(i.attr(`class`,`tag-label-bkg`).attr(`points`,`
|
|
1
|
+
import{n as e}from"./mermaid-parser.core-n0Wb6T7Q.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n,p as r}from"./src-_wZywoZs.js";import{H as i,K as a,U as o,Y as s,a as c,b as l,f as u,s as d,v as f,w as p,x as m,y as h}from"./chunk-DU6HZSFF-Bx2ELCn-.js";import{g,i as _,m as v}from"./chunk-75Z2AOVW-DJJjslyX.js";import{t as y}from"./chunk-JWPE2WC7-DVXcaiue.js";import{t as b}from"./chunk-2Q5K7J3B-C1jixKkw.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},ee=u.gitGraph,S=t(()=>_({...ee,...l().gitGraph}),`getConfig`),C=new b(()=>{let e=S(),t=e.mainBranchName,n=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:n}]]),branches:new Map([[t,null]]),currBranch:t,direction:`LR`,seq:0,options:{}}});function w(){return v({length:7})}t(w,`getID`);function T(e,t){let n=Object.create(null);return e.reduce((e,r)=>{let i=t(r);return n[i]||(n[i]=!0,e.push(r)),e},[])}t(T,`uniqBy`);var te=t(function(e){C.records.direction=e},`setDirection`),ne=t(function(e){n.debug(`options str`,e),e=e?.trim(),e||=`{}`;try{C.records.options=JSON.parse(e)}catch(e){n.error(`error while parsing gitGraph options`,e.message)}},`setOptions`),re=t(function(){return C.records.options},`getOptions`),ie=t(function(e){let t=e.msg,r=e.id,i=e.type,a=e.tags;n.info(`commit`,t,r,i,a),n.debug(`Entering commit:`,t,r,i,a);let o=S();r=d.sanitizeText(r,o),t=d.sanitizeText(t,o),a=a?.map(e=>d.sanitizeText(e,o));let s={id:r||C.records.seq+`-`+w(),message:t,seq:C.records.seq++,type:i??x.NORMAL,tags:a??[],parents:C.records.head==null?[]:[C.records.head.id],branch:C.records.currBranch};C.records.head=s,n.info(`main branch`,o.mainBranchName),C.records.commits.has(s.id)&&n.warn(`Commit ID ${s.id} already exists`),C.records.commits.set(s.id,s),C.records.branches.set(C.records.currBranch,s.id),n.debug(`in pushCommit `+s.id)},`commit`),ae=t(function(e){let t=e.name,r=e.order;if(t=d.sanitizeText(t,S()),C.records.branches.has(t))throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${t}")`);C.records.branches.set(t,C.records.head==null?null:C.records.head.id),C.records.branchConfig.set(t,{name:t,order:r}),E(t),n.debug(`in createBranch`)},`branch`),oe=t(e=>{let t=e.branch,r=e.id,i=e.type,a=e.tags,o=S();t=d.sanitizeText(t,o),r&&=d.sanitizeText(r,o);let s=C.records.branches.get(C.records.currBranch),c=C.records.branches.get(t),l=s?C.records.commits.get(s):void 0,u=c?C.records.commits.get(c):void 0;if(l&&u&&l.branch===t)throw Error(`Cannot merge branch '${t}' into itself.`);if(C.records.currBranch===t){let e=Error(`Incorrect usage of "merge". Cannot merge a branch to itself`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(l===void 0||!l){let e=Error(`Incorrect usage of "merge". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`commit`]},e}if(!C.records.branches.has(t)){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) does not exist`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},e}if(u===void 0||!u){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`"commit"`]},e}if(l===u){let e=Error(`Incorrect usage of "merge". Both branches have same head`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(r&&C.records.commits.has(r)){let e=Error(`Incorrect usage of "merge". Commit with id:`+r+` already exists, use different custom id`);throw e.hash={text:`merge ${t} ${r} ${i} ${a?.join(` `)}`,token:`merge ${t} ${r} ${i} ${a?.join(` `)}`,expected:[`merge ${t} ${r}_UNIQUE ${i} ${a?.join(` `)}`]},e}let f=c||``,p={id:r||`${C.records.seq}-${w()}`,message:`merged branch ${t} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,f],branch:C.records.currBranch,type:x.MERGE,customType:i,customId:!!r,tags:a??[]};C.records.head=p,C.records.commits.set(p.id,p),C.records.branches.set(C.records.currBranch,p.id),n.debug(C.records.branches),n.debug(`in mergeBranch`)},`merge`),se=t(function(e){let t=e.id,r=e.targetId,i=e.tags,a=e.parent;n.debug(`Entering cherryPick:`,t,r,i);let o=S();if(t=d.sanitizeText(t,o),r=d.sanitizeText(r,o),i=i?.map(e=>d.sanitizeText(e,o)),a=d.sanitizeText(a,o),!t||!C.records.commits.has(t)){let e=Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);throw e.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:[`cherry-pick abc`]},e}let s=C.records.commits.get(t);if(s===void 0||!s)throw Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);if(a&&!(Array.isArray(s.parents)&&s.parents.includes(a)))throw Error(`Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.`);let c=s.branch;if(s.type===x.MERGE&&!a)throw Error(`Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.`);if(!r||!C.records.commits.has(r)){if(c===C.records.currBranch){let e=Error(`Incorrect usage of "cherryPick". Source commit is already on current branch`);throw e.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:[`cherry-pick abc`]},e}let e=C.records.branches.get(C.records.currBranch);if(e===void 0||!e){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:[`cherry-pick abc`]},e}let o=C.records.commits.get(e);if(o===void 0||!o){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${r}`,token:`cherryPick ${t} ${r}`,expected:[`cherry-pick abc`]},e}let l={id:C.records.seq+`-`+w(),message:`cherry-picked ${s?.message} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,s.id],branch:C.records.currBranch,type:x.CHERRY_PICK,tags:i?i.filter(Boolean):[`cherry-pick:${s.id}${s.type===x.MERGE?`|parent:${a}`:``}`]};C.records.head=l,C.records.commits.set(l.id,l),C.records.branches.set(C.records.currBranch,l.id),n.debug(C.records.branches),n.debug(`in cherryPick`)}},`cherryPick`),E=t(function(e){if(e=d.sanitizeText(e,S()),C.records.branches.has(e)){C.records.currBranch=e;let t=C.records.branches.get(C.records.currBranch);t===void 0||!t?C.records.head=null:C.records.head=C.records.commits.get(t)??null}else{let t=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw t.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},t}},`checkout`);function D(e,t,n){let r=e.indexOf(t);r===-1?e.push(n):e.splice(r,1,n)}t(D,`upsert`);function O(e){let t=e.reduce((e,t)=>e.seq>t.seq?e:t,e[0]),r=``;e.forEach(function(e){e===t?r+=` *`:r+=` |`});let i=[r,t.id,t.seq];for(let e in C.records.branches)C.records.branches.get(e)===t.id&&i.push(e);if(n.debug(i.join(` `)),t.parents&&t.parents.length==2&&t.parents[0]&&t.parents[1]){let n=C.records.commits.get(t.parents[0]);D(e,t,n),t.parents[1]&&e.push(C.records.commits.get(t.parents[1]))}else if(t.parents.length==0)return;else if(t.parents[0]){let n=C.records.commits.get(t.parents[0]);D(e,t,n)}e=T(e,e=>e.id),O(e)}t(O,`prettyPrintCommitHistory`);var ce=t(function(){n.debug(C.records.commits);let e=k()[0];O([e])},`prettyPrint`),le=t(function(){C.reset(),c()},`clear`),ue=t(function(){return[...C.records.branchConfig.values()].map((e,t)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}))},`getBranchesAsObjArray`),de=t(function(){return C.records.branches},`getBranches`),fe=t(function(){return C.records.commits},`getCommits`),k=t(function(){let e=[...C.records.commits.values()];return e.forEach(function(e){n.debug(e.id)}),e.sort((e,t)=>e.seq-t.seq),e},`getCommitsArray`),A={commitType:x,getConfig:S,setDirection:te,setOptions:ne,getOptions:re,commit:ie,branch:ae,merge:oe,cherryPick:se,checkout:E,prettyPrint:ce,clear:le,getBranchesAsObjArray:ue,getBranches:de,getCommits:fe,getCommitsArray:k,getCurrentBranch:t(function(){return C.records.currBranch},`getCurrentBranch`),getDirection:t(function(){return C.records.direction},`getDirection`),getHead:t(function(){return C.records.head},`getHead`),setAccTitle:o,getAccTitle:h,getAccDescription:f,setAccDescription:i,setDiagramTitle:a,getDiagramTitle:p},pe=t((e,t)=>{y(e,t),e.dir&&t.setDirection(e.dir);for(let n of e.statements)me(n,t)},`populate`),me=t((e,r)=>{let i={Commit:t(e=>r.commit(he(e)),`Commit`),Branch:t(e=>r.branch(ge(e)),`Branch`),Merge:t(e=>r.merge(_e(e)),`Merge`),Checkout:t(e=>r.checkout(ve(e)),`Checkout`),CherryPicking:t(e=>r.cherryPick(ye(e)),`CherryPicking`)}[e.$type];i?i(e):n.error(`Unknown statement type: ${e.$type}`)},`parseStatement`),he=t(e=>({id:e.id,msg:e.message??``,type:e.type===void 0?x.NORMAL:x[e.type],tags:e.tags??void 0}),`parseCommit`),ge=t(e=>({name:e.name,order:e.order??0}),`parseBranch`),_e=t(e=>({branch:e.branch,id:e.id??``,type:e.type===void 0?void 0:x[e.type],tags:e.tags??void 0}),`parseMerge`),ve=t(e=>e.branch,`parseCheckout`),ye=t(e=>({id:e.id,targetId:``,tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),`parseCherryPicking`),be={parse:t(async t=>{let r=await e(`gitGraph`,t);n.debug(r),pe(r,A)},`parse`)},j=10,M=40,N=4,P=2,F=8,I=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),L=12,R=new Set([`redux-color`,`redux-dark-color`]),xe=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),z=t((e,t,n=!1)=>n&&e>0?(e-1)%(t-1)+1:e%t,`calcColorIndex`),B=new Map,V=new Map,H=30,U=new Map,W=[],G=0,K=`LR`,Se=t(()=>{B.clear(),V.clear(),U.clear(),G=0,W=[],K=`LR`},`clear`),q=t(e=>{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);return(typeof e==`string`?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(e=>{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);n.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`),n.setAttribute(`dy`,`1em`),n.setAttribute(`x`,`0`),n.setAttribute(`class`,`row`),n.textContent=e.trim(),t.appendChild(n)}),t},`drawText`),J=t(e=>{let n,r,i;return K===`BT`?(r=t((e,t)=>e<=t,`comparisonFunc`),i=1/0):(r=t((e,t)=>e>=t,`comparisonFunc`),i=0),e.forEach(e=>{let t=K===`TB`||K==`BT`?V.get(e)?.y:V.get(e)?.x;t!==void 0&&r(t,i)&&(n=e,i=t)}),n},`findClosestParent`),Ce=t(e=>{let t=``,n=1/0;return e.forEach(e=>{let r=V.get(e).y;r<=n&&(t=e,n=r)}),t||void 0},`findClosestParentBT`),we=t((e,t,n)=>{let r=n,i=n,a=[];e.forEach(e=>{let n=t.get(e);if(!n)throw Error(`Commit not found for key ${e}`);n.parents.length?(r=Ee(n),i=Math.max(r,i)):a.push(n),De(n,r)}),r=i,a.forEach(e=>{Oe(e,r,n)}),e.forEach(e=>{let n=t.get(e);if(n?.parents.length){let e=Ce(n.parents);r=V.get(e).y-M,r<=i&&(i=r);let t=B.get(n.branch).pos,a=r-j;V.set(n.id,{x:t,y:a})}})},`setParallelBTPos`),Te=t(e=>{let t=J(e.parents.filter(e=>e!==null));if(!t)throw Error(`Closest parent not found for commit ${e.id}`);let n=V.get(t)?.y;if(n===void 0)throw Error(`Closest parent position not found for commit ${e.id}`);return n},`findClosestParentPos`),Ee=t(e=>Te(e)+M,`calculateCommitPosition`),De=t((e,t)=>{let n=B.get(e.branch);if(!n)throw Error(`Branch not found for commit ${e.id}`);let r=n.pos,i=t+j;return V.set(e.id,{x:r,y:i}),{x:r,y:i}},`setCommitPosition`),Oe=t((e,t,n)=>{let r=B.get(e.branch);if(!r)throw Error(`Branch not found for commit ${e.id}`);let i=t+n,a=r.pos;V.set(e.id,{x:a,y:i})},`setRootPosition`),ke=t((e,t,n,r,i,a)=>{let{theme:o}=m(),s=I.has(o??``),c=R.has(o??``),l=xe.has(o??``);if(a===x.HIGHLIGHT)e.append(`rect`).attr(`x`,n.x-10+(s?3:0)).attr(`y`,n.y-10+(s?3:0)).attr(`width`,s?14:20).attr(`height`,s?14:20).attr(`class`,`commit ${t.id} commit-highlight${z(i,F,c)} ${r}-outer`),e.append(`rect`).attr(`x`,n.x-6+(s?2:0)).attr(`y`,n.y-6+(s?2:0)).attr(`width`,s?8:12).attr(`height`,s?8:12).attr(`class`,`commit ${t.id} commit${z(i,F,c)} ${r}-inner`);else if(a===x.CHERRY_PICK)e.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,s?7:10).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x-3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x+3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x+3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x-3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`);else{let o=e.append(`circle`);if(o.attr(`cx`,n.x),o.attr(`cy`,n.y),o.attr(`r`,s?7:10),o.attr(`class`,`commit ${t.id} commit${z(i,F,c)}`),a===x.MERGE){let a=e.append(`circle`);a.attr(`cx`,n.x),a.attr(`cy`,n.y),a.attr(`r`,s?5:6),a.attr(`class`,`commit ${r} ${t.id} commit${z(i,F,c)}`)}if(a===x.REVERSE){let a=e.append(`path`),o=s?4:5;a.attr(`d`,`M ${n.x-o},${n.y-o}L${n.x+o},${n.y+o}M${n.x-o},${n.y+o}L${n.x+o},${n.y-o}`).attr(`class`,`commit ${r} ${t.id} commit${z(i,F,c)}`)}}},`drawCommitBullet`),Ae=t((e,t,n,r,i)=>{if(t.type!==x.CHERRY_PICK&&(t.customId&&t.type===x.MERGE||t.type!==x.MERGE)&&i.showCommitLabel){let a=e.append(`g`),o=a.insert(`rect`).attr(`class`,`commit-label-bkg`),s=a.append(`text`).attr(`x`,r).attr(`y`,n.y+25).attr(`class`,`commit-label`).text(t.id),c=s.node()?.getBBox();if(c&&(o.attr(`x`,n.posWithOffset-c.width/2-P).attr(`y`,n.y+13.5).attr(`width`,c.width+2*P).attr(`height`,c.height+2*P),K===`TB`||K===`BT`?(o.attr(`x`,n.x-(c.width+4*N+5)).attr(`y`,n.y-12),s.attr(`x`,n.x-(c.width+4*N)).attr(`y`,n.y+c.height-12)):s.attr(`x`,n.posWithOffset-c.width/2),i.rotateCommitLabel))if(K===`TB`||K===`BT`)s.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`),o.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`);else{let e=-7.5-(c.width+10)/25*9.5,t=10+c.width/25*8.5;a.attr(`transform`,`translate(`+e+`, `+t+`) rotate(-45, `+r+`, `+n.y+`)`)}}},`drawCommitLabel`),je=t((e,t,n,r)=>{if(t.tags.length>0){let i=0,a=0,o=0,s=[];for(let r of t.tags.reverse()){let t=e.insert(`polygon`),c=e.append(`circle`),l=e.append(`text`).attr(`y`,n.y-16-i).attr(`class`,`tag-label`).text(r),u=l.node()?.getBBox();if(!u)throw Error(`Tag bbox not found`);a=Math.max(a,u.width),o=Math.max(o,u.height),l.attr(`x`,n.posWithOffset-u.width/2),s.push({tag:l,hole:c,rect:t,yOffset:i}),i+=20}for(let{tag:e,hole:t,rect:i,yOffset:c}of s){let s=o/2,l=n.y-19.2-c;if(i.attr(`class`,`tag-label-bkg`).attr(`points`,`
|
|
2
2
|
${r-a/2-N/2},${l+P}
|
|
3
3
|
${r-a/2-N/2},${l-P}
|
|
4
4
|
${n.posWithOffset-a/2-N},${l-s-P}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{b as n,n as r}from"./index-C1a3rCk2.js";import{i}from"./dist-CxMnSex-.js";var a=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},o=new class extends a{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},s={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},c=new class{#e=s;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function l(e){setTimeout(e,0)}var u=typeof window>`u`||`Deno`in globalThis;function d(){}function f(e,t){return typeof e==`function`?e(t):e}function p(e){return typeof e==`number`&&e>=0&&e!==1/0}function m(e,t){return Math.max(e+(t||0)-Date.now(),0)}function h(e,t){return typeof e==`function`?e(t):e}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==y(o,t.options))return!1}else if(!x(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function v(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(b(t.options.mutationKey)!==b(a))return!1}else if(!x(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function y(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function x(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>x(e[n],t[n])):!1}var S=Object.prototype.hasOwnProperty;function ee(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=te(e)&&te(t);if(!r&&!(w(e)&&w(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:S.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ee(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function C(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function te(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!ne(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ne(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ne(e){return Object.prototype.toString.call(e)===`[object Object]`}function re(e){return new Promise(t=>{c.setTimeout(t,e)})}function T(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ee(e,t)}function ie(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ae(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var E=Symbol();function oe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===E?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function D(e,t){return typeof e==`function`?e(...t):!!e}function se(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var O=(()=>{let e=()=>u;return{isServer(){return e()},setIsServer(t){e=t}}})();function k(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ce=l;function le(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ce,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var A=le(),j=new class extends a{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ue(e){return Math.min(1e3*2**e,3e4)}function de(e){return(e??`online`)!==`online`||j.isOnline()}var M=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function fe(e){let t=!1,n=0,r,i=k(),a=()=>i.status!==`pending`,s=t=>{if(!a()){let n=new M(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>o.isFocused()&&(e.networkMode===`always`||j.isOnline())&&e.canRun(),d=()=>de(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(O.isServer()?0:3),o=e.retryDelay??ue,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),re(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var pe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),p(this.gcTime)&&(this.#e=c.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(O.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(c.clearTimeout(this.#e),this.#e=void 0)}};function me(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{se(e,()=>t.signal,()=>n=!0)},u=oe(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ae:ie;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?he:N,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:N(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function N(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function he(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function ge(e,t){return t?N(e,t)!=null:!1}function _e(e,t){return!t||!e.getPreviousPageParam?!1:he(e,t)!=null}var ve=class extends pe{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=I(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=I(this.options);e.data!==void 0&&(this.setState(F(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=T(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(d).catch(d):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>g(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===E||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>h(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!m(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=oe(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?me(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=fe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof M&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof M){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...P(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...F(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),A.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function P(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:de(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function F(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function I(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ye=class extends a{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=k(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),xe(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof g(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!C(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Se(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ce(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(d)),t}#g(){this.#b();let e=h(this.options.staleTime,this.#t);if(O.isServer()||this.#r.isStale||!p(e))return;let t=m(this.#r.dataUpdatedAt,e)+1;this.#d=c.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(O.isServer()||g(this.options.enabled,this.#t)===!1||!p(this.#p)||this.#p===0)&&(this.#f=c.setInterval(()=>{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(c.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(c.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&xe(e,t),o=i&&Se(e,n,t,r);(a||o)&&(l={...l,...P(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=T(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=T(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:R(e,t),refetch:this.refetch,promise:this.#o,isEnabled:g(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=k();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!C(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){A.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function be(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&g(t.retryOnMount,e)===!1)}function xe(e,t){return be(e,t)||e.state.data!==void 0&&L(e,t,t.refetchOnMount)}function L(e,t,n){if(g(t.enabled,e)!==!1&&h(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&R(e,t)}return!1}function Se(e,t,n,r){return(e!==t||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&R(e,n)}function R(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(h(t.staleTime,e))}function Ce(e,t){return!C(e.getCurrentResult(),t)}var we=class extends pe{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Te(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=fe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),A.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Te(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ee=class extends a{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),C(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&b(t.mutationKey)!==b(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Te();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){A.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},z=e(t(),1),De=r(),Oe=z.createContext(void 0),B=e=>{let t=z.useContext(Oe);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ke=({client:e,children:t})=>(z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,De.jsx)(Oe.Provider,{value:e,children:t})),Ae=z.createContext(!1),je=()=>z.useContext(Ae);Ae.Provider;function Me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ne=z.createContext(Me()),Pe=()=>z.useContext(Ne),Fe=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?D(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ie=e=>{z.useEffect(()=>{e.clearReset()},[e])},Le=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||D(n,[e.error,r])),Re=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ze=(e,t)=>e.isLoading&&e.isFetching&&!t,Be=(e,t)=>e?.suspense&&t.isPending,Ve=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function He(e,t,n){let r=je(),i=Pe(),a=B(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Re(o),Fe(o,i,s),Ie(i);let l=!a.getQueryCache().get(o.queryHash),[u]=z.useState(()=>new t(a,o)),f=u.getOptimisticResult(o),p=!r&&c;if(z.useSyncExternalStore(z.useCallback(e=>{let t=p?u.subscribe(A.batchCalls(e)):d;return u.updateResult(),t},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),z.useEffect(()=>{u.setOptions(o)},[o,u]),Be(o,f))throw Ve(o,u,i);if(Le({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!O.isServer()&&ze(f,r)&&(l?Ve(o,u,i):s?.promise)?.catch(d).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?f:u.trackResult(f)}function V(e,t){return He(e,ye,t)}function H(e,t){let n=B(t),[r]=z.useState(()=>new Ee(n,e));z.useEffect(()=>{r.setOptions(e)},[r,e]);let i=z.useSyncExternalStore(z.useCallback(e=>r.subscribe(A.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=z.useCallback((e,t)=>{r.mutate(e,t).catch(d)},[r]);if(i.error&&D(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ue=12,U=typeof document<`u`?document.hasFocus():!0;typeof window<`u`&&(window.addEventListener(`focus`,()=>{U=!0}),window.addEventListener(`blur`,()=>{U=!1}),o.setEventListener(e=>{let t=()=>e(void 0);return window.addEventListener(`visibilitychange`,t,!1),window.addEventListener(`focus`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}}));function W(e){return()=>U?e:e*Ue}function We(){return V({queryKey:[`profiles`],queryFn:()=>i(`GET`,`/api/profiles`)})}function Ge(e){return V({queryKey:[`profile-settings`,e],queryFn:()=>i(`GET`,`/api/profiles/${e}/settings`),enabled:e!==void 0})}function Ke(e){return V({queryKey:[`accounts`,e],queryFn:()=>i(`GET`,`/api/accounts?profile=${e}`),enabled:e!==void 0})}function qe(e){return V({queryKey:[`account-usage`,e],queryFn:()=>i(`GET`,`/api/accounts/${e}/usage`),enabled:e!==void 0,staleTime:15e3})}function Je(){return V({queryKey:[`repos`],queryFn:()=>i(`GET`,`/api/repos`)})}function Ye(e,t=!0){return V({queryKey:[`projects`,e??`all`],queryFn:()=>i(`GET`,e===void 0?`/api/projects`:`/api/projects?profile=${e}`),enabled:t})}function Xe(e){return V({queryKey:[`project`,e],queryFn:()=>i(`GET`,`/api/projects/${e}`),enabled:e!==void 0,placeholderData:e=>e})}function Ze(e){return i(`POST`,`/api/projects/${e}/conversations/refresh`)}function Qe(e){return V({queryKey:[`sessions`,e],queryFn:()=>i(`GET`,`/api/sessions?project=${e}`),enabled:e!==void 0})}var $e={queryKey:[`sessions`,`all`],queryFn:()=>i(`GET`,`/api/sessions`)};function et(e=!0){return V({...$e,enabled:e})}function tt(e){return e.fetchQuery($e)}function nt(){return V({queryKey:[`config`],queryFn:()=>i(`GET`,`/api/config`)})}function rt(e){return V({queryKey:[`repo-branches`,e],queryFn:()=>i(`GET`,`/api/repos/${e}/branches`),enabled:e!==void 0,staleTime:3e4})}function it(e){return V({queryKey:[`repo-worktrees`,e],queryFn:()=>i(`GET`,`/api/repos/${e}/worktrees`),enabled:e!==void 0,staleTime:1e4})}function at(e,t){let n=B();return H({mutationFn:t=>i(`DELETE`,`/api/repos/${e}/worktrees?path=${encodeURIComponent(t)}`),onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function ot(e,t){let n=B();return H({mutationFn:({name:t,confirm:n})=>{let r=new URLSearchParams({name:t});return n&&r.set(`confirm`,`1`),i(`DELETE`,`/api/repos/${e}/branches?${r.toString()}`)},onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function st(e){return V({queryKey:[`fs-dirs`,e],queryFn:()=>i(`GET`,`/api/fs/dirs?prefix=${encodeURIComponent(e)}`),enabled:e.startsWith(`/`)||e.startsWith(`~`),placeholderData:e=>e,staleTime:1e4})}function ct(){return V({queryKey:[`version`],queryFn:()=>i(`GET`,`/api/version`),staleTime:1/0})}function lt(){return V({queryKey:[`host`],queryFn:()=>i(`GET`,`/api/host`),staleTime:1/0})}function ut(e){return e?e.displayName||e.hostname:void 0}function dt(){return V({queryKey:[`agents`],queryFn:()=>i(`GET`,`/api/agents`),staleTime:3e4,refetchOnWindowFocus:!0})}function ft(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/profiles`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function pt(e){let t=B();return H({mutationFn:t=>i(`PATCH`,`/api/profiles/${e}/settings`,t),onSuccess:n=>t.setQueryData([`profile-settings`,e],n)})}function mt(){let e=B();return H({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/profiles/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function ht(){let e=B();return H({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/accounts/${e}`,t),onSuccess:t=>{e.invalidateQueries({queryKey:[`accounts`,t.profile_id]}),e.invalidateQueries({queryKey:[`account-usage`,t.id]})}})}function gt(){let e=B();return H({mutationFn:e=>i(`DELETE`,`/api/profiles/${e}`),onSuccess:()=>e.clear()})}function _t(){let e=B();return H({mutationFn:e=>i(`DELETE`,`/api/accounts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`accounts`]})})}function vt(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/accounts`,e),onSuccess:t=>void e.invalidateQueries({queryKey:[`accounts`,t.profile_id]})})}function yt(){return H({mutationFn:e=>i(`POST`,`/api/accounts/${e}/login`)})}function bt(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/repos`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function xt(){let e=B();return H({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/repos/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function St(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/repos/${e}/fetch`),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Ct(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/projects`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function wt(){let e=B();return H({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/projects/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function Tt(e,t){return V({queryKey:[`scratchpad`,e,t??`none`],queryFn:()=>i(`GET`,`/api/scratchpad?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function Et(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/scratchpad`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Dt(){let e=B();return H({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/scratchpad/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Ot(){let e=B();return H({mutationFn:e=>i(`DELETE`,`/api/scratchpad/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function kt(e,t){return V({queryKey:[`layouts`,e,t??`none`],queryFn:()=>i(`GET`,`/api/layouts?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function At(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/layouts`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function jt(){let e=B();return H({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/layouts/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Mt(){let e=B();return H({mutationFn:e=>i(`DELETE`,`/api/layouts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function G(e,t){e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`project`,t.project_id]})}function Nt(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/sessions`,e),onSuccess:t=>G(e,t)})}function Pt(e){let t=B();return H({mutationFn:t=>i(`POST`,`/api/sessions/${t}/${e}`),onSuccess:e=>G(t,e)})}function Ft(){let e=B();return H({mutationFn:({sessionId:e,accountId:t})=>i(`POST`,`/api/sessions/${e}/migrate`,{account_id:t}),onSuccess:t=>G(e,t)})}function It(){let e=B();return H({mutationFn:({sessionId:e,accountId:t})=>i(`POST`,`/api/sessions/${e}/handoff`,{account_id:t}),onSuccess:(t,{sessionId:n})=>{G(e,t),e.invalidateQueries({queryKey:[`session`,n]})}})}function Lt(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/sessions/${e}/archive`),onSuccess:t=>G(e,t)})}function Rt(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/sessions/${e}/unarchive`),onSuccess:t=>G(e,t)})}function zt(){let e=B();return H({mutationFn:({sessionId:e,title:t})=>i(`PATCH`,`/api/sessions/${e}`,{title:t}),onSuccess:t=>G(e,t)})}function Bt(){let e=B();return H({mutationFn:e=>i(`PATCH`,`/api/config`,e),onSuccess:(t,n)=>{e.setQueryData([`config`],t),`displayName`in n&&e.invalidateQueries({queryKey:[`host`]})}})}async function Vt(e){try{return await i(`GET`,`/api/profiles/${e}/state`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`no_state`)return null;throw e}}function Ht(e,t){return i(`PUT`,`/api/profiles/${e}/state`,{ui_state:t})}function Ut(e,t){return V({queryKey:[`ports`,e],queryFn:()=>i(`GET`,`/api/sessions/${e}/ports`),enabled:e!==void 0&&t,refetchInterval:W(5e3),refetchIntervalInBackground:!1})}function Wt(e,t){return V({queryKey:[`session-env`,e],queryFn:()=>i(`GET`,`/api/sessions/${e}/env`),enabled:e!==void 0&&t,refetchInterval:W(5e3),refetchIntervalInBackground:!1})}function Gt(){let e=B();return H({mutationFn:e=>i(`DELETE`,`/api/sessions/${e}/env`),onSuccess:(t,n)=>{e.setQueryData([`session-env`,n],{vars:[]})}})}var K=n(`puddle.profile-id`);function Kt(){let e=(0,z.useSyncExternalStore)(K.subscribe,K.get);return e!==null&&/^[0-9a-f]{10}$/.test(e)?e:null}function qt(e){window.location.pathname!==`/`&&window.history.replaceState(null,``,`/`),K.set(e)}function q(){return window.puddleDesktop}function Jt(){let[e,t]=(0,z.useState)({fullScreen:!1,animate:!1});return(0,z.useEffect)(()=>{let e=q();if(!e)return;let n=!0;e.isFullScreen?.()?.then(e=>{n&&t({fullScreen:e,animate:!1})});let r=e.onFullScreenChange?.(e=>t({fullScreen:e,animate:!0}));return()=>{n=!1,r?.()}},[]),e}var Yt=[`Layout & tabs`,`Editor`,`Left sidebar`,`Right sidebar`],J=[{id:`palette.toggle`,label:`Command palette`,group:`Layout & tabs`,defaultBinding:`meta+KeyK`},{id:`tab.close`,label:`Close current tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyW`,desktopBinding:`meta+KeyW`},{id:`tab.reopen`,label:`Reopen last closed tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyT`,desktopBinding:`shift+meta+KeyT`},{id:`tab.newUntitled`,label:`New untitled file`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyN`,desktopBinding:`meta+KeyN`},{id:`tab.next`,label:`Next tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketRight`,desktopBinding:`ctrl+Tab`},{id:`tab.prev`,label:`Previous tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketLeft`,desktopBinding:`ctrl+shift+Tab`},{id:`window.close`,label:`Close window`,group:`Layout & tabs`,defaultBinding:`meta+KeyW`,desktopBinding:`shift+meta+KeyW`},{id:`sidebar.left`,label:`Toggle left sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Comma`,desktopBinding:`meta+KeyB`},{id:`sidebar.right`,label:`Toggle right sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Period`,desktopBinding:`shift+meta+KeyB`},{id:`editor.save`,label:`Save`,group:`Editor`,defaultBinding:`meta+KeyS`,editor:!0},{id:`editor.wordWrap`,label:`Toggle word wrap`,group:`Editor`,defaultBinding:`alt+KeyZ`,editor:!0},{id:`nav.files`,label:`Open Files`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyE`},{id:`nav.search`,label:`Open Search`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyF`},{id:`nav.changes`,label:`Open Changes`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyV`},{id:`nav.worktrees`,label:`Open Worktrees`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyB`},{id:`session.newAgent`,label:`New agent`,group:`Right sidebar`,defaultBinding:`ctrl+alt+Backquote`,desktopBinding:`meta+KeyT`},{id:`session.newTerminal`,label:`New terminal`,group:`Right sidebar`,defaultBinding:`ctrl+Backquote`},{id:`scratchpad.toggle`,label:`Toggle Scratchpad`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyS`},{id:`layouts.toggle`,label:`Toggle Layouts`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyL`}],Xt=new Map(J.map(e=>[e.id,e])),Zt=typeof window<`u`&&q()!==void 0;function Y(e,t=Zt){return t&&e.desktopBinding?e.desktopBinding:e.defaultBinding}function Qt(e){let t=e.code;if(!t||/^(Control|Alt|Shift|Meta)(Left|Right)$/.test(t))return null;let n=[];return e.ctrlKey&&n.push(`ctrl`),e.altKey&&n.push(`alt`),e.shiftKey&&n.push(`shift`),e.metaKey&&n.push(`meta`),n.length===0?null:(n.push(t),n.join(`+`))}var $t={ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`},en={Comma:`,`,Period:`.`,Backquote:"`",Slash:`/`,Backslash:`\\`,Minus:`-`,Equal:`=`,Space:`␣`,Enter:`↵`,Escape:`Esc`,Tab:`⇥`,BracketLeft:`[`,BracketRight:`]`};function tn(e){return e.startsWith(`Key`)?e.slice(3):e.startsWith(`Digit`)?e.slice(5):en[e]??e}function nn(e){if(!e)return`—`;let t=e.split(`+`),n=t.pop()??``;return t.map(e=>$t[e]??e).join(``)+tn(n)}var X=new Map;function rn(e,t){return X.set(e,t),()=>{X.get(e)===t&&X.delete(e)}}var an=e=>X.get(e),on=e=>Xt.get(e);function sn(e,t){return e.id===`editor.save`||t&&e.editor!==!0}var cn={},Z=new Set,Q=$();function $(){let e={};for(let t of J)e[t.id]=cn[t.id]||Y(t);return e}function ln(e){cn=e??{},Q=$(),Z.forEach(e=>e())}var un=e=>Q[e]??``;function dn(e){for(let[t,n]of Object.entries(Q))if(n===e)return t}function fn(e){return nn(pn()[e]??``)}function pn(){return(0,z.useSyncExternalStore)(e=>(Z.add(e),()=>Z.delete(e)),()=>Q)}export{jt as $,nt as A,_e as At,ot as B,h as Bt,Ze as C,He as Ct,et as D,ye as Dt,dt as E,we as Et,bt as F,y as Ft,St as G,gt as H,o as Ht,Et as I,v as It,kt as J,It as K,Nt as L,_ as Lt,At as M,A as Mt,ft as N,f as Nt,Lt as O,ve as Ot,Ct as P,b as Pt,Bt as Q,ct as R,d as Rt,Ht as S,V as St,Ke as T,B as Tt,Ot as U,a as Ut,Mt as V,E as Vt,st as W,Ft as X,yt as Y,ht as Z,qt as _,Ut as _t,nn as a,Ge as at,Vt as b,W as bt,un as c,Ye as ct,ln as d,rt as dt,mt as et,Y as f,it as ft,K as g,Wt as gt,Jt as h,Pt as ht,Qt as i,Dt as it,vt as j,j as jt,Gt as k,ge as kt,sn as l,at as lt,q as m,Tt as mt,Yt as n,wt as nt,on as o,We as ot,fn as p,Je as pt,lt as q,dn as r,xt as rt,an as s,Xe as st,J as t,pt as tt,rn as u,zt as ut,Kt as v,Qe as vt,qe as w,ke as wt,ut as x,H as xt,tt as y,Rt as yt,_t as z,x as zt};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{b as n,n as r}from"./index-BLx1AR0-.js";import{i}from"./dist-3tmIo7Ja.js";var a=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},o=new class extends a{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},s={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},c=new class{#e=s;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function l(e){setTimeout(e,0)}var u=typeof window>`u`||`Deno`in globalThis;function d(){}function f(e,t){return typeof e==`function`?e(t):e}function p(e){return typeof e==`number`&&e>=0&&e!==1/0}function m(e,t){return Math.max(e+(t||0)-Date.now(),0)}function h(e,t){return typeof e==`function`?e(t):e}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==y(o,t.options))return!1}else if(!x(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function v(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(b(t.options.mutationKey)!==b(a))return!1}else if(!x(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function y(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function x(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>x(e[n],t[n])):!1}var S=Object.prototype.hasOwnProperty;function ee(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=te(e)&&te(t);if(!r&&!(w(e)&&w(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:S.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ee(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function C(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function te(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!ne(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ne(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ne(e){return Object.prototype.toString.call(e)===`[object Object]`}function re(e){return new Promise(t=>{c.setTimeout(t,e)})}function T(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ee(e,t)}function ie(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ae(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var E=Symbol();function oe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===E?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function D(e,t){return typeof e==`function`?e(...t):!!e}function se(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var O=(()=>{let e=()=>u;return{isServer(){return e()},setIsServer(t){e=t}}})();function k(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ce=l;function le(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ce,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var A=le(),j=new class extends a{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ue(e){return Math.min(1e3*2**e,3e4)}function de(e){return(e??`online`)!==`online`||j.isOnline()}var M=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function fe(e){let t=!1,n=0,r,i=k(),a=()=>i.status!==`pending`,s=t=>{if(!a()){let n=new M(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>o.isFocused()&&(e.networkMode===`always`||j.isOnline())&&e.canRun(),d=()=>de(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(O.isServer()?0:3),o=e.retryDelay??ue,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),re(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var pe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),p(this.gcTime)&&(this.#e=c.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(O.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(c.clearTimeout(this.#e),this.#e=void 0)}};function me(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{se(e,()=>t.signal,()=>n=!0)},u=oe(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ae:ie;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?he:N,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:N(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function N(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function he(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function ge(e,t){return t?N(e,t)!=null:!1}function _e(e,t){return!t||!e.getPreviousPageParam?!1:he(e,t)!=null}var ve=class extends pe{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=I(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=I(this.options);e.data!==void 0&&(this.setState(F(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=T(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(d).catch(d):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>g(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===E||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>h(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!m(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=oe(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?me(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=fe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof M&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof M){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...P(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...F(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),A.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function P(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:de(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function F(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function I(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ye=class extends a{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=k(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),xe(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof g(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!C(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Se(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ce(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(d)),t}#g(){this.#b();let e=h(this.options.staleTime,this.#t);if(O.isServer()||this.#r.isStale||!p(e))return;let t=m(this.#r.dataUpdatedAt,e)+1;this.#d=c.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(O.isServer()||g(this.options.enabled,this.#t)===!1||!p(this.#p)||this.#p===0)&&(this.#f=c.setInterval(()=>{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(c.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(c.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&xe(e,t),o=i&&Se(e,n,t,r);(a||o)&&(l={...l,...P(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=T(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=T(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:R(e,t),refetch:this.refetch,promise:this.#o,isEnabled:g(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=k();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!C(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){A.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function be(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&g(t.retryOnMount,e)===!1)}function xe(e,t){return be(e,t)||e.state.data!==void 0&&L(e,t,t.refetchOnMount)}function L(e,t,n){if(g(t.enabled,e)!==!1&&h(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&R(e,t)}return!1}function Se(e,t,n,r){return(e!==t||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&R(e,n)}function R(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(h(t.staleTime,e))}function Ce(e,t){return!C(e.getCurrentResult(),t)}var we=class extends pe{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Te(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=fe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),A.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Te(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ee=class extends a{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),C(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&b(t.mutationKey)!==b(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Te();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){A.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},z=e(t(),1),De=r(),Oe=z.createContext(void 0),B=e=>{let t=z.useContext(Oe);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ke=({client:e,children:t})=>(z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,De.jsx)(Oe.Provider,{value:e,children:t})),Ae=z.createContext(!1),je=()=>z.useContext(Ae);Ae.Provider;function Me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ne=z.createContext(Me()),Pe=()=>z.useContext(Ne),Fe=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?D(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ie=e=>{z.useEffect(()=>{e.clearReset()},[e])},Le=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||D(n,[e.error,r])),Re=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ze=(e,t)=>e.isLoading&&e.isFetching&&!t,Be=(e,t)=>e?.suspense&&t.isPending,Ve=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function He(e,t,n){let r=je(),i=Pe(),a=B(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Re(o),Fe(o,i,s),Ie(i);let l=!a.getQueryCache().get(o.queryHash),[u]=z.useState(()=>new t(a,o)),f=u.getOptimisticResult(o),p=!r&&c;if(z.useSyncExternalStore(z.useCallback(e=>{let t=p?u.subscribe(A.batchCalls(e)):d;return u.updateResult(),t},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),z.useEffect(()=>{u.setOptions(o)},[o,u]),Be(o,f))throw Ve(o,u,i);if(Le({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!O.isServer()&&ze(f,r)&&(l?Ve(o,u,i):s?.promise)?.catch(d).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?f:u.trackResult(f)}function V(e,t){return He(e,ye,t)}function H(e,t){let n=B(t),[r]=z.useState(()=>new Ee(n,e));z.useEffect(()=>{r.setOptions(e)},[r,e]);let i=z.useSyncExternalStore(z.useCallback(e=>r.subscribe(A.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=z.useCallback((e,t)=>{r.mutate(e,t).catch(d)},[r]);if(i.error&&D(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ue=12,U=typeof document<`u`?document.hasFocus():!0;typeof window<`u`&&(window.addEventListener(`focus`,()=>{U=!0}),window.addEventListener(`blur`,()=>{U=!1}),o.setEventListener(e=>{let t=()=>e(void 0);return window.addEventListener(`visibilitychange`,t,!1),window.addEventListener(`focus`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}}));function W(e){return()=>U?e:e*Ue}function We(){return V({queryKey:[`profiles`],queryFn:()=>i(`GET`,`/api/profiles`)})}function Ge(e){return V({queryKey:[`profile-settings`,e],queryFn:()=>i(`GET`,`/api/profiles/${e}/settings`),enabled:e!==void 0})}function Ke(e){return V({queryKey:[`accounts`,e],queryFn:()=>i(`GET`,`/api/accounts?profile=${e}`),enabled:e!==void 0})}function qe(e){return V({queryKey:[`account-usage`,e],queryFn:()=>i(`GET`,`/api/accounts/${e}/usage`),enabled:e!==void 0,staleTime:15e3})}function Je(){return V({queryKey:[`repos`],queryFn:()=>i(`GET`,`/api/repos`)})}function Ye(e,t=!0){return V({queryKey:[`projects`,e??`all`],queryFn:()=>i(`GET`,e===void 0?`/api/projects`:`/api/projects?profile=${e}`),enabled:t})}function Xe(e){return V({queryKey:[`project`,e],queryFn:()=>i(`GET`,`/api/projects/${e}`),enabled:e!==void 0,placeholderData:e=>e})}function Ze(e){return i(`POST`,`/api/projects/${e}/conversations/refresh`)}function Qe(e){return V({queryKey:[`sessions`,e],queryFn:()=>i(`GET`,`/api/sessions?project=${e}`),enabled:e!==void 0})}var $e={queryKey:[`sessions`,`all`],queryFn:()=>i(`GET`,`/api/sessions`)};function et(e=!0){return V({...$e,enabled:e})}function tt(e){return e.fetchQuery($e)}function nt(){return V({queryKey:[`config`],queryFn:()=>i(`GET`,`/api/config`)})}function rt(e){return V({queryKey:[`repo-branches`,e],queryFn:()=>i(`GET`,`/api/repos/${e}/branches`),enabled:e!==void 0,staleTime:3e4})}function it(e){return V({queryKey:[`repo-worktrees`,e],queryFn:()=>i(`GET`,`/api/repos/${e}/worktrees`),enabled:e!==void 0,staleTime:1e4})}function at(e,t){let n=B();return H({mutationFn:t=>i(`DELETE`,`/api/repos/${e}/worktrees?path=${encodeURIComponent(t)}`),onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function ot(e,t){let n=B();return H({mutationFn:({name:t,confirm:n})=>{let r=new URLSearchParams({name:t});return n&&r.set(`confirm`,`1`),i(`DELETE`,`/api/repos/${e}/branches?${r.toString()}`)},onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function st(e){return V({queryKey:[`fs-dirs`,e],queryFn:()=>i(`GET`,`/api/fs/dirs?prefix=${encodeURIComponent(e)}`),enabled:e.startsWith(`/`)||e.startsWith(`~`),placeholderData:e=>e,staleTime:1e4})}function ct(){return V({queryKey:[`version`],queryFn:()=>i(`GET`,`/api/version`),staleTime:1/0})}function lt(){return V({queryKey:[`host`],queryFn:()=>i(`GET`,`/api/host`),staleTime:1/0})}function ut(e){return e?e.displayName||e.hostname:void 0}function dt(){return V({queryKey:[`agents`],queryFn:()=>i(`GET`,`/api/agents`),staleTime:3e4,refetchOnWindowFocus:!0})}function ft(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/profiles`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function pt(e){let t=B();return H({mutationFn:t=>i(`PATCH`,`/api/profiles/${e}/settings`,t),onSuccess:n=>t.setQueryData([`profile-settings`,e],n)})}function mt(){let e=B();return H({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/profiles/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function ht(){let e=B();return H({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/accounts/${e}`,t),onSuccess:t=>{e.invalidateQueries({queryKey:[`accounts`,t.profile_id]}),e.invalidateQueries({queryKey:[`account-usage`,t.id]})}})}function gt(){let e=B();return H({mutationFn:e=>i(`DELETE`,`/api/profiles/${e}`),onSuccess:()=>e.clear()})}function _t(){let e=B();return H({mutationFn:e=>i(`DELETE`,`/api/accounts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`accounts`]})})}function vt(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/accounts`,e),onSuccess:t=>void e.invalidateQueries({queryKey:[`accounts`,t.profile_id]})})}function yt(){return H({mutationFn:e=>i(`POST`,`/api/accounts/${e}/login`)})}function bt(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/repos`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function xt(){let e=B();return H({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/repos/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function St(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/repos/${e}/fetch`),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function Ct(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/projects`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function wt(){let e=B();return H({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/projects/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function Tt(e,t){return V({queryKey:[`scratchpad`,e,t??`none`],queryFn:()=>i(`GET`,`/api/scratchpad?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function Et(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/scratchpad`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Dt(){let e=B();return H({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/scratchpad/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Ot(){let e=B();return H({mutationFn:e=>i(`DELETE`,`/api/scratchpad/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function kt(e,t){return V({queryKey:[`layouts`,e,t??`none`],queryFn:()=>i(`GET`,`/api/layouts?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function At(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/layouts`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function jt(){let e=B();return H({mutationFn:({id:e,...t})=>i(`PATCH`,`/api/layouts/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Mt(){let e=B();return H({mutationFn:e=>i(`DELETE`,`/api/layouts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function G(e,t){e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`project`,t.project_id]})}function Nt(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/sessions`,e),onSuccess:t=>G(e,t)})}function Pt(e){let t=B();return H({mutationFn:t=>i(`POST`,`/api/sessions/${t}/${e}`),onSuccess:e=>G(t,e)})}function Ft(){let e=B();return H({mutationFn:({sessionId:e,accountId:t})=>i(`POST`,`/api/sessions/${e}/migrate`,{account_id:t}),onSuccess:t=>G(e,t)})}function It(){let e=B();return H({mutationFn:({sessionId:e,accountId:t})=>i(`POST`,`/api/sessions/${e}/handoff`,{account_id:t}),onSuccess:(t,{sessionId:n})=>{G(e,t),e.invalidateQueries({queryKey:[`session`,n]})}})}function Lt(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/sessions/${e}/archive`),onSuccess:t=>G(e,t)})}function Rt(){let e=B();return H({mutationFn:e=>i(`POST`,`/api/sessions/${e}/unarchive`),onSuccess:t=>G(e,t)})}function zt(){let e=B();return H({mutationFn:({sessionId:e,title:t})=>i(`PATCH`,`/api/sessions/${e}`,{title:t}),onSuccess:t=>G(e,t)})}function Bt(){let e=B();return H({mutationFn:e=>i(`PATCH`,`/api/config`,e),onSuccess:(t,n)=>{e.setQueryData([`config`],t),`displayName`in n&&e.invalidateQueries({queryKey:[`host`]})}})}async function Vt(e){try{return await i(`GET`,`/api/profiles/${e}/state`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`no_state`)return null;throw e}}function Ht(e,t){return i(`PUT`,`/api/profiles/${e}/state`,{ui_state:t})}function Ut(e,t){return V({queryKey:[`ports`,e],queryFn:()=>i(`GET`,`/api/sessions/${e}/ports`),enabled:e!==void 0&&t,refetchInterval:W(5e3),refetchIntervalInBackground:!1})}function Wt(e,t){return V({queryKey:[`session-env`,e],queryFn:()=>i(`GET`,`/api/sessions/${e}/env`),enabled:e!==void 0&&t,refetchInterval:W(5e3),refetchIntervalInBackground:!1})}function Gt(){let e=B();return H({mutationFn:e=>i(`DELETE`,`/api/sessions/${e}/env`),onSuccess:(t,n)=>{e.setQueryData([`session-env`,n],{vars:[]})}})}var K=n(`puddle.profile-id`);function Kt(){let e=(0,z.useSyncExternalStore)(K.subscribe,K.get);return e!==null&&/^[0-9a-f]{10}$/.test(e)?e:null}function qt(e){window.location.pathname!==`/`&&window.history.replaceState(null,``,`/`),K.set(e)}function q(){return window.puddleDesktop}function Jt(){let[e,t]=(0,z.useState)({fullScreen:!1,animate:!1});return(0,z.useEffect)(()=>{let e=q();if(!e)return;let n=!0;e.isFullScreen?.()?.then(e=>{n&&t({fullScreen:e,animate:!1})});let r=e.onFullScreenChange?.(e=>t({fullScreen:e,animate:!0}));return()=>{n=!1,r?.()}},[]),e}var Yt=[`Layout & tabs`,`Editor`,`Left sidebar`,`Right sidebar`],J=[{id:`palette.toggle`,label:`Command palette`,group:`Layout & tabs`,defaultBinding:`meta+KeyK`},{id:`tab.close`,label:`Close current tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyW`,desktopBinding:`meta+KeyW`},{id:`tab.reopen`,label:`Reopen last closed tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyT`,desktopBinding:`shift+meta+KeyT`},{id:`tab.newUntitled`,label:`New untitled file`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyN`,desktopBinding:`meta+KeyN`},{id:`tab.next`,label:`Next tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketRight`,desktopBinding:`ctrl+Tab`},{id:`tab.prev`,label:`Previous tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketLeft`,desktopBinding:`ctrl+shift+Tab`},{id:`window.close`,label:`Close window`,group:`Layout & tabs`,defaultBinding:`meta+KeyW`,desktopBinding:`shift+meta+KeyW`},{id:`sidebar.left`,label:`Toggle left sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Comma`,desktopBinding:`meta+KeyB`},{id:`sidebar.right`,label:`Toggle right sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Period`,desktopBinding:`shift+meta+KeyB`},{id:`editor.save`,label:`Save`,group:`Editor`,defaultBinding:`meta+KeyS`,editor:!0},{id:`editor.wordWrap`,label:`Toggle word wrap`,group:`Editor`,defaultBinding:`alt+KeyZ`,editor:!0},{id:`nav.files`,label:`Open Files`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyE`},{id:`nav.search`,label:`Open Search`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyF`},{id:`nav.changes`,label:`Open Changes`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyV`},{id:`nav.worktrees`,label:`Open Worktrees`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyB`},{id:`session.newAgent`,label:`New agent`,group:`Right sidebar`,defaultBinding:`ctrl+alt+Backquote`,desktopBinding:`meta+KeyT`},{id:`session.newTerminal`,label:`New terminal`,group:`Right sidebar`,defaultBinding:`ctrl+Backquote`},{id:`scratchpad.toggle`,label:`Toggle Scratchpad`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyS`},{id:`layouts.toggle`,label:`Toggle Layouts`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyL`}],Xt=new Map(J.map(e=>[e.id,e])),Zt=typeof window<`u`&&q()!==void 0;function Y(e,t=Zt){return t&&e.desktopBinding?e.desktopBinding:e.defaultBinding}function Qt(e){let t=e.code;if(!t||/^(Control|Alt|Shift|Meta)(Left|Right)$/.test(t))return null;let n=[];return e.ctrlKey&&n.push(`ctrl`),e.altKey&&n.push(`alt`),e.shiftKey&&n.push(`shift`),e.metaKey&&n.push(`meta`),n.length===0?null:(n.push(t),n.join(`+`))}var $t={ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`},en={Comma:`,`,Period:`.`,Backquote:"`",Slash:`/`,Backslash:`\\`,Minus:`-`,Equal:`=`,Space:`␣`,Enter:`↵`,Escape:`Esc`,Tab:`⇥`,BracketLeft:`[`,BracketRight:`]`};function tn(e){return e.startsWith(`Key`)?e.slice(3):e.startsWith(`Digit`)?e.slice(5):en[e]??e}function nn(e){if(!e)return`—`;let t=e.split(`+`),n=t.pop()??``;return t.map(e=>$t[e]??e).join(``)+tn(n)}var X=new Map;function rn(e,t){return X.set(e,t),()=>{X.get(e)===t&&X.delete(e)}}var an=e=>X.get(e),on=e=>Xt.get(e);function sn(e,t){return e.id===`editor.save`||t&&e.editor!==!0}var cn={},Z=new Set,Q=$();function $(){let e={};for(let t of J)e[t.id]=cn[t.id]||Y(t);return e}function ln(e){cn=e??{},Q=$(),Z.forEach(e=>e())}var un=e=>Q[e]??``;function dn(e){for(let[t,n]of Object.entries(Q))if(n===e)return t}function fn(e){return nn(pn()[e]??``)}function pn(){return(0,z.useSyncExternalStore)(e=>(Z.add(e),()=>Z.delete(e)),()=>Q)}export{jt as $,nt as A,_e as At,ot as B,h as Bt,Ze as C,He as Ct,et as D,ye as Dt,dt as E,we as Et,bt as F,y as Ft,St as G,gt as H,o as Ht,Et as I,v as It,kt as J,It as K,Nt as L,_ as Lt,At as M,A as Mt,ft as N,f as Nt,Lt as O,ve as Ot,Ct as P,b as Pt,Bt as Q,ct as R,d as Rt,Ht as S,V as St,Ke as T,B as Tt,Ot as U,a as Ut,Mt as V,E as Vt,st as W,Ft as X,yt as Y,ht as Z,qt as _,Ut as _t,nn as a,Ge as at,Vt as b,W as bt,un as c,Ye as ct,ln as d,rt as dt,mt as et,Y as f,it as ft,K as g,Wt as gt,Jt as h,Pt as ht,Qt as i,Dt as it,vt as j,j as jt,Gt as k,ge as kt,sn as l,at as lt,q as m,Tt as mt,Yt as n,wt as nt,on as o,We as ot,fn as p,Je as pt,lt as q,dn as r,xt as rt,an as s,Xe as st,J as t,pt as tt,rn as u,zt as ut,Kt as v,Qe as vt,qe as w,ke as wt,ut as x,H as xt,tt as y,Rt as yt,_t as z,x as zt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./editor.api2-4X9Vh9Zw.js";import{h as t}from"./buffer-store
|
|
1
|
+
import{h as e}from"./editor.api2-4X9Vh9Zw.js";import{h as t}from"./buffer-store--4yU4YqM.js";import{_ as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y}from"./lspLanguageFeatures-x2nWJpem.js";var b=120*1e3,x=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>b&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=t({moduleId:`vs/language/html/htmlWorker`,createWorker:()=>new Worker(new URL(`/assets/html.worker-DSJ9zmd7.js`,``+import.meta.url),{type:`module`}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}},S=class extends _{constructor(e){super(e,[`.`,`:`,`<`,`"`,`=`,`/`])}};function C(t){let n=new x(t),o=(...e)=>n.getLanguageServiceWorker(...e),s=t.languageId;e.registerCompletionItemProvider(s,new S(o)),e.registerHoverProvider(s,new a(o)),e.registerDocumentHighlightProvider(s,new p(o)),e.registerLinkProvider(s,new g(o)),e.registerFoldingRangeProvider(s,new v(o)),e.registerDocumentSymbolProvider(s,new u(o)),e.registerSelectionRangeProvider(s,new d(o)),e.registerRenameProvider(s,new m(o)),s===`html`&&(e.registerDocumentFormattingEditProvider(s,new r(o)),e.registerDocumentRangeFormattingEditProvider(s,new i(o)))}function w(t){let n=[],o=[],s=new x(t);n.push(s);let c=(...e)=>s.getLanguageServiceWorker(...e);function l(){let{languageId:n,modeConfiguration:s}=t;E(o),s.completionItems&&o.push(e.registerCompletionItemProvider(n,new S(c))),s.hovers&&o.push(e.registerHoverProvider(n,new a(c))),s.documentHighlights&&o.push(e.registerDocumentHighlightProvider(n,new p(c))),s.links&&o.push(e.registerLinkProvider(n,new g(c))),s.documentSymbols&&o.push(e.registerDocumentSymbolProvider(n,new u(c))),s.rename&&o.push(e.registerRenameProvider(n,new m(c))),s.foldingRanges&&o.push(e.registerFoldingRangeProvider(n,new v(c))),s.selectionRanges&&o.push(e.registerSelectionRangeProvider(n,new d(c))),s.documentFormattingEdits&&o.push(e.registerDocumentFormattingEditProvider(n,new r(c))),s.documentRangeFormattingEdits&&o.push(e.registerDocumentRangeFormattingEditProvider(n,new i(c)))}return l(),n.push(T(o)),T(n)}function T(e){return{dispose:()=>E(e)}}function E(e){for(;e.length;)e.pop().dispose()}export{_ as CompletionAdapter,f as DefinitionAdapter,h as DiagnosticsAdapter,l as DocumentColorAdapter,r as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,g as DocumentLinkAdapter,i as DocumentRangeFormattingEditProvider,u as DocumentSymbolAdapter,v as FoldingRangeAdapter,a as HoverAdapter,o as ReferenceAdapter,m as RenameAdapter,d as SelectionRangeAdapter,x as WorkerManager,c as fromPosition,s as fromRange,w as setupMode,C as setupMode1,n as toRange,y as toTextEdit};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-CzuHShdO.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-CZI7_Jkm.js","assets/dist-3tmIo7Ja.js","assets/hotkeys-DbIEec2f.js","assets/project-abbrev-BU2DBpdq.js","assets/createLucideIcon-DyMAgLa3.js","assets/dialog-CAMTxigV.js","assets/button-DehrlYw7.js","assets/x-CZCUod6A.js","assets/LazyTerminal-BYbPpGEI.js","assets/switch-CN9NW-du.js","assets/use-ui-state-CzR7YpWb.js","assets/preview-kind-QJSMKfUN.js","assets/debounce-B9DrqirV.js","assets/notification-permission-CG2r3Oi8.js","assets/copy-CGsu8426.js","assets/NewProjectDialog-D3bNK3u_.js","assets/use-debounced-value-C86N-mOK.js","assets/protocol-support-C1NCVjbV.js","assets/ws-C-kvwpeD.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{r as e,t}from"./rolldown-runtime-QTnfLwEv.js";import{t as n}from"./react-CZI7_Jkm.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function ee(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function te(e){if(h=!1,ee(e),!m)if(n(c)!==null)m=!0,b||(b=!0,se());else{var t=n(l);t!==null&&ue(te,t.startTime-e)}}var b=!1,ne=-1,re=5,ie=-1;function ae(){return g?!0:!(e.unstable_now()-ie<re)}function oe(){if(g=!1,b){var t=e.unstable_now();ie=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(ne),ne=-1),p=!0;var a=f;try{b:{for(ee(t),d=n(c);d!==null&&!(d.expirationTime>t&&ae());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,ee(t),i=!0;break b}d===n(c)&&r(c),ee(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ue(te,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?se():b=!1}}}var se;if(typeof y==`function`)se=function(){y(oe)};else if(typeof MessageChannel<`u`){var ce=new MessageChannel,le=ce.port2;ce.port1.onmessage=oe,se=function(){le.postMessage(null)}}else se=function(){_(oe,0)};function ue(t,n){ne=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):re=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(ne),ne=-1):h=!0,ue(te,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,b||(b=!0,se()))),r},e.unstable_shouldYield=ae,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),i=t(((e,t)=>{t.exports=r()})),a=t((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),o=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=a()})),s=t((e=>{var t=i(),r=n(),a=o();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),te=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),ne=Symbol.for(`react.context`),re=Symbol.for(`react.forward_ref`),ie=Symbol.for(`react.suspense`),ae=Symbol.for(`react.suspense_list`),oe=Symbol.for(`react.memo`),se=Symbol.for(`react.lazy`),ce=Symbol.for(`react.activity`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.iterator;function de(e){return typeof e!=`object`||!e?null:(e=ue&&e[ue]||e[`@@iterator`],typeof e==`function`?e:null)}var fe=Symbol.for(`react.client.reference`);function pe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case te:return`Profiler`;case ee:return`StrictMode`;case ie:return`Suspense`;case ae:return`SuspenseList`;case ce:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case ne:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case re:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case oe:return t=e.displayName||null,t===null?pe(e.type)||`Memo`:t;case se:t=e._payload,e=e._init;try{return pe(e(t))}catch{}}return null}var x=Array.isArray,S=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,C=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},he=[],ge=-1;function _e(e){return{current:e}}function ve(e){0>ge||(e.current=he[ge],he[ge]=null,ge--)}function w(e,t){ge++,he[ge]=e.current,e.current=t}var ye=_e(null),be=_e(null),xe=_e(null),Se=_e(null);function Ce(e,t){switch(w(xe,t),w(be,e),w(ye,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ve(ye),w(ye,e)}function we(){ve(ye),ve(be),ve(xe)}function Te(e){e.memoizedState!==null&&w(Se,e);var t=ye.current,n=Hd(t,e.type);t!==n&&(w(be,e),w(ye,n))}function Ee(e){be.current===e&&(ve(ye),ve(be)),Se.current===e&&(ve(Se),Qf._currentValue=me)}var De,Oe;function ke(e){if(De===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);De=t&&t[1]||``,Oe=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+De+e+Oe}var Ae=!1;function je(e,t){if(!e||Ae)return``;Ae=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -79,4 +79,4 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
79
79
|
3. Apply what the rules above settle without asking. Ask the user about anything they leave open, stating trade-offs where relevant (e.g. a symlinked .venv saves gigabytes per worktree, but parallel sessions then share mutable dependency state).
|
|
80
80
|
4. If the user states a standing rule for all future worktrees ("always…", "never…", "from now on…"), write the complete updated rules to \`.puddle/onboarding-notes.md\` in this worktree — full replacement, user-owned prose; record their decision, don't invent policy.
|
|
81
81
|
|
|
82
|
-
Then proceed with the task below (or await instructions if none is given).`,Do=`[puddle] You are joining an existing branch and worktree that other agents may be working in concurrently. Files can change underneath you, so re-check the working tree before you act, and avoid disruptive git operations (resetting, force-pushing, or deleting the branch) that would disrupt work already in progress by others.`,Oo=`This session was interrupted (daemon or machine restart). Processes you started are gone; re-verify your environment before continuing.`,ko=[[`name`,`the resolved display name: user rename, else agent name, else sequence, else id`],[`title`,`the user rename override only (empty when unset)`],[`agentName`,`the agent's own session name (empty when the agent has not named it)`],[`sequence`,`the terminal-title name the process set (empty when it set none)`],[`branch`,`the git branch`],[`cwd`,`the worktree directory's name`],[`id`,`the first 8 characters of the session id`],[`status`,`the session status (running, waiting_input, …)`],[`agent`,`the agent type (empty for terminal sessions)`],[`separator`,`an em dash that appears only between two non-empty neighbours`]],Ao="${name}",jo=[`navy`,`gold`,`blue`,`green`,`red`,`violet`,`cyan`];I({id:So,name:wo,branch_prefix:j(),icon:j().nullable().default(null),icon_colour:j().nullable().default(null),created_at:vo}),I({name:wo,branch_prefix:j().max(64).optional()}),I({name:wo.optional(),branch_prefix:j().max(64).optional(),icon:j().max(64).nullable().optional(),icon_colour:j().max(32).nullable().optional()});var Mo=Fa({baseBranch:j().optional(),separateBranch:P().optional(),separateWorktree:P().optional()}),No=Fa({agent:Mo.optional(),terminal:Mo.optional()});Fa({allowSkipPermissions:P().default(!1),captureSessionEnv:P().default(!0),terminalAppShortcuts:P().default(!0),onboardingTemplate:j().optional(),concurrentTemplate:j().optional(),restartTemplate:j().optional(),tabTitleTemplate:j().optional(),projectOrder:F(j()).optional(),sessionDefaults:No.optional(),hotkeys:Ua(j(),j()).optional()}),Ua(j(),Aa());var Po=j().regex(/^untitled-\d+\.md$/);I({name:Po}),I({name:Po,content:j(),mtime_ms:N()}),I({content:j()}),I({mtime_ms:N()}),I({id:yo,profile_id:So,agent_type:j(),label:j(),config_dir:j(),skip_permissions_default:P(),logged_in:P(),created_at:vo}),I({profile_id:So,agent_type:j().min(1),label:wo,skip_permissions_default:P().optional(),import_dir:j().min(1).optional()}),I({label:wo.optional(),skip_permissions_default:P().optional()}),I({stream:j(),term:j(),hint:j().optional()}),Fa({account_id:yo,logged_in:P(),session_count:N().int().nonnegative(),active_session_count:N().int().nonnegative(),last_activity_at:vo.nullable(),agent_usage:I({input_tokens:N().int().nonnegative(),output_tokens:N().int().nonnegative(),cache_read_input_tokens:N().int().nonnegative(),cache_creation_input_tokens:N().int().nonnegative(),message_count:N().int().nonnegative()}).nullable(),live_usage:I({captured_at:vo,context_used_percentage:N().nullable(),total_cost_usd:N().nullable(),model:j().nullable()}).nullable(),subscription:I({windows:F(I({key:j(),label:j(),used_percentage:N(),resets:j().nullable()}))}).nullable()}),I({id:j(),display_name:j(),capabilities:I({resume:P(),skip_permissions:P()}),binary:j().optional(),available:P().optional()}),I({id:yo,path:j(),default_base_branch:j(),onboarding_notes:j().nullable(),fetch_enabled:P(),last_fetched_at:vo.nullable()}).extend({orphan_worktrees:F(j())}),I({path:j().min(1),default_base_branch:j().min(1).optional(),onboarding_notes:j().nullable().optional(),fetch_enabled:P().optional()}),I({branches:F(I({name:j(),is_session:P(),session_title:j().nullable()}))});var Fo=I({path:j(),branch:j().nullable(),is_primary:P(),dirty:P().optional(),local_only:P().optional()}),Io=I({name:j(),local_only:P()});I({worktrees:F(Fo),orphan_branches:F(Io)}),I({default_base_branch:j().min(1).optional(),onboarding_notes:j().nullable().optional(),fetch_enabled:P().optional()});var Lo=L([`starting`,`running`,`waiting_input`,`exited`,`interrupted`,`archived`]),Ro=L([`agent`,`terminal`]),zo=I({id:bo,project_id:xo,account_id:yo.nullable(),worktree_path:j(),base_branch:j(),branch:j(),separate_branch:P(),kind:Ro,agent_type:j().nullable(),agent_session_ref:j().nullable(),conversation_id:yo.nullable().optional(),parent_conversation_id:yo.nullable().optional(),title:j().nullable(),agent_title:j().nullable().optional(),conversation_missing:P().optional(),branch_owner:P().optional(),native_sync:L([`pending`,`full`,`fallback`]).optional(),osc_title:j().nullable().optional(),status:Lo,cwd:j().nullable().optional(),skip_permissions:P(),created_at:vo,updated_at:vo,last_activity_at:vo.nullable(),worktree_missing:P().optional(),stale_running:P().optional(),git_summary:I({ahead:N().int().nonnegative(),behind:N().int().nonnegative(),dirty_files:N().int().nonnegative()}).nullable().optional()});I({project_id:xo,account_id:yo.optional(),kind:Ro.optional(),base_branch:j().min(1).optional(),branch:j().min(1).max(200).optional(),separate_branch:P().optional(),separate_worktree:P().optional(),join_worktree:j().optional(),cwd:j().optional(),title:j().min(1).max(200).optional(),prompt:j().optional(),skip_permissions:P().optional()}),I({title:j().max(200)}),I({account_id:yo}),I({account_id:yo}),I({vars:F(I({name:j(),bytes:N().int().nonnegative(),value:j().optional()}))}),I({cleared:N().int().nonnegative()}),I({force:P().default(!1),delete_branch:P().default(!1)});var Bo=j().min(1).max(5),Vo=I({id:xo,profile_id:So,repo_id:yo,name:j(),abbrev:Bo.nullable().default(null),archived:P().default(!1),created_at:vo,updated_at:vo});I({profile_id:So,repo_id:yo,name:j().min(1).max(100),abbrev:Bo.optional()}),I({name:j().min(1).max(100).optional(),abbrev:Bo.optional(),archived:P().optional()}),I({project:Vo,sessions:F(zo)});var Ho=L([`project`,`profile`]);I({id:yo,profile_id:So,scope:Ho,project_id:xo.nullable(),title:j().nullable(),body:j(),tags:F(j()),agent_type:j().nullable(),position:N(),created_at:vo,updated_at:vo}),I({profile_id:So,scope:Ho,project_id:xo.optional(),title:j().max(200).optional(),body:j().min(1),tags:F(j()).optional(),agent_type:j().optional()}),I({scope:Ho.optional(),project_id:xo.nullable().optional(),title:j().max(200).nullable().optional(),body:j().min(1).optional(),tags:F(j()).optional(),agent_type:j().nullable().optional(),position:N().optional()});var Uo=L([`on_demand`,`eager`]),Wo=I({session:bo,path:j().min(1),root:j().min(1).optional()}),Go=j().regex(/^[a-z][a-z0-9_-]*$/);I({providers:F(I({id:Go,display_name:j().min(1),extensions:F(j().regex(/^[a-z0-9]+$/)).min(1),input_extensions:F(j().regex(/^[a-z0-9]+$/)).min(1),available:P(),executor:j().min(1).nullable(),eager:P()}))});var Ko=I({source:Wo,provider:Go.optional(),profile_id:So.optional(),project_id:xo.optional()}),qo=I({role:j().min(1),media_type:j().min(1),file:Wo}),Jo=I({source:Wo,severity:L([`error`,`warning`,`info`]),message:j().min(1),line:N().int().positive(),column:N().int().positive().optional(),end_line:N().int().positive().optional(),end_column:N().int().positive().optional()}),Yo=I({source:Wo.optional(),output:j().optional(),diagnostics:F(Jo).optional()}),Xo=Yo.extend({message:j().min(1)}),Zo=I({provider:Go,executor:j().min(1),revision:N().int().nonnegative(),source:Wo,artifacts:F(qo),navigation:I({kind:j().min(1)}).optional()});Ko.extend({mode:Uo}),I({provider:Go,mode:Uo,state:L([`idle`,`running`,`succeeded`,`failed`]),revision:N().int().nonnegative(),result:Zo.nullable(),error:Xo.nullable()});var Qo=I({placeholder:j().regex(/^\{\{[a-z][a-z0-9_]*\}\}$/),description:j().min(1)}),$o=I({mode:Uo,run_when:L([`when_clicked`,`upon_file_change`]),default_command:j().min(1).nullable(),override_command:j().min(1).nullable()}),es=Ko.extend({profile_id:So,project_id:xo});I({provider:Go,display_name:j().min(1),file_type:j().regex(/^[a-z0-9][a-z0-9_-]*$/),file_path:j().min(1),variables:F(Qo),commands:F($o).min(1)}),es.extend({mode:Uo,command:j().trim().min(1).max(16384).nullable()});var ts=`00000000-0000-0000-0000-000000000000`,ns=I({session:bo,path:j(),kind:L([`file`,`diff`,`commit`,`external`,`untitled`]).optional(),sha:j().optional(),git_area:L([`staged`,`unstaged`]).optional(),root:j().optional(),view:L([`source`,`preview`,`linked`,`locked`]).optional(),compile_mode:Uo.optional(),generated_by:Go.optional()}),rs=za(`type`,[I({type:R(`editor`),tab:ns}),I({type:R(`terminal`),session:bo})]),is=I({kind:R(`leaf`),id:j(),tabs:F(rs).default([]),activeKey:j().nullable().default(null),previewKey:j().nullable().default(null)}),as=mo(()=>za(`kind`,[is,I({kind:R(`split`),id:j(),direction:L([`row`,`col`]),children:F(as),sizes:F(N())})])),os=Fa({layout_tree:as.nullable().default(null),active_session:bo.nullable().default(null),layout_ref:yo.nullable().default(null)}),ss=Fa({session_tabs:F(bo).default([]),active_session:bo.nullable().default(null),editor_tabs:F(ns).default([]),layout:Fa({}).default({}),explorer_pin:bo.nullable().default(null),active_editor_tab:ns.nullable().default(null),explorer_open:P().default(!0),sidebar_mode:L([`files`,`diff`,`history`,`changes`,`search`,`worktrees`]).default(`files`),sidebar_collapsed:P().default(!1),sessions_collapsed:P().default(!1),right_panel:L([`sessions`,`scratchpad`]).optional(),session_order:F(bo).default([]),layout_tree:as.nullable().default(null),layout_mode:L([`profile`,`project`]).optional(),project_layouts:Ua(j(),os).default({}),layout_ref:yo.nullable().default(null)});I({ui_state:ss}),I({ui_state:ss,updated_at:vo});var cs=L([`project`,`profile`]);I({id:yo,profile_id:So,scope:cs,project_id:xo.nullable(),name:j(),layout_tree:as.nullable(),active_session:bo.nullable(),created_at:vo,updated_at:vo}),I({profile_id:So,scope:cs,project_id:xo.optional(),name:j().min(1).max(200),layout_tree:as.nullable(),active_session:bo.nullable().optional()}),I({name:j().min(1).max(200).optional(),layout_tree:as.nullable().optional(),active_session:bo.nullable().optional()}),Wo.extend({root:j().min(1),page:N().int().positive(),x:N().finite().nonnegative(),y:N().finite().nonnegative()});var ls=Wo.extend({line:N().int().positive(),column:N().int().nonnegative().optional()}),us=L([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);I({mime:us,data:j().min(1)});var ds=I({path:j()});I({path:j(),line:N().int().nullable(),kind:L([`file`,`dir`]).optional(),relative_path:j().optional(),root:j().optional()});var fs=I({name:j(),type:L([`file`,`dir`,`symlink`]),size:N().int().nonnegative().nullable(),symlink:P().default(!1)}),ps=I({path:j(),entries:F(fs)}),ms=I({path:j(),content:j().nullable(),binary:P(),size:N().int().nonnegative(),mtime_ms:N()}),hs=I({mime:j().min(1).max(128),data:j().max(4*2796203)});I({content:j(),expected_mtime_ms:N().optional()}),I({path:j(),mtime_ms:N(),size:N().int().nonnegative()}),I({files:F(I({path:j(),size:N().int().nonnegative()}))}),I({path:j().min(1),kind:L([`file`,`dir`])}),I({from:j().min(1),to:j().min(1)}),I({from:j().min(1),to:j().min(1)}),I({operation:L([`copy`,`move`]),source:I({session_id:bo,root:j().optional()}),from:j().min(1),to:j().min(1)}),I({path:j().min(1)}),I({ok:R(!0),path:j()});var gs=L([`added`,`modified`,`deleted`,`renamed`]),_s=L([`staged`,`unstaged`]),vs=I({path:j(),status:gs,old_path:j().nullable()}),ys=I({against:j(),base_ref:j().nullable(),entries:F(vs),area:_s.optional()}),bs=L([`untracked`,`modified`,`added`,`deleted`,`renamed`,`conflicted`,`ignored`]),xs=I({path:j(),status:bs});I({entries:F(xs)});var Ss=I({path:j(),status:bs.exclude([`ignored`]),old_path:j().nullable()});I({repositories:F(I({root:j(),relative_path:j(),name:j(),owning:P(),submodule:P(),initialised:P(),head:j().nullable(),branch:j().nullable(),detached:P(),upstream:j().nullable(),ahead:N().int().nonnegative(),behind:N().int().nonnegative(),has_remote:P(),staged:F(Ss),unstaged:F(Ss),conflicts:F(Ss)})),entries:F(xs)});var Cs=I({repository:j().min(1)});Cs.extend({paths:F(j().min(1)).min(1)}),Cs.extend({message:j().trim().min(1),stage_all:P().optional()}),Cs.extend({set_upstream:P().optional()}),I({ok:R(!0),sha:j().optional()}),I({path:j(),content:j().nullable(),binary:P(),exists:P()}),I({path:j(),repository:j().nullable(),repository_path:j().nullable(),head:j().nullable(),content:j().nullable(),binary:P(),exists:P(),tracked:P(),ignored:P()});var ws=I({path:j(),ref:j(),content:j().nullable(),binary:P()}),Ts=I({sha:j(),subject:j(),author_name:j(),author_email:j(),authored_at:vo,parents:F(j()).optional()});I({commits:F(Ts),has_more:P()}),I({commit:Ts.extend({body:j()}),parents:F(j()),files:F(vs)});var Es=I({line:N().int().positive(),text:j()}),Ds=I({path:j(),matches:F(Es)});I({query:j(),files:F(j()),content:F(Ds),truncated:P()}),I({ports:F(I({port:N().int().min(1).max(65535),pid:N().int(),command:j(),address:j()})),scanned_at:vo}),I({refreshId:j().uuid()}).strict();var Os=I({status:R(`refreshing`),refreshId:j().uuid(),instance:j().uuid()}),ks=j().regex(/^(agent|shell-[0-9]+)$/),As=`home`,js={cols:N().int().min(2).max(1e3),rows:N().int().min(2).max(500)},Ms=za(`t`,[I({t:R(`auth`),token:j().max(128),resource:j().regex(/^[a-f0-9]{64}$/).optional()}),I({t:R(`attach`),session:j(),term:ks,...js}),I({t:R(`stdin`),session:j(),term:ks,data:j()}),I({t:R(`resize`),session:j(),term:ks,...js}),I({t:R(`detach`),session:j(),term:ks}),I({t:R(`spawn-shell`),session:j()}),I({t:R(`kill-shell`),session:j(),term:ks}),I({t:R(`subscribe-status`)}),I({t:R(`theme`),fg:j().regex(/^#[0-9a-fA-F]{6}$/),bg:j().regex(/^#[0-9a-fA-F]{6}$/)})]),Ns=za(`t`,[I({t:R(`authenticated`)}),I({t:R(`shell-spawned`),session:j(),term:j()}),I({t:R(`replay`),session:j(),term:j(),data:j()}),I({t:R(`output`),session:j(),term:j(),data:j()}),I({t:R(`status`),session:j(),status:Lo,last_activity_at:j().nullable()}),I({t:R(`renamed`),session:j(),title:j().nullable(),agent_title:j().nullable().optional(),osc_title:j().nullable().optional()}),I({t:R(`exit`),session:j(),term:j(),code:N()}),I({t:R(`notice`),level:L([`error`,`warning`]),title:j(),detail:j().optional(),session:j().optional(),term:j().optional()}),I({t:R(`account`),account_id:N(),profile_id:j(),logged_in:P()}),I({t:R(`session-switched`),source_session:j(),target_session:j(),target_project:j(),cause:L([`clear`,`resume`,`fork`]),outcome:L([`rebound`,`focused-existing`])}),I({t:R(`sessions-changed`),project_ids:F(j())}),I({t:R(`error`),message:j()})]),Ps={chunkBytes:32*1024,frameBytes:48*1024,requestBytes:256*1024,responseBytes:16*1024*1024,queueBytes:1024*1024,relayQueueBytes:64*1024*1024,requests:8,connectionsPerHost:8,connectionsPerAccount:16,connections:128,handshakeMs:1e4,invitationMs:3e5,idleMs:720*60*60*1e3,absoluteMs:2160*60*60*1e3},H=j().uuid(),Fs=j().regex(/^[a-f0-9]{64}$/),Is=j().min(20).max(128),Ls=j().min(1).max(128),Rs=j().trim().min(1).max(80).regex(/^[^\u0000-\u001f\u007f]+$/),zs=j().url().refine(e=>{try{let t=new URL(e);return t.protocol===`https:`&&t.origin===e&&!t.username&&!t.password}catch{return!1}},`An exact HTTPS origin is required`),Bs=I({version:R(2),service:zs,host:H,peer:Is,invitation:Fs,expires:N().int().positive()}).strict();I({t:R(`connect`),host:H}).strict(),za(`t`,[I({t:R(`registered`),host:H}).strict(),I({t:R(`open`),connection:H,account:Ls}).strict(),I({t:R(`ready`),connection:H,account:Ls}).strict()]);var Vs=I({id:H,peer:Is,account:Ls,label:Rs,created:N(),lastUsed:N(),expires:N(),status:L([`pending`,`approved`,`revoked`])}),Hs=za(`t`,[I({t:R(`status`)}).strict(),I({t:R(`pair`)}).strict(),I({t:R(`devices`)}).strict(),I({t:R(`approve`),id:H}).strict(),I({t:R(`revoke`),id:H}).strict(),I({t:R(`disable`)}).strict()]),Us=I({enabled:P().optional(),connected:P().optional(),host:H.optional(),peer:Is.optional(),invitation:Bs.optional(),url:j().url().optional(),devices:F(Vs).optional(),error:j().max(256).optional()}).strict();za(`t`,[I({t:R(`hello`),account:Ls,label:Rs,invitation:Fs.optional()}).strict(),I({t:R(`pending`),device:Vs}).strict(),I({t:R(`admitted`),generation:H,device:H}).strict(),I({t:R(`challenge`),nonce:Fs,generation:H}).strict(),I({t:R(`participate`),nonce:Fs,generation:H,resources:F(H).max(Ps.requests+1)}).strict(),I({t:R(`request`),id:H,method:L([`GET`,`POST`,`PATCH`]),path:j().max(8192),body:Aa().optional()}).strict(),I({t:R(`response`),id:H,status:N().int().min(100).max(599),body:Aa()}).strict(),I({t:R(`cancel`),id:H}).strict(),I({t:R(`stream`),id:H}).strict(),I({t:R(`terminal`),id:H,message:Ms}).strict(),I({t:R(`event`),message:Ns}).strict(),I({t:R(`sent`),id:H}).strict(),I({t:R(`admin`),id:H,request:Hs}).strict(),I({t:R(`admin-result`),id:H,result:Us}).strict(),I({t:R(`error`),code:L([`rejected`,`expired`,`unavailable`,`protocol_mismatch`]),message:j().max(256)}).strict()]),I({id:H,index:N().int().min(0).max(8192),end:P(),data:j().max(Ps.chunkBytes)}).strict(),La([La([Hs,I({t:R(`delete_registration`)}).strict()]),I({t:R(`enable`),registration:I({service:zs,app:zs,code:Fs}).strict().optional()}).strict(),I({t:R(`reset`)}).strict()]),I({service:zs,code:Fs}).strict();var Ws=I({availability:L([`ready`,`not_installed`,`upgrade_required`]),configured:P(),enabled:P(),connected:P(),canDeleteRegistration:P().optional(),supervisor:L([`systemd`,`launchd`]).nullable(),host:H.optional(),peer:Is.optional(),service:zs.optional(),app:zs.optional(),devices:F(Vs)}),Gs=j().regex(/^[a-f0-9]{64}$/),Ks=j().regex(/^cn_[a-f0-9]{64}$/),qs=j().regex(/^br_[a-f0-9]{64}$/),Js=j().regex(/^iv_[a-f0-9]{64}$/);L([`browser_rejected`,`upstream_expired`,`upstream_unavailable`,`protocol_mismatch`]),za(`t`,[I({t:R(`open`)}).strict(),I({t:R(`renew`),resources:F(Gs).max(2048)}).strict(),I({t:R(`close`)}).strict()]);var Ys=I({t:R(`inspection`),port:N().int().min(1).max(65535),version:V,liveSessions:N().int().nonnegative()});za(`t`,[I({t:R(`authority`),generation:j().uuid(),token:Ks.optional(),validForMs:N().int().positive().max(45e3),port:N().int().min(1).max(65535),version:V}).strict(),Ys,I({t:R(`error`),code:L([`unavailable`,`rejected`,`invalid_control`])}).strict()]),I({invitation:Js}).strict();var Xs=I({credential:qs});I({status:R(`revoked`)}),I({session:j().uuid(),port:N().int().min(1).max(65535)}).extend({path:j().max(8192).default(`/`)});var Zs=I({url:j().url()});I({invitation:Js}).strict(),I({t:R(`invite`),secret:j().max(128).optional()}).strict(),I({url:j().url()}).strict();var Qs=I({instance:j().uuid(),refreshId:j().uuid().nullable(),upstream:L([`ready`,`upstream_expired`,`upstream_unavailable`,`protocol_mismatch`])}),$s=I({id:j(),hash:j(),lastUsed:N()}),ec=I({hash:j(),browser:j(),prefix:j()});I({version:R(1),origin:j(),target:j(),browsers:F($s),proxies:F(ec)});var tc={imageBytes:4*1024*1024,chunkBytes:64*1024,idleMs:6e4,lifetimeMs:5*6e4};za(`action`,[I({action:R(`start`),upload:j().uuid(),mime:us,size:N().int().positive().max(tc.imageBytes)}).strict(),I({action:R(`chunk`),upload:j().uuid(),offset:N().int().nonnegative().max(tc.imageBytes),data:j().min(4).max(4*Math.ceil(tc.chunkBytes/3)).regex(/^[A-Za-z0-9+/]+={0,2}$/).refine(e=>{let t=e.endsWith(`==`)?2:+!!e.endsWith(`=`);return e.length%4==0&&e.length/4*3-t<=tc.chunkBytes},`Image chunk is too large or malformed`)}).strict(),I({action:R(`finish`),upload:j().uuid()}).strict(),I({action:R(`cancel`),upload:j().uuid()}).strict()]);var nc=I({received:N().int().nonnegative().max(tc.imageBytes)});I({id:H,label:Rs,online:P()}),I({providers:F(L([`google`,`github`])),protocol:R(2)}),I({user:I({id:Ls,name:j(),email:j(),emailVerified:P(),twoFactorEnabled:P()}).nullable(),mfaRequired:P()}),I({label:Rs}).strict(),I({host:H,code:Fs,expires:N()}).strict(),I({code:Fs}).strict(),I({credential:Fs}).strict();var rc=I({challenge:Fs,label:Rs,service:zs,app:zs,expires:N().int().positive()}).strict(),ic=I({ready:P()}).strict();I({host:H,account:Ls,credential:Fs}).strict().extend({service:zs,app:zs,enabled:P()}).strict(),I({service:zs.optional(),app:zs.optional(),code:Fs.optional(),managed:P().default(!0)}).strict();var ac=F(N().int().min(0).max(255)).min(32).max(256);I({host:H,peer:Is,account:Ls,service:zs,label:j(),privateKey:ac}).strict();var oc=null;function sc(){return oc}function cc(e){return e}function lc(e){let t=new Set;return{get:()=>localStorage.getItem(cc(e)),set(n){n===null?localStorage.removeItem(cc(e)):localStorage.setItem(cc(e),n);for(let e of t)e()},subscribe(e){return t.add(e),()=>t.delete(e)}}}var uc=lc(`puddle.browser-authorisation`);async function dc(){localStorage.removeItem(`puddle.token`);let e=new URLSearchParams(window.location.hash.slice(1)),t=e.get(`invite`);if(e.has(`invite`)||e.has(`token`)){let e=new URL(window.location.href);e.hash=``,history.replaceState(null,``,e)}if(t)try{let e=await fetch(`/cockpit/bootstrap`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({invitation:t})});if(!e.ok)return;uc.set(Xs.parse(await e.json()).credential)}catch{}}function fc(){uc.set(null)}var pc=e(n(),1),mc=[{id:`system`,label:`System`},{id:`rangefinder`,label:`Rangefinder`},{id:`drafting`,label:`Drafting`},{id:`invert`,label:`Invert`}],hc=`system`;function gc(e){return mc.some(t=>t.id===e)?e:hc}var _c={uiFontSize:16,cursorPackage:hc,terminalFontSize:13,editorFontSize:14,density:`compact`,terminalScrollback:2e4,editorTabSize:2,editorWordWrap:!1,editorLinkSshHost:``,projectBasedLayout:!0,showAllProjectSessions:!0},vc=`puddle.client-settings`,yc=new Set,bc=null;function xc(e){let t={...e};return t.projectBasedLayout===void 0&&t.showAllProjectSessions!==void 0&&(t.projectBasedLayout=!t.showAllProjectSessions),t.showAllProjectSessions===void 0&&t.projectBasedLayout!==void 0&&(t.showAllProjectSessions=!t.projectBasedLayout),t}function Sc(e){return e.terminalScrollback===5e3?{...e,terminalScrollback:_c.terminalScrollback}:e}function Cc(){if(bc)return bc;let e={};try{e=JSON.parse(localStorage.getItem(vc)??`{}`)}catch{}let t={..._c,...Sc(xc(e))};return bc={...t,cursorPackage:gc(t.cursorPackage)},bc}function wc(e){document.documentElement.style.setProperty(`--ui-font-size`,`${e.uiFontSize}px`),document.documentElement.dataset.density=e.density,document.documentElement.dataset.cursorPackage=e.cursorPackage}function Tc(){return Cc()}function Ec(e){let t={...Cc(),...e};bc={...t,cursorPackage:gc(t.cursorPackage)},localStorage.setItem(vc,JSON.stringify(bc)),wc(bc);for(let e of yc)e()}function Dc(){wc(Cc())}function Oc(){return(0,pc.useSyncExternalStore)(e=>(yc.add(e),()=>yc.delete(e)),()=>Cc())}function kc(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}function Ac(e){return e.replace(/[%#? ]/g,e=>encodeURIComponent(e))}function jc(e,t,n){let r=kc(t);return n?`${e}://vscode-remote/ssh-remote+${Ac(n)}${r}`:`${e}://file${r}`}function Mc(e,t){return e.trim()||t||null}var Nc=lc(`puddle.host`);function Pc(){return Mc(Tc().editorLinkSshHost,Nc.get())}function Fc(e){return new URLSearchParams(e).get(`host`)?.trim()||null}function Ic(e,t,n){return Fc(e)||(/[#&](?:invite|token)=/.test(t)?null:n)}function Lc(){let e=Ic(window.location.search,window.location.hash,Nc.get());if(Nc.set(e),Fc(window.location.search)!==null){let e=new URL(window.location.href);e.searchParams.delete(`host`),history.replaceState(null,``,e)}}var Rc=[`dark`,`light`],U=`puddle.theme`,zc=`system`,Bc=`dark`,Vc=new Set;function Hc(){return window.matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`}function Uc(e){return e===`system`?Hc():e}function Wc(){let e=localStorage.getItem(U);return e===`system`||Rc.includes(e??``)?e:zc}function Gc(){let e=document.documentElement.dataset.theme;return Rc.includes(e??``)?e:Bc}function Kc(e){localStorage.setItem(U,e);let t=Uc(e);document.documentElement.dataset.theme=t;for(let e of Vc)e(t);return t}function qc(){Kc(Wc()),window.matchMedia(`(prefers-color-scheme: light)`).addEventListener(`change`,()=>{Wc()===`system`&&Kc(`system`)})}function Jc(e){return Vc.add(e),()=>Vc.delete(e)}function Yc(e){let t=/^#([0-9a-fA-F]{3,4})$/.exec(e);return t?.[1]?`#${[...t[1]].map(e=>e+e).join(``)}`:e}function Xc(){let e=getComputedStyle(document.documentElement);return t=>Yc(e.getPropertyValue(t).trim())}var Zc=4.5;function Qc(e){return{background:e(`--bg-base`),foreground:e(`--text-primary`),cursor:e(`--accent`),cursorAccent:e(`--bg-base`),selectionBackground:e(`--selection`),black:e(`--ansi-black`),red:e(`--ansi-red`),green:e(`--ansi-green`),yellow:e(`--ansi-yellow`),blue:e(`--ansi-blue`),magenta:e(`--ansi-magenta`),cyan:e(`--ansi-cyan`),white:e(`--ansi-white`),brightBlack:e(`--ansi-bright-black`),brightRed:e(`--ansi-bright-red`),brightGreen:e(`--ansi-bright-green`),brightYellow:e(`--ansi-bright-yellow`),brightBlue:e(`--ansi-bright-blue`),brightMagenta:e(`--ansi-bright-magenta`),brightCyan:e(`--ansi-bright-cyan`),brightWhite:e(`--ansi-bright-white`)}}function $c(){return Qc(Xc())}function el(e){return{theme:Qc(e),minimumContrastRatio:Zc}}function tl(){return el(Xc())}function W(e){return e.replace(`#`,``)}function nl(e,t){return{base:t===`light`?`vs`:`vs-dark`,inherit:!0,rules:[{token:`comment`,foreground:W(e(`--text-muted`)),fontStyle:`italic`},{token:`string`,foreground:W(e(`--ansi-green`))},{token:`number`,foreground:W(e(`--ansi-yellow`))},{token:`keyword`,foreground:W(e(`--ansi-blue`))},{token:`type`,foreground:W(e(`--ansi-cyan`))},{token:`function`,foreground:W(e(`--ansi-magenta`))}],colors:{"editor.background":e(`--bg-base`),"editor.foreground":e(`--text-primary`),"editor.selectionBackground":e(`--selection`),"editor.lineHighlightBackground":e(`--bg-surface`),"editorCursor.foreground":e(`--accent`),"editorLineNumber.foreground":e(`--text-muted`),"editorLineNumber.activeForeground":e(`--text-secondary`),"editorWidget.background":e(`--bg-elevated`),"editorWidget.border":e(`--border`),focusBorder:e(`--focus-ring`),"diffEditor.insertedTextBackground":e(`--diff-added`),"diffEditor.removedTextBackground":e(`--diff-removed`)}}}function rl(){return nl(Xc(),Gc())}var il=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),al=t(((e,t)=>{t.exports=il()})),ol=al(),sl=`modulepreload`,G=function(e){return`/`+e},cl={},ll=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=G(t,n),t=s(t),t in cl)return;cl[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:sl,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};qc(),Dc(),Lc(),dc().then(async()=>{let{App:e}=await ll(async()=>{let{App:e}=await import(`./App-C2IQg_6K.js`);return{App:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]));(0,go.createRoot)(document.getElementById(`root`)).render((0,ol.jsx)(e,{}))});export{ko as $,Ps as A,ds as B,rc as C,Qs as D,nc as E,ws as F,Yo as G,ts as H,ms as I,Do as J,Xo as K,hs as L,As as M,Os as N,Zs as O,ys as P,jo as Q,ps as R,sc as S,tc as T,rs as U,ls as V,ss as W,Oo as X,Eo as Y,Ao as Z,mc as _,Gc as a,lc as b,Wc as c,jc as d,V as et,Pc as f,Oc as g,Ec as h,Xc as i,o as it,Us as j,Ws as k,$c as l,Tc as m,al as n,F as nt,rl as o,Nc as p,To as q,Kc as r,j as rt,Jc as s,ll as t,_o as tt,tl as u,fc as v,ic as w,cc as x,uc as y,us as z};
|
|
82
|
+
Then proceed with the task below (or await instructions if none is given).`,Do=`[puddle] You are joining an existing branch and worktree that other agents may be working in concurrently. Files can change underneath you, so re-check the working tree before you act, and avoid disruptive git operations (resetting, force-pushing, or deleting the branch) that would disrupt work already in progress by others.`,Oo=`This session was interrupted (daemon or machine restart). Processes you started are gone; re-verify your environment before continuing.`,ko=[[`name`,`the resolved display name: user rename, else agent name, else sequence, else id`],[`title`,`the user rename override only (empty when unset)`],[`agentName`,`the agent's own session name (empty when the agent has not named it)`],[`sequence`,`the terminal-title name the process set (empty when it set none)`],[`branch`,`the git branch`],[`cwd`,`the worktree directory's name`],[`id`,`the first 8 characters of the session id`],[`status`,`the session status (running, waiting_input, …)`],[`agent`,`the agent type (empty for terminal sessions)`],[`separator`,`an em dash that appears only between two non-empty neighbours`]],Ao="${name}",jo=[`navy`,`gold`,`blue`,`green`,`red`,`violet`,`cyan`];I({id:So,name:wo,branch_prefix:j(),icon:j().nullable().default(null),icon_colour:j().nullable().default(null),created_at:vo}),I({name:wo,branch_prefix:j().max(64).optional()}),I({name:wo.optional(),branch_prefix:j().max(64).optional(),icon:j().max(64).nullable().optional(),icon_colour:j().max(32).nullable().optional()});var Mo=Fa({baseBranch:j().optional(),separateBranch:P().optional(),separateWorktree:P().optional()}),No=Fa({agent:Mo.optional(),terminal:Mo.optional()});Fa({allowSkipPermissions:P().default(!1),captureSessionEnv:P().default(!0),terminalAppShortcuts:P().default(!0),onboardingTemplate:j().optional(),concurrentTemplate:j().optional(),restartTemplate:j().optional(),tabTitleTemplate:j().optional(),projectOrder:F(j()).optional(),sessionDefaults:No.optional(),hotkeys:Ua(j(),j()).optional()}),Ua(j(),Aa());var Po=j().regex(/^untitled-\d+\.md$/);I({name:Po}),I({name:Po,content:j(),mtime_ms:N()}),I({content:j()}),I({mtime_ms:N()}),I({id:yo,profile_id:So,agent_type:j(),label:j(),config_dir:j(),skip_permissions_default:P(),logged_in:P(),created_at:vo}),I({profile_id:So,agent_type:j().min(1),label:wo,skip_permissions_default:P().optional(),import_dir:j().min(1).optional()}),I({label:wo.optional(),skip_permissions_default:P().optional()}),I({stream:j(),term:j(),hint:j().optional()}),Fa({account_id:yo,logged_in:P(),session_count:N().int().nonnegative(),active_session_count:N().int().nonnegative(),last_activity_at:vo.nullable(),agent_usage:I({input_tokens:N().int().nonnegative(),output_tokens:N().int().nonnegative(),cache_read_input_tokens:N().int().nonnegative(),cache_creation_input_tokens:N().int().nonnegative(),message_count:N().int().nonnegative()}).nullable(),live_usage:I({captured_at:vo,context_used_percentage:N().nullable(),total_cost_usd:N().nullable(),model:j().nullable()}).nullable(),subscription:I({windows:F(I({key:j(),label:j(),used_percentage:N(),resets:j().nullable()}))}).nullable()}),I({id:j(),display_name:j(),capabilities:I({resume:P(),skip_permissions:P()}),binary:j().optional(),available:P().optional()}),I({id:yo,path:j(),default_base_branch:j(),onboarding_notes:j().nullable(),fetch_enabled:P(),last_fetched_at:vo.nullable()}).extend({orphan_worktrees:F(j())}),I({path:j().min(1),default_base_branch:j().min(1).optional(),onboarding_notes:j().nullable().optional(),fetch_enabled:P().optional()}),I({branches:F(I({name:j(),is_session:P(),session_title:j().nullable()}))});var Fo=I({path:j(),branch:j().nullable(),is_primary:P(),dirty:P().optional(),local_only:P().optional()}),Io=I({name:j(),local_only:P()});I({worktrees:F(Fo),orphan_branches:F(Io)}),I({default_base_branch:j().min(1).optional(),onboarding_notes:j().nullable().optional(),fetch_enabled:P().optional()});var Lo=L([`starting`,`running`,`waiting_input`,`exited`,`interrupted`,`archived`]),Ro=L([`agent`,`terminal`]),zo=I({id:bo,project_id:xo,account_id:yo.nullable(),worktree_path:j(),base_branch:j(),branch:j(),separate_branch:P(),kind:Ro,agent_type:j().nullable(),agent_session_ref:j().nullable(),conversation_id:yo.nullable().optional(),parent_conversation_id:yo.nullable().optional(),title:j().nullable(),agent_title:j().nullable().optional(),conversation_missing:P().optional(),branch_owner:P().optional(),native_sync:L([`pending`,`full`,`fallback`]).optional(),osc_title:j().nullable().optional(),status:Lo,cwd:j().nullable().optional(),skip_permissions:P(),created_at:vo,updated_at:vo,last_activity_at:vo.nullable(),worktree_missing:P().optional(),stale_running:P().optional(),git_summary:I({ahead:N().int().nonnegative(),behind:N().int().nonnegative(),dirty_files:N().int().nonnegative()}).nullable().optional()});I({project_id:xo,account_id:yo.optional(),kind:Ro.optional(),base_branch:j().min(1).optional(),branch:j().min(1).max(200).optional(),separate_branch:P().optional(),separate_worktree:P().optional(),join_worktree:j().optional(),cwd:j().optional(),title:j().min(1).max(200).optional(),prompt:j().optional(),skip_permissions:P().optional()}),I({title:j().max(200)}),I({account_id:yo}),I({account_id:yo}),I({vars:F(I({name:j(),bytes:N().int().nonnegative(),value:j().optional()}))}),I({cleared:N().int().nonnegative()}),I({force:P().default(!1),delete_branch:P().default(!1)});var Bo=j().min(1).max(5),Vo=I({id:xo,profile_id:So,repo_id:yo,name:j(),abbrev:Bo.nullable().default(null),archived:P().default(!1),created_at:vo,updated_at:vo});I({profile_id:So,repo_id:yo,name:j().min(1).max(100),abbrev:Bo.optional()}),I({name:j().min(1).max(100).optional(),abbrev:Bo.optional(),archived:P().optional()}),I({project:Vo,sessions:F(zo)});var Ho=L([`project`,`profile`]);I({id:yo,profile_id:So,scope:Ho,project_id:xo.nullable(),title:j().nullable(),body:j(),tags:F(j()),agent_type:j().nullable(),position:N(),created_at:vo,updated_at:vo}),I({profile_id:So,scope:Ho,project_id:xo.optional(),title:j().max(200).optional(),body:j().min(1),tags:F(j()).optional(),agent_type:j().optional()}),I({scope:Ho.optional(),project_id:xo.nullable().optional(),title:j().max(200).nullable().optional(),body:j().min(1).optional(),tags:F(j()).optional(),agent_type:j().nullable().optional(),position:N().optional()});var Uo=L([`on_demand`,`eager`]),Wo=I({session:bo,path:j().min(1),root:j().min(1).optional()}),Go=j().regex(/^[a-z][a-z0-9_-]*$/);I({providers:F(I({id:Go,display_name:j().min(1),extensions:F(j().regex(/^[a-z0-9]+$/)).min(1),input_extensions:F(j().regex(/^[a-z0-9]+$/)).min(1),available:P(),executor:j().min(1).nullable(),eager:P()}))});var Ko=I({source:Wo,provider:Go.optional(),profile_id:So.optional(),project_id:xo.optional()}),qo=I({role:j().min(1),media_type:j().min(1),file:Wo}),Jo=I({source:Wo,severity:L([`error`,`warning`,`info`]),message:j().min(1),line:N().int().positive(),column:N().int().positive().optional(),end_line:N().int().positive().optional(),end_column:N().int().positive().optional()}),Yo=I({source:Wo.optional(),output:j().optional(),diagnostics:F(Jo).optional()}),Xo=Yo.extend({message:j().min(1)}),Zo=I({provider:Go,executor:j().min(1),revision:N().int().nonnegative(),source:Wo,artifacts:F(qo),navigation:I({kind:j().min(1)}).optional()});Ko.extend({mode:Uo}),I({provider:Go,mode:Uo,state:L([`idle`,`running`,`succeeded`,`failed`]),revision:N().int().nonnegative(),result:Zo.nullable(),error:Xo.nullable()});var Qo=I({placeholder:j().regex(/^\{\{[a-z][a-z0-9_]*\}\}$/),description:j().min(1)}),$o=I({mode:Uo,run_when:L([`when_clicked`,`upon_file_change`]),default_command:j().min(1).nullable(),override_command:j().min(1).nullable()}),es=Ko.extend({profile_id:So,project_id:xo});I({provider:Go,display_name:j().min(1),file_type:j().regex(/^[a-z0-9][a-z0-9_-]*$/),file_path:j().min(1),variables:F(Qo),commands:F($o).min(1)}),es.extend({mode:Uo,command:j().trim().min(1).max(16384).nullable()});var ts=`00000000-0000-0000-0000-000000000000`,ns=I({session:bo,path:j(),kind:L([`file`,`diff`,`commit`,`external`,`untitled`]).optional(),sha:j().optional(),git_area:L([`staged`,`unstaged`]).optional(),root:j().optional(),view:L([`source`,`preview`,`linked`,`locked`]).optional(),compile_mode:Uo.optional(),generated_by:Go.optional()}),rs=za(`type`,[I({type:R(`editor`),tab:ns}),I({type:R(`terminal`),session:bo})]),is=I({kind:R(`leaf`),id:j(),tabs:F(rs).default([]),activeKey:j().nullable().default(null),previewKey:j().nullable().default(null)}),as=mo(()=>za(`kind`,[is,I({kind:R(`split`),id:j(),direction:L([`row`,`col`]),children:F(as),sizes:F(N())})])),os=Fa({layout_tree:as.nullable().default(null),active_session:bo.nullable().default(null),layout_ref:yo.nullable().default(null)}),ss=Fa({session_tabs:F(bo).default([]),active_session:bo.nullable().default(null),editor_tabs:F(ns).default([]),layout:Fa({}).default({}),explorer_pin:bo.nullable().default(null),active_editor_tab:ns.nullable().default(null),explorer_open:P().default(!0),sidebar_mode:L([`files`,`diff`,`history`,`changes`,`search`,`worktrees`]).default(`files`),sidebar_collapsed:P().default(!1),sessions_collapsed:P().default(!1),right_panel:L([`sessions`,`scratchpad`]).optional(),session_order:F(bo).default([]),layout_tree:as.nullable().default(null),layout_mode:L([`profile`,`project`]).optional(),project_layouts:Ua(j(),os).default({}),layout_ref:yo.nullable().default(null)});I({ui_state:ss}),I({ui_state:ss,updated_at:vo});var cs=L([`project`,`profile`]);I({id:yo,profile_id:So,scope:cs,project_id:xo.nullable(),name:j(),layout_tree:as.nullable(),active_session:bo.nullable(),created_at:vo,updated_at:vo}),I({profile_id:So,scope:cs,project_id:xo.optional(),name:j().min(1).max(200),layout_tree:as.nullable(),active_session:bo.nullable().optional()}),I({name:j().min(1).max(200).optional(),layout_tree:as.nullable().optional(),active_session:bo.nullable().optional()}),Wo.extend({root:j().min(1),page:N().int().positive(),x:N().finite().nonnegative(),y:N().finite().nonnegative()});var ls=Wo.extend({line:N().int().positive(),column:N().int().nonnegative().optional()}),us=L([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);I({mime:us,data:j().min(1)});var ds=I({path:j()});I({path:j(),line:N().int().nullable(),kind:L([`file`,`dir`]).optional(),relative_path:j().optional(),root:j().optional()});var fs=I({name:j(),type:L([`file`,`dir`,`symlink`]),size:N().int().nonnegative().nullable(),symlink:P().default(!1)}),ps=I({path:j(),entries:F(fs)}),ms=I({path:j(),content:j().nullable(),binary:P(),size:N().int().nonnegative(),mtime_ms:N()}),hs=I({mime:j().min(1).max(128),data:j().max(4*2796203)});I({content:j(),expected_mtime_ms:N().optional()}),I({path:j(),mtime_ms:N(),size:N().int().nonnegative()}),I({files:F(I({path:j(),size:N().int().nonnegative()}))}),I({path:j().min(1),kind:L([`file`,`dir`])}),I({from:j().min(1),to:j().min(1)}),I({from:j().min(1),to:j().min(1)}),I({operation:L([`copy`,`move`]),source:I({session_id:bo,root:j().optional()}),from:j().min(1),to:j().min(1)}),I({path:j().min(1)}),I({ok:R(!0),path:j()});var gs=L([`added`,`modified`,`deleted`,`renamed`]),_s=L([`staged`,`unstaged`]),vs=I({path:j(),status:gs,old_path:j().nullable()}),ys=I({against:j(),base_ref:j().nullable(),entries:F(vs),area:_s.optional()}),bs=L([`untracked`,`modified`,`added`,`deleted`,`renamed`,`conflicted`,`ignored`]),xs=I({path:j(),status:bs});I({entries:F(xs)});var Ss=I({path:j(),status:bs.exclude([`ignored`]),old_path:j().nullable()});I({repositories:F(I({root:j(),relative_path:j(),name:j(),owning:P(),submodule:P(),initialised:P(),head:j().nullable(),branch:j().nullable(),detached:P(),upstream:j().nullable(),ahead:N().int().nonnegative(),behind:N().int().nonnegative(),has_remote:P(),staged:F(Ss),unstaged:F(Ss),conflicts:F(Ss)})),entries:F(xs)});var Cs=I({repository:j().min(1)});Cs.extend({paths:F(j().min(1)).min(1)}),Cs.extend({message:j().trim().min(1),stage_all:P().optional()}),Cs.extend({set_upstream:P().optional()}),I({ok:R(!0),sha:j().optional()}),I({path:j(),content:j().nullable(),binary:P(),exists:P()}),I({path:j(),repository:j().nullable(),repository_path:j().nullable(),head:j().nullable(),content:j().nullable(),binary:P(),exists:P(),tracked:P(),ignored:P()});var ws=I({path:j(),ref:j(),content:j().nullable(),binary:P()}),Ts=I({sha:j(),subject:j(),author_name:j(),author_email:j(),authored_at:vo,parents:F(j()).optional()});I({commits:F(Ts),has_more:P()}),I({commit:Ts.extend({body:j()}),parents:F(j()),files:F(vs)});var Es=I({line:N().int().positive(),text:j()}),Ds=I({path:j(),matches:F(Es)});I({query:j(),files:F(j()),content:F(Ds),truncated:P()}),I({ports:F(I({port:N().int().min(1).max(65535),pid:N().int(),command:j(),address:j()})),scanned_at:vo}),I({refreshId:j().uuid()}).strict();var Os=I({status:R(`refreshing`),refreshId:j().uuid(),instance:j().uuid()}),ks=j().regex(/^(agent|shell-[0-9]+)$/),As=`home`,js={cols:N().int().min(2).max(1e3),rows:N().int().min(2).max(500)},Ms=za(`t`,[I({t:R(`auth`),token:j().max(128),resource:j().regex(/^[a-f0-9]{64}$/).optional()}),I({t:R(`attach`),session:j(),term:ks,...js}),I({t:R(`stdin`),session:j(),term:ks,data:j()}),I({t:R(`resize`),session:j(),term:ks,...js}),I({t:R(`detach`),session:j(),term:ks}),I({t:R(`spawn-shell`),session:j()}),I({t:R(`kill-shell`),session:j(),term:ks}),I({t:R(`subscribe-status`)}),I({t:R(`theme`),fg:j().regex(/^#[0-9a-fA-F]{6}$/),bg:j().regex(/^#[0-9a-fA-F]{6}$/)})]),Ns=za(`t`,[I({t:R(`authenticated`)}),I({t:R(`shell-spawned`),session:j(),term:j()}),I({t:R(`replay`),session:j(),term:j(),data:j()}),I({t:R(`output`),session:j(),term:j(),data:j()}),I({t:R(`status`),session:j(),status:Lo,last_activity_at:j().nullable()}),I({t:R(`renamed`),session:j(),title:j().nullable(),agent_title:j().nullable().optional(),osc_title:j().nullable().optional()}),I({t:R(`exit`),session:j(),term:j(),code:N()}),I({t:R(`notice`),level:L([`error`,`warning`]),title:j(),detail:j().optional(),session:j().optional(),term:j().optional()}),I({t:R(`account`),account_id:N(),profile_id:j(),logged_in:P()}),I({t:R(`session-switched`),source_session:j(),target_session:j(),target_project:j(),cause:L([`clear`,`resume`,`fork`]),outcome:L([`rebound`,`focused-existing`])}),I({t:R(`sessions-changed`),project_ids:F(j())}),I({t:R(`error`),message:j()})]),Ps={chunkBytes:32*1024,frameBytes:48*1024,requestBytes:256*1024,responseBytes:16*1024*1024,queueBytes:1024*1024,relayQueueBytes:64*1024*1024,requests:8,connectionsPerHost:8,connectionsPerAccount:16,connections:128,handshakeMs:1e4,invitationMs:3e5,idleMs:720*60*60*1e3,absoluteMs:2160*60*60*1e3},H=j().uuid(),Fs=j().regex(/^[a-f0-9]{64}$/),Is=j().min(20).max(128),Ls=j().min(1).max(128),Rs=j().trim().min(1).max(80).regex(/^[^\u0000-\u001f\u007f]+$/),zs=j().url().refine(e=>{try{let t=new URL(e);return t.protocol===`https:`&&t.origin===e&&!t.username&&!t.password}catch{return!1}},`An exact HTTPS origin is required`),Bs=I({version:R(2),service:zs,host:H,peer:Is,invitation:Fs,expires:N().int().positive()}).strict();I({t:R(`connect`),host:H}).strict(),za(`t`,[I({t:R(`registered`),host:H}).strict(),I({t:R(`open`),connection:H,account:Ls}).strict(),I({t:R(`ready`),connection:H,account:Ls}).strict()]);var Vs=I({id:H,peer:Is,account:Ls,label:Rs,created:N(),lastUsed:N(),expires:N(),status:L([`pending`,`approved`,`revoked`])}),Hs=za(`t`,[I({t:R(`status`)}).strict(),I({t:R(`pair`)}).strict(),I({t:R(`devices`)}).strict(),I({t:R(`approve`),id:H}).strict(),I({t:R(`revoke`),id:H}).strict(),I({t:R(`disable`)}).strict()]),Us=I({enabled:P().optional(),connected:P().optional(),host:H.optional(),peer:Is.optional(),invitation:Bs.optional(),url:j().url().optional(),devices:F(Vs).optional(),error:j().max(256).optional()}).strict();za(`t`,[I({t:R(`hello`),account:Ls,label:Rs,invitation:Fs.optional()}).strict(),I({t:R(`pending`),device:Vs}).strict(),I({t:R(`admitted`),generation:H,device:H}).strict(),I({t:R(`challenge`),nonce:Fs,generation:H}).strict(),I({t:R(`participate`),nonce:Fs,generation:H,resources:F(H).max(Ps.requests+1)}).strict(),I({t:R(`request`),id:H,method:L([`GET`,`POST`,`PATCH`]),path:j().max(8192),body:Aa().optional()}).strict(),I({t:R(`response`),id:H,status:N().int().min(100).max(599),body:Aa()}).strict(),I({t:R(`cancel`),id:H}).strict(),I({t:R(`stream`),id:H}).strict(),I({t:R(`terminal`),id:H,message:Ms}).strict(),I({t:R(`event`),message:Ns}).strict(),I({t:R(`sent`),id:H}).strict(),I({t:R(`admin`),id:H,request:Hs}).strict(),I({t:R(`admin-result`),id:H,result:Us}).strict(),I({t:R(`error`),code:L([`rejected`,`expired`,`unavailable`,`protocol_mismatch`]),message:j().max(256)}).strict()]),I({id:H,index:N().int().min(0).max(8192),end:P(),data:j().max(Ps.chunkBytes)}).strict(),La([La([Hs,I({t:R(`delete_registration`)}).strict()]),I({t:R(`enable`),registration:I({service:zs,app:zs,code:Fs}).strict().optional()}).strict(),I({t:R(`reset`)}).strict()]),I({service:zs,code:Fs}).strict();var Ws=I({availability:L([`ready`,`not_installed`,`upgrade_required`]),configured:P(),enabled:P(),connected:P(),canDeleteRegistration:P().optional(),supervisor:L([`systemd`,`launchd`]).nullable(),host:H.optional(),peer:Is.optional(),service:zs.optional(),app:zs.optional(),devices:F(Vs)}),Gs=j().regex(/^[a-f0-9]{64}$/),Ks=j().regex(/^cn_[a-f0-9]{64}$/),qs=j().regex(/^br_[a-f0-9]{64}$/),Js=j().regex(/^iv_[a-f0-9]{64}$/);L([`browser_rejected`,`upstream_expired`,`upstream_unavailable`,`protocol_mismatch`]),za(`t`,[I({t:R(`open`)}).strict(),I({t:R(`renew`),resources:F(Gs).max(2048)}).strict(),I({t:R(`close`)}).strict()]);var Ys=I({t:R(`inspection`),port:N().int().min(1).max(65535),version:V,liveSessions:N().int().nonnegative()});za(`t`,[I({t:R(`authority`),generation:j().uuid(),token:Ks.optional(),validForMs:N().int().positive().max(45e3),port:N().int().min(1).max(65535),version:V}).strict(),Ys,I({t:R(`error`),code:L([`unavailable`,`rejected`,`invalid_control`])}).strict()]),I({invitation:Js}).strict();var Xs=I({credential:qs});I({status:R(`revoked`)}),I({session:j().uuid(),port:N().int().min(1).max(65535)}).extend({path:j().max(8192).default(`/`)});var Zs=I({url:j().url()});I({invitation:Js}).strict(),I({t:R(`invite`),secret:j().max(128).optional()}).strict(),I({url:j().url()}).strict();var Qs=I({instance:j().uuid(),refreshId:j().uuid().nullable(),upstream:L([`ready`,`upstream_expired`,`upstream_unavailable`,`protocol_mismatch`])}),$s=I({id:j(),hash:j(),lastUsed:N()}),ec=I({hash:j(),browser:j(),prefix:j()});I({version:R(1),origin:j(),target:j(),browsers:F($s),proxies:F(ec)});var tc={imageBytes:4*1024*1024,chunkBytes:64*1024,idleMs:6e4,lifetimeMs:5*6e4};za(`action`,[I({action:R(`start`),upload:j().uuid(),mime:us,size:N().int().positive().max(tc.imageBytes)}).strict(),I({action:R(`chunk`),upload:j().uuid(),offset:N().int().nonnegative().max(tc.imageBytes),data:j().min(4).max(4*Math.ceil(tc.chunkBytes/3)).regex(/^[A-Za-z0-9+/]+={0,2}$/).refine(e=>{let t=e.endsWith(`==`)?2:+!!e.endsWith(`=`);return e.length%4==0&&e.length/4*3-t<=tc.chunkBytes},`Image chunk is too large or malformed`)}).strict(),I({action:R(`finish`),upload:j().uuid()}).strict(),I({action:R(`cancel`),upload:j().uuid()}).strict()]);var nc=I({received:N().int().nonnegative().max(tc.imageBytes)});I({id:H,label:Rs,online:P()}),I({providers:F(L([`google`,`github`])),protocol:R(2)}),I({user:I({id:Ls,name:j(),email:j(),emailVerified:P(),twoFactorEnabled:P()}).nullable(),mfaRequired:P()}),I({label:Rs}).strict(),I({host:H,code:Fs,expires:N()}).strict(),I({code:Fs}).strict(),I({credential:Fs}).strict();var rc=I({challenge:Fs,label:Rs,service:zs,app:zs,expires:N().int().positive()}).strict(),ic=I({ready:P()}).strict();I({host:H,account:Ls,credential:Fs}).strict().extend({service:zs,app:zs,enabled:P()}).strict(),I({service:zs.optional(),app:zs.optional(),code:Fs.optional(),managed:P().default(!0)}).strict();var ac=F(N().int().min(0).max(255)).min(32).max(256);I({host:H,peer:Is,account:Ls,service:zs,label:j(),privateKey:ac}).strict();var oc=null;function sc(){return oc}function cc(e){return e}function lc(e){let t=new Set;return{get:()=>localStorage.getItem(cc(e)),set(n){n===null?localStorage.removeItem(cc(e)):localStorage.setItem(cc(e),n);for(let e of t)e()},subscribe(e){return t.add(e),()=>t.delete(e)}}}var uc=lc(`puddle.browser-authorisation`);async function dc(){localStorage.removeItem(`puddle.token`);let e=new URLSearchParams(window.location.hash.slice(1)),t=e.get(`invite`);if(e.has(`invite`)||e.has(`token`)){let e=new URL(window.location.href);e.hash=``,history.replaceState(null,``,e)}if(t)try{let e=await fetch(`/cockpit/bootstrap`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({invitation:t})});if(!e.ok)return;uc.set(Xs.parse(await e.json()).credential)}catch{}}function fc(){uc.set(null)}var pc=e(n(),1),mc=[{id:`system`,label:`System`},{id:`rangefinder`,label:`Rangefinder`},{id:`drafting`,label:`Drafting`},{id:`invert`,label:`Invert`}],hc=`system`;function gc(e){return mc.some(t=>t.id===e)?e:hc}var _c={uiFontSize:16,cursorPackage:hc,terminalFontSize:13,editorFontSize:14,density:`compact`,terminalScrollback:2e4,editorTabSize:2,editorWordWrap:!1,editorLinkSshHost:``,projectBasedLayout:!0,showAllProjectSessions:!0},vc=`puddle.client-settings`,yc=new Set,bc=null;function xc(e){let t={...e};return t.projectBasedLayout===void 0&&t.showAllProjectSessions!==void 0&&(t.projectBasedLayout=!t.showAllProjectSessions),t.showAllProjectSessions===void 0&&t.projectBasedLayout!==void 0&&(t.showAllProjectSessions=!t.projectBasedLayout),t}function Sc(e){return e.terminalScrollback===5e3?{...e,terminalScrollback:_c.terminalScrollback}:e}function Cc(){if(bc)return bc;let e={};try{e=JSON.parse(localStorage.getItem(vc)??`{}`)}catch{}let t={..._c,...Sc(xc(e))};return bc={...t,cursorPackage:gc(t.cursorPackage)},bc}function wc(e){document.documentElement.style.setProperty(`--ui-font-size`,`${e.uiFontSize}px`),document.documentElement.dataset.density=e.density,document.documentElement.dataset.cursorPackage=e.cursorPackage}function Tc(){return Cc()}function Ec(e){let t={...Cc(),...e};bc={...t,cursorPackage:gc(t.cursorPackage)},localStorage.setItem(vc,JSON.stringify(bc)),wc(bc);for(let e of yc)e()}function Dc(){wc(Cc())}function Oc(){return(0,pc.useSyncExternalStore)(e=>(yc.add(e),()=>yc.delete(e)),()=>Cc())}function kc(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}function Ac(e){return e.replace(/[%#? ]/g,e=>encodeURIComponent(e))}function jc(e,t,n){let r=kc(t);return n?`${e}://vscode-remote/ssh-remote+${Ac(n)}${r}`:`${e}://file${r}`}function Mc(e,t){return e.trim()||t||null}var Nc=lc(`puddle.host`);function Pc(){return Mc(Tc().editorLinkSshHost,Nc.get())}function Fc(e){return new URLSearchParams(e).get(`host`)?.trim()||null}function Ic(e,t,n){return Fc(e)||(/[#&](?:invite|token)=/.test(t)?null:n)}function Lc(){let e=Ic(window.location.search,window.location.hash,Nc.get());if(Nc.set(e),Fc(window.location.search)!==null){let e=new URL(window.location.href);e.searchParams.delete(`host`),history.replaceState(null,``,e)}}var Rc=[`dark`,`light`],U=`puddle.theme`,zc=`system`,Bc=`dark`,Vc=new Set;function Hc(){return window.matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`}function Uc(e){return e===`system`?Hc():e}function Wc(){let e=localStorage.getItem(U);return e===`system`||Rc.includes(e??``)?e:zc}function Gc(){let e=document.documentElement.dataset.theme;return Rc.includes(e??``)?e:Bc}function Kc(e){localStorage.setItem(U,e);let t=Uc(e);document.documentElement.dataset.theme=t;for(let e of Vc)e(t);return t}function qc(){Kc(Wc()),window.matchMedia(`(prefers-color-scheme: light)`).addEventListener(`change`,()=>{Wc()===`system`&&Kc(`system`)})}function Jc(e){return Vc.add(e),()=>Vc.delete(e)}function Yc(e){let t=/^#([0-9a-fA-F]{3,4})$/.exec(e);return t?.[1]?`#${[...t[1]].map(e=>e+e).join(``)}`:e}function Xc(){let e=getComputedStyle(document.documentElement);return t=>Yc(e.getPropertyValue(t).trim())}var Zc=4.5;function Qc(e){return{background:e(`--bg-base`),foreground:e(`--text-primary`),cursor:e(`--accent`),cursorAccent:e(`--bg-base`),selectionBackground:e(`--selection`),black:e(`--ansi-black`),red:e(`--ansi-red`),green:e(`--ansi-green`),yellow:e(`--ansi-yellow`),blue:e(`--ansi-blue`),magenta:e(`--ansi-magenta`),cyan:e(`--ansi-cyan`),white:e(`--ansi-white`),brightBlack:e(`--ansi-bright-black`),brightRed:e(`--ansi-bright-red`),brightGreen:e(`--ansi-bright-green`),brightYellow:e(`--ansi-bright-yellow`),brightBlue:e(`--ansi-bright-blue`),brightMagenta:e(`--ansi-bright-magenta`),brightCyan:e(`--ansi-bright-cyan`),brightWhite:e(`--ansi-bright-white`)}}function $c(){return Qc(Xc())}function el(e){return{theme:Qc(e),minimumContrastRatio:Zc}}function tl(){return el(Xc())}function W(e){return e.replace(`#`,``)}function nl(e,t){return{base:t===`light`?`vs`:`vs-dark`,inherit:!0,rules:[{token:`comment`,foreground:W(e(`--text-muted`)),fontStyle:`italic`},{token:`string`,foreground:W(e(`--ansi-green`))},{token:`number`,foreground:W(e(`--ansi-yellow`))},{token:`keyword`,foreground:W(e(`--ansi-blue`))},{token:`type`,foreground:W(e(`--ansi-cyan`))},{token:`function`,foreground:W(e(`--ansi-magenta`))}],colors:{"editor.background":e(`--bg-base`),"editor.foreground":e(`--text-primary`),"editor.selectionBackground":e(`--selection`),"editor.lineHighlightBackground":e(`--bg-surface`),"editorCursor.foreground":e(`--accent`),"editorLineNumber.foreground":e(`--text-muted`),"editorLineNumber.activeForeground":e(`--text-secondary`),"editorWidget.background":e(`--bg-elevated`),"editorWidget.border":e(`--border`),focusBorder:e(`--focus-ring`),"diffEditor.insertedTextBackground":e(`--diff-added`),"diffEditor.removedTextBackground":e(`--diff-removed`)}}}function rl(){return nl(Xc(),Gc())}var il=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),al=t(((e,t)=>{t.exports=il()})),ol=al(),sl=`modulepreload`,G=function(e){return`/`+e},cl={},ll=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=G(t,n),t=s(t),t in cl)return;cl[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:sl,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};qc(),Dc(),Lc(),dc().then(async()=>{let{App:e}=await ll(async()=>{let{App:e}=await import(`./App-CzuHShdO.js`);return{App:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]));(0,go.createRoot)(document.getElementById(`root`)).render((0,ol.jsx)(e,{}))});export{ko as $,Ps as A,ds as B,rc as C,Qs as D,nc as E,ws as F,Yo as G,ts as H,ms as I,Do as J,Xo as K,hs as L,As as M,Os as N,Zs as O,ys as P,jo as Q,ps as R,sc as S,tc as T,rs as U,ls as V,ss as W,Oo as X,Eo as Y,Ao as Z,mc as _,Gc as a,lc as b,Wc as c,jc as d,V as et,Pc as f,Oc as g,Ec as h,Xc as i,o as it,Us as j,Ws as k,$c as l,Tc as m,al as n,F as nt,rl as o,Nc as p,To as q,Kc as r,j as rt,Jc as s,ll as t,_o as tt,tl as u,fc as v,ic as w,cc as x,uc as y,us as z};
|