@puddle-code/cli 0.2.12 → 0.2.14
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 +8 -3
- package/dist/index.js +6 -4
- package/dist/public/assets/{App-DfAiKq3q.js → App-DmpTrUZ_.js} +2 -2
- package/dist/public/assets/{Dashboard-CSgMrIyy.js → Dashboard-B_Wl5BUW.js} +1 -1
- package/dist/public/assets/{EditorTabClose-D6Dp46I2.js → EditorTabClose-DgHiWUeH.js} +1 -1
- package/dist/public/assets/{FindWidget-BIkbrNkw.js → FindWidget-DvE5pM_m.js} +1 -1
- package/dist/public/assets/{LazyTerminal-C_4rCoYX.js → LazyTerminal-D_WH4lhZ.js} +2 -2
- package/dist/public/assets/{ModelRefcount-6ViCEZ-R.js → ModelRefcount-CrcIbyvv.js} +1 -1
- package/dist/public/assets/{NewProjectDialog-DmHU0eFH.js → NewProjectDialog-Cz1ogICv.js} +1 -1
- package/dist/public/assets/{PaneEditorBody-5o66FjJV.js → PaneEditorBody-B6bdrN7S.js} +4 -4
- package/dist/public/assets/PdfViewer-BHSLh8dm.js +2 -0
- package/dist/public/assets/{SettingsDialog-LcZ4sy2U.js → SettingsDialog-CfC9lvq9.js} +1 -1
- package/dist/public/assets/{Terminal-B-eGMj3C.js → Terminal-1wvLIdsn.js} +1 -1
- package/dist/public/assets/{Workspace-B4VAhexX.js → Workspace-BA7HLQtr.js} +4 -4
- package/dist/public/assets/{Workspace-DdBCUbGN.css → Workspace-HyAD9NTJ.css} +1 -1
- package/dist/public/assets/{abnfDiagram-VCTEODGH-BPIJ_6Xw.js → abnfDiagram-VCTEODGH-CYiBJCKB.js} +1 -1
- package/dist/public/assets/architecture-7GRP2DOG-lF7MgvlB.js +1 -0
- package/dist/public/assets/{architectureDiagram-5GKGNRK7-C3N-rgqa.js → architectureDiagram-5GKGNRK7-7dDnpr2A.js} +1 -1
- package/dist/public/assets/{blockDiagram-I7D4REHJ-CgWUBUrF.js → blockDiagram-I7D4REHJ-CnHBCey1.js} +1 -1
- package/dist/public/assets/{buffer-store-CW-AmjVB.js → buffer-store-DjjKlkBx.js} +2 -2
- package/dist/public/assets/{button-CX27Pdc8.js → button-C2U4JLSJ.js} +1 -1
- package/dist/public/assets/{c4Diagram-7LVT6UL2-BhQhjnur.js → c4Diagram-7LVT6UL2-Dh4L8JvS.js} +1 -1
- package/dist/public/assets/channel-QRQcomU6.js +1 -0
- package/dist/public/assets/{chunk-2E4U76K2-CEukLkTQ.js → chunk-2E4U76K2-DZ0SBCfs.js} +1 -1
- package/dist/public/assets/{chunk-4HAMMTFA-isaSrXBl.js → chunk-4HAMMTFA-DDQ7TZvS.js} +1 -1
- package/dist/public/assets/{chunk-75Z2AOVW-CjKKRNBO.js → chunk-75Z2AOVW-b-3efKur.js} +1 -1
- package/dist/public/assets/{chunk-CLGD4ZFX-Daexln-J.js → chunk-CLGD4ZFX-I3haxkb8.js} +1 -1
- package/dist/public/assets/{chunk-DU6HZSFF-BPZm7Aec.js → chunk-DU6HZSFF-DU6gnSTi.js} +1 -1
- package/dist/public/assets/{chunk-F27PBJKO-B0pTDJJ1.js → chunk-F27PBJKO-CLOxkQ_H.js} +1 -1
- package/dist/public/assets/{chunk-GMAD6QVW-Cj2ISoJT.js → chunk-GMAD6QVW-BgNxh1Wg.js} +1 -1
- package/dist/public/assets/{chunk-GVQU2GXP-B1MLdPUq.js → chunk-GVQU2GXP-CNaIDciQ.js} +1 -1
- package/dist/public/assets/{chunk-IMKFNOWR-fC5wMHoh.js → chunk-IMKFNOWR-B5c6xExk.js} +1 -1
- package/dist/public/assets/{chunk-L3NEJ4N5-BKN2lh_0.js → chunk-L3NEJ4N5-59iBItHO.js} +1 -1
- package/dist/public/assets/{chunk-OSK3NFVY-C1_C6p7q.js → chunk-OSK3NFVY-SdTDzoMy.js} +1 -1
- package/dist/public/assets/{chunk-P2QGCYS3-DChPIjch.js → chunk-P2QGCYS3-VniWvIJd.js} +1 -1
- package/dist/public/assets/{chunk-POPQ4Y6H-CnJnbyG8.js → chunk-POPQ4Y6H-BUjB1fDF.js} +1 -1
- package/dist/public/assets/{chunk-PWAF6VOD-Cait0vBS.js → chunk-PWAF6VOD--PrNfcDv.js} +1 -1
- package/dist/public/assets/{chunk-SHT3W25Y-fCVaJAUc.js → chunk-SHT3W25Y-iS7BNavD.js} +1 -1
- package/dist/public/assets/{chunk-SVP7TREG-sgjgeRKG.js → chunk-SVP7TREG-es_cu5SS.js} +1 -1
- package/dist/public/assets/{chunk-TICWLB2K-BetG1ZhS.js → chunk-TICWLB2K-CAQdSlKl.js} +1 -1
- package/dist/public/assets/{chunk-TLUHSLCS-CJQbxTzh.js → chunk-TLUHSLCS-CivtNrZW.js} +2 -2
- package/dist/public/assets/classDiagram-ZZMXUADV-ZU8dp57e.js +1 -0
- package/dist/public/assets/classDiagram-v2-VYDZK3BY-ZU8dp57e.js +1 -0
- package/dist/public/assets/{context-menu-CMBBLKmk.js → context-menu-C99CAwCo.js} +1 -1
- package/dist/public/assets/{cssMode-IW1OdmwV.js → cssMode-BYtLhrHD.js} +1 -1
- package/dist/public/assets/{cynefin-OW5HDTMX-flRiCKtv.js → cynefin-OW5HDTMX-CnreCTXF.js} +1 -1
- package/dist/public/assets/{cynefinDiagram-5FMLGOSQ-Brg4u3bj.js → cynefinDiagram-5FMLGOSQ-CBhOEGQq.js} +1 -1
- package/dist/public/assets/{dagre-GXQ25YYZ-C3SLKgND.js → dagre-GXQ25YYZ-CtMkNeKj.js} +1 -1
- package/dist/public/assets/{diagram-S7CK7UJ4-DyXUX4_O.js → diagram-S7CK7UJ4-BwGNVBES.js} +1 -1
- package/dist/public/assets/{diagram-UQ7AKVKN-BfX2meSB.js → diagram-UQ7AKVKN-NvnuUqC5.js} +1 -1
- package/dist/public/assets/{diagram-VSXAHHWV-D0gba8hn.js → diagram-VSXAHHWV-A1jhKo-L.js} +1 -1
- package/dist/public/assets/{diagram-VX7I27RA-Bk5DBOLt.js → diagram-VX7I27RA-Dm82GNqE.js} +1 -1
- package/dist/public/assets/{diagram-Z3DM3KII-BwqYVngK.js → diagram-Z3DM3KII-BfSG8tI1.js} +1 -1
- package/dist/public/assets/{dialog-2aSLI4Tq.js → dialog-BWYDvidH.js} +1 -1
- package/dist/public/assets/{disclosure-C5Bd_kvR.js → disclosure-BwmmXyDN.js} +1 -1
- package/dist/public/assets/{dist-BtWbkq62.js → dist-B1yD4sI3.js} +1 -1
- package/dist/public/assets/{dist-C0uGtrE7.js → dist-CXaqo3cO.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-PWID7BFC-DG5fHEYY.js → ebnfDiagram-PWID7BFC-CRZBgWXo.js} +1 -1
- package/dist/public/assets/{erDiagram-RLTQ6QDP-BlWtW0qx.js → erDiagram-RLTQ6QDP-BGgBvFkm.js} +1 -1
- package/dist/public/assets/eventmodeling-NTZA5JFV-D59DFIHa.js +1 -0
- package/dist/public/assets/flowDiagram-HODETNUW-B5A3kSmc.js +1 -0
- package/dist/public/assets/{ganttDiagram-EL5Y4UJY-BkUQHWc3.js → ganttDiagram-EL5Y4UJY-BPnnrdiz.js} +1 -1
- package/dist/public/assets/{gitGraph-4MIJSDKK-BWzzegLX.js → gitGraph-4MIJSDKK-DwnCyNC0.js} +1 -1
- package/dist/public/assets/{gitGraphDiagram-WWUBYQGX-D0s0u9Me.js → gitGraphDiagram-WWUBYQGX-DPK44hHT.js} +1 -1
- package/dist/public/assets/{hotkeys-BKwA6yDB.js → hotkeys-B5IFr8Wj.js} +1 -1
- package/dist/public/assets/{htmlMode-BC4FsaY_.js → htmlMode-DUwVyVGW.js} +1 -1
- package/dist/public/assets/{index-CHQCnqBC.js → index-BuCcWx9p.js} +2 -2
- package/dist/public/assets/index-DRbjjH1k.css +2 -0
- package/dist/public/assets/{info-A6RAGUB7-IH7GTf4S.js → info-A6RAGUB7-BZfkzQZ9.js} +1 -1
- package/dist/public/assets/{infoDiagram-27XIBGKW-CVxNf4pG.js → infoDiagram-27XIBGKW-De3RP-ip.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-5VMMS53U-IVaFsDaO.js → ishikawaDiagram-5VMMS53U-CgKS_YTG.js} +1 -1
- package/dist/public/assets/{journeyDiagram-3NMN7TZE-BBEWFzTv.js → journeyDiagram-3NMN7TZE-C3O0Ecte.js} +1 -1
- package/dist/public/assets/{jsonMode-C0auehlj.js → jsonMode-BXRjPbsP.js} +1 -1
- package/dist/public/assets/{kanban-definition-UXKFOSKX-D_SCywYG.js → kanban-definition-UXKFOSKX-CZ7RgNB2.js} +1 -1
- package/dist/public/assets/{line-DypWKsOp.js → line-4f0hVotd.js} +1 -1
- package/dist/public/assets/{media-refresh-store-CRu4LARy.js → media-refresh-store-DJBTfex1.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-DjudYqc1.js → mermaid-parser.core-BDA8Oa7i.js} +3 -3
- package/dist/public/assets/{mermaid.core-DYtpuPxI.js → mermaid.core-cvYygy5u.js} +3 -3
- package/dist/public/assets/{mindmap-definition-YA3MSWOX-D3E0udnH.js → mindmap-definition-YA3MSWOX-CWYhHFvQ.js} +1 -1
- package/dist/public/assets/{notification-permission-Dw2YIMNo.js → notification-permission-BKYFvjLt.js} +1 -1
- package/dist/public/assets/{packet-AYTQ26CC-BvfG3Y1e.js → packet-AYTQ26CC-CB-X1biA.js} +1 -1
- package/dist/public/assets/{pdf-mcnWpTlq.js → pdf-ZHMExUNo.js} +1 -1
- package/dist/public/assets/{pegDiagram-XKGWAZYB-CaTJykwA.js → pegDiagram-XKGWAZYB-2tLrxoF1.js} +1 -1
- package/dist/public/assets/{pie-WAS4IAKB-Dveh6y97.js → pie-WAS4IAKB-BIcZ1M_1.js} +1 -1
- package/dist/public/assets/{pieDiagram-E7YTZNPT-ORH8xXwQ.js → pieDiagram-E7YTZNPT-DBO0Vc1V.js} +1 -1
- package/dist/public/assets/{project-abbrev-Yyhq4IQP.js → project-abbrev-D6zdXeC-.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-AXDQQJYC-DdFjT0aX.js → quadrantDiagram-AXDQQJYC-81wtxryw.js} +1 -1
- package/dist/public/assets/{radar-RG4KPBEZ-CbhCH12U.js → radar-RG4KPBEZ-ChF4ZoCX.js} +1 -1
- package/dist/public/assets/{railroad-74A4TZTK-DkXypmnL.js → railroad-74A4TZTK-OtZozV0Q.js} +1 -1
- package/dist/public/assets/railroad-abnf-HS5TGJTU-BdWrV_su.js +1 -0
- package/dist/public/assets/railroad-ebnf-LZEXJU2U-BVjLGse_.js +1 -0
- package/dist/public/assets/railroad-peg-WCYAUIDC-B6r-AmeI.js +1 -0
- package/dist/public/assets/{railroadDiagram-O6MQD6OU-DH-SaFzu.js → railroadDiagram-O6MQD6OU-D0o8VE08.js} +1 -1
- package/dist/public/assets/{requirementDiagram-BXWQKSXE-haYgs9Q-.js → requirementDiagram-BXWQKSXE-3zzyqA14.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-P5KCCOFB-wX8wd8U1.js → sankeyDiagram-P5KCCOFB-hUUgKGHN.js} +1 -1
- package/dist/public/assets/{scroll-restoration-C0NMkov_.js → scroll-restoration-CuOEoIlj.js} +1 -1
- package/dist/public/assets/{selection-actions-DGAOYptr.js → selection-actions-BAD5y0Aa.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-WJ2MYXX4-59ksijVu.js → sequenceDiagram-WJ2MYXX4-Cwk3h-rN.js} +1 -1
- package/dist/public/assets/{stateDiagram-D77RDMKH-BunJS731.js → stateDiagram-D77RDMKH-BOHkHb7y.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-MP3YSRHH-CsZg8ab0.js +1 -0
- package/dist/public/assets/{swimlanes-42K2YHIH-D5uHbpLH.js → swimlanes-42K2YHIH-P69oIcuJ.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-VR7AAH4N-Dz_fGSxz.js +8 -0
- package/dist/public/assets/{switch-B-Im0urx.js → switch-Cw0Ot6EQ.js} +1 -1
- package/dist/public/assets/{timeline-definition-24CTP7MA-CuVByGqR.js → timeline-definition-24CTP7MA-DbMqQLnN.js} +1 -1
- package/dist/public/assets/{treeView-Q6P3EWNA-DHxF0zNv.js → treeView-Q6P3EWNA-B0EapB0i.js} +1 -1
- package/dist/public/assets/{treemap-WGGIJYW6-CFg5d1mh.js → treemap-WGGIJYW6-DlgZgQf2.js} +1 -1
- package/dist/public/assets/{tsMode-BuQo0vzE.js → tsMode-DZaSoOf6.js} +1 -1
- package/dist/public/assets/{use-ui-state-Hk9fQwqt.js → use-ui-state-BONthfkR.js} +1 -1
- package/dist/public/assets/{vennDiagram-4TSXK5OY-CtwdHTQ2.js → vennDiagram-4TSXK5OY-BympGav2.js} +1 -1
- package/dist/public/assets/{view-state-store-BYX2FoUu.js → view-state-store-DC0jfhBX.js} +1 -1
- package/dist/public/assets/{wardley-WFR3VGLG-D5WVjnK4.js → wardley-WFR3VGLG-Dbf8bnG7.js} +1 -1
- package/dist/public/assets/{wardleyDiagram-VM6X3IG4-D2gatdsS.js → wardleyDiagram-VM6X3IG4-BgekmxbV.js} +1 -1
- package/dist/public/assets/{ws-BJBexI14.js → ws-ffUcAuKj.js} +1 -1
- package/dist/public/assets/{xychartDiagram-S5SC5T6Z-Cv6sANRx.js → xychartDiagram-S5SC5T6Z-Ctmrmwdh.js} +1 -1
- package/dist/public/index.html +2 -2
- package/package.json +1 -1
- package/dist/public/assets/PdfViewer-CDlrkl8b.js +0 -2
- package/dist/public/assets/architecture-7GRP2DOG-Be8DTVg5.js +0 -1
- package/dist/public/assets/channel-DsunNb7S.js +0 -1
- package/dist/public/assets/classDiagram-ZZMXUADV-DUMFGmwl.js +0 -1
- package/dist/public/assets/classDiagram-v2-VYDZK3BY-DUMFGmwl.js +0 -1
- package/dist/public/assets/eventmodeling-NTZA5JFV-CurGGdyn.js +0 -1
- package/dist/public/assets/flowDiagram-HODETNUW-CTnIi_OX.js +0 -1
- package/dist/public/assets/index-DMliHgh7.css +0 -2
- package/dist/public/assets/railroad-abnf-HS5TGJTU-iVbgIOln.js +0 -1
- package/dist/public/assets/railroad-ebnf-LZEXJU2U-DPzo9l_H.js +0 -1
- package/dist/public/assets/railroad-peg-WCYAUIDC-AAqRdj9L.js +0 -1
- package/dist/public/assets/stateDiagram-v2-MP3YSRHH-a_qUh5oN.js +0 -1
- package/dist/public/assets/swimlanesDiagram-VR7AAH4N-C-DUVLJy.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./mermaid-parser.core-DjudYqc1.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-BPZm7Aec.js";import{g,i as _,m as v}from"./chunk-75Z2AOVW-CjKKRNBO.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-BDA8Oa7i.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-DU6gnSTi.js";import{g,i as _,m as v}from"./chunk-75Z2AOVW-b-3efKur.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-CHQCnqBC.js";import{i}from"./dist-BtWbkq62.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,t=1e4){return V({queryKey:[`repo-worktrees`,e],queryFn:()=>i(`GET`,`/api/repos/${e}/worktrees`),enabled:e!==void 0,staleTime:t})}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-BuCcWx9p.js";import{i}from"./dist-B1yD4sI3.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,t=1e4){return V({queryKey:[`repo-worktrees`,e],queryFn:()=>i(`GET`,`/api/repos/${e}/worktrees`),enabled:e!==void 0,staleTime:t})}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-DjjKlkBx.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-DmpTrUZ_.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-CZI7_Jkm.js","assets/dist-B1yD4sI3.js","assets/hotkeys-B5IFr8Wj.js","assets/project-abbrev-D6zdXeC-.js","assets/createLucideIcon-DyMAgLa3.js","assets/dialog-BWYDvidH.js","assets/button-C2U4JLSJ.js","assets/x-CZCUod6A.js","assets/LazyTerminal-D_WH4lhZ.js","assets/switch-Cw0Ot6EQ.js","assets/use-ui-state-BONthfkR.js","assets/preview-kind-QJSMKfUN.js","assets/debounce-B9DrqirV.js","assets/notification-permission-BKYFvjLt.js","assets/copy-CGsu8426.js","assets/NewProjectDialog-Cz1ogICv.js","assets/use-debounced-value-C86N-mOK.js","assets/protocol-support-C3qZDXsO.js","assets/ws-ffUcAuKj.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 b(e){if(h=!1,ee(e),!m)if(n(c)!==null)m=!0,x||(x=!0,oe());else{var t=n(l);t!==null&&le(b,t.startTime-e)}}var x=!1,te=-1,ne=5,re=-1;function ie(){return g?!0:!(e.unstable_now()-re<ne)}function ae(){if(g=!1,x){var t=e.unstable_now();re=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(te),te=-1),p=!0;var a=f;try{b:{for(ee(t),d=n(c);d!==null&&!(d.expirationTime>t&&ie());){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&&le(b,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?oe():x=!1}}}var oe;if(typeof y==`function`)oe=function(){y(ae)};else if(typeof MessageChannel<`u`){var se=new MessageChannel,ce=se.port2;se.port1.onmessage=ae,oe=function(){ce.postMessage(null)}}else oe=function(){_(ae,0)};function le(t,n){te=_(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`):ne=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(te),te=-1):h=!0,le(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,oe()))),r},e.unstable_shouldYield=ie,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`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),te=Symbol.for(`react.context`),ne=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.memo_cache_sentinel`),le=Symbol.iterator;function ue(e){return typeof e!=`object`||!e?null:(e=le&&e[le]||e[`@@iterator`],typeof e==`function`?e:null)}var de=Symbol.for(`react.client.reference`);function fe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case b:return`Profiler`;case ee:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case te:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case ne:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}var S=Array.isArray,C=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,w=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},me=[],he=-1;function ge(e){return{current:e}}function _e(e){0>he||(e.current=me[he],me[he]=null,he--)}function T(e,t){he++,me[he]=e.current,e.current=t}var ve=ge(null),ye=ge(null),be=ge(null),xe=ge(null);function Se(e,t){switch(T(be,t),T(ye,e),T(ve,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}}_e(ve),T(ve,e)}function Ce(){_e(ve),_e(ye),_e(be)}function we(e){e.memoizedState!==null&&T(xe,e);var t=ve.current,n=Hd(t,e.type);t!==n&&(T(ye,e),T(ve,n))}function Te(e){ye.current===e&&(_e(ve),_e(ye)),xe.current===e&&(_e(xe),Qf._currentValue=pe)}var Ee,De;function Oe(e){if(Ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ee=t&&t[1]||``,De=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+Ee+e+De}var ke=!1;function Ae(e,t){if(!e||ke)return``;ke=!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).`,To=`[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.`,Eo=`This session was interrupted (daemon or machine restart). Processes you started are gone; re-verify your environment before continuing.`,Do=[[`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`]],Oo="${name}",ko=[`navy`,`gold`,`blue`,`green`,`red`,`violet`,`cyan`];R({id:bo,name:So,branch_prefix:N(),icon:N().nullable().default(null),icon_colour:N().nullable().default(null),created_at:go}),R({name:So,branch_prefix:N().max(64).optional()}),R({name:So.optional(),branch_prefix:N().max(64).optional(),icon:N().max(64).nullable().optional(),icon_colour:N().max(32).nullable().optional()});var Ao=Na({baseBranch:N().optional(),separateBranch:I().optional(),separateWorktree:I().optional()}),jo=Na({agent:Ao.optional(),terminal:Ao.optional()});Na({allowSkipPermissions:I().default(!1),captureSessionEnv:I().default(!0),terminalAppShortcuts:I().default(!0),onboardingTemplate:N().optional(),concurrentTemplate:N().optional(),restartTemplate:N().optional(),tabTitleTemplate:N().optional(),projectOrder:L(N()).optional(),sessionDefaults:jo.optional(),hotkeys:Va(N(),N()).optional()}),Va(N(),Oa());var Mo=N().regex(/^untitled-\d+\.md$/);R({name:Mo}),R({name:Mo,content:N(),mtime_ms:F()}),R({content:N()}),R({mtime_ms:F()}),R({id:_o,profile_id:bo,agent_type:N(),label:N(),config_dir:N(),skip_permissions_default:I(),logged_in:I(),created_at:go}),R({profile_id:bo,agent_type:N().min(1),label:So,skip_permissions_default:I().optional(),import_dir:N().min(1).optional()}),R({label:So.optional(),skip_permissions_default:I().optional()}),R({stream:N(),term:N(),hint:N().optional()}),Na({account_id:_o,logged_in:I(),session_count:F().int().nonnegative(),active_session_count:F().int().nonnegative(),last_activity_at:go.nullable(),agent_usage:R({input_tokens:F().int().nonnegative(),output_tokens:F().int().nonnegative(),cache_read_input_tokens:F().int().nonnegative(),cache_creation_input_tokens:F().int().nonnegative(),message_count:F().int().nonnegative()}).nullable(),live_usage:R({captured_at:go,context_used_percentage:F().nullable(),total_cost_usd:F().nullable(),model:N().nullable()}).nullable(),subscription:R({windows:L(R({key:N(),label:N(),used_percentage:F(),resets:N().nullable()}))}).nullable()}),R({id:N(),display_name:N(),capabilities:R({resume:I(),skip_permissions:I()}),binary:N().optional(),available:I().optional()}),R({id:_o,path:N(),default_base_branch:N(),onboarding_notes:N().nullable(),fetch_enabled:I(),last_fetched_at:go.nullable()}).extend({orphan_worktrees:L(N())}),R({path:N().min(1),default_base_branch:N().optional(),onboarding_notes:N().nullable().optional(),fetch_enabled:I().optional()}),R({branches:L(R({name:N(),is_session:I(),session_title:N().nullable()}))});var No=R({path:N(),branch:N().nullable(),is_primary:I(),dirty:I().optional(),local_only:I().optional()}),Po=R({name:N(),local_only:I()});R({worktrees:L(No),orphan_branches:L(Po)}),R({default_base_branch:N().optional(),onboarding_notes:N().nullable().optional(),fetch_enabled:I().optional()});var Fo=z([`starting`,`running`,`waiting_input`,`exited`,`interrupted`,`archived`]),Io=z([`agent`,`terminal`]),Lo=R({id:vo,project_id:yo,account_id:_o.nullable(),worktree_path:N(),base_branch:N(),branch:N(),separate_branch:I(),kind:Io,agent_type:N().nullable(),agent_session_ref:N().nullable(),conversation_id:_o.nullable().optional(),parent_conversation_id:_o.nullable().optional(),title:N().nullable(),agent_title:N().nullable().optional(),conversation_missing:I().optional(),branch_owner:I().optional(),native_sync:z([`pending`,`full`,`fallback`]).optional(),osc_title:N().nullable().optional(),status:Fo,cwd:N().nullable().optional(),skip_permissions:I(),created_at:go,updated_at:go,last_activity_at:go.nullable(),worktree_missing:I().optional(),stale_running:I().optional(),git_summary:R({ahead:F().int().nonnegative(),behind:F().int().nonnegative(),dirty_files:F().int().nonnegative()}).nullable().optional()});R({project_id:yo,account_id:_o.optional(),kind:Io.optional(),base_branch:N().min(1).optional(),branch:N().min(1).max(200).optional(),separate_branch:I().optional(),separate_worktree:I().optional(),join_worktree:N().optional(),cwd:N().optional(),title:N().min(1).max(200).optional(),prompt:N().optional(),skip_permissions:I().optional()}),R({title:N().max(200)}),R({account_id:_o}),R({account_id:_o}),R({vars:L(R({name:N(),bytes:F().int().nonnegative(),value:N().optional()}))}),R({cleared:F().int().nonnegative()}),R({force:I().default(!1),delete_branch:I().default(!1)});var Ro=N().min(1).max(5),zo=R({id:yo,profile_id:bo,repo_id:_o,name:N(),abbrev:Ro.nullable().default(null),archived:I().default(!1),created_at:go,updated_at:go});R({profile_id:bo,repo_id:_o,name:N().min(1).max(100),abbrev:Ro.optional()}),R({name:N().min(1).max(100).optional(),abbrev:Ro.optional(),archived:I().optional()}),R({project:zo,sessions:L(Lo)});var Bo=z([`project`,`profile`]);R({id:_o,profile_id:bo,scope:Bo,project_id:yo.nullable(),title:N().nullable(),body:N(),tags:L(N()),agent_type:N().nullable(),position:F(),created_at:go,updated_at:go}),R({profile_id:bo,scope:Bo,project_id:yo.optional(),title:N().max(200).optional(),body:N().min(1),tags:L(N()).optional(),agent_type:N().optional()}),R({scope:Bo.optional(),project_id:yo.nullable().optional(),title:N().max(200).nullable().optional(),body:N().min(1).optional(),tags:L(N()).optional(),agent_type:N().nullable().optional(),position:F().optional()});var Vo=z([`on_demand`,`eager`]),Ho=R({session:vo,path:N().min(1),root:N().min(1).optional()}),Uo=N().regex(/^[a-z][a-z0-9_-]*$/);R({providers:L(R({id:Uo,display_name:N().min(1),extensions:L(N().regex(/^[a-z0-9]+$/)).min(1),input_extensions:L(N().regex(/^[a-z0-9]+$/)).min(1),available:I(),executor:N().min(1).nullable(),eager:I()}))});var Wo=R({source:Ho,provider:Uo.optional(),profile_id:bo.optional(),project_id:yo.optional()}),Go=R({role:N().min(1),media_type:N().min(1),file:Ho}),Ko=R({source:Ho,severity:z([`error`,`warning`,`info`]),message:N().min(1),line:F().int().positive(),column:F().int().positive().optional(),end_line:F().int().positive().optional(),end_column:F().int().positive().optional()}),qo=R({source:Ho.optional(),output:N().optional(),diagnostics:L(Ko).optional()}),Jo=qo.extend({message:N().min(1)}),Yo=R({provider:Uo,executor:N().min(1),revision:F().int().nonnegative(),source:Ho,artifacts:L(Go),navigation:R({kind:N().min(1)}).optional()});Wo.extend({mode:Vo}),R({provider:Uo,mode:Vo,state:z([`idle`,`running`,`succeeded`,`failed`]),revision:F().int().nonnegative(),result:Yo.nullable(),error:Jo.nullable()});var Xo=R({placeholder:N().regex(/^\{\{[a-z][a-z0-9_]*\}\}$/),description:N().min(1)}),Zo=R({mode:Vo,run_when:z([`when_clicked`,`upon_file_change`]),default_command:N().min(1).nullable(),override_command:N().min(1).nullable()}),Qo=Wo.extend({profile_id:bo,project_id:yo});R({provider:Uo,display_name:N().min(1),file_type:N().regex(/^[a-z0-9][a-z0-9_-]*$/),file_path:N().min(1),variables:L(Xo),commands:L(Zo).min(1)}),Qo.extend({mode:Vo,command:N().trim().min(1).max(16384).nullable()});var $o=`00000000-0000-0000-0000-000000000000`,es=R({session:vo,path:N(),kind:z([`file`,`diff`,`commit`,`external`,`untitled`]).optional(),sha:N().optional(),git_area:z([`staged`,`unstaged`]).optional(),root:N().optional(),view:z([`source`,`preview`,`linked`,`locked`]).optional(),compile_mode:Vo.optional(),generated_by:Uo.optional()}),ts=La(`type`,[R({type:B(`editor`),tab:es}),R({type:B(`terminal`),session:vo})]),ns=R({kind:B(`leaf`),id:N(),tabs:L(ts).default([]),activeKey:N().nullable().default(null),previewKey:N().nullable().default(null)}),rs=fo(()=>La(`kind`,[ns,R({kind:B(`split`),id:N(),direction:z([`row`,`col`]),children:L(rs),sizes:L(F())})])),is=Na({layout_tree:rs.nullable().default(null),active_session:vo.nullable().default(null),layout_ref:_o.nullable().default(null)}),as=Na({session_tabs:L(vo).default([]),active_session:vo.nullable().default(null),editor_tabs:L(es).default([]),layout:Na({}).default({}),explorer_pin:vo.nullable().default(null),active_editor_tab:es.nullable().default(null),explorer_open:I().default(!0),sidebar_mode:z([`files`,`diff`,`history`,`changes`,`search`,`worktrees`]).default(`files`),sidebar_collapsed:I().default(!1),sessions_collapsed:I().default(!1),right_panel:z([`sessions`,`scratchpad`]).optional(),session_order:L(vo).default([]),layout_tree:rs.nullable().default(null),layout_mode:z([`profile`,`project`]).optional(),project_layouts:Va(N(),is).default({}),layout_ref:_o.nullable().default(null)});R({ui_state:as}),R({ui_state:as,updated_at:go});var os=z([`project`,`profile`]);R({id:_o,profile_id:bo,scope:os,project_id:yo.nullable(),name:N(),layout_tree:rs.nullable(),active_session:vo.nullable(),created_at:go,updated_at:go}),R({profile_id:bo,scope:os,project_id:yo.optional(),name:N().min(1).max(200),layout_tree:rs.nullable(),active_session:vo.nullable().optional()}),R({name:N().min(1).max(200).optional(),layout_tree:rs.nullable().optional(),active_session:vo.nullable().optional()}),Ho.extend({root:N().min(1),page:F().int().positive(),x:F().finite().nonnegative(),y:F().finite().nonnegative()});var ss=Ho.extend({line:F().int().positive(),column:F().int().nonnegative().optional()}),cs=z([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);R({mime:cs,data:N().min(1)});var ls=R({path:N()});R({path:N(),line:F().int().nullable(),kind:z([`file`,`dir`]).optional(),relative_path:N().optional(),root:N().optional()});var us=R({name:N(),type:z([`file`,`dir`,`symlink`]),size:F().int().nonnegative().nullable(),symlink:I().default(!1)});R({path:N(),entries:L(us)});var ds=R({path:N(),content:N().nullable(),binary:I(),size:F().int().nonnegative(),mtime_ms:F()}),fs=R({mime:N().min(1).max(128),data:N().max(4*2796203)});R({content:N(),expected_mtime_ms:F().optional()}),R({path:N(),mtime_ms:F(),size:F().int().nonnegative()}),R({files:L(R({path:N(),size:F().int().nonnegative()}))}),R({path:N().min(1),kind:z([`file`,`dir`])}),R({from:N().min(1),to:N().min(1)}),R({from:N().min(1),to:N().min(1)}),R({operation:z([`copy`,`move`]),source:R({session_id:vo,root:N().optional()}),from:N().min(1),to:N().min(1)}),R({path:N().min(1)}),R({ok:B(!0),path:N()});var ps=z([`added`,`modified`,`deleted`,`renamed`]),ms=z([`staged`,`unstaged`]),hs=R({path:N(),status:ps,old_path:N().nullable()}),gs=R({against:N(),base_ref:N().nullable(),entries:L(hs),area:ms.optional()}),_s=z([`untracked`,`modified`,`added`,`deleted`,`renamed`,`conflicted`,`ignored`]),vs=R({path:N(),status:_s});R({entries:L(vs)});var ys=R({path:N(),status:_s.exclude([`ignored`]),old_path:N().nullable()});R({repositories:L(R({root:N(),relative_path:N(),name:N(),owning:I(),submodule:I(),initialised:I(),head:N().nullable(),branch:N().nullable(),detached:I(),upstream:N().nullable(),ahead:F().int().nonnegative(),behind:F().int().nonnegative(),has_remote:I(),staged:L(ys),unstaged:L(ys),conflicts:L(ys)})),entries:L(vs)});var bs=R({repository:N().min(1)});bs.extend({paths:L(N().min(1)).min(1)}),bs.extend({message:N().trim().min(1),stage_all:I().optional()}),bs.extend({set_upstream:I().optional()}),R({ok:B(!0),sha:N().optional()}),R({path:N(),content:N().nullable(),binary:I(),exists:I()}),R({path:N(),repository:N().nullable(),repository_path:N().nullable(),head:N().nullable(),content:N().nullable(),binary:I(),exists:I(),tracked:I(),ignored:I()});var xs=R({path:N(),ref:N(),content:N().nullable(),binary:I()}),Ss=R({sha:N(),subject:N(),author_name:N(),author_email:N(),authored_at:go,parents:L(N()).optional()});R({commits:L(Ss),has_more:I()}),R({commit:Ss.extend({body:N()}),parents:L(N()),files:L(hs)});var Cs=R({line:F().int().positive(),text:N()}),ws=R({path:N(),matches:L(Cs)});R({query:N(),files:L(N()),content:L(ws),truncated:I()}),R({ports:L(R({port:F().int().min(1).max(65535),pid:F().int(),command:N(),address:N()})),scanned_at:go}),R({refreshId:N().uuid()}).strict();var Ts=R({status:B(`refreshing`),refreshId:N().uuid(),instance:N().uuid()}),Es=N().regex(/^(agent|shell-[0-9]+)$/),Ds=`home`,Os={cols:F().int().min(2).max(1e3),rows:F().int().min(2).max(500)},ks=La(`t`,[R({t:B(`auth`),token:N().max(128),resource:N().regex(/^[a-f0-9]{64}$/).optional()}),R({t:B(`attach`),session:N(),term:Es,...Os}),R({t:B(`stdin`),session:N(),term:Es,data:N()}),R({t:B(`resize`),session:N(),term:Es,...Os}),R({t:B(`detach`),session:N(),term:Es}),R({t:B(`spawn-shell`),session:N()}),R({t:B(`kill-shell`),session:N(),term:Es}),R({t:B(`subscribe-status`)}),R({t:B(`theme`),fg:N().regex(/^#[0-9a-fA-F]{6}$/),bg:N().regex(/^#[0-9a-fA-F]{6}$/)})]),As=La(`t`,[R({t:B(`authenticated`)}),R({t:B(`shell-spawned`),session:N(),term:N()}),R({t:B(`replay`),session:N(),term:N(),data:N()}),R({t:B(`output`),session:N(),term:N(),data:N()}),R({t:B(`status`),session:N(),status:Fo,last_activity_at:N().nullable()}),R({t:B(`renamed`),session:N(),title:N().nullable(),agent_title:N().nullable().optional(),osc_title:N().nullable().optional()}),R({t:B(`exit`),session:N(),term:N(),code:F()}),R({t:B(`notice`),level:z([`error`,`warning`]),title:N(),detail:N().optional(),session:N().optional(),term:N().optional()}),R({t:B(`account`),account_id:F(),profile_id:N(),logged_in:I()}),R({t:B(`session-switched`),source_session:N(),target_session:N(),target_project:N(),cause:z([`clear`,`resume`,`fork`]),outcome:z([`rebound`,`focused-existing`])}),R({t:B(`sessions-changed`),project_ids:L(N())}),R({t:B(`error`),message:N()})]),js={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},W=N().uuid(),Ms=N().regex(/^[a-f0-9]{64}$/),Ns=N().min(20).max(128),Ps=N().min(1).max(128),Fs=N().trim().min(1).max(80).regex(/^[^\u0000-\u001f\u007f]+$/),Is=N().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`),Ls=R({version:B(3),service:Is,host:W,peer:Ns,invitation:Ms,expires:F().int().positive()}).strict();R({t:B(`connect`),host:W}).strict(),La(`t`,[R({t:B(`registered`),host:W}).strict(),R({t:B(`open`),connection:W,account:Ps}).strict(),R({t:B(`ready`),connection:W,account:Ps}).strict()]);var Rs=R({id:W,peer:Ns,account:Ps,label:Fs,created:F(),lastUsed:F(),expires:F(),status:z([`pending`,`approved`,`revoked`])}),zs=La(`t`,[R({t:B(`status`)}).strict(),R({t:B(`pair`)}).strict(),R({t:B(`devices`)}).strict(),R({t:B(`approve`),id:W}).strict(),R({t:B(`revoke`),id:W}).strict(),R({t:B(`disable`)}).strict()]),Bs=R({enabled:I().optional(),connected:I().optional(),host:W.optional(),peer:Ns.optional(),invitation:Ls.optional(),url:N().url().optional(),devices:L(Rs).optional(),error:N().max(256).optional()}).strict();La(`t`,[R({t:B(`hello`),account:Ps,label:Fs,invitation:Ms.optional()}).strict(),R({t:B(`pending`),device:Rs}).strict(),R({t:B(`admitted`),generation:W,device:W}).strict(),R({t:B(`challenge`),nonce:Ms,generation:W}).strict(),R({t:B(`participate`),nonce:Ms,generation:W,resources:L(W).max(js.requests+1)}).strict(),R({t:B(`request`),id:W,method:z([`GET`,`POST`,`PATCH`]),path:N().max(8192),body:Oa().optional()}).strict(),R({t:B(`response`),id:W,status:F().int().min(100).max(599),body:Oa()}).strict(),R({t:B(`cancel`),id:W}).strict(),R({t:B(`stream`),id:W}).strict(),R({t:B(`terminal`),id:W,message:ks}).strict(),R({t:B(`event`),message:As}).strict(),R({t:B(`sent`),id:W}).strict(),R({t:B(`admin`),id:W,request:zs}).strict(),R({t:B(`admin-result`),id:W,result:Bs}).strict(),R({t:B(`error`),code:z([`rejected`,`expired`,`unavailable`,`protocol_mismatch`]),message:N().max(256)}).strict()]),R({id:W,index:F().int().min(0).max(8192),end:I(),data:N().max(js.chunkBytes)}).strict(),R({id:W,label:Fs,online:I()}),R({providers:L(z([`google`,`github`])),protocol:B(3)}),R({user:R({id:Ps,name:N(),email:N(),emailVerified:I(),twoFactorEnabled:I()}).nullable(),mfaRequired:I()}),R({label:Fs}).strict(),R({host:W,code:Ms,expires:F()}).strict(),R({code:Ms}).strict(),R({credential:Ms}).strict();var Vs=R({challenge:Ms,label:Fs,service:Is,app:Is,expires:F().int().positive()}).strict(),Hs=R({ready:I()}).strict();R({host:W,account:Ps,credential:Ms}).strict().extend({service:Is,app:Is,enabled:I()}).strict();var Us=R({service:Is.optional(),app:Is.optional(),code:Ms.optional(),managed:I().default(!0)}).strict(),Ws=L(F().int().min(0).max(255)).min(32).max(256);R({host:W,peer:Ns,account:Ps,service:Is,label:N(),privateKey:Ws}).strict();var Gs=Fa([zs,R({t:B(`delete_registration`)}).strict()]);Fa([Gs,R({t:B(`enable`),registration:R({service:Is,app:Is,code:Ms}).strict().optional()}).strict(),R({t:B(`reset`)}).strict()]),R({service:Is,code:Ms}).strict();var Ks=R({availability:z([`ready`,`not_installed`,`upgrade_required`]),configured:I(),enabled:I(),connected:I(),canDeleteRegistration:I().optional(),supervisor:z([`systemd`,`launchd`]).nullable(),host:W.optional(),peer:Ns.optional(),service:Is.optional(),app:Is.optional(),devices:L(Rs)});R({profile:bo}).strict(),R({profile:bo,request:Gs}).strict(),R({profile:bo,setup:Us}).strict();var qs=N().regex(/^[a-f0-9]{64}$/),Js=N().regex(/^cn_[a-f0-9]{64}$/),Ys=N().regex(/^br_[a-f0-9]{64}$/),Xs=N().regex(/^iv_[a-f0-9]{64}$/);z([`browser_rejected`,`upstream_expired`,`upstream_unavailable`,`protocol_mismatch`]),La(`t`,[R({t:B(`open`),profile:bo.optional()}).strict(),R({t:B(`renew`),resources:L(qs).max(2048)}).strict(),R({t:B(`close`)}).strict()]);var Zs=R({t:B(`inspection`),port:F().int().min(1).max(65535),version:U,liveSessions:F().int().nonnegative()});La(`t`,[R({t:B(`authority`),generation:N().uuid(),token:Js.optional(),validForMs:F().int().positive().max(45e3),port:F().int().min(1).max(65535),version:U}).strict(),Zs,R({t:B(`error`),code:z([`unavailable`,`rejected`,`invalid_control`])}).strict()]),R({invitation:Xs}).strict();var Qs=R({credential:Ys});R({status:B(`revoked`)}),R({session:N().uuid(),port:F().int().min(1).max(65535)}).extend({path:N().max(8192).default(`/`)});var $s=R({url:N().url()});R({invitation:Xs}).strict(),R({t:B(`invite`),secret:N().max(128).optional()}).strict(),R({url:N().url()}).strict();var ec=R({instance:N().uuid(),refreshId:N().uuid().nullable(),upstream:z([`ready`,`upstream_expired`,`upstream_unavailable`,`protocol_mismatch`])}),tc=R({id:N(),hash:N(),lastUsed:F()}),nc=R({hash:N(),browser:N(),prefix:N()});R({version:B(1),origin:N(),target:N(),browsers:L(tc),proxies:L(nc)});var rc={imageBytes:4*1024*1024,chunkBytes:64*1024,idleMs:6e4,lifetimeMs:5*6e4};La(`action`,[R({action:B(`start`),upload:N().uuid(),mime:cs,size:F().int().positive().max(rc.imageBytes)}).strict(),R({action:B(`chunk`),upload:N().uuid(),offset:F().int().nonnegative().max(rc.imageBytes),data:N().min(4).max(4*Math.ceil(rc.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<=rc.chunkBytes},`Image chunk is too large or malformed`)}).strict(),R({action:B(`finish`),upload:N().uuid()}).strict(),R({action:B(`cancel`),upload:N().uuid()}).strict()]);var ic=R({received:F().int().nonnegative().max(rc.imageBytes)}),ac=null;function oc(){return ac}function sc(e){return e}function cc(e){let t=new Set;return{get:()=>localStorage.getItem(sc(e)),set(n){n===null?localStorage.removeItem(sc(e)):localStorage.setItem(sc(e),n);for(let e of t)e()},subscribe(e){return t.add(e),()=>t.delete(e)}}}var lc=cc(`puddle.browser-authorisation`);async function uc(){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;lc.set(Qs.parse(await e.json()).credential)}catch{}}function dc(){lc.set(null)}var fc=e(n(),1),pc=[{id:`system`,label:`System`},{id:`rangefinder`,label:`Rangefinder`},{id:`drafting`,label:`Drafting`},{id:`invert`,label:`Invert`}],mc=`system`;function hc(e){return pc.some(t=>t.id===e)?e:mc}var gc={uiFontSize:16,cursorPackage:mc,terminalFontSize:13,editorFontSize:14,density:`compact`,terminalScrollback:2e4,editorTabSize:2,editorWordWrap:!1,editorLinkSshHost:``,projectBasedLayout:!0,showAllProjectSessions:!0},_c=`puddle.client-settings`,vc=new Set,yc=null;function bc(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 xc(e){return e.terminalScrollback===5e3?{...e,terminalScrollback:gc.terminalScrollback}:e}function Sc(){if(yc)return yc;let e={};try{e=JSON.parse(localStorage.getItem(_c)??`{}`)}catch{}let t={...gc,...xc(bc(e))};return yc={...t,cursorPackage:hc(t.cursorPackage)},yc}function Cc(e){document.documentElement.style.setProperty(`--ui-font-size`,`${e.uiFontSize}px`),document.documentElement.dataset.density=e.density,document.documentElement.dataset.cursorPackage=e.cursorPackage}function wc(){return Sc()}function Tc(e){let t={...Sc(),...e};yc={...t,cursorPackage:hc(t.cursorPackage)},localStorage.setItem(_c,JSON.stringify(yc)),Cc(yc);for(let e of vc)e()}function Ec(){Cc(Sc())}function Dc(){return(0,fc.useSyncExternalStore)(e=>(vc.add(e),()=>vc.delete(e)),()=>Sc())}function Oc(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}function kc(e){return e.replace(/[%#? ]/g,e=>encodeURIComponent(e))}function Ac(e,t,n){let r=Oc(t);return n?`${e}://vscode-remote/ssh-remote+${kc(n)}${r}`:`${e}://file${r}`}function jc(e,t){return e.trim()||t||null}var Mc=cc(`puddle.host`);function Nc(){return jc(wc().editorLinkSshHost,Mc.get())}function Pc(e){return new URLSearchParams(e).get(`host`)?.trim()||null}function Fc(e,t,n){return Pc(e)||(/[#&](?:invite|token)=/.test(t)?null:n)}function Ic(){let e=Fc(window.location.search,window.location.hash,Mc.get());if(Mc.set(e),Pc(window.location.search)!==null){let e=new URL(window.location.href);e.searchParams.delete(`host`),history.replaceState(null,``,e)}}var G=[`dark`,`light`],Lc=`puddle.theme`,Rc=`system`,zc=`dark`,Bc=new Set;function Vc(){return window.matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`}function Hc(e){return e===`system`?Vc():e}function Uc(){let e=localStorage.getItem(Lc);return e===`system`||G.includes(e??``)?e:Rc}function Wc(){let e=document.documentElement.dataset.theme;return G.includes(e??``)?e:zc}function Gc(e){localStorage.setItem(Lc,e);let t=Hc(e);document.documentElement.dataset.theme=t;for(let e of Bc)e(t);return t}function Kc(){Gc(Uc()),window.matchMedia(`(prefers-color-scheme: light)`).addEventListener(`change`,()=>{Uc()===`system`&&Gc(`system`)})}function qc(e){return Bc.add(e),()=>Bc.delete(e)}function Jc(e){let t=/^#([0-9a-fA-F]{3,4})$/.exec(e);return t?.[1]?`#${[...t[1]].map(e=>e+e).join(``)}`:e}function Yc(){let e=getComputedStyle(document.documentElement);return t=>Jc(e.getPropertyValue(t).trim())}var Xc=4.5;function Zc(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 Qc(){return Zc(Yc())}function $c(e){return{theme:Zc(e),minimumContrastRatio:Xc}}function el(){return $c(Yc())}function tl(e){return e.replace(`#`,``)}function nl(e,t){return{base:t===`light`?`vs`:`vs-dark`,inherit:!0,rules:[{token:`comment`,foreground:tl(e(`--text-muted`)),fontStyle:`italic`},{token:`string`,foreground:tl(e(`--ansi-green`))},{token:`number`,foreground:tl(e(`--ansi-yellow`))},{token:`keyword`,foreground:tl(e(`--ansi-blue`))},{token:`type`,foreground:tl(e(`--ansi-cyan`))},{token:`function`,foreground:tl(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(Yc(),Wc())}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`,cl=function(e){return`/`+e},ll={},ul=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=cl(t,n),t=s(t),t in ll)return;ll[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)})};Kc(),Ec(),Ic(),uc().then(async()=>{let{App:e}=await ul(async()=>{let{App:e}=await import(`./App-DfAiKq3q.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,mo.createRoot)(document.getElementById(`root`)).render((0,ol.jsx)(e,{}))});export{U as $,js as A,ss as B,rc as C,Ks as D,$s as E,xs as F,Jo as G,ts as H,ds as I,wo as J,Co as K,fs as L,Ds as M,Ts as N,Vs as O,gs as P,Do as Q,cs as R,oc as S,ec as T,as as U,$o as V,qo as W,Oo as X,Eo as Y,ko as Z,pc as _,Wc as a,cc as b,Uc as c,Ac as d,ho as et,Nc as f,Dc as g,Tc as h,Yc as i,Bs as j,Hs as k,Qc as l,wc as m,al as n,N as nt,rl as o,Mc as p,To as q,Gc as r,o as rt,qc as s,ul as t,L as tt,el as u,dc as v,ic as w,sc as x,lc as y,ls as z};
|
|
82
|
+
Then proceed with the task below (or await instructions if none is given).`,To=`[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.`,Eo=`This session was interrupted (daemon or machine restart). Processes you started are gone; re-verify your environment before continuing.`,Do=[[`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`]],Oo="${name}",ko=[`navy`,`gold`,`blue`,`green`,`red`,`violet`,`cyan`];R({id:bo,name:So,branch_prefix:N(),icon:N().nullable().default(null),icon_colour:N().nullable().default(null),created_at:go}),R({name:So,branch_prefix:N().max(64).optional()}),R({name:So.optional(),branch_prefix:N().max(64).optional(),icon:N().max(64).nullable().optional(),icon_colour:N().max(32).nullable().optional()});var Ao=Na({baseBranch:N().optional(),separateBranch:I().optional(),separateWorktree:I().optional()}),jo=Na({agent:Ao.optional(),terminal:Ao.optional()});Na({allowSkipPermissions:I().default(!1),captureSessionEnv:I().default(!0),terminalAppShortcuts:I().default(!0),onboardingTemplate:N().optional(),concurrentTemplate:N().optional(),restartTemplate:N().optional(),tabTitleTemplate:N().optional(),projectOrder:L(N()).optional(),sessionDefaults:jo.optional(),hotkeys:Va(N(),N()).optional()}),Va(N(),Oa());var Mo=N().regex(/^untitled-\d+\.md$/);R({name:Mo}),R({name:Mo,content:N(),mtime_ms:F()}),R({content:N()}),R({mtime_ms:F()}),R({id:_o,profile_id:bo,agent_type:N(),label:N(),config_dir:N(),skip_permissions_default:I(),logged_in:I(),created_at:go}),R({profile_id:bo,agent_type:N().min(1),label:So,skip_permissions_default:I().optional(),import_dir:N().min(1).optional()}),R({label:So.optional(),skip_permissions_default:I().optional()}),R({stream:N(),term:N(),hint:N().optional()}),Na({account_id:_o,logged_in:I(),session_count:F().int().nonnegative(),active_session_count:F().int().nonnegative(),last_activity_at:go.nullable(),agent_usage:R({input_tokens:F().int().nonnegative(),output_tokens:F().int().nonnegative(),cache_read_input_tokens:F().int().nonnegative(),cache_creation_input_tokens:F().int().nonnegative(),message_count:F().int().nonnegative()}).nullable(),live_usage:R({captured_at:go,context_used_percentage:F().nullable(),total_cost_usd:F().nullable(),model:N().nullable()}).nullable(),subscription:R({windows:L(R({key:N(),label:N(),used_percentage:F(),resets:N().nullable()}))}).nullable()}),R({id:N(),display_name:N(),capabilities:R({resume:I(),skip_permissions:I()}),binary:N().optional(),available:I().optional()}),R({id:_o,path:N(),default_base_branch:N(),onboarding_notes:N().nullable(),fetch_enabled:I(),last_fetched_at:go.nullable()}).extend({orphan_worktrees:L(N())}),R({path:N().min(1),default_base_branch:N().optional(),onboarding_notes:N().nullable().optional(),fetch_enabled:I().optional()}),R({branches:L(R({name:N(),is_session:I(),session_title:N().nullable()}))});var No=R({path:N(),branch:N().nullable(),is_primary:I(),dirty:I().optional(),local_only:I().optional()}),Po=R({name:N(),local_only:I()});R({worktrees:L(No),orphan_branches:L(Po)}),R({default_base_branch:N().optional(),onboarding_notes:N().nullable().optional(),fetch_enabled:I().optional()});var Fo=z([`starting`,`running`,`waiting_input`,`exited`,`interrupted`,`archived`]),Io=z([`agent`,`terminal`]),Lo=R({id:vo,project_id:yo,account_id:_o.nullable(),worktree_path:N(),base_branch:N(),branch:N(),separate_branch:I(),kind:Io,agent_type:N().nullable(),agent_session_ref:N().nullable(),conversation_id:_o.nullable().optional(),parent_conversation_id:_o.nullable().optional(),title:N().nullable(),agent_title:N().nullable().optional(),conversation_missing:I().optional(),branch_owner:I().optional(),native_sync:z([`pending`,`full`,`fallback`]).optional(),osc_title:N().nullable().optional(),status:Fo,cwd:N().nullable().optional(),skip_permissions:I(),created_at:go,updated_at:go,last_activity_at:go.nullable(),worktree_missing:I().optional(),stale_running:I().optional(),git_summary:R({ahead:F().int().nonnegative(),behind:F().int().nonnegative(),dirty_files:F().int().nonnegative()}).nullable().optional()});R({project_id:yo,account_id:_o.optional(),kind:Io.optional(),base_branch:N().min(1).optional(),branch:N().min(1).max(200).optional(),separate_branch:I().optional(),separate_worktree:I().optional(),join_worktree:N().optional(),cwd:N().optional(),title:N().min(1).max(200).optional(),prompt:N().optional(),skip_permissions:I().optional()}),R({title:N().max(200)}),R({account_id:_o}),R({account_id:_o}),R({vars:L(R({name:N(),bytes:F().int().nonnegative(),value:N().optional()}))}),R({cleared:F().int().nonnegative()}),R({force:I().default(!1),delete_branch:I().default(!1)});var Ro=N().min(1).max(5),zo=R({id:yo,profile_id:bo,repo_id:_o,name:N(),abbrev:Ro.nullable().default(null),archived:I().default(!1),created_at:go,updated_at:go});R({profile_id:bo,repo_id:_o,name:N().min(1).max(100),abbrev:Ro.optional()}),R({name:N().min(1).max(100).optional(),abbrev:Ro.optional(),archived:I().optional()}),R({project:zo,sessions:L(Lo)});var Bo=z([`project`,`profile`]);R({id:_o,profile_id:bo,scope:Bo,project_id:yo.nullable(),title:N().nullable(),body:N(),tags:L(N()),agent_type:N().nullable(),position:F(),created_at:go,updated_at:go}),R({profile_id:bo,scope:Bo,project_id:yo.optional(),title:N().max(200).optional(),body:N().min(1),tags:L(N()).optional(),agent_type:N().optional()}),R({scope:Bo.optional(),project_id:yo.nullable().optional(),title:N().max(200).nullable().optional(),body:N().min(1).optional(),tags:L(N()).optional(),agent_type:N().nullable().optional(),position:F().optional()});var Vo=z([`on_demand`,`eager`]),Ho=R({session:vo,path:N().min(1),root:N().min(1).optional()}),Uo=N().regex(/^[a-z][a-z0-9_-]*$/);R({providers:L(R({id:Uo,display_name:N().min(1),extensions:L(N().regex(/^[a-z0-9]+$/)).min(1),input_extensions:L(N().regex(/^[a-z0-9]+$/)).min(1),available:I(),executor:N().min(1).nullable(),eager:I()}))});var Wo=R({source:Ho,provider:Uo.optional(),profile_id:bo.optional(),project_id:yo.optional()}),Go=R({role:N().min(1),media_type:N().min(1),file:Ho}),Ko=R({source:Ho,severity:z([`error`,`warning`,`info`]),message:N().min(1),line:F().int().positive(),column:F().int().positive().optional(),end_line:F().int().positive().optional(),end_column:F().int().positive().optional()}),qo=R({source:Ho.optional(),output:N().optional(),diagnostics:L(Ko).optional()}),Jo=qo.extend({message:N().min(1)}),Yo=R({provider:Uo,executor:N().min(1),revision:F().int().nonnegative(),source:Ho,artifacts:L(Go),navigation:R({kind:N().min(1)}).optional()});Wo.extend({mode:Vo}),R({provider:Uo,mode:Vo,state:z([`idle`,`running`,`succeeded`,`failed`]),revision:F().int().nonnegative(),result:Yo.nullable(),error:Jo.nullable()});var Xo=R({placeholder:N().regex(/^\{\{[a-z][a-z0-9_]*\}\}$/),description:N().min(1)}),Zo=R({mode:Vo,run_when:z([`when_clicked`,`upon_file_change`]),default_command:N().min(1).nullable(),override_command:N().min(1).nullable()}),Qo=Wo.extend({profile_id:bo,project_id:yo});R({provider:Uo,display_name:N().min(1),file_type:N().regex(/^[a-z0-9][a-z0-9_-]*$/),file_path:N().min(1),variables:L(Xo),commands:L(Zo).min(1)}),Qo.extend({mode:Vo,command:N().trim().min(1).max(16384).nullable()});var $o=`00000000-0000-0000-0000-000000000000`,es=R({session:vo,path:N(),kind:z([`file`,`diff`,`commit`,`external`,`untitled`]).optional(),sha:N().optional(),git_area:z([`staged`,`unstaged`]).optional(),root:N().optional(),view:z([`source`,`preview`,`linked`,`locked`]).optional(),compile_mode:Vo.optional(),generated_by:Uo.optional()}),ts=La(`type`,[R({type:B(`editor`),tab:es}),R({type:B(`terminal`),session:vo})]),ns=R({kind:B(`leaf`),id:N(),tabs:L(ts).default([]),activeKey:N().nullable().default(null),previewKey:N().nullable().default(null)}),rs=fo(()=>La(`kind`,[ns,R({kind:B(`split`),id:N(),direction:z([`row`,`col`]),children:L(rs),sizes:L(F())})])),is=Na({layout_tree:rs.nullable().default(null),active_session:vo.nullable().default(null),layout_ref:_o.nullable().default(null)}),as=Na({session_tabs:L(vo).default([]),active_session:vo.nullable().default(null),editor_tabs:L(es).default([]),layout:Na({}).default({}),explorer_pin:vo.nullable().default(null),active_editor_tab:es.nullable().default(null),explorer_open:I().default(!0),sidebar_mode:z([`files`,`diff`,`history`,`changes`,`search`,`worktrees`]).default(`files`),sidebar_collapsed:I().default(!1),sessions_collapsed:I().default(!1),right_panel:z([`sessions`,`scratchpad`]).optional(),session_order:L(vo).default([]),layout_tree:rs.nullable().default(null),layout_mode:z([`profile`,`project`]).optional(),project_layouts:Va(N(),is).default({}),layout_ref:_o.nullable().default(null)});R({ui_state:as}),R({ui_state:as,updated_at:go});var os=z([`project`,`profile`]);R({id:_o,profile_id:bo,scope:os,project_id:yo.nullable(),name:N(),layout_tree:rs.nullable(),active_session:vo.nullable(),created_at:go,updated_at:go}),R({profile_id:bo,scope:os,project_id:yo.optional(),name:N().min(1).max(200),layout_tree:rs.nullable(),active_session:vo.nullable().optional()}),R({name:N().min(1).max(200).optional(),layout_tree:rs.nullable().optional(),active_session:vo.nullable().optional()}),Ho.extend({root:N().min(1),page:F().int().positive(),x:F().finite().nonnegative(),y:F().finite().nonnegative()});var ss=Ho.extend({line:F().int().positive(),column:F().int().nonnegative().optional()}),cs=z([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);R({mime:cs,data:N().min(1)});var ls=R({path:N()});R({path:N(),line:F().int().nullable(),kind:z([`file`,`dir`]).optional(),relative_path:N().optional(),root:N().optional()});var us=R({name:N(),type:z([`file`,`dir`,`symlink`]),size:F().int().nonnegative().nullable(),symlink:I().default(!1)});R({path:N(),entries:L(us)});var ds=R({path:N(),content:N().nullable(),binary:I(),size:F().int().nonnegative(),mtime_ms:F()}),fs=R({mime:N().min(1).max(128),data:N().max(4*2796203)});R({content:N(),expected_mtime_ms:F().optional()}),R({path:N(),mtime_ms:F(),size:F().int().nonnegative()}),R({files:L(R({path:N(),size:F().int().nonnegative()}))}),R({path:N().min(1),kind:z([`file`,`dir`])}),R({from:N().min(1),to:N().min(1)}),R({from:N().min(1),to:N().min(1)}),R({operation:z([`copy`,`move`]),source:R({session_id:vo,root:N().optional()}),from:N().min(1),to:N().min(1)}),R({path:N().min(1)}),R({ok:B(!0),path:N()});var ps=z([`added`,`modified`,`deleted`,`renamed`]),ms=z([`staged`,`unstaged`]),hs=R({path:N(),status:ps,old_path:N().nullable()}),gs=R({against:N(),base_ref:N().nullable(),entries:L(hs),area:ms.optional()}),_s=z([`untracked`,`modified`,`added`,`deleted`,`renamed`,`conflicted`,`ignored`]),vs=R({path:N(),status:_s});R({entries:L(vs)});var ys=R({path:N(),status:_s.exclude([`ignored`]),old_path:N().nullable()});R({repositories:L(R({root:N(),relative_path:N(),name:N(),owning:I(),submodule:I(),initialised:I(),head:N().nullable(),branch:N().nullable(),detached:I(),upstream:N().nullable(),ahead:F().int().nonnegative(),behind:F().int().nonnegative(),has_remote:I(),staged:L(ys),unstaged:L(ys),conflicts:L(ys)})),entries:L(vs)});var bs=R({repository:N().min(1)});bs.extend({paths:L(N().min(1)).min(1)}),bs.extend({message:N().trim().min(1),stage_all:I().optional()}),bs.extend({set_upstream:I().optional()}),R({ok:B(!0),sha:N().optional()}),R({path:N(),content:N().nullable(),binary:I(),exists:I()}),R({path:N(),repository:N().nullable(),repository_path:N().nullable(),head:N().nullable(),content:N().nullable(),binary:I(),exists:I(),tracked:I(),ignored:I()});var xs=R({path:N(),ref:N(),content:N().nullable(),binary:I()}),Ss=R({sha:N(),subject:N(),author_name:N(),author_email:N(),authored_at:go,parents:L(N()).optional()});R({commits:L(Ss),has_more:I()}),R({commit:Ss.extend({body:N()}),parents:L(N()),files:L(hs)});var Cs=R({line:F().int().positive(),text:N()}),ws=R({path:N(),matches:L(Cs)});R({query:N(),files:L(N()),content:L(ws),truncated:I()}),R({ports:L(R({port:F().int().min(1).max(65535),pid:F().int(),command:N(),address:N()})),scanned_at:go}),R({refreshId:N().uuid()}).strict();var Ts=R({status:B(`refreshing`),refreshId:N().uuid(),instance:N().uuid()}),Es=N().regex(/^(agent|shell-[0-9]+)$/),Ds=`home`,Os={cols:F().int().min(2).max(1e3),rows:F().int().min(2).max(500)},ks=La(`t`,[R({t:B(`auth`),token:N().max(128),resource:N().regex(/^[a-f0-9]{64}$/).optional()}),R({t:B(`attach`),session:N(),term:Es,...Os}),R({t:B(`stdin`),session:N(),term:Es,data:N()}),R({t:B(`resize`),session:N(),term:Es,...Os}),R({t:B(`detach`),session:N(),term:Es}),R({t:B(`spawn-shell`),session:N()}),R({t:B(`kill-shell`),session:N(),term:Es}),R({t:B(`subscribe-status`)}),R({t:B(`theme`),fg:N().regex(/^#[0-9a-fA-F]{6}$/),bg:N().regex(/^#[0-9a-fA-F]{6}$/)})]),As=La(`t`,[R({t:B(`authenticated`)}),R({t:B(`shell-spawned`),session:N(),term:N()}),R({t:B(`replay`),session:N(),term:N(),data:N()}),R({t:B(`output`),session:N(),term:N(),data:N()}),R({t:B(`status`),session:N(),status:Fo,last_activity_at:N().nullable()}),R({t:B(`renamed`),session:N(),title:N().nullable(),agent_title:N().nullable().optional(),osc_title:N().nullable().optional()}),R({t:B(`exit`),session:N(),term:N(),code:F()}),R({t:B(`notice`),level:z([`error`,`warning`]),title:N(),detail:N().optional(),session:N().optional(),term:N().optional()}),R({t:B(`account`),account_id:F(),profile_id:N(),logged_in:I()}),R({t:B(`session-switched`),source_session:N(),target_session:N(),target_project:N(),cause:z([`clear`,`resume`,`fork`]),outcome:z([`rebound`,`focused-existing`])}),R({t:B(`sessions-changed`),project_ids:L(N())}),R({t:B(`error`),message:N()})]),js={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},W=N().uuid(),Ms=N().regex(/^[a-f0-9]{64}$/),Ns=N().min(20).max(128),Ps=N().min(1).max(128),Fs=N().trim().min(1).max(80).regex(/^[^\u0000-\u001f\u007f]+$/),Is=N().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`),Ls=R({version:B(3),service:Is,host:W,peer:Ns,invitation:Ms,expires:F().int().positive()}).strict();R({t:B(`connect`),host:W}).strict(),La(`t`,[R({t:B(`registered`),host:W}).strict(),R({t:B(`open`),connection:W,account:Ps}).strict(),R({t:B(`ready`),connection:W,account:Ps}).strict()]);var Rs=R({id:W,peer:Ns,account:Ps,label:Fs,created:F(),lastUsed:F(),expires:F(),status:z([`pending`,`approved`,`revoked`])}),zs=La(`t`,[R({t:B(`status`)}).strict(),R({t:B(`pair`)}).strict(),R({t:B(`devices`)}).strict(),R({t:B(`approve`),id:W}).strict(),R({t:B(`revoke`),id:W}).strict(),R({t:B(`disable`)}).strict()]),Bs=R({enabled:I().optional(),connected:I().optional(),host:W.optional(),peer:Ns.optional(),invitation:Ls.optional(),url:N().url().optional(),devices:L(Rs).optional(),error:N().max(256).optional()}).strict();La(`t`,[R({t:B(`hello`),account:Ps,label:Fs,invitation:Ms.optional()}).strict(),R({t:B(`pending`),device:Rs}).strict(),R({t:B(`admitted`),generation:W,device:W}).strict(),R({t:B(`challenge`),nonce:Ms,generation:W}).strict(),R({t:B(`participate`),nonce:Ms,generation:W,resources:L(W).max(js.requests+1)}).strict(),R({t:B(`request`),id:W,method:z([`GET`,`POST`,`PATCH`]),path:N().max(8192),body:Oa().optional()}).strict(),R({t:B(`response`),id:W,status:F().int().min(100).max(599),body:Oa()}).strict(),R({t:B(`cancel`),id:W}).strict(),R({t:B(`stream`),id:W}).strict(),R({t:B(`terminal`),id:W,message:ks}).strict(),R({t:B(`event`),message:As}).strict(),R({t:B(`sent`),id:W}).strict(),R({t:B(`admin`),id:W,request:zs}).strict(),R({t:B(`admin-result`),id:W,result:Bs}).strict(),R({t:B(`error`),code:z([`rejected`,`expired`,`unavailable`,`protocol_mismatch`]),message:N().max(256)}).strict()]),R({id:W,index:F().int().min(0).max(8192),end:I(),data:N().max(js.chunkBytes)}).strict(),R({id:W,label:Fs,online:I()}),R({providers:L(z([`google`,`github`])),protocol:B(3)}),R({user:R({id:Ps,name:N(),email:N(),emailVerified:I(),twoFactorEnabled:I()}).nullable(),mfaRequired:I()}),R({label:Fs}).strict(),R({host:W,code:Ms,expires:F()}).strict(),R({code:Ms}).strict(),R({credential:Ms}).strict();var Vs=R({challenge:Ms,label:Fs,service:Is,app:Is,expires:F().int().positive()}).strict(),Hs=R({ready:I()}).strict();R({host:W,account:Ps,credential:Ms}).strict().extend({service:Is,app:Is,enabled:I()}).strict();var Us=R({service:Is.optional(),app:Is.optional(),code:Ms.optional(),managed:I().default(!0)}).strict(),Ws=L(F().int().min(0).max(255)).min(32).max(256);R({host:W,peer:Ns,account:Ps,service:Is,label:N(),privateKey:Ws}).strict();var Gs=Fa([zs,R({t:B(`delete_registration`)}).strict()]);Fa([Gs,R({t:B(`enable`),registration:R({service:Is,app:Is,code:Ms}).strict().optional()}).strict(),R({t:B(`reset`)}).strict()]),R({service:Is,code:Ms}).strict();var Ks=R({availability:z([`ready`,`not_installed`,`upgrade_required`]),configured:I(),enabled:I(),connected:I(),canDeleteRegistration:I().optional(),supervisor:z([`systemd`,`launchd`]).nullable(),host:W.optional(),peer:Ns.optional(),service:Is.optional(),app:Is.optional(),devices:L(Rs)});R({profile:bo}).strict(),R({profile:bo,request:Gs}).strict(),R({profile:bo,setup:Us}).strict();var qs=N().regex(/^[a-f0-9]{64}$/),Js=N().regex(/^cn_[a-f0-9]{64}$/),Ys=N().regex(/^br_[a-f0-9]{64}$/),Xs=N().regex(/^iv_[a-f0-9]{64}$/);z([`browser_rejected`,`upstream_expired`,`upstream_unavailable`,`protocol_mismatch`]),La(`t`,[R({t:B(`open`),profile:bo.optional()}).strict(),R({t:B(`renew`),resources:L(qs).max(2048)}).strict(),R({t:B(`close`)}).strict()]);var Zs=R({t:B(`inspection`),port:F().int().min(1).max(65535),version:U,liveSessions:F().int().nonnegative()});La(`t`,[R({t:B(`authority`),generation:N().uuid(),token:Js.optional(),validForMs:F().int().positive().max(45e3),port:F().int().min(1).max(65535),version:U}).strict(),Zs,R({t:B(`error`),code:z([`unavailable`,`rejected`,`invalid_control`])}).strict()]),R({invitation:Xs}).strict();var Qs=R({credential:Ys});R({status:B(`revoked`)}),R({session:N().uuid(),port:F().int().min(1).max(65535)}).extend({path:N().max(8192).default(`/`)});var $s=R({url:N().url()});R({invitation:Xs}).strict(),R({t:B(`invite`),secret:N().max(128).optional()}).strict(),R({url:N().url()}).strict();var ec=R({instance:N().uuid(),refreshId:N().uuid().nullable(),upstream:z([`ready`,`upstream_expired`,`upstream_unavailable`,`protocol_mismatch`])}),tc=R({id:N(),hash:N(),lastUsed:F()}),nc=R({hash:N(),browser:N(),prefix:N()});R({version:B(1),origin:N(),target:N(),browsers:L(tc),proxies:L(nc)});var rc={imageBytes:4*1024*1024,chunkBytes:64*1024,idleMs:6e4,lifetimeMs:5*6e4};La(`action`,[R({action:B(`start`),upload:N().uuid(),mime:cs,size:F().int().positive().max(rc.imageBytes)}).strict(),R({action:B(`chunk`),upload:N().uuid(),offset:F().int().nonnegative().max(rc.imageBytes),data:N().min(4).max(4*Math.ceil(rc.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<=rc.chunkBytes},`Image chunk is too large or malformed`)}).strict(),R({action:B(`finish`),upload:N().uuid()}).strict(),R({action:B(`cancel`),upload:N().uuid()}).strict()]);var ic=R({received:F().int().nonnegative().max(rc.imageBytes)}),ac=null;function oc(){return ac}function sc(e){return e}function cc(e){let t=new Set;return{get:()=>localStorage.getItem(sc(e)),set(n){n===null?localStorage.removeItem(sc(e)):localStorage.setItem(sc(e),n);for(let e of t)e()},subscribe(e){return t.add(e),()=>t.delete(e)}}}var lc=cc(`puddle.browser-authorisation`);async function uc(){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;lc.set(Qs.parse(await e.json()).credential)}catch{}}function dc(){lc.set(null)}var fc=e(n(),1),pc=[{id:`system`,label:`System`},{id:`rangefinder`,label:`Rangefinder`},{id:`drafting`,label:`Drafting`},{id:`invert`,label:`Invert`}],mc=`system`;function hc(e){return pc.some(t=>t.id===e)?e:mc}var gc={uiFontSize:16,cursorPackage:mc,terminalFontSize:13,editorFontSize:14,density:`compact`,terminalScrollback:2e4,editorTabSize:2,editorWordWrap:!1,editorLinkSshHost:``,projectBasedLayout:!0,showAllProjectSessions:!0},_c=`puddle.client-settings`,vc=new Set,yc=null;function bc(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 xc(e){return e.terminalScrollback===5e3?{...e,terminalScrollback:gc.terminalScrollback}:e}function Sc(){if(yc)return yc;let e={};try{e=JSON.parse(localStorage.getItem(_c)??`{}`)}catch{}let t={...gc,...xc(bc(e))};return yc={...t,cursorPackage:hc(t.cursorPackage)},yc}function Cc(e){document.documentElement.style.setProperty(`--ui-font-size`,`${e.uiFontSize}px`),document.documentElement.dataset.density=e.density,document.documentElement.dataset.cursorPackage=e.cursorPackage}function wc(){return Sc()}function Tc(e){let t={...Sc(),...e};yc={...t,cursorPackage:hc(t.cursorPackage)},localStorage.setItem(_c,JSON.stringify(yc)),Cc(yc);for(let e of vc)e()}function Ec(){Cc(Sc())}function Dc(){return(0,fc.useSyncExternalStore)(e=>(vc.add(e),()=>vc.delete(e)),()=>Sc())}function Oc(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}function kc(e){return e.replace(/[%#? ]/g,e=>encodeURIComponent(e))}function Ac(e,t,n){let r=Oc(t);return n?`${e}://vscode-remote/ssh-remote+${kc(n)}${r}`:`${e}://file${r}`}function jc(e,t){return e.trim()||t||null}var Mc=cc(`puddle.host`);function Nc(){return jc(wc().editorLinkSshHost,Mc.get())}function Pc(e){return new URLSearchParams(e).get(`host`)?.trim()||null}function Fc(e,t,n){return Pc(e)||(/[#&](?:invite|token)=/.test(t)?null:n)}function Ic(){let e=Fc(window.location.search,window.location.hash,Mc.get());if(Mc.set(e),Pc(window.location.search)!==null){let e=new URL(window.location.href);e.searchParams.delete(`host`),history.replaceState(null,``,e)}}var G=[`dark`,`light`],Lc=`puddle.theme`,Rc=`system`,zc=`dark`,Bc=new Set;function Vc(){return window.matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`}function Hc(e){return e===`system`?Vc():e}function Uc(){let e=localStorage.getItem(Lc);return e===`system`||G.includes(e??``)?e:Rc}function Wc(){let e=document.documentElement.dataset.theme;return G.includes(e??``)?e:zc}function Gc(e){localStorage.setItem(Lc,e);let t=Hc(e);document.documentElement.dataset.theme=t;for(let e of Bc)e(t);return t}function Kc(){Gc(Uc()),window.matchMedia(`(prefers-color-scheme: light)`).addEventListener(`change`,()=>{Uc()===`system`&&Gc(`system`)})}function qc(e){return Bc.add(e),()=>Bc.delete(e)}function Jc(e){let t=/^#([0-9a-fA-F]{3,4})$/.exec(e);return t?.[1]?`#${[...t[1]].map(e=>e+e).join(``)}`:e}function Yc(){let e=getComputedStyle(document.documentElement);return t=>Jc(e.getPropertyValue(t).trim())}var Xc=4.5;function Zc(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 Qc(){return Zc(Yc())}function $c(e){return{theme:Zc(e),minimumContrastRatio:Xc}}function el(){return $c(Yc())}function tl(e){return e.replace(`#`,``)}function nl(e,t){return{base:t===`light`?`vs`:`vs-dark`,inherit:!0,rules:[{token:`comment`,foreground:tl(e(`--text-muted`)),fontStyle:`italic`},{token:`string`,foreground:tl(e(`--ansi-green`))},{token:`number`,foreground:tl(e(`--ansi-yellow`))},{token:`keyword`,foreground:tl(e(`--ansi-blue`))},{token:`type`,foreground:tl(e(`--ansi-cyan`))},{token:`function`,foreground:tl(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(Yc(),Wc())}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`,cl=function(e){return`/`+e},ll={},ul=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=cl(t,n),t=s(t),t in ll)return;ll[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)})};Kc(),Ec(),Ic(),uc().then(async()=>{let{App:e}=await ul(async()=>{let{App:e}=await import(`./App-DmpTrUZ_.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,mo.createRoot)(document.getElementById(`root`)).render((0,ol.jsx)(e,{}))});export{U as $,js as A,ss as B,rc as C,Ks as D,$s as E,xs as F,Jo as G,ts as H,ds as I,wo as J,Co as K,fs as L,Ds as M,Ts as N,Vs as O,gs as P,Do as Q,cs as R,oc as S,ec as T,as as U,$o as V,qo as W,Oo as X,Eo as Y,ko as Z,pc as _,Wc as a,cc as b,Uc as c,Ac as d,ho as et,Nc as f,Dc as g,Tc as h,Yc as i,Bs as j,Hs as k,Qc as l,wc as m,al as n,N as nt,rl as o,Mc as p,To as q,Gc as r,o as rt,qc as s,ul as t,L as tt,el as u,dc as v,ic as w,sc as x,lc as y,ls as z};
|