@staff0rd/assist 0.1184.0 → 0.1185.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-files +303 -301
- package/dist/{acceptanceCriteria-SLOFMJWS.js → acceptanceCriteria-BTQDLULJ.js} +2 -2
- package/dist/{add-4QMH6R4T.js → add-7DAC5W2W.js} +11 -11
- package/dist/{add-A2AYOU3X.js → add-MZCK3R75.js} +12 -12
- package/dist/{add-UKTNIEOE.js → add-YGWMQIDK.js} +5 -5
- package/dist/{addActivity-Z5MLKDWA.js → addActivity-VWFJOAEG.js} +15 -15
- package/dist/{addPhase-X523ER6L.js → addPhase-I6IY7FEJ.js} +18 -18
- package/dist/{advise-LODJWGM5.js → advise-7I4S5K2M.js} +8 -8
- package/dist/{analyze-WFFDLZQU.js → analyze-NW4ZFOCH.js} +9 -9
- package/dist/{askCheck-IOQTH5XX.js → askCheck-YRVKCMID.js} +19 -19
- package/dist/{askDesign-USQZ325D.js → askDesign-SJ3MNPFE.js} +5 -5
- package/dist/{askQuestion-GJOIBEES.js → askQuestion-HH2PCX3D.js} +2 -2
- package/dist/{associateGithub-ZKGDQLEE.js → associateGithub-C6SLR3UC.js} +11 -11
- package/dist/{associateJira-MNS74IPL.js → associateJira-WOGV7V3U.js} +11 -11
- package/dist/{backup-YXQWRVQX.js → backup-MPCOJXTK.js} +6 -6
- package/dist/{blockCodeComments-63L7F6T4.js → blockCodeComments-WV2DDN76.js} +3 -3
- package/dist/{branch-SCWKTAHT.js → branch-5QSVUNDX.js} +12 -12
- package/dist/built-version +1 -1
- package/dist/{chunk-YZRAEDBO.js → chunk-22EV6N3N.js} +1 -1
- package/dist/{chunk-4IPAHXEY.js → chunk-26ZJFULO.js} +1 -1
- package/dist/{chunk-4OYAS4FY.js → chunk-2BXG4NQG.js} +2 -2
- package/dist/{chunk-BY2RUZMD.js → chunk-2RUGZQUD.js} +2 -2
- package/dist/{chunk-TAKV63YW.js → chunk-2RYBRXTJ.js} +2 -2
- package/dist/{chunk-AHGWDOR4.js → chunk-3UQ3L5WR.js} +3 -3
- package/dist/{chunk-6O7EFYYQ.js → chunk-43UV77PT.js} +4 -4
- package/dist/{chunk-VWE6MAHT.js → chunk-4QBROVCM.js} +1 -1
- package/dist/{chunk-QDXJDFNJ.js → chunk-5CNDLMYO.js} +1 -1
- package/dist/{chunk-RORAHBCJ.js → chunk-5SXNWSSH.js} +1 -1
- package/dist/{chunk-C4V76PIG.js → chunk-5YO2D7JF.js} +1 -1
- package/dist/{chunk-5Y7WEJN5.js → chunk-655A7RGF.js} +1 -1
- package/dist/{chunk-6Z5ZFMOK.js → chunk-664TLOAJ.js} +1 -1
- package/dist/{chunk-D4VFSP5N.js → chunk-66K6EK7O.js} +1 -1
- package/dist/{chunk-U7AMGD5M.js → chunk-6GYYLGSL.js} +1 -1
- package/dist/{chunk-OZYO3TWV.js → chunk-6K75OLQN.js} +2 -2
- package/dist/{chunk-KHBZVMTI.js → chunk-6QO66MJ4.js} +2 -2
- package/dist/{chunk-FKPXA6JH.js → chunk-6VCFPUNV.js} +1 -1
- package/dist/{chunk-7NON2SOP.js → chunk-7F22C6MC.js} +1 -1
- package/dist/{chunk-FHQCHJGE.js → chunk-7KVL2L7Z.js} +2 -2
- package/dist/{chunk-BCPHWGET.js → chunk-7LNVF7KF.js} +3 -3
- package/dist/{chunk-2Y774DMJ.js → chunk-7OWMI6MW.js} +1 -1
- package/dist/{chunk-BK5EYUSP.js → chunk-7YBIKUGH.js} +4 -4
- package/dist/{chunk-LMOV3JYR.js → chunk-A5PV6HEK.js} +1 -1
- package/dist/{chunk-JJ74F2P6.js → chunk-ACEJSQDN.js} +3 -3
- package/dist/{chunk-ZW2JMSTJ.js → chunk-AH7XVN5D.js} +1 -1
- package/dist/{chunk-NIXPQAFT.js → chunk-AUATODOI.js} +2 -2
- package/dist/{chunk-VG3MVSEY.js → chunk-AYZKB6AU.js} +1 -1
- package/dist/{chunk-XKJJ7CSC.js → chunk-B2XNGBON.js} +4 -4
- package/dist/{chunk-WSU6N6UY.js → chunk-BFGH34XT.js} +1 -1
- package/dist/{chunk-3Y3VVI23.js → chunk-BJNES5JB.js} +4 -4
- package/dist/{chunk-COVJ6KFD.js → chunk-BXGPF3TG.js} +13 -9
- package/dist/{chunk-JQRXCIMN.js → chunk-C6C5BLVW.js} +2 -2
- package/dist/{chunk-PPFJHCMQ.js → chunk-C6WGPBBN.js} +2 -2
- package/dist/{chunk-GMZZH3NG.js → chunk-D4K2EXMS.js} +9 -9
- package/dist/{chunk-AFBVLMAJ.js → chunk-DGQ7KOW4.js} +1 -1
- package/dist/{chunk-BZOP4WBR.js → chunk-DJMOTMNX.js} +54 -54
- package/dist/{chunk-ESOUBS6M.js → chunk-DWXXA5BF.js} +2 -2
- package/dist/{chunk-3KBHTKBJ.js → chunk-EITOI7YF.js} +1 -1
- package/dist/{chunk-XQDZ4AFD.js → chunk-ES5IPLDM.js} +1 -1
- package/dist/{chunk-2PO6HLR6.js → chunk-EVTO23NP.js} +2 -2
- package/dist/{chunk-PBUFRWMB.js → chunk-FAYB2ZL6.js} +1 -1
- package/dist/{chunk-WYMMKFRW.js → chunk-FJLEKQLN.js} +3 -3
- package/dist/{chunk-ZJMB4FR7.js → chunk-FLDRXYEM.js} +10 -1
- package/dist/chunk-FQZ6D3OJ.js +13 -0
- package/dist/{chunk-AF2N6DQA.js → chunk-G3CJH2XK.js} +1 -1
- package/dist/{chunk-LJBRFKVU.js → chunk-GURN5643.js} +2 -2
- package/dist/{chunk-AB6R7R3S.js → chunk-H2KHIEQF.js} +1 -1
- package/dist/{chunk-PFDFOWX6.js → chunk-H7EUPSJB.js} +2 -2
- package/dist/{chunk-6U2RYRLS.js → chunk-HI6T3DND.js} +1 -1
- package/dist/{chunk-WZWZZKXK.js → chunk-HIOA4WIF.js} +1 -1
- package/dist/{chunk-F5362RBL.js → chunk-HTWP3CTM.js} +2 -2
- package/dist/{chunk-DZ63MNUG.js → chunk-HUWALF4X.js} +5 -5
- package/dist/{chunk-TH6Y7OK4.js → chunk-I5WU4LMN.js} +5 -5
- package/dist/{chunk-WDDYURVQ.js → chunk-I7WSEOJX.js} +1 -1
- package/dist/{chunk-WWPT4BOD.js → chunk-IBVCCKC3.js} +2 -2
- package/dist/{chunk-W2VCUKA4.js → chunk-IDRVSAV5.js} +2 -2
- package/dist/{chunk-XTGZ6CXY.js → chunk-IHZGFTOB.js} +1 -1
- package/dist/{chunk-JYGMYVUF.js → chunk-IISY3AMC.js} +4 -4
- package/dist/{chunk-7ADEWYV3.js → chunk-IMEG34TV.js} +1 -1
- package/dist/{chunk-G72EPR4G.js → chunk-ISIVSUR5.js} +1 -1
- package/dist/{chunk-7B4TM3EA.js → chunk-IULYBBGP.js} +3 -3
- package/dist/{chunk-CUSCQWIM.js → chunk-IXVSWYW2.js} +1 -1
- package/dist/{chunk-B2OH3RAT.js → chunk-J2PPCMCR.js} +1 -1
- package/dist/{chunk-6C45VMGR.js → chunk-J7SNTS4M.js} +1 -1
- package/dist/{chunk-IVU2B2DV.js → chunk-JFBD33EV.js} +5 -5
- package/dist/{chunk-KVIW7FOK.js → chunk-JMEYVW4M.js} +1 -1
- package/dist/{chunk-QYXD4GZN.js → chunk-KBG335EU.js} +5 -5
- package/dist/{chunk-QZPGZF4J.js → chunk-KOA2T5AC.js} +5 -5
- package/dist/{chunk-OSZLOSQ7.js → chunk-KYB4QM5B.js} +5 -5
- package/dist/{chunk-T7GVTJ6K.js → chunk-KZX6UIKC.js} +1 -1
- package/dist/{chunk-RFB7FJDF.js → chunk-LBTJOD75.js} +2 -2
- package/dist/{chunk-ZUXPVZHJ.js → chunk-LD27GZVA.js} +1 -1
- package/dist/{chunk-7Z4FT2ZQ.js → chunk-LIN3HTLF.js} +1 -1
- package/dist/{chunk-FXJ6JYJA.js → chunk-LJF44BOU.js} +3 -3
- package/dist/{chunk-5R23DWGC.js → chunk-LTETA6J4.js} +2 -2
- package/dist/{chunk-B734T35U.js → chunk-LXL7IJDI.js} +7 -7
- package/dist/{chunk-ULIZVNYC.js → chunk-MKT6HLUK.js} +3 -3
- package/dist/{chunk-G7YKWBJI.js → chunk-MT2LAO3P.js} +1 -1
- package/dist/{chunk-NVTKGLHM.js → chunk-N45WGW2P.js} +1 -1
- package/dist/{chunk-FTIJZZQP.js → chunk-NA7DJG7B.js} +1 -1
- package/dist/{chunk-3CMKKJHU.js → chunk-NFD2LJ2B.js} +1 -1
- package/dist/{chunk-EUXPITGV.js → chunk-NGVE6SZL.js} +4 -4
- package/dist/{chunk-ZPGJZFFQ.js → chunk-NPYFCGGD.js} +4 -4
- package/dist/{chunk-JDPIT22R.js → chunk-NULLVW23.js} +11 -11
- package/dist/{chunk-7XTWLKFV.js → chunk-O3SCSMQJ.js} +1 -1
- package/dist/{chunk-UXHNN5NF.js → chunk-O6RBWPG2.js} +1 -1
- package/dist/{chunk-R33Q64FL.js → chunk-OXQ6C5S4.js} +2 -2
- package/dist/{chunk-WMCTKW7P.js → chunk-P56S7RYB.js} +1 -1
- package/dist/{chunk-NADFF4WE.js → chunk-PBA5AY4X.js} +2 -2
- package/dist/{chunk-BI3ORSJ6.js → chunk-QAU4ACLB.js} +2 -2
- package/dist/{chunk-AOEJRVBE.js → chunk-QBRRDTBJ.js} +1 -1
- package/dist/{chunk-2OAW4T47.js → chunk-QCKGNH44.js} +3 -3
- package/dist/{chunk-BDMLW7FT.js → chunk-RNLMOKGH.js} +1 -1
- package/dist/{chunk-M3OUR6EO.js → chunk-RTRVDYHK.js} +1 -1
- package/dist/{chunk-SJFAFWR7.js → chunk-RW6YKTIM.js} +1 -1
- package/dist/{chunk-DLWEFC6J.js → chunk-RWVRH774.js} +1 -1
- package/dist/{chunk-VQG3J77A.js → chunk-RZBCBCNG.js} +3 -3
- package/dist/{chunk-ZM5VU2NX.js → chunk-SHWMHL7S.js} +1 -1
- package/dist/{chunk-6BPHYRZT.js → chunk-SORWZAHF.js} +1 -1
- package/dist/{chunk-VOVS2VNU.js → chunk-SVCR2A7L.js} +2 -2
- package/dist/{chunk-NNTNZBO7.js → chunk-TE2FHIWS.js} +1 -1
- package/dist/{chunk-MSR5UBCL.js → chunk-TEBEVYZR.js} +2 -2
- package/dist/{chunk-QHE5XU2M.js → chunk-TJM6UIF2.js} +3 -3
- package/dist/{chunk-RH7HJX2O.js → chunk-TSRTRJU4.js} +1 -1
- package/dist/{chunk-2I4XK5MA.js → chunk-UETLXHQ4.js} +1 -1
- package/dist/{chunk-W7Y4YARD.js → chunk-UFSOFNXQ.js} +1 -1
- package/dist/{chunk-XHPQVAVX.js → chunk-UPGNKZVA.js} +2 -2
- package/dist/{chunk-2DBMDQH4.js → chunk-UYSNEOWQ.js} +1 -1
- package/dist/{chunk-SEHUEJ2O.js → chunk-VAFCLLQN.js} +1 -1
- package/dist/{chunk-L5PRCU3S.js → chunk-VDKJH36N.js} +2 -2
- package/dist/{chunk-SXKO56ET.js → chunk-W4T6HQPP.js} +1 -1
- package/dist/{chunk-NGEJFH3F.js → chunk-WBDH7XCZ.js} +170 -165
- package/dist/{chunk-6A7PMRDC.js → chunk-WMMPGPFK.js} +2 -2
- package/dist/{chunk-MIWJUXA2.js → chunk-WUMARDUD.js} +2 -2
- package/dist/{chunk-NW2J55J3.js → chunk-XNCJ3OIJ.js} +3 -3
- package/dist/{chunk-YSNERYZP.js → chunk-XTQSKMFH.js} +1 -1
- package/dist/{chunk-S7WMMKPN.js → chunk-XZT5S5IY.js} +6 -6
- package/dist/{chunk-BAMRZFTG.js → chunk-Y6P4BRKB.js} +1 -1
- package/dist/{chunk-V3PLXXT5.js → chunk-YCFOCDUA.js} +2 -2
- package/dist/{chunk-5TVMD5PN.js → chunk-YHJHYOBF.js} +1 -1
- package/dist/{chunk-WXXJRT3T.js → chunk-YNRNHUFX.js} +1 -1
- package/dist/{chunk-FWCUJGBB.js → chunk-YV2YMBDC.js} +3 -3
- package/dist/{chunk-IVZGIMZZ.js → chunk-YVSSG6RU.js} +1 -1
- package/dist/{chunk-C6H77UCJ.js → chunk-YWAICNEQ.js} +4 -4
- package/dist/{chunk-MZ6RPRRH.js → chunk-Z2R2O27D.js} +1 -1
- package/dist/{chunk-3VGBPGYD.js → chunk-ZKH6WPY5.js} +1 -1
- package/dist/{chunk-QHPLN5A4.js → chunk-ZMW2VHAF.js} +1 -1
- package/dist/{chunk-QPIS6KAL.js → chunk-ZN5LRXXN.js} +3 -3
- package/dist/{chunk-MBXPXTLB.js → chunk-ZN6EQMYU.js} +2 -2
- package/dist/{chunk-HQ7SE6R2.js → chunk-ZZVYRC77.js} +3 -3
- package/dist/{cliHook-CCSWXSD7.js → cliHook-5QAWK55J.js} +17 -17
- package/dist/{cliHookCheck-EDR6HP7G.js → cliHookCheck-GUU4GSRL.js} +6 -6
- package/dist/{cloneRepo-ZCA6F4D4.js → cloneRepo-IUMKS26Z.js} +2 -2
- package/dist/{codexHook-IH3XPACG.js → codexHook-SJOJJDAN.js} +20 -20
- package/dist/commands/sessions/web/bundle.js +2 -2
- package/dist/{comment-GDQRDDFY.js → comment-O7CAONH7.js} +2 -2
- package/dist/{comment-ANKBIBSW.js → comment-YXTD4LLT.js} +11 -11
- package/dist/{comments-7FTGSLL3.js → comments-Z46LCFIS.js} +10 -10
- package/dist/{commit-DQHAKNLH.js → commit-ZF3ZK5MP.js} +16 -16
- package/dist/{configGet-QX3RMIEE.js → configGet-BZTYR2DN.js} +17 -17
- package/dist/{configImportRepos-XMFG3B6A.js → configImportRepos-RFQEGD67.js} +8 -8
- package/dist/{configImportUser-CBQRDAWZ.js → configImportUser-52NTS5AU.js} +8 -8
- package/dist/configKeys-HDARPPPH.js +1 -1
- package/dist/configKeys-KFWJBDSL.js +1 -1
- package/dist/{configList-3RMQX5SR.js → configList-JOLWPWRD.js} +7 -7
- package/dist/{configSet-MSRWXZP3.js → configSet-NMSZ27OX.js} +18 -18
- package/dist/{configUnset-5KQIMTGV.js → configUnset-IINMDUOO.js} +13 -13
- package/dist/{configure-S5LY5DGC.js → configure-M2ECXTUT.js} +2 -2
- package/dist/{cyclomatic-TUPKWV63.js → cyclomatic-CYUIP7H3.js} +4 -4
- package/dist/{del-BVQPVPQ4.js → del-6CB5KFFD.js} +10 -10
- package/dist/{deleteCommentCmd-SIXGNSO7.js → deleteCommentCmd-5GOBHKJE.js} +11 -11
- package/dist/{denyAdd-QM4AO5BB.js → denyAdd-S3RUAP3Y.js} +3 -3
- package/dist/{denyList-ADIBQJHI.js → denyList-CUZY5JQT.js} +2 -2
- package/dist/{denyRemove-MNFRFLCJ.js → denyRemove-ZCS2QH42.js} +3 -3
- package/dist/{docsConfirm-GDHYL52L.js → docsConfirm-AQGXUXUM.js} +15 -15
- package/dist/{docsScreenshots-W5MOOTEE.js → docsScreenshots-VV5F5SK5.js} +10 -10
- package/dist/{docsUnlock-IO2JFHLH.js → docsUnlock-27IXZHHP.js} +13 -13
- package/dist/{doctorNodes-E5YNA7DH.js → doctorNodes-WKB45ZDS.js} +9 -9
- package/dist/{done-3FRHKGVK.js → done-N5DKY66V.js} +17 -17
- package/dist/{drainDaemon-LRMJS4UO.js → drainDaemon-ZHP2VY7D.js} +1 -1
- package/dist/{editHook-STPJOEOR.js → editHook-GO3EG666.js} +21 -21
- package/dist/{exportBacklog-XJIHB3LT.js → exportBacklog-ZTMILEAX.js} +6 -6
- package/dist/{fixConflict-KMBO5NJ5.js → fixConflict-IZHOVB5C.js} +10 -10
- package/dist/{fixed-KBLDGUZ2.js → fixed-Y4CY77XC.js} +2 -2
- package/dist/{forbiddenStrings-JGSRS3Z7.js → forbiddenStrings-CAQE3QI2.js} +2 -2
- package/dist/{formatConfiguredCommands-3XL5MPUJ.js → formatConfiguredCommands-JZU2PXXF.js} +5 -5
- package/dist/{getBacklogDir-YYVRRAQE.js → getBacklogDir-FJLWXTYN.js} +3 -3
- package/dist/{halstead-N2NLWN2V.js → halstead-X6VRGFZD.js} +4 -4
- package/dist/{hardcodedColors-PFH6DWVY.js → hardcodedColors-XCNT2GKZ.js} +2 -2
- package/dist/{harnessFollowUps-QM54HSMW.js → harnessFollowUps-TGRDAK4V.js} +10 -10
- package/dist/{importBacklog-CTS2DX7F.js → importBacklog-VI7MCUJM.js} +5 -5
- package/dist/index.js +200 -199
- package/dist/{init-E6537CL7.js → init-TNGZPSA5.js} +4 -4
- package/dist/{init-Y5YHIDKT.js → init-TXWUSTMQ.js} +3 -3
- package/dist/{inspect-4HA5BH2D.js → inspect-PFLCMDPC.js} +4 -4
- package/dist/isWake-SLMDAWOG.js +6 -0
- package/dist/{launchMode-QIZDZ7Z6.js → launchMode-JABYPVKP.js} +36 -35
- package/dist/{link-TZJRBKTP.js → link-3GKIBBER.js} +2 -2
- package/dist/{link-S6ZRDNMY.js → link-FDUUDMSG.js} +10 -10
- package/dist/{linkNode-WOUTB6NA.js → linkNode-PIXSDLWU.js} +6 -6
- package/dist/{list-R3FAZV2W.js → list-4QDH3TBJ.js} +6 -6
- package/dist/{list-KRQZ2B62.js → list-KPRLB7TL.js} +8 -8
- package/dist/{list-ANTUX5OH.js → list-NIO2MVBB.js} +5 -5
- package/dist/{list-KHE3HYHF.js → list-RQLGAQII.js} +2 -2
- package/dist/{list-TV4EXOYN.js → list-UPXSS5BF.js} +18 -18
- package/dist/{list-QKGNUKJR.js → list-Y6M6QQTB.js} +5 -5
- package/dist/{listModels-SZ25PQYZ.js → listModels-4F2BDGXM.js} +3 -3
- package/dist/{listNodes-NJCZKQQH.js → listNodes-HE3X4GGF.js} +4 -4
- package/dist/{maintainability-YIKFQHRG.js → maintainability-NJU5J7PO.js} +4 -4
- package/dist/{mermaidExport-HF7SPBLF.js → mermaidExport-4HF66MJK.js} +2 -2
- package/dist/{migrate-L4TWI5WU.js → migrate-PUUK4MPL.js} +12 -12
- package/dist/{migrations-RXATMXAB.js → migrations-SJDOA65U.js} +2 -2
- package/dist/{move-ELAFG3YF.js → move-2CGL6ZKG.js} +2 -2
- package/dist/{movePhase-2EO7BF76.js → movePhase-PEVFM3QF.js} +11 -11
- package/dist/{moveRepo-3U5G37PP.js → moveRepo-SVQODVXS.js} +10 -10
- package/dist/{newCli-3GYIXQKX.js → newCli-4FUEKQTH.js} +8 -8
- package/dist/{newProject-LNXKKSMP.js → newProject-UG7JLZE5.js} +3 -3
- package/dist/{next-F5F5BL4P.js → next-EQJJNYO6.js} +34 -33
- package/dist/{next-I6SRSJ6Q.js → next-LYYOYPYK.js} +6 -6
- package/dist/{nodeLogs-PVLPINEZ.js → nodeLogs-43P3MY5C.js} +4 -4
- package/dist/{notify-QCWUZAWR.js → notify-ZCHPP6ME.js} +2 -2
- package/dist/{phaseDone-FWHXEARK.js → phaseDone-T7C4KJRU.js} +20 -20
- package/dist/{piHook-CTS4AMQB.js → piHook-DB35QCNY.js} +17 -17
- package/dist/{plan-XW2X2JX7.js → plan-CJ4PUZNL.js} +10 -10
- package/dist/{postSlackMessage-ZRMQ7H64.js → postSlackMessage-USP3GJV3.js} +3 -3
- package/dist/{posted-MLCWQQS7.js → posted-MWD6MQLW.js} +4 -4
- package/dist/{propose-IDDRLHAH.js → propose-OURQOJ3D.js} +20 -20
- package/dist/{prsSlackChannel-BTTRGYB3.js → prsSlackChannel-QGXDVDOM.js} +2 -2
- package/dist/{pullIfConfigured-44K775ZD.js → pullIfConfigured-ATTGJC3C.js} +3 -3
- package/dist/{raise-2QJZMXW7.js → raise-O7DVXVP6.js} +9 -9
- package/dist/{raiseHelpText-STFQMOCD.js → raiseHelpText-IDZI3UAC.js} +2 -2
- package/dist/{ravendbAuth-3B5R56B7.js → ravendbAuth-QCLMPEJ3.js} +3 -3
- package/dist/{ravendbCollections-7U7OXHY6.js → ravendbCollections-L4H5PMFE.js} +3 -3
- package/dist/{ravendbQuery-EE3TWSFN.js → ravendbQuery-Z4HJQ2MU.js} +3 -3
- package/dist/{ravendbSetConnection-TZFBRMOT.js → ravendbSetConnection-N43YKUZS.js} +3 -3
- package/dist/{readTime-TEVUITXQ.js → readTime-HERHP2II.js} +2 -2
- package/dist/{recordSlack-7YWIYECM.js → recordSlack-IWDKNZYN.js} +7 -7
- package/dist/{refine-GF4LESB3.js → refine-UW4PQIIQ.js} +38 -37
- package/dist/{refreshDocs-TGZYPVEL.js → refreshDocs-UJMGIGKA.js} +11 -11
- package/dist/{refuseParallelPhasesOff-NT4CVHRK.js → refuseParallelPhasesOff-EVWZZY2T.js} +3 -3
- package/dist/{releasesConfigure-7DZRV7K2.js → releasesConfigure-7OOTDLID.js} +11 -11
- package/dist/{releasesList-7YK45BRD.js → releasesList-OTHOKMQT.js} +2 -2
- package/dist/{remove-VP76Q5BB.js → remove-I6B67PEG.js} +5 -5
- package/dist/{remove-DCHQB43B.js → remove-Q5FHKDSC.js} +11 -11
- package/dist/{removePhase-UWTR4VUK.js → removePhase-7FHB5VHO.js} +12 -12
- package/dist/{reportCliError-FZFPRENP.js → reportCliError-GXHKBCKF.js} +5 -5
- package/dist/{repos-PLJEX7PA.js → repos-HRCIMY6J.js} +3 -3
- package/dist/{resolveHarness-3THYSJRZ.js → resolveHarness-ADZRYQZA.js} +3 -3
- package/dist/{resolveModel-VIDORHYH.js → resolveModel-2OGVGUM3.js} +3 -3
- package/dist/{restartDaemon-UUHHVQIN.js → restartDaemon-UXFWI7FO.js} +4 -4
- package/dist/{restartNode-5HU454NN.js → restartNode-ESMKKEZX.js} +9 -9
- package/dist/{restructure-56DYGZUB.js → restructure-OGGDZTXX.js} +2 -2
- package/dist/{review-GLH254ZE.js → review-65D47IRK.js} +33 -33
- package/dist/{reviewPrComments-Q3JLGPEX.js → reviewPrComments-QXKVMFOK.js} +10 -10
- package/dist/{rewindPhase-V5CB5BZQ.js → rewindPhase-JF5EITNU.js} +22 -22
- package/dist/{rulesAdd-3EUUUI6O.js → rulesAdd-75UVUUDX.js} +15 -15
- package/dist/{run-RAHLYZBV.js → run-4776ITKB.js} +37 -36
- package/dist/{run-57MVTMKW.js → run-LQNYRVK6.js} +31 -30
- package/dist/{runDaemon-342YVOQW.js → runDaemon-DCEFSJ7T.js} +3208 -3127
- package/dist/{runExtract-RWAO2SAA.js → runExtract-ALNQ3I3T.js} +15 -15
- package/dist/{runParallelPhase-QZY53C56.js → runParallelPhase-JDOXAC6I.js} +22 -22
- package/dist/{runRefine-YW3U55TY.js → runRefine-IQRQBG6Q.js} +41 -40
- package/dist/{runScope-MNOVHOLP.js → runScope-YQ4HHYKE.js} +6 -6
- package/dist/{scan-Y7NQIBMP.js → scan-GPTSBYX7.js} +10 -10
- package/dist/{scheduleBackup-ZZ336HLJ.js → scheduleBackup-HW3T2KMI.js} +2 -2
- package/dist/{schemaConfirm-X7BAD6DC.js → schemaConfirm-IYKPVP5S.js} +23 -23
- package/dist/{schemaLock-VY76ZB5O.js → schemaLock-Y35ITWOU.js} +17 -17
- package/dist/{schemaUnlock-ZIRINECP.js → schemaUnlock-2QUPRWYP.js} +17 -17
- package/dist/{screenshot-RKJU55XX.js → screenshot-WDAF3QYG.js} +2 -2
- package/dist/{search-DUCGUDFJ.js → search-FAXDMX7R.js} +17 -17
- package/dist/{seqAuth-XDILICCK.js → seqAuth-AZ6KEYKZ.js} +3 -3
- package/dist/{seqQuery-G3AGSHWI.js → seqQuery-VUHLNVW5.js} +3 -3
- package/dist/{seqSetConnection-UKJFMMXE.js → seqSetConnection-MYKF5CB2.js} +3 -3
- package/dist/{setStatusCommand-SFJANGGE.js → setStatusCommand-LRKWRX2A.js} +10 -10
- package/dist/{show-FYIFLX7C.js → show-66M53CNS.js} +17 -17
- package/dist/{show-2N3GGRYO.js → show-CZRMUDLL.js} +7 -7
- package/dist/{signExtension-2WE5G5QC.js → signExtension-ADFZWG6K.js} +1 -1
- package/dist/{skip-ZAN5ANM6.js → skip-7Q3IVOBV.js} +11 -11
- package/dist/{slack-UTI3VEV7.js → slack-DX2FRJ7S.js} +8 -8
- package/dist/{sloc-VGR5JBDW.js → sloc-YKCRSSNV.js} +4 -4
- package/dist/{sqlAuth-VSASS7WL.js → sqlAuth-5MZEMBVF.js} +3 -3
- package/dist/{sqlColumns-IY3EPG2K.js → sqlColumns-2LSPBSWL.js} +4 -4
- package/dist/{sqlMutate-CKW3YQ6I.js → sqlMutate-R3IFTIR7.js} +4 -4
- package/dist/{sqlQuery-TEPL6L7Q.js → sqlQuery-QSDI4OKK.js} +4 -4
- package/dist/{sqlSetConnection-F2XQTIIA.js → sqlSetConnection-TQ4B3ABN.js} +3 -3
- package/dist/{sqlTables-T6APJAHH.js → sqlTables-COKBMOCY.js} +4 -4
- package/dist/{star-5NVGVZOE.js → star-6PT7TOGZ.js} +12 -12
- package/dist/{start-6QSENF6C.js → start-3JFWDC7I.js} +10 -10
- package/dist/startIssue-MAZ7G4IH.js +1 -1
- package/dist/{status-MG45YXW4.js → status-L5PR3TBX.js} +5 -5
- package/dist/{stop-MCXZHQMS.js → stop-VNQPXBRZ.js} +10 -10
- package/dist/{sync-UZPATI5A.js → sync-TZRANWCY.js} +2 -2
- package/dist/{testflightAdd-LJ2R5LCJ.js → testflightAdd-PKE75NJ5.js} +2 -2
- package/dist/{unlink-ZSI72C6B.js → unlink-3LM63UE2.js} +10 -10
- package/dist/{unlinkNode-MLFR2CMM.js → unlinkNode-RKC44U2T.js} +5 -5
- package/dist/{unstar-PJW6MUKU.js → unstar-YQDZUJV7.js} +12 -12
- package/dist/{update-IBFJPBRO.js → update-ESCLMLUB.js} +4 -4
- package/dist/{update-DSDSWCZH.js → update-FHGTCK6N.js} +10 -10
- package/dist/{updateNode-JH4FCU73.js → updateNode-PXT24Q4D.js} +9 -9
- package/dist/{updatePhase-7B66ANHW.js → updatePhase-JEVJRAOR.js} +11 -11
- package/dist/{updatePlan-NREHNGUK.js → updatePlan-U5UPDSAB.js} +18 -18
- package/dist/{version-WWNN3LFM.js → version-W7VP7LDJ.js} +7 -7
- package/dist/{watchWait-3Z6AZUFC.js → watchWait-5Y2J5VQY.js} +6 -6
- package/dist/{web-6EIQMFU6.js → web-2Y5UGBTJ.js} +69 -69
- package/dist/{web-NQZOX5QB.js → web-L6NU62IK.js} +69 -69
- package/dist/{withPool-J4IBOROS.js → withPool-LEJ76IOJ.js} +5 -5
- package/dist/{wontdo-U3ZYM3FI.js → wontdo-XAQGHSR5.js} +11 -11
- package/dist/{write-5L6OXZDB.js → write-DSMLI4RN.js} +4 -4
- package/package.json +1 -1
- package/dist/{chunk-IQGY6BGN.js → chunk-TM3TO23X.js} +3 -3
- package/dist/{reply-TP5KOGGN.js → reply-GTYV733P.js} +3 -3
- package/dist/{wontfix-3U7LZF2M.js → wontfix-W2DXPEE4.js} +3 -3
|
@@ -3813,7 +3813,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
|
|
|
3813
3813
|
${e.palette.mode==="light"?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${cwt.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:t})=>t.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),zEn=RZ.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTableCell"}),{align:o="inherit",className:i,component:a,padding:s,scope:l,size:u,sortDirection:d,variant:f,...p}=n,h=RZ.useContext(Tfe),m=RZ.useContext(P_),g=m&&m.variant==="head",y;a?y=a:y=g?"th":"td";let v=l;y==="td"?v=void 0:!v&&g&&(v="col");let b=f||m&&m.variant,x={...n,align:o,component:y,padding:s||(h&&h.padding?h.padding:"normal"),size:u||(h&&h.size?h.size:"medium"),sortDirection:d,stickyHeader:b==="head"&&h&&h.stickyHeader,variant:b},w=$En(x),C=null;return d&&(C=d==="asc"?"ascending":"descending"),(0,uwt.jsx)(FEn,{as:y,ref:r,className:gt(w.root,i),"aria-sort":C,scope:v,ownerState:x,...p})}),Qr=zEn;var fwt=S(re(),1);function dwt(e){return wt("MuiTableContainer",e)}var O7i=kt("MuiTableContainer",["root"]);var pwt=S(_(),1),HEn=e=>{let{classes:t}=e;return Ct({root:["root"]},dwt,t)},UEn=it("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),WEn=fwt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTableContainer"}),{className:o,component:i="div",...a}=n,s={...n,component:i},l=HEn(s);return(0,pwt.jsx)(UEn,{ref:r,as:i,className:gt(l.root,o),ownerState:s,...a})}),z2=WEn;var gwt=S(re(),1);function hwt(e){return wt("MuiTableHead",e)}var K7i=kt("MuiTableHead",["root"]);var NNe=S(_(),1),VEn=e=>{let{classes:t}=e;return Ct({root:["root"]},hwt,t)},GEn=it("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),qEn={variant:"head"},mwt="thead",jEn=gwt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTableHead"}),{className:o,component:i=mwt,...a}=n,s={...n,component:i},l=VEn(s);return(0,NNe.jsx)(P_.Provider,{value:qEn,children:(0,NNe.jsx)(GEn,{as:i,className:gt(l.root,o),ref:r,role:i===mwt?null:"rowgroup",ownerState:s,...a})})}),H2=jEn;var Ewt=S(re(),1);var vwt=S(re(),1);function ywt(e){return wt("MuiToolbar",e)}var c8i=kt("MuiToolbar",["root","gutters","regular","dense"]);var bwt=S(_(),1),YEn=e=>{let{classes:t,disableGutters:r,variant:n}=e;return Ct({root:["root",!r&&"gutters",n]},ywt,t)},KEn=it("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,!r.disableGutters&&t.gutters,t[r.variant]]}})(Dt(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),XEn=vwt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiToolbar"}),{className:o,component:i="div",disableGutters:a=!1,variant:s="regular",...l}=n,u={...n,component:i,disableGutters:a,variant:s},d=YEn(u);return(0,bwt.jsx)(KEn,{as:i,className:gt(d.root,o),ref:r,ownerState:u,...l})}),AA=XEn;var wwt=S(re(),1);var xwt=S(_(),1),Cfe=ot((0,xwt.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft");var Swt=S(_(),1),kfe=ot((0,Swt.jsx)("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function Twt(e){return wt("MuiTablePaginationActions",e)}var E8i=kt("MuiTablePaginationActions",["root"]);var Af=S(_(),1),ZEn=e=>{let{classes:t}=e;return Ct({root:["root"]},Twt,t)},QEn=it("div",{name:"MuiTablePaginationActions",slot:"Root"})({}),JEn=wwt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTablePaginationActions"}),{className:o,count:i,disabled:a=!1,getItemAriaLabel:s,onPageChange:l,page:u,rowsPerPage:d,showFirstButton:f,showLastButton:p,slots:h={},slotProps:m={},...g}=n,y=Md(),b=ZEn(n),x=q=>{l(q,0)},w=q=>{l(q,u-1)},C=q=>{l(q,u+1)},k=q=>{l(q,Math.max(0,Math.ceil(i/d)-1))},E=h.firstButton??Mt,R=h.lastButton??Mt,D=h.nextButton??Mt,N=h.previousButton??Mt,$=h.firstButtonIcon??PTt,P=h.lastButtonIcon??LTt,A=h.nextButtonIcon??kfe,L=h.previousButtonIcon??Cfe,I=y?R:E,M=y?D:N,F=y?N:D,O=y?E:R,z=y?m.lastButton:m.firstButton,U=y?m.nextButton:m.previousButton,V=y?m.previousButton:m.nextButton,W=y?m.firstButton:m.lastButton;return(0,Af.jsxs)(QEn,{ref:r,className:gt(b.root,o),...g,children:[f&&(0,Af.jsx)(I,{onClick:x,disabled:a||u===0,"aria-label":s("first",u),title:s("first",u),...z,children:y?(0,Af.jsx)(P,{...m.lastButtonIcon}):(0,Af.jsx)($,{...m.firstButtonIcon})}),(0,Af.jsx)(M,{onClick:w,disabled:a||u===0,color:"inherit","aria-label":s("previous",u),title:s("previous",u),...U,children:y?(0,Af.jsx)(A,{...m.nextButtonIcon}):(0,Af.jsx)(L,{...m.previousButtonIcon})}),(0,Af.jsx)(F,{onClick:C,disabled:a||(i!==-1?u>=Math.ceil(i/d)-1:!1),color:"inherit","aria-label":s("next",u),title:s("next",u),...V,children:y?(0,Af.jsx)(L,{...m.previousButtonIcon}):(0,Af.jsx)(A,{...m.nextButtonIcon})}),p&&(0,Af.jsx)(O,{onClick:k,disabled:a||u>=Math.ceil(i/d)-1,"aria-label":s("last",u),title:s("last",u),...W,children:y?(0,Af.jsx)($,{...m.firstButtonIcon}):(0,Af.jsx)(P,{...m.lastButtonIcon})})]})}),ONe=JEn;function Cwt(e){return wt("MuiTablePagination",e)}var e4n=kt("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]),dO=e4n;var t4n=e=>{let t;if(typeof Intl<"u"&&Intl.NumberFormat)try{t=new Intl.NumberFormat(e)}catch{}return r=>Number.isFinite(r)&&t?t.format(r):String(r)},kwt=t4n;var G1=S(_(),1),Rwt=S(re(),1),_wt,_fe=kwt("en-US"),r4n=it(Qr,{name:"MuiTablePagination",slot:"Root"})(Dt(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),n4n=it(AA,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${dO.actions}`]:t.actions,...t.toolbar})})(Dt(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${dO.actions}`]:{flexShrink:0,marginLeft:20}}))),o4n=it("div",{name:"MuiTablePagination",slot:"Spacer"})({flex:"1 1 100%"}),i4n=it("p",{name:"MuiTablePagination",slot:"SelectLabel"})(Dt(({theme:e})=>({...e.typography.body2,flexShrink:0}))),a4n=it(E_,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${dO.selectIcon}`]:t.selectIcon,[`& .${dO.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${dO.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),s4n=it(Br,{name:"MuiTablePagination",slot:"MenuItem"})({}),l4n=it("p",{name:"MuiTablePagination",slot:"DisplayedRows"})(Dt(({theme:e})=>({...e.typography.body2,flexShrink:0})));function c4n({from:e,to:t,count:r}){return`${_fe(e)}\u2013${_fe(t)} of ${r!==-1?_fe(r):`more than ${_fe(t)}`}`}function u4n(e){return`Go to ${e} page`}var d4n=e=>{let{classes:t}=e;return Ct({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},Cwt,t)},f4n=Ewt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTablePagination"}),{ActionsComponent:o=ONe,colSpan:i,component:a=Qr,count:s,disabled:l=!1,getItemAriaLabel:u=u4n,labelDisplayedRows:d=c4n,labelRowsPerPage:f="Rows per page:",onPageChange:p,onRowsPerPageChange:h,page:m,rowsPerPage:g,rowsPerPageOptions:y=[10,25,50,100],showFirstButton:v=!1,showLastButton:b=!1,slotProps:x={},slots:w={},...C}=n,k=n,E=d4n(k),R=typeof x?.select=="function"?x.select(k):x?.select??{},D=R.native?"option":s4n,N;(a===Qr||a==="td")&&(N=i||1e3);let $=Rg(R.id),P=Rg(R.labelId),A=()=>s===-1?(m+1)*g:g===-1?s:Math.min(s,(m+1)*g),L={slots:w,slotProps:x},[I,M]=sr("root",{ref:r,className:E.root,elementType:r4n,externalForwardedProps:{...L,component:a,...C},ownerState:k,additionalProps:{colSpan:N}}),[F,O]=sr("toolbar",{className:E.toolbar,elementType:n4n,externalForwardedProps:L,ownerState:k}),[z,U]=sr("spacer",{className:E.spacer,elementType:o4n,externalForwardedProps:L,ownerState:k}),[V,W]=sr("selectLabel",{className:E.selectLabel,elementType:i4n,externalForwardedProps:L,ownerState:k,additionalProps:{id:P}}),[q,Y]=sr("select",{className:E.select,elementType:a4n,externalForwardedProps:L,ownerState:k}),[Z,ee]=sr("menuItem",{className:E.menuItem,elementType:D,externalForwardedProps:L,ownerState:k}),[K,ce]=sr("displayedRows",{className:E.displayedRows,elementType:l4n,externalForwardedProps:L,ownerState:k});return(0,G1.jsx)(I,{...M,children:(0,G1.jsxs)(F,{...O,children:[(0,G1.jsx)(z,{...U}),y.length>1&&(0,G1.jsx)(V,{...W,children:f}),y.length>1&&(0,G1.jsx)(q,{variant:"standard",...!R.variant&&{input:_wt||(_wt=(0,G1.jsx)(zi,{}))},value:g,onChange:h,id:$,labelId:P,...R,classes:{...R.classes,root:gt(E.input,E.selectRoot,(R.classes||{}).root),select:gt(E.select,(R.classes||{}).select),icon:gt(E.selectIcon,(R.classes||{}).icon)},disabled:l,...Y,children:y.map(oe=>(0,Rwt.createElement)(Z,{...ee,key:oe.label?oe.label:oe,value:oe.value?oe.value:oe},oe.label?oe.label:oe))}),(0,G1.jsx)(K,{...ce,children:d({from:s===0?0:m*g+1,to:A(),count:s===-1?-1:s,page:m})}),(0,G1.jsx)(o,{className:E.actions,count:s,onPageChange:p,page:m,rowsPerPage:g,showFirstButton:v,showLastButton:b,slotProps:x.actions,slots:w.actions,getItemAriaLabel:u,disabled:l})]})})}),LA=f4n;var Efe=S(re(),1);function Pwt(e){return wt("MuiTableRow",e)}var p4n=kt("MuiTableRow",["root","selected","hover","head","footer"]),BNe=p4n;var Lwt=S(_(),1),h4n=e=>{let{classes:t,selected:r,hover:n,head:o,footer:i}=e;return Ct({root:["root",r&&"selected",n&&"hover",o&&"head",i&&"footer"]},Pwt,t)},m4n=it("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.head&&t.head,r.footer&&t.footer]}})(Dt(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${BNe.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${BNe.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)}}}))),Awt="tr",g4n=Efe.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTableRow"}),{className:o,component:i=Awt,hover:a=!1,selected:s=!1,...l}=n,u=Efe.useContext(P_),d={...n,component:i,hover:a,selected:s,head:u&&u.variant==="head",footer:u&&u.variant==="footer"},f=h4n(d);return(0,Lwt.jsx)(m4n,{as:i,ref:r,className:gt(f.root,o),role:i===Awt?null:"row",ownerState:d,...l})}),yc=g4n;var Nwt=S(re(),1);var Iwt=S(_(),1),Dwt=ot((0,Iwt.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");function Mwt(e){return wt("MuiTableSortLabel",e)}var y4n=kt("MuiTableSortLabel",["root","active","icon","directionDesc","directionAsc"]),Rfe=y4n;var Pfe=S(_(),1),v4n=e=>{let{classes:t,direction:r,active:n}=e,o={root:["root",n&&"active",`direction${It(r)}`],icon:["icon"]};return Ct(o,Mwt,t)},b4n=it(Vt,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.active&&t.active]}})(Dt(({theme:e})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(e.vars||e).palette.text.secondary},"&:hover":{color:(e.vars||e).palette.text.secondary,[`& .${Rfe.icon}`]:{opacity:.5}},[`&.${Rfe.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${Rfe.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}}))),x4n=it("span",{name:"MuiTableSortLabel",slot:"Icon"})(Dt(({theme:e})=>({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none",variants:[{props:{direction:"desc"},style:{transform:"rotate(0deg)"}},{props:{direction:"asc"},style:{transform:"rotate(180deg)"}}]}))),S4n=Nwt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTableSortLabel"}),{active:o=!1,children:i,className:a,direction:s="asc",hideSortIcon:l=!1,IconComponent:u=Dwt,slots:d={},slotProps:f={},...p}=n,h={...n,active:o,direction:s,hideSortIcon:l,IconComponent:u},m=v4n(h),g={slots:d,slotProps:f},[y,v]=sr("root",{elementType:b4n,externalForwardedProps:g,ownerState:h,className:gt(m.root,a),ref:r,additionalProps:{internalNativeButton:!1}}),[b,x]=sr("icon",{elementType:x4n,externalForwardedProps:g,ownerState:h,className:m.icon});return(0,Pfe.jsxs)(y,{disableRipple:!0,component:"span",...v,...p,children:[i,l&&!o?null:(0,Pfe.jsx)(b,{as:u,...x})]})}),$Ne=S4n;var Ki=S(re(),1);function T4n(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function FNe(e,t,r,n={},o=()=>{}){let{ease:i=T4n,duration:a=300}=n,s=null,l=t[e],u=!1,d=()=>{u=!0},f=p=>{if(u){o(new Error("Animation cancelled"));return}s===null&&(s=p);let h=Math.min(1,(p-s)/a);if(t[e]=i(h)*(r-l)+l,h>=1){requestAnimationFrame(()=>{o(null)});return}requestAnimationFrame(f)};return l===r?(o(new Error("Element already at target position")),d):(requestAnimationFrame(f),d)}var PZ=S(re(),1);var Owt=S(_(),1),w4n={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function zNe(e){let{onChange:t,...r}=e,n=PZ.useRef(),o=PZ.useRef(null),i=()=>{n.current=o.current.offsetHeight-o.current.clientHeight};return I0(()=>{let a=c_(()=>{let l=n.current;i(),l!==n.current&&t(n.current)}),s=Xh(o.current);return s.addEventListener("resize",a),()=>{a.clear(),s.removeEventListener("resize",a)}},[t]),PZ.useEffect(()=>{i(),t(n.current)},[t]),(0,Owt.jsx)("div",{style:w4n,...r,ref:o})}var Fwt=S(re(),1);function Bwt(e){return wt("MuiTabScrollButton",e)}var C4n=kt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),$wt=C4n;var Afe=S(_(),1),k4n=e=>{let{classes:t,orientation:r,disabled:n}=e;return Ct({root:["root",r,n&&"disabled"]},Bwt,t)},_4n=it(Vt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.orientation&&t[r.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${$wt.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),E4n=Fwt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTabScrollButton"}),{className:o,slots:i={},slotProps:a={},direction:s,orientation:l,disabled:u,...d}=n,{nativeButton:f,...p}=d,h=Md(),m={isRtl:h,...n},g=k4n(m),y=i.StartScrollButtonIcon??Cfe,v=i.EndScrollButtonIcon??kfe,b=$0({elementType:y,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m}),x=$0({elementType:v,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m});return(0,Afe.jsx)(_4n,{component:"div",className:gt(g.root,o),ref:r,role:null,ownerState:m,tabIndex:null,...p,style:{...p.style,...l==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${h?-90:90}deg)`}},children:s==="left"?(0,Afe.jsx)(y,{...b}):(0,Afe.jsx)(v,{...x})})}),HNe=E4n;function zwt(e){return wt("MuiTabs",e)}var R4n=kt("MuiTabs",["root","vertical","list","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Lfe=R4n;var q1=S(_(),1),P4n=e=>{let{vertical:t,fixed:r,hideScrollbar:n,scrollableX:o,scrollableY:i,centered:a,scrollButtonsHideMobile:s,classes:l}=e;return Ct({root:["root",t&&"vertical"],scroller:["scroller",r&&"fixed",n&&"hideScrollbar",o&&"scrollableX",i&&"scrollableY"],list:["list",t&&"vertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[o&&"scrollableX"],hideScrollbar:[n&&"hideScrollbar"]},zwt,l)},A4n=it("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[{[`& .${Lfe.scrollButtons}`]:t.scrollButtons},{[`& .${Lfe.scrollButtons}`]:r.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,r.vertical&&t.vertical]}})(Dt(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${Lfe.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),L4n=it("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.scroller,r.fixed&&t.fixed,r.hideScrollbar&&t.hideScrollbar,r.scrollableX&&t.scrollableX,r.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),I4n=it("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.list,r.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),D4n=it("span",{name:"MuiTabs",slot:"Indicator"})(Dt(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),M4n=it(zNe)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Hwt={};var N4n=Ki.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTabs"}),o=on(),i=Md(),{"aria-label":a,"aria-labelledby":s,action:l,centered:u=!1,children:d,className:f,component:p="div",allowScrollButtonsMobile:h=!1,indicatorColor:m="primary",onChange:g,orientation:y="horizontal",scrollButtons:v="auto",selectionFollowsFocus:b,slots:x={},slotProps:w={},textColor:C="primary",value:k,variant:E="standard",visibleScrollbar:R=!1,...D}=n,N=E==="scrollable",$=y==="vertical",P=$?"scrollTop":"scrollLeft",A=$?"top":"left",L=$?"bottom":"right",I=$?"clientHeight":"clientWidth",M=$?"height":"width",F={...n,component:p,allowScrollButtonsMobile:h,indicatorColor:m,orientation:y,vertical:$,scrollButtons:v,textColor:C,variant:E,visibleScrollbar:R,fixed:!N,hideScrollbar:N&&!R,scrollableX:N&&!$,scrollableY:N&&$,centered:u&&!N,scrollButtonsHideMobile:!h},O=P4n(F),z=$0({elementType:x.startScrollButtonIcon,externalSlotProps:w.startScrollButtonIcon,ownerState:F}),U=$0({elementType:x.endScrollButtonIcon,externalSlotProps:w.endScrollButtonIcon,ownerState:F}),[V,W]=Ki.useState(!1),[q,Y]=Ki.useState(Hwt),[Z,ee]=Ki.useState(!1),[K,ce]=Ki.useState(!1),[oe,ge]=Ki.useState(!1),he=k===!1?null:k,[me,Ce]=Ki.useState(!1),[Te,Ve]=Ki.useState({overflow:"hidden",scrollbarWidth:0}),je=new Map,Ye=Ki.useRef(null),xe=Ki.useRef(null),Pe={slots:x,slotProps:w},Me=()=>{let yt=Ye.current,Re;if(yt){let Ue=yt.getBoundingClientRect();Re={clientWidth:yt.clientWidth,scrollLeft:yt.scrollLeft,scrollTop:yt.scrollTop,scrollWidth:yt.scrollWidth,top:Ue.top,bottom:Ue.bottom,left:Ue.left,right:Ue.right}}let se;if(yt&&k!==!1){let Ue=xe.current.children;if(Ue.length>0){let et=Ue[je.get(k)];se=et?et.getBoundingClientRect():null}}return{tabsMeta:Re,tabMeta:se}},He=kf(()=>{let{tabsMeta:yt,tabMeta:Re}=Me(),se=0,Ue;$?(Ue="top",Re&&yt&&(se=Re.top-yt.top+yt.scrollTop)):(Ue=i?"right":"left",Re&&yt&&(se=(i?-1:1)*(Re[Ue]-yt[Ue]+yt.scrollLeft)));let et={[Ue]:se,[M]:Re?Re[M]:0};if(typeof q[Ue]!="number"||typeof q[M]!="number")Y(et);else{let Xe=Math.abs(q[Ue]-et[Ue]),vt=Math.abs(q[M]-et[M]);(Xe>=1||vt>=1)&&Y(et)}}),le=(yt,{animation:Re=!0}={})=>{Re?FNe(P,Ye.current,yt,{duration:o.transitions.duration.standard}):Ye.current[P]=yt},fe=yt=>{let Re=Ye.current[P];$?Re+=yt:Re+=yt*(i?-1:1),le(Re)},ye=()=>{let yt=Ye.current[I],Re=0,se=Array.from(xe.current.children);for(let Ue=0;Ue<se.length;Ue+=1){let et=se[Ue];if(Re+et[I]>yt){Ue===0&&(Re=yt);break}Re+=et[I]}return Re},ve=()=>{fe(-1*ye())},ke=()=>{fe(ye())},[de,{onChange:G,...J}]=sr("scrollbar",{className:gt(O.scrollableX,O.hideScrollbar),elementType:M4n,shouldForwardComponentProp:!0,externalForwardedProps:Pe,ownerState:F}),ae=Ki.useCallback(yt=>{G?.(yt),Ve({overflow:null,scrollbarWidth:yt})},[G]),[j,ue]=sr("scrollButtons",{className:O.scrollButtons,elementType:HNe,externalForwardedProps:Pe,ownerState:F,additionalProps:{orientation:y,slots:{StartScrollButtonIcon:x.startScrollButtonIcon,EndScrollButtonIcon:x.endScrollButtonIcon},slotProps:{startScrollButtonIcon:z,endScrollButtonIcon:U}}}),ne=()=>{let yt={};yt.scrollbarSizeListener=N?(0,q1.jsx)(de,{...J,onChange:ae}):null;let se=N&&(v==="auto"&&(Z||K)||v===!0);return yt.scrollButtonStart=se?(0,q1.jsx)(j,{direction:i?"right":"left",onClick:ve,disabled:!Z,...ue}):null,yt.scrollButtonEnd=se?(0,q1.jsx)(j,{direction:i?"left":"right",onClick:ke,disabled:!K,...ue}):null,yt},X=kf(yt=>{let{tabsMeta:Re,tabMeta:se}=Me();if(!(!se||!Re)){if(se[A]<Re[A]){let Ue=Re[P]+(se[A]-Re[A]);le(Ue,{animation:yt})}else if(se[L]>Re[L]){let Ue=Re[P]+(se[L]-Re[L]);le(Ue,{animation:yt})}}}),Q=kf(()=>{N&&v!==!1&&ge(!oe)});Ki.useEffect(()=>{let yt=c_(()=>{Ye.current&&He()}),Re,se=Xe=>{Xe.forEach(vt=>{vt.removedNodes.forEach(zt=>{Re?.unobserve(zt)}),vt.addedNodes.forEach(zt=>{Re?.observe(zt)})}),yt(),Q()},Ue=Xh(Ye.current);Ue.addEventListener("resize",yt);let et;return typeof ResizeObserver<"u"&&(Re=new ResizeObserver(yt),Array.from(xe.current.children).forEach(Xe=>{Re.observe(Xe)})),typeof MutationObserver<"u"&&(et=new MutationObserver(se),et.observe(xe.current,{childList:!0})),()=>{yt.clear(),Ue.removeEventListener("resize",yt),et?.disconnect(),Re?.disconnect()}},[He,Q]),Ki.useEffect(()=>{let yt=Array.from(xe.current.children),Re=yt.length;if(typeof IntersectionObserver<"u"&&Re>0&&N&&v!==!1){let se=yt[0],Ue=yt[Re-1],et={root:Ye.current,threshold:.99},Xe=Qe=>{ee(!Qe[0].isIntersecting)},vt=new IntersectionObserver(Xe,et);vt.observe(se);let zt=Qe=>{ce(!Qe[0].isIntersecting)},Fe=new IntersectionObserver(zt,et);return Fe.observe(Ue),()=>{vt.disconnect(),Fe.disconnect()}}},[N,v,oe,d?.length]),Ki.useEffect(()=>{W(!0)},[]),Ki.useEffect(()=>{He()}),Ki.useEffect(()=>{X(Hwt!==q)},[X,q]),Ki.useImperativeHandle(l,()=>({updateIndicator:He,updateScrollButtons:Q}),[He,Q]);let[$e,we]=sr("indicator",{className:O.indicator,elementType:D4n,externalForwardedProps:Pe,ownerState:F,additionalProps:{style:q}}),Ie=(0,q1.jsx)($e,{...we}),De=pZ({activeItemId:me?void 0:he,orientation:y,isRtl:i}),Oe=De.getContainerProps(),Ge=Ki.Children.toArray(d).filter(Ki.isValidElement).map((yt,Re)=>{let se=yt.props.value===void 0?Re:yt.props.value;return je.set(se,Re),{child:yt,index:Re,childValue:se}}).map(({child:yt,childValue:Re})=>{let se=Re===k;return Ki.cloneElement(yt,{fullWidth:E==="fullWidth",indicator:se&&!V&&Ie,selected:se,selectionFollowsFocus:b,onChange:g,textColor:C,value:Re})}),Be=ne(),[tt,Ee]=sr("root",{ref:r,className:gt(O.root,f),elementType:A4n,externalForwardedProps:{...Pe,...D,component:p},ownerState:F}),[Rt,qe]=sr("scroller",{ref:Ye,className:O.scroller,elementType:L4n,externalForwardedProps:Pe,ownerState:F,additionalProps:{style:{overflow:Te.overflow,[$?`margin${i?"Left":"Right"}`:"marginBottom"]:R?void 0:-Te.scrollbarWidth}}}),Lt=Zo(Oe.ref,xe),Jt=yt=>{let Re=xe.current;$1(F1(Re))?.getAttribute("role")==="tab"&&Oe.onKeyDown(yt)},[hr,Ot]=sr("list",{ref:Lt,className:O.list,elementType:I4n,externalForwardedProps:Pe,ownerState:F,getSlotProps:yt=>({...yt,onBlur:Re=>{Re.currentTarget.contains(Re.relatedTarget)||Ce(!1),yt.onBlur?.(Re)},onKeyDown:Re=>{Jt(Re),yt.onKeyDown?.(Re)},onFocus:Re=>{Ce(!0),Oe.onFocus(Re),yt.onFocus?.(Re)}})});return(0,q1.jsxs)(tt,{...Ee,children:[Be.scrollButtonStart,Be.scrollbarSizeListener,(0,q1.jsxs)(Rt,{...qe,children:[(0,q1.jsx)(hr,{"aria-label":a,"aria-labelledby":s,"aria-orientation":y==="vertical"?"vertical":null,role:"tablist",...Ot,children:(0,q1.jsx)(nO.Provider,{value:De,children:Ge})}),V&&Ie]}),Be.scrollButtonEnd]})}),IA=N4n;var Wwt=S(re(),1);function Uwt(e){return wt("MuiTextField",e)}var zBi=kt("MuiTextField",["root"]);var DA=S(_(),1),O4n={standard:cZ,filled:sZ,outlined:SZ},B4n=e=>{let{classes:t}=e;return Ct({root:["root"]},Uwt,t)},$4n=it(ZMe,{name:"MuiTextField",slot:"Root"})({}),F4n=Wwt.forwardRef(function(t,r){let n=_t({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:i=!1,children:a,className:s,color:l="primary",defaultValue:u,disabled:d=!1,error:f=!1,fullWidth:p=!1,helperText:h,id:m,inputRef:g,label:y,maxRows:v,minRows:b,multiline:x=!1,name:w,onBlur:C,onChange:k,onFocus:E,placeholder:R,required:D=!1,rows:N,select:$=!1,slots:P={},slotProps:A={},type:L,value:I,variant:M="outlined",...F}=n,O={...n,autoFocus:i,color:l,disabled:d,error:f,fullWidth:p,multiline:x,required:D,select:$,variant:M},z=B4n(O),U=Kh(m),V=h&&U?`${U}-helper-text`:void 0,W=y&&U?`${U}-label`:void 0,q=O4n[M],Y={slots:P,slotProps:A},[Z,ee]=sr("select",{elementType:E_,externalForwardedProps:Y,ownerState:O}),K=$&&ee.native,ce={},oe=Y.slotProps.inputLabel;M==="outlined"&&(oe&&typeof oe.shrink<"u"&&(ce.notched=oe.shrink),ce.label=y),$&&(K||(ce.id=void 0),ce["aria-describedby"]=void 0);let[ge,he]=sr("root",{elementType:$4n,shouldForwardComponentProp:!0,externalForwardedProps:{...Y,...F},ownerState:O,className:gt(z.root,s),ref:r,additionalProps:{disabled:d,error:f,fullWidth:p,required:D,color:l,variant:M}}),[me,Ce]=sr("input",{elementType:q,externalForwardedProps:Y,additionalProps:ce,ownerState:O}),[Te,Ve]=sr("inputLabel",{elementType:sNe,externalForwardedProps:Y,ownerState:O}),[je,Ye]=sr("htmlInput",{elementType:"input",externalForwardedProps:Y,ownerState:O}),[xe,Pe]=sr("formHelperText",{elementType:tNe,externalForwardedProps:Y,ownerState:O}),Me=(0,DA.jsx)(me,{"aria-describedby":V,autoComplete:o,autoFocus:i,defaultValue:u,fullWidth:p,multiline:x,name:w,rows:N,maxRows:v,minRows:b,type:L,value:I,id:U,inputRef:g,onBlur:C,onChange:k,onFocus:E,placeholder:R,inputProps:Ye,slots:{input:P.htmlInput?je:void 0},...Ce});return(0,DA.jsxs)(ge,{...he,children:[y!=null&&y!==""&&(0,DA.jsx)(Te,{htmlFor:$&&!K?void 0:U,id:W,...$&&!K&&{component:"div"},...Ve,children:y}),$?(0,DA.jsx)(Z,{"aria-describedby":V,id:U,labelId:W,value:I,input:Me,...ee,children:a}):Me,h&&(0,DA.jsx)(xe,{id:V,...Pe,children:h})]})}),An=F4n;var AZ=S(re(),1);function Vwt(e){return wt("MuiToggleButton",e)}var z4n=kt("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),U2=z4n;var Gwt=S(re(),1),H4n=Gwt.createContext({}),Ife=H4n;var qwt=S(re(),1),U4n=qwt.createContext(void 0),Dfe=U4n;function UNe(e,t){return t===void 0||e===void 0?!1:Array.isArray(t)?t.includes(e):e===t}var jwt=S(_(),1),W4n=e=>{let{classes:t,fullWidth:r,selected:n,disabled:o,size:i,color:a}=e,s={root:["root",n&&"selected",o&&"disabled",r&&"fullWidth",`size${It(i)}`,a]};return Ct(s,Vwt,t)},V4n=it(Vt,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`size${It(r.size)}`]]}})(Dt(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${U2.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${U2.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter(Tn()).map(([t])=>({props:{color:t},style:{[`&.${U2.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),G4n=AZ.forwardRef(function(t,r){let{value:n,...o}=AZ.useContext(Ife),i=AZ.useContext(Dfe),a=_g({...o,selected:UNe(t.value,n)},t),s=_t({props:a,name:"MuiToggleButton"}),{children:l,className:u,color:d="standard",disabled:f=!1,disableFocusRipple:p=!1,fullWidth:h=!1,onChange:m,onClick:g,selected:y,size:v="medium",value:b,...x}=s,w={...s,color:d,disabled:f,disableFocusRipple:p,fullWidth:h,size:v},C=W4n(w),k=R=>{g&&(g(R,b),R.defaultPrevented)||m&&m(R,b)},E=i||"";return(0,jwt.jsx)(V4n,{className:gt(o.className,C.root,u,E),internalNativeButton:!0,disabled:f,focusRipple:!p,ref:r,onClick:k,onChange:m,value:b,ownerState:w,"aria-pressed":y,...x,children:l})}),As=G4n;var MA=S(re(),1);function Ywt(e){return wt("MuiToggleButtonGroup",e)}var q4n=kt("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","fullWidth","firstButton","lastButton","middleButton"]),Wa=q4n;var Mfe=S(_(),1),j4n=e=>{let{classes:t,orientation:r,fullWidth:n,disabled:o}=e;return Ct({root:["root",r,n&&"fullWidth"],grouped:["grouped",o&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]},Ywt,t)},Y4n=it("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[{[`& .${Wa.grouped}`]:t.grouped},{[`& .${Wa.firstButton}`]:t.firstButton},{[`& .${Wa.lastButton}`]:t.lastButton},{[`& .${Wa.middleButton}`]:t.middleButton},t.root,r.orientation==="vertical"&&t.vertical,r.fullWidth&&t.fullWidth]}})(Dt(({theme:e})=>({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${Wa.grouped}`]:{[`&.${Wa.selected} + .${Wa.grouped}.${Wa.selected}`]:{borderTop:0,marginTop:0}},[`& .${Wa.firstButton},& .${Wa.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${Wa.lastButton},& .${Wa.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${Wa.lastButton}.${U2.disabled},& .${Wa.middleButton}.${U2.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${Wa.grouped}`]:{[`&.${Wa.selected} + .${Wa.grouped}.${Wa.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${Wa.firstButton},& .${Wa.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${Wa.lastButton},& .${Wa.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${Wa.lastButton}.${U2.disabled},& .${Wa.middleButton}.${U2.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),K4n=MA.forwardRef(function(t,r){let n=_t({props:t,name:"MuiToggleButtonGroup"}),{children:o,className:i,color:a="standard",disabled:s=!1,exclusive:l=!1,fullWidth:u=!1,onChange:d,orientation:f="horizontal",size:p="medium",value:h,...m}=n,g={...n,disabled:s,fullWidth:u,orientation:f,size:p},y=j4n(g),v=MA.useCallback((E,R)=>{if(!d)return;let D=h&&h.indexOf(R),N;h&&D>=0?(N=h.slice(),N.splice(D,1)):N=h?h.concat(R):[R],d(E,N)},[d,h]),b=MA.useCallback((E,R)=>{d&&d(E,h===R?null:R)},[d,h]),x=MA.useMemo(()=>({className:y.grouped,onChange:l?b:v,value:h,size:p,fullWidth:u,color:a,disabled:s}),[y.grouped,l,b,v,h,p,u,a,s]),w=V8(o),C=w.length,k=E=>{let R=E===0,D=E===C-1;return R&&D?"":R?y.firstButton:D?y.lastButton:y.middleButton};return(0,Mfe.jsx)(Y4n,{role:"group",className:gt(y.root,i),ref:r,ownerState:g,...m,children:(0,Mfe.jsx)(Ife.Provider,{value:x,children:w.map((E,R)=>(0,Mfe.jsx)(Dfe.Provider,{value:k(R),children:E},R))})})}),Jc=K4n;var X4n=NDe({themeId:pc}),Kwt=X4n;var ivn=S(re(),1);var avn=S(T4t(),1);var Hp=S(re(),1),zr=S(re(),1),fn=S(re(),1),XOe=S(re(),1),q5t=S(re(),1),$o=S(re(),1),gAn=S(re(),1),yAn=S(re(),1),vAn=S(re(),1),pn=S(re(),1),oRt=S(re(),1),IAn={};var J4t=e=>{throw TypeError(e)},e5t=(e,t,r)=>t.has(e)||J4t("Cannot "+r),Yg=(e,t,r)=>(e5t(e,t,"read from private field"),r?r.call(e):t.get(e)),DQ=(e,t,r)=>t.has(e)?J4t("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),eb=(e,t,r,n)=>(e5t(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),xhe=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,She=/^[\\/]{2}/;function t5t(e,t){return t+e.replace(/\\/g,"/")}var $Q=(e=>(e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE",e))($Q||{}),w4t="popstate";function C4t(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function r5t(e={}){function t(n,o){let i=o.state?.masked,{pathname:a,search:s,hash:l}=i||n.location;return OQ("",{pathname:a,search:s,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default",i?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,o){return typeof o=="string"?o:Vd(o)}return C3n(t,r,null,e)}function jn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function us(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function w3n(){return Math.random().toString(36).substring(2,10)}function k4t(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function OQ(e,t,r=null,n,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Zg(t):t,state:r,key:t&&t.key||n||w3n(),mask:o}}function Vd({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Zg(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function C3n(e,t,r,n={}){let{window:o=document.defaultView,v5Compat:i=!1}=n,a=o.history,s="POP",l=null,u=d();u==null&&(u=0,a.replaceState({...a.state,idx:u},""));function d(){return(a.state||{idx:null}).idx}function f(){s="POP";let y=d(),v=y==null?null:y-u;u=y,l&&l({action:s,location:g.location,delta:v})}function p(y,v){s="PUSH";let b=C4t(y)?y:OQ(g.location,y,v);r&&r(b,y),u=d()+1;let x=k4t(b,u),w=g.createHref(b.mask||b);try{a.pushState(x,"",w)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(w)}i&&l&&l({action:s,location:g.location,delta:1})}function h(y,v){s="REPLACE";let b=C4t(y)?y:OQ(g.location,y,v);r&&r(b,y),u=d();let x=k4t(b,u),w=g.createHref(b.mask||b);a.replaceState(x,"",w),i&&l&&l({action:s,location:g.location,delta:0})}function m(y){return n5t(o,y)}let g={get action(){return s},get location(){return e(o,a)},listen(y){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(w4t,f),l=y,()=>{o.removeEventListener(w4t,f),l=null}},createHref(y){return t(o,y)},createURL:m,encodeLocation(y){let v=m(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:h,go(y){return a.go(y)}};return g}function n5t(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),jn(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Vd(t);return o=o.replace(/ $/,"%20"),!r&&She.test(o)&&(o=n+o),new URL(o,n)}var MQ,_Oe=class{constructor(e){if(DQ(this,MQ,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Yg(this,MQ).has(e))return Yg(this,MQ).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Yg(this,MQ).set(e,t)}};MQ=new WeakMap;var k3n=new Set(["lazy","caseSensitive","path","id","index","children"]);function _3n(e){return k3n.has(e)}var E3n=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function R3n(e){return E3n.has(e)}function P3n(e){return e.index===!0}function BQ(e,t,r=[],n={},o=!1){return e.map((i,a)=>{let s=[...r,String(a)],l=typeof i.id=="string"?i.id:s.join("-");if(jn(i.index!==!0||!i.children,"Cannot specify children on an index route"),jn(o||!n[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),P3n(i)){let u={...i,id:l};return n[l]=_4t(u,t(u)),u}else{let u={...i,id:l,children:void 0};return n[l]=_4t(u,t(u)),i.children&&(u.children=BQ(i.children,t,s,n,o)),u}})}function _4t(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function DOe(e,t,r="/"){return X0(e,t,r,!1)}function X0(e,t,r,n,o){let i=typeof t=="string"?Zg(t):t,a=If(i.pathname||"/",r);if(a==null)return null;let s=o??phe(e),l=null,u=c5t(a);for(let d=0;l==null&&d<s.length;++d)l=F3n(s[d],u,n);return l}function o5t(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function phe(e){let t=i5t(e);return A3n(t),t}function i5t(e,t=[],r=[],n="",o=!1){let i=(a,s,l=o,u)=>{let d={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(n)&&l)return;jn(d.relativePath.startsWith(n),`Absolute route path "${d.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(n.length)}let f=Xg([n,d.relativePath]),p=r.concat(d);a.children&&a.children.length>0&&(jn(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),i5t(a.children,t,p,f,l)),!(a.path==null&&!a.index)&&t.push({path:f,score:B3n(f,a.index),routesMeta:p.map((h,m)=>{let[g,y]=l5t(h.relativePath,h.caseSensitive,m===p.length-1);return{...h,matcher:g,compiledParams:y}})})};return e.forEach((a,s)=>{if(a.path===""||!a.path?.includes("?"))i(a,s);else for(let l of a5t(a.path))i(a,s,!0,l)}),t}function a5t(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return o?[i,""]:[i];let a=a5t(n.join("/")),s=[];return s.push(...a.map(l=>l===""?i:[i,l].join("/"))),o&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function A3n(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:$3n(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var L3n=/^:[\w-]+$/,I3n=3,D3n=2,M3n=1,N3n=10,O3n=-2,E4t=e=>e==="*";function B3n(e,t){let r=e.split("/"),n=r.length;return r.some(E4t)&&(n+=O3n),t&&(n+=D3n),r.filter(o=>!E4t(o)).reduce((o,i)=>o+(L3n.test(i)?I3n:i===""?M3n:N3n),n)}function $3n(e,t){return e.length===t.length&&e.slice(0,-1).every((n,o)=>n===t[o])?e[e.length-1]-t[t.length-1]:0}function F3n(e,t,r=!1){let{routesMeta:n}=e,o={},i="/",a=[];for(let s=0;s<n.length;++s){let l=n[s],u=s===n.length-1,d=i==="/"?t:t.slice(i.length)||"/",f={path:l.relativePath,caseSensitive:l.caseSensitive,end:u},p=l.matcher&&l.compiledParams?s5t(f,d,l.matcher,l.compiledParams):cB(f,d),h=l.route;if(!p&&u&&r&&!n[n.length-1].route.index&&(p=cB({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!p)return null;Object.assign(o,p.params),a.push({params:o,pathname:Xg([i,p.pathname]),pathnameBase:H3n(Xg([i,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(i=Xg([i,p.pathnameBase]))}return a}function cB(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=l5t(e.path,e.caseSensitive,e.end);return s5t(e,t,r,n)}function s5t(e,t,r,n){let o=t.match(r);if(!o)return null;let i=o[0],a=uB(i,1),s=o.slice(1);return{params:n.reduce((u,{paramName:d,isOptional:f},p)=>{if(d==="*"){let m=s[p]||"";a=uB(i.slice(0,i.length-m.length),1)}let h=s[p];return f&&!h?u[d]=void 0:u[d]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:e}}function l5t(e,t=!1,r=!0){us(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l,u,d)=>{if(n.push({paramName:s,isOptional:l!=null}),l){let f=d.charAt(u+a.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function c5t(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return us(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function If(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function z3n({basename:e,pathname:t}){return t==="/"?e:Xg([e,t])}var MOe=e=>xhe.test(e);function u5t(e,t="/"){let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Zg(e):e,i;return r?(r=NOe(r),r.startsWith("/")||r.startsWith("\\")?i=R4t(r.substring(1),"/"):i=R4t(r,t)):i=t,{pathname:i,search:U3n(n),hash:W3n(o)}}function R4t(e,t){let r=uB(t).split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function SOe(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function d5t(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function The(e){let t=d5t(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function FQ(e,t,r,n=!1){let o;typeof e=="string"?o=Zg(e):(o={...e},jn(!o.pathname||!o.pathname.includes("?"),SOe("?","pathname","search",o)),jn(!o.pathname||!o.pathname.includes("#"),SOe("#","pathname","hash",o)),jn(!o.search||!o.search.includes("#"),SOe("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,s;if(a==null)s=r;else{let f=t.length-1;if(!n&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),f-=1;o.pathname=p.join("/")}s=f>=0?t[f]:"/"}let l=u5t(o,s),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}var NOe=e=>e.replace(/[\\/]{2,}/g,"/"),Xg=e=>NOe(e.join("/"));function uB(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var H3n=e=>uB(e).replace(/^\/*/,"/"),U3n=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,W3n=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var V3n=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fB=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function dB(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function zQ(e){let t=e.map(r=>r.route.path).filter(Boolean);return Xg(t)||"/"}var f5t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function p5t(e,t){let r=e;if(typeof r!="string"||!xhe.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,o=!1;if(f5t)try{let i=new URL(window.location.href),a=She.test(r)?new URL(t5t(r,i.protocol)):new URL(r),s=If(a.pathname,t);a.origin===i.origin&&s!=null?r=s+a.search+a.hash:o=!0}catch{us(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:o,to:r}}var iE=Symbol("Uninstrumented");function G3n(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(i){let a=Object.keys(r);for(let s of a)i[s]&&r[s].push(i[s])}}));let n={};if(typeof t.lazy=="function"&&r.lazy.length>0){let o=iB(r.lazy,t.lazy,()=>{});o&&(n.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(i=>{let a=o[i],s=r[`lazy.${i}`];if(typeof a=="function"&&s.length>0){let l=iB(s,a,()=>{});l&&(n.lazy=Object.assign(n.lazy||{},{[i]:l}))}})}return["loader","action"].forEach(o=>{let i=t[o];if(typeof i=="function"&&r[o].length>0){let a=i[iE]??i,s=iB(r[o],a,(...l)=>P4t(l[0]));s&&(o==="loader"&&a.hydrate===!0&&(s.hydrate=!0),s[iE]=a,n[o]=s)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(o=>{let i=o[iE]??o,a=iB(r.middleware,i,(...s)=>P4t(s[0]));return a?(a[iE]=i,a):o})),n}function q3n(e,t){let r={navigate:[],fetch:[]};if(t.forEach(n=>n({instrument(o){let i=Object.keys(o);for(let a of i)o[a]&&r[a].push(o[a])}})),r.navigate.length>0){let n=e.navigate[iE]??e.navigate,o=iB(r.navigate,n,(...i)=>{let[a,s]=i;return{to:typeof a=="number"||typeof a=="string"?a:a?Vd(a):".",...A4t(e,s??{})}});o&&(o[iE]=n,e.navigate=o)}if(r.fetch.length>0){let n=e.fetch[iE]??e.fetch,o=iB(r.fetch,n,(...i)=>{let[a,,s,l]=i;return{href:s??".",fetcherKey:a,...A4t(e,l??{})}});o&&(o[iE]=n,e.fetch=o)}return e}function iB(e,t,r){return e.length===0?null:async(...n)=>{let o=await h5t(e,r(...n),()=>t(...n),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function h5t(e,t,r,n){let o=e[n],i;if(o){let a,s=async()=>(a?console.error("You cannot call instrumented handlers more than once"):a=h5t(e,t,r,n-1),i=await a,jn(i,"Expected a result"),i.type==="error"&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await o(s,t)}catch(l){console.error("An instrumentation function threw an error:",l)}a||await s(),await a}else try{i={type:"success",value:await r()}}catch(a){i={type:"error",value:a}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function P4t(e){let{request:t,context:r,params:n,pattern:o}=e;return{request:j3n(t),params:{...n},pattern:o,context:Y3n(r)}}function A4t(e,t){return{currentUrl:Vd(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function j3n(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Y3n(e){if(X3n(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var K3n=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function X3n(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===K3n}var L4t=new URL("http://localhost");function OOe(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),L4t)}catch{return L4t}}function TOe(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function Z3n(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function aB(e,t,r,n){let o=null;try{o=e==null?null:new URL(e,r)}catch{}let i=new URL(t,r),a=o!=null&&!TOe(o,r),s=!TOe(i,r);if(n==="reject"){if(a||s)throw new Error("External navigation is not allowed")}else if(s&&(o==null||!Z3n(e,o)||!TOe(o,i)))throw new Error("External navigation is not allowed")}var m5t=["POST","PUT","PATCH","DELETE"],Q3n=new Set(m5t),J3n=["GET",...m5t],ePn=new Set(J3n),g5t=new Set([301,302,303,307,308]),tPn=new Set([307,308]),hhe={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},y5t={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},r6={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},rPn=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),v5t="remix-router-transitions",b5t=Symbol("ResetLoaderData"),t6,rB,nE,nB,nPn=class{constructor(e){DQ(this,t6),DQ(this,rB),DQ(this,nE),DQ(this,nB),eb(this,t6,e),eb(this,rB,phe(e))}get stableRoutes(){return Yg(this,t6)}get activeRoutes(){return Yg(this,nE)??Yg(this,t6)}get branches(){return Yg(this,nB)??Yg(this,rB)}get hasHMRRoutes(){return Yg(this,nE)!=null}setRoutes(e){eb(this,t6,e),eb(this,rB,phe(e))}setHmrRoutes(e){eb(this,nE,e),eb(this,nB,phe(e))}commitHmrRoutes(){Yg(this,nE)&&(eb(this,t6,Yg(this,nE)),eb(this,rB,Yg(this,nB)),eb(this,nE,void 0),eb(this,nB,void 0))}};t6=new WeakMap;rB=new WeakMap;nE=new WeakMap;nB=new WeakMap;function x5t(e){let t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";jn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],o=e.mapRouteProperties||rPn,i=o;if(e.instrumentations){let Re=e.instrumentations;i=se=>({...o(se),...G3n(Re.map(Ue=>Ue.route).filter(Boolean),se)})}let a={},s=new nPn(BQ(e.routes,i,void 0,a)),l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let u=e.dataStrategy||lPn,d={...e.future},f=null,p=new Set,h=null,m=null,g=null,y=null,v=e.hydrationData!=null,b=X0(s.activeRoutes,e.history.location,l,!1,s.branches),x=!1,w=null,C,k;if(b==null&&!e.patchRoutesOnNavigation){let Re=Kg(404,{pathname:e.history.location.pathname}),{matches:se,route:Ue}=che(s.activeRoutes);C=!0,k=!C,b=se,w={[Ue.id]:Re}}else if(b&&!e.hydrationData&&Lt(b,s.activeRoutes,e.history.location.pathname).active&&(b=null),b)if(b.some(Re=>Re.route.lazy))C=!1,k=!C;else if(!b.some(Re=>BOe(Re.route)))C=!0,k=!C;else{let Re=e.hydrationData?e.hydrationData.loaderData:null,se=e.hydrationData?e.hydrationData.errors:null,Ue=b;if(se){let et=b.findIndex(Xe=>se[Xe.route.id]!==void 0);Ue=Ue.slice(0,et+1)}k=!1,C=!0,Ue.forEach(et=>{let Xe=S5t(et.route,Re,se);k=k||Xe.renderFallback,C=C&&!Xe.shouldLoad})}else{C=!1,k=!C,b=[];let Re=Lt(null,s.activeRoutes,e.history.location.pathname);Re.active&&Re.matches&&(x=!0,b=Re.matches)}let E,R={historyAction:e.history.action,location:e.history.location,matches:b,initialized:C,renderFallback:k,navigation:hhe,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||w,fetchers:new Map,blockers:new Map},D="POP",N=null,$=!1,P,A=!1,L=new Map,I=null,M=!1,F=!1,O=new Set,z=new Map,U=0,V=-1,W=new Map,q=new Set,Y=new Map,Z=new Map,ee=new Set,K=new Map,ce,oe=null;function ge(){if(f=e.history.listen(({action:Re,location:se,delta:Ue})=>{if(ce){ce(),ce=void 0;return}us(K.size===0||Ue!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let et=Ge({currentLocation:R.location,nextLocation:se,historyAction:Re});if(et&&Ue!=null){let Xe=new Promise(vt=>{ce=vt});e.history.go(Ue*-1),Le(et,{state:"blocked",location:se,proceed(){Le(et,{state:"proceeding",proceed:void 0,reset:void 0,location:se}),Xe.then(()=>e.history.go(Ue))},reset(){let vt=new Map(R.blockers);vt.set(et,r6),Ce({blockers:vt})}}),N?.resolve(),N=null;return}return Ye(Re,se)}),r){EPn(t,L);let Re=()=>RPn(t,L);t.addEventListener("pagehide",Re),I=()=>t.removeEventListener("pagehide",Re)}return R.initialized||Ye("POP",R.location,{initialHydration:!0}),E}function he(){f&&f(),I&&I(),p.clear(),P&&P.abort(),R.fetchers.forEach((Re,se)=>ne(R.fetchers,se)),R.blockers.forEach((Re,se)=>Oe(se))}function me(Re){if(p.add(Re),h){let{newErrors:se}=h;h=null,Re(R,{deletedFetchers:[],newErrors:se,viewTransitionOpts:void 0,flushSync:!1})}return()=>p.delete(Re)}function Ce(Re,se={}){Re.matches&&(Re.matches=Re.matches.map(Xe=>{let vt=a[Xe.route.id],zt=Xe.route;return zt.element!==vt.element||zt.errorElement!==vt.errorElement||zt.hydrateFallbackElement!==vt.hydrateFallbackElement?{...Xe,route:vt}:Xe})),R={...R,...Re};let Ue=[],et=[];R.fetchers.forEach((Xe,vt)=>{Xe.state==="idle"&&(ee.has(vt)?Ue.push(vt):et.push(vt))}),ee.forEach(Xe=>{!R.fetchers.has(Xe)&&!z.has(Xe)&&Ue.push(Xe)}),p.size===0&&(h={newErrors:Re.errors??null}),[...p].forEach(Xe=>Xe(R,{deletedFetchers:Ue,newErrors:Re.errors??null,viewTransitionOpts:se.viewTransitionOpts,flushSync:se.flushSync===!0})),Ue.forEach(Xe=>ne(R.fetchers,Xe)),et.forEach(Xe=>R.fetchers.delete(Xe))}function Te(Re,se,{flushSync:Ue}={}){let et=R.actionData!=null&&R.navigation.formMethod!=null&&Wd(R.navigation.formMethod)&&R.navigation.state==="loading"&&Re.state?._isRedirect!==!0,Xe;se.actionData?Object.keys(se.actionData).length>0?Xe=se.actionData:Xe=null:et?Xe=R.actionData:Xe=null;let vt=se.loaderData?H4t(R.loaderData,se.loaderData,se.matches||[],se.errors):R.loaderData,zt=R.blockers;zt.size>0&&(zt=new Map(zt),zt.forEach((ht,Wt)=>zt.set(Wt,r6)));let Fe=M?!1:qe(Re,se.matches||R.matches),Qe=$===!0||R.navigation.formMethod!=null&&Wd(R.navigation.formMethod)&&Re.state?._isRedirect!==!0;s.commitHmrRoutes(),M||D==="POP"||(D==="PUSH"?e.history.push(Re,Re.state):D==="REPLACE"&&e.history.replace(Re,Re.state));let mt;if(D==="POP"&&!M&&Re!==R.location){let ht=L.get(R.location.pathname);ht&&ht.has(Re.pathname)?mt={currentLocation:R.location,nextLocation:Re}:L.has(Re.pathname)&&(mt={currentLocation:Re,nextLocation:R.location})}else if(A){let ht=L.get(R.location.pathname);ht?ht.add(Re.pathname):(ht=new Set([Re.pathname]),L.set(R.location.pathname,ht)),mt={currentLocation:R.location,nextLocation:Re}}Ce({...se,actionData:Xe,loaderData:vt,historyAction:D,location:Re,initialized:!0,renderFallback:!1,navigation:hhe,revalidation:"idle",restoreScrollPosition:Fe,preventScrollReset:Qe,blockers:zt},{viewTransitionOpts:mt,flushSync:Ue===!0}),D="POP",$=!1,A=!1,M=!1,F=!1,N?.resolve(),N=null,oe?.resolve(),oe=null}async function Ve(Re,se){if(N?.resolve(),N=null,typeof Re=="number"){N||(N=G4t());let er=N.promise;return e.history.go(Re),er}let Ue=EOe(R.location,R.matches,l,Re,se?.fromRouteId,se?.relative),{path:et,submission:Xe,error:vt}=I4t(!1,Ue,se),zt;if(se?.mask){let er=typeof se.mask=="string"?Zg(se.mask):{...R.location.mask,...se.mask};if(zt={pathname:er.pathname??"",search:er.search??"",hash:er.hash??""},She.test(zt.pathname))throw new Error("External navigation is not allowed");zt.pathname.startsWith("\\")&&(zt.pathname=zt.pathname.replace(/^\\+/,"/")),aB(typeof se.mask=="string"?se.mask:Vd(se.mask),Vd(zt),e.history.createURL("/"),"reject")}let Fe=R.location,Qe=OQ(Fe,et,se&&se.state,void 0,zt);Qe={...Qe,...e.history.encodeLocation(Qe)},aB(Re==null?e.history.createHref(R.location):typeof Re=="string"?Re:Vd(Re),e.history.createHref(Qe.mask||Qe),e.history.createURL("/"),"reject");let mt=se&&se.replace!=null?se.replace:void 0,ht="PUSH";mt===!0?ht="REPLACE":mt===!1||Xe!=null&&Wd(Xe.formMethod)&&Xe.formAction===R.location.pathname+R.location.search&&(ht="REPLACE");let Wt=se&&"preventScrollReset"in se?se.preventScrollReset===!0:void 0,or=(se&&se.flushSync)===!0,dr=Ge({currentLocation:Fe,nextLocation:Qe,historyAction:ht});if(dr){Le(dr,{state:"blocked",location:Qe,proceed(){Le(dr,{state:"proceeding",proceed:void 0,reset:void 0,location:Qe}),Ve(Re,se)},reset(){let er=new Map(R.blockers);er.set(dr,r6),Ce({blockers:er})}});return}await Ye(ht,Qe,{submission:Xe,pendingError:vt,preventScrollReset:Wt,replace:se&&se.replace,enableViewTransition:se&&se.viewTransition,flushSync:or,callSiteDefaultShouldRevalidate:se&&se.defaultShouldRevalidate})}function je(){oe||(oe=G4t()),G(),Ce({revalidation:"loading"});let Re=oe.promise;return R.navigation.state==="submitting"?Re:R.navigation.state==="idle"?(Ye(R.historyAction,R.location,{startUninterruptedRevalidation:!0}),Re):(Ye(D||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:A===!0}),Re)}async function Ye(Re,se,Ue){P&&P.abort(),P=null,D=Re,M=(Ue&&Ue.startUninterruptedRevalidation)===!0,Rt(R.location,R.matches),$=(Ue&&Ue.preventScrollReset)===!0,A=(Ue&&Ue.enableViewTransition)===!0;let et=s.activeRoutes,Xe=Ue?.initialHydration&&R.matches&&R.matches.length>0&&!x?R.matches:X0(et,se,l,!1,s.branches),vt=(Ue&&Ue.flushSync)===!0;if(Xe&&R.initialized&&!F&&yPn(R.location,se)&&!(Ue&&Ue.submission&&Wd(Ue.submission.formMethod))){Te(se,{matches:Xe},{flushSync:vt});return}let zt=Lt(Xe,et,se.pathname);if(zt.active&&zt.matches&&(Xe=zt.matches),!Xe){let{error:at,notFoundMatches:ft,route:Nt}=Be(se.pathname);Te(se,{matches:ft,loaderData:{},errors:{[Nt.id]:at}},{flushSync:vt});return}let Fe=Ue&&Ue.overrideNavigation?{...Ue.overrideNavigation,matches:Xe,historyAction:Re}:void 0;P=new AbortController;let Qe=oB(e.history,se,P.signal,Ue&&Ue.submission),mt=e.getContext?await e.getContext():new _Oe,ht;if(Ue&&Ue.pendingError)ht=[oE(Xe).route.id,{type:"error",error:Ue.pendingError}];else if(Ue&&Ue.submission&&Wd(Ue.submission.formMethod)){let at=await xe(Qe,se,Ue.submission,Xe,Re,mt,zt.active,Ue&&Ue.initialHydration===!0,{replace:Ue.replace,flushSync:vt});if(at.shortCircuited)return;if(at.pendingActionResult){let[ft,Nt]=at.pendingActionResult;if(fm(Nt)&&dB(Nt.error)&&Nt.error.status===404){P=null,Te(se,{matches:at.matches,loaderData:{},errors:{[ft]:Nt.error}});return}}Xe=at.matches||Xe,ht=at.pendingActionResult,Fe=wOe(se,Xe,Re,Ue.submission),vt=!1,zt.active=!1,Qe=oB(e.history,Qe.url,Qe.signal)}let{shortCircuited:Wt,matches:or,loaderData:dr,errors:er,workingFetchers:wr}=await Pe(Qe,se,Xe,Re,mt,zt.active,Fe,Ue&&Ue.submission,Ue&&Ue.fetcherSubmission,Ue&&Ue.replace,Ue&&Ue.initialHydration===!0,vt,ht,Ue&&Ue.callSiteDefaultShouldRevalidate);Wt||(P=null,Te(se,{matches:or||Xe,...U4t(ht),loaderData:dr,errors:er,...wr?{fetchers:wr}:{}}))}async function xe(Re,se,Ue,et,Xe,vt,zt,Fe,Qe={}){G();let mt=kPn(se,et,Xe,Ue);if(Ce({navigation:mt},{flushSync:Qe.flushSync===!0}),zt){let or=await Jt(et,se.pathname,Re.signal);if(or.type==="aborted")return{shortCircuited:!0};if(or.type==="error"){if(or.partialMatches.length===0){let{matches:er,route:wr}=che(s.activeRoutes);return{matches:er,pendingActionResult:[wr.id,{type:"error",error:or.error}]}}let dr=oE(or.partialMatches).route.id;return{matches:or.partialMatches,pendingActionResult:[dr,{type:"error",error:or.error}]}}else if(or.matches)et=or.matches;else{let{notFoundMatches:dr,error:er,route:wr}=Be(se.pathname);return{matches:dr,pendingActionResult:[wr.id,{type:"error",error:er}]}}}let ht,Wt=mhe(et,se);if(!Wt.route.action&&!Wt.route.lazy)ht={type:"error",error:Kg(405,{method:Re.method,pathname:se.pathname,routeId:Wt.route.id})};else{let or=sB(i,a,Re,se,et,Wt,Fe?[]:n,vt),dr=await ke(Re,se,or,vt,null);if(ht=dr[Wt.route.id],!ht){for(let er of et)if(dr[er.route.id]){ht=dr[er.route.id];break}}if(Re.signal.aborted)return{shortCircuited:!0}}if(n6(ht)){let or;return Qe&&Qe.replace!=null?or=Qe.replace:or=$4t(ht.response.headers.get("Location"),new URL(Re.url),l,e.history)===R.location.pathname+R.location.search,await ve(Re,ht,!0,{submission:Ue,replace:or}),{shortCircuited:!0}}if(fm(ht)){let or=oE(et,Wt.route.id);return(Qe&&Qe.replace)!==!0&&(D="PUSH"),{matches:et,pendingActionResult:[or.route.id,ht,Wt.route.id]}}return{matches:et,pendingActionResult:[Wt.route.id,ht]}}async function Pe(Re,se,Ue,et,Xe,vt,zt,Fe,Qe,mt,ht,Wt,or,dr){let er=zt||wOe(se,Ue,et,Fe),wr=Fe||Qe||V4t(er),at=!M&&!ht;if(vt){if(at){let Jn=Me(or);Ce({navigation:er,...Jn!==void 0?{actionData:Jn}:{}},{flushSync:Wt})}let Ne=await Jt(Ue,se.pathname,Re.signal);if(Ne.type==="aborted")return{shortCircuited:!0};if(Ne.type==="error"){if(Ne.partialMatches.length===0){let{matches:Ke,route:Xr}=che(s.activeRoutes);return{matches:Ke,loaderData:{},errors:{[Xr.id]:Ne.error}}}let Jn=oE(Ne.partialMatches).route.id;return{matches:Ne.partialMatches,loaderData:{},errors:{[Jn]:Ne.error}}}else if(Ne.matches)Ue=Ne.matches;else{let{error:Jn,notFoundMatches:Ke,route:Xr}=Be(se.pathname);return{matches:Ke,loaderData:{},errors:{[Xr.id]:Jn}}}}let ft=s.activeRoutes,{dsMatches:Nt,revalidatingFetchers:kr}=D4t(Re,Xe,i,a,e.history,R,Ue,wr,se,ht?[]:n,ht===!0,F,O,ee,Y,q,ft,l,e.patchRoutesOnNavigation!=null,s.branches,or,dr);if(V=++U,!e.dataStrategy&&!Nt.some(Ne=>Ne.shouldLoad)&&!Nt.some(Ne=>Ne.route.middleware&&Ne.route.middleware.length>0)&&kr.length===0){let Ne=new Map(R.fetchers),Jn=we(Ne);return Te(se,{matches:Ue,loaderData:{},errors:or&&fm(or[1])?{[or[0]]:or[1].error}:null,...U4t(or),...Jn?{fetchers:Ne}:{}},{flushSync:Wt}),{shortCircuited:!0}}if(at){let Ne={};if(!vt){Ne.navigation=er;let Jn=Me(or);Jn!==void 0&&(Ne.actionData=Jn)}kr.length>0&&(Ne.fetchers=He(kr)),Ce(Ne,{flushSync:Wt})}kr.forEach(Ne=>{Q(Ne.key),Ne.controller&&z.set(Ne.key,Ne.controller)});let Ar=()=>kr.forEach(Ne=>Q(Ne.key));P&&P.signal.addEventListener("abort",Ar);let{loaderResults:gn,fetcherResults:uo}=await de(Nt,kr,Re,se,Xe);if(Re.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",Ar),kr.forEach(Ne=>z.delete(Ne.key));let nn=uhe(gn);if(nn)return await ve(Re,nn.result,!0,{replace:mt}),{shortCircuited:!0};if(nn=uhe(uo),nn)return q.add(nn.key),await ve(Re,nn.result,!0,{replace:mt}),{shortCircuited:!0};let tr=new Map(R.fetchers),{loaderData:Yt,errors:fr}=z4t(R,Ue,gn,or,kr,uo,tr);ht&&R.errors&&(fr={...R.errors,...fr});let mr=we(tr),Kt=Ie(V,tr),Kr=mr||Kt||kr.length>0;return{matches:Ue,loaderData:Yt,errors:fr,...Kr?{workingFetchers:tr}:{}}}function Me(Re){if(Re&&!fm(Re[1]))return{[Re[0]]:Re[1].data};if(R.actionData)return Object.keys(R.actionData).length===0?null:R.actionData}function He(Re){let se=new Map(R.fetchers);return Re.forEach(Ue=>{let et=se.get(Ue.key),Xe=LQ(void 0,et?et.data:void 0);se.set(Ue.key,Xe)}),se}async function le(Re,se,Ue,et){Q(Re);let Xe=(et&&et.flushSync)===!0,vt=s.activeRoutes,zt=EOe(R.location,R.matches,l,Ue,se,et?.relative),Fe=X0(vt,zt,l,!1,s.branches),Qe=Lt(Fe,vt,zt);if(Qe.active&&Qe.matches&&(Fe=Qe.matches),!Fe){ae(Re,se,Kg(404,{pathname:zt}),{flushSync:Xe});return}let{path:mt,submission:ht,error:Wt}=I4t(!0,zt,et);if(Wt){ae(Re,se,Wt,{flushSync:Xe});return}let or=e.getContext?await e.getContext():new _Oe,dr=(et&&et.preventScrollReset)===!0;if(ht&&Wd(ht.formMethod)){await fe(Re,se,mt,Fe,or,Qe.active,Xe,dr,ht,et&&et.defaultShouldRevalidate);return}Y.set(Re,{routeId:se,path:mt}),await ye(Re,se,mt,Fe,or,Qe.active,Xe,dr,ht)}async function fe(Re,se,Ue,et,Xe,vt,zt,Fe,Qe,mt){G(),Y.delete(Re);let ht=R.fetchers.get(Re);J(Re,_Pn(Qe,ht),{flushSync:zt});let Wt=new AbortController,or=oB(e.history,Ue,Wt.signal,Qe);if(vt){let ei=await Jt(et,new URL(or.url).pathname,or.signal,Re);if(ei.type==="aborted")return;if(ei.type==="error"){ae(Re,se,ei.error,{flushSync:zt});return}else if(ei.matches)et=ei.matches;else{ae(Re,se,Kg(404,{pathname:Ue}),{flushSync:zt});return}}let dr=mhe(et,Ue);if(!dr.route.action&&!dr.route.lazy){let ei=Kg(405,{method:Qe.formMethod,pathname:Ue,routeId:se});ae(Re,se,ei,{flushSync:zt});return}z.set(Re,Wt);let er=U,wr=sB(i,a,or,Ue,et,dr,n,Xe),at=await ke(or,Ue,wr,Xe,Re),ft=at[dr.route.id];if(!ft){for(let ei of wr)if(at[ei.route.id]){ft=at[ei.route.id];break}}if(or.signal.aborted){z.get(Re)===Wt&&z.delete(Re);return}if(ee.has(Re)){if(n6(ft)||fm(ft)){J(Re,tb(void 0));return}}else{if(n6(ft))if(z.delete(Re),V>er){J(Re,tb(void 0));return}else return q.add(Re),J(Re,LQ(Qe)),ve(or,ft,!1,{fetcherSubmission:Qe,preventScrollReset:Fe});if(fm(ft)){ae(Re,se,ft.error);return}}let Nt=R.navigation.location||R.location,kr=oB(e.history,Nt,Wt.signal),Ar=s.activeRoutes,gn=R.navigation.state!=="idle"?X0(Ar,R.navigation.location,l,!1,s.branches):R.matches;jn(gn,"Didn't find any matches after fetcher action");let uo=++U;W.set(Re,uo);let{dsMatches:nn,revalidatingFetchers:tr}=D4t(kr,Xe,i,a,e.history,R,gn,Qe,Nt,n,!1,F,O,ee,Y,q,Ar,l,e.patchRoutesOnNavigation!=null,s.branches,[dr.route.id,ft],mt),Yt=LQ(Qe,ft.data),fr=new Map(R.fetchers);fr.set(Re,Yt),tr.filter(ei=>ei.key!==Re).forEach(ei=>{let Id=ei.key,P1=fr.get(Id),za=LQ(void 0,P1?P1.data:void 0);fr.set(Id,za),Q(Id),ei.controller&&z.set(Id,ei.controller)}),Ce({fetchers:fr});let mr=()=>tr.forEach(ei=>Q(ei.key));Wt.signal.addEventListener("abort",mr);let{loaderResults:Kt,fetcherResults:Kr}=await de(nn,tr,kr,Nt,Xe);if(Wt.signal.aborted)return;Wt.signal.removeEventListener("abort",mr),W.delete(Re),z.delete(Re),tr.forEach(ei=>z.delete(ei.key));let Ne=R.fetchers.has(Re),Jn=ei=>{if(!Ne)return ei;let Id=new Map(ei.fetchers);return Id.set(Re,tb(ft.data)),{...ei,fetchers:Id}},Ke=uhe(Kt);if(Ke)return R=Jn(R),ve(kr,Ke.result,!1,{preventScrollReset:Fe});if(Ke=uhe(Kr),Ke)return q.add(Ke.key),R=Jn(R),ve(kr,Ke.result,!1,{preventScrollReset:Fe});let Xr=new Map(R.fetchers);Ne&&Xr.set(Re,tb(ft.data));let{loaderData:Us,errors:vf}=z4t(R,gn,Kt,void 0,tr,Kr,Xr);Ie(uo,Xr),R.navigation.state==="loading"&&uo>V?(jn(D,"Expected pending action"),P&&P.abort(),Te(R.navigation.location,{matches:gn,loaderData:Us,errors:vf,fetchers:Xr})):(Ce({errors:vf,loaderData:H4t(R.loaderData,Us,gn,vf),fetchers:Xr}),F=!1)}async function ye(Re,se,Ue,et,Xe,vt,zt,Fe,Qe){let mt=R.fetchers.get(Re);J(Re,LQ(Qe,mt?mt.data:void 0),{flushSync:zt});let ht=new AbortController,Wt=oB(e.history,Ue,ht.signal);if(vt){let ft=await Jt(et,new URL(Wt.url).pathname,Wt.signal,Re);if(ft.type==="aborted")return;if(ft.type==="error"){ae(Re,se,ft.error,{flushSync:zt});return}else if(ft.matches)et=ft.matches;else{ae(Re,se,Kg(404,{pathname:Ue}),{flushSync:zt});return}}let or=mhe(et,Ue);z.set(Re,ht);let dr=U,er=sB(i,a,Wt,Ue,et,or,n,Xe),wr=await ke(Wt,Ue,er,Xe,Re),at=wr[or.route.id];if(!at){for(let ft of et)if(wr[ft.route.id]){at=wr[ft.route.id];break}}if(z.get(Re)===ht&&z.delete(Re),!Wt.signal.aborted){if(ee.has(Re)){J(Re,tb(void 0));return}if(n6(at))if(V>dr){J(Re,tb(void 0));return}else{q.add(Re),await ve(Wt,at,!1,{preventScrollReset:Fe});return}if(fm(at)){ae(Re,se,at.error);return}J(Re,tb(at.data))}}async function ve(Re,se,Ue,{submission:et,fetcherSubmission:Xe,preventScrollReset:vt,replace:zt}={}){Ue||(N?.resolve(),N=null),se.response.headers.has("X-Remix-Revalidate")&&(F=!0);let Fe=se.response.headers.get("Location");jn(Fe,"Expected a Location header on the redirect Response");let Qe=Fe,mt=new URL(Re.url);Fe=$4t(Fe,mt,l,e.history),aB(Qe,Fe,mt,"allow-explicit");let ht=OQ(R.location,Fe,{_isRedirect:!0});if(r){let at=!1;if(se.response.headers.has("X-Remix-Reload-Document"))at=!0;else if(MOe(Fe)){let ft=n5t(t,Fe,!0);at=ft.origin!==t.location.origin||If(ft.pathname,l)==null}if(at){zt?t.location.replace(Fe):t.location.assign(Fe);return}}P=null;let Wt=zt===!0||se.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:or,formAction:dr,formEncType:er}=R.navigation;!et&&!Xe&&or&&dr&&er&&(et=V4t(R.navigation));let wr=et||Xe;if(tPn.has(se.response.status)&&wr&&Wd(wr.formMethod))await Ye(Wt,ht,{submission:{...wr,formAction:Fe},preventScrollReset:vt||$,enableViewTransition:Ue?A:void 0});else{let at=wOe(ht,[],Wt,et);await Ye(Wt,ht,{overrideNavigation:at,fetcherSubmission:Xe,preventScrollReset:vt||$,enableViewTransition:Ue?A:void 0})}}async function ke(Re,se,Ue,et,Xe){let vt,zt={};try{vt=await uPn(u,Re,se,Ue,Xe,et,!1)}catch(Fe){return Ue.filter(Qe=>Qe.shouldLoad).forEach(Qe=>{zt[Qe.route.id]={type:"error",error:Fe}}),zt}if(Re.signal.aborted)return zt;if(!Wd(Re.method))for(let Fe of Ue){if(vt[Fe.route.id]?.type==="error")break;!vt.hasOwnProperty(Fe.route.id)&&!R.loaderData.hasOwnProperty(Fe.route.id)&&(!R.errors||!R.errors.hasOwnProperty(Fe.route.id))&&Fe.shouldCallHandler()&&(vt[Fe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Fe.route.id}`)})}for(let[Fe,Qe]of Object.entries(vt))if(SPn(Qe)){let mt=Qe.result;zt[Fe]={type:"redirect",response:hPn(mt,Re,Fe,Ue,l)}}else zt[Fe]=await pPn(Qe);return zt}async function de(Re,se,Ue,et,Xe){let vt=ke(Ue,et,Re,Xe,null),zt=Promise.all(se.map(async mt=>{if(mt.matches&&mt.match&&mt.request&&mt.controller){let Wt=(await ke(mt.request,mt.path,mt.matches,Xe,mt.key))[mt.match.route.id];return{[mt.key]:Wt}}else return Promise.resolve({[mt.key]:{type:"error",error:Kg(404,{pathname:mt.path})}})})),Fe=await vt,Qe=(await zt).reduce((mt,ht)=>Object.assign(mt,ht),{});return{loaderResults:Fe,fetcherResults:Qe}}function G(){F=!0,Y.forEach((Re,se)=>{z.has(se)&&O.add(se),Q(se)})}function J(Re,se,Ue={}){let et=new Map(R.fetchers);et.set(Re,se),Ce({fetchers:et},{flushSync:(Ue&&Ue.flushSync)===!0})}function ae(Re,se,Ue,et={}){let Xe=oE(R.matches,se),vt=new Map(R.fetchers);ne(vt,Re),Ce({errors:{[Xe.route.id]:Ue},fetchers:vt},{flushSync:(et&&et.flushSync)===!0})}function j(Re){return Z.set(Re,(Z.get(Re)||0)+1),ee.has(Re)&&ee.delete(Re),R.fetchers.get(Re)||y5t}function ue(Re,se){Q(Re,se?.reason),J(Re,tb(null))}function ne(Re,se){let Ue=R.fetchers.get(se);z.has(se)&&!(Ue&&Ue.state==="loading"&&W.has(se))&&Q(se),Y.delete(se),W.delete(se),q.delete(se),ee.delete(se),O.delete(se),Re.delete(se)}function X(Re){let se=(Z.get(Re)||0)-1;se<=0?(Z.delete(Re),ee.add(Re)):Z.set(Re,se),Ce({fetchers:new Map(R.fetchers)})}function Q(Re,se){let Ue=z.get(Re);Ue&&(Ue.abort(se),z.delete(Re))}function $e(Re,se){for(let Ue of Re){let et=se.get(Ue);jn(et,`Expected fetcher: ${Ue}`);let Xe=tb(et.data);se.set(Ue,Xe)}}function we(Re){let se=[],Ue=!1;for(let et of q){let Xe=Re.get(et);jn(Xe,`Expected fetcher: ${et}`),Xe.state==="loading"&&(q.delete(et),se.push(et),Ue=!0)}return $e(se,Re),Ue}function Ie(Re,se){let Ue=[];for(let[et,Xe]of W)if(Xe<Re){let vt=se.get(et);jn(vt,`Expected fetcher: ${et}`),vt.state==="loading"&&(Q(et),W.delete(et),Ue.push(et))}return $e(Ue,se),Ue.length>0}function De(Re,se){let Ue=R.blockers.get(Re)||r6;return K.get(Re)!==se&&K.set(Re,se),Ue}function Oe(Re){R.blockers.delete(Re),K.delete(Re)}function Le(Re,se){let Ue=R.blockers.get(Re)||r6;jn(Ue.state==="unblocked"&&se.state==="blocked"||Ue.state==="blocked"&&se.state==="blocked"||Ue.state==="blocked"&&se.state==="proceeding"||Ue.state==="blocked"&&se.state==="unblocked"||Ue.state==="proceeding"&&se.state==="unblocked",`Invalid blocker state transition: ${Ue.state} -> ${se.state}`);let et=new Map(R.blockers);et.set(Re,se),Ce({blockers:et})}function Ge({currentLocation:Re,nextLocation:se,historyAction:Ue}){if(K.size===0)return;K.size>1&&us(!1,"A router only supports one blocker at a time");let et=Array.from(K.entries()),[Xe,vt]=et[et.length-1],zt=R.blockers.get(Xe);if(!(zt&&zt.state==="proceeding")&&vt({currentLocation:Re,nextLocation:se,historyAction:Ue}))return Xe}function Be(Re){let se=Kg(404,{pathname:Re}),Ue=s.activeRoutes,{matches:et,route:Xe}=che(Ue);return{notFoundMatches:et,route:Xe,error:se}}function tt(Re,se,Ue){if(m=Re,y=se,g=Ue||null,!v&&R.navigation===hhe){v=!0;let et=qe(R.location,R.matches);et!=null&&Ce({restoreScrollPosition:et})}return()=>{m=null,y=null,g=null}}function Ee(Re,se){return g&&g(Re,se.map(et=>o5t(et,R.loaderData)))||Re.key}function Rt(Re,se){if(m&&y){let Ue=Ee(Re,se);m[Ue]=y()}}function qe(Re,se){if(m){let Ue=Ee(Re,se),et=m[Ue];if(typeof et=="number")return et}return null}function Lt(Re,se,Ue){if(e.patchRoutesOnNavigation){let et=s.branches;if(Re){if(Object.keys(Re[0].params).length>0)return{active:!0,matches:X0(se,Ue,l,!0,et)}}else return{active:!0,matches:X0(se,Ue,l,!0,et)||[]}}return{active:!1,matches:null}}async function Jt(Re,se,Ue,et){if(!e.patchRoutesOnNavigation)return{type:"success",matches:Re};let Xe=Re;for(;;){let vt=a;try{await e.patchRoutesOnNavigation({signal:Ue,path:se,matches:Xe,fetcherKey:et,patch:(mt,ht)=>{Ue.aborted||M4t(mt,ht,s,vt,i,!1)}})}catch(mt){return{type:"error",error:mt,partialMatches:Xe}}if(Ue.aborted)return{type:"aborted"};let zt=s.branches,Fe=X0(s.activeRoutes,se,l,!1,zt),Qe=null;if(Fe){if(Object.keys(Fe[0].params).length===0)return{type:"success",matches:Fe};if(Qe=X0(s.activeRoutes,se,l,!0,zt),!(Qe&&Xe.length<Qe.length&&hr(Xe,Qe.slice(0,Xe.length))))return{type:"success",matches:Fe}}if(Qe||(Qe=X0(s.activeRoutes,se,l,!0,zt)),!Qe||hr(Xe,Qe))return{type:"success",matches:null};Xe=Qe}}function hr(Re,se){return Re.length===se.length&&Re.every((Ue,et)=>Ue.route.id===se[et].route.id)}function Ot(Re){a={},s.setHmrRoutes(BQ(Re,i,void 0,a))}function yt(Re,se,Ue=!1){M4t(Re,se,s,a,i,Ue),s.hasHMRRoutes||Ce({})}return E={get basename(){return l},get future(){return d},get state(){return R},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return a},get window(){return t},initialize:ge,subscribe:me,enableScrollRestoration:tt,navigate:Ve,fetch:le,revalidate:je,createHref:Re=>e.history.createHref(Re),createURL:Re=>e.history.createURL(Re),encodeLocation:Re=>e.history.encodeLocation(Re),getFetcher:j,resetFetcher:ue,deleteFetcher:X,dispose:he,getBlocker:De,deleteBlocker:Oe,patchRoutes:yt,_internalFetchControllers:z,_internalSetRoutes:Ot,_internalSetStateDoNotUseOrYouWillBreakYourApp(Re){Ce(Re)}},e.instrumentations&&(E=q3n(E,e.instrumentations.map(Re=>Re.router).filter(Boolean))),E}function oPn(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function EOe(e,t,r,n,o,i){let a,s;if(o){a=[];for(let u of t)if(a.push(u),u.route.id===o){s=u;break}}else a=t,s=t[t.length-1];let l=FQ(n||".",The(a),If(e.pathname,r)||e.pathname,i==="path");if(n==null&&(l.search=e.search,l.hash=e.hash),(n==null||n===""||n===".")&&s){let u=FOe(l.search);if(s.route.index&&!u)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let d=new URLSearchParams(l.search),f=d.getAll("index");d.delete("index"),f.filter(h=>h).forEach(h=>d.append("index",h));let p=d.toString();l.search=p?`?${p}`:""}}return r!=="/"&&(l.pathname=z3n({basename:r,pathname:l.pathname})),Vd(l)}function I4t(e,t,r){if(!r||!oPn(r))return{path:t};if(r.formMethod&&!CPn(r.formMethod))return{path:t,error:Kg(405,{method:r.formMethod})};let n=()=>({path:t,error:Kg(400,{type:"invalid-body"})}),i=(r.formMethod||"get").toUpperCase(),a=R5t(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Wd(i))return n();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,[h,m])=>`${p}${h}=${m}
|
|
3814
3814
|
`,""):String(r.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!Wd(i))return n();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return n()}}}jn(typeof FormData=="function","FormData is not available in this environment");let s,l;if(r.formData)s=AOe(r.formData),l=r.formData;else if(r.body instanceof FormData)s=AOe(r.body),l=r.body;else if(r.body instanceof URLSearchParams)s=r.body,l=F4t(s);else if(r.body==null)s=new URLSearchParams,l=new FormData;else try{s=new URLSearchParams(r.body),l=F4t(s)}catch{return n()}let u={formMethod:i,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(Wd(u.formMethod))return{path:t,submission:u};let d=Zg(t);return e&&d.search&&FOe(d.search)&&s.append("index",""),d.search=`?${s}`,{path:Vd(d),submission:u}}function D4t(e,t,r,n,o,i,a,s,l,u,d,f,p,h,m,g,y,v,b,x,w,C){let k=w?fm(w[1])?w[1].error:w[1].data:void 0,E=o.createURL(i.location),R=o.createURL(l),D;if(d&&i.errors){let M=Object.keys(i.errors)[0];D=a.findIndex(F=>F.route.id===M)}else if(w&&fm(w[1])){let M=w[0];D=a.findIndex(F=>F.route.id===M)-1}let N=w?w[1].statusCode:void 0,$=N&&N>=400,P={currentUrl:E,currentParams:i.matches[0]?.params||{},nextUrl:R,nextParams:a[0].params,...s,actionResult:k,actionStatus:N},A=zQ(a),L=a.map((M,F)=>{let{route:O}=M,z=null;if(D!=null&&F>D)z=!1;else if(O.lazy)z=!0;else if(!BOe(O))z=!1;else if(d){let{shouldLoad:q}=S5t(O,i.loaderData,i.errors);z=q}else iPn(i.loaderData,i.matches[F],M)&&(z=!0);if(z!==null)return ROe(r,n,e,l,A,M,u,t,z);let U=!1;typeof C=="boolean"?U=C:$?U=!1:(f||E.pathname+E.search===R.pathname+R.search||E.search!==R.search||aPn(i.matches[F],M))&&(U=!0);let V={...P,defaultShouldRevalidate:U},W=NQ(M,V);return ROe(r,n,e,l,A,M,u,t,W,V,C)}),I=[];return m.forEach((M,F)=>{if(d||!a.some(Z=>Z.route.id===M.routeId)||h.has(F))return;let O=i.fetchers.get(F),z=O&&O.state!=="idle"&&O.data===void 0,U=X0(y,M.path,v??"/",!1,x);if(!U){if(b&&z)return;I.push({key:F,routeId:M.routeId,path:M.path,matches:null,match:null,request:null,controller:null});return}if(g.has(F))return;let V=mhe(U,M.path),W=new AbortController,q=oB(o,M.path,W.signal),Y=null;if(p.has(F))p.delete(F),Y=sB(r,n,q,M.path,U,V,u,t);else if(z)f&&(Y=sB(r,n,q,M.path,U,V,u,t));else{let Z;typeof C=="boolean"?Z=C:$?Z=!1:Z=f;let ee={...P,defaultShouldRevalidate:Z};NQ(V,ee)&&(Y=sB(r,n,q,M.path,U,V,u,t,ee))}Y&&I.push({key:F,routeId:M.routeId,path:M.path,matches:Y,match:V,request:q,controller:W})}),{dsMatches:L,revalidatingFetchers:I}}function BOe(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function S5t(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!BOe(e))return{shouldLoad:!1,renderFallback:!1};let n=t!=null&&e.id in t,o=r!=null&&r[e.id]!==void 0;if(!n&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!n};let i=!n&&!o;return{shouldLoad:i,renderFallback:i}}function iPn(e,t,r){let n=!t||r.route.id!==t.route.id,o=!e.hasOwnProperty(r.route.id);return n||o}function aPn(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function NQ(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function M4t(e,t,r,n,o,i){let a;if(e){let u=n[e];jn(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),a=u.children}else a=r.activeRoutes;let s=[],l=[];if(t.forEach(u=>{let d=a.find(f=>T5t(u,f));d?l.push({existingRoute:d,newRoute:u}):s.push(u)}),s.length>0){let u=BQ(s,o,[e||"_","patch",String(a?.length||"0")],n);a.push(...u)}if(i&&l.length>0)for(let u=0;u<l.length;u++){let{existingRoute:d,newRoute:f}=l[u],p=d,[h]=BQ([f],o,[],{},!0);Object.assign(p,{element:h.element?h.element:p.element,errorElement:h.errorElement?h.errorElement:p.errorElement,hydrateFallbackElement:h.hydrateFallbackElement?h.hydrateFallbackElement:p.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}function T5t(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((r,n)=>t.children?.some(o=>T5t(r,o)))??!1:!1}var N4t=new WeakMap,w5t=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let o=r[t.id];if(jn(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let i=o.lazy[e];if(!i)return;let a=N4t.get(o);a||(a={},N4t.set(o,a));let s=a[e];if(s)return s;let l=(async()=>{let u=_3n(e),f=o[e]!==void 0&&e!=="hasErrorBoundary";if(u)us(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),a[e]=Promise.resolve();else if(f)us(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let p=await i();p!=null&&(Object.assign(o,{[e]:p}),Object.assign(o,n(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(p=>p===void 0)&&(o.lazy=void 0))})();return a[e]=l,l},O4t=new WeakMap;function sPn(e,t,r,n,o){let i=r[e.id];if(jn(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let d=O4t.get(i);if(d)return{lazyRoutePromise:d,lazyHandlerPromise:d};let f=(async()=>{jn(typeof e.lazy=="function","No lazy route function found");let p=await e.lazy(),h={};for(let m in p){let g=p[m];if(g===void 0)continue;let y=R3n(m),b=i[m]!==void 0&&m!=="hasErrorBoundary";y?us(!y,"Route property "+m+" is not a supported property to be returned from a lazy route function. This property will be ignored."):b?us(!b,`Route "${i.id}" has a static property "${m}" defined but its lazy function is also returning a value for this property. The lazy route property "${m}" will be ignored.`):h[m]=g}Object.assign(i,h),Object.assign(i,{...n(i),lazy:void 0})})();return O4t.set(i,f),f.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:f}}let a=Object.keys(e.lazy),s=[],l;for(let d of a){if(o&&o.includes(d))continue;let f=w5t({key:d,route:e,manifest:r,mapRouteProperties:n});f&&(s.push(f),d===t&&(l=f))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u?.catch(()=>{}),l?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:l}}async function B4t(e){let t=e.matches.filter(o=>o.shouldLoad),r={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,i)=>{r[t[i].route.id]=o}),r}async function lPn(e){return e.matches.some(t=>t.route.middleware)?C5t(e,()=>B4t(e)):B4t(e)}function C5t(e,t){return cPn(e,t,n=>{if(wPn(n))throw n;return n},bPn,r);function r(n,o,i){if(i)return Promise.resolve(Object.assign(i.value,{[o]:{type:"error",result:n}}));{let{matches:a}=e,s=Math.min(Math.max(a.findIndex(u=>u.route.id===o),0),Math.max(a.findIndex(u=>u.shouldCallHandler()),0)),l=oE(a,a[s].route.id).route.id;return Promise.resolve({[l]:{type:"error",result:n}})}}}async function cPn(e,t,r,n,o){let{matches:i,...a}=e,s=i.flatMap(u=>u.route.middleware?u.route.middleware.map(d=>[u.route.id,d]):[]);return await k5t(a,s,t,r,n,o)}async function k5t(e,t,r,n,o,i,a=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let l=t[a];if(!l)return await r();let[u,d]=l,f,p=async()=>{if(f)throw new Error("You may only call `next()` once per middleware");try{return f={value:await k5t(e,t,r,n,o,i,a+1)},f.value}catch(h){return f={value:await i(h,u,f)},f.value}};try{let h=await d(e,p),m=h!=null?n(h):void 0;return o(m)?m:f?m??f.value:(f={value:await p()},f.value)}catch(h){return await i(h,u,f)}}function _5t(e,t,r,n,o){let i=w5t({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),a=sPn(n.route,Wd(r.method)?"action":"loader",t,e,o);return{middleware:i,route:a.lazyRoutePromise,handler:a.lazyHandlerPromise}}function ROe(e,t,r,n,o,i,a,s,l,u=null,d){let f=!1,p=_5t(e,t,r,i,a);return{...i,_lazyPromises:p,shouldLoad:l,shouldRevalidateArgs:u,shouldCallHandler(h){return f=!0,u?typeof d=="boolean"?NQ(i,{...u,defaultShouldRevalidate:d}):typeof h=="boolean"?NQ(i,{...u,defaultShouldRevalidate:h}):NQ(i,u):l},resolve(h){let{lazy:m,loader:g,middleware:y}=i.route,v=f||l||h&&!Wd(r.method)&&(m||g),b=y&&y.length>0&&!g&&!m;return v&&(Wd(r.method)||!b)?dPn({request:r,path:n,pattern:o,match:i,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:h,scopedContext:s}):Promise.resolve({type:"data",result:void 0})}}}function sB(e,t,r,n,o,i,a,s,l=null){return o.map(u=>u.route.id!==i.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:_5t(e,t,r,u,a),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ROe(e,t,r,n,zQ(o),u,a,s,!0,l))}async function uPn(e,t,r,n,o,i,a){n.some(d=>d._lazyPromises?.middleware)&&await Promise.all(n.map(d=>d._lazyPromises?.middleware));let s={request:t,url:E5t(t,r),pattern:zQ(n),params:n[0].params,context:i,matches:n},u=await e({...s,fetcherKey:o,runClientMiddleware:a?()=>{throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:d=>{let f=s;return C5t(f,()=>d({...f,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(d=>[d._lazyPromises?.handler,d._lazyPromises?.route]))}catch{}return u}async function dPn({request:e,path:t,pattern:r,match:n,lazyHandlerPromise:o,lazyRoutePromise:i,handlerOverride:a,scopedContext:s}){let l,u,d=Wd(e.method),f=d?"action":"loader",p=h=>{let m,g=new Promise((b,x)=>m=x);u=()=>m(),e.signal.addEventListener("abort",u);let y=b=>typeof h!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${f}" [routeId: ${n.route.id}]`)):h({request:e,url:E5t(e,t),pattern:r,params:n.params,context:s},...b!==void 0?[b]:[]),v=(async()=>{try{return{type:"data",result:await(a?a(x=>y(x)):y())}}catch(b){return{type:"error",result:b}}})();return Promise.race([v,g])};try{let h=d?n.route.action:n.route.loader;if(o||i)if(h){let m,[g]=await Promise.all([p(h).catch(y=>{m=y}),o,i]);if(m!==void 0)throw m;l=g}else{await o;let m=d?n.route.action:n.route.loader;if(m)[l]=await Promise.all([p(m),i]);else if(f==="action"){let g=new URL(e.url),y=g.pathname+g.search;throw Kg(405,{method:e.method,pathname:y,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(h)l=await p(h);else{let m=new URL(e.url),g=m.pathname+m.search;throw Kg(404,{pathname:g})}}catch(h){return{type:"error",result:h}}finally{u&&e.signal.removeEventListener("abort",u)}return l}async function fPn(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function pPn(e){let{result:t,type:r}=e;if($Oe(t)){let n;try{n=await fPn(t)}catch(o){return{type:"error",error:o}}return r==="error"?{type:"error",error:new fB(t.status,t.statusText,n),statusCode:t.status,headers:t.headers}:{type:"data",data:n,statusCode:t.status,headers:t.headers}}return r==="error"?W4t(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:vPn(t),statusCode:dB(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:dB(t)?t.status:void 0}:W4t(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function hPn(e,t,r,n,o){let i=e.headers.get("Location");if(jn(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!MOe(i)){let a=n.slice(0,n.findIndex(s=>s.route.id===r)+1);i=EOe(new URL(t.url),a,o,i),e.headers.set("Location",i)}return e}var mPn=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function POe(e){try{return mPn.includes(new URL(e).protocol)}catch{return!1}}function $4t(e,t,r,n){if(MOe(e)){let o=e,i=She.test(o)?new URL(t5t(o,t.protocol)):new URL(o);if(POe(i.toString()))throw new Error("Invalid redirect location");let a=If(i.pathname,r)!=null;if(i.origin===t.origin&&a)return NOe(i.pathname)+i.search+i.hash}try{let o=n.createURL(e);if(POe(o.toString()))throw new Error("Invalid redirect location")}catch{}return e}function oB(e,t,r,n){let o=e.createURL(R5t(t)).toString(),i={signal:r};if(n&&Wd(n.formMethod)){let{formMethod:a,formEncType:s}=n;i.method=a.toUpperCase(),s==="application/json"?(i.headers=new Headers({"Content-Type":s}),i.body=JSON.stringify(n.json)):s==="text/plain"?i.body=n.text:s==="application/x-www-form-urlencoded"&&n.formData?i.body=AOe(n.formData):i.body=n.formData}return new Request(o,i)}function E5t(e,t){let r=new URL(e.url),n=typeof t=="string"?Zg(t):t;if(r.pathname=n.pathname||"/",n.search){let o=new URLSearchParams(n.search),i=o.getAll("index");o.delete("index");for(let a of i.filter(Boolean))o.append("index",a);r.search=o.size?`?${o.toString()}`:""}else r.search="";return r.hash=n.hash||"",r}function AOe(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function F4t(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function gPn(e,t,r,n=!1,o=!1){let i={},a=null,s,l=!1,u={},d=r&&fm(r[1])?r[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let p=f.route.id,h=t[p];if(jn(!n6(h),"Cannot handle redirect results in processLoaderData"),fm(h)){let m=h.error;if(d!==void 0&&(m=d,d=void 0),a=a||{},o)a[p]=m;else{let g=oE(e,p);a[g.route.id]==null&&(a[g.route.id]=m)}n||(i[p]=b5t),l||(l=!0,s=dB(h.error)?h.error.status:500),h.headers&&(u[p]=h.headers)}else i[p]=h.data,h.statusCode&&h.statusCode!==200&&!l&&(s=h.statusCode),h.headers&&(u[p]=h.headers)}),d!==void 0&&r&&(a={[r[0]]:d},r[2]&&(i[r[2]]=void 0)),{loaderData:i,errors:a,statusCode:s||200,loaderHeaders:u}}function z4t(e,t,r,n,o,i,a){let{loaderData:s,errors:l}=gPn(t,r,n);return o.filter(u=>!u.matches||u.matches.some(d=>d.shouldLoad)).forEach(u=>{let{key:d,match:f,controller:p}=u;if(p&&p.signal.aborted)return;let h=i[d];if(jn(h,"Did not find corresponding fetcher result"),fm(h)){let m=oE(e.matches,f?.route.id);l&&l[m.route.id]||(l={...l,[m.route.id]:h.error}),a.delete(d)}else if(n6(h))jn(!1,"Unhandled fetcher revalidation redirect");else{let m=tb(h.data);a.set(d,m)}}),{loaderData:s,errors:l}}function H4t(e,t,r,n){let o=Object.entries(t).filter(([,i])=>i!==b5t).reduce((i,[a,s])=>(i[a]=s,i),{});for(let i of r){let a=i.route.id;if(!t.hasOwnProperty(a)&&e.hasOwnProperty(a)&&i.route.loader&&(o[a]=e[a]),n&&n.hasOwnProperty(a))break}return o}function U4t(e){return e?fm(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function oE(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function che(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Kg(e,{pathname:t,routeId:r,method:n,type:o,message:i}={}){let a="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(a="Bad Request",n&&t&&r?s=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:o==="invalid-body"&&(s="Unable to encode submission body")):e===403?(a="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(a="Not Found",s=`No route matches URL "${t}"`):e===405&&(a="Method Not Allowed",n&&t&&r?s=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(s=`Invalid request method "${n.toUpperCase()}"`)),new fB(e||500,a,new Error(s),!0)}function uhe(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,o]=t[r];if(n6(o))return{key:n,result:o}}}function R5t(e){let t=typeof e=="string"?Zg(e):e;return Vd({...t,hash:""})}function yPn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function vPn(e){return new fB(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function bPn(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&xPn(r))}function xPn(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function SPn(e){return $Oe(e.result)&&g5t.has(e.result.status)}function fm(e){return e.type==="error"}function n6(e){return(e&&e.type)==="redirect"}function W4t(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function $Oe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function TPn(e){return g5t.has(e)}function wPn(e){return $Oe(e)&&TPn(e.status)&&e.headers.has("Location")}function CPn(e){return ePn.has(e.toUpperCase())}function Wd(e){return Q3n.has(e.toUpperCase())}function FOe(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function mhe(e,t){let r=typeof t=="string"?Zg(t).search:t.search;if(e[e.length-1].route.index&&FOe(r||""))return e[e.length-1];let n=d5t(e);return n[n.length-1]}function V4t(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:i,json:a}=e;if(!(!t||!r||!n)){if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:a,text:void 0}}}function wOe(e,t,r,n){return n?{state:"loading",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:e,matches:t,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function kPn(e,t,r,n){return{state:"submitting",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function LQ(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function _Pn(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function tb(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function EPn(e,t){try{let r=e.sessionStorage.getItem(v5t);if(r){let n=JSON.parse(r);for(let[o,i]of Object.entries(n||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function RPn(e,t){if(t.size>0){let r={};for(let[n,o]of t)r[n]=[...o];try{e.sessionStorage.setItem(v5t,JSON.stringify(r))}catch(n){us(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function G4t(){let e,t,r=new Promise((n,o)=>{e=async i=>{n(i);try{await r}catch{}},t=async i=>{o(i);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var aE=Hp.createContext(null);aE.displayName="DataRouter";var o6=Hp.createContext(null);o6.displayName="DataRouterState";var P5t=Hp.createContext(!1);function A5t(){return Hp.useContext(P5t)}var whe=Hp.createContext({isTransitioning:!1});whe.displayName="ViewTransition";var zOe=Hp.createContext(new Map);zOe.displayName="Fetchers";var PPn=Hp.createContext(null);PPn.displayName="Await";var Gd=Hp.createContext(null);Gd.displayName="Navigation";var i6=Hp.createContext(null);i6.displayName="Location";var pm=Hp.createContext({outlet:null,matches:[],isDataRoute:!1});pm.displayName="Route";var HOe=Hp.createContext(null);HOe.displayName="RouteError";var lB=!0,L5t="REACT_ROUTER_ERROR",APn="REDIRECT",LPn="ROUTE_ERROR_RESPONSE";function IPn(e){if(e.startsWith(`${L5t}:${APn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function DPn(e){if(e.startsWith(`${L5t}:${LPn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new fB(t.status,t.statusText,t.data)}catch{}}function I5t(e,{relative:t}={}){jn(sE(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=zr.useContext(Gd),{hash:o,pathname:i,search:a}=pB(e,{relative:t}),s=i;return r!=="/"&&(s=i==="/"?r:Xg([r,i])),n.createHref({pathname:s,search:a,hash:o})}function sE(){return zr.useContext(i6)!=null}function Vo(){return jn(sE(),"useLocation() may be used only in the context of a <Router> component."),zr.useContext(i6).location}function UOe(){return zr.useContext(i6).navigationType}function WOe(e){jn(sE(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Vo();return zr.useMemo(()=>cB(e,c5t(t)),[t,e])}var D5t="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function M5t(e){zr.useContext(Gd).static||zr.useLayoutEffect(e)}function en(){let{isDataRoute:e}=zr.useContext(pm);return e?VPn():MPn()}function MPn(){jn(sE(),"useNavigate() may be used only in the context of a <Router> component.");let e=zr.useContext(aE),{basename:t,navigator:r}=zr.useContext(Gd),{matches:n}=zr.useContext(pm),{pathname:o}=Vo(),i=JSON.stringify(The(n)),a=zr.useRef(!1);return M5t(()=>{a.current=!0}),zr.useCallback((l,u={})=>{if(us(a.current,D5t),!a.current)return;if(typeof l=="number"){r.go(l);return}let d=FQ(l,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Xg([t,d.pathname])),aB(typeof l=="string"?l:Vd(l),r.createHref(d),OOe(r),"reject"),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,i,o,e])}var NPn=zr.createContext(null);function N5t(e){let t=zr.useContext(pm).outlet;return zr.useMemo(()=>t&&zr.createElement(NPn.Provider,{value:e},t),[t,e])}function cT(){let{matches:e}=zr.useContext(pm);return e[e.length-1]?.params??{}}function pB(e,{relative:t}={}){let{matches:r}=zr.useContext(pm),{pathname:n}=Vo(),o=JSON.stringify(The(r));return zr.useMemo(()=>FQ(e,JSON.parse(o),n,t==="path"),[e,o,n,t])}function O5t(e,t){return B5t(e,t)}function B5t(e,t,r){jn(sE(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=zr.useContext(Gd),{matches:o}=zr.useContext(pm),i=o[o.length-1],a=i?i.params:{},s=i?i.pathname:"/",l=i?i.pathnameBase:"/",u=i&&i.route;if(lB){let y=u&&u.path||"";U5t(s,!u||y.endsWith("*")||y.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${y}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3815
3815
|
|
|
3816
|
-
Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}/*`}">.`)}let d=Vo(),f;if(t){let y=typeof t=="string"?Zg(t):t;jn(l==="/"||y.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${y.pathname}" was given in the \`location\` prop.`),f=y}else f=d;let p=f.pathname||"/",h=p;if(l!=="/"){let y=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=r&&r.state.matches.length?r.state.matches.map(y=>Object.assign(y,{route:r.manifest[y.route.id]||y.route})):DOe(e,{pathname:h});lB&&(us(u||m!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),us(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let g=zPn(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Xg([l,n.encodeLocation?n.encodeLocation(y.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Xg([l,n.encodeLocation?n.encodeLocation(y.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathnameBase])})),o,r);return t&&g?zr.createElement(i6.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},g):g}function OPn(){let e=H5t(),t=dB(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},a=null;return lB&&(console.error("Error handled by React Router default ErrorBoundary:",e),a=zr.createElement(zr.Fragment,null,zr.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),zr.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",zr.createElement("code",{style:i},"ErrorBoundary")," or"," ",zr.createElement("code",{style:i},"errorElement")," prop on your route."))),zr.createElement(zr.Fragment,null,zr.createElement("h2",null,"Unexpected Application Error!"),zr.createElement("h3",{style:{fontStyle:"italic"}},t),r?zr.createElement("pre",{style:o},r):null,a)}var BPn=zr.createElement(OPn,null),$5t=class extends zr.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=DPn(e.digest);r&&(e=r)}let t=e!==void 0?zr.createElement(pm.Provider,{value:this.props.routeContext},zr.createElement(HOe.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?zr.createElement($Pn,{error:e},t):t}};$5t.contextType=P5t;var COe=new WeakMap;function $Pn({children:e,error:t}){let{basename:r,navigator:n}=zr.useContext(Gd);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=IPn(t.digest);if(o){let i=COe.get(t);if(i)throw i;let a=p5t(o.location,r),s=a.absoluteURL||a.to;if(aB(o.location,s,OOe(n),"allow-explicit"),POe(s))throw new Error("Invalid redirect location");if(f5t&&!COe.get(t))if(a.isExternal||o.reloadDocument)window.location.href=s;else{let l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:o.replace}));throw COe.set(t,l),l}return zr.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s}`})}}return e}function FPn({routeContext:e,match:t,children:r}){let n=zr.useContext(aE);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),zr.createElement(pm.Provider,{value:e},r)}function zPn(e,t=[],r){let n=r?.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n?.errors;if(i!=null){let d=o.findIndex(f=>f.route.id&&i?.[f.route.id]!==void 0);jn(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,d+1))}let a=!1,s=-1;if(r&&n){a=n.renderFallback;for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(s=d),f.route.id){let{loaderData:p,errors:h}=n,m=f.route.loader&&!p.hasOwnProperty(f.route.id)&&(!h||h[f.route.id]===void 0);if(f.route.lazy||m){r.isStatic&&(a=!0),s>=0?o=o.slice(0,s+1):o=[o[0]];break}}}}let l=r?.onError,u=n&&l?(d,f)=>{l(d,{location:n.location,params:n.matches?.[0]?.params??{},pattern:zQ(n.matches),errorInfo:f})}:void 0;return o.reduceRight((d,f,p)=>{let h,m=!1,g=null,y=null;n&&(h=i&&f.route.id?i[f.route.id]:void 0,g=f.route.errorElement||BPn,a&&(s<0&&p===0?(U5t("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,y=null):s===p&&(m=!0,y=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,p+1)),b=()=>{let x;return h?x=g:m?x=y:f.route.Component?x=zr.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,zr.createElement(FPn,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?zr.createElement($5t,{location:n.location,revalidation:n.revalidation,component:g,error:h,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:u}):b()},null)}function VOe(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function F5t(e){let t=zr.useContext(aE);return jn(t,VOe(e)),t}function Che(e){let t=zr.useContext(o6);return jn(t,VOe(e)),t}function HPn(e){let t=zr.useContext(pm);return jn(t,VOe(e)),t}function GOe(e){let t=HPn(e),r=t.matches[t.matches.length-1];return jn(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function UPn(){return GOe("useRouteId")}function z5t(){let e=Che("useNavigation");return zr.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}function qOe(){let{matches:e,loaderData:t}=Che("useMatches");return zr.useMemo(()=>e.map(r=>o5t(r,t)),[e,t])}function H5t(){let e=zr.useContext(HOe),t=Che("useRouteError"),r=GOe("useRouteError");return e!==void 0?e:t.errors?.[r]}var WPn=0;function jOe(e){let{router:t,basename:r}=F5t("useBlocker"),n=Che("useBlocker"),[o,i]=zr.useState(""),a=zr.useCallback(s=>{if(typeof e!="function")return!!e;if(r==="/")return e(s);let{currentLocation:l,nextLocation:u,historyAction:d}=s;return e({currentLocation:{...l,pathname:If(l.pathname,r)||l.pathname},nextLocation:{...u,pathname:If(u.pathname,r)||u.pathname},historyAction:d})},[r,e]);return zr.useEffect(()=>{let s=String(++WPn);return i(s),()=>t.deleteBlocker(s)},[t]),zr.useEffect(()=>{o!==""&&t.getBlocker(o,a)},[t,o,a]),o&&n.blockers.has(o)?n.blockers.get(o):r6}function VPn(){let{router:e}=F5t("useNavigate"),t=GOe("useNavigate"),r=zr.useRef(!1);return M5t(()=>{r.current=!0}),zr.useCallback(async(o,i={})=>{us(r.current,D5t),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...i}))},[e,t])}var q4t={};function U5t(e,t,r){!t&&!q4t[e]&&(q4t[e]=!0,us(!1,r))}var j4t={};function Y4t(e,t){!e&&!j4t[t]&&(j4t[t]=!0,console.warn(t))}var GPn="useOptimistic",K4t=fn[GPn],qPn=()=>{};function jPn(e){return K4t?K4t(e):[e,qPn]}function W5t(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(lB&&e.element&&us(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:fn.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(lB&&e.hydrateFallbackElement&&us(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:fn.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(lB&&e.errorElement&&us(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:fn.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var V5t=["HydrateFallback","hydrateFallbackElement"];var YPn=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function YOe({router:e,flushSync:t,onError:r,useTransitions:n}){n=A5t()||n;let[i,a]=fn.useState(e.state),[s,l]=jPn(i),[u,d]=fn.useState(),[f,p]=fn.useState({isTransitioning:!1}),[h,m]=fn.useState(),[g,y]=fn.useState(),[v,b]=fn.useState(),x=fn.useRef(new Map),w=fn.useCallback((R,{deletedFetchers:D,newErrors:N,flushSync:$,viewTransitionOpts:P})=>{N&&r&&Object.values(N).forEach(L=>r(L,{location:R.location,params:R.matches[0]?.params??{},pattern:zQ(R.matches)})),R.fetchers.forEach((L,I)=>{L.data!==void 0&&x.current.set(I,L.data)}),D.forEach(L=>x.current.delete(L)),Y4t($===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let A=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Y4t(P==null||A,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!P||!A){t&&$?t(()=>a(R)):n===!1?a(R):fn.startTransition(()=>{n===!0&&l(L=>X4t(L,R)),a(R)});return}if(t&&$){t(()=>{g&&(h?.resolve(),g.skipTransition()),p({isTransitioning:!0,flushSync:!0,currentLocation:P.currentLocation,nextLocation:P.nextLocation})});let L=e.window.document.startViewTransition(()=>{t(()=>a(R))});L.finished.finally(()=>{t(()=>{m(void 0),y(void 0),d(void 0),p({isTransitioning:!1})})}),t(()=>y(L));return}g?(h?.resolve(),g.skipTransition(),b({state:R,currentLocation:P.currentLocation,nextLocation:P.nextLocation})):(d(R),p({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}))},[e.window,t,g,h,n,l,r]);fn.useLayoutEffect(()=>e.subscribe(w),[e,w]),fn.useEffect(()=>{f.isTransitioning&&!f.flushSync&&m(new YPn)},[f]),fn.useEffect(()=>{if(h&&u&&e.window){let R=u,D=h.promise,N=e.window.document.startViewTransition(async()=>{n===!1?a(R):fn.startTransition(()=>{n===!0&&l($=>X4t($,R)),a(R)}),await D});N.finished.finally(()=>{m(void 0),y(void 0),d(void 0),p({isTransitioning:!1})}),y(N)}},[u,h,e.window,n,l]),fn.useEffect(()=>{h&&u&&s.location.key===u.location.key&&h.resolve()},[h,g,s.location,u]),fn.useEffect(()=>{!f.isTransitioning&&v&&(d(v.state),p({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),b(void 0))},[f.isTransitioning,v]);let C=fn.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:R=>e.navigate(R),push:(R,D,N)=>e.navigate(R,{state:D,preventScrollReset:N?.preventScrollReset}),replace:(R,D,N)=>e.navigate(R,{replace:!0,state:D,preventScrollReset:N?.preventScrollReset})}),[e]),k=e.basename||"/",E=fn.useMemo(()=>({router:e,navigator:C,static:!1,basename:k,onError:r}),[e,C,k,r]);return fn.createElement(fn.Fragment,null,fn.createElement(aE.Provider,{value:E},fn.createElement(o6.Provider,{value:s},fn.createElement(zOe.Provider,{value:x.current},fn.createElement(whe.Provider,{value:f},fn.createElement(KOe,{basename:k,location:s.location,navigationType:s.historyAction,navigator:C,useTransitions:n},fn.createElement(KPn,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function X4t(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var KPn=fn.memo(XPn);function XPn({routes:e,manifest:t,future:r,state:n,isStatic:o,onError:i}){return B5t(e,void 0,{manifest:t,state:n,isStatic:o,onError:i,future:r})}function a6({to:e,replace:t,state:r,relative:n}){jn(sE(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:i}=fn.useContext(Gd);us(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=fn.useContext(pm),{pathname:s}=Vo(),l=en(),u=FQ(e,The(a),s,n==="path");aB(typeof e=="string"?e:Vd(e),i.createHref(u),OOe(i),"reject");let d=JSON.stringify(u);return fn.useEffect(()=>{l(JSON.parse(d),{replace:t,state:r,relative:n})},[l,d,n,t,r]),null}function HQ(e){return N5t(e.context)}function So(e){jn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function KOe({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:i=!1,useTransitions:a}){jn(!sE(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=fn.useMemo(()=>({basename:s,navigator:o,static:i,useTransitions:a,future:{}}),[s,o,i,a]);typeof r=="string"&&(r=Zg(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:h="default",mask:m}=r,g=fn.useMemo(()=>{let y=If(u,s);return y==null?null:{location:{pathname:y,search:d,hash:f,state:p,key:h,mask:m},navigationType:n}},[s,u,d,f,p,h,n,m]);return us(g!=null,`<Router basename="${s}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:fn.createElement(Gd.Provider,{value:l},fn.createElement(i6.Provider,{children:t,value:g}))}function uT({children:e,location:t}){return O5t(vhe(e),t)}function vhe(e,t=[]){let r=[];return fn.Children.forEach(e,(n,o)=>{if(!fn.isValidElement(n))return;let i=[...t,o];if(n.type===fn.Fragment){r.push.apply(r,vhe(n.props.children,i));return}jn(n.type===So,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),jn(!n.props.index||!n.props.children,"An index route cannot have child routes.");let a={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=vhe(n.props.children,i)),r.push(a)}),r}var ghe="get",yhe="application/x-www-form-urlencoded";function khe(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function ZPn(e){return khe(e)&&e.tagName.toLowerCase()==="button"}function QPn(e){return khe(e)&&e.tagName.toLowerCase()==="form"}function JPn(e){return khe(e)&&e.tagName.toLowerCase()==="input"}function eAn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tAn(e,t){return e.button===0&&(!t||t==="_self")&&!eAn(e)}function bhe(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function rAn(e,t){let r=bhe(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}var dhe=null;function nAn(){if(dhe===null)try{new FormData(document.createElement("form"),0),dhe=!1}catch{dhe=!0}return dhe}var oAn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function kOe(e){return e!=null&&!oAn.has(e)?(us(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${yhe}"`),null):e}function iAn(e,t){let r,n,o,i,a;if(QPn(e)){let s=e.getAttribute("action");n=s?If(s,t):null,r=e.getAttribute("method")||ghe,o=kOe(e.getAttribute("enctype"))||yhe,i=new FormData(e)}else if(ZPn(e)||JPn(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(n=l?If(l,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||ghe,o=kOe(e.getAttribute("formenctype"))||kOe(s.getAttribute("enctype"))||yhe,i=new FormData(s,e),!nAn()){let{name:u,type:d,value:f}=e;if(d==="image"){let p=u?`${u}.`:"";i.append(`${p}x`,"0"),i.append(`${p}y`,"0")}else u&&i.append(u,f)}}else{if(khe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ghe,n=null,o=yhe,a=e}return i&&o==="text/plain"&&(a=i,i=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:i,body:a}}var hHi=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var aAn={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},sAn=/[&><\u2028\u2029]/g;function Z4t(e){return e.replace(sAn,t=>aAn[t])}function ZOe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function G5t(e,t,r,n){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${n}`:o.pathname=`${o.pathname}.${n}`:o.pathname==="/"?o.pathname=`_root.${n}`:t&&If(o.pathname,t)==="/"?o.pathname=`${uB(t)}/_root.${n}`:o.pathname=`${uB(o.pathname)}.${n}`,o}async function lAn(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&IAn.hot)throw r;return window.location.reload(),new Promise(()=>{})}}function cAn(e){return e!=null&&typeof e.page=="string"}function uAn(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function dAn(e,t,r){let n=await Promise.all(e.map(async o=>{let i=t.routes[o.route.id];if(i){let a=await lAn(i,r);return a.links?a.links():[]}return[]}));return mAn(n.flat(1).filter(uAn).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Q4t(e,t,r,n,o,i){let a=(l,u)=>r[u]?l.route.id!==r[u].route.id:!0,s=(l,u)=>r[u].pathname!==l.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==l.params["*"];return i==="assets"?t.filter((l,u)=>a(l,u)||s(l,u)):i==="data"?t.filter((l,u)=>{let d=n.routes[l.route.id];if(!d||!d.hasLoader)return!1;if(a(l,u)||s(l,u))return!0;if(l.route.shouldRevalidate){let f=l.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function fAn(e,t,{includeHydrateFallback:r}={}){return pAn(e.map(n=>{let o=t.routes[n.route.id];if(!o)return[];let i=[o.module];return o.clientActionModule&&(i=i.concat(o.clientActionModule)),o.clientLoaderModule&&(i=i.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(i=i.concat(o.hydrateFallbackModule)),o.imports&&(i=i.concat(o.imports)),i}).flat(1))}function pAn(e){return[...new Set(e)]}function hAn(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function mAn(e,t){let r=new Set,n=new Set(t);return e.reduce((o,i)=>{if(t&&!cAn(i)&&i.as==="script"&&i.href&&n.has(i.href))return o;let s=JSON.stringify(hAn(i));return r.has(s)||(r.add(s),o.push({key:s,link:i})),o},[])}function QOe(){let e=$o.useContext(aE);return ZOe(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function bAn(){let e=$o.useContext(o6);return ZOe(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var UQ=$o.createContext(void 0);UQ.displayName="FrameworkContext";function _he(){let e=$o.useContext(UQ);return ZOe(e,"You must render this element inside a <HydratedRouter> element"),e}function xAn(e,t){let r=$o.useContext(UQ),[n,o]=$o.useState(!1),[i,a]=$o.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=$o.useRef(null);$o.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let g=v=>{v.forEach(b=>{a(b.isIntersecting)})},y=new IntersectionObserver(g,{threshold:.5});return p.current&&y.observe(p.current),()=>{y.disconnect()}}},[e]),$o.useEffect(()=>{if(n){let g=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(g)}}},[n]);let h=()=>{o(!0)},m=()=>{o(!1),a(!1)};return r?e!=="intent"?[i,p,{}]:[i,p,{onFocus:IQ(s,h),onBlur:IQ(l,m),onMouseEnter:IQ(u,h),onMouseLeave:IQ(d,m),onTouchStart:IQ(f,h)}]:[!1,p,{}]}function IQ(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function j5t({page:e,...t}){let r=A5t(),{nonce:n}=_he(),{router:o}=QOe(),i=$o.useMemo(()=>DOe(o.routes,e,o.basename),[o.routes,e,o.basename]);return i?(t.nonce==null&&n&&(t={...t,nonce:n}),r?$o.createElement(TAn,{page:e,matches:i,...t}):$o.createElement(wAn,{page:e,matches:i,...t})):null}function SAn(e){let{manifest:t,routeModules:r}=_he(),[n,o]=$o.useState([]);return $o.useEffect(()=>{let i=!1;return dAn(e,t,r).then(a=>{i||o(a)}),()=>{i=!0}},[e,t,r]),n}function TAn({page:e,matches:t,...r}){let n=Vo(),{future:o}=_he(),{basename:i}=QOe(),a=$o.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let s=G5t(e,i,o.v8_trailingSlashAwareDataRequests,"rsc"),l=!1,u=[];for(let d of t)typeof d.route.shouldRevalidate=="function"?l=!0:u.push(d.route.id);return l&&u.length>0&&s.searchParams.set("_routes",u.join(",")),[s.pathname+s.search]},[i,o.v8_trailingSlashAwareDataRequests,e,n,t]);return $o.createElement($o.Fragment,null,a.map(s=>$o.createElement("link",{key:s,rel:"prefetch",as:"fetch",href:s,...r})))}function wAn({page:e,matches:t,...r}){let n=Vo(),{future:o,manifest:i,routeModules:a}=_he(),{basename:s}=QOe(),{loaderData:l,matches:u}=bAn(),d=$o.useMemo(()=>Q4t(e,t,u,i,n,"data"),[e,t,u,i,n]),f=$o.useMemo(()=>Q4t(e,t,u,i,n,"assets"),[e,t,u,i,n]),p=$o.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let g=new Set,y=!1;if(t.forEach(b=>{let x=i.routes[b.route.id];!x||!x.hasLoader||(!d.some(w=>w.route.id===b.route.id)&&b.route.id in l&&a[b.route.id]?.shouldRevalidate||x.hasClientLoader?y=!0:g.add(b.route.id))}),g.size===0)return[];let v=G5t(e,s,o.v8_trailingSlashAwareDataRequests,"data");return y&&g.size>0&&v.searchParams.set("_routes",t.filter(b=>g.has(b.route.id)).map(b=>b.route.id).join(",")),[v.pathname+v.search]},[s,o.v8_trailingSlashAwareDataRequests,l,n,i,d,t,e,a]),h=$o.useMemo(()=>fAn(f,i),[f,i]),m=SAn(f);return $o.createElement($o.Fragment,null,p.map(g=>$o.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...r})),h.map(g=>$o.createElement("link",{key:g,rel:"modulepreload",href:g,...r})),m.map(({key:g,link:y})=>$o.createElement("link",{key:g,nonce:r.nonce,...y,crossOrigin:y.crossOrigin??r.crossOrigin})))}function CAn(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var kAn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{kAn&&(window.__reactRouterVersion="7.18.5")}catch{}function JOe(e,t){return x5t({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:r5t({window:t?.window}),hydrationData:t?.hydrationData||_An(),routes:e,mapRouteProperties:W5t,hydrationRouteProperties:V5t,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function _An(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:EAn(e.errors)}),e}function EAn(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,o]of t)if(o&&o.__type==="RouteErrorResponse")r[n]=new fB(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(typeof o.__subType=="string"&&V3n.includes(o.__subType)){let i=window[o.__subType];if(typeof i=="function")try{let a=new i(o.message);a.stack="",r[n]=a}catch{}}if(r[n]==null){let i=new Error(o.message);i.stack="",r[n]=i}}else r[n]=o;return r}function Y5t({basename:e,children:t,history:r,useTransitions:n}){let[o,i]=pn.useState({action:r.action,location:r.location}),a=pn.useCallback(s=>{n===!1?i(s):pn.startTransition(()=>i(s))},[n]);return pn.useLayoutEffect(()=>r.listen(a),[r,a]),pn.createElement(KOe,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:r,useTransitions:n})}Y5t.displayName="unstable_HistoryRouter";var wa=pn.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:o,reloadDocument:i,replace:a,mask:s,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:h,...m},g){let{basename:y,navigator:v,useTransitions:b}=pn.useContext(Gd),x=typeof d=="string"&&xhe.test(d),w=p5t(d,y);d=w.to;let C=I5t(d,{relative:o}),k=Vo(),E=null;if(s){let I=FQ(s,[],k.mask?k.mask.pathname:"/",!0);y!=="/"&&(I.pathname=I.pathname==="/"?y:Xg([y,I.pathname])),E=v.createHref(I)}let[R,D,N]=xAn(n,m),$=J5t(d,{replace:a,mask:s,state:l,target:u,preventScrollReset:f,relative:o,viewTransition:p,defaultShouldRevalidate:h,useTransitions:b});function P(I){t&&t(I),I.defaultPrevented||$(I)}let A=!(w.isExternal||i),L=pn.createElement("a",{...m,...N,href:(A?E:void 0)||w.absoluteURL||C,onClick:A?P:t,ref:CAn(g,D),target:u,"data-discover":!x&&r==="render"?"true":void 0});return R&&!x?pn.createElement(pn.Fragment,null,L,pn.createElement(j5t,{page:C})):L});wa.displayName="Link";var K5t=pn.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:o=!1,style:i,to:a,viewTransition:s,children:l,...u},d){let f=pB(a,{relative:u.relative}),p=Vo(),h=pn.useContext(o6),{navigator:m,basename:g}=pn.useContext(Gd),y=h!=null&&nRt(f)&&s===!0,v=m.encodeLocation?m.encodeLocation(f).pathname:f.pathname,b=p.pathname,x=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;r||(b=b.toLowerCase(),x=x?x.toLowerCase():null,v=v.toLowerCase()),x&&g&&(x=If(x,g)||x);let w=v!=="/"&&v.endsWith("/")?v.length-1:v.length,C=b===v||!o&&b.startsWith(v)&&b.charAt(w)==="/",k=x!=null&&(x===v||!o&&x.startsWith(v)&&x.charAt(v.length)==="/"),E={isActive:C,isPending:k,isTransitioning:y},R=C?t:void 0,D;typeof n=="function"?D=n(E):D=[n,C?"active":null,k?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let N=typeof i=="function"?i(E):i;return pn.createElement(wa,{...u,"aria-current":R,className:D,ref:d,style:N,to:a,viewTransition:s},typeof l=="function"?l(E):l)});K5t.displayName="NavLink";var X5t=pn.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:i,method:a=ghe,action:s,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...h},m)=>{let{useTransitions:g}=pn.useContext(Gd),y=eRt(),v=tRt(s,{relative:u}),b=a.toLowerCase()==="get"?"get":"post",x=typeof s=="string"&&xhe.test(s);return pn.createElement("form",{ref:m,method:b,action:v,onSubmit:n?l:C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let k=C.nativeEvent.submitter,E=k?.getAttribute("formmethod")||a,R=()=>y(k||C.currentTarget,{fetcherKey:t,method:E,navigate:r,replace:o,state:i,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&r!==!1?pn.startTransition(()=>R()):R()},...h,"data-discover":!x&&e==="render"?"true":void 0})});X5t.displayName="Form";function Z5t({getKey:e,storageKey:t,...r}){let n=pn.useContext(UQ),{basename:o}=pn.useContext(Gd),i=Vo(),a=qOe();rRt({getKey:e,storageKey:t});let s=pn.useMemo(()=>{if(!n||!e)return null;let u=IOe(i,a,o,e);return u!==i.key?u:null},[]);if(!n||n.isSpaMode)return null;let l=((u,d)=>{if(!window.history.state||!window.history.state.key){let f=Math.random().toString(32).slice(2);window.history.replaceState({key:f},"")}try{let p=JSON.parse(sessionStorage.getItem(u)||"{}")[d||window.history.state.key];typeof p=="number"&&window.scrollTo(0,p)}catch(f){console.error(f),sessionStorage.removeItem(u)}}).toString();return r.nonce==null&&n?.nonce&&(r.nonce=n.nonce),pn.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${Z4t(JSON.stringify(t||LOe))}, ${Z4t(JSON.stringify(s))})`}})}Z5t.displayName="ScrollRestoration";function Q5t(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function eBe(e){let t=pn.useContext(aE);return jn(t,Q5t(e)),t}function RAn(e){let t=pn.useContext(o6);return jn(t,Q5t(e)),t}function J5t(e,{target:t,replace:r,mask:n,state:o,preventScrollReset:i,relative:a,viewTransition:s,defaultShouldRevalidate:l,useTransitions:u}={}){let d=en(),f=Vo(),p=pB(e,{relative:a});return pn.useCallback(h=>{if(tAn(h,t)){h.preventDefault();let m=r!==void 0?r:Vd(f)===Vd(p),g=()=>d(e,{replace:m,mask:n,state:o,preventScrollReset:i,relative:a,viewTransition:s,defaultShouldRevalidate:l});u?pn.startTransition(()=>g()):g()}},[f,d,p,r,n,o,t,e,i,a,s,l,u])}function ja(e){us(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=pn.useRef(bhe(e)),r=pn.useRef(!1),n=Vo(),o=pn.useMemo(()=>rAn(n.search,r.current?null:t.current),[n.search]),i=en(),a=pn.useCallback((s,l)=>{let u=bhe(typeof s=="function"?s(new URLSearchParams(o)):s);r.current=!0,i("?"+u,l)},[i,o]);return[o,a]}var PAn=0,AAn=()=>`__${String(++PAn)}__`;function eRt(){let{router:e}=eBe("useSubmit"),{basename:t}=pn.useContext(Gd),r=UPn(),n=e.fetch,o=e.navigate;return pn.useCallback(async(i,a={})=>{let{action:s,method:l,encType:u,formData:d,body:f}=iAn(i,t);if(a.navigate===!1){let p=a.fetcherKey||AAn();await n(p,r,a.action||s,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||l,formEncType:a.encType||u,flushSync:a.flushSync})}else await o(a.action||s,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||l,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[n,o,t,r])}function tRt(e,{relative:t}={}){let{basename:r}=pn.useContext(Gd),n=pn.useContext(pm);jn(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),i={...pB(e||".",{relative:t})},a=Vo();if(e==null){i.search=a.search;let s=new URLSearchParams(i.search),l=s.getAll("index");if(l.some(d=>d==="")){s.delete("index"),l.filter(f=>f).forEach(f=>s.append("index",f));let d=s.toString();i.search=d?`?${d}`:""}}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(i.pathname=i.pathname==="/"?r:Xg([r,i.pathname])),Vd(i)}var LOe="react-router-scroll-positions",fhe={};function IOe(e,t,r,n){let o=null;return n&&(r!=="/"?o=n({...e,pathname:If(e.pathname,r)||e.pathname},t):o=n(e,t)),o==null&&(o=e.key),o}function rRt({getKey:e,storageKey:t}={}){let{router:r}=eBe("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:o}=RAn("useScrollRestoration"),{basename:i}=pn.useContext(Gd),a=Vo(),s=qOe(),l=z5t();pn.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),LAn(pn.useCallback(()=>{if(l.state==="idle"){let u=IOe(a,s,i,e);fhe[u]=window.scrollY}try{sessionStorage.setItem(t||LOe,JSON.stringify(fhe))}catch(u){us(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[l.state,e,i,a,s,t])),typeof document<"u"&&(pn.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||LOe);u&&(fhe=JSON.parse(u))}catch{}},[t]),pn.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(fhe,()=>window.scrollY,e?(d,f)=>IOe(d,f,i,e):void 0);return()=>u&&u()},[r,i,e]),pn.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(a.hash){let u=document.getElementById(decodeURIComponent(a.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{us(!1,`"${a.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}o!==!0&&window.scrollTo(0,0)}},[a,n,o]))}function LAn(e,t){let{capture:r}=t||{};pn.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function nRt(e,{relative:t}={}){let r=pn.useContext(whe);jn(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=eBe("useViewTransitionState"),o=pB(e,{relative:t});if(!r.isTransitioning)return!1;let i=If(r.currentLocation.pathname,n)||r.currentLocation.pathname,a=If(r.nextLocation.pathname,n)||r.nextLocation.pathname;return cB(o.pathname,a)!=null||cB(o.pathname,i)!=null}var Edn=S(re(),1);var Ehe=S(re(),1),tBe=(0,Ehe.createContext)({nodes:null,transfer:()=>{},cancel:()=>{}});function Rhe(){return(0,Ehe.useContext)(tBe)}var iRt=S(_(),1);function lE({inputRef:e,value:t,onChange:r,onKeyDown:n,placeholder:o,autoFocus:i}){return(0,iRt.jsx)(An,{autoFocus:i,inputRef:e,value:t,onChange:a=>r(a.target.value),onKeyDown:n,placeholder:o,size:"small",fullWidth:!0,slotProps:{input:{sx:{fontSize:12}}},sx:{p:.5}})}var dT=S(re(),1),cRt=S(_(),1),aRt=(0,dT.createContext)({query:"",setQuery:()=>{},viewedTerm:"",setViewedTerm:()=>{}});function sRt({children:e}){let[t,r]=(0,dT.useState)(""),[n,o]=(0,dT.useState)(""),i=(0,dT.useMemo)(()=>({query:t,setQuery:r,viewedTerm:n,setViewedTerm:o}),[t,n]);return(0,cRt.jsx)(aRt.Provider,{value:i,children:e})}function WQ(){return(0,dT.useContext)(aRt)}function lRt(){let{query:e,viewedTerm:t}=WQ();return e.trim()?t:""}var uRt=S(_(),1),Z0=ot((0,uRt.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");function Phe(e){return{display:"block",width:"100%",textAlign:"left",p:"5px 10px",borderRadius:0,bgcolor:e?"action.selected":"background.default",borderLeft:2,borderLeftColor:e?"primary.main":"transparent",cursor:e?"default":"pointer",transition:"background 0.15s","&:hover":e?void 0:{bgcolor:"action.hover"}}}var AUi=S(re(),1);var dRt=S(_(),1),Ahe=ot((0,dRt.jsx)("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub");var DAn=/^([^/\s]+)\/([^/\s]+)#(\d+)$/;function Lhe(e){let t=DAn.exec(e);if(!t)return;let[,r,n,o]=t;return`https://github.com/${r}/${n}/issues/${o}`}var MAn=/^[^/\s]+\/[^/\s]+#(\d+)$/;function fRt(e){let t=MAn.exec(e);return t?`#${t[1]}`:e}var NAn=/^([^/\s]+)\/([^/\s]+)#(\d+)$/;function pRt(e,t){let r=NAn.exec(e);if(!r||!t)return e;let[,n,o,i]=r;return`github.com/${n}/${o}`.toLowerCase()===t.toLowerCase()?`#${i}`:e}var rBe=S(_(),1),hRt={height:18,fontSize:"0.65rem"};function mRt({label:e,url:t,title:r}){return t?(0,rBe.jsx)(yn,{label:e,title:r,size:"small",sx:hRt,clickable:!0,component:"a",href:t,target:"_blank",rel:"noopener",onClick:n=>n.stopPropagation()}):(0,rBe.jsx)(yn,{label:e,title:r,size:"small",sx:hRt,clickable:!1,onClick:n=>n.stopPropagation()})}var hB=S(_(),1),gRt={display:"inline-flex",alignItems:"center",gap:.375,whiteSpace:"nowrap","& svg":{fontSize:14}};function yRt({icon:e,label:t,title:r,url:n}){return n?(0,hB.jsx)(lr,{title:r,children:(0,hB.jsxs)(Ur,{href:n,target:"_blank",rel:"noopener",underline:"hover",sx:gRt,children:[e,t]})}):(0,hB.jsx)(lr,{title:r,children:(0,hB.jsxs)(H,{component:"span",sx:{...gRt,color:"text.disabled"},children:[e,t]})})}var bRt=S(_(),1),OAn={color:"primary.main",opacity:.85,whiteSpace:"nowrap"};function vRt({label:e,url:t,title:r}){return t?(0,bRt.jsx)(Ur,{href:t,title:r,target:"_blank",rel:"noopener",underline:"hover",sx:OAn,onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:e}):e}var mB=S(_(),1),xRt={fontSize:"0.875rem"};function Ihe({label:e,url:t,variant:r="link",icon:n,title:o}){return r==="chip"?(0,mB.jsx)(mRt,{label:e,url:t,title:o}):r==="token"?(0,mB.jsx)(vRt,{label:e,url:t,title:o}):r==="icon"?(0,mB.jsx)(yRt,{icon:n,label:e,title:o??e,url:t}):t?(0,mB.jsx)(Ur,{href:t,target:"_blank",rel:"noopener",onClick:i=>i.stopPropagation(),sx:xRt,children:e}):(0,mB.jsx)(be,{variant:"body2",color:"text.disabled",sx:xRt,children:e})}var nBe=S(_(),1);function cE({githubIssue:e,origin:t,variant:r="link"}){return e?(0,nBe.jsx)(Ihe,{label:r==="link"?pRt(e,t):fRt(e),title:e,url:Lhe(e),icon:(0,nBe.jsx)(Ahe,{}),variant:r}):null}var Dhe=S(re(),1);function SRt(){let[e,t]=(0,Dhe.useState)(null);return(0,Dhe.useEffect)(()=>{let r=!1;return(async()=>{try{let o=await(await fetch("/api/jira-site")).json();r||t(o?.site??null)}catch{r||t(null)}})(),()=>{r=!0}},[]),e}var TRt=S(_(),1);function gB({jiraKey:e,variant:t="link"}){let r=SRt();if(!e)return null;let n=r?`https://${r}/browse/${e}`:void 0;return(0,TRt.jsx)(Ihe,{label:e,url:n,variant:t})}var oBe=S(_(),1);function Mhe({tracker:e,variant:t="link"}){return e?.jiraKey?(0,oBe.jsx)(gB,{jiraKey:e.jiraKey,variant:t}):e?.githubIssue?(0,oBe.jsx)(cE,{githubIssue:e.githubIssue,origin:e.origin,variant:t}):null}var iBe=class extends Error{constructor(){super(...arguments);yr(this,"name","InvalidItemIdError")}};function hn(e){return`a${e}`}var BAn=/^a?(\d+)$/;function uE(e){let t=BAn.exec(e.trim());if(!t)throw new iBe(`Invalid backlog item id "${e}" (e.g. a574 or 574).`);return Number.parseInt(t[1],10)}function Dr(e,t){if(!t)return e;let r=e.includes("?")?"&":"?";return`${e}${r}node=${encodeURIComponent(t)}`}function xc(e,t,r){if(!t)return Dr(e,r);let n=e.includes("?")?"&":"?";return Dr(`${e}${n}cwd=${encodeURIComponent(t)}`,r)}function qd(e,t,r){return xc(`/backlog/items/${hn(e)}`,t,t&&r)}function $An(e,t){if(t==="neutral")return{color:e.palette.text.secondary,borderColor:e.palette.divider};let{main:r}=e.palette[t];return{color:r,borderColor:Or(r,.35)}}function Go(e){return t=>({display:"inline-block",fontFamily:t.typography.fontFamilyMono,fontSize:10,fontWeight:400,lineHeight:"16px",px:"5px",border:1,borderRadius:"4px",whiteSpace:"nowrap",opacity:1,...$An(t,e)})}var Nhe=S(re(),1),Sc=(0,Nhe.createContext)(void 0);function ur(){return(0,Nhe.useContext)(Sc)}var CRt=S(_(),1),FAn=[Go("primary"),{flexShrink:0,textDecoration:"none"}],wRt=e=>e.stopPropagation();function Ohe({itemId:e,cwd:t}){let r=ur();return(0,CRt.jsx)(H,{component:wa,to:qd(e,t,r),onMouseDown:wRt,onClick:wRt,sx:FAn,children:hn(e)})}var zAn={claude:"Claude","claude-sdk":"Claude (SDK)",codex:"Codex",pi:"pi"},HAn={claude:"Claude Code","claude-sdk":"Claude Code",codex:"Codex",pi:"pi"},Qg="claude";function jd(e){return e??Qg}function Ei(e){let t=jd(e);return zAn[t]??t}function kRt(e){let t=jd(e);return HAn[t]??t}var _Rt=S(_(),1),UAn=Go("neutral");function Bhe({harness:e}){return jd(e)===Qg?null:(0,_Rt.jsx)(H,{component:"span",sx:UAn,children:Ei(e).toLowerCase()})}var WAn=["update"];function yB(e){return!e||!WAn.includes(e)}function Aa(e){if(!e)return"";let t=e.split(/[/\\]/).filter(Boolean);return t[t.length-1]??""}function Q0(e){return e.repoGroup?.origin||e.cwd||void 0}function Ul(e){return e.repoGroup?.clone||e.cwd||void 0}function vB(e,t){if(!e)return e;for(let r of t){let n=r.repoGroup;if(n&&(n.clone===e||r.cwd===e))return n.origin}return e}var Hhe=S(re(),1);var ERt="";function aBe(e){ERt=e.replace(/\/+$/,"")}function fT(e){return`${ERt}${e}`}function RRt(e){let t=new URL(fT(e),location.href);return t.protocol=t.protocol==="https:"?"wss:":"ws:",t.toString()}var PRt=new WeakSet;function s6(e){typeof e=="object"&&e!==null&&PRt.add(e)}function VQ(e){return typeof e=="object"&&e!==null&&PRt.has(e)}var VAn="/api/client-errors",uBe=1e3,GAn=6e4,qAn=1e4,jAn=50,YAn=500,bB=[],sBe,lBe=!1,$he=uBe;function cBe(e){sBe||lBe||(sBe=setTimeout(()=>{sBe=void 0,XAn()},e))}async function KAn(e){try{return(await fetch(fT(VAn),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({failures:e}),signal:AbortSignal.timeout(qAn)})).ok}catch{return!1}}async function XAn(){let e=bB.slice(0,jAn);if(e.length===0)return;lBe=!0;let t=await KAn(e);if(lBe=!1,t){bB=bB.slice(e.length),$he=uBe,bB.length>0&&cBe(0);return}$he=Math.min($he*2,GAn),cBe($he)}function ARt(e){bB=[...bB,e].slice(-YAn),cBe(uBe)}var ZAn=100,fBe=[],dBe=new Set;function LRt(e){fBe=e;for(let t of dBe)t()}function xB(e){LRt([e,...fBe].slice(0,ZAn)),ARt(e)}function pBe(){return fBe}function IRt(){LRt([])}function DRt(e){return dBe.add(e),()=>{dBe.delete(e)}}function QAn(e){return new URL(e,"http://local").searchParams.get("node")??void 0}function MRt(e,t,r){let n=Date.now();return o=>{r&&xB({at:new Date(n).toISOString(),method:(t??"GET").toUpperCase(),path:e,base:fT("")||location.origin,node:QAn(e),durationMs:Date.now()-n,...o})}}var JAn="x-assist-trace-id";async function e6n(e){try{let t=await e.clone().json();if(t&&typeof t=="object"&&"error"in t){let{error:r}=t;if(typeof r=="string"&&r)return r}}catch{}}async function Fhe(e){let t=await e6n(e)??(e.statusText||void 0),r=e.headers?.get(JAn);return r?t?`${t} (trace=${r})`:`trace=${r}`:t}function NRt(e,t){let r=new AbortController,n=()=>r.abort(e?.reason);e?.aborted?n():e?.addEventListener("abort",n,{once:!0});let o=setTimeout(()=>r.abort(new DOMException(`timed out after ${t/1e3}s`,"TimeoutError")),t);return{signal:r.signal,clear:()=>{clearTimeout(o),e?.removeEventListener("abort",n)}}}var t6n=3e4;function r6n(e){return e instanceof DOMException&&e.name==="TimeoutError"}async function Ut(e,t={}){let{timeoutMs:r=t6n,capture:n=!0,blipGate:o,signal:i,...a}=t,{signal:s,clear:l}=NRt(i,r),u=MRt(e,a.method,n);try{let d=await fetch(fT(e),{...a,signal:s});return d.ok?o?.reset():(o?.shouldRecord(d.status)??!0)&&u({status:d.status,error:await Fhe(d)}),d}catch(d){let f=s.aborted?s.reason:d;throw(!s.aborted||r6n(f))&&(u({error:f instanceof Error?f.message:String(f)}),s6(f)),f}finally{l()}}var n6n={error:"ERROR",rejection:"REJECT",caught:"CAUGHT"};function GQ(e,t){xB({at:new Date().toISOString(),kind:e,method:n6n[e],path:location.pathname+location.search,base:location.origin,error:t,durationMs:0})}function xr(e,t){if(VQ(e))return;s6(e);let r=e instanceof Error?e.message:String(e);GQ("caught",`${t}: ${r}`)}var ORt=new Map;function zhe(e,t){let r=`${t??""}\0${e??""}`,n=ORt.get(r);return n||(n=(async()=>{let i=await(await Ut(xc("/api/items",e,t))).json(),a=new Map;for(let s of i)!s.jiraKey&&!s.githubIssue||a.set(s.id,{jiraKey:s.jiraKey,githubIssue:s.githubIssue,origin:s.origin});return a})().catch(o=>(xr(o,"item trackers"),new Map)),ORt.set(r,n)),n}function Uhe(e){let[t,r]=(0,Hhe.useState)(()=>new Map),n=ur();return(0,Hhe.useEffect)(()=>{let o=!1;return zhe(e,n).then(i=>{o||r(i)}),()=>{o=!0}},[e,n]),o=>o==null?void 0:t.get(o)}var hBe=S(_(),1),o6n=Go("neutral");function Whe({node:e}){return e?(0,hBe.jsx)(lr,{title:`Running on ${e}`,children:(0,hBe.jsx)(H,{component:"span",sx:o6n,children:e})}):null}var J0=S(_(),1),BRt={height:18,fontSize:"0.65rem"};function $Rt({session:e}){let t=yB(e.sessionType)?Aa(e.cwd):"",r=Uhe(e.cwd);return(0,J0.jsxs)(J0.Fragment,{children:[t&&(0,J0.jsx)(yn,{label:t,size:"small",sx:BRt}),(0,J0.jsx)(Bhe,{harness:e.harness}),(0,J0.jsx)(Whe,{node:e.node}),e.sessionType&&e.sessionType!=="next"&&(0,J0.jsx)(yn,{label:e.sessionType,size:"small",color:"primary",variant:"outlined",sx:BRt}),e.itemId!=null&&(0,J0.jsx)(Ohe,{itemId:e.itemId,cwd:Ul(e)}),(0,J0.jsx)(Mhe,{variant:"chip",tracker:r(e.itemId)})]})}function lo(e){let t=Date.now()-new Date(e).getTime(),r=Math.floor(t/1e3);if(r<60)return"just now";let n=Math.floor(r/60);if(n<60)return`${n}m ago`;let o=Math.floor(n/60);if(o<24)return`${o}h ago`;let i=Math.floor(o/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}var FRt=S(_(),1);function ca({children:e}){let t=r=>r.stopPropagation();return(0,FRt.jsx)(H,{sx:{display:"contents"},onClick:t,onMouseDown:t,onTouchStart:t,children:e})}var SB=S(re(),1),i6n=1200;function dE(e){let[t,r]=(0,SB.useState)(!1),n=(0,SB.useRef)(void 0);return(0,SB.useEffect)(()=>()=>clearTimeout(n.current),[]),{copied:t,copy:()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),clearTimeout(n.current),n.current=setTimeout(()=>r(!1),i6n)})}}}var qQ=S(_(),1);function zRt({sessionId:e,harness:t}){let{copied:r,copy:n}=dE(e),o=i=>{i.stopPropagation(),n()};return(0,qQ.jsx)(ca,{children:(0,qQ.jsx)(lr,{title:r?"Copied!":`Copy ${Ei(t)} session id`,open:r||void 0,children:(0,qQ.jsx)(Vt,{onClick:o,sx:{borderRadius:.5,px:.25},children:(0,qQ.jsx)(be,{variant:"caption",color:"text.disabled",sx:{fontFamily:"fontFamilyMono"},children:e.slice(0,8)})})})})}var jQ=S(_(),1);function HRt({session:e}){return(0,jQ.jsxs)(H,{sx:{display:"flex",alignItems:"center",gap:1,alignSelf:"flex-end"},children:[e.sessionId&&(0,jQ.jsx)(zRt,{sessionId:e.sessionId,harness:e.harness}),(0,jQ.jsx)(be,{variant:"caption",color:"text.disabled",children:lo(e.lastActivity??e.timestamp)})]})}var URt=S(_(),1);function Vhe({children:e}){return(0,URt.jsx)(H,{component:"mark",sx:{bgcolor:"warning.main",color:"warning.contrastText",borderRadius:.5,px:.25},children:e})}var Ghe=S(_(),1);function WRt({snippet:e}){return(0,Ghe.jsxs)(be,{variant:"caption",sx:{color:"text.secondary",overflowWrap:"anywhere"},children:[e.before,(0,Ghe.jsx)(Vhe,{children:e.match}),e.after]})}function VRt(e){return e.prompt||e.name}var l6=S(_(),1);function GRt({session:e}){return(0,l6.jsxs)(l6.Fragment,{children:[e.title&&(0,l6.jsx)(be,{variant:"body2",sx:{color:"text.primary",fontWeight:500,overflowWrap:"anywhere"},children:e.title}),(0,l6.jsx)(be,{variant:e.title?"caption":"body2",sx:{color:e.title?"text.secondary":"text.primary",overflowWrap:"anywhere"},children:VRt(e)})]})}var Df=S(_(),1);function a6n({onResume:e}){return(0,Df.jsx)(Mt,{size:"small",onClick:t=>{t.stopPropagation(),e()},title:"Resume",sx:{color:"text.disabled","&:hover":{color:"text.primary"}},children:(0,Df.jsx)(Z0,{sx:{fontSize:14}})})}function qRt({session:e,selected:t=!1,onView:r,onResume:n}){return(0,Df.jsx)(Sc.Provider,{value:e.node,children:(0,Df.jsx)(Vt,{onClick:()=>r(e),sx:Phe(t),"aria-current":t||void 0,children:(0,Df.jsxs)(H,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[(0,Df.jsxs)(H,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,Df.jsx)($Rt,{session:e}),(0,Df.jsx)(H,{sx:{flex:1}}),(0,Df.jsx)(ca,{children:(0,Df.jsx)(a6n,{onResume:()=>n(e)})})]}),(0,Df.jsx)(GRt,{session:e}),e.snippet&&(0,Df.jsx)(WRt,{snippet:e.snippet}),(0,Df.jsx)(HRt,{session:e})]})})})}var jhe=S(_(),1);function qhe({sessions:e,viewingId:t,onView:r,onResume:n,empty:o}){return(0,jhe.jsxs)(H,{sx:{flex:1,overflow:"auto",p:1},children:[e.map(i=>(0,jhe.jsx)(qRt,{session:i,selected:i.sessionId===t,onView:r,onResume:n},i.sessionId)),e.length===0&&o]})}var jRt=S(_(),1);function TB({children:e,color:t="text.disabled"}){return(0,jRt.jsx)(be,{variant:"caption",color:t,role:"status",sx:{display:"block",textAlign:"center",p:2},children:e})}var wB=S(_(),1);function YRt({search:e,viewingId:t,...r}){return e.status==="loading"?(0,wB.jsx)(TB,{children:"Searching\u2026"}):e.status==="error"?(0,wB.jsxs)(TB,{color:"error.main",children:["Search failed: ",e.message]}):(0,wB.jsx)(qhe,{sessions:e.sessions,viewingId:t,empty:(0,wB.jsx)(TB,{children:"No sessions match"}),...r})}var Yhe=S(re(),1);async function KRt(e,t,r,n){let o=await Ut(Dr(`/api/history/search?cwd=${encodeURIComponent(e)}&q=${encodeURIComponent(t)}`,r),{signal:n}),i=await o.json().catch(()=>({}));if(!o.ok)throw new Error(i.error??`HTTP ${o.status}`);let a=Array.isArray(i.sessions)?i.sessions:[];return r?a.map(s=>({...s,node:r})):a}var s6n=300;function XRt(e,t,r){let n=r.trim(),[o,i]=(0,Yhe.useState)({status:"idle"});return(0,Yhe.useEffect)(()=>{if(!e||!n){i({status:"idle"});return}i({status:"loading"});let a=new AbortController,s=setTimeout(()=>{KRt(e,n,t,a.signal).then(l=>{a.signal.aborted||i({status:"done",sessions:l})},l=>{if(a.signal.aborted)return;let u=l instanceof Error?l.message:String(l);i({status:"error",message:u})})},s6n);return()=>{clearTimeout(s),a.abort()}},[e,t,n]),o}var Khe=S(re(),1),YQ=(0,Khe.createContext)({repos:[],selectedCwd:"",worktreeCwd:"",setSelectedCwd:()=>{},cloneOn:e=>e,originOf:()=>{}});function _n(){return(0,Khe.useContext)(YQ)}var c6=S(_(),1);function ZRt({sessions:e,...t}){let{selectedCwd:r,selectedNode:n}=_n(),{query:o,setQuery:i}=WQ(),a=XRt(r,n,o),s=vB(r,e),l=r?e.filter(u=>Q0(u)===s||Ul(u)===r):[];return(0,c6.jsxs)(H,{sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[r&&(0,c6.jsx)(lE,{value:o,onChange:i,placeholder:"Search history..."}),a.status==="idle"?(0,c6.jsx)(qhe,{sessions:l,empty:(0,c6.jsx)(TB,{children:"No history for this repo"}),...t}):(0,c6.jsx)(YRt,{search:a,...t,onView:u=>t.onView(u,o.trim())})]})}var b3t=S(re(),1);function QRt(e,t,r){if(e.length===0)return null;let n=t===null?-1:e.indexOf(t);return n===-1?r===1?e[0]:e.at(-1):e[(n+r+e.length)%e.length]}var mBe=null;function Xhe(e){mBe=e,e.focus({preventScroll:!0})}function fE(){let e=globalThis.document;return e.querySelector('[role="dialog"][aria-modal="true"]')?!0:mBe!==null&&e.activeElement===mBe}function Zhe(e){let t=globalThis.document.querySelector(`[data-session-id="${e}"]`);t&&Xhe(t)}function Qhe(e){globalThis.requestAnimationFrame(()=>{globalThis.document.querySelector(`[data-session-id="${e}"]`)?.scrollIntoView({block:"nearest"})})}function Jhe(e){return e.key==="Tab"&&!e.ctrlKey&&!e.altKey&&!e.metaKey}var u6=S(re(),1);var JRt="assist:group-collapse",gBe=new Set;function yBe(){try{return localStorage.getItem(JRt)??""}catch{return""}}function vBe(e){if(!e)return{};try{let t=JSON.parse(e);return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([,r])=>r&&typeof r=="object"))}catch{return{}}}function e3t(e){try{localStorage.setItem(JRt,JSON.stringify(e))}catch{}for(let t of gBe)t()}function l6n(e,t){e3t({...vBe(yBe()),[e]:t})}function c6n(e){let t=vBe(yBe()),r=Object.fromEntries(Object.entries(t).filter(([n])=>!e.includes(n)));Object.keys(r).length!==Object.keys(t).length&&e3t(r)}function u6n(e){return gBe.add(e),()=>{gBe.delete(e)}}var pT={getRaw:yBe,parse:vBe,setChoice:l6n,removeChoices:c6n,subscribe:u6n};function CB(){let e=(0,u6.useSyncExternalStore)(pT.subscribe,pT.getRaw),t=(0,u6.useMemo)(()=>pT.parse(e),[e]),r=(0,u6.useCallback)(n=>{let o=t[n];return o!==void 0&&"collapsedAt"in o},[t]);return(0,u6.useMemo)(()=>({isCollapsed:r,setCollapsed:(n,o)=>pT.setChoice(n,o?{collapsedAt:Date.now()}:{openedAt:Date.now()})}),[r])}var hT=S(re(),1);function d6n(e,t){let r=new URLSearchParams;e&&r.set("q",e),t&&t!=="todo"&&r.set("filter",t);let n=r.toString();return n?`/api/items?${n}`:"/api/items"}async function pE({query:e,cwd:t,node:r,signal:n,filter:o}={}){let i=await Ut(xc(d6n(e,o),t,r),{signal:n});if(!i.ok){let a=await i.json().catch(()=>null);throw new Error(a?.error??`HTTP ${i.status}`)}return i.json()}function KQ(e){let t=e.activity?.itemId;if(!(!e.cwd||e.activity?.kind!=="backlog"||t==null))return{cwd:e.cwd,itemId:t}}function XQ(e,t){return`${e}::${t}`}function t3t(e){let t=new Set;for(let r of e){let n=KQ(r);n&&t.add(n.cwd)}return[...t].sort()}async function f6n(e){try{return(await pE({cwd:e,filter:"all"})).filter(r=>r.starred).map(r=>XQ(e,r.id))}catch(t){return xr(t,"starred keys"),[]}}async function r3t(e){let t=await Promise.all(e.map(f6n));return new Set(t.flat())}var rme=S(re(),1);var n3t="/api/backlog/docs-refresh";async function eme(e,t,r){let n=await Ut(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok)throw new Error(`${t} ${e} failed: ${n.status}`);return n.json()}async function o3t(e,t,r){await Ut(xc(`/api/items/${hn(e)}`,t,r),{method:"DELETE"})}function kB(e,t,r,n){return eme(xc(`/api/items/${hn(e)}`,r,n),"PATCH",{status:t})}function tme(e,t,r,n){return eme(xc(`/api/items/${hn(e)}/star`,r,n),"POST",{starred:t})}function i3t(e,t,r,n,o){return eme(xc(`/api/items/${hn(e)}/rewind`,n,o),"POST",{phase:t,reason:r})}async function a3t(e,t,r){return(await Ut(xc(n3t,e,t),{signal:r})).json()}function s3t(e,t){return eme(xc(n3t,e,t),"POST",{})}function p6n(e,t,r){let n=new Set(e);return r?n.add(t):n.delete(t),n}function l3t(e,t){let r=KQ(t);return r?e.has(XQ(r.cwd,r.itemId)):t.starred??!1}function c3t(e,t,r){let n=KQ(r);if(!n){t(r.id,!(r.starred??!1));return}let o=XQ(n.cwd,n.itemId);e(i=>{let a=!i.has(o);return tme(n.itemId,a,n.cwd),p6n(i,o,a)})}function h6n(e,t){let r=!1,n=e?e.split("|"):[];return r3t(n).then(o=>{r||t(o)}),()=>{r=!0}}function u3t(e){let[t,r]=(0,rme.useState)(new Set);return(0,rme.useEffect)(()=>h6n(e,r),[e]),[t,r]}var f3t=S(_(),1),d3t=(0,hT.createContext)(null);function nme({sessions:e,setSessionStarred:t,children:r}){let n=t3t(e).join("|"),[o,i]=u3t(n),a=(0,hT.useCallback)(u=>l3t(o,u),[o]),s=(0,hT.useCallback)(u=>c3t(i,t,u),[i,t]),l=(0,hT.useMemo)(()=>({isStarred:a,toggleStar:s}),[a,s]);return(0,f3t.jsx)(d3t.Provider,{value:l,children:r})}function Jg(){let e=(0,hT.useContext)(d3t);if(!e)throw new Error("useStarredSessions must be used within a StarredSessionsProvider");return e}function ome(e){return e.flatMap(t=>t.kind==="single"?[t.session]:t.rows.flatMap(r=>[r.session,...r.children]))}var bBe="assist:group-order";var d6=null;function m6n(){if(d6)return d6;try{let e=JSON.parse(localStorage.getItem(bBe)??"[]");d6=Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}catch{d6=[]}return d6}function g6n(e){d6=e;try{localStorage.setItem(bBe,JSON.stringify(e))}catch{}}function y6n(e,t){let r=e.length-200;return r<=0?e:e.filter(n=>t.has(n)||r--<=0)}function v6n(e){let t=m6n(),r=e.filter(o=>!t.includes(o)),n=r.length>0?y6n([...t,...r],new Set(e)):t;return n!==t&&g6n(n),new Map(n.map((o,i)=>[o,i]))}function b6n(){d6=null;try{localStorage.removeItem(bBe)}catch{}}var p3t={rank:v6n,clear:b6n};function h3t(e){let t=new Map;for(let n of e){let o=Q0(n)??` nogroup:${n.id}`,i=t.get(o);if(i){i.members.push(n);continue}t.set(o,{key:o,label:Aa(Ul(n)??o),members:[n]})}let r=p3t.rank([...t.keys()]);return[...t.values()].sort((n,o)=>(r.get(n.key)??0)-(r.get(o.key)??0))}function m3t(e){let t=new Map(e.map(o=>[xBe(o,o.id),o])),r=x6n(e),n=new Map;for(let o of e){let i=S6n(o,t)??C6n(o,r);i&&n.set(o,i)}return n}function x6n(e){let t=new Map;for(let r of e){let n=y3t(r);!n||!g3t(r)||t.has(n)||t.set(n,r)}return t}function S6n(e,t){let r=e.launchedFrom?t.get(xBe(e,e.launchedFrom)):void 0;if(!(!r||r===e))return w6n(e,r)||T6n(e)?r:void 0}function T6n(e){let[t,r]=e.assistArgs??[];return t==="backlog"&&r==="run-phase"}function w6n(e,t){return e.cwd!==void 0&&e.cwd===t.cwd&&e.node===t.node}function C6n(e,t){if(g3t(e))return;let r=y3t(e),n=r?t.get(r):void 0;return n===e?void 0:n}function g3t(e){return e.activity?.kind==="backlog"}function y3t(e){let{cwd:t,repoGroup:r}=e;if(!(!t||!r||r.clone===t))return xBe(e,t)}function xBe(e,t){return JSON.stringify([e.node??null,t])}function ime(e){let t=m3t(e),r=new Map;for(let i of e){let a=k6n(i,t);a&&r.set(i,a)}let n=new Map,o=[];for(let i of e){if(r.has(i))continue;let a={session:i,children:[]};n.set(i,a),o.push(a)}for(let i of e){let a=r.get(i);a&&n.get(a)?.children.push(i)}return o}function k6n(e,t){let r=new Set([e]),n=t.get(e);for(;n;){if(r.has(n))return;let o=t.get(n);if(!o)return n;r.add(n),n=o}}function SBe(e,t){return[...e.filter(r=>t(r)),...e.filter(r=>!t(r))]}function ame(e,t,r=2){let n=h3t(e).map(({key:o,label:i,members:a})=>a.length<r?{kind:"single",session:a[0]}:{kind:"repo",key:o,label:i,rows:SBe(ime(a),s=>v3t(s).some(t))});return SBe(n,o=>_6n(o).some(t))}function v3t(e){return[e.session,...e.children]}function _6n(e){return e.kind==="repo"?e.rows.flatMap(v3t):[e.session]}var E6n=()=>!1;function sme(e,t,r=E6n,n=2){return ome(ame(e,t,n).filter(o=>o.kind==="single"||!r(o.key)))}function x3t({sessions:e,onSelect:t}){let{isStarred:r}=Jg(),{isCollapsed:n}=CB();return(0,b3t.useCallback)(o=>{if(!Jhe(o.nativeEvent))return;let i=o.target.closest("[data-session-id]");if(!i)return;let a=sme(e,r,n,1).map(u=>u.id),s=i.getAttribute("data-session-id"),l=QRt(a,s,o.shiftKey?-1:1);!l||l===s||(o.preventDefault(),t(l),Zhe(l),Qhe(l))},[e,r,n,t])}var TBe=S(_(),1),R6n={flex:1,overflow:"auto"},P6n={py:.5};function S3t({sessions:e,onSelect:t,children:r}){let n=x3t({sessions:e,onSelect:t});return(0,TBe.jsx)(H,{sx:R6n,onKeyDown:n,children:(0,TBe.jsx)(H,{sx:P6n,children:r})})}var w3t=S(_(),1),A6n={display:"block",textAlign:"center",p:2};function T3t(){return(0,w3t.jsx)(be,{variant:"caption",color:"text.disabled",sx:A6n,children:"No sessions yet"})}var C3t=S(_(),1),_o=ot((0,C3t.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var k3t=S(_(),1),_B=ot((0,k3t.jsx)("path",{d:"M12 7c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1s-1-.45-1-1V8c0-.55.45-1 1-1m-.01-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m1-3h-2v-2h2z"}),"ErrorOutlineRounded");var rb=S(_(),1),L6n={...Phe(!1),cursor:"default",position:"relative"},I6n={position:"absolute",top:4,right:4,color:"text.disabled","&:hover":{color:"text.primary"}},D6n={display:"flex",alignItems:"center",gap:1,pr:3},M6n={color:"text.primary",overflowWrap:"anywhere"};function N6n(e){return{display:"block",mt:.5,color:e?"error.main":"text.secondary",overflowWrap:"anywhere"}}function O6n(e){return e.node?`Starting session on ${e.node}\u2026`:"Starting session\u2026"}function _3t({launch:e,onDismiss:t}){let r=e.status==="error";return(0,rb.jsxs)(H,{sx:L6n,children:[(0,rb.jsx)(Mt,{size:"small",onClick:()=>t(e.id),title:"Dismiss",sx:I6n,children:(0,rb.jsx)(_o,{sx:{fontSize:16}})}),(0,rb.jsxs)(H,{sx:D6n,children:[r?(0,rb.jsx)(_B,{color:"error",sx:{fontSize:18}}):(0,rb.jsx)(io,{size:16}),(0,rb.jsx)(be,{variant:"body2",sx:M6n,children:e.title})]}),(0,rb.jsx)(be,{variant:"caption",sx:N6n(r),children:r?e.error:O6n(e)})]})}function E3t(e){return new Set(e.filter(t=>t.cwd&&t.cwd===t.repoGroup?.clone).map(t=>t.id))}function wBe(e){return e.commandType==="run"&&e.server===!0&&e.status!=="done"&&e.status!=="error"}function R3t(e){return e.filter(wBe)}var P3t=S(_(),1),lme=ot((0,P3t.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"Launch");var cme=S(re(),1),CBe=(0,cme.createContext)({nodes:null,names:[],visible:!1,selected:void 0,select:()=>{}});function ds(){return(0,cme.useContext)(CBe)}function B6n(e){return e?e.startsWith("/")?e:`/${e}`:""}function A3t(e,t,r,n="http",o){let i=t&&t!==r?.local?r?.links.find(s=>s.name===t):void 0,a=B6n(o);return i?{url:`${n}://${new URL(i.url).hostname}:${e}${a}`,remote:!0}:{url:`${n}://localhost:${e}${a}`,remote:!1}}var L3t=S(_(),1);function ume({port:e,node:t,protocol:r,urlPath:n}){let{nodes:o}=ds(),{url:i,remote:a}=A3t(e,t,o,r,n);return(0,L3t.jsxs)(Ur,{href:i,title:a?`Opens ${i} on ${t}; the dev server must listen on the tailnet (e.g. --host 0.0.0.0)`:i,target:"_blank",rel:"noopener noreferrer",color:"inherit",onMouseDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),children:[":",e]})}var nb=S(_(),1),$6n={display:"flex",alignItems:"center",gap:.5,px:"10px",py:.25,borderRadius:0,borderLeft:2,borderLeftColor:"success.main",bgcolor:"success.dark"},F6n={flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"success.contrastText"};function I3t({serving:e,onJump:t}){let r=Aa(e.cwd),n=r?` \xB7 ${r} \xB7 ${e.name}`:` \xB7 ${e.name}`,o=`${e.port?`serving :${e.port}`:"serving"}${n}`;return(0,nb.jsxs)(H,{sx:$6n,children:[(0,nb.jsxs)(be,{variant:"caption",title:o,sx:F6n,children:["serving",e.port?(0,nb.jsxs)(nb.Fragment,{children:[" ",(0,nb.jsx)(ume,{port:e.port,node:e.node,protocol:e.protocol,urlPath:e.urlPath})]}):null,n]}),(0,nb.jsx)(nt,{size:"small",startIcon:(0,nb.jsx)(lme,{sx:{fontSize:14}}),onClick:i=>{i.stopPropagation(),t()},sx:{color:"success.contrastText",minWidth:0},children:"Jump"})]})}var ZQ=S(_(),1);function D3t({sessions:e,onJump:t}){let r=R3t(e);return r.length===0?null:(0,ZQ.jsx)(ZQ.Fragment,{children:r.map(n=>(0,ZQ.jsx)(I3t,{serving:n,onJump:()=>t(n.id)},n.id))})}function M3t(e){return e.flatMap(t=>[t.session,...t.children])}var QQ=S(_(),1),z6n={position:"relative","&::before":{content:'""',position:"absolute",left:0,top:"-1px",width:"6px",height:"19.5px",borderLeft:1,borderBottom:1,borderColor:"divider"},"&:not(:last-of-type)::after":{content:'""',position:"absolute",left:0,top:0,bottom:"-1px",borderLeft:1,borderColor:"divider"}},H6n={ml:"13px"};function N3t({rows:e,renderCard:t}){let r=(n,o,i=!0)=>(0,QQ.jsx)(H,{sx:i?z6n:void 0,children:t(n,o)},n.id);return e.map(n=>n.children.length===0?r(n.session,void 0,!1):(0,QQ.jsxs)(H,{children:[r(n.session,n.children,!1),(0,QQ.jsx)(H,{sx:H6n,children:n.children.map(o=>r(o))})]},n.session.id))}var mT=S(_(),1);function Fo({onConfirm:e,onCancel:t,title:r="Confirm deletion",message:n="Are you sure you want to delete this item?",confirmLabel:o="Delete",confirmColor:i="error",busy:a=!1,autoFocusConfirm:s=!1}){return(0,mT.jsxs)(Ra,{open:!0,onClose:a?void 0:t,maxWidth:"xs",fullWidth:!0,children:[(0,mT.jsx)(Bl,{children:r}),(0,mT.jsx)(Ol,{children:(0,mT.jsx)(T_,{children:n})}),(0,mT.jsxs)(Qc,{children:[(0,mT.jsx)(nt,{onClick:t,disabled:a,children:"Cancel"}),(0,mT.jsx)(nt,{variant:"contained",color:i,onClick:e,loading:a,autoFocus:s,children:o})]})]})}var O3t=S(re(),1),U6n="(Shift skips confirmation)";function fs(e,{needsConfirm:t=!0,onOpen:r}={}){let[n,o]=(0,O3t.useState)(!1),i=r??(()=>o(!0));return{confirming:n,close:()=>o(!1),triggerHandlers:{onClick:a=>{a.stopPropagation(),a.shiftKey||!t?e():i()},onKeyDown:a=>{a.key!=="Enter"||!a.shiftKey||(a.preventDefault(),a.stopPropagation(),e())}},withHint:a=>`${a} ${U6n}`}}var gT=S(_(),1),kBe="group-close",W6n={p:"2px",my:"-2px",opacity:0,color:"text.disabled","&:hover":{color:"text.primary"},"&:focus-visible":{opacity:1}};function B3t({label:e,sessionIds:t,onDismiss:r}){let n=()=>{for(let d of t)r(d)},{confirming:o,close:i,triggerHandlers:a,withHint:s}=fs(n),l=t.length,u=l===1?"session":"sessions";return(0,gT.jsxs)(gT.Fragment,{children:[(0,gT.jsx)(Mt,{size:"small",className:kBe,...a,title:s(`Close all sessions in ${e}`),sx:W6n,children:(0,gT.jsx)(_o,{sx:{fontSize:14}})}),o&&(0,gT.jsx)(ca,{children:(0,gT.jsx)(Fo,{title:`Close ${e}`,message:`This will close all ${l} ${u} in ${e}, including starred and nested sessions. Running sessions will be stopped.`,confirmLabel:`Close ${l}`,onConfirm:()=>{i(),n()},onCancel:i})})]})}var V6n=new Set(["question","backlog-item","github-issue","github-issue-edit","github-issue-comment","pr-comment"]);function Qi(e){let t=e.pendingPrPreview;return t&&t.kind!=="show"&&(e.status==="running"||e.status==="waiting")?V6n.has(t.kind)?"question":t.kind==="design"?"design":t.kind==="check"?"check":"waiting":e.status}var G6n=["check","waiting","running","done"];function q6n(e){return e==="question"||e==="design"?"waiting":e}function $3t(e){return G6n.map(t=>({status:t,count:e.filter(r=>q6n(Qi(r))===t).length})).filter(t=>t.count>0)}var F3t={claude:{red:30,yellow:20},"claude-sdk":{red:30,yellow:20},codex:{red:75,yellow:50},pi:{red:30,yellow:20}};function z3t(e,t){let{red:r,yellow:n}=F3t[jd(t)]??F3t.claude;return e>=r?"red":e>=n?"yellow":"dim"}var Zu={running:"success.main",idle:"text.disabled",waiting:"warning.main",question:"warning.main",design:"warning.main",check:"warning.main",done:"info.main",error:"error.main",stopped:"text.secondary"};function dme(e,t){switch(z3t(e,t)){case"red":return"error.main";case"yellow":return"warning.main";default:return"text.disabled"}}var H3t={d:"M0.25 8C4.13 1.5 11.88 1.5 15.75 8C11.88 14.5 4.13 14.5 0.25 8ZM8 4.7A3.3 3.3 0 1 0 8 11.3A3.3 3.3 0 1 0 8 4.7ZM8 6.5A1.5 1.5 0 1 0 8 9.5A1.5 1.5 0 1 0 8 6.5Z",transform:"translate(8 8) scale(0.88) translate(-8 -8)",fillRule:"evenodd"};var _Be=S(_(),1),j6n={fontSize:"inherit",verticalAlign:"-0.125em"};function EBe({path:e,testId:t}){return(0,_Be.jsx)(B1,{viewBox:"0 0 16 16",sx:j6n,"data-testid":t,children:(0,_Be.jsx)("path",{...e})})}var U3t={d:"M-1.62 -3.93A4.25 4.25 0 0 0 -1.62 3.93V6.93H1.62V3.93A4.25 4.25 0 0 0 1.62 -3.93V0.25H-1.62Z",transform:"translate(8 8) scale(1.46) translate(0.9 -0.9) rotate(45)"};var hE={running:"\u25CF",idle:"\u25CF",waiting:"\u25C6",question:"?",done:"\u2713",error:"\u2715",stopped:"\u25CB"};var RBe=S(_(),1);function ob({status:e}){return e==="check"?(0,RBe.jsx)(EBe,{path:U3t,testId:"wrench-head"}):e==="design"?(0,RBe.jsx)(EBe,{path:H3t,testId:"eye"}):hE[e]}var EB=S(_(),1),Y6n={display:"flex",gap:1,flexShrink:0,color:"text.secondary",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"};function W3t({sessions:e}){return(0,EB.jsx)(H,{sx:Y6n,children:$3t(e).map(({status:t,count:r})=>(0,EB.jsxs)(be,{variant:"caption","data-tally":t,children:[(0,EB.jsx)(H,{component:"span",sx:{color:Zu[t]},children:(0,EB.jsx)(ob,{status:t})})," ",r," ",t]},t))})}var V3t=S(_(),1),zo=ot((0,V3t.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");var G3t=S(_(),1),La=ot((0,G3t.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var j3t=S(_(),1),K6n={fontSize:12,color:"text.secondary",flexShrink:0};function q3t({collapsed:e}){return(0,j3t.jsx)(e?zo:La,{sx:K6n})}var Y3t=S(_(),1),K3t=ot((0,Y3t.jsx)("path",{d:"M14 4v5c0 1.12.37 2.16 1 3H9c.65-.86 1-1.9 1-3V4zm3-2H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3V4h1c.55 0 1-.45 1-1s-.45-1-1-1"}),"PushPinOutlined");var mE=S(_(),1),X6n={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:600,lineHeight:"16px",letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},Z6n={fontSize:14,color:"text.disabled",flexShrink:0};function X3t({label:e,pinned:t}){return(0,mE.jsxs)(mE.Fragment,{children:[(0,mE.jsx)(be,{variant:"body1",title:e,sx:X6n,children:e}),t&&(0,mE.jsx)(lr,{title:"Collapsed by you. Stays collapsed until you open it.",children:(0,mE.jsx)(K3t,{"data-testid":"group-pinned","aria-label":"Collapsed by you",sx:Z6n})})]})}var PBe={toggle:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.75,justifyContent:"flex-start",textAlign:"left",borderRadius:.5,"&:focus-visible":{outline:1,outlineColor:"primary.main"}},count:{color:"text.disabled",fontVariantNumeric:"tabular-nums",fontFamily:"fontFamilyMono",fontSize:11,lineHeight:1}};var RB=S(_(),1);function Z3t({label:e,count:t,collapsedSummary:r,collapsed:n,pinned:o,onToggle:i}){return(0,RB.jsxs)(Vt,{"aria-expanded":!n,onClick:i,sx:PBe.toggle,children:[(0,RB.jsx)(q3t,{collapsed:n}),(0,RB.jsx)(X3t,{label:e,pinned:o}),n?r:(0,RB.jsx)(be,{variant:"caption",sx:PBe.count,children:t})]})}var PB=S(_(),1),Q6n={display:"flex",alignItems:"center",gap:.75,p:"8px 12px 4px",bgcolor:"background.paper",position:"sticky",top:0,zIndex:1,[`&:hover .${kBe}`]:{opacity:1}};function Q3t({label:e,sessions:t,collapsed:r,pinned:n,onToggle:o,onDismiss:i}){return(0,PB.jsxs)(H,{sx:Q6n,children:[(0,PB.jsx)(Z3t,{label:e,count:t.length,collapsedSummary:(0,PB.jsx)(W3t,{sessions:t}),collapsed:r,pinned:n,onToggle:o}),(0,PB.jsx)(B3t,{label:e,sessionIds:t.map(a=>a.id),onDismiss:i})]})}var fme=S(re(),1),ABe=(0,fme.createContext)(!1);function J3t(){return(0,fme.useContext)(ABe)}var JQ=S(_(),1),J6n={mb:.5};function ePt({groupKey:e,label:t,sessions:r,onDismiss:n,children:o}){let{isCollapsed:i,setCollapsed:a}=CB(),s=i(e);return(0,JQ.jsxs)(H,{sx:J6n,children:[(0,JQ.jsx)(Q3t,{label:t,sessions:r,collapsed:s,pinned:s,onToggle:()=>a(e,!s),onDismiss:n}),!s&&(0,JQ.jsx)(ABe.Provider,{value:!0,children:o})]})}function pme(e,t,r){if(t.length===0)return;let n=()=>{for(let o of t)r(o.id)};return{childCount:t.length,onDismissAll:()=>{r(e.id),n()},onDismissChildren:n}}function hme(e,t){return e.sdk?!1:!t.has(e.id)&&e.status!=="done"&&e.status!=="error"&&e.status!=="stopped"}function gE(e){let t=e.claudeSessionId??e.harnessSessionId;if(t)return e.harness?{conversationId:t,harness:e.harness}:{conversationId:t}}var yT="branch";function tPt(e,t){return[{value:"all",label:"All changes"},{value:"uncommitted",label:"Uncommitted"},...t?[{value:yT,label:"Branch",note:`vs ${t}`}]:[],...e.map(r=>({value:r.sha,label:r.title||r.sha.slice(0,7)}))]}function rPt(e,t){return e.find(r=>r.value===t)??{value:"all",label:"All changes"}}var mme=S(re(),1);var yE=S(re(),1);function nPt(e,t,r){let n=e[t];return n&&n.cwd===r.cwd&&n.scope===r.scope?LBe(e,t):{...e,[t]:{...r,mode:n?.mode??"half"}}}function LBe(e,t){let{[t]:r,...n}=e;return r?n:e}function oPt(e,t){let r=new Set(t),n=Object.entries(e).filter(([o])=>r.has(o));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function iPt(e,t,r){let n=e[t];return n?{...e,[t]:{...n,scope:r}}:e}function aPt(e,t){let r=e[t];if(!r)return e;let n=r.mode==="half"?"full":"half";return{...e,[t]:{...r,mode:n}}}function sPt(e,t){let[r,n]=(0,yE.useState)({}),o=e.join(" ");(0,yE.useEffect)(()=>{let a=o===""?[]:o.split(" ");n(s=>oPt(s,a))},[o]);let i=(0,yE.useCallback)((a,s)=>{t(a),n(l=>nPt(l,a,s))},[t]);return(0,yE.useMemo)(()=>({panelFor:a=>a===null?void 0:r[a],togglePanel:i,closePanel:a=>n(s=>LBe(s,a)),setPanelScope:(a,s)=>n(l=>iPt(l,a,s)),togglePanelMode:a=>n(s=>aPt(s,a))}),[r,i])}var uPt=S(_(),1),lPt=(0,mme.createContext)(null);function cPt({sessionIds:e,onActivateSession:t,children:r}){let n=sPt(e,t);return(0,uPt.jsx)(lPt.Provider,{value:n,children:r})}function ib(){let e=(0,mme.useContext)(lPt);if(!e)throw new Error("useDiffPanels must be used within a DiffPanelsProvider");return e}function gme(e,t,r){let{togglePanel:n}=ib(),o=ur();return i=>n(e,{cwd:t,conversation:r,scope:i,node:o})}var fPt=S(_(),1);function dPt({panelSessionId:e,cwd:t,conversation:r,defaultBranch:n}){let o=gme(e,t,r),i=`Diff against ${n}`;return(0,fPt.jsxs)(Ur,{component:"button",type:"button",title:i,"aria-label":i,onClick:()=>o(yT),variant:"caption",underline:"hover",color:"inherit",sx:{border:0,p:0,bgcolor:"transparent",cursor:"pointer",fontFamily:"fontFamilyMono",whiteSpace:"nowrap",color:"text.disabled","&:hover":{color:"text.primary"}},children:["vs ",n]})}function AB(){return/Mac|iPhone|iPad/.test(globalThis.navigator?.platform??"")}var eLn={Ctrl:"\u2303",Alt:"\u2325",Shift:"\u21E7",Mod:"\u2318",Meta:"\u2318"},tLn={Mod:"Ctrl"};function pPt(e,t=AB()){let r=t?eLn:tLn;return e.map(n=>r[n]??n)}function yme(e,t=AB()){return pPt(e,t).join(t?"":"+")}var hPt=S(_(),1),rLn={px:.5,border:1,borderColor:"grey.500",borderRadius:.5,fontFamily:"fontFamilyMono",fontSize:11,whiteSpace:"nowrap"};function vme({chords:e}){return e.map(t=>{let r=yme(t);return(0,hPt.jsx)(H,{component:"kbd",sx:rLn,children:r},r)})}var eJ=S(_(),1);function Yd({label:e,chords:t}){return(0,eJ.jsxs)(St,{direction:"row",spacing:.75,sx:{alignItems:"center"},children:[(0,eJ.jsx)("span",{children:e}),(0,eJ.jsx)(vme,{chords:t})]})}var nLn={"/":"Slash",".":"Period",",":"Comma",";":"Semicolon","'":"Quote","[":"BracketLeft","]":"BracketRight","\\":"Backslash","-":"Minus","=":"Equal","`":"Backquote"},oLn=["Enter","Space","Escape","Backspace","Delete","Insert","Home","End","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];function mPt(e){if(/^[a-z]$/i.test(e)){let n=e.toUpperCase();return{code:`Key${n}`,label:n}}if(/^\d$/.test(e))return{code:`Digit${e}`,label:e};let t=nLn[e];if(t)return{code:t,label:e};if(/^F([1-9]|1[0-2])$/i.test(e)){let n=e.toUpperCase();return{code:n,label:n}}let r=oLn.find(n=>n.toLowerCase()===e.toLowerCase());return r?{code:r,label:r}:void 0}var iLn={mod:"Mod",ctrl:"Ctrl",control:"Ctrl",alt:"Alt",option:"Alt",opt:"Alt",shift:"Shift",meta:"Meta",cmd:"Meta",command:"Meta",win:"Meta"},aLn=["Mod","Ctrl","Alt","Shift","Meta"];function gPt(e,t){let r=new Set;for(let n of e){let o=iLn[n.toLowerCase()];if(!o)return{ok:!1,error:`"${n}" is not a modifier in "${t}"`};if(r.has(o))return{ok:!1,error:`"${n}" is repeated in "${t}"`};r.add(o)}return[...r].some(n=>n!=="Shift")?r.has("Mod")&&(r.has("Ctrl")||r.has("Meta"))?{ok:!1,error:`"${t}" combines Mod with Ctrl or Meta, which Mod already means`}:{ok:!0,modifiers:aLn.filter(n=>r.has(n))}:{ok:!1,error:`"${t}" needs at least one of Mod, Ctrl, Alt or Meta`}}function yPt(e,{modifiersOnly:t=!1}={}){let r=e.split("+").map(s=>s.trim()),n=t?void 0:r.pop(),o=gPt(r,e);if(!o.ok)return o;let{modifiers:i}=o;if(n===void 0)return{ok:!0,chord:{modifiers:i}};let a=mPt(n);return a?{ok:!0,chord:{modifiers:i,key:a}}:{ok:!1,error:`"${n}" is not a key in "${e}"`}}function bme({modifiers:e,key:t},r,n=AB()){if(r.type!=="keydown"||t&&r.code!==t.code)return!1;let o=e.includes("Mod");return r.ctrlKey===(e.includes("Ctrl")||o&&!n)&&r.metaKey===(e.includes("Meta")||o&&n)&&r.altKey===e.includes("Alt")&&r.shiftKey===e.includes("Shift")}var sLn=/^Digit([1-6])$/;function tJ(e,t){if(!t.some(n=>bme(n,e)))return;let r=sLn.exec(e.code);return r?Number(r[1])-1:void 0}var LB={navTab:{label:"Switch top-level tab",group:"Navigate"},focusSidebar:{label:"Focus sidebar (backlog: last-selected session card)",group:"Navigate"},focusTerminal:{label:"Focus terminal (backlog: search / back)",group:"Navigate"},toggleDiff:{label:"Open / close diff panel, or focus preview pane",group:"Navigate"},focusRepoPicker:{label:"Focus repo picker",group:"Navigate"},openUpdates:{label:"Open nodes",group:"Navigate"},openConfig:{label:"Open config",group:"Navigate"},openMenu:{label:"Open menu",group:"Navigate"},cycleCards:{label:"Next / previous sidebar card",group:"Navigate"},nextWaiting:{label:"Next waiting session",group:"Sessions"},focusAddAgent:{label:"Focus add agent",group:"Sessions"},focusVsCode:{label:"Focus VS Code",group:"Sessions"},focusDone:{label:"Focus done",group:"Sessions"},newSession:{label:"New session",group:"Sessions"},quickOpen:{label:"Quick open file",group:"Files"},save:{label:"Save file",group:"Files"},shortcutsSheet:{label:"Keyboard shortcuts",group:"Help"}};var lLn="1\u20136",vPt=new WeakMap;function vE(e,t){let r=vPt.get(t);r||(r=new Map,vPt.set(t,r));let n=r.get(e);return n||(n=cLn(e,t),r.set(e,n)),n}function cLn(e,t){let{label:r,group:n}=LB[e];if(e==="cycleCards")return{label:r,group:n,chords:[["Tab"],["Shift","Tab"]],bound:[],matches:Jhe};let o=e==="navTab",i=t[e].flatMap(a=>{let s=yPt(a,{modifiersOnly:o});return s.ok?[s.chord]:[]});return{label:r,group:n,chords:i.map(a=>uLn(a)),bound:i,matches:o?a=>tJ(a,i)!==void 0:a=>i.some(s=>bme(s,a))}}function uLn({modifiers:e,key:t}){return[...e,t?.label??lLn]}var SPt=S(re(),1);var bPt={navTab:["Alt"],focusSidebar:["Alt+A"],focusTerminal:["Alt+S"],toggleDiff:["Alt+D"],focusRepoPicker:["Alt+R"],openUpdates:["Alt+Q"],openConfig:["Alt+W"],openMenu:["Alt+E"],focusAddAgent:["Alt+Z"],focusVsCode:["Alt+X"],focusDone:["Alt+C"],nextWaiting:["Mod+."],newSession:["Mod+N","Alt+N"],quickOpen:["Mod+P"],save:["Mod+S"],shortcutsSheet:["Mod+/"]};var xPt=bPt,IBe=new Set,f6={get:()=>xPt,set(e){xPt=e;for(let t of IBe)t()},subscribe(e){return IBe.add(e),()=>IBe.delete(e)}};function IB(){return(0,SPt.useSyncExternalStore)(f6.subscribe,f6.get)}function vo(e){return vE(e,IB())}var DBe=S(_(),1);function TPt({show:e,children:t}){let{label:r,chords:n}=vo("toggleDiff");return(0,DBe.jsx)(lr,{describeChild:!0,title:e?(0,DBe.jsx)(Yd,{label:r,chords:n}):"",children:t})}function wPt(e){return t=>({px:1,py:"3px",border:1,borderRadius:`${t.tokens.radius.sm}px`,borderColor:e?Or(t.palette.primary.main,.55):"divider",bgcolor:e?t.tokens.color.selected:"background.default",fontSize:11,textDecoration:"none",transition:"border-color .2s ease, background-color .2s ease","&:hover":{textDecoration:"none",borderColor:e?Or(t.palette.primary.main,.55):t.palette.text.disabled}})}function CPt(e,t,r){let n=ib().panelFor(e);if(!r)return;let o=n!==void 0&&(t==="uncommitted"?n.scope===t:n.scope!=="uncommitted");return{pressed:o,sx:wPt(o)}}var _Pt=S(_(),1);function kPt({groups:e}){return e.map(t=>(0,_Pt.jsxs)(H,{component:"span",sx:{color:t.color},children:[t.prefix,t.count]},t.key))}var p6=S(_(),1),dLn={display:"flex",alignItems:"center",gap:.75,fontFamily:"fontFamilyMono",whiteSpace:"nowrap",border:0,p:0,bgcolor:"transparent",cursor:"pointer"};function MBe({panelSessionId:e,cwd:t,conversation:r,scope:n,groups:o,bracketed:i,toggleChordHint:a=!1,countButton:s=!1}){let l=gme(e,t,r),u=CPt(e,n,s);return(0,p6.jsx)(TPt,{show:a,children:(0,p6.jsxs)(Ur,{component:"button",type:"button",onClick:()=>l(n),variant:"caption",underline:u?"none":"hover",color:"inherit","aria-pressed":u?.pressed,sx:[dLn,u?.sx??{}],children:[i&&(0,p6.jsx)(H,{component:"span",children:"("}),(0,p6.jsx)(kPt,{groups:o}),i&&(0,p6.jsx)(H,{component:"span",children:")"})]})})}var DB=S(_(),1),fLn={display:"flex",alignItems:"center",gap:.75,minWidth:0},EPt=[{key:"new",prefix:"+",color:"success.main"},{key:"modified",prefix:"~",color:"warning.main"},{key:"deleted",prefix:"-",color:"error.main"}];function RPt({panelSessionId:e,cwd:t,conversation:r,groups:n,uncommitted:o,toggleChordHint:i,countButton:a}){return(0,DB.jsx)(ca,{children:(0,DB.jsxs)(H,{sx:fLn,"data-testid":"git-status-counts",children:[n.length>0&&(0,DB.jsx)(MBe,{panelSessionId:e,cwd:t,conversation:r,scope:"all",groups:n,toggleChordHint:i,countButton:a}),o&&o.length>0&&(0,DB.jsx)(MBe,{panelSessionId:e,cwd:t,conversation:r,scope:"uncommitted",groups:o,bracketed:!0,countButton:a})]})})}function PPt(e){return EPt.map(t=>({...t,count:e[t.key]?.length??0})).filter(t=>t.count>0)}function APt(e){if(!e)return null;let t=PPt(e),r=e.hasCommits&&e.uncommitted?PPt(e.uncommitted):void 0;return t.length>0||(r?.length??0)>0?{kind:"counts",groups:t,uncommitted:r}:e.defaultBranch&&e.onDefaultBranch===!1?{kind:"branch",defaultBranch:e.defaultBranch}:null}var bE=S(re(),1);function MB(e,t,r){let n=new URLSearchParams({cwd:e});return t&&(n.set("session",t.conversationId),t.harness&&n.set("harness",t.harness)),r&&r!=="all"&&n.set("scope",r),n.toString()}var pLn=new Set([502,504]);function LPt(){let e=!1;return{shouldRecord:t=>pLn.has(t)?e?!0:(e=!0,!1):(e=!1,!0),reset:()=>{e=!1}}}function IPt(e){let t=2**Math.max(0,e-1);return Math.min(5e3*t,6e4)}function xme(e){let t=new AbortController,r=!1,n=0,o,i=async()=>{if(r||t.signal.aborted)return;r=!0,clearTimeout(o);let a=await e(t.signal);r=!1,!t.signal.aborted&&(n=a?.failed?n+1:0,o=setTimeout(i,IPt(n)))};return i(),{poll:i,stop:()=>{t.abort(),clearTimeout(o)}}}async function DPt(e,t,r){try{let n=await Ut(e,{blipGate:t,signal:r});return n.ok?await n.json().then(o=>({counts:o??null}),()=>{}):{counts:null,failed:!0}}catch(n){return r?.aborted?void 0:(xr(n,"git status counts"),{counts:null,failed:!0})}}function MPt(e,t){let r=LPt();return xme(async n=>{let o=await DPt(e,r,n);return o&&t(o.counts),o&&{failed:!!o.failed}})}function Sme(e,t,r=!0){let[n,o]=(0,bE.useState)(null),i=(0,bE.useRef)(()=>{}),a=ur(),s=MB(e,t);return(0,bE.useEffect)(()=>{if(i.current=()=>{},!e||!r){o(null);return}let l=MPt(Dr(`/api/git-status?${s}`,a),o);return i.current=l.poll,l.stop},[e,s,a,r]),{counts:n,refresh:(0,bE.useCallback)(()=>i.current(),[])}}function NPt(e,t){return Sme(e,t).counts}var NBe=S(_(),1);function Tme({panelSessionId:e,cwd:t,conversation:r,offerBranchDiff:n=!1,toggleChordHint:o=!1,countButton:i=!1}){let a=APt(NPt(t,r));return a?a.kind==="branch"?n?(0,NBe.jsx)(dPt,{panelSessionId:e,cwd:t,conversation:r,defaultBranch:a.defaultBranch}):null:(0,NBe.jsx)(RPt,{panelSessionId:e,cwd:t,conversation:r,groups:a.groups,uncommitted:a.uncommitted,toggleChordHint:o,countButton:i}):null}var xE=S(_(),1);function OPt({restored:e,usedPct:t,harness:r,undurable:n}){return(0,xE.jsxs)(xE.Fragment,{children:[n&&(0,xE.jsx)(be,{variant:"caption",sx:{color:"warning.main"},children:n.reason}),e!==void 0&&(0,xE.jsx)(be,{variant:"caption",sx:{color:e?"success.main":"warning.main"},children:e?"restored":"not restored"}),t!==void 0&&(0,xE.jsxs)(be,{variant:"caption",sx:{color:dme(t,r),opacity:.6,fontSize:"0.8rem"},children:[Math.round(t),"%"]})]})}var rJ=S(_(),1),hLn={gridColumn:3,gridRow:2,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.75,minWidth:0};function BPt({session:e}){return(0,rJ.jsxs)(H,{sx:hLn,children:[(0,rJ.jsx)(OPt,{usedPct:e.usedPct,harness:e.harness,undurable:e.undurable}),e.cwd&&(0,rJ.jsx)(Tme,{panelSessionId:e.id,cwd:e.cwd,conversation:gE(e)})]})}function wme(e,t){if(t)return!0;let r=e.commandType==="assist"&&e.activity===void 0,n=e.status==="done"||e.status==="error";return r&&!n}var OBe=S(_(),1),mLn=Go("neutral");function $Pt({clone:e}){return(0,OBe.jsx)(lr,{title:`Clone \u2014 ${e}`,children:(0,OBe.jsx)(H,{component:"span",sx:mLn,children:"clone"})})}var Cme=[Go("primary"),e=>({bgcolor:e.palette.primary.main,borderColor:e.palette.primary.main,color:e.palette.primary.contrastText})];var BBe=S(_(),1),gLn=Go("success");function FPt({session:e}){return wBe(e)?(0,BBe.jsx)(H,{component:"span",sx:gLn,children:e.port?(0,BBe.jsx)(ume,{port:e.port,node:e.node,protocol:e.protocol,urlPath:e.urlPath}):"serving"}):null}var kme=S(re(),1),$Be=(0,kme.createContext)(new Set);function zPt(){return(0,kme.useContext)($Be)}var ey=S(_(),1),yLn=Go("check");function vLn({label:e}){return(0,ey.jsx)(H,{component:"span",sx:Cme,children:e})}function HPt({session:e}){let t=zPt().has(e.id),r=e.repoGroup?.clone,{activity:n}=e,o=n?.kind==="backlog"&&n.phase===n.totalPhases;return(0,ey.jsxs)(ey.Fragment,{children:[Qi(e)==="check"&&(0,ey.jsx)(H,{component:"span",sx:yLn,children:"Check"}),(0,ey.jsx)(FPt,{session:e}),(0,ey.jsx)(Bhe,{harness:e.harness}),t&&r&&(0,ey.jsx)($Pt,{clone:r}),(0,ey.jsx)(Whe,{node:e.node}),o&&(0,ey.jsx)(vLn,{label:`${n.phase}/${n.totalPhases}`})]})}var QPt=S(re(),1);function _me(e){return e?.itemIds?.length?e.itemIds:e?.itemId==null?[]:[e.itemId]}var WPt=S(_(),1),bLn=Go("primary");function UPt({itemId:e,session:t}){let r=ur();return(0,WPt.jsx)(Ur,{component:wa,to:qd(e,Ul(t),r),underline:"hover",sx:bLn,onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:hn(e)})}var FBe=S(_(),1),VPt=Go("secondary");function GPt({prNumber:e,url:t}){let r=`#${e}`;return t?(0,FBe.jsx)(Ur,{href:t,target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:VPt,onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:r}):(0,FBe.jsx)(H,{component:"span",sx:VPt,children:r})}var jPt=S(_(),1),xLn={color:"text.secondary",whiteSpace:"nowrap"};function qPt(e,t){let r=yB(t)?Aa(e):"";if(r)return{key:"repo",node:(0,jPt.jsx)(H,{component:"span",sx:xLn,children:r})}}function YPt(e,t){return!e?.jiraKey&&e?.githubIssue?.toLowerCase()===t.toLowerCase()}var XPt=S(_(),1);function KPt(e,t){if(!(!e||YPt(t,e)))return{key:"prompt-issue",node:(0,XPt.jsx)(cE,{githubIssue:e,variant:"token"})}}function SE(e){if(e.activity?.kind==="backlog")return"next";if(e.design)return"design";switch(e.commandType){case"assist":{let t=e.assistArgs?.[0];return t==="review-pr-comments"||t==="fix-conflict"?"review":t==="draft"||t==="bug"||t==="next"||t==="refine"||t==="review"||t==="update"?t:"prompt"}case"run":return"run";default:return e.promptType??"prompt"}}var Eme=S(_(),1);function ZPt(e,t,r,n){let o=[],i=SE(e),a=t?void 0:qPt(e.cwd,i),{activity:s}=e;a&&o.push(a),s?.kind==="backlog"?s.phase!==s.totalPhases&&o.push({key:"phase",node:`${s.phase}/${s.totalPhases}`}):o.push({key:"type",node:i}),r.number!==void 0&&o.push({key:"pr",badge:!0,node:(0,Eme.jsx)(GPt,{prNumber:r.number,url:r.url})});for(let u of _me(s))o.push({key:`item-${u}`,badge:!0,node:(0,Eme.jsx)(UPt,{itemId:u,session:e})});n&&o.push({key:"tracker",node:(0,Eme.jsx)(Mhe,{tracker:n,variant:"token"})});let l=KPt(e.promptIssue,n);return l&&o.push(l),o}var SLn=["review","review-pr-comments","fix-conflict"];function ab(e){let t=e.assistArgs?.[0];if(!t||!SLn.includes(t))return;let r=e.assistArgs?.slice(1).map(o=>Number(o)).find(o=>Number.isInteger(o)&&o>0);if(r!==void 0)return r;let n=e.subtitle?.match(/^#(\d+)/);return n?Number(n[1]):void 0}var Rme=S(re(),1);function NB(e,t,r){let[n,o]=(0,Rme.useState)(null),i=ur();return(0,Rme.useEffect)(()=>{if(!e){o(null);return}let a=!1,s=t!==void 0?`&number=${t}`:"";return Ut(Dr(`/api/pr-status?cwd=${encodeURIComponent(e)}${s}`,i)).then(l=>l.json()).then(l=>{a||o(typeof l?.pr?.number=="number"?l.pr:null)}).catch(l=>{xr(l,"PR status"),a||o(null)}),()=>{a=!0}},[e,i,t,r]),n}var h6=S(_(),1),TLn={opacity:.35,mx:.5};function JPt({session:e}){let t=J3t(),r=Uhe(e.cwd),n=ab(e)??e.promptPr,o=NB(e.cwd,n,e.status),i=ZPt(e,t,{number:n??o?.number,url:o?.url},r(e.activity?.itemId)),a=s=>s>0&&!i[s].badge&&!i[s-1].badge;return(0,h6.jsx)(h6.Fragment,{children:i.map((s,l)=>(0,h6.jsxs)(QPt.Fragment,{children:[a(l)&&(0,h6.jsx)(H,{component:"span",sx:TLn,children:"\xB7"}),s.node]},s.key))})}var m6=S(_(),1);function eAt({session:e}){return(0,m6.jsxs)(m6.Fragment,{children:[(0,m6.jsx)(JPt,{session:e}),(0,m6.jsx)(HPt,{session:e})]})}var zBe=S(_(),1),wLn={color:"text.disabled",fontSize:"0.65rem",lineHeight:1.4};function tAt({toggles:e}){let t=e.flatMap(r=>r.caption??[]);return t.length===0?null:(0,zBe.jsx)(H,{sx:{display:"flex",gap:1,minWidth:0},children:t.map(r=>(0,zBe.jsx)(be,{sx:wLn,children:r},r))})}function OB({activity:e}){return e?.kind==="backlog"&&!!e.phase&&e.phase===e.totalPhases}function BB(e){let t=[],r=SE(e);if(r==="draft"||r==="bug"||r==="refine"){let n=e.autoApprove??!1;t.push({key:"autoApprove",label:"Auto start",checked:n,...n?{caption:"will auto start"}:{}})}if(e.activity?.kind==="backlog"){let n=e.autoAdvance??!0;OB(e)||t.push({key:"autoAdvance",label:"Continue",checked:n,...n?{}:{caption:"won't continue"}})}return t}var nJ=S(_(),1),CLn={gridColumn:2,gridRow:2,display:"flex",alignItems:"center",gap:.625,minWidth:0,overflow:"hidden",fontSize:"0.6875rem",lineHeight:"16px",color:"text.secondary"};function rAt({session:e}){return wme(e,!1)?null:(0,nJ.jsxs)(H,{sx:CLn,children:[(0,nJ.jsx)(eAt,{session:e}),(0,nJ.jsx)(tAt,{toggles:BB(e)})]})}var g6=S(_(),1);function nAt({session:e,loading:t}){return t?null:(0,g6.jsxs)(g6.Fragment,{children:[(0,g6.jsx)(rAt,{session:e}),(0,g6.jsx)(BPt,{session:e})]})}var Pme="session-card-title";var TE="session-card-close";var oAt=S(_(),1),iAt=ot((0,oAt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"DeleteForever");var Ame=S(re(),1),HBe=(0,Ame.createContext)({onStop:()=>{},onStart:()=>{},onDiscard:()=>{}});function $B(){return(0,Ame.useContext)(HBe)}var vT=S(_(),1);function aAt({id:e,reason:t,path:r,removesTree:n}){let{onDiscard:o}=$B(),{confirming:i,close:a,triggerHandlers:s,withHint:l}=fs(()=>o(e)),u=t?` (${t})`:"",d=r??"its working tree";return(0,vT.jsxs)(vT.Fragment,{children:[(0,vT.jsx)(Mt,{size:"small",...s,title:l(n?"Discard changes and remove worktree":"Drop this card and stop tracking its unlanded work"),sx:{color:"text.disabled","&:hover":{color:"error.main"}},children:(0,vT.jsx)(iAt,{sx:{fontSize:16}})}),i&&(0,vT.jsx)(ca,{children:(0,vT.jsx)(Fo,{title:n?"Discard all changes":"Stop tracking this work",message:n?`This permanently deletes the worktree ${d} and the work it holds${u}. This cannot be undone.`:`This drops the card and stops tracking the unlanded work in ${d}${u}. Nothing on disk is deleted.`,confirmLabel:n?"Discard changes":"Drop card",onConfirm:()=>{a(),o(e)},onCancel:a})})]})}var sb=S(_(),1);function sAt({childCount:e,onDismissThis:t,onDismissAll:r,onCancel:n}){let o=e===1?"session":"sessions";return(0,sb.jsxs)(Ra,{open:!0,onClose:n,maxWidth:"xs",fullWidth:!0,children:[(0,sb.jsx)(Bl,{children:"Close nested sessions?"}),(0,sb.jsx)(Ol,{children:(0,sb.jsx)(T_,{children:`This session has ${e} nested ${o}. Close just this session, or close it along with its nested ${o}? Running sessions will be stopped.`})}),(0,sb.jsxs)(Qc,{children:[(0,sb.jsx)(nt,{onClick:n,children:"Cancel"}),(0,sb.jsx)(nt,{onClick:t,children:"Close this only"}),(0,sb.jsx)(nt,{variant:"contained",color:"error",onClick:r,children:`Close all ${e+1}`})]})]})}var Lme=S(_(),1);function lAt({onDismiss:e,childDismiss:t,onClose:r}){let n=o=>{r(),o()};return(0,Lme.jsx)(ca,{children:t?(0,Lme.jsx)(sAt,{childCount:t.childCount,onDismissThis:()=>n(e),onDismissAll:()=>n(t.onDismissAll),onCancel:r}):(0,Lme.jsx)(Fo,{title:"End session",message:"This will stop the running session and kill its process. Are you sure?",confirmLabel:"End session",onConfirm:()=>n(e),onCancel:r})})}var wE=S(_(),1);function Ime({id:e,status:t,onDismiss:r,childDismiss:n}){let{confirming:o,close:i,triggerHandlers:a,withHint:s}=fs(n?.onDismissAll??r,{needsConfirm:t!=="done"||!!n});return(0,wE.jsxs)(wE.Fragment,{children:[(0,wE.jsx)(Mt,{size:"small",...a,title:s(`Dismiss session ${e}`),sx:{color:"text.disabled","&:hover":{color:"text.primary"}},children:(0,wE.jsx)(_o,{sx:{fontSize:16}})}),o&&(0,wE.jsx)(lAt,{onDismiss:r,childDismiss:n,onClose:i})]})}var Kn={supported:!0};function qo(e,t,r){return r?{supported:!1,reason:e,remediation:t,followUp:r}:{supported:!1,reason:e,remediation:t}}var cAt={"skills.native":Kn,"launch.terminal":Kn,"conversation.resume":Kn,"conversation.relocate":Kn,"conversation.id":Kn,"conversation.preassignId":Kn,"systemPrompt.append":Kn,"tasks.notifyOnExit":Kn,"preview.nextTurn":Kn,"artifacts.publish":Kn,"transcript.read":Kn,"oneShot.text":Kn,"oneShot.structured":Kn,"usage.rateLimits":Kn,"tools.restrict":Kn,"connector.gmail.read":Kn,"connector.slack.read":Kn,"intercept.command":Kn,"intercept.fileRead":Kn,"intercept.fileWrite":Kn,"intercept.editDiff":Kn,"intercept.question":Kn,"slashCommands.suggest":Kn,"session.driven":qo("Claude runs in a terminal the daemon mirrors rather than a session the daemon drives","pick Claude (SDK) for a session driven through the Agent SDK"),"tasks.background":qo("assist cannot list or stop the background tasks of a Claude session running in a terminal","pick Claude (SDK) to see background tasks on the session card")},kLn={...cAt,"session.driven":Kn,"tasks.background":Kn},uAt={claude:cAt,"claude-sdk":kLn,codex:{"skills.native":Kn,"launch.terminal":Kn,"conversation.resume":Kn,"conversation.relocate":Kn,"conversation.id":Kn,"conversation.preassignId":qo("Codex assigns its own conversation id when its rollout starts","assist binds the Codex conversation id from the rollout after launch"),"systemPrompt.append":qo("Design launches on Codex have not passed manual testing: sessions arrived without the design prompt or stopped before designing anything","start design sessions with Claude","a1589"),"tasks.notifyOnExit":qo("Codex runs a background command in an exec session that reports nothing back once the turn ends, so an agent that ends its turn never sees a command that waits on the user, such as review-high-level's verdict","run the high-level review on Claude; assist ask-question, ask and ask-check hand off to the daemon, which types the decision into Codex as its next turn","a1573"),"preview.nextTurn":Kn,"artifacts.publish":qo("Codex has no tool that publishes a claude.ai artifact, and assist ask-design reviews only artifact links","design in Codex and deliver the HTML file, then review it in chat; start the design session with Claude for preview-pane review rounds","a1567"),"transcript.read":Kn,"oneShot.text":Kn,"oneShot.structured":Kn,"usage.rateLimits":Kn,"tools.restrict":qo("assist cannot yet limit a headless Codex run to an allow-list of connector tools","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.gmail.read":qo("Codex has no verified read-only Gmail connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.slack.read":qo("Codex has no verified read-only Slack connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"intercept.command":Kn,"intercept.fileRead":Kn,"intercept.fileWrite":Kn,"intercept.editDiff":qo("assist's maintainability-override and comment guards run only in Claude's edit hook, so Codex patches are not checked for override markers or new code comments","the shared policy still applies the allowlist, restricted paths and docs/schema locks; run work that must keep those guards on Claude","a1592"),"intercept.question":Kn,"slashCommands.suggest":qo("assist reads skills and commands only from Claude's home and project dirs","type the Codex skill name in full in the phone reply bar"),"session.driven":qo("Codex runs in a terminal the daemon mirrors rather than a session the daemon drives","Codex sessions use the terminal; pick Claude (SDK) for a driven session","a1684"),"tasks.background":qo("Codex reports no background tasks to assist","Codex sessions show no background-task rows")},pi:{"skills.native":Kn,"launch.terminal":Kn,"conversation.resume":qo("pi sessions cannot be resumed yet","restart starts a fresh pi conversation; pick Claude or Codex to keep the conversation across restarts","a696"),"conversation.relocate":qo("pi sessions cannot be resumed, so a pi conversation cannot continue in a replacement worktree","start a fresh session in the replacement worktree; pick Claude or Codex to keep the conversation across worktree replacement","a696"),"conversation.id":qo("assist records no conversation id for pi sessions","comment from the session's own diff panel; a standalone /diff link cannot find a pi session","a696"),"conversation.preassignId":qo("pi does not accept a caller-assigned conversation id","the session card tracks pi without a conversation id"),"systemPrompt.append":qo("assist has not verified a pi flag that appends a system prompt at launch and on resume","start design sessions with Claude or Codex, or run /design inside a pi session to read the design prompt from disk","a696"),"tasks.notifyOnExit":qo("assist has not verified a pi tool that wakes the agent when a background command exits, so an agent that ends its turn would never see a command that waits on the user, such as review-high-level's verdict or an assist ask-question answer","run the high-level review on Claude; pi routes its native question tool to the preview pane instead of assist ask-question","a1573"),"preview.nextTurn":qo("assist cannot yet deliver a preview-pane decision into a pi session as its next turn, and pi cannot wait on a background task","pi routes its native question tool to the preview pane instead of assist ask-question","a1573"),"artifacts.publish":qo("pi has no tool that publishes a claude.ai artifact, and assist ask-design reviews only artifact links","deliver the HTML file and review it in chat; start the design session with Claude for preview-pane review rounds","a1567"),"transcript.read":qo("assist cannot read pi conversation transcripts yet","pi session cards show no message previews or transcript-derived status and title; pick Claude or Codex for those","a696"),"oneShot.text":qo("assist has no headless pi one-shot yet","the derived fallback is used instead (slug from the description, no generated title); set harness.engine to claude or codex for generated suggestions","a696"),"oneShot.structured":qo("assist has no headless streaming pi run yet","pick Claude or Codex for review synthesis (review.synthesisHarness); pi cannot be a reviewer","a696"),"usage.rateLimits":qo("pi reports no account rate-limit windows to assist","pi sessions show no usage windows; Claude and Codex usage is still tracked under their own accounts","a696"),"tools.restrict":qo("assist cannot limit a headless pi run to an allow-list of tools","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.gmail.read":qo("pi has no Gmail connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.slack.read":qo("pi has no Slack connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"intercept.command":Kn,"intercept.fileRead":Kn,"intercept.fileWrite":Kn,"intercept.editDiff":qo("assist's maintainability-override and comment guards run only in Claude's edit hook, so pi edits and writes are not checked for override markers or new code comments","the shared policy still applies the allowlist, restricted paths and docs/schema locks; run work that must keep those guards on Claude","a1592"),"intercept.question":Kn,"slashCommands.suggest":qo("assist reads skills and commands only from Claude's home and project dirs","type the pi prompt name in full in the phone reply bar"),"session.driven":qo("pi runs in a terminal the daemon mirrors rather than a session the daemon drives","pi sessions use the terminal; pick Claude (SDK) for a driven session"),"tasks.background":qo("pi reports no background tasks to assist","pi sessions show no background-task rows")}};function dAt(e,t){let r=e[t];return typeof r=="function"?r():r}function Dme(e,t){let r=jd(e),n=uAt[r];return n?dAt(n,t):qo(`This app does not recognise the ${r} harness.`,"Update the app to a version that supports it.")}function Mme(e){return Dme(e,"conversation.resume").supported}var fAt=S(_(),1),js=ot((0,fAt.jsx)("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");var Nme=S(re(),1);var CE=S(_(),1);function pAt({id:e,onStartOver:t,anchor:r,onClose:n}){let o=fs(()=>{n(),t()});return(0,CE.jsxs)(CE.Fragment,{children:[(0,CE.jsx)(fi,{anchorEl:r,open:r!==null,onClose:n,onClick:i=>i.stopPropagation(),children:(0,CE.jsx)(Br,{title:o.withHint("Start over"),...o.triggerHandlers,onClick:i=>{n(),o.triggerHandlers.onClick(i)},children:"Start over"})}),o.confirming&&(0,CE.jsx)(Fo,{title:`Start over session ${e}`,message:"Start over? The conversation history is discarded. This stops the running process and starts a new conversation with only the initial prompt, or opens idle if there was none.",confirmLabel:"Start over",onConfirm:()=>{o.close(),t()},onCancel:o.close})]})}var bT=S(_(),1);function hAt({id:e,onStartOver:t,children:r}){let n=(0,Nme.useRef)(null),[o,i]=(0,Nme.useState)(null);return(0,bT.jsxs)(bT.Fragment,{children:[(0,bT.jsxs)(U1,{ref:n,variant:"outlined",color:"inherit",size:"small","aria-label":"Restart session",sx:{color:"text.secondary",flexShrink:0,"& .MuiButtonGroup-grouped":{borderColor:"divider"},"& .MuiButtonGroup-lastButton":{minWidth:0,px:.25}},children:[r,(0,bT.jsx)(nt,{"aria-label":"Restart options","aria-haspopup":"menu","aria-expanded":o!==null,onClick:a=>{a.stopPropagation(),i(n.current)},children:(0,bT.jsx)(js,{sx:{fontSize:16}})})]}),(0,bT.jsx)(pAt,{id:e,onStartOver:t,anchor:o,onClose:()=>i(null)})]})}var mAt=S(_(),1),xT=ot((0,mAt.jsx)("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt");var Ome=S(re(),1),UBe=(0,Ome.createContext)(!1);function Bme(){return(0,Ome.useContext)(UBe)}var $me=S(_(),1);function gAt({title:e,onClick:t,onKeyDown:r}){let n=Bme();return(0,$me.jsx)(nt,{size:"small","aria-label":"Restart",title:e,onClick:t,onKeyDown:r,startIcon:n?(0,$me.jsx)(xT,{sx:{fontSize:14}}):void 0,sx:{textTransform:"none",minWidth:0,px:1,whiteSpace:"nowrap"},children:n?"Restart":(0,$me.jsx)(xT,{sx:{fontSize:14}})})}var kE=S(_(),1);function _Ln(e){return Mme(e)?"resumes the conversation":"relaunches it from the start"}function Fme({id:e,onRestart:t,onStartOver:r,harness:n}){let{confirming:o,close:i,triggerHandlers:a,withHint:s}=fs(t),l=(0,kE.jsx)(gAt,{title:s(`Restart session ${e}`),...a});return(0,kE.jsxs)(kE.Fragment,{children:[r?(0,kE.jsx)(hAt,{id:e,onStartOver:r,children:l}):l,o&&(0,kE.jsx)(Fo,{title:`Restart session ${e}`,message:`Restart this ${Ei(n)} session? It ${_Ln(n)}, stopping the running process first.`,confirmLabel:"Restart",onConfirm:()=>{i(),t()},onCancel:i})]})}var lb=S(_(),1);function yAt({session:e,onRestart:t,onStartOver:r,onDismiss:n,childDismiss:o}){let{status:i,id:a,harness:s}=e;return e.closing?null:i!=="stopped"?(0,lb.jsx)("span",{className:TE,children:(0,lb.jsx)(Ime,{id:a,status:i,onDismiss:n,childDismiss:o})}):(0,lb.jsxs)(lb.Fragment,{children:[e.undurable&&(0,lb.jsx)("span",{className:TE,children:(0,lb.jsx)(aAt,{id:a,reason:e.undurable.reason,path:e.cwd,removesTree:e.undurable.removesTree})}),t&&(0,lb.jsx)(Fme,{id:a,onRestart:t,onStartOver:r,harness:s})]})}var WBe=S(_(),1);function vAt({session:e,onRestart:t,onStartOver:r,onDismiss:n,childDismiss:o}){return(0,WBe.jsx)(ca,{children:(0,WBe.jsx)(yAt,{session:e,onRestart:t,onStartOver:r,onDismiss:n,childDismiss:o})})}var VBe=S(_(),1),ELn={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25};function bAt({session:e,loading:t,onRetry:r,onRestart:n,onStartOver:o,onDismiss:i,childDismiss:a}){return(0,VBe.jsx)(H,{sx:ELn,children:(0,VBe.jsx)(vAt,{session:e,loading:t,onRetry:r,onRestart:n,onStartOver:o,onDismiss:i,childDismiss:a})})}function zme(e){return e.verifying===!0&&Qi(e)==="running"}var FB=S(_(),1),RLn=wi`
|
|
3816
|
+
Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}/*`}">.`)}let d=Vo(),f;if(t){let y=typeof t=="string"?Zg(t):t;jn(l==="/"||y.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${y.pathname}" was given in the \`location\` prop.`),f=y}else f=d;let p=f.pathname||"/",h=p;if(l!=="/"){let y=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=r&&r.state.matches.length?r.state.matches.map(y=>Object.assign(y,{route:r.manifest[y.route.id]||y.route})):DOe(e,{pathname:h});lB&&(us(u||m!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),us(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let g=zPn(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Xg([l,n.encodeLocation?n.encodeLocation(y.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Xg([l,n.encodeLocation?n.encodeLocation(y.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathnameBase])})),o,r);return t&&g?zr.createElement(i6.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},g):g}function OPn(){let e=H5t(),t=dB(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},a=null;return lB&&(console.error("Error handled by React Router default ErrorBoundary:",e),a=zr.createElement(zr.Fragment,null,zr.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),zr.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",zr.createElement("code",{style:i},"ErrorBoundary")," or"," ",zr.createElement("code",{style:i},"errorElement")," prop on your route."))),zr.createElement(zr.Fragment,null,zr.createElement("h2",null,"Unexpected Application Error!"),zr.createElement("h3",{style:{fontStyle:"italic"}},t),r?zr.createElement("pre",{style:o},r):null,a)}var BPn=zr.createElement(OPn,null),$5t=class extends zr.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=DPn(e.digest);r&&(e=r)}let t=e!==void 0?zr.createElement(pm.Provider,{value:this.props.routeContext},zr.createElement(HOe.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?zr.createElement($Pn,{error:e},t):t}};$5t.contextType=P5t;var COe=new WeakMap;function $Pn({children:e,error:t}){let{basename:r,navigator:n}=zr.useContext(Gd);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=IPn(t.digest);if(o){let i=COe.get(t);if(i)throw i;let a=p5t(o.location,r),s=a.absoluteURL||a.to;if(aB(o.location,s,OOe(n),"allow-explicit"),POe(s))throw new Error("Invalid redirect location");if(f5t&&!COe.get(t))if(a.isExternal||o.reloadDocument)window.location.href=s;else{let l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:o.replace}));throw COe.set(t,l),l}return zr.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s}`})}}return e}function FPn({routeContext:e,match:t,children:r}){let n=zr.useContext(aE);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),zr.createElement(pm.Provider,{value:e},r)}function zPn(e,t=[],r){let n=r?.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n?.errors;if(i!=null){let d=o.findIndex(f=>f.route.id&&i?.[f.route.id]!==void 0);jn(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,d+1))}let a=!1,s=-1;if(r&&n){a=n.renderFallback;for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(s=d),f.route.id){let{loaderData:p,errors:h}=n,m=f.route.loader&&!p.hasOwnProperty(f.route.id)&&(!h||h[f.route.id]===void 0);if(f.route.lazy||m){r.isStatic&&(a=!0),s>=0?o=o.slice(0,s+1):o=[o[0]];break}}}}let l=r?.onError,u=n&&l?(d,f)=>{l(d,{location:n.location,params:n.matches?.[0]?.params??{},pattern:zQ(n.matches),errorInfo:f})}:void 0;return o.reduceRight((d,f,p)=>{let h,m=!1,g=null,y=null;n&&(h=i&&f.route.id?i[f.route.id]:void 0,g=f.route.errorElement||BPn,a&&(s<0&&p===0?(U5t("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,y=null):s===p&&(m=!0,y=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,p+1)),b=()=>{let x;return h?x=g:m?x=y:f.route.Component?x=zr.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,zr.createElement(FPn,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?zr.createElement($5t,{location:n.location,revalidation:n.revalidation,component:g,error:h,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:u}):b()},null)}function VOe(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function F5t(e){let t=zr.useContext(aE);return jn(t,VOe(e)),t}function Che(e){let t=zr.useContext(o6);return jn(t,VOe(e)),t}function HPn(e){let t=zr.useContext(pm);return jn(t,VOe(e)),t}function GOe(e){let t=HPn(e),r=t.matches[t.matches.length-1];return jn(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function UPn(){return GOe("useRouteId")}function z5t(){let e=Che("useNavigation");return zr.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}function qOe(){let{matches:e,loaderData:t}=Che("useMatches");return zr.useMemo(()=>e.map(r=>o5t(r,t)),[e,t])}function H5t(){let e=zr.useContext(HOe),t=Che("useRouteError"),r=GOe("useRouteError");return e!==void 0?e:t.errors?.[r]}var WPn=0;function jOe(e){let{router:t,basename:r}=F5t("useBlocker"),n=Che("useBlocker"),[o,i]=zr.useState(""),a=zr.useCallback(s=>{if(typeof e!="function")return!!e;if(r==="/")return e(s);let{currentLocation:l,nextLocation:u,historyAction:d}=s;return e({currentLocation:{...l,pathname:If(l.pathname,r)||l.pathname},nextLocation:{...u,pathname:If(u.pathname,r)||u.pathname},historyAction:d})},[r,e]);return zr.useEffect(()=>{let s=String(++WPn);return i(s),()=>t.deleteBlocker(s)},[t]),zr.useEffect(()=>{o!==""&&t.getBlocker(o,a)},[t,o,a]),o&&n.blockers.has(o)?n.blockers.get(o):r6}function VPn(){let{router:e}=F5t("useNavigate"),t=GOe("useNavigate"),r=zr.useRef(!1);return M5t(()=>{r.current=!0}),zr.useCallback(async(o,i={})=>{us(r.current,D5t),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...i}))},[e,t])}var q4t={};function U5t(e,t,r){!t&&!q4t[e]&&(q4t[e]=!0,us(!1,r))}var j4t={};function Y4t(e,t){!e&&!j4t[t]&&(j4t[t]=!0,console.warn(t))}var GPn="useOptimistic",K4t=fn[GPn],qPn=()=>{};function jPn(e){return K4t?K4t(e):[e,qPn]}function W5t(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(lB&&e.element&&us(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:fn.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(lB&&e.hydrateFallbackElement&&us(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:fn.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(lB&&e.errorElement&&us(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:fn.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var V5t=["HydrateFallback","hydrateFallbackElement"];var YPn=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function YOe({router:e,flushSync:t,onError:r,useTransitions:n}){n=A5t()||n;let[i,a]=fn.useState(e.state),[s,l]=jPn(i),[u,d]=fn.useState(),[f,p]=fn.useState({isTransitioning:!1}),[h,m]=fn.useState(),[g,y]=fn.useState(),[v,b]=fn.useState(),x=fn.useRef(new Map),w=fn.useCallback((R,{deletedFetchers:D,newErrors:N,flushSync:$,viewTransitionOpts:P})=>{N&&r&&Object.values(N).forEach(L=>r(L,{location:R.location,params:R.matches[0]?.params??{},pattern:zQ(R.matches)})),R.fetchers.forEach((L,I)=>{L.data!==void 0&&x.current.set(I,L.data)}),D.forEach(L=>x.current.delete(L)),Y4t($===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let A=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Y4t(P==null||A,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!P||!A){t&&$?t(()=>a(R)):n===!1?a(R):fn.startTransition(()=>{n===!0&&l(L=>X4t(L,R)),a(R)});return}if(t&&$){t(()=>{g&&(h?.resolve(),g.skipTransition()),p({isTransitioning:!0,flushSync:!0,currentLocation:P.currentLocation,nextLocation:P.nextLocation})});let L=e.window.document.startViewTransition(()=>{t(()=>a(R))});L.finished.finally(()=>{t(()=>{m(void 0),y(void 0),d(void 0),p({isTransitioning:!1})})}),t(()=>y(L));return}g?(h?.resolve(),g.skipTransition(),b({state:R,currentLocation:P.currentLocation,nextLocation:P.nextLocation})):(d(R),p({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}))},[e.window,t,g,h,n,l,r]);fn.useLayoutEffect(()=>e.subscribe(w),[e,w]),fn.useEffect(()=>{f.isTransitioning&&!f.flushSync&&m(new YPn)},[f]),fn.useEffect(()=>{if(h&&u&&e.window){let R=u,D=h.promise,N=e.window.document.startViewTransition(async()=>{n===!1?a(R):fn.startTransition(()=>{n===!0&&l($=>X4t($,R)),a(R)}),await D});N.finished.finally(()=>{m(void 0),y(void 0),d(void 0),p({isTransitioning:!1})}),y(N)}},[u,h,e.window,n,l]),fn.useEffect(()=>{h&&u&&s.location.key===u.location.key&&h.resolve()},[h,g,s.location,u]),fn.useEffect(()=>{!f.isTransitioning&&v&&(d(v.state),p({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),b(void 0))},[f.isTransitioning,v]);let C=fn.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:R=>e.navigate(R),push:(R,D,N)=>e.navigate(R,{state:D,preventScrollReset:N?.preventScrollReset}),replace:(R,D,N)=>e.navigate(R,{replace:!0,state:D,preventScrollReset:N?.preventScrollReset})}),[e]),k=e.basename||"/",E=fn.useMemo(()=>({router:e,navigator:C,static:!1,basename:k,onError:r}),[e,C,k,r]);return fn.createElement(fn.Fragment,null,fn.createElement(aE.Provider,{value:E},fn.createElement(o6.Provider,{value:s},fn.createElement(zOe.Provider,{value:x.current},fn.createElement(whe.Provider,{value:f},fn.createElement(KOe,{basename:k,location:s.location,navigationType:s.historyAction,navigator:C,useTransitions:n},fn.createElement(KPn,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function X4t(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var KPn=fn.memo(XPn);function XPn({routes:e,manifest:t,future:r,state:n,isStatic:o,onError:i}){return B5t(e,void 0,{manifest:t,state:n,isStatic:o,onError:i,future:r})}function a6({to:e,replace:t,state:r,relative:n}){jn(sE(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:i}=fn.useContext(Gd);us(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=fn.useContext(pm),{pathname:s}=Vo(),l=en(),u=FQ(e,The(a),s,n==="path");aB(typeof e=="string"?e:Vd(e),i.createHref(u),OOe(i),"reject");let d=JSON.stringify(u);return fn.useEffect(()=>{l(JSON.parse(d),{replace:t,state:r,relative:n})},[l,d,n,t,r]),null}function HQ(e){return N5t(e.context)}function So(e){jn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function KOe({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:i=!1,useTransitions:a}){jn(!sE(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=fn.useMemo(()=>({basename:s,navigator:o,static:i,useTransitions:a,future:{}}),[s,o,i,a]);typeof r=="string"&&(r=Zg(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:h="default",mask:m}=r,g=fn.useMemo(()=>{let y=If(u,s);return y==null?null:{location:{pathname:y,search:d,hash:f,state:p,key:h,mask:m},navigationType:n}},[s,u,d,f,p,h,n,m]);return us(g!=null,`<Router basename="${s}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:fn.createElement(Gd.Provider,{value:l},fn.createElement(i6.Provider,{children:t,value:g}))}function uT({children:e,location:t}){return O5t(vhe(e),t)}function vhe(e,t=[]){let r=[];return fn.Children.forEach(e,(n,o)=>{if(!fn.isValidElement(n))return;let i=[...t,o];if(n.type===fn.Fragment){r.push.apply(r,vhe(n.props.children,i));return}jn(n.type===So,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),jn(!n.props.index||!n.props.children,"An index route cannot have child routes.");let a={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=vhe(n.props.children,i)),r.push(a)}),r}var ghe="get",yhe="application/x-www-form-urlencoded";function khe(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function ZPn(e){return khe(e)&&e.tagName.toLowerCase()==="button"}function QPn(e){return khe(e)&&e.tagName.toLowerCase()==="form"}function JPn(e){return khe(e)&&e.tagName.toLowerCase()==="input"}function eAn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tAn(e,t){return e.button===0&&(!t||t==="_self")&&!eAn(e)}function bhe(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function rAn(e,t){let r=bhe(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}var dhe=null;function nAn(){if(dhe===null)try{new FormData(document.createElement("form"),0),dhe=!1}catch{dhe=!0}return dhe}var oAn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function kOe(e){return e!=null&&!oAn.has(e)?(us(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${yhe}"`),null):e}function iAn(e,t){let r,n,o,i,a;if(QPn(e)){let s=e.getAttribute("action");n=s?If(s,t):null,r=e.getAttribute("method")||ghe,o=kOe(e.getAttribute("enctype"))||yhe,i=new FormData(e)}else if(ZPn(e)||JPn(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(n=l?If(l,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||ghe,o=kOe(e.getAttribute("formenctype"))||kOe(s.getAttribute("enctype"))||yhe,i=new FormData(s,e),!nAn()){let{name:u,type:d,value:f}=e;if(d==="image"){let p=u?`${u}.`:"";i.append(`${p}x`,"0"),i.append(`${p}y`,"0")}else u&&i.append(u,f)}}else{if(khe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ghe,n=null,o=yhe,a=e}return i&&o==="text/plain"&&(a=i,i=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:i,body:a}}var hHi=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var aAn={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},sAn=/[&><\u2028\u2029]/g;function Z4t(e){return e.replace(sAn,t=>aAn[t])}function ZOe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function G5t(e,t,r,n){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${n}`:o.pathname=`${o.pathname}.${n}`:o.pathname==="/"?o.pathname=`_root.${n}`:t&&If(o.pathname,t)==="/"?o.pathname=`${uB(t)}/_root.${n}`:o.pathname=`${uB(o.pathname)}.${n}`,o}async function lAn(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&IAn.hot)throw r;return window.location.reload(),new Promise(()=>{})}}function cAn(e){return e!=null&&typeof e.page=="string"}function uAn(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function dAn(e,t,r){let n=await Promise.all(e.map(async o=>{let i=t.routes[o.route.id];if(i){let a=await lAn(i,r);return a.links?a.links():[]}return[]}));return mAn(n.flat(1).filter(uAn).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Q4t(e,t,r,n,o,i){let a=(l,u)=>r[u]?l.route.id!==r[u].route.id:!0,s=(l,u)=>r[u].pathname!==l.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==l.params["*"];return i==="assets"?t.filter((l,u)=>a(l,u)||s(l,u)):i==="data"?t.filter((l,u)=>{let d=n.routes[l.route.id];if(!d||!d.hasLoader)return!1;if(a(l,u)||s(l,u))return!0;if(l.route.shouldRevalidate){let f=l.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function fAn(e,t,{includeHydrateFallback:r}={}){return pAn(e.map(n=>{let o=t.routes[n.route.id];if(!o)return[];let i=[o.module];return o.clientActionModule&&(i=i.concat(o.clientActionModule)),o.clientLoaderModule&&(i=i.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(i=i.concat(o.hydrateFallbackModule)),o.imports&&(i=i.concat(o.imports)),i}).flat(1))}function pAn(e){return[...new Set(e)]}function hAn(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function mAn(e,t){let r=new Set,n=new Set(t);return e.reduce((o,i)=>{if(t&&!cAn(i)&&i.as==="script"&&i.href&&n.has(i.href))return o;let s=JSON.stringify(hAn(i));return r.has(s)||(r.add(s),o.push({key:s,link:i})),o},[])}function QOe(){let e=$o.useContext(aE);return ZOe(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function bAn(){let e=$o.useContext(o6);return ZOe(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var UQ=$o.createContext(void 0);UQ.displayName="FrameworkContext";function _he(){let e=$o.useContext(UQ);return ZOe(e,"You must render this element inside a <HydratedRouter> element"),e}function xAn(e,t){let r=$o.useContext(UQ),[n,o]=$o.useState(!1),[i,a]=$o.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=$o.useRef(null);$o.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let g=v=>{v.forEach(b=>{a(b.isIntersecting)})},y=new IntersectionObserver(g,{threshold:.5});return p.current&&y.observe(p.current),()=>{y.disconnect()}}},[e]),$o.useEffect(()=>{if(n){let g=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(g)}}},[n]);let h=()=>{o(!0)},m=()=>{o(!1),a(!1)};return r?e!=="intent"?[i,p,{}]:[i,p,{onFocus:IQ(s,h),onBlur:IQ(l,m),onMouseEnter:IQ(u,h),onMouseLeave:IQ(d,m),onTouchStart:IQ(f,h)}]:[!1,p,{}]}function IQ(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function j5t({page:e,...t}){let r=A5t(),{nonce:n}=_he(),{router:o}=QOe(),i=$o.useMemo(()=>DOe(o.routes,e,o.basename),[o.routes,e,o.basename]);return i?(t.nonce==null&&n&&(t={...t,nonce:n}),r?$o.createElement(TAn,{page:e,matches:i,...t}):$o.createElement(wAn,{page:e,matches:i,...t})):null}function SAn(e){let{manifest:t,routeModules:r}=_he(),[n,o]=$o.useState([]);return $o.useEffect(()=>{let i=!1;return dAn(e,t,r).then(a=>{i||o(a)}),()=>{i=!0}},[e,t,r]),n}function TAn({page:e,matches:t,...r}){let n=Vo(),{future:o}=_he(),{basename:i}=QOe(),a=$o.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let s=G5t(e,i,o.v8_trailingSlashAwareDataRequests,"rsc"),l=!1,u=[];for(let d of t)typeof d.route.shouldRevalidate=="function"?l=!0:u.push(d.route.id);return l&&u.length>0&&s.searchParams.set("_routes",u.join(",")),[s.pathname+s.search]},[i,o.v8_trailingSlashAwareDataRequests,e,n,t]);return $o.createElement($o.Fragment,null,a.map(s=>$o.createElement("link",{key:s,rel:"prefetch",as:"fetch",href:s,...r})))}function wAn({page:e,matches:t,...r}){let n=Vo(),{future:o,manifest:i,routeModules:a}=_he(),{basename:s}=QOe(),{loaderData:l,matches:u}=bAn(),d=$o.useMemo(()=>Q4t(e,t,u,i,n,"data"),[e,t,u,i,n]),f=$o.useMemo(()=>Q4t(e,t,u,i,n,"assets"),[e,t,u,i,n]),p=$o.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let g=new Set,y=!1;if(t.forEach(b=>{let x=i.routes[b.route.id];!x||!x.hasLoader||(!d.some(w=>w.route.id===b.route.id)&&b.route.id in l&&a[b.route.id]?.shouldRevalidate||x.hasClientLoader?y=!0:g.add(b.route.id))}),g.size===0)return[];let v=G5t(e,s,o.v8_trailingSlashAwareDataRequests,"data");return y&&g.size>0&&v.searchParams.set("_routes",t.filter(b=>g.has(b.route.id)).map(b=>b.route.id).join(",")),[v.pathname+v.search]},[s,o.v8_trailingSlashAwareDataRequests,l,n,i,d,t,e,a]),h=$o.useMemo(()=>fAn(f,i),[f,i]),m=SAn(f);return $o.createElement($o.Fragment,null,p.map(g=>$o.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...r})),h.map(g=>$o.createElement("link",{key:g,rel:"modulepreload",href:g,...r})),m.map(({key:g,link:y})=>$o.createElement("link",{key:g,nonce:r.nonce,...y,crossOrigin:y.crossOrigin??r.crossOrigin})))}function CAn(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var kAn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{kAn&&(window.__reactRouterVersion="7.18.5")}catch{}function JOe(e,t){return x5t({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:r5t({window:t?.window}),hydrationData:t?.hydrationData||_An(),routes:e,mapRouteProperties:W5t,hydrationRouteProperties:V5t,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function _An(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:EAn(e.errors)}),e}function EAn(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,o]of t)if(o&&o.__type==="RouteErrorResponse")r[n]=new fB(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(typeof o.__subType=="string"&&V3n.includes(o.__subType)){let i=window[o.__subType];if(typeof i=="function")try{let a=new i(o.message);a.stack="",r[n]=a}catch{}}if(r[n]==null){let i=new Error(o.message);i.stack="",r[n]=i}}else r[n]=o;return r}function Y5t({basename:e,children:t,history:r,useTransitions:n}){let[o,i]=pn.useState({action:r.action,location:r.location}),a=pn.useCallback(s=>{n===!1?i(s):pn.startTransition(()=>i(s))},[n]);return pn.useLayoutEffect(()=>r.listen(a),[r,a]),pn.createElement(KOe,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:r,useTransitions:n})}Y5t.displayName="unstable_HistoryRouter";var wa=pn.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:o,reloadDocument:i,replace:a,mask:s,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:h,...m},g){let{basename:y,navigator:v,useTransitions:b}=pn.useContext(Gd),x=typeof d=="string"&&xhe.test(d),w=p5t(d,y);d=w.to;let C=I5t(d,{relative:o}),k=Vo(),E=null;if(s){let I=FQ(s,[],k.mask?k.mask.pathname:"/",!0);y!=="/"&&(I.pathname=I.pathname==="/"?y:Xg([y,I.pathname])),E=v.createHref(I)}let[R,D,N]=xAn(n,m),$=J5t(d,{replace:a,mask:s,state:l,target:u,preventScrollReset:f,relative:o,viewTransition:p,defaultShouldRevalidate:h,useTransitions:b});function P(I){t&&t(I),I.defaultPrevented||$(I)}let A=!(w.isExternal||i),L=pn.createElement("a",{...m,...N,href:(A?E:void 0)||w.absoluteURL||C,onClick:A?P:t,ref:CAn(g,D),target:u,"data-discover":!x&&r==="render"?"true":void 0});return R&&!x?pn.createElement(pn.Fragment,null,L,pn.createElement(j5t,{page:C})):L});wa.displayName="Link";var K5t=pn.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:o=!1,style:i,to:a,viewTransition:s,children:l,...u},d){let f=pB(a,{relative:u.relative}),p=Vo(),h=pn.useContext(o6),{navigator:m,basename:g}=pn.useContext(Gd),y=h!=null&&nRt(f)&&s===!0,v=m.encodeLocation?m.encodeLocation(f).pathname:f.pathname,b=p.pathname,x=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;r||(b=b.toLowerCase(),x=x?x.toLowerCase():null,v=v.toLowerCase()),x&&g&&(x=If(x,g)||x);let w=v!=="/"&&v.endsWith("/")?v.length-1:v.length,C=b===v||!o&&b.startsWith(v)&&b.charAt(w)==="/",k=x!=null&&(x===v||!o&&x.startsWith(v)&&x.charAt(v.length)==="/"),E={isActive:C,isPending:k,isTransitioning:y},R=C?t:void 0,D;typeof n=="function"?D=n(E):D=[n,C?"active":null,k?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let N=typeof i=="function"?i(E):i;return pn.createElement(wa,{...u,"aria-current":R,className:D,ref:d,style:N,to:a,viewTransition:s},typeof l=="function"?l(E):l)});K5t.displayName="NavLink";var X5t=pn.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:i,method:a=ghe,action:s,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...h},m)=>{let{useTransitions:g}=pn.useContext(Gd),y=eRt(),v=tRt(s,{relative:u}),b=a.toLowerCase()==="get"?"get":"post",x=typeof s=="string"&&xhe.test(s);return pn.createElement("form",{ref:m,method:b,action:v,onSubmit:n?l:C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let k=C.nativeEvent.submitter,E=k?.getAttribute("formmethod")||a,R=()=>y(k||C.currentTarget,{fetcherKey:t,method:E,navigate:r,replace:o,state:i,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&r!==!1?pn.startTransition(()=>R()):R()},...h,"data-discover":!x&&e==="render"?"true":void 0})});X5t.displayName="Form";function Z5t({getKey:e,storageKey:t,...r}){let n=pn.useContext(UQ),{basename:o}=pn.useContext(Gd),i=Vo(),a=qOe();rRt({getKey:e,storageKey:t});let s=pn.useMemo(()=>{if(!n||!e)return null;let u=IOe(i,a,o,e);return u!==i.key?u:null},[]);if(!n||n.isSpaMode)return null;let l=((u,d)=>{if(!window.history.state||!window.history.state.key){let f=Math.random().toString(32).slice(2);window.history.replaceState({key:f},"")}try{let p=JSON.parse(sessionStorage.getItem(u)||"{}")[d||window.history.state.key];typeof p=="number"&&window.scrollTo(0,p)}catch(f){console.error(f),sessionStorage.removeItem(u)}}).toString();return r.nonce==null&&n?.nonce&&(r.nonce=n.nonce),pn.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${Z4t(JSON.stringify(t||LOe))}, ${Z4t(JSON.stringify(s))})`}})}Z5t.displayName="ScrollRestoration";function Q5t(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function eBe(e){let t=pn.useContext(aE);return jn(t,Q5t(e)),t}function RAn(e){let t=pn.useContext(o6);return jn(t,Q5t(e)),t}function J5t(e,{target:t,replace:r,mask:n,state:o,preventScrollReset:i,relative:a,viewTransition:s,defaultShouldRevalidate:l,useTransitions:u}={}){let d=en(),f=Vo(),p=pB(e,{relative:a});return pn.useCallback(h=>{if(tAn(h,t)){h.preventDefault();let m=r!==void 0?r:Vd(f)===Vd(p),g=()=>d(e,{replace:m,mask:n,state:o,preventScrollReset:i,relative:a,viewTransition:s,defaultShouldRevalidate:l});u?pn.startTransition(()=>g()):g()}},[f,d,p,r,n,o,t,e,i,a,s,l,u])}function ja(e){us(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=pn.useRef(bhe(e)),r=pn.useRef(!1),n=Vo(),o=pn.useMemo(()=>rAn(n.search,r.current?null:t.current),[n.search]),i=en(),a=pn.useCallback((s,l)=>{let u=bhe(typeof s=="function"?s(new URLSearchParams(o)):s);r.current=!0,i("?"+u,l)},[i,o]);return[o,a]}var PAn=0,AAn=()=>`__${String(++PAn)}__`;function eRt(){let{router:e}=eBe("useSubmit"),{basename:t}=pn.useContext(Gd),r=UPn(),n=e.fetch,o=e.navigate;return pn.useCallback(async(i,a={})=>{let{action:s,method:l,encType:u,formData:d,body:f}=iAn(i,t);if(a.navigate===!1){let p=a.fetcherKey||AAn();await n(p,r,a.action||s,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||l,formEncType:a.encType||u,flushSync:a.flushSync})}else await o(a.action||s,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:d,body:f,formMethod:a.method||l,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:r,flushSync:a.flushSync,viewTransition:a.viewTransition})},[n,o,t,r])}function tRt(e,{relative:t}={}){let{basename:r}=pn.useContext(Gd),n=pn.useContext(pm);jn(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),i={...pB(e||".",{relative:t})},a=Vo();if(e==null){i.search=a.search;let s=new URLSearchParams(i.search),l=s.getAll("index");if(l.some(d=>d==="")){s.delete("index"),l.filter(f=>f).forEach(f=>s.append("index",f));let d=s.toString();i.search=d?`?${d}`:""}}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(i.pathname=i.pathname==="/"?r:Xg([r,i.pathname])),Vd(i)}var LOe="react-router-scroll-positions",fhe={};function IOe(e,t,r,n){let o=null;return n&&(r!=="/"?o=n({...e,pathname:If(e.pathname,r)||e.pathname},t):o=n(e,t)),o==null&&(o=e.key),o}function rRt({getKey:e,storageKey:t}={}){let{router:r}=eBe("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:o}=RAn("useScrollRestoration"),{basename:i}=pn.useContext(Gd),a=Vo(),s=qOe(),l=z5t();pn.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),LAn(pn.useCallback(()=>{if(l.state==="idle"){let u=IOe(a,s,i,e);fhe[u]=window.scrollY}try{sessionStorage.setItem(t||LOe,JSON.stringify(fhe))}catch(u){us(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[l.state,e,i,a,s,t])),typeof document<"u"&&(pn.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||LOe);u&&(fhe=JSON.parse(u))}catch{}},[t]),pn.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(fhe,()=>window.scrollY,e?(d,f)=>IOe(d,f,i,e):void 0);return()=>u&&u()},[r,i,e]),pn.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(a.hash){let u=document.getElementById(decodeURIComponent(a.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{us(!1,`"${a.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}o!==!0&&window.scrollTo(0,0)}},[a,n,o]))}function LAn(e,t){let{capture:r}=t||{};pn.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function nRt(e,{relative:t}={}){let r=pn.useContext(whe);jn(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=eBe("useViewTransitionState"),o=pB(e,{relative:t});if(!r.isTransitioning)return!1;let i=If(r.currentLocation.pathname,n)||r.currentLocation.pathname,a=If(r.nextLocation.pathname,n)||r.nextLocation.pathname;return cB(o.pathname,a)!=null||cB(o.pathname,i)!=null}var Edn=S(re(),1);var Ehe=S(re(),1),tBe=(0,Ehe.createContext)({nodes:null,transfer:()=>{},cancel:()=>{}});function Rhe(){return(0,Ehe.useContext)(tBe)}var iRt=S(_(),1);function lE({inputRef:e,value:t,onChange:r,onKeyDown:n,placeholder:o,autoFocus:i}){return(0,iRt.jsx)(An,{autoFocus:i,inputRef:e,value:t,onChange:a=>r(a.target.value),onKeyDown:n,placeholder:o,size:"small",fullWidth:!0,slotProps:{input:{sx:{fontSize:12}}},sx:{p:.5}})}var dT=S(re(),1),cRt=S(_(),1),aRt=(0,dT.createContext)({query:"",setQuery:()=>{},viewedTerm:"",setViewedTerm:()=>{}});function sRt({children:e}){let[t,r]=(0,dT.useState)(""),[n,o]=(0,dT.useState)(""),i=(0,dT.useMemo)(()=>({query:t,setQuery:r,viewedTerm:n,setViewedTerm:o}),[t,n]);return(0,cRt.jsx)(aRt.Provider,{value:i,children:e})}function WQ(){return(0,dT.useContext)(aRt)}function lRt(){let{query:e,viewedTerm:t}=WQ();return e.trim()?t:""}var uRt=S(_(),1),Z0=ot((0,uRt.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");function Phe(e){return{display:"block",width:"100%",textAlign:"left",p:"5px 10px",borderRadius:0,bgcolor:e?"action.selected":"background.default",borderLeft:2,borderLeftColor:e?"primary.main":"transparent",cursor:e?"default":"pointer",transition:"background 0.15s","&:hover":e?void 0:{bgcolor:"action.hover"}}}var AUi=S(re(),1);var dRt=S(_(),1),Ahe=ot((0,dRt.jsx)("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub");var DAn=/^([^/\s]+)\/([^/\s]+)#(\d+)$/;function Lhe(e){let t=DAn.exec(e);if(!t)return;let[,r,n,o]=t;return`https://github.com/${r}/${n}/issues/${o}`}var MAn=/^[^/\s]+\/[^/\s]+#(\d+)$/;function fRt(e){let t=MAn.exec(e);return t?`#${t[1]}`:e}var NAn=/^([^/\s]+)\/([^/\s]+)#(\d+)$/;function pRt(e,t){let r=NAn.exec(e);if(!r||!t)return e;let[,n,o,i]=r;return`github.com/${n}/${o}`.toLowerCase()===t.toLowerCase()?`#${i}`:e}var rBe=S(_(),1),hRt={height:18,fontSize:"0.65rem"};function mRt({label:e,url:t,title:r}){return t?(0,rBe.jsx)(yn,{label:e,title:r,size:"small",sx:hRt,clickable:!0,component:"a",href:t,target:"_blank",rel:"noopener",onClick:n=>n.stopPropagation()}):(0,rBe.jsx)(yn,{label:e,title:r,size:"small",sx:hRt,clickable:!1,onClick:n=>n.stopPropagation()})}var hB=S(_(),1),gRt={display:"inline-flex",alignItems:"center",gap:.375,whiteSpace:"nowrap","& svg":{fontSize:14}};function yRt({icon:e,label:t,title:r,url:n}){return n?(0,hB.jsx)(lr,{title:r,children:(0,hB.jsxs)(Ur,{href:n,target:"_blank",rel:"noopener",underline:"hover",sx:gRt,children:[e,t]})}):(0,hB.jsx)(lr,{title:r,children:(0,hB.jsxs)(H,{component:"span",sx:{...gRt,color:"text.disabled"},children:[e,t]})})}var bRt=S(_(),1),OAn={color:"primary.main",opacity:.85,whiteSpace:"nowrap"};function vRt({label:e,url:t,title:r}){return t?(0,bRt.jsx)(Ur,{href:t,title:r,target:"_blank",rel:"noopener",underline:"hover",sx:OAn,onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:e}):e}var mB=S(_(),1),xRt={fontSize:"0.875rem"};function Ihe({label:e,url:t,variant:r="link",icon:n,title:o}){return r==="chip"?(0,mB.jsx)(mRt,{label:e,url:t,title:o}):r==="token"?(0,mB.jsx)(vRt,{label:e,url:t,title:o}):r==="icon"?(0,mB.jsx)(yRt,{icon:n,label:e,title:o??e,url:t}):t?(0,mB.jsx)(Ur,{href:t,target:"_blank",rel:"noopener",onClick:i=>i.stopPropagation(),sx:xRt,children:e}):(0,mB.jsx)(be,{variant:"body2",color:"text.disabled",sx:xRt,children:e})}var nBe=S(_(),1);function cE({githubIssue:e,origin:t,variant:r="link"}){return e?(0,nBe.jsx)(Ihe,{label:r==="link"?pRt(e,t):fRt(e),title:e,url:Lhe(e),icon:(0,nBe.jsx)(Ahe,{}),variant:r}):null}var Dhe=S(re(),1);function SRt(){let[e,t]=(0,Dhe.useState)(null);return(0,Dhe.useEffect)(()=>{let r=!1;return(async()=>{try{let o=await(await fetch("/api/jira-site")).json();r||t(o?.site??null)}catch{r||t(null)}})(),()=>{r=!0}},[]),e}var TRt=S(_(),1);function gB({jiraKey:e,variant:t="link"}){let r=SRt();if(!e)return null;let n=r?`https://${r}/browse/${e}`:void 0;return(0,TRt.jsx)(Ihe,{label:e,url:n,variant:t})}var oBe=S(_(),1);function Mhe({tracker:e,variant:t="link"}){return e?.jiraKey?(0,oBe.jsx)(gB,{jiraKey:e.jiraKey,variant:t}):e?.githubIssue?(0,oBe.jsx)(cE,{githubIssue:e.githubIssue,origin:e.origin,variant:t}):null}var iBe=class extends Error{constructor(){super(...arguments);yr(this,"name","InvalidItemIdError")}};function hn(e){return`a${e}`}var BAn=/^a?(\d+)$/;function uE(e){let t=BAn.exec(e.trim());if(!t)throw new iBe(`Invalid backlog item id "${e}" (e.g. a574 or 574).`);return Number.parseInt(t[1],10)}function Dr(e,t){if(!t)return e;let r=e.includes("?")?"&":"?";return`${e}${r}node=${encodeURIComponent(t)}`}function xc(e,t,r){if(!t)return Dr(e,r);let n=e.includes("?")?"&":"?";return Dr(`${e}${n}cwd=${encodeURIComponent(t)}`,r)}function qd(e,t,r){return xc(`/backlog/items/${hn(e)}`,t,t&&r)}function $An(e,t){if(t==="neutral")return{color:e.palette.text.secondary,borderColor:e.palette.divider};let{main:r}=e.palette[t];return{color:r,borderColor:Or(r,.35)}}function Go(e){return t=>({display:"inline-block",fontFamily:t.typography.fontFamilyMono,fontSize:10,fontWeight:400,lineHeight:"16px",px:"5px",border:1,borderRadius:"4px",whiteSpace:"nowrap",opacity:1,...$An(t,e)})}var Nhe=S(re(),1),Sc=(0,Nhe.createContext)(void 0);function ur(){return(0,Nhe.useContext)(Sc)}var CRt=S(_(),1),FAn=[Go("primary"),{flexShrink:0,textDecoration:"none"}],wRt=e=>e.stopPropagation();function Ohe({itemId:e,cwd:t}){let r=ur();return(0,CRt.jsx)(H,{component:wa,to:qd(e,t,r),onMouseDown:wRt,onClick:wRt,sx:FAn,children:hn(e)})}var zAn={claude:"Claude","claude-sdk":"Claude (SDK)",codex:"Codex",pi:"pi"},HAn={claude:"Claude Code","claude-sdk":"Claude Code",codex:"Codex",pi:"pi"},Qg="claude";function jd(e){return e??Qg}function Ei(e){let t=jd(e);return zAn[t]??t}function kRt(e){let t=jd(e);return HAn[t]??t}var _Rt=S(_(),1),UAn=Go("neutral");function Bhe({harness:e}){return jd(e)===Qg?null:(0,_Rt.jsx)(H,{component:"span",sx:UAn,children:Ei(e).toLowerCase()})}var WAn=["update"];function yB(e){return!e||!WAn.includes(e)}function Aa(e){if(!e)return"";let t=e.split(/[/\\]/).filter(Boolean);return t[t.length-1]??""}function Q0(e){return e.repoGroup?.origin||e.cwd||void 0}function Ul(e){return e.repoGroup?.clone||e.cwd||void 0}function vB(e,t){if(!e)return e;for(let r of t){let n=r.repoGroup;if(n&&(n.clone===e||r.cwd===e))return n.origin}return e}var Hhe=S(re(),1);var ERt="";function aBe(e){ERt=e.replace(/\/+$/,"")}function fT(e){return`${ERt}${e}`}function RRt(e){let t=new URL(fT(e),location.href);return t.protocol=t.protocol==="https:"?"wss:":"ws:",t.toString()}var PRt=new WeakSet;function s6(e){typeof e=="object"&&e!==null&&PRt.add(e)}function VQ(e){return typeof e=="object"&&e!==null&&PRt.has(e)}var VAn="/api/client-errors",uBe=1e3,GAn=6e4,qAn=1e4,jAn=50,YAn=500,bB=[],sBe,lBe=!1,$he=uBe;function cBe(e){sBe||lBe||(sBe=setTimeout(()=>{sBe=void 0,XAn()},e))}async function KAn(e){try{return(await fetch(fT(VAn),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({failures:e}),signal:AbortSignal.timeout(qAn)})).ok}catch{return!1}}async function XAn(){let e=bB.slice(0,jAn);if(e.length===0)return;lBe=!0;let t=await KAn(e);if(lBe=!1,t){bB=bB.slice(e.length),$he=uBe,bB.length>0&&cBe(0);return}$he=Math.min($he*2,GAn),cBe($he)}function ARt(e){bB=[...bB,e].slice(-YAn),cBe(uBe)}var ZAn=100,fBe=[],dBe=new Set;function LRt(e){fBe=e;for(let t of dBe)t()}function xB(e){LRt([e,...fBe].slice(0,ZAn)),ARt(e)}function pBe(){return fBe}function IRt(){LRt([])}function DRt(e){return dBe.add(e),()=>{dBe.delete(e)}}function QAn(e){return new URL(e,"http://local").searchParams.get("node")??void 0}function MRt(e,t,r){let n=Date.now();return o=>{r&&xB({at:new Date(n).toISOString(),method:(t??"GET").toUpperCase(),path:e,base:fT("")||location.origin,node:QAn(e),durationMs:Date.now()-n,...o})}}var JAn="x-assist-trace-id";async function e6n(e){try{let t=await e.clone().json();if(t&&typeof t=="object"&&"error"in t){let{error:r}=t;if(typeof r=="string"&&r)return r}}catch{}}async function Fhe(e){let t=await e6n(e)??(e.statusText||void 0),r=e.headers?.get(JAn);return r?t?`${t} (trace=${r})`:`trace=${r}`:t}function NRt(e,t){let r=new AbortController,n=()=>r.abort(e?.reason);e?.aborted?n():e?.addEventListener("abort",n,{once:!0});let o=setTimeout(()=>r.abort(new DOMException(`timed out after ${t/1e3}s`,"TimeoutError")),t);return{signal:r.signal,clear:()=>{clearTimeout(o),e?.removeEventListener("abort",n)}}}var t6n=3e4;function r6n(e){return e instanceof DOMException&&e.name==="TimeoutError"}async function Ut(e,t={}){let{timeoutMs:r=t6n,capture:n=!0,blipGate:o,signal:i,...a}=t,{signal:s,clear:l}=NRt(i,r),u=MRt(e,a.method,n);try{let d=await fetch(fT(e),{...a,signal:s});return d.ok?o?.reset():(o?.shouldRecord(d.status)??!0)&&u({status:d.status,error:await Fhe(d)}),d}catch(d){let f=s.aborted?s.reason:d;throw(!s.aborted||r6n(f))&&(u({error:f instanceof Error?f.message:String(f)}),s6(f)),f}finally{l()}}var n6n={error:"ERROR",rejection:"REJECT",caught:"CAUGHT"};function GQ(e,t){xB({at:new Date().toISOString(),kind:e,method:n6n[e],path:location.pathname+location.search,base:location.origin,error:t,durationMs:0})}function xr(e,t){if(VQ(e))return;s6(e);let r=e instanceof Error?e.message:String(e);GQ("caught",`${t}: ${r}`)}var ORt=new Map;function zhe(e,t){let r=`${t??""}\0${e??""}`,n=ORt.get(r);return n||(n=(async()=>{let i=await(await Ut(xc("/api/items",e,t))).json(),a=new Map;for(let s of i)!s.jiraKey&&!s.githubIssue||a.set(s.id,{jiraKey:s.jiraKey,githubIssue:s.githubIssue,origin:s.origin});return a})().catch(o=>(xr(o,"item trackers"),new Map)),ORt.set(r,n)),n}function Uhe(e){let[t,r]=(0,Hhe.useState)(()=>new Map),n=ur();return(0,Hhe.useEffect)(()=>{let o=!1;return zhe(e,n).then(i=>{o||r(i)}),()=>{o=!0}},[e,n]),o=>o==null?void 0:t.get(o)}var hBe=S(_(),1),o6n=Go("neutral");function Whe({node:e}){return e?(0,hBe.jsx)(lr,{title:`Running on ${e}`,children:(0,hBe.jsx)(H,{component:"span",sx:o6n,children:e})}):null}var J0=S(_(),1),BRt={height:18,fontSize:"0.65rem"};function $Rt({session:e}){let t=yB(e.sessionType)?Aa(e.cwd):"",r=Uhe(e.cwd);return(0,J0.jsxs)(J0.Fragment,{children:[t&&(0,J0.jsx)(yn,{label:t,size:"small",sx:BRt}),(0,J0.jsx)(Bhe,{harness:e.harness}),(0,J0.jsx)(Whe,{node:e.node}),e.sessionType&&e.sessionType!=="next"&&(0,J0.jsx)(yn,{label:e.sessionType,size:"small",color:"primary",variant:"outlined",sx:BRt}),e.itemId!=null&&(0,J0.jsx)(Ohe,{itemId:e.itemId,cwd:Ul(e)}),(0,J0.jsx)(Mhe,{variant:"chip",tracker:r(e.itemId)})]})}function lo(e){let t=Date.now()-new Date(e).getTime(),r=Math.floor(t/1e3);if(r<60)return"just now";let n=Math.floor(r/60);if(n<60)return`${n}m ago`;let o=Math.floor(n/60);if(o<24)return`${o}h ago`;let i=Math.floor(o/24);return i<30?`${i}d ago`:`${Math.floor(i/30)}mo ago`}var FRt=S(_(),1);function ca({children:e}){let t=r=>r.stopPropagation();return(0,FRt.jsx)(H,{sx:{display:"contents"},onClick:t,onMouseDown:t,onTouchStart:t,children:e})}var SB=S(re(),1),i6n=1200;function dE(e){let[t,r]=(0,SB.useState)(!1),n=(0,SB.useRef)(void 0);return(0,SB.useEffect)(()=>()=>clearTimeout(n.current),[]),{copied:t,copy:()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),clearTimeout(n.current),n.current=setTimeout(()=>r(!1),i6n)})}}}var qQ=S(_(),1);function zRt({sessionId:e,harness:t}){let{copied:r,copy:n}=dE(e),o=i=>{i.stopPropagation(),n()};return(0,qQ.jsx)(ca,{children:(0,qQ.jsx)(lr,{title:r?"Copied!":`Copy ${Ei(t)} session id`,open:r||void 0,children:(0,qQ.jsx)(Vt,{onClick:o,sx:{borderRadius:.5,px:.25},children:(0,qQ.jsx)(be,{variant:"caption",color:"text.disabled",sx:{fontFamily:"fontFamilyMono"},children:e.slice(0,8)})})})})}var jQ=S(_(),1);function HRt({session:e}){return(0,jQ.jsxs)(H,{sx:{display:"flex",alignItems:"center",gap:1,alignSelf:"flex-end"},children:[e.sessionId&&(0,jQ.jsx)(zRt,{sessionId:e.sessionId,harness:e.harness}),(0,jQ.jsx)(be,{variant:"caption",color:"text.disabled",children:lo(e.lastActivity??e.timestamp)})]})}var URt=S(_(),1);function Vhe({children:e}){return(0,URt.jsx)(H,{component:"mark",sx:{bgcolor:"warning.main",color:"warning.contrastText",borderRadius:.5,px:.25},children:e})}var Ghe=S(_(),1);function WRt({snippet:e}){return(0,Ghe.jsxs)(be,{variant:"caption",sx:{color:"text.secondary",overflowWrap:"anywhere"},children:[e.before,(0,Ghe.jsx)(Vhe,{children:e.match}),e.after]})}function VRt(e){return e.prompt||e.name}var l6=S(_(),1);function GRt({session:e}){return(0,l6.jsxs)(l6.Fragment,{children:[e.title&&(0,l6.jsx)(be,{variant:"body2",sx:{color:"text.primary",fontWeight:500,overflowWrap:"anywhere"},children:e.title}),(0,l6.jsx)(be,{variant:e.title?"caption":"body2",sx:{color:e.title?"text.secondary":"text.primary",overflowWrap:"anywhere"},children:VRt(e)})]})}var Df=S(_(),1);function a6n({onResume:e}){return(0,Df.jsx)(Mt,{size:"small",onClick:t=>{t.stopPropagation(),e()},title:"Resume",sx:{color:"text.disabled","&:hover":{color:"text.primary"}},children:(0,Df.jsx)(Z0,{sx:{fontSize:14}})})}function qRt({session:e,selected:t=!1,onView:r,onResume:n}){return(0,Df.jsx)(Sc.Provider,{value:e.node,children:(0,Df.jsx)(Vt,{onClick:()=>r(e),sx:Phe(t),"aria-current":t||void 0,children:(0,Df.jsxs)(H,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[(0,Df.jsxs)(H,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,Df.jsx)($Rt,{session:e}),(0,Df.jsx)(H,{sx:{flex:1}}),(0,Df.jsx)(ca,{children:(0,Df.jsx)(a6n,{onResume:()=>n(e)})})]}),(0,Df.jsx)(GRt,{session:e}),e.snippet&&(0,Df.jsx)(WRt,{snippet:e.snippet}),(0,Df.jsx)(HRt,{session:e})]})})})}var jhe=S(_(),1);function qhe({sessions:e,viewingId:t,onView:r,onResume:n,empty:o}){return(0,jhe.jsxs)(H,{sx:{flex:1,overflow:"auto",p:1},children:[e.map(i=>(0,jhe.jsx)(qRt,{session:i,selected:i.sessionId===t,onView:r,onResume:n},i.sessionId)),e.length===0&&o]})}var jRt=S(_(),1);function TB({children:e,color:t="text.disabled"}){return(0,jRt.jsx)(be,{variant:"caption",color:t,role:"status",sx:{display:"block",textAlign:"center",p:2},children:e})}var wB=S(_(),1);function YRt({search:e,viewingId:t,...r}){return e.status==="loading"?(0,wB.jsx)(TB,{children:"Searching\u2026"}):e.status==="error"?(0,wB.jsxs)(TB,{color:"error.main",children:["Search failed: ",e.message]}):(0,wB.jsx)(qhe,{sessions:e.sessions,viewingId:t,empty:(0,wB.jsx)(TB,{children:"No sessions match"}),...r})}var Yhe=S(re(),1);async function KRt(e,t,r,n){let o=await Ut(Dr(`/api/history/search?cwd=${encodeURIComponent(e)}&q=${encodeURIComponent(t)}`,r),{signal:n}),i=await o.json().catch(()=>({}));if(!o.ok)throw new Error(i.error??`HTTP ${o.status}`);let a=Array.isArray(i.sessions)?i.sessions:[];return r?a.map(s=>({...s,node:r})):a}var s6n=300;function XRt(e,t,r){let n=r.trim(),[o,i]=(0,Yhe.useState)({status:"idle"});return(0,Yhe.useEffect)(()=>{if(!e||!n){i({status:"idle"});return}i({status:"loading"});let a=new AbortController,s=setTimeout(()=>{KRt(e,n,t,a.signal).then(l=>{a.signal.aborted||i({status:"done",sessions:l})},l=>{if(a.signal.aborted)return;let u=l instanceof Error?l.message:String(l);i({status:"error",message:u})})},s6n);return()=>{clearTimeout(s),a.abort()}},[e,t,n]),o}var Khe=S(re(),1),YQ=(0,Khe.createContext)({repos:[],selectedCwd:"",worktreeCwd:"",setSelectedCwd:()=>{},cloneOn:e=>e,originOf:()=>{}});function _n(){return(0,Khe.useContext)(YQ)}var c6=S(_(),1);function ZRt({sessions:e,...t}){let{selectedCwd:r,selectedNode:n}=_n(),{query:o,setQuery:i}=WQ(),a=XRt(r,n,o),s=vB(r,e),l=r?e.filter(u=>Q0(u)===s||Ul(u)===r):[];return(0,c6.jsxs)(H,{sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[r&&(0,c6.jsx)(lE,{value:o,onChange:i,placeholder:"Search history..."}),a.status==="idle"?(0,c6.jsx)(qhe,{sessions:l,empty:(0,c6.jsx)(TB,{children:"No history for this repo"}),...t}):(0,c6.jsx)(YRt,{search:a,...t,onView:u=>t.onView(u,o.trim())})]})}var b3t=S(re(),1);function QRt(e,t,r){if(e.length===0)return null;let n=t===null?-1:e.indexOf(t);return n===-1?r===1?e[0]:e.at(-1):e[(n+r+e.length)%e.length]}var mBe=null;function Xhe(e){mBe=e,e.focus({preventScroll:!0})}function fE(){let e=globalThis.document;return e.querySelector('[role="dialog"][aria-modal="true"]')?!0:mBe!==null&&e.activeElement===mBe}function Zhe(e){let t=globalThis.document.querySelector(`[data-session-id="${e}"]`);t&&Xhe(t)}function Qhe(e){globalThis.requestAnimationFrame(()=>{globalThis.document.querySelector(`[data-session-id="${e}"]`)?.scrollIntoView({block:"nearest"})})}function Jhe(e){return e.key==="Tab"&&!e.ctrlKey&&!e.altKey&&!e.metaKey}var u6=S(re(),1);var JRt="assist:group-collapse",gBe=new Set;function yBe(){try{return localStorage.getItem(JRt)??""}catch{return""}}function vBe(e){if(!e)return{};try{let t=JSON.parse(e);return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([,r])=>r&&typeof r=="object"))}catch{return{}}}function e3t(e){try{localStorage.setItem(JRt,JSON.stringify(e))}catch{}for(let t of gBe)t()}function l6n(e,t){e3t({...vBe(yBe()),[e]:t})}function c6n(e){let t=vBe(yBe()),r=Object.fromEntries(Object.entries(t).filter(([n])=>!e.includes(n)));Object.keys(r).length!==Object.keys(t).length&&e3t(r)}function u6n(e){return gBe.add(e),()=>{gBe.delete(e)}}var pT={getRaw:yBe,parse:vBe,setChoice:l6n,removeChoices:c6n,subscribe:u6n};function CB(){let e=(0,u6.useSyncExternalStore)(pT.subscribe,pT.getRaw),t=(0,u6.useMemo)(()=>pT.parse(e),[e]),r=(0,u6.useCallback)(n=>{let o=t[n];return o!==void 0&&"collapsedAt"in o},[t]);return(0,u6.useMemo)(()=>({isCollapsed:r,setCollapsed:(n,o)=>pT.setChoice(n,o?{collapsedAt:Date.now()}:{openedAt:Date.now()})}),[r])}var hT=S(re(),1);function d6n(e,t){let r=new URLSearchParams;e&&r.set("q",e),t&&t!=="todo"&&r.set("filter",t);let n=r.toString();return n?`/api/items?${n}`:"/api/items"}async function pE({query:e,cwd:t,node:r,signal:n,filter:o}={}){let i=await Ut(xc(d6n(e,o),t,r),{signal:n});if(!i.ok){let a=await i.json().catch(()=>null);throw new Error(a?.error??`HTTP ${i.status}`)}return i.json()}function KQ(e){let t=e.activity?.itemId;if(!(!e.cwd||e.activity?.kind!=="backlog"||t==null))return{cwd:e.cwd,itemId:t}}function XQ(e,t){return`${e}::${t}`}function t3t(e){let t=new Set;for(let r of e){let n=KQ(r);n&&t.add(n.cwd)}return[...t].sort()}async function f6n(e){try{return(await pE({cwd:e,filter:"all"})).filter(r=>r.starred).map(r=>XQ(e,r.id))}catch(t){return xr(t,"starred keys"),[]}}async function r3t(e){let t=await Promise.all(e.map(f6n));return new Set(t.flat())}var rme=S(re(),1);var n3t="/api/backlog/docs-refresh";async function eme(e,t,r){let n=await Ut(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok)throw new Error(`${t} ${e} failed: ${n.status}`);return n.json()}async function o3t(e,t,r){await Ut(xc(`/api/items/${hn(e)}`,t,r),{method:"DELETE"})}function kB(e,t,r,n){return eme(xc(`/api/items/${hn(e)}`,r,n),"PATCH",{status:t})}function tme(e,t,r,n){return eme(xc(`/api/items/${hn(e)}/star`,r,n),"POST",{starred:t})}function i3t(e,t,r,n,o){return eme(xc(`/api/items/${hn(e)}/rewind`,n,o),"POST",{phase:t,reason:r})}async function a3t(e,t,r){return(await Ut(xc(n3t,e,t),{signal:r})).json()}function s3t(e,t){return eme(xc(n3t,e,t),"POST",{})}function p6n(e,t,r){let n=new Set(e);return r?n.add(t):n.delete(t),n}function l3t(e,t){let r=KQ(t);return r?e.has(XQ(r.cwd,r.itemId)):t.starred??!1}function c3t(e,t,r){let n=KQ(r);if(!n){t(r.id,!(r.starred??!1));return}let o=XQ(n.cwd,n.itemId);e(i=>{let a=!i.has(o);return tme(n.itemId,a,n.cwd),p6n(i,o,a)})}function h6n(e,t){let r=!1,n=e?e.split("|"):[];return r3t(n).then(o=>{r||t(o)}),()=>{r=!0}}function u3t(e){let[t,r]=(0,rme.useState)(new Set);return(0,rme.useEffect)(()=>h6n(e,r),[e]),[t,r]}var f3t=S(_(),1),d3t=(0,hT.createContext)(null);function nme({sessions:e,setSessionStarred:t,children:r}){let n=t3t(e).join("|"),[o,i]=u3t(n),a=(0,hT.useCallback)(u=>l3t(o,u),[o]),s=(0,hT.useCallback)(u=>c3t(i,t,u),[i,t]),l=(0,hT.useMemo)(()=>({isStarred:a,toggleStar:s}),[a,s]);return(0,f3t.jsx)(d3t.Provider,{value:l,children:r})}function Jg(){let e=(0,hT.useContext)(d3t);if(!e)throw new Error("useStarredSessions must be used within a StarredSessionsProvider");return e}function ome(e){return e.flatMap(t=>t.kind==="single"?[t.session]:t.rows.flatMap(r=>[r.session,...r.children]))}var bBe="assist:group-order";var d6=null;function m6n(){if(d6)return d6;try{let e=JSON.parse(localStorage.getItem(bBe)??"[]");d6=Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}catch{d6=[]}return d6}function g6n(e){d6=e;try{localStorage.setItem(bBe,JSON.stringify(e))}catch{}}function y6n(e,t){let r=e.length-200;return r<=0?e:e.filter(n=>t.has(n)||r--<=0)}function v6n(e){let t=m6n(),r=e.filter(o=>!t.includes(o)),n=r.length>0?y6n([...t,...r],new Set(e)):t;return n!==t&&g6n(n),new Map(n.map((o,i)=>[o,i]))}function b6n(){d6=null;try{localStorage.removeItem(bBe)}catch{}}var p3t={rank:v6n,clear:b6n};function h3t(e){let t=new Map;for(let n of e){let o=Q0(n)??` nogroup:${n.id}`,i=t.get(o);if(i){i.members.push(n);continue}t.set(o,{key:o,label:Aa(Ul(n)??o),members:[n]})}let r=p3t.rank([...t.keys()]);return[...t.values()].sort((n,o)=>(r.get(n.key)??0)-(r.get(o.key)??0))}function m3t(e){let t=new Map(e.map(o=>[xBe(o,o.id),o])),r=x6n(e),n=new Map;for(let o of e){let i=S6n(o,t)??C6n(o,r);i&&n.set(o,i)}return n}function x6n(e){let t=new Map;for(let r of e){let n=y3t(r);!n||!g3t(r)||t.has(n)||t.set(n,r)}return t}function S6n(e,t){let r=e.launchedFrom?t.get(xBe(e,e.launchedFrom)):void 0;if(!(!r||r===e))return w6n(e,r)||T6n(e)?r:void 0}function T6n(e){let[t,r]=e.assistArgs??[];return t==="backlog"&&r==="run-phase"}function w6n(e,t){return e.cwd!==void 0&&e.cwd===t.cwd&&e.node===t.node}function C6n(e,t){if(g3t(e))return;let r=y3t(e),n=r?t.get(r):void 0;return n===e?void 0:n}function g3t(e){return e.activity?.kind==="backlog"}function y3t(e){let{cwd:t,repoGroup:r}=e;if(!(!t||!r||r.clone===t))return xBe(e,t)}function xBe(e,t){return JSON.stringify([e.node??null,t])}function ime(e){let t=m3t(e),r=new Map;for(let i of e){let a=k6n(i,t);a&&r.set(i,a)}let n=new Map,o=[];for(let i of e){if(r.has(i))continue;let a={session:i,children:[]};n.set(i,a),o.push(a)}for(let i of e){let a=r.get(i);a&&n.get(a)?.children.push(i)}return o}function k6n(e,t){let r=new Set([e]),n=t.get(e);for(;n;){if(r.has(n))return;let o=t.get(n);if(!o)return n;r.add(n),n=o}}function SBe(e,t){return[...e.filter(r=>t(r)),...e.filter(r=>!t(r))]}function ame(e,t,r=2){let n=h3t(e).map(({key:o,label:i,members:a})=>a.length<r?{kind:"single",session:a[0]}:{kind:"repo",key:o,label:i,rows:SBe(ime(a),s=>v3t(s).some(t))});return SBe(n,o=>_6n(o).some(t))}function v3t(e){return[e.session,...e.children]}function _6n(e){return e.kind==="repo"?e.rows.flatMap(v3t):[e.session]}var E6n=()=>!1;function sme(e,t,r=E6n,n=2){return ome(ame(e,t,n).filter(o=>o.kind==="single"||!r(o.key)))}function x3t({sessions:e,onSelect:t}){let{isStarred:r}=Jg(),{isCollapsed:n}=CB();return(0,b3t.useCallback)(o=>{if(!Jhe(o.nativeEvent))return;let i=o.target.closest("[data-session-id]");if(!i)return;let a=sme(e,r,n,1).map(u=>u.id),s=i.getAttribute("data-session-id"),l=QRt(a,s,o.shiftKey?-1:1);!l||l===s||(o.preventDefault(),t(l),Zhe(l),Qhe(l))},[e,r,n,t])}var TBe=S(_(),1),R6n={flex:1,overflow:"auto"},P6n={py:.5};function S3t({sessions:e,onSelect:t,children:r}){let n=x3t({sessions:e,onSelect:t});return(0,TBe.jsx)(H,{sx:R6n,onKeyDown:n,children:(0,TBe.jsx)(H,{sx:P6n,children:r})})}var w3t=S(_(),1),A6n={display:"block",textAlign:"center",p:2};function T3t(){return(0,w3t.jsx)(be,{variant:"caption",color:"text.disabled",sx:A6n,children:"No sessions yet"})}var C3t=S(_(),1),_o=ot((0,C3t.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var k3t=S(_(),1),_B=ot((0,k3t.jsx)("path",{d:"M12 7c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1s-1-.45-1-1V8c0-.55.45-1 1-1m-.01-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m1-3h-2v-2h2z"}),"ErrorOutlineRounded");var rb=S(_(),1),L6n={...Phe(!1),cursor:"default",position:"relative"},I6n={position:"absolute",top:4,right:4,color:"text.disabled","&:hover":{color:"text.primary"}},D6n={display:"flex",alignItems:"center",gap:1,pr:3},M6n={color:"text.primary",overflowWrap:"anywhere"};function N6n(e){return{display:"block",mt:.5,color:e?"error.main":"text.secondary",overflowWrap:"anywhere"}}function O6n(e){return e.node?`Starting session on ${e.node}\u2026`:"Starting session\u2026"}function _3t({launch:e,onDismiss:t}){let r=e.status==="error";return(0,rb.jsxs)(H,{sx:L6n,children:[(0,rb.jsx)(Mt,{size:"small",onClick:()=>t(e.id),title:"Dismiss",sx:I6n,children:(0,rb.jsx)(_o,{sx:{fontSize:16}})}),(0,rb.jsxs)(H,{sx:D6n,children:[r?(0,rb.jsx)(_B,{color:"error",sx:{fontSize:18}}):(0,rb.jsx)(io,{size:16}),(0,rb.jsx)(be,{variant:"body2",sx:M6n,children:e.title})]}),(0,rb.jsx)(be,{variant:"caption",sx:N6n(r),children:r?e.error:O6n(e)})]})}function E3t(e){return new Set(e.filter(t=>t.cwd&&t.cwd===t.repoGroup?.clone).map(t=>t.id))}function wBe(e){return e.commandType==="run"&&e.server===!0&&e.status!=="done"&&e.status!=="error"}function R3t(e){return e.filter(wBe)}var P3t=S(_(),1),lme=ot((0,P3t.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"Launch");var cme=S(re(),1),CBe=(0,cme.createContext)({nodes:null,names:[],visible:!1,selected:void 0,select:()=>{}});function ds(){return(0,cme.useContext)(CBe)}function B6n(e){return e?e.startsWith("/")?e:`/${e}`:""}function A3t(e,t,r,n="http",o){let i=t&&t!==r?.local?r?.links.find(s=>s.name===t):void 0,a=B6n(o);return i?{url:`${n}://${new URL(i.url).hostname}:${e}${a}`,remote:!0}:{url:`${n}://localhost:${e}${a}`,remote:!1}}var L3t=S(_(),1);function ume({port:e,node:t,protocol:r,urlPath:n}){let{nodes:o}=ds(),{url:i,remote:a}=A3t(e,t,o,r,n);return(0,L3t.jsxs)(Ur,{href:i,title:a?`Opens ${i} on ${t}; the dev server must listen on the tailnet (e.g. --host 0.0.0.0)`:i,target:"_blank",rel:"noopener noreferrer",color:"inherit",onMouseDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),children:[":",e]})}var nb=S(_(),1),$6n={display:"flex",alignItems:"center",gap:.5,px:"10px",py:.25,borderRadius:0,borderLeft:2,borderLeftColor:"success.main",bgcolor:"success.dark"},F6n={flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"success.contrastText"};function I3t({serving:e,onJump:t}){let r=Aa(e.cwd),n=r?` \xB7 ${r} \xB7 ${e.name}`:` \xB7 ${e.name}`,o=`${e.port?`serving :${e.port}`:"serving"}${n}`;return(0,nb.jsxs)(H,{sx:$6n,children:[(0,nb.jsxs)(be,{variant:"caption",title:o,sx:F6n,children:["serving",e.port?(0,nb.jsxs)(nb.Fragment,{children:[" ",(0,nb.jsx)(ume,{port:e.port,node:e.node,protocol:e.protocol,urlPath:e.urlPath})]}):null,n]}),(0,nb.jsx)(nt,{size:"small",startIcon:(0,nb.jsx)(lme,{sx:{fontSize:14}}),onClick:i=>{i.stopPropagation(),t()},sx:{color:"success.contrastText",minWidth:0},children:"Jump"})]})}var ZQ=S(_(),1);function D3t({sessions:e,onJump:t}){let r=R3t(e);return r.length===0?null:(0,ZQ.jsx)(ZQ.Fragment,{children:r.map(n=>(0,ZQ.jsx)(I3t,{serving:n,onJump:()=>t(n.id)},n.id))})}function M3t(e){return e.flatMap(t=>[t.session,...t.children])}var QQ=S(_(),1),z6n={position:"relative","&::before":{content:'""',position:"absolute",left:0,top:"-1px",width:"6px",height:"19.5px",borderLeft:1,borderBottom:1,borderColor:"divider"},"&:not(:last-of-type)::after":{content:'""',position:"absolute",left:0,top:0,bottom:"-1px",borderLeft:1,borderColor:"divider"}},H6n={ml:"13px"};function N3t({rows:e,renderCard:t}){let r=(n,o,i=!0)=>(0,QQ.jsx)(H,{sx:i?z6n:void 0,children:t(n,o)},n.id);return e.map(n=>n.children.length===0?r(n.session,void 0,!1):(0,QQ.jsxs)(H,{children:[r(n.session,n.children,!1),(0,QQ.jsx)(H,{sx:H6n,children:n.children.map(o=>r(o))})]},n.session.id))}var mT=S(_(),1);function Fo({onConfirm:e,onCancel:t,title:r="Confirm deletion",message:n="Are you sure you want to delete this item?",confirmLabel:o="Delete",confirmColor:i="error",busy:a=!1,autoFocusConfirm:s=!1}){return(0,mT.jsxs)(Ra,{open:!0,onClose:a?void 0:t,maxWidth:"xs",fullWidth:!0,children:[(0,mT.jsx)(Bl,{children:r}),(0,mT.jsx)(Ol,{children:(0,mT.jsx)(T_,{children:n})}),(0,mT.jsxs)(Qc,{children:[(0,mT.jsx)(nt,{onClick:t,disabled:a,children:"Cancel"}),(0,mT.jsx)(nt,{variant:"contained",color:i,onClick:e,loading:a,autoFocus:s,children:o})]})]})}var O3t=S(re(),1),U6n="(Shift skips confirmation)";function fs(e,{needsConfirm:t=!0,onOpen:r}={}){let[n,o]=(0,O3t.useState)(!1),i=r??(()=>o(!0));return{confirming:n,close:()=>o(!1),triggerHandlers:{onClick:a=>{a.stopPropagation(),a.shiftKey||!t?e():i()},onKeyDown:a=>{a.key!=="Enter"||!a.shiftKey||(a.preventDefault(),a.stopPropagation(),e())}},withHint:a=>`${a} ${U6n}`}}var gT=S(_(),1),kBe="group-close",W6n={p:"2px",my:"-2px",opacity:0,color:"text.disabled","&:hover":{color:"text.primary"},"&:focus-visible":{opacity:1}};function B3t({label:e,sessionIds:t,onDismiss:r}){let n=()=>{for(let d of t)r(d)},{confirming:o,close:i,triggerHandlers:a,withHint:s}=fs(n),l=t.length,u=l===1?"session":"sessions";return(0,gT.jsxs)(gT.Fragment,{children:[(0,gT.jsx)(Mt,{size:"small",className:kBe,...a,title:s(`Close all sessions in ${e}`),sx:W6n,children:(0,gT.jsx)(_o,{sx:{fontSize:14}})}),o&&(0,gT.jsx)(ca,{children:(0,gT.jsx)(Fo,{title:`Close ${e}`,message:`This will close all ${l} ${u} in ${e}, including starred and nested sessions. Running sessions will be stopped.`,confirmLabel:`Close ${l}`,onConfirm:()=>{i(),n()},onCancel:i})})]})}var V6n=new Set(["question","backlog-item","github-issue","github-issue-edit","github-issue-comment","pr-comment"]);function Qi(e){let t=e.pendingPrPreview;return t&&t.kind!=="show"&&(e.status==="running"||e.status==="waiting")?V6n.has(t.kind)?"question":t.kind==="design"?"design":t.kind==="check"?"check":"waiting":e.status}var G6n=["check","waiting","running","done"];function q6n(e){return e==="question"||e==="design"?"waiting":e}function $3t(e){return G6n.map(t=>({status:t,count:e.filter(r=>q6n(Qi(r))===t).length})).filter(t=>t.count>0)}var F3t={claude:{red:30,yellow:20},"claude-sdk":{red:30,yellow:20},codex:{red:75,yellow:50},pi:{red:30,yellow:20}};function z3t(e,t){let{red:r,yellow:n}=F3t[jd(t)]??F3t.claude;return e>=r?"red":e>=n?"yellow":"dim"}var Zu={running:"success.main",idle:"text.disabled",waiting:"warning.main",question:"warning.main",design:"warning.main",check:"warning.main",done:"info.main",error:"error.main",stopped:"text.secondary",parked:"text.secondary"};function dme(e,t){switch(z3t(e,t)){case"red":return"error.main";case"yellow":return"warning.main";default:return"text.disabled"}}var H3t={d:"M0.25 8C4.13 1.5 11.88 1.5 15.75 8C11.88 14.5 4.13 14.5 0.25 8ZM8 4.7A3.3 3.3 0 1 0 8 11.3A3.3 3.3 0 1 0 8 4.7ZM8 6.5A1.5 1.5 0 1 0 8 9.5A1.5 1.5 0 1 0 8 6.5Z",transform:"translate(8 8) scale(0.88) translate(-8 -8)",fillRule:"evenodd"};var _Be=S(_(),1),j6n={fontSize:"inherit",verticalAlign:"-0.125em"};function EBe({path:e,testId:t}){return(0,_Be.jsx)(B1,{viewBox:"0 0 16 16",sx:j6n,"data-testid":t,children:(0,_Be.jsx)("path",{...e})})}var U3t={d:"M-1.62 -3.93A4.25 4.25 0 0 0 -1.62 3.93V6.93H1.62V3.93A4.25 4.25 0 0 0 1.62 -3.93V0.25H-1.62Z",transform:"translate(8 8) scale(1.46) translate(0.9 -0.9) rotate(45)"};var hE={running:"\u25CF",idle:"\u25CF",waiting:"\u25C6",question:"?",done:"\u2713",error:"\u2715",stopped:"\u25CB",parked:"\u25CC"};var RBe=S(_(),1);function ob({status:e}){return e==="check"?(0,RBe.jsx)(EBe,{path:U3t,testId:"wrench-head"}):e==="design"?(0,RBe.jsx)(EBe,{path:H3t,testId:"eye"}):hE[e]}var EB=S(_(),1),Y6n={display:"flex",gap:1,flexShrink:0,color:"text.secondary",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"};function W3t({sessions:e}){return(0,EB.jsx)(H,{sx:Y6n,children:$3t(e).map(({status:t,count:r})=>(0,EB.jsxs)(be,{variant:"caption","data-tally":t,children:[(0,EB.jsx)(H,{component:"span",sx:{color:Zu[t]},children:(0,EB.jsx)(ob,{status:t})})," ",r," ",t]},t))})}var V3t=S(_(),1),zo=ot((0,V3t.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");var G3t=S(_(),1),La=ot((0,G3t.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var j3t=S(_(),1),K6n={fontSize:12,color:"text.secondary",flexShrink:0};function q3t({collapsed:e}){return(0,j3t.jsx)(e?zo:La,{sx:K6n})}var Y3t=S(_(),1),K3t=ot((0,Y3t.jsx)("path",{d:"M14 4v5c0 1.12.37 2.16 1 3H9c.65-.86 1-1.9 1-3V4zm3-2H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3V4h1c.55 0 1-.45 1-1s-.45-1-1-1"}),"PushPinOutlined");var mE=S(_(),1),X6n={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:600,lineHeight:"16px",letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},Z6n={fontSize:14,color:"text.disabled",flexShrink:0};function X3t({label:e,pinned:t}){return(0,mE.jsxs)(mE.Fragment,{children:[(0,mE.jsx)(be,{variant:"body1",title:e,sx:X6n,children:e}),t&&(0,mE.jsx)(lr,{title:"Collapsed by you. Stays collapsed until you open it.",children:(0,mE.jsx)(K3t,{"data-testid":"group-pinned","aria-label":"Collapsed by you",sx:Z6n})})]})}var PBe={toggle:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.75,justifyContent:"flex-start",textAlign:"left",borderRadius:.5,"&:focus-visible":{outline:1,outlineColor:"primary.main"}},count:{color:"text.disabled",fontVariantNumeric:"tabular-nums",fontFamily:"fontFamilyMono",fontSize:11,lineHeight:1}};var RB=S(_(),1);function Z3t({label:e,count:t,collapsedSummary:r,collapsed:n,pinned:o,onToggle:i}){return(0,RB.jsxs)(Vt,{"aria-expanded":!n,onClick:i,sx:PBe.toggle,children:[(0,RB.jsx)(q3t,{collapsed:n}),(0,RB.jsx)(X3t,{label:e,pinned:o}),n?r:(0,RB.jsx)(be,{variant:"caption",sx:PBe.count,children:t})]})}var PB=S(_(),1),Q6n={display:"flex",alignItems:"center",gap:.75,p:"8px 12px 4px",bgcolor:"background.paper",position:"sticky",top:0,zIndex:1,[`&:hover .${kBe}`]:{opacity:1}};function Q3t({label:e,sessions:t,collapsed:r,pinned:n,onToggle:o,onDismiss:i}){return(0,PB.jsxs)(H,{sx:Q6n,children:[(0,PB.jsx)(Z3t,{label:e,count:t.length,collapsedSummary:(0,PB.jsx)(W3t,{sessions:t}),collapsed:r,pinned:n,onToggle:o}),(0,PB.jsx)(B3t,{label:e,sessionIds:t.map(a=>a.id),onDismiss:i})]})}var fme=S(re(),1),ABe=(0,fme.createContext)(!1);function J3t(){return(0,fme.useContext)(ABe)}var JQ=S(_(),1),J6n={mb:.5};function ePt({groupKey:e,label:t,sessions:r,onDismiss:n,children:o}){let{isCollapsed:i,setCollapsed:a}=CB(),s=i(e);return(0,JQ.jsxs)(H,{sx:J6n,children:[(0,JQ.jsx)(Q3t,{label:t,sessions:r,collapsed:s,pinned:s,onToggle:()=>a(e,!s),onDismiss:n}),!s&&(0,JQ.jsx)(ABe.Provider,{value:!0,children:o})]})}function pme(e,t,r){if(t.length===0)return;let n=()=>{for(let o of t)r(o.id)};return{childCount:t.length,onDismissAll:()=>{r(e.id),n()},onDismissChildren:n}}function hme(e,t){return e.sdk?!1:!t.has(e.id)&&e.status!=="done"&&e.status!=="error"&&e.status!=="stopped"}function gE(e){let t=e.claudeSessionId??e.harnessSessionId;if(t)return e.harness?{conversationId:t,harness:e.harness}:{conversationId:t}}var yT="branch";function tPt(e,t){return[{value:"all",label:"All changes"},{value:"uncommitted",label:"Uncommitted"},...t?[{value:yT,label:"Branch",note:`vs ${t}`}]:[],...e.map(r=>({value:r.sha,label:r.title||r.sha.slice(0,7)}))]}function rPt(e,t){return e.find(r=>r.value===t)??{value:"all",label:"All changes"}}var mme=S(re(),1);var yE=S(re(),1);function nPt(e,t,r){let n=e[t];return n&&n.cwd===r.cwd&&n.scope===r.scope?LBe(e,t):{...e,[t]:{...r,mode:n?.mode??"half"}}}function LBe(e,t){let{[t]:r,...n}=e;return r?n:e}function oPt(e,t){let r=new Set(t),n=Object.entries(e).filter(([o])=>r.has(o));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function iPt(e,t,r){let n=e[t];return n?{...e,[t]:{...n,scope:r}}:e}function aPt(e,t){let r=e[t];if(!r)return e;let n=r.mode==="half"?"full":"half";return{...e,[t]:{...r,mode:n}}}function sPt(e,t){let[r,n]=(0,yE.useState)({}),o=e.join(" ");(0,yE.useEffect)(()=>{let a=o===""?[]:o.split(" ");n(s=>oPt(s,a))},[o]);let i=(0,yE.useCallback)((a,s)=>{t(a),n(l=>nPt(l,a,s))},[t]);return(0,yE.useMemo)(()=>({panelFor:a=>a===null?void 0:r[a],togglePanel:i,closePanel:a=>n(s=>LBe(s,a)),setPanelScope:(a,s)=>n(l=>iPt(l,a,s)),togglePanelMode:a=>n(s=>aPt(s,a))}),[r,i])}var uPt=S(_(),1),lPt=(0,mme.createContext)(null);function cPt({sessionIds:e,onActivateSession:t,children:r}){let n=sPt(e,t);return(0,uPt.jsx)(lPt.Provider,{value:n,children:r})}function ib(){let e=(0,mme.useContext)(lPt);if(!e)throw new Error("useDiffPanels must be used within a DiffPanelsProvider");return e}function gme(e,t,r){let{togglePanel:n}=ib(),o=ur();return i=>n(e,{cwd:t,conversation:r,scope:i,node:o})}var fPt=S(_(),1);function dPt({panelSessionId:e,cwd:t,conversation:r,defaultBranch:n}){let o=gme(e,t,r),i=`Diff against ${n}`;return(0,fPt.jsxs)(Ur,{component:"button",type:"button",title:i,"aria-label":i,onClick:()=>o(yT),variant:"caption",underline:"hover",color:"inherit",sx:{border:0,p:0,bgcolor:"transparent",cursor:"pointer",fontFamily:"fontFamilyMono",whiteSpace:"nowrap",color:"text.disabled","&:hover":{color:"text.primary"}},children:["vs ",n]})}function AB(){return/Mac|iPhone|iPad/.test(globalThis.navigator?.platform??"")}var eLn={Ctrl:"\u2303",Alt:"\u2325",Shift:"\u21E7",Mod:"\u2318",Meta:"\u2318"},tLn={Mod:"Ctrl"};function pPt(e,t=AB()){let r=t?eLn:tLn;return e.map(n=>r[n]??n)}function yme(e,t=AB()){return pPt(e,t).join(t?"":"+")}var hPt=S(_(),1),rLn={px:.5,border:1,borderColor:"grey.500",borderRadius:.5,fontFamily:"fontFamilyMono",fontSize:11,whiteSpace:"nowrap"};function vme({chords:e}){return e.map(t=>{let r=yme(t);return(0,hPt.jsx)(H,{component:"kbd",sx:rLn,children:r},r)})}var eJ=S(_(),1);function Yd({label:e,chords:t}){return(0,eJ.jsxs)(St,{direction:"row",spacing:.75,sx:{alignItems:"center"},children:[(0,eJ.jsx)("span",{children:e}),(0,eJ.jsx)(vme,{chords:t})]})}var nLn={"/":"Slash",".":"Period",",":"Comma",";":"Semicolon","'":"Quote","[":"BracketLeft","]":"BracketRight","\\":"Backslash","-":"Minus","=":"Equal","`":"Backquote"},oLn=["Enter","Space","Escape","Backspace","Delete","Insert","Home","End","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];function mPt(e){if(/^[a-z]$/i.test(e)){let n=e.toUpperCase();return{code:`Key${n}`,label:n}}if(/^\d$/.test(e))return{code:`Digit${e}`,label:e};let t=nLn[e];if(t)return{code:t,label:e};if(/^F([1-9]|1[0-2])$/i.test(e)){let n=e.toUpperCase();return{code:n,label:n}}let r=oLn.find(n=>n.toLowerCase()===e.toLowerCase());return r?{code:r,label:r}:void 0}var iLn={mod:"Mod",ctrl:"Ctrl",control:"Ctrl",alt:"Alt",option:"Alt",opt:"Alt",shift:"Shift",meta:"Meta",cmd:"Meta",command:"Meta",win:"Meta"},aLn=["Mod","Ctrl","Alt","Shift","Meta"];function gPt(e,t){let r=new Set;for(let n of e){let o=iLn[n.toLowerCase()];if(!o)return{ok:!1,error:`"${n}" is not a modifier in "${t}"`};if(r.has(o))return{ok:!1,error:`"${n}" is repeated in "${t}"`};r.add(o)}return[...r].some(n=>n!=="Shift")?r.has("Mod")&&(r.has("Ctrl")||r.has("Meta"))?{ok:!1,error:`"${t}" combines Mod with Ctrl or Meta, which Mod already means`}:{ok:!0,modifiers:aLn.filter(n=>r.has(n))}:{ok:!1,error:`"${t}" needs at least one of Mod, Ctrl, Alt or Meta`}}function yPt(e,{modifiersOnly:t=!1}={}){let r=e.split("+").map(s=>s.trim()),n=t?void 0:r.pop(),o=gPt(r,e);if(!o.ok)return o;let{modifiers:i}=o;if(n===void 0)return{ok:!0,chord:{modifiers:i}};let a=mPt(n);return a?{ok:!0,chord:{modifiers:i,key:a}}:{ok:!1,error:`"${n}" is not a key in "${e}"`}}function bme({modifiers:e,key:t},r,n=AB()){if(r.type!=="keydown"||t&&r.code!==t.code)return!1;let o=e.includes("Mod");return r.ctrlKey===(e.includes("Ctrl")||o&&!n)&&r.metaKey===(e.includes("Meta")||o&&n)&&r.altKey===e.includes("Alt")&&r.shiftKey===e.includes("Shift")}var sLn=/^Digit([1-6])$/;function tJ(e,t){if(!t.some(n=>bme(n,e)))return;let r=sLn.exec(e.code);return r?Number(r[1])-1:void 0}var LB={navTab:{label:"Switch top-level tab",group:"Navigate"},focusSidebar:{label:"Focus sidebar (backlog: last-selected session card)",group:"Navigate"},focusTerminal:{label:"Focus terminal (backlog: search / back)",group:"Navigate"},toggleDiff:{label:"Open / close diff panel, or focus preview pane",group:"Navigate"},focusRepoPicker:{label:"Focus repo picker",group:"Navigate"},openUpdates:{label:"Open nodes",group:"Navigate"},openConfig:{label:"Open config",group:"Navigate"},openMenu:{label:"Open menu",group:"Navigate"},cycleCards:{label:"Next / previous sidebar card",group:"Navigate"},nextWaiting:{label:"Next waiting session",group:"Sessions"},focusAddAgent:{label:"Focus add agent",group:"Sessions"},focusVsCode:{label:"Focus VS Code",group:"Sessions"},focusDone:{label:"Focus done",group:"Sessions"},newSession:{label:"New session",group:"Sessions"},quickOpen:{label:"Quick open file",group:"Files"},save:{label:"Save file",group:"Files"},shortcutsSheet:{label:"Keyboard shortcuts",group:"Help"}};var lLn="1\u20136",vPt=new WeakMap;function vE(e,t){let r=vPt.get(t);r||(r=new Map,vPt.set(t,r));let n=r.get(e);return n||(n=cLn(e,t),r.set(e,n)),n}function cLn(e,t){let{label:r,group:n}=LB[e];if(e==="cycleCards")return{label:r,group:n,chords:[["Tab"],["Shift","Tab"]],bound:[],matches:Jhe};let o=e==="navTab",i=t[e].flatMap(a=>{let s=yPt(a,{modifiersOnly:o});return s.ok?[s.chord]:[]});return{label:r,group:n,chords:i.map(a=>uLn(a)),bound:i,matches:o?a=>tJ(a,i)!==void 0:a=>i.some(s=>bme(s,a))}}function uLn({modifiers:e,key:t}){return[...e,t?.label??lLn]}var SPt=S(re(),1);var bPt={navTab:["Alt"],focusSidebar:["Alt+A"],focusTerminal:["Alt+S"],toggleDiff:["Alt+D"],focusRepoPicker:["Alt+R"],openUpdates:["Alt+Q"],openConfig:["Alt+W"],openMenu:["Alt+E"],focusAddAgent:["Alt+Z"],focusVsCode:["Alt+X"],focusDone:["Alt+C"],nextWaiting:["Mod+."],newSession:["Mod+N","Alt+N"],quickOpen:["Mod+P"],save:["Mod+S"],shortcutsSheet:["Mod+/"]};var xPt=bPt,IBe=new Set,f6={get:()=>xPt,set(e){xPt=e;for(let t of IBe)t()},subscribe(e){return IBe.add(e),()=>IBe.delete(e)}};function IB(){return(0,SPt.useSyncExternalStore)(f6.subscribe,f6.get)}function vo(e){return vE(e,IB())}var DBe=S(_(),1);function TPt({show:e,children:t}){let{label:r,chords:n}=vo("toggleDiff");return(0,DBe.jsx)(lr,{describeChild:!0,title:e?(0,DBe.jsx)(Yd,{label:r,chords:n}):"",children:t})}function wPt(e){return t=>({px:1,py:"3px",border:1,borderRadius:`${t.tokens.radius.sm}px`,borderColor:e?Or(t.palette.primary.main,.55):"divider",bgcolor:e?t.tokens.color.selected:"background.default",fontSize:11,textDecoration:"none",transition:"border-color .2s ease, background-color .2s ease","&:hover":{textDecoration:"none",borderColor:e?Or(t.palette.primary.main,.55):t.palette.text.disabled}})}function CPt(e,t,r){let n=ib().panelFor(e);if(!r)return;let o=n!==void 0&&(t==="uncommitted"?n.scope===t:n.scope!=="uncommitted");return{pressed:o,sx:wPt(o)}}var _Pt=S(_(),1);function kPt({groups:e}){return e.map(t=>(0,_Pt.jsxs)(H,{component:"span",sx:{color:t.color},children:[t.prefix,t.count]},t.key))}var p6=S(_(),1),dLn={display:"flex",alignItems:"center",gap:.75,fontFamily:"fontFamilyMono",whiteSpace:"nowrap",border:0,p:0,bgcolor:"transparent",cursor:"pointer"};function MBe({panelSessionId:e,cwd:t,conversation:r,scope:n,groups:o,bracketed:i,toggleChordHint:a=!1,countButton:s=!1}){let l=gme(e,t,r),u=CPt(e,n,s);return(0,p6.jsx)(TPt,{show:a,children:(0,p6.jsxs)(Ur,{component:"button",type:"button",onClick:()=>l(n),variant:"caption",underline:u?"none":"hover",color:"inherit","aria-pressed":u?.pressed,sx:[dLn,u?.sx??{}],children:[i&&(0,p6.jsx)(H,{component:"span",children:"("}),(0,p6.jsx)(kPt,{groups:o}),i&&(0,p6.jsx)(H,{component:"span",children:")"})]})})}var DB=S(_(),1),fLn={display:"flex",alignItems:"center",gap:.75,minWidth:0},EPt=[{key:"new",prefix:"+",color:"success.main"},{key:"modified",prefix:"~",color:"warning.main"},{key:"deleted",prefix:"-",color:"error.main"}];function RPt({panelSessionId:e,cwd:t,conversation:r,groups:n,uncommitted:o,toggleChordHint:i,countButton:a}){return(0,DB.jsx)(ca,{children:(0,DB.jsxs)(H,{sx:fLn,"data-testid":"git-status-counts",children:[n.length>0&&(0,DB.jsx)(MBe,{panelSessionId:e,cwd:t,conversation:r,scope:"all",groups:n,toggleChordHint:i,countButton:a}),o&&o.length>0&&(0,DB.jsx)(MBe,{panelSessionId:e,cwd:t,conversation:r,scope:"uncommitted",groups:o,bracketed:!0,countButton:a})]})})}function PPt(e){return EPt.map(t=>({...t,count:e[t.key]?.length??0})).filter(t=>t.count>0)}function APt(e){if(!e)return null;let t=PPt(e),r=e.hasCommits&&e.uncommitted?PPt(e.uncommitted):void 0;return t.length>0||(r?.length??0)>0?{kind:"counts",groups:t,uncommitted:r}:e.defaultBranch&&e.onDefaultBranch===!1?{kind:"branch",defaultBranch:e.defaultBranch}:null}var bE=S(re(),1);function MB(e,t,r){let n=new URLSearchParams({cwd:e});return t&&(n.set("session",t.conversationId),t.harness&&n.set("harness",t.harness)),r&&r!=="all"&&n.set("scope",r),n.toString()}var pLn=new Set([502,504]);function LPt(){let e=!1;return{shouldRecord:t=>pLn.has(t)?e?!0:(e=!0,!1):(e=!1,!0),reset:()=>{e=!1}}}function IPt(e){let t=2**Math.max(0,e-1);return Math.min(5e3*t,6e4)}function xme(e){let t=new AbortController,r=!1,n=0,o,i=async()=>{if(r||t.signal.aborted)return;r=!0,clearTimeout(o);let a=await e(t.signal);r=!1,!t.signal.aborted&&(n=a?.failed?n+1:0,o=setTimeout(i,IPt(n)))};return i(),{poll:i,stop:()=>{t.abort(),clearTimeout(o)}}}async function DPt(e,t,r){try{let n=await Ut(e,{blipGate:t,signal:r});return n.ok?await n.json().then(o=>({counts:o??null}),()=>{}):{counts:null,failed:!0}}catch(n){return r?.aborted?void 0:(xr(n,"git status counts"),{counts:null,failed:!0})}}function MPt(e,t){let r=LPt();return xme(async n=>{let o=await DPt(e,r,n);return o&&t(o.counts),o&&{failed:!!o.failed}})}function Sme(e,t,r=!0){let[n,o]=(0,bE.useState)(null),i=(0,bE.useRef)(()=>{}),a=ur(),s=MB(e,t);return(0,bE.useEffect)(()=>{if(i.current=()=>{},!e||!r){o(null);return}let l=MPt(Dr(`/api/git-status?${s}`,a),o);return i.current=l.poll,l.stop},[e,s,a,r]),{counts:n,refresh:(0,bE.useCallback)(()=>i.current(),[])}}function NPt(e,t){return Sme(e,t).counts}var NBe=S(_(),1);function Tme({panelSessionId:e,cwd:t,conversation:r,offerBranchDiff:n=!1,toggleChordHint:o=!1,countButton:i=!1}){let a=APt(NPt(t,r));return a?a.kind==="branch"?n?(0,NBe.jsx)(dPt,{panelSessionId:e,cwd:t,conversation:r,defaultBranch:a.defaultBranch}):null:(0,NBe.jsx)(RPt,{panelSessionId:e,cwd:t,conversation:r,groups:a.groups,uncommitted:a.uncommitted,toggleChordHint:o,countButton:i}):null}var xE=S(_(),1);function OPt({restored:e,usedPct:t,harness:r,undurable:n}){return(0,xE.jsxs)(xE.Fragment,{children:[n&&(0,xE.jsx)(be,{variant:"caption",sx:{color:"warning.main"},children:n.reason}),e!==void 0&&(0,xE.jsx)(be,{variant:"caption",sx:{color:e?"success.main":"warning.main"},children:e?"restored":"not restored"}),t!==void 0&&(0,xE.jsxs)(be,{variant:"caption",sx:{color:dme(t,r),opacity:.6,fontSize:"0.8rem"},children:[Math.round(t),"%"]})]})}var rJ=S(_(),1),hLn={gridColumn:3,gridRow:2,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.75,minWidth:0};function BPt({session:e}){return(0,rJ.jsxs)(H,{sx:hLn,children:[(0,rJ.jsx)(OPt,{usedPct:e.usedPct,harness:e.harness,undurable:e.undurable}),e.cwd&&(0,rJ.jsx)(Tme,{panelSessionId:e.id,cwd:e.cwd,conversation:gE(e)})]})}function wme(e,t){if(t)return!0;let r=e.commandType==="assist"&&e.activity===void 0,n=e.status==="done"||e.status==="error";return r&&!n}var OBe=S(_(),1),mLn=Go("neutral");function $Pt({clone:e}){return(0,OBe.jsx)(lr,{title:`Clone \u2014 ${e}`,children:(0,OBe.jsx)(H,{component:"span",sx:mLn,children:"clone"})})}var Cme=[Go("primary"),e=>({bgcolor:e.palette.primary.main,borderColor:e.palette.primary.main,color:e.palette.primary.contrastText})];var BBe=S(_(),1),gLn=Go("success");function FPt({session:e}){return wBe(e)?(0,BBe.jsx)(H,{component:"span",sx:gLn,children:e.port?(0,BBe.jsx)(ume,{port:e.port,node:e.node,protocol:e.protocol,urlPath:e.urlPath}):"serving"}):null}var kme=S(re(),1),$Be=(0,kme.createContext)(new Set);function zPt(){return(0,kme.useContext)($Be)}var ey=S(_(),1),yLn=Go("check");function vLn({label:e}){return(0,ey.jsx)(H,{component:"span",sx:Cme,children:e})}function HPt({session:e}){let t=zPt().has(e.id),r=e.repoGroup?.clone,{activity:n}=e,o=n?.kind==="backlog"&&n.phase===n.totalPhases;return(0,ey.jsxs)(ey.Fragment,{children:[Qi(e)==="check"&&(0,ey.jsx)(H,{component:"span",sx:yLn,children:"Check"}),(0,ey.jsx)(FPt,{session:e}),(0,ey.jsx)(Bhe,{harness:e.harness}),t&&r&&(0,ey.jsx)($Pt,{clone:r}),(0,ey.jsx)(Whe,{node:e.node}),o&&(0,ey.jsx)(vLn,{label:`${n.phase}/${n.totalPhases}`})]})}var QPt=S(re(),1);function _me(e){return e?.itemIds?.length?e.itemIds:e?.itemId==null?[]:[e.itemId]}var WPt=S(_(),1),bLn=Go("primary");function UPt({itemId:e,session:t}){let r=ur();return(0,WPt.jsx)(Ur,{component:wa,to:qd(e,Ul(t),r),underline:"hover",sx:bLn,onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:hn(e)})}var FBe=S(_(),1),VPt=Go("secondary");function GPt({prNumber:e,url:t}){let r=`#${e}`;return t?(0,FBe.jsx)(Ur,{href:t,target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:VPt,onMouseDown:n=>n.stopPropagation(),onClick:n=>n.stopPropagation(),children:r}):(0,FBe.jsx)(H,{component:"span",sx:VPt,children:r})}var jPt=S(_(),1),xLn={color:"text.secondary",whiteSpace:"nowrap"};function qPt(e,t){let r=yB(t)?Aa(e):"";if(r)return{key:"repo",node:(0,jPt.jsx)(H,{component:"span",sx:xLn,children:r})}}function YPt(e,t){return!e?.jiraKey&&e?.githubIssue?.toLowerCase()===t.toLowerCase()}var XPt=S(_(),1);function KPt(e,t){if(!(!e||YPt(t,e)))return{key:"prompt-issue",node:(0,XPt.jsx)(cE,{githubIssue:e,variant:"token"})}}function SE(e){if(e.activity?.kind==="backlog")return"next";if(e.design)return"design";switch(e.commandType){case"assist":{let t=e.assistArgs?.[0];return t==="review-pr-comments"||t==="fix-conflict"?"review":t==="draft"||t==="bug"||t==="next"||t==="refine"||t==="review"||t==="update"?t:"prompt"}case"run":return"run";default:return e.promptType??"prompt"}}var Eme=S(_(),1);function ZPt(e,t,r,n){let o=[],i=SE(e),a=t?void 0:qPt(e.cwd,i),{activity:s}=e;a&&o.push(a),s?.kind==="backlog"?s.phase!==s.totalPhases&&o.push({key:"phase",node:`${s.phase}/${s.totalPhases}`}):o.push({key:"type",node:i}),r.number!==void 0&&o.push({key:"pr",badge:!0,node:(0,Eme.jsx)(GPt,{prNumber:r.number,url:r.url})});for(let u of _me(s))o.push({key:`item-${u}`,badge:!0,node:(0,Eme.jsx)(UPt,{itemId:u,session:e})});n&&o.push({key:"tracker",node:(0,Eme.jsx)(Mhe,{tracker:n,variant:"token"})});let l=KPt(e.promptIssue,n);return l&&o.push(l),o}var SLn=["review","review-pr-comments","fix-conflict"];function ab(e){let t=e.assistArgs?.[0];if(!t||!SLn.includes(t))return;let r=e.assistArgs?.slice(1).map(o=>Number(o)).find(o=>Number.isInteger(o)&&o>0);if(r!==void 0)return r;let n=e.subtitle?.match(/^#(\d+)/);return n?Number(n[1]):void 0}var Rme=S(re(),1);function NB(e,t,r){let[n,o]=(0,Rme.useState)(null),i=ur();return(0,Rme.useEffect)(()=>{if(!e){o(null);return}let a=!1,s=t!==void 0?`&number=${t}`:"";return Ut(Dr(`/api/pr-status?cwd=${encodeURIComponent(e)}${s}`,i)).then(l=>l.json()).then(l=>{a||o(typeof l?.pr?.number=="number"?l.pr:null)}).catch(l=>{xr(l,"PR status"),a||o(null)}),()=>{a=!0}},[e,i,t,r]),n}var h6=S(_(),1),TLn={opacity:.35,mx:.5};function JPt({session:e}){let t=J3t(),r=Uhe(e.cwd),n=ab(e)??e.promptPr,o=NB(e.cwd,n,e.status),i=ZPt(e,t,{number:n??o?.number,url:o?.url},r(e.activity?.itemId)),a=s=>s>0&&!i[s].badge&&!i[s-1].badge;return(0,h6.jsx)(h6.Fragment,{children:i.map((s,l)=>(0,h6.jsxs)(QPt.Fragment,{children:[a(l)&&(0,h6.jsx)(H,{component:"span",sx:TLn,children:"\xB7"}),s.node]},s.key))})}var m6=S(_(),1);function eAt({session:e}){return(0,m6.jsxs)(m6.Fragment,{children:[(0,m6.jsx)(JPt,{session:e}),(0,m6.jsx)(HPt,{session:e})]})}var zBe=S(_(),1),wLn={color:"text.disabled",fontSize:"0.65rem",lineHeight:1.4};function tAt({toggles:e}){let t=e.flatMap(r=>r.caption??[]);return t.length===0?null:(0,zBe.jsx)(H,{sx:{display:"flex",gap:1,minWidth:0},children:t.map(r=>(0,zBe.jsx)(be,{sx:wLn,children:r},r))})}function OB({activity:e}){return e?.kind==="backlog"&&!!e.phase&&e.phase===e.totalPhases}function BB(e){let t=[],r=SE(e);if(r==="draft"||r==="bug"||r==="refine"){let n=e.autoApprove??!1;t.push({key:"autoApprove",label:"Auto start",checked:n,...n?{caption:"will auto start"}:{}})}if(e.activity?.kind==="backlog"){let n=e.autoAdvance??!0;OB(e)||t.push({key:"autoAdvance",label:"Continue",checked:n,...n?{}:{caption:"won't continue"}})}return t}var nJ=S(_(),1),CLn={gridColumn:2,gridRow:2,display:"flex",alignItems:"center",gap:.625,minWidth:0,overflow:"hidden",fontSize:"0.6875rem",lineHeight:"16px",color:"text.secondary"};function rAt({session:e}){return wme(e,!1)?null:(0,nJ.jsxs)(H,{sx:CLn,children:[(0,nJ.jsx)(eAt,{session:e}),(0,nJ.jsx)(tAt,{toggles:BB(e)})]})}var g6=S(_(),1);function nAt({session:e,loading:t}){return t?null:(0,g6.jsxs)(g6.Fragment,{children:[(0,g6.jsx)(rAt,{session:e}),(0,g6.jsx)(BPt,{session:e})]})}var Pme="session-card-title";var TE="session-card-close";var oAt=S(_(),1),iAt=ot((0,oAt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"DeleteForever");var Ame=S(re(),1),HBe=(0,Ame.createContext)({onStop:()=>{},onStart:()=>{},onDiscard:()=>{}});function $B(){return(0,Ame.useContext)(HBe)}var vT=S(_(),1);function aAt({id:e,reason:t,path:r,removesTree:n}){let{onDiscard:o}=$B(),{confirming:i,close:a,triggerHandlers:s,withHint:l}=fs(()=>o(e)),u=t?` (${t})`:"",d=r??"its working tree";return(0,vT.jsxs)(vT.Fragment,{children:[(0,vT.jsx)(Mt,{size:"small",...s,title:l(n?"Discard changes and remove worktree":"Drop this card and stop tracking its unlanded work"),sx:{color:"text.disabled","&:hover":{color:"error.main"}},children:(0,vT.jsx)(iAt,{sx:{fontSize:16}})}),i&&(0,vT.jsx)(ca,{children:(0,vT.jsx)(Fo,{title:n?"Discard all changes":"Stop tracking this work",message:n?`This permanently deletes the worktree ${d} and the work it holds${u}. This cannot be undone.`:`This drops the card and stops tracking the unlanded work in ${d}${u}. Nothing on disk is deleted.`,confirmLabel:n?"Discard changes":"Drop card",onConfirm:()=>{a(),o(e)},onCancel:a})})]})}var sb=S(_(),1);function sAt({childCount:e,onDismissThis:t,onDismissAll:r,onCancel:n}){let o=e===1?"session":"sessions";return(0,sb.jsxs)(Ra,{open:!0,onClose:n,maxWidth:"xs",fullWidth:!0,children:[(0,sb.jsx)(Bl,{children:"Close nested sessions?"}),(0,sb.jsx)(Ol,{children:(0,sb.jsx)(T_,{children:`This session has ${e} nested ${o}. Close just this session, or close it along with its nested ${o}? Running sessions will be stopped.`})}),(0,sb.jsxs)(Qc,{children:[(0,sb.jsx)(nt,{onClick:n,children:"Cancel"}),(0,sb.jsx)(nt,{onClick:t,children:"Close this only"}),(0,sb.jsx)(nt,{variant:"contained",color:"error",onClick:r,children:`Close all ${e+1}`})]})]})}var Lme=S(_(),1);function lAt({onDismiss:e,childDismiss:t,onClose:r}){let n=o=>{r(),o()};return(0,Lme.jsx)(ca,{children:t?(0,Lme.jsx)(sAt,{childCount:t.childCount,onDismissThis:()=>n(e),onDismissAll:()=>n(t.onDismissAll),onCancel:r}):(0,Lme.jsx)(Fo,{title:"End session",message:"This will stop the running session and kill its process. Are you sure?",confirmLabel:"End session",onConfirm:()=>n(e),onCancel:r})})}var wE=S(_(),1);function Ime({id:e,status:t,onDismiss:r,childDismiss:n}){let{confirming:o,close:i,triggerHandlers:a,withHint:s}=fs(n?.onDismissAll??r,{needsConfirm:t!=="done"||!!n});return(0,wE.jsxs)(wE.Fragment,{children:[(0,wE.jsx)(Mt,{size:"small",...a,title:s(`Dismiss session ${e}`),sx:{color:"text.disabled","&:hover":{color:"text.primary"}},children:(0,wE.jsx)(_o,{sx:{fontSize:16}})}),o&&(0,wE.jsx)(lAt,{onDismiss:r,childDismiss:n,onClose:i})]})}var Kn={supported:!0};function qo(e,t,r){return r?{supported:!1,reason:e,remediation:t,followUp:r}:{supported:!1,reason:e,remediation:t}}var cAt={"skills.native":Kn,"launch.terminal":Kn,"conversation.resume":Kn,"conversation.relocate":Kn,"conversation.id":Kn,"conversation.preassignId":Kn,"systemPrompt.append":Kn,"tasks.notifyOnExit":Kn,"preview.nextTurn":Kn,"artifacts.publish":Kn,"transcript.read":Kn,"oneShot.text":Kn,"oneShot.structured":Kn,"usage.rateLimits":Kn,"tools.restrict":Kn,"connector.gmail.read":Kn,"connector.slack.read":Kn,"intercept.command":Kn,"intercept.fileRead":Kn,"intercept.fileWrite":Kn,"intercept.editDiff":Kn,"intercept.question":Kn,"slashCommands.suggest":Kn,"session.driven":qo("Claude runs in a terminal the daemon mirrors rather than a session the daemon drives","pick Claude (SDK) for a session driven through the Agent SDK"),"tasks.background":qo("assist cannot list or stop the background tasks of a Claude session running in a terminal","pick Claude (SDK) to see background tasks on the session card")},kLn={...cAt,"session.driven":Kn,"tasks.background":Kn},uAt={claude:cAt,"claude-sdk":kLn,codex:{"skills.native":Kn,"launch.terminal":Kn,"conversation.resume":Kn,"conversation.relocate":Kn,"conversation.id":Kn,"conversation.preassignId":qo("Codex assigns its own conversation id when its rollout starts","assist binds the Codex conversation id from the rollout after launch"),"systemPrompt.append":qo("Design launches on Codex have not passed manual testing: sessions arrived without the design prompt or stopped before designing anything","start design sessions with Claude","a1589"),"tasks.notifyOnExit":qo("Codex runs a background command in an exec session that reports nothing back once the turn ends, so an agent that ends its turn never sees a command that waits on the user, such as review-high-level's verdict","run the high-level review on Claude; assist ask-question, ask and ask-check hand off to the daemon, which types the decision into Codex as its next turn","a1573"),"preview.nextTurn":Kn,"artifacts.publish":qo("Codex has no tool that publishes a claude.ai artifact, and assist ask-design reviews only artifact links","design in Codex and deliver the HTML file, then review it in chat; start the design session with Claude for preview-pane review rounds","a1567"),"transcript.read":Kn,"oneShot.text":Kn,"oneShot.structured":Kn,"usage.rateLimits":Kn,"tools.restrict":qo("assist cannot yet limit a headless Codex run to an allow-list of connector tools","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.gmail.read":qo("Codex has no verified read-only Gmail connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.slack.read":qo("Codex has no verified read-only Slack connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"intercept.command":Kn,"intercept.fileRead":Kn,"intercept.fileWrite":Kn,"intercept.editDiff":qo("assist's maintainability-override and comment guards run only in Claude's edit hook, so Codex patches are not checked for override markers or new code comments","the shared policy still applies the allowlist, restricted paths and docs/schema locks; run work that must keep those guards on Claude","a1592"),"intercept.question":Kn,"slashCommands.suggest":qo("assist reads skills and commands only from Claude's home and project dirs","type the Codex skill name in full in the phone reply bar"),"session.driven":qo("Codex runs in a terminal the daemon mirrors rather than a session the daemon drives","Codex sessions use the terminal; pick Claude (SDK) for a driven session","a1684"),"tasks.background":qo("Codex reports no background tasks to assist","Codex sessions show no background-task rows")},pi:{"skills.native":Kn,"launch.terminal":Kn,"conversation.resume":qo("pi sessions cannot be resumed yet","restart starts a fresh pi conversation; pick Claude or Codex to keep the conversation across restarts","a696"),"conversation.relocate":qo("pi sessions cannot be resumed, so a pi conversation cannot continue in a replacement worktree","start a fresh session in the replacement worktree; pick Claude or Codex to keep the conversation across worktree replacement","a696"),"conversation.id":qo("assist records no conversation id for pi sessions","comment from the session's own diff panel; a standalone /diff link cannot find a pi session","a696"),"conversation.preassignId":qo("pi does not accept a caller-assigned conversation id","the session card tracks pi without a conversation id"),"systemPrompt.append":qo("assist has not verified a pi flag that appends a system prompt at launch and on resume","start design sessions with Claude or Codex, or run /design inside a pi session to read the design prompt from disk","a696"),"tasks.notifyOnExit":qo("assist has not verified a pi tool that wakes the agent when a background command exits, so an agent that ends its turn would never see a command that waits on the user, such as review-high-level's verdict or an assist ask-question answer","run the high-level review on Claude; pi routes its native question tool to the preview pane instead of assist ask-question","a1573"),"preview.nextTurn":qo("assist cannot yet deliver a preview-pane decision into a pi session as its next turn, and pi cannot wait on a background task","pi routes its native question tool to the preview pane instead of assist ask-question","a1573"),"artifacts.publish":qo("pi has no tool that publishes a claude.ai artifact, and assist ask-design reviews only artifact links","deliver the HTML file and review it in chat; start the design session with Claude for preview-pane review rounds","a1567"),"transcript.read":qo("assist cannot read pi conversation transcripts yet","pi session cards show no message previews or transcript-derived status and title; pick Claude or Codex for those","a696"),"oneShot.text":qo("assist has no headless pi one-shot yet","the derived fallback is used instead (slug from the description, no generated title); set harness.engine to claude or codex for generated suggestions","a696"),"oneShot.structured":qo("assist has no headless streaming pi run yet","pick Claude or Codex for review synthesis (review.synthesisHarness); pi cannot be a reviewer","a696"),"usage.rateLimits":qo("pi reports no account rate-limit windows to assist","pi sessions show no usage windows; Claude and Codex usage is still tracked under their own accounts","a696"),"tools.restrict":qo("assist cannot limit a headless pi run to an allow-list of tools","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.gmail.read":qo("pi has no Gmail connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"connector.slack.read":qo("pi has no Slack connector","run the inbox scan with Claude (assist inbox scan --harness claude)","a1562"),"intercept.command":Kn,"intercept.fileRead":Kn,"intercept.fileWrite":Kn,"intercept.editDiff":qo("assist's maintainability-override and comment guards run only in Claude's edit hook, so pi edits and writes are not checked for override markers or new code comments","the shared policy still applies the allowlist, restricted paths and docs/schema locks; run work that must keep those guards on Claude","a1592"),"intercept.question":Kn,"slashCommands.suggest":qo("assist reads skills and commands only from Claude's home and project dirs","type the pi prompt name in full in the phone reply bar"),"session.driven":qo("pi runs in a terminal the daemon mirrors rather than a session the daemon drives","pi sessions use the terminal; pick Claude (SDK) for a driven session"),"tasks.background":qo("pi reports no background tasks to assist","pi sessions show no background-task rows")}};function dAt(e,t){let r=e[t];return typeof r=="function"?r():r}function Dme(e,t){let r=jd(e),n=uAt[r];return n?dAt(n,t):qo(`This app does not recognise the ${r} harness.`,"Update the app to a version that supports it.")}function Mme(e){return Dme(e,"conversation.resume").supported}var fAt=S(_(),1),js=ot((0,fAt.jsx)("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");var Nme=S(re(),1);var CE=S(_(),1);function pAt({id:e,onStartOver:t,anchor:r,onClose:n}){let o=fs(()=>{n(),t()});return(0,CE.jsxs)(CE.Fragment,{children:[(0,CE.jsx)(fi,{anchorEl:r,open:r!==null,onClose:n,onClick:i=>i.stopPropagation(),children:(0,CE.jsx)(Br,{title:o.withHint("Start over"),...o.triggerHandlers,onClick:i=>{n(),o.triggerHandlers.onClick(i)},children:"Start over"})}),o.confirming&&(0,CE.jsx)(Fo,{title:`Start over session ${e}`,message:"Start over? The conversation history is discarded. This stops the running process and starts a new conversation with only the initial prompt, or opens idle if there was none.",confirmLabel:"Start over",onConfirm:()=>{o.close(),t()},onCancel:o.close})]})}var bT=S(_(),1);function hAt({id:e,onStartOver:t,children:r}){let n=(0,Nme.useRef)(null),[o,i]=(0,Nme.useState)(null);return(0,bT.jsxs)(bT.Fragment,{children:[(0,bT.jsxs)(U1,{ref:n,variant:"outlined",color:"inherit",size:"small","aria-label":"Restart session",sx:{color:"text.secondary",flexShrink:0,"& .MuiButtonGroup-grouped":{borderColor:"divider"},"& .MuiButtonGroup-lastButton":{minWidth:0,px:.25}},children:[r,(0,bT.jsx)(nt,{"aria-label":"Restart options","aria-haspopup":"menu","aria-expanded":o!==null,onClick:a=>{a.stopPropagation(),i(n.current)},children:(0,bT.jsx)(js,{sx:{fontSize:16}})})]}),(0,bT.jsx)(pAt,{id:e,onStartOver:t,anchor:o,onClose:()=>i(null)})]})}var mAt=S(_(),1),xT=ot((0,mAt.jsx)("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt");var Ome=S(re(),1),UBe=(0,Ome.createContext)(!1);function Bme(){return(0,Ome.useContext)(UBe)}var $me=S(_(),1);function gAt({title:e,onClick:t,onKeyDown:r}){let n=Bme();return(0,$me.jsx)(nt,{size:"small","aria-label":"Restart",title:e,onClick:t,onKeyDown:r,startIcon:n?(0,$me.jsx)(xT,{sx:{fontSize:14}}):void 0,sx:{textTransform:"none",minWidth:0,px:1,whiteSpace:"nowrap"},children:n?"Restart":(0,$me.jsx)(xT,{sx:{fontSize:14}})})}var kE=S(_(),1);function _Ln(e){return Mme(e)?"resumes the conversation":"relaunches it from the start"}function Fme({id:e,onRestart:t,onStartOver:r,harness:n}){let{confirming:o,close:i,triggerHandlers:a,withHint:s}=fs(t),l=(0,kE.jsx)(gAt,{title:s(`Restart session ${e}`),...a});return(0,kE.jsxs)(kE.Fragment,{children:[r?(0,kE.jsx)(hAt,{id:e,onStartOver:r,children:l}):l,o&&(0,kE.jsx)(Fo,{title:`Restart session ${e}`,message:`Restart this ${Ei(n)} session? It ${_Ln(n)}, stopping the running process first.`,confirmLabel:"Restart",onConfirm:()=>{i(),t()},onCancel:i})]})}var lb=S(_(),1);function yAt({session:e,onRestart:t,onStartOver:r,onDismiss:n,childDismiss:o}){let{status:i,id:a,harness:s}=e;return e.closing?null:i!=="stopped"?(0,lb.jsx)("span",{className:TE,children:(0,lb.jsx)(Ime,{id:a,status:i,onDismiss:n,childDismiss:o})}):(0,lb.jsxs)(lb.Fragment,{children:[e.undurable&&(0,lb.jsx)("span",{className:TE,children:(0,lb.jsx)(aAt,{id:a,reason:e.undurable.reason,path:e.cwd,removesTree:e.undurable.removesTree})}),t&&(0,lb.jsx)(Fme,{id:a,onRestart:t,onStartOver:r,harness:s})]})}var WBe=S(_(),1);function vAt({session:e,onRestart:t,onStartOver:r,onDismiss:n,childDismiss:o}){return(0,WBe.jsx)(ca,{children:(0,WBe.jsx)(yAt,{session:e,onRestart:t,onStartOver:r,onDismiss:n,childDismiss:o})})}var VBe=S(_(),1),ELn={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25};function bAt({session:e,loading:t,onRetry:r,onRestart:n,onStartOver:o,onDismiss:i,childDismiss:a}){return(0,VBe.jsx)(H,{sx:ELn,children:(0,VBe.jsx)(vAt,{session:e,loading:t,onRetry:r,onRestart:n,onStartOver:o,onDismiss:i,childDismiss:a})})}function zme(e){return e.verifying===!0&&Qi(e)==="running"}var FB=S(_(),1),RLn=wi`
|
|
3817
3817
|
to { transform: rotate(360deg); }
|
|
3818
3818
|
`,Hme=8,PLn=3,ALn=6.25,LLn=1.5,ILn={gridColumn:1,gridRow:1,justifySelf:"center",alignSelf:"center",display:"block",color:Zu.running,"& .verify-ring":{fill:"none",stroke:"currentColor",strokeWidth:LLn,strokeDasharray:"70 30",opacity:.45,transformBox:"fill-box",transformOrigin:"center",animation:`${RLn} 1.1s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none",strokeDasharray:"none"}}};function Ume({ring:e=!1,title:t="running"}){return(0,FB.jsxs)(H,{component:"svg",viewBox:"0 0 16 16",width:16,height:16,sx:ILn,children:[(0,FB.jsx)("title",{children:t}),(0,FB.jsx)("circle",{cx:Hme,cy:Hme,r:PLn,fill:"currentColor",shapeRendering:"geometricPrecision"}),e&&(0,FB.jsx)("circle",{className:"verify-ring",cx:Hme,cy:Hme,r:ALn,pathLength:100})]})}function _E(e){return e==="waiting"||e==="question"||e==="design"||e==="check"}var Wme=S(_(),1),DLn=wi`
|
|
3819
3819
|
0%, 100% { opacity: 1; }
|
|
@@ -4140,7 +4140,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4140
4140
|
`)){let n=t[t.length-1];r.startsWith("@@")||n===void 0?t.push(r):t[t.length-1]=`${n}
|
|
4141
4141
|
${r}`}return t}function cXr(e){return lXr(e??"").filter(t=>t.startsWith("@@"))}function njo(e){return Number(/^@@ -(\d+)/.exec(e)?.[1]??1)}function ojo(e){return/^@@[^@]*@@/.exec(e)?.[0]??e.split(`
|
|
4142
4142
|
`)[0]??""}function uXr(e,t){return e.reduce((r,n)=>r+sXr(n,t),0)}function dXr(e,t,r){let n=cXr(e.patch),o=[],i=[];return n.forEach((a,s)=>{let l=r.get(`${e.path}#${s}`)??[];l.includes(t)?o.push(a):i.push({oldStart:njo(a),header:ojo(a),slice:l[0]??0})}),o.length===0||i.length===0?e:{...e,patch:o.join(`
|
|
4143
|
-
`),additions:uXr(o,"+"),deletions:uXr(o,"-"),split:{hunks:o.length,of:n.length,elsewhere:i}}}function fXr(e){return e.flatMap(t=>{if(t.kind==="dir")return fXr(t.children);let{kind:r,name:n,...o}=t;return[o]})}function ijo(e){let t=new Map;return e.forEach((r,n)=>{for(let o of r.hunks)t.set(o,[...t.get(o)??[],n+1])}),t}function pXr(e,t,r=new Set,n=new Set){let o=fXr(e.tree).filter(a=>!r.has(a.path)).map(a=>n.has(a.path)?{...a,critical:!0}:a),i=ijo(t);return t.map((a,s)=>{let l=new Set(a.hunks.map(Vj));return aXr(o.filter(u=>l.has(u.path)).map(u=>dXr(u,s+1,i)))})}function ajo(e,t){let r=-1,n=0;return t.forEach((o,i)=>{let a=o.hunks.filter(s=>Vj(s)===e).length;a>n&&(r=i,n=a)}),r}function hXr(e,t){let r=t.map(()=>[]);for(let n of e)r[ajo(n.path,t)]?.push(n);return r}function mXr(e,t){let r=pXr(e.structure,t,new Set(e.tests.map(i=>i.path)),new Set(e.criticalDiffs.map(i=>i.path))),n=hXr(e.tests,t),o=yPe(t);return t.map((i,a)=>{let s=a+1;return{number:s,slice:i,structure:r[a]??e.structure,tests:n[a]??[],critical:e.criticalDiffs.filter(l=>o.get(l.path)?.some(u=>u.number===s))}})}function gXr(e){if(!e.slices)return;let t=mXr(e,e.slices);return{entries:QKr(e,t),slicing:{count:t.length,noCritical:new Set(t.filter(r=>r.critical.length===0).map(r=>r.number))}}}function yXr(e){if(!(!e.repo||!e.headSha))return`${e.repo}#${e.prNumber}@${e.headSha}`}var ugt="assist:high-level-progress:",sjo=`${ugt}head:`,ljo=720*60*60*1e3,ile=e=>`${ugt}${e}`,dgt=e=>`${sjo}${e}`,cgt=e=>dl(e)[0];function cjo(e,t){let r=e?cgt(ile(e)):void 0;return e&&$v(ile(e)),r??(t?cgt(dgt(t)):void 0)}function vXr(e,t,r){return Hx(ugt,ljo),cgt(ile(e))??cjo(t,r)}function bXr(e,t,r){Il(ile(e),[r]),t&&Il(dgt(t),[r])}function xXr(e,t){$v(ile(e)),t&&$v(dgt(t))}function SXr(e){let t=e;return typeof t?.id=="string"&&typeof t.title=="string"&&typeof t.reason=="string"&&(t.kind==="deterministic"||t.kind==="manual")&&["pass","fail","manual"].includes(t.status)}function gN(e,t){return Array.isArray(e)?t?e.filter(t):e:[]}var fgt=e=>typeof e=="string"?e:"";function TXr(e){return{repo:fgt(e.repo),prNumber:typeof e.prNumber=="number"?e.prNumber:0,headSha:fgt(e.headSha),body:fgt(e.body)}}var pgt={repo:"",prNumber:0,headSha:"",body:"",checks:[],structure:{tree:[],added:0,removed:0,modified:0,additions:0,deletions:0},criticalDiffs:[],criticalPaths:[],tests:[],testPaths:[],collapsedPaths:[]};function wXr(e){let t;try{t=JSON.parse(e)}catch{return pgt}return typeof t!="object"||t===null?pgt:{...TXr(t),checks:gN(t.checks,SXr),structure:{...pgt.structure,...t.structure},criticalDiffs:gN(t.criticalDiffs),criticalPaths:gN(t.criticalPaths),tests:gN(t.tests),testPaths:gN(t.testPaths),collapsedPaths:gN(t.collapsedPaths),...Array.isArray(t.slices)?{slices:t.slices}:{},...t.manualTesting?{manualTesting:t.manualTesting}:{},...t.saved?{saved:t.saved}:{},...t.draft?{draft:t.draft}:{}}}function CXr(e){let t=(0,zPe.useMemo)(()=>wXr(e.body),[e.body]),r=(0,zPe.useMemo)(()=>gXr(t),[t]),n=yXr(t),o=(0,zPe.useMemo)(()=>vXr(e.requestId,e.supersedes,n)??t.draft??t.saved,[e.requestId,e.supersedes,n,t]);return{payload:t,sliced:r,progress:o,head:n}}var kXr=S(re(),1);function _Xr(e){let[t,r]=(0,kXr.useState)(()=>e?.reviewComments??[]);return{queued:t,onQueue:n=>r(o=>[...o,n]),onRemove:n=>r(o=>o.filter((i,a)=>a!==n)),onEdit:(n,o)=>r(i=>i.map((a,s)=>s===n?{...a,note:o}:a))}}var EXr=S(re(),1);function RXr(e,t,r,n){(0,EXr.useEffect)(()=>{bXr(e,t,{items:r,reviewComments:n})},[e,t,r,n])}function AXr(e,t,r){let{payload:n,sliced:o,progress:i,head:a}=CXr(e),s=XKr(n.checks,i,o?.slicing),l=_Xr(i),u=zKr(o?.entries??[]),{comments:d,sentTo:f,clearSent:p}=Q3e(t,r),h={...d,onQueue:l.onQueue};RXr(e.requestId,a,s.items,l.queued);let m=(0,PXr.useMemo)(()=>GKr(n),[n]);return{payload:n,checklist:s,queue:l,details:VKr(n,h),counts:m,sentTo:f,clearSent:p,sliced:o,nav:u,diffComments:h,head:a}}var PS=S(_(),1);function LXr({preview:e,session:t,sendInput:r,onDecision:n}){let o=AXr(e,t,r);return(0,PS.jsxs)(H,{sx:r0,children:[(0,PS.jsx)(Ih,{preview:e,draft:!1}),(0,PS.jsx)(Jj,{items:e.metadata??[]}),(0,PS.jsx)(qn,{}),(0,PS.jsx)(kKr,{payload:o.payload,checklist:o.checklist,details:o.details,counts:o.counts,sliced:o.sliced,nav:o.nav,comments:o.diffComments}),(0,PS.jsx)(qn,{}),(0,PS.jsx)($Kr,{pane:o,onDecision:(i,a)=>{xXr(e.requestId,o.head),n(i,a)}}),(0,PS.jsx)(kh,{sessionName:o.sentTo,onClose:o.clearSent})]})}var FXr=S(re(),1);var yN=S(_(),1);function ujo(e){return e.topLeft===null?"Click the top-left box":e.bottomRight===null?"Now click the bottom-right box":"Both anchors picked"}function IXr({selection:e,onConfirm:t,onReject:r}){let n=e.topLeft!==null&&e.bottomRight!==null;return(0,yN.jsxs)(St,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,yN.jsx)(be,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:ujo(e)}),(0,yN.jsx)(nt,{color:"error",variant:"outlined",onClick:r,children:"Cancel"}),(0,yN.jsx)(nt,{variant:"outlined",onClick:e.reset,children:"Start over"}),(0,yN.jsx)(nt,{color:"success",variant:"contained",disabled:!n,onClick:t,children:"Extract boxes"})]})}var djo={"top-left":oc.miro.topLeft,"bottom-right":oc.miro.bottomRight};function DXr(e,t){let r=e.right-e.left,n=e.bottom-e.top;return{width:r,height:n,fontSize:Math.max(6,Math.min(n*.3,r/6,28)),radius:Math.min(8,n/4),colour:t?djo[t]:oc.miro.box,opacity:t?.75:.35,strokeWidth:Math.max(1,r*.004)}}var ale=S(_(),1);function MXr({box:e,role:t,onSelect:r}){let n=DXr(e,t);return(0,ale.jsxs)("g",{role:"button",tabIndex:0,"aria-label":t?`${e.text} (${t})`:e.text,onClick:()=>r(e.id),onKeyDown:o=>{o.key==="Enter"&&r(e.id)},style:{cursor:"pointer"},children:[(0,ale.jsx)("rect",{x:e.left,y:e.top,width:n.width,height:n.height,rx:n.radius,fill:n.colour,fillOpacity:n.opacity,stroke:n.colour,strokeWidth:n.strokeWidth}),(0,ale.jsx)("text",{x:e.left+n.width/2,y:e.top+n.height/2,textAnchor:"middle",dominantBaseline:"central",fontSize:n.fontSize,fill:oc.miro.text,children:e.text})]})}function NXr(e){if(e.length===0)return"0 0 100 100";let t=Math.min(...e.map(a=>a.left)),r=Math.min(...e.map(a=>a.top)),n=Math.max(...e.map(a=>a.right))-t,o=Math.max(...e.map(a=>a.bottom))-r,i=Math.max(n*.02,8);return`${t-i} ${r-i} ${n+i*2} ${o+i*2}`}var HPe=S(_(),1);function OXr({boxes:e,selection:t}){return(0,HPe.jsx)(H,{sx:{flex:1,minHeight:0,overflow:"auto",p:2},children:(0,HPe.jsx)("svg",{role:"img","aria-label":"Miro board boxes",viewBox:NXr(e),preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:e.map(r=>(0,HPe.jsx)(MXr,{box:r,role:t.roleOf(r.id),onSelect:t.choose},r.id))})})}function fjo(e){return typeof e?.id=="string"&&typeof e.text=="string"&&[e.left,e.top,e.right,e.bottom].every(t=>typeof t=="number"&&Number.isFinite(t))}function BXr(e){try{let t=JSON.parse(e);return Array.isArray(t?.boxes)?t.boxes.filter(fjo):[]}catch{return[]}}var hgt=S(re(),1);function $Xr(){let[e,t]=(0,hgt.useState)(null),[r,n]=(0,hgt.useState)(null);return{topLeft:e,bottomRight:r,choose:s=>{if(e===null||r!==null){t(s),n(null);return}n(s)},reset:()=>{t(null),n(null)},roleOf:s=>s===e?"top-left":s===r?"bottom-right":null}}var N3=S(_(),1);function zXr({preview:e,onDecision:t}){let r=(0,FXr.useMemo)(()=>BXr(e.body),[e.body]),n=$Xr();return(0,N3.jsxs)(H,{sx:r0,children:[(0,N3.jsx)(Ih,{preview:e,draft:!1}),(0,N3.jsx)(qn,{}),(0,N3.jsx)(OXr,{boxes:r,selection:n}),(0,N3.jsx)(qn,{}),(0,N3.jsx)(IXr,{selection:n,onConfirm:()=>{let{topLeft:i,bottomRight:a}=n;i===null||a===null||t("approve",Vc({topLeft:i,bottomRight:a}))},onReject:()=>t("reject",Vc())})]})}var yZr=S(re(),1);function HXr(e){let t=[];return e.map(r=>(t.length=r+1,t[r]=(t[r]??0)+1,t.map(n=>n??1).join(".")))}function UPe(e){return e*22}function UXr(e){return Math.round(e/22)}var WXr={display:"flex",alignItems:"flex-start",gap:.25,"& .criterion-action":{opacity:0,transition:"opacity 120ms"},"&:hover .criterion-action":{opacity:1},"&:focus-within .criterion-action":{opacity:1},"& .criterion-action:focus-visible":{opacity:1}},VXr={p:.25,mt:"2px",color:"text.disabled",cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},GXr={fontFamily:"fontFamilyMono",fontSize:"0.8rem",color:"text.secondary",minWidth:32,pt:"5px",textAlign:"right",userSelect:"none",whiteSpace:"nowrap"},qXr={flex:1,fontSize:"inherit",lineHeight:1.5,px:.75,py:0,borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focused":{bgcolor:"action.selected"}},mgt={p:.25,mt:"2px"},jXr={position:"absolute",right:8,height:2,borderRadius:1,bgcolor:"primary.main",pointerEvents:"none"};var KXr=S(_(),1),pjo=8;function YXr({drag:e}){return e?(0,KXr.jsx)(H,{sx:jXr,style:{top:e.top-1,left:pjo+UPe(e.depth)}}):null}var XXr=S(_(),1),ZXr=ot((0,XXr.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");var ggt=S(_(),1);function QXr({number:e,onGrip:t}){return(0,ggt.jsx)(Mt,{size:"small",className:"criterion-action",sx:VXr,"aria-label":`Reorder criterion ${e}`,onPointerDown:t,children:(0,ggt.jsx)(ZXr,{fontSize:"inherit"})})}var sk=S(_(),1);function JXr({number:e,onAdd:t,onDelete:r}){return(0,sk.jsxs)(sk.Fragment,{children:[(0,sk.jsx)(Mt,{size:"small",className:"criterion-action",sx:mgt,"aria-label":`Add criterion after ${e}`,onClick:t,children:(0,sk.jsx)(Kd,{fontSize:"inherit"})}),(0,sk.jsx)(Mt,{size:"small",className:"criterion-action",sx:mgt,"aria-label":`Delete criterion ${e}`,onClick:r,children:(0,sk.jsx)(_o,{fontSize:"inherit"})})]})}var WPe=S(re(),1);function eZr(e,t){return e==="start"?0:e==="end"?t:Math.min(Math.max(e,0),t)}function tZr(e){let t=(0,WPe.useRef)(null);return(0,WPe.useEffect)(()=>{let r=t.current;if(!e||!r)return;r.focus();let n=eZr(e.caret,r.value.length);r.setSelectionRange(n,n)},[e]),t}var vN=S(_(),1);function rZr({index:e,number:t,item:r,outline:n,dragging:o,onGrip:i}){let a=tZr(n.focus?.index===e?n.focus:null),s={marginLeft:UPe(r.depth),opacity:o?.4:1};return(0,vN.jsxs)(H,{sx:WXr,"data-criterion-row":!0,style:s,children:[(0,vN.jsx)(QXr,{number:t,onGrip:i}),(0,vN.jsx)(H,{component:"span",sx:GXr,"aria-hidden":"true",children:`${t}.`}),(0,vN.jsx)(zi,{multiline:!0,value:r.text,sx:qXr,inputRef:a,inputProps:{"aria-label":`Criterion ${t}`},onChange:l=>n.onText(e,l.target.value),onKeyDown:l=>n.onKeyDown(e,l)}),(0,vN.jsx)(JXr,{number:t,onAdd:()=>n.onAdd(e),onDelete:()=>n.onDelete(e)})]})}var cZr=S(re(),1);function nZr(e,t,{key:r,shift:n,alt:o,caret:i,text:a}){return o||n?null:r==="ArrowUp"&&i===0&&t>0?{kind:"focus",index:t-1}:r==="ArrowDown"&&i===a.length&&t<e.length-1?{kind:"focus",index:t+1}:null}function O3(e){if(e.length===0)return[{text:"",depth:0}];let t=-1;return e.map(r=>{let n=Math.min(Math.max(r.depth,0),t+1);return t=n,r.depth===n?r:{...r,depth:n}})}function VPe(e,t,r,n){let o=e[t]?.depth??0,i=e.map((a,s)=>s===t?{...a,text:r}:a);return{items:O3([...i.slice(0,t+1),{text:n,depth:o},...i.slice(t+1)]),index:t+1}}function sg(e,t){let r=t+1;for(;r<e.length&&e[r].depth>e[t].depth;)r+=1;return r}function GPe(e,t){let r=e[t].depth;for(let n=t-1;n>=0;n-=1){if(e[n].depth<r)return-1;if(e[n].depth===r)return n}return-1}function oZr(e,t){let r=sg(e,t);return r<e.length&&e[r].depth===e[t].depth?r:-1}function iZr(e,t,r){let n=r<0?GPe(e,t):oZr(e,t);if(n<0)return null;let o=sg(e,t),i=e.slice(t,o),a=[...e.slice(0,t),...e.slice(o)],s=r<0?n:sg(e,n)-(o-t);return{items:[...a.slice(0,s),...i,...a.slice(s)],index:s}}function qPe(e,t){let r=sg(e,t),n=e.map((o,i)=>i>t&&i<r?{...o,depth:o.depth-1}:o).filter((o,i)=>i!==t);return{items:O3(n),index:Math.max(0,t-1)}}function aZr(e,t,r){if(r<0&&e[t].depth===0||r>0&&GPe(e,t)<0)return null;let n=sg(e,t);return e.map((o,i)=>i>=t&&i<n?{...o,depth:o.depth+r}:o)}function jPe(e,t){return e?{kind:"edit",edit:e,caret:t}:null}function hjo(e,t,{caret:r,text:n}){let o=n.slice(0,r);return jPe(VPe(e,t,o,n.slice(r)),"start")}function mjo(e,t,{shift:r,caret:n}){let o=aZr(e,t,r?-1:1);return jPe(o?{items:o,index:t}:null,n)}function sZr(e,t,r){let{key:n,shift:o,alt:i,caret:a,text:s}=r;return n==="Enter"&&!o?hjo(e,t,r):n==="Tab"?mjo(e,t,r):i&&(n==="ArrowUp"||n==="ArrowDown")?jPe(iZr(e,t,n==="ArrowUp"?-1:1),a):n==="Backspace"&&a===0&&s===""?jPe(qPe(e,t),"end"):null}function lZr(e,t,r){return sZr(e,t,r)??nZr(e,t,r)}function uZr(e,t){let[r,n]=(0,cZr.useState)(null),o=(a,s)=>{a&&(t(a.items),n({index:a.index,caret:s}))};return{focus:r,onKeyDown:(a,s)=>{let l=s.currentTarget;(s.key==="Enter"||s.key==="Tab")&&s.preventDefault();let u=lZr(e,a,{key:s.key,shift:s.shiftKey,alt:s.altKey,caret:l.selectionStart??0,text:l.value});u&&(s.preventDefault(),u.kind==="focus"?n({index:u.index,caret:"end"}):o(u.edit,u.caret))},onDrop:a=>o(a,"end"),onText:(a,s)=>t(e.map((l,u)=>u===a?{...l,text:s}:l)),onAdd:a=>o(VPe(e,a,e[a].text,""),"start"),onDelete:a=>o(qPe(e,a),"end")}}var mZr=S(re(),1);function gjo(e,t,r,n){let o=t.length;for(let a=0;a<e.length;a+=1)if(n<e[a].top+e[a].height/2){o=a;break}let i=sg(t,r);return o>r&&o<i?r:o}function yjo(e,t,r,n){let o=sg(e,t),i=r-1,a=i>=t&&i<o?t-1:i,s=a>=0?e[a].depth+1:0;return Math.max(0,Math.min(e[t].depth+UXr(n),s))}function vjo(e,t){if(t<e.length)return e[t].top;let r=e[e.length-1];return r?r.top+r.height:0}function dZr(e,t,r,n,o){let i=gjo(e,t,r,o);return{target:i,depth:yjo(t,r,i,n),top:vjo(e,i)}}function bjo(e){let t=e.getBoundingClientRect().top;return{boxes:Array.from(e.querySelectorAll("[data-criterion-row]")).map(n=>{let o=n.getBoundingClientRect();return{top:o.top-t,height:o.height}}),origin:t}}function fZr(e,t,r,n){return o=>{let{boxes:i,origin:a}=bjo(t);return dZr(i,e,r,o.clientX-n,o.clientY-a)}}function pZr(e,t,r,n,o){let i=new AbortController,a=null,s=d=>{a=r(d),n(a)},l=()=>{i.abort(),a&&o(a)},u={signal:i.signal};return e.setPointerCapture(t),e.addEventListener("pointermove",s,u),e.addEventListener("pointerup",l,u),e.addEventListener("pointercancel",l,u),s}function hZr(e,t,r,n){let o=sg(e,t),i=n-e[t].depth,a=e.slice(t,o).map(u=>({...u,depth:Math.max(0,u.depth+i)})),s=[...e.slice(0,t),...e.slice(o)],l=r>t?r-a.length:r;return{items:O3([...s.slice(0,l),...a,...s.slice(l)]),index:l}}function gZr(e,t,r){let[n,o]=(0,mZr.useState)(null);return{drag:n,onGrip:a=>s=>{let l=t.current;if(!l||s.pointerType==="mouse"&&s.button!==0)return;s.preventDefault(),pZr(s.currentTarget,s.pointerId,fZr(e,l,a,s.clientX),d=>o({from:a,depth:d.depth,top:d.top}),d=>{o(null),r(hZr(e,a,d.target,d.depth))})(s)}}}var sle=S(_(),1),xjo={my:1,px:1,py:.5,border:1,borderColor:"divider",borderRadius:1,position:"relative",userSelect:"text",cursor:"auto"},Sjo=[{text:"",depth:0}];function vZr({items:e,onChange:t}){let r=(0,yZr.useRef)(null),n=e.length>0?e:Sjo,o=uZr(n,t),{drag:i,onGrip:a}=gZr(n,r,o.onDrop),s=HXr(n.map(l=>l.depth));return(0,sle.jsxs)(H,{sx:xjo,ref:r,"data-preview-skip":!0,"aria-label":"Acceptance criteria",children:[n.map((l,u)=>(0,sle.jsx)(rZr,{index:u,number:s[u],item:l,outline:o,dragging:i?.from===u,onGrip:a(u)},`criterion-${u}`)),(0,sle.jsx)(YXr,{drag:i})]})}var bZr=S(_(),1),xZr=ot((0,bZr.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered");var lle=S(_(),1),Tjo={insert:"Add acceptance criteria",convert:"Convert to outline"};function SZr({kind:e,onClick:t}){return(0,lle.jsx)(H,{sx:{my:1},"data-preview-skip":!0,children:(0,lle.jsx)(nt,{size:"small",variant:"outlined",startIcon:e==="insert"?(0,lle.jsx)(Kd,{}):(0,lle.jsx)(xZr,{}),onClick:t,children:Tjo[e]})})}var cle=S(re(),1);function TZr(e,t,{color:r,pin:n}){let o=L6(e),i=[],a=o.nextNode();for(;a;){let u=a;if(t.intersectsNode(u)){let d=u===t.startContainer?t.startOffset:0,f=u===t.endContainer?t.endOffset:u.length;d<f&&i.push({node:u,start:d,end:f})}a=o.nextNode()}let l=i.map(u=>wjo(u.node,u.start,u.end,r)).at(-1);l&&n&&(l.dataset.pin=n)}function wjo(e,t,r,n){let o=document.createRange();o.setStart(e,t),o.setEnd(e,r);let i=document.createElement("mark");return i.className="pr-comment",i.style.backgroundColor=n,o.surroundContents(i),i}function wZr(e){for(let t of e.querySelectorAll("mark.pr-comment"))if(t.parentNode){for(;t.firstChild;)t.before(t.firstChild);t.remove()}}function CZr(e,t){for(let r of t){let n=aNt(e,r);n&&TZr(e,n,r)}}var ule=S(_(),1);function kZr({content:e,control:t,trailing:r,ranges:n,contentRef:o}){let i=(0,cle.useMemo)(()=>ND(e),[e]),a=(0,cle.useMemo)(()=>ND(r??""),[r]);return(0,cle.useLayoutEffect)(()=>{let s=o.current;s&&(wZr(s),CZr(s,n))},[i,a,n,o]),(0,ule.jsxs)(H,{ref:o,children:[(0,ule.jsx)(LD,{segments:i,skipDiagramText:!0}),t,t?(0,ule.jsx)(LD,{segments:a,skipDiagramText:!0}):null]})}var bN=e=>e.split(",").map(t=>`&& .markdown ${t.trim()}`).join(", ");function YPe(e){let{color:t,radius:r}=e.tokens;return{px:2.5,py:2,fontSize:14,lineHeight:1.6,[bN("")]:{lineHeight:1.6},[bN("h1, h2, h3, h4, h5, h6")]:{fontSize:15,fontWeight:600,lineHeight:1.4,mt:2,mb:1},[bN("ul, ol")]:{pl:2.5,mb:2},[bN("li")]:{mb:"6px"},[bN("code")]:{fontFamily:e.typography.fontFamilyMono,fontSize:"0.86em",px:"5px",py:0,bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:"4px"},[bN("pre")]:{bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:`${r.sm}px`},[bN("pre code")]:{border:0,px:0,bgcolor:"transparent"}}}var _Zr=e=>({flex:1,overflow:"auto",position:"relative",userSelect:"none",cursor:"text",wordBreak:"break-word","& .markdown":{...V$(e),maxWidth:"none"},"& a":{color:"primary.main"},"& mark.pr-comment":{color:"inherit",borderRadius:"2px"},...YPe(e)});var tY=S(_(),1);function EZr({content:e,control:t,trailing:r,ranges:n,wrapperRef:o,contentRef:i,dragRects:a,dragColor:s,onMouseDown:l,footer:u}){return(0,tY.jsxs)(H,{ref:o,onMouseDown:l,sx:_Zr,children:[(0,tY.jsx)(kZr,{content:e,control:t,trailing:r,ranges:n,contentRef:i}),u&&(0,tY.jsx)(H,{sx:{userSelect:"text"},children:u}),(0,tY.jsx)(M$,{rects:a,color:s})]})}function RZr(e){let t=new Map,r=[];for(let n of e){if(!n.group){r.push(n);continue}t.set(n.group,[...t.get(n.group)??[],n])}return{groups:[...t],ungrouped:r}}var KPe=S(re(),1),PZr=S(_(),1);function ygt({label:e,value:t,onCommit:r,listId:n}){let[o,i]=(0,KPe.useState)(t);return(0,KPe.useEffect)(()=>i(t),[t]),(0,PZr.jsx)(An,{size:"small",variant:"standard",fullWidth:!0,label:e,value:o,onChange:s=>i(s.target.value),onBlur:()=>{let s=o.trim();i(t),s!==t&&r(s)},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},onMouseDown:s=>s.stopPropagation(),slotProps:{htmlInput:{list:n}}})}var dle=S(_(),1),vgt="screenshot-groups";function Cjo(e){return(e.split(/[\\/]/).pop()??e).replace(/\.[^.]+$/,"")}function AZr({screenshot:e,onUpdate:t}){return(0,dle.jsxs)(St,{direction:"row",spacing:1,sx:{mt:.5},children:[(0,dle.jsx)(ygt,{label:"Caption",value:e.alt,onCommit:r=>t(e.id,{alt:r||Cjo(e.path)})}),(0,dle.jsx)(ygt,{label:"Group",value:e.group??"",listId:vgt,onCommit:r=>t(e.id,{group:r})})]})}var B3=S(_(),1),LZr={display:"block",maxWidth:"100%",borderRadius:1,border:1,borderColor:"divider"},kjo={position:"absolute",top:4,right:4,bgcolor:"background.paper","&:hover":{bgcolor:"background.paper"}};function IZr({screenshot:e,onRemove:t,onUpdate:r}){let n=e.contentType.startsWith("video/");return(0,B3.jsxs)(H,{sx:{position:"relative"},children:[n?(0,B3.jsx)(H,{component:"video",controls:!0,src:e.url,"aria-label":"screenshot",sx:LZr}):(0,B3.jsx)(H,{component:"img",src:e.url,alt:"screenshot",sx:LZr}),(0,B3.jsx)(Mt,{size:"small","aria-label":"Remove screenshot",sx:kjo,onMouseDown:o=>o.stopPropagation(),onClick:()=>t(e.id),children:(0,B3.jsx)(_o,{fontSize:"small"})}),(0,B3.jsx)(AZr,{screenshot:e,onUpdate:r})]})}var u0=S(_(),1);function _jo(){return(0,u0.jsxs)(St,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[(0,u0.jsx)(io,{size:16}),(0,u0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Attaching screenshot or video\u2026"})]})}function Ejo({error:e}){return(0,u0.jsx)(be,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:e})}function DZr({uploads:e,empty:t}){return e.length>0?(0,u0.jsx)(u0.Fragment,{children:e.map(r=>r.error?(0,u0.jsx)(Ejo,{error:r.error},r.id):(0,u0.jsx)(_jo,{},r.id))}):t?(0,u0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Drop or paste an image or video to attach"}):null}var d0=S(_(),1),Rjo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:1};function MZr({screenshots:e,uploads:t,onRemove:r,onUpdate:n}){let{groups:o,ungrouped:i}=RZr(e),a=s=>(0,d0.jsx)(IZr,{screenshot:s,onRemove:r,onUpdate:n},s.id);return(0,d0.jsxs)(H,{sx:{mt:3},children:[e.length>0&&(0,d0.jsx)(H,{component:"h2",children:"Screenshots"}),(0,d0.jsx)("datalist",{id:vgt,children:o.map(([s])=>(0,d0.jsx)("option",{value:s},s))}),o.map(([s,l])=>(0,d0.jsxs)(H,{sx:{mb:2},children:[(0,d0.jsx)(H,{component:"h3",children:s}),(0,d0.jsx)(H,{sx:Rjo,children:l.map(a)})]},s)),(0,d0.jsxs)(St,{spacing:1,children:[i.map(a),(0,d0.jsx)(DZr,{uploads:t,empty:e.length===0})]})]})}var fle=S(_(),1);function Pjo(e){let t=e.criteria;if(!t)return{content:e.body};let r={content:t.before,trailing:t.after};return t.kind==="outline"?{...r,control:(0,fle.jsx)(vZr,{items:t.items,onChange:e.onCriteriaChange})}:{...r,control:(0,fle.jsx)(SZr,{kind:t.kind,onClick:t.kind==="insert"?e.onCriteriaInsert:e.onCriteriaConvert})}}function XPe({pane:e,screenshots:t}){return(0,fle.jsx)(EZr,{...Pjo(e),ranges:e.ranges,wrapperRef:e.wrapperRef,contentRef:e.contentRef,dragRects:e.dragRects,dragColor:e.dragColor,onMouseDown:e.onMouseDown,footer:t?(0,fle.jsx)(MZr,{screenshots:e.screenshots,uploads:e.uploads,onRemove:e.removeScreenshot,onUpdate:e.updateScreenshot}):void 0})}var NZr=e=>({display:"grid",gap:1,maxHeight:220,overflow:"auto",px:2,py:1.25,borderTop:1,borderColor:e.tokens.color.lineSoft}),OZr={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},BZr=e=>({display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"4px 8px",px:1.25,py:1,borderRadius:`${e.tokens.radius.sm}px`,bgcolor:e.tokens.color.raised,border:1,borderColor:e.tokens.color.lineSoft,fontSize:12.5}),$Zr={gridColumn:2,gridRow:1,width:20,height:20,color:"text.disabled","& .MuiSvgIcon-root":{fontSize:14}};var lk=S(_(),1);function FZr({comments:e,colors:t,onRemove:r}){return(0,lk.jsxs)(H,{sx:NZr,children:[(0,lk.jsxs)(be,{sx:OZr,children:["Comments (",e.length,")"]}),e.map((n,o)=>(0,lk.jsxs)(H,{sx:BZr,children:[(0,lk.jsx)(A$,{text:n.quote,sx:{gridColumn:1,borderLeft:2,pl:1,borderColor:t[o]}}),(0,lk.jsx)(H,{sx:{gridColumn:1,wordBreak:"break-word"},children:n.note}),(0,lk.jsx)(Mt,{"aria-label":"Remove comment",onClick:()=>r(n.id),sx:$Zr,children:(0,lk.jsx)(_o,{})})]},n.id))]})}var HZr=S(_(),1);function zZr(e){return e.comments.length===0?null:(0,HZr.jsx)(FZr,{...e})}var UZr=S(_(),1),ZPe=ot((0,UZr.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Computer");var YZr=S(re(),1);var WZr=S(_(),1),VZr=ot((0,WZr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var f0="0.1184.0";var Ajo={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function GZr(e){return e?Ajo[e]:"success.main"}function qZr(e){return e.split("-")[0].split(".").map(Number)}function jZr(e,t){if(!e||!t||e===t)return;let r=qZr(e),n=qZr(t);for(let o=0;o<Math.max(r.length,n.length);o++){let i=(r[o]??0)-(n[o]??0);if(Number.isNaN(i))return;if(i!==0)return i<0?"behind":"ahead"}}var QPe=S(re(),1),bgt=(0,QPe.createContext)(null);function JPe(){return(0,QPe.useContext)(bgt)}var xN=S(_(),1),Ljo={height:16,fontSize:10},Ijo={opacity:.6,fontSize:"0.85em"};function Djo(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function $3({nodes:e,name:t,showVersion:r=!1}){let n=JPe()??f0,o=e.links.find(a=>a.name===t),i=jZr(o?.peerVersion,n);return(0,xN.jsx)(lr,{title:Djo(e,t),placement:"right",children:(0,xN.jsxs)(H,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,xN.jsx)(VZr,{sx:{fontSize:8,color:GZr(o?.state)}}),t,r&&o?.peerVersion&&(0,xN.jsxs)(H,{component:"span",sx:Ijo,children:["v",o.peerVersion]}),i&&(0,xN.jsx)(yn,{label:i,size:"small",color:i==="behind"?"warning":"info",sx:Ljo})]})})}var p0=S(_(),1),Mjo={textTransform:"none"};function eAe({nodes:e,options:t,target:r,onPick:n}){let[o,i]=(0,YZr.useState)(null);return(0,p0.jsxs)(p0.Fragment,{children:[(0,p0.jsx)(nt,{size:"small",color:"inherit",startIcon:(0,p0.jsx)(ZPe,{fontSize:"small"}),"aria-label":"Start on node","aria-haspopup":"menu",onClick:a=>i(a.currentTarget),sx:Mjo,children:(0,p0.jsx)($3,{nodes:e,name:r.node})}),(0,p0.jsx)(fi,{anchorEl:o,open:!!o,onClose:()=>i(null),children:t.map(({name:a,cwd:s})=>(0,p0.jsx)(Br,{disabled:!s,selected:a===r.node,onClick:()=>{n(a),i(null)},children:(0,p0.jsx)(Vu,{primary:(0,p0.jsx)($3,{nodes:e,name:a}),secondary:s?void 0:"no clone"})},a))})]})}var KZr=S(re(),1);function Njo(e,t){return e?.toLowerCase()===t.toLowerCase()}function tAe(e,t){let{nodes:r,names:n,visible:o}=ds(),{repos:i,selectedCwd:a,selectedNode:s,cloneOn:l,originOf:u}=_n(),[d,f]=(0,KZr.useState)(),p=e&&u(e)?e:a,h=t?i.find(b=>Njo(u(b),t)):p,m=n.map(b=>({name:b,cwd:h?l(h,b):void 0})),g=b=>m.find(x=>x.name===b&&x.cwd),y=g(d)??g(s??r?.local)??m.find(b=>b.cwd),v=o&&y?.cwd?{node:y.name,cwd:y.cwd}:void 0;return{nodes:r,visible:o,options:m,target:v,pick:f}}var F3=S(_(),1);function XZr({canStart:e,startOrigin:t,cwd:r,onApprove:n,onApproveAndStart:o}){let i=Xme(),a=tAe(r,t);return(0,F3.jsxs)(F3.Fragment,{children:[(0,F3.jsx)(nt,{color:"primary",variant:e?"tonal":"contained",onClick:n,...e?{}:i,children:"Approve"}),e&&a.nodes&&a.target&&(0,F3.jsx)(eAe,{nodes:a.nodes,options:a.options,target:a.target,onPick:a.pick}),e&&(0,F3.jsx)(nt,{color:"primary",variant:"contained",onClick:()=>o(a.target),...i,children:"Approve & start"})]})}var xgt=S(_(),1),Ojo={"& .MuiFormControlLabel-label":{fontSize:12}};function ple({label:e,title:t,checked:r,onChange:n}){return(0,xgt.jsx)($d,{control:(0,xgt.jsx)(Ip,{size:"small",checked:r,onChange:o=>n(o.target.checked)}),label:e,title:t,sx:Ojo})}var SN=S(_(),1);function rAe({chain:e,newPr:t,onChange:r}){return(0,SN.jsxs)(St,{direction:"row",sx:{mr:"auto"},children:[t&&(0,SN.jsx)(ple,{label:"Draft",title:"Create the PR as a draft rather than ready for review",checked:e.draft,onChange:n=>r({...e,draft:n,autoMerge:n?!1:e.autoMerge})}),(0,SN.jsx)(ple,{label:"Auto-merge (squash)",title:"Squash-merge the PR automatically once its required checks pass",checked:e.autoMerge,onChange:n=>r({...e,autoMerge:n,draft:n?!1:e.draft})}),(0,SN.jsx)(ple,{label:"Review PR",title:"After raising, run a review that posts its findings and then addresses them",checked:e.reviewAfter,onChange:n=>r({...e,reviewAfter:n})}),(0,SN.jsx)(ple,{label:"Post to Slack",title:"Announce the PR in Slack at the tail of the chain",checked:e.announceAfter,onChange:n=>r({...e,announceAfter:n})})]})}var TN=S(_(),1);function ZZr({commentCount:e,chain:t,newPr:r,canStart:n,startOrigin:o,onChainChange:i,onApprove:a,cwd:s,onApproveAndStart:l,onReject:u,onRequestChanges:d}){return(0,TN.jsxs)(St,{direction:"row",spacing:1,sx:{px:2,py:1.5,alignItems:"center",justifyContent:"flex-end"},children:[t&&(0,TN.jsx)(rAe,{chain:t,newPr:r,onChange:i}),(0,TN.jsx)(nt,{color:"error",variant:"outlined",onClick:u,children:"Reject"}),e>0&&(0,TN.jsxs)(nt,{color:"warning",variant:"tonal",onClick:d,children:["Request changes (",e,")"]}),(0,TN.jsx)(XZr,{canStart:n,startOrigin:o,cwd:s,onApprove:a,onApproveAndStart:l})]})}var JZr=S(_(),1);function QZr({comments:e,cwd:t,onDecision:r,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s}){let l=()=>e.map(u=>({quote:u.quote,note:u.note}));return(0,JZr.jsx)(ZZr,{commentCount:e.length,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s,onApprove:()=>r("approve",l()),cwd:t,onApproveAndStart:u=>r("approve",l(),u??!0),onReject:()=>r("reject",[]),onRequestChanges:()=>r("reject",l())})}var ck=S(_(),1);function eQr(e){let{comments:t,commentColors:r,pending:n,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onRemove:d,onCancel:f,onCollapse:p,editable:h}=e;return(0,ck.jsxs)(ck.Fragment,{children:[(0,ck.jsx)(zZr,{comments:t,colors:r,onRemove:d}),(0,ck.jsx)(qn,{}),(0,ck.jsx)(QZr,{...e}),(0,ck.jsx)(dye,{pending:n,editable:h,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onCancel:f,onCollapse:p})]})}var hle=S(_(),1),Bjo={px:2,pb:2,display:"flex",alignItems:"center",gap:1.5,minWidth:0},$jo={color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function tQr({url:e}){return(0,hle.jsxs)(H,{sx:Bjo,children:[(0,hle.jsx)(nt,{variant:"contained",href:e,target:"_blank",rel:"noopener noreferrer",sx:{flexShrink:0},children:"Open design \u2197"}),(0,hle.jsx)(be,{variant:"body2",sx:$jo,title:e,children:e})]})}var Sgt=S(_(),1);function rQr({preview:e}){let t=e.kind==="design"?e.metadata?.[0]?.url:void 0;return t?(0,Sgt.jsx)(tQr,{url:t}):(0,Sgt.jsx)(Jj,{items:e.metadata??[]})}function nQr({preview:e,pane:t,cwd:r,isPr:n,editable:o,sender:i,onCite:a,onAddRule:s}){return{comments:t.comments,commentColors:t.commentColors,pending:t.pending,cwd:r,unavailable:i.unavailable,onAdd:i.onSend,onQueue:t.onAdd,onCite:a,onAddRule:s,onRemove:t.remove,onCancel:t.onCancel,onCollapse:t.onCollapse,onDecision:t.onDecide,chain:n?t.chain:void 0,editable:o,newPr:n&&e.prNumber===null,canStart:e.kind==="backlog-item"&&e.canStart===!0,startOrigin:e.startOrigin,onChainChange:t.setChain}}function rY(e){let t=e??"pr";return{isPr:t==="pr",screenshots:t==="pr"||t==="github-issue",editable:t==="github-issue-edit",closeOnly:t==="show"}}function oQr(e,t){return e?`${e}:${t??"pr"}`:void 0}function nAe(e,t,r,n){return{...rY(e.kind),requestId:e.requestId,supersedes:e.supersedes,sessionId:t,cwd:r,onDecision:n,screenshotScope:oQr(t,e.kind),seededScreenshots:e.screenshots??[],chainDefaults:{draft:e.draft===!0,reviewAfter:e.reviewAfter??!0},initialBody:e.body}}function iQr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&ul(t,e,Jke({quote:r,note:o})),n()}}function aQr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&ul(t,e,zx(r,Qge(o))),n()}}function oAe(e,t,r,n){return{onCite:aQr(e,t,r,n),onAddRule:iQr(e,t,r,n)}}function sQr(e){return{criteria:e.criteria,onCriteriaChange:e.writeCriteria,onCriteriaInsert:e.insertCriteria,onCriteriaConvert:e.convertCriteria}}var gQr=S(re(),1);var uk=S(re(),1);var lQr="assist:pr-preview-comments:",Tgt=e=>`${lQr}${e}`;function wgt(e){return dl(Tgt(e))}function mle(e,t){Il(Tgt(e),t)}function iAe(e){$v(Tgt(e))}function cQr(){Hx(lQr)}function uQr(e){let t=L6(e),r="";for(let n=t.nextNode();n;n=t.nextNode())r+=n.textContent??"";return r}function Fjo(e,t,r){let n=-1;for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+1))(n===-1||Math.abs(o-r)<Math.abs(n-r))&&(n=o);return n}function dQr(e,t){return e.flatMap(r=>{let n=Fjo(t,r.quote,r.start);return n===-1?[]:[{...r,start:n,end:n+r.quote.length}]})}function fQr(e,t,r){let n=wgt(e);if(n.length>0||!t||!r)return n;let o=dQr(wgt(t),uQr(r));return mle(e,o),iAe(t),o}function pQr(e,t,r){let[n,o]=(0,uk.useState)([]),i=(0,uk.useRef)(0);(0,uk.useEffect)(()=>{cQr(),o(fQr(e,t,r.current).map(l=>({...l,id:i.current++})))},[e,t,r]);let a=(0,uk.useCallback)(l=>{o(u=>{let d=[...u,{...l,id:i.current++}];return mle(e,d),d})},[e]),s=(0,uk.useCallback)(l=>{o(u=>{let d=u.filter(f=>f.id!==l);return mle(e,d),d})},[e]);return{comments:n,add:a,remove:s}}function hQr(e,t){let r=e.map((i,a)=>mG(a).solid),n=mG(e.length).fill,o=e.map((i,a)=>({start:i.start,end:i.end,color:mG(a).fill,pin:String(a+1)}));return t&&o.push({start:t.start,end:t.end,color:n}),{commentColors:r,dragColor:n,ranges:o}}function mQr(e,t,r,n){return{onAdd:o=>{e&&t({quote:e.quote,note:o,start:e.start,end:e.end}),n()},onCollapse:()=>{e&&r(e.quote),n()}}}function yQr(e,t,r){let{wrapperRef:n,contentRef:o,pending:i,dragRects:a,onMouseDown:s,clear:l,select:u}=Uy(),{comments:d,add:f,remove:p}=pQr(e,t,o),{commentColors:h,dragColor:m,ranges:g}=(0,gQr.useMemo)(()=>hQr(d,i),[d,i]),{onAdd:y,onCollapse:v}=mQr(i,f,r,l);return{wrapperRef:n,contentRef:o,onMouseDown:s,comments:d,commentColors:h,remove:p,pending:i,ranges:g,dragRects:a,dragColor:m,onAdd:y,onCollapse:v,onCancel:l,onSelect:u}}var sAe=S(re(),1);var Cgt="assist:preview-screenshots:",kgt=e=>`${Cgt}${e}`,aAe=e=>`${Cgt}seeded:${e}`;function vQr(e){return e?(Hx(Cgt),dl(kgt(e)).filter(t=>typeof t.path=="string")):[]}function wN(e,t){e&&Il(kgt(e),t.map(({path:r,alt:n,group:o,contentType:i,seeded:a})=>({path:r,alt:n,group:o,contentType:i,seeded:a})))}function bQr(e){e&&($v(kgt(e)),$v(aAe(e)))}var CN=S(re(),1);var xQr={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov"};function zjo(e){let t=e.split(".").pop()?.toLowerCase();return Object.entries(xQr).find(([,n])=>n===t)?.[0]??"application/octet-stream"}function SQr(e){return e.map(t=>({...t,contentType:zjo(t.path),seeded:!0}))}function TQr(e,t,r){if(!e)return SQr(r);let n=vQr(e);if(dl(aAe(e))[0]===t)return n;let o=[...SQr(r),...n.filter(i=>!i.seeded)];return wN(e,o),Il(aAe(e),[t]),o}function wQr(e,t){let r=new URLSearchParams({path:e});return t&&r.set("node",t),fT(`/api/pr-preview/image?${r}`)}function CQr(e,t,r){let[n,o]=(0,CN.useState)([]),i=(0,CN.useRef)(0),a=ur(),s=(0,CN.useRef)(r);return s.current=r,(0,CN.useEffect)(()=>{o(TQr(e,t,s.current).map(l=>({...l,url:wQr(l.path,a),id:i.current++})))},[e,t,a]),{screenshots:n,setScreenshots:o,nextId:i}}var kQr=S(re(),1);function _Qr(e,t){return(0,kQr.useCallback)((r,n)=>{t(o=>{let i=o.map(a=>a.id===r?{...a,...n}:a);return wN(e,i),i})},[e,t])}function EQr(e,t,r){let{screenshots:n,setScreenshots:o,nextId:i}=CQr(e,t,r),a=(0,sAe.useCallback)(d=>{o(f=>{let p=[...f,{...d,id:i.current++}];return wN(e,p),p})},[e,o,i]),s=(0,sAe.useCallback)(d=>{o(f=>{let p=f.find(m=>m.id===d);p?.url.startsWith("blob:")&&URL.revokeObjectURL(p.url);let h=f.filter(m=>m.id!==d);return wN(e,h),h})},[e,o]),l=_Qr(e,o),u=(0,sAe.useCallback)(()=>bQr(e),[e]);return{screenshots:n,add:a,remove:s,update:l,clearPersisted:u}}var nY=S(re(),1);async function RQr(e,t,r){let n=new URLSearchParams;t&&n.set("cwd",t),r&&n.set("node",r),e instanceof File&&e.name&&n.set("name",e.name);let o=await Ut(`/api/pr-preview/upload-image?${n}`,{method:"POST",headers:{"Content-Type":e.type||"application/octet-stream"},body:e,timeoutMs:12e4}),i=await o.json().catch(()=>null);if(!o.ok||!i?.path)throw new Error(i?.error??"Failed to attach file");return{path:i.path,alt:i.alt??"screenshot"}}var IQr=S(re(),1);function PQr(e){return e.startsWith("image/")||e.startsWith("video/")}function AQr(e){if(!e)return null;for(let t of e.items)if(t.kind==="file"&&PQr(t.type)){let r=t.getAsFile();if(r)return r}return null}function LQr(e){return e?Array.from(e.files).find(t=>PQr(t.type))??null:null}function DQr(e,t){return(0,IQr.useEffect)(()=>{if(!t)return;let o=i=>{let a=AQr(i.clipboardData);a&&(i.preventDefault(),e(a))};return globalThis.addEventListener("paste",o),()=>globalThis.removeEventListener("paste",o)},[e,t]),t?{onDrop:o=>{let i=LQr(o.dataTransfer);i&&(o.preventDefault(),e(i))},onDragOver:o=>{Array.from(o.dataTransfer.items).some(i=>i.kind==="file")&&o.preventDefault()}}:{onDrop:void 0,onDragOver:void 0}}function MQr(e,t,r){let[n,o]=(0,nY.useState)([]),i=(0,nY.useRef)(0),a=ur(),s=(0,nY.useCallback)(async d=>{let f=i.current++;o(p=>[...p.filter(h=>!h.error),{id:f}]);try{let p=await RQr(d,e,a);t({...p,url:URL.createObjectURL(d),contentType:d.type}),o(h=>h.filter(m=>m.id!==f))}catch(p){let h=p instanceof Error?p.message:"Failed to attach file";o(m=>m.map(g=>g.id===f?{id:f,error:h}:g))}},[e,a,t]),{onDrop:l,onDragOver:u}=DQr(s,r);return{uploads:n,onDrop:l,onDragOver:u}}function NQr({cwd:e,screenshots:t,screenshotScope:r,requestId:n,seededScreenshots:o}){let{screenshots:i,add:a,remove:s,update:l,clearPersisted:u}=EQr(t?r:void 0,n,t?o:[]),{uploads:d,onDrop:f,onDragOver:p}=MQr(e,a,t);return{screenshots:i,removeScreenshot:s,updateScreenshot:l,decision:{attachments:()=>i.map(({path:h,alt:m,group:g})=>g?{path:h,alt:m,group:g}:{path:h,alt:m}),clearPersisted:u},uploads:d,onDrop:f,onDragOver:p}}var VQr=S(re(),1);var OQr="assist:pr-preview-chain:",_gt=e=>`${OQr}${e}`;function BQr(e){if(e)return dl(_gt(e))[0]}function $Qr(e,t){e&&Il(_gt(e),[t])}function FQr(e){e&&$v(_gt(e))}function zQr(){Hx(OQr)}function HQr(e,t,r){if(!e)return{reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1};zQr();let n=BQr(t);return{reviewAfter:n?.reviewAfter??r.reviewAfter,announceAfter:n?.announceAfter??!0,draft:n?.draft??r.draft,autoMerge:n?.autoMerge??!1}}function UQr(e,t,r,n,o){return{comments:t,screenshots:n,reviewAfter:e&&r.reviewAfter,announceAfter:e&&r.announceAfter,draft:r.draft,autoMerge:e&&r.autoMerge,...o===void 0?{}:{body:o}}}function WQr(e,t){return!e||t===!1?{}:t===!0?{autostart:!0}:{autostart:!0,startOn:t}}function GQr(e,t,r,n,o,i,a){let[s,l]=(0,VQr.useState)(()=>HQr(n,t,o));return{chain:s,setChain:f=>{l(f),$Qr(t,f)},onDecide:(f,p,h=!1)=>{let m=f==="approve";r(f,{...UQr(m,p,s,m?i.attachments():[],a()),...WQr(m,h)}),iAe(e),m&&(FQr(t),i.clearPersisted())}}}var tJr=S(re(),1);var Hjo=/^ {0,3}#{1,6}[ \t]+acceptance criteria[ \t]*$/i,Ujo=/^ {0,3}#{1,6}[ \t]/;function z3(e){let t=e.split(`
|
|
4143
|
+
`),additions:uXr(o,"+"),deletions:uXr(o,"-"),split:{hunks:o.length,of:n.length,elsewhere:i}}}function fXr(e){return e.flatMap(t=>{if(t.kind==="dir")return fXr(t.children);let{kind:r,name:n,...o}=t;return[o]})}function ijo(e){let t=new Map;return e.forEach((r,n)=>{for(let o of r.hunks)t.set(o,[...t.get(o)??[],n+1])}),t}function pXr(e,t,r=new Set,n=new Set){let o=fXr(e.tree).filter(a=>!r.has(a.path)).map(a=>n.has(a.path)?{...a,critical:!0}:a),i=ijo(t);return t.map((a,s)=>{let l=new Set(a.hunks.map(Vj));return aXr(o.filter(u=>l.has(u.path)).map(u=>dXr(u,s+1,i)))})}function ajo(e,t){let r=-1,n=0;return t.forEach((o,i)=>{let a=o.hunks.filter(s=>Vj(s)===e).length;a>n&&(r=i,n=a)}),r}function hXr(e,t){let r=t.map(()=>[]);for(let n of e)r[ajo(n.path,t)]?.push(n);return r}function mXr(e,t){let r=pXr(e.structure,t,new Set(e.tests.map(i=>i.path)),new Set(e.criticalDiffs.map(i=>i.path))),n=hXr(e.tests,t),o=yPe(t);return t.map((i,a)=>{let s=a+1;return{number:s,slice:i,structure:r[a]??e.structure,tests:n[a]??[],critical:e.criticalDiffs.filter(l=>o.get(l.path)?.some(u=>u.number===s))}})}function gXr(e){if(!e.slices)return;let t=mXr(e,e.slices);return{entries:QKr(e,t),slicing:{count:t.length,noCritical:new Set(t.filter(r=>r.critical.length===0).map(r=>r.number))}}}function yXr(e){if(!(!e.repo||!e.headSha))return`${e.repo}#${e.prNumber}@${e.headSha}`}var ugt="assist:high-level-progress:",sjo=`${ugt}head:`,ljo=720*60*60*1e3,ile=e=>`${ugt}${e}`,dgt=e=>`${sjo}${e}`,cgt=e=>dl(e)[0];function cjo(e,t){let r=e?cgt(ile(e)):void 0;return e&&$v(ile(e)),r??(t?cgt(dgt(t)):void 0)}function vXr(e,t,r){return Hx(ugt,ljo),cgt(ile(e))??cjo(t,r)}function bXr(e,t,r){Il(ile(e),[r]),t&&Il(dgt(t),[r])}function xXr(e,t){$v(ile(e)),t&&$v(dgt(t))}function SXr(e){let t=e;return typeof t?.id=="string"&&typeof t.title=="string"&&typeof t.reason=="string"&&(t.kind==="deterministic"||t.kind==="manual")&&["pass","fail","manual"].includes(t.status)}function gN(e,t){return Array.isArray(e)?t?e.filter(t):e:[]}var fgt=e=>typeof e=="string"?e:"";function TXr(e){return{repo:fgt(e.repo),prNumber:typeof e.prNumber=="number"?e.prNumber:0,headSha:fgt(e.headSha),body:fgt(e.body)}}var pgt={repo:"",prNumber:0,headSha:"",body:"",checks:[],structure:{tree:[],added:0,removed:0,modified:0,additions:0,deletions:0},criticalDiffs:[],criticalPaths:[],tests:[],testPaths:[],collapsedPaths:[]};function wXr(e){let t;try{t=JSON.parse(e)}catch{return pgt}return typeof t!="object"||t===null?pgt:{...TXr(t),checks:gN(t.checks,SXr),structure:{...pgt.structure,...t.structure},criticalDiffs:gN(t.criticalDiffs),criticalPaths:gN(t.criticalPaths),tests:gN(t.tests),testPaths:gN(t.testPaths),collapsedPaths:gN(t.collapsedPaths),...Array.isArray(t.slices)?{slices:t.slices}:{},...t.manualTesting?{manualTesting:t.manualTesting}:{},...t.saved?{saved:t.saved}:{},...t.draft?{draft:t.draft}:{}}}function CXr(e){let t=(0,zPe.useMemo)(()=>wXr(e.body),[e.body]),r=(0,zPe.useMemo)(()=>gXr(t),[t]),n=yXr(t),o=(0,zPe.useMemo)(()=>vXr(e.requestId,e.supersedes,n)??t.draft??t.saved,[e.requestId,e.supersedes,n,t]);return{payload:t,sliced:r,progress:o,head:n}}var kXr=S(re(),1);function _Xr(e){let[t,r]=(0,kXr.useState)(()=>e?.reviewComments??[]);return{queued:t,onQueue:n=>r(o=>[...o,n]),onRemove:n=>r(o=>o.filter((i,a)=>a!==n)),onEdit:(n,o)=>r(i=>i.map((a,s)=>s===n?{...a,note:o}:a))}}var EXr=S(re(),1);function RXr(e,t,r,n){(0,EXr.useEffect)(()=>{bXr(e,t,{items:r,reviewComments:n})},[e,t,r,n])}function AXr(e,t,r){let{payload:n,sliced:o,progress:i,head:a}=CXr(e),s=XKr(n.checks,i,o?.slicing),l=_Xr(i),u=zKr(o?.entries??[]),{comments:d,sentTo:f,clearSent:p}=Q3e(t,r),h={...d,onQueue:l.onQueue};RXr(e.requestId,a,s.items,l.queued);let m=(0,PXr.useMemo)(()=>GKr(n),[n]);return{payload:n,checklist:s,queue:l,details:VKr(n,h),counts:m,sentTo:f,clearSent:p,sliced:o,nav:u,diffComments:h,head:a}}var PS=S(_(),1);function LXr({preview:e,session:t,sendInput:r,onDecision:n}){let o=AXr(e,t,r);return(0,PS.jsxs)(H,{sx:r0,children:[(0,PS.jsx)(Ih,{preview:e,draft:!1}),(0,PS.jsx)(Jj,{items:e.metadata??[]}),(0,PS.jsx)(qn,{}),(0,PS.jsx)(kKr,{payload:o.payload,checklist:o.checklist,details:o.details,counts:o.counts,sliced:o.sliced,nav:o.nav,comments:o.diffComments}),(0,PS.jsx)(qn,{}),(0,PS.jsx)($Kr,{pane:o,onDecision:(i,a)=>{xXr(e.requestId,o.head),n(i,a)}}),(0,PS.jsx)(kh,{sessionName:o.sentTo,onClose:o.clearSent})]})}var FXr=S(re(),1);var yN=S(_(),1);function ujo(e){return e.topLeft===null?"Click the top-left box":e.bottomRight===null?"Now click the bottom-right box":"Both anchors picked"}function IXr({selection:e,onConfirm:t,onReject:r}){let n=e.topLeft!==null&&e.bottomRight!==null;return(0,yN.jsxs)(St,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,yN.jsx)(be,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:ujo(e)}),(0,yN.jsx)(nt,{color:"error",variant:"outlined",onClick:r,children:"Cancel"}),(0,yN.jsx)(nt,{variant:"outlined",onClick:e.reset,children:"Start over"}),(0,yN.jsx)(nt,{color:"success",variant:"contained",disabled:!n,onClick:t,children:"Extract boxes"})]})}var djo={"top-left":oc.miro.topLeft,"bottom-right":oc.miro.bottomRight};function DXr(e,t){let r=e.right-e.left,n=e.bottom-e.top;return{width:r,height:n,fontSize:Math.max(6,Math.min(n*.3,r/6,28)),radius:Math.min(8,n/4),colour:t?djo[t]:oc.miro.box,opacity:t?.75:.35,strokeWidth:Math.max(1,r*.004)}}var ale=S(_(),1);function MXr({box:e,role:t,onSelect:r}){let n=DXr(e,t);return(0,ale.jsxs)("g",{role:"button",tabIndex:0,"aria-label":t?`${e.text} (${t})`:e.text,onClick:()=>r(e.id),onKeyDown:o=>{o.key==="Enter"&&r(e.id)},style:{cursor:"pointer"},children:[(0,ale.jsx)("rect",{x:e.left,y:e.top,width:n.width,height:n.height,rx:n.radius,fill:n.colour,fillOpacity:n.opacity,stroke:n.colour,strokeWidth:n.strokeWidth}),(0,ale.jsx)("text",{x:e.left+n.width/2,y:e.top+n.height/2,textAnchor:"middle",dominantBaseline:"central",fontSize:n.fontSize,fill:oc.miro.text,children:e.text})]})}function NXr(e){if(e.length===0)return"0 0 100 100";let t=Math.min(...e.map(a=>a.left)),r=Math.min(...e.map(a=>a.top)),n=Math.max(...e.map(a=>a.right))-t,o=Math.max(...e.map(a=>a.bottom))-r,i=Math.max(n*.02,8);return`${t-i} ${r-i} ${n+i*2} ${o+i*2}`}var HPe=S(_(),1);function OXr({boxes:e,selection:t}){return(0,HPe.jsx)(H,{sx:{flex:1,minHeight:0,overflow:"auto",p:2},children:(0,HPe.jsx)("svg",{role:"img","aria-label":"Miro board boxes",viewBox:NXr(e),preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:e.map(r=>(0,HPe.jsx)(MXr,{box:r,role:t.roleOf(r.id),onSelect:t.choose},r.id))})})}function fjo(e){return typeof e?.id=="string"&&typeof e.text=="string"&&[e.left,e.top,e.right,e.bottom].every(t=>typeof t=="number"&&Number.isFinite(t))}function BXr(e){try{let t=JSON.parse(e);return Array.isArray(t?.boxes)?t.boxes.filter(fjo):[]}catch{return[]}}var hgt=S(re(),1);function $Xr(){let[e,t]=(0,hgt.useState)(null),[r,n]=(0,hgt.useState)(null);return{topLeft:e,bottomRight:r,choose:s=>{if(e===null||r!==null){t(s),n(null);return}n(s)},reset:()=>{t(null),n(null)},roleOf:s=>s===e?"top-left":s===r?"bottom-right":null}}var N3=S(_(),1);function zXr({preview:e,onDecision:t}){let r=(0,FXr.useMemo)(()=>BXr(e.body),[e.body]),n=$Xr();return(0,N3.jsxs)(H,{sx:r0,children:[(0,N3.jsx)(Ih,{preview:e,draft:!1}),(0,N3.jsx)(qn,{}),(0,N3.jsx)(OXr,{boxes:r,selection:n}),(0,N3.jsx)(qn,{}),(0,N3.jsx)(IXr,{selection:n,onConfirm:()=>{let{topLeft:i,bottomRight:a}=n;i===null||a===null||t("approve",Vc({topLeft:i,bottomRight:a}))},onReject:()=>t("reject",Vc())})]})}var yZr=S(re(),1);function HXr(e){let t=[];return e.map(r=>(t.length=r+1,t[r]=(t[r]??0)+1,t.map(n=>n??1).join(".")))}function UPe(e){return e*22}function UXr(e){return Math.round(e/22)}var WXr={display:"flex",alignItems:"flex-start",gap:.25,"& .criterion-action":{opacity:0,transition:"opacity 120ms"},"&:hover .criterion-action":{opacity:1},"&:focus-within .criterion-action":{opacity:1},"& .criterion-action:focus-visible":{opacity:1}},VXr={p:.25,mt:"2px",color:"text.disabled",cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},GXr={fontFamily:"fontFamilyMono",fontSize:"0.8rem",color:"text.secondary",minWidth:32,pt:"5px",textAlign:"right",userSelect:"none",whiteSpace:"nowrap"},qXr={flex:1,fontSize:"inherit",lineHeight:1.5,px:.75,py:0,borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focused":{bgcolor:"action.selected"}},mgt={p:.25,mt:"2px"},jXr={position:"absolute",right:8,height:2,borderRadius:1,bgcolor:"primary.main",pointerEvents:"none"};var KXr=S(_(),1),pjo=8;function YXr({drag:e}){return e?(0,KXr.jsx)(H,{sx:jXr,style:{top:e.top-1,left:pjo+UPe(e.depth)}}):null}var XXr=S(_(),1),ZXr=ot((0,XXr.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");var ggt=S(_(),1);function QXr({number:e,onGrip:t}){return(0,ggt.jsx)(Mt,{size:"small",className:"criterion-action",sx:VXr,"aria-label":`Reorder criterion ${e}`,onPointerDown:t,children:(0,ggt.jsx)(ZXr,{fontSize:"inherit"})})}var sk=S(_(),1);function JXr({number:e,onAdd:t,onDelete:r}){return(0,sk.jsxs)(sk.Fragment,{children:[(0,sk.jsx)(Mt,{size:"small",className:"criterion-action",sx:mgt,"aria-label":`Add criterion after ${e}`,onClick:t,children:(0,sk.jsx)(Kd,{fontSize:"inherit"})}),(0,sk.jsx)(Mt,{size:"small",className:"criterion-action",sx:mgt,"aria-label":`Delete criterion ${e}`,onClick:r,children:(0,sk.jsx)(_o,{fontSize:"inherit"})})]})}var WPe=S(re(),1);function eZr(e,t){return e==="start"?0:e==="end"?t:Math.min(Math.max(e,0),t)}function tZr(e){let t=(0,WPe.useRef)(null);return(0,WPe.useEffect)(()=>{let r=t.current;if(!e||!r)return;r.focus();let n=eZr(e.caret,r.value.length);r.setSelectionRange(n,n)},[e]),t}var vN=S(_(),1);function rZr({index:e,number:t,item:r,outline:n,dragging:o,onGrip:i}){let a=tZr(n.focus?.index===e?n.focus:null),s={marginLeft:UPe(r.depth),opacity:o?.4:1};return(0,vN.jsxs)(H,{sx:WXr,"data-criterion-row":!0,style:s,children:[(0,vN.jsx)(QXr,{number:t,onGrip:i}),(0,vN.jsx)(H,{component:"span",sx:GXr,"aria-hidden":"true",children:`${t}.`}),(0,vN.jsx)(zi,{multiline:!0,value:r.text,sx:qXr,inputRef:a,inputProps:{"aria-label":`Criterion ${t}`},onChange:l=>n.onText(e,l.target.value),onKeyDown:l=>n.onKeyDown(e,l)}),(0,vN.jsx)(JXr,{number:t,onAdd:()=>n.onAdd(e),onDelete:()=>n.onDelete(e)})]})}var cZr=S(re(),1);function nZr(e,t,{key:r,shift:n,alt:o,caret:i,text:a}){return o||n?null:r==="ArrowUp"&&i===0&&t>0?{kind:"focus",index:t-1}:r==="ArrowDown"&&i===a.length&&t<e.length-1?{kind:"focus",index:t+1}:null}function O3(e){if(e.length===0)return[{text:"",depth:0}];let t=-1;return e.map(r=>{let n=Math.min(Math.max(r.depth,0),t+1);return t=n,r.depth===n?r:{...r,depth:n}})}function VPe(e,t,r,n){let o=e[t]?.depth??0,i=e.map((a,s)=>s===t?{...a,text:r}:a);return{items:O3([...i.slice(0,t+1),{text:n,depth:o},...i.slice(t+1)]),index:t+1}}function sg(e,t){let r=t+1;for(;r<e.length&&e[r].depth>e[t].depth;)r+=1;return r}function GPe(e,t){let r=e[t].depth;for(let n=t-1;n>=0;n-=1){if(e[n].depth<r)return-1;if(e[n].depth===r)return n}return-1}function oZr(e,t){let r=sg(e,t);return r<e.length&&e[r].depth===e[t].depth?r:-1}function iZr(e,t,r){let n=r<0?GPe(e,t):oZr(e,t);if(n<0)return null;let o=sg(e,t),i=e.slice(t,o),a=[...e.slice(0,t),...e.slice(o)],s=r<0?n:sg(e,n)-(o-t);return{items:[...a.slice(0,s),...i,...a.slice(s)],index:s}}function qPe(e,t){let r=sg(e,t),n=e.map((o,i)=>i>t&&i<r?{...o,depth:o.depth-1}:o).filter((o,i)=>i!==t);return{items:O3(n),index:Math.max(0,t-1)}}function aZr(e,t,r){if(r<0&&e[t].depth===0||r>0&&GPe(e,t)<0)return null;let n=sg(e,t);return e.map((o,i)=>i>=t&&i<n?{...o,depth:o.depth+r}:o)}function jPe(e,t){return e?{kind:"edit",edit:e,caret:t}:null}function hjo(e,t,{caret:r,text:n}){let o=n.slice(0,r);return jPe(VPe(e,t,o,n.slice(r)),"start")}function mjo(e,t,{shift:r,caret:n}){let o=aZr(e,t,r?-1:1);return jPe(o?{items:o,index:t}:null,n)}function sZr(e,t,r){let{key:n,shift:o,alt:i,caret:a,text:s}=r;return n==="Enter"&&!o?hjo(e,t,r):n==="Tab"?mjo(e,t,r):i&&(n==="ArrowUp"||n==="ArrowDown")?jPe(iZr(e,t,n==="ArrowUp"?-1:1),a):n==="Backspace"&&a===0&&s===""?jPe(qPe(e,t),"end"):null}function lZr(e,t,r){return sZr(e,t,r)??nZr(e,t,r)}function uZr(e,t){let[r,n]=(0,cZr.useState)(null),o=(a,s)=>{a&&(t(a.items),n({index:a.index,caret:s}))};return{focus:r,onKeyDown:(a,s)=>{let l=s.currentTarget;(s.key==="Enter"||s.key==="Tab")&&s.preventDefault();let u=lZr(e,a,{key:s.key,shift:s.shiftKey,alt:s.altKey,caret:l.selectionStart??0,text:l.value});u&&(s.preventDefault(),u.kind==="focus"?n({index:u.index,caret:"end"}):o(u.edit,u.caret))},onDrop:a=>o(a,"end"),onText:(a,s)=>t(e.map((l,u)=>u===a?{...l,text:s}:l)),onAdd:a=>o(VPe(e,a,e[a].text,""),"start"),onDelete:a=>o(qPe(e,a),"end")}}var mZr=S(re(),1);function gjo(e,t,r,n){let o=t.length;for(let a=0;a<e.length;a+=1)if(n<e[a].top+e[a].height/2){o=a;break}let i=sg(t,r);return o>r&&o<i?r:o}function yjo(e,t,r,n){let o=sg(e,t),i=r-1,a=i>=t&&i<o?t-1:i,s=a>=0?e[a].depth+1:0;return Math.max(0,Math.min(e[t].depth+UXr(n),s))}function vjo(e,t){if(t<e.length)return e[t].top;let r=e[e.length-1];return r?r.top+r.height:0}function dZr(e,t,r,n,o){let i=gjo(e,t,r,o);return{target:i,depth:yjo(t,r,i,n),top:vjo(e,i)}}function bjo(e){let t=e.getBoundingClientRect().top;return{boxes:Array.from(e.querySelectorAll("[data-criterion-row]")).map(n=>{let o=n.getBoundingClientRect();return{top:o.top-t,height:o.height}}),origin:t}}function fZr(e,t,r,n){return o=>{let{boxes:i,origin:a}=bjo(t);return dZr(i,e,r,o.clientX-n,o.clientY-a)}}function pZr(e,t,r,n,o){let i=new AbortController,a=null,s=d=>{a=r(d),n(a)},l=()=>{i.abort(),a&&o(a)},u={signal:i.signal};return e.setPointerCapture(t),e.addEventListener("pointermove",s,u),e.addEventListener("pointerup",l,u),e.addEventListener("pointercancel",l,u),s}function hZr(e,t,r,n){let o=sg(e,t),i=n-e[t].depth,a=e.slice(t,o).map(u=>({...u,depth:Math.max(0,u.depth+i)})),s=[...e.slice(0,t),...e.slice(o)],l=r>t?r-a.length:r;return{items:O3([...s.slice(0,l),...a,...s.slice(l)]),index:l}}function gZr(e,t,r){let[n,o]=(0,mZr.useState)(null);return{drag:n,onGrip:a=>s=>{let l=t.current;if(!l||s.pointerType==="mouse"&&s.button!==0)return;s.preventDefault(),pZr(s.currentTarget,s.pointerId,fZr(e,l,a,s.clientX),d=>o({from:a,depth:d.depth,top:d.top}),d=>{o(null),r(hZr(e,a,d.target,d.depth))})(s)}}}var sle=S(_(),1),xjo={my:1,px:1,py:.5,border:1,borderColor:"divider",borderRadius:1,position:"relative",userSelect:"text",cursor:"auto"},Sjo=[{text:"",depth:0}];function vZr({items:e,onChange:t}){let r=(0,yZr.useRef)(null),n=e.length>0?e:Sjo,o=uZr(n,t),{drag:i,onGrip:a}=gZr(n,r,o.onDrop),s=HXr(n.map(l=>l.depth));return(0,sle.jsxs)(H,{sx:xjo,ref:r,"data-preview-skip":!0,"aria-label":"Acceptance criteria",children:[n.map((l,u)=>(0,sle.jsx)(rZr,{index:u,number:s[u],item:l,outline:o,dragging:i?.from===u,onGrip:a(u)},`criterion-${u}`)),(0,sle.jsx)(YXr,{drag:i})]})}var bZr=S(_(),1),xZr=ot((0,bZr.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered");var lle=S(_(),1),Tjo={insert:"Add acceptance criteria",convert:"Convert to outline"};function SZr({kind:e,onClick:t}){return(0,lle.jsx)(H,{sx:{my:1},"data-preview-skip":!0,children:(0,lle.jsx)(nt,{size:"small",variant:"outlined",startIcon:e==="insert"?(0,lle.jsx)(Kd,{}):(0,lle.jsx)(xZr,{}),onClick:t,children:Tjo[e]})})}var cle=S(re(),1);function TZr(e,t,{color:r,pin:n}){let o=L6(e),i=[],a=o.nextNode();for(;a;){let u=a;if(t.intersectsNode(u)){let d=u===t.startContainer?t.startOffset:0,f=u===t.endContainer?t.endOffset:u.length;d<f&&i.push({node:u,start:d,end:f})}a=o.nextNode()}let l=i.map(u=>wjo(u.node,u.start,u.end,r)).at(-1);l&&n&&(l.dataset.pin=n)}function wjo(e,t,r,n){let o=document.createRange();o.setStart(e,t),o.setEnd(e,r);let i=document.createElement("mark");return i.className="pr-comment",i.style.backgroundColor=n,o.surroundContents(i),i}function wZr(e){for(let t of e.querySelectorAll("mark.pr-comment"))if(t.parentNode){for(;t.firstChild;)t.before(t.firstChild);t.remove()}}function CZr(e,t){for(let r of t){let n=aNt(e,r);n&&TZr(e,n,r)}}var ule=S(_(),1);function kZr({content:e,control:t,trailing:r,ranges:n,contentRef:o}){let i=(0,cle.useMemo)(()=>ND(e),[e]),a=(0,cle.useMemo)(()=>ND(r??""),[r]);return(0,cle.useLayoutEffect)(()=>{let s=o.current;s&&(wZr(s),CZr(s,n))},[i,a,n,o]),(0,ule.jsxs)(H,{ref:o,children:[(0,ule.jsx)(LD,{segments:i,skipDiagramText:!0}),t,t?(0,ule.jsx)(LD,{segments:a,skipDiagramText:!0}):null]})}var bN=e=>e.split(",").map(t=>`&& .markdown ${t.trim()}`).join(", ");function YPe(e){let{color:t,radius:r}=e.tokens;return{px:2.5,py:2,fontSize:14,lineHeight:1.6,[bN("")]:{lineHeight:1.6},[bN("h1, h2, h3, h4, h5, h6")]:{fontSize:15,fontWeight:600,lineHeight:1.4,mt:2,mb:1},[bN("ul, ol")]:{pl:2.5,mb:2},[bN("li")]:{mb:"6px"},[bN("code")]:{fontFamily:e.typography.fontFamilyMono,fontSize:"0.86em",px:"5px",py:0,bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:"4px"},[bN("pre")]:{bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:`${r.sm}px`},[bN("pre code")]:{border:0,px:0,bgcolor:"transparent"}}}var _Zr=e=>({flex:1,overflow:"auto",position:"relative",userSelect:"none",cursor:"text",wordBreak:"break-word","& .markdown":{...V$(e),maxWidth:"none"},"& a":{color:"primary.main"},"& mark.pr-comment":{color:"inherit",borderRadius:"2px"},...YPe(e)});var tY=S(_(),1);function EZr({content:e,control:t,trailing:r,ranges:n,wrapperRef:o,contentRef:i,dragRects:a,dragColor:s,onMouseDown:l,footer:u}){return(0,tY.jsxs)(H,{ref:o,onMouseDown:l,sx:_Zr,children:[(0,tY.jsx)(kZr,{content:e,control:t,trailing:r,ranges:n,contentRef:i}),u&&(0,tY.jsx)(H,{sx:{userSelect:"text"},children:u}),(0,tY.jsx)(M$,{rects:a,color:s})]})}function RZr(e){let t=new Map,r=[];for(let n of e){if(!n.group){r.push(n);continue}t.set(n.group,[...t.get(n.group)??[],n])}return{groups:[...t],ungrouped:r}}var KPe=S(re(),1),PZr=S(_(),1);function ygt({label:e,value:t,onCommit:r,listId:n}){let[o,i]=(0,KPe.useState)(t);return(0,KPe.useEffect)(()=>i(t),[t]),(0,PZr.jsx)(An,{size:"small",variant:"standard",fullWidth:!0,label:e,value:o,onChange:s=>i(s.target.value),onBlur:()=>{let s=o.trim();i(t),s!==t&&r(s)},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},onMouseDown:s=>s.stopPropagation(),slotProps:{htmlInput:{list:n}}})}var dle=S(_(),1),vgt="screenshot-groups";function Cjo(e){return(e.split(/[\\/]/).pop()??e).replace(/\.[^.]+$/,"")}function AZr({screenshot:e,onUpdate:t}){return(0,dle.jsxs)(St,{direction:"row",spacing:1,sx:{mt:.5},children:[(0,dle.jsx)(ygt,{label:"Caption",value:e.alt,onCommit:r=>t(e.id,{alt:r||Cjo(e.path)})}),(0,dle.jsx)(ygt,{label:"Group",value:e.group??"",listId:vgt,onCommit:r=>t(e.id,{group:r})})]})}var B3=S(_(),1),LZr={display:"block",maxWidth:"100%",borderRadius:1,border:1,borderColor:"divider"},kjo={position:"absolute",top:4,right:4,bgcolor:"background.paper","&:hover":{bgcolor:"background.paper"}};function IZr({screenshot:e,onRemove:t,onUpdate:r}){let n=e.contentType.startsWith("video/");return(0,B3.jsxs)(H,{sx:{position:"relative"},children:[n?(0,B3.jsx)(H,{component:"video",controls:!0,src:e.url,"aria-label":"screenshot",sx:LZr}):(0,B3.jsx)(H,{component:"img",src:e.url,alt:"screenshot",sx:LZr}),(0,B3.jsx)(Mt,{size:"small","aria-label":"Remove screenshot",sx:kjo,onMouseDown:o=>o.stopPropagation(),onClick:()=>t(e.id),children:(0,B3.jsx)(_o,{fontSize:"small"})}),(0,B3.jsx)(AZr,{screenshot:e,onUpdate:r})]})}var u0=S(_(),1);function _jo(){return(0,u0.jsxs)(St,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[(0,u0.jsx)(io,{size:16}),(0,u0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Attaching screenshot or video\u2026"})]})}function Ejo({error:e}){return(0,u0.jsx)(be,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:e})}function DZr({uploads:e,empty:t}){return e.length>0?(0,u0.jsx)(u0.Fragment,{children:e.map(r=>r.error?(0,u0.jsx)(Ejo,{error:r.error},r.id):(0,u0.jsx)(_jo,{},r.id))}):t?(0,u0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Drop or paste an image or video to attach"}):null}var d0=S(_(),1),Rjo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:1};function MZr({screenshots:e,uploads:t,onRemove:r,onUpdate:n}){let{groups:o,ungrouped:i}=RZr(e),a=s=>(0,d0.jsx)(IZr,{screenshot:s,onRemove:r,onUpdate:n},s.id);return(0,d0.jsxs)(H,{sx:{mt:3},children:[e.length>0&&(0,d0.jsx)(H,{component:"h2",children:"Screenshots"}),(0,d0.jsx)("datalist",{id:vgt,children:o.map(([s])=>(0,d0.jsx)("option",{value:s},s))}),o.map(([s,l])=>(0,d0.jsxs)(H,{sx:{mb:2},children:[(0,d0.jsx)(H,{component:"h3",children:s}),(0,d0.jsx)(H,{sx:Rjo,children:l.map(a)})]},s)),(0,d0.jsxs)(St,{spacing:1,children:[i.map(a),(0,d0.jsx)(DZr,{uploads:t,empty:e.length===0})]})]})}var fle=S(_(),1);function Pjo(e){let t=e.criteria;if(!t)return{content:e.body};let r={content:t.before,trailing:t.after};return t.kind==="outline"?{...r,control:(0,fle.jsx)(vZr,{items:t.items,onChange:e.onCriteriaChange})}:{...r,control:(0,fle.jsx)(SZr,{kind:t.kind,onClick:t.kind==="insert"?e.onCriteriaInsert:e.onCriteriaConvert})}}function XPe({pane:e,screenshots:t}){return(0,fle.jsx)(EZr,{...Pjo(e),ranges:e.ranges,wrapperRef:e.wrapperRef,contentRef:e.contentRef,dragRects:e.dragRects,dragColor:e.dragColor,onMouseDown:e.onMouseDown,footer:t?(0,fle.jsx)(MZr,{screenshots:e.screenshots,uploads:e.uploads,onRemove:e.removeScreenshot,onUpdate:e.updateScreenshot}):void 0})}var NZr=e=>({display:"grid",gap:1,maxHeight:220,overflow:"auto",px:2,py:1.25,borderTop:1,borderColor:e.tokens.color.lineSoft}),OZr={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},BZr=e=>({display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"4px 8px",px:1.25,py:1,borderRadius:`${e.tokens.radius.sm}px`,bgcolor:e.tokens.color.raised,border:1,borderColor:e.tokens.color.lineSoft,fontSize:12.5}),$Zr={gridColumn:2,gridRow:1,width:20,height:20,color:"text.disabled","& .MuiSvgIcon-root":{fontSize:14}};var lk=S(_(),1);function FZr({comments:e,colors:t,onRemove:r}){return(0,lk.jsxs)(H,{sx:NZr,children:[(0,lk.jsxs)(be,{sx:OZr,children:["Comments (",e.length,")"]}),e.map((n,o)=>(0,lk.jsxs)(H,{sx:BZr,children:[(0,lk.jsx)(A$,{text:n.quote,sx:{gridColumn:1,borderLeft:2,pl:1,borderColor:t[o]}}),(0,lk.jsx)(H,{sx:{gridColumn:1,wordBreak:"break-word"},children:n.note}),(0,lk.jsx)(Mt,{"aria-label":"Remove comment",onClick:()=>r(n.id),sx:$Zr,children:(0,lk.jsx)(_o,{})})]},n.id))]})}var HZr=S(_(),1);function zZr(e){return e.comments.length===0?null:(0,HZr.jsx)(FZr,{...e})}var UZr=S(_(),1),ZPe=ot((0,UZr.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Computer");var YZr=S(re(),1);var WZr=S(_(),1),VZr=ot((0,WZr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var f0="0.1185.1";var Ajo={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function GZr(e){return e?Ajo[e]:"success.main"}function qZr(e){return e.split("-")[0].split(".").map(Number)}function jZr(e,t){if(!e||!t||e===t)return;let r=qZr(e),n=qZr(t);for(let o=0;o<Math.max(r.length,n.length);o++){let i=(r[o]??0)-(n[o]??0);if(Number.isNaN(i))return;if(i!==0)return i<0?"behind":"ahead"}}var QPe=S(re(),1),bgt=(0,QPe.createContext)(null);function JPe(){return(0,QPe.useContext)(bgt)}var xN=S(_(),1),Ljo={height:16,fontSize:10},Ijo={opacity:.6,fontSize:"0.85em"};function Djo(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function $3({nodes:e,name:t,showVersion:r=!1}){let n=JPe()??f0,o=e.links.find(a=>a.name===t),i=jZr(o?.peerVersion,n);return(0,xN.jsx)(lr,{title:Djo(e,t),placement:"right",children:(0,xN.jsxs)(H,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,xN.jsx)(VZr,{sx:{fontSize:8,color:GZr(o?.state)}}),t,r&&o?.peerVersion&&(0,xN.jsxs)(H,{component:"span",sx:Ijo,children:["v",o.peerVersion]}),i&&(0,xN.jsx)(yn,{label:i,size:"small",color:i==="behind"?"warning":"info",sx:Ljo})]})})}var p0=S(_(),1),Mjo={textTransform:"none"};function eAe({nodes:e,options:t,target:r,onPick:n}){let[o,i]=(0,YZr.useState)(null);return(0,p0.jsxs)(p0.Fragment,{children:[(0,p0.jsx)(nt,{size:"small",color:"inherit",startIcon:(0,p0.jsx)(ZPe,{fontSize:"small"}),"aria-label":"Start on node","aria-haspopup":"menu",onClick:a=>i(a.currentTarget),sx:Mjo,children:(0,p0.jsx)($3,{nodes:e,name:r.node})}),(0,p0.jsx)(fi,{anchorEl:o,open:!!o,onClose:()=>i(null),children:t.map(({name:a,cwd:s})=>(0,p0.jsx)(Br,{disabled:!s,selected:a===r.node,onClick:()=>{n(a),i(null)},children:(0,p0.jsx)(Vu,{primary:(0,p0.jsx)($3,{nodes:e,name:a}),secondary:s?void 0:"no clone"})},a))})]})}var KZr=S(re(),1);function Njo(e,t){return e?.toLowerCase()===t.toLowerCase()}function tAe(e,t){let{nodes:r,names:n,visible:o}=ds(),{repos:i,selectedCwd:a,selectedNode:s,cloneOn:l,originOf:u}=_n(),[d,f]=(0,KZr.useState)(),p=e&&u(e)?e:a,h=t?i.find(b=>Njo(u(b),t)):p,m=n.map(b=>({name:b,cwd:h?l(h,b):void 0})),g=b=>m.find(x=>x.name===b&&x.cwd),y=g(d)??g(s??r?.local)??m.find(b=>b.cwd),v=o&&y?.cwd?{node:y.name,cwd:y.cwd}:void 0;return{nodes:r,visible:o,options:m,target:v,pick:f}}var F3=S(_(),1);function XZr({canStart:e,startOrigin:t,cwd:r,onApprove:n,onApproveAndStart:o}){let i=Xme(),a=tAe(r,t);return(0,F3.jsxs)(F3.Fragment,{children:[(0,F3.jsx)(nt,{color:"primary",variant:e?"tonal":"contained",onClick:n,...e?{}:i,children:"Approve"}),e&&a.nodes&&a.target&&(0,F3.jsx)(eAe,{nodes:a.nodes,options:a.options,target:a.target,onPick:a.pick}),e&&(0,F3.jsx)(nt,{color:"primary",variant:"contained",onClick:()=>o(a.target),...i,children:"Approve & start"})]})}var xgt=S(_(),1),Ojo={"& .MuiFormControlLabel-label":{fontSize:12}};function ple({label:e,title:t,checked:r,onChange:n}){return(0,xgt.jsx)($d,{control:(0,xgt.jsx)(Ip,{size:"small",checked:r,onChange:o=>n(o.target.checked)}),label:e,title:t,sx:Ojo})}var SN=S(_(),1);function rAe({chain:e,newPr:t,onChange:r}){return(0,SN.jsxs)(St,{direction:"row",sx:{mr:"auto"},children:[t&&(0,SN.jsx)(ple,{label:"Draft",title:"Create the PR as a draft rather than ready for review",checked:e.draft,onChange:n=>r({...e,draft:n,autoMerge:n?!1:e.autoMerge})}),(0,SN.jsx)(ple,{label:"Auto-merge (squash)",title:"Squash-merge the PR automatically once its required checks pass",checked:e.autoMerge,onChange:n=>r({...e,autoMerge:n,draft:n?!1:e.draft})}),(0,SN.jsx)(ple,{label:"Review PR",title:"After raising, run a review that posts its findings and then addresses them",checked:e.reviewAfter,onChange:n=>r({...e,reviewAfter:n})}),(0,SN.jsx)(ple,{label:"Post to Slack",title:"Announce the PR in Slack at the tail of the chain",checked:e.announceAfter,onChange:n=>r({...e,announceAfter:n})})]})}var TN=S(_(),1);function ZZr({commentCount:e,chain:t,newPr:r,canStart:n,startOrigin:o,onChainChange:i,onApprove:a,cwd:s,onApproveAndStart:l,onReject:u,onRequestChanges:d}){return(0,TN.jsxs)(St,{direction:"row",spacing:1,sx:{px:2,py:1.5,alignItems:"center",justifyContent:"flex-end"},children:[t&&(0,TN.jsx)(rAe,{chain:t,newPr:r,onChange:i}),(0,TN.jsx)(nt,{color:"error",variant:"outlined",onClick:u,children:"Reject"}),e>0&&(0,TN.jsxs)(nt,{color:"warning",variant:"tonal",onClick:d,children:["Request changes (",e,")"]}),(0,TN.jsx)(XZr,{canStart:n,startOrigin:o,cwd:s,onApprove:a,onApproveAndStart:l})]})}var JZr=S(_(),1);function QZr({comments:e,cwd:t,onDecision:r,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s}){let l=()=>e.map(u=>({quote:u.quote,note:u.note}));return(0,JZr.jsx)(ZZr,{commentCount:e.length,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s,onApprove:()=>r("approve",l()),cwd:t,onApproveAndStart:u=>r("approve",l(),u??!0),onReject:()=>r("reject",[]),onRequestChanges:()=>r("reject",l())})}var ck=S(_(),1);function eQr(e){let{comments:t,commentColors:r,pending:n,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onRemove:d,onCancel:f,onCollapse:p,editable:h}=e;return(0,ck.jsxs)(ck.Fragment,{children:[(0,ck.jsx)(zZr,{comments:t,colors:r,onRemove:d}),(0,ck.jsx)(qn,{}),(0,ck.jsx)(QZr,{...e}),(0,ck.jsx)(dye,{pending:n,editable:h,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onCancel:f,onCollapse:p})]})}var hle=S(_(),1),Bjo={px:2,pb:2,display:"flex",alignItems:"center",gap:1.5,minWidth:0},$jo={color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function tQr({url:e}){return(0,hle.jsxs)(H,{sx:Bjo,children:[(0,hle.jsx)(nt,{variant:"contained",href:e,target:"_blank",rel:"noopener noreferrer",sx:{flexShrink:0},children:"Open design \u2197"}),(0,hle.jsx)(be,{variant:"body2",sx:$jo,title:e,children:e})]})}var Sgt=S(_(),1);function rQr({preview:e}){let t=e.kind==="design"?e.metadata?.[0]?.url:void 0;return t?(0,Sgt.jsx)(tQr,{url:t}):(0,Sgt.jsx)(Jj,{items:e.metadata??[]})}function nQr({preview:e,pane:t,cwd:r,isPr:n,editable:o,sender:i,onCite:a,onAddRule:s}){return{comments:t.comments,commentColors:t.commentColors,pending:t.pending,cwd:r,unavailable:i.unavailable,onAdd:i.onSend,onQueue:t.onAdd,onCite:a,onAddRule:s,onRemove:t.remove,onCancel:t.onCancel,onCollapse:t.onCollapse,onDecision:t.onDecide,chain:n?t.chain:void 0,editable:o,newPr:n&&e.prNumber===null,canStart:e.kind==="backlog-item"&&e.canStart===!0,startOrigin:e.startOrigin,onChainChange:t.setChain}}function rY(e){let t=e??"pr";return{isPr:t==="pr",screenshots:t==="pr"||t==="github-issue",editable:t==="github-issue-edit",closeOnly:t==="show"}}function oQr(e,t){return e?`${e}:${t??"pr"}`:void 0}function nAe(e,t,r,n){return{...rY(e.kind),requestId:e.requestId,supersedes:e.supersedes,sessionId:t,cwd:r,onDecision:n,screenshotScope:oQr(t,e.kind),seededScreenshots:e.screenshots??[],chainDefaults:{draft:e.draft===!0,reviewAfter:e.reviewAfter??!0},initialBody:e.body}}function iQr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&ul(t,e,Jke({quote:r,note:o})),n()}}function aQr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&ul(t,e,zx(r,Qge(o))),n()}}function oAe(e,t,r,n){return{onCite:aQr(e,t,r,n),onAddRule:iQr(e,t,r,n)}}function sQr(e){return{criteria:e.criteria,onCriteriaChange:e.writeCriteria,onCriteriaInsert:e.insertCriteria,onCriteriaConvert:e.convertCriteria}}var gQr=S(re(),1);var uk=S(re(),1);var lQr="assist:pr-preview-comments:",Tgt=e=>`${lQr}${e}`;function wgt(e){return dl(Tgt(e))}function mle(e,t){Il(Tgt(e),t)}function iAe(e){$v(Tgt(e))}function cQr(){Hx(lQr)}function uQr(e){let t=L6(e),r="";for(let n=t.nextNode();n;n=t.nextNode())r+=n.textContent??"";return r}function Fjo(e,t,r){let n=-1;for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+1))(n===-1||Math.abs(o-r)<Math.abs(n-r))&&(n=o);return n}function dQr(e,t){return e.flatMap(r=>{let n=Fjo(t,r.quote,r.start);return n===-1?[]:[{...r,start:n,end:n+r.quote.length}]})}function fQr(e,t,r){let n=wgt(e);if(n.length>0||!t||!r)return n;let o=dQr(wgt(t),uQr(r));return mle(e,o),iAe(t),o}function pQr(e,t,r){let[n,o]=(0,uk.useState)([]),i=(0,uk.useRef)(0);(0,uk.useEffect)(()=>{cQr(),o(fQr(e,t,r.current).map(l=>({...l,id:i.current++})))},[e,t,r]);let a=(0,uk.useCallback)(l=>{o(u=>{let d=[...u,{...l,id:i.current++}];return mle(e,d),d})},[e]),s=(0,uk.useCallback)(l=>{o(u=>{let d=u.filter(f=>f.id!==l);return mle(e,d),d})},[e]);return{comments:n,add:a,remove:s}}function hQr(e,t){let r=e.map((i,a)=>mG(a).solid),n=mG(e.length).fill,o=e.map((i,a)=>({start:i.start,end:i.end,color:mG(a).fill,pin:String(a+1)}));return t&&o.push({start:t.start,end:t.end,color:n}),{commentColors:r,dragColor:n,ranges:o}}function mQr(e,t,r,n){return{onAdd:o=>{e&&t({quote:e.quote,note:o,start:e.start,end:e.end}),n()},onCollapse:()=>{e&&r(e.quote),n()}}}function yQr(e,t,r){let{wrapperRef:n,contentRef:o,pending:i,dragRects:a,onMouseDown:s,clear:l,select:u}=Uy(),{comments:d,add:f,remove:p}=pQr(e,t,o),{commentColors:h,dragColor:m,ranges:g}=(0,gQr.useMemo)(()=>hQr(d,i),[d,i]),{onAdd:y,onCollapse:v}=mQr(i,f,r,l);return{wrapperRef:n,contentRef:o,onMouseDown:s,comments:d,commentColors:h,remove:p,pending:i,ranges:g,dragRects:a,dragColor:m,onAdd:y,onCollapse:v,onCancel:l,onSelect:u}}var sAe=S(re(),1);var Cgt="assist:preview-screenshots:",kgt=e=>`${Cgt}${e}`,aAe=e=>`${Cgt}seeded:${e}`;function vQr(e){return e?(Hx(Cgt),dl(kgt(e)).filter(t=>typeof t.path=="string")):[]}function wN(e,t){e&&Il(kgt(e),t.map(({path:r,alt:n,group:o,contentType:i,seeded:a})=>({path:r,alt:n,group:o,contentType:i,seeded:a})))}function bQr(e){e&&($v(kgt(e)),$v(aAe(e)))}var CN=S(re(),1);var xQr={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov"};function zjo(e){let t=e.split(".").pop()?.toLowerCase();return Object.entries(xQr).find(([,n])=>n===t)?.[0]??"application/octet-stream"}function SQr(e){return e.map(t=>({...t,contentType:zjo(t.path),seeded:!0}))}function TQr(e,t,r){if(!e)return SQr(r);let n=vQr(e);if(dl(aAe(e))[0]===t)return n;let o=[...SQr(r),...n.filter(i=>!i.seeded)];return wN(e,o),Il(aAe(e),[t]),o}function wQr(e,t){let r=new URLSearchParams({path:e});return t&&r.set("node",t),fT(`/api/pr-preview/image?${r}`)}function CQr(e,t,r){let[n,o]=(0,CN.useState)([]),i=(0,CN.useRef)(0),a=ur(),s=(0,CN.useRef)(r);return s.current=r,(0,CN.useEffect)(()=>{o(TQr(e,t,s.current).map(l=>({...l,url:wQr(l.path,a),id:i.current++})))},[e,t,a]),{screenshots:n,setScreenshots:o,nextId:i}}var kQr=S(re(),1);function _Qr(e,t){return(0,kQr.useCallback)((r,n)=>{t(o=>{let i=o.map(a=>a.id===r?{...a,...n}:a);return wN(e,i),i})},[e,t])}function EQr(e,t,r){let{screenshots:n,setScreenshots:o,nextId:i}=CQr(e,t,r),a=(0,sAe.useCallback)(d=>{o(f=>{let p=[...f,{...d,id:i.current++}];return wN(e,p),p})},[e,o,i]),s=(0,sAe.useCallback)(d=>{o(f=>{let p=f.find(m=>m.id===d);p?.url.startsWith("blob:")&&URL.revokeObjectURL(p.url);let h=f.filter(m=>m.id!==d);return wN(e,h),h})},[e,o]),l=_Qr(e,o),u=(0,sAe.useCallback)(()=>bQr(e),[e]);return{screenshots:n,add:a,remove:s,update:l,clearPersisted:u}}var nY=S(re(),1);async function RQr(e,t,r){let n=new URLSearchParams;t&&n.set("cwd",t),r&&n.set("node",r),e instanceof File&&e.name&&n.set("name",e.name);let o=await Ut(`/api/pr-preview/upload-image?${n}`,{method:"POST",headers:{"Content-Type":e.type||"application/octet-stream"},body:e,timeoutMs:12e4}),i=await o.json().catch(()=>null);if(!o.ok||!i?.path)throw new Error(i?.error??"Failed to attach file");return{path:i.path,alt:i.alt??"screenshot"}}var IQr=S(re(),1);function PQr(e){return e.startsWith("image/")||e.startsWith("video/")}function AQr(e){if(!e)return null;for(let t of e.items)if(t.kind==="file"&&PQr(t.type)){let r=t.getAsFile();if(r)return r}return null}function LQr(e){return e?Array.from(e.files).find(t=>PQr(t.type))??null:null}function DQr(e,t){return(0,IQr.useEffect)(()=>{if(!t)return;let o=i=>{let a=AQr(i.clipboardData);a&&(i.preventDefault(),e(a))};return globalThis.addEventListener("paste",o),()=>globalThis.removeEventListener("paste",o)},[e,t]),t?{onDrop:o=>{let i=LQr(o.dataTransfer);i&&(o.preventDefault(),e(i))},onDragOver:o=>{Array.from(o.dataTransfer.items).some(i=>i.kind==="file")&&o.preventDefault()}}:{onDrop:void 0,onDragOver:void 0}}function MQr(e,t,r){let[n,o]=(0,nY.useState)([]),i=(0,nY.useRef)(0),a=ur(),s=(0,nY.useCallback)(async d=>{let f=i.current++;o(p=>[...p.filter(h=>!h.error),{id:f}]);try{let p=await RQr(d,e,a);t({...p,url:URL.createObjectURL(d),contentType:d.type}),o(h=>h.filter(m=>m.id!==f))}catch(p){let h=p instanceof Error?p.message:"Failed to attach file";o(m=>m.map(g=>g.id===f?{id:f,error:h}:g))}},[e,a,t]),{onDrop:l,onDragOver:u}=DQr(s,r);return{uploads:n,onDrop:l,onDragOver:u}}function NQr({cwd:e,screenshots:t,screenshotScope:r,requestId:n,seededScreenshots:o}){let{screenshots:i,add:a,remove:s,update:l,clearPersisted:u}=EQr(t?r:void 0,n,t?o:[]),{uploads:d,onDrop:f,onDragOver:p}=MQr(e,a,t);return{screenshots:i,removeScreenshot:s,updateScreenshot:l,decision:{attachments:()=>i.map(({path:h,alt:m,group:g})=>g?{path:h,alt:m,group:g}:{path:h,alt:m}),clearPersisted:u},uploads:d,onDrop:f,onDragOver:p}}var VQr=S(re(),1);var OQr="assist:pr-preview-chain:",_gt=e=>`${OQr}${e}`;function BQr(e){if(e)return dl(_gt(e))[0]}function $Qr(e,t){e&&Il(_gt(e),[t])}function FQr(e){e&&$v(_gt(e))}function zQr(){Hx(OQr)}function HQr(e,t,r){if(!e)return{reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1};zQr();let n=BQr(t);return{reviewAfter:n?.reviewAfter??r.reviewAfter,announceAfter:n?.announceAfter??!0,draft:n?.draft??r.draft,autoMerge:n?.autoMerge??!1}}function UQr(e,t,r,n,o){return{comments:t,screenshots:n,reviewAfter:e&&r.reviewAfter,announceAfter:e&&r.announceAfter,draft:r.draft,autoMerge:e&&r.autoMerge,...o===void 0?{}:{body:o}}}function WQr(e,t){return!e||t===!1?{}:t===!0?{autostart:!0}:{autostart:!0,startOn:t}}function GQr(e,t,r,n,o,i,a){let[s,l]=(0,VQr.useState)(()=>HQr(n,t,o));return{chain:s,setChain:f=>{l(f),$Qr(t,f)},onDecide:(f,p,h=!1)=>{let m=f==="approve";r(f,{...UQr(m,p,s,m?i.attachments():[],a()),...WQr(m,h)}),iAe(e),m&&(FQr(t),i.clearPersisted())}}}var tJr=S(re(),1);var Hjo=/^ {0,3}#{1,6}[ \t]+acceptance criteria[ \t]*$/i,Ujo=/^ {0,3}#{1,6}[ \t]/;function z3(e){let t=e.split(`
|
|
4144
4144
|
`),r=t.findIndex(a=>Hjo.test(a));if(r===-1)return null;let n=r+1;for(;n<t.length&&!Ujo.test(t[n]);)n+=1;let o=r+1;for(;o<n&&t[o].trim()==="";)o+=1;let i=n;for(;i>o&&t[i-1].trim()==="";)i-=1;return o===n&&(o=r+1,i=r+1),{before:t.slice(0,o),lines:t.slice(o,i),after:t.slice(i)}}function lAe(e){let t=0;for(let r of e)t+=r===" "?4:1;return t}function cAe(e){let t=[];return e.map(r=>{for(;t.length>0&&r<t[t.length-1];)t.pop();return(t.length===0||r>t[t.length-1])&&t.push(r),t.length-1})}var Wjo=" ";function Vjo({text:e,depth:t}){let r=`${Wjo.repeat(t)}1.`;return e===""?r:`${r} ${e}`}function uAe(e,t){let r=z3(e);return r?[...r.before,...t.map(Vjo),...r.after].join(`
|
|
4145
4145
|
`):e}var Gjo=/^([ \t]*)(?:[-*+]|\d+[.)])(?:[ \t]+(.*))?$/,qjo=/^\[[ xX]\][ \t]*/;function jjo(e){return e.slice(0,e.length-e.trimStart().length)}function qQr(e){let t=z3(e);if(!t)return e;let r=t.lines.filter(o=>o.trim()!=="").map(o=>{let i=Gjo.exec(o);return{width:lAe(i?i[1]:jjo(o)),text:(i?i[2]??"":o.trim()).replace(qjo,"")}}),n=cAe(r.map(o=>o.width));return uAe(e,O3(r.map((o,i)=>({text:o.text,depth:n[i]}))))}var jQr=`## Acceptance criteria
|
|
4146
4146
|
|