@dylanpiercey/work 0.0.41 → 0.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/index.mjs +199 -199
  2. package/dist/public/assets/{_BOb-Pn3q.js → _08Vl4BnZ.js} +2 -2
  3. package/dist/public/assets/{_BOb-Pn3q.js.map → _08Vl4BnZ.js.map} +1 -1
  4. package/dist/public/assets/{_D-CiRcbK.js → _0HFtYC9j.js} +2 -2
  5. package/dist/public/assets/{_D-CiRcbK.js.map → _0HFtYC9j.js.map} +1 -1
  6. package/dist/public/assets/{_B7s0O6p8.js → _4lBAOiBs.js} +2 -2
  7. package/dist/public/assets/{_B7s0O6p8.js.map → _4lBAOiBs.js.map} +1 -1
  8. package/dist/public/assets/{_D9nZPeON.js → _5zAnG8_b.js} +2 -2
  9. package/dist/public/assets/{_D9nZPeON.js.map → _5zAnG8_b.js.map} +1 -1
  10. package/dist/public/assets/{__Fv6A47I.js → _6jzzkyr3.js} +2 -2
  11. package/dist/public/assets/{__Fv6A47I.js.map → _6jzzkyr3.js.map} +1 -1
  12. package/dist/public/assets/{_CHpdg7T22.js → _B12yQQbd2.js} +2 -2
  13. package/dist/public/assets/{_CHpdg7T22.js.map → _B12yQQbd2.js.map} +1 -1
  14. package/dist/public/assets/{_COW7ENXO.js → _BAU6KG-h.js} +2 -2
  15. package/dist/public/assets/{_COW7ENXO.js.map → _BAU6KG-h.js.map} +1 -1
  16. package/dist/public/assets/{_DOuSJx7H.js → _BBa9QG56.js} +2 -2
  17. package/dist/public/assets/{_DOuSJx7H.js.map → _BBa9QG56.js.map} +1 -1
  18. package/dist/public/assets/{_lXr5_a6k2.js → _BF6FAj1Y2.js} +2 -2
  19. package/dist/public/assets/{_lXr5_a6k2.js.map → _BF6FAj1Y2.js.map} +1 -1
  20. package/dist/public/assets/{_Cf990ZTV.js → _BHLmP9J5.js} +2 -2
  21. package/dist/public/assets/{_Cf990ZTV.js.map → _BHLmP9J5.js.map} +1 -1
  22. package/dist/public/assets/{_BW-4hwO72.js → _BHXi673w2.js} +2 -2
  23. package/dist/public/assets/{_BW-4hwO72.js.map → _BHXi673w2.js.map} +1 -1
  24. package/dist/public/assets/{_3FvrUJYy2.js → _BIb9glVD2.js} +2 -2
  25. package/dist/public/assets/{_3FvrUJYy2.js.map → _BIb9glVD2.js.map} +1 -1
  26. package/dist/public/assets/{_Di2tZObT.js → _BL0H8RTc.js} +2 -2
  27. package/dist/public/assets/{_Di2tZObT.js.map → _BL0H8RTc.js.map} +1 -1
  28. package/dist/public/assets/{_Dl4EWW5M.js → _BNg95hln.js} +2 -2
  29. package/dist/public/assets/{_Dl4EWW5M.js.map → _BNg95hln.js.map} +1 -1
  30. package/dist/public/assets/{_MORbWdYO.js → _BQTrV1C2.js} +2 -2
  31. package/dist/public/assets/{_MORbWdYO.js.map → _BQTrV1C2.js.map} +1 -1
  32. package/dist/public/assets/{_DRFzGQ_P.js → _BYcdvOlZ.js} +2 -2
  33. package/dist/public/assets/{_DRFzGQ_P.js.map → _BYcdvOlZ.js.map} +1 -1
  34. package/dist/public/assets/{_CsZuTP-e2.js → _Bl0uloCS2.js} +2 -2
  35. package/dist/public/assets/{_CsZuTP-e2.js.map → _Bl0uloCS2.js.map} +1 -1
  36. package/dist/public/assets/{_C2jFdMKg2.js → _BlfF1DXc2.js} +2 -2
  37. package/dist/public/assets/{_C2jFdMKg2.js.map → _BlfF1DXc2.js.map} +1 -1
  38. package/dist/public/assets/{_BXsQSWWX.js → _Boa1CUha.js} +2 -2
  39. package/dist/public/assets/{_BXsQSWWX.js.map → _Boa1CUha.js.map} +1 -1
  40. package/dist/public/assets/{_BWNzPyR-.js → _BtlXwps-.js} +2 -2
  41. package/dist/public/assets/{_BWNzPyR-.js.map → _BtlXwps-.js.map} +1 -1
  42. package/dist/public/assets/{_DOMdlLi02.js → _BwCEKN3X2.js} +2 -2
  43. package/dist/public/assets/{_DOMdlLi02.js.map → _BwCEKN3X2.js.map} +1 -1
  44. package/dist/public/assets/{_C4VRIVt2.js → _By4p-yp6.js} +2 -2
  45. package/dist/public/assets/{_C4VRIVt2.js.map → _By4p-yp6.js.map} +1 -1
  46. package/dist/public/assets/{_BCIV1arR2.js → _C-u7G7Rc2.js} +2 -2
  47. package/dist/public/assets/{_BCIV1arR2.js.map → _C-u7G7Rc2.js.map} +1 -1
  48. package/dist/public/assets/{_DITDEtIK.js → _C4eToTSH.js} +2 -2
  49. package/dist/public/assets/{_DITDEtIK.js.map → _C4eToTSH.js.map} +1 -1
  50. package/dist/public/assets/{_bqFlf3Pi.js → _CIyqQPOJ.js} +2 -2
  51. package/dist/public/assets/{_bqFlf3Pi.js.map → _CIyqQPOJ.js.map} +1 -1
  52. package/dist/public/assets/{_B2NkZVYt.js → _CK57eBfx.js} +2 -2
  53. package/dist/public/assets/{_B2NkZVYt.js.map → _CK57eBfx.js.map} +1 -1
  54. package/dist/public/assets/{_B0Lbe-Ub.js → _CKtA_VfT.js} +2 -2
  55. package/dist/public/assets/{_B0Lbe-Ub.js.map → _CKtA_VfT.js.map} +1 -1
  56. package/dist/public/assets/{_CMC5FOms.js → _CMrgWit1.js} +2 -2
  57. package/dist/public/assets/{_CMC5FOms.js.map → _CMrgWit1.js.map} +1 -1
  58. package/dist/public/assets/{_Bct9DrCG2.js → _CPWwxTeC2.js} +2 -2
  59. package/dist/public/assets/{_Bct9DrCG2.js.map → _CPWwxTeC2.js.map} +1 -1
  60. package/dist/public/assets/{_DCdPuEzi.js → _CQLk7EcY.js} +2 -2
  61. package/dist/public/assets/{_DCdPuEzi.js.map → _CQLk7EcY.js.map} +1 -1
  62. package/dist/public/assets/{_DANQhsl6.js → _CTYKjish.js} +2 -2
  63. package/dist/public/assets/{_DANQhsl6.js.map → _CTYKjish.js.map} +1 -1
  64. package/dist/public/assets/{_DnucOiTi2.js → _CULJ2MVA2.js} +2 -2
  65. package/dist/public/assets/{_DnucOiTi2.js.map → _CULJ2MVA2.js.map} +1 -1
  66. package/dist/public/assets/{_BocyNiHx2.js → _CUQCJnj92.js} +2 -2
  67. package/dist/public/assets/{_BocyNiHx2.js.map → _CUQCJnj92.js.map} +1 -1
  68. package/dist/public/assets/{_DiZzZSjb.js → _Ch-k8j3L.js} +2 -2
  69. package/dist/public/assets/{_DiZzZSjb.js.map → _Ch-k8j3L.js.map} +1 -1
  70. package/dist/public/assets/{_BCr95U42.js → _Ch2s5Yl1.js} +2 -2
  71. package/dist/public/assets/{_BCr95U42.js.map → _Ch2s5Yl1.js.map} +1 -1
  72. package/dist/public/assets/{_DLtguS0M2.js → _ChpDcY902.js} +2 -2
  73. package/dist/public/assets/{_DLtguS0M2.js.map → _ChpDcY902.js.map} +1 -1
  74. package/dist/public/assets/{_BjchXZRW.js → _Ci-5oHFp.js} +2 -2
  75. package/dist/public/assets/{_BjchXZRW.js.map → _Ci-5oHFp.js.map} +1 -1
  76. package/dist/public/assets/{_B7kC4ECJ.js → _CoiAbeQ8.js} +2 -2
  77. package/dist/public/assets/{_B7kC4ECJ.js.map → _CoiAbeQ8.js.map} +1 -1
  78. package/dist/public/assets/{_B72m4Heg2.js → _Cp03K8j72.js} +2 -2
  79. package/dist/public/assets/{_B72m4Heg2.js.map → _Cp03K8j72.js.map} +1 -1
  80. package/dist/public/assets/{_D8kGoid1.js → _CsV5dOWU.js} +2 -2
  81. package/dist/public/assets/{_D8kGoid1.js.map → _CsV5dOWU.js.map} +1 -1
  82. package/dist/public/assets/{_DOK3qs_j.js → _CvDp4NJZ.js} +2 -2
  83. package/dist/public/assets/{_DOK3qs_j.js.map → _CvDp4NJZ.js.map} +1 -1
  84. package/dist/public/assets/{_Bg7axLcI2.js → _CvNPU6mj2.js} +2 -2
  85. package/dist/public/assets/{_Bg7axLcI2.js.map → _CvNPU6mj2.js.map} +1 -1
  86. package/dist/public/assets/{_BCnAMUTQ2.js → _CxmlqqW12.js} +2 -2
  87. package/dist/public/assets/{_BCnAMUTQ2.js.map → _CxmlqqW12.js.map} +1 -1
  88. package/dist/public/assets/{_CR9ATfbr.js → _DDlaBvIf.js} +2 -2
  89. package/dist/public/assets/{_CR9ATfbr.js.map → _DDlaBvIf.js.map} +1 -1
  90. package/dist/public/assets/{_KKXFtWm1.js → _DE2lMRoV.js} +2 -2
  91. package/dist/public/assets/{_KKXFtWm1.js.map → _DE2lMRoV.js.map} +1 -1
  92. package/dist/public/assets/{_ByWtfiyC.js → _DFnRtdNh.js} +2 -2
  93. package/dist/public/assets/{_ByWtfiyC.js.map → _DFnRtdNh.js.map} +1 -1
  94. package/dist/public/assets/{_BKxOULLA.js → _DHQLqogP.js} +2 -2
  95. package/dist/public/assets/{_BKxOULLA.js.map → _DHQLqogP.js.map} +1 -1
  96. package/dist/public/assets/{_CLG4Axpw.js → _DJpNULvH.js} +2 -2
  97. package/dist/public/assets/{_CLG4Axpw.js.map → _DJpNULvH.js.map} +1 -1
  98. package/dist/public/assets/{_Bni2E818.js → _DK6ZJVn2.js} +2 -2
  99. package/dist/public/assets/{_Bni2E818.js.map → _DK6ZJVn2.js.map} +1 -1
  100. package/dist/public/assets/{_C78LMQ4R.js → _DML-mp8Z.js} +2 -2
  101. package/dist/public/assets/{_C78LMQ4R.js.map → _DML-mp8Z.js.map} +1 -1
  102. package/dist/public/assets/{_B67tNyB02.js → _DPzh9We22.js} +2 -2
  103. package/dist/public/assets/{_B67tNyB02.js.map → _DPzh9We22.js.map} +1 -1
  104. package/dist/public/assets/{_BfM6eibe2.js → _DSb5aJbx2.js} +2 -2
  105. package/dist/public/assets/{_BfM6eibe2.js.map → _DSb5aJbx2.js.map} +1 -1
  106. package/dist/public/assets/{_DKIbpX1r.js → _D_Zit_pp.js} +2 -2
  107. package/dist/public/assets/{_DKIbpX1r.js.map → _D_Zit_pp.js.map} +1 -1
  108. package/dist/public/assets/{_eLpVB_Wq.js → _DaWbmgiB.js} +2 -2
  109. package/dist/public/assets/{_eLpVB_Wq.js.map → _DaWbmgiB.js.map} +1 -1
  110. package/dist/public/assets/{_D20wuad5.js → _Dd9JhTP3.js} +2 -2
  111. package/dist/public/assets/{_D20wuad5.js.map → _Dd9JhTP3.js.map} +1 -1
  112. package/dist/public/assets/{_BdJRzcvC.js → _DoEzd4-6.js} +2 -2
  113. package/dist/public/assets/{_BdJRzcvC.js.map → _DoEzd4-6.js.map} +1 -1
  114. package/dist/public/assets/{_D4T8Kx36.js → _DsIT1wDB.js} +2 -2
  115. package/dist/public/assets/{_D4T8Kx36.js.map → _DsIT1wDB.js.map} +1 -1
  116. package/dist/public/assets/{_BLiEKrCj.js → _Dtp3DbhR.js} +2 -2
  117. package/dist/public/assets/{_BLiEKrCj.js.map → _Dtp3DbhR.js.map} +1 -1
  118. package/dist/public/assets/{_DYUI_qtj.js → _DtshxIqm.js} +2 -2
  119. package/dist/public/assets/{_DYUI_qtj.js.map → _DtshxIqm.js.map} +1 -1
  120. package/dist/public/assets/{_QIS_jvCk2.js → _Dtyrasyh2.js} +2 -2
  121. package/dist/public/assets/{_QIS_jvCk2.js.map → _Dtyrasyh2.js.map} +1 -1
  122. package/dist/public/assets/{_EPocSo4T.js → _DuuJhr1w.js} +2 -2
  123. package/dist/public/assets/{_EPocSo4T.js.map → _DuuJhr1w.js.map} +1 -1
  124. package/dist/public/assets/{_BoX_Ofe92.js → _Dy3ee_fS2.js} +2 -2
  125. package/dist/public/assets/{_BoX_Ofe92.js.map → _Dy3ee_fS2.js.map} +1 -1
  126. package/dist/public/assets/{_DDsvxP8k.js → _EcTBrSbd.js} +2 -2
  127. package/dist/public/assets/{_DDsvxP8k.js.map → _EcTBrSbd.js.map} +1 -1
  128. package/dist/public/assets/{_CglqdFiD2.js → _LyFFu4J72.js} +2 -2
  129. package/dist/public/assets/{_CglqdFiD2.js.map → _LyFFu4J72.js.map} +1 -1
  130. package/dist/public/assets/{_BVpFyzyu2.js → _RKdvAu9n2.js} +2 -2
  131. package/dist/public/assets/{_BVpFyzyu2.js.map → _RKdvAu9n2.js.map} +1 -1
  132. package/dist/public/assets/{_B_WEnwWZ2.js → _a6SPz--f2.js} +2 -2
  133. package/dist/public/assets/{_B_WEnwWZ2.js.map → _a6SPz--f2.js.map} +1 -1
  134. package/dist/public/assets/{_BQBiYAA_.js → _g8rZMKlA.js} +2 -2
  135. package/dist/public/assets/{_BQBiYAA_.js.map → _g8rZMKlA.js.map} +1 -1
  136. package/dist/public/assets/{_Zjm8E5gs.js → _kDVs_4yB.js} +2 -2
  137. package/dist/public/assets/{_Zjm8E5gs.js.map → _kDVs_4yB.js.map} +1 -1
  138. package/dist/public/assets/{_BBC6FrOe2.js → _nmjNS1SP2.js} +2 -2
  139. package/dist/public/assets/{_BBC6FrOe2.js.map → _nmjNS1SP2.js.map} +1 -1
  140. package/dist/public/assets/{_C_g0fhev.js → _oHnAhOiq.js} +2 -2
  141. package/dist/public/assets/{_C_g0fhev.js.map → _oHnAhOiq.js.map} +1 -1
  142. package/dist/public/assets/{_CuXae0ve.js → _rFAkd66p.js} +2 -2
  143. package/dist/public/assets/{_CuXae0ve.js.map → _rFAkd66p.js.map} +1 -1
  144. package/dist/public/assets/{_CXQ9i19x2.js → _t8wmk8-H2.js} +2 -2
  145. package/dist/public/assets/{_CXQ9i19x2.js.map → _t8wmk8-H2.js.map} +1 -1
  146. package/dist/public/assets/{_vk5AMlte.js → _yd7odEAs.js} +2 -2
  147. package/dist/public/assets/{_vk5AMlte.js.map → _yd7odEAs.js.map} +1 -1
  148. package/dist/public/assets/{_BnSmLTYb.js → _zLB-9r7D.js} +2 -2
  149. package/dist/public/assets/{_BnSmLTYb.js.map → _zLB-9r7D.js.map} +1 -1
  150. package/dist/public/assets/{index-CNo7v-9k.js → index-DNOnhrX7.js} +8 -8
  151. package/dist/public/assets/{index-CNo7v-9k.js.map → index-DNOnhrX7.js.map} +1 -1
  152. package/dist/public/assets/index-Dfh2odxc.css +1 -0
  153. package/package.json +2 -1
  154. package/dist/public/assets/index-B0XMMdPo.css +0 -1
@@ -1,11 +1,11 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_DDsvxP8k.js","assets/_C4VRIVt2.js","assets/_Cf990ZTV.js","assets/_BKxOULLA.js","assets/_B2NkZVYt.js","assets/_Di2tZObT.js","assets/_BWNzPyR-.js","assets/_BOb-Pn3q.js","assets/_bqFlf3Pi.js","assets/_CuXae0ve.js","assets/_C_g0fhev.js","assets/_Bni2E818.js","assets/_BXeXVLqQ.js","assets/_B7kC4ECJ.js","assets/_BCnAMUTQ2.js","assets/_DnucOiTi2.js","assets/_BW-4hwO72.js","assets/_CpYNKFv52.js","assets/_bTVj8UrX2.js","assets/_kIpfj7zU2.js","assets/_gzcpVVnB2.js","assets/_B72m4Heg2.js","assets/_B67tNyB02.js","assets/_CHpdg7T22.js","assets/_BfM6eibe2.js","assets/_DOK3qs_j.js","assets/_BLiEKrCj.js","assets/_D4T8Kx36.js","assets/_vk5AMlte.js","assets/_B0Lbe-Ub.js","assets/_DKIbpX1r.js","assets/_ByWtfiyC.js","assets/_BXsQSWWX.js","assets/_BnSmLTYb.js","assets/_Dl4EWW5M.js","assets/_eLpVB_Wq.js","assets/_COW7ENXO.js","assets/_DCdPuEzi.js","assets/_DANQhsl6.js","assets/_B7s0O6p8.js","assets/_BaHq4SXp.js","assets/_BYOwaDjH.js","assets/_CQJs3lWb.js","assets/_CYNrtFtB.js","assets/_DmIc4jLQ.js","assets/_CY8IvGdO2.js","assets/_CBce3t8t2.js","assets/_DYvRD3hg2.js","assets/_Dl-2e7rI2.js","assets/_woXpYk--.js","assets/_B_WEnwWZ2.js","assets/_BoX_Ofe92.js","assets/_BVpFyzyu2.js","assets/_CXQ9i19x2.js","assets/_DOMdlLi02.js","assets/_CglqdFiD2.js","assets/_C2jFdMKg2.js","assets/_Dx-8-gkx.js","assets/_DLbMbJfH2.js","assets/_C8oCnwJJ2.js","assets/_BjchXZRW.js","assets/_MORbWdYO.js","assets/_D9nZPeON.js","assets/_DITDEtIK.js","assets/_D8kGoid1.js","assets/_D20wuad5.js","assets/_C78LMQ4R.js","assets/_KKXFtWm1.js","assets/_DiZzZSjb.js","assets/_CR9ATfbr.js","assets/_DVTAwKKz.js","assets/_DYUI_qtj.js","assets/_DWQbgPoS.js","assets/_DJMQeKeT.js","assets/_D-CiRcbK.js","assets/_BocyNiHx2.js","assets/_3FvrUJYy2.js","assets/_DqKBuwfJ2.js","assets/_oqKa8noW.js","assets/_CnvKMtbv.js","assets/_IyjqRm3v.js","assets/_rLFTqkRN2.js","assets/_CacY0gHj2.js","assets/_B5eOa1yu.js","assets/_Dixweg8N.js","assets/_D1A_Heim2.js","assets/_O90oeIOV2.js","assets/_DLtguS0M2.js","assets/_DOwzaHZ02.js","assets/_B3gFvitq2.js","assets/_Cfkwpbl82.js","assets/_BiFt_7mu2.js","assets/_CMLA9XwU2.js","assets/_BCIV1arR2.js","assets/_BQBiYAA_.js","assets/_CMC5FOms.js","assets/__Fv6A47I.js","assets/_Zjm8E5gs.js","assets/_Bj61d0ZC2.js","assets/_CLG4Axpw.js","assets/_BM315xPC.js","assets/_Cvrh5tZx2.js","assets/_BdJRzcvC.js","assets/_EPocSo4T.js","assets/_L8AbGenz.js","assets/_ByJddavk.js","assets/_DOuSJx7H.js","assets/_DRFzGQ_P.js","assets/_BCr95U42.js","assets/_CsZuTP-e2.js","assets/_QIS_jvCk2.js","assets/_lXr5_a6k2.js","assets/_BBC6FrOe2.js","assets/_Bg7axLcI2.js","assets/_Bct9DrCG2.js","assets/_B6D30XZt.js"])))=>i.map(i=>d[i]);
2
- var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n=/[\\;]/g,r=e=>e===`;`?`\\3B `:`\\\\`,i=function e(t,n,r){let i=``,a=``,o;if(t){if(typeof t!=`object`)i+=t;else if(Array.isArray(t))for(let s of t)o=e(s,n,r),o&&(i+=a+o,a=n);else for(let e in t)o=r(e,t[e]),o&&(i+=a+o,a=n)}return i},a=e=>(e+(e<26?10:e<962?334:11998)).toString(36),o,s,c=2,l=new WeakSet,u=new WeakSet,d=[],f=[],p=(e=>{for(let t=0;t<e.length;)e[t++](e[t++])}),m=e=>{(!o||e.b.F?.H!==0)&&e.c(e.b,e.d)},h,g=(e,t)=>t[1+e]||=(document.addEventListener(e,t,!0),1),_={},v=1e6,y,b=function e(t){t.H=0,t.D?.forEach(e),t.B?.forEach(Re)},x,S,ee=(e,t)=>e.T?.(t),te=new WeakMap,C,ne=function e(t,n,r){let i,o,s=0,c=0;for(;t<n.length;)if(i=n.charCodeAt(t++),o=s,s=0,i===32)r[a(c++)]=C;else if(i===37||i===49)C.replaceWith(C=r[a(c++)]=new Text),i===49&&(r[a(c++)]=Ie());else if(i===38)return t;else if(i===47||i===48)t=e(t,n,r[a(c++)]=Fe(r.$,r.F)),i===48&&(r[a(c++)]=Ie());else if(i<92)for(i=25*o+i-67;i--;)w();else if(i<107)for(i=10*o+i-97;i--;)re();else if(i<117){for(i=10*o+i-107;i--;)C=C.parentNode||C;re()}else s=o*10+i-117},w=()=>{if(C.firstChild)return C=C.firstChild;for(;!C.nextSibling&&C.parentNode;)C=C.parentNode;re()},re=()=>C=C.nextSibling||C,ie={},ae,oe,se,T,E={},D=/[\p{L}\p{N}]/gu,ce=``,le={},ue={},O=be((e,...t)=>{e=a(e);let n=`D`+e,r=[],i=0;for(;i<t.length;)r.push(dt(``,t[i++],t[i++],t[i++])());return(t,i)=>{i!==(t[n]??(t[`A`+e]&&0))&&qt(t,e,r[t[n]=i],lt)}}),de=be((e,t,n)=>{e=a(e),t!==void 0&&(t=a(t)),n!==void 0&&(n=a(n));let r=`A`+e;return(i,a)=>{let o=i[e],s=o.nodeType===1,c=s?o:o.parentNode,l=i[r];l||(l=i[r]={},l.S=s?c.firstChild:i[t],l.K=s?c.lastChild:n===void 0?o.previousSibling:i[n]);let u=l.S;if(l.L&&u===l.K&&u.tagName===`T`){let e=u;e.firstChild||e.appendChild(new Text),l=i[r]={},l.S=u=e.firstChild,l.K=e.lastChild,e.replaceWith(...e.childNodes)}let d=s?!!c.firstChild:u.parentNode===c;a?d||Ve(l,c,s?null:o):d&&(s&&(l.S=c.firstChild,l.K=c.lastChild),He(l))}}),fe=be((e,t,n,r)=>{e=a(e);let i=`A`+e,o=`D`+e;return(a,s,c)=>{let l=ye(s);if(a[o]!==(a[o]=l?.a||l)||t&&!(l||a[i])){if(qt(a,e,l||(t?t(a):void 0),lee),n&&(a[i].T=e=>n()(a,e)),typeof l==`string`){if(t){let e=t(a);qt(a[i],`a`,e,lt),e.f&&Ze(e.e,e.f,a[i].Aa)}}else l?.f&&Ze(l.e,l.f,a[i])}if(l){let e=a[i],n=c?.();if(typeof l==`string`)(t?_t:iee)(e,`a`,(r?n[0]:n)||{},ue[e.a.tagName]),(e.Ia||e.Ea)&&Ce(e,cee);else{for(let t in l.g)l.g[t](e,l.h[t]);if(l.d){if(r)l.d(e,l._?n[0]:n);else{let r=t?{...n,content:t(a)}:n||{};l.d(e,l._?r:[r])}}}}}}),k=be(e=>(t,n,r,i,o)=>{t=a(t);let s=`A`+t,c=`O`+t,l=dt(``,n,r,i)();return(n,r)=>{let i=n[t],a=Ae(n[s]),u=n[s]=[];n[c]=null;let d=a.length,f=i.nodeType>1?i.parentNode||a[0]?.S.parentNode:i,p,m,h=0;e(r,(e,t)=>{let r=u.length,i=a[r],s=d&&(p||e!==(i?.M??r)?(p||=a.reduce((e,t,n)=>n<r?e:(t.I=n,e.set(t.M??n,t)),new Map)).get(e):i&&(h++,i));s?(m=!0,p?.delete(e)):s=lt(n.$,l,n,f),s.M=e,u.push(s),o?.(s,t)});let g=u.length,_=i!==f,v=null,y=d-1,b=g-1;if(_&&(d?(v=a[y].K.nextSibling,g||f.insertBefore(i,v)):g&&(v=i.nextSibling,i.remove())),!m){d&&(a.forEach(_?Be:Le),_||(f.textContent=``));for(let e of u)Ve(e,f,v);return}if(p)p.forEach(Be);else for(let e=g;e<d;e++)Be(a[e]);for(;y>=h&&b>=h&&a[y]===u[b];)y--,b--;if(y+1<d&&(v=a[y+1].S),h>y||h>b){for(let e=h;e<=b;e++)Ve(u[e],f,v);return}let x=b-h+1,S=Array(x),ee=Array(x),te=[],C=-1,ne,w,re;for(let e=x;e--;)S[e]=u[h+e].I??-1;for(let e=0;e<x;e++)if(~S[e]){if(C<0||S[te[C]]<S[e])~C&&(ee[e]=te[C]),te[++C]=e;else{for(ne=0,w=C;ne<w;)re=(ne+w)/2|0,S[te[re]]<S[e]?ne=re+1:w=re;S[e]<S[te[ne]]&&(ne>0&&(ee[e]=te[ne-1]),te[ne]=e)}}for(w=te[C],ne=C+1;ne-->0;)te[ne]=w,w=ee[w];for(let e=x;e--;)~C&&e===te[C]?C--:Ve(u[h+e],f,v),v=u[h+e].S}})(([e,t],n)=>{t||=uee,typeof t==`string`?xe(e,(e,r)=>n(e[t],[e,r])):xe(e,(e,r)=>n(t(e,r),[e,r]))});function pe(e,t){return t?e:``}function me(e,t){return t||t===0?he(e)+`:`+he(t+``):``}function he(e){return n.test(e)?e.replace(n,r):e}function ge(e){return/^on[A-Z-]/.test(e)}function _e(e){return e[2]===`-`?e.slice(3):e.slice(2).toLowerCase()}function ve(e){return e!=null&&e!==!1}function ye(e){if(e){if(typeof e==`string`)return e;let t=e.content||e.default||e;if(`a`in t)return t}}function be(e){return o=1,e}function xe(e,t){if(e){let n=0;for(let r of e)t(r,n++)}}function Se(e,t,n,r,i=e.L){let a;if(n>=0&&(a=e[n])){if(a.d=r,a.e===c||h&&a.f)return;a.e=c}else a={a:i*1e6+n,b:e,c:t,d:r,e:c},n>=0&&(e[n]=a);eee(a)}function eee(e){let t=f.push(e)-1;for(;t;){let n=t-1>>1,r=f[n];if(e.a-r.a>=0)break;f[t]=r,t=n}f[t]=e}function Ce(e,t){d.push(t,e)}function we(){let e=d;try{s=1,Te()}finally{c++,s=0,f=[],d=[]}p(e)}function tee(e,t){h=1,be(),p=e(p),m=t(m)}function Te(){for(;f.length;){let e=f[0],t=f.pop();if(e!==t){let e=0,n=f.length>>1,r=(f[0]=t).a;for(;e<n;){let t=(e<<1)+1,n=t+1;if(n<f.length&&f[n].a-f[t].a<0&&(t=n),f[t].a-r>=0)break;f[e]=f[t],e=t}f[e]=t}m(e)}}function Ee(e,t){let n=e.A?.[t];n&&(e.A[t]=void 0,s?Ce(n,ke):ke(n))}function De(e,t){return Oe(e),((e.A||={})[t]||=new AbortController).signal}function Oe(e,t){let n=e.F;n&&(n.B||=new Set).add(e),t&&(e.Z||=[]).push(t)}function ke(e){e.abort()}function Ae(e){return e?Array.isArray(e)?e:[e]:[]}function je(e,t){if(e){if(Array.isArray(e))for(let n of e)t(n);else t(e)}}function Me(e,t){return e?Array.isArray(e)?(e.push(t),e):[e,t]:t}function A(e,t,n){e[1+t]===void 0&&g(t,Ne),e[1+t]=n||null}function Ne(e){let t=!s&&e.target;for(;t;)t[1+e.type]?.(e,t),t=e.bubbles&&!e.cancelBubble&&t.parentNode}function Pe(e,t){let n=_[t]||=document.createElementNS(t,`template`);return n.innerHTML=e,n.content||n}function Fe(e,t){let n={L:v++,H:c,F:t,$:e};return y?.push(n),n}function Ie(){return v++}function nee(e,t){let n=e.F;for(;n&&n[t]==null;)n=n.N;return n}function Le(e){e.N?.D?.delete(e),b(e)}function Re(e){e.Z?.forEach(ze,e);for(let t in e.A)Ee(e,t)}function ze(e){e.delete(this)}function Be(e){Le(e),Et(e.S,e.K)}function Ve(e,t,n){Dt(t,n,e.S,e.K)}function He(e){let t=new DocumentFragment;t.namespaceURI=e.S.parentNode.namespaceURI,Dt(t,null,e.S,e.K)}function Ue(){x||(x=1,queueMicrotask(We))}function We(){requestAnimationFrame(Ge),we()}function Ge(){S||(S=new MessageChannel,S.port1.onmessage=()=>{x=0,we()}),S.port2.postMessage(0)}function j(e,t){let n=a(e);return(r,i)=>(s?r.H===c&&(r[n]=i,t?.(r)):(r[n]!==i||!(n in r))&&(r[n]=i,t)&&(Ue(),Se(r,t,e)),i)}function Ke(e,t){let n=a(e),r=a(e+1),i=j(e,t);return(e,a,o)=>(s?(e[r]=o)&&(e[n]!==a||!(n in e))?(e[n]=a,t?.(e)):i(e,a):e[r]?e[r](a):i(e,a),a)}function M(e,t){return e=a(e),((n,r)=>{(n[e]!==r||!(e in n))&&(n[e]=r,t?.(n))})}function N(e,t,n=1,r=`L`){return r!==`L`&&(r=a(r)),i=>{i.H===c?~e in i?--i[~e]||t(i):i[~e]=n:Se(i,t,e,0,i[r])}}function qe(e,t){e=a(e);let n=`A`+e,r=e=>{let r=Ae(e[n]);r.length&&Se(e,()=>{for(let e of r)e.H>0&&e.H<c&&t(e)},-1,0,r[0].L)};return r._=t,r}function Je(e,t,n,r){e=a(e),t=a(t),n!==`M`&&(n=a(n));let i=`A`+e,o=`O`+e,s=`_${t}`,l=e=>{let a=Ae(e[i]);if(e.H<c&&a.length){let c=e[t];Se(e,()=>{let t=Ye(e,i,o,n);if(t&&s in t){let e=t.get(t[s]),n=t.get(c);e!==n&&(Xe(e,r),Xe(n,r))}else for(let t of Ae(e[i]))Xe(t,r);t&&(t[s]=c)},-1,0,a[0].L)}};return l._=r,l}function Ye(e,t,n,r){let i=e[n]||=new Map;if(!i.size)for(let a of Ae(e[t])){let t=a.M??a[r];if(t===void 0)return e[n]=null;a.M=t,i.set(t,a)}return i}function Xe(e,t){e&&e.H>0&&e.H<c&&t(e)}function P(e,t,n){e=a(e);let r=`A`+e,i=`D`+e,o=e=>{let a=e[r];a&&a.H>0&&a.H<c&&(e[i]||0)===t&&Se(a,n,-1)};return o._=n,o}function Ze(e,t,n){let r=e[t]||=new Set,{size:i}=r;r.add(n).size!==i&&Oe(n,r)}function F(...e){let[t]=e,n=t.a,r=t.b;for(let t=e.length;t--;)e[t].c=t;return t=>{if(t[n])for(let i of t[n])i.H>0&&i.H<c&&Se(i,e[i[r]||0],-1)}}function I(e,t,n,r){e=a(e);let i=(e=>{e[i.b]=i.c,t(e),Ze(n?n(e):e._,i.a,e)});return i.a=e,i.b=`C`+e,r&&R(r,i),i}function Qe(e,t,n){e[a(t)].T=t=>n(e,t)}function $e({$:e}){let t=te.get(e)||0;return te.set(e,t+1),`c`+e.runtimeId+e.renderId+t.toString(36)}function L(e,t){return R(e,t),e=>{Ce(e,t)}}function*et(e,t,n=t.length-1){if(e){if(Symbol.iterator in e)for(let r of e.values())yield*et(r,t,n);else{let r=e[t[n]];n?yield*et(r,t,n-1):yield typeof r==`function`?r():r}}}function tt(...e){return e=e.map(e=>typeof e==`string`?e:a(e)),t=>{let n=()=>et(t,e).next().value;return n[Symbol.iterator]=()=>et(t,e),n}}function nt(e,...t){return R(e,tt(...t))}function rt(e,t,n){C=e,ne(0,t,n)}function ree(e=`M`){if(ae)return;let t=self[e],n=t=>Object.defineProperty(self,e,t),r=t=>{n({value:ae=(n=>{let r=ae[n]=t[n]||t(n),i=r.w,a={},s=e=>a[e]||(+e?l(a[e]={L:+e}):c()),c=()=>a[0]||={runtimeId:e,renderId:n},l=e=>(e.H=1,e.$=c(),o&&e.G&&(e.F=s(e.G)),e),u=e=>{let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];typeof r==`number`?t+=r:(t?l(Object.assign(a[t]||=(r.L=t,r),r)):Object.assign(c(),r),t++)}},d=((e,t)=>typeof e==`number`?t?ie[t](s(e)):s(e):u(e)),f=(e=[],t=[],n=[],i=[],a)=>(o,c,l,u,d,f=_.parentNode,m=_,h=n.length,v=i.length)=>{for(y!==`[`&&(b[p()]=y===`)`||y===`}`?f:_,u=`A`+x,d=y!==`]`&&y!==`)`,p());o=+x;){if((l||=[]).push(c=s(o)),ct(c,c.F),(c.O=r.p?.[o])&&(c.O.m=r.m),d){for(;m.previousSibling&&~g.indexOf(m=m.previousSibling););c._??=b,c.K=c.S=m,y===`'`&&(c.a=m)}else a=Me(a,c),u&&(b[u]=a,je(a,e=>e._??=b),a=e.pop()),m=t.pop(),f!==m.parentNode&&f.prepend(m),c.S=m,c.K=_.previousSibling===m?m:f.insertBefore(new Text,_);for(;h&&n[h-1].L>o;)h--,ct(n.pop(),c);for(;v&&i[v-1].L>o;){v--;let e=i.pop();e.F!==e&&(e.F=c)}p()}if(l){for(let e of l)n.push(e);d&&(b[u]=l.length>1?l.reverse():l[0])}y===`[`?(l||(e.push(a),a=void 0),t.push(_)):i.push(b)},p=()=>x=v.slice(S,(S=v.indexOf(` `,S)+1||v.length+1)-1),m=(e=[],t)=>{let n=0;for(;n<e.length;n++){let i=e[n];if(typeof i==`string`)for(S=0,v=i;p();)/\D/.test(x)?h=ie[x]:t.push(h,s(x));else if(Array.isArray(i)){if(!(se&&i.every(e=>se.has(e)&&!r.b[e].length)))break}else if(se&&typeof i==`number`)break;else{let e=i(d);Array.isArray(e)&&u(e)}}return e.splice(0,n),n},h,g,_,v,y,b,x,S,ee,te;return d._=ie,r.m=e=>{if(m(r.r,e),se&&r.b)for(let t=1;t;){t=0;for(let n of se){let i=r.b[n];i&&m(i,e)&&(t=1)}}let t=0;for(_ of g=r.v)if(S=r.i.length,v=_.data,y=v[S++],b=s(p()),y===`*`){let e=_.previousSibling;b[p()]=e&&(e.nodeType<8||e.data)?e:_.parentNode.insertBefore(new Text,_)}else o?(ee||=f())():r.b&&(g[t++]=_);return oe&&!te&&_&&oe.set(te=_.parentNode.insertBefore(new Text,_.nextSibling),[n,a]),g.length=t,e},r.w=()=>{i(),it(r)},r})})};if(t){r(t);for(let e in t)it(ae(e))}else n({configurable:!0,set:r})}function it(e){try{T=1,p(e.m([]),1)}finally{T=0}}function R(e,t){return ie[e]=t}function at(e,t){return R(e,e=>n=>t(e,n)),t}function ot(e,t){return t=a(t),R(e,e=>()=>e[t])}function st(e,t,n,r){let i=Fe(e);return i._=t.e||n,ct(i,n?.F),t.b?.(i,r.namespaceURI),i}function ct(e,t){t&&(e.N=t,(t.D||=new Set).add(e)),e.F=e}function lt(e,t,n,r){return ut(t,st(e,t,n,r))}function ut(e,t){return e.c&&Se(t,e.c,-1),t}function dt(e,t,n,r,i,a){n=n?n.replace(/[^\0-1]+$/,``):``,r=r?r._||r:void 0,i||=void 0;let o=t?(e,r)=>{((E[r]||={})[1+t]||=pt(t,r))(e,n)}:e=>{rt(e.S=e.K=new Text,n,e)};return t=>({a:e,b:o,e:t,c:r,d:i,f:a})}function ft(e,t,n,r,i,a){return R(e,dt(e,t,n,r,i,a))}function pt(e,t){let{firstChild:n,lastChild:r}=Pe(e,t),i=document.createElementNS(t,`t`);return Dt(i,null,n,r),n===r&&n.nodeType<8?(e,t)=>{rt(e.S=e.K=n.cloneNode(!0),t,e)}:(e,t)=>{let n=i.cloneNode(!0);rt(n.firstChild,t,e),e.S=n.firstChild,e.K=n.lastChild}}function mt(e){return e||e===0?e+``:``}function z(e,t,n){ht(e,t,wt(n))}function ht(e,t,n){e.getAttribute(t)!=n&&(n===void 0?e.removeAttribute(t):e.setAttribute(t,n))}function B(e,t){ht(e,`class`,i(t,` `,pe)||void 0)}function gt(e,t){ht(e,`style`,i(t,`;`,me)||void 0)}function V(e,t){let n=mt(t);e.data!==n&&(e.data=n)}function _t(e,t,n,r){let i=e[t];for(let e=i.attributes.length;e--;){let{name:t}=i.attributes.item(e);n&&(t in n||vt(i,t,n))||i.removeAttribute(t)}bt(e,t,n,r)}function iee(e,t,n,r){_t(e,t,n,r),xt(e,t,n?.content)}function vt(e,t,n){return t===`checked`&&e.tagName===`INPUT`&&`checkedValue`in n}function yt(e,t,n,r,i){let a=e[t],o={};for(let e=a.attributes.length;e--;){let{name:t}=a.attributes.item(e);!r[t]&&!(n&&(t in n||vt(a,t,n)))&&a.removeAttribute(t)}for(let e in n){let t=ge(e)?`on-${_e(e)}`:e;r[t]||(o[t]=n[e])}bt(e,t,o,i)}function bt(e,t,n,r){let i=e[t],a=e[`I`+t],o;for(let e in a)a[e]=0;r&&(e[`F`+t]=5,e[`E`+t]=0,n&&(o=r(e,t,n)));for(let r in n){let s=n[r];switch(r){case`class`:B(i,s);break;case`style`:gt(i,s);break;default:ge(r)?(a||=e[`I`+t]={})[_e(r)]=s:o?.test(r)||r===`content`&&i.tagName!==`META`||z(i,r,s)}}}function xt(e,t,n){let r=Ct(n);e[`D`+t]!==(e[`D`+t]=r?.a)&&(qt(e,t,r,lt),r?.f&&Ze(r.e,r.f,e[`A`+t]));for(let n in r?.g)r.g[n](e[`A`+t],r.h[n])}function St(e,t){let n=e[t],r=e[`I`+t];le[e[`F`+t]]?.(e,t);for(let e in r)A(n,e,r[e])}function Ct(e){let t=ye(e);if(t&&t.a)return t}function wt(e){if(ve(e))return e===!0?``:e+``}function Tt(e,t,n=0){let r=`K`+n,i=e[r];i?(Object.assign(i,t),i.onUpdate?.()):(e[r]=t,Object.assign(t,t.onMount?.()),De(e,r).onabort=()=>t.onDestroy?.())}function Et(e,t){let n=t.nextSibling;for(;e!==n;){let t=e.nextSibling;e.remove(),e=t}}function Dt(e,t,n,r){if(e.isConnected)e.insertBefore(Ot(n,r),t);else{let i=r.nextSibling;for(;n!==i;){let r=n.nextSibling;e.insertBefore(n,t),n=r}}return e}function Ot(e,t){return e===t?e:Dt(new DocumentFragment,null,e,t)}function kt(e,t,n,r){if((t||t===0)&&(t!==n.length||/kw/.test(e))){let e=n.slice(0,t),i=n.slice(t);if(r.startsWith(e))return t;if(r.endsWith(i))return r.length-i.length;let a=e.match(D)?.length;for(;a&&D.test(r);)a--;return a?r.length:D.lastIndex}return-1}function At(e,t,n){let r=e[t],i=wt(n)||``;if(r.defaultValue!==i){let t=e.H<c?r.value:i;r.defaultValue=i,Nt(r,t)}}function jt(e,t,n,r,i=At){let a=e[t],o=wt(n)||``;e[`E`+t]=r,e[`G`+t]=o,e[`F`+t]=r?2:5,r&&e.H<c?Nt(a,o):i(e,t,o)}function Mt(e,t){let n=e[t];T&&(e[`G`+t]=n.defaultValue),Vt(n,Wt,r=>{let i=e[`E`+t];i&&(ce=r?.inputType,i(n.value),we(),Nt(n,e[`G`+t]),ce=``)})}function Nt(e,t){if(e.value!==t){let n=kt(ce,document.activeElement===e&&e.selectionStart,e.value,e.value=t);~n&&e.setSelectionRange(n,n)}}function Pt(e,t,n){let r,i=e[t],a=e.H<c,o=Array.isArray(n),s=o?n.map(Kt):Kt(n);d.unshift(()=>{for(let e of i.options){let t=o?s.includes(e.value):e.value===s;e.defaultSelected!==t&&(a&&(r??=Rt(i,o)),e.defaultSelected=t)}r!==void 0&&Lt(i,r,o)},e)}function Ft(e,t,n,r){let i=e[t],a=e.H<c,o=Array.isArray(n),s=e[`G`+t]=o?n.map(Kt):Kt(n);e[`E`+t]=r,e[`F`+t]=r?3:5,r&&a?d.unshift(()=>Lt(i,s,o),e):Pt(e,t,s)}function It(e,t){let n=e[t],r=()=>{let r=e[`E`+t];if(r){let i=e[`G`+t],a=Array.isArray(i),o=Rt(n,a);Lt(n,i,a),r(o),we()}};if(T){if(n.multiple){e[`G`+t]=[];for(let r of n.options)r.defaultSelected&&e[`G`+t].push(r.value)}else{e[`G`+t]=``;for(let r of n.options)if(r.defaultSelected){e[`G`+t]=r.value;break}}}Vt(n,Gt,r),Bt(e,t,{childList:!0,subtree:!0},()=>{let i=e[`G`+t];(Array.isArray(i)?i.length!==n.selectedOptions.length||i.some((e,t)=>!i.includes(n.selectedOptions[t].value)):n.value!==i)&&r()})}function Lt(e,t,n){if(n)for(let n of e.options)n.selected=t.includes(n.value);else e.value=t}function Rt(e,t){return t?Array.from(e.selectedOptions,e=>e.value):e.value}function zt(e,t,n){e.H===c&&(e[t].open=ve(n))}function Bt(e,t,n,r){(e[`N`+t]||=new MutationObserver(r)).observe(e[t],n)}function Vt(e,t,n){e._=n,g(`input`,Ht),e.form&&g(`reset`,Ut),T&&t(e)&&queueMicrotask(n)}function Ht(e){e.target._?.(e)}function Ut(e){let t=[];for(let n of e.target.elements)n._&&oee(n)&&t.push(n._);requestAnimationFrame(()=>{if(!e.defaultPrevented)for(let e of t)e()})}function Wt(e){return e.value!==e.defaultValue}function aee(e){return e.checked!==e.defaultChecked}function Gt(e){for(let t of e.options)if(t.selected!==t.defaultSelected)return!0}function oee(e){return e.options?Gt(e):Wt(e)||aee(e)}function Kt(e){return wt(e)||``}function see(e,t){let n=nee(e,`E`);if(n){let e=n._,r=n.P;r&&(n.O&&(n.O.i=0),e[`A`+n.C]=r,Le(n)),l.add(d),qt(e,n.C,n.E,lt),n.E?.d?.(e[`A`+n.C],[t])}else throw t}function cee(e){St(e,`a`)}function qt(e,t,n,r){let i=e[t],a=e[`A`+t],o=i.nodeType>1?(a?.S||i).parentNode:i,s=e[`A`+t]=n&&r(e.$,n,e,o);i===o?(a&&(Le(a),i.textContent=``),s&&Ve(s,o,null)):a?(s?Ve(s,o,a.S):o.insertBefore(i,a.S),Be(a)):s&&(Ve(s,o,i),i.remove())}function lee(e,t,n,r){let i=st(e,t,n,r);return typeof t==`string`?i.a=i.S=i.K=document.createElementNS(t===`svg`?`http://www.w3.org/2000/svg`:t===`math`?`http://www.w3.org/1998/Math/MathML`:r.namespaceURI,t):ut(t,i),i}function uee(e,t){return t}var dee=[],Jt=Symbol();function fee(e){return e[Symbol.iterator]=pee,e[Jt]=dee,e}function*pee(){yield this,yield*this[Jt]}var Yt={working:`_p`,waiting:`_q`,idle:`_r`,off:`_s`},mee=`_u _t`;async function H(e,t){let n=await fetch(e,t),r;try{r=await n.json()}catch{throw Error(n.ok?`invalid response`:`HTTP ${n.status}`)}if(r&&typeof r==`object`&&r.error)throw Error(r.error);if(!n.ok)throw Error(`HTTP ${n.status}`);return r}function Xt(e){let t=e instanceof Error?e.message:String(e);return/HTTP 502|HTTP 503|HTTP 504|Failed to fetch|NetworkError|Load failed|ECONNREFUSED/i.test(t)}var Zt=new Set([`workspaces.changed`,`sessions.changed`,`workspace.progress`,`review.changed`,`status.changed`]),Qt=1e4,$t=4e4,en=8e3,tn=5e3,nn=6e4,rn,an,on=null,sn,cn,ln,un,dn=0;function fn(){return!!on&&on.readyState===WebSocket.OPEN&&!dn}function pn(e){rn?.dispatchEvent(new MessageEvent(`sse.health`,{data:{healthy:e}}))}function mn(e){an&&e!==an&&location.reload(),an=e}async function hn(){try{mn((await H(`/api/boot`)).boot)}catch{}}function gn(){clearTimeout(cn),clearTimeout(ln),ln=setTimeout(_n,$t),dn&&(dn=0,clearInterval(un),un=void 0,pn(!0))}function _n(){vn(),!dn&&(dn=Date.now(),pn(!1),un=setInterval(()=>{document.visibilityState===`visible`&&(Date.now()-dn>nn&&(dn=Date.now(),bn()),yn(),hn(),H(`/api/status`).then(e=>{rn.dispatchEvent(new MessageEvent(`status.changed`,{data:e}))}).catch(()=>{}))},tn))}function vn(){clearTimeout(cn),clearTimeout(ln);let e=on;on=null,e&&(e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null,(e.readyState===WebSocket.OPEN||e.readyState===WebSocket.CONNECTING)&&e.close())}function yn(){for(let e of[`workspaces.changed`,`sessions.changed`])rn.dispatchEvent(new MessageEvent(e,{data:null}))}function bn(){if(on&&(on.readyState===WebSocket.OPEN||on.readyState===WebSocket.CONNECTING))return;let e=location.protocol===`https:`?`wss`:`ws`,t=on=new WebSocket(`${e}://${location.host}/api/events`);clearTimeout(cn),cn=setTimeout(_n,en),t.onmessage=e=>{let t;try{t=JSON.parse(String(e.data))}catch{return}let n=t.type;if(n){if(n===`hello`){gn(),pn(!0),mn(t.data?.boot);return}if(n===`ping`){gn();return}Zt.has(n)&&(gn(),rn.dispatchEvent(new MessageEvent(n,{data:t.data??null})))}},t.onerror=()=>{},t.onclose=()=>{on===t&&(on=null,dn||_n())}}function xn(){return rn||(rn=new EventTarget,bn(),hn(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`?(clearTimeout(sn),bn(),hn(),yn()):(clearTimeout(sn),sn=setTimeout(()=>{dn||vn()},Qt))})),rn}var Sn=null,Cn=null,wn=null,Tn=new EventTarget;function En(e,t){Tn.addEventListener(`intent`,e,{signal:t})}function Dn(e,t){Sn={workspaceId:e,pr:t},Tn.dispatchEvent(new Event(`intent`))}function On(e){if(Sn?.workspaceId!==e)return!1;let t=Sn.pr;return Sn=null,{pr:t}}function kn(e,t){Cn=[e,t],Tn.dispatchEvent(new Event(`intent`))}function An(e){if(Cn?.[0]!==e)return null;let t=Cn[1];return Cn=null,t}function jn(e){wn=e,Tn.dispatchEvent(new Event(`intent`))}function Mn(e){return wn===e&&(wn=null,!0)}function Nn(e){let t=!1,n=!1;return async()=>{if(t){n=!0;return}t=!0;try{do n=!1,await e();while(n)}finally{t=!1}}}var Pn=new Map,Fn=new Set,hee;function gee(e){for(let[t,n]of Object.entries(e))Fn.has(t)||Pn.set(t,n);typeof window<`u`&&(hee??=Promise.resolve())}function In(e){return Pn.get(e)??null}function Ln(e,t){Fn.add(e),t===null?Pn.delete(e):Pn.set(e,t),_ee(e,t)}function _ee(e,t){return fetch(`/api/prefs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({key:e,value:t})}).catch(()=>{})}function Rn(e){Ln(`last-workspace`,e)}function zn(){return In(`side-nav`)!==`0`}function vee(e){Ln(`side-nav`,e?`1`:`0`)}function Bn(e){return In(`tab:${e}`)}function Vn(e,t){Ln(`tab:${e}`,t)}function yee(){return In(`diff-tree`)!==`0`}function bee(e){Ln(`diff-tree`,e?`1`:`0`)}function xee(){return In(`diff-uncommitted`)===`1`}function Hn(e){Ln(`diff-uncommitted`,e?`1`:`0`)}function Un(){return typeof window<`u`&&`serviceWorker`in navigator&&`PushManager`in window}async function Wn(){return Un()?(await Jn()).pushManager.getSubscription():null}async function Gn(){if(await Notification.requestPermission()!==`granted`)return!1;let e=await Jn(),t=await e.pushManager.getSubscription();if(!t){let{publicKey:n}=await H(`/api/push`);t=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Yn(n)})}return await H(`/api/push`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t.toJSON())}),!0}async function Kn(){let e=await Wn();e&&(await H(`/api/push?endpoint=${encodeURIComponent(e.endpoint)}`,{method:`DELETE`}).catch(()=>{}),await e.unsubscribe())}function qn(e){let t=()=>{document.visibilityState===`visible`&&navigator.clearAppBadge?.().catch(()=>{})};t(),document.addEventListener(`visibilitychange`,t,{signal:e})}async function Jn(){return await navigator.serviceWorker.getRegistration()??navigator.serviceWorker.register(`/sw.js`)}function Yn(e){let t=e.padEnd(e.length+(4-e.length%4)%4,`=`),n=atob(t.replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(n,e=>e.charCodeAt(0))}function Xn(){return typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches}function Zn(){return typeof window<`u`&&window.matchMedia(`(max-width: 899px)`).matches}function Qn(){return typeof navigator<`u`&&navigator.standalone===!0}function $n(e){if(!Qn()||!/^https?:\/\//.test(e)){window.open(e,`_blank`,`noopener`);return}if(localStorage.getItem(`xSafariOk`)){location.href=`x-safari-${e}`;return}if(localStorage.getItem(`xSafariNo`)){window.open(e,`_blank`,`noopener`);return}let t=!1,n=()=>{document.visibilityState===`hidden`&&(t=!0,localStorage.setItem(`xSafariOk`,`1`))};document.addEventListener(`visibilitychange`,n),window.addEventListener(`pagehide`,n),setTimeout(()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`pagehide`,n),!(t||document.visibilityState===`hidden`)&&(localStorage.setItem(`xSafariNo`,`1`),window.open(e,`_blank`,`noopener`))},1500),location.href=`x-safari-${e}`}var er=`_S _G`,tr=`<div><div><!><!></div><!></div>`,nr=` D D%b%l%l`,rr=L(`w0`,e=>A(e.a,`click`,function(){e._._.o?.()})),ir=e=>{B(e.a,er),rr(e)},ar=fe(0),or=I(26,e=>ar(e,e._._.n),e=>e._._),sr=O(1,`<!><!><!>`,`b%`,or),cr=P(4,0,e=>sr(e,+!e._.m)),lr=e=>{cr._(e),dr._(e),B(e.a,`_R`)},ur=O(2,`<button type=button title=Dismiss aria-label=Dismiss>×</button>`,` `,ir),dr=P(4,0,e=>ur(e,+!e._.o)),fr=fe(1),pr=P(3,0,e=>fr(e,e._.l)),mr=e=>{pr._(e),B(e.a,`_Q`)},hr=P(2,0,e=>V(e.b,e._.j)),gr=e=>{hr._(e),B(e.a,`_M`)},_r=N(22,e=>B(e.a,[`_I`,e.u,e.v,e.k]),2),vr=M(20,_r),yr=(e,t)=>{z(e.a,`role`,t===`error`?`alert`:`status`),vr(e,{error:`_L`,warn:`_N`,info:`_O`}[t])},br=(e,t)=>yr(e,t||`error`),xr=M(21,_r),Sr=N(19,L(`w1`,e=>Tt(e,{onDismiss:e.o,placement:e.s,onMount:function(){let e=new AbortController;return this.placement===`float`&&this.onDismiss&&window.addEventListener(`keydown`,e=>{e.key===`Escape`&&(document.querySelector(`dialog[open]`)||document.querySelector(`[data-palette]:not([data-inline])`)||e.target instanceof HTMLInputElement&&e.target.value||(e.stopPropagation(),this.onDismiss?.()))},{capture:!0,signal:e.signal}),{abort:e}},onDestroy:function(){this.abort.abort()}}))),Cr=M(18,e=>{xr(e,{float:`_J`,inline:`_K`}[e.s]),Sr(e)}),wr=(e,t)=>Cr(e,t||`float`),Tr=M(10,_r),Er=L(`w2`,e=>St(e,`a`)),Dr=M(16,e=>{yt(e,`a`,e.q,{class:1,role:1}),Er(e)});function Or(e){B(e.b,`_P`)}var kr=O(2,`<strong> </strong>`,` D `,gr),Ar=M(9,e=>{kr(e,+!e.j),hr(e)}),jr=O(3,`<div><!></div>`,` D%`,mr),Mr=M(11,e=>{jr(e,+!e.l),pr(e)}),Nr=O(4,`<div><!><!></div>`,` D%b%`,lr),Pr=N(15,e=>Nr(e,e.m||e.o?0:1)),Fr=M(12,e=>{Lr(e,e.m?.content),Pr(e),cr(e)}),Ir=M(14,e=>{Pr(e),Sr(e),dr(e)}),Lr=M(13,F(or));function Rr(e,t){if(!e)return-1;let n=e.toLowerCase(),r=t.toLowerCase(),i=r.lastIndexOf(`/`),a=r.slice(i+1),o=r.slice(0,Math.max(0,i)).includes(n)?5:0;return a===n?1e3+o:a.startsWith(n)?800+o:a.includes(n)?600+o:Br(n,a)?400+o:r.includes(n)?300:Br(n,r)?100:-1}function zr(e,t,n){return e?t.map(t=>({repo:t,score:Rr(e,t.nameWithOwner)})).filter(({repo:e,score:t})=>!e.isArchived&&t>=0&&!n(e.nameWithOwner)).sort((e,t)=>t.score-e.score||e.repo.nameWithOwner.length-t.repo.nameWithOwner.length||e.repo.nameWithOwner.localeCompare(t.repo.nameWithOwner)).slice(0,8).map(({repo:e})=>e):[]}function Br(e,t){if(!e)return!0;let n=0,r=t.toLowerCase();for(let t of e.toLowerCase()){if(n=r.indexOf(t,n),n===-1)return!1;n++}return!0}function Vr(e){return e?.working?`working`:e?.waiting?`waiting`:e?.agents?`idle`:`off`}function Hr(e){return e?.phase===`working`?`working`:e?.phase===`waiting`?`waiting`:e?.alive?`idle`:`off`}var Ur=`<svg viewBox="0 0 24 24" fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path></path></svg>`,Wr=` D l`,Gr=(e,t)=>{z(e.a,`width`,t),z(e.a,`height`,t)},Kr=(e,t)=>Gr(e,t??15),qr=(e,t)=>B(e.a,[`_c`,t]),Jr=(e,t)=>z(e.b,`d`,t),Yr=Ur,Xr=(e=>`/${e}&`)(Wr);function Zr(e){Jr(e.a,`M18 21C19.1046 21 20 20.1046 20 19C20 17.8954 19.1046 17 18 17C16.8954 17 16 17.8954 16 19C16 20.1046 16.8954 21 18 21Z M6 7C7.10457 7 8 6.10457 8 5C8 3.89543 7.10457 3 6 3C4.89543 3 4 3.89543 4 5C4 6.10457 4.89543 7 6 7Z M18 17V7C18 7 18 5 16 5H13 M6 7V17C6 17 6 19 8 19H11 M15.0005 7.50012L12.5005 5.00012L15.0005 2.50012 M8.5 16.5L11 19L8.5 21.5`)}var Qr=(e,t)=>Kr(e.a,t),$r=(e,t)=>qr(e.a,t),ei=Ur,ti=(e=>`/${e}&`)(Wr);function ni(e){Jr(e.a,`M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z M19.6224 10.3954L18.5247 7.7448L20 6L18 4L16.2647 5.48295L13.5578 4.36974L12.9353 2H10.981L10.3491 4.40113L7.70441 5.51596L6 4L4 6L5.45337 7.78885L4.3725 10.4463L2 11V13L4.40111 13.6555L5.51575 16.2997L4 18L6 20L7.79116 18.5403L10.397 19.6123L11 22H13L13.6045 19.6132L16.2551 18.5155C16.6969 18.8313 18 20 18 20L20 18L18.5159 16.2494L19.6139 13.598L21.9999 12.9772L22 11L19.6224 10.3954Z`)}var ri=(e,t)=>Kr(e.a,t),ii=(e,t)=>qr(e.a,t),ai=Ur,oi=(e=>`/${e}&`)(Wr);function si(e){Jr(e.a,`M6 12H12M18 12H12M12 12V6M12 12V18`)}var ci=(e,t)=>Kr(e.a,t),li=(e,t)=>qr(e.a,t),ui=`<!><!><!>`,See={claude:`M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z`,codex:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`,grok:`M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815`,copilot:`M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z`,cursor:`M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z`},di=P(0,1,e=>Kr(e.a,e._.d)),Cee=e=>{di._(e),fi._(e),Jr(e.a,`M5 7L10 12L5 17 M13 17H20`)},fi=P(0,1,e=>qr(e.a,e._.f)),pi=P(0,0,e=>B(e.a,[`_c`,e._.f])),wee=e=>{pi._(e),mi._(e),hi._(e)},mi=P(0,0,e=>{z(e.a,`width`,e._.g),z(e.a,`height`,e._.g)}),hi=P(0,0,e=>z(e.b,`d`,e._.h)),Tee=M(6,mi),gi=M(3,e=>{Tee(e,e.d??15),di(e)}),Eee=O(0,`<svg viewBox="0 0 24 24" fill=currentColor fill-rule=evenodd aria-hidden=true><path></path></svg>`,` D `,wee,Ur,(e=>`/${e}&`)(Wr),Cee),Dee=M(7,e=>{Eee(e,+!e.h),hi(e)}),_i=(e,t)=>Dee(e,See[t]),vi=M(5,e=>{pi(e),fi(e)}),Oee=`<!><!><div data-palette role=dialog aria-label=Workspaces><!><input autofocus placeholder="Jump to workspace…" aria-label="Filter workspaces"><ul></ul><!><div><span></span><span>↑↓ navigate · ↵ open · ⌘1–9 switch · esc close</span><!></div></div>`,kee=`b%b D%b b b%b Db b%m`,Aee=(e,t)=>{z(e.a,`value`,t),V(e.b,t)},jee=(e,t)=>Aee(e,t[0]),Mee=e=>B(e.a,`_m`),Nee=(e,t)=>V(e.b,t),Pee=(e,t)=>Nee(e,t[0]?.worktree),Fee=e=>B(e.a,`_h`),Iee=e=>B(e.a,[`_h`,`_bx`]),yi=P(8,0,e=>{z(e.a,`title`,`${e._.u} open PR${e._.u===1?``:`s`}`),V(e.b,e._.u),V(e.c,e._.u===1?``:`s`)}),Lee=e=>{yi._(e),B(e.a,[`_h`,`_by`])},bi=P(9,0,e=>z(e.a,`title`,e._.r.map(e=>`:${e.port} ${e.cmd}`).join(`
3
- `))),xi=e=>{bi._(e),Si._(e),B(e.a,[`_h`,`_by`])},Si=P(9,0,e=>V(e.b,e._.s)),Ci=N(2,e=>z(e.a,`title`,`${e._.o} running session${e._.o===1?``:`s`}${e._.p?` — ${e._.p} working`:``}${e._.q?` — ${e._.q} waiting on you`:``}`),2),wi=P(7,0,e=>{V(e.b,e._.o),Ci(e)}),Ti=e=>{wi._(e),Ei._(e),Di._(e),B(e.a,[`_h`,`_by`])},Ei=P(7,0,Ci),Di=P(7,0,Ci),Oi=e=>B(e.a,`_bu`),ki=P(1,1,e=>V(e.b,e._.h)),Ai=e=>{ki._(e),B(e.a,[`_bu`,`_bs`])},ji=e=>B(e.a,`_bt`),Mi=N(2,e=>V(e.b,e._.af?`hide archived`:`archived (${e._.ai})`)),Ni=P(5,0,Mi),Pi=L(`o8`,e=>A(e.a,`click`,function(){po(e._,!e._.af)})),Fi=e=>{Ni._(e),Ii._(e),B(e.a,`_bC`),Pi(e)},Ii=P(5,0,Mi),Li=P(8,0,e=>Ft(e,`b`,e._.aa?.preferredAgent,Bo(e))),Ri=L(`o9`,e=>It(e,`b`)),zi=e=>{Li._(e),Vi._(e),B(e.a,`_l`),Ri(e)},Bi=k(1,`<option> </option>`,` D `,0,jee),Vi=P(8,0,e=>Bi(e,[e._.ad,e=>e])),Hi=L(`o4`,e=>A(e.a,`click`,function(){za(e._,!1)})),Ui=e=>{B(e.a,`_bj`),Hi(e)},Wi=L(`o5`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._.z(e._._.i,e.e)})),Gi=e=>{e.b,gi(e.b,14),vi(e.b),Wi(e)},Ki=M(4,e=>{_i(e.b,e.e),V(e.c,e.e)}),qi=k(6,(e=>`<button>${e}<!></button>`)(ui),(e=>` D/${e}&%l`)(`b%c`),Gi,(e,t)=>Ki(e,t[0])),Ji=I(59,e=>qi(e,[[...e._._.a7||[],`shell`],e=>e]),e=>e._._),Yi=(e,t)=>{z(e.e,`popovertarget`,t),z(e.g,`id`,t)},Xi=L(`o6`,e=>{A(e.a,`click`,function(t){t.stopPropagation(),e._._.x(e._.i)}),A(e.c,`click`,function(t){t.stopPropagation(),e._._.y(e._.i)}),A(e.e,`click`,function(e){e.stopPropagation()}),A(e.g,`toggle`,function(t,n){if(t.newState===`open`){let t=e.e.getBoundingClientRect();n.style.top=`${t.bottom+4}px`,n.style.left=`${Math.max(8,t.right-n.offsetWidth)}px`}})}),Zi=e=>{Ji(e),B(e.a,`_br`),Zr(e.b),Qr(e.b,13),$r(e.b),B(e.c,`_br`),ni(e.d),ri(e.d,13),ii(e.d),B(e.e,`_br`),si(e.f),ci(e.f,13),li(e.f),B(e.g,`_bD`),Yi(e,$e(e)),Xi(e)},Qi=O(4,`<span>open</span>`,` `,Iee),$i=N(21,e=>Qi(e,e._.j===e._._.v?0:1)),ea=I(57,$i,e=>e._._),ta=e=>{ea(e),ia(e),oa._(e),sa._(e),ca._(e),da._(e),B(e.a,`_bu`),B(e.c,`_bv`),B(e.g,`_bw`),B(e.k,`_bz`)},na=(e,t)=>{B(e.b,[`_o`,Yt[Vr(t)]]),pa(e,t?.repos),ha(e,t?.agents),ga(e,t?.working),_a(e,t?.waiting),ya(e,t?.ports)},ra=N(22,e=>na(e,e._._.a6[e._.j])),ia=I(58,ra,e=>e._._),aa=O(5,`<span>archived</span>`,` `,Fee),oa=P(1,2,e=>aa(e,+!e._.g)),sa=P(1,2,e=>{ra(e),$i(e)}),ca=P(1,2,e=>V(e.d,e._.k)),la=k(10,`<span> </span>`,` D `,Mee,Pee),ua=N(13,e=>la(e,[e.m||e._.l,`full_name`])),da=P(1,2,ua),fa=(e,t)=>Sa(e,t?.length),pa=M(12,e=>{fa(e,(e.m||[]).flatMap(e=>e.prs||[])),ua(e)}),ma=O(7,`<span> </span>`,` D `,Ti),ha=M(14,e=>{ma(e,+!e.o),wi(e)}),ga=M(15,Ei),_a=M(16,Di),va=O(9,`<span>:<!></span>`,` Db%`,xi),ya=M(17,e=>{ba(e,e.r?.length),va(e,+!(e.r||[]).length),bi(e)}),ba=M(18,Si),xa=O(8,`<span><!> PR<!></span>`,` D%c%`,Lee),Sa=M(20,e=>{xa(e,+!e.u),yi(e)}),Ca=N(13,e=>B(e.b,[`_bq`,{_bp:e.m===e._.as,_bo:e.f===`ws`&&e.g}]),3),wa=qe(4,Ca),Ta=L(`o7`,e=>{A(e.b,`click`,function(){e._.au(e.e)}),A(e.b,`mouseenter`,function(){fo(e._,e.m)})}),Ea=e=>{wa._(e),B(e.a,`_bn`),Ta(e)},Da=O(1,`<span>+ New workspace</span>`,` `,Oi,`<span>▸ <!></span>`,` Db%`,Ai,`<span><span></span><span> </span><!><!><span><!><!><!></span></span><span></span>`,` D b D l%b%b D%b%b%m `,ta),Oa=O(2,((e,t,n)=>`<button title="Review changes">${e}</button><button title="Manage workspace">${t}</button><button title="New session">${n}</button><div popover=auto></div>`)(Yr,ei,ai),((e,t,n)=>` D/${e}&l D/${t}&l D/${n}&l b`)(Xr,ti,oi),Zi),ka=M(5,e=>{Da(e,e.f===`new`?0:e.f===`cmd`?1:2),Oa(e,e.f===`ws`?0:1),Ca(e)}),Aa=M(6,e=>{Ca(e),oa(e)}),ja=M(12,Ca),Ma=(e,t)=>{Na(e,t[0]),ja(e,t[1])},Na=M(4,e=>{ka(e,e.e?.kind),Aa(e,e.e?.archived),Pa(e,e.e?.label),Fa(e,e.e?.ws)}),Pa=M(7,ki),Fa=M(8,e=>{Ia(e,e.i?.id),La(e,e.i?.name),Ra(e,e.i?.repos)}),Ia=M(9,sa),La=M(10,ca),Ra=M(11,da),za=Ke(19),Ba=N(13,e=>za(e,e.l,e.m)),Va=M(11,Ba),Ha=M(12,Ba),Ua=k(4,`<li><div><button></button><!></div></li>`,`D D b%`,Ea,Ma),Wa=N(55,L(`o12`,e=>{{let t=e.ap.findIndex(t=>t.kind===`ws`&&t.ws.id===e.v);t>=0&&fo(e,t)}setTimeout(()=>e.d?.focus(),0),e.e.children[e.as]?.scrollIntoView({block:`nearest`})}),2),Ga=M(51,e=>{Do(e,e.ap.length),Ua(e,[e.ap,e=>e.kind===`new`?`new`:e.kind===`cmd`?`cmd:${e.label}`:e.ws.id]),Wa(e)}),Ka=N(50,e=>Ga(e,[...e.ak(e.ag).map(e=>({kind:`ws`,ws:e})),...e.af||e.a8?e.ak(e.ah).map(e=>({kind:`ws`,ws:e,archived:!0})):[],...e.an,{kind:`new`}]),5),qa=M(46,Ka),Ja=M(49,Ka),Ya=N(48,e=>Ja(e,!e.a8||!e.al?[]:[{kind:`cmd`,label:`Review changes — ${e.al?.name}`,run:()=>e.x(e.al)},{kind:`cmd`,label:`Manage workspace — ${e.al?.name}`,run:()=>e.y(e.al)},{kind:`cmd`,label:`New ${e.ac||`agent`} session — ${e.al?.name}`,run:()=>e.z(e.al,e.ac||`claude`)}].filter(t=>t.kind===`cmd`&&Br(e.a8||``,t.label))),5),Xa=O(5,`<button> </button>`,` D `,Fi),Za=N(45,e=>Xa(e,e.ai&&!e.a8?0:1)),Qa=Ke(34,e=>{jt(e,`d`,e.a8||``,Ho(e)),qa(e,Vo(e)),Ya(e),Ka(e),Za(e)}),$a=N(16,e=>Qa(e,e.o,e.p)),eo=M(14,$a),to=M(15,$a),no=O(8,`<label><select aria-label="Preferred agent"></select></label>`,` D `,zi),ro=Ke(36,e=>{io(e,e.aa?.preferredAgent),ao(e,e.aa?.agents),no(e,+!e.aa),Li(e)}),io=M(38,Ya),ao=M(39,Vi),oo=N(19,e=>ro(e,e.r,e.s)),so=M(17,e=>{Ro(e,e.r?.agents),oo(e)}),co=M(18,oo),lo=M(54,e=>{Wa(e),wa(e)}),uo=N(53,e=>lo(e,Math.min(e.ae,e.aq-1))),fo=j(40,uo),po=j(41,e=>{Ka(e),Ni(e)}),mo=L(`o10`,e=>{Mt(e,`d`),A(e.d,`keydown`,function(t){t.key===`ArrowDown`?(t.preventDefault(),fo(e,Math.min(e.as+1,e.ap.length-1))):t.key===`ArrowUp`?(t.preventDefault(),fo(e,Math.max(e.as-1,0))):t.key===`Enter`&&(t.preventDefault(),e.au(e.ap[e.as]))})});function ho(e){B(e.e,`_bm`),B(e.g,`_bA`),B(e.h,`_bB`),fo(e,0),po(e,!1),mo(e)}var go=M(42,Ka),_o=M(43,e=>{xo(e,e.ah?.length),Ka(e)}),vo=M(47,Ya),yo=N(22,e=>vo(e,e.u.find(t=>t.id===e.v))),bo=M(20,e=>{Lo(e,e.u?.length),go(e,e.u.filter(e=>e.status===`active`)),_o(e,e.u.filter(e=>e.status===`archived`)),yo(e)}),xo=M(44,e=>{Za(e),Ii(e)}),So=F(ea),Co=M(21,e=>{yo(e),Wa(e),So(e)}),wo=M(23,Ya),To=M(24,Ya),Eo=M(25,Ya),Do=M(52,uo),Oo=M(56),ko=N(28,e=>Oo(e,Uo(e))),Ao=M(26,ko),jo=M(27,ko),Mo=O(0,`<div></div>`,` `,Ui),No=O(2,`<div><p>A <strong>workspace</strong> checks out one or more repos as git worktrees on a shared branch and gives each agent session its own terminal. Create one to get started.</p><p>Pick your preferred agent below — new sessions and the quick-create button use it. GitHub access uses your <code>gh</code> login.</p></div>`,` `,ji),Po=N(31,e=>No(e,e.a3&&!e.a4?0:1)),Fo=L(`o11`,e=>A(e.b,`keydown`,!e.a3&&(t=>{t.key===`Escape`&&(document.querySelector(`:popover-open`)||document.querySelector(`dialog[open]`)||(t.preventDefault(),za(e,!1)))}))),Io=M(29,e=>{B(e.b,[`_bl`,{_bk:e.a3}]),z(e.b,`data-inline`,e.a3?``:void 0),Mo(e,+!!e.a3),Po(e),Fo(e)}),Lo=M(30,Po),Ro=M(33,F(Ji)),zo=M(32,F(ia));function Bo(e){return function(t){ro(e._,{...e._.aa,preferredAgent:t}),H(`/api/settings`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({preferredAgent:t})}).catch(()=>{})}}function Vo(e){return t=>t.filter(t=>Br(e.a8||``,t.name))}function Ho(e){return function(t){Qa(e,t),fo(e,0)}}function Uo(e){return t=>{t&&(t.kind===`new`?e.a0():t.kind===`cmd`?t.run():e.a1(t.ws))}}R(`o1`,Bo),R(`o2`,Vo),R(`o0`,Ho),R(`o3`,Uo);var Wo=`_T _A`,Go=`_W _G`,Ko=`_X _H`,qo=Ur,Jo=(e=>`/${e}&`)(Wr);function Yo(e){Jr(e.a,`M21.8883 13.5C21.1645 18.3113 17.013 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C16.1006 2 19.6248 4.46819 21.1679 8 M17 8H21.4C21.7314 8 22 7.73137 22 7.4V3`)}var Xo=(e,t)=>Kr(e.a,t),Zo=(e,t)=>qr(e.a,t),Qo=`<div><input placeholder="Add a repo…" aria-label="Add a repo"><!><!></div>`,$o=` D b%b%l`,es=null,ts=e=>B(e.a,`_bX`),ns=e=>{B(e.a,`_bX`),B(e.b,`_w`)},rs=e=>B(e.a,`_bX`),is=L(`q7`,e=>A(e.a,`click`,function(){e._._._._._.a1(e._._._.j,e.e)})),as=e=>{B(e.a,`_bQ`),B(e.b,[`_bW`,`_m`]),is(e)},os=M(4,e=>V(e.c,e.e)),ss=(e,t)=>os(e,t[0]),cs=I(35,e=>jt(e,`a`,e._._._._._.a0,Qs(e)),e=>e._._._._._),ls=L(`q6`,e=>Mt(e,`a`)),us=e=>{cs(e),ls(e)},ds=k(2,`<li><button><span> </span></button></li>`,`D D D `,as,ss),fs=(e,t)=>{bs(e,t?.length),ds(e,[t,e=>e])},ps=N(6,e=>fs(e,(e._._._._.a0?e._._._._.y.filter(t=>t.toLowerCase().includes(e._._._._.a0.toLowerCase())):e._._._._.y).slice(0,12))),ms=I(33,ps,e=>e._._._._),hs=e=>{ms(e),_s(e),vs(e),B(e.b,`_bU`)},gs=O(0,`<input placeholder="Filter branches…" aria-label="Filter branches" autofocus>`,` `,us),_s=I(34,e=>gs(e,e._._._._.z>8?0:1),e=>e._._._._),vs=I(35,ps,e=>e._._._._),ys=O(3,`<li><p>No branches match.</p></li>`,`D `,ts),bs=(e,t)=>ys(e,+!!t),xs=O(0,`<p><span></span> Loading branches…</p>`,` D `,ns,`<!><!><ul><!><!></ul>`,`b%b D%b%`,hs),Ss=I(33,e=>xs(e,+!!e._._._.y),e=>e._._._),Cs=e=>{Ss(e),B(e.a,`_bT`)},ws=N(12,e=>B(e.a,[`_bP`,{_bO:e.l===e._._.r}])),Ts=I(30,ws,e=>e._._),Es=L(`q8`,e=>{A(e.a,`mouseenter`,function(){Hs(e._._,e.l)}),A(e.b,`click`,function(){e._._.a1(e.j)}),A(e.f,`click`,function(){e._._.a2(e.j)})}),Ds=e=>{Ts(e),As(e),B(e.b,`_bQ`),si(e.c),ci(e.c,12),li(e.c,`_bV`),B(e.d,`_bW`),Es(e)},Os=O(6,`<div></div>`,` `,Cs),ks=N(10,e=>{B(e.f,[`_bS`,{_bR:e._._.w===e.j}]),Os(e,e._._.w===e.j?0:1)}),As=I(32,ks,e=>e._._),Ree=M(11,ws),zee=M(9,e=>{V(e.e,e.j),z(e.f,`title`,`Pick a base branch for ${e.j}`),z(e.f,`aria-label`,`Pick a base branch for ${e.j}`),ks(e)}),Bee=k(0,(e=>`<li><div><button>${e}<span> </span></button><button>⎇</button></div><!></li>`)(ai),(e=>`D D D/${e}& D m l%l`)(oi),Ds,(e,t)=>{zee(e,t[0]?.nameWithOwner),Ree(e,t[1])}),js=P(3,0,e=>Bee(e,[e._.t,`nameWithOwner`])),Vee=e=>{js._(e),B(e.a,`_bN`)},Ms=P(3,1,e=>V(e.b,e._.o)),Hee=e=>{Ms._(e),B(e.a,`_bX`)},Ns=Ke(8),Ps=N(8,e=>Ns(e,e.g,e.h)),Fs=M(6,Ps),Is=M(7,Ps),Uee=M(19,e=>{Qee(e,e.t?.length),js(e)}),Ls=N(16,e=>Uee(e,e.n&&e.o?zr(e.o,e.n?.repos,t=>e.k.has(t)):[]),2),Wee=O(2,`<p>Loading repos…</p>`,` `,rs),Rs=N(15,e=>Wee(e,e.o&&!e.n?0:1)),Gee=O(3,`<ul></ul>`,` `,Vee,`<p>No repos match "<!>".</p>`,` Db%`,Hee),zs=N(21,e=>Gee(e,e.u?0:e.o&&e.n?1:2),2),Bs=j(13,e=>{Ls(e),Rs(e),zs(e)}),Vs=j(14,e=>{jt(e,`b`,e.o,$s(e)),Ls(e),Rs(e),zs(e),Ms(e)}),Hs=j(17,F(Ts)),Kee=M(28),Us=N(23,e=>Kee(e,ec(e))),qee=F(As),Ws=j(22,e=>{Us(e),qee(e)}),Jee=F(Ss,ms),Gs=j(24,e=>{$ee(e,e.y?.length),Jee(e)}),Ks=j(26,F(vs,cs)),Yee=L(`q9`,e=>{Mt(e,`b`),A(e.b,`keydown`,function(t){t.key===`ArrowDown`?(t.preventDefault(),Hs(e,Math.min(e.r+1,e.t?.length-1))):t.key===`ArrowUp`?(t.preventDefault(),Hs(e,Math.max(e.r-1,0))):t.key===`Enter`?(t.preventDefault(),e.t[e.r]&&e.a1(e.t[e.r].nameWithOwner)):t.key===`Escape`&&e.o&&(t.preventDefault(),Vs(e,``))})});function qs(e){B(e.a,`_bM`),Bs(e,null),Vs(e,``),Hs(e,0),Ws(e,null),Gs(e,null),Ks(e,``),Yee(e)}var Xee=L(`q10`,e=>Tt(e,{onMount:function(){es&&Bs(e,es),e.s(!1)}})),Zee=M(18,e=>{ee(e,tc(e)),Xee(e)}),Js=M(9,e=>{Zee(e,nc(e)),Us(e)}),Qee=M(20,zs),Ys=M(10,Ls),$ee=M(25,F(_s)),ete=M(27),Xs=M(11,e=>ete(e,rc(e))),Zs=(e,t)=>z(e.b,`disabled`,t);function Qs(e){return t=>{Ks(e._._._._._,t)}}function $s(e){return function(t){Vs(e,t),Hs(e,0)}}function ec(e){return async t=>{if(e.w===t){Ws(e,null);return}Ws(e,t),Gs(e,null),Ks(e,``);try{let n=await H(`/api/repos/branches?repo=${encodeURIComponent(t)}`);e.w===t&&Gs(e,n.branches)}catch(t){Ws(e,null),e.j?.(String(t.message||t))}}}function tc(e){return()=>e.s(!0)}function nc(e){return async t=>{t&&Ns(e,!0);try{let n=await H(`/api/repos${t?`?refresh`:``}`);es=n,Bs(e,n)}catch(t){e.j?.(String(t.message||t))}t&&Ns(e,!1)}}function rc(e){return(t,n)=>{Vs(e,``),Ws(e,null),e.l(t,n)}}R(`q1`,Qs),R(`q0`,$s),R(`q5`,ec),R(`q2`,tc),R(`q3`,nc),R(`q4`,rc);var ic=((e,t)=>`<div role=region><div><div><header><div><h1>New workspace</h1><p>Name the space and pick repos — or restore an archived one below.</p></div></header><!><label><span>Name</span><input placeholder=my-feature autofocus></label><section><div><h2>Repos</h2><button title="Refresh repo list" aria-label="Refresh repo list">${e}</button></div><ul><!><!></ul>${t}</section><!><div><button type=button>Cancel</button><button type=button> </button></div><!></div></div></div>`)(qo,Qo),ac=((e,t)=>` D D D D D b m%b Db l D Db D/${e}&m D%b%l0${t}&l%b D b D m%n`)(Jo,$o),tte=e=>B(e.a,`_w`),nte=e=>B(e.a,`_9`),rte=e=>B(e.a,`_w`),ite=e=>B(e.a,`_6`),oc=P(3,0,e=>V(e.b,e._.i)),ate=e=>{oc._(e),B(e.a,[`_4`,`_m`])},ote=O(1,`<span></span>`,` `,rte,`<span>✓</span>`,` `,nte),sc=I(63,e=>{B(e.a,{_8:e.M===e._._.ag-1}),ote(e,e.M===e._._.ag-1?0:1)},e=>e._._),ste=sc,cte=(e,t)=>V(e.c,t),lte=k(0,`<li><!><!></li>`,` D%b%`,ste,(e,t)=>cte(e,t[0])),cc=P(19,0,e=>lte(e,[e._.af])),ute=e=>{cc._(e),B(e.a,`_7`)},lc=I(61,e=>V(e.a,e._._.ae),e=>e._._),dte=ft(`m10`,` `,` `,lc),fte=e=>{Or(e.a),Mr(e.a,dte(e)),wr(e.a,`inline`),Ir(e.a,xl(e)),Fr(e.a),Tr(e.a),br(e.a),Ar(e.a),Dr(e.a,{})},uc=N(15,e=>z(e.g,`disabled`,e._._.a9||!!e._._.aa)),dc=I(59,uc,e=>e._._),pte=L(`m13`,e=>A(e.g,`click`,function(){e._._.at(e.i)})),mte=e=>{dc(e),pc(e),B(e.a,`_bd`),B(e.b,`_be`),B(e.c,`_bf`),B(e.e,[`_bg`,`_m`]),B(e.g,[`_d`,`_bh`]),pte(e)},hte=O(6,`<span></span> Restoring…`,` `,tte,`Restore`),fc=N(14,e=>hte(e,e._._.aa===e.n?0:1)),pc=I(60,e=>{uc(e),fc(e)},e=>e._._),gte=(e,t)=>V(e.d,t),mc=N(12,e=>{z(e.e,`title`,e.k||e.l),V(e.f,e.k||e.l)}),hc=M(10,mc),gc=M(11,mc),_c=M(13,fc),vc=(e,t)=>yc(e,t[0]),yc=M(8,e=>{gte(e,e.i?.name),hc(e,e.i?.display_path),gc(e,e.i?.path),_c(e,e.i?.id)}),bc=k(5,`<li><div><span> </span><span> </span></div><button type=button></button></li>`,` D D D l D m `,mte,vc),xc=P(24,0,e=>bc(e,[e._.ai,`id`])),Sc=e=>{xc._(e),Cc._(e),B(e.a,`__`),B(e.b,`_0`),B(e.c,`_ba`),B(e.e,`_bb`),B(e.f,`_bc`)},Cc=P(24,0,e=>V(e.d,e._.aj)),wc=qe(15,e=>z(e.e,`disabled`,e._.a9)),Tc=L(`m11`,e=>A(e.e,`click`,function(){e._.as(e.h)})),Ec=e=>{wc._(e),B(e.a,`_2`),B(e.b,`_3`),B(e.e,`_5`),Tc(e)},Dc=M(7,e=>{V(e.c,e.h),z(e.e,`title`,`Remove ${e.h}`)}),Oc=O(3,`<span title="Base branch">⎇ <!></span>`,` Db%`,ate),kc=M(8,e=>{Oc(e,+!e.i),oc(e)}),Ac=(e,t)=>{Dc(e,t[0]?.fullName),kc(e,t[0]?.baseBranch)},jc=tt(58),Mc=M(56),Nc=N(52,e=>Mc(e,Sl(e)),6),Pc=N(39,e=>z(e.w,`disabled`,e.a9||!!e.aa||!e.a5.trim()),2),Fc=j(31,e=>{jt(e,`j`,e.a5,Cl(e)),Nc(e),Pc(e)}),Ic=j(32,e=>{B(e.m,[Go,{[Ko]:e.a6}]),z(e.m,`disabled`,e.a6)}),Lc=M(53,e=>Xs(e.r,wl(e))),Rc=M(54),zc=k(15,`<li><span> </span><!><button>×</button></li>`,` D D l%b `,Ec,Ac),Bc=j(33,e=>{Ys(e.r,new Set(e.a7.map(e=>e.fullName))),cl(e,e.a7?.length),Lc(e,Tl(e)),Rc(e,El(e)),zc(e,[e.a7,`fullName`]),Nc(e)}),Vc=N(51,L(`m15`,e=>Tt(e,{busy:e.a9,onMount:function(){let t=new AbortController;return xn().addEventListener(`workspace.progress`,t=>{this.busy&&t.data?.message&&e.ao([t.data])},{signal:t.signal}),{abort:t}},onDestroy:function(){this.abort.abort()}}))),Hc=M(55),Uc=N(38,e=>Hc(e,Dl(e)),2),Wc=O(19,`<ul></ul>`,` `,ute),Gc=N(43,e=>Wc(e,e.a9&&e.ag?0:1)),Kc=N(37,e=>z(e.v,`disabled`,e.a9||!!e.aa)),qc=F(dc),Jc=j(35,e=>{z(e.j,`disabled`,e.a9),Zs(e.r,e.a9),V(e.x,e.a9?`Creating…`:`Create workspace`),Vc(e),Uc(e),Gc(e),Kc(e),Pc(e),wc(e),qc(e)}),Yc=F(pc),Xc=j(36,e=>{Uc(e),Nc(e),Kc(e),Pc(e),Yc(e)}),Zc=O(7,tr,(e=>`/${e}&`)(nr),fte),Qc=F(lc),$c=j(40,e=>{Zc(e,+!e.ae),Qc(e)}),el=M(50,e=>{Vc(e),Nc(e)}),tl=N(49,e=>el(e,Ol(e)),2),nl=j(41,e=>{ul(e,e.af?.length),tl(e),cc(e)}),rl=(e,t)=>{hl(e,t.op),gl(e,t.last)},il=(e,t)=>{z(e.a,`aria-labelledby`,t),z(e.f,`id`,t)},al=L(`m14`,e=>{Mt(e,`j`),A(e.m,`click`,function(){jc(e)()}),A(e.v,`click`,function(){e.a4?.()}),A(e.w,`click`,function(){e.au()})});function ol(e){B(e.a,`_y`),B(e.b,`_z`),B(e.c,Wo),B(e.d,`_C`),B(e.e,`_D`),B(e.g,`_E`),B(e.i,`_Y`),B(e.k,`_Z`),B(e.l,`_0`),Yo(e.n),Xo(e.n,14),Zo(e.n),B(e.o,`_1`),Qe(e,17,yl),qs(e.r),Js(e.r,Al(e)),Is(e.r,kl(e)),Fs(e.r),B(e.u,`_U`),B(e.v,`_d`),B(e.w,[`_d`,`_e`,`_V`]),Fc(e,``),Ic(e,!1),Bc(e,[]),Jc(e,!1),Xc(e,null),$c(e,null),nl(e,[]),rl(e,{last:0,op:``}),il(e,$e(e)),al(e)}var sl=O(16,`<li>No repos yet — search below to add one (or create empty).</li>`,` `,ite),cl=M(34,e=>sl(e,+!!e.a8)),ll=F(sc),ul=M(42,e=>{Gc(e),ll(e)}),dl=M(44,e=>{pl(e,e.ai?.length),xc(e)}),fl=O(24,`<section><div><h2>Archived</h2><span> </span></div><p>Restore a parked space instead of creating a new one.</p><ul></ul></section>`,` D Db D m b `,Sc),pl=M(45,e=>{fl(e,+!e.aj),Cc(e)}),ml=(e,t)=>dl(e,(t||[]).filter(e=>e.status===`archived`).slice().sort((e,t)=>t.created_at.localeCompare(e.created_at))),hl=M(47,e=>{tl(e),Nc(e)}),gl=M(48,e=>{tl(e),Nc(e)}),_l=M(28,Uc),vl=M(29,Nc),yl=at(`m12`,M(58)),bl=M(30);function xl(e){return function(){$c(e._,null)}}function Sl(e){return async()=>{if(e.aa)return;Jc(e,!0),$c(e,null),nl(e,[]),e.al=Math.random().toString(36).slice(2,10);try{e.am=(await H(`/api/progress`)).seq}catch{}let t=setInterval(async()=>{try{let t=await H(`/api/progress?since=${e.am}&op=${e.al}`);e.ao(t.messages)}catch{}},800);try{let t=await H(`/api/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:e.a5,repos:e.a7,opId:e.al})});Jc(e,!1),e.a3?.(t)}catch(t){Jc(e,!1),$c(e,String(t.message||t))}finally{clearInterval(t)}}}function Cl(e){return t=>{Fc(e,t)}}function wl(e){return function(t,n){e.ar(t,n)}}function Tl(e){return(t,n)=>{!t||e.a7.some(e=>e.fullName===t)||Bc(e,e.a7.concat({fullName:t,baseBranch:n}))}}function El(e){return t=>{Bc(e,e.a7.filter(e=>e.fullName!==t))}}function Dl(e){return async t=>{if(!(e.a9||e.aa)){$c(e,null),Xc(e,t.id);try{await H(`/api/workspaces/${t.id}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`restore`})}),e.a2?.({...t,status:`active`})}catch(t){$c(e,String(t.message||t))}finally{Xc(e,null)}}}}function Ol(e){return t=>{for(let n of t)n.op===e.al&&(n.seq&&n.seq<=e.am||(n.seq&&(e.am=n.seq),nl(e,e.af.concat(n.message))))}}function kl(e){return function(t){Ic(e,t)}}function Al(e){return function(t){$c(e,t)}}R(`m6`,xl),R(`m5`,Sl),R(`m0`,Cl),R(`m7`,wl),R(`m2`,Tl),R(`m3`,El),R(`m4`,Dl),R(`m1`,Ol),R(`m9`,kl),R(`m8`,Al);var jl=`_cp _G`,Ml=`_cr _G`,Nl=`_cs _G`,Pl=Ur,Fl=(e=>`/${e}&`)(Wr);function Il(e){Jr(e.a,`M18 8.4C18 6.70261 17.3679 5.07475 16.2426 3.87452C15.1174 2.67428 13.5913 2 12 2C10.4087 2 8.88258 2.67428 7.75736 3.87452C6.63214 5.07475 6 6.70261 6 8.4C6 15.8667 3 18 3 18H21C21 18 18 15.8667 18 8.4Z M13.73 21C13.5542 21.3031 13.3019 21.5547 12.9982 21.7295C12.6946 21.9044 12.3504 21.9965 12 21.9965C11.6496 21.9965 11.3054 21.9044 11.0018 21.7295C10.6982 21.5547 10.4458 21.3031 10.27 21`)}var Ll=(e,t)=>Kr(e.a,t),Rl=(e,t)=>qr(e.a,t),zl=Ur,Bl=(e=>`/${e}&`)(Wr);function Vl(e){Jr(e.a,`M3 12H6L9 3L15 21L18 12H21`)}var Hl=(e,t)=>Kr(e.a,t),Ul=(e,t)=>qr(e.a,t),Wl=`_eR _G`,Gl=Ur,Kl=(e=>`/${e}&`)(Wr);function ql(e){Jr(e.a,`M14.3632 5.65156L15.8431 4.17157C16.6242 3.39052 17.8905 3.39052 18.6716 4.17157L20.0858 5.58579C20.8668 6.36683 20.8668 7.63316 20.0858 8.41421L18.6058 9.8942M14.3632 5.65156L4.74749 15.2672C4.41542 15.5993 4.21079 16.0376 4.16947 16.5054L3.92738 19.2459C3.87261 19.8659 4.39148 20.3848 5.0115 20.33L7.75191 20.0879C8.21972 20.0466 8.65806 19.8419 8.99013 19.5099L18.6058 9.8942M14.3632 5.65156L18.6058 9.8942`)}var Jl=(e,t)=>Kr(e.a,t),Yl=(e,t)=>qr(e.a,t),Xl=`_fG _h _fF`,Zl=`_fH _h _fF`,Ql={open:`_fM`,merged:`_fN`,closed:`_fO`},$l=Ur,eu=(e=>`/${e}&`)(Wr);function tu(e){Jr(e.a,`M6.75827 17.2426L12.0009 12M17.2435 6.75736L12.0009 12M12.0009 12L6.75827 6.75736M12.0009 12L17.2435 17.2426`)}var nu=(e,t)=>Kr(e.a,t),ru=(e,t)=>qr(e.a,t),iu=`<!><!><!>`,au=(e,t)=>{let n=[`${e.worktree} — ${t.title}`];return t.state===`MERGED`?n.push(`merged`):t.state===`CLOSED`?n.push(`closed`):t.isDraft?n.push(`draft`):n.push(`open`),n.join(` · `)},ou=e=>!e.state||e.state===`OPEN`,su=P(4,1,e=>z(e.a,`title`,`Clear #${e._.l} from this list`)),cu=L(`r4`,e=>A(e.a,`click`,function(){e._._._._.m(e._._.f,e._.l)})),lu=e=>{su._(e),B(e.a,[`_fI`,`_fJ`,`_fK`]),tu(e.b),nu(e.b,12),ru(e.b),cu(e)},uu=N(10,e=>B(e.d,[`_fI`,`_fJ`,`_fK`,{_fL:e._._.i===e.j}])),du=N(11,e=>z(e.d,`title`,e._._.i===e.j?`Really kill ${e.h}?`:`Kill ${e.h} (pid ${e.j})`),2),fu=I(17,e=>{uu(e),du(e)},e=>e._._),pu=L(`r5`,e=>{A(e.b,`click`,function(){window.open(`http://${location.hostname}:${e.i}`,`_blank`,`noopener`)}),A(e.d,`click`,function(){e._._.i===e.j?(qu(e._._,null),fetch(`/api/procs/${e.j}`,{method:`DELETE`}).catch(()=>{})):e._._.l(e.j)})}),mu=e=>{fu(e),B(e.a,[`_h`,Zl]),B(e.b,[`_fI`,`_fP`]),tu(e.e),nu(e.e,12),ru(e.e),pu(e)},hu=M(7,e=>{z(e.a,`title`,e.h),du(e)}),gu=M(8,e=>{z(e.b,`title`,`Open http://${typeof location>`u`?`localhost`:location.hostname}:${e.i}`),V(e.c,e.i)}),_u=M(9,e=>{uu(e),du(e)}),vu=(e,t)=>{hu(e,t[0]?.cmd),gu(e,t[0]?.port),_u(e,t[0]?.pid)},yu=P(4,0,e=>z(e.a,`title`,`Review #${e._.l} diff`)),bu=L(`r3`,e=>A(e.a,`click`,function(){e._._._._.h?.(e._._.e,e._.l)})),xu=e=>{yu._(e),B(e.a,[`_fI`,`_fJ`]),Zr(e.b),Qr(e.b,12),$r(e.b),bu(e)},Su=N(14,e=>V(e.c,e._._.d(e._.c))),Cu=I(4,Su,e=>e._._),wu=e=>{Cu(e),Eu._(e),B(e.b,`_fI`)},Tu=N(7,e=>z(e.a,`title`,au(e._.c,e.g))),Eu=qe(0,e=>{Tu(e),Su(e)}),Du=O(4,(e=>`<button type=button>${e}</button>`)(Yr),(e=>` D/${e}&l`)(Xr),xu,(e=>`<button type=button>${e}</button>`)($l),(e=>` D/${e}&l`)(eu),lu),Ou=N(13,e=>B(e.a,[`_h`,Xl,{_j:e.m&&!e.i,_k:e.m&&e.i,[Ql.merged]:e.j===`MERGED`,[Ql.closed]:e.j===`CLOSED`}]),2),ku=M(12,e=>{Du(e,+!e.m),Ou(e)}),Au=M(6,e=>{ju(e,e.g?.isDraft),Mu(e,e.g?.state),Nu(e,e.g?.url),Pu(e,e.g?.number),ku(e,ou(e.g)),Tu(e)}),ju=M(8,Ou),Mu=M(9,Ou),Nu=(e,t)=>z(e.b,`href`,t),Pu=M(11,e=>{V(e.d,e.l),yu(e),su(e)}),Fu=k(0,`<span><a target=_blank rel=noopener><!>#<!></a><!></span>`,` D D%c%l%`,wu,(e,t)=>Au(e,t[0])),Iu=(e,t)=>Fu(e,[t||[],`number`]),Lu=(e,t)=>Ru(e,t[0]),Ru=M(2,e=>{Iu(e,e.c?.prs),zu(e,e.c?.worktree),Bu(e,e.c?.full_name),Eu(e)}),zu=M(4),Bu=M(5),Vu=M(3,F(Cu)),Hu=k(1,`<!><!><!>`,`b%`,0,Lu),Uu=P(0,0,e=>{Vu(e,ld(e)),Hu(e,[e._.n,`full_name`])}),Wu=e=>{Uu._(e),Ku._(e),B(e.a,`_fE`)},Gu=k(2,(e=>`<span><button type=button>:<!></button><button type=button>${e}</button></span>`)($l),(e=>` D Db%l D/${e}&m`)(eu),mu,vu),Ku=P(0,0,e=>Gu(e,[e._.o,`port`])),qu=j(8,F(fu)),Ju=(e,t)=>Zu(e,t.timer);function Yu(e){qu(e,null),Ju(e,{timer:0})}var Xu=M(11),Zu=M(10,e=>Xu(e,ud(e))),Qu=M(12),$u=M(3,e=>Qu(e,dd(e))),ed=O(0,`<div><!><!></div>`,` D%b%`,Wu),td=N(16,e=>ed(e,e.n.some(e=>(e.prs||[]).length)||e.p?0:1)),nd=M(13,e=>{td(e),Uu(e)}),rd=(e,t)=>nd(e,t||[]),id=M(14,e=>{ad(e,e.o.length),Ku(e)}),ad=M(15,td),od=(e,t)=>id(e,t||[]),sd=(e,t)=>{rd(e,t?.repos),od(e,t?.ports)},cd=M(7);function ld(e){return t=>{if(e._.n.length<2)return``;let n=t.full_name.split(`/`)[1];return e._.n.some(e=>e.full_name!==t.full_name&&e.full_name.split(`/`)[1]===n)?t.full_name:n}}function ud(e){return t=>{clearTimeout(e.k),qu(e,t),e.k=setTimeout(()=>{qu(e,null)},3500)}}function dd(e){return(t,n)=>{fetch(`/api/workspaces/${e.d}/prs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t,number:n})}).catch(()=>{})}}R(`r2`,ld),R(`r0`,ud),R(`r1`,dd);var fd=`<!><!><!>`,pd=P(7,0,e=>V(e.b,e._.u)),md=e=>{pd._(e),B(e.a,`_e3`)},hd=I(50,e=>jt(e,`c`,e._._._._.a3,Tp(e)),e=>e._._._._),gd=L(`s8`,e=>{Mt(e,`c`),A(e.c,`keydown`,function(t){t.key===`Enter`?(t.preventDefault(),e._._._._.a5(e._.c)):t.key===`Escape`&&(t.preventDefault(),Jf(e._._._._,null))}),A(e.c,`blur`,function(){e._._._._.a5(e._.c)}),Tt(e,{onMount:function(){queueMicrotask(()=>{let t=e.c;t?.focus(),t?.select()})}})}),_d=e=>{hd(e),vd._(e),yd._(e),e.b,gi(e.b,13),vi(e.b,`_ff`),B(e.c,`_e_`),gd(e)},vd=P(0,0,e=>B(e.a,[`_o`,Yt[Hr(e._.g)],`_e9`])),yd=P(0,0,e=>_i(e.b,e._.h)),bd=N(9,e=>{B(e.i,[`_fa`,{_fc:e._._._._.y===e._.d}]),z(e.i,`title`,e._._._._.y===e._.d?`Really kill this session?`:`Kill session`)}),xd=I(48,bd,e=>e._._._._),Sd=L(`s9`,e=>{A(e.a,`click`,function(){e._._._._.v?.(e._.d)}),A(e.g,`click`,function(){Jf(e._._._._,e._.d),Xf(e._._._._,e._.i||e._.h)}),A(e.i,`click`,function(){e._._._._.y===e._.d?(Uf(e._._._._,null),e._._._._.w?.(e._.d)):e._._._._.a1(e._.d)})}),Cd=e=>{xd(e),wd._(e),Td._(e),Dd._(e),Od._(e),B(e.a,`_fe`),e.c,gi(e.c,13),vi(e.c,`_ff`),B(e.d,`_e7`),B(e.f,`_e8`),B(e.g,`_eY`),ql(e.h),Jl(e.h,12),Yl(e.h),Sd(e)},wd=P(0,1,bd),Td=P(0,1,e=>B(e.b,[`_o`,Yt[Hr(e._.g)]])),Ed=N(10,e=>V(e.e,e._.i||e._.h)),Dd=P(0,1,e=>{_i(e.c,e._.h),Ed(e)}),Od=P(0,1,Ed),kd=N(4,e=>B(e.a,[`_fb`,{_eQ:e.d===e._._._.u}])),Ad=I(46,kd,e=>e._._._),jd=e=>{Ad(e),Pd(e)},Md=O(0,(e=>`<span></span>${e}<input aria-label="Session name">`)(ui),(e=>` b/${e}& b`)(`b%c`),_d,((e,t)=>`<button><span></span>${e}<span> </span></button><div><button title="Rename session">${t}</button><button>×</button></div>`)(ui,Gl),((e,t)=>` D b/${e}& D m D D/${t}&l l`)(`b%c`,Kl),Cd),Nd=N(5,e=>Md(e,e._._._.a2===e.d?0:1)),Pd=I(49,Nd,e=>e._._._),Fd=M(3,e=>{kd(e),Nd(e),wd(e)}),Id=(e,t)=>Ld(e,t[0]),Ld=M(2,e=>{Fd(e,e.c?.id),Rd(e,e.c?.state),zd(e,e.c?.agent),Bd(e,e.c?.title)}),Rd=M(6,e=>{Td(e),vd(e)}),zd=M(7,e=>{Dd(e),yd(e)}),Bd=M(8,Od),Vd=L(`s6`,e=>A(e.a,`click`,function(){e._._._._.r?.()})),Hd=e=>{B(e.a,`_eY`),Zr(e.b),Qr(e.b,12),$r(e.b),Vd(e)},Ud=L(`s4`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._._._.p?.(e.e)})),Wd=e=>{e.b,gi(e.b,14),vi(e.b),Ud(e)},Gd=M(4,e=>{_i(e.b,e.e),V(e.c,e.e)}),Kd=k(2,(e=>`<button>${e}<!></button>`)(ui),(e=>` D/${e}&%l`)(`b%c`),Wd,(e,t)=>Gd(e,t[0])),qd=I(43,e=>Kd(e,[[...e._._._._.q||[],`shell`],e=>e]),e=>e._._._._),Jd=(e,t)=>{z(e.a,`popovertarget`,t),z(e.c,`id`,t)},Yd=L(`s5`,e=>A(e.c,`toggle`,function(t,n){if(t.newState===`open`){let t=e.a.getBoundingClientRect();n.style.top=`${t.bottom+4}px`,n.style.left=`${Math.max(8,Math.min(t.left,window.innerWidth-n.offsetWidth-8))}px`}})),Xd=O(1,(e=>`<button title="New session">${e}</button><div popover=auto></div>`)(ui),(e=>` D/${e}&l b`)(`b%c`),e=>{qd(e),B(e.a,`_eY`),e.b,_i(e.b,`shell`),gi(e.b,12),vi(e.b),B(e.c,`_e0`),Jd(e,$e(e)),Yd(e)}),Zd=I(42,e=>Xd(e,+!e._._._.p),e=>e._._._),Qd=L(`s7`,e=>A(e.d,`click`,function(){e._._._.t?.()})),$d=e=>{Zd(e),tf(e),nf(e),B(e.a,`_eX`),ni(e.e),ri(e.e,12),ii(e.e),Qd(e)},ef=O(2,(e=>`<button title="Review changes">${e}</button>`)(Yr),(e=>` D/${e}&l`)(Xr),Hd),tf=I(44,e=>ef(e,+!e._._._.r),e=>e._._._),nf=I(45,e=>{B(e.d,[`_eY`,{_eZ:e._._._.s}]),z(e.d,`aria-pressed`,e._._._.s?`true`:`false`)},e=>e._._._),rf=I(37,e=>V(e.b,e._._._.j?`Open`:``),e=>e._._._),af=e=>{rf(e),B(e.a,`_e4`)},of=I(34,e=>$u(e.m,e._._.f),e=>e._._),sf=L(`s10`,e=>{A(e.a,`click`,function(t){t.target?.closest(`button, input, a, [popover]`)||e._._.k()}),A(e.c,`click`,function(){e._._.k()})}),cf=e=>{of(e),uf(e),pf(e),mf(e),vf(e),yf(e),bf(e),xf._(e),Tf._(e),B(e.b,`_eV`),B(e.c,`_eW`),B(e.e,`_e1`),B(e.f,`_e2`),B(e.k,`_fd`),Yu(e.m),sf(e)},lf=N(21,e=>B(e.a,[`_eT`,{_eQ:e._._.j,_eU:e._._.n,_e6:e._._.o}]),2),uf=I(37,lf,e=>e._._),df=k(11,`<div></div>`,` `,jd,Id),ff=(e,t)=>{Ef(e,t.length),Df(e,t[0]?.title),Of(e,t[0]?.agent),df(e,[t.length>1?t:[],`id`])},pf=I(39,e=>ff(e,e._._.m||[]),e=>e._._),mf=I(40,lf,e=>e._._),hf=O(7,`<span> </span>`,` D `,md),gf=O(8,`<span> </span>`,` D `,af),_f=O(9,(e=>`<div><!><!><button title="Manage workspace">${e}</button></div>`)(ei),(e=>` D%b%b D/${e}&m`)(ti),$d),vf=I(41,e=>{hf(e,+!e._._.o),gf(e,+!e._._.o),_f(e,+!!e._._.o),lf(e)},e=>e._._),yf=I(47,e=>cd(e.m,e._._.x),e=>e._._),bf=I(51,e=>V(e.g,e._._.a7),e=>e._._),xf=P(0,1,e=>sd(e.m,e._.b)),Sf=M(20,pd),Cf=N(19,e=>Sf(e,e.o===0?e.s:e.o===1?`${e.q||e.r} · ${e.s}`:`${e.o} sessions · ${e.s}`),3),wf=M(18,Cf),Tf=P(0,1,e=>{B(e.d,[`_o`,Yt[e._.c],`_e5`]),wf(e,e._.c===`working`?`Working`:e._.c===`waiting`?`Needs you`:e._.c===`idle`?`Idle`:`Off`)}),Ef=M(14,Cf),Df=M(16,Cf),Of=M(17,Cf),kf=I(37,e=>B(e.a,[Wl,{_eQ:e._._.j}]),e=>e._._),Af=L(`s3`,e=>A(e.a,`click`,function(){e._._.k()})),jf=e=>{kf(e),Mf(e),Nf(e),Pf._(e),Af(e)},Mf=I(38,e=>V(e.b,(e._._.l??0)+1),e=>e._._),Nf=I(51,e=>z(e.a,`title`,e._._.a7),e=>e._._),Pf=P(0,0,e=>B(e.c,[`_o`,Yt[e._.c],`_eS`])),Ff=M(2,e=>{Pf(e),Tf(e)}),If=M(1,e=>{Ff(e,Vr(e.b)),xf(e)}),Lf=N(3,e=>If(e,e._.h[e._.f])),Rf=P(0,0,Lf),zf=e=>{Rf._(e),Bf._(e),Hf._(e)},Bf=P(0,0,Lf),Vf=O(0,`<button> <span></span></button>`,` D b `,jf,(e=>`<section><div><button><span></span><span><span> </span><!></span><!></button><!></div><div><!>${e}</div></section>`)(iu),(e=>` D D D b D D l%l%l%l D%b/${e}&m`)(`b%c`),cf),Hf=P(0,0,e=>Vf(e,+!e._.i)),Uf=j(24,F(xd)),Wf=(e,t)=>$f(e,t.timer),Gf=M(31),Kf=N(30,e=>Gf(e,Ep(e)),2),qf=F(Pd),Jf=j(28,e=>{Kf(e),qf(e)}),Yf=F(hd),Xf=j(29,e=>{Kf(e),Yf(e)});function Zf(e){Uf(e,null),Wf(e,{timer:0}),Jf(e,null),Xf(e,``)}var Qf=M(27),$f=M(26,e=>Qf(e,Dp(e))),ep=M(3,Kf),tp=O(0,`<!><!><!>`,`b%`,zf),np=(e,t)=>{rp(e,t?.name),tp(e,+!t)},rp=M(33,F(Nf,bf)),ip=N(6,e=>np(e,e.e.find(t=>t.id===e.f))),ap=M(4,ip),op=F(of),sp=M(5,e=>{ip(e),Rf(e),op(e)}),cp=M(7,Bf),lp=M(8,Hf),up=M(9,F(kf,uf,rf)),dp=M(10),fp=M(11,F(Mf)),pp=M(12,F(pf)),mp=M(13,F(mf)),hp=M(14,F(vf)),gp=M(15,F(Zd)),_p=M(16,F(qd)),vp=M(17,F(tf)),yp=M(18,F(nf)),bp=M(19),xp=M(20,F(Ad)),Sp=M(21),Cp=M(22),wp=M(23,F(yf));function Tp(e){return t=>{Xf(e._._._._,t)}}function Ep(e){return t=>{if(e.a2!==t.id)return;let n=e.a3.trim();Jf(e,null),n&&e.d?.(t,n)}}function Dp(e){return t=>{clearTimeout(e.a0),Uf(e,t),e.a0=setTimeout(()=>{Uf(e,null)},3500)}}R(`s0`,Tp),R(`s2`,Ep),R(`s1`,Dp);var Op=Ur,kp=(e=>`/${e}&`)(Wr);function Ap(e){Jr(e.a,`M18 6H20M22 6H20M20 6V4M20 6V8 M21.4 20H2.6C2.26863 20 2 19.7314 2 19.4V11H21.4C21.7314 11 22 11.2686 22 11.6V19.4C22 19.7314 21.7314 20 21.4 20Z M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H14`)}var jp=(e,t)=>Kr(e.a,t),Mp=(e,t)=>qr(e.a,t),Np=Ur,Pp=(e=>`/${e}&`)(Wr);function Fp(e){Jr(e.a,`M19 21L5 21C3.89543 21 3 20.1046 3 19L3 5C3 3.89543 3.89543 3 5 3L19 3C20.1046 3 21 3.89543 21 5L21 19C21 20.1046 20.1046 21 19 21Z M7.25 10L5.5 12L7.25 14 M9.5 21V3`)}var Ip=(e,t)=>Kr(e.a,t),Lp=(e,t)=>qr(e.a,t),Rp=Ur,zp=(e=>`/${e}&`)(Wr);function Bp(e){Jr(e.a,`M19 21L5 21C3.89543 21 3 20.1046 3 19L3 5C3 3.89543 3.89543 3 5 3L19 3C20.1046 3 21 3.89543 21 5L21 19C21 20.1046 20.1046 21 19 21Z M9.5 21V3 M5.5 10L7.25 12L5.5 14`)}var Vp=(e,t)=>Kr(e.a,t),Hp=(e,t)=>qr(e.a,t),Up=`<aside><!><div></div><!><div></div></aside>`,Wp=` D%b b%b l`,Gp=e=>{Bp(e.a),Vp(e.a,15),Hp(e.a)},Kp=e=>{Fp(e.a),Ip(e.a,15),Lp(e.a)},qp=e=>B(e.a,`_cy`),Jp=e=>B(e.a,`_cy`),Yp=I(66,e=>{B(e.a,[Nl,{_co:e._._.ac}]),z(e.a,`title`,e._._.ac?`Disable agent-waiting notifications`:`Notify when an agent is waiting`)},e=>e._._),Xp=L(`t22`,e=>A(e.a,`click`,function(){e._._.ag()})),Zp=e=>{Yp(e),Il(e.b),Ll(e.b,15),Rl(e.b),Xp(e)},Qp=I(66,e=>{B(e.a,[Nl,{_co:e._._.ac}]),z(e.a,`title`,e._._.ac?`Disable agent-waiting notifications`:`Notify when an agent is waiting`)},e=>e._._),$p=L(`t17`,e=>A(e.a,`click`,function(){e._._.ag()})),em=e=>{Qp(e),Il(e.b),Ll(e.b,16),Rl(e.b),$p(e)},tm=P(4,1,e=>{B(e.d,[jl,{_co:e._.a9===`usage`}]),z(e.d,`aria-pressed`,e._.a9===`usage`?`true`:`false`),B(e.f,[jl,{_co:e._.a9===`new`}]),z(e.f,`aria-pressed`,e._.a9===`new`?`true`:`false`)}),nm=L(`t23`,e=>{A(e.a,`click`,function(){Th(e._,!e._.ab),vee(e._.ab)}),A(e.d,`click`,function(){e._.af(),e._.s?.()}),A(e.f,`click`,function(){e._.af(),e._.a2?.()})}),rm=e=>{tm._(e),am._(e),sm._(e),B(e.a,Ml),B(e.b,[`_n`,`_cD`]),Vl(e.e),Hl(e.e,15),Ul(e.e),Ap(e.g),jp(e.g,16),Mp(e.g),nm(e)},im=O(0,Np,(e=>`/${e}&`)(Pp),Kp,Rp,(e=>`/${e}&`)(zp),Gp),am=P(4,1,e=>{z(e.a,`title`,e._.ab?`Collapse sidebar`:`Expand sidebar`),im(e,+!e._.ab)}),om=O(2,(e=>`<button>${e}</button>`)(Pl),(e=>` D/${e}&l`)(Fl),Zp),sm=P(4,1,e=>om(e,+!e._.ae)),cm=P(4,0,e=>{B(e.a,[`_cz`,{_co:e._.a9===`new`}]),z(e.a,`aria-pressed`,e._.a9===`new`?`true`:`false`)}),lm=L(`t21`,e=>A(e.a,`click`,function(){e._.af(),e._.a2?.()})),um=e=>{cm._(e),Ap(e.b),jp(e.b,16),Mp(e.b),lm(e)},dm=N(8,e=>vp(e.b,kh(e)),4),fm=I(55,dm,e=>e._._),pm=L(`t20`,e=>{A(e.a,`mouseenter`,function(){e._.i()}),A(e.a,`mouseleave`,function(){e._.j()})}),mm=e=>{fm(e),hm(e),_m(e),vm(e),bm(e),xm(e),Sm(e),Em(e),Dm(e),Om(e),km(e),Am(e),jm(e),Mm._(e),Pm._(e),Fm._(e),B(e.a,`_cE`),Zf(e.b),mp(e.b,!0),bp(e.b,Ah(e)),lp(e.b),fp(e.b),hp(e.b),pm(e)},hm=I(56,e=>_p(e.b,e._._.v),e=>e._._),gm=N(3,e=>gp(e.b,jh(e))),_m=I(57,gm,e=>e._._),vm=I(58,dm,e=>e._._),ym=N(6,e=>pp(e.b,e.c===e._._.a5&&e._._.y?e._._.y:e._._.ak[e.c]?.sessions||[]),3),bm=I(59,ym,e=>e._._),xm=I(60,e=>ep(e.b,e._._.a0),e=>e._._),Sm=I(61,e=>Cp(e.b,e._._.a1),e=>e._._),Cm=N(5,e=>up(e.b,e._._.ao&&e.c===e._._.a5),2),wm=N(4,e=>yp(e.b,e._._.a9===`manage`&&e.c===e._._.a5),2),Tm=N(7,e=>xp(e.b,e.c===e._._.a5&&e._._.a9===`term`?e._._.a7:null),3),Em=I(62,e=>{dp(e.b,Ph(e)),wp(e.b,Nh(e)),Sp(e.b,Mh(e)),Cm(e),wm(e),dm(e),ym(e),Tm(e)},e=>e._._),Dm=I(63,Tm,e=>e._._),Om=I(64,e=>{wm(e),dm(e),Tm(e)},e=>e._._),km=I(70,e=>ap(e.b,e._._.aj),e=>e._._),Am=I(71,e=>{cp(e.b,e._._.ak),ym(e)},e=>e._._),jm=I(73,Cm,e=>e._._),_te=M(2,e=>{sp(e.b,e.c),Cm(e),wm(e),gm(e),dm(e),ym(e),Tm(e)}),Mm=P(1,0,e=>_te(e,e._.d)),Nm=N(9,e=>gt(e.a,`top:${e._.e}px;left:${e._.f}px`)),Pm=P(1,0,Nm),Fm=P(1,0,Nm),Im=N(4,e=>up(e.b,e._._.ao&&e.d===e._._.a5),2),Lm=I(62,e=>{dp(e.b,Fh(e)),Im(e)},e=>e._._),vte=L(`t19`,e=>{A(e.a,`mouseenter`,function(t,n){e._.i();let r=n.getBoundingClientRect();Hm(e._,{id:e.d,top:r.top,left:r.right+8})}),A(e.a,`mouseleave`,function(){e._.j()})}),yte=e=>{Lm(e),Rm(e),zm(e),Bm(e),Zf(e.b),lp(e.b,!0),ep(e.b),pp(e.b),mp(e.b),hp(e.b),gp(e.b),_p(e.b),vp(e.b),yp(e.b),bp(e.b),xp(e.b),Sp(e.b),Cp(e.b),wp(e.b),vte(e)},Rm=I(70,e=>ap(e.b,e._._.aj),e=>e._._),zm=I(71,e=>cp(e.b,e._._.ak),e=>e._._),Bm=I(73,Im,e=>e._._),bte=(e,t)=>fp(e.b,t),xte=M(3,e=>{sp(e.b,e.d),Im(e)}),Ste=k(0,(e=>`<span>${e}</span>`)(fd),(e=>` D/${e}&l`)(`b%c`),yte,(e,t)=>{xte(e,t[0]),bte(e,t[1])}),Vm=P(3,0,e=>Ste(e,[e._.ah,e=>e])),Cte=O(1,(e=>`<div>${e}</div>`)(fd),(e=>` D/${e}&l`)(`b%c`),mm),Hm=j(2,e=>{Ete(e,e.c?.id),Dte(e,e.c?.top),Ote(e,e.c?.left),Cte(e,+!e.c)}),wte=(e,t)=>jte(e,t.timer),Tte=e=>{Vm._(e),B(e.a,`_cB`),Hm(e,null),wte(e,{timer:0})},Ete=M(3,Mm),Dte=M(4,Pm),Ote=M(5,Fm),kte=M(8),Ate=M(9),jte=M(7,e=>{kte(e,Ih(e)),Ate(e,Lh(e))}),Um=N(12,e=>vp(e.c,Rh(e)),4),Wm=qe(2,Um),Mte=e=>{Wm._(e),Gm._(e),qm._(e),Jm._(e),Xm._(e),Zm._(e),Qm._(e),ih._(e),ah._(e),oh._(e),sh._(e),ch._(e),lh._(e),uh._(e),dh._(e),fh._(e),Zf(e.c),bp(e.c,zh(e)),lp(e.c),fp(e.c),mp(e.c)},Gm=qe(2,e=>_p(e.c,e._.v)),Km=N(5,e=>gp(e.c,Bh(e)),2),qm=qe(2,Km),Jm=qe(2,Um),Ym=N(9,e=>pp(e.c,e.e===e._.a5&&e._.y?e._.y:e._.ak[e.e]?.sessions||[]),3),Xm=qe(2,Ym),Zm=qe(2,e=>ep(e.c,e._.a0)),Qm=qe(2,e=>Cp(e.c,e._.a1)),Nte=O(0,`<h2>Current</h2>`,` `,Jp),$m=N(7,e=>Nte(e,e._.am&&e.e===e._.a5?0:1),2),Pte=O(1,`<h2>Other spaces</h2>`,` `,qp),eh=N(11,e=>Pte(e,e._.am&&e.e!==e._.a5&&e.e===e._.ar?0:1),3),th=N(8,e=>up(e.c,e._.ao&&e.e===e._.a5),2),nh=N(6,e=>yp(e.c,e._.a9===`manage`&&e.e===e._.a5),2),rh=N(10,e=>xp(e.c,e.e===e._.a5&&e._.a9===`term`?e._.a7:null),3),ih=Je(2,31,4,e=>{dp(e.c,Uh(e)),wp(e.c,Hh(e)),Sp(e.c,Vh(e)),$m(e),eh(e),th(e),nh(e),Um(e),Ym(e),rh(e)}),ah=qe(2,rh),oh=qe(2,e=>{nh(e),Um(e),rh(e)}),sh=qe(2,Km),ch=qe(2,e=>ap(e.c,e._.aj)),lh=qe(2,e=>{cp(e.c,e._.ak),Ym(e)}),uh=qe(2,e=>{hp(e.c,e._.am),$m(e),eh(e)}),dh=qe(2,th),fh=Je(2,53,4,eh),Fte=M(4,e=>{sp(e.c,e.e),$m(e),eh(e),th(e),nh(e),Km(e),Um(e),Ym(e),rh(e)}),Ite=(e,t)=>Fte(e,t[0]),ph=P(1,0,e=>{B(e.d,[jl,{_co:e._.a9===`usage`}]),z(e.d,`aria-pressed`,e._.a9===`usage`?`true`:`false`)}),Lte=L(`t18`,e=>A(e.d,`click`,function(){e._.af(),e._.s?.()})),Rte=e=>{ph._(e),mh._(e),B(e.a,`_cw`),B(e.b,`_cx`),Vl(e.e),Hl(e.e,16),Ul(e.e),Lte(e)},zte=O(2,(e=>`<button>${e}</button>`)(Pl),(e=>` D/${e}&l`)(Fl),em),mh=P(1,0,e=>zte(e,+!e._.ae)),Bte=F(Rm,km),Vte=M(45,e=>{ch(e),Bte(e)}),hh=N(30,e=>Vte(e,e.q||[e.a3])),Hte=M(29,e=>{Jte(e,e.a3?.id),hh(e)}),Ute=k(2,(e=>`<!><!><!>${e}<!>`)(fd),(e=>`b%b%b/${e}&b`)(`b%c`),Mte,Ite),Wte=(e,t)=>Ute(e,[t,e=>e]),gh=N(52,e=>Wte(e,e.am?[e.a5,...e.ap]:e.ah),3),Gte=M(51,e=>{yne(e,e.ap?.[0]),gh(e)}),_h=N(44,e=>Gte(e,e.ah.filter(t=>t!==e.a5))),Kte=M(43,e=>{_h(e),gh(e),Vm(e)}),vh=N(32,e=>Kte(e,e.q?.length?e.q.filter(e=>e.status===`active`).map(e=>e.id):[e.a5])),yh=N(47,e=>e.ak[e.a5]),qte=F(Lm,Em),Jte=M(31,e=>{vh(e),yh(e),_h(e),gh(e),ih(e),qte(e)}),Yte=Hte,Xte=F(Dm),bh=Ke(33,e=>{ah(e),Xte(e)}),xh=N(10,e=>bh(e,e.i,e.j)),Zte=M(8,xh),Qte=M(9,xh),$te=M(41,sh),ene=O(1,(e=>`<header><h1>Workspaces</h1><div><!><button title=Usage>${e}</button></div></header>`)(zl),(e=>` Db D%b D/${e}&n`)(Bl),Rte),tne=O(4,(e=>`<button title="New workspace">${e} New workspace</button>`)(Op),(e=>` D/${e}&l`)(kp),um,((e,t)=>`<button></button><div></div><!><button title=Usage>${e}</button><button title="New workspace">${t}</button>`)(zl,Op),((e,t)=>` b b%b D/${e}&l D/${t}&l`)(Bl,kp),rm),Sh=N(49,e=>B(e.a,[`_cv`,{_ct:!e.ab,_cu:e.am}])),nne=M(48,e=>{ene(e,+!e.am),tne(e,+!e.am),gh(e),Sh(e),uh(e)}),rne=F(Bm,jm),ine=M(50,e=>{dh(e),rne(e)}),ane=F(Om),Ch=Ke(35,e=>{z(e.a,`hidden`,e.a9===`diff`),$te(e,Wh(e)),nne(e,e.a9===`nav`),ine(e,e.a9!==`usage`&&e.a9!==`new`),ph(e),oh(e),ane(e),cm(e),tm(e)}),wh=N(13,e=>Ch(e,e.l,e.m)),one=M(11,wh),sne=M(12,wh),cne=O(3,`<div></div><!><!>`,` b%`,Tte),Th=j(37,e=>{cne(e,+!!e.ab),Sh(e),am(e)}),lne=M(42),Eh=N(39,e=>lne(e,Gh(e))),une=F(Qp,Yp),Dh=j(38,e=>{Eh(e),une(e)}),dne=L(`t25`,e=>Tt(e,{onMount:function(){Oh(e,Un()),e.ae&&Wn().then(t=>{Dh(e,!!t)})}})),Oh=j(40,e=>{mh(e),sm(e),dne(e)});function fne(e){B(e.c,`_cA`),B(e.e,`_cC`),Th(e,zn()),Dh(e,!1),Oh(e,!1)}var pne=M(14,Eh),mne=M(15,L(`t24`,e=>{e.p&&Th(e,zn())})),hne=M(16,e=>{vh(e),hh(e)}),gne=F(zm,Am),_ne=M(46,e=>{yh(e),lh(e),gne(e)}),vne=(e,t)=>_ne(e,t||{}),yne=M(53,fh),bne=M(18),xne=F(fm),Sne=M(19,e=>{Wm(e),xne(e)}),Cne=M(20),wne=F(hm),Tne=M(21,e=>{Gm(e),wne(e)}),Ene=F(_m),Dne=M(22,e=>{qm(e),Ene(e)}),One=F(vm),kne=M(23,e=>{Jm(e),One(e)}),Ane=F(bm),jne=M(24,e=>{Xm(e),Ane(e)}),Mne=M(25),Nne=F(xm),Pne=M(26,e=>{Zm(e),Nne(e)}),Fne=F(Sm),Ine=M(27,e=>{Qm(e),Fne(e)}),Lne=M(28);function kh(e){return function(){Hm(e._,null),e.c===e._._.a5?e._._.a9===`diff`?Ch(e._._,`term`):e._._.x?.():(Dn(e.c),e._._.t?.(e.c))}}function Ah(e){return function(){Hm(e._,null),e._._.u?.(e.c)}}function jh(e){return function(t){Hm(e._,null),e._._.w(e.c,t)}}function Mh(e){return function(t){Hm(e._,null),e.c===e._._.a5?(bh(e._._,t),Ch(e._._,`term`)):e._._.z?.(e.c,t)}}function Nh(e){return function(t,n){Hm(e._,null);let r=`${t}/${n}`;e.c===e._._.a5?e._._.x?.(r):(Dn(e.c,r),e._._.t?.(e.c))}}function Ph(e){return function(){Hm(e._,null),e.c===e._._.a5?(e._._.a9===`manage`||e._._.a9===`usage`||e._._.a9===`new`)&&Ch(e._._,`term`):e._._.t?.(e.c)}}function Fh(e){return function(){e.d===e._._.a5?(e._._.a9===`manage`||e._._.a9===`usage`||e._._.a9===`new`)&&Ch(e._._,`term`):e._._.t?.(e.d)}}function Ih(e){return()=>clearTimeout(e.h)}function Lh(e){return()=>{clearTimeout(e.h),e.h=setTimeout(()=>{Hm(e,null)},150)}}function Rh(e){return function(){e.e===e._.a5?e._.a9===`diff`?Ch(e._,`term`):e._.x?.():(Dn(e.e),e._.t?.(e.e))}}function zh(e){return function(){e._.u?.(e.e)}}function Bh(e){return function(t){e._.af(),e._.w(e.e,t)}}function Vh(e){return function(t){e.e===e._.a5?(bh(e._,t),Ch(e._,`term`)):e._.z?.(e.e,t)}}function Hh(e){return function(t,n){let r=`${t}/${n}`;e.e===e._.a5?e._.x?.(r):(Dn(e.e,r),e._.t?.(e.e))}}function Uh(e){return function(){e.e===e._.a5?(e._.a9===`nav`||e._.a9===`manage`||e._.a9===`usage`||e._.a9===`new`)&&Ch(e._,`term`):(e._.af(),e._.t?.(e.e))}}function Wh(e){return()=>{e.a9===`nav`&&Ch(e,`term`)}}function Gh(e){return async()=>{try{e.ac?(await Kn(),Dh(e,!1)):(Dh(e,await Gn()),e.ac||e.o?.(`Notifications blocked — allow them for this site in browser/system settings.`))}catch(t){Dh(e,!1),e.o?.(`Notifications failed: ${String(t.message||t)}`)}}}R(`t14`,kh),R(`t12`,Ah),R(`t13`,jh),R(`t16`,Mh),R(`t15`,Nh),R(`t11`,Ph),R(`t10`,Fh),R(`t8`,Ih),R(`t9`,Lh),R(`t5`,Rh),R(`t3`,zh),R(`t4`,Bh),R(`t7`,Vh),R(`t6`,Hh),R(`t2`,Uh),R(`t0`,Wh),R(`t1`,Gh);async function Kh(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.style.cssText=`position:fixed;top:-100px;opacity:0;`,document.body.append(t),t.focus(),t.select();let n=document.execCommand(`copy`);return t.remove(),n}}function qh(e){return e.map(e=>{let t=e.pr?String(e.pr.number):`-`,n=e.pr&&(e.pr.headRefOid||e.head)||``,r=e.localHead||e.head||``;return`${e.worktree}#${t}:${n}:L${r}`}).sort().join(`\0`)}function Jh(e){return e.repos.flatMap(e=>{let t=e.localHead||``;return e.prs.length?e.prs.map(n=>`${e.worktree}#${n.number}:${n.headRefOid||``}:L${t}`):[`${e.worktree}#-::L${t}`]}).sort().join(`\0`)}var Yh=null;function Xh(){return Yh}function Zh(e){let t=[],n=[];for(let r of e.trim().split(/\s+/).filter(Boolean)){let e=r.startsWith(`!`),i=e?r.slice(1):r;i&&(e?n:t).push(Qh(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function Qh(e){if(!/[*?]/.test(e))return t=>Br(e,t);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r===`*`?e[n+1]===`*`?(t+=`.*`,n++):t+=`[^/]*`:t+=r===`?`?`[^/]`:r.replace(/[.+^${}()|[\]\\]/,`\\$&`)}try{let e=new RegExp(t,`i`);return t=>e.test(t)}catch{return t=>Br(e,t)}}var $h=`search-mark`,eg=`mark.${$h}`,tg=`mark.${$h}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${$h} *,mark.${$h} *::before,mark.${$h} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${$h}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,ng={query:``,hit:null},rg=new Map;function ig(e,t){ng.query=e,ng.hit=t;for(let[e,t]of rg)vg(e,ng.query,ng.hit?.key===t?ng.hit:null);t&&og(t)}function ag(){ng.hit&&og(ng.hit)}function og(e,t=0){requestAnimationFrame(()=>{requestAnimationFrame(()=>{let n=!1;for(let[r,i]of rg)if(i===e.key&&(n=!0,cg(r,e)||t>=40))return;t>=40||(!n||t<12)&&setTimeout(()=>og(e,t+1),n?32:48)})})}function sg(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();if(i.height===0&&i.width===0)return!1;if(n===`y`){let t=i.top-r.top+e.scrollTop-(r.height/2-i.height/2);return e.scrollTo({top:Math.max(0,t)}),!0}if(e.scrollWidth<=e.clientWidth+1)return!0;let a=i.left-r.left+e.scrollLeft-(r.width/2-i.width/2),o=Math.max(0,e.scrollWidth-e.clientWidth);return e.scrollTo({left:Math.max(0,Math.min(a,o))}),!0}function cg(e,t){let n=e.querySelector(`diffs-container`)?.shadowRoot;if(!n)return!1;let r=n.querySelector(`mark.search-mark.active`)??(()=>{if(t.line<1)return null;let e=[...n.querySelectorAll(`[data-line="${t.line}"]`)],r=t.side||`additions`;return e.find(e=>pg(e)===r)??e[0]??null})();if(!r)return!1;let i=e.closest(`[data-diff-main]`);if(i){if(!sg(i,r,`y`))return!1}else r.scrollIntoView({block:`center`,inline:`nearest`});let a=r.getRootNode(),o=a instanceof ShadowRoot?a.host:e.querySelector(`diffs-container`);return o&&sg(o,r,`x`),!0}function lg(e,t){let n=t&&ng.hit?.key===t?ng.hit:null;vg(e,ng.query,n),n&&og(n)}function ug(e,t){return rg.set(e,t),lg(e,t),()=>{rg.delete(e)}}function dg(e){lg(e,rg.get(e))}function fg(e){for(let t of[...e.querySelectorAll(eg)]){let e=t.parentElement;t.replaceWith(...t.childNodes),e?.normalize()}}function pg(e){let t=e.closest(`[data-code]`);return t?.hasAttribute(`data-deletions`)?`deletions`:t?.hasAttribute(`data-additions`)?`additions`:(e.getAttribute(`data-line-type`)||``).includes(`deletion`)?`deletions`:`additions`}function mg(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(eg)||n.push(e);return n}function hg(e,t,n){let r=0;for(let i=0;i<e.length;i++){let a=t[i].length;if(n<=r+a)return{node:e[i],offset:Math.min(a,Math.max(0,n-r))};r+=a}let i=e.at(-1);return i?{node:i,offset:t.at(-1)?.length??0}:null}function gg(e,t,n,r,i){let a=hg(e,t,n),o=hg(e,t,r);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset);let c=document.createElement(`mark`);c.className=i;try{c.append(s.extractContents()),s.insertNode(c)}catch{}}function _g(e,t,n,r){let i=mg(e);if(!i.length)return;let a=i.map(e=>e.textContent??``),o=a.join(``),s=n?o:o.toLowerCase(),c=[];for(let e=s.indexOf(t);e!==-1;e=s.indexOf(t,e+t.length))c.push([e,e+t.length]);if(!c.length)return;let l=pg(e),u=Number(e.getAttribute(`data-line`)),d=r&&r.line===u&&(r.side||`additions`)===l?`${$h} active`:$h;for(let e=c.length-1;e>=0;e--)gg(i,a,c[e][0],c[e][1],d)}function vg(e,t,n){let r=[e],i=e.querySelector(`diffs-container`)?.shadowRoot;i&&r.push(i);let a=t.trim(),o=/[A-Z]/.test(a),s=a&&!o?a.toLowerCase():a;for(let e of r)if(fg(e),s)for(let t of e.querySelectorAll(`[data-code] [data-line]`))_g(t,s,o,n)}function yg(e){let t=e.replace(/^origin\//,``),n=t.match(/^(?:[\w.-]+-)?ws-([^-]+)/i);if(n)return n[1];let r=t.includes(`/`)?t.slice(t.lastIndexOf(`/`)+1):t;return r.split(`-`)[0]||r}function bg(e,t){if(!t)return``;let n=e.replace(/^origin\//,``),r=t.replace(/^origin\//,``);return n.startsWith(`${r}-`)?n.slice(r.length+1):``}function xg(e){let t=e.match(/^(?:[\w.-]+-)?ws-([^-]+)/i);if(t)return t[1];if(e.length<=20)return e;let n=e.split(`-`);return n.length>1?n[n.length-1]:e}function Sg(e,t,n=``){let r=(e||`base`).replace(/^origin\//,``),i=(t||`HEAD`).replace(/^origin\//,``),a=(n||``).replace(/^origin\//,``),o=!!a&&(i===a||i.startsWith(`${a}-`));return{base:r,head:o?yg(a):xg(i),topic:o?bg(i,a):``,title:i===r?r:`${i} vs ${r}`}}function Cg(e,t=``){let n=e.replace(/^origin\//,``);if(!n||n===`HEAD`)return n||`HEAD`;let r=t.replace(/^origin\//,``);if(r&&(n===r||n.startsWith(`${r}-`))){let e=yg(r),t=bg(n,r);return t?`${e} [${t}]`:e}return xg(n)}var wg=3;function Tg(e,t){let n=new Map;for(let t of e)n.set(t.worktree,[...n.get(t.worktree)||[],t]);let r=[`Review feedback:`],i=0;for(let[e,a]of n){let n=(t||[]).find(t=>t.worktree===e);r.push(``),r.push(Eg(e,n));for(let e of a){i++;let t=n?.files.find(t=>t.path===e.path),a=e.side===`deletions`?t?.old:t?.new,o=e.side===`deletions`?`Old`:`New`,s=e.line_start===e.line_end?`line ${e.line_start}`:`lines ${e.line_start}-${e.line_end}`;if(r.push(``),r.push(`${i}. **${e.path}** (${o} ${s})`),a!=null){let t=Og(a,e.line_start,e.line_end,e.side),n=kg(t);r.push(``),r.push(Ag(`${n}diff\n${t}\n${n}`))}r.push(``),r.push(Ag(e.text))}}return r.join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_EcTBrSbd.js","assets/_By4p-yp6.js","assets/_BHLmP9J5.js","assets/_DHQLqogP.js","assets/_CK57eBfx.js","assets/_BL0H8RTc.js","assets/_BtlXwps-.js","assets/_08Vl4BnZ.js","assets/_CIyqQPOJ.js","assets/_rFAkd66p.js","assets/_oHnAhOiq.js","assets/_DK6ZJVn2.js","assets/_BXeXVLqQ.js","assets/_CoiAbeQ8.js","assets/_CxmlqqW12.js","assets/_CULJ2MVA2.js","assets/_BHXi673w2.js","assets/_CpYNKFv52.js","assets/_bTVj8UrX2.js","assets/_kIpfj7zU2.js","assets/_gzcpVVnB2.js","assets/_Cp03K8j72.js","assets/_DPzh9We22.js","assets/_B12yQQbd2.js","assets/_DSb5aJbx2.js","assets/_CvDp4NJZ.js","assets/_Dtp3DbhR.js","assets/_DsIT1wDB.js","assets/_yd7odEAs.js","assets/_CKtA_VfT.js","assets/_D_Zit_pp.js","assets/_DFnRtdNh.js","assets/_Boa1CUha.js","assets/_zLB-9r7D.js","assets/_BNg95hln.js","assets/_DaWbmgiB.js","assets/_BAU6KG-h.js","assets/_CQLk7EcY.js","assets/_CTYKjish.js","assets/_4lBAOiBs.js","assets/_BaHq4SXp.js","assets/_BYOwaDjH.js","assets/_CQJs3lWb.js","assets/_CYNrtFtB.js","assets/_DmIc4jLQ.js","assets/_CY8IvGdO2.js","assets/_CBce3t8t2.js","assets/_DYvRD3hg2.js","assets/_Dl-2e7rI2.js","assets/_woXpYk--.js","assets/_a6SPz--f2.js","assets/_Dy3ee_fS2.js","assets/_RKdvAu9n2.js","assets/_t8wmk8-H2.js","assets/_BwCEKN3X2.js","assets/_LyFFu4J72.js","assets/_BlfF1DXc2.js","assets/_Dx-8-gkx.js","assets/_DLbMbJfH2.js","assets/_C8oCnwJJ2.js","assets/_Ci-5oHFp.js","assets/_BQTrV1C2.js","assets/_5zAnG8_b.js","assets/_C4eToTSH.js","assets/_CsV5dOWU.js","assets/_Dd9JhTP3.js","assets/_DML-mp8Z.js","assets/_DE2lMRoV.js","assets/_Ch-k8j3L.js","assets/_DDlaBvIf.js","assets/_DVTAwKKz.js","assets/_DtshxIqm.js","assets/_DWQbgPoS.js","assets/_DJMQeKeT.js","assets/_0HFtYC9j.js","assets/_CUQCJnj92.js","assets/_BIb9glVD2.js","assets/_DqKBuwfJ2.js","assets/_oqKa8noW.js","assets/_CnvKMtbv.js","assets/_IyjqRm3v.js","assets/_rLFTqkRN2.js","assets/_CacY0gHj2.js","assets/_B5eOa1yu.js","assets/_Dixweg8N.js","assets/_D1A_Heim2.js","assets/_O90oeIOV2.js","assets/_ChpDcY902.js","assets/_DOwzaHZ02.js","assets/_B3gFvitq2.js","assets/_Cfkwpbl82.js","assets/_BiFt_7mu2.js","assets/_CMLA9XwU2.js","assets/_C-u7G7Rc2.js","assets/_g8rZMKlA.js","assets/_CMrgWit1.js","assets/_6jzzkyr3.js","assets/_kDVs_4yB.js","assets/_Bj61d0ZC2.js","assets/_DJpNULvH.js","assets/_BM315xPC.js","assets/_Cvrh5tZx2.js","assets/_DoEzd4-6.js","assets/_DuuJhr1w.js","assets/_L8AbGenz.js","assets/_ByJddavk.js","assets/_BBa9QG56.js","assets/_BYcdvOlZ.js","assets/_Ch2s5Yl1.js","assets/_Bl0uloCS2.js","assets/_Dtyrasyh2.js","assets/_BF6FAj1Y2.js","assets/_nmjNS1SP2.js","assets/_CvNPU6mj2.js","assets/_CPWwxTeC2.js","assets/_B6D30XZt.js"])))=>i.map(i=>d[i]);
2
+ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n=/[\\;]/g,r=e=>e===`;`?`\\3B `:`\\\\`,i=function e(t,n,r){let i=``,a=``,o;if(t){if(typeof t!=`object`)i+=t;else if(Array.isArray(t))for(let s of t)o=e(s,n,r),o&&(i+=a+o,a=n);else for(let e in t)o=r(e,t[e]),o&&(i+=a+o,a=n)}return i},a=e=>(e+(e<26?10:e<962?334:11998)).toString(36),o,s,c=2,l=new WeakSet,u=new WeakSet,d=[],f=[],p=(e=>{for(let t=0;t<e.length;)e[t++](e[t++])}),m=e=>{(!o||e.b.F?.H!==0)&&e.c(e.b,e.d)},h,g=(e,t)=>t[1+e]||=(document.addEventListener(e,t,!0),1),_={},v=1e6,y,b=function e(t){t.H=0,t.D?.forEach(e),t.B?.forEach(Re)},x,S,ee=(e,t)=>e.T?.(t),te=new WeakMap,C,ne=function e(t,n,r){let i,o,s=0,c=0;for(;t<n.length;)if(i=n.charCodeAt(t++),o=s,s=0,i===32)r[a(c++)]=C;else if(i===37||i===49)C.replaceWith(C=r[a(c++)]=new Text),i===49&&(r[a(c++)]=Ie());else if(i===38)return t;else if(i===47||i===48)t=e(t,n,r[a(c++)]=Fe(r.$,r.F)),i===48&&(r[a(c++)]=Ie());else if(i<92)for(i=25*o+i-67;i--;)w();else if(i<107)for(i=10*o+i-97;i--;)re();else if(i<117){for(i=10*o+i-107;i--;)C=C.parentNode||C;re()}else s=o*10+i-117},w=()=>{if(C.firstChild)return C=C.firstChild;for(;!C.nextSibling&&C.parentNode;)C=C.parentNode;re()},re=()=>C=C.nextSibling||C,ie={},ae,oe,se,T,E={},D=/[\p{L}\p{N}]/gu,ce=``,le={},ue={},O=be((e,...t)=>{e=a(e);let n=`D`+e,r=[],i=0;for(;i<t.length;)r.push(dt(``,t[i++],t[i++],t[i++])());return(t,i)=>{i!==(t[n]??(t[`A`+e]&&0))&&qt(t,e,r[t[n]=i],lt)}}),de=be((e,t,n)=>{e=a(e),t!==void 0&&(t=a(t)),n!==void 0&&(n=a(n));let r=`A`+e;return(i,a)=>{let o=i[e],s=o.nodeType===1,c=s?o:o.parentNode,l=i[r];l||(l=i[r]={},l.S=s?c.firstChild:i[t],l.K=s?c.lastChild:n===void 0?o.previousSibling:i[n]);let u=l.S;if(l.L&&u===l.K&&u.tagName===`T`){let e=u;e.firstChild||e.appendChild(new Text),l=i[r]={},l.S=u=e.firstChild,l.K=e.lastChild,e.replaceWith(...e.childNodes)}let d=s?!!c.firstChild:u.parentNode===c;a?d||Ve(l,c,s?null:o):d&&(s&&(l.S=c.firstChild,l.K=c.lastChild),He(l))}}),fe=be((e,t,n,r)=>{e=a(e);let i=`A`+e,o=`D`+e;return(a,s,c)=>{let l=ye(s);if(a[o]!==(a[o]=l?.a||l)||t&&!(l||a[i])){if(qt(a,e,l||(t?t(a):void 0),lee),n&&(a[i].T=e=>n()(a,e)),typeof l==`string`){if(t){let e=t(a);qt(a[i],`a`,e,lt),e.f&&Ze(e.e,e.f,a[i].Aa)}}else l?.f&&Ze(l.e,l.f,a[i])}if(l){let e=a[i],n=c?.();if(typeof l==`string`)(t?_t:iee)(e,`a`,(r?n[0]:n)||{},ue[e.a.tagName]),(e.Ia||e.Ea)&&Ce(e,cee);else{for(let t in l.g)l.g[t](e,l.h[t]);if(l.d){if(r)l.d(e,l._?n[0]:n);else{let r=t?{...n,content:t(a)}:n||{};l.d(e,l._?r:[r])}}}}}}),k=be(e=>(t,n,r,i,o)=>{t=a(t);let s=`A`+t,c=`O`+t,l=dt(``,n,r,i)();return(n,r)=>{let i=n[t],a=Ae(n[s]),u=n[s]=[];n[c]=null;let d=a.length,f=i.nodeType>1?i.parentNode||a[0]?.S.parentNode:i,p,m,h=0;e(r,(e,t)=>{let r=u.length,i=a[r],s=d&&(p||e!==(i?.M??r)?(p||=a.reduce((e,t,n)=>n<r?e:(t.I=n,e.set(t.M??n,t)),new Map)).get(e):i&&(h++,i));s?(m=!0,p?.delete(e)):s=lt(n.$,l,n,f),s.M=e,u.push(s),o?.(s,t)});let g=u.length,_=i!==f,v=null,y=d-1,b=g-1;if(_&&(d?(v=a[y].K.nextSibling,g||f.insertBefore(i,v)):g&&(v=i.nextSibling,i.remove())),!m){d&&(a.forEach(_?Be:Le),_||(f.textContent=``));for(let e of u)Ve(e,f,v);return}if(p)p.forEach(Be);else for(let e=g;e<d;e++)Be(a[e]);for(;y>=h&&b>=h&&a[y]===u[b];)y--,b--;if(y+1<d&&(v=a[y+1].S),h>y||h>b){for(let e=h;e<=b;e++)Ve(u[e],f,v);return}let x=b-h+1,S=Array(x),ee=Array(x),te=[],C=-1,ne,w,re;for(let e=x;e--;)S[e]=u[h+e].I??-1;for(let e=0;e<x;e++)if(~S[e]){if(C<0||S[te[C]]<S[e])~C&&(ee[e]=te[C]),te[++C]=e;else{for(ne=0,w=C;ne<w;)re=(ne+w)/2|0,S[te[re]]<S[e]?ne=re+1:w=re;S[e]<S[te[ne]]&&(ne>0&&(ee[e]=te[ne-1]),te[ne]=e)}}for(w=te[C],ne=C+1;ne-->0;)te[ne]=w,w=ee[w];for(let e=x;e--;)~C&&e===te[C]?C--:Ve(u[h+e],f,v),v=u[h+e].S}})(([e,t],n)=>{t||=uee,typeof t==`string`?xe(e,(e,r)=>n(e[t],[e,r])):xe(e,(e,r)=>n(t(e,r),[e,r]))});function pe(e,t){return t?e:``}function me(e,t){return t||t===0?he(e)+`:`+he(t+``):``}function he(e){return n.test(e)?e.replace(n,r):e}function ge(e){return/^on[A-Z-]/.test(e)}function _e(e){return e[2]===`-`?e.slice(3):e.slice(2).toLowerCase()}function ve(e){return e!=null&&e!==!1}function ye(e){if(e){if(typeof e==`string`)return e;let t=e.content||e.default||e;if(`a`in t)return t}}function be(e){return o=1,e}function xe(e,t){if(e){let n=0;for(let r of e)t(r,n++)}}function Se(e,t,n,r,i=e.L){let a;if(n>=0&&(a=e[n])){if(a.d=r,a.e===c||h&&a.f)return;a.e=c}else a={a:i*1e6+n,b:e,c:t,d:r,e:c},n>=0&&(e[n]=a);eee(a)}function eee(e){let t=f.push(e)-1;for(;t;){let n=t-1>>1,r=f[n];if(e.a-r.a>=0)break;f[t]=r,t=n}f[t]=e}function Ce(e,t){d.push(t,e)}function we(){let e=d;try{s=1,Te()}finally{c++,s=0,f=[],d=[]}p(e)}function tee(e,t){h=1,be(),p=e(p),m=t(m)}function Te(){for(;f.length;){let e=f[0],t=f.pop();if(e!==t){let e=0,n=f.length>>1,r=(f[0]=t).a;for(;e<n;){let t=(e<<1)+1,n=t+1;if(n<f.length&&f[n].a-f[t].a<0&&(t=n),f[t].a-r>=0)break;f[e]=f[t],e=t}f[e]=t}m(e)}}function Ee(e,t){let n=e.A?.[t];n&&(e.A[t]=void 0,s?Ce(n,ke):ke(n))}function De(e,t){return Oe(e),((e.A||={})[t]||=new AbortController).signal}function Oe(e,t){let n=e.F;n&&(n.B||=new Set).add(e),t&&(e.Z||=[]).push(t)}function ke(e){e.abort()}function Ae(e){return e?Array.isArray(e)?e:[e]:[]}function je(e,t){if(e){if(Array.isArray(e))for(let n of e)t(n);else t(e)}}function Me(e,t){return e?Array.isArray(e)?(e.push(t),e):[e,t]:t}function A(e,t,n){e[1+t]===void 0&&g(t,Ne),e[1+t]=n||null}function Ne(e){let t=!s&&e.target;for(;t;)t[1+e.type]?.(e,t),t=e.bubbles&&!e.cancelBubble&&t.parentNode}function Pe(e,t){let n=_[t]||=document.createElementNS(t,`template`);return n.innerHTML=e,n.content||n}function Fe(e,t){let n={L:v++,H:c,F:t,$:e};return y?.push(n),n}function Ie(){return v++}function nee(e,t){let n=e.F;for(;n&&n[t]==null;)n=n.N;return n}function Le(e){e.N?.D?.delete(e),b(e)}function Re(e){e.Z?.forEach(ze,e);for(let t in e.A)Ee(e,t)}function ze(e){e.delete(this)}function Be(e){Le(e),Et(e.S,e.K)}function Ve(e,t,n){Dt(t,n,e.S,e.K)}function He(e){let t=new DocumentFragment;t.namespaceURI=e.S.parentNode.namespaceURI,Dt(t,null,e.S,e.K)}function Ue(){x||(x=1,queueMicrotask(We))}function We(){requestAnimationFrame(Ge),we()}function Ge(){S||(S=new MessageChannel,S.port1.onmessage=()=>{x=0,we()}),S.port2.postMessage(0)}function j(e,t){let n=a(e);return(r,i)=>(s?r.H===c&&(r[n]=i,t?.(r)):(r[n]!==i||!(n in r))&&(r[n]=i,t)&&(Ue(),Se(r,t,e)),i)}function Ke(e,t){let n=a(e),r=a(e+1),i=j(e,t);return(e,a,o)=>(s?(e[r]=o)&&(e[n]!==a||!(n in e))?(e[n]=a,t?.(e)):i(e,a):e[r]?e[r](a):i(e,a),a)}function M(e,t){return e=a(e),((n,r)=>{(n[e]!==r||!(e in n))&&(n[e]=r,t?.(n))})}function N(e,t,n=1,r=`L`){return r!==`L`&&(r=a(r)),i=>{i.H===c?~e in i?--i[~e]||t(i):i[~e]=n:Se(i,t,e,0,i[r])}}function qe(e,t){e=a(e);let n=`A`+e,r=e=>{let r=Ae(e[n]);r.length&&Se(e,()=>{for(let e of r)e.H>0&&e.H<c&&t(e)},-1,0,r[0].L)};return r._=t,r}function Je(e,t,n,r){e=a(e),t=a(t),n!==`M`&&(n=a(n));let i=`A`+e,o=`O`+e,s=`_${t}`,l=e=>{let a=Ae(e[i]);if(e.H<c&&a.length){let c=e[t];Se(e,()=>{let t=Ye(e,i,o,n);if(t&&s in t){let e=t.get(t[s]),n=t.get(c);e!==n&&(Xe(e,r),Xe(n,r))}else for(let t of Ae(e[i]))Xe(t,r);t&&(t[s]=c)},-1,0,a[0].L)}};return l._=r,l}function Ye(e,t,n,r){let i=e[n]||=new Map;if(!i.size)for(let a of Ae(e[t])){let t=a.M??a[r];if(t===void 0)return e[n]=null;a.M=t,i.set(t,a)}return i}function Xe(e,t){e&&e.H>0&&e.H<c&&t(e)}function P(e,t,n){e=a(e);let r=`A`+e,i=`D`+e,o=e=>{let a=e[r];a&&a.H>0&&a.H<c&&(e[i]||0)===t&&Se(a,n,-1)};return o._=n,o}function Ze(e,t,n){let r=e[t]||=new Set,{size:i}=r;r.add(n).size!==i&&Oe(n,r)}function F(...e){let[t]=e,n=t.a,r=t.b;for(let t=e.length;t--;)e[t].c=t;return t=>{if(t[n])for(let i of t[n])i.H>0&&i.H<c&&Se(i,e[i[r]||0],-1)}}function I(e,t,n,r){e=a(e);let i=(e=>{e[i.b]=i.c,t(e),Ze(n?n(e):e._,i.a,e)});return i.a=e,i.b=`C`+e,r&&R(r,i),i}function Qe(e,t,n){e[a(t)].T=t=>n(e,t)}function $e({$:e}){let t=te.get(e)||0;return te.set(e,t+1),`c`+e.runtimeId+e.renderId+t.toString(36)}function L(e,t){return R(e,t),e=>{Ce(e,t)}}function*et(e,t,n=t.length-1){if(e){if(Symbol.iterator in e)for(let r of e.values())yield*et(r,t,n);else{let r=e[t[n]];n?yield*et(r,t,n-1):yield typeof r==`function`?r():r}}}function tt(...e){return e=e.map(e=>typeof e==`string`?e:a(e)),t=>{let n=()=>et(t,e).next().value;return n[Symbol.iterator]=()=>et(t,e),n}}function nt(e,...t){return R(e,tt(...t))}function rt(e,t,n){C=e,ne(0,t,n)}function ree(e=`M`){if(ae)return;let t=self[e],n=t=>Object.defineProperty(self,e,t),r=t=>{n({value:ae=(n=>{let r=ae[n]=t[n]||t(n),i=r.w,a={},s=e=>a[e]||(+e?l(a[e]={L:+e}):c()),c=()=>a[0]||={runtimeId:e,renderId:n},l=e=>(e.H=1,e.$=c(),o&&e.G&&(e.F=s(e.G)),e),u=e=>{let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];typeof r==`number`?t+=r:(t?l(Object.assign(a[t]||=(r.L=t,r),r)):Object.assign(c(),r),t++)}},d=((e,t)=>typeof e==`number`?t?ie[t](s(e)):s(e):u(e)),f=(e=[],t=[],n=[],i=[],a)=>(o,c,l,u,d,f=_.parentNode,m=_,h=n.length,v=i.length)=>{for(y!==`[`&&(b[p()]=y===`)`||y===`}`?f:_,u=`A`+x,d=y!==`]`&&y!==`)`,p());o=+x;){if((l||=[]).push(c=s(o)),ct(c,c.F),(c.O=r.p?.[o])&&(c.O.m=r.m),d){for(;m.previousSibling&&~g.indexOf(m=m.previousSibling););c._??=b,c.K=c.S=m,y===`'`&&(c.a=m)}else a=Me(a,c),u&&(b[u]=a,je(a,e=>e._??=b),a=e.pop()),m=t.pop(),f!==m.parentNode&&f.prepend(m),c.S=m,c.K=_.previousSibling===m?m:f.insertBefore(new Text,_);for(;h&&n[h-1].L>o;)h--,ct(n.pop(),c);for(;v&&i[v-1].L>o;){v--;let e=i.pop();e.F!==e&&(e.F=c)}p()}if(l){for(let e of l)n.push(e);d&&(b[u]=l.length>1?l.reverse():l[0])}y===`[`?(l||(e.push(a),a=void 0),t.push(_)):i.push(b)},p=()=>x=v.slice(S,(S=v.indexOf(` `,S)+1||v.length+1)-1),m=(e=[],t)=>{let n=0;for(;n<e.length;n++){let i=e[n];if(typeof i==`string`)for(S=0,v=i;p();)/\D/.test(x)?h=ie[x]:t.push(h,s(x));else if(Array.isArray(i)){if(!(se&&i.every(e=>se.has(e)&&!r.b[e].length)))break}else if(se&&typeof i==`number`)break;else{let e=i(d);Array.isArray(e)&&u(e)}}return e.splice(0,n),n},h,g,_,v,y,b,x,S,ee,te;return d._=ie,r.m=e=>{if(m(r.r,e),se&&r.b)for(let t=1;t;){t=0;for(let n of se){let i=r.b[n];i&&m(i,e)&&(t=1)}}let t=0;for(_ of g=r.v)if(S=r.i.length,v=_.data,y=v[S++],b=s(p()),y===`*`){let e=_.previousSibling;b[p()]=e&&(e.nodeType<8||e.data)?e:_.parentNode.insertBefore(new Text,_)}else o?(ee||=f())():r.b&&(g[t++]=_);return oe&&!te&&_&&oe.set(te=_.parentNode.insertBefore(new Text,_.nextSibling),[n,a]),g.length=t,e},r.w=()=>{i(),it(r)},r})})};if(t){r(t);for(let e in t)it(ae(e))}else n({configurable:!0,set:r})}function it(e){try{T=1,p(e.m([]),1)}finally{T=0}}function R(e,t){return ie[e]=t}function at(e,t){return R(e,e=>n=>t(e,n)),t}function ot(e,t){return t=a(t),R(e,e=>()=>e[t])}function st(e,t,n,r){let i=Fe(e);return i._=t.e||n,ct(i,n?.F),t.b?.(i,r.namespaceURI),i}function ct(e,t){t&&(e.N=t,(t.D||=new Set).add(e)),e.F=e}function lt(e,t,n,r){return ut(t,st(e,t,n,r))}function ut(e,t){return e.c&&Se(t,e.c,-1),t}function dt(e,t,n,r,i,a){n=n?n.replace(/[^\0-1]+$/,``):``,r=r?r._||r:void 0,i||=void 0;let o=t?(e,r)=>{((E[r]||={})[1+t]||=pt(t,r))(e,n)}:e=>{rt(e.S=e.K=new Text,n,e)};return t=>({a:e,b:o,e:t,c:r,d:i,f:a})}function ft(e,t,n,r,i,a){return R(e,dt(e,t,n,r,i,a))}function pt(e,t){let{firstChild:n,lastChild:r}=Pe(e,t),i=document.createElementNS(t,`t`);return Dt(i,null,n,r),n===r&&n.nodeType<8?(e,t)=>{rt(e.S=e.K=n.cloneNode(!0),t,e)}:(e,t)=>{let n=i.cloneNode(!0);rt(n.firstChild,t,e),e.S=n.firstChild,e.K=n.lastChild}}function mt(e){return e||e===0?e+``:``}function z(e,t,n){ht(e,t,wt(n))}function ht(e,t,n){e.getAttribute(t)!=n&&(n===void 0?e.removeAttribute(t):e.setAttribute(t,n))}function B(e,t){ht(e,`class`,i(t,` `,pe)||void 0)}function gt(e,t){ht(e,`style`,i(t,`;`,me)||void 0)}function V(e,t){let n=mt(t);e.data!==n&&(e.data=n)}function _t(e,t,n,r){let i=e[t];for(let e=i.attributes.length;e--;){let{name:t}=i.attributes.item(e);n&&(t in n||vt(i,t,n))||i.removeAttribute(t)}bt(e,t,n,r)}function iee(e,t,n,r){_t(e,t,n,r),xt(e,t,n?.content)}function vt(e,t,n){return t===`checked`&&e.tagName===`INPUT`&&`checkedValue`in n}function yt(e,t,n,r,i){let a=e[t],o={};for(let e=a.attributes.length;e--;){let{name:t}=a.attributes.item(e);!r[t]&&!(n&&(t in n||vt(a,t,n)))&&a.removeAttribute(t)}for(let e in n){let t=ge(e)?`on-${_e(e)}`:e;r[t]||(o[t]=n[e])}bt(e,t,o,i)}function bt(e,t,n,r){let i=e[t],a=e[`I`+t],o;for(let e in a)a[e]=0;r&&(e[`F`+t]=5,e[`E`+t]=0,n&&(o=r(e,t,n)));for(let r in n){let s=n[r];switch(r){case`class`:B(i,s);break;case`style`:gt(i,s);break;default:ge(r)?(a||=e[`I`+t]={})[_e(r)]=s:o?.test(r)||r===`content`&&i.tagName!==`META`||z(i,r,s)}}}function xt(e,t,n){let r=Ct(n);e[`D`+t]!==(e[`D`+t]=r?.a)&&(qt(e,t,r,lt),r?.f&&Ze(r.e,r.f,e[`A`+t]));for(let n in r?.g)r.g[n](e[`A`+t],r.h[n])}function St(e,t){let n=e[t],r=e[`I`+t];le[e[`F`+t]]?.(e,t);for(let e in r)A(n,e,r[e])}function Ct(e){let t=ye(e);if(t&&t.a)return t}function wt(e){if(ve(e))return e===!0?``:e+``}function Tt(e,t,n=0){let r=`K`+n,i=e[r];i?(Object.assign(i,t),i.onUpdate?.()):(e[r]=t,Object.assign(t,t.onMount?.()),De(e,r).onabort=()=>t.onDestroy?.())}function Et(e,t){let n=t.nextSibling;for(;e!==n;){let t=e.nextSibling;e.remove(),e=t}}function Dt(e,t,n,r){if(e.isConnected)e.insertBefore(Ot(n,r),t);else{let i=r.nextSibling;for(;n!==i;){let r=n.nextSibling;e.insertBefore(n,t),n=r}}return e}function Ot(e,t){return e===t?e:Dt(new DocumentFragment,null,e,t)}function kt(e,t,n,r){if((t||t===0)&&(t!==n.length||/kw/.test(e))){let e=n.slice(0,t),i=n.slice(t);if(r.startsWith(e))return t;if(r.endsWith(i))return r.length-i.length;let a=e.match(D)?.length;for(;a&&D.test(r);)a--;return a?r.length:D.lastIndex}return-1}function At(e,t,n){let r=e[t],i=wt(n)||``;if(r.defaultValue!==i){let t=e.H<c?r.value:i;r.defaultValue=i,Nt(r,t)}}function jt(e,t,n,r,i=At){let a=e[t],o=wt(n)||``;e[`E`+t]=r,e[`G`+t]=o,e[`F`+t]=r?2:5,r&&e.H<c?Nt(a,o):i(e,t,o)}function Mt(e,t){let n=e[t];T&&(e[`G`+t]=n.defaultValue),Vt(n,Wt,r=>{let i=e[`E`+t];i&&(ce=r?.inputType,i(n.value),we(),Nt(n,e[`G`+t]),ce=``)})}function Nt(e,t){if(e.value!==t){let n=kt(ce,document.activeElement===e&&e.selectionStart,e.value,e.value=t);~n&&e.setSelectionRange(n,n)}}function Pt(e,t,n){let r,i=e[t],a=e.H<c,o=Array.isArray(n),s=o?n.map(Kt):Kt(n);d.unshift(()=>{for(let e of i.options){let t=o?s.includes(e.value):e.value===s;e.defaultSelected!==t&&(a&&(r??=Rt(i,o)),e.defaultSelected=t)}r!==void 0&&Lt(i,r,o)},e)}function Ft(e,t,n,r){let i=e[t],a=e.H<c,o=Array.isArray(n),s=e[`G`+t]=o?n.map(Kt):Kt(n);e[`E`+t]=r,e[`F`+t]=r?3:5,r&&a?d.unshift(()=>Lt(i,s,o),e):Pt(e,t,s)}function It(e,t){let n=e[t],r=()=>{let r=e[`E`+t];if(r){let i=e[`G`+t],a=Array.isArray(i),o=Rt(n,a);Lt(n,i,a),r(o),we()}};if(T){if(n.multiple){e[`G`+t]=[];for(let r of n.options)r.defaultSelected&&e[`G`+t].push(r.value)}else{e[`G`+t]=``;for(let r of n.options)if(r.defaultSelected){e[`G`+t]=r.value;break}}}Vt(n,Gt,r),Bt(e,t,{childList:!0,subtree:!0},()=>{let i=e[`G`+t];(Array.isArray(i)?i.length!==n.selectedOptions.length||i.some((e,t)=>!i.includes(n.selectedOptions[t].value)):n.value!==i)&&r()})}function Lt(e,t,n){if(n)for(let n of e.options)n.selected=t.includes(n.value);else e.value=t}function Rt(e,t){return t?Array.from(e.selectedOptions,e=>e.value):e.value}function zt(e,t,n){e.H===c&&(e[t].open=ve(n))}function Bt(e,t,n,r){(e[`N`+t]||=new MutationObserver(r)).observe(e[t],n)}function Vt(e,t,n){e._=n,g(`input`,Ht),e.form&&g(`reset`,Ut),T&&t(e)&&queueMicrotask(n)}function Ht(e){e.target._?.(e)}function Ut(e){let t=[];for(let n of e.target.elements)n._&&oee(n)&&t.push(n._);requestAnimationFrame(()=>{if(!e.defaultPrevented)for(let e of t)e()})}function Wt(e){return e.value!==e.defaultValue}function aee(e){return e.checked!==e.defaultChecked}function Gt(e){for(let t of e.options)if(t.selected!==t.defaultSelected)return!0}function oee(e){return e.options?Gt(e):Wt(e)||aee(e)}function Kt(e){return wt(e)||``}function see(e,t){let n=nee(e,`E`);if(n){let e=n._,r=n.P;r&&(n.O&&(n.O.i=0),e[`A`+n.C]=r,Le(n)),l.add(d),qt(e,n.C,n.E,lt),n.E?.d?.(e[`A`+n.C],[t])}else throw t}function cee(e){St(e,`a`)}function qt(e,t,n,r){let i=e[t],a=e[`A`+t],o=i.nodeType>1?(a?.S||i).parentNode:i,s=e[`A`+t]=n&&r(e.$,n,e,o);i===o?(a&&(Le(a),i.textContent=``),s&&Ve(s,o,null)):a?(s?Ve(s,o,a.S):o.insertBefore(i,a.S),Be(a)):s&&(Ve(s,o,i),i.remove())}function lee(e,t,n,r){let i=st(e,t,n,r);return typeof t==`string`?i.a=i.S=i.K=document.createElementNS(t===`svg`?`http://www.w3.org/2000/svg`:t===`math`?`http://www.w3.org/1998/Math/MathML`:r.namespaceURI,t):ut(t,i),i}function uee(e,t){return t}var dee=[],Jt=Symbol();function fee(e){return e[Symbol.iterator]=pee,e[Jt]=dee,e}function*pee(){yield this,yield*this[Jt]}var Yt={working:`_p`,waiting:`_q`,idle:`_r`,off:`_s`},mee=`_u _t`;async function H(e,t){let n=await fetch(e,t),r;try{r=await n.json()}catch{throw Error(n.ok?`invalid response`:`HTTP ${n.status}`)}if(r&&typeof r==`object`&&r.error)throw Error(r.error);if(!n.ok)throw Error(`HTTP ${n.status}`);return r}function Xt(e){let t=e instanceof Error?e.message:String(e);return/HTTP 502|HTTP 503|HTTP 504|Failed to fetch|NetworkError|Load failed|ECONNREFUSED/i.test(t)}var Zt=new Set([`workspaces.changed`,`sessions.changed`,`workspace.progress`,`review.changed`,`status.changed`]),Qt=1e4,$t=4e4,en=8e3,tn=5e3,nn=6e4,rn,an,on=null,sn,cn,ln,un,dn=0;function fn(){return!!on&&on.readyState===WebSocket.OPEN&&!dn}function pn(e){rn?.dispatchEvent(new MessageEvent(`sse.health`,{data:{healthy:e}}))}function mn(e){an&&e!==an&&location.reload(),an=e}async function hn(){try{mn((await H(`/api/boot`)).boot)}catch{}}function gn(){clearTimeout(cn),clearTimeout(ln),ln=setTimeout(_n,$t),dn&&(dn=0,clearInterval(un),un=void 0,pn(!0))}function _n(){vn(),!dn&&(dn=Date.now(),pn(!1),un=setInterval(()=>{document.visibilityState===`visible`&&(Date.now()-dn>nn&&(dn=Date.now(),bn()),yn(),hn(),H(`/api/status`).then(e=>{rn.dispatchEvent(new MessageEvent(`status.changed`,{data:e}))}).catch(()=>{}))},tn))}function vn(){clearTimeout(cn),clearTimeout(ln);let e=on;on=null,e&&(e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null,(e.readyState===WebSocket.OPEN||e.readyState===WebSocket.CONNECTING)&&e.close())}function yn(){for(let e of[`workspaces.changed`,`sessions.changed`])rn.dispatchEvent(new MessageEvent(e,{data:null}))}function bn(){if(on&&(on.readyState===WebSocket.OPEN||on.readyState===WebSocket.CONNECTING))return;let e=location.protocol===`https:`?`wss`:`ws`,t=on=new WebSocket(`${e}://${location.host}/api/events`);clearTimeout(cn),cn=setTimeout(_n,en),t.onmessage=e=>{let t;try{t=JSON.parse(String(e.data))}catch{return}let n=t.type;if(n){if(n===`hello`){gn(),pn(!0),mn(t.data?.boot);return}if(n===`ping`){gn();return}Zt.has(n)&&(gn(),rn.dispatchEvent(new MessageEvent(n,{data:t.data??null})))}},t.onerror=()=>{},t.onclose=()=>{on===t&&(on=null,dn||_n())}}function xn(){return rn||(rn=new EventTarget,bn(),hn(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`?(clearTimeout(sn),bn(),hn(),yn()):(clearTimeout(sn),sn=setTimeout(()=>{dn||vn()},Qt))})),rn}var Sn=null,Cn=null,wn=null,Tn=new EventTarget;function En(e,t){Tn.addEventListener(`intent`,e,{signal:t})}function Dn(e,t){Sn={workspaceId:e,pr:t},Tn.dispatchEvent(new Event(`intent`))}function On(e){if(Sn?.workspaceId!==e)return!1;let t=Sn.pr;return Sn=null,{pr:t}}function kn(e,t){Cn=[e,t],Tn.dispatchEvent(new Event(`intent`))}function An(e){if(Cn?.[0]!==e)return null;let t=Cn[1];return Cn=null,t}function jn(e){wn=e,Tn.dispatchEvent(new Event(`intent`))}function Mn(e){return wn===e&&(wn=null,!0)}function Nn(e){let t=!1,n=!1;return async()=>{if(t){n=!0;return}t=!0;try{do n=!1,await e();while(n)}finally{t=!1}}}var Pn=new Map,Fn=new Set,hee;function gee(e){for(let[t,n]of Object.entries(e))Fn.has(t)||Pn.set(t,n);typeof window<`u`&&(hee??=Promise.resolve())}function In(e){return Pn.get(e)??null}function Ln(e,t){Fn.add(e),t===null?Pn.delete(e):Pn.set(e,t),_ee(e,t)}function _ee(e,t){return fetch(`/api/prefs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({key:e,value:t})}).catch(()=>{})}function Rn(e){Ln(`last-workspace`,e)}function zn(){return In(`side-nav`)!==`0`}function vee(e){Ln(`side-nav`,e?`1`:`0`)}function Bn(e){return In(`tab:${e}`)}function Vn(e,t){Ln(`tab:${e}`,t)}function yee(){return In(`diff-tree`)!==`0`}function bee(e){Ln(`diff-tree`,e?`1`:`0`)}function xee(){return In(`diff-uncommitted`)===`1`}function Hn(e){Ln(`diff-uncommitted`,e?`1`:`0`)}function Un(){return typeof window<`u`&&`serviceWorker`in navigator&&`PushManager`in window}async function Wn(){return Un()?(await Jn()).pushManager.getSubscription():null}async function Gn(){if(await Notification.requestPermission()!==`granted`)return!1;let e=await Jn(),t=await e.pushManager.getSubscription();if(!t){let{publicKey:n}=await H(`/api/push`);t=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Yn(n)})}return await H(`/api/push`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t.toJSON())}),!0}async function Kn(){let e=await Wn();e&&(await H(`/api/push?endpoint=${encodeURIComponent(e.endpoint)}`,{method:`DELETE`}).catch(()=>{}),await e.unsubscribe())}function qn(e){let t=()=>{document.visibilityState===`visible`&&navigator.clearAppBadge?.().catch(()=>{})};t(),document.addEventListener(`visibilitychange`,t,{signal:e})}async function Jn(){return await navigator.serviceWorker.getRegistration()??navigator.serviceWorker.register(`/sw.js`)}function Yn(e){let t=e.padEnd(e.length+(4-e.length%4)%4,`=`),n=atob(t.replace(/-/g,`+`).replace(/_/g,`/`));return Uint8Array.from(n,e=>e.charCodeAt(0))}function Xn(){return typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches}function Zn(){return typeof window<`u`&&window.matchMedia(`(max-width: 899px)`).matches}function Qn(){return typeof navigator<`u`&&navigator.standalone===!0}function $n(e){if(!Qn()||!/^https?:\/\//.test(e)){window.open(e,`_blank`,`noopener`);return}if(localStorage.getItem(`xSafariOk`)){location.href=`x-safari-${e}`;return}if(localStorage.getItem(`xSafariNo`)){window.open(e,`_blank`,`noopener`);return}let t=!1,n=()=>{document.visibilityState===`hidden`&&(t=!0,localStorage.setItem(`xSafariOk`,`1`))};document.addEventListener(`visibilitychange`,n),window.addEventListener(`pagehide`,n),setTimeout(()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`pagehide`,n),!(t||document.visibilityState===`hidden`)&&(localStorage.setItem(`xSafariNo`,`1`),window.open(e,`_blank`,`noopener`))},1500),location.href=`x-safari-${e}`}var er=`_K _y`,tr=`<div><div><!><!></div><!></div>`,nr=` D D%b%l%l`,rr=L(`w0`,e=>A(e.a,`click`,function(){e._._.o?.()})),ir=e=>{B(e.a,er),rr(e)},ar=fe(0),or=I(26,e=>ar(e,e._._.n),e=>e._._),sr=O(1,`<!><!><!>`,`b%`,or),cr=P(4,0,e=>sr(e,+!e._.m)),lr=e=>{cr._(e),dr._(e),B(e.a,`_J`)},ur=O(2,`<button type=button title=Dismiss aria-label=Dismiss>×</button>`,` `,ir),dr=P(4,0,e=>ur(e,+!e._.o)),fr=fe(1),pr=P(3,0,e=>fr(e,e._.l)),mr=e=>{pr._(e),B(e.a,`_I`)},hr=P(2,0,e=>V(e.b,e._.j)),gr=e=>{hr._(e),B(e.a,`_E`)},_r=N(22,e=>B(e.a,[`_A`,e.u,e.v,e.k]),2),vr=M(20,_r),yr=(e,t)=>{z(e.a,`role`,t===`error`?`alert`:`status`),vr(e,{error:`_D`,warn:`_F`,info:`_G`}[t])},br=(e,t)=>yr(e,t||`error`),xr=M(21,_r),Sr=N(19,L(`w1`,e=>Tt(e,{onDismiss:e.o,placement:e.s,onMount:function(){let e=new AbortController;return this.placement===`float`&&this.onDismiss&&window.addEventListener(`keydown`,e=>{e.key===`Escape`&&(document.querySelector(`dialog[open]`)||document.querySelector(`[data-palette]:not([data-inline])`)||e.target instanceof HTMLInputElement&&e.target.value||(e.stopPropagation(),this.onDismiss?.()))},{capture:!0,signal:e.signal}),{abort:e}},onDestroy:function(){this.abort.abort()}}))),Cr=M(18,e=>{xr(e,{float:`_B`,inline:`_C`}[e.s]),Sr(e)}),wr=(e,t)=>Cr(e,t||`float`),Tr=M(10,_r),Er=L(`w2`,e=>St(e,`a`)),Dr=M(16,e=>{yt(e,`a`,e.q,{class:1,role:1}),Er(e)});function Or(e){B(e.b,`_H`)}var kr=O(2,`<strong> </strong>`,` D `,gr),Ar=M(9,e=>{kr(e,+!e.j),hr(e)}),jr=O(3,`<div><!></div>`,` D%`,mr),Mr=M(11,e=>{jr(e,+!e.l),pr(e)}),Nr=O(4,`<div><!><!></div>`,` D%b%`,lr),Pr=N(15,e=>Nr(e,e.m||e.o?0:1)),Fr=M(12,e=>{Lr(e,e.m?.content),Pr(e),cr(e)}),Ir=M(14,e=>{Pr(e),Sr(e),dr(e)}),Lr=M(13,F(or));function Rr(e,t){if(!e)return-1;let n=e.toLowerCase(),r=t.toLowerCase(),i=r.lastIndexOf(`/`),a=r.slice(i+1),o=r.slice(0,Math.max(0,i)).includes(n)?5:0;return a===n?1e3+o:a.startsWith(n)?800+o:a.includes(n)?600+o:Br(n,a)?400+o:r.includes(n)?300:Br(n,r)?100:-1}function zr(e,t,n){return e?t.map(t=>({repo:t,score:Rr(e,t.nameWithOwner)})).filter(({repo:e,score:t})=>!e.isArchived&&t>=0&&!n(e.nameWithOwner)).sort((e,t)=>t.score-e.score||e.repo.nameWithOwner.length-t.repo.nameWithOwner.length||e.repo.nameWithOwner.localeCompare(t.repo.nameWithOwner)).slice(0,8).map(({repo:e})=>e):[]}function Br(e,t){if(!e)return!0;let n=0,r=t.toLowerCase();for(let t of e.toLowerCase()){if(n=r.indexOf(t,n),n===-1)return!1;n++}return!0}function Vr(e){return e?.working?`working`:e?.waiting?`waiting`:e?.agents?`idle`:`off`}function Hr(e){return e?.phase===`working`?`working`:e?.phase===`waiting`?`waiting`:e?.alive?`idle`:`off`}var Ur=`<svg viewBox="0 0 24 24" fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path></path></svg>`,Wr=` D l`,Gr=(e,t)=>{z(e.a,`width`,t),z(e.a,`height`,t)},Kr=(e,t)=>Gr(e,t??15),qr=(e,t)=>B(e.a,[`_c`,t]),Jr=(e,t)=>z(e.b,`d`,t),Yr=Ur,Xr=(e=>`/${e}&`)(Wr);function Zr(e){Jr(e.a,`M18 21C19.1046 21 20 20.1046 20 19C20 17.8954 19.1046 17 18 17C16.8954 17 16 17.8954 16 19C16 20.1046 16.8954 21 18 21Z M6 7C7.10457 7 8 6.10457 8 5C8 3.89543 7.10457 3 6 3C4.89543 3 4 3.89543 4 5C4 6.10457 4.89543 7 6 7Z M18 17V7C18 7 18 5 16 5H13 M6 7V17C6 17 6 19 8 19H11 M15.0005 7.50012L12.5005 5.00012L15.0005 2.50012 M8.5 16.5L11 19L8.5 21.5`)}var Qr=(e,t)=>Kr(e.a,t),$r=(e,t)=>qr(e.a,t),ei=Ur,ti=(e=>`/${e}&`)(Wr);function ni(e){Jr(e.a,`M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z M19.6224 10.3954L18.5247 7.7448L20 6L18 4L16.2647 5.48295L13.5578 4.36974L12.9353 2H10.981L10.3491 4.40113L7.70441 5.51596L6 4L4 6L5.45337 7.78885L4.3725 10.4463L2 11V13L4.40111 13.6555L5.51575 16.2997L4 18L6 20L7.79116 18.5403L10.397 19.6123L11 22H13L13.6045 19.6132L16.2551 18.5155C16.6969 18.8313 18 20 18 20L20 18L18.5159 16.2494L19.6139 13.598L21.9999 12.9772L22 11L19.6224 10.3954Z`)}var ri=(e,t)=>Kr(e.a,t),ii=(e,t)=>qr(e.a,t),ai=Ur,oi=(e=>`/${e}&`)(Wr);function si(e){Jr(e.a,`M6 12H12M18 12H12M12 12V6M12 12V18`)}var ci=(e,t)=>Kr(e.a,t),li=(e,t)=>qr(e.a,t),ui=`<!><!><!>`,See={claude:`M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z`,codex:`M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z`,grok:`M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815`,copilot:`M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z`,cursor:`M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z`},di=P(0,1,e=>Kr(e.a,e._.d)),Cee=e=>{di._(e),fi._(e),Jr(e.a,`M5 7L10 12L5 17 M13 17H20`)},fi=P(0,1,e=>qr(e.a,e._.f)),pi=P(0,0,e=>B(e.a,[`_c`,e._.f])),wee=e=>{pi._(e),mi._(e),hi._(e)},mi=P(0,0,e=>{z(e.a,`width`,e._.g),z(e.a,`height`,e._.g)}),hi=P(0,0,e=>z(e.b,`d`,e._.h)),Tee=M(6,mi),gi=M(3,e=>{Tee(e,e.d??15),di(e)}),Eee=O(0,`<svg viewBox="0 0 24 24" fill=currentColor fill-rule=evenodd aria-hidden=true><path></path></svg>`,` D `,wee,Ur,(e=>`/${e}&`)(Wr),Cee),Dee=M(7,e=>{Eee(e,+!e.h),hi(e)}),_i=(e,t)=>Dee(e,See[t]),vi=M(5,e=>{pi(e),fi(e)}),Oee=`<!><!><div data-palette role=dialog aria-label=Workspaces><!><input autofocus placeholder="Jump to workspace…" aria-label="Filter workspaces"><ul></ul><!><div><span></span><span>↑↓ navigate · ↵ open · ⌘1–9 switch · esc close</span><!></div></div>`,kee=`b%b D%b b b%b Db b%m`,Aee=(e,t)=>{z(e.a,`value`,t),V(e.b,t)},jee=(e,t)=>Aee(e,t[0]),Mee=e=>B(e.a,`_m`),Nee=(e,t)=>V(e.b,t),Pee=(e,t)=>Nee(e,t[0]?.worktree),Fee=e=>B(e.a,`_h`),Iee=e=>B(e.a,[`_h`,`_be`]),yi=P(8,0,e=>{z(e.a,`title`,`${e._.u} open PR${e._.u===1?``:`s`}`),V(e.b,e._.u),V(e.c,e._.u===1?``:`s`)}),Lee=e=>{yi._(e),B(e.a,[`_h`,`_bf`])},bi=P(9,0,e=>z(e.a,`title`,e._.r.map(e=>`:${e.port} ${e.cmd}`).join(`
3
+ `))),xi=e=>{bi._(e),Si._(e),B(e.a,[`_h`,`_bf`])},Si=P(9,0,e=>V(e.b,e._.s)),Ci=N(2,e=>z(e.a,`title`,`${e._.o} running session${e._.o===1?``:`s`}${e._.p?` — ${e._.p} working`:``}${e._.q?` — ${e._.q} waiting on you`:``}`),2),wi=P(7,0,e=>{V(e.b,e._.o),Ci(e)}),Ti=e=>{wi._(e),Ei._(e),Di._(e),B(e.a,[`_h`,`_bf`])},Ei=P(7,0,Ci),Di=P(7,0,Ci),Oi=e=>B(e.a,`_bb`),ki=P(1,1,e=>V(e.b,e._.h)),Ai=e=>{ki._(e),B(e.a,[`_bb`,`__`])},ji=e=>B(e.a,`_ba`),Mi=N(2,e=>V(e.b,e._.af?`hide archived`:`archived (${e._.ai})`)),Ni=P(5,0,Mi),Pi=L(`o8`,e=>A(e.a,`click`,function(){po(e._,!e._.af)})),Fi=e=>{Ni._(e),Ii._(e),B(e.a,`_bj`),Pi(e)},Ii=P(5,0,Mi),Li=P(8,0,e=>Ft(e,`b`,e._.aa?.preferredAgent,Bo(e))),Ri=L(`o9`,e=>It(e,`b`)),zi=e=>{Li._(e),Vi._(e),B(e.a,`_l`),Ri(e)},Bi=k(1,`<option> </option>`,` D `,0,jee),Vi=P(8,0,e=>Bi(e,[e._.ad,e=>e])),Hi=L(`o4`,e=>A(e.a,`click`,function(){za(e._,!1)})),Ui=e=>{B(e.a,`_1`),Hi(e)},Wi=L(`o5`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._.z(e._._.i,e.e)})),Gi=e=>{e.b,gi(e.b,14),vi(e.b),Wi(e)},Ki=M(4,e=>{_i(e.b,e.e),V(e.c,e.e)}),qi=k(6,(e=>`<button>${e}<!></button>`)(ui),(e=>` D/${e}&%l`)(`b%c`),Gi,(e,t)=>Ki(e,t[0])),Ji=I(59,e=>qi(e,[[...e._._.a7||[],`shell`],e=>e]),e=>e._._),Yi=(e,t)=>{z(e.e,`popovertarget`,t),z(e.g,`id`,t)},Xi=L(`o6`,e=>{A(e.a,`click`,function(t){t.stopPropagation(),e._._.x(e._.i)}),A(e.c,`click`,function(t){t.stopPropagation(),e._._.y(e._.i)}),A(e.e,`click`,function(e){e.stopPropagation()}),A(e.g,`toggle`,function(t,n){if(t.newState===`open`){let t=e.e.getBoundingClientRect();n.style.top=`${t.bottom+4}px`,n.style.left=`${Math.max(8,t.right-n.offsetWidth)}px`}})}),Zi=e=>{Ji(e),B(e.a,`_9`),Zr(e.b),Qr(e.b,13),$r(e.b),B(e.c,`_9`),ni(e.d),ri(e.d,13),ii(e.d),B(e.e,`_9`),si(e.f),ci(e.f,13),li(e.f),B(e.g,`_bk`),Yi(e,$e(e)),Xi(e)},Qi=O(4,`<span>open</span>`,` `,Iee),$i=N(21,e=>Qi(e,e._.j===e._._.v?0:1)),ea=I(57,$i,e=>e._._),ta=e=>{ea(e),ia(e),oa._(e),sa._(e),ca._(e),da._(e),B(e.a,`_bb`),B(e.c,`_bc`),B(e.g,`_bd`),B(e.k,`_bg`)},na=(e,t)=>{B(e.b,[`_o`,Yt[Vr(t)]]),pa(e,t?.repos),ha(e,t?.agents),ga(e,t?.working),_a(e,t?.waiting),ya(e,t?.ports)},ra=N(22,e=>na(e,e._._.a6[e._.j])),ia=I(58,ra,e=>e._._),aa=O(5,`<span>archived</span>`,` `,Fee),oa=P(1,2,e=>aa(e,+!e._.g)),sa=P(1,2,e=>{ra(e),$i(e)}),ca=P(1,2,e=>V(e.d,e._.k)),la=k(10,`<span> </span>`,` D `,Mee,Pee),ua=N(13,e=>la(e,[e.m||e._.l,`full_name`])),da=P(1,2,ua),fa=(e,t)=>Sa(e,t?.length),pa=M(12,e=>{fa(e,(e.m||[]).flatMap(e=>e.prs||[])),ua(e)}),ma=O(7,`<span> </span>`,` D `,Ti),ha=M(14,e=>{ma(e,+!e.o),wi(e)}),ga=M(15,Ei),_a=M(16,Di),va=O(9,`<span>:<!></span>`,` Db%`,xi),ya=M(17,e=>{ba(e,e.r?.length),va(e,+!(e.r||[]).length),bi(e)}),ba=M(18,Si),xa=O(8,`<span><!> PR<!></span>`,` D%c%`,Lee),Sa=M(20,e=>{xa(e,+!e.u),yi(e)}),Ca=N(13,e=>B(e.b,[`_8`,{_7:e.m===e._.as,_6:e.f===`ws`&&e.g}]),3),wa=qe(4,Ca),Ta=L(`o7`,e=>{A(e.b,`click`,function(){e._.au(e.e)}),A(e.b,`mouseenter`,function(){fo(e._,e.m)})}),Ea=e=>{wa._(e),B(e.a,`_5`),Ta(e)},Da=O(1,`<span>+ New workspace</span>`,` `,Oi,`<span>▸ <!></span>`,` Db%`,Ai,`<span><span></span><span> </span><!><!><span><!><!><!></span></span><span></span>`,` D b D l%b%b D%b%b%m `,ta),Oa=O(2,((e,t,n)=>`<button title="Review changes">${e}</button><button title="Manage workspace">${t}</button><button title="New session">${n}</button><div popover=auto></div>`)(Yr,ei,ai),((e,t,n)=>` D/${e}&l D/${t}&l D/${n}&l b`)(Xr,ti,oi),Zi),ka=M(5,e=>{Da(e,e.f===`new`?0:e.f===`cmd`?1:2),Oa(e,e.f===`ws`?0:1),Ca(e)}),Aa=M(6,e=>{Ca(e),oa(e)}),ja=M(12,Ca),Ma=(e,t)=>{Na(e,t[0]),ja(e,t[1])},Na=M(4,e=>{ka(e,e.e?.kind),Aa(e,e.e?.archived),Pa(e,e.e?.label),Fa(e,e.e?.ws)}),Pa=M(7,ki),Fa=M(8,e=>{Ia(e,e.i?.id),La(e,e.i?.name),Ra(e,e.i?.repos)}),Ia=M(9,sa),La=M(10,ca),Ra=M(11,da),za=Ke(19),Ba=N(13,e=>za(e,e.l,e.m)),Va=M(11,Ba),Ha=M(12,Ba),Ua=k(4,`<li><div><button></button><!></div></li>`,`D D b%`,Ea,Ma),Wa=N(55,L(`o12`,e=>{{let t=e.ap.findIndex(t=>t.kind===`ws`&&t.ws.id===e.v);t>=0&&fo(e,t)}setTimeout(()=>e.d?.focus(),0),e.e.children[e.as]?.scrollIntoView({block:`nearest`})}),2),Ga=M(51,e=>{Do(e,e.ap.length),Ua(e,[e.ap,e=>e.kind===`new`?`new`:e.kind===`cmd`?`cmd:${e.label}`:e.ws.id]),Wa(e)}),Ka=N(50,e=>Ga(e,[...e.ak(e.ag).map(e=>({kind:`ws`,ws:e})),...e.af||e.a8?e.ak(e.ah).map(e=>({kind:`ws`,ws:e,archived:!0})):[],...e.an,{kind:`new`}]),5),qa=M(46,Ka),Ja=M(49,Ka),Ya=N(48,e=>Ja(e,!e.a8||!e.al?[]:[{kind:`cmd`,label:`Review changes — ${e.al?.name}`,run:()=>e.x(e.al)},{kind:`cmd`,label:`Manage workspace — ${e.al?.name}`,run:()=>e.y(e.al)},{kind:`cmd`,label:`New ${e.ac||`agent`} session — ${e.al?.name}`,run:()=>e.z(e.al,e.ac||`claude`)}].filter(t=>t.kind===`cmd`&&Br(e.a8||``,t.label))),5),Xa=O(5,`<button> </button>`,` D `,Fi),Za=N(45,e=>Xa(e,e.ai&&!e.a8?0:1)),Qa=Ke(34,e=>{jt(e,`d`,e.a8||``,Ho(e)),qa(e,Vo(e)),Ya(e),Ka(e),Za(e)}),$a=N(16,e=>Qa(e,e.o,e.p)),eo=M(14,$a),to=M(15,$a),no=O(8,`<label><select aria-label="Preferred agent"></select></label>`,` D `,zi),ro=Ke(36,e=>{io(e,e.aa?.preferredAgent),ao(e,e.aa?.agents),no(e,+!e.aa),Li(e)}),io=M(38,Ya),ao=M(39,Vi),oo=N(19,e=>ro(e,e.r,e.s)),so=M(17,e=>{Ro(e,e.r?.agents),oo(e)}),co=M(18,oo),lo=M(54,e=>{Wa(e),wa(e)}),uo=N(53,e=>lo(e,Math.min(e.ae,e.aq-1))),fo=j(40,uo),po=j(41,e=>{Ka(e),Ni(e)}),mo=L(`o10`,e=>{Mt(e,`d`),A(e.d,`keydown`,function(t){t.key===`ArrowDown`?(t.preventDefault(),fo(e,Math.min(e.as+1,e.ap.length-1))):t.key===`ArrowUp`?(t.preventDefault(),fo(e,Math.max(e.as-1,0))):t.key===`Enter`&&(t.preventDefault(),e.au(e.ap[e.as]))})});function ho(e){B(e.e,`_4`),B(e.g,`_bh`),B(e.h,`_bi`),fo(e,0),po(e,!1),mo(e)}var go=M(42,Ka),_o=M(43,e=>{xo(e,e.ah?.length),Ka(e)}),vo=M(47,Ya),yo=N(22,e=>vo(e,e.u.find(t=>t.id===e.v))),bo=M(20,e=>{Lo(e,e.u?.length),go(e,e.u.filter(e=>e.status===`active`)),_o(e,e.u.filter(e=>e.status===`archived`)),yo(e)}),xo=M(44,e=>{Za(e),Ii(e)}),So=F(ea),Co=M(21,e=>{yo(e),Wa(e),So(e)}),wo=M(23,Ya),To=M(24,Ya),Eo=M(25,Ya),Do=M(52,uo),Oo=M(56),ko=N(28,e=>Oo(e,Uo(e))),Ao=M(26,ko),jo=M(27,ko),Mo=O(0,`<div></div>`,` `,Ui),No=O(2,`<div><p>A <strong>workspace</strong> checks out one or more repos as git worktrees on a shared branch and gives each agent session its own terminal. Create one to get started.</p><p>Pick your preferred agent below — new sessions and the quick-create button use it. GitHub access uses your <code>gh</code> login.</p></div>`,` `,ji),Po=N(31,e=>No(e,e.a3&&!e.a4?0:1)),Fo=L(`o11`,e=>A(e.b,`keydown`,!e.a3&&(t=>{t.key===`Escape`&&(document.querySelector(`:popover-open`)||document.querySelector(`dialog[open]`)||(t.preventDefault(),za(e,!1)))}))),Io=M(29,e=>{B(e.b,[`_3`,{_2:e.a3}]),z(e.b,`data-inline`,e.a3?``:void 0),Mo(e,+!!e.a3),Po(e),Fo(e)}),Lo=M(30,Po),Ro=M(33,F(Ji)),zo=M(32,F(ia));function Bo(e){return function(t){ro(e._,{...e._.aa,preferredAgent:t}),H(`/api/settings`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({preferredAgent:t})}).catch(()=>{})}}function Vo(e){return t=>t.filter(t=>Br(e.a8||``,t.name))}function Ho(e){return function(t){Qa(e,t),fo(e,0)}}function Uo(e){return t=>{t&&(t.kind===`new`?e.a0():t.kind===`cmd`?t.run():e.a1(t.ws))}}R(`o1`,Bo),R(`o2`,Vo),R(`o0`,Ho),R(`o3`,Uo);var Wo=`_bl _V`,Go=`_bo _y`,Ko=`_bp _z`,qo=Ur,Jo=(e=>`/${e}&`)(Wr);function Yo(e){Jr(e.a,`M21.8883 13.5C21.1645 18.3113 17.013 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C16.1006 2 19.6248 4.46819 21.1679 8 M17 8H21.4C21.7314 8 22 7.73137 22 7.4V3`)}var Xo=(e,t)=>Kr(e.a,t),Zo=(e,t)=>qr(e.a,t),Qo=`<div><input placeholder="Add a repo…" aria-label="Add a repo"><!><!></div>`,$o=` D b%b%l`,es=null,ts=e=>B(e.a,`_bX`),ns=e=>{B(e.a,`_bX`),B(e.b,`_w`)},rs=e=>B(e.a,`_bX`),is=L(`q7`,e=>A(e.a,`click`,function(){e._._._._._.a1(e._._._.j,e.e)})),as=e=>{B(e.a,`_bQ`),B(e.b,[`_bW`,`_m`]),is(e)},os=M(4,e=>V(e.c,e.e)),ss=(e,t)=>os(e,t[0]),cs=I(35,e=>jt(e,`a`,e._._._._._.a0,Qs(e)),e=>e._._._._._),ls=L(`q6`,e=>Mt(e,`a`)),us=e=>{cs(e),ls(e)},ds=k(2,`<li><button><span> </span></button></li>`,`D D D `,as,ss),fs=(e,t)=>{bs(e,t?.length),ds(e,[t,e=>e])},ps=N(6,e=>fs(e,(e._._._._.a0?e._._._._.y.filter(t=>t.toLowerCase().includes(e._._._._.a0.toLowerCase())):e._._._._.y).slice(0,12))),ms=I(33,ps,e=>e._._._._),hs=e=>{ms(e),_s(e),vs(e),B(e.b,`_bU`)},gs=O(0,`<input placeholder="Filter branches…" aria-label="Filter branches" autofocus>`,` `,us),_s=I(34,e=>gs(e,e._._._._.z>8?0:1),e=>e._._._._),vs=I(35,ps,e=>e._._._._),ys=O(3,`<li><p>No branches match.</p></li>`,`D `,ts),bs=(e,t)=>ys(e,+!!t),xs=O(0,`<p><span></span> Loading branches…</p>`,` D `,ns,`<!><!><ul><!><!></ul>`,`b%b D%b%`,hs),Ss=I(33,e=>xs(e,+!!e._._._.y),e=>e._._._),Cs=e=>{Ss(e),B(e.a,`_bT`)},ws=N(12,e=>B(e.a,[`_bP`,{_bO:e.l===e._._.r}])),Ts=I(30,ws,e=>e._._),Es=L(`q8`,e=>{A(e.a,`mouseenter`,function(){Hs(e._._,e.l)}),A(e.b,`click`,function(){e._._.a1(e.j)}),A(e.f,`click`,function(){e._._.a2(e.j)})}),Ds=e=>{Ts(e),As(e),B(e.b,`_bQ`),si(e.c),ci(e.c,12),li(e.c,`_bV`),B(e.d,`_bW`),Es(e)},Os=O(6,`<div></div>`,` `,Cs),ks=N(10,e=>{B(e.f,[`_bS`,{_bR:e._._.w===e.j}]),Os(e,e._._.w===e.j?0:1)}),As=I(32,ks,e=>e._._),Ree=M(11,ws),zee=M(9,e=>{V(e.e,e.j),z(e.f,`title`,`Pick a base branch for ${e.j}`),z(e.f,`aria-label`,`Pick a base branch for ${e.j}`),ks(e)}),Bee=k(0,(e=>`<li><div><button>${e}<span> </span></button><button>⎇</button></div><!></li>`)(ai),(e=>`D D D/${e}& D m l%l`)(oi),Ds,(e,t)=>{zee(e,t[0]?.nameWithOwner),Ree(e,t[1])}),js=P(3,0,e=>Bee(e,[e._.t,`nameWithOwner`])),Vee=e=>{js._(e),B(e.a,`_bN`)},Ms=P(3,1,e=>V(e.b,e._.o)),Hee=e=>{Ms._(e),B(e.a,`_bX`)},Ns=Ke(8),Ps=N(8,e=>Ns(e,e.g,e.h)),Fs=M(6,Ps),Is=M(7,Ps),Uee=M(19,e=>{Qee(e,e.t?.length),js(e)}),Ls=N(16,e=>Uee(e,e.n&&e.o?zr(e.o,e.n?.repos,t=>e.k.has(t)):[]),2),Wee=O(2,`<p>Loading repos…</p>`,` `,rs),Rs=N(15,e=>Wee(e,e.o&&!e.n?0:1)),Gee=O(3,`<ul></ul>`,` `,Vee,`<p>No repos match "<!>".</p>`,` Db%`,Hee),zs=N(21,e=>Gee(e,e.u?0:e.o&&e.n?1:2),2),Bs=j(13,e=>{Ls(e),Rs(e),zs(e)}),Vs=j(14,e=>{jt(e,`b`,e.o,$s(e)),Ls(e),Rs(e),zs(e),Ms(e)}),Hs=j(17,F(Ts)),Kee=M(28),Us=N(23,e=>Kee(e,ec(e))),qee=F(As),Ws=j(22,e=>{Us(e),qee(e)}),Jee=F(Ss,ms),Gs=j(24,e=>{$ee(e,e.y?.length),Jee(e)}),Ks=j(26,F(vs,cs)),Yee=L(`q9`,e=>{Mt(e,`b`),A(e.b,`keydown`,function(t){t.key===`ArrowDown`?(t.preventDefault(),Hs(e,Math.min(e.r+1,e.t?.length-1))):t.key===`ArrowUp`?(t.preventDefault(),Hs(e,Math.max(e.r-1,0))):t.key===`Enter`?(t.preventDefault(),e.t[e.r]&&e.a1(e.t[e.r].nameWithOwner)):t.key===`Escape`&&e.o&&(t.preventDefault(),Vs(e,``))})});function qs(e){B(e.a,`_bM`),Bs(e,null),Vs(e,``),Hs(e,0),Ws(e,null),Gs(e,null),Ks(e,``),Yee(e)}var Xee=L(`q10`,e=>Tt(e,{onMount:function(){es&&Bs(e,es),e.s(!1)}})),Zee=M(18,e=>{ee(e,tc(e)),Xee(e)}),Js=M(9,e=>{Zee(e,nc(e)),Us(e)}),Qee=M(20,zs),Ys=M(10,Ls),$ee=M(25,F(_s)),ete=M(27),Xs=M(11,e=>ete(e,rc(e))),Zs=(e,t)=>z(e.b,`disabled`,t);function Qs(e){return t=>{Ks(e._._._._._,t)}}function $s(e){return function(t){Vs(e,t),Hs(e,0)}}function ec(e){return async t=>{if(e.w===t){Ws(e,null);return}Ws(e,t),Gs(e,null),Ks(e,``);try{let n=await H(`/api/repos/branches?repo=${encodeURIComponent(t)}`);e.w===t&&Gs(e,n.branches)}catch(t){Ws(e,null),e.j?.(String(t.message||t))}}}function tc(e){return()=>e.s(!0)}function nc(e){return async t=>{t&&Ns(e,!0);try{let n=await H(`/api/repos${t?`?refresh`:``}`);es=n,Bs(e,n)}catch(t){e.j?.(String(t.message||t))}t&&Ns(e,!1)}}function rc(e){return(t,n)=>{Vs(e,``),Ws(e,null),e.l(t,n)}}R(`q1`,Qs),R(`q0`,$s),R(`q5`,ec),R(`q2`,tc),R(`q3`,nc),R(`q4`,rc);var ic=((e,t)=>`<div role=region><div><div><header><div><h1>New workspace</h1><p>Name the space and pick repos — or restore an archived one below.</p></div></header><!><label><span>Name</span><input placeholder=my-feature autofocus></label><section><div><h2>Repos</h2><button title="Refresh repo list" aria-label="Refresh repo list">${e}</button></div><ul><!><!></ul>${t}</section><!><div><button type=button>Cancel</button><button type=button> </button></div><!></div></div></div>`)(qo,Qo),ac=((e,t)=>` D D D D D b m%b Db l D Db D/${e}&m D%b%l0${t}&l%b D b D m%n`)(Jo,$o),tte=e=>B(e.a,`_w`),nte=e=>B(e.a,`_bB`),rte=e=>B(e.a,`_w`),ite=e=>B(e.a,`_by`),oc=P(3,0,e=>V(e.b,e._.i)),ate=e=>{oc._(e),B(e.a,[`_bw`,`_m`])},ote=O(1,`<span></span>`,` `,rte,`<span>✓</span>`,` `,nte),sc=I(63,e=>{B(e.a,{_bA:e.M===e._._.ag-1}),ote(e,e.M===e._._.ag-1?0:1)},e=>e._._),ste=sc,cte=(e,t)=>V(e.c,t),lte=k(0,`<li><!><!></li>`,` D%b%`,ste,(e,t)=>cte(e,t[0])),cc=P(19,0,e=>lte(e,[e._.af])),ute=e=>{cc._(e),B(e.a,`_bz`)},lc=I(61,e=>V(e.a,e._._.ae),e=>e._._),dte=ft(`m10`,` `,` `,lc),fte=e=>{Or(e.a),Mr(e.a,dte(e)),wr(e.a,`inline`),Ir(e.a,xl(e)),Fr(e.a),Tr(e.a),br(e.a),Ar(e.a),Dr(e.a,{})},uc=N(15,e=>z(e.g,`disabled`,e._._.a9||!!e._._.aa)),dc=I(59,uc,e=>e._._),pte=L(`m13`,e=>A(e.g,`click`,function(){e._._.at(e.i)})),mte=e=>{dc(e),pc(e),B(e.a,`_bG`),B(e.b,`_bH`),B(e.c,`_bI`),B(e.e,[`_bJ`,`_m`]),B(e.g,[`_d`,`_bK`]),pte(e)},hte=O(6,`<span></span> Restoring…`,` `,tte,`Restore`),fc=N(14,e=>hte(e,e._._.aa===e.n?0:1)),pc=I(60,e=>{uc(e),fc(e)},e=>e._._),gte=(e,t)=>V(e.d,t),mc=N(12,e=>{z(e.e,`title`,e.k||e.l),V(e.f,e.k||e.l)}),hc=M(10,mc),gc=M(11,mc),_c=M(13,fc),vc=(e,t)=>yc(e,t[0]),yc=M(8,e=>{gte(e,e.i?.name),hc(e,e.i?.display_path),gc(e,e.i?.path),_c(e,e.i?.id)}),bc=k(5,`<li><div><span> </span><span> </span></div><button type=button></button></li>`,` D D D l D m `,mte,vc),xc=P(24,0,e=>bc(e,[e._.ai,`id`])),Sc=e=>{xc._(e),Cc._(e),B(e.a,`_bC`),B(e.b,`_bs`),B(e.c,`_bD`),B(e.e,`_bE`),B(e.f,`_bF`)},Cc=P(24,0,e=>V(e.d,e._.aj)),wc=qe(15,e=>z(e.e,`disabled`,e._.a9)),Tc=L(`m11`,e=>A(e.e,`click`,function(){e._.as(e.h)})),Ec=e=>{wc._(e),B(e.a,`_bu`),B(e.b,`_bv`),B(e.e,`_bx`),Tc(e)},Dc=M(7,e=>{V(e.c,e.h),z(e.e,`title`,`Remove ${e.h}`)}),Oc=O(3,`<span title="Base branch">⎇ <!></span>`,` Db%`,ate),kc=M(8,e=>{Oc(e,+!e.i),oc(e)}),Ac=(e,t)=>{Dc(e,t[0]?.fullName),kc(e,t[0]?.baseBranch)},jc=tt(58),Mc=M(56),Nc=N(52,e=>Mc(e,Sl(e)),6),Pc=N(39,e=>z(e.w,`disabled`,e.a9||!!e.aa||!e.a5.trim()),2),Fc=j(31,e=>{jt(e,`j`,e.a5,Cl(e)),Nc(e),Pc(e)}),Ic=j(32,e=>{B(e.m,[Go,{[Ko]:e.a6}]),z(e.m,`disabled`,e.a6)}),Lc=M(53,e=>Xs(e.r,wl(e))),Rc=M(54),zc=k(15,`<li><span> </span><!><button>×</button></li>`,` D D l%b `,Ec,Ac),Bc=j(33,e=>{Ys(e.r,new Set(e.a7.map(e=>e.fullName))),cl(e,e.a7?.length),Lc(e,Tl(e)),Rc(e,El(e)),zc(e,[e.a7,`fullName`]),Nc(e)}),Vc=N(51,L(`m15`,e=>Tt(e,{busy:e.a9,onMount:function(){let t=new AbortController;return xn().addEventListener(`workspace.progress`,t=>{this.busy&&t.data?.message&&e.ao([t.data])},{signal:t.signal}),{abort:t}},onDestroy:function(){this.abort.abort()}}))),Hc=M(55),Uc=N(38,e=>Hc(e,Dl(e)),2),Wc=O(19,`<ul></ul>`,` `,ute),Gc=N(43,e=>Wc(e,e.a9&&e.ag?0:1)),Kc=N(37,e=>z(e.v,`disabled`,e.a9||!!e.aa)),qc=F(dc),Jc=j(35,e=>{z(e.j,`disabled`,e.a9),Zs(e.r,e.a9),V(e.x,e.a9?`Creating…`:`Create workspace`),Vc(e),Uc(e),Gc(e),Kc(e),Pc(e),wc(e),qc(e)}),Yc=F(pc),Xc=j(36,e=>{Uc(e),Nc(e),Kc(e),Pc(e),Yc(e)}),Zc=O(7,tr,(e=>`/${e}&`)(nr),fte),Qc=F(lc),$c=j(40,e=>{Zc(e,+!e.ae),Qc(e)}),el=M(50,e=>{Vc(e),Nc(e)}),tl=N(49,e=>el(e,Ol(e)),2),nl=j(41,e=>{ul(e,e.af?.length),tl(e),cc(e)}),rl=(e,t)=>{hl(e,t.op),gl(e,t.last)},il=(e,t)=>{z(e.a,`aria-labelledby`,t),z(e.f,`id`,t)},al=L(`m14`,e=>{Mt(e,`j`),A(e.m,`click`,function(){jc(e)()}),A(e.v,`click`,function(){e.a4?.()}),A(e.w,`click`,function(){e.au()})});function ol(e){B(e.a,`_T`),B(e.b,`_U`),B(e.c,Wo),B(e.d,`_X`),B(e.e,`_Y`),B(e.g,`_Z`),B(e.i,`_bq`),B(e.k,`_br`),B(e.l,`_bs`),Yo(e.n),Xo(e.n,14),Zo(e.n),B(e.o,`_bt`),Qe(e,17,yl),qs(e.r),Js(e.r,Al(e)),Is(e.r,kl(e)),Fs(e.r),B(e.u,`_bm`),B(e.v,`_d`),B(e.w,[`_d`,`_e`,`_bn`]),Fc(e,``),Ic(e,!1),Bc(e,[]),Jc(e,!1),Xc(e,null),$c(e,null),nl(e,[]),rl(e,{last:0,op:``}),il(e,$e(e)),al(e)}var sl=O(16,`<li>No repos yet — search below to add one (or create empty).</li>`,` `,ite),cl=M(34,e=>sl(e,+!!e.a8)),ll=F(sc),ul=M(42,e=>{Gc(e),ll(e)}),dl=M(44,e=>{pl(e,e.ai?.length),xc(e)}),fl=O(24,`<section><div><h2>Archived</h2><span> </span></div><p>Restore a parked space instead of creating a new one.</p><ul></ul></section>`,` D Db D m b `,Sc),pl=M(45,e=>{fl(e,+!e.aj),Cc(e)}),ml=(e,t)=>dl(e,(t||[]).filter(e=>e.status===`archived`).slice().sort((e,t)=>t.created_at.localeCompare(e.created_at))),hl=M(47,e=>{tl(e),Nc(e)}),gl=M(48,e=>{tl(e),Nc(e)}),_l=M(28,Uc),vl=M(29,Nc),yl=at(`m12`,M(58)),bl=M(30);function xl(e){return function(){$c(e._,null)}}function Sl(e){return async()=>{if(e.aa)return;Jc(e,!0),$c(e,null),nl(e,[]),e.al=Math.random().toString(36).slice(2,10);try{e.am=(await H(`/api/progress`)).seq}catch{}let t=setInterval(async()=>{try{let t=await H(`/api/progress?since=${e.am}&op=${e.al}`);e.ao(t.messages)}catch{}},800);try{let t=await H(`/api/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:e.a5,repos:e.a7,opId:e.al})});Jc(e,!1),e.a3?.(t)}catch(t){Jc(e,!1),$c(e,String(t.message||t))}finally{clearInterval(t)}}}function Cl(e){return t=>{Fc(e,t)}}function wl(e){return function(t,n){e.ar(t,n)}}function Tl(e){return(t,n)=>{!t||e.a7.some(e=>e.fullName===t)||Bc(e,e.a7.concat({fullName:t,baseBranch:n}))}}function El(e){return t=>{Bc(e,e.a7.filter(e=>e.fullName!==t))}}function Dl(e){return async t=>{if(!(e.a9||e.aa)){$c(e,null),Xc(e,t.id);try{await H(`/api/workspaces/${t.id}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`restore`})}),e.a2?.({...t,status:`active`})}catch(t){$c(e,String(t.message||t))}finally{Xc(e,null)}}}}function Ol(e){return t=>{for(let n of t)n.op===e.al&&(n.seq&&n.seq<=e.am||(n.seq&&(e.am=n.seq),nl(e,e.af.concat(n.message))))}}function kl(e){return function(t){Ic(e,t)}}function Al(e){return function(t){$c(e,t)}}R(`m6`,xl),R(`m5`,Sl),R(`m0`,Cl),R(`m7`,wl),R(`m2`,Tl),R(`m3`,El),R(`m4`,Dl),R(`m1`,Ol),R(`m9`,kl),R(`m8`,Al);var jl=`_cU _y`,Ml=`_cW _y`,Nl=`_cX _y`,Pl=Ur,Fl=(e=>`/${e}&`)(Wr);function Il(e){Jr(e.a,`M18 8.4C18 6.70261 17.3679 5.07475 16.2426 3.87452C15.1174 2.67428 13.5913 2 12 2C10.4087 2 8.88258 2.67428 7.75736 3.87452C6.63214 5.07475 6 6.70261 6 8.4C6 15.8667 3 18 3 18H21C21 18 18 15.8667 18 8.4Z M13.73 21C13.5542 21.3031 13.3019 21.5547 12.9982 21.7295C12.6946 21.9044 12.3504 21.9965 12 21.9965C11.6496 21.9965 11.3054 21.9044 11.0018 21.7295C10.6982 21.5547 10.4458 21.3031 10.27 21`)}var Ll=(e,t)=>Kr(e.a,t),Rl=(e,t)=>qr(e.a,t),zl=Ur,Bl=(e=>`/${e}&`)(Wr);function Vl(e){Jr(e.a,`M3 12H6L9 3L15 21L18 12H21`)}var Hl=(e,t)=>Kr(e.a,t),Ul=(e,t)=>qr(e.a,t),Wl=`_fe _y`,Gl=Ur,Kl=(e=>`/${e}&`)(Wr);function ql(e){Jr(e.a,`M14.3632 5.65156L15.8431 4.17157C16.6242 3.39052 17.8905 3.39052 18.6716 4.17157L20.0858 5.58579C20.8668 6.36683 20.8668 7.63316 20.0858 8.41421L18.6058 9.8942M14.3632 5.65156L4.74749 15.2672C4.41542 15.5993 4.21079 16.0376 4.16947 16.5054L3.92738 19.2459C3.87261 19.8659 4.39148 20.3848 5.0115 20.33L7.75191 20.0879C8.21972 20.0466 8.65806 19.8419 8.99013 19.5099L18.6058 9.8942M14.3632 5.65156L18.6058 9.8942`)}var Jl=(e,t)=>Kr(e.a,t),Yl=(e,t)=>qr(e.a,t),Xl=`_fG _h _fF`,Zl=`_fH _h _fF`,Ql={open:`_fM`,merged:`_fN`,closed:`_fO`},$l=Ur,eu=(e=>`/${e}&`)(Wr);function tu(e){Jr(e.a,`M6.75827 17.2426L12.0009 12M17.2435 6.75736L12.0009 12M12.0009 12L6.75827 6.75736M12.0009 12L17.2435 17.2426`)}var nu=(e,t)=>Kr(e.a,t),ru=(e,t)=>qr(e.a,t),iu=`<!><!><!>`,au=(e,t)=>{let n=[`${e.worktree} — ${t.title}`];return t.state===`MERGED`?n.push(`merged`):t.state===`CLOSED`?n.push(`closed`):t.isDraft?n.push(`draft`):n.push(`open`),n.join(` · `)},ou=e=>!e.state||e.state===`OPEN`,su=P(4,1,e=>z(e.a,`title`,`Clear #${e._.l} from this list`)),cu=L(`r4`,e=>A(e.a,`click`,function(){e._._._._.m(e._._.f,e._.l)})),lu=e=>{su._(e),B(e.a,[`_fI`,`_fJ`,`_fK`]),tu(e.b),nu(e.b,12),ru(e.b),cu(e)},uu=N(10,e=>B(e.d,[`_fI`,`_fJ`,`_fK`,{_fL:e._._.i===e.j}])),du=N(11,e=>z(e.d,`title`,e._._.i===e.j?`Really kill ${e.h}?`:`Kill ${e.h} (pid ${e.j})`),2),fu=I(17,e=>{uu(e),du(e)},e=>e._._),pu=L(`r5`,e=>{A(e.b,`click`,function(){window.open(`http://${location.hostname}:${e.i}`,`_blank`,`noopener`)}),A(e.d,`click`,function(){e._._.i===e.j?(qu(e._._,null),fetch(`/api/procs/${e.j}`,{method:`DELETE`}).catch(()=>{})):e._._.l(e.j)})}),mu=e=>{fu(e),B(e.a,[`_h`,Zl]),B(e.b,[`_fI`,`_fP`]),tu(e.e),nu(e.e,12),ru(e.e),pu(e)},hu=M(7,e=>{z(e.a,`title`,e.h),du(e)}),gu=M(8,e=>{z(e.b,`title`,`Open http://${typeof location>`u`?`localhost`:location.hostname}:${e.i}`),V(e.c,e.i)}),_u=M(9,e=>{uu(e),du(e)}),vu=(e,t)=>{hu(e,t[0]?.cmd),gu(e,t[0]?.port),_u(e,t[0]?.pid)},yu=P(4,0,e=>z(e.a,`title`,`Review #${e._.l} diff`)),bu=L(`r3`,e=>A(e.a,`click`,function(){e._._._._.h?.(e._._.e,e._.l)})),xu=e=>{yu._(e),B(e.a,[`_fI`,`_fJ`]),Zr(e.b),Qr(e.b,12),$r(e.b),bu(e)},Su=N(14,e=>V(e.c,e._._.d(e._.c))),Cu=I(4,Su,e=>e._._),wu=e=>{Cu(e),Eu._(e),B(e.b,`_fI`)},Tu=N(7,e=>z(e.a,`title`,au(e._.c,e.g))),Eu=qe(0,e=>{Tu(e),Su(e)}),Du=O(4,(e=>`<button type=button>${e}</button>`)(Yr),(e=>` D/${e}&l`)(Xr),xu,(e=>`<button type=button>${e}</button>`)($l),(e=>` D/${e}&l`)(eu),lu),Ou=N(13,e=>B(e.a,[`_h`,Xl,{_j:e.m&&!e.i,_k:e.m&&e.i,[Ql.merged]:e.j===`MERGED`,[Ql.closed]:e.j===`CLOSED`}]),2),ku=M(12,e=>{Du(e,+!e.m),Ou(e)}),Au=M(6,e=>{ju(e,e.g?.isDraft),Mu(e,e.g?.state),Nu(e,e.g?.url),Pu(e,e.g?.number),ku(e,ou(e.g)),Tu(e)}),ju=M(8,Ou),Mu=M(9,Ou),Nu=(e,t)=>z(e.b,`href`,t),Pu=M(11,e=>{V(e.d,e.l),yu(e),su(e)}),Fu=k(0,`<span><a target=_blank rel=noopener><!>#<!></a><!></span>`,` D D%c%l%`,wu,(e,t)=>Au(e,t[0])),Iu=(e,t)=>Fu(e,[t||[],`number`]),Lu=(e,t)=>Ru(e,t[0]),Ru=M(2,e=>{Iu(e,e.c?.prs),zu(e,e.c?.worktree),Bu(e,e.c?.full_name),Eu(e)}),zu=M(4),Bu=M(5),Vu=M(3,F(Cu)),Hu=k(1,`<!><!><!>`,`b%`,0,Lu),Uu=P(0,0,e=>{Vu(e,ld(e)),Hu(e,[e._.n,`full_name`])}),Wu=e=>{Uu._(e),Ku._(e),B(e.a,`_fE`)},Gu=k(2,(e=>`<span><button type=button>:<!></button><button type=button>${e}</button></span>`)($l),(e=>` D Db%l D/${e}&m`)(eu),mu,vu),Ku=P(0,0,e=>Gu(e,[e._.o,`port`])),qu=j(8,F(fu)),Ju=(e,t)=>Zu(e,t.timer);function Yu(e){qu(e,null),Ju(e,{timer:0})}var Xu=M(11),Zu=M(10,e=>Xu(e,ud(e))),Qu=M(12),$u=M(3,e=>Qu(e,dd(e))),ed=O(0,`<div><!><!></div>`,` D%b%`,Wu),td=N(16,e=>ed(e,e.n.some(e=>(e.prs||[]).length)||e.p?0:1)),nd=M(13,e=>{td(e),Uu(e)}),rd=(e,t)=>nd(e,t||[]),id=M(14,e=>{ad(e,e.o.length),Ku(e)}),ad=M(15,td),od=(e,t)=>id(e,t||[]),sd=(e,t)=>{rd(e,t?.repos),od(e,t?.ports)},cd=M(7);function ld(e){return t=>{if(e._.n.length<2)return``;let n=t.full_name.split(`/`)[1];return e._.n.some(e=>e.full_name!==t.full_name&&e.full_name.split(`/`)[1]===n)?t.full_name:n}}function ud(e){return t=>{clearTimeout(e.k),qu(e,t),e.k=setTimeout(()=>{qu(e,null)},3500)}}function dd(e){return(t,n)=>{fetch(`/api/workspaces/${e.d}/prs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t,number:n})}).catch(()=>{})}}R(`r2`,ld),R(`r0`,ud),R(`r1`,dd);var fd=`<!><!><!>`,pd=P(7,0,e=>V(e.b,e._.u)),md=e=>{pd._(e),B(e.a,`_fq`)},hd=I(50,e=>jt(e,`c`,e._._._._.a3,Tp(e)),e=>e._._._._),gd=L(`s8`,e=>{Mt(e,`c`),A(e.c,`keydown`,function(t){t.key===`Enter`?(t.preventDefault(),e._._._._.a5(e._.c)):t.key===`Escape`&&(t.preventDefault(),Jf(e._._._._,null))}),A(e.c,`blur`,function(){e._._._._.a5(e._.c)}),Tt(e,{onMount:function(){queueMicrotask(()=>{let t=e.c;t?.focus(),t?.select()})}})}),_d=e=>{hd(e),vd._(e),yd._(e),e.b,gi(e.b,13),vi(e.b,`_fD`),B(e.c,`_fx`),gd(e)},vd=P(0,0,e=>B(e.a,[`_o`,Yt[Hr(e._.g)],`_fw`])),yd=P(0,0,e=>_i(e.b,e._.h)),bd=N(9,e=>{B(e.i,[`_fy`,{_fA:e._._._._.y===e._.d}]),z(e.i,`title`,e._._._._.y===e._.d?`Really kill this session?`:`Kill session`)}),xd=I(48,bd,e=>e._._._._),Sd=L(`s9`,e=>{A(e.a,`click`,function(){e._._._._.v?.(e._.d)}),A(e.g,`click`,function(){Jf(e._._._._,e._.d),Xf(e._._._._,e._.i||e._.h)}),A(e.i,`click`,function(){e._._._._.y===e._.d?(Uf(e._._._._,null),e._._._._.w?.(e._.d)):e._._._._.a1(e._.d)})}),Cd=e=>{xd(e),wd._(e),Td._(e),Dd._(e),Od._(e),B(e.a,`_fC`),e.c,gi(e.c,13),vi(e.c,`_fD`),B(e.d,`_fu`),B(e.f,`_fv`),B(e.g,`_fl`),ql(e.h),Jl(e.h,12),Yl(e.h),Sd(e)},wd=P(0,1,bd),Td=P(0,1,e=>B(e.b,[`_o`,Yt[Hr(e._.g)]])),Ed=N(10,e=>V(e.e,e._.i||e._.h)),Dd=P(0,1,e=>{_i(e.c,e._.h),Ed(e)}),Od=P(0,1,Ed),kd=N(4,e=>B(e.a,[`_fz`,{_fd:e.d===e._._._.u}])),Ad=I(46,kd,e=>e._._._),jd=e=>{Ad(e),Pd(e)},Md=O(0,(e=>`<span></span>${e}<input aria-label="Session name">`)(ui),(e=>` b/${e}& b`)(`b%c`),_d,((e,t)=>`<button><span></span>${e}<span> </span></button><div><button title="Rename session">${t}</button><button>×</button></div>`)(ui,Gl),((e,t)=>` D b/${e}& D m D D/${t}&l l`)(`b%c`,Kl),Cd),Nd=N(5,e=>Md(e,e._._._.a2===e.d?0:1)),Pd=I(49,Nd,e=>e._._._),Fd=M(3,e=>{kd(e),Nd(e),wd(e)}),Id=(e,t)=>Ld(e,t[0]),Ld=M(2,e=>{Fd(e,e.c?.id),Rd(e,e.c?.state),zd(e,e.c?.agent),Bd(e,e.c?.title)}),Rd=M(6,e=>{Td(e),vd(e)}),zd=M(7,e=>{Dd(e),yd(e)}),Bd=M(8,Od),Vd=L(`s6`,e=>A(e.a,`click`,function(){e._._._._.r?.()})),Hd=e=>{B(e.a,`_fl`),Zr(e.b),Qr(e.b,12),$r(e.b),Vd(e)},Ud=L(`s4`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._._._.p?.(e.e)})),Wd=e=>{e.b,gi(e.b,14),vi(e.b),Ud(e)},Gd=M(4,e=>{_i(e.b,e.e),V(e.c,e.e)}),Kd=k(2,(e=>`<button>${e}<!></button>`)(ui),(e=>` D/${e}&%l`)(`b%c`),Wd,(e,t)=>Gd(e,t[0])),qd=I(43,e=>Kd(e,[[...e._._._._.q||[],`shell`],e=>e]),e=>e._._._._),Jd=(e,t)=>{z(e.a,`popovertarget`,t),z(e.c,`id`,t)},Yd=L(`s5`,e=>A(e.c,`toggle`,function(t,n){if(t.newState===`open`){let t=e.a.getBoundingClientRect();n.style.top=`${t.bottom+4}px`,n.style.left=`${Math.max(8,Math.min(t.left,window.innerWidth-n.offsetWidth-8))}px`}})),Xd=O(1,(e=>`<button title="New session">${e}</button><div popover=auto></div>`)(ui),(e=>` D/${e}&l b`)(`b%c`),e=>{qd(e),B(e.a,`_fl`),e.b,_i(e.b,`shell`),gi(e.b,12),vi(e.b),B(e.c,`_fn`),Jd(e,$e(e)),Yd(e)}),Zd=I(42,e=>Xd(e,+!e._._._.p),e=>e._._._),Qd=L(`s7`,e=>A(e.d,`click`,function(){e._._._.t?.()})),$d=e=>{Zd(e),tf(e),nf(e),B(e.a,`_fk`),ni(e.e),ri(e.e,12),ii(e.e),Qd(e)},ef=O(2,(e=>`<button title="Review changes">${e}</button>`)(Yr),(e=>` D/${e}&l`)(Xr),Hd),tf=I(44,e=>ef(e,+!e._._._.r),e=>e._._._),nf=I(45,e=>{B(e.d,[`_fl`,{_fm:e._._._.s}]),z(e.d,`aria-pressed`,e._._._.s?`true`:`false`)},e=>e._._._),rf=I(37,e=>V(e.b,e._._._.j?`Open`:``),e=>e._._._),af=e=>{rf(e),B(e.a,`_fr`)},of=I(34,e=>$u(e.m,e._._.f),e=>e._._),sf=L(`s10`,e=>{A(e.a,`click`,function(t){t.target?.closest(`button, input, a, [popover]`)||e._._.k()}),A(e.c,`click`,function(){e._._.k()})}),cf=e=>{of(e),uf(e),pf(e),mf(e),vf(e),yf(e),bf(e),xf._(e),Tf._(e),B(e.b,`_fi`),B(e.c,`_fj`),B(e.e,`_fo`),B(e.f,`_fp`),B(e.k,`_fB`),Yu(e.m),sf(e)},lf=N(21,e=>B(e.a,[`_fg`,{_fd:e._._.j,_fh:e._._.n,_ft:e._._.o}]),2),uf=I(37,lf,e=>e._._),df=k(11,`<div></div>`,` `,jd,Id),ff=(e,t)=>{Ef(e,t.length),Df(e,t[0]?.title),Of(e,t[0]?.agent),df(e,[t.length>1?t:[],`id`])},pf=I(39,e=>ff(e,e._._.m||[]),e=>e._._),mf=I(40,lf,e=>e._._),hf=O(7,`<span> </span>`,` D `,md),gf=O(8,`<span> </span>`,` D `,af),_f=O(9,(e=>`<div><!><!><button title="Manage workspace">${e}</button></div>`)(ei),(e=>` D%b%b D/${e}&m`)(ti),$d),vf=I(41,e=>{hf(e,+!e._._.o),gf(e,+!e._._.o),_f(e,+!!e._._.o),lf(e)},e=>e._._),yf=I(47,e=>cd(e.m,e._._.x),e=>e._._),bf=I(51,e=>V(e.g,e._._.a7),e=>e._._),xf=P(0,1,e=>sd(e.m,e._.b)),Sf=M(20,pd),Cf=N(19,e=>Sf(e,e.o===0?e.s:e.o===1?`${e.q||e.r} · ${e.s}`:`${e.o} sessions · ${e.s}`),3),wf=M(18,Cf),Tf=P(0,1,e=>{B(e.d,[`_o`,Yt[e._.c],`_fs`]),wf(e,e._.c===`working`?`Working`:e._.c===`waiting`?`Needs you`:e._.c===`idle`?`Idle`:`Off`)}),Ef=M(14,Cf),Df=M(16,Cf),Of=M(17,Cf),kf=I(37,e=>B(e.a,[Wl,{_fd:e._._.j}]),e=>e._._),Af=L(`s3`,e=>A(e.a,`click`,function(){e._._.k()})),jf=e=>{kf(e),Mf(e),Nf(e),Pf._(e),Af(e)},Mf=I(38,e=>V(e.b,(e._._.l??0)+1),e=>e._._),Nf=I(51,e=>z(e.a,`title`,e._._.a7),e=>e._._),Pf=P(0,0,e=>B(e.c,[`_o`,Yt[e._.c],`_ff`])),Ff=M(2,e=>{Pf(e),Tf(e)}),If=M(1,e=>{Ff(e,Vr(e.b)),xf(e)}),Lf=N(3,e=>If(e,e._.h[e._.f])),Rf=P(0,0,Lf),zf=e=>{Rf._(e),Bf._(e),Hf._(e)},Bf=P(0,0,Lf),Vf=O(0,`<button> <span></span></button>`,` D b `,jf,(e=>`<section><div><button><span></span><span><span> </span><!></span><!></button><!></div><div><!>${e}</div></section>`)(iu),(e=>` D D D b D D l%l%l%l D%b/${e}&m`)(`b%c`),cf),Hf=P(0,0,e=>Vf(e,+!e._.i)),Uf=j(24,F(xd)),Wf=(e,t)=>$f(e,t.timer),Gf=M(31),Kf=N(30,e=>Gf(e,Ep(e)),2),qf=F(Pd),Jf=j(28,e=>{Kf(e),qf(e)}),Yf=F(hd),Xf=j(29,e=>{Kf(e),Yf(e)});function Zf(e){Uf(e,null),Wf(e,{timer:0}),Jf(e,null),Xf(e,``)}var Qf=M(27),$f=M(26,e=>Qf(e,Dp(e))),ep=M(3,Kf),tp=O(0,`<!><!><!>`,`b%`,zf),np=(e,t)=>{rp(e,t?.name),tp(e,+!t)},rp=M(33,F(Nf,bf)),ip=N(6,e=>np(e,e.e.find(t=>t.id===e.f))),ap=M(4,ip),op=F(of),sp=M(5,e=>{ip(e),Rf(e),op(e)}),cp=M(7,Bf),lp=M(8,Hf),up=M(9,F(kf,uf,rf)),dp=M(10),fp=M(11,F(Mf)),pp=M(12,F(pf)),mp=M(13,F(mf)),hp=M(14,F(vf)),gp=M(15,F(Zd)),_p=M(16,F(qd)),vp=M(17,F(tf)),yp=M(18,F(nf)),bp=M(19),xp=M(20,F(Ad)),Sp=M(21),Cp=M(22),wp=M(23,F(yf));function Tp(e){return t=>{Xf(e._._._._,t)}}function Ep(e){return t=>{if(e.a2!==t.id)return;let n=e.a3.trim();Jf(e,null),n&&e.d?.(t,n)}}function Dp(e){return t=>{clearTimeout(e.a0),Uf(e,t),e.a0=setTimeout(()=>{Uf(e,null)},3500)}}R(`s0`,Tp),R(`s2`,Ep),R(`s1`,Dp);var Op=Ur,kp=(e=>`/${e}&`)(Wr);function Ap(e){Jr(e.a,`M18 6H20M22 6H20M20 6V4M20 6V8 M21.4 20H2.6C2.26863 20 2 19.7314 2 19.4V11H21.4C21.7314 11 22 11.2686 22 11.6V19.4C22 19.7314 21.7314 20 21.4 20Z M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H14`)}var jp=(e,t)=>Kr(e.a,t),Mp=(e,t)=>qr(e.a,t),Np=Ur,Pp=(e=>`/${e}&`)(Wr);function Fp(e){Jr(e.a,`M19 21L5 21C3.89543 21 3 20.1046 3 19L3 5C3 3.89543 3.89543 3 5 3L19 3C20.1046 3 21 3.89543 21 5L21 19C21 20.1046 20.1046 21 19 21Z M7.25 10L5.5 12L7.25 14 M9.5 21V3`)}var Ip=(e,t)=>Kr(e.a,t),Lp=(e,t)=>qr(e.a,t),Rp=Ur,zp=(e=>`/${e}&`)(Wr);function Bp(e){Jr(e.a,`M19 21L5 21C3.89543 21 3 20.1046 3 19L3 5C3 3.89543 3.89543 3 5 3L19 3C20.1046 3 21 3.89543 21 5L21 19C21 20.1046 20.1046 21 19 21Z M9.5 21V3 M5.5 10L7.25 12L5.5 14`)}var Vp=(e,t)=>Kr(e.a,t),Hp=(e,t)=>qr(e.a,t),Up=`<aside><!><div></div><!><div></div></aside>`,Wp=` D%b b%b l`,Gp=e=>{Bp(e.a),Vp(e.a,15),Hp(e.a)},Kp=e=>{Fp(e.a),Ip(e.a,15),Lp(e.a)},qp=e=>B(e.a,`_c3`),Jp=e=>B(e.a,`_c3`),Yp=I(66,e=>{B(e.a,[Nl,{_cT:e._._.ac}]),z(e.a,`title`,e._._.ac?`Disable agent-waiting notifications`:`Notify when an agent is waiting`)},e=>e._._),Xp=L(`t22`,e=>A(e.a,`click`,function(){e._._.ag()})),Zp=e=>{Yp(e),Il(e.b),Ll(e.b,15),Rl(e.b),Xp(e)},Qp=I(66,e=>{B(e.a,[Nl,{_cT:e._._.ac}]),z(e.a,`title`,e._._.ac?`Disable agent-waiting notifications`:`Notify when an agent is waiting`)},e=>e._._),$p=L(`t17`,e=>A(e.a,`click`,function(){e._._.ag()})),em=e=>{Qp(e),Il(e.b),Ll(e.b,16),Rl(e.b),$p(e)},tm=P(4,1,e=>{B(e.d,[jl,{_cT:e._.a9===`usage`}]),z(e.d,`aria-pressed`,e._.a9===`usage`?`true`:`false`),B(e.f,[jl,{_cT:e._.a9===`new`}]),z(e.f,`aria-pressed`,e._.a9===`new`?`true`:`false`)}),nm=L(`t23`,e=>{A(e.a,`click`,function(){Th(e._,!e._.ab),vee(e._.ab)}),A(e.d,`click`,function(){e._.af(),e._.s?.()}),A(e.f,`click`,function(){e._.af(),e._.a2?.()})}),rm=e=>{tm._(e),am._(e),sm._(e),B(e.a,Ml),B(e.b,[`_n`,`_c8`]),Vl(e.e),Hl(e.e,15),Ul(e.e),Ap(e.g),jp(e.g,16),Mp(e.g),nm(e)},im=O(0,Np,(e=>`/${e}&`)(Pp),Kp,Rp,(e=>`/${e}&`)(zp),Gp),am=P(4,1,e=>{z(e.a,`title`,e._.ab?`Collapse sidebar`:`Expand sidebar`),im(e,+!e._.ab)}),om=O(2,(e=>`<button>${e}</button>`)(Pl),(e=>` D/${e}&l`)(Fl),Zp),sm=P(4,1,e=>om(e,+!e._.ae)),cm=P(4,0,e=>{B(e.a,[`_c4`,{_cT:e._.a9===`new`}]),z(e.a,`aria-pressed`,e._.a9===`new`?`true`:`false`)}),lm=L(`t21`,e=>A(e.a,`click`,function(){e._.af(),e._.a2?.()})),um=e=>{cm._(e),Ap(e.b),jp(e.b,16),Mp(e.b),lm(e)},dm=N(8,e=>vp(e.b,kh(e)),4),fm=I(55,dm,e=>e._._),pm=L(`t20`,e=>{A(e.a,`mouseenter`,function(){e._.i()}),A(e.a,`mouseleave`,function(){e._.j()})}),mm=e=>{fm(e),hm(e),_m(e),vm(e),bm(e),xm(e),Sm(e),Em(e),Dm(e),Om(e),km(e),Am(e),jm(e),Mm._(e),Pm._(e),Fm._(e),B(e.a,`_c9`),Zf(e.b),mp(e.b,!0),bp(e.b,Ah(e)),lp(e.b),fp(e.b),hp(e.b),pm(e)},hm=I(56,e=>_p(e.b,e._._.v),e=>e._._),gm=N(3,e=>gp(e.b,jh(e))),_m=I(57,gm,e=>e._._),vm=I(58,dm,e=>e._._),ym=N(6,e=>pp(e.b,e.c===e._._.a5&&e._._.y?e._._.y:e._._.ak[e.c]?.sessions||[]),3),bm=I(59,ym,e=>e._._),xm=I(60,e=>ep(e.b,e._._.a0),e=>e._._),Sm=I(61,e=>Cp(e.b,e._._.a1),e=>e._._),Cm=N(5,e=>up(e.b,e._._.ao&&e.c===e._._.a5),2),wm=N(4,e=>yp(e.b,e._._.a9===`manage`&&e.c===e._._.a5),2),Tm=N(7,e=>xp(e.b,e.c===e._._.a5&&e._._.a9===`term`?e._._.a7:null),3),Em=I(62,e=>{dp(e.b,Ph(e)),wp(e.b,Nh(e)),Sp(e.b,Mh(e)),Cm(e),wm(e),dm(e),ym(e),Tm(e)},e=>e._._),Dm=I(63,Tm,e=>e._._),Om=I(64,e=>{wm(e),dm(e),Tm(e)},e=>e._._),km=I(70,e=>ap(e.b,e._._.aj),e=>e._._),Am=I(71,e=>{cp(e.b,e._._.ak),ym(e)},e=>e._._),jm=I(73,Cm,e=>e._._),_te=M(2,e=>{sp(e.b,e.c),Cm(e),wm(e),gm(e),dm(e),ym(e),Tm(e)}),Mm=P(1,0,e=>_te(e,e._.d)),Nm=N(9,e=>gt(e.a,`top:${e._.e}px;left:${e._.f}px`)),Pm=P(1,0,Nm),Fm=P(1,0,Nm),Im=N(4,e=>up(e.b,e._._.ao&&e.d===e._._.a5),2),Lm=I(62,e=>{dp(e.b,Fh(e)),Im(e)},e=>e._._),vte=L(`t19`,e=>{A(e.a,`mouseenter`,function(t,n){e._.i();let r=n.getBoundingClientRect();Hm(e._,{id:e.d,top:r.top,left:r.right+8})}),A(e.a,`mouseleave`,function(){e._.j()})}),yte=e=>{Lm(e),Rm(e),zm(e),Bm(e),Zf(e.b),lp(e.b,!0),ep(e.b),pp(e.b),mp(e.b),hp(e.b),gp(e.b),_p(e.b),vp(e.b),yp(e.b),bp(e.b),xp(e.b),Sp(e.b),Cp(e.b),wp(e.b),vte(e)},Rm=I(70,e=>ap(e.b,e._._.aj),e=>e._._),zm=I(71,e=>cp(e.b,e._._.ak),e=>e._._),Bm=I(73,Im,e=>e._._),bte=(e,t)=>fp(e.b,t),xte=M(3,e=>{sp(e.b,e.d),Im(e)}),Ste=k(0,(e=>`<span>${e}</span>`)(fd),(e=>` D/${e}&l`)(`b%c`),yte,(e,t)=>{xte(e,t[0]),bte(e,t[1])}),Vm=P(3,0,e=>Ste(e,[e._.ah,e=>e])),Cte=O(1,(e=>`<div>${e}</div>`)(fd),(e=>` D/${e}&l`)(`b%c`),mm),Hm=j(2,e=>{Ete(e,e.c?.id),Dte(e,e.c?.top),Ote(e,e.c?.left),Cte(e,+!e.c)}),wte=(e,t)=>jte(e,t.timer),Tte=e=>{Vm._(e),B(e.a,`_c6`),Hm(e,null),wte(e,{timer:0})},Ete=M(3,Mm),Dte=M(4,Pm),Ote=M(5,Fm),kte=M(8),Ate=M(9),jte=M(7,e=>{kte(e,Ih(e)),Ate(e,Lh(e))}),Um=N(12,e=>vp(e.c,Rh(e)),4),Wm=qe(2,Um),Mte=e=>{Wm._(e),Gm._(e),qm._(e),Jm._(e),Xm._(e),Zm._(e),Qm._(e),ih._(e),ah._(e),oh._(e),sh._(e),ch._(e),lh._(e),uh._(e),dh._(e),fh._(e),Zf(e.c),bp(e.c,zh(e)),lp(e.c),fp(e.c),mp(e.c)},Gm=qe(2,e=>_p(e.c,e._.v)),Km=N(5,e=>gp(e.c,Bh(e)),2),qm=qe(2,Km),Jm=qe(2,Um),Ym=N(9,e=>pp(e.c,e.e===e._.a5&&e._.y?e._.y:e._.ak[e.e]?.sessions||[]),3),Xm=qe(2,Ym),Zm=qe(2,e=>ep(e.c,e._.a0)),Qm=qe(2,e=>Cp(e.c,e._.a1)),Nte=O(0,`<h2>Current</h2>`,` `,Jp),$m=N(7,e=>Nte(e,e._.am&&e.e===e._.a5?0:1),2),Pte=O(1,`<h2>Other spaces</h2>`,` `,qp),eh=N(11,e=>Pte(e,e._.am&&e.e!==e._.a5&&e.e===e._.ar?0:1),3),th=N(8,e=>up(e.c,e._.ao&&e.e===e._.a5),2),nh=N(6,e=>yp(e.c,e._.a9===`manage`&&e.e===e._.a5),2),rh=N(10,e=>xp(e.c,e.e===e._.a5&&e._.a9===`term`?e._.a7:null),3),ih=Je(2,31,4,e=>{dp(e.c,Uh(e)),wp(e.c,Hh(e)),Sp(e.c,Vh(e)),$m(e),eh(e),th(e),nh(e),Um(e),Ym(e),rh(e)}),ah=qe(2,rh),oh=qe(2,e=>{nh(e),Um(e),rh(e)}),sh=qe(2,Km),ch=qe(2,e=>ap(e.c,e._.aj)),lh=qe(2,e=>{cp(e.c,e._.ak),Ym(e)}),uh=qe(2,e=>{hp(e.c,e._.am),$m(e),eh(e)}),dh=qe(2,th),fh=Je(2,53,4,eh),Fte=M(4,e=>{sp(e.c,e.e),$m(e),eh(e),th(e),nh(e),Km(e),Um(e),Ym(e),rh(e)}),Ite=(e,t)=>Fte(e,t[0]),ph=P(1,0,e=>{B(e.d,[jl,{_cT:e._.a9===`usage`}]),z(e.d,`aria-pressed`,e._.a9===`usage`?`true`:`false`)}),Lte=L(`t18`,e=>A(e.d,`click`,function(){e._.af(),e._.s?.()})),Rte=e=>{ph._(e),mh._(e),B(e.a,`_c1`),B(e.b,`_c2`),Vl(e.e),Hl(e.e,16),Ul(e.e),Lte(e)},zte=O(2,(e=>`<button>${e}</button>`)(Pl),(e=>` D/${e}&l`)(Fl),em),mh=P(1,0,e=>zte(e,+!e._.ae)),Bte=F(Rm,km),Vte=M(45,e=>{ch(e),Bte(e)}),hh=N(30,e=>Vte(e,e.q||[e.a3])),Hte=M(29,e=>{Jte(e,e.a3?.id),hh(e)}),Ute=k(2,(e=>`<!><!><!>${e}<!>`)(fd),(e=>`b%b%b/${e}&b`)(`b%c`),Mte,Ite),Wte=(e,t)=>Ute(e,[t,e=>e]),gh=N(52,e=>Wte(e,e.am?[e.a5,...e.ap]:e.ah),3),Gte=M(51,e=>{yne(e,e.ap?.[0]),gh(e)}),_h=N(44,e=>Gte(e,e.ah.filter(t=>t!==e.a5))),Kte=M(43,e=>{_h(e),gh(e),Vm(e)}),vh=N(32,e=>Kte(e,e.q?.length?e.q.filter(e=>e.status===`active`).map(e=>e.id):[e.a5])),yh=N(47,e=>e.ak[e.a5]),qte=F(Lm,Em),Jte=M(31,e=>{vh(e),yh(e),_h(e),gh(e),ih(e),qte(e)}),Yte=Hte,Xte=F(Dm),bh=Ke(33,e=>{ah(e),Xte(e)}),xh=N(10,e=>bh(e,e.i,e.j)),Zte=M(8,xh),Qte=M(9,xh),$te=M(41,sh),ene=O(1,(e=>`<header><h1>Workspaces</h1><div><!><button title=Usage>${e}</button></div></header>`)(zl),(e=>` Db D%b D/${e}&n`)(Bl),Rte),tne=O(4,(e=>`<button title="New workspace">${e} New workspace</button>`)(Op),(e=>` D/${e}&l`)(kp),um,((e,t)=>`<button></button><div></div><!><button title=Usage>${e}</button><button title="New workspace">${t}</button>`)(zl,Op),((e,t)=>` b b%b D/${e}&l D/${t}&l`)(Bl,kp),rm),Sh=N(49,e=>B(e.a,[`_c0`,{_cY:!e.ab,_cZ:e.am}])),nne=M(48,e=>{ene(e,+!e.am),tne(e,+!e.am),gh(e),Sh(e),uh(e)}),rne=F(Bm,jm),ine=M(50,e=>{dh(e),rne(e)}),ane=F(Om),Ch=Ke(35,e=>{z(e.a,`hidden`,e.a9===`diff`),$te(e,Wh(e)),nne(e,e.a9===`nav`),ine(e,e.a9!==`usage`&&e.a9!==`new`),ph(e),oh(e),ane(e),cm(e),tm(e)}),wh=N(13,e=>Ch(e,e.l,e.m)),one=M(11,wh),sne=M(12,wh),cne=O(3,`<div></div><!><!>`,` b%`,Tte),Th=j(37,e=>{cne(e,+!!e.ab),Sh(e),am(e)}),lne=M(42),Eh=N(39,e=>lne(e,Gh(e))),une=F(Qp,Yp),Dh=j(38,e=>{Eh(e),une(e)}),dne=L(`t25`,e=>Tt(e,{onMount:function(){Oh(e,Un()),e.ae&&Wn().then(t=>{Dh(e,!!t)})}})),Oh=j(40,e=>{mh(e),sm(e),dne(e)});function fne(e){B(e.c,`_c5`),B(e.e,`_c7`),Th(e,zn()),Dh(e,!1),Oh(e,!1)}var pne=M(14,Eh),mne=M(15,L(`t24`,e=>{e.p&&Th(e,zn())})),hne=M(16,e=>{vh(e),hh(e)}),gne=F(zm,Am),_ne=M(46,e=>{yh(e),lh(e),gne(e)}),vne=(e,t)=>_ne(e,t||{}),yne=M(53,fh),bne=M(18),xne=F(fm),Sne=M(19,e=>{Wm(e),xne(e)}),Cne=M(20),wne=F(hm),Tne=M(21,e=>{Gm(e),wne(e)}),Ene=F(_m),Dne=M(22,e=>{qm(e),Ene(e)}),One=F(vm),kne=M(23,e=>{Jm(e),One(e)}),Ane=F(bm),jne=M(24,e=>{Xm(e),Ane(e)}),Mne=M(25),Nne=F(xm),Pne=M(26,e=>{Zm(e),Nne(e)}),Fne=F(Sm),Ine=M(27,e=>{Qm(e),Fne(e)}),Lne=M(28);function kh(e){return function(){Hm(e._,null),e.c===e._._.a5?e._._.a9===`diff`?Ch(e._._,`term`):e._._.x?.():(Dn(e.c),e._._.t?.(e.c))}}function Ah(e){return function(){Hm(e._,null),e._._.u?.(e.c)}}function jh(e){return function(t){Hm(e._,null),e._._.w(e.c,t)}}function Mh(e){return function(t){Hm(e._,null),e.c===e._._.a5?(bh(e._._,t),Ch(e._._,`term`)):e._._.z?.(e.c,t)}}function Nh(e){return function(t,n){Hm(e._,null);let r=`${t}/${n}`;e.c===e._._.a5?e._._.x?.(r):(Dn(e.c,r),e._._.t?.(e.c))}}function Ph(e){return function(){Hm(e._,null),e.c===e._._.a5?(e._._.a9===`manage`||e._._.a9===`usage`||e._._.a9===`new`)&&Ch(e._._,`term`):e._._.t?.(e.c)}}function Fh(e){return function(){e.d===e._._.a5?(e._._.a9===`manage`||e._._.a9===`usage`||e._._.a9===`new`)&&Ch(e._._,`term`):e._._.t?.(e.d)}}function Ih(e){return()=>clearTimeout(e.h)}function Lh(e){return()=>{clearTimeout(e.h),e.h=setTimeout(()=>{Hm(e,null)},150)}}function Rh(e){return function(){e.e===e._.a5?e._.a9===`diff`?Ch(e._,`term`):e._.x?.():(Dn(e.e),e._.t?.(e.e))}}function zh(e){return function(){e._.u?.(e.e)}}function Bh(e){return function(t){e._.af(),e._.w(e.e,t)}}function Vh(e){return function(t){e.e===e._.a5?(bh(e._,t),Ch(e._,`term`)):e._.z?.(e.e,t)}}function Hh(e){return function(t,n){let r=`${t}/${n}`;e.e===e._.a5?e._.x?.(r):(Dn(e.e,r),e._.t?.(e.e))}}function Uh(e){return function(){e.e===e._.a5?(e._.a9===`nav`||e._.a9===`manage`||e._.a9===`usage`||e._.a9===`new`)&&Ch(e._,`term`):(e._.af(),e._.t?.(e.e))}}function Wh(e){return()=>{e.a9===`nav`&&Ch(e,`term`)}}function Gh(e){return async()=>{try{e.ac?(await Kn(),Dh(e,!1)):(Dh(e,await Gn()),e.ac||e.o?.(`Notifications blocked — allow them for this site in browser/system settings.`))}catch(t){Dh(e,!1),e.o?.(`Notifications failed: ${String(t.message||t)}`)}}}R(`t14`,kh),R(`t12`,Ah),R(`t13`,jh),R(`t16`,Mh),R(`t15`,Nh),R(`t11`,Ph),R(`t10`,Fh),R(`t8`,Ih),R(`t9`,Lh),R(`t5`,Rh),R(`t3`,zh),R(`t4`,Bh),R(`t7`,Vh),R(`t6`,Hh),R(`t2`,Uh),R(`t0`,Wh),R(`t1`,Gh);async function Kh(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.style.cssText=`position:fixed;top:-100px;opacity:0;`,document.body.append(t),t.focus(),t.select();let n=document.execCommand(`copy`);return t.remove(),n}}function qh(e){return e.map(e=>{let t=e.pr?String(e.pr.number):`-`,n=e.pr&&(e.pr.headRefOid||e.head)||``,r=e.localHead||e.head||``;return`${e.worktree}#${t}:${n}:L${r}`}).sort().join(`\0`)}function Jh(e){return e.repos.flatMap(e=>{let t=e.localHead||``;return e.prs.length?e.prs.map(n=>`${e.worktree}#${n.number}:${n.headRefOid||``}:L${t}`):[`${e.worktree}#-::L${t}`]}).sort().join(`\0`)}var Yh=null;function Xh(){return Yh}function Zh(e){let t=[],n=[];for(let r of e.trim().split(/\s+/).filter(Boolean)){let e=r.startsWith(`!`),i=e?r.slice(1):r;i&&(e?n:t).push(Qh(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function Qh(e){if(!/[*?]/.test(e))return t=>Br(e,t);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r===`*`?e[n+1]===`*`?(t+=`.*`,n++):t+=`[^/]*`:t+=r===`?`?`[^/]`:r.replace(/[.+^${}()|[\]\\]/,`\\$&`)}try{let e=new RegExp(t,`i`);return t=>e.test(t)}catch{return t=>Br(e,t)}}var $h=`search-mark`,eg=`mark.${$h}`,tg=`mark.${$h}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${$h} *,mark.${$h} *::before,mark.${$h} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${$h}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,ng={query:``,hit:null},rg=new Map;function ig(e,t){ng.query=e,ng.hit=t;for(let[e,t]of rg)vg(e,ng.query,ng.hit?.key===t?ng.hit:null);t&&og(t)}function ag(){ng.hit&&og(ng.hit)}function og(e,t=0){requestAnimationFrame(()=>{requestAnimationFrame(()=>{let n=!1;for(let[r,i]of rg)if(i===e.key&&(n=!0,cg(r,e)||t>=40))return;t>=40||(!n||t<12)&&setTimeout(()=>og(e,t+1),n?32:48)})})}function sg(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();if(i.height===0&&i.width===0)return!1;if(n===`y`){let t=i.top-r.top+e.scrollTop-(r.height/2-i.height/2);return e.scrollTo({top:Math.max(0,t)}),!0}if(e.scrollWidth<=e.clientWidth+1)return!0;let a=i.left-r.left+e.scrollLeft-(r.width/2-i.width/2),o=Math.max(0,e.scrollWidth-e.clientWidth);return e.scrollTo({left:Math.max(0,Math.min(a,o))}),!0}function cg(e,t){let n=e.querySelector(`diffs-container`)?.shadowRoot;if(!n)return!1;let r=n.querySelector(`mark.search-mark.active`)??(()=>{if(t.line<1)return null;let e=[...n.querySelectorAll(`[data-line="${t.line}"]`)],r=t.side||`additions`;return e.find(e=>pg(e)===r)??e[0]??null})();if(!r)return!1;let i=e.closest(`[data-diff-main]`);if(i){if(!sg(i,r,`y`))return!1}else r.scrollIntoView({block:`center`,inline:`nearest`});let a=r.getRootNode(),o=a instanceof ShadowRoot?a.host:e.querySelector(`diffs-container`);return o&&sg(o,r,`x`),!0}function lg(e,t){let n=t&&ng.hit?.key===t?ng.hit:null;vg(e,ng.query,n),n&&og(n)}function ug(e,t){return rg.set(e,t),lg(e,t),()=>{rg.delete(e)}}function dg(e){lg(e,rg.get(e))}function fg(e){for(let t of[...e.querySelectorAll(eg)]){let e=t.parentElement;t.replaceWith(...t.childNodes),e?.normalize()}}function pg(e){let t=e.closest(`[data-code]`);return t?.hasAttribute(`data-deletions`)?`deletions`:t?.hasAttribute(`data-additions`)?`additions`:(e.getAttribute(`data-line-type`)||``).includes(`deletion`)?`deletions`:`additions`}function mg(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(eg)||n.push(e);return n}function hg(e,t,n){let r=0;for(let i=0;i<e.length;i++){let a=t[i].length;if(n<=r+a)return{node:e[i],offset:Math.min(a,Math.max(0,n-r))};r+=a}let i=e.at(-1);return i?{node:i,offset:t.at(-1)?.length??0}:null}function gg(e,t,n,r,i){let a=hg(e,t,n),o=hg(e,t,r);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset);let c=document.createElement(`mark`);c.className=i;try{c.append(s.extractContents()),s.insertNode(c)}catch{}}function _g(e,t,n,r){let i=mg(e);if(!i.length)return;let a=i.map(e=>e.textContent??``),o=a.join(``),s=n?o:o.toLowerCase(),c=[];for(let e=s.indexOf(t);e!==-1;e=s.indexOf(t,e+t.length))c.push([e,e+t.length]);if(!c.length)return;let l=pg(e),u=Number(e.getAttribute(`data-line`)),d=r&&r.line===u&&(r.side||`additions`)===l?`${$h} active`:$h;for(let e=c.length-1;e>=0;e--)gg(i,a,c[e][0],c[e][1],d)}function vg(e,t,n){let r=[e],i=e.querySelector(`diffs-container`)?.shadowRoot;i&&r.push(i);let a=t.trim(),o=/[A-Z]/.test(a),s=a&&!o?a.toLowerCase():a;for(let e of r)if(fg(e),s)for(let t of e.querySelectorAll(`[data-code] [data-line]`))_g(t,s,o,n)}function yg(e){let t=e.replace(/^origin\//,``),n=t.match(/^(?:[\w.-]+-)?ws-([^-]+)/i);if(n)return n[1];let r=t.includes(`/`)?t.slice(t.lastIndexOf(`/`)+1):t;return r.split(`-`)[0]||r}function bg(e,t){if(!t)return``;let n=e.replace(/^origin\//,``),r=t.replace(/^origin\//,``);return n.startsWith(`${r}-`)?n.slice(r.length+1):``}function xg(e){let t=e.match(/^(?:[\w.-]+-)?ws-([^-]+)/i);if(t)return t[1];if(e.length<=20)return e;let n=e.split(`-`);return n.length>1?n[n.length-1]:e}function Sg(e,t,n=``){let r=(e||`base`).replace(/^origin\//,``),i=(t||`HEAD`).replace(/^origin\//,``),a=(n||``).replace(/^origin\//,``),o=!!a&&(i===a||i.startsWith(`${a}-`));return{base:r,head:o?yg(a):xg(i),topic:o?bg(i,a):``,title:i===r?r:`${i} vs ${r}`}}function Cg(e,t=``){let n=e.replace(/^origin\//,``);if(!n||n===`HEAD`)return n||`HEAD`;let r=t.replace(/^origin\//,``);if(r&&(n===r||n.startsWith(`${r}-`))){let e=yg(r),t=bg(n,r);return t?`${e} [${t}]`:e}return xg(n)}var wg=3;function Tg(e,t){let n=new Map;for(let t of e)n.set(t.worktree,[...n.get(t.worktree)||[],t]);let r=[`Review feedback:`],i=0;for(let[e,a]of n){let n=(t||[]).find(t=>t.worktree===e);r.push(``),r.push(Eg(e,n));for(let e of a){i++;let t=n?.files.find(t=>t.path===e.path),a=e.side===`deletions`?t?.old:t?.new,o=e.side===`deletions`?`Old`:`New`,s=e.line_start===e.line_end?`line ${e.line_start}`:`lines ${e.line_start}-${e.line_end}`;if(r.push(``),r.push(`${i}. **${e.path}** (${o} ${s})`),a!=null){let t=Og(a,e.line_start,e.line_end,e.side),n=kg(t);r.push(``),r.push(Ag(`${n}diff\n${t}\n${n}`))}r.push(``),r.push(Ag(e.text))}}return r.join(`
4
4
  `)}function Eg(e,t){if(!t?.head)return`${e}/`;let n=Dg(t.head),r=Dg(t.baseSha),i=t.pr?.headRefName||t.branch||`HEAD`;return`${e}/${t.pr?` #${t.pr.number}`:``} — \`${i}\` ${n} vs \`${t.base}\` ${r}`}function Dg(e,t=12){return e.slice(0,t)}function Og(e,t,n,r){let i=e.split(`
5
5
  `),a=Math.max(1,t-wg),o=Math.min(i.length,n+wg),s=r===`deletions`?`-`:`+`,c=[];for(let e=a;e<=o;e++){let r=e>=t&&e<=n?s:` `;c.push(`${r}${String(e).padStart(4)} | ${i[e-1]??``}`)}return c.join(`
6
6
  `)}function kg(e){let t=3,n=/`+/g,r;for(;r=n.exec(e);)t=Math.max(t,r[0].length+1);return"`".repeat(t)}function Ag(e){return e.split(`
7
7
  `).map(e=>e&&` ${e}`).join(`
8
- `)}function jg(e){let t={dirs:new Map,files:[]};for(let n of e){let e=n.path.split(`/`),r=e.pop(),i=t;for(let t of e){let e=i.dirs.get(t);e||(e={dirs:new Map,files:[]},i.dirs.set(t,e)),i=e}i.files.push({file:n,name:r})}let n=[],r=(e,t,i)=>{for(let[a,o]of[...e.dirs].sort(([e],[t])=>e.localeCompare(t))){let e=a,s=o;for(;s.dirs.size===1&&!s.files.length;){let[[t,n]]=s.dirs;e+=`/${t}`,s=n}let c=i?`${i}/${e}`:e;n.push({kind:`dir`,label:e,path:c,depth:t}),r(s,t+1,c)}for(let{file:r,name:i}of e.files)n.push({kind:`file`,file:r,name:i,depth:t})};return r(t,0,``),n}var Mg=`_dN _G`,Ng=`_dO _H`,Pg=`_dR _G`,Fg=`_el _m`,Ig=`_en _l`,Lg=Ur,Rg=(e=>`/${e}&`)(Wr);function zg(e){Jr(e.a,`M15 6L9 12L15 18`)}var Bg=(e,t)=>Kr(e.a,t),Vg=(e,t)=>qr(e.a,t),Hg=`<div><input type=search placeholder="Filter files…" aria-label="Filter files"></div>`,Ug=` D l`,Wg=N(18,e=>jt(e,`b`,e.l,o_(e))),Gg=M(11,Wg),Kg=N(10,e=>Gg(e,(e.j??e.h)||``)),qg=M(17,Wg),Jg=N(16,e=>qg(e,s_(e))),Yg=M(15,Jg),Xg=N(14,e=>Yg(e,c_(e)),2),Zg=Ke(7,e=>{Kg(e),Xg(e)}),Qg=N(6,e=>Zg(e,e.e,e.f)),$g=M(4,Qg),e_=M(5,Qg),t_=j(9,e=>{Kg(e),Xg(e)}),n_=(e,t)=>a_(e,t.timer),r_=L(`j3`,e=>{Mt(e,`b`),A(e.b,`keydown`,function(t){t.key===`Enter`&&e.p(),t.key===`Escape`&&e.l&&(t.preventDefault(),e.r(``))})});function i_(e){B(e.a,`_fg`),B(e.b,`_fh`),t_(e,null),n_(e,{timer:0}),r_(e)}var a_=M(13,e=>{Xg(e),Jg(e)});function o_(e){return function(t){e.r(t)}}function s_(e){return t=>{if(e.n&&clearTimeout(e.n),!t){e.n=0,t_(e,null),Zg(e,``);return}t_(e,t),e.n=setTimeout(e.p,150)}}function c_(e){return()=>{e.n&&=(clearTimeout(e.n),0);let t=e.j===null?e.h||``:e.j;t_(e,null),Zg(e,t)}}R(`j0`,o_),R(`j2`,s_),R(`j1`,c_);var l_=`<span><button type=button title="Copy comments as markdown"> </button><!></span>`,u_=` D D l%l`,d_=(e,t)=>z(e.a,`value`,t),f_=N(7,e=>V(e.b,e.f||e.g)),p_=M(5,f_),m_=M(6,f_),h_=(e,t)=>{d_(e,t[0]?.id),p_(e,t[0]?.title),m_(e,t[0]?.agent)},g_=P(3,1,e=>{z(e.b,`disabled`,e._.k),V(e.c,e._.k?`Sending…`:`Send to`),z(e.d,`disabled`,e._.k)}),__=L(`g2`,e=>{A(e.b,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){k_(e._,!0);try{await e._.i(e._.s)}finally{k_(e._,!1)}}})()}),It(e,`d`)}),v_=e=>{g_._(e),y_._(e),x_._(e),B(e.a,mee),__(e)},y_=P(3,1,e=>Ft(e,`d`,e._.l,U_(e))),b_=k(3,`<option> </option>`,` D `,0,h_),x_=P(3,1,e=>b_(e,[e._.m,`id`])),S_=N(2,e=>V(e.b,e._.k?`Sending…`:`Send to ${e._.q||e._.r}`),2),C_=P(3,0,e=>{z(e.a,`disabled`,e._.k),S_(e)}),w_=L(`g1`,e=>A(e.a,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){k_(e._,!0);try{await e._.i(e._.s)}finally{k_(e._,!1)}}})()})),T_=e=>{C_._(e),E_._(e),D_._(e),B(e.a,[`_d`,`_e`]),w_(e)},E_=P(3,0,S_),D_=P(3,0,S_),O_=j(9,e=>V(e.c,e.j?`Copied ✓`:`Copy`)),k_=j(10,e=>{C_(e),g_(e)}),A_=M(18),j_=N(13,e=>A_(e,e.m.some(t=>t.id===e.l)?e.l:e.m[0]?.id??null)),M_=j(11,e=>{j_(e),y_(e)}),N_=L(`g3`,e=>A(e.b,`click`,function(){(async()=>{await e.h()&&(O_(e,!0),setTimeout(()=>{O_(e,!1)},1500))})()}));function P_(e){B(e.a,`_fi`),B(e.b,`_d`),O_(e,!1),k_(e,!1),M_(e,null),N_(e)}var F_=M(12,e=>{I_(e,e.m[0]?.title),L_(e,e.m[0]?.agent),z_(e,e.m.length),j_(e),x_(e)}),I_=M(16,E_),L_=M(17,D_),R_=O(3,`<button type=button> </button>`,` D `,T_,`<span><button type=button> </button><select aria-label="Send comments to session"></select></span>`,` D D l `,v_),z_=(e,t)=>R_(e,t===1?0:t?1:2),B_=(e,t)=>F_(e,t||[]),V_=M(7),H_=M(8);function U_(e){return t=>{M_(e._,t)}}R(`g0`,U_);var W_=`diffs-container`,G_=/(?=^diff --git)/gm,K_=/(?<=\n)/,q_=/^(---|\+\+\+)\s+([^\t\r\n]+)/,J_=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Y_=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,X_=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Z_=`header-prefix`,Q_=`header-filename-suffix`,$_=`header-metadata`,ev=`header-custom`,tv={dark:`pierre-dark`,light:`pierre-light`},nv=`data-theme-css`,rv=`data-unsafe-css`,iv=`data-diffs-scrollbar-measure`,av=`--diffs-scrollbar-gutter-measured`,ov=1e5,sv=Object.freeze({fromStart:0,fromEnd:0}),cv={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},lv={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},uv=new Set,dv=null;function fv(e){uv.add(e),dv??=requestAnimationFrame(mv)}function pv(e){uv.delete(e)&&uv.size===0&&dv!=null&&(cancelAnimationFrame(dv),dv=null)}function mv(e){let t=new Set(uv);uv.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}dv=uv.size>0?requestAnimationFrame(mv):null}function hv(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function gv(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function _v(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var vv=new TextEncoder,yv=new TextDecoder(`utf-8`,{ignoreBOM:!0}),bv=/[\uD800-\uDFFF]/,xv=1024,Sv=new Uint8Array(xv);function Cv(){Sv.length!==xv&&(Sv=new Uint8Array(xv))}function wv(e){if(e.length===0)return e;if(bv.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;Sv.length<t&&(Sv=new Uint8Array(t));let{written:n}=vv.encodeInto(e,Sv);return yv.decode(Sv.subarray(0,n))}function Tv(e,t){return e-(t===0?0:1)}function Ev(e,t){return Tv(e,t)+t}var Dv=4096,Ov=.5;function kv(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=jv(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}Av(t,e)}}function Av(e,t){let{hunkContent:n}=e;for(let e=1;e<n.length;e++){let r=n[e],i=n[e-1];if(r.type!==`change`||r.additions>0&&r.deletions>0||i.type!==`context`)continue;let a=r.additions>0,o=a?t.additionLines:t.deletionLines,s=a?r.additionLineIndex:r.deletionLineIndex,c=a?r.additions:r.deletions,l=o[s]??``;if(l.trim()!==``)continue;let u=!0;for(let e=1;e<c;e++)if(o[s+e]!==l){u=!1;break}if(!u)continue;let d=0;for(;d<i.lines&&t.additionLines[i.additionLineIndex+i.lines-1-d]===l;)d++;if(d===0||e===1&&d===i.lines)continue;r.additionLineIndex-=d,r.deletionLineIndex-=d;let f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,m=n[e+1];m?.type===`context`?(m.lines+=d,m.additionLineIndex=f,m.deletionLineIndex=p):n.splice(e+1,0,{type:`context`,lines:d,additionLineIndex:f,deletionLineIndex:p}),i.lines-=d,i.lines===0&&(n.splice(e-1,1),e--)}}function jv(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>Dv)return null;let c=[];for(let t=0;t<n;t++)c.push(Nv(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(Nv(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=Pv(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*Ov:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var Mv=/\s+/g;function Nv(e){return e.replace(Mv,``)}function Pv(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}function Fv(e,t){try{return Iv(e,t)}finally{Cv()}}function Iv(e,{cacheKey:t,isGitDiff:n=G_.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=Wv(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=Rv(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=Vv(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?Lv(i.contents):[],deletionLines:!l&&r!=null&&i!=null?Lv(r.contents):[],cacheKey:Kv(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(Y_),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=wv(r.trim()),n!==r&&(c.prevName=wv(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?J_:q_):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=wv(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=wv(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=wv(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=wv(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=wv(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=wv(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(X_)??[];t!=null&&(c.prevObjectId=wv(t)),n!=null&&(c.newObjectId=wv(n)),r!=null&&(c.mode=wv(r))}e.startsWith(`rename from `)&&(c.prevName=wv(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=wv(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
8
+ `)}function jg(e){let t={dirs:new Map,files:[]};for(let n of e){let e=n.path.split(`/`),r=e.pop(),i=t;for(let t of e){let e=i.dirs.get(t);e||(e={dirs:new Map,files:[]},i.dirs.set(t,e)),i=e}i.files.push({file:n,name:r})}let n=[],r=(e,t,i)=>{for(let[a,o]of[...e.dirs].sort(([e],[t])=>e.localeCompare(t))){let e=a,s=o;for(;s.dirs.size===1&&!s.files.length;){let[[t,n]]=s.dirs;e+=`/${t}`,s=n}let c=i?`${i}/${e}`:e;n.push({kind:`dir`,label:e,path:c,depth:t}),r(s,t+1,c)}for(let{file:r,name:i}of e.files)n.push({kind:`file`,file:r,name:i,depth:t})};return r(t,0,``),n}var Mg=`_c_ _y`,Ng=`_da _z`,Pg=`_dd _y`,Fg=`_dI _m`,Ig=`_dK _l`,Lg=Ur,Rg=(e=>`/${e}&`)(Wr);function zg(e){Jr(e.a,`M15 6L9 12L15 18`)}var Bg=(e,t)=>Kr(e.a,t),Vg=(e,t)=>qr(e.a,t),Hg=`<div><input type=search placeholder="Filter files…" aria-label="Filter files"></div>`,Ug=` D l`,Wg=N(18,e=>jt(e,`b`,e.l,o_(e))),Gg=M(11,Wg),Kg=N(10,e=>Gg(e,(e.j??e.h)||``)),qg=M(17,Wg),Jg=N(16,e=>qg(e,s_(e))),Yg=M(15,Jg),Xg=N(14,e=>Yg(e,c_(e)),2),Zg=Ke(7,e=>{Kg(e),Xg(e)}),Qg=N(6,e=>Zg(e,e.e,e.f)),$g=M(4,Qg),e_=M(5,Qg),t_=j(9,e=>{Kg(e),Xg(e)}),n_=(e,t)=>a_(e,t.timer),r_=L(`j3`,e=>{Mt(e,`b`),A(e.b,`keydown`,function(t){t.key===`Enter`&&e.p(),t.key===`Escape`&&e.l&&(t.preventDefault(),e.r(``))})});function i_(e){B(e.a,`_e2`),B(e.b,`_e3`),t_(e,null),n_(e,{timer:0}),r_(e)}var a_=M(13,e=>{Xg(e),Jg(e)});function o_(e){return function(t){e.r(t)}}function s_(e){return t=>{if(e.n&&clearTimeout(e.n),!t){e.n=0,t_(e,null),Zg(e,``);return}t_(e,t),e.n=setTimeout(e.p,150)}}function c_(e){return()=>{e.n&&=(clearTimeout(e.n),0);let t=e.j===null?e.h||``:e.j;t_(e,null),Zg(e,t)}}R(`j0`,o_),R(`j2`,s_),R(`j1`,c_);var l_=`<span><button type=button title="Copy comments as markdown"> </button><!></span>`,u_=` D D l%l`,d_=(e,t)=>z(e.a,`value`,t),f_=N(7,e=>V(e.b,e.f||e.g)),p_=M(5,f_),m_=M(6,f_),h_=(e,t)=>{d_(e,t[0]?.id),p_(e,t[0]?.title),m_(e,t[0]?.agent)},g_=P(3,1,e=>{z(e.b,`disabled`,e._.k),V(e.c,e._.k?`Sending…`:`Send to`),z(e.d,`disabled`,e._.k)}),__=L(`g2`,e=>{A(e.b,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){k_(e._,!0);try{await e._.i(e._.s)}finally{k_(e._,!1)}}})()}),It(e,`d`)}),v_=e=>{g_._(e),y_._(e),x_._(e),B(e.a,mee),__(e)},y_=P(3,1,e=>Ft(e,`d`,e._.l,U_(e))),b_=k(3,`<option> </option>`,` D `,0,h_),x_=P(3,1,e=>b_(e,[e._.m,`id`])),S_=N(2,e=>V(e.b,e._.k?`Sending…`:`Send to ${e._.q||e._.r}`),2),C_=P(3,0,e=>{z(e.a,`disabled`,e._.k),S_(e)}),w_=L(`g1`,e=>A(e.a,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){k_(e._,!0);try{await e._.i(e._.s)}finally{k_(e._,!1)}}})()})),T_=e=>{C_._(e),E_._(e),D_._(e),B(e.a,[`_d`,`_e`]),w_(e)},E_=P(3,0,S_),D_=P(3,0,S_),O_=j(9,e=>V(e.c,e.j?`Copied ✓`:`Copy`)),k_=j(10,e=>{C_(e),g_(e)}),A_=M(18),j_=N(13,e=>A_(e,e.m.some(t=>t.id===e.l)?e.l:e.m[0]?.id??null)),M_=j(11,e=>{j_(e),y_(e)}),N_=L(`g3`,e=>A(e.b,`click`,function(){(async()=>{await e.h()&&(O_(e,!0),setTimeout(()=>{O_(e,!1)},1500))})()}));function P_(e){B(e.a,`_eF`),B(e.b,`_d`),O_(e,!1),k_(e,!1),M_(e,null),N_(e)}var F_=M(12,e=>{I_(e,e.m[0]?.title),L_(e,e.m[0]?.agent),z_(e,e.m.length),j_(e),x_(e)}),I_=M(16,E_),L_=M(17,D_),R_=O(3,`<button type=button> </button>`,` D `,T_,`<span><button type=button> </button><select aria-label="Send comments to session"></select></span>`,` D D l `,v_),z_=(e,t)=>R_(e,t===1?0:t?1:2),B_=(e,t)=>F_(e,t||[]),V_=M(7),H_=M(8);function U_(e){return t=>{M_(e._,t)}}R(`g0`,U_);var W_=`diffs-container`,G_=/(?=^diff --git)/gm,K_=/(?<=\n)/,q_=/^(---|\+\+\+)\s+([^\t\r\n]+)/,J_=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Y_=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,X_=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Z_=`header-prefix`,Q_=`header-filename-suffix`,$_=`header-metadata`,ev=`header-custom`,tv={dark:`pierre-dark`,light:`pierre-light`},nv=`data-theme-css`,rv=`data-unsafe-css`,iv=`data-diffs-scrollbar-measure`,av=`--diffs-scrollbar-gutter-measured`,ov=1e5,sv=Object.freeze({fromStart:0,fromEnd:0}),cv={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},lv={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},uv=new Set,dv=null;function fv(e){uv.add(e),dv??=requestAnimationFrame(mv)}function pv(e){uv.delete(e)&&uv.size===0&&dv!=null&&(cancelAnimationFrame(dv),dv=null)}function mv(e){let t=new Set(uv);uv.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}dv=uv.size>0?requestAnimationFrame(mv):null}function hv(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function gv(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function _v(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var vv=new TextEncoder,yv=new TextDecoder(`utf-8`,{ignoreBOM:!0}),bv=/[\uD800-\uDFFF]/,xv=1024,Sv=new Uint8Array(xv);function Cv(){Sv.length!==xv&&(Sv=new Uint8Array(xv))}function wv(e){if(e.length===0)return e;if(bv.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;Sv.length<t&&(Sv=new Uint8Array(t));let{written:n}=vv.encodeInto(e,Sv);return yv.decode(Sv.subarray(0,n))}function Tv(e,t){return e-(t===0?0:1)}function Ev(e,t){return Tv(e,t)+t}var Dv=4096,Ov=.5;function kv(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=jv(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}Av(t,e)}}function Av(e,t){let{hunkContent:n}=e;for(let e=1;e<n.length;e++){let r=n[e],i=n[e-1];if(r.type!==`change`||r.additions>0&&r.deletions>0||i.type!==`context`)continue;let a=r.additions>0,o=a?t.additionLines:t.deletionLines,s=a?r.additionLineIndex:r.deletionLineIndex,c=a?r.additions:r.deletions,l=o[s]??``;if(l.trim()!==``)continue;let u=!0;for(let e=1;e<c;e++)if(o[s+e]!==l){u=!1;break}if(!u)continue;let d=0;for(;d<i.lines&&t.additionLines[i.additionLineIndex+i.lines-1-d]===l;)d++;if(d===0||e===1&&d===i.lines)continue;r.additionLineIndex-=d,r.deletionLineIndex-=d;let f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,m=n[e+1];m?.type===`context`?(m.lines+=d,m.additionLineIndex=f,m.deletionLineIndex=p):n.splice(e+1,0,{type:`context`,lines:d,additionLineIndex:f,deletionLineIndex:p}),i.lines-=d,i.lines===0&&(n.splice(e-1,1),e--)}}function jv(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>Dv)return null;let c=[];for(let t=0;t<n;t++)c.push(Nv(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(Nv(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=Pv(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*Ov:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var Mv=/\s+/g;function Nv(e){return e.replace(Mv,``)}function Pv(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}function Fv(e,t){try{return Iv(e,t)}finally{Cv()}}function Iv(e,{cacheKey:t,isGitDiff:n=G_.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=Wv(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=Rv(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=Vv(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?Lv(i.contents):[],deletionLines:!l&&r!=null&&i!=null?Lv(r.contents):[],cacheKey:Kv(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(Y_),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=wv(r.trim()),n!==r&&(c.prevName=wv(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?J_:q_):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=wv(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=wv(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=wv(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=wv(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=wv(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=wv(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(X_)??[];t!=null&&(c.prevObjectId=wv(t)),n!=null&&(c.newObjectId=wv(n)),r!=null&&(c.mode=wv(r))}e.startsWith(`rename from `)&&(c.prevName=wv(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=wv(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
9
9
  `||s[s.length-1]===`\r`||s[s.length-1]===`\r
10
10
  `||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:Kv(p.hunkContext),hunkSpecs:wv(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(a&&zv(t)&&!Bv(t))throw Error(`parsePatchContent: hunk has more lines than expected`);break}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=qv(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=Jv(t);(g==null||g.type!==`change`)&&(g=Yv(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=Jv(t);(g==null||g.type!==`change`)&&(g=Yv(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=Jv(t);(g==null||g.type!==`context`)&&(g=Yv(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=_v(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=_v(c.deletionLines[e]))}}}if(a&&(x!==b.additionCount||S!==b.deletionCount))throw Error(`parsePatchContent: hunk line count mismatch`);b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(Tv(b.additionStart,b.additionCount)-o,0),c.hunks.push(b),o=Ev(b.additionStart,b.additionCount);for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=Ev(e.additionStart,e.additionCount),n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),kv(c),c}}function Lv(e){let t=Rv(e);for(let e=0;e<t.length;e++)t[e]=wv(t[e]);return t}function Rv(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
11
11
  `,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function zv(e){let t=e[0];return t===`+`||t===`-`||t===` `}function Bv(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
@@ -32,7 +32,7 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en
32
32
  \f\r &>`.split(``),`\0
33
33
  \f\r "&'<=>\``.split(``)],[`\0
34
34
  \f\r "&'<=>\``.split(``),`\0
35
- \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Ox(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=_b);let l=kx(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!xx(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!ax(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function kx(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Ax(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Ax(e,t,n){let r=pb(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=Vb(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Dx.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Jb:Yb)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Vb(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Dx.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&qb(n,o)>qb(n,e.alternative)&&(o=e.alternative),s=o+Vb(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Dx.single:Dx.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var jx=[`<`,`&`];function Mx(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Vb(e.value,Object.assign({},r.settings.characterReferences,{subset:jx}))}function Nx(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Mx(e,t,n,r)}function Px(e,t,n,r){return r.all(e)}var Fx=yb(`type`,{invalid:Ix,unknown:Lx,handlers:{comment:Gb,doctype:Kb,element:Ox,raw:Nx,root:Px,text:Mx}});function Ix(e){throw Error("Expected node, not `"+e+"`")}function Lx(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Rx={},zx={},Bx=[];function Vx(e,t){let n=t||Rx,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Hx,all:Ux,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||zy,characterReferences:n.characterReferences||zx,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?_b:gb,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Hx(e,t,n){return Fx(e,t,n,this)}function Ux(e){let t=[],n=e&&e.children||Bx,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var Wx=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),pv(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||gv(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&Ry(e.composedPath())||(lS(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(lS(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(lS(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){lS(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();lS(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);lS(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=Yx(i)&&this.hoveredLine?.lineElement===i.lineElement;Jx(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),Jx(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Yx(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(Zx(i)&&p!=null){p(i);break}if(Xx(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!Yx(i))break;Jx(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,lS(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),lS(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),lS(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();Ry(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(Ly(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=Vx(Iy());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);qx(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(eS(t));if(qx(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(qx(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(qx(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&Ry(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=eS(e);if(t&&Ry(n))return;let r=tS(e);return r==null?this.pathFromAnnotationSlot(e):eS(r)}pathFromAnnotationSlot(e){let t=rS(nS(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:eS(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=iS(t)?t:iS(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}gv(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,fv(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{pv(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!oS(this.renderedSelectedLinesState,n),i=!oS(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);Qx(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=cS(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=cS(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:$x(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:$x(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:sS(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:sS(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Gx({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:Kx({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function Kx({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function qx(e){return e!=null&&`kind`in e&&e.kind===`line`}function Jx(e){return e!=null&&`kind`in e&&e.kind===`token`}function Yx(e){return qx(e)||Jx(e)}function Xx(e){return`type`in e&&e.type===`line-info`}function Zx(e){return`kind`in e&&e.kind===`merge-conflict-action`}function Qx(e){return e===`current`||e===`incoming`||e===`both`}function $x(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function eS(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function tS(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function nS(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function rS(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function iS(e){return e!=null&&typeof e.elementFromPoint==`function`}function aS(e,t){return e===t||gv(e??void 0,t??void 0)}function oS(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&aS(e?.range??null,t.range)}function sS(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function cS(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function lS(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var uS=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),pS(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?gS(t):_S(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:dS(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:fS(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&mS(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function dS(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function fS(e){return Math.max(Math.ceil(e),0)}function pS(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?mS(e,{codeWidthChanged:!0,numberWidthChanged:!0}):hS(e))}function mS(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function hS(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function gS(e){e.codeElement.isConnected&&hS(e)}function _S(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}var vS=new Map,yS=new Map,bS=new Map,xS=new Set;function SS(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!xS.has(t))return!1;return!0}function CS(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(xS.has(n.name))continue;let e=vS.get(n.name);e??(e=n,vS.set(n.name,e)),xS.add(e.name),t.loadLanguageSync(e.data)}}function wS(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var TS=Object.defineProperty,ES=Object.getOwnPropertyDescriptor,DS=Object.getOwnPropertyNames,OS=Object.prototype.hasOwnProperty,kS=(e,t)=>{let n={};for(var r in e)TS(n,r,{get:e[r],enumerable:!0});return t||TS(n,Symbol.toStringTag,{value:`Module`}),n},AS=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=DS(t),a=0,o=i.length,s;a<o;a++)s=i[a],!OS.call(e,s)&&s!==n&&TS(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ES(t,s))||r.enumerable});return e},jS=(e,t,n)=>(AS(e,t,`default`),n&&AS(n,t,`default`)),MS=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),NS=function(e){return`/`+e},PS={},K=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=NS(t,n),t=s(t),t in PS)return;PS[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:MS,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},FS=[{id:`abap`,name:`ABAP`,import:(()=>K(()=>import(`./_CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>K(()=>import(`./_Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>K(()=>import(`./_C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>K(()=>import(`./_CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>K(()=>import(`./__6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>K(()=>import(`./_DDsvxP8k.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>K(()=>import(`./_B2NkZVYt.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>K(()=>import(`./_U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>K(()=>import(`./_KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>K(()=>import(`./_BWNzPyR-.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>K(()=>import(`./_CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>K(()=>import(`./_4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>K(()=>import(`./_SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>K(()=>import(`./_Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>K(()=>import(`./_C_g0fhev.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>K(()=>import(`./_BWXHIvNe2.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>K(()=>import(`./_B7ZEbQpA2.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>K(()=>import(`./_qdxAdBWQ2.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>K(()=>import(`./_D-usSTwE2.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>K(()=>import(`./_DKpUyyne2.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>K(()=>import(`./_Ci_nEsc72.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>K(()=>import(`./_CUHmPFLl2.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>K(()=>import(`./_CYIUgYqB2.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>K(()=>import(`./_BCnAMUTQ2.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>K(()=>import(`./_CpYNKFv52.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>K(()=>import(`./_B67tNyB02.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>K(()=>import(`./_D0apG41V2.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>K(()=>import(`./_CQ2zXKGN2.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>K(()=>import(`./_kIpfj7zU2.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>K(()=>import(`./_B72m4Heg2.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>K(()=>import(`./_CtfBBspg2.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>K(()=>import(`./_DqKBuwfJ2.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>K(()=>import(`./_Bj61d0ZC2.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>K(()=>import(`./_CHpdg7T22.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>K(()=>import(`./_C8r90Shi2.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>K(()=>import(`./_oeQT6MSM2.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>K(()=>import(`./_BfM6eibe2.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>K(()=>import(`./_Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>K(()=>import(`./_DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>K(()=>import(`./_DOK3qs_j.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>K(()=>import(`./_vk5AMlte.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>K(()=>import(`./_oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>K(()=>import(`./_BKxOULLA.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>K(()=>import(`./_Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>K(()=>import(`./_CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>K(()=>import(`./_ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>K(()=>import(`./_qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>K(()=>import(`./_CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>K(()=>import(`./_BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>K(()=>import(`./_Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>K(()=>import(`./_woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>K(()=>import(`./_IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>K(()=>import(`./__5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>K(()=>import(`./_DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>K(()=>import(`./_DKIbpX1r.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>K(()=>import(`./_ByWtfiyC.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>K(()=>import(`./_BXsQSWWX.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>K(()=>import(`./_c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>K(()=>import(`./_BnSmLTYb.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>K(()=>import(`./_BaHq4SXp.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>K(()=>import(`./_DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>K(()=>import(`./_BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>K(()=>import(`./_C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>K(()=>import(`./_CQJs3lWb.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>K(()=>import(`./_CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>K(()=>import(`./_DmIc4jLQ.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>K(()=>import(`./_CY8IvGdO2.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>K(()=>import(`./_DYvRD3hg2.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>K(()=>import(`./_CBce3t8t2.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>K(()=>import(`./_CV2tkWYe2.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>K(()=>import(`./_DExj1W_82.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>K(()=>import(`./_Dl-2e7rI2.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>K(()=>import(`./_B_WEnwWZ2.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>K(()=>import(`./_CSRkHgEL2.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>K(()=>import(`./_BoX_Ofe92.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>K(()=>import(`./_BVpFyzyu2.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>K(()=>import(`./_D4T8Kx36.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>K(()=>import(`./_ilITqXS62.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>K(()=>import(`./_7GGW24-e2.js`),[]))},{id:`go`,name:`Go`,import:(()=>K(()=>import(`./_rLFTqkRN2.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>K(()=>import(`./_COW7ENXO.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>K(()=>import(`./_CacY0gHj2.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>K(()=>import(`./_CXQ9i19x2.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>K(()=>import(`./_eLpVB_Wq.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>K(()=>import(`./_DOMdlLi02.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>K(()=>import(`./_D8IpX4py2.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>K(()=>import(`./_C8oCnwJJ2.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>K(()=>import(`./_Dh228itO2.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>K(()=>import(`./_CxZEssPk2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>K(()=>import(`./_Cvrh5tZx2.js`),[]))},{id:`html`,name:`HTML`,import:(()=>K(()=>import(`./_C4VRIVt2.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>K(()=>import(`./_DnucOiTi2.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>K(()=>import(`./_CglqdFiD2.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>K(()=>import(`./_C2jFdMKg2.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>K(()=>import(`./_DLbMbJfH2.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>K(()=>import(`./_CZbG8q4J2.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>K(()=>import(`./_DsUTQ-LC2.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>K(()=>import(`./_B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>K(()=>import(`./_bqFlf3Pi.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>K(()=>import(`./_Cf990ZTV.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>K(()=>import(`./_BjchXZRW.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>K(()=>import(`./_MORbWdYO.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>K(()=>import(`./_CuXae0ve.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>K(()=>import(`./_BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>K(()=>import(`./_CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>K(()=>import(`./_CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>K(()=>import(`./_CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>K(()=>import(`./_DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>K(()=>import(`./_DCdPuEzi.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>K(()=>import(`./_D9nZPeON.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>K(()=>import(`./_D8kGoid1.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>K(()=>import(`./_CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>K(()=>import(`./_DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>K(()=>import(`./_C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>K(()=>import(`./_C78LMQ4R.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>K(()=>import(`./_CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>K(()=>import(`./_DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>K(()=>import(`./_DiZzZSjb.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>K(()=>import(`./_DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>K(()=>import(`./_BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>K(()=>import(`./_Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>K(()=>import(`./_DANQhsl6.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>K(()=>import(`./_C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>K(()=>import(`./_Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>K(()=>import(`./_BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>K(()=>import(`./_CR9ATfbr.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>K(()=>import(`./_D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>K(()=>import(`./_DYUI_qtj.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>K(()=>import(`./_DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>K(()=>import(`./_BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>K(()=>import(`./_BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>K(()=>import(`./_CFuIV2fl.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>K(()=>import(`./_DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>K(()=>import(`./_BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>K(()=>import(`./__X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>K(()=>import(`./_DWQbgPoS.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>K(()=>import(`./_DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>K(()=>import(`./_D-CiRcbK.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>K(()=>import(`./_BocyNiHx2.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>K(()=>import(`./_IvuFDN5E2.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>K(()=>import(`./_CjNLYCLg2.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>K(()=>import(`./_DHYfO66s2.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>K(()=>import(`./_D1A_Heim2.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>K(()=>import(`./_BsSzOQcm2.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>K(()=>import(`./_O90oeIOV2.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>K(()=>import(`./_B1RWQWA52.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>K(()=>import(`./_BUDT5pXO2.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>K(()=>import(`./_3FvrUJYy2.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>K(()=>import(`./_4ZHwLPI52.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>K(()=>import(`./_D20wuad5.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>K(()=>import(`./_DLtguS0M2.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>K(()=>import(`./_ot-7Btpt2.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>K(()=>import(`./_DGHpHOYJ2.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>K(()=>import(`./_BiJDBrnU2.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>K(()=>import(`./_C7UOKdEL2.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>K(()=>import(`./_BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>K(()=>import(`./_DNMTfnFr2.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>K(()=>import(`./_CCSX75yM2.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>K(()=>import(`./_DMgNhnYS2.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>K(()=>import(`./_iXnhIJG72.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>K(()=>import(`./_DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>K(()=>import(`./_BQBiYAA_.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>K(()=>import(`./_CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>K(()=>import(`./_9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>K(()=>import(`./_gzcpVVnB2.js`),[]))},{id:`qml`,name:`QML`,import:(()=>K(()=>import(`./_CMC5FOms.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>K(()=>import(`./_DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>K(()=>import(`./_Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>K(()=>import(`./_DITDEtIK.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>K(()=>import(`./_DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>K(()=>import(`./_B3gFvitq2.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>K(()=>import(`./__Fv6A47I.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>K(()=>import(`./_C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>K(()=>import(`./_CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>K(()=>import(`./_BLiEKrCj.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>K(()=>import(`./_BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>K(()=>import(`./_Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>K(()=>import(`./_VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>K(()=>import(`./_CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>K(()=>import(`./_Zjm8E5gs.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>K(()=>import(`./_Dl4EWW5M.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>K(()=>import(`./_Cfkwpbl82.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>K(()=>import(`./_CLG4Axpw.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>K(()=>import(`./_DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>K(()=>import(`./_BiFt_7mu2.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>K(()=>import(`./_DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>K(()=>import(`./_Di2tZObT.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>K(()=>import(`./_bTVj8UrX2.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>K(()=>import(`./_BM315xPC.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>K(()=>import(`./_B0Lbe-Ub.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>K(()=>import(`./_BdJRzcvC.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>K(()=>import(`./_BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>K(()=>import(`./_Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>K(()=>import(`./_Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>K(()=>import(`./_EPocSo4T.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>K(()=>import(`./_L8AbGenz.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>K(()=>import(`./_BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>K(()=>import(`./_BW-4hwO72.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>K(()=>import(`./_BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>K(()=>import(`./_DOuSJx7H.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>K(()=>import(`./_B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>K(()=>import(`./_DRFzGQ_P.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>K(()=>import(`./_BCr95U42.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>K(()=>import(`./_CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>K(()=>import(`./_Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>K(()=>import(`./_BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>K(()=>import(`./_CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>K(()=>import(`./_DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>K(()=>import(`./_CZd0xW_V2.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>K(()=>import(`./_CsZuTP-e2.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>K(()=>import(`./_DswuEJGm2.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>K(()=>import(`./_KKXFtWm1.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>K(()=>import(`./_CcmNWLt02.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>K(()=>import(`./_QIS_jvCk2.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>K(()=>import(`./_sltzmVWM2.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>K(()=>import(`./_B7kC4ECJ.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>K(()=>import(`./_ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>K(()=>import(`./_lXr5_a6k2.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>K(()=>import(`./_Bni2E818.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>K(()=>import(`./_BRdr0IET2.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>K(()=>import(`./_DI99ib-x2.js`),[]))},{id:`v`,name:`V`,import:(()=>K(()=>import(`./_DBj4K9d_2.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>K(()=>import(`./_zf12oZj62.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>K(()=>import(`./_DOwzaHZ02.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>K(()=>import(`./_B2gwz-sJ2.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>K(()=>import(`./_BroJfC0k2.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>K(()=>import(`./_DvXPmvsu2.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>K(()=>import(`./_BBC6FrOe2.js`),__vite__mapDeps([112,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>K(()=>import(`./_Bg7axLcI2.js`),__vite__mapDeps([113,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>K(()=>import(`./_Bct9DrCG2.js`),__vite__mapDeps([114,2,3,5,12,70,115])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>K(()=>import(`./_CgoNMtux2.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>K(()=>import(`./_ByWQv1Qj2.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>K(()=>import(`./_C8pVoKbM2.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>K(()=>import(`./_BsKzXJz42.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>K(()=>import(`./_ClFFjSW22.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>K(()=>import(`./_DdvCle-K2.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>K(()=>import(`./_DLL8P-h_2.js`),[]))},{id:`xml`,name:`XML`,import:(()=>K(()=>import(`./_BOb-Pn3q.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>K(()=>import(`./_BCIV1arR2.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>K(()=>import(`./_B7s0O6p8.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>K(()=>import(`./_BnlCZFoB2.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>K(()=>import(`./_CMLA9XwU2.js`),[]))}],IS=Object.fromEntries(FS.map(e=>[e.id,e.import])),LS=Object.fromEntries(FS.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),RS={...IS,...LS},zS=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>K(()=>import(`./_vGVdxbeo2.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>K(()=>import(`./_CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>K(()=>import(`./_DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>K(()=>import(`./_C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>K(()=>import(`./_Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>K(()=>import(`./_C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>K(()=>import(`./_CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>K(()=>import(`./_R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>K(()=>import(`./_DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>K(()=>import(`./_Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>K(()=>import(`./_BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>K(()=>import(`./_5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>K(()=>import(`./_sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>K(()=>import(`./_Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>K(()=>import(`./_C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>K(()=>import(`./_DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>K(()=>import(`./_Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>K(()=>import(`./_B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>K(()=>import(`./_EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>K(()=>import(`./_BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>K(()=>import(`./_B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>K(()=>import(`./_C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>K(()=>import(`./_BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>K(()=>import(`./_MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>K(()=>import(`./_BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>K(()=>import(`./_BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>K(()=>import(`./_BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>K(()=>import(`./_CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>K(()=>import(`./_DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>K(()=>import(`./_CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>K(()=>import(`./_Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>K(()=>import(`./_BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>K(()=>import(`./_BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>K(()=>import(`./_C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>K(()=>import(`./_DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>K(()=>import(`./_Bm3Qr25_2.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>K(()=>import(`./_2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>K(()=>import(`./_uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>K(()=>import(`./_CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>K(()=>import(`./_B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>K(()=>import(`./_BSWPekZh2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>K(()=>import(`./_DDpmG2fV2.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>K(()=>import(`./_B_bV9PQ92.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>K(()=>import(`./_DhmEMT882.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>K(()=>import(`./_eJ-hLW7d2.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>K(()=>import(`./_Cb4Vim4T2.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>K(()=>import(`./_CLwyXe_n2.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>K(()=>import(`./_D7Lr4KcI2.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>K(()=>import(`./_DQwYfKfQ2.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>K(()=>import(`./_DRFjx7u42.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>K(()=>import(`./_DX1BQOs82.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>K(()=>import(`./_aMsaMD1D2.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>K(()=>import(`./_8PwUyIlP2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>K(()=>import(`./_DO-qXg-I2.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>K(()=>import(`./_DnToyrRv2.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>K(()=>import(`./_B2OO5cIa2.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>K(()=>import(`./_4G7pJPwS2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>K(()=>import(`./_UdsmMDCL2.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>K(()=>import(`./_C1IUL_tW2.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>K(()=>import(`./_nFMaYfgc2.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>K(()=>import(`./_oM2G3aXe2.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>K(()=>import(`./_DdrHHSXu2.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>K(()=>import(`./_fwtXNY1n2.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>K(()=>import(`./_BZCL-v6S2.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>K(()=>import(`./_VbXTXTou2.js`),[]))}].map(e=>[e.id,e.import])),BS=t({createOnigurumaEngine:()=>mC,getDefaultWasmLoader:()=>pC,loadWasm:()=>sC,setDefaultWasmLoader:()=>fC}),VS=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function HS(){return 2147483648}function US(){return typeof performance<`u`?performance.now():Date.now()}var WS=(e,t)=>e+(t-e%t)%t;async function GS(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=HS();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,WS(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:US,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var KS=Object.defineProperty,qS=(e,t,n)=>t in e?KS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JS=(e,t,n)=>qS(e,typeof t==`symbol`?t:t+``,n),YS=null;function XS(e){throw new VS(e.UTF8ToString(e.getLastOnigError()))}var ZS=class e{constructor(t){JS(this,`utf16Length`),JS(this,`utf8Length`),JS(this,`utf16Value`),JS(this,`utf8Value`),JS(this,`utf16OffsetToUtf8`),JS(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},QS=class e{constructor(t){if(JS(this,`id`,++e.LAST_ID),JS(this,`_onigBinding`),JS(this,`content`),JS(this,`utf16Length`),JS(this,`utf8Length`),JS(this,`utf16OffsetToUtf8`),JS(this,`utf8OffsetToUtf16`),JS(this,`ptr`),!YS)throw new VS(`Must invoke loadWasm first.`);this._onigBinding=YS,this.content=t;let n=new ZS(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=YS.omalloc(1e4),e._sharedPtrInUse=!0,YS.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(YS)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};JS(QS,`LAST_ID`,0),JS(QS,`_sharedPtr`,0),JS(QS,`_sharedPtrInUse`,!1);var $S=QS,eC=class{constructor(e){if(JS(this,`_onigBinding`),JS(this,`_ptr`),!YS)throw new VS(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new ZS(e[r]);t[r]=i.createString(YS),n[r]=i.utf8Length}let r=YS.omalloc(4*e.length);YS.HEAPU32.set(t,r/4);let i=YS.omalloc(4*e.length);YS.HEAPU32.set(n,i/4);let a=YS.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)YS.ofree(t[n]);YS.ofree(i),YS.ofree(r),a===0&&XS(YS),this._onigBinding=YS,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new $S(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function tC(e){return typeof e.instantiator==`function`}function nC(e){return typeof e.default==`function`}function rC(e){return e.data!==void 0}function iC(e){return typeof Response<`u`&&e instanceof Response}function aC(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var oC;function sC(e){if(oC)return oC;async function t(){YS=await GS(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),tC(n)?n=await n.instantiator(t):nC(n)?n=await n.default(t):(rC(n)&&(n=n.data),iC(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await lC(n)(t):await uC(n)(t):aC(n)||n instanceof WebAssembly.Module?n=await cC(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await cC(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return oC=t(),oC}function cC(e){return t=>WebAssembly.instantiate(e,t)}function lC(e){return t=>WebAssembly.instantiateStreaming(e,t)}function uC(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var dC;function fC(e){dC=e}function pC(){return dC}async function mC(e){return e&&await sC(e),{createScanner(e){return new eC(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new $S(e)}}}var hC=kS({});jS(hC,BS);var gC=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function _C(e){return vC(e)}function vC(e){return Array.isArray(e)?yC(e):e instanceof RegExp?e:typeof e==`object`?bC(e):e}function yC(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=vC(e[n]);return t}function bC(e){let t={};for(let n in e)t[n]=vC(e[n]);return t}function xC(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function SC(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?SC(e.substring(0,e.length-1)):e.substr(~t+1)}var CC=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,wC=class{static hasCaptures(e){return e!==null&&(CC.lastIndex=0,CC.test(e))}static replaceCaptures(e,t,n){return e.replace(CC,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function TC(e,t){return e<t?-1:+(e>t)}function EC(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=TC(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function DC(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function OC(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var kC=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},AC=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(FC(e),t)}static createFromParsedTheme(e,t){return RC(e,t)}_cachedMatchRoot=new kC(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>MC(e.parent,t.parentScopes));return n?new PC(n.fontStyle,n.foreground,n.background):null}},jC=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function MC(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!NC(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function NC(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var PC=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function FC(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&DC(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&DC(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new IC(l,u,e,o,s,c)}}return n}var IC=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},LC=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(LC||{});function RC(e,t){e.sort((e,t)=>{let n=TC(e.scope,t.scope);return n!==0||(n=EC(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new zC(t),o=new PC(n,a.getId(r),a.getId(i)),s=new HC(new VC(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new AC(a,o,s)}var zC=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},BC=Object.freeze([]),VC=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||BC,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},HC=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),VC.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(EC(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new VC(e,t,n,r,i))}},UC=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=GC(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function WC(e){return e}function GC(e){return e}function KC(e,t){let n=[],r=JC(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(qC(i)){let e=[];do e.push(i),i=r.next();while(qC(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function qC(e){return!!e&&!!e.match(/[\w\.:]+/)}function JC(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function YC(e){typeof e.dispose==`function`&&e.dispose()}var XC=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ZC=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},QC=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},$C=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new XC(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new QC;for(let n of e)ew(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof XC){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function ew(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof XC?nw({baseGrammar:a,selfGrammar:i},r):tw(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new XC(e))}function tw(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];rw([r],t,n)}}function nw(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&rw(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&rw(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function rw(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?xC({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&rw(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=lw(i);switch(a.kind){case 0:nw({...t,selfGrammar:t.baseGrammar},n);break;case 1:nw(t,n);break;case 2:tw(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?tw(a.ruleName,i,n):nw(i,n)}else a.kind===4?n.add(new ZC(a.scopeName,a.ruleName)):n.add(new XC(a.scopeName))}}}var iw=class{kind=0},aw=class{kind=1},ow=class{constructor(e){this.ruleName=e}kind=2},sw=class{constructor(e){this.scopeName=e}kind=3},cw=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function lw(e){if(e===`$base`)return new iw;if(e===`$self`)return new aw;let t=e.indexOf(`#`);return t===-1?new sw(e):t===0?new ow(e.substring(1)):new cw(e.substring(0,t),e.substring(t+1))}var uw=/\\(\d+)/,dw=/\\(\d+)/g,fw=-1,pw=-2;function mw(e){return e}function hw(e){return e}var gw=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=wC.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=wC.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${SC(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:wC.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:wC.replaceCaptures(this._contentName,e,t)}},_w=class extends gw{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},vw=class extends gw{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Cw(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ww,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},yw=class extends gw{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ww,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},bw=class extends gw{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Cw(i,this.id),this.beginCaptures=a,this._end=new Cw(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ww;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},xw=class extends gw{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Cw(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Cw(o,pw),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ww;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ww,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},Sw=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new _w(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new vw(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=xC({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new yw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new xw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new bw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=lw(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof yw||e instanceof bw||e instanceof xw)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Cw=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&uw.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return dw.lastIndex=0,this.source.replace(dw,(e,t)=>OC(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ww=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Tw(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Tw(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Tw=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
35
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Ox(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=_b);let l=kx(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!xx(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!ax(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function kx(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Ax(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Ax(e,t,n){let r=pb(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=Vb(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Dx.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Jb:Yb)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Vb(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Dx.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&qb(n,o)>qb(n,e.alternative)&&(o=e.alternative),s=o+Vb(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Dx.single:Dx.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var jx=[`<`,`&`];function Mx(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Vb(e.value,Object.assign({},r.settings.characterReferences,{subset:jx}))}function Nx(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Mx(e,t,n,r)}function Px(e,t,n,r){return r.all(e)}var Fx=yb(`type`,{invalid:Ix,unknown:Lx,handlers:{comment:Gb,doctype:Kb,element:Ox,raw:Nx,root:Px,text:Mx}});function Ix(e){throw Error("Expected node, not `"+e+"`")}function Lx(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Rx={},zx={},Bx=[];function Vx(e,t){let n=t||Rx,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Hx,all:Ux,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||zy,characterReferences:n.characterReferences||zx,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?_b:gb,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Hx(e,t,n){return Fx(e,t,n,this)}function Ux(e){let t=[],n=e&&e.children||Bx,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var Wx=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),pv(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||gv(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&Ry(e.composedPath())||(lS(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(lS(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(lS(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){lS(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();lS(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);lS(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=Yx(i)&&this.hoveredLine?.lineElement===i.lineElement;Jx(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),Jx(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Yx(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(Zx(i)&&p!=null){p(i);break}if(Xx(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!Yx(i))break;Jx(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,lS(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),lS(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),lS(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();Ry(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(Ly(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=Vx(Iy());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);qx(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(eS(t));if(qx(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(qx(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(qx(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&Ry(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=eS(e);if(t&&Ry(n))return;let r=tS(e);return r==null?this.pathFromAnnotationSlot(e):eS(r)}pathFromAnnotationSlot(e){let t=rS(nS(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:eS(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=iS(t)?t:iS(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}gv(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,fv(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{pv(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!oS(this.renderedSelectedLinesState,n),i=!oS(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);Qx(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=cS(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=cS(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:$x(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:$x(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:sS(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:sS(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Gx({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:Kx({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function Kx({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function qx(e){return e!=null&&`kind`in e&&e.kind===`line`}function Jx(e){return e!=null&&`kind`in e&&e.kind===`token`}function Yx(e){return qx(e)||Jx(e)}function Xx(e){return`type`in e&&e.type===`line-info`}function Zx(e){return`kind`in e&&e.kind===`merge-conflict-action`}function Qx(e){return e===`current`||e===`incoming`||e===`both`}function $x(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function eS(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function tS(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function nS(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function rS(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function iS(e){return e!=null&&typeof e.elementFromPoint==`function`}function aS(e,t){return e===t||gv(e??void 0,t??void 0)}function oS(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&aS(e?.range??null,t.range)}function sS(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function cS(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function lS(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var uS=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),pS(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?gS(t):_S(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:dS(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:fS(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&mS(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function dS(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function fS(e){return Math.max(Math.ceil(e),0)}function pS(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?mS(e,{codeWidthChanged:!0,numberWidthChanged:!0}):hS(e))}function mS(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function hS(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function gS(e){e.codeElement.isConnected&&hS(e)}function _S(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}var vS=new Map,yS=new Map,bS=new Map,xS=new Set;function SS(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!xS.has(t))return!1;return!0}function CS(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(xS.has(n.name))continue;let e=vS.get(n.name);e??(e=n,vS.set(n.name,e)),xS.add(e.name),t.loadLanguageSync(e.data)}}function wS(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var TS=Object.defineProperty,ES=Object.getOwnPropertyDescriptor,DS=Object.getOwnPropertyNames,OS=Object.prototype.hasOwnProperty,kS=(e,t)=>{let n={};for(var r in e)TS(n,r,{get:e[r],enumerable:!0});return t||TS(n,Symbol.toStringTag,{value:`Module`}),n},AS=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=DS(t),a=0,o=i.length,s;a<o;a++)s=i[a],!OS.call(e,s)&&s!==n&&TS(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ES(t,s))||r.enumerable});return e},jS=(e,t,n)=>(AS(e,t,`default`),n&&AS(n,t,`default`)),MS=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),NS=function(e){return`/`+e},PS={},K=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=NS(t,n),t=s(t),t in PS)return;PS[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:MS,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},FS=[{id:`abap`,name:`ABAP`,import:(()=>K(()=>import(`./_CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>K(()=>import(`./_Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>K(()=>import(`./_C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>K(()=>import(`./_CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>K(()=>import(`./__6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>K(()=>import(`./_EcTBrSbd.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>K(()=>import(`./_CK57eBfx.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>K(()=>import(`./_U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>K(()=>import(`./_KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>K(()=>import(`./_BtlXwps-.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>K(()=>import(`./_CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>K(()=>import(`./_4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>K(()=>import(`./_SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>K(()=>import(`./_Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>K(()=>import(`./_oHnAhOiq.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>K(()=>import(`./_BWXHIvNe2.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>K(()=>import(`./_B7ZEbQpA2.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>K(()=>import(`./_qdxAdBWQ2.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>K(()=>import(`./_D-usSTwE2.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>K(()=>import(`./_DKpUyyne2.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>K(()=>import(`./_Ci_nEsc72.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>K(()=>import(`./_CUHmPFLl2.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>K(()=>import(`./_CYIUgYqB2.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>K(()=>import(`./_CxmlqqW12.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>K(()=>import(`./_CpYNKFv52.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>K(()=>import(`./_DPzh9We22.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>K(()=>import(`./_D0apG41V2.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>K(()=>import(`./_CQ2zXKGN2.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>K(()=>import(`./_kIpfj7zU2.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>K(()=>import(`./_Cp03K8j72.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>K(()=>import(`./_CtfBBspg2.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>K(()=>import(`./_DqKBuwfJ2.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>K(()=>import(`./_Bj61d0ZC2.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>K(()=>import(`./_B12yQQbd2.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>K(()=>import(`./_C8r90Shi2.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>K(()=>import(`./_oeQT6MSM2.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>K(()=>import(`./_DSb5aJbx2.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>K(()=>import(`./_Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>K(()=>import(`./_DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>K(()=>import(`./_CvDp4NJZ.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>K(()=>import(`./_yd7odEAs.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>K(()=>import(`./_oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>K(()=>import(`./_DHQLqogP.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>K(()=>import(`./_Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>K(()=>import(`./_CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>K(()=>import(`./_ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>K(()=>import(`./_qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>K(()=>import(`./_CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>K(()=>import(`./_BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>K(()=>import(`./_Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>K(()=>import(`./_woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>K(()=>import(`./_IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>K(()=>import(`./__5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>K(()=>import(`./_DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>K(()=>import(`./_D_Zit_pp.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>K(()=>import(`./_DFnRtdNh.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>K(()=>import(`./_Boa1CUha.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>K(()=>import(`./_c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>K(()=>import(`./_zLB-9r7D.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>K(()=>import(`./_BaHq4SXp.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>K(()=>import(`./_DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>K(()=>import(`./_BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>K(()=>import(`./_C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>K(()=>import(`./_CQJs3lWb.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>K(()=>import(`./_CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>K(()=>import(`./_DmIc4jLQ.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>K(()=>import(`./_CY8IvGdO2.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>K(()=>import(`./_DYvRD3hg2.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>K(()=>import(`./_CBce3t8t2.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>K(()=>import(`./_CV2tkWYe2.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>K(()=>import(`./_DExj1W_82.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>K(()=>import(`./_Dl-2e7rI2.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>K(()=>import(`./_a6SPz--f2.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>K(()=>import(`./_CSRkHgEL2.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>K(()=>import(`./_Dy3ee_fS2.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>K(()=>import(`./_RKdvAu9n2.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>K(()=>import(`./_DsIT1wDB.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>K(()=>import(`./_ilITqXS62.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>K(()=>import(`./_7GGW24-e2.js`),[]))},{id:`go`,name:`Go`,import:(()=>K(()=>import(`./_rLFTqkRN2.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>K(()=>import(`./_BAU6KG-h.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>K(()=>import(`./_CacY0gHj2.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>K(()=>import(`./_t8wmk8-H2.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>K(()=>import(`./_DaWbmgiB.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>K(()=>import(`./_BwCEKN3X2.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>K(()=>import(`./_D8IpX4py2.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>K(()=>import(`./_C8oCnwJJ2.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>K(()=>import(`./_Dh228itO2.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>K(()=>import(`./_CxZEssPk2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>K(()=>import(`./_Cvrh5tZx2.js`),[]))},{id:`html`,name:`HTML`,import:(()=>K(()=>import(`./_By4p-yp6.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>K(()=>import(`./_CULJ2MVA2.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>K(()=>import(`./_LyFFu4J72.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>K(()=>import(`./_BlfF1DXc2.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>K(()=>import(`./_DLbMbJfH2.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>K(()=>import(`./_CZbG8q4J2.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>K(()=>import(`./_DsUTQ-LC2.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>K(()=>import(`./_B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>K(()=>import(`./_CIyqQPOJ.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>K(()=>import(`./_BHLmP9J5.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>K(()=>import(`./_Ci-5oHFp.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>K(()=>import(`./_BQTrV1C2.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>K(()=>import(`./_rFAkd66p.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>K(()=>import(`./_BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>K(()=>import(`./_CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>K(()=>import(`./_CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>K(()=>import(`./_CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>K(()=>import(`./_DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>K(()=>import(`./_CQLk7EcY.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>K(()=>import(`./_5zAnG8_b.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>K(()=>import(`./_CsV5dOWU.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>K(()=>import(`./_CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>K(()=>import(`./_DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>K(()=>import(`./_C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>K(()=>import(`./_DML-mp8Z.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>K(()=>import(`./_CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>K(()=>import(`./_DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>K(()=>import(`./_Ch-k8j3L.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>K(()=>import(`./_DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>K(()=>import(`./_BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>K(()=>import(`./_Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>K(()=>import(`./_CTYKjish.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>K(()=>import(`./_C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>K(()=>import(`./_Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>K(()=>import(`./_BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>K(()=>import(`./_DDlaBvIf.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>K(()=>import(`./_D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>K(()=>import(`./_DtshxIqm.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>K(()=>import(`./_DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>K(()=>import(`./_BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>K(()=>import(`./_BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>K(()=>import(`./_CFuIV2fl.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>K(()=>import(`./_DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>K(()=>import(`./_BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>K(()=>import(`./__X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>K(()=>import(`./_DWQbgPoS.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>K(()=>import(`./_DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>K(()=>import(`./_0HFtYC9j.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>K(()=>import(`./_CUQCJnj92.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>K(()=>import(`./_IvuFDN5E2.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>K(()=>import(`./_CjNLYCLg2.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>K(()=>import(`./_DHYfO66s2.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>K(()=>import(`./_D1A_Heim2.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>K(()=>import(`./_BsSzOQcm2.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>K(()=>import(`./_O90oeIOV2.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>K(()=>import(`./_B1RWQWA52.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>K(()=>import(`./_BUDT5pXO2.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>K(()=>import(`./_BIb9glVD2.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>K(()=>import(`./_4ZHwLPI52.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>K(()=>import(`./_Dd9JhTP3.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>K(()=>import(`./_ChpDcY902.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>K(()=>import(`./_ot-7Btpt2.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>K(()=>import(`./_DGHpHOYJ2.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>K(()=>import(`./_BiJDBrnU2.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>K(()=>import(`./_C7UOKdEL2.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>K(()=>import(`./_BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>K(()=>import(`./_DNMTfnFr2.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>K(()=>import(`./_CCSX75yM2.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>K(()=>import(`./_DMgNhnYS2.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>K(()=>import(`./_iXnhIJG72.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>K(()=>import(`./_DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>K(()=>import(`./_g8rZMKlA.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>K(()=>import(`./_CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>K(()=>import(`./_9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>K(()=>import(`./_gzcpVVnB2.js`),[]))},{id:`qml`,name:`QML`,import:(()=>K(()=>import(`./_CMrgWit1.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>K(()=>import(`./_DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>K(()=>import(`./_Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>K(()=>import(`./_C4eToTSH.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>K(()=>import(`./_DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>K(()=>import(`./_B3gFvitq2.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>K(()=>import(`./_6jzzkyr3.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>K(()=>import(`./_C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>K(()=>import(`./_CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>K(()=>import(`./_Dtp3DbhR.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>K(()=>import(`./_BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>K(()=>import(`./_Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>K(()=>import(`./_VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>K(()=>import(`./_CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>K(()=>import(`./_kDVs_4yB.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>K(()=>import(`./_BNg95hln.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>K(()=>import(`./_Cfkwpbl82.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>K(()=>import(`./_DJpNULvH.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>K(()=>import(`./_DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>K(()=>import(`./_BiFt_7mu2.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>K(()=>import(`./_DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>K(()=>import(`./_BL0H8RTc.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>K(()=>import(`./_bTVj8UrX2.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>K(()=>import(`./_BM315xPC.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>K(()=>import(`./_CKtA_VfT.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>K(()=>import(`./_DoEzd4-6.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>K(()=>import(`./_BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>K(()=>import(`./_Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>K(()=>import(`./_Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>K(()=>import(`./_DuuJhr1w.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>K(()=>import(`./_L8AbGenz.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>K(()=>import(`./_BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>K(()=>import(`./_BHXi673w2.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>K(()=>import(`./_BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>K(()=>import(`./_BBa9QG56.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>K(()=>import(`./_B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>K(()=>import(`./_BYcdvOlZ.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>K(()=>import(`./_Ch2s5Yl1.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>K(()=>import(`./_CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>K(()=>import(`./_Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>K(()=>import(`./_BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>K(()=>import(`./_CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>K(()=>import(`./_DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>K(()=>import(`./_CZd0xW_V2.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>K(()=>import(`./_Bl0uloCS2.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>K(()=>import(`./_DswuEJGm2.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>K(()=>import(`./_DE2lMRoV.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>K(()=>import(`./_CcmNWLt02.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>K(()=>import(`./_Dtyrasyh2.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>K(()=>import(`./_sltzmVWM2.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>K(()=>import(`./_CoiAbeQ8.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>K(()=>import(`./_ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>K(()=>import(`./_BF6FAj1Y2.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>K(()=>import(`./_DK6ZJVn2.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>K(()=>import(`./_BRdr0IET2.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>K(()=>import(`./_DI99ib-x2.js`),[]))},{id:`v`,name:`V`,import:(()=>K(()=>import(`./_DBj4K9d_2.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>K(()=>import(`./_zf12oZj62.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>K(()=>import(`./_DOwzaHZ02.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>K(()=>import(`./_B2gwz-sJ2.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>K(()=>import(`./_BroJfC0k2.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>K(()=>import(`./_DvXPmvsu2.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>K(()=>import(`./_nmjNS1SP2.js`),__vite__mapDeps([112,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>K(()=>import(`./_CvNPU6mj2.js`),__vite__mapDeps([113,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>K(()=>import(`./_CPWwxTeC2.js`),__vite__mapDeps([114,2,3,5,12,70,115])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>K(()=>import(`./_CgoNMtux2.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>K(()=>import(`./_ByWQv1Qj2.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>K(()=>import(`./_C8pVoKbM2.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>K(()=>import(`./_BsKzXJz42.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>K(()=>import(`./_ClFFjSW22.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>K(()=>import(`./_DdvCle-K2.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>K(()=>import(`./_DLL8P-h_2.js`),[]))},{id:`xml`,name:`XML`,import:(()=>K(()=>import(`./_08Vl4BnZ.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>K(()=>import(`./_C-u7G7Rc2.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>K(()=>import(`./_4lBAOiBs.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>K(()=>import(`./_BnlCZFoB2.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>K(()=>import(`./_CMLA9XwU2.js`),[]))}],IS=Object.fromEntries(FS.map(e=>[e.id,e.import])),LS=Object.fromEntries(FS.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),RS={...IS,...LS},zS=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>K(()=>import(`./_vGVdxbeo2.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>K(()=>import(`./_CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>K(()=>import(`./_DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>K(()=>import(`./_C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>K(()=>import(`./_Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>K(()=>import(`./_C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>K(()=>import(`./_CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>K(()=>import(`./_R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>K(()=>import(`./_DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>K(()=>import(`./_Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>K(()=>import(`./_BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>K(()=>import(`./_5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>K(()=>import(`./_sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>K(()=>import(`./_Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>K(()=>import(`./_C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>K(()=>import(`./_DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>K(()=>import(`./_Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>K(()=>import(`./_B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>K(()=>import(`./_EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>K(()=>import(`./_BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>K(()=>import(`./_B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>K(()=>import(`./_C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>K(()=>import(`./_BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>K(()=>import(`./_MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>K(()=>import(`./_BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>K(()=>import(`./_BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>K(()=>import(`./_BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>K(()=>import(`./_CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>K(()=>import(`./_DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>K(()=>import(`./_CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>K(()=>import(`./_Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>K(()=>import(`./_BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>K(()=>import(`./_BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>K(()=>import(`./_C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>K(()=>import(`./_DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>K(()=>import(`./_Bm3Qr25_2.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>K(()=>import(`./_2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>K(()=>import(`./_uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>K(()=>import(`./_CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>K(()=>import(`./_B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>K(()=>import(`./_BSWPekZh2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>K(()=>import(`./_DDpmG2fV2.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>K(()=>import(`./_B_bV9PQ92.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>K(()=>import(`./_DhmEMT882.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>K(()=>import(`./_eJ-hLW7d2.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>K(()=>import(`./_Cb4Vim4T2.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>K(()=>import(`./_CLwyXe_n2.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>K(()=>import(`./_D7Lr4KcI2.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>K(()=>import(`./_DQwYfKfQ2.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>K(()=>import(`./_DRFjx7u42.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>K(()=>import(`./_DX1BQOs82.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>K(()=>import(`./_aMsaMD1D2.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>K(()=>import(`./_8PwUyIlP2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>K(()=>import(`./_DO-qXg-I2.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>K(()=>import(`./_DnToyrRv2.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>K(()=>import(`./_B2OO5cIa2.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>K(()=>import(`./_4G7pJPwS2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>K(()=>import(`./_UdsmMDCL2.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>K(()=>import(`./_C1IUL_tW2.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>K(()=>import(`./_nFMaYfgc2.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>K(()=>import(`./_oM2G3aXe2.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>K(()=>import(`./_DdrHHSXu2.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>K(()=>import(`./_fwtXNY1n2.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>K(()=>import(`./_BZCL-v6S2.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>K(()=>import(`./_VbXTXTou2.js`),[]))}].map(e=>[e.id,e.import])),BS=t({createOnigurumaEngine:()=>mC,getDefaultWasmLoader:()=>pC,loadWasm:()=>sC,setDefaultWasmLoader:()=>fC}),VS=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function HS(){return 2147483648}function US(){return typeof performance<`u`?performance.now():Date.now()}var WS=(e,t)=>e+(t-e%t)%t;async function GS(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=HS();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,WS(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:US,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var KS=Object.defineProperty,qS=(e,t,n)=>t in e?KS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JS=(e,t,n)=>qS(e,typeof t==`symbol`?t:t+``,n),YS=null;function XS(e){throw new VS(e.UTF8ToString(e.getLastOnigError()))}var ZS=class e{constructor(t){JS(this,`utf16Length`),JS(this,`utf8Length`),JS(this,`utf16Value`),JS(this,`utf8Value`),JS(this,`utf16OffsetToUtf8`),JS(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},QS=class e{constructor(t){if(JS(this,`id`,++e.LAST_ID),JS(this,`_onigBinding`),JS(this,`content`),JS(this,`utf16Length`),JS(this,`utf8Length`),JS(this,`utf16OffsetToUtf8`),JS(this,`utf8OffsetToUtf16`),JS(this,`ptr`),!YS)throw new VS(`Must invoke loadWasm first.`);this._onigBinding=YS,this.content=t;let n=new ZS(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=YS.omalloc(1e4),e._sharedPtrInUse=!0,YS.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(YS)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};JS(QS,`LAST_ID`,0),JS(QS,`_sharedPtr`,0),JS(QS,`_sharedPtrInUse`,!1);var $S=QS,eC=class{constructor(e){if(JS(this,`_onigBinding`),JS(this,`_ptr`),!YS)throw new VS(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new ZS(e[r]);t[r]=i.createString(YS),n[r]=i.utf8Length}let r=YS.omalloc(4*e.length);YS.HEAPU32.set(t,r/4);let i=YS.omalloc(4*e.length);YS.HEAPU32.set(n,i/4);let a=YS.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)YS.ofree(t[n]);YS.ofree(i),YS.ofree(r),a===0&&XS(YS),this._onigBinding=YS,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new $S(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function tC(e){return typeof e.instantiator==`function`}function nC(e){return typeof e.default==`function`}function rC(e){return e.data!==void 0}function iC(e){return typeof Response<`u`&&e instanceof Response}function aC(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var oC;function sC(e){if(oC)return oC;async function t(){YS=await GS(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),tC(n)?n=await n.instantiator(t):nC(n)?n=await n.default(t):(rC(n)&&(n=n.data),iC(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await lC(n)(t):await uC(n)(t):aC(n)||n instanceof WebAssembly.Module?n=await cC(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await cC(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return oC=t(),oC}function cC(e){return t=>WebAssembly.instantiate(e,t)}function lC(e){return t=>WebAssembly.instantiateStreaming(e,t)}function uC(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var dC;function fC(e){dC=e}function pC(){return dC}async function mC(e){return e&&await sC(e),{createScanner(e){return new eC(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new $S(e)}}}var hC=kS({});jS(hC,BS);var gC=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function _C(e){return vC(e)}function vC(e){return Array.isArray(e)?yC(e):e instanceof RegExp?e:typeof e==`object`?bC(e):e}function yC(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=vC(e[n]);return t}function bC(e){let t={};for(let n in e)t[n]=vC(e[n]);return t}function xC(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function SC(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?SC(e.substring(0,e.length-1)):e.substr(~t+1)}var CC=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,wC=class{static hasCaptures(e){return e!==null&&(CC.lastIndex=0,CC.test(e))}static replaceCaptures(e,t,n){return e.replace(CC,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function TC(e,t){return e<t?-1:+(e>t)}function EC(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=TC(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function DC(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function OC(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var kC=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},AC=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(FC(e),t)}static createFromParsedTheme(e,t){return RC(e,t)}_cachedMatchRoot=new kC(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>MC(e.parent,t.parentScopes));return n?new PC(n.fontStyle,n.foreground,n.background):null}},jC=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function MC(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!NC(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function NC(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var PC=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function FC(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&DC(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&DC(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new IC(l,u,e,o,s,c)}}return n}var IC=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},LC=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(LC||{});function RC(e,t){e.sort((e,t)=>{let n=TC(e.scope,t.scope);return n!==0||(n=EC(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new zC(t),o=new PC(n,a.getId(r),a.getId(i)),s=new HC(new VC(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new AC(a,o,s)}var zC=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},BC=Object.freeze([]),VC=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||BC,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},HC=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),VC.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(EC(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new VC(e,t,n,r,i))}},UC=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=GC(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function WC(e){return e}function GC(e){return e}function KC(e,t){let n=[],r=JC(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(qC(i)){let e=[];do e.push(i),i=r.next();while(qC(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function qC(e){return!!e&&!!e.match(/[\w\.:]+/)}function JC(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function YC(e){typeof e.dispose==`function`&&e.dispose()}var XC=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ZC=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},QC=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},$C=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new XC(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new QC;for(let n of e)ew(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof XC){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function ew(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof XC?nw({baseGrammar:a,selfGrammar:i},r):tw(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new XC(e))}function tw(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];rw([r],t,n)}}function nw(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&rw(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&rw(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function rw(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?xC({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&rw(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=lw(i);switch(a.kind){case 0:nw({...t,selfGrammar:t.baseGrammar},n);break;case 1:nw(t,n);break;case 2:tw(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?tw(a.ruleName,i,n):nw(i,n)}else a.kind===4?n.add(new ZC(a.scopeName,a.ruleName)):n.add(new XC(a.scopeName))}}}var iw=class{kind=0},aw=class{kind=1},ow=class{constructor(e){this.ruleName=e}kind=2},sw=class{constructor(e){this.scopeName=e}kind=3},cw=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function lw(e){if(e===`$base`)return new iw;if(e===`$self`)return new aw;let t=e.indexOf(`#`);return t===-1?new sw(e):t===0?new ow(e.substring(1)):new cw(e.substring(0,t),e.substring(t+1))}var uw=/\\(\d+)/,dw=/\\(\d+)/g,fw=-1,pw=-2;function mw(e){return e}function hw(e){return e}var gw=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=wC.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=wC.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${SC(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:wC.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:wC.replaceCaptures(this._contentName,e,t)}},_w=class extends gw{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},vw=class extends gw{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Cw(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ww,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},yw=class extends gw{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ww,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},bw=class extends gw{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Cw(i,this.id),this.beginCaptures=a,this._end=new Cw(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ww;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},xw=class extends gw{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Cw(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Cw(o,pw),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ww;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ww,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},Sw=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new _w(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new vw(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=xC({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new yw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new xw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new bw(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=lw(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof yw||e instanceof bw||e instanceof xw)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Cw=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&uw.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return dw.lastIndex=0,this.source.replace(dw,(e,t)=>OC(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ww=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Tw(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Tw(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Tw=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
36
36
  `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ew=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Dw=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Ew(e,8),this._embeddedLanguagesMatcher=new Ow(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Ew(0,0);_getBasicScopeAttributes=new kC(e=>new Ew(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Ow=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>OC(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var kw=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Aw(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=jw(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new kw(i,!0);f()}return new kw(i,!1);function f(){let o=Mw(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===fw){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Lw(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof bw){let r=o;Lw(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof xw){let r=o;Lw(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Lw(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function jw(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof xw&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Iw(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==pw){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Lw(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Mw(e,t,n,r,i,a){let o=Nw(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Pw(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Nw(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Fw(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Pw(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Fw(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Fw(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Iw(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Lw(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Aw(e,p,n&&d.start===0,d.start,f,i,!1,0),YC(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Rw(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Rw=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function zw(e,t,n,r,i,a,o,s){return new Uw(e,t,n,r,i,a,o,s)}function Bw(e,t,n,r,i){let a=KC(t,Vw),o=Sw.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Vw(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Hw(t[r],e))return n=r+1,!0;return!1})}function Hw(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var Uw=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Dw(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ww(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=KC(e,Vw);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Bw(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Bw(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(mw(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[hw(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Ww(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Sw.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Kw.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=UC.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?Gw.createRootAndLookUpScopeName(a,r,this):Gw.createRoot(`unknown`,r),t=new Kw(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
37
37
  `;let a=this.createOnigString(e),o=a.content.length,s=new Jw(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Aw(this,a,i,0,t,s,!0,r);return YC(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Ww(e,t){return e=_C(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Gw=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=jC.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new jC(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new jC(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),UC.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Kw=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Gw.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:hw(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Gw.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,mw(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Gw.fromExtension(r,n.contentNameScopesList))}},qw=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):KC(e,Vw).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>KC(e,Vw).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Jw=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=UC.set(n,0,WC(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=UC.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Yw=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,zw(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Xw=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Yw(AC.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(AC.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new qw(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new $C(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Zw=Kw.NULL;function Qw(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function $w(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function eT(e){return Array.isArray(e)?e:[e]}async function tT(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function nT(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function rT(e){return e===`ansi`||nT(e)}function iT(e){return e===`none`}function aT(e){return iT(e)}var oT=/(\r?\n)/g;function sT(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(oT),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var cT={light:`#333333`,dark:`#bbbbbb`},lT={light:`#fffffe`,dark:`#1e1e1e`},uT=`__shiki_resolved`;function dT(e){if(e?.[uT])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?cT.light:cT.dark,n||=t.type===`light`?lT.light:lT.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,uT,{enumerable:!1,writable:!1,value:!0}),t}async function fT(e){return[...new Set((await Promise.all(e.filter(e=>!rT(e)).map(async e=>await tT(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function pT(e){return(await Promise.all(e.map(async e=>aT(e)?null:dT(await tT(e))))).filter(e=>!!e)}function mT(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new gC(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var hT=class extends Xw{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=dT(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=AC.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=mT(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new gC(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},gT=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},_T=0;function vT(e){_T+=1,e.warnings!==!1&&_T>=10&&_T%10==0&&console.warn(`[Shiki] ${_T} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new gC("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(dT),i=new hT(new gT(e.engine,n),r,n,e.langAlias),a;function o(t){return mT(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new gC(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new gC(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await fT(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await pT(e))}function g(){if(t)throw new gC(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--_T)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function yT(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([pT(e.themes||[]),fT(e.langs||[]),e.engine]);return vT({...e,themes:t,langs:n,engine:r})}var bT=new WeakMap;function xT(e,t){bT.set(e,t)}function ST(e){return bT.get(e)}var CT=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(eT(n).map(e=>[e,Zw])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return wT(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function wT(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function TT(e,t){if(!(e instanceof CT))throw new gC(`Invalid grammar state`);return e.getInternalStack(t)}var ET=/,/,DT=/ /;function OT(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(nT(e.resolveLangAlias(n.lang||`text`))||iT(r))return sT(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new gC(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new gC(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return AT(t,o,i,a,n)}function kT(...e){if(e.length===2)return ST(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(nT(i)||iT(a))throw new gC(`Plain language does not have grammar state`);if(i===`ansi`)throw new gC(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new CT(jT(n,c,o,s,r).stateStack,c.name,o.name)}function AT(e,t,n,r,i){let a=jT(e,t,n,r,i),o=new CT(a.stateStack,t.name,n.name);return xT(a.tokens,o),a.tokens}function jT(e,t,n,r,i){let a=Qw(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=sT(e),u=i.grammarState?TT(i.grammarState,n.name)??Zw:i.grammarContextCode==null?Zw:jT(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=$w(r[UC.getForeground(s)],a),u=UC.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=UC.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(ET).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(DT))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?MT(t.scopes):NT(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function MT(e){return e.map(e=>({scopeName:e}))}function NT(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:IT(e,i,t.slice(0,r))}}return n}function PT(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function FT(e,t,n){if(!PT(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)PT(e[r],n[i])&&--r,--i;return r===-1}function IT(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(FT(e,t,n)){r.push(a);break}return r}function LT(e,t,n,r=OT){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:ST(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=RT(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new CT(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&xT(s,c),s}function RT(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var zT=/\s+/g;function BT(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(zT)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(zT);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var VT=/:?lang=["']([^"']+)["']/g,HT=/(?:```|~~~)([\w-]+)/g,UT=/\\begin\{([\w-]+)\}/g,WT=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,GT=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function KT(e){let t=sT(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function qT(e,t,n){let r=new Set;for(let t of e.matchAll(VT)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(HT)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(UT)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(WT)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(GT.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var JT=[`color`,`background-color`];function YT(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function XT(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function ZT(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=XT(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return YT(e,a)})):e}function QT(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>$T(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&JT.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new gC('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function $T(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&LC.Italic&&(t[`font-style`]=`italic`),e.fontStyle&LC.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&LC.Underline&&n.push(`underline`),e.fontStyle&LC.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function eE(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function tE(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=KT(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new gC(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new gC(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new gC(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));nE(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return ZT(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new gC(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=rE(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new gC(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new gC(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&BT(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function nE(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new gC(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new gC(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function rE(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(rE).join(``):``}var iE=[tE()];function aE(e){let t=oE(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...iE]}function oE(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var sE=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],cE={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function lE(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function uE(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function dE(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)cE[r]&&t.push({type:`setDecoration`,value:cE[r]});else if(r<=29){let e=cE[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:sE[r-30]}});else if(r===38){let n=uE(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:sE[r-40]}});else if(r===48){let n=uE(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:sE[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:sE[r-100+8]}})}}return t}function fE(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=lE(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=dE(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var pE={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function mE(e=pE){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<sE.length;e++)r.push(t(sE[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var hE=/#([0-9a-f]{3,8})/i,gE=/var\((--[\w-]+-ansi-[\w-]+)\)/,_E={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function vE(e,t,n){let r=Qw(e,n),i=sT(t),a=mE(Object.fromEntries(sE.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||_E[t]]}))),o=fE();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=$w(i,r),o=$w(o,r),n.decorations.has(`dim`)&&(i=yE(i));let s=LC.None;return n.decorations.has(`bold`)&&(s|=LC.Bold),n.decorations.has(`italic`)&&(s|=LC.Italic),n.decorations.has(`underline`)&&(s|=LC.Underline),n.decorations.has(`strikethrough`)&&(s|=LC.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function yE(e){let t=e.match(hE);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(gE);return n?`var(${n[1]}-dim)`:e}function bE(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!nT(r)&&!iT(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return vE(r,t,n)}return OT(e,t,n)}function xE(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new gC("`themes` option must not be empty");let p=LT(e,t,n,bE);if(c=ST(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new gC(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>QT(e,h,u,l,d))),c&&xT(a,c);let g=f.map(e=>Qw(e.theme,n));i=SE(f,m,g,u,l,`fg`,d),r=SE(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=Qw(n.theme,n);a=bE(e,t,n);let l=e.getTheme(n.theme);r=$w(l.bg,s),i=$w(l.fg,s),o=l.name,c=ST(a)}else throw new gC("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function SE(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=$w(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new gC('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${$w(t[r][a],n[r])||`inherit`}, ${$w(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var CE=/^\s+$/,wE=/^(\s*)(.*?)(\s*)$/;function TE(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>TE(e,t,n),codeToTokens:(t,n)=>xE(e,t,n)}){let i=t;for(let e of aE(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=xE(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=DE(a):d===`never`&&(a=OE(a)),f&&(a=kE(a));let p={...r,get source(){return i}};for(let e of aE(n))a=e.tokens?.call(p,a)||a;return EE(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function EE(e,t,n,r=ST(e)){let i=aE(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:BT,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
38
38
  `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=eE(a.htmlStyle||$T(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&xT(m,r),m}function DE(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&LC.Underline||i.fontStyle&LC.Strikethrough));o&&CE.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function OE(e){return e.map(e=>e.flatMap(e=>{if(CE.test(e.content))return e;let t=e.content.match(wE);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function kE(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=eE(e.htmlStyle||$T(e)),i=eE(n.htmlStyle||$T(n)),a=e.fontStyle&&(e.fontStyle&LC.Underline||e.fontStyle&LC.Strikethrough),o=n.fontStyle&&(n.fontStyle&LC.Underline||n.fontStyle&LC.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var AE=Vx;function jE(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>TE(e,t,n),codeToTokens:(t,n)=>xE(e,t,n)},i=AE(TE(e,t,n,r));for(let e of aE(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Rne(e){let t=await yT(e);return{getLastGrammarState:(...e)=>kT(t,...e),codeToTokensBase:(e,n)=>bE(t,e,n),codeToTokensWithThemes:(e,n)=>LT(t,e,n),codeToTokens:(e,n)=>xE(t,e,n),codeToHast:(e,n)=>TE(t,e,n),codeToHtml:(e,n)=>jE(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function ME(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,rT(n))return[];let r=t[n];if(!r)throw new gC(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(aT(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new gC(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Rne({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function NE(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function PE(e,t){let n=NE(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var FE=ME({langs:RS,themes:zS,engine:()=>(0,hC.createOnigurumaEngine)(K(()=>import(`./_BnjxR4X6.js`),[]))}),{codeToHtml:zne,codeToHast:Bne,codeToTokens:Vne,codeToTokensBase:Hne,codeToTokensWithThemes:Une,getSingletonHighlighter:Wne,getLastGrammarState:Gne}=PE(FE,{guessEmbeddedLanguages:qT}),IE=4294967295,LE=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:IE,end:IE,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function RE(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function zE(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var BE=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),VE=String.raw;function HE(e,t){if(e==null)throw Error(t??`Value expected`);return e}var UE=VE`\[\^?`,WE=`c.? | C(?:-.?)?|${VE`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${VE`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${VE`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${VE`o\{[^\}]*\}?`}|${VE`\d{1,3}`}`,GE=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,KE=new RegExp(VE`
@@ -1529,7 +1529,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[fO(e),e])),Zne=new Map([[`s`,UO(383)],[UO(38
1529
1529
  `))return`
1530
1530
  `;if(t.endsWith(`\r`))return`\r`}return`
1531
1531
  `}function nj(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function ioe(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function aoe(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function ooe(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function soe(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function rj({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function coe(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:Yie(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function loe(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var uoe=-1,doe=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++uoe}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:tv},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new uS,this.scrollSyncManager=new cae,this.interactionManager=new Wx(`diff`,Gx(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return coe(e)}createHunksRenderer(e){return new Zae(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=Tv(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e<c){let t=c-e;i=Math.max(u-t,0),a=Math.max(l-t,0);break hunkIterator}if(e>=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`){if(e<c+n.lines){let t=e-c;a=l+t,i=u+t;break hunkIterator}c+=n.lines,l+=n.lines,u+=n.lines}else{let r=t===`deletions`?n.deletions:n.additions;if(e<c+r){let r=e-c;i=u+(t===`additions`?n.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(n.deletions,n.additions),u+=n.deletions+n.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Gx(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!hv(this.appliedThemeCSS.theme,this.options.theme??tv)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){pv(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=rj(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),moe(this.pre,foe({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||hoe(this.headerElement,poe({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),qie(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Dy(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!loe(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(tae(`merge`,e,t),this.setHydratedState(t),await soe(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=rj(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!ij(u,this.deletionFile)||!ij(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)&&i!==this.lineAnnotations;if(!f&&Fk(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=Dy(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(BA(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:ee=!1,disableFileHeader:te=!1}=this.options;if(te&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,lv);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(ee)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(ee)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||vA(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return TA({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=zae(e,this.hunksRenderer.getExpandedHunksMap(),t);return BA(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(Bae(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return fae({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return pae({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=xA(o);if(e<s){let c=SA({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=wA({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=xA(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){fv(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||qA(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!ooe(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${zk(r)}`,a=this.annotationCache.get(i);if(a==null||!aoe(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:Rie(zk(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=zie();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:sA(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):sA(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=Fie;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??Vx(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,ev,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Z_,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Q_,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,$_,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=Bie(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Uie(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??tv,s=typeof o==`string`?o:{...o},c=rA(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=Xie({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Wie(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=Gie(this.themeCSSStyle.textContent??``,rA(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&$ie()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?cA(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=aj(t[0]),a=aj(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=Vx(i),r.content.innerHTML=Vx(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=oA({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=oA({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=oA({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=aj(r?.[0]),a=aj(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=aj(n?.[0]),i=aj(n?.[1]),a=()=>{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=Vx(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?cA(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=aj(t[0]),i=aj(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};Iie(u,this.appliedPreAttributes)||(Jie(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function ij(e,t){return e==null||t==null?e==null&&t==null:ky(e,t)}function foe({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function poe({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function moe(e,t,n=!1){return!n&&e==null&&t}function hoe(e,t,n=!1){return e==null&&t&&!n}function aj(e){if(e!=null&&e.type===`element`)return e.children??[]}var oj=200,goe=40;function sj(e,t){let n=t.trim();if(!n)return[];let r=/[A-Z]/.test(n),i=r?n:n.toLowerCase(),a=[];for(let t of e){if(a.length>=oj)break;let e=a.length,n=voe(t.old,t.new),o=new Set;cj(t,t.new,`additions`,i,r,o,a,n.additions),cj(t,t.old,`deletions`,i,r,o,a,n.deletions),a.length===e&&_oe(t.path,i,r)&&a.push({key:t.key,path:t.path,repo:t.repo,line:0,side:null,preview:t.path})}return a}function _oe(e,t,n){let r=n?e:e.toLowerCase();if(!r.includes(t))return!1;let i=e.lastIndexOf(`/`),a=i>=0?e.slice(i+1):e,o=a.lastIndexOf(`.`);if(o<=0)return!0;let s=a.slice(o+1);if(!(n?s:s.toLowerCase()).includes(t))return!0;let c=e.length-s.length;for(let e=r.indexOf(t);e!==-1;e=r.indexOf(t,e+1))if(e<c)return!0;return!1}function voe(e,t){let n=new Set,r=new Set;if(e==null&&t==null)return{additions:n,deletions:r};try{let i=Dy(e==null?null:{name:`old`,contents:e},t==null?null:{name:`new`,contents:t});for(let e of i.hunks){for(let t=0;t<e.additionCount;t++)n.add(e.additionStart+t);for(let t=0;t<e.deletionCount;t++)r.add(e.deletionStart+t)}}catch{}return{additions:n,deletions:r}}function cj(e,t,n,r,i,a,o,s){if(!t||o.length>=oj||!s.size)return;let c=0,l=t.split(`
1532
- `);for(let t=0;t<l.length;t++){if(o.length>=oj||c>=goe)return;let u=t+1;if(!s.has(u))continue;let d=l[t],f=(i?d:d.toLowerCase()).indexOf(r);f<0||n===`deletions`&&a.has(d)||(n===`additions`&&a.add(d),c++,o.push({key:e.key,path:e.path,repo:e.repo,line:u,side:n,preview:yoe(d,f,r.length)}))}}function yoe(e,t,n){let r=Math.max(0,t-36),i=Math.min(e.length,t+n+36);return(r>0?`…`:``)+e.slice(r,i)+(i<e.length?`…`:``)}var lj=`_eK _G`,boe=`<div><input type=search enterkeyhint=search autocomplete=off placeholder="Find in diffs" aria-label="Find in diffs"><span> </span><button type=button title="Previous match">↑</button><button type=button title="Next match">↓</button><button type=button title="Close find">×</button></div>`,xoe=` D b D l b b l`,uj=N(49,L(`f8`,e=>{e.a8=!!e.v,e.t&&(e.t.focus=e.am)}),3),dj=N(50,L(`f7`,e=>Tt(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(!e.a8)return;if(t.key===`Escape`){if(document.querySelector(`dialog[open]`)||t.target instanceof HTMLTextAreaElement)return;t.preventDefault(),e.al();return}let n=t.metaKey||t.ctrlKey;(t.key===`F3`||n&&t.key.toLowerCase()===`g`)&&(t.preventDefault(),e.ak(t.shiftKey?-1:1))},{signal:t.signal}),e.ad=e.u,e.ae=!!e.v,e.v&&e.am(),{abort:t}},onUpdate:function(){e.u!==e.ad&&(e.ad=e.u,e.v&&e.am()),e.v&&!e.ae?(e.ae=!0,e.am()):!e.v&&e.ae&&(e.ae=!1,e.ab&&=(clearTimeout(e.ab),0),ig(``,null),xj(e,{query:``,hit:null,keys:[]}))},onDestroy:function(){e.ab&&clearTimeout(e.ab),this.abort.abort(),ig(``,null),xj(e,{query:``,hit:null,keys:[]})}})),8),fj=N(32,e=>V(e.d,e.v&&(e.x||``).trim()?e.a2?`${e.a5+1}/${e.a2}`:`0/0`:``),3),pj=N(29,e=>{z(e.e,`disabled`,!e.a2||!e.v),z(e.f,`disabled`,!e.a2||!e.v)}),mj=Ke(21,e=>{B(e.a,[`_eG`,!e.v&&`_eF`]),z(e.a,`aria-hidden`,e.v?`false`:`true`),z(e.b,`tabindex`,e.v?0:-1),z(e.e,`tabindex`,e.v?0:-1),z(e.f,`tabindex`,e.v?0:-1),z(e.g,`tabindex`,e.v?0:-1),uj(e),dj(e),fj(e),pj(e)}),hj=N(11,e=>mj(e,e.j,e.k)),Soe=M(9,hj),Coe=M(10,hj),woe=(e,t)=>Nj(e,t?.length),gj=N(25,e=>woe(e,sj(e.s,e.x||``))),Toe=M(46,dj),_j=N(43,e=>Toe(e,Uj(e)),4),vj=N(45,e=>jt(e,`b`,e.x||``,Wj(e))),yj=Ke(23,e=>{gj(e),_j(e),vj(e),fj(e)}),bj=N(14,e=>yj(e,e.m,e.n)),Eoe=M(12,bj),Doe=M(13,bj),xj=Ke(14),Sj=N(17,e=>xj(e,e.p,e.q)),Ooe=M(15,Sj),koe=M(16,Sj),Aoe=M(31,e=>{_j(e),fj(e)}),Cj=N(30,e=>Aoe(e,e.a2?Math.min(e.a0,e.a2-1):-1)),joe=M(44,vj),wj=N(42,e=>joe(e,Gj(e)),3),Tj=M(41,e=>{wj(e),_j(e)}),Ej=N(35,e=>Tj(e,Kj(e)),2),Dj=j(26,e=>{Cj(e),Ej(e)}),Oj=(e,t)=>Lj(e,t.open),kj=(e,t)=>{Rj(e,t.timer),zj(e,t.tick),Bj(e,t.wasOpen)},Aj=M(48,e=>{uj(e),dj(e)}),jj=L(`f6`,e=>{Mt(e,`b`),A(e.b,`keydown`,function(t){if(e.v){if(t.key===`Escape`){t.preventDefault(),e.al();return}t.key===`Enter`&&(t.preventDefault(),e.ak(t.shiftKey?-1:1))}}),A(e.e,`mousedown`,function(e){e.preventDefault()}),A(e.e,`click`,function(){e.ak(-1)}),A(e.f,`mousedown`,function(e){e.preventDefault()}),A(e.f,`click`,function(){e.ak(1)}),A(e.g,`mousedown`,function(e){e.preventDefault()}),A(e.g,`click`,function(){e.al()})});function Mj(e){B(e.b,`_eH`),B(e.c,`_eJ`),B(e.e,lj),B(e.f,lj),B(e.g,lj),Dj(e,0),Oj(e,{open:!1}),kj(e,{timer:0,tick:0,wasOpen:!1}),Aj(e,qj(e)),jj(e)}var Nj=M(28,e=>{Cj(e),fj(e),pj(e)}),Pj=M(18,e=>{gj(e),Ej(e),wj(e)}),Fj=M(47,dj),Ij=N(38,e=>Fj(e,Jj(e))),Lj=M(34,e=>{Ej(e),wj(e),_j(e),Ij(e),uj(e),dj(e)}),Rj=M(37,e=>{wj(e),_j(e),Ij(e),dj(e)}),zj=M(39,dj),Bj=M(40,dj),Vj=M(19,uj),Hj=M(20,dj);function Uj(e){return t=>{e.a8&&(e.ab&&=(clearTimeout(e.ab),0),e.af(e.x||``,(e.a5<0?0:e.a5)+t))}}function Wj(e){return function(t){e.ai(t)}}function Gj(e){return t=>{e.a8&&(yj(e,t),Dj(e,0),ig(t,sj(e.s,t)[0]??null),e.ab&&clearTimeout(e.ab),e.ab=setTimeout(()=>{e.ab=0,e.af(t,0)},80))}}function Kj(e){return(t,n)=>{if(!e.a8)return;let r=sj(e.s,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){Dj(e,0),ig(t,null),xj(e,{query:t,hit:null,keys:i});return}Dj(e,(n%r.length+r.length)%r.length);let a=r[e.a0];ig(t,a),xj(e,{query:t,hit:a,keys:i})}}function qj(e){return()=>{let t=e.b;t&&(t.focus(),t.select(),document.activeElement!==t&&setTimeout(()=>{t.focus(),t.select()},0))}}function Jj(e){return()=>{mj(e,!1),e.a8=!1,e.ab&&=(clearTimeout(e.ab),0),ig(``,null),xj(e,{query:``,hit:null,keys:[]})}}R(`f3`,Uj),R(`f0`,Wj),R(`f2`,Gj),R(`f1`,Kj),R(`f5`,qj),R(`f4`,Jj);var Yj=Ur,Xj=(e=>`/${e}&`)(Wr);function Zj(e){Jr(e.a,`M17 17L21 21 M3 11C3 15.4183 6.58172 19 11 19C13.213 19 15.2161 18.1015 16.6644 16.6493C18.1077 15.2022 19 13.2053 19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11Z`)}var Qj=(e,t)=>Kr(e.a,t),$j=(e,t)=>qr(e.a,t);function eM(e,t){let n=null,r=()=>{if(!n||t.aborted)return;let i=e().closest(`[data-diff-main]`);if(i){let t=i.getBoundingClientRect(),r=0;if(n.y>=t.bottom-110?r=Math.max(4,Math.min(20,(n.y-(t.bottom-110))/3)):n.y<=t.top+110&&(r=-Math.max(4,Math.min(20,(t.top+110-n.y)/3))),r){i.scrollTop+=r;let a=e().getBoundingClientRect(),o=Math.max(t.top+12,a.top+48),s=Math.min(t.bottom-12,a.bottom-48),c=Math.max(o,Math.min(n.y,s));document.dispatchEvent(new PointerEvent(`pointermove`,{clientX:n.x,clientY:c,pointerId:n.pointerId,pointerType:`touch`,bubbles:!0,composed:!0}))}}requestAnimationFrame(r)};e().addEventListener(`pointerdown`,e=>{e.pointerType!==`mouse`&&e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute?.(`data-column-number`))&&(n={pointerId:e.pointerId,x:e.clientX,y:e.clientY},requestAnimationFrame(r))},{capture:!0,signal:t}),document.addEventListener(`pointermove`,e=>{n&&e.pointerId===n.pointerId&&e.isTrusted&&(n.x=e.clientX,n.y=e.clientY)},{capture:!0,passive:!0,signal:t});for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,e=>{n&&e.pointerId===n.pointerId&&(n=null)},{capture:!0,signal:t})}var tM=`<div></div>`,nM=`background:var(--panel);border-block:1px solid var(--border);padding:.5rem .75rem;font-family:system-ui,sans-serif;font-size:.85rem;display:flex;flex-direction:column;gap:.35rem;`,rM=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;`,iM=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;background:var(--accent);color:light-dark(#fff,#10131f);border-color:transparent;`,aM=`font:inherit;max-width:8rem;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .35rem;background:inherit;color:inherit;`,oM=new CSSStyleSheet;oM.replaceSync(`:host { display: block; max-width: 100%; overflow-x: auto; } @media (pointer: coarse) { pre[data-diff] { touch-action: pan-x pan-y; } [data-column-number], [data-gutter-utility-slot] { touch-action: none !important; } }`+tg);var sM=ot(`e0`,0);function cM(e){B(e.a,`_fj`)}var lM=N(14,L(`e1`,e=>Tt(e,{file:e.d,comments:e.e,draft:e.f,sessions:e.g,onMount:function(){let t=()=>e.g||[],n=()=>{let e=t();if(e.length<=1)return null;let n=document.createElement(`select`);n.setAttribute(`aria-label`,`Send to session`),n.style.cssText=aM;for(let t of e){let e=document.createElement(`option`);e.value=t.id,e.textContent=t.title||t.agent,n.append(e)}return n},r=e=>e?.value||t()[0]?.id||null,i=(e,t,n)=>{for(let r of e)r.disabled=t,n&&r.dataset.role===`send`&&(r.textContent=t?`Sending…`:n)},a=a=>{if(!a)return;let o=document.createElement(`div`);o.style.cssText=nM;let s=document.createElement(`p`);s.textContent=a.text,s.style.cssText=`margin:0;white-space:pre-wrap;`;let c=document.createElement(`div`);c.style.cssText=`display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;`;let l=document.createElement(`button`);l.type=`button`,l.textContent=`Remove`,l.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;font-size:.75rem;opacity:.85;`,l.onclick=()=>e.h?.(a.id);let u=t().length>0&&!!e.i,d=document.createElement(`button`);d.type=`button`,d.dataset.role=`send`,d.textContent=`Send`,d.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;background:var(--accent);color:light-dark(#fff,#10131f);border-color:transparent;font-size:.75rem;`,d.hidden=!u;let f=u?n():null;return f&&(f.style.fontSize=`.75rem`),d.onclick=()=>{(async()=>{let t=r(f);if(!(!t||d.disabled)){i([l,d],!0,`Send`);try{await e.i?.(a.id,t)}finally{i([l,d],!1,`Send`)}}})()},c.append(l),u&&(c.append(d),f&&c.append(f)),o.append(s,c),o},o=()=>{let a=document.createElement(`div`);a.style.cssText=nM;let o=document.createElement(`textarea`);o.placeholder=`Leave a comment…`,o.rows=3,o.style.cssText=`font:inherit;width:100%;resize:vertical;border:1px solid var(--border);border-radius:var(--radius);padding:.4rem .5rem;background:inherit;color:inherit;`+(Xn()?`font-size:16px;`:``);let s=document.createElement(`button`);s.type=`button`,s.textContent=`Add`,s.style.cssText=rM;let c=document.createElement(`button`);c.type=`button`,c.dataset.role=`send`,c.textContent=`Send`,c.style.cssText=iM;let l=document.createElement(`button`);l.type=`button`,l.textContent=`Cancel`,l.style.cssText=rM;let u=t().length>0&&!!e.j;c.hidden=!u;let d=u?n():null;s.onclick=()=>{o.value.trim()&&e.k?.(o.value)},c.onclick=()=>{(async()=>{let t=o.value.trim(),n=r(d);if(!(!t||!n||c.disabled)){i([s,c,l],!0,`Send`);try{await e.j?.(t,n)}finally{i([s,c,l],!1,`Send`)}}})()},l.onclick=()=>e.l?.(),o.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),u?c.onclick():s.onclick()),e.key===`Escape`&&l.onclick()};let f=document.createElement(`div`);f.style.cssText=`display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;`,f.append(s),u&&(f.append(c),d&&f.append(d)),f.append(l),a.append(o,f);let p=()=>o.scrollIntoView({block:`center`,behavior:`smooth`});return o.addEventListener(`focus`,()=>{let e=window.visualViewport;e&&(e.addEventListener(`resize`,p),o.addEventListener(`blur`,()=>e.removeEventListener(`resize`,p),{once:!0}))}),setTimeout(()=>{o.scrollIntoView({block:`center`,behavior:`instant`}),o.focus()},0),a},s=new Map,c,l={draft:!0},u,d=new doe({diffStyle:Zn()?`unified`:`split`,disableFileHeader:!0,enableLineSelection:!0,onLineSelectionEnd(t){if(!t)return;let n=t.endSide!=null&&t.endSide!==t.side;e.m?.({side:t.side,start:t.start,end:n?t.start:t.end})},renderAnnotation(e){let t=e.metadata||{};return t.draft?u??=o():a(t.comment)}}),f=()=>{let t=[],n=new Map;for(let r of e.e||[]){let e=s.get(r.id)||{comment:r};n.set(r.id,e),t.push({side:r.side,lineNumber:r.line_end,metadata:e})}return s=n,e.f&&(c!==e.f&&(c=e.f,l={draft:!0},u=void 0),t.push({side:e.f.side,lineNumber:e.f.end,metadata:l})),t},p=()=>{let t=e.a.querySelector(`diffs-container`)?.shadowRoot;t&&!t.adoptedStyleSheets.includes(oM)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,oM])},m=()=>{if(e.d.old==null&&e.d.new==null){e.n?.(`could not read ${e.d.path}`);return}let t=d.render({containerWrapper:e.a,oldFile:e.d.old==null?null:{name:e.d.oldPath||e.d.path,contents:e.d.old},newFile:e.d.new==null?null:{name:e.d.path,contents:e.d.new},lineAnnotations:f()});Promise.resolve(t).then(()=>{p(),dg(e.a)}).catch(t=>e.n?.(`diff render: ${t}`))};m();let h=new AbortController;return Xn()&&eM(sM(e),h.signal),{instance:d,render:m,dragAbort:h,unregSearch:ug(e.a,e.d.key),shownFile:e.d,shownComments:e.e,shownDraft:e.f,shownSessions:e.g}},onUpdate:function(){this.shownDraft&&!this.draft&&this.instance.setSelectedLines(null),(this.file!==this.shownFile||this.comments!==this.shownComments||this.draft!==this.shownDraft||this.sessions!==this.shownSessions)&&(this.shownFile=this.file,this.shownComments=this.comments,this.shownDraft=this.draft,this.shownSessions=this.sessions,this.render())},onDestroy:function(){this.unregSearch(),this.dragAbort.abort(),this.instance.cleanUp?.()}})),10),uM=M(3,lM),dM=M(4,lM),fM=M(5,lM),pM=M(6,lM),mM=M(7,lM),hM=M(8,lM),gM=M(9,lM),_M=M(10,lM),vM=M(11,lM),yM=M(12,lM),bM=M(13,lM),xM=`<aside></aside>`,SM=e=>B(e.a,`_fB`),CM=N(4,e=>{B(e.a,[`_fy`,{_fu:e._._._._.r.has(e._._.f(e._.e))}]),V(e.c,e._._._._.r.has(e._._.f(e._.e))?`▸`:`▾`)},2),wM=I(21,CM,e=>e._._._._),TM=L(`h3`,e=>A(e.a,`click`,function(){let t=new Set(e._._._._.r);t.delete(e._._.f(e._.e))||t.add(e._._.f(e._.e)),NN(e._._._._,t)})),EM=e=>{wM(e),DM(e),OM._(e),kM._(e),AM._(e),B(e.b,`_fC`),TM(e)},DM=I(10,CM,e=>e._._),OM=P(0,0,e=>{z(e.a,`title`,e._.e),CM(e)}),kM=P(0,0,e=>gt(e.a,`padding-left:${.35+e._.f*.75}rem`)),AM=P(0,0,e=>V(e.d,e._.g)),jM=O(5,`<span>💬</span>`,` `,SM),MM=N(6,e=>jM(e,+!e._._._._.s.has(e._.j))),NM=I(22,MM,e=>e._._._._),PM=L(`h4`,e=>A(e.a,`click`,function(){e._._._._.m(e._.j)})),FM=e=>{NM(e),IM._(e),LM._(e),RM._(e),zM._(e),BM._(e),B(e.a,`_fz`),B(e.b,`_fD`),B(e.d,`_fA`),PM(e)},IM=P(0,1,e=>gt(e.a,`padding-left:${.5+e._.f*.75}rem`)),LM=P(0,1,e=>z(e.a,`title`,e._.i)),RM=P(0,1,MM),zM=P(0,1,e=>{z(e.b,`data-status`,e._.k),V(e.c,e._.k)}),BM=P(0,1,e=>V(e.e,e._.l)),VM=O(0,`<button type=button><span> </span><!>/</button>`,` D D l%`,EM,`<button type=button><span> </span><span> </span><!></button>`,` D D l D l%`,FM),HM=N(3,e=>VM(e,!e._.i(e.c)&&e.c?.kind===`dir`?0:!e._.i(e.c)&&e.c?.kind!==`dir`?1:2)),UM=qe(1,HM),WM=UM,GM=M(2,e=>{qM(e,e.c?.path),JM(e,e.c?.depth),YM(e,e.c?.label),XM(e,e.c?.file?.path),ZM(e,e.c?.file?.key),QM(e,e.c?.file?.status),$M(e,e.c?.name),HM(e)}),KM=(e,t)=>GM(e,t[0]),qM=M(4,OM),JM=M(5,e=>{IM(e),kM(e)}),YM=M(6,AM),XM=M(8,LM),ZM=M(9,RM),QM=M(10,zM),$M=M(11,BM),eN=de(3,0,2),tN=N(9,e=>eN(e,!e._._.n.has(e._.i))),nN=I(19,tN,e=>e._._),rN=M(8,UM),iN=N(7,e=>rN(e,VN(e)),2),aN=M(6,iN),oN=e=>{nN(e),sN(e),lN._(e),fN._(e),aN(e,HN)},sN=I(21,iN,e=>e._._),cN=M(5,F(DM)),lN=P(5,0,e=>{cN(e,UN(e)),iN(e),tN(e)}),uN=k(1,`<!><!><!>`,`b%`,WM,KM),dN=(e,t)=>uN(e,[t,e=>e.kind===`dir`?`d:${e.path}`:e.file.key]),fN=P(5,0,e=>dN(e,jg(e._.m))),pN=N(9,e=>{B(e.b,[`_fx`,{_fu:e._.n.has(e.i)}]),V(e.d,e._.n.has(e.i)?`▸`:`▾`)}),mN=O(5,`<!><!><!><!><!><!>`,`b%b%b%b%`,oN),hN=N(10,e=>mN(e,!e._.n.has(e.i)||e._.p.has(e.i)?0:1),2),gN=qe(0,e=>{pN(e),hN(e)}),_N=L(`h5`,e=>A(e.b,`click`,function(){let t=e.i,n=new Set(e._.n);n.delete(t)||(kN(e._,new Set([...e._.p,t])),n.add(t)),TN(e._,n)})),vN=e=>{gN._(e),yN._(e),B(e.a,`_fw`),B(e.c,`_fC`),_N(e)},yN=qe(0,hN),bN=M(8,e=>{pN(e),hN(e),lN(e)}),xN=(e,t)=>V(e.e,t),SN=(e,t)=>{bN(e,t[0]?.id),xN(e,t[0]?.label),CN(e,t[0]?.files)},CN=M(12,fN),wN=F(nN),TN=Ke(13,e=>{gN(e),wN(e)}),EN=N(5,e=>TN(e,e.d,e.e)),DN=M(3,EN),ON=M(4,EN),kN=Ke(15,yN),AN=N(8,e=>kN(e,e.g,e.h)),jN=M(6,AN),MN=M(7,AN),NN=j(17,F(sN,wM));function PN(e){NN(e,new Set)}var FN=M(18,F(NM)),IN=(e,t)=>FN(e,t||new Set),LN=(e,t)=>B(e.a,[`_fv`,{_fu:t===!1}]),RN=k(0,`<div><button type=button><span> </span> </button><!></div>`,` D D D l l%`,vN,SN),zN=(e,t)=>RN(e,[t,`id`]),BN=M(12);function VN(e){return t=>{let n=e.g(t);for(let r of e._._.r){let i=r.indexOf(`/`),a=r.slice(0,i),o=r.slice(i+1);if(a===e._.i&&(t.kind!==`dir`||t.path!==o)&&(n===o||n.startsWith(`${o}/`)))return!0}return!1}}function HN(e){return e.kind===`dir`?e.path:e.file.path.includes(`/`)?e.file.path.slice(0,e.file.path.lastIndexOf(`/`)):``}function UN(e){return t=>`${e._.i}/${t}`}R(`h2`,VN),R(`h1`,HN),R(`h0`,UN);var WN=`_fk _G`,GN=`<!><!><!>`,KN=O(5,`<span>💬</span>`),qN=N(9,e=>KN(e,+!e._._.o.has(e.i))),JN=I(18,qN,e=>e._._),YN=L(`d0`,e=>A(e.a,`click`,function(){sP(e._._,!1),e._._.l(e.i)})),XN=e=>{JN(e),B(e.a,[`_fr`,`_m`]),B(e.b,`_ft`),B(e.d,`_fs`),YN(e)},ZN=(e,t)=>{z(e.b,`data-status`,t),V(e.c,t)},QN=M(8,e=>{z(e.d,`title`,e.i),V(e.e,e.i),qN(e)}),$N=k(7,`<button type=button><span> </span><span><bdi> </bdi></span><!></button>`,` D D l E m%`,XN,(e,t)=>{QN(e,t[0]?.key),ZN(e,t[0]?.status)}),eP=P(0,0,e=>$N(e,[e._.i,`key`])),tP=L(`d1`,e=>{A(e.a,`click`,function(){sP(e._,!1)}),A(e.g,`click`,function(){sP(e._,!1)})}),nP=e=>{eP._(e),iP._(e),aP._(e),B(e.a,`_fm`),B(e.b,`_fn`),B(e.c,`_fo`),B(e.d,`_fp`),B(e.g,WN),B(e.h,`_fq`),tP(e)},rP=N(8,e=>V(e.f,e._.j===e._.p?``:` / ${e._.p}`)),iP=P(0,0,e=>{V(e.e,e._.j),rP(e)}),aP=P(0,0,rP),oP=O(0,`<div></div><div role=dialog aria-label="Jump to file"><div><strong>Files</strong><span><!><!></span><button type=button title=Close aria-label=Close>×</button></div><div></div></div>`,` b D Db D%b%l l `,nP),sP=Ke(12,e=>oP(e,+!e.m)),cP=N(5,e=>sP(e,e.d,e.e)),lP=M(3,cP),uP=M(4,cP),dP=M(14,F(JN)),fP=(e,t)=>dP(e,t||new Set),pP=M(15,aP),mP=N(10,e=>pP(e,e.h??e.j)),hP=M(7,mP),gP=M(9,e=>{mP(e),iP(e)}),_P=M(8,e=>{gP(e,e.i?.length),eP(e)}),vP=M(11),yP=((e,t,n,r,i,a,o)=>`<div><div><div><div><!><div>${e}</div><div><h1>Review</h1><span><!><!></span></div><!></div><div><button>${t}</button><button title="Refresh diff">${n}</button><button title="Jump to file">Files (<!>)</button><div role=group aria-label="Review scope"><button type=button title="Committed changes only — base…tip, no working-tree edits">Committed</button><button type=button title="Include uncommitted and untracked files in the working tree">Working tree</button></div><button type=button> </button><div>${r}</div><button title="Find in the review (⌘/Ctrl+F)" aria-label="Find in the review">${i}</button></div></div><div data-diff-main><!><!><!><!><!><!><!><!></div></div>${a}${o}</div>`)(Hg,Rp,qo,boe,Yj,xM,GN),bP=((e,t,n,r,i,a,o)=>` D D D D%b D/${e}&l D b D%b%m%l D D/${t}&l D/${n}&l Db%l D b l D l D/${r}&l D/${i}&n D%b%b%b%b%b%b%b%m/${a}&/${o}&l`)(Ug,zp,Jo,xoe,Xj,` b`,`b%c`),xP=e=>B(e.a,`_eE`),SP=e=>B(e.a,`_eE`),CP=e=>B(e.a,`_eE`),wP=P(5,0,e=>V(e.b,e._.v)),TP=e=>{wP._(e),B(e.a,`_h`)},EP=P(8,0,e=>V(e.b,e._.p)),DP=e=>{EP._(e),B(e.a,`_et`)},OP=P(12,0,e=>V(e.b,e._.a0)),kP=e=>{OP._(e),B(e.a,`_et`)},AP=I(27,e=>V(e.b,e._._._.i),e=>e._._._),jP=e=>{AP(e),MP(e),PP(e),FP(e),IP(e),LP(e),RP(e),B(e.a,[`_h`,`_j`]),B(e.c,`_l`)},MP=I(28,e=>z(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),NP=N(4,e=>z(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),PP=I(29,e=>{V(e.d,e._._._.k),NP(e)},e=>e._._._),FP=I(30,NP,e=>e._._._),IP=I(31,NP,e=>e._._._),LP=I(32,NP,e=>e._._._),RP=I(33,NP,e=>e._._._),zP=I(34,e=>V(e.b,e._._._.p),e=>e._._._),BP=e=>{zP(e),B(e.a,Ig)},VP=I(27,e=>V(e.b,e._._._.i),e=>e._._._),HP=L(`i44`,e=>A(e.a,`click`,function(e){e.stopPropagation()})),UP=e=>{VP(e),WP(e),KP(e),qP(e),JP(e),YP(e),XP(e),B(e.a,[`_h`,`_j`]),B(e.c,Ig),HP(e)},WP=I(28,e=>z(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),GP=N(4,e=>z(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),KP=I(29,e=>{V(e.d,e._._._.k),GP(e)},e=>e._._._),qP=I(30,GP,e=>e._._._),JP=I(31,GP,e=>e._._._),YP=I(32,GP,e=>e._._._),XP=I(33,GP,e=>e._._._),ZP=N(10,e=>z(e.a,`title`,`origin/${e.h} ${e.i} · GitHub ${e.j}`),2),QP=M(7,ZP),$P=M(8,e=>{V(e.c,Dg(e.i)),ZP(e)}),eF=M(9,e=>{V(e.d,Dg(e.j)),ZP(e)}),tF=(e,t)=>V(e.b,t>0?` · `:``),nF=(e,t)=>{QP(e,t[0]?.pr?.headRefName),eF(e,t[0]?.pr?.headRefOid),$P(e,t[0]?.head),tF(e,t[1])},rF=(e,t)=>V(e.a,t>0?` · `:``),iF=(e,t)=>V(e.b,t),aF=(e,t)=>V(e.c,t),oF=(e,t)=>{iF(e,t[0]?.worktree),aF(e,t[0]?.pr?.number),rF(e,t[1])},sF=e=>B(e.a,`_eC`),cF=e=>B(e.a,`_ec`),lF=k(1,`<!><!> #<!>`,`%b%c%`,0,oF),uF=k(2,`<span><!><!> → <!></span>`,` D%b%c%`,0,nF),dF=I(181,e=>{lF(e,[e._._.cz,`id`]),uF(e,[e._._.cz,`id`])},e=>e._._),fF=ft(`i42`,`<span><!> — this view has a newer tip than the PR page.</span><span></span>`,` D%l `,e=>{dF(e),B(e.a,`_l`),B(e.c,[`_m`,`_d7`])}),pF=P(10,0,e=>V(e.b,e._.ch)),mF=e=>{pF._(e),hF._(e),B(e.a,`_ea`),B(e.c,`_eb`)},hF=P(10,0,e=>V(e.d,e._.ci)),gF=P(36,0,e=>V(e.b,e._.c9.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`)),_F=e=>{gF._(e),B(e.a,`_eC`)},vF=I(171,L(`i46`,e=>Tt(e,{onMount:function(){e._._._._._._.br(e.a,()=>{MI(e._,!0)})}})),e=>e._._._._._._),yF=e=>{vF(e),B(e.a,`_ew`)},bF=I(163,e=>V(e.e,e._._.b1?`, plus uncommitted`:``),e=>e._._),xF=e=>{bF(e),SF(e),CF(e),wF(e),TF(e)},SF=I(11,e=>V(e.a,Dg(e._.h))),CF=I(12,e=>V(e.b,e._.i)),wF=I(13,e=>V(e.c,Dg(e._.j))),TF=I(14,e=>V(e.d,e._.k)),EF=ft(`i43`,`this view is <!> (<!>). Local is <!> (<!><!>).`,`b%c%c%c%b%`,xF),DF=e=>{Or(e.a),Mr(e.a,EF(e)),br(e.a,`info`),wr(e.a,`inline`),Fr(e.a),Tr(e.a),Ir(e.a),Dr(e.a,{})},OF=N(6,e=>Ar(e.a,`${e.d} #${e.f}`)),kF=M(3,OF),AF=M(5,OF),jF=(e,t)=>{kF(e,t[0]?.worktree),AF(e,t[0]?.pr?.number),MF(e,t[0]?.pr?.headRefName),NF(e,t[0]?.head),PF(e,t[0]?.localHead),FF(e,t[0]?.branch)},MF=M(8,F(CF)),NF=M(7,F(SF)),PF=M(9,F(wF)),FF=M(10,F(TF)),IF=I(163,e=>V(e.b,e._._.b1?` — showing uncommitted changes only`:``),e=>e._._),LF=e=>{IF(e),RF(e)},RF=I(7,e=>V(e.a,e._.g)),zF=ft(`i39`,`already in <!><!>.`,`b%b%`,LF),BF=e=>{Or(e.a),Mr(e.a,zF(e)),br(e.a,`info`),wr(e.a,`inline`),Fr(e.a),Tr(e.a),Ir(e.a),Dr(e.a,{})},VF=N(5,e=>Ar(e.a,e.d?`${e.e} #${e.d.number}`:e.e)),HF=M(3,VF),UF=M(4,VF),WF=(e,t)=>{HF(e,t[0]?.pr),UF(e,t[0]?.worktree),GF(e,t[0]?.base)},GF=M(6,F(RF)),KF=I(163,e=>V(e.b,e._._.b1?` — showing uncommitted changes only`:``),e=>e._._),qF=e=>{KF(e),JF(e)},JF=I(5,e=>V(e.a,e._.e)),YF=ft(`i38`,`<!><!>.`,`%b%`,qF),XF=e=>{Or(e.a),Mr(e.a,YF(e)),br(e.a,`warn`),wr(e.a,`inline`),Fr(e.a),Tr(e.a),Ir(e.a),Dr(e.a,{})},ZF=(e,t)=>Ar(e.a,`${t}: base not found`),QF=(e,t)=>{ZF(e,t[0]?.worktree),$F(e,t[0]?.base)},$F=M(4,F(JF)),eI=N(2,e=>V(e.b,e._.bb.trim()?`No matches in diffs.`:`No files match "${e._.b0}".`)),tI=P(36,1,eI),nI=e=>{tI._(e),rI._(e),B(e.a,`_eC`)},rI=P(36,1,eI),iI=I(161,e=>{z(e.a,`disabled`,e._._.ay),V(e.b,e._._.ay?`Reloading…`:`Reload`)},e=>e._._),aI=L(`i40`,e=>A(e.a,`click`,function(){e._._.c5()})),oI=ft(`i41`,`<button> </button>`,` D `,e=>{iI(e),B(e.a,`_d`),aI(e)}),sI=P(34,0,e=>Ir(e.a,cH(e))),cI=e=>{sI._(e),Or(e.a),Fr(e.a,fee({content:oI(e)})),Mr(e.a,fF(e)),br(e.a,`info`),wr(e.a,`inline`),Ar(e.a,`GitHub is behind`),Tr(e.a),Dr(e.a,{})},lI=I(160,e=>V(e.a,e._._.ax),e=>e._._),uI=ft(`i37`,` `,` `,lI),dI=e=>{Or(e.a),Mr(e.a,uI(e)),Ir(e.a,lH(e)),Fr(e.a),Tr(e.a),br(e.a),wr(e.a),Ar(e.a),Dr(e.a,{})},fI=P(11,0,e=>{V(e.b,e._.av),V(e.c,e._.av===1?``:`s`)}),pI=e=>{fI._(e),B(e.a,`_ed`)},mI=I(156,e=>pM(e.a,e._._._._._._.ar||[]),e=>e._._._._._._),hI=e=>{mI(e),_I(e),yI(e),bI(e),SI(e),CI(e),wI(e),TI(e),EI(e),cM(e.a),vM(e.a,dH(e)),bM(e.a,uH(e))},gI=N(1,e=>fM(e.a,e._._._._._._.aw&&e._._._._._._.aw?.key===e._._.j?e._._._._._._.aw:null)),_I=I(159,gI,e=>e._._._._._._),vI=N(2,e=>_M(e.a,fH(e))),yI=I(183,vI,e=>e._._._._._._),bI=I(184,e=>mM(e.a,pH(e)),e=>e._._._._._._),xI=N(3,e=>gM(e.a,mH(e))),SI=I(187,xI,e=>e._._._._._._),CI=I(188,e=>hM(e.a,hH(e)),e=>e._._._._._._),wI=I(24,e=>{uM(e.a,e._._.i),vI(e),xI(e)},e=>e._._),TI=I(25,e=>{yM(e.a,gH(e)),gI(e)},e=>e._._),EI=I(26,e=>dM(e.a,e._._.u),e=>e._._),DI=O(0,`<div></div>`,` `,yF,tM,(e=>`/${e}&`)(` b`),hI),OI=N(3,e=>DI(e,e.b||e.c?1:0)),kI=M(2,OI),AI=N(4,e=>kI(e,e._._._._._.be===e._.j)),jI=I(165,AI,e=>e._._._._._),MI=j(1,OI),NI=e=>{jI(e),PI._(e),MI(e,!1)},PI=P(6,3,AI),FI=N(10,e=>B(e.a,[`_ev`,e._._._._.be===e.j&&`_d4`])),II=N(13,e=>B(e.d,[`_eB`,e._._._._.be===e.j&&e._._._._.bg<1&&`_d5`]),2),LI=I(165,e=>{FI(e),II(e)},e=>e._._._._),RI=O(6,`<p>binary file</p>`,` `,CP,`<p>file too large to display</p>`,` `,SP,`<p>file could not be read</p>`,` `,xP,`<!><!><!>`,`b%`,NI),zI=N(23,e=>RI(e,e.q?0:e.r?1:e.s==null&&e.t==null?2:e.w?3:4),4),BI=j(22,e=>{zt(e,`a`,e.w),zI(e)}),VI=L(`i47`,e=>A(e.a,`toggle`,function(t,n){if(BI(e,n.open),!n.open){let e=n.closest(`[data-diff-main]`);if(e){let t=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t<0&&(e.scrollTop+=t)}}})),HI=e=>{LI(e),UI(e),GI(e),YI(e),B(e.b,`_eA`),BI(e,!0),VI(e)},UI=I(167,II,e=>e._._._._),WI=N(11,e=>z(e.a,`hidden`,!e._._._._.cq.has(e.j))),GI=I(176,WI,e=>e._._._._),KI=F(EI),qI=M(20,e=>{ZI(e,e.u.length),KI(e)}),JI=N(12,e=>qI(e,e._._._._.cu.get(e.j)||[])),YI=I(179,JI,e=>e._._._._),XI=O(5,`<span>💬 <!></span>`,` Db%`,TP),ZI=M(21,e=>{XI(e,+!e.v),wP(e)}),QI=F(TI),$I=M(9,e=>{z(e.a,`data-key`,e.j),JI(e),FI(e),WI(e),II(e),PI(e),QI(e)}),eL=(e,t)=>{z(e.b,`data-status`,t),V(e.c,t)},tL=(e,t)=>{z(e.d,`title`,t),V(e.e,t)},nL=M(16,zI),rL=M(17,zI),iL=M(18,zI),aL=M(19,zI),oL=(e,t)=>cL(e,t[0]),sL=F(wI),cL=M(8,e=>{$I(e,e.i?.key),eL(e,e.i?.status),tL(e,e.i?.path),nL(e,e.i?.binary),rL(e,e.i?.tooLarge),iL(e,e.i?.old),aL(e,e.i?.new),sL(e)}),lL=de(2,0),uL=N(3,e=>lL(e,e._._._.cb===1||!e._._._.bh.has(e._._.d)),2),dL=I(168,uL,e=>e._._._),fL=e=>{dL(e),pL(e),mL(e),gL(e),B(e.b,`_eu`)},pL=I(173,uL,e=>e._._._),mL=I(24,uL,e=>e._._),hL=k(1,`<details><summary><span> </span><span><bdi> </bdi></span><!></summary><!></details>`,` E D l E m%l%`,HI,oL),gL=I(38,e=>hL(e,[e._._.t,`key`]),e=>e._._),_L=N(2,e=>V(e.b,Cg(e._._._.r,e._._._._.as||``))),vL=I(157,_L,e=>e._._._._),yL=e=>{vL(e),xL(e),SL(e),B(e.a,`_h`)},bL=N(3,e=>z(e.a,`title`,`checked out ${e._._._.r} ${e._._._.s}`)),xL=I(36,e=>{bL(e),_L(e)},e=>e._._._),SL=I(37,bL,e=>e._._._),CL=(e,t)=>{BL(e,t?.title),VL(e,t?.base),HL(e,t?.head),WL(e,t?.topic)},wL=N(17,e=>CL(e,Sg(e._._.q||e._._.n,e._._.l||e._._.r,e._._._.as||``)),4),TL=I(157,wL,e=>e._._._),EL=e=>{TL(e),kL(e),AL(e),ML(e),NL(e),FL(e),IL(e),LL(e),RL(e),zL(e),B(e.a,`_eo`),B(e.c,`_ep`),B(e.d,`_eq`),B(e.f,`_es`),B(e.g,`_er`)},DL=O(9,`<span>local <!></span>`,` Db%`,yL),OL=N(16,e=>DL(e,+!e._._._.cy.has(e._._.d))),kL=I(180,OL,e=>e._._._),AL=I(24,OL,e=>e._._),jL=O(1,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,jP),ML=I(25,e=>jL(e,+!e._._.g),e=>e._._),NL=I(30,wL,e=>e._._),PL=N(12,e=>z(e.c,`title`,`${e.l} · ${e._._.m.slice(0,7)}…${e._._.o.slice(0,7)}`),2),FL=I(31,PL,e=>e._._),IL=I(32,wL,e=>e._._),LL=I(33,PL,e=>e._._),RL=I(35,wL,e=>e._._),zL=I(36,wL,e=>e._._),BL=M(11,PL),VL=(e,t)=>V(e.e,t),HL=(e,t)=>V(e.h,t),UL=O(8,`<span> </span>`,` D `,DP),WL=M(15,e=>{UL(e,+!e.p),EP(e)}),GL=N(2,e=>V(e.b,Cg(e._._._.r,e._._._._.as||``))),KL=I(157,GL,e=>e._._._._),qL=e=>{KL(e),YL(e),XL(e),B(e.a,`_h`)},JL=N(3,e=>z(e.a,`title`,`checked out ${e._._._.r} ${e._._._.s}`)),YL=I(36,e=>{JL(e),GL(e)},e=>e._._._),XL=I(37,JL,e=>e._._._),ZL=(e,t)=>{DR(e,t?.title),OR(e,t?.base),kR(e,t?.head),jR(e,t?.topic)},QL=N(31,e=>ZL(e,Sg(e._._.q||e._._.n,e._._.l||e._._.r,e._._._.as||``)),4),$L=I(157,QL,e=>e._._._),eR=L(`i45`,e=>A(e.a,`click`,function(){let t=e._._.d;if(e._._._.bk.has(t)){let n=new Set(e._._._.bk);n.delete(t),XB(e._._._,n),e._._._.bh.has(t)||qB(e._._._,new Set([...e._._._.bh,t]));return}if(e._._._.bh.has(t)){if(e._._._.bi.has(t)){let n=new Set(e._._._.bh);n.delete(t),qB(e._._._,n);return}XB(e._._._,new Set([...e._._._.bk,t])),requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!e._._._.bk.has(t))return;let n=new Set(e._._._.bh);n.delete(t),qB(e._._._,n);let r=new Set(e._._._.bk);r.delete(t),XB(e._._._,r)})})}else YB(e._._._,new Set([...e._._._.bi,t])),qB(e._._._,new Set([...e._._._.bh,t]))})),tR=e=>{$L(e),oR(e),lR(e),fR(e),pR(e),hR(e),gR(e),_R(e),yR(e),bR(e),xR(e),SR(e),CR(e),TR(e),ER(e),B(e.d,Fg),B(e.g,`_ep`),B(e.h,`_eq`),B(e.j,`_es`),B(e.k,`_er`),B(e.o,`_em`),eR(e)},nR=N(18,e=>z(e.a,`title`,e.r?`Show ${e._._.x||e._._.u} files`:`Hide files`),2),rR=N(20,e=>B(e.b,[`_ex`,!e.r&&`_ey`,e.t&&`_ez`])),iR=M(17,e=>{B(e.a,[`_ej`,e.r&&`_ek`]),z(e.a,`aria-expanded`,e.r?`false`:`true`),V(e.c,e.r?`▸`:`▾`),nR(e),rR(e)}),aR=N(27,e=>iR(e,e._._._.bh.has(e._._.d))),oR=I(168,aR,e=>e._._._),sR=M(19,e=>{z(e.a,`aria-busy`,e.t?`true`:`false`),rR(e)}),cR=N(28,e=>sR(e,e._._._.bk.has(e._._.d))),lR=I(170,cR,e=>e._._._),uR=O(13,`<span>local <!></span>`,` Db%`,qL),dR=N(29,e=>uR(e,+!e._._._.cy.has(e._._.d))),fR=I(180,dR,e=>e._._._),pR=I(24,e=>{aR(e),cR(e),dR(e)},e=>e._._),mR=O(5,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,UP,`<span> </span>`,` D `,BP),hR=I(25,e=>mR(e,+!e._._.g),e=>e._._),gR=I(26,e=>V(e.e,e._._.h),e=>e._._),_R=I(30,QL,e=>e._._),vR=N(23,e=>z(e.g,`title`,`${e.w} · ${e._._.m.slice(0,7)}…${e._._.o.slice(0,7)}`),2),yR=I(31,vR,e=>e._._),bR=I(32,QL,e=>e._._),xR=I(33,vR,e=>e._._),SR=I(35,QL,e=>e._._),CR=I(36,QL,e=>e._._),wR=N(30,e=>{V(e.p,e._._.x||e._._.u),V(e.q,(e._._.x||e._._.u)===1?``:`s`)}),TR=I(39,e=>{nR(e),wR(e)},e=>e._._),ER=I(40,e=>{nR(e),wR(e)},e=>e._._),DR=M(22,vR),OR=(e,t)=>V(e.i,t),kR=(e,t)=>V(e.l,t),AR=O(12,`<span> </span>`,` D `,kP),jR=M(26,e=>{AR(e,+!e.a0),OP(e)}),MR=N(4,e=>z(e.a,`hidden`,!e._.x&&!e._.g&&e._._.bf!==e._.d),3),NR=I(166,MR,e=>e._._),PR=e=>{NR(e),LR(e),RR(e),BR(e),VR._(e),UR._(e),WR._(e),GR._(e),B(e.a,`_ei`)},FR=O(2,`<!><!><div></div><!><!>`,`b%b b%`,fL),IR=N(5,e=>FR(e,e._._.cb===1||!e._._.bh.has(e._.d)||e._._.bi.has(e._.d)?0:1),3),LR=I(168,IR,e=>e._._),RR=I(169,IR,e=>e._._),zR=O(1,`<button type=button><span aria-hidden=true> </span><span> </span><!><span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span><!><span><!> file<!></span></button>`,` D D l D l%b D D l b D l%l%b D%c%`,tR,`<p><!><span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span><!></p>`,` D%b D D l b D l%l%`,EL),BR=I(173,e=>{zR(e,e._._.cb>1?0:1),IR(e)},e=>e._._),VR=P(0,0,e=>{MR(e),IR(e)}),HR=N(3,e=>z(e.a,`data-pr`,e._.g?`${e._.h}/${e._.g.number}`:void 0)),UR=P(0,0,e=>{HR(e),MR(e)}),WR=P(0,0,HR),GR=P(0,0,MR),KR=F(gL),qR=M(19,e=>{rz(e,e.t.length),KR(e)}),JR=N(4,e=>qR(e,e._.cr.get(e.d)||[])),YR=qe(37,JR),XR=e=>{YR._(e),$R._(e)},ZR=(e,t)=>sz(e,t.length),QR=N(5,e=>ZR(e,e._.cs.get(e.d)||[])),$R=qe(37,QR),ez=O(0,`<section><!><!></section>`,` D%b%`,PR),tz=N(21,e=>ez(e,e.u||e.g?0:1)),nz=F(TR),rz=M(20,e=>{tz(e),nz(e)}),iz=F(pR,AL,mL),az=M(3,e=>{JR(e),QR(e),VR(e),iz(e)}),oz=F(ER),sz=M(23,e=>{GR(e),oz(e)}),cz=F(hR,ML),lz=M(6,e=>{dz(e,e.g?.number),fz(e,e.g?.url),pz(e,e.g?.title),mz(e,e.g?.headRefName),hz(e,e.g?.baseRefName),tz(e),UR(e),cz(e)}),uz=(e,t)=>{az(e,t[0]?.id),lz(e,t[0]?.pr),_z(e,t[0]?.worktree),vz(e,t[0]?.head),yz(e,t[0]?.base),bz(e,t[0]?.baseSha),xz(e,t[0]?.full_name),Sz(e,t[0]?.branch),Cz(e,t[0]?.localHead)},dz=M(8,F(VP,AP)),fz=M(9,F(WP,MP)),pz=M(10,F(KP,PP)),mz=M(11,F(_R,NL,qP,FP)),hz=M(16,F(SR,RL)),gz=F(gR),_z=M(7,e=>{WR(e),gz(e)}),vz=M(12,F(yR,FL,JP,IP)),yz=M(13,F(bR,IL,YP,LP)),bz=M(14,F(xR,LL,XP,RP)),xz=M(15,F(zP)),Sz=M(17,F(CR,YL,zL,xL)),Cz=M(18,F(XL,SL)),wz=P(12,0,e=>B_(e.a,e._.ar)),Tz=e=>{wz._(e),Ez._(e),Dz._(e),P_(e.a)},Ez=P(12,0,e=>V_(e.a,e._.dd)),Dz=P(12,0,e=>H_(e.a,e._.de)),Oz=L(`i36`,e=>A(e.a,`click`,function(){e._.aq?.()})),kz=e=>{B(e.a,[Mg,`_dV`]),zg(e.b),Bg(e.b,14),Vg(e.b),Oz(e)},Az=(e,t)=>{ZV(e,t?.additions),QV(e,t?.deletions)},jz=M(124,F(GI)),Mz=(e,t)=>zN(e.ac,t),Nz=N(127,e=>Mz(e,e.c9.filter(t=>(e.cs.get(t.id)||[]).length).map(t=>({id:t.id,label:t.pr?`${t.worktree} #${t.pr.number}`:t.worktree,files:e.cs.get(t.id)||[]})))),Pz=M(126,e=>{Nz(e),$R(e)}),Fz=N(121,e=>Pz(e,new Map(e.c9.map(t=>[t.id,e.cm.filter(e=>e.repo===t.id)])))),Iz=M(120,e=>{_P(e.ad,e.cm),$V(e,e.cm?.length),jz(e,new Set(e.cm.map(e=>e.key))),Fz(e)}),Lz=N(119,e=>Iz(e,e.ck?e.cf.filter(t=>e.ck.has(t.key)||t.key===e.be):e.cf),2),Rz=M(113,e=>{Pj(e.a0,e.cf),Az(e,(()=>{let t=0,n=0;for(let r of e.cf)t+=r.additions||0,n+=r.deletions||0;return{additions:t,deletions:n}})()),Lz(e)}),zz=N(111,e=>Rz(e,(()=>{let t=Zh(e.b0);return e.cc.filter(e=>t(e.key))})())),Bz=M(110,e=>{JV(e,e.cc?.length),zz(e)}),Vz=M(132,F(fR,kL)),Hz=k(35,tr,(e=>`/${e}&`)(nr),DF,jF),Uz=(e,t)=>{Vz(e,new Set(t.map(e=>e.id))),Hz(e,[t,`id`])},Wz=k(32,tr,(e=>`/${e}&`)(nr),XF,QF),Gz=k(33,tr,(e=>`/${e}&`)(nr),BF,WF),Kz=k(37,`<!><!><!>`,`b%`,XR,uz),qz=M(136,sI),Jz=N(134,e=>qz(e,_H(e))),Yz=F(dF),Xz=M(133,e=>{tH(e,e.cz?.length),Jz(e),Yz(e)}),Zz=N(108,e=>Xz(e,e.c9.filter(t=>t.githubDrift&&!e.bl.has(t.id)))),Qz=M(107,e=>{qV(e,e.c9.length),Bz(e,e.c9.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),Uz(e,e.c9.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName))),Wz(e,[e.c9.filter(e=>e.baseMissing),`id`]),Gz(e,[e.c9.filter(e=>e.contained&&e.files.length),`id`]),Kz(e,[e.c9,`id`]),Fz(e),Nz(e),Zz(e),gF(e)}),$z=M(148,Dz),eB=N(145,e=>$z(e,vH(e)),4),tB=M(149,F(SI)),nB=N(146,e=>tB(e,yH(e)),5),rB=M(150,F(CI)),iB=N(144,e=>rB(e,bH(e)),3),aB=M(143,e=>{eB(e),nB(e),iB(e)}),oB=N(106,L(`i50`,e=>Tt(e,{active:e.an,load:e.bz,onMount:function(){let t=new AbortController,n={abort:t,loaded:!1,wasActive:!1,lastPr:e.am||``,lastNonce:e.ao||0,start:()=>{this.active&&!n.loaded&&(n.loaded=!0,this.load())}};return n.wasActive=!!this.active,xn().addEventListener(`review.changed`,t=>{n.loaded&&t.data?.workspaceId===e.al&&e.c4()},{signal:t.signal}),xn().addEventListener(`status.changed`,t=>{if(!this.active||!n.loaded||e.ay)return;let r=t.data,i=r&&r[e.al];if(!i)return;let a=Jh(i);!a||!e.bu||a===e.bu||e.c7()},{signal:t.signal}),n.start(),n},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.c5(),this.wasActive=!!this.active;let t=e.am||``,n=e.ao||0;this.loaded&&t&&n!==this.lastNonce?(this.lastNonce=n,this.lastPr=t,e.bs(t)):(this.lastPr=t,this.lastNonce=n)},onDestroy:function(){e.bv&&clearTimeout(e.bv),this.abort.abort()}})),11),sB=M(105,oB),cB=N(104,e=>sB(e,SH(e))),lB=M(103,e=>{cB(e),oB(e)}),uB=N(98,e=>lB(e,CH(e))),dB=M(97,e=>{uB(e),oB(e)}),fB=N(96,e=>dB(e,wH(e)),5),pB=M(90,e=>{fB(e),oB(e)}),mB=N(81,e=>pB(e,TH(e)),2),hB=M(125,YR),gB=e=>{hB(e,new Map(e.c9.map(t=>[t.id,e.cc.filter(e=>e.repo===t.id)])))},_B=M(147,Ez),vB=N(142,e=>_B(e,EH(e)),2),yB=O(31,`<p>Loading diff…</p>`,` `,sF),bB=N(61,e=>yB(e,!e.at&&e.ay?0:1)),xB=O(36,`<p> </p>`,` D `,_F,`<p> </p>`,` D `,nI),SB=N(123,e=>xB(e,e.at&&!e.ce?0:e.at&&!e.co&&!e.bd?1:2),3),CB=j(55,e=>{Qz(e,e.at||[]),aB(e,xH(e)),mB(e),gB(e),vB(e),bB(e),SB(e)}),wB=(e,t)=>{IN(e.ac,t),fP(e.ad,t)},TB=F(YI),EB=M(128,e=>{wB(e,new Set(e.cu.keys())),TB(e)}),DB=M(140,F(bI)),OB=M(139,F(yI)),kB=N(138,e=>OB(e,OH(e)),3),AB=j(56,e=>{uV(e,e.au?.length),EB(e,(()=>{let t=new Map;for(let n of e.au){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),DB(e,DH(e)),kB(e),vB(e),eB(e),iB(e)}),jB=F(_I),MB=j(58,e=>{kB(e),nB(e),jB(e)}),NB=O(30,tr,(e=>`/${e}&`)(nr),dI),PB=F(lI),FB=j(59,e=>{NB(e,+!e.ax),PB(e)}),IB=F(iI),LB=j(60,e=>{B(e.q,[Mg,`_dZ`,{[Ng]:e.ay}]),z(e.q,`disabled`,e.ay),z(e.v,`disabled`,e.ay),z(e.w,`disabled`,e.ay),z(e.x,`disabled`,e.ay),oB(e),bB(e),IB(e)}),RB=j(62,e=>{$g(e.g,e.b0),zz(e),tI(e)}),zB=F(KF,IF,bF),BB=j(63,e=>{B(e.v,[`_eg`,{_ef:!e.b1}]),z(e.v,`aria-pressed`,e.b1?`false`:`true`),B(e.w,[`_eg`,{_ef:e.b1}]),z(e.w,`aria-pressed`,e.b1?`true`:`false`),B(e.x,[`_eh`,`_dZ`,{_ef:e.b1}]),z(e.x,`aria-pressed`,e.b1?`true`:`false`),z(e.x,`title`,e.b1?`Showing working tree — tap for committed only`:`Showing committed only — tap to include uncommitted`),V(e.y,e.b1?`Dirty`:`Clean`),fB(e),uB(e),zB(e)}),VB=j(64,e=>{B(e.o,[Pg,{_dQ:e.b2}]),z(e.o,`title`,e.b2?`Hide file tree`:`Show file tree`),LN(e.ac,e.b2)}),HB=j(65,e=>lP(e.ad,e.b3)),UB=M(118,Lz),WB=e=>{UB(e,e.bb.trim()?new Set(e.bc):null)},GB=j(72,e=>{wV(e,e.ba?.query),TV(e,e.ba?.keys),EV(e,e.ba?.hit),WB(e)}),KB=F(LR,oR,dL),qB=j(79,e=>{DN(e.ac,e.bh),mB(e),KB(e)}),JB=F(RR),YB=j(80,e=>{jN(e.ac,e.bi),mB(e),JB(e)}),XB=j(82,F(lR)),ZB=j(83,e=>{Zz(e),Jz(e)}),QB=(e,t)=>{NV(e,t.cbs),PV(e,t.io),FV(e,t.root)},$B=(e,t)=>{IV(e,t.sig),LV(e,t.timer)},eV=(e,t)=>RV(e,t.seq),tV=(e,t)=>WV(e,t.busy),nV=M(137,e=>{kB(e),nB(e)}),rV=(e,t)=>{BN(e.ac,t),vP(e.ad,t)},iV=M(155,e=>koe(e.a0,jH(e))),aV=M(151,e=>{rV(e,AH(e)),iV(e,MH(e))}),oV=L(`i48`,e=>{A(e.o,`click`,function(){VB(e,!e.b2),bee(e.b2)}),A(e.q,`click`,function(){e.c5()}),A(e.s,`click`,function(){HB(e,!0)}),A(e.v,`click`,function(){e.b1&&(BB(e,!1),Hn(!1),e.bz(!1))}),A(e.w,`click`,function(){e.b1||(BB(e,!0),Hn(!0),e.bz(!0))}),A(e.x,`click`,function(){let t=!e.b1;BB(e,t),Hn(t),e.bz(t)}),A(e.a1,`click`,function(){e.dj()})});function sV(e){B(e.a,`_dP`),B(e.b,`_dT`),B(e.d,`_d8`),B(e.f,`_d9`),i_(e.g),e_(e.g,RH(e)),B(e.h,`_dW`),B(e.i,`_dX`),B(e.j,`_d_`),Bp(e.p),Vp(e.p,14),Hp(e.p),Yo(e.r),Xo(e.r,14),Zo(e.r),B(e.s,[`_eD`,`_dZ`]),B(e.u,[`_ee`,`_dZ`]),Mj(e.a0),Coe(e.a0,LH(e)),Eoe(e.a0),Doe(e.a0),Ooe(e.a0),B(e.a1,[Mg,`_d0`,`_dZ`]),Zj(e.a2),Qj(e.a2,14),$j(e.a2),B(e.a3,`_d6`),PN(e.ac),ON(e.ac,IH(e)),MN(e.ac,FH(e)),uP(e.ad,PH(e)),CB(e,null),AB(e,[]),MB(e,null),FB(e,null),LB(e,!1),RB(e,``),BB(e,xee()),VB(e,yee()),HB(e,!1),GB(e,{query:``,hit:null,keys:[]}),qB(e,new Set),YB(e,new Set),XB(e,new Set),ZB(e,new Set),QB(e,{io:null,root:null,cbs:null}),$B(e,{sig:``,timer:0}),eV(e,{seq:0}),tV(e,{busy:0}),nV(e,kH),aV(e,NH(e)),oV(e)}var cV=O(11,`<span>·</span><!> comment<!>`,` b%c%`,pI),lV=O(12,l_,(e=>`/${e}&`)(u_),Tz),uV=M(57,e=>{B(e.c,[`_dU`,{_dY:e.av>0}]),cV(e,+!e.av),lV(e,+!e.av),fI(e)}),dV=Ke(66,e=>{B(e.n,[`_dS`,{_d3:e.b4&&!Xn()}]),B(e.z,[`_d2`,{_d1:!e.b4}]),Soe(e.a0,e.b4),z(e.a1,`hidden`,e.b4)}),fV=N(44,e=>dV(e,e.ag,e.ah)),pV=M(42,fV),mV=M(43,fV),hV=N(69,L(`i51`,e=>{e.aj!=null&&e.aj!==e.b6&&bV(e,e.aj)})),gV=L(`i49`,e=>{e.an&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||t.target?.closest?.(`[data-palette]`)||(t.preventDefault(),e.dj()))},{capture:!0,signal:De(e,0)})}),_V=N(154,e=>{Ee(e,0),gV(e)}),vV=M(153,_V),yV=N(71,e=>vV(e,zH(e))),bV=j(68,e=>{Hj(e.a0,e.b6),hV(e),yV(e)}),xV=M(45,e=>{bV(e,e.aj||0),hV(e)}),SV=M(70,e=>{Vj(e.a0,e.b8),yV(e)}),CV=(e,t)=>SV(e,t||{focus:BH}),wV=M(73,rI),TV=M(74),EV=M(75,e=>{OV(e,e.bd?.key),kV(e,e.bd?.repo),AV(e,e.bd?.line),SB(e)}),DV=F(LI,jI),OV=M(76,e=>{Lz(e),DV(e)}),kV=M(77,F(NR)),AV=M(78,F(UI)),jV=M(89),MV=N(88,e=>jV(e,VH(e)),2),NV=M(85,MV),PV=M(86,MV),FV=M(87,MV),IV=M(92,e=>{fB(e),oB(e)}),LV=M(93,e=>{cB(e),oB(e)}),RV=M(95,fB),zV=M(141,vB),BV=M(102,oB),VV=N(101,e=>BV(e,UH(e))),HV=M(47,e=>{zV(e,HH(e)),fB(e),VV(e),oB(e),kB(e),eB(e),nB(e)}),UV=M(48,e=>{fB(e),oB(e)}),WV=M(100,e=>{VV(e),eB(e),nB(e),iB(e)}),GV=M(49,e=>{oB(e),_V(e)}),KV=M(50,oB),qV=M(109,F(BR,pL)),JV=M(112,e=>{hP(e.ad,e.ce),SB(e)}),YV=O(10,`<span>+<!></span><span>−<!></span>`,` Db%l Db%`,mF,`<span>0</span>`,` `,cF),XV=N(117,e=>YV(e,e.ch||e.ci?0:1)),ZV=M(115,e=>{XV(e),pF(e)}),QV=M(116,e=>{XV(e),hF(e)}),$V=M(122,e=>{V(e.t,e.co),SB(e)}),eH=O(34,tr,(e=>`/${e}&`)(nr),cI),tH=(e,t)=>eH(e,+!t),nH=M(51,e=>{eB(e),nB(e),iB(e)}),rH=O(4,(e=>`<button title="Back to terminal">${e}</button>`)(Lg),(e=>` D/${e}&l`)(Rg),kz),iH=M(52,e=>rH(e,+!e.aq)),aH=F(mI),oH=M(53,e=>{wz(e),aH(e)}),sH=M(54,F($L,KL,TL,vL));function cH(e){return function(){e._.d2()}}function lH(e){return function(){FB(e._,null)}}function uH(e){return function(t){FB(e._._._._._._,t)}}function dH(e){return function(){MB(e._._._._._._,null)}}function fH(e){return function(t){e._._._._._._.d5(e._._.i,t)}}function pH(e){return function(t){e._._._._._._.d6(t)}}function mH(e){return function(t,n){e._._._._._._.df(e._._.i,t,n)}}function hH(e){return function(t,n){e._._._._._._.dg(t,n)}}function gH(e){return function(t){MB(e._._._._._._,{key:e._._.j,side:t.side||`additions`,start:Math.min(t.start,t.end),end:Math.max(t.start,t.end)})}}function _H(e){return()=>{ZB(e,new Set([...e.bl,...e.cz.map(e=>e.id)]))}}function vH(e){return async t=>{let n=e.au;e.c2++;try{await e.d9(n,t),e.ap?.(t),AB(e,[]),MB(e,null),await fetch(`/api/workspaces/${e.al}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})}).catch(()=>{})}catch(t){FB(e,String(t.message||t))}finally{e.c2--}}}function yH(e){return async(t,n,r)=>{let i=e.aw;if(!i)return;let a=n.trim();if(!a)return;let o={id:-1,workspace_id:e.al,worktree:e.d3(t.repo),path:t.path,side:i.side===`deletions`?`deletions`:`additions`,line_start:i.start,line_end:i.end,text:a,created_at:``};e.c2++;try{await e.d9([o],r),e.ap?.(r),MB(e,null)}catch(t){FB(e,String(t.message||t))}finally{e.c2--}}}function bH(e){return async(t,n)=>{let r=e.au.find(e=>e.id===t);if(r){e.c2++;try{await e.d9([r],n),e.ap?.(n),AB(e,e.au.filter(e=>e.id!==t)),await fetch(`/api/review-comments/${t}`,{method:`DELETE`}).catch(()=>{})}catch(t){FB(e,String(t.message||t))}finally{e.c2--}}}}function xH(e){return async(t,n)=>{t.length&&await H(`/api/sessions/${n}/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:`Please address this review feedback, then summarize what you changed.\n\n${Tg(t,e.at)}`,...Xh()||{}})})}}function SH(e){return()=>{e.bv&&clearTimeout(e.bv),e.bv=setTimeout(()=>{e.bv=0,e.c5()},250)}}function CH(e){return()=>(ZB(e,new Set),e.bz(e.b1,!0))}function wH(e){return async(t=e.b1,n=!1)=>{let r=++e.bx;LB(e,!0),FB(e,null);try{let i=new URLSearchParams;t&&i.set(`uncommitted`,`1`),n&&i.set(`refresh`,`1`);let a=i.size?`?${i}`:``,[o,s]=await Promise.all([H(`/api/workspaces/${e.al}/diff${a}`),H(`/api/workspaces/${e.al}/review`)]);if(r!==e.bx)return;CB(e,o),AB(e,s.comments||[]),e.bu=qh(o),e.am&&e.bs(e.am)}catch(t){if(r!==e.bx)return;FB(e,String(t.message||t))}finally{r===e.bx&&LB(e,!1)}}}function TH(e){return t=>{if(!t)return;let n=e.at||[],r=n.find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),i=new Set(e.bi);for(let t of n)e.bh.has(t.id)||i.add(t.id);r&&i.add(r.id),YB(e,i);let a=new Set;for(let e of n)(!r||e.id!==r.id)&&a.add(e.id);qB(e,a),XB(e,new Set);let o=Date.now(),s=()=>{let n=e.a3,r=n?.querySelector(`[data-pr="${CSS.escape(t)}"]`);if(!n||!r){Date.now()-o<2500&&requestAnimationFrame(s);return}let i=r.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop;n.scrollTo({top:Math.max(0,i-8)})};requestAnimationFrame(s)}}function EH(e){return async()=>await Kh(Tg(e.au,e.at))?(await e.d7(),!0):(FB(e,`Copy failed — clipboard needs HTTPS on this browser.`),!1)}function DH(e){return async t=>{AB(e,e.au.filter(e=>e.id!==t)),await fetch(`/api/review-comments/${t}`,{method:`DELETE`})}}function OH(e){return async(t,n)=>{let r=e.aw;MB(e,null);try{let i=await H(`/api/workspaces/${e.al}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:e.d3(t.repo),path:t.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim()})});AB(e,e.au.concat(i))}catch(t){FB(e,String(t.message||t))}}}function kH(e){return e.includes(`#`)?e.split(`#`)[0]:e}function AH(e){return t=>{e.dh(t)?.scrollIntoView({block:`start`})}}function jH(e){return function(t){e.dl(t)}}function MH(e){return t=>{if(GB(e,t),!t.hit)return;let n=t.hit;setTimeout(()=>{let r=e.dh(n.key);if(r){if(n.line<1){let t=e.a3;if(t){let e=r.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop;t.scrollTo({top:Math.max(0,e-8)})}else r.scrollIntoView({block:`start`});return}ig(t.query,n),ag()}},0)}}function NH(e){return t=>{let n=e.a3?.querySelector(`details[data-key="${CSS.escape(t)}"]`);return n&&(n.open=!0),n}}function PH(e){return t=>{HB(e,t)}}function FH(e){return t=>{YB(e,t)}}function IH(e){return t=>{qB(e,t)}}function LH(e){return t=>{dV(e,t)}}function RH(e){return t=>{RB(e,t)}}function zH(e){return()=>{dV(e,!0),bV(e,e.b6+1),e.b8.focus()}}function BH(){}function VH(e){return(t,n)=>{e.bn??=new WeakMap,e.bn.set(t,n);let r=e.a3||null;(!e.bo||e.bp!==r)&&(e.bo?.disconnect(),e.bp=r,e.bo=new IntersectionObserver(t=>{for(let n of t)n.isIntersecting&&(e.bo.unobserve(n.target),e.bn.get(n.target)?.())},{root:r,rootMargin:`800px 0px`})),e.bo.observe(t),requestAnimationFrame(()=>{if(!t.isConnected)return;let r=e.a3,i=t.getBoundingClientRect(),a=r?r.getBoundingClientRect():{top:0,bottom:window.innerHeight};i.bottom>=a.top-800&&i.top<=a.bottom+800&&(e.bo?.unobserve(t),n())})}}function HH(e){return async()=>{AB(e,[]),MB(e,null),await fetch(`/api/workspaces/${e.al}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})})}}function UH(e){return async()=>{if(!e.c2)try{let t=await H(`/api/workspaces/${e.al}/review`);if(e.c2)return;AB(e,t.comments||[])}catch{}}}R(`i25`,cH),R(`i24`,lH),R(`i32`,uH),R(`i29`,dH),R(`i27`,fH),R(`i30`,pH),R(`i28`,mH),R(`i31`,hH),R(`i26`,gH),R(`i7`,_H),R(`i14`,vH),R(`i15`,yH),R(`i16`,bH),R(`i12`,xH),R(`i6`,SH),R(`i5`,CH),R(`i3`,wH),R(`i2`,TH),R(`i13`,EH),R(`i10`,DH),R(`i9`,OH),R(`i8`,kH),R(`i18`,AH),R(`i23`,jH),R(`i20`,MH),R(`i17`,NH),R(`i35`,PH),R(`i34`,FH),R(`i33`,IH),R(`i22`,LH),R(`i21`,RH),R(`i19`,zH),R(`i0`,BH),R(`i1`,VH),R(`i11`,HH),R(`i4`,UH);var WH=`_cF _A`,GH=`_cG _E`,KH=`_c8 _G`,qH=`_c9 _H`,JH=((e,t)=>`<div role=region><div><div><header><div><h1>Manage</h1><p><span> </span><!><span aria-hidden=true>·</span><span> </span></p></div></header><!><!><section><div><h2>Repos</h2><span> </span><div></div><button title="Refresh repo list" aria-label="Refresh repo list">${e}</button></div><ul><!><!></ul><!><div>${t}</div></section><!><section><div><h2>Workspace</h2></div><div><!><button type=button> </button></div><p>Archive hides the space from the list. Delete removes it and its worktrees.</p></section></div></div></div>`)(qo,Qo),YH=((e,t)=>` D D D D D b D D l%b b D o%b%b D Db D l b D/${e}&m D%b%l%b D0${t}&m%b D b D%b D m o`)(Jo,$o),XH=new Map,ZH=L(`k13`,e=>A(e.a,`click`,function(){window.open(`http://${location.hostname}:${e.d}`,`_blank`,`noopener`)})),QH=e=>{B(e.a,[`_h`,`_c2`]),ZH(e)},$H=M(3,e=>{z(e.a,`title`,`Open http://${typeof location>`u`?`localhost`:location.hostname}:${e.d}`),V(e.b,e.d)}),eU=k(0,`<button>:<!></button>`,` Db%`,QH,(e,t)=>$H(e,t[0])),tU=P(4,0,e=>eU(e,[e._.k,e=>String(e)])),nU=e=>{tU._(e),B(e.a,`_cW`)},rU=e=>B(e.a,`_c3`),iU=e=>{B(e.a,[`_cT`,`_cS`]),B(e.b,`_w`),B(e.c,`_cU`),B(e.d,`_cX`)},aU=(e,t)=>V(e.e,t),oU=(e,t)=>aU(e,t[0]),sU=e=>B(e.a,`_w`),cU=P(7,0,e=>V(e.b,e._.o)),lU=e=>{cU._(e),B(e.a,[`_cY`,`_m`])},uU=e=>B(e.a,[`_cK`,`_cL`]),dU=L(`k14`,e=>A(e.f,`click`,function(){e._._.b8(e.m)})),fU=e=>{B(e.a,`_cT`),B(e.b,`_cU`),B(e.c,[`_cV`,`_m`]),B(e.f,[`_cZ`,`_c1`]),dU(e)},pU=(e,t)=>z(e.b,`title`,t),mU=(e,t)=>V(e.d,t),hU=O(4,`<span></span>`,` `,nU),gU=(e,t)=>hU(e,+!t),_U=M(12,e=>{z(e.f,`title`,`Kill ${e.m}`),z(e.f,`aria-label`,`Kill process ${e.m}`)}),vU=(e,t)=>{pU(e,t[0]?.args),mU(e,t[0]?.cmd),yU(e,t[0]?.ports),_U(e,t[0]?.pid)},yU=M(10,e=>{gU(e,e.k?.length),tU(e)}),bU=k(4,`<li><div><span> </span><!></div><button type=button>×</button></li>`,` D D D l%l `,fU,vU),xU=P(29,0,e=>bU(e,[e._.bb,`pid`])),SU=e=>{xU._(e),CU._(e),B(e.a,`_cN`),B(e.b,`_cO`),B(e.c,`_cP`),B(e.e,`_cR`)},CU=P(29,0,e=>V(e.d,e._.bc)),wU=P(14,0,e=>V(e.c,e._.ar)),TU=e=>{wU._(e),B(e.a,`_cM`),B(e.b,`_w`)},EU=N(2,e=>{B(e.a,[`_cZ`,`_c1`,{_c0:e._._.aq===e._.m}]),V(e.b,e._._.aq===e._.m?`Remove?`:`×`)}),DU=N(3,e=>z(e.a,`title`,e._._.aq===e._.m?`Really remove ${e._.l}/? Uncommitted changes are lost.`:`Remove ${e._.l}/`),2),OU=I(84,e=>{EU(e),DU(e)},e=>e._._),kU=L(`k11`,e=>A(e.a,`click`,function(){e._._.aq===e._.k?.full_name?(yW(e._._,null),e._._.b6(e._.k)):(yW(e._._,e._.k?.full_name),setTimeout(()=>{yW(e._._,null)},4e3))})),AU=e=>{OU(e),jU._(e),MU._(e),kU(e)},jU=P(8,1,DU),MU=P(8,1,e=>{EU(e),DU(e)}),NU=P(33,1,e=>z(e.a,`disabled`,!!e._.an)),PU=L(`k16`,e=>A(e.a,`click`,function(){e._.b7(`restore`)})),FU=e=>{NU._(e),B(e.a,[`_d`,`_c6`]),PU(e)},IU=P(33,0,e=>{z(e.a,`disabled`,!!e._.an),V(e.b,e._.an===`archive`?`Archiving…`:`Archive`)}),LU=L(`k15`,e=>A(e.a,`click`,function(){e._.b7(`archive`)})),RU=e=>{IU._(e),B(e.a,[`_d`,`_c6`]),LU(e)},zU=I(82,e=>V(e.a,e._._.am),e=>e._._),BU=ft(`k10`,` `,` `,zU),VU=e=>{Or(e.a),Mr(e.a,BU(e)),wr(e.a,`inline`),Ir(e.a,tG(e)),Fr(e.a),Tr(e.a),br(e.a),Ar(e.a),Dr(e.a,{})},HU=O(8,`<span></span>`,` `,sU,`<button> </button>`,` D `,AU),UU=N(13,e=>HU(e,+!e._.ak.has(e.m))),WU=qe(23,UU),GU=e=>{WU._(e),B(e.a,`_cT`),B(e.b,`_cU`),B(e.c,[`_cV`,`_m`]),B(e.e,`_cW`),B(e.f,`_cX`)},KU=M(11,e=>{V(e.d,e.l),jU(e)}),qU=M(12,e=>{V(e.g,e.m),UU(e),MU(e)}),JU=O(7,`<span title="Base branch">⎇ <!></span>`,` Db%`,lU),YU=N(16,e=>JU(e,+(e.o===e.p))),XU=M(14,e=>{YU(e),cU(e)}),ZU=M(15,YU),QU=(e,t)=>$U(e,t[0]),$U=M(10,e=>{KU(e,e.k?.worktree),qU(e,e.k?.full_name),XU(e,e.k?.base_branch),ZU(e,e.k?.default_branch)}),eW=tt(72),tW=j(44,e=>{B(e.u,[KH,{[qH]:e.ai}]),z(e.u,`disabled`,e.ai)}),nW=M(67,e=>Xs(e.a1,nG(e))),rW=N(80,e=>nW(e,rG(e)),2),iW=M(68),aW=N(79,e=>iW(e,iG(e)),2),oW=M(66,e=>{rW(e),aW(e)}),sW=k(24,`<li><span></span><div><span>Adding <!>…</span></div></li>`,` D b D Db%`,iU,oU),cW=N(78,e=>sW(e,[[...e.ak].filter(t=>!e.b3.has(t)),e=>e])),lW=j(46,e=>{kW(e,e.ak?.size),oW(e,aG(e)),rW(e),aW(e),cW(e),WU(e)}),uW=O(13,tr,(e=>`/${e}&`)(nr),VU),dW=F(zU),fW=j(48,e=>{uW(e,+!e.am),dW(e)}),pW=N(77,L(`k18`,e=>Tt(e,{busyCount:e.al,pendingAction:e.an,onMount:function(){let t=new AbortController,n=t.signal;return xn().addEventListener(`workspace.progress`,t=>{(this.pendingAction||this.busyCount)&&t.data?.message&&t.data.op===e.av&&bW(e,t.data.message)},{signal:n}),e.b2(n),{abort:t}},onDestroy:function(){this.abort.abort()}})),3),mW=O(14,`<p><span></span> </p>`,` D b `,TU),hW=N(54,e=>mW(e,e.an&&e.ar?0:1)),gW=N(51,e=>V(e.a9,e.an===`delete`?`Deleting…`:e.ao?`Really delete?`:`Delete`)),_W=j(49,e=>{z(e.a8,`disabled`,!!e.an),pW(e),hW(e),gW(e),IU(e),NU(e)}),vW=j(50,e=>{B(e.a8,[`_d`,`_g`,`_c6`,{_f:e.ao}]),gW(e)}),yW=j(52,F(OU)),bW=j(53,e=>{hW(e),wU(e)}),xW=(e,t)=>{z(e.a,`aria-labelledby`,t),z(e.f,`id`,t)},SW=L(`k17`,e=>{A(e.u,`click`,function(){eW(e)()}),A(e.a8,`click`,function(){e.ao?(vW(e,!1),e.b7(`delete`)):(vW(e,!0),setTimeout(()=>{vW(e,!1)},4e3))})});function CW(e){B(e.a,`_y`),B(e.b,`_z`),B(e.c,WH),B(e.d,`_C`),B(e.e,`_D`),B(e.g,GH),B(e.h,`_cH`),B(e.k,`_cI`),B(e.l,[`_cJ`,`_m`]),B(e.p,`_cN`),B(e.q,`_cO`),B(e.r,`_cP`),B(e.t,`_n`),Yo(e.v),Xo(e.v,14),Zo(e.v),B(e.w,`_cR`),B(e.a0,`_cQ`),Qe(e,27,QW),qs(e.a1),Js(e.a1,sG(e)),Is(e.a1,oG(e)),Fs(e.a1),Zs(e.a1),B(e.a4,[`_cN`,`_c4`]),B(e.a5,`_cO`),B(e.a6,`_c5`),B(e.aa,`_c7`),tW(e,!1),lW(e,new Set),fW(e,null),_W(e,null),vW(e,!1),yW(e,null),bW(e,null),xW(e,$e(e)),SW(e)}var wW=M(73,e=>{eG(e,e.bb.length),xU(e)}),TW=j(45,e=>wW(e,e.aj||[])),EW=(e,t)=>TW(e,XH.get(`procs:${t}`)||null),DW=O(25,`<p>No repos yet — search below to add one.</p>`,` `,rU),OW=N(76,e=>DW(e,!e.b1&&!e.al?0:1)),kW=M(47,e=>{pW(e),OW(e)}),AW=M(69),jW=N(75,e=>AW(e,cG(e)),2),MW=e=>{z(e.g,`title`,e.ax||e.ay),V(e.m,e.ax||e.ay)},NW=Ke(55,e=>{PW(e,e.at),aW(e),jW(e),MW(e)}),PW=e=>{LW(e,e.at?.id),BW(e,e.at?.repos),HW(e,e.at?.display_path),UW(e,e.at?.path),WW(e,e.at?.name),qW(e,e.at?.status)},FW=M(70),IW=M(64,e=>{FW(e,lG(e)),pW(e)}),LW=M(57,e=>{IW(e,uG(e)),pW(e),rW(e)}),RW=M(65,e=>{Ys(e.a1,e.b3),cW(e)}),zW=k(23,`<li><div><span><!>/</span><span><span> </span><!></span></div><!></li>`,` D D D%l D D l%m%`,GU,QU),BW=M(58,e=>{VW(e,e.aw?.length),RW(e,new Set(e.aw.map(e=>e.full_name))),zW(e,[e.aw,`full_name`])}),VW=M(63,e=>{V(e.s,e.b1),OW(e)}),HW=M(59),UW=M(60),WW=M(61,e=>V(e.i,e.az)),GW=O(9,`<span>Archived</span>`,` `,uU),KW=O(33,`<button type=button> </button>`,` D `,RU,`<button type=button>Restore</button>`,` `,FU),qW=M(62,e=>{GW(e,+(e.b0===`active`)),KW(e,e.b0===`active`?0:1)}),JW=N(42,e=>NW(e,e.ad,e.af)),YW=M(39,e=>{EW(e,e.ad?.id),JW(e)}),XW=M(41,e=>{JW(e),jW(e)}),ZW=M(43,jW),QW=at(`k12`,M(72)),$W=O(29,`<section><div><h2>Running</h2><span> </span></div><ul></ul></section>`,` D Db D m `,SU),eG=M(74,e=>{$W(e,+!e.bc),CU(e)});function tG(e){return function(){fW(e._,null)}}function nG(e){return function(t,n){e.b5(t,n)}}function rG(e){return async(t,n)=>{if(!(!t||e.ak.has(t))){fW(e,null),e.b4(t,!0);try{NW(e,await H(`/api/workspaces/${e.av}/repos`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t,baseBranch:n})}))}catch(t){fW(e,String(t.message||t))}e.b4(t,!1)}}}function iG(e){return async t=>{if(!e.ak.has(t.full_name)){fW(e,null),e.b4(t.full_name,!0);try{await H(`/api/workspaces/${e.at?.id}/repos/${encodeURIComponent(t.worktree)}`,{method:`DELETE`}),NW(e,{...e.at,repos:(e.at?.repos).filter(e=>e.full_name!==t.full_name)})}catch(t){fW(e,String(t.message||t))}e.b4(t.full_name,!1)}}}function aG(e){return(t,n)=>{let r=new Set(e.ak);n?r.add(t):r.delete(t),lW(e,r)}}function oG(e){return function(t){tW(e,t)}}function sG(e){return function(t){fW(e,t)}}function cG(e){return async t=>{fW(e,null),_W(e,t),bW(e,null);try{await H(`/api/workspaces/${e.at?.id}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:t})}),t===`archive`?e.af?.({...e.at,status:`archived`}):t===`delete`&&e.ah?.()}catch(t){fW(e,String(t.message||t))}finally{_W(e,null),bW(e,null)}}}function lG(e){return async t=>{await fetch(`/api/procs/${t}`,{method:`DELETE`}),setTimeout(()=>e.b2(void 0),500)}}function uG(e){return async t=>{try{let n=await H(`/api/workspaces/${e.av}/procs`,{signal:t});TW(e,n),XH.set(`procs:${e.av}`,n)}catch{}}}R(`k6`,tG),R(`k7`,nG),R(`k2`,rG),R(`k3`,iG),R(`k1`,aG),R(`k9`,oG),R(`k8`,sG),R(`k4`,cG),R(`k5`,lG),R(`k0`,uG);var dG=`_bY _A _B`,fG=`_bZ _G`,pG=`_b0 _H`,mG=(e=>`<div role=region><div><div><header><div><h1>Usage</h1><p>Provider plan windows across your agents.</p></div><div><button title="Refresh usage" aria-label="Refresh usage">${e}</button></div></header><!></div></div></div>`)(qo),hG=(e=>` D D D D D b l D D/${e}&n%n`)(Jo);function gG(e){let t=Math.round(e/6e4);if(t<60)return`${t}m`;let n=Math.round(t/60);return n<48?`${n}h`:`${Math.round(n/24)}d`}function _G(e,t){if(!e)return null;let n=new Date(e).getTime()-Date.now();return n<=0?t?null:`now`:gG(n)}var vG=P(7,0,e=>V(e.b,e._.n)),yG=e=>{vG._(e),B(e.a,`_b_`)},bG=(e,t)=>V(e.i,t?`↻ ${mt(t)}`:``),xG=N(13,e=>bG(e,_G(e.m,e._.k!=null))),SG=qe(6,xG),CG=e=>{SG._(e),B(e.a,`_ca`),B(e.b,`_cb`),B(e.d,`_cc`),B(e.h,`_cn`)},wG=N(16,e=>z(e.a,`title`,`${e.o}: ${e.p}% used${e.m?` — resets ${new Date(e.m).toLocaleString()}`:``}`),2),TG=M(15,e=>{V(e.g,e.p),wG(e)}),EG=(e,t)=>B(e.e,[`_cd`,t]),DG=(e,t)=>B(e.f,[`_ci`,t]),OG=(e,t)=>{gt(e.e,`width:${Math.min(100,Math.max(2,t))}%`),TG(e,Math.round(t)),EG(e,t>=90?`_ch`:t>=70?`_cg`:t>=40?`_cf`:`_ce`),DG(e,t>=90?`_cm`:t>=70?`_cl`:t>=40?`_ck`:`_cj`)},kG=M(12,e=>{xG(e),wG(e)}),AG=M(14,e=>{V(e.c,e.o),wG(e)}),jG=(e,t)=>{OG(e,t[0]?.used_percent),kG(e,t[0]?.resets_at),AG(e,t[0]?.window)},MG=N(2,e=>z(e.a,`title`,`${e._.n||`couldn't reach this provider`} — these are the last cached numbers, ${gG(e._.k*1e3)} old`)),NG=P(4,0,e=>{V(e.b,gG(e._.k*1e3)),MG(e)}),PG=e=>{NG._(e),FG._(e),B(e.a,`_b7`)},FG=P(4,0,MG),IG=P(3,0,e=>V(e.b,e._.m.replace(/^default_/,``).replaceAll(`_`,` `))),LG=e=>{IG._(e),B(e.a,`_b6`)},RG=O(4,`<span>⚠ <!> old</span>`,` Db%`,PG),zG=M(10,e=>{B(e.a,[`_b4`,{_b8:e.k!=null}]),RG(e,+(e.k==null)),NG(e),SG(e)}),BG=e=>{B(e.b,`_b5`),B(e.f,`_b9`)},VG=(e,t)=>V(e.c,t),HG=O(3,`<span> </span>`,` D `,LG),UG=M(12,e=>{HG(e,+!e.m),IG(e)}),WG=k(6,`<div><span> </span><span><span></span></span><span><!>%</span><span> </span></div>`,` D D l D l D%l D `,CG,jG),GG=(e,t)=>WG(e,[t||[],`window`]),KG=O(7,`<p> </p>`,` D `,yG),qG=M(13,e=>{KG(e,+!e.n),FG(e),vG(e)}),JG=(e,t)=>{zG(e,t[0]?.stale_seconds),VG(e,t[0]?.agent),UG(e,t[0]?.plan),qG(e,t[0]?.note),GG(e,t[0]?.windows)},YG=e=>{B(e.a,[`_l`,`_b2`]),B(e.b,`_w`)},XG=k(0,`<div><div><strong> </strong><!><!></div><div><!><!></div></div>`,` D E l%b%l D%b%`,BG,JG),ZG=P(10,2,e=>XG(e,[e._.n||[],e=>`${e.agent}-${e.account||``}`])),QG=e=>{ZG._(e),B(e.a,`_b3`)},$G=P(10,1,e=>V(e.b,e._.m)),eK=O(10,`<p><span></span> Loading usage…</p>`,` D `,YG,`<p> </p>`,` D `,e=>{$G._(e),B(e.a,[`_l`,`_b2`])},`<div></div>`,` `,QG),tK=j(11,e=>{nK(e,e.l?.error),rK(e,e.l?.agents),eK(e,e.l?e.l?.error?1:2:0)}),nK=M(12,$G),rK=M(13,ZG),iK=j(14,e=>{B(e.i,[fG,`_b1`,{[pG]:e.o}]),z(e.i,`disabled`,e.o)}),aK=M(16),oK=L(`x3`,e=>Tt(e,{onMount:function(){e.p(!1)}})),sK=M(15,e=>{aK(e,dK(e)),oK(e)}),cK=(e,t)=>{z(e.a,`aria-labelledby`,t),z(e.f,`id`,t)},lK=L(`x2`,e=>A(e.i,`click`,function(){e.q()}));function uK(e){B(e.a,`_y`),B(e.b,`_z`),B(e.c,dG),B(e.d,`_C`),B(e.e,`_D`),B(e.g,`_E`),B(e.h,`_F`),Yo(e.j),Xo(e.j,14),Zo(e.j),tK(e,null),iK(e,!1),sK(e,fK(e)),cK(e,$e(e)),lK(e)}function dK(e){return async()=>{iK(e,!0),await e.p(!0),iK(e,!1)}}function fK(e){return async t=>{try{tK(e,await H(`/api/usage${t?`?refresh`:``}`))}catch(t){tK(e,{error:String(t.message||t)})}}}R(`x1`,dK),R(`x0`,fK);var pK=Object.defineProperty,mK=Object.getOwnPropertyDescriptor,hK=(e,t)=>{for(var n in t)pK(e,n,{get:t[n],enumerable:!0})},gK=(e,t,n,r)=>{for(var i=r>1?void 0:r?mK(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&pK(t,n,i),i},J=(e,t)=>(n,r)=>t(n,r,e),_K=`Terminal input`,vK={get:()=>_K,set:e=>_K=e},yK=`Too much output to announce, navigate to rows manually to read`,bK={get:()=>yK,set:e=>yK=e};function xK(e){return e.replace(/\r?\n/g,`\r`)}function SK(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function CK(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function wK(e,t,n,r){e.stopPropagation(),e.clipboardData&&TK(e.clipboardData.getData(`text/plain`),t,n,r)}function TK(e,t,n,r){e=xK(e),e=SK(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function EK(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function DK(e,t,n,r,i){EK(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function OK(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function kK(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var AK=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},jK=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},MK=``,NK=` `,PK=class e{constructor(){this.fg=0,this.bg=0,this.extended=new FK}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},FK=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},IK=class e extends PK{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new FK,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?OK(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},LK=`di$target`,RK=`di$dependencies`,zK=new Map;function BK(e){return e[RK]||[]}function VK(e){if(zK.has(e))return zK.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);HK(t,e,r)};return t._id=e,zK.set(e,t),t}function HK(e,t,n){t[LK]===t?t[RK].push({id:e,index:n}):(t[RK]=[{id:e,index:n}],t[LK]=t)}var UK=VK(`BufferService`),WK=VK(`CoreMouseService`),GK=VK(`CoreService`),KK=VK(`CharsetService`),qK=VK(`InstantiationService`),JK=VK(`LogService`),YK=VK(`OptionsService`),XK=VK(`OscLinkService`),ZK=VK(`UnicodeService`),QK=VK(`DecorationService`),$K=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new IK,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):eq(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};$K=gK([J(0,UK),J(1,YK),J(2,XK)],$K);function eq(e,t){if(confirm(`Do you want to navigate to ${t}?
1532
+ `);for(let t=0;t<l.length;t++){if(o.length>=oj||c>=goe)return;let u=t+1;if(!s.has(u))continue;let d=l[t],f=(i?d:d.toLowerCase()).indexOf(r);f<0||n===`deletions`&&a.has(d)||(n===`additions`&&a.add(d),c++,o.push({key:e.key,path:e.path,repo:e.repo,line:u,side:n,preview:yoe(d,f,r.length)}))}}function yoe(e,t,n){let r=Math.max(0,t-36),i=Math.min(e.length,t+n+36);return(r>0?`…`:``)+e.slice(r,i)+(i<e.length?`…`:``)}var lj=`_eM _y`,boe=`<div><input type=search enterkeyhint=search autocomplete=off placeholder="Find in diffs" aria-label="Find in diffs"><span> </span><button type=button title="Previous match">↑</button><button type=button title="Next match">↓</button><button type=button title="Close find">×</button></div>`,xoe=` D b D l b b l`,uj=N(49,L(`f8`,e=>{e.a8=!!e.v,e.t&&(e.t.focus=e.am)}),3),dj=N(50,L(`f7`,e=>Tt(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(!e.a8)return;if(t.key===`Escape`){if(document.querySelector(`dialog[open]`)||t.target instanceof HTMLTextAreaElement)return;t.preventDefault(),e.al();return}let n=t.metaKey||t.ctrlKey;(t.key===`F3`||n&&t.key.toLowerCase()===`g`)&&(t.preventDefault(),e.ak(t.shiftKey?-1:1))},{signal:t.signal}),e.ad=e.u,e.ae=!!e.v,e.v&&e.am(),{abort:t}},onUpdate:function(){e.u!==e.ad&&(e.ad=e.u,e.v&&e.am()),e.v&&!e.ae?(e.ae=!0,e.am()):!e.v&&e.ae&&(e.ae=!1,e.ab&&=(clearTimeout(e.ab),0),ig(``,null),xj(e,{query:``,hit:null,keys:[]}))},onDestroy:function(){e.ab&&clearTimeout(e.ab),this.abort.abort(),ig(``,null),xj(e,{query:``,hit:null,keys:[]})}})),8),fj=N(32,e=>V(e.d,e.v&&(e.x||``).trim()?e.a2?`${e.a5+1}/${e.a2}`:`0/0`:``),3),pj=N(29,e=>{z(e.e,`disabled`,!e.a2||!e.v),z(e.f,`disabled`,!e.a2||!e.v)}),mj=Ke(21,e=>{B(e.a,[`_eI`,!e.v&&`_eH`]),z(e.a,`aria-hidden`,e.v?`false`:`true`),z(e.b,`tabindex`,e.v?0:-1),z(e.e,`tabindex`,e.v?0:-1),z(e.f,`tabindex`,e.v?0:-1),z(e.g,`tabindex`,e.v?0:-1),uj(e),dj(e),fj(e),pj(e)}),hj=N(11,e=>mj(e,e.j,e.k)),Soe=M(9,hj),Coe=M(10,hj),woe=(e,t)=>Nj(e,t?.length),gj=N(25,e=>woe(e,sj(e.s,e.x||``))),Toe=M(46,dj),_j=N(43,e=>Toe(e,Uj(e)),4),vj=N(45,e=>jt(e,`b`,e.x||``,Wj(e))),yj=Ke(23,e=>{gj(e),_j(e),vj(e),fj(e)}),bj=N(14,e=>yj(e,e.m,e.n)),Eoe=M(12,bj),Doe=M(13,bj),xj=Ke(14),Sj=N(17,e=>xj(e,e.p,e.q)),Ooe=M(15,Sj),koe=M(16,Sj),Aoe=M(31,e=>{_j(e),fj(e)}),Cj=N(30,e=>Aoe(e,e.a2?Math.min(e.a0,e.a2-1):-1)),joe=M(44,vj),wj=N(42,e=>joe(e,Gj(e)),3),Tj=M(41,e=>{wj(e),_j(e)}),Ej=N(35,e=>Tj(e,Kj(e)),2),Dj=j(26,e=>{Cj(e),Ej(e)}),Oj=(e,t)=>Lj(e,t.open),kj=(e,t)=>{Rj(e,t.timer),zj(e,t.tick),Bj(e,t.wasOpen)},Aj=M(48,e=>{uj(e),dj(e)}),jj=L(`f6`,e=>{Mt(e,`b`),A(e.b,`keydown`,function(t){if(e.v){if(t.key===`Escape`){t.preventDefault(),e.al();return}t.key===`Enter`&&(t.preventDefault(),e.ak(t.shiftKey?-1:1))}}),A(e.e,`mousedown`,function(e){e.preventDefault()}),A(e.e,`click`,function(){e.ak(-1)}),A(e.f,`mousedown`,function(e){e.preventDefault()}),A(e.f,`click`,function(){e.ak(1)}),A(e.g,`mousedown`,function(e){e.preventDefault()}),A(e.g,`click`,function(){e.al()})});function Mj(e){B(e.b,`_eJ`),B(e.c,`_eL`),B(e.e,lj),B(e.f,lj),B(e.g,lj),Dj(e,0),Oj(e,{open:!1}),kj(e,{timer:0,tick:0,wasOpen:!1}),Aj(e,qj(e)),jj(e)}var Nj=M(28,e=>{Cj(e),fj(e),pj(e)}),Pj=M(18,e=>{gj(e),Ej(e),wj(e)}),Fj=M(47,dj),Ij=N(38,e=>Fj(e,Jj(e))),Lj=M(34,e=>{Ej(e),wj(e),_j(e),Ij(e),uj(e),dj(e)}),Rj=M(37,e=>{wj(e),_j(e),Ij(e),dj(e)}),zj=M(39,dj),Bj=M(40,dj),Vj=M(19,uj),Hj=M(20,dj);function Uj(e){return t=>{e.a8&&(e.ab&&=(clearTimeout(e.ab),0),e.af(e.x||``,(e.a5<0?0:e.a5)+t))}}function Wj(e){return function(t){e.ai(t)}}function Gj(e){return t=>{e.a8&&(yj(e,t),Dj(e,0),ig(t,sj(e.s,t)[0]??null),e.ab&&clearTimeout(e.ab),e.ab=setTimeout(()=>{e.ab=0,e.af(t,0)},80))}}function Kj(e){return(t,n)=>{if(!e.a8)return;let r=sj(e.s,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){Dj(e,0),ig(t,null),xj(e,{query:t,hit:null,keys:i});return}Dj(e,(n%r.length+r.length)%r.length);let a=r[e.a0];ig(t,a),xj(e,{query:t,hit:a,keys:i})}}function qj(e){return()=>{let t=e.b;t&&(t.focus(),t.select(),document.activeElement!==t&&setTimeout(()=>{t.focus(),t.select()},0))}}function Jj(e){return()=>{mj(e,!1),e.a8=!1,e.ab&&=(clearTimeout(e.ab),0),ig(``,null),xj(e,{query:``,hit:null,keys:[]})}}R(`f3`,Uj),R(`f0`,Wj),R(`f2`,Gj),R(`f1`,Kj),R(`f5`,qj),R(`f4`,Jj);var Yj=Ur,Xj=(e=>`/${e}&`)(Wr);function Zj(e){Jr(e.a,`M17 17L21 21 M3 11C3 15.4183 6.58172 19 11 19C13.213 19 15.2161 18.1015 16.6644 16.6493C18.1077 15.2022 19 13.2053 19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11Z`)}var Qj=(e,t)=>Kr(e.a,t),$j=(e,t)=>qr(e.a,t);function eM(e,t){let n=null,r=()=>{if(!n||t.aborted)return;let i=e().closest(`[data-diff-main]`);if(i){let t=i.getBoundingClientRect(),r=0;if(n.y>=t.bottom-110?r=Math.max(4,Math.min(20,(n.y-(t.bottom-110))/3)):n.y<=t.top+110&&(r=-Math.max(4,Math.min(20,(t.top+110-n.y)/3))),r){i.scrollTop+=r;let a=e().getBoundingClientRect(),o=Math.max(t.top+12,a.top+48),s=Math.min(t.bottom-12,a.bottom-48),c=Math.max(o,Math.min(n.y,s));document.dispatchEvent(new PointerEvent(`pointermove`,{clientX:n.x,clientY:c,pointerId:n.pointerId,pointerType:`touch`,bubbles:!0,composed:!0}))}}requestAnimationFrame(r)};e().addEventListener(`pointerdown`,e=>{e.pointerType!==`mouse`&&e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute?.(`data-column-number`))&&(n={pointerId:e.pointerId,x:e.clientX,y:e.clientY},requestAnimationFrame(r))},{capture:!0,signal:t}),document.addEventListener(`pointermove`,e=>{n&&e.pointerId===n.pointerId&&e.isTrusted&&(n.x=e.clientX,n.y=e.clientY)},{capture:!0,passive:!0,signal:t});for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,e=>{n&&e.pointerId===n.pointerId&&(n=null)},{capture:!0,signal:t})}var tM=`<div></div>`,nM=`background:var(--panel);border-block:1px solid var(--border);padding:.5rem .75rem;font-family:system-ui,sans-serif;font-size:.85rem;display:flex;flex-direction:column;gap:.35rem;`,rM=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;`,iM=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;background:var(--accent);color:light-dark(#fff,#10131f);border-color:transparent;`,aM=`font:inherit;max-width:8rem;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .35rem;background:inherit;color:inherit;`,oM=new CSSStyleSheet;oM.replaceSync(`:host { display: block; max-width: 100%; overflow-x: auto; } @media (pointer: coarse) { pre[data-diff] { touch-action: pan-x pan-y; } [data-column-number], [data-gutter-utility-slot] { touch-action: none !important; } }`+tg);var sM=ot(`e0`,0);function cM(e){B(e.a,`_eG`)}var lM=N(14,L(`e1`,e=>Tt(e,{file:e.d,comments:e.e,draft:e.f,sessions:e.g,onMount:function(){let t=()=>e.g||[],n=()=>{let e=t();if(e.length<=1)return null;let n=document.createElement(`select`);n.setAttribute(`aria-label`,`Send to session`),n.style.cssText=aM;for(let t of e){let e=document.createElement(`option`);e.value=t.id,e.textContent=t.title||t.agent,n.append(e)}return n},r=e=>e?.value||t()[0]?.id||null,i=(e,t,n)=>{for(let r of e)r.disabled=t,n&&r.dataset.role===`send`&&(r.textContent=t?`Sending…`:n)},a=a=>{if(!a)return;let o=document.createElement(`div`);o.style.cssText=nM;let s=document.createElement(`p`);s.textContent=a.text,s.style.cssText=`margin:0;white-space:pre-wrap;`;let c=document.createElement(`div`);c.style.cssText=`display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;`;let l=document.createElement(`button`);l.type=`button`,l.textContent=`Remove`,l.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;font-size:.75rem;opacity:.85;`,l.onclick=()=>e.h?.(a.id);let u=t().length>0&&!!e.i,d=document.createElement(`button`);d.type=`button`,d.dataset.role=`send`,d.textContent=`Send`,d.style.cssText=`font:inherit;cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:.2rem .6rem;background:none;color:inherit;background:var(--accent);color:light-dark(#fff,#10131f);border-color:transparent;font-size:.75rem;`,d.hidden=!u;let f=u?n():null;return f&&(f.style.fontSize=`.75rem`),d.onclick=()=>{(async()=>{let t=r(f);if(!(!t||d.disabled)){i([l,d],!0,`Send`);try{await e.i?.(a.id,t)}finally{i([l,d],!1,`Send`)}}})()},c.append(l),u&&(c.append(d),f&&c.append(f)),o.append(s,c),o},o=()=>{let a=document.createElement(`div`);a.style.cssText=nM;let o=document.createElement(`textarea`);o.placeholder=`Leave a comment…`,o.rows=3,o.style.cssText=`font:inherit;width:100%;resize:vertical;border:1px solid var(--border);border-radius:var(--radius);padding:.4rem .5rem;background:inherit;color:inherit;`+(Xn()?`font-size:16px;`:``);let s=document.createElement(`button`);s.type=`button`,s.textContent=`Add`,s.style.cssText=rM;let c=document.createElement(`button`);c.type=`button`,c.dataset.role=`send`,c.textContent=`Send`,c.style.cssText=iM;let l=document.createElement(`button`);l.type=`button`,l.textContent=`Cancel`,l.style.cssText=rM;let u=t().length>0&&!!e.j;c.hidden=!u;let d=u?n():null;s.onclick=()=>{o.value.trim()&&e.k?.(o.value)},c.onclick=()=>{(async()=>{let t=o.value.trim(),n=r(d);if(!(!t||!n||c.disabled)){i([s,c,l],!0,`Send`);try{await e.j?.(t,n)}finally{i([s,c,l],!1,`Send`)}}})()},l.onclick=()=>e.l?.(),o.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),u?c.onclick():s.onclick()),e.key===`Escape`&&l.onclick()};let f=document.createElement(`div`);f.style.cssText=`display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;`,f.append(s),u&&(f.append(c),d&&f.append(d)),f.append(l),a.append(o,f);let p=()=>o.scrollIntoView({block:`center`,behavior:`smooth`});return o.addEventListener(`focus`,()=>{let e=window.visualViewport;e&&(e.addEventListener(`resize`,p),o.addEventListener(`blur`,()=>e.removeEventListener(`resize`,p),{once:!0}))}),setTimeout(()=>{o.scrollIntoView({block:`center`,behavior:`instant`}),o.focus()},0),a},s=new Map,c,l={draft:!0},u,d=new doe({diffStyle:Zn()?`unified`:`split`,disableFileHeader:!0,enableLineSelection:!0,onLineSelectionEnd(t){if(!t)return;let n=t.endSide!=null&&t.endSide!==t.side;e.m?.({side:t.side,start:t.start,end:n?t.start:t.end})},renderAnnotation(e){let t=e.metadata||{};return t.draft?u??=o():a(t.comment)}}),f=()=>{let t=[],n=new Map;for(let r of e.e||[]){let e=s.get(r.id)||{comment:r};n.set(r.id,e),t.push({side:r.side,lineNumber:r.line_end,metadata:e})}return s=n,e.f&&(c!==e.f&&(c=e.f,l={draft:!0},u=void 0),t.push({side:e.f.side,lineNumber:e.f.end,metadata:l})),t},p=()=>{let t=e.a.querySelector(`diffs-container`)?.shadowRoot;t&&!t.adoptedStyleSheets.includes(oM)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,oM])},m=()=>{if(e.d.old==null&&e.d.new==null){e.n?.(`could not read ${e.d.path}`);return}let t=d.render({containerWrapper:e.a,oldFile:e.d.old==null?null:{name:e.d.oldPath||e.d.path,contents:e.d.old},newFile:e.d.new==null?null:{name:e.d.path,contents:e.d.new},lineAnnotations:f()});Promise.resolve(t).then(()=>{p(),dg(e.a)}).catch(t=>e.n?.(`diff render: ${t}`))};m();let h=new AbortController;return Xn()&&eM(sM(e),h.signal),{instance:d,render:m,dragAbort:h,unregSearch:ug(e.a,e.d.key),shownFile:e.d,shownComments:e.e,shownDraft:e.f,shownSessions:e.g}},onUpdate:function(){this.shownDraft&&!this.draft&&this.instance.setSelectedLines(null),(this.file!==this.shownFile||this.comments!==this.shownComments||this.draft!==this.shownDraft||this.sessions!==this.shownSessions)&&(this.shownFile=this.file,this.shownComments=this.comments,this.shownDraft=this.draft,this.shownSessions=this.sessions,this.render())},onDestroy:function(){this.unregSearch(),this.dragAbort.abort(),this.instance.cleanUp?.()}})),10),uM=M(3,lM),dM=M(4,lM),fM=M(5,lM),pM=M(6,lM),mM=M(7,lM),hM=M(8,lM),gM=M(9,lM),_M=M(10,lM),vM=M(11,lM),yM=M(12,lM),bM=M(13,lM),xM=`<aside></aside>`,SM=e=>B(e.a,`_fa`),CM=N(4,e=>{B(e.a,[`_e8`,{_e4:e._._._._.r.has(e._._.f(e._.e))}]),V(e.c,e._._._._.r.has(e._._.f(e._.e))?`▸`:`▾`)},2),wM=I(21,CM,e=>e._._._._),TM=L(`h3`,e=>A(e.a,`click`,function(){let t=new Set(e._._._._.r);t.delete(e._._.f(e._.e))||t.add(e._._.f(e._.e)),NN(e._._._._,t)})),EM=e=>{wM(e),DM(e),OM._(e),kM._(e),AM._(e),B(e.b,`_fb`),TM(e)},DM=I(10,CM,e=>e._._),OM=P(0,0,e=>{z(e.a,`title`,e._.e),CM(e)}),kM=P(0,0,e=>gt(e.a,`padding-left:${.35+e._.f*.75}rem`)),AM=P(0,0,e=>V(e.d,e._.g)),jM=O(5,`<span>💬</span>`,` `,SM),MM=N(6,e=>jM(e,+!e._._._._.s.has(e._.j))),NM=I(22,MM,e=>e._._._._),PM=L(`h4`,e=>A(e.a,`click`,function(){e._._._._.m(e._.j)})),FM=e=>{NM(e),IM._(e),LM._(e),RM._(e),zM._(e),BM._(e),B(e.a,`_e9`),B(e.b,`_fc`),B(e.d,`_e_`),PM(e)},IM=P(0,1,e=>gt(e.a,`padding-left:${.5+e._.f*.75}rem`)),LM=P(0,1,e=>z(e.a,`title`,e._.i)),RM=P(0,1,MM),zM=P(0,1,e=>{z(e.b,`data-status`,e._.k),V(e.c,e._.k)}),BM=P(0,1,e=>V(e.e,e._.l)),VM=O(0,`<button type=button><span> </span><!>/</button>`,` D D l%`,EM,`<button type=button><span> </span><span> </span><!></button>`,` D D l D l%`,FM),HM=N(3,e=>VM(e,!e._.i(e.c)&&e.c?.kind===`dir`?0:!e._.i(e.c)&&e.c?.kind!==`dir`?1:2)),UM=qe(1,HM),WM=UM,GM=M(2,e=>{qM(e,e.c?.path),JM(e,e.c?.depth),YM(e,e.c?.label),XM(e,e.c?.file?.path),ZM(e,e.c?.file?.key),QM(e,e.c?.file?.status),$M(e,e.c?.name),HM(e)}),KM=(e,t)=>GM(e,t[0]),qM=M(4,OM),JM=M(5,e=>{IM(e),kM(e)}),YM=M(6,AM),XM=M(8,LM),ZM=M(9,RM),QM=M(10,zM),$M=M(11,BM),eN=de(3,0,2),tN=N(9,e=>eN(e,!e._._.n.has(e._.i))),nN=I(19,tN,e=>e._._),rN=M(8,UM),iN=N(7,e=>rN(e,VN(e)),2),aN=M(6,iN),oN=e=>{nN(e),sN(e),lN._(e),fN._(e),aN(e,HN)},sN=I(21,iN,e=>e._._),cN=M(5,F(DM)),lN=P(5,0,e=>{cN(e,UN(e)),iN(e),tN(e)}),uN=k(1,`<!><!><!>`,`b%`,WM,KM),dN=(e,t)=>uN(e,[t,e=>e.kind===`dir`?`d:${e.path}`:e.file.key]),fN=P(5,0,e=>dN(e,jg(e._.m))),pN=N(9,e=>{B(e.b,[`_e7`,{_e4:e._.n.has(e.i)}]),V(e.d,e._.n.has(e.i)?`▸`:`▾`)}),mN=O(5,`<!><!><!><!><!><!>`,`b%b%b%b%`,oN),hN=N(10,e=>mN(e,!e._.n.has(e.i)||e._.p.has(e.i)?0:1),2),gN=qe(0,e=>{pN(e),hN(e)}),_N=L(`h5`,e=>A(e.b,`click`,function(){let t=e.i,n=new Set(e._.n);n.delete(t)||(kN(e._,new Set([...e._.p,t])),n.add(t)),TN(e._,n)})),vN=e=>{gN._(e),yN._(e),B(e.a,`_e6`),B(e.c,`_fb`),_N(e)},yN=qe(0,hN),bN=M(8,e=>{pN(e),hN(e),lN(e)}),xN=(e,t)=>V(e.e,t),SN=(e,t)=>{bN(e,t[0]?.id),xN(e,t[0]?.label),CN(e,t[0]?.files)},CN=M(12,fN),wN=F(nN),TN=Ke(13,e=>{gN(e),wN(e)}),EN=N(5,e=>TN(e,e.d,e.e)),DN=M(3,EN),ON=M(4,EN),kN=Ke(15,yN),AN=N(8,e=>kN(e,e.g,e.h)),jN=M(6,AN),MN=M(7,AN),NN=j(17,F(sN,wM));function PN(e){NN(e,new Set)}var FN=M(18,F(NM)),IN=(e,t)=>FN(e,t||new Set),LN=(e,t)=>B(e.a,[`_e5`,{_e4:t===!1}]),RN=k(0,`<div><button type=button><span> </span> </button><!></div>`,` D D D l l%`,vN,SN),zN=(e,t)=>RN(e,[t,`id`]),BN=M(12);function VN(e){return t=>{let n=e.g(t);for(let r of e._._.r){let i=r.indexOf(`/`),a=r.slice(0,i),o=r.slice(i+1);if(a===e._.i&&(t.kind!==`dir`||t.path!==o)&&(n===o||n.startsWith(`${o}/`)))return!0}return!1}}function HN(e){return e.kind===`dir`?e.path:e.file.path.includes(`/`)?e.file.path.slice(0,e.file.path.lastIndexOf(`/`)):``}function UN(e){return t=>`${e._.i}/${t}`}R(`h2`,VN),R(`h1`,HN),R(`h0`,UN);var WN=`_eS _y`,GN=`<!><!><!>`,KN=O(5,`<span>💬</span>`),qN=N(9,e=>KN(e,+!e._._.o.has(e.i))),JN=I(18,qN,e=>e._._),YN=L(`d0`,e=>A(e.a,`click`,function(){sP(e._._,!1),e._._.l(e.i)})),XN=e=>{JN(e),B(e.a,[`_eZ`,`_m`]),B(e.b,`_e1`),B(e.d,`_e0`),YN(e)},ZN=(e,t)=>{z(e.b,`data-status`,t),V(e.c,t)},QN=M(8,e=>{z(e.d,`title`,e.i),V(e.e,e.i),qN(e)}),$N=k(7,`<button type=button><span> </span><span><bdi> </bdi></span><!></button>`,` D D l E m%`,XN,(e,t)=>{QN(e,t[0]?.key),ZN(e,t[0]?.status)}),eP=P(0,0,e=>$N(e,[e._.i,`key`])),tP=L(`d1`,e=>{A(e.a,`click`,function(){sP(e._,!1)}),A(e.g,`click`,function(){sP(e._,!1)})}),nP=e=>{eP._(e),iP._(e),aP._(e),B(e.a,`_eU`),B(e.b,`_eV`),B(e.c,`_eW`),B(e.d,`_eX`),B(e.g,WN),B(e.h,`_eY`),tP(e)},rP=N(8,e=>V(e.f,e._.j===e._.p?``:` / ${e._.p}`)),iP=P(0,0,e=>{V(e.e,e._.j),rP(e)}),aP=P(0,0,rP),oP=O(0,`<div></div><div role=dialog aria-label="Jump to file"><div><strong>Files</strong><span><!><!></span><button type=button title=Close aria-label=Close>×</button></div><div></div></div>`,` b D Db D%b%l l `,nP),sP=Ke(12,e=>oP(e,+!e.m)),cP=N(5,e=>sP(e,e.d,e.e)),lP=M(3,cP),uP=M(4,cP),dP=M(14,F(JN)),fP=(e,t)=>dP(e,t||new Set),pP=M(15,aP),mP=N(10,e=>pP(e,e.h??e.j)),hP=M(7,mP),gP=M(9,e=>{mP(e),iP(e)}),_P=M(8,e=>{gP(e,e.i?.length),eP(e)}),vP=M(11),yP=((e,t,n,r,i,a,o)=>`<div><div><div><div><!><div>${e}</div><div><h1>Review</h1><span><!><!></span></div><!></div><div><button>${t}</button><button title="Refresh diff">${n}</button><button title="Jump to file">Files (<!>)</button><div role=group aria-label="Review scope"><button type=button title="Committed changes only — base…tip, no working-tree edits">Committed</button><button type=button title="Include uncommitted and untracked files in the working tree">Working tree</button></div><button type=button> </button><div>${r}</div><button title="Find in the review (⌘/Ctrl+F)" aria-label="Find in the review">${i}</button></div></div><div data-diff-main><!><!><!><!><!><!><!><!></div></div>${a}${o}</div>`)(Hg,Rp,qo,boe,Yj,xM,GN),bP=((e,t,n,r,i,a,o)=>` D D D D%b D/${e}&l D b D%b%m%l D D/${t}&l D/${n}&l Db%l D b l D l D/${r}&l D/${i}&n D%b%b%b%b%b%b%b%m/${a}&/${o}&l`)(Ug,zp,Jo,xoe,Xj,` b`,`b%c`),xP=e=>B(e.a,`_d1`),SP=e=>B(e.a,`_d1`),CP=e=>B(e.a,`_d1`),wP=P(5,0,e=>V(e.b,e._.v)),TP=e=>{wP._(e),B(e.a,`_h`)},EP=P(8,0,e=>V(e.b,e._.p)),DP=e=>{EP._(e),B(e.a,`_dQ`)},OP=P(12,0,e=>V(e.b,e._.a0)),kP=e=>{OP._(e),B(e.a,`_dQ`)},AP=I(27,e=>V(e.b,e._._._.i),e=>e._._._),jP=e=>{AP(e),MP(e),PP(e),FP(e),IP(e),LP(e),RP(e),B(e.a,[`_h`,`_j`]),B(e.c,`_l`)},MP=I(28,e=>z(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),NP=N(4,e=>z(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),PP=I(29,e=>{V(e.d,e._._._.k),NP(e)},e=>e._._._),FP=I(30,NP,e=>e._._._),IP=I(31,NP,e=>e._._._),LP=I(32,NP,e=>e._._._),RP=I(33,NP,e=>e._._._),zP=I(34,e=>V(e.b,e._._._.p),e=>e._._._),BP=e=>{zP(e),B(e.a,Ig)},VP=I(27,e=>V(e.b,e._._._.i),e=>e._._._),HP=L(`i44`,e=>A(e.a,`click`,function(e){e.stopPropagation()})),UP=e=>{VP(e),WP(e),KP(e),qP(e),JP(e),YP(e),XP(e),B(e.a,[`_h`,`_j`]),B(e.c,Ig),HP(e)},WP=I(28,e=>z(e.a,`href`,`${e._._._.j}/files`),e=>e._._._),GP=N(4,e=>z(e.a,`title`,`${e._._._.k} — ${e._._._.l} ${e._._._.m} vs ${e._._._.n} ${e._._._.o}`),4),KP=I(29,e=>{V(e.d,e._._._.k),GP(e)},e=>e._._._),qP=I(30,GP,e=>e._._._),JP=I(31,GP,e=>e._._._),YP=I(32,GP,e=>e._._._),XP=I(33,GP,e=>e._._._),ZP=N(10,e=>z(e.a,`title`,`origin/${e.h} ${e.i} · GitHub ${e.j}`),2),QP=M(7,ZP),$P=M(8,e=>{V(e.c,Dg(e.i)),ZP(e)}),eF=M(9,e=>{V(e.d,Dg(e.j)),ZP(e)}),tF=(e,t)=>V(e.b,t>0?` · `:``),nF=(e,t)=>{QP(e,t[0]?.pr?.headRefName),eF(e,t[0]?.pr?.headRefOid),$P(e,t[0]?.head),tF(e,t[1])},rF=(e,t)=>V(e.a,t>0?` · `:``),iF=(e,t)=>V(e.b,t),aF=(e,t)=>V(e.c,t),oF=(e,t)=>{iF(e,t[0]?.worktree),aF(e,t[0]?.pr?.number),rF(e,t[1])},sF=e=>B(e.a,`_dZ`),cF=e=>B(e.a,`_dz`),lF=k(1,`<!><!> #<!>`,`%b%c%`,0,oF),uF=k(2,`<span><!><!> → <!></span>`,` D%b%c%`,0,nF),dF=I(181,e=>{lF(e,[e._._.cz,`id`]),uF(e,[e._._.cz,`id`])},e=>e._._),fF=ft(`i42`,`<span><!> — this view has a newer tip than the PR page.</span><span></span>`,` D%l `,e=>{dF(e),B(e.a,`_l`),B(e.c,[`_m`,`_dt`])}),pF=P(10,0,e=>V(e.b,e._.ch)),mF=e=>{pF._(e),hF._(e),B(e.a,`_dx`),B(e.c,`_dy`)},hF=P(10,0,e=>V(e.d,e._.ci)),gF=P(36,0,e=>V(e.b,e._.c9.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`)),_F=e=>{gF._(e),B(e.a,`_dZ`)},vF=I(171,L(`i46`,e=>Tt(e,{onMount:function(){e._._._._._._.br(e.a,()=>{MI(e._,!0)})}})),e=>e._._._._._._),yF=e=>{vF(e),B(e.a,`_dT`)},bF=I(163,e=>V(e.e,e._._.b1?`, plus uncommitted`:``),e=>e._._),xF=e=>{bF(e),SF(e),CF(e),wF(e),TF(e)},SF=I(11,e=>V(e.a,Dg(e._.h))),CF=I(12,e=>V(e.b,e._.i)),wF=I(13,e=>V(e.c,Dg(e._.j))),TF=I(14,e=>V(e.d,e._.k)),EF=ft(`i43`,`this view is <!> (<!>). Local is <!> (<!><!>).`,`b%c%c%c%b%`,xF),DF=e=>{Or(e.a),Mr(e.a,EF(e)),br(e.a,`info`),wr(e.a,`inline`),Fr(e.a),Tr(e.a),Ir(e.a),Dr(e.a,{})},OF=N(6,e=>Ar(e.a,`${e.d} #${e.f}`)),kF=M(3,OF),AF=M(5,OF),jF=(e,t)=>{kF(e,t[0]?.worktree),AF(e,t[0]?.pr?.number),MF(e,t[0]?.pr?.headRefName),NF(e,t[0]?.head),PF(e,t[0]?.localHead),FF(e,t[0]?.branch)},MF=M(8,F(CF)),NF=M(7,F(SF)),PF=M(9,F(wF)),FF=M(10,F(TF)),IF=I(163,e=>V(e.b,e._._.b1?` — showing uncommitted changes only`:``),e=>e._._),LF=e=>{IF(e),RF(e)},RF=I(7,e=>V(e.a,e._.g)),zF=ft(`i39`,`already in <!><!>.`,`b%b%`,LF),BF=e=>{Or(e.a),Mr(e.a,zF(e)),br(e.a,`info`),wr(e.a,`inline`),Fr(e.a),Tr(e.a),Ir(e.a),Dr(e.a,{})},VF=N(5,e=>Ar(e.a,e.d?`${e.e} #${e.d.number}`:e.e)),HF=M(3,VF),UF=M(4,VF),WF=(e,t)=>{HF(e,t[0]?.pr),UF(e,t[0]?.worktree),GF(e,t[0]?.base)},GF=M(6,F(RF)),KF=I(163,e=>V(e.b,e._._.b1?` — showing uncommitted changes only`:``),e=>e._._),qF=e=>{KF(e),JF(e)},JF=I(5,e=>V(e.a,e._.e)),YF=ft(`i38`,`<!><!>.`,`%b%`,qF),XF=e=>{Or(e.a),Mr(e.a,YF(e)),br(e.a,`warn`),wr(e.a,`inline`),Fr(e.a),Tr(e.a),Ir(e.a),Dr(e.a,{})},ZF=(e,t)=>Ar(e.a,`${t}: base not found`),QF=(e,t)=>{ZF(e,t[0]?.worktree),$F(e,t[0]?.base)},$F=M(4,F(JF)),eI=N(2,e=>V(e.b,e._.bb.trim()?`No matches in diffs.`:`No files match "${e._.b0}".`)),tI=P(36,1,eI),nI=e=>{tI._(e),rI._(e),B(e.a,`_dZ`)},rI=P(36,1,eI),iI=I(161,e=>{z(e.a,`disabled`,e._._.ay),V(e.b,e._._.ay?`Reloading…`:`Reload`)},e=>e._._),aI=L(`i40`,e=>A(e.a,`click`,function(){e._._.c5()})),oI=ft(`i41`,`<button> </button>`,` D `,e=>{iI(e),B(e.a,`_d`),aI(e)}),sI=P(34,0,e=>Ir(e.a,cH(e))),cI=e=>{sI._(e),Or(e.a),Fr(e.a,fee({content:oI(e)})),Mr(e.a,fF(e)),br(e.a,`info`),wr(e.a,`inline`),Ar(e.a,`GitHub is behind`),Tr(e.a),Dr(e.a,{})},lI=I(160,e=>V(e.a,e._._.ax),e=>e._._),uI=ft(`i37`,` `,` `,lI),dI=e=>{Or(e.a),Mr(e.a,uI(e)),Ir(e.a,lH(e)),Fr(e.a),Tr(e.a),br(e.a),wr(e.a),Ar(e.a),Dr(e.a,{})},fI=P(11,0,e=>{V(e.b,e._.av),V(e.c,e._.av===1?``:`s`)}),pI=e=>{fI._(e),B(e.a,`_dA`)},mI=I(156,e=>pM(e.a,e._._._._._._.ar||[]),e=>e._._._._._._),hI=e=>{mI(e),_I(e),yI(e),bI(e),SI(e),CI(e),wI(e),TI(e),EI(e),cM(e.a),vM(e.a,dH(e)),bM(e.a,uH(e))},gI=N(1,e=>fM(e.a,e._._._._._._.aw&&e._._._._._._.aw?.key===e._._.j?e._._._._._._.aw:null)),_I=I(159,gI,e=>e._._._._._._),vI=N(2,e=>_M(e.a,fH(e))),yI=I(183,vI,e=>e._._._._._._),bI=I(184,e=>mM(e.a,pH(e)),e=>e._._._._._._),xI=N(3,e=>gM(e.a,mH(e))),SI=I(187,xI,e=>e._._._._._._),CI=I(188,e=>hM(e.a,hH(e)),e=>e._._._._._._),wI=I(24,e=>{uM(e.a,e._._.i),vI(e),xI(e)},e=>e._._),TI=I(25,e=>{yM(e.a,gH(e)),gI(e)},e=>e._._),EI=I(26,e=>dM(e.a,e._._.u),e=>e._._),DI=O(0,`<div></div>`,` `,yF,tM,(e=>`/${e}&`)(` b`),hI),OI=N(3,e=>DI(e,e.b||e.c?1:0)),kI=M(2,OI),AI=N(4,e=>kI(e,e._._._._._.be===e._.j)),jI=I(165,AI,e=>e._._._._._),MI=j(1,OI),NI=e=>{jI(e),PI._(e),MI(e,!1)},PI=P(6,3,AI),FI=N(10,e=>B(e.a,[`_dS`,e._._._._.be===e.j&&`_dq`])),II=N(13,e=>B(e.d,[`_dY`,e._._._._.be===e.j&&e._._._._.bg<1&&`_dr`]),2),LI=I(165,e=>{FI(e),II(e)},e=>e._._._._),RI=O(6,`<p>binary file</p>`,` `,CP,`<p>file too large to display</p>`,` `,SP,`<p>file could not be read</p>`,` `,xP,`<!><!><!>`,`b%`,NI),zI=N(23,e=>RI(e,e.q?0:e.r?1:e.s==null&&e.t==null?2:e.w?3:4),4),BI=j(22,e=>{zt(e,`a`,e.w),zI(e)}),VI=L(`i47`,e=>A(e.a,`toggle`,function(t,n){if(BI(e,n.open),!n.open){let e=n.closest(`[data-diff-main]`);if(e){let t=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t<0&&(e.scrollTop+=t)}}})),HI=e=>{LI(e),UI(e),GI(e),YI(e),B(e.b,`_dX`),BI(e,!0),VI(e)},UI=I(167,II,e=>e._._._._),WI=N(11,e=>z(e.a,`hidden`,!e._._._._.cq.has(e.j))),GI=I(176,WI,e=>e._._._._),KI=F(EI),qI=M(20,e=>{ZI(e,e.u.length),KI(e)}),JI=N(12,e=>qI(e,e._._._._.cu.get(e.j)||[])),YI=I(179,JI,e=>e._._._._),XI=O(5,`<span>💬 <!></span>`,` Db%`,TP),ZI=M(21,e=>{XI(e,+!e.v),wP(e)}),QI=F(TI),$I=M(9,e=>{z(e.a,`data-key`,e.j),JI(e),FI(e),WI(e),II(e),PI(e),QI(e)}),eL=(e,t)=>{z(e.b,`data-status`,t),V(e.c,t)},tL=(e,t)=>{z(e.d,`title`,t),V(e.e,t)},nL=M(16,zI),rL=M(17,zI),iL=M(18,zI),aL=M(19,zI),oL=(e,t)=>cL(e,t[0]),sL=F(wI),cL=M(8,e=>{$I(e,e.i?.key),eL(e,e.i?.status),tL(e,e.i?.path),nL(e,e.i?.binary),rL(e,e.i?.tooLarge),iL(e,e.i?.old),aL(e,e.i?.new),sL(e)}),lL=de(2,0),uL=N(3,e=>lL(e,e._._._.cb===1||!e._._._.bh.has(e._._.d)),2),dL=I(168,uL,e=>e._._._),fL=e=>{dL(e),pL(e),mL(e),gL(e),B(e.b,`_dR`)},pL=I(173,uL,e=>e._._._),mL=I(24,uL,e=>e._._),hL=k(1,`<details><summary><span> </span><span><bdi> </bdi></span><!></summary><!></details>`,` E D l E m%l%`,HI,oL),gL=I(38,e=>hL(e,[e._._.t,`key`]),e=>e._._),_L=N(2,e=>V(e.b,Cg(e._._._.r,e._._._._.as||``))),vL=I(157,_L,e=>e._._._._),yL=e=>{vL(e),xL(e),SL(e),B(e.a,`_h`)},bL=N(3,e=>z(e.a,`title`,`checked out ${e._._._.r} ${e._._._.s}`)),xL=I(36,e=>{bL(e),_L(e)},e=>e._._._),SL=I(37,bL,e=>e._._._),CL=(e,t)=>{BL(e,t?.title),VL(e,t?.base),HL(e,t?.head),WL(e,t?.topic)},wL=N(17,e=>CL(e,Sg(e._._.q||e._._.n,e._._.l||e._._.r,e._._._.as||``)),4),TL=I(157,wL,e=>e._._._),EL=e=>{TL(e),kL(e),AL(e),ML(e),NL(e),FL(e),IL(e),LL(e),RL(e),zL(e),B(e.a,`_dL`),B(e.c,`_dM`),B(e.d,`_dN`),B(e.f,`_dP`),B(e.g,`_dO`)},DL=O(9,`<span>local <!></span>`,` Db%`,yL),OL=N(16,e=>DL(e,+!e._._._.cy.has(e._._.d))),kL=I(180,OL,e=>e._._._),AL=I(24,OL,e=>e._._),jL=O(1,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,jP),ML=I(25,e=>jL(e,+!e._._.g),e=>e._._),NL=I(30,wL,e=>e._._),PL=N(12,e=>z(e.c,`title`,`${e.l} · ${e._._.m.slice(0,7)}…${e._._.o.slice(0,7)}`),2),FL=I(31,PL,e=>e._._),IL=I(32,wL,e=>e._._),LL=I(33,PL,e=>e._._),RL=I(35,wL,e=>e._._),zL=I(36,wL,e=>e._._),BL=M(11,PL),VL=(e,t)=>V(e.e,t),HL=(e,t)=>V(e.h,t),UL=O(8,`<span> </span>`,` D `,DP),WL=M(15,e=>{UL(e,+!e.p),EP(e)}),GL=N(2,e=>V(e.b,Cg(e._._._.r,e._._._._.as||``))),KL=I(157,GL,e=>e._._._._),qL=e=>{KL(e),YL(e),XL(e),B(e.a,`_h`)},JL=N(3,e=>z(e.a,`title`,`checked out ${e._._._.r} ${e._._._.s}`)),YL=I(36,e=>{JL(e),GL(e)},e=>e._._._),XL=I(37,JL,e=>e._._._),ZL=(e,t)=>{DR(e,t?.title),OR(e,t?.base),kR(e,t?.head),jR(e,t?.topic)},QL=N(31,e=>ZL(e,Sg(e._._.q||e._._.n,e._._.l||e._._.r,e._._._.as||``)),4),$L=I(157,QL,e=>e._._._),eR=L(`i45`,e=>A(e.a,`click`,function(){let t=e._._.d;if(e._._._.bk.has(t)){let n=new Set(e._._._.bk);n.delete(t),XB(e._._._,n),e._._._.bh.has(t)||qB(e._._._,new Set([...e._._._.bh,t]));return}if(e._._._.bh.has(t)){if(e._._._.bi.has(t)){let n=new Set(e._._._.bh);n.delete(t),qB(e._._._,n);return}XB(e._._._,new Set([...e._._._.bk,t])),requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!e._._._.bk.has(t))return;let n=new Set(e._._._.bh);n.delete(t),qB(e._._._,n);let r=new Set(e._._._.bk);r.delete(t),XB(e._._._,r)})})}else YB(e._._._,new Set([...e._._._.bi,t])),qB(e._._._,new Set([...e._._._.bh,t]))})),tR=e=>{$L(e),oR(e),lR(e),fR(e),pR(e),hR(e),gR(e),_R(e),yR(e),bR(e),xR(e),SR(e),CR(e),TR(e),ER(e),B(e.d,Fg),B(e.g,`_dM`),B(e.h,`_dN`),B(e.j,`_dP`),B(e.k,`_dO`),B(e.o,`_dJ`),eR(e)},nR=N(18,e=>z(e.a,`title`,e.r?`Show ${e._._.x||e._._.u} files`:`Hide files`),2),rR=N(20,e=>B(e.b,[`_dU`,!e.r&&`_dV`,e.t&&`_dW`])),iR=M(17,e=>{B(e.a,[`_dG`,e.r&&`_dH`]),z(e.a,`aria-expanded`,e.r?`false`:`true`),V(e.c,e.r?`▸`:`▾`),nR(e),rR(e)}),aR=N(27,e=>iR(e,e._._._.bh.has(e._._.d))),oR=I(168,aR,e=>e._._._),sR=M(19,e=>{z(e.a,`aria-busy`,e.t?`true`:`false`),rR(e)}),cR=N(28,e=>sR(e,e._._._.bk.has(e._._.d))),lR=I(170,cR,e=>e._._._),uR=O(13,`<span>local <!></span>`,` Db%`,qL),dR=N(29,e=>uR(e,+!e._._._.cy.has(e._._.d))),fR=I(180,dR,e=>e._._._),pR=I(24,e=>{aR(e),cR(e),dR(e)},e=>e._._),mR=O(5,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,UP,`<span> </span>`,` D `,BP),hR=I(25,e=>mR(e,+!e._._.g),e=>e._._),gR=I(26,e=>V(e.e,e._._.h),e=>e._._),_R=I(30,QL,e=>e._._),vR=N(23,e=>z(e.g,`title`,`${e.w} · ${e._._.m.slice(0,7)}…${e._._.o.slice(0,7)}`),2),yR=I(31,vR,e=>e._._),bR=I(32,QL,e=>e._._),xR=I(33,vR,e=>e._._),SR=I(35,QL,e=>e._._),CR=I(36,QL,e=>e._._),wR=N(30,e=>{V(e.p,e._._.x||e._._.u),V(e.q,(e._._.x||e._._.u)===1?``:`s`)}),TR=I(39,e=>{nR(e),wR(e)},e=>e._._),ER=I(40,e=>{nR(e),wR(e)},e=>e._._),DR=M(22,vR),OR=(e,t)=>V(e.i,t),kR=(e,t)=>V(e.l,t),AR=O(12,`<span> </span>`,` D `,kP),jR=M(26,e=>{AR(e,+!e.a0),OP(e)}),MR=N(4,e=>z(e.a,`hidden`,!e._.x&&!e._.g&&e._._.bf!==e._.d),3),NR=I(166,MR,e=>e._._),PR=e=>{NR(e),LR(e),RR(e),BR(e),VR._(e),UR._(e),WR._(e),GR._(e),B(e.a,`_dF`)},FR=O(2,`<!><!><div></div><!><!>`,`b%b b%`,fL),IR=N(5,e=>FR(e,e._._.cb===1||!e._._.bh.has(e._.d)||e._._.bi.has(e._.d)?0:1),3),LR=I(168,IR,e=>e._._),RR=I(169,IR,e=>e._._),zR=O(1,`<button type=button><span aria-hidden=true> </span><span> </span><!><span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span><!><span><!> file<!></span></button>`,` D D l D l%b D D l b D l%l%b D%c%`,tR,`<p><!><span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span><!></p>`,` D%b D D l b D l%l%`,EL),BR=I(173,e=>{zR(e,e._._.cb>1?0:1),IR(e)},e=>e._._),VR=P(0,0,e=>{MR(e),IR(e)}),HR=N(3,e=>z(e.a,`data-pr`,e._.g?`${e._.h}/${e._.g.number}`:void 0)),UR=P(0,0,e=>{HR(e),MR(e)}),WR=P(0,0,HR),GR=P(0,0,MR),KR=F(gL),qR=M(19,e=>{rz(e,e.t.length),KR(e)}),JR=N(4,e=>qR(e,e._.cr.get(e.d)||[])),YR=qe(37,JR),XR=e=>{YR._(e),$R._(e)},ZR=(e,t)=>sz(e,t.length),QR=N(5,e=>ZR(e,e._.cs.get(e.d)||[])),$R=qe(37,QR),ez=O(0,`<section><!><!></section>`,` D%b%`,PR),tz=N(21,e=>ez(e,e.u||e.g?0:1)),nz=F(TR),rz=M(20,e=>{tz(e),nz(e)}),iz=F(pR,AL,mL),az=M(3,e=>{JR(e),QR(e),VR(e),iz(e)}),oz=F(ER),sz=M(23,e=>{GR(e),oz(e)}),cz=F(hR,ML),lz=M(6,e=>{dz(e,e.g?.number),fz(e,e.g?.url),pz(e,e.g?.title),mz(e,e.g?.headRefName),hz(e,e.g?.baseRefName),tz(e),UR(e),cz(e)}),uz=(e,t)=>{az(e,t[0]?.id),lz(e,t[0]?.pr),_z(e,t[0]?.worktree),vz(e,t[0]?.head),yz(e,t[0]?.base),bz(e,t[0]?.baseSha),xz(e,t[0]?.full_name),Sz(e,t[0]?.branch),Cz(e,t[0]?.localHead)},dz=M(8,F(VP,AP)),fz=M(9,F(WP,MP)),pz=M(10,F(KP,PP)),mz=M(11,F(_R,NL,qP,FP)),hz=M(16,F(SR,RL)),gz=F(gR),_z=M(7,e=>{WR(e),gz(e)}),vz=M(12,F(yR,FL,JP,IP)),yz=M(13,F(bR,IL,YP,LP)),bz=M(14,F(xR,LL,XP,RP)),xz=M(15,F(zP)),Sz=M(17,F(CR,YL,zL,xL)),Cz=M(18,F(XL,SL)),wz=P(12,0,e=>B_(e.a,e._.ar)),Tz=e=>{wz._(e),Ez._(e),Dz._(e),P_(e.a)},Ez=P(12,0,e=>V_(e.a,e._.dd)),Dz=P(12,0,e=>H_(e.a,e._.de)),Oz=L(`i36`,e=>A(e.a,`click`,function(){e._.aq?.()})),kz=e=>{B(e.a,[Mg,`_dh`]),zg(e.b),Bg(e.b,14),Vg(e.b),Oz(e)},Az=(e,t)=>{ZV(e,t?.additions),QV(e,t?.deletions)},jz=M(124,F(GI)),Mz=(e,t)=>zN(e.ac,t),Nz=N(127,e=>Mz(e,e.c9.filter(t=>(e.cs.get(t.id)||[]).length).map(t=>({id:t.id,label:t.pr?`${t.worktree} #${t.pr.number}`:t.worktree,files:e.cs.get(t.id)||[]})))),Pz=M(126,e=>{Nz(e),$R(e)}),Fz=N(121,e=>Pz(e,new Map(e.c9.map(t=>[t.id,e.cm.filter(e=>e.repo===t.id)])))),Iz=M(120,e=>{_P(e.ad,e.cm),$V(e,e.cm?.length),jz(e,new Set(e.cm.map(e=>e.key))),Fz(e)}),Lz=N(119,e=>Iz(e,e.ck?e.cf.filter(t=>e.ck.has(t.key)||t.key===e.be):e.cf),2),Rz=M(113,e=>{Pj(e.a0,e.cf),Az(e,(()=>{let t=0,n=0;for(let r of e.cf)t+=r.additions||0,n+=r.deletions||0;return{additions:t,deletions:n}})()),Lz(e)}),zz=N(111,e=>Rz(e,(()=>{let t=Zh(e.b0);return e.cc.filter(e=>t(e.key))})())),Bz=M(110,e=>{JV(e,e.cc?.length),zz(e)}),Vz=M(132,F(fR,kL)),Hz=k(35,tr,(e=>`/${e}&`)(nr),DF,jF),Uz=(e,t)=>{Vz(e,new Set(t.map(e=>e.id))),Hz(e,[t,`id`])},Wz=k(32,tr,(e=>`/${e}&`)(nr),XF,QF),Gz=k(33,tr,(e=>`/${e}&`)(nr),BF,WF),Kz=k(37,`<!><!><!>`,`b%`,XR,uz),qz=M(136,sI),Jz=N(134,e=>qz(e,_H(e))),Yz=F(dF),Xz=M(133,e=>{tH(e,e.cz?.length),Jz(e),Yz(e)}),Zz=N(108,e=>Xz(e,e.c9.filter(t=>t.githubDrift&&!e.bl.has(t.id)))),Qz=M(107,e=>{qV(e,e.c9.length),Bz(e,e.c9.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),Uz(e,e.c9.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName))),Wz(e,[e.c9.filter(e=>e.baseMissing),`id`]),Gz(e,[e.c9.filter(e=>e.contained&&e.files.length),`id`]),Kz(e,[e.c9,`id`]),Fz(e),Nz(e),Zz(e),gF(e)}),$z=M(148,Dz),eB=N(145,e=>$z(e,vH(e)),4),tB=M(149,F(SI)),nB=N(146,e=>tB(e,yH(e)),5),rB=M(150,F(CI)),iB=N(144,e=>rB(e,bH(e)),3),aB=M(143,e=>{eB(e),nB(e),iB(e)}),oB=N(106,L(`i50`,e=>Tt(e,{active:e.an,load:e.bz,onMount:function(){let t=new AbortController,n={abort:t,loaded:!1,wasActive:!1,lastPr:e.am||``,lastNonce:e.ao||0,start:()=>{this.active&&!n.loaded&&(n.loaded=!0,this.load())}};return n.wasActive=!!this.active,xn().addEventListener(`review.changed`,t=>{n.loaded&&t.data?.workspaceId===e.al&&e.c4()},{signal:t.signal}),xn().addEventListener(`status.changed`,t=>{if(!this.active||!n.loaded||e.ay)return;let r=t.data,i=r&&r[e.al];if(!i)return;let a=Jh(i);!a||!e.bu||a===e.bu||e.c7()},{signal:t.signal}),n.start(),n},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.c5(),this.wasActive=!!this.active;let t=e.am||``,n=e.ao||0;this.loaded&&t&&n!==this.lastNonce?(this.lastNonce=n,this.lastPr=t,e.bs(t)):(this.lastPr=t,this.lastNonce=n)},onDestroy:function(){e.bv&&clearTimeout(e.bv),this.abort.abort()}})),11),sB=M(105,oB),cB=N(104,e=>sB(e,SH(e))),lB=M(103,e=>{cB(e),oB(e)}),uB=N(98,e=>lB(e,CH(e))),dB=M(97,e=>{uB(e),oB(e)}),fB=N(96,e=>dB(e,wH(e)),5),pB=M(90,e=>{fB(e),oB(e)}),mB=N(81,e=>pB(e,TH(e)),2),hB=M(125,YR),gB=e=>{hB(e,new Map(e.c9.map(t=>[t.id,e.cc.filter(e=>e.repo===t.id)])))},_B=M(147,Ez),vB=N(142,e=>_B(e,EH(e)),2),yB=O(31,`<p>Loading diff…</p>`,` `,sF),bB=N(61,e=>yB(e,!e.at&&e.ay?0:1)),xB=O(36,`<p> </p>`,` D `,_F,`<p> </p>`,` D `,nI),SB=N(123,e=>xB(e,e.at&&!e.ce?0:e.at&&!e.co&&!e.bd?1:2),3),CB=j(55,e=>{Qz(e,e.at||[]),aB(e,xH(e)),mB(e),gB(e),vB(e),bB(e),SB(e)}),wB=(e,t)=>{IN(e.ac,t),fP(e.ad,t)},TB=F(YI),EB=M(128,e=>{wB(e,new Set(e.cu.keys())),TB(e)}),DB=M(140,F(bI)),OB=M(139,F(yI)),kB=N(138,e=>OB(e,OH(e)),3),AB=j(56,e=>{uV(e,e.au?.length),EB(e,(()=>{let t=new Map;for(let n of e.au){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),DB(e,DH(e)),kB(e),vB(e),eB(e),iB(e)}),jB=F(_I),MB=j(58,e=>{kB(e),nB(e),jB(e)}),NB=O(30,tr,(e=>`/${e}&`)(nr),dI),PB=F(lI),FB=j(59,e=>{NB(e,+!e.ax),PB(e)}),IB=F(iI),LB=j(60,e=>{B(e.q,[Mg,`_dl`,{[Ng]:e.ay}]),z(e.q,`disabled`,e.ay),z(e.v,`disabled`,e.ay),z(e.w,`disabled`,e.ay),z(e.x,`disabled`,e.ay),oB(e),bB(e),IB(e)}),RB=j(62,e=>{$g(e.g,e.b0),zz(e),tI(e)}),zB=F(KF,IF,bF),BB=j(63,e=>{B(e.v,[`_dD`,{_dC:!e.b1}]),z(e.v,`aria-pressed`,e.b1?`false`:`true`),B(e.w,[`_dD`,{_dC:e.b1}]),z(e.w,`aria-pressed`,e.b1?`true`:`false`),B(e.x,[`_dE`,`_dl`,{_dC:e.b1}]),z(e.x,`aria-pressed`,e.b1?`true`:`false`),z(e.x,`title`,e.b1?`Showing working tree — tap for committed only`:`Showing committed only — tap to include uncommitted`),V(e.y,e.b1?`Dirty`:`Clean`),fB(e),uB(e),zB(e)}),VB=j(64,e=>{B(e.o,[Pg,{_dc:e.b2}]),z(e.o,`title`,e.b2?`Hide file tree`:`Show file tree`),LN(e.ac,e.b2)}),HB=j(65,e=>lP(e.ad,e.b3)),UB=M(118,Lz),WB=e=>{UB(e,e.bb.trim()?new Set(e.bc):null)},GB=j(72,e=>{wV(e,e.ba?.query),TV(e,e.ba?.keys),EV(e,e.ba?.hit),WB(e)}),KB=F(LR,oR,dL),qB=j(79,e=>{DN(e.ac,e.bh),mB(e),KB(e)}),JB=F(RR),YB=j(80,e=>{jN(e.ac,e.bi),mB(e),JB(e)}),XB=j(82,F(lR)),ZB=j(83,e=>{Zz(e),Jz(e)}),QB=(e,t)=>{NV(e,t.cbs),PV(e,t.io),FV(e,t.root)},$B=(e,t)=>{IV(e,t.sig),LV(e,t.timer)},eV=(e,t)=>RV(e,t.seq),tV=(e,t)=>WV(e,t.busy),nV=M(137,e=>{kB(e),nB(e)}),rV=(e,t)=>{BN(e.ac,t),vP(e.ad,t)},iV=M(155,e=>koe(e.a0,jH(e))),aV=M(151,e=>{rV(e,AH(e)),iV(e,MH(e))}),oV=L(`i48`,e=>{A(e.o,`click`,function(){VB(e,!e.b2),bee(e.b2)}),A(e.q,`click`,function(){e.c5()}),A(e.s,`click`,function(){HB(e,!0)}),A(e.v,`click`,function(){e.b1&&(BB(e,!1),Hn(!1),e.bz(!1))}),A(e.w,`click`,function(){e.b1||(BB(e,!0),Hn(!0),e.bz(!0))}),A(e.x,`click`,function(){let t=!e.b1;BB(e,t),Hn(t),e.bz(t)}),A(e.a1,`click`,function(){e.dj()})});function sV(e){B(e.a,`_db`),B(e.b,`_df`),B(e.d,`_du`),B(e.f,`_dv`),i_(e.g),e_(e.g,RH(e)),B(e.h,`_di`),B(e.i,`_dj`),B(e.j,`_dw`),Bp(e.p),Vp(e.p,14),Hp(e.p),Yo(e.r),Xo(e.r,14),Zo(e.r),B(e.s,[`_d0`,`_dl`]),B(e.u,[`_dB`,`_dl`]),Mj(e.a0),Coe(e.a0,LH(e)),Eoe(e.a0),Doe(e.a0),Ooe(e.a0),B(e.a1,[Mg,`_dm`,`_dl`]),Zj(e.a2),Qj(e.a2,14),$j(e.a2),B(e.a3,`_ds`),PN(e.ac),ON(e.ac,IH(e)),MN(e.ac,FH(e)),uP(e.ad,PH(e)),CB(e,null),AB(e,[]),MB(e,null),FB(e,null),LB(e,!1),RB(e,``),BB(e,xee()),VB(e,yee()),HB(e,!1),GB(e,{query:``,hit:null,keys:[]}),qB(e,new Set),YB(e,new Set),XB(e,new Set),ZB(e,new Set),QB(e,{io:null,root:null,cbs:null}),$B(e,{sig:``,timer:0}),eV(e,{seq:0}),tV(e,{busy:0}),nV(e,kH),aV(e,NH(e)),oV(e)}var cV=O(11,`<span>·</span><!> comment<!>`,` b%c%`,pI),lV=O(12,l_,(e=>`/${e}&`)(u_),Tz),uV=M(57,e=>{B(e.c,[`_dg`,{_dk:e.av>0}]),cV(e,+!e.av),lV(e,+!e.av),fI(e)}),dV=Ke(66,e=>{B(e.n,[`_de`,{_dp:e.b4&&!Xn()}]),B(e.z,[`_do`,{_dn:!e.b4}]),Soe(e.a0,e.b4),z(e.a1,`hidden`,e.b4)}),fV=N(44,e=>dV(e,e.ag,e.ah)),pV=M(42,fV),mV=M(43,fV),hV=N(69,L(`i51`,e=>{e.aj!=null&&e.aj!==e.b6&&bV(e,e.aj)})),gV=L(`i49`,e=>{e.an&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||t.target?.closest?.(`[data-palette]`)||(t.preventDefault(),e.dj()))},{capture:!0,signal:De(e,0)})}),_V=N(154,e=>{Ee(e,0),gV(e)}),vV=M(153,_V),yV=N(71,e=>vV(e,zH(e))),bV=j(68,e=>{Hj(e.a0,e.b6),hV(e),yV(e)}),xV=M(45,e=>{bV(e,e.aj||0),hV(e)}),SV=M(70,e=>{Vj(e.a0,e.b8),yV(e)}),CV=(e,t)=>SV(e,t||{focus:BH}),wV=M(73,rI),TV=M(74),EV=M(75,e=>{OV(e,e.bd?.key),kV(e,e.bd?.repo),AV(e,e.bd?.line),SB(e)}),DV=F(LI,jI),OV=M(76,e=>{Lz(e),DV(e)}),kV=M(77,F(NR)),AV=M(78,F(UI)),jV=M(89),MV=N(88,e=>jV(e,VH(e)),2),NV=M(85,MV),PV=M(86,MV),FV=M(87,MV),IV=M(92,e=>{fB(e),oB(e)}),LV=M(93,e=>{cB(e),oB(e)}),RV=M(95,fB),zV=M(141,vB),BV=M(102,oB),VV=N(101,e=>BV(e,UH(e))),HV=M(47,e=>{zV(e,HH(e)),fB(e),VV(e),oB(e),kB(e),eB(e),nB(e)}),UV=M(48,e=>{fB(e),oB(e)}),WV=M(100,e=>{VV(e),eB(e),nB(e),iB(e)}),GV=M(49,e=>{oB(e),_V(e)}),KV=M(50,oB),qV=M(109,F(BR,pL)),JV=M(112,e=>{hP(e.ad,e.ce),SB(e)}),YV=O(10,`<span>+<!></span><span>−<!></span>`,` Db%l Db%`,mF,`<span>0</span>`,` `,cF),XV=N(117,e=>YV(e,e.ch||e.ci?0:1)),ZV=M(115,e=>{XV(e),pF(e)}),QV=M(116,e=>{XV(e),hF(e)}),$V=M(122,e=>{V(e.t,e.co),SB(e)}),eH=O(34,tr,(e=>`/${e}&`)(nr),cI),tH=(e,t)=>eH(e,+!t),nH=M(51,e=>{eB(e),nB(e),iB(e)}),rH=O(4,(e=>`<button title="Back to terminal">${e}</button>`)(Lg),(e=>` D/${e}&l`)(Rg),kz),iH=M(52,e=>rH(e,+!e.aq)),aH=F(mI),oH=M(53,e=>{wz(e),aH(e)}),sH=M(54,F($L,KL,TL,vL));function cH(e){return function(){e._.d2()}}function lH(e){return function(){FB(e._,null)}}function uH(e){return function(t){FB(e._._._._._._,t)}}function dH(e){return function(){MB(e._._._._._._,null)}}function fH(e){return function(t){e._._._._._._.d5(e._._.i,t)}}function pH(e){return function(t){e._._._._._._.d6(t)}}function mH(e){return function(t,n){e._._._._._._.df(e._._.i,t,n)}}function hH(e){return function(t,n){e._._._._._._.dg(t,n)}}function gH(e){return function(t){MB(e._._._._._._,{key:e._._.j,side:t.side||`additions`,start:Math.min(t.start,t.end),end:Math.max(t.start,t.end)})}}function _H(e){return()=>{ZB(e,new Set([...e.bl,...e.cz.map(e=>e.id)]))}}function vH(e){return async t=>{let n=e.au;e.c2++;try{await e.d9(n,t),e.ap?.(t),AB(e,[]),MB(e,null),await fetch(`/api/workspaces/${e.al}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})}).catch(()=>{})}catch(t){FB(e,String(t.message||t))}finally{e.c2--}}}function yH(e){return async(t,n,r)=>{let i=e.aw;if(!i)return;let a=n.trim();if(!a)return;let o={id:-1,workspace_id:e.al,worktree:e.d3(t.repo),path:t.path,side:i.side===`deletions`?`deletions`:`additions`,line_start:i.start,line_end:i.end,text:a,created_at:``};e.c2++;try{await e.d9([o],r),e.ap?.(r),MB(e,null)}catch(t){FB(e,String(t.message||t))}finally{e.c2--}}}function bH(e){return async(t,n)=>{let r=e.au.find(e=>e.id===t);if(r){e.c2++;try{await e.d9([r],n),e.ap?.(n),AB(e,e.au.filter(e=>e.id!==t)),await fetch(`/api/review-comments/${t}`,{method:`DELETE`}).catch(()=>{})}catch(t){FB(e,String(t.message||t))}finally{e.c2--}}}}function xH(e){return async(t,n)=>{t.length&&await H(`/api/sessions/${n}/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:`Please address this review feedback, then summarize what you changed.\n\n${Tg(t,e.at)}`,...Xh()||{}})})}}function SH(e){return()=>{e.bv&&clearTimeout(e.bv),e.bv=setTimeout(()=>{e.bv=0,e.c5()},250)}}function CH(e){return()=>(ZB(e,new Set),e.bz(e.b1,!0))}function wH(e){return async(t=e.b1,n=!1)=>{let r=++e.bx;LB(e,!0),FB(e,null);try{let i=new URLSearchParams;t&&i.set(`uncommitted`,`1`),n&&i.set(`refresh`,`1`);let a=i.size?`?${i}`:``,[o,s]=await Promise.all([H(`/api/workspaces/${e.al}/diff${a}`),H(`/api/workspaces/${e.al}/review`)]);if(r!==e.bx)return;CB(e,o),AB(e,s.comments||[]),e.bu=qh(o),e.am&&e.bs(e.am)}catch(t){if(r!==e.bx)return;FB(e,String(t.message||t))}finally{r===e.bx&&LB(e,!1)}}}function TH(e){return t=>{if(!t)return;let n=e.at||[],r=n.find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),i=new Set(e.bi);for(let t of n)e.bh.has(t.id)||i.add(t.id);r&&i.add(r.id),YB(e,i);let a=new Set;for(let e of n)(!r||e.id!==r.id)&&a.add(e.id);qB(e,a),XB(e,new Set);let o=Date.now(),s=()=>{let n=e.a3,r=n?.querySelector(`[data-pr="${CSS.escape(t)}"]`);if(!n||!r){Date.now()-o<2500&&requestAnimationFrame(s);return}let i=r.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop;n.scrollTo({top:Math.max(0,i-8)})};requestAnimationFrame(s)}}function EH(e){return async()=>await Kh(Tg(e.au,e.at))?(await e.d7(),!0):(FB(e,`Copy failed — clipboard needs HTTPS on this browser.`),!1)}function DH(e){return async t=>{AB(e,e.au.filter(e=>e.id!==t)),await fetch(`/api/review-comments/${t}`,{method:`DELETE`})}}function OH(e){return async(t,n)=>{let r=e.aw;MB(e,null);try{let i=await H(`/api/workspaces/${e.al}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:e.d3(t.repo),path:t.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim()})});AB(e,e.au.concat(i))}catch(t){FB(e,String(t.message||t))}}}function kH(e){return e.includes(`#`)?e.split(`#`)[0]:e}function AH(e){return t=>{e.dh(t)?.scrollIntoView({block:`start`})}}function jH(e){return function(t){e.dl(t)}}function MH(e){return t=>{if(GB(e,t),!t.hit)return;let n=t.hit;setTimeout(()=>{let r=e.dh(n.key);if(r){if(n.line<1){let t=e.a3;if(t){let e=r.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop;t.scrollTo({top:Math.max(0,e-8)})}else r.scrollIntoView({block:`start`});return}ig(t.query,n),ag()}},0)}}function NH(e){return t=>{let n=e.a3?.querySelector(`details[data-key="${CSS.escape(t)}"]`);return n&&(n.open=!0),n}}function PH(e){return t=>{HB(e,t)}}function FH(e){return t=>{YB(e,t)}}function IH(e){return t=>{qB(e,t)}}function LH(e){return t=>{dV(e,t)}}function RH(e){return t=>{RB(e,t)}}function zH(e){return()=>{dV(e,!0),bV(e,e.b6+1),e.b8.focus()}}function BH(){}function VH(e){return(t,n)=>{e.bn??=new WeakMap,e.bn.set(t,n);let r=e.a3||null;(!e.bo||e.bp!==r)&&(e.bo?.disconnect(),e.bp=r,e.bo=new IntersectionObserver(t=>{for(let n of t)n.isIntersecting&&(e.bo.unobserve(n.target),e.bn.get(n.target)?.())},{root:r,rootMargin:`800px 0px`})),e.bo.observe(t),requestAnimationFrame(()=>{if(!t.isConnected)return;let r=e.a3,i=t.getBoundingClientRect(),a=r?r.getBoundingClientRect():{top:0,bottom:window.innerHeight};i.bottom>=a.top-800&&i.top<=a.bottom+800&&(e.bo?.unobserve(t),n())})}}function HH(e){return async()=>{AB(e,[]),MB(e,null),await fetch(`/api/workspaces/${e.al}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})})}}function UH(e){return async()=>{if(!e.c2)try{let t=await H(`/api/workspaces/${e.al}/review`);if(e.c2)return;AB(e,t.comments||[])}catch{}}}R(`i25`,cH),R(`i24`,lH),R(`i32`,uH),R(`i29`,dH),R(`i27`,fH),R(`i30`,pH),R(`i28`,mH),R(`i31`,hH),R(`i26`,gH),R(`i7`,_H),R(`i14`,vH),R(`i15`,yH),R(`i16`,bH),R(`i12`,xH),R(`i6`,SH),R(`i5`,CH),R(`i3`,wH),R(`i2`,TH),R(`i13`,EH),R(`i10`,DH),R(`i9`,OH),R(`i8`,kH),R(`i18`,AH),R(`i23`,jH),R(`i20`,MH),R(`i17`,NH),R(`i35`,PH),R(`i34`,FH),R(`i33`,IH),R(`i22`,LH),R(`i21`,RH),R(`i19`,zH),R(`i0`,BH),R(`i1`,VH),R(`i11`,HH),R(`i4`,UH);var WH=`_co _V`,GH=`_cp _Z`,KH=`_cR _y`,qH=`_cS _z`,JH=((e,t)=>`<div role=region><div><div><header><div><h1>Manage</h1><p><span> </span><!><span aria-hidden=true>·</span><span> </span></p></div></header><!><!><section><div><h2>Repos</h2><span> </span><div></div><button title="Refresh repo list" aria-label="Refresh repo list">${e}</button></div><ul><!><!></ul><!><div>${t}</div></section><!><section><div><h2>Workspace</h2></div><div><!><button type=button> </button></div><p>Archive hides the space from the list. Delete removes it and its worktrees.</p></section></div></div></div>`)(qo,Qo),YH=((e,t)=>` D D D D D b D D l%b b D o%b%b D Db D l b D/${e}&m D%b%l%b D0${t}&m%b D b D%b D m o`)(Jo,$o),XH=new Map,ZH=L(`k13`,e=>A(e.a,`click`,function(){window.open(`http://${location.hostname}:${e.d}`,`_blank`,`noopener`)})),QH=e=>{B(e.a,[`_h`,`_cL`]),ZH(e)},$H=M(3,e=>{z(e.a,`title`,`Open http://${typeof location>`u`?`localhost`:location.hostname}:${e.d}`),V(e.b,e.d)}),eU=k(0,`<button>:<!></button>`,` Db%`,QH,(e,t)=>$H(e,t[0])),tU=P(4,0,e=>eU(e,[e._.k,e=>String(e)])),nU=e=>{tU._(e),B(e.a,`_cF`)},rU=e=>B(e.a,`_cM`),iU=e=>{B(e.a,[`_cC`,`_cB`]),B(e.b,`_w`),B(e.c,`_cD`),B(e.d,`_cG`)},aU=(e,t)=>V(e.e,t),oU=(e,t)=>aU(e,t[0]),sU=e=>B(e.a,`_w`),cU=P(7,0,e=>V(e.b,e._.o)),lU=e=>{cU._(e),B(e.a,[`_cH`,`_m`])},uU=e=>B(e.a,[`_ct`,`_cu`]),dU=L(`k14`,e=>A(e.f,`click`,function(){e._._.b8(e.m)})),fU=e=>{B(e.a,`_cC`),B(e.b,`_cD`),B(e.c,[`_cE`,`_m`]),B(e.f,[`_cI`,`_cK`]),dU(e)},pU=(e,t)=>z(e.b,`title`,t),mU=(e,t)=>V(e.d,t),hU=O(4,`<span></span>`,` `,nU),gU=(e,t)=>hU(e,+!t),_U=M(12,e=>{z(e.f,`title`,`Kill ${e.m}`),z(e.f,`aria-label`,`Kill process ${e.m}`)}),vU=(e,t)=>{pU(e,t[0]?.args),mU(e,t[0]?.cmd),yU(e,t[0]?.ports),_U(e,t[0]?.pid)},yU=M(10,e=>{gU(e,e.k?.length),tU(e)}),bU=k(4,`<li><div><span> </span><!></div><button type=button>×</button></li>`,` D D D l%l `,fU,vU),xU=P(29,0,e=>bU(e,[e._.bb,`pid`])),SU=e=>{xU._(e),CU._(e),B(e.a,`_cw`),B(e.b,`_cx`),B(e.c,`_cy`),B(e.e,`_cA`)},CU=P(29,0,e=>V(e.d,e._.bc)),wU=P(14,0,e=>V(e.c,e._.ar)),TU=e=>{wU._(e),B(e.a,`_cv`),B(e.b,`_w`)},EU=N(2,e=>{B(e.a,[`_cI`,`_cK`,{_cJ:e._._.aq===e._.m}]),V(e.b,e._._.aq===e._.m?`Remove?`:`×`)}),DU=N(3,e=>z(e.a,`title`,e._._.aq===e._.m?`Really remove ${e._.l}/? Uncommitted changes are lost.`:`Remove ${e._.l}/`),2),OU=I(84,e=>{EU(e),DU(e)},e=>e._._),kU=L(`k11`,e=>A(e.a,`click`,function(){e._._.aq===e._.k?.full_name?(yW(e._._,null),e._._.b6(e._.k)):(yW(e._._,e._.k?.full_name),setTimeout(()=>{yW(e._._,null)},4e3))})),AU=e=>{OU(e),jU._(e),MU._(e),kU(e)},jU=P(8,1,DU),MU=P(8,1,e=>{EU(e),DU(e)}),NU=P(33,1,e=>z(e.a,`disabled`,!!e._.an)),PU=L(`k16`,e=>A(e.a,`click`,function(){e._.b7(`restore`)})),FU=e=>{NU._(e),B(e.a,[`_d`,`_cP`]),PU(e)},IU=P(33,0,e=>{z(e.a,`disabled`,!!e._.an),V(e.b,e._.an===`archive`?`Archiving…`:`Archive`)}),LU=L(`k15`,e=>A(e.a,`click`,function(){e._.b7(`archive`)})),RU=e=>{IU._(e),B(e.a,[`_d`,`_cP`]),LU(e)},zU=I(82,e=>V(e.a,e._._.am),e=>e._._),BU=ft(`k10`,` `,` `,zU),VU=e=>{Or(e.a),Mr(e.a,BU(e)),wr(e.a,`inline`),Ir(e.a,tG(e)),Fr(e.a),Tr(e.a),br(e.a),Ar(e.a),Dr(e.a,{})},HU=O(8,`<span></span>`,` `,sU,`<button> </button>`,` D `,AU),UU=N(13,e=>HU(e,+!e._.ak.has(e.m))),WU=qe(23,UU),GU=e=>{WU._(e),B(e.a,`_cC`),B(e.b,`_cD`),B(e.c,[`_cE`,`_m`]),B(e.e,`_cF`),B(e.f,`_cG`)},KU=M(11,e=>{V(e.d,e.l),jU(e)}),qU=M(12,e=>{V(e.g,e.m),UU(e),MU(e)}),JU=O(7,`<span title="Base branch">⎇ <!></span>`,` Db%`,lU),YU=N(16,e=>JU(e,+(e.o===e.p))),XU=M(14,e=>{YU(e),cU(e)}),ZU=M(15,YU),QU=(e,t)=>$U(e,t[0]),$U=M(10,e=>{KU(e,e.k?.worktree),qU(e,e.k?.full_name),XU(e,e.k?.base_branch),ZU(e,e.k?.default_branch)}),eW=tt(72),tW=j(44,e=>{B(e.u,[KH,{[qH]:e.ai}]),z(e.u,`disabled`,e.ai)}),nW=M(67,e=>Xs(e.a1,nG(e))),rW=N(80,e=>nW(e,rG(e)),2),iW=M(68),aW=N(79,e=>iW(e,iG(e)),2),oW=M(66,e=>{rW(e),aW(e)}),sW=k(24,`<li><span></span><div><span>Adding <!>…</span></div></li>`,` D b D Db%`,iU,oU),cW=N(78,e=>sW(e,[[...e.ak].filter(t=>!e.b3.has(t)),e=>e])),lW=j(46,e=>{kW(e,e.ak?.size),oW(e,aG(e)),rW(e),aW(e),cW(e),WU(e)}),uW=O(13,tr,(e=>`/${e}&`)(nr),VU),dW=F(zU),fW=j(48,e=>{uW(e,+!e.am),dW(e)}),pW=N(77,L(`k18`,e=>Tt(e,{busyCount:e.al,pendingAction:e.an,onMount:function(){let t=new AbortController,n=t.signal;return xn().addEventListener(`workspace.progress`,t=>{(this.pendingAction||this.busyCount)&&t.data?.message&&t.data.op===e.av&&bW(e,t.data.message)},{signal:n}),e.b2(n),{abort:t}},onDestroy:function(){this.abort.abort()}})),3),mW=O(14,`<p><span></span> </p>`,` D b `,TU),hW=N(54,e=>mW(e,e.an&&e.ar?0:1)),gW=N(51,e=>V(e.a9,e.an===`delete`?`Deleting…`:e.ao?`Really delete?`:`Delete`)),_W=j(49,e=>{z(e.a8,`disabled`,!!e.an),pW(e),hW(e),gW(e),IU(e),NU(e)}),vW=j(50,e=>{B(e.a8,[`_d`,`_g`,`_cP`,{_f:e.ao}]),gW(e)}),yW=j(52,F(OU)),bW=j(53,e=>{hW(e),wU(e)}),xW=(e,t)=>{z(e.a,`aria-labelledby`,t),z(e.f,`id`,t)},SW=L(`k17`,e=>{A(e.u,`click`,function(){eW(e)()}),A(e.a8,`click`,function(){e.ao?(vW(e,!1),e.b7(`delete`)):(vW(e,!0),setTimeout(()=>{vW(e,!1)},4e3))})});function CW(e){B(e.a,`_T`),B(e.b,`_U`),B(e.c,WH),B(e.d,`_X`),B(e.e,`_Y`),B(e.g,GH),B(e.h,`_cq`),B(e.k,`_cr`),B(e.l,[`_cs`,`_m`]),B(e.p,`_cw`),B(e.q,`_cx`),B(e.r,`_cy`),B(e.t,`_n`),Yo(e.v),Xo(e.v,14),Zo(e.v),B(e.w,`_cA`),B(e.a0,`_cz`),Qe(e,27,QW),qs(e.a1),Js(e.a1,sG(e)),Is(e.a1,oG(e)),Fs(e.a1),Zs(e.a1),B(e.a4,[`_cw`,`_cN`]),B(e.a5,`_cx`),B(e.a6,`_cO`),B(e.aa,`_cQ`),tW(e,!1),lW(e,new Set),fW(e,null),_W(e,null),vW(e,!1),yW(e,null),bW(e,null),xW(e,$e(e)),SW(e)}var wW=M(73,e=>{eG(e,e.bb.length),xU(e)}),TW=j(45,e=>wW(e,e.aj||[])),EW=(e,t)=>TW(e,XH.get(`procs:${t}`)||null),DW=O(25,`<p>No repos yet — search below to add one.</p>`,` `,rU),OW=N(76,e=>DW(e,!e.b1&&!e.al?0:1)),kW=M(47,e=>{pW(e),OW(e)}),AW=M(69),jW=N(75,e=>AW(e,cG(e)),2),MW=e=>{z(e.g,`title`,e.ax||e.ay),V(e.m,e.ax||e.ay)},NW=Ke(55,e=>{PW(e,e.at),aW(e),jW(e),MW(e)}),PW=e=>{LW(e,e.at?.id),BW(e,e.at?.repos),HW(e,e.at?.display_path),UW(e,e.at?.path),WW(e,e.at?.name),qW(e,e.at?.status)},FW=M(70),IW=M(64,e=>{FW(e,lG(e)),pW(e)}),LW=M(57,e=>{IW(e,uG(e)),pW(e),rW(e)}),RW=M(65,e=>{Ys(e.a1,e.b3),cW(e)}),zW=k(23,`<li><div><span><!>/</span><span><span> </span><!></span></div><!></li>`,` D D D%l D D l%m%`,GU,QU),BW=M(58,e=>{VW(e,e.aw?.length),RW(e,new Set(e.aw.map(e=>e.full_name))),zW(e,[e.aw,`full_name`])}),VW=M(63,e=>{V(e.s,e.b1),OW(e)}),HW=M(59),UW=M(60),WW=M(61,e=>V(e.i,e.az)),GW=O(9,`<span>Archived</span>`,` `,uU),KW=O(33,`<button type=button> </button>`,` D `,RU,`<button type=button>Restore</button>`,` `,FU),qW=M(62,e=>{GW(e,+(e.b0===`active`)),KW(e,e.b0===`active`?0:1)}),JW=N(42,e=>NW(e,e.ad,e.af)),YW=M(39,e=>{EW(e,e.ad?.id),JW(e)}),XW=M(41,e=>{JW(e),jW(e)}),ZW=M(43,jW),QW=at(`k12`,M(72)),$W=O(29,`<section><div><h2>Running</h2><span> </span></div><ul></ul></section>`,` D Db D m `,SU),eG=M(74,e=>{$W(e,+!e.bc),CU(e)});function tG(e){return function(){fW(e._,null)}}function nG(e){return function(t,n){e.b5(t,n)}}function rG(e){return async(t,n)=>{if(!(!t||e.ak.has(t))){fW(e,null),e.b4(t,!0);try{NW(e,await H(`/api/workspaces/${e.av}/repos`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fullName:t,baseBranch:n})}))}catch(t){fW(e,String(t.message||t))}e.b4(t,!1)}}}function iG(e){return async t=>{if(!e.ak.has(t.full_name)){fW(e,null),e.b4(t.full_name,!0);try{await H(`/api/workspaces/${e.at?.id}/repos/${encodeURIComponent(t.worktree)}`,{method:`DELETE`}),NW(e,{...e.at,repos:(e.at?.repos).filter(e=>e.full_name!==t.full_name)})}catch(t){fW(e,String(t.message||t))}e.b4(t.full_name,!1)}}}function aG(e){return(t,n)=>{let r=new Set(e.ak);n?r.add(t):r.delete(t),lW(e,r)}}function oG(e){return function(t){tW(e,t)}}function sG(e){return function(t){fW(e,t)}}function cG(e){return async t=>{fW(e,null),_W(e,t),bW(e,null);try{await H(`/api/workspaces/${e.at?.id}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:t})}),t===`archive`?e.af?.({...e.at,status:`archived`}):t===`delete`&&e.ah?.()}catch(t){fW(e,String(t.message||t))}finally{_W(e,null),bW(e,null)}}}function lG(e){return async t=>{await fetch(`/api/procs/${t}`,{method:`DELETE`}),setTimeout(()=>e.b2(void 0),500)}}function uG(e){return async t=>{try{let n=await H(`/api/workspaces/${e.av}/procs`,{signal:t});TW(e,n),XH.set(`procs:${e.av}`,n)}catch{}}}R(`k6`,tG),R(`k7`,nG),R(`k2`,rG),R(`k3`,iG),R(`k1`,aG),R(`k9`,oG),R(`k8`,sG),R(`k4`,cG),R(`k5`,lG),R(`k0`,uG);var dG=`_bY _V _W`,fG=`_bZ _y`,pG=`_b0 _z`,mG=(e=>`<div role=region><div><div><header><div><h1>Usage</h1><p>Provider plan windows across your agents.</p></div><div><button title="Refresh usage" aria-label="Refresh usage">${e}</button></div></header><!></div></div></div>`)(qo),hG=(e=>` D D D D D b l D D/${e}&n%n`)(Jo);function gG(e){let t=Math.round(e/6e4);if(t<60)return`${t}m`;let n=Math.round(t/60);return n<48?`${n}h`:`${Math.round(n/24)}d`}function _G(e,t){if(!e)return null;let n=new Date(e).getTime()-Date.now();return n<=0?t?null:`now`:gG(n)}var vG=P(7,0,e=>V(e.b,e._.n)),yG=e=>{vG._(e),B(e.a,`_b_`)},bG=(e,t)=>V(e.i,t?`↻ ${mt(t)}`:``),xG=N(13,e=>bG(e,_G(e.m,e._.k!=null))),SG=qe(6,xG),CG=e=>{SG._(e),B(e.a,`_ca`),B(e.b,`_cb`),B(e.d,`_cc`),B(e.h,`_cn`)},wG=N(16,e=>z(e.a,`title`,`${e.o}: ${e.p}% used${e.m?` — resets ${new Date(e.m).toLocaleString()}`:``}`),2),TG=M(15,e=>{V(e.g,e.p),wG(e)}),EG=(e,t)=>B(e.e,[`_cd`,t]),DG=(e,t)=>B(e.f,[`_ci`,t]),OG=(e,t)=>{gt(e.e,`width:${Math.min(100,Math.max(2,t))}%`),TG(e,Math.round(t)),EG(e,t>=90?`_ch`:t>=70?`_cg`:t>=40?`_cf`:`_ce`),DG(e,t>=90?`_cm`:t>=70?`_cl`:t>=40?`_ck`:`_cj`)},kG=M(12,e=>{xG(e),wG(e)}),AG=M(14,e=>{V(e.c,e.o),wG(e)}),jG=(e,t)=>{OG(e,t[0]?.used_percent),kG(e,t[0]?.resets_at),AG(e,t[0]?.window)},MG=N(2,e=>z(e.a,`title`,`${e._.n||`couldn't reach this provider`} — these are the last cached numbers, ${gG(e._.k*1e3)} old`)),NG=P(4,0,e=>{V(e.b,gG(e._.k*1e3)),MG(e)}),PG=e=>{NG._(e),FG._(e),B(e.a,`_b7`)},FG=P(4,0,MG),IG=P(3,0,e=>V(e.b,e._.m.replace(/^default_/,``).replaceAll(`_`,` `))),LG=e=>{IG._(e),B(e.a,`_b6`)},RG=O(4,`<span>⚠ <!> old</span>`,` Db%`,PG),zG=M(10,e=>{B(e.a,[`_b4`,{_b8:e.k!=null}]),RG(e,+(e.k==null)),NG(e),SG(e)}),BG=e=>{B(e.b,`_b5`),B(e.f,`_b9`)},VG=(e,t)=>V(e.c,t),HG=O(3,`<span> </span>`,` D `,LG),UG=M(12,e=>{HG(e,+!e.m),IG(e)}),WG=k(6,`<div><span> </span><span><span></span></span><span><!>%</span><span> </span></div>`,` D D l D l D%l D `,CG,jG),GG=(e,t)=>WG(e,[t||[],`window`]),KG=O(7,`<p> </p>`,` D `,yG),qG=M(13,e=>{KG(e,+!e.n),FG(e),vG(e)}),JG=(e,t)=>{zG(e,t[0]?.stale_seconds),VG(e,t[0]?.agent),UG(e,t[0]?.plan),qG(e,t[0]?.note),GG(e,t[0]?.windows)},YG=e=>{B(e.a,[`_l`,`_b2`]),B(e.b,`_w`)},XG=k(0,`<div><div><strong> </strong><!><!></div><div><!><!></div></div>`,` D E l%b%l D%b%`,BG,JG),ZG=P(10,2,e=>XG(e,[e._.n||[],e=>`${e.agent}-${e.account||``}`])),QG=e=>{ZG._(e),B(e.a,`_b3`)},$G=P(10,1,e=>V(e.b,e._.m)),eK=O(10,`<p><span></span> Loading usage…</p>`,` D `,YG,`<p> </p>`,` D `,e=>{$G._(e),B(e.a,[`_l`,`_b2`])},`<div></div>`,` `,QG),tK=j(11,e=>{nK(e,e.l?.error),rK(e,e.l?.agents),eK(e,e.l?e.l?.error?1:2:0)}),nK=M(12,$G),rK=M(13,ZG),iK=j(14,e=>{B(e.i,[fG,`_b1`,{[pG]:e.o}]),z(e.i,`disabled`,e.o)}),aK=M(16),oK=L(`x3`,e=>Tt(e,{onMount:function(){e.p(!1)}})),sK=M(15,e=>{aK(e,dK(e)),oK(e)}),cK=(e,t)=>{z(e.a,`aria-labelledby`,t),z(e.f,`id`,t)},lK=L(`x2`,e=>A(e.i,`click`,function(){e.q()}));function uK(e){B(e.a,`_T`),B(e.b,`_U`),B(e.c,dG),B(e.d,`_X`),B(e.e,`_Y`),B(e.g,`_Z`),B(e.h,`_0`),Yo(e.j),Xo(e.j,14),Zo(e.j),tK(e,null),iK(e,!1),sK(e,fK(e)),cK(e,$e(e)),lK(e)}function dK(e){return async()=>{iK(e,!0),await e.p(!0),iK(e,!1)}}function fK(e){return async t=>{try{tK(e,await H(`/api/usage${t?`?refresh`:``}`))}catch(t){tK(e,{error:String(t.message||t)})}}}R(`x1`,dK),R(`x0`,fK);var pK=Object.defineProperty,mK=Object.getOwnPropertyDescriptor,hK=(e,t)=>{for(var n in t)pK(e,n,{get:t[n],enumerable:!0})},gK=(e,t,n,r)=>{for(var i=r>1?void 0:r?mK(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&pK(t,n,i),i},J=(e,t)=>(n,r)=>t(n,r,e),_K=`Terminal input`,vK={get:()=>_K,set:e=>_K=e},yK=`Too much output to announce, navigate to rows manually to read`,bK={get:()=>yK,set:e=>yK=e};function xK(e){return e.replace(/\r?\n/g,`\r`)}function SK(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function CK(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function wK(e,t,n,r){e.stopPropagation(),e.clipboardData&&TK(e.clipboardData.getData(`text/plain`),t,n,r)}function TK(e,t,n,r){e=xK(e),e=SK(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function EK(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function DK(e,t,n,r,i){EK(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function OK(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function kK(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var AK=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},jK=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},MK=``,NK=` `,PK=class e{constructor(){this.fg=0,this.bg=0,this.extended=new FK}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},FK=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},IK=class e extends PK{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new FK,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?OK(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},LK=`di$target`,RK=`di$dependencies`,zK=new Map;function BK(e){return e[RK]||[]}function VK(e){if(zK.has(e))return zK.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);HK(t,e,r)};return t._id=e,zK.set(e,t),t}function HK(e,t,n){t[LK]===t?t[RK].push({id:e,index:n}):(t[RK]=[{id:e,index:n}],t[LK]=t)}var UK=VK(`BufferService`),WK=VK(`CoreMouseService`),GK=VK(`CoreService`),KK=VK(`CharsetService`),qK=VK(`InstantiationService`),JK=VK(`LogService`),YK=VK(`OptionsService`),XK=VK(`OscLinkService`),ZK=VK(`UnicodeService`),QK=VK(`DecorationService`),$K=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new IK,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):eq(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};$K=gK([J(0,UK),J(1,YK),J(2,XK)],$K);function eq(e,t){if(confirm(`Do you want to navigate to ${t}?
1533
1533
 
1534
1534
  WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var tq=VK(`CharSizeService`),nq=VK(`CoreBrowserService`),rq=VK(`MouseService`),iq=VK(`RenderService`),aq=VK(`SelectionService`),oq=VK(`CharacterJoinerService`),sq=VK(`ThemeService`),cq=VK(`LinkProviderService`),lq=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?hq.isErrorNoTelemetry(e)?new hq(e.message+`
1535
1535
 
@@ -1611,5 +1611,5 @@ out vec4 outColor;
1611
1611
 
1612
1612
  void main() {
1613
1613
  outColor = v_color;
1614
- }`,V2=8,H2=V2*Float32Array.BYTES_PER_ELEMENT,U2=20*V2,W2=class{constructor(){this.attributes=new Float32Array(U2),this.count=0}},G2=0,K2=0,q2=0,J2=0,Y2=0,X2=0,Z2=0,Q2=class extends C1{constructor(e,t,n,r){super(),this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new W2,this._verticesCursor=new W2;let i=this._gl;this._program=G1(_2(i,z2,B2)),this._register(b1(()=>i.deleteProgram(this._program))),this._projectionLocation=G1(i.getUniformLocation(this._program,`u_projection`)),this._vertexArrayObject=i.createVertexArray(),i.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),o=i.createBuffer();this._register(b1(()=>i.deleteBuffer(o))),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,a,i.STATIC_DRAW),i.enableVertexAttribArray(3),i.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),c=i.createBuffer();this._register(b1(()=>i.deleteBuffer(c))),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c),i.bufferData(i.ELEMENT_ARRAY_BUFFER,s,i.STATIC_DRAW),this._attributesBuffer=G1(i.createBuffer()),this._register(b1(()=>i.deleteBuffer(this._attributesBuffer))),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.enableVertexAttribArray(0),i.vertexAttribPointer(0,2,i.FLOAT,!1,H2,0),i.vertexAttribDivisor(0,1),i.enableVertexAttribArray(1),i.vertexAttribPointer(1,2,i.FLOAT,!1,H2,2*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(1,1),i.enableVertexAttribArray(2),i.vertexAttribPointer(2,4,i.FLOAT,!1,H2,4*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,g2),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,n=this._vertices,r=1,i,a,o,s,c,l,u,d,f,p,m;for(i=0;i<t.rows;i++){for(o=-1,s=0,c=0,l=!1,a=0;a<t.cols;a++)u=(i*t.cols+a)*N2,d=e.cells[u+P2],f=e.cells[u+F2],p=!!(f&67108864),(d!==s||f!==c&&(l||p))&&((s!==0||l&&c!==0)&&(m=r++*V2,this._updateRectangle(n,m,c,s,o,a,i)),o=a,s=d,c=f,l=p);(s!==0||l&&c!==0)&&(m=r++*V2,this._updateRectangle(n,m,c,s,o,t.cols,i))}n.count=r}updateCursor(e){let t=this._verticesCursor,n=e.cursor;if(!n||n.style===`block`){t.count=0;return}let r,i=0;(n.style===`bar`||n.style===`outline`)&&(r=i++*V2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style===`bar`?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style===`underline`||n.style===`outline`)&&(r=i++*V2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style===`outline`&&(r=i++*V2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),r=i++*V2,this._addRectangleFloat(t.attributes,r,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=i}_updateRectangle(e,t,n,r,i,a,o){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:G2=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:G2=(n&16777215)<<8;break;case 0:default:G2=this._themeService.colors.foreground.rgba}else switch(r&50331648){case 16777216:case 33554432:G2=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:G2=(r&16777215)<<8;break;case 0:default:G2=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=y2(e.attributes,this._terminal.rows*this._terminal.cols*V2)),K2=i*this._dimensions.device.cell.width,q2=o*this._dimensions.device.cell.height,J2=(G2>>24&255)/255,Y2=(G2>>16&255)/255,X2=(G2>>8&255)/255,Z2=1,this._addRectangle(e.attributes,t,K2,q2,(a-i)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,J2,Y2,X2,Z2)}_addRectangle(e,t,n,r,i,a,o,s,c,l){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=c,e[t+7]=l}_addRectangleFloat(e,t,n,r,i,a,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},$2=class extends C1{constructor(e,t,n,r,i,a,o,s){super(),this._container=t,this._alpha=i,this._coreBrowserService=a,this._optionsService=o,this._themeService=s,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(b1(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=G1(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=l2(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=d0,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?`italic`:``} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},e4=class extends $2{constructor(e,t,n,r,i,a,o){super(n,e,`link`,t,!0,i,a,o),this._register(r.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(r.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&s2(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},t4=typeof window==`object`?window:globalThis,n4=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Y0,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Y0,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};n4.INSTANCE=new n4;var r4=n4;function i4(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}r4.INSTANCE.onDidChangeZoomLevel,r4.INSTANCE.onDidChangeFullscreen;var a4=typeof navigator==`object`?navigator.userAgent:``;a4.indexOf(`Firefox`);var o4=a4.indexOf(`AppleWebKit`)>=0;!(a4.indexOf(`Chrome`)>=0)&&a4.indexOf(`Safari`),a4.indexOf(`Electron/`),a4.indexOf(`Android`);var s4=!1;if(typeof t4.matchMedia==`function`){let e=t4.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=t4.matchMedia(`(display-mode: fullscreen)`);s4=e.matches,i4(t4,e,({matches:e})=>{s4&&t.matches||(s4=e)})}function c4(){return s4}var l4=`en`,u4=!1,d4=!1,f4=!1,p4=l4,m4,h4=globalThis,g4;typeof h4.vscode<`u`&&typeof h4.vscode.process<`u`?g4=h4.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(g4=process);var _4=typeof g4?.versions?.electron==`string`&&g4?.type===`renderer`;if(typeof g4==`object`){g4.platform,g4.platform,u4=g4.platform===`linux`,u4&&g4.env.SNAP&&g4.env.SNAP_REVISION,g4.env.CI||g4.env.BUILD_ARTIFACTSTAGINGDIRECTORY,p4=l4;let e=g4.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,p4=t.resolvedLanguage||l4,t.languagePack?.translationsConfigFile}catch{}d4=!0}else typeof navigator==`object`&&!_4?(m4=navigator.userAgent,m4.indexOf(`Windows`),m4.indexOf(`Macintosh`),(m4.indexOf(`Macintosh`)>=0||m4.indexOf(`iPad`)>=0||m4.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,u4=m4.indexOf(`Linux`)>=0,m4?.indexOf(`Mobi`),f4=!0,p4=globalThis._VSCODE_NLS_LANGUAGE||l4,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var v4=d4;f4&&typeof h4.importScripts==`function`&&h4.origin;var y4=m4,b4=p4,x4;(e=>{function t(){return b4}e.value=t;function n(){return b4.length===2?b4===`en`:b4.length>=3&&b4[0]===`e`&&b4[1]===`n`&&b4[2]===`-`}e.isDefaultVariant=n;function r(){return b4===`en`}e.isDefault=r})(x4||={});var S4=typeof h4.postMessage==`function`&&!h4.importScripts;(()=>{if(S4){let e=[];h4.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),h4.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var C4=!!(y4&&y4.indexOf(`Chrome`)>=0);y4&&y4.indexOf(`Firefox`),!C4&&y4&&y4.indexOf(`Safari`),y4&&y4.indexOf(`Edg/`),y4&&y4.indexOf(`Android`);var w4=typeof navigator==`object`?navigator:{};v4||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||w4&&w4.clipboard&&w4.clipboard.writeText,v4||w4&&w4.clipboard&&w4.clipboard.readText,v4||c4()||w4.keyboard,`ontouchstart`in t4||w4.maxTouchPoints,t4.PointerEvent&&(`ontouchstart`in t4||navigator.maxTouchPoints);var T4=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},E4=new T4,D4=new T4,O4=new T4;Array(230);var k4;(e=>{function t(e){return E4.keyCodeToStr(e)}e.toString=t;function n(e){return E4.strToKeyCode(e)}e.fromString=n;function r(e){return D4.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return O4.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return D4.strToKeyCode(e)||O4.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return E4.keyCodeToStr(e)}e.toElectronAccelerator=o})(k4||={});var A4=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),Boe;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof Voe?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:I0.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:A4})})(Boe||={});var Voe=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?A4:(this._emitter||=new Y0,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var Hoe;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(Hoe||={});var j4=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Y0,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await I0.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};j4.EMPTY=j4.fromArray([]);function Uoe(e){return M4(e,0)}function M4(e,t){switch(typeof e){case`object`:return e===null?N4(349,t):Array.isArray(e)?Goe(e,t):Koe(e,t);case`string`:return P4(e,t);case`boolean`:return Woe(e,t);case`number`:return N4(e,t);case`undefined`:return N4(937,t);default:return N4(617,t)}}function N4(e,t){return(t<<5)-t+e|0}function Woe(e,t){return N4(e?433:863,t)}function P4(e,t){t=N4(149417,t);for(let n=0,r=e.length;n<r;n++)t=N4(e.charCodeAt(n),t);return t}function Goe(e,t){return t=N4(104579,t),e.reduce((e,t)=>M4(t,e),t)}function Koe(e,t){return t=N4(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=P4(n,t),M4(e[n],t)),t)}var{registerWindow:qoe,getWindow:Joe,getDocument:Yoe,getWindows:Xoe,getWindowsCount:Zoe,getWindowId:Qoe,getWindowById:$oe,hasWindow:ese,onDidRegisterWindow:tse,onWillUnregisterWindow:nse,onDidUnregisterWindow:rse}=function(){let e=new Map,t={window:t4,disposables:new S1};e.set(t4.vscodeWindowId,t);let n=new Y0,r=new Y0,i=new Y0;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return C1.None;let a=new S1,o={window:t,disposables:a.add(new S1)};return e.set(t.vscodeWindowId,o),a.add(b1(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(F4(t,ase.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:t4},getDocument(e){return Joe(e).document}}}(),ise=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function F4(e,t,n,r){return new ise(e,t,n,r)}var I4=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};I4.None=new I4(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=Uoe(n),a=r.get(i);if(a)a.users+=1;else{let o=new Y0,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(b1(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var ase={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:o4?`webkitAnimationStart`:`animationstart`,ANIMATION_END:o4?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:o4?`webkitAnimationIteration`:`animationiteration`},ose=class extends C1{constructor(e,t,n,r,i,a,o,s,c){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new w1,this._charAtlasDisposable=this._register(new w1),this._observerDisposable=this._register(new w1),this._model=new R2,this._workCell=new h2,this._workCell2=new h2,this._rectangleRenderer=this._register(new w1),this._glyphRenderer=this._register(new w1),this._onChangeTextureAtlas=this._register(new Y0),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Y0),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Y0),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Y0),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Y0),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`);let l={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext(`webgl2`,l),!this._gl)throw Error(`WebGL2 not supported `+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new l0(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new e4(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=$1(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(F4(this._canvas,`webglcontextlost`,e=>{console.log(`webglcontextlost event received`),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn(`webgl context not restored; firing onContextLoss`),this._onContextLoss.fire(e)},3e3)})),this._register(F4(this._canvas,`webglcontextrestored`,e=>{console.warn(`webglcontextrestored event received`),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,u2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=p2(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=p2(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(b1(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),u2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Q2(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new A2(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=l2(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=y1(I0.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),I0.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached){if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return}for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new f2(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,i,a,o,s,c,l,u=0,d=!0,f,p,m,h,g,_,v,y,b;e=L4(e,n.rows-1,0),t=L4(t,n.rows-1,0);let x=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??`block`,S=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ee=S-n.buffer.ydisp,te=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),C=-1,ne=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let w=!1;for(a=e;a<=t;a++)for(o=a+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[a]=0,m=S===o,u=0,c=this._characterJoinerService.getJoinedCharacters(o),y=0;y<n.cols;y++){if(i=this._cellColorResolver.result.bg,s.loadCell(y,r),y===0&&(i=this._cellColorResolver.result.bg),l=!1,d=y>=u,f=y,c.length>0&&y===c[0][0]&&d){p=c.shift();let e=this._model.selection.isCellSelected(this._terminal,p[0],o);for(v=p[0]+1;v<p[1];v++)d&&=e===this._model.selection.isCellSelected(this._terminal,v,o);d&&=!m||te<p[0]||te>=p[1],d?(l=!0,r=new sse(r,s.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1):u=p[1]}if(h=r.getChars(),g=r.getCode(),v=(a*n.cols+y)*N2,this._cellColorResolver.resolve(r,y,o,this.dimensions.device.cell.width),ne&&o===S&&(y===te&&(this._model.cursor={x:te,y:ee,width:r.getWidth(),style:this._coreBrowserService.isFocused?x:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},C=te+r.getWidth()-1),y>=te&&y<=C&&(this._coreBrowserService.isFocused&&x===`block`||this._coreBrowserService.isFocused===!1&&n.options.cursorInactiveStyle===`block`)&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),g!==0&&(this._model.lineLengths[a]=y+1),(this._model.cells[v]!==g||this._model.cells[v+P2]!==this._cellColorResolver.result.bg||this._model.cells[v+F2]!==this._cellColorResolver.result.fg||this._model.cells[v+I2]!==this._cellColorResolver.result.ext)&&(w=!0,h.length>1&&(g|=L2),this._model.cells[v]=g,this._model.cells[v+P2]=this._cellColorResolver.result.bg,this._model.cells[v+F2]=this._cellColorResolver.result.fg,this._model.cells[v+I2]=this._cellColorResolver.result.ext,_=r.getWidth(),this._glyphRenderer.value.updateCell(y,a,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,h,_,i),l)){for(r=this._workCell,y++;y<=f;y++)b=(a*n.cols+y)*N2,this._glyphRenderer.value.updateCell(y,a,0,0,0,0,M1,0,0),this._model.cells[b]=0,this._model.cells[b+P2]=this._cellColorResolver.result.bg,this._model.cells[b+F2]=this._cellColorResolver.result.fg,this._model.cells[b+I2]=this._cellColorResolver.result.ext;y--}}w&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},sse=class extends j0{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function L4(e,t,n=0){return Math.max(Math.min(e,t),n)}var R4=`di$target`,z4=`di$dependencies`,B4=new Map;function V4(e){if(B4.has(e))return B4.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);cse(t,e,r)};return t._id=e,B4.set(e,t),t}function cse(e,t,n){t[R4]===t?t[z4].push({id:e,index:n}):(t[z4]=[{id:e,index:n}],t[R4]=t)}V4(`BufferService`),V4(`CoreMouseService`),V4(`CoreService`),V4(`CharsetService`),V4(`InstantiationService`),V4(`LogService`);var lse=V4(`OptionsService`);V4(`OscLinkService`),V4(`UnicodeService`),V4(`DecorationService`);var use={trace:0,debug:1,info:2,warn:3,error:4,off:5},dse=`xterm.js: `,H4=class extends C1{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),fse=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=use[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:dse)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};H4=n1([r1(0,lse)],H4);var fse,pse=class extends C1{constructor(e){if(A1&&j1()<16&&!document.createElement(`canvas`).getContext(`webgl2`,{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error(`Webgl2 is only supported on Safari 16 and above`);super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Y0),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Y0),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Y0),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Y0),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let n=t.coreService,r=t.optionsService,i=t,a=i._renderService,o=i._characterJoinerService,s=i._charSizeService,c=i._coreBrowserService,l=i._decorationService;i._logService;let u=i._themeService;this._renderer=this._register(new ose(e,o,s,c,n,l,r,u,this._preserveDrawingBuffer)),this._register(I0.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(I0.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(I0.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(I0.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),a.setRenderer(this._renderer),this._register(b1(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},mse=2,hse=1,gse=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(mse,Math.floor(u/e.css.cell.width)),rows:Math.max(hse,Math.floor(l/e.css.cell.height))}}},U4=`3.7.8`,_se=U4,W4=typeof Buffer==`function`,G4=typeof TextDecoder==`function`?new TextDecoder:void 0,K4=typeof TextEncoder==`function`?new TextEncoder:void 0,q4=Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`),J4=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(q4),vse=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Y4=String.fromCharCode.bind(String),X4=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Z4=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),Q4=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),$4=e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=q4[t>>18&63]+q4[t>>12&63]+q4[t>>6&63]+q4[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},e3=typeof btoa==`function`?e=>btoa(e):W4?e=>Buffer.from(e,`binary`).toString(`base64`):$4,t3=W4?e=>Buffer.from(e).toString(`base64`):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(Y4.apply(null,e.subarray(n,n+4096)));return e3(t.join(``))},n3=(e,t=!1)=>t?Z4(t3(e)):t3(e),yse=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?Y4(192|t>>>6)+Y4(128|t&63):Y4(224|t>>>12&15)+Y4(128|t>>>6&63)+Y4(128|t&63)}var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return Y4(240|t>>>18&7)+Y4(128|t>>>12&63)+Y4(128|t>>>6&63)+Y4(128|t&63)},bse=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,r3=e=>e.replace(bse,yse),i3=W4?e=>Buffer.from(e,`utf8`).toString(`base64`):K4?e=>t3(K4.encode(e)):e=>e3(r3(e)),a3=(e,t=!1)=>t?Z4(i3(e)):i3(e),o3=e=>a3(e,!0),xse=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Sse=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return Y4((t>>>10)+55296)+Y4((t&1023)+56320);case 3:return Y4((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Y4((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},s3=e=>e.replace(xse,Sse),c3=e=>{if(e=e.replace(/\s+/g,``),!vse.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a<e.length;)t=J4[e.charAt(a++)]<<18|J4[e.charAt(a++)]<<12|(n=J4[e.charAt(a++)])<<6|(r=J4[e.charAt(a++)]),n===64?i.push(Y4(t>>16&255)):r===64?i.push(Y4(t>>16&255,t>>8&255)):i.push(Y4(t>>16&255,t>>8&255,t&255));return i.join(``)},l3=typeof atob==`function`?e=>atob(Q4(e)):W4?e=>Buffer.from(e,`base64`).toString(`binary`):c3,u3=W4?e=>X4(Buffer.from(e,`base64`)):e=>X4(l3(e).split(``).map(e=>e.charCodeAt(0))),d3=e=>u3(f3(e)),Cse=W4?e=>Buffer.from(e,`base64`).toString(`utf8`):G4?e=>G4.decode(u3(e)):e=>s3(l3(e)),f3=e=>Q4(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),p3=e=>Cse(f3(e)),wse=e=>{if(typeof e!=`string`)return!1;let t=e.replace(/\s+/g,``).replace(/={0,2}$/,``);return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},m3=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),h3=function(){let e=(e,t)=>Object.defineProperty(String.prototype,e,m3(t));e(`fromBase64`,function(){return p3(this)}),e(`toBase64`,function(e){return a3(this,e)}),e(`toBase64URI`,function(){return a3(this,!0)}),e(`toBase64URL`,function(){return a3(this,!0)}),e(`toUint8Array`,function(){return d3(this)})},g3=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,m3(t));e(`toBase64`,function(e){return n3(this,e)}),e(`toBase64URI`,function(){return n3(this,!0)}),e(`toBase64URL`,function(){return n3(this,!0)})},_3={version:U4,VERSION:_se,atob:l3,atobPolyfill:c3,btoa:e3,btoaPolyfill:$4,fromBase64:p3,toBase64:a3,encode:a3,encodeURI:o3,encodeURL:o3,utob:r3,btou:s3,decode:p3,isValid:wse,fromUint8Array:n3,toUint8Array:d3,extendString:h3,extendUint8Array:g3,extendBuiltins:()=>{h3(),g3()}},Tse=class{constructor(e=new Dse,t=new Ese){this._base64=e,this._provider=t}activate(e){this._terminal=e,this._disposable=e.parser.registerOscHandler(52,e=>this._setOrReportClipboard(e))}dispose(){return this._disposable?.dispose()}_readText(e,t){let n=this._base64.encodeText(t);this._terminal?.input(`\x1B]52;${e};${n}\x07`,!1)}_setOrReportClipboard(e){let t=e.split(`;`);if(t.length<2)return!0;let n=t[0],r=t[1];if(r===`?`){let e=this._provider.readText(n);return e instanceof Promise?e.then(e=>(this._readText(n,e),!0)):(this._readText(n,e),!0)}let i=``;try{i=this._base64.decodeText(r)}catch{}let a=this._provider.writeText(n,i);return a instanceof Promise?a.then(()=>!0):!0}},Ese=class{async readText(e){return e===`c`?navigator.clipboard.readText():Promise.resolve(``)}async writeText(e,t){return e===`c`?navigator.clipboard.writeText(t):Promise.resolve()}},Dse=class{encodeText(e){return _3.encode(e)}decodeText(e){let t=_3.decode(e);return!_3.isValid(e)||_3.encode(t)!==e?``:t}},Ose=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=Ase.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function kse(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var Ase=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!kse(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},jse=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function Mse(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var Nse=class{constructor(e=Mse,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||jse;this._linkProvider=this._terminal.registerLinkProvider(new Ose(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}};function Pse(e,t){let{term:n,write:r}=e,i=new TextEncoder,a=null,o=0,s=!1,c=null,l=()=>{if(s)return;let i=location.protocol===`https:`?`wss`:`ws`,f=a=new WebSocket(`${i}://${location.host}/term/${e.sessionId}?cols=${n.cols}&rows=${n.rows}&visible=${+!!u()}`);f.onmessage=e=>r(e.data),f.onopen=()=>{o=0,d(f),c&&=(f.send(JSON.stringify({resize:c})),null),m()},f.onclose=()=>{if(!(t.aborted||s||a!==f)){if(document.visibilityState!==`visible`){let e=()=>{document.visibilityState===`visible`&&(document.removeEventListener(`visibilitychange`,e),!t.aborted&&a===f&&l())};document.addEventListener(`visibilitychange`,e,{signal:t})}else++o<=3?setTimeout(()=>{!t.aborted&&a===f&&l()},400*o):e.onDead()}}},u=()=>document.visibilityState===`visible`&&e.isVisible(),d=e=>{e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({visible:u()}))};document.addEventListener(`visibilitychange`,()=>a&&d(a),{signal:t}),l(),t.addEventListener(`abort`,()=>a?.close());let f=[],p=0,m=()=>{for(;f.length&&a?.readyState===WebSocket.OPEN;)a.send(i.encode(f.shift()));p=0};return{send(e){a?.readyState===WebSocket.OPEN?a.send(i.encode(e)):p<1024&&(f.push(e),p+=e.length)},resize(e,t){a?.readyState===WebSocket.OPEN?a.send(JSON.stringify({resize:[e,t]})):c=[e,t]},syncVisibility(){a&&d(a)},get readyState(){return a?.readyState},reconnect(){s=!1,l()},disconnect(){s=!0,a?.close()}}}function Fse(e,t,n,r){let i=null,a=0,o=0,s=0,c=0,l=n=>{let r=t().querySelector(`.xterm-screen`)||t(),i=r.clientHeight/e.rows||17;c+=n/i;let a=Math.trunc(c);if(!a)return;c-=a;let o=r.getBoundingClientRect(),s=a>0?1:-1;for(let e=0;e!==a;e+=s)r.dispatchEvent(new WheelEvent(`wheel`,{deltaY:s,deltaMode:WheelEvent.DOM_DELTA_LINE,bubbles:!0,cancelable:!0,clientX:o.left+o.width/2,clientY:o.top+o.height/2}))},u=()=>{cancelAnimationFrame(s),s=0},d=()=>{o*=.97,!(Math.abs(o)<.25)&&(l(o*16),s=requestAnimationFrame(d))};n.addEventListener(`abort`,u),t().addEventListener(`touchstart`,e=>{u(),o=0,i=e.touches[0]?.clientY??null,a=e.timeStamp},{passive:!0,signal:n}),t().addEventListener(`touchmove`,e=>{if(r?.())return;let t=e.touches[0]?.clientY;if(t==null||i==null)return;let n=i-t;Math.abs(n)>=2&&(o=n/Math.max(1,e.timeStamp-a),i=t,a=e.timeStamp,l(n)),e.preventDefault()},{passive:!1,signal:n}),t().addEventListener(`touchend`,()=>{i=null,Math.abs(o)>.5&&(u(),s=requestAnimationFrame(d))},{signal:n})}function Ise(e){let t=!1,n=[],r=0;return{write(i){if(!t){e.write(i);return}for(n.push(i),r+=i.length;r>1048576&&n.length>1;)r-=n.shift().length},setFrozen(i){if(t!==i&&(t=i,!i)){let t=n.join(``);n=[],r=0,t&&e.write(t)}}}}function Lse(e,t,n){let r=e.textarea;if(!r)return;let i=`\xA0`.repeat(4),a={deleteContentBackward:``,deleteWordBackward:``,deleteSoftLineBackward:``,deleteHardLineBackward:``},o=!1,s=()=>{o||(r.value!==i&&(r.value=i),r.setSelectionRange(i.length,i.length))};r.addEventListener(`beforeinput`,e=>{let n=a[e.inputType];n&&(e.preventDefault(),e.stopImmediatePropagation(),t(n))},{capture:!0,signal:n}),r.addEventListener(`compositionstart`,()=>{o=!0},{signal:n}),r.addEventListener(`compositionend`,()=>{o=!1,setTimeout(s,0)},{signal:n}),r.addEventListener(`input`,()=>setTimeout(s,0),{signal:n}),r.addEventListener(`focus`,()=>setTimeout(s,0),{signal:n}),s()}var Rse=450,zse=12,Bse=` ·│┃()[]{}<>'"\`,;│|`;function Vse(e,t,n,r){let i=!1,a,o=0,s=0,c=null,l=null,u=()=>t().querySelector(`.xterm-screen`)||t(),d=(t,n)=>{let r=u().getBoundingClientRect();return{col:Math.max(0,Math.min(e.cols-1,Math.floor((t-r.left)/r.width*e.cols))),row:Math.max(0,Math.min(e.rows-1,Math.floor((n-r.top)/r.height*e.rows)))+e.buffer.active.viewportY}},f=t=>{let n=e.buffer.active.getLine(t.row)?.translateToString()??``,r=e=>!e||e===` `||Bse.includes(e);if(r(n[t.col]))return{start:t,end:t};let i=t.col,a=t.col;for(;i>0&&!r(n[i-1]);)i--;for(;a<n.length-1&&!r(n[a+1]);)a++;return{start:{col:i,row:t.row},end:{col:a,row:t.row}}},p=(e,t)=>e.row<t.row||e.row===t.row&&e.col<=t.col,m=()=>{if(!c||!l)return;let[t,n]=p(c,l)?[c,l]:[l,c],r=(n.row-t.row)*e.cols+(n.col-t.col)+1;e.select(t.col,t.row,Math.max(1,r))},h=()=>{clearTimeout(a),a=void 0};t().addEventListener(`touchstart`,t=>{if(t.touches.length!==1){h();return}!i&&e.hasSelection()&&e.clearSelection(),o=t.touches[0].clientX,s=t.touches[0].clientY,a=setTimeout(()=>{a=void 0,i=!0,n.onStart();let e=f(d(o,s));c=e.start,l=e.end,m(),navigator.vibrate?.(10)},Rse)},{passive:!0,signal:r}),t().addEventListener(`touchmove`,e=>{let t=e.touches[0];if(t){if(i){l=d(t.clientX,t.clientY),m(),e.preventDefault();return}a&&Math.hypot(t.clientX-o,t.clientY-s)>zse&&h()}},{passive:!1,signal:r});let g=()=>{if(h(),!i)return;i=!1,n.onEnd();let t=e.getSelection();t&&Kh(t).then(e=>{e&&n.onCopy(t)})};return t().addEventListener(`touchend`,g,{signal:r}),t().addEventListener(`touchcancel`,g,{signal:r}),{selecting:()=>i}}var Hse=5;function Use(e,t,n,r){let i=null,a=!1,o=0,s=0,c=()=>t().querySelector(`.xterm-screen`)||t(),l=(t,n)=>{let r=c().getBoundingClientRect();return{col:Math.max(0,Math.min(e.cols-1,Math.floor((t-r.left)/r.width*e.cols))),row:Math.max(0,Math.min(e.rows-1,Math.floor((n-r.top)/r.height*e.rows)))+e.buffer.active.viewportY}};t().addEventListener(`mousedown`,t=>{if(a||t.button!==0||t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)return;t.preventDefault(),t.stopImmediatePropagation();let n=t.timeStamp;s=n-o<400?s+1:1,o=n;let r=l(t.clientX,t.clientY);i={startX:t.clientX,startY:t.clientY,startCol:r.col,startRow:r.row,selecting:!1,detail:s},e.focus()},{capture:!0,signal:r}),window.addEventListener(`mousemove`,t=>{if(!i)return;if(!i.selecting){if(Math.hypot(t.clientX-i.startX,t.clientY-i.startY)<Hse)return;i.selecting=!0}let n=l(t.clientX,t.clientY),r=(n.row-i.startRow)*e.cols+(n.col-i.startCol)+1,[a,o,s]=r>=0?[i.startCol,i.startRow,Math.max(1,r)]:[n.col,n.row,Math.max(1,-r+1)];e.select(a,o,s),t.preventDefault()},{signal:r}),window.addEventListener(`mouseup`,async t=>{if(!i)return;let r=i.selecting,o=i;if(i=null,r){let t=e.getSelection();t&&await Kh(t)&&n(t);return}a=!0;let s={bubbles:!0,cancelable:!0,clientX:o.startX,clientY:o.startY,button:0,buttons:1,detail:o.detail,view:window},c=document.elementFromPoint(o.startX,o.startY);c?.dispatchEvent(new MouseEvent(`mousedown`,s)),c?.dispatchEvent(new MouseEvent(`mouseup`,{...s,buttons:0,button:0})),c?.dispatchEvent(new MouseEvent(`click`,{...s,buttons:0})),a=!1,t.preventDefault()},{signal:r})}function v3(e,t){let n=t.trim().toLowerCase();if(!n)return[];let r=e.buffer.active,i=n.length,a=[];for(let e=0;e<r.length;e++){let t=r.getLine(e);if(!t)continue;let o=t.translateToString(!1).toLowerCase(),s=0;for(;s<=o.length-i;){let t=o.indexOf(n,s);if(t<0)break;a.push({row:e,col:t,len:i}),s=t+i}}return a}function Wse(e,t){let n=document.createElement(`div`);n.className=`termFindOverlay`,n.setAttribute(`aria-hidden`,`true`),t.appendChild(n);let r=``,i=[],a=-1,o=0,s=()=>e.element?.querySelector(`.xterm-screen`)||e.element?.querySelector(`.xterm-rows`)||t,c=()=>{let n=s();if(!e.cols||!e.rows)return null;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();return i.width<1||i.height<1?null:{w:i.width/e.cols,h:i.height/e.rows,left:i.left-r.left,top:i.top-r.top}},l=()=>{n.replaceChildren();let t=r.trim().toLowerCase();if(!t){n.style.display=`none`;return}let o=c();if(!o){n.style.display=`none`;return}n.style.display=`block`,n.style.left=`${o.left}px`,n.style.top=`${o.top}px`,n.style.width=`${o.w*e.cols}px`,n.style.height=`${o.h*e.rows}px`;let s=e.buffer.active,l=s.viewportY,u=t.length,d=a>=0?i[a]:null;for(let r=0;r<e.rows;r++){let i=l+r,a=s.getLine(i);if(!a)continue;let c=a.translateToString(!1).toLowerCase(),f=0;for(;f<=c.length-u;){let a=c.indexOf(t,f);if(a<0)break;if(a<e.cols){let t=Math.min(u,e.cols-a),s=document.createElement(`div`);s.className=d&&d.row===i&&d.col===a&&d.len===u?`termFindHit termFindHitActive`:`termFindHit`,s.style.left=`${a*o.w}px`,s.style.top=`${r*o.h}px`,s.style.width=`${t*o.w}px`,s.style.height=`${o.h}px`,n.appendChild(s)}f=a+u}}},u=t=>{let n=e.buffer.active.viewportY;(t.row<n||t.row>=n+e.rows)&&e.scrollToLine(Math.max(0,t.row-Math.floor(e.rows/2))),e.select(t.col,t.row,t.len)},d=t=>{if(!i.length)return a=-1,e.clearSelection(),t<0?`up`:t>0?`down`:null;if(t===0)a=i.length-1;else if(a<0||a>=i.length)a=t>0?0:i.length-1;else if(t>0){if(a>=i.length-1)return`down`;a+=1}else{if(a<=0)return`up`;--a}return u(i[a]),null},f=t=>{let n=s(),r=n.getBoundingClientRect(),i=Math.max(1,e.rows-1),a=t===`up`?-1:1;for(let e=0;e<i;e++)n.dispatchEvent(new WheelEvent(`wheel`,{deltaY:a,deltaMode:WheelEvent.DOM_DELTA_LINE,bubbles:!0,cancelable:!0,clientX:r.left+r.width/2,clientY:r.top+r.height/2}))},p=()=>{o&&clearTimeout(o),o=0};return{search(t,n){p(),r=t,i=v3(e,r);let s=d(n);l(),!(!s||n===0)&&(f(s),o=setTimeout(()=>{o=0,r===t&&(i=v3(e,r),a=-1,d(n),l())},80))},refresh(){l()},clear(){p(),r=``,i=[],a=-1,e.clearSelection(),l()},dispose(){p(),n.remove()}}}var Gse=2,Kse=[`#2e3436`,`#cc0000`,`#4e9a06`,`#c4a000`,`#3465a4`,`#75507b`,`#06989a`,`#d3d7cf`,`#555753`,`#ef2929`,`#8ae234`,`#fce94f`,`#729fcf`,`#ad7fa8`,`#34e2e2`,`#eeeeec`];function y3(e){return e?.background||`#000000`}function qse(e,t){if(t<0||t>255)return y3(e);let n=[e?.black,e?.red,e?.green,e?.yellow,e?.blue,e?.magenta,e?.cyan,e?.white,e?.brightBlack,e?.brightRed,e?.brightGreen,e?.brightYellow,e?.brightBlue,e?.brightMagenta,e?.brightCyan,e?.brightWhite][t];if(n)return n;if(t<16)return Kse[t];if(t<232){let e=t-16,n=Math.floor(e/36),r=Math.floor(e%36/6),i=e%6,a=e=>e===0?0:55+e*40;return`rgb(${a(n)},${a(r)},${a(i)})`}let r=8+(t-232)*10;return`rgb(${r},${r},${r})`}function Jse(e,t){let n=e.options.theme;if(t.isBgDefault())return y3(n);if(t.isBgRGB()){let e=t.getBgColor();return`rgb(${e>>16&255},${e>>8&255},${e&255})`}return t.isBgPalette()?qse(n,t.getBgColor()):y3(n)}function Yse(e){let t=e.buffer.active,n=t.getNullCell(),r=t.viewportY,i=Math.min(t.length-1,r+Math.max(0,e.rows-1)),a=Math.max(0,e.cols-1),o=[[0,r],[a,r],[0,i],[a,i],[Math.floor(a/2),r+Math.floor((i-r)/2)]],s=new Map;for(let[r,i]of o){if(!t.getLine(i)?.getCell(r,n))continue;let a=Jse(e,n);s.set(a,(s.get(a)||0)+1)}let c=y3(e.options.theme),l=0;for(let[e,t]of s)t>l&&(c=e,l=t);return c}function Xse(e){let t=e._core?._renderService?.dimensions?.css?.cell;return!t?.width||!t?.height?null:{w:t.width,h:t.height}}function Zse(e){try{let t=e._core;if(!t)return;let n=t._viewport||t.viewport;return n?n._scrollableElement||n.scrollableElement:void 0}catch{return}}function b3(e){try{let t=e.options.overviewRuler;(!t||t.width!==0)&&(e.options.overviewRuler={...t||{},width:0}),Zse(e)?.updateOptions?.({vertical:Gse,verticalScrollbarSize:0})}catch{}}function x3(e,t,n){return e.style.getPropertyValue(t)===n&&e.style.getPropertyPriority(t)===`important`?!1:(e.style.setProperty(t,n,`important`),!0)}function S3(e){x3(e,`display`,`none`),x3(e,`width`,`0px`),x3(e,`min-width`,`0px`),x3(e,`max-width`,`0px`),x3(e,`height`,`0px`),x3(e,`opacity`,`0`),x3(e,`pointer-events`,`none`),x3(e,`visibility`,`hidden`)}function Qse(e){return e instanceof HTMLElement?e.classList.contains(`scrollbar`)||e.classList.contains(`slider`)||e.classList.contains(`shadow`):!1}function $se(e){let t=e.element;if(!t)return{dispose(){}};let n=!1,r=new Set,i=new MutationObserver(()=>{if(!n){n=!0;try{for(let e of r)e.isConnected&&S3(e)}finally{n=!1}}}),a=e=>{if(!r.has(e)){r.add(e),n=!0;try{S3(e)}finally{n=!1}i.observe(e,{attributes:!0,attributeFilter:[`style`,`class`]})}};(()=>{b3(e);let r=t.querySelector(`.xterm-viewport`);if(r){n=!0;try{x3(r,`overflow`,`hidden`),x3(r,`overflow-y`,`hidden`),x3(r,`overflow-x`,`hidden`)}finally{n=!1}}for(let e of t.querySelectorAll(`.scrollbar, .scrollbar .slider, .xterm-scrollable-element > .shadow`))a(e)})();let o=new MutationObserver(t=>{let n=!1;for(let e of t)for(let t of e.addedNodes)if(Qse(t))n=!0,a(t);else if(t instanceof HTMLElement)for(let e of t.querySelectorAll(`.scrollbar, .slider, .shadow`))n=!0,a(e);n&&b3(e)});return o.observe(t,{childList:!0,subtree:!0}),{dispose(){i.disconnect(),o.disconnect(),r.clear()}}}function C3(e,t){b3(e);let n=e.element?.parentElement,r=Xse(e);if(!n||!r||!e.element){t.fit();return}let i=getComputedStyle(n),a=getComputedStyle(e.element),o=(parseFloat(a.paddingLeft)||0)+(parseFloat(a.paddingRight)||0),s=(parseFloat(a.paddingTop)||0)+(parseFloat(a.paddingBottom)||0),c=Math.max(0,parseFloat(i.width)||n.clientWidth)-o,l=Math.max(0,parseFloat(i.height)||n.clientHeight)-s,u=Math.max(2,Math.floor(c/r.w)),d=Math.max(1,Math.floor(l/r.h));if(e.cols!==u||e.rows!==d){try{e._core?._renderService?.clear?.()}catch{}e.resize(u,d)}}function w3(e,t){let n=e.element;if(!n)return;let r=Yse(e);if(n.dataset.shellBg===r&&(!t||t.dataset.shellBg===r))return;n.dataset.shellBg=r,n.style.backgroundColor=r,t&&(t.dataset.shellBg=r,t.style.backgroundColor=r);let i=n.querySelector(`.xterm-viewport`);i&&(i.style.backgroundColor=r);let a=n.querySelector(`.xterm-scrollable-element`);a&&(a.style.backgroundColor=r)}function ece(e,t){let n=0,r=()=>{n||=requestAnimationFrame(()=>{n=0,w3(e,t())})};w3(e,t());let i=e.onWriteParsed(r);return{dispose(){cancelAnimationFrame(n),i.dispose()}}}var tce=`_c_ _G`,T3=`_dH _G`,E3=`<div><div><input type=search enterkeyhint=search autocomplete=off placeholder="Find in terminal" aria-label="Find in terminal"><button type=button title="Previous match">↑</button><button type=button title="Next match">↓</button><button type=button title="Close find">×</button></div></div>`,D3=` D D b b b m`,nce=(e,t)=>{z(e.d,`disabled`,!t),z(e.e,`disabled`,!t)},O3=N(35,e=>nce(e,e.a8&&e.q)),k3=N(32,L(`u6`,e=>{e.v=!!e.q,e.x=e.t,e.n&&(e.n.focus=e.a5)}),5),A3=N(33,L(`u5`,e=>Tt(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(!e.v)return;if(t.key===`Escape`){if(document.querySelector(`dialog[open]`))return;t.preventDefault(),t.stopPropagation(),e.a4();return}let n=t.metaKey||t.ctrlKey;if(t.key===`F3`||n&&t.key.toLowerCase()===`g`){t.preventDefault(),t.stopPropagation(),e.a2(t.shiftKey?-1:1);return}if(!(n||t.altKey)){if(t.key===`Enter`){if(document.activeElement!==e.c)return;t.preventDefault(),t.stopPropagation(),e.a2(t.shiftKey?-1:1);return}if(t.key===`ArrowDown`){if(!e.x.trim())return;t.preventDefault(),t.stopPropagation(),e.a2(1);return}if(t.key===`ArrowUp`){if(!e.x.trim())return;t.preventDefault(),t.stopPropagation(),e.a2(-1)}}},{capture:!0,signal:t.signal}),e.a0=e.o,e.a1=!!e.q,e.q&&e.a5(),{abort:t}},onUpdate:function(){e.o!==e.a0&&(e.a0=e.o,e.q&&(e.a5(),e.c?.select())),e.q&&!e.a1?(e.a1=!0,e.a5()):e.q||(e.a1=!1)},onDestroy:function(){if(this.abort.abort(),e.v){let t=e.m;t&&t()}}})),9),j3=N(18,e=>B(e.a,[`_eL`,e.p===`keybar`?`_eN`:`_eM`,!e.q&&`_eP`])),M3=N(29,e=>jt(e,`c`,e.t,K3(e)),3),N3=Ke(16,e=>{z(e.a,`aria-hidden`,e.q?`false`:`true`),z(e.c,`tabindex`,e.q?0:-1),z(e.d,`tabindex`,e.q?0:-1),z(e.e,`tabindex`,e.q?0:-1),z(e.f,`tabindex`,e.q?0:-1),O3(e),k3(e),A3(e),j3(e),M3(e)}),P3=N(10,e=>N3(e,e.i,e.j)),F3=M(8,P3),I3=M(9,P3),rce=M(34,O3),L3=j(19,e=>{rce(e,!!e.t.trim()),k3(e),M3(e)}),ice=(e,t)=>{uce(e,t.open),dce(e,t.query)},ace=(e,t)=>{fce(e,t.tick),pce(e,t.wasOpen)},oce=M(31,e=>{k3(e),A3(e)}),sce=L(`u4`,e=>{Mt(e,`c`),A(e.c,`keydown`,function(t){if(e.q){if(t.key===`Escape`){t.preventDefault(),t.stopPropagation(),e.a4();return}t.stopPropagation()}}),A(e.d,`mousedown`,function(e){e.preventDefault()}),A(e.d,`click`,function(){e.a2(-1)}),A(e.e,`mousedown`,function(e){e.preventDefault()}),A(e.e,`click`,function(){e.a2(1)}),A(e.f,`mousedown`,function(e){e.preventDefault()}),A(e.f,`click`,function(){e.a4()})});function R3(e){B(e.c,`_eH`),B(e.d,lj),B(e.e,lj),B(e.f,lj),L3(e,``),ice(e,{open:!1,query:``}),ace(e,{tick:0,wasOpen:!1}),oce(e,q3(e)),sce(e)}var cce=M(28,e=>{A3(e),M3(e)}),z3=N(24,e=>cce(e,J3(e)),2),lce=M(30,A3),B3=N(22,e=>lce(e,Y3(e))),uce=M(21,e=>{z3(e),B3(e),k3(e),A3(e)}),dce=M(23,e=>{z3(e),k3(e),A3(e),M3(e)}),fce=M(26,A3),pce=M(27,A3),V3=M(11,z3),H3=M(12,e=>{B3(e),A3(e)}),U3=M(13,k3),W3=M(14,A3),G3=M(15,e=>{B(e.b,[`_eG`,e.p===`keybar`?`_eO`:`_eI`]),j3(e)});function K3(e){return function(t){e.q&&(L3(e,t),e.x=t,e.a2(0))}}function q3(e){return()=>{let t=e.c;t&&(t.focus(),document.activeElement!==t&&setTimeout(()=>t.focus(),0))}}function J3(e){return t=>{if(!e.v)return;let n=e.l;n&&n(e.x,t)}}function Y3(e){return()=>{N3(e,!1),e.v=!1;let t=e.m;t&&t()}}R(`u0`,K3),R(`u3`,q3),R(`u1`,J3),R(`u2`,Y3);var mce=Ur,hce=(e=>`/${e}&`)(Wr);function gce(e){Jr(e.a,`M8 6L20 6 M4 6.01L4.01 5.99889 M4 12.01L4.01 11.9989 M4 18.01L4.01 17.9989 M8 12L20 12 M8 18L20 18`)}var _ce=(e,t)=>Kr(e.a,t),vce=(e,t)=>qr(e.a,t),yce=Ur,bce=(e=>`/${e}&`)(Wr);function xce(e){Jr(e.a,`M15 4L8 20`)}var Sce=(e,t)=>Kr(e.a,t),Cce=(e,t)=>qr(e.a,t),wce=Ur,Tce=(e=>`/${e}&`)(Wr);function Ece(e){Jr(e.a,`M7 12L17 12 M7 8L13 8 M3 20.2895V5C3 3.89543 3.89543 3 5 3H19C20.1046 3 21 3.89543 21 5V15C21 16.1046 20.1046 17 19 17H7.96125C7.35368 17 6.77906 17.2762 6.39951 17.7506L4.06852 20.6643C3.71421 21.1072 3 20.8567 3 20.2895Z`)}var Dce=(e,t)=>Kr(e.a,t),Oce=(e,t)=>qr(e.a,t),kce=Ur,Ace=(e=>`/${e}&`)(Wr);function jce(e){Jr(e.a,`M8.5 4H6C4.89543 4 4 4.89543 4 6V20C4 21.1046 4.89543 22 6 22H18C19.1046 22 20 21.1046 20 20V6C20 4.89543 19.1046 4 18 4H15.5 M8 6.4V4.5C8 4.22386 8.22386 4 8.5 4C8.77614 4 9.00422 3.77604 9.05152 3.50398C9.19968 2.65171 9.77399 1 12 1C14.226 1 14.8003 2.65171 14.9485 3.50398C14.9958 3.77604 15.2239 4 15.5 4C15.7761 4 16 4.22386 16 4.5V6.4C16 6.73137 15.7314 7 15.4 7H8.6C8.26863 7 8 6.73137 8 6.4Z`)}var Mce=(e,t)=>Kr(e.a,t),Nce=(e,t)=>qr(e.a,t),Pce=`<div><div></div><!><!><!><!><!></div><!><!>`,Fce=` D b%b%b%b%b%l%c`,Ice=400,Lce=55,X3=3e4,Rce=150,zce=[[{kind:`paste`},{kind:`key`,label:`▲`,seq:`\x1B[A`},{kind:`key`,label:`⇥`,seq:` `}],[{kind:`key`,label:`◀`,seq:`\x1B[D`},{kind:`key`,label:`↵`,seq:`\r`},{kind:`key`,label:`▶`,seq:`\x1B[C`}],[{kind:`esc`},{kind:`key`,label:`▼`,seq:`\x1B[B`},{kind:`key`,label:`^C`,seq:``}]],Bce=L(`v26`,e=>A(e.a,`click`,function(){S6(e._._._,e._._.d),C6(e._._._,e._._.i||e._._.h)})),Vce=e=>{B(e.a,[`_dA`,`_dB`]),ql(e.b),Jl(e.b,12),Yl(e.b),Bce(e)},Z3=I(6,e=>jt(e,`c`,e._._.c,u8(e)),e=>e._._),Hce=L(`v25`,e=>{Mt(e,`c`),A(e.c,`keydown`,function(t){t.key===`Enter`?(t.preventDefault(),e._._.e(e._.d)):t.key===`Escape`&&(t.preventDefault(),S6(e._._,null))}),A(e.c,`blur`,function(){e._._.e(e._.d)}),Tt(e,{onMount:function(){queueMicrotask(()=>{let t=e.c;t?.focus(),t?.select()})}})}),Uce=e=>{Z3(e),Q3._(e),$3._(e),e.b,gi(e.b,14),vi(e.b),B(e.c,`_dy`),Hce(e)},Q3=P(0,0,e=>B(e.a,[`_o`,Yt[Hr(e._.g)]])),$3=P(0,0,e=>_i(e.b,e._.h)),Wce=e=>B(e.a,`_di`),Gce=e=>B(e.a,`_dj`),Kce=L(`v32`,e=>{A(e.a,`pointerdown`,function(e){e.preventDefault()}),A(e.a,`click`,function(){e._._._._.bc()})}),qce=e=>{jce(e.b),Mce(e.b,16),Nce(e.b),Kce(e)},Jce=P(0,2,e=>{B(e.a,[`_dJ`,{_dL:e._.e===`↵`,_dK:e._.e===`↵`||e._.e===`⇥`}]),V(e.b,e._.e)}),Yce=L(`v35`,e=>{A(e.a,`pointerdown`,function(t){t.preventDefault(),e._._._._.b6(e._.f)}),A(e.a,`pointerup`,function(){e._._._._.b7()}),A(e.a,`pointercancel`,function(){e._._._._.b7()}),A(e.a,`pointerleave`,function(){e._._._._.b7()}),A(e.a,`contextmenu`,function(e){e.preventDefault()})}),Xce=e=>{Jce._(e),Yce(e)},Zce=I(91,L(`v33`,e=>A(e.a,`click`,function(){e._._._._.ae?.send(`\x1B`)})),e=>e._._._._),Qce=L(`v34`,e=>A(e.a,`pointerdown`,function(e){e.preventDefault()})),$ce=O(0,(e=>`<button title=Paste>${e}</button>`)(kce),(e=>` D/${e}&l`)(Ace),qce,`<button title=Escape>esc</button>`,` `,e=>{Zce(e),B(e.a,`_dM`),Qce(e)},`<button> </button>`,` D `,Xce),ele=(e,t)=>$ce(e,t===`paste`?0:t===`esc`?1:2),tle=(e,t)=>{ele(e,t[0]?.kind),nle(e,t[0]?.label),rle(e,t[0]?.seq)},nle=M(4),rle=M(5),ile=k(0,`<!><!><!>`,`b%`,0,tle),ale=(e,t)=>ile(e,[t]),ole=(e,t)=>ale(e,t[0]),e6=I(88,e=>F3(e.a,e._._.a9),e=>e._._),sle=e=>{e6(e),cle(e),t6(e),lle(e),ule(e),dle(e),fle(e),R3(e.a),G3(e.a,`keybar`)},cle=I(89,e=>I3(e.a,e._._.ab),e=>e._._),t6=I(90,e=>W3(e.a,e._._.ac),e=>e._._),n6=N(1,e=>H3(e.a,d8(e))),lle=I(91,n6,e=>e._._),ule=I(92,e=>U3(e.a,e._._.al),e=>e._._),dle=I(93,e=>V3(e.a,f8(e)),e=>e._._),fle=I(94,n6,e=>e._._),r6=P(2,0,e=>F3(e.a,e._.a9)),ple=e=>{r6._(e),mle._(e),i6._(e),hle._(e),gle._(e),_le._(e),vle._(e),R3(e.a),G3(e.a,`overlay`)},mle=P(2,0,e=>I3(e.a,e._.ab)),i6=P(2,0,e=>W3(e.a,e._.ac)),a6=N(1,e=>H3(e.a,p8(e))),hle=P(2,0,a6),gle=P(2,0,e=>U3(e.a,e._.al)),_le=P(2,0,e=>V3(e.a,m8(e))),vle=P(2,0,a6),o6=P(6,0,L(`v23`,e=>{e._.a8&&setTimeout(()=>e.d?.focus(),50)})),yle=L(`v24`,e=>{A(e.a,`click`,function(){n8(e._,!1)}),A(e.b,`click`,function(e){e.stopPropagation()}),A(e.d,`paste`,function(t){t.preventDefault(),e._.bb(t.clipboardData)}),A(e.e,`click`,function(){n8(e._,!1)})}),ble=e=>{o6._(e),B(e.a,`_dk`),B(e.b,`_dl`),B(e.c,`_l`),B(e.e,`_d`),yle(e)},xle=L(`v22`,e=>A(e.b,`click`,function(){K6(e._,!1)})),Sle=e=>{B(e.a,`_dg`),B(e.b,[`_d`,`_e`]),xle(e)},s6=I(85,e=>V(e.c,e._._.a1),e=>e._._),Cle=e=>{s6(e),B(e.a,`_dE`),B(e.b,`_dF`)},wle=L(`v29`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._.s?.(e.d)})),Tle=e=>{B(e.a,tce),e.b,gi(e.b,15),vi(e.b),wle(e)},Ele=M(3,e=>{z(e.a,`title`,`New ${e.d} session`),_i(e.b,e.d)}),Dle=(e,t)=>Ele(e,t[0]),c6=N(1,e=>{B(e.a,[`_dA`,{_dz:e._._._._.g===e._._.d}]),z(e.a,`title`,e._._._._.g===e._._.d?`Really kill this session?`:`Kill session`)}),l6=I(9,c6,e=>e._._._._),Ole=L(`v27`,e=>A(e.a,`click`,function(t,n){e._._._._.g===e._._.d?(E6(e._._._._,null),n.closest(`[popover]`)?.hidePopover(),e._._._._._._.z?.(e._._.d)):E6(e._._._._,e._._.d)})),kle=e=>{l6(e),u6(e),Ole(e)},u6=I(9,c6,e=>e._._),Ale=O(5,(e=>`<button title="Rename session">${e}</button>`)(Gl),(e=>` D/${e}&l`)(Kl),Vce),d6=I(82,e=>Ale(e,+!e._._._._._.y),e=>e._._._._._),jle=L(`v28`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._.d!==e._._._._._.u&&e._._._._._.t?.(e._.d)})),Mle=e=>{d6(e),f6(e),p6._(e),h6._(e),g6._(e),B(e.a,`_dw`),e.c,gi(e.c,14),vi(e.c),B(e.d,`_dx`),jle(e)},Nle=O(6,`<button>×</button>`,` `,kle),f6=I(83,e=>Nle(e,+!e._._._._._.z),e=>e._._._._._),p6=P(0,1,e=>B(e.b,[`_o`,Yt[Hr(e._.g)]])),m6=N(7,e=>V(e.e,e._.i||e._.h)),h6=P(0,1,e=>{_i(e.c,e._.h),m6(e)}),g6=P(0,1,m6),_6=N(4,e=>B(e.a,[`_dv`,{_du:e.d===e._._._._.u}])),v6=I(78,_6,e=>e._._._._),Ple=e=>{v6(e),y6._(e)},Fle=O(0,(e=>`<span></span>${e}<input aria-label="Session name">`)(ui),(e=>` b/${e}& b`)(`b%c`),Uce,(e=>`<button><span></span>${e}<span> </span></button><!><!><!>`)(ui),(e=>` D b/${e}& D m%b%c`)(`b%c`),Mle),y6=Je(0,1,3,e=>Fle(e,e._.b===e.d?0:1)),Ile=F(u6),Lle=M(3,e=>{_6(e),Ile(e)}),Rle=(e,t)=>{Lle(e,t[0]?.id),zle(e,t[0]?.state),Ble(e,t[0]?.agent),Vle(e,t[0]?.title)},zle=M(6,e=>{p6(e),Q3(e)}),Ble=M(7,e=>{h6(e),$3(e)}),Vle=M(8,g6),Hle=k(0,`<div></div>`,` `,Ple,Rle),b6=I(81,e=>Hle(e,[e._._._.x||[],`id`]),e=>e._._._),Ule=M(4),x6=N(3,e=>Ule(e,h8(e)),2),S6=j(1,e=>{x6(e),y6(e)}),Wle=F(Z3),C6=j(2,e=>{x6(e),Wle(e)}),Gle=e=>{b6(e),w6(e),S6(e,null),C6(e,``)},w6=I(82,x6,e=>e._._._),T6=I(79,e=>_i(e.b,e._._.v||`shell`),e=>e._._),E6=j(6,F(l6)),D6=N(8,e=>z(e.a,`popovertarget`,e._._.at?e.h:void 0)),Kle=M(7,e=>{z(e.d,`id`,e.h),D6(e)}),qle=L(`v30`,e=>A(e.d,`toggle`,function(t,n){if(E6(e,null),t.newState===`open`){let t=e.a.getBoundingClientRect();n.style.top=`${Math.max(8,t.top-n.offsetHeight-8)}px`,n.style.left=`${Math.max(8,Math.min(t.left+t.width/2-n.offsetWidth/2,window.innerWidth-n.offsetWidth-8))}px`}})),Jle=e=>{T6(e),O6(e),k6(e),A6(e),j6(e),B(e.a,[T3,`_dr`]),e.b,gi(e.b,16),vi(e.b),B(e.d,`_dt`),E6(e,null),Kle(e,$e(e)),qle(e)},O6=I(80,e=>B(e.c,[`_o`,`_ds`,Yt[Hr(e._._.w)]]),e=>e._._),Yle=O(4,`<!><!><!>`,`b%`,Gle),k6=I(81,e=>{B(e.f,[`_dD`,{_dC:(e._._.x||[]).length<=1}]),Yle(e,(e._._.x||[]).length>1?0:1)},e=>e._._),Xle=k(5,(e=>`<button>${e}</button>`)(ui),(e=>` D/${e}&l`)(`b%c`),Tle,Dle),A6=I(84,e=>Xle(e,[[...e._._.a0||[],`shell`],e=>e]),e=>e._._),Zle=L(`v31`,e=>A(e.a,`click`,!e._._.at&&(()=>{e._._.t?.(e._._.u)}))),j6=I(95,e=>{z(e.a,`title`,e._._.at?`Sessions`:`Back to session`),D6(e),Zle(e)},e=>e._._),Qle=nt(`v21`,19),M6=N(23,e=>B(e.d,[`_do`,{_dp:e._.a9||!!e._.l&&e._.k===`diff`}]),2),N6=N(24,e=>{z(e.o,`title`,e._.ay?`Close find`:e._.aw?e._.k===`diff`?`Find in the review`:`Find in terminal`:`Find unavailable on this page`),z(e.o,`aria-label`,e._.ay?`Close find`:e._.aw?e._.k===`diff`?`Find in the review`:`Find in terminal`:`Find unavailable on this page`)},2),P6=P(7,0,e=>{B(e.e,[T3,{_dG:e._.k===`nav`}]),z(e.e,`aria-pressed`,e._.k===`nav`?`true`:`false`),B(e.g,[T3,{_dG:e._.k===`manage`}]),z(e.g,`aria-pressed`,e._.k===`manage`?`true`:`false`),B(e.i,[T3,{_dG:e._.k===`diff`}]),z(e.i,`title`,e._.k===`diff`?`Back to terminal`:`Review changes`),z(e.i,`aria-pressed`,e._.k===`diff`?`true`:`false`),M6(e),N6(e)}),$le=M(19,e=>z(e.m,`aria-controls`,e.t)),eue=(e,t)=>cue(e,t.open),tue=k(18,`<!><!><!>`,`b%`,0,ole),nue=L(`v38`,e=>{A(e.e,`click`,function(){e._.o?.()}),A(e.g,`click`,function(){e._.p?.()}),A(e.i,`click`,function(){e._.k===`diff`?e._.q?.():e._.r?.()}),A(e.o,`click`,function(){e._.az()}),A(e.q,`pointerdown`,function(e){e.preventDefault()}),A(e.s,`pointerdown`,function(e){e.preventDefault()}),A(e.s,`toggle`,function(t,n){t.newState===`open`&&requestAnimationFrame(()=>{let t=e.m?.getBoundingClientRect();t&&(n.style.bottom=`auto`,n.style.right=`0.5rem`,n.style.left=`auto`,n.style.top=`${Math.max(8,t.top-n.offsetHeight-8)}px`)})})}),rue=e=>{P6._(e),F6._(e),I6._(e),L6._(e),z6._(e),B6._(e),oue._(e),V6._(e),H6._(e),U6._(e),B(e.a,`_dm`),B(e.b,`_dn`),gce(e.f),_ce(e.f,16),vce(e.f),ni(e.h),ri(e.h,16),ii(e.h),Zr(e.j),Qr(e.j,16),$r(e.j),B(e.k,`_dq`),B(e.m,T3),xce(e.n),Sce(e.n,16),Cce(e.n),Zj(e.p),Qj(e.p,16),$j(e.p),Ece(e.r),Dce(e.r,16),Oce(e.r),z(e.s,`id`,Qle(e)),B(e.s,`_dI`),$le(e,$e(e)),eue(e,{open:!1}),tue(e,[zce]),nue(e)},F6=P(7,0,M6),iue=O(10,(e=>`<button>${e}<span></span></button><div popover=auto><!><div></div></div>`)(ui),(e=>` D/${e}& l D%b l`)(`b%c`),Jle),I6=P(7,0,e=>iue(e,+!e._.s)),aue=O(11,`<span aria-hidden=true><span> </span></span>`,` D D `,Cle),L6=P(7,0,e=>aue(e,+!e._.a1)),R6=N(22,e=>z(e.q,`title`,e._.aw?e._.a4?`Hide keyboard`:`Show keyboard`:`Keyboard unavailable on this page`)),z6=P(7,0,e=>{B(e.q,[T3,{_dG:e._.a4}]),R6(e)}),B6=P(7,0,M6),oue=P(7,0,L(`v36`,e=>A(e.q,`click`,function(){Z6(e._,!e._.a4),e._.ae?.setKeyboard(e._.a4)}))),sue=O(2,E3,(e=>`/${e}&`)(D3),sle),V6=P(7,0,e=>sue(e,+!e._.at)),H6=P(7,0,e=>{z(e.m,`title`,e._.aw?`More keys`:`Keys unavailable on this page`),z(e.m,`disabled`,!e._.aw),z(e.o,`disabled`,!e._.aw),z(e.q,`disabled`,!e._.aw),N6(e),R6(e)}),U6=P(7,0,e=>{B(e.o,[T3,{_dG:e._.ay}]),z(e.o,`aria-pressed`,e._.ay?`true`:`false`),N6(e)}),cue=M(21,L(`v37`,e=>{A(e.m,`pointerdown`,function(t){t.preventDefault(),e.v=!!e.s?.matches(`:popover-open`)}),A(e.m,`click`,function(){let t=e.s;t&&(e.v?t.hidePopover():t.showPopover())})})),W6=nt(`v20`,1),lue=tt(69),uue=O(5,`<div><button>Reconnect</button></div>`,` D `,Sle),G6=N(72,L(`v39`,e=>Tt(e,{onMount:function(){let t=new AbortController,n=t.signal,r=new $$({fontSize:13,fontFamily:`ui-monospace, monospace`,scrollback:0,overviewRuler:{width:0},allowProposedApi:!0,rightClickSelectsWord:!0,macOptionClickForcesSelection:!0,theme:{selectionBackground:`#ffb000`,selectionInactiveBackground:`#ffb000`,selectionForeground:`#000000`},linkHandler:{activate(e,t){$n(t)}}}),i=new gse;r.loadAddon(i),r.open(e.b);let a=Xn();try{let e=new pse;e.onContextLoss(()=>e.dispose()),r.loadAddon(e)}catch{}try{r.loadAddon(new Tse(void 0,{readText:()=>navigator.clipboard.readText().catch(()=>``),writeText:(e,t)=>Kh(t).then(()=>{})}))}catch{}r.loadAddon(new Nse((e,t)=>$n(t)));let o=Wse(r,e.b);e.ai=o;let s=r.onScroll(()=>e.an()),c=r.onWriteParsed(()=>e.an());e.b.addEventListener(`wheel`,()=>e.an(),{passive:!0,signal:n}),C3(r,i);let l=$se(r),u=ece(r,W6(e));n.addEventListener(`abort`,()=>{s.dispose(),c.dispose(),l.dispose(),u.dispose(),e.ap(),o.dispose(),e.ai=null});let d=a?Ise(r):null,f=d?d.write:e=>r.write(e),p=Pse({sessionId:e.u,term:r,write:f,onDead:()=>{K6(e,!0)},isVisible:()=>!!e.a2},n),m={on:!1},h=e=>e.startsWith(`\x1B[<`)||e.startsWith(`\x1B[M`)||e.startsWith(`\x1B[>`);r.onData(e=>{m.on&&!h(e)||p.send(e)}),r.attachCustomKeyEventHandler(t=>m.on?!1:t.key===`Enter`&&t.shiftKey?(t.type===`keydown`&&p.send(`\x1B\r`),!1):(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()===`c`&&r.hasSelection()?(t.type===`keydown`&&Kh(r.getSelection()).then(t=>{t&&(r.clearSelection(),e.b2())}),!1):!((t.ctrlKey||t.metaKey)&&!t.shiftKey&&!t.altKey&&t.key.toLowerCase()===`f`||a&&t.type===`keydown`&&t.key===`Backspace`));let g=()=>{if(!e.b.clientWidth)return;let t=r.cols,n=r.rows;C3(r,i),(r.cols!==t||r.rows!==n)&&p.resize(r.cols,r.rows),w3(r,e.b),e.an()},_=new ResizeObserver(g);_.observe(e.b),n.addEventListener(`abort`,()=>_.disconnect());let v=()=>requestAnimationFrame(g);if(document.addEventListener(`visibilitychange`,()=>{document.hidden||v()},{signal:n}),window.addEventListener(`pageshow`,v,{signal:n}),window.addEventListener(`focus`,v,{signal:n}),window.visualViewport?.addEventListener(`resize`,v,{signal:n}),window.addEventListener(`keydown`,t=>{e.a2&&(e.k==null||e.k===`term`)&&(t.metaKey||t.ctrlKey)&&!t.shiftKey&&!t.altKey&&t.key.toLowerCase()===`f`&&(t.preventDefault(),t.stopPropagation(),e.aq())},{capture:!0,signal:n}),e.b.addEventListener(`paste`,t=>{let n=[...t.clipboardData?.files||[]];if(n.length){t.preventDefault(),t.stopImmediatePropagation();for(let t of n)e.b8(t)}},{capture:!0,signal:n}),e.ae={send(e){m.on||p.send(e)},setKeyboard(e){if(m.on&&e)return;let t=r.textarea;t&&(t.inputMode=e?`text`:`none`,e?(t.focus(),setTimeout(()=>{document.activeElement!==t&&t.focus()},50)):t.blur())},setFindMode(e){m.on=e;let t=r.textarea;t&&(e?(t.inputMode=`none`,t.readOnly=!0,t.blur()):(t.readOnly=!1,a||(t.inputMode=`text`)))}},a){r.textarea&&(r.textarea.inputMode=`none`);let t=window.visualViewport;if(t){let i=0,a=()=>{i=Math.max(i,t.height),e.a4&&i-t.height<Rce&&(Z6(e,!1),r.textarea&&(r.textarea.inputMode=`none`))};a(),t.addEventListener(`resize`,a,{signal:n}),window.addEventListener(`orientationchange`,()=>{i=0},{signal:n})}let i=Vse(r,W6(e),{onStart(){d?.setFrozen(!0)},onEnd(){d?.setFrozen(!1)},onCopy(){e.b2()}},n);Fse(r,W6(e),n,i.selecting),Lse(r,e=>{m.on||p.send(e)},n)}else Use(r,W6(e),()=>e.b2(),n);e.a2&&!a&&r.focus();let y={term:r,socket:p,abort:t,suspend:void 0};return e.a2||(y.suspend=setTimeout(()=>p.disconnect(),X3)),y},onUpdate:function(){clearTimeout(this.suspend),this.socket.syncVisibility(),e.a2?(!e.a3&&this.socket.readyState>=WebSocket.CLOSING&&(this.term.reset(),this.socket.reconnect()),!e.a3&&!e.a5&&this.term.focus()):this.suspend=setTimeout(()=>this.socket.disconnect(),X3)},onDestroy:function(){clearTimeout(this.suspend),this.abort.abort(),this.term.dispose()}})),12),K6=j(29,e=>{uue(e,+!e.a3),G6(e)}),due=M(61),q6=N(59,e=>due(e,g8(e)),4),fue=M(54,q6),J6=N(53,e=>fue(e,_8(e)),3),pue=M(52,e=>{J6(e),G6(e)}),Y6=N(48,e=>pue(e,v8(e)),3),X6=N(57,L(`v40`,e=>{e.at||(e.a9&&(i8(e,!1),e.ap(),e.ae?.setFindMode(!1)),e.a4&&(Z6(e,!1),e.ae?.setKeyboard(!1)))}),4),Z6=j(30,e=>{Y6(e),X6(e),G6(e),z6(e)}),mue=O(7,((e,t,n,r,i,a)=>`<div><div><!><div><button title=Workspaces>${e}</button><button title="Manage workspace">${t}</button><button>${n}</button><div></div><!><button aria-haspopup=dialog>${r}</button><button>${i}</button><button>${a}</button></div><div popover=auto></div></div></div>`)(mce,ei,Yr,yce,Yj,wce),((e,t,n,r,i,a)=>` D D%b D D/${e}&l D/${t}&l D/${n}&l b%b D/${r}&l D/${i}&l D/${a}&m m`)(hce,ti,Xr,bce,Xj,Tce),rue),hue=O(2,E3,(e=>`/${e}&`)(D3),ple),Q6=N(36,e=>hue(e,!e.a5&&e.a9?0:1)),$6=j(31,e=>{mue(e,+!e.a5),Q6(e),G6(e)}),gue=O(3,`<div>uploading…</div>`,` `,Gce),e8=j(32,e=>gue(e,+!e.a6)),_ue=O(4,`<div>Copied</div>`,` `,Wce),t8=j(33,e=>_ue(e,+!e.a7)),vue=O(6,`<div><div><p>Long-press below and choose Paste</p><input placeholder="Paste here…"><button>Cancel</button></div></div>`,` D D b b `,ble),n8=j(34,e=>{vue(e,+!e.a8),o6(e)}),yue=M(60,U6),r8=N(56,e=>yue(e,e.at?e.a9:e.k===`diff`&&!!e.l),3),bue=F(e6),i8=j(35,e=>{J6(e),r8(e),X6(e),Q6(e),B6(e),r6(e),bue(e)}),xue=M(37),Sue=F(t6),a8=j(38,e=>{Y6(e),i6(e),Sue(e)}),Cue=(e,t)=>Pue(e,t.current),wue=(e,t)=>{Rue(e,t.query),zue(e,t.overlay),Bue(e,t.refreshTimer)},Tue=M(47,Y6),Eue=(e,t)=>Yue(e,t.timer),Due=(e,t)=>Zue(e,t.current),Oue=L(`v41`,e=>{$6(e,Xn()),A(e.a,`dragover`,function(e){e.preventDefault()}),A(e.a,`drop`,function(t){t.preventDefault();for(let n of t.dataTransfer?.files||[])e.b8(n)})});function kue(e){B(e.a,`_da`),B(e.b,`_db`),K6(e,!1),Z6(e,!1),$6(e,!1),e8(e,!1),t8(e,!1),n8(e,!1),i8(e,!1),xue(e,y8(e)),a8(e,0),Cue(e,{current:null}),wue(e,{overlay:null,query:``,refreshTimer:0}),Tue(e,{focus:b8}),Eue(e,{timer:0}),Due(e,{current:null}),Oue(e)}var Aue=M(68),o8=N(67,e=>Aue(e,x8(e))),jue=M(73),Mue=M(74),s8=N(71,e=>{jue(e,S8(e)),Mue(e,C8(e))}),Nue=M(70,e=>{s8(e),G6(e)}),c8=N(41,e=>Nue(e,w8(e))),Pue=M(40,e=>{Y6(e),J6(e),o8(e),c8(e),s8(e),X6(e),G6(e)}),Fue=M(49,G6),Iue=M(50),Lue=M(51,e=>{J6(e),X6(e),G6(e)}),l8=N(46,e=>{Fue(e,T8(e)),Iue(e,E8(e)),Lue(e,D8(e))},2),Rue=M(43,l8),zue=M(44,e=>{l8(e),G6(e)}),Bue=M(45,l8),Vue=F(j6),Hue=M(55,e=>{z(e.a,`hidden`,!e.at),r8(e),q6(e),X6(e),V6(e),Vue(e)}),Uue=M(58,e=>{q6(e),H6(e)}),Wue=e=>{Uue(e,e.at||e.k===`diff`)},Gue=M(10,e=>{Hue(e,e.k==null||e.k===`term`),Wue(e),r8(e),q6(e),G6(e),P6(e)}),Kue=M(11,e=>{r8(e),F6(e)}),que=M(12,q6),Jue=M(64,G6),Yue=M(63,e=>Jue(e,O8(e))),Xue=M(69),Zue=M(66,e=>{Xue(e,k8(e)),o8(e)}),Que=M(13,c8),$ue=F(v6),ede=M(20,e=>{G6(e),$ue(e)}),tde=M(28,G6),nde=M(14),rde=M(15),ide=M(16),ade=M(17),ode=M(18,I6),sde=M(19),cde=M(21,F(T6)),lde=M(22,F(O6)),ude=M(23,F(k6,b6)),dde=M(24,F(w6,d6)),fde=M(25,F(f6)),pde=M(26,F(A6)),mde=F(s6),hde=M(27,e=>{L6(e),mde(e)});function u8(e){return t=>{C6(e._._,t)}}function d8(e){return function(){e._._.ap(),e._._.ae?.setFindMode(!1)}}function f8(e){return function(t,n){e._._.ao(t,n)}}function p8(e){return function(){e._.ap(),e._.ae?.setFindMode(!1)}}function m8(e){return function(t,n){e._.ao(t,n)}}function h8(e){return t=>{if(e.b!==t)return;let n=e.c.trim();S6(e,null),n&&e._._._.y?.(t,n)}}function g8(e){return()=>{if(e.aw){if(e.at){e.as();return}e.k===`diff`&&e.m?.()}}}function _8(e){return()=>{if(e.a9){i8(e,!1),e.ap(),e.ae?.setFindMode(!1);return}e.aq()}}function v8(e){return()=>{e.a4&&(Z6(e,!1),e.ae?.setKeyboard(!1)),e.ae?.setFindMode(!0),i8(e,!0),a8(e,e.ac+1),e.al.focus()}}function y8(e){return t=>{i8(e,t)}}function b8(){}function x8(e){return t=>{lue(e)(),e.ae?.send(t);let n={};n.delay=setTimeout(()=>{n.repeat=setInterval(()=>e.ae?.send(t),Lce)},Ice),e.b4=n}}function S8(e){return async t=>{let n=[...t?.files||[]];for(let t of n)await e.b8(t);if(!n.length){let n=t?.getData(`text/plain`);n&&e.ae?.send(n)}n8(e,!1)}}function C8(e){return async()=>{if(!navigator.clipboard?.read){n8(e,!0);return}try{for(let t of await navigator.clipboard.read()){let n=t.types.find(e=>e.startsWith(`image/`));if(n){let r=await t.getType(n);await e.b8(new File([r],`pasted.${n.split(`/`)[1]||`png`}`,{type:n}))}else if(t.types.includes(`text/plain`)){let n=await(await t.getType(`text/plain`)).text();n&&e.ae?.send(n)}}}catch{n8(e,!0)}}}function w8(e){return async t=>{if(t){e8(e,!0);try{let n=await(await fetch(`/api/workspaces/${e.n}/assets?name=${encodeURIComponent(t.name||`pasted.png`)}`,{method:`POST`,body:t})).json();n.path&&e.ae?.send(`${n.path} `)}finally{e8(e,!1)}}}}function T8(e){return()=>{!e.ah.trim()||!e.ai||(e.aj&&clearTimeout(e.aj),e.aj=setTimeout(()=>{e.aj=0,e.ai?.refresh()},32))}}function E8(e){return(t,n)=>{let r=e.ai;if(r){if(e.ah=t,e.aj&&=(clearTimeout(e.aj),0),!t.trim()){r.clear();return}r.search(t,n)}}}function D8(e){return()=>{e.aj&&=(clearTimeout(e.aj),0),e.ah=``,e.ai?.clear()}}function O8(e){return()=>{clearTimeout(e.b1),t8(e,!0),e.b1=setTimeout(()=>{t8(e,!1)},1200)}}function k8(e){return()=>{let t=e.b4;t&&(clearTimeout(t.delay),clearInterval(t.repeat),e.b4=null)}}R(`v0`,u8),R(`v18`,d8),R(`v17`,f8),R(`v16`,p8),R(`v15`,m8),R(`v19`,h8),R(`v8`,g8),R(`v7`,_8),R(`v6`,v8),R(`v1`,y8),R(`v2`,b8),R(`v10`,x8),R(`v13`,S8),R(`v14`,C8),R(`v12`,w8),R(`v3`,T8),R(`v4`,E8),R(`v5`,D8),R(`v9`,O8),R(`v11`,k8);var gde=(e=>`<div><div>${e}</div><div><!><!><!><!><!><div></div></div></div>`)(Up),_de=(e=>` D D/${e}&l D%b%b%b%b%b m`)(Wp),vde=e=>B(e.a,`_bK`),A8=I(101,e=>V(e.a,e._._.ag),e=>e._._),yde=ft(`y46`,` `,` `,A8),bde=e=>{Or(e.a),Mr(e.a,yde(e)),Ir(e.a,Z5(e)),Fr(e.a),Tr(e.a),br(e.a),wr(e.a),Ar(e.a),Dr(e.a,{})},xde=de(3,0,2),j8=P(7,0,e=>xde(e,e._.a3===`usage`)),Sde=e=>{j8._(e),uK(e.b)},M8=N(4,e=>V(e.d,e._._.ah?`Starting…`:`Start ${e._._.r||`claude`}`)),N8=I(89,M8,e=>e._._),Cde=L(`y47`,e=>A(e.c,`click`,function(){e._._.bc(e._._.r||`claude`,!0)})),wde=e=>{N8(e),P8(e),B(e.a,`_bL`),B(e.b,`_l`),B(e.c,[`_d`,`_e`]),Cde(e)},P8=I(102,e=>{z(e.c,`disabled`,e._._.ah),M8(e)},e=>e._._),F8=N(8,e=>tde(e.b,e._._.o&&e._._.a3===`term`&&e.g===e._._.b4),3),I8=I(88,F8,e=>e._._),Tde=e=>{I8(e),L8(e),R8(e),z8(e),V8(e),H8(e),U8(e),G8(e),K8(e),q8(e),J8(e),Y8(e),kue(e.b),sde(e.b,n7(e)),ade(e.b,t7(e)),ide(e.b,e7(e)),nde(e.b,$5(e)),rde(e.b,Q5(e))},L8=I(92,e=>pde(e.b,e._._.u),e=>e._._),R8=I(95,e=>{Gue(e.b,e._._.a3),F8(e)},e=>e._._),z8=I(96,e=>Kue(e.b,e._._.a9),e=>e._._),B8=N(11,e=>ode(e.b,r7(e))),V8=I(104,e=>{Que(e.b,e._._.aj),B8(e)},e=>e._._),H8=I(106,e=>hde(e.b,e._._.ap),e=>e._._),U8=I(107,e=>ude(e.b,e._._.b1),e=>e._._),Ede=de(3,0,2),W8=N(7,e=>Ede(e,e.g===e._._.b4)),G8=I(109,e=>{F8(e),W8(e)},e=>e._._),K8=I(110,e=>que(e.b,i7(e)),e=>e._._),q8=I(112,e=>fde(e.b,a7(e)),e=>e._._),J8=I(113,e=>dde(e.b,o7(e)),e=>e._._),Y8=I(114,B8,e=>e._._),Dde=M(6,e=>{ede(e.b,e.g),F8(e),W8(e)}),Ode=(e,t)=>lde(e.b,t),kde=(e,t)=>cde(e.b,t),Ade=k(0,(e=>`<!><!>${e}<!><!><!>`)(Pce),(e=>`b%b/${e}&%b%c`)(Fce),Tde,(e,t)=>{Dde(e,t[0]?.id),Ode(e,t[0]?.state),kde(e,t[0]?.agent)}),X8=P(9,0,e=>Ade(e,[e._.b1,`id`])),jde=e=>{X8._(e),Z8._(e)},Mde=O(1,`<div><p>No sessions in this workspace.</p><button> </button></div>`,` D b D `,wde),Z8=P(9,0,e=>Mde(e,+!!e._.b3)),Q8=N(4,e=>_l(e.b,s7(e)),2),$8=P(8,0,Q8),Nde=e=>{$8._(e),e5._(e),t5._(e),n5._(e),r5._(e),i5._(e),ol(e.b),bl(e.b,c7(e))},e5=P(8,0,e=>ml(e.b,e._.t||[])),t5=P(8,0,Q8),n5=P(8,0,e=>vl(e.b,l7(e))),Pde=de(3,0,2),r5=P(8,0,e=>Pde(e,e._.a3===`new`)),i5=P(8,0,Q8),a5=P(6,0,e=>XW(e.b,u7(e))),Fde=e=>{a5._(e),o5._(e),s5._(e),CW(e.b),ZW(e.b,d7(e))},Ide=de(3,0,2),o5=P(6,0,e=>Ide(e,e._.a3===`manage`)),s5=P(6,0,e=>YW(e.b,e._.ai)),c5=N(4,e=>GV(e.b,e._.o&&e._.a3===`diff`)),l5=P(5,0,c5),Lde=e=>{l5._(e),u5._(e),d5._(e),f5._(e),zde._(e),p5._(e),m5._(e),h5._(e),g5._(e),_5._(e),sV(e.b),mV(e.b,m7(e)),nH(e.b,p7(e)),iH(e.b,f7(e))},Rde=de(3,0,2),u5=P(5,0,e=>{Rde(e,e._.a3===`diff`),c5(e)}),d5=P(5,0,e=>pV(e.b,e._.a9)),f5=P(5,0,e=>xV(e.b,e._.ab)),zde=P(5,0,e=>CV(e.b,e._.ac)),p5=P(5,0,e=>UV(e.b,e._.ae)),m5=P(5,0,e=>KV(e.b,e._.af)),h5=P(5,0,e=>HV(e.b,e._.aj)),g5=P(5,0,e=>sH(e.b,e._.ao)),_5=P(5,0,e=>oH(e.b,e._.b1||[])),Bde=F(J8),Vde=M(85,e=>{Pne(e.c,h7(e)),Bde(e)}),Hde=O(9,`<!><!><!><!>`,`b%b%`,jde,`<p>Loading sessions…</p>`,` `,vde),Ude=F(G8),Wde=M(66,e=>{Zte(e.c,e.b4),Ude(e)}),v5=N(64,e=>Wde(e,(()=>{if(e.a1&&e.b1?.some(t=>t.id===e.a1))return e.a1;let t=Bn(e.aj);return t&&e.b1?.some(e=>e.id===t)?t:e.b1?.[0]?.id??null})()),2),Gde=F(U8),Kde=M(63,e=>{jne(e.c,e.b1),Dfe(e,e.b1?.length),Hde(e,+!e.b1),v5(e),_5(e),X8(e),Gde(e)}),y5=N(48,e=>Kde(e,e.a0??e.n?.[e.aj]?.sessions??null),2),b5=N(83,L(`y49`,e=>Tt(e,{active:e.o,load:e.bk,onMount:function(){let t=new AbortController,n=t.signal,r={abort:t,started:!1,stale:!1,timer:void 0,refresh:()=>{if(document.hidden){r.stale=!0;return}r.stale=!1,this.load(!1)},applySessions:t=>{D5(e,t);let n=Bn(e.aj);n&&t.some(e=>e.id===n)&&k5(e,n),t.some(t=>t.id===e.a1)||k5(e,t[0]?.id||null),r.stale=!1},mergeStatus:t=>{let n=t?.[e.aj]?.sessions;if(!n||!e.a0)return;let r=new Map(n.map(e=>[e.id,e.state]));D5(e,e.a0.map(e=>{let t=r.get(e.id);return t?{...e,state:t}:e}))},syncPoll:()=>{if(!this.active||fn()){r.stop();return}r.timer??=setInterval(r.refresh,15e3)},sync:()=>{this.active?(r.started||(r.started=!0,this.load(!0)),r.syncPoll()):r.stop()},stop:()=>{clearInterval(r.timer),r.timer=void 0}};return xn().addEventListener(`sessions.changed`,t=>{if(!r.started)return;let n=t.data;if(!(n?.workspaceId&&n.workspaceId!==e.aj)){if(Array.isArray(n?.sessions)){r.applySessions(n.sessions);return}r.refresh()}},{signal:n}),xn().addEventListener(`status.changed`,e=>{r.started&&r.mergeStatus(e.data)},{signal:n}),xn().addEventListener(`sse.health`,()=>{r.syncPoll()},{signal:n}),document.addEventListener(`visibilitychange`,()=>{!document.hidden&&r.stale&&r.refresh()},{signal:n}),En(()=>{if(!this.active)return;let t=On(e.aj);t&&e.aq(t.pr),Mn(e.aj)&&e.as();let n=An(e.aj);n&&(k5(e,n),R5(e,`term`))},n),r.sync(),r},onUpdate:function(){this.sync()},onDestroy:function(){this.abort.abort(),this.stop()}})),6),qde=M(82,b5),x5=N(81,e=>qde(e,_7(e)),2),Jde=M(80,x5),S5=N(78,e=>Jde(e,v7(e)),6),C5=N(87,e=>Dne(e.c,y7(e))),Yde=F(Y8),Xde=M(86,e=>{C5(e),Yde(e)}),w5=N(75,e=>Xde(e,b7(e)),2),Zde=M(74,e=>{S5(e),w5(e)}),T5=N(46,e=>Zde(e,x7(e))),Qde=M(84,F(q8)),E5=N(28,e=>Qde(e,S7(e))),D5=j(26,e=>{Vde(e,g7(e)),y5(e),T5(e),S5(e),E5(e),b5(e)}),O5=N(47,L(`y50`,e=>{e.a1&&Vn(e.aj,e.a1)})),k5=j(27,e=>{v5(e),S5(e),E5(e),O5(e),b5(e)}),$de=M(60),A5=N(72,e=>Sne(e.c,w7(e))),j5=N(73,e=>kne(e.c,T7(e))),efe=M(71,e=>{A5(e),C5(e),j5(e),i5(e)}),tfe=M(59),M5=N(58,e=>tfe(e,D7(e))),nfe=M(61),N5=N(55,e=>nfe(e,O7(e))),rfe=M(62),P5=N(53,e=>rfe(e,k7(e))),F5=N(30,L(`y54`,e=>{!e.o&&(e.a3===`nav`||e.a3===`manage`||e.a3===`usage`||e.a3===`new`)&&R5(e,`term`)})),I5=N(36,L(`y53`,e=>{e.a3!==`diff`&&e.a9&&W5(e,!1)})),L5=N(69,L(`y52`,e=>{e.o&&e.p&&!e.b6&&(e.b6=!0,H5(e,!0),R5(e,`new`)),e.p?e.b6&&e.a3!==`new`&&(e.b6=!1,e.q?.()):(e.b6=!1,e.a3===`new`&&R5(e,`term`))}),4),ife=F(R8),R5=j(29,e=>{B(e.a,[`_bF`,{_bE:e.a3===`nav`}]),one(e.c,e.a3),B(e.j,[`_bJ`,{_bI:e.a3!==`term`}]),$de(e,C7(e)),efe(e,E7(e)),M5(e),N5(e),P5(e),F5(e),I5(e),L5(e),u5(e),o5(e),r5(e),ife(e),j8(e)}),afe=O(5,(e=>`<!><!>${e}<!><!><!>`)(yP),(e=>`b%b/${e}&%b%c`)(bP),Lde),z5=j(31,e=>afe(e,+!e.a5)),ofe=O(6,(e=>`<!><!>${e}<!><!><!>`)(JH),(e=>`b%b/${e}&%b%c`)(YH),Fde),B5=j(32,e=>ofe(e,+!e.a6)),sfe=O(7,(e=>`<!><!>${e}<!><!><!>`)(mG),(e=>`b%b/${e}&%b%c`)(hG),Sde),V5=j(33,e=>sfe(e,+!e.a7)),cfe=O(8,(e=>`<!><!>${e}<!><!><!>`)(ic),(e=>`b%b/${e}&%b%c`)(ac),Nde),H5=j(34,e=>cfe(e,+!e.a8)),lfe=M(70,F(K8)),U5=N(39,e=>lfe(e,A7(e)),2),ufe=F(z8),W5=j(35,e=>{I5(e),U5(e),d5(e),ufe(e)}),G5=j(37,e=>{U5(e),f5(e)}),dfe=M(38,U5),K5=j(40,p5),q5=N(56,L(`y51`,e=>{if(e.o){let t=On(e.aj);t&&e.aq(t.pr),Mn(e.aj)&&e.as();let n=An(e.aj);n&&(k5(e,n),R5(e,`term`))}}),3),ffe=M(52,e=>{P5(e),q5(e),b5(e),j5(e)}),J5=j(41,e=>{ffe(e,M7(e)),m5(e)}),pfe=O(4,tr,(e=>`/${e}&`)(nr),bde),mfe=F(A8),Y5=j(42,e=>{pfe(e,+!e.ag),mfe(e)}),X5=j(43,F(P8)),hfe=M(54,e=>{N5(e),q5(e),b5(e)}),gfe=M(57,M5),_fe=(e,t)=>kfe(e,t.open),vfe=(e,t)=>{Ffe(e,t.wanted),Ife(e,t.run)};function yfe(e){B(e.b,`_bG`),fne(e.c),Qte(e.c,V7(e)),sne(e.c,B7(e)),pne(e.c,z7(e)),Mne(e.c,R7(e)),Lne(e.c,L7(e)),bne(e.c,I7(e)),Ine(e.c,F7(e)),B(e.d,`_bH`),D5(e,null),k5(e,null),R5(e,`term`),z5(e,!1),B5(e,!1),V5(e,!1),H5(e,!1),W5(e,!1),G5(e,0),dfe(e,{focus:j7}),K5(e,``),J5(e,0),Y5(e,null),X5(e,!1),hfe(e,N7(e)),gfe(e,P7(e)),_fe(e,{open:!1}),vfe(e,{wanted:!1,run:void 0})}var bfe=M(44,e=>{Yte(e.c,e.ai),Sfe(e,e.ai?.id),Cfe(e,e.ai?.status),wfe(e,e.ai?.branch),Tfe(e,e.ai?.name),s5(e)}),xfe=F(V8),Sfe=M(45,e=>{Cne(e.c,H7(e)),y5(e),v5(e),q5(e),T5(e),S5(e),O5(e),w5(e),b5(e),h5(e),xfe(e)}),Cfe=M(49,S5),wfe=M(50,g5),Tfe=M(51,F(H8)),Efe=bfe,Dfe=M(65,Z8),Ofe=M(13,e=>{vne(e.c,e.n),y5(e)}),kfe=M(68,L5),Afe=F(I8),jfe=L(`y48`,e=>A(e.a,`keydown`,e.o&&(t=>{if(t.key===`Escape`&&e.a3===`nav`&&!document.querySelector(`dialog[open]`)&&R5(e,`term`),(t.metaKey||t.ctrlKey)&&t.shiftKey&&t.key.toLowerCase()===`d`&&(t.preventDefault(),e.b0()),t.altKey&&(t.key===`[`||t.key===`]`)&&(e.b1?.length??0)>1){t.preventDefault();let n=e.b1.map(e=>e.id);k5(e,n[(Math.max(0,n.indexOf(e.b4))+(t.key===`]`?1:n.length-1))%n.length]),R5(e,`term`)}}))),Mfe=M(14,e=>{mne(e.c,e.o),F5(e),L5(e),q5(e),b5(e),l5(e),Afe(e),jfe(e)}),Nfe=M(15,L5),Pfe=M(16,L5),Ffe=M(77,e=>{S5(e),x5(e)}),Ife=M(79,x5),Lfe=F(N8),Rfe=M(17,e=>{S5(e),Lfe(e)}),zfe=M(18,e=>{w5(e),A5(e),$8(e)}),Bfe=M(19,e=>{hne(e.c,e.t),e5(e)}),Vfe=F(L8),Hfe=M(20,e=>{Tne(e.c,e.u),Vfe(e)}),Ufe=M(21),Wfe=M(22),Gfe=M(23),Kfe=M(24,e=>{a5(e),t5(e)}),qfe=M(25,n5);function Z5(e){return function(){Y5(e._,null)}}function Q5(e){return function(){e._._.az()}}function $5(e){return function(){e._._.ay()}}function e7(e){return function(){R5(e._._,`term`)}}function t7(e){return function(){e._._.b0()}}function n7(e){return function(t){k5(e._._,t),R5(e._._,`term`)}}function r7(e){return function(t){R5(e._._,`term`),e._._.bo(e._._.aj,t)}}function i7(e){return function(){e._._.b8()}}function a7(e){return function(t){e._._.bm(t)}}function o7(e){return function(t,n){e._._.bn(t,n)}}function s7(e){return function(t){e._.y?.(t),e._.s?.(t.id),e._.b9()}}function c7(e){return function(){e._.b9()}}function l7(e){return function(t){e._.z?.(t)}}function u7(e){return function(t){e._.y?.(t)}}function d7(e){return function(){R5(e._,`term`)}}function f7(e){return function(){R5(e._,`term`)}}function p7(e){return function(t){k5(e._,t),R5(e._,`term`)}}function m7(e){return t=>{W5(e._,t)}}function h7(e){return function(t,n){e.bn(t.id,n)}}function g7(e){return async(t,n)=>{n=n.trim(),n&&(D5(e,(e.a0||[]).map(e=>e.id===t?{...e,title:n}:e)),await fetch(`/api/sessions/${t}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({title:n})}))}}function _7(e){return t=>(t&&(e.bf=!0),(e.bh??=Nn(e.bi))())}function v7(e){return async()=>{let t=e.bf;e.bf=!1;try{let n=`/api/workspaces/${e.aj}/sessions`,r=await H(n);!r.length&&t&&e.an===`active`&&(r=await H(n)),!r.length&&t&&e.an===`active`&&(await e.bc(e.r||`claude`,!1),r=await H(n).catch(()=>e.a0||[])),D5(e,r);let i=Bn(e.aj);i&&r.some(e=>e.id===i)&&k5(e,i),e.a0.some(t=>t.id===e.a1)||k5(e,e.a0?.[0]?.id||null)}catch(t){if(D5(e,e.a0||[]),Xt(t))return;Y5(e,String(t.message||t))}}}function y7(e){return function(t,n){e.b9(),e.bo(t,n)}}function b7(e){return async(t,n)=>{if(t===e.aj){let r=await e.bc(n,!0);r&&Vn(t,r.id);return}try{Vn(t,(await H(`/api/workspaces/${t}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:n})})).id),e.s?.(t)}catch(t){Y5(e,String(t.message||t))}}}function x7(e){return async(t,n)=>{X5(e,!0);try{let r=await H(`/api/workspaces/${e.aj}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:t})});if(n){let t=e.a0||[];D5(e,t.some(e=>e.id===r.id)?t:t.concat(r)),k5(e,r.id)}return r}catch(t){return Y5(e,String(t.message||t)),null}finally{X5(e,!1)}}}function S7(e){return async t=>{try{await H(`/api/sessions/${t}`,{method:`DELETE`}),D5(e,(e.a0||[]).filter(e=>e.id!==t)),e.a1===t&&k5(e,e.a0?.[0]?.id||null)}catch(t){Y5(e,`Kill session failed: ${String(t.message||t)}`)}}}function C7(e){return()=>{R5(e,e.a3===`nav`?`term`:`nav`)}}function w7(e){return function(t){e.b9(),e.s?.(t)}}function T7(e){return function(t){e.b9(),e.aq(t)}}function E7(e){return()=>{e.a3===`new`&&R5(e,`term`)}}function D7(e){return()=>{e.a3===`usage`?R5(e,`term`):e.av()}}function O7(e){return()=>{e.a3===`manage`?R5(e,`term`):e.as()}}function k7(e){return()=>{e.a3===`diff`?R5(e,`term`):e.aq()}}function A7(e){return()=>{if(e.a9){W5(e,!1);return}W5(e,!0),G5(e,e.ab+1),e.ac.focus()}}function j7(){}function M7(e){return t=>{K5(e,t||``),t&&J5(e,e.af+1),z5(e,!0),R5(e,`diff`)}}function N7(e){return()=>{B5(e,!0),R5(e,`manage`)}}function P7(e){return()=>{V5(e,!0),R5(e,`usage`)}}function F7(e){return function(t){e.bm(t)}}function I7(e){return function(){e.b9(),e.ax()}}function L7(e){return function(){e.a3===`new`?e.b9():e.x?.()}}function R7(e){return function(t,n){e.b9(),e.v?.(t,n)}}function z7(e){return function(t){Y5(e,t)}}function B7(e){return t=>{R5(e,t)}}function V7(e){return function(t){k5(e,t)}}function H7(e){return function(t){e.b9(),!t||t===e.aj?e.az():e.w?.(t)}}R(`y28`,Z5),R(`y44`,Q5),R(`y43`,$5),R(`y42`,e7),R(`y41`,t7),R(`y38`,n7),R(`y37`,r7),R(`y45`,i7),R(`y39`,a7),R(`y40`,o7),R(`y36`,s7),R(`y34`,c7),R(`y35`,l7),R(`y32`,u7),R(`y33`,d7),R(`y31`,f7),R(`y30`,p7),R(`y29`,m7),R(`y26`,h7),R(`y14`,g7),R(`y12`,_7),R(`y11`,v7),R(`y24`,y7),R(`y15`,b7),R(`y10`,x7),R(`y13`,S7),R(`y5`,C7),R(`y19`,w7),R(`y27`,T7),R(`y9`,E7),R(`y4`,D7),R(`y6`,O7),R(`y7`,k7),R(`y8`,A7),R(`y0`,j7),R(`y1`,M7),R(`y2`,N7),R(`y3`,P7),R(`y25`,F7),R(`y23`,I7),R(`y22`,L7),R(`y20`,R7),R(`y18`,z7),R(`y17`,B7),R(`y16`,V7),R(`y21`,H7);var U7=I(47,e=>V(e.a,e._._.a0),e=>e._._),Jfe=ft(`n23`,` `,` `,U7),Yfe=e=>{Or(e.a),Mr(e.a,Jfe(e)),Ir(e.a,M9(e)),Fr(e.a),Tr(e.a),br(e.a),wr(e.a),Ar(e.a),Dr(e.a,{})},W7=N(4,e=>Kfe(e.b,N9(e))),G7=N(5,e=>qfe(e.b,P9(e))),K7=I(41,e=>{Bfe(e.b,e._._.o),W7(e),G7(e)},e=>e._._),Xfe=e=>{K7(e),q7(e),J7(e),Z7(e),Q7(e),$7(e),e9(e),t9._(e),n9._(e),yfe(e.b),Ufe(e.b,L9(e)),Gfe(e.b,I9(e)),Pfe(e.b,F9(e))},q7=I(42,e=>Ofe(e.b,e._._.p),e=>e._._),J7=I(43,e=>{Rfe(e.b,e._._.q?e._._.q?.preferredAgent:`claude`),Hfe(e.b,e._._.q?e._._.q?.agents:[`claude`])},e=>e._._),Zfe=de(3,0,2),Y7=N(6,e=>{Mfe(e.b,e._.f===e._._.s),Zfe(e,e._.f===e._._.s)}),X7=N(7,e=>Nfe(e.b,e._._.x&&e._.f===e._._.s),2),Z7=I(44,e=>{Y7(e),X7(e)},e=>e._._),Q7=I(45,X7,e=>e._._),$7=I(48,W7,e=>e._._),e9=I(49,e=>{zfe(e.b,R9(e)),G7(e)},e=>e._._),t9=P(0,0,e=>Efe(e.b,e._.e)),n9=P(0,0,e=>{Wfe(e.b,z9(e)),Y7(e),X7(e)}),Qfe=O(0,(e=>`<!><!>${e}<!><!><!>`)(gde),(e=>`b%b/${e}&%b%c`)(_de),Xfe),$fe=M(4,e=>{tpe(e,e.e?.id),Qfe(e,+!e.e),t9(e)}),r9=N(3,e=>$fe(e,e._.o.find(t=>t.id===e.c))),i9=qe(4,r9),epe=i9,tpe=M(5,n9),npe=M(2,r9),rpe=(e,t)=>npe(e,t[0]),a9=N(1,e=>vl(e.a,B9(e))),o9=N(2,e=>_l(e.a,V9(e)),2),s9=P(3,0,e=>{ml(e.a,e._.o),a9(e),o9(e)}),ipe=e=>{s9._(e),c9._(e),l9._(e),ol(e.a),bl(e.a,H9(e))},c9=P(3,0,o9),l9=P(3,0,e=>{a9(e),o9(e)}),u9=P(2,0,e=>bo(e.a,e._.o)),ape=e=>{u9._(e),d9._(e),f9._(e),p9._(e),h9._(e),g9._(e),_9._(e),ho(e.a),co(e.a,G9(e)),Ao(e.a,W9(e)),Ha(e.a,U9(e)),eo(e.a),to(e.a)},d9=P(2,0,e=>zo(e.a,e._.p)),f9=P(2,0,e=>so(e.a,e._.q)),p9=P(2,0,e=>Co(e.a,e._.s)),m9=N(1,e=>Io(e.a,!e._.z&&e._.ad)),h9=P(2,0,e=>{Va(e.a,e._.z),m9(e)}),g9=P(2,0,e=>{jo(e.a,Y9(e)),wo(e.a,J9(e)),Eo(e.a,q9(e)),To(e.a,K9(e))}),_9=P(2,0,m9),v9=N(36,L(`n25`,e=>Tt(e,{onMount:function(){let t=new AbortController,n=t.signal,r={abort:t,statusStale:!1,statusDebounce:void 0};gee(e.m),qn(n);let i=(t,n)=>{n&&(kn(t,n),Vn(t,n)),e.a9(t)},a=new URLSearchParams(location.search);a.get(`ws`)&&(i(a.get(`ws`),a.get(`session`)),history.replaceState(null,``,`/`)),Qn()&&document.addEventListener(`click`,e=>{let t=e.target?.closest?.(`a[target="_blank"][href^="http"]`);t&&(e.preventDefault(),$n(t.href))},{capture:!0,signal:n}),navigator.serviceWorker?.addEventListener(`message`,e=>{e.data?.type===`open-session`&&i(e.data.workspaceId,e.data.sessionId)},{signal:n});let o=()=>{if(document.hidden){r.statusStale=!0;return}r.statusStale=!1,e.a8()};document.addEventListener(`visibilitychange`,()=>{document.hidden||(r.statusStale=!1,e.a8(!0))},{signal:n}),o(),xn().addEventListener(`workspaces.changed`,t=>{let n=t.data;Array.isArray(n)?e.a1(n):e.a2(),o()},{signal:n}),xn().addEventListener(`sessions.changed`,t=>{let n=t.data;if(n?.workspaceId&&Array.isArray(n.sessions)){e.a3(n.workspaceId,n.sessions),r.statusStale=!1;return}clearTimeout(r.statusDebounce),r.statusDebounce=setTimeout(o,300)},{signal:n}),xn().addEventListener(`status.changed`,t=>{t.data&&(w9(e,t.data),r.statusStale=!1)},{signal:n});let s=window.visualViewport;if(s){let e=()=>{let e=Math.abs(s.height-window.innerHeight)<1;document.documentElement.style.setProperty(`--app-height`,e?``:`${Math.round(s.height)}px`),e||window.scrollTo(0,0)};s.addEventListener(`resize`,e,{signal:n}),s.addEventListener(`scroll`,e,{signal:n}),document.addEventListener(`visibilitychange`,()=>{document.hidden||e()},{signal:n}),window.addEventListener(`pageshow`,e,{signal:n}),window.addEventListener(`focus`,e,{signal:n})}return r},onDestroy:function(){this.abort.abort(),clearTimeout(this.statusDebounce)}})),5),ope=F(e9),spe=M(35,e=>{v9(e),g9(e),l9(e),ope(e)}),y9=N(21,e=>spe(e,X9(e))),cpe=O(2,(e=>`<!>${e}`)(Oee),(e=>`b/${e}&`)(kee),ape),b9=N(40,e=>cpe(e,e.z||e.ad?0:1)),lpe=M(39,e=>{b9(e),_9(e)}),x9=N(38,e=>lpe(e,!e.x&&!e.ab)),upe=M(37,x9),S9=N(19,e=>upe(e,e.o.find(t=>t.id===e.s))),dpe=F(K7),C9=j(14,e=>{y9(e),S9(e),u9(e),s9(e),i9(e),dpe(e)}),fpe=M(29,v9),ppe=F(q7),w9=j(15,e=>{fpe(e,Z9(e)),d9(e),ppe(e)}),mpe=F(J7),hpe=j(16,e=>{f9(e),mpe(e)}),gpe=k(4,`<!><!><!>`,`b%`,epe,rpe),_pe=M(28,v9),vpe=F($7),ype=M(27,e=>{_pe(e,Q9(e)),v9(e),c9(e),vpe(e)}),T9=N(22,e=>ype(e,$9(e))),E9=j(20,e=>{gpe(e,[e.u,e=>e]),T9(e),y9(e)}),bpe=O(3,ic,(e=>`/${e}&`)(ac),ipe),D9=N(24,e=>bpe(e,e.x&&!e.s?0:1)),xpe=F(Z7),O9=j(18,e=>{E9(e,e.s?[e.s]:[]),T9(e),S9(e),D9(e),p9(e),xpe(e)}),Spe=F(Q7),k9=j(23,e=>{x9(e),D9(e),Spe(e)}),A9=j(25,e=>{b9(e),h9(e)}),Cpe=O(1,tr,(e=>`/${e}&`)(nr),Yfe),wpe=F(U7),j9=j(26,e=>{Cpe(e,+!e.a0),wpe(e)});L(`n24`,e=>A(e.a,`keydown`,function(t){if((t.metaKey||t.ctrlKey)&&t.key===`k`&&(t.preventDefault(),A9(e,!e.z)),(t.metaKey||t.ctrlKey)&&!t.shiftKey&&!t.altKey&&t.key>=`1`&&t.key<=`9`){let n=e.o.filter(e=>e.status===`active`)[Number(t.key)-1];n&&(t.preventDefault(),e.a9(n.id))}}));function M9(e){return function(){j9(e._,null)}}function N9(e){return function(t){e._._.a1(e._._.o.map(e=>e.id===t.id?t:e))}}function P9(e){return function(t){e._._.o.some(e=>e.id===t.id)||C9(e._._,[t,...e._._.o]),k9(e._._,!1),e._._.a9(t.id)}}function F9(e){return function(){k9(e._._,!1)}}function I9(e){return function(){k9(e._._,!0)}}function L9(e){return function(t,n){kn(t,n),Vn(t,n),e._._.a9(t)}}function R9(e){return function(t){e._._.a9(t)}}function z9(e){return function(t){let n=t||e._.f;jn(n),e._._.a9(n)}}function B9(e){return function(t){e._.o.some(e=>e.id===t.id)||C9(e._,[t,...e._.o]),k9(e._,!1),e._.a9(t.id)}}function V9(e){return function(t){e._.a1(e._.o.map(e=>e.id===t.id?t:e)),k9(e._,!1),e._.a9(t.id)}}function H9(e){return function(){k9(e._,!1)}}function U9(e){return t=>{A9(e._,t)}}function W9(e){return function(){k9(e._,!0),A9(e._,!1)}}function G9(e){return function(t){hpe(e._,t)}}function K9(e){return function(t){k9(e._,!1),A9(e._,!1),jn(t.id),e._.a9(t.id)}}function q9(e){return function(t,n){A9(e._,!1),H(`/api/workspaces/${t.id}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:n})}).then(n=>{kn(t.id,n.id),e._.a9(t.id)}).catch(t=>{j9(e._,`New session failed: ${String(t.message||t)}`)})}}function J9(e){return function(t){Dn(t.id),e._.a9(t.id)}}function Y9(e){return function(t){e._.a9(t.id)}}function X9(e){return async t=>{e.o.find(e=>e.id===t)?.status===`archived`&&(await H(`/api/workspaces/${t}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`restore`})}).catch(()=>{}),C9(e,e.o.map(e=>e.id===t?{...e,status:`active`}:e))),O9(e,t),k9(e,!1),A9(e,!1),e.u.includes(t)||E9(e,e.u.concat(t)),Rn(t)}}function Z9(e){return(t,n)=>{let r=e.p[t];if(!r)return;let i=n.map(e=>e.state).filter(e=>!!e?.alive);w9(e,{...e.p,[t]:{...r,sessions:n.map(e=>({id:e.id,agent:e.agent,title:e.title,state:e.state||{alive:!1}})),agents:i.length,working:i.filter(e=>e.phase===`working`).length,waiting:i.filter(e=>e.phase===`waiting`).length}})}}function Q9(e){return async()=>{try{e.a1(await H(`/api/workspaces`))}catch(t){if(Xt(t))return;j9(e,`Loading workspaces failed: ${t.message||String(t)}`)}}}function $9(e){return t=>{C9(e,t);let n=new Set(t.filter(e=>e.status===`active`).map(e=>e.id));E9(e,e.u.filter(e=>n.has(e))),e.s&&!n.has(e.s)&&(O9(e,e.u[e.u?.length-1]||null),Rn(e.s))}}function Tpe(e){return(t=!1)=>(e.a5||=t,(e.a6??=Nn(async()=>{let t=e.a5;e.a5=!1;try{w9(e,await H(`/api/status${t?`?fresh`:``}`))}catch(e){if(!Xt(e))throw e}}))())}R(`n5`,M9),R(`n19`,N9),R(`n22`,P9),R(`n21`,F9),R(`n20`,I9),R(`n17`,L9),R(`n16`,R9),R(`n18`,z9),R(`n14`,B9),R(`n15`,V9),R(`n13`,H9),R(`n12`,U9),R(`n11`,W9),R(`n6`,G9),R(`n10`,K9),R(`n9`,q9),R(`n8`,J9),R(`n7`,Y9),R(`n4`,X9),R(`n2`,Z9),R(`n1`,Q9),R(`n0`,$9),R(`n3`,Tpe);var Epe=(e,t,n)=>{for(;n;){if(n.O?.i)return(n.J||=[]).push(e,t);n=n.N}};tee(e=>(t,n=u.has(t))=>{if(n||l.has(t)){let e=0,r,i,a;for(;e<t.length;)r=t[e++],i=t[e++],(a=i.F)?.H!==0&&!(n&&Epe(r,i,a))&&r(i)}else e(t)},e=>t=>{try{let n=t.b.F;for(;n;){if(n.W)return t.f=1,n.W.push(t);n=n.N}t.f=0,e(t)}catch(e){see(t.b,e)}});var Dpe=e=>B(e.a,`_b`),Ope=(e,t)=>V(e.b,t instanceof Error?t.message:String(t));ft(`b1`,`<div><p> </p></div>`,` E `,Dpe,(e,t)=>Ope(e,t[0])),ft(`b0`,`<div><span></span>Loading workspaces…</div>`,` D `,e=>{B(e.a,`_b`),B(e.b,`_w`)}),ree();export{t};
1615
- //# sourceMappingURL=index-CNo7v-9k.js.map
1614
+ }`,V2=8,H2=V2*Float32Array.BYTES_PER_ELEMENT,U2=20*V2,W2=class{constructor(){this.attributes=new Float32Array(U2),this.count=0}},G2=0,K2=0,q2=0,J2=0,Y2=0,X2=0,Z2=0,Q2=class extends C1{constructor(e,t,n,r){super(),this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new W2,this._verticesCursor=new W2;let i=this._gl;this._program=G1(_2(i,z2,B2)),this._register(b1(()=>i.deleteProgram(this._program))),this._projectionLocation=G1(i.getUniformLocation(this._program,`u_projection`)),this._vertexArrayObject=i.createVertexArray(),i.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),o=i.createBuffer();this._register(b1(()=>i.deleteBuffer(o))),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,a,i.STATIC_DRAW),i.enableVertexAttribArray(3),i.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),c=i.createBuffer();this._register(b1(()=>i.deleteBuffer(c))),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c),i.bufferData(i.ELEMENT_ARRAY_BUFFER,s,i.STATIC_DRAW),this._attributesBuffer=G1(i.createBuffer()),this._register(b1(()=>i.deleteBuffer(this._attributesBuffer))),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.enableVertexAttribArray(0),i.vertexAttribPointer(0,2,i.FLOAT,!1,H2,0),i.vertexAttribDivisor(0,1),i.enableVertexAttribArray(1),i.vertexAttribPointer(1,2,i.FLOAT,!1,H2,2*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(1,1),i.enableVertexAttribArray(2),i.vertexAttribPointer(2,4,i.FLOAT,!1,H2,4*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,g2),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,n=this._vertices,r=1,i,a,o,s,c,l,u,d,f,p,m;for(i=0;i<t.rows;i++){for(o=-1,s=0,c=0,l=!1,a=0;a<t.cols;a++)u=(i*t.cols+a)*N2,d=e.cells[u+P2],f=e.cells[u+F2],p=!!(f&67108864),(d!==s||f!==c&&(l||p))&&((s!==0||l&&c!==0)&&(m=r++*V2,this._updateRectangle(n,m,c,s,o,a,i)),o=a,s=d,c=f,l=p);(s!==0||l&&c!==0)&&(m=r++*V2,this._updateRectangle(n,m,c,s,o,t.cols,i))}n.count=r}updateCursor(e){let t=this._verticesCursor,n=e.cursor;if(!n||n.style===`block`){t.count=0;return}let r,i=0;(n.style===`bar`||n.style===`outline`)&&(r=i++*V2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style===`bar`?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style===`underline`||n.style===`outline`)&&(r=i++*V2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style===`outline`&&(r=i++*V2,this._addRectangleFloat(t.attributes,r,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),r=i++*V2,this._addRectangleFloat(t.attributes,r,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=i}_updateRectangle(e,t,n,r,i,a,o){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:G2=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:G2=(n&16777215)<<8;break;case 0:default:G2=this._themeService.colors.foreground.rgba}else switch(r&50331648){case 16777216:case 33554432:G2=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:G2=(r&16777215)<<8;break;case 0:default:G2=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=y2(e.attributes,this._terminal.rows*this._terminal.cols*V2)),K2=i*this._dimensions.device.cell.width,q2=o*this._dimensions.device.cell.height,J2=(G2>>24&255)/255,Y2=(G2>>16&255)/255,X2=(G2>>8&255)/255,Z2=1,this._addRectangle(e.attributes,t,K2,q2,(a-i)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,J2,Y2,X2,Z2)}_addRectangle(e,t,n,r,i,a,o,s,c,l){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=c,e[t+7]=l}_addRectangleFloat(e,t,n,r,i,a,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},$2=class extends C1{constructor(e,t,n,r,i,a,o,s){super(),this._container=t,this._alpha=i,this._coreBrowserService=a,this._optionsService=o,this._themeService=s,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(b1(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=G1(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=l2(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=d0,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?`italic`:``} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},e4=class extends $2{constructor(e,t,n,r,i,a,o){super(n,e,`link`,t,!0,i,a,o),this._register(r.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(r.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&s2(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},t4=typeof window==`object`?window:globalThis,n4=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Y0,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Y0,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};n4.INSTANCE=new n4;var r4=n4;function i4(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}r4.INSTANCE.onDidChangeZoomLevel,r4.INSTANCE.onDidChangeFullscreen;var a4=typeof navigator==`object`?navigator.userAgent:``;a4.indexOf(`Firefox`);var o4=a4.indexOf(`AppleWebKit`)>=0;!(a4.indexOf(`Chrome`)>=0)&&a4.indexOf(`Safari`),a4.indexOf(`Electron/`),a4.indexOf(`Android`);var s4=!1;if(typeof t4.matchMedia==`function`){let e=t4.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=t4.matchMedia(`(display-mode: fullscreen)`);s4=e.matches,i4(t4,e,({matches:e})=>{s4&&t.matches||(s4=e)})}function c4(){return s4}var l4=`en`,u4=!1,d4=!1,f4=!1,p4=l4,m4,h4=globalThis,g4;typeof h4.vscode<`u`&&typeof h4.vscode.process<`u`?g4=h4.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(g4=process);var _4=typeof g4?.versions?.electron==`string`&&g4?.type===`renderer`;if(typeof g4==`object`){g4.platform,g4.platform,u4=g4.platform===`linux`,u4&&g4.env.SNAP&&g4.env.SNAP_REVISION,g4.env.CI||g4.env.BUILD_ARTIFACTSTAGINGDIRECTORY,p4=l4;let e=g4.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,p4=t.resolvedLanguage||l4,t.languagePack?.translationsConfigFile}catch{}d4=!0}else typeof navigator==`object`&&!_4?(m4=navigator.userAgent,m4.indexOf(`Windows`),m4.indexOf(`Macintosh`),(m4.indexOf(`Macintosh`)>=0||m4.indexOf(`iPad`)>=0||m4.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,u4=m4.indexOf(`Linux`)>=0,m4?.indexOf(`Mobi`),f4=!0,p4=globalThis._VSCODE_NLS_LANGUAGE||l4,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var v4=d4;f4&&typeof h4.importScripts==`function`&&h4.origin;var y4=m4,b4=p4,x4;(e=>{function t(){return b4}e.value=t;function n(){return b4.length===2?b4===`en`:b4.length>=3&&b4[0]===`e`&&b4[1]===`n`&&b4[2]===`-`}e.isDefaultVariant=n;function r(){return b4===`en`}e.isDefault=r})(x4||={});var S4=typeof h4.postMessage==`function`&&!h4.importScripts;(()=>{if(S4){let e=[];h4.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),h4.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var C4=!!(y4&&y4.indexOf(`Chrome`)>=0);y4&&y4.indexOf(`Firefox`),!C4&&y4&&y4.indexOf(`Safari`),y4&&y4.indexOf(`Edg/`),y4&&y4.indexOf(`Android`);var w4=typeof navigator==`object`?navigator:{};v4||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||w4&&w4.clipboard&&w4.clipboard.writeText,v4||w4&&w4.clipboard&&w4.clipboard.readText,v4||c4()||w4.keyboard,`ontouchstart`in t4||w4.maxTouchPoints,t4.PointerEvent&&(`ontouchstart`in t4||navigator.maxTouchPoints);var T4=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},E4=new T4,D4=new T4,O4=new T4;Array(230);var k4;(e=>{function t(e){return E4.keyCodeToStr(e)}e.toString=t;function n(e){return E4.strToKeyCode(e)}e.fromString=n;function r(e){return D4.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return O4.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return D4.strToKeyCode(e)||O4.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return E4.keyCodeToStr(e)}e.toElectronAccelerator=o})(k4||={});var A4=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),Boe;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof Voe?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:I0.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:A4})})(Boe||={});var Voe=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?A4:(this._emitter||=new Y0,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var Hoe;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(Hoe||={});var j4=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Y0,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await I0.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};j4.EMPTY=j4.fromArray([]);function Uoe(e){return M4(e,0)}function M4(e,t){switch(typeof e){case`object`:return e===null?N4(349,t):Array.isArray(e)?Goe(e,t):Koe(e,t);case`string`:return P4(e,t);case`boolean`:return Woe(e,t);case`number`:return N4(e,t);case`undefined`:return N4(937,t);default:return N4(617,t)}}function N4(e,t){return(t<<5)-t+e|0}function Woe(e,t){return N4(e?433:863,t)}function P4(e,t){t=N4(149417,t);for(let n=0,r=e.length;n<r;n++)t=N4(e.charCodeAt(n),t);return t}function Goe(e,t){return t=N4(104579,t),e.reduce((e,t)=>M4(t,e),t)}function Koe(e,t){return t=N4(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=P4(n,t),M4(e[n],t)),t)}var{registerWindow:qoe,getWindow:Joe,getDocument:Yoe,getWindows:Xoe,getWindowsCount:Zoe,getWindowId:Qoe,getWindowById:$oe,hasWindow:ese,onDidRegisterWindow:tse,onWillUnregisterWindow:nse,onDidUnregisterWindow:rse}=function(){let e=new Map,t={window:t4,disposables:new S1};e.set(t4.vscodeWindowId,t);let n=new Y0,r=new Y0,i=new Y0;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return C1.None;let a=new S1,o={window:t,disposables:a.add(new S1)};return e.set(t.vscodeWindowId,o),a.add(b1(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(F4(t,ase.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:t4},getDocument(e){return Joe(e).document}}}(),ise=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function F4(e,t,n,r){return new ise(e,t,n,r)}var I4=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};I4.None=new I4(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=Uoe(n),a=r.get(i);if(a)a.users+=1;else{let o=new Y0,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(b1(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var ase={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:o4?`webkitAnimationStart`:`animationstart`,ANIMATION_END:o4?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:o4?`webkitAnimationIteration`:`animationiteration`},ose=class extends C1{constructor(e,t,n,r,i,a,o,s,c){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new w1,this._charAtlasDisposable=this._register(new w1),this._observerDisposable=this._register(new w1),this._model=new R2,this._workCell=new h2,this._workCell2=new h2,this._rectangleRenderer=this._register(new w1),this._glyphRenderer=this._register(new w1),this._onChangeTextureAtlas=this._register(new Y0),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Y0),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Y0),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Y0),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Y0),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`);let l={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext(`webgl2`,l),!this._gl)throw Error(`WebGL2 not supported `+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new l0(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new e4(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=$1(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(F4(this._canvas,`webglcontextlost`,e=>{console.log(`webglcontextlost event received`),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn(`webgl context not restored; firing onContextLoss`),this._onContextLoss.fire(e)},3e3)})),this._register(F4(this._canvas,`webglcontextrestored`,e=>{console.warn(`webglcontextrestored event received`),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,u2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=p2(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=p2(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(b1(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),u2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Q2(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new A2(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=l2(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=y1(I0.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),I0.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached){if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return}for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new f2(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,i,a,o,s,c,l,u=0,d=!0,f,p,m,h,g,_,v,y,b;e=L4(e,n.rows-1,0),t=L4(t,n.rows-1,0);let x=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??`block`,S=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ee=S-n.buffer.ydisp,te=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),C=-1,ne=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let w=!1;for(a=e;a<=t;a++)for(o=a+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[a]=0,m=S===o,u=0,c=this._characterJoinerService.getJoinedCharacters(o),y=0;y<n.cols;y++){if(i=this._cellColorResolver.result.bg,s.loadCell(y,r),y===0&&(i=this._cellColorResolver.result.bg),l=!1,d=y>=u,f=y,c.length>0&&y===c[0][0]&&d){p=c.shift();let e=this._model.selection.isCellSelected(this._terminal,p[0],o);for(v=p[0]+1;v<p[1];v++)d&&=e===this._model.selection.isCellSelected(this._terminal,v,o);d&&=!m||te<p[0]||te>=p[1],d?(l=!0,r=new sse(r,s.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1):u=p[1]}if(h=r.getChars(),g=r.getCode(),v=(a*n.cols+y)*N2,this._cellColorResolver.resolve(r,y,o,this.dimensions.device.cell.width),ne&&o===S&&(y===te&&(this._model.cursor={x:te,y:ee,width:r.getWidth(),style:this._coreBrowserService.isFocused?x:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},C=te+r.getWidth()-1),y>=te&&y<=C&&(this._coreBrowserService.isFocused&&x===`block`||this._coreBrowserService.isFocused===!1&&n.options.cursorInactiveStyle===`block`)&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),g!==0&&(this._model.lineLengths[a]=y+1),(this._model.cells[v]!==g||this._model.cells[v+P2]!==this._cellColorResolver.result.bg||this._model.cells[v+F2]!==this._cellColorResolver.result.fg||this._model.cells[v+I2]!==this._cellColorResolver.result.ext)&&(w=!0,h.length>1&&(g|=L2),this._model.cells[v]=g,this._model.cells[v+P2]=this._cellColorResolver.result.bg,this._model.cells[v+F2]=this._cellColorResolver.result.fg,this._model.cells[v+I2]=this._cellColorResolver.result.ext,_=r.getWidth(),this._glyphRenderer.value.updateCell(y,a,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,h,_,i),l)){for(r=this._workCell,y++;y<=f;y++)b=(a*n.cols+y)*N2,this._glyphRenderer.value.updateCell(y,a,0,0,0,0,M1,0,0),this._model.cells[b]=0,this._model.cells[b+P2]=this._cellColorResolver.result.bg,this._model.cells[b+F2]=this._cellColorResolver.result.fg,this._model.cells[b+I2]=this._cellColorResolver.result.ext;y--}}w&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},sse=class extends j0{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function L4(e,t,n=0){return Math.max(Math.min(e,t),n)}var R4=`di$target`,z4=`di$dependencies`,B4=new Map;function V4(e){if(B4.has(e))return B4.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);cse(t,e,r)};return t._id=e,B4.set(e,t),t}function cse(e,t,n){t[R4]===t?t[z4].push({id:e,index:n}):(t[z4]=[{id:e,index:n}],t[R4]=t)}V4(`BufferService`),V4(`CoreMouseService`),V4(`CoreService`),V4(`CharsetService`),V4(`InstantiationService`),V4(`LogService`);var lse=V4(`OptionsService`);V4(`OscLinkService`),V4(`UnicodeService`),V4(`DecorationService`);var use={trace:0,debug:1,info:2,warn:3,error:4,off:5},dse=`xterm.js: `,H4=class extends C1{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),fse=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=use[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:dse)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};H4=n1([r1(0,lse)],H4);var fse,pse=class extends C1{constructor(e){if(A1&&j1()<16&&!document.createElement(`canvas`).getContext(`webgl2`,{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error(`Webgl2 is only supported on Safari 16 and above`);super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Y0),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Y0),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Y0),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Y0),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let n=t.coreService,r=t.optionsService,i=t,a=i._renderService,o=i._characterJoinerService,s=i._charSizeService,c=i._coreBrowserService,l=i._decorationService;i._logService;let u=i._themeService;this._renderer=this._register(new ose(e,o,s,c,n,l,r,u,this._preserveDrawingBuffer)),this._register(I0.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(I0.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(I0.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(I0.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),a.setRenderer(this._renderer),this._register(b1(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},mse=2,hse=1,gse=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(mse,Math.floor(u/e.css.cell.width)),rows:Math.max(hse,Math.floor(l/e.css.cell.height))}}},U4=`3.7.8`,_se=U4,W4=typeof Buffer==`function`,G4=typeof TextDecoder==`function`?new TextDecoder:void 0,K4=typeof TextEncoder==`function`?new TextEncoder:void 0,q4=Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`),J4=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(q4),vse=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Y4=String.fromCharCode.bind(String),X4=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Z4=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),Q4=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),$4=e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=q4[t>>18&63]+q4[t>>12&63]+q4[t>>6&63]+q4[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},e3=typeof btoa==`function`?e=>btoa(e):W4?e=>Buffer.from(e,`binary`).toString(`base64`):$4,t3=W4?e=>Buffer.from(e).toString(`base64`):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(Y4.apply(null,e.subarray(n,n+4096)));return e3(t.join(``))},n3=(e,t=!1)=>t?Z4(t3(e)):t3(e),yse=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?Y4(192|t>>>6)+Y4(128|t&63):Y4(224|t>>>12&15)+Y4(128|t>>>6&63)+Y4(128|t&63)}var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return Y4(240|t>>>18&7)+Y4(128|t>>>12&63)+Y4(128|t>>>6&63)+Y4(128|t&63)},bse=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,r3=e=>e.replace(bse,yse),i3=W4?e=>Buffer.from(e,`utf8`).toString(`base64`):K4?e=>t3(K4.encode(e)):e=>e3(r3(e)),a3=(e,t=!1)=>t?Z4(i3(e)):i3(e),o3=e=>a3(e,!0),xse=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Sse=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return Y4((t>>>10)+55296)+Y4((t&1023)+56320);case 3:return Y4((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Y4((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},s3=e=>e.replace(xse,Sse),c3=e=>{if(e=e.replace(/\s+/g,``),!vse.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a<e.length;)t=J4[e.charAt(a++)]<<18|J4[e.charAt(a++)]<<12|(n=J4[e.charAt(a++)])<<6|(r=J4[e.charAt(a++)]),n===64?i.push(Y4(t>>16&255)):r===64?i.push(Y4(t>>16&255,t>>8&255)):i.push(Y4(t>>16&255,t>>8&255,t&255));return i.join(``)},l3=typeof atob==`function`?e=>atob(Q4(e)):W4?e=>Buffer.from(e,`base64`).toString(`binary`):c3,u3=W4?e=>X4(Buffer.from(e,`base64`)):e=>X4(l3(e).split(``).map(e=>e.charCodeAt(0))),d3=e=>u3(f3(e)),Cse=W4?e=>Buffer.from(e,`base64`).toString(`utf8`):G4?e=>G4.decode(u3(e)):e=>s3(l3(e)),f3=e=>Q4(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),p3=e=>Cse(f3(e)),wse=e=>{if(typeof e!=`string`)return!1;let t=e.replace(/\s+/g,``).replace(/={0,2}$/,``);return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},m3=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),h3=function(){let e=(e,t)=>Object.defineProperty(String.prototype,e,m3(t));e(`fromBase64`,function(){return p3(this)}),e(`toBase64`,function(e){return a3(this,e)}),e(`toBase64URI`,function(){return a3(this,!0)}),e(`toBase64URL`,function(){return a3(this,!0)}),e(`toUint8Array`,function(){return d3(this)})},g3=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,m3(t));e(`toBase64`,function(e){return n3(this,e)}),e(`toBase64URI`,function(){return n3(this,!0)}),e(`toBase64URL`,function(){return n3(this,!0)})},_3={version:U4,VERSION:_se,atob:l3,atobPolyfill:c3,btoa:e3,btoaPolyfill:$4,fromBase64:p3,toBase64:a3,encode:a3,encodeURI:o3,encodeURL:o3,utob:r3,btou:s3,decode:p3,isValid:wse,fromUint8Array:n3,toUint8Array:d3,extendString:h3,extendUint8Array:g3,extendBuiltins:()=>{h3(),g3()}},Tse=class{constructor(e=new Dse,t=new Ese){this._base64=e,this._provider=t}activate(e){this._terminal=e,this._disposable=e.parser.registerOscHandler(52,e=>this._setOrReportClipboard(e))}dispose(){return this._disposable?.dispose()}_readText(e,t){let n=this._base64.encodeText(t);this._terminal?.input(`\x1B]52;${e};${n}\x07`,!1)}_setOrReportClipboard(e){let t=e.split(`;`);if(t.length<2)return!0;let n=t[0],r=t[1];if(r===`?`){let e=this._provider.readText(n);return e instanceof Promise?e.then(e=>(this._readText(n,e),!0)):(this._readText(n,e),!0)}let i=``;try{i=this._base64.decodeText(r)}catch{}let a=this._provider.writeText(n,i);return a instanceof Promise?a.then(()=>!0):!0}},Ese=class{async readText(e){return e===`c`?navigator.clipboard.readText():Promise.resolve(``)}async writeText(e,t){return e===`c`?navigator.clipboard.writeText(t):Promise.resolve()}},Dse=class{encodeText(e){return _3.encode(e)}decodeText(e){let t=_3.decode(e);return!_3.isValid(e)||_3.encode(t)!==e?``:t}},Ose=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=Ase.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function kse(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var Ase=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!kse(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},jse=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function Mse(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var Nse=class{constructor(e=Mse,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||jse;this._linkProvider=this._terminal.registerLinkProvider(new Ose(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}};function Pse(e,t){let{term:n,write:r}=e,i=new TextEncoder,a=null,o=0,s=!1,c=null,l=()=>{if(s)return;let i=location.protocol===`https:`?`wss`:`ws`,f=a=new WebSocket(`${i}://${location.host}/term/${e.sessionId}?cols=${n.cols}&rows=${n.rows}&visible=${+!!u()}`);f.onmessage=e=>r(e.data),f.onopen=()=>{o=0,d(f),c&&=(f.send(JSON.stringify({resize:c})),null),m()},f.onclose=()=>{if(!(t.aborted||s||a!==f)){if(document.visibilityState!==`visible`){let e=()=>{document.visibilityState===`visible`&&(document.removeEventListener(`visibilitychange`,e),!t.aborted&&a===f&&l())};document.addEventListener(`visibilitychange`,e,{signal:t})}else++o<=3?setTimeout(()=>{!t.aborted&&a===f&&l()},400*o):e.onDead()}}},u=()=>document.visibilityState===`visible`&&e.isVisible(),d=e=>{e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({visible:u()}))};document.addEventListener(`visibilitychange`,()=>a&&d(a),{signal:t}),l(),t.addEventListener(`abort`,()=>a?.close());let f=[],p=0,m=()=>{for(;f.length&&a?.readyState===WebSocket.OPEN;)a.send(i.encode(f.shift()));p=0};return{send(e){a?.readyState===WebSocket.OPEN?a.send(i.encode(e)):p<1024&&(f.push(e),p+=e.length)},resize(e,t){a?.readyState===WebSocket.OPEN?a.send(JSON.stringify({resize:[e,t]})):c=[e,t]},syncVisibility(){a&&d(a)},get readyState(){return a?.readyState},reconnect(){s=!1,l()},disconnect(){s=!0,a?.close()}}}function Fse(e,t,n,r){let i=null,a=0,o=0,s=0,c=0,l=n=>{let r=t().querySelector(`.xterm-screen`)||t(),i=r.clientHeight/e.rows||17;c+=n/i;let a=Math.trunc(c);if(!a)return;c-=a;let o=r.getBoundingClientRect(),s=a>0?1:-1;for(let e=0;e!==a;e+=s)r.dispatchEvent(new WheelEvent(`wheel`,{deltaY:s,deltaMode:WheelEvent.DOM_DELTA_LINE,bubbles:!0,cancelable:!0,clientX:o.left+o.width/2,clientY:o.top+o.height/2}))},u=()=>{cancelAnimationFrame(s),s=0},d=()=>{o*=.97,!(Math.abs(o)<.25)&&(l(o*16),s=requestAnimationFrame(d))};n.addEventListener(`abort`,u),t().addEventListener(`touchstart`,e=>{u(),o=0,i=e.touches[0]?.clientY??null,a=e.timeStamp},{passive:!0,signal:n}),t().addEventListener(`touchmove`,e=>{if(r?.())return;let t=e.touches[0]?.clientY;if(t==null||i==null)return;let n=i-t;Math.abs(n)>=2&&(o=n/Math.max(1,e.timeStamp-a),i=t,a=e.timeStamp,l(n)),e.preventDefault()},{passive:!1,signal:n}),t().addEventListener(`touchend`,()=>{i=null,Math.abs(o)>.5&&(u(),s=requestAnimationFrame(d))},{signal:n})}function Ise(e){let t=!1,n=[],r=0;return{write(i){if(!t){e.write(i);return}for(n.push(i),r+=i.length;r>1048576&&n.length>1;)r-=n.shift().length},setFrozen(i){if(t!==i&&(t=i,!i)){let t=n.join(``);n=[],r=0,t&&e.write(t)}}}}function Lse(e,t,n){let r=e.textarea;if(!r)return;let i=`\xA0`.repeat(4),a={deleteContentBackward:``,deleteWordBackward:``,deleteSoftLineBackward:``,deleteHardLineBackward:``},o=!1,s=()=>{o||(r.value!==i&&(r.value=i),r.setSelectionRange(i.length,i.length))};r.addEventListener(`beforeinput`,e=>{let n=a[e.inputType];n&&(e.preventDefault(),e.stopImmediatePropagation(),t(n))},{capture:!0,signal:n}),r.addEventListener(`compositionstart`,()=>{o=!0},{signal:n}),r.addEventListener(`compositionend`,()=>{o=!1,setTimeout(s,0)},{signal:n}),r.addEventListener(`input`,()=>setTimeout(s,0),{signal:n}),r.addEventListener(`focus`,()=>setTimeout(s,0),{signal:n}),s()}var Rse=450,zse=12,Bse=` ·│┃()[]{}<>'"\`,;│|`;function Vse(e,t,n,r){let i=!1,a,o=0,s=0,c=null,l=null,u=()=>t().querySelector(`.xterm-screen`)||t(),d=(t,n)=>{let r=u().getBoundingClientRect();return{col:Math.max(0,Math.min(e.cols-1,Math.floor((t-r.left)/r.width*e.cols))),row:Math.max(0,Math.min(e.rows-1,Math.floor((n-r.top)/r.height*e.rows)))+e.buffer.active.viewportY}},f=t=>{let n=e.buffer.active.getLine(t.row)?.translateToString()??``,r=e=>!e||e===` `||Bse.includes(e);if(r(n[t.col]))return{start:t,end:t};let i=t.col,a=t.col;for(;i>0&&!r(n[i-1]);)i--;for(;a<n.length-1&&!r(n[a+1]);)a++;return{start:{col:i,row:t.row},end:{col:a,row:t.row}}},p=(e,t)=>e.row<t.row||e.row===t.row&&e.col<=t.col,m=()=>{if(!c||!l)return;let[t,n]=p(c,l)?[c,l]:[l,c],r=(n.row-t.row)*e.cols+(n.col-t.col)+1;e.select(t.col,t.row,Math.max(1,r))},h=()=>{clearTimeout(a),a=void 0};t().addEventListener(`touchstart`,t=>{if(t.touches.length!==1){h();return}!i&&e.hasSelection()&&e.clearSelection(),o=t.touches[0].clientX,s=t.touches[0].clientY,a=setTimeout(()=>{a=void 0,i=!0,n.onStart();let e=f(d(o,s));c=e.start,l=e.end,m(),navigator.vibrate?.(10)},Rse)},{passive:!0,signal:r}),t().addEventListener(`touchmove`,e=>{let t=e.touches[0];if(t){if(i){l=d(t.clientX,t.clientY),m(),e.preventDefault();return}a&&Math.hypot(t.clientX-o,t.clientY-s)>zse&&h()}},{passive:!1,signal:r});let g=()=>{if(h(),!i)return;i=!1,n.onEnd();let t=e.getSelection();t&&Kh(t).then(e=>{e&&n.onCopy(t)})};return t().addEventListener(`touchend`,g,{signal:r}),t().addEventListener(`touchcancel`,g,{signal:r}),{selecting:()=>i}}var Hse=5;function Use(e,t,n,r){let i=null,a=!1,o=0,s=0,c=()=>t().querySelector(`.xterm-screen`)||t(),l=(t,n)=>{let r=c().getBoundingClientRect();return{col:Math.max(0,Math.min(e.cols-1,Math.floor((t-r.left)/r.width*e.cols))),row:Math.max(0,Math.min(e.rows-1,Math.floor((n-r.top)/r.height*e.rows)))+e.buffer.active.viewportY}};t().addEventListener(`mousedown`,t=>{if(a||t.button!==0||t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)return;t.preventDefault(),t.stopImmediatePropagation();let n=t.timeStamp;s=n-o<400?s+1:1,o=n;let r=l(t.clientX,t.clientY);i={startX:t.clientX,startY:t.clientY,startCol:r.col,startRow:r.row,selecting:!1,detail:s},e.focus()},{capture:!0,signal:r}),window.addEventListener(`mousemove`,t=>{if(!i)return;if(!i.selecting){if(Math.hypot(t.clientX-i.startX,t.clientY-i.startY)<Hse)return;i.selecting=!0}let n=l(t.clientX,t.clientY),r=(n.row-i.startRow)*e.cols+(n.col-i.startCol)+1,[a,o,s]=r>=0?[i.startCol,i.startRow,Math.max(1,r)]:[n.col,n.row,Math.max(1,-r+1)];e.select(a,o,s),t.preventDefault()},{signal:r}),window.addEventListener(`mouseup`,async t=>{if(!i)return;let r=i.selecting,o=i;if(i=null,r){let t=e.getSelection();t&&await Kh(t)&&n(t);return}a=!0;let s={bubbles:!0,cancelable:!0,clientX:o.startX,clientY:o.startY,button:0,buttons:1,detail:o.detail,view:window},c=document.elementFromPoint(o.startX,o.startY);c?.dispatchEvent(new MouseEvent(`mousedown`,s)),c?.dispatchEvent(new MouseEvent(`mouseup`,{...s,buttons:0,button:0})),c?.dispatchEvent(new MouseEvent(`click`,{...s,buttons:0})),a=!1,t.preventDefault()},{signal:r})}function v3(e,t){let n=t.trim().toLowerCase();if(!n)return[];let r=e.buffer.active,i=n.length,a=[];for(let e=0;e<r.length;e++){let t=r.getLine(e);if(!t)continue;let o=t.translateToString(!1).toLowerCase(),s=0;for(;s<=o.length-i;){let t=o.indexOf(n,s);if(t<0)break;a.push({row:e,col:t,len:i}),s=t+i}}return a}function Wse(e,t){let n=document.createElement(`div`);n.className=`termFindOverlay`,n.setAttribute(`aria-hidden`,`true`),t.appendChild(n);let r=``,i=[],a=-1,o=0,s=()=>e.element?.querySelector(`.xterm-screen`)||e.element?.querySelector(`.xterm-rows`)||t,c=()=>{let n=s();if(!e.cols||!e.rows)return null;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();return i.width<1||i.height<1?null:{w:i.width/e.cols,h:i.height/e.rows,left:i.left-r.left,top:i.top-r.top}},l=()=>{n.replaceChildren();let t=r.trim().toLowerCase();if(!t){n.style.display=`none`;return}let o=c();if(!o){n.style.display=`none`;return}n.style.display=`block`,n.style.left=`${o.left}px`,n.style.top=`${o.top}px`,n.style.width=`${o.w*e.cols}px`,n.style.height=`${o.h*e.rows}px`;let s=e.buffer.active,l=s.viewportY,u=t.length,d=a>=0?i[a]:null;for(let r=0;r<e.rows;r++){let i=l+r,a=s.getLine(i);if(!a)continue;let c=a.translateToString(!1).toLowerCase(),f=0;for(;f<=c.length-u;){let a=c.indexOf(t,f);if(a<0)break;if(a<e.cols){let t=Math.min(u,e.cols-a),s=document.createElement(`div`);s.className=d&&d.row===i&&d.col===a&&d.len===u?`termFindHit termFindHitActive`:`termFindHit`,s.style.left=`${a*o.w}px`,s.style.top=`${r*o.h}px`,s.style.width=`${t*o.w}px`,s.style.height=`${o.h}px`,n.appendChild(s)}f=a+u}}},u=t=>{let n=e.buffer.active.viewportY;(t.row<n||t.row>=n+e.rows)&&e.scrollToLine(Math.max(0,t.row-Math.floor(e.rows/2))),e.select(t.col,t.row,t.len)},d=t=>{if(!i.length)return a=-1,e.clearSelection(),t<0?`up`:t>0?`down`:null;if(t===0)a=i.length-1;else if(a<0||a>=i.length)a=t>0?0:i.length-1;else if(t>0){if(a>=i.length-1)return`down`;a+=1}else{if(a<=0)return`up`;--a}return u(i[a]),null},f=t=>{let n=s(),r=n.getBoundingClientRect(),i=Math.max(1,e.rows-1),a=t===`up`?-1:1;for(let e=0;e<i;e++)n.dispatchEvent(new WheelEvent(`wheel`,{deltaY:a,deltaMode:WheelEvent.DOM_DELTA_LINE,bubbles:!0,cancelable:!0,clientX:r.left+r.width/2,clientY:r.top+r.height/2}))},p=()=>{o&&clearTimeout(o),o=0};return{search(t,n){p(),r=t,i=v3(e,r);let s=d(n);l(),!(!s||n===0)&&(f(s),o=setTimeout(()=>{o=0,r===t&&(i=v3(e,r),a=-1,d(n),l())},80))},refresh(){l()},clear(){p(),r=``,i=[],a=-1,e.clearSelection(),l()},dispose(){p(),n.remove()}}}var Gse=2,Kse=[`#2e3436`,`#cc0000`,`#4e9a06`,`#c4a000`,`#3465a4`,`#75507b`,`#06989a`,`#d3d7cf`,`#555753`,`#ef2929`,`#8ae234`,`#fce94f`,`#729fcf`,`#ad7fa8`,`#34e2e2`,`#eeeeec`];function y3(e){return e?.background||`#000000`}function qse(e,t){if(t<0||t>255)return y3(e);let n=[e?.black,e?.red,e?.green,e?.yellow,e?.blue,e?.magenta,e?.cyan,e?.white,e?.brightBlack,e?.brightRed,e?.brightGreen,e?.brightYellow,e?.brightBlue,e?.brightMagenta,e?.brightCyan,e?.brightWhite][t];if(n)return n;if(t<16)return Kse[t];if(t<232){let e=t-16,n=Math.floor(e/36),r=Math.floor(e%36/6),i=e%6,a=e=>e===0?0:55+e*40;return`rgb(${a(n)},${a(r)},${a(i)})`}let r=8+(t-232)*10;return`rgb(${r},${r},${r})`}function Jse(e,t){let n=e.options.theme;if(t.isBgDefault())return y3(n);if(t.isBgRGB()){let e=t.getBgColor();return`rgb(${e>>16&255},${e>>8&255},${e&255})`}return t.isBgPalette()?qse(n,t.getBgColor()):y3(n)}function Yse(e){let t=e.buffer.active,n=t.getNullCell(),r=t.viewportY,i=Math.min(t.length-1,r+Math.max(0,e.rows-1)),a=Math.max(0,e.cols-1),o=[[0,r],[a,r],[0,i],[a,i],[Math.floor(a/2),r+Math.floor((i-r)/2)]],s=new Map;for(let[r,i]of o){if(!t.getLine(i)?.getCell(r,n))continue;let a=Jse(e,n);s.set(a,(s.get(a)||0)+1)}let c=y3(e.options.theme),l=0;for(let[e,t]of s)t>l&&(c=e,l=t);return c}function Xse(e){let t=e._core?._renderService?.dimensions?.css?.cell;return!t?.width||!t?.height?null:{w:t.width,h:t.height}}function Zse(e){try{let t=e._core;if(!t)return;let n=t._viewport||t.viewport;return n?n._scrollableElement||n.scrollableElement:void 0}catch{return}}function b3(e){try{let t=e.options.overviewRuler;(!t||t.width!==0)&&(e.options.overviewRuler={...t||{},width:0}),Zse(e)?.updateOptions?.({vertical:Gse,verticalScrollbarSize:0})}catch{}}function x3(e,t,n){return e.style.getPropertyValue(t)===n&&e.style.getPropertyPriority(t)===`important`?!1:(e.style.setProperty(t,n,`important`),!0)}function S3(e){x3(e,`display`,`none`),x3(e,`width`,`0px`),x3(e,`min-width`,`0px`),x3(e,`max-width`,`0px`),x3(e,`height`,`0px`),x3(e,`opacity`,`0`),x3(e,`pointer-events`,`none`),x3(e,`visibility`,`hidden`)}function Qse(e){return e instanceof HTMLElement?e.classList.contains(`scrollbar`)||e.classList.contains(`slider`)||e.classList.contains(`shadow`):!1}function $se(e){let t=e.element;if(!t)return{dispose(){}};let n=!1,r=new Set,i=new MutationObserver(()=>{if(!n){n=!0;try{for(let e of r)e.isConnected&&S3(e)}finally{n=!1}}}),a=e=>{if(!r.has(e)){r.add(e),n=!0;try{S3(e)}finally{n=!1}i.observe(e,{attributes:!0,attributeFilter:[`style`,`class`]})}};(()=>{b3(e);let r=t.querySelector(`.xterm-viewport`);if(r){n=!0;try{x3(r,`overflow`,`hidden`),x3(r,`overflow-y`,`hidden`),x3(r,`overflow-x`,`hidden`)}finally{n=!1}}for(let e of t.querySelectorAll(`.scrollbar, .scrollbar .slider, .xterm-scrollable-element > .shadow`))a(e)})();let o=new MutationObserver(t=>{let n=!1;for(let e of t)for(let t of e.addedNodes)if(Qse(t))n=!0,a(t);else if(t instanceof HTMLElement)for(let e of t.querySelectorAll(`.scrollbar, .slider, .shadow`))n=!0,a(e);n&&b3(e)});return o.observe(t,{childList:!0,subtree:!0}),{dispose(){i.disconnect(),o.disconnect(),r.clear()}}}function C3(e,t){b3(e);let n=e.element?.parentElement,r=Xse(e);if(!n||!r||!e.element){t.fit();return}let i=getComputedStyle(n),a=getComputedStyle(e.element),o=(parseFloat(a.paddingLeft)||0)+(parseFloat(a.paddingRight)||0),s=(parseFloat(a.paddingTop)||0)+(parseFloat(a.paddingBottom)||0),c=Math.max(0,parseFloat(i.width)||n.clientWidth)-o,l=Math.max(0,parseFloat(i.height)||n.clientHeight)-s,u=Math.max(2,Math.floor(c/r.w)),d=Math.max(1,Math.floor(l/r.h));if(e.cols!==u||e.rows!==d){try{e._core?._renderService?.clear?.()}catch{}e.resize(u,d)}}function w3(e,t){let n=e.element;if(!n)return;let r=Yse(e);if(n.dataset.shellBg===r&&(!t||t.dataset.shellBg===r))return;n.dataset.shellBg=r,n.style.backgroundColor=r,t&&(t.dataset.shellBg=r,t.style.backgroundColor=r);let i=n.querySelector(`.xterm-viewport`);i&&(i.style.backgroundColor=r);let a=n.querySelector(`.xterm-scrollable-element`);a&&(a.style.backgroundColor=r)}function ece(e,t){let n=0,r=()=>{n||=requestAnimationFrame(()=>{n=0,w3(e,t())})};w3(e,t());let i=e.onWriteParsed(r);return{dispose(){cancelAnimationFrame(n),i.dispose()}}}var tce=`_d2 _y`,T3=`_ez _y`,E3=`<div><div><input type=search enterkeyhint=search autocomplete=off placeholder="Find in terminal" aria-label="Find in terminal"><button type=button title="Previous match">↑</button><button type=button title="Next match">↓</button><button type=button title="Close find">×</button></div></div>`,D3=` D D b b b m`,nce=(e,t)=>{z(e.d,`disabled`,!t),z(e.e,`disabled`,!t)},O3=N(35,e=>nce(e,e.a8&&e.q)),k3=N(32,L(`u6`,e=>{e.v=!!e.q,e.x=e.t,e.n&&(e.n.focus=e.a5)}),5),A3=N(33,L(`u5`,e=>Tt(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(!e.v)return;if(t.key===`Escape`){if(document.querySelector(`dialog[open]`))return;t.preventDefault(),t.stopPropagation(),e.a4();return}let n=t.metaKey||t.ctrlKey;if(t.key===`F3`||n&&t.key.toLowerCase()===`g`){t.preventDefault(),t.stopPropagation(),e.a2(t.shiftKey?-1:1);return}if(!(n||t.altKey)){if(t.key===`Enter`){if(document.activeElement!==e.c)return;t.preventDefault(),t.stopPropagation(),e.a2(t.shiftKey?-1:1);return}if(t.key===`ArrowDown`){if(!e.x.trim())return;t.preventDefault(),t.stopPropagation(),e.a2(1);return}if(t.key===`ArrowUp`){if(!e.x.trim())return;t.preventDefault(),t.stopPropagation(),e.a2(-1)}}},{capture:!0,signal:t.signal}),e.a0=e.o,e.a1=!!e.q,e.q&&e.a5(),{abort:t}},onUpdate:function(){e.o!==e.a0&&(e.a0=e.o,e.q&&(e.a5(),e.c?.select())),e.q&&!e.a1?(e.a1=!0,e.a5()):e.q||(e.a1=!1)},onDestroy:function(){if(this.abort.abort(),e.v){let t=e.m;t&&t()}}})),9),j3=N(18,e=>B(e.a,[`_eN`,e.p===`keybar`?`_eP`:`_eO`,!e.q&&`_eR`])),M3=N(29,e=>jt(e,`c`,e.t,K3(e)),3),N3=Ke(16,e=>{z(e.a,`aria-hidden`,e.q?`false`:`true`),z(e.c,`tabindex`,e.q?0:-1),z(e.d,`tabindex`,e.q?0:-1),z(e.e,`tabindex`,e.q?0:-1),z(e.f,`tabindex`,e.q?0:-1),O3(e),k3(e),A3(e),j3(e),M3(e)}),P3=N(10,e=>N3(e,e.i,e.j)),F3=M(8,P3),I3=M(9,P3),rce=M(34,O3),L3=j(19,e=>{rce(e,!!e.t.trim()),k3(e),M3(e)}),ice=(e,t)=>{uce(e,t.open),dce(e,t.query)},ace=(e,t)=>{fce(e,t.tick),pce(e,t.wasOpen)},oce=M(31,e=>{k3(e),A3(e)}),sce=L(`u4`,e=>{Mt(e,`c`),A(e.c,`keydown`,function(t){if(e.q){if(t.key===`Escape`){t.preventDefault(),t.stopPropagation(),e.a4();return}t.stopPropagation()}}),A(e.d,`mousedown`,function(e){e.preventDefault()}),A(e.d,`click`,function(){e.a2(-1)}),A(e.e,`mousedown`,function(e){e.preventDefault()}),A(e.e,`click`,function(){e.a2(1)}),A(e.f,`mousedown`,function(e){e.preventDefault()}),A(e.f,`click`,function(){e.a4()})});function R3(e){B(e.c,`_eJ`),B(e.d,lj),B(e.e,lj),B(e.f,lj),L3(e,``),ice(e,{open:!1,query:``}),ace(e,{tick:0,wasOpen:!1}),oce(e,q3(e)),sce(e)}var cce=M(28,e=>{A3(e),M3(e)}),z3=N(24,e=>cce(e,J3(e)),2),lce=M(30,A3),B3=N(22,e=>lce(e,Y3(e))),uce=M(21,e=>{z3(e),B3(e),k3(e),A3(e)}),dce=M(23,e=>{z3(e),k3(e),A3(e),M3(e)}),fce=M(26,A3),pce=M(27,A3),V3=M(11,z3),H3=M(12,e=>{B3(e),A3(e)}),U3=M(13,k3),W3=M(14,A3),G3=M(15,e=>{B(e.b,[`_eI`,e.p===`keybar`?`_eQ`:`_eK`]),j3(e)});function K3(e){return function(t){e.q&&(L3(e,t),e.x=t,e.a2(0))}}function q3(e){return()=>{let t=e.c;t&&(t.focus(),document.activeElement!==t&&setTimeout(()=>t.focus(),0))}}function J3(e){return t=>{if(!e.v)return;let n=e.l;n&&n(e.x,t)}}function Y3(e){return()=>{N3(e,!1),e.v=!1;let t=e.m;t&&t()}}R(`u0`,K3),R(`u3`,q3),R(`u1`,J3),R(`u2`,Y3);var mce=Ur,hce=(e=>`/${e}&`)(Wr);function gce(e){Jr(e.a,`M8 6L20 6 M4 6.01L4.01 5.99889 M4 12.01L4.01 11.9989 M4 18.01L4.01 17.9989 M8 12L20 12 M8 18L20 18`)}var _ce=(e,t)=>Kr(e.a,t),vce=(e,t)=>qr(e.a,t),yce=Ur,bce=(e=>`/${e}&`)(Wr);function xce(e){Jr(e.a,`M15 4L8 20`)}var Sce=(e,t)=>Kr(e.a,t),Cce=(e,t)=>qr(e.a,t),wce=Ur,Tce=(e=>`/${e}&`)(Wr);function Ece(e){Jr(e.a,`M7 12L17 12 M7 8L13 8 M3 20.2895V5C3 3.89543 3.89543 3 5 3H19C20.1046 3 21 3.89543 21 5V15C21 16.1046 20.1046 17 19 17H7.96125C7.35368 17 6.77906 17.2762 6.39951 17.7506L4.06852 20.6643C3.71421 21.1072 3 20.8567 3 20.2895Z`)}var Dce=(e,t)=>Kr(e.a,t),Oce=(e,t)=>qr(e.a,t),kce=Ur,Ace=(e=>`/${e}&`)(Wr);function jce(e){Jr(e.a,`M8.5 4H6C4.89543 4 4 4.89543 4 6V20C4 21.1046 4.89543 22 6 22H18C19.1046 22 20 21.1046 20 20V6C20 4.89543 19.1046 4 18 4H15.5 M8 6.4V4.5C8 4.22386 8.22386 4 8.5 4C8.77614 4 9.00422 3.77604 9.05152 3.50398C9.19968 2.65171 9.77399 1 12 1C14.226 1 14.8003 2.65171 14.9485 3.50398C14.9958 3.77604 15.2239 4 15.5 4C15.7761 4 16 4.22386 16 4.5V6.4C16 6.73137 15.7314 7 15.4 7H8.6C8.26863 7 8 6.73137 8 6.4Z`)}var Mce=(e,t)=>Kr(e.a,t),Nce=(e,t)=>qr(e.a,t),Pce=`<div><div></div><!><!><!><!><!></div><!><!>`,Fce=` D b%b%b%b%b%l%c`,Ice=400,Lce=55,X3=3e4,Rce=150,zce=[[{kind:`paste`},{kind:`key`,label:`▲`,seq:`\x1B[A`},{kind:`key`,label:`⇥`,seq:` `}],[{kind:`key`,label:`◀`,seq:`\x1B[D`},{kind:`key`,label:`↵`,seq:`\r`},{kind:`key`,label:`▶`,seq:`\x1B[C`}],[{kind:`esc`},{kind:`key`,label:`▼`,seq:`\x1B[B`},{kind:`key`,label:`^C`,seq:``}]],Bce=L(`v26`,e=>A(e.a,`click`,function(){S6(e._._._,e._._.d),C6(e._._._,e._._.i||e._._.h)})),Vce=e=>{B(e.a,[`_es`,`_et`]),ql(e.b),Jl(e.b,12),Yl(e.b),Bce(e)},Z3=I(6,e=>jt(e,`c`,e._._.c,u8(e)),e=>e._._),Hce=L(`v25`,e=>{Mt(e,`c`),A(e.c,`keydown`,function(t){t.key===`Enter`?(t.preventDefault(),e._._.e(e._.d)):t.key===`Escape`&&(t.preventDefault(),S6(e._._,null))}),A(e.c,`blur`,function(){e._._.e(e._.d)}),Tt(e,{onMount:function(){queueMicrotask(()=>{let t=e.c;t?.focus(),t?.select()})}})}),Uce=e=>{Z3(e),Q3._(e),$3._(e),e.b,gi(e.b,14),vi(e.b),B(e.c,`_eq`),Hce(e)},Q3=P(0,0,e=>B(e.a,[`_o`,Yt[Hr(e._.g)]])),$3=P(0,0,e=>_i(e.b,e._.h)),Wce=e=>B(e.a,`_ea`),Gce=e=>B(e.a,`_eb`),Kce=L(`v32`,e=>{A(e.a,`pointerdown`,function(e){e.preventDefault()}),A(e.a,`click`,function(){e._._._._.bc()})}),qce=e=>{jce(e.b),Mce(e.b,16),Nce(e.b),Kce(e)},Jce=P(0,2,e=>{B(e.a,[`_eB`,{_eD:e._.e===`↵`,_eC:e._.e===`↵`||e._.e===`⇥`}]),V(e.b,e._.e)}),Yce=L(`v35`,e=>{A(e.a,`pointerdown`,function(t){t.preventDefault(),e._._._._.b6(e._.f)}),A(e.a,`pointerup`,function(){e._._._._.b7()}),A(e.a,`pointercancel`,function(){e._._._._.b7()}),A(e.a,`pointerleave`,function(){e._._._._.b7()}),A(e.a,`contextmenu`,function(e){e.preventDefault()})}),Xce=e=>{Jce._(e),Yce(e)},Zce=I(91,L(`v33`,e=>A(e.a,`click`,function(){e._._._._.ae?.send(`\x1B`)})),e=>e._._._._),Qce=L(`v34`,e=>A(e.a,`pointerdown`,function(e){e.preventDefault()})),$ce=O(0,(e=>`<button title=Paste>${e}</button>`)(kce),(e=>` D/${e}&l`)(Ace),qce,`<button title=Escape>esc</button>`,` `,e=>{Zce(e),B(e.a,`_eE`),Qce(e)},`<button> </button>`,` D `,Xce),ele=(e,t)=>$ce(e,t===`paste`?0:t===`esc`?1:2),tle=(e,t)=>{ele(e,t[0]?.kind),nle(e,t[0]?.label),rle(e,t[0]?.seq)},nle=M(4),rle=M(5),ile=k(0,`<!><!><!>`,`b%`,0,tle),ale=(e,t)=>ile(e,[t]),ole=(e,t)=>ale(e,t[0]),e6=I(88,e=>F3(e.a,e._._.a9),e=>e._._),sle=e=>{e6(e),cle(e),t6(e),lle(e),ule(e),dle(e),fle(e),R3(e.a),G3(e.a,`keybar`)},cle=I(89,e=>I3(e.a,e._._.ab),e=>e._._),t6=I(90,e=>W3(e.a,e._._.ac),e=>e._._),n6=N(1,e=>H3(e.a,d8(e))),lle=I(91,n6,e=>e._._),ule=I(92,e=>U3(e.a,e._._.al),e=>e._._),dle=I(93,e=>V3(e.a,f8(e)),e=>e._._),fle=I(94,n6,e=>e._._),r6=P(2,0,e=>F3(e.a,e._.a9)),ple=e=>{r6._(e),mle._(e),i6._(e),hle._(e),gle._(e),_le._(e),vle._(e),R3(e.a),G3(e.a,`overlay`)},mle=P(2,0,e=>I3(e.a,e._.ab)),i6=P(2,0,e=>W3(e.a,e._.ac)),a6=N(1,e=>H3(e.a,p8(e))),hle=P(2,0,a6),gle=P(2,0,e=>U3(e.a,e._.al)),_le=P(2,0,e=>V3(e.a,m8(e))),vle=P(2,0,a6),o6=P(6,0,L(`v23`,e=>{e._.a8&&setTimeout(()=>e.d?.focus(),50)})),yle=L(`v24`,e=>{A(e.a,`click`,function(){n8(e._,!1)}),A(e.b,`click`,function(e){e.stopPropagation()}),A(e.d,`paste`,function(t){t.preventDefault(),e._.bb(t.clipboardData)}),A(e.e,`click`,function(){n8(e._,!1)})}),ble=e=>{o6._(e),B(e.a,`_ec`),B(e.b,`_ed`),B(e.c,`_l`),B(e.e,`_d`),yle(e)},xle=L(`v22`,e=>A(e.b,`click`,function(){K6(e._,!1)})),Sle=e=>{B(e.a,`_d9`),B(e.b,[`_d`,`_e`]),xle(e)},s6=I(85,e=>V(e.c,e._._.a1),e=>e._._),Cle=e=>{s6(e),B(e.a,`_ew`),B(e.b,`_ex`)},wle=L(`v29`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._._._.s?.(e.d)})),Tle=e=>{B(e.a,tce),e.b,gi(e.b,15),vi(e.b),wle(e)},Ele=M(3,e=>{z(e.a,`title`,`New ${e.d} session`),_i(e.b,e.d)}),Dle=(e,t)=>Ele(e,t[0]),c6=N(1,e=>{B(e.a,[`_es`,{_er:e._._._._.g===e._._.d}]),z(e.a,`title`,e._._._._.g===e._._.d?`Really kill this session?`:`Kill session`)}),l6=I(9,c6,e=>e._._._._),Ole=L(`v27`,e=>A(e.a,`click`,function(t,n){e._._._._.g===e._._.d?(E6(e._._._._,null),n.closest(`[popover]`)?.hidePopover(),e._._._._._._.z?.(e._._.d)):E6(e._._._._,e._._.d)})),kle=e=>{l6(e),u6(e),Ole(e)},u6=I(9,c6,e=>e._._),Ale=O(5,(e=>`<button title="Rename session">${e}</button>`)(Gl),(e=>` D/${e}&l`)(Kl),Vce),d6=I(82,e=>Ale(e,+!e._._._._._.y),e=>e._._._._._),jle=L(`v28`,e=>A(e.a,`click`,function(t,n){n.closest(`[popover]`)?.hidePopover(),e._.d!==e._._._._._.u&&e._._._._._.t?.(e._.d)})),Mle=e=>{d6(e),f6(e),p6._(e),h6._(e),g6._(e),B(e.a,`_eo`),e.c,gi(e.c,14),vi(e.c),B(e.d,`_ep`),jle(e)},Nle=O(6,`<button>×</button>`,` `,kle),f6=I(83,e=>Nle(e,+!e._._._._._.z),e=>e._._._._._),p6=P(0,1,e=>B(e.b,[`_o`,Yt[Hr(e._.g)]])),m6=N(7,e=>V(e.e,e._.i||e._.h)),h6=P(0,1,e=>{_i(e.c,e._.h),m6(e)}),g6=P(0,1,m6),_6=N(4,e=>B(e.a,[`_en`,{_em:e.d===e._._._._.u}])),v6=I(78,_6,e=>e._._._._),Ple=e=>{v6(e),y6._(e)},Fle=O(0,(e=>`<span></span>${e}<input aria-label="Session name">`)(ui),(e=>` b/${e}& b`)(`b%c`),Uce,(e=>`<button><span></span>${e}<span> </span></button><!><!><!>`)(ui),(e=>` D b/${e}& D m%b%c`)(`b%c`),Mle),y6=Je(0,1,3,e=>Fle(e,e._.b===e.d?0:1)),Ile=F(u6),Lle=M(3,e=>{_6(e),Ile(e)}),Rle=(e,t)=>{Lle(e,t[0]?.id),zle(e,t[0]?.state),Ble(e,t[0]?.agent),Vle(e,t[0]?.title)},zle=M(6,e=>{p6(e),Q3(e)}),Ble=M(7,e=>{h6(e),$3(e)}),Vle=M(8,g6),Hle=k(0,`<div></div>`,` `,Ple,Rle),b6=I(81,e=>Hle(e,[e._._._.x||[],`id`]),e=>e._._._),Ule=M(4),x6=N(3,e=>Ule(e,h8(e)),2),S6=j(1,e=>{x6(e),y6(e)}),Wle=F(Z3),C6=j(2,e=>{x6(e),Wle(e)}),Gle=e=>{b6(e),w6(e),S6(e,null),C6(e,``)},w6=I(82,x6,e=>e._._._),T6=I(79,e=>_i(e.b,e._._.v||`shell`),e=>e._._),E6=j(6,F(l6)),D6=N(8,e=>z(e.a,`popovertarget`,e._._.at?e.h:void 0)),Kle=M(7,e=>{z(e.d,`id`,e.h),D6(e)}),qle=L(`v30`,e=>A(e.d,`toggle`,function(t,n){if(E6(e,null),t.newState===`open`){let t=e.a.getBoundingClientRect();n.style.top=`${Math.max(8,t.top-n.offsetHeight-8)}px`,n.style.left=`${Math.max(8,Math.min(t.left+t.width/2-n.offsetWidth/2,window.innerWidth-n.offsetWidth-8))}px`}})),Jle=e=>{T6(e),O6(e),k6(e),A6(e),j6(e),B(e.a,[T3,`_ej`]),e.b,gi(e.b,16),vi(e.b),B(e.d,`_el`),E6(e,null),Kle(e,$e(e)),qle(e)},O6=I(80,e=>B(e.c,[`_o`,`_ek`,Yt[Hr(e._._.w)]]),e=>e._._),Yle=O(4,`<!><!><!>`,`b%`,Gle),k6=I(81,e=>{B(e.f,[`_ev`,{_eu:(e._._.x||[]).length<=1}]),Yle(e,(e._._.x||[]).length>1?0:1)},e=>e._._),Xle=k(5,(e=>`<button>${e}</button>`)(ui),(e=>` D/${e}&l`)(`b%c`),Tle,Dle),A6=I(84,e=>Xle(e,[[...e._._.a0||[],`shell`],e=>e]),e=>e._._),Zle=L(`v31`,e=>A(e.a,`click`,!e._._.at&&(()=>{e._._.t?.(e._._.u)}))),j6=I(95,e=>{z(e.a,`title`,e._._.at?`Sessions`:`Back to session`),D6(e),Zle(e)},e=>e._._),Qle=nt(`v21`,19),M6=N(23,e=>B(e.d,[`_eg`,{_eh:e._.a9||!!e._.l&&e._.k===`diff`}]),2),N6=N(24,e=>{z(e.o,`title`,e._.ay?`Close find`:e._.aw?e._.k===`diff`?`Find in the review`:`Find in terminal`:`Find unavailable on this page`),z(e.o,`aria-label`,e._.ay?`Close find`:e._.aw?e._.k===`diff`?`Find in the review`:`Find in terminal`:`Find unavailable on this page`)},2),P6=P(7,0,e=>{B(e.e,[T3,{_ey:e._.k===`nav`}]),z(e.e,`aria-pressed`,e._.k===`nav`?`true`:`false`),B(e.g,[T3,{_ey:e._.k===`manage`}]),z(e.g,`aria-pressed`,e._.k===`manage`?`true`:`false`),B(e.i,[T3,{_ey:e._.k===`diff`}]),z(e.i,`title`,e._.k===`diff`?`Back to terminal`:`Review changes`),z(e.i,`aria-pressed`,e._.k===`diff`?`true`:`false`),M6(e),N6(e)}),$le=M(19,e=>z(e.m,`aria-controls`,e.t)),eue=(e,t)=>cue(e,t.open),tue=k(18,`<!><!><!>`,`b%`,0,ole),nue=L(`v38`,e=>{A(e.e,`click`,function(){e._.o?.()}),A(e.g,`click`,function(){e._.p?.()}),A(e.i,`click`,function(){e._.k===`diff`?e._.q?.():e._.r?.()}),A(e.o,`click`,function(){e._.az()}),A(e.q,`pointerdown`,function(e){e.preventDefault()}),A(e.s,`pointerdown`,function(e){e.preventDefault()}),A(e.s,`toggle`,function(t,n){t.newState===`open`&&requestAnimationFrame(()=>{let t=e.m?.getBoundingClientRect();t&&(n.style.bottom=`auto`,n.style.right=`0.5rem`,n.style.left=`auto`,n.style.top=`${Math.max(8,t.top-n.offsetHeight-8)}px`)})})}),rue=e=>{P6._(e),F6._(e),I6._(e),L6._(e),z6._(e),B6._(e),oue._(e),V6._(e),H6._(e),U6._(e),B(e.a,`_ee`),B(e.b,`_ef`),gce(e.f),_ce(e.f,16),vce(e.f),ni(e.h),ri(e.h,16),ii(e.h),Zr(e.j),Qr(e.j,16),$r(e.j),B(e.k,`_ei`),B(e.m,T3),xce(e.n),Sce(e.n,16),Cce(e.n),Zj(e.p),Qj(e.p,16),$j(e.p),Ece(e.r),Dce(e.r,16),Oce(e.r),z(e.s,`id`,Qle(e)),B(e.s,`_eA`),$le(e,$e(e)),eue(e,{open:!1}),tue(e,[zce]),nue(e)},F6=P(7,0,M6),iue=O(10,(e=>`<button>${e}<span></span></button><div popover=auto><!><div></div></div>`)(ui),(e=>` D/${e}& l D%b l`)(`b%c`),Jle),I6=P(7,0,e=>iue(e,+!e._.s)),aue=O(11,`<span aria-hidden=true><span> </span></span>`,` D D `,Cle),L6=P(7,0,e=>aue(e,+!e._.a1)),R6=N(22,e=>z(e.q,`title`,e._.aw?e._.a4?`Hide keyboard`:`Show keyboard`:`Keyboard unavailable on this page`)),z6=P(7,0,e=>{B(e.q,[T3,{_ey:e._.a4}]),R6(e)}),B6=P(7,0,M6),oue=P(7,0,L(`v36`,e=>A(e.q,`click`,function(){Z6(e._,!e._.a4),e._.ae?.setKeyboard(e._.a4)}))),sue=O(2,E3,(e=>`/${e}&`)(D3),sle),V6=P(7,0,e=>sue(e,+!e._.at)),H6=P(7,0,e=>{z(e.m,`title`,e._.aw?`More keys`:`Keys unavailable on this page`),z(e.m,`disabled`,!e._.aw),z(e.o,`disabled`,!e._.aw),z(e.q,`disabled`,!e._.aw),N6(e),R6(e)}),U6=P(7,0,e=>{B(e.o,[T3,{_ey:e._.ay}]),z(e.o,`aria-pressed`,e._.ay?`true`:`false`),N6(e)}),cue=M(21,L(`v37`,e=>{A(e.m,`pointerdown`,function(t){t.preventDefault(),e.v=!!e.s?.matches(`:popover-open`)}),A(e.m,`click`,function(){let t=e.s;t&&(e.v?t.hidePopover():t.showPopover())})})),W6=nt(`v20`,1),lue=tt(69),uue=O(5,`<div><button>Reconnect</button></div>`,` D `,Sle),G6=N(72,L(`v39`,e=>Tt(e,{onMount:function(){let t=new AbortController,n=t.signal,r=new $$({fontSize:13,fontFamily:`ui-monospace, monospace`,scrollback:0,overviewRuler:{width:0},allowProposedApi:!0,rightClickSelectsWord:!0,macOptionClickForcesSelection:!0,theme:{selectionBackground:`#ffb000`,selectionInactiveBackground:`#ffb000`,selectionForeground:`#000000`},linkHandler:{activate(e,t){$n(t)}}}),i=new gse;r.loadAddon(i),r.open(e.b);let a=Xn();try{let e=new pse;e.onContextLoss(()=>e.dispose()),r.loadAddon(e)}catch{}try{r.loadAddon(new Tse(void 0,{readText:()=>navigator.clipboard.readText().catch(()=>``),writeText:(e,t)=>Kh(t).then(()=>{})}))}catch{}r.loadAddon(new Nse((e,t)=>$n(t)));let o=Wse(r,e.b);e.ai=o;let s=r.onScroll(()=>e.an()),c=r.onWriteParsed(()=>e.an());e.b.addEventListener(`wheel`,()=>e.an(),{passive:!0,signal:n}),C3(r,i);let l=$se(r),u=ece(r,W6(e));n.addEventListener(`abort`,()=>{s.dispose(),c.dispose(),l.dispose(),u.dispose(),e.ap(),o.dispose(),e.ai=null});let d=a?Ise(r):null,f=d?d.write:e=>r.write(e),p=Pse({sessionId:e.u,term:r,write:f,onDead:()=>{K6(e,!0)},isVisible:()=>!!e.a2},n),m={on:!1},h=e=>e.startsWith(`\x1B[<`)||e.startsWith(`\x1B[M`)||e.startsWith(`\x1B[>`);r.onData(e=>{m.on&&!h(e)||p.send(e)}),r.attachCustomKeyEventHandler(t=>m.on?!1:t.key===`Enter`&&t.shiftKey?(t.type===`keydown`&&p.send(`\x1B\r`),!1):(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()===`c`&&r.hasSelection()?(t.type===`keydown`&&Kh(r.getSelection()).then(t=>{t&&(r.clearSelection(),e.b2())}),!1):!((t.ctrlKey||t.metaKey)&&!t.shiftKey&&!t.altKey&&t.key.toLowerCase()===`f`||a&&t.type===`keydown`&&t.key===`Backspace`));let g=()=>{if(!e.b.clientWidth)return;let t=r.cols,n=r.rows;C3(r,i),(r.cols!==t||r.rows!==n)&&p.resize(r.cols,r.rows),w3(r,e.b),e.an()},_=new ResizeObserver(g);_.observe(e.b),n.addEventListener(`abort`,()=>_.disconnect());let v=()=>requestAnimationFrame(g);if(document.addEventListener(`visibilitychange`,()=>{document.hidden||v()},{signal:n}),window.addEventListener(`pageshow`,v,{signal:n}),window.addEventListener(`focus`,v,{signal:n}),window.visualViewport?.addEventListener(`resize`,v,{signal:n}),window.addEventListener(`keydown`,t=>{e.a2&&(e.k==null||e.k===`term`)&&(t.metaKey||t.ctrlKey)&&!t.shiftKey&&!t.altKey&&t.key.toLowerCase()===`f`&&(t.preventDefault(),t.stopPropagation(),e.aq())},{capture:!0,signal:n}),e.b.addEventListener(`paste`,t=>{let n=[...t.clipboardData?.files||[]];if(n.length){t.preventDefault(),t.stopImmediatePropagation();for(let t of n)e.b8(t)}},{capture:!0,signal:n}),e.ae={send(e){m.on||p.send(e)},setKeyboard(e){if(m.on&&e)return;let t=r.textarea;t&&(t.inputMode=e?`text`:`none`,e?(t.focus(),setTimeout(()=>{document.activeElement!==t&&t.focus()},50)):t.blur())},setFindMode(e){m.on=e;let t=r.textarea;t&&(e?(t.inputMode=`none`,t.readOnly=!0,t.blur()):(t.readOnly=!1,a||(t.inputMode=`text`)))}},a){r.textarea&&(r.textarea.inputMode=`none`);let t=window.visualViewport;if(t){let i=0,a=()=>{i=Math.max(i,t.height),e.a4&&i-t.height<Rce&&(Z6(e,!1),r.textarea&&(r.textarea.inputMode=`none`))};a(),t.addEventListener(`resize`,a,{signal:n}),window.addEventListener(`orientationchange`,()=>{i=0},{signal:n})}let i=Vse(r,W6(e),{onStart(){d?.setFrozen(!0)},onEnd(){d?.setFrozen(!1)},onCopy(){e.b2()}},n);Fse(r,W6(e),n,i.selecting),Lse(r,e=>{m.on||p.send(e)},n)}else Use(r,W6(e),()=>e.b2(),n);e.a2&&!a&&r.focus();let y={term:r,socket:p,abort:t,suspend:void 0};return e.a2||(y.suspend=setTimeout(()=>p.disconnect(),X3)),y},onUpdate:function(){clearTimeout(this.suspend),this.socket.syncVisibility(),e.a2?(!e.a3&&this.socket.readyState>=WebSocket.CLOSING&&(this.term.reset(),this.socket.reconnect()),!e.a3&&!e.a5&&this.term.focus()):this.suspend=setTimeout(()=>this.socket.disconnect(),X3)},onDestroy:function(){clearTimeout(this.suspend),this.abort.abort(),this.term.dispose()}})),12),K6=j(29,e=>{uue(e,+!e.a3),G6(e)}),due=M(61),q6=N(59,e=>due(e,g8(e)),4),fue=M(54,q6),J6=N(53,e=>fue(e,_8(e)),3),pue=M(52,e=>{J6(e),G6(e)}),Y6=N(48,e=>pue(e,v8(e)),3),X6=N(57,L(`v40`,e=>{e.at||(e.a9&&(i8(e,!1),e.ap(),e.ae?.setFindMode(!1)),e.a4&&(Z6(e,!1),e.ae?.setKeyboard(!1)))}),4),Z6=j(30,e=>{Y6(e),X6(e),G6(e),z6(e)}),mue=O(7,((e,t,n,r,i,a)=>`<div><div><!><div><button title=Workspaces>${e}</button><button title="Manage workspace">${t}</button><button>${n}</button><div></div><!><button aria-haspopup=dialog>${r}</button><button>${i}</button><button>${a}</button></div><div popover=auto></div></div></div>`)(mce,ei,Yr,yce,Yj,wce),((e,t,n,r,i,a)=>` D D%b D D/${e}&l D/${t}&l D/${n}&l b%b D/${r}&l D/${i}&l D/${a}&m m`)(hce,ti,Xr,bce,Xj,Tce),rue),hue=O(2,E3,(e=>`/${e}&`)(D3),ple),Q6=N(36,e=>hue(e,!e.a5&&e.a9?0:1)),$6=j(31,e=>{mue(e,+!e.a5),Q6(e),G6(e)}),gue=O(3,`<div>uploading…</div>`,` `,Gce),e8=j(32,e=>gue(e,+!e.a6)),_ue=O(4,`<div>Copied</div>`,` `,Wce),t8=j(33,e=>_ue(e,+!e.a7)),vue=O(6,`<div><div><p>Long-press below and choose Paste</p><input placeholder="Paste here…"><button>Cancel</button></div></div>`,` D D b b `,ble),n8=j(34,e=>{vue(e,+!e.a8),o6(e)}),yue=M(60,U6),r8=N(56,e=>yue(e,e.at?e.a9:e.k===`diff`&&!!e.l),3),bue=F(e6),i8=j(35,e=>{J6(e),r8(e),X6(e),Q6(e),B6(e),r6(e),bue(e)}),xue=M(37),Sue=F(t6),a8=j(38,e=>{Y6(e),i6(e),Sue(e)}),Cue=(e,t)=>Pue(e,t.current),wue=(e,t)=>{Rue(e,t.query),zue(e,t.overlay),Bue(e,t.refreshTimer)},Tue=M(47,Y6),Eue=(e,t)=>Yue(e,t.timer),Due=(e,t)=>Zue(e,t.current),Oue=L(`v41`,e=>{$6(e,Xn()),A(e.a,`dragover`,function(e){e.preventDefault()}),A(e.a,`drop`,function(t){t.preventDefault();for(let n of t.dataTransfer?.files||[])e.b8(n)})});function kue(e){B(e.a,`_d3`),B(e.b,`_d4`),K6(e,!1),Z6(e,!1),$6(e,!1),e8(e,!1),t8(e,!1),n8(e,!1),i8(e,!1),xue(e,y8(e)),a8(e,0),Cue(e,{current:null}),wue(e,{overlay:null,query:``,refreshTimer:0}),Tue(e,{focus:b8}),Eue(e,{timer:0}),Due(e,{current:null}),Oue(e)}var Aue=M(68),o8=N(67,e=>Aue(e,x8(e))),jue=M(73),Mue=M(74),s8=N(71,e=>{jue(e,S8(e)),Mue(e,C8(e))}),Nue=M(70,e=>{s8(e),G6(e)}),c8=N(41,e=>Nue(e,w8(e))),Pue=M(40,e=>{Y6(e),J6(e),o8(e),c8(e),s8(e),X6(e),G6(e)}),Fue=M(49,G6),Iue=M(50),Lue=M(51,e=>{J6(e),X6(e),G6(e)}),l8=N(46,e=>{Fue(e,T8(e)),Iue(e,E8(e)),Lue(e,D8(e))},2),Rue=M(43,l8),zue=M(44,e=>{l8(e),G6(e)}),Bue=M(45,l8),Vue=F(j6),Hue=M(55,e=>{z(e.a,`hidden`,!e.at),r8(e),q6(e),X6(e),V6(e),Vue(e)}),Uue=M(58,e=>{q6(e),H6(e)}),Wue=e=>{Uue(e,e.at||e.k===`diff`)},Gue=M(10,e=>{Hue(e,e.k==null||e.k===`term`),Wue(e),r8(e),q6(e),G6(e),P6(e)}),Kue=M(11,e=>{r8(e),F6(e)}),que=M(12,q6),Jue=M(64,G6),Yue=M(63,e=>Jue(e,O8(e))),Xue=M(69),Zue=M(66,e=>{Xue(e,k8(e)),o8(e)}),Que=M(13,c8),$ue=F(v6),ede=M(20,e=>{G6(e),$ue(e)}),tde=M(28,G6),nde=M(14),rde=M(15),ide=M(16),ade=M(17),ode=M(18,I6),sde=M(19),cde=M(21,F(T6)),lde=M(22,F(O6)),ude=M(23,F(k6,b6)),dde=M(24,F(w6,d6)),fde=M(25,F(f6)),pde=M(26,F(A6)),mde=F(s6),hde=M(27,e=>{L6(e),mde(e)});function u8(e){return t=>{C6(e._._,t)}}function d8(e){return function(){e._._.ap(),e._._.ae?.setFindMode(!1)}}function f8(e){return function(t,n){e._._.ao(t,n)}}function p8(e){return function(){e._.ap(),e._.ae?.setFindMode(!1)}}function m8(e){return function(t,n){e._.ao(t,n)}}function h8(e){return t=>{if(e.b!==t)return;let n=e.c.trim();S6(e,null),n&&e._._._.y?.(t,n)}}function g8(e){return()=>{if(e.aw){if(e.at){e.as();return}e.k===`diff`&&e.m?.()}}}function _8(e){return()=>{if(e.a9){i8(e,!1),e.ap(),e.ae?.setFindMode(!1);return}e.aq()}}function v8(e){return()=>{e.a4&&(Z6(e,!1),e.ae?.setKeyboard(!1)),e.ae?.setFindMode(!0),i8(e,!0),a8(e,e.ac+1),e.al.focus()}}function y8(e){return t=>{i8(e,t)}}function b8(){}function x8(e){return t=>{lue(e)(),e.ae?.send(t);let n={};n.delay=setTimeout(()=>{n.repeat=setInterval(()=>e.ae?.send(t),Lce)},Ice),e.b4=n}}function S8(e){return async t=>{let n=[...t?.files||[]];for(let t of n)await e.b8(t);if(!n.length){let n=t?.getData(`text/plain`);n&&e.ae?.send(n)}n8(e,!1)}}function C8(e){return async()=>{if(!navigator.clipboard?.read){n8(e,!0);return}try{for(let t of await navigator.clipboard.read()){let n=t.types.find(e=>e.startsWith(`image/`));if(n){let r=await t.getType(n);await e.b8(new File([r],`pasted.${n.split(`/`)[1]||`png`}`,{type:n}))}else if(t.types.includes(`text/plain`)){let n=await(await t.getType(`text/plain`)).text();n&&e.ae?.send(n)}}}catch{n8(e,!0)}}}function w8(e){return async t=>{if(t){e8(e,!0);try{let n=await(await fetch(`/api/workspaces/${e.n}/assets?name=${encodeURIComponent(t.name||`pasted.png`)}`,{method:`POST`,body:t})).json();n.path&&e.ae?.send(`${n.path} `)}finally{e8(e,!1)}}}}function T8(e){return()=>{!e.ah.trim()||!e.ai||(e.aj&&clearTimeout(e.aj),e.aj=setTimeout(()=>{e.aj=0,e.ai?.refresh()},32))}}function E8(e){return(t,n)=>{let r=e.ai;if(r){if(e.ah=t,e.aj&&=(clearTimeout(e.aj),0),!t.trim()){r.clear();return}r.search(t,n)}}}function D8(e){return()=>{e.aj&&=(clearTimeout(e.aj),0),e.ah=``,e.ai?.clear()}}function O8(e){return()=>{clearTimeout(e.b1),t8(e,!0),e.b1=setTimeout(()=>{t8(e,!1)},1200)}}function k8(e){return()=>{let t=e.b4;t&&(clearTimeout(t.delay),clearInterval(t.repeat),e.b4=null)}}R(`v0`,u8),R(`v18`,d8),R(`v17`,f8),R(`v16`,p8),R(`v15`,m8),R(`v19`,h8),R(`v8`,g8),R(`v7`,_8),R(`v6`,v8),R(`v1`,y8),R(`v2`,b8),R(`v10`,x8),R(`v13`,S8),R(`v14`,C8),R(`v12`,w8),R(`v3`,T8),R(`v4`,E8),R(`v5`,D8),R(`v9`,O8),R(`v11`,k8);var gde=(e=>`<div><div>${e}</div><div><!><!><!><!><!><div></div></div></div>`)(Up),_de=(e=>` D D/${e}&l D%b%b%b%b%b m`)(Wp),vde=e=>B(e.a,`_R`),A8=I(101,e=>V(e.a,e._._.ag),e=>e._._),yde=ft(`y46`,` `,` `,A8),bde=e=>{Or(e.a),Mr(e.a,yde(e)),Ir(e.a,Z5(e)),Fr(e.a),Tr(e.a),br(e.a),wr(e.a),Ar(e.a),Dr(e.a,{})},xde=de(3,0,2),j8=P(7,0,e=>xde(e,e._.a3===`usage`)),Sde=e=>{j8._(e),uK(e.b)},M8=N(4,e=>V(e.d,e._._.ah?`Starting…`:`Start ${e._._.r||`claude`}`)),N8=I(89,M8,e=>e._._),Cde=L(`y47`,e=>A(e.c,`click`,function(){e._._.bc(e._._.r||`claude`,!0)})),wde=e=>{N8(e),P8(e),B(e.a,`_S`),B(e.b,`_l`),B(e.c,[`_d`,`_e`]),Cde(e)},P8=I(102,e=>{z(e.c,`disabled`,e._._.ah),M8(e)},e=>e._._),F8=N(8,e=>tde(e.b,e._._.o&&e._._.a3===`term`&&e.g===e._._.b4),3),I8=I(88,F8,e=>e._._),Tde=e=>{I8(e),L8(e),R8(e),z8(e),V8(e),H8(e),U8(e),G8(e),K8(e),q8(e),J8(e),Y8(e),kue(e.b),sde(e.b,n7(e)),ade(e.b,t7(e)),ide(e.b,e7(e)),nde(e.b,$5(e)),rde(e.b,Q5(e))},L8=I(92,e=>pde(e.b,e._._.u),e=>e._._),R8=I(95,e=>{Gue(e.b,e._._.a3),F8(e)},e=>e._._),z8=I(96,e=>Kue(e.b,e._._.a9),e=>e._._),B8=N(11,e=>ode(e.b,r7(e))),V8=I(104,e=>{Que(e.b,e._._.aj),B8(e)},e=>e._._),H8=I(106,e=>hde(e.b,e._._.ap),e=>e._._),U8=I(107,e=>ude(e.b,e._._.b1),e=>e._._),Ede=de(3,0,2),W8=N(7,e=>Ede(e,e.g===e._._.b4)),G8=I(109,e=>{F8(e),W8(e)},e=>e._._),K8=I(110,e=>que(e.b,i7(e)),e=>e._._),q8=I(112,e=>fde(e.b,a7(e)),e=>e._._),J8=I(113,e=>dde(e.b,o7(e)),e=>e._._),Y8=I(114,B8,e=>e._._),Dde=M(6,e=>{ede(e.b,e.g),F8(e),W8(e)}),Ode=(e,t)=>lde(e.b,t),kde=(e,t)=>cde(e.b,t),Ade=k(0,(e=>`<!><!>${e}<!><!><!>`)(Pce),(e=>`b%b/${e}&%b%c`)(Fce),Tde,(e,t)=>{Dde(e,t[0]?.id),Ode(e,t[0]?.state),kde(e,t[0]?.agent)}),X8=P(9,0,e=>Ade(e,[e._.b1,`id`])),jde=e=>{X8._(e),Z8._(e)},Mde=O(1,`<div><p>No sessions in this workspace.</p><button> </button></div>`,` D b D `,wde),Z8=P(9,0,e=>Mde(e,+!!e._.b3)),Q8=N(4,e=>_l(e.b,s7(e)),2),$8=P(8,0,Q8),Nde=e=>{$8._(e),e5._(e),t5._(e),n5._(e),r5._(e),i5._(e),ol(e.b),bl(e.b,c7(e))},e5=P(8,0,e=>ml(e.b,e._.t||[])),t5=P(8,0,Q8),n5=P(8,0,e=>vl(e.b,l7(e))),Pde=de(3,0,2),r5=P(8,0,e=>Pde(e,e._.a3===`new`)),i5=P(8,0,Q8),a5=P(6,0,e=>XW(e.b,u7(e))),Fde=e=>{a5._(e),o5._(e),s5._(e),CW(e.b),ZW(e.b,d7(e))},Ide=de(3,0,2),o5=P(6,0,e=>Ide(e,e._.a3===`manage`)),s5=P(6,0,e=>YW(e.b,e._.ai)),c5=N(4,e=>GV(e.b,e._.o&&e._.a3===`diff`)),l5=P(5,0,c5),Lde=e=>{l5._(e),u5._(e),d5._(e),f5._(e),zde._(e),p5._(e),m5._(e),h5._(e),g5._(e),_5._(e),sV(e.b),mV(e.b,m7(e)),nH(e.b,p7(e)),iH(e.b,f7(e))},Rde=de(3,0,2),u5=P(5,0,e=>{Rde(e,e._.a3===`diff`),c5(e)}),d5=P(5,0,e=>pV(e.b,e._.a9)),f5=P(5,0,e=>xV(e.b,e._.ab)),zde=P(5,0,e=>CV(e.b,e._.ac)),p5=P(5,0,e=>UV(e.b,e._.ae)),m5=P(5,0,e=>KV(e.b,e._.af)),h5=P(5,0,e=>HV(e.b,e._.aj)),g5=P(5,0,e=>sH(e.b,e._.ao)),_5=P(5,0,e=>oH(e.b,e._.b1||[])),Bde=F(J8),Vde=M(85,e=>{Pne(e.c,h7(e)),Bde(e)}),Hde=O(9,`<!><!><!><!>`,`b%b%`,jde,`<p>Loading sessions…</p>`,` `,vde),Ude=F(G8),Wde=M(66,e=>{Zte(e.c,e.b4),Ude(e)}),v5=N(64,e=>Wde(e,(()=>{if(e.a1&&e.b1?.some(t=>t.id===e.a1))return e.a1;let t=Bn(e.aj);return t&&e.b1?.some(e=>e.id===t)?t:e.b1?.[0]?.id??null})()),2),Gde=F(U8),Kde=M(63,e=>{jne(e.c,e.b1),Dfe(e,e.b1?.length),Hde(e,+!e.b1),v5(e),_5(e),X8(e),Gde(e)}),y5=N(48,e=>Kde(e,e.a0??e.n?.[e.aj]?.sessions??null),2),b5=N(83,L(`y49`,e=>Tt(e,{active:e.o,load:e.bk,onMount:function(){let t=new AbortController,n=t.signal,r={abort:t,started:!1,stale:!1,timer:void 0,refresh:()=>{if(document.hidden){r.stale=!0;return}r.stale=!1,this.load(!1)},applySessions:t=>{D5(e,t);let n=Bn(e.aj);n&&t.some(e=>e.id===n)&&k5(e,n),t.some(t=>t.id===e.a1)||k5(e,t[0]?.id||null),r.stale=!1},mergeStatus:t=>{let n=t?.[e.aj]?.sessions;if(!n||!e.a0)return;let r=new Map(n.map(e=>[e.id,e.state]));D5(e,e.a0.map(e=>{let t=r.get(e.id);return t?{...e,state:t}:e}))},syncPoll:()=>{if(!this.active||fn()){r.stop();return}r.timer??=setInterval(r.refresh,15e3)},sync:()=>{this.active?(r.started||(r.started=!0,this.load(!0)),r.syncPoll()):r.stop()},stop:()=>{clearInterval(r.timer),r.timer=void 0}};return xn().addEventListener(`sessions.changed`,t=>{if(!r.started)return;let n=t.data;if(!(n?.workspaceId&&n.workspaceId!==e.aj)){if(Array.isArray(n?.sessions)){r.applySessions(n.sessions);return}r.refresh()}},{signal:n}),xn().addEventListener(`status.changed`,e=>{r.started&&r.mergeStatus(e.data)},{signal:n}),xn().addEventListener(`sse.health`,()=>{r.syncPoll()},{signal:n}),document.addEventListener(`visibilitychange`,()=>{!document.hidden&&r.stale&&r.refresh()},{signal:n}),En(()=>{if(!this.active)return;let t=On(e.aj);t&&e.aq(t.pr),Mn(e.aj)&&e.as();let n=An(e.aj);n&&(k5(e,n),R5(e,`term`))},n),r.sync(),r},onUpdate:function(){this.sync()},onDestroy:function(){this.abort.abort(),this.stop()}})),6),qde=M(82,b5),x5=N(81,e=>qde(e,_7(e)),2),Jde=M(80,x5),S5=N(78,e=>Jde(e,v7(e)),6),C5=N(87,e=>Dne(e.c,y7(e))),Yde=F(Y8),Xde=M(86,e=>{C5(e),Yde(e)}),w5=N(75,e=>Xde(e,b7(e)),2),Zde=M(74,e=>{S5(e),w5(e)}),T5=N(46,e=>Zde(e,x7(e))),Qde=M(84,F(q8)),E5=N(28,e=>Qde(e,S7(e))),D5=j(26,e=>{Vde(e,g7(e)),y5(e),T5(e),S5(e),E5(e),b5(e)}),O5=N(47,L(`y50`,e=>{e.a1&&Vn(e.aj,e.a1)})),k5=j(27,e=>{v5(e),S5(e),E5(e),O5(e),b5(e)}),$de=M(60),A5=N(72,e=>Sne(e.c,w7(e))),j5=N(73,e=>kne(e.c,T7(e))),efe=M(71,e=>{A5(e),C5(e),j5(e),i5(e)}),tfe=M(59),M5=N(58,e=>tfe(e,D7(e))),nfe=M(61),N5=N(55,e=>nfe(e,O7(e))),rfe=M(62),P5=N(53,e=>rfe(e,k7(e))),F5=N(30,L(`y54`,e=>{!e.o&&(e.a3===`nav`||e.a3===`manage`||e.a3===`usage`||e.a3===`new`)&&R5(e,`term`)})),I5=N(36,L(`y53`,e=>{e.a3!==`diff`&&e.a9&&W5(e,!1)})),L5=N(69,L(`y52`,e=>{e.o&&e.p&&!e.b6&&(e.b6=!0,H5(e,!0),R5(e,`new`)),e.p?e.b6&&e.a3!==`new`&&(e.b6=!1,e.q?.()):(e.b6=!1,e.a3===`new`&&R5(e,`term`))}),4),ife=F(R8),R5=j(29,e=>{B(e.a,[`_M`,{_L:e.a3===`nav`}]),one(e.c,e.a3),B(e.j,[`_Q`,{_P:e.a3!==`term`}]),$de(e,C7(e)),efe(e,E7(e)),M5(e),N5(e),P5(e),F5(e),I5(e),L5(e),u5(e),o5(e),r5(e),ife(e),j8(e)}),afe=O(5,(e=>`<!><!>${e}<!><!><!>`)(yP),(e=>`b%b/${e}&%b%c`)(bP),Lde),z5=j(31,e=>afe(e,+!e.a5)),ofe=O(6,(e=>`<!><!>${e}<!><!><!>`)(JH),(e=>`b%b/${e}&%b%c`)(YH),Fde),B5=j(32,e=>ofe(e,+!e.a6)),sfe=O(7,(e=>`<!><!>${e}<!><!><!>`)(mG),(e=>`b%b/${e}&%b%c`)(hG),Sde),V5=j(33,e=>sfe(e,+!e.a7)),cfe=O(8,(e=>`<!><!>${e}<!><!><!>`)(ic),(e=>`b%b/${e}&%b%c`)(ac),Nde),H5=j(34,e=>cfe(e,+!e.a8)),lfe=M(70,F(K8)),U5=N(39,e=>lfe(e,A7(e)),2),ufe=F(z8),W5=j(35,e=>{I5(e),U5(e),d5(e),ufe(e)}),G5=j(37,e=>{U5(e),f5(e)}),dfe=M(38,U5),K5=j(40,p5),q5=N(56,L(`y51`,e=>{if(e.o){let t=On(e.aj);t&&e.aq(t.pr),Mn(e.aj)&&e.as();let n=An(e.aj);n&&(k5(e,n),R5(e,`term`))}}),3),ffe=M(52,e=>{P5(e),q5(e),b5(e),j5(e)}),J5=j(41,e=>{ffe(e,M7(e)),m5(e)}),pfe=O(4,tr,(e=>`/${e}&`)(nr),bde),mfe=F(A8),Y5=j(42,e=>{pfe(e,+!e.ag),mfe(e)}),X5=j(43,F(P8)),hfe=M(54,e=>{N5(e),q5(e),b5(e)}),gfe=M(57,M5),_fe=(e,t)=>kfe(e,t.open),vfe=(e,t)=>{Ffe(e,t.wanted),Ife(e,t.run)};function yfe(e){B(e.b,`_N`),fne(e.c),Qte(e.c,V7(e)),sne(e.c,B7(e)),pne(e.c,z7(e)),Mne(e.c,R7(e)),Lne(e.c,L7(e)),bne(e.c,I7(e)),Ine(e.c,F7(e)),B(e.d,`_O`),D5(e,null),k5(e,null),R5(e,`term`),z5(e,!1),B5(e,!1),V5(e,!1),H5(e,!1),W5(e,!1),G5(e,0),dfe(e,{focus:j7}),K5(e,``),J5(e,0),Y5(e,null),X5(e,!1),hfe(e,N7(e)),gfe(e,P7(e)),_fe(e,{open:!1}),vfe(e,{wanted:!1,run:void 0})}var bfe=M(44,e=>{Yte(e.c,e.ai),Sfe(e,e.ai?.id),Cfe(e,e.ai?.status),wfe(e,e.ai?.branch),Tfe(e,e.ai?.name),s5(e)}),xfe=F(V8),Sfe=M(45,e=>{Cne(e.c,H7(e)),y5(e),v5(e),q5(e),T5(e),S5(e),O5(e),w5(e),b5(e),h5(e),xfe(e)}),Cfe=M(49,S5),wfe=M(50,g5),Tfe=M(51,F(H8)),Efe=bfe,Dfe=M(65,Z8),Ofe=M(13,e=>{vne(e.c,e.n),y5(e)}),kfe=M(68,L5),Afe=F(I8),jfe=L(`y48`,e=>A(e.a,`keydown`,e.o&&(t=>{if(t.key===`Escape`&&e.a3===`nav`&&!document.querySelector(`dialog[open]`)&&R5(e,`term`),(t.metaKey||t.ctrlKey)&&t.shiftKey&&t.key.toLowerCase()===`d`&&(t.preventDefault(),e.b0()),t.altKey&&(t.key===`[`||t.key===`]`)&&(e.b1?.length??0)>1){t.preventDefault();let n=e.b1.map(e=>e.id);k5(e,n[(Math.max(0,n.indexOf(e.b4))+(t.key===`]`?1:n.length-1))%n.length]),R5(e,`term`)}}))),Mfe=M(14,e=>{mne(e.c,e.o),F5(e),L5(e),q5(e),b5(e),l5(e),Afe(e),jfe(e)}),Nfe=M(15,L5),Pfe=M(16,L5),Ffe=M(77,e=>{S5(e),x5(e)}),Ife=M(79,x5),Lfe=F(N8),Rfe=M(17,e=>{S5(e),Lfe(e)}),zfe=M(18,e=>{w5(e),A5(e),$8(e)}),Bfe=M(19,e=>{hne(e.c,e.t),e5(e)}),Vfe=F(L8),Hfe=M(20,e=>{Tne(e.c,e.u),Vfe(e)}),Ufe=M(21),Wfe=M(22),Gfe=M(23),Kfe=M(24,e=>{a5(e),t5(e)}),qfe=M(25,n5);function Z5(e){return function(){Y5(e._,null)}}function Q5(e){return function(){e._._.az()}}function $5(e){return function(){e._._.ay()}}function e7(e){return function(){R5(e._._,`term`)}}function t7(e){return function(){e._._.b0()}}function n7(e){return function(t){k5(e._._,t),R5(e._._,`term`)}}function r7(e){return function(t){R5(e._._,`term`),e._._.bo(e._._.aj,t)}}function i7(e){return function(){e._._.b8()}}function a7(e){return function(t){e._._.bm(t)}}function o7(e){return function(t,n){e._._.bn(t,n)}}function s7(e){return function(t){e._.y?.(t),e._.s?.(t.id),e._.b9()}}function c7(e){return function(){e._.b9()}}function l7(e){return function(t){e._.z?.(t)}}function u7(e){return function(t){e._.y?.(t)}}function d7(e){return function(){R5(e._,`term`)}}function f7(e){return function(){R5(e._,`term`)}}function p7(e){return function(t){k5(e._,t),R5(e._,`term`)}}function m7(e){return t=>{W5(e._,t)}}function h7(e){return function(t,n){e.bn(t.id,n)}}function g7(e){return async(t,n)=>{n=n.trim(),n&&(D5(e,(e.a0||[]).map(e=>e.id===t?{...e,title:n}:e)),await fetch(`/api/sessions/${t}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({title:n})}))}}function _7(e){return t=>(t&&(e.bf=!0),(e.bh??=Nn(e.bi))())}function v7(e){return async()=>{let t=e.bf;e.bf=!1;try{let n=`/api/workspaces/${e.aj}/sessions`,r=await H(n);!r.length&&t&&e.an===`active`&&(r=await H(n)),!r.length&&t&&e.an===`active`&&(await e.bc(e.r||`claude`,!1),r=await H(n).catch(()=>e.a0||[])),D5(e,r);let i=Bn(e.aj);i&&r.some(e=>e.id===i)&&k5(e,i),e.a0.some(t=>t.id===e.a1)||k5(e,e.a0?.[0]?.id||null)}catch(t){if(D5(e,e.a0||[]),Xt(t))return;Y5(e,String(t.message||t))}}}function y7(e){return function(t,n){e.b9(),e.bo(t,n)}}function b7(e){return async(t,n)=>{if(t===e.aj){let r=await e.bc(n,!0);r&&Vn(t,r.id);return}try{Vn(t,(await H(`/api/workspaces/${t}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:n})})).id),e.s?.(t)}catch(t){Y5(e,String(t.message||t))}}}function x7(e){return async(t,n)=>{X5(e,!0);try{let r=await H(`/api/workspaces/${e.aj}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:t})});if(n){let t=e.a0||[];D5(e,t.some(e=>e.id===r.id)?t:t.concat(r)),k5(e,r.id)}return r}catch(t){return Y5(e,String(t.message||t)),null}finally{X5(e,!1)}}}function S7(e){return async t=>{try{await H(`/api/sessions/${t}`,{method:`DELETE`}),D5(e,(e.a0||[]).filter(e=>e.id!==t)),e.a1===t&&k5(e,e.a0?.[0]?.id||null)}catch(t){Y5(e,`Kill session failed: ${String(t.message||t)}`)}}}function C7(e){return()=>{R5(e,e.a3===`nav`?`term`:`nav`)}}function w7(e){return function(t){e.b9(),e.s?.(t)}}function T7(e){return function(t){e.b9(),e.aq(t)}}function E7(e){return()=>{e.a3===`new`&&R5(e,`term`)}}function D7(e){return()=>{e.a3===`usage`?R5(e,`term`):e.av()}}function O7(e){return()=>{e.a3===`manage`?R5(e,`term`):e.as()}}function k7(e){return()=>{e.a3===`diff`?R5(e,`term`):e.aq()}}function A7(e){return()=>{if(e.a9){W5(e,!1);return}W5(e,!0),G5(e,e.ab+1),e.ac.focus()}}function j7(){}function M7(e){return t=>{K5(e,t||``),t&&J5(e,e.af+1),z5(e,!0),R5(e,`diff`)}}function N7(e){return()=>{B5(e,!0),R5(e,`manage`)}}function P7(e){return()=>{V5(e,!0),R5(e,`usage`)}}function F7(e){return function(t){e.bm(t)}}function I7(e){return function(){e.b9(),e.ax()}}function L7(e){return function(){e.a3===`new`?e.b9():e.x?.()}}function R7(e){return function(t,n){e.b9(),e.v?.(t,n)}}function z7(e){return function(t){Y5(e,t)}}function B7(e){return t=>{R5(e,t)}}function V7(e){return function(t){k5(e,t)}}function H7(e){return function(t){e.b9(),!t||t===e.aj?e.az():e.w?.(t)}}R(`y28`,Z5),R(`y44`,Q5),R(`y43`,$5),R(`y42`,e7),R(`y41`,t7),R(`y38`,n7),R(`y37`,r7),R(`y45`,i7),R(`y39`,a7),R(`y40`,o7),R(`y36`,s7),R(`y34`,c7),R(`y35`,l7),R(`y32`,u7),R(`y33`,d7),R(`y31`,f7),R(`y30`,p7),R(`y29`,m7),R(`y26`,h7),R(`y14`,g7),R(`y12`,_7),R(`y11`,v7),R(`y24`,y7),R(`y15`,b7),R(`y10`,x7),R(`y13`,S7),R(`y5`,C7),R(`y19`,w7),R(`y27`,T7),R(`y9`,E7),R(`y4`,D7),R(`y6`,O7),R(`y7`,k7),R(`y8`,A7),R(`y0`,j7),R(`y1`,M7),R(`y2`,N7),R(`y3`,P7),R(`y25`,F7),R(`y23`,I7),R(`y22`,L7),R(`y20`,R7),R(`y18`,z7),R(`y17`,B7),R(`y16`,V7),R(`y21`,H7);var U7=I(47,e=>V(e.a,e._._.a0),e=>e._._),Jfe=ft(`n23`,` `,` `,U7),Yfe=e=>{Or(e.a),Mr(e.a,Jfe(e)),Ir(e.a,M9(e)),Fr(e.a),Tr(e.a),br(e.a),wr(e.a),Ar(e.a),Dr(e.a,{})},W7=N(4,e=>Kfe(e.b,N9(e))),G7=N(5,e=>qfe(e.b,P9(e))),K7=I(41,e=>{Bfe(e.b,e._._.o),W7(e),G7(e)},e=>e._._),Xfe=e=>{K7(e),q7(e),J7(e),Z7(e),Q7(e),$7(e),e9(e),t9._(e),n9._(e),yfe(e.b),Ufe(e.b,L9(e)),Gfe(e.b,I9(e)),Pfe(e.b,F9(e))},q7=I(42,e=>Ofe(e.b,e._._.p),e=>e._._),J7=I(43,e=>{Rfe(e.b,e._._.q?e._._.q?.preferredAgent:`claude`),Hfe(e.b,e._._.q?e._._.q?.agents:[`claude`])},e=>e._._),Zfe=de(3,0,2),Y7=N(6,e=>{Mfe(e.b,e._.f===e._._.s),Zfe(e,e._.f===e._._.s)}),X7=N(7,e=>Nfe(e.b,e._._.x&&e._.f===e._._.s),2),Z7=I(44,e=>{Y7(e),X7(e)},e=>e._._),Q7=I(45,X7,e=>e._._),$7=I(48,W7,e=>e._._),e9=I(49,e=>{zfe(e.b,R9(e)),G7(e)},e=>e._._),t9=P(0,0,e=>Efe(e.b,e._.e)),n9=P(0,0,e=>{Wfe(e.b,z9(e)),Y7(e),X7(e)}),Qfe=O(0,(e=>`<!><!>${e}<!><!><!>`)(gde),(e=>`b%b/${e}&%b%c`)(_de),Xfe),$fe=M(4,e=>{tpe(e,e.e?.id),Qfe(e,+!e.e),t9(e)}),r9=N(3,e=>$fe(e,e._.o.find(t=>t.id===e.c))),i9=qe(4,r9),epe=i9,tpe=M(5,n9),npe=M(2,r9),rpe=(e,t)=>npe(e,t[0]),a9=N(1,e=>vl(e.a,B9(e))),o9=N(2,e=>_l(e.a,V9(e)),2),s9=P(3,0,e=>{ml(e.a,e._.o),a9(e),o9(e)}),ipe=e=>{s9._(e),c9._(e),l9._(e),ol(e.a),bl(e.a,H9(e))},c9=P(3,0,o9),l9=P(3,0,e=>{a9(e),o9(e)}),u9=P(2,0,e=>bo(e.a,e._.o)),ape=e=>{u9._(e),d9._(e),f9._(e),p9._(e),h9._(e),g9._(e),_9._(e),ho(e.a),co(e.a,G9(e)),Ao(e.a,W9(e)),Ha(e.a,U9(e)),eo(e.a),to(e.a)},d9=P(2,0,e=>zo(e.a,e._.p)),f9=P(2,0,e=>so(e.a,e._.q)),p9=P(2,0,e=>Co(e.a,e._.s)),m9=N(1,e=>Io(e.a,!e._.z&&e._.ad)),h9=P(2,0,e=>{Va(e.a,e._.z),m9(e)}),g9=P(2,0,e=>{jo(e.a,Y9(e)),wo(e.a,J9(e)),Eo(e.a,q9(e)),To(e.a,K9(e))}),_9=P(2,0,m9),v9=N(36,L(`n25`,e=>Tt(e,{onMount:function(){let t=new AbortController,n=t.signal,r={abort:t,statusStale:!1,statusDebounce:void 0};gee(e.m),qn(n);let i=(t,n)=>{n&&(kn(t,n),Vn(t,n)),e.a9(t)},a=new URLSearchParams(location.search);a.get(`ws`)&&(i(a.get(`ws`),a.get(`session`)),history.replaceState(null,``,`/`)),Qn()&&document.addEventListener(`click`,e=>{let t=e.target?.closest?.(`a[target="_blank"][href^="http"]`);t&&(e.preventDefault(),$n(t.href))},{capture:!0,signal:n}),navigator.serviceWorker?.addEventListener(`message`,e=>{e.data?.type===`open-session`&&i(e.data.workspaceId,e.data.sessionId)},{signal:n});let o=()=>{if(document.hidden){r.statusStale=!0;return}r.statusStale=!1,e.a8()};document.addEventListener(`visibilitychange`,()=>{document.hidden||(r.statusStale=!1,e.a8(!0))},{signal:n}),o(),xn().addEventListener(`workspaces.changed`,t=>{let n=t.data;Array.isArray(n)?e.a1(n):e.a2(),o()},{signal:n}),xn().addEventListener(`sessions.changed`,t=>{let n=t.data;if(n?.workspaceId&&Array.isArray(n.sessions)){e.a3(n.workspaceId,n.sessions),r.statusStale=!1;return}clearTimeout(r.statusDebounce),r.statusDebounce=setTimeout(o,300)},{signal:n}),xn().addEventListener(`status.changed`,t=>{t.data&&(w9(e,t.data),r.statusStale=!1)},{signal:n});let s=window.visualViewport;if(s){let e=()=>{let e=Math.abs(s.height-window.innerHeight)<1;document.documentElement.style.setProperty(`--app-height`,e?``:`${Math.round(s.height)}px`),e||window.scrollTo(0,0)};s.addEventListener(`resize`,e,{signal:n}),s.addEventListener(`scroll`,e,{signal:n}),document.addEventListener(`visibilitychange`,()=>{document.hidden||e()},{signal:n}),window.addEventListener(`pageshow`,e,{signal:n}),window.addEventListener(`focus`,e,{signal:n})}return r},onDestroy:function(){this.abort.abort(),clearTimeout(this.statusDebounce)}})),5),ope=F(e9),spe=M(35,e=>{v9(e),g9(e),l9(e),ope(e)}),y9=N(21,e=>spe(e,X9(e))),cpe=O(2,(e=>`<!>${e}`)(Oee),(e=>`b/${e}&`)(kee),ape),b9=N(40,e=>cpe(e,e.z||e.ad?0:1)),lpe=M(39,e=>{b9(e),_9(e)}),x9=N(38,e=>lpe(e,!e.x&&!e.ab)),upe=M(37,x9),S9=N(19,e=>upe(e,e.o.find(t=>t.id===e.s))),dpe=F(K7),C9=j(14,e=>{y9(e),S9(e),u9(e),s9(e),i9(e),dpe(e)}),fpe=M(29,v9),ppe=F(q7),w9=j(15,e=>{fpe(e,Z9(e)),d9(e),ppe(e)}),mpe=F(J7),hpe=j(16,e=>{f9(e),mpe(e)}),gpe=k(4,`<!><!><!>`,`b%`,epe,rpe),_pe=M(28,v9),vpe=F($7),ype=M(27,e=>{_pe(e,Q9(e)),v9(e),c9(e),vpe(e)}),T9=N(22,e=>ype(e,$9(e))),E9=j(20,e=>{gpe(e,[e.u,e=>e]),T9(e),y9(e)}),bpe=O(3,ic,(e=>`/${e}&`)(ac),ipe),D9=N(24,e=>bpe(e,e.x&&!e.s?0:1)),xpe=F(Z7),O9=j(18,e=>{E9(e,e.s?[e.s]:[]),T9(e),S9(e),D9(e),p9(e),xpe(e)}),Spe=F(Q7),k9=j(23,e=>{x9(e),D9(e),Spe(e)}),A9=j(25,e=>{b9(e),h9(e)}),Cpe=O(1,tr,(e=>`/${e}&`)(nr),Yfe),wpe=F(U7),j9=j(26,e=>{Cpe(e,+!e.a0),wpe(e)});L(`n24`,e=>A(e.a,`keydown`,function(t){if((t.metaKey||t.ctrlKey)&&t.key===`k`&&(t.preventDefault(),A9(e,!e.z)),(t.metaKey||t.ctrlKey)&&!t.shiftKey&&!t.altKey&&t.key>=`1`&&t.key<=`9`){let n=e.o.filter(e=>e.status===`active`)[Number(t.key)-1];n&&(t.preventDefault(),e.a9(n.id))}}));function M9(e){return function(){j9(e._,null)}}function N9(e){return function(t){e._._.a1(e._._.o.map(e=>e.id===t.id?t:e))}}function P9(e){return function(t){e._._.o.some(e=>e.id===t.id)||C9(e._._,[t,...e._._.o]),k9(e._._,!1),e._._.a9(t.id)}}function F9(e){return function(){k9(e._._,!1)}}function I9(e){return function(){k9(e._._,!0)}}function L9(e){return function(t,n){kn(t,n),Vn(t,n),e._._.a9(t)}}function R9(e){return function(t){e._._.a9(t)}}function z9(e){return function(t){let n=t||e._.f;jn(n),e._._.a9(n)}}function B9(e){return function(t){e._.o.some(e=>e.id===t.id)||C9(e._,[t,...e._.o]),k9(e._,!1),e._.a9(t.id)}}function V9(e){return function(t){e._.a1(e._.o.map(e=>e.id===t.id?t:e)),k9(e._,!1),e._.a9(t.id)}}function H9(e){return function(){k9(e._,!1)}}function U9(e){return t=>{A9(e._,t)}}function W9(e){return function(){k9(e._,!0),A9(e._,!1)}}function G9(e){return function(t){hpe(e._,t)}}function K9(e){return function(t){k9(e._,!1),A9(e._,!1),jn(t.id),e._.a9(t.id)}}function q9(e){return function(t,n){A9(e._,!1),H(`/api/workspaces/${t.id}/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:n})}).then(n=>{kn(t.id,n.id),e._.a9(t.id)}).catch(t=>{j9(e._,`New session failed: ${String(t.message||t)}`)})}}function J9(e){return function(t){Dn(t.id),e._.a9(t.id)}}function Y9(e){return function(t){e._.a9(t.id)}}function X9(e){return async t=>{e.o.find(e=>e.id===t)?.status===`archived`&&(await H(`/api/workspaces/${t}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`restore`})}).catch(()=>{}),C9(e,e.o.map(e=>e.id===t?{...e,status:`active`}:e))),O9(e,t),k9(e,!1),A9(e,!1),e.u.includes(t)||E9(e,e.u.concat(t)),Rn(t)}}function Z9(e){return(t,n)=>{let r=e.p[t];if(!r)return;let i=n.map(e=>e.state).filter(e=>!!e?.alive);w9(e,{...e.p,[t]:{...r,sessions:n.map(e=>({id:e.id,agent:e.agent,title:e.title,state:e.state||{alive:!1}})),agents:i.length,working:i.filter(e=>e.phase===`working`).length,waiting:i.filter(e=>e.phase===`waiting`).length}})}}function Q9(e){return async()=>{try{e.a1(await H(`/api/workspaces`))}catch(t){if(Xt(t))return;j9(e,`Loading workspaces failed: ${t.message||String(t)}`)}}}function $9(e){return t=>{C9(e,t);let n=new Set(t.filter(e=>e.status===`active`).map(e=>e.id));E9(e,e.u.filter(e=>n.has(e))),e.s&&!n.has(e.s)&&(O9(e,e.u[e.u?.length-1]||null),Rn(e.s))}}function Tpe(e){return(t=!1)=>(e.a5||=t,(e.a6??=Nn(async()=>{let t=e.a5;e.a5=!1;try{w9(e,await H(`/api/status${t?`?fresh`:``}`))}catch(e){if(!Xt(e))throw e}}))())}R(`n5`,M9),R(`n19`,N9),R(`n22`,P9),R(`n21`,F9),R(`n20`,I9),R(`n17`,L9),R(`n16`,R9),R(`n18`,z9),R(`n14`,B9),R(`n15`,V9),R(`n13`,H9),R(`n12`,U9),R(`n11`,W9),R(`n6`,G9),R(`n10`,K9),R(`n9`,q9),R(`n8`,J9),R(`n7`,Y9),R(`n4`,X9),R(`n2`,Z9),R(`n1`,Q9),R(`n0`,$9),R(`n3`,Tpe);var Epe=(e,t,n)=>{for(;n;){if(n.O?.i)return(n.J||=[]).push(e,t);n=n.N}};tee(e=>(t,n=u.has(t))=>{if(n||l.has(t)){let e=0,r,i,a;for(;e<t.length;)r=t[e++],i=t[e++],(a=i.F)?.H!==0&&!(n&&Epe(r,i,a))&&r(i)}else e(t)},e=>t=>{try{let n=t.b.F;for(;n;){if(n.W)return t.f=1,n.W.push(t);n=n.N}t.f=0,e(t)}catch(e){see(t.b,e)}});var Dpe=e=>B(e.a,`_b`),Ope=(e,t)=>V(e.b,t instanceof Error?t.message:String(t));ft(`b1`,`<div><p> </p></div>`,` E `,Dpe,(e,t)=>Ope(e,t[0])),ft(`b0`,`<div><span></span>Loading workspaces…</div>`,` D `,e=>{B(e.a,`_b`),B(e.b,`_w`)}),ree();export{t};
1615
+ //# sourceMappingURL=index-DNOnhrX7.js.map