@qitqode/qitqode-android-arm64 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. package/bundle/{chunk-cx7p4ezk.js → chunk-03mbn7nj.js} +2 -2
  2. package/bundle/{chunk-aw8af3ky.js → chunk-073ydjmk.js} +1 -1
  3. package/bundle/{chunk-rrd0jf5m.js → chunk-07s30fpb.js} +1 -1
  4. package/bundle/{chunk-yacccwf6.js → chunk-087tnr8a.js} +1 -1
  5. package/bundle/{chunk-kx2dp8ch.js → chunk-0f3ft9dh.js} +1 -1
  6. package/bundle/{chunk-rgxy4ngt.js → chunk-0gab4v98.js} +1 -1
  7. package/bundle/chunk-0xrr0k94.js +2 -0
  8. package/bundle/chunk-0yagj4ss.js +2 -0
  9. package/bundle/chunk-0ych0f5w.js +2 -0
  10. package/bundle/{chunk-2pzvcpv4.js → chunk-0z1cxvk1.js} +2 -2
  11. package/bundle/{chunk-rph9zj24.js → chunk-0zxwjsvz.js} +1 -1
  12. package/bundle/{chunk-pqnbdygz.js → chunk-1p6jjrea.js} +2 -2
  13. package/bundle/{chunk-9cw4cnz0.js → chunk-1q1cddy4.js} +1 -1
  14. package/bundle/{chunk-w9pdvcf9.js → chunk-1sfcxdbw.js} +2 -2
  15. package/bundle/chunk-22hr3ndh.js +2 -0
  16. package/bundle/chunk-23tyxyyj.js +2 -0
  17. package/bundle/chunk-28g1ndpx.js +2 -0
  18. package/bundle/chunk-29v1v357.js +2 -0
  19. package/bundle/{chunk-txqc7543.js → chunk-29zm623f.js} +2 -2
  20. package/bundle/{chunk-wm77svwm.js → chunk-2a9rzgk6.js} +1 -1
  21. package/bundle/chunk-2avxtbv3.js +2 -0
  22. package/bundle/{chunk-eaqfnwdj.js → chunk-2bgqy6z7.js} +1 -1
  23. package/bundle/{chunk-9zre5e54.js → chunk-2hv2c8d5.js} +1 -1
  24. package/bundle/{chunk-swcgsrbj.js → chunk-2jpmxt4v.js} +1 -1
  25. package/bundle/chunk-2qk0k2eb.js +2 -0
  26. package/bundle/{chunk-nsjp44fp.js → chunk-2qwmrp16.js} +1 -1
  27. package/bundle/{chunk-dykqn0nj.js → chunk-2xqqkf86.js} +2 -2
  28. package/bundle/{chunk-r0g5yyhf.js → chunk-3aq70t26.js} +1 -1
  29. package/bundle/{chunk-zfcfyagt.js → chunk-3h49k2ck.js} +1 -1
  30. package/bundle/{chunk-sv1s1qxd.js → chunk-3kn57y8d.js} +5 -5
  31. package/bundle/chunk-3ktj87g4.js +2 -0
  32. package/bundle/{chunk-52b1v7mn.js → chunk-3qfpw8f6.js} +1 -1
  33. package/bundle/{chunk-v3x5nrc4.js → chunk-3tmq81kq.js} +2 -2
  34. package/bundle/chunk-3wxvpvg4.js +3 -0
  35. package/bundle/{chunk-neqy8j4n.js → chunk-42r7z6sq.js} +1 -1
  36. package/bundle/chunk-42wdfks8.js +2 -0
  37. package/bundle/chunk-4f19vqxf.js +2 -0
  38. package/bundle/{chunk-d93z6hrn.js → chunk-4fk46ngj.js} +1 -1
  39. package/bundle/{chunk-njkserae.js → chunk-4hd3v58j.js} +1 -1
  40. package/bundle/chunk-4jq25vbc.js +2 -0
  41. package/bundle/chunk-4m3k1atq.js +2 -0
  42. package/bundle/{chunk-1wpjmwnh.js → chunk-4mvg7jt1.js} +1 -1
  43. package/bundle/chunk-4n2ytddp.js +2 -0
  44. package/bundle/{chunk-zesbm9k1.js → chunk-4sxg9cgr.js} +1 -1
  45. package/bundle/{chunk-8fgamz4y.js → chunk-4v61ysex.js} +1 -1
  46. package/bundle/chunk-4yg42p6y.js +2 -0
  47. package/bundle/chunk-4zx3ze68.js +2 -0
  48. package/bundle/chunk-57xbwzdn.js +3 -0
  49. package/bundle/{chunk-rexdr63q.js → chunk-5az84brc.js} +2 -2
  50. package/bundle/{chunk-y0ydzdfc.js → chunk-5t0w9ecw.js} +1 -1
  51. package/bundle/{chunk-nq495be3.js → chunk-5wwd40t3.js} +1 -1
  52. package/bundle/chunk-637sjdzq.js +2 -0
  53. package/bundle/{chunk-snt1kefv.js → chunk-64c8q9zg.js} +3 -3
  54. package/bundle/{chunk-g794ey6w.js → chunk-6avjq7my.js} +1 -1
  55. package/bundle/chunk-6bghztra.js +2 -0
  56. package/bundle/{chunk-n0trgp1c.js → chunk-6dfjtzqb.js} +2 -2
  57. package/bundle/chunk-6h8f89tt.js +2 -0
  58. package/bundle/{chunk-b0jh0rby.js → chunk-6j339s7a.js} +2 -2
  59. package/bundle/{chunk-8q6z6emx.js → chunk-6kf4vw2g.js} +1 -1
  60. package/bundle/{chunk-hgsykghj.js → chunk-6pcmv8vs.js} +2 -2
  61. package/bundle/chunk-6sjj203r.js +2 -0
  62. package/bundle/{chunk-6r8pg6ma.js → chunk-6y4mwmn4.js} +1 -1
  63. package/bundle/{chunk-kt0ej3nq.js → chunk-6ypafpg8.js} +1 -1
  64. package/bundle/{chunk-p8kpqyxb.js → chunk-732yr6qq.js} +2 -2
  65. package/bundle/{chunk-3sz6gw10.js → chunk-73fz0cf4.js} +2 -2
  66. package/bundle/chunk-79aka9xe.js +2 -0
  67. package/bundle/{chunk-8tp4whyw.js → chunk-7my2231h.js} +1 -1
  68. package/bundle/{chunk-xjhezxft.js → chunk-7myg8076.js} +3 -3
  69. package/bundle/{chunk-vvzbfv2f.js → chunk-7njz51r4.js} +1 -1
  70. package/bundle/chunk-7nqdhe7x.js +2 -0
  71. package/bundle/{chunk-zaan8jk6.js → chunk-7ntw4rrn.js} +1 -1
  72. package/bundle/chunk-7rhry8nv.js +2 -0
  73. package/bundle/chunk-7x88b2n2.js +2 -0
  74. package/bundle/{chunk-46ztrjw0.js → chunk-7zvawpe1.js} +1 -1
  75. package/bundle/{chunk-jgz1a29w.js → chunk-86jsqc7d.js} +3 -3
  76. package/bundle/{chunk-zbqzm65q.js → chunk-86yk21g4.js} +1 -1
  77. package/bundle/{chunk-w3bmf3zz.js → chunk-8e6gx3gg.js} +1 -1
  78. package/bundle/chunk-8mthftwc.js +2 -0
  79. package/bundle/{chunk-73ckx171.js → chunk-8q5ns61h.js} +1 -1
  80. package/bundle/{chunk-549ptbaj.js → chunk-8rh0femq.js} +1 -1
  81. package/bundle/chunk-8wdara3b.js +2 -0
  82. package/bundle/chunk-8xhzpnph.js +2 -0
  83. package/bundle/{chunk-kqhh2pm9.js → chunk-94qhpkfx.js} +1 -1
  84. package/bundle/{chunk-gxmxx8jb.js → chunk-99148b1k.js} +1 -1
  85. package/bundle/chunk-9akz8w0d.js +2 -0
  86. package/bundle/{chunk-7gbytqkn.js → chunk-9b4aqcde.js} +2 -2
  87. package/bundle/{chunk-tdmn21z0.js → chunk-9ea1n338.js} +2 -2
  88. package/bundle/chunk-9eg2ytjd.js +17 -0
  89. package/bundle/chunk-9etpppyv.js +3 -0
  90. package/bundle/{chunk-vgaxv70x.js → chunk-9jrxrjzt.js} +2 -2
  91. package/bundle/{chunk-3bkdbqjj.js → chunk-9jsgs71h.js} +1 -1
  92. package/bundle/{chunk-twhavv1m.js → chunk-9nn4jpb7.js} +1 -1
  93. package/bundle/{chunk-pxx2hz0g.js → chunk-9rxyq6f9.js} +2 -2
  94. package/bundle/chunk-9tk4wsn4.js +2 -0
  95. package/bundle/{chunk-9fkmhmh6.js → chunk-9y15zjxa.js} +1 -1
  96. package/bundle/chunk-a0rjp24v.js +2 -0
  97. package/bundle/{chunk-mdzzcrf9.js → chunk-a2dz9nqh.js} +2 -2
  98. package/bundle/chunk-a7p0x4sw.js +2 -0
  99. package/bundle/{chunk-ev3a2sxv.js → chunk-a92hh67a.js} +2 -2
  100. package/bundle/chunk-ae0a496j.js +2 -0
  101. package/bundle/{chunk-px8vtbmr.js → chunk-ahyqfbmq.js} +2 -2
  102. package/bundle/chunk-aq1j9y18.js +2 -0
  103. package/bundle/chunk-aq8nz9hp.js +2 -0
  104. package/bundle/{chunk-zxddasg8.js → chunk-as845ya4.js} +1 -1
  105. package/bundle/chunk-b4zy78be.js +2 -0
  106. package/bundle/{chunk-45mjcxqk.js → chunk-b50t4jc5.js} +1 -1
  107. package/bundle/chunk-basjzwqp.js +2 -0
  108. package/bundle/{chunk-d1rn44wz.js → chunk-bbbh69ys.js} +1 -1
  109. package/bundle/{chunk-mw2hr4pd.js → chunk-bcx2vkv4.js} +1 -1
  110. package/bundle/{chunk-72zxassf.js → chunk-bggybm9k.js} +1 -1
  111. package/bundle/{chunk-4gs87ghj.js → chunk-bgng3rdj.js} +2 -2
  112. package/bundle/chunk-bhetpmgq.js +3 -0
  113. package/bundle/{chunk-bnz0mxak.js → chunk-bk3z400e.js} +1 -1
  114. package/bundle/chunk-bm7xpjh6.js +2 -0
  115. package/bundle/{chunk-nhwhkx62.js → chunk-bzs2ep7s.js} +1 -1
  116. package/bundle/{chunk-7fawtcnn.js → chunk-c1g8n10t.js} +1 -1
  117. package/bundle/chunk-c2k556rk.js +2 -0
  118. package/bundle/{chunk-w03fdrxe.js → chunk-cbf1y12x.js} +1 -1
  119. package/bundle/{chunk-vc4e6xc4.js → chunk-cbmwhvxw.js} +2 -2
  120. package/bundle/{chunk-5bate758.js → chunk-cp39f96a.js} +1 -1
  121. package/bundle/{chunk-9nk0ts0s.js → chunk-d307vb2d.js} +1 -1
  122. package/bundle/chunk-d41mg7at.js +2 -0
  123. package/bundle/chunk-d50kpss6.js +2 -0
  124. package/bundle/chunk-day0rb5p.js +2 -0
  125. package/bundle/{chunk-dz3s882k.js → chunk-dj3525nn.js} +4 -4
  126. package/bundle/{chunk-qq2rcxv2.js → chunk-dknemkw2.js} +2 -2
  127. package/bundle/chunk-dp7cww4v.js +2 -0
  128. package/bundle/{chunk-yeq7b87a.js → chunk-drwqag0f.js} +1 -1
  129. package/bundle/{chunk-qdcf1ay5.js → chunk-e586sjb0.js} +2 -2
  130. package/bundle/{chunk-qs4wef8c.js → chunk-e6wp96vm.js} +1 -1
  131. package/bundle/{chunk-g8cfzzrs.js → chunk-e89zjjmj.js} +1 -1
  132. package/bundle/chunk-egae7vvg.js +2 -0
  133. package/bundle/chunk-erdjd9w3.js +2 -0
  134. package/bundle/chunk-ex93y6dw.js +2 -0
  135. package/bundle/chunk-eyr0vf92.js +2 -0
  136. package/bundle/{chunk-02xcb52z.js → chunk-ezfzb8qc.js} +2 -2
  137. package/bundle/{chunk-kp8nkm3m.js → chunk-f1bcz9yz.js} +1 -1
  138. package/bundle/chunk-f4zfk5ye.js +2 -0
  139. package/bundle/{chunk-ceefd2nj.js → chunk-f7rj6fck.js} +1 -1
  140. package/bundle/{chunk-4sazy0nq.js → chunk-f83wv08n.js} +1 -1
  141. package/bundle/{chunk-eb8nsk7e.js → chunk-faa0zxey.js} +2 -2
  142. package/bundle/{chunk-3dr4469n.js → chunk-fbm6qczy.js} +1 -1
  143. package/bundle/{chunk-0g25z230.js → chunk-fd7fmvyw.js} +1 -1
  144. package/bundle/chunk-fghqr4x8.js +8 -0
  145. package/bundle/{chunk-0z33en1a.js → chunk-fgn83bs7.js} +1 -1
  146. package/bundle/{chunk-dshnn54c.js → chunk-fpm2vgz6.js} +1 -1
  147. package/bundle/chunk-fvkwcx35.js +2 -0
  148. package/bundle/{chunk-w5940jxm.js → chunk-fvy24yhq.js} +1 -1
  149. package/bundle/{chunk-gt6tgm42.js → chunk-fymt1rym.js} +1 -1
  150. package/bundle/{chunk-dt899wbf.js → chunk-g3kd4957.js} +2 -2
  151. package/bundle/{chunk-v7q3d3n6.js → chunk-g5cgpvef.js} +2 -2
  152. package/bundle/{chunk-909fp6pm.js → chunk-g9end129.js} +1 -1
  153. package/bundle/chunk-gbmmbhy4.js +2 -0
  154. package/bundle/chunk-gp877cq5.js +2 -0
  155. package/bundle/{chunk-tgd5ctnt.js → chunk-gr4bctqj.js} +2 -2
  156. package/bundle/{chunk-dvxk6mr6.js → chunk-grw4gg9j.js} +2 -2
  157. package/bundle/{chunk-mvnxwwe7.js → chunk-gtjn3yc4.js} +2 -2
  158. package/bundle/chunk-hk8vvc10.js +2 -0
  159. package/bundle/{chunk-cxtxvt43.js → chunk-hmznf0ax.js} +1 -1
  160. package/bundle/{chunk-gnt982jr.js → chunk-hpa7e9va.js} +3 -3
  161. package/bundle/{chunk-hcy77w6t.js → chunk-hq9bgnqb.js} +1 -1
  162. package/bundle/{chunk-gkj4a27z.js → chunk-hrw5rmj1.js} +1 -1
  163. package/bundle/{chunk-n2ygpy76.js → chunk-hs3vfhar.js} +1 -1
  164. package/bundle/chunk-hwavzxdm.js +2 -0
  165. package/bundle/chunk-hwnc2sa5.js +2 -0
  166. package/bundle/chunk-j2gvpa15.js +2 -0
  167. package/bundle/{chunk-te5tfq79.js → chunk-j3jqk62r.js} +1 -1
  168. package/bundle/{chunk-jqn27885.js → chunk-j5ymkhry.js} +1 -1
  169. package/bundle/chunk-j7n8khk7.js +2 -0
  170. package/bundle/{chunk-ws3p9cya.js → chunk-jgtcfw96.js} +2 -2
  171. package/bundle/{chunk-5myxjxae.js → chunk-jjjs8p0t.js} +2 -2
  172. package/bundle/chunk-jkh98wby.js +2 -0
  173. package/bundle/{chunk-h7w35n7w.js → chunk-jv4th87b.js} +1 -1
  174. package/bundle/{chunk-j63fkt6n.js → chunk-jvjq554f.js} +1 -1
  175. package/bundle/{chunk-00sr2gwz.js → chunk-jw114bbt.js} +2 -2
  176. package/bundle/{chunk-ax1y4699.js → chunk-jwph7tpc.js} +1 -1
  177. package/bundle/{chunk-xdacgfba.js → chunk-k1gddnkm.js} +1 -1
  178. package/bundle/chunk-k5a652s4.js +2 -0
  179. package/bundle/{chunk-1mcsf4yb.js → chunk-k6cbfrzc.js} +2 -2
  180. package/bundle/chunk-k6w32q2p.js +2 -0
  181. package/bundle/{chunk-rtdym35y.js → chunk-kc1xmcc9.js} +141 -135
  182. package/bundle/{chunk-5kmfnkzv.js → chunk-kdcnder5.js} +1 -1
  183. package/bundle/chunk-ke5rqv5b.js +2 -0
  184. package/bundle/chunk-kghwk0yh.js +2 -0
  185. package/bundle/{chunk-r6ndvzd0.js → chunk-km1n4ttr.js} +1 -1
  186. package/bundle/{chunk-m0xsvzyd.js → chunk-knh01n2r.js} +2 -2
  187. package/bundle/{chunk-ydc6ypjt.js → chunk-ks1cs80p.js} +2 -2
  188. package/bundle/{chunk-08q55ya0.js → chunk-kxjrrdj0.js} +1 -1
  189. package/bundle/{chunk-jts0dma5.js → chunk-kzvvvj79.js} +2 -2
  190. package/bundle/chunk-mgadsp7r.js +2 -0
  191. package/bundle/chunk-mk2s9py8.js +2 -0
  192. package/bundle/{chunk-hb9mc5f9.js → chunk-mpe8zxc0.js} +1 -1
  193. package/bundle/{chunk-yykjvt7f.js → chunk-mswx4k75.js} +2 -2
  194. package/bundle/{chunk-z0tfsdb9.js → chunk-mx3jd1p9.js} +1 -1
  195. package/bundle/{chunk-sxy4hyyy.js → chunk-mxf9p0p9.js} +1 -1
  196. package/bundle/{chunk-std2bgv7.js → chunk-mxhb5adq.js} +2 -2
  197. package/bundle/{chunk-gwfx7tx7.js → chunk-my3cswnp.js} +2 -2
  198. package/bundle/chunk-n0k0pp4k.js +2 -0
  199. package/bundle/chunk-n393nnh5.js +2 -0
  200. package/bundle/chunk-n5vyed7w.js +2 -0
  201. package/bundle/{chunk-jf6ry79j.js → chunk-n7kqdqkh.js} +4 -4
  202. package/bundle/{chunk-tdxbm1nd.js → chunk-n90eh3e7.js} +1 -1
  203. package/bundle/{chunk-n7d9eemn.js → chunk-nb86kh94.js} +211 -211
  204. package/bundle/{chunk-s8mghr5a.js → chunk-ngvp6zc2.js} +2 -2
  205. package/bundle/{chunk-98effz12.js → chunk-nh044sjn.js} +1 -1
  206. package/bundle/{chunk-ypk3t1eh.js → chunk-nm6wnne9.js} +1 -1
  207. package/bundle/{chunk-mcc5ynma.js → chunk-p4ewy9xh.js} +3 -3
  208. package/bundle/{chunk-d9x9kqvy.js → chunk-p5mes2sh.js} +1 -1
  209. package/bundle/{chunk-vgnddhdj.js → chunk-p635phfw.js} +1 -1
  210. package/bundle/{chunk-dgx4rq86.js → chunk-p887g1xj.js} +1 -1
  211. package/bundle/{chunk-7jhrxzjx.js → chunk-p9mj4zyk.js} +2 -2
  212. package/bundle/chunk-pasm65wq.js +2 -0
  213. package/bundle/chunk-pfh34atn.js +2 -0
  214. package/bundle/{chunk-xdjwapwy.js → chunk-pfkm3j8g.js} +2 -2
  215. package/bundle/chunk-phpmxjf8.js +2 -0
  216. package/bundle/{chunk-9dh9bc9d.js → chunk-pp9neaaz.js} +1 -1
  217. package/bundle/{chunk-c72jajx9.js → chunk-pzefsndd.js} +1 -1
  218. package/bundle/{chunk-dh1h513y.js → chunk-q128vfc6.js} +1 -1
  219. package/bundle/{chunk-z7vv0ngm.js → chunk-q148vndn.js} +2 -2
  220. package/bundle/{chunk-4fa390yr.js → chunk-q4fn41ex.js} +2 -2
  221. package/bundle/{chunk-zrmx397j.js → chunk-q5abwn50.js} +1 -1
  222. package/bundle/{chunk-s2xdf6qh.js → chunk-q9ft590w.js} +2 -2
  223. package/bundle/{chunk-7vftsy04.js → chunk-qaz100ht.js} +1 -1
  224. package/bundle/{chunk-17pxm5d3.js → chunk-qeg0jnxq.js} +2 -2
  225. package/bundle/{chunk-871f8x99.js → chunk-qf1dqzra.js} +2 -2
  226. package/bundle/{chunk-qyjt0qnq.js → chunk-qg9bt0kx.js} +2 -2
  227. package/bundle/{chunk-pnq1h5az.js → chunk-qhnpq5gb.js} +2 -2
  228. package/bundle/{chunk-kb6v5hhm.js → chunk-qkh8697x.js} +2 -2
  229. package/bundle/chunk-qvzvxsjw.js +2 -0
  230. package/bundle/chunk-qzszrd0s.js +2 -0
  231. package/bundle/{chunk-yzwgvjzd.js → chunk-r0s28gnb.js} +1 -1
  232. package/bundle/{chunk-k7n1csxv.js → chunk-r2qns6yc.js} +1 -1
  233. package/bundle/{chunk-yj6rbe9p.js → chunk-rcyzqa3g.js} +2 -2
  234. package/bundle/{chunk-70pb4kcm.js → chunk-rdwma0de.js} +2 -2
  235. package/bundle/{chunk-25bp7pcm.js → chunk-rk2bk4s7.js} +2 -2
  236. package/bundle/{chunk-x6rr6ss1.js → chunk-rm5ntsvn.js} +1 -1
  237. package/bundle/{chunk-fyz7fngd.js → chunk-rnq5ezrt.js} +1 -1
  238. package/bundle/{chunk-xhbb8b5g.js → chunk-rp8asmq7.js} +1 -1
  239. package/bundle/{chunk-z1rshv6g.js → chunk-rpfhgncs.js} +1 -1
  240. package/bundle/{chunk-cagk1sjd.js → chunk-s0ptrw0z.js} +1 -1
  241. package/bundle/{chunk-yw9pfqxt.js → chunk-s0ty36qg.js} +1 -1
  242. package/bundle/{chunk-pr1ysgr3.js → chunk-s7yza695.js} +1 -1
  243. package/bundle/chunk-s99cvvc9.js +2 -0
  244. package/bundle/{chunk-v0yxkq99.js → chunk-sh76e256.js} +2 -2
  245. package/bundle/chunk-skpkjnyy.js +2 -0
  246. package/bundle/{chunk-8r3410c2.js → chunk-skv9ww0s.js} +1 -1
  247. package/bundle/chunk-snt4kwab.js +2 -0
  248. package/bundle/chunk-sq47t8f1.js +2 -0
  249. package/bundle/chunk-sqhgnvvs.js +2 -0
  250. package/bundle/chunk-t114r59h.js +2 -0
  251. package/bundle/chunk-t1f56k0j.js +2 -0
  252. package/bundle/{chunk-9s4whpg1.js → chunk-t1jgx17a.js} +2 -2
  253. package/bundle/chunk-t69jx6fz.js +2 -0
  254. package/bundle/{chunk-srxx88nb.js → chunk-t9zbp2qw.js} +1 -1
  255. package/bundle/{chunk-jcjaw7tk.js → chunk-ta7mfkms.js} +2 -2
  256. package/bundle/{chunk-aj3y2e86.js → chunk-tce12v85.js} +1 -1
  257. package/bundle/{chunk-fn8191ps.js → chunk-tczbhj0e.js} +1 -1
  258. package/bundle/{chunk-h1kg35mn.js → chunk-tge53d52.js} +1 -1
  259. package/bundle/chunk-tq1dqhes.js +2 -0
  260. package/bundle/chunk-tsb3jsx4.js +2 -0
  261. package/bundle/chunk-ttpbpzbh.js +2 -0
  262. package/bundle/{chunk-2dkrfc1s.js → chunk-v5z6sx6j.js} +1 -1
  263. package/bundle/chunk-v667egp5.js +2 -0
  264. package/bundle/{chunk-w8d9srv7.js → chunk-v7mg632n.js} +2 -2
  265. package/bundle/{chunk-60qyqqxx.js → chunk-v9rg0a8g.js} +1 -1
  266. package/bundle/{chunk-jngchw38.js → chunk-ve3np791.js} +1 -1
  267. package/bundle/{chunk-wev34grp.js → chunk-vhe92p7a.js} +2 -2
  268. package/bundle/{chunk-qpzspr9z.js → chunk-vjx0064q.js} +2 -2
  269. package/bundle/{chunk-atpzz901.js → chunk-vm1ek7yf.js} +1 -1
  270. package/bundle/{chunk-3mepk08v.js → chunk-vqpfpmha.js} +2 -2
  271. package/bundle/{chunk-cdh26622.js → chunk-vqss3e48.js} +2 -2
  272. package/bundle/{chunk-ewpzqnj4.js → chunk-w79jzf8w.js} +1 -1
  273. package/bundle/{chunk-yha554nm.js → chunk-w7em72p8.js} +2 -2
  274. package/bundle/chunk-wcqfr8vr.js +3 -0
  275. package/bundle/{chunk-r58gzg6m.js → chunk-wdaf713t.js} +1 -1
  276. package/bundle/{chunk-ymtcm4xd.js → chunk-wf4x5cjc.js} +1 -1
  277. package/bundle/{chunk-vsys768k.js → chunk-wfggztm4.js} +1 -1
  278. package/bundle/{chunk-j5kyf7vt.js → chunk-wp3dpt6d.js} +2 -2
  279. package/bundle/{chunk-acyj91wq.js → chunk-x2cavpa9.js} +1 -1
  280. package/bundle/{chunk-kmtfdky8.js → chunk-x3afqfww.js} +2 -2
  281. package/bundle/{chunk-qb35hqm4.js → chunk-x4pdpka8.js} +1 -1
  282. package/bundle/{chunk-vm58fkrv.js → chunk-xd3xc1vv.js} +1 -1
  283. package/bundle/{chunk-m6zxr0j8.js → chunk-xjpvv3vp.js} +2 -2
  284. package/bundle/chunk-xnhvt98g.js +5 -0
  285. package/bundle/{chunk-64s7vfj7.js → chunk-xny5ecn0.js} +2 -2
  286. package/bundle/chunk-xwgc2pw7.js +28 -0
  287. package/bundle/chunk-xxrtr6sd.js +2 -0
  288. package/bundle/chunk-y287zwkr.js +10 -0
  289. package/bundle/{chunk-ezrskm25.js → chunk-y3dfk6n5.js} +1 -1
  290. package/bundle/{chunk-t01bhw5h.js → chunk-y4e7e42x.js} +3 -3
  291. package/bundle/chunk-y8eggnrr.js +2 -0
  292. package/bundle/{chunk-9xvctnjr.js → chunk-yajd975f.js} +1 -1
  293. package/bundle/chunk-yck5h49c.js +2 -0
  294. package/bundle/{chunk-8yr682pv.js → chunk-yd2emszh.js} +2 -2
  295. package/bundle/{chunk-p9zrk16q.js → chunk-yd8bzhv6.js} +1 -1
  296. package/bundle/{chunk-ztnepaqc.js → chunk-yerfyz4w.js} +1 -1
  297. package/bundle/{chunk-x42w8ewc.js → chunk-yg0pfngv.js} +1 -1
  298. package/bundle/{chunk-y1b2h15z.js → chunk-ypcc3cnb.js} +1 -1
  299. package/bundle/{chunk-tzrbb0e8.js → chunk-yqb6cfed.js} +2 -2
  300. package/bundle/{chunk-qy1a2tpc.js → chunk-yr35q7q1.js} +1 -1
  301. package/bundle/{chunk-rcyhqkv5.js → chunk-yrfq22a5.js} +1 -1
  302. package/bundle/{chunk-gg7bg3ek.js → chunk-yvjke593.js} +1 -1
  303. package/bundle/{chunk-zfnbk5gy.js → chunk-ywkvq7zb.js} +1 -1
  304. package/bundle/{chunk-p3rp99na.js → chunk-yx1h0b5v.js} +1 -1
  305. package/bundle/chunk-yxeja9kg.js +2 -0
  306. package/bundle/{chunk-mzbr0m2v.js → chunk-yz0pwv2m.js} +1 -1
  307. package/bundle/{chunk-q81m4m9z.js → chunk-z2h1gxyx.js} +1 -1
  308. package/bundle/{chunk-qqne79vp.js → chunk-zdzxsyxs.js} +2 -2
  309. package/bundle/{chunk-yzh4rmrt.js → chunk-zek5c15t.js} +1 -1
  310. package/bundle/{chunk-8dxdeksr.js → chunk-zfd70p01.js} +1 -1
  311. package/bundle/{chunk-pnpre7ys.js → chunk-zqkv8796.js} +1 -1
  312. package/bundle/chunk-ztn2jv26.js +11 -0
  313. package/bundle/index.js +3 -3
  314. package/bundle/parser.worker.js +2 -2
  315. package/bundle/worker.js +1 -1
  316. package/package.json +1 -1
  317. package/bundle/chunk-092bx2yw.js +0 -2
  318. package/bundle/chunk-0jrgk6vk.js +0 -2
  319. package/bundle/chunk-0ne5m1n3.js +0 -2
  320. package/bundle/chunk-0qn52zsd.js +0 -2
  321. package/bundle/chunk-10accb7b.js +0 -2
  322. package/bundle/chunk-13kpdfr7.js +0 -2
  323. package/bundle/chunk-15s8zwgf.js +0 -2
  324. package/bundle/chunk-1bx2sjn6.js +0 -11
  325. package/bundle/chunk-1kgyfja6.js +0 -2
  326. package/bundle/chunk-4dtkj9zg.js +0 -2
  327. package/bundle/chunk-4e9p3e0a.js +0 -2
  328. package/bundle/chunk-4tbqsrsn.js +0 -2
  329. package/bundle/chunk-53kns5wy.js +0 -2
  330. package/bundle/chunk-559ek1ym.js +0 -2
  331. package/bundle/chunk-55wxgsga.js +0 -2
  332. package/bundle/chunk-5ke0yqqz.js +0 -8
  333. package/bundle/chunk-5q1fz2az.js +0 -2
  334. package/bundle/chunk-5sgpjgss.js +0 -10
  335. package/bundle/chunk-88emsbaz.js +0 -2
  336. package/bundle/chunk-8yn64y27.js +0 -2
  337. package/bundle/chunk-8ywa7az5.js +0 -2
  338. package/bundle/chunk-8ywdddts.js +0 -2
  339. package/bundle/chunk-92zjark4.js +0 -2
  340. package/bundle/chunk-a6z0fhta.js +0 -2
  341. package/bundle/chunk-akpssv2d.js +0 -2
  342. package/bundle/chunk-aq28ejhv.js +0 -2
  343. package/bundle/chunk-b10px5g4.js +0 -2
  344. package/bundle/chunk-bha3sbsj.js +0 -2
  345. package/bundle/chunk-bs020a3x.js +0 -2
  346. package/bundle/chunk-bs61sezq.js +0 -2
  347. package/bundle/chunk-cmdjkx32.js +0 -2
  348. package/bundle/chunk-de2rfsaf.js +0 -2
  349. package/bundle/chunk-dncnyzaa.js +0 -2
  350. package/bundle/chunk-dp6zktka.js +0 -2
  351. package/bundle/chunk-dvqdtdza.js +0 -2
  352. package/bundle/chunk-ebabnv33.js +0 -3
  353. package/bundle/chunk-ebdpg3cn.js +0 -2
  354. package/bundle/chunk-eyc6tb5h.js +0 -2
  355. package/bundle/chunk-eze57bty.js +0 -2
  356. package/bundle/chunk-fa47vzfc.js +0 -2
  357. package/bundle/chunk-fe397ph0.js +0 -2
  358. package/bundle/chunk-fr75ytdr.js +0 -2
  359. package/bundle/chunk-fw2tnbt6.js +0 -2
  360. package/bundle/chunk-fwr2qgqb.js +0 -2
  361. package/bundle/chunk-g204pt98.js +0 -2
  362. package/bundle/chunk-gcgmwqhh.js +0 -2
  363. package/bundle/chunk-grdfpd57.js +0 -2
  364. package/bundle/chunk-gw36mrg4.js +0 -2
  365. package/bundle/chunk-h36qec67.js +0 -2
  366. package/bundle/chunk-h9gtymfm.js +0 -2
  367. package/bundle/chunk-h9qn35pn.js +0 -2
  368. package/bundle/chunk-hd8q4msp.js +0 -2
  369. package/bundle/chunk-hhjkezfz.js +0 -2
  370. package/bundle/chunk-hnz570f9.js +0 -3
  371. package/bundle/chunk-jfz8wwk9.js +0 -2
  372. package/bundle/chunk-js6hqmq7.js +0 -2
  373. package/bundle/chunk-k70x182t.js +0 -2
  374. package/bundle/chunk-kwzawx7r.js +0 -2
  375. package/bundle/chunk-m0mek3es.js +0 -2
  376. package/bundle/chunk-m31d2n6h.js +0 -2
  377. package/bundle/chunk-n14qktbg.js +0 -2
  378. package/bundle/chunk-n38h109k.js +0 -17
  379. package/bundle/chunk-nzzsj54n.js +0 -2
  380. package/bundle/chunk-p19qfw59.js +0 -2
  381. package/bundle/chunk-p2yxj9s4.js +0 -2
  382. package/bundle/chunk-ps9p14y6.js +0 -2
  383. package/bundle/chunk-qagc6v17.js +0 -2
  384. package/bundle/chunk-qc0zhbhm.js +0 -2
  385. package/bundle/chunk-r78kfhvz.js +0 -2
  386. package/bundle/chunk-rnd5mnsm.js +0 -2
  387. package/bundle/chunk-schtpyjs.js +0 -2
  388. package/bundle/chunk-sp8ek94w.js +0 -5
  389. package/bundle/chunk-sxwqrvmy.js +0 -28
  390. package/bundle/chunk-syc4b8rt.js +0 -2
  391. package/bundle/chunk-tcs6wgna.js +0 -3
  392. package/bundle/chunk-tf4xwqz7.js +0 -2
  393. package/bundle/chunk-tzg4z74d.js +0 -2
  394. package/bundle/chunk-v8vcwx23.js +0 -2
  395. package/bundle/chunk-vftqwdpg.js +0 -3
  396. package/bundle/chunk-w6rf2knb.js +0 -2
  397. package/bundle/chunk-wh7r96t3.js +0 -2
  398. package/bundle/chunk-wnjqaxze.js +0 -2
  399. package/bundle/chunk-xc9se3c8.js +0 -2
  400. package/bundle/chunk-xfz698bh.js +0 -2
  401. package/bundle/chunk-xxj3sgd5.js +0 -2
  402. package/bundle/chunk-xxvqq7kc.js +0 -2
  403. package/bundle/chunk-ye0mkqb4.js +0 -2
  404. package/bundle/chunk-yfp9y71y.js +0 -2
  405. package/bundle/chunk-yjjh339w.js +0 -2
  406. package/bundle/chunk-yt6vd7a5.js +0 -2
  407. package/bundle/chunk-yzn08nx1.js +0 -2
  408. package/bundle/chunk-yzq3c3dq.js +0 -2
  409. package/bundle/chunk-z1j25911.js +0 -2
  410. package/bundle/chunk-z210dtw1.js +0 -3
  411. package/bundle/chunk-z29ahthm.js +0 -2
  412. package/bundle/chunk-zgre4gc2.js +0 -2
  413. package/bundle/chunk-zthkjx33.js +0 -2
  414. package/bundle/chunk-zwvwbrsc.js +0 -2
@@ -1,45 +1,45 @@
1
1
  // @bun
2
- import{$j as F0,Ak as M8,Bk as c7,Ck as yZ,Dk as TZ,Ek as MX,Fk as wX,Gk as RX,Hk as LX,Ik as NX,Jk as uV,Kk as vV,Lj as P$,Mj as r8,Mk as E$,Nk as jB,Ok as UB,Qk as yJ,Rk as xX,Sk as bX,Tj as Hq,Tk as vX,Uj as WV,Vj as _7,Vk as Z4,Zj as J1,Zk as WX,_k as hX,ak as IJ,bk as f2,bl as L1,dl as z2,ek as b0,el as HB,fk as z8,gl as H1,ik as xK,il as w0,jk as bK,kk as R1,lk as bV,nk as I6,ok as GB,pl as cX,qk as XB,ql as lX,rk as WB,rl as Y1,sl as R$,tk as zZ,uk as CZ,vk as oG,yk as NZ,zk as Q1}from"./chunk-rtdym35y.js";import{tl as f9}from"./chunk-5myxjxae.js";import{Gl as SG,Hl as mB,Kl as V0,Ll as e$,Ml as $1,Nl as JJ,Sl as z$,Tl as HJ,Wl as U2,am as B$,bm as i,dm as O1}from"./chunk-sp8ek94w.js";import{fm as M9,gm as u6,hm as S1,im as XJ,mm as Z0}from"./chunk-gnt982jr.js";import{An as JZ,Gn as f7,Tn as m1,Un as O8,Vm as f1,pn as t0,qn as i$,rn as e0,sn as b2,tn as BX,um as UX,vn as G$,xn as _0,yn as NJ}from"./chunk-1bx2sjn6.js";import{cp as m6}from"./chunk-n38h109k.js";import{Ap as U1,wp as YZ,xp as gV,yp as KZ}from"./chunk-qdcf1ay5.js";import{Bp as T2}from"./chunk-45mjcxqk.js";import{Cp as x$}from"./chunk-qqne79vp.js";import{sq as e}from"./chunk-xjhezxft.js";import{cs as VB}from"./chunk-w9pdvcf9.js";import{ns as HZ}from"./chunk-kb6v5hhm.js";import{Fs as G2,Gs as ZV,Ms as v1,Ns as X2}from"./chunk-xdjwapwy.js";import{lt as jZ,ut as D0}from"./chunk-cxtxvt43.js";import{vt as SB,zt as _9}from"./chunk-871f8x99.js";import{Ot as o9}from"./chunk-3sz6gw10.js";import{Qt as zB}from"./chunk-twhavv1m.js";import{$t as F9,Rt as E2,Ut as p9,Vt as YB,Yt as KB,Zt as QB,pu as BK}from"./chunk-v0yxkq99.js";import{qu as zG}from"./chunk-2pzvcpv4.js";import{Bu as k$,Ku as O$}from"./chunk-kmtfdky8.js";import{Nu as g9,Qu as y2,Ru as $$,Vu as O0,Zu as B8,_u as f$}from"./chunk-vc4e6xc4.js";import{$u as F}from"./chunk-hnz570f9.js";import{$C as p1,DL as BJ,HP as F$,LL as l$,MG as fB,NF as B0,UI as G,XL as JV,YC as ZB,aK as Z8,bG as UJ,mL as wU,nD as D$,nL as vG,oE as h2,qL as RU,rG as f,sL as qZ,uK as b1,wK as bG,yG as gB,zF as u0}from"./chunk-ydc6ypjt.js";import{aQ as x3}from"./chunk-ev3a2sxv.js";import{gQ as S9,hQ as p,iQ as o$,kQ as d0,lQ as w9,mQ as R9}from"./chunk-4sazy0nq.js";var LK=p((sS,I9)=>{function CK($){return Array.isArray($)?$:[$]}var T_=void 0,c6="",FK=" ",p6="\\",k_=/^\s+$/,E_=/(?:[^\\]|^)\\$/,x_=/^\\!/,b_=/^\\#/,v_=/\r?\n/g,h_=/^\.{0,2}\/|^\.{1,2}$/,g_=/\/$/,WJ="/",MK="node-ignore";if(typeof Symbol<"u")MK=Symbol.for("node-ignore");var DK=MK,jJ=($,J,Z)=>{return Object.defineProperty($,J,{value:Z}),Z},f_=/([0-z])-([0-z])/g,PK=()=>!1,m_=($)=>$.replace(f_,(J,Z,Y)=>Z.charCodeAt(0)<=Y.charCodeAt(0)?J:c6),u_=($)=>{let{length:J}=$;return $.slice(0,J-J%2)},d_=[[/^\uFEFF/,()=>c6],[/((?:\\\\)*?)(\\?\s+)$/,($,J,Z)=>J+(Z.indexOf("\\")===0?FK:c6)],[/(\\+?)\s/g,($,J)=>{let{length:Z}=J;return J.slice(0,Z-Z%2)+FK}],[/[\\$.|*+(){^]/g,($)=>`\\${$}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,($,J,Z)=>J+6<Z.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,($,J,Z)=>{let Y=Z.replace(/\\\*/g,"[^\\/]*");return J+Y}],[/\\\\\\(?=[$.|*+(){^])/g,()=>p6],[/\\\\/g,()=>p6],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,($,J,Z,Y,K)=>J===p6?`\\[${Z}${u_(Y)}${K}`:K==="]"?Y.length%2===0?`[${m_(Z)}${Y}]`:"[]":"[]"],[/(?:[^*])$/,($)=>/\/$/.test($)?`${$}$`:`${$}(?=$|\\/$)`]],p_=/(^|\\\/)?\\\*$/,Y8="regex",D9="checkRegex",zK="_",c_={[Y8]($,J){return`${J?`${J}[^/]+`:"[^/]*"}(?=$|\\/$)`},[D9]($,J){return`${J?`${J}[^/]*`:"[^/]*"}(?=$|\\/$)`}},l_=($)=>d_.reduce((J,[Z,Y])=>J.replace(Z,Y.bind($)),$),P9=($)=>typeof $==="string",o_=($)=>$&&P9($)&&!k_.test($)&&!E_.test($)&&$.indexOf("#")!==0,r_=($)=>$.split(v_).filter(Boolean);class IK{constructor($,J,Z,Y,K,Q){this.pattern=$,this.mark=J,this.negative=K,jJ(this,"body",Z),jJ(this,"ignoreCase",Y),jJ(this,"regexPrefix",Q)}get regex(){let $=zK+Y8;if(this[$])return this[$];return this._make(Y8,$)}get checkRegex(){let $=zK+D9;if(this[$])return this[$];return this._make(D9,$)}_make($,J){let Z=this.regexPrefix.replace(p_,c_[$]),Y=this.ignoreCase?new RegExp(Z,"i"):new RegExp(Z);return jJ(this,J,Y)}}var i_=({pattern:$,mark:J},Z)=>{let Y=!1,K=$;if(K.indexOf("!")===0)Y=!0,K=K.substr(1);K=K.replace(x_,"!").replace(b_,"#");let Q=l_(K);return new IK($,J,K,Z,Y,Q)};class AK{constructor($){this._ignoreCase=$,this._rules=[]}_add($){if($&&$[DK]){this._rules=this._rules.concat($._rules._rules),this._added=!0;return}if(P9($))$={pattern:$};if(o_($.pattern)){let J=i_($,this._ignoreCase);this._added=!0,this._rules.push(J)}}add($){return this._added=!1,CK(P9($)?r_($):$).forEach(this._add,this),this._added}test($,J,Z){let Y=!1,K=!1,Q;this._rules.forEach((X)=>{let{negative:W}=X;if(K===W&&Y!==K||W&&!Y&&!K&&!J)return;if(!X[Z].test($))return;Y=!W,K=W,Q=W?T_:X});let V={ignored:Y,unignored:K};if(Q)V.rule=Q;return V}}var s_=($,J)=>{throw new J($)},h1=($,J,Z)=>{if(!P9($))return Z(`path must be a string, but got \`${J}\``,TypeError);if(!$)return Z("path must not be empty",TypeError);if(h1.isNotRelative($))return Z(`path should be a \`path.relative()\`d string, but got "${J}"`,RangeError);return!0},SK=($)=>h_.test($);h1.isNotRelative=SK;h1.convert=($)=>$;class wK{constructor({ignorecase:$=!0,ignoreCase:J=$,allowRelativePaths:Z=!1}={}){jJ(this,DK,!0),this._rules=new AK(J),this._strictPathCheck=!Z,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add($){if(this._rules.add($))this._initCache();return this}addPattern($){return this.add($)}_test($,J,Z,Y){let K=$&&h1.convert($);return h1(K,$,this._strictPathCheck?s_:PK),this._t(K,J,Z,Y)}checkIgnore($){if(!g_.test($))return this.test($);let J=$.split(WJ).filter(Boolean);if(J.pop(),J.length){let Z=this._t(J.join(WJ)+WJ,this._testCache,!0,J);if(Z.ignored)return Z}return this._rules.test($,!1,D9)}_t($,J,Z,Y){if($ in J)return J[$];if(!Y)Y=$.split(WJ).filter(Boolean);if(Y.pop(),!Y.length)return J[$]=this._rules.test($,Z,Y8);let K=this._t(Y.join(WJ)+WJ,J,Z,Y);return J[$]=K.ignored?K:this._rules.test($,Z,Y8)}ignores($){return this._test($,this._ignoreCache,!1).ignored}createFilter(){return($)=>!this.ignores($)}filter($){return CK($).filter(this.createFilter())}test($){return this._test($,this._testCache,!0)}}var l6=($)=>new wK($),n_=($)=>h1($&&h1.convert($),$,PK),RK=()=>{let $=(Z)=>/^\\\\\?\\/.test(Z)||/["<>|\u0000-\u001F]+/u.test(Z)?Z:Z.replace(/\\/g,"/");h1.convert=$;let J=/^[a-z]:\//i;h1.isNotRelative=(Z)=>J.test(Z)||SK(Z)};if(typeof process<"u"&&process.platform==="win32")RK();I9.exports=l6;l6.default=l6;I9.exports.isPathValid=n_;jJ(I9.exports,Symbol.for("setupWindows"),RK)});var L9=p((D4)=>{D4.isInteger=($)=>{if(typeof $==="number")return Number.isInteger($);if(typeof $==="string"&&$.trim()!=="")return Number.isInteger(Number($));return!1};D4.find=($,J)=>$.nodes.find((Z)=>Z.type===J);D4.exceedsLimit=($,J,Z=1,Y)=>{if(Y===!1)return!1;if(!D4.isInteger($)||!D4.isInteger(J))return!1;return(Number(J)-Number($))/Number(Z)>=Y};D4.escapeNode=($,J=0,Z)=>{let Y=$.nodes[J];if(!Y)return;if(Z&&Y.type===Z||Y.type==="open"||Y.type==="close"){if(Y.escaped!==!0)Y.value="\\"+Y.value,Y.escaped=!0}};D4.encloseBrace=($)=>{if($.type!=="brace")return!1;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;return!1};D4.isInvalidBrace=($)=>{if($.type!=="brace")return!1;if($.invalid===!0||$.dollar)return!0;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;if($.open!==!0||$.close!==!0)return $.invalid=!0,!0;return!1};D4.isOpenOrClose=($)=>{if($.type==="open"||$.type==="close")return!0;return $.open===!0||$.close===!0};D4.reduce=($)=>$.reduce((J,Z)=>{if(Z.type==="text")J.push(Z.value);if(Z.type==="range")Z.type="text";return J},[]);D4.flatten=(...$)=>{let J=[],Z=(Y)=>{for(let K=0;K<Y.length;K++){let Q=Y[K];if(Array.isArray(Q)){Z(Q);continue}if(Q!==void 0)J.push(Q)}return J};return Z($),J}});var N9=p((Hw,mK)=>{var fK=L9();mK.exports=($,J={})=>{let Z=(Y,K={})=>{let Q=J.escapeInvalid&&fK.isInvalidBrace(K),V=Y.invalid===!0&&J.escapeInvalid===!0,X="";if(Y.value){if((Q||V)&&fK.isOpenOrClose(Y))return"\\"+Y.value;return Y.value}if(Y.value)return Y.value;if(Y.nodes)for(let W of Y.nodes)X+=Z(W);return X};return Z($)}});var dK=p((_w,uK)=>{/*!
2
+ import{$j as J1,$k as _G,Ak as NZ,Bk as V1,Ck as C8,Dk as o7,Ek as yZ,Fk as TZ,Gk as SG,Hk as TG,Ik as kG,Jk as EG,Kk as xG,Lk as cQ,Mk as fQ,Nj as P$,Oj as r8,Ok as E$,Pk as OH,Qk as qH,Sk as yJ,Tk as fG,Uk as mG,Vj as Fq,Vk as uG,Wj as HQ,Xj as _7,Xk as Q4,al as dG,bk as F0,ck as IJ,dk as f2,dl as L1,fl as z2,gk as b0,gl as zH,hk as z8,il as B1,kk as hK,kl as R0,lk as gK,mk as w1,nk as gQ,pk as I6,qk as HH,rl as sG,sk as BH,sl as nG,tk as _H,tl as Y1,ul as w$,vk as zZ,wk as MZ,xk as aX}from"./chunk-kc1xmcc9.js";import{vl as f9}from"./chunk-jjjs8p0t.js";import{Il as yX,Jl as cH,Ml as Q0,Nl as e$,Ol as $1,Pl as JJ,Ul as z$,Vl as BJ,Yl as U2,cm as H$,dm as i,fm as O1}from"./chunk-xnhvt98g.js";import{hm as C9,im as u6,jm as S1,km as GJ,om as Z0}from"./chunk-hpa7e9va.js";import{Em as f1,Lm as t0,Mm as i$,Nm as e0,Om as b2,Pm as FG,Rm as X$,Tm as _0,Um as NJ,Wm as JZ,an as u7,nn as m1,on as O8,rm as qG}from"./chunk-y287zwkr.js";import{Hn as m6}from"./chunk-9eg2ytjd.js";import{$n as YZ,ao as uQ,bo as KZ,do as U1}from"./chunk-e586sjb0.js";import{eo as T2}from"./chunk-b50t4jc5.js";import{fo as x$}from"./chunk-zdzxsyxs.js";import{Xo as e}from"./chunk-7myg8076.js";import{Hq as UH}from"./chunk-1sfcxdbw.js";import{Sq as BZ}from"./chunk-qkh8697x.js";import{ir as X2,jr as VQ,pr as v1,qr as G2}from"./chunk-pfkm3j8g.js";import{Qr as jZ,Zr as D0}from"./chunk-hmznf0ax.js";import{_r as NH,cs as _9}from"./chunk-qf1dqzra.js";import{rs as o9}from"./chunk-73fz0cf4.js";import{ts as PH}from"./chunk-9nn4jpb7.js";import{Bs as WH,Cs as jH,Es as F9,Us as OK,us as E2,xs as p9,ys as GH}from"./chunk-sh76e256.js";import{Vs as DX}from"./chunk-0z1cxvk1.js";import{et as k$,nt as O$}from"./chunk-x3afqfww.js";import{Ct as H8,Dt as f$,qt as g9,tt as y2,ut as $$,yt as O0}from"./chunk-cbmwhvxw.js";import{Et as F}from"./chunk-9etpppyv.js";import{$I as mX,AK as KQ,BB as XH,EB as p1,FI as Z8,GE as UJ,RJ as TU,SB as D$,SJ as uX,TC as h2,VJ as kU,WE as f,XJ as qZ,ZI as b1,bF as dH,cE as u0,gK as HJ,kO as F$,oK as l$,pF as pH,qE as H0,xH as X}from"./chunk-ks1cs80p.js";import{FO as h3}from"./chunk-a92hh67a.js";import{LO as S9,MO as p,NO as o$,PO as d0,QO as R9,RO as w9}from"./chunk-f83wv08n.js";var TK=p((YR,I9)=>{function PK($){return Array.isArray($)?$:[$]}var b_=void 0,c6="",CK=" ",p6="\\",v_=/^\s+$/,h_=/(?:[^\\]|^)\\$/,g_=/^\\!/,f_=/^\\#/,m_=/\r?\n/g,u_=/^\.{0,2}\/|^\.{1,2}$/,d_=/\/$/,WJ="/",IK="node-ignore";if(typeof Symbol<"u")IK=Symbol.for("node-ignore");var AK=IK,jJ=($,J,Z)=>{return Object.defineProperty($,J,{value:Z}),Z},p_=/([0-z])-([0-z])/g,SK=()=>!1,c_=($)=>$.replace(p_,(J,Z,Y)=>Z.charCodeAt(0)<=Y.charCodeAt(0)?J:c6),l_=($)=>{let{length:J}=$;return $.slice(0,J-J%2)},o_=[[/^\uFEFF/,()=>c6],[/((?:\\\\)*?)(\\?\s+)$/,($,J,Z)=>J+(Z.indexOf("\\")===0?CK:c6)],[/(\\+?)\s/g,($,J)=>{let{length:Z}=J;return J.slice(0,Z-Z%2)+CK}],[/[\\$.|*+(){^]/g,($)=>`\\${$}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,($,J,Z)=>J+6<Z.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,($,J,Z)=>{let Y=Z.replace(/\\\*/g,"[^\\/]*");return J+Y}],[/\\\\\\(?=[$.|*+(){^])/g,()=>p6],[/\\\\/g,()=>p6],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,($,J,Z,Y,K)=>J===p6?`\\[${Z}${l_(Y)}${K}`:K==="]"?Y.length%2===0?`[${c_(Z)}${Y}]`:"[]":"[]"],[/(?:[^*])$/,($)=>/\/$/.test($)?`${$}$`:`${$}(?=$|\\/$)`]],r_=/(^|\\\/)?\\\*$/,Y8="regex",D9="checkRegex",DK="_",i_={[Y8]($,J){return`${J?`${J}[^/]+`:"[^/]*"}(?=$|\\/$)`},[D9]($,J){return`${J?`${J}[^/]*`:"[^/]*"}(?=$|\\/$)`}},s_=($)=>o_.reduce((J,[Z,Y])=>J.replace(Z,Y.bind($)),$),P9=($)=>typeof $==="string",n_=($)=>$&&P9($)&&!v_.test($)&&!h_.test($)&&$.indexOf("#")!==0,a_=($)=>$.split(m_).filter(Boolean);class RK{constructor($,J,Z,Y,K,V){this.pattern=$,this.mark=J,this.negative=K,jJ(this,"body",Z),jJ(this,"ignoreCase",Y),jJ(this,"regexPrefix",V)}get regex(){let $=DK+Y8;if(this[$])return this[$];return this._make(Y8,$)}get checkRegex(){let $=DK+D9;if(this[$])return this[$];return this._make(D9,$)}_make($,J){let Z=this.regexPrefix.replace(r_,i_[$]),Y=this.ignoreCase?new RegExp(Z,"i"):new RegExp(Z);return jJ(this,J,Y)}}var t_=({pattern:$,mark:J},Z)=>{let Y=!1,K=$;if(K.indexOf("!")===0)Y=!0,K=K.substr(1);K=K.replace(g_,"!").replace(f_,"#");let V=s_(K);return new RK($,J,K,Z,Y,V)};class wK{constructor($){this._ignoreCase=$,this._rules=[]}_add($){if($&&$[AK]){this._rules=this._rules.concat($._rules._rules),this._added=!0;return}if(P9($))$={pattern:$};if(n_($.pattern)){let J=t_($,this._ignoreCase);this._added=!0,this._rules.push(J)}}add($){return this._added=!1,PK(P9($)?a_($):$).forEach(this._add,this),this._added}test($,J,Z){let Y=!1,K=!1,V;this._rules.forEach((G)=>{let{negative:W}=G;if(K===W&&Y!==K||W&&!Y&&!K&&!J)return;if(!G[Z].test($))return;Y=!W,K=W,V=W?b_:G});let Q={ignored:Y,unignored:K};if(V)Q.rule=V;return Q}}var e_=($,J)=>{throw new J($)},h1=($,J,Z)=>{if(!P9($))return Z(`path must be a string, but got \`${J}\``,TypeError);if(!$)return Z("path must not be empty",TypeError);if(h1.isNotRelative($))return Z(`path should be a \`path.relative()\`d string, but got "${J}"`,RangeError);return!0},LK=($)=>u_.test($);h1.isNotRelative=LK;h1.convert=($)=>$;class NK{constructor({ignorecase:$=!0,ignoreCase:J=$,allowRelativePaths:Z=!1}={}){jJ(this,AK,!0),this._rules=new wK(J),this._strictPathCheck=!Z,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add($){if(this._rules.add($))this._initCache();return this}addPattern($){return this.add($)}_test($,J,Z,Y){let K=$&&h1.convert($);return h1(K,$,this._strictPathCheck?e_:SK),this._t(K,J,Z,Y)}checkIgnore($){if(!d_.test($))return this.test($);let J=$.split(WJ).filter(Boolean);if(J.pop(),J.length){let Z=this._t(J.join(WJ)+WJ,this._testCache,!0,J);if(Z.ignored)return Z}return this._rules.test($,!1,D9)}_t($,J,Z,Y){if($ in J)return J[$];if(!Y)Y=$.split(WJ).filter(Boolean);if(Y.pop(),!Y.length)return J[$]=this._rules.test($,Z,Y8);let K=this._t(Y.join(WJ)+WJ,J,Z,Y);return J[$]=K.ignored?K:this._rules.test($,Z,Y8)}ignores($){return this._test($,this._ignoreCache,!1).ignored}createFilter(){return($)=>!this.ignores($)}filter($){return PK($).filter(this.createFilter())}test($){return this._test($,this._testCache,!0)}}var l6=($)=>new NK($),$4=($)=>h1($&&h1.convert($),$,SK),yK=()=>{let $=(Z)=>/^\\\\\?\\/.test(Z)||/["<>|\u0000-\u001F]+/u.test(Z)?Z:Z.replace(/\\/g,"/");h1.convert=$;let J=/^[a-z]:\//i;h1.isNotRelative=(Z)=>J.test(Z)||LK(Z)};if(typeof process<"u"&&process.platform==="win32")yK();I9.exports=l6;l6.default=l6;I9.exports.isPathValid=$4;jJ(I9.exports,Symbol.for("setupWindows"),yK)});var L9=p((S4)=>{S4.isInteger=($)=>{if(typeof $==="number")return Number.isInteger($);if(typeof $==="string"&&$.trim()!=="")return Number.isInteger(Number($));return!1};S4.find=($,J)=>$.nodes.find((Z)=>Z.type===J);S4.exceedsLimit=($,J,Z=1,Y)=>{if(Y===!1)return!1;if(!S4.isInteger($)||!S4.isInteger(J))return!1;return(Number(J)-Number($))/Number(Z)>=Y};S4.escapeNode=($,J=0,Z)=>{let Y=$.nodes[J];if(!Y)return;if(Z&&Y.type===Z||Y.type==="open"||Y.type==="close"){if(Y.escaped!==!0)Y.value="\\"+Y.value,Y.escaped=!0}};S4.encloseBrace=($)=>{if($.type!=="brace")return!1;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;return!1};S4.isInvalidBrace=($)=>{if($.type!=="brace")return!1;if($.invalid===!0||$.dollar)return!0;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;if($.open!==!0||$.close!==!0)return $.invalid=!0,!0;return!1};S4.isOpenOrClose=($)=>{if($.type==="open"||$.type==="close")return!0;return $.open===!0||$.close===!0};S4.reduce=($)=>$.reduce((J,Z)=>{if(Z.type==="text")J.push(Z.value);if(Z.type==="range")Z.type="text";return J},[]);S4.flatten=(...$)=>{let J=[],Z=(Y)=>{for(let K=0;K<Y.length;K++){let V=Y[K];if(Array.isArray(V)){Z(V);continue}if(V!==void 0)J.push(V)}return J};return Z($),J}});var N9=p((DR,pK)=>{var dK=L9();pK.exports=($,J={})=>{let Z=(Y,K={})=>{let V=J.escapeInvalid&&dK.isInvalidBrace(K),Q=Y.invalid===!0&&J.escapeInvalid===!0,G="";if(Y.value){if((V||Q)&&dK.isOpenOrClose(Y))return"\\"+Y.value;return Y.value}if(Y.value)return Y.value;if(Y.nodes)for(let W of Y.nodes)G+=Z(W);return G};return Z($)}});var lK=p((PR,cK)=>{/*!
3
3
  * is-number <https://github.com/jonschlinkert/is-number>
4
4
  *
5
5
  * Copyright (c) 2014-present, Jon Schlinkert.
6
6
  * Released under the MIT License.
7
- */uK.exports=function($){if(typeof $==="number")return $-$===0;if(typeof $==="string"&&$.trim()!=="")return Number.isFinite?Number.isFinite(+$):isFinite(+$);return!1}});var aK=p((Ow,nK)=>{/*!
7
+ */cK.exports=function($){if(typeof $==="number")return $-$===0;if(typeof $==="string"&&$.trim()!=="")return Number.isFinite?Number.isFinite(+$):isFinite(+$);return!1}});var $V=p((IR,eK)=>{/*!
8
8
  * to-regex-range <https://github.com/micromatch/to-regex-range>
9
9
  *
10
10
  * Copyright (c) 2015-present, Jon Schlinkert.
11
11
  * Released under the MIT License.
12
- */var pK=dK(),R2=($,J,Z)=>{if(pK($)===!1)throw TypeError("toRegexRange: expected the first argument to be a number");if(J===void 0||$===J)return String($);if(pK(J)===!1)throw TypeError("toRegexRange: expected the second argument to be a number.");let Y={relaxZeros:!0,...Z};if(typeof Y.strictZeros==="boolean")Y.relaxZeros=Y.strictZeros===!1;let K=String(Y.relaxZeros),Q=String(Y.shorthand),V=String(Y.capture),X=String(Y.wrap),W=$+":"+J+"="+K+Q+V+X;if(R2.cache.hasOwnProperty(W))return R2.cache[W].result;let _=Math.min($,J),j=Math.max($,J);if(Math.abs(_-j)===1){let M=$+"|"+J;if(Y.capture)return`(${M})`;if(Y.wrap===!1)return M;return`(?:${M})`}let H=sK($)||sK(J),q={min:$,max:J,a:_,b:j},U=[],z=[];if(H)q.isPadded=H,q.maxLen=String(q.max).length;if(_<0){let M=j<0?Math.abs(j):1;z=cK(M,Math.abs(_),q,Y),_=q.a=0}if(j>=0)U=cK(_,j,q,Y);if(q.negatives=z,q.positives=U,q.result=y4(z,U,Y),Y.capture===!0)q.result=`(${q.result})`;else if(Y.wrap!==!1&&U.length+z.length>1)q.result=`(?:${q.result})`;return R2.cache[W]=q,q.result};function y4($,J,Z){let Y=s6($,J,"-",!1,Z)||[],K=s6(J,$,"",!1,Z)||[],Q=s6($,J,"-?",!0,Z)||[];return Y.concat(Q).concat(K).join("|")}function T4($,J){let Z=1,Y=1,K=oK($,Z),Q=new Set([J]);while($<=K&&K<=J)Q.add(K),Z+=1,K=oK($,Z);K=rK(J+1,Y)-1;while($<K&&K<=J)Q.add(K),Y+=1,K=rK(J+1,Y)-1;return Q=[...Q],Q.sort(x4),Q}function k4($,J,Z){if($===J)return{pattern:$,count:[],digits:0};let Y=E4($,J),K=Y.length,Q="",V=0;for(let X=0;X<K;X++){let[W,_]=Y[X];if(W===_)Q+=W;else if(W!=="0"||_!=="9")Q+=b4(W,_,Z);else V++}if(V)Q+=Z.shorthand===!0?"\\d":"[0-9]";return{pattern:Q,count:[V],digits:K}}function cK($,J,Z,Y){let K=T4($,J),Q=[],V=$,X;for(let W=0;W<K.length;W++){let _=K[W],j=k4(String(V),String(_),Y),H="";if(!Z.isPadded&&X&&X.pattern===j.pattern){if(X.count.length>1)X.count.pop();X.count.push(j.count[0]),X.string=X.pattern+iK(X.count),V=_+1;continue}if(Z.isPadded)H=v4(_,Z,Y);j.string=H+j.pattern+iK(j.count),Q.push(j),V=_+1,X=j}return Q}function s6($,J,Z,Y,K){let Q=[];for(let V of $){let{string:X}=V;if(!Y&&!lK(J,"string",X))Q.push(Z+X);if(Y&&lK(J,"string",X))Q.push(Z+X)}return Q}function E4($,J){let Z=[];for(let Y=0;Y<$.length;Y++)Z.push([$[Y],J[Y]]);return Z}function x4($,J){return $>J?1:J>$?-1:0}function lK($,J,Z){return $.some((Y)=>Y[J]===Z)}function oK($,J){return Number(String($).slice(0,-J)+"9".repeat(J))}function rK($,J){return $-$%Math.pow(10,J)}function iK($){let[J=0,Z=""]=$;if(Z||J>1)return`{${J+(Z?","+Z:"")}}`;return""}function b4($,J,Z){return`[${$}${J-$===1?"":"-"}${J}]`}function sK($){return/^-?(0+)\d/.test($)}function v4($,J,Z){if(!J.isPadded)return $;let Y=Math.abs(J.maxLen-String($).length),K=Z.relaxZeros!==!1;switch(Y){case 0:return"";case 1:return K?"0?":"0";case 2:return K?"0{0,2}":"00";default:return K?`0{0,${Y}}`:`0{${Y}}`}}R2.cache={};R2.clearCache=()=>R2.cache={};nK.exports=R2});var t6=p((qw,KQ)=>{/*!
12
+ */var oK=lK(),w2=($,J,Z)=>{if(oK($)===!1)throw TypeError("toRegexRange: expected the first argument to be a number");if(J===void 0||$===J)return String($);if(oK(J)===!1)throw TypeError("toRegexRange: expected the second argument to be a number.");let Y={relaxZeros:!0,...Z};if(typeof Y.strictZeros==="boolean")Y.relaxZeros=Y.strictZeros===!1;let K=String(Y.relaxZeros),V=String(Y.shorthand),Q=String(Y.capture),G=String(Y.wrap),W=$+":"+J+"="+K+V+Q+G;if(w2.cache.hasOwnProperty(W))return w2.cache[W].result;let _=Math.min($,J),j=Math.max($,J);if(Math.abs(_-j)===1){let C=$+"|"+J;if(Y.capture)return`(${C})`;if(Y.wrap===!1)return C;return`(?:${C})`}let B=tK($)||tK(J),q={min:$,max:J,a:_,b:j},U=[],z=[];if(B)q.isPadded=B,q.maxLen=String(q.max).length;if(_<0){let C=j<0?Math.abs(j):1;z=rK(C,Math.abs(_),q,Y),_=q.a=0}if(j>=0)U=rK(_,j,q,Y);if(q.negatives=z,q.positives=U,q.result=x4(z,U,Y),Y.capture===!0)q.result=`(${q.result})`;else if(Y.wrap!==!1&&U.length+z.length>1)q.result=`(?:${q.result})`;return w2.cache[W]=q,q.result};function x4($,J,Z){let Y=s6($,J,"-",!1,Z)||[],K=s6(J,$,"",!1,Z)||[],V=s6($,J,"-?",!0,Z)||[];return Y.concat(V).concat(K).join("|")}function b4($,J){let Z=1,Y=1,K=sK($,Z),V=new Set([J]);while($<=K&&K<=J)V.add(K),Z+=1,K=sK($,Z);K=nK(J+1,Y)-1;while($<K&&K<=J)V.add(K),Y+=1,K=nK(J+1,Y)-1;return V=[...V],V.sort(g4),V}function v4($,J,Z){if($===J)return{pattern:$,count:[],digits:0};let Y=h4($,J),K=Y.length,V="",Q=0;for(let G=0;G<K;G++){let[W,_]=Y[G];if(W===_)V+=W;else if(W!=="0"||_!=="9")V+=f4(W,_,Z);else Q++}if(Q)V+=Z.shorthand===!0?"\\d":"[0-9]";return{pattern:V,count:[Q],digits:K}}function rK($,J,Z,Y){let K=b4($,J),V=[],Q=$,G;for(let W=0;W<K.length;W++){let _=K[W],j=v4(String(Q),String(_),Y),B="";if(!Z.isPadded&&G&&G.pattern===j.pattern){if(G.count.length>1)G.count.pop();G.count.push(j.count[0]),G.string=G.pattern+aK(G.count),Q=_+1;continue}if(Z.isPadded)B=m4(_,Z,Y);j.string=B+j.pattern+aK(j.count),V.push(j),Q=_+1,G=j}return V}function s6($,J,Z,Y,K){let V=[];for(let Q of $){let{string:G}=Q;if(!Y&&!iK(J,"string",G))V.push(Z+G);if(Y&&iK(J,"string",G))V.push(Z+G)}return V}function h4($,J){let Z=[];for(let Y=0;Y<$.length;Y++)Z.push([$[Y],J[Y]]);return Z}function g4($,J){return $>J?1:J>$?-1:0}function iK($,J,Z){return $.some((Y)=>Y[J]===Z)}function sK($,J){return Number(String($).slice(0,-J)+"9".repeat(J))}function nK($,J){return $-$%Math.pow(10,J)}function aK($){let[J=0,Z=""]=$;if(Z||J>1)return`{${J+(Z?","+Z:"")}}`;return""}function f4($,J,Z){return`[${$}${J-$===1?"":"-"}${J}]`}function tK($){return/^-?(0+)\d/.test($)}function m4($,J,Z){if(!J.isPadded)return $;let Y=Math.abs(J.maxLen-String($).length),K=Z.relaxZeros!==!1;switch(Y){case 0:return"";case 1:return K?"0?":"0";case 2:return K?"0{0,2}":"00";default:return K?`0{0,${Y}}`:`0{${Y}}`}}w2.cache={};w2.clearCache=()=>w2.cache={};eK.exports=w2});var t6=p((AR,XV)=>{/*!
13
13
  * fill-range <https://github.com/jonschlinkert/fill-range>
14
14
  *
15
15
  * Copyright (c) 2014-present, Jon Schlinkert.
16
16
  * Licensed under the MIT License.
17
- */var h4=d0("util"),eK=aK(),tK=($)=>$!==null&&typeof $==="object"&&!Array.isArray($),g4=($)=>{return(J)=>$===!0?Number(J):String(J)},n6=($)=>{return typeof $==="number"||typeof $==="string"&&$!==""},V8=($)=>Number.isInteger(+$),a6=($)=>{let J=`${$}`,Z=-1;if(J[0]==="-")J=J.slice(1);if(J==="0")return!1;while(J[++Z]==="0");return Z>0},f4=($,J,Z)=>{if(typeof $==="string"||typeof J==="string")return!0;return Z.stringify===!0},m4=($,J,Z)=>{if(J>0){let Y=$[0]==="-"?"-":"";if(Y)$=$.slice(1);$=Y+$.padStart(Y?J-1:J,"0")}if(Z===!1)return String($);return $},T9=($,J)=>{let Z=$[0]==="-"?"-":"";if(Z)$=$.slice(1),J--;while($.length<J)$="0"+$;return Z?"-"+$:$},u4=($,J,Z)=>{$.negatives.sort((X,W)=>X<W?-1:X>W?1:0),$.positives.sort((X,W)=>X<W?-1:X>W?1:0);let Y=J.capture?"":"?:",K="",Q="",V;if($.positives.length)K=$.positives.map((X)=>T9(String(X),Z)).join("|");if($.negatives.length)Q=`-(${Y}${$.negatives.map((X)=>T9(String(X),Z)).join("|")})`;if(K&&Q)V=`${K}|${Q}`;else V=K||Q;if(J.wrap)return`(${Y}${V})`;return V},$Q=($,J,Z,Y)=>{if(Z)return eK($,J,{wrap:!1,...Y});let K=String.fromCharCode($);if($===J)return K;let Q=String.fromCharCode(J);return`[${K}-${Q}]`},JQ=($,J,Z)=>{if(Array.isArray($)){let Y=Z.wrap===!0,K=Z.capture?"":"?:";return Y?`(${K}${$.join("|")})`:$.join("|")}return eK($,J,Z)},ZQ=(...$)=>{return RangeError("Invalid range arguments: "+h4.inspect(...$))},YQ=($,J,Z)=>{if(Z.strictRanges===!0)throw ZQ([$,J]);return[]},d4=($,J)=>{if(J.strictRanges===!0)throw TypeError(`Expected step "${$}" to be a number`);return[]},p4=($,J,Z=1,Y={})=>{let K=Number($),Q=Number(J);if(!Number.isInteger(K)||!Number.isInteger(Q)){if(Y.strictRanges===!0)throw ZQ([$,J]);return[]}if(K===0)K=0;if(Q===0)Q=0;let V=K>Q,X=String($),W=String(J),_=String(Z);Z=Math.max(Math.abs(Z),1);let j=a6(X)||a6(W)||a6(_),H=j?Math.max(X.length,W.length,_.length):0,q=j===!1&&f4($,J,Y)===!1,U=Y.transform||g4(q);if(Y.toRegex&&Z===1)return $Q(T9($,H),T9(J,H),!0,Y);let z={negatives:[],positives:[]},M=(P)=>z[P<0?"negatives":"positives"].push(Math.abs(P)),I=[],C=0;while(V?K>=Q:K<=Q){if(Y.toRegex===!0&&Z>1)M(K);else I.push(m4(U(K,C),H,q));K=V?K-Z:K+Z,C++}if(Y.toRegex===!0)return Z>1?u4(z,Y,H):JQ(I,null,{wrap:!1,...Y});return I},c4=($,J,Z=1,Y={})=>{if(!V8($)&&$.length>1||!V8(J)&&J.length>1)return YQ($,J,Y);let K=Y.transform||((q)=>String.fromCharCode(q)),Q=`${$}`.charCodeAt(0),V=`${J}`.charCodeAt(0),X=Q>V,W=Math.min(Q,V),_=Math.max(Q,V);if(Y.toRegex&&Z===1)return $Q(W,_,!1,Y);let j=[],H=0;while(X?Q>=V:Q<=V)j.push(K(Q,H)),Q=X?Q-Z:Q+Z,H++;if(Y.toRegex===!0)return JQ(j,null,{wrap:!1,options:Y});return j},y9=($,J,Z,Y={})=>{if(J==null&&n6($))return[$];if(!n6($)||!n6(J))return YQ($,J,Y);if(typeof Z==="function")return y9($,J,1,{transform:Z});if(tK(Z))return y9($,J,0,Z);let K={...Y};if(K.capture===!0)K.wrap=!0;if(Z=Z||K.step||1,!V8(Z)){if(Z!=null&&!tK(Z))return d4(Z,K);return y9($,J,1,Z)}if(V8($)&&V8(J))return p4($,J,Z,K);return c4($,J,Math.max(Math.abs(Z),1),K)};KQ.exports=y9});var GQ=p((Fw,VQ)=>{var l4=t6(),QQ=L9(),o4=($,J={})=>{let Z=(Y,K={})=>{let Q=QQ.isInvalidBrace(K),V=Y.invalid===!0&&J.escapeInvalid===!0,X=Q===!0||V===!0,W=J.escapeInvalid===!0?"\\":"",_="";if(Y.isOpen===!0)return W+Y.value;if(Y.isClose===!0)return console.log("node.isClose",W,Y.value),W+Y.value;if(Y.type==="open")return X?W+Y.value:"(";if(Y.type==="close")return X?W+Y.value:")";if(Y.type==="comma")return Y.prev.type==="comma"?"":X?Y.value:"|";if(Y.value)return Y.value;if(Y.nodes&&Y.ranges>0){let j=QQ.reduce(Y.nodes),H=l4(...j,{...J,wrap:!1,toRegex:!0,strictZeros:!0});if(H.length!==0)return j.length>1&&H.length>1?`(${H})`:H}if(Y.nodes)for(let j of Y.nodes)_+=Z(j,Y);return _};return Z($)};VQ.exports=o4});var jQ=p((zw,WQ)=>{var r4=t6(),XQ=N9(),_J=L9(),L2=($="",J="",Z=!1)=>{let Y=[];if($=[].concat($),J=[].concat(J),!J.length)return $;if(!$.length)return Z?_J.flatten(J).map((K)=>`{${K}}`):J;for(let K of $)if(Array.isArray(K))for(let Q of K)Y.push(L2(Q,J,Z));else for(let Q of J){if(Z===!0&&typeof Q==="string")Q=`{${Q}}`;Y.push(Array.isArray(Q)?L2(K,Q,Z):K+Q)}return _J.flatten(Y)},i4=($,J={})=>{let Z=J.rangeLimit===void 0?1000:J.rangeLimit,Y=(K,Q={})=>{K.queue=[];let V=Q,X=Q.queue;while(V.type!=="brace"&&V.type!=="root"&&V.parent)V=V.parent,X=V.queue;if(K.invalid||K.dollar){X.push(L2(X.pop(),XQ(K,J)));return}if(K.type==="brace"&&K.invalid!==!0&&K.nodes.length===2){X.push(L2(X.pop(),["{}"]));return}if(K.nodes&&K.ranges>0){let H=_J.reduce(K.nodes);if(_J.exceedsLimit(...H,J.step,Z))throw RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let q=r4(...H,J);if(q.length===0)q=XQ(K,J);X.push(L2(X.pop(),q)),K.nodes=[];return}let W=_J.encloseBrace(K),_=K.queue,j=K;while(j.type!=="brace"&&j.type!=="root"&&j.parent)j=j.parent,_=j.queue;for(let H=0;H<K.nodes.length;H++){let q=K.nodes[H];if(q.type==="comma"&&K.type==="brace"){if(H===1)_.push("");_.push("");continue}if(q.type==="close"){X.push(L2(X.pop(),_,W));continue}if(q.value&&q.type!=="open"){_.push(L2(_.pop(),q.value));continue}if(q.nodes)Y(q,K)}return _};return _J.flatten(Y($))};WQ.exports=i4});var BQ=p((Cw,UQ)=>{UQ.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
18
- `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var FQ=p((Mw,qQ)=>{var s4=N9(),{MAX_LENGTH:HQ,CHAR_BACKSLASH:e6,CHAR_BACKTICK:n4,CHAR_COMMA:a4,CHAR_DOT:t4,CHAR_LEFT_PARENTHESES:e4,CHAR_RIGHT_PARENTHESES:$O,CHAR_LEFT_CURLY_BRACE:JO,CHAR_RIGHT_CURLY_BRACE:ZO,CHAR_LEFT_SQUARE_BRACKET:_Q,CHAR_RIGHT_SQUARE_BRACKET:OQ,CHAR_DOUBLE_QUOTE:YO,CHAR_SINGLE_QUOTE:KO,CHAR_NO_BREAK_SPACE:QO,CHAR_ZERO_WIDTH_NOBREAK_SPACE:VO}=BQ(),GO=($,J={})=>{if(typeof $!=="string")throw TypeError("Expected a string");let Z=J||{},Y=typeof Z.maxLength==="number"?Math.min(HQ,Z.maxLength):HQ;if($.length>Y)throw SyntaxError(`Input length (${$.length}), exceeds max characters (${Y})`);let K={type:"root",input:$,nodes:[]},Q=[K],V=K,X=K,W=0,_=$.length,j=0,H=0,q,U=()=>$[j++],z=(M)=>{if(M.type==="text"&&X.type==="dot")X.type="text";if(X&&X.type==="text"&&M.type==="text"){X.value+=M.value;return}return V.nodes.push(M),M.parent=V,M.prev=X,X=M,M};z({type:"bos"});while(j<_){if(V=Q[Q.length-1],q=U(),q===VO||q===QO)continue;if(q===e6){z({type:"text",value:(J.keepEscaping?q:"")+U()});continue}if(q===OQ){z({type:"text",value:"\\"+q});continue}if(q===_Q){W++;let M;while(j<_&&(M=U())){if(q+=M,M===_Q){W++;continue}if(M===e6){q+=U();continue}if(M===OQ){if(W--,W===0)break}}z({type:"text",value:q});continue}if(q===e4){V=z({type:"paren",nodes:[]}),Q.push(V),z({type:"text",value:q});continue}if(q===$O){if(V.type!=="paren"){z({type:"text",value:q});continue}V=Q.pop(),z({type:"text",value:q}),V=Q[Q.length-1];continue}if(q===YO||q===KO||q===n4){let M=q,I;if(J.keepQuotes!==!0)q="";while(j<_&&(I=U())){if(I===e6){q+=I+U();continue}if(I===M){if(J.keepQuotes===!0)q+=I;break}q+=I}z({type:"text",value:q});continue}if(q===JO){H++;let I={type:"brace",open:!0,close:!1,dollar:X.value&&X.value.slice(-1)==="$"||V.dollar===!0,depth:H,commas:0,ranges:0,nodes:[]};V=z(I),Q.push(V),z({type:"open",value:q});continue}if(q===ZO){if(V.type!=="brace"){z({type:"text",value:q});continue}let M="close";V=Q.pop(),V.close=!0,z({type:M,value:q}),H--,V=Q[Q.length-1];continue}if(q===a4&&H>0){if(V.ranges>0){V.ranges=0;let M=V.nodes.shift();V.nodes=[M,{type:"text",value:s4(V)}]}z({type:"comma",value:q}),V.commas++;continue}if(q===t4&&H>0&&V.commas===0){let M=V.nodes;if(H===0||M.length===0){z({type:"text",value:q});continue}if(X.type==="dot"){if(V.range=[],X.value+=q,X.type="range",V.nodes.length!==3&&V.nodes.length!==5){V.invalid=!0,V.ranges=0,X.type="text";continue}V.ranges++,V.args=[];continue}if(X.type==="range"){M.pop();let I=M[M.length-1];I.value+=X.value+q,X=I,V.ranges--;continue}z({type:"dot",value:q});continue}z({type:"text",value:q})}do if(V=Q.pop(),V.type!=="root"){V.nodes.forEach((C)=>{if(!C.nodes){if(C.type==="open")C.isOpen=!0;if(C.type==="close")C.isClose=!0;if(!C.nodes)C.type="text";C.invalid=!0}});let M=Q[Q.length-1],I=M.nodes.indexOf(V);M.nodes.splice(I,1,...V.nodes)}while(Q.length>0);return z({type:"eos"}),K};qQ.exports=GO});var MQ=p((Dw,CQ)=>{var zQ=N9(),XO=GQ(),WO=jQ(),jO=FQ(),p0=($,J={})=>{let Z=[];if(Array.isArray($))for(let Y of $){let K=p0.create(Y,J);if(Array.isArray(K))Z.push(...K);else Z.push(K)}else Z=[].concat(p0.create($,J));if(J&&J.expand===!0&&J.nodupes===!0)Z=[...new Set(Z)];return Z};p0.parse=($,J={})=>jO($,J);p0.stringify=($,J={})=>{if(typeof $==="string")return zQ(p0.parse($,J),J);return zQ($,J)};p0.compile=($,J={})=>{if(typeof $==="string")$=p0.parse($,J);return XO($,J)};p0.expand=($,J={})=>{if(typeof $==="string")$=p0.parse($,J);let Z=WO($,J);if(J.noempty===!0)Z=Z.filter(Boolean);if(J.nodupes===!0)Z=[...new Set(Z)];return Z};p0.create=($,J={})=>{if($===""||$.length<3)return[$];return J.expand!==!0?p0.compile($,J):p0.expand($,J)};CQ.exports=p0});var G8=p((Pw,PQ)=>{var UO=d0("path"),DQ={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},BO={...DQ,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"},HO={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};PQ.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:HO,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:UO.sep,extglobChars($){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${$.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars($){return $===!0?BO:DQ}}});var X8=p((MO)=>{var _O=d0("path"),OO=process.platform==="win32",{REGEX_BACKSLASH:qO,REGEX_REMOVE_BACKSLASH:FO,REGEX_SPECIAL_CHARS:zO,REGEX_SPECIAL_CHARS_GLOBAL:CO}=G8();MO.isObject=($)=>$!==null&&typeof $==="object"&&!Array.isArray($);MO.hasRegexChars=($)=>zO.test($);MO.isRegexChar=($)=>$.length===1&&MO.hasRegexChars($);MO.escapeRegex=($)=>$.replace(CO,"\\$1");MO.toPosixSlashes=($)=>$.replace(qO,"/");MO.removeBackslashes=($)=>{return $.replace(FO,(J)=>{return J==="\\"?"":J})};MO.supportsLookbehinds=()=>{let $=process.version.slice(1).split(".").map(Number);if($.length===3&&$[0]>=9||$[0]===8&&$[1]>=10)return!0;return!1};MO.isWindows=($)=>{if($&&typeof $.windows==="boolean")return $.windows;return OO===!0||_O.sep==="\\"};MO.escapeLast=($,J,Z)=>{let Y=$.lastIndexOf(J,Z);if(Y===-1)return $;if($[Y-1]==="\\")return MO.escapeLast($,J,Y-1);return`${$.slice(0,Y)}\\${$.slice(Y)}`};MO.removePrefix=($,J={})=>{let Z=$;if(Z.startsWith("./"))Z=Z.slice(2),J.prefix="./";return Z};MO.wrapOutput=($,J={},Z={})=>{let Y=Z.contains?"":"^",K=Z.contains?"":"$",Q=`${Y}(?:${$})${K}`;if(J.negated===!0)Q=`(?:^(?!${Q}).*$)`;return Q}});var kQ=p((Aw,TQ)=>{var SQ=X8(),{CHAR_ASTERISK:$7,CHAR_AT:yO,CHAR_BACKWARD_SLASH:W8,CHAR_COMMA:TO,CHAR_DOT:J7,CHAR_EXCLAMATION_MARK:Z7,CHAR_FORWARD_SLASH:yQ,CHAR_LEFT_CURLY_BRACE:Y7,CHAR_LEFT_PARENTHESES:K7,CHAR_LEFT_SQUARE_BRACKET:kO,CHAR_PLUS:EO,CHAR_QUESTION_MARK:wQ,CHAR_RIGHT_CURLY_BRACE:xO,CHAR_RIGHT_PARENTHESES:RQ,CHAR_RIGHT_SQUARE_BRACKET:bO}=G8(),LQ=($)=>{return $===yQ||$===W8},NQ=($)=>{if($.isPrefix!==!0)$.depth=$.isGlobstar?1/0:1},vO=($,J)=>{let Z=J||{},Y=$.length-1,K=Z.parts===!0||Z.scanToEnd===!0,Q=[],V=[],X=[],W=$,_=-1,j=0,H=0,q=!1,U=!1,z=!1,M=!1,I=!1,C=!1,P=!1,D=!1,L=!1,R=!1,N=0,x,b,v={value:"",depth:0,isGlob:!1},m=()=>_>=Y,A=()=>W.charCodeAt(_+1),u=()=>{return x=b,W.charCodeAt(++_)};while(_<Y){b=u();let A$;if(b===W8){if(P=v.backslashes=!0,b=u(),b===Y7)C=!0;continue}if(C===!0||b===Y7){N++;while(m()!==!0&&(b=u())){if(b===W8){P=v.backslashes=!0,u();continue}if(b===Y7){N++;continue}if(C!==!0&&b===J7&&(b=u())===J7){if(q=v.isBrace=!0,z=v.isGlob=!0,R=!0,K===!0)continue;break}if(C!==!0&&b===TO){if(q=v.isBrace=!0,z=v.isGlob=!0,R=!0,K===!0)continue;break}if(b===xO){if(N--,N===0){C=!1,q=v.isBrace=!0,R=!0;break}}}if(K===!0)continue;break}if(b===yQ){if(Q.push(_),V.push(v),v={value:"",depth:0,isGlob:!1},R===!0)continue;if(x===J7&&_===j+1){j+=2;continue}H=_+1;continue}if(Z.noext!==!0){if((b===EO||b===yO||b===$7||b===wQ||b===Z7)===!0&&A()===K7){if(z=v.isGlob=!0,M=v.isExtglob=!0,R=!0,b===Z7&&_===j)L=!0;if(K===!0){while(m()!==!0&&(b=u())){if(b===W8){P=v.backslashes=!0,b=u();continue}if(b===RQ){z=v.isGlob=!0,R=!0;break}}continue}break}}if(b===$7){if(x===$7)I=v.isGlobstar=!0;if(z=v.isGlob=!0,R=!0,K===!0)continue;break}if(b===wQ){if(z=v.isGlob=!0,R=!0,K===!0)continue;break}if(b===kO){while(m()!==!0&&(A$=u())){if(A$===W8){P=v.backslashes=!0,u();continue}if(A$===bO){U=v.isBracket=!0,z=v.isGlob=!0,R=!0;break}}if(K===!0)continue;break}if(Z.nonegate!==!0&&b===Z7&&_===j){D=v.negated=!0,j++;continue}if(Z.noparen!==!0&&b===K7){if(z=v.isGlob=!0,K===!0){while(m()!==!0&&(b=u())){if(b===K7){P=v.backslashes=!0,b=u();continue}if(b===RQ){R=!0;break}}continue}break}if(z===!0){if(R=!0,K===!0)continue;break}}if(Z.noext===!0)M=!1,z=!1;let r=W,S="",T="";if(j>0)S=W.slice(0,j),W=W.slice(j),H-=j;if(r&&z===!0&&H>0)r=W.slice(0,H),T=W.slice(H);else if(z===!0)r="",T=W;else r=W;if(r&&r!==""&&r!=="/"&&r!==W){if(LQ(r.charCodeAt(r.length-1)))r=r.slice(0,-1)}if(Z.unescape===!0){if(T)T=SQ.removeBackslashes(T);if(r&&P===!0)r=SQ.removeBackslashes(r)}let k={prefix:S,input:$,start:j,base:r,glob:T,isBrace:q,isBracket:U,isGlob:z,isExtglob:M,isGlobstar:I,negated:D,negatedExtglob:L};if(Z.tokens===!0){if(k.maxDepth=0,!LQ(b))V.push(v);k.tokens=V}if(Z.parts===!0||Z.tokens===!0){let A$;for(let s=0;s<Q.length;s++){let J$=A$?A$+1:j,Z$=Q[s],W$=$.slice(J$,Z$);if(Z.tokens){if(s===0&&j!==0)V[s].isPrefix=!0,V[s].value=S;else V[s].value=W$;NQ(V[s]),k.maxDepth+=V[s].depth}if(s!==0||W$!=="")X.push(W$);A$=Z$}if(A$&&A$+1<$.length){let s=$.slice(A$+1);if(X.push(s),Z.tokens)V[V.length-1].value=s,NQ(V[V.length-1]),k.maxDepth+=V[V.length-1].depth}k.slashes=Q,k.parts=X}return k};TQ.exports=vO});var hQ=p((Sw,vQ)=>{var j8=G8(),S0=X8(),{MAX_LENGTH:k9,POSIX_REGEX_SOURCE:hO,REGEX_NON_SPECIAL_CHARS:gO,REGEX_SPECIAL_CHARS_BACKREF:fO,REPLACEMENTS:EQ}=j8,mO=($,J)=>{if(typeof J.expandRange==="function")return J.expandRange(...$,J);$.sort();let Z=`[${$.join("-")}]`;try{new RegExp(Z)}catch(Y){return $.map((K)=>S0.escapeRegex(K)).join("..")}return Z},OJ=($,J)=>{return`Missing ${$}: "${J}" - use "\\\\${J}" to match literal characters`},xQ=($)=>{let J=[],Z=0,Y=0,K=0,Q="",V=!1;for(let X of $){if(V===!0){Q+=X,V=!1;continue}if(X==="\\"){Q+=X,V=!0;continue}if(X==='"'){K=K===1?0:1,Q+=X;continue}if(K===0){if(X==="[")Z++;else if(X==="]"&&Z>0)Z--;else if(Z===0){if(X==="(")Y++;else if(X===")"&&Y>0)Y--;else if(X==="|"&&Y===0){J.push(Q),Q="";continue}}}Q+=X}return J.push(Q),J},uO=($)=>{let J=!1;for(let Z of $){if(J===!0){J=!1;continue}if(Z==="\\"){J=!0;continue}if(/[?*+@!()[\]{}]/.test(Z))return!1}return!0},bQ=($)=>{let J=$.trim(),Z=!0;while(Z===!0)if(Z=!1,/^@\([^\\()[\]{}|]+\)$/.test(J))J=J.slice(2,-1),Z=!0;if(!uO(J))return;return J.replace(/\\(.)/g,"$1")},dO=($)=>{let J=$.map(bQ).filter(Boolean);for(let Z=0;Z<J.length;Z++)for(let Y=Z+1;Y<J.length;Y++){let K=J[Z],Q=J[Y],V=K[0];if(!V||K!==V.repeat(K.length)||Q!==V.repeat(Q.length))continue;if(K===Q||K.startsWith(Q)||Q.startsWith(K))return!0}return!1},Q7=($,J=!0)=>{if($[0]!=="+"&&$[0]!=="*"||$[1]!=="(")return;let Z=0,Y=0,K=0,Q=!1;for(let V=1;V<$.length;V++){let X=$[V];if(Q===!0){Q=!1;continue}if(X==="\\"){Q=!0;continue}if(X==='"'){K=K===1?0:1;continue}if(K===1)continue;if(X==="["){Z++;continue}if(X==="]"&&Z>0){Z--;continue}if(Z>0)continue;if(X==="("){Y++;continue}if(X===")"){if(Y--,Y===0){if(J===!0&&V!==$.length-1)return;return{type:$[0],body:$.slice(2,V),end:V}}}}},pO=($)=>{let J=0,Z=[];while(J<$.length){let K=Q7($.slice(J),!1);if(!K||K.type!=="*")return;let Q=xQ(K.body).map((X)=>X.trim());if(Q.length!==1)return;let V=bQ(Q[0]);if(!V||V.length!==1)return;Z.push(V),J+=K.end+1}if(Z.length<1)return;return`${Z.length===1?S0.escapeRegex(Z[0]):`[${Z.map((K)=>S0.escapeRegex(K)).join("")}]`}*`},cO=($)=>{let J=0,Z=$.trim(),Y=Q7(Z);while(Y)J++,Z=Y.body.trim(),Y=Q7(Z);return J},lO=($,J)=>{if(J.maxExtglobRecursion===!1)return{risky:!1};let Z=typeof J.maxExtglobRecursion==="number"?J.maxExtglobRecursion:j8.DEFAULT_MAX_EXTGLOB_RECURSION,Y=xQ($).map((K)=>K.trim());if(Y.length>1){if(Y.some((K)=>K==="")||Y.some((K)=>/^[*?]+$/.test(K))||dO(Y))return{risky:!0}}for(let K of Y){let Q=pO(K);if(Q)return{risky:!0,safeOutput:Q};if(cO(K)>Z)return{risky:!0}}return{risky:!1}},V7=($,J)=>{if(typeof $!=="string")throw TypeError("Expected a string");$=EQ[$]||$;let Z={...J},Y=typeof Z.maxLength==="number"?Math.min(k9,Z.maxLength):k9,K=$.length;if(K>Y)throw SyntaxError(`Input length: ${K}, exceeds maximum allowed length: ${Y}`);let Q={type:"bos",value:"",output:Z.prepend||""},V=[Q],X=Z.capture?"":"?:",W=S0.isWindows(J),_=j8.globChars(W),j=j8.extglobChars(_),{DOT_LITERAL:H,PLUS_LITERAL:q,SLASH_LITERAL:U,ONE_CHAR:z,DOTS_SLASH:M,NO_DOT:I,NO_DOT_SLASH:C,NO_DOTS_SLASH:P,QMARK:D,QMARK_NO_DOT:L,STAR:R,START_ANCHOR:N}=_,x=(d)=>{return`(${X}(?:(?!${N}${d.dot?M:H}).)*?)`},b=Z.dot?"":I,v=Z.dot?D:L,m=Z.bash===!0?x(Z):R;if(Z.capture)m=`(${m})`;if(typeof Z.noext==="boolean")Z.noextglob=Z.noext;let A={input:$,index:-1,start:0,dot:Z.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:V};$=S0.removePrefix($,A),K=$.length;let u=[],r=[],S=[],T=Q,k,A$=()=>A.index===K-1,s=A.peek=(d=1)=>$[A.index+d],J$=A.advance=()=>$[++A.index]||"",Z$=()=>$.slice(A.index+1),W$=(d="",Y$=0)=>{A.consumed+=d,A.index+=Y$},y$=(d)=>{A.output+=d.output!=null?d.output:d.value,W$(d.value)},Q$=()=>{let d=1;while(s()==="!"&&(s(2)!=="("||s(3)==="?"))J$(),A.start++,d++;if(d%2===0)return!1;return A.negated=!0,A.start++,!0},y=(d)=>{A[d]++,S.push(d)},n=(d)=>{A[d]--,S.pop()},a=(d)=>{if(T.type==="globstar"){let Y$=A.braces>0&&(d.type==="comma"||d.type==="brace"),g=d.extglob===!0||u.length&&(d.type==="pipe"||d.type==="paren");if(d.type!=="slash"&&d.type!=="paren"&&!Y$&&!g)A.output=A.output.slice(0,-T.output.length),T.type="star",T.value="*",T.output=m,A.output+=T.output}if(u.length&&d.type!=="paren")u[u.length-1].inner+=d.value;if(d.value||d.output)y$(d);if(T&&T.type==="text"&&d.type==="text"){T.value+=d.value,T.output=(T.output||"")+d.value;return}d.prev=T,V.push(d),T=d},c$=(d,Y$)=>{let g={...j[Y$],conditions:1,inner:""};g.prev=T,g.parens=A.parens,g.output=A.output,g.startIndex=A.index,g.tokensIndex=V.length;let t=(Z.capture?"(":"")+g.open;y("parens"),a({type:d,value:Y$,output:A.output?"":z}),a({type:"paren",extglob:!0,value:J$(),output:t}),u.push(g)},l=(d)=>{let Y$=$.slice(d.startIndex,A.index+1),g=$.slice(d.startIndex+2,A.index),t=lO(g,Z);if((d.type==="plus"||d.type==="star")&&t.risky){let M$=t.safeOutput?(d.output?"":z)+(Z.capture?`(${t.safeOutput})`:t.safeOutput):void 0,r$=V[d.tokensIndex];r$.type="text",r$.value=Y$,r$.output=M$||S0.escapeRegex(Y$);for(let K0=d.tokensIndex+1;K0<V.length;K0++)V[K0].value="",V[K0].output="",delete V[K0].suffix;A.output=d.output+r$.output,A.backtrack=!0,a({type:"paren",extglob:!0,value:k,output:""}),n("parens");return}let C$=d.close+(Z.capture?")":""),T$;if(d.type==="negate"){let M$=m;if(d.inner&&d.inner.length>1&&d.inner.includes("/"))M$=x(Z);if(M$!==m||A$()||/^\)+$/.test(Z$()))C$=d.close=`)$))${M$}`;if(d.inner.includes("*")&&(T$=Z$())&&/^\.[^\\/.]+$/.test(T$)){let r$=V7(T$,{...J,fastpaths:!1}).output;C$=d.close=`)${r$})${M$})`}if(d.prev.type==="bos")A.negatedExtglob=!0}a({type:"paren",extglob:!0,value:k,output:C$}),n("parens")};if(Z.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test($)){let d=!1,Y$=$.replace(fO,(g,t,C$,T$,M$,r$)=>{if(T$==="\\")return d=!0,g;if(T$==="?"){if(t)return t+T$+(M$?D.repeat(M$.length):"");if(r$===0)return v+(M$?D.repeat(M$.length):"");return D.repeat(C$.length)}if(T$===".")return H.repeat(C$.length);if(T$==="*"){if(t)return t+T$+(M$?m:"");return m}return t?g:`\\${g}`});if(d===!0)if(Z.unescape===!0)Y$=Y$.replace(/\\/g,"");else Y$=Y$.replace(/\\+/g,(g)=>{return g.length%2===0?"\\\\":g?"\\":""});if(Y$===$&&Z.contains===!0)return A.output=$,A;return A.output=S0.wrapOutput(Y$,A,J),A}while(!A$()){if(k=J$(),k==="\x00")continue;if(k==="\\"){let g=s();if(g==="/"&&Z.bash!==!0)continue;if(g==="."||g===";")continue;if(!g){k+="\\",a({type:"text",value:k});continue}let t=/^\\+/.exec(Z$()),C$=0;if(t&&t[0].length>2){if(C$=t[0].length,A.index+=C$,C$%2!==0)k+="\\"}if(Z.unescape===!0)k=J$();else k+=J$();if(A.brackets===0){a({type:"text",value:k});continue}}if(A.brackets>0&&(k!=="]"||T.value==="["||T.value==="[^")){if(Z.posix!==!1&&k===":"){let g=T.value.slice(1);if(g.includes("[")){if(T.posix=!0,g.includes(":")){let t=T.value.lastIndexOf("["),C$=T.value.slice(0,t),T$=T.value.slice(t+2),M$=hO[T$];if(M$){if(T.value=C$+M$,A.backtrack=!0,J$(),!Q.output&&V.indexOf(T)===1)Q.output=z;continue}}}}if(k==="["&&s()!==":"||k==="-"&&s()==="]")k=`\\${k}`;if(k==="]"&&(T.value==="["||T.value==="[^"))k=`\\${k}`;if(Z.posix===!0&&k==="!"&&T.value==="[")k="^";T.value+=k,y$({value:k});continue}if(A.quotes===1&&k!=='"'){k=S0.escapeRegex(k),T.value+=k,y$({value:k});continue}if(k==='"'){if(A.quotes=A.quotes===1?0:1,Z.keepQuotes===!0)a({type:"text",value:k});continue}if(k==="("){y("parens"),a({type:"paren",value:k});continue}if(k===")"){if(A.parens===0&&Z.strictBrackets===!0)throw SyntaxError(OJ("opening","("));let g=u[u.length-1];if(g&&A.parens===g.parens+1){l(u.pop());continue}a({type:"paren",value:k,output:A.parens?")":"\\)"}),n("parens");continue}if(k==="["){if(Z.nobracket===!0||!Z$().includes("]")){if(Z.nobracket!==!0&&Z.strictBrackets===!0)throw SyntaxError(OJ("closing","]"));k=`\\${k}`}else y("brackets");a({type:"bracket",value:k});continue}if(k==="]"){if(Z.nobracket===!0||T&&T.type==="bracket"&&T.value.length===1){a({type:"text",value:k,output:`\\${k}`});continue}if(A.brackets===0){if(Z.strictBrackets===!0)throw SyntaxError(OJ("opening","["));a({type:"text",value:k,output:`\\${k}`});continue}n("brackets");let g=T.value.slice(1);if(T.posix!==!0&&g[0]==="^"&&!g.includes("/"))k=`/${k}`;if(T.value+=k,y$({value:k}),Z.literalBrackets===!1||S0.hasRegexChars(g))continue;let t=S0.escapeRegex(T.value);if(A.output=A.output.slice(0,-T.value.length),Z.literalBrackets===!0){A.output+=t,T.value=t;continue}T.value=`(${X}${t}|${T.value})`,A.output+=T.value;continue}if(k==="{"&&Z.nobrace!==!0){y("braces");let g={type:"brace",value:k,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};r.push(g),a(g);continue}if(k==="}"){let g=r[r.length-1];if(Z.nobrace===!0||!g){a({type:"text",value:k,output:k});continue}let t=")";if(g.dots===!0){let C$=V.slice(),T$=[];for(let M$=C$.length-1;M$>=0;M$--){if(V.pop(),C$[M$].type==="brace")break;if(C$[M$].type!=="dots")T$.unshift(C$[M$].value)}t=mO(T$,Z),A.backtrack=!0}if(g.comma!==!0&&g.dots!==!0){let C$=A.output.slice(0,g.outputIndex),T$=A.tokens.slice(g.tokensIndex);g.value=g.output="\\{",k=t="\\}",A.output=C$;for(let M$ of T$)A.output+=M$.output||M$.value}a({type:"brace",value:k,output:t}),n("braces"),r.pop();continue}if(k==="|"){if(u.length>0)u[u.length-1].conditions++;a({type:"text",value:k});continue}if(k===","){let g=k,t=r[r.length-1];if(t&&S[S.length-1]==="braces")t.comma=!0,g="|";a({type:"comma",value:k,output:g});continue}if(k==="/"){if(T.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",V.pop(),T=Q;continue}a({type:"slash",value:k,output:U});continue}if(k==="."){if(A.braces>0&&T.type==="dot"){if(T.value===".")T.output=H;let g=r[r.length-1];T.type="dots",T.output+=k,T.value+=k,g.dots=!0;continue}if(A.braces+A.parens===0&&T.type!=="bos"&&T.type!=="slash"){a({type:"text",value:k,output:H});continue}a({type:"dot",value:k,output:H});continue}if(k==="?"){if(!(T&&T.value==="(")&&Z.noextglob!==!0&&s()==="("&&s(2)!=="?"){c$("qmark",k);continue}if(T&&T.type==="paren"){let t=s(),C$=k;if(t==="<"&&!S0.supportsLookbehinds())throw Error("Node.js v10 or higher is required for regex lookbehinds");if(T.value==="("&&!/[!=<:]/.test(t)||t==="<"&&!/<([!=]|\w+>)/.test(Z$()))C$=`\\${k}`;a({type:"text",value:k,output:C$});continue}if(Z.dot!==!0&&(T.type==="slash"||T.type==="bos")){a({type:"qmark",value:k,output:L});continue}a({type:"qmark",value:k,output:D});continue}if(k==="!"){if(Z.noextglob!==!0&&s()==="("){if(s(2)!=="?"||!/[!=<:]/.test(s(3))){c$("negate",k);continue}}if(Z.nonegate!==!0&&A.index===0){Q$();continue}}if(k==="+"){if(Z.noextglob!==!0&&s()==="("&&s(2)!=="?"){c$("plus",k);continue}if(T&&T.value==="("||Z.regex===!1){a({type:"plus",value:k,output:q});continue}if(T&&(T.type==="bracket"||T.type==="paren"||T.type==="brace")||A.parens>0){a({type:"plus",value:k});continue}a({type:"plus",value:q});continue}if(k==="@"){if(Z.noextglob!==!0&&s()==="("&&s(2)!=="?"){a({type:"at",extglob:!0,value:k,output:""});continue}a({type:"text",value:k});continue}if(k!=="*"){if(k==="$"||k==="^")k=`\\${k}`;let g=gO.exec(Z$());if(g)k+=g[0],A.index+=g[0].length;a({type:"text",value:k});continue}if(T&&(T.type==="globstar"||T.star===!0)){T.type="star",T.star=!0,T.value+=k,T.output=m,A.backtrack=!0,A.globstar=!0,W$(k);continue}let d=Z$();if(Z.noextglob!==!0&&/^\([^?]/.test(d)){c$("star",k);continue}if(T.type==="star"){if(Z.noglobstar===!0){W$(k);continue}let g=T.prev,t=g.prev,C$=g.type==="slash"||g.type==="bos",T$=t&&(t.type==="star"||t.type==="globstar");if(Z.bash===!0&&(!C$||d[0]&&d[0]!=="/")){a({type:"star",value:k,output:""});continue}let M$=A.braces>0&&(g.type==="comma"||g.type==="brace"),r$=u.length&&(g.type==="pipe"||g.type==="paren");if(!C$&&g.type!=="paren"&&!M$&&!r$){a({type:"star",value:k,output:""});continue}while(d.slice(0,3)==="/**"){let K0=$[A.index+4];if(K0&&K0!=="/")break;d=d.slice(3),W$("/**",3)}if(g.type==="bos"&&A$()){T.type="globstar",T.value+=k,T.output=x(Z),A.output=T.output,A.globstar=!0,W$(k);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&!T$&&A$()){A.output=A.output.slice(0,-(g.output+T.output).length),g.output=`(?:${g.output}`,T.type="globstar",T.output=x(Z)+(Z.strictSlashes?")":"|$)"),T.value+=k,A.globstar=!0,A.output+=g.output+T.output,W$(k);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&d[0]==="/"){let K0=d[1]!==void 0?"|$":"";A.output=A.output.slice(0,-(g.output+T.output).length),g.output=`(?:${g.output}`,T.type="globstar",T.output=`${x(Z)}${U}|${U}${K0})`,T.value+=k,A.output+=g.output+T.output,A.globstar=!0,W$(k+J$()),a({type:"slash",value:"/",output:""});continue}if(g.type==="bos"&&d[0]==="/"){T.type="globstar",T.value+=k,T.output=`(?:^|${U}|${x(Z)}${U})`,A.output=T.output,A.globstar=!0,W$(k+J$()),a({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-T.output.length),T.type="globstar",T.output=x(Z),T.value+=k,A.output+=T.output,A.globstar=!0,W$(k);continue}let Y$={type:"star",value:k,output:m};if(Z.bash===!0){if(Y$.output=".*?",T.type==="bos"||T.type==="slash")Y$.output=b+Y$.output;a(Y$);continue}if(T&&(T.type==="bracket"||T.type==="paren")&&Z.regex===!0){Y$.output=k,a(Y$);continue}if(A.index===A.start||T.type==="slash"||T.type==="dot"){if(T.type==="dot")A.output+=C,T.output+=C;else if(Z.dot===!0)A.output+=P,T.output+=P;else A.output+=b,T.output+=b;if(s()!=="*")A.output+=z,T.output+=z}a(Y$)}while(A.brackets>0){if(Z.strictBrackets===!0)throw SyntaxError(OJ("closing","]"));A.output=S0.escapeLast(A.output,"["),n("brackets")}while(A.parens>0){if(Z.strictBrackets===!0)throw SyntaxError(OJ("closing",")"));A.output=S0.escapeLast(A.output,"("),n("parens")}while(A.braces>0){if(Z.strictBrackets===!0)throw SyntaxError(OJ("closing","}"));A.output=S0.escapeLast(A.output,"{"),n("braces")}if(Z.strictSlashes!==!0&&(T.type==="star"||T.type==="bracket"))a({type:"maybe_slash",value:"",output:`${U}?`});if(A.backtrack===!0){A.output="";for(let d of A.tokens)if(A.output+=d.output!=null?d.output:d.value,d.suffix)A.output+=d.suffix}return A};V7.fastpaths=($,J)=>{let Z={...J},Y=typeof Z.maxLength==="number"?Math.min(k9,Z.maxLength):k9,K=$.length;if(K>Y)throw SyntaxError(`Input length: ${K}, exceeds maximum allowed length: ${Y}`);$=EQ[$]||$;let Q=S0.isWindows(J),{DOT_LITERAL:V,SLASH_LITERAL:X,ONE_CHAR:W,DOTS_SLASH:_,NO_DOT:j,NO_DOTS:H,NO_DOTS_SLASH:q,STAR:U,START_ANCHOR:z}=j8.globChars(Q),M=Z.dot?H:j,I=Z.dot?q:j,C=Z.capture?"":"?:",P={negated:!1,prefix:""},D=Z.bash===!0?".*?":U;if(Z.capture)D=`(${D})`;let L=(b)=>{if(b.noglobstar===!0)return D;return`(${C}(?:(?!${z}${b.dot?_:V}).)*?)`},R=(b)=>{switch(b){case"*":return`${M}${W}${D}`;case".*":return`${V}${W}${D}`;case"*.*":return`${M}${D}${V}${W}${D}`;case"*/*":return`${M}${D}${X}${W}${I}${D}`;case"**":return M+L(Z);case"**/*":return`(?:${M}${L(Z)}${X})?${I}${W}${D}`;case"**/*.*":return`(?:${M}${L(Z)}${X})?${I}${D}${V}${W}${D}`;case"**/.*":return`(?:${M}${L(Z)}${X})?${V}${W}${D}`;default:{let v=/^(.*?)\.(\w+)$/.exec(b);if(!v)return;let m=R(v[1]);if(!m)return;return m+V+v[2]}}},N=S0.removePrefix($,P),x=R(N);if(x&&Z.strictSlashes!==!0)x+=`${X}?`;return x};vQ.exports=V7});var fQ=p((ww,gQ)=>{var oO=d0("path"),rO=kQ(),G7=hQ(),X7=X8(),iO=G8(),sO=($)=>$&&typeof $==="object"&&!Array.isArray($),U0=($,J,Z=!1)=>{if(Array.isArray($)){let j=$.map((q)=>U0(q,J,Z));return(q)=>{for(let U of j){let z=U(q);if(z)return z}return!1}}let Y=sO($)&&$.tokens&&$.input;if($===""||typeof $!=="string"&&!Y)throw TypeError("Expected pattern to be a non-empty string");let K=J||{},Q=X7.isWindows(J),V=Y?U0.compileRe($,J):U0.makeRe($,J,!1,!0),X=V.state;delete V.state;let W=()=>!1;if(K.ignore){let j={...J,ignore:null,onMatch:null,onResult:null};W=U0(K.ignore,j,Z)}let _=(j,H=!1)=>{let{isMatch:q,match:U,output:z}=U0.test(j,V,J,{glob:$,posix:Q}),M={glob:$,state:X,regex:V,posix:Q,input:j,output:z,match:U,isMatch:q};if(typeof K.onResult==="function")K.onResult(M);if(q===!1)return M.isMatch=!1,H?M:!1;if(W(j)){if(typeof K.onIgnore==="function")K.onIgnore(M);return M.isMatch=!1,H?M:!1}if(typeof K.onMatch==="function")K.onMatch(M);return H?M:!0};if(Z)_.state=X;return _};U0.test=($,J,Z,{glob:Y,posix:K}={})=>{if(typeof $!=="string")throw TypeError("Expected input to be a string");if($==="")return{isMatch:!1,output:""};let Q=Z||{},V=Q.format||(K?X7.toPosixSlashes:null),X=$===Y,W=X&&V?V($):$;if(X===!1)W=V?V($):$,X=W===Y;if(X===!1||Q.capture===!0)if(Q.matchBase===!0||Q.basename===!0)X=U0.matchBase($,J,Z,K);else X=J.exec(W);return{isMatch:Boolean(X),match:X,output:W}};U0.matchBase=($,J,Z,Y=X7.isWindows(Z))=>{return(J instanceof RegExp?J:U0.makeRe(J,Z)).test(oO.basename($))};U0.isMatch=($,J,Z)=>U0(J,Z)($);U0.parse=($,J)=>{if(Array.isArray($))return $.map((Z)=>U0.parse(Z,J));return G7($,{...J,fastpaths:!1})};U0.scan=($,J)=>rO($,J);U0.compileRe=($,J,Z=!1,Y=!1)=>{if(Z===!0)return $.output;let K=J||{},Q=K.contains?"":"^",V=K.contains?"":"$",X=`${Q}(?:${$.output})${V}`;if($&&$.negated===!0)X=`^(?!${X}).*$`;let W=U0.toRegex(X,J);if(Y===!0)W.state=$;return W};U0.makeRe=($,J={},Z=!1,Y=!1)=>{if(!$||typeof $!=="string")throw TypeError("Expected a non-empty string");let K={negated:!1,fastpaths:!0};if(J.fastpaths!==!1&&($[0]==="."||$[0]==="*"))K.output=G7.fastpaths($,J);if(!K.output)K=G7($,J);return U0.compileRe(K,J,Z,Y)};U0.toRegex=($,J)=>{try{let Z=J||{};return new RegExp($,Z.flags||(Z.nocase?"i":""))}catch(Z){if(J&&J.debug===!0)throw Z;return/$^/}};U0.constants=iO;gQ.exports=U0});var lQ=p((Rw,cQ)=>{var uQ=d0("util"),dQ=MQ(),w1=fQ(),W7=X8(),mQ=($)=>$===""||$==="./",pQ=($)=>{let J=$.indexOf("{");return J>-1&&$.indexOf("}",J)>-1},a$=($,J,Z)=>{J=[].concat(J),$=[].concat($);let Y=new Set,K=new Set,Q=new Set,V=0,X=(j)=>{if(Q.add(j.output),Z&&Z.onResult)Z.onResult(j)};for(let j=0;j<J.length;j++){let H=w1(String(J[j]),{...Z,onResult:X},!0),q=H.state.negated||H.state.negatedExtglob;if(q)V++;for(let U of $){let z=H(U,!0);if(!(q?!z.isMatch:z.isMatch))continue;if(q)Y.add(z.output);else Y.delete(z.output),K.add(z.output)}}let _=(V===J.length?[...Q]:[...K]).filter((j)=>!Y.has(j));if(Z&&_.length===0){if(Z.failglob===!0)throw Error(`No matches found for "${J.join(", ")}"`);if(Z.nonull===!0||Z.nullglob===!0)return Z.unescape?J.map((j)=>j.replace(/\\/g,"")):J}return _};a$.match=a$;a$.matcher=($,J)=>w1($,J);a$.isMatch=($,J,Z)=>w1(J,Z)($);a$.any=a$.isMatch;a$.not=($,J,Z={})=>{J=[].concat(J).map(String);let Y=new Set,K=[],V=new Set(a$($,J,{...Z,onResult:(X)=>{if(Z.onResult)Z.onResult(X);K.push(X.output)}}));for(let X of K)if(!V.has(X))Y.add(X);return[...Y]};a$.contains=($,J,Z)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${uQ.inspect($)}"`);if(Array.isArray(J))return J.some((Y)=>a$.contains($,Y,Z));if(typeof J==="string"){if(mQ($)||mQ(J))return!1;if($.includes(J)||$.startsWith("./")&&$.slice(2).includes(J))return!0}return a$.isMatch($,J,{...Z,contains:!0})};a$.matchKeys=($,J,Z)=>{if(!W7.isObject($))throw TypeError("Expected the first argument to be an object");let Y=a$(Object.keys($),J,Z),K={};for(let Q of Y)K[Q]=$[Q];return K};a$.some=($,J,Z)=>{let Y=[].concat($);for(let K of[].concat(J)){let Q=w1(String(K),Z);if(Y.some((V)=>Q(V)))return!0}return!1};a$.every=($,J,Z)=>{let Y=[].concat($);for(let K of[].concat(J)){let Q=w1(String(K),Z);if(!Y.every((V)=>Q(V)))return!1}return!0};a$.all=($,J,Z)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${uQ.inspect($)}"`);return[].concat(J).every((Y)=>w1(Y,Z)($))};a$.capture=($,J,Z)=>{let Y=W7.isWindows(Z),Q=w1.makeRe(String($),{...Z,capture:!0}).exec(Y?W7.toPosixSlashes(J):J);if(Q)return Q.slice(1).map((V)=>V===void 0?"":V)};a$.makeRe=(...$)=>w1.makeRe(...$);a$.scan=(...$)=>w1.scan(...$);a$.parse=($,J)=>{let Z=[];for(let Y of[].concat($||[]))for(let K of dQ(String(Y),J))Z.push(w1.parse(K,J));return Z};a$.braces=($,J)=>{if(typeof $!=="string")throw TypeError("Expected a string");if(J&&J.nobrace===!0||!pQ($))return[$];return dQ($,J)};a$.braceExpand=($,J)=>{if(typeof $!=="string")throw TypeError("Expected a string");return a$.braces($,{...J,expand:!0})};a$.hasBraces=pQ;cQ.exports=a$});var rQ=p((Lw,oQ)=>{/*!
17
+ */var u4=d0("util"),ZV=$V(),JV=($)=>$!==null&&typeof $==="object"&&!Array.isArray($),d4=($)=>{return(J)=>$===!0?Number(J):String(J)},n6=($)=>{return typeof $==="number"||typeof $==="string"&&$!==""},Q8=($)=>Number.isInteger(+$),a6=($)=>{let J=`${$}`,Z=-1;if(J[0]==="-")J=J.slice(1);if(J==="0")return!1;while(J[++Z]==="0");return Z>0},p4=($,J,Z)=>{if(typeof $==="string"||typeof J==="string")return!0;return Z.stringify===!0},c4=($,J,Z)=>{if(J>0){let Y=$[0]==="-"?"-":"";if(Y)$=$.slice(1);$=Y+$.padStart(Y?J-1:J,"0")}if(Z===!1)return String($);return $},T9=($,J)=>{let Z=$[0]==="-"?"-":"";if(Z)$=$.slice(1),J--;while($.length<J)$="0"+$;return Z?"-"+$:$},l4=($,J,Z)=>{$.negatives.sort((G,W)=>G<W?-1:G>W?1:0),$.positives.sort((G,W)=>G<W?-1:G>W?1:0);let Y=J.capture?"":"?:",K="",V="",Q;if($.positives.length)K=$.positives.map((G)=>T9(String(G),Z)).join("|");if($.negatives.length)V=`-(${Y}${$.negatives.map((G)=>T9(String(G),Z)).join("|")})`;if(K&&V)Q=`${K}|${V}`;else Q=K||V;if(J.wrap)return`(${Y}${Q})`;return Q},YV=($,J,Z,Y)=>{if(Z)return ZV($,J,{wrap:!1,...Y});let K=String.fromCharCode($);if($===J)return K;let V=String.fromCharCode(J);return`[${K}-${V}]`},KV=($,J,Z)=>{if(Array.isArray($)){let Y=Z.wrap===!0,K=Z.capture?"":"?:";return Y?`(${K}${$.join("|")})`:$.join("|")}return ZV($,J,Z)},VV=(...$)=>{return RangeError("Invalid range arguments: "+u4.inspect(...$))},QV=($,J,Z)=>{if(Z.strictRanges===!0)throw VV([$,J]);return[]},o4=($,J)=>{if(J.strictRanges===!0)throw TypeError(`Expected step "${$}" to be a number`);return[]},r4=($,J,Z=1,Y={})=>{let K=Number($),V=Number(J);if(!Number.isInteger(K)||!Number.isInteger(V)){if(Y.strictRanges===!0)throw VV([$,J]);return[]}if(K===0)K=0;if(V===0)V=0;let Q=K>V,G=String($),W=String(J),_=String(Z);Z=Math.max(Math.abs(Z),1);let j=a6(G)||a6(W)||a6(_),B=j?Math.max(G.length,W.length,_.length):0,q=j===!1&&p4($,J,Y)===!1,U=Y.transform||d4(q);if(Y.toRegex&&Z===1)return YV(T9($,B),T9(J,B),!0,Y);let z={negatives:[],positives:[]},C=(I)=>z[I<0?"negatives":"positives"].push(Math.abs(I)),D=[],M=0;while(Q?K>=V:K<=V){if(Y.toRegex===!0&&Z>1)C(K);else D.push(c4(U(K,M),B,q));K=Q?K-Z:K+Z,M++}if(Y.toRegex===!0)return Z>1?l4(z,Y,B):KV(D,null,{wrap:!1,...Y});return D},i4=($,J,Z=1,Y={})=>{if(!Q8($)&&$.length>1||!Q8(J)&&J.length>1)return QV($,J,Y);let K=Y.transform||((q)=>String.fromCharCode(q)),V=`${$}`.charCodeAt(0),Q=`${J}`.charCodeAt(0),G=V>Q,W=Math.min(V,Q),_=Math.max(V,Q);if(Y.toRegex&&Z===1)return YV(W,_,!1,Y);let j=[],B=0;while(G?V>=Q:V<=Q)j.push(K(V,B)),V=G?V-Z:V+Z,B++;if(Y.toRegex===!0)return KV(j,null,{wrap:!1,options:Y});return j},y9=($,J,Z,Y={})=>{if(J==null&&n6($))return[$];if(!n6($)||!n6(J))return QV($,J,Y);if(typeof Z==="function")return y9($,J,1,{transform:Z});if(JV(Z))return y9($,J,0,Z);let K={...Y};if(K.capture===!0)K.wrap=!0;if(Z=Z||K.step||1,!Q8(Z)){if(Z!=null&&!JV(Z))return o4(Z,K);return y9($,J,1,Z)}if(Q8($)&&Q8(J))return r4($,J,Z,K);return i4($,J,Math.max(Math.abs(Z),1),K)};XV.exports=y9});var jV=p((SR,WV)=>{var s4=t6(),GV=L9(),n4=($,J={})=>{let Z=(Y,K={})=>{let V=GV.isInvalidBrace(K),Q=Y.invalid===!0&&J.escapeInvalid===!0,G=V===!0||Q===!0,W=J.escapeInvalid===!0?"\\":"",_="";if(Y.isOpen===!0)return W+Y.value;if(Y.isClose===!0)return console.log("node.isClose",W,Y.value),W+Y.value;if(Y.type==="open")return G?W+Y.value:"(";if(Y.type==="close")return G?W+Y.value:")";if(Y.type==="comma")return Y.prev.type==="comma"?"":G?Y.value:"|";if(Y.value)return Y.value;if(Y.nodes&&Y.ranges>0){let j=GV.reduce(Y.nodes),B=s4(...j,{...J,wrap:!1,toRegex:!0,strictZeros:!0});if(B.length!==0)return j.length>1&&B.length>1?`(${B})`:B}if(Y.nodes)for(let j of Y.nodes)_+=Z(j,Y);return _};return Z($)};WV.exports=n4});var BV=p((RR,HV)=>{var a4=t6(),UV=N9(),_J=L9(),L2=($="",J="",Z=!1)=>{let Y=[];if($=[].concat($),J=[].concat(J),!J.length)return $;if(!$.length)return Z?_J.flatten(J).map((K)=>`{${K}}`):J;for(let K of $)if(Array.isArray(K))for(let V of K)Y.push(L2(V,J,Z));else for(let V of J){if(Z===!0&&typeof V==="string")V=`{${V}}`;Y.push(Array.isArray(V)?L2(K,V,Z):K+V)}return _J.flatten(Y)},t4=($,J={})=>{let Z=J.rangeLimit===void 0?1000:J.rangeLimit,Y=(K,V={})=>{K.queue=[];let Q=V,G=V.queue;while(Q.type!=="brace"&&Q.type!=="root"&&Q.parent)Q=Q.parent,G=Q.queue;if(K.invalid||K.dollar){G.push(L2(G.pop(),UV(K,J)));return}if(K.type==="brace"&&K.invalid!==!0&&K.nodes.length===2){G.push(L2(G.pop(),["{}"]));return}if(K.nodes&&K.ranges>0){let B=_J.reduce(K.nodes);if(_J.exceedsLimit(...B,J.step,Z))throw RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let q=a4(...B,J);if(q.length===0)q=UV(K,J);G.push(L2(G.pop(),q)),K.nodes=[];return}let W=_J.encloseBrace(K),_=K.queue,j=K;while(j.type!=="brace"&&j.type!=="root"&&j.parent)j=j.parent,_=j.queue;for(let B=0;B<K.nodes.length;B++){let q=K.nodes[B];if(q.type==="comma"&&K.type==="brace"){if(B===1)_.push("");_.push("");continue}if(q.type==="close"){G.push(L2(G.pop(),_,W));continue}if(q.value&&q.type!=="open"){_.push(L2(_.pop(),q.value));continue}if(q.nodes)Y(q,K)}return _};return _J.flatten(Y($))};HV.exports=t4});var OV=p((wR,_V)=>{_V.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
18
+ `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var CV=p((LR,MV)=>{var e4=N9(),{MAX_LENGTH:qV,CHAR_BACKSLASH:e6,CHAR_BACKTICK:$O,CHAR_COMMA:JO,CHAR_DOT:ZO,CHAR_LEFT_PARENTHESES:YO,CHAR_RIGHT_PARENTHESES:KO,CHAR_LEFT_CURLY_BRACE:VO,CHAR_RIGHT_CURLY_BRACE:QO,CHAR_LEFT_SQUARE_BRACKET:FV,CHAR_RIGHT_SQUARE_BRACKET:zV,CHAR_DOUBLE_QUOTE:XO,CHAR_SINGLE_QUOTE:GO,CHAR_NO_BREAK_SPACE:WO,CHAR_ZERO_WIDTH_NOBREAK_SPACE:jO}=OV(),UO=($,J={})=>{if(typeof $!=="string")throw TypeError("Expected a string");let Z=J||{},Y=typeof Z.maxLength==="number"?Math.min(qV,Z.maxLength):qV;if($.length>Y)throw SyntaxError(`Input length (${$.length}), exceeds max characters (${Y})`);let K={type:"root",input:$,nodes:[]},V=[K],Q=K,G=K,W=0,_=$.length,j=0,B=0,q,U=()=>$[j++],z=(C)=>{if(C.type==="text"&&G.type==="dot")G.type="text";if(G&&G.type==="text"&&C.type==="text"){G.value+=C.value;return}return Q.nodes.push(C),C.parent=Q,C.prev=G,G=C,C};z({type:"bos"});while(j<_){if(Q=V[V.length-1],q=U(),q===jO||q===WO)continue;if(q===e6){z({type:"text",value:(J.keepEscaping?q:"")+U()});continue}if(q===zV){z({type:"text",value:"\\"+q});continue}if(q===FV){W++;let C;while(j<_&&(C=U())){if(q+=C,C===FV){W++;continue}if(C===e6){q+=U();continue}if(C===zV){if(W--,W===0)break}}z({type:"text",value:q});continue}if(q===YO){Q=z({type:"paren",nodes:[]}),V.push(Q),z({type:"text",value:q});continue}if(q===KO){if(Q.type!=="paren"){z({type:"text",value:q});continue}Q=V.pop(),z({type:"text",value:q}),Q=V[V.length-1];continue}if(q===XO||q===GO||q===$O){let C=q,D;if(J.keepQuotes!==!0)q="";while(j<_&&(D=U())){if(D===e6){q+=D+U();continue}if(D===C){if(J.keepQuotes===!0)q+=D;break}q+=D}z({type:"text",value:q});continue}if(q===VO){B++;let D={type:"brace",open:!0,close:!1,dollar:G.value&&G.value.slice(-1)==="$"||Q.dollar===!0,depth:B,commas:0,ranges:0,nodes:[]};Q=z(D),V.push(Q),z({type:"open",value:q});continue}if(q===QO){if(Q.type!=="brace"){z({type:"text",value:q});continue}let C="close";Q=V.pop(),Q.close=!0,z({type:C,value:q}),B--,Q=V[V.length-1];continue}if(q===JO&&B>0){if(Q.ranges>0){Q.ranges=0;let C=Q.nodes.shift();Q.nodes=[C,{type:"text",value:e4(Q)}]}z({type:"comma",value:q}),Q.commas++;continue}if(q===ZO&&B>0&&Q.commas===0){let C=Q.nodes;if(B===0||C.length===0){z({type:"text",value:q});continue}if(G.type==="dot"){if(Q.range=[],G.value+=q,G.type="range",Q.nodes.length!==3&&Q.nodes.length!==5){Q.invalid=!0,Q.ranges=0,G.type="text";continue}Q.ranges++,Q.args=[];continue}if(G.type==="range"){C.pop();let D=C[C.length-1];D.value+=G.value+q,G=D,Q.ranges--;continue}z({type:"dot",value:q});continue}z({type:"text",value:q})}do if(Q=V.pop(),Q.type!=="root"){Q.nodes.forEach((M)=>{if(!M.nodes){if(M.type==="open")M.isOpen=!0;if(M.type==="close")M.isClose=!0;if(!M.nodes)M.type="text";M.invalid=!0}});let C=V[V.length-1],D=C.nodes.indexOf(Q);C.nodes.splice(D,1,...Q.nodes)}while(V.length>0);return z({type:"eos"}),K};MV.exports=UO});var IV=p((NR,PV)=>{var DV=N9(),HO=jV(),BO=BV(),_O=CV(),p0=($,J={})=>{let Z=[];if(Array.isArray($))for(let Y of $){let K=p0.create(Y,J);if(Array.isArray(K))Z.push(...K);else Z.push(K)}else Z=[].concat(p0.create($,J));if(J&&J.expand===!0&&J.nodupes===!0)Z=[...new Set(Z)];return Z};p0.parse=($,J={})=>_O($,J);p0.stringify=($,J={})=>{if(typeof $==="string")return DV(p0.parse($,J),J);return DV($,J)};p0.compile=($,J={})=>{if(typeof $==="string")$=p0.parse($,J);return HO($,J)};p0.expand=($,J={})=>{if(typeof $==="string")$=p0.parse($,J);let Z=BO($,J);if(J.noempty===!0)Z=Z.filter(Boolean);if(J.nodupes===!0)Z=[...new Set(Z)];return Z};p0.create=($,J={})=>{if($===""||$.length<3)return[$];return J.expand!==!0?p0.compile($,J):p0.expand($,J)};PV.exports=p0});var X8=p((yR,SV)=>{var OO=d0("path"),AV={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},qO={...AV,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"},FO={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};SV.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:FO,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:OO.sep,extglobChars($){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${$.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars($){return $===!0?qO:AV}}});var G8=p((AO)=>{var zO=d0("path"),MO=process.platform==="win32",{REGEX_BACKSLASH:CO,REGEX_REMOVE_BACKSLASH:DO,REGEX_SPECIAL_CHARS:PO,REGEX_SPECIAL_CHARS_GLOBAL:IO}=X8();AO.isObject=($)=>$!==null&&typeof $==="object"&&!Array.isArray($);AO.hasRegexChars=($)=>PO.test($);AO.isRegexChar=($)=>$.length===1&&AO.hasRegexChars($);AO.escapeRegex=($)=>$.replace(IO,"\\$1");AO.toPosixSlashes=($)=>$.replace(CO,"/");AO.removeBackslashes=($)=>{return $.replace(DO,(J)=>{return J==="\\"?"":J})};AO.supportsLookbehinds=()=>{let $=process.version.slice(1).split(".").map(Number);if($.length===3&&$[0]>=9||$[0]===8&&$[1]>=10)return!0;return!1};AO.isWindows=($)=>{if($&&typeof $.windows==="boolean")return $.windows;return MO===!0||zO.sep==="\\"};AO.escapeLast=($,J,Z)=>{let Y=$.lastIndexOf(J,Z);if(Y===-1)return $;if($[Y-1]==="\\")return AO.escapeLast($,J,Y-1);return`${$.slice(0,Y)}\\${$.slice(Y)}`};AO.removePrefix=($,J={})=>{let Z=$;if(Z.startsWith("./"))Z=Z.slice(2),J.prefix="./";return Z};AO.wrapOutput=($,J={},Z={})=>{let Y=Z.contains?"":"^",K=Z.contains?"":"$",V=`${Y}(?:${$})${K}`;if(J.negated===!0)V=`(?:^(?!${V}).*$)`;return V}});var bV=p((kR,xV)=>{var LV=G8(),{CHAR_ASTERISK:$7,CHAR_AT:xO,CHAR_BACKWARD_SLASH:W8,CHAR_COMMA:bO,CHAR_DOT:J7,CHAR_EXCLAMATION_MARK:Z7,CHAR_FORWARD_SLASH:EV,CHAR_LEFT_CURLY_BRACE:Y7,CHAR_LEFT_PARENTHESES:K7,CHAR_LEFT_SQUARE_BRACKET:vO,CHAR_PLUS:hO,CHAR_QUESTION_MARK:NV,CHAR_RIGHT_CURLY_BRACE:gO,CHAR_RIGHT_PARENTHESES:yV,CHAR_RIGHT_SQUARE_BRACKET:fO}=X8(),TV=($)=>{return $===EV||$===W8},kV=($)=>{if($.isPrefix!==!0)$.depth=$.isGlobstar?1/0:1},mO=($,J)=>{let Z=J||{},Y=$.length-1,K=Z.parts===!0||Z.scanToEnd===!0,V=[],Q=[],G=[],W=$,_=-1,j=0,B=0,q=!1,U=!1,z=!1,C=!1,D=!1,M=!1,I=!1,P=!1,L=!1,w=!1,N=0,x,b,v={value:"",depth:0,isGlob:!1},m=()=>_>=Y,A=()=>W.charCodeAt(_+1),u=()=>{return x=b,W.charCodeAt(++_)};while(_<Y){b=u();let A$;if(b===W8){if(I=v.backslashes=!0,b=u(),b===Y7)M=!0;continue}if(M===!0||b===Y7){N++;while(m()!==!0&&(b=u())){if(b===W8){I=v.backslashes=!0,u();continue}if(b===Y7){N++;continue}if(M!==!0&&b===J7&&(b=u())===J7){if(q=v.isBrace=!0,z=v.isGlob=!0,w=!0,K===!0)continue;break}if(M!==!0&&b===bO){if(q=v.isBrace=!0,z=v.isGlob=!0,w=!0,K===!0)continue;break}if(b===gO){if(N--,N===0){M=!1,q=v.isBrace=!0,w=!0;break}}}if(K===!0)continue;break}if(b===EV){if(V.push(_),Q.push(v),v={value:"",depth:0,isGlob:!1},w===!0)continue;if(x===J7&&_===j+1){j+=2;continue}B=_+1;continue}if(Z.noext!==!0){if((b===hO||b===xO||b===$7||b===NV||b===Z7)===!0&&A()===K7){if(z=v.isGlob=!0,C=v.isExtglob=!0,w=!0,b===Z7&&_===j)L=!0;if(K===!0){while(m()!==!0&&(b=u())){if(b===W8){I=v.backslashes=!0,b=u();continue}if(b===yV){z=v.isGlob=!0,w=!0;break}}continue}break}}if(b===$7){if(x===$7)D=v.isGlobstar=!0;if(z=v.isGlob=!0,w=!0,K===!0)continue;break}if(b===NV){if(z=v.isGlob=!0,w=!0,K===!0)continue;break}if(b===vO){while(m()!==!0&&(A$=u())){if(A$===W8){I=v.backslashes=!0,u();continue}if(A$===fO){U=v.isBracket=!0,z=v.isGlob=!0,w=!0;break}}if(K===!0)continue;break}if(Z.nonegate!==!0&&b===Z7&&_===j){P=v.negated=!0,j++;continue}if(Z.noparen!==!0&&b===K7){if(z=v.isGlob=!0,K===!0){while(m()!==!0&&(b=u())){if(b===K7){I=v.backslashes=!0,b=u();continue}if(b===yV){w=!0;break}}continue}break}if(z===!0){if(w=!0,K===!0)continue;break}}if(Z.noext===!0)C=!1,z=!1;let r=W,S="",T="";if(j>0)S=W.slice(0,j),W=W.slice(j),B-=j;if(r&&z===!0&&B>0)r=W.slice(0,B),T=W.slice(B);else if(z===!0)r="",T=W;else r=W;if(r&&r!==""&&r!=="/"&&r!==W){if(TV(r.charCodeAt(r.length-1)))r=r.slice(0,-1)}if(Z.unescape===!0){if(T)T=LV.removeBackslashes(T);if(r&&I===!0)r=LV.removeBackslashes(r)}let k={prefix:S,input:$,start:j,base:r,glob:T,isBrace:q,isBracket:U,isGlob:z,isExtglob:C,isGlobstar:D,negated:P,negatedExtglob:L};if(Z.tokens===!0){if(k.maxDepth=0,!TV(b))Q.push(v);k.tokens=Q}if(Z.parts===!0||Z.tokens===!0){let A$;for(let s=0;s<V.length;s++){let J$=A$?A$+1:j,Z$=V[s],W$=$.slice(J$,Z$);if(Z.tokens){if(s===0&&j!==0)Q[s].isPrefix=!0,Q[s].value=S;else Q[s].value=W$;kV(Q[s]),k.maxDepth+=Q[s].depth}if(s!==0||W$!=="")G.push(W$);A$=Z$}if(A$&&A$+1<$.length){let s=$.slice(A$+1);if(G.push(s),Z.tokens)Q[Q.length-1].value=s,kV(Q[Q.length-1]),k.maxDepth+=Q[Q.length-1].depth}k.slashes=V,k.parts=G}return k};xV.exports=mO});var mV=p((ER,fV)=>{var j8=X8(),S0=G8(),{MAX_LENGTH:k9,POSIX_REGEX_SOURCE:uO,REGEX_NON_SPECIAL_CHARS:dO,REGEX_SPECIAL_CHARS_BACKREF:pO,REPLACEMENTS:vV}=j8,cO=($,J)=>{if(typeof J.expandRange==="function")return J.expandRange(...$,J);$.sort();let Z=`[${$.join("-")}]`;try{new RegExp(Z)}catch(Y){return $.map((K)=>S0.escapeRegex(K)).join("..")}return Z},OJ=($,J)=>{return`Missing ${$}: "${J}" - use "\\\\${J}" to match literal characters`},hV=($)=>{let J=[],Z=0,Y=0,K=0,V="",Q=!1;for(let G of $){if(Q===!0){V+=G,Q=!1;continue}if(G==="\\"){V+=G,Q=!0;continue}if(G==='"'){K=K===1?0:1,V+=G;continue}if(K===0){if(G==="[")Z++;else if(G==="]"&&Z>0)Z--;else if(Z===0){if(G==="(")Y++;else if(G===")"&&Y>0)Y--;else if(G==="|"&&Y===0){J.push(V),V="";continue}}}V+=G}return J.push(V),J},lO=($)=>{let J=!1;for(let Z of $){if(J===!0){J=!1;continue}if(Z==="\\"){J=!0;continue}if(/[?*+@!()[\]{}]/.test(Z))return!1}return!0},gV=($)=>{let J=$.trim(),Z=!0;while(Z===!0)if(Z=!1,/^@\([^\\()[\]{}|]+\)$/.test(J))J=J.slice(2,-1),Z=!0;if(!lO(J))return;return J.replace(/\\(.)/g,"$1")},oO=($)=>{let J=$.map(gV).filter(Boolean);for(let Z=0;Z<J.length;Z++)for(let Y=Z+1;Y<J.length;Y++){let K=J[Z],V=J[Y],Q=K[0];if(!Q||K!==Q.repeat(K.length)||V!==Q.repeat(V.length))continue;if(K===V||K.startsWith(V)||V.startsWith(K))return!0}return!1},V7=($,J=!0)=>{if($[0]!=="+"&&$[0]!=="*"||$[1]!=="(")return;let Z=0,Y=0,K=0,V=!1;for(let Q=1;Q<$.length;Q++){let G=$[Q];if(V===!0){V=!1;continue}if(G==="\\"){V=!0;continue}if(G==='"'){K=K===1?0:1;continue}if(K===1)continue;if(G==="["){Z++;continue}if(G==="]"&&Z>0){Z--;continue}if(Z>0)continue;if(G==="("){Y++;continue}if(G===")"){if(Y--,Y===0){if(J===!0&&Q!==$.length-1)return;return{type:$[0],body:$.slice(2,Q),end:Q}}}}},rO=($)=>{let J=0,Z=[];while(J<$.length){let K=V7($.slice(J),!1);if(!K||K.type!=="*")return;let V=hV(K.body).map((G)=>G.trim());if(V.length!==1)return;let Q=gV(V[0]);if(!Q||Q.length!==1)return;Z.push(Q),J+=K.end+1}if(Z.length<1)return;return`${Z.length===1?S0.escapeRegex(Z[0]):`[${Z.map((K)=>S0.escapeRegex(K)).join("")}]`}*`},iO=($)=>{let J=0,Z=$.trim(),Y=V7(Z);while(Y)J++,Z=Y.body.trim(),Y=V7(Z);return J},sO=($,J)=>{if(J.maxExtglobRecursion===!1)return{risky:!1};let Z=typeof J.maxExtglobRecursion==="number"?J.maxExtglobRecursion:j8.DEFAULT_MAX_EXTGLOB_RECURSION,Y=hV($).map((K)=>K.trim());if(Y.length>1){if(Y.some((K)=>K==="")||Y.some((K)=>/^[*?]+$/.test(K))||oO(Y))return{risky:!0}}for(let K of Y){let V=rO(K);if(V)return{risky:!0,safeOutput:V};if(iO(K)>Z)return{risky:!0}}return{risky:!1}},Q7=($,J)=>{if(typeof $!=="string")throw TypeError("Expected a string");$=vV[$]||$;let Z={...J},Y=typeof Z.maxLength==="number"?Math.min(k9,Z.maxLength):k9,K=$.length;if(K>Y)throw SyntaxError(`Input length: ${K}, exceeds maximum allowed length: ${Y}`);let V={type:"bos",value:"",output:Z.prepend||""},Q=[V],G=Z.capture?"":"?:",W=S0.isWindows(J),_=j8.globChars(W),j=j8.extglobChars(_),{DOT_LITERAL:B,PLUS_LITERAL:q,SLASH_LITERAL:U,ONE_CHAR:z,DOTS_SLASH:C,NO_DOT:D,NO_DOT_SLASH:M,NO_DOTS_SLASH:I,QMARK:P,QMARK_NO_DOT:L,STAR:w,START_ANCHOR:N}=_,x=(d)=>{return`(${G}(?:(?!${N}${d.dot?C:B}).)*?)`},b=Z.dot?"":D,v=Z.dot?P:L,m=Z.bash===!0?x(Z):w;if(Z.capture)m=`(${m})`;if(typeof Z.noext==="boolean")Z.noextglob=Z.noext;let A={input:$,index:-1,start:0,dot:Z.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:Q};$=S0.removePrefix($,A),K=$.length;let u=[],r=[],S=[],T=V,k,A$=()=>A.index===K-1,s=A.peek=(d=1)=>$[A.index+d],J$=A.advance=()=>$[++A.index]||"",Z$=()=>$.slice(A.index+1),W$=(d="",Y$=0)=>{A.consumed+=d,A.index+=Y$},y$=(d)=>{A.output+=d.output!=null?d.output:d.value,W$(d.value)},V$=()=>{let d=1;while(s()==="!"&&(s(2)!=="("||s(3)==="?"))J$(),A.start++,d++;if(d%2===0)return!1;return A.negated=!0,A.start++,!0},y=(d)=>{A[d]++,S.push(d)},n=(d)=>{A[d]--,S.pop()},a=(d)=>{if(T.type==="globstar"){let Y$=A.braces>0&&(d.type==="comma"||d.type==="brace"),g=d.extglob===!0||u.length&&(d.type==="pipe"||d.type==="paren");if(d.type!=="slash"&&d.type!=="paren"&&!Y$&&!g)A.output=A.output.slice(0,-T.output.length),T.type="star",T.value="*",T.output=m,A.output+=T.output}if(u.length&&d.type!=="paren")u[u.length-1].inner+=d.value;if(d.value||d.output)y$(d);if(T&&T.type==="text"&&d.type==="text"){T.value+=d.value,T.output=(T.output||"")+d.value;return}d.prev=T,Q.push(d),T=d},c$=(d,Y$)=>{let g={...j[Y$],conditions:1,inner:""};g.prev=T,g.parens=A.parens,g.output=A.output,g.startIndex=A.index,g.tokensIndex=Q.length;let t=(Z.capture?"(":"")+g.open;y("parens"),a({type:d,value:Y$,output:A.output?"":z}),a({type:"paren",extglob:!0,value:J$(),output:t}),u.push(g)},l=(d)=>{let Y$=$.slice(d.startIndex,A.index+1),g=$.slice(d.startIndex+2,A.index),t=sO(g,Z);if((d.type==="plus"||d.type==="star")&&t.risky){let C$=t.safeOutput?(d.output?"":z)+(Z.capture?`(${t.safeOutput})`:t.safeOutput):void 0,r$=Q[d.tokensIndex];r$.type="text",r$.value=Y$,r$.output=C$||S0.escapeRegex(Y$);for(let K0=d.tokensIndex+1;K0<Q.length;K0++)Q[K0].value="",Q[K0].output="",delete Q[K0].suffix;A.output=d.output+r$.output,A.backtrack=!0,a({type:"paren",extglob:!0,value:k,output:""}),n("parens");return}let M$=d.close+(Z.capture?")":""),T$;if(d.type==="negate"){let C$=m;if(d.inner&&d.inner.length>1&&d.inner.includes("/"))C$=x(Z);if(C$!==m||A$()||/^\)+$/.test(Z$()))M$=d.close=`)$))${C$}`;if(d.inner.includes("*")&&(T$=Z$())&&/^\.[^\\/.]+$/.test(T$)){let r$=Q7(T$,{...J,fastpaths:!1}).output;M$=d.close=`)${r$})${C$})`}if(d.prev.type==="bos")A.negatedExtglob=!0}a({type:"paren",extglob:!0,value:k,output:M$}),n("parens")};if(Z.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test($)){let d=!1,Y$=$.replace(pO,(g,t,M$,T$,C$,r$)=>{if(T$==="\\")return d=!0,g;if(T$==="?"){if(t)return t+T$+(C$?P.repeat(C$.length):"");if(r$===0)return v+(C$?P.repeat(C$.length):"");return P.repeat(M$.length)}if(T$===".")return B.repeat(M$.length);if(T$==="*"){if(t)return t+T$+(C$?m:"");return m}return t?g:`\\${g}`});if(d===!0)if(Z.unescape===!0)Y$=Y$.replace(/\\/g,"");else Y$=Y$.replace(/\\+/g,(g)=>{return g.length%2===0?"\\\\":g?"\\":""});if(Y$===$&&Z.contains===!0)return A.output=$,A;return A.output=S0.wrapOutput(Y$,A,J),A}while(!A$()){if(k=J$(),k==="\x00")continue;if(k==="\\"){let g=s();if(g==="/"&&Z.bash!==!0)continue;if(g==="."||g===";")continue;if(!g){k+="\\",a({type:"text",value:k});continue}let t=/^\\+/.exec(Z$()),M$=0;if(t&&t[0].length>2){if(M$=t[0].length,A.index+=M$,M$%2!==0)k+="\\"}if(Z.unescape===!0)k=J$();else k+=J$();if(A.brackets===0){a({type:"text",value:k});continue}}if(A.brackets>0&&(k!=="]"||T.value==="["||T.value==="[^")){if(Z.posix!==!1&&k===":"){let g=T.value.slice(1);if(g.includes("[")){if(T.posix=!0,g.includes(":")){let t=T.value.lastIndexOf("["),M$=T.value.slice(0,t),T$=T.value.slice(t+2),C$=uO[T$];if(C$){if(T.value=M$+C$,A.backtrack=!0,J$(),!V.output&&Q.indexOf(T)===1)V.output=z;continue}}}}if(k==="["&&s()!==":"||k==="-"&&s()==="]")k=`\\${k}`;if(k==="]"&&(T.value==="["||T.value==="[^"))k=`\\${k}`;if(Z.posix===!0&&k==="!"&&T.value==="[")k="^";T.value+=k,y$({value:k});continue}if(A.quotes===1&&k!=='"'){k=S0.escapeRegex(k),T.value+=k,y$({value:k});continue}if(k==='"'){if(A.quotes=A.quotes===1?0:1,Z.keepQuotes===!0)a({type:"text",value:k});continue}if(k==="("){y("parens"),a({type:"paren",value:k});continue}if(k===")"){if(A.parens===0&&Z.strictBrackets===!0)throw SyntaxError(OJ("opening","("));let g=u[u.length-1];if(g&&A.parens===g.parens+1){l(u.pop());continue}a({type:"paren",value:k,output:A.parens?")":"\\)"}),n("parens");continue}if(k==="["){if(Z.nobracket===!0||!Z$().includes("]")){if(Z.nobracket!==!0&&Z.strictBrackets===!0)throw SyntaxError(OJ("closing","]"));k=`\\${k}`}else y("brackets");a({type:"bracket",value:k});continue}if(k==="]"){if(Z.nobracket===!0||T&&T.type==="bracket"&&T.value.length===1){a({type:"text",value:k,output:`\\${k}`});continue}if(A.brackets===0){if(Z.strictBrackets===!0)throw SyntaxError(OJ("opening","["));a({type:"text",value:k,output:`\\${k}`});continue}n("brackets");let g=T.value.slice(1);if(T.posix!==!0&&g[0]==="^"&&!g.includes("/"))k=`/${k}`;if(T.value+=k,y$({value:k}),Z.literalBrackets===!1||S0.hasRegexChars(g))continue;let t=S0.escapeRegex(T.value);if(A.output=A.output.slice(0,-T.value.length),Z.literalBrackets===!0){A.output+=t,T.value=t;continue}T.value=`(${G}${t}|${T.value})`,A.output+=T.value;continue}if(k==="{"&&Z.nobrace!==!0){y("braces");let g={type:"brace",value:k,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};r.push(g),a(g);continue}if(k==="}"){let g=r[r.length-1];if(Z.nobrace===!0||!g){a({type:"text",value:k,output:k});continue}let t=")";if(g.dots===!0){let M$=Q.slice(),T$=[];for(let C$=M$.length-1;C$>=0;C$--){if(Q.pop(),M$[C$].type==="brace")break;if(M$[C$].type!=="dots")T$.unshift(M$[C$].value)}t=cO(T$,Z),A.backtrack=!0}if(g.comma!==!0&&g.dots!==!0){let M$=A.output.slice(0,g.outputIndex),T$=A.tokens.slice(g.tokensIndex);g.value=g.output="\\{",k=t="\\}",A.output=M$;for(let C$ of T$)A.output+=C$.output||C$.value}a({type:"brace",value:k,output:t}),n("braces"),r.pop();continue}if(k==="|"){if(u.length>0)u[u.length-1].conditions++;a({type:"text",value:k});continue}if(k===","){let g=k,t=r[r.length-1];if(t&&S[S.length-1]==="braces")t.comma=!0,g="|";a({type:"comma",value:k,output:g});continue}if(k==="/"){if(T.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",Q.pop(),T=V;continue}a({type:"slash",value:k,output:U});continue}if(k==="."){if(A.braces>0&&T.type==="dot"){if(T.value===".")T.output=B;let g=r[r.length-1];T.type="dots",T.output+=k,T.value+=k,g.dots=!0;continue}if(A.braces+A.parens===0&&T.type!=="bos"&&T.type!=="slash"){a({type:"text",value:k,output:B});continue}a({type:"dot",value:k,output:B});continue}if(k==="?"){if(!(T&&T.value==="(")&&Z.noextglob!==!0&&s()==="("&&s(2)!=="?"){c$("qmark",k);continue}if(T&&T.type==="paren"){let t=s(),M$=k;if(t==="<"&&!S0.supportsLookbehinds())throw Error("Node.js v10 or higher is required for regex lookbehinds");if(T.value==="("&&!/[!=<:]/.test(t)||t==="<"&&!/<([!=]|\w+>)/.test(Z$()))M$=`\\${k}`;a({type:"text",value:k,output:M$});continue}if(Z.dot!==!0&&(T.type==="slash"||T.type==="bos")){a({type:"qmark",value:k,output:L});continue}a({type:"qmark",value:k,output:P});continue}if(k==="!"){if(Z.noextglob!==!0&&s()==="("){if(s(2)!=="?"||!/[!=<:]/.test(s(3))){c$("negate",k);continue}}if(Z.nonegate!==!0&&A.index===0){V$();continue}}if(k==="+"){if(Z.noextglob!==!0&&s()==="("&&s(2)!=="?"){c$("plus",k);continue}if(T&&T.value==="("||Z.regex===!1){a({type:"plus",value:k,output:q});continue}if(T&&(T.type==="bracket"||T.type==="paren"||T.type==="brace")||A.parens>0){a({type:"plus",value:k});continue}a({type:"plus",value:q});continue}if(k==="@"){if(Z.noextglob!==!0&&s()==="("&&s(2)!=="?"){a({type:"at",extglob:!0,value:k,output:""});continue}a({type:"text",value:k});continue}if(k!=="*"){if(k==="$"||k==="^")k=`\\${k}`;let g=dO.exec(Z$());if(g)k+=g[0],A.index+=g[0].length;a({type:"text",value:k});continue}if(T&&(T.type==="globstar"||T.star===!0)){T.type="star",T.star=!0,T.value+=k,T.output=m,A.backtrack=!0,A.globstar=!0,W$(k);continue}let d=Z$();if(Z.noextglob!==!0&&/^\([^?]/.test(d)){c$("star",k);continue}if(T.type==="star"){if(Z.noglobstar===!0){W$(k);continue}let g=T.prev,t=g.prev,M$=g.type==="slash"||g.type==="bos",T$=t&&(t.type==="star"||t.type==="globstar");if(Z.bash===!0&&(!M$||d[0]&&d[0]!=="/")){a({type:"star",value:k,output:""});continue}let C$=A.braces>0&&(g.type==="comma"||g.type==="brace"),r$=u.length&&(g.type==="pipe"||g.type==="paren");if(!M$&&g.type!=="paren"&&!C$&&!r$){a({type:"star",value:k,output:""});continue}while(d.slice(0,3)==="/**"){let K0=$[A.index+4];if(K0&&K0!=="/")break;d=d.slice(3),W$("/**",3)}if(g.type==="bos"&&A$()){T.type="globstar",T.value+=k,T.output=x(Z),A.output=T.output,A.globstar=!0,W$(k);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&!T$&&A$()){A.output=A.output.slice(0,-(g.output+T.output).length),g.output=`(?:${g.output}`,T.type="globstar",T.output=x(Z)+(Z.strictSlashes?")":"|$)"),T.value+=k,A.globstar=!0,A.output+=g.output+T.output,W$(k);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&d[0]==="/"){let K0=d[1]!==void 0?"|$":"";A.output=A.output.slice(0,-(g.output+T.output).length),g.output=`(?:${g.output}`,T.type="globstar",T.output=`${x(Z)}${U}|${U}${K0})`,T.value+=k,A.output+=g.output+T.output,A.globstar=!0,W$(k+J$()),a({type:"slash",value:"/",output:""});continue}if(g.type==="bos"&&d[0]==="/"){T.type="globstar",T.value+=k,T.output=`(?:^|${U}|${x(Z)}${U})`,A.output=T.output,A.globstar=!0,W$(k+J$()),a({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-T.output.length),T.type="globstar",T.output=x(Z),T.value+=k,A.output+=T.output,A.globstar=!0,W$(k);continue}let Y$={type:"star",value:k,output:m};if(Z.bash===!0){if(Y$.output=".*?",T.type==="bos"||T.type==="slash")Y$.output=b+Y$.output;a(Y$);continue}if(T&&(T.type==="bracket"||T.type==="paren")&&Z.regex===!0){Y$.output=k,a(Y$);continue}if(A.index===A.start||T.type==="slash"||T.type==="dot"){if(T.type==="dot")A.output+=M,T.output+=M;else if(Z.dot===!0)A.output+=I,T.output+=I;else A.output+=b,T.output+=b;if(s()!=="*")A.output+=z,T.output+=z}a(Y$)}while(A.brackets>0){if(Z.strictBrackets===!0)throw SyntaxError(OJ("closing","]"));A.output=S0.escapeLast(A.output,"["),n("brackets")}while(A.parens>0){if(Z.strictBrackets===!0)throw SyntaxError(OJ("closing",")"));A.output=S0.escapeLast(A.output,"("),n("parens")}while(A.braces>0){if(Z.strictBrackets===!0)throw SyntaxError(OJ("closing","}"));A.output=S0.escapeLast(A.output,"{"),n("braces")}if(Z.strictSlashes!==!0&&(T.type==="star"||T.type==="bracket"))a({type:"maybe_slash",value:"",output:`${U}?`});if(A.backtrack===!0){A.output="";for(let d of A.tokens)if(A.output+=d.output!=null?d.output:d.value,d.suffix)A.output+=d.suffix}return A};Q7.fastpaths=($,J)=>{let Z={...J},Y=typeof Z.maxLength==="number"?Math.min(k9,Z.maxLength):k9,K=$.length;if(K>Y)throw SyntaxError(`Input length: ${K}, exceeds maximum allowed length: ${Y}`);$=vV[$]||$;let V=S0.isWindows(J),{DOT_LITERAL:Q,SLASH_LITERAL:G,ONE_CHAR:W,DOTS_SLASH:_,NO_DOT:j,NO_DOTS:B,NO_DOTS_SLASH:q,STAR:U,START_ANCHOR:z}=j8.globChars(V),C=Z.dot?B:j,D=Z.dot?q:j,M=Z.capture?"":"?:",I={negated:!1,prefix:""},P=Z.bash===!0?".*?":U;if(Z.capture)P=`(${P})`;let L=(b)=>{if(b.noglobstar===!0)return P;return`(${M}(?:(?!${z}${b.dot?_:Q}).)*?)`},w=(b)=>{switch(b){case"*":return`${C}${W}${P}`;case".*":return`${Q}${W}${P}`;case"*.*":return`${C}${P}${Q}${W}${P}`;case"*/*":return`${C}${P}${G}${W}${D}${P}`;case"**":return C+L(Z);case"**/*":return`(?:${C}${L(Z)}${G})?${D}${W}${P}`;case"**/*.*":return`(?:${C}${L(Z)}${G})?${D}${P}${Q}${W}${P}`;case"**/.*":return`(?:${C}${L(Z)}${G})?${Q}${W}${P}`;default:{let v=/^(.*?)\.(\w+)$/.exec(b);if(!v)return;let m=w(v[1]);if(!m)return;return m+Q+v[2]}}},N=S0.removePrefix($,I),x=w(N);if(x&&Z.strictSlashes!==!0)x+=`${G}?`;return x};fV.exports=Q7});var dV=p((xR,uV)=>{var nO=d0("path"),aO=bV(),X7=mV(),G7=G8(),tO=X8(),eO=($)=>$&&typeof $==="object"&&!Array.isArray($),U0=($,J,Z=!1)=>{if(Array.isArray($)){let j=$.map((q)=>U0(q,J,Z));return(q)=>{for(let U of j){let z=U(q);if(z)return z}return!1}}let Y=eO($)&&$.tokens&&$.input;if($===""||typeof $!=="string"&&!Y)throw TypeError("Expected pattern to be a non-empty string");let K=J||{},V=G7.isWindows(J),Q=Y?U0.compileRe($,J):U0.makeRe($,J,!1,!0),G=Q.state;delete Q.state;let W=()=>!1;if(K.ignore){let j={...J,ignore:null,onMatch:null,onResult:null};W=U0(K.ignore,j,Z)}let _=(j,B=!1)=>{let{isMatch:q,match:U,output:z}=U0.test(j,Q,J,{glob:$,posix:V}),C={glob:$,state:G,regex:Q,posix:V,input:j,output:z,match:U,isMatch:q};if(typeof K.onResult==="function")K.onResult(C);if(q===!1)return C.isMatch=!1,B?C:!1;if(W(j)){if(typeof K.onIgnore==="function")K.onIgnore(C);return C.isMatch=!1,B?C:!1}if(typeof K.onMatch==="function")K.onMatch(C);return B?C:!0};if(Z)_.state=G;return _};U0.test=($,J,Z,{glob:Y,posix:K}={})=>{if(typeof $!=="string")throw TypeError("Expected input to be a string");if($==="")return{isMatch:!1,output:""};let V=Z||{},Q=V.format||(K?G7.toPosixSlashes:null),G=$===Y,W=G&&Q?Q($):$;if(G===!1)W=Q?Q($):$,G=W===Y;if(G===!1||V.capture===!0)if(V.matchBase===!0||V.basename===!0)G=U0.matchBase($,J,Z,K);else G=J.exec(W);return{isMatch:Boolean(G),match:G,output:W}};U0.matchBase=($,J,Z,Y=G7.isWindows(Z))=>{return(J instanceof RegExp?J:U0.makeRe(J,Z)).test(nO.basename($))};U0.isMatch=($,J,Z)=>U0(J,Z)($);U0.parse=($,J)=>{if(Array.isArray($))return $.map((Z)=>U0.parse(Z,J));return X7($,{...J,fastpaths:!1})};U0.scan=($,J)=>aO($,J);U0.compileRe=($,J,Z=!1,Y=!1)=>{if(Z===!0)return $.output;let K=J||{},V=K.contains?"":"^",Q=K.contains?"":"$",G=`${V}(?:${$.output})${Q}`;if($&&$.negated===!0)G=`^(?!${G}).*$`;let W=U0.toRegex(G,J);if(Y===!0)W.state=$;return W};U0.makeRe=($,J={},Z=!1,Y=!1)=>{if(!$||typeof $!=="string")throw TypeError("Expected a non-empty string");let K={negated:!1,fastpaths:!0};if(J.fastpaths!==!1&&($[0]==="."||$[0]==="*"))K.output=X7.fastpaths($,J);if(!K.output)K=X7($,J);return U0.compileRe(K,J,Z,Y)};U0.toRegex=($,J)=>{try{let Z=J||{};return new RegExp($,Z.flags||(Z.nocase?"i":""))}catch(Z){if(J&&J.debug===!0)throw Z;return/$^/}};U0.constants=tO;uV.exports=U0});var iV=p((bR,rV)=>{var cV=d0("util"),lV=IV(),R1=dV(),W7=G8(),pV=($)=>$===""||$==="./",oV=($)=>{let J=$.indexOf("{");return J>-1&&$.indexOf("}",J)>-1},a$=($,J,Z)=>{J=[].concat(J),$=[].concat($);let Y=new Set,K=new Set,V=new Set,Q=0,G=(j)=>{if(V.add(j.output),Z&&Z.onResult)Z.onResult(j)};for(let j=0;j<J.length;j++){let B=R1(String(J[j]),{...Z,onResult:G},!0),q=B.state.negated||B.state.negatedExtglob;if(q)Q++;for(let U of $){let z=B(U,!0);if(!(q?!z.isMatch:z.isMatch))continue;if(q)Y.add(z.output);else Y.delete(z.output),K.add(z.output)}}let _=(Q===J.length?[...V]:[...K]).filter((j)=>!Y.has(j));if(Z&&_.length===0){if(Z.failglob===!0)throw Error(`No matches found for "${J.join(", ")}"`);if(Z.nonull===!0||Z.nullglob===!0)return Z.unescape?J.map((j)=>j.replace(/\\/g,"")):J}return _};a$.match=a$;a$.matcher=($,J)=>R1($,J);a$.isMatch=($,J,Z)=>R1(J,Z)($);a$.any=a$.isMatch;a$.not=($,J,Z={})=>{J=[].concat(J).map(String);let Y=new Set,K=[],Q=new Set(a$($,J,{...Z,onResult:(G)=>{if(Z.onResult)Z.onResult(G);K.push(G.output)}}));for(let G of K)if(!Q.has(G))Y.add(G);return[...Y]};a$.contains=($,J,Z)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${cV.inspect($)}"`);if(Array.isArray(J))return J.some((Y)=>a$.contains($,Y,Z));if(typeof J==="string"){if(pV($)||pV(J))return!1;if($.includes(J)||$.startsWith("./")&&$.slice(2).includes(J))return!0}return a$.isMatch($,J,{...Z,contains:!0})};a$.matchKeys=($,J,Z)=>{if(!W7.isObject($))throw TypeError("Expected the first argument to be an object");let Y=a$(Object.keys($),J,Z),K={};for(let V of Y)K[V]=$[V];return K};a$.some=($,J,Z)=>{let Y=[].concat($);for(let K of[].concat(J)){let V=R1(String(K),Z);if(Y.some((Q)=>V(Q)))return!0}return!1};a$.every=($,J,Z)=>{let Y=[].concat($);for(let K of[].concat(J)){let V=R1(String(K),Z);if(!Y.every((Q)=>V(Q)))return!1}return!0};a$.all=($,J,Z)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${cV.inspect($)}"`);return[].concat(J).every((Y)=>R1(Y,Z)($))};a$.capture=($,J,Z)=>{let Y=W7.isWindows(Z),V=R1.makeRe(String($),{...Z,capture:!0}).exec(Y?W7.toPosixSlashes(J):J);if(V)return V.slice(1).map((Q)=>Q===void 0?"":Q)};a$.makeRe=(...$)=>R1.makeRe(...$);a$.scan=(...$)=>R1.scan(...$);a$.parse=($,J)=>{let Z=[];for(let Y of[].concat($||[]))for(let K of lV(String(Y),J))Z.push(R1.parse(K,J));return Z};a$.braces=($,J)=>{if(typeof $!=="string")throw TypeError("Expected a string");if(J&&J.nobrace===!0||!oV($))return[$];return lV($,J)};a$.braceExpand=($,J)=>{if(typeof $!=="string")throw TypeError("Expected a string");return a$.braces($,{...J,expand:!0})};a$.hasBraces=oV;rV.exports=a$});var nV=p((vR,sV)=>{/*!
19
19
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
20
20
  *
21
21
  * Copyright (c) 2014-2016, Jon Schlinkert.
22
22
  * Licensed under the MIT License.
23
- */oQ.exports=function(J){if(typeof J!=="string"||J==="")return!1;var Z;while(Z=/(\\).|([@?!+*]\(.*\))/g.exec(J)){if(Z[2])return!0;J=J.slice(Z.index+Z[0].length)}return!1}});var nQ=p((Nw,sQ)=>{/*!
23
+ */sV.exports=function(J){if(typeof J!=="string"||J==="")return!1;var Z;while(Z=/(\\).|([@?!+*]\(.*\))/g.exec(J)){if(Z[2])return!0;J=J.slice(Z.index+Z[0].length)}return!1}});var eV=p((hR,tV)=>{/*!
24
24
  * is-glob <https://github.com/jonschlinkert/is-glob>
25
25
  *
26
26
  * Copyright (c) 2014-2017, Jon Schlinkert.
27
27
  * Released under the MIT License.
28
- */var nO=rQ(),iQ={"{":"}","(":")","[":"]"},aO=function($){if($[0]==="!")return!0;var J=0,Z=-2,Y=-2,K=-2,Q=-2,V=-2;while(J<$.length){if($[J]==="*")return!0;if($[J+1]==="?"&&/[\].+)]/.test($[J]))return!0;if(Y!==-1&&$[J]==="["&&$[J+1]!=="]"){if(Y<J)Y=$.indexOf("]",J);if(Y>J){if(V===-1||V>Y)return!0;if(V=$.indexOf("\\",J),V===-1||V>Y)return!0}}if(K!==-1&&$[J]==="{"&&$[J+1]!=="}"){if(K=$.indexOf("}",J),K>J){if(V=$.indexOf("\\",J),V===-1||V>K)return!0}}if(Q!==-1&&$[J]==="("&&$[J+1]==="?"&&/[:!=]/.test($[J+2])&&$[J+3]!==")"){if(Q=$.indexOf(")",J),Q>J){if(V=$.indexOf("\\",J),V===-1||V>Q)return!0}}if(Z!==-1&&$[J]==="("&&$[J+1]!=="|"){if(Z<J)Z=$.indexOf("|",J);if(Z!==-1&&$[Z+1]!==")"){if(Q=$.indexOf(")",Z),Q>Z){if(V=$.indexOf("\\",Z),V===-1||V>Q)return!0}}}if($[J]==="\\"){var X=$[J+1];J+=2;var W=iQ[X];if(W){var _=$.indexOf(W,J);if(_!==-1)J=_+1}if($[J]==="!")return!0}else J++}return!1},tO=function($){if($[0]==="!")return!0;var J=0;while(J<$.length){if(/[*?{}()[\]]/.test($[J]))return!0;if($[J]==="\\"){var Z=$[J+1];J+=2;var Y=iQ[Z];if(Y){var K=$.indexOf(Y,J);if(K!==-1)J=K+1}if($[J]==="!")return!0}else J++}return!1};sQ.exports=function(J,Z){if(typeof J!=="string"||J==="")return!1;if(nO(J))return!0;var Y=aO;if(Z&&Z.strict===!1)Y=tO;return Y(J)}});var aG=p((Bk,nG)=>{var Cz=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],sG=/[\n\r\u2028\u2029]/,Mz=/[\s#!"$&'():;<=>@\\^`|]/g;nG.exports=function(J){return J.map(function(Z){if(Z==="")return"''";if(Z&&typeof Z==="object"){if(Z.op==="glob"){if(typeof Z.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(sG.test(Z.pattern))throw TypeError("glob `pattern` must not contain line terminators");return Z.pattern.replace(Mz,"\\$&")}if(typeof Z.op==="string"){if(Cz.indexOf(Z.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(Z.op));return Z.op.replace(/[\s\S]/g,"\\$&")}if(typeof Z.comment==="string"){if(sG.test(Z.comment))throw TypeError("`comment` must not contain line terminators");return"#"+Z.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(Z)&&!/'/.test(Z))return"'"+Z.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(Z))return'"'+Z.replace(/(["\\$`!])/g,"\\$1")+'"';return String(Z).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")}});var KX=p((Hk,YX)=>{var ZX="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",tG=new RegExp("^"+ZX+"$"),eG="|&;()<> \\t",Dz='"((\\\\"|[^"])*?)"',Pz="'((\\\\'|[^'])*?)'",Iz=/^#$/,$X="'",JX='"',x7="$",p2="",Az=4294967296;for(MZ=0;MZ<4;MZ++)p2+=(Az*Math.random()).toString(16);var MZ,Sz=new RegExp("^"+p2);function wz($,J){var Z=J.lastIndex,Y=[],K;while(K=J.exec($))if(Y.push(K),J.lastIndex===K.index)J.lastIndex+=1;return J.lastIndex=Z,Y}function Rz($,J,Z){var Y=typeof $==="function"?$(Z):$[Z];if(typeof Y>"u"&&Z!="")Y="";else if(typeof Y>"u")Y="$";if(typeof Y==="object")return J+p2+JSON.stringify(Y)+p2;return J+Y}function Lz($,J,Z){if(!Z)Z={};var Y=Z.escape||"\\",K="(\\"+Y+`['"`+eG+`]|[^\\s'"`+eG+"])+",Q=new RegExp(["("+ZX+")","("+K+"|"+Dz+"|"+Pz+")+"].join("|"),"g"),V=wz($,Q);if(V.length===0)return[];if(!J)J={};var X=!1;return V.map(function(W){var _=W[0];if(!_||X)return;if(tG.test(_))return{op:_};var j=!1,H=!1,q="",U=!1,z;function M(){z+=1;var P,D,L=_.charAt(z);if(L==="{"){if(z+=1,_.charAt(z)==="}")throw Error("Bad substitution: "+_.slice(z-2,z+1));if(P=_.indexOf("}",z),P<0)throw Error("Bad substitution: "+_.slice(z));D=_.slice(z,P),z=P}else if(/[*@#?$!_-]/.test(L))D=L,z+=1;else{var R=_.slice(z);if(P=R.match(/[^\w\d_]/),!P)D=R,z=_.length;else D=R.slice(0,P.index),z+=P.index-1}return Rz(J,"",D)}for(z=0;z<_.length;z++){var I=_.charAt(z);if(U=U||!j&&(I==="*"||I==="?"),H)q+=I,H=!1;else if(j)if(I===j)j=!1;else if(j==$X)q+=I;else if(I===Y)if(z+=1,I=_.charAt(z),I===JX||I===Y||I===x7)q+=I;else q+=Y+I;else if(I===x7)q+=M();else q+=I;else if(I===JX||I===$X)j=I;else if(tG.test(I))return{op:_};else if(Iz.test(I)){X=!0;var C={comment:$.slice(W.index+z+1)};if(q.length)return[q,C];return[C]}else if(I===Y)H=!0;else if(I===x7)q+=M();else q+=I}if(U)return{op:"glob",pattern:q};return q}).reduce(function(W,_){return typeof _>"u"?W:W.concat(_)},[])}YX.exports=function(J,Z,Y){var K=Lz(J,Z,Y);if(typeof Z!=="function")return K;return K.reduce(function(Q,V){if(typeof V==="object")return Q.concat(V);var X=V.split(RegExp("("+p2+".*?"+p2+")","g"));if(X.length===1)return Q.concat(X[0]);return Q.concat(X.filter(Boolean).map(function(W){if(Sz.test(W))return JSON.parse(W.split(p2)[1]);return W}))},[])}});var QX=p((Nz)=>{Nz.quote=aG();Nz.parse=KX()});var TJ=p((Hb,eX)=>{eX.exports=r2;r2.CAPTURING_PHASE=1;r2.AT_TARGET=2;r2.BUBBLING_PHASE=3;function r2($,J){if(this.type="",this.target=null,this.currentTarget=null,this.eventPhase=r2.AT_TARGET,this.bubbles=!1,this.cancelable=!1,this.isTrusted=!1,this.defaultPrevented=!1,this.timeStamp=Date.now(),this._propagationStopped=!1,this._immediatePropagationStopped=!1,this._initialized=!0,this._dispatching=!1,$)this.type=$;if(J)for(var Z in J)this[Z]=J[Z]}r2.prototype=Object.create(Object.prototype,{constructor:{value:r2},stopPropagation:{value:function(){this._propagationStopped=!0}},stopImmediatePropagation:{value:function(){this._propagationStopped=!0,this._immediatePropagationStopped=!0}},preventDefault:{value:function(){if(this.cancelable)this.defaultPrevented=!0}},initEvent:{value:function(J,Z,Y){if(this._initialized=!0,this._dispatching)return;this._propagationStopped=!1,this._immediatePropagationStopped=!1,this.defaultPrevented=!1,this.isTrusted=!1,this.target=null,this.type=J,this.bubbles=Z,this.cancelable=Y}}})});var a7=p((_b,JW)=>{var $W=TJ();JW.exports=n7;function n7(){$W.call(this),this.view=null,this.detail=0}n7.prototype=Object.create($W.prototype,{constructor:{value:n7},initUIEvent:{value:function($,J,Z,Y,K){this.initEvent($,J,Z),this.view=Y,this.detail=K}}})});var e7=p((Ob,YW)=>{var ZW=a7();YW.exports=t7;function t7(){ZW.call(this),this.screenX=this.screenY=this.clientX=this.clientY=0,this.ctrlKey=this.altKey=this.shiftKey=this.metaKey=!1,this.button=0,this.buttons=1,this.relatedTarget=null}t7.prototype=Object.create(ZW.prototype,{constructor:{value:t7},initMouseEvent:{value:function($,J,Z,Y,K,Q,V,X,W,_,j,H,q,U,z){switch(this.initEvent($,J,Z,Y,K),this.screenX=Q,this.screenY=V,this.clientX=X,this.clientY=W,this.ctrlKey=_,this.altKey=j,this.shiftKey=H,this.metaKey=q,this.button=U,U){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2;break;default:this.buttons=0;break}this.relatedTarget=z}},getModifierState:{value:function($){switch($){case"Alt":return this.altKey;case"Control":return this.ctrlKey;case"Shift":return this.shiftKey;case"Meta":return this.metaKey;default:return!1}}}})});var vZ=p((qb,QW)=>{QW.exports=bZ;var hC=1,gC=3,fC=4,mC=5,uC=7,dC=8,pC=9,cC=11,lC=12,oC=13,rC=14,iC=15,sC=17,nC=18,aC=19,tC=20,eC=21,$M=22,JM=23,ZM=24,YM=25,KM=[null,"INDEX_SIZE_ERR",null,"HIERARCHY_REQUEST_ERR","WRONG_DOCUMENT_ERR","INVALID_CHARACTER_ERR",null,"NO_MODIFICATION_ALLOWED_ERR","NOT_FOUND_ERR","NOT_SUPPORTED_ERR","INUSE_ATTRIBUTE_ERR","INVALID_STATE_ERR","SYNTAX_ERR","INVALID_MODIFICATION_ERR","NAMESPACE_ERR","INVALID_ACCESS_ERR",null,"TYPE_MISMATCH_ERR","SECURITY_ERR","NETWORK_ERR","ABORT_ERR","URL_MISMATCH_ERR","QUOTA_EXCEEDED_ERR","TIMEOUT_ERR","INVALID_NODE_TYPE_ERR","DATA_CLONE_ERR"],QM=[null,"INDEX_SIZE_ERR (1): the index is not in the allowed range",null,"HIERARCHY_REQUEST_ERR (3): the operation would yield an incorrect nodes model","WRONG_DOCUMENT_ERR (4): the object is in the wrong Document, a call to importNode is required","INVALID_CHARACTER_ERR (5): the string contains invalid characters",null,"NO_MODIFICATION_ALLOWED_ERR (7): the object can not be modified","NOT_FOUND_ERR (8): the object can not be found here","NOT_SUPPORTED_ERR (9): this operation is not supported","INUSE_ATTRIBUTE_ERR (10): setAttributeNode called on owned Attribute","INVALID_STATE_ERR (11): the object is in an invalid state","SYNTAX_ERR (12): the string did not match the expected pattern","INVALID_MODIFICATION_ERR (13): the object can not be modified in this way","NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML","INVALID_ACCESS_ERR (15): the object does not support the operation or argument",null,"TYPE_MISMATCH_ERR (17): the type of the object does not match the expected type","SECURITY_ERR (18): the operation is insecure","NETWORK_ERR (19): a network error occurred","ABORT_ERR (20): the user aborted an operation","URL_MISMATCH_ERR (21): the given URL does not match another URL","QUOTA_EXCEEDED_ERR (22): the quota has been exceeded","TIMEOUT_ERR (23): a timeout occurred","INVALID_NODE_TYPE_ERR (24): the supplied node is invalid or has an invalid ancestor for this operation","DATA_CLONE_ERR (25): the object can not be cloned."],KW={INDEX_SIZE_ERR:hC,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:gC,WRONG_DOCUMENT_ERR:fC,INVALID_CHARACTER_ERR:mC,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:uC,NOT_FOUND_ERR:dC,NOT_SUPPORTED_ERR:pC,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:cC,SYNTAX_ERR:lC,INVALID_MODIFICATION_ERR:oC,NAMESPACE_ERR:rC,INVALID_ACCESS_ERR:iC,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:sC,SECURITY_ERR:nC,NETWORK_ERR:aC,ABORT_ERR:tC,URL_MISMATCH_ERR:eC,QUOTA_EXCEEDED_ERR:$M,TIMEOUT_ERR:JM,INVALID_NODE_TYPE_ERR:ZM,DATA_CLONE_ERR:YM};function bZ($){Error.call(this),Error.captureStackTrace(this,this.constructor),this.code=$,this.message=QM[$],this.name=KM[$]}bZ.prototype.__proto__=Error.prototype;for(I8 in KW)xZ={value:KW[I8]},Object.defineProperty(bZ,I8,xZ),Object.defineProperty(bZ.prototype,I8,xZ);var xZ,I8});var hZ=p((VM)=>{VM.isApiWritable=!globalThis.__domino_frozen__});var X0=p((WM)=>{var G0=vZ(),H0=G0,XM=hZ().isApiWritable;WM.NAMESPACE={HTML:"http://www.w3.org/1999/xhtml",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink"};WM.IndexSizeError=function(){throw new G0(H0.INDEX_SIZE_ERR)};WM.HierarchyRequestError=function(){throw new G0(H0.HIERARCHY_REQUEST_ERR)};WM.WrongDocumentError=function(){throw new G0(H0.WRONG_DOCUMENT_ERR)};WM.InvalidCharacterError=function(){throw new G0(H0.INVALID_CHARACTER_ERR)};WM.NoModificationAllowedError=function(){throw new G0(H0.NO_MODIFICATION_ALLOWED_ERR)};WM.NotFoundError=function(){throw new G0(H0.NOT_FOUND_ERR)};WM.NotSupportedError=function(){throw new G0(H0.NOT_SUPPORTED_ERR)};WM.InvalidStateError=function(){throw new G0(H0.INVALID_STATE_ERR)};WM.SyntaxError=function(){throw new G0(H0.SYNTAX_ERR)};WM.InvalidModificationError=function(){throw new G0(H0.INVALID_MODIFICATION_ERR)};WM.NamespaceError=function(){throw new G0(H0.NAMESPACE_ERR)};WM.InvalidAccessError=function(){throw new G0(H0.INVALID_ACCESS_ERR)};WM.TypeMismatchError=function(){throw new G0(H0.TYPE_MISMATCH_ERR)};WM.SecurityError=function(){throw new G0(H0.SECURITY_ERR)};WM.NetworkError=function(){throw new G0(H0.NETWORK_ERR)};WM.AbortError=function(){throw new G0(H0.ABORT_ERR)};WM.UrlMismatchError=function(){throw new G0(H0.URL_MISMATCH_ERR)};WM.QuotaExceededError=function(){throw new G0(H0.QUOTA_EXCEEDED_ERR)};WM.TimeoutError=function(){throw new G0(H0.TIMEOUT_ERR)};WM.InvalidNodeTypeError=function(){throw new G0(H0.INVALID_NODE_TYPE_ERR)};WM.DataCloneError=function(){throw new G0(H0.DATA_CLONE_ERR)};WM.nyi=function(){throw Error("NotYetImplemented")};WM.shouldOverride=function(){throw Error("Abstract function; should be overriding in subclass.")};WM.assert=function($,J){if(!$)throw Error("Assertion failed: "+(J||"")+`
29
- `+Error().stack)};WM.expose=function($,J){for(var Z in $)Object.defineProperty(J.prototype,Z,{value:$[Z],writable:XM})};WM.merge=function($,J){for(var Z in J)$[Z]=J[Z]};WM.documentOrder=function($,J){return 3-($.compareDocumentPosition(J)&6)};WM.toASCIILowerCase=function($){return $.replace(/[A-Z]+/g,function(J){return J.toLowerCase()})};WM.toASCIIUpperCase=function($){return $.replace(/[a-z]+/g,function(J){return J.toUpperCase()})}});var $Y=p((Cb,GW)=>{var i2=TJ(),mM=e7(),uM=X0();GW.exports=VW;function VW(){}VW.prototype={addEventListener:function(J,Z,Y){if(!Z)return;if(Y===void 0)Y=!1;if(!this._listeners)this._listeners=Object.create(null);if(!this._listeners[J])this._listeners[J]=[];var K=this._listeners[J];for(var Q=0,V=K.length;Q<V;Q++){var X=K[Q];if(X.listener===Z&&X.capture===Y)return}var W={listener:Z,capture:Y};if(typeof Z==="function")W.f=Z;K.push(W)},removeEventListener:function(J,Z,Y){if(Y===void 0)Y=!1;if(this._listeners){var K=this._listeners[J];if(K)for(var Q=0,V=K.length;Q<V;Q++){var X=K[Q];if(X.listener===Z&&X.capture===Y){if(K.length===1)this._listeners[J]=void 0;else K.splice(Q,1);return}}}},dispatchEvent:function(J){return this._dispatchEvent(J,!1)},_dispatchEvent:function(J,Z){if(typeof Z!=="boolean")Z=!1;function Y(_,j){var{type:H,eventPhase:q}=j;if(j.currentTarget=_,q!==i2.CAPTURING_PHASE&&_._handlers&&_._handlers[H]){var U=_._handlers[H],z;if(typeof U==="function")z=U.call(j.currentTarget,j);else{var M=U.handleEvent;if(typeof M!=="function")throw TypeError("handleEvent property of event handler object isnot a function.");z=M.call(U,j)}switch(j.type){case"mouseover":if(z===!0)j.preventDefault();break;case"beforeunload":default:if(z===!1)j.preventDefault();break}}var I=_._listeners&&_._listeners[H];if(!I)return;I=I.slice();for(var C=0,P=I.length;C<P;C++){if(j._immediatePropagationStopped)return;var D=I[C];if(q===i2.CAPTURING_PHASE&&!D.capture||q===i2.BUBBLING_PHASE&&D.capture)continue;if(D.f)D.f.call(j.currentTarget,j);else{var L=D.listener.handleEvent;if(typeof L!=="function")throw TypeError("handleEvent property of event listener object is not a function.");L.call(D.listener,j)}}}if(!J._initialized||J._dispatching)uM.InvalidStateError();J.isTrusted=Z,J._dispatching=!0,J.target=this;var K=[];for(var Q=this.parentNode;Q;Q=Q.parentNode)K.push(Q);J.eventPhase=i2.CAPTURING_PHASE;for(var V=K.length-1;V>=0;V--)if(Y(K[V],J),J._propagationStopped)break;if(!J._propagationStopped)J.eventPhase=i2.AT_TARGET,Y(this,J);if(J.bubbles&&!J._propagationStopped){J.eventPhase=i2.BUBBLING_PHASE;for(var X=0,W=K.length;X<W;X++)if(Y(K[X],J),J._propagationStopped)break}if(J._dispatching=!1,J.eventPhase=i2.AT_TARGET,J.currentTarget=null,Z&&!J.defaultPrevented&&J instanceof mM)switch(J.type){case"mousedown":this._armed={x:J.clientX,y:J.clientY,t:J.timeStamp};break;case"mouseout":case"mouseover":this._armed=null;break;case"mouseup":if(this._isClick(J))this._doClick(J);this._armed=null;break}return!J.defaultPrevented},_isClick:function($){return this._armed!==null&&$.type==="mouseup"&&$.isTrusted&&$.button===0&&$.timeStamp-this._armed.t<1000&&Math.abs($.clientX-this._armed.x)<10&&Math.abs($.clientY-this._armed.Y)<10},_doClick:function($){if(this._click_in_progress)return;this._click_in_progress=!0;var J=this;while(J&&!J._post_click_activation_steps)J=J.parentNode;if(J&&J._pre_click_activation_steps)J._pre_click_activation_steps();var Z=this.ownerDocument.createEvent("MouseEvent");Z.initMouseEvent("click",!0,!0,this.ownerDocument.defaultView,1,$.screenX,$.screenY,$.clientX,$.clientY,$.ctrlKey,$.altKey,$.shiftKey,$.metaKey,$.button,null);var Y=this._dispatchEvent(Z,!0);if(J){if(Y){if(J._post_click_activation_steps)J._post_click_activation_steps(Z)}else if(J._cancelled_activation_steps)J._cancelled_activation_steps()}},_setEventHandler:function(J,Z){if(!this._handlers)this._handlers=Object.create(null);this._handlers[J]=Z},_getEventHandler:function(J){return this._handlers&&this._handlers[J]||null}}});var JY=p((Mb,XW)=>{var r1=X0(),V1=XW.exports={valid:function($){return r1.assert($,"list falsy"),r1.assert($._previousSibling,"previous falsy"),r1.assert($._nextSibling,"next falsy"),!0},insertBefore:function($,J){r1.assert(V1.valid($)&&V1.valid(J));var Z=$,Y=$._previousSibling,K=J,Q=J._previousSibling;Z._previousSibling=Q,Y._nextSibling=K,Q._nextSibling=Z,K._previousSibling=Y,r1.assert(V1.valid($)&&V1.valid(J))},replace:function($,J){if(r1.assert(V1.valid($)&&(J===null||V1.valid(J))),J!==null)V1.insertBefore(J,$);V1.remove($),r1.assert(V1.valid($)&&(J===null||V1.valid(J)))},remove:function($){r1.assert(V1.valid($));var J=$._previousSibling;if(J===$)return;var Z=$._nextSibling;J._nextSibling=Z,Z._previousSibling=J,$._previousSibling=$._nextSibling=$,r1.assert(V1.valid($))}}});var ZY=p((Db,qW)=>{qW.exports={serializeOne:iM,\u{275}escapeMatchingClosingTag:HW,\u{275}escapeClosingCommentTag:_W,\u{275}escapeProcessingInstructionContent:OW};var BW=X0(),s2=BW.NAMESPACE,WW={STYLE:!0,SCRIPT:!0,XMP:!0,IFRAME:!0,NOEMBED:!0,NOFRAMES:!0,PLAINTEXT:!0},dM={area:!0,base:!0,basefont:!0,bgsound:!0,br:!0,col:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},pM={},jW=/[&<>\u00A0]/g,UW=/[&"<>\u00A0]/g;function cM($){if(!jW.test($))return $;return $.replace(jW,(J)=>{switch(J){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case"\xA0":return"&nbsp;"}})}function lM($){if(!UW.test($))return $;return $.replace(UW,(J)=>{switch(J){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case'"':return"&quot;";case"\xA0":return"&nbsp;"}})}function oM($){var J=$.namespaceURI;if(!J)return $.localName;if(J===s2.XML)return"xml:"+$.localName;if(J===s2.XLINK)return"xlink:"+$.localName;if(J===s2.XMLNS)if($.localName==="xmlns")return"xmlns";else return"xmlns:"+$.localName;return $.name}function HW($,J){let Z="</"+J;if(!$.toLowerCase().includes(Z))return $;let Y=[...$],K=$.matchAll(new RegExp(Z,"ig"));for(let Q of K)Y[Q.index]="&lt;";return Y.join("")}var rM=/--!?>/;function _W($){if(!rM.test($))return $;return $.replace(/(--\!?)>/g,"$1&gt;")}function OW($){return $.includes(">")?$.replaceAll(">","&gt;"):$}function iM($,J){var Z="";switch($.nodeType){case 1:var Y=$.namespaceURI,K=Y===s2.HTML,Q=K||Y===s2.SVG||Y===s2.MATHML?$.localName:$.tagName;Z+="<"+Q;for(var V=0,X=$._numattrs;V<X;V++){var W=$._attr(V);if(Z+=" "+oM(W),W.value!==void 0)Z+='="'+lM(W.value)+'"'}if(Z+=">",!(K&&dM[Q])){var _=$.serialize();if(WW[Q.toUpperCase()])_=HW(_,Q);if(K&&pM[Q]&&_.charAt(0)===`
28
+ */var $q=nV(),aV={"{":"}","(":")","[":"]"},Jq=function($){if($[0]==="!")return!0;var J=0,Z=-2,Y=-2,K=-2,V=-2,Q=-2;while(J<$.length){if($[J]==="*")return!0;if($[J+1]==="?"&&/[\].+)]/.test($[J]))return!0;if(Y!==-1&&$[J]==="["&&$[J+1]!=="]"){if(Y<J)Y=$.indexOf("]",J);if(Y>J){if(Q===-1||Q>Y)return!0;if(Q=$.indexOf("\\",J),Q===-1||Q>Y)return!0}}if(K!==-1&&$[J]==="{"&&$[J+1]!=="}"){if(K=$.indexOf("}",J),K>J){if(Q=$.indexOf("\\",J),Q===-1||Q>K)return!0}}if(V!==-1&&$[J]==="("&&$[J+1]==="?"&&/[:!=]/.test($[J+2])&&$[J+3]!==")"){if(V=$.indexOf(")",J),V>J){if(Q=$.indexOf("\\",J),Q===-1||Q>V)return!0}}if(Z!==-1&&$[J]==="("&&$[J+1]!=="|"){if(Z<J)Z=$.indexOf("|",J);if(Z!==-1&&$[Z+1]!==")"){if(V=$.indexOf(")",Z),V>Z){if(Q=$.indexOf("\\",Z),Q===-1||Q>V)return!0}}}if($[J]==="\\"){var G=$[J+1];J+=2;var W=aV[G];if(W){var _=$.indexOf(W,J);if(_!==-1)J=_+1}if($[J]==="!")return!0}else J++}return!1},Zq=function($){if($[0]==="!")return!0;var J=0;while(J<$.length){if(/[*?{}()[\]]/.test($[J]))return!0;if($[J]==="\\"){var Z=$[J+1];J+=2;var Y=aV[Z];if(Y){var K=$.indexOf(Y,J);if(K!==-1)J=K+1}if($[J]==="!")return!0}else J++}return!1};tV.exports=function(J,Z){if(typeof J!=="string"||J==="")return!1;if($q(J))return!0;var Y=Jq;if(Z&&Z.strict===!1)Y=Zq;return Y(J)}});var ZG=p((Dk,JG)=>{var wz=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],$G=/[\n\r\u2028\u2029]/,Lz=/[\s#!"$&'():;<=>@\\^`|]/g;JG.exports=function(J){return J.map(function(Z){if(Z==="")return"''";if(Z&&typeof Z==="object"){if(Z.op==="glob"){if(typeof Z.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if($G.test(Z.pattern))throw TypeError("glob `pattern` must not contain line terminators");return Z.pattern.replace(Lz,"\\$&")}if(typeof Z.op==="string"){if(wz.indexOf(Z.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(Z.op));return Z.op.replace(/[\s\S]/g,"\\$&")}if(typeof Z.comment==="string"){if($G.test(Z.comment))throw TypeError("`comment` must not contain line terminators");return"#"+Z.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(Z)&&!/'/.test(Z))return"'"+Z.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(Z))return'"'+Z.replace(/(["\\$`!])/g,"\\$1")+'"';return String(Z).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")}});var WG=p((Pk,GG)=>{var XG="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",YG=new RegExp("^"+XG+"$"),KG="|&;()<> \\t",Nz='"((\\\\"|[^"])*?)"',yz="'((\\\\'|[^'])*?)'",Tz=/^#$/,VG="'",QG='"',v7="$",p2="",kz=4294967296;for(CZ=0;CZ<4;CZ++)p2+=(kz*Math.random()).toString(16);var CZ,Ez=new RegExp("^"+p2);function xz($,J){var Z=J.lastIndex,Y=[],K;while(K=J.exec($))if(Y.push(K),J.lastIndex===K.index)J.lastIndex+=1;return J.lastIndex=Z,Y}function bz($,J,Z){var Y=typeof $==="function"?$(Z):$[Z];if(typeof Y>"u"&&Z!="")Y="";else if(typeof Y>"u")Y="$";if(typeof Y==="object")return J+p2+JSON.stringify(Y)+p2;return J+Y}function vz($,J,Z){if(!Z)Z={};var Y=Z.escape||"\\",K="(\\"+Y+`['"`+KG+`]|[^\\s'"`+KG+"])+",V=new RegExp(["("+XG+")","("+K+"|"+Nz+"|"+yz+")+"].join("|"),"g"),Q=xz($,V);if(Q.length===0)return[];if(!J)J={};var G=!1;return Q.map(function(W){var _=W[0];if(!_||G)return;if(YG.test(_))return{op:_};var j=!1,B=!1,q="",U=!1,z;function C(){z+=1;var I,P,L=_.charAt(z);if(L==="{"){if(z+=1,_.charAt(z)==="}")throw Error("Bad substitution: "+_.slice(z-2,z+1));if(I=_.indexOf("}",z),I<0)throw Error("Bad substitution: "+_.slice(z));P=_.slice(z,I),z=I}else if(/[*@#?$!_-]/.test(L))P=L,z+=1;else{var w=_.slice(z);if(I=w.match(/[^\w\d_]/),!I)P=w,z=_.length;else P=w.slice(0,I.index),z+=I.index-1}return bz(J,"",P)}for(z=0;z<_.length;z++){var D=_.charAt(z);if(U=U||!j&&(D==="*"||D==="?"),B)q+=D,B=!1;else if(j)if(D===j)j=!1;else if(j==VG)q+=D;else if(D===Y)if(z+=1,D=_.charAt(z),D===QG||D===Y||D===v7)q+=D;else q+=Y+D;else if(D===v7)q+=C();else q+=D;else if(D===QG||D===VG)j=D;else if(YG.test(D))return{op:_};else if(Tz.test(D)){G=!0;var M={comment:$.slice(W.index+z+1)};if(q.length)return[q,M];return[M]}else if(D===Y)B=!0;else if(D===v7)q+=C();else q+=D}if(U)return{op:"glob",pattern:q};return q}).reduce(function(W,_){return typeof _>"u"?W:W.concat(_)},[])}GG.exports=function(J,Z,Y){var K=vz(J,Z,Y);if(typeof Z!=="function")return K;return K.reduce(function(V,Q){if(typeof Q==="object")return V.concat(Q);var G=Q.split(RegExp("("+p2+".*?"+p2+")","g"));if(G.length===1)return V.concat(G[0]);return V.concat(G.filter(Boolean).map(function(W){if(Ez.test(W))return JSON.parse(W.split(p2)[1]);return W}))},[])}});var jG=p((hz)=>{hz.quote=ZG();hz.parse=WG()});var TJ=p((Pb,KW)=>{KW.exports=r2;r2.CAPTURING_PHASE=1;r2.AT_TARGET=2;r2.BUBBLING_PHASE=3;function r2($,J){if(this.type="",this.target=null,this.currentTarget=null,this.eventPhase=r2.AT_TARGET,this.bubbles=!1,this.cancelable=!1,this.isTrusted=!1,this.defaultPrevented=!1,this.timeStamp=Date.now(),this._propagationStopped=!1,this._immediatePropagationStopped=!1,this._initialized=!0,this._dispatching=!1,$)this.type=$;if(J)for(var Z in J)this[Z]=J[Z]}r2.prototype=Object.create(Object.prototype,{constructor:{value:r2},stopPropagation:{value:function(){this._propagationStopped=!0}},stopImmediatePropagation:{value:function(){this._propagationStopped=!0,this._immediatePropagationStopped=!0}},preventDefault:{value:function(){if(this.cancelable)this.defaultPrevented=!0}},initEvent:{value:function(J,Z,Y){if(this._initialized=!0,this._dispatching)return;this._propagationStopped=!1,this._immediatePropagationStopped=!1,this.defaultPrevented=!1,this.isTrusted=!1,this.target=null,this.type=J,this.bubbles=Z,this.cancelable=Y}}})});var e7=p((Ib,QW)=>{var VW=TJ();QW.exports=t7;function t7(){VW.call(this),this.view=null,this.detail=0}t7.prototype=Object.create(VW.prototype,{constructor:{value:t7},initUIEvent:{value:function($,J,Z,Y,K){this.initEvent($,J,Z),this.view=Y,this.detail=K}}})});var JY=p((Ab,GW)=>{var XW=e7();GW.exports=$Y;function $Y(){XW.call(this),this.screenX=this.screenY=this.clientX=this.clientY=0,this.ctrlKey=this.altKey=this.shiftKey=this.metaKey=!1,this.button=0,this.buttons=1,this.relatedTarget=null}$Y.prototype=Object.create(XW.prototype,{constructor:{value:$Y},initMouseEvent:{value:function($,J,Z,Y,K,V,Q,G,W,_,j,B,q,U,z){switch(this.initEvent($,J,Z,Y,K),this.screenX=V,this.screenY=Q,this.clientX=G,this.clientY=W,this.ctrlKey=_,this.altKey=j,this.shiftKey=B,this.metaKey=q,this.button=U,U){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2;break;default:this.buttons=0;break}this.relatedTarget=z}},getModifierState:{value:function($){switch($){case"Alt":return this.altKey;case"Control":return this.ctrlKey;case"Shift":return this.shiftKey;case"Meta":return this.metaKey;default:return!1}}}})});var vZ=p((Sb,jW)=>{jW.exports=bZ;var lM=1,oM=3,rM=4,iM=5,sM=7,nM=8,aM=9,tM=11,eM=12,$C=13,JC=14,ZC=15,YC=17,KC=18,VC=19,QC=20,XC=21,GC=22,WC=23,jC=24,UC=25,HC=[null,"INDEX_SIZE_ERR",null,"HIERARCHY_REQUEST_ERR","WRONG_DOCUMENT_ERR","INVALID_CHARACTER_ERR",null,"NO_MODIFICATION_ALLOWED_ERR","NOT_FOUND_ERR","NOT_SUPPORTED_ERR","INUSE_ATTRIBUTE_ERR","INVALID_STATE_ERR","SYNTAX_ERR","INVALID_MODIFICATION_ERR","NAMESPACE_ERR","INVALID_ACCESS_ERR",null,"TYPE_MISMATCH_ERR","SECURITY_ERR","NETWORK_ERR","ABORT_ERR","URL_MISMATCH_ERR","QUOTA_EXCEEDED_ERR","TIMEOUT_ERR","INVALID_NODE_TYPE_ERR","DATA_CLONE_ERR"],BC=[null,"INDEX_SIZE_ERR (1): the index is not in the allowed range",null,"HIERARCHY_REQUEST_ERR (3): the operation would yield an incorrect nodes model","WRONG_DOCUMENT_ERR (4): the object is in the wrong Document, a call to importNode is required","INVALID_CHARACTER_ERR (5): the string contains invalid characters",null,"NO_MODIFICATION_ALLOWED_ERR (7): the object can not be modified","NOT_FOUND_ERR (8): the object can not be found here","NOT_SUPPORTED_ERR (9): this operation is not supported","INUSE_ATTRIBUTE_ERR (10): setAttributeNode called on owned Attribute","INVALID_STATE_ERR (11): the object is in an invalid state","SYNTAX_ERR (12): the string did not match the expected pattern","INVALID_MODIFICATION_ERR (13): the object can not be modified in this way","NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML","INVALID_ACCESS_ERR (15): the object does not support the operation or argument",null,"TYPE_MISMATCH_ERR (17): the type of the object does not match the expected type","SECURITY_ERR (18): the operation is insecure","NETWORK_ERR (19): a network error occurred","ABORT_ERR (20): the user aborted an operation","URL_MISMATCH_ERR (21): the given URL does not match another URL","QUOTA_EXCEEDED_ERR (22): the quota has been exceeded","TIMEOUT_ERR (23): a timeout occurred","INVALID_NODE_TYPE_ERR (24): the supplied node is invalid or has an invalid ancestor for this operation","DATA_CLONE_ERR (25): the object can not be cloned."],WW={INDEX_SIZE_ERR:lM,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:oM,WRONG_DOCUMENT_ERR:rM,INVALID_CHARACTER_ERR:iM,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:sM,NOT_FOUND_ERR:nM,NOT_SUPPORTED_ERR:aM,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:tM,SYNTAX_ERR:eM,INVALID_MODIFICATION_ERR:$C,NAMESPACE_ERR:JC,INVALID_ACCESS_ERR:ZC,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:YC,SECURITY_ERR:KC,NETWORK_ERR:VC,ABORT_ERR:QC,URL_MISMATCH_ERR:XC,QUOTA_EXCEEDED_ERR:GC,TIMEOUT_ERR:WC,INVALID_NODE_TYPE_ERR:jC,DATA_CLONE_ERR:UC};function bZ($){Error.call(this),Error.captureStackTrace(this,this.constructor),this.code=$,this.message=BC[$],this.name=HC[$]}bZ.prototype.__proto__=Error.prototype;for(I8 in WW)xZ={value:WW[I8]},Object.defineProperty(bZ,I8,xZ),Object.defineProperty(bZ.prototype,I8,xZ);var xZ,I8});var hZ=p((_C)=>{_C.isApiWritable=!globalThis.__domino_frozen__});var G0=p((FC)=>{var X0=vZ(),B0=X0,qC=hZ().isApiWritable;FC.NAMESPACE={HTML:"http://www.w3.org/1999/xhtml",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink"};FC.IndexSizeError=function(){throw new X0(B0.INDEX_SIZE_ERR)};FC.HierarchyRequestError=function(){throw new X0(B0.HIERARCHY_REQUEST_ERR)};FC.WrongDocumentError=function(){throw new X0(B0.WRONG_DOCUMENT_ERR)};FC.InvalidCharacterError=function(){throw new X0(B0.INVALID_CHARACTER_ERR)};FC.NoModificationAllowedError=function(){throw new X0(B0.NO_MODIFICATION_ALLOWED_ERR)};FC.NotFoundError=function(){throw new X0(B0.NOT_FOUND_ERR)};FC.NotSupportedError=function(){throw new X0(B0.NOT_SUPPORTED_ERR)};FC.InvalidStateError=function(){throw new X0(B0.INVALID_STATE_ERR)};FC.SyntaxError=function(){throw new X0(B0.SYNTAX_ERR)};FC.InvalidModificationError=function(){throw new X0(B0.INVALID_MODIFICATION_ERR)};FC.NamespaceError=function(){throw new X0(B0.NAMESPACE_ERR)};FC.InvalidAccessError=function(){throw new X0(B0.INVALID_ACCESS_ERR)};FC.TypeMismatchError=function(){throw new X0(B0.TYPE_MISMATCH_ERR)};FC.SecurityError=function(){throw new X0(B0.SECURITY_ERR)};FC.NetworkError=function(){throw new X0(B0.NETWORK_ERR)};FC.AbortError=function(){throw new X0(B0.ABORT_ERR)};FC.UrlMismatchError=function(){throw new X0(B0.URL_MISMATCH_ERR)};FC.QuotaExceededError=function(){throw new X0(B0.QUOTA_EXCEEDED_ERR)};FC.TimeoutError=function(){throw new X0(B0.TIMEOUT_ERR)};FC.InvalidNodeTypeError=function(){throw new X0(B0.INVALID_NODE_TYPE_ERR)};FC.DataCloneError=function(){throw new X0(B0.DATA_CLONE_ERR)};FC.nyi=function(){throw Error("NotYetImplemented")};FC.shouldOverride=function(){throw Error("Abstract function; should be overriding in subclass.")};FC.assert=function($,J){if(!$)throw Error("Assertion failed: "+(J||"")+`
29
+ `+Error().stack)};FC.expose=function($,J){for(var Z in $)Object.defineProperty(J.prototype,Z,{value:$[Z],writable:qC})};FC.merge=function($,J){for(var Z in J)$[Z]=J[Z]};FC.documentOrder=function($,J){return 3-($.compareDocumentPosition(J)&6)};FC.toASCIILowerCase=function($){return $.replace(/[A-Z]+/g,function(J){return J.toLowerCase()})};FC.toASCIIUpperCase=function($){return $.replace(/[a-z]+/g,function(J){return J.toUpperCase()})}});var ZY=p((Lb,HW)=>{var i2=TJ(),iC=JY(),sC=G0();HW.exports=UW;function UW(){}UW.prototype={addEventListener:function(J,Z,Y){if(!Z)return;if(Y===void 0)Y=!1;if(!this._listeners)this._listeners=Object.create(null);if(!this._listeners[J])this._listeners[J]=[];var K=this._listeners[J];for(var V=0,Q=K.length;V<Q;V++){var G=K[V];if(G.listener===Z&&G.capture===Y)return}var W={listener:Z,capture:Y};if(typeof Z==="function")W.f=Z;K.push(W)},removeEventListener:function(J,Z,Y){if(Y===void 0)Y=!1;if(this._listeners){var K=this._listeners[J];if(K)for(var V=0,Q=K.length;V<Q;V++){var G=K[V];if(G.listener===Z&&G.capture===Y){if(K.length===1)this._listeners[J]=void 0;else K.splice(V,1);return}}}},dispatchEvent:function(J){return this._dispatchEvent(J,!1)},_dispatchEvent:function(J,Z){if(typeof Z!=="boolean")Z=!1;function Y(_,j){var{type:B,eventPhase:q}=j;if(j.currentTarget=_,q!==i2.CAPTURING_PHASE&&_._handlers&&_._handlers[B]){var U=_._handlers[B],z;if(typeof U==="function")z=U.call(j.currentTarget,j);else{var C=U.handleEvent;if(typeof C!=="function")throw TypeError("handleEvent property of event handler object isnot a function.");z=C.call(U,j)}switch(j.type){case"mouseover":if(z===!0)j.preventDefault();break;case"beforeunload":default:if(z===!1)j.preventDefault();break}}var D=_._listeners&&_._listeners[B];if(!D)return;D=D.slice();for(var M=0,I=D.length;M<I;M++){if(j._immediatePropagationStopped)return;var P=D[M];if(q===i2.CAPTURING_PHASE&&!P.capture||q===i2.BUBBLING_PHASE&&P.capture)continue;if(P.f)P.f.call(j.currentTarget,j);else{var L=P.listener.handleEvent;if(typeof L!=="function")throw TypeError("handleEvent property of event listener object is not a function.");L.call(P.listener,j)}}}if(!J._initialized||J._dispatching)sC.InvalidStateError();J.isTrusted=Z,J._dispatching=!0,J.target=this;var K=[];for(var V=this.parentNode;V;V=V.parentNode)K.push(V);J.eventPhase=i2.CAPTURING_PHASE;for(var Q=K.length-1;Q>=0;Q--)if(Y(K[Q],J),J._propagationStopped)break;if(!J._propagationStopped)J.eventPhase=i2.AT_TARGET,Y(this,J);if(J.bubbles&&!J._propagationStopped){J.eventPhase=i2.BUBBLING_PHASE;for(var G=0,W=K.length;G<W;G++)if(Y(K[G],J),J._propagationStopped)break}if(J._dispatching=!1,J.eventPhase=i2.AT_TARGET,J.currentTarget=null,Z&&!J.defaultPrevented&&J instanceof iC)switch(J.type){case"mousedown":this._armed={x:J.clientX,y:J.clientY,t:J.timeStamp};break;case"mouseout":case"mouseover":this._armed=null;break;case"mouseup":if(this._isClick(J))this._doClick(J);this._armed=null;break}return!J.defaultPrevented},_isClick:function($){return this._armed!==null&&$.type==="mouseup"&&$.isTrusted&&$.button===0&&$.timeStamp-this._armed.t<1000&&Math.abs($.clientX-this._armed.x)<10&&Math.abs($.clientY-this._armed.Y)<10},_doClick:function($){if(this._click_in_progress)return;this._click_in_progress=!0;var J=this;while(J&&!J._post_click_activation_steps)J=J.parentNode;if(J&&J._pre_click_activation_steps)J._pre_click_activation_steps();var Z=this.ownerDocument.createEvent("MouseEvent");Z.initMouseEvent("click",!0,!0,this.ownerDocument.defaultView,1,$.screenX,$.screenY,$.clientX,$.clientY,$.ctrlKey,$.altKey,$.shiftKey,$.metaKey,$.button,null);var Y=this._dispatchEvent(Z,!0);if(J){if(Y){if(J._post_click_activation_steps)J._post_click_activation_steps(Z)}else if(J._cancelled_activation_steps)J._cancelled_activation_steps()}},_setEventHandler:function(J,Z){if(!this._handlers)this._handlers=Object.create(null);this._handlers[J]=Z},_getEventHandler:function(J){return this._handlers&&this._handlers[J]||null}}});var YY=p((Nb,BW)=>{var r1=G0(),Q1=BW.exports={valid:function($){return r1.assert($,"list falsy"),r1.assert($._previousSibling,"previous falsy"),r1.assert($._nextSibling,"next falsy"),!0},insertBefore:function($,J){r1.assert(Q1.valid($)&&Q1.valid(J));var Z=$,Y=$._previousSibling,K=J,V=J._previousSibling;Z._previousSibling=V,Y._nextSibling=K,V._nextSibling=Z,K._previousSibling=Y,r1.assert(Q1.valid($)&&Q1.valid(J))},replace:function($,J){if(r1.assert(Q1.valid($)&&(J===null||Q1.valid(J))),J!==null)Q1.insertBefore(J,$);Q1.remove($),r1.assert(Q1.valid($)&&(J===null||Q1.valid(J)))},remove:function($){r1.assert(Q1.valid($));var J=$._previousSibling;if(J===$)return;var Z=$._nextSibling;J._nextSibling=Z,Z._previousSibling=J,$._previousSibling=$._nextSibling=$,r1.assert(Q1.valid($))}}});var KY=p((yb,DW)=>{DW.exports={serializeOne:ZD,\u{275}escapeMatchingClosingTag:zW,\u{275}escapeClosingCommentTag:MW,\u{275}escapeProcessingInstructionContent:CW};var FW=G0(),s2=FW.NAMESPACE,_W={STYLE:!0,SCRIPT:!0,XMP:!0,IFRAME:!0,NOEMBED:!0,NOFRAMES:!0,PLAINTEXT:!0},nC={area:!0,base:!0,basefont:!0,bgsound:!0,br:!0,col:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},aC={},OW=/[&<>\u00A0]/g,qW=/[&"<>\u00A0]/g;function tC($){if(!OW.test($))return $;return $.replace(OW,(J)=>{switch(J){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case"\xA0":return"&nbsp;"}})}function eC($){if(!qW.test($))return $;return $.replace(qW,(J)=>{switch(J){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case'"':return"&quot;";case"\xA0":return"&nbsp;"}})}function $D($){var J=$.namespaceURI;if(!J)return $.localName;if(J===s2.XML)return"xml:"+$.localName;if(J===s2.XLINK)return"xlink:"+$.localName;if(J===s2.XMLNS)if($.localName==="xmlns")return"xmlns";else return"xmlns:"+$.localName;return $.name}function zW($,J){let Z="</"+J;if(!$.toLowerCase().includes(Z))return $;let Y=[...$],K=$.matchAll(new RegExp(Z,"ig"));for(let V of K)Y[V.index]="&lt;";return Y.join("")}var JD=/--!?>/;function MW($){if(!JD.test($))return $;return $.replace(/(--\!?)>/g,"$1&gt;")}function CW($){return $.includes(">")?$.replaceAll(">","&gt;"):$}function ZD($,J){var Z="";switch($.nodeType){case 1:var Y=$.namespaceURI,K=Y===s2.HTML,V=K||Y===s2.SVG||Y===s2.MATHML?$.localName:$.tagName;Z+="<"+V;for(var Q=0,G=$._numattrs;Q<G;Q++){var W=$._attr(Q);if(Z+=" "+$D(W),W.value!==void 0)Z+='="'+eC(W.value)+'"'}if(Z+=">",!(K&&nC[V])){var _=$.serialize();if(_W[V.toUpperCase()])_=zW(_,V);if(K&&aC[V]&&_.charAt(0)===`
30
30
  `)Z+=`
31
- `;Z+=_,Z+="</"+Q+">"}break;case 3:case 4:var j;if(J.nodeType===1&&J.namespaceURI===s2.HTML)j=J.tagName;else j="";if(WW[j]||j==="NOSCRIPT"&&J.ownerDocument._scripting_enabled)Z+=$.data;else Z+=cM($.data);break;case 8:Z+="<!--"+_W($.data)+"-->";break;case 7:let H=OW($.data);Z+="<?"+$.target+" "+H+"?>";break;case 10:Z+="<!DOCTYPE "+$.name,Z+=">";break;default:BW.InvalidStateError()}return Z}});var P0=p((Pb,PW)=>{PW.exports=$0;var DW=$Y(),gZ=JY(),FW=ZY(),m$=X0();function $0(){DW.call(this),this.parentNode=null,this._nextSibling=this._previousSibling=this,this._index=void 0}var f0=$0.ELEMENT_NODE=1,YY=$0.ATTRIBUTE_NODE=2,fZ=$0.TEXT_NODE=3,sM=$0.CDATA_SECTION_NODE=4,nM=$0.ENTITY_REFERENCE_NODE=5,KY=$0.ENTITY_NODE=6,zW=$0.PROCESSING_INSTRUCTION_NODE=7,CW=$0.COMMENT_NODE=8,A8=$0.DOCUMENT_NODE=9,G1=$0.DOCUMENT_TYPE_NODE=10,H2=$0.DOCUMENT_FRAGMENT_NODE=11,QY=$0.NOTATION_NODE=12,VY=$0.DOCUMENT_POSITION_DISCONNECTED=1,GY=$0.DOCUMENT_POSITION_PRECEDING=2,XY=$0.DOCUMENT_POSITION_FOLLOWING=4,MW=$0.DOCUMENT_POSITION_CONTAINS=8,WY=$0.DOCUMENT_POSITION_CONTAINED_BY=16,jY=$0.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;$0.prototype=Object.create(DW.prototype,{baseURI:{get:m$.nyi},parentElement:{get:function(){return this.parentNode&&this.parentNode.nodeType===f0?this.parentNode:null}},hasChildNodes:{value:m$.shouldOverride},firstChild:{get:m$.shouldOverride},lastChild:{get:m$.shouldOverride},isConnected:{get:function(){let $=this;while($!=null){if($.nodeType===$0.DOCUMENT_NODE)return!0;if($=$.parentNode,$!=null&&$.nodeType===$0.DOCUMENT_FRAGMENT_NODE)$=$.host}return!1}},previousSibling:{get:function(){var $=this.parentNode;if(!$)return null;if(this===$.firstChild)return null;return this._previousSibling}},nextSibling:{get:function(){var $=this.parentNode,J=this._nextSibling;if(!$)return null;if(J===$.firstChild)return null;return J}},textContent:{get:function(){return null},set:function($){}},innerText:{get:function(){return null},set:function($){}},_countChildrenOfType:{value:function($){var J=0;for(var Z=this.firstChild;Z!==null;Z=Z.nextSibling)if(Z.nodeType===$)J++;return J}},_ensureInsertValid:{value:function(J,Z,Y){var K=this,Q,V;if(!J.nodeType)throw TypeError("not a node");switch(K.nodeType){case A8:case H2:case f0:break;default:m$.HierarchyRequestError()}if(J.isAncestor(K))m$.HierarchyRequestError();if(Z!==null||!Y){if(Z.parentNode!==K)m$.NotFoundError()}switch(J.nodeType){case H2:case G1:case f0:case fZ:case zW:case CW:break;default:m$.HierarchyRequestError()}if(K.nodeType===A8)switch(J.nodeType){case fZ:m$.HierarchyRequestError();break;case H2:if(J._countChildrenOfType(fZ)>0)m$.HierarchyRequestError();switch(J._countChildrenOfType(f0)){case 0:break;case 1:if(Z!==null){if(Y&&Z.nodeType===G1)m$.HierarchyRequestError();for(V=Z.nextSibling;V!==null;V=V.nextSibling)if(V.nodeType===G1)m$.HierarchyRequestError()}if(Q=K._countChildrenOfType(f0),Y){if(Q>0)m$.HierarchyRequestError()}else if(Q>1||Q===1&&Z.nodeType!==f0)m$.HierarchyRequestError();break;default:m$.HierarchyRequestError()}break;case f0:if(Z!==null){if(Y&&Z.nodeType===G1)m$.HierarchyRequestError();for(V=Z.nextSibling;V!==null;V=V.nextSibling)if(V.nodeType===G1)m$.HierarchyRequestError()}if(Q=K._countChildrenOfType(f0),Y){if(Q>0)m$.HierarchyRequestError()}else if(Q>1||Q===1&&Z.nodeType!==f0)m$.HierarchyRequestError();break;case G1:if(Z===null){if(K._countChildrenOfType(f0))m$.HierarchyRequestError()}else for(V=K.firstChild;V!==null;V=V.nextSibling){if(V===Z)break;if(V.nodeType===f0)m$.HierarchyRequestError()}if(Q=K._countChildrenOfType(G1),Y){if(Q>0)m$.HierarchyRequestError()}else if(Q>1||Q===1&&Z.nodeType!==G1)m$.HierarchyRequestError();break}else if(J.nodeType===G1)m$.HierarchyRequestError()}},insertBefore:{value:function(J,Z){var Y=this;Y._ensureInsertValid(J,Z,!0);var K=Z;if(K===J)K=J.nextSibling;return Y.doc.adoptNode(J),J._insertOrReplace(Y,K,!1),J}},appendChild:{value:function($){return this.insertBefore($,null)}},_appendChild:{value:function($){$._insertOrReplace(this,null,!1)}},removeChild:{value:function(J){var Z=this;if(!J.nodeType)throw TypeError("not a node");if(J.parentNode!==Z)m$.NotFoundError();return J.remove(),J}},replaceChild:{value:function(J,Z){var Y=this;if(Y._ensureInsertValid(J,Z,!1),J.doc!==Y.doc)Y.doc.adoptNode(J);return J._insertOrReplace(Y,Z,!0),Z}},contains:{value:function(J){if(J===null)return!1;if(this===J)return!0;return(this.compareDocumentPosition(J)&WY)!==0}},compareDocumentPosition:{value:function(J){if(this===J)return 0;if(this.doc!==J.doc||this.rooted!==J.rooted)return VY+jY;var Z=[],Y=[];for(var K=this;K!==null;K=K.parentNode)Z.push(K);for(K=J;K!==null;K=K.parentNode)Y.push(K);if(Z.reverse(),Y.reverse(),Z[0]!==Y[0])return VY+jY;K=Math.min(Z.length,Y.length);for(var Q=1;Q<K;Q++)if(Z[Q]!==Y[Q])if(Z[Q].index<Y[Q].index)return XY;else return GY;if(Z.length<Y.length)return XY+WY;else return GY+MW}},isSameNode:{value:function(J){return this===J}},isEqualNode:{value:function(J){if(!J)return!1;if(J.nodeType!==this.nodeType)return!1;if(!this.isEqual(J))return!1;for(var Z=this.firstChild,Y=J.firstChild;Z&&Y;Z=Z.nextSibling,Y=Y.nextSibling)if(!Z.isEqualNode(Y))return!1;return Z===null&&Y===null}},cloneNode:{value:function($){var J=this.clone();if($)for(var Z=this.firstChild;Z!==null;Z=Z.nextSibling)J._appendChild(Z.cloneNode(!0));return J}},lookupPrefix:{value:function(J){var Z;if(J===""||J===null||J===void 0)return null;switch(this.nodeType){case f0:return this._lookupNamespacePrefix(J,this);case A8:return Z=this.documentElement,Z?Z.lookupPrefix(J):null;case KY:case QY:case H2:case G1:return null;case YY:return Z=this.ownerElement,Z?Z.lookupPrefix(J):null;default:return Z=this.parentElement,Z?Z.lookupPrefix(J):null}}},lookupNamespaceURI:{value:function(J){if(J===""||J===void 0)J=null;var Z;switch(this.nodeType){case f0:return m$.shouldOverride();case A8:return Z=this.documentElement,Z?Z.lookupNamespaceURI(J):null;case KY:case QY:case G1:case H2:return null;case YY:return Z=this.ownerElement,Z?Z.lookupNamespaceURI(J):null;default:return Z=this.parentElement,Z?Z.lookupNamespaceURI(J):null}}},isDefaultNamespace:{value:function(J){if(J===""||J===void 0)J=null;var Z=this.lookupNamespaceURI(null);return Z===J}},index:{get:function(){var $=this.parentNode;if(this===$.firstChild)return 0;var J=$.childNodes;if(this._index===void 0||J[this._index]!==this){for(var Z=0;Z<J.length;Z++)J[Z]._index=Z;m$.assert(J[this._index]===this)}return this._index}},isAncestor:{value:function($){if(this.doc!==$.doc)return!1;if(this.rooted!==$.rooted)return!1;for(var J=$;J;J=J.parentNode)if(J===this)return!0;return!1}},ensureSameDoc:{value:function($){if($.ownerDocument===null)$.ownerDocument=this.doc;else if($.ownerDocument!==this.doc)m$.WrongDocumentError()}},removeChildren:{value:m$.shouldOverride},_insertOrReplace:{value:function(J,Z,Y){var K=this,Q,V;if(K.nodeType===H2&&K.rooted)m$.HierarchyRequestError();if(J._childNodes){if(Q=Z===null?J._childNodes.length:Z.index,K.parentNode===J){var X=K.index;if(X<Q)Q--}}if(Y){if(Z.rooted)Z.doc.mutateRemove(Z);Z.parentNode=null}var W=Z;if(W===null)W=J.firstChild;var _=K.rooted&&J.rooted;if(K.nodeType===H2){var j=[0,Y?1:0],H;for(var q=K.firstChild;q!==null;q=H)H=q.nextSibling,j.push(q),q.parentNode=J;var U=j.length;if(Y)gZ.replace(W,U>2?j[2]:null);else if(U>2&&W!==null)gZ.insertBefore(j[2],W);if(J._childNodes){j[0]=Z===null?J._childNodes.length:Z._index,J._childNodes.splice.apply(J._childNodes,j);for(V=2;V<U;V++)j[V]._index=j[0]+(V-2)}else if(J._firstChild===Z){if(U>2)J._firstChild=j[2];else if(Y)J._firstChild=null}if(K._childNodes)K._childNodes.length=0;else K._firstChild=null;if(J.rooted){J.modify();for(V=2;V<U;V++)J.doc.mutateInsert(j[V])}}else{if(Z===K)return;if(_)K._remove();else if(K.parentNode)K.remove();if(K.parentNode=J,Y){if(gZ.replace(W,K),J._childNodes)K._index=Q,J._childNodes[Q]=K;else if(J._firstChild===Z)J._firstChild=K}else{if(W!==null)gZ.insertBefore(K,W);if(J._childNodes)K._index=Q,J._childNodes.splice(Q,0,K);else if(J._firstChild===Z)J._firstChild=K}if(_)J.modify(),J.doc.mutateMove(K);else if(J.rooted)J.modify(),J.doc.mutateInsert(K)}}},lastModTime:{get:function(){if(!this._lastModTime)this._lastModTime=this.doc.modclock;return this._lastModTime}},modify:{value:function(){if(this.doc.modclock){var $=++this.doc.modclock;for(var J=this;J;J=J.parentElement)if(J._lastModTime)J._lastModTime=$}}},doc:{get:function(){return this.ownerDocument||this}},rooted:{get:function(){return!!this._nid}},normalize:{value:function(){var $;for(var J=this.firstChild;J!==null;J=$){if($=J.nextSibling,J.normalize)J.normalize();if(J.nodeType!==$0.TEXT_NODE)continue;if(J.nodeValue===""){this.removeChild(J);continue}var Z=J.previousSibling;if(Z===null)continue;else if(Z.nodeType===$0.TEXT_NODE)Z.appendData(J.nodeValue),this.removeChild(J)}}},serialize:{value:function(){if(this._innerHTML)return this._innerHTML;var $="";for(var J=this.firstChild;J!==null;J=J.nextSibling)$+=FW.serializeOne(J,this);return $}},outerHTML:{get:function(){return FW.serializeOne(this,{nodeType:0})},set:m$.nyi},ELEMENT_NODE:{value:f0},ATTRIBUTE_NODE:{value:YY},TEXT_NODE:{value:fZ},CDATA_SECTION_NODE:{value:sM},ENTITY_REFERENCE_NODE:{value:nM},ENTITY_NODE:{value:KY},PROCESSING_INSTRUCTION_NODE:{value:zW},COMMENT_NODE:{value:CW},DOCUMENT_NODE:{value:A8},DOCUMENT_TYPE_NODE:{value:G1},DOCUMENT_FRAGMENT_NODE:{value:H2},NOTATION_NODE:{value:QY},DOCUMENT_POSITION_DISCONNECTED:{value:VY},DOCUMENT_POSITION_PRECEDING:{value:GY},DOCUMENT_POSITION_FOLLOWING:{value:XY},DOCUMENT_POSITION_CONTAINS:{value:MW},DOCUMENT_POSITION_CONTAINED_BY:{value:WY},DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:{value:jY}})});var AW=p((Ib,IW)=>{IW.exports=class extends Array{constructor(J){super(J&&J.length||0);if(J)for(var Z in J)this[Z]=J[Z]}item(J){return this[J]||null}}});var wW=p((Ab,SW)=>{function aM($){return this[$]||null}function tM($){if(!$)$=[];return $.item=aM,$}SW.exports=tM});var n2=p((Sb,RW)=>{var UY;try{UY=AW()}catch($){UY=wW()}RW.exports=UY});var mZ=p((wb,yW)=>{yW.exports=NW;var LW=P0(),eM=n2();function NW(){LW.call(this),this._firstChild=this._childNodes=null}NW.prototype=Object.create(LW.prototype,{hasChildNodes:{value:function(){if(this._childNodes)return this._childNodes.length>0;return this._firstChild!==null}},childNodes:{get:function(){return this._ensureChildNodes(),this._childNodes}},firstChild:{get:function(){if(this._childNodes)return this._childNodes.length===0?null:this._childNodes[0];return this._firstChild}},lastChild:{get:function(){var $=this._childNodes,J;if($)return $.length===0?null:$[$.length-1];if(J=this._firstChild,J===null)return null;return J._previousSibling}},_ensureChildNodes:{value:function(){if(this._childNodes)return;var $=this._firstChild,J=$,Z=this._childNodes=new eM;if($)do Z.push(J),J=J._nextSibling;while(J!==$);this._firstChild=null}},removeChildren:{value:function(){var J=this.rooted?this.ownerDocument:null,Z=this.firstChild,Y;while(Z!==null){if(Y=Z,Z=Y.nextSibling,J)J.mutateRemove(Y);Y.parentNode=null}if(this._childNodes)this._childNodes.length=0;else this._firstChild=null;this.modify()}}})});var uZ=p((XD)=>{XD.isValidName=VD;XD.isValidQName=GD;var $D=/^[_:A-Za-z][-.:\w]+$/,JD=/^([_A-Za-z][-.\w]+|[_A-Za-z][-.\w]+:[_A-Za-z][-.\w]+)$/,S8="_A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",w8="-._A-Za-z0-9\xB7\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0300-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",a2="["+S8+"]["+w8+"]*",BY=S8+":",HY=w8+":",ZD=new RegExp("^["+BY+"]["+HY+"]*$"),YD=new RegExp("^("+a2+"|"+a2+":"+a2+")$"),TW=/[\uD800-\uDB7F\uDC00-\uDFFF]/,kW=/[\uD800-\uDB7F\uDC00-\uDFFF]/g,EW=/[\uD800-\uDB7F][\uDC00-\uDFFF]/g;S8+="\uD800-\uDB7F\uDC00-\uDFFF";w8+="\uD800-\uDB7F\uDC00-\uDFFF";a2="["+S8+"]["+w8+"]*";BY=S8+":";HY=w8+":";var KD=new RegExp("^["+BY+"]["+HY+"]*$"),QD=new RegExp("^("+a2+"|"+a2+":"+a2+")$");function VD($){if($D.test($))return!0;if(ZD.test($))return!0;if(!TW.test($))return!1;if(!KD.test($))return!1;var J=$.match(kW),Z=$.match(EW);return Z!==null&&2*Z.length===J.length}function GD($){if(JD.test($))return!0;if(YD.test($))return!0;if(!TW.test($))return!1;if(!QD.test($))return!1;var J=$.match(kW),Z=$.match(EW);return Z!==null&&2*Z.length===J.length}});var _Y=p((BD)=>{var xW=X0();BD.property=function($){if(Array.isArray($.type)){var J=Object.create(null);$.type.forEach(function(K){J[K.value||K]=K.alias||K});var Z=$.missing;if(Z===void 0)Z=null;var Y=$.invalid;if(Y===void 0)Y=Z;return{get:function(){var K=this._getattr($.name);if(K===null)return Z;if(K=J[K.toLowerCase()],K!==void 0)return K;if(Y!==null)return Y;return K},set:function(K){this._setattr($.name,K)}}}else if($.type===Boolean)return{get:function(){return this.hasAttribute($.name)},set:function(K){if(K)this._setattr($.name,"");else this.removeAttribute($.name)}};else if($.type===Number||$.type==="long"||$.type==="unsigned long"||$.type==="limited unsigned long with fallback")return UD($);else if(!$.type||$.type===String)return{get:function(){return this._getattr($.name)||""},set:function(K){if($.treatNullAsEmptyString&&K===null)K="";this._setattr($.name,K)}};else if(typeof $.type==="function")return $.type($.name,$);throw Error("Invalid attribute definition")};function UD($){var J;if(typeof $.default==="function")J=$.default;else if(typeof $.default==="number")J=function(){return $.default};else J=function(){xW.assert(!1,typeof $.default)};var Z=$.type==="unsigned long",Y=$.type==="long",K=$.type==="limited unsigned long with fallback",Q=$.min,V=$.max,X=$.setmin;if(Q===void 0){if(Z)Q=0;if(Y)Q=-2147483648;if(K)Q=1}if(V===void 0){if(Z||Y||K)V=2147483647}return{get:function(){var W=this._getattr($.name),_=$.float?parseFloat(W):parseInt(W,10);if(W===null||!isFinite(_)||Q!==void 0&&_<Q||V!==void 0&&_>V)return J.call(this);if(Z||Y||K){if(!/^[ \t\n\f\r]*[-+]?[0-9]/.test(W))return J.call(this);_=_|0}return _},set:function(W){if(!$.float)W=Math.floor(W);if(X!==void 0&&W<X)xW.IndexSizeError($.name+" set to "+W);if(Z)W=W<0||W>2147483647?J.call(this):W|0;else if(K)W=W<1||W>2147483647?J.call(this):W|0;else if(Y)W=W<-2147483648||W>2147483647?J.call(this):W|0;this._setattr($.name,String(W))}}}BD.registerChangeHandler=function($,J,Z){var Y=$.prototype;if(!Object.prototype.hasOwnProperty.call(Y,"_attributeChangeHandlers"))Y._attributeChangeHandlers=Object.create(Y._attributeChangeHandlers||null);Y._attributeChangeHandlers[J]=Z}});var hW=p((Nb,vW)=>{vW.exports=bW;var OD=P0();function bW($,J){this.root=$,this.filter=J,this.lastModTime=$.lastModTime,this.done=!1,this.cache=[],this.traverse()}bW.prototype=Object.create(Object.prototype,{length:{get:function(){if(this.checkcache(),!this.done)this.traverse();return this.cache.length}},item:{value:function($){if(this.checkcache(),!this.done&&$>=this.cache.length)this.traverse();return this.cache[$]}},checkcache:{value:function(){if(this.lastModTime!==this.root.lastModTime){for(var $=this.cache.length-1;$>=0;$--)this[$]=void 0;this.cache.length=0,this.done=!1,this.lastModTime=this.root.lastModTime}}},traverse:{value:function($){if($!==void 0)$++;var J;while((J=this.next())!==null)if(this[this.cache.length]=J,this.cache.push(J),$&&this.cache.length===$)return;this.done=!0}},next:{value:function(){var $=this.cache.length===0?this.root:this.cache[this.cache.length-1],J;if($.nodeType===OD.DOCUMENT_NODE)J=$.documentElement;else J=$.nextElement(this.root);while(J){if(this.filter(J))return J;J=J.nextElement(this.root)}return null}}})});var qY=p((yb,mW)=>{var OY=X0();mW.exports=fW;function fW($,J){this._getString=$,this._setString=J,this._length=0,this._lastStringValue="",this._update()}Object.defineProperties(fW.prototype,{length:{get:function(){return this._length}},item:{value:function($){var J=kJ(this);if($<0||$>=J.length)return null;return J[$]}},contains:{value:function($){$=String($);var J=kJ(this);return J.indexOf($)>-1}},add:{value:function(){var $=kJ(this);for(var J=0,Z=arguments.length;J<Z;J++){var Y=R8(arguments[J]);if($.indexOf(Y)<0)$.push(Y)}this._update($)}},remove:{value:function(){var $=kJ(this);for(var J=0,Z=arguments.length;J<Z;J++){var Y=R8(arguments[J]),K=$.indexOf(Y);if(K>-1)$.splice(K,1)}this._update($)}},toggle:{value:function(J,Z){if(J=R8(J),this.contains(J)){if(Z===void 0||Z===!1)return this.remove(J),!1;return!0}else{if(Z===void 0||Z===!0)return this.add(J),!0;return!1}}},replace:{value:function(J,Z){if(String(Z)==="")OY.SyntaxError();J=R8(J),Z=R8(Z);var Y=kJ(this),K=Y.indexOf(J);if(K<0)return!1;var Q=Y.indexOf(Z);if(Q<0)Y[K]=Z;else if(K<Q)Y[K]=Z,Y.splice(Q,1);else Y.splice(K,1);return this._update(Y),!0}},toString:{value:function(){return this._getString()}},value:{get:function(){return this._getString()},set:function($){this._setString($),this._update()}},_update:{value:function($){if($)gW(this,$),this._setString($.join(" ").trim());else gW(this,kJ(this));this._lastStringValue=this._getString()}}});function gW($,J){var Z=$._length,Y;$._length=J.length;for(Y=0;Y<J.length;Y++)$[Y]=J[Y];for(;Y<Z;Y++)$[Y]=void 0}function R8($){if($=String($),$==="")OY.SyntaxError();if(/[ \t\r\n\f]/.test($))OY.InvalidCharacterError();return $}function qD($){var J=$._length,Z=Array(J);for(var Y=0;Y<J;Y++)Z[Y]=$[Y];return Z}function kJ($){var J=$._getString();if(J===$._lastStringValue)return qD($);var Z=J.replace(/(^[ \t\r\n\f]+)|([ \t\r\n\f]+$)/g,"");if(Z==="")return[];else{var Y=Object.create(null);return Z.split(/[ \t\r\n\f]+/g).filter(function(K){var Q="$"+K;if(Y[Q])return!1;return Y[Q]=!0,!0})}}});var lZ=p((bJ,oW)=>{var dZ=Object.create(null,{location:{get:function(){throw Error("window.location is not supported.")}}}),FD=function($,J){return $.compareDocumentPosition(J)},zD=function($,J){return FD($,J)&2?1:-1},cZ=function($){while(($=$.nextSibling)&&$.nodeType!==1);return $},xJ=function($){while(($=$.previousSibling)&&$.nodeType!==1);return $},CD=function($){if($=$.firstChild)while($.nodeType!==1&&($=$.nextSibling));return $},MD=function($){if($=$.lastChild)while($.nodeType!==1&&($=$.previousSibling));return $},EJ=function($){if(!$.parentNode)return!1;var J=$.parentNode.nodeType;return J===1||J===9},uW=function($){if(!$)return $;var J=$[0];if(J==='"'||J==="'"){if($[$.length-1]===J)$=$.slice(1,-1);else $=$.slice(1);return $.replace(_$.str_escape,function(Z){var Y=/^\\(?:([0-9A-Fa-f]+)|([\r\n\f]+))/.exec(Z);if(!Y)return Z.slice(1);if(Y[2])return"";var K=parseInt(Y[1],16);return String.fromCodePoint?String.fromCodePoint(K):String.fromCharCode(K)})}else if(_$.ident.test($))return _2($);else return $},_2=function($){return $.replace(_$.escape,function(J){var Z=/^\\([0-9A-Fa-f]+)/.exec(J);if(!Z)return J[1];var Y=parseInt(Z[1],16);return String.fromCodePoint?String.fromCodePoint(Y):String.fromCharCode(Y)})},DD=function(){if(Array.prototype.indexOf)return Array.prototype.indexOf;return function($,J){var Z=this.length;while(Z--)if(this[Z]===J)return Z;return-1}}(),pW=function($,J){var Z=_$.inside.source.replace(/</g,$).replace(/>/g,J);return new RegExp(Z)},m0=function($,J,Z){return $=$.source,$=$.replace(J,Z.source||Z),new RegExp($)},dW=function($,J){return $.replace(/^(?:\w+:\/\/|\/+)/,"").replace(/(?:\/+|\/*#.*?)$/,"").split("/",J).join("/")},PD=function($,J){var Z=$.replace(/\s+/g,""),Y;if(Z==="even")Z="2n+0";else if(Z==="odd")Z="2n+1";else if(Z.indexOf("n")===-1)Z="0n"+Z;return Y=/^([+-])?(\d+)?n([+-])?(\d+)?$/.exec(Z),{group:Y[1]==="-"?-(Y[2]||1):+(Y[2]||1),offset:Y[4]?Y[3]==="-"?-Y[4]:+Y[4]:0}},FY=function($,J,Z){var Y=PD($),K=Y.group,Q=Y.offset,V=!Z?CD:MD,X=!Z?cZ:xJ;return function(W){if(!EJ(W))return;var _=V(W.parentNode),j=0;while(_){if(J(_,W))j++;if(_===W)return j-=Q,K&&j?j%K===0&&j<0===K<0:!j;_=X(_)}}},z0={"*":function(){return function(){return!0}}(),type:function($){return $=$.toLowerCase(),function(J){return J.nodeName.toLowerCase()===$}},attr:function($,J,Z,Y){return J=cW[J],function(K){var Q;switch($){case"for":Q=K.htmlFor;break;case"class":if(Q=K.className,Q===""&&K.getAttribute("class")==null)Q=null;break;case"href":case"src":Q=K.getAttribute($,2);break;case"title":Q=K.getAttribute("title")||null;break;case"id":case"lang":case"dir":case"accessKey":case"hidden":case"tabIndex":case"style":if(K.getAttribute){Q=K.getAttribute($);break}default:if(K.hasAttribute&&!K.hasAttribute($))break;Q=K[$]!=null?K[$]:K.getAttribute&&K.getAttribute($);break}if(Q==null)return;if(Q=Q+"",Y)Q=Q.toLowerCase(),Z=Z.toLowerCase();return J(Q,Z)}},":first-child":function($){return!xJ($)&&EJ($)},":last-child":function($){return!cZ($)&&EJ($)},":only-child":function($){return!xJ($)&&!cZ($)&&EJ($)},":nth-child":function($,J){return FY($,function(){return!0},J)},":nth-last-child":function($){return z0[":nth-child"]($,!0)},":root":function($){return $.ownerDocument.documentElement===$},":empty":function($){return!$.firstChild},":not":function($){var J=CY($);return function(Z){return!J(Z)}},":first-of-type":function($){if(!EJ($))return;var J=$.nodeName;while($=xJ($))if($.nodeName===J)return;return!0},":last-of-type":function($){if(!EJ($))return;var J=$.nodeName;while($=cZ($))if($.nodeName===J)return;return!0},":only-of-type":function($){return z0[":first-of-type"]($)&&z0[":last-of-type"]($)},":nth-of-type":function($,J){return FY($,function(Z,Y){return Z.nodeName===Y.nodeName},J)},":nth-last-of-type":function($){return z0[":nth-of-type"]($,!0)},":checked":function($){return!!($.checked||$.selected)},":indeterminate":function($){return!z0[":checked"]($)},":enabled":function($){return!$.disabled&&$.type!=="hidden"},":disabled":function($){return!!$.disabled},":target":function($){return $.id===dZ.location.hash.substring(1)},":focus":function($){return $===$.ownerDocument.activeElement},":is":function($){return CY($)},":matches":function($){return z0[":is"]($)},":nth-match":function($,J){var Z=$.split(/\s*,\s*/),Y=Z.shift(),K=CY(Z.join(","));return FY(Y,K,J)},":nth-last-match":function($){return z0[":nth-match"]($,!0)},":links-here":function($){return $+""===dZ.location+""},":lang":function($){return function(J){while(J){if(J.lang)return J.lang.indexOf($)===0;J=J.parentNode}}},":dir":function($){return function(J){while(J){if(J.dir)return J.dir===$;J=J.parentNode}}},":scope":function($,J){var Z=J||$.ownerDocument;if(Z.nodeType===9)return $===Z.documentElement;return $===Z},":any-link":function($){return typeof $.href==="string"},":local-link":function($){if($.nodeName)return $.href&&$.host===dZ.location.host;var J=+$+1;return function(Z){if(!Z.href)return;var Y=dZ.location+"",K=Z+"";return dW(Y,J)===dW(K,J)}},":default":function($){return!!$.defaultSelected},":valid":function($){return $.willValidate||$.validity&&$.validity.valid},":invalid":function($){return!z0[":valid"]($)},":in-range":function($){return $.value>$.min&&$.value<=$.max},":out-of-range":function($){return!z0[":in-range"]($)},":required":function($){return!!$.required},":optional":function($){return!$.required},":read-only":function($){if($.readOnly)return!0;var J=$.getAttribute("contenteditable"),Z=$.contentEditable,Y=$.nodeName.toLowerCase();return Y=Y!=="input"&&Y!=="textarea",(Y||$.disabled)&&J==null&&Z!=="true"},":read-write":function($){return!z0[":read-only"]($)},":hover":function(){throw Error(":hover is not supported.")},":active":function(){throw Error(":active is not supported.")},":link":function(){throw Error(":link is not supported.")},":visited":function(){throw Error(":visited is not supported.")},":column":function(){throw Error(":column is not supported.")},":nth-column":function(){throw Error(":nth-column is not supported.")},":nth-last-column":function(){throw Error(":nth-last-column is not supported.")},":current":function(){throw Error(":current is not supported.")},":past":function(){throw Error(":past is not supported.")},":future":function(){throw Error(":future is not supported.")},":contains":function($){return function(J){var Z=J.innerText||J.textContent||J.value||"";return Z.indexOf($)!==-1}},":has":function($){return function(J){return lW($,J).length>0}}},cW={"-":function(){return!0},"=":function($,J){return $===J},"*=":function($,J){return $.indexOf(J)!==-1},"~=":function($,J){var Z,Y,K,Q;for(Y=0;;Y=Z+1){if(Z=$.indexOf(J,Y),Z===-1)return!1;if(K=$[Z-1],Q=$[Z+J.length],(!K||K===" ")&&(!Q||Q===" "))return!0}},"|=":function($,J){var Z=$.indexOf(J),Y;if(Z!==0)return;return Y=$[Z+J.length],Y==="-"||!Y},"^=":function($,J){return $.indexOf(J)===0},"$=":function($,J){var Z=$.lastIndexOf(J);return Z!==-1&&Z+J.length===$.length},"!=":function($,J){return $!==J}},L8={" ":function($){return function(J){while(J=J.parentNode)if($(J))return J}},">":function($){return function(J){if(J=J.parentNode)return $(J)&&J}},"+":function($){return function(J){if(J=xJ(J))return $(J)&&J}},"~":function($){return function(J){while(J=xJ(J))if($(J))return J}},noop:function($){return function(J){return $(J)&&J}},ref:function($,J){var Z;function Y(K){var Q=K.ownerDocument,V=Q.getElementsByTagName("*"),X=V.length;while(X--)if(Z=V[X],Y.test(K))return Z=null,!0;Z=null}return Y.combinator=function(K){if(!Z||!Z.getAttribute)return;var Q=Z.getAttribute(J)||"";if(Q[0]==="#")Q=Q.substring(1);if(Q===K.id&&$(Z))return Z},Y}},_$={escape:/\\(?:[^0-9A-Fa-f\r\n]|[0-9A-Fa-f]{1,6}[\r\n\t ]?)/g,str_escape:/(escape)|\\(\n|\r\n?|\f)/g,nonascii:/[\u00A0-\uFFFF]/,cssid:/(?:(?!-?[0-9])(?:escape|nonascii|[-_a-zA-Z0-9])+)/,qname:/^ *(cssid|\*)/,simple:/^(?:([.#]cssid)|pseudo|attr)/,ref:/^ *\/(cssid)\/ */,combinator:/^(?: +([^ \w*.#\\]) +|( )+|([^ \w*.#\\]))(?! *$)/,attr:/^\[(cssid)(?:([^\w]?=)(inside))?\]/,pseudo:/^(:cssid)(?:\((inside)\))?/,inside:/(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|<[^"'>]*>|\\["'>]|[^"'>])*/,ident:/^(cssid)$/};_$.cssid=m0(_$.cssid,"nonascii",_$.nonascii);_$.cssid=m0(_$.cssid,"escape",_$.escape);_$.qname=m0(_$.qname,"cssid",_$.cssid);_$.simple=m0(_$.simple,"cssid",_$.cssid);_$.ref=m0(_$.ref,"cssid",_$.cssid);_$.attr=m0(_$.attr,"cssid",_$.cssid);_$.pseudo=m0(_$.pseudo,"cssid",_$.cssid);_$.inside=m0(_$.inside,`[^"'>]*`,_$.inside);_$.attr=m0(_$.attr,"inside",pW("\\[","\\]"));_$.pseudo=m0(_$.pseudo,"inside",pW("\\(","\\)"));_$.simple=m0(_$.simple,"pseudo",_$.pseudo);_$.simple=m0(_$.simple,"attr",_$.attr);_$.ident=m0(_$.ident,"cssid",_$.cssid);_$.str_escape=m0(_$.str_escape,"escape",_$.escape);var N8=function($){var J=$.replace(/^\s+|\s+$/g,""),Z,Y=[],K=[],Q,V,X,W,_;while(J){if(X=_$.qname.exec(J))J=J.substring(X[0].length),V=_2(X[1]),K.push(pZ(V,!0));else if(X=_$.simple.exec(J))J=J.substring(X[0].length),V="*",K.push(pZ(V,!0)),K.push(pZ(X));else throw SyntaxError("Invalid selector.");while(X=_$.simple.exec(J))J=J.substring(X[0].length),K.push(pZ(X));if(J[0]==="!")J=J.substring(1),Q=AD(),Q.qname=V,K.push(Q.simple);if(X=_$.ref.exec(J)){J=J.substring(X[0].length),_=L8.ref(zY(K),_2(X[1])),Y.push(_.combinator),K=[];continue}if(X=_$.combinator.exec(J)){if(J=J.substring(X[0].length),W=X[1]||X[2]||X[3],W===","){Y.push(L8.noop(zY(K)));break}}else W="noop";if(!L8[W])throw SyntaxError("Bad combinator.");Y.push(L8[W](zY(K))),K=[]}if(Z=ID(Y),Z.qname=V,Z.sel=J,Q)Q.lname=Z.qname,Q.test=Z,Q.qname=Q.qname,Q.sel=Z.sel,Z=Q;if(_)_.test=Z,_.qname=Z.qname,_.sel=Z.sel,Z=_;return Z},pZ=function($,J){if(J)return $==="*"?z0["*"]:z0.type($);if($[1])return $[1][0]==="."?z0.attr("class","~=",_2($[1].substring(1)),!1):z0.attr("id","=",_2($[1].substring(1)),!1);if($[2])return $[3]?z0[_2($[2])](uW($[3])):z0[_2($[2])];if($[4]){var Z=$[6],Y=/["'\s]\s*I$/i.test(Z);if(Y)Z=Z.replace(/\s*I$/i,"");return z0.attr(_2($[4]),$[5]||"-",uW(Z),Y)}throw SyntaxError("Unknown Selector.")},zY=function($){var J=$.length,Z;if(J<2)return $[0];return function(Y){if(!Y)return;for(Z=0;Z<J;Z++)if(!$[Z](Y))return;return!0}},ID=function($){if($.length<2)return function(J){return!!$[0](J)};return function(J){var Z=$.length;while(Z--)if(!(J=$[Z](J)))return;return!0}},AD=function(){var $;function J(Z){var Y=Z.ownerDocument,K=Y.getElementsByTagName(J.lname),Q=K.length;while(Q--)if(J.test(K[Q])&&$===Z)return $=null,!0;$=null}return J.simple=function(Z){return $=Z,!0},J},CY=function($){var J=N8($),Z=[J];while(J.sel)J=N8(J.sel),Z.push(J);if(Z.length<2)return J;return function(Y){var K=Z.length,Q=0;for(;Q<K;Q++)if(Z[Q](Y))return!0}},lW=function($,J){var Z=[],Y=N8($),K=J.getElementsByTagName(Y.qname),Q=0,V;while(V=K[Q++])if(Y(V))Z.push(V);if(Y.sel){while(Y.sel){Y=N8(Y.sel),K=J.getElementsByTagName(Y.qname),Q=0;while(V=K[Q++])if(Y(V)&&DD.call(Z,V)===-1)Z.push(V)}Z.sort(zD)}return Z};oW.exports=bJ=function($,J){var Z,Y;if(J.nodeType!==11&&$.indexOf(" ")===-1){if($[0]==="#"&&J.rooted&&/^#[A-Z_][-A-Z0-9_]*$/i.test($)){if(J.doc._hasMultipleElementsWithId){if(Z=$.substring(1),!J.doc._hasMultipleElementsWithId(Z))return Y=J.doc.getElementById(Z),Y?[Y]:[]}}if($[0]==="."&&/^\.\w+$/.test($))return J.getElementsByClassName($.substring(1));if(/^\w+$/.test($))return J.getElementsByTagName($)}return lW($,J)};bJ.selectors=z0;bJ.operators=cW;bJ.combinators=L8;bJ.matches=function($,J){var Z={sel:J};do if(Z=N8(Z.sel),Z($))return!0;while(Z.sel);return!1}});var oZ=p((Tb,rW)=>{var SD=P0(),wD=JY(),MY=function($,J){var Z=$.createDocumentFragment();for(var Y=0;Y<J.length;Y++){var K=J[Y],Q=K instanceof SD;Z.appendChild(Q?K:$.createTextNode(String(K)))}return Z},RD={after:{value:function(){var J=Array.prototype.slice.call(arguments),Z=this.parentNode,Y=this.nextSibling;if(Z===null)return;while(Y&&J.some(function(Q){return Q===Y}))Y=Y.nextSibling;var K=MY(this.doc,J);Z.insertBefore(K,Y)}},before:{value:function(){var J=Array.prototype.slice.call(arguments),Z=this.parentNode,Y=this.previousSibling;if(Z===null)return;while(Y&&J.some(function(V){return V===Y}))Y=Y.previousSibling;var K=MY(this.doc,J),Q=Y?Y.nextSibling:Z.firstChild;Z.insertBefore(K,Q)}},remove:{value:function(){if(this.parentNode===null)return;if(this.doc){if(this.doc._preremoveNodeIterators(this),this.rooted)this.doc.mutateRemove(this)}this._remove(),this.parentNode=null}},_remove:{value:function(){var J=this.parentNode;if(J===null)return;if(J._childNodes)J._childNodes.splice(this.index,1);else if(J._firstChild===this)if(this._nextSibling===this)J._firstChild=null;else J._firstChild=this._nextSibling;wD.remove(this),J.modify()}},replaceWith:{value:function(){var J=Array.prototype.slice.call(arguments),Z=this.parentNode,Y=this.nextSibling;if(Z===null)return;while(Y&&J.some(function(Q){return Q===Y}))Y=Y.nextSibling;var K=MY(this.doc,J);if(this.parentNode===Z)Z.replaceChild(K,this);else Z.insertBefore(K,Y)}}};rW.exports=RD});var DY=p((kb,sW)=>{var iW=P0(),LD={nextElementSibling:{get:function(){if(this.parentNode){for(var $=this.nextSibling;$!==null;$=$.nextSibling)if($.nodeType===iW.ELEMENT_NODE)return $}return null}},previousElementSibling:{get:function(){if(this.parentNode){for(var $=this.previousSibling;$!==null;$=$.previousSibling)if($.nodeType===iW.ELEMENT_NODE)return $}return null}}};sW.exports=LD});var PY=p((Eb,aW)=>{aW.exports=nW;var vJ=X0();function nW($){this.element=$}Object.defineProperties(nW.prototype,{length:{get:vJ.shouldOverride},item:{value:vJ.shouldOverride},getNamedItem:{value:function(J){return this.element.getAttributeNode(J)}},getNamedItemNS:{value:function(J,Z){return this.element.getAttributeNodeNS(J,Z)}},setNamedItem:{value:vJ.nyi},setNamedItemNS:{value:vJ.nyi},removeNamedItem:{value:function(J){var Z=this.element.getAttributeNode(J);if(Z)return this.element.removeAttribute(J),Z;vJ.NotFoundError()}},removeNamedItemNS:{value:function(J,Z){var Y=this.element.getAttributeNodeNS(J,Z);if(Y)return this.element.removeAttributeNS(J,Z),Y;vJ.NotFoundError()}}})});var gJ=p((xb,Z5)=>{Z5.exports=O2;var IY=uZ(),Y0=X0(),N1=Y0.NAMESPACE,iZ=_Y(),q1=P0(),AY=n2(),ND=ZY(),rZ=hW(),hJ=vZ(),yD=qY(),SY=lZ(),eW=mZ(),TD=oZ(),kD=DY(),$5=PY(),tW=Object.create(null);function O2($,J,Z,Y){eW.call(this),this.nodeType=q1.ELEMENT_NODE,this.ownerDocument=$,this.localName=J,this.namespaceURI=Z,this.prefix=Y,this._tagName=void 0,this._attrsByQName=Object.create(null),this._attrsByLName=Object.create(null),this._attrKeys=[]}function wY($,J){if($.nodeType===q1.TEXT_NODE)J.push($._data);else for(var Z=0,Y=$.childNodes.length;Z<Y;Z++)wY($.childNodes[Z],J)}O2.prototype=Object.create(eW.prototype,{isHTML:{get:function(){return this.namespaceURI===N1.HTML&&this.ownerDocument.isHTML}},tagName:{get:function(){if(this._tagName===void 0){var J;if(this.prefix===null)J=this.localName;else J=this.prefix+":"+this.localName;if(this.isHTML){var Z=tW[J];if(!Z)tW[J]=Z=Y0.toASCIIUpperCase(J);J=Z}this._tagName=J}return this._tagName}},nodeName:{get:function(){return this.tagName}},nodeValue:{get:function(){return null},set:function(){}},textContent:{get:function(){var $=[];return wY(this,$),$.join("")},set:function($){if(this.removeChildren(),$!==null&&$!==void 0&&$!=="")this._appendChild(this.ownerDocument.createTextNode($))}},innerText:{get:function(){var $=[];return wY(this,$),$.join("").replace(/[ \t\n\f\r]+/g," ").trim()},set:function($){if(this.removeChildren(),$!==null&&$!==void 0&&$!=="")this._appendChild(this.ownerDocument.createTextNode($))}},innerHTML:{get:function(){return this.serialize()},set:Y0.nyi},outerHTML:{get:function(){return ND.serializeOne(this,{nodeType:0})},set:function($){var J=this.ownerDocument,Z=this.parentNode;if(Z===null)return;if(Z.nodeType===q1.DOCUMENT_NODE)Y0.NoModificationAllowedError();if(Z.nodeType===q1.DOCUMENT_FRAGMENT_NODE)Z=Z.ownerDocument.createElement("body");var Y=J.implementation.mozHTMLParser(J._address,Z);Y.parse($===null?"":String($),!0),this.replaceWith(Y._asDocumentFragment())}},_insertAdjacent:{value:function(J,Z){var Y=!1;switch(J){case"beforebegin":Y=!0;case"afterend":var K=this.parentNode;if(K===null)return null;return K.insertBefore(Z,Y?this:this.nextSibling);case"afterbegin":Y=!0;case"beforeend":return this.insertBefore(Z,Y?this.firstChild:null);default:return Y0.SyntaxError()}}},insertAdjacentElement:{value:function(J,Z){if(Z.nodeType!==q1.ELEMENT_NODE)throw TypeError("not an element");return J=Y0.toASCIILowerCase(String(J)),this._insertAdjacent(J,Z)}},insertAdjacentText:{value:function(J,Z){var Y=this.ownerDocument.createTextNode(Z);J=Y0.toASCIILowerCase(String(J)),this._insertAdjacent(J,Y)}},insertAdjacentHTML:{value:function(J,Z){J=Y0.toASCIILowerCase(String(J)),Z=String(Z);var Y;switch(J){case"beforebegin":case"afterend":if(Y=this.parentNode,Y===null||Y.nodeType===q1.DOCUMENT_NODE)Y0.NoModificationAllowedError();break;case"afterbegin":case"beforeend":Y=this;break;default:Y0.SyntaxError()}if(!(Y instanceof O2)||Y.ownerDocument.isHTML&&Y.localName==="html"&&Y.namespaceURI===N1.HTML)Y=Y.ownerDocument.createElementNS(N1.HTML,"body");var K=this.ownerDocument.implementation.mozHTMLParser(this.ownerDocument._address,Y);K.parse(Z,!0),this._insertAdjacent(J,K._asDocumentFragment())}},children:{get:function(){if(!this._children)this._children=new J5(this);return this._children}},attributes:{get:function(){if(!this._attributes)this._attributes=new LY(this);return this._attributes}},firstElementChild:{get:function(){for(var $=this.firstChild;$!==null;$=$.nextSibling)if($.nodeType===q1.ELEMENT_NODE)return $;return null}},lastElementChild:{get:function(){for(var $=this.lastChild;$!==null;$=$.previousSibling)if($.nodeType===q1.ELEMENT_NODE)return $;return null}},childElementCount:{get:function(){return this.children.length}},nextElement:{value:function($){if(!$)$=this.ownerDocument.documentElement;var J=this.firstElementChild;if(!J){if(this===$)return null;J=this.nextElementSibling}if(J)return J;for(var Z=this.parentElement;Z&&Z!==$;Z=Z.parentElement)if(J=Z.nextElementSibling,J)return J;return null}},getElementsByTagName:{value:function(J){var Z;if(!J)return new AY;if(J==="*")Z=function(){return!0};else if(this.isHTML)Z=ED(J);else Z=RY(J);return new rZ(this,Z)}},getElementsByTagNameNS:{value:function(J,Z){var Y;if(J==="*"&&Z==="*")Y=function(){return!0};else if(J==="*")Y=RY(Z);else if(Z==="*")Y=xD(J);else Y=bD(J,Z);return new rZ(this,Y)}},getElementsByClassName:{value:function(J){if(J=String(J).trim(),J===""){var Z=new AY;return Z}return J=J.split(/[ \t\r\n\f]+/),new rZ(this,vD(J))}},getElementsByName:{value:function(J){return new rZ(this,hD(String(J)))}},clone:{value:function(){var J;if(this.namespaceURI!==N1.HTML||this.prefix||!this.ownerDocument.isHTML)J=this.ownerDocument.createElementNS(this.namespaceURI,this.prefix!==null?this.prefix+":"+this.localName:this.localName);else J=this.ownerDocument.createElement(this.localName);for(var Z=0,Y=this._attrKeys.length;Z<Y;Z++){var K=this._attrKeys[Z],Q=this._attrsByLName[K],V=Q.cloneNode();V._setOwnerElement(J),J._attrsByLName[K]=V,J._addQName(V)}return J._attrKeys=this._attrKeys.concat(),J}},isEqual:{value:function(J){if(this.localName!==J.localName||this.namespaceURI!==J.namespaceURI||this.prefix!==J.prefix||this._numattrs!==J._numattrs)return!1;for(var Z=0,Y=this._numattrs;Z<Y;Z++){var K=this._attr(Z);if(!J.hasAttributeNS(K.namespaceURI,K.localName))return!1;if(J.getAttributeNS(K.namespaceURI,K.localName)!==K.value)return!1}return!0}},_lookupNamespacePrefix:{value:function(J,Z){if(this.namespaceURI&&this.namespaceURI===J&&this.prefix!==null&&Z.lookupNamespaceURI(this.prefix)===J)return this.prefix;for(var Y=0,K=this._numattrs;Y<K;Y++){var Q=this._attr(Y);if(Q.prefix==="xmlns"&&Q.value===J&&Z.lookupNamespaceURI(Q.localName)===J)return Q.localName}var V=this.parentElement;return V?V._lookupNamespacePrefix(J,Z):null}},lookupNamespaceURI:{value:function(J){if(J===""||J===void 0)J=null;if(this.namespaceURI!==null&&this.prefix===J)return this.namespaceURI;for(var Z=0,Y=this._numattrs;Z<Y;Z++){var K=this._attr(Z);if(K.namespaceURI===N1.XMLNS){if(K.prefix==="xmlns"&&K.localName===J||J===null&&K.prefix===null&&K.localName==="xmlns")return K.value||null}}var Q=this.parentElement;return Q?Q.lookupNamespaceURI(J):null}},getAttribute:{value:function(J){var Z=this.getAttributeNode(J);return Z?Z.value:null}},getAttributeNS:{value:function(J,Z){var Y=this.getAttributeNodeNS(J,Z);return Y?Y.value:null}},getAttributeNode:{value:function(J){if(J=String(J),/[A-Z]/.test(J)&&this.isHTML)J=Y0.toASCIILowerCase(J);var Z=this._attrsByQName[J];if(!Z)return null;if(Array.isArray(Z))Z=Z[0];return Z}},getAttributeNodeNS:{value:function(J,Z){J=J===void 0||J===null?"":String(J),Z=String(Z);var Y=this._attrsByLName[J+"|"+Z];return Y?Y:null}},hasAttribute:{value:function(J){if(J=String(J),/[A-Z]/.test(J)&&this.isHTML)J=Y0.toASCIILowerCase(J);return this._attrsByQName[J]!==void 0}},hasAttributeNS:{value:function(J,Z){J=J===void 0||J===null?"":String(J),Z=String(Z);var Y=J+"|"+Z;return this._attrsByLName[Y]!==void 0}},hasAttributes:{value:function(){return this._numattrs>0}},toggleAttribute:{value:function(J,Z){if(J=String(J),!IY.isValidName(J))Y0.InvalidCharacterError();if(/[A-Z]/.test(J)&&this.isHTML)J=Y0.toASCIILowerCase(J);var Y=this._attrsByQName[J];if(Y===void 0){if(Z===void 0||Z===!0)return this._setAttribute(J,""),!0;return!1}else{if(Z===void 0||Z===!1)return this.removeAttribute(J),!1;return!0}}},_setAttribute:{value:function(J,Z){var Y=this._attrsByQName[J],K;if(!Y)Y=this._newattr(J),K=!0;else if(Array.isArray(Y))Y=Y[0];if(Y.value=Z,this._attributes)this._attributes[J]=Y;if(K&&this._newattrhook)this._newattrhook(J,Z)}},setAttribute:{value:function(J,Z){if(J=String(J),!IY.isValidName(J))Y0.InvalidCharacterError();if(/[A-Z]/.test(J)&&this.isHTML)J=Y0.toASCIILowerCase(J);this._setAttribute(J,String(Z))}},_setAttributeNS:{value:function(J,Z,Y){var K=Z.indexOf(":"),Q,V;if(K<0)Q=null,V=Z;else Q=Z.substring(0,K),V=Z.substring(K+1);if(J===""||J===void 0)J=null;var X=(J===null?"":J)+"|"+V,W=this._attrsByLName[X],_;if(!W){if(W=new y8(this,V,Q,J),_=!0,this._attrsByLName[X]=W,this._attributes)this._attributes[this._attrKeys.length]=W;this._attrKeys.push(X),this._addQName(W)}if(W.value=Y,_&&this._newattrhook)this._newattrhook(Z,Y)}},setAttributeNS:{value:function(J,Z,Y){if(J=J===null||J===void 0||J===""?null:String(J),Z=String(Z),!IY.isValidQName(Z))Y0.InvalidCharacterError();var K=Z.indexOf(":"),Q=K<0?null:Z.substring(0,K);if(Q!==null&&J===null||Q==="xml"&&J!==N1.XML||(Z==="xmlns"||Q==="xmlns")&&J!==N1.XMLNS||J===N1.XMLNS&&!(Z==="xmlns"||Q==="xmlns"))Y0.NamespaceError();this._setAttributeNS(J,Z,String(Y))}},setAttributeNode:{value:function(J){if(J.ownerElement!==null&&J.ownerElement!==this)throw new hJ(hJ.INUSE_ATTRIBUTE_ERR);var Z=null,Y=this._attrsByQName[J.name];if(Y){if(!Array.isArray(Y))Y=[Y];if(Y.some(function(K){return K===J}))return J;else if(J.ownerElement!==null)throw new hJ(hJ.INUSE_ATTRIBUTE_ERR);Y.forEach(function(K){this.removeAttributeNode(K)},this),Z=Y[0]}return this.setAttributeNodeNS(J),Z}},setAttributeNodeNS:{value:function(J){if(J.ownerElement!==null)throw new hJ(hJ.INUSE_ATTRIBUTE_ERR);var Z=J.namespaceURI,Y=(Z===null?"":Z)+"|"+J.localName,K=this._attrsByLName[Y];if(K)this.removeAttributeNode(K);if(J._setOwnerElement(this),this._attrsByLName[Y]=J,this._attributes)this._attributes[this._attrKeys.length]=J;if(this._attrKeys.push(Y),this._addQName(J),this._newattrhook)this._newattrhook(J.name,J.value);return K||null}},removeAttribute:{value:function(J){if(J=String(J),/[A-Z]/.test(J)&&this.isHTML)J=Y0.toASCIILowerCase(J);var Z=this._attrsByQName[J];if(!Z)return;if(Array.isArray(Z))if(Z.length>2)Z=Z.shift();else this._attrsByQName[J]=Z[1],Z=Z[0];else this._attrsByQName[J]=void 0;var Y=Z.namespaceURI,K=(Y===null?"":Y)+"|"+Z.localName;this._attrsByLName[K]=void 0;var Q=this._attrKeys.indexOf(K);if(this._attributes)Array.prototype.splice.call(this._attributes,Q,1),this._attributes[J]=void 0;this._attrKeys.splice(Q,1);var V=Z.onchange;if(Z._setOwnerElement(null),V)V.call(Z,this,Z.localName,Z.value,null);if(this.rooted)this.ownerDocument.mutateRemoveAttr(Z)}},removeAttributeNS:{value:function(J,Z){J=J===void 0||J===null?"":String(J),Z=String(Z);var Y=J+"|"+Z,K=this._attrsByLName[Y];if(!K)return;this._attrsByLName[Y]=void 0;var Q=this._attrKeys.indexOf(Y);if(this._attributes)Array.prototype.splice.call(this._attributes,Q,1);this._attrKeys.splice(Q,1),this._removeQName(K);var V=K.onchange;if(K._setOwnerElement(null),V)V.call(K,this,K.localName,K.value,null);if(this.rooted)this.ownerDocument.mutateRemoveAttr(K)}},removeAttributeNode:{value:function(J){var Z=J.namespaceURI,Y=(Z===null?"":Z)+"|"+J.localName;if(this._attrsByLName[Y]!==J)Y0.NotFoundError();return this.removeAttributeNS(Z,J.localName),J}},getAttributeNames:{value:function(){var J=this;return this._attrKeys.map(function(Z){return J._attrsByLName[Z].name})}},_getattr:{value:function(J){var Z=this._attrsByQName[J];return Z?Z.value:null}},_setattr:{value:function(J,Z){var Y=this._attrsByQName[J],K;if(!Y)Y=this._newattr(J),K=!0;if(Y.value=String(Z),this._attributes)this._attributes[J]=Y;if(K&&this._newattrhook)this._newattrhook(J,Z)}},_newattr:{value:function(J){var Z=new y8(this,J,null,null),Y="|"+J;if(this._attrsByQName[J]=Z,this._attrsByLName[Y]=Z,this._attributes)this._attributes[this._attrKeys.length]=Z;return this._attrKeys.push(Y),Z}},_addQName:{value:function($){var J=$.name,Z=this._attrsByQName[J];if(!Z)this._attrsByQName[J]=$;else if(Array.isArray(Z))Z.push($);else this._attrsByQName[J]=[Z,$];if(this._attributes)this._attributes[J]=$}},_removeQName:{value:function($){var J=$.name,Z=this._attrsByQName[J];if(Array.isArray(Z)){var Y=Z.indexOf($);if(Y0.assert(Y!==-1),Z.length===2){if(this._attrsByQName[J]=Z[1-Y],this._attributes)this._attributes[J]=this._attrsByQName[J]}else if(Z.splice(Y,1),this._attributes&&this._attributes[J]===$)this._attributes[J]=Z[0]}else if(Y0.assert(Z===$),this._attrsByQName[J]=void 0,this._attributes)this._attributes[J]=void 0}},_numattrs:{get:function(){return this._attrKeys.length}},_attr:{value:function($){return this._attrsByLName[this._attrKeys[$]]}},id:iZ.property({name:"id"}),className:iZ.property({name:"class"}),classList:{get:function(){var $=this;if(this._classList)return this._classList;var J=new yD(function(){return $.className||""},function(Z){$.className=Z});return this._classList=J,J},set:function($){this.className=$}},matches:{value:function($){return SY.matches(this,$)}},closest:{value:function($){var J=this;do{if(J.matches&&J.matches($))return J;J=J.parentElement||J.parentNode}while(J!==null&&J.nodeType===q1.ELEMENT_NODE);return null}},querySelector:{value:function($){return SY($,this)[0]}},querySelectorAll:{value:function($){var J=SY($,this);return J.item?J:new AY(J)}}});Object.defineProperties(O2.prototype,TD);Object.defineProperties(O2.prototype,kD);iZ.registerChangeHandler(O2,"id",function($,J,Z,Y){if($.rooted){if(Z)$.ownerDocument.delId(Z,$);if(Y)$.ownerDocument.addId(Y,$)}});iZ.registerChangeHandler(O2,"class",function($,J,Z,Y){if($._classList)$._classList._update()});function y8($,J,Z,Y,K){this.localName=J,this.prefix=Z===null||Z===""?null:""+Z,this.namespaceURI=Y===null||Y===""?null:""+Y,this.data=K,this._setOwnerElement($)}y8.prototype=Object.create(Object.prototype,{ownerElement:{get:function(){return this._ownerElement}},_setOwnerElement:{value:function(J){if(this._ownerElement=J,this.prefix===null&&this.namespaceURI===null&&J)this.onchange=J._attributeChangeHandlers[this.localName];else this.onchange=null}},name:{get:function(){return this.prefix?this.prefix+":"+this.localName:this.localName}},specified:{get:function(){return!0}},value:{get:function(){return this.data},set:function($){var J=this.data;if($=$===void 0?"":$+"",$===J)return;if(this.data=$,this.ownerElement){if(this.onchange)this.onchange(this.ownerElement,this.localName,J,$);if(this.ownerElement.rooted)this.ownerElement.ownerDocument.mutateAttr(this,J)}}},cloneNode:{value:function(J){return new y8(null,this.localName,this.prefix,this.namespaceURI,this.data)}},nodeType:{get:function(){return q1.ATTRIBUTE_NODE}},nodeName:{get:function(){return this.name}},nodeValue:{get:function(){return this.value},set:function($){this.value=$}},textContent:{get:function(){return this.value},set:function($){if($===null||$===void 0)$="";this.value=$}},innerText:{get:function(){return this.value},set:function($){if($===null||$===void 0)$="";this.value=$}}});O2._Attr=y8;function LY($){$5.call(this,$);for(var J in $._attrsByQName)this[J]=$._attrsByQName[J];for(var Z=0;Z<$._attrKeys.length;Z++)this[Z]=$._attrsByLName[$._attrKeys[Z]]}LY.prototype=Object.create($5.prototype,{length:{get:function(){return this.element._attrKeys.length},set:function(){}},item:{value:function($){if($=$>>>0,$>=this.length)return null;return this.element._attrsByLName[this.element._attrKeys[$]]}}});if(globalThis.Symbol?.iterator)LY.prototype[globalThis.Symbol.iterator]=function(){var $=0,J=this.length,Z=this;return{next:function(){if($<J)return{value:Z.item($++)};return{done:!0}}}};function J5($){this.element=$,this.updateCache()}J5.prototype=Object.create(Object.prototype,{length:{get:function(){return this.updateCache(),this.childrenByNumber.length}},item:{value:function(J){return this.updateCache(),this.childrenByNumber[J]||null}},namedItem:{value:function(J){return this.updateCache(),this.childrenByName[J]||null}},namedItems:{get:function(){return this.updateCache(),this.childrenByName}},updateCache:{value:function(){var J=/^(a|applet|area|embed|form|frame|frameset|iframe|img|object)$/;if(this.lastModTime!==this.element.lastModTime){this.lastModTime=this.element.lastModTime;var Z=this.childrenByNumber&&this.childrenByNumber.length||0;for(var Y=0;Y<Z;Y++)this[Y]=void 0;this.childrenByNumber=[],this.childrenByName=Object.create(null);for(var K=this.element.firstChild;K!==null;K=K.nextSibling)if(K.nodeType===q1.ELEMENT_NODE){this[this.childrenByNumber.length]=K,this.childrenByNumber.push(K);var Q=K.getAttribute("id");if(Q&&!this.childrenByName[Q])this.childrenByName[Q]=K;var V=K.getAttribute("name");if(V&&this.element.namespaceURI===N1.HTML&&J.test(this.element.localName)&&!this.childrenByName[V])this.childrenByName[Q]=K}}}}});function RY($){return function(J){return J.localName===$}}function ED($){var J=Y0.toASCIILowerCase($);if(J===$)return RY($);return function(Z){return Z.isHTML?Z.localName===J:Z.localName===$}}function xD($){return function(J){return J.namespaceURI===$}}function bD($,J){return function(Z){return Z.namespaceURI===$&&Z.localName===J}}function vD($){return function(J){return $.every(function(Z){return J.classList.contains(Z)})}}function hD($){return function(J){if(J.namespaceURI!==N1.HTML)return!1;return J.getAttribute("name")===$}}});var NY=p((bb,G5)=>{G5.exports=V5;var K5=P0(),gD=n2(),Q5=X0(),Y5=Q5.HierarchyRequestError,fD=Q5.NotFoundError;function V5(){K5.call(this)}V5.prototype=Object.create(K5.prototype,{hasChildNodes:{value:function(){return!1}},firstChild:{value:null},lastChild:{value:null},insertBefore:{value:function($,J){if(!$.nodeType)throw TypeError("not a node");Y5()}},replaceChild:{value:function($,J){if(!$.nodeType)throw TypeError("not a node");Y5()}},removeChild:{value:function($){if(!$.nodeType)throw TypeError("not a node");fD()}},removeChildren:{value:function(){}},childNodes:{get:function(){if(!this._childNodes)this._childNodes=new gD;return this._childNodes}}})});var T8=p((vb,j5)=>{j5.exports=sZ;var W5=NY(),X5=X0(),mD=oZ(),uD=DY();function sZ(){W5.call(this)}sZ.prototype=Object.create(W5.prototype,{substringData:{value:function(J,Z){if(arguments.length<2)throw TypeError("Not enough arguments");if(J=J>>>0,Z=Z>>>0,J>this.data.length||J<0||Z<0)X5.IndexSizeError();return this.data.substring(J,J+Z)}},appendData:{value:function(J){if(arguments.length<1)throw TypeError("Not enough arguments");this.data+=String(J)}},insertData:{value:function(J,Z){return this.replaceData(J,0,Z)}},deleteData:{value:function(J,Z){return this.replaceData(J,Z,"")}},replaceData:{value:function(J,Z,Y){var K=this.data,Q=K.length;if(J=J>>>0,Z=Z>>>0,Y=String(Y),J>Q||J<0)X5.IndexSizeError();if(J+Z>Q)Z=Q-J;var V=K.substring(0,J),X=K.substring(J+Z);this.data=V+Y+X}},isEqual:{value:function(J){return this._data===J._data}},length:{get:function(){return this.data.length}}});Object.defineProperties(sZ.prototype,mD);Object.defineProperties(sZ.prototype,uD)});var TY=p((hb,_5)=>{_5.exports=yY;var U5=X0(),B5=P0(),H5=T8();function yY($,J){H5.call(this),this.nodeType=B5.TEXT_NODE,this.ownerDocument=$,this._data=J,this._index=void 0}var k8={get:function(){return this._data},set:function($){if($===null||$===void 0)$="";else $=String($);if($===this._data)return;if(this._data=$,this.rooted)this.ownerDocument.mutateValue(this);if(this.parentNode&&this.parentNode._textchangehook)this.parentNode._textchangehook(this)}};yY.prototype=Object.create(H5.prototype,{nodeName:{value:"#text"},nodeValue:k8,textContent:k8,innerText:k8,data:{get:k8.get,set:function($){k8.set.call(this,$===null?"":String($))}},splitText:{value:function(J){if(J>this._data.length||J<0)U5.IndexSizeError();var Z=this._data.substring(J),Y=this.ownerDocument.createTextNode(Z);this.data=this.data.substring(0,J);var K=this.parentNode;if(K!==null)K.insertBefore(Y,this.nextSibling);return Y}},wholeText:{get:function(){var J=this.textContent;for(var Z=this.nextSibling;Z;Z=Z.nextSibling){if(Z.nodeType!==B5.TEXT_NODE)break;J+=Z.textContent}return J}},replaceWholeText:{value:U5.nyi},clone:{value:function(){return new yY(this.ownerDocument,this._data)}}})});var EY=p((gb,q5)=>{q5.exports=kY;var dD=P0(),O5=T8();function kY($,J){O5.call(this),this.nodeType=dD.COMMENT_NODE,this.ownerDocument=$,this._data=J}var E8={get:function(){return this._data},set:function($){if($===null||$===void 0)$="";else $=String($);if(this._data=$,this.rooted)this.ownerDocument.mutateValue(this)}};kY.prototype=Object.create(O5.prototype,{nodeName:{value:"#comment"},nodeValue:E8,textContent:E8,innerText:E8,data:{get:E8.get,set:function($){E8.set.call(this,$===null?"":String($))}},clone:{value:function(){return new kY(this.ownerDocument,this._data)}}})});var bY=p((fb,C5)=>{C5.exports=xY;var pD=P0(),cD=n2(),z5=mZ(),nZ=gJ(),lD=lZ(),F5=X0();function xY($){z5.call(this),this.nodeType=pD.DOCUMENT_FRAGMENT_NODE,this.ownerDocument=$}xY.prototype=Object.create(z5.prototype,{nodeName:{value:"#document-fragment"},nodeValue:{get:function(){return null},set:function(){}},textContent:Object.getOwnPropertyDescriptor(nZ.prototype,"textContent"),innerText:Object.getOwnPropertyDescriptor(nZ.prototype,"innerText"),querySelector:{value:function($){var J=this.querySelectorAll($);return J.length?J[0]:null}},querySelectorAll:{value:function($){var J=Object.create(this);J.isHTML=!0,J.getElementsByTagName=nZ.prototype.getElementsByTagName,J.nextElement=Object.getOwnPropertyDescriptor(nZ.prototype,"firstElementChild").get;var Z=lD($,J);return Z.item?Z:new cD(Z)}},clone:{value:function(){return new xY(this.ownerDocument)}},isEqual:{value:function(J){return!0}},innerHTML:{get:function(){return this.serialize()},set:F5.nyi},outerHTML:{get:function(){return this.serialize()},set:F5.nyi}})});var hY=p((mb,D5)=>{D5.exports=vY;var oD=P0(),M5=T8();function vY($,J,Z){M5.call(this),this.nodeType=oD.PROCESSING_INSTRUCTION_NODE,this.ownerDocument=$,this.target=J,this._data=Z}var x8={get:function(){return this._data},set:function($){if($===null||$===void 0)$="";else $=String($);if(this._data=$,this.rooted)this.ownerDocument.mutateValue(this)}};vY.prototype=Object.create(M5.prototype,{nodeName:{get:function(){return this.target}},nodeValue:x8,textContent:x8,innerText:x8,data:{get:x8.get,set:function($){x8.set.call(this,$===null?"":String($))}},clone:{value:function(){return new vY(this.ownerDocument,this.target,this._data)}},isEqual:{value:function(J){return this.target===J.target&&this._data===J._data}}})});var b8=p((ub,P5)=>{var gY={FILTER_ACCEPT:1,FILTER_REJECT:2,FILTER_SKIP:3,SHOW_ALL:4294967295,SHOW_ELEMENT:1,SHOW_ATTRIBUTE:2,SHOW_TEXT:4,SHOW_CDATA_SECTION:8,SHOW_ENTITY_REFERENCE:16,SHOW_ENTITY:32,SHOW_PROCESSING_INSTRUCTION:64,SHOW_COMMENT:128,SHOW_DOCUMENT:256,SHOW_DOCUMENT_TYPE:512,SHOW_DOCUMENT_FRAGMENT:1024,SHOW_NOTATION:2048};P5.exports=gY.constructor=gY.prototype=gY});var mY=p((pb,A5)=>{var db=A5.exports={nextSkippingChildren:rD,nextAncestorSibling:fY,next:iD,previous:sD,deepLastChild:I5};function rD($,J){if($===J)return null;if($.nextSibling!==null)return $.nextSibling;return fY($,J)}function fY($,J){for($=$.parentNode;$!==null;$=$.parentNode){if($===J)return null;if($.nextSibling!==null)return $.nextSibling}return null}function iD($,J){var Z=$.firstChild;if(Z!==null)return Z;if($===J)return null;if(Z=$.nextSibling,Z!==null)return Z;return fY($,J)}function I5($){while($.lastChild)$=$.lastChild;return $}function sD($,J){var Z=$.previousSibling;if(Z!==null)return I5(Z);if(Z=$.parentNode,Z===J)return null;return Z}});var T5=p((cb,y5)=>{y5.exports=N5;var nD=P0(),I0=b8(),S5=mY(),L5=X0(),uY={first:"firstChild",last:"lastChild",next:"firstChild",previous:"lastChild"},dY={first:"nextSibling",last:"previousSibling",next:"nextSibling",previous:"previousSibling"};function w5($,J){var Z,Y,K,Q,V;Y=$._currentNode[uY[J]];while(Y!==null){if(Q=$._internalFilter(Y),Q===I0.FILTER_ACCEPT)return $._currentNode=Y,Y;if(Q===I0.FILTER_SKIP){if(Z=Y[uY[J]],Z!==null){Y=Z;continue}}while(Y!==null){if(V=Y[dY[J]],V!==null){Y=V;break}if(K=Y.parentNode,K===null||K===$.root||K===$._currentNode)return null;else Y=K}}return null}function R5($,J){var Z,Y,K;if(Z=$._currentNode,Z===$.root)return null;while(!0){K=Z[dY[J]];while(K!==null){if(Z=K,Y=$._internalFilter(Z),Y===I0.FILTER_ACCEPT)return $._currentNode=Z,Z;if(K=Z[uY[J]],Y===I0.FILTER_REJECT||K===null)K=Z[dY[J]]}if(Z=Z.parentNode,Z===null||Z===$.root)return null;if($._internalFilter(Z)===I0.FILTER_ACCEPT)return null}}function N5($,J,Z){if(!$||!$.nodeType)L5.NotSupportedError();this._root=$,this._whatToShow=Number(J)||0,this._filter=Z||null,this._active=!1,this._currentNode=$}Object.defineProperties(N5.prototype,{root:{get:function(){return this._root}},whatToShow:{get:function(){return this._whatToShow}},filter:{get:function(){return this._filter}},currentNode:{get:function(){return this._currentNode},set:function(J){if(!(J instanceof nD))throw TypeError("Not a Node");this._currentNode=J}},_internalFilter:{value:function(J){var Z,Y;if(this._active)L5.InvalidStateError();if(!(1<<J.nodeType-1&this._whatToShow))return I0.FILTER_SKIP;if(Y=this._filter,Y===null)Z=I0.FILTER_ACCEPT;else{this._active=!0;try{if(typeof Y==="function")Z=Y(J);else Z=Y.acceptNode(J)}finally{this._active=!1}}return+Z}},parentNode:{value:function(){var J=this._currentNode;while(J!==this.root){if(J=J.parentNode,J===null)return null;if(this._internalFilter(J)===I0.FILTER_ACCEPT)return this._currentNode=J,J}return null}},firstChild:{value:function(){return w5(this,"first")}},lastChild:{value:function(){return w5(this,"last")}},previousSibling:{value:function(){return R5(this,"previous")}},nextSibling:{value:function(){return R5(this,"next")}},previousNode:{value:function(){var J,Z,Y,K;J=this._currentNode;while(J!==this._root){for(Y=J.previousSibling;Y;Y=J.previousSibling){if(J=Y,Z=this._internalFilter(J),Z===I0.FILTER_REJECT)continue;for(K=J.lastChild;K;K=J.lastChild)if(J=K,Z=this._internalFilter(J),Z===I0.FILTER_REJECT)break;if(Z===I0.FILTER_ACCEPT)return this._currentNode=J,J}if(J===this.root||J.parentNode===null)return null;if(J=J.parentNode,this._internalFilter(J)===I0.FILTER_ACCEPT)return this._currentNode=J,J}return null}},nextNode:{value:function(){var J,Z,Y,K;J=this._currentNode,Z=I0.FILTER_ACCEPT;$:while(!0){for(Y=J.firstChild;Y;Y=J.firstChild)if(J=Y,Z=this._internalFilter(J),Z===I0.FILTER_ACCEPT)return this._currentNode=J,J;else if(Z===I0.FILTER_REJECT)break;for(K=S5.nextSkippingChildren(J,this.root);K;K=S5.nextSkippingChildren(J,this.root))if(J=K,Z=this._internalFilter(J),Z===I0.FILTER_ACCEPT)return this._currentNode=J,J;else if(Z===I0.FILTER_SKIP)continue $;return null}}},toString:{value:function(){return"[object TreeWalker]"}}})});var h5=p((lb,v5)=>{v5.exports=b5;var pY=b8(),cY=mY(),x5=X0();function aD($,J,Z){if(Z)return cY.next($,J);else{if($===J)return null;return cY.previous($,null)}}function k5($,J){for(;J;J=J.parentNode)if($===J)return!0;return!1}function E5($,J){var Z,Y;Z=$._referenceNode,Y=$._pointerBeforeReferenceNode;while(!0){if(Y===J)Y=!Y;else if(Z=aD(Z,$._root,J),Z===null)return null;var K=$._internalFilter(Z);if(K===pY.FILTER_ACCEPT)break}return $._referenceNode=Z,$._pointerBeforeReferenceNode=Y,Z}function b5($,J,Z){if(!$||!$.nodeType)x5.NotSupportedError();this._root=$,this._referenceNode=$,this._pointerBeforeReferenceNode=!0,this._whatToShow=Number(J)||0,this._filter=Z||null,this._active=!1,$.doc._attachNodeIterator(this)}Object.defineProperties(b5.prototype,{root:{get:function(){return this._root}},referenceNode:{get:function(){return this._referenceNode}},pointerBeforeReferenceNode:{get:function(){return this._pointerBeforeReferenceNode}},whatToShow:{get:function(){return this._whatToShow}},filter:{get:function(){return this._filter}},_internalFilter:{value:function(J){var Z,Y;if(this._active)x5.InvalidStateError();if(!(1<<J.nodeType-1&this._whatToShow))return pY.FILTER_SKIP;if(Y=this._filter,Y===null)Z=pY.FILTER_ACCEPT;else{this._active=!0;try{if(typeof Y==="function")Z=Y(J);else Z=Y.acceptNode(J)}finally{this._active=!1}}return+Z}},_preremove:{value:function(J){if(k5(J,this._root))return;if(!k5(J,this._referenceNode))return;if(this._pointerBeforeReferenceNode){var Z=J;while(Z.lastChild)Z=Z.lastChild;if(Z=cY.next(Z,this.root),Z){this._referenceNode=Z;return}this._pointerBeforeReferenceNode=!1}if(J.previousSibling===null)this._referenceNode=J.parentNode;else{this._referenceNode=J.previousSibling;var Y;for(Y=this._referenceNode.lastChild;Y;Y=this._referenceNode.lastChild)this._referenceNode=Y}}},nextNode:{value:function(){return E5(this,!0)}},previousNode:{value:function(){return E5(this,!1)}},detach:{value:function(){}},toString:{value:function(){return"[object NodeIterator]"}}})});var aZ=p((ob,g5)=>{g5.exports=A0;function A0($){if(!$)return Object.create(A0.prototype);this.url=$.replace(/^[ \t\n\r\f]+|[ \t\n\r\f]+$/g,"");var J=A0.pattern.exec(this.url);if(J){if(J[2])this.scheme=J[2];if(J[4]){var Z=J[4].match(A0.userinfoPattern);if(Z)this.username=Z[1],this.password=Z[3],J[4]=J[4].substring(Z[0].length);if(J[4].match(A0.portPattern)){var Y=J[4].lastIndexOf(":");this.host=J[4].substring(0,Y),this.port=J[4].substring(Y+1)}else this.host=J[4]}if(J[5])this.path=J[5];if(J[6])this.query=J[7];if(J[8])this.fragment=J[9]}}A0.pattern=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/;A0.userinfoPattern=/^([^@:]*)(:([^@]*))?@/;A0.portPattern=/:\d+$/;A0.authorityPattern=/^[^:\/?#]+:\/\//;A0.hierarchyPattern=/^[^:\/?#]+:\//;A0.percentEncode=function(J){var Z=J.charCodeAt(0);if(Z<256)return"%"+Z.toString(16);else throw Error("can't percent-encode codepoints > 255 yet")};A0.prototype={constructor:A0,isAbsolute:function(){return!!this.scheme},isAuthorityBased:function(){return A0.authorityPattern.test(this.url)},isHierarchical:function(){return A0.hierarchyPattern.test(this.url)},toString:function(){var $="";if(this.scheme!==void 0)$+=this.scheme+":";if(this.isAbsolute()){if($+="//",this.username||this.password){if($+=this.username||"",this.password)$+=":"+this.password;$+="@"}if(this.host)$+=this.host}if(this.port!==void 0)$+=":"+this.port;if(this.path!==void 0)$+=this.path;if(this.query!==void 0)$+="?"+this.query;if(this.fragment!==void 0)$+="#"+this.fragment;return $},resolve:function($){var J=this,Z=new A0($),Y=new A0;if(Z.scheme!==void 0)Y.scheme=Z.scheme,Y.username=Z.username,Y.password=Z.password,Y.host=Z.host,Y.port=Z.port,Y.path=Q(Z.path),Y.query=Z.query;else if(Y.scheme=J.scheme,Z.host!==void 0)Y.username=Z.username,Y.password=Z.password,Y.host=Z.host,Y.port=Z.port,Y.path=Q(Z.path),Y.query=Z.query;else if(Y.username=J.username,Y.password=J.password,Y.host=J.host,Y.port=J.port,!Z.path)if(Y.path=J.path,Z.query!==void 0)Y.query=Z.query;else Y.query=J.query;else{if(Z.path.charAt(0)==="/")Y.path=Q(Z.path);else Y.path=K(J.path,Z.path),Y.path=Q(Y.path);Y.query=Z.query}return Y.fragment=Z.fragment,Y.toString();function K(V,X){if(J.host!==void 0&&!J.path)return"/"+X;var W=V.lastIndexOf("/");if(W===-1)return X;else return V.substring(0,W+1)+X}function Q(V){if(!V)return V;var X="";while(V.length>0){if(V==="."||V===".."){V="";break}var W=V.substring(0,2),_=V.substring(0,3),j=V.substring(0,4);if(_==="../")V=V.substring(3);else if(W==="./")V=V.substring(2);else if(_==="/./")V="/"+V.substring(3);else if(W==="/."&&V.length===2)V="/";else if(j==="/../"||_==="/.."&&V.length===3)V="/"+V.substring(4),X=X.replace(/\/?[^\/]*$/,"");else{var H=V.match(/(\/?([^\/]*))/)[0];X+=H,V=V.substring(H.length)}}return X}}}});var u5=p((rb,m5)=>{m5.exports=lY;var f5=TJ();function lY($,J){f5.call(this,$,J)}lY.prototype=Object.create(f5.prototype,{constructor:{value:lY}})});var oY=p((ib,d5)=>{d5.exports={Event:TJ(),UIEvent:a7(),MouseEvent:e7(),CustomEvent:u5()}});var o5=p((c5)=>{Object.defineProperty(c5,"__esModule",{value:!0});c5.hyphenate=c5.parse=void 0;function tD($){let J=[],Z=0,Y=0,K=0,Q=0,V=0,X=null;while(Z<$.length)switch($.charCodeAt(Z++)){case 40:Y++;break;case 41:Y--;break;case 39:if(K===0)K=39;else if(K===39&&$.charCodeAt(Z-1)!==92)K=0;break;case 34:if(K===0)K=34;else if(K===34&&$.charCodeAt(Z-1)!==92)K=0;break;case 58:if(!X&&Y===0&&K===0)X=p5($.substring(V,Z-1).trim()),Q=Z;break;case 59:if(X&&Q>0&&Y===0&&K===0){let _=$.substring(Q,Z-1).trim();J.push(X,_),V=Z,Q=0,X=null}break}if(X&&Q){let W=$.slice(Q).trim();J.push(X,W)}return J}c5.parse=tD;function p5($){return $.replace(/[a-z][A-Z]/g,(J)=>{return J.charAt(0)+"-"+J.charAt(1)}).toLowerCase()}c5.hyphenate=p5});var tZ=p((nb,a5)=>{var{parse:$P}=o5();a5.exports=function($){let J=new n5($);return new Proxy(J,{get:function(Y,K){return K in Y?Y[K]:Y.getPropertyValue(r5(K))},has:function(Y,K){return!0},set:function(Y,K,Q){if(K in Y)Y[K]=Q;else Y.setProperty(r5(K),Q??void 0);return!0}})};function r5($){return $.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function n5($){this._element=$}var i5="!important";function s5($){let J={property:{},priority:{}};if(!$)return J;let Z=$P($);if(Z.length<2)return J;for(let Y=0;Y<Z.length;Y+=2){let K=Z[Y],Q=Z[Y+1];if(Q.endsWith(i5))J.priority[K]="important",Q=Q.slice(0,-i5.length).trim();J.property[K]=Q}return J}var fJ={};n5.prototype=Object.create(Object.prototype,{_parsed:{get:function(){if(!this._parsedStyles||this.cssText!==this._lastParsedText){var $=this.cssText;this._parsedStyles=s5($),this._lastParsedText=$,delete this._names}return this._parsedStyles}},_serialize:{value:function(){var $=this._parsed,J="";for(var Z in $.property){if(J)J+=" ";if(J+=Z+": "+$.property[Z],$.priority[Z])J+=" !"+$.priority[Z];J+=";"}this.cssText=J,this._lastParsedText=J,delete this._names}},cssText:{get:function(){return this._element.getAttribute("style")},set:function($){this._element.setAttribute("style",$)}},length:{get:function(){if(!this._names)this._names=Object.getOwnPropertyNames(this._parsed.property);return this._names.length}},item:{value:function($){if(!this._names)this._names=Object.getOwnPropertyNames(this._parsed.property);return this._names[$]}},getPropertyValue:{value:function($){return $=$.toLowerCase(),this._parsed.property[$]||""}},getPropertyPriority:{value:function($){return $=$.toLowerCase(),this._parsed.priority[$]||""}},setProperty:{value:function($,J,Z){if($=$.toLowerCase(),J===null||J===void 0)J="";if(Z===null||Z===void 0)Z="";if(J!==fJ)J=""+J;if(J=J.trim(),J===""){this.removeProperty($);return}if(Z!==""&&Z!==fJ&&!/^important$/i.test(Z))return;var Y=this._parsed;if(J===fJ){if(!Y.property[$])return;if(Z!=="")Y.priority[$]="important";else delete Y.priority[$]}else{if(J.indexOf(";")!==-1)return;var K=s5($+":"+J);if(Object.getOwnPropertyNames(K.property).length===0)return;if(Object.getOwnPropertyNames(K.priority).length!==0)return;for(var Q in K.property)if(Y.property[Q]=K.property[Q],Z===fJ)continue;else if(Z!=="")Y.priority[Q]="important";else if(Y.priority[Q])delete Y.priority[Q]}this._serialize()}},setPropertyValue:{value:function($,J){return this.setProperty($,J,fJ)}},setPropertyPriority:{value:function($,J){return this.setProperty($,fJ,J)}},removeProperty:{value:function($){$=$.toLowerCase();var J=this._parsed;if($ in J.property)delete J.property[$],delete J.priority[$],this._serialize()}}})});var rY=p((ab,t5)=>{var C0=aZ();t5.exports=v8;function v8(){}v8.prototype=Object.create(Object.prototype,{_url:{get:function(){return new C0(this.href)}},protocol:{get:function(){var $=this._url;if($&&$.scheme)return $.scheme+":";else return":"},set:function($){var J=this.href,Z=new C0(J);if(Z.isAbsolute()){if($=$.replace(/:+$/,""),$=$.replace(/[^-+\.a-zA-Z0-9]/g,C0.percentEncode),$.length>0)Z.scheme=$,J=Z.toString()}this.href=J}},host:{get:function(){var $=this._url;if($.isAbsolute()&&$.isAuthorityBased())return $.host+($.port?":"+$.port:"");else return""},set:function($){var J=this.href,Z=new C0(J);if(Z.isAbsolute()&&Z.isAuthorityBased()){if($=$.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g,C0.percentEncode),$.length>0)Z.host=$,delete Z.port,J=Z.toString()}this.href=J}},hostname:{get:function(){var $=this._url;if($.isAbsolute()&&$.isAuthorityBased())return $.host;else return""},set:function($){var J=this.href,Z=new C0(J);if(Z.isAbsolute()&&Z.isAuthorityBased()){if($=$.replace(/^\/+/,""),$=$.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g,C0.percentEncode),$.length>0)Z.host=$,J=Z.toString()}this.href=J}},port:{get:function(){var $=this._url;if($.isAbsolute()&&$.isAuthorityBased()&&$.port!==void 0)return $.port;else return""},set:function($){var J=this.href,Z=new C0(J);if(Z.isAbsolute()&&Z.isAuthorityBased()){if($=""+$,$=$.replace(/[^0-9].*$/,""),$=$.replace(/^0+/,""),$.length===0)$="0";if(parseInt($,10)<=65535)Z.port=$,J=Z.toString()}this.href=J}},pathname:{get:function(){var $=this._url;if($.isAbsolute()&&$.isHierarchical())return $.path;else return""},set:function($){var J=this.href,Z=new C0(J);if(Z.isAbsolute()&&Z.isHierarchical()){if($.charAt(0)!=="/")$="/"+$;$=$.replace(/[^-+\._~!$&'()*,;:=@\/a-zA-Z0-9]/g,C0.percentEncode),Z.path=$,J=Z.toString()}this.href=J}},search:{get:function(){var $=this._url;if($.isAbsolute()&&$.isHierarchical()&&$.query!==void 0)return"?"+$.query;else return""},set:function($){var J=this.href,Z=new C0(J);if(Z.isAbsolute()&&Z.isHierarchical()){if($.charAt(0)==="?")$=$.substring(1);$=$.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g,C0.percentEncode),Z.query=$,J=Z.toString()}this.href=J}},hash:{get:function(){var $=this._url;if($==null||$.fragment==null||$.fragment==="")return"";else return"#"+$.fragment},set:function($){var J=this.href,Z=new C0(J);if($.charAt(0)==="#")$=$.substring(1);$=$.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g,C0.percentEncode),Z.fragment=$,J=Z.toString(),this.href=J}},username:{get:function(){var $=this._url;return $.username||""},set:function($){var J=this.href,Z=new C0(J);if(Z.isAbsolute())$=$.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\:]/g,C0.percentEncode),Z.username=$,J=Z.toString();this.href=J}},password:{get:function(){var $=this._url;return $.password||""},set:function($){var J=this.href,Z=new C0(J);if(Z.isAbsolute()){if($==="")Z.password=null;else $=$.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\]/g,C0.percentEncode),Z.password=$;J=Z.toString()}this.href=J}},origin:{get:function(){var $=this._url;if($==null)return"";var J=function(Z){var Y=[$.scheme,$.host,+$.port||Z];return Y[0]+"://"+Y[1]+(Y[2]===Z?"":":"+Y[2])};switch($.scheme){case"ftp":return J(21);case"gopher":return J(70);case"http":case"ws":return J(80);case"https":case"wss":return J(443);default:return $.scheme+"://"}}}});v8._inherit=function($){Object.getOwnPropertyNames(v8.prototype).forEach(function(J){if(J==="constructor"||J==="href")return;var Z=Object.getOwnPropertyDescriptor(v8.prototype,J);Object.defineProperty($,J,Z)})}});var iY=p((tb,Jj)=>{var e5=_Y(),JP=hZ().isApiWritable;Jj.exports=function($,J,Z,Y){var K=$.ctor;if(K){var Q=$.props||{};if($.attributes)for(var V in $.attributes){var X=$.attributes[V];if(typeof X!=="object"||Array.isArray(X))X={type:X};if(!X.name)X.name=V.toLowerCase();Q[V]=e5.property(X)}if(Q.constructor={value:K,writable:JP},K.prototype=Object.create(($.superclass||J).prototype,Q),$.events)YP(K,$.events);Z[$.name]=K}else K=J;return($.tags||$.tag&&[$.tag]||[]).forEach(function(W){Y[W]=K}),K};function $j($,J,Z,Y){this.body=$,this.document=J,this.form=Z,this.element=Y}$j.prototype.build=function(){return()=>{}};function ZP($,J,Z,Y){var K=$.ownerDocument||Object.create(null),Q=$.form||Object.create(null);$[J]=new $j(Y,K,Q,$).build()}function YP($,J){var Z=$.prototype;J.forEach(function(Y){Object.defineProperty(Z,"on"+Y,{get:function(){return this._getEventHandler(Y)},set:function(K){this._setEventHandler(Y,K)}}),e5.registerChangeHandler($,"on"+Y,ZP)})}});var $6=p((XP)=>{var sY=P0(),Zj=gJ(),KP=tZ(),l0=X0(),Yj=rY(),QP=iY(),i1=XP.elements={},h8=Object.create(null);XP.createElement=function($,J,Z){var Y=h8[J]||GP;return new Y($,J,Z)};function o($){return QP($,K$,i1,h8)}function W0($){return{get:function(){var J=this._getattr($);if(J===null)return"";var Z=this.doc._resolve(J);return Z===null?J:Z},set:function(J){this._setattr($,J)}}}function eZ($){return{get:function(){var J=this._getattr($);if(J===null)return null;if(J.toLowerCase()==="use-credentials")return"use-credentials";return"anonymous"},set:function(J){if(J===null||J===void 0)this.removeAttribute($);else this._setattr($,J)}}}var mJ={type:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],missing:""},VP={A:!0,LINK:!0,BUTTON:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0,COMMAND:!0},F1=function($,J,Z){K$.call(this,$,J,Z),this._form=null},K$=XP.HTMLElement=o({superclass:Zj,name:"HTMLElement",ctor:function(J,Z,Y){Zj.call(this,J,Z,l0.NAMESPACE.HTML,Y)},props:{dangerouslySetInnerHTML:{set:function($){this._innerHTML=$}},innerHTML:{get:function(){return this.serialize()},set:function($){var J=this.ownerDocument.implementation.mozHTMLParser(this.ownerDocument._address,this);J.parse($===null?"":String($),!0);var Z=this instanceof h8.template?this.content:this;while(Z.hasChildNodes())Z.removeChild(Z.firstChild);Z.appendChild(J._asDocumentFragment())}},style:{get:function(){if(!this._style)this._style=new KP(this);return this._style},set:function($){if($===null||$===void 0)$="";this._setattr("style",String($))}},blur:{value:function(){}},focus:{value:function(){}},forceSpellCheck:{value:function(){}},click:{value:function(){if(this._click_in_progress)return;this._click_in_progress=!0;try{if(this._pre_click_activation_steps)this._pre_click_activation_steps();var $=this.ownerDocument.createEvent("MouseEvent");$.initMouseEvent("click",!0,!0,this.ownerDocument.defaultView,1,0,0,0,0,!1,!1,!1,!1,0,null);var J=this.dispatchEvent($);if(J){if(this._post_click_activation_steps)this._post_click_activation_steps($)}else if(this._cancelled_activation_steps)this._cancelled_activation_steps()}finally{this._click_in_progress=!1}}},submit:{value:l0.nyi}},attributes:{title:String,lang:String,dir:{type:["ltr","rtl","auto"],missing:""},draggable:{type:["true","false"],treatNullAsEmptyString:!0},spellcheck:{type:["true","false"],missing:""},enterKeyHint:{type:["enter","done","go","next","previous","search","send"],missing:""},autoCapitalize:{type:["off","on","none","sentences","words","characters"],missing:""},autoFocus:Boolean,accessKey:String,nonce:String,hidden:Boolean,translate:{type:["no","yes"],missing:""},tabIndex:{type:"long",default:function(){if(this.tagName in VP||this.contentEditable)return 0;else return-1}}},events:["abort","canplay","canplaythrough","change","click","contextmenu","cuechange","dblclick","drag","dragend","dragenter","dragleave","dragover","dragstart","drop","durationchange","emptied","ended","input","invalid","keydown","keypress","keyup","loadeddata","loadedmetadata","loadstart","mousedown","mousemove","mouseout","mouseover","mouseup","mousewheel","pause","play","playing","progress","ratechange","readystatechange","reset","seeked","seeking","select","show","stalled","submit","suspend","timeupdate","volumechange","waiting","blur","error","focus","load","scroll"]}),GP=o({name:"HTMLUnknownElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)}}),z1={form:{get:function(){return this._form}}};o({tag:"a",name:"HTMLAnchorElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{_post_click_activation_steps:{value:function($){if(this.href)this.ownerDocument.defaultView.location=this.href}}},attributes:{href:W0,ping:String,download:String,target:String,rel:String,media:String,hreflang:String,type:String,referrerPolicy:mJ,coords:String,charset:String,name:String,rev:String,shape:String}});Yj._inherit(h8.a.prototype);o({tag:"area",name:"HTMLAreaElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{alt:String,target:String,download:String,rel:String,media:String,href:W0,hreflang:String,type:String,shape:String,coords:String,ping:String,referrerPolicy:mJ,noHref:Boolean}});Yj._inherit(h8.area.prototype);o({tag:"br",name:"HTMLBRElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{clear:String}});o({tag:"base",name:"HTMLBaseElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{target:String}});o({tag:"body",name:"HTMLBodyElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},events:["afterprint","beforeprint","beforeunload","blur","error","focus","hashchange","load","message","offline","online","pagehide","pageshow","popstate","resize","scroll","storage","unload"],attributes:{text:{type:String,treatNullAsEmptyString:!0},link:{type:String,treatNullAsEmptyString:!0},vLink:{type:String,treatNullAsEmptyString:!0},aLink:{type:String,treatNullAsEmptyString:!0},bgColor:{type:String,treatNullAsEmptyString:!0},background:String}});o({tag:"button",name:"HTMLButtonElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{name:String,value:String,disabled:Boolean,autofocus:Boolean,type:{type:["submit","reset","button","menu"],missing:"submit"},formTarget:String,formAction:W0,formNoValidate:Boolean,formMethod:{type:["get","post","dialog"],invalid:"get",missing:""},formEnctype:{type:["application/x-www-form-urlencoded","multipart/form-data","text/plain"],invalid:"application/x-www-form-urlencoded",missing:""}}});o({tag:"dl",name:"HTMLDListElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{compact:Boolean}});o({tag:"data",name:"HTMLDataElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{value:String}});o({tag:"datalist",name:"HTMLDataListElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)}});o({tag:"details",name:"HTMLDetailsElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{open:Boolean}});o({tag:"div",name:"HTMLDivElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{align:String}});o({tag:"embed",name:"HTMLEmbedElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{src:W0,type:String,width:String,height:String,align:String,name:String}});o({tag:"fieldset",name:"HTMLFieldSetElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{disabled:Boolean,name:String}});o({tag:"form",name:"HTMLFormElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{action:String,autocomplete:{type:["on","off"],missing:"on"},name:String,acceptCharset:{name:"accept-charset"},target:String,noValidate:Boolean,method:{type:["get","post","dialog"],invalid:"get",missing:"get"},enctype:{type:["application/x-www-form-urlencoded","multipart/form-data","text/plain"],invalid:"application/x-www-form-urlencoded",missing:"application/x-www-form-urlencoded"},encoding:{name:"enctype",type:["application/x-www-form-urlencoded","multipart/form-data","text/plain"],invalid:"application/x-www-form-urlencoded",missing:"application/x-www-form-urlencoded"}}});o({tag:"hr",name:"HTMLHRElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{align:String,color:String,noShade:Boolean,size:String,width:String}});o({tag:"head",name:"HTMLHeadElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)}});o({tags:["h1","h2","h3","h4","h5","h6"],name:"HTMLHeadingElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{align:String}});o({tag:"html",name:"HTMLHtmlElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{xmlns:W0,version:String}});o({tag:"iframe",name:"HTMLIFrameElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{src:W0,srcdoc:String,name:String,width:String,height:String,seamless:Boolean,allow:Boolean,allowFullscreen:Boolean,allowUserMedia:Boolean,allowPaymentRequest:Boolean,referrerPolicy:mJ,loading:{type:["eager","lazy"],treatNullAsEmptyString:!0},align:String,scrolling:String,frameBorder:String,longDesc:W0,marginHeight:{type:String,treatNullAsEmptyString:!0},marginWidth:{type:String,treatNullAsEmptyString:!0}}});o({tag:"img",name:"HTMLImageElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{alt:String,src:W0,srcset:String,crossOrigin:eZ,useMap:String,isMap:Boolean,sizes:String,height:{type:"unsigned long",default:0},width:{type:"unsigned long",default:0},referrerPolicy:mJ,loading:{type:["eager","lazy"],missing:""},name:String,lowsrc:W0,align:String,hspace:{type:"unsigned long",default:0},vspace:{type:"unsigned long",default:0},longDesc:W0,border:{type:String,treatNullAsEmptyString:!0}}});o({tag:"input",name:"HTMLInputElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:{form:z1.form,_post_click_activation_steps:{value:function($){if(this.type==="checkbox")this.checked=!this.checked;else if(this.type==="radio"){var J=this.form.getElementsByName(this.name);for(var Z=J.length-1;Z>=0;Z--){var Y=J[Z];Y.checked=Y===this}}}}},attributes:{name:String,disabled:Boolean,autofocus:Boolean,accept:String,alt:String,max:String,min:String,pattern:String,placeholder:String,step:String,dirName:String,defaultValue:{name:"value"},multiple:Boolean,required:Boolean,readOnly:Boolean,checked:Boolean,value:String,src:W0,defaultChecked:{name:"checked",type:Boolean},size:{type:"unsigned long",default:20,min:1,setmin:1},width:{type:"unsigned long",min:0,setmin:0,default:0},height:{type:"unsigned long",min:0,setmin:0,default:0},minLength:{type:"unsigned long",min:0,setmin:0,default:-1},maxLength:{type:"unsigned long",min:0,setmin:0,default:-1},autocomplete:String,type:{type:["text","hidden","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"],missing:"text"},formTarget:String,formNoValidate:Boolean,formMethod:{type:["get","post"],invalid:"get",missing:""},formEnctype:{type:["application/x-www-form-urlencoded","multipart/form-data","text/plain"],invalid:"application/x-www-form-urlencoded",missing:""},inputMode:{type:["verbatim","latin","latin-name","latin-prose","full-width-latin","kana","kana-name","katakana","numeric","tel","email","url"],missing:""},align:String,useMap:String}});o({tag:"keygen",name:"HTMLKeygenElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{name:String,disabled:Boolean,autofocus:Boolean,challenge:String,keytype:{type:["rsa"],missing:""}}});o({tag:"li",name:"HTMLLIElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{value:{type:"long",default:0},type:String}});o({tag:"label",name:"HTMLLabelElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{htmlFor:{name:"for",type:String}}});o({tag:"legend",name:"HTMLLegendElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{align:String}});o({tag:"link",name:"HTMLLinkElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{href:W0,rel:String,media:String,hreflang:String,type:String,crossOrigin:eZ,nonce:String,integrity:String,referrerPolicy:mJ,imageSizes:String,imageSrcset:String,charset:String,rev:String,target:String}});o({tag:"map",name:"HTMLMapElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{name:String}});o({tag:"menu",name:"HTMLMenuElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{type:{type:["context","popup","toolbar"],missing:"toolbar"},label:String,compact:Boolean}});o({tag:"meta",name:"HTMLMetaElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{name:String,content:String,httpEquiv:{name:"http-equiv",type:String},scheme:String}});o({tag:"meter",name:"HTMLMeterElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1});o({tags:["ins","del"],name:"HTMLModElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{cite:W0,dateTime:String}});o({tag:"ol",name:"HTMLOListElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{_numitems:{get:function(){var $=0;return this.childNodes.forEach(function(J){if(J.nodeType===sY.ELEMENT_NODE&&J.tagName==="LI")$++}),$}}},attributes:{type:String,reversed:Boolean,start:{type:"long",default:function(){if(this.reversed)return this._numitems;else return 1}},compact:Boolean}});o({tag:"object",name:"HTMLObjectElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{data:W0,type:String,name:String,useMap:String,typeMustMatch:Boolean,width:String,height:String,align:String,archive:String,code:String,declare:Boolean,hspace:{type:"unsigned long",default:0},standby:String,vspace:{type:"unsigned long",default:0},codeBase:W0,codeType:String,border:{type:String,treatNullAsEmptyString:!0}}});o({tag:"optgroup",name:"HTMLOptGroupElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{disabled:Boolean,label:String}});o({tag:"option",name:"HTMLOptionElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{form:{get:function(){var $=this.parentNode;while($&&$.nodeType===sY.ELEMENT_NODE){if($.localName==="select")return $.form;$=$.parentNode}}},value:{get:function(){return this._getattr("value")||this.text},set:function($){this._setattr("value",$)}},text:{get:function(){return this.textContent.replace(/[ \t\n\f\r]+/g," ").trim()},set:function($){this.textContent=$}}},attributes:{disabled:Boolean,defaultSelected:{name:"selected",type:Boolean},label:String}});o({tag:"output",name:"HTMLOutputElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{name:String}});o({tag:"p",name:"HTMLParagraphElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{align:String}});o({tag:"param",name:"HTMLParamElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{name:String,value:String,type:String,valueType:String}});o({tags:["pre","listing","xmp"],name:"HTMLPreElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{width:{type:"long",default:0}}});o({tag:"progress",name:"HTMLProgressElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{max:{type:Number,float:!0,default:1,min:0}}});o({tags:["q","blockquote"],name:"HTMLQuoteElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{cite:W0}});o({tag:"script",name:"HTMLScriptElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{text:{get:function(){var $="";for(var J=0,Z=this.childNodes.length;J<Z;J++){var Y=this.childNodes[J];if(Y.nodeType===sY.TEXT_NODE)$+=Y._data}return $},set:function($){if(this.removeChildren(),$!==null&&$!=="")this.appendChild(this.ownerDocument.createTextNode($))}}},attributes:{src:W0,type:String,charset:String,referrerPolicy:mJ,defer:Boolean,async:Boolean,nomodule:Boolean,crossOrigin:eZ,nonce:String,integrity:String}});o({tag:"select",name:"HTMLSelectElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:{form:z1.form,options:{get:function(){return this.getElementsByTagName("option")}}},attributes:{autocomplete:String,name:String,disabled:Boolean,autofocus:Boolean,multiple:Boolean,required:Boolean,size:{type:"unsigned long",default:0}}});o({tag:"span",name:"HTMLSpanElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)}});o({tag:"style",name:"HTMLStyleElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{media:String,type:String,scoped:Boolean}});o({tag:"caption",name:"HTMLTableCaptionElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{align:String}});o({name:"HTMLTableCellElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{colSpan:{type:"unsigned long",default:1},rowSpan:{type:"unsigned long",default:1},scope:{type:["row","col","rowgroup","colgroup"],missing:""},abbr:String,align:String,axis:String,height:String,width:String,ch:{name:"char",type:String},chOff:{name:"charoff",type:String},noWrap:Boolean,vAlign:String,bgColor:{type:String,treatNullAsEmptyString:!0}}});o({tags:["col","colgroup"],name:"HTMLTableColElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{span:{type:"limited unsigned long with fallback",default:1,min:1},align:String,ch:{name:"char",type:String},chOff:{name:"charoff",type:String},vAlign:String,width:String}});o({tag:"table",name:"HTMLTableElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{rows:{get:function(){return this.getElementsByTagName("tr")}}},attributes:{align:String,border:String,frame:String,rules:String,summary:String,width:String,bgColor:{type:String,treatNullAsEmptyString:!0},cellPadding:{type:String,treatNullAsEmptyString:!0},cellSpacing:{type:String,treatNullAsEmptyString:!0}}});o({tag:"template",name:"HTMLTemplateElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y),this._contentFragment=J._templateDoc.createDocumentFragment()},props:{content:{get:function(){return this._contentFragment}},serialize:{value:function(){return this.content.serialize()}}}});o({tag:"tr",name:"HTMLTableRowElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{cells:{get:function(){return this.querySelectorAll("td,th")}}},attributes:{align:String,ch:{name:"char",type:String},chOff:{name:"charoff",type:String},vAlign:String,bgColor:{type:String,treatNullAsEmptyString:!0}}});o({tags:["thead","tfoot","tbody"],name:"HTMLTableSectionElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{rows:{get:function(){return this.getElementsByTagName("tr")}}},attributes:{align:String,ch:{name:"char",type:String},chOff:{name:"charoff",type:String},vAlign:String}});o({tag:"textarea",name:"HTMLTextAreaElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:{form:z1.form,type:{get:function(){return"textarea"}},defaultValue:{get:function(){return this.textContent},set:function($){this.textContent=$}},value:{get:function(){return this.defaultValue},set:function($){this.defaultValue=$}},textLength:{get:function(){return this.value.length}}},attributes:{autocomplete:String,name:String,disabled:Boolean,autofocus:Boolean,placeholder:String,wrap:String,dirName:String,required:Boolean,readOnly:Boolean,rows:{type:"limited unsigned long with fallback",default:2},cols:{type:"limited unsigned long with fallback",default:20},maxLength:{type:"unsigned long",min:0,setmin:0,default:-1},minLength:{type:"unsigned long",min:0,setmin:0,default:-1},inputMode:{type:["verbatim","latin","latin-name","latin-prose","full-width-latin","kana","kana-name","katakana","numeric","tel","email","url"],missing:""}}});o({tag:"time",name:"HTMLTimeElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{dateTime:String,pubDate:Boolean}});o({tag:"title",name:"HTMLTitleElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{text:{get:function(){return this.textContent}}}});o({tag:"ul",name:"HTMLUListElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{type:String,compact:Boolean}});o({name:"HTMLMediaElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{src:W0,crossOrigin:eZ,preload:{type:["metadata","none","auto",{value:"",alias:"auto"}],missing:"auto"},loop:Boolean,autoplay:Boolean,mediaGroup:String,controls:Boolean,defaultMuted:{name:"muted",type:Boolean}}});o({name:"HTMLAudioElement",tag:"audio",superclass:i1.HTMLMediaElement,ctor:function(J,Z,Y){i1.HTMLMediaElement.call(this,J,Z,Y)}});o({name:"HTMLVideoElement",tag:"video",superclass:i1.HTMLMediaElement,ctor:function(J,Z,Y){i1.HTMLMediaElement.call(this,J,Z,Y)},attributes:{poster:W0,width:{type:"unsigned long",min:0,default:0},height:{type:"unsigned long",min:0,default:0}}});o({tag:"td",name:"HTMLTableDataCellElement",superclass:i1.HTMLTableCellElement,ctor:function(J,Z,Y){i1.HTMLTableCellElement.call(this,J,Z,Y)}});o({tag:"th",name:"HTMLTableHeaderCellElement",superclass:i1.HTMLTableCellElement,ctor:function(J,Z,Y){i1.HTMLTableCellElement.call(this,J,Z,Y)}});o({tag:"frameset",name:"HTMLFrameSetElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)}});o({tag:"frame",name:"HTMLFrameElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)}});o({tag:"canvas",name:"HTMLCanvasElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{getContext:{value:l0.nyi},probablySupportsContext:{value:l0.nyi},setContext:{value:l0.nyi},transferControlToProxy:{value:l0.nyi},toDataURL:{value:l0.nyi},toBlob:{value:l0.nyi}},attributes:{width:{type:"unsigned long",default:300},height:{type:"unsigned long",default:150}}});o({tag:"dialog",name:"HTMLDialogElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{show:{value:l0.nyi},showModal:{value:l0.nyi},close:{value:l0.nyi}},attributes:{open:Boolean,returnValue:String}});o({tag:"menuitem",name:"HTMLMenuItemElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{_label:{get:function(){var $=this._getattr("label");if($!==null&&$!=="")return $;return $=this.textContent,$.replace(/[ \t\n\f\r]+/g," ").trim()}},label:{get:function(){var $=this._getattr("label");if($!==null)return $;return this._label},set:function($){this._setattr("label",$)}}},attributes:{type:{type:["command","checkbox","radio"],missing:"command"},icon:W0,disabled:Boolean,checked:Boolean,radiogroup:String,default:Boolean}});o({tag:"source",name:"HTMLSourceElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{srcset:String,sizes:String,media:String,src:W0,type:String,width:String,height:String}});o({tag:"track",name:"HTMLTrackElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{src:W0,srclang:String,label:String,default:Boolean,kind:{type:["subtitles","captions","descriptions","chapters","metadata"],missing:"subtitles",invalid:"metadata"}},props:{NONE:{get:function(){return 0}},LOADING:{get:function(){return 1}},LOADED:{get:function(){return 2}},ERROR:{get:function(){return 3}},readyState:{get:l0.nyi},track:{get:l0.nyi}}});o({tag:"font",name:"HTMLFontElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{color:{type:String,treatNullAsEmptyString:!0},face:{type:String},size:{type:String}}});o({tag:"dir",name:"HTMLDirectoryElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{compact:Boolean}});o({tags:["abbr","address","article","aside","b","bdi","bdo","cite","content","code","dd","dfn","dt","em","figcaption","figure","footer","header","hgroup","i","kbd","main","mark","nav","noscript","rb","rp","rt","rtc","ruby","s","samp","section","small","strong","sub","summary","sup","u","var","wbr","acronym","basefont","big","center","nobr","noembed","noframes","plaintext","strike","tt"]})});var tY=p((_P)=>{var Kj=gJ(),jP=iY(),UP=X0(),BP=tZ(),HP=_P.elements={},Qj=Object.create(null);_P.createElement=function($,J,Z){var Y=Qj[J]||aY;return new Y($,J,Z)};function nY($){return jP($,aY,HP,Qj)}var aY=nY({superclass:Kj,name:"SVGElement",ctor:function(J,Z,Y){Kj.call(this,J,Z,UP.NAMESPACE.SVG,Y)},props:{style:{get:function(){if(!this._style)this._style=new BP(this);return this._style}}}});nY({name:"SVGSVGElement",ctor:function(J,Z,Y){aY.call(this,J,Z,Y)},tag:"svg",props:{createSVGRect:{value:function(){return _P.createElement(this.ownerDocument,"rect",null)}}}});nY({tags:["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"]})});var Xj=p((Kv,Gj)=>{Gj.exports={VALUE:1,ATTR:2,REMOVE_ATTR:3,REMOVE:4,MOVE:5,INSERT:6}});var Z6=p((Qv,zj)=>{zj.exports=f8;var L0=P0(),OP=n2(),_j=mZ(),q2=gJ(),qP=TY(),FP=EY(),g8=TJ(),zP=bY(),CP=hY(),MP=m8(),DP=T5(),PP=h5(),Wj=b8(),jj=aZ(),Uj=lZ(),IP=oY(),J6=uZ(),eY=$6(),AP=tY(),v$=X0(),uJ=Xj(),pJ=v$.NAMESPACE,$3=hZ().isApiWritable;function f8($,J){_j.call(this),this.nodeType=L0.DOCUMENT_NODE,this.isHTML=$,this._address=J||"about:blank",this.readyState="loading",this.implementation=new MP(this),this.ownerDocument=null,this._contentType=$?"text/html":"application/xml",this.doctype=null,this.documentElement=null,this._templateDocCache=null,this._nodeIterators=null,this._nid=1,this._nextnid=2,this._nodes=[null,this],this.byId=Object.create(null),this.modclock=0}var SP={event:"Event",customevent:"CustomEvent",uievent:"UIEvent",mouseevent:"MouseEvent"},wP={events:"event",htmlevents:"event",mouseevents:"mouseevent",mutationevents:"mutationevent",uievents:"uievent"},dJ=function($,J,Z){return{get:function(){var Y=$.call(this);if(Y)return Y[J];return Z},set:function(Y){var K=$.call(this);if(K)K[J]=Y}}};function Bj($,J){var Z,Y,K;if($==="")$=null;if(!J6.isValidQName(J))v$.InvalidCharacterError();if(Z=null,Y=J,K=J.indexOf(":"),K>=0)Z=J.substring(0,K),Y=J.substring(K+1);if(Z!==null&&$===null)v$.NamespaceError();if(Z==="xml"&&$!==pJ.XML)v$.NamespaceError();if((Z==="xmlns"||J==="xmlns")&&$!==pJ.XMLNS)v$.NamespaceError();if($===pJ.XMLNS&&!(Z==="xmlns"||J==="xmlns"))v$.NamespaceError();return{namespace:$,prefix:Z,localName:Y}}f8.prototype=Object.create(_j.prototype,{_setMutationHandler:{value:function($){this.mutationHandler=$}},_dispatchRendererEvent:{value:function($,J,Z){var Y=this._nodes[$];if(!Y)return;Y._dispatchEvent(new g8(J,Z),!0)}},nodeName:{value:"#document"},nodeValue:{get:function(){return null},set:function(){}},documentURI:{get:function(){return this._address},set:v$.nyi},compatMode:{get:function(){return this._quirks?"BackCompat":"CSS1Compat"}},createTextNode:{value:function($){return new qP(this,String($))}},createComment:{value:function($){return new FP(this,$)}},createDocumentFragment:{value:function(){return new zP(this)}},createProcessingInstruction:{value:function($,J){if(!J6.isValidName($)||J.indexOf("?>")!==-1)v$.InvalidCharacterError();return new CP(this,$,J)}},createAttribute:{value:function($){if($=String($),!J6.isValidName($))v$.InvalidCharacterError();if(this.isHTML)$=v$.toASCIILowerCase($);return new q2._Attr(null,$,null,null,"")}},createAttributeNS:{value:function($,J){$=$===null||$===void 0||$===""?null:String($),J=String(J);var Z=Bj($,J);return new q2._Attr(null,Z.localName,Z.prefix,Z.namespace,"")}},createElement:{value:function($){if($=String($),!J6.isValidName($))v$.InvalidCharacterError();if(this.isHTML){if(/[A-Z]/.test($))$=v$.toASCIILowerCase($);return eY.createElement(this,$,null)}else if(this.contentType==="application/xhtml+xml")return eY.createElement(this,$,null);else return new q2(this,$,null,null)},writable:$3},createElementNS:{value:function($,J){$=$===null||$===void 0||$===""?null:String($),J=String(J);var Z=Bj($,J);return this._createElementNS(Z.localName,Z.namespace,Z.prefix)},writable:$3},_createElementNS:{value:function($,J,Z){if(J===pJ.HTML)return eY.createElement(this,$,Z);else if(J===pJ.SVG)return AP.createElement(this,$,Z);return new q2(this,$,J,Z)}},createEvent:{value:function(J){J=J.toLowerCase();var Z=wP[J]||J,Y=IP[SP[Z]];if(Y){var K=new Y;return K._initialized=!1,K}else v$.NotSupportedError()}},createTreeWalker:{value:function($,J,Z){if(!$)throw TypeError("root argument is required");if(!($ instanceof L0))throw TypeError("root not a node");return J=J===void 0?Wj.SHOW_ALL:+J,Z=Z===void 0?null:Z,new DP($,J,Z)}},createNodeIterator:{value:function($,J,Z){if(!$)throw TypeError("root argument is required");if(!($ instanceof L0))throw TypeError("root not a node");return J=J===void 0?Wj.SHOW_ALL:+J,Z=Z===void 0?null:Z,new PP($,J,Z)}},_attachNodeIterator:{value:function($){if(!this._nodeIterators)this._nodeIterators=[];this._nodeIterators.push($)}},_detachNodeIterator:{value:function($){var J=this._nodeIterators.indexOf($);this._nodeIterators.splice(J,1)}},_preremoveNodeIterators:{value:function($){if(this._nodeIterators)this._nodeIterators.forEach(function(J){J._preremove($)})}},_updateDocTypeElement:{value:function(){this.doctype=this.documentElement=null;for(var J=this.firstChild;J!==null;J=J.nextSibling)if(J.nodeType===L0.DOCUMENT_TYPE_NODE)this.doctype=J;else if(J.nodeType===L0.ELEMENT_NODE)this.documentElement=J}},insertBefore:{value:function(J,Z){return L0.prototype.insertBefore.call(this,J,Z),this._updateDocTypeElement(),J}},replaceChild:{value:function(J,Z){return L0.prototype.replaceChild.call(this,J,Z),this._updateDocTypeElement(),Z}},removeChild:{value:function(J){return L0.prototype.removeChild.call(this,J),this._updateDocTypeElement(),J}},getElementById:{value:function($){var J=this.byId[$];if(!J)return null;if(J instanceof s1)return J.getFirst();return J}},_hasMultipleElementsWithId:{value:function($){return this.byId[$]instanceof s1}},getElementsByName:{value:q2.prototype.getElementsByName},getElementsByTagName:{value:q2.prototype.getElementsByTagName},getElementsByTagNameNS:{value:q2.prototype.getElementsByTagNameNS},getElementsByClassName:{value:q2.prototype.getElementsByClassName},adoptNode:{value:function(J){if(J.nodeType===L0.DOCUMENT_NODE)v$.NotSupportedError();if(J.nodeType===L0.ATTRIBUTE_NODE)return J;if(J.parentNode)J.parentNode.removeChild(J);if(J.ownerDocument!==this)Fj(J,this);return J}},importNode:{value:function(J,Z){return this.adoptNode(J.cloneNode(Z))},writable:$3},origin:{get:function(){return null}},characterSet:{get:function(){return"UTF-8"}},contentType:{get:function(){return this._contentType}},URL:{get:function(){return this._address}},domain:{get:v$.nyi,set:v$.nyi},referrer:{get:v$.nyi},cookie:{get:v$.nyi,set:v$.nyi},lastModified:{get:v$.nyi},location:{get:function(){return this.defaultView?this.defaultView.location:null},set:v$.nyi},_titleElement:{get:function(){return this.getElementsByTagName("title").item(0)||null}},title:{get:function(){var $=this._titleElement,J=$?$.textContent:"";return J.replace(/[ \t\n\r\f]+/g," ").replace(/(^ )|( $)/g,"")},set:function($){var J=this._titleElement,Z=this.head;if(!J&&!Z)return;if(!J)J=this.createElement("title"),Z.appendChild(J);J.textContent=$}},dir:dJ(function(){var $=this.documentElement;if($&&$.tagName==="HTML")return $},"dir",""),fgColor:dJ(function(){return this.body},"text",""),linkColor:dJ(function(){return this.body},"link",""),vlinkColor:dJ(function(){return this.body},"vLink",""),alinkColor:dJ(function(){return this.body},"aLink",""),bgColor:dJ(function(){return this.body},"bgColor",""),charset:{get:function(){return this.characterSet}},inputEncoding:{get:function(){return this.characterSet}},scrollingElement:{get:function(){return this._quirks?this.body:this.documentElement}},body:{get:function(){return Hj(this.documentElement,"body")},set:v$.nyi},head:{get:function(){return Hj(this.documentElement,"head")}},images:{get:v$.nyi},embeds:{get:v$.nyi},plugins:{get:v$.nyi},links:{get:v$.nyi},forms:{get:v$.nyi},scripts:{get:v$.nyi},applets:{get:function(){return[]}},activeElement:{get:function(){return null}},innerHTML:{get:function(){return this.serialize()},set:v$.nyi},outerHTML:{get:function(){return this.serialize()},set:v$.nyi},write:{value:function($){if(!this.isHTML)v$.InvalidStateError();if(!this._parser)return;if(!this._parser);var J=arguments.join("");this._parser.parse(J)}},writeln:{value:function(J){this.write(Array.prototype.join.call(arguments,"")+`
32
- `)}},open:{value:function(){this.documentElement=null}},close:{value:function(){if(this.readyState="interactive",this._dispatchEvent(new g8("readystatechange"),!0),this._dispatchEvent(new g8("DOMContentLoaded"),!0),this.readyState="complete",this._dispatchEvent(new g8("readystatechange"),!0),this.defaultView)this.defaultView._dispatchEvent(new g8("load"),!0)}},clone:{value:function(){var J=new f8(this.isHTML,this._address);return J._quirks=this._quirks,J._contentType=this._contentType,J}},cloneNode:{value:function(J){var Z=L0.prototype.cloneNode.call(this,!1);if(J)for(var Y=this.firstChild;Y!==null;Y=Y.nextSibling)Z._appendChild(Z.importNode(Y,!0));return Z._updateDocTypeElement(),Z}},isEqual:{value:function(J){return!0}},mutateValue:{value:function($){if(this.mutationHandler)this.mutationHandler({type:uJ.VALUE,target:$,data:$.data})}},mutateAttr:{value:function($,J){if(this.mutationHandler)this.mutationHandler({type:uJ.ATTR,target:$.ownerElement,attr:$})}},mutateRemoveAttr:{value:function($){if(this.mutationHandler)this.mutationHandler({type:uJ.REMOVE_ATTR,target:$.ownerElement,attr:$})}},mutateRemove:{value:function($){if(this.mutationHandler)this.mutationHandler({type:uJ.REMOVE,target:$.parentNode,node:$});qj($)}},mutateInsert:{value:function($){if(Oj($),this.mutationHandler)this.mutationHandler({type:uJ.INSERT,target:$.parentNode,node:$})}},mutateMove:{value:function($){if(this.mutationHandler)this.mutationHandler({type:uJ.MOVE,target:$})}},addId:{value:function(J,Z){var Y=this.byId[J];if(!Y)this.byId[J]=Z;else{if(!(Y instanceof s1))Y=new s1(Y),this.byId[J]=Y;Y.add(Z)}}},delId:{value:function(J,Z){var Y=this.byId[J];if(v$.assert(Y),Y instanceof s1){if(Y.del(Z),Y.length===1)this.byId[J]=Y.downgrade()}else this.byId[J]=void 0}},_resolve:{value:function($){return new jj(this._documentBaseURL).resolve($)}},_documentBaseURL:{get:function(){var $=this._address;if($==="about:blank")$="/";var J=this.querySelector("base[href]");if(J)return new jj($).resolve(J.getAttribute("href"));return $}},_templateDoc:{get:function(){if(!this._templateDocCache){var $=new f8(this.isHTML,this._address);this._templateDocCache=$._templateDocCache=$}return this._templateDocCache}},querySelector:{value:function($){return Uj($,this)[0]}},querySelectorAll:{value:function($){var J=Uj($,this);return J.item?J:new OP(J)}}});var RP=["abort","canplay","canplaythrough","change","click","contextmenu","cuechange","dblclick","drag","dragend","dragenter","dragleave","dragover","dragstart","drop","durationchange","emptied","ended","input","invalid","keydown","keypress","keyup","loadeddata","loadedmetadata","loadstart","mousedown","mousemove","mouseout","mouseover","mouseup","mousewheel","pause","play","playing","progress","ratechange","readystatechange","reset","seeked","seeking","select","show","stalled","submit","suspend","timeupdate","volumechange","waiting","blur","error","focus","load","scroll"];RP.forEach(function($){Object.defineProperty(f8.prototype,"on"+$,{get:function(){return this._getEventHandler($)},set:function(J){this._setEventHandler($,J)}})});function Hj($,J){if($&&$.isHTML){for(var Z=$.firstChild;Z!==null;Z=Z.nextSibling)if(Z.nodeType===L0.ELEMENT_NODE&&Z.localName===J&&Z.namespaceURI===pJ.HTML)return Z}return null}function LP($){if($._nid=$.ownerDocument._nextnid++,$.ownerDocument._nodes[$._nid]=$,$.nodeType===L0.ELEMENT_NODE){var J=$.getAttribute("id");if(J)$.ownerDocument.addId(J,$);if($._roothook)$._roothook()}}function NP($){if($.nodeType===L0.ELEMENT_NODE){var J=$.getAttribute("id");if(J)$.ownerDocument.delId(J,$)}$.ownerDocument._nodes[$._nid]=void 0,$._nid=void 0}function Oj($){if(LP($),$.nodeType===L0.ELEMENT_NODE)for(var J=$.firstChild;J!==null;J=J.nextSibling)Oj(J)}function qj($){NP($);for(var J=$.firstChild;J!==null;J=J.nextSibling)qj(J)}function Fj($,J){if($.ownerDocument=J,$._lastModTime=void 0,Object.prototype.hasOwnProperty.call($,"_tagName"))$._tagName=void 0;for(var Z=$.firstChild;Z!==null;Z=Z.nextSibling)Fj(Z,J)}function s1($){this.nodes=Object.create(null),this.nodes[$._nid]=$,this.length=1,this.firstNode=void 0}s1.prototype.add=function($){if(!this.nodes[$._nid])this.nodes[$._nid]=$,this.length++,this.firstNode=void 0};s1.prototype.del=function($){if(this.nodes[$._nid])delete this.nodes[$._nid],this.length--,this.firstNode=void 0};s1.prototype.getFirst=function(){if(!this.firstNode){var $;for($ in this.nodes)if(this.firstNode===void 0||this.firstNode.compareDocumentPosition(this.nodes[$])&L0.DOCUMENT_POSITION_PRECEDING)this.firstNode=this.nodes[$]}return this.firstNode};s1.prototype.downgrade=function(){if(this.length===1){var $;for($ in this.nodes)return this.nodes[$]}return this}});var K6=p((Vv,Mj)=>{Mj.exports=Y6;var yP=P0(),Cj=NY(),TP=oZ();function Y6($,J,Z,Y){Cj.call(this),this.nodeType=yP.DOCUMENT_TYPE_NODE,this.ownerDocument=$||null,this.name=J,this.publicId=Z||"",this.systemId=Y||""}Y6.prototype=Object.create(Cj.prototype,{nodeName:{get:function(){return this.name}},nodeValue:{get:function(){return null},set:function(){}},clone:{value:function(){return new Y6(this.ownerDocument,this.name,this.publicId,this.systemId)}},isEqual:{value:function(J){return this.name===J.name&&this.publicId===J.publicId&&this.systemId===J.systemId}}});Object.defineProperties(Y6.prototype,TP)});var U6=p((Gv,pj)=>{pj.exports=b$;var kP=Z6(),EP=K6(),J3=P0(),X$=X0().NAMESPACE,bj=$6(),u$=bj.elements,t2=Function.prototype.apply.bind(Array.prototype.push),Q6=-1,cJ=1,N0=2,N$=3,y1=4,xP=5,bP=[],vP=/^HTML$|^-\/\/W3O\/\/DTD W3 HTML Strict 3\.0\/\/EN\/\/$|^-\/W3C\/DTD HTML 4\.0 Transitional\/EN$|^\+\/\/Silmaril\/\/dtd html Pro v0r11 19970101\/\/|^-\/\/AdvaSoft Ltd\/\/DTD HTML 3\.0 asWedit \+ extensions\/\/|^-\/\/AS\/\/DTD HTML 3\.0 asWedit \+ extensions\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Level 1\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Level 2\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Strict Level 1\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Strict Level 2\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Strict\/\/|^-\/\/IETF\/\/DTD HTML 2\.0\/\/|^-\/\/IETF\/\/DTD HTML 2\.1E\/\/|^-\/\/IETF\/\/DTD HTML 3\.0\/\/|^-\/\/IETF\/\/DTD HTML 3\.2 Final\/\/|^-\/\/IETF\/\/DTD HTML 3\.2\/\/|^-\/\/IETF\/\/DTD HTML 3\/\/|^-\/\/IETF\/\/DTD HTML Level 0\/\/|^-\/\/IETF\/\/DTD HTML Level 1\/\/|^-\/\/IETF\/\/DTD HTML Level 2\/\/|^-\/\/IETF\/\/DTD HTML Level 3\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 0\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 1\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 2\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 3\/\/|^-\/\/IETF\/\/DTD HTML Strict\/\/|^-\/\/IETF\/\/DTD HTML\/\/|^-\/\/Metrius\/\/DTD Metrius Presentational\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 2\.0 HTML Strict\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 2\.0 HTML\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 2\.0 Tables\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 3\.0 HTML Strict\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 3\.0 HTML\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 3\.0 Tables\/\/|^-\/\/Netscape Comm\. Corp\.\/\/DTD HTML\/\/|^-\/\/Netscape Comm\. Corp\.\/\/DTD Strict HTML\/\/|^-\/\/O'Reilly and Associates\/\/DTD HTML 2\.0\/\/|^-\/\/O'Reilly and Associates\/\/DTD HTML Extended 1\.0\/\/|^-\/\/O'Reilly and Associates\/\/DTD HTML Extended Relaxed 1\.0\/\/|^-\/\/SoftQuad Software\/\/DTD HoTMetaL PRO 6\.0::19990601::extensions to HTML 4\.0\/\/|^-\/\/SoftQuad\/\/DTD HoTMetaL PRO 4\.0::19971010::extensions to HTML 4\.0\/\/|^-\/\/Spyglass\/\/DTD HTML 2\.0 Extended\/\/|^-\/\/SQ\/\/DTD HTML 2\.0 HoTMetaL \+ extensions\/\/|^-\/\/Sun Microsystems Corp\.\/\/DTD HotJava HTML\/\/|^-\/\/Sun Microsystems Corp\.\/\/DTD HotJava Strict HTML\/\/|^-\/\/W3C\/\/DTD HTML 3 1995-03-24\/\/|^-\/\/W3C\/\/DTD HTML 3\.2 Draft\/\/|^-\/\/W3C\/\/DTD HTML 3\.2 Final\/\/|^-\/\/W3C\/\/DTD HTML 3\.2\/\/|^-\/\/W3C\/\/DTD HTML 3\.2S Draft\/\/|^-\/\/W3C\/\/DTD HTML 4\.0 Frameset\/\/|^-\/\/W3C\/\/DTD HTML 4\.0 Transitional\/\/|^-\/\/W3C\/\/DTD HTML Experimental 19960712\/\/|^-\/\/W3C\/\/DTD HTML Experimental 970421\/\/|^-\/\/W3C\/\/DTD W3 HTML\/\/|^-\/\/W3O\/\/DTD W3 HTML 3\.0\/\/|^-\/\/WebTechs\/\/DTD Mozilla HTML 2\.0\/\/|^-\/\/WebTechs\/\/DTD Mozilla HTML\/\//i,hP="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Dj=/^-\/\/W3C\/\/DTD HTML 4\.01 Frameset\/\/|^-\/\/W3C\/\/DTD HTML 4\.01 Transitional\/\//i,gP=/^-\/\/W3C\/\/DTD XHTML 1\.0 Frameset\/\/|^-\/\/W3C\/\/DTD XHTML 1\.0 Transitional\/\//i,$J=Object.create(null);$J[X$.HTML]={__proto__:null,address:!0,applet:!0,area:!0,article:!0,aside:!0,base:!0,basefont:!0,bgsound:!0,blockquote:!0,body:!0,br:!0,button:!0,caption:!0,center:!0,col:!0,colgroup:!0,dd:!0,details:!0,dir:!0,div:!0,dl:!0,dt:!0,embed:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,frame:!0,frameset:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,head:!0,header:!0,hgroup:!0,hr:!0,html:!0,iframe:!0,img:!0,input:!0,li:!0,link:!0,listing:!0,main:!0,marquee:!0,menu:!0,meta:!0,nav:!0,noembed:!0,noframes:!0,noscript:!0,object:!0,ol:!0,p:!0,param:!0,plaintext:!0,pre:!0,script:!0,section:!0,select:!0,source:!0,style:!0,summary:!0,table:!0,tbody:!0,td:!0,template:!0,textarea:!0,tfoot:!0,th:!0,thead:!0,title:!0,tr:!0,track:!0,ul:!0,wbr:!0,xmp:!0};$J[X$.SVG]={__proto__:null,foreignObject:!0,desc:!0,title:!0};$J[X$.MATHML]={__proto__:null,mi:!0,mo:!0,mn:!0,ms:!0,mtext:!0,"annotation-xml":!0};var K3=Object.create(null);K3[X$.HTML]={__proto__:null,address:!0,div:!0,p:!0};var vj=Object.create(null);vj[X$.HTML]={__proto__:null,dd:!0,dt:!0};var lJ=Object.create(null);lJ[X$.HTML]={__proto__:null,table:!0,thead:!0,tbody:!0,tfoot:!0,tr:!0};var hj=Object.create(null);hj[X$.HTML]={__proto__:null,dd:!0,dt:!0,li:!0,menuitem:!0,optgroup:!0,option:!0,p:!0,rb:!0,rp:!0,rt:!0,rtc:!0};var gj=Object.create(null);gj[X$.HTML]={__proto__:null,caption:!0,colgroup:!0,dd:!0,dt:!0,li:!0,optgroup:!0,option:!0,p:!0,rb:!0,rp:!0,rt:!0,rtc:!0,tbody:!0,td:!0,tfoot:!0,th:!0,thead:!0,tr:!0};var X6=Object.create(null);X6[X$.HTML]={__proto__:null,table:!0,template:!0,html:!0};var W6=Object.create(null);W6[X$.HTML]={__proto__:null,tbody:!0,tfoot:!0,thead:!0,template:!0,html:!0};var Q3=Object.create(null);Q3[X$.HTML]={__proto__:null,tr:!0,template:!0,html:!0};var fj=Object.create(null);fj[X$.HTML]={__proto__:null,button:!0,fieldset:!0,input:!0,keygen:!0,object:!0,output:!0,select:!0,textarea:!0,img:!0};var T1=Object.create(null);T1[X$.HTML]={__proto__:null,applet:!0,caption:!0,html:!0,table:!0,td:!0,th:!0,marquee:!0,object:!0,template:!0};T1[X$.MATHML]={__proto__:null,mi:!0,mo:!0,mn:!0,ms:!0,mtext:!0,"annotation-xml":!0};T1[X$.SVG]={__proto__:null,foreignObject:!0,desc:!0,title:!0};var j6=Object.create(T1);j6[X$.HTML]=Object.create(T1[X$.HTML]);j6[X$.HTML].ol=!0;j6[X$.HTML].ul=!0;var V3=Object.create(T1);V3[X$.HTML]=Object.create(T1[X$.HTML]);V3[X$.HTML].button=!0;var mj=Object.create(null);mj[X$.HTML]={__proto__:null,html:!0,table:!0,template:!0};var fP=Object.create(null);fP[X$.HTML]={__proto__:null,optgroup:!0,option:!0};var uj=Object.create(null);uj[X$.MATHML]={__proto__:null,mi:!0,mo:!0,mn:!0,ms:!0,mtext:!0};var dj=Object.create(null);dj[X$.SVG]={__proto__:null,foreignObject:!0,desc:!0,title:!0};var Pj={__proto__:null,"xlink:actuate":X$.XLINK,"xlink:arcrole":X$.XLINK,"xlink:href":X$.XLINK,"xlink:role":X$.XLINK,"xlink:show":X$.XLINK,"xlink:title":X$.XLINK,"xlink:type":X$.XLINK,"xml:base":X$.XML,"xml:lang":X$.XML,"xml:space":X$.XML,xmlns:X$.XMLNS,"xmlns:xlink":X$.XMLNS},Ij={__proto__:null,attributename:"attributeName",attributetype:"attributeType",basefrequency:"baseFrequency",baseprofile:"baseProfile",calcmode:"calcMode",clippathunits:"clipPathUnits",diffuseconstant:"diffuseConstant",edgemode:"edgeMode",filterunits:"filterUnits",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",limitingconeangle:"limitingConeAngle",markerheight:"markerHeight",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textlength:"textLength",viewbox:"viewBox",viewtarget:"viewTarget",xchannelselector:"xChannelSelector",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan"},Aj={__proto__:null,altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient",textpath:"textPath"},Sj={__proto__:null,0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},mP={__proto__:null,AElig:198,"AElig;":198,AMP:38,"AMP;":38,Aacute:193,"Aacute;":193,"Abreve;":258,Acirc:194,"Acirc;":194,"Acy;":1040,"Afr;":[55349,56580],Agrave:192,"Agrave;":192,"Alpha;":913,"Amacr;":256,"And;":10835,"Aogon;":260,"Aopf;":[55349,56632],"ApplyFunction;":8289,Aring:197,"Aring;":197,"Ascr;":[55349,56476],"Assign;":8788,Atilde:195,"Atilde;":195,Auml:196,"Auml;":196,"Backslash;":8726,"Barv;":10983,"Barwed;":8966,"Bcy;":1041,"Because;":8757,"Bernoullis;":8492,"Beta;":914,"Bfr;":[55349,56581],"Bopf;":[55349,56633],"Breve;":728,"Bscr;":8492,"Bumpeq;":8782,"CHcy;":1063,COPY:169,"COPY;":169,"Cacute;":262,"Cap;":8914,"CapitalDifferentialD;":8517,"Cayleys;":8493,"Ccaron;":268,Ccedil:199,"Ccedil;":199,"Ccirc;":264,"Cconint;":8752,"Cdot;":266,"Cedilla;":184,"CenterDot;":183,"Cfr;":8493,"Chi;":935,"CircleDot;":8857,"CircleMinus;":8854,"CirclePlus;":8853,"CircleTimes;":8855,"ClockwiseContourIntegral;":8754,"CloseCurlyDoubleQuote;":8221,"CloseCurlyQuote;":8217,"Colon;":8759,"Colone;":10868,"Congruent;":8801,"Conint;":8751,"ContourIntegral;":8750,"Copf;":8450,"Coproduct;":8720,"CounterClockwiseContourIntegral;":8755,"Cross;":10799,"Cscr;":[55349,56478],"Cup;":8915,"CupCap;":8781,"DD;":8517,"DDotrahd;":10513,"DJcy;":1026,"DScy;":1029,"DZcy;":1039,"Dagger;":8225,"Darr;":8609,"Dashv;":10980,"Dcaron;":270,"Dcy;":1044,"Del;":8711,"Delta;":916,"Dfr;":[55349,56583],"DiacriticalAcute;":180,"DiacriticalDot;":729,"DiacriticalDoubleAcute;":733,"DiacriticalGrave;":96,"DiacriticalTilde;":732,"Diamond;":8900,"DifferentialD;":8518,"Dopf;":[55349,56635],"Dot;":168,"DotDot;":8412,"DotEqual;":8784,"DoubleContourIntegral;":8751,"DoubleDot;":168,"DoubleDownArrow;":8659,"DoubleLeftArrow;":8656,"DoubleLeftRightArrow;":8660,"DoubleLeftTee;":10980,"DoubleLongLeftArrow;":10232,"DoubleLongLeftRightArrow;":10234,"DoubleLongRightArrow;":10233,"DoubleRightArrow;":8658,"DoubleRightTee;":8872,"DoubleUpArrow;":8657,"DoubleUpDownArrow;":8661,"DoubleVerticalBar;":8741,"DownArrow;":8595,"DownArrowBar;":10515,"DownArrowUpArrow;":8693,"DownBreve;":785,"DownLeftRightVector;":10576,"DownLeftTeeVector;":10590,"DownLeftVector;":8637,"DownLeftVectorBar;":10582,"DownRightTeeVector;":10591,"DownRightVector;":8641,"DownRightVectorBar;":10583,"DownTee;":8868,"DownTeeArrow;":8615,"Downarrow;":8659,"Dscr;":[55349,56479],"Dstrok;":272,"ENG;":330,ETH:208,"ETH;":208,Eacute:201,"Eacute;":201,"Ecaron;":282,Ecirc:202,"Ecirc;":202,"Ecy;":1069,"Edot;":278,"Efr;":[55349,56584],Egrave:200,"Egrave;":200,"Element;":8712,"Emacr;":274,"EmptySmallSquare;":9723,"EmptyVerySmallSquare;":9643,"Eogon;":280,"Eopf;":[55349,56636],"Epsilon;":917,"Equal;":10869,"EqualTilde;":8770,"Equilibrium;":8652,"Escr;":8496,"Esim;":10867,"Eta;":919,Euml:203,"Euml;":203,"Exists;":8707,"ExponentialE;":8519,"Fcy;":1060,"Ffr;":[55349,56585],"FilledSmallSquare;":9724,"FilledVerySmallSquare;":9642,"Fopf;":[55349,56637],"ForAll;":8704,"Fouriertrf;":8497,"Fscr;":8497,"GJcy;":1027,GT:62,"GT;":62,"Gamma;":915,"Gammad;":988,"Gbreve;":286,"Gcedil;":290,"Gcirc;":284,"Gcy;":1043,"Gdot;":288,"Gfr;":[55349,56586],"Gg;":8921,"Gopf;":[55349,56638],"GreaterEqual;":8805,"GreaterEqualLess;":8923,"GreaterFullEqual;":8807,"GreaterGreater;":10914,"GreaterLess;":8823,"GreaterSlantEqual;":10878,"GreaterTilde;":8819,"Gscr;":[55349,56482],"Gt;":8811,"HARDcy;":1066,"Hacek;":711,"Hat;":94,"Hcirc;":292,"Hfr;":8460,"HilbertSpace;":8459,"Hopf;":8461,"HorizontalLine;":9472,"Hscr;":8459,"Hstrok;":294,"HumpDownHump;":8782,"HumpEqual;":8783,"IEcy;":1045,"IJlig;":306,"IOcy;":1025,Iacute:205,"Iacute;":205,Icirc:206,"Icirc;":206,"Icy;":1048,"Idot;":304,"Ifr;":8465,Igrave:204,"Igrave;":204,"Im;":8465,"Imacr;":298,"ImaginaryI;":8520,"Implies;":8658,"Int;":8748,"Integral;":8747,"Intersection;":8898,"InvisibleComma;":8291,"InvisibleTimes;":8290,"Iogon;":302,"Iopf;":[55349,56640],"Iota;":921,"Iscr;":8464,"Itilde;":296,"Iukcy;":1030,Iuml:207,"Iuml;":207,"Jcirc;":308,"Jcy;":1049,"Jfr;":[55349,56589],"Jopf;":[55349,56641],"Jscr;":[55349,56485],"Jsercy;":1032,"Jukcy;":1028,"KHcy;":1061,"KJcy;":1036,"Kappa;":922,"Kcedil;":310,"Kcy;":1050,"Kfr;":[55349,56590],"Kopf;":[55349,56642],"Kscr;":[55349,56486],"LJcy;":1033,LT:60,"LT;":60,"Lacute;":313,"Lambda;":923,"Lang;":10218,"Laplacetrf;":8466,"Larr;":8606,"Lcaron;":317,"Lcedil;":315,"Lcy;":1051,"LeftAngleBracket;":10216,"LeftArrow;":8592,"LeftArrowBar;":8676,"LeftArrowRightArrow;":8646,"LeftCeiling;":8968,"LeftDoubleBracket;":10214,"LeftDownTeeVector;":10593,"LeftDownVector;":8643,"LeftDownVectorBar;":10585,"LeftFloor;":8970,"LeftRightArrow;":8596,"LeftRightVector;":10574,"LeftTee;":8867,"LeftTeeArrow;":8612,"LeftTeeVector;":10586,"LeftTriangle;":8882,"LeftTriangleBar;":10703,"LeftTriangleEqual;":8884,"LeftUpDownVector;":10577,"LeftUpTeeVector;":10592,"LeftUpVector;":8639,"LeftUpVectorBar;":10584,"LeftVector;":8636,"LeftVectorBar;":10578,"Leftarrow;":8656,"Leftrightarrow;":8660,"LessEqualGreater;":8922,"LessFullEqual;":8806,"LessGreater;":8822,"LessLess;":10913,"LessSlantEqual;":10877,"LessTilde;":8818,"Lfr;":[55349,56591],"Ll;":8920,"Lleftarrow;":8666,"Lmidot;":319,"LongLeftArrow;":10229,"LongLeftRightArrow;":10231,"LongRightArrow;":10230,"Longleftarrow;":10232,"Longleftrightarrow;":10234,"Longrightarrow;":10233,"Lopf;":[55349,56643],"LowerLeftArrow;":8601,"LowerRightArrow;":8600,"Lscr;":8466,"Lsh;":8624,"Lstrok;":321,"Lt;":8810,"Map;":10501,"Mcy;":1052,"MediumSpace;":8287,"Mellintrf;":8499,"Mfr;":[55349,56592],"MinusPlus;":8723,"Mopf;":[55349,56644],"Mscr;":8499,"Mu;":924,"NJcy;":1034,"Nacute;":323,"Ncaron;":327,"Ncedil;":325,"Ncy;":1053,"NegativeMediumSpace;":8203,"NegativeThickSpace;":8203,"NegativeThinSpace;":8203,"NegativeVeryThinSpace;":8203,"NestedGreaterGreater;":8811,"NestedLessLess;":8810,"NewLine;":10,"Nfr;":[55349,56593],"NoBreak;":8288,"NonBreakingSpace;":160,"Nopf;":8469,"Not;":10988,"NotCongruent;":8802,"NotCupCap;":8813,"NotDoubleVerticalBar;":8742,"NotElement;":8713,"NotEqual;":8800,"NotEqualTilde;":[8770,824],"NotExists;":8708,"NotGreater;":8815,"NotGreaterEqual;":8817,"NotGreaterFullEqual;":[8807,824],"NotGreaterGreater;":[8811,824],"NotGreaterLess;":8825,"NotGreaterSlantEqual;":[10878,824],"NotGreaterTilde;":8821,"NotHumpDownHump;":[8782,824],"NotHumpEqual;":[8783,824],"NotLeftTriangle;":8938,"NotLeftTriangleBar;":[10703,824],"NotLeftTriangleEqual;":8940,"NotLess;":8814,"NotLessEqual;":8816,"NotLessGreater;":8824,"NotLessLess;":[8810,824],"NotLessSlantEqual;":[10877,824],"NotLessTilde;":8820,"NotNestedGreaterGreater;":[10914,824],"NotNestedLessLess;":[10913,824],"NotPrecedes;":8832,"NotPrecedesEqual;":[10927,824],"NotPrecedesSlantEqual;":8928,"NotReverseElement;":8716,"NotRightTriangle;":8939,"NotRightTriangleBar;":[10704,824],"NotRightTriangleEqual;":8941,"NotSquareSubset;":[8847,824],"NotSquareSubsetEqual;":8930,"NotSquareSuperset;":[8848,824],"NotSquareSupersetEqual;":8931,"NotSubset;":[8834,8402],"NotSubsetEqual;":8840,"NotSucceeds;":8833,"NotSucceedsEqual;":[10928,824],"NotSucceedsSlantEqual;":8929,"NotSucceedsTilde;":[8831,824],"NotSuperset;":[8835,8402],"NotSupersetEqual;":8841,"NotTilde;":8769,"NotTildeEqual;":8772,"NotTildeFullEqual;":8775,"NotTildeTilde;":8777,"NotVerticalBar;":8740,"Nscr;":[55349,56489],Ntilde:209,"Ntilde;":209,"Nu;":925,"OElig;":338,Oacute:211,"Oacute;":211,Ocirc:212,"Ocirc;":212,"Ocy;":1054,"Odblac;":336,"Ofr;":[55349,56594],Ograve:210,"Ograve;":210,"Omacr;":332,"Omega;":937,"Omicron;":927,"Oopf;":[55349,56646],"OpenCurlyDoubleQuote;":8220,"OpenCurlyQuote;":8216,"Or;":10836,"Oscr;":[55349,56490],Oslash:216,"Oslash;":216,Otilde:213,"Otilde;":213,"Otimes;":10807,Ouml:214,"Ouml;":214,"OverBar;":8254,"OverBrace;":9182,"OverBracket;":9140,"OverParenthesis;":9180,"PartialD;":8706,"Pcy;":1055,"Pfr;":[55349,56595],"Phi;":934,"Pi;":928,"PlusMinus;":177,"Poincareplane;":8460,"Popf;":8473,"Pr;":10939,"Precedes;":8826,"PrecedesEqual;":10927,"PrecedesSlantEqual;":8828,"PrecedesTilde;":8830,"Prime;":8243,"Product;":8719,"Proportion;":8759,"Proportional;":8733,"Pscr;":[55349,56491],"Psi;":936,QUOT:34,"QUOT;":34,"Qfr;":[55349,56596],"Qopf;":8474,"Qscr;":[55349,56492],"RBarr;":10512,REG:174,"REG;":174,"Racute;":340,"Rang;":10219,"Rarr;":8608,"Rarrtl;":10518,"Rcaron;":344,"Rcedil;":342,"Rcy;":1056,"Re;":8476,"ReverseElement;":8715,"ReverseEquilibrium;":8651,"ReverseUpEquilibrium;":10607,"Rfr;":8476,"Rho;":929,"RightAngleBracket;":10217,"RightArrow;":8594,"RightArrowBar;":8677,"RightArrowLeftArrow;":8644,"RightCeiling;":8969,"RightDoubleBracket;":10215,"RightDownTeeVector;":10589,"RightDownVector;":8642,"RightDownVectorBar;":10581,"RightFloor;":8971,"RightTee;":8866,"RightTeeArrow;":8614,"RightTeeVector;":10587,"RightTriangle;":8883,"RightTriangleBar;":10704,"RightTriangleEqual;":8885,"RightUpDownVector;":10575,"RightUpTeeVector;":10588,"RightUpVector;":8638,"RightUpVectorBar;":10580,"RightVector;":8640,"RightVectorBar;":10579,"Rightarrow;":8658,"Ropf;":8477,"RoundImplies;":10608,"Rrightarrow;":8667,"Rscr;":8475,"Rsh;":8625,"RuleDelayed;":10740,"SHCHcy;":1065,"SHcy;":1064,"SOFTcy;":1068,"Sacute;":346,"Sc;":10940,"Scaron;":352,"Scedil;":350,"Scirc;":348,"Scy;":1057,"Sfr;":[55349,56598],"ShortDownArrow;":8595,"ShortLeftArrow;":8592,"ShortRightArrow;":8594,"ShortUpArrow;":8593,"Sigma;":931,"SmallCircle;":8728,"Sopf;":[55349,56650],"Sqrt;":8730,"Square;":9633,"SquareIntersection;":8851,"SquareSubset;":8847,"SquareSubsetEqual;":8849,"SquareSuperset;":8848,"SquareSupersetEqual;":8850,"SquareUnion;":8852,"Sscr;":[55349,56494],"Star;":8902,"Sub;":8912,"Subset;":8912,"SubsetEqual;":8838,"Succeeds;":8827,"SucceedsEqual;":10928,"SucceedsSlantEqual;":8829,"SucceedsTilde;":8831,"SuchThat;":8715,"Sum;":8721,"Sup;":8913,"Superset;":8835,"SupersetEqual;":8839,"Supset;":8913,THORN:222,"THORN;":222,"TRADE;":8482,"TSHcy;":1035,"TScy;":1062,"Tab;":9,"Tau;":932,"Tcaron;":356,"Tcedil;":354,"Tcy;":1058,"Tfr;":[55349,56599],"Therefore;":8756,"Theta;":920,"ThickSpace;":[8287,8202],"ThinSpace;":8201,"Tilde;":8764,"TildeEqual;":8771,"TildeFullEqual;":8773,"TildeTilde;":8776,"Topf;":[55349,56651],"TripleDot;":8411,"Tscr;":[55349,56495],"Tstrok;":358,Uacute:218,"Uacute;":218,"Uarr;":8607,"Uarrocir;":10569,"Ubrcy;":1038,"Ubreve;":364,Ucirc:219,"Ucirc;":219,"Ucy;":1059,"Udblac;":368,"Ufr;":[55349,56600],Ugrave:217,"Ugrave;":217,"Umacr;":362,"UnderBar;":95,"UnderBrace;":9183,"UnderBracket;":9141,"UnderParenthesis;":9181,"Union;":8899,"UnionPlus;":8846,"Uogon;":370,"Uopf;":[55349,56652],"UpArrow;":8593,"UpArrowBar;":10514,"UpArrowDownArrow;":8645,"UpDownArrow;":8597,"UpEquilibrium;":10606,"UpTee;":8869,"UpTeeArrow;":8613,"Uparrow;":8657,"Updownarrow;":8661,"UpperLeftArrow;":8598,"UpperRightArrow;":8599,"Upsi;":978,"Upsilon;":933,"Uring;":366,"Uscr;":[55349,56496],"Utilde;":360,Uuml:220,"Uuml;":220,"VDash;":8875,"Vbar;":10987,"Vcy;":1042,"Vdash;":8873,"Vdashl;":10982,"Vee;":8897,"Verbar;":8214,"Vert;":8214,"VerticalBar;":8739,"VerticalLine;":124,"VerticalSeparator;":10072,"VerticalTilde;":8768,"VeryThinSpace;":8202,"Vfr;":[55349,56601],"Vopf;":[55349,56653],"Vscr;":[55349,56497],"Vvdash;":8874,"Wcirc;":372,"Wedge;":8896,"Wfr;":[55349,56602],"Wopf;":[55349,56654],"Wscr;":[55349,56498],"Xfr;":[55349,56603],"Xi;":926,"Xopf;":[55349,56655],"Xscr;":[55349,56499],"YAcy;":1071,"YIcy;":1031,"YUcy;":1070,Yacute:221,"Yacute;":221,"Ycirc;":374,"Ycy;":1067,"Yfr;":[55349,56604],"Yopf;":[55349,56656],"Yscr;":[55349,56500],"Yuml;":376,"ZHcy;":1046,"Zacute;":377,"Zcaron;":381,"Zcy;":1047,"Zdot;":379,"ZeroWidthSpace;":8203,"Zeta;":918,"Zfr;":8488,"Zopf;":8484,"Zscr;":[55349,56501],aacute:225,"aacute;":225,"abreve;":259,"ac;":8766,"acE;":[8766,819],"acd;":8767,acirc:226,"acirc;":226,acute:180,"acute;":180,"acy;":1072,aelig:230,"aelig;":230,"af;":8289,"afr;":[55349,56606],agrave:224,"agrave;":224,"alefsym;":8501,"aleph;":8501,"alpha;":945,"amacr;":257,"amalg;":10815,amp:38,"amp;":38,"and;":8743,"andand;":10837,"andd;":10844,"andslope;":10840,"andv;":10842,"ang;":8736,"ange;":10660,"angle;":8736,"angmsd;":8737,"angmsdaa;":10664,"angmsdab;":10665,"angmsdac;":10666,"angmsdad;":10667,"angmsdae;":10668,"angmsdaf;":10669,"angmsdag;":10670,"angmsdah;":10671,"angrt;":8735,"angrtvb;":8894,"angrtvbd;":10653,"angsph;":8738,"angst;":197,"angzarr;":9084,"aogon;":261,"aopf;":[55349,56658],"ap;":8776,"apE;":10864,"apacir;":10863,"ape;":8778,"apid;":8779,"apos;":39,"approx;":8776,"approxeq;":8778,aring:229,"aring;":229,"ascr;":[55349,56502],"ast;":42,"asymp;":8776,"asympeq;":8781,atilde:227,"atilde;":227,auml:228,"auml;":228,"awconint;":8755,"awint;":10769,"bNot;":10989,"backcong;":8780,"backepsilon;":1014,"backprime;":8245,"backsim;":8765,"backsimeq;":8909,"barvee;":8893,"barwed;":8965,"barwedge;":8965,"bbrk;":9141,"bbrktbrk;":9142,"bcong;":8780,"bcy;":1073,"bdquo;":8222,"becaus;":8757,"because;":8757,"bemptyv;":10672,"bepsi;":1014,"bernou;":8492,"beta;":946,"beth;":8502,"between;":8812,"bfr;":[55349,56607],"bigcap;":8898,"bigcirc;":9711,"bigcup;":8899,"bigodot;":10752,"bigoplus;":10753,"bigotimes;":10754,"bigsqcup;":10758,"bigstar;":9733,"bigtriangledown;":9661,"bigtriangleup;":9651,"biguplus;":10756,"bigvee;":8897,"bigwedge;":8896,"bkarow;":10509,"blacklozenge;":10731,"blacksquare;":9642,"blacktriangle;":9652,"blacktriangledown;":9662,"blacktriangleleft;":9666,"blacktriangleright;":9656,"blank;":9251,"blk12;":9618,"blk14;":9617,"blk34;":9619,"block;":9608,"bne;":[61,8421],"bnequiv;":[8801,8421],"bnot;":8976,"bopf;":[55349,56659],"bot;":8869,"bottom;":8869,"bowtie;":8904,"boxDL;":9559,"boxDR;":9556,"boxDl;":9558,"boxDr;":9555,"boxH;":9552,"boxHD;":9574,"boxHU;":9577,"boxHd;":9572,"boxHu;":9575,"boxUL;":9565,"boxUR;":9562,"boxUl;":9564,"boxUr;":9561,"boxV;":9553,"boxVH;":9580,"boxVL;":9571,"boxVR;":9568,"boxVh;":9579,"boxVl;":9570,"boxVr;":9567,"boxbox;":10697,"boxdL;":9557,"boxdR;":9554,"boxdl;":9488,"boxdr;":9484,"boxh;":9472,"boxhD;":9573,"boxhU;":9576,"boxhd;":9516,"boxhu;":9524,"boxminus;":8863,"boxplus;":8862,"boxtimes;":8864,"boxuL;":9563,"boxuR;":9560,"boxul;":9496,"boxur;":9492,"boxv;":9474,"boxvH;":9578,"boxvL;":9569,"boxvR;":9566,"boxvh;":9532,"boxvl;":9508,"boxvr;":9500,"bprime;":8245,"breve;":728,brvbar:166,"brvbar;":166,"bscr;":[55349,56503],"bsemi;":8271,"bsim;":8765,"bsime;":8909,"bsol;":92,"bsolb;":10693,"bsolhsub;":10184,"bull;":8226,"bullet;":8226,"bump;":8782,"bumpE;":10926,"bumpe;":8783,"bumpeq;":8783,"cacute;":263,"cap;":8745,"capand;":10820,"capbrcup;":10825,"capcap;":10827,"capcup;":10823,"capdot;":10816,"caps;":[8745,65024],"caret;":8257,"caron;":711,"ccaps;":10829,"ccaron;":269,ccedil:231,"ccedil;":231,"ccirc;":265,"ccups;":10828,"ccupssm;":10832,"cdot;":267,cedil:184,"cedil;":184,"cemptyv;":10674,cent:162,"cent;":162,"centerdot;":183,"cfr;":[55349,56608],"chcy;":1095,"check;":10003,"checkmark;":10003,"chi;":967,"cir;":9675,"cirE;":10691,"circ;":710,"circeq;":8791,"circlearrowleft;":8634,"circlearrowright;":8635,"circledR;":174,"circledS;":9416,"circledast;":8859,"circledcirc;":8858,"circleddash;":8861,"cire;":8791,"cirfnint;":10768,"cirmid;":10991,"cirscir;":10690,"clubs;":9827,"clubsuit;":9827,"colon;":58,"colone;":8788,"coloneq;":8788,"comma;":44,"commat;":64,"comp;":8705,"compfn;":8728,"complement;":8705,"complexes;":8450,"cong;":8773,"congdot;":10861,"conint;":8750,"copf;":[55349,56660],"coprod;":8720,copy:169,"copy;":169,"copysr;":8471,"crarr;":8629,"cross;":10007,"cscr;":[55349,56504],"csub;":10959,"csube;":10961,"csup;":10960,"csupe;":10962,"ctdot;":8943,"cudarrl;":10552,"cudarrr;":10549,"cuepr;":8926,"cuesc;":8927,"cularr;":8630,"cularrp;":10557,"cup;":8746,"cupbrcap;":10824,"cupcap;":10822,"cupcup;":10826,"cupdot;":8845,"cupor;":10821,"cups;":[8746,65024],"curarr;":8631,"curarrm;":10556,"curlyeqprec;":8926,"curlyeqsucc;":8927,"curlyvee;":8910,"curlywedge;":8911,curren:164,"curren;":164,"curvearrowleft;":8630,"curvearrowright;":8631,"cuvee;":8910,"cuwed;":8911,"cwconint;":8754,"cwint;":8753,"cylcty;":9005,"dArr;":8659,"dHar;":10597,"dagger;":8224,"daleth;":8504,"darr;":8595,"dash;":8208,"dashv;":8867,"dbkarow;":10511,"dblac;":733,"dcaron;":271,"dcy;":1076,"dd;":8518,"ddagger;":8225,"ddarr;":8650,"ddotseq;":10871,deg:176,"deg;":176,"delta;":948,"demptyv;":10673,"dfisht;":10623,"dfr;":[55349,56609],"dharl;":8643,"dharr;":8642,"diam;":8900,"diamond;":8900,"diamondsuit;":9830,"diams;":9830,"die;":168,"digamma;":989,"disin;":8946,"div;":247,divide:247,"divide;":247,"divideontimes;":8903,"divonx;":8903,"djcy;":1106,"dlcorn;":8990,"dlcrop;":8973,"dollar;":36,"dopf;":[55349,56661],"dot;":729,"doteq;":8784,"doteqdot;":8785,"dotminus;":8760,"dotplus;":8724,"dotsquare;":8865,"doublebarwedge;":8966,"downarrow;":8595,"downdownarrows;":8650,"downharpoonleft;":8643,"downharpoonright;":8642,"drbkarow;":10512,"drcorn;":8991,"drcrop;":8972,"dscr;":[55349,56505],"dscy;":1109,"dsol;":10742,"dstrok;":273,"dtdot;":8945,"dtri;":9663,"dtrif;":9662,"duarr;":8693,"duhar;":10607,"dwangle;":10662,"dzcy;":1119,"dzigrarr;":10239,"eDDot;":10871,"eDot;":8785,eacute:233,"eacute;":233,"easter;":10862,"ecaron;":283,"ecir;":8790,ecirc:234,"ecirc;":234,"ecolon;":8789,"ecy;":1101,"edot;":279,"ee;":8519,"efDot;":8786,"efr;":[55349,56610],"eg;":10906,egrave:232,"egrave;":232,"egs;":10902,"egsdot;":10904,"el;":10905,"elinters;":9191,"ell;":8467,"els;":10901,"elsdot;":10903,"emacr;":275,"empty;":8709,"emptyset;":8709,"emptyv;":8709,"emsp13;":8196,"emsp14;":8197,"emsp;":8195,"eng;":331,"ensp;":8194,"eogon;":281,"eopf;":[55349,56662],"epar;":8917,"eparsl;":10723,"eplus;":10865,"epsi;":949,"epsilon;":949,"epsiv;":1013,"eqcirc;":8790,"eqcolon;":8789,"eqsim;":8770,"eqslantgtr;":10902,"eqslantless;":10901,"equals;":61,"equest;":8799,"equiv;":8801,"equivDD;":10872,"eqvparsl;":10725,"erDot;":8787,"erarr;":10609,"escr;":8495,"esdot;":8784,"esim;":8770,"eta;":951,eth:240,"eth;":240,euml:235,"euml;":235,"euro;":8364,"excl;":33,"exist;":8707,"expectation;":8496,"exponentiale;":8519,"fallingdotseq;":8786,"fcy;":1092,"female;":9792,"ffilig;":64259,"fflig;":64256,"ffllig;":64260,"ffr;":[55349,56611],"filig;":64257,"fjlig;":[102,106],"flat;":9837,"fllig;":64258,"fltns;":9649,"fnof;":402,"fopf;":[55349,56663],"forall;":8704,"fork;":8916,"forkv;":10969,"fpartint;":10765,frac12:189,"frac12;":189,"frac13;":8531,frac14:188,"frac14;":188,"frac15;":8533,"frac16;":8537,"frac18;":8539,"frac23;":8532,"frac25;":8534,frac34:190,"frac34;":190,"frac35;":8535,"frac38;":8540,"frac45;":8536,"frac56;":8538,"frac58;":8541,"frac78;":8542,"frasl;":8260,"frown;":8994,"fscr;":[55349,56507],"gE;":8807,"gEl;":10892,"gacute;":501,"gamma;":947,"gammad;":989,"gap;":10886,"gbreve;":287,"gcirc;":285,"gcy;":1075,"gdot;":289,"ge;":8805,"gel;":8923,"geq;":8805,"geqq;":8807,"geqslant;":10878,"ges;":10878,"gescc;":10921,"gesdot;":10880,"gesdoto;":10882,"gesdotol;":10884,"gesl;":[8923,65024],"gesles;":10900,"gfr;":[55349,56612],"gg;":8811,"ggg;":8921,"gimel;":8503,"gjcy;":1107,"gl;":8823,"glE;":10898,"gla;":10917,"glj;":10916,"gnE;":8809,"gnap;":10890,"gnapprox;":10890,"gne;":10888,"gneq;":10888,"gneqq;":8809,"gnsim;":8935,"gopf;":[55349,56664],"grave;":96,"gscr;":8458,"gsim;":8819,"gsime;":10894,"gsiml;":10896,gt:62,"gt;":62,"gtcc;":10919,"gtcir;":10874,"gtdot;":8919,"gtlPar;":10645,"gtquest;":10876,"gtrapprox;":10886,"gtrarr;":10616,"gtrdot;":8919,"gtreqless;":8923,"gtreqqless;":10892,"gtrless;":8823,"gtrsim;":8819,"gvertneqq;":[8809,65024],"gvnE;":[8809,65024],"hArr;":8660,"hairsp;":8202,"half;":189,"hamilt;":8459,"hardcy;":1098,"harr;":8596,"harrcir;":10568,"harrw;":8621,"hbar;":8463,"hcirc;":293,"hearts;":9829,"heartsuit;":9829,"hellip;":8230,"hercon;":8889,"hfr;":[55349,56613],"hksearow;":10533,"hkswarow;":10534,"hoarr;":8703,"homtht;":8763,"hookleftarrow;":8617,"hookrightarrow;":8618,"hopf;":[55349,56665],"horbar;":8213,"hscr;":[55349,56509],"hslash;":8463,"hstrok;":295,"hybull;":8259,"hyphen;":8208,iacute:237,"iacute;":237,"ic;":8291,icirc:238,"icirc;":238,"icy;":1080,"iecy;":1077,iexcl:161,"iexcl;":161,"iff;":8660,"ifr;":[55349,56614],igrave:236,"igrave;":236,"ii;":8520,"iiiint;":10764,"iiint;":8749,"iinfin;":10716,"iiota;":8489,"ijlig;":307,"imacr;":299,"image;":8465,"imagline;":8464,"imagpart;":8465,"imath;":305,"imof;":8887,"imped;":437,"in;":8712,"incare;":8453,"infin;":8734,"infintie;":10717,"inodot;":305,"int;":8747,"intcal;":8890,"integers;":8484,"intercal;":8890,"intlarhk;":10775,"intprod;":10812,"iocy;":1105,"iogon;":303,"iopf;":[55349,56666],"iota;":953,"iprod;":10812,iquest:191,"iquest;":191,"iscr;":[55349,56510],"isin;":8712,"isinE;":8953,"isindot;":8949,"isins;":8948,"isinsv;":8947,"isinv;":8712,"it;":8290,"itilde;":297,"iukcy;":1110,iuml:239,"iuml;":239,"jcirc;":309,"jcy;":1081,"jfr;":[55349,56615],"jmath;":567,"jopf;":[55349,56667],"jscr;":[55349,56511],"jsercy;":1112,"jukcy;":1108,"kappa;":954,"kappav;":1008,"kcedil;":311,"kcy;":1082,"kfr;":[55349,56616],"kgreen;":312,"khcy;":1093,"kjcy;":1116,"kopf;":[55349,56668],"kscr;":[55349,56512],"lAarr;":8666,"lArr;":8656,"lAtail;":10523,"lBarr;":10510,"lE;":8806,"lEg;":10891,"lHar;":10594,"lacute;":314,"laemptyv;":10676,"lagran;":8466,"lambda;":955,"lang;":10216,"langd;":10641,"langle;":10216,"lap;":10885,laquo:171,"laquo;":171,"larr;":8592,"larrb;":8676,"larrbfs;":10527,"larrfs;":10525,"larrhk;":8617,"larrlp;":8619,"larrpl;":10553,"larrsim;":10611,"larrtl;":8610,"lat;":10923,"latail;":10521,"late;":10925,"lates;":[10925,65024],"lbarr;":10508,"lbbrk;":10098,"lbrace;":123,"lbrack;":91,"lbrke;":10635,"lbrksld;":10639,"lbrkslu;":10637,"lcaron;":318,"lcedil;":316,"lceil;":8968,"lcub;":123,"lcy;":1083,"ldca;":10550,"ldquo;":8220,"ldquor;":8222,"ldrdhar;":10599,"ldrushar;":10571,"ldsh;":8626,"le;":8804,"leftarrow;":8592,"leftarrowtail;":8610,"leftharpoondown;":8637,"leftharpoonup;":8636,"leftleftarrows;":8647,"leftrightarrow;":8596,"leftrightarrows;":8646,"leftrightharpoons;":8651,"leftrightsquigarrow;":8621,"leftthreetimes;":8907,"leg;":8922,"leq;":8804,"leqq;":8806,"leqslant;":10877,"les;":10877,"lescc;":10920,"lesdot;":10879,"lesdoto;":10881,"lesdotor;":10883,"lesg;":[8922,65024],"lesges;":10899,"lessapprox;":10885,"lessdot;":8918,"lesseqgtr;":8922,"lesseqqgtr;":10891,"lessgtr;":8822,"lesssim;":8818,"lfisht;":10620,"lfloor;":8970,"lfr;":[55349,56617],"lg;":8822,"lgE;":10897,"lhard;":8637,"lharu;":8636,"lharul;":10602,"lhblk;":9604,"ljcy;":1113,"ll;":8810,"llarr;":8647,"llcorner;":8990,"llhard;":10603,"lltri;":9722,"lmidot;":320,"lmoust;":9136,"lmoustache;":9136,"lnE;":8808,"lnap;":10889,"lnapprox;":10889,"lne;":10887,"lneq;":10887,"lneqq;":8808,"lnsim;":8934,"loang;":10220,"loarr;":8701,"lobrk;":10214,"longleftarrow;":10229,"longleftrightarrow;":10231,"longmapsto;":10236,"longrightarrow;":10230,"looparrowleft;":8619,"looparrowright;":8620,"lopar;":10629,"lopf;":[55349,56669],"loplus;":10797,"lotimes;":10804,"lowast;":8727,"lowbar;":95,"loz;":9674,"lozenge;":9674,"lozf;":10731,"lpar;":40,"lparlt;":10643,"lrarr;":8646,"lrcorner;":8991,"lrhar;":8651,"lrhard;":10605,"lrm;":8206,"lrtri;":8895,"lsaquo;":8249,"lscr;":[55349,56513],"lsh;":8624,"lsim;":8818,"lsime;":10893,"lsimg;":10895,"lsqb;":91,"lsquo;":8216,"lsquor;":8218,"lstrok;":322,lt:60,"lt;":60,"ltcc;":10918,"ltcir;":10873,"ltdot;":8918,"lthree;":8907,"ltimes;":8905,"ltlarr;":10614,"ltquest;":10875,"ltrPar;":10646,"ltri;":9667,"ltrie;":8884,"ltrif;":9666,"lurdshar;":10570,"luruhar;":10598,"lvertneqq;":[8808,65024],"lvnE;":[8808,65024],"mDDot;":8762,macr:175,"macr;":175,"male;":9794,"malt;":10016,"maltese;":10016,"map;":8614,"mapsto;":8614,"mapstodown;":8615,"mapstoleft;":8612,"mapstoup;":8613,"marker;":9646,"mcomma;":10793,"mcy;":1084,"mdash;":8212,"measuredangle;":8737,"mfr;":[55349,56618],"mho;":8487,micro:181,"micro;":181,"mid;":8739,"midast;":42,"midcir;":10992,middot:183,"middot;":183,"minus;":8722,"minusb;":8863,"minusd;":8760,"minusdu;":10794,"mlcp;":10971,"mldr;":8230,"mnplus;":8723,"models;":8871,"mopf;":[55349,56670],"mp;":8723,"mscr;":[55349,56514],"mstpos;":8766,"mu;":956,"multimap;":8888,"mumap;":8888,"nGg;":[8921,824],"nGt;":[8811,8402],"nGtv;":[8811,824],"nLeftarrow;":8653,"nLeftrightarrow;":8654,"nLl;":[8920,824],"nLt;":[8810,8402],"nLtv;":[8810,824],"nRightarrow;":8655,"nVDash;":8879,"nVdash;":8878,"nabla;":8711,"nacute;":324,"nang;":[8736,8402],"nap;":8777,"napE;":[10864,824],"napid;":[8779,824],"napos;":329,"napprox;":8777,"natur;":9838,"natural;":9838,"naturals;":8469,nbsp:160,"nbsp;":160,"nbump;":[8782,824],"nbumpe;":[8783,824],"ncap;":10819,"ncaron;":328,"ncedil;":326,"ncong;":8775,"ncongdot;":[10861,824],"ncup;":10818,"ncy;":1085,"ndash;":8211,"ne;":8800,"neArr;":8663,"nearhk;":10532,"nearr;":8599,"nearrow;":8599,"nedot;":[8784,824],"nequiv;":8802,"nesear;":10536,"nesim;":[8770,824],"nexist;":8708,"nexists;":8708,"nfr;":[55349,56619],"ngE;":[8807,824],"nge;":8817,"ngeq;":8817,"ngeqq;":[8807,824],"ngeqslant;":[10878,824],"nges;":[10878,824],"ngsim;":8821,"ngt;":8815,"ngtr;":8815,"nhArr;":8654,"nharr;":8622,"nhpar;":10994,"ni;":8715,"nis;":8956,"nisd;":8954,"niv;":8715,"njcy;":1114,"nlArr;":8653,"nlE;":[8806,824],"nlarr;":8602,"nldr;":8229,"nle;":8816,"nleftarrow;":8602,"nleftrightarrow;":8622,"nleq;":8816,"nleqq;":[8806,824],"nleqslant;":[10877,824],"nles;":[10877,824],"nless;":8814,"nlsim;":8820,"nlt;":8814,"nltri;":8938,"nltrie;":8940,"nmid;":8740,"nopf;":[55349,56671],not:172,"not;":172,"notin;":8713,"notinE;":[8953,824],"notindot;":[8949,824],"notinva;":8713,"notinvb;":8951,"notinvc;":8950,"notni;":8716,"notniva;":8716,"notnivb;":8958,"notnivc;":8957,"npar;":8742,"nparallel;":8742,"nparsl;":[11005,8421],"npart;":[8706,824],"npolint;":10772,"npr;":8832,"nprcue;":8928,"npre;":[10927,824],"nprec;":8832,"npreceq;":[10927,824],"nrArr;":8655,"nrarr;":8603,"nrarrc;":[10547,824],"nrarrw;":[8605,824],"nrightarrow;":8603,"nrtri;":8939,"nrtrie;":8941,"nsc;":8833,"nsccue;":8929,"nsce;":[10928,824],"nscr;":[55349,56515],"nshortmid;":8740,"nshortparallel;":8742,"nsim;":8769,"nsime;":8772,"nsimeq;":8772,"nsmid;":8740,"nspar;":8742,"nsqsube;":8930,"nsqsupe;":8931,"nsub;":8836,"nsubE;":[10949,824],"nsube;":8840,"nsubset;":[8834,8402],"nsubseteq;":8840,"nsubseteqq;":[10949,824],"nsucc;":8833,"nsucceq;":[10928,824],"nsup;":8837,"nsupE;":[10950,824],"nsupe;":8841,"nsupset;":[8835,8402],"nsupseteq;":8841,"nsupseteqq;":[10950,824],"ntgl;":8825,ntilde:241,"ntilde;":241,"ntlg;":8824,"ntriangleleft;":8938,"ntrianglelefteq;":8940,"ntriangleright;":8939,"ntrianglerighteq;":8941,"nu;":957,"num;":35,"numero;":8470,"numsp;":8199,"nvDash;":8877,"nvHarr;":10500,"nvap;":[8781,8402],"nvdash;":8876,"nvge;":[8805,8402],"nvgt;":[62,8402],"nvinfin;":10718,"nvlArr;":10498,"nvle;":[8804,8402],"nvlt;":[60,8402],"nvltrie;":[8884,8402],"nvrArr;":10499,"nvrtrie;":[8885,8402],"nvsim;":[8764,8402],"nwArr;":8662,"nwarhk;":10531,"nwarr;":8598,"nwarrow;":8598,"nwnear;":10535,"oS;":9416,oacute:243,"oacute;":243,"oast;":8859,"ocir;":8858,ocirc:244,"ocirc;":244,"ocy;":1086,"odash;":8861,"odblac;":337,"odiv;":10808,"odot;":8857,"odsold;":10684,"oelig;":339,"ofcir;":10687,"ofr;":[55349,56620],"ogon;":731,ograve:242,"ograve;":242,"ogt;":10689,"ohbar;":10677,"ohm;":937,"oint;":8750,"olarr;":8634,"olcir;":10686,"olcross;":10683,"oline;":8254,"olt;":10688,"omacr;":333,"omega;":969,"omicron;":959,"omid;":10678,"ominus;":8854,"oopf;":[55349,56672],"opar;":10679,"operp;":10681,"oplus;":8853,"or;":8744,"orarr;":8635,"ord;":10845,"order;":8500,"orderof;":8500,ordf:170,"ordf;":170,ordm:186,"ordm;":186,"origof;":8886,"oror;":10838,"orslope;":10839,"orv;":10843,"oscr;":8500,oslash:248,"oslash;":248,"osol;":8856,otilde:245,"otilde;":245,"otimes;":8855,"otimesas;":10806,ouml:246,"ouml;":246,"ovbar;":9021,"par;":8741,para:182,"para;":182,"parallel;":8741,"parsim;":10995,"parsl;":11005,"part;":8706,"pcy;":1087,"percnt;":37,"period;":46,"permil;":8240,"perp;":8869,"pertenk;":8241,"pfr;":[55349,56621],"phi;":966,"phiv;":981,"phmmat;":8499,"phone;":9742,"pi;":960,"pitchfork;":8916,"piv;":982,"planck;":8463,"planckh;":8462,"plankv;":8463,"plus;":43,"plusacir;":10787,"plusb;":8862,"pluscir;":10786,"plusdo;":8724,"plusdu;":10789,"pluse;":10866,plusmn:177,"plusmn;":177,"plussim;":10790,"plustwo;":10791,"pm;":177,"pointint;":10773,"popf;":[55349,56673],pound:163,"pound;":163,"pr;":8826,"prE;":10931,"prap;":10935,"prcue;":8828,"pre;":10927,"prec;":8826,"precapprox;":10935,"preccurlyeq;":8828,"preceq;":10927,"precnapprox;":10937,"precneqq;":10933,"precnsim;":8936,"precsim;":8830,"prime;":8242,"primes;":8473,"prnE;":10933,"prnap;":10937,"prnsim;":8936,"prod;":8719,"profalar;":9006,"profline;":8978,"profsurf;":8979,"prop;":8733,"propto;":8733,"prsim;":8830,"prurel;":8880,"pscr;":[55349,56517],"psi;":968,"puncsp;":8200,"qfr;":[55349,56622],"qint;":10764,"qopf;":[55349,56674],"qprime;":8279,"qscr;":[55349,56518],"quaternions;":8461,"quatint;":10774,"quest;":63,"questeq;":8799,quot:34,"quot;":34,"rAarr;":8667,"rArr;":8658,"rAtail;":10524,"rBarr;":10511,"rHar;":10596,"race;":[8765,817],"racute;":341,"radic;":8730,"raemptyv;":10675,"rang;":10217,"rangd;":10642,"range;":10661,"rangle;":10217,raquo:187,"raquo;":187,"rarr;":8594,"rarrap;":10613,"rarrb;":8677,"rarrbfs;":10528,"rarrc;":10547,"rarrfs;":10526,"rarrhk;":8618,"rarrlp;":8620,"rarrpl;":10565,"rarrsim;":10612,"rarrtl;":8611,"rarrw;":8605,"ratail;":10522,"ratio;":8758,"rationals;":8474,"rbarr;":10509,"rbbrk;":10099,"rbrace;":125,"rbrack;":93,"rbrke;":10636,"rbrksld;":10638,"rbrkslu;":10640,"rcaron;":345,"rcedil;":343,"rceil;":8969,"rcub;":125,"rcy;":1088,"rdca;":10551,"rdldhar;":10601,"rdquo;":8221,"rdquor;":8221,"rdsh;":8627,"real;":8476,"realine;":8475,"realpart;":8476,"reals;":8477,"rect;":9645,reg:174,"reg;":174,"rfisht;":10621,"rfloor;":8971,"rfr;":[55349,56623],"rhard;":8641,"rharu;":8640,"rharul;":10604,"rho;":961,"rhov;":1009,"rightarrow;":8594,"rightarrowtail;":8611,"rightharpoondown;":8641,"rightharpoonup;":8640,"rightleftarrows;":8644,"rightleftharpoons;":8652,"rightrightarrows;":8649,"rightsquigarrow;":8605,"rightthreetimes;":8908,"ring;":730,"risingdotseq;":8787,"rlarr;":8644,"rlhar;":8652,"rlm;":8207,"rmoust;":9137,"rmoustache;":9137,"rnmid;":10990,"roang;":10221,"roarr;":8702,"robrk;":10215,"ropar;":10630,"ropf;":[55349,56675],"roplus;":10798,"rotimes;":10805,"rpar;":41,"rpargt;":10644,"rppolint;":10770,"rrarr;":8649,"rsaquo;":8250,"rscr;":[55349,56519],"rsh;":8625,"rsqb;":93,"rsquo;":8217,"rsquor;":8217,"rthree;":8908,"rtimes;":8906,"rtri;":9657,"rtrie;":8885,"rtrif;":9656,"rtriltri;":10702,"ruluhar;":10600,"rx;":8478,"sacute;":347,"sbquo;":8218,"sc;":8827,"scE;":10932,"scap;":10936,"scaron;":353,"sccue;":8829,"sce;":10928,"scedil;":351,"scirc;":349,"scnE;":10934,"scnap;":10938,"scnsim;":8937,"scpolint;":10771,"scsim;":8831,"scy;":1089,"sdot;":8901,"sdotb;":8865,"sdote;":10854,"seArr;":8664,"searhk;":10533,"searr;":8600,"searrow;":8600,sect:167,"sect;":167,"semi;":59,"seswar;":10537,"setminus;":8726,"setmn;":8726,"sext;":10038,"sfr;":[55349,56624],"sfrown;":8994,"sharp;":9839,"shchcy;":1097,"shcy;":1096,"shortmid;":8739,"shortparallel;":8741,shy:173,"shy;":173,"sigma;":963,"sigmaf;":962,"sigmav;":962,"sim;":8764,"simdot;":10858,"sime;":8771,"simeq;":8771,"simg;":10910,"simgE;":10912,"siml;":10909,"simlE;":10911,"simne;":8774,"simplus;":10788,"simrarr;":10610,"slarr;":8592,"smallsetminus;":8726,"smashp;":10803,"smeparsl;":10724,"smid;":8739,"smile;":8995,"smt;":10922,"smte;":10924,"smtes;":[10924,65024],"softcy;":1100,"sol;":47,"solb;":10692,"solbar;":9023,"sopf;":[55349,56676],"spades;":9824,"spadesuit;":9824,"spar;":8741,"sqcap;":8851,"sqcaps;":[8851,65024],"sqcup;":8852,"sqcups;":[8852,65024],"sqsub;":8847,"sqsube;":8849,"sqsubset;":8847,"sqsubseteq;":8849,"sqsup;":8848,"sqsupe;":8850,"sqsupset;":8848,"sqsupseteq;":8850,"squ;":9633,"square;":9633,"squarf;":9642,"squf;":9642,"srarr;":8594,"sscr;":[55349,56520],"ssetmn;":8726,"ssmile;":8995,"sstarf;":8902,"star;":9734,"starf;":9733,"straightepsilon;":1013,"straightphi;":981,"strns;":175,"sub;":8834,"subE;":10949,"subdot;":10941,"sube;":8838,"subedot;":10947,"submult;":10945,"subnE;":10955,"subne;":8842,"subplus;":10943,"subrarr;":10617,"subset;":8834,"subseteq;":8838,"subseteqq;":10949,"subsetneq;":8842,"subsetneqq;":10955,"subsim;":10951,"subsub;":10965,"subsup;":10963,"succ;":8827,"succapprox;":10936,"succcurlyeq;":8829,"succeq;":10928,"succnapprox;":10938,"succneqq;":10934,"succnsim;":8937,"succsim;":8831,"sum;":8721,"sung;":9834,sup1:185,"sup1;":185,sup2:178,"sup2;":178,sup3:179,"sup3;":179,"sup;":8835,"supE;":10950,"supdot;":10942,"supdsub;":10968,"supe;":8839,"supedot;":10948,"suphsol;":10185,"suphsub;":10967,"suplarr;":10619,"supmult;":10946,"supnE;":10956,"supne;":8843,"supplus;":10944,"supset;":8835,"supseteq;":8839,"supseteqq;":10950,"supsetneq;":8843,"supsetneqq;":10956,"supsim;":10952,"supsub;":10964,"supsup;":10966,"swArr;":8665,"swarhk;":10534,"swarr;":8601,"swarrow;":8601,"swnwar;":10538,szlig:223,"szlig;":223,"target;":8982,"tau;":964,"tbrk;":9140,"tcaron;":357,"tcedil;":355,"tcy;":1090,"tdot;":8411,"telrec;":8981,"tfr;":[55349,56625],"there4;":8756,"therefore;":8756,"theta;":952,"thetasym;":977,"thetav;":977,"thickapprox;":8776,"thicksim;":8764,"thinsp;":8201,"thkap;":8776,"thksim;":8764,thorn:254,"thorn;":254,"tilde;":732,times:215,"times;":215,"timesb;":8864,"timesbar;":10801,"timesd;":10800,"tint;":8749,"toea;":10536,"top;":8868,"topbot;":9014,"topcir;":10993,"topf;":[55349,56677],"topfork;":10970,"tosa;":10537,"tprime;":8244,"trade;":8482,"triangle;":9653,"triangledown;":9663,"triangleleft;":9667,"trianglelefteq;":8884,"triangleq;":8796,"triangleright;":9657,"trianglerighteq;":8885,"tridot;":9708,"trie;":8796,"triminus;":10810,"triplus;":10809,"trisb;":10701,"tritime;":10811,"trpezium;":9186,"tscr;":[55349,56521],"tscy;":1094,"tshcy;":1115,"tstrok;":359,"twixt;":8812,"twoheadleftarrow;":8606,"twoheadrightarrow;":8608,"uArr;":8657,"uHar;":10595,uacute:250,"uacute;":250,"uarr;":8593,"ubrcy;":1118,"ubreve;":365,ucirc:251,"ucirc;":251,"ucy;":1091,"udarr;":8645,"udblac;":369,"udhar;":10606,"ufisht;":10622,"ufr;":[55349,56626],ugrave:249,"ugrave;":249,"uharl;":8639,"uharr;":8638,"uhblk;":9600,"ulcorn;":8988,"ulcorner;":8988,"ulcrop;":8975,"ultri;":9720,"umacr;":363,uml:168,"uml;":168,"uogon;":371,"uopf;":[55349,56678],"uparrow;":8593,"updownarrow;":8597,"upharpoonleft;":8639,"upharpoonright;":8638,"uplus;":8846,"upsi;":965,"upsih;":978,"upsilon;":965,"upuparrows;":8648,"urcorn;":8989,"urcorner;":8989,"urcrop;":8974,"uring;":367,"urtri;":9721,"uscr;":[55349,56522],"utdot;":8944,"utilde;":361,"utri;":9653,"utrif;":9652,"uuarr;":8648,uuml:252,"uuml;":252,"uwangle;":10663,"vArr;":8661,"vBar;":10984,"vBarv;":10985,"vDash;":8872,"vangrt;":10652,"varepsilon;":1013,"varkappa;":1008,"varnothing;":8709,"varphi;":981,"varpi;":982,"varpropto;":8733,"varr;":8597,"varrho;":1009,"varsigma;":962,"varsubsetneq;":[8842,65024],"varsubsetneqq;":[10955,65024],"varsupsetneq;":[8843,65024],"varsupsetneqq;":[10956,65024],"vartheta;":977,"vartriangleleft;":8882,"vartriangleright;":8883,"vcy;":1074,"vdash;":8866,"vee;":8744,"veebar;":8891,"veeeq;":8794,"vellip;":8942,"verbar;":124,"vert;":124,"vfr;":[55349,56627],"vltri;":8882,"vnsub;":[8834,8402],"vnsup;":[8835,8402],"vopf;":[55349,56679],"vprop;":8733,"vrtri;":8883,"vscr;":[55349,56523],"vsubnE;":[10955,65024],"vsubne;":[8842,65024],"vsupnE;":[10956,65024],"vsupne;":[8843,65024],"vzigzag;":10650,"wcirc;":373,"wedbar;":10847,"wedge;":8743,"wedgeq;":8793,"weierp;":8472,"wfr;":[55349,56628],"wopf;":[55349,56680],"wp;":8472,"wr;":8768,"wreath;":8768,"wscr;":[55349,56524],"xcap;":8898,"xcirc;":9711,"xcup;":8899,"xdtri;":9661,"xfr;":[55349,56629],"xhArr;":10234,"xharr;":10231,"xi;":958,"xlArr;":10232,"xlarr;":10229,"xmap;":10236,"xnis;":8955,"xodot;":10752,"xopf;":[55349,56681],"xoplus;":10753,"xotime;":10754,"xrArr;":10233,"xrarr;":10230,"xscr;":[55349,56525],"xsqcup;":10758,"xuplus;":10756,"xutri;":9651,"xvee;":8897,"xwedge;":8896,yacute:253,"yacute;":253,"yacy;":1103,"ycirc;":375,"ycy;":1099,yen:165,"yen;":165,"yfr;":[55349,56630],"yicy;":1111,"yopf;":[55349,56682],"yscr;":[55349,56526],"yucy;":1102,yuml:255,"yuml;":255,"zacute;":378,"zcaron;":382,"zcy;":1079,"zdot;":380,"zeetrf;":8488,"zeta;":950,"zfr;":[55349,56631],"zhcy;":1078,"zigrarr;":8669,"zopf;":[55349,56683],"zscr;":[55349,56527],"zwj;":8205,"zwnj;":8204},wj=/(A(?:Elig;?|MP;?|acute;?|breve;|c(?:irc;?|y;)|fr;|grave;?|lpha;|macr;|nd;|o(?:gon;|pf;)|pplyFunction;|ring;?|s(?:cr;|sign;)|tilde;?|uml;?)|B(?:a(?:ckslash;|r(?:v;|wed;))|cy;|e(?:cause;|rnoullis;|ta;)|fr;|opf;|reve;|scr;|umpeq;)|C(?:Hcy;|OPY;?|a(?:cute;|p(?:;|italDifferentialD;)|yleys;)|c(?:aron;|edil;?|irc;|onint;)|dot;|e(?:dilla;|nterDot;)|fr;|hi;|ircle(?:Dot;|Minus;|Plus;|Times;)|lo(?:ckwiseContourIntegral;|seCurly(?:DoubleQuote;|Quote;))|o(?:lon(?:;|e;)|n(?:gruent;|int;|tourIntegral;)|p(?:f;|roduct;)|unterClockwiseContourIntegral;)|ross;|scr;|up(?:;|Cap;))|D(?:D(?:;|otrahd;)|Jcy;|Scy;|Zcy;|a(?:gger;|rr;|shv;)|c(?:aron;|y;)|el(?:;|ta;)|fr;|i(?:a(?:critical(?:Acute;|Do(?:t;|ubleAcute;)|Grave;|Tilde;)|mond;)|fferentialD;)|o(?:pf;|t(?:;|Dot;|Equal;)|uble(?:ContourIntegral;|Do(?:t;|wnArrow;)|L(?:eft(?:Arrow;|RightArrow;|Tee;)|ong(?:Left(?:Arrow;|RightArrow;)|RightArrow;))|Right(?:Arrow;|Tee;)|Up(?:Arrow;|DownArrow;)|VerticalBar;)|wn(?:Arrow(?:;|Bar;|UpArrow;)|Breve;|Left(?:RightVector;|TeeVector;|Vector(?:;|Bar;))|Right(?:TeeVector;|Vector(?:;|Bar;))|Tee(?:;|Arrow;)|arrow;))|s(?:cr;|trok;))|E(?:NG;|TH;?|acute;?|c(?:aron;|irc;?|y;)|dot;|fr;|grave;?|lement;|m(?:acr;|pty(?:SmallSquare;|VerySmallSquare;))|o(?:gon;|pf;)|psilon;|qu(?:al(?:;|Tilde;)|ilibrium;)|s(?:cr;|im;)|ta;|uml;?|x(?:ists;|ponentialE;))|F(?:cy;|fr;|illed(?:SmallSquare;|VerySmallSquare;)|o(?:pf;|rAll;|uriertrf;)|scr;)|G(?:Jcy;|T;?|amma(?:;|d;)|breve;|c(?:edil;|irc;|y;)|dot;|fr;|g;|opf;|reater(?:Equal(?:;|Less;)|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;)|scr;|t;)|H(?:ARDcy;|a(?:cek;|t;)|circ;|fr;|ilbertSpace;|o(?:pf;|rizontalLine;)|s(?:cr;|trok;)|ump(?:DownHump;|Equal;))|I(?:Ecy;|Jlig;|Ocy;|acute;?|c(?:irc;?|y;)|dot;|fr;|grave;?|m(?:;|a(?:cr;|ginaryI;)|plies;)|n(?:t(?:;|e(?:gral;|rsection;))|visible(?:Comma;|Times;))|o(?:gon;|pf;|ta;)|scr;|tilde;|u(?:kcy;|ml;?))|J(?:c(?:irc;|y;)|fr;|opf;|s(?:cr;|ercy;)|ukcy;)|K(?:Hcy;|Jcy;|appa;|c(?:edil;|y;)|fr;|opf;|scr;)|L(?:Jcy;|T;?|a(?:cute;|mbda;|ng;|placetrf;|rr;)|c(?:aron;|edil;|y;)|e(?:ft(?:A(?:ngleBracket;|rrow(?:;|Bar;|RightArrow;))|Ceiling;|Do(?:ubleBracket;|wn(?:TeeVector;|Vector(?:;|Bar;)))|Floor;|Right(?:Arrow;|Vector;)|T(?:ee(?:;|Arrow;|Vector;)|riangle(?:;|Bar;|Equal;))|Up(?:DownVector;|TeeVector;|Vector(?:;|Bar;))|Vector(?:;|Bar;)|arrow;|rightarrow;)|ss(?:EqualGreater;|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;))|fr;|l(?:;|eftarrow;)|midot;|o(?:ng(?:Left(?:Arrow;|RightArrow;)|RightArrow;|left(?:arrow;|rightarrow;)|rightarrow;)|pf;|wer(?:LeftArrow;|RightArrow;))|s(?:cr;|h;|trok;)|t;)|M(?:ap;|cy;|e(?:diumSpace;|llintrf;)|fr;|inusPlus;|opf;|scr;|u;)|N(?:Jcy;|acute;|c(?:aron;|edil;|y;)|e(?:gative(?:MediumSpace;|Thi(?:ckSpace;|nSpace;)|VeryThinSpace;)|sted(?:GreaterGreater;|LessLess;)|wLine;)|fr;|o(?:Break;|nBreakingSpace;|pf;|t(?:;|C(?:ongruent;|upCap;)|DoubleVerticalBar;|E(?:lement;|qual(?:;|Tilde;)|xists;)|Greater(?:;|Equal;|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;)|Hump(?:DownHump;|Equal;)|Le(?:ftTriangle(?:;|Bar;|Equal;)|ss(?:;|Equal;|Greater;|Less;|SlantEqual;|Tilde;))|Nested(?:GreaterGreater;|LessLess;)|Precedes(?:;|Equal;|SlantEqual;)|R(?:everseElement;|ightTriangle(?:;|Bar;|Equal;))|S(?:quareSu(?:bset(?:;|Equal;)|perset(?:;|Equal;))|u(?:bset(?:;|Equal;)|cceeds(?:;|Equal;|SlantEqual;|Tilde;)|perset(?:;|Equal;)))|Tilde(?:;|Equal;|FullEqual;|Tilde;)|VerticalBar;))|scr;|tilde;?|u;)|O(?:Elig;|acute;?|c(?:irc;?|y;)|dblac;|fr;|grave;?|m(?:acr;|ega;|icron;)|opf;|penCurly(?:DoubleQuote;|Quote;)|r;|s(?:cr;|lash;?)|ti(?:lde;?|mes;)|uml;?|ver(?:B(?:ar;|rac(?:e;|ket;))|Parenthesis;))|P(?:artialD;|cy;|fr;|hi;|i;|lusMinus;|o(?:incareplane;|pf;)|r(?:;|ecedes(?:;|Equal;|SlantEqual;|Tilde;)|ime;|o(?:duct;|portion(?:;|al;)))|s(?:cr;|i;))|Q(?:UOT;?|fr;|opf;|scr;)|R(?:Barr;|EG;?|a(?:cute;|ng;|rr(?:;|tl;))|c(?:aron;|edil;|y;)|e(?:;|verse(?:E(?:lement;|quilibrium;)|UpEquilibrium;))|fr;|ho;|ight(?:A(?:ngleBracket;|rrow(?:;|Bar;|LeftArrow;))|Ceiling;|Do(?:ubleBracket;|wn(?:TeeVector;|Vector(?:;|Bar;)))|Floor;|T(?:ee(?:;|Arrow;|Vector;)|riangle(?:;|Bar;|Equal;))|Up(?:DownVector;|TeeVector;|Vector(?:;|Bar;))|Vector(?:;|Bar;)|arrow;)|o(?:pf;|undImplies;)|rightarrow;|s(?:cr;|h;)|uleDelayed;)|S(?:H(?:CHcy;|cy;)|OFTcy;|acute;|c(?:;|aron;|edil;|irc;|y;)|fr;|hort(?:DownArrow;|LeftArrow;|RightArrow;|UpArrow;)|igma;|mallCircle;|opf;|q(?:rt;|uare(?:;|Intersection;|Su(?:bset(?:;|Equal;)|perset(?:;|Equal;))|Union;))|scr;|tar;|u(?:b(?:;|set(?:;|Equal;))|c(?:ceeds(?:;|Equal;|SlantEqual;|Tilde;)|hThat;)|m;|p(?:;|erset(?:;|Equal;)|set;)))|T(?:HORN;?|RADE;|S(?:Hcy;|cy;)|a(?:b;|u;)|c(?:aron;|edil;|y;)|fr;|h(?:e(?:refore;|ta;)|i(?:ckSpace;|nSpace;))|ilde(?:;|Equal;|FullEqual;|Tilde;)|opf;|ripleDot;|s(?:cr;|trok;))|U(?:a(?:cute;?|rr(?:;|ocir;))|br(?:cy;|eve;)|c(?:irc;?|y;)|dblac;|fr;|grave;?|macr;|n(?:der(?:B(?:ar;|rac(?:e;|ket;))|Parenthesis;)|ion(?:;|Plus;))|o(?:gon;|pf;)|p(?:Arrow(?:;|Bar;|DownArrow;)|DownArrow;|Equilibrium;|Tee(?:;|Arrow;)|arrow;|downarrow;|per(?:LeftArrow;|RightArrow;)|si(?:;|lon;))|ring;|scr;|tilde;|uml;?)|V(?:Dash;|bar;|cy;|dash(?:;|l;)|e(?:e;|r(?:bar;|t(?:;|ical(?:Bar;|Line;|Separator;|Tilde;))|yThinSpace;))|fr;|opf;|scr;|vdash;)|W(?:circ;|edge;|fr;|opf;|scr;)|X(?:fr;|i;|opf;|scr;)|Y(?:Acy;|Icy;|Ucy;|acute;?|c(?:irc;|y;)|fr;|opf;|scr;|uml;)|Z(?:Hcy;|acute;|c(?:aron;|y;)|dot;|e(?:roWidthSpace;|ta;)|fr;|opf;|scr;)|a(?:acute;?|breve;|c(?:;|E;|d;|irc;?|ute;?|y;)|elig;?|f(?:;|r;)|grave;?|l(?:e(?:fsym;|ph;)|pha;)|m(?:a(?:cr;|lg;)|p;?)|n(?:d(?:;|and;|d;|slope;|v;)|g(?:;|e;|le;|msd(?:;|a(?:a;|b;|c;|d;|e;|f;|g;|h;))|rt(?:;|vb(?:;|d;))|s(?:ph;|t;)|zarr;))|o(?:gon;|pf;)|p(?:;|E;|acir;|e;|id;|os;|prox(?:;|eq;))|ring;?|s(?:cr;|t;|ymp(?:;|eq;))|tilde;?|uml;?|w(?:conint;|int;))|b(?:Not;|a(?:ck(?:cong;|epsilon;|prime;|sim(?:;|eq;))|r(?:vee;|wed(?:;|ge;)))|brk(?:;|tbrk;)|c(?:ong;|y;)|dquo;|e(?:caus(?:;|e;)|mptyv;|psi;|rnou;|t(?:a;|h;|ween;))|fr;|ig(?:c(?:ap;|irc;|up;)|o(?:dot;|plus;|times;)|s(?:qcup;|tar;)|triangle(?:down;|up;)|uplus;|vee;|wedge;)|karow;|l(?:a(?:ck(?:lozenge;|square;|triangle(?:;|down;|left;|right;))|nk;)|k(?:1(?:2;|4;)|34;)|ock;)|n(?:e(?:;|quiv;)|ot;)|o(?:pf;|t(?:;|tom;)|wtie;|x(?:D(?:L;|R;|l;|r;)|H(?:;|D;|U;|d;|u;)|U(?:L;|R;|l;|r;)|V(?:;|H;|L;|R;|h;|l;|r;)|box;|d(?:L;|R;|l;|r;)|h(?:;|D;|U;|d;|u;)|minus;|plus;|times;|u(?:L;|R;|l;|r;)|v(?:;|H;|L;|R;|h;|l;|r;)))|prime;|r(?:eve;|vbar;?)|s(?:cr;|emi;|im(?:;|e;)|ol(?:;|b;|hsub;))|u(?:ll(?:;|et;)|mp(?:;|E;|e(?:;|q;))))|c(?:a(?:cute;|p(?:;|and;|brcup;|c(?:ap;|up;)|dot;|s;)|r(?:et;|on;))|c(?:a(?:ps;|ron;)|edil;?|irc;|ups(?:;|sm;))|dot;|e(?:dil;?|mptyv;|nt(?:;|erdot;|))|fr;|h(?:cy;|eck(?:;|mark;)|i;)|ir(?:;|E;|c(?:;|eq;|le(?:arrow(?:left;|right;)|d(?:R;|S;|ast;|circ;|dash;)))|e;|fnint;|mid;|scir;)|lubs(?:;|uit;)|o(?:lon(?:;|e(?:;|q;))|m(?:ma(?:;|t;)|p(?:;|fn;|le(?:ment;|xes;)))|n(?:g(?:;|dot;)|int;)|p(?:f;|rod;|y(?:;|sr;|)))|r(?:arr;|oss;)|s(?:cr;|u(?:b(?:;|e;)|p(?:;|e;)))|tdot;|u(?:darr(?:l;|r;)|e(?:pr;|sc;)|larr(?:;|p;)|p(?:;|brcap;|c(?:ap;|up;)|dot;|or;|s;)|r(?:arr(?:;|m;)|ly(?:eq(?:prec;|succ;)|vee;|wedge;)|ren;?|vearrow(?:left;|right;))|vee;|wed;)|w(?:conint;|int;)|ylcty;)|d(?:Arr;|Har;|a(?:gger;|leth;|rr;|sh(?:;|v;))|b(?:karow;|lac;)|c(?:aron;|y;)|d(?:;|a(?:gger;|rr;)|otseq;)|e(?:g;?|lta;|mptyv;)|f(?:isht;|r;)|har(?:l;|r;)|i(?:am(?:;|ond(?:;|suit;)|s;)|e;|gamma;|sin;|v(?:;|ide(?:;|ontimes;|)|onx;))|jcy;|lc(?:orn;|rop;)|o(?:llar;|pf;|t(?:;|eq(?:;|dot;)|minus;|plus;|square;)|ublebarwedge;|wn(?:arrow;|downarrows;|harpoon(?:left;|right;)))|r(?:bkarow;|c(?:orn;|rop;))|s(?:c(?:r;|y;)|ol;|trok;)|t(?:dot;|ri(?:;|f;))|u(?:arr;|har;)|wangle;|z(?:cy;|igrarr;))|e(?:D(?:Dot;|ot;)|a(?:cute;?|ster;)|c(?:aron;|ir(?:;|c;?)|olon;|y;)|dot;|e;|f(?:Dot;|r;)|g(?:;|rave;?|s(?:;|dot;))|l(?:;|inters;|l;|s(?:;|dot;))|m(?:acr;|pty(?:;|set;|v;)|sp(?:1(?:3;|4;)|;))|n(?:g;|sp;)|o(?:gon;|pf;)|p(?:ar(?:;|sl;)|lus;|si(?:;|lon;|v;))|q(?:c(?:irc;|olon;)|s(?:im;|lant(?:gtr;|less;))|u(?:als;|est;|iv(?:;|DD;))|vparsl;)|r(?:Dot;|arr;)|s(?:cr;|dot;|im;)|t(?:a;|h;?)|u(?:ml;?|ro;)|x(?:cl;|ist;|p(?:ectation;|onentiale;)))|f(?:allingdotseq;|cy;|emale;|f(?:ilig;|l(?:ig;|lig;)|r;)|ilig;|jlig;|l(?:at;|lig;|tns;)|nof;|o(?:pf;|r(?:all;|k(?:;|v;)))|partint;|r(?:a(?:c(?:1(?:2;?|3;|4;?|5;|6;|8;)|2(?:3;|5;)|3(?:4;?|5;|8;)|45;|5(?:6;|8;)|78;)|sl;)|own;)|scr;)|g(?:E(?:;|l;)|a(?:cute;|mma(?:;|d;)|p;)|breve;|c(?:irc;|y;)|dot;|e(?:;|l;|q(?:;|q;|slant;)|s(?:;|cc;|dot(?:;|o(?:;|l;))|l(?:;|es;)))|fr;|g(?:;|g;)|imel;|jcy;|l(?:;|E;|a;|j;)|n(?:E;|ap(?:;|prox;)|e(?:;|q(?:;|q;))|sim;)|opf;|rave;|s(?:cr;|im(?:;|e;|l;))|t(?:;|c(?:c;|ir;)|dot;|lPar;|quest;|r(?:a(?:pprox;|rr;)|dot;|eq(?:less;|qless;)|less;|sim;)|)|v(?:ertneqq;|nE;))|h(?:Arr;|a(?:irsp;|lf;|milt;|r(?:dcy;|r(?:;|cir;|w;)))|bar;|circ;|e(?:arts(?:;|uit;)|llip;|rcon;)|fr;|ks(?:earow;|warow;)|o(?:arr;|mtht;|ok(?:leftarrow;|rightarrow;)|pf;|rbar;)|s(?:cr;|lash;|trok;)|y(?:bull;|phen;))|i(?:acute;?|c(?:;|irc;?|y;)|e(?:cy;|xcl;?)|f(?:f;|r;)|grave;?|i(?:;|i(?:int;|nt;)|nfin;|ota;)|jlig;|m(?:a(?:cr;|g(?:e;|line;|part;)|th;)|of;|ped;)|n(?:;|care;|fin(?:;|tie;)|odot;|t(?:;|cal;|e(?:gers;|rcal;)|larhk;|prod;))|o(?:cy;|gon;|pf;|ta;)|prod;|quest;?|s(?:cr;|in(?:;|E;|dot;|s(?:;|v;)|v;))|t(?:;|ilde;)|u(?:kcy;|ml;?))|j(?:c(?:irc;|y;)|fr;|math;|opf;|s(?:cr;|ercy;)|ukcy;)|k(?:appa(?:;|v;)|c(?:edil;|y;)|fr;|green;|hcy;|jcy;|opf;|scr;)|l(?:A(?:arr;|rr;|tail;)|Barr;|E(?:;|g;)|Har;|a(?:cute;|emptyv;|gran;|mbda;|ng(?:;|d;|le;)|p;|quo;?|rr(?:;|b(?:;|fs;)|fs;|hk;|lp;|pl;|sim;|tl;)|t(?:;|ail;|e(?:;|s;)))|b(?:arr;|brk;|r(?:ac(?:e;|k;)|k(?:e;|sl(?:d;|u;))))|c(?:aron;|e(?:dil;|il;)|ub;|y;)|d(?:ca;|quo(?:;|r;)|r(?:dhar;|ushar;)|sh;)|e(?:;|ft(?:arrow(?:;|tail;)|harpoon(?:down;|up;)|leftarrows;|right(?:arrow(?:;|s;)|harpoons;|squigarrow;)|threetimes;)|g;|q(?:;|q;|slant;)|s(?:;|cc;|dot(?:;|o(?:;|r;))|g(?:;|es;)|s(?:approx;|dot;|eq(?:gtr;|qgtr;)|gtr;|sim;)))|f(?:isht;|loor;|r;)|g(?:;|E;)|h(?:ar(?:d;|u(?:;|l;))|blk;)|jcy;|l(?:;|arr;|corner;|hard;|tri;)|m(?:idot;|oust(?:;|ache;))|n(?:E;|ap(?:;|prox;)|e(?:;|q(?:;|q;))|sim;)|o(?:a(?:ng;|rr;)|brk;|ng(?:left(?:arrow;|rightarrow;)|mapsto;|rightarrow;)|oparrow(?:left;|right;)|p(?:ar;|f;|lus;)|times;|w(?:ast;|bar;)|z(?:;|enge;|f;))|par(?:;|lt;)|r(?:arr;|corner;|har(?:;|d;)|m;|tri;)|s(?:aquo;|cr;|h;|im(?:;|e;|g;)|q(?:b;|uo(?:;|r;))|trok;)|t(?:;|c(?:c;|ir;)|dot;|hree;|imes;|larr;|quest;|r(?:Par;|i(?:;|e;|f;))|)|ur(?:dshar;|uhar;)|v(?:ertneqq;|nE;))|m(?:DDot;|a(?:cr;?|l(?:e;|t(?:;|ese;))|p(?:;|sto(?:;|down;|left;|up;))|rker;)|c(?:omma;|y;)|dash;|easuredangle;|fr;|ho;|i(?:cro;?|d(?:;|ast;|cir;|dot;?)|nus(?:;|b;|d(?:;|u;)))|l(?:cp;|dr;)|nplus;|o(?:dels;|pf;)|p;|s(?:cr;|tpos;)|u(?:;|ltimap;|map;))|n(?:G(?:g;|t(?:;|v;))|L(?:eft(?:arrow;|rightarrow;)|l;|t(?:;|v;))|Rightarrow;|V(?:Dash;|dash;)|a(?:bla;|cute;|ng;|p(?:;|E;|id;|os;|prox;)|tur(?:;|al(?:;|s;)))|b(?:sp;?|ump(?:;|e;))|c(?:a(?:p;|ron;)|edil;|ong(?:;|dot;)|up;|y;)|dash;|e(?:;|Arr;|ar(?:hk;|r(?:;|ow;))|dot;|quiv;|s(?:ear;|im;)|xist(?:;|s;))|fr;|g(?:E;|e(?:;|q(?:;|q;|slant;)|s;)|sim;|t(?:;|r;))|h(?:Arr;|arr;|par;)|i(?:;|s(?:;|d;)|v;)|jcy;|l(?:Arr;|E;|arr;|dr;|e(?:;|ft(?:arrow;|rightarrow;)|q(?:;|q;|slant;)|s(?:;|s;))|sim;|t(?:;|ri(?:;|e;)))|mid;|o(?:pf;|t(?:;|in(?:;|E;|dot;|v(?:a;|b;|c;))|ni(?:;|v(?:a;|b;|c;))|))|p(?:ar(?:;|allel;|sl;|t;)|olint;|r(?:;|cue;|e(?:;|c(?:;|eq;))))|r(?:Arr;|arr(?:;|c;|w;)|ightarrow;|tri(?:;|e;))|s(?:c(?:;|cue;|e;|r;)|hort(?:mid;|parallel;)|im(?:;|e(?:;|q;))|mid;|par;|qsu(?:be;|pe;)|u(?:b(?:;|E;|e;|set(?:;|eq(?:;|q;)))|cc(?:;|eq;)|p(?:;|E;|e;|set(?:;|eq(?:;|q;)))))|t(?:gl;|ilde;?|lg;|riangle(?:left(?:;|eq;)|right(?:;|eq;)))|u(?:;|m(?:;|ero;|sp;))|v(?:Dash;|Harr;|ap;|dash;|g(?:e;|t;)|infin;|l(?:Arr;|e;|t(?:;|rie;))|r(?:Arr;|trie;)|sim;)|w(?:Arr;|ar(?:hk;|r(?:;|ow;))|near;))|o(?:S;|a(?:cute;?|st;)|c(?:ir(?:;|c;?)|y;)|d(?:ash;|blac;|iv;|ot;|sold;)|elig;|f(?:cir;|r;)|g(?:on;|rave;?|t;)|h(?:bar;|m;)|int;|l(?:arr;|c(?:ir;|ross;)|ine;|t;)|m(?:acr;|ega;|i(?:cron;|d;|nus;))|opf;|p(?:ar;|erp;|lus;)|r(?:;|arr;|d(?:;|er(?:;|of;)|f;?|m;?)|igof;|or;|slope;|v;)|s(?:cr;|lash;?|ol;)|ti(?:lde;?|mes(?:;|as;))|uml;?|vbar;)|p(?:ar(?:;|a(?:;|llel;|)|s(?:im;|l;)|t;)|cy;|er(?:cnt;|iod;|mil;|p;|tenk;)|fr;|h(?:i(?:;|v;)|mmat;|one;)|i(?:;|tchfork;|v;)|l(?:an(?:ck(?:;|h;)|kv;)|us(?:;|acir;|b;|cir;|d(?:o;|u;)|e;|mn;?|sim;|two;))|m;|o(?:intint;|pf;|und;?)|r(?:;|E;|ap;|cue;|e(?:;|c(?:;|approx;|curlyeq;|eq;|n(?:approx;|eqq;|sim;)|sim;))|ime(?:;|s;)|n(?:E;|ap;|sim;)|o(?:d;|f(?:alar;|line;|surf;)|p(?:;|to;))|sim;|urel;)|s(?:cr;|i;)|uncsp;)|q(?:fr;|int;|opf;|prime;|scr;|u(?:at(?:ernions;|int;)|est(?:;|eq;)|ot;?))|r(?:A(?:arr;|rr;|tail;)|Barr;|Har;|a(?:c(?:e;|ute;)|dic;|emptyv;|ng(?:;|d;|e;|le;)|quo;?|rr(?:;|ap;|b(?:;|fs;)|c;|fs;|hk;|lp;|pl;|sim;|tl;|w;)|t(?:ail;|io(?:;|nals;)))|b(?:arr;|brk;|r(?:ac(?:e;|k;)|k(?:e;|sl(?:d;|u;))))|c(?:aron;|e(?:dil;|il;)|ub;|y;)|d(?:ca;|ldhar;|quo(?:;|r;)|sh;)|e(?:al(?:;|ine;|part;|s;)|ct;|g;?)|f(?:isht;|loor;|r;)|h(?:ar(?:d;|u(?:;|l;))|o(?:;|v;))|i(?:ght(?:arrow(?:;|tail;)|harpoon(?:down;|up;)|left(?:arrows;|harpoons;)|rightarrows;|squigarrow;|threetimes;)|ng;|singdotseq;)|l(?:arr;|har;|m;)|moust(?:;|ache;)|nmid;|o(?:a(?:ng;|rr;)|brk;|p(?:ar;|f;|lus;)|times;)|p(?:ar(?:;|gt;)|polint;)|rarr;|s(?:aquo;|cr;|h;|q(?:b;|uo(?:;|r;)))|t(?:hree;|imes;|ri(?:;|e;|f;|ltri;))|uluhar;|x;)|s(?:acute;|bquo;|c(?:;|E;|a(?:p;|ron;)|cue;|e(?:;|dil;)|irc;|n(?:E;|ap;|sim;)|polint;|sim;|y;)|dot(?:;|b;|e;)|e(?:Arr;|ar(?:hk;|r(?:;|ow;))|ct;?|mi;|swar;|tm(?:inus;|n;)|xt;)|fr(?:;|own;)|h(?:arp;|c(?:hcy;|y;)|ort(?:mid;|parallel;)|y;?)|i(?:gma(?:;|f;|v;)|m(?:;|dot;|e(?:;|q;)|g(?:;|E;)|l(?:;|E;)|ne;|plus;|rarr;))|larr;|m(?:a(?:llsetminus;|shp;)|eparsl;|i(?:d;|le;)|t(?:;|e(?:;|s;)))|o(?:ftcy;|l(?:;|b(?:;|ar;))|pf;)|pa(?:des(?:;|uit;)|r;)|q(?:c(?:ap(?:;|s;)|up(?:;|s;))|su(?:b(?:;|e;|set(?:;|eq;))|p(?:;|e;|set(?:;|eq;)))|u(?:;|ar(?:e;|f;)|f;))|rarr;|s(?:cr;|etmn;|mile;|tarf;)|t(?:ar(?:;|f;)|r(?:aight(?:epsilon;|phi;)|ns;))|u(?:b(?:;|E;|dot;|e(?:;|dot;)|mult;|n(?:E;|e;)|plus;|rarr;|s(?:et(?:;|eq(?:;|q;)|neq(?:;|q;))|im;|u(?:b;|p;)))|cc(?:;|approx;|curlyeq;|eq;|n(?:approx;|eqq;|sim;)|sim;)|m;|ng;|p(?:1;?|2;?|3;?|;|E;|d(?:ot;|sub;)|e(?:;|dot;)|hs(?:ol;|ub;)|larr;|mult;|n(?:E;|e;)|plus;|s(?:et(?:;|eq(?:;|q;)|neq(?:;|q;))|im;|u(?:b;|p;))))|w(?:Arr;|ar(?:hk;|r(?:;|ow;))|nwar;)|zlig;?)|t(?:a(?:rget;|u;)|brk;|c(?:aron;|edil;|y;)|dot;|elrec;|fr;|h(?:e(?:re(?:4;|fore;)|ta(?:;|sym;|v;))|i(?:ck(?:approx;|sim;)|nsp;)|k(?:ap;|sim;)|orn;?)|i(?:lde;|mes(?:;|b(?:;|ar;)|d;|)|nt;)|o(?:ea;|p(?:;|bot;|cir;|f(?:;|ork;))|sa;)|prime;|r(?:ade;|i(?:angle(?:;|down;|left(?:;|eq;)|q;|right(?:;|eq;))|dot;|e;|minus;|plus;|sb;|time;)|pezium;)|s(?:c(?:r;|y;)|hcy;|trok;)|w(?:ixt;|ohead(?:leftarrow;|rightarrow;)))|u(?:Arr;|Har;|a(?:cute;?|rr;)|br(?:cy;|eve;)|c(?:irc;?|y;)|d(?:arr;|blac;|har;)|f(?:isht;|r;)|grave;?|h(?:ar(?:l;|r;)|blk;)|l(?:c(?:orn(?:;|er;)|rop;)|tri;)|m(?:acr;|l;?)|o(?:gon;|pf;)|p(?:arrow;|downarrow;|harpoon(?:left;|right;)|lus;|si(?:;|h;|lon;)|uparrows;)|r(?:c(?:orn(?:;|er;)|rop;)|ing;|tri;)|scr;|t(?:dot;|ilde;|ri(?:;|f;))|u(?:arr;|ml;?)|wangle;)|v(?:Arr;|Bar(?:;|v;)|Dash;|a(?:ngrt;|r(?:epsilon;|kappa;|nothing;|p(?:hi;|i;|ropto;)|r(?:;|ho;)|s(?:igma;|u(?:bsetneq(?:;|q;)|psetneq(?:;|q;)))|t(?:heta;|riangle(?:left;|right;))))|cy;|dash;|e(?:e(?:;|bar;|eq;)|llip;|r(?:bar;|t;))|fr;|ltri;|nsu(?:b;|p;)|opf;|prop;|rtri;|s(?:cr;|u(?:bn(?:E;|e;)|pn(?:E;|e;)))|zigzag;)|w(?:circ;|e(?:d(?:bar;|ge(?:;|q;))|ierp;)|fr;|opf;|p;|r(?:;|eath;)|scr;)|x(?:c(?:ap;|irc;|up;)|dtri;|fr;|h(?:Arr;|arr;)|i;|l(?:Arr;|arr;)|map;|nis;|o(?:dot;|p(?:f;|lus;)|time;)|r(?:Arr;|arr;)|s(?:cr;|qcup;)|u(?:plus;|tri;)|vee;|wedge;)|y(?:ac(?:ute;?|y;)|c(?:irc;|y;)|en;?|fr;|icy;|opf;|scr;|u(?:cy;|ml;?))|z(?:acute;|c(?:aron;|y;)|dot;|e(?:etrf;|ta;)|fr;|hcy;|igrarr;|opf;|scr;|w(?:j;|nj;)))|[\s\S]/g,uP=32,dP=/[^\r"&\u0000]+/g,pP=/[^\r'&\u0000]+/g,cP=/[^\r\t\n\f &>\u0000]+/g,lP=/[^\r\t\n\f \/>A-Z\u0000]+/g,oP=/[^\r\t\n\f \/=>A-Z\u0000]+/g,rP=/[^\]\r\u0000\uffff]*/g,iP=/[^&<\r\u0000\uffff]*/g,Rj=/[^<\r\u0000\uffff]*/g,sP=/[^\r\u0000\uffff]*/g,Lj=/(?:(\/)?([a-z]+)>)|[\s\S]/g,Nj=/(?:([-a-z]+)[ \t\n\f]*=[ \t\n\f]*('[^'&\r\u0000]*'|"[^"&\r\u0000]*"|[^\t\n\r\f "&'\u0000>][^&> \t\n\r\f\u0000]*[ \t\n\f]))|[\s\S]/g,V6=/[^\x09\x0A\x0C\x0D\x20]/,Z3=/[^\x09\x0A\x0C\x0D\x20]/g,nP=/[^\x00\x09\x0A\x0C\x0D\x20]/,e2=/^[\x09\x0A\x0C\x0D\x20]+/,G6=/\x00/g;function y0($){var J=16384;if($.length<J)return String.fromCharCode.apply(String,$);var Z="";for(var Y=0;Y<$.length;Y+=J)Z+=String.fromCharCode.apply(String,$.slice(Y,Y+J));return Z}function aP($){var J=[];for(var Z=0;Z<$.length;Z++)J[Z]=$.charCodeAt(Z);return J}function d$($,J){if(typeof J==="string")return $.namespaceURI===X$.HTML&&$.localName===J;var Z=J[$.namespaceURI];return Z&&Z[$.localName]}function yj($){return d$($,uj)}function Tj($){if(d$($,dj))return!0;if($.namespaceURI===X$.MATHML&&$.localName==="annotation-xml"){var J=$.getAttribute("encoding");if(J)J=J.toLowerCase();if(J==="text/html"||J==="application/xhtml+xml")return!0}return!1}function tP($){if($ in Aj)return Aj[$];else return $}function kj($){for(var J=0,Z=$.length;J<Z;J++)if($[J][0]in Ij)$[J][0]=Ij[$[J][0]]}function Ej($){for(var J=0,Z=$.length;J<Z;J++)if($[J][0]==="definitionurl"){$[J][0]="definitionURL";break}}function Y3($){for(var J=0,Z=$.length;J<Z;J++)if($[J][0]in Pj)$[J].push(Pj[$[J][0]])}function xj($,J){for(var Z=0,Y=$.length;Z<Y;Z++){var K=$[Z][0],Q=$[Z][1];if(J.hasAttribute(K))continue;J._setAttribute(K,Q)}}b$.ElementStack=function(){this.elements=[],this.top=null};b$.ElementStack.prototype.push=function($){this.elements.push($),this.top=$};b$.ElementStack.prototype.pop=function($){this.elements.pop(),this.top=this.elements[this.elements.length-1]};b$.ElementStack.prototype.popTag=function($){for(var J=this.elements.length-1;J>0;J--){var Z=this.elements[J];if(d$(Z,$))break}this.elements.length=J,this.top=this.elements[J-1]};b$.ElementStack.prototype.popElementType=function($){for(var J=this.elements.length-1;J>0;J--)if(this.elements[J]instanceof $)break;this.elements.length=J,this.top=this.elements[J-1]};b$.ElementStack.prototype.popElement=function($){for(var J=this.elements.length-1;J>0;J--)if(this.elements[J]===$)break;this.elements.length=J,this.top=this.elements[J-1]};b$.ElementStack.prototype.removeElement=function($){if(this.top===$)this.pop();else{var J=this.elements.lastIndexOf($);if(J!==-1)this.elements.splice(J,1)}};b$.ElementStack.prototype.clearToContext=function($){for(var J=this.elements.length-1;J>0;J--)if(d$(this.elements[J],$))break;this.elements.length=J+1,this.top=this.elements[J]};b$.ElementStack.prototype.contains=function($){return this.inSpecificScope($,Object.create(null))};b$.ElementStack.prototype.inSpecificScope=function($,J){for(var Z=this.elements.length-1;Z>=0;Z--){var Y=this.elements[Z];if(d$(Y,$))return!0;if(d$(Y,J))return!1}return!1};b$.ElementStack.prototype.elementInSpecificScope=function($,J){for(var Z=this.elements.length-1;Z>=0;Z--){var Y=this.elements[Z];if(Y===$)return!0;if(d$(Y,J))return!1}return!1};b$.ElementStack.prototype.elementTypeInSpecificScope=function($,J){for(var Z=this.elements.length-1;Z>=0;Z--){var Y=this.elements[Z];if(Y instanceof $)return!0;if(d$(Y,J))return!1}return!1};b$.ElementStack.prototype.inScope=function($){return this.inSpecificScope($,T1)};b$.ElementStack.prototype.elementInScope=function($){return this.elementInSpecificScope($,T1)};b$.ElementStack.prototype.elementTypeInScope=function($){return this.elementTypeInSpecificScope($,T1)};b$.ElementStack.prototype.inButtonScope=function($){return this.inSpecificScope($,V3)};b$.ElementStack.prototype.inListItemScope=function($){return this.inSpecificScope($,j6)};b$.ElementStack.prototype.inTableScope=function($){return this.inSpecificScope($,mj)};b$.ElementStack.prototype.inSelectScope=function($){for(var J=this.elements.length-1;J>=0;J--){var Z=this.elements[J];if(Z.namespaceURI!==X$.HTML)return!1;var Y=Z.localName;if(Y===$)return!0;if(Y!=="optgroup"&&Y!=="option")return!1}return!1};b$.ElementStack.prototype.generateImpliedEndTags=function($,J){var Z=J?gj:hj;for(var Y=this.elements.length-1;Y>=0;Y--){var K=this.elements[Y];if($&&d$(K,$))break;if(!d$(this.elements[Y],Z))break}this.elements.length=Y+1,this.top=this.elements[Y]};b$.ActiveFormattingElements=function(){this.list=[],this.attrs=[]};b$.ActiveFormattingElements.prototype.MARKER={localName:"|"};b$.ActiveFormattingElements.prototype.insertMarker=function(){this.list.push(this.MARKER),this.attrs.push(this.MARKER)};b$.ActiveFormattingElements.prototype.push=function($,J){var Z=0;for(var Y=this.list.length-1;Y>=0;Y--){if(this.list[Y]===this.MARKER)break;if(V($,this.list[Y],this.attrs[Y])){if(Z++,Z===3){this.list.splice(Y,1),this.attrs.splice(Y,1);break}}}this.list.push($);var K=[];for(var Q=0;Q<J.length;Q++)K[Q]=J[Q];this.attrs.push(K);function V(X,W,_){if(X.localName!==W.localName)return!1;if(X._numattrs!==_.length)return!1;for(var j=0,H=_.length;j<H;j++){var q=_[j][0],U=_[j][1];if(!X.hasAttribute(q))return!1;if(X.getAttribute(q)!==U)return!1}return!0}};b$.ActiveFormattingElements.prototype.clearToMarker=function(){for(var $=this.list.length-1;$>=0;$--)if(this.list[$]===this.MARKER)break;if($<0)$=0;this.list.length=$,this.attrs.length=$};b$.ActiveFormattingElements.prototype.findElementByTag=function($){for(var J=this.list.length-1;J>=0;J--){var Z=this.list[J];if(Z===this.MARKER)break;if(Z.localName===$)return Z}return null};b$.ActiveFormattingElements.prototype.indexOf=function($){return this.list.lastIndexOf($)};b$.ActiveFormattingElements.prototype.remove=function($){var J=this.list.lastIndexOf($);if(J!==-1)this.list.splice(J,1),this.attrs.splice(J,1)};b$.ActiveFormattingElements.prototype.replace=function($,J,Z){var Y=this.list.lastIndexOf($);if(Y!==-1)this.list[Y]=J,this.attrs[Y]=Z};b$.ActiveFormattingElements.prototype.insertAfter=function($,J){var Z=this.list.lastIndexOf($);if(Z!==-1)this.list.splice(Z,0,J),this.attrs.splice(Z,0,J)};function b$($,J,Z){var Y=null,K=0,Q=0,V=!1,X=!1,W=0,_=[],j="",H=!0,q=0,U=S$,z,M,I="",C="",P=[],D="",L="",R=[],N=[],x=[],b=[],v=[],m=!1,A=fH,u=null,r=[],S=new b$.ElementStack,T=new b$.ActiveFormattingElements,k=J!==void 0,A$=null,s=null,J$=!0;if(J)J$=J.ownerDocument._scripting_enabled;if(Z&&Z.scripting_enabled===!1)J$=!1;var Z$=!0,W$=!1,y$,Q$,y=[],n=!1,a=!1,c$={document:function(){return l},_asDocumentFragment:function(){var B=l.createDocumentFragment(),O=l.firstChild;while(O.hasChildNodes())B.appendChild(O.firstChild);return B},pause:function(){q++},resume:function(){q--,this.parse("")},parse:function(B,O,w){var E;if(q>0)return j+=B,!0;if(W===0){if(j)B=j+B,j="";if(O)B+="\uFFFF",V=!0;if(Y=B,K=B.length,Q=0,H){if(H=!1,Y.charCodeAt(0)===65279)Q=1}W++,E=g(w),j=Y.substring(Q,K),W--}else{if(W++,_.push(Y,K,Q),Y=B,K=B.length,Q=0,g(),E=!1,j=Y.substring(Q,K),Q=_.pop(),K=_.pop(),Y=_.pop(),j)Y=j+Y.substring(Q),K=Y.length,Q=0,j="";W--}return E}},l=new kP(!0,$);if(l._parser=c$,l._scripting_enabled=J$,J){if(J.ownerDocument._quirks)l._quirks=!0;if(J.ownerDocument._limitedQuirks)l._limitedQuirks=!0;if(J.namespaceURI===X$.HTML)switch(J.localName){case"title":case"textarea":U=J2;break;case"style":case"xmp":case"iframe":case"noembed":case"noframes":case"script":case"plaintext":U=L6;break}var d=l.createElement("html");if(l._appendChild(d),S.push(d),J instanceof u$.HTMLTemplateElement)r.push(g6);nJ();for(var Y$=J;Y$!==null;Y$=Y$.parentElement)if(Y$ instanceof u$.HTMLFormElement){s=Y$;break}}function g(B){var O,w,E,h;while(Q<K){if(q>0||B&&B())return!0;switch(typeof U.lookahead){case"undefined":if(O=Y.charCodeAt(Q++),X){if(X=!1,O===10){Q++;continue}}switch(O){case 13:if(Q<K){if(Y.charCodeAt(Q)===10)Q++}else X=!0;U(10);break;case 65535:if(V&&Q===K){U(Q6);break}default:U(O);break}break;case"number":O=Y.charCodeAt(Q);var c=U.lookahead,U$=!0;if(c<0)U$=!1,c=-c;if(c<K-Q)w=U$?Y.substring(Q,Q+c):null,h=!1;else if(V){if(w=U$?Y.substring(Q,K):null,h=!0,O===65535&&Q===K-1)O=Q6}else return!0;U(O,w,h);break;case"string":O=Y.charCodeAt(Q),E=U.lookahead;var w$=Y.indexOf(E,Q);if(w$!==-1)w=Y.substring(Q,w$+E.length),h=!1;else{if(!V)return!0;if(w=Y.substring(Q,K),O===65535&&Q===K-1)O=Q6;h=!0}U(O,w,h);break}}return!1}function t(B,O){for(var w=0;w<v.length;w++)if(v[w][0]===B)return;if(O!==void 0)v.push([B,O]);else v.push([B])}function C$(){Nj.lastIndex=Q-1;var B=Nj.exec(Y);if(!B)throw Error("should never happen");var O=B[1];if(!O)return!1;var w=B[2],E=w.length;switch(w[0]){case'"':case"'":w=w.substring(1,E-1),Q+=B[0].length-1,U=k6;break;default:U=A1,Q+=B[0].length-1,w=w.substring(0,E-1);break}for(var h=0;h<v.length;h++)if(v[h][0]===O)return!0;return v.push([O,w]),!0}function T$(){m=!1,I="",v.length=0}function M$(){m=!0,I="",v.length=0}function r$(){P.length=0}function K0(){D=""}function t1(){L=""}function a8(){R.length=0}function e1(){N.length=0,x=null,b=null}function C1(){x=[]}function M1(){b=[]}function h$(){W$=!0}function lB(){return S.top&&S.top.namespaceURI!=="http://www.w3.org/1999/xhtml"}function i0(B){return C===B}function VJ(){if(y.length>0){var B=y0(y);if(y.length=0,a){if(a=!1,B[0]===`
33
- `)B=B.substring(1);if(B.length===0)return}j0(cJ,B),n=!1}a=!1}function rJ(B){B.lastIndex=Q-1;var O=B.exec(Y);if(O&&O.index===Q-1){if(O=O[0],Q+=O.length-1,V&&Q===K)O=O.slice(0,-1),Q--;return O}else throw Error("should never happen")}function iJ(B){B.lastIndex=Q-1;var O=B.exec(Y)[0];if(!O)return!1;return oB(O),Q+=O.length-1,!0}function oB(B){if(y.length>0)VJ();if(a){if(a=!1,B[0]===`
34
- `)B=B.substring(1);if(B.length===0)return}j0(cJ,B)}function k1(){if(m)j0(N$,I);else{var B=I;I="",C=B,j0(N0,B,v)}}function rB(){if(Q===K)return!1;Lj.lastIndex=Q;var B=Lj.exec(Y);if(!B)throw Error("should never happen");var O=B[2];if(!O)return!1;var w=B[1];if(w)Q+=O.length+2,j0(N$,O);else Q+=O.length+1,C=O,j0(N0,O,bP);return!0}function iB(){if(m)j0(N$,I,null,!0);else j0(N0,I,v,!0)}function g$(){j0(xP,y0(N),x?y0(x):void 0,b?y0(b):void 0)}function I$(){VJ(),A(Q6),l.modclock=1}var j0=c$.insertToken=function(O,w,E,h){VJ();var c=S.top;if(!c||c.namespaceURI===X$.HTML)A(O,w,E,h);else if(O!==N0&&O!==cJ)ZK(O,w,E,h);else if(yj(c)&&(O===cJ||O===N0&&w!=="mglyph"&&w!=="malignmark")||O===N0&&w==="svg"&&c.namespaceURI===X$.MATHML&&c.localName==="annotation-xml"||Tj(c))Q$=!0,A(O,w,E,h),Q$=!1;else ZK(O,w,E,h)};function D1(B){var O=S.top;if($2&&d$(O,lJ))e8(function(w){return w.createComment(B)});else{if(O instanceof u$.HTMLTemplateElement)O=O.content;O._appendChild(O.ownerDocument.createComment(B))}}function P1(B){var O=S.top;if($2&&d$(O,lJ))e8(function(E){return E.createTextNode(B)});else{if(O instanceof u$.HTMLTemplateElement)O=O.content;var w=O.lastChild;if(w&&w.nodeType===J3.TEXT_NODE)w.appendData(B);else O._appendChild(O.ownerDocument.createTextNode(B))}}function sJ(B,O,w){var E=bj.createElement(B,O,null);if(w)for(var h=0,c=w.length;h<c;h++)E._setAttribute(w[h][0],w[h][1]);return E}var $2=!1;function q$(B,O){var w=t8(function(E){return sJ(E,B,O)});if(d$(w,fj))w._form=s;return w}function t8(B){var O;if($2&&d$(S.top,lJ))O=e8(B);else if(S.top instanceof u$.HTMLTemplateElement)O=B(S.top.content.ownerDocument),S.top.content._appendChild(O);else O=B(S.top.ownerDocument),S.top._appendChild(O);return S.push(O),O}function w6(B,O,w){return t8(function(E){var h=E._createElementNS(B,w,null);if(O)for(var c=0,U$=O.length;c<U$;c++){var w$=O[c];if(w$.length===2)h._setAttribute(w$[0],w$[1]);else h._setAttributeNS(w$[2],w$[0],w$[1])}return h})}function u3(B){for(var O=S.elements.length-1;O>=0;O--)if(S.elements[O]instanceof B)return O;return-1}function e8(B){var O,w,E=-1,h=-1,c;if(E=u3(u$.HTMLTableElement),h=u3(u$.HTMLTemplateElement),h>=0&&(E<0||h>E))O=S.elements[h];else if(E>=0)if(O=S.elements[E].parentNode,O)w=S.elements[E];else O=S.elements[E-1];if(!O)O=S.elements[0];if(O instanceof u$.HTMLTemplateElement)O=O.content;if(c=B(O.ownerDocument),c.nodeType===J3.TEXT_NODE){var U$;if(w)U$=w.previousSibling;else U$=O.lastChild;if(U$&&U$.nodeType===J3.TEXT_NODE)return U$.appendData(c.data),c}if(w)O.insertBefore(c,w);else O._appendChild(c);return c}function nJ(){var B=!1;for(var O=S.elements.length-1;O>=0;O--){var w=S.elements[O];if(O===0){if(B=!0,k)w=J}if(w.namespaceURI===X$.HTML){var E=w.localName;switch(E){case"select":for(var h=O;h>0;){var c=S.elements[--h];if(c instanceof u$.HTMLTemplateElement)break;else if(c instanceof u$.HTMLTableElement){A=H9;return}}A=E1;return;case"tr":A=eJ;return;case"tbody":case"tfoot":case"thead":A=I2;return;case"caption":A=h6;return;case"colgroup":A=B9;return;case"table":A=s0;return;case"template":A=r[r.length-1];return;case"body":A=j$;return;case"frameset":A=f6;return;case"html":if(A$===null)A=j9;else A=v6;return;default:if(!B){if(E==="head"){A=Q0;return}if(E==="td"||E==="th"){A=GJ;return}}}}if(B){A=j$;return}}}function $9(B,O){q$(B,O),U=aJ,u=A,A=U9}function sB(B,O){q$(B,O),U=J2,u=A,A=U9}function R6(B,O){return{elt:sJ(B,T.list[O].localName,T.attrs[O]),attrs:T.attrs[O]}}function k0(){if(T.list.length===0)return;var B=T.list[T.list.length-1];if(B===T.MARKER)return;if(S.elements.lastIndexOf(B)!==-1)return;for(var O=T.list.length-2;O>=0;O--){if(B=T.list[O],B===T.MARKER)break;if(S.elements.lastIndexOf(B)!==-1)break}for(O=O+1;O<T.list.length;O++){var w=t8(function(E){return R6(E,O).elt});T.list[O]=w}}var J9={localName:"BM"};function nB(B){if(d$(S.top,B)&&T.indexOf(S.top)===-1)return S.pop(),!0;var O=0;while(O<8){O++;var w=T.findElementByTag(B);if(!w)return!1;var E=S.elements.lastIndexOf(w);if(E===-1)return T.remove(w),!0;if(!S.elementInScope(w))return!0;var h=null,c;for(var U$=E+1;U$<S.elements.length;U$++)if(d$(S.elements[U$],$J)){h=S.elements[U$],c=U$;break}if(!h)return S.popElement(w),T.remove(w),!0;else{var w$=S.elements[E-1];T.insertAfter(w,J9);var J0=h,M0=h,n0=c,X1,A2=0;while(!0){if(A2++,J0=S.elements[--n0],J0===w)break;if(X1=T.indexOf(J0),A2>3&&X1!==-1)T.remove(J0),X1=-1;if(X1===-1){S.removeElement(J0);continue}var V2=R6(w$.ownerDocument,X1);if(T.replace(J0,V2.elt,V2.attrs),S.elements[n0]=V2.elt,J0=V2.elt,M0===h)T.remove(J9),T.insertAfter(V2.elt,J9);J0._appendChild(M0),M0=J0}if($2&&d$(w$,lJ))e8(function(){return M0});else if(w$ instanceof u$.HTMLTemplateElement)w$.content._appendChild(M0);else w$._appendChild(M0);var $8=R6(h.ownerDocument,T.indexOf(w));while(h.hasChildNodes())$8.elt._appendChild(h.firstChild);h._appendChild($8.elt),T.remove(w),T.replace(J9,$8.elt,$8.attrs),S.removeElement(w);var cH=S.elements.lastIndexOf(h);S.elements.splice(cH+1,0,$8.elt)}}return!0}function aB(){S.pop(),A=u;return}function M2(){if(delete l._parser,S.elements.length=0,l.defaultView)l.defaultView.dispatchEvent(new u$.Event("load",{}))}function V$(B,O){U=O,Q--}function S$(B){switch(B){case 38:z=S$,U=tJ;break;case 60:if(rB())break;U=tB;break;case 0:y.push(B),n=!0;break;case-1:I$();break;default:iJ(iP)||y.push(B);break}}function J2(B){switch(B){case 38:z=J2,U=tJ;break;case 60:U=$H;break;case 0:y.push(65533),n=!0;break;case-1:I$();break;default:y.push(B);break}}function aJ(B){switch(B){case 60:U=YH;break;case 0:y.push(65533);break;case-1:I$();break;default:iJ(Rj)||y.push(B);break}}function Z2(B){switch(B){case 60:U=VH;break;case 0:y.push(65533);break;case-1:I$();break;default:iJ(Rj)||y.push(B);break}}function L6(B){switch(B){case 0:y.push(65533);break;case-1:I$();break;default:iJ(sP)||y.push(B);break}}function tB(B){switch(B){case 33:U=l3;break;case 47:U=eB;break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:T$(),V$(B,d3);break;case 63:V$(B,Q9);break;default:y.push(60),V$(B,S$);break}}function eB(B){switch(B){case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:M$(),V$(B,d3);break;case 62:U=S$;break;case-1:y.push(60),y.push(47),I$();break;default:V$(B,Q9);break}}function d3(B){switch(B){case 9:case 10:case 12:case 32:U=A1;break;case 47:U=K2;break;case 62:U=S$,k1();break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:I+=String.fromCharCode(B+32);break;case 0:I+=String.fromCharCode(65533);break;case-1:I$();break;default:I+=rJ(lP);break}}function $H(B){if(B===47)r$(),U=JH;else y.push(60),V$(B,J2)}function JH(B){switch(B){case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:M$(),V$(B,ZH);break;default:y.push(60),y.push(47),V$(B,J2);break}}function ZH(B){switch(B){case 9:case 10:case 12:case 32:if(i0(I)){U=A1;return}break;case 47:if(i0(I)){U=K2;return}break;case 62:if(i0(I)){U=S$,k1();return}break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:I+=String.fromCharCode(B+32),P.push(B);return;case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:I+=String.fromCharCode(B),P.push(B);return;default:break}y.push(60),y.push(47),t2(y,P),V$(B,J2)}function YH(B){if(B===47)r$(),U=KH;else y.push(60),V$(B,aJ)}function KH(B){switch(B){case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:M$(),V$(B,QH);break;default:y.push(60),y.push(47),V$(B,aJ);break}}function QH(B){switch(B){case 9:case 10:case 12:case 32:if(i0(I)){U=A1;return}break;case 47:if(i0(I)){U=K2;return}break;case 62:if(i0(I)){U=S$,k1();return}break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:I+=String.fromCharCode(B+32),P.push(B);return;case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:I+=String.fromCharCode(B),P.push(B);return;default:break}y.push(60),y.push(47),t2(y,P),V$(B,aJ)}function VH(B){switch(B){case 47:r$(),U=GH;break;case 33:U=WH,y.push(60),y.push(33);break;default:y.push(60),V$(B,Z2);break}}function GH(B){switch(B){case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:M$(),V$(B,XH);break;default:y.push(60),y.push(47),V$(B,Z2);break}}function XH(B){switch(B){case 9:case 10:case 12:case 32:if(i0(I)){U=A1;return}break;case 47:if(i0(I)){U=K2;return}break;case 62:if(i0(I)){U=S$,k1();return}break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:I+=String.fromCharCode(B+32),P.push(B);return;case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:I+=String.fromCharCode(B),P.push(B);return;default:break}y.push(60),y.push(47),t2(y,P),V$(B,Z2)}function WH(B){if(B===45)U=jH,y.push(45);else V$(B,Z2)}function jH(B){if(B===45)U=p3,y.push(45);else V$(B,Z2)}function I1(B){switch(B){case 45:U=UH,y.push(45);break;case 60:U=N6;break;case 0:y.push(65533);break;case-1:I$();break;default:y.push(B);break}}function UH(B){switch(B){case 45:U=p3,y.push(45);break;case 60:U=N6;break;case 0:U=I1,y.push(65533);break;case-1:I$();break;default:U=I1,y.push(B);break}}function p3(B){switch(B){case 45:y.push(45);break;case 60:U=N6;break;case 62:U=Z2,y.push(62);break;case 0:U=I1,y.push(65533);break;case-1:I$();break;default:U=I1,y.push(B);break}}function N6(B){switch(B){case 47:r$(),U=BH;break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:r$(),y.push(60),V$(B,_H);break;default:y.push(60),V$(B,I1);break}}function BH(B){switch(B){case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:M$(),V$(B,HH);break;default:y.push(60),y.push(47),V$(B,I1);break}}function HH(B){switch(B){case 9:case 10:case 12:case 32:if(i0(I)){U=A1;return}break;case 47:if(i0(I)){U=K2;return}break;case 62:if(i0(I)){U=S$,k1();return}break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:I+=String.fromCharCode(B+32),P.push(B);return;case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:I+=String.fromCharCode(B),P.push(B);return;default:break}y.push(60),y.push(47),t2(y,P),V$(B,I1)}function _H(B){switch(B){case 9:case 10:case 12:case 32:case 47:case 62:if(y0(P)==="script")U=Y2;else U=I1;y.push(B);break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:P.push(B+32),y.push(B);break;case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:P.push(B),y.push(B);break;default:V$(B,I1);break}}function Y2(B){switch(B){case 45:U=OH,y.push(45);break;case 60:U=y6,y.push(60);break;case 0:y.push(65533);break;case-1:I$();break;default:y.push(B);break}}function OH(B){switch(B){case 45:U=qH,y.push(45);break;case 60:U=y6,y.push(60);break;case 0:U=Y2,y.push(65533);break;case-1:I$();break;default:U=Y2,y.push(B);break}}function qH(B){switch(B){case 45:y.push(45);break;case 60:U=y6,y.push(60);break;case 62:U=Z2,y.push(62);break;case 0:U=Y2,y.push(65533);break;case-1:I$();break;default:U=Y2,y.push(B);break}}function y6(B){if(B===47)r$(),U=FH,y.push(47);else V$(B,Y2)}function FH(B){switch(B){case 9:case 10:case 12:case 32:case 47:case 62:if(y0(P)==="script")U=I1;else U=Y2;y.push(B);break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:P.push(B+32),y.push(B);break;case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:P.push(B),y.push(B);break;default:V$(B,Y2);break}}function A1(B){switch(B){case 9:case 10:case 12:case 32:break;case 47:U=K2;break;case 62:U=S$,k1();break;case-1:I$();break;case 61:K0(),D+=String.fromCharCode(B),U=T6;break;default:if(C$())break;K0(),V$(B,T6);break}}function T6(B){switch(B){case 9:case 10:case 12:case 32:case 47:case 62:case-1:V$(B,zH);break;case 61:U=c3;break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:D+=String.fromCharCode(B+32);break;case 0:D+=String.fromCharCode(65533);break;case 34:case 39:case 60:default:D+=rJ(oP);break}}function zH(B){switch(B){case 9:case 10:case 12:case 32:break;case 47:t(D),U=K2;break;case 61:U=c3;break;case 62:U=S$,t(D),k1();break;case-1:t(D),I$();break;default:t(D),K0(),V$(B,T6);break}}function c3(B){switch(B){case 9:case 10:case 12:case 32:break;case 34:t1(),U=Z9;break;case 39:t1(),U=Y9;break;case 62:default:t1(),V$(B,K9);break}}function Z9(B){switch(B){case 34:t(D,L),U=k6;break;case 38:z=Z9,U=tJ;break;case 0:L+=String.fromCharCode(65533);break;case-1:I$();break;case 10:L+=String.fromCharCode(B);break;default:L+=rJ(dP);break}}function Y9(B){switch(B){case 39:t(D,L),U=k6;break;case 38:z=Y9,U=tJ;break;case 0:L+=String.fromCharCode(65533);break;case-1:I$();break;case 10:L+=String.fromCharCode(B);break;default:L+=rJ(pP);break}}function K9(B){switch(B){case 9:case 10:case 12:case 32:t(D,L),U=A1;break;case 38:z=K9,U=tJ;break;case 62:t(D,L),U=S$,k1();break;case 0:L+=String.fromCharCode(65533);break;case-1:Q--,U=S$;break;case 34:case 39:case 60:case 61:case 96:default:L+=rJ(cP);break}}function k6(B){switch(B){case 9:case 10:case 12:case 32:U=A1;break;case 47:U=K2;break;case 62:U=S$,k1();break;case-1:I$();break;default:V$(B,A1);break}}function K2(B){switch(B){case 62:U=S$,iB(!0);break;case-1:I$();break;default:V$(B,A1);break}}function Q9(B,O,w){var E=O.length;if(w)Q+=E-1;else Q+=E;var h=O.substring(0,E-1);h=h.replace(/\u0000/g,"\uFFFD"),h=h.replace(/\u000D\u000A/g,`
31
+ `;Z+=_,Z+="</"+V+">"}break;case 3:case 4:var j;if(J.nodeType===1&&J.namespaceURI===s2.HTML)j=J.tagName;else j="";if(_W[j]||j==="NOSCRIPT"&&J.ownerDocument._scripting_enabled)Z+=$.data;else Z+=tC($.data);break;case 8:Z+="<!--"+MW($.data)+"-->";break;case 7:let B=CW($.data);Z+="<?"+$.target+" "+B+"?>";break;case 10:Z+="<!DOCTYPE "+$.name,Z+=">";break;default:FW.InvalidStateError()}return Z}});var P0=p((Tb,wW)=>{wW.exports=$0;var RW=ZY(),gZ=YY(),PW=KY(),m$=G0();function $0(){RW.call(this),this.parentNode=null,this._nextSibling=this._previousSibling=this,this._index=void 0}var f0=$0.ELEMENT_NODE=1,VY=$0.ATTRIBUTE_NODE=2,fZ=$0.TEXT_NODE=3,YD=$0.CDATA_SECTION_NODE=4,KD=$0.ENTITY_REFERENCE_NODE=5,QY=$0.ENTITY_NODE=6,IW=$0.PROCESSING_INSTRUCTION_NODE=7,AW=$0.COMMENT_NODE=8,A8=$0.DOCUMENT_NODE=9,X1=$0.DOCUMENT_TYPE_NODE=10,B2=$0.DOCUMENT_FRAGMENT_NODE=11,XY=$0.NOTATION_NODE=12,GY=$0.DOCUMENT_POSITION_DISCONNECTED=1,WY=$0.DOCUMENT_POSITION_PRECEDING=2,jY=$0.DOCUMENT_POSITION_FOLLOWING=4,SW=$0.DOCUMENT_POSITION_CONTAINS=8,UY=$0.DOCUMENT_POSITION_CONTAINED_BY=16,HY=$0.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;$0.prototype=Object.create(RW.prototype,{baseURI:{get:m$.nyi},parentElement:{get:function(){return this.parentNode&&this.parentNode.nodeType===f0?this.parentNode:null}},hasChildNodes:{value:m$.shouldOverride},firstChild:{get:m$.shouldOverride},lastChild:{get:m$.shouldOverride},isConnected:{get:function(){let $=this;while($!=null){if($.nodeType===$0.DOCUMENT_NODE)return!0;if($=$.parentNode,$!=null&&$.nodeType===$0.DOCUMENT_FRAGMENT_NODE)$=$.host}return!1}},previousSibling:{get:function(){var $=this.parentNode;if(!$)return null;if(this===$.firstChild)return null;return this._previousSibling}},nextSibling:{get:function(){var $=this.parentNode,J=this._nextSibling;if(!$)return null;if(J===$.firstChild)return null;return J}},textContent:{get:function(){return null},set:function($){}},innerText:{get:function(){return null},set:function($){}},_countChildrenOfType:{value:function($){var J=0;for(var Z=this.firstChild;Z!==null;Z=Z.nextSibling)if(Z.nodeType===$)J++;return J}},_ensureInsertValid:{value:function(J,Z,Y){var K=this,V,Q;if(!J.nodeType)throw TypeError("not a node");switch(K.nodeType){case A8:case B2:case f0:break;default:m$.HierarchyRequestError()}if(J.isAncestor(K))m$.HierarchyRequestError();if(Z!==null||!Y){if(Z.parentNode!==K)m$.NotFoundError()}switch(J.nodeType){case B2:case X1:case f0:case fZ:case IW:case AW:break;default:m$.HierarchyRequestError()}if(K.nodeType===A8)switch(J.nodeType){case fZ:m$.HierarchyRequestError();break;case B2:if(J._countChildrenOfType(fZ)>0)m$.HierarchyRequestError();switch(J._countChildrenOfType(f0)){case 0:break;case 1:if(Z!==null){if(Y&&Z.nodeType===X1)m$.HierarchyRequestError();for(Q=Z.nextSibling;Q!==null;Q=Q.nextSibling)if(Q.nodeType===X1)m$.HierarchyRequestError()}if(V=K._countChildrenOfType(f0),Y){if(V>0)m$.HierarchyRequestError()}else if(V>1||V===1&&Z.nodeType!==f0)m$.HierarchyRequestError();break;default:m$.HierarchyRequestError()}break;case f0:if(Z!==null){if(Y&&Z.nodeType===X1)m$.HierarchyRequestError();for(Q=Z.nextSibling;Q!==null;Q=Q.nextSibling)if(Q.nodeType===X1)m$.HierarchyRequestError()}if(V=K._countChildrenOfType(f0),Y){if(V>0)m$.HierarchyRequestError()}else if(V>1||V===1&&Z.nodeType!==f0)m$.HierarchyRequestError();break;case X1:if(Z===null){if(K._countChildrenOfType(f0))m$.HierarchyRequestError()}else for(Q=K.firstChild;Q!==null;Q=Q.nextSibling){if(Q===Z)break;if(Q.nodeType===f0)m$.HierarchyRequestError()}if(V=K._countChildrenOfType(X1),Y){if(V>0)m$.HierarchyRequestError()}else if(V>1||V===1&&Z.nodeType!==X1)m$.HierarchyRequestError();break}else if(J.nodeType===X1)m$.HierarchyRequestError()}},insertBefore:{value:function(J,Z){var Y=this;Y._ensureInsertValid(J,Z,!0);var K=Z;if(K===J)K=J.nextSibling;return Y.doc.adoptNode(J),J._insertOrReplace(Y,K,!1),J}},appendChild:{value:function($){return this.insertBefore($,null)}},_appendChild:{value:function($){$._insertOrReplace(this,null,!1)}},removeChild:{value:function(J){var Z=this;if(!J.nodeType)throw TypeError("not a node");if(J.parentNode!==Z)m$.NotFoundError();return J.remove(),J}},replaceChild:{value:function(J,Z){var Y=this;if(Y._ensureInsertValid(J,Z,!1),J.doc!==Y.doc)Y.doc.adoptNode(J);return J._insertOrReplace(Y,Z,!0),Z}},contains:{value:function(J){if(J===null)return!1;if(this===J)return!0;return(this.compareDocumentPosition(J)&UY)!==0}},compareDocumentPosition:{value:function(J){if(this===J)return 0;if(this.doc!==J.doc||this.rooted!==J.rooted)return GY+HY;var Z=[],Y=[];for(var K=this;K!==null;K=K.parentNode)Z.push(K);for(K=J;K!==null;K=K.parentNode)Y.push(K);if(Z.reverse(),Y.reverse(),Z[0]!==Y[0])return GY+HY;K=Math.min(Z.length,Y.length);for(var V=1;V<K;V++)if(Z[V]!==Y[V])if(Z[V].index<Y[V].index)return jY;else return WY;if(Z.length<Y.length)return jY+UY;else return WY+SW}},isSameNode:{value:function(J){return this===J}},isEqualNode:{value:function(J){if(!J)return!1;if(J.nodeType!==this.nodeType)return!1;if(!this.isEqual(J))return!1;for(var Z=this.firstChild,Y=J.firstChild;Z&&Y;Z=Z.nextSibling,Y=Y.nextSibling)if(!Z.isEqualNode(Y))return!1;return Z===null&&Y===null}},cloneNode:{value:function($){var J=this.clone();if($)for(var Z=this.firstChild;Z!==null;Z=Z.nextSibling)J._appendChild(Z.cloneNode(!0));return J}},lookupPrefix:{value:function(J){var Z;if(J===""||J===null||J===void 0)return null;switch(this.nodeType){case f0:return this._lookupNamespacePrefix(J,this);case A8:return Z=this.documentElement,Z?Z.lookupPrefix(J):null;case QY:case XY:case B2:case X1:return null;case VY:return Z=this.ownerElement,Z?Z.lookupPrefix(J):null;default:return Z=this.parentElement,Z?Z.lookupPrefix(J):null}}},lookupNamespaceURI:{value:function(J){if(J===""||J===void 0)J=null;var Z;switch(this.nodeType){case f0:return m$.shouldOverride();case A8:return Z=this.documentElement,Z?Z.lookupNamespaceURI(J):null;case QY:case XY:case X1:case B2:return null;case VY:return Z=this.ownerElement,Z?Z.lookupNamespaceURI(J):null;default:return Z=this.parentElement,Z?Z.lookupNamespaceURI(J):null}}},isDefaultNamespace:{value:function(J){if(J===""||J===void 0)J=null;var Z=this.lookupNamespaceURI(null);return Z===J}},index:{get:function(){var $=this.parentNode;if(this===$.firstChild)return 0;var J=$.childNodes;if(this._index===void 0||J[this._index]!==this){for(var Z=0;Z<J.length;Z++)J[Z]._index=Z;m$.assert(J[this._index]===this)}return this._index}},isAncestor:{value:function($){if(this.doc!==$.doc)return!1;if(this.rooted!==$.rooted)return!1;for(var J=$;J;J=J.parentNode)if(J===this)return!0;return!1}},ensureSameDoc:{value:function($){if($.ownerDocument===null)$.ownerDocument=this.doc;else if($.ownerDocument!==this.doc)m$.WrongDocumentError()}},removeChildren:{value:m$.shouldOverride},_insertOrReplace:{value:function(J,Z,Y){var K=this,V,Q;if(K.nodeType===B2&&K.rooted)m$.HierarchyRequestError();if(J._childNodes){if(V=Z===null?J._childNodes.length:Z.index,K.parentNode===J){var G=K.index;if(G<V)V--}}if(Y){if(Z.rooted)Z.doc.mutateRemove(Z);Z.parentNode=null}var W=Z;if(W===null)W=J.firstChild;var _=K.rooted&&J.rooted;if(K.nodeType===B2){var j=[0,Y?1:0],B;for(var q=K.firstChild;q!==null;q=B)B=q.nextSibling,j.push(q),q.parentNode=J;var U=j.length;if(Y)gZ.replace(W,U>2?j[2]:null);else if(U>2&&W!==null)gZ.insertBefore(j[2],W);if(J._childNodes){j[0]=Z===null?J._childNodes.length:Z._index,J._childNodes.splice.apply(J._childNodes,j);for(Q=2;Q<U;Q++)j[Q]._index=j[0]+(Q-2)}else if(J._firstChild===Z){if(U>2)J._firstChild=j[2];else if(Y)J._firstChild=null}if(K._childNodes)K._childNodes.length=0;else K._firstChild=null;if(J.rooted){J.modify();for(Q=2;Q<U;Q++)J.doc.mutateInsert(j[Q])}}else{if(Z===K)return;if(_)K._remove();else if(K.parentNode)K.remove();if(K.parentNode=J,Y){if(gZ.replace(W,K),J._childNodes)K._index=V,J._childNodes[V]=K;else if(J._firstChild===Z)J._firstChild=K}else{if(W!==null)gZ.insertBefore(K,W);if(J._childNodes)K._index=V,J._childNodes.splice(V,0,K);else if(J._firstChild===Z)J._firstChild=K}if(_)J.modify(),J.doc.mutateMove(K);else if(J.rooted)J.modify(),J.doc.mutateInsert(K)}}},lastModTime:{get:function(){if(!this._lastModTime)this._lastModTime=this.doc.modclock;return this._lastModTime}},modify:{value:function(){if(this.doc.modclock){var $=++this.doc.modclock;for(var J=this;J;J=J.parentElement)if(J._lastModTime)J._lastModTime=$}}},doc:{get:function(){return this.ownerDocument||this}},rooted:{get:function(){return!!this._nid}},normalize:{value:function(){var $;for(var J=this.firstChild;J!==null;J=$){if($=J.nextSibling,J.normalize)J.normalize();if(J.nodeType!==$0.TEXT_NODE)continue;if(J.nodeValue===""){this.removeChild(J);continue}var Z=J.previousSibling;if(Z===null)continue;else if(Z.nodeType===$0.TEXT_NODE)Z.appendData(J.nodeValue),this.removeChild(J)}}},serialize:{value:function(){if(this._innerHTML)return this._innerHTML;var $="";for(var J=this.firstChild;J!==null;J=J.nextSibling)$+=PW.serializeOne(J,this);return $}},outerHTML:{get:function(){return PW.serializeOne(this,{nodeType:0})},set:m$.nyi},ELEMENT_NODE:{value:f0},ATTRIBUTE_NODE:{value:VY},TEXT_NODE:{value:fZ},CDATA_SECTION_NODE:{value:YD},ENTITY_REFERENCE_NODE:{value:KD},ENTITY_NODE:{value:QY},PROCESSING_INSTRUCTION_NODE:{value:IW},COMMENT_NODE:{value:AW},DOCUMENT_NODE:{value:A8},DOCUMENT_TYPE_NODE:{value:X1},DOCUMENT_FRAGMENT_NODE:{value:B2},NOTATION_NODE:{value:XY},DOCUMENT_POSITION_DISCONNECTED:{value:GY},DOCUMENT_POSITION_PRECEDING:{value:WY},DOCUMENT_POSITION_FOLLOWING:{value:jY},DOCUMENT_POSITION_CONTAINS:{value:SW},DOCUMENT_POSITION_CONTAINED_BY:{value:UY},DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:{value:HY}})});var NW=p((kb,LW)=>{LW.exports=class extends Array{constructor(J){super(J&&J.length||0);if(J)for(var Z in J)this[Z]=J[Z]}item(J){return this[J]||null}}});var TW=p((Eb,yW)=>{function VD($){return this[$]||null}function QD($){if(!$)$=[];return $.item=VD,$}yW.exports=QD});var n2=p((xb,kW)=>{var BY;try{BY=NW()}catch($){BY=TW()}kW.exports=BY});var mZ=p((bb,bW)=>{bW.exports=xW;var EW=P0(),XD=n2();function xW(){EW.call(this),this._firstChild=this._childNodes=null}xW.prototype=Object.create(EW.prototype,{hasChildNodes:{value:function(){if(this._childNodes)return this._childNodes.length>0;return this._firstChild!==null}},childNodes:{get:function(){return this._ensureChildNodes(),this._childNodes}},firstChild:{get:function(){if(this._childNodes)return this._childNodes.length===0?null:this._childNodes[0];return this._firstChild}},lastChild:{get:function(){var $=this._childNodes,J;if($)return $.length===0?null:$[$.length-1];if(J=this._firstChild,J===null)return null;return J._previousSibling}},_ensureChildNodes:{value:function(){if(this._childNodes)return;var $=this._firstChild,J=$,Z=this._childNodes=new XD;if($)do Z.push(J),J=J._nextSibling;while(J!==$);this._firstChild=null}},removeChildren:{value:function(){var J=this.rooted?this.ownerDocument:null,Z=this.firstChild,Y;while(Z!==null){if(Y=Z,Z=Y.nextSibling,J)J.mutateRemove(Y);Y.parentNode=null}if(this._childNodes)this._childNodes.length=0;else this._firstChild=null;this.modify()}}})});var uZ=p((qD)=>{qD.isValidName=_D;qD.isValidQName=OD;var GD=/^[_:A-Za-z][-.:\w]+$/,WD=/^([_A-Za-z][-.\w]+|[_A-Za-z][-.\w]+:[_A-Za-z][-.\w]+)$/,S8="_A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",R8="-._A-Za-z0-9\xB7\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0300-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",a2="["+S8+"]["+R8+"]*",_Y=S8+":",OY=R8+":",jD=new RegExp("^["+_Y+"]["+OY+"]*$"),UD=new RegExp("^("+a2+"|"+a2+":"+a2+")$"),vW=/[\uD800-\uDB7F\uDC00-\uDFFF]/,hW=/[\uD800-\uDB7F\uDC00-\uDFFF]/g,gW=/[\uD800-\uDB7F][\uDC00-\uDFFF]/g;S8+="\uD800-\uDB7F\uDC00-\uDFFF";R8+="\uD800-\uDB7F\uDC00-\uDFFF";a2="["+S8+"]["+R8+"]*";_Y=S8+":";OY=R8+":";var HD=new RegExp("^["+_Y+"]["+OY+"]*$"),BD=new RegExp("^("+a2+"|"+a2+":"+a2+")$");function _D($){if(GD.test($))return!0;if(jD.test($))return!0;if(!vW.test($))return!1;if(!HD.test($))return!1;var J=$.match(hW),Z=$.match(gW);return Z!==null&&2*Z.length===J.length}function OD($){if(WD.test($))return!0;if(UD.test($))return!0;if(!vW.test($))return!1;if(!BD.test($))return!1;var J=$.match(hW),Z=$.match(gW);return Z!==null&&2*Z.length===J.length}});var qY=p((CD)=>{var fW=G0();CD.property=function($){if(Array.isArray($.type)){var J=Object.create(null);$.type.forEach(function(K){J[K.value||K]=K.alias||K});var Z=$.missing;if(Z===void 0)Z=null;var Y=$.invalid;if(Y===void 0)Y=Z;return{get:function(){var K=this._getattr($.name);if(K===null)return Z;if(K=J[K.toLowerCase()],K!==void 0)return K;if(Y!==null)return Y;return K},set:function(K){this._setattr($.name,K)}}}else if($.type===Boolean)return{get:function(){return this.hasAttribute($.name)},set:function(K){if(K)this._setattr($.name,"");else this.removeAttribute($.name)}};else if($.type===Number||$.type==="long"||$.type==="unsigned long"||$.type==="limited unsigned long with fallback")return MD($);else if(!$.type||$.type===String)return{get:function(){return this._getattr($.name)||""},set:function(K){if($.treatNullAsEmptyString&&K===null)K="";this._setattr($.name,K)}};else if(typeof $.type==="function")return $.type($.name,$);throw Error("Invalid attribute definition")};function MD($){var J;if(typeof $.default==="function")J=$.default;else if(typeof $.default==="number")J=function(){return $.default};else J=function(){fW.assert(!1,typeof $.default)};var Z=$.type==="unsigned long",Y=$.type==="long",K=$.type==="limited unsigned long with fallback",V=$.min,Q=$.max,G=$.setmin;if(V===void 0){if(Z)V=0;if(Y)V=-2147483648;if(K)V=1}if(Q===void 0){if(Z||Y||K)Q=2147483647}return{get:function(){var W=this._getattr($.name),_=$.float?parseFloat(W):parseInt(W,10);if(W===null||!isFinite(_)||V!==void 0&&_<V||Q!==void 0&&_>Q)return J.call(this);if(Z||Y||K){if(!/^[ \t\n\f\r]*[-+]?[0-9]/.test(W))return J.call(this);_=_|0}return _},set:function(W){if(!$.float)W=Math.floor(W);if(G!==void 0&&W<G)fW.IndexSizeError($.name+" set to "+W);if(Z)W=W<0||W>2147483647?J.call(this):W|0;else if(K)W=W<1||W>2147483647?J.call(this):W|0;else if(Y)W=W<-2147483648||W>2147483647?J.call(this):W|0;this._setattr($.name,String(W))}}}CD.registerChangeHandler=function($,J,Z){var Y=$.prototype;if(!Object.prototype.hasOwnProperty.call(Y,"_attributeChangeHandlers"))Y._attributeChangeHandlers=Object.create(Y._attributeChangeHandlers||null);Y._attributeChangeHandlers[J]=Z}});var dW=p((gb,uW)=>{uW.exports=mW;var ID=P0();function mW($,J){this.root=$,this.filter=J,this.lastModTime=$.lastModTime,this.done=!1,this.cache=[],this.traverse()}mW.prototype=Object.create(Object.prototype,{length:{get:function(){if(this.checkcache(),!this.done)this.traverse();return this.cache.length}},item:{value:function($){if(this.checkcache(),!this.done&&$>=this.cache.length)this.traverse();return this.cache[$]}},checkcache:{value:function(){if(this.lastModTime!==this.root.lastModTime){for(var $=this.cache.length-1;$>=0;$--)this[$]=void 0;this.cache.length=0,this.done=!1,this.lastModTime=this.root.lastModTime}}},traverse:{value:function($){if($!==void 0)$++;var J;while((J=this.next())!==null)if(this[this.cache.length]=J,this.cache.push(J),$&&this.cache.length===$)return;this.done=!0}},next:{value:function(){var $=this.cache.length===0?this.root:this.cache[this.cache.length-1],J;if($.nodeType===ID.DOCUMENT_NODE)J=$.documentElement;else J=$.nextElement(this.root);while(J){if(this.filter(J))return J;J=J.nextElement(this.root)}return null}}})});var zY=p((fb,lW)=>{var FY=G0();lW.exports=cW;function cW($,J){this._getString=$,this._setString=J,this._length=0,this._lastStringValue="",this._update()}Object.defineProperties(cW.prototype,{length:{get:function(){return this._length}},item:{value:function($){var J=kJ(this);if($<0||$>=J.length)return null;return J[$]}},contains:{value:function($){$=String($);var J=kJ(this);return J.indexOf($)>-1}},add:{value:function(){var $=kJ(this);for(var J=0,Z=arguments.length;J<Z;J++){var Y=w8(arguments[J]);if($.indexOf(Y)<0)$.push(Y)}this._update($)}},remove:{value:function(){var $=kJ(this);for(var J=0,Z=arguments.length;J<Z;J++){var Y=w8(arguments[J]),K=$.indexOf(Y);if(K>-1)$.splice(K,1)}this._update($)}},toggle:{value:function(J,Z){if(J=w8(J),this.contains(J)){if(Z===void 0||Z===!1)return this.remove(J),!1;return!0}else{if(Z===void 0||Z===!0)return this.add(J),!0;return!1}}},replace:{value:function(J,Z){if(String(Z)==="")FY.SyntaxError();J=w8(J),Z=w8(Z);var Y=kJ(this),K=Y.indexOf(J);if(K<0)return!1;var V=Y.indexOf(Z);if(V<0)Y[K]=Z;else if(K<V)Y[K]=Z,Y.splice(V,1);else Y.splice(K,1);return this._update(Y),!0}},toString:{value:function(){return this._getString()}},value:{get:function(){return this._getString()},set:function($){this._setString($),this._update()}},_update:{value:function($){if($)pW(this,$),this._setString($.join(" ").trim());else pW(this,kJ(this));this._lastStringValue=this._getString()}}});function pW($,J){var Z=$._length,Y;$._length=J.length;for(Y=0;Y<J.length;Y++)$[Y]=J[Y];for(;Y<Z;Y++)$[Y]=void 0}function w8($){if($=String($),$==="")FY.SyntaxError();if(/[ \t\r\n\f]/.test($))FY.InvalidCharacterError();return $}function AD($){var J=$._length,Z=Array(J);for(var Y=0;Y<J;Y++)Z[Y]=$[Y];return Z}function kJ($){var J=$._getString();if(J===$._lastStringValue)return AD($);var Z=J.replace(/(^[ \t\r\n\f]+)|([ \t\r\n\f]+$)/g,"");if(Z==="")return[];else{var Y=Object.create(null);return Z.split(/[ \t\r\n\f]+/g).filter(function(K){var V="$"+K;if(Y[V])return!1;return Y[V]=!0,!0})}}});var lZ=p((bJ,aW)=>{var dZ=Object.create(null,{location:{get:function(){throw Error("window.location is not supported.")}}}),SD=function($,J){return $.compareDocumentPosition(J)},RD=function($,J){return SD($,J)&2?1:-1},cZ=function($){while(($=$.nextSibling)&&$.nodeType!==1);return $},xJ=function($){while(($=$.previousSibling)&&$.nodeType!==1);return $},wD=function($){if($=$.firstChild)while($.nodeType!==1&&($=$.nextSibling));return $},LD=function($){if($=$.lastChild)while($.nodeType!==1&&($=$.previousSibling));return $},EJ=function($){if(!$.parentNode)return!1;var J=$.parentNode.nodeType;return J===1||J===9},oW=function($){if(!$)return $;var J=$[0];if(J==='"'||J==="'"){if($[$.length-1]===J)$=$.slice(1,-1);else $=$.slice(1);return $.replace(_$.str_escape,function(Z){var Y=/^\\(?:([0-9A-Fa-f]+)|([\r\n\f]+))/.exec(Z);if(!Y)return Z.slice(1);if(Y[2])return"";var K=parseInt(Y[1],16);return String.fromCodePoint?String.fromCodePoint(K):String.fromCharCode(K)})}else if(_$.ident.test($))return _2($);else return $},_2=function($){return $.replace(_$.escape,function(J){var Z=/^\\([0-9A-Fa-f]+)/.exec(J);if(!Z)return J[1];var Y=parseInt(Z[1],16);return String.fromCodePoint?String.fromCodePoint(Y):String.fromCharCode(Y)})},ND=function(){if(Array.prototype.indexOf)return Array.prototype.indexOf;return function($,J){var Z=this.length;while(Z--)if(this[Z]===J)return Z;return-1}}(),iW=function($,J){var Z=_$.inside.source.replace(/</g,$).replace(/>/g,J);return new RegExp(Z)},m0=function($,J,Z){return $=$.source,$=$.replace(J,Z.source||Z),new RegExp($)},rW=function($,J){return $.replace(/^(?:\w+:\/\/|\/+)/,"").replace(/(?:\/+|\/*#.*?)$/,"").split("/",J).join("/")},yD=function($,J){var Z=$.replace(/\s+/g,""),Y;if(Z==="even")Z="2n+0";else if(Z==="odd")Z="2n+1";else if(Z.indexOf("n")===-1)Z="0n"+Z;return Y=/^([+-])?(\d+)?n([+-])?(\d+)?$/.exec(Z),{group:Y[1]==="-"?-(Y[2]||1):+(Y[2]||1),offset:Y[4]?Y[3]==="-"?-Y[4]:+Y[4]:0}},MY=function($,J,Z){var Y=yD($),K=Y.group,V=Y.offset,Q=!Z?wD:LD,G=!Z?cZ:xJ;return function(W){if(!EJ(W))return;var _=Q(W.parentNode),j=0;while(_){if(J(_,W))j++;if(_===W)return j-=V,K&&j?j%K===0&&j<0===K<0:!j;_=G(_)}}},z0={"*":function(){return function(){return!0}}(),type:function($){return $=$.toLowerCase(),function(J){return J.nodeName.toLowerCase()===$}},attr:function($,J,Z,Y){return J=sW[J],function(K){var V;switch($){case"for":V=K.htmlFor;break;case"class":if(V=K.className,V===""&&K.getAttribute("class")==null)V=null;break;case"href":case"src":V=K.getAttribute($,2);break;case"title":V=K.getAttribute("title")||null;break;case"id":case"lang":case"dir":case"accessKey":case"hidden":case"tabIndex":case"style":if(K.getAttribute){V=K.getAttribute($);break}default:if(K.hasAttribute&&!K.hasAttribute($))break;V=K[$]!=null?K[$]:K.getAttribute&&K.getAttribute($);break}if(V==null)return;if(V=V+"",Y)V=V.toLowerCase(),Z=Z.toLowerCase();return J(V,Z)}},":first-child":function($){return!xJ($)&&EJ($)},":last-child":function($){return!cZ($)&&EJ($)},":only-child":function($){return!xJ($)&&!cZ($)&&EJ($)},":nth-child":function($,J){return MY($,function(){return!0},J)},":nth-last-child":function($){return z0[":nth-child"]($,!0)},":root":function($){return $.ownerDocument.documentElement===$},":empty":function($){return!$.firstChild},":not":function($){var J=DY($);return function(Z){return!J(Z)}},":first-of-type":function($){if(!EJ($))return;var J=$.nodeName;while($=xJ($))if($.nodeName===J)return;return!0},":last-of-type":function($){if(!EJ($))return;var J=$.nodeName;while($=cZ($))if($.nodeName===J)return;return!0},":only-of-type":function($){return z0[":first-of-type"]($)&&z0[":last-of-type"]($)},":nth-of-type":function($,J){return MY($,function(Z,Y){return Z.nodeName===Y.nodeName},J)},":nth-last-of-type":function($){return z0[":nth-of-type"]($,!0)},":checked":function($){return!!($.checked||$.selected)},":indeterminate":function($){return!z0[":checked"]($)},":enabled":function($){return!$.disabled&&$.type!=="hidden"},":disabled":function($){return!!$.disabled},":target":function($){return $.id===dZ.location.hash.substring(1)},":focus":function($){return $===$.ownerDocument.activeElement},":is":function($){return DY($)},":matches":function($){return z0[":is"]($)},":nth-match":function($,J){var Z=$.split(/\s*,\s*/),Y=Z.shift(),K=DY(Z.join(","));return MY(Y,K,J)},":nth-last-match":function($){return z0[":nth-match"]($,!0)},":links-here":function($){return $+""===dZ.location+""},":lang":function($){return function(J){while(J){if(J.lang)return J.lang.indexOf($)===0;J=J.parentNode}}},":dir":function($){return function(J){while(J){if(J.dir)return J.dir===$;J=J.parentNode}}},":scope":function($,J){var Z=J||$.ownerDocument;if(Z.nodeType===9)return $===Z.documentElement;return $===Z},":any-link":function($){return typeof $.href==="string"},":local-link":function($){if($.nodeName)return $.href&&$.host===dZ.location.host;var J=+$+1;return function(Z){if(!Z.href)return;var Y=dZ.location+"",K=Z+"";return rW(Y,J)===rW(K,J)}},":default":function($){return!!$.defaultSelected},":valid":function($){return $.willValidate||$.validity&&$.validity.valid},":invalid":function($){return!z0[":valid"]($)},":in-range":function($){return $.value>$.min&&$.value<=$.max},":out-of-range":function($){return!z0[":in-range"]($)},":required":function($){return!!$.required},":optional":function($){return!$.required},":read-only":function($){if($.readOnly)return!0;var J=$.getAttribute("contenteditable"),Z=$.contentEditable,Y=$.nodeName.toLowerCase();return Y=Y!=="input"&&Y!=="textarea",(Y||$.disabled)&&J==null&&Z!=="true"},":read-write":function($){return!z0[":read-only"]($)},":hover":function(){throw Error(":hover is not supported.")},":active":function(){throw Error(":active is not supported.")},":link":function(){throw Error(":link is not supported.")},":visited":function(){throw Error(":visited is not supported.")},":column":function(){throw Error(":column is not supported.")},":nth-column":function(){throw Error(":nth-column is not supported.")},":nth-last-column":function(){throw Error(":nth-last-column is not supported.")},":current":function(){throw Error(":current is not supported.")},":past":function(){throw Error(":past is not supported.")},":future":function(){throw Error(":future is not supported.")},":contains":function($){return function(J){var Z=J.innerText||J.textContent||J.value||"";return Z.indexOf($)!==-1}},":has":function($){return function(J){return nW($,J).length>0}}},sW={"-":function(){return!0},"=":function($,J){return $===J},"*=":function($,J){return $.indexOf(J)!==-1},"~=":function($,J){var Z,Y,K,V;for(Y=0;;Y=Z+1){if(Z=$.indexOf(J,Y),Z===-1)return!1;if(K=$[Z-1],V=$[Z+J.length],(!K||K===" ")&&(!V||V===" "))return!0}},"|=":function($,J){var Z=$.indexOf(J),Y;if(Z!==0)return;return Y=$[Z+J.length],Y==="-"||!Y},"^=":function($,J){return $.indexOf(J)===0},"$=":function($,J){var Z=$.lastIndexOf(J);return Z!==-1&&Z+J.length===$.length},"!=":function($,J){return $!==J}},L8={" ":function($){return function(J){while(J=J.parentNode)if($(J))return J}},">":function($){return function(J){if(J=J.parentNode)return $(J)&&J}},"+":function($){return function(J){if(J=xJ(J))return $(J)&&J}},"~":function($){return function(J){while(J=xJ(J))if($(J))return J}},noop:function($){return function(J){return $(J)&&J}},ref:function($,J){var Z;function Y(K){var V=K.ownerDocument,Q=V.getElementsByTagName("*"),G=Q.length;while(G--)if(Z=Q[G],Y.test(K))return Z=null,!0;Z=null}return Y.combinator=function(K){if(!Z||!Z.getAttribute)return;var V=Z.getAttribute(J)||"";if(V[0]==="#")V=V.substring(1);if(V===K.id&&$(Z))return Z},Y}},_$={escape:/\\(?:[^0-9A-Fa-f\r\n]|[0-9A-Fa-f]{1,6}[\r\n\t ]?)/g,str_escape:/(escape)|\\(\n|\r\n?|\f)/g,nonascii:/[\u00A0-\uFFFF]/,cssid:/(?:(?!-?[0-9])(?:escape|nonascii|[-_a-zA-Z0-9])+)/,qname:/^ *(cssid|\*)/,simple:/^(?:([.#]cssid)|pseudo|attr)/,ref:/^ *\/(cssid)\/ */,combinator:/^(?: +([^ \w*.#\\]) +|( )+|([^ \w*.#\\]))(?! *$)/,attr:/^\[(cssid)(?:([^\w]?=)(inside))?\]/,pseudo:/^(:cssid)(?:\((inside)\))?/,inside:/(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|<[^"'>]*>|\\["'>]|[^"'>])*/,ident:/^(cssid)$/};_$.cssid=m0(_$.cssid,"nonascii",_$.nonascii);_$.cssid=m0(_$.cssid,"escape",_$.escape);_$.qname=m0(_$.qname,"cssid",_$.cssid);_$.simple=m0(_$.simple,"cssid",_$.cssid);_$.ref=m0(_$.ref,"cssid",_$.cssid);_$.attr=m0(_$.attr,"cssid",_$.cssid);_$.pseudo=m0(_$.pseudo,"cssid",_$.cssid);_$.inside=m0(_$.inside,`[^"'>]*`,_$.inside);_$.attr=m0(_$.attr,"inside",iW("\\[","\\]"));_$.pseudo=m0(_$.pseudo,"inside",iW("\\(","\\)"));_$.simple=m0(_$.simple,"pseudo",_$.pseudo);_$.simple=m0(_$.simple,"attr",_$.attr);_$.ident=m0(_$.ident,"cssid",_$.cssid);_$.str_escape=m0(_$.str_escape,"escape",_$.escape);var N8=function($){var J=$.replace(/^\s+|\s+$/g,""),Z,Y=[],K=[],V,Q,G,W,_;while(J){if(G=_$.qname.exec(J))J=J.substring(G[0].length),Q=_2(G[1]),K.push(pZ(Q,!0));else if(G=_$.simple.exec(J))J=J.substring(G[0].length),Q="*",K.push(pZ(Q,!0)),K.push(pZ(G));else throw SyntaxError("Invalid selector.");while(G=_$.simple.exec(J))J=J.substring(G[0].length),K.push(pZ(G));if(J[0]==="!")J=J.substring(1),V=kD(),V.qname=Q,K.push(V.simple);if(G=_$.ref.exec(J)){J=J.substring(G[0].length),_=L8.ref(CY(K),_2(G[1])),Y.push(_.combinator),K=[];continue}if(G=_$.combinator.exec(J)){if(J=J.substring(G[0].length),W=G[1]||G[2]||G[3],W===","){Y.push(L8.noop(CY(K)));break}}else W="noop";if(!L8[W])throw SyntaxError("Bad combinator.");Y.push(L8[W](CY(K))),K=[]}if(Z=TD(Y),Z.qname=Q,Z.sel=J,V)V.lname=Z.qname,V.test=Z,V.qname=V.qname,V.sel=Z.sel,Z=V;if(_)_.test=Z,_.qname=Z.qname,_.sel=Z.sel,Z=_;return Z},pZ=function($,J){if(J)return $==="*"?z0["*"]:z0.type($);if($[1])return $[1][0]==="."?z0.attr("class","~=",_2($[1].substring(1)),!1):z0.attr("id","=",_2($[1].substring(1)),!1);if($[2])return $[3]?z0[_2($[2])](oW($[3])):z0[_2($[2])];if($[4]){var Z=$[6],Y=/["'\s]\s*I$/i.test(Z);if(Y)Z=Z.replace(/\s*I$/i,"");return z0.attr(_2($[4]),$[5]||"-",oW(Z),Y)}throw SyntaxError("Unknown Selector.")},CY=function($){var J=$.length,Z;if(J<2)return $[0];return function(Y){if(!Y)return;for(Z=0;Z<J;Z++)if(!$[Z](Y))return;return!0}},TD=function($){if($.length<2)return function(J){return!!$[0](J)};return function(J){var Z=$.length;while(Z--)if(!(J=$[Z](J)))return;return!0}},kD=function(){var $;function J(Z){var Y=Z.ownerDocument,K=Y.getElementsByTagName(J.lname),V=K.length;while(V--)if(J.test(K[V])&&$===Z)return $=null,!0;$=null}return J.simple=function(Z){return $=Z,!0},J},DY=function($){var J=N8($),Z=[J];while(J.sel)J=N8(J.sel),Z.push(J);if(Z.length<2)return J;return function(Y){var K=Z.length,V=0;for(;V<K;V++)if(Z[V](Y))return!0}},nW=function($,J){var Z=[],Y=N8($),K=J.getElementsByTagName(Y.qname),V=0,Q;while(Q=K[V++])if(Y(Q))Z.push(Q);if(Y.sel){while(Y.sel){Y=N8(Y.sel),K=J.getElementsByTagName(Y.qname),V=0;while(Q=K[V++])if(Y(Q)&&ND.call(Z,Q)===-1)Z.push(Q)}Z.sort(RD)}return Z};aW.exports=bJ=function($,J){var Z,Y;if(J.nodeType!==11&&$.indexOf(" ")===-1){if($[0]==="#"&&J.rooted&&/^#[A-Z_][-A-Z0-9_]*$/i.test($)){if(J.doc._hasMultipleElementsWithId){if(Z=$.substring(1),!J.doc._hasMultipleElementsWithId(Z))return Y=J.doc.getElementById(Z),Y?[Y]:[]}}if($[0]==="."&&/^\.\w+$/.test($))return J.getElementsByClassName($.substring(1));if(/^\w+$/.test($))return J.getElementsByTagName($)}return nW($,J)};bJ.selectors=z0;bJ.operators=sW;bJ.combinators=L8;bJ.matches=function($,J){var Z={sel:J};do if(Z=N8(Z.sel),Z($))return!0;while(Z.sel);return!1}});var oZ=p((mb,tW)=>{var ED=P0(),xD=YY(),PY=function($,J){var Z=$.createDocumentFragment();for(var Y=0;Y<J.length;Y++){var K=J[Y],V=K instanceof ED;Z.appendChild(V?K:$.createTextNode(String(K)))}return Z},bD={after:{value:function(){var J=Array.prototype.slice.call(arguments),Z=this.parentNode,Y=this.nextSibling;if(Z===null)return;while(Y&&J.some(function(V){return V===Y}))Y=Y.nextSibling;var K=PY(this.doc,J);Z.insertBefore(K,Y)}},before:{value:function(){var J=Array.prototype.slice.call(arguments),Z=this.parentNode,Y=this.previousSibling;if(Z===null)return;while(Y&&J.some(function(Q){return Q===Y}))Y=Y.previousSibling;var K=PY(this.doc,J),V=Y?Y.nextSibling:Z.firstChild;Z.insertBefore(K,V)}},remove:{value:function(){if(this.parentNode===null)return;if(this.doc){if(this.doc._preremoveNodeIterators(this),this.rooted)this.doc.mutateRemove(this)}this._remove(),this.parentNode=null}},_remove:{value:function(){var J=this.parentNode;if(J===null)return;if(J._childNodes)J._childNodes.splice(this.index,1);else if(J._firstChild===this)if(this._nextSibling===this)J._firstChild=null;else J._firstChild=this._nextSibling;xD.remove(this),J.modify()}},replaceWith:{value:function(){var J=Array.prototype.slice.call(arguments),Z=this.parentNode,Y=this.nextSibling;if(Z===null)return;while(Y&&J.some(function(V){return V===Y}))Y=Y.nextSibling;var K=PY(this.doc,J);if(this.parentNode===Z)Z.replaceChild(K,this);else Z.insertBefore(K,Y)}}};tW.exports=bD});var IY=p((ub,$5)=>{var eW=P0(),vD={nextElementSibling:{get:function(){if(this.parentNode){for(var $=this.nextSibling;$!==null;$=$.nextSibling)if($.nodeType===eW.ELEMENT_NODE)return $}return null}},previousElementSibling:{get:function(){if(this.parentNode){for(var $=this.previousSibling;$!==null;$=$.previousSibling)if($.nodeType===eW.ELEMENT_NODE)return $}return null}}};$5.exports=vD});var AY=p((db,Z5)=>{Z5.exports=J5;var vJ=G0();function J5($){this.element=$}Object.defineProperties(J5.prototype,{length:{get:vJ.shouldOverride},item:{value:vJ.shouldOverride},getNamedItem:{value:function(J){return this.element.getAttributeNode(J)}},getNamedItemNS:{value:function(J,Z){return this.element.getAttributeNodeNS(J,Z)}},setNamedItem:{value:vJ.nyi},setNamedItemNS:{value:vJ.nyi},removeNamedItem:{value:function(J){var Z=this.element.getAttributeNode(J);if(Z)return this.element.removeAttribute(J),Z;vJ.NotFoundError()}},removeNamedItemNS:{value:function(J,Z){var Y=this.element.getAttributeNodeNS(J,Z);if(Y)return this.element.removeAttributeNS(J,Z),Y;vJ.NotFoundError()}}})});var gJ=p((pb,X5)=>{X5.exports=O2;var SY=uZ(),Y0=G0(),N1=Y0.NAMESPACE,iZ=qY(),q1=P0(),RY=n2(),hD=KY(),rZ=dW(),hJ=vZ(),gD=zY(),wY=lZ(),K5=mZ(),fD=oZ(),mD=IY(),V5=AY(),Y5=Object.create(null);function O2($,J,Z,Y){K5.call(this),this.nodeType=q1.ELEMENT_NODE,this.ownerDocument=$,this.localName=J,this.namespaceURI=Z,this.prefix=Y,this._tagName=void 0,this._attrsByQName=Object.create(null),this._attrsByLName=Object.create(null),this._attrKeys=[]}function LY($,J){if($.nodeType===q1.TEXT_NODE)J.push($._data);else for(var Z=0,Y=$.childNodes.length;Z<Y;Z++)LY($.childNodes[Z],J)}O2.prototype=Object.create(K5.prototype,{isHTML:{get:function(){return this.namespaceURI===N1.HTML&&this.ownerDocument.isHTML}},tagName:{get:function(){if(this._tagName===void 0){var J;if(this.prefix===null)J=this.localName;else J=this.prefix+":"+this.localName;if(this.isHTML){var Z=Y5[J];if(!Z)Y5[J]=Z=Y0.toASCIIUpperCase(J);J=Z}this._tagName=J}return this._tagName}},nodeName:{get:function(){return this.tagName}},nodeValue:{get:function(){return null},set:function(){}},textContent:{get:function(){var $=[];return LY(this,$),$.join("")},set:function($){if(this.removeChildren(),$!==null&&$!==void 0&&$!=="")this._appendChild(this.ownerDocument.createTextNode($))}},innerText:{get:function(){var $=[];return LY(this,$),$.join("").replace(/[ \t\n\f\r]+/g," ").trim()},set:function($){if(this.removeChildren(),$!==null&&$!==void 0&&$!=="")this._appendChild(this.ownerDocument.createTextNode($))}},innerHTML:{get:function(){return this.serialize()},set:Y0.nyi},outerHTML:{get:function(){return hD.serializeOne(this,{nodeType:0})},set:function($){var J=this.ownerDocument,Z=this.parentNode;if(Z===null)return;if(Z.nodeType===q1.DOCUMENT_NODE)Y0.NoModificationAllowedError();if(Z.nodeType===q1.DOCUMENT_FRAGMENT_NODE)Z=Z.ownerDocument.createElement("body");var Y=J.implementation.mozHTMLParser(J._address,Z);Y.parse($===null?"":String($),!0),this.replaceWith(Y._asDocumentFragment())}},_insertAdjacent:{value:function(J,Z){var Y=!1;switch(J){case"beforebegin":Y=!0;case"afterend":var K=this.parentNode;if(K===null)return null;return K.insertBefore(Z,Y?this:this.nextSibling);case"afterbegin":Y=!0;case"beforeend":return this.insertBefore(Z,Y?this.firstChild:null);default:return Y0.SyntaxError()}}},insertAdjacentElement:{value:function(J,Z){if(Z.nodeType!==q1.ELEMENT_NODE)throw TypeError("not an element");return J=Y0.toASCIILowerCase(String(J)),this._insertAdjacent(J,Z)}},insertAdjacentText:{value:function(J,Z){var Y=this.ownerDocument.createTextNode(Z);J=Y0.toASCIILowerCase(String(J)),this._insertAdjacent(J,Y)}},insertAdjacentHTML:{value:function(J,Z){J=Y0.toASCIILowerCase(String(J)),Z=String(Z);var Y;switch(J){case"beforebegin":case"afterend":if(Y=this.parentNode,Y===null||Y.nodeType===q1.DOCUMENT_NODE)Y0.NoModificationAllowedError();break;case"afterbegin":case"beforeend":Y=this;break;default:Y0.SyntaxError()}if(!(Y instanceof O2)||Y.ownerDocument.isHTML&&Y.localName==="html"&&Y.namespaceURI===N1.HTML)Y=Y.ownerDocument.createElementNS(N1.HTML,"body");var K=this.ownerDocument.implementation.mozHTMLParser(this.ownerDocument._address,Y);K.parse(Z,!0),this._insertAdjacent(J,K._asDocumentFragment())}},children:{get:function(){if(!this._children)this._children=new Q5(this);return this._children}},attributes:{get:function(){if(!this._attributes)this._attributes=new yY(this);return this._attributes}},firstElementChild:{get:function(){for(var $=this.firstChild;$!==null;$=$.nextSibling)if($.nodeType===q1.ELEMENT_NODE)return $;return null}},lastElementChild:{get:function(){for(var $=this.lastChild;$!==null;$=$.previousSibling)if($.nodeType===q1.ELEMENT_NODE)return $;return null}},childElementCount:{get:function(){return this.children.length}},nextElement:{value:function($){if(!$)$=this.ownerDocument.documentElement;var J=this.firstElementChild;if(!J){if(this===$)return null;J=this.nextElementSibling}if(J)return J;for(var Z=this.parentElement;Z&&Z!==$;Z=Z.parentElement)if(J=Z.nextElementSibling,J)return J;return null}},getElementsByTagName:{value:function(J){var Z;if(!J)return new RY;if(J==="*")Z=function(){return!0};else if(this.isHTML)Z=uD(J);else Z=NY(J);return new rZ(this,Z)}},getElementsByTagNameNS:{value:function(J,Z){var Y;if(J==="*"&&Z==="*")Y=function(){return!0};else if(J==="*")Y=NY(Z);else if(Z==="*")Y=dD(J);else Y=pD(J,Z);return new rZ(this,Y)}},getElementsByClassName:{value:function(J){if(J=String(J).trim(),J===""){var Z=new RY;return Z}return J=J.split(/[ \t\r\n\f]+/),new rZ(this,cD(J))}},getElementsByName:{value:function(J){return new rZ(this,lD(String(J)))}},clone:{value:function(){var J;if(this.namespaceURI!==N1.HTML||this.prefix||!this.ownerDocument.isHTML)J=this.ownerDocument.createElementNS(this.namespaceURI,this.prefix!==null?this.prefix+":"+this.localName:this.localName);else J=this.ownerDocument.createElement(this.localName);for(var Z=0,Y=this._attrKeys.length;Z<Y;Z++){var K=this._attrKeys[Z],V=this._attrsByLName[K],Q=V.cloneNode();Q._setOwnerElement(J),J._attrsByLName[K]=Q,J._addQName(Q)}return J._attrKeys=this._attrKeys.concat(),J}},isEqual:{value:function(J){if(this.localName!==J.localName||this.namespaceURI!==J.namespaceURI||this.prefix!==J.prefix||this._numattrs!==J._numattrs)return!1;for(var Z=0,Y=this._numattrs;Z<Y;Z++){var K=this._attr(Z);if(!J.hasAttributeNS(K.namespaceURI,K.localName))return!1;if(J.getAttributeNS(K.namespaceURI,K.localName)!==K.value)return!1}return!0}},_lookupNamespacePrefix:{value:function(J,Z){if(this.namespaceURI&&this.namespaceURI===J&&this.prefix!==null&&Z.lookupNamespaceURI(this.prefix)===J)return this.prefix;for(var Y=0,K=this._numattrs;Y<K;Y++){var V=this._attr(Y);if(V.prefix==="xmlns"&&V.value===J&&Z.lookupNamespaceURI(V.localName)===J)return V.localName}var Q=this.parentElement;return Q?Q._lookupNamespacePrefix(J,Z):null}},lookupNamespaceURI:{value:function(J){if(J===""||J===void 0)J=null;if(this.namespaceURI!==null&&this.prefix===J)return this.namespaceURI;for(var Z=0,Y=this._numattrs;Z<Y;Z++){var K=this._attr(Z);if(K.namespaceURI===N1.XMLNS){if(K.prefix==="xmlns"&&K.localName===J||J===null&&K.prefix===null&&K.localName==="xmlns")return K.value||null}}var V=this.parentElement;return V?V.lookupNamespaceURI(J):null}},getAttribute:{value:function(J){var Z=this.getAttributeNode(J);return Z?Z.value:null}},getAttributeNS:{value:function(J,Z){var Y=this.getAttributeNodeNS(J,Z);return Y?Y.value:null}},getAttributeNode:{value:function(J){if(J=String(J),/[A-Z]/.test(J)&&this.isHTML)J=Y0.toASCIILowerCase(J);var Z=this._attrsByQName[J];if(!Z)return null;if(Array.isArray(Z))Z=Z[0];return Z}},getAttributeNodeNS:{value:function(J,Z){J=J===void 0||J===null?"":String(J),Z=String(Z);var Y=this._attrsByLName[J+"|"+Z];return Y?Y:null}},hasAttribute:{value:function(J){if(J=String(J),/[A-Z]/.test(J)&&this.isHTML)J=Y0.toASCIILowerCase(J);return this._attrsByQName[J]!==void 0}},hasAttributeNS:{value:function(J,Z){J=J===void 0||J===null?"":String(J),Z=String(Z);var Y=J+"|"+Z;return this._attrsByLName[Y]!==void 0}},hasAttributes:{value:function(){return this._numattrs>0}},toggleAttribute:{value:function(J,Z){if(J=String(J),!SY.isValidName(J))Y0.InvalidCharacterError();if(/[A-Z]/.test(J)&&this.isHTML)J=Y0.toASCIILowerCase(J);var Y=this._attrsByQName[J];if(Y===void 0){if(Z===void 0||Z===!0)return this._setAttribute(J,""),!0;return!1}else{if(Z===void 0||Z===!1)return this.removeAttribute(J),!1;return!0}}},_setAttribute:{value:function(J,Z){var Y=this._attrsByQName[J],K;if(!Y)Y=this._newattr(J),K=!0;else if(Array.isArray(Y))Y=Y[0];if(Y.value=Z,this._attributes)this._attributes[J]=Y;if(K&&this._newattrhook)this._newattrhook(J,Z)}},setAttribute:{value:function(J,Z){if(J=String(J),!SY.isValidName(J))Y0.InvalidCharacterError();if(/[A-Z]/.test(J)&&this.isHTML)J=Y0.toASCIILowerCase(J);this._setAttribute(J,String(Z))}},_setAttributeNS:{value:function(J,Z,Y){var K=Z.indexOf(":"),V,Q;if(K<0)V=null,Q=Z;else V=Z.substring(0,K),Q=Z.substring(K+1);if(J===""||J===void 0)J=null;var G=(J===null?"":J)+"|"+Q,W=this._attrsByLName[G],_;if(!W){if(W=new y8(this,Q,V,J),_=!0,this._attrsByLName[G]=W,this._attributes)this._attributes[this._attrKeys.length]=W;this._attrKeys.push(G),this._addQName(W)}if(W.value=Y,_&&this._newattrhook)this._newattrhook(Z,Y)}},setAttributeNS:{value:function(J,Z,Y){if(J=J===null||J===void 0||J===""?null:String(J),Z=String(Z),!SY.isValidQName(Z))Y0.InvalidCharacterError();var K=Z.indexOf(":"),V=K<0?null:Z.substring(0,K);if(V!==null&&J===null||V==="xml"&&J!==N1.XML||(Z==="xmlns"||V==="xmlns")&&J!==N1.XMLNS||J===N1.XMLNS&&!(Z==="xmlns"||V==="xmlns"))Y0.NamespaceError();this._setAttributeNS(J,Z,String(Y))}},setAttributeNode:{value:function(J){if(J.ownerElement!==null&&J.ownerElement!==this)throw new hJ(hJ.INUSE_ATTRIBUTE_ERR);var Z=null,Y=this._attrsByQName[J.name];if(Y){if(!Array.isArray(Y))Y=[Y];if(Y.some(function(K){return K===J}))return J;else if(J.ownerElement!==null)throw new hJ(hJ.INUSE_ATTRIBUTE_ERR);Y.forEach(function(K){this.removeAttributeNode(K)},this),Z=Y[0]}return this.setAttributeNodeNS(J),Z}},setAttributeNodeNS:{value:function(J){if(J.ownerElement!==null)throw new hJ(hJ.INUSE_ATTRIBUTE_ERR);var Z=J.namespaceURI,Y=(Z===null?"":Z)+"|"+J.localName,K=this._attrsByLName[Y];if(K)this.removeAttributeNode(K);if(J._setOwnerElement(this),this._attrsByLName[Y]=J,this._attributes)this._attributes[this._attrKeys.length]=J;if(this._attrKeys.push(Y),this._addQName(J),this._newattrhook)this._newattrhook(J.name,J.value);return K||null}},removeAttribute:{value:function(J){if(J=String(J),/[A-Z]/.test(J)&&this.isHTML)J=Y0.toASCIILowerCase(J);var Z=this._attrsByQName[J];if(!Z)return;if(Array.isArray(Z))if(Z.length>2)Z=Z.shift();else this._attrsByQName[J]=Z[1],Z=Z[0];else this._attrsByQName[J]=void 0;var Y=Z.namespaceURI,K=(Y===null?"":Y)+"|"+Z.localName;this._attrsByLName[K]=void 0;var V=this._attrKeys.indexOf(K);if(this._attributes)Array.prototype.splice.call(this._attributes,V,1),this._attributes[J]=void 0;this._attrKeys.splice(V,1);var Q=Z.onchange;if(Z._setOwnerElement(null),Q)Q.call(Z,this,Z.localName,Z.value,null);if(this.rooted)this.ownerDocument.mutateRemoveAttr(Z)}},removeAttributeNS:{value:function(J,Z){J=J===void 0||J===null?"":String(J),Z=String(Z);var Y=J+"|"+Z,K=this._attrsByLName[Y];if(!K)return;this._attrsByLName[Y]=void 0;var V=this._attrKeys.indexOf(Y);if(this._attributes)Array.prototype.splice.call(this._attributes,V,1);this._attrKeys.splice(V,1),this._removeQName(K);var Q=K.onchange;if(K._setOwnerElement(null),Q)Q.call(K,this,K.localName,K.value,null);if(this.rooted)this.ownerDocument.mutateRemoveAttr(K)}},removeAttributeNode:{value:function(J){var Z=J.namespaceURI,Y=(Z===null?"":Z)+"|"+J.localName;if(this._attrsByLName[Y]!==J)Y0.NotFoundError();return this.removeAttributeNS(Z,J.localName),J}},getAttributeNames:{value:function(){var J=this;return this._attrKeys.map(function(Z){return J._attrsByLName[Z].name})}},_getattr:{value:function(J){var Z=this._attrsByQName[J];return Z?Z.value:null}},_setattr:{value:function(J,Z){var Y=this._attrsByQName[J],K;if(!Y)Y=this._newattr(J),K=!0;if(Y.value=String(Z),this._attributes)this._attributes[J]=Y;if(K&&this._newattrhook)this._newattrhook(J,Z)}},_newattr:{value:function(J){var Z=new y8(this,J,null,null),Y="|"+J;if(this._attrsByQName[J]=Z,this._attrsByLName[Y]=Z,this._attributes)this._attributes[this._attrKeys.length]=Z;return this._attrKeys.push(Y),Z}},_addQName:{value:function($){var J=$.name,Z=this._attrsByQName[J];if(!Z)this._attrsByQName[J]=$;else if(Array.isArray(Z))Z.push($);else this._attrsByQName[J]=[Z,$];if(this._attributes)this._attributes[J]=$}},_removeQName:{value:function($){var J=$.name,Z=this._attrsByQName[J];if(Array.isArray(Z)){var Y=Z.indexOf($);if(Y0.assert(Y!==-1),Z.length===2){if(this._attrsByQName[J]=Z[1-Y],this._attributes)this._attributes[J]=this._attrsByQName[J]}else if(Z.splice(Y,1),this._attributes&&this._attributes[J]===$)this._attributes[J]=Z[0]}else if(Y0.assert(Z===$),this._attrsByQName[J]=void 0,this._attributes)this._attributes[J]=void 0}},_numattrs:{get:function(){return this._attrKeys.length}},_attr:{value:function($){return this._attrsByLName[this._attrKeys[$]]}},id:iZ.property({name:"id"}),className:iZ.property({name:"class"}),classList:{get:function(){var $=this;if(this._classList)return this._classList;var J=new gD(function(){return $.className||""},function(Z){$.className=Z});return this._classList=J,J},set:function($){this.className=$}},matches:{value:function($){return wY.matches(this,$)}},closest:{value:function($){var J=this;do{if(J.matches&&J.matches($))return J;J=J.parentElement||J.parentNode}while(J!==null&&J.nodeType===q1.ELEMENT_NODE);return null}},querySelector:{value:function($){return wY($,this)[0]}},querySelectorAll:{value:function($){var J=wY($,this);return J.item?J:new RY(J)}}});Object.defineProperties(O2.prototype,fD);Object.defineProperties(O2.prototype,mD);iZ.registerChangeHandler(O2,"id",function($,J,Z,Y){if($.rooted){if(Z)$.ownerDocument.delId(Z,$);if(Y)$.ownerDocument.addId(Y,$)}});iZ.registerChangeHandler(O2,"class",function($,J,Z,Y){if($._classList)$._classList._update()});function y8($,J,Z,Y,K){this.localName=J,this.prefix=Z===null||Z===""?null:""+Z,this.namespaceURI=Y===null||Y===""?null:""+Y,this.data=K,this._setOwnerElement($)}y8.prototype=Object.create(Object.prototype,{ownerElement:{get:function(){return this._ownerElement}},_setOwnerElement:{value:function(J){if(this._ownerElement=J,this.prefix===null&&this.namespaceURI===null&&J)this.onchange=J._attributeChangeHandlers[this.localName];else this.onchange=null}},name:{get:function(){return this.prefix?this.prefix+":"+this.localName:this.localName}},specified:{get:function(){return!0}},value:{get:function(){return this.data},set:function($){var J=this.data;if($=$===void 0?"":$+"",$===J)return;if(this.data=$,this.ownerElement){if(this.onchange)this.onchange(this.ownerElement,this.localName,J,$);if(this.ownerElement.rooted)this.ownerElement.ownerDocument.mutateAttr(this,J)}}},cloneNode:{value:function(J){return new y8(null,this.localName,this.prefix,this.namespaceURI,this.data)}},nodeType:{get:function(){return q1.ATTRIBUTE_NODE}},nodeName:{get:function(){return this.name}},nodeValue:{get:function(){return this.value},set:function($){this.value=$}},textContent:{get:function(){return this.value},set:function($){if($===null||$===void 0)$="";this.value=$}},innerText:{get:function(){return this.value},set:function($){if($===null||$===void 0)$="";this.value=$}}});O2._Attr=y8;function yY($){V5.call(this,$);for(var J in $._attrsByQName)this[J]=$._attrsByQName[J];for(var Z=0;Z<$._attrKeys.length;Z++)this[Z]=$._attrsByLName[$._attrKeys[Z]]}yY.prototype=Object.create(V5.prototype,{length:{get:function(){return this.element._attrKeys.length},set:function(){}},item:{value:function($){if($=$>>>0,$>=this.length)return null;return this.element._attrsByLName[this.element._attrKeys[$]]}}});if(globalThis.Symbol?.iterator)yY.prototype[globalThis.Symbol.iterator]=function(){var $=0,J=this.length,Z=this;return{next:function(){if($<J)return{value:Z.item($++)};return{done:!0}}}};function Q5($){this.element=$,this.updateCache()}Q5.prototype=Object.create(Object.prototype,{length:{get:function(){return this.updateCache(),this.childrenByNumber.length}},item:{value:function(J){return this.updateCache(),this.childrenByNumber[J]||null}},namedItem:{value:function(J){return this.updateCache(),this.childrenByName[J]||null}},namedItems:{get:function(){return this.updateCache(),this.childrenByName}},updateCache:{value:function(){var J=/^(a|applet|area|embed|form|frame|frameset|iframe|img|object)$/;if(this.lastModTime!==this.element.lastModTime){this.lastModTime=this.element.lastModTime;var Z=this.childrenByNumber&&this.childrenByNumber.length||0;for(var Y=0;Y<Z;Y++)this[Y]=void 0;this.childrenByNumber=[],this.childrenByName=Object.create(null);for(var K=this.element.firstChild;K!==null;K=K.nextSibling)if(K.nodeType===q1.ELEMENT_NODE){this[this.childrenByNumber.length]=K,this.childrenByNumber.push(K);var V=K.getAttribute("id");if(V&&!this.childrenByName[V])this.childrenByName[V]=K;var Q=K.getAttribute("name");if(Q&&this.element.namespaceURI===N1.HTML&&J.test(this.element.localName)&&!this.childrenByName[Q])this.childrenByName[V]=K}}}}});function NY($){return function(J){return J.localName===$}}function uD($){var J=Y0.toASCIILowerCase($);if(J===$)return NY($);return function(Z){return Z.isHTML?Z.localName===J:Z.localName===$}}function dD($){return function(J){return J.namespaceURI===$}}function pD($,J){return function(Z){return Z.namespaceURI===$&&Z.localName===J}}function cD($){return function(J){return $.every(function(Z){return J.classList.contains(Z)})}}function lD($){return function(J){if(J.namespaceURI!==N1.HTML)return!1;return J.getAttribute("name")===$}}});var TY=p((cb,H5)=>{H5.exports=U5;var W5=P0(),oD=n2(),j5=G0(),G5=j5.HierarchyRequestError,rD=j5.NotFoundError;function U5(){W5.call(this)}U5.prototype=Object.create(W5.prototype,{hasChildNodes:{value:function(){return!1}},firstChild:{value:null},lastChild:{value:null},insertBefore:{value:function($,J){if(!$.nodeType)throw TypeError("not a node");G5()}},replaceChild:{value:function($,J){if(!$.nodeType)throw TypeError("not a node");G5()}},removeChild:{value:function($){if(!$.nodeType)throw TypeError("not a node");rD()}},removeChildren:{value:function(){}},childNodes:{get:function(){if(!this._childNodes)this._childNodes=new oD;return this._childNodes}}})});var T8=p((lb,O5)=>{O5.exports=sZ;var _5=TY(),B5=G0(),iD=oZ(),sD=IY();function sZ(){_5.call(this)}sZ.prototype=Object.create(_5.prototype,{substringData:{value:function(J,Z){if(arguments.length<2)throw TypeError("Not enough arguments");if(J=J>>>0,Z=Z>>>0,J>this.data.length||J<0||Z<0)B5.IndexSizeError();return this.data.substring(J,J+Z)}},appendData:{value:function(J){if(arguments.length<1)throw TypeError("Not enough arguments");this.data+=String(J)}},insertData:{value:function(J,Z){return this.replaceData(J,0,Z)}},deleteData:{value:function(J,Z){return this.replaceData(J,Z,"")}},replaceData:{value:function(J,Z,Y){var K=this.data,V=K.length;if(J=J>>>0,Z=Z>>>0,Y=String(Y),J>V||J<0)B5.IndexSizeError();if(J+Z>V)Z=V-J;var Q=K.substring(0,J),G=K.substring(J+Z);this.data=Q+Y+G}},isEqual:{value:function(J){return this._data===J._data}},length:{get:function(){return this.data.length}}});Object.defineProperties(sZ.prototype,iD);Object.defineProperties(sZ.prototype,sD)});var EY=p((ob,M5)=>{M5.exports=kY;var q5=G0(),F5=P0(),z5=T8();function kY($,J){z5.call(this),this.nodeType=F5.TEXT_NODE,this.ownerDocument=$,this._data=J,this._index=void 0}var k8={get:function(){return this._data},set:function($){if($===null||$===void 0)$="";else $=String($);if($===this._data)return;if(this._data=$,this.rooted)this.ownerDocument.mutateValue(this);if(this.parentNode&&this.parentNode._textchangehook)this.parentNode._textchangehook(this)}};kY.prototype=Object.create(z5.prototype,{nodeName:{value:"#text"},nodeValue:k8,textContent:k8,innerText:k8,data:{get:k8.get,set:function($){k8.set.call(this,$===null?"":String($))}},splitText:{value:function(J){if(J>this._data.length||J<0)q5.IndexSizeError();var Z=this._data.substring(J),Y=this.ownerDocument.createTextNode(Z);this.data=this.data.substring(0,J);var K=this.parentNode;if(K!==null)K.insertBefore(Y,this.nextSibling);return Y}},wholeText:{get:function(){var J=this.textContent;for(var Z=this.nextSibling;Z;Z=Z.nextSibling){if(Z.nodeType!==F5.TEXT_NODE)break;J+=Z.textContent}return J}},replaceWholeText:{value:q5.nyi},clone:{value:function(){return new kY(this.ownerDocument,this._data)}}})});var bY=p((rb,D5)=>{D5.exports=xY;var nD=P0(),C5=T8();function xY($,J){C5.call(this),this.nodeType=nD.COMMENT_NODE,this.ownerDocument=$,this._data=J}var E8={get:function(){return this._data},set:function($){if($===null||$===void 0)$="";else $=String($);if(this._data=$,this.rooted)this.ownerDocument.mutateValue(this)}};xY.prototype=Object.create(C5.prototype,{nodeName:{value:"#comment"},nodeValue:E8,textContent:E8,innerText:E8,data:{get:E8.get,set:function($){E8.set.call(this,$===null?"":String($))}},clone:{value:function(){return new xY(this.ownerDocument,this._data)}}})});var hY=p((ib,A5)=>{A5.exports=vY;var aD=P0(),tD=n2(),I5=mZ(),nZ=gJ(),eD=lZ(),P5=G0();function vY($){I5.call(this),this.nodeType=aD.DOCUMENT_FRAGMENT_NODE,this.ownerDocument=$}vY.prototype=Object.create(I5.prototype,{nodeName:{value:"#document-fragment"},nodeValue:{get:function(){return null},set:function(){}},textContent:Object.getOwnPropertyDescriptor(nZ.prototype,"textContent"),innerText:Object.getOwnPropertyDescriptor(nZ.prototype,"innerText"),querySelector:{value:function($){var J=this.querySelectorAll($);return J.length?J[0]:null}},querySelectorAll:{value:function($){var J=Object.create(this);J.isHTML=!0,J.getElementsByTagName=nZ.prototype.getElementsByTagName,J.nextElement=Object.getOwnPropertyDescriptor(nZ.prototype,"firstElementChild").get;var Z=eD($,J);return Z.item?Z:new tD(Z)}},clone:{value:function(){return new vY(this.ownerDocument)}},isEqual:{value:function(J){return!0}},innerHTML:{get:function(){return this.serialize()},set:P5.nyi},outerHTML:{get:function(){return this.serialize()},set:P5.nyi}})});var fY=p((sb,R5)=>{R5.exports=gY;var $P=P0(),S5=T8();function gY($,J,Z){S5.call(this),this.nodeType=$P.PROCESSING_INSTRUCTION_NODE,this.ownerDocument=$,this.target=J,this._data=Z}var x8={get:function(){return this._data},set:function($){if($===null||$===void 0)$="";else $=String($);if(this._data=$,this.rooted)this.ownerDocument.mutateValue(this)}};gY.prototype=Object.create(S5.prototype,{nodeName:{get:function(){return this.target}},nodeValue:x8,textContent:x8,innerText:x8,data:{get:x8.get,set:function($){x8.set.call(this,$===null?"":String($))}},clone:{value:function(){return new gY(this.ownerDocument,this.target,this._data)}},isEqual:{value:function(J){return this.target===J.target&&this._data===J._data}}})});var b8=p((nb,w5)=>{var mY={FILTER_ACCEPT:1,FILTER_REJECT:2,FILTER_SKIP:3,SHOW_ALL:4294967295,SHOW_ELEMENT:1,SHOW_ATTRIBUTE:2,SHOW_TEXT:4,SHOW_CDATA_SECTION:8,SHOW_ENTITY_REFERENCE:16,SHOW_ENTITY:32,SHOW_PROCESSING_INSTRUCTION:64,SHOW_COMMENT:128,SHOW_DOCUMENT:256,SHOW_DOCUMENT_TYPE:512,SHOW_DOCUMENT_FRAGMENT:1024,SHOW_NOTATION:2048};w5.exports=mY.constructor=mY.prototype=mY});var dY=p((tb,N5)=>{var ab=N5.exports={nextSkippingChildren:JP,nextAncestorSibling:uY,next:ZP,previous:YP,deepLastChild:L5};function JP($,J){if($===J)return null;if($.nextSibling!==null)return $.nextSibling;return uY($,J)}function uY($,J){for($=$.parentNode;$!==null;$=$.parentNode){if($===J)return null;if($.nextSibling!==null)return $.nextSibling}return null}function ZP($,J){var Z=$.firstChild;if(Z!==null)return Z;if($===J)return null;if(Z=$.nextSibling,Z!==null)return Z;return uY($,J)}function L5($){while($.lastChild)$=$.lastChild;return $}function YP($,J){var Z=$.previousSibling;if(Z!==null)return L5(Z);if(Z=$.parentNode,Z===J)return null;return Z}});var v5=p((eb,b5)=>{b5.exports=x5;var KP=P0(),I0=b8(),y5=dY(),E5=G0(),pY={first:"firstChild",last:"lastChild",next:"firstChild",previous:"lastChild"},cY={first:"nextSibling",last:"previousSibling",next:"nextSibling",previous:"previousSibling"};function T5($,J){var Z,Y,K,V,Q;Y=$._currentNode[pY[J]];while(Y!==null){if(V=$._internalFilter(Y),V===I0.FILTER_ACCEPT)return $._currentNode=Y,Y;if(V===I0.FILTER_SKIP){if(Z=Y[pY[J]],Z!==null){Y=Z;continue}}while(Y!==null){if(Q=Y[cY[J]],Q!==null){Y=Q;break}if(K=Y.parentNode,K===null||K===$.root||K===$._currentNode)return null;else Y=K}}return null}function k5($,J){var Z,Y,K;if(Z=$._currentNode,Z===$.root)return null;while(!0){K=Z[cY[J]];while(K!==null){if(Z=K,Y=$._internalFilter(Z),Y===I0.FILTER_ACCEPT)return $._currentNode=Z,Z;if(K=Z[pY[J]],Y===I0.FILTER_REJECT||K===null)K=Z[cY[J]]}if(Z=Z.parentNode,Z===null||Z===$.root)return null;if($._internalFilter(Z)===I0.FILTER_ACCEPT)return null}}function x5($,J,Z){if(!$||!$.nodeType)E5.NotSupportedError();this._root=$,this._whatToShow=Number(J)||0,this._filter=Z||null,this._active=!1,this._currentNode=$}Object.defineProperties(x5.prototype,{root:{get:function(){return this._root}},whatToShow:{get:function(){return this._whatToShow}},filter:{get:function(){return this._filter}},currentNode:{get:function(){return this._currentNode},set:function(J){if(!(J instanceof KP))throw TypeError("Not a Node");this._currentNode=J}},_internalFilter:{value:function(J){var Z,Y;if(this._active)E5.InvalidStateError();if(!(1<<J.nodeType-1&this._whatToShow))return I0.FILTER_SKIP;if(Y=this._filter,Y===null)Z=I0.FILTER_ACCEPT;else{this._active=!0;try{if(typeof Y==="function")Z=Y(J);else Z=Y.acceptNode(J)}finally{this._active=!1}}return+Z}},parentNode:{value:function(){var J=this._currentNode;while(J!==this.root){if(J=J.parentNode,J===null)return null;if(this._internalFilter(J)===I0.FILTER_ACCEPT)return this._currentNode=J,J}return null}},firstChild:{value:function(){return T5(this,"first")}},lastChild:{value:function(){return T5(this,"last")}},previousSibling:{value:function(){return k5(this,"previous")}},nextSibling:{value:function(){return k5(this,"next")}},previousNode:{value:function(){var J,Z,Y,K;J=this._currentNode;while(J!==this._root){for(Y=J.previousSibling;Y;Y=J.previousSibling){if(J=Y,Z=this._internalFilter(J),Z===I0.FILTER_REJECT)continue;for(K=J.lastChild;K;K=J.lastChild)if(J=K,Z=this._internalFilter(J),Z===I0.FILTER_REJECT)break;if(Z===I0.FILTER_ACCEPT)return this._currentNode=J,J}if(J===this.root||J.parentNode===null)return null;if(J=J.parentNode,this._internalFilter(J)===I0.FILTER_ACCEPT)return this._currentNode=J,J}return null}},nextNode:{value:function(){var J,Z,Y,K;J=this._currentNode,Z=I0.FILTER_ACCEPT;$:while(!0){for(Y=J.firstChild;Y;Y=J.firstChild)if(J=Y,Z=this._internalFilter(J),Z===I0.FILTER_ACCEPT)return this._currentNode=J,J;else if(Z===I0.FILTER_REJECT)break;for(K=y5.nextSkippingChildren(J,this.root);K;K=y5.nextSkippingChildren(J,this.root))if(J=K,Z=this._internalFilter(J),Z===I0.FILTER_ACCEPT)return this._currentNode=J,J;else if(Z===I0.FILTER_SKIP)continue $;return null}}},toString:{value:function(){return"[object TreeWalker]"}}})});var d5=p(($v,u5)=>{u5.exports=m5;var lY=b8(),oY=dY(),f5=G0();function VP($,J,Z){if(Z)return oY.next($,J);else{if($===J)return null;return oY.previous($,null)}}function h5($,J){for(;J;J=J.parentNode)if($===J)return!0;return!1}function g5($,J){var Z,Y;Z=$._referenceNode,Y=$._pointerBeforeReferenceNode;while(!0){if(Y===J)Y=!Y;else if(Z=VP(Z,$._root,J),Z===null)return null;var K=$._internalFilter(Z);if(K===lY.FILTER_ACCEPT)break}return $._referenceNode=Z,$._pointerBeforeReferenceNode=Y,Z}function m5($,J,Z){if(!$||!$.nodeType)f5.NotSupportedError();this._root=$,this._referenceNode=$,this._pointerBeforeReferenceNode=!0,this._whatToShow=Number(J)||0,this._filter=Z||null,this._active=!1,$.doc._attachNodeIterator(this)}Object.defineProperties(m5.prototype,{root:{get:function(){return this._root}},referenceNode:{get:function(){return this._referenceNode}},pointerBeforeReferenceNode:{get:function(){return this._pointerBeforeReferenceNode}},whatToShow:{get:function(){return this._whatToShow}},filter:{get:function(){return this._filter}},_internalFilter:{value:function(J){var Z,Y;if(this._active)f5.InvalidStateError();if(!(1<<J.nodeType-1&this._whatToShow))return lY.FILTER_SKIP;if(Y=this._filter,Y===null)Z=lY.FILTER_ACCEPT;else{this._active=!0;try{if(typeof Y==="function")Z=Y(J);else Z=Y.acceptNode(J)}finally{this._active=!1}}return+Z}},_preremove:{value:function(J){if(h5(J,this._root))return;if(!h5(J,this._referenceNode))return;if(this._pointerBeforeReferenceNode){var Z=J;while(Z.lastChild)Z=Z.lastChild;if(Z=oY.next(Z,this.root),Z){this._referenceNode=Z;return}this._pointerBeforeReferenceNode=!1}if(J.previousSibling===null)this._referenceNode=J.parentNode;else{this._referenceNode=J.previousSibling;var Y;for(Y=this._referenceNode.lastChild;Y;Y=this._referenceNode.lastChild)this._referenceNode=Y}}},nextNode:{value:function(){return g5(this,!0)}},previousNode:{value:function(){return g5(this,!1)}},detach:{value:function(){}},toString:{value:function(){return"[object NodeIterator]"}}})});var aZ=p((Jv,p5)=>{p5.exports=A0;function A0($){if(!$)return Object.create(A0.prototype);this.url=$.replace(/^[ \t\n\r\f]+|[ \t\n\r\f]+$/g,"");var J=A0.pattern.exec(this.url);if(J){if(J[2])this.scheme=J[2];if(J[4]){var Z=J[4].match(A0.userinfoPattern);if(Z)this.username=Z[1],this.password=Z[3],J[4]=J[4].substring(Z[0].length);if(J[4].match(A0.portPattern)){var Y=J[4].lastIndexOf(":");this.host=J[4].substring(0,Y),this.port=J[4].substring(Y+1)}else this.host=J[4]}if(J[5])this.path=J[5];if(J[6])this.query=J[7];if(J[8])this.fragment=J[9]}}A0.pattern=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/;A0.userinfoPattern=/^([^@:]*)(:([^@]*))?@/;A0.portPattern=/:\d+$/;A0.authorityPattern=/^[^:\/?#]+:\/\//;A0.hierarchyPattern=/^[^:\/?#]+:\//;A0.percentEncode=function(J){var Z=J.charCodeAt(0);if(Z<256)return"%"+Z.toString(16);else throw Error("can't percent-encode codepoints > 255 yet")};A0.prototype={constructor:A0,isAbsolute:function(){return!!this.scheme},isAuthorityBased:function(){return A0.authorityPattern.test(this.url)},isHierarchical:function(){return A0.hierarchyPattern.test(this.url)},toString:function(){var $="";if(this.scheme!==void 0)$+=this.scheme+":";if(this.isAbsolute()){if($+="//",this.username||this.password){if($+=this.username||"",this.password)$+=":"+this.password;$+="@"}if(this.host)$+=this.host}if(this.port!==void 0)$+=":"+this.port;if(this.path!==void 0)$+=this.path;if(this.query!==void 0)$+="?"+this.query;if(this.fragment!==void 0)$+="#"+this.fragment;return $},resolve:function($){var J=this,Z=new A0($),Y=new A0;if(Z.scheme!==void 0)Y.scheme=Z.scheme,Y.username=Z.username,Y.password=Z.password,Y.host=Z.host,Y.port=Z.port,Y.path=V(Z.path),Y.query=Z.query;else if(Y.scheme=J.scheme,Z.host!==void 0)Y.username=Z.username,Y.password=Z.password,Y.host=Z.host,Y.port=Z.port,Y.path=V(Z.path),Y.query=Z.query;else if(Y.username=J.username,Y.password=J.password,Y.host=J.host,Y.port=J.port,!Z.path)if(Y.path=J.path,Z.query!==void 0)Y.query=Z.query;else Y.query=J.query;else{if(Z.path.charAt(0)==="/")Y.path=V(Z.path);else Y.path=K(J.path,Z.path),Y.path=V(Y.path);Y.query=Z.query}return Y.fragment=Z.fragment,Y.toString();function K(Q,G){if(J.host!==void 0&&!J.path)return"/"+G;var W=Q.lastIndexOf("/");if(W===-1)return G;else return Q.substring(0,W+1)+G}function V(Q){if(!Q)return Q;var G="";while(Q.length>0){if(Q==="."||Q===".."){Q="";break}var W=Q.substring(0,2),_=Q.substring(0,3),j=Q.substring(0,4);if(_==="../")Q=Q.substring(3);else if(W==="./")Q=Q.substring(2);else if(_==="/./")Q="/"+Q.substring(3);else if(W==="/."&&Q.length===2)Q="/";else if(j==="/../"||_==="/.."&&Q.length===3)Q="/"+Q.substring(4),G=G.replace(/\/?[^\/]*$/,"");else{var B=Q.match(/(\/?([^\/]*))/)[0];G+=B,Q=Q.substring(B.length)}}return G}}}});var o5=p((Zv,l5)=>{l5.exports=rY;var c5=TJ();function rY($,J){c5.call(this,$,J)}rY.prototype=Object.create(c5.prototype,{constructor:{value:rY}})});var iY=p((Yv,r5)=>{r5.exports={Event:TJ(),UIEvent:e7(),MouseEvent:JY(),CustomEvent:o5()}});var a5=p((s5)=>{Object.defineProperty(s5,"__esModule",{value:!0});s5.hyphenate=s5.parse=void 0;function QP($){let J=[],Z=0,Y=0,K=0,V=0,Q=0,G=null;while(Z<$.length)switch($.charCodeAt(Z++)){case 40:Y++;break;case 41:Y--;break;case 39:if(K===0)K=39;else if(K===39&&$.charCodeAt(Z-1)!==92)K=0;break;case 34:if(K===0)K=34;else if(K===34&&$.charCodeAt(Z-1)!==92)K=0;break;case 58:if(!G&&Y===0&&K===0)G=i5($.substring(Q,Z-1).trim()),V=Z;break;case 59:if(G&&V>0&&Y===0&&K===0){let _=$.substring(V,Z-1).trim();J.push(G,_),Q=Z,V=0,G=null}break}if(G&&V){let W=$.slice(V).trim();J.push(G,W)}return J}s5.parse=QP;function i5($){return $.replace(/[a-z][A-Z]/g,(J)=>{return J.charAt(0)+"-"+J.charAt(1)}).toLowerCase()}s5.hyphenate=i5});var tZ=p((Vv,Zj)=>{var{parse:GP}=a5();Zj.exports=function($){let J=new Jj($);return new Proxy(J,{get:function(Y,K){return K in Y?Y[K]:Y.getPropertyValue(t5(K))},has:function(Y,K){return!0},set:function(Y,K,V){if(K in Y)Y[K]=V;else Y.setProperty(t5(K),V??void 0);return!0}})};function t5($){return $.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Jj($){this._element=$}var e5="!important";function $j($){let J={property:{},priority:{}};if(!$)return J;let Z=GP($);if(Z.length<2)return J;for(let Y=0;Y<Z.length;Y+=2){let K=Z[Y],V=Z[Y+1];if(V.endsWith(e5))J.priority[K]="important",V=V.slice(0,-e5.length).trim();J.property[K]=V}return J}var fJ={};Jj.prototype=Object.create(Object.prototype,{_parsed:{get:function(){if(!this._parsedStyles||this.cssText!==this._lastParsedText){var $=this.cssText;this._parsedStyles=$j($),this._lastParsedText=$,delete this._names}return this._parsedStyles}},_serialize:{value:function(){var $=this._parsed,J="";for(var Z in $.property){if(J)J+=" ";if(J+=Z+": "+$.property[Z],$.priority[Z])J+=" !"+$.priority[Z];J+=";"}this.cssText=J,this._lastParsedText=J,delete this._names}},cssText:{get:function(){return this._element.getAttribute("style")},set:function($){this._element.setAttribute("style",$)}},length:{get:function(){if(!this._names)this._names=Object.getOwnPropertyNames(this._parsed.property);return this._names.length}},item:{value:function($){if(!this._names)this._names=Object.getOwnPropertyNames(this._parsed.property);return this._names[$]}},getPropertyValue:{value:function($){return $=$.toLowerCase(),this._parsed.property[$]||""}},getPropertyPriority:{value:function($){return $=$.toLowerCase(),this._parsed.priority[$]||""}},setProperty:{value:function($,J,Z){if($=$.toLowerCase(),J===null||J===void 0)J="";if(Z===null||Z===void 0)Z="";if(J!==fJ)J=""+J;if(J=J.trim(),J===""){this.removeProperty($);return}if(Z!==""&&Z!==fJ&&!/^important$/i.test(Z))return;var Y=this._parsed;if(J===fJ){if(!Y.property[$])return;if(Z!=="")Y.priority[$]="important";else delete Y.priority[$]}else{if(J.indexOf(";")!==-1)return;var K=$j($+":"+J);if(Object.getOwnPropertyNames(K.property).length===0)return;if(Object.getOwnPropertyNames(K.priority).length!==0)return;for(var V in K.property)if(Y.property[V]=K.property[V],Z===fJ)continue;else if(Z!=="")Y.priority[V]="important";else if(Y.priority[V])delete Y.priority[V]}this._serialize()}},setPropertyValue:{value:function($,J){return this.setProperty($,J,fJ)}},setPropertyPriority:{value:function($,J){return this.setProperty($,fJ,J)}},removeProperty:{value:function($){$=$.toLowerCase();var J=this._parsed;if($ in J.property)delete J.property[$],delete J.priority[$],this._serialize()}}})});var sY=p((Qv,Yj)=>{var M0=aZ();Yj.exports=v8;function v8(){}v8.prototype=Object.create(Object.prototype,{_url:{get:function(){return new M0(this.href)}},protocol:{get:function(){var $=this._url;if($&&$.scheme)return $.scheme+":";else return":"},set:function($){var J=this.href,Z=new M0(J);if(Z.isAbsolute()){if($=$.replace(/:+$/,""),$=$.replace(/[^-+\.a-zA-Z0-9]/g,M0.percentEncode),$.length>0)Z.scheme=$,J=Z.toString()}this.href=J}},host:{get:function(){var $=this._url;if($.isAbsolute()&&$.isAuthorityBased())return $.host+($.port?":"+$.port:"");else return""},set:function($){var J=this.href,Z=new M0(J);if(Z.isAbsolute()&&Z.isAuthorityBased()){if($=$.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g,M0.percentEncode),$.length>0)Z.host=$,delete Z.port,J=Z.toString()}this.href=J}},hostname:{get:function(){var $=this._url;if($.isAbsolute()&&$.isAuthorityBased())return $.host;else return""},set:function($){var J=this.href,Z=new M0(J);if(Z.isAbsolute()&&Z.isAuthorityBased()){if($=$.replace(/^\/+/,""),$=$.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g,M0.percentEncode),$.length>0)Z.host=$,J=Z.toString()}this.href=J}},port:{get:function(){var $=this._url;if($.isAbsolute()&&$.isAuthorityBased()&&$.port!==void 0)return $.port;else return""},set:function($){var J=this.href,Z=new M0(J);if(Z.isAbsolute()&&Z.isAuthorityBased()){if($=""+$,$=$.replace(/[^0-9].*$/,""),$=$.replace(/^0+/,""),$.length===0)$="0";if(parseInt($,10)<=65535)Z.port=$,J=Z.toString()}this.href=J}},pathname:{get:function(){var $=this._url;if($.isAbsolute()&&$.isHierarchical())return $.path;else return""},set:function($){var J=this.href,Z=new M0(J);if(Z.isAbsolute()&&Z.isHierarchical()){if($.charAt(0)!=="/")$="/"+$;$=$.replace(/[^-+\._~!$&'()*,;:=@\/a-zA-Z0-9]/g,M0.percentEncode),Z.path=$,J=Z.toString()}this.href=J}},search:{get:function(){var $=this._url;if($.isAbsolute()&&$.isHierarchical()&&$.query!==void 0)return"?"+$.query;else return""},set:function($){var J=this.href,Z=new M0(J);if(Z.isAbsolute()&&Z.isHierarchical()){if($.charAt(0)==="?")$=$.substring(1);$=$.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g,M0.percentEncode),Z.query=$,J=Z.toString()}this.href=J}},hash:{get:function(){var $=this._url;if($==null||$.fragment==null||$.fragment==="")return"";else return"#"+$.fragment},set:function($){var J=this.href,Z=new M0(J);if($.charAt(0)==="#")$=$.substring(1);$=$.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g,M0.percentEncode),Z.fragment=$,J=Z.toString(),this.href=J}},username:{get:function(){var $=this._url;return $.username||""},set:function($){var J=this.href,Z=new M0(J);if(Z.isAbsolute())$=$.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\:]/g,M0.percentEncode),Z.username=$,J=Z.toString();this.href=J}},password:{get:function(){var $=this._url;return $.password||""},set:function($){var J=this.href,Z=new M0(J);if(Z.isAbsolute()){if($==="")Z.password=null;else $=$.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\]/g,M0.percentEncode),Z.password=$;J=Z.toString()}this.href=J}},origin:{get:function(){var $=this._url;if($==null)return"";var J=function(Z){var Y=[$.scheme,$.host,+$.port||Z];return Y[0]+"://"+Y[1]+(Y[2]===Z?"":":"+Y[2])};switch($.scheme){case"ftp":return J(21);case"gopher":return J(70);case"http":case"ws":return J(80);case"https":case"wss":return J(443);default:return $.scheme+"://"}}}});v8._inherit=function($){Object.getOwnPropertyNames(v8.prototype).forEach(function(J){if(J==="constructor"||J==="href")return;var Z=Object.getOwnPropertyDescriptor(v8.prototype,J);Object.defineProperty($,J,Z)})}});var nY=p((Xv,Qj)=>{var Kj=qY(),WP=hZ().isApiWritable;Qj.exports=function($,J,Z,Y){var K=$.ctor;if(K){var V=$.props||{};if($.attributes)for(var Q in $.attributes){var G=$.attributes[Q];if(typeof G!=="object"||Array.isArray(G))G={type:G};if(!G.name)G.name=Q.toLowerCase();V[Q]=Kj.property(G)}if(V.constructor={value:K,writable:WP},K.prototype=Object.create(($.superclass||J).prototype,V),$.events)UP(K,$.events);Z[$.name]=K}else K=J;return($.tags||$.tag&&[$.tag]||[]).forEach(function(W){Y[W]=K}),K};function Vj($,J,Z,Y){this.body=$,this.document=J,this.form=Z,this.element=Y}Vj.prototype.build=function(){return()=>{}};function jP($,J,Z,Y){var K=$.ownerDocument||Object.create(null),V=$.form||Object.create(null);$[J]=new Vj(Y,K,V,$).build()}function UP($,J){var Z=$.prototype;J.forEach(function(Y){Object.defineProperty(Z,"on"+Y,{get:function(){return this._getEventHandler(Y)},set:function(K){this._setEventHandler(Y,K)}}),Kj.registerChangeHandler($,"on"+Y,jP)})}});var $6=p((qP)=>{var aY=P0(),Xj=gJ(),HP=tZ(),l0=G0(),Gj=sY(),BP=nY(),i1=qP.elements={},h8=Object.create(null);qP.createElement=function($,J,Z){var Y=h8[J]||OP;return new Y($,J,Z)};function o($){return BP($,K$,i1,h8)}function W0($){return{get:function(){var J=this._getattr($);if(J===null)return"";var Z=this.doc._resolve(J);return Z===null?J:Z},set:function(J){this._setattr($,J)}}}function eZ($){return{get:function(){var J=this._getattr($);if(J===null)return null;if(J.toLowerCase()==="use-credentials")return"use-credentials";return"anonymous"},set:function(J){if(J===null||J===void 0)this.removeAttribute($);else this._setattr($,J)}}}var mJ={type:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],missing:""},_P={A:!0,LINK:!0,BUTTON:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0,COMMAND:!0},F1=function($,J,Z){K$.call(this,$,J,Z),this._form=null},K$=qP.HTMLElement=o({superclass:Xj,name:"HTMLElement",ctor:function(J,Z,Y){Xj.call(this,J,Z,l0.NAMESPACE.HTML,Y)},props:{dangerouslySetInnerHTML:{set:function($){this._innerHTML=$}},innerHTML:{get:function(){return this.serialize()},set:function($){var J=this.ownerDocument.implementation.mozHTMLParser(this.ownerDocument._address,this);J.parse($===null?"":String($),!0);var Z=this instanceof h8.template?this.content:this;while(Z.hasChildNodes())Z.removeChild(Z.firstChild);Z.appendChild(J._asDocumentFragment())}},style:{get:function(){if(!this._style)this._style=new HP(this);return this._style},set:function($){if($===null||$===void 0)$="";this._setattr("style",String($))}},blur:{value:function(){}},focus:{value:function(){}},forceSpellCheck:{value:function(){}},click:{value:function(){if(this._click_in_progress)return;this._click_in_progress=!0;try{if(this._pre_click_activation_steps)this._pre_click_activation_steps();var $=this.ownerDocument.createEvent("MouseEvent");$.initMouseEvent("click",!0,!0,this.ownerDocument.defaultView,1,0,0,0,0,!1,!1,!1,!1,0,null);var J=this.dispatchEvent($);if(J){if(this._post_click_activation_steps)this._post_click_activation_steps($)}else if(this._cancelled_activation_steps)this._cancelled_activation_steps()}finally{this._click_in_progress=!1}}},submit:{value:l0.nyi}},attributes:{title:String,lang:String,dir:{type:["ltr","rtl","auto"],missing:""},draggable:{type:["true","false"],treatNullAsEmptyString:!0},spellcheck:{type:["true","false"],missing:""},enterKeyHint:{type:["enter","done","go","next","previous","search","send"],missing:""},autoCapitalize:{type:["off","on","none","sentences","words","characters"],missing:""},autoFocus:Boolean,accessKey:String,nonce:String,hidden:Boolean,translate:{type:["no","yes"],missing:""},tabIndex:{type:"long",default:function(){if(this.tagName in _P||this.contentEditable)return 0;else return-1}}},events:["abort","canplay","canplaythrough","change","click","contextmenu","cuechange","dblclick","drag","dragend","dragenter","dragleave","dragover","dragstart","drop","durationchange","emptied","ended","input","invalid","keydown","keypress","keyup","loadeddata","loadedmetadata","loadstart","mousedown","mousemove","mouseout","mouseover","mouseup","mousewheel","pause","play","playing","progress","ratechange","readystatechange","reset","seeked","seeking","select","show","stalled","submit","suspend","timeupdate","volumechange","waiting","blur","error","focus","load","scroll"]}),OP=o({name:"HTMLUnknownElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)}}),z1={form:{get:function(){return this._form}}};o({tag:"a",name:"HTMLAnchorElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{_post_click_activation_steps:{value:function($){if(this.href)this.ownerDocument.defaultView.location=this.href}}},attributes:{href:W0,ping:String,download:String,target:String,rel:String,media:String,hreflang:String,type:String,referrerPolicy:mJ,coords:String,charset:String,name:String,rev:String,shape:String}});Gj._inherit(h8.a.prototype);o({tag:"area",name:"HTMLAreaElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{alt:String,target:String,download:String,rel:String,media:String,href:W0,hreflang:String,type:String,shape:String,coords:String,ping:String,referrerPolicy:mJ,noHref:Boolean}});Gj._inherit(h8.area.prototype);o({tag:"br",name:"HTMLBRElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{clear:String}});o({tag:"base",name:"HTMLBaseElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{target:String}});o({tag:"body",name:"HTMLBodyElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},events:["afterprint","beforeprint","beforeunload","blur","error","focus","hashchange","load","message","offline","online","pagehide","pageshow","popstate","resize","scroll","storage","unload"],attributes:{text:{type:String,treatNullAsEmptyString:!0},link:{type:String,treatNullAsEmptyString:!0},vLink:{type:String,treatNullAsEmptyString:!0},aLink:{type:String,treatNullAsEmptyString:!0},bgColor:{type:String,treatNullAsEmptyString:!0},background:String}});o({tag:"button",name:"HTMLButtonElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{name:String,value:String,disabled:Boolean,autofocus:Boolean,type:{type:["submit","reset","button","menu"],missing:"submit"},formTarget:String,formAction:W0,formNoValidate:Boolean,formMethod:{type:["get","post","dialog"],invalid:"get",missing:""},formEnctype:{type:["application/x-www-form-urlencoded","multipart/form-data","text/plain"],invalid:"application/x-www-form-urlencoded",missing:""}}});o({tag:"dl",name:"HTMLDListElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{compact:Boolean}});o({tag:"data",name:"HTMLDataElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{value:String}});o({tag:"datalist",name:"HTMLDataListElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)}});o({tag:"details",name:"HTMLDetailsElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{open:Boolean}});o({tag:"div",name:"HTMLDivElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{align:String}});o({tag:"embed",name:"HTMLEmbedElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{src:W0,type:String,width:String,height:String,align:String,name:String}});o({tag:"fieldset",name:"HTMLFieldSetElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{disabled:Boolean,name:String}});o({tag:"form",name:"HTMLFormElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{action:String,autocomplete:{type:["on","off"],missing:"on"},name:String,acceptCharset:{name:"accept-charset"},target:String,noValidate:Boolean,method:{type:["get","post","dialog"],invalid:"get",missing:"get"},enctype:{type:["application/x-www-form-urlencoded","multipart/form-data","text/plain"],invalid:"application/x-www-form-urlencoded",missing:"application/x-www-form-urlencoded"},encoding:{name:"enctype",type:["application/x-www-form-urlencoded","multipart/form-data","text/plain"],invalid:"application/x-www-form-urlencoded",missing:"application/x-www-form-urlencoded"}}});o({tag:"hr",name:"HTMLHRElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{align:String,color:String,noShade:Boolean,size:String,width:String}});o({tag:"head",name:"HTMLHeadElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)}});o({tags:["h1","h2","h3","h4","h5","h6"],name:"HTMLHeadingElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{align:String}});o({tag:"html",name:"HTMLHtmlElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{xmlns:W0,version:String}});o({tag:"iframe",name:"HTMLIFrameElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{src:W0,srcdoc:String,name:String,width:String,height:String,seamless:Boolean,allow:Boolean,allowFullscreen:Boolean,allowUserMedia:Boolean,allowPaymentRequest:Boolean,referrerPolicy:mJ,loading:{type:["eager","lazy"],treatNullAsEmptyString:!0},align:String,scrolling:String,frameBorder:String,longDesc:W0,marginHeight:{type:String,treatNullAsEmptyString:!0},marginWidth:{type:String,treatNullAsEmptyString:!0}}});o({tag:"img",name:"HTMLImageElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{alt:String,src:W0,srcset:String,crossOrigin:eZ,useMap:String,isMap:Boolean,sizes:String,height:{type:"unsigned long",default:0},width:{type:"unsigned long",default:0},referrerPolicy:mJ,loading:{type:["eager","lazy"],missing:""},name:String,lowsrc:W0,align:String,hspace:{type:"unsigned long",default:0},vspace:{type:"unsigned long",default:0},longDesc:W0,border:{type:String,treatNullAsEmptyString:!0}}});o({tag:"input",name:"HTMLInputElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:{form:z1.form,_post_click_activation_steps:{value:function($){if(this.type==="checkbox")this.checked=!this.checked;else if(this.type==="radio"){var J=this.form.getElementsByName(this.name);for(var Z=J.length-1;Z>=0;Z--){var Y=J[Z];Y.checked=Y===this}}}}},attributes:{name:String,disabled:Boolean,autofocus:Boolean,accept:String,alt:String,max:String,min:String,pattern:String,placeholder:String,step:String,dirName:String,defaultValue:{name:"value"},multiple:Boolean,required:Boolean,readOnly:Boolean,checked:Boolean,value:String,src:W0,defaultChecked:{name:"checked",type:Boolean},size:{type:"unsigned long",default:20,min:1,setmin:1},width:{type:"unsigned long",min:0,setmin:0,default:0},height:{type:"unsigned long",min:0,setmin:0,default:0},minLength:{type:"unsigned long",min:0,setmin:0,default:-1},maxLength:{type:"unsigned long",min:0,setmin:0,default:-1},autocomplete:String,type:{type:["text","hidden","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"],missing:"text"},formTarget:String,formNoValidate:Boolean,formMethod:{type:["get","post"],invalid:"get",missing:""},formEnctype:{type:["application/x-www-form-urlencoded","multipart/form-data","text/plain"],invalid:"application/x-www-form-urlencoded",missing:""},inputMode:{type:["verbatim","latin","latin-name","latin-prose","full-width-latin","kana","kana-name","katakana","numeric","tel","email","url"],missing:""},align:String,useMap:String}});o({tag:"keygen",name:"HTMLKeygenElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{name:String,disabled:Boolean,autofocus:Boolean,challenge:String,keytype:{type:["rsa"],missing:""}}});o({tag:"li",name:"HTMLLIElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{value:{type:"long",default:0},type:String}});o({tag:"label",name:"HTMLLabelElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{htmlFor:{name:"for",type:String}}});o({tag:"legend",name:"HTMLLegendElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{align:String}});o({tag:"link",name:"HTMLLinkElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{href:W0,rel:String,media:String,hreflang:String,type:String,crossOrigin:eZ,nonce:String,integrity:String,referrerPolicy:mJ,imageSizes:String,imageSrcset:String,charset:String,rev:String,target:String}});o({tag:"map",name:"HTMLMapElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{name:String}});o({tag:"menu",name:"HTMLMenuElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{type:{type:["context","popup","toolbar"],missing:"toolbar"},label:String,compact:Boolean}});o({tag:"meta",name:"HTMLMetaElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{name:String,content:String,httpEquiv:{name:"http-equiv",type:String},scheme:String}});o({tag:"meter",name:"HTMLMeterElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1});o({tags:["ins","del"],name:"HTMLModElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{cite:W0,dateTime:String}});o({tag:"ol",name:"HTMLOListElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{_numitems:{get:function(){var $=0;return this.childNodes.forEach(function(J){if(J.nodeType===aY.ELEMENT_NODE&&J.tagName==="LI")$++}),$}}},attributes:{type:String,reversed:Boolean,start:{type:"long",default:function(){if(this.reversed)return this._numitems;else return 1}},compact:Boolean}});o({tag:"object",name:"HTMLObjectElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{data:W0,type:String,name:String,useMap:String,typeMustMatch:Boolean,width:String,height:String,align:String,archive:String,code:String,declare:Boolean,hspace:{type:"unsigned long",default:0},standby:String,vspace:{type:"unsigned long",default:0},codeBase:W0,codeType:String,border:{type:String,treatNullAsEmptyString:!0}}});o({tag:"optgroup",name:"HTMLOptGroupElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{disabled:Boolean,label:String}});o({tag:"option",name:"HTMLOptionElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{form:{get:function(){var $=this.parentNode;while($&&$.nodeType===aY.ELEMENT_NODE){if($.localName==="select")return $.form;$=$.parentNode}}},value:{get:function(){return this._getattr("value")||this.text},set:function($){this._setattr("value",$)}},text:{get:function(){return this.textContent.replace(/[ \t\n\f\r]+/g," ").trim()},set:function($){this.textContent=$}}},attributes:{disabled:Boolean,defaultSelected:{name:"selected",type:Boolean},label:String}});o({tag:"output",name:"HTMLOutputElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{name:String}});o({tag:"p",name:"HTMLParagraphElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{align:String}});o({tag:"param",name:"HTMLParamElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{name:String,value:String,type:String,valueType:String}});o({tags:["pre","listing","xmp"],name:"HTMLPreElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{width:{type:"long",default:0}}});o({tag:"progress",name:"HTMLProgressElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:z1,attributes:{max:{type:Number,float:!0,default:1,min:0}}});o({tags:["q","blockquote"],name:"HTMLQuoteElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{cite:W0}});o({tag:"script",name:"HTMLScriptElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{text:{get:function(){var $="";for(var J=0,Z=this.childNodes.length;J<Z;J++){var Y=this.childNodes[J];if(Y.nodeType===aY.TEXT_NODE)$+=Y._data}return $},set:function($){if(this.removeChildren(),$!==null&&$!=="")this.appendChild(this.ownerDocument.createTextNode($))}}},attributes:{src:W0,type:String,charset:String,referrerPolicy:mJ,defer:Boolean,async:Boolean,nomodule:Boolean,crossOrigin:eZ,nonce:String,integrity:String}});o({tag:"select",name:"HTMLSelectElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:{form:z1.form,options:{get:function(){return this.getElementsByTagName("option")}}},attributes:{autocomplete:String,name:String,disabled:Boolean,autofocus:Boolean,multiple:Boolean,required:Boolean,size:{type:"unsigned long",default:0}}});o({tag:"span",name:"HTMLSpanElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)}});o({tag:"style",name:"HTMLStyleElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{media:String,type:String,scoped:Boolean}});o({tag:"caption",name:"HTMLTableCaptionElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{align:String}});o({name:"HTMLTableCellElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{colSpan:{type:"unsigned long",default:1},rowSpan:{type:"unsigned long",default:1},scope:{type:["row","col","rowgroup","colgroup"],missing:""},abbr:String,align:String,axis:String,height:String,width:String,ch:{name:"char",type:String},chOff:{name:"charoff",type:String},noWrap:Boolean,vAlign:String,bgColor:{type:String,treatNullAsEmptyString:!0}}});o({tags:["col","colgroup"],name:"HTMLTableColElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{span:{type:"limited unsigned long with fallback",default:1,min:1},align:String,ch:{name:"char",type:String},chOff:{name:"charoff",type:String},vAlign:String,width:String}});o({tag:"table",name:"HTMLTableElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{rows:{get:function(){return this.getElementsByTagName("tr")}}},attributes:{align:String,border:String,frame:String,rules:String,summary:String,width:String,bgColor:{type:String,treatNullAsEmptyString:!0},cellPadding:{type:String,treatNullAsEmptyString:!0},cellSpacing:{type:String,treatNullAsEmptyString:!0}}});o({tag:"template",name:"HTMLTemplateElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y),this._contentFragment=J._templateDoc.createDocumentFragment()},props:{content:{get:function(){return this._contentFragment}},serialize:{value:function(){return this.content.serialize()}}}});o({tag:"tr",name:"HTMLTableRowElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{cells:{get:function(){return this.querySelectorAll("td,th")}}},attributes:{align:String,ch:{name:"char",type:String},chOff:{name:"charoff",type:String},vAlign:String,bgColor:{type:String,treatNullAsEmptyString:!0}}});o({tags:["thead","tfoot","tbody"],name:"HTMLTableSectionElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{rows:{get:function(){return this.getElementsByTagName("tr")}}},attributes:{align:String,ch:{name:"char",type:String},chOff:{name:"charoff",type:String},vAlign:String}});o({tag:"textarea",name:"HTMLTextAreaElement",ctor:function(J,Z,Y){F1.call(this,J,Z,Y)},props:{form:z1.form,type:{get:function(){return"textarea"}},defaultValue:{get:function(){return this.textContent},set:function($){this.textContent=$}},value:{get:function(){return this.defaultValue},set:function($){this.defaultValue=$}},textLength:{get:function(){return this.value.length}}},attributes:{autocomplete:String,name:String,disabled:Boolean,autofocus:Boolean,placeholder:String,wrap:String,dirName:String,required:Boolean,readOnly:Boolean,rows:{type:"limited unsigned long with fallback",default:2},cols:{type:"limited unsigned long with fallback",default:20},maxLength:{type:"unsigned long",min:0,setmin:0,default:-1},minLength:{type:"unsigned long",min:0,setmin:0,default:-1},inputMode:{type:["verbatim","latin","latin-name","latin-prose","full-width-latin","kana","kana-name","katakana","numeric","tel","email","url"],missing:""}}});o({tag:"time",name:"HTMLTimeElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{dateTime:String,pubDate:Boolean}});o({tag:"title",name:"HTMLTitleElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{text:{get:function(){return this.textContent}}}});o({tag:"ul",name:"HTMLUListElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{type:String,compact:Boolean}});o({name:"HTMLMediaElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{src:W0,crossOrigin:eZ,preload:{type:["metadata","none","auto",{value:"",alias:"auto"}],missing:"auto"},loop:Boolean,autoplay:Boolean,mediaGroup:String,controls:Boolean,defaultMuted:{name:"muted",type:Boolean}}});o({name:"HTMLAudioElement",tag:"audio",superclass:i1.HTMLMediaElement,ctor:function(J,Z,Y){i1.HTMLMediaElement.call(this,J,Z,Y)}});o({name:"HTMLVideoElement",tag:"video",superclass:i1.HTMLMediaElement,ctor:function(J,Z,Y){i1.HTMLMediaElement.call(this,J,Z,Y)},attributes:{poster:W0,width:{type:"unsigned long",min:0,default:0},height:{type:"unsigned long",min:0,default:0}}});o({tag:"td",name:"HTMLTableDataCellElement",superclass:i1.HTMLTableCellElement,ctor:function(J,Z,Y){i1.HTMLTableCellElement.call(this,J,Z,Y)}});o({tag:"th",name:"HTMLTableHeaderCellElement",superclass:i1.HTMLTableCellElement,ctor:function(J,Z,Y){i1.HTMLTableCellElement.call(this,J,Z,Y)}});o({tag:"frameset",name:"HTMLFrameSetElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)}});o({tag:"frame",name:"HTMLFrameElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)}});o({tag:"canvas",name:"HTMLCanvasElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{getContext:{value:l0.nyi},probablySupportsContext:{value:l0.nyi},setContext:{value:l0.nyi},transferControlToProxy:{value:l0.nyi},toDataURL:{value:l0.nyi},toBlob:{value:l0.nyi}},attributes:{width:{type:"unsigned long",default:300},height:{type:"unsigned long",default:150}}});o({tag:"dialog",name:"HTMLDialogElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{show:{value:l0.nyi},showModal:{value:l0.nyi},close:{value:l0.nyi}},attributes:{open:Boolean,returnValue:String}});o({tag:"menuitem",name:"HTMLMenuItemElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},props:{_label:{get:function(){var $=this._getattr("label");if($!==null&&$!=="")return $;return $=this.textContent,$.replace(/[ \t\n\f\r]+/g," ").trim()}},label:{get:function(){var $=this._getattr("label");if($!==null)return $;return this._label},set:function($){this._setattr("label",$)}}},attributes:{type:{type:["command","checkbox","radio"],missing:"command"},icon:W0,disabled:Boolean,checked:Boolean,radiogroup:String,default:Boolean}});o({tag:"source",name:"HTMLSourceElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{srcset:String,sizes:String,media:String,src:W0,type:String,width:String,height:String}});o({tag:"track",name:"HTMLTrackElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{src:W0,srclang:String,label:String,default:Boolean,kind:{type:["subtitles","captions","descriptions","chapters","metadata"],missing:"subtitles",invalid:"metadata"}},props:{NONE:{get:function(){return 0}},LOADING:{get:function(){return 1}},LOADED:{get:function(){return 2}},ERROR:{get:function(){return 3}},readyState:{get:l0.nyi},track:{get:l0.nyi}}});o({tag:"font",name:"HTMLFontElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{color:{type:String,treatNullAsEmptyString:!0},face:{type:String},size:{type:String}}});o({tag:"dir",name:"HTMLDirectoryElement",ctor:function(J,Z,Y){K$.call(this,J,Z,Y)},attributes:{compact:Boolean}});o({tags:["abbr","address","article","aside","b","bdi","bdo","cite","content","code","dd","dfn","dt","em","figcaption","figure","footer","header","hgroup","i","kbd","main","mark","nav","noscript","rb","rp","rt","rtc","ruby","s","samp","section","small","strong","sub","summary","sup","u","var","wbr","acronym","basefont","big","center","nobr","noembed","noframes","plaintext","strike","tt"]})});var $3=p((PP)=>{var Wj=gJ(),zP=nY(),MP=G0(),CP=tZ(),DP=PP.elements={},jj=Object.create(null);PP.createElement=function($,J,Z){var Y=jj[J]||eY;return new Y($,J,Z)};function tY($){return zP($,eY,DP,jj)}var eY=tY({superclass:Wj,name:"SVGElement",ctor:function(J,Z,Y){Wj.call(this,J,Z,MP.NAMESPACE.SVG,Y)},props:{style:{get:function(){if(!this._style)this._style=new CP(this);return this._style}}}});tY({name:"SVGSVGElement",ctor:function(J,Z,Y){eY.call(this,J,Z,Y)},tag:"svg",props:{createSVGRect:{value:function(){return PP.createElement(this.ownerDocument,"rect",null)}}}});tY({tags:["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"]})});var Bj=p((Bv,Hj)=>{Hj.exports={VALUE:1,ATTR:2,REMOVE_ATTR:3,REMOVE:4,MOVE:5,INSERT:6}});var Z6=p((_v,Ij)=>{Ij.exports=f8;var L0=P0(),IP=n2(),Mj=mZ(),q2=gJ(),AP=EY(),SP=bY(),g8=TJ(),RP=hY(),wP=fY(),LP=m8(),NP=v5(),yP=d5(),_j=b8(),Oj=aZ(),qj=lZ(),TP=iY(),J6=uZ(),J3=$6(),kP=$3(),v$=G0(),uJ=Bj(),pJ=v$.NAMESPACE,Z3=hZ().isApiWritable;function f8($,J){Mj.call(this),this.nodeType=L0.DOCUMENT_NODE,this.isHTML=$,this._address=J||"about:blank",this.readyState="loading",this.implementation=new LP(this),this.ownerDocument=null,this._contentType=$?"text/html":"application/xml",this.doctype=null,this.documentElement=null,this._templateDocCache=null,this._nodeIterators=null,this._nid=1,this._nextnid=2,this._nodes=[null,this],this.byId=Object.create(null),this.modclock=0}var EP={event:"Event",customevent:"CustomEvent",uievent:"UIEvent",mouseevent:"MouseEvent"},xP={events:"event",htmlevents:"event",mouseevents:"mouseevent",mutationevents:"mutationevent",uievents:"uievent"},dJ=function($,J,Z){return{get:function(){var Y=$.call(this);if(Y)return Y[J];return Z},set:function(Y){var K=$.call(this);if(K)K[J]=Y}}};function Fj($,J){var Z,Y,K;if($==="")$=null;if(!J6.isValidQName(J))v$.InvalidCharacterError();if(Z=null,Y=J,K=J.indexOf(":"),K>=0)Z=J.substring(0,K),Y=J.substring(K+1);if(Z!==null&&$===null)v$.NamespaceError();if(Z==="xml"&&$!==pJ.XML)v$.NamespaceError();if((Z==="xmlns"||J==="xmlns")&&$!==pJ.XMLNS)v$.NamespaceError();if($===pJ.XMLNS&&!(Z==="xmlns"||J==="xmlns"))v$.NamespaceError();return{namespace:$,prefix:Z,localName:Y}}f8.prototype=Object.create(Mj.prototype,{_setMutationHandler:{value:function($){this.mutationHandler=$}},_dispatchRendererEvent:{value:function($,J,Z){var Y=this._nodes[$];if(!Y)return;Y._dispatchEvent(new g8(J,Z),!0)}},nodeName:{value:"#document"},nodeValue:{get:function(){return null},set:function(){}},documentURI:{get:function(){return this._address},set:v$.nyi},compatMode:{get:function(){return this._quirks?"BackCompat":"CSS1Compat"}},createTextNode:{value:function($){return new AP(this,String($))}},createComment:{value:function($){return new SP(this,$)}},createDocumentFragment:{value:function(){return new RP(this)}},createProcessingInstruction:{value:function($,J){if(!J6.isValidName($)||J.indexOf("?>")!==-1)v$.InvalidCharacterError();return new wP(this,$,J)}},createAttribute:{value:function($){if($=String($),!J6.isValidName($))v$.InvalidCharacterError();if(this.isHTML)$=v$.toASCIILowerCase($);return new q2._Attr(null,$,null,null,"")}},createAttributeNS:{value:function($,J){$=$===null||$===void 0||$===""?null:String($),J=String(J);var Z=Fj($,J);return new q2._Attr(null,Z.localName,Z.prefix,Z.namespace,"")}},createElement:{value:function($){if($=String($),!J6.isValidName($))v$.InvalidCharacterError();if(this.isHTML){if(/[A-Z]/.test($))$=v$.toASCIILowerCase($);return J3.createElement(this,$,null)}else if(this.contentType==="application/xhtml+xml")return J3.createElement(this,$,null);else return new q2(this,$,null,null)},writable:Z3},createElementNS:{value:function($,J){$=$===null||$===void 0||$===""?null:String($),J=String(J);var Z=Fj($,J);return this._createElementNS(Z.localName,Z.namespace,Z.prefix)},writable:Z3},_createElementNS:{value:function($,J,Z){if(J===pJ.HTML)return J3.createElement(this,$,Z);else if(J===pJ.SVG)return kP.createElement(this,$,Z);return new q2(this,$,J,Z)}},createEvent:{value:function(J){J=J.toLowerCase();var Z=xP[J]||J,Y=TP[EP[Z]];if(Y){var K=new Y;return K._initialized=!1,K}else v$.NotSupportedError()}},createTreeWalker:{value:function($,J,Z){if(!$)throw TypeError("root argument is required");if(!($ instanceof L0))throw TypeError("root not a node");return J=J===void 0?_j.SHOW_ALL:+J,Z=Z===void 0?null:Z,new NP($,J,Z)}},createNodeIterator:{value:function($,J,Z){if(!$)throw TypeError("root argument is required");if(!($ instanceof L0))throw TypeError("root not a node");return J=J===void 0?_j.SHOW_ALL:+J,Z=Z===void 0?null:Z,new yP($,J,Z)}},_attachNodeIterator:{value:function($){if(!this._nodeIterators)this._nodeIterators=[];this._nodeIterators.push($)}},_detachNodeIterator:{value:function($){var J=this._nodeIterators.indexOf($);this._nodeIterators.splice(J,1)}},_preremoveNodeIterators:{value:function($){if(this._nodeIterators)this._nodeIterators.forEach(function(J){J._preremove($)})}},_updateDocTypeElement:{value:function(){this.doctype=this.documentElement=null;for(var J=this.firstChild;J!==null;J=J.nextSibling)if(J.nodeType===L0.DOCUMENT_TYPE_NODE)this.doctype=J;else if(J.nodeType===L0.ELEMENT_NODE)this.documentElement=J}},insertBefore:{value:function(J,Z){return L0.prototype.insertBefore.call(this,J,Z),this._updateDocTypeElement(),J}},replaceChild:{value:function(J,Z){return L0.prototype.replaceChild.call(this,J,Z),this._updateDocTypeElement(),Z}},removeChild:{value:function(J){return L0.prototype.removeChild.call(this,J),this._updateDocTypeElement(),J}},getElementById:{value:function($){var J=this.byId[$];if(!J)return null;if(J instanceof s1)return J.getFirst();return J}},_hasMultipleElementsWithId:{value:function($){return this.byId[$]instanceof s1}},getElementsByName:{value:q2.prototype.getElementsByName},getElementsByTagName:{value:q2.prototype.getElementsByTagName},getElementsByTagNameNS:{value:q2.prototype.getElementsByTagNameNS},getElementsByClassName:{value:q2.prototype.getElementsByClassName},adoptNode:{value:function(J){if(J.nodeType===L0.DOCUMENT_NODE)v$.NotSupportedError();if(J.nodeType===L0.ATTRIBUTE_NODE)return J;if(J.parentNode)J.parentNode.removeChild(J);if(J.ownerDocument!==this)Pj(J,this);return J}},importNode:{value:function(J,Z){return this.adoptNode(J.cloneNode(Z))},writable:Z3},origin:{get:function(){return null}},characterSet:{get:function(){return"UTF-8"}},contentType:{get:function(){return this._contentType}},URL:{get:function(){return this._address}},domain:{get:v$.nyi,set:v$.nyi},referrer:{get:v$.nyi},cookie:{get:v$.nyi,set:v$.nyi},lastModified:{get:v$.nyi},location:{get:function(){return this.defaultView?this.defaultView.location:null},set:v$.nyi},_titleElement:{get:function(){return this.getElementsByTagName("title").item(0)||null}},title:{get:function(){var $=this._titleElement,J=$?$.textContent:"";return J.replace(/[ \t\n\r\f]+/g," ").replace(/(^ )|( $)/g,"")},set:function($){var J=this._titleElement,Z=this.head;if(!J&&!Z)return;if(!J)J=this.createElement("title"),Z.appendChild(J);J.textContent=$}},dir:dJ(function(){var $=this.documentElement;if($&&$.tagName==="HTML")return $},"dir",""),fgColor:dJ(function(){return this.body},"text",""),linkColor:dJ(function(){return this.body},"link",""),vlinkColor:dJ(function(){return this.body},"vLink",""),alinkColor:dJ(function(){return this.body},"aLink",""),bgColor:dJ(function(){return this.body},"bgColor",""),charset:{get:function(){return this.characterSet}},inputEncoding:{get:function(){return this.characterSet}},scrollingElement:{get:function(){return this._quirks?this.body:this.documentElement}},body:{get:function(){return zj(this.documentElement,"body")},set:v$.nyi},head:{get:function(){return zj(this.documentElement,"head")}},images:{get:v$.nyi},embeds:{get:v$.nyi},plugins:{get:v$.nyi},links:{get:v$.nyi},forms:{get:v$.nyi},scripts:{get:v$.nyi},applets:{get:function(){return[]}},activeElement:{get:function(){return null}},innerHTML:{get:function(){return this.serialize()},set:v$.nyi},outerHTML:{get:function(){return this.serialize()},set:v$.nyi},write:{value:function($){if(!this.isHTML)v$.InvalidStateError();if(!this._parser)return;if(!this._parser);var J=arguments.join("");this._parser.parse(J)}},writeln:{value:function(J){this.write(Array.prototype.join.call(arguments,"")+`
32
+ `)}},open:{value:function(){this.documentElement=null}},close:{value:function(){if(this.readyState="interactive",this._dispatchEvent(new g8("readystatechange"),!0),this._dispatchEvent(new g8("DOMContentLoaded"),!0),this.readyState="complete",this._dispatchEvent(new g8("readystatechange"),!0),this.defaultView)this.defaultView._dispatchEvent(new g8("load"),!0)}},clone:{value:function(){var J=new f8(this.isHTML,this._address);return J._quirks=this._quirks,J._contentType=this._contentType,J}},cloneNode:{value:function(J){var Z=L0.prototype.cloneNode.call(this,!1);if(J)for(var Y=this.firstChild;Y!==null;Y=Y.nextSibling)Z._appendChild(Z.importNode(Y,!0));return Z._updateDocTypeElement(),Z}},isEqual:{value:function(J){return!0}},mutateValue:{value:function($){if(this.mutationHandler)this.mutationHandler({type:uJ.VALUE,target:$,data:$.data})}},mutateAttr:{value:function($,J){if(this.mutationHandler)this.mutationHandler({type:uJ.ATTR,target:$.ownerElement,attr:$})}},mutateRemoveAttr:{value:function($){if(this.mutationHandler)this.mutationHandler({type:uJ.REMOVE_ATTR,target:$.ownerElement,attr:$})}},mutateRemove:{value:function($){if(this.mutationHandler)this.mutationHandler({type:uJ.REMOVE,target:$.parentNode,node:$});Dj($)}},mutateInsert:{value:function($){if(Cj($),this.mutationHandler)this.mutationHandler({type:uJ.INSERT,target:$.parentNode,node:$})}},mutateMove:{value:function($){if(this.mutationHandler)this.mutationHandler({type:uJ.MOVE,target:$})}},addId:{value:function(J,Z){var Y=this.byId[J];if(!Y)this.byId[J]=Z;else{if(!(Y instanceof s1))Y=new s1(Y),this.byId[J]=Y;Y.add(Z)}}},delId:{value:function(J,Z){var Y=this.byId[J];if(v$.assert(Y),Y instanceof s1){if(Y.del(Z),Y.length===1)this.byId[J]=Y.downgrade()}else this.byId[J]=void 0}},_resolve:{value:function($){return new Oj(this._documentBaseURL).resolve($)}},_documentBaseURL:{get:function(){var $=this._address;if($==="about:blank")$="/";var J=this.querySelector("base[href]");if(J)return new Oj($).resolve(J.getAttribute("href"));return $}},_templateDoc:{get:function(){if(!this._templateDocCache){var $=new f8(this.isHTML,this._address);this._templateDocCache=$._templateDocCache=$}return this._templateDocCache}},querySelector:{value:function($){return qj($,this)[0]}},querySelectorAll:{value:function($){var J=qj($,this);return J.item?J:new IP(J)}}});var bP=["abort","canplay","canplaythrough","change","click","contextmenu","cuechange","dblclick","drag","dragend","dragenter","dragleave","dragover","dragstart","drop","durationchange","emptied","ended","input","invalid","keydown","keypress","keyup","loadeddata","loadedmetadata","loadstart","mousedown","mousemove","mouseout","mouseover","mouseup","mousewheel","pause","play","playing","progress","ratechange","readystatechange","reset","seeked","seeking","select","show","stalled","submit","suspend","timeupdate","volumechange","waiting","blur","error","focus","load","scroll"];bP.forEach(function($){Object.defineProperty(f8.prototype,"on"+$,{get:function(){return this._getEventHandler($)},set:function(J){this._setEventHandler($,J)}})});function zj($,J){if($&&$.isHTML){for(var Z=$.firstChild;Z!==null;Z=Z.nextSibling)if(Z.nodeType===L0.ELEMENT_NODE&&Z.localName===J&&Z.namespaceURI===pJ.HTML)return Z}return null}function vP($){if($._nid=$.ownerDocument._nextnid++,$.ownerDocument._nodes[$._nid]=$,$.nodeType===L0.ELEMENT_NODE){var J=$.getAttribute("id");if(J)$.ownerDocument.addId(J,$);if($._roothook)$._roothook()}}function hP($){if($.nodeType===L0.ELEMENT_NODE){var J=$.getAttribute("id");if(J)$.ownerDocument.delId(J,$)}$.ownerDocument._nodes[$._nid]=void 0,$._nid=void 0}function Cj($){if(vP($),$.nodeType===L0.ELEMENT_NODE)for(var J=$.firstChild;J!==null;J=J.nextSibling)Cj(J)}function Dj($){hP($);for(var J=$.firstChild;J!==null;J=J.nextSibling)Dj(J)}function Pj($,J){if($.ownerDocument=J,$._lastModTime=void 0,Object.prototype.hasOwnProperty.call($,"_tagName"))$._tagName=void 0;for(var Z=$.firstChild;Z!==null;Z=Z.nextSibling)Pj(Z,J)}function s1($){this.nodes=Object.create(null),this.nodes[$._nid]=$,this.length=1,this.firstNode=void 0}s1.prototype.add=function($){if(!this.nodes[$._nid])this.nodes[$._nid]=$,this.length++,this.firstNode=void 0};s1.prototype.del=function($){if(this.nodes[$._nid])delete this.nodes[$._nid],this.length--,this.firstNode=void 0};s1.prototype.getFirst=function(){if(!this.firstNode){var $;for($ in this.nodes)if(this.firstNode===void 0||this.firstNode.compareDocumentPosition(this.nodes[$])&L0.DOCUMENT_POSITION_PRECEDING)this.firstNode=this.nodes[$]}return this.firstNode};s1.prototype.downgrade=function(){if(this.length===1){var $;for($ in this.nodes)return this.nodes[$]}return this}});var K6=p((Ov,Sj)=>{Sj.exports=Y6;var gP=P0(),Aj=TY(),fP=oZ();function Y6($,J,Z,Y){Aj.call(this),this.nodeType=gP.DOCUMENT_TYPE_NODE,this.ownerDocument=$||null,this.name=J,this.publicId=Z||"",this.systemId=Y||""}Y6.prototype=Object.create(Aj.prototype,{nodeName:{get:function(){return this.name}},nodeValue:{get:function(){return null},set:function(){}},clone:{value:function(){return new Y6(this.ownerDocument,this.name,this.publicId,this.systemId)}},isEqual:{value:function(J){return this.name===J.name&&this.publicId===J.publicId&&this.systemId===J.systemId}}});Object.defineProperties(Y6.prototype,fP)});var U6=p((qv,ij)=>{ij.exports=b$;var mP=Z6(),uP=K6(),Y3=P0(),G$=G0().NAMESPACE,mj=$6(),u$=mj.elements,t2=Function.prototype.apply.bind(Array.prototype.push),V6=-1,cJ=1,N0=2,N$=3,y1=4,dP=5,pP=[],cP=/^HTML$|^-\/\/W3O\/\/DTD W3 HTML Strict 3\.0\/\/EN\/\/$|^-\/W3C\/DTD HTML 4\.0 Transitional\/EN$|^\+\/\/Silmaril\/\/dtd html Pro v0r11 19970101\/\/|^-\/\/AdvaSoft Ltd\/\/DTD HTML 3\.0 asWedit \+ extensions\/\/|^-\/\/AS\/\/DTD HTML 3\.0 asWedit \+ extensions\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Level 1\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Level 2\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Strict Level 1\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Strict Level 2\/\/|^-\/\/IETF\/\/DTD HTML 2\.0 Strict\/\/|^-\/\/IETF\/\/DTD HTML 2\.0\/\/|^-\/\/IETF\/\/DTD HTML 2\.1E\/\/|^-\/\/IETF\/\/DTD HTML 3\.0\/\/|^-\/\/IETF\/\/DTD HTML 3\.2 Final\/\/|^-\/\/IETF\/\/DTD HTML 3\.2\/\/|^-\/\/IETF\/\/DTD HTML 3\/\/|^-\/\/IETF\/\/DTD HTML Level 0\/\/|^-\/\/IETF\/\/DTD HTML Level 1\/\/|^-\/\/IETF\/\/DTD HTML Level 2\/\/|^-\/\/IETF\/\/DTD HTML Level 3\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 0\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 1\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 2\/\/|^-\/\/IETF\/\/DTD HTML Strict Level 3\/\/|^-\/\/IETF\/\/DTD HTML Strict\/\/|^-\/\/IETF\/\/DTD HTML\/\/|^-\/\/Metrius\/\/DTD Metrius Presentational\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 2\.0 HTML Strict\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 2\.0 HTML\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 2\.0 Tables\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 3\.0 HTML Strict\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 3\.0 HTML\/\/|^-\/\/Microsoft\/\/DTD Internet Explorer 3\.0 Tables\/\/|^-\/\/Netscape Comm\. Corp\.\/\/DTD HTML\/\/|^-\/\/Netscape Comm\. Corp\.\/\/DTD Strict HTML\/\/|^-\/\/O'Reilly and Associates\/\/DTD HTML 2\.0\/\/|^-\/\/O'Reilly and Associates\/\/DTD HTML Extended 1\.0\/\/|^-\/\/O'Reilly and Associates\/\/DTD HTML Extended Relaxed 1\.0\/\/|^-\/\/SoftQuad Software\/\/DTD HoTMetaL PRO 6\.0::19990601::extensions to HTML 4\.0\/\/|^-\/\/SoftQuad\/\/DTD HoTMetaL PRO 4\.0::19971010::extensions to HTML 4\.0\/\/|^-\/\/Spyglass\/\/DTD HTML 2\.0 Extended\/\/|^-\/\/SQ\/\/DTD HTML 2\.0 HoTMetaL \+ extensions\/\/|^-\/\/Sun Microsystems Corp\.\/\/DTD HotJava HTML\/\/|^-\/\/Sun Microsystems Corp\.\/\/DTD HotJava Strict HTML\/\/|^-\/\/W3C\/\/DTD HTML 3 1995-03-24\/\/|^-\/\/W3C\/\/DTD HTML 3\.2 Draft\/\/|^-\/\/W3C\/\/DTD HTML 3\.2 Final\/\/|^-\/\/W3C\/\/DTD HTML 3\.2\/\/|^-\/\/W3C\/\/DTD HTML 3\.2S Draft\/\/|^-\/\/W3C\/\/DTD HTML 4\.0 Frameset\/\/|^-\/\/W3C\/\/DTD HTML 4\.0 Transitional\/\/|^-\/\/W3C\/\/DTD HTML Experimental 19960712\/\/|^-\/\/W3C\/\/DTD HTML Experimental 970421\/\/|^-\/\/W3C\/\/DTD W3 HTML\/\/|^-\/\/W3O\/\/DTD W3 HTML 3\.0\/\/|^-\/\/WebTechs\/\/DTD Mozilla HTML 2\.0\/\/|^-\/\/WebTechs\/\/DTD Mozilla HTML\/\//i,lP="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Rj=/^-\/\/W3C\/\/DTD HTML 4\.01 Frameset\/\/|^-\/\/W3C\/\/DTD HTML 4\.01 Transitional\/\//i,oP=/^-\/\/W3C\/\/DTD XHTML 1\.0 Frameset\/\/|^-\/\/W3C\/\/DTD XHTML 1\.0 Transitional\/\//i,$J=Object.create(null);$J[G$.HTML]={__proto__:null,address:!0,applet:!0,area:!0,article:!0,aside:!0,base:!0,basefont:!0,bgsound:!0,blockquote:!0,body:!0,br:!0,button:!0,caption:!0,center:!0,col:!0,colgroup:!0,dd:!0,details:!0,dir:!0,div:!0,dl:!0,dt:!0,embed:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,frame:!0,frameset:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,head:!0,header:!0,hgroup:!0,hr:!0,html:!0,iframe:!0,img:!0,input:!0,li:!0,link:!0,listing:!0,main:!0,marquee:!0,menu:!0,meta:!0,nav:!0,noembed:!0,noframes:!0,noscript:!0,object:!0,ol:!0,p:!0,param:!0,plaintext:!0,pre:!0,script:!0,section:!0,select:!0,source:!0,style:!0,summary:!0,table:!0,tbody:!0,td:!0,template:!0,textarea:!0,tfoot:!0,th:!0,thead:!0,title:!0,tr:!0,track:!0,ul:!0,wbr:!0,xmp:!0};$J[G$.SVG]={__proto__:null,foreignObject:!0,desc:!0,title:!0};$J[G$.MATHML]={__proto__:null,mi:!0,mo:!0,mn:!0,ms:!0,mtext:!0,"annotation-xml":!0};var Q3=Object.create(null);Q3[G$.HTML]={__proto__:null,address:!0,div:!0,p:!0};var uj=Object.create(null);uj[G$.HTML]={__proto__:null,dd:!0,dt:!0};var lJ=Object.create(null);lJ[G$.HTML]={__proto__:null,table:!0,thead:!0,tbody:!0,tfoot:!0,tr:!0};var dj=Object.create(null);dj[G$.HTML]={__proto__:null,dd:!0,dt:!0,li:!0,menuitem:!0,optgroup:!0,option:!0,p:!0,rb:!0,rp:!0,rt:!0,rtc:!0};var pj=Object.create(null);pj[G$.HTML]={__proto__:null,caption:!0,colgroup:!0,dd:!0,dt:!0,li:!0,optgroup:!0,option:!0,p:!0,rb:!0,rp:!0,rt:!0,rtc:!0,tbody:!0,td:!0,tfoot:!0,th:!0,thead:!0,tr:!0};var G6=Object.create(null);G6[G$.HTML]={__proto__:null,table:!0,template:!0,html:!0};var W6=Object.create(null);W6[G$.HTML]={__proto__:null,tbody:!0,tfoot:!0,thead:!0,template:!0,html:!0};var X3=Object.create(null);X3[G$.HTML]={__proto__:null,tr:!0,template:!0,html:!0};var cj=Object.create(null);cj[G$.HTML]={__proto__:null,button:!0,fieldset:!0,input:!0,keygen:!0,object:!0,output:!0,select:!0,textarea:!0,img:!0};var T1=Object.create(null);T1[G$.HTML]={__proto__:null,applet:!0,caption:!0,html:!0,table:!0,td:!0,th:!0,marquee:!0,object:!0,template:!0};T1[G$.MATHML]={__proto__:null,mi:!0,mo:!0,mn:!0,ms:!0,mtext:!0,"annotation-xml":!0};T1[G$.SVG]={__proto__:null,foreignObject:!0,desc:!0,title:!0};var j6=Object.create(T1);j6[G$.HTML]=Object.create(T1[G$.HTML]);j6[G$.HTML].ol=!0;j6[G$.HTML].ul=!0;var G3=Object.create(T1);G3[G$.HTML]=Object.create(T1[G$.HTML]);G3[G$.HTML].button=!0;var lj=Object.create(null);lj[G$.HTML]={__proto__:null,html:!0,table:!0,template:!0};var rP=Object.create(null);rP[G$.HTML]={__proto__:null,optgroup:!0,option:!0};var oj=Object.create(null);oj[G$.MATHML]={__proto__:null,mi:!0,mo:!0,mn:!0,ms:!0,mtext:!0};var rj=Object.create(null);rj[G$.SVG]={__proto__:null,foreignObject:!0,desc:!0,title:!0};var wj={__proto__:null,"xlink:actuate":G$.XLINK,"xlink:arcrole":G$.XLINK,"xlink:href":G$.XLINK,"xlink:role":G$.XLINK,"xlink:show":G$.XLINK,"xlink:title":G$.XLINK,"xlink:type":G$.XLINK,"xml:base":G$.XML,"xml:lang":G$.XML,"xml:space":G$.XML,xmlns:G$.XMLNS,"xmlns:xlink":G$.XMLNS},Lj={__proto__:null,attributename:"attributeName",attributetype:"attributeType",basefrequency:"baseFrequency",baseprofile:"baseProfile",calcmode:"calcMode",clippathunits:"clipPathUnits",diffuseconstant:"diffuseConstant",edgemode:"edgeMode",filterunits:"filterUnits",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",limitingconeangle:"limitingConeAngle",markerheight:"markerHeight",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textlength:"textLength",viewbox:"viewBox",viewtarget:"viewTarget",xchannelselector:"xChannelSelector",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan"},Nj={__proto__:null,altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient",textpath:"textPath"},yj={__proto__:null,0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},iP={__proto__:null,AElig:198,"AElig;":198,AMP:38,"AMP;":38,Aacute:193,"Aacute;":193,"Abreve;":258,Acirc:194,"Acirc;":194,"Acy;":1040,"Afr;":[55349,56580],Agrave:192,"Agrave;":192,"Alpha;":913,"Amacr;":256,"And;":10835,"Aogon;":260,"Aopf;":[55349,56632],"ApplyFunction;":8289,Aring:197,"Aring;":197,"Ascr;":[55349,56476],"Assign;":8788,Atilde:195,"Atilde;":195,Auml:196,"Auml;":196,"Backslash;":8726,"Barv;":10983,"Barwed;":8966,"Bcy;":1041,"Because;":8757,"Bernoullis;":8492,"Beta;":914,"Bfr;":[55349,56581],"Bopf;":[55349,56633],"Breve;":728,"Bscr;":8492,"Bumpeq;":8782,"CHcy;":1063,COPY:169,"COPY;":169,"Cacute;":262,"Cap;":8914,"CapitalDifferentialD;":8517,"Cayleys;":8493,"Ccaron;":268,Ccedil:199,"Ccedil;":199,"Ccirc;":264,"Cconint;":8752,"Cdot;":266,"Cedilla;":184,"CenterDot;":183,"Cfr;":8493,"Chi;":935,"CircleDot;":8857,"CircleMinus;":8854,"CirclePlus;":8853,"CircleTimes;":8855,"ClockwiseContourIntegral;":8754,"CloseCurlyDoubleQuote;":8221,"CloseCurlyQuote;":8217,"Colon;":8759,"Colone;":10868,"Congruent;":8801,"Conint;":8751,"ContourIntegral;":8750,"Copf;":8450,"Coproduct;":8720,"CounterClockwiseContourIntegral;":8755,"Cross;":10799,"Cscr;":[55349,56478],"Cup;":8915,"CupCap;":8781,"DD;":8517,"DDotrahd;":10513,"DJcy;":1026,"DScy;":1029,"DZcy;":1039,"Dagger;":8225,"Darr;":8609,"Dashv;":10980,"Dcaron;":270,"Dcy;":1044,"Del;":8711,"Delta;":916,"Dfr;":[55349,56583],"DiacriticalAcute;":180,"DiacriticalDot;":729,"DiacriticalDoubleAcute;":733,"DiacriticalGrave;":96,"DiacriticalTilde;":732,"Diamond;":8900,"DifferentialD;":8518,"Dopf;":[55349,56635],"Dot;":168,"DotDot;":8412,"DotEqual;":8784,"DoubleContourIntegral;":8751,"DoubleDot;":168,"DoubleDownArrow;":8659,"DoubleLeftArrow;":8656,"DoubleLeftRightArrow;":8660,"DoubleLeftTee;":10980,"DoubleLongLeftArrow;":10232,"DoubleLongLeftRightArrow;":10234,"DoubleLongRightArrow;":10233,"DoubleRightArrow;":8658,"DoubleRightTee;":8872,"DoubleUpArrow;":8657,"DoubleUpDownArrow;":8661,"DoubleVerticalBar;":8741,"DownArrow;":8595,"DownArrowBar;":10515,"DownArrowUpArrow;":8693,"DownBreve;":785,"DownLeftRightVector;":10576,"DownLeftTeeVector;":10590,"DownLeftVector;":8637,"DownLeftVectorBar;":10582,"DownRightTeeVector;":10591,"DownRightVector;":8641,"DownRightVectorBar;":10583,"DownTee;":8868,"DownTeeArrow;":8615,"Downarrow;":8659,"Dscr;":[55349,56479],"Dstrok;":272,"ENG;":330,ETH:208,"ETH;":208,Eacute:201,"Eacute;":201,"Ecaron;":282,Ecirc:202,"Ecirc;":202,"Ecy;":1069,"Edot;":278,"Efr;":[55349,56584],Egrave:200,"Egrave;":200,"Element;":8712,"Emacr;":274,"EmptySmallSquare;":9723,"EmptyVerySmallSquare;":9643,"Eogon;":280,"Eopf;":[55349,56636],"Epsilon;":917,"Equal;":10869,"EqualTilde;":8770,"Equilibrium;":8652,"Escr;":8496,"Esim;":10867,"Eta;":919,Euml:203,"Euml;":203,"Exists;":8707,"ExponentialE;":8519,"Fcy;":1060,"Ffr;":[55349,56585],"FilledSmallSquare;":9724,"FilledVerySmallSquare;":9642,"Fopf;":[55349,56637],"ForAll;":8704,"Fouriertrf;":8497,"Fscr;":8497,"GJcy;":1027,GT:62,"GT;":62,"Gamma;":915,"Gammad;":988,"Gbreve;":286,"Gcedil;":290,"Gcirc;":284,"Gcy;":1043,"Gdot;":288,"Gfr;":[55349,56586],"Gg;":8921,"Gopf;":[55349,56638],"GreaterEqual;":8805,"GreaterEqualLess;":8923,"GreaterFullEqual;":8807,"GreaterGreater;":10914,"GreaterLess;":8823,"GreaterSlantEqual;":10878,"GreaterTilde;":8819,"Gscr;":[55349,56482],"Gt;":8811,"HARDcy;":1066,"Hacek;":711,"Hat;":94,"Hcirc;":292,"Hfr;":8460,"HilbertSpace;":8459,"Hopf;":8461,"HorizontalLine;":9472,"Hscr;":8459,"Hstrok;":294,"HumpDownHump;":8782,"HumpEqual;":8783,"IEcy;":1045,"IJlig;":306,"IOcy;":1025,Iacute:205,"Iacute;":205,Icirc:206,"Icirc;":206,"Icy;":1048,"Idot;":304,"Ifr;":8465,Igrave:204,"Igrave;":204,"Im;":8465,"Imacr;":298,"ImaginaryI;":8520,"Implies;":8658,"Int;":8748,"Integral;":8747,"Intersection;":8898,"InvisibleComma;":8291,"InvisibleTimes;":8290,"Iogon;":302,"Iopf;":[55349,56640],"Iota;":921,"Iscr;":8464,"Itilde;":296,"Iukcy;":1030,Iuml:207,"Iuml;":207,"Jcirc;":308,"Jcy;":1049,"Jfr;":[55349,56589],"Jopf;":[55349,56641],"Jscr;":[55349,56485],"Jsercy;":1032,"Jukcy;":1028,"KHcy;":1061,"KJcy;":1036,"Kappa;":922,"Kcedil;":310,"Kcy;":1050,"Kfr;":[55349,56590],"Kopf;":[55349,56642],"Kscr;":[55349,56486],"LJcy;":1033,LT:60,"LT;":60,"Lacute;":313,"Lambda;":923,"Lang;":10218,"Laplacetrf;":8466,"Larr;":8606,"Lcaron;":317,"Lcedil;":315,"Lcy;":1051,"LeftAngleBracket;":10216,"LeftArrow;":8592,"LeftArrowBar;":8676,"LeftArrowRightArrow;":8646,"LeftCeiling;":8968,"LeftDoubleBracket;":10214,"LeftDownTeeVector;":10593,"LeftDownVector;":8643,"LeftDownVectorBar;":10585,"LeftFloor;":8970,"LeftRightArrow;":8596,"LeftRightVector;":10574,"LeftTee;":8867,"LeftTeeArrow;":8612,"LeftTeeVector;":10586,"LeftTriangle;":8882,"LeftTriangleBar;":10703,"LeftTriangleEqual;":8884,"LeftUpDownVector;":10577,"LeftUpTeeVector;":10592,"LeftUpVector;":8639,"LeftUpVectorBar;":10584,"LeftVector;":8636,"LeftVectorBar;":10578,"Leftarrow;":8656,"Leftrightarrow;":8660,"LessEqualGreater;":8922,"LessFullEqual;":8806,"LessGreater;":8822,"LessLess;":10913,"LessSlantEqual;":10877,"LessTilde;":8818,"Lfr;":[55349,56591],"Ll;":8920,"Lleftarrow;":8666,"Lmidot;":319,"LongLeftArrow;":10229,"LongLeftRightArrow;":10231,"LongRightArrow;":10230,"Longleftarrow;":10232,"Longleftrightarrow;":10234,"Longrightarrow;":10233,"Lopf;":[55349,56643],"LowerLeftArrow;":8601,"LowerRightArrow;":8600,"Lscr;":8466,"Lsh;":8624,"Lstrok;":321,"Lt;":8810,"Map;":10501,"Mcy;":1052,"MediumSpace;":8287,"Mellintrf;":8499,"Mfr;":[55349,56592],"MinusPlus;":8723,"Mopf;":[55349,56644],"Mscr;":8499,"Mu;":924,"NJcy;":1034,"Nacute;":323,"Ncaron;":327,"Ncedil;":325,"Ncy;":1053,"NegativeMediumSpace;":8203,"NegativeThickSpace;":8203,"NegativeThinSpace;":8203,"NegativeVeryThinSpace;":8203,"NestedGreaterGreater;":8811,"NestedLessLess;":8810,"NewLine;":10,"Nfr;":[55349,56593],"NoBreak;":8288,"NonBreakingSpace;":160,"Nopf;":8469,"Not;":10988,"NotCongruent;":8802,"NotCupCap;":8813,"NotDoubleVerticalBar;":8742,"NotElement;":8713,"NotEqual;":8800,"NotEqualTilde;":[8770,824],"NotExists;":8708,"NotGreater;":8815,"NotGreaterEqual;":8817,"NotGreaterFullEqual;":[8807,824],"NotGreaterGreater;":[8811,824],"NotGreaterLess;":8825,"NotGreaterSlantEqual;":[10878,824],"NotGreaterTilde;":8821,"NotHumpDownHump;":[8782,824],"NotHumpEqual;":[8783,824],"NotLeftTriangle;":8938,"NotLeftTriangleBar;":[10703,824],"NotLeftTriangleEqual;":8940,"NotLess;":8814,"NotLessEqual;":8816,"NotLessGreater;":8824,"NotLessLess;":[8810,824],"NotLessSlantEqual;":[10877,824],"NotLessTilde;":8820,"NotNestedGreaterGreater;":[10914,824],"NotNestedLessLess;":[10913,824],"NotPrecedes;":8832,"NotPrecedesEqual;":[10927,824],"NotPrecedesSlantEqual;":8928,"NotReverseElement;":8716,"NotRightTriangle;":8939,"NotRightTriangleBar;":[10704,824],"NotRightTriangleEqual;":8941,"NotSquareSubset;":[8847,824],"NotSquareSubsetEqual;":8930,"NotSquareSuperset;":[8848,824],"NotSquareSupersetEqual;":8931,"NotSubset;":[8834,8402],"NotSubsetEqual;":8840,"NotSucceeds;":8833,"NotSucceedsEqual;":[10928,824],"NotSucceedsSlantEqual;":8929,"NotSucceedsTilde;":[8831,824],"NotSuperset;":[8835,8402],"NotSupersetEqual;":8841,"NotTilde;":8769,"NotTildeEqual;":8772,"NotTildeFullEqual;":8775,"NotTildeTilde;":8777,"NotVerticalBar;":8740,"Nscr;":[55349,56489],Ntilde:209,"Ntilde;":209,"Nu;":925,"OElig;":338,Oacute:211,"Oacute;":211,Ocirc:212,"Ocirc;":212,"Ocy;":1054,"Odblac;":336,"Ofr;":[55349,56594],Ograve:210,"Ograve;":210,"Omacr;":332,"Omega;":937,"Omicron;":927,"Oopf;":[55349,56646],"OpenCurlyDoubleQuote;":8220,"OpenCurlyQuote;":8216,"Or;":10836,"Oscr;":[55349,56490],Oslash:216,"Oslash;":216,Otilde:213,"Otilde;":213,"Otimes;":10807,Ouml:214,"Ouml;":214,"OverBar;":8254,"OverBrace;":9182,"OverBracket;":9140,"OverParenthesis;":9180,"PartialD;":8706,"Pcy;":1055,"Pfr;":[55349,56595],"Phi;":934,"Pi;":928,"PlusMinus;":177,"Poincareplane;":8460,"Popf;":8473,"Pr;":10939,"Precedes;":8826,"PrecedesEqual;":10927,"PrecedesSlantEqual;":8828,"PrecedesTilde;":8830,"Prime;":8243,"Product;":8719,"Proportion;":8759,"Proportional;":8733,"Pscr;":[55349,56491],"Psi;":936,QUOT:34,"QUOT;":34,"Qfr;":[55349,56596],"Qopf;":8474,"Qscr;":[55349,56492],"RBarr;":10512,REG:174,"REG;":174,"Racute;":340,"Rang;":10219,"Rarr;":8608,"Rarrtl;":10518,"Rcaron;":344,"Rcedil;":342,"Rcy;":1056,"Re;":8476,"ReverseElement;":8715,"ReverseEquilibrium;":8651,"ReverseUpEquilibrium;":10607,"Rfr;":8476,"Rho;":929,"RightAngleBracket;":10217,"RightArrow;":8594,"RightArrowBar;":8677,"RightArrowLeftArrow;":8644,"RightCeiling;":8969,"RightDoubleBracket;":10215,"RightDownTeeVector;":10589,"RightDownVector;":8642,"RightDownVectorBar;":10581,"RightFloor;":8971,"RightTee;":8866,"RightTeeArrow;":8614,"RightTeeVector;":10587,"RightTriangle;":8883,"RightTriangleBar;":10704,"RightTriangleEqual;":8885,"RightUpDownVector;":10575,"RightUpTeeVector;":10588,"RightUpVector;":8638,"RightUpVectorBar;":10580,"RightVector;":8640,"RightVectorBar;":10579,"Rightarrow;":8658,"Ropf;":8477,"RoundImplies;":10608,"Rrightarrow;":8667,"Rscr;":8475,"Rsh;":8625,"RuleDelayed;":10740,"SHCHcy;":1065,"SHcy;":1064,"SOFTcy;":1068,"Sacute;":346,"Sc;":10940,"Scaron;":352,"Scedil;":350,"Scirc;":348,"Scy;":1057,"Sfr;":[55349,56598],"ShortDownArrow;":8595,"ShortLeftArrow;":8592,"ShortRightArrow;":8594,"ShortUpArrow;":8593,"Sigma;":931,"SmallCircle;":8728,"Sopf;":[55349,56650],"Sqrt;":8730,"Square;":9633,"SquareIntersection;":8851,"SquareSubset;":8847,"SquareSubsetEqual;":8849,"SquareSuperset;":8848,"SquareSupersetEqual;":8850,"SquareUnion;":8852,"Sscr;":[55349,56494],"Star;":8902,"Sub;":8912,"Subset;":8912,"SubsetEqual;":8838,"Succeeds;":8827,"SucceedsEqual;":10928,"SucceedsSlantEqual;":8829,"SucceedsTilde;":8831,"SuchThat;":8715,"Sum;":8721,"Sup;":8913,"Superset;":8835,"SupersetEqual;":8839,"Supset;":8913,THORN:222,"THORN;":222,"TRADE;":8482,"TSHcy;":1035,"TScy;":1062,"Tab;":9,"Tau;":932,"Tcaron;":356,"Tcedil;":354,"Tcy;":1058,"Tfr;":[55349,56599],"Therefore;":8756,"Theta;":920,"ThickSpace;":[8287,8202],"ThinSpace;":8201,"Tilde;":8764,"TildeEqual;":8771,"TildeFullEqual;":8773,"TildeTilde;":8776,"Topf;":[55349,56651],"TripleDot;":8411,"Tscr;":[55349,56495],"Tstrok;":358,Uacute:218,"Uacute;":218,"Uarr;":8607,"Uarrocir;":10569,"Ubrcy;":1038,"Ubreve;":364,Ucirc:219,"Ucirc;":219,"Ucy;":1059,"Udblac;":368,"Ufr;":[55349,56600],Ugrave:217,"Ugrave;":217,"Umacr;":362,"UnderBar;":95,"UnderBrace;":9183,"UnderBracket;":9141,"UnderParenthesis;":9181,"Union;":8899,"UnionPlus;":8846,"Uogon;":370,"Uopf;":[55349,56652],"UpArrow;":8593,"UpArrowBar;":10514,"UpArrowDownArrow;":8645,"UpDownArrow;":8597,"UpEquilibrium;":10606,"UpTee;":8869,"UpTeeArrow;":8613,"Uparrow;":8657,"Updownarrow;":8661,"UpperLeftArrow;":8598,"UpperRightArrow;":8599,"Upsi;":978,"Upsilon;":933,"Uring;":366,"Uscr;":[55349,56496],"Utilde;":360,Uuml:220,"Uuml;":220,"VDash;":8875,"Vbar;":10987,"Vcy;":1042,"Vdash;":8873,"Vdashl;":10982,"Vee;":8897,"Verbar;":8214,"Vert;":8214,"VerticalBar;":8739,"VerticalLine;":124,"VerticalSeparator;":10072,"VerticalTilde;":8768,"VeryThinSpace;":8202,"Vfr;":[55349,56601],"Vopf;":[55349,56653],"Vscr;":[55349,56497],"Vvdash;":8874,"Wcirc;":372,"Wedge;":8896,"Wfr;":[55349,56602],"Wopf;":[55349,56654],"Wscr;":[55349,56498],"Xfr;":[55349,56603],"Xi;":926,"Xopf;":[55349,56655],"Xscr;":[55349,56499],"YAcy;":1071,"YIcy;":1031,"YUcy;":1070,Yacute:221,"Yacute;":221,"Ycirc;":374,"Ycy;":1067,"Yfr;":[55349,56604],"Yopf;":[55349,56656],"Yscr;":[55349,56500],"Yuml;":376,"ZHcy;":1046,"Zacute;":377,"Zcaron;":381,"Zcy;":1047,"Zdot;":379,"ZeroWidthSpace;":8203,"Zeta;":918,"Zfr;":8488,"Zopf;":8484,"Zscr;":[55349,56501],aacute:225,"aacute;":225,"abreve;":259,"ac;":8766,"acE;":[8766,819],"acd;":8767,acirc:226,"acirc;":226,acute:180,"acute;":180,"acy;":1072,aelig:230,"aelig;":230,"af;":8289,"afr;":[55349,56606],agrave:224,"agrave;":224,"alefsym;":8501,"aleph;":8501,"alpha;":945,"amacr;":257,"amalg;":10815,amp:38,"amp;":38,"and;":8743,"andand;":10837,"andd;":10844,"andslope;":10840,"andv;":10842,"ang;":8736,"ange;":10660,"angle;":8736,"angmsd;":8737,"angmsdaa;":10664,"angmsdab;":10665,"angmsdac;":10666,"angmsdad;":10667,"angmsdae;":10668,"angmsdaf;":10669,"angmsdag;":10670,"angmsdah;":10671,"angrt;":8735,"angrtvb;":8894,"angrtvbd;":10653,"angsph;":8738,"angst;":197,"angzarr;":9084,"aogon;":261,"aopf;":[55349,56658],"ap;":8776,"apE;":10864,"apacir;":10863,"ape;":8778,"apid;":8779,"apos;":39,"approx;":8776,"approxeq;":8778,aring:229,"aring;":229,"ascr;":[55349,56502],"ast;":42,"asymp;":8776,"asympeq;":8781,atilde:227,"atilde;":227,auml:228,"auml;":228,"awconint;":8755,"awint;":10769,"bNot;":10989,"backcong;":8780,"backepsilon;":1014,"backprime;":8245,"backsim;":8765,"backsimeq;":8909,"barvee;":8893,"barwed;":8965,"barwedge;":8965,"bbrk;":9141,"bbrktbrk;":9142,"bcong;":8780,"bcy;":1073,"bdquo;":8222,"becaus;":8757,"because;":8757,"bemptyv;":10672,"bepsi;":1014,"bernou;":8492,"beta;":946,"beth;":8502,"between;":8812,"bfr;":[55349,56607],"bigcap;":8898,"bigcirc;":9711,"bigcup;":8899,"bigodot;":10752,"bigoplus;":10753,"bigotimes;":10754,"bigsqcup;":10758,"bigstar;":9733,"bigtriangledown;":9661,"bigtriangleup;":9651,"biguplus;":10756,"bigvee;":8897,"bigwedge;":8896,"bkarow;":10509,"blacklozenge;":10731,"blacksquare;":9642,"blacktriangle;":9652,"blacktriangledown;":9662,"blacktriangleleft;":9666,"blacktriangleright;":9656,"blank;":9251,"blk12;":9618,"blk14;":9617,"blk34;":9619,"block;":9608,"bne;":[61,8421],"bnequiv;":[8801,8421],"bnot;":8976,"bopf;":[55349,56659],"bot;":8869,"bottom;":8869,"bowtie;":8904,"boxDL;":9559,"boxDR;":9556,"boxDl;":9558,"boxDr;":9555,"boxH;":9552,"boxHD;":9574,"boxHU;":9577,"boxHd;":9572,"boxHu;":9575,"boxUL;":9565,"boxUR;":9562,"boxUl;":9564,"boxUr;":9561,"boxV;":9553,"boxVH;":9580,"boxVL;":9571,"boxVR;":9568,"boxVh;":9579,"boxVl;":9570,"boxVr;":9567,"boxbox;":10697,"boxdL;":9557,"boxdR;":9554,"boxdl;":9488,"boxdr;":9484,"boxh;":9472,"boxhD;":9573,"boxhU;":9576,"boxhd;":9516,"boxhu;":9524,"boxminus;":8863,"boxplus;":8862,"boxtimes;":8864,"boxuL;":9563,"boxuR;":9560,"boxul;":9496,"boxur;":9492,"boxv;":9474,"boxvH;":9578,"boxvL;":9569,"boxvR;":9566,"boxvh;":9532,"boxvl;":9508,"boxvr;":9500,"bprime;":8245,"breve;":728,brvbar:166,"brvbar;":166,"bscr;":[55349,56503],"bsemi;":8271,"bsim;":8765,"bsime;":8909,"bsol;":92,"bsolb;":10693,"bsolhsub;":10184,"bull;":8226,"bullet;":8226,"bump;":8782,"bumpE;":10926,"bumpe;":8783,"bumpeq;":8783,"cacute;":263,"cap;":8745,"capand;":10820,"capbrcup;":10825,"capcap;":10827,"capcup;":10823,"capdot;":10816,"caps;":[8745,65024],"caret;":8257,"caron;":711,"ccaps;":10829,"ccaron;":269,ccedil:231,"ccedil;":231,"ccirc;":265,"ccups;":10828,"ccupssm;":10832,"cdot;":267,cedil:184,"cedil;":184,"cemptyv;":10674,cent:162,"cent;":162,"centerdot;":183,"cfr;":[55349,56608],"chcy;":1095,"check;":10003,"checkmark;":10003,"chi;":967,"cir;":9675,"cirE;":10691,"circ;":710,"circeq;":8791,"circlearrowleft;":8634,"circlearrowright;":8635,"circledR;":174,"circledS;":9416,"circledast;":8859,"circledcirc;":8858,"circleddash;":8861,"cire;":8791,"cirfnint;":10768,"cirmid;":10991,"cirscir;":10690,"clubs;":9827,"clubsuit;":9827,"colon;":58,"colone;":8788,"coloneq;":8788,"comma;":44,"commat;":64,"comp;":8705,"compfn;":8728,"complement;":8705,"complexes;":8450,"cong;":8773,"congdot;":10861,"conint;":8750,"copf;":[55349,56660],"coprod;":8720,copy:169,"copy;":169,"copysr;":8471,"crarr;":8629,"cross;":10007,"cscr;":[55349,56504],"csub;":10959,"csube;":10961,"csup;":10960,"csupe;":10962,"ctdot;":8943,"cudarrl;":10552,"cudarrr;":10549,"cuepr;":8926,"cuesc;":8927,"cularr;":8630,"cularrp;":10557,"cup;":8746,"cupbrcap;":10824,"cupcap;":10822,"cupcup;":10826,"cupdot;":8845,"cupor;":10821,"cups;":[8746,65024],"curarr;":8631,"curarrm;":10556,"curlyeqprec;":8926,"curlyeqsucc;":8927,"curlyvee;":8910,"curlywedge;":8911,curren:164,"curren;":164,"curvearrowleft;":8630,"curvearrowright;":8631,"cuvee;":8910,"cuwed;":8911,"cwconint;":8754,"cwint;":8753,"cylcty;":9005,"dArr;":8659,"dHar;":10597,"dagger;":8224,"daleth;":8504,"darr;":8595,"dash;":8208,"dashv;":8867,"dbkarow;":10511,"dblac;":733,"dcaron;":271,"dcy;":1076,"dd;":8518,"ddagger;":8225,"ddarr;":8650,"ddotseq;":10871,deg:176,"deg;":176,"delta;":948,"demptyv;":10673,"dfisht;":10623,"dfr;":[55349,56609],"dharl;":8643,"dharr;":8642,"diam;":8900,"diamond;":8900,"diamondsuit;":9830,"diams;":9830,"die;":168,"digamma;":989,"disin;":8946,"div;":247,divide:247,"divide;":247,"divideontimes;":8903,"divonx;":8903,"djcy;":1106,"dlcorn;":8990,"dlcrop;":8973,"dollar;":36,"dopf;":[55349,56661],"dot;":729,"doteq;":8784,"doteqdot;":8785,"dotminus;":8760,"dotplus;":8724,"dotsquare;":8865,"doublebarwedge;":8966,"downarrow;":8595,"downdownarrows;":8650,"downharpoonleft;":8643,"downharpoonright;":8642,"drbkarow;":10512,"drcorn;":8991,"drcrop;":8972,"dscr;":[55349,56505],"dscy;":1109,"dsol;":10742,"dstrok;":273,"dtdot;":8945,"dtri;":9663,"dtrif;":9662,"duarr;":8693,"duhar;":10607,"dwangle;":10662,"dzcy;":1119,"dzigrarr;":10239,"eDDot;":10871,"eDot;":8785,eacute:233,"eacute;":233,"easter;":10862,"ecaron;":283,"ecir;":8790,ecirc:234,"ecirc;":234,"ecolon;":8789,"ecy;":1101,"edot;":279,"ee;":8519,"efDot;":8786,"efr;":[55349,56610],"eg;":10906,egrave:232,"egrave;":232,"egs;":10902,"egsdot;":10904,"el;":10905,"elinters;":9191,"ell;":8467,"els;":10901,"elsdot;":10903,"emacr;":275,"empty;":8709,"emptyset;":8709,"emptyv;":8709,"emsp13;":8196,"emsp14;":8197,"emsp;":8195,"eng;":331,"ensp;":8194,"eogon;":281,"eopf;":[55349,56662],"epar;":8917,"eparsl;":10723,"eplus;":10865,"epsi;":949,"epsilon;":949,"epsiv;":1013,"eqcirc;":8790,"eqcolon;":8789,"eqsim;":8770,"eqslantgtr;":10902,"eqslantless;":10901,"equals;":61,"equest;":8799,"equiv;":8801,"equivDD;":10872,"eqvparsl;":10725,"erDot;":8787,"erarr;":10609,"escr;":8495,"esdot;":8784,"esim;":8770,"eta;":951,eth:240,"eth;":240,euml:235,"euml;":235,"euro;":8364,"excl;":33,"exist;":8707,"expectation;":8496,"exponentiale;":8519,"fallingdotseq;":8786,"fcy;":1092,"female;":9792,"ffilig;":64259,"fflig;":64256,"ffllig;":64260,"ffr;":[55349,56611],"filig;":64257,"fjlig;":[102,106],"flat;":9837,"fllig;":64258,"fltns;":9649,"fnof;":402,"fopf;":[55349,56663],"forall;":8704,"fork;":8916,"forkv;":10969,"fpartint;":10765,frac12:189,"frac12;":189,"frac13;":8531,frac14:188,"frac14;":188,"frac15;":8533,"frac16;":8537,"frac18;":8539,"frac23;":8532,"frac25;":8534,frac34:190,"frac34;":190,"frac35;":8535,"frac38;":8540,"frac45;":8536,"frac56;":8538,"frac58;":8541,"frac78;":8542,"frasl;":8260,"frown;":8994,"fscr;":[55349,56507],"gE;":8807,"gEl;":10892,"gacute;":501,"gamma;":947,"gammad;":989,"gap;":10886,"gbreve;":287,"gcirc;":285,"gcy;":1075,"gdot;":289,"ge;":8805,"gel;":8923,"geq;":8805,"geqq;":8807,"geqslant;":10878,"ges;":10878,"gescc;":10921,"gesdot;":10880,"gesdoto;":10882,"gesdotol;":10884,"gesl;":[8923,65024],"gesles;":10900,"gfr;":[55349,56612],"gg;":8811,"ggg;":8921,"gimel;":8503,"gjcy;":1107,"gl;":8823,"glE;":10898,"gla;":10917,"glj;":10916,"gnE;":8809,"gnap;":10890,"gnapprox;":10890,"gne;":10888,"gneq;":10888,"gneqq;":8809,"gnsim;":8935,"gopf;":[55349,56664],"grave;":96,"gscr;":8458,"gsim;":8819,"gsime;":10894,"gsiml;":10896,gt:62,"gt;":62,"gtcc;":10919,"gtcir;":10874,"gtdot;":8919,"gtlPar;":10645,"gtquest;":10876,"gtrapprox;":10886,"gtrarr;":10616,"gtrdot;":8919,"gtreqless;":8923,"gtreqqless;":10892,"gtrless;":8823,"gtrsim;":8819,"gvertneqq;":[8809,65024],"gvnE;":[8809,65024],"hArr;":8660,"hairsp;":8202,"half;":189,"hamilt;":8459,"hardcy;":1098,"harr;":8596,"harrcir;":10568,"harrw;":8621,"hbar;":8463,"hcirc;":293,"hearts;":9829,"heartsuit;":9829,"hellip;":8230,"hercon;":8889,"hfr;":[55349,56613],"hksearow;":10533,"hkswarow;":10534,"hoarr;":8703,"homtht;":8763,"hookleftarrow;":8617,"hookrightarrow;":8618,"hopf;":[55349,56665],"horbar;":8213,"hscr;":[55349,56509],"hslash;":8463,"hstrok;":295,"hybull;":8259,"hyphen;":8208,iacute:237,"iacute;":237,"ic;":8291,icirc:238,"icirc;":238,"icy;":1080,"iecy;":1077,iexcl:161,"iexcl;":161,"iff;":8660,"ifr;":[55349,56614],igrave:236,"igrave;":236,"ii;":8520,"iiiint;":10764,"iiint;":8749,"iinfin;":10716,"iiota;":8489,"ijlig;":307,"imacr;":299,"image;":8465,"imagline;":8464,"imagpart;":8465,"imath;":305,"imof;":8887,"imped;":437,"in;":8712,"incare;":8453,"infin;":8734,"infintie;":10717,"inodot;":305,"int;":8747,"intcal;":8890,"integers;":8484,"intercal;":8890,"intlarhk;":10775,"intprod;":10812,"iocy;":1105,"iogon;":303,"iopf;":[55349,56666],"iota;":953,"iprod;":10812,iquest:191,"iquest;":191,"iscr;":[55349,56510],"isin;":8712,"isinE;":8953,"isindot;":8949,"isins;":8948,"isinsv;":8947,"isinv;":8712,"it;":8290,"itilde;":297,"iukcy;":1110,iuml:239,"iuml;":239,"jcirc;":309,"jcy;":1081,"jfr;":[55349,56615],"jmath;":567,"jopf;":[55349,56667],"jscr;":[55349,56511],"jsercy;":1112,"jukcy;":1108,"kappa;":954,"kappav;":1008,"kcedil;":311,"kcy;":1082,"kfr;":[55349,56616],"kgreen;":312,"khcy;":1093,"kjcy;":1116,"kopf;":[55349,56668],"kscr;":[55349,56512],"lAarr;":8666,"lArr;":8656,"lAtail;":10523,"lBarr;":10510,"lE;":8806,"lEg;":10891,"lHar;":10594,"lacute;":314,"laemptyv;":10676,"lagran;":8466,"lambda;":955,"lang;":10216,"langd;":10641,"langle;":10216,"lap;":10885,laquo:171,"laquo;":171,"larr;":8592,"larrb;":8676,"larrbfs;":10527,"larrfs;":10525,"larrhk;":8617,"larrlp;":8619,"larrpl;":10553,"larrsim;":10611,"larrtl;":8610,"lat;":10923,"latail;":10521,"late;":10925,"lates;":[10925,65024],"lbarr;":10508,"lbbrk;":10098,"lbrace;":123,"lbrack;":91,"lbrke;":10635,"lbrksld;":10639,"lbrkslu;":10637,"lcaron;":318,"lcedil;":316,"lceil;":8968,"lcub;":123,"lcy;":1083,"ldca;":10550,"ldquo;":8220,"ldquor;":8222,"ldrdhar;":10599,"ldrushar;":10571,"ldsh;":8626,"le;":8804,"leftarrow;":8592,"leftarrowtail;":8610,"leftharpoondown;":8637,"leftharpoonup;":8636,"leftleftarrows;":8647,"leftrightarrow;":8596,"leftrightarrows;":8646,"leftrightharpoons;":8651,"leftrightsquigarrow;":8621,"leftthreetimes;":8907,"leg;":8922,"leq;":8804,"leqq;":8806,"leqslant;":10877,"les;":10877,"lescc;":10920,"lesdot;":10879,"lesdoto;":10881,"lesdotor;":10883,"lesg;":[8922,65024],"lesges;":10899,"lessapprox;":10885,"lessdot;":8918,"lesseqgtr;":8922,"lesseqqgtr;":10891,"lessgtr;":8822,"lesssim;":8818,"lfisht;":10620,"lfloor;":8970,"lfr;":[55349,56617],"lg;":8822,"lgE;":10897,"lhard;":8637,"lharu;":8636,"lharul;":10602,"lhblk;":9604,"ljcy;":1113,"ll;":8810,"llarr;":8647,"llcorner;":8990,"llhard;":10603,"lltri;":9722,"lmidot;":320,"lmoust;":9136,"lmoustache;":9136,"lnE;":8808,"lnap;":10889,"lnapprox;":10889,"lne;":10887,"lneq;":10887,"lneqq;":8808,"lnsim;":8934,"loang;":10220,"loarr;":8701,"lobrk;":10214,"longleftarrow;":10229,"longleftrightarrow;":10231,"longmapsto;":10236,"longrightarrow;":10230,"looparrowleft;":8619,"looparrowright;":8620,"lopar;":10629,"lopf;":[55349,56669],"loplus;":10797,"lotimes;":10804,"lowast;":8727,"lowbar;":95,"loz;":9674,"lozenge;":9674,"lozf;":10731,"lpar;":40,"lparlt;":10643,"lrarr;":8646,"lrcorner;":8991,"lrhar;":8651,"lrhard;":10605,"lrm;":8206,"lrtri;":8895,"lsaquo;":8249,"lscr;":[55349,56513],"lsh;":8624,"lsim;":8818,"lsime;":10893,"lsimg;":10895,"lsqb;":91,"lsquo;":8216,"lsquor;":8218,"lstrok;":322,lt:60,"lt;":60,"ltcc;":10918,"ltcir;":10873,"ltdot;":8918,"lthree;":8907,"ltimes;":8905,"ltlarr;":10614,"ltquest;":10875,"ltrPar;":10646,"ltri;":9667,"ltrie;":8884,"ltrif;":9666,"lurdshar;":10570,"luruhar;":10598,"lvertneqq;":[8808,65024],"lvnE;":[8808,65024],"mDDot;":8762,macr:175,"macr;":175,"male;":9794,"malt;":10016,"maltese;":10016,"map;":8614,"mapsto;":8614,"mapstodown;":8615,"mapstoleft;":8612,"mapstoup;":8613,"marker;":9646,"mcomma;":10793,"mcy;":1084,"mdash;":8212,"measuredangle;":8737,"mfr;":[55349,56618],"mho;":8487,micro:181,"micro;":181,"mid;":8739,"midast;":42,"midcir;":10992,middot:183,"middot;":183,"minus;":8722,"minusb;":8863,"minusd;":8760,"minusdu;":10794,"mlcp;":10971,"mldr;":8230,"mnplus;":8723,"models;":8871,"mopf;":[55349,56670],"mp;":8723,"mscr;":[55349,56514],"mstpos;":8766,"mu;":956,"multimap;":8888,"mumap;":8888,"nGg;":[8921,824],"nGt;":[8811,8402],"nGtv;":[8811,824],"nLeftarrow;":8653,"nLeftrightarrow;":8654,"nLl;":[8920,824],"nLt;":[8810,8402],"nLtv;":[8810,824],"nRightarrow;":8655,"nVDash;":8879,"nVdash;":8878,"nabla;":8711,"nacute;":324,"nang;":[8736,8402],"nap;":8777,"napE;":[10864,824],"napid;":[8779,824],"napos;":329,"napprox;":8777,"natur;":9838,"natural;":9838,"naturals;":8469,nbsp:160,"nbsp;":160,"nbump;":[8782,824],"nbumpe;":[8783,824],"ncap;":10819,"ncaron;":328,"ncedil;":326,"ncong;":8775,"ncongdot;":[10861,824],"ncup;":10818,"ncy;":1085,"ndash;":8211,"ne;":8800,"neArr;":8663,"nearhk;":10532,"nearr;":8599,"nearrow;":8599,"nedot;":[8784,824],"nequiv;":8802,"nesear;":10536,"nesim;":[8770,824],"nexist;":8708,"nexists;":8708,"nfr;":[55349,56619],"ngE;":[8807,824],"nge;":8817,"ngeq;":8817,"ngeqq;":[8807,824],"ngeqslant;":[10878,824],"nges;":[10878,824],"ngsim;":8821,"ngt;":8815,"ngtr;":8815,"nhArr;":8654,"nharr;":8622,"nhpar;":10994,"ni;":8715,"nis;":8956,"nisd;":8954,"niv;":8715,"njcy;":1114,"nlArr;":8653,"nlE;":[8806,824],"nlarr;":8602,"nldr;":8229,"nle;":8816,"nleftarrow;":8602,"nleftrightarrow;":8622,"nleq;":8816,"nleqq;":[8806,824],"nleqslant;":[10877,824],"nles;":[10877,824],"nless;":8814,"nlsim;":8820,"nlt;":8814,"nltri;":8938,"nltrie;":8940,"nmid;":8740,"nopf;":[55349,56671],not:172,"not;":172,"notin;":8713,"notinE;":[8953,824],"notindot;":[8949,824],"notinva;":8713,"notinvb;":8951,"notinvc;":8950,"notni;":8716,"notniva;":8716,"notnivb;":8958,"notnivc;":8957,"npar;":8742,"nparallel;":8742,"nparsl;":[11005,8421],"npart;":[8706,824],"npolint;":10772,"npr;":8832,"nprcue;":8928,"npre;":[10927,824],"nprec;":8832,"npreceq;":[10927,824],"nrArr;":8655,"nrarr;":8603,"nrarrc;":[10547,824],"nrarrw;":[8605,824],"nrightarrow;":8603,"nrtri;":8939,"nrtrie;":8941,"nsc;":8833,"nsccue;":8929,"nsce;":[10928,824],"nscr;":[55349,56515],"nshortmid;":8740,"nshortparallel;":8742,"nsim;":8769,"nsime;":8772,"nsimeq;":8772,"nsmid;":8740,"nspar;":8742,"nsqsube;":8930,"nsqsupe;":8931,"nsub;":8836,"nsubE;":[10949,824],"nsube;":8840,"nsubset;":[8834,8402],"nsubseteq;":8840,"nsubseteqq;":[10949,824],"nsucc;":8833,"nsucceq;":[10928,824],"nsup;":8837,"nsupE;":[10950,824],"nsupe;":8841,"nsupset;":[8835,8402],"nsupseteq;":8841,"nsupseteqq;":[10950,824],"ntgl;":8825,ntilde:241,"ntilde;":241,"ntlg;":8824,"ntriangleleft;":8938,"ntrianglelefteq;":8940,"ntriangleright;":8939,"ntrianglerighteq;":8941,"nu;":957,"num;":35,"numero;":8470,"numsp;":8199,"nvDash;":8877,"nvHarr;":10500,"nvap;":[8781,8402],"nvdash;":8876,"nvge;":[8805,8402],"nvgt;":[62,8402],"nvinfin;":10718,"nvlArr;":10498,"nvle;":[8804,8402],"nvlt;":[60,8402],"nvltrie;":[8884,8402],"nvrArr;":10499,"nvrtrie;":[8885,8402],"nvsim;":[8764,8402],"nwArr;":8662,"nwarhk;":10531,"nwarr;":8598,"nwarrow;":8598,"nwnear;":10535,"oS;":9416,oacute:243,"oacute;":243,"oast;":8859,"ocir;":8858,ocirc:244,"ocirc;":244,"ocy;":1086,"odash;":8861,"odblac;":337,"odiv;":10808,"odot;":8857,"odsold;":10684,"oelig;":339,"ofcir;":10687,"ofr;":[55349,56620],"ogon;":731,ograve:242,"ograve;":242,"ogt;":10689,"ohbar;":10677,"ohm;":937,"oint;":8750,"olarr;":8634,"olcir;":10686,"olcross;":10683,"oline;":8254,"olt;":10688,"omacr;":333,"omega;":969,"omicron;":959,"omid;":10678,"ominus;":8854,"oopf;":[55349,56672],"opar;":10679,"operp;":10681,"oplus;":8853,"or;":8744,"orarr;":8635,"ord;":10845,"order;":8500,"orderof;":8500,ordf:170,"ordf;":170,ordm:186,"ordm;":186,"origof;":8886,"oror;":10838,"orslope;":10839,"orv;":10843,"oscr;":8500,oslash:248,"oslash;":248,"osol;":8856,otilde:245,"otilde;":245,"otimes;":8855,"otimesas;":10806,ouml:246,"ouml;":246,"ovbar;":9021,"par;":8741,para:182,"para;":182,"parallel;":8741,"parsim;":10995,"parsl;":11005,"part;":8706,"pcy;":1087,"percnt;":37,"period;":46,"permil;":8240,"perp;":8869,"pertenk;":8241,"pfr;":[55349,56621],"phi;":966,"phiv;":981,"phmmat;":8499,"phone;":9742,"pi;":960,"pitchfork;":8916,"piv;":982,"planck;":8463,"planckh;":8462,"plankv;":8463,"plus;":43,"plusacir;":10787,"plusb;":8862,"pluscir;":10786,"plusdo;":8724,"plusdu;":10789,"pluse;":10866,plusmn:177,"plusmn;":177,"plussim;":10790,"plustwo;":10791,"pm;":177,"pointint;":10773,"popf;":[55349,56673],pound:163,"pound;":163,"pr;":8826,"prE;":10931,"prap;":10935,"prcue;":8828,"pre;":10927,"prec;":8826,"precapprox;":10935,"preccurlyeq;":8828,"preceq;":10927,"precnapprox;":10937,"precneqq;":10933,"precnsim;":8936,"precsim;":8830,"prime;":8242,"primes;":8473,"prnE;":10933,"prnap;":10937,"prnsim;":8936,"prod;":8719,"profalar;":9006,"profline;":8978,"profsurf;":8979,"prop;":8733,"propto;":8733,"prsim;":8830,"prurel;":8880,"pscr;":[55349,56517],"psi;":968,"puncsp;":8200,"qfr;":[55349,56622],"qint;":10764,"qopf;":[55349,56674],"qprime;":8279,"qscr;":[55349,56518],"quaternions;":8461,"quatint;":10774,"quest;":63,"questeq;":8799,quot:34,"quot;":34,"rAarr;":8667,"rArr;":8658,"rAtail;":10524,"rBarr;":10511,"rHar;":10596,"race;":[8765,817],"racute;":341,"radic;":8730,"raemptyv;":10675,"rang;":10217,"rangd;":10642,"range;":10661,"rangle;":10217,raquo:187,"raquo;":187,"rarr;":8594,"rarrap;":10613,"rarrb;":8677,"rarrbfs;":10528,"rarrc;":10547,"rarrfs;":10526,"rarrhk;":8618,"rarrlp;":8620,"rarrpl;":10565,"rarrsim;":10612,"rarrtl;":8611,"rarrw;":8605,"ratail;":10522,"ratio;":8758,"rationals;":8474,"rbarr;":10509,"rbbrk;":10099,"rbrace;":125,"rbrack;":93,"rbrke;":10636,"rbrksld;":10638,"rbrkslu;":10640,"rcaron;":345,"rcedil;":343,"rceil;":8969,"rcub;":125,"rcy;":1088,"rdca;":10551,"rdldhar;":10601,"rdquo;":8221,"rdquor;":8221,"rdsh;":8627,"real;":8476,"realine;":8475,"realpart;":8476,"reals;":8477,"rect;":9645,reg:174,"reg;":174,"rfisht;":10621,"rfloor;":8971,"rfr;":[55349,56623],"rhard;":8641,"rharu;":8640,"rharul;":10604,"rho;":961,"rhov;":1009,"rightarrow;":8594,"rightarrowtail;":8611,"rightharpoondown;":8641,"rightharpoonup;":8640,"rightleftarrows;":8644,"rightleftharpoons;":8652,"rightrightarrows;":8649,"rightsquigarrow;":8605,"rightthreetimes;":8908,"ring;":730,"risingdotseq;":8787,"rlarr;":8644,"rlhar;":8652,"rlm;":8207,"rmoust;":9137,"rmoustache;":9137,"rnmid;":10990,"roang;":10221,"roarr;":8702,"robrk;":10215,"ropar;":10630,"ropf;":[55349,56675],"roplus;":10798,"rotimes;":10805,"rpar;":41,"rpargt;":10644,"rppolint;":10770,"rrarr;":8649,"rsaquo;":8250,"rscr;":[55349,56519],"rsh;":8625,"rsqb;":93,"rsquo;":8217,"rsquor;":8217,"rthree;":8908,"rtimes;":8906,"rtri;":9657,"rtrie;":8885,"rtrif;":9656,"rtriltri;":10702,"ruluhar;":10600,"rx;":8478,"sacute;":347,"sbquo;":8218,"sc;":8827,"scE;":10932,"scap;":10936,"scaron;":353,"sccue;":8829,"sce;":10928,"scedil;":351,"scirc;":349,"scnE;":10934,"scnap;":10938,"scnsim;":8937,"scpolint;":10771,"scsim;":8831,"scy;":1089,"sdot;":8901,"sdotb;":8865,"sdote;":10854,"seArr;":8664,"searhk;":10533,"searr;":8600,"searrow;":8600,sect:167,"sect;":167,"semi;":59,"seswar;":10537,"setminus;":8726,"setmn;":8726,"sext;":10038,"sfr;":[55349,56624],"sfrown;":8994,"sharp;":9839,"shchcy;":1097,"shcy;":1096,"shortmid;":8739,"shortparallel;":8741,shy:173,"shy;":173,"sigma;":963,"sigmaf;":962,"sigmav;":962,"sim;":8764,"simdot;":10858,"sime;":8771,"simeq;":8771,"simg;":10910,"simgE;":10912,"siml;":10909,"simlE;":10911,"simne;":8774,"simplus;":10788,"simrarr;":10610,"slarr;":8592,"smallsetminus;":8726,"smashp;":10803,"smeparsl;":10724,"smid;":8739,"smile;":8995,"smt;":10922,"smte;":10924,"smtes;":[10924,65024],"softcy;":1100,"sol;":47,"solb;":10692,"solbar;":9023,"sopf;":[55349,56676],"spades;":9824,"spadesuit;":9824,"spar;":8741,"sqcap;":8851,"sqcaps;":[8851,65024],"sqcup;":8852,"sqcups;":[8852,65024],"sqsub;":8847,"sqsube;":8849,"sqsubset;":8847,"sqsubseteq;":8849,"sqsup;":8848,"sqsupe;":8850,"sqsupset;":8848,"sqsupseteq;":8850,"squ;":9633,"square;":9633,"squarf;":9642,"squf;":9642,"srarr;":8594,"sscr;":[55349,56520],"ssetmn;":8726,"ssmile;":8995,"sstarf;":8902,"star;":9734,"starf;":9733,"straightepsilon;":1013,"straightphi;":981,"strns;":175,"sub;":8834,"subE;":10949,"subdot;":10941,"sube;":8838,"subedot;":10947,"submult;":10945,"subnE;":10955,"subne;":8842,"subplus;":10943,"subrarr;":10617,"subset;":8834,"subseteq;":8838,"subseteqq;":10949,"subsetneq;":8842,"subsetneqq;":10955,"subsim;":10951,"subsub;":10965,"subsup;":10963,"succ;":8827,"succapprox;":10936,"succcurlyeq;":8829,"succeq;":10928,"succnapprox;":10938,"succneqq;":10934,"succnsim;":8937,"succsim;":8831,"sum;":8721,"sung;":9834,sup1:185,"sup1;":185,sup2:178,"sup2;":178,sup3:179,"sup3;":179,"sup;":8835,"supE;":10950,"supdot;":10942,"supdsub;":10968,"supe;":8839,"supedot;":10948,"suphsol;":10185,"suphsub;":10967,"suplarr;":10619,"supmult;":10946,"supnE;":10956,"supne;":8843,"supplus;":10944,"supset;":8835,"supseteq;":8839,"supseteqq;":10950,"supsetneq;":8843,"supsetneqq;":10956,"supsim;":10952,"supsub;":10964,"supsup;":10966,"swArr;":8665,"swarhk;":10534,"swarr;":8601,"swarrow;":8601,"swnwar;":10538,szlig:223,"szlig;":223,"target;":8982,"tau;":964,"tbrk;":9140,"tcaron;":357,"tcedil;":355,"tcy;":1090,"tdot;":8411,"telrec;":8981,"tfr;":[55349,56625],"there4;":8756,"therefore;":8756,"theta;":952,"thetasym;":977,"thetav;":977,"thickapprox;":8776,"thicksim;":8764,"thinsp;":8201,"thkap;":8776,"thksim;":8764,thorn:254,"thorn;":254,"tilde;":732,times:215,"times;":215,"timesb;":8864,"timesbar;":10801,"timesd;":10800,"tint;":8749,"toea;":10536,"top;":8868,"topbot;":9014,"topcir;":10993,"topf;":[55349,56677],"topfork;":10970,"tosa;":10537,"tprime;":8244,"trade;":8482,"triangle;":9653,"triangledown;":9663,"triangleleft;":9667,"trianglelefteq;":8884,"triangleq;":8796,"triangleright;":9657,"trianglerighteq;":8885,"tridot;":9708,"trie;":8796,"triminus;":10810,"triplus;":10809,"trisb;":10701,"tritime;":10811,"trpezium;":9186,"tscr;":[55349,56521],"tscy;":1094,"tshcy;":1115,"tstrok;":359,"twixt;":8812,"twoheadleftarrow;":8606,"twoheadrightarrow;":8608,"uArr;":8657,"uHar;":10595,uacute:250,"uacute;":250,"uarr;":8593,"ubrcy;":1118,"ubreve;":365,ucirc:251,"ucirc;":251,"ucy;":1091,"udarr;":8645,"udblac;":369,"udhar;":10606,"ufisht;":10622,"ufr;":[55349,56626],ugrave:249,"ugrave;":249,"uharl;":8639,"uharr;":8638,"uhblk;":9600,"ulcorn;":8988,"ulcorner;":8988,"ulcrop;":8975,"ultri;":9720,"umacr;":363,uml:168,"uml;":168,"uogon;":371,"uopf;":[55349,56678],"uparrow;":8593,"updownarrow;":8597,"upharpoonleft;":8639,"upharpoonright;":8638,"uplus;":8846,"upsi;":965,"upsih;":978,"upsilon;":965,"upuparrows;":8648,"urcorn;":8989,"urcorner;":8989,"urcrop;":8974,"uring;":367,"urtri;":9721,"uscr;":[55349,56522],"utdot;":8944,"utilde;":361,"utri;":9653,"utrif;":9652,"uuarr;":8648,uuml:252,"uuml;":252,"uwangle;":10663,"vArr;":8661,"vBar;":10984,"vBarv;":10985,"vDash;":8872,"vangrt;":10652,"varepsilon;":1013,"varkappa;":1008,"varnothing;":8709,"varphi;":981,"varpi;":982,"varpropto;":8733,"varr;":8597,"varrho;":1009,"varsigma;":962,"varsubsetneq;":[8842,65024],"varsubsetneqq;":[10955,65024],"varsupsetneq;":[8843,65024],"varsupsetneqq;":[10956,65024],"vartheta;":977,"vartriangleleft;":8882,"vartriangleright;":8883,"vcy;":1074,"vdash;":8866,"vee;":8744,"veebar;":8891,"veeeq;":8794,"vellip;":8942,"verbar;":124,"vert;":124,"vfr;":[55349,56627],"vltri;":8882,"vnsub;":[8834,8402],"vnsup;":[8835,8402],"vopf;":[55349,56679],"vprop;":8733,"vrtri;":8883,"vscr;":[55349,56523],"vsubnE;":[10955,65024],"vsubne;":[8842,65024],"vsupnE;":[10956,65024],"vsupne;":[8843,65024],"vzigzag;":10650,"wcirc;":373,"wedbar;":10847,"wedge;":8743,"wedgeq;":8793,"weierp;":8472,"wfr;":[55349,56628],"wopf;":[55349,56680],"wp;":8472,"wr;":8768,"wreath;":8768,"wscr;":[55349,56524],"xcap;":8898,"xcirc;":9711,"xcup;":8899,"xdtri;":9661,"xfr;":[55349,56629],"xhArr;":10234,"xharr;":10231,"xi;":958,"xlArr;":10232,"xlarr;":10229,"xmap;":10236,"xnis;":8955,"xodot;":10752,"xopf;":[55349,56681],"xoplus;":10753,"xotime;":10754,"xrArr;":10233,"xrarr;":10230,"xscr;":[55349,56525],"xsqcup;":10758,"xuplus;":10756,"xutri;":9651,"xvee;":8897,"xwedge;":8896,yacute:253,"yacute;":253,"yacy;":1103,"ycirc;":375,"ycy;":1099,yen:165,"yen;":165,"yfr;":[55349,56630],"yicy;":1111,"yopf;":[55349,56682],"yscr;":[55349,56526],"yucy;":1102,yuml:255,"yuml;":255,"zacute;":378,"zcaron;":382,"zcy;":1079,"zdot;":380,"zeetrf;":8488,"zeta;":950,"zfr;":[55349,56631],"zhcy;":1078,"zigrarr;":8669,"zopf;":[55349,56683],"zscr;":[55349,56527],"zwj;":8205,"zwnj;":8204},Tj=/(A(?:Elig;?|MP;?|acute;?|breve;|c(?:irc;?|y;)|fr;|grave;?|lpha;|macr;|nd;|o(?:gon;|pf;)|pplyFunction;|ring;?|s(?:cr;|sign;)|tilde;?|uml;?)|B(?:a(?:ckslash;|r(?:v;|wed;))|cy;|e(?:cause;|rnoullis;|ta;)|fr;|opf;|reve;|scr;|umpeq;)|C(?:Hcy;|OPY;?|a(?:cute;|p(?:;|italDifferentialD;)|yleys;)|c(?:aron;|edil;?|irc;|onint;)|dot;|e(?:dilla;|nterDot;)|fr;|hi;|ircle(?:Dot;|Minus;|Plus;|Times;)|lo(?:ckwiseContourIntegral;|seCurly(?:DoubleQuote;|Quote;))|o(?:lon(?:;|e;)|n(?:gruent;|int;|tourIntegral;)|p(?:f;|roduct;)|unterClockwiseContourIntegral;)|ross;|scr;|up(?:;|Cap;))|D(?:D(?:;|otrahd;)|Jcy;|Scy;|Zcy;|a(?:gger;|rr;|shv;)|c(?:aron;|y;)|el(?:;|ta;)|fr;|i(?:a(?:critical(?:Acute;|Do(?:t;|ubleAcute;)|Grave;|Tilde;)|mond;)|fferentialD;)|o(?:pf;|t(?:;|Dot;|Equal;)|uble(?:ContourIntegral;|Do(?:t;|wnArrow;)|L(?:eft(?:Arrow;|RightArrow;|Tee;)|ong(?:Left(?:Arrow;|RightArrow;)|RightArrow;))|Right(?:Arrow;|Tee;)|Up(?:Arrow;|DownArrow;)|VerticalBar;)|wn(?:Arrow(?:;|Bar;|UpArrow;)|Breve;|Left(?:RightVector;|TeeVector;|Vector(?:;|Bar;))|Right(?:TeeVector;|Vector(?:;|Bar;))|Tee(?:;|Arrow;)|arrow;))|s(?:cr;|trok;))|E(?:NG;|TH;?|acute;?|c(?:aron;|irc;?|y;)|dot;|fr;|grave;?|lement;|m(?:acr;|pty(?:SmallSquare;|VerySmallSquare;))|o(?:gon;|pf;)|psilon;|qu(?:al(?:;|Tilde;)|ilibrium;)|s(?:cr;|im;)|ta;|uml;?|x(?:ists;|ponentialE;))|F(?:cy;|fr;|illed(?:SmallSquare;|VerySmallSquare;)|o(?:pf;|rAll;|uriertrf;)|scr;)|G(?:Jcy;|T;?|amma(?:;|d;)|breve;|c(?:edil;|irc;|y;)|dot;|fr;|g;|opf;|reater(?:Equal(?:;|Less;)|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;)|scr;|t;)|H(?:ARDcy;|a(?:cek;|t;)|circ;|fr;|ilbertSpace;|o(?:pf;|rizontalLine;)|s(?:cr;|trok;)|ump(?:DownHump;|Equal;))|I(?:Ecy;|Jlig;|Ocy;|acute;?|c(?:irc;?|y;)|dot;|fr;|grave;?|m(?:;|a(?:cr;|ginaryI;)|plies;)|n(?:t(?:;|e(?:gral;|rsection;))|visible(?:Comma;|Times;))|o(?:gon;|pf;|ta;)|scr;|tilde;|u(?:kcy;|ml;?))|J(?:c(?:irc;|y;)|fr;|opf;|s(?:cr;|ercy;)|ukcy;)|K(?:Hcy;|Jcy;|appa;|c(?:edil;|y;)|fr;|opf;|scr;)|L(?:Jcy;|T;?|a(?:cute;|mbda;|ng;|placetrf;|rr;)|c(?:aron;|edil;|y;)|e(?:ft(?:A(?:ngleBracket;|rrow(?:;|Bar;|RightArrow;))|Ceiling;|Do(?:ubleBracket;|wn(?:TeeVector;|Vector(?:;|Bar;)))|Floor;|Right(?:Arrow;|Vector;)|T(?:ee(?:;|Arrow;|Vector;)|riangle(?:;|Bar;|Equal;))|Up(?:DownVector;|TeeVector;|Vector(?:;|Bar;))|Vector(?:;|Bar;)|arrow;|rightarrow;)|ss(?:EqualGreater;|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;))|fr;|l(?:;|eftarrow;)|midot;|o(?:ng(?:Left(?:Arrow;|RightArrow;)|RightArrow;|left(?:arrow;|rightarrow;)|rightarrow;)|pf;|wer(?:LeftArrow;|RightArrow;))|s(?:cr;|h;|trok;)|t;)|M(?:ap;|cy;|e(?:diumSpace;|llintrf;)|fr;|inusPlus;|opf;|scr;|u;)|N(?:Jcy;|acute;|c(?:aron;|edil;|y;)|e(?:gative(?:MediumSpace;|Thi(?:ckSpace;|nSpace;)|VeryThinSpace;)|sted(?:GreaterGreater;|LessLess;)|wLine;)|fr;|o(?:Break;|nBreakingSpace;|pf;|t(?:;|C(?:ongruent;|upCap;)|DoubleVerticalBar;|E(?:lement;|qual(?:;|Tilde;)|xists;)|Greater(?:;|Equal;|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;)|Hump(?:DownHump;|Equal;)|Le(?:ftTriangle(?:;|Bar;|Equal;)|ss(?:;|Equal;|Greater;|Less;|SlantEqual;|Tilde;))|Nested(?:GreaterGreater;|LessLess;)|Precedes(?:;|Equal;|SlantEqual;)|R(?:everseElement;|ightTriangle(?:;|Bar;|Equal;))|S(?:quareSu(?:bset(?:;|Equal;)|perset(?:;|Equal;))|u(?:bset(?:;|Equal;)|cceeds(?:;|Equal;|SlantEqual;|Tilde;)|perset(?:;|Equal;)))|Tilde(?:;|Equal;|FullEqual;|Tilde;)|VerticalBar;))|scr;|tilde;?|u;)|O(?:Elig;|acute;?|c(?:irc;?|y;)|dblac;|fr;|grave;?|m(?:acr;|ega;|icron;)|opf;|penCurly(?:DoubleQuote;|Quote;)|r;|s(?:cr;|lash;?)|ti(?:lde;?|mes;)|uml;?|ver(?:B(?:ar;|rac(?:e;|ket;))|Parenthesis;))|P(?:artialD;|cy;|fr;|hi;|i;|lusMinus;|o(?:incareplane;|pf;)|r(?:;|ecedes(?:;|Equal;|SlantEqual;|Tilde;)|ime;|o(?:duct;|portion(?:;|al;)))|s(?:cr;|i;))|Q(?:UOT;?|fr;|opf;|scr;)|R(?:Barr;|EG;?|a(?:cute;|ng;|rr(?:;|tl;))|c(?:aron;|edil;|y;)|e(?:;|verse(?:E(?:lement;|quilibrium;)|UpEquilibrium;))|fr;|ho;|ight(?:A(?:ngleBracket;|rrow(?:;|Bar;|LeftArrow;))|Ceiling;|Do(?:ubleBracket;|wn(?:TeeVector;|Vector(?:;|Bar;)))|Floor;|T(?:ee(?:;|Arrow;|Vector;)|riangle(?:;|Bar;|Equal;))|Up(?:DownVector;|TeeVector;|Vector(?:;|Bar;))|Vector(?:;|Bar;)|arrow;)|o(?:pf;|undImplies;)|rightarrow;|s(?:cr;|h;)|uleDelayed;)|S(?:H(?:CHcy;|cy;)|OFTcy;|acute;|c(?:;|aron;|edil;|irc;|y;)|fr;|hort(?:DownArrow;|LeftArrow;|RightArrow;|UpArrow;)|igma;|mallCircle;|opf;|q(?:rt;|uare(?:;|Intersection;|Su(?:bset(?:;|Equal;)|perset(?:;|Equal;))|Union;))|scr;|tar;|u(?:b(?:;|set(?:;|Equal;))|c(?:ceeds(?:;|Equal;|SlantEqual;|Tilde;)|hThat;)|m;|p(?:;|erset(?:;|Equal;)|set;)))|T(?:HORN;?|RADE;|S(?:Hcy;|cy;)|a(?:b;|u;)|c(?:aron;|edil;|y;)|fr;|h(?:e(?:refore;|ta;)|i(?:ckSpace;|nSpace;))|ilde(?:;|Equal;|FullEqual;|Tilde;)|opf;|ripleDot;|s(?:cr;|trok;))|U(?:a(?:cute;?|rr(?:;|ocir;))|br(?:cy;|eve;)|c(?:irc;?|y;)|dblac;|fr;|grave;?|macr;|n(?:der(?:B(?:ar;|rac(?:e;|ket;))|Parenthesis;)|ion(?:;|Plus;))|o(?:gon;|pf;)|p(?:Arrow(?:;|Bar;|DownArrow;)|DownArrow;|Equilibrium;|Tee(?:;|Arrow;)|arrow;|downarrow;|per(?:LeftArrow;|RightArrow;)|si(?:;|lon;))|ring;|scr;|tilde;|uml;?)|V(?:Dash;|bar;|cy;|dash(?:;|l;)|e(?:e;|r(?:bar;|t(?:;|ical(?:Bar;|Line;|Separator;|Tilde;))|yThinSpace;))|fr;|opf;|scr;|vdash;)|W(?:circ;|edge;|fr;|opf;|scr;)|X(?:fr;|i;|opf;|scr;)|Y(?:Acy;|Icy;|Ucy;|acute;?|c(?:irc;|y;)|fr;|opf;|scr;|uml;)|Z(?:Hcy;|acute;|c(?:aron;|y;)|dot;|e(?:roWidthSpace;|ta;)|fr;|opf;|scr;)|a(?:acute;?|breve;|c(?:;|E;|d;|irc;?|ute;?|y;)|elig;?|f(?:;|r;)|grave;?|l(?:e(?:fsym;|ph;)|pha;)|m(?:a(?:cr;|lg;)|p;?)|n(?:d(?:;|and;|d;|slope;|v;)|g(?:;|e;|le;|msd(?:;|a(?:a;|b;|c;|d;|e;|f;|g;|h;))|rt(?:;|vb(?:;|d;))|s(?:ph;|t;)|zarr;))|o(?:gon;|pf;)|p(?:;|E;|acir;|e;|id;|os;|prox(?:;|eq;))|ring;?|s(?:cr;|t;|ymp(?:;|eq;))|tilde;?|uml;?|w(?:conint;|int;))|b(?:Not;|a(?:ck(?:cong;|epsilon;|prime;|sim(?:;|eq;))|r(?:vee;|wed(?:;|ge;)))|brk(?:;|tbrk;)|c(?:ong;|y;)|dquo;|e(?:caus(?:;|e;)|mptyv;|psi;|rnou;|t(?:a;|h;|ween;))|fr;|ig(?:c(?:ap;|irc;|up;)|o(?:dot;|plus;|times;)|s(?:qcup;|tar;)|triangle(?:down;|up;)|uplus;|vee;|wedge;)|karow;|l(?:a(?:ck(?:lozenge;|square;|triangle(?:;|down;|left;|right;))|nk;)|k(?:1(?:2;|4;)|34;)|ock;)|n(?:e(?:;|quiv;)|ot;)|o(?:pf;|t(?:;|tom;)|wtie;|x(?:D(?:L;|R;|l;|r;)|H(?:;|D;|U;|d;|u;)|U(?:L;|R;|l;|r;)|V(?:;|H;|L;|R;|h;|l;|r;)|box;|d(?:L;|R;|l;|r;)|h(?:;|D;|U;|d;|u;)|minus;|plus;|times;|u(?:L;|R;|l;|r;)|v(?:;|H;|L;|R;|h;|l;|r;)))|prime;|r(?:eve;|vbar;?)|s(?:cr;|emi;|im(?:;|e;)|ol(?:;|b;|hsub;))|u(?:ll(?:;|et;)|mp(?:;|E;|e(?:;|q;))))|c(?:a(?:cute;|p(?:;|and;|brcup;|c(?:ap;|up;)|dot;|s;)|r(?:et;|on;))|c(?:a(?:ps;|ron;)|edil;?|irc;|ups(?:;|sm;))|dot;|e(?:dil;?|mptyv;|nt(?:;|erdot;|))|fr;|h(?:cy;|eck(?:;|mark;)|i;)|ir(?:;|E;|c(?:;|eq;|le(?:arrow(?:left;|right;)|d(?:R;|S;|ast;|circ;|dash;)))|e;|fnint;|mid;|scir;)|lubs(?:;|uit;)|o(?:lon(?:;|e(?:;|q;))|m(?:ma(?:;|t;)|p(?:;|fn;|le(?:ment;|xes;)))|n(?:g(?:;|dot;)|int;)|p(?:f;|rod;|y(?:;|sr;|)))|r(?:arr;|oss;)|s(?:cr;|u(?:b(?:;|e;)|p(?:;|e;)))|tdot;|u(?:darr(?:l;|r;)|e(?:pr;|sc;)|larr(?:;|p;)|p(?:;|brcap;|c(?:ap;|up;)|dot;|or;|s;)|r(?:arr(?:;|m;)|ly(?:eq(?:prec;|succ;)|vee;|wedge;)|ren;?|vearrow(?:left;|right;))|vee;|wed;)|w(?:conint;|int;)|ylcty;)|d(?:Arr;|Har;|a(?:gger;|leth;|rr;|sh(?:;|v;))|b(?:karow;|lac;)|c(?:aron;|y;)|d(?:;|a(?:gger;|rr;)|otseq;)|e(?:g;?|lta;|mptyv;)|f(?:isht;|r;)|har(?:l;|r;)|i(?:am(?:;|ond(?:;|suit;)|s;)|e;|gamma;|sin;|v(?:;|ide(?:;|ontimes;|)|onx;))|jcy;|lc(?:orn;|rop;)|o(?:llar;|pf;|t(?:;|eq(?:;|dot;)|minus;|plus;|square;)|ublebarwedge;|wn(?:arrow;|downarrows;|harpoon(?:left;|right;)))|r(?:bkarow;|c(?:orn;|rop;))|s(?:c(?:r;|y;)|ol;|trok;)|t(?:dot;|ri(?:;|f;))|u(?:arr;|har;)|wangle;|z(?:cy;|igrarr;))|e(?:D(?:Dot;|ot;)|a(?:cute;?|ster;)|c(?:aron;|ir(?:;|c;?)|olon;|y;)|dot;|e;|f(?:Dot;|r;)|g(?:;|rave;?|s(?:;|dot;))|l(?:;|inters;|l;|s(?:;|dot;))|m(?:acr;|pty(?:;|set;|v;)|sp(?:1(?:3;|4;)|;))|n(?:g;|sp;)|o(?:gon;|pf;)|p(?:ar(?:;|sl;)|lus;|si(?:;|lon;|v;))|q(?:c(?:irc;|olon;)|s(?:im;|lant(?:gtr;|less;))|u(?:als;|est;|iv(?:;|DD;))|vparsl;)|r(?:Dot;|arr;)|s(?:cr;|dot;|im;)|t(?:a;|h;?)|u(?:ml;?|ro;)|x(?:cl;|ist;|p(?:ectation;|onentiale;)))|f(?:allingdotseq;|cy;|emale;|f(?:ilig;|l(?:ig;|lig;)|r;)|ilig;|jlig;|l(?:at;|lig;|tns;)|nof;|o(?:pf;|r(?:all;|k(?:;|v;)))|partint;|r(?:a(?:c(?:1(?:2;?|3;|4;?|5;|6;|8;)|2(?:3;|5;)|3(?:4;?|5;|8;)|45;|5(?:6;|8;)|78;)|sl;)|own;)|scr;)|g(?:E(?:;|l;)|a(?:cute;|mma(?:;|d;)|p;)|breve;|c(?:irc;|y;)|dot;|e(?:;|l;|q(?:;|q;|slant;)|s(?:;|cc;|dot(?:;|o(?:;|l;))|l(?:;|es;)))|fr;|g(?:;|g;)|imel;|jcy;|l(?:;|E;|a;|j;)|n(?:E;|ap(?:;|prox;)|e(?:;|q(?:;|q;))|sim;)|opf;|rave;|s(?:cr;|im(?:;|e;|l;))|t(?:;|c(?:c;|ir;)|dot;|lPar;|quest;|r(?:a(?:pprox;|rr;)|dot;|eq(?:less;|qless;)|less;|sim;)|)|v(?:ertneqq;|nE;))|h(?:Arr;|a(?:irsp;|lf;|milt;|r(?:dcy;|r(?:;|cir;|w;)))|bar;|circ;|e(?:arts(?:;|uit;)|llip;|rcon;)|fr;|ks(?:earow;|warow;)|o(?:arr;|mtht;|ok(?:leftarrow;|rightarrow;)|pf;|rbar;)|s(?:cr;|lash;|trok;)|y(?:bull;|phen;))|i(?:acute;?|c(?:;|irc;?|y;)|e(?:cy;|xcl;?)|f(?:f;|r;)|grave;?|i(?:;|i(?:int;|nt;)|nfin;|ota;)|jlig;|m(?:a(?:cr;|g(?:e;|line;|part;)|th;)|of;|ped;)|n(?:;|care;|fin(?:;|tie;)|odot;|t(?:;|cal;|e(?:gers;|rcal;)|larhk;|prod;))|o(?:cy;|gon;|pf;|ta;)|prod;|quest;?|s(?:cr;|in(?:;|E;|dot;|s(?:;|v;)|v;))|t(?:;|ilde;)|u(?:kcy;|ml;?))|j(?:c(?:irc;|y;)|fr;|math;|opf;|s(?:cr;|ercy;)|ukcy;)|k(?:appa(?:;|v;)|c(?:edil;|y;)|fr;|green;|hcy;|jcy;|opf;|scr;)|l(?:A(?:arr;|rr;|tail;)|Barr;|E(?:;|g;)|Har;|a(?:cute;|emptyv;|gran;|mbda;|ng(?:;|d;|le;)|p;|quo;?|rr(?:;|b(?:;|fs;)|fs;|hk;|lp;|pl;|sim;|tl;)|t(?:;|ail;|e(?:;|s;)))|b(?:arr;|brk;|r(?:ac(?:e;|k;)|k(?:e;|sl(?:d;|u;))))|c(?:aron;|e(?:dil;|il;)|ub;|y;)|d(?:ca;|quo(?:;|r;)|r(?:dhar;|ushar;)|sh;)|e(?:;|ft(?:arrow(?:;|tail;)|harpoon(?:down;|up;)|leftarrows;|right(?:arrow(?:;|s;)|harpoons;|squigarrow;)|threetimes;)|g;|q(?:;|q;|slant;)|s(?:;|cc;|dot(?:;|o(?:;|r;))|g(?:;|es;)|s(?:approx;|dot;|eq(?:gtr;|qgtr;)|gtr;|sim;)))|f(?:isht;|loor;|r;)|g(?:;|E;)|h(?:ar(?:d;|u(?:;|l;))|blk;)|jcy;|l(?:;|arr;|corner;|hard;|tri;)|m(?:idot;|oust(?:;|ache;))|n(?:E;|ap(?:;|prox;)|e(?:;|q(?:;|q;))|sim;)|o(?:a(?:ng;|rr;)|brk;|ng(?:left(?:arrow;|rightarrow;)|mapsto;|rightarrow;)|oparrow(?:left;|right;)|p(?:ar;|f;|lus;)|times;|w(?:ast;|bar;)|z(?:;|enge;|f;))|par(?:;|lt;)|r(?:arr;|corner;|har(?:;|d;)|m;|tri;)|s(?:aquo;|cr;|h;|im(?:;|e;|g;)|q(?:b;|uo(?:;|r;))|trok;)|t(?:;|c(?:c;|ir;)|dot;|hree;|imes;|larr;|quest;|r(?:Par;|i(?:;|e;|f;))|)|ur(?:dshar;|uhar;)|v(?:ertneqq;|nE;))|m(?:DDot;|a(?:cr;?|l(?:e;|t(?:;|ese;))|p(?:;|sto(?:;|down;|left;|up;))|rker;)|c(?:omma;|y;)|dash;|easuredangle;|fr;|ho;|i(?:cro;?|d(?:;|ast;|cir;|dot;?)|nus(?:;|b;|d(?:;|u;)))|l(?:cp;|dr;)|nplus;|o(?:dels;|pf;)|p;|s(?:cr;|tpos;)|u(?:;|ltimap;|map;))|n(?:G(?:g;|t(?:;|v;))|L(?:eft(?:arrow;|rightarrow;)|l;|t(?:;|v;))|Rightarrow;|V(?:Dash;|dash;)|a(?:bla;|cute;|ng;|p(?:;|E;|id;|os;|prox;)|tur(?:;|al(?:;|s;)))|b(?:sp;?|ump(?:;|e;))|c(?:a(?:p;|ron;)|edil;|ong(?:;|dot;)|up;|y;)|dash;|e(?:;|Arr;|ar(?:hk;|r(?:;|ow;))|dot;|quiv;|s(?:ear;|im;)|xist(?:;|s;))|fr;|g(?:E;|e(?:;|q(?:;|q;|slant;)|s;)|sim;|t(?:;|r;))|h(?:Arr;|arr;|par;)|i(?:;|s(?:;|d;)|v;)|jcy;|l(?:Arr;|E;|arr;|dr;|e(?:;|ft(?:arrow;|rightarrow;)|q(?:;|q;|slant;)|s(?:;|s;))|sim;|t(?:;|ri(?:;|e;)))|mid;|o(?:pf;|t(?:;|in(?:;|E;|dot;|v(?:a;|b;|c;))|ni(?:;|v(?:a;|b;|c;))|))|p(?:ar(?:;|allel;|sl;|t;)|olint;|r(?:;|cue;|e(?:;|c(?:;|eq;))))|r(?:Arr;|arr(?:;|c;|w;)|ightarrow;|tri(?:;|e;))|s(?:c(?:;|cue;|e;|r;)|hort(?:mid;|parallel;)|im(?:;|e(?:;|q;))|mid;|par;|qsu(?:be;|pe;)|u(?:b(?:;|E;|e;|set(?:;|eq(?:;|q;)))|cc(?:;|eq;)|p(?:;|E;|e;|set(?:;|eq(?:;|q;)))))|t(?:gl;|ilde;?|lg;|riangle(?:left(?:;|eq;)|right(?:;|eq;)))|u(?:;|m(?:;|ero;|sp;))|v(?:Dash;|Harr;|ap;|dash;|g(?:e;|t;)|infin;|l(?:Arr;|e;|t(?:;|rie;))|r(?:Arr;|trie;)|sim;)|w(?:Arr;|ar(?:hk;|r(?:;|ow;))|near;))|o(?:S;|a(?:cute;?|st;)|c(?:ir(?:;|c;?)|y;)|d(?:ash;|blac;|iv;|ot;|sold;)|elig;|f(?:cir;|r;)|g(?:on;|rave;?|t;)|h(?:bar;|m;)|int;|l(?:arr;|c(?:ir;|ross;)|ine;|t;)|m(?:acr;|ega;|i(?:cron;|d;|nus;))|opf;|p(?:ar;|erp;|lus;)|r(?:;|arr;|d(?:;|er(?:;|of;)|f;?|m;?)|igof;|or;|slope;|v;)|s(?:cr;|lash;?|ol;)|ti(?:lde;?|mes(?:;|as;))|uml;?|vbar;)|p(?:ar(?:;|a(?:;|llel;|)|s(?:im;|l;)|t;)|cy;|er(?:cnt;|iod;|mil;|p;|tenk;)|fr;|h(?:i(?:;|v;)|mmat;|one;)|i(?:;|tchfork;|v;)|l(?:an(?:ck(?:;|h;)|kv;)|us(?:;|acir;|b;|cir;|d(?:o;|u;)|e;|mn;?|sim;|two;))|m;|o(?:intint;|pf;|und;?)|r(?:;|E;|ap;|cue;|e(?:;|c(?:;|approx;|curlyeq;|eq;|n(?:approx;|eqq;|sim;)|sim;))|ime(?:;|s;)|n(?:E;|ap;|sim;)|o(?:d;|f(?:alar;|line;|surf;)|p(?:;|to;))|sim;|urel;)|s(?:cr;|i;)|uncsp;)|q(?:fr;|int;|opf;|prime;|scr;|u(?:at(?:ernions;|int;)|est(?:;|eq;)|ot;?))|r(?:A(?:arr;|rr;|tail;)|Barr;|Har;|a(?:c(?:e;|ute;)|dic;|emptyv;|ng(?:;|d;|e;|le;)|quo;?|rr(?:;|ap;|b(?:;|fs;)|c;|fs;|hk;|lp;|pl;|sim;|tl;|w;)|t(?:ail;|io(?:;|nals;)))|b(?:arr;|brk;|r(?:ac(?:e;|k;)|k(?:e;|sl(?:d;|u;))))|c(?:aron;|e(?:dil;|il;)|ub;|y;)|d(?:ca;|ldhar;|quo(?:;|r;)|sh;)|e(?:al(?:;|ine;|part;|s;)|ct;|g;?)|f(?:isht;|loor;|r;)|h(?:ar(?:d;|u(?:;|l;))|o(?:;|v;))|i(?:ght(?:arrow(?:;|tail;)|harpoon(?:down;|up;)|left(?:arrows;|harpoons;)|rightarrows;|squigarrow;|threetimes;)|ng;|singdotseq;)|l(?:arr;|har;|m;)|moust(?:;|ache;)|nmid;|o(?:a(?:ng;|rr;)|brk;|p(?:ar;|f;|lus;)|times;)|p(?:ar(?:;|gt;)|polint;)|rarr;|s(?:aquo;|cr;|h;|q(?:b;|uo(?:;|r;)))|t(?:hree;|imes;|ri(?:;|e;|f;|ltri;))|uluhar;|x;)|s(?:acute;|bquo;|c(?:;|E;|a(?:p;|ron;)|cue;|e(?:;|dil;)|irc;|n(?:E;|ap;|sim;)|polint;|sim;|y;)|dot(?:;|b;|e;)|e(?:Arr;|ar(?:hk;|r(?:;|ow;))|ct;?|mi;|swar;|tm(?:inus;|n;)|xt;)|fr(?:;|own;)|h(?:arp;|c(?:hcy;|y;)|ort(?:mid;|parallel;)|y;?)|i(?:gma(?:;|f;|v;)|m(?:;|dot;|e(?:;|q;)|g(?:;|E;)|l(?:;|E;)|ne;|plus;|rarr;))|larr;|m(?:a(?:llsetminus;|shp;)|eparsl;|i(?:d;|le;)|t(?:;|e(?:;|s;)))|o(?:ftcy;|l(?:;|b(?:;|ar;))|pf;)|pa(?:des(?:;|uit;)|r;)|q(?:c(?:ap(?:;|s;)|up(?:;|s;))|su(?:b(?:;|e;|set(?:;|eq;))|p(?:;|e;|set(?:;|eq;)))|u(?:;|ar(?:e;|f;)|f;))|rarr;|s(?:cr;|etmn;|mile;|tarf;)|t(?:ar(?:;|f;)|r(?:aight(?:epsilon;|phi;)|ns;))|u(?:b(?:;|E;|dot;|e(?:;|dot;)|mult;|n(?:E;|e;)|plus;|rarr;|s(?:et(?:;|eq(?:;|q;)|neq(?:;|q;))|im;|u(?:b;|p;)))|cc(?:;|approx;|curlyeq;|eq;|n(?:approx;|eqq;|sim;)|sim;)|m;|ng;|p(?:1;?|2;?|3;?|;|E;|d(?:ot;|sub;)|e(?:;|dot;)|hs(?:ol;|ub;)|larr;|mult;|n(?:E;|e;)|plus;|s(?:et(?:;|eq(?:;|q;)|neq(?:;|q;))|im;|u(?:b;|p;))))|w(?:Arr;|ar(?:hk;|r(?:;|ow;))|nwar;)|zlig;?)|t(?:a(?:rget;|u;)|brk;|c(?:aron;|edil;|y;)|dot;|elrec;|fr;|h(?:e(?:re(?:4;|fore;)|ta(?:;|sym;|v;))|i(?:ck(?:approx;|sim;)|nsp;)|k(?:ap;|sim;)|orn;?)|i(?:lde;|mes(?:;|b(?:;|ar;)|d;|)|nt;)|o(?:ea;|p(?:;|bot;|cir;|f(?:;|ork;))|sa;)|prime;|r(?:ade;|i(?:angle(?:;|down;|left(?:;|eq;)|q;|right(?:;|eq;))|dot;|e;|minus;|plus;|sb;|time;)|pezium;)|s(?:c(?:r;|y;)|hcy;|trok;)|w(?:ixt;|ohead(?:leftarrow;|rightarrow;)))|u(?:Arr;|Har;|a(?:cute;?|rr;)|br(?:cy;|eve;)|c(?:irc;?|y;)|d(?:arr;|blac;|har;)|f(?:isht;|r;)|grave;?|h(?:ar(?:l;|r;)|blk;)|l(?:c(?:orn(?:;|er;)|rop;)|tri;)|m(?:acr;|l;?)|o(?:gon;|pf;)|p(?:arrow;|downarrow;|harpoon(?:left;|right;)|lus;|si(?:;|h;|lon;)|uparrows;)|r(?:c(?:orn(?:;|er;)|rop;)|ing;|tri;)|scr;|t(?:dot;|ilde;|ri(?:;|f;))|u(?:arr;|ml;?)|wangle;)|v(?:Arr;|Bar(?:;|v;)|Dash;|a(?:ngrt;|r(?:epsilon;|kappa;|nothing;|p(?:hi;|i;|ropto;)|r(?:;|ho;)|s(?:igma;|u(?:bsetneq(?:;|q;)|psetneq(?:;|q;)))|t(?:heta;|riangle(?:left;|right;))))|cy;|dash;|e(?:e(?:;|bar;|eq;)|llip;|r(?:bar;|t;))|fr;|ltri;|nsu(?:b;|p;)|opf;|prop;|rtri;|s(?:cr;|u(?:bn(?:E;|e;)|pn(?:E;|e;)))|zigzag;)|w(?:circ;|e(?:d(?:bar;|ge(?:;|q;))|ierp;)|fr;|opf;|p;|r(?:;|eath;)|scr;)|x(?:c(?:ap;|irc;|up;)|dtri;|fr;|h(?:Arr;|arr;)|i;|l(?:Arr;|arr;)|map;|nis;|o(?:dot;|p(?:f;|lus;)|time;)|r(?:Arr;|arr;)|s(?:cr;|qcup;)|u(?:plus;|tri;)|vee;|wedge;)|y(?:ac(?:ute;?|y;)|c(?:irc;|y;)|en;?|fr;|icy;|opf;|scr;|u(?:cy;|ml;?))|z(?:acute;|c(?:aron;|y;)|dot;|e(?:etrf;|ta;)|fr;|hcy;|igrarr;|opf;|scr;|w(?:j;|nj;)))|[\s\S]/g,sP=32,nP=/[^\r"&\u0000]+/g,aP=/[^\r'&\u0000]+/g,tP=/[^\r\t\n\f &>\u0000]+/g,eP=/[^\r\t\n\f \/>A-Z\u0000]+/g,$I=/[^\r\t\n\f \/=>A-Z\u0000]+/g,JI=/[^\]\r\u0000\uffff]*/g,ZI=/[^&<\r\u0000\uffff]*/g,kj=/[^<\r\u0000\uffff]*/g,YI=/[^\r\u0000\uffff]*/g,Ej=/(?:(\/)?([a-z]+)>)|[\s\S]/g,xj=/(?:([-a-z]+)[ \t\n\f]*=[ \t\n\f]*('[^'&\r\u0000]*'|"[^"&\r\u0000]*"|[^\t\n\r\f "&'\u0000>][^&> \t\n\r\f\u0000]*[ \t\n\f]))|[\s\S]/g,Q6=/[^\x09\x0A\x0C\x0D\x20]/,K3=/[^\x09\x0A\x0C\x0D\x20]/g,KI=/[^\x00\x09\x0A\x0C\x0D\x20]/,e2=/^[\x09\x0A\x0C\x0D\x20]+/,X6=/\x00/g;function y0($){var J=16384;if($.length<J)return String.fromCharCode.apply(String,$);var Z="";for(var Y=0;Y<$.length;Y+=J)Z+=String.fromCharCode.apply(String,$.slice(Y,Y+J));return Z}function VI($){var J=[];for(var Z=0;Z<$.length;Z++)J[Z]=$.charCodeAt(Z);return J}function d$($,J){if(typeof J==="string")return $.namespaceURI===G$.HTML&&$.localName===J;var Z=J[$.namespaceURI];return Z&&Z[$.localName]}function bj($){return d$($,oj)}function vj($){if(d$($,rj))return!0;if($.namespaceURI===G$.MATHML&&$.localName==="annotation-xml"){var J=$.getAttribute("encoding");if(J)J=J.toLowerCase();if(J==="text/html"||J==="application/xhtml+xml")return!0}return!1}function QI($){if($ in Nj)return Nj[$];else return $}function hj($){for(var J=0,Z=$.length;J<Z;J++)if($[J][0]in Lj)$[J][0]=Lj[$[J][0]]}function gj($){for(var J=0,Z=$.length;J<Z;J++)if($[J][0]==="definitionurl"){$[J][0]="definitionURL";break}}function V3($){for(var J=0,Z=$.length;J<Z;J++)if($[J][0]in wj)$[J].push(wj[$[J][0]])}function fj($,J){for(var Z=0,Y=$.length;Z<Y;Z++){var K=$[Z][0],V=$[Z][1];if(J.hasAttribute(K))continue;J._setAttribute(K,V)}}b$.ElementStack=function(){this.elements=[],this.top=null};b$.ElementStack.prototype.push=function($){this.elements.push($),this.top=$};b$.ElementStack.prototype.pop=function($){this.elements.pop(),this.top=this.elements[this.elements.length-1]};b$.ElementStack.prototype.popTag=function($){for(var J=this.elements.length-1;J>0;J--){var Z=this.elements[J];if(d$(Z,$))break}this.elements.length=J,this.top=this.elements[J-1]};b$.ElementStack.prototype.popElementType=function($){for(var J=this.elements.length-1;J>0;J--)if(this.elements[J]instanceof $)break;this.elements.length=J,this.top=this.elements[J-1]};b$.ElementStack.prototype.popElement=function($){for(var J=this.elements.length-1;J>0;J--)if(this.elements[J]===$)break;this.elements.length=J,this.top=this.elements[J-1]};b$.ElementStack.prototype.removeElement=function($){if(this.top===$)this.pop();else{var J=this.elements.lastIndexOf($);if(J!==-1)this.elements.splice(J,1)}};b$.ElementStack.prototype.clearToContext=function($){for(var J=this.elements.length-1;J>0;J--)if(d$(this.elements[J],$))break;this.elements.length=J+1,this.top=this.elements[J]};b$.ElementStack.prototype.contains=function($){return this.inSpecificScope($,Object.create(null))};b$.ElementStack.prototype.inSpecificScope=function($,J){for(var Z=this.elements.length-1;Z>=0;Z--){var Y=this.elements[Z];if(d$(Y,$))return!0;if(d$(Y,J))return!1}return!1};b$.ElementStack.prototype.elementInSpecificScope=function($,J){for(var Z=this.elements.length-1;Z>=0;Z--){var Y=this.elements[Z];if(Y===$)return!0;if(d$(Y,J))return!1}return!1};b$.ElementStack.prototype.elementTypeInSpecificScope=function($,J){for(var Z=this.elements.length-1;Z>=0;Z--){var Y=this.elements[Z];if(Y instanceof $)return!0;if(d$(Y,J))return!1}return!1};b$.ElementStack.prototype.inScope=function($){return this.inSpecificScope($,T1)};b$.ElementStack.prototype.elementInScope=function($){return this.elementInSpecificScope($,T1)};b$.ElementStack.prototype.elementTypeInScope=function($){return this.elementTypeInSpecificScope($,T1)};b$.ElementStack.prototype.inButtonScope=function($){return this.inSpecificScope($,G3)};b$.ElementStack.prototype.inListItemScope=function($){return this.inSpecificScope($,j6)};b$.ElementStack.prototype.inTableScope=function($){return this.inSpecificScope($,lj)};b$.ElementStack.prototype.inSelectScope=function($){for(var J=this.elements.length-1;J>=0;J--){var Z=this.elements[J];if(Z.namespaceURI!==G$.HTML)return!1;var Y=Z.localName;if(Y===$)return!0;if(Y!=="optgroup"&&Y!=="option")return!1}return!1};b$.ElementStack.prototype.generateImpliedEndTags=function($,J){var Z=J?pj:dj;for(var Y=this.elements.length-1;Y>=0;Y--){var K=this.elements[Y];if($&&d$(K,$))break;if(!d$(this.elements[Y],Z))break}this.elements.length=Y+1,this.top=this.elements[Y]};b$.ActiveFormattingElements=function(){this.list=[],this.attrs=[]};b$.ActiveFormattingElements.prototype.MARKER={localName:"|"};b$.ActiveFormattingElements.prototype.insertMarker=function(){this.list.push(this.MARKER),this.attrs.push(this.MARKER)};b$.ActiveFormattingElements.prototype.push=function($,J){var Z=0;for(var Y=this.list.length-1;Y>=0;Y--){if(this.list[Y]===this.MARKER)break;if(Q($,this.list[Y],this.attrs[Y])){if(Z++,Z===3){this.list.splice(Y,1),this.attrs.splice(Y,1);break}}}this.list.push($);var K=[];for(var V=0;V<J.length;V++)K[V]=J[V];this.attrs.push(K);function Q(G,W,_){if(G.localName!==W.localName)return!1;if(G._numattrs!==_.length)return!1;for(var j=0,B=_.length;j<B;j++){var q=_[j][0],U=_[j][1];if(!G.hasAttribute(q))return!1;if(G.getAttribute(q)!==U)return!1}return!0}};b$.ActiveFormattingElements.prototype.clearToMarker=function(){for(var $=this.list.length-1;$>=0;$--)if(this.list[$]===this.MARKER)break;if($<0)$=0;this.list.length=$,this.attrs.length=$};b$.ActiveFormattingElements.prototype.findElementByTag=function($){for(var J=this.list.length-1;J>=0;J--){var Z=this.list[J];if(Z===this.MARKER)break;if(Z.localName===$)return Z}return null};b$.ActiveFormattingElements.prototype.indexOf=function($){return this.list.lastIndexOf($)};b$.ActiveFormattingElements.prototype.remove=function($){var J=this.list.lastIndexOf($);if(J!==-1)this.list.splice(J,1),this.attrs.splice(J,1)};b$.ActiveFormattingElements.prototype.replace=function($,J,Z){var Y=this.list.lastIndexOf($);if(Y!==-1)this.list[Y]=J,this.attrs[Y]=Z};b$.ActiveFormattingElements.prototype.insertAfter=function($,J){var Z=this.list.lastIndexOf($);if(Z!==-1)this.list.splice(Z,0,J),this.attrs.splice(Z,0,J)};function b$($,J,Z){var Y=null,K=0,V=0,Q=!1,G=!1,W=0,_=[],j="",B=!0,q=0,U=S$,z,C,D="",M="",I=[],P="",L="",w=[],N=[],x=[],b=[],v=[],m=!1,A=pB,u=null,r=[],S=new b$.ElementStack,T=new b$.ActiveFormattingElements,k=J!==void 0,A$=null,s=null,J$=!0;if(J)J$=J.ownerDocument._scripting_enabled;if(Z&&Z.scripting_enabled===!1)J$=!1;var Z$=!0,W$=!1,y$,V$,y=[],n=!1,a=!1,c$={document:function(){return l},_asDocumentFragment:function(){var H=l.createDocumentFragment(),O=l.firstChild;while(O.hasChildNodes())H.appendChild(O.firstChild);return H},pause:function(){q++},resume:function(){q--,this.parse("")},parse:function(H,O,R){var E;if(q>0)return j+=H,!0;if(W===0){if(j)H=j+H,j="";if(O)H+="\uFFFF",Q=!0;if(Y=H,K=H.length,V=0,B){if(B=!1,Y.charCodeAt(0)===65279)V=1}W++,E=g(R),j=Y.substring(V,K),W--}else{if(W++,_.push(Y,K,V),Y=H,K=H.length,V=0,g(),E=!1,j=Y.substring(V,K),V=_.pop(),K=_.pop(),Y=_.pop(),j)Y=j+Y.substring(V),K=Y.length,V=0,j="";W--}return E}},l=new mP(!0,$);if(l._parser=c$,l._scripting_enabled=J$,J){if(J.ownerDocument._quirks)l._quirks=!0;if(J.ownerDocument._limitedQuirks)l._limitedQuirks=!0;if(J.namespaceURI===G$.HTML)switch(J.localName){case"title":case"textarea":U=J2;break;case"style":case"xmp":case"iframe":case"noembed":case"noframes":case"script":case"plaintext":U=L6;break}var d=l.createElement("html");if(l._appendChild(d),S.push(d),J instanceof u$.HTMLTemplateElement)r.push(g6);nJ();for(var Y$=J;Y$!==null;Y$=Y$.parentElement)if(Y$ instanceof u$.HTMLFormElement){s=Y$;break}}function g(H){var O,R,E,h;while(V<K){if(q>0||H&&H())return!0;switch(typeof U.lookahead){case"undefined":if(O=Y.charCodeAt(V++),G){if(G=!1,O===10){V++;continue}}switch(O){case 13:if(V<K){if(Y.charCodeAt(V)===10)V++}else G=!0;U(10);break;case 65535:if(Q&&V===K){U(V6);break}default:U(O);break}break;case"number":O=Y.charCodeAt(V);var c=U.lookahead,U$=!0;if(c<0)U$=!1,c=-c;if(c<K-V)R=U$?Y.substring(V,V+c):null,h=!1;else if(Q){if(R=U$?Y.substring(V,K):null,h=!0,O===65535&&V===K-1)O=V6}else return!0;U(O,R,h);break;case"string":O=Y.charCodeAt(V),E=U.lookahead;var R$=Y.indexOf(E,V);if(R$!==-1)R=Y.substring(V,R$+E.length),h=!1;else{if(!Q)return!0;if(R=Y.substring(V,K),O===65535&&V===K-1)O=V6;h=!0}U(O,R,h);break}}return!1}function t(H,O){for(var R=0;R<v.length;R++)if(v[R][0]===H)return;if(O!==void 0)v.push([H,O]);else v.push([H])}function M$(){xj.lastIndex=V-1;var H=xj.exec(Y);if(!H)throw Error("should never happen");var O=H[1];if(!O)return!1;var R=H[2],E=R.length;switch(R[0]){case'"':case"'":R=R.substring(1,E-1),V+=H[0].length-1,U=k6;break;default:U=A1,V+=H[0].length-1,R=R.substring(0,E-1);break}for(var h=0;h<v.length;h++)if(v[h][0]===O)return!0;return v.push([O,R]),!0}function T$(){m=!1,D="",v.length=0}function C$(){m=!0,D="",v.length=0}function r$(){I.length=0}function K0(){P=""}function t1(){L=""}function a8(){w.length=0}function e1(){N.length=0,x=null,b=null}function M1(){x=[]}function C1(){b=[]}function h$(){W$=!0}function sH(){return S.top&&S.top.namespaceURI!=="http://www.w3.org/1999/xhtml"}function i0(H){return M===H}function QJ(){if(y.length>0){var H=y0(y);if(y.length=0,a){if(a=!1,H[0]===`
33
+ `)H=H.substring(1);if(H.length===0)return}j0(cJ,H),n=!1}a=!1}function rJ(H){H.lastIndex=V-1;var O=H.exec(Y);if(O&&O.index===V-1){if(O=O[0],V+=O.length-1,Q&&V===K)O=O.slice(0,-1),V--;return O}else throw Error("should never happen")}function iJ(H){H.lastIndex=V-1;var O=H.exec(Y)[0];if(!O)return!1;return nH(O),V+=O.length-1,!0}function nH(H){if(y.length>0)QJ();if(a){if(a=!1,H[0]===`
34
+ `)H=H.substring(1);if(H.length===0)return}j0(cJ,H)}function k1(){if(m)j0(N$,D);else{var H=D;D="",M=H,j0(N0,H,v)}}function aH(){if(V===K)return!1;Ej.lastIndex=V;var H=Ej.exec(Y);if(!H)throw Error("should never happen");var O=H[2];if(!O)return!1;var R=H[1];if(R)V+=O.length+2,j0(N$,O);else V+=O.length+1,M=O,j0(N0,O,pP);return!0}function tH(){if(m)j0(N$,D,null,!0);else j0(N0,D,v,!0)}function g$(){j0(dP,y0(N),x?y0(x):void 0,b?y0(b):void 0)}function I$(){QJ(),A(V6),l.modclock=1}var j0=c$.insertToken=function(O,R,E,h){QJ();var c=S.top;if(!c||c.namespaceURI===G$.HTML)A(O,R,E,h);else if(O!==N0&&O!==cJ)VK(O,R,E,h);else if(bj(c)&&(O===cJ||O===N0&&R!=="mglyph"&&R!=="malignmark")||O===N0&&R==="svg"&&c.namespaceURI===G$.MATHML&&c.localName==="annotation-xml"||vj(c))V$=!0,A(O,R,E,h),V$=!1;else VK(O,R,E,h)};function D1(H){var O=S.top;if($2&&d$(O,lJ))e8(function(R){return R.createComment(H)});else{if(O instanceof u$.HTMLTemplateElement)O=O.content;O._appendChild(O.ownerDocument.createComment(H))}}function P1(H){var O=S.top;if($2&&d$(O,lJ))e8(function(E){return E.createTextNode(H)});else{if(O instanceof u$.HTMLTemplateElement)O=O.content;var R=O.lastChild;if(R&&R.nodeType===Y3.TEXT_NODE)R.appendData(H);else O._appendChild(O.ownerDocument.createTextNode(H))}}function sJ(H,O,R){var E=mj.createElement(H,O,null);if(R)for(var h=0,c=R.length;h<c;h++)E._setAttribute(R[h][0],R[h][1]);return E}var $2=!1;function q$(H,O){var R=t8(function(E){return sJ(E,H,O)});if(d$(R,cj))R._form=s;return R}function t8(H){var O;if($2&&d$(S.top,lJ))O=e8(H);else if(S.top instanceof u$.HTMLTemplateElement)O=H(S.top.content.ownerDocument),S.top.content._appendChild(O);else O=H(S.top.ownerDocument),S.top._appendChild(O);return S.push(O),O}function R6(H,O,R){return t8(function(E){var h=E._createElementNS(H,R,null);if(O)for(var c=0,U$=O.length;c<U$;c++){var R$=O[c];if(R$.length===2)h._setAttribute(R$[0],R$[1]);else h._setAttributeNS(R$[2],R$[0],R$[1])}return h})}function c3(H){for(var O=S.elements.length-1;O>=0;O--)if(S.elements[O]instanceof H)return O;return-1}function e8(H){var O,R,E=-1,h=-1,c;if(E=c3(u$.HTMLTableElement),h=c3(u$.HTMLTemplateElement),h>=0&&(E<0||h>E))O=S.elements[h];else if(E>=0)if(O=S.elements[E].parentNode,O)R=S.elements[E];else O=S.elements[E-1];if(!O)O=S.elements[0];if(O instanceof u$.HTMLTemplateElement)O=O.content;if(c=H(O.ownerDocument),c.nodeType===Y3.TEXT_NODE){var U$;if(R)U$=R.previousSibling;else U$=O.lastChild;if(U$&&U$.nodeType===Y3.TEXT_NODE)return U$.appendData(c.data),c}if(R)O.insertBefore(c,R);else O._appendChild(c);return c}function nJ(){var H=!1;for(var O=S.elements.length-1;O>=0;O--){var R=S.elements[O];if(O===0){if(H=!0,k)R=J}if(R.namespaceURI===G$.HTML){var E=R.localName;switch(E){case"select":for(var h=O;h>0;){var c=S.elements[--h];if(c instanceof u$.HTMLTemplateElement)break;else if(c instanceof u$.HTMLTableElement){A=B9;return}}A=E1;return;case"tr":A=eJ;return;case"tbody":case"tfoot":case"thead":A=I2;return;case"caption":A=h6;return;case"colgroup":A=H9;return;case"table":A=s0;return;case"template":A=r[r.length-1];return;case"body":A=j$;return;case"frameset":A=f6;return;case"html":if(A$===null)A=j9;else A=v6;return;default:if(!H){if(E==="head"){A=V0;return}if(E==="td"||E==="th"){A=XJ;return}}}}if(H){A=j$;return}}}function $9(H,O){q$(H,O),U=aJ,u=A,A=U9}function eH(H,O){q$(H,O),U=J2,u=A,A=U9}function w6(H,O){return{elt:sJ(H,T.list[O].localName,T.attrs[O]),attrs:T.attrs[O]}}function k0(){if(T.list.length===0)return;var H=T.list[T.list.length-1];if(H===T.MARKER)return;if(S.elements.lastIndexOf(H)!==-1)return;for(var O=T.list.length-2;O>=0;O--){if(H=T.list[O],H===T.MARKER)break;if(S.elements.lastIndexOf(H)!==-1)break}for(O=O+1;O<T.list.length;O++){var R=t8(function(E){return w6(E,O).elt});T.list[O]=R}}var J9={localName:"BM"};function $B(H){if(d$(S.top,H)&&T.indexOf(S.top)===-1)return S.pop(),!0;var O=0;while(O<8){O++;var R=T.findElementByTag(H);if(!R)return!1;var E=S.elements.lastIndexOf(R);if(E===-1)return T.remove(R),!0;if(!S.elementInScope(R))return!0;var h=null,c;for(var U$=E+1;U$<S.elements.length;U$++)if(d$(S.elements[U$],$J)){h=S.elements[U$],c=U$;break}if(!h)return S.popElement(R),T.remove(R),!0;else{var R$=S.elements[E-1];T.insertAfter(R,J9);var J0=h,C0=h,n0=c,G1,A2=0;while(!0){if(A2++,J0=S.elements[--n0],J0===R)break;if(G1=T.indexOf(J0),A2>3&&G1!==-1)T.remove(J0),G1=-1;if(G1===-1){S.removeElement(J0);continue}var Q2=w6(R$.ownerDocument,G1);if(T.replace(J0,Q2.elt,Q2.attrs),S.elements[n0]=Q2.elt,J0=Q2.elt,C0===h)T.remove(J9),T.insertAfter(Q2.elt,J9);J0._appendChild(C0),C0=J0}if($2&&d$(R$,lJ))e8(function(){return C0});else if(R$ instanceof u$.HTMLTemplateElement)R$.content._appendChild(C0);else R$._appendChild(C0);var $8=w6(h.ownerDocument,T.indexOf(R));while(h.hasChildNodes())$8.elt._appendChild(h.firstChild);h._appendChild($8.elt),T.remove(R),T.replace(J9,$8.elt,$8.attrs),S.removeElement(R);var iB=S.elements.lastIndexOf(h);S.elements.splice(iB+1,0,$8.elt)}}return!0}function JB(){S.pop(),A=u;return}function C2(){if(delete l._parser,S.elements.length=0,l.defaultView)l.defaultView.dispatchEvent(new u$.Event("load",{}))}function Q$(H,O){U=O,V--}function S$(H){switch(H){case 38:z=S$,U=tJ;break;case 60:if(aH())break;U=ZB;break;case 0:y.push(H),n=!0;break;case-1:I$();break;default:iJ(ZI)||y.push(H);break}}function J2(H){switch(H){case 38:z=J2,U=tJ;break;case 60:U=KB;break;case 0:y.push(65533),n=!0;break;case-1:I$();break;default:y.push(H);break}}function aJ(H){switch(H){case 60:U=XB;break;case 0:y.push(65533);break;case-1:I$();break;default:iJ(kj)||y.push(H);break}}function Z2(H){switch(H){case 60:U=jB;break;case 0:y.push(65533);break;case-1:I$();break;default:iJ(kj)||y.push(H);break}}function L6(H){switch(H){case 0:y.push(65533);break;case-1:I$();break;default:iJ(YI)||y.push(H);break}}function ZB(H){switch(H){case 33:U=i3;break;case 47:U=YB;break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:T$(),Q$(H,l3);break;case 63:Q$(H,V9);break;default:y.push(60),Q$(H,S$);break}}function YB(H){switch(H){case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:C$(),Q$(H,l3);break;case 62:U=S$;break;case-1:y.push(60),y.push(47),I$();break;default:Q$(H,V9);break}}function l3(H){switch(H){case 9:case 10:case 12:case 32:U=A1;break;case 47:U=K2;break;case 62:U=S$,k1();break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:D+=String.fromCharCode(H+32);break;case 0:D+=String.fromCharCode(65533);break;case-1:I$();break;default:D+=rJ(eP);break}}function KB(H){if(H===47)r$(),U=VB;else y.push(60),Q$(H,J2)}function VB(H){switch(H){case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:C$(),Q$(H,QB);break;default:y.push(60),y.push(47),Q$(H,J2);break}}function QB(H){switch(H){case 9:case 10:case 12:case 32:if(i0(D)){U=A1;return}break;case 47:if(i0(D)){U=K2;return}break;case 62:if(i0(D)){U=S$,k1();return}break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:D+=String.fromCharCode(H+32),I.push(H);return;case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:D+=String.fromCharCode(H),I.push(H);return;default:break}y.push(60),y.push(47),t2(y,I),Q$(H,J2)}function XB(H){if(H===47)r$(),U=GB;else y.push(60),Q$(H,aJ)}function GB(H){switch(H){case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:C$(),Q$(H,WB);break;default:y.push(60),y.push(47),Q$(H,aJ);break}}function WB(H){switch(H){case 9:case 10:case 12:case 32:if(i0(D)){U=A1;return}break;case 47:if(i0(D)){U=K2;return}break;case 62:if(i0(D)){U=S$,k1();return}break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:D+=String.fromCharCode(H+32),I.push(H);return;case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:D+=String.fromCharCode(H),I.push(H);return;default:break}y.push(60),y.push(47),t2(y,I),Q$(H,aJ)}function jB(H){switch(H){case 47:r$(),U=UB;break;case 33:U=BB,y.push(60),y.push(33);break;default:y.push(60),Q$(H,Z2);break}}function UB(H){switch(H){case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:C$(),Q$(H,HB);break;default:y.push(60),y.push(47),Q$(H,Z2);break}}function HB(H){switch(H){case 9:case 10:case 12:case 32:if(i0(D)){U=A1;return}break;case 47:if(i0(D)){U=K2;return}break;case 62:if(i0(D)){U=S$,k1();return}break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:D+=String.fromCharCode(H+32),I.push(H);return;case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:D+=String.fromCharCode(H),I.push(H);return;default:break}y.push(60),y.push(47),t2(y,I),Q$(H,Z2)}function BB(H){if(H===45)U=_B,y.push(45);else Q$(H,Z2)}function _B(H){if(H===45)U=o3,y.push(45);else Q$(H,Z2)}function I1(H){switch(H){case 45:U=OB,y.push(45);break;case 60:U=N6;break;case 0:y.push(65533);break;case-1:I$();break;default:y.push(H);break}}function OB(H){switch(H){case 45:U=o3,y.push(45);break;case 60:U=N6;break;case 0:U=I1,y.push(65533);break;case-1:I$();break;default:U=I1,y.push(H);break}}function o3(H){switch(H){case 45:y.push(45);break;case 60:U=N6;break;case 62:U=Z2,y.push(62);break;case 0:U=I1,y.push(65533);break;case-1:I$();break;default:U=I1,y.push(H);break}}function N6(H){switch(H){case 47:r$(),U=qB;break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:r$(),y.push(60),Q$(H,zB);break;default:y.push(60),Q$(H,I1);break}}function qB(H){switch(H){case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:C$(),Q$(H,FB);break;default:y.push(60),y.push(47),Q$(H,I1);break}}function FB(H){switch(H){case 9:case 10:case 12:case 32:if(i0(D)){U=A1;return}break;case 47:if(i0(D)){U=K2;return}break;case 62:if(i0(D)){U=S$,k1();return}break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:D+=String.fromCharCode(H+32),I.push(H);return;case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:D+=String.fromCharCode(H),I.push(H);return;default:break}y.push(60),y.push(47),t2(y,I),Q$(H,I1)}function zB(H){switch(H){case 9:case 10:case 12:case 32:case 47:case 62:if(y0(I)==="script")U=Y2;else U=I1;y.push(H);break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:I.push(H+32),y.push(H);break;case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:I.push(H),y.push(H);break;default:Q$(H,I1);break}}function Y2(H){switch(H){case 45:U=MB,y.push(45);break;case 60:U=y6,y.push(60);break;case 0:y.push(65533);break;case-1:I$();break;default:y.push(H);break}}function MB(H){switch(H){case 45:U=CB,y.push(45);break;case 60:U=y6,y.push(60);break;case 0:U=Y2,y.push(65533);break;case-1:I$();break;default:U=Y2,y.push(H);break}}function CB(H){switch(H){case 45:y.push(45);break;case 60:U=y6,y.push(60);break;case 62:U=Z2,y.push(62);break;case 0:U=Y2,y.push(65533);break;case-1:I$();break;default:U=Y2,y.push(H);break}}function y6(H){if(H===47)r$(),U=DB,y.push(47);else Q$(H,Y2)}function DB(H){switch(H){case 9:case 10:case 12:case 32:case 47:case 62:if(y0(I)==="script")U=I1;else U=Y2;y.push(H);break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:I.push(H+32),y.push(H);break;case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:I.push(H),y.push(H);break;default:Q$(H,Y2);break}}function A1(H){switch(H){case 9:case 10:case 12:case 32:break;case 47:U=K2;break;case 62:U=S$,k1();break;case-1:I$();break;case 61:K0(),P+=String.fromCharCode(H),U=T6;break;default:if(M$())break;K0(),Q$(H,T6);break}}function T6(H){switch(H){case 9:case 10:case 12:case 32:case 47:case 62:case-1:Q$(H,PB);break;case 61:U=r3;break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:P+=String.fromCharCode(H+32);break;case 0:P+=String.fromCharCode(65533);break;case 34:case 39:case 60:default:P+=rJ($I);break}}function PB(H){switch(H){case 9:case 10:case 12:case 32:break;case 47:t(P),U=K2;break;case 61:U=r3;break;case 62:U=S$,t(P),k1();break;case-1:t(P),I$();break;default:t(P),K0(),Q$(H,T6);break}}function r3(H){switch(H){case 9:case 10:case 12:case 32:break;case 34:t1(),U=Z9;break;case 39:t1(),U=Y9;break;case 62:default:t1(),Q$(H,K9);break}}function Z9(H){switch(H){case 34:t(P,L),U=k6;break;case 38:z=Z9,U=tJ;break;case 0:L+=String.fromCharCode(65533);break;case-1:I$();break;case 10:L+=String.fromCharCode(H);break;default:L+=rJ(nP);break}}function Y9(H){switch(H){case 39:t(P,L),U=k6;break;case 38:z=Y9,U=tJ;break;case 0:L+=String.fromCharCode(65533);break;case-1:I$();break;case 10:L+=String.fromCharCode(H);break;default:L+=rJ(aP);break}}function K9(H){switch(H){case 9:case 10:case 12:case 32:t(P,L),U=A1;break;case 38:z=K9,U=tJ;break;case 62:t(P,L),U=S$,k1();break;case 0:L+=String.fromCharCode(65533);break;case-1:V--,U=S$;break;case 34:case 39:case 60:case 61:case 96:default:L+=rJ(tP);break}}function k6(H){switch(H){case 9:case 10:case 12:case 32:U=A1;break;case 47:U=K2;break;case 62:U=S$,k1();break;case-1:I$();break;default:Q$(H,A1);break}}function K2(H){switch(H){case 62:U=S$,tH(!0);break;case-1:I$();break;default:Q$(H,A1);break}}function V9(H,O,R){var E=O.length;if(R)V+=E-1;else V+=E;var h=O.substring(0,E-1);h=h.replace(/\u0000/g,"\uFFFD"),h=h.replace(/\u000D\u000A/g,`
35
35
  `),h=h.replace(/\u000D/g,`
36
- `),j0(y1,h),U=S$}Q9.lookahead=">";function l3(B,O,w){if(O[0]==="-"&&O[1]==="-"){Q+=2,a8(),U=CH;return}if(O.toUpperCase()==="DOCTYPE")Q+=7,U=wH;else if(O==="[CDATA["&&lB())Q+=7,U=b6;else U=Q9}l3.lookahead=7;function CH(B){switch(a8(),B){case 45:U=MH;break;case 62:U=S$,j0(y1,y0(R));break;default:V$(B,D2);break}}function MH(B){switch(B){case 45:U=V9;break;case 62:U=S$,j0(y1,y0(R));break;case-1:j0(y1,y0(R)),I$();break;default:R.push(45),V$(B,D2);break}}function D2(B){switch(B){case 60:R.push(B),U=DH;break;case 45:U=E6;break;case 0:R.push(65533);break;case-1:j0(y1,y0(R)),I$();break;default:R.push(B);break}}function DH(B){switch(B){case 33:R.push(B),U=PH;break;case 60:R.push(B);break;default:V$(B,D2);break}}function PH(B){switch(B){case 45:U=IH;break;default:V$(B,D2);break}}function IH(B){switch(B){case 45:U=AH;break;default:V$(B,E6);break}}function AH(B){switch(B){case 62:case-1:V$(B,V9);break;default:V$(B,V9);break}}function E6(B){switch(B){case 45:U=V9;break;case-1:j0(y1,y0(R)),I$();break;default:R.push(45),V$(B,D2);break}}function V9(B){switch(B){case 62:U=S$,j0(y1,y0(R));break;case 33:U=SH;break;case 45:R.push(45);break;case-1:j0(y1,y0(R)),I$();break;default:R.push(45),R.push(45),V$(B,D2);break}}function SH(B){switch(B){case 45:R.push(45),R.push(45),R.push(33),U=E6;break;case 62:U=S$,j0(y1,y0(R));break;case-1:j0(y1,y0(R)),I$();break;default:R.push(45),R.push(45),R.push(33),V$(B,D2);break}}function wH(B){switch(B){case 9:case 10:case 12:case 32:U=o3;break;case-1:e1(),h$(),g$(),I$();break;default:V$(B,o3);break}}function o3(B){switch(B){case 9:case 10:case 12:case 32:break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:e1(),N.push(B+32),U=x6;break;case 0:e1(),N.push(65533),U=x6;break;case 62:e1(),h$(),U=S$,g$();break;case-1:e1(),h$(),g$(),I$();break;default:e1(),N.push(B),U=x6;break}}function x6(B){switch(B){case 9:case 10:case 12:case 32:U=r3;break;case 62:U=S$,g$();break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:N.push(B+32);break;case 0:N.push(65533);break;case-1:h$(),g$(),I$();break;default:N.push(B);break}}function r3(B,O,w){switch(B){case 9:case 10:case 12:case 32:Q+=1;break;case 62:U=S$,Q+=1,g$();break;case-1:h$(),g$(),I$();break;default:if(O=O.toUpperCase(),O==="PUBLIC")Q+=6,U=RH;else if(O==="SYSTEM")Q+=6,U=yH;else h$(),U=Q2;break}}r3.lookahead=6;function RH(B){switch(B){case 9:case 10:case 12:case 32:U=LH;break;case 34:C1(),U=i3;break;case 39:C1(),U=s3;break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:h$(),U=Q2;break}}function LH(B){switch(B){case 9:case 10:case 12:case 32:break;case 34:C1(),U=i3;break;case 39:C1(),U=s3;break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:h$(),U=Q2;break}}function i3(B){switch(B){case 34:U=n3;break;case 0:x.push(65533);break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:x.push(B);break}}function s3(B){switch(B){case 39:U=n3;break;case 0:x.push(65533);break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:x.push(B);break}}function n3(B){switch(B){case 9:case 10:case 12:case 32:U=NH;break;case 62:U=S$,g$();break;case 34:M1(),U=G9;break;case 39:M1(),U=X9;break;case-1:h$(),g$(),I$();break;default:h$(),U=Q2;break}}function NH(B){switch(B){case 9:case 10:case 12:case 32:break;case 62:U=S$,g$();break;case 34:M1(),U=G9;break;case 39:M1(),U=X9;break;case-1:h$(),g$(),I$();break;default:h$(),U=Q2;break}}function yH(B){switch(B){case 9:case 10:case 12:case 32:U=TH;break;case 34:M1(),U=G9;break;case 39:M1(),U=X9;break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:h$(),U=Q2;break}}function TH(B){switch(B){case 9:case 10:case 12:case 32:break;case 34:M1(),U=G9;break;case 39:M1(),U=X9;break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:h$(),U=Q2;break}}function G9(B){switch(B){case 34:U=a3;break;case 0:b.push(65533);break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:b.push(B);break}}function X9(B){switch(B){case 39:U=a3;break;case 0:b.push(65533);break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:b.push(B);break}}function a3(B){switch(B){case 9:case 10:case 12:case 32:break;case 62:U=S$,g$();break;case-1:h$(),g$(),I$();break;default:U=Q2;break}}function Q2(B){switch(B){case 62:U=S$,g$();break;case-1:g$(),I$();break;default:break}}function b6(B){switch(B){case 93:U=kH;break;case-1:I$();break;case 0:n=!0;default:iJ(rP)||y.push(B);break}}function kH(B){switch(B){case 93:U=EH;break;default:y.push(93),V$(B,b6);break}}function EH(B){switch(B){case 93:y.push(93);break;case 62:VJ(),U=S$;break;default:y.push(93),y.push(93),V$(B,b6);break}}function tJ(B){switch(r$(),P.push(38),B){case 9:case 10:case 12:case 32:case 60:case 38:case-1:V$(B,P2);break;case 35:P.push(B),U=xH;break;default:V$(B,t3);break}}function t3(B){wj.lastIndex=Q;var O=wj.exec(Y);if(!O)throw Error("should never happen");var w=O[1];if(!w){U=P2;return}switch(Q+=w.length,t2(P,aP(w)),z){case Z9:case Y9:case K9:if(w[w.length-1]!==";"){if(/[=A-Za-z0-9]/.test(Y[Q])){U=P2;return}}break;default:break}r$();var E=mP[w];if(typeof E==="number")P.push(E);else t2(P,E);U=P2}t3.lookahead=-uP;function xH(B){switch(M=0,B){case 120:case 88:P.push(B),U=bH;break;default:V$(B,vH);break}}function bH(B){switch(B){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 65:case 66:case 67:case 68:case 69:case 70:case 97:case 98:case 99:case 100:case 101:case 102:V$(B,hH);break;default:V$(B,P2);break}}function vH(B){switch(B){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:V$(B,gH);break;default:V$(B,P2);break}}function hH(B){switch(B){case 65:case 66:case 67:case 68:case 69:case 70:M*=16,M+=B-55;break;case 97:case 98:case 99:case 100:case 101:case 102:M*=16,M+=B-87;break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:M*=16,M+=B-48;break;case 59:U=W9;break;default:V$(B,W9);break}}function gH(B){switch(B){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:M*=10,M+=B-48;break;case 59:U=W9;break;default:V$(B,W9);break}}function W9(B){if(M in Sj)M=Sj[M];else if(M>1114111||M>=55296&&M<57344)M=65533;if(r$(),M<=65535)P.push(M);else M=M-65536,P.push(55296+(M>>10)),P.push(56320+(M&1023));V$(B,P2)}function P2(B){switch(z){case Z9:case Y9:case K9:L+=y0(P);break;default:t2(y,P);break}V$(B,z)}function fH(B,O,w,E){switch(B){case 1:if(O=O.replace(e2,""),O.length===0)return;break;case 4:l._appendChild(l.createComment(O));return;case 5:var h=O,c=w,U$=E;if(l.appendChild(new EP(l,h,c,U$)),W$||h.toLowerCase()!=="html"||vP.test(c)||U$&&U$.toLowerCase()===hP||U$===void 0&&Dj.test(c))l._quirks=!0;else if(gP.test(c)||U$!==void 0&&Dj.test(c))l._limitedQuirks=!0;A=e3;return}l._quirks=!0,A=e3,A(B,O,w,E)}function e3(B,O,w,E){var h;switch(B){case 1:if(O=O.replace(e2,""),O.length===0)return;break;case 5:return;case 4:l._appendChild(l.createComment(O));return;case 2:if(O==="html"){h=sJ(l,O,w),S.push(h),l.appendChild(h),A=j9;return}break;case 3:switch(O){case"html":case"head":case"body":case"br":break;default:return}}h=sJ(l,"html",null),S.push(h),l.appendChild(h),A=j9,A(B,O,w,E)}function j9(B,O,w,E){switch(B){case 1:if(O=O.replace(e2,""),O.length===0)return;break;case 5:return;case 4:D1(O);return;case 2:switch(O){case"html":j$(B,O,w,E);return;case"head":var h=q$(O,w);A$=h,A=Q0;return}break;case 3:switch(O){case"html":case"head":case"body":case"br":break;default:return}}j9(N0,"head",null),A(B,O,w,E)}function Q0(B,O,w,E){switch(B){case 1:var h=O.match(e2);if(h)P1(h[0]),O=O.substring(h[0].length);if(O.length===0)return;break;case 4:D1(O);return;case 5:return;case 2:switch(O){case"html":j$(B,O,w,E);return;case"meta":case"base":case"basefont":case"bgsound":case"link":q$(O,w),S.pop();return;case"title":sB(O,w);return;case"noscript":if(!J$){q$(O,w),A=$K;return}case"noframes":case"style":$9(O,w);return;case"script":t8(function(c){var U$=sJ(c,O,w);if(U$._parser_inserted=!0,U$._force_async=!1,k)U$._already_started=!0;return VJ(),U$}),U=Z2,u=A,A=U9;return;case"template":q$(O,w),T.insertMarker(),Z$=!1,A=g6,r.push(A);return;case"head":return}break;case 3:switch(O){case"head":S.pop(),A=v6;return;case"body":case"html":case"br":break;case"template":if(!S.contains("template"))return;S.generateImpliedEndTags(null,"thorough"),S.popTag("template"),T.clearToMarker(),r.pop(),nJ();return;default:return}break}Q0(N$,"head",null),A(B,O,w,E)}function $K(B,O,w,E){switch(B){case 5:return;case 4:Q0(B,O);return;case 1:var h=O.match(e2);if(h)Q0(B,h[0]),O=O.substring(h[0].length);if(O.length===0)return;break;case 2:switch(O){case"html":j$(B,O,w,E);return;case"basefont":case"bgsound":case"link":case"meta":case"noframes":case"style":Q0(B,O,w);return;case"head":case"noscript":return}break;case 3:switch(O){case"noscript":S.pop(),A=Q0;return;case"br":break;default:return}break}$K(N$,"noscript",null),A(B,O,w,E)}function v6(B,O,w,E){switch(B){case 1:var h=O.match(e2);if(h)P1(h[0]),O=O.substring(h[0].length);if(O.length===0)return;break;case 4:D1(O);return;case 5:return;case 2:switch(O){case"html":j$(B,O,w,E);return;case"body":q$(O,w),Z$=!1,A=j$;return;case"frameset":q$(O,w),A=f6;return;case"base":case"basefont":case"bgsound":case"link":case"meta":case"noframes":case"script":case"style":case"template":case"title":S.push(A$),Q0(N0,O,w),S.removeElement(A$);return;case"head":return}break;case 3:switch(O){case"template":return Q0(B,O,w,E);case"body":case"html":case"br":break;default:return}break}v6(N0,"body",null),Z$=!0,A(B,O,w,E)}function j$(B,O,w,E){var h,c,U$,w$;switch(B){case 1:if(n){if(O=O.replace(G6,""),O.length===0)return}if(Z$&&V6.test(O))Z$=!1;k0(),P1(O);return;case 5:return;case 4:D1(O);return;case-1:if(r.length)return g6(B);M2();return;case 2:switch(O){case"html":if(S.contains("template"))return;xj(w,S.elements[0]);return;case"base":case"basefont":case"bgsound":case"link":case"meta":case"noframes":case"script":case"style":case"template":case"title":Q0(N0,O,w);return;case"body":if(h=S.elements[1],!h||!(h instanceof u$.HTMLBodyElement)||S.contains("template"))return;Z$=!1,xj(w,h);return;case"frameset":if(!Z$)return;if(h=S.elements[1],!h||!(h instanceof u$.HTMLBodyElement))return;if(h.parentNode)h.parentNode.removeChild(h);while(!(S.top instanceof u$.HTMLHtmlElement))S.pop();q$(O,w),A=f6;return;case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"nav":case"ol":case"p":case"section":case"summary":case"ul":if(S.inButtonScope("p"))j$(N$,"p");q$(O,w);return;case"menu":if(S.inButtonScope("p"))j$(N$,"p");if(d$(S.top,"menuitem"))S.pop();q$(O,w);return;case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":if(S.inButtonScope("p"))j$(N$,"p");if(S.top instanceof u$.HTMLHeadingElement)S.pop();q$(O,w);return;case"pre":case"listing":if(S.inButtonScope("p"))j$(N$,"p");q$(O,w),a=!0,Z$=!1;return;case"form":if(s&&!S.contains("template"))return;if(S.inButtonScope("p"))j$(N$,"p");if(w$=q$(O,w),!S.contains("template"))s=w$;return;case"li":Z$=!1;for(c=S.elements.length-1;c>=0;c--){if(U$=S.elements[c],U$ instanceof u$.HTMLLIElement){j$(N$,"li");break}if(d$(U$,$J)&&!d$(U$,K3))break}if(S.inButtonScope("p"))j$(N$,"p");q$(O,w);return;case"dd":case"dt":Z$=!1;for(c=S.elements.length-1;c>=0;c--){if(U$=S.elements[c],d$(U$,vj)){j$(N$,U$.localName);break}if(d$(U$,$J)&&!d$(U$,K3))break}if(S.inButtonScope("p"))j$(N$,"p");q$(O,w);return;case"plaintext":if(S.inButtonScope("p"))j$(N$,"p");q$(O,w),U=L6;return;case"button":if(S.inScope("button"))j$(N$,"button"),A(B,O,w,E);else k0(),q$(O,w),Z$=!1;return;case"a":var J0=T.findElementByTag("a");if(J0)j$(N$,O),T.remove(J0),S.removeElement(J0);case"b":case"big":case"code":case"em":case"font":case"i":case"s":case"small":case"strike":case"strong":case"tt":case"u":k0(),T.push(q$(O,w),w);return;case"nobr":if(k0(),S.inScope(O))j$(N$,O),k0();T.push(q$(O,w),w);return;case"applet":case"marquee":case"object":k0(),q$(O,w),T.insertMarker(),Z$=!1;return;case"table":if(!l._quirks&&S.inButtonScope("p"))j$(N$,"p");q$(O,w),Z$=!1,A=s0;return;case"area":case"br":case"embed":case"img":case"keygen":case"wbr":k0(),q$(O,w),S.pop(),Z$=!1;return;case"input":k0(),w$=q$(O,w),S.pop();var M0=w$.getAttribute("type");if(!M0||M0.toLowerCase()!=="hidden")Z$=!1;return;case"param":case"source":case"track":q$(O,w),S.pop();return;case"hr":if(S.inButtonScope("p"))j$(N$,"p");if(d$(S.top,"menuitem"))S.pop();q$(O,w),S.pop(),Z$=!1;return;case"image":j$(N0,"img",w,E);return;case"textarea":q$(O,w),a=!0,Z$=!1,U=J2,u=A,A=U9;return;case"xmp":if(S.inButtonScope("p"))j$(N$,"p");k0(),Z$=!1,$9(O,w);return;case"iframe":Z$=!1,$9(O,w);return;case"noembed":$9(O,w);return;case"select":if(k0(),q$(O,w),Z$=!1,A===s0||A===h6||A===I2||A===eJ||A===GJ)A=H9;else A=E1;return;case"optgroup":case"option":if(S.top instanceof u$.HTMLOptionElement)j$(N$,"option");k0(),q$(O,w);return;case"menuitem":if(d$(S.top,"menuitem"))S.pop();k0(),q$(O,w);return;case"rb":case"rtc":if(S.inScope("ruby"))S.generateImpliedEndTags();q$(O,w);return;case"rp":case"rt":if(S.inScope("ruby"))S.generateImpliedEndTags("rtc");q$(O,w);return;case"math":if(k0(),Ej(w),Y3(w),w6(O,w,X$.MATHML),E)S.pop();return;case"svg":if(k0(),kj(w),Y3(w),w6(O,w,X$.SVG),E)S.pop();return;case"caption":case"col":case"colgroup":case"frame":case"head":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return}k0(),q$(O,w);return;case 3:switch(O){case"template":Q0(N$,O,w);return;case"body":if(!S.inScope("body"))return;A=JK;return;case"html":if(!S.inScope("body"))return;A=JK,A(B,O,w);return;case"address":case"article":case"aside":case"blockquote":case"button":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"listing":case"main":case"menu":case"nav":case"ol":case"pre":case"section":case"summary":case"ul":if(!S.inScope(O))return;S.generateImpliedEndTags(),S.popTag(O);return;case"form":if(!S.contains("template")){var n0=s;if(s=null,!n0||!S.elementInScope(n0))return;S.generateImpliedEndTags(),S.removeElement(n0)}else{if(!S.inScope("form"))return;S.generateImpliedEndTags(),S.popTag("form")}return;case"p":if(!S.inButtonScope(O))j$(N0,O,null),A(B,O,w,E);else S.generateImpliedEndTags(O),S.popTag(O);return;case"li":if(!S.inListItemScope(O))return;S.generateImpliedEndTags(O),S.popTag(O);return;case"dd":case"dt":if(!S.inScope(O))return;S.generateImpliedEndTags(O),S.popTag(O);return;case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":if(!S.elementTypeInScope(u$.HTMLHeadingElement))return;S.generateImpliedEndTags(),S.popElementType(u$.HTMLHeadingElement);return;case"sarcasm":break;case"a":case"b":case"big":case"code":case"em":case"font":case"i":case"nobr":case"s":case"small":case"strike":case"strong":case"tt":case"u":var X1=nB(O);if(X1)return;break;case"applet":case"marquee":case"object":if(!S.inScope(O))return;S.generateImpliedEndTags(),S.popTag(O),T.clearToMarker();return;case"br":j$(N0,O,null);return}for(c=S.elements.length-1;c>=0;c--)if(U$=S.elements[c],d$(U$,O)){S.generateImpliedEndTags(O),S.popElement(U$);break}else if(d$(U$,$J))return;return}}function U9(B,O,w,E){switch(B){case 1:P1(O);return;case-1:if(S.top instanceof u$.HTMLScriptElement)S.top._already_started=!0;S.pop(),A=u,A(B);return;case 3:if(O==="script")aB();else S.pop(),A=u;return;default:return}}function s0(B,O,w,E){function h(U$){for(var w$=0,J0=U$.length;w$<J0;w$++)if(U$[w$][0]==="type")return U$[w$][1].toLowerCase();return null}switch(B){case 1:if(Q$){j$(B,O,w,E);return}else if(d$(S.top,lJ)){y$=[],u=A,A=mH,A(B,O,w,E);return}break;case 4:D1(O);return;case 5:return;case 2:switch(O){case"caption":S.clearToContext(X6),T.insertMarker(),q$(O,w),A=h6;return;case"colgroup":S.clearToContext(X6),q$(O,w),A=B9;return;case"col":s0(N0,"colgroup",null),A(B,O,w,E);return;case"tbody":case"tfoot":case"thead":S.clearToContext(X6),q$(O,w),A=I2;return;case"td":case"th":case"tr":s0(N0,"tbody",null),A(B,O,w,E);return;case"table":if(!S.inTableScope(O))return;s0(N$,O),A(B,O,w,E);return;case"style":case"script":case"template":Q0(B,O,w,E);return;case"input":var c=h(w);if(c!=="hidden")break;q$(O,w),S.pop();return;case"form":if(s||S.contains("template"))return;s=q$(O,w),S.popElement(s);return}break;case 3:switch(O){case"table":if(!S.inTableScope(O))return;S.popTag(O),nJ();return;case"body":case"caption":case"col":case"colgroup":case"html":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return;case"template":Q0(B,O,w,E);return}break;case-1:j$(B,O,w,E);return}$2=!0,j$(B,O,w,E),$2=!1}function mH(B,O,w,E){if(B===cJ){if(n){if(O=O.replace(G6,""),O.length===0)return}y$.push(O)}else{var h=y$.join("");if(y$.length=0,V6.test(h))$2=!0,j$(cJ,h),$2=!1;else P1(h);A=u,A(B,O,w,E)}}function h6(B,O,w,E){function h(){if(!S.inTableScope("caption"))return!1;return S.generateImpliedEndTags(),S.popTag("caption"),T.clearToMarker(),A=s0,!0}switch(B){case 2:switch(O){case"caption":case"col":case"colgroup":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":if(h())A(B,O,w,E);return}break;case 3:switch(O){case"caption":h();return;case"table":if(h())A(B,O,w,E);return;case"body":case"col":case"colgroup":case"html":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return}break}j$(B,O,w,E)}function B9(B,O,w,E){switch(B){case 1:var h=O.match(e2);if(h)P1(h[0]),O=O.substring(h[0].length);if(O.length===0)return;break;case 4:D1(O);return;case 5:return;case 2:switch(O){case"html":j$(B,O,w,E);return;case"col":q$(O,w),S.pop();return;case"template":Q0(B,O,w,E);return}break;case 3:switch(O){case"colgroup":if(!d$(S.top,"colgroup"))return;S.pop(),A=s0;return;case"col":return;case"template":Q0(B,O,w,E);return}break;case-1:j$(B,O,w,E);return}if(!d$(S.top,"colgroup"))return;B9(N$,"colgroup"),A(B,O,w,E)}function I2(B,O,w,E){function h(){if(!S.inTableScope("tbody")&&!S.inTableScope("thead")&&!S.inTableScope("tfoot"))return;S.clearToContext(W6),I2(N$,S.top.localName,null),A(B,O,w,E)}switch(B){case 2:switch(O){case"tr":S.clearToContext(W6),q$(O,w),A=eJ;return;case"th":case"td":I2(N0,"tr",null),A(B,O,w,E);return;case"caption":case"col":case"colgroup":case"tbody":case"tfoot":case"thead":h();return}break;case 3:switch(O){case"table":h();return;case"tbody":case"tfoot":case"thead":if(S.inTableScope(O))S.clearToContext(W6),S.pop(),A=s0;return;case"body":case"caption":case"col":case"colgroup":case"html":case"td":case"th":case"tr":return}break}s0(B,O,w,E)}function eJ(B,O,w,E){function h(){if(!S.inTableScope("tr"))return!1;return S.clearToContext(Q3),S.pop(),A=I2,!0}switch(B){case 2:switch(O){case"th":case"td":S.clearToContext(Q3),q$(O,w),A=GJ,T.insertMarker();return;case"caption":case"col":case"colgroup":case"tbody":case"tfoot":case"thead":case"tr":if(h())A(B,O,w,E);return}break;case 3:switch(O){case"tr":h();return;case"table":if(h())A(B,O,w,E);return;case"tbody":case"tfoot":case"thead":if(S.inTableScope(O)){if(h())A(B,O,w,E)}return;case"body":case"caption":case"col":case"colgroup":case"html":case"td":case"th":return}break}s0(B,O,w,E)}function GJ(B,O,w,E){switch(B){case 2:switch(O){case"caption":case"col":case"colgroup":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":if(S.inTableScope("td"))GJ(N$,"td"),A(B,O,w,E);else if(S.inTableScope("th"))GJ(N$,"th"),A(B,O,w,E);return}break;case 3:switch(O){case"td":case"th":if(!S.inTableScope(O))return;S.generateImpliedEndTags(),S.popTag(O),T.clearToMarker(),A=eJ;return;case"body":case"caption":case"col":case"colgroup":case"html":return;case"table":case"tbody":case"tfoot":case"thead":case"tr":if(!S.inTableScope(O))return;GJ(N$,S.inTableScope("td")?"td":"th"),A(B,O,w,E);return}break}j$(B,O,w,E)}function E1(B,O,w,E){switch(B){case 1:if(n){if(O=O.replace(G6,""),O.length===0)return}P1(O);return;case 4:D1(O);return;case 5:return;case-1:j$(B,O,w,E);return;case 2:switch(O){case"html":j$(B,O,w,E);return;case"option":if(S.top instanceof u$.HTMLOptionElement)E1(N$,O);q$(O,w);return;case"optgroup":if(S.top instanceof u$.HTMLOptionElement)E1(N$,"option");if(S.top instanceof u$.HTMLOptGroupElement)E1(N$,O);q$(O,w);return;case"select":E1(N$,O);return;case"input":case"keygen":case"textarea":if(!S.inSelectScope("select"))return;E1(N$,"select"),A(B,O,w,E);return;case"script":case"template":Q0(B,O,w,E);return}break;case 3:switch(O){case"optgroup":if(S.top instanceof u$.HTMLOptionElement&&S.elements[S.elements.length-2]instanceof u$.HTMLOptGroupElement)E1(N$,"option");if(S.top instanceof u$.HTMLOptGroupElement)S.pop();return;case"option":if(S.top instanceof u$.HTMLOptionElement)S.pop();return;case"select":if(!S.inSelectScope(O))return;S.popTag(O),nJ();return;case"template":Q0(B,O,w,E);return}break}}function H9(B,O,w,E){switch(O){case"caption":case"table":case"tbody":case"tfoot":case"thead":case"tr":case"td":case"th":switch(B){case 2:H9(N$,"select"),A(B,O,w,E);return;case 3:if(S.inTableScope(O))H9(N$,"select"),A(B,O,w,E);return}}E1(B,O,w,E)}function g6(B,O,w,E){function h(c){A=c,r[r.length-1]=A,A(B,O,w,E)}switch(B){case 1:case 4:case 5:j$(B,O,w,E);return;case-1:if(!S.contains("template"))M2();else S.popTag("template"),T.clearToMarker(),r.pop(),nJ(),A(B,O,w,E);return;case 2:switch(O){case"base":case"basefont":case"bgsound":case"link":case"meta":case"noframes":case"script":case"style":case"template":case"title":Q0(B,O,w,E);return;case"caption":case"colgroup":case"tbody":case"tfoot":case"thead":h(s0);return;case"col":h(B9);return;case"tr":h(I2);return;case"td":case"th":h(eJ);return}h(j$);return;case 3:switch(O){case"template":Q0(B,O,w,E);return;default:return}}}function JK(B,O,w,E){switch(B){case 1:if(V6.test(O))break;j$(B,O);return;case 4:S.elements[0]._appendChild(l.createComment(O));return;case 5:return;case-1:M2();return;case 2:if(O==="html"){j$(B,O,w,E);return}break;case 3:if(O==="html"){if(k)return;A=dH;return}break}A=j$,A(B,O,w,E)}function f6(B,O,w,E){switch(B){case 1:if(O=O.replace(Z3,""),O.length>0)P1(O);return;case 4:D1(O);return;case 5:return;case-1:M2();return;case 2:switch(O){case"html":j$(B,O,w,E);return;case"frameset":q$(O,w);return;case"frame":q$(O,w),S.pop();return;case"noframes":Q0(B,O,w,E);return}break;case 3:if(O==="frameset"){if(k&&S.top instanceof u$.HTMLHtmlElement)return;if(S.pop(),!k&&!(S.top instanceof u$.HTMLFrameSetElement))A=uH;return}break}}function uH(B,O,w,E){switch(B){case 1:if(O=O.replace(Z3,""),O.length>0)P1(O);return;case 4:D1(O);return;case 5:return;case-1:M2();return;case 2:switch(O){case"html":j$(B,O,w,E);return;case"noframes":Q0(B,O,w,E);return}break;case 3:if(O==="html"){A=pH;return}break}}function dH(B,O,w,E){switch(B){case 1:if(V6.test(O))break;j$(B,O,w,E);return;case 4:l._appendChild(l.createComment(O));return;case 5:j$(B,O,w,E);return;case-1:M2();return;case 2:if(O==="html"){j$(B,O,w,E);return}break}A=j$,A(B,O,w,E)}function pH(B,O,w,E){switch(B){case 1:if(O=O.replace(Z3,""),O.length>0)j$(B,O,w,E);return;case 4:l._appendChild(l.createComment(O));return;case 5:j$(B,O,w,E);return;case-1:M2();return;case 2:switch(O){case"html":j$(B,O,w,E);return;case"noframes":Q0(B,O,w,E);return}break}}function ZK(B,O,w,E){function h(J0){for(var M0=0,n0=J0.length;M0<n0;M0++)switch(J0[M0][0]){case"color":case"face":case"size":return!0}return!1}var c;switch(B){case 1:if(Z$&&nP.test(O))Z$=!1;if(n)O=O.replace(G6,"\uFFFD");P1(O);return;case 4:D1(O);return;case 5:return;case 2:switch(O){case"font":if(!h(w))break;case"b":case"big":case"blockquote":case"body":case"br":case"center":case"code":case"dd":case"div":case"dl":case"dt":case"em":case"embed":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"head":case"hr":case"i":case"img":case"li":case"listing":case"menu":case"meta":case"nobr":case"ol":case"p":case"pre":case"ruby":case"s":case"small":case"span":case"strong":case"strike":case"sub":case"sup":case"table":case"tt":case"u":case"ul":case"var":if(k)break;do S.pop(),c=S.top;while(c.namespaceURI!==X$.HTML&&!yj(c)&&!Tj(c));j0(B,O,w,E);return}if(c=S.elements.length===1&&k?J:S.top,c.namespaceURI===X$.MATHML)Ej(w);else if(c.namespaceURI===X$.SVG)O=tP(O),kj(w);if(Y3(w),w6(O,w,c.namespaceURI),E){if(O==="script"&&c.namespaceURI===X$.SVG);S.pop()}return;case 3:if(c=S.top,O==="script"&&c.namespaceURI===X$.SVG&&c.localName==="script")S.pop();else{var U$=S.elements.length-1,w$=S.elements[U$];for(;;){if(w$.localName.toLowerCase()===O){S.popElement(w$);break}if(w$=S.elements[--U$],w$.namespaceURI!==X$.HTML)continue;A(B,O,w,E);break}}return}}return c$.testTokenizer=function(B,O,w,E){var h=[];switch(O){case"PCDATA state":U=S$;break;case"RCDATA state":U=J2;break;case"RAWTEXT state":U=aJ;break;case"PLAINTEXT state":U=L6;break}if(w)C=w;if(j0=function(U$,w$,J0,M0){switch(VJ(),U$){case 1:if(h.length>0&&h[h.length-1][0]==="Character")h[h.length-1][1]+=w$;else h.push(["Character",w$]);break;case 4:h.push(["Comment",w$]);break;case 5:h.push(["DOCTYPE",w$,J0===void 0?null:J0,M0===void 0?null:M0,!W$]);break;case 2:var n0=Object.create(null);for(var X1=0;X1<J0.length;X1++){var A2=J0[X1];if(A2.length===1)n0[A2[0]]="";else n0[A2[0]]=A2[1]}var V2=["StartTag",w$,n0];if(M0)V2.push(!0);h.push(V2);break;case 3:h.push(["EndTag",w$]);break;case-1:break}},!E)this.parse(B,!0);else{for(var c=0;c<B.length;c++)this.parse(B[c]);this.parse("",!0)}return h},c$}});var m8=p((Xv,rj)=>{rj.exports=oj;var cj=Z6(),lj=K6(),eP=U6(),B6=X0(),$I=uZ();function oj($){this.contextObject=$}var JI={xml:{"":!0,"1.0":!0,"2.0":!0},core:{"":!0,"2.0":!0},html:{"":!0,"1.0":!0,"2.0":!0},xhtml:{"":!0,"1.0":!0,"2.0":!0}};oj.prototype={hasFeature:function(J,Z){var Y=JI[(J||"").toLowerCase()];return Y&&Y[Z||""]||!1},createDocumentType:function(J,Z,Y){if(!$I.isValidQName(J))B6.InvalidCharacterError();return new lj(this.contextObject,J,Z,Y)},createDocument:function(J,Z,Y){var K=new cj(!1,null),Q;if(Z)Q=K.createElementNS(J,Z);else Q=null;if(Y)K.appendChild(Y);if(Q)K.appendChild(Q);if(J===B6.NAMESPACE.HTML)K._contentType="application/xhtml+xml";else if(J===B6.NAMESPACE.SVG)K._contentType="image/svg+xml";else K._contentType="application/xml";return K},createHTMLDocument:function(J){var Z=new cj(!0,null);Z.appendChild(new lj(Z,"html"));var Y=Z.createElement("html");Z.appendChild(Y);var K=Z.createElement("head");if(Y.appendChild(K),J!==void 0){var Q=Z.createElement("title");K.appendChild(Q),Q.appendChild(Z.createTextNode(J))}return Y.appendChild(Z.createElement("body")),Z.modclock=1,Z},mozSetOutputMutationHandler:function($,J){$.mutationHandler=J},mozGetInputMutationHandler:function($){B6.nyi()},mozHTMLParser:eP}});var sj=p((Wv,ij)=>{var ZI=aZ(),YI=rY();ij.exports=G3;function G3($,J){this._window=$,this._href=J}G3.prototype=Object.create(YI.prototype,{constructor:{value:G3},href:{get:function(){return this._href},set:function($){this.assign($)}},assign:{value:function($){var J=new ZI(this._href),Z=J.resolve($);this._href=Z}},replace:{value:function($){this.assign($)}},reload:{value:function(){this.assign(this.href)}},toString:{value:function(){return this.href}}})});var aj=p((jv,nj)=>{var KI=Object.create(null,{appCodeName:{value:"Mozilla"},appName:{value:"Netscape"},appVersion:{value:"4.0"},platform:{value:""},product:{value:"Gecko"},productSub:{value:"20100101"},userAgent:{value:""},vendor:{value:""},vendorSub:{value:""},taintEnabled:{value:function(){return!1}}});nj.exports=KI});var ej=p((Uv,tj)=>{var QI={setTimeout,clearTimeout,setInterval,clearInterval};tj.exports=QI});var W3=p((u8,$U)=>{var X3=X0();u8=$U.exports={CSSStyleDeclaration:tZ(),CharacterData:T8(),Comment:EY(),DOMException:vZ(),DOMImplementation:m8(),DOMTokenList:qY(),Document:Z6(),DocumentFragment:bY(),DocumentType:K6(),Element:gJ(),HTMLParser:U6(),NamedNodeMap:PY(),Node:P0(),NodeList:n2(),NodeFilter:b8(),ProcessingInstruction:hY(),Text:TY(),Window:j3()};X3.merge(u8,oY());X3.merge(u8,$6().elements);X3.merge(u8,tY().elements)});var j3=p((Bv,JU)=>{var VI=m8(),GI=$Y(),XI=sj(),d8=X0();JU.exports=H6;function H6($){this.document=$||new VI(null).createHTMLDocument(""),this.document._scripting_enabled=!0,this.document.defaultView=this,this.location=new XI(this,this.document._address||"about:blank")}H6.prototype=Object.create(GI.prototype,{console:{value:console},history:{value:{back:d8.nyi,forward:d8.nyi,go:d8.nyi}},navigator:{value:aj()},window:{get:function(){return this}},self:{get:function(){return this}},frames:{get:function(){return this}},parent:{get:function(){return this}},top:{get:function(){return this}},length:{value:0},frameElement:{value:null},opener:{value:null},onload:{get:function(){return this._getEventHandler("load")},set:function($){this._setEventHandler("load",$)}},getComputedStyle:{value:function(J){return J.style}}});d8.expose(ej(),H6);d8.expose(W3(),H6)});var VU=p((WI)=>{var ZU=m8(),YU=U6(),Hv=j3(),KU=W3();WI.createDOMImplementation=function(){return new ZU(null)};WI.createDocument=function($,J){if($||J){var Z=new YU;return Z.parse($||"",!0),Z.document()}return new ZU(null).createHTMLDocument("")};WI.createIncrementalHTMLParser=function(){var $=new YU;return{write:function(J){if(J.length>0)$.parse(J,!1,function(){return!0})},end:function(J){$.parse(J||"",!0,function(){return!0})},process:function(J){return $.parse("",!1,J)},document:function(){return $.document()}}};WI.createWindow=function($,J){var Z=WI.createDocument($);if(J!==void 0)Z._address=J;return new KU.Window(Z)};WI.impl=KU});var W1={};o$(W1,{layer:()=>GK,defaultLayer:()=>z_,Status:()=>F_,Service:()=>q9,Format:()=>W1});import q_ from"path";var O9={};o$(O9,{zig:()=>nH,uvformat:()=>$_,terraform:()=>V_,standardrb:()=>Z_,shfmt:()=>W_,rustfmt:()=>U_,ruff:()=>QK,rubocop:()=>J_,rlang:()=>eH,prettier:()=>rH,pint:()=>B_,oxfmt:()=>iH,ormolu:()=>H_,ocamlformat:()=>Q_,nixfmt:()=>j_,mix:()=>oH,latexindent:()=>G_,ktlint:()=>tH,htmlbeautifier:()=>Y_,gofmt:()=>lH,gleam:()=>X_,dfmt:()=>O_,dart:()=>K_,cljfmt:()=>__,clang:()=>aH,biome:()=>sH});var lH={name:"gofmt",extensions:[".go"],async enabled(){let $=x$("gofmt");if(!$)return!1;return[$,"-w","$FILE"]}},oH={name:"mix",extensions:[".ex",".exs",".eex",".heex",".leex",".neex",".sface"],async enabled(){let $=x$("mix");if(!$)return!1;return[$,"format","$FILE"]}},YK=[".js",".jsx",".mjs",".cjs",".ts",".tsx",".mts",".cts",".html",".htm",".css",".scss",".sass",".less",".vue",".svelte",".json",".jsonc",".yaml",".yml",".toml",".xml",".md",".mdx",".graphql",".gql"];async function KK($,J){let Z=await O0.findUp("package.json",$.directory,$.worktree);for(let Y of Z){let K=await O0.readJson(Y);if(K.dependencies?.[J]||K.devDependencies?.[J]){let Q=await m6.which(J);if(Q)return Q}}return}var rH={name:"prettier",environment:{BUN_BE_BUN:"1"},extensions:[...YK],async enabled($){let J=await KK($,"prettier");return J?[J,"--write","$FILE"]:!1}},iH={name:"oxfmt",environment:{BUN_BE_BUN:"1"},extensions:[".js",".jsx",".mjs",".cjs",".ts",".tsx",".mts",".cts"],async enabled($){if(!k$.QITQODE_EXPERIMENTAL_OXFMT)return!1;let J=await KK($,"oxfmt");return J?[J,"$FILE"]:!1}},sH={name:"biome",environment:{BUN_BE_BUN:"1"},extensions:[...YK],async enabled($){let J=["biome.json","biome.jsonc"];for(let Z of J)if((await O0.findUp(Z,$.directory,$.worktree)).length>0){let K=await m6.which("@biomejs/biome");if(K)return[K,"format","--write","$FILE"]}return!1}},nH={name:"zig",extensions:[".zig",".zon"],async enabled(){let $=x$("zig");if(!$)return!1;return[$,"fmt","$FILE"]}},aH={name:"clang-format",extensions:[".c",".cc",".cpp",".cxx",".c++",".h",".hh",".hpp",".hxx",".h++",".ino",".C",".H"],async enabled($){if((await O0.findUp(".clang-format",$.directory,$.worktree)).length>0){let Z=x$("clang-format");if(Z)return[Z,"-i","$FILE"]}return!1}},tH={name:"ktlint",extensions:[".kt",".kts"],async enabled(){let $=x$("ktlint");if(!$)return!1;return[$,"-F","$FILE"]}},QK={name:"ruff",extensions:[".py",".pyi"],async enabled($){if(!x$("ruff"))return!1;let J=["pyproject.toml","ruff.toml",".ruff.toml"];for(let Y of J){let K=await O0.findUp(Y,$.directory,$.worktree);if(K.length>0)if(Y==="pyproject.toml"){if((await O0.readText(K[0])).includes("[tool.ruff]"))return["ruff","format","$FILE"]}else return["ruff","format","$FILE"]}let Z=["requirements.txt","pyproject.toml","Pipfile"];for(let Y of Z){let K=await O0.findUp(Y,$.directory,$.worktree);if(K.length>0){if((await O0.readText(K[0])).includes("ruff"))return["ruff","format","$FILE"]}}return!1}},eH={name:"air",extensions:[".R"],async enabled(){let $=x$("air");if($==null)return!1;let J=await _9.text([$,"--help"],{nothrow:!0}),Z=J.text.split(`
37
- `)[0],Y=Z.includes("R language"),K=Z.includes("formatter");if(J.code===0&&Y&&K)return[$,"format","$FILE"];return!1}},$_={name:"uv",extensions:[".py",".pyi"],async enabled($){if(await QK.enabled($))return!1;let J=x$("uv");if(J==null)return!1;if((await _9.run([J,"format","--help"],{nothrow:!0})).code===0)return[J,"format","--","$FILE"];return!1}},J_={name:"rubocop",extensions:[".rb",".rake",".gemspec",".ru"],async enabled(){let $=x$("rubocop");if(!$)return!1;return[$,"--autocorrect","$FILE"]}},Z_={name:"standardrb",extensions:[".rb",".rake",".gemspec",".ru"],async enabled(){let $=x$("standardrb");if(!$)return!1;return[$,"--fix","$FILE"]}},Y_={name:"htmlbeautifier",extensions:[".erb",".html.erb"],async enabled(){let $=x$("htmlbeautifier");if(!$)return!1;return[$,"$FILE"]}},K_={name:"dart",extensions:[".dart"],async enabled(){let $=x$("dart");if(!$)return!1;return[$,"format","$FILE"]}},Q_={name:"ocamlformat",extensions:[".ml",".mli"],async enabled($){if(!x$("ocamlformat"))return!1;if((await O0.findUp(".ocamlformat",$.directory,$.worktree)).length>0)return["ocamlformat","-i","$FILE"];return!1}},V_={name:"terraform",extensions:[".tf",".tfvars"],async enabled(){let $=x$("terraform");if(!$)return!1;return[$,"fmt","$FILE"]}},G_={name:"latexindent",extensions:[".tex"],async enabled(){let $=x$("latexindent");if(!$)return!1;return[$,"-w","-s","$FILE"]}},X_={name:"gleam",extensions:[".gleam"],async enabled(){let $=x$("gleam");if(!$)return!1;return[$,"format","$FILE"]}},W_={name:"shfmt",extensions:[".sh",".bash"],async enabled(){let $=x$("shfmt");if(!$)return!1;return[$,"-w","$FILE"]}},j_={name:"nixfmt",extensions:[".nix"],async enabled(){let $=x$("nixfmt");if(!$)return!1;return[$,"$FILE"]}},U_={name:"rustfmt",extensions:[".rs"],async enabled(){let $=x$("rustfmt");if(!$)return!1;return[$,"$FILE"]}},B_={name:"pint",extensions:[".php"],async enabled($){let J=await O0.findUp("composer.json",$.directory,$.worktree);for(let Z of J){let Y=await O0.readJson(Z);if(Y.require?.["laravel/pint"]||Y["require-dev"]?.["laravel/pint"])return["./vendor/bin/pint","$FILE"]}return!1}},H_={name:"ormolu",extensions:[".hs"],async enabled(){let $=x$("ormolu");if(!$)return!1;return[$,"-i","$FILE"]}},__={name:"cljfmt",extensions:[".clj",".cljs",".cljc",".edn"],async enabled(){let $=x$("cljfmt");if(!$)return!1;return[$,"fix","--quiet","$FILE"]}},O_={name:"dfmt",extensions:[".d"],async enabled(){let $=x$("dfmt");if(!$)return!1;return[$,"-i","$FILE"]}};var x1=O$.create({service:"format"}),F_=F.object({name:F.string(),extensions:F.string().array(),enabled:F.boolean()}).meta({ref:"FormatterStatus"});class q9 extends D$.Service()("@qitqode/Format"){}var GK=f.effect(q9,G.gen(function*(){let $=yield*R$.Service,J=yield*u6.ChildProcessSpawner,Z=yield*i.make(G.fn("Format.state")(function*(V){let X={},W={};async function _(z){let M=X[z.name];if(M===!1||M===void 0)M=await z.enabled(V),X[z.name]=M;return M}async function j(z){return await _(z)!==!1}async function H(z){let M=Object.values(W).filter((C)=>C.extensions.includes(z));return(await Promise.all(M.map(async(C)=>{x1.info("checking",{name:C.name,ext:z});let P=await _(C);if(P)x1.info("enabled",{name:C.name,ext:z});return{item:C,cmd:P}}))).filter((C)=>C.cmd).map((C)=>({item:C.item,cmd:C.cmd}))}function q(z){return G.gen(function*(){x1.info("formatting",{file:z});let M=q_.extname(z);for(let{item:I,cmd:C}of yield*G.promise(()=>H(M))){if(C===!1)continue;x1.info("running",{command:C});let P=C.map((R)=>R.replace("$FILE",z)),D=yield*i.directory;if((yield*J.spawn(S1.make(P[0],P.slice(1),{cwd:D,env:I.environment,extendEnv:!0})).pipe(G.flatMap((R)=>R.exitCode),G.scoped,G.catch(()=>G.sync(()=>{return x1.error("failed to format file",{error:"spawn failed",command:C,...I.environment,file:z}),u6.ExitCode(1)}))))!==0)x1.error("failed",{command:C,...I.environment})}})}let U=yield*$.get();if(!U.formatter)return x1.info("all formatters are disabled"),x1.info("init"),{formatters:W,isEnabled:j,formatFile:q};for(let z of Object.values(O9))W[z.name]=z;if(U.formatter!==!0)for(let[z,M]of Object.entries(U.formatter)){let I=O9[z];if(["ruff","uv"].includes(z)&&(U.formatter.ruff?.disabled||U.formatter.uv?.disabled)){delete W.ruff,delete W.uv;continue}if(M.disabled){delete W[z];continue}let C=F9(I??{extensions:[]},M);W[z]={...C,name:z,extensions:C.extensions??[],enabled:I&&!C.command?I.enabled:async(P)=>C.command??!1}}return x1.info("init"),{formatters:W,isEnabled:j,formatFile:q}})),Y=G.fn("Format.init")(function*(){yield*i.get(Z)}),K=G.fn("Format.status")(function*(){let{formatters:V,isEnabled:X}=yield*i.get(Z),W=[];for(let _ of Object.values(V)){let j=yield*G.promise(()=>X(_));W.push({name:_.name,extensions:_.extensions,enabled:j})}return W}),Q=G.fn("Format.file")(function*(V){let{formatFile:X}=yield*i.get(Z);yield*X(V)});return q9.of({init:Y,status:K,file:Q})})),z_=GK.pipe(f.provide(R$.defaultLayer),f.provide(XJ));var h0={};o$(h0,{layer:()=>qK,defaultLayer:()=>y_,Service:()=>C9,Ripgrep:()=>h0,Match:()=>_K});import J8 from"path";var XK=O$.create({service:"ripgrep"}),d6="15.1.0",C_={"arm64-darwin":{platform:"aarch64-apple-darwin",extension:"tar.gz"},"arm64-linux":{platform:"aarch64-unknown-linux-gnu",extension:"tar.gz"},"x64-darwin":{platform:"x86_64-apple-darwin",extension:"tar.gz"},"x64-linux":{platform:"x86_64-unknown-linux-musl",extension:"tar.gz"},"arm64-win32":{platform:"aarch64-pc-windows-msvc",extension:"zip"},"ia32-win32":{platform:"i686-pc-windows-msvc",extension:"zip"},"x64-win32":{platform:"x86_64-pc-windows-msvc",extension:"zip"}},HK=F.object({elapsed:F.object({secs:F.number(),nanos:F.number(),human:F.string()}),searches:F.number(),searches_with_match:F.number(),bytes_searched:F.number(),bytes_printed:F.number(),matched_lines:F.number(),matches:F.number()}),M_=F.object({type:F.literal("begin"),data:F.object({path:F.object({text:F.string()})})}),_K=F.object({type:F.literal("match"),data:F.object({path:F.object({text:F.string()}),lines:F.object({text:F.string()}),line_number:F.number(),absolute_offset:F.number(),submatches:F.array(F.object({match:F.object({text:F.string()}),start:F.number(),end:F.number()}))})}),D_=F.object({type:F.literal("end"),data:F.object({path:F.object({text:F.string()}),binary_offset:F.number().nullable(),stats:HK})}),P_=F.object({type:F.literal("summary"),data:F.object({elapsed_total:F.object({human:F.string(),nanos:F.number(),secs:F.number()}),stats:HK})}),I_=F.union([M_,_K,D_,P_]);class C9 extends D$.Service()("@qitqode/Ripgrep"){}function A_(){let $=BK();return delete $.RIPGREP_CONFIG_PATH,$}function WK($){let J=$?.reason;if(J instanceof Error)return J;let Z=Error("Aborted");return Z.name="AbortError",Z}function S_($){if(!$)return G.never;if($.aborted)return G.fail(WK($));return G.callback((J)=>{let Z=()=>J(G.fail(WK($)));if($.addEventListener("abort",Z,{once:!0}),$.aborted)Z();return G.sync(()=>$.removeEventListener("abort",Z))})}function z9($,J){let Z=Error($.trim()||`ripgrep failed with code ${J}`);return Z.name="RipgrepError",Z}function OK($){return J8.normalize($.replace(/^\.[\\/]/,""))}function w_($){return{...$,path:{...$.path,text:OK($.path.text)}}}function R_($){return G.try({try:()=>I_.parse(JSON.parse($)),catch:(J)=>Error("invalid ripgrep output",{cause:J})})}function jK($,J){b1.failCauseUnsafe($,u0.fail(J))}function L_($){let J=["--no-config","--files","--glob=!.git/*"];if($.follow)J.push("--follow");if($.hidden!==!1)J.push("--hidden");if($.hidden===!1)J.push("--glob=!.*");if($.maxDepth!==void 0)J.push(`--max-depth=${$.maxDepth}`);if($.glob)for(let Z of $.glob)J.push(`--glob=${Z}`);return J.push("."),J}function N_($){let J=["--no-config","--json","--hidden","--glob=!.git/*","--no-messages"];if($.follow)J.push("--follow");if($.glob)for(let Z of $.glob)J.push(`--glob=${Z}`);if($.limit)J.push(`--max-count=${$.limit}`);return J.push("--",$.pattern,...$.file??["."]),J}function UK($,J){return J?$.pipe(G.raceFirst(S_(J))):$}var qK=f.effect(C9,G.gen(function*(){let $=yield*$$.Service,J=v1.filterStatusOk(yield*v1.HttpClient),Z=yield*M9,Y=G.fnUntraced(function*(H,q,U){let z=yield*Z.spawn(S1.make(H,q,{cwd:U?.cwd,extendEnv:!0,stdin:"ignore"})),[M,I,C]=yield*G.all([l$.mkString(l$.decodeText(z.stdout)),l$.mkString(l$.decodeText(z.stderr)),z.exitCode],{concurrency:"unbounded"});return{stdout:M,stderr:I,code:C}},G.scoped),K=G.fnUntraced(function*(H,q,U){let z=yield*$.makeTempDirectoryScoped({directory:f$.Path.bin,prefix:"ripgrep-"});if(q.extension==="zip"){let I=(yield*G.sync(()=>x$("powershell.exe")??x$("pwsh.exe")))??"powershell.exe",C=yield*Y(I,["-NoProfile","-NonInteractive","-Command",`$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -LiteralPath '${H.replaceAll("'","''")}' -DestinationPath '${z.replaceAll("'","''")}' -Force`]);if(C.code!==0)return yield*G.fail(z9(C.stderr||C.stdout,C.code))}if(q.extension==="tar.gz"){let I=yield*Y("tar",["-xzf",H,"-C",z]);if(I.code!==0)return yield*G.fail(z9(I.stderr||I.stdout,I.code))}let M=J8.join(z,`ripgrep-${d6}-${q.platform}`,process.platform==="win32"?"rg.exe":"rg");if(!(yield*$.isFile(M)))return yield*G.fail(Error(`ripgrep archive did not contain executable: ${M}`));if(yield*$.copyFile(M,U),process.platform==="win32")return;yield*$.chmod(U,493)},G.scoped),Q=yield*G.cached(G.gen(function*(){let H=yield*G.sync(()=>x$(process.platform==="win32"?"rg.exe":"rg"));if(H&&(yield*$.isFile(H).pipe(G.orDie)))return H;let q=J8.join(f$.Path.bin,`rg${process.platform==="win32"?".exe":""}`);if(yield*$.isFile(q).pipe(G.orDie))return q;let U=`${process.arch}-${process.platform}`,z=C_[U];if(!z)return yield*G.fail(Error(`unsupported platform for ripgrep: ${U}`));let M=`ripgrep-${d6}-${z.platform}.${z.extension}`,I=`https://github.com/BurntSushi/ripgrep/releases/download/${d6}/${M}`,C=J8.join(f$.Path.bin,M);XK.info("downloading ripgrep",{url:I}),yield*$.ensureDir(f$.Path.bin).pipe(G.orDie);let P=yield*G2.get(I).pipe(J.execute,G.flatMap((D)=>D.arrayBuffer),G.mapError((D)=>D instanceof Error?D:Error(String(D))));if(P.byteLength===0)return yield*G.fail(Error(`failed to download ripgrep from ${I}`));return yield*$.writeWithDirs(C,new Uint8Array(P)),yield*K(C,z,q),yield*$.remove(C,{force:!0}).pipe(G.ignore),q})),V=G.fnUntraced(function*(H){if(yield*$.isDir(H).pipe(G.orDie))return;return yield*G.fail(Object.assign(Error(`No such file or directory: '${H}'`),{code:"ENOENT",errno:-2,path:H}))}),X=G.fnUntraced(function*(H,q){let U=yield*Q;return S1.make(U,q,{cwd:H,env:A_(),extendEnv:!0,stdin:"ignore"})}),W=(H)=>l$.callback((q)=>G.gen(function*(){yield*G.forkScoped(G.gen(function*(){yield*V(H.cwd);let U=yield*Z.spawn(yield*X(H.cwd,L_(H))),z=yield*l$.mkString(l$.decodeText(U.stderr)).pipe(G.forkScoped),M=yield*l$.decodeText(U.stdout).pipe(l$.splitLines,l$.filter((C)=>C.length>0),l$.runForEach((C)=>G.sync(()=>b1.offerUnsafe(q,OK(C)))),G.forkScoped),I=yield*UK(U.exitCode,H.signal);if(yield*Z8.join(M),I===0||I===1){b1.endUnsafe(q);return}jK(q,z9(yield*Z8.join(z),I))}).pipe(G.catch((U)=>G.sync(()=>{jK(q,U)}))))})),_=G.fn("Ripgrep.search")(function*(H){yield*V(H.cwd);let q=G.scoped(G.gen(function*(){let U=yield*Z.spawn(yield*X(H.cwd,N_(H))),[z,M,I]=yield*G.all([l$.decodeText(U.stdout).pipe(l$.splitLines,l$.filter((C)=>C.length>0),l$.mapEffect(R_),l$.filter((C)=>C.type==="match"),l$.map((C)=>w_(C.data)),l$.runCollect,G.map((C)=>[...C])),l$.mkString(l$.decodeText(U.stderr)),U.exitCode],{concurrency:"unbounded"});if(I!==0&&I!==1&&I!==2)return yield*G.fail(z9(M,I));return{items:I===1?[]:z,partial:I===2}}));return yield*UK(q,H.signal)}),j=G.fn("Ripgrep.tree")(function*(H){XK.info("tree",H);let q=Array.from(yield*W({cwd:H.cwd,signal:H.signal}).pipe(l$.runCollect));function U(R,N){let x=R.children.get(N);if(x)return x;let b={name:N,children:new Map};return R.children.set(N,b),b}function z(R){return Array.from(R.children.values()).reduce((N,x)=>N+1+z(x),0)}let M={name:"",children:new Map};for(let R of q){if(R.includes(".qitqode"))continue;let N=R.split(J8.sep);if(N.length<2)continue;let x=M;for(let b of N.slice(0,-1))x=U(x,b)}let I=z(M),C=H.limit??I,P=[],D=Array.from(M.children.values()).sort((R,N)=>R.name.localeCompare(N.name)).map((R)=>({node:R,path:R.name})),L=0;for(let R=0;R<D.length&&L<C;R++){let N=D[R];P.push(N.path),L++,D.push(...Array.from(N.node.children.values()).sort((x,b)=>x.name.localeCompare(b.name)).map((x)=>({node:x,path:`${N.path}/${x.name}`})))}if(I>L)P.push(`[${I-L} truncated]`);return P.join(`
38
- `)});return C9.of({files:W,tree:j,search:_})})),y_=qK.pipe(f.provide(X2.layer),f.provide($$.defaultLayer),f.provide(XJ));var w2={};o$(w2,{layer:()=>gK,defaultLayer:()=>M4,Service:()=>A9,Node:()=>K4,Info:()=>Y4,File:()=>w2,Event:()=>V4,Content:()=>Q4});var vK=S9(Z4(),1),hK=S9(LK(),1);import E0 from"path";var S2={};o$(S2,{paths:()=>J4,names:()=>$4,Protected:()=>S2});import o6 from"path";import a_ from"os";var r6=a_.homedir(),NK=["Music","Pictures","Movies","Downloads","Desktop","Documents","Public","Applications","Library"],t_=["Application Support/AddressBook","Calendars","Mail","Messages","Safari","Cookies","Application Support/com.apple.TCC","PersonalizationPortrait","Metadata/CoreSpotlight","Suggestions"],e_=["/.DocumentRevisions-V100","/.Spotlight-V100","/.Trashes","/.fseventsd"],yK=["AppData","Downloads","Desktop","Documents","Pictures","Music","Videos","OneDrive"];function $4(){if(process.platform==="darwin")return new Set(NK);if(process.platform==="win32")return new Set(yK);return new Set}function J4(){if(process.platform==="darwin")return[...NK.map(($)=>o6.join(r6,$)),...t_.map(($)=>o6.join(r6,"Library",$)),...e_];if(process.platform==="win32")return yK.map(($)=>o6.join(r6,$));return[]}var Y4=F.object({path:F.string(),added:F.number().int(),removed:F.number().int(),status:F.enum(["added","deleted","modified"])}).meta({ref:"File"}),K4=F.object({name:F.string(),path:F.string(),absolute:F.string(),type:F.enum(["file","directory"]),ignored:F.boolean()}).meta({ref:"FileNode"}),Q4=F.object({type:F.enum(["text","binary"]),content:F.string(),diff:F.string().optional(),patch:F.object({oldFileName:F.string(),newFileName:F.string(),oldHeader:F.string().optional(),newHeader:F.string().optional(),hunks:F.array(F.object({oldStart:F.number(),oldLines:F.number(),newStart:F.number(),newLines:F.number(),lines:F.array(F.string())})),index:F.string().optional()}).optional(),encoding:F.literal("base64").optional(),mimeType:F.string().optional()}).meta({ref:"FileContent"}),V4={Edited:Z0.define("file.edited",F.object({file:F.string()}))},K8=O$.create({service:"file"}),TK=393216,G4=new Set(["exe","dll","pdb","bin","so","dylib","o","a","lib","wav","mp3","ogg","oga","ogv","ogx","flac","aac","wma","m4a","weba","mp4","avi","mov","wmv","flv","webm","mkv","zip","tar","gz","gzip","bz","bz2","bzip","bzip2","7z","rar","xz","lz","z","pdf","doc","docx","ppt","pptx","xls","xlsx","dmg","iso","img","vmdk","ttf","otf","woff","woff2","eot","sqlite","db","mdb","apk","ipa","aab","xapk","app","pkg","deb","rpm","snap","flatpak","appimage","msi","msp","jar","war","ear","class","kotlin_module","dex","vdex","odex","oat","art","wasm","wat","bc","ll","s","ko","sys","drv","efi","rom","com"]),X4=new Set(["png","jpg","jpeg","gif","bmp","webp","ico","tif","tiff","svg","svgz","avif","apng","jxl","heic","heif","raw","cr2","nef","arw","dng","orf","raf","pef","x3f"]),W4=new Set(["ts","tsx","mts","cts","mtsx","ctsx","js","jsx","mjs","cjs","sh","bash","zsh","fish","ps1","psm1","cmd","bat","json","jsonc","json5","yaml","yml","toml","md","mdx","txt","xml","html","htm","css","scss","sass","less","graphql","gql","sql","ini","cfg","conf","env"]),j4=new Set(["dockerfile","makefile",".gitignore",".gitattributes",".editorconfig",".npmrc",".nvmrc",".prettierrc",".eslintrc"]),U4={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",webp:"image/webp",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff",svg:"image/svg+xml",svgz:"image/svg+xml",avif:"image/avif",apng:"image/apng",jxl:"image/jxl",heic:"image/heic",heif:"image/heif"},Q8=($)=>E0.extname($).toLowerCase().slice(1),B4=($)=>E0.basename($).toLowerCase(),H4=($)=>X4.has(Q8($)),_4=($)=>W4.has(Q8($)),O4=($)=>j4.has(B4($)),q4=($)=>G4.has(Q8($)),F4=($)=>$.startsWith("image/"),kK=($)=>U4[Q8($)]||"image/"+Q8($);function z4($){let J=$.toLowerCase();if(K8.debug("shouldEncode",{type:J}),!J)return!1;if(J.startsWith("text/"))return!1;if(J.includes("charset="))return!1;let Z=J.split("/",2)[0];return["image","audio","video","font","model","multipart"].includes(Z)}var C4=($)=>{return $.replaceAll("\\","/").replace(/\/+$/,"").split("/").some((Z)=>Z.startsWith(".")&&Z.length>1)},EK=($,J)=>{if(J)return $;let Z=[],Y=[];for(let K of $)if(C4(K))Y.push(K);else Z.push(K);return[...Z,...Y]};class A9 extends D$.Service()("@qitqode/File"){}var gK=f.effect(A9,G.gen(function*(){let $=yield*$$.Service,J=yield*h0.Service,Z=yield*HJ.Service,Y=yield*UJ.Scope,K=yield*i.make(G.fn("File.state")(()=>G.succeed({cache:{files:[],dirs:[]}}))),Q=G.fn("File.scan")(function*(){let M=yield*i.context;if(M.directory===E0.parse(M.directory).root)return;let I=M.directory===f$.Path.home&&M.project.id==="global",C={files:[],dirs:[]};if(I){let D=new Set,L=S2.names(),R=new Set(["node_modules","dist","build","target","vendor"]),N=(v)=>v.startsWith(".")||L.has(v),x=(v)=>v.startsWith(".")||R.has(v),b=yield*$.readDirectoryEntries(M.directory).pipe(G.orElseSucceed(()=>[]));for(let v of b){if(v.type!=="directory")continue;if(N(v.name))continue;D.add(v.name+"/");let m=E0.join(M.directory,v.name),A=yield*$.readDirectoryEntries(m).pipe(G.orElseSucceed(()=>[]));for(let u of A){if(u.type!=="directory")continue;if(x(u.name))continue;D.add(v.name+"/"+u.name+"/")}}C.dirs=Array.from(D).toSorted()}else{let D=yield*J.files({cwd:M.directory}).pipe(BJ,G.map((R)=>[...R])),L=new Set;for(let R of D){C.files.push(R);let N=R;while(!0){let x=E0.dirname(N);if(x===".")break;if(x===N)break;if(N=x,L.has(x))continue;L.add(x),C.dirs.push(x+"/")}}}let P=yield*i.get(K);P.cache=C}),V=yield*G.cached(Q().pipe(G.catchCause(()=>G.void))),X=G.fn("File.ensure")(function*(){yield*V,V=yield*G.cached(Q().pipe(G.catchCause(()=>G.void)))}),W=G.fnUntraced(function*(M){return(yield*Z.run(M,{cwd:(yield*i.context).directory})).text()}),_=(M,I)=>{if(!B$.containsPath(M,I))throw Error("Access denied: path escapes project directory");let C=$$.canonical(M);if(!B$.containsPath(C,I))throw Error("Access denied: path escapes project directory")},j=G.fn("File.init")(function*(){yield*X().pipe(G.forkIn(Y))}),H=G.fn("File.status")(function*(){let M=yield*i.context;if(M.project.vcs!=="git")return[];let I=yield*W(["-c","core.fsmonitor=false","-c","core.quotepath=false","diff","--numstat","HEAD"]),C=[];if(I.trim())for(let L of I.trim().split(`
39
- `)){let[R,N,x]=L.split("\t");C.push({path:x,added:R==="-"?0:parseInt(R,10),removed:N==="-"?0:parseInt(N,10),status:"modified"})}let P=yield*W(["-c","core.fsmonitor=false","-c","core.quotepath=false","ls-files","--others","--exclude-standard"]);if(P.trim())for(let L of P.trim().split(`
40
- `)){let R=yield*$.readFileString(E0.join(M.directory,L)).pipe(G.catch(()=>G.succeed(void 0)));if(R===void 0)continue;C.push({path:L,added:R.split(`
41
- `).length,removed:0,status:"added"})}let D=yield*W(["-c","core.fsmonitor=false","-c","core.quotepath=false","diff","--name-only","--diff-filter=D","HEAD"]);if(D.trim())for(let L of D.trim().split(`
42
- `))C.push({path:L,added:0,removed:0,status:"deleted"});return C.map((L)=>{let R=E0.isAbsolute(L.path)?L.path:E0.join(M.directory,L.path);return{...L,path:E0.relative(M.directory,R)}})}),q=G.fn("File.read")(function*(M){let b=[];try{const I=w9(b,K8.time("read",{file:M}),0);let C=yield*i.context;let P=E0.join(C.directory,M);_(P,C);if(H4(M)){let u=yield*$.stat(P).pipe(G.catch(()=>G.succeed(void 0)));if(!u)return{type:"text",content:""};if(Number(u.size)>TK)return{type:"binary",content:"",mimeType:kK(M)};let r=yield*$.readFile(P).pipe(G.catch(()=>G.succeed(new Uint8Array)));return{type:"text",content:Buffer.from(r).toString("base64"),mimeType:kK(M),encoding:"base64"}}let D=_4(M)||O4(M);if(q4(M)&&!D)return{type:"binary",content:""};let L=yield*$.stat(P).pipe(G.catch(()=>G.succeed(void 0)));if(!L)return{type:"text",content:""};let R=$$.mimeType(P);let N=D?!1:z4(R);if(N&&!F4(R))return{type:"binary",content:"",mimeType:R};if(N){if(Number(L.size)>TK)return{type:"binary",content:"",mimeType:R};let u=yield*$.readFile(P).pipe(G.catch(()=>G.succeed(new Uint8Array)));return{type:"text",content:Buffer.from(u).toString("base64"),mimeType:R,encoding:"base64"}}let x=yield*$.readFileString(P).pipe(G.map((u)=>u.trim()),G.catch(()=>G.succeed("")));if(C.project.vcs==="git"){let u=yield*W(["-c","core.fsmonitor=false","diff","--",M]);if(!u.trim())u=yield*W(["-c","core.fsmonitor=false","diff","--staged","--",M]);if(u.trim()){let r=yield*Z.show(C.directory,"HEAD",M),S=xK(M,M,r,x,"old","new",{context:1/0,ignoreWhitespace:!0});return{type:"text",content:x,patch:S,diff:bK(S)}}return{type:"text",content:x}}return{type:"text",content:x}}catch(v){var m=v,A=1}finally{R9(b,m,A)}}),U=G.fn("File.list")(function*(M){let I=yield*i.context,C=[".git",".DS_Store"],P=(N)=>!1;if(I.project.vcs==="git"){let N=hK.default(),x=E0.join(I.worktree,".gitignore"),b=yield*$.readFileString(x).pipe(G.catch(()=>G.succeed("")));if(b)N.add(b);let v=E0.join(I.worktree,".ignore"),m=yield*$.readFileString(v).pipe(G.catch(()=>G.succeed("")));if(m)N.add(m);P=N.ignores.bind(N)}let D=M?E0.join(I.directory,M):I.directory;_(D,I);let L=yield*$.readDirectoryEntries(D).pipe(G.orElseSucceed(()=>[])),R=[];for(let N of L){if(C.includes(N.name))continue;let x=E0.join(D,N.name),b=E0.relative(I.directory,x),v=N.type==="directory"?"directory":"file";R.push({name:N.name,path:b,absolute:x,type:v,ignored:P(v==="directory"?b+"/":b)})}return R.sort((N,x)=>{if(N.type!==x.type)return N.type==="directory"?-1:1;return N.name.localeCompare(x.name)})}),z=G.fn("File.search")(function*(M){yield*X();let{cache:I}=yield*i.get(K),C=M.query.trim(),P=M.limit??100,D=M.type??(M.dirs===!1?"file":"all");K8.info("search",{query:C,kind:D});let L=C.startsWith(".")||C.includes("/.");if(!C){if(D==="file")return I.files.slice(0,P);return EK(I.dirs.toSorted(),L).slice(0,P)}let R=D==="file"?I.files:D==="directory"?I.dirs:[...I.files,...I.dirs],N=D==="directory"&&!L?P*20:P,x=vK.default.go(C,R,{limit:N}).map((v)=>v.target),b=D==="directory"?EK(x,L).slice(0,P):x;return K8.info("search",{query:C,kind:D,results:b.length}),b});return K8.info("init"),A9.of({init:j,status:H,read:q,list:U,search:z})})),M4=gK.pipe(f.provide(h0.defaultLayer),f.provide($$.defaultLayer),f.provide(HJ.defaultLayer));var k2={};o$(k2,{layer:()=>$V,hasNativeBinding:()=>Gq,defaultLayer:()=>Xq,Service:()=>v9,FileWatcher:()=>k2,Event:()=>b9});var N2=d0("path"),eO=lQ(),$q=nQ();function E9($,J={}){let{ignore:Z,...Y}=J;if(Array.isArray(Z)){J={...Y};for(let K of Z)if($q(K)){if(!J.ignoreGlobs)J.ignoreGlobs=[];let Q=eO.makeRe(K,{dot:!0,lookbehinds:!1});J.ignoreGlobs.push(Q.source)}else{if(!J.ignorePaths)J.ignorePaths=[];J.ignorePaths.push(N2.resolve($,K))}}return J}var j7=($)=>{return{writeSnapshot(J,Z,Y){return $.writeSnapshot(N2.resolve(J),N2.resolve(Z),E9(J,Y))},getEventsSince(J,Z,Y){return $.getEventsSince(N2.resolve(J),N2.resolve(Z),E9(J,Y))},async subscribe(J,Z,Y){return J=N2.resolve(J),Y=E9(J,Y),await $.subscribe(J,Z,Y),{unsubscribe(){return $.unsubscribe(J,Z,Y)}}},unsubscribe(J,Z,Y){return $.unsubscribe(N2.resolve(J),Z,E9(J,Y))}}};import{readdir as Yq}from"fs/promises";import x9 from"path";var U8={};o$(U8,{match:()=>Zq,PATTERNS:()=>Jq,FileIgnore:()=>U8});var aQ=new Set(["node_modules","bower_components",".pnpm-store","vendor",".npm","dist","build","out",".next","target","bin","obj",".git",".svn",".hg",".vscode",".idea",".turbo",".output","desktop",".sst",".cache",".webkit-cache","__pycache__",".pytest_cache","mypy_cache",".history",".gradle"]),tQ=["**/*.swp","**/*.swo","**/*.pyc","**/.DS_Store","**/Thumbs.db","**/logs/**","**/tmp/**","**/temp/**","**/*.log","**/coverage/**","**/.nyc_output/**"],Jq=[...tQ,...aQ];function Zq($,J){for(let K of J?.whitelist||[])if(y2.match(K,$))return!1;let Z=$.split(/[/\\]/);for(let K=0;K<Z.length;K++)if(aQ.has(Z[K]))return!0;let Y=J?.extra||[];for(let K of[...tQ,...Y])if(y2.match(K,$))return!0;return!1}var qJ=O$.create({service:"file.watcher"}),Kq=1e4,b9={Updated:Z0.define("file.watcher.updated",F.object({file:F.string(),event:F.union([F.literal("add"),F.literal("change"),F.literal("unlink")])}))},eQ=T2(()=>{try{let $=d0(`@parcel/watcher-${process.platform}-${process.arch}${process.platform==="linux"?"-bionic":""}`);return j7($)}catch($){qJ.error("failed to load watcher binding",{error:$});return}});function Qq(){if(process.platform==="win32")return"windows";if(process.platform==="darwin")return"fs-events";if(process.platform==="linux")return"inotify"}function Vq($){return S2.paths().filter((J)=>{let Z=x9.relative($,J);return Z!==""&&Z!==".."&&!Z.startsWith(`..${x9.sep}`)&&!x9.isAbsolute(Z)})}var Gq=()=>!!eQ();class v9 extends D$.Service()("@qitqode/FileWatcher"){}var $V=f.effect(v9,G.gen(function*(){let $=yield*R$.Service,J=yield*HJ.Service,Z=yield*i.make(G.fn("FileWatcher.state")(function*(){if(yield*k$.QITQODE_EXPERIMENTAL_DISABLE_FILEWATCHER)return;qJ.info("init",{directory:B$.directory});let Y=Qq();if(!Y){qJ.error("watcher backend not supported",{directory:B$.directory,platform:process.platform});return}let K=eQ();if(!K)return;qJ.info("watcher backend",{directory:B$.directory,platform:process.platform,backend:Y});let Q=[];yield*G.addFinalizer(()=>G.promise(()=>Promise.allSettled(Q.map((j)=>j.unsubscribe()))));let V=B$.bind((j,H)=>{if(j)return;for(let q of H){if(q.type==="create")P$.publish(b9.Updated,{file:q.path,event:"add"});if(q.type==="update")P$.publish(b9.Updated,{file:q.path,event:"change"});if(q.type==="delete")P$.publish(b9.Updated,{file:q.path,event:"unlink"})}}),X=(j,H)=>{let q=K.subscribe(j,V,{ignore:H,backend:Y});return G.gen(function*(){let U=yield*G.promise(()=>q);Q.push(U)}).pipe(G.timeout(Kq),G.catchCause((U)=>{return qJ.error("failed to subscribe",{dir:j,cause:u0.pretty(U)}),q.then((z)=>z.unsubscribe()).catch(()=>{}),G.void}))},_=(yield*$.get()).watcher?.ignore??[];if(yield*k$.QITQODE_EXPERIMENTAL_FILEWATCHER)yield*X(B$.directory,[...U8.PATTERNS,..._,...Vq(B$.directory)]);if(B$.project.vcs==="git"){let j=yield*J.run(["rev-parse","--git-dir"],{cwd:B$.project.worktree}),H=j.exitCode===0?x9.resolve(B$.project.worktree,j.text().trim()):void 0;if(H&&!_.includes(".git")&&!_.includes(H)){let q=(yield*G.promise(()=>Yq(H).catch(()=>[]))).filter((U)=>U!=="HEAD");yield*X(H,q)}}},G.catchCause((Y)=>{return qJ.error("failed to init watcher service",{cause:u0.pretty(Y)}),G.void})));return v9.of({init:G.fn("FileWatcher.init")(function*(){yield*i.get(Z)})})})),Xq=$V.pipe(f.provide(R$.defaultLayer),f.provide(HJ.defaultLayer));var FJ={};o$(FJ,{layer:()=>QV,defaultLayer:()=>Uq,Service:()=>h9,Discovery:()=>FJ});var Wq=4,jq=8;class YV extends F$.Class("IndexSkill")({name:F$.String,files:F$.Array(F$.String)}){}class KV extends F$.Class("Index")({skills:F$.Array(YV)}){}class h9 extends D$.Service()("@qitqode/SkillDiscovery"){}var QV=f.effect(h9,G.gen(function*(){let $=O$.create({service:"skill-discovery"}),J=yield*$$.Service,Z=yield*JV.Path,Y=v1.filterStatusOk(f9(yield*v1.HttpClient)),K=Z.join(f$.Path.cache,"skills"),Q=G.fn("Discovery.download")(function*(X,W){if(yield*J.exists(W).pipe(G.orDie))return!0;return yield*G2.get(X).pipe(Y.execute,G.flatMap((_)=>_.arrayBuffer),G.flatMap((_)=>J.writeWithDirs(W,new Uint8Array(_))),G.as(!0),G.catch((_)=>G.sync(()=>{return $.error("failed to download",{url:X,err:_}),!1})))}),V=G.fn("Discovery.pull")(function*(X){let W=X.endsWith("/")?X:`${X}/`,_=new URL("index.json",W).href,j=W.slice(0,-1);$.info("fetching index",{url:_});let H=yield*G2.get(_).pipe(G2.acceptJson,Y.execute,G.flatMap(ZV.schemaBodyJson(KV)),G.catch((z)=>G.sync(()=>{return $.error("failed to fetch index",{url:_,err:z}),null})));if(!H)return[];let q=H.skills.filter((z)=>{if(!z.files.includes("SKILL.md"))return $.warn("skill entry missing SKILL.md",{url:_,skill:z.name}),!1;return!0});return(yield*G.forEach(q,(z)=>G.gen(function*(){let M=Z.join(K,z.name);yield*G.forEach(z.files,(C)=>Q(new URL(C,`${j}/${z.name}/`).href,Z.join(M,C)),{concurrency:jq});let I=Z.join(M,"SKILL.md");return(yield*J.exists(I).pipe(G.orDie))?M:null}),{concurrency:Wq})).filter((z)=>z!==null)});return h9.of({pull:V})})),Uq=QV.pipe(f.provide(X2.layer),f.provide($$.defaultLayer),f.provide(g9.layer));var a0={};o$(a0,{layer:()=>FV,fmt:()=>kq,defaultLayer:()=>Tq,Skill:()=>a0,Service:()=>l9,NameMismatchError:()=>Rq,InvalidError:()=>wq,Info:()=>qV});import Pq from"os";import zJ from"path";import{pathToFileURL as Iq}from"url";import d9 from"path";import{pathToFileURL as _q}from"url";var H7=S9(Hq(),1);import Bq from"path";import U7 from"fs";import B7 from"path";function VV($,J,Z){let Y=J?B7.join($,J):$;for(let K of U7.readdirSync(Y,{withFileTypes:!0})){let Q=J?`${J}/${K.name}`:K.name;if(K.isDirectory())VV($,Q,Z);else Z[Q]=U7.readFileSync(B7.join(Y,K.name),"utf8")}}function m9($){let J={};for(let Z of U7.readdirSync($,{withFileTypes:!0})){if(!Z.isDirectory())continue;let Y={};if(VV(B7.join($,Z.name),"",Y),Object.keys(Y).length>0)J[Z.name]=Y}return J}function GV(){return m9(Bq.resolve(import.meta.dir,".bundle"))}import XV from"path";function u9($){return G.gen(function*(){if($.skipIfPresent&&(yield*$.fsys.existsSafe($.marker)))return $.root;for(let[J,Z]of Object.entries($.bundle)){let Y=XV.join($.root,"skills",J);for(let[K,Q]of Object.entries(Z))yield*$.fsys.writeWithDirs(XV.join(Y,K),Q)}return yield*$.fsys.writeWithDirs($.marker,$.markerContent),$.onExtracted($.root),$.root})}function Oq(){try{return{ask:{"SKILL.md":`---
36
+ `),j0(y1,h),U=S$}V9.lookahead=">";function i3(H,O,R){if(O[0]==="-"&&O[1]==="-"){V+=2,a8(),U=IB;return}if(O.toUpperCase()==="DOCTYPE")V+=7,U=yB;else if(O==="[CDATA["&&sH())V+=7,U=b6;else U=V9}i3.lookahead=7;function IB(H){switch(a8(),H){case 45:U=AB;break;case 62:U=S$,j0(y1,y0(w));break;default:Q$(H,D2);break}}function AB(H){switch(H){case 45:U=Q9;break;case 62:U=S$,j0(y1,y0(w));break;case-1:j0(y1,y0(w)),I$();break;default:w.push(45),Q$(H,D2);break}}function D2(H){switch(H){case 60:w.push(H),U=SB;break;case 45:U=E6;break;case 0:w.push(65533);break;case-1:j0(y1,y0(w)),I$();break;default:w.push(H);break}}function SB(H){switch(H){case 33:w.push(H),U=RB;break;case 60:w.push(H);break;default:Q$(H,D2);break}}function RB(H){switch(H){case 45:U=wB;break;default:Q$(H,D2);break}}function wB(H){switch(H){case 45:U=LB;break;default:Q$(H,E6);break}}function LB(H){switch(H){case 62:case-1:Q$(H,Q9);break;default:Q$(H,Q9);break}}function E6(H){switch(H){case 45:U=Q9;break;case-1:j0(y1,y0(w)),I$();break;default:w.push(45),Q$(H,D2);break}}function Q9(H){switch(H){case 62:U=S$,j0(y1,y0(w));break;case 33:U=NB;break;case 45:w.push(45);break;case-1:j0(y1,y0(w)),I$();break;default:w.push(45),w.push(45),Q$(H,D2);break}}function NB(H){switch(H){case 45:w.push(45),w.push(45),w.push(33),U=E6;break;case 62:U=S$,j0(y1,y0(w));break;case-1:j0(y1,y0(w)),I$();break;default:w.push(45),w.push(45),w.push(33),Q$(H,D2);break}}function yB(H){switch(H){case 9:case 10:case 12:case 32:U=s3;break;case-1:e1(),h$(),g$(),I$();break;default:Q$(H,s3);break}}function s3(H){switch(H){case 9:case 10:case 12:case 32:break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:e1(),N.push(H+32),U=x6;break;case 0:e1(),N.push(65533),U=x6;break;case 62:e1(),h$(),U=S$,g$();break;case-1:e1(),h$(),g$(),I$();break;default:e1(),N.push(H),U=x6;break}}function x6(H){switch(H){case 9:case 10:case 12:case 32:U=n3;break;case 62:U=S$,g$();break;case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:N.push(H+32);break;case 0:N.push(65533);break;case-1:h$(),g$(),I$();break;default:N.push(H);break}}function n3(H,O,R){switch(H){case 9:case 10:case 12:case 32:V+=1;break;case 62:U=S$,V+=1,g$();break;case-1:h$(),g$(),I$();break;default:if(O=O.toUpperCase(),O==="PUBLIC")V+=6,U=TB;else if(O==="SYSTEM")V+=6,U=xB;else h$(),U=V2;break}}n3.lookahead=6;function TB(H){switch(H){case 9:case 10:case 12:case 32:U=kB;break;case 34:M1(),U=a3;break;case 39:M1(),U=t3;break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:h$(),U=V2;break}}function kB(H){switch(H){case 9:case 10:case 12:case 32:break;case 34:M1(),U=a3;break;case 39:M1(),U=t3;break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:h$(),U=V2;break}}function a3(H){switch(H){case 34:U=e3;break;case 0:x.push(65533);break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:x.push(H);break}}function t3(H){switch(H){case 39:U=e3;break;case 0:x.push(65533);break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:x.push(H);break}}function e3(H){switch(H){case 9:case 10:case 12:case 32:U=EB;break;case 62:U=S$,g$();break;case 34:C1(),U=X9;break;case 39:C1(),U=G9;break;case-1:h$(),g$(),I$();break;default:h$(),U=V2;break}}function EB(H){switch(H){case 9:case 10:case 12:case 32:break;case 62:U=S$,g$();break;case 34:C1(),U=X9;break;case 39:C1(),U=G9;break;case-1:h$(),g$(),I$();break;default:h$(),U=V2;break}}function xB(H){switch(H){case 9:case 10:case 12:case 32:U=bB;break;case 34:C1(),U=X9;break;case 39:C1(),U=G9;break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:h$(),U=V2;break}}function bB(H){switch(H){case 9:case 10:case 12:case 32:break;case 34:C1(),U=X9;break;case 39:C1(),U=G9;break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:h$(),U=V2;break}}function X9(H){switch(H){case 34:U=$K;break;case 0:b.push(65533);break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:b.push(H);break}}function G9(H){switch(H){case 39:U=$K;break;case 0:b.push(65533);break;case 62:h$(),U=S$,g$();break;case-1:h$(),g$(),I$();break;default:b.push(H);break}}function $K(H){switch(H){case 9:case 10:case 12:case 32:break;case 62:U=S$,g$();break;case-1:h$(),g$(),I$();break;default:U=V2;break}}function V2(H){switch(H){case 62:U=S$,g$();break;case-1:g$(),I$();break;default:break}}function b6(H){switch(H){case 93:U=vB;break;case-1:I$();break;case 0:n=!0;default:iJ(JI)||y.push(H);break}}function vB(H){switch(H){case 93:U=hB;break;default:y.push(93),Q$(H,b6);break}}function hB(H){switch(H){case 93:y.push(93);break;case 62:QJ(),U=S$;break;default:y.push(93),y.push(93),Q$(H,b6);break}}function tJ(H){switch(r$(),I.push(38),H){case 9:case 10:case 12:case 32:case 60:case 38:case-1:Q$(H,P2);break;case 35:I.push(H),U=gB;break;default:Q$(H,JK);break}}function JK(H){Tj.lastIndex=V;var O=Tj.exec(Y);if(!O)throw Error("should never happen");var R=O[1];if(!R){U=P2;return}switch(V+=R.length,t2(I,VI(R)),z){case Z9:case Y9:case K9:if(R[R.length-1]!==";"){if(/[=A-Za-z0-9]/.test(Y[V])){U=P2;return}}break;default:break}r$();var E=iP[R];if(typeof E==="number")I.push(E);else t2(I,E);U=P2}JK.lookahead=-sP;function gB(H){switch(C=0,H){case 120:case 88:I.push(H),U=fB;break;default:Q$(H,mB);break}}function fB(H){switch(H){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 65:case 66:case 67:case 68:case 69:case 70:case 97:case 98:case 99:case 100:case 101:case 102:Q$(H,uB);break;default:Q$(H,P2);break}}function mB(H){switch(H){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:Q$(H,dB);break;default:Q$(H,P2);break}}function uB(H){switch(H){case 65:case 66:case 67:case 68:case 69:case 70:C*=16,C+=H-55;break;case 97:case 98:case 99:case 100:case 101:case 102:C*=16,C+=H-87;break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:C*=16,C+=H-48;break;case 59:U=W9;break;default:Q$(H,W9);break}}function dB(H){switch(H){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:C*=10,C+=H-48;break;case 59:U=W9;break;default:Q$(H,W9);break}}function W9(H){if(C in yj)C=yj[C];else if(C>1114111||C>=55296&&C<57344)C=65533;if(r$(),C<=65535)I.push(C);else C=C-65536,I.push(55296+(C>>10)),I.push(56320+(C&1023));Q$(H,P2)}function P2(H){switch(z){case Z9:case Y9:case K9:L+=y0(I);break;default:t2(y,I);break}Q$(H,z)}function pB(H,O,R,E){switch(H){case 1:if(O=O.replace(e2,""),O.length===0)return;break;case 4:l._appendChild(l.createComment(O));return;case 5:var h=O,c=R,U$=E;if(l.appendChild(new uP(l,h,c,U$)),W$||h.toLowerCase()!=="html"||cP.test(c)||U$&&U$.toLowerCase()===lP||U$===void 0&&Rj.test(c))l._quirks=!0;else if(oP.test(c)||U$!==void 0&&Rj.test(c))l._limitedQuirks=!0;A=ZK;return}l._quirks=!0,A=ZK,A(H,O,R,E)}function ZK(H,O,R,E){var h;switch(H){case 1:if(O=O.replace(e2,""),O.length===0)return;break;case 5:return;case 4:l._appendChild(l.createComment(O));return;case 2:if(O==="html"){h=sJ(l,O,R),S.push(h),l.appendChild(h),A=j9;return}break;case 3:switch(O){case"html":case"head":case"body":case"br":break;default:return}}h=sJ(l,"html",null),S.push(h),l.appendChild(h),A=j9,A(H,O,R,E)}function j9(H,O,R,E){switch(H){case 1:if(O=O.replace(e2,""),O.length===0)return;break;case 5:return;case 4:D1(O);return;case 2:switch(O){case"html":j$(H,O,R,E);return;case"head":var h=q$(O,R);A$=h,A=V0;return}break;case 3:switch(O){case"html":case"head":case"body":case"br":break;default:return}}j9(N0,"head",null),A(H,O,R,E)}function V0(H,O,R,E){switch(H){case 1:var h=O.match(e2);if(h)P1(h[0]),O=O.substring(h[0].length);if(O.length===0)return;break;case 4:D1(O);return;case 5:return;case 2:switch(O){case"html":j$(H,O,R,E);return;case"meta":case"base":case"basefont":case"bgsound":case"link":q$(O,R),S.pop();return;case"title":eH(O,R);return;case"noscript":if(!J$){q$(O,R),A=YK;return}case"noframes":case"style":$9(O,R);return;case"script":t8(function(c){var U$=sJ(c,O,R);if(U$._parser_inserted=!0,U$._force_async=!1,k)U$._already_started=!0;return QJ(),U$}),U=Z2,u=A,A=U9;return;case"template":q$(O,R),T.insertMarker(),Z$=!1,A=g6,r.push(A);return;case"head":return}break;case 3:switch(O){case"head":S.pop(),A=v6;return;case"body":case"html":case"br":break;case"template":if(!S.contains("template"))return;S.generateImpliedEndTags(null,"thorough"),S.popTag("template"),T.clearToMarker(),r.pop(),nJ();return;default:return}break}V0(N$,"head",null),A(H,O,R,E)}function YK(H,O,R,E){switch(H){case 5:return;case 4:V0(H,O);return;case 1:var h=O.match(e2);if(h)V0(H,h[0]),O=O.substring(h[0].length);if(O.length===0)return;break;case 2:switch(O){case"html":j$(H,O,R,E);return;case"basefont":case"bgsound":case"link":case"meta":case"noframes":case"style":V0(H,O,R);return;case"head":case"noscript":return}break;case 3:switch(O){case"noscript":S.pop(),A=V0;return;case"br":break;default:return}break}YK(N$,"noscript",null),A(H,O,R,E)}function v6(H,O,R,E){switch(H){case 1:var h=O.match(e2);if(h)P1(h[0]),O=O.substring(h[0].length);if(O.length===0)return;break;case 4:D1(O);return;case 5:return;case 2:switch(O){case"html":j$(H,O,R,E);return;case"body":q$(O,R),Z$=!1,A=j$;return;case"frameset":q$(O,R),A=f6;return;case"base":case"basefont":case"bgsound":case"link":case"meta":case"noframes":case"script":case"style":case"template":case"title":S.push(A$),V0(N0,O,R),S.removeElement(A$);return;case"head":return}break;case 3:switch(O){case"template":return V0(H,O,R,E);case"body":case"html":case"br":break;default:return}break}v6(N0,"body",null),Z$=!0,A(H,O,R,E)}function j$(H,O,R,E){var h,c,U$,R$;switch(H){case 1:if(n){if(O=O.replace(X6,""),O.length===0)return}if(Z$&&Q6.test(O))Z$=!1;k0(),P1(O);return;case 5:return;case 4:D1(O);return;case-1:if(r.length)return g6(H);C2();return;case 2:switch(O){case"html":if(S.contains("template"))return;fj(R,S.elements[0]);return;case"base":case"basefont":case"bgsound":case"link":case"meta":case"noframes":case"script":case"style":case"template":case"title":V0(N0,O,R);return;case"body":if(h=S.elements[1],!h||!(h instanceof u$.HTMLBodyElement)||S.contains("template"))return;Z$=!1,fj(R,h);return;case"frameset":if(!Z$)return;if(h=S.elements[1],!h||!(h instanceof u$.HTMLBodyElement))return;if(h.parentNode)h.parentNode.removeChild(h);while(!(S.top instanceof u$.HTMLHtmlElement))S.pop();q$(O,R),A=f6;return;case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"nav":case"ol":case"p":case"section":case"summary":case"ul":if(S.inButtonScope("p"))j$(N$,"p");q$(O,R);return;case"menu":if(S.inButtonScope("p"))j$(N$,"p");if(d$(S.top,"menuitem"))S.pop();q$(O,R);return;case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":if(S.inButtonScope("p"))j$(N$,"p");if(S.top instanceof u$.HTMLHeadingElement)S.pop();q$(O,R);return;case"pre":case"listing":if(S.inButtonScope("p"))j$(N$,"p");q$(O,R),a=!0,Z$=!1;return;case"form":if(s&&!S.contains("template"))return;if(S.inButtonScope("p"))j$(N$,"p");if(R$=q$(O,R),!S.contains("template"))s=R$;return;case"li":Z$=!1;for(c=S.elements.length-1;c>=0;c--){if(U$=S.elements[c],U$ instanceof u$.HTMLLIElement){j$(N$,"li");break}if(d$(U$,$J)&&!d$(U$,Q3))break}if(S.inButtonScope("p"))j$(N$,"p");q$(O,R);return;case"dd":case"dt":Z$=!1;for(c=S.elements.length-1;c>=0;c--){if(U$=S.elements[c],d$(U$,uj)){j$(N$,U$.localName);break}if(d$(U$,$J)&&!d$(U$,Q3))break}if(S.inButtonScope("p"))j$(N$,"p");q$(O,R);return;case"plaintext":if(S.inButtonScope("p"))j$(N$,"p");q$(O,R),U=L6;return;case"button":if(S.inScope("button"))j$(N$,"button"),A(H,O,R,E);else k0(),q$(O,R),Z$=!1;return;case"a":var J0=T.findElementByTag("a");if(J0)j$(N$,O),T.remove(J0),S.removeElement(J0);case"b":case"big":case"code":case"em":case"font":case"i":case"s":case"small":case"strike":case"strong":case"tt":case"u":k0(),T.push(q$(O,R),R);return;case"nobr":if(k0(),S.inScope(O))j$(N$,O),k0();T.push(q$(O,R),R);return;case"applet":case"marquee":case"object":k0(),q$(O,R),T.insertMarker(),Z$=!1;return;case"table":if(!l._quirks&&S.inButtonScope("p"))j$(N$,"p");q$(O,R),Z$=!1,A=s0;return;case"area":case"br":case"embed":case"img":case"keygen":case"wbr":k0(),q$(O,R),S.pop(),Z$=!1;return;case"input":k0(),R$=q$(O,R),S.pop();var C0=R$.getAttribute("type");if(!C0||C0.toLowerCase()!=="hidden")Z$=!1;return;case"param":case"source":case"track":q$(O,R),S.pop();return;case"hr":if(S.inButtonScope("p"))j$(N$,"p");if(d$(S.top,"menuitem"))S.pop();q$(O,R),S.pop(),Z$=!1;return;case"image":j$(N0,"img",R,E);return;case"textarea":q$(O,R),a=!0,Z$=!1,U=J2,u=A,A=U9;return;case"xmp":if(S.inButtonScope("p"))j$(N$,"p");k0(),Z$=!1,$9(O,R);return;case"iframe":Z$=!1,$9(O,R);return;case"noembed":$9(O,R);return;case"select":if(k0(),q$(O,R),Z$=!1,A===s0||A===h6||A===I2||A===eJ||A===XJ)A=B9;else A=E1;return;case"optgroup":case"option":if(S.top instanceof u$.HTMLOptionElement)j$(N$,"option");k0(),q$(O,R);return;case"menuitem":if(d$(S.top,"menuitem"))S.pop();k0(),q$(O,R);return;case"rb":case"rtc":if(S.inScope("ruby"))S.generateImpliedEndTags();q$(O,R);return;case"rp":case"rt":if(S.inScope("ruby"))S.generateImpliedEndTags("rtc");q$(O,R);return;case"math":if(k0(),gj(R),V3(R),R6(O,R,G$.MATHML),E)S.pop();return;case"svg":if(k0(),hj(R),V3(R),R6(O,R,G$.SVG),E)S.pop();return;case"caption":case"col":case"colgroup":case"frame":case"head":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return}k0(),q$(O,R);return;case 3:switch(O){case"template":V0(N$,O,R);return;case"body":if(!S.inScope("body"))return;A=KK;return;case"html":if(!S.inScope("body"))return;A=KK,A(H,O,R);return;case"address":case"article":case"aside":case"blockquote":case"button":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"listing":case"main":case"menu":case"nav":case"ol":case"pre":case"section":case"summary":case"ul":if(!S.inScope(O))return;S.generateImpliedEndTags(),S.popTag(O);return;case"form":if(!S.contains("template")){var n0=s;if(s=null,!n0||!S.elementInScope(n0))return;S.generateImpliedEndTags(),S.removeElement(n0)}else{if(!S.inScope("form"))return;S.generateImpliedEndTags(),S.popTag("form")}return;case"p":if(!S.inButtonScope(O))j$(N0,O,null),A(H,O,R,E);else S.generateImpliedEndTags(O),S.popTag(O);return;case"li":if(!S.inListItemScope(O))return;S.generateImpliedEndTags(O),S.popTag(O);return;case"dd":case"dt":if(!S.inScope(O))return;S.generateImpliedEndTags(O),S.popTag(O);return;case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":if(!S.elementTypeInScope(u$.HTMLHeadingElement))return;S.generateImpliedEndTags(),S.popElementType(u$.HTMLHeadingElement);return;case"sarcasm":break;case"a":case"b":case"big":case"code":case"em":case"font":case"i":case"nobr":case"s":case"small":case"strike":case"strong":case"tt":case"u":var G1=$B(O);if(G1)return;break;case"applet":case"marquee":case"object":if(!S.inScope(O))return;S.generateImpliedEndTags(),S.popTag(O),T.clearToMarker();return;case"br":j$(N0,O,null);return}for(c=S.elements.length-1;c>=0;c--)if(U$=S.elements[c],d$(U$,O)){S.generateImpliedEndTags(O),S.popElement(U$);break}else if(d$(U$,$J))return;return}}function U9(H,O,R,E){switch(H){case 1:P1(O);return;case-1:if(S.top instanceof u$.HTMLScriptElement)S.top._already_started=!0;S.pop(),A=u,A(H);return;case 3:if(O==="script")JB();else S.pop(),A=u;return;default:return}}function s0(H,O,R,E){function h(U$){for(var R$=0,J0=U$.length;R$<J0;R$++)if(U$[R$][0]==="type")return U$[R$][1].toLowerCase();return null}switch(H){case 1:if(V$){j$(H,O,R,E);return}else if(d$(S.top,lJ)){y$=[],u=A,A=cB,A(H,O,R,E);return}break;case 4:D1(O);return;case 5:return;case 2:switch(O){case"caption":S.clearToContext(G6),T.insertMarker(),q$(O,R),A=h6;return;case"colgroup":S.clearToContext(G6),q$(O,R),A=H9;return;case"col":s0(N0,"colgroup",null),A(H,O,R,E);return;case"tbody":case"tfoot":case"thead":S.clearToContext(G6),q$(O,R),A=I2;return;case"td":case"th":case"tr":s0(N0,"tbody",null),A(H,O,R,E);return;case"table":if(!S.inTableScope(O))return;s0(N$,O),A(H,O,R,E);return;case"style":case"script":case"template":V0(H,O,R,E);return;case"input":var c=h(R);if(c!=="hidden")break;q$(O,R),S.pop();return;case"form":if(s||S.contains("template"))return;s=q$(O,R),S.popElement(s);return}break;case 3:switch(O){case"table":if(!S.inTableScope(O))return;S.popTag(O),nJ();return;case"body":case"caption":case"col":case"colgroup":case"html":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return;case"template":V0(H,O,R,E);return}break;case-1:j$(H,O,R,E);return}$2=!0,j$(H,O,R,E),$2=!1}function cB(H,O,R,E){if(H===cJ){if(n){if(O=O.replace(X6,""),O.length===0)return}y$.push(O)}else{var h=y$.join("");if(y$.length=0,Q6.test(h))$2=!0,j$(cJ,h),$2=!1;else P1(h);A=u,A(H,O,R,E)}}function h6(H,O,R,E){function h(){if(!S.inTableScope("caption"))return!1;return S.generateImpliedEndTags(),S.popTag("caption"),T.clearToMarker(),A=s0,!0}switch(H){case 2:switch(O){case"caption":case"col":case"colgroup":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":if(h())A(H,O,R,E);return}break;case 3:switch(O){case"caption":h();return;case"table":if(h())A(H,O,R,E);return;case"body":case"col":case"colgroup":case"html":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return}break}j$(H,O,R,E)}function H9(H,O,R,E){switch(H){case 1:var h=O.match(e2);if(h)P1(h[0]),O=O.substring(h[0].length);if(O.length===0)return;break;case 4:D1(O);return;case 5:return;case 2:switch(O){case"html":j$(H,O,R,E);return;case"col":q$(O,R),S.pop();return;case"template":V0(H,O,R,E);return}break;case 3:switch(O){case"colgroup":if(!d$(S.top,"colgroup"))return;S.pop(),A=s0;return;case"col":return;case"template":V0(H,O,R,E);return}break;case-1:j$(H,O,R,E);return}if(!d$(S.top,"colgroup"))return;H9(N$,"colgroup"),A(H,O,R,E)}function I2(H,O,R,E){function h(){if(!S.inTableScope("tbody")&&!S.inTableScope("thead")&&!S.inTableScope("tfoot"))return;S.clearToContext(W6),I2(N$,S.top.localName,null),A(H,O,R,E)}switch(H){case 2:switch(O){case"tr":S.clearToContext(W6),q$(O,R),A=eJ;return;case"th":case"td":I2(N0,"tr",null),A(H,O,R,E);return;case"caption":case"col":case"colgroup":case"tbody":case"tfoot":case"thead":h();return}break;case 3:switch(O){case"table":h();return;case"tbody":case"tfoot":case"thead":if(S.inTableScope(O))S.clearToContext(W6),S.pop(),A=s0;return;case"body":case"caption":case"col":case"colgroup":case"html":case"td":case"th":case"tr":return}break}s0(H,O,R,E)}function eJ(H,O,R,E){function h(){if(!S.inTableScope("tr"))return!1;return S.clearToContext(X3),S.pop(),A=I2,!0}switch(H){case 2:switch(O){case"th":case"td":S.clearToContext(X3),q$(O,R),A=XJ,T.insertMarker();return;case"caption":case"col":case"colgroup":case"tbody":case"tfoot":case"thead":case"tr":if(h())A(H,O,R,E);return}break;case 3:switch(O){case"tr":h();return;case"table":if(h())A(H,O,R,E);return;case"tbody":case"tfoot":case"thead":if(S.inTableScope(O)){if(h())A(H,O,R,E)}return;case"body":case"caption":case"col":case"colgroup":case"html":case"td":case"th":return}break}s0(H,O,R,E)}function XJ(H,O,R,E){switch(H){case 2:switch(O){case"caption":case"col":case"colgroup":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":if(S.inTableScope("td"))XJ(N$,"td"),A(H,O,R,E);else if(S.inTableScope("th"))XJ(N$,"th"),A(H,O,R,E);return}break;case 3:switch(O){case"td":case"th":if(!S.inTableScope(O))return;S.generateImpliedEndTags(),S.popTag(O),T.clearToMarker(),A=eJ;return;case"body":case"caption":case"col":case"colgroup":case"html":return;case"table":case"tbody":case"tfoot":case"thead":case"tr":if(!S.inTableScope(O))return;XJ(N$,S.inTableScope("td")?"td":"th"),A(H,O,R,E);return}break}j$(H,O,R,E)}function E1(H,O,R,E){switch(H){case 1:if(n){if(O=O.replace(X6,""),O.length===0)return}P1(O);return;case 4:D1(O);return;case 5:return;case-1:j$(H,O,R,E);return;case 2:switch(O){case"html":j$(H,O,R,E);return;case"option":if(S.top instanceof u$.HTMLOptionElement)E1(N$,O);q$(O,R);return;case"optgroup":if(S.top instanceof u$.HTMLOptionElement)E1(N$,"option");if(S.top instanceof u$.HTMLOptGroupElement)E1(N$,O);q$(O,R);return;case"select":E1(N$,O);return;case"input":case"keygen":case"textarea":if(!S.inSelectScope("select"))return;E1(N$,"select"),A(H,O,R,E);return;case"script":case"template":V0(H,O,R,E);return}break;case 3:switch(O){case"optgroup":if(S.top instanceof u$.HTMLOptionElement&&S.elements[S.elements.length-2]instanceof u$.HTMLOptGroupElement)E1(N$,"option");if(S.top instanceof u$.HTMLOptGroupElement)S.pop();return;case"option":if(S.top instanceof u$.HTMLOptionElement)S.pop();return;case"select":if(!S.inSelectScope(O))return;S.popTag(O),nJ();return;case"template":V0(H,O,R,E);return}break}}function B9(H,O,R,E){switch(O){case"caption":case"table":case"tbody":case"tfoot":case"thead":case"tr":case"td":case"th":switch(H){case 2:B9(N$,"select"),A(H,O,R,E);return;case 3:if(S.inTableScope(O))B9(N$,"select"),A(H,O,R,E);return}}E1(H,O,R,E)}function g6(H,O,R,E){function h(c){A=c,r[r.length-1]=A,A(H,O,R,E)}switch(H){case 1:case 4:case 5:j$(H,O,R,E);return;case-1:if(!S.contains("template"))C2();else S.popTag("template"),T.clearToMarker(),r.pop(),nJ(),A(H,O,R,E);return;case 2:switch(O){case"base":case"basefont":case"bgsound":case"link":case"meta":case"noframes":case"script":case"style":case"template":case"title":V0(H,O,R,E);return;case"caption":case"colgroup":case"tbody":case"tfoot":case"thead":h(s0);return;case"col":h(H9);return;case"tr":h(I2);return;case"td":case"th":h(eJ);return}h(j$);return;case 3:switch(O){case"template":V0(H,O,R,E);return;default:return}}}function KK(H,O,R,E){switch(H){case 1:if(Q6.test(O))break;j$(H,O);return;case 4:S.elements[0]._appendChild(l.createComment(O));return;case 5:return;case-1:C2();return;case 2:if(O==="html"){j$(H,O,R,E);return}break;case 3:if(O==="html"){if(k)return;A=oB;return}break}A=j$,A(H,O,R,E)}function f6(H,O,R,E){switch(H){case 1:if(O=O.replace(K3,""),O.length>0)P1(O);return;case 4:D1(O);return;case 5:return;case-1:C2();return;case 2:switch(O){case"html":j$(H,O,R,E);return;case"frameset":q$(O,R);return;case"frame":q$(O,R),S.pop();return;case"noframes":V0(H,O,R,E);return}break;case 3:if(O==="frameset"){if(k&&S.top instanceof u$.HTMLHtmlElement)return;if(S.pop(),!k&&!(S.top instanceof u$.HTMLFrameSetElement))A=lB;return}break}}function lB(H,O,R,E){switch(H){case 1:if(O=O.replace(K3,""),O.length>0)P1(O);return;case 4:D1(O);return;case 5:return;case-1:C2();return;case 2:switch(O){case"html":j$(H,O,R,E);return;case"noframes":V0(H,O,R,E);return}break;case 3:if(O==="html"){A=rB;return}break}}function oB(H,O,R,E){switch(H){case 1:if(Q6.test(O))break;j$(H,O,R,E);return;case 4:l._appendChild(l.createComment(O));return;case 5:j$(H,O,R,E);return;case-1:C2();return;case 2:if(O==="html"){j$(H,O,R,E);return}break}A=j$,A(H,O,R,E)}function rB(H,O,R,E){switch(H){case 1:if(O=O.replace(K3,""),O.length>0)j$(H,O,R,E);return;case 4:l._appendChild(l.createComment(O));return;case 5:j$(H,O,R,E);return;case-1:C2();return;case 2:switch(O){case"html":j$(H,O,R,E);return;case"noframes":V0(H,O,R,E);return}break}}function VK(H,O,R,E){function h(J0){for(var C0=0,n0=J0.length;C0<n0;C0++)switch(J0[C0][0]){case"color":case"face":case"size":return!0}return!1}var c;switch(H){case 1:if(Z$&&KI.test(O))Z$=!1;if(n)O=O.replace(X6,"\uFFFD");P1(O);return;case 4:D1(O);return;case 5:return;case 2:switch(O){case"font":if(!h(R))break;case"b":case"big":case"blockquote":case"body":case"br":case"center":case"code":case"dd":case"div":case"dl":case"dt":case"em":case"embed":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"head":case"hr":case"i":case"img":case"li":case"listing":case"menu":case"meta":case"nobr":case"ol":case"p":case"pre":case"ruby":case"s":case"small":case"span":case"strong":case"strike":case"sub":case"sup":case"table":case"tt":case"u":case"ul":case"var":if(k)break;do S.pop(),c=S.top;while(c.namespaceURI!==G$.HTML&&!bj(c)&&!vj(c));j0(H,O,R,E);return}if(c=S.elements.length===1&&k?J:S.top,c.namespaceURI===G$.MATHML)gj(R);else if(c.namespaceURI===G$.SVG)O=QI(O),hj(R);if(V3(R),R6(O,R,c.namespaceURI),E){if(O==="script"&&c.namespaceURI===G$.SVG);S.pop()}return;case 3:if(c=S.top,O==="script"&&c.namespaceURI===G$.SVG&&c.localName==="script")S.pop();else{var U$=S.elements.length-1,R$=S.elements[U$];for(;;){if(R$.localName.toLowerCase()===O){S.popElement(R$);break}if(R$=S.elements[--U$],R$.namespaceURI!==G$.HTML)continue;A(H,O,R,E);break}}return}}return c$.testTokenizer=function(H,O,R,E){var h=[];switch(O){case"PCDATA state":U=S$;break;case"RCDATA state":U=J2;break;case"RAWTEXT state":U=aJ;break;case"PLAINTEXT state":U=L6;break}if(R)M=R;if(j0=function(U$,R$,J0,C0){switch(QJ(),U$){case 1:if(h.length>0&&h[h.length-1][0]==="Character")h[h.length-1][1]+=R$;else h.push(["Character",R$]);break;case 4:h.push(["Comment",R$]);break;case 5:h.push(["DOCTYPE",R$,J0===void 0?null:J0,C0===void 0?null:C0,!W$]);break;case 2:var n0=Object.create(null);for(var G1=0;G1<J0.length;G1++){var A2=J0[G1];if(A2.length===1)n0[A2[0]]="";else n0[A2[0]]=A2[1]}var Q2=["StartTag",R$,n0];if(C0)Q2.push(!0);h.push(Q2);break;case 3:h.push(["EndTag",R$]);break;case-1:break}},!E)this.parse(H,!0);else{for(var c=0;c<H.length;c++)this.parse(H[c]);this.parse("",!0)}return h},c$}});var m8=p((Fv,tj)=>{tj.exports=aj;var sj=Z6(),nj=K6(),XI=U6(),H6=G0(),GI=uZ();function aj($){this.contextObject=$}var WI={xml:{"":!0,"1.0":!0,"2.0":!0},core:{"":!0,"2.0":!0},html:{"":!0,"1.0":!0,"2.0":!0},xhtml:{"":!0,"1.0":!0,"2.0":!0}};aj.prototype={hasFeature:function(J,Z){var Y=WI[(J||"").toLowerCase()];return Y&&Y[Z||""]||!1},createDocumentType:function(J,Z,Y){if(!GI.isValidQName(J))H6.InvalidCharacterError();return new nj(this.contextObject,J,Z,Y)},createDocument:function(J,Z,Y){var K=new sj(!1,null),V;if(Z)V=K.createElementNS(J,Z);else V=null;if(Y)K.appendChild(Y);if(V)K.appendChild(V);if(J===H6.NAMESPACE.HTML)K._contentType="application/xhtml+xml";else if(J===H6.NAMESPACE.SVG)K._contentType="image/svg+xml";else K._contentType="application/xml";return K},createHTMLDocument:function(J){var Z=new sj(!0,null);Z.appendChild(new nj(Z,"html"));var Y=Z.createElement("html");Z.appendChild(Y);var K=Z.createElement("head");if(Y.appendChild(K),J!==void 0){var V=Z.createElement("title");K.appendChild(V),V.appendChild(Z.createTextNode(J))}return Y.appendChild(Z.createElement("body")),Z.modclock=1,Z},mozSetOutputMutationHandler:function($,J){$.mutationHandler=J},mozGetInputMutationHandler:function($){H6.nyi()},mozHTMLParser:XI}});var $U=p((zv,ej)=>{var jI=aZ(),UI=sY();ej.exports=W3;function W3($,J){this._window=$,this._href=J}W3.prototype=Object.create(UI.prototype,{constructor:{value:W3},href:{get:function(){return this._href},set:function($){this.assign($)}},assign:{value:function($){var J=new jI(this._href),Z=J.resolve($);this._href=Z}},replace:{value:function($){this.assign($)}},reload:{value:function(){this.assign(this.href)}},toString:{value:function(){return this.href}}})});var ZU=p((Mv,JU)=>{var HI=Object.create(null,{appCodeName:{value:"Mozilla"},appName:{value:"Netscape"},appVersion:{value:"4.0"},platform:{value:""},product:{value:"Gecko"},productSub:{value:"20100101"},userAgent:{value:""},vendor:{value:""},vendorSub:{value:""},taintEnabled:{value:function(){return!1}}});JU.exports=HI});var KU=p((Cv,YU)=>{var BI={setTimeout,clearTimeout,setInterval,clearInterval};YU.exports=BI});var U3=p((u8,VU)=>{var j3=G0();u8=VU.exports={CSSStyleDeclaration:tZ(),CharacterData:T8(),Comment:bY(),DOMException:vZ(),DOMImplementation:m8(),DOMTokenList:zY(),Document:Z6(),DocumentFragment:hY(),DocumentType:K6(),Element:gJ(),HTMLParser:U6(),NamedNodeMap:AY(),Node:P0(),NodeList:n2(),NodeFilter:b8(),ProcessingInstruction:fY(),Text:EY(),Window:H3()};j3.merge(u8,iY());j3.merge(u8,$6().elements);j3.merge(u8,$3().elements)});var H3=p((Dv,QU)=>{var _I=m8(),OI=ZY(),qI=$U(),d8=G0();QU.exports=B6;function B6($){this.document=$||new _I(null).createHTMLDocument(""),this.document._scripting_enabled=!0,this.document.defaultView=this,this.location=new qI(this,this.document._address||"about:blank")}B6.prototype=Object.create(OI.prototype,{console:{value:console},history:{value:{back:d8.nyi,forward:d8.nyi,go:d8.nyi}},navigator:{value:ZU()},window:{get:function(){return this}},self:{get:function(){return this}},frames:{get:function(){return this}},parent:{get:function(){return this}},top:{get:function(){return this}},length:{value:0},frameElement:{value:null},opener:{value:null},onload:{get:function(){return this._getEventHandler("load")},set:function($){this._setEventHandler("load",$)}},getComputedStyle:{value:function(J){return J.style}}});d8.expose(KU(),B6);d8.expose(U3(),B6)});var UU=p((FI)=>{var XU=m8(),GU=U6(),Pv=H3(),WU=U3();FI.createDOMImplementation=function(){return new XU(null)};FI.createDocument=function($,J){if($||J){var Z=new GU;return Z.parse($||"",!0),Z.document()}return new XU(null).createHTMLDocument("")};FI.createIncrementalHTMLParser=function(){var $=new GU;return{write:function(J){if(J.length>0)$.parse(J,!1,function(){return!0})},end:function(J){$.parse(J||"",!0,function(){return!0})},process:function(J){return $.parse("",!1,J)},document:function(){return $.document()}}};FI.createWindow=function($,J){var Z=FI.createDocument($);if(J!==void 0)Z._address=J;return new WU.Window(Z)};FI.impl=WU});var W1={};o$(W1,{layer:()=>jK,defaultLayer:()=>P_,Status:()=>D_,Service:()=>q9,Format:()=>W1});import C_ from"path";var O9={};o$(O9,{zig:()=>$_,uvformat:()=>K_,terraform:()=>j_,standardrb:()=>Q_,shfmt:()=>B_,rustfmt:()=>O_,ruff:()=>GK,rubocop:()=>V_,rlang:()=>Y_,prettier:()=>aB,pint:()=>q_,oxfmt:()=>tB,ormolu:()=>F_,ocamlformat:()=>W_,nixfmt:()=>__,mix:()=>nB,latexindent:()=>U_,ktlint:()=>Z_,htmlbeautifier:()=>X_,gofmt:()=>sB,gleam:()=>H_,dfmt:()=>M_,dart:()=>G_,cljfmt:()=>z_,clang:()=>J_,biome:()=>eB});var sB={name:"gofmt",extensions:[".go"],async enabled(){let $=x$("gofmt");if(!$)return!1;return[$,"-w","$FILE"]}},nB={name:"mix",extensions:[".ex",".exs",".eex",".heex",".leex",".neex",".sface"],async enabled(){let $=x$("mix");if(!$)return!1;return[$,"format","$FILE"]}},QK=[".js",".jsx",".mjs",".cjs",".ts",".tsx",".mts",".cts",".html",".htm",".css",".scss",".sass",".less",".vue",".svelte",".json",".jsonc",".yaml",".yml",".toml",".xml",".md",".mdx",".graphql",".gql"];async function XK($,J){let Z=await O0.findUp("package.json",$.directory,$.worktree);for(let Y of Z){let K=await O0.readJson(Y);if(K.dependencies?.[J]||K.devDependencies?.[J]){let V=await m6.which(J);if(V)return V}}return}var aB={name:"prettier",environment:{BUN_BE_BUN:"1"},extensions:[...QK],async enabled($){let J=await XK($,"prettier");return J?[J,"--write","$FILE"]:!1}},tB={name:"oxfmt",environment:{BUN_BE_BUN:"1"},extensions:[".js",".jsx",".mjs",".cjs",".ts",".tsx",".mts",".cts"],async enabled($){if(!k$.QITQODE_EXPERIMENTAL_OXFMT)return!1;let J=await XK($,"oxfmt");return J?[J,"$FILE"]:!1}},eB={name:"biome",environment:{BUN_BE_BUN:"1"},extensions:[...QK],async enabled($){let J=["biome.json","biome.jsonc"];for(let Z of J)if((await O0.findUp(Z,$.directory,$.worktree)).length>0){let K=await m6.which("@biomejs/biome");if(K)return[K,"format","--write","$FILE"]}return!1}},$_={name:"zig",extensions:[".zig",".zon"],async enabled(){let $=x$("zig");if(!$)return!1;return[$,"fmt","$FILE"]}},J_={name:"clang-format",extensions:[".c",".cc",".cpp",".cxx",".c++",".h",".hh",".hpp",".hxx",".h++",".ino",".C",".H"],async enabled($){if((await O0.findUp(".clang-format",$.directory,$.worktree)).length>0){let Z=x$("clang-format");if(Z)return[Z,"-i","$FILE"]}return!1}},Z_={name:"ktlint",extensions:[".kt",".kts"],async enabled(){let $=x$("ktlint");if(!$)return!1;return[$,"-F","$FILE"]}},GK={name:"ruff",extensions:[".py",".pyi"],async enabled($){if(!x$("ruff"))return!1;let J=["pyproject.toml","ruff.toml",".ruff.toml"];for(let Y of J){let K=await O0.findUp(Y,$.directory,$.worktree);if(K.length>0)if(Y==="pyproject.toml"){if((await O0.readText(K[0])).includes("[tool.ruff]"))return["ruff","format","$FILE"]}else return["ruff","format","$FILE"]}let Z=["requirements.txt","pyproject.toml","Pipfile"];for(let Y of Z){let K=await O0.findUp(Y,$.directory,$.worktree);if(K.length>0){if((await O0.readText(K[0])).includes("ruff"))return["ruff","format","$FILE"]}}return!1}},Y_={name:"air",extensions:[".R"],async enabled(){let $=x$("air");if($==null)return!1;let J=await _9.text([$,"--help"],{nothrow:!0}),Z=J.text.split(`
37
+ `)[0],Y=Z.includes("R language"),K=Z.includes("formatter");if(J.code===0&&Y&&K)return[$,"format","$FILE"];return!1}},K_={name:"uv",extensions:[".py",".pyi"],async enabled($){if(await GK.enabled($))return!1;let J=x$("uv");if(J==null)return!1;if((await _9.run([J,"format","--help"],{nothrow:!0})).code===0)return[J,"format","--","$FILE"];return!1}},V_={name:"rubocop",extensions:[".rb",".rake",".gemspec",".ru"],async enabled(){let $=x$("rubocop");if(!$)return!1;return[$,"--autocorrect","$FILE"]}},Q_={name:"standardrb",extensions:[".rb",".rake",".gemspec",".ru"],async enabled(){let $=x$("standardrb");if(!$)return!1;return[$,"--fix","$FILE"]}},X_={name:"htmlbeautifier",extensions:[".erb",".html.erb"],async enabled(){let $=x$("htmlbeautifier");if(!$)return!1;return[$,"$FILE"]}},G_={name:"dart",extensions:[".dart"],async enabled(){let $=x$("dart");if(!$)return!1;return[$,"format","$FILE"]}},W_={name:"ocamlformat",extensions:[".ml",".mli"],async enabled($){if(!x$("ocamlformat"))return!1;if((await O0.findUp(".ocamlformat",$.directory,$.worktree)).length>0)return["ocamlformat","-i","$FILE"];return!1}},j_={name:"terraform",extensions:[".tf",".tfvars"],async enabled(){let $=x$("terraform");if(!$)return!1;return[$,"fmt","$FILE"]}},U_={name:"latexindent",extensions:[".tex"],async enabled(){let $=x$("latexindent");if(!$)return!1;return[$,"-w","-s","$FILE"]}},H_={name:"gleam",extensions:[".gleam"],async enabled(){let $=x$("gleam");if(!$)return!1;return[$,"format","$FILE"]}},B_={name:"shfmt",extensions:[".sh",".bash"],async enabled(){let $=x$("shfmt");if(!$)return!1;return[$,"-w","$FILE"]}},__={name:"nixfmt",extensions:[".nix"],async enabled(){let $=x$("nixfmt");if(!$)return!1;return[$,"$FILE"]}},O_={name:"rustfmt",extensions:[".rs"],async enabled(){let $=x$("rustfmt");if(!$)return!1;return[$,"$FILE"]}},q_={name:"pint",extensions:[".php"],async enabled($){let J=await O0.findUp("composer.json",$.directory,$.worktree);for(let Z of J){let Y=await O0.readJson(Z);if(Y.require?.["laravel/pint"]||Y["require-dev"]?.["laravel/pint"])return["./vendor/bin/pint","$FILE"]}return!1}},F_={name:"ormolu",extensions:[".hs"],async enabled(){let $=x$("ormolu");if(!$)return!1;return[$,"-i","$FILE"]}},z_={name:"cljfmt",extensions:[".clj",".cljs",".cljc",".edn"],async enabled(){let $=x$("cljfmt");if(!$)return!1;return[$,"fix","--quiet","$FILE"]}},M_={name:"dfmt",extensions:[".d"],async enabled(){let $=x$("dfmt");if(!$)return!1;return[$,"-i","$FILE"]}};var x1=O$.create({service:"format"}),D_=F.object({name:F.string(),extensions:F.string().array(),enabled:F.boolean()}).meta({ref:"FormatterStatus"});class q9 extends D$.Service()("@qitqode/Format"){}var jK=f.effect(q9,X.gen(function*(){let $=yield*w$.Service,J=yield*u6.ChildProcessSpawner,Z=yield*i.make(X.fn("Format.state")(function*(Q){let G={},W={};async function _(z){let C=G[z.name];if(C===!1||C===void 0)C=await z.enabled(Q),G[z.name]=C;return C}async function j(z){return await _(z)!==!1}async function B(z){let C=Object.values(W).filter((M)=>M.extensions.includes(z));return(await Promise.all(C.map(async(M)=>{x1.info("checking",{name:M.name,ext:z});let I=await _(M);if(I)x1.info("enabled",{name:M.name,ext:z});return{item:M,cmd:I}}))).filter((M)=>M.cmd).map((M)=>({item:M.item,cmd:M.cmd}))}function q(z){return X.gen(function*(){x1.info("formatting",{file:z});let C=C_.extname(z);for(let{item:D,cmd:M}of yield*X.promise(()=>B(C))){if(M===!1)continue;x1.info("running",{command:M});let I=M.map((w)=>w.replace("$FILE",z)),P=yield*i.directory;if((yield*J.spawn(S1.make(I[0],I.slice(1),{cwd:P,env:D.environment,extendEnv:!0})).pipe(X.flatMap((w)=>w.exitCode),X.scoped,X.catch(()=>X.sync(()=>{return x1.error("failed to format file",{error:"spawn failed",command:M,...D.environment,file:z}),u6.ExitCode(1)}))))!==0)x1.error("failed",{command:M,...D.environment})}})}let U=yield*$.get();if(!U.formatter)return x1.info("all formatters are disabled"),x1.info("init"),{formatters:W,isEnabled:j,formatFile:q};for(let z of Object.values(O9))W[z.name]=z;if(U.formatter!==!0)for(let[z,C]of Object.entries(U.formatter)){let D=O9[z];if(["ruff","uv"].includes(z)&&(U.formatter.ruff?.disabled||U.formatter.uv?.disabled)){delete W.ruff,delete W.uv;continue}if(C.disabled){delete W[z];continue}let M=F9(D??{extensions:[]},C);W[z]={...M,name:z,extensions:M.extensions??[],enabled:D&&!M.command?D.enabled:async(I)=>M.command??!1}}return x1.info("init"),{formatters:W,isEnabled:j,formatFile:q}})),Y=X.fn("Format.init")(function*(){yield*i.get(Z)}),K=X.fn("Format.status")(function*(){let{formatters:Q,isEnabled:G}=yield*i.get(Z),W=[];for(let _ of Object.values(Q)){let j=yield*X.promise(()=>G(_));W.push({name:_.name,extensions:_.extensions,enabled:j})}return W}),V=X.fn("Format.file")(function*(Q){let{formatFile:G}=yield*i.get(Z);yield*G(Q)});return q9.of({init:Y,status:K,file:V})})),P_=jK.pipe(f.provide(w$.defaultLayer),f.provide(GJ));var h0={};o$(h0,{layer:()=>MK,defaultLayer:()=>x_,Service:()=>M9,Ripgrep:()=>h0,Match:()=>FK});import J8 from"path";var UK=O$.create({service:"ripgrep"}),d6="15.1.0",I_={"arm64-darwin":{platform:"aarch64-apple-darwin",extension:"tar.gz"},"arm64-linux":{platform:"aarch64-unknown-linux-gnu",extension:"tar.gz"},"x64-darwin":{platform:"x86_64-apple-darwin",extension:"tar.gz"},"x64-linux":{platform:"x86_64-unknown-linux-musl",extension:"tar.gz"},"arm64-win32":{platform:"aarch64-pc-windows-msvc",extension:"zip"},"ia32-win32":{platform:"i686-pc-windows-msvc",extension:"zip"},"x64-win32":{platform:"x86_64-pc-windows-msvc",extension:"zip"}},qK=F.object({elapsed:F.object({secs:F.number(),nanos:F.number(),human:F.string()}),searches:F.number(),searches_with_match:F.number(),bytes_searched:F.number(),bytes_printed:F.number(),matched_lines:F.number(),matches:F.number()}),A_=F.object({type:F.literal("begin"),data:F.object({path:F.object({text:F.string()})})}),FK=F.object({type:F.literal("match"),data:F.object({path:F.object({text:F.string()}),lines:F.object({text:F.string()}),line_number:F.number(),absolute_offset:F.number(),submatches:F.array(F.object({match:F.object({text:F.string()}),start:F.number(),end:F.number()}))})}),S_=F.object({type:F.literal("end"),data:F.object({path:F.object({text:F.string()}),binary_offset:F.number().nullable(),stats:qK})}),R_=F.object({type:F.literal("summary"),data:F.object({elapsed_total:F.object({human:F.string(),nanos:F.number(),secs:F.number()}),stats:qK})}),w_=F.union([A_,FK,S_,R_]);class M9 extends D$.Service()("@qitqode/Ripgrep"){}function L_(){let $=OK();return delete $.RIPGREP_CONFIG_PATH,$}function HK($){let J=$?.reason;if(J instanceof Error)return J;let Z=Error("Aborted");return Z.name="AbortError",Z}function N_($){if(!$)return X.never;if($.aborted)return X.fail(HK($));return X.callback((J)=>{let Z=()=>J(X.fail(HK($)));if($.addEventListener("abort",Z,{once:!0}),$.aborted)Z();return X.sync(()=>$.removeEventListener("abort",Z))})}function z9($,J){let Z=Error($.trim()||`ripgrep failed with code ${J}`);return Z.name="RipgrepError",Z}function zK($){return J8.normalize($.replace(/^\.[\\/]/,""))}function y_($){return{...$,path:{...$.path,text:zK($.path.text)}}}function T_($){return X.try({try:()=>w_.parse(JSON.parse($)),catch:(J)=>Error("invalid ripgrep output",{cause:J})})}function BK($,J){b1.failCauseUnsafe($,u0.fail(J))}function k_($){let J=["--no-config","--files","--glob=!.git/*"];if($.follow)J.push("--follow");if($.hidden!==!1)J.push("--hidden");if($.hidden===!1)J.push("--glob=!.*");if($.maxDepth!==void 0)J.push(`--max-depth=${$.maxDepth}`);if($.glob)for(let Z of $.glob)J.push(`--glob=${Z}`);return J.push("."),J}function E_($){let J=["--no-config","--json","--hidden","--glob=!.git/*","--no-messages"];if($.follow)J.push("--follow");if($.glob)for(let Z of $.glob)J.push(`--glob=${Z}`);if($.limit)J.push(`--max-count=${$.limit}`);return J.push("--",$.pattern,...$.file??["."]),J}function _K($,J){return J?$.pipe(X.raceFirst(N_(J))):$}var MK=f.effect(M9,X.gen(function*(){let $=yield*$$.Service,J=v1.filterStatusOk(yield*v1.HttpClient),Z=yield*C9,Y=X.fnUntraced(function*(B,q,U){let z=yield*Z.spawn(S1.make(B,q,{cwd:U?.cwd,extendEnv:!0,stdin:"ignore"})),[C,D,M]=yield*X.all([l$.mkString(l$.decodeText(z.stdout)),l$.mkString(l$.decodeText(z.stderr)),z.exitCode],{concurrency:"unbounded"});return{stdout:C,stderr:D,code:M}},X.scoped),K=X.fnUntraced(function*(B,q,U){let z=yield*$.makeTempDirectoryScoped({directory:f$.Path.bin,prefix:"ripgrep-"});if(q.extension==="zip"){let D=(yield*X.sync(()=>x$("powershell.exe")??x$("pwsh.exe")))??"powershell.exe",M=yield*Y(D,["-NoProfile","-NonInteractive","-Command",`$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -LiteralPath '${B.replaceAll("'","''")}' -DestinationPath '${z.replaceAll("'","''")}' -Force`]);if(M.code!==0)return yield*X.fail(z9(M.stderr||M.stdout,M.code))}if(q.extension==="tar.gz"){let D=yield*Y("tar",["-xzf",B,"-C",z]);if(D.code!==0)return yield*X.fail(z9(D.stderr||D.stdout,D.code))}let C=J8.join(z,`ripgrep-${d6}-${q.platform}`,process.platform==="win32"?"rg.exe":"rg");if(!(yield*$.isFile(C)))return yield*X.fail(Error(`ripgrep archive did not contain executable: ${C}`));if(yield*$.copyFile(C,U),process.platform==="win32")return;yield*$.chmod(U,493)},X.scoped),V=yield*X.cached(X.gen(function*(){let B=yield*X.sync(()=>x$(process.platform==="win32"?"rg.exe":"rg"));if(B&&(yield*$.isFile(B).pipe(X.orDie)))return B;let q=J8.join(f$.Path.bin,`rg${process.platform==="win32"?".exe":""}`);if(yield*$.isFile(q).pipe(X.orDie))return q;let U=`${process.arch}-${process.platform}`,z=I_[U];if(!z)return yield*X.fail(Error(`unsupported platform for ripgrep: ${U}`));let C=`ripgrep-${d6}-${z.platform}.${z.extension}`,D=`https://github.com/BurntSushi/ripgrep/releases/download/${d6}/${C}`,M=J8.join(f$.Path.bin,C);UK.info("downloading ripgrep",{url:D}),yield*$.ensureDir(f$.Path.bin).pipe(X.orDie);let I=yield*X2.get(D).pipe(J.execute,X.flatMap((P)=>P.arrayBuffer),X.mapError((P)=>P instanceof Error?P:Error(String(P))));if(I.byteLength===0)return yield*X.fail(Error(`failed to download ripgrep from ${D}`));return yield*$.writeWithDirs(M,new Uint8Array(I)),yield*K(M,z,q),yield*$.remove(M,{force:!0}).pipe(X.ignore),q})),Q=X.fnUntraced(function*(B){if(yield*$.isDir(B).pipe(X.orDie))return;return yield*X.fail(Object.assign(Error(`No such file or directory: '${B}'`),{code:"ENOENT",errno:-2,path:B}))}),G=X.fnUntraced(function*(B,q){let U=yield*V;return S1.make(U,q,{cwd:B,env:L_(),extendEnv:!0,stdin:"ignore"})}),W=(B)=>l$.callback((q)=>X.gen(function*(){yield*X.forkScoped(X.gen(function*(){yield*Q(B.cwd);let U=yield*Z.spawn(yield*G(B.cwd,k_(B))),z=yield*l$.mkString(l$.decodeText(U.stderr)).pipe(X.forkScoped),C=yield*l$.decodeText(U.stdout).pipe(l$.splitLines,l$.filter((M)=>M.length>0),l$.runForEach((M)=>X.sync(()=>b1.offerUnsafe(q,zK(M)))),X.forkScoped),D=yield*_K(U.exitCode,B.signal);if(yield*Z8.join(C),D===0||D===1){b1.endUnsafe(q);return}BK(q,z9(yield*Z8.join(z),D))}).pipe(X.catch((U)=>X.sync(()=>{BK(q,U)}))))})),_=X.fn("Ripgrep.search")(function*(B){yield*Q(B.cwd);let q=X.scoped(X.gen(function*(){let U=yield*Z.spawn(yield*G(B.cwd,E_(B))),[z,C,D]=yield*X.all([l$.decodeText(U.stdout).pipe(l$.splitLines,l$.filter((M)=>M.length>0),l$.mapEffect(T_),l$.filter((M)=>M.type==="match"),l$.map((M)=>y_(M.data)),l$.runCollect,X.map((M)=>[...M])),l$.mkString(l$.decodeText(U.stderr)),U.exitCode],{concurrency:"unbounded"});if(D!==0&&D!==1&&D!==2)return yield*X.fail(z9(C,D));return{items:D===1?[]:z,partial:D===2}}));return yield*_K(q,B.signal)}),j=X.fn("Ripgrep.tree")(function*(B){UK.info("tree",B);let q=Array.from(yield*W({cwd:B.cwd,signal:B.signal}).pipe(l$.runCollect));function U(w,N){let x=w.children.get(N);if(x)return x;let b={name:N,children:new Map};return w.children.set(N,b),b}function z(w){return Array.from(w.children.values()).reduce((N,x)=>N+1+z(x),0)}let C={name:"",children:new Map};for(let w of q){if(w.includes(".qitqode"))continue;let N=w.split(J8.sep);if(N.length<2)continue;let x=C;for(let b of N.slice(0,-1))x=U(x,b)}let D=z(C),M=B.limit??D,I=[],P=Array.from(C.children.values()).sort((w,N)=>w.name.localeCompare(N.name)).map((w)=>({node:w,path:w.name})),L=0;for(let w=0;w<P.length&&L<M;w++){let N=P[w];I.push(N.path),L++,P.push(...Array.from(N.node.children.values()).sort((x,b)=>x.name.localeCompare(b.name)).map((x)=>({node:x,path:`${N.path}/${x.name}`})))}if(D>L)I.push(`[${D-L} truncated]`);return I.join(`
38
+ `)});return M9.of({files:W,tree:j,search:_})})),x_=MK.pipe(f.provide(G2.layer),f.provide($$.defaultLayer),f.provide(GJ));var R2={};o$(R2,{layer:()=>uK,defaultLayer:()=>A4,Service:()=>A9,Node:()=>G4,Info:()=>X4,File:()=>R2,Event:()=>j4,Content:()=>W4});var fK=S9(Q4(),1),mK=S9(TK(),1);import E0 from"path";var S2={};o$(S2,{paths:()=>V4,names:()=>K4,Protected:()=>S2});import o6 from"path";import J4 from"os";var r6=J4.homedir(),kK=["Music","Pictures","Movies","Downloads","Desktop","Documents","Public","Applications","Library"],Z4=["Application Support/AddressBook","Calendars","Mail","Messages","Safari","Cookies","Application Support/com.apple.TCC","PersonalizationPortrait","Metadata/CoreSpotlight","Suggestions"],Y4=["/.DocumentRevisions-V100","/.Spotlight-V100","/.Trashes","/.fseventsd"],EK=["AppData","Downloads","Desktop","Documents","Pictures","Music","Videos","OneDrive"];function K4(){if(process.platform==="darwin")return new Set(kK);if(process.platform==="win32")return new Set(EK);return new Set}function V4(){if(process.platform==="darwin")return[...kK.map(($)=>o6.join(r6,$)),...Z4.map(($)=>o6.join(r6,"Library",$)),...Y4];if(process.platform==="win32")return EK.map(($)=>o6.join(r6,$));return[]}var X4=F.object({path:F.string(),added:F.number().int(),removed:F.number().int(),status:F.enum(["added","deleted","modified"])}).meta({ref:"File"}),G4=F.object({name:F.string(),path:F.string(),absolute:F.string(),type:F.enum(["file","directory"]),ignored:F.boolean()}).meta({ref:"FileNode"}),W4=F.object({type:F.enum(["text","binary"]),content:F.string(),diff:F.string().optional(),patch:F.object({oldFileName:F.string(),newFileName:F.string(),oldHeader:F.string().optional(),newHeader:F.string().optional(),hunks:F.array(F.object({oldStart:F.number(),oldLines:F.number(),newStart:F.number(),newLines:F.number(),lines:F.array(F.string())})),index:F.string().optional()}).optional(),encoding:F.literal("base64").optional(),mimeType:F.string().optional()}).meta({ref:"FileContent"}),j4={Edited:Z0.define("file.edited",F.object({file:F.string()}))},K8=O$.create({service:"file"}),xK=393216,U4=new Set(["exe","dll","pdb","bin","so","dylib","o","a","lib","wav","mp3","ogg","oga","ogv","ogx","flac","aac","wma","m4a","weba","mp4","avi","mov","wmv","flv","webm","mkv","zip","tar","gz","gzip","bz","bz2","bzip","bzip2","7z","rar","xz","lz","z","pdf","doc","docx","ppt","pptx","xls","xlsx","dmg","iso","img","vmdk","ttf","otf","woff","woff2","eot","sqlite","db","mdb","apk","ipa","aab","xapk","app","pkg","deb","rpm","snap","flatpak","appimage","msi","msp","jar","war","ear","class","kotlin_module","dex","vdex","odex","oat","art","wasm","wat","bc","ll","s","ko","sys","drv","efi","rom","com"]),H4=new Set(["png","jpg","jpeg","gif","bmp","webp","ico","tif","tiff","svg","svgz","avif","apng","jxl","heic","heif","raw","cr2","nef","arw","dng","orf","raf","pef","x3f"]),B4=new Set(["ts","tsx","mts","cts","mtsx","ctsx","js","jsx","mjs","cjs","sh","bash","zsh","fish","ps1","psm1","cmd","bat","json","jsonc","json5","yaml","yml","toml","md","mdx","txt","xml","html","htm","css","scss","sass","less","graphql","gql","sql","ini","cfg","conf","env"]),_4=new Set(["dockerfile","makefile",".gitignore",".gitattributes",".editorconfig",".npmrc",".nvmrc",".prettierrc",".eslintrc"]),O4={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",webp:"image/webp",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff",svg:"image/svg+xml",svgz:"image/svg+xml",avif:"image/avif",apng:"image/apng",jxl:"image/jxl",heic:"image/heic",heif:"image/heif"},V8=($)=>E0.extname($).toLowerCase().slice(1),q4=($)=>E0.basename($).toLowerCase(),F4=($)=>H4.has(V8($)),z4=($)=>B4.has(V8($)),M4=($)=>_4.has(q4($)),C4=($)=>U4.has(V8($)),D4=($)=>$.startsWith("image/"),bK=($)=>O4[V8($)]||"image/"+V8($);function P4($){let J=$.toLowerCase();if(K8.debug("shouldEncode",{type:J}),!J)return!1;if(J.startsWith("text/"))return!1;if(J.includes("charset="))return!1;let Z=J.split("/",2)[0];return["image","audio","video","font","model","multipart"].includes(Z)}var I4=($)=>{return $.replaceAll("\\","/").replace(/\/+$/,"").split("/").some((Z)=>Z.startsWith(".")&&Z.length>1)},vK=($,J)=>{if(J)return $;let Z=[],Y=[];for(let K of $)if(I4(K))Y.push(K);else Z.push(K);return[...Z,...Y]};class A9 extends D$.Service()("@qitqode/File"){}var uK=f.effect(A9,X.gen(function*(){let $=yield*$$.Service,J=yield*h0.Service,Z=yield*BJ.Service,Y=yield*UJ.Scope,K=yield*i.make(X.fn("File.state")(()=>X.succeed({cache:{files:[],dirs:[]}}))),V=X.fn("File.scan")(function*(){let C=yield*i.context;if(C.directory===E0.parse(C.directory).root)return;let D=C.directory===f$.Path.home&&C.project.id==="global",M={files:[],dirs:[]};if(D){let P=new Set,L=S2.names(),w=new Set(["node_modules","dist","build","target","vendor"]),N=(v)=>v.startsWith(".")||L.has(v),x=(v)=>v.startsWith(".")||w.has(v),b=yield*$.readDirectoryEntries(C.directory).pipe(X.orElseSucceed(()=>[]));for(let v of b){if(v.type!=="directory")continue;if(N(v.name))continue;P.add(v.name+"/");let m=E0.join(C.directory,v.name),A=yield*$.readDirectoryEntries(m).pipe(X.orElseSucceed(()=>[]));for(let u of A){if(u.type!=="directory")continue;if(x(u.name))continue;P.add(v.name+"/"+u.name+"/")}}M.dirs=Array.from(P).toSorted()}else{let P=yield*J.files({cwd:C.directory}).pipe(HJ,X.map((w)=>[...w])),L=new Set;for(let w of P){M.files.push(w);let N=w;while(!0){let x=E0.dirname(N);if(x===".")break;if(x===N)break;if(N=x,L.has(x))continue;L.add(x),M.dirs.push(x+"/")}}}let I=yield*i.get(K);I.cache=M}),Q=yield*X.cached(V().pipe(X.catchCause(()=>X.void))),G=X.fn("File.ensure")(function*(){yield*Q,Q=yield*X.cached(V().pipe(X.catchCause(()=>X.void)))}),W=X.fnUntraced(function*(C){return(yield*Z.run(C,{cwd:(yield*i.context).directory})).text()}),_=(C,D)=>{if(!H$.containsPath(C,D))throw Error("Access denied: path escapes project directory");let M=$$.canonical(C);if(!H$.containsPath(M,D))throw Error("Access denied: path escapes project directory")},j=X.fn("File.init")(function*(){yield*G().pipe(X.forkIn(Y))}),B=X.fn("File.status")(function*(){let C=yield*i.context;if(C.project.vcs!=="git")return[];let D=yield*W(["-c","core.fsmonitor=false","-c","core.quotepath=false","diff","--numstat","HEAD"]),M=[];if(D.trim())for(let L of D.trim().split(`
39
+ `)){let[w,N,x]=L.split("\t");M.push({path:x,added:w==="-"?0:parseInt(w,10),removed:N==="-"?0:parseInt(N,10),status:"modified"})}let I=yield*W(["-c","core.fsmonitor=false","-c","core.quotepath=false","ls-files","--others","--exclude-standard"]);if(I.trim())for(let L of I.trim().split(`
40
+ `)){let w=yield*$.readFileString(E0.join(C.directory,L)).pipe(X.catch(()=>X.succeed(void 0)));if(w===void 0)continue;M.push({path:L,added:w.split(`
41
+ `).length,removed:0,status:"added"})}let P=yield*W(["-c","core.fsmonitor=false","-c","core.quotepath=false","diff","--name-only","--diff-filter=D","HEAD"]);if(P.trim())for(let L of P.trim().split(`
42
+ `))M.push({path:L,added:0,removed:0,status:"deleted"});return M.map((L)=>{let w=E0.isAbsolute(L.path)?L.path:E0.join(C.directory,L.path);return{...L,path:E0.relative(C.directory,w)}})}),q=X.fn("File.read")(function*(C){let b=[];try{const D=R9(b,K8.time("read",{file:C}),0);let M=yield*i.context;let I=E0.join(M.directory,C);_(I,M);if(F4(C)){let u=yield*$.stat(I).pipe(X.catch(()=>X.succeed(void 0)));if(!u)return{type:"text",content:""};if(Number(u.size)>xK)return{type:"binary",content:"",mimeType:bK(C)};let r=yield*$.readFile(I).pipe(X.catch(()=>X.succeed(new Uint8Array)));return{type:"text",content:Buffer.from(r).toString("base64"),mimeType:bK(C),encoding:"base64"}}let P=z4(C)||M4(C);if(C4(C)&&!P)return{type:"binary",content:""};let L=yield*$.stat(I).pipe(X.catch(()=>X.succeed(void 0)));if(!L)return{type:"text",content:""};let w=$$.mimeType(I);let N=P?!1:P4(w);if(N&&!D4(w))return{type:"binary",content:"",mimeType:w};if(N){if(Number(L.size)>xK)return{type:"binary",content:"",mimeType:w};let u=yield*$.readFile(I).pipe(X.catch(()=>X.succeed(new Uint8Array)));return{type:"text",content:Buffer.from(u).toString("base64"),mimeType:w,encoding:"base64"}}let x=yield*$.readFileString(I).pipe(X.map((u)=>u.trim()),X.catch(()=>X.succeed("")));if(M.project.vcs==="git"){let u=yield*W(["-c","core.fsmonitor=false","diff","--",C]);if(!u.trim())u=yield*W(["-c","core.fsmonitor=false","diff","--staged","--",C]);if(u.trim()){let r=yield*Z.show(M.directory,"HEAD",C),S=hK(C,C,r,x,"old","new",{context:1/0,ignoreWhitespace:!0});return{type:"text",content:x,patch:S,diff:gK(S)}}return{type:"text",content:x}}return{type:"text",content:x}}catch(v){var m=v,A=1}finally{w9(b,m,A)}}),U=X.fn("File.list")(function*(C){let D=yield*i.context,M=[".git",".DS_Store"],I=(N)=>!1;if(D.project.vcs==="git"){let N=mK.default(),x=E0.join(D.worktree,".gitignore"),b=yield*$.readFileString(x).pipe(X.catch(()=>X.succeed("")));if(b)N.add(b);let v=E0.join(D.worktree,".ignore"),m=yield*$.readFileString(v).pipe(X.catch(()=>X.succeed("")));if(m)N.add(m);I=N.ignores.bind(N)}let P=C?E0.join(D.directory,C):D.directory;_(P,D);let L=yield*$.readDirectoryEntries(P).pipe(X.orElseSucceed(()=>[])),w=[];for(let N of L){if(M.includes(N.name))continue;let x=E0.join(P,N.name),b=E0.relative(D.directory,x),v=N.type==="directory"?"directory":"file";w.push({name:N.name,path:b,absolute:x,type:v,ignored:I(v==="directory"?b+"/":b)})}return w.sort((N,x)=>{if(N.type!==x.type)return N.type==="directory"?-1:1;return N.name.localeCompare(x.name)})}),z=X.fn("File.search")(function*(C){yield*G();let{cache:D}=yield*i.get(K),M=C.query.trim(),I=C.limit??100,P=C.type??(C.dirs===!1?"file":"all");K8.info("search",{query:M,kind:P});let L=M.startsWith(".")||M.includes("/.");if(!M){if(P==="file")return D.files.slice(0,I);return vK(D.dirs.toSorted(),L).slice(0,I)}let w=P==="file"?D.files:P==="directory"?D.dirs:[...D.files,...D.dirs],N=P==="directory"&&!L?I*20:I,x=fK.default.go(M,w,{limit:N}).map((v)=>v.target),b=P==="directory"?vK(x,L).slice(0,I):x;return K8.info("search",{query:M,kind:P,results:b.length}),b});return K8.info("init"),A9.of({init:j,status:B,read:q,list:U,search:z})})),A4=uK.pipe(f.provide(h0.defaultLayer),f.provide($$.defaultLayer),f.provide(BJ.defaultLayer));var k2={};o$(k2,{layer:()=>YQ,hasNativeBinding:()=>Uq,defaultLayer:()=>Hq,Service:()=>v9,FileWatcher:()=>k2,Event:()=>b9});var N2=d0("path"),Yq=iV(),Kq=eV();function E9($,J={}){let{ignore:Z,...Y}=J;if(Array.isArray(Z)){J={...Y};for(let K of Z)if(Kq(K)){if(!J.ignoreGlobs)J.ignoreGlobs=[];let V=Yq.makeRe(K,{dot:!0,lookbehinds:!1});J.ignoreGlobs.push(V.source)}else{if(!J.ignorePaths)J.ignorePaths=[];J.ignorePaths.push(N2.resolve($,K))}}return J}var j7=($)=>{return{writeSnapshot(J,Z,Y){return $.writeSnapshot(N2.resolve(J),N2.resolve(Z),E9(J,Y))},getEventsSince(J,Z,Y){return $.getEventsSince(N2.resolve(J),N2.resolve(Z),E9(J,Y))},async subscribe(J,Z,Y){return J=N2.resolve(J),Y=E9(J,Y),await $.subscribe(J,Z,Y),{unsubscribe(){return $.unsubscribe(J,Z,Y)}}},unsubscribe(J,Z,Y){return $.unsubscribe(N2.resolve(J),Z,E9(J,Y))}}};import{readdir as Xq}from"fs/promises";import x9 from"path";var U8={};o$(U8,{match:()=>Qq,PATTERNS:()=>Vq,FileIgnore:()=>U8});var $Q=new Set(["node_modules","bower_components",".pnpm-store","vendor",".npm","dist","build","out",".next","target","bin","obj",".git",".svn",".hg",".vscode",".idea",".turbo",".output","desktop",".sst",".cache",".webkit-cache","__pycache__",".pytest_cache","mypy_cache",".history",".gradle"]),JQ=["**/*.swp","**/*.swo","**/*.pyc","**/.DS_Store","**/Thumbs.db","**/logs/**","**/tmp/**","**/temp/**","**/*.log","**/coverage/**","**/.nyc_output/**"],Vq=[...JQ,...$Q];function Qq($,J){for(let K of J?.whitelist||[])if(y2.match(K,$))return!1;let Z=$.split(/[/\\]/);for(let K=0;K<Z.length;K++)if($Q.has(Z[K]))return!0;let Y=J?.extra||[];for(let K of[...JQ,...Y])if(y2.match(K,$))return!0;return!1}var qJ=O$.create({service:"file.watcher"}),Gq=1e4,b9={Updated:Z0.define("file.watcher.updated",F.object({file:F.string(),event:F.union([F.literal("add"),F.literal("change"),F.literal("unlink")])}))},ZQ=T2(()=>{try{let J=d0(`@parcel/watcher-${process.platform}-${process.arch}${process.platform==="linux"?"-bionic":""}`);return j7(J)}catch($){qJ.error("failed to load watcher binding",{error:$});return}});function Wq(){if(process.platform==="win32")return"windows";if(process.platform==="darwin")return"fs-events";if(process.platform==="linux")return"inotify"}function jq($){return S2.paths().filter((J)=>{let Z=x9.relative($,J);return Z!==""&&Z!==".."&&!Z.startsWith(`..${x9.sep}`)&&!x9.isAbsolute(Z)})}var Uq=()=>!!ZQ();class v9 extends D$.Service()("@qitqode/FileWatcher"){}var YQ=f.effect(v9,X.gen(function*(){let $=yield*w$.Service,J=yield*BJ.Service,Z=yield*i.make(X.fn("FileWatcher.state")(function*(){if(yield*k$.QITQODE_EXPERIMENTAL_DISABLE_FILEWATCHER)return;qJ.info("init",{directory:H$.directory});let Y=Wq();if(!Y){qJ.error("watcher backend not supported",{directory:H$.directory,platform:process.platform});return}let K=ZQ();if(!K)return;qJ.info("watcher backend",{directory:H$.directory,platform:process.platform,backend:Y});let V=[];yield*X.addFinalizer(()=>X.promise(()=>Promise.allSettled(V.map((j)=>j.unsubscribe()))));let Q=H$.bind((j,B)=>{if(j)return;for(let q of B){if(q.type==="create")P$.publish(b9.Updated,{file:q.path,event:"add"});if(q.type==="update")P$.publish(b9.Updated,{file:q.path,event:"change"});if(q.type==="delete")P$.publish(b9.Updated,{file:q.path,event:"unlink"})}}),G=(j,B)=>{let q=K.subscribe(j,Q,{ignore:B,backend:Y});return X.gen(function*(){let U=yield*X.promise(()=>q);V.push(U)}).pipe(X.timeout(Gq),X.catchCause((U)=>{return qJ.error("failed to subscribe",{dir:j,cause:u0.pretty(U)}),q.then((z)=>z.unsubscribe()).catch(()=>{}),X.void}))},_=(yield*$.get()).watcher?.ignore??[];if(yield*k$.QITQODE_EXPERIMENTAL_FILEWATCHER)yield*G(H$.directory,[...U8.PATTERNS,..._,...jq(H$.directory)]);if(H$.project.vcs==="git"){let j=yield*J.run(["rev-parse","--git-dir"],{cwd:H$.project.worktree}),B=j.exitCode===0?x9.resolve(H$.project.worktree,j.text().trim()):void 0;if(B&&!_.includes(".git")&&!_.includes(B)){let q=(yield*X.promise(()=>Xq(B).catch(()=>[]))).filter((U)=>U!=="HEAD");yield*G(B,q)}}},X.catchCause((Y)=>{return qJ.error("failed to init watcher service",{cause:u0.pretty(Y)}),X.void})));return v9.of({init:X.fn("FileWatcher.init")(function*(){yield*i.get(Z)})})})),Hq=YQ.pipe(f.provide(w$.defaultLayer),f.provide(BJ.defaultLayer));var FJ={};o$(FJ,{layer:()=>GQ,defaultLayer:()=>Oq,Service:()=>h9,Discovery:()=>FJ});var Bq=4,_q=8;class QQ extends F$.Class("IndexSkill")({name:F$.String,files:F$.Array(F$.String)}){}class XQ extends F$.Class("Index")({skills:F$.Array(QQ)}){}class h9 extends D$.Service()("@qitqode/SkillDiscovery"){}var GQ=f.effect(h9,X.gen(function*(){let $=O$.create({service:"skill-discovery"}),J=yield*$$.Service,Z=yield*KQ.Path,Y=v1.filterStatusOk(f9(yield*v1.HttpClient)),K=Z.join(f$.Path.cache,"skills"),V=X.fn("Discovery.download")(function*(G,W){if(yield*J.exists(W).pipe(X.orDie))return!0;return yield*X2.get(G).pipe(Y.execute,X.flatMap((_)=>_.arrayBuffer),X.flatMap((_)=>J.writeWithDirs(W,new Uint8Array(_))),X.as(!0),X.catch((_)=>X.sync(()=>{return $.error("failed to download",{url:G,err:_}),!1})))}),Q=X.fn("Discovery.pull")(function*(G){let W=G.endsWith("/")?G:`${G}/`,_=new URL("index.json",W).href,j=W.slice(0,-1);$.info("fetching index",{url:_});let B=yield*X2.get(_).pipe(X2.acceptJson,Y.execute,X.flatMap(VQ.schemaBodyJson(XQ)),X.catch((z)=>X.sync(()=>{return $.error("failed to fetch index",{url:_,err:z}),null})));if(!B)return[];let q=B.skills.filter((z)=>{if(!z.files.includes("SKILL.md"))return $.warn("skill entry missing SKILL.md",{url:_,skill:z.name}),!1;return!0});return(yield*X.forEach(q,(z)=>X.gen(function*(){let C=Z.join(K,z.name);yield*X.forEach(z.files,(M)=>V(new URL(M,`${j}/${z.name}/`).href,Z.join(C,M)),{concurrency:_q});let D=Z.join(C,"SKILL.md");return(yield*J.exists(D).pipe(X.orDie))?C:null}),{concurrency:Bq})).filter((z)=>z!==null)});return h9.of({pull:Q})})),Oq=GQ.pipe(f.provide(G2.layer),f.provide($$.defaultLayer),f.provide(g9.layer));var a0={};o$(a0,{layer:()=>CQ,fmt:()=>vq,defaultLayer:()=>bq,Skill:()=>a0,Service:()=>l9,NameMismatchError:()=>Tq,InvalidError:()=>yq,Info:()=>MQ});import Rq from"os";import zJ from"path";import{pathToFileURL as wq}from"url";import d9 from"path";import{pathToFileURL as zq}from"url";var B7=S9(Fq(),1);import qq from"path";import U7 from"fs";import H7 from"path";function WQ($,J,Z){let Y=J?H7.join($,J):$;for(let K of U7.readdirSync(Y,{withFileTypes:!0})){let V=J?`${J}/${K.name}`:K.name;if(K.isDirectory())WQ($,V,Z);else Z[V]=U7.readFileSync(H7.join(Y,K.name),"utf8")}}function m9($){let J={};for(let Z of U7.readdirSync($,{withFileTypes:!0})){if(!Z.isDirectory())continue;let Y={};if(WQ(H7.join($,Z.name),"",Y),Object.keys(Y).length>0)J[Z.name]=Y}return J}function jQ(){return m9(qq.resolve(import.meta.dir,".bundle"))}import UQ from"path";function u9($){return X.gen(function*(){if($.skipIfPresent&&(yield*$.fsys.existsSafe($.marker)))return $.root;for(let[J,Z]of Object.entries($.bundle)){let Y=UQ.join($.root,"skills",J);for(let[K,V]of Object.entries(Z))yield*$.fsys.writeWithDirs(UQ.join(Y,K),V)}return yield*$.fsys.writeWithDirs($.marker,$.markerContent),$.onExtracted($.root),$.root})}function Mq(){try{return{ask:{"SKILL.md":`---
43
43
  name: compose:ask
44
44
  hidden: true
45
45
  description: "Use whenever you need a decision, clarification, or approval from the user \u2014 covers how to ask with the question tool, and how to resolve the decision yourself when no user is available (question tool absent, or a [Never-Ask] response)"
@@ -6337,8 +6337,8 @@ Ready to implement <feature-name>
6337
6337
  - Verify directory is ignored for project-local
6338
6338
  - Auto-detect and run project setup
6339
6339
  - Verify clean test baseline
6340
- `}}}catch($){if($ instanceof ReferenceError)return GV();throw $}}var jV=Oq(),qq=O$.create({service:"skill.compose"}),UV=G.fn("Skill.extractComposeBundle")(function*($){let J=d9.join(B8.data,"compose",E2),Z=d9.join(J,".extracted");return yield*u9({fsys:$,bundle:jV,root:J,marker:Z,markerContent:E2,skipIfPresent:!p9,onExtracted:(Y)=>qq.info("extracted compose skills",{root:Y})})});function Fq($){try{return H7.default($,{})}catch{let J=WV($);if(J===$)return;try{return H7.default(J,{})}catch{return}}}function MR(){let $=d9.join(B8.data,"compose",E2),J=[];for(let[Z,Y]of Object.entries(jV)){let K=Y["SKILL.md"];if(!K)continue;let Q=Fq(K);if(!Q?.data?.name||!Q?.data?.description)continue;let V=_q(d9.join($,"skills",Z,"SKILL.md")).href;J.push(" <skill>",` <name>${Q.data.name}</name>`,` <description>${Q.data.description}</description>`,` <location>${V}</location>`," </skill>")}if(J.length===0)return"";return["<compose_skills>",...J,"</compose_skills>"].join(`
6341
- `)}import HV from"path";import zq from"path";function BV(){return m9(zq.resolve(import.meta.dir,".bundle"))}function Cq(){try{return{"self-extend":{"reference/hook-api.md":`# Hook API Reference
6340
+ `}}}catch($){if($ instanceof ReferenceError)return jQ();throw $}}var BQ=Mq(),Cq=O$.create({service:"skill.compose"}),_Q=X.fn("Skill.extractComposeBundle")(function*($){let J=d9.join(H8.data,"compose",E2),Z=d9.join(J,".extracted");return yield*u9({fsys:$,bundle:BQ,root:J,marker:Z,markerContent:E2,skipIfPresent:!p9,onExtracted:(Y)=>Cq.info("extracted compose skills",{root:Y})})});function Dq($){try{return B7.default($,{})}catch{let J=HQ($);if(J===$)return;try{return B7.default(J,{})}catch{return}}}function Lw(){let $=d9.join(H8.data,"compose",E2),J=[];for(let[Z,Y]of Object.entries(BQ)){let K=Y["SKILL.md"];if(!K)continue;let V=Dq(K);if(!V?.data?.name||!V?.data?.description)continue;let Q=zq(d9.join($,"skills",Z,"SKILL.md")).href;J.push(" <skill>",` <name>${V.data.name}</name>`,` <description>${V.data.description}</description>`,` <location>${Q}</location>`," </skill>")}if(J.length===0)return"";return["<compose_skills>",...J,"</compose_skills>"].join(`
6341
+ `)}import qQ from"path";import Pq from"path";function OQ(){return m9(Pq.resolve(import.meta.dir,".bundle"))}function Iq(){try{return{"self-extend":{"reference/hook-api.md":`# Hook API Reference
6342
6342
 
6343
6343
  ## File Format
6344
6344
 
@@ -7204,9 +7204,9 @@ For full type signatures, all available fields, and more examples:
7204
7204
  - Cannot modify the permission system
7205
7205
  - Tool output truncated at 50KB / 2000 lines
7206
7206
  - Prefer small, composable extensions over monolithic ones
7207
- `}}}catch($){if($ instanceof ReferenceError)return BV();throw $}}var Mq=Cq(),Dq=O$.create({service:"skill.builtin"}),_V=G.fn("Skill.extractBuiltinBundle")(function*($){let J=HV.join(B8.data,"builtin_skills",E2),Z=HV.join(J,".extracted");return yield*u9({fsys:$,bundle:Mq,root:J,marker:Z,markerContent:E2,skipIfPresent:!p9,onExtracted:(Y)=>Dq.info("extracted builtin skills",{root:Y})})});var H8=O$.create({service:"skill"}),Aq=[".claude",".agents",".codex",".opencode"],OV="skills/**/SKILL.md",Sq="{skill,skills}/**/SKILL.md",c9="**/SKILL.md",qV=F.object({name:F.string(),description:F.string(),location:F.string(),content:F.string(),hidden:F.boolean().optional()}),wq=o9.create("SkillInvalidError",F.object({path:F.string(),message:F.string().optional(),issues:F.custom().optional()})),Rq=o9.create("SkillNameMismatchError",F.object({path:F.string(),expected:F.string(),actual:F.string()})),Lq=G.fnUntraced(function*($,J,Z){let Y=yield*G.tryPromise({try:()=>_7.parse(J),catch:(Q)=>Q}).pipe(G.catch(G.fnUntraced(function*(Q){let V=_7.FrontmatterError.isInstance(Q)?Q.data.message:`Failed to parse skill ${J}`,{Session:X}=yield*G.promise(()=>import("./chunk-hd8q4msp.js"));yield*Z.publish(X.Event.Error,{error:new o9.Unknown({message:V}).toObject()}),H8.error("failed to load skill",{skill:J,err:Q});return})));if(!Y)return;let K=qV.pick({name:!0,description:!0,hidden:!0}).safeParse(Y.data);if(!K.success)return;if($.skills[K.data.name])H8.warn("duplicate skill name",{name:K.data.name,existing:$.skills[K.data.name].location,duplicate:J});$.dirs.add(zJ.dirname(J)),$.skills[K.data.name]={name:K.data.name,description:K.data.description,location:J,content:Y.content,hidden:K.data.hidden}}),x2=G.fnUntraced(function*($,J,Z,Y){let K=yield*G.tryPromise({try:()=>y2.scan(Z,{cwd:J,absolute:!0,include:"file",symlink:!0,dot:Y?.dot}),catch:(Q)=>Q}).pipe(G.catch((Q)=>{if(!Y?.scope)return G.die(Q);return H8.error(`failed to scan ${Y.scope} skills`,{dir:J,error:Q}),G.succeed([])}));for(let Q of K)$.matches.add(Q),$.dirs.add(zJ.dirname(Q))}),Nq=G.fnUntraced(function*($,J,Z,Y,K){let Q={matches:new Set,dirs:new Set};if(!k$.QITQODE_DISABLE_BUILTIN_SKILLS){let W=yield*_V(Z).pipe(G.catch(()=>G.succeed(void 0)));if(W&&(yield*Z.isDir(W)))yield*x2(Q,W,c9,{scope:"builtin"})}if(!k$.QITQODE_DISABLE_COMPOSE_SKILLS){let W=yield*UV(Z).pipe(G.catch(()=>G.succeed(void 0)));if(W&&(yield*Z.isDir(W)))yield*x2(Q,W,c9,{scope:"compose"})}if(!k$.QITQODE_DISABLE_EXTERNAL_SKILLS){let W=Aq.filter((j)=>{if(j===".claude"&&k$.QITQODE_DISABLE_CLAUDE_CODE_SKILLS)return!1;if(j===".codex"&&k$.QITQODE_DISABLE_CODEX_SKILLS)return!1;if(j===".opencode"&&k$.QITQODE_DISABLE_OPENCODE_SKILLS)return!1;return!0});for(let j of W){let H=zJ.join(f$.Path.home,j);if(!(yield*Z.isDir(H)))continue;yield*x2(Q,H,OV,{dot:!0,scope:"global"})}let _=yield*Z.up({targets:W,start:Y,stop:K}).pipe(G.catch(()=>G.succeed([])));for(let j of _)yield*x2(Q,j,OV,{dot:!0,scope:"project"})}let V=yield*$.directories();for(let W of V)yield*x2(Q,W,Sq);let X=yield*$.get();for(let W of X.skills?.paths??[]){let _=W.startsWith("~/")?zJ.join(Pq.homedir(),W.slice(2)):W,j=zJ.isAbsolute(_)?_:zJ.join(Y,_);if(!(yield*Z.isDir(j))){H8.warn("skill path not found",{path:j});continue}yield*x2(Q,j,c9)}for(let W of X.skills?.urls??[]){let _=yield*J.pull(W);for(let j of _)yield*x2(Q,j,c9)}return{matches:Array.from(Q.matches),dirs:Array.from(Q.dirs)}}),yq=G.fnUntraced(function*($,J,Z){yield*G.forEach(J.matches,(Y)=>Lq($,Y,Z),{concurrency:16,discard:!0}),H8.info("init",{count:Object.keys($.skills).length})});class l9 extends D$.Service()("@qitqode/Skill"){}var FV=f.effect(l9,G.gen(function*(){let $=yield*FJ.Service,J=yield*R$.Service,Z=yield*P$.Service,Y=yield*$$.Service,K=yield*i.make(G.fn("Skill.discovery")(function*(H){return yield*Nq(J,$,Y,H.directory,H.worktree)})),Q=yield*i.make(G.fn("Skill.state")(function*(H){let q={skills:{},dirs:new Set};return yield*yq(q,yield*i.get(K),Z),q})),V=G.fn("Skill.get")(function*(H){return(yield*i.get(Q)).skills[H]}),X=G.fn("Skill.all")(function*(){let H=yield*i.get(Q);return Object.values(H.skills)}),W=G.fn("Skill.dirs")(function*(){return(yield*i.get(K)).dirs}),_=G.fn("Skill.available")(function*(H){let q=yield*i.get(Q),U=Object.values(q.skills).filter((z)=>!z.hidden);if(U=U.toSorted((z,M)=>z.name.localeCompare(M.name)),!H)return U;return U.filter((z)=>E$.evaluate("skill",z.name,H.permission).action!=="deny")}),j=G.fn("Skill.reload")(function*(){yield*i.invalidate(K),yield*i.invalidate(Q)});return l9.of({get:V,all:X,dirs:W,available:_,reload:j})})),Tq=FV.pipe(f.provide(FJ.defaultLayer),f.provide(R$.defaultLayer),f.provide(P$.layer),f.provide($$.defaultLayer));function kq($,J){if($.length===0)return"No skills are currently available.";if(J.verbose)return["<available_skills>",...$.sort((Z,Y)=>Z.name.localeCompare(Y.name)).flatMap((Z)=>[" <skill>",` <name>${Z.name}</name>`,` <description>${Z.description}</description>`,` <location>${Iq(Z.location).href}</location>`," </skill>"]),"</available_skills>"].join(`
7207
+ `}}}catch($){if($ instanceof ReferenceError)return OQ();throw $}}var Aq=Iq(),Sq=O$.create({service:"skill.builtin"}),FQ=X.fn("Skill.extractBuiltinBundle")(function*($){let J=qQ.join(H8.data,"builtin_skills",E2),Z=qQ.join(J,".extracted");return yield*u9({fsys:$,bundle:Aq,root:J,marker:Z,markerContent:E2,skipIfPresent:!p9,onExtracted:(Y)=>Sq.info("extracted builtin skills",{root:Y})})});var B8=O$.create({service:"skill"}),Lq=[".claude",".agents",".codex",".opencode"],zQ="skills/**/SKILL.md",Nq="{skill,skills}/**/SKILL.md",c9="**/SKILL.md",MQ=F.object({name:F.string(),description:F.string(),location:F.string(),content:F.string(),hidden:F.boolean().optional()}),yq=o9.create("SkillInvalidError",F.object({path:F.string(),message:F.string().optional(),issues:F.custom().optional()})),Tq=o9.create("SkillNameMismatchError",F.object({path:F.string(),expected:F.string(),actual:F.string()})),kq=X.fnUntraced(function*($,J,Z){let Y=yield*X.tryPromise({try:()=>_7.parse(J),catch:(V)=>V}).pipe(X.catch(X.fnUntraced(function*(V){let Q=_7.FrontmatterError.isInstance(V)?V.data.message:`Failed to parse skill ${J}`,{Session:G}=yield*X.promise(()=>import("./chunk-egae7vvg.js"));yield*Z.publish(G.Event.Error,{error:new o9.Unknown({message:Q}).toObject()}),B8.error("failed to load skill",{skill:J,err:V});return})));if(!Y)return;let K=MQ.pick({name:!0,description:!0,hidden:!0}).safeParse(Y.data);if(!K.success)return;if($.skills[K.data.name])B8.warn("duplicate skill name",{name:K.data.name,existing:$.skills[K.data.name].location,duplicate:J});$.dirs.add(zJ.dirname(J)),$.skills[K.data.name]={name:K.data.name,description:K.data.description,location:J,content:Y.content,hidden:K.data.hidden}}),x2=X.fnUntraced(function*($,J,Z,Y){let K=yield*X.tryPromise({try:()=>y2.scan(Z,{cwd:J,absolute:!0,include:"file",symlink:!0,dot:Y?.dot}),catch:(V)=>V}).pipe(X.catch((V)=>{if(!Y?.scope)return X.die(V);return B8.error(`failed to scan ${Y.scope} skills`,{dir:J,error:V}),X.succeed([])}));for(let V of K)$.matches.add(V),$.dirs.add(zJ.dirname(V))}),Eq=X.fnUntraced(function*($,J,Z,Y,K){let V={matches:new Set,dirs:new Set};if(!k$.QITQODE_DISABLE_BUILTIN_SKILLS){let W=yield*FQ(Z).pipe(X.catch(()=>X.succeed(void 0)));if(W&&(yield*Z.isDir(W)))yield*x2(V,W,c9,{scope:"builtin"})}if(!k$.QITQODE_DISABLE_COMPOSE_SKILLS){let W=yield*_Q(Z).pipe(X.catch(()=>X.succeed(void 0)));if(W&&(yield*Z.isDir(W)))yield*x2(V,W,c9,{scope:"compose"})}if(!k$.QITQODE_DISABLE_EXTERNAL_SKILLS){let W=Lq.filter((j)=>{if(j===".claude"&&k$.QITQODE_DISABLE_CLAUDE_CODE_SKILLS)return!1;if(j===".codex"&&k$.QITQODE_DISABLE_CODEX_SKILLS)return!1;if(j===".opencode"&&k$.QITQODE_DISABLE_OPENCODE_SKILLS)return!1;return!0});for(let j of W){let B=zJ.join(f$.Path.home,j);if(!(yield*Z.isDir(B)))continue;yield*x2(V,B,zQ,{dot:!0,scope:"global"})}let _=yield*Z.up({targets:W,start:Y,stop:K}).pipe(X.catch(()=>X.succeed([])));for(let j of _)yield*x2(V,j,zQ,{dot:!0,scope:"project"})}let Q=yield*$.directories();for(let W of Q)yield*x2(V,W,Nq);let G=yield*$.get();for(let W of G.skills?.paths??[]){let _=W.startsWith("~/")?zJ.join(Rq.homedir(),W.slice(2)):W,j=zJ.isAbsolute(_)?_:zJ.join(Y,_);if(!(yield*Z.isDir(j))){B8.warn("skill path not found",{path:j});continue}yield*x2(V,j,c9)}for(let W of G.skills?.urls??[]){let _=yield*J.pull(W);for(let j of _)yield*x2(V,j,c9)}return{matches:Array.from(V.matches),dirs:Array.from(V.dirs)}}),xq=X.fnUntraced(function*($,J,Z){yield*X.forEach(J.matches,(Y)=>kq($,Y,Z),{concurrency:16,discard:!0}),B8.info("init",{count:Object.keys($.skills).length})});class l9 extends D$.Service()("@qitqode/Skill"){}var CQ=f.effect(l9,X.gen(function*(){let $=yield*FJ.Service,J=yield*w$.Service,Z=yield*P$.Service,Y=yield*$$.Service,K=yield*i.make(X.fn("Skill.discovery")(function*(B){return yield*Eq(J,$,Y,B.directory,B.worktree)})),V=yield*i.make(X.fn("Skill.state")(function*(B){let q={skills:{},dirs:new Set};return yield*xq(q,yield*i.get(K),Z),q})),Q=X.fn("Skill.get")(function*(B){return(yield*i.get(V)).skills[B]}),G=X.fn("Skill.all")(function*(){let B=yield*i.get(V);return Object.values(B.skills)}),W=X.fn("Skill.dirs")(function*(){return(yield*i.get(K)).dirs}),_=X.fn("Skill.available")(function*(B){let q=yield*i.get(V),U=Object.values(q.skills).filter((z)=>!z.hidden);if(U=U.toSorted((z,C)=>z.name.localeCompare(C.name)),!B)return U;return U.filter((z)=>E$.evaluate("skill",z.name,B.permission).action!=="deny")}),j=X.fn("Skill.reload")(function*(){yield*i.invalidate(K),yield*i.invalidate(V)});return l9.of({get:Q,all:G,dirs:W,available:_,reload:j})})),bq=CQ.pipe(f.provide(FJ.defaultLayer),f.provide(w$.defaultLayer),f.provide(P$.layer),f.provide($$.defaultLayer));function vq($,J){if($.length===0)return"No skills are currently available.";if(J.verbose)return["<available_skills>",...$.sort((Z,Y)=>Z.name.localeCompare(Y.name)).flatMap((Z)=>[" <skill>",` <name>${Z.name}</name>`,` <description>${Z.description}</description>`,` <location>${wq(Z.location).href}</location>`," </skill>"]),"</available_skills>"].join(`
7208
7208
  `);return["## Available Skills",...$.toSorted((Z,Y)=>Z.name.localeCompare(Y.name)).map((Z)=>`- **${Z.name}**: ${Z.description}`)].join(`
7209
- `)}var g1={};o$(g1,{layer:()=>RV,defaultLayer:()=>pq,Service:()=>n9});import wV from"path";import dq from"os";import*as CJ from"fs/promises";import IV from"path";var q0=b2("memory_fts",{id:t0().primaryKey({autoIncrement:!0}),path:i$().notNull().unique(),scope:i$().notNull(),scope_id:i$().notNull().default(""),type:i$().notNull(),body:i$().notNull(),fingerprint:i$().notNull(),last_indexed_at:t0().notNull()},($)=>[e0("memory_fts_scope_idx").on($.scope,$.scope_id),e0("memory_fts_type_idx").on($.type)]);var Eq=["feedback","project","reference","user"],xq=[{match:/^memory$/i,type:"memory"},{match:/^memory-/i,type:"memory"},{match:/^checkpoint$/,type:"checkpoint"},{match:/^checkpoint-/,type:"checkpoint"},{match:/^tasks\/[^/]+\/progress$/,type:"progress"},{match:/^tasks\/[^/]+\/notes$/,type:"notes"}];function bq($){for(let J of xq)if(J.match.test($))return J.type;return"free"}function zV($){let Z=$.replaceAll("\\","/").match(/\/memory\/(global|projects|sessions)(?:\/([^/]+))?\/(.+)\.md$/);if(!Z)return null;let[,Y,K,Q]=Z,V=Y==="global"?"":K??"",X=Q;return{scope:Y,scope_id:V,type:bq(X),key:X}}var vq=/\/\.claude\/projects\/([^/]+)\/memory\/(.+)\.md$/;function CV($){let J=$.replaceAll("\\","/").match(vq);if(!J)return null;let[,Z,Y]=J;return{scope:"cc",scope_id:Z,type:"free",key:Y}}var hq=/^---\n([\s\S]*?)\n---\n/,gq=/^[ \t]+type:[ \t]*(\w+)[ \t]*$/m;function MV($){let J=$.match(hq);if(!J)return null;let Y=J[1].match(gq);if(!Y)return null;let K=Y[1];return Eq.includes(K)?K:null}var DV=O$.create({service:"memory.reconcile"});async function AV($){let J=[];async function Z(Y){let K=await CJ.readdir(Y,{withFileTypes:!0}).catch((Q)=>{if(Q.code==="ENOENT")return[];throw Q});for(let Q of K){let V=IV.join(Y,Q.name);if(Q.isDirectory())await Z(V);else if(Q.isFile()&&V.endsWith(".md"))J.push(V)}}return await Z($),J}async function fq($){let J=await CJ.readdir($,{withFileTypes:!0}).catch((Y)=>{if(Y.code==="ENOENT")return[];throw Y}),Z=[];for(let Y of J){if(!Y.isDirectory())continue;let K=IV.join($,Y.name,"memory");if(!await CJ.stat(K).then(()=>!0).catch(()=>!1))continue;let V=await AV(K);for(let X of V)Z.push(X)}return Z}async function PV($,J,Z,Y){let K=await CJ.stat($).catch((W)=>{if(W.code==="ENOENT")return null;throw W});if(!K)return"skipped";let Q=`${K.size}-${K.mtimeMs}`;if(Y===Q)return"hit";let V=await Bun.file($).text(),X=Z==="cc"?MV(V)??"free":J.type;return z$.use((W)=>W.insert(q0).values({path:$,scope:J.scope,scope_id:J.scope_id,type:X,body:V,fingerprint:Q,last_indexed_at:Date.now()}).onConflictDoUpdate({target:q0.path,set:{scope:J.scope,scope_id:J.scope_id,type:X,body:V,fingerprint:Q,last_indexed_at:Date.now()}}).run()),"updated"}async function O7($){let J=new Set(await AV($.qode)),Z=$.cc?new Set(await fq($.cc)):new Set,Y=new Set([...J,...Z]),K=new Map(z$.use((X)=>X.select({path:q0.path,fingerprint:q0.fingerprint}).from(q0).all()).map((X)=>[X.path,X.fingerprint])),Q=0;for(let X of K.keys())if(!Y.has(X))z$.use((W)=>W.delete(q0).where(G$(q0.path,X)).run()),Q++;let V=0;for(let X of J){let W=zV(X);if(!W){DV.warn("path outside memory layout, skipping",{path:X});continue}if(await PV(X,W,"qode",K.get(X))==="updated")V++}for(let X of Z){let W=CV(X);if(!W){DV.warn("CC path failed to parse, skipping",{path:X});continue}if(await PV(X,W,"cc",K.get(X))==="updated")V++}return{indexed:V,pruned:Q}}function r9($,J){let Z=$.match(/[\p{L}\p{N}_]+/gu)?.map((K)=>K.trim()).filter(Boolean)??[];if(Z.length===0)return null;return Z.map((K)=>`"${K.replaceAll('"',"")}"`).join(` ${J} `)}function SV($){return r9($,"OR")}var mq=64,uq=8,i9=4096;function s9($){let J=z$.Client().$client,Z=$.conditions.length>0?`WHERE ${$.conditions.join(" AND ")}`:"",Y=`
7209
+ `)}var g1={};o$(g1,{layer:()=>yQ,defaultLayer:()=>rq,Service:()=>n9});import NQ from"path";import oq from"os";import*as MJ from"fs/promises";import RQ from"path";var q0=b2("memory_fts",{id:t0().primaryKey({autoIncrement:!0}),path:i$().notNull().unique(),scope:i$().notNull(),scope_id:i$().notNull().default(""),type:i$().notNull(),body:i$().notNull(),fingerprint:i$().notNull(),last_indexed_at:t0().notNull()},($)=>[e0("memory_fts_scope_idx").on($.scope,$.scope_id),e0("memory_fts_type_idx").on($.type)]);var hq=["feedback","project","reference","user"],gq=[{match:/^memory$/i,type:"memory"},{match:/^memory-/i,type:"memory"},{match:/^checkpoint$/,type:"checkpoint"},{match:/^checkpoint-/,type:"checkpoint"},{match:/^tasks\/[^/]+\/progress$/,type:"progress"},{match:/^tasks\/[^/]+\/notes$/,type:"notes"}];function fq($){for(let J of gq)if(J.match.test($))return J.type;return"free"}function DQ($){let Z=$.replaceAll("\\","/").match(/\/memory\/(global|projects|sessions)(?:\/([^/]+))?\/(.+)\.md$/);if(!Z)return null;let[,Y,K,V]=Z,Q=Y==="global"?"":K??"",G=V;return{scope:Y,scope_id:Q,type:fq(G),key:G}}var mq=/\/\.claude\/projects\/([^/]+)\/memory\/(.+)\.md$/;function PQ($){let J=$.replaceAll("\\","/").match(mq);if(!J)return null;let[,Z,Y]=J;return{scope:"cc",scope_id:Z,type:"free",key:Y}}var uq=/^---\n([\s\S]*?)\n---\n/,dq=/^[ \t]+type:[ \t]*(\w+)[ \t]*$/m;function IQ($){let J=$.match(uq);if(!J)return null;let Y=J[1].match(dq);if(!Y)return null;let K=Y[1];return hq.includes(K)?K:null}var AQ=O$.create({service:"memory.reconcile"});async function wQ($){let J=[];async function Z(Y){let K=await MJ.readdir(Y,{withFileTypes:!0}).catch((V)=>{if(V.code==="ENOENT")return[];throw V});for(let V of K){let Q=RQ.join(Y,V.name);if(V.isDirectory())await Z(Q);else if(V.isFile()&&Q.endsWith(".md"))J.push(Q)}}return await Z($),J}async function pq($){let J=await MJ.readdir($,{withFileTypes:!0}).catch((Y)=>{if(Y.code==="ENOENT")return[];throw Y}),Z=[];for(let Y of J){if(!Y.isDirectory())continue;let K=RQ.join($,Y.name,"memory");if(!await MJ.stat(K).then(()=>!0).catch(()=>!1))continue;let Q=await wQ(K);for(let G of Q)Z.push(G)}return Z}async function SQ($,J,Z,Y){let K=await MJ.stat($).catch((W)=>{if(W.code==="ENOENT")return null;throw W});if(!K)return"skipped";let V=`${K.size}-${K.mtimeMs}`;if(Y===V)return"hit";let Q=await Bun.file($).text(),G=Z==="cc"?IQ(Q)??"free":J.type;return z$.use((W)=>W.insert(q0).values({path:$,scope:J.scope,scope_id:J.scope_id,type:G,body:Q,fingerprint:V,last_indexed_at:Date.now()}).onConflictDoUpdate({target:q0.path,set:{scope:J.scope,scope_id:J.scope_id,type:G,body:Q,fingerprint:V,last_indexed_at:Date.now()}}).run()),"updated"}async function O7($){let J=new Set(await wQ($.qode)),Z=$.cc?new Set(await pq($.cc)):new Set,Y=new Set([...J,...Z]),K=new Map(z$.use((G)=>G.select({path:q0.path,fingerprint:q0.fingerprint}).from(q0).all()).map((G)=>[G.path,G.fingerprint])),V=0;for(let G of K.keys())if(!Y.has(G))z$.use((W)=>W.delete(q0).where(X$(q0.path,G)).run()),V++;let Q=0;for(let G of J){let W=DQ(G);if(!W){AQ.warn("path outside memory layout, skipping",{path:G});continue}if(await SQ(G,W,"qode",K.get(G))==="updated")Q++}for(let G of Z){let W=PQ(G);if(!W){AQ.warn("CC path failed to parse, skipping",{path:G});continue}if(await SQ(G,W,"cc",K.get(G))==="updated")Q++}return{indexed:Q,pruned:V}}function r9($,J){let Z=$.match(/[\p{L}\p{N}_]+/gu)?.map((K)=>K.trim()).filter(Boolean)??[];if(Z.length===0)return null;return Z.map((K)=>`"${K.replaceAll('"',"")}"`).join(` ${J} `)}function LQ($){return r9($,"OR")}var cq=64,lq=8,i9=4096;function s9($){let J=z$.Client().$client,Z=$.conditions.length>0?`WHERE ${$.conditions.join(" AND ")}`:"",Y=`
7210
7210
  WITH matched(fts_rowid, fts_score) AS (
7211
7211
  SELECT rowid, rank
7212
7212
  FROM ${$.idx}
@@ -7222,25 +7222,25 @@ For full type signatures, all available fields, and more examples:
7222
7222
  ${Z}
7223
7223
  ORDER BY matched.fts_score
7224
7224
  LIMIT ?
7225
- `,K=J.query(Y),Q=[],V=Math.max($.limit,mq);for(;;){if(Q=K.all($.ftsQuery,V,...$.params,$.limit),Q.length>=$.limit)break;if($.conditions.length===0)break;if(V>=i9)break;V=Math.min(V*uq,i9)}let X=!1;if(Q.length<$.limit&&$.conditions.length>0&&V>=i9){let H=`
7225
+ `,K=J.query(Y),V=[],Q=Math.max($.limit,cq);for(;;){if(V=K.all($.ftsQuery,Q,...$.params,$.limit),V.length>=$.limit)break;if($.conditions.length===0)break;if(Q>=i9)break;Q=Math.min(Q*lq,i9)}let G=!1;if(V.length<$.limit&&$.conditions.length>0&&Q>=i9){let B=`
7226
7226
  SELECT rowid
7227
7227
  FROM ${$.idx}
7228
7228
  WHERE ${$.idx} MATCH ?
7229
7229
  LIMIT 1 OFFSET ?
7230
- `;X=J.query(H).all($.ftsQuery,i9).length>0}if(Q.length===0)return{rows:[],capped:X};let W=Q.map((H)=>H.fts_rowid),_=`
7230
+ `;G=J.query(B).all($.ftsQuery,i9).length>0}if(V.length===0)return{rows:[],capped:G};let W=V.map((B)=>B.fts_rowid),_=`
7231
7231
  SELECT rowid AS fts_rowid,
7232
7232
  snippet(${$.idx}, 0, '<<', '>>', '...', 32) AS snippet
7233
7233
  FROM ${$.idx}
7234
7234
  WHERE ${$.idx} MATCH ?
7235
7235
  AND rowid IN (${W.map(()=>"?").join(",")})
7236
- `,j=new Map;for(let H of J.query(_).all($.ftsQuery,...W))j.set(H.fts_rowid,H.snippet);return{rows:Q.map(({fts_rowid:H,...q})=>({...q,snippet:j.get(H)??"",score:-q.score})),capped:X}}class n9 extends D$.Service()("@qitqode/Memory"){}var RV=f.effect(n9,G.gen(function*(){let $=yield*R$.Service,J=wV.join(f$.Path.data,"memory"),Z=wV.join(dq.homedir(),".claude","projects"),Y=G.fn("Memory.root")(function*(){return J}),K=G.fn("Memory.reconcile")(function*(){let X=(yield*$.get()).memory?.cc_index?Z:void 0;return yield*G.promise(()=>O7({qode:J,cc:X}))}),Q=G.fn("Memory.search")(function*(V){let X=yield*$.get();if(X.checkpoint?.memory_reconcile_on_search??!0){let D=X.memory?.cc_index?Z:void 0;yield*G.promise(()=>O7({qode:J,cc:D}))}let W=V.limit??10,_=SV(V.query);if(!_)return{results:[],incomplete:!1};let j=X.checkpoint?.memory_search_score_floor??0.15,H=[],q=[];if(V.scope)H.push("memory_fts.scope = ?"),q.push(V.scope);if(V.scope_id)H.push("memory_fts.scope_id = ?"),q.push(V.scope_id);if(V.type)H.push("memory_fts.type = ?"),q.push(V.type);let U=Math.min(W*3,50),z=s9({select:"memory_fts.path, memory_fts.scope, memory_fts.scope_id, memory_fts.type",idx:"memory_fts_idx",contentTable:"memory_fts",contentRowid:"memory_fts.id",conditions:H,params:q,ftsQuery:_,limit:U}),M=z.rows.map((D)=>({path:D.path,snippet:D.snippet,score:D.score,scope:D.scope,scope_id:D.scope_id,type:D.type})),I=z.capped&&M.length<W;if(M.length===0)return{results:[],incomplete:I};let C=M[0].score,P=j>0?C*j:-1/0;return{results:M.filter((D,L)=>L===0||D.score>=P).slice(0,W),incomplete:I}});return n9.of({root:Y,reconcile:K,search:Q})})),pq=f.suspend(()=>RV.pipe(f.provide(R$.defaultLayer)));var MJ={};o$(MJ,{layer:()=>TV,defaultLayer:()=>aq,Service:()=>ZZ});function LV($){return r9($,"AND")}var W2=b2("history_fts",{part_id:i$().primaryKey(),session_id:i$().notNull(),message_id:i$().notNull(),project_id:i$().notNull(),kind:i$().notNull(),tool_name:i$(),body:i$().notNull(),time_created:t0().notNull()},($)=>[e0("history_fts_session_idx").on($.session_id,$.time_created),e0("history_fts_project_idx").on($.project_id,$.time_created),e0("history_fts_message_idx").on($.message_id)]);var _8=["user_text","assistant_text","tool_input","tool_error"];function a9($,J,Z){switch($.type){case"text":{let Y=J==="user"?"user_text":"assistant_text";if(!Z.has(Y))return null;if(!$.text)return null;return{kind:Y,body:$.text,tool_name:null}}case"reasoning":{if(!Z.has("reasoning"))return null;if(!$.text)return null;return{kind:"reasoning",body:$.text,tool_name:null}}case"tool":{let Y=$.state;if(Y.status==="pending"||Y.status==="running")return null;if(Y.status==="error"&&Z.has("tool_error"))return{kind:"tool_error",body:`${$.tool} ${JSON.stringify(Y.input??{})} ${Y.error??""}`,tool_name:$.tool};if(Y.status==="completed"&&Z.has("tool_output"))return{kind:"tool_output",body:`${$.tool} ${JSON.stringify(Y.input??{})} ${JSON.stringify(Y.output??"")}`,tool_name:$.tool};if(Z.has("tool_input"))return{kind:"tool_input",body:`${$.tool} ${JSON.stringify(Y.input??{})}`,tool_name:$.tool};return null}default:return null}}class q7{max;map=new Map;constructor($){this.max=$}get($){let J=this.map.get($);if(J===void 0)return;return this.map.delete($),this.map.set($,J),J}set($,J){if(this.map.has($))this.map.delete($);if(this.map.set($,J),this.map.size>this.max){let Z=this.map.keys().next().value;if(Z!==void 0)this.map.delete(Z)}}}function t9(){let $=new q7(1024),J=new q7(512);return{role:(Z)=>G.sync(()=>{let Y=$.get(Z);if(Y)return Y;let Q=z$.use((V)=>V.select({data:e$.data}).from(e$).where(G$(e$.id,Z)).get())?.data?.role==="user"?"user":"assistant";return $.set(Z,Q),Q}),projectID:(Z)=>G.sync(()=>{let Y=J.get(Z);if(Y)return Y;let Q=z$.use((V)=>V.select({project_id:V0.project_id}).from(V0).where(G$(V0.id,Z)).get())?.project_id??"";return J.set(Z,Q),Q})}}var cq=O$.create({service:"history.writer"});class e9 extends D$.Service()("@qitqode/History.Writer"){}var NV=f.effect(e9,G.gen(function*(){let $=yield*R$.Service,J=yield*P$.Service,Z=yield*i.make(G.fn("History.Writer.state")(function*(Y){let Q=(yield*$.get()).history?.kinds??_8,V=new Set(Q);if(V.size===0)return{started:!0};let X=yield*b1.unbounded(),W=t9();return yield*J.subscribeCallback(w0.Event.PartUpdated,(_)=>{b1.offerUnsafe(X,{type:"upsert",part:_.properties.part,time:_.properties.time})}),yield*J.subscribeCallback(w0.Event.PartRemoved,(_)=>{b1.offerUnsafe(X,{type:"delete",partID:_.properties.partID})}),yield*G.forever(G.gen(function*(){let _=yield*b1.take(X);yield*lq(_,W,V).pipe(G.catchCause((j)=>G.sync(()=>cq.warn("write failed",{cause:String(j)}))))})).pipe(G.forkScoped),{started:!0}}));return e9.of({init:G.fn("History.Writer.init")(function*(){yield*i.get(Z)})})}));function lq($,J,Z){if($.type==="delete")return G.sync(()=>z$.use((Y)=>Y.delete(W2).where(G$(W2.part_id,$.partID)).run()));return G.gen(function*(){let Y=$.part,K=yield*J.role(Y.messageID),Q=a9(Y,K,Z);if(!Q)return;let V=yield*J.projectID(Y.sessionID);z$.use((X)=>X.insert(W2).values({part_id:Y.id,session_id:Y.sessionID,message_id:Y.messageID,project_id:V,kind:Q.kind,tool_name:Q.tool_name,body:Q.body,time_created:$.time}).onConflictDoUpdate({target:W2.part_id,set:{kind:Q.kind,tool_name:Q.tool_name,body:Q.body,time_created:$.time}}).run())})}var F7=O$.create({service:"history.backfill"}),oq=500;function rq($=new Set(_8)){return G.gen(function*(){if($.size===0)return;let J=t9(),Z=z$.use((Y)=>Y.select({id:V0.id,project_id:V0.project_id}).from(V0).orderBy(O8(V0.time_updated)).all());for(let Y of Z)yield*iq(Y,J,$).pipe(G.catchCause((K)=>G.sync(()=>F7.warn("session scan failed",{session:Y.id,cause:String(K)})))),yield*G.sleep("50 millis");F7.info("backfill complete",{sessions:Z.length})})}function iq($,J,Z){return G.gen(function*(){let Y="";while(!0){let K=z$.use((Q)=>Q.select().from($1).where(_0(G$($1.session_id,$.id),JZ($1.id,Y),f1`NOT EXISTS (SELECT 1 FROM history_fts WHERE history_fts.part_id = ${$1.id})`)).orderBy(m1($1.id)).limit(oq).all());if(K.length===0)return;yield*sq(K,$.project_id,J,Z),Y=K[K.length-1].id,yield*G.sleep("10 millis")}})}function sq($,J,Z,Y){return G.gen(function*(){let K=[];for(let Q of $){let V=yield*Z.role(Q.message_id),X={id:Q.id,sessionID:Q.session_id,messageID:Q.message_id,...Q.data},W=a9(X,V,Y);if(!W)continue;K.push({part:Q,kind:W.kind,body:W.body,tool_name:W.tool_name,time:Q.time_created})}if(K.length===0)return;z$.transaction((Q)=>{for(let V of K)Q.insert(W2).values({part_id:V.part.id,session_id:V.part.session_id,message_id:V.part.message_id,project_id:J,kind:V.kind,tool_name:V.tool_name,body:V.body,time_created:V.time}).onConflictDoUpdate({target:W2.part_id,set:{kind:V.kind,tool_name:V.tool_name,body:V.body,time_created:V.time}}).run()})})}class $Z extends D$.Service()("@qitqode/History.Backfill"){}var yV=f.effect($Z,G.gen(function*(){let $=yield*R$.Service;return $Z.of({init:G.fn("History.Backfill.init")(function*(){let Z=(yield*$.get()).history?.kinds??_8,Y=new Set(Z);yield*rq(Y).pipe(G.catchCause((K)=>G.sync(()=>F7.warn("backfill aborted",{cause:String(K)}))),G.forkDetach)})})}));class ZZ extends D$.Service()("@qitqode/History"){}var nq=50,aq=f.suspend(()=>f.mergeAll(TV,NV,yV).pipe(f.provide(R$.defaultLayer),f.provide(P$.defaultLayer))),TV=f.effect(ZZ,G.gen(function*(){let $=G.fn("History.search")(function*(Z){let Y=LV(Z.query);if(!Y)return{hits:[],incomplete:!1};let K=Math.min(Z.limit??10,nq),Q=[],V=[];if((Z.scope??"project")==="project")Q.push("history_fts.project_id = ?"),V.push(B$.project.id);if(Z.session_id)Q.push("history_fts.session_id = ?"),V.push(Z.session_id);if(Z.kind){let _=Array.isArray(Z.kind)?Z.kind:[Z.kind];Q.push(`history_fts.kind IN (${_.map(()=>"?").join(",")})`);for(let j of _)V.push(j)}if(Z.tool_name)Q.push("history_fts.tool_name = ?"),V.push(Z.tool_name);if(Z.time_after!==void 0)Q.push("history_fts.time_created >= ?"),V.push(Z.time_after);if(Z.time_before!==void 0)Q.push("history_fts.time_created <= ?"),V.push(Z.time_before);let W=s9({select:"history_fts.part_id, history_fts.session_id, history_fts.message_id, history_fts.project_id, history_fts.kind, history_fts.tool_name, history_fts.time_created",idx:"history_fts_idx",contentTable:"history_fts",contentRowid:"history_fts.rowid",conditions:Q,params:V,ftsQuery:Y,limit:K});return{hits:W.rows.map((_)=>({part_id:_.part_id,session_id:_.session_id,message_id:_.message_id,project_id:_.project_id,kind:_.kind,tool_name:_.tool_name,snippet:_.snippet,score:_.score,time_created:_.time_created})),incomplete:W.capped}}),J=G.fn("History.around")(function*(Z){let Y=Z.before??5,K=Z.after??5,Q=z$.use((q)=>q.select({id:e$.id,session_id:e$.session_id,time_created:e$.time_created}).from(e$).where(G$(e$.id,Z.message_id)).get());if(!Q)return{session_id:"",messages:[]};let V=z$.use((q)=>q.select().from(e$).where(_0(G$(e$.session_id,Q.session_id),f1`(${e$.time_created} < ${Q.time_created} OR (${e$.time_created} = ${Q.time_created} AND ${e$.id} <= ${Q.id}))`)).orderBy(O8(e$.time_created),O8(e$.id)).limit(Y+1).all()),X=z$.use((q)=>q.select().from(e$).where(_0(G$(e$.session_id,Q.session_id),f1`(${e$.time_created} > ${Q.time_created} OR (${e$.time_created} = ${Q.time_created} AND ${e$.id} > ${Q.id}))`)).orderBy(m1(e$.time_created),m1(e$.id)).limit(K).all()),W=[...V.reverse(),...X];if(W.length===0)return{session_id:Q.session_id,messages:[]};let _=z$.use((q)=>q.select().from($1).where(_0(G$($1.session_id,Q.session_id),f1`${$1.message_id} IN (${f1.join(W.map((U)=>f1`${U.id}`),f1`, `)})`)).orderBy(m1($1.message_id),m1($1.id)).all()),j=new Map;for(let q of _){let U=j.get(q.message_id)??[];U.push(q),j.set(q.message_id,U)}let H=W.map((q)=>{let U=q.data?.role==="user"?"user":"assistant",z=(j.get(q.id)??[]).map((M)=>{let I=M.data,C=I.type==="text"||I.type==="reasoning"?I.text??"":I.type==="tool"?`tool: ${I.tool??""}
7237
- input: ${JSON.stringify(I.state?.input??{})}
7238
- ${I.state?.error?`error: ${I.state.error}`:`output: ${JSON.stringify(I.state?.output??"")}`}`:`[${I.type}]`;return{part_id:M.id,type:I.type,role:U,tool_name:I.type==="tool"?I.tool??null:null,text:C}});return{message_id:q.id,matched:q.id===Z.message_id,time_created:q.time_created,parts:z}});return{session_id:Q.session_id,messages:H}});return ZZ.of({search:$,around:J})}));var j1={};o$(j1,{tailLines:()=>P7,layer:()=>hV,headLines:()=>D7,defaultLayer:()=>I7,Service:()=>Z1,MAX_LINES:()=>DJ,MAX_BYTES:()=>u1,GLOB:()=>YF,DIR:()=>ZF});import z7 from"path";var tq=F$.String.annotate({[KZ]:J1.schema("tool")}).pipe(F$.brand("ToolID")),kV=tq.pipe(YZ(($)=>({ascending:(J)=>$.make(J1.ascending("tool",J)),zod:J1.schema("tool").pipe(F.custom())})));import eq from"path";var v2=eq.join(f$.Path.data,"tool-output");var $F=O$.create({service:"truncation"}),JF=h2.days(7),DJ=2000,u1=51200,ZF=v2,YF=z7.join(v2,"*"),KF=/error|exception|failed|fatal|traceback|panic|exit code/i;function C7($,J){let Z=Buffer.from($,"utf-8");if(Z.length<=J)return $;let Y=Math.min(J,Z.length);while(Y>0&&(Z[Y]&192)===128)Y--;return Z.subarray(0,Y).toString("utf-8")}function M7($,J){let Z=Buffer.from($,"utf-8");if(Z.length<=J)return $;let Y=Math.max(0,Z.length-J);while(Y<Z.length&&(Z[Y]&192)===128)Y++;return Z.subarray(Y).toString("utf-8")}function D7($,J,Z){let Y=$.split(`
7239
- `),K=[],Q=0;for(let V=0;V<Y.length&&K.length<J;V++){let X=Buffer.byteLength(Y[V],"utf-8")+(V>0?1:0);if(Q+X>Z){if(K.length===0)K.push(C7(Y[V],Z));break}K.push(Y[V]),Q+=X}return K.join(`
7236
+ `,j=new Map;for(let B of J.query(_).all($.ftsQuery,...W))j.set(B.fts_rowid,B.snippet);return{rows:V.map(({fts_rowid:B,...q})=>({...q,snippet:j.get(B)??"",score:-q.score})),capped:G}}class n9 extends D$.Service()("@qitqode/Memory"){}var yQ=f.effect(n9,X.gen(function*(){let $=yield*w$.Service,J=NQ.join(f$.Path.data,"memory"),Z=NQ.join(oq.homedir(),".claude","projects"),Y=X.fn("Memory.root")(function*(){return J}),K=X.fn("Memory.reconcile")(function*(){let G=(yield*$.get()).memory?.cc_index?Z:void 0;return yield*X.promise(()=>O7({qode:J,cc:G}))}),V=X.fn("Memory.search")(function*(Q){let G=yield*$.get();if(G.checkpoint?.memory_reconcile_on_search??!0){let P=G.memory?.cc_index?Z:void 0;yield*X.promise(()=>O7({qode:J,cc:P}))}let W=Q.limit??10,_=LQ(Q.query);if(!_)return{results:[],incomplete:!1};let j=G.checkpoint?.memory_search_score_floor??0.15,B=[],q=[];if(Q.scope)B.push("memory_fts.scope = ?"),q.push(Q.scope);if(Q.scope_id)B.push("memory_fts.scope_id = ?"),q.push(Q.scope_id);if(Q.type)B.push("memory_fts.type = ?"),q.push(Q.type);let U=Math.min(W*3,50),z=s9({select:"memory_fts.path, memory_fts.scope, memory_fts.scope_id, memory_fts.type",idx:"memory_fts_idx",contentTable:"memory_fts",contentRowid:"memory_fts.id",conditions:B,params:q,ftsQuery:_,limit:U}),C=z.rows.map((P)=>({path:P.path,snippet:P.snippet,score:P.score,scope:P.scope,scope_id:P.scope_id,type:P.type})),D=z.capped&&C.length<W;if(C.length===0)return{results:[],incomplete:D};let M=C[0].score,I=j>0?M*j:-1/0;return{results:C.filter((P,L)=>L===0||P.score>=I).slice(0,W),incomplete:D}});return n9.of({root:Y,reconcile:K,search:V})})),rq=f.suspend(()=>yQ.pipe(f.provide(w$.defaultLayer)));var CJ={};o$(CJ,{layer:()=>xQ,defaultLayer:()=>JF,Service:()=>ZZ});function TQ($){return r9($,"AND")}var W2=b2("history_fts",{part_id:i$().primaryKey(),session_id:i$().notNull(),message_id:i$().notNull(),project_id:i$().notNull(),kind:i$().notNull(),tool_name:i$(),body:i$().notNull(),time_created:t0().notNull()},($)=>[e0("history_fts_session_idx").on($.session_id,$.time_created),e0("history_fts_project_idx").on($.project_id,$.time_created),e0("history_fts_message_idx").on($.message_id)]);var _8=["user_text","assistant_text","tool_input","tool_error"];function a9($,J,Z){switch($.type){case"text":{let Y=J==="user"?"user_text":"assistant_text";if(!Z.has(Y))return null;if(!$.text)return null;return{kind:Y,body:$.text,tool_name:null}}case"reasoning":{if(!Z.has("reasoning"))return null;if(!$.text)return null;return{kind:"reasoning",body:$.text,tool_name:null}}case"tool":{let Y=$.state;if(Y.status==="pending"||Y.status==="running")return null;if(Y.status==="error"&&Z.has("tool_error"))return{kind:"tool_error",body:`${$.tool} ${JSON.stringify(Y.input??{})} ${Y.error??""}`,tool_name:$.tool};if(Y.status==="completed"&&Z.has("tool_output"))return{kind:"tool_output",body:`${$.tool} ${JSON.stringify(Y.input??{})} ${JSON.stringify(Y.output??"")}`,tool_name:$.tool};if(Z.has("tool_input"))return{kind:"tool_input",body:`${$.tool} ${JSON.stringify(Y.input??{})}`,tool_name:$.tool};return null}default:return null}}class q7{max;map=new Map;constructor($){this.max=$}get($){let J=this.map.get($);if(J===void 0)return;return this.map.delete($),this.map.set($,J),J}set($,J){if(this.map.has($))this.map.delete($);if(this.map.set($,J),this.map.size>this.max){let Z=this.map.keys().next().value;if(Z!==void 0)this.map.delete(Z)}}}function t9(){let $=new q7(1024),J=new q7(512);return{role:(Z)=>X.sync(()=>{let Y=$.get(Z);if(Y)return Y;let V=z$.use((Q)=>Q.select({data:e$.data}).from(e$).where(X$(e$.id,Z)).get())?.data?.role==="user"?"user":"assistant";return $.set(Z,V),V}),projectID:(Z)=>X.sync(()=>{let Y=J.get(Z);if(Y)return Y;let V=z$.use((Q)=>Q.select({project_id:Q0.project_id}).from(Q0).where(X$(Q0.id,Z)).get())?.project_id??"";return J.set(Z,V),V})}}var iq=O$.create({service:"history.writer"});class e9 extends D$.Service()("@qitqode/History.Writer"){}var kQ=f.effect(e9,X.gen(function*(){let $=yield*w$.Service,J=yield*P$.Service,Z=yield*i.make(X.fn("History.Writer.state")(function*(Y){let V=(yield*$.get()).history?.kinds??_8,Q=new Set(V);if(Q.size===0)return{started:!0};let G=yield*b1.unbounded(),W=t9();return yield*J.subscribeCallback(R0.Event.PartUpdated,(_)=>{b1.offerUnsafe(G,{type:"upsert",part:_.properties.part,time:_.properties.time})}),yield*J.subscribeCallback(R0.Event.PartRemoved,(_)=>{b1.offerUnsafe(G,{type:"delete",partID:_.properties.partID})}),yield*X.forever(X.gen(function*(){let _=yield*b1.take(G);yield*sq(_,W,Q).pipe(X.catchCause((j)=>X.sync(()=>iq.warn("write failed",{cause:String(j)}))))})).pipe(X.forkScoped),{started:!0}}));return e9.of({init:X.fn("History.Writer.init")(function*(){yield*i.get(Z)})})}));function sq($,J,Z){if($.type==="delete")return X.sync(()=>z$.use((Y)=>Y.delete(W2).where(X$(W2.part_id,$.partID)).run()));return X.gen(function*(){let Y=$.part,K=yield*J.role(Y.messageID),V=a9(Y,K,Z);if(!V)return;let Q=yield*J.projectID(Y.sessionID);z$.use((G)=>G.insert(W2).values({part_id:Y.id,session_id:Y.sessionID,message_id:Y.messageID,project_id:Q,kind:V.kind,tool_name:V.tool_name,body:V.body,time_created:$.time}).onConflictDoUpdate({target:W2.part_id,set:{kind:V.kind,tool_name:V.tool_name,body:V.body,time_created:$.time}}).run())})}var F7=O$.create({service:"history.backfill"}),nq=500;function aq($=new Set(_8)){return X.gen(function*(){if($.size===0)return;let J=t9(),Z=z$.use((Y)=>Y.select({id:Q0.id,project_id:Q0.project_id}).from(Q0).orderBy(O8(Q0.time_updated)).all());for(let Y of Z)yield*tq(Y,J,$).pipe(X.catchCause((K)=>X.sync(()=>F7.warn("session scan failed",{session:Y.id,cause:String(K)})))),yield*X.sleep("50 millis");F7.info("backfill complete",{sessions:Z.length})})}function tq($,J,Z){return X.gen(function*(){let Y="";while(!0){let K=z$.use((V)=>V.select().from($1).where(_0(X$($1.session_id,$.id),JZ($1.id,Y),f1`NOT EXISTS (SELECT 1 FROM history_fts WHERE history_fts.part_id = ${$1.id})`)).orderBy(m1($1.id)).limit(nq).all());if(K.length===0)return;yield*eq(K,$.project_id,J,Z),Y=K[K.length-1].id,yield*X.sleep("10 millis")}})}function eq($,J,Z,Y){return X.gen(function*(){let K=[];for(let V of $){let Q=yield*Z.role(V.message_id),G={id:V.id,sessionID:V.session_id,messageID:V.message_id,...V.data},W=a9(G,Q,Y);if(!W)continue;K.push({part:V,kind:W.kind,body:W.body,tool_name:W.tool_name,time:V.time_created})}if(K.length===0)return;z$.transaction((V)=>{for(let Q of K)V.insert(W2).values({part_id:Q.part.id,session_id:Q.part.session_id,message_id:Q.part.message_id,project_id:J,kind:Q.kind,tool_name:Q.tool_name,body:Q.body,time_created:Q.time}).onConflictDoUpdate({target:W2.part_id,set:{kind:Q.kind,tool_name:Q.tool_name,body:Q.body,time_created:Q.time}}).run()})})}class $Z extends D$.Service()("@qitqode/History.Backfill"){}var EQ=f.effect($Z,X.gen(function*(){let $=yield*w$.Service;return $Z.of({init:X.fn("History.Backfill.init")(function*(){let Z=(yield*$.get()).history?.kinds??_8,Y=new Set(Z);yield*aq(Y).pipe(X.catchCause((K)=>X.sync(()=>F7.warn("backfill aborted",{cause:String(K)}))),X.forkDetach)})})}));class ZZ extends D$.Service()("@qitqode/History"){}var $F=50,JF=f.suspend(()=>f.mergeAll(xQ,kQ,EQ).pipe(f.provide(w$.defaultLayer),f.provide(P$.defaultLayer))),xQ=f.effect(ZZ,X.gen(function*(){let $=X.fn("History.search")(function*(Z){let Y=TQ(Z.query);if(!Y)return{hits:[],incomplete:!1};let K=Math.min(Z.limit??10,$F),V=[],Q=[];if((Z.scope??"project")==="project")V.push("history_fts.project_id = ?"),Q.push(H$.project.id);if(Z.session_id)V.push("history_fts.session_id = ?"),Q.push(Z.session_id);if(Z.kind){let _=Array.isArray(Z.kind)?Z.kind:[Z.kind];V.push(`history_fts.kind IN (${_.map(()=>"?").join(",")})`);for(let j of _)Q.push(j)}if(Z.tool_name)V.push("history_fts.tool_name = ?"),Q.push(Z.tool_name);if(Z.time_after!==void 0)V.push("history_fts.time_created >= ?"),Q.push(Z.time_after);if(Z.time_before!==void 0)V.push("history_fts.time_created <= ?"),Q.push(Z.time_before);let W=s9({select:"history_fts.part_id, history_fts.session_id, history_fts.message_id, history_fts.project_id, history_fts.kind, history_fts.tool_name, history_fts.time_created",idx:"history_fts_idx",contentTable:"history_fts",contentRowid:"history_fts.rowid",conditions:V,params:Q,ftsQuery:Y,limit:K});return{hits:W.rows.map((_)=>({part_id:_.part_id,session_id:_.session_id,message_id:_.message_id,project_id:_.project_id,kind:_.kind,tool_name:_.tool_name,snippet:_.snippet,score:_.score,time_created:_.time_created})),incomplete:W.capped}}),J=X.fn("History.around")(function*(Z){let Y=Z.before??5,K=Z.after??5,V=z$.use((q)=>q.select({id:e$.id,session_id:e$.session_id,time_created:e$.time_created}).from(e$).where(X$(e$.id,Z.message_id)).get());if(!V)return{session_id:"",messages:[]};let Q=z$.use((q)=>q.select().from(e$).where(_0(X$(e$.session_id,V.session_id),f1`(${e$.time_created} < ${V.time_created} OR (${e$.time_created} = ${V.time_created} AND ${e$.id} <= ${V.id}))`)).orderBy(O8(e$.time_created),O8(e$.id)).limit(Y+1).all()),G=z$.use((q)=>q.select().from(e$).where(_0(X$(e$.session_id,V.session_id),f1`(${e$.time_created} > ${V.time_created} OR (${e$.time_created} = ${V.time_created} AND ${e$.id} > ${V.id}))`)).orderBy(m1(e$.time_created),m1(e$.id)).limit(K).all()),W=[...Q.reverse(),...G];if(W.length===0)return{session_id:V.session_id,messages:[]};let _=z$.use((q)=>q.select().from($1).where(_0(X$($1.session_id,V.session_id),f1`${$1.message_id} IN (${f1.join(W.map((U)=>f1`${U.id}`),f1`, `)})`)).orderBy(m1($1.message_id),m1($1.id)).all()),j=new Map;for(let q of _){let U=j.get(q.message_id)??[];U.push(q),j.set(q.message_id,U)}let B=W.map((q)=>{let U=q.data?.role==="user"?"user":"assistant",z=(j.get(q.id)??[]).map((C)=>{let D=C.data,M=D.type==="text"||D.type==="reasoning"?D.text??"":D.type==="tool"?`tool: ${D.tool??""}
7237
+ input: ${JSON.stringify(D.state?.input??{})}
7238
+ ${D.state?.error?`error: ${D.state.error}`:`output: ${JSON.stringify(D.state?.output??"")}`}`:`[${D.type}]`;return{part_id:C.id,type:D.type,role:U,tool_name:D.type==="tool"?D.tool??null:null,text:M}});return{message_id:q.id,matched:q.id===Z.message_id,time_created:q.time_created,parts:z}});return{session_id:V.session_id,messages:B}});return ZZ.of({search:$,around:J})}));var j1={};o$(j1,{tailLines:()=>P7,layer:()=>mQ,headLines:()=>D7,defaultLayer:()=>I7,Service:()=>Z1,MAX_LINES:()=>DJ,MAX_BYTES:()=>u1,GLOB:()=>XF,DIR:()=>QF});import z7 from"path";var ZF=F$.String.annotate({[KZ]:J1.schema("tool")}).pipe(F$.brand("ToolID")),bQ=ZF.pipe(YZ(($)=>({ascending:(J)=>$.make(J1.ascending("tool",J)),zod:J1.schema("tool").pipe(F.custom())})));import YF from"path";var v2=YF.join(f$.Path.data,"tool-output");var KF=O$.create({service:"truncation"}),VF=h2.days(7),DJ=2000,u1=51200,QF=v2,XF=z7.join(v2,"*"),GF=/error|exception|failed|fatal|traceback|panic|exit code/i;function M7($,J){let Z=Buffer.from($,"utf-8");if(Z.length<=J)return $;let Y=Math.min(J,Z.length);while(Y>0&&(Z[Y]&192)===128)Y--;return Z.subarray(0,Y).toString("utf-8")}function C7($,J){let Z=Buffer.from($,"utf-8");if(Z.length<=J)return $;let Y=Math.max(0,Z.length-J);while(Y<Z.length&&(Z[Y]&192)===128)Y++;return Z.subarray(Y).toString("utf-8")}function D7($,J,Z){let Y=$.split(`
7239
+ `),K=[],V=0;for(let Q=0;Q<Y.length&&K.length<J;Q++){let G=Buffer.byteLength(Y[Q],"utf-8")+(Q>0?1:0);if(V+G>Z){if(K.length===0)K.push(M7(Y[Q],Z));break}K.push(Y[Q]),V+=G}return K.join(`
7240
7240
  `)}function P7($,J,Z){let Y=$.split(`
7241
- `);if(Y.length<=J&&Buffer.byteLength($,"utf-8")<=Z)return{text:$,cut:!1};let K=[],Q=0;for(let V=Y.length-1;V>=0&&K.length<J;V--){let X=Buffer.byteLength(Y[V],"utf-8")+(K.length>0?1:0);if(Q+X>Z){if(K.length===0)K.unshift(M7(Y[V],Z));break}K.unshift(Y[V]),Q+=X}return{text:K.join(`
7242
- `),cut:!0}}var EV=2048;function xV($){if(!$?.permission)return!1;return vV("actor","*",$.permission).action!=="deny"}class Z1 extends D$.Service()("@qitqode/Truncate"){}var hV=f.effect(Z1,G.gen(function*(){let $=yield*$$.Service,J=G.fn("Truncate.cleanup")(function*(){let K=J1.timestamp(J1.create("tool","ascending",Date.now()-h2.toMillis(JF))),Q=yield*$.readDirectory(v2).pipe(G.map((V)=>V.filter((X)=>X.startsWith("tool_"))),G.catch(()=>G.succeed([])));for(let V of Q){if(J1.timestamp(V)>=K)continue;yield*$.remove(z7.join(v2,V)).pipe(G.catch(()=>G.void))}}),Z=G.fn("Truncate.write")(function*(K){let Q=z7.join(v2,kV.ascending());return yield*$.ensureDir(v2).pipe(G.orDie),yield*$.writeFileString(Q,K).pipe(G.orDie),Q}),Y=G.fn("Truncate.output")(function*(K,Q={},V){let X=Q.maxLines??DJ,W=Q.maxBytes??u1,_=Q.direction??"head+tail";if(Q.pressureCaps??!1)X=Math.floor(X/2),W=Math.floor(W/2);let H=K.split(`
7243
- `),q=Buffer.byteLength(K,"utf-8");if(H.length<=X&&q<=W)return{content:K,truncated:!1};if(_==="head+tail"){let N=K.length>EV?K.slice(-EV):K;if(KF.test(N)){let b=Math.floor(X*0.7),v=Math.floor(W*0.7),m=X-b,A=W-v,u=[],r=0;for(let J$=0;J$<H.length&&u.length<b;J$++){let Z$=Buffer.byteLength(H[J$],"utf-8")+(J$>0?1:0);if(r+Z$>v){if(u.length===0)u.push(C7(H[J$],v));break}u.push(H[J$]),r+=Z$}let S=[],T=0;for(let J$=H.length-1;J$>=0&&S.length<m;J$--){let Z$=Buffer.byteLength(H[J$],"utf-8")+(S.length>0?1:0);if(T+Z$>A){if(S.length===0)S.unshift(M7(H[J$],A));break}S.unshift(H[J$]),T+=Z$}let k=Math.max(0,H.length-u.length-S.length),A$=yield*Z(K),s=xV(V)?`The tool call succeeded but the output was truncated. Full output saved to: ${A$}
7241
+ `);if(Y.length<=J&&Buffer.byteLength($,"utf-8")<=Z)return{text:$,cut:!1};let K=[],V=0;for(let Q=Y.length-1;Q>=0&&K.length<J;Q--){let G=Buffer.byteLength(Y[Q],"utf-8")+(K.length>0?1:0);if(V+G>Z){if(K.length===0)K.unshift(C7(Y[Q],Z));break}K.unshift(Y[Q]),V+=G}return{text:K.join(`
7242
+ `),cut:!0}}var vQ=2048;function hQ($){if(!$?.permission)return!1;return fQ("actor","*",$.permission).action!=="deny"}class Z1 extends D$.Service()("@qitqode/Truncate"){}var mQ=f.effect(Z1,X.gen(function*(){let $=yield*$$.Service,J=X.fn("Truncate.cleanup")(function*(){let K=J1.timestamp(J1.create("tool","ascending",Date.now()-h2.toMillis(VF))),V=yield*$.readDirectory(v2).pipe(X.map((Q)=>Q.filter((G)=>G.startsWith("tool_"))),X.catch(()=>X.succeed([])));for(let Q of V){if(J1.timestamp(Q)>=K)continue;yield*$.remove(z7.join(v2,Q)).pipe(X.catch(()=>X.void))}}),Z=X.fn("Truncate.write")(function*(K){let V=z7.join(v2,bQ.ascending());return yield*$.ensureDir(v2).pipe(X.orDie),yield*$.writeFileString(V,K).pipe(X.orDie),V}),Y=X.fn("Truncate.output")(function*(K,V={},Q){let G=V.maxLines??DJ,W=V.maxBytes??u1,_=V.direction??"head+tail";if(V.pressureCaps??!1)G=Math.floor(G/2),W=Math.floor(W/2);let B=K.split(`
7243
+ `),q=Buffer.byteLength(K,"utf-8");if(B.length<=G&&q<=W)return{content:K,truncated:!1};if(_==="head+tail"){let N=K.length>vQ?K.slice(-vQ):K;if(GF.test(N)){let b=Math.floor(G*0.7),v=Math.floor(W*0.7),m=G-b,A=W-v,u=[],r=0;for(let J$=0;J$<B.length&&u.length<b;J$++){let Z$=Buffer.byteLength(B[J$],"utf-8")+(J$>0?1:0);if(r+Z$>v){if(u.length===0)u.push(M7(B[J$],v));break}u.push(B[J$]),r+=Z$}let S=[],T=0;for(let J$=B.length-1;J$>=0&&S.length<m;J$--){let Z$=Buffer.byteLength(B[J$],"utf-8")+(S.length>0?1:0);if(T+Z$>A){if(S.length===0)S.unshift(C7(B[J$],A));break}S.unshift(B[J$]),T+=Z$}let k=Math.max(0,B.length-u.length-S.length),A$=yield*Z(K),s=hQ(Q)?`The tool call succeeded but the output was truncated. Full output saved to: ${A$}
7244
7244
  Use the actor tool to have explore agent process this file with Grep and Read (with offset/limit). Do NOT read the full file yourself - delegate to save context.`:`The tool call succeeded but the output was truncated. Full output saved to: ${A$}
7245
7245
  Use Grep to search the full content or Read with offset/limit to view specific sections.`;return{content:`${u.join(`
7246
7246
  `)}
@@ -7250,18 +7250,18 @@ Use Grep to search the full content or Read with offset/limit to view specific s
7250
7250
  ${S.join(`
7251
7251
  `)}
7252
7252
 
7253
- ${s}`,truncated:!0,outputPath:A$}}}let U=[],z=0,M=0,I=!1;if(_==="head"||_==="head+tail")for(z=0;z<H.length&&z<X;z++){let N=Buffer.byteLength(H[z],"utf-8")+(z>0?1:0);if(M+N>W){if(I=!0,U.length===0)U.push(C7(H[z],W)),M+=Buffer.byteLength(U[0],"utf-8");break}U.push(H[z]),M+=N}else for(z=H.length-1;z>=0&&U.length<X;z--){let N=Buffer.byteLength(H[z],"utf-8")+(U.length>0?1:0);if(M+N>W){if(I=!0,U.length===0)U.unshift(M7(H[z],W)),M+=Buffer.byteLength(U[0],"utf-8");break}U.unshift(H[z]),M+=N}let C=I?q-M:H.length-U.length,P=I?"bytes":"lines",D=U.join(`
7254
- `),L=yield*Z(K),R=xV(V)?`The tool call succeeded but the output was truncated. Full output saved to: ${L}
7253
+ ${s}`,truncated:!0,outputPath:A$}}}let U=[],z=0,C=0,D=!1;if(_==="head"||_==="head+tail")for(z=0;z<B.length&&z<G;z++){let N=Buffer.byteLength(B[z],"utf-8")+(z>0?1:0);if(C+N>W){if(D=!0,U.length===0)U.push(M7(B[z],W)),C+=Buffer.byteLength(U[0],"utf-8");break}U.push(B[z]),C+=N}else for(z=B.length-1;z>=0&&U.length<G;z--){let N=Buffer.byteLength(B[z],"utf-8")+(U.length>0?1:0);if(C+N>W){if(D=!0,U.length===0)U.unshift(C7(B[z],W)),C+=Buffer.byteLength(U[0],"utf-8");break}U.unshift(B[z]),C+=N}let M=D?q-C:B.length-U.length,I=D?"bytes":"lines",P=U.join(`
7254
+ `),L=yield*Z(K),w=hQ(Q)?`The tool call succeeded but the output was truncated. Full output saved to: ${L}
7255
7255
  Use the actor tool to have explore agent process this file with Grep and Read (with offset/limit). Do NOT read the full file yourself - delegate to save context.`:`The tool call succeeded but the output was truncated. Full output saved to: ${L}
7256
- Use Grep to search the full content or Read with offset/limit to view specific sections.`;return{content:_==="head"||_==="head+tail"?`${D}
7256
+ Use Grep to search the full content or Read with offset/limit to view specific sections.`;return{content:_==="head"||_==="head+tail"?`${P}
7257
7257
 
7258
- ...${C} ${P} truncated...
7258
+ ...${M} ${I} truncated...
7259
7259
 
7260
- ${R}`:`...${C} ${P} truncated...
7260
+ ${w}`:`...${M} ${I} truncated...
7261
7261
 
7262
- ${R}
7262
+ ${w}
7263
7263
 
7264
- ${D}`,truncated:!0,outputPath:L}});return yield*bV(J(),(K)=>{return $F.error("truncation cleanup failed",{cause:u0.pretty(K)}),G.void}),Z1.of({cleanup:J,write:Z,output:Y})})),I7=hV.pipe(f.provide($$.defaultLayer),f.provide(g9.layer));var B1={};o$(B1,{normalizeQuestions:()=>w7,normalizeQuestion:()=>mV,normalizeOptionLabel:()=>S7,meaningfulOptions:()=>VF,layer:()=>lV,isFreeTextQuestion:()=>GF,isFillerOption:()=>VZ,defaultLayer:()=>XF,Tool:()=>L7,Service:()=>WZ,Request:()=>UZ,Reply:()=>dV,RejectedError:()=>XZ,Question:()=>B1,Prompt:()=>q8,Option:()=>QZ,Info:()=>R7,Event:()=>GZ,Answer:()=>N7});class PJ extends gV()("QuestionID",F$.String.annotate({[KZ]:J1.schema("question")})){static ascending($){return this.make(J1.ascending("question",$))}static zod=J1.schema("question")}class QZ extends F$.Class("QuestionOption")({label:F$.String.annotate({description:"Display text (1-5 words, concise). Must name a distinct, actionable choice. Never a filler such as 'Other', 'Provide details' or 'Type your own answer' \u2014 a free-text answer is always offered separately and filler options are stripped."}),description:F$.String.annotate({description:"What choosing this option means and what work it leads to"})}){static zod=U1(this)}var A7={question:F$.String.annotate({description:"Complete question"}),header:F$.String.annotate({description:"Very short label (max 30 chars)"}),options:F$.Array(QZ).annotate({description:"At least two mutually exclusive, decision-bearing choices. If you cannot offer two genuinely different choices, do not ask through this tool \u2014 ask for what you need as prose in your reply instead."}),multiple:F$.optional(F$.Boolean).annotate({description:"Allow selecting multiple choices"})};class q8 extends F$.Class("QuestionPrompt")(A7){static zod=U1(this)}var QF=[/^others?$/,/^something else$/,/^(an)?other (option|answer|choice)$/,/^(custom|free ?-?(text|form))( answer| response| input| option)?$/,/^(type|write|enter|input|fill)( in)? (your|my) own( answer| response| text| words)?$/,/^(type|write|enter) (an )?answer$/,/^(provide|give|share|add|supply|include)( me)?( the| more| additional| further| relevant)* ?(details?|context|info|information|specifics|goals?|requirements?)(,? (and |or )?(details?|context|info|information|specifics|goals?|requirements?))*( (here|below))?$/,/^(please )?(specify|elaborate|describe it|explain it|clarify)( (here|below|yourself))?$/,/^tell (me|us) more( here| below)?$/];function S7($){return $.toLowerCase().replace(/\s+/g," ").trim().replace(/^["'\u201C\u201D\u2018\u2019(\[]+/,"").replace(/["'\u201C\u201D\u2018\u2019)\]]+$/,"").replace(/[.!?\u2026:;,\-\u2013\u2014]+$/,"").trim()}function VZ($){let J=S7($.label??"");if(!J)return!0;return QF.some((Z)=>Z.test(J))}function fV($,J){let Z=new Set,Y=[];for(let K of $){let Q=S7(K.label);if(Z.has(Q)){J?.(K.label,"duplicate");continue}Z.add(Q),Y.push(K)}return Y}function VF($){return fV($).filter((J)=>!VZ(J))}function mV($,J){let Z=fV($.options??[],J);if(Z.filter((K)=>!VZ(K)).length>=2){if(Z.length===($.options?.length??0))return $;return{...$,options:Z}}for(let K of Z)J?.(K.label,VZ(K)?"filler":"collapsed");return{...$,options:[],custom:!0,multiple:!1}}function w7($,J){return $.map((Z)=>mV(Z,J))}function GF($){return($.options?.length??0)===0&&$.custom!==!1}var g2=O$.create({service:"question"});class R7 extends F$.Class("QuestionInfo")({...A7,custom:F$.optional(F$.Boolean).annotate({description:"Allow typing a custom answer (default: true)"}),key:F$.optional(F$.String).annotate({description:"i18n key for client-side translation (e.g. plan_exit). When set, clients may translate question/options text using this key as a namespace."}),params:F$.optional(F$.Record(F$.String,F$.String)).annotate({description:"Template parameters for i18n interpolation (e.g. { plan: '.qitqode/plans/...' })"})}){static zod=U1(this)}class L7 extends F$.Class("QuestionTool")({messageID:IJ,callID:F$.String}){static zod=U1(this)}class UZ extends F$.Class("QuestionRequest")({id:PJ,sessionID:F0,questions:F$.Array(R7).annotate({description:"Questions to ask"}),tool:F$.optional(L7)}){static zod=U1(this)}var N7=F$.Array(F$.String).annotate({identifier:"QuestionAnswer"}).pipe(YZ(($)=>({zod:U1($)})));class dV extends F$.Class("QuestionReply")({answers:F$.Array(N7).annotate({description:"User answers in order of questions (each answer is an array of selected labels)"})}){static zod=U1(this)}class pV extends F$.Class("QuestionReplied")({sessionID:F0,requestID:PJ,answers:F$.Array(N7)}){}class cV extends F$.Class("QuestionRejected")({sessionID:F0,requestID:PJ}){}var GZ={Asked:Z0.define("question.asked",UZ.zod),Replied:Z0.define("question.replied",U1(pV)),Rejected:Z0.define("question.rejected",U1(cV))};class XZ extends F$.TaggedErrorClass()("QuestionRejectedError",{}){get message(){return"The user dismissed this question"}}class WZ extends D$.Service()("@qitqode/Question"){}var lV=f.effect(WZ,G.gen(function*(){let $=yield*P$.Service,J=yield*i.make(G.fn("Question.state")(function*(){let _={pending:new Map,neverAsk:!1,declined:new Map};return yield*uV(_.pending,()=>new XZ),_})),Z=G.fn("Question.ask")(function*(_){let j=(yield*i.get(J)).pending,H=PJ.ascending();g2.info("asking",{id:H,questions:_.questions.length});let q=yield*B0.make(),U=w7(_.questions,(M,I)=>g2.debug("stripped question option",{id:H,label:M,reason:I})),z=F$.decodeUnknownSync(UZ)({id:H,sessionID:_.sessionID,questions:U,tool:_.tool});return j.set(H,{info:z,deferred:q}),yield*$.publish(GZ.Asked,z),yield*jZ.awaitDeferred(q,()=>{j.delete(H)})}),Y=G.fn("Question.reply")(function*(_){let j=(yield*i.get(J)).pending,H=j.get(_.requestID);if(!H){g2.warn("reply for unknown request",{requestID:_.requestID});return}j.delete(_.requestID),g2.info("replied",{requestID:_.requestID,answers:_.answers}),yield*$.publish(GZ.Replied,{sessionID:H.info.sessionID,requestID:H.info.id,answers:_.answers}),yield*B0.succeed(H.deferred,_.answers)}),K=G.fn("Question.reject")(function*(_){let j=yield*i.get(J),H=j.pending,q=H.get(_);if(!q){g2.warn("reject for unknown request",{requestID:_});return}H.delete(_),j.declined.set(q.info.sessionID,Date.now()),g2.info("rejected",{requestID:_}),yield*$.publish(GZ.Rejected,{sessionID:q.info.sessionID,requestID:q.info.id}),yield*B0.fail(q.deferred,new XZ)}),Q=G.fn("Question.list")(function*(){let _=(yield*i.get(J)).pending;return Array.from(_.values(),(j)=>j.info)}),V=G.fn("Question.declinedAt")(function*(_){return(yield*i.get(J)).declined.get(_)}),X=G.fn("Question.neverAsk")(function*(){return(yield*i.get(J)).neverAsk}),W=G.fn("Question.setNeverAsk")(function*(_){let j=yield*i.get(J);j.neverAsk=_,g2.info("never-ask",{enabled:_})});return WZ.of({ask:Z,reply:Y,reject:K,list:Q,declinedAt:V,neverAsk:X,setNeverAsk:W})})),XF=lV.pipe(f.provide(P$.layer));import WF from"crypto";var y7=O$.create({service:"bash-interactive"}),oV={Asked:Z0.define("bash.interactive.asked",F.object({id:F.string(),command:F.string(),cwd:F.string(),env:F.record(F.string(),F.string()).optional(),description:F.string()})),Replied:Z0.define("bash.interactive.replied",F.object({id:F.string(),output:F.string(),exitCode:F.number()}))};class rV extends Error{constructor($){super($);this.name="BashInteractiveError"}}class BZ extends D$.Service()("@qitqode/BashInteractive"){}var jF=f.effect(BZ,G.gen(function*(){let $=yield*P$.Service,J=yield*i.make(G.fn("BashInteractive.state")(function*(){let Q={pending:new Map};return yield*G.addFinalizer(()=>G.gen(function*(){for(let V of Q.pending.values())yield*B0.fail(V.deferred,new rV("Instance disposed"));Q.pending.clear()})),Q})),Z=G.fn("BashInteractive.request")(function*(Q){let V=(yield*i.get(J)).pending,X=WF.randomUUID();y7.info("requesting interactive",{id:X,command:Q.command});let W=yield*B0.make(),_={id:X,command:Q.command,cwd:Q.cwd,env:Q.env,description:Q.description};return V.set(X,{request:_,deferred:W}),yield*$.publish(oV.Asked,_),yield*jZ.awaitDeferred(W,()=>{V.delete(X)})}),Y=G.fn("BashInteractive.reply")(function*(Q){let V=(yield*i.get(J)).pending,X=V.get(Q.id);if(!X){y7.warn("reply for unknown request",{id:Q.id});return}V.delete(Q.id),y7.info("replied",{id:Q.id,exitCode:Q.exitCode}),yield*$.publish(oV.Replied,{id:X.request.id,output:Q.output,exitCode:Q.exitCode}),yield*B0.succeed(X.deferred,{output:Q.output,exitCode:Q.exitCode})}),K=G.fn("BashInteractive.list")(function*(){let Q=(yield*i.get(J)).pending;return Array.from(Q.values(),(V)=>V.request)});return BZ.of({request:Z,reply:Y,list:K})})),UF=jF.pipe(f.provide(P$.layer)),{runPromise:BF}=HZ(BZ,UF);function iV($){return BF((J)=>J.request($))}var nV=F.object({tool:F.string(),error:F.string()}),aV=F.object({questions:F.array(q8.zod).describe("Questions to ask")}),tV=F.object({command:F.string().describe("The command to execute"),timeout:F.number().describe("Optional timeout in milliseconds").optional(),workdir:F.string().describe("The working directory to run the command in. Defaults to the current directory. Use this instead of 'cd' commands.").optional(),interactive:F.boolean().describe("Set to true when the command requires user interaction (password input, y/N confirmation, SSH key passphrase, etc). The terminal will be handed to the user for direct interaction.").optional(),description:F.string().describe(`Clear, concise description of what this command does in 5-10 words. Examples:
7264
+ ${P}`,truncated:!0,outputPath:L}});return yield*gQ(J(),(K)=>{return KF.error("truncation cleanup failed",{cause:u0.pretty(K)}),X.void}),Z1.of({cleanup:J,write:Z,output:Y})})),I7=mQ.pipe(f.provide($$.defaultLayer),f.provide(g9.layer));var H1={};o$(H1,{normalizeQuestions:()=>R7,normalizeQuestion:()=>pQ,normalizeOptionLabel:()=>S7,meaningfulOptions:()=>jF,layer:()=>iQ,isFreeTextQuestion:()=>UF,isFillerOption:()=>QZ,defaultLayer:()=>HF,Tool:()=>L7,Service:()=>WZ,Request:()=>UZ,Reply:()=>lQ,RejectedError:()=>GZ,Question:()=>H1,Prompt:()=>q8,Option:()=>VZ,Info:()=>w7,Event:()=>XZ,Answer:()=>N7});class PJ extends uQ()("QuestionID",F$.String.annotate({[KZ]:J1.schema("question")})){static ascending($){return this.make(J1.ascending("question",$))}static zod=J1.schema("question")}class VZ extends F$.Class("QuestionOption")({label:F$.String.annotate({description:"Display text (1-5 words, concise). Must name a distinct, actionable choice. Never a filler such as 'Other', 'Provide details' or 'Type your own answer' \u2014 a free-text answer is always offered separately and filler options are stripped."}),description:F$.String.annotate({description:"What choosing this option means and what work it leads to"})}){static zod=U1(this)}var A7={question:F$.String.annotate({description:"Complete question"}),header:F$.String.annotate({description:"Very short label (max 30 chars)"}),options:F$.Array(VZ).annotate({description:"At least two mutually exclusive, decision-bearing choices. If you cannot offer two genuinely different choices, do not ask through this tool \u2014 ask for what you need as prose in your reply instead."}),multiple:F$.optional(F$.Boolean).annotate({description:"Allow selecting multiple choices"})};class q8 extends F$.Class("QuestionPrompt")(A7){static zod=U1(this)}var WF=[/^others?$/,/^something else$/,/^(an)?other (option|answer|choice)$/,/^(custom|free ?-?(text|form))( answer| response| input| option)?$/,/^(type|write|enter|input|fill)( in)? (your|my) own( answer| response| text| words)?$/,/^(type|write|enter) (an )?answer$/,/^(provide|give|share|add|supply|include)( me)?( the| more| additional| further| relevant)* ?(details?|context|info|information|specifics|goals?|requirements?)(,? (and |or )?(details?|context|info|information|specifics|goals?|requirements?))*( (here|below))?$/,/^(please )?(specify|elaborate|describe it|explain it|clarify)( (here|below|yourself))?$/,/^tell (me|us) more( here| below)?$/];function S7($){return $.toLowerCase().replace(/\s+/g," ").trim().replace(/^["'\u201C\u201D\u2018\u2019(\[]+/,"").replace(/["'\u201C\u201D\u2018\u2019)\]]+$/,"").replace(/[.!?\u2026:;,\-\u2013\u2014]+$/,"").trim()}function QZ($){let J=S7($.label??"");if(!J)return!0;return WF.some((Z)=>Z.test(J))}function dQ($,J){let Z=new Set,Y=[];for(let K of $){let V=S7(K.label);if(Z.has(V)){J?.(K.label,"duplicate");continue}Z.add(V),Y.push(K)}return Y}function jF($){return dQ($).filter((J)=>!QZ(J))}function pQ($,J){let Z=dQ($.options??[],J);if(Z.filter((K)=>!QZ(K)).length>=2){if(Z.length===($.options?.length??0))return $;return{...$,options:Z}}for(let K of Z)J?.(K.label,QZ(K)?"filler":"collapsed");return{...$,options:[],custom:!0,multiple:!1}}function R7($,J){return $.map((Z)=>pQ(Z,J))}function UF($){return($.options?.length??0)===0&&$.custom!==!1}var g2=O$.create({service:"question"});class w7 extends F$.Class("QuestionInfo")({...A7,custom:F$.optional(F$.Boolean).annotate({description:"Allow typing a custom answer (default: true)"}),key:F$.optional(F$.String).annotate({description:"i18n key for client-side translation (e.g. plan_exit). When set, clients may translate question/options text using this key as a namespace."}),params:F$.optional(F$.Record(F$.String,F$.String)).annotate({description:"Template parameters for i18n interpolation (e.g. { plan: '.qitqode/plans/...' })"})}){static zod=U1(this)}class L7 extends F$.Class("QuestionTool")({messageID:IJ,callID:F$.String}){static zod=U1(this)}class UZ extends F$.Class("QuestionRequest")({id:PJ,sessionID:F0,questions:F$.Array(w7).annotate({description:"Questions to ask"}),tool:F$.optional(L7)}){static zod=U1(this)}var N7=F$.Array(F$.String).annotate({identifier:"QuestionAnswer"}).pipe(YZ(($)=>({zod:U1($)})));class lQ extends F$.Class("QuestionReply")({answers:F$.Array(N7).annotate({description:"User answers in order of questions (each answer is an array of selected labels)"})}){static zod=U1(this)}class oQ extends F$.Class("QuestionReplied")({sessionID:F0,requestID:PJ,answers:F$.Array(N7)}){}class rQ extends F$.Class("QuestionRejected")({sessionID:F0,requestID:PJ}){}var XZ={Asked:Z0.define("question.asked",UZ.zod),Replied:Z0.define("question.replied",U1(oQ)),Rejected:Z0.define("question.rejected",U1(rQ))};class GZ extends F$.TaggedErrorClass()("QuestionRejectedError",{}){get message(){return"The user dismissed this question"}}class WZ extends D$.Service()("@qitqode/Question"){}var iQ=f.effect(WZ,X.gen(function*(){let $=yield*P$.Service,J=yield*i.make(X.fn("Question.state")(function*(){let _={pending:new Map,neverAsk:!1,declined:new Map};return yield*cQ(_.pending,()=>new GZ),_})),Z=X.fn("Question.ask")(function*(_){let j=(yield*i.get(J)).pending,B=PJ.ascending();g2.info("asking",{id:B,questions:_.questions.length});let q=yield*H0.make(),U=R7(_.questions,(C,D)=>g2.debug("stripped question option",{id:B,label:C,reason:D})),z=F$.decodeUnknownSync(UZ)({id:B,sessionID:_.sessionID,questions:U,tool:_.tool});return j.set(B,{info:z,deferred:q}),yield*$.publish(XZ.Asked,z),yield*jZ.awaitDeferred(q,()=>{j.delete(B)})}),Y=X.fn("Question.reply")(function*(_){let j=(yield*i.get(J)).pending,B=j.get(_.requestID);if(!B){g2.warn("reply for unknown request",{requestID:_.requestID});return}j.delete(_.requestID),g2.info("replied",{requestID:_.requestID,answers:_.answers}),yield*$.publish(XZ.Replied,{sessionID:B.info.sessionID,requestID:B.info.id,answers:_.answers}),yield*H0.succeed(B.deferred,_.answers)}),K=X.fn("Question.reject")(function*(_){let j=yield*i.get(J),B=j.pending,q=B.get(_);if(!q){g2.warn("reject for unknown request",{requestID:_});return}B.delete(_),j.declined.set(q.info.sessionID,Date.now()),g2.info("rejected",{requestID:_}),yield*$.publish(XZ.Rejected,{sessionID:q.info.sessionID,requestID:q.info.id}),yield*H0.fail(q.deferred,new GZ)}),V=X.fn("Question.list")(function*(){let _=(yield*i.get(J)).pending;return Array.from(_.values(),(j)=>j.info)}),Q=X.fn("Question.declinedAt")(function*(_){return(yield*i.get(J)).declined.get(_)}),G=X.fn("Question.neverAsk")(function*(){return(yield*i.get(J)).neverAsk}),W=X.fn("Question.setNeverAsk")(function*(_){let j=yield*i.get(J);j.neverAsk=_,g2.info("never-ask",{enabled:_})});return WZ.of({ask:Z,reply:Y,reject:K,list:V,declinedAt:Q,neverAsk:G,setNeverAsk:W})})),HF=iQ.pipe(f.provide(P$.layer));import BF from"crypto";var y7=O$.create({service:"bash-interactive"}),sQ={Asked:Z0.define("bash.interactive.asked",F.object({id:F.string(),command:F.string(),cwd:F.string(),env:F.record(F.string(),F.string()).optional(),description:F.string()})),Replied:Z0.define("bash.interactive.replied",F.object({id:F.string(),output:F.string(),exitCode:F.number()}))};class nQ extends Error{constructor($){super($);this.name="BashInteractiveError"}}class HZ extends D$.Service()("@qitqode/BashInteractive"){}var _F=f.effect(HZ,X.gen(function*(){let $=yield*P$.Service,J=yield*i.make(X.fn("BashInteractive.state")(function*(){let V={pending:new Map};return yield*X.addFinalizer(()=>X.gen(function*(){for(let Q of V.pending.values())yield*H0.fail(Q.deferred,new nQ("Instance disposed"));V.pending.clear()})),V})),Z=X.fn("BashInteractive.request")(function*(V){let Q=(yield*i.get(J)).pending,G=BF.randomUUID();y7.info("requesting interactive",{id:G,command:V.command});let W=yield*H0.make(),_={id:G,command:V.command,cwd:V.cwd,env:V.env,description:V.description};return Q.set(G,{request:_,deferred:W}),yield*$.publish(sQ.Asked,_),yield*jZ.awaitDeferred(W,()=>{Q.delete(G)})}),Y=X.fn("BashInteractive.reply")(function*(V){let Q=(yield*i.get(J)).pending,G=Q.get(V.id);if(!G){y7.warn("reply for unknown request",{id:V.id});return}Q.delete(V.id),y7.info("replied",{id:V.id,exitCode:V.exitCode}),yield*$.publish(sQ.Replied,{id:G.request.id,output:V.output,exitCode:V.exitCode}),yield*H0.succeed(G.deferred,{output:V.output,exitCode:V.exitCode})}),K=X.fn("BashInteractive.list")(function*(){let V=(yield*i.get(J)).pending;return Array.from(V.values(),(Q)=>Q.request)});return HZ.of({request:Z,reply:Y,list:K})})),OF=_F.pipe(f.provide(P$.layer)),{runPromise:qF}=BZ(HZ,OF);function aQ($){return qF((J)=>J.request($))}var eQ=F.object({tool:F.string(),error:F.string()}),$X=F.object({questions:F.array(q8.zod).describe("Questions to ask")}),JX=F.object({command:F.string().describe("The command to execute"),timeout:F.number().describe("Optional timeout in milliseconds").optional(),workdir:F.string().describe("The working directory to run the command in. Defaults to the current directory. Use this instead of 'cd' commands.").optional(),interactive:F.boolean().describe("Set to true when the command requires user interaction (password input, y/N confirmation, SSH key passphrase, etc). The terminal will be handed to the user for direct interaction.").optional(),description:F.string().describe(`Clear, concise description of what this command does in 5-10 words. Examples:
7265
7265
  Input: ls
7266
7266
  Output: Lists files in current directory
7267
7267
 
@@ -7272,13 +7272,13 @@ Input: npm install
7272
7272
  Output: Installs package dependencies
7273
7273
 
7274
7274
  Input: mkdir foo
7275
- Output: Creates directory 'foo'`)}),eV=F.object({filePath:F.string().describe("The absolute path to the file or directory to read"),offset:F.coerce.number().int().min(1).describe("The line number to start reading from (1-indexed)").optional(),limit:F.coerce.number().int().min(1).describe("The maximum number of lines to read (defaults to 2000)").optional()}),$G=F.object({pattern:F.string().describe("The glob pattern to match files against"),path:F.string().optional().describe('The directory to search in. If not specified, the current working directory will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter "undefined" or "null" - simply omit it for the default behavior. Must be a valid directory path if provided.')}),JG=F.object({pattern:F.string().describe("The regex pattern to search for in file contents"),path:F.string().optional().describe("The directory to search in. Defaults to the current working directory."),include:F.string().optional().describe('File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}")')}),HF=F.object({filePath:F.string().describe("The absolute path to the file to modify"),oldString:F.string().describe("The text to replace"),newString:F.string().describe("The text to replace it with (must be different from oldString)"),replaceAll:F.boolean().optional().describe("Replace all occurrences of oldString (default false)")}),ZG=HF,YG=F.object({content:F.string().describe("The content to write to the file"),filePath:F.string().describe("The absolute path to the file to write (must be absolute, not relative)")}),_F="(optional) Model for this subagent: a model group name (e.g. fast/economical/default/power) or a literal provider/model. Overrides the agent's configured model; defaults to the agent's model, else the parent's. If no model_groups are configured, the tier names resolve to their default model.";function KG($=F.string()){let J=F.string().min(1).describe("Actor session id to operate on. Distinct from the user-task IDs (T1, T2, ...) used by the `task` tool."),Z=F.number().int().positive().optional().describe("(optional) Milliseconds to wait before returning { status: 'timeout' }. Default 600000 (10 min)."),Y=F.string().min(1).describe("A short (3-5 words) description of the task."),K=F.string().min(1).describe("The task for the agent to perform."),Q=$.describe("The type of specialized agent to use for this task."),V=F.string().min(1).optional().describe(_F),X=F.string().min(1).optional().describe("(optional) The command that triggered this task."),W=F.string().min(1).optional().describe("(optional) If this subagent is doing work for a specific task in the `task` tool, pass that task's ID (e.g. T4, T2.1) here \u2014 only an ID the `task` tool returned this session. After completion, the actor.postStop hook validates that tasks/<task_id>/progress.md exists with the required sections. If the ID is malformed or names no existing task, the binding is silently dropped and the subagent's findings are NOT captured to that task. Leave omitted only for work that isn't tied to a task."),_=F.strictObject({action:F.literal("run").describe("Spawn a subagent and block until it completes; the result is returned inline as the tool response."),description:Y,prompt:K,subagent_type:Q,model:V,actor_id:F.string().min(1).optional().describe("(optional) If set, resume the specified prior actor session instead of creating a new one. Distinct from the user-task IDs (T1, T2, ...) used by the `task` tool."),timeout_ms:Z,command:X,context:F.enum(["none","state","full"]).optional().describe("(optional) Context inheritance. 'none' (default): child sees only prompt. 'full': child sees parent conversation (prefix cache sharing). 'state': child gets checkpoint summary."),task_id:W,output_schema:F.record(F.string(),F.any()).optional().describe("(optional) A JSON Schema. When set, the subagent is forced to return a single structured object matching this schema (via the StructuredOutput tool) instead of free text; the validated object is returned in <actor_result>.")}),j=F.strictObject({action:F.literal("spawn").describe("Spawn a subagent and return its actor_id immediately; result is delivered as a notification or via a separate `wait` call."),description:Y,prompt:K,subagent_type:Q,model:V,actor_id:F.string().min(1).optional().describe("(optional) If set, resume the specified prior actor session instead of creating a new one."),command:X,context:F.enum(["none","state","full"]).optional().describe("(optional) Context inheritance. Default 'none'."),task_id:W,output_schema:F.record(F.string(),F.any()).optional().describe("(optional) A JSON Schema. When set, the subagent is forced to return a single structured object matching this schema (via the StructuredOutput tool) instead of free text.")}),H=F.strictObject({action:F.literal("status"),actor_id:J}),q=F.strictObject({action:F.literal("wait"),actor_id:J,timeout_ms:Z}),U=F.strictObject({action:F.literal("cancel"),actor_id:J}),z=F.strictObject({action:F.literal("send"),to_session_id:F.string().min(1).optional().describe("(optional) Target session ID. Defaults to the current session \u2014 useful for sending to subagents in this session."),to_actor_id:F.string().min(1).describe("Target actor ID. Use 'main' to send to a session's main agent, or a subagent ID like 'explore-1'."),content:F.string().min(1).describe("Message content (plain text). Wrapped in <inbox> for the receiver."),type:F.string().optional().describe("(optional) Message type. Default 'text' is wrapped in <inbox>...</inbox>. 'actor_notification' is passed through verbatim (sender pre-renders).")});return F.strictObject({operation:F.discriminatedUnion("action",[_,j,H,q,U,z]).meta({type:"object"})})}var QG=F.object({url:F.string().describe("The URL to fetch content from"),format:F.enum(["text","markdown","html"]).default("markdown").describe("The format to return the content in (text, markdown, or html). Defaults to markdown."),timeout:F.number().min(1).describe("Optional timeout in seconds (min 1, max 120)").optional()}),VG=F.object({query:F.string().describe("Websearch query"),numResults:F.number().optional().describe("Number of search results to return (default: 8)"),timeout:F.number().min(1).describe("Optional timeout in seconds (min 1, max 120)").optional(),livecrawl:F.enum(["fallback","preferred"]).optional().describe("Live crawl mode - 'fallback': use live crawling as backup if cached content unavailable, 'preferred': prioritize live crawling (default: 'fallback')"),type:F.enum(["auto","fast","deep"]).optional().describe("Search type - 'auto': balanced search (default), 'fast': quick results, 'deep': comprehensive search"),contextMaxCharacters:F.number().optional().describe("Maximum characters for context string optimized for LLMs (default: 10000)")}),GG=F.object({query:F.string().describe("Search query to find relevant context for APIs, Libraries, and SDKs. For example, 'React useState hook examples', 'Python pandas dataframe filtering', 'Express.js middleware', 'Next js partial prerendering configuration'"),tokensNum:F.number().min(1000).max(50000).default(5000).describe("Number of tokens to return (1000-50000). Default is 5000 tokens. Adjust this value based on how much context you need - use lower values for focused queries and higher values for comprehensive documentation.")}),XG=F.object({name:F.string().describe("The name of the skill from available_skills")}),WG=F.object({patchText:F.string().describe("The full patch text that describes all changes to be made")}),jG=F.object({path:F.string().describe("The directory to switch to. Absolute or relative to current working directory. Use '~' to reset to project root.")}),OF=["goToDefinition","findReferences","hover","documentSymbol","workspaceSymbol","goToImplementation","prepareCallHierarchy","incomingCalls","outgoingCalls"],UG=F.object({operation:F.enum(OF).describe("The LSP operation to perform"),filePath:F.string().describe("The absolute or relative path to the file"),line:F.number().int().min(1).describe("The line number (1-based, as shown in editors)"),character:F.number().int().min(1).describe("The character offset (1-based, as shown in editors)")}),BG=F.object({}),HG=F.object({}),_G=F.object({operation:F.enum(["search"]).default("search").describe("Memory operation to perform"),query:F.string().describe("Search query (BM25 over markdown bodies)"),scope:F.enum(["global","projects","sessions","cc"]).optional().describe("Filter by memory scope"),scope_id:F.string().optional().describe("Filter by scope id (e.g., session id, task id, project id hash)"),type:F.string().optional().describe("Filter by memory type (pinned, snapshot, learning, progress, free, ...)"),limit:F.number().optional().describe("Max results (default 10)")}),qF=F.enum(["user_text","assistant_text","tool_input","tool_error","reasoning","tool_output"]),OG=F.object({operation:F.enum(["search","around"]).describe("search: FTS BM25; around: pull message context"),query:F.string().optional().describe("FTS query (BM25 over text/tool bodies). Required for operation=search."),scope:F.enum(["project","global"]).optional().describe("Default project."),session_id:F.string().optional(),kind:F.array(qF).optional(),tool_name:F.string().optional().describe("Filter to a specific tool (e.g. Bash, Read)"),time_after:F.number().optional().describe("Unix ms"),time_before:F.number().optional(),limit:F.number().optional().describe("Max 50, default 10"),message_id:F.string().optional().describe("Anchor message id. Required for operation=around."),before:F.number().optional().describe("Default 5"),after:F.number().optional().describe("Default 5")}),FF=F.enum(["open","in_progress","blocked","done","abandoned"]),zF=F.strictObject({action:F.literal("create"),summary:F.string().min(1).describe("Task summary for a single task."),parent_id:F.string().min(1).optional().describe("Parent task id for sub-tasks."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),CF=F.strictObject({action:F.literal("list"),status:FF.optional().describe("Filter by status."),include_terminal:F.boolean().optional().describe("Include done/abandoned tasks. Default false."),include_archived:F.boolean().optional().describe("Include archived tasks. Default false."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),MF=F.strictObject({action:F.literal("get"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),DF=F.strictObject({action:F.literal("start"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),event_summary:F.string().min(1).optional().describe("Short note on starting."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),PF=F.strictObject({action:F.literal("block"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),event_summary:F.string().min(1).optional().describe("Short reason for blocking."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),IF=F.strictObject({action:F.literal("unblock"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),event_summary:F.string().min(1).optional().describe("Short reason for unblocking."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),AF=F.strictObject({action:F.literal("done"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),event_summary:F.string().min(1).optional().describe("Short summary of what was completed."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),SF=F.strictObject({action:F.literal("abandon"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),event_summary:F.string().min(1).optional().describe("Short reason for abandoning."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),wF=F.strictObject({action:F.literal("rename"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),summary:F.string().min(1).describe("New task summary."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),qG=F.strictObject({operation:F.discriminatedUnion("action",[zF,CF,MF,DF,PF,IF,AF,SF,wF]).meta({type:"object"})}),RF=F.strictObject({operation:F.literal("run"),name:F.string().min(1).optional().describe('(optional) Name of a built-in workflow to run (e.g. "deep-research"). Provide EITHER name OR script, not both.'),script:F.string().min(1).optional().describe("(optional) Inline JS workflow script; must begin with `export const meta = {...}`. Provide EITHER name OR script, not both."),args:F.any().optional().describe("(optional) JSON value exposed to the script as `args`."),workspace:F.string().optional().describe("(optional) Absolute dir the script's file primitives (readFile/writeFile/glob/exists) are jailed to. Defaults to the project worktree."),async:F.boolean().optional().describe("(optional) When true, return a run_id immediately and let the workflow run in the background; the result arrives later as an inbox notification. Default false: block until terminal and return the transcript inline (skill-like semantics, recommended for short workflows).")}),LF=F.strictObject({operation:F.literal("status"),run_id:F.string().min(1)}),NF=F.strictObject({operation:F.literal("wait"),run_id:F.string().min(1),timeout_ms:F.number().int().positive().optional()}),yF=F.strictObject({operation:F.literal("cancel"),run_id:F.string().min(1)}),TF=F.strictObject({operation:F.literal("resume"),run_id:F.string().min(1)}),FG=F.discriminatedUnion("operation",[RF,LF,NF,yF,TF]);import b3 from"os";import{createWriteStream as cA}from"fs";import{open as lA,stat as oA}from"fs/promises";class R0 extends Error{recoverable=!0;constructor($,J){super($,J);this.name="RecoverableError"}}function Wy($){if($ instanceof R0)return!0;return zG($)&&$.recoverable===!0}function _Z($,J){if(typeof $!=="string")return{value:$,decoded:!1,attempts:0};if($.trim()==="")return{value:$,decoded:!1,attempts:0};let Z=J?.maxDecodes,Y=Number.isFinite(Z)&&Z>=0?Z:2,K=Math.min(Y+1,3),Q=$,V=0;for(let X=0;X<K;X++){if(typeof Q!=="string")break;let W;try{W=JSON.parse(Q)}catch{return{value:$,decoded:!1,attempts:V}}if(V++,W!==null&&typeof W==="object")return{value:W,decoded:!0,attempts:V};if(typeof W==="string"){Q=W;continue}return{value:$,decoded:!1,attempts:V}}return{value:$,decoded:!1,attempts:V}}function CG($,J=500){let Z;try{Z=typeof $==="string"?$:JSON.stringify($)??String($)}catch{try{Z=String($)}catch{Z="<unrenderable>"}}let Y=J>0?J:0;if(Z.length<=Y)return Z;return`${Z.slice(0,Y)}\u2026 (${Z.length} chars total)`}var c0={};o$(c0,{layer:()=>BB,defaultLayer:()=>wA,Service:()=>A6,Info:()=>SA,Agent:()=>c0});var JB={};o$(JB,{renderWorkflowCatalog:()=>eU,layer:()=>$B,defaultLayer:()=>AA,Service:()=>P6});import kF from"path";function EF($){for(let J of w0.stream($,{agentID:"*"}))if(J.info.role==="user"&&J.info.model)return J.info.model;return}var MG=G.fn("runPlanSwitch")(function*($,J,Z){let Y=yield*$.session.get(J.sessionID),K=kF.relative(B$.worktree,Y1.plan(Y)),V=(yield*$.question.ask({sessionID:J.sessionID,questions:[{key:Z.key,params:{plan:K},question:Z.question(K),header:"Plan",options:Z.options}],tool:J.callID?{messageID:J.messageID,callID:J.callID}:void 0}))[0]?.[0];if(V==="No")return yield*new B1.RejectedError;if(V!=="Yes")return{title:"User provided feedback",output:`User chose not to switch yet and provided feedback: ${V}`,metadata:{switched:!1,feedback:V}};let X=EF(J.sessionID)??(yield*$.provider.defaultModel()),W={id:IJ.ascending(),sessionID:J.sessionID,role:"user",time:{created:Date.now()},agent:Z.agent,model:X};return yield*$.session.updateMessage(W),yield*$.session.updatePart({id:f2.ascending(),messageID:W.id,sessionID:J.sessionID,type:"text",text:Z.text(K),synthetic:!0}),{title:Z.title,output:Z.output,metadata:{switched:!0,feedback:""}}}),DG=H$("plan_enter",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("plan_enter"))??"",J=yield*Y1.Service,Z=yield*B1.Service,Y=yield*H1.Service;return{description:$,parameters:BG,execute:(K,Q)=>G.gen(function*(){if(Q.agent==="plan")return{title:"Already in plan mode",output:"You are already in plan mode. This tool is only effective outside of plan mode.",metadata:{switched:!1,feedback:""}};return yield*MG({session:J,question:Z,provider:Y},Q,{key:"plan_enter",question:()=>"Would you like to switch to plan mode for structured planning?",options:[{label:"Yes",description:"Switch to plan agent for read-only planning"},{label:"No",description:"Stay in current mode"}],agent:"plan",text:(V)=>`Switched to plan mode. Create a plan at ${V}`,title:"Switching to plan agent",output:"User approved switching to plan agent. Wait for further instructions."})}).pipe(G.orDie)}})),PG=H$("plan_exit",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("plan_exit"))??"",J=yield*Y1.Service,Z=yield*B1.Service,Y=yield*H1.Service;return{description:$,parameters:HG,execute:(K,Q)=>G.gen(function*(){if(Q.agent!=="plan")return{title:"Not in plan mode",output:"You are not in plan mode. This tool is only effective in plan mode.",metadata:{switched:!1,feedback:""}};return yield*MG({session:J,question:Z,provider:Y},Q,{key:"plan_exit",question:(V)=>`Plan at ${V} is complete. Would you like to switch to the build agent and start implementing?`,options:[{label:"Yes",description:"Switch to build agent and start implementing the plan"},{label:"No",description:"Stay with plan agent to continue refining the plan"}],agent:"build",text:(V)=>`The plan at ${V} has been approved, you can now edit files. Execute the plan`,title:"Switching to build agent",output:"User approved switching to build agent. Wait for further instructions."})}).pipe(G.orDie)}}));var xF=aV,bF=`
7275
+ Output: Creates directory 'foo'`)}),ZX=F.object({filePath:F.string().describe("The absolute path to the file or directory to read"),offset:F.coerce.number().int().min(1).describe("The line number to start reading from (1-indexed)").optional(),limit:F.coerce.number().int().min(1).describe("The maximum number of lines to read (defaults to 2000)").optional()}),YX=F.object({pattern:F.string().describe("The glob pattern to match files against"),path:F.string().optional().describe('The directory to search in. If not specified, the current working directory will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter "undefined" or "null" - simply omit it for the default behavior. Must be a valid directory path if provided.')}),KX=F.object({pattern:F.string().describe("The regex pattern to search for in file contents"),path:F.string().optional().describe("The directory to search in. Defaults to the current working directory."),include:F.string().optional().describe('File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}")')}),FF=F.object({filePath:F.string().describe("The absolute path to the file to modify"),oldString:F.string().describe("The text to replace"),newString:F.string().describe("The text to replace it with (must be different from oldString)"),replaceAll:F.boolean().optional().describe("Replace all occurrences of oldString (default false)")}),VX=FF,QX=F.object({content:F.string().describe("The content to write to the file"),filePath:F.string().describe("The absolute path to the file to write (must be absolute, not relative)")}),zF="(optional) Model for this subagent: a model group name (e.g. fast/economical/default/power) or a literal provider/model. Overrides the agent's configured model; defaults to the agent's model, else the parent's. If no model_groups are configured, the tier names resolve to their default model.";function XX($=F.string()){let J=F.string().min(1).describe("Actor session id to operate on. Distinct from the user-task IDs (T1, T2, ...) used by the `task` tool."),Z=F.number().int().positive().optional().describe("(optional) Milliseconds to wait before returning { status: 'timeout' }. Default 600000 (10 min)."),Y=F.string().min(1).describe("A short (3-5 words) description of the task."),K=F.string().min(1).describe("The task for the agent to perform."),V=$.describe("The type of specialized agent to use for this task."),Q=F.string().min(1).optional().describe(zF),G=F.string().min(1).optional().describe("(optional) The command that triggered this task."),W=F.string().min(1).optional().describe("(optional) If this subagent is doing work for a specific task in the `task` tool, pass that task's ID (e.g. T4, T2.1) here \u2014 only an ID the `task` tool returned this session. After completion, the actor.postStop hook validates that tasks/<task_id>/progress.md exists with the required sections. If the ID is malformed or names no existing task, the binding is silently dropped and the subagent's findings are NOT captured to that task. Leave omitted only for work that isn't tied to a task."),_=F.strictObject({action:F.literal("run").describe("Spawn a subagent and block until it completes; the result is returned inline as the tool response."),description:Y,prompt:K,subagent_type:V,model:Q,actor_id:F.string().min(1).optional().describe("(optional) If set, resume the specified prior actor session instead of creating a new one. Distinct from the user-task IDs (T1, T2, ...) used by the `task` tool."),timeout_ms:Z,command:G,context:F.enum(["none","state","full"]).optional().describe("(optional) Context inheritance. 'none' (default): child sees only prompt. 'full': child sees parent conversation (prefix cache sharing). 'state': child gets checkpoint summary."),task_id:W,output_schema:F.record(F.string(),F.any()).optional().describe("(optional) A JSON Schema. When set, the subagent is forced to return a single structured object matching this schema (via the StructuredOutput tool) instead of free text; the validated object is returned in <actor_result>.")}),j=F.strictObject({action:F.literal("spawn").describe("Spawn a subagent and return its actor_id immediately; result is delivered as a notification or via a separate `wait` call."),description:Y,prompt:K,subagent_type:V,model:Q,actor_id:F.string().min(1).optional().describe("(optional) If set, resume the specified prior actor session instead of creating a new one."),command:G,context:F.enum(["none","state","full"]).optional().describe("(optional) Context inheritance. Default 'none'."),task_id:W,output_schema:F.record(F.string(),F.any()).optional().describe("(optional) A JSON Schema. When set, the subagent is forced to return a single structured object matching this schema (via the StructuredOutput tool) instead of free text.")}),B=F.strictObject({action:F.literal("status"),actor_id:J}),q=F.strictObject({action:F.literal("wait"),actor_id:J,timeout_ms:Z}),U=F.strictObject({action:F.literal("cancel"),actor_id:J}),z=F.strictObject({action:F.literal("send"),to_session_id:F.string().min(1).optional().describe("(optional) Target session ID. Defaults to the current session \u2014 useful for sending to subagents in this session."),to_actor_id:F.string().min(1).describe("Target actor ID. Use 'main' to send to a session's main agent, or a subagent ID like 'explore-1'."),content:F.string().min(1).describe("Message content (plain text). Wrapped in <inbox> for the receiver."),type:F.string().optional().describe("(optional) Message type. Default 'text' is wrapped in <inbox>...</inbox>. 'actor_notification' is passed through verbatim (sender pre-renders).")});return F.strictObject({operation:F.discriminatedUnion("action",[_,j,B,q,U,z]).meta({type:"object"})})}var GX=F.object({url:F.string().describe("The URL to fetch content from"),format:F.enum(["text","markdown","html"]).default("markdown").describe("The format to return the content in (text, markdown, or html). Defaults to markdown."),timeout:F.number().min(1).describe("Optional timeout in seconds (min 1, max 120)").optional()}),WX=F.object({query:F.string().describe("Websearch query"),numResults:F.number().optional().describe("Number of search results to return (default: 8)"),timeout:F.number().min(1).describe("Optional timeout in seconds (min 1, max 120)").optional(),livecrawl:F.enum(["fallback","preferred"]).optional().describe("Live crawl mode - 'fallback': use live crawling as backup if cached content unavailable, 'preferred': prioritize live crawling (default: 'fallback')"),type:F.enum(["auto","fast","deep"]).optional().describe("Search type - 'auto': balanced search (default), 'fast': quick results, 'deep': comprehensive search"),contextMaxCharacters:F.number().optional().describe("Maximum characters for context string optimized for LLMs (default: 10000)")}),jX=F.object({query:F.string().describe("Search query to find relevant context for APIs, Libraries, and SDKs. For example, 'React useState hook examples', 'Python pandas dataframe filtering', 'Express.js middleware', 'Next js partial prerendering configuration'"),tokensNum:F.number().min(1000).max(50000).default(5000).describe("Number of tokens to return (1000-50000). Default is 5000 tokens. Adjust this value based on how much context you need - use lower values for focused queries and higher values for comprehensive documentation.")}),UX=F.object({name:F.string().describe("The name of the skill from available_skills")}),HX=F.object({patchText:F.string().describe("The full patch text that describes all changes to be made")}),BX=F.object({path:F.string().describe("The directory to switch to. Absolute or relative to current working directory. Use '~' to reset to project root.")}),MF=["goToDefinition","findReferences","hover","documentSymbol","workspaceSymbol","goToImplementation","prepareCallHierarchy","incomingCalls","outgoingCalls"],_X=F.object({operation:F.enum(MF).describe("The LSP operation to perform"),filePath:F.string().describe("The absolute or relative path to the file"),line:F.number().int().min(1).describe("The line number (1-based, as shown in editors)"),character:F.number().int().min(1).describe("The character offset (1-based, as shown in editors)")}),OX=F.object({}),qX=F.object({}),FX=F.object({operation:F.enum(["search"]).default("search").describe("Memory operation to perform"),query:F.string().describe("Search query (BM25 over markdown bodies)"),scope:F.enum(["global","projects","sessions","cc"]).optional().describe("Filter by memory scope"),scope_id:F.string().optional().describe("Filter by scope id (e.g., session id, task id, project id hash)"),type:F.string().optional().describe("Filter by memory type (pinned, snapshot, learning, progress, free, ...)"),limit:F.number().optional().describe("Max results (default 10)")}),CF=F.enum(["user_text","assistant_text","tool_input","tool_error","reasoning","tool_output"]),zX=F.object({operation:F.enum(["search","around"]).describe("search: FTS BM25; around: pull message context"),query:F.string().optional().describe("FTS query (BM25 over text/tool bodies). Required for operation=search."),scope:F.enum(["project","global"]).optional().describe("Default project."),session_id:F.string().optional(),kind:F.array(CF).optional(),tool_name:F.string().optional().describe("Filter to a specific tool (e.g. Bash, Read)"),time_after:F.number().optional().describe("Unix ms"),time_before:F.number().optional(),limit:F.number().optional().describe("Max 50, default 10"),message_id:F.string().optional().describe("Anchor message id. Required for operation=around."),before:F.number().optional().describe("Default 5"),after:F.number().optional().describe("Default 5")}),DF=F.enum(["open","in_progress","blocked","done","abandoned"]),PF=F.strictObject({action:F.literal("create"),summary:F.string().min(1).describe("Task summary for a single task."),parent_id:F.string().min(1).optional().describe("Parent task id for sub-tasks."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),IF=F.strictObject({action:F.literal("list"),status:DF.optional().describe("Filter by status."),include_terminal:F.boolean().optional().describe("Include done/abandoned tasks. Default false."),include_archived:F.boolean().optional().describe("Include archived tasks. Default false."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),AF=F.strictObject({action:F.literal("get"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),SF=F.strictObject({action:F.literal("start"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),event_summary:F.string().min(1).optional().describe("Short note on starting."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),RF=F.strictObject({action:F.literal("block"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),event_summary:F.string().min(1).optional().describe("Short reason for blocking."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),wF=F.strictObject({action:F.literal("unblock"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),event_summary:F.string().min(1).optional().describe("Short reason for unblocking."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),LF=F.strictObject({action:F.literal("done"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),event_summary:F.string().min(1).optional().describe("Short summary of what was completed."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),NF=F.strictObject({action:F.literal("abandon"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),event_summary:F.string().min(1).optional().describe("Short reason for abandoning."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),yF=F.strictObject({action:F.literal("rename"),id:F.string().min(1).describe("Task id, e.g. T1 or T1.1."),summary:F.string().min(1).describe("New task summary."),session_id:F.string().min(1).optional().describe("Session id to act on. Defaults to current session.")}),MX=F.strictObject({operation:F.discriminatedUnion("action",[PF,IF,AF,SF,RF,wF,LF,NF,yF]).meta({type:"object"})}),TF=F.strictObject({operation:F.literal("run"),name:F.string().min(1).optional().describe('(optional) Name of a built-in workflow to run (e.g. "deep-research"). Provide EITHER name OR script, not both.'),script:F.string().min(1).optional().describe("(optional) Inline JS workflow script; must begin with `export const meta = {...}`. Provide EITHER name OR script, not both."),args:F.any().optional().describe("(optional) JSON value exposed to the script as `args`."),workspace:F.string().optional().describe("(optional) Absolute dir the script's file primitives (readFile/writeFile/glob/exists) are jailed to. Defaults to the project worktree."),async:F.boolean().optional().describe("(optional) When true, return a run_id immediately and let the workflow run in the background; the result arrives later as an inbox notification. Default false: block until terminal and return the transcript inline (skill-like semantics, recommended for short workflows).")}),kF=F.strictObject({operation:F.literal("status"),run_id:F.string().min(1)}),EF=F.strictObject({operation:F.literal("wait"),run_id:F.string().min(1),timeout_ms:F.number().int().positive().optional()}),xF=F.strictObject({operation:F.literal("cancel"),run_id:F.string().min(1)}),bF=F.strictObject({operation:F.literal("resume"),run_id:F.string().min(1)}),CX=F.discriminatedUnion("operation",[TF,kF,EF,xF,bF]);import g3 from"os";import{createWriteStream as tA}from"fs";import{open as eA,stat as $S}from"fs/promises";class w0 extends Error{recoverable=!0;constructor($,J){super($,J);this.name="RecoverableError"}}function Fy($){if($ instanceof w0)return!0;return DX($)&&$.recoverable===!0}function _Z($,J){if(typeof $!=="string")return{value:$,decoded:!1,attempts:0};if($.trim()==="")return{value:$,decoded:!1,attempts:0};let Z=J?.maxDecodes,Y=Number.isFinite(Z)&&Z>=0?Z:2,K=Math.min(Y+1,3),V=$,Q=0;for(let G=0;G<K;G++){if(typeof V!=="string")break;let W;try{W=JSON.parse(V)}catch{return{value:$,decoded:!1,attempts:Q}}if(Q++,W!==null&&typeof W==="object")return{value:W,decoded:!0,attempts:Q};if(typeof W==="string"){V=W;continue}return{value:$,decoded:!1,attempts:Q}}return{value:$,decoded:!1,attempts:Q}}function PX($,J=500){let Z;try{Z=typeof $==="string"?$:JSON.stringify($)??String($)}catch{try{Z=String($)}catch{Z="<unrenderable>"}}let Y=J>0?J:0;if(Z.length<=Y)return Z;return`${Z.slice(0,Y)}\u2026 (${Z.length} chars total)`}var k7=new Set(["__proto__","constructor","prototype"]),vF=8,hF=65536;function IX($,J){return Number.isFinite($)&&$>=0?Math.min(Math.floor($),J):J}function gF($,J){let Z=$;for(let Y of J){if(Z===null||Z===void 0)return;if(typeof Y==="number"){if(!Array.isArray(Z))return;Z=Z[Y];continue}if(typeof Z!=="object")return;let K=Z;if(Y in k7)return;if(!Object.prototype.hasOwnProperty.call(K,Y))return;Z=K[Y]}return Z}function T7($,J,Z){if(J.length===0)return Z;let[Y,...K]=J;if(typeof Y==="number"){let Q=Array.isArray($)?$.slice():[];if(Q.length<=Y)Q.length=Y+1;return Q[Y]=T7(Q[Y],K,Z),Q}if(k7.has(Y))return $;let V=$&&typeof $==="object"&&!Array.isArray($)?{...$}:{};return V[Y]=T7($&&typeof $==="object"&&!Array.isArray($)?$[Y]:void 0,K,Z),V}function fF($,J){return J.reduce((Z,Y)=>T7(Z,Y.path,Y.value),$)}function AX($,J,Z){let Y=IX(Z?.maxRepairs,vF),K=IX(Z?.maxStringBytes,hF);if(J.safeParse($).success)return{value:$,repaired:!1,repairedPaths:[]};let V=J.safeParse($).error,Q=[];for(let W of V.issues){if(Q.length>=Y)break;if(W.code!=="invalid_type")continue;let _=W.path.filter((z)=>typeof z==="string"||typeof z==="number");if(_.length===0)continue;if(_.some((z)=>typeof z==="string"&&k7.has(z)))continue;let j=W.expected;if(j!=="object"&&j!=="array")continue;let B=gF($,_);if(typeof B!=="string")continue;if(B.length>K)continue;let q;try{q=JSON.parse(B)}catch{continue}let U=q!==null&&typeof q==="object"&&!Array.isArray(q);if(j==="object"&&!U)continue;if(j==="array"&&!Array.isArray(q))continue;Q.push({path:_,value:q})}if(Q.length===0)return{value:$,repaired:!1,repairedPaths:[]};let G=fF($,Q);if(!J.safeParse(G).success)return{value:$,repaired:!1,repairedPaths:[]};return{value:G,repaired:!0,repairedPaths:Q.map((W)=>W.path)}}var c0={};o$(c0,{layer:()=>FH,defaultLayer:()=>xA,Service:()=>A6,Info:()=>EA,Agent:()=>c0});var QH={};o$(QH,{renderWorkflowCatalog:()=>KH,layer:()=>VH,defaultLayer:()=>kA,Service:()=>P6});import mF from"path";function uF($){for(let J of R0.stream($,{agentID:"*"}))if(J.info.role==="user"&&J.info.model)return J.info.model;return}var SX=X.fn("runPlanSwitch")(function*($,J,Z){let Y=yield*$.session.get(J.sessionID),K=mF.relative(H$.worktree,Y1.plan(Y)),Q=(yield*$.question.ask({sessionID:J.sessionID,questions:[{key:Z.key,params:{plan:K},question:Z.question(K),header:"Plan",options:Z.options}],tool:J.callID?{messageID:J.messageID,callID:J.callID}:void 0}))[0]?.[0];if(Q==="No")return yield*new H1.RejectedError;if(Q!=="Yes")return{title:"User provided feedback",output:`User chose not to switch yet and provided feedback: ${Q}`,metadata:{switched:!1,feedback:Q}};let G=uF(J.sessionID)??(yield*$.provider.defaultModel()),W={id:IJ.ascending(),sessionID:J.sessionID,role:"user",time:{created:Date.now()},agent:Z.agent,model:G};return yield*$.session.updateMessage(W),yield*$.session.updatePart({id:f2.ascending(),messageID:W.id,sessionID:J.sessionID,type:"text",text:Z.text(K),synthetic:!0}),{title:Z.title,output:Z.output,metadata:{switched:!0,feedback:""}}}),RX=B$("plan_enter",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("plan_enter"))??"",J=yield*Y1.Service,Z=yield*H1.Service,Y=yield*B1.Service;return{description:$,parameters:OX,execute:(K,V)=>X.gen(function*(){if(V.agent==="plan")return{title:"Already in plan mode",output:"You are already in plan mode. This tool is only effective outside of plan mode.",metadata:{switched:!1,feedback:""}};return yield*SX({session:J,question:Z,provider:Y},V,{key:"plan_enter",question:()=>"Would you like to switch to plan mode for structured planning?",options:[{label:"Yes",description:"Switch to plan agent for read-only planning"},{label:"No",description:"Stay in current mode"}],agent:"plan",text:(Q)=>`Switched to plan mode. Create a plan at ${Q}`,title:"Switching to plan agent",output:"User approved switching to plan agent. Wait for further instructions."})}).pipe(X.orDie)}})),wX=B$("plan_exit",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("plan_exit"))??"",J=yield*Y1.Service,Z=yield*H1.Service,Y=yield*B1.Service;return{description:$,parameters:qX,execute:(K,V)=>X.gen(function*(){if(V.agent!=="plan")return{title:"Not in plan mode",output:"You are not in plan mode. This tool is only effective in plan mode.",metadata:{switched:!1,feedback:""}};return yield*SX({session:J,question:Z,provider:Y},V,{key:"plan_exit",question:(Q)=>`Plan at ${Q} is complete. Would you like to switch to the build agent and start implementing?`,options:[{label:"Yes",description:"Switch to build agent and start implementing the plan"},{label:"No",description:"Stay with plan agent to continue refining the plan"}],agent:"build",text:(Q)=>`The plan at ${Q} has been approved, you can now edit files. Execute the plan`,title:"Switching to build agent",output:"User approved switching to build agent. Wait for further instructions."})}).pipe(X.orDie)}}));var dF=$X,pF=`
7276
7276
 
7277
7277
  ## Client rules for this prompt
7278
7278
  - A free-text answer is ALWAYS offered alongside your options. Never add an option that only means "Type your own answer", "Provide details", "Other" or similar \u2014 the client strips those, and a list with one real entry is not a choice.
7279
7279
  - Only call this tool when you can offer at least TWO mutually exclusive, decision-bearing options. Every option must be a distinct, actionable choice that leads to visibly different work.
7280
7280
  - If there is no real choice to make \u2014 you simply need more information, context or goals \u2014 ask for it as prose in your reply. Do NOT call this tool for that.
7281
- - The user may dismiss the prompt. You then get a "declined" result: proceed with your best judgement or stop and wait for direction. Do not re-ask the same question.`,IG=($)=>({title:`Dismissed ${$} question${$===1?"":"s"}`,output:"The user declined to answer and dismissed the question. This is final for this turn \u2014 do NOT ask again. "+"Either proceed with your best judgement using what you already know, or stop and wait for the user to give direction.",metadata:{answers:[],declined:!0}});function vF($){for(let J=$.length-1;J>=0;J--){let Z=$[J]?.info;if(Z?.role==="user")return Z.time.created}return 0}var AG=H$("question",G.gen(function*(){let $=((yield*e.toolDescriptionEffect("question"))??"")+bF,J=yield*B1.Service;return{description:$,parameters:xF,execute:(Z,Y)=>G.gen(function*(){if(yield*J.neverAsk())return{title:`Auto-resolved ${Z.questions.length} question${Z.questions.length>1?"s":""}`,output:"[Never-Ask] No user is available to answer (never-ask mode is on). "+"Re-evaluate the options you just proposed for unattended/headless execution \u2014 "+"prefer text-only, non-interactive, minimal-scope paths and avoid anything that needs a GUI or the user to be present. Pick the best option yourself and continue. "+"IMPORTANT: You MUST explicitly state which option you chose and why in your response text (not just in thinking) \u2014 "+"the user will review the conversation history later and needs to see what you decided without expanding thinking blocks. This applies only to this question; never-ask may be turned off later, so keep using the question tool at future decision points (the user may have returned).",metadata:{answers:Z.questions.map(()=>["[Never-Ask] The model will decide autonomously"])}};let K=yield*J.declinedAt(Y.sessionID);if(K!==void 0&&K>=vF(Y.messages))return IG(Z.questions.length);let Q=yield*J.ask({sessionID:Y.sessionID,questions:Z.questions,tool:Y.callID?{messageID:Y.messageID,callID:Y.callID}:void 0}).pipe(G.catch(()=>G.succeed(void 0)));if(Q===void 0)return IG(Z.questions.length);let V=Z.questions.map((X,W)=>`"${X.question}"="${Q[W]?.length?Q[W].join(", "):"Unanswered"}"`).join(", ");return{title:`Asked ${Z.questions.length} question${Z.questions.length>1?"s":""}`,output:`User has answered your questions: ${V}. You can now continue with the user's answers in mind.`,metadata:{answers:Q}}}).pipe(G.orDie)}}));import*as SJ from"path";var t$={};o$(t$,{set:()=>mF,get:()=>fF,clear:()=>uF,SessionCwd:()=>t$,Event:()=>gF});var hF=1000,j2=new Map;SG(async()=>{j2.clear()});var gF={Changed:Z0.define("session.cwd",F.object({sessionID:F0.zod,cwd:F.string()}))};function fF($){return j2.get($)??B$.directory}function mF($,J){if(j2.delete($),j2.set($,J),j2.size>hF){let Z=j2.keys().next().value;if(Z!==void 0)j2.delete(Z)}}function uF($){j2.delete($)}import m2 from"path";import*as x0 from"path";var dF=["global","projects","sessions"],pF=/^T\d+(\.\d+)*$/;function cF($){if($.length<3)return!1;if($[0]==="projects"){if($.length!==3)return!1;let J=$[2];if(!J.endsWith(".md"))return!1;let Z=J.toLowerCase();return Z==="memory.md"||Z.startsWith("memory-")}if($[0]==="sessions"){let J=$.slice(2);if(J.length===1){let Z=J[0];if(!Z.endsWith(".md"))return!1;return Z==="checkpoint.md"||Z==="notes.md"||Z.startsWith("checkpoint-")}if(J.length===3&&J[0]==="tasks")return pF.test(J[1])&&J[2].endsWith(".md");return!1}return!1}function wG($,J,Z){return`Memory writes go under <memoryRoot>/<scope>/<scope_id>/<key>.md (scope: global | projects | sessions). You attempted: ${Z}.
7281
+ - The user may dismiss the prompt. You then get a "declined" result: proceed with your best judgement or stop and wait for direction. Do not re-ask the same question.`,LX=($)=>({title:`Dismissed ${$} question${$===1?"":"s"}`,output:"The user declined to answer and dismissed the question. This is final for this turn \u2014 do NOT ask again. "+"Either proceed with your best judgement using what you already know, or stop and wait for the user to give direction.",metadata:{answers:[],declined:!0}});function cF($){for(let J=$.length-1;J>=0;J--){let Z=$[J]?.info;if(Z?.role==="user")return Z.time.created}return 0}var NX=B$("question",X.gen(function*(){let $=((yield*e.toolDescriptionEffect("question"))??"")+pF,J=yield*H1.Service;return{description:$,parameters:dF,execute:(Z,Y)=>X.gen(function*(){if(yield*J.neverAsk())return{title:`Auto-resolved ${Z.questions.length} question${Z.questions.length>1?"s":""}`,output:"[Never-Ask] No user is available to answer (never-ask mode is on). "+"Re-evaluate the options you just proposed for unattended/headless execution \u2014 "+"prefer text-only, non-interactive, minimal-scope paths and avoid anything that needs a GUI or the user to be present. Pick the best option yourself and continue. "+"IMPORTANT: You MUST explicitly state which option you chose and why in your response text (not just in thinking) \u2014 "+"the user will review the conversation history later and needs to see what you decided without expanding thinking blocks. This applies only to this question; never-ask may be turned off later, so keep using the question tool at future decision points (the user may have returned).",metadata:{answers:Z.questions.map(()=>["[Never-Ask] The model will decide autonomously"])}};let K=yield*J.declinedAt(Y.sessionID);if(K!==void 0&&K>=cF(Y.messages))return LX(Z.questions.length);let V=yield*J.ask({sessionID:Y.sessionID,questions:Z.questions,tool:Y.callID?{messageID:Y.messageID,callID:Y.callID}:void 0}).pipe(X.catch(()=>X.succeed(void 0)));if(V===void 0)return LX(Z.questions.length);let Q=Z.questions.map((G,W)=>`"${G.question}"="${V[W]?.length?V[W].join(", "):"Unanswered"}"`).join(", ");return{title:`Asked ${Z.questions.length} question${Z.questions.length>1?"s":""}`,output:`User has answered your questions: ${Q}. You can now continue with the user's answers in mind.`,metadata:{answers:V}}}).pipe(X.orDie)}}));import*as SJ from"path";var t$={};o$(t$,{set:()=>iF,get:()=>rF,clear:()=>sF,SessionCwd:()=>t$,Event:()=>oF});var lF=1000,j2=new Map;yX(async()=>{j2.clear()});var oF={Changed:Z0.define("session.cwd",F.object({sessionID:F0.zod,cwd:F.string()}))};function rF($){return j2.get($)??H$.directory}function iF($,J){if(j2.delete($),j2.set($,J),j2.size>lF){let Z=j2.keys().next().value;if(Z!==void 0)j2.delete(Z)}}function sF($){j2.delete($)}import m2 from"path";import*as x0 from"path";var nF=["global","projects","sessions"],aF=/^T\d+(\.\d+)*$/;function tF($){if($.length<3)return!1;if($[0]==="projects"){if($.length!==3)return!1;let J=$[2];if(!J.endsWith(".md"))return!1;let Z=J.toLowerCase();return Z==="memory.md"||Z.startsWith("memory-")}if($[0]==="sessions"){let J=$.slice(2);if(J.length===1){let Z=J[0];if(!Z.endsWith(".md"))return!1;return Z==="checkpoint.md"||Z==="notes.md"||Z.startsWith("checkpoint-")}if(J.length===3&&J[0]==="tasks")return aF.test(J[1])&&J[2].endsWith(".md");return!1}return!1}function TX($,J,Z){return`Memory writes go under <memoryRoot>/<scope>/<scope_id>/<key>.md (scope: global | projects | sessions). You attempted: ${Z}.
7282
7282
 
7283
7283
  Canonical main-agent paths (copy verbatim):
7284
7284
  ${$}
@@ -7286,179 +7286,179 @@ Canonical main-agent paths (copy verbatim):
7286
7286
  ${J}
7287
7287
  `+" Append `## [turn N \xB7 ISO-Z]` entries for free-form scratch.\n"+`
7288
7288
  Other free-form <key>.md under a valid scope dir are also allowed.
7289
- checkpoint.md, task progress, and memory-/checkpoint-<topic>.md spillovers are checkpoint-writer's domain.`}function lF($){if($[0]!=="sessions"||$.length<4)return!1;if($[2]==="tasks")return!0;return!1}function RG($){let{target:J,agentName:Z,memoryRoot:Y,projectID:K,sessionID:Q}=$,V=x0.join(Y,"projects",K,"MEMORY.md"),X=x0.join(Y,"sessions",Q,"notes.md"),W=x0.join(Y,"sessions",Q,"checkpoint.md"),_=x0.join(Y,"sessions",Q,"tasks"),j=x0.resolve(Y),H=x0.resolve(J),q=x0.relative(j,H);if(!q||q===".."||q.startsWith(`..${x0.sep}`)||x0.isAbsolute(q))return;let U=q,z=U.split(x0.sep);if(z.length<2)throw Error(wG(V,X,J));let M=z[0];if(!dF.includes(M))throw Error(wG(V,X,J));if(Z==="checkpoint-writer"){if(!cF(z))throw Error(`Path '${U}' is not in the checkpoint-writer allowlist.
7289
+ checkpoint.md, task progress, and memory-/checkpoint-<topic>.md spillovers are checkpoint-writer's domain.`}function eF($){if($[0]!=="sessions"||$.length<4)return!1;if($[2]==="tasks")return!0;return!1}function kX($){let{target:J,agentName:Z,memoryRoot:Y,projectID:K,sessionID:V}=$,Q=x0.join(Y,"projects",K,"MEMORY.md"),G=x0.join(Y,"sessions",V,"notes.md"),W=x0.join(Y,"sessions",V,"checkpoint.md"),_=x0.join(Y,"sessions",V,"tasks"),j=x0.resolve(Y),B=x0.resolve(J),q=x0.relative(j,B);if(!q||q===".."||q.startsWith(`..${x0.sep}`)||x0.isAbsolute(q))return;let U=q,z=U.split(x0.sep);if(z.length<2)throw Error(TX(Q,G,J));let C=z[0];if(!nF.includes(C))throw Error(TX(Q,G,J));if(Z==="checkpoint-writer"){if(!tF(z))throw Error(`Path '${U}' is not in the checkpoint-writer allowlist.
7290
7290
  Writer may only write to:
7291
- ${V} \u2014 project memory (or memory-<topic>.md spillover)
7291
+ ${Q} \u2014 project memory (or memory-<topic>.md spillover)
7292
7292
  `+` ${W} \u2014 session checkpoint (or checkpoint-<topic>.md spillover)
7293
7293
  `+` ${_}/<task_id>/*.md \u2014 per-task narratives (any .md filename)
7294
- `+`You attempted: ${J}.`);return}if(lF(z)){if($.taskId&&z[2]==="tasks"&&z[3]===$.taskId&&z.length>=5&&z[z.length-1].endsWith(".md"))return;throw Error(`Path '${U}' is reserved for the checkpoint-writer subagent.
7294
+ `+`You attempted: ${J}.`);return}if(eF(z)){if($.taskId&&z[2]==="tasks"&&z[3]===$.taskId&&z.length>=5&&z[z.length-1].endsWith(".md"))return;throw Error(`Path '${U}' is reserved for the checkpoint-writer subagent.
7295
7295
  Main agent writes to:
7296
- ${V}
7297
- ${X}
7296
+ ${Q}
7297
+ ${G}
7298
7298
  Subagent bound to task <TID> may write to tasks/<TID>/*.md (pass task_id when spawning).
7299
- You attempted: ${J}.`)}}var _1=G.fn("Tool.assertExternalDirectory")(function*($,J,Z){if(!J)return;if(Z?.bypass)return;let Y=yield*i.context,K=process.platform==="win32"?$$.normalizePath(J):J;if(B$.containsPath(K,Y)){let j=$$.canonical(K);if(B$.containsPath(j,Y))return;throw Error("Access denied: path escapes project directory through a symlink")}let V=m2.join(f$.Path.data,"memory");if($$.contains(V,K)){let j=$$.canonical(K);if($$.contains(V,j))return;throw Error("Access denied: path escapes memory directory through a symlink")}let W=(Z?.kind??"file")==="directory"?K:m2.dirname(K),_=process.platform==="win32"?$$.normalizePathPattern(m2.join(W,"*")):m2.join(W,"*").replaceAll("\\","/");yield*$.ask({permission:"external_directory",patterns:[_],always:[_],metadata:{filepath:K,parentDir:W}})});var u2=G.fn("Tool.assertWriteAllowed")(function*($,J,Z){if(yield*_1($,J,Z),!J)return;let Y=(()=>{try{return B$.current?.project?.id??U2.global}catch{return U2.global}})();RG({target:$$.canonical(J),agentName:$.agent,memoryRoot:m2.join(f$.Path.data,"memory"),projectID:Y,sessionID:$.sessionID,taskId:$.taskId})}),LG=G.fn("Tool.askEditUnlessMemory")(function*($,J,Z){let Y=process.platform==="win32"?$$.normalizePath(J):J;if($$.contains(m2.join(f$.Path.data,"memory"),Y))return;yield*$.ask({permission:"edit",patterns:Z.patterns,always:["*"],metadata:{filepath:J,diff:Z.diff,...Z.files!==void 0?{files:Z.files}:{}}})});import*as NG from"path";var F8=G.fnUntraced(function*($){let J=d1(R1($.filePath,$.filePath,$.diffOld,$.diffNew));return yield*LG($.ctx,$.filePath,{patterns:[NG.relative(B$.worktree,$.filePath)],diff:J}),yield*$.write,yield*$.format.file($.filePath),yield*$.bus.publish(w2.Event.Edited,{file:$.filePath}),yield*$.bus.publish(k2.Event.Updated,{file:$.filePath,event:$.event}),J});function AJ($){return $.replaceAll(`\r
7299
+ You attempted: ${J}.`)}}var _1=X.fn("Tool.assertExternalDirectory")(function*($,J,Z){if(!J)return;if(Z?.bypass)return;let Y=yield*i.context,K=process.platform==="win32"?$$.normalizePath(J):J;if(H$.containsPath(K,Y)){let j=$$.canonical(K);if(H$.containsPath(j,Y))return;throw Error("Access denied: path escapes project directory through a symlink")}let Q=m2.join(f$.Path.data,"memory");if($$.contains(Q,K)){let j=$$.canonical(K);if($$.contains(Q,j))return;throw Error("Access denied: path escapes memory directory through a symlink")}let W=(Z?.kind??"file")==="directory"?K:m2.dirname(K),_=process.platform==="win32"?$$.normalizePathPattern(m2.join(W,"*")):m2.join(W,"*").replaceAll("\\","/");yield*$.ask({permission:"external_directory",patterns:[_],always:[_],metadata:{filepath:K,parentDir:W}})});var u2=X.fn("Tool.assertWriteAllowed")(function*($,J,Z){if(yield*_1($,J,Z),!J)return;let Y=(()=>{try{return H$.current?.project?.id??U2.global}catch{return U2.global}})();kX({target:$$.canonical(J),agentName:$.agent,memoryRoot:m2.join(f$.Path.data,"memory"),projectID:Y,sessionID:$.sessionID,taskId:$.taskId})}),EX=X.fn("Tool.askEditUnlessMemory")(function*($,J,Z){let Y=process.platform==="win32"?$$.normalizePath(J):J;if($$.contains(m2.join(f$.Path.data,"memory"),Y))return;yield*$.ask({permission:"edit",patterns:Z.patterns,always:["*"],metadata:{filepath:J,diff:Z.diff,...Z.files!==void 0?{files:Z.files}:{}}})});import*as xX from"path";var F8=X.fnUntraced(function*($){let J=d1(w1($.filePath,$.filePath,$.diffOld,$.diffNew));return yield*EX($.ctx,$.filePath,{patterns:[xX.relative(H$.worktree,$.filePath)],diff:J}),yield*$.write,yield*$.format.file($.filePath),yield*$.bus.publish(R2.Event.Edited,{file:$.filePath}),yield*$.bus.publish(k2.Event.Updated,{file:$.filePath,event:$.event}),J});function AJ($){return $.replaceAll(`\r
7300
7300
  `,`
7301
- `)}function oF($){return $.includes(`\r
7301
+ `)}function $z($){return $.includes(`\r
7302
7302
  `)?`\r
7303
7303
  `:`
7304
- `}function yG($,J){if(J===`
7304
+ `}function bX($,J){if(J===`
7305
7305
  `)return $;return $.replaceAll(`
7306
7306
  `,`\r
7307
- `)}var TG=new Map;function rF($){let J=$$.resolve($),Z=TG.get(J);if(Z)return Z;let Y=bG.makeUnsafe(1);return TG.set(J,Y),Y}var T7=H$("edit",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("edit"))??"",J=yield*b0.Service,Z=yield*$$.Service,Y=yield*W1.Service,K=yield*P$.Service;return{description:$,parameters:ZG,execute:(Q,V)=>G.gen(function*(){if(!Q.filePath)throw Error("filePath is required");if(Q.oldString===Q.newString)throw Error("No changes to apply: oldString and newString are identical.");let X=SJ.isAbsolute(Q.filePath)?Q.filePath:SJ.join(t$.get(V.sessionID),Q.filePath);yield*u2(V,X);let W="",_="",j="";yield*rF(X).withPermits(1)(G.gen(function*(){if(Q.oldString===""){let L=yield*Z.existsSafe(X);j=Q.newString,W=yield*F8({ctx:V,filePath:X,diffOld:_,diffNew:j,write:Z.writeWithDirs(X,Q.newString),event:L?"change":"add",format:Y,bus:K});return}let I=yield*Z.stat(X).pipe(G.catch(()=>G.succeed(void 0)));if(!I)throw Error(`File ${X} not found`);if(I.type==="Directory")throw Error(`Path is a directory, not a file: ${X}`);_=yield*Z.readFileString(X);let C=oF(_),P=yG(AJ(Q.oldString),C),D=yG(AJ(Q.newString),C);j=Qz(_,P,D,Q.replaceAll),W=yield*F8({ctx:V,filePath:X,diffOld:AJ(_),diffNew:AJ(j),write:Z.writeWithDirs(X,j),event:"change",format:Y,bus:K}),j=yield*Z.readFileString(X),W=d1(R1(X,X,AJ(_),AJ(j)))}).pipe(G.orDie));let H={file:X,patch:W,additions:0,deletions:0};for(let I of z8(_,j)){if(I.added)H.additions+=I.count||0;if(I.removed)H.deletions+=I.count||0}yield*V.metadata({metadata:{diff:W,filediff:H,diagnostics:{}}});let q="Edit applied successfully.";yield*J.touchFile(X,!0);let U=yield*J.diagnostics(),z=$$.normalizePath(X),M=b0.Diagnostic.report(X,U[z]??[]);if(M)q+=`
7307
+ `)}var vX=new Map;function Jz($){let J=$$.resolve($),Z=vX.get(J);if(Z)return Z;let Y=mX.makeUnsafe(1);return vX.set(J,Y),Y}var E7=B$("edit",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("edit"))??"",J=yield*b0.Service,Z=yield*$$.Service,Y=yield*W1.Service,K=yield*P$.Service;return{description:$,parameters:VX,execute:(V,Q)=>X.gen(function*(){if(!V.filePath)throw Error("filePath is required");if(V.oldString===V.newString)throw Error("No changes to apply: oldString and newString are identical.");let G=SJ.isAbsolute(V.filePath)?V.filePath:SJ.join(t$.get(Q.sessionID),V.filePath);yield*u2(Q,G);let W="",_="",j="";yield*Jz(G).withPermits(1)(X.gen(function*(){if(V.oldString===""){let L=yield*Z.existsSafe(G);j=V.newString,W=yield*F8({ctx:Q,filePath:G,diffOld:_,diffNew:j,write:Z.writeWithDirs(G,V.newString),event:L?"change":"add",format:Y,bus:K});return}let D=yield*Z.stat(G).pipe(X.catch(()=>X.succeed(void 0)));if(!D)throw Error(`File ${G} not found`);if(D.type==="Directory")throw Error(`Path is a directory, not a file: ${G}`);_=yield*Z.readFileString(G);let M=$z(_),I=bX(AJ(V.oldString),M),P=bX(AJ(V.newString),M);j=Bz(_,I,P,V.replaceAll),W=yield*F8({ctx:Q,filePath:G,diffOld:AJ(_),diffNew:AJ(j),write:Z.writeWithDirs(G,j),event:"change",format:Y,bus:K}),j=yield*Z.readFileString(G),W=d1(w1(G,G,AJ(_),AJ(j)))}).pipe(X.orDie));let B={file:G,patch:W,additions:0,deletions:0};for(let D of z8(_,j)){if(D.added)B.additions+=D.count||0;if(D.removed)B.deletions+=D.count||0}yield*Q.metadata({metadata:{diff:W,filediff:B,diagnostics:{}}});let q="Edit applied successfully.";yield*J.touchFile(G,!0);let U=yield*J.diagnostics(),z=$$.normalizePath(G),C=b0.Diagnostic.report(G,U[z]??[]);if(C)q+=`
7308
7308
 
7309
7309
  LSP errors detected in this file, please fix:
7310
- ${M}`;return{metadata:{diagnostics:U,diff:W,filediff:H},title:`${SJ.relative(B$.worktree,X)}`,output:q}})}})),kG=0,iF=0.3;function sF($,J){if($===""||J==="")return Math.max($.length,J.length);if($.length<J.length)[$,J]=[J,$];let Z=Array(J.length+1),Y=Array(J.length+1);for(let K=0;K<=J.length;K++)Z[K]=K;for(let K=1;K<=$.length;K++){Y[0]=K;for(let Q=1;Q<=J.length;Q++){let V=$[K-1]===J[Q-1]?0:1;Y[Q]=Math.min(Z[Q]+1,Y[Q-1]+1,Z[Q-1]+V)}[Z,Y]=[Y,Z]}return Z[J.length]}var nF=function*($,J){yield J},aF=function*($,J){let Z=$.split(`
7310
+ ${C}`;return{metadata:{diagnostics:U,diff:W,filediff:B},title:`${SJ.relative(H$.worktree,G)}`,output:q}})}})),hX=0,Zz=0.3;function Yz($,J){if($===""||J==="")return Math.max($.length,J.length);if($.length<J.length)[$,J]=[J,$];let Z=Array(J.length+1),Y=Array(J.length+1);for(let K=0;K<=J.length;K++)Z[K]=K;for(let K=1;K<=$.length;K++){Y[0]=K;for(let V=1;V<=J.length;V++){let Q=$[K-1]===J[V-1]?0:1;Y[V]=Math.min(Z[V]+1,Y[V-1]+1,Z[V-1]+Q)}[Z,Y]=[Y,Z]}return Z[J.length]}var Kz=function*($,J){yield J},Vz=function*($,J){let Z=$.split(`
7311
7311
  `),Y=J.split(`
7312
- `);if(Y[Y.length-1]==="")Y.pop();for(let K=0;K<=Z.length-Y.length;K++){let Q=!0;for(let V=0;V<Y.length;V++){let X=Z[K+V].trim(),W=Y[V].trim();if(X!==W){Q=!1;break}}if(Q){let V=0;for(let W=0;W<K;W++)V+=Z[W].length+1;let X=V;for(let W=0;W<Y.length;W++)if(X+=Z[K+W].length,W<Y.length-1)X+=1;yield $.substring(V,X)}}};function EG($,J,Z,Y,K){let Q=J.length,V=Y-Z+1,X=0,W=Math.min(Q-2,V-2);if(W>0){for(let _=1;_<Q-1&&_<V-1;_++){let j=$[Z+_].trim(),H=J[_].trim(),q=Math.max(j.length,H.length);if(q===0)continue;let U=sF(j,H);if(K!==void 0){if(X+=(1-U/q)/W,X>=K)break}else X+=1-U/q}if(K===void 0)X/=W}else X=1;return X}function xG($,J,Z,Y){let K=0;for(let V=0;V<Z;V++)K+=J[V].length+1;let Q=K;for(let V=Z;V<=Y;V++)if(Q+=J[V].length,V<Y)Q+=1;return $.substring(K,Q)}var tF=function*($,J){let Z=$.split(`
7312
+ `);if(Y[Y.length-1]==="")Y.pop();for(let K=0;K<=Z.length-Y.length;K++){let V=!0;for(let Q=0;Q<Y.length;Q++){let G=Z[K+Q].trim(),W=Y[Q].trim();if(G!==W){V=!1;break}}if(V){let Q=0;for(let W=0;W<K;W++)Q+=Z[W].length+1;let G=Q;for(let W=0;W<Y.length;W++)if(G+=Z[K+W].length,W<Y.length-1)G+=1;yield $.substring(Q,G)}}};function gX($,J,Z,Y,K){let V=J.length,Q=Y-Z+1,G=0,W=Math.min(V-2,Q-2);if(W>0){for(let _=1;_<V-1&&_<Q-1;_++){let j=$[Z+_].trim(),B=J[_].trim(),q=Math.max(j.length,B.length);if(q===0)continue;let U=Yz(j,B);if(K!==void 0){if(G+=(1-U/q)/W,G>=K)break}else G+=1-U/q}if(K===void 0)G/=W}else G=1;return G}function fX($,J,Z,Y){let K=0;for(let Q=0;Q<Z;Q++)K+=J[Q].length+1;let V=K;for(let Q=Z;Q<=Y;Q++)if(V+=J[Q].length,Q<Y)V+=1;return $.substring(K,V)}var Qz=function*($,J){let Z=$.split(`
7313
7313
  `),Y=J.split(`
7314
- `);if(Y.length<3)return;if(Y[Y.length-1]==="")Y.pop();let K=Y[0].trim(),Q=Y[Y.length-1].trim(),V=Y.length,X=[];for(let j=0;j<Z.length;j++){if(Z[j].trim()!==K)continue;for(let H=j+2;H<Z.length;H++)if(Z[H].trim()===Q){X.push({startLine:j,endLine:H});break}}if(X.length===0)return;if(X.length===1){let{startLine:j,endLine:H}=X[0];if(EG(Z,Y,j,H,kG)>=kG)yield xG($,Z,j,H);return}let W=null,_=-1;for(let j of X){let H=EG(Z,Y,j.startLine,j.endLine);if(H>_)_=H,W=j}if(_>=iF&&W)yield xG($,Z,W.startLine,W.endLine)},eF=function*($,J){let Z=(V)=>V.replace(/\s+/g," ").trim(),Y=Z(J),K=$.split(`
7315
- `);for(let V=0;V<K.length;V++){let X=K[V];if(Z(X)===Y)yield X;else if(Z(X).includes(Y)){let _=J.trim().split(/\s+/);if(_.length>0){let j=_.map((H)=>H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("\\s+");try{let H=new RegExp(j),q=X.match(H);if(q)yield q[0]}catch{}}}}let Q=J.split(`
7316
- `);if(Q.length>1)for(let V=0;V<=K.length-Q.length;V++){let X=K.slice(V,V+Q.length);if(Z(X.join(`
7317
- `))===Y)yield X.join(`
7318
- `)}},$z=function*($,J){let Z=(V)=>{let X=V.split(`
7319
- `),W=X.filter((j)=>j.trim().length>0);if(W.length===0)return V;let _=Math.min(...W.map((j)=>{let H=j.match(/^(\s*)/);return H?H[1].length:0}));return X.map((j)=>j.trim().length===0?j:j.slice(_)).join(`
7314
+ `);if(Y.length<3)return;if(Y[Y.length-1]==="")Y.pop();let K=Y[0].trim(),V=Y[Y.length-1].trim(),Q=Y.length,G=[];for(let j=0;j<Z.length;j++){if(Z[j].trim()!==K)continue;for(let B=j+2;B<Z.length;B++)if(Z[B].trim()===V){G.push({startLine:j,endLine:B});break}}if(G.length===0)return;if(G.length===1){let{startLine:j,endLine:B}=G[0];if(gX(Z,Y,j,B,hX)>=hX)yield fX($,Z,j,B);return}let W=null,_=-1;for(let j of G){let B=gX(Z,Y,j.startLine,j.endLine);if(B>_)_=B,W=j}if(_>=Zz&&W)yield fX($,Z,W.startLine,W.endLine)},Xz=function*($,J){let Z=(Q)=>Q.replace(/\s+/g," ").trim(),Y=Z(J),K=$.split(`
7315
+ `);for(let Q=0;Q<K.length;Q++){let G=K[Q];if(Z(G)===Y)yield G;else if(Z(G).includes(Y)){let _=J.trim().split(/\s+/);if(_.length>0){let j=_.map((B)=>B.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("\\s+");try{let B=new RegExp(j),q=G.match(B);if(q)yield q[0]}catch{}}}}let V=J.split(`
7316
+ `);if(V.length>1)for(let Q=0;Q<=K.length-V.length;Q++){let G=K.slice(Q,Q+V.length);if(Z(G.join(`
7317
+ `))===Y)yield G.join(`
7318
+ `)}},Gz=function*($,J){let Z=(Q)=>{let G=Q.split(`
7319
+ `),W=G.filter((j)=>j.trim().length>0);if(W.length===0)return Q;let _=Math.min(...W.map((j)=>{let B=j.match(/^(\s*)/);return B?B[1].length:0}));return G.map((j)=>j.trim().length===0?j:j.slice(_)).join(`
7320
7320
  `)},Y=Z(J),K=$.split(`
7321
- `),Q=J.split(`
7322
- `);for(let V=0;V<=K.length-Q.length;V++){let X=K.slice(V,V+Q.length).join(`
7323
- `);if(Z(X)===Y)yield X}},Jz=function*($,J){let Z=(V)=>{return V.replace(/\\(n|t|r|'|"|`|\\|\n|\$)/g,(X,W)=>{switch(W){case"n":return`
7321
+ `),V=J.split(`
7322
+ `);for(let Q=0;Q<=K.length-V.length;Q++){let G=K.slice(Q,Q+V.length).join(`
7323
+ `);if(Z(G)===Y)yield G}},Wz=function*($,J){let Z=(Q)=>{return Q.replace(/\\(n|t|r|'|"|`|\\|\n|\$)/g,(G,W)=>{switch(W){case"n":return`
7324
7324
  `;case"t":return"\t";case"r":return"\r";case"'":return"'";case'"':return'"';case"`":return"`";case"\\":return"\\";case`
7325
7325
  `:return`
7326
- `;case"$":return"$";default:return X}})},Y=Z(J);if($.includes(Y))yield Y;let K=$.split(`
7327
- `),Q=Y.split(`
7328
- `);for(let V=0;V<=K.length-Q.length;V++){let X=K.slice(V,V+Q.length).join(`
7329
- `);if(Z(X)===Y)yield X}},Zz=function*($,J){let Z=0;while(!0){let Y=$.indexOf(J,Z);if(Y===-1)break;yield J,Z=Y+J.length}},Yz=function*($,J){let Z=J.trim();if(Z===J)return;if($.includes(Z))yield Z;let Y=$.split(`
7326
+ `;case"$":return"$";default:return G}})},Y=Z(J);if($.includes(Y))yield Y;let K=$.split(`
7327
+ `),V=Y.split(`
7328
+ `);for(let Q=0;Q<=K.length-V.length;Q++){let G=K.slice(Q,Q+V.length).join(`
7329
+ `);if(Z(G)===Y)yield G}},jz=function*($,J){let Z=0;while(!0){let Y=$.indexOf(J,Z);if(Y===-1)break;yield J,Z=Y+J.length}},Uz=function*($,J){let Z=J.trim();if(Z===J)return;if($.includes(Z))yield Z;let Y=$.split(`
7330
7330
  `),K=J.split(`
7331
- `);for(let Q=0;Q<=Y.length-K.length;Q++){let V=Y.slice(Q,Q+K.length).join(`
7332
- `);if(V.trim()===Z)yield V}},Kz=function*($,J){let Z=J.split(`
7331
+ `);for(let V=0;V<=Y.length-K.length;V++){let Q=Y.slice(V,V+K.length).join(`
7332
+ `);if(Q.trim()===Z)yield Q}},Hz=function*($,J){let Z=J.split(`
7333
7333
  `);if(Z.length<3)return;if(Z[Z.length-1]==="")Z.pop();let Y=$.split(`
7334
- `),K=Z[0].trim(),Q=Z[Z.length-1].trim();for(let V=0;V<Y.length;V++){if(Y[V].trim()!==K)continue;for(let X=V+2;X<Y.length;X++)if(Y[X].trim()===Q){let W=Y.slice(V,X+1),_=W.join(`
7335
- `);if(W.length===Z.length){let j=0,H=0;for(let q=1;q<W.length-1;q++){let U=W[q].trim(),z=Z[q].trim();if(U.length>0||z.length>0){if(H++,U===z)j++}}if(H===0||j/H>=0.5){yield _;break}}break}}};function d1($){let J=$.split(`
7336
- `),Z=J.filter((Q)=>(Q.startsWith("+")||Q.startsWith("-")||Q.startsWith(" "))&&!Q.startsWith("---")&&!Q.startsWith("+++"));if(Z.length===0)return $;let Y=1/0;for(let Q of Z){let V=Q.slice(1);if(V.trim().length>0){let X=V.match(/^(\s*)/);if(X)Y=Math.min(Y,X[1].length)}}if(Y===1/0||Y===0)return $;return J.map((Q)=>{if((Q.startsWith("+")||Q.startsWith("-")||Q.startsWith(" "))&&!Q.startsWith("---")&&!Q.startsWith("+++")){let V=Q[0],X=Q.slice(1);return V+X.slice(Y)}return Q}).join(`
7337
- `)}function Qz($,J,Z,Y=!1){if(J===Z)throw Error("No changes to apply: oldString and newString are identical.");let K=!0;for(let Q of[nF,aF,tF,eF,$z,Jz,Yz,Kz,Zz])for(let V of Q($,J)){let X=$.indexOf(V);if(X===-1)continue;if(K=!1,Y)return $.replaceAll(V,Z);let W=$.lastIndexOf(V);if(X!==W)continue;return $.substring(0,X)+Z+$.substring(X+V.length)}if(K)throw Error("Could not find oldString in the file. It must match exactly, including whitespace, indentation, and line endings.");throw Error("Found multiple matches for oldString. Provide more surrounding context to make the match unique.")}import OZ from"path";var hG=H$("glob",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("glob"))??"",J=yield*h0.Service,Z=yield*$$.Service;return{description:$,parameters:$G,execute:(Y,K)=>G.gen(function*(){let Q=yield*i.context;yield*K.ask({permission:"glob",patterns:[Y.pattern],always:["*"],metadata:{pattern:Y.pattern,path:Y.path}});let V=Y.path??t$.get(K.sessionID);if(V=OZ.isAbsolute(V)?V:OZ.resolve(t$.get(K.sessionID),V),(yield*Z.stat(V).pipe(G.catch(()=>G.succeed(void 0))))?.type==="File")throw Error(`glob path must be a directory: ${V}`);yield*_1(K,V,{kind:"directory"});let W=100,_=!1,j=yield*J.files({cwd:V,glob:[Y.pattern],signal:K.abort}).pipe(vG((q)=>G.gen(function*(){let U=OZ.resolve(V,q),M=(yield*Z.stat(U).pipe(G.catch(()=>G.succeed(void 0))))?.mtime.pipe(p1.map((I)=>I.getTime()),p1.getOrElse(()=>0))??0;return{path:U,mtime:M}})),qZ(W+1),BJ,G.map((q)=>[...q]));if(j.length>W)_=!0,j.length=W;j.sort((q,U)=>U.mtime-q.mtime);let H=[];if(j.length===0)H.push("No files found");if(j.length>0){if(H.push(...j.map((q)=>q.path)),_)H.push(""),H.push(`(Results are truncated: showing first ${W} results. Consider using a more specific path or pattern.)`)}return{title:OZ.relative(Q.worktree,V),metadata:{count:j.length,truncated:_},output:H.join(`
7338
- `)}}).pipe(G.orDie)}}));import wJ from"path";var gG=2000,fG=H$("grep",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("grep"))??"",J=yield*$$.Service,Z=yield*h0.Service;return{description:$,parameters:JG,execute:(Y,K)=>G.gen(function*(){let Q={title:Y.pattern,metadata:{matches:0,truncated:!1},output:"No files found"};if(!Y.pattern)throw Error("pattern is required");yield*K.ask({permission:"grep",patterns:[Y.pattern],always:["*"],metadata:{pattern:Y.pattern,path:Y.path,include:Y.include}});let V=t$.get(K.sessionID),X=wJ.isAbsolute(Y.path??V)?Y.path??V:wJ.join(V,Y.path??"."),W=$$.resolve(X),_=yield*J.stat(W).pipe(G.catch(()=>G.succeed(void 0))),j=_?.type==="Directory"?W:wJ.dirname(W),H=_?.type==="Directory"?void 0:[wJ.relative(j,W)];yield*_1(K,X,{kind:_?.type==="Directory"?"directory":"file"});let q=yield*Z.search({cwd:j,pattern:Y.pattern,glob:Y.include?[Y.include]:void 0,file:H,signal:K.abort});if(q.items.length===0)return Q;let U=q.items.map((N)=>({path:$$.resolve(wJ.isAbsolute(N.path.text)?N.path.text:wJ.join(j,N.path.text)),line:N.line_number,text:N.lines.text})),z=new Map((yield*G.forEach([...new Set(U.map((N)=>N.path))],G.fnUntraced(function*(N){let x=yield*J.stat(N).pipe(G.catch(()=>G.succeed(void 0)));if(!x||x.type==="Directory")return;return[N,x.mtime.pipe(p1.map((b)=>b.getTime()),p1.getOrElse(()=>0))??0]}),{concurrency:16})).filter((N)=>Boolean(N))),M=U.flatMap((N)=>{let x=z.get(N.path);if(x===void 0)return[];return[{...N,mtime:x}]});M.sort((N,x)=>x.mtime-N.mtime);let I=100,C=M.length>I,P=C?M.slice(0,I):M;if(P.length===0)return Q;let D=M.length,L=[`Found ${D} matches${C?` (showing first ${I})`:""}`],R="";for(let N of P){if(R!==N.path){if(R!=="")L.push("");R=N.path,L.push(`${N.path}:`)}let x=N.text.length>gG?N.text.substring(0,gG)+"...":N.text;L.push(` Line ${N.line}: ${x}`)}if(C)L.push(""),L.push(`(Results truncated: showing ${I} of ${D} matches (${D-I} hidden). Consider using a more specific path or pattern.)`);if(q.partial)L.push(""),L.push("(Some paths were inaccessible and skipped)");return{title:Y.pattern,metadata:{matches:D,truncated:C},output:L.join(`
7339
- `)}}).pipe(G.orDie)}}));var Vz=20480,mG=H$("history",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("history"))??"",J=yield*MJ.Service,Z=yield*Z1,Y=yield*c0.Service;return{description:$,parameters:OG,execute:(K,Q)=>G.gen(function*(){if(K.operation==="search"){if(!K.query)return{title:"History search: missing query",output:"operation=search requires a `query` argument.",metadata:{count:0,incomplete:!1}};let{hits:H,incomplete:q}=yield*J.search({query:K.query,scope:K.scope,session_id:K.session_id,kind:K.kind,tool_name:K.tool_name,time_after:K.time_after,time_before:K.time_before,limit:K.limit}),U=q?"NOTE: Results may be incomplete \u2014 the filters were too selective for the search's safety cap, so real matches may have been missed. Narrow the query (add rarer/more distinctive terms) or loosen the filters and retry.":"";if(H.length===0)return{title:"History search: 0 matches",output:[`0 matches for "${K.query}". Try memory search if you haven't, or broaden the query.`,...U?["",U]:[]].join(`
7340
- `),metadata:{count:0,incomplete:q}};let z=[`Found ${H.length} match${H.length===1?"":"es"}:`,""];if(U)z.splice(1,0,U);for(let M of H){let I=M.tool_name?`${M.kind} \xB7 ${M.tool_name}`:M.kind;z.push(`### ${M.session_id} ${M.message_id} (${I})`),z.push(`Time: ${new Date(M.time_created).toISOString()}, Score: ${M.score.toFixed(3)}`),z.push(M.snippet),z.push("")}return{title:`History search: ${H.length} match${H.length===1?"":"es"}${q?" (may be incomplete)":""}`,output:z.join(`
7341
- `),metadata:{count:H.length,incomplete:q}}}if(!K.message_id)return{title:"History around: missing message_id",output:"operation=around requires a `message_id` argument.",metadata:{count:0,incomplete:!1}};let V=yield*J.around({message_id:K.message_id,before:K.before,after:K.after});if(V.messages.length===0)return{title:"History around: anchor not found",output:`No message with id ${K.message_id}.`,metadata:{count:0,incomplete:!1}};let X=[`Session ${V.session_id}, ${V.messages.length} messages (anchor ${K.message_id}):`,""];for(let H of V.messages){let q=H.matched?">>>":"---";X.push(`${q} ${H.message_id} (${new Date(H.time_created).toISOString()})`);for(let U of H.parts){let z=U.tool_name?`${U.type} (${U.tool_name})`:U.type;X.push(` ${U.role} \xB7 ${z}:`),X.push(U.text.split(`
7342
- `).map((M)=>` ${M}`).join(`
7343
- `))}X.push("")}let W=X.join(`
7344
- `),_=yield*Y.get(Q.agent),j=yield*Z.output(W,{maxBytes:Vz},_);return{title:`History around ${K.message_id}`,output:j.content,metadata:{count:V.messages.length,incomplete:!1,truncated:j.truncated,...j.truncated&&{outputPath:j.outputPath}}}})}}));var uG=H$("memory",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("memory"))??"",J=yield*g1.Service;return{description:$,parameters:_G,execute:(Z)=>G.gen(function*(){let{results:Y,incomplete:K}=yield*J.search({query:Z.query,scope:Z.scope,scope_id:Z.scope_id,type:Z.type,limit:Z.limit}),Q=K?"NOTE: Results may be incomplete \u2014 the scope/type filters were too selective for the search's safety cap, so real matches may have been missed. Use rarer/more distinctive terms or loosen the filters and retry.":"";if(Y.length===0)return{title:"Memory search: 0 results",output:[`No matches for "${Z.query}".`,...Q?["",Q]:[],"","0 results does NOT mean it was never recorded. Escalate before giving up:","1. Retry with FEWER / more distinctive terms \u2014 queries are OR-joined and"," ranked, so 1-2 rare words (an exact ID, function name, flag) beat a long",' descriptive phrase. Drop generic words ("config", "params", "database").',"2. For a LITERAL string the tokenizer splits (URLs like postgres://\u2026, ports"," like 5433, paths) \u2014 Grep the memory dir directly; FTS can't see it.","3. For VERBATIM recall of something a summary may have glossed over (exact"," command, the user's precise wording) \u2014 use the history tool (raw"," conversation), which keeps original messages.","Widen scope progressively: session \u2192 project \u2192 global \u2192 history."].join(`
7345
- `),metadata:{count:0,incomplete:K}};let V=[`Found ${Y.length} match${Y.length===1?"":"es"} (BM25-ranked, best first).`,...Q?[Q]:[],"A hit here is authoritative \u2014 use it even if a parallel/sibling query returned nothing.","If you need the FULL body (snippets are truncated), Read the path.","If you need an EXACT literal (a connection string, port, token, full command line, path) and the snippet/body only paraphrases or partially shows it, the curated memory may have dropped the precise form \u2014 query the history tool for the original message, which holds it verbatim.",""];for(let X of Y)V.push(`### ${X.path}`),V.push(`Scope: ${X.scope}${X.scope_id?`/${X.scope_id}`:""}, Type: ${X.type}, Score: ${X.score.toFixed(3)}`),V.push(X.snippet),V.push("");return{title:`Memory search: ${Y.length} result${Y.length===1?"":"s"}${K?" (may be incomplete)":""}`,output:V.join(`
7346
- `),metadata:{count:Y.length,incomplete:K}}})}}));import{createReadStream as rG}from"fs";import*as v0 from"path";var d2={};o$(d2,{loaded:()=>Uz,layer:()=>cG,display:()=>Bz,defaultLayer:()=>jz,Service:()=>FZ,Instruction:()=>d2});import k7 from"os";import p$ from"path";var Gz=O$.create({service:"instruction"}),dG=["AGENTS.md",...k$.QITQODE_DISABLE_CLAUDE_CODE_PROMPT?[]:["CLAUDE.md"],"CONTEXT.md"],Xz=500;function Wz(){let $=[];if(k$.QITQODE_CONFIG_DIR)$.push(p$.join(k$.QITQODE_CONFIG_DIR,"AGENTS.md"));if($.push(p$.join(f$.Path.config,"AGENTS.md")),!k$.QITQODE_DISABLE_CLAUDE_CODE_PROMPT)$.push(p$.join(k7.homedir(),".claude","CLAUDE.md"));return $}function pG($){let J=new Set;for(let Z of $)for(let Y of Z.parts)if(Y.type==="tool"&&Y.tool==="read"&&Y.state.status==="completed"){if(Y.state.time.compacted)continue;let K=Y.state.metadata?.loaded;if(!K||!Array.isArray(K))continue;for(let Q of K)if(typeof Q==="string")J.add(Q)}return J}class FZ extends D$.Service()("@qitqode/Instruction"){}var cG=f.effect(FZ,G.gen(function*(){let $=yield*R$.Service,J=yield*$$.Service,Z=v1.filterStatusOk(f9(yield*v1.HttpClient)),Y=yield*i.make(G.fn("Instruction.state")(()=>G.succeed({claims:new Map}))),K=G.fnUntraced(function*(q){let U=yield*i.context;if(!k$.QITQODE_DISABLE_PROJECT_CONFIG)return yield*J.globUp(q,U.directory,U.worktree).pipe(G.catch(()=>G.succeed([])));if(!k$.QITQODE_CONFIG_DIR)return Gz.warn(`Skipping relative instruction "${q}" - no QITQODE_CONFIG_DIR set while project config is disabled`),[];return yield*J.globUp(q,k$.QITQODE_CONFIG_DIR,k$.QITQODE_CONFIG_DIR).pipe(G.catch(()=>G.succeed([])))}),Q=G.fnUntraced(function*(q){return yield*J.readFileString(q).pipe(G.catch(()=>G.succeed("")))}),V=G.fnUntraced(function*(q){let U=yield*Z.execute(G2.get(q)).pipe(G.timeout(5000),G.catch(()=>G.succeed(null)));if(!U)return"";let z=yield*U.arrayBuffer.pipe(G.catch(()=>G.succeed(new ArrayBuffer(0))));return new TextDecoder().decode(z)}),X=G.fn("Instruction.clear")(function*(q){(yield*i.get(Y)).claims.delete(q)}),W=G.fn("Instruction.systemPaths")(function*(){let q=yield*$.get(),U=yield*i.context,z=new Set;if(!k$.QITQODE_DISABLE_PROJECT_CONFIG){let M=yield*J.findUp("AGENTS.md",U.directory,U.worktree);if(M.length>0){if(M.forEach((I)=>z.add(p$.resolve(I))),!k$.QITQODE_DISABLE_CLAUDE_CODE_PROMPT){if((yield*G.forEach(M,Q,{concurrency:8})).join("").trim().length<Xz)(yield*J.findUp("CLAUDE.md",U.directory,U.worktree)).forEach((P)=>z.add(p$.resolve(P)))}}else for(let I of dG){if(I==="AGENTS.md")continue;let C=yield*J.findUp(I,U.directory,U.worktree);if(C.length>0){C.forEach((P)=>z.add(p$.resolve(P)));break}}}for(let M of Wz())if(yield*J.existsSafe(M)){z.add(p$.resolve(M));break}if(q.instructions)for(let M of q.instructions){if(M.startsWith("https://")||M.startsWith("http://"))continue;let I=M.startsWith("~/")?p$.join(k7.homedir(),M.slice(2)):M;(yield*(p$.isAbsolute(I)?J.glob(p$.basename(I),{cwd:p$.dirname(I),absolute:!0,include:"file"}):K(I)).pipe(G.catch(()=>G.succeed([])))).forEach((P)=>z.add(p$.resolve(P)))}return z}),_=G.fn("Instruction.system")(function*(){let q=yield*$.get(),U=yield*W(),z=(q.instructions??[]).filter((C)=>C.startsWith("https://")||C.startsWith("http://")),M=yield*G.forEach(Array.from(U),Q,{concurrency:8}),I=yield*G.forEach(z,V,{concurrency:4});return{paths:U,content:[...Array.from(U).flatMap((C,P)=>M[P]?[`Instructions from: ${C}
7347
- ${M[P]}`]:[]),...z.flatMap((C,P)=>I[P]?[`Instructions from: ${C}
7348
- ${I[P]}`]:[])]}}),j=G.fn("Instruction.find")(function*(q){for(let U of dG){let z=p$.resolve(p$.join(q,U));if(yield*J.existsSafe(z))return z}}),H=G.fn("Instruction.resolve")(function*(q,U,z){let M=yield*W(),I=pG(q),C=[],P=yield*i.get(Y),D=p$.resolve(yield*i.directory),L=p$.resolve(U),R=p$.dirname(L);while(R!==D){let N=p$.relative(D,R);if(N===".."||N.startsWith(`..${p$.sep}`)||p$.isAbsolute(N))break;let x=yield*j(R);if(!x||x===L||M.has(x)||I.has(x)){R=p$.dirname(R);continue}let b=P.claims.get(z);if(!b)b=new Set,P.claims.set(z,b);if(b.has(x)){R=p$.dirname(R);continue}b.add(x);let v=yield*Q(x);if(v)C.push({filepath:x,content:`Instructions from: ${x}
7349
- ${v}`});R=p$.dirname(R)}return C});return FZ.of({clear:X,systemPaths:W,system:_,find:j,resolve:H})})),jz=cG.pipe(f.provide(R$.defaultLayer),f.provide($$.defaultLayer),f.provide(X2.layer));function Uz($){return pG($)}function Bz($,J){let Z=p$.relative(J,$);if(Z&&Z!==".."&&!Z.startsWith(`..${p$.sep}`)&&!p$.isAbsolute(Z))return Z;let Y=k7.homedir();if($===Y||$.startsWith(Y+p$.sep))return p$.join("~",p$.relative(Y,$));return $}var lG=2000,E7=2000,Hz=`... (line truncated to ${E7} chars)`,_z=`${u1/1024} KB`,Oz=4096,qz=393216,iG=H$("read",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("read"))??"",J=yield*$$.Service,Z=yield*d2.Service,Y=yield*b0.Service,K=yield*UJ.Scope,Q=G.fn("ReadTool.miss")(function*(H){let q=v0.dirname(H),U=v0.basename(H),z=yield*J.readDirectory(q).pipe(G.map((M)=>M.filter((I)=>I.toLowerCase().includes(U.toLowerCase())||U.toLowerCase().includes(I.toLowerCase())).map((I)=>v0.join(q,I)).slice(0,3)),G.catch(()=>G.succeed([])));if(z.length>0)return yield*G.fail(Error(`File not found: ${H}
7334
+ `),K=Z[0].trim(),V=Z[Z.length-1].trim();for(let Q=0;Q<Y.length;Q++){if(Y[Q].trim()!==K)continue;for(let G=Q+2;G<Y.length;G++)if(Y[G].trim()===V){let W=Y.slice(Q,G+1),_=W.join(`
7335
+ `);if(W.length===Z.length){let j=0,B=0;for(let q=1;q<W.length-1;q++){let U=W[q].trim(),z=Z[q].trim();if(U.length>0||z.length>0){if(B++,U===z)j++}}if(B===0||j/B>=0.5){yield _;break}}break}}};function d1($){let J=$.split(`
7336
+ `),Z=J.filter((V)=>(V.startsWith("+")||V.startsWith("-")||V.startsWith(" "))&&!V.startsWith("---")&&!V.startsWith("+++"));if(Z.length===0)return $;let Y=1/0;for(let V of Z){let Q=V.slice(1);if(Q.trim().length>0){let G=Q.match(/^(\s*)/);if(G)Y=Math.min(Y,G[1].length)}}if(Y===1/0||Y===0)return $;return J.map((V)=>{if((V.startsWith("+")||V.startsWith("-")||V.startsWith(" "))&&!V.startsWith("---")&&!V.startsWith("+++")){let Q=V[0],G=V.slice(1);return Q+G.slice(Y)}return V}).join(`
7337
+ `)}function Bz($,J,Z,Y=!1){if(J===Z)throw Error("No changes to apply: oldString and newString are identical.");let K=!0;for(let V of[Kz,Vz,Qz,Xz,Gz,Wz,Uz,Hz,jz])for(let Q of V($,J)){let G=$.indexOf(Q);if(G===-1)continue;if(K=!1,Y)return $.replaceAll(Q,Z);let W=$.lastIndexOf(Q);if(G!==W)continue;return $.substring(0,G)+Z+$.substring(G+Q.length)}if(K)throw Error("Could not find oldString in the file. It must match exactly, including whitespace, indentation, and line endings.");throw Error("Found multiple matches for oldString. Provide more surrounding context to make the match unique.")}import OZ from"path";var dX=B$("glob",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("glob"))??"",J=yield*h0.Service,Z=yield*$$.Service;return{description:$,parameters:YX,execute:(Y,K)=>X.gen(function*(){let V=yield*i.context;yield*K.ask({permission:"glob",patterns:[Y.pattern],always:["*"],metadata:{pattern:Y.pattern,path:Y.path}});let Q=Y.path??t$.get(K.sessionID);if(Q=OZ.isAbsolute(Q)?Q:OZ.resolve(t$.get(K.sessionID),Q),(yield*Z.stat(Q).pipe(X.catch(()=>X.succeed(void 0))))?.type==="File")throw Error(`glob path must be a directory: ${Q}`);yield*_1(K,Q,{kind:"directory"});let W=100,_=!1,j=yield*J.files({cwd:Q,glob:[Y.pattern],signal:K.abort}).pipe(uX((q)=>X.gen(function*(){let U=OZ.resolve(Q,q),C=(yield*Z.stat(U).pipe(X.catch(()=>X.succeed(void 0))))?.mtime.pipe(p1.map((D)=>D.getTime()),p1.getOrElse(()=>0))??0;return{path:U,mtime:C}})),qZ(W+1),HJ,X.map((q)=>[...q]));if(j.length>W)_=!0,j.length=W;j.sort((q,U)=>U.mtime-q.mtime);let B=[];if(j.length===0)B.push("No files found");if(j.length>0){if(B.push(...j.map((q)=>q.path)),_)B.push(""),B.push(`(Results are truncated: showing first ${W} results. Consider using a more specific path or pattern.)`)}return{title:OZ.relative(V.worktree,Q),metadata:{count:j.length,truncated:_},output:B.join(`
7338
+ `)}}).pipe(X.orDie)}}));import RJ from"path";var pX=2000,cX=B$("grep",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("grep"))??"",J=yield*$$.Service,Z=yield*h0.Service;return{description:$,parameters:KX,execute:(Y,K)=>X.gen(function*(){let V={title:Y.pattern,metadata:{matches:0,truncated:!1},output:"No files found"};if(!Y.pattern)throw Error("pattern is required");yield*K.ask({permission:"grep",patterns:[Y.pattern],always:["*"],metadata:{pattern:Y.pattern,path:Y.path,include:Y.include}});let Q=t$.get(K.sessionID),G=RJ.isAbsolute(Y.path??Q)?Y.path??Q:RJ.join(Q,Y.path??"."),W=$$.resolve(G),_=yield*J.stat(W).pipe(X.catch(()=>X.succeed(void 0))),j=_?.type==="Directory"?W:RJ.dirname(W),B=_?.type==="Directory"?void 0:[RJ.relative(j,W)];yield*_1(K,G,{kind:_?.type==="Directory"?"directory":"file"});let q=yield*Z.search({cwd:j,pattern:Y.pattern,glob:Y.include?[Y.include]:void 0,file:B,signal:K.abort});if(q.items.length===0)return V;let U=q.items.map((N)=>({path:$$.resolve(RJ.isAbsolute(N.path.text)?N.path.text:RJ.join(j,N.path.text)),line:N.line_number,text:N.lines.text})),z=new Map((yield*X.forEach([...new Set(U.map((N)=>N.path))],X.fnUntraced(function*(N){let x=yield*J.stat(N).pipe(X.catch(()=>X.succeed(void 0)));if(!x||x.type==="Directory")return;return[N,x.mtime.pipe(p1.map((b)=>b.getTime()),p1.getOrElse(()=>0))??0]}),{concurrency:16})).filter((N)=>Boolean(N))),C=U.flatMap((N)=>{let x=z.get(N.path);if(x===void 0)return[];return[{...N,mtime:x}]});C.sort((N,x)=>x.mtime-N.mtime);let D=100,M=C.length>D,I=M?C.slice(0,D):C;if(I.length===0)return V;let P=C.length,L=[`Found ${P} matches${M?` (showing first ${D})`:""}`],w="";for(let N of I){if(w!==N.path){if(w!=="")L.push("");w=N.path,L.push(`${N.path}:`)}let x=N.text.length>pX?N.text.substring(0,pX)+"...":N.text;L.push(` Line ${N.line}: ${x}`)}if(M)L.push(""),L.push(`(Results truncated: showing ${D} of ${P} matches (${P-D} hidden). Consider using a more specific path or pattern.)`);if(q.partial)L.push(""),L.push("(Some paths were inaccessible and skipped)");return{title:Y.pattern,metadata:{matches:P,truncated:M},output:L.join(`
7339
+ `)}}).pipe(X.orDie)}}));var _z=20480,lX=B$("history",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("history"))??"",J=yield*CJ.Service,Z=yield*Z1,Y=yield*c0.Service;return{description:$,parameters:zX,execute:(K,V)=>X.gen(function*(){if(K.operation==="search"){if(!K.query)return{title:"History search: missing query",output:"operation=search requires a `query` argument.",metadata:{count:0,incomplete:!1}};let{hits:B,incomplete:q}=yield*J.search({query:K.query,scope:K.scope,session_id:K.session_id,kind:K.kind,tool_name:K.tool_name,time_after:K.time_after,time_before:K.time_before,limit:K.limit}),U=q?"NOTE: Results may be incomplete \u2014 the filters were too selective for the search's safety cap, so real matches may have been missed. Narrow the query (add rarer/more distinctive terms) or loosen the filters and retry.":"";if(B.length===0)return{title:"History search: 0 matches",output:[`0 matches for "${K.query}". Try memory search if you haven't, or broaden the query.`,...U?["",U]:[]].join(`
7340
+ `),metadata:{count:0,incomplete:q}};let z=[`Found ${B.length} match${B.length===1?"":"es"}:`,""];if(U)z.splice(1,0,U);for(let C of B){let D=C.tool_name?`${C.kind} \xB7 ${C.tool_name}`:C.kind;z.push(`### ${C.session_id} ${C.message_id} (${D})`),z.push(`Time: ${new Date(C.time_created).toISOString()}, Score: ${C.score.toFixed(3)}`),z.push(C.snippet),z.push("")}return{title:`History search: ${B.length} match${B.length===1?"":"es"}${q?" (may be incomplete)":""}`,output:z.join(`
7341
+ `),metadata:{count:B.length,incomplete:q}}}if(!K.message_id)return{title:"History around: missing message_id",output:"operation=around requires a `message_id` argument.",metadata:{count:0,incomplete:!1}};let Q=yield*J.around({message_id:K.message_id,before:K.before,after:K.after});if(Q.messages.length===0)return{title:"History around: anchor not found",output:`No message with id ${K.message_id}.`,metadata:{count:0,incomplete:!1}};let G=[`Session ${Q.session_id}, ${Q.messages.length} messages (anchor ${K.message_id}):`,""];for(let B of Q.messages){let q=B.matched?">>>":"---";G.push(`${q} ${B.message_id} (${new Date(B.time_created).toISOString()})`);for(let U of B.parts){let z=U.tool_name?`${U.type} (${U.tool_name})`:U.type;G.push(` ${U.role} \xB7 ${z}:`),G.push(U.text.split(`
7342
+ `).map((C)=>` ${C}`).join(`
7343
+ `))}G.push("")}let W=G.join(`
7344
+ `),_=yield*Y.get(V.agent),j=yield*Z.output(W,{maxBytes:_z},_);return{title:`History around ${K.message_id}`,output:j.content,metadata:{count:Q.messages.length,incomplete:!1,truncated:j.truncated,...j.truncated&&{outputPath:j.outputPath}}}})}}));var oX=B$("memory",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("memory"))??"",J=yield*g1.Service;return{description:$,parameters:FX,execute:(Z)=>X.gen(function*(){let{results:Y,incomplete:K}=yield*J.search({query:Z.query,scope:Z.scope,scope_id:Z.scope_id,type:Z.type,limit:Z.limit}),V=K?"NOTE: Results may be incomplete \u2014 the scope/type filters were too selective for the search's safety cap, so real matches may have been missed. Use rarer/more distinctive terms or loosen the filters and retry.":"";if(Y.length===0)return{title:"Memory search: 0 results",output:[`No matches for "${Z.query}".`,...V?["",V]:[],"","0 results does NOT mean it was never recorded. Escalate before giving up:","1. Retry with FEWER / more distinctive terms \u2014 queries are OR-joined and"," ranked, so 1-2 rare words (an exact ID, function name, flag) beat a long",' descriptive phrase. Drop generic words ("config", "params", "database").',"2. For a LITERAL string the tokenizer splits (URLs like postgres://\u2026, ports"," like 5433, paths) \u2014 Grep the memory dir directly; FTS can't see it.","3. For VERBATIM recall of something a summary may have glossed over (exact"," command, the user's precise wording) \u2014 use the history tool (raw"," conversation), which keeps original messages.","Widen scope progressively: session \u2192 project \u2192 global \u2192 history."].join(`
7345
+ `),metadata:{count:0,incomplete:K}};let Q=[`Found ${Y.length} match${Y.length===1?"":"es"} (BM25-ranked, best first).`,...V?[V]:[],"A hit here is authoritative \u2014 use it even if a parallel/sibling query returned nothing.","If you need the FULL body (snippets are truncated), Read the path.","If you need an EXACT literal (a connection string, port, token, full command line, path) and the snippet/body only paraphrases or partially shows it, the curated memory may have dropped the precise form \u2014 query the history tool for the original message, which holds it verbatim.",""];for(let G of Y)Q.push(`### ${G.path}`),Q.push(`Scope: ${G.scope}${G.scope_id?`/${G.scope_id}`:""}, Type: ${G.type}, Score: ${G.score.toFixed(3)}`),Q.push(G.snippet),Q.push("");return{title:`Memory search: ${Y.length} result${Y.length===1?"":"s"}${K?" (may be incomplete)":""}`,output:Q.join(`
7346
+ `),metadata:{count:Y.length,incomplete:K}}})}}));import{createReadStream as tX}from"fs";import*as v0 from"path";var d2={};o$(d2,{loaded:()=>Mz,layer:()=>sX,display:()=>Cz,defaultLayer:()=>zz,Service:()=>FZ,Instruction:()=>d2});import x7 from"os";import p$ from"path";var Oz=O$.create({service:"instruction"}),rX=["AGENTS.md",...k$.QITQODE_DISABLE_CLAUDE_CODE_PROMPT?[]:["CLAUDE.md"],"CONTEXT.md"],qz=500;function Fz(){let $=[];if(k$.QITQODE_CONFIG_DIR)$.push(p$.join(k$.QITQODE_CONFIG_DIR,"AGENTS.md"));if($.push(p$.join(f$.Path.config,"AGENTS.md")),!k$.QITQODE_DISABLE_CLAUDE_CODE_PROMPT)$.push(p$.join(x7.homedir(),".claude","CLAUDE.md"));return $}function iX($){let J=new Set;for(let Z of $)for(let Y of Z.parts)if(Y.type==="tool"&&Y.tool==="read"&&Y.state.status==="completed"){if(Y.state.time.compacted)continue;let K=Y.state.metadata?.loaded;if(!K||!Array.isArray(K))continue;for(let V of K)if(typeof V==="string")J.add(V)}return J}class FZ extends D$.Service()("@qitqode/Instruction"){}var sX=f.effect(FZ,X.gen(function*(){let $=yield*w$.Service,J=yield*$$.Service,Z=v1.filterStatusOk(f9(yield*v1.HttpClient)),Y=yield*i.make(X.fn("Instruction.state")(()=>X.succeed({claims:new Map}))),K=X.fnUntraced(function*(q){let U=yield*i.context;if(!k$.QITQODE_DISABLE_PROJECT_CONFIG)return yield*J.globUp(q,U.directory,U.worktree).pipe(X.catch(()=>X.succeed([])));if(!k$.QITQODE_CONFIG_DIR)return Oz.warn(`Skipping relative instruction "${q}" - no QITQODE_CONFIG_DIR set while project config is disabled`),[];return yield*J.globUp(q,k$.QITQODE_CONFIG_DIR,k$.QITQODE_CONFIG_DIR).pipe(X.catch(()=>X.succeed([])))}),V=X.fnUntraced(function*(q){return yield*J.readFileString(q).pipe(X.catch(()=>X.succeed("")))}),Q=X.fnUntraced(function*(q){let U=yield*Z.execute(X2.get(q)).pipe(X.timeout(5000),X.catch(()=>X.succeed(null)));if(!U)return"";let z=yield*U.arrayBuffer.pipe(X.catch(()=>X.succeed(new ArrayBuffer(0))));return new TextDecoder().decode(z)}),G=X.fn("Instruction.clear")(function*(q){(yield*i.get(Y)).claims.delete(q)}),W=X.fn("Instruction.systemPaths")(function*(){let q=yield*$.get(),U=yield*i.context,z=new Set;if(!k$.QITQODE_DISABLE_PROJECT_CONFIG){let C=yield*J.findUp("AGENTS.md",U.directory,U.worktree);if(C.length>0){if(C.forEach((D)=>z.add(p$.resolve(D))),!k$.QITQODE_DISABLE_CLAUDE_CODE_PROMPT){if((yield*X.forEach(C,V,{concurrency:8})).join("").trim().length<qz)(yield*J.findUp("CLAUDE.md",U.directory,U.worktree)).forEach((I)=>z.add(p$.resolve(I)))}}else for(let D of rX){if(D==="AGENTS.md")continue;let M=yield*J.findUp(D,U.directory,U.worktree);if(M.length>0){M.forEach((I)=>z.add(p$.resolve(I)));break}}}for(let C of Fz())if(yield*J.existsSafe(C)){z.add(p$.resolve(C));break}if(q.instructions)for(let C of q.instructions){if(C.startsWith("https://")||C.startsWith("http://"))continue;let D=C.startsWith("~/")?p$.join(x7.homedir(),C.slice(2)):C;(yield*(p$.isAbsolute(D)?J.glob(p$.basename(D),{cwd:p$.dirname(D),absolute:!0,include:"file"}):K(D)).pipe(X.catch(()=>X.succeed([])))).forEach((I)=>z.add(p$.resolve(I)))}return z}),_=X.fn("Instruction.system")(function*(){let q=yield*$.get(),U=yield*W(),z=(q.instructions??[]).filter((M)=>M.startsWith("https://")||M.startsWith("http://")),C=yield*X.forEach(Array.from(U),V,{concurrency:8}),D=yield*X.forEach(z,Q,{concurrency:4});return{paths:U,content:[...Array.from(U).flatMap((M,I)=>C[I]?[`Instructions from: ${M}
7347
+ ${C[I]}`]:[]),...z.flatMap((M,I)=>D[I]?[`Instructions from: ${M}
7348
+ ${D[I]}`]:[])]}}),j=X.fn("Instruction.find")(function*(q){for(let U of rX){let z=p$.resolve(p$.join(q,U));if(yield*J.existsSafe(z))return z}}),B=X.fn("Instruction.resolve")(function*(q,U,z){let C=yield*W(),D=iX(q),M=[],I=yield*i.get(Y),P=p$.resolve(yield*i.directory),L=p$.resolve(U),w=p$.dirname(L);while(w!==P){let N=p$.relative(P,w);if(N===".."||N.startsWith(`..${p$.sep}`)||p$.isAbsolute(N))break;let x=yield*j(w);if(!x||x===L||C.has(x)||D.has(x)){w=p$.dirname(w);continue}let b=I.claims.get(z);if(!b)b=new Set,I.claims.set(z,b);if(b.has(x)){w=p$.dirname(w);continue}b.add(x);let v=yield*V(x);if(v)M.push({filepath:x,content:`Instructions from: ${x}
7349
+ ${v}`});w=p$.dirname(w)}return M});return FZ.of({clear:G,systemPaths:W,system:_,find:j,resolve:B})})),zz=sX.pipe(f.provide(w$.defaultLayer),f.provide($$.defaultLayer),f.provide(G2.layer));function Mz($){return iX($)}function Cz($,J){let Z=p$.relative(J,$);if(Z&&Z!==".."&&!Z.startsWith(`..${p$.sep}`)&&!p$.isAbsolute(Z))return Z;let Y=x7.homedir();if($===Y||$.startsWith(Y+p$.sep))return p$.join("~",p$.relative(Y,$));return $}var nX=2000,b7=2000,Dz=`... (line truncated to ${b7} chars)`,Pz=`${u1/1024} KB`,Iz=4096,Az=393216,eX=B$("read",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("read"))??"",J=yield*$$.Service,Z=yield*d2.Service,Y=yield*b0.Service,K=yield*UJ.Scope,V=X.fn("ReadTool.miss")(function*(B){let q=v0.dirname(B),U=v0.basename(B),z=yield*J.readDirectory(q).pipe(X.map((C)=>C.filter((D)=>D.toLowerCase().includes(U.toLowerCase())||U.toLowerCase().includes(D.toLowerCase())).map((D)=>v0.join(q,D)).slice(0,3)),X.catch(()=>X.succeed([])));if(z.length>0)return yield*X.fail(Error(`File not found: ${B}
7350
7350
 
7351
7351
  Did you mean one of these?
7352
7352
  ${z.join(`
7353
- `)}`));return yield*G.fail(Error(`File not found: ${H}`))}),V=G.fn("ReadTool.list")(function*(H){let q=yield*J.readDirectoryEntries(H);return yield*G.forEach(q,G.fnUntraced(function*(U){if(U.type==="directory")return U.name+"/";if(U.type!=="symlink")return U.name;if((yield*J.stat(v0.join(H,U.name)).pipe(G.catch(()=>G.void)))?.type==="Directory")return U.name+"/";return U.name}),{concurrency:32}).pipe(G.map((U)=>U.sort((z,M)=>z.localeCompare(M))))}),X=G.fn("ReadTool.warm")(function*(H){yield*Y.touchFile(H,!1).pipe(G.ignore,G.forkIn(K))}),W=G.fn("ReadTool.readSample")(function*(H,q,U){if(q===0)return new Uint8Array;return yield*G.scoped(G.gen(function*(){let M=yield*(yield*J.open(H,{flag:"r"})).readAlloc(Math.min(U,q));if(M._tag==="None")return new Uint8Array;return M.value}))}),_=(H,q)=>{switch(v0.extname(H).toLowerCase()){case".zip":case".tar":case".gz":case".exe":case".dll":case".so":case".class":case".jar":case".war":case".7z":case".doc":case".docx":case".xls":case".xlsx":case".ppt":case".pptx":case".odt":case".ods":case".odp":case".bin":case".dat":case".obj":case".o":case".a":case".lib":case".wasm":case".pyc":case".pyo":return!0}if(q.length===0)return!1;let z=0;for(let M=0;M<q.length;M++){if(q[M]===0)return!0;if(q[M]<9||q[M]>13&&q[M]<32)z++}return z/q.length>0.3},j=G.fn("ReadTool.execute")(function*(H,q){if(H.offset!==void 0&&H.offset<1)return yield*G.fail(Error("offset must be greater than or equal to 1"));let U=H.filePath;if(!v0.isAbsolute(U))U=v0.resolve(t$.get(q.sessionID),U);if(process.platform==="win32")U=$$.normalizePath(U);let z=v0.relative(B$.worktree,U),M=yield*J.stat(U).pipe(G.catchIf((b)=>("reason"in b)&&b.reason._tag==="NotFound",()=>G.succeed(void 0)));if(yield*_1(q,U,{bypass:Boolean(q.extra?.bypassCwdCheck),kind:M?.type==="Directory"?"directory":"file"}),yield*q.ask({permission:"read",patterns:[U],always:["*"],metadata:{}}),!M)return yield*Q(U);if(M.type==="Directory"){let b=yield*V(U),v=H.limit??lG,m=H.offset??1,A=m-1,u=b.slice(A,A+v),r=A+u.length<b.length;return{title:z,output:[`<path>${U}</path>`,"<type>directory</type>","<entries>",u.join(`
7353
+ `)}`));return yield*X.fail(Error(`File not found: ${B}`))}),Q=X.fn("ReadTool.list")(function*(B){let q=yield*J.readDirectoryEntries(B);return yield*X.forEach(q,X.fnUntraced(function*(U){if(U.type==="directory")return U.name+"/";if(U.type!=="symlink")return U.name;if((yield*J.stat(v0.join(B,U.name)).pipe(X.catch(()=>X.void)))?.type==="Directory")return U.name+"/";return U.name}),{concurrency:32}).pipe(X.map((U)=>U.sort((z,C)=>z.localeCompare(C))))}),G=X.fn("ReadTool.warm")(function*(B){yield*Y.touchFile(B,!1).pipe(X.ignore,X.forkIn(K))}),W=X.fn("ReadTool.readSample")(function*(B,q,U){if(q===0)return new Uint8Array;return yield*X.scoped(X.gen(function*(){let C=yield*(yield*J.open(B,{flag:"r"})).readAlloc(Math.min(U,q));if(C._tag==="None")return new Uint8Array;return C.value}))}),_=(B,q)=>{switch(v0.extname(B).toLowerCase()){case".zip":case".tar":case".gz":case".exe":case".dll":case".so":case".class":case".jar":case".war":case".7z":case".doc":case".docx":case".xls":case".xlsx":case".ppt":case".pptx":case".odt":case".ods":case".odp":case".bin":case".dat":case".obj":case".o":case".a":case".lib":case".wasm":case".pyc":case".pyo":return!0}if(q.length===0)return!1;let z=0;for(let C=0;C<q.length;C++){if(q[C]===0)return!0;if(q[C]<9||q[C]>13&&q[C]<32)z++}return z/q.length>0.3},j=X.fn("ReadTool.execute")(function*(B,q){if(B.offset!==void 0&&B.offset<1)return yield*X.fail(Error("offset must be greater than or equal to 1"));let U=B.filePath;if(!v0.isAbsolute(U))U=v0.resolve(t$.get(q.sessionID),U);if(process.platform==="win32")U=$$.normalizePath(U);let z=v0.relative(H$.worktree,U),C=yield*J.stat(U).pipe(X.catchIf((b)=>("reason"in b)&&b.reason._tag==="NotFound",()=>X.succeed(void 0)));if(yield*_1(q,U,{bypass:Boolean(q.extra?.bypassCwdCheck),kind:C?.type==="Directory"?"directory":"file"}),yield*q.ask({permission:"read",patterns:[U],always:["*"],metadata:{}}),!C)return yield*V(U);if(C.type==="Directory"){let b=yield*Q(U),v=B.limit??nX,m=B.offset??1,A=m-1,u=b.slice(A,A+v),r=A+u.length<b.length;return{title:z,output:[`<path>${U}</path>`,"<type>directory</type>","<entries>",u.join(`
7354
7354
  `),r?`
7355
7355
  (Showing ${u.length} of ${b.length} entries. Use 'offset' parameter to read beyond entry ${m+u.length})`:`
7356
7356
  (${b.length} entries)`,"</entries>"].join(`
7357
7357
  `),metadata:{preview:u.slice(0,20).join(`
7358
- `),truncated:r,loaded:[]}}}let I=yield*Z.resolve(q.messages,U,q.messageID),C=yield*W(U,Number(M.size),Oz),P=oG(C,$$.mimeType(U));if(CZ(P)||zZ(P)){if(Number(M.size)>qz)return yield*G.fail(Error(`Attachment is too large to send (${Math.ceil(Number(M.size)/1024)} KB; limit is 384 KB): ${U}
7359
- Resize or compress the ${zZ(P)?"PDF":"image"} to under 384 KB and try again.`));let b=yield*J.readFile(U),v=zZ(P)?"PDF read successfully":"Image read successfully";return{title:z,output:v,metadata:{preview:v,truncated:!1,loaded:I.map((m)=>m.filepath)},attachments:[{type:"file",mime:P,url:`data:${P};base64,${Buffer.from(b).toString("base64")}`}]}}if(_(U,C))return yield*G.fail(Error(`Cannot read binary file: ${U}`));let D=yield*G.promise(()=>Fz(U,{limit:H.limit??lG,offset:H.offset??1}));if(D.count<D.offset&&!(D.count===0&&D.offset===1))return yield*G.fail(Error(`Offset ${D.offset} is out of range for this file (${D.count} lines)`));let L=[`<path>${U}</path>`,"<type>file</type>",`<content>
7358
+ `),truncated:r,loaded:[]}}}let D=yield*Z.resolve(q.messages,U,q.messageID),M=yield*W(U,Number(C.size),Iz),I=aX(M,$$.mimeType(U));if(MZ(I)||zZ(I)){if(Number(C.size)>Az)return yield*X.fail(Error(`Attachment is too large to send (${Math.ceil(Number(C.size)/1024)} KB; limit is 384 KB): ${U}
7359
+ Resize or compress the ${zZ(I)?"PDF":"image"} to under 384 KB and try again.`));let b=yield*J.readFile(U),v=zZ(I)?"PDF read successfully":"Image read successfully";return{title:z,output:v,metadata:{preview:v,truncated:!1,loaded:D.map((m)=>m.filepath)},attachments:[{type:"file",mime:I,url:`data:${I};base64,${Buffer.from(b).toString("base64")}`}]}}if(_(U,M))return yield*X.fail(Error(`Cannot read binary file: ${U}`));let P=yield*X.promise(()=>Sz(U,{limit:B.limit??nX,offset:B.offset??1}));if(P.count<P.offset&&!(P.count===0&&P.offset===1))return yield*X.fail(Error(`Offset ${P.offset} is out of range for this file (${P.count} lines)`));let L=[`<path>${U}</path>`,"<type>file</type>",`<content>
7360
7360
  `].join(`
7361
- `);L+=D.raw.map((b,v)=>`${v+D.offset}: ${b}`).join(`
7362
- `);let R=D.offset+D.raw.length-1,N=R+1,x=D.more||D.cut;if(D.cut)L+=`
7361
+ `);L+=P.raw.map((b,v)=>`${v+P.offset}: ${b}`).join(`
7362
+ `);let w=P.offset+P.raw.length-1,N=w+1,x=P.more||P.cut;if(P.cut)L+=`
7363
7363
 
7364
- (Output capped at ${_z}. Showing lines ${D.offset}-${R}. Use offset=${N} to continue.)`;else if(D.more)L+=`
7364
+ (Output capped at ${Pz}. Showing lines ${P.offset}-${w}. Use offset=${N} to continue.)`;else if(P.more)L+=`
7365
7365
 
7366
- (Showing lines ${D.offset}-${R} of ${D.count}. Use offset=${N} to continue.)`;else L+=`
7366
+ (Showing lines ${P.offset}-${w} of ${P.count}. Use offset=${N} to continue.)`;else L+=`
7367
7367
 
7368
- (End of file - total ${D.count} lines)`;if(L+=`
7369
- </content>`,yield*X(U),I.length>0)L+=`
7368
+ (End of file - total ${P.count} lines)`;if(L+=`
7369
+ </content>`,yield*G(U),D.length>0)L+=`
7370
7370
 
7371
7371
  <system-reminder>
7372
- ${I.map((b)=>b.content).join(`
7372
+ ${D.map((b)=>b.content).join(`
7373
7373
 
7374
7374
  `)}
7375
- </system-reminder>`;return{title:z,output:L,metadata:{preview:D.raw.slice(0,20).join(`
7376
- `),truncated:x,loaded:I.map((b)=>b.filepath)}}});return{description:$,parameters:eV,execute:(H,q)=>j(H,q).pipe(G.orDie)}}));async function Fz($,J){let Z=rG($,{highWaterMark:65536}),Y=10,K=13,Q=J.offset-1,V=[],X=0,W=0,_=!1,j=!1,H=0,q=(I)=>{if(W+=1,W<=Q)return!0;if(V.length>=J.limit)return j=!0,!1;let C=I.length>E7?I.substring(0,E7)+Hz:I,P=Buffer.byteLength(C,"utf-8")+(V.length>0?1:0);if(X+P>u1)return _=!0,j=!0,!1;return V.push(C),X+=P,!0},U=Buffer.alloc(0),z=0,M=!1;try{for await(let I of Z){if(I.length===0)continue;let C=U.length>0?Buffer.concat([U,I]):I,P=0;while(!0){let D=C.indexOf(10,P),L=C.indexOf(13,P);if(D===-1&&L===-1)break;let R,N;if(L!==-1&&(D===-1||L<D)){if(L===C.length-1)break;R=L,N=C[L+1]===10?2:1}else R=D,N=1;let x=q(C.subarray(P,R).toString("utf8"));if(H=z+R+N,P=R+N,!x){M=!0;break}}if(M)break;U=C.subarray(P),z+=P}}finally{Z.destroy()}if(!M&&U.length>0){let I=U[U.length-1]===13?U.length-1:U.length;q(U.subarray(0,I).toString("utf8")),H=z+U.length}if(j)W=await zz($,{start:H,lines:W});return{raw:V,count:W,cut:_,more:j,offset:J.offset}}async function zz($,J){let Z=rG($,{highWaterMark:65536,...J&&J.start>0?{start:J.start}:{}}),Y=J?.lines??0,K=10,Q=13,V=0,X=-1,W=!0;try{for await(let _ of Z){if(_.length===0)continue;W=!1;let j=-1;while((j=_.indexOf(10,j+1))!==-1)V+=1;j=-1;while((j=_.indexOf(13,j+1))!==-1)if((j+1<_.length?_[j+1]:-1)!==10)V+=1;if(X===13&&_[0]===10)V-=1;X=_[_.length-1]}}finally{Z.destroy()}if(W)return Y;return Y+(X===10||X===13?V:V+1)}var VX=S9(QX(),1);function kz($){return`\x00HD${$}\x00`}function Ez($){let J=[],Z="",Y=null,K=0,Q=1;while(K<$.length){let V=$[K];if(Y){if(V==="\\"&&Y==='"'&&K+1<$.length){if(Z+=V+$[K+1],$[K+1]===`
7377
- `)Q++;K+=2;continue}if(V===Y){Y=null,Z+=V,K++;continue}if(V===`
7378
- `)Q++;Z+=V,K++;continue}if(V==='"'||V==="'"){Y=V,Z+=V,K++;continue}if(V==="<"&&$[K+1]==="<"){if($[K+2]==="<"){Z+="<<< ",K+=3;while(K<$.length&&$[K]!==`
7379
- `)K++;continue}let X=K+2,W=X;if(X<$.length&&/[A-Za-z_]/.test($[X])){while(X<$.length&&/[A-Za-z0-9_]/.test($[X]))X++;let _=$.slice(W,X),j=X;while(j<$.length&&($[j]===" "||$[j]==="\t"))j++;if(j<$.length&&$[j]!==`
7380
- `)return{ok:!1,error:{kind:"unsupported-operator",line:Q,detail:"tokens after <<MARKER on the same line are not supported"}};let H=J.length,q=Q;Z+=kz(H)+`
7381
- `,K=j+1,Q++;let U=[],z=!1;while(K<$.length){let M=K;while(M<$.length&&$[M]!==`
7382
- `)M++;let I=$.slice(K,M);if(Z+=`
7383
- `,I.trim()===_){K=M+(M<$.length?1:0),Q++,z=!0;break}U.push(I),K=M+(M<$.length?1:0),Q++}if(!z)return{ok:!1,error:{kind:"unclosed-heredoc",line:q,detail:`unclosed heredoc <<${_}`}};J.push(U.join(`
7384
- `));continue}Z+=V,K++;continue}if(Z+=V,V===`
7385
- `)Q++;K++}return{ok:!0,stripped:Z,bodies:J}}var xz=/^\x00HD(\d+)\x00$/;function bz($){let J="",Z=0,Y=null,K=!0;while(Z<$.length){let Q=$[Z];if(Y){if(J+=Q,Q==="\\"&&Y==='"'&&Z+1<$.length){J+=$[Z+1],Z+=2;continue}if(Q===Y)Y=null;Z++,K=!1;continue}if(Q==='"'||Q==="'"){Y=Q,J+=Q,Z++,K=!1;continue}if(Q==="\\"){if(Z+1<$.length&&$[Z+1]==="#"){J+="\\#",Z+=2,K=!1;continue}J+=Q,Z++,K=!1;continue}if(Q==="#"){if(K){while(Z<$.length&&$[Z]!==`
7386
- `)Z++;continue}J+="\\#",Z++,K=!1;continue}J+=Q,K=Q===`
7387
- `||/\s/.test(Q),Z++}return J}function DZ($){return G.suspend(()=>{if($.trim()==="")return G.succeed([]);let J=Ez($);if(!J.ok)return G.fail(J.error);let{stripped:Z,bodies:Y}=J,K=hz(bz(Z)).filter((V)=>V.text.trim()!==""),Q=[];for(let V of K){let X=vz(V.text);if(X)return G.fail({kind:"unclosed-quote",line:V.line,detail:`unclosed ${X}-quoted string`});let W=VX.parse(V.text,(j)=>"$"+j,{escape:"\\"}),_=[];for(let j of W){if(typeof j==="string"){let H=xz.exec(j);if(H){_.push(Y[parseInt(H[1],10)]);continue}_.push(j);continue}if(typeof j==="object"&&j!==null&&"op"in j){let H=j,q=H.op==="glob"&&H.pattern!=null?`unsupported glob pattern: ${H.pattern}`:`unsupported shell operator: ${H.op}`;return G.fail({kind:"unsupported-operator",line:V.line,detail:q})}}if(_.length>0)Q.push({line:V.line,tokens:_})}return G.succeed(Q)})}function vz($){let J=null;for(let Z=0;Z<$.length;Z++){let Y=$[Z];if(J){if(Y==="\\"&&J==='"'&&Z+1<$.length){Z++;continue}if(Y===J)J=null;continue}if(Y==='"'||Y==="'")J=Y}return J}function hz($){let J=[],Z="",Y=1,K=1,Q=null,V=0;while(V<$.length){let X=$[V];if(Q){if(X==="\\"&&Q==='"'&&V+1<$.length){if(Z+=X+$[V+1],$[V+1]===`
7388
- `)K++;V+=2;continue}if(X===Q){Q=null,Z+=X,V++;continue}if(X===`
7389
- `)K++;Z+=X,V++;continue}if(X==='"'||X==="'"){Q=X,Z+=X,V++;continue}if(X==="\\"&&V+1<$.length&&$[V+1]===`
7390
- `){K++,V+=2;continue}if(X===`
7391
- `){J.push({line:Y,text:Z}),Z="",K++,Y=K,V++;continue}Z+=X,V++}if(Z.length>0)J.push({line:Y,text:Z});return J}function GX($,J,Z){let Y=$.length,K=J.length;if(Math.abs(Y-K)>Z)return Z+1;if(Y===0)return K;if(K===0)return Y;if(Y<K)return GX(J,$,Z);let Q=Array(K+1),V=Array(K+1);for(let X=0;X<=K;X++)Q[X]=X;for(let X=1;X<=Y;X++){V.fill(Z+1),V[0]=X;let W=Math.max(1,X-Z),_=Math.min(K,X+Z),j=Number.POSITIVE_INFINITY;for(let H=W;H<=_;H++){let q=$[X-1]===J[H-1]?0:1;V[H]=Math.min(Q[H]+1,V[H-1]+1,Q[H-1]+q),j=Math.min(j,V[H])}if(j>Z)return Z+1;[Q,V]=[V,Q]}return Q[K]}function PZ($,J){let Z;for(let Y of J){if(GX($,Y,2)>2)continue;if(Z!==void 0)return;Z=Y}return Z}function IZ($){if($==null||typeof $!=="object")return;let J=$;if(typeof J.operation==="string")try{let Z=JSON.parse(J.operation);if(Z&&typeof Z==="object"&&!Array.isArray(Z))J={operation:Z}}catch{}if(J.operation&&typeof J.operation==="object"&&!Array.isArray(J.operation))return{kind:"operation",operation:J.operation};return{kind:"bare",obj:J}}var c2={};o$(c2,{layer:()=>jX,defaultLayer:()=>dz,Service:()=>AZ,ActorWaiter:()=>c2});var gz=/^\s*\*\*Status\*\*:\s*(success|partial|failed|blocked)\b/im,fz=/\*\*Summary\*\*:\s*(.+)$/im;function XX($){if(!$)return{};let J=$.match(gz)?.[1]?.toLowerCase(),Z=$.match(fz)?.[1]?.trim();return{...J?{status:J}:{},...Z?{summary:Z}:{}}}var uz=600000;function b7($){return $.status==="idle"&&($.lifecycle==="ephemeral"||$.lastOutcome!==void 0&&$.lastOutcome!=="success")}class AZ extends D$.Service()("@qitqode/ActorWaiter"){}var jX=f.effect(AZ,G.gen(function*(){let $=yield*L1.Service,J=yield*P$.Service,Z=yield*Y1.Service,Y=(V,X)=>G.gen(function*(){let _=(yield*Z.messages({sessionID:V,agentID:X})).findLast((q)=>q.info.role==="assistant");if(!_)return{result:void 0,structured:void 0};let j=_.info.role==="assistant"?_.info.structured:void 0;if(j!==void 0)return{result:void 0,structured:j};return{result:_.parts.findLast((q)=>q.type==="text")?.text,structured:void 0}}),K=(V,X,W)=>G.gen(function*(){let _=W.status==="idle"&&W.lastOutcome==="success"?yield*Y(V,X):{result:void 0,structured:void 0},j=XX(_.result);return{status:W.status,actor_id:W.actorID,description:W.description,agent:W.agent,background:W.background,turnCount:W.turnCount,lastTurnTime:W.lastTurnTime,lastOutcome:W.lastOutcome,...W.lastError!==void 0?{error:W.lastError}:{},..._.result!==void 0?{result:_.result}:{},..._.structured!==void 0?{structured:_.structured}:{},...j.status?{reportedStatus:j.status}:{},...j.summary?{reportedSummary:j.summary}:{},time:W.time}}),Q=G.fn("ActorWaiter.wait")(function*(V){let X=yield*$.get(V.sessionID,V.actor_id);if(!X)return{status:"unknown",actor_id:V.actor_id};if(b7(X))return yield*K(V.sessionID,V.actor_id,X);let W=yield*B0.make(),_=V.timeout_ms??uz,j=yield*O1.make();return yield*G.acquireUseRelease(J.subscribeCallback(WX,(H)=>{if(H.properties.actorID!==V.actor_id)return;if(H.properties.sessionID!==V.sessionID)return;j.fork(G.gen(function*(){let q=yield*$.get(V.sessionID,V.actor_id);if(!q)return;if(!b7(q))return;let U=yield*K(V.sessionID,V.actor_id,q);B0.doneUnsafe(W,G.succeed(U))}).pipe(G.catchCause((q)=>G.logError(`waiter rehydrate failed: ${q}`))))}),()=>G.gen(function*(){let H=yield*$.get(V.sessionID,V.actor_id);if(H&&b7(H))return yield*K(V.sessionID,V.actor_id,H);let q=yield*B0.await(W).pipe(G.timeout(_),G.catchTag("TimeoutError",()=>G.succeed(null)));if(q===null)return{status:"timeout",actor_id:V.actor_id};return q}),(H)=>G.sync(()=>H()))});return AZ.of({wait:Q})})),dz=jX.pipe(f.provide(P$.defaultLayer),f.provide(L1.defaultLayer),f.provide(Y1.defaultLayer));var SZ={current:void 0};var K1={};o$(K1,{layer:()=>OX,defaultLayer:()=>iz,TaskRegistry:()=>K1,Service:()=>wZ});var L$=b2("task",{id:i$().notNull(),session_id:i$().$type().notNull().references(()=>V0.id,{onDelete:"cascade"}),parent_task_id:i$(),status:i$().$type().notNull(),summary:i$().notNull(),owner:i$(),created_at:t0().notNull(),last_event_at:t0().notNull(),ended_at:t0(),cleanup_after:t0()},($)=>[BX({columns:[$.session_id,$.id]}),e0("task_session_idx").on($.session_id),e0("task_parent_idx").on($.session_id,$.parent_task_id),e0("task_status_idx").on($.status)]),RJ=b2("task_event",{id:t0().primaryKey({autoIncrement:!0}),session_id:i$().$type().notNull().references(()=>V0.id,{onDelete:"cascade"}),task_id:i$().notNull(),at:t0().notNull(),kind:i$().notNull(),summary:i$()},($)=>[UX({columns:[$.session_id,$.task_id],foreignColumns:[L$.session_id,L$.id]}).onDelete("cascade"),e0("task_event_task_idx").on($.session_id,$.task_id,$.at)]);var C8=F.string().regex(/^T\d+(\.\d+)*$/,"Task ID must be Tn or Tn.m..."),pz=F.enum(["open","in_progress","blocked","done","abandoned"]),v7=F.object({id:C8,session_id:F0.zod,parent_task_id:C8.optional(),status:pz,summary:F.string(),owner:F.string().optional(),created_at:F.number(),last_event_at:F.number(),ended_at:F.number().optional(),cleanup_after:F.number().optional()}),h7=F.enum(["created","started","unstarted","blocked","unblocked","done","abandoned","renamed"]),Tk=F.object({id:F.number(),task_id:C8,at:F.number(),kind:h7,summary:F.string().optional()});var HX=Z0.define("task.created",F.object({sessionID:F0.zod,task:v7})),cz=h7.exclude(["created"]),_X=Z0.define("task.updated",F.object({sessionID:F0.zod,task:v7,kind:cz}));var lz=86400000,LJ=($)=>`Task ${$} not found. Use \`task list\` to see valid task IDs, or \`task create\` to add one.`;function g7($){return{id:$.id,session_id:$.session_id,parent_task_id:$.parent_task_id??void 0,status:$.status,summary:$.summary,owner:$.owner??void 0,created_at:$.created_at,last_event_at:$.last_event_at,ended_at:$.ended_at??void 0,cleanup_after:$.cleanup_after??void 0}}function oz($){return{id:$.id,task_id:$.task_id,at:$.at,kind:$.kind,summary:$.summary??void 0}}function rz($,J){let Z=$?`${$}.`:"T",Y=J.filter((Q)=>$?Q.startsWith(Z):/^T\d+$/.test(Q)).map((Q)=>{let V=Q.slice(Z.length);return/^\d+$/.test(V)?Number(V):0}),K=Y.length>0?Math.max(...Y)+1:1;return`${Z}${K}`}class wZ extends D$.Service()("@qitqode/TaskRegistry"){}var OX=f.effect(wZ,G.gen(function*(){let $=yield*P$.Service,J=yield*R$.Service,Z=G.fn("TaskRegistry.cleanupAfter")(function*(C){let P=yield*J.get(),D=P.checkpoint?.task_archive_days??P.checkpoint?.task_cleanup_days??7;return C+D*lz}),Y=(C,P,D,L,R)=>{z$.use((N)=>N.insert(RJ).values({session_id:C,task_id:P,at:R,kind:D,summary:L??null}).run())},K=(C,P)=>C.fork($.publish(HX,{sessionID:P.session_id,task:P})),Q=(C,P,D)=>C.fork($.publish(_X,{sessionID:P.session_id,task:P,kind:D})),V=G.fn("TaskRegistry.create")(function*(C){let P=yield*O1.make(),D=Date.now(),L=z$.use((b)=>b.select({id:L$.id}).from(L$).where(_0(G$(L$.session_id,C.session_id),C.parent_id?G$(L$.parent_task_id,C.parent_id):f7(L$.parent_task_id))).all()),R=rz(C.parent_id,L.map((b)=>b.id)),N={id:R,session_id:C.session_id,parent_task_id:C.parent_id??null,status:"open",summary:C.summary,owner:C.owner??null,created_at:D,last_event_at:D,ended_at:null,cleanup_after:null};z$.use((b)=>b.insert(L$).values(N).run()),Y(C.session_id,R,"created",void 0,D);let x=g7(N);return K(P,x),x}),X=G.fn("TaskRegistry.list")(function*(C){let P=Date.now(),D=[];if(C.session_id)D.push(G$(L$.session_id,C.session_id));if(C.status)D.push(G$(L$.status,C.status));if(C.owner)D.push(G$(L$.owner,C.owner));if(!C.include_terminal){let N=NJ(G$(L$.status,"open"),G$(L$.status,"in_progress"),G$(L$.status,"blocked"));if(N)D.push(N)}if(!C.include_archived){let N=NJ(f7(L$.cleanup_after),JZ(L$.cleanup_after,P));if(N)D.push(N)}let L=D.length>0?_0(...D):void 0;return z$.use((N)=>N.select().from(L$).where(L).orderBy(L$.created_at).all()).map(g7)}),W=G.fn("TaskRegistry.get")(function*(C){let P=z$.use((D)=>D.select().from(L$).where(_0(G$(L$.session_id,C.session_id),G$(L$.id,C.id))).get());return P?g7(P):void 0}),_=G.fn("TaskRegistry.events")(function*(C){return z$.use((D)=>D.select().from(RJ).where(_0(G$(RJ.session_id,C.session_id),G$(RJ.task_id,C.task_id))).orderBy(RJ.at).all()).map(oz)}),j=G.fn("TaskRegistry.block")(function*(C){let P=yield*O1.make(),D=Date.now();z$.use((R)=>R.update(L$).set({status:"blocked",last_event_at:D}).where(_0(G$(L$.session_id,C.session_id),G$(L$.id,C.id))).run()),Y(C.session_id,C.id,"blocked",C.event_summary,D);let L=yield*W({session_id:C.session_id,id:C.id});if(!L)return yield*G.die(new R0(LJ(C.id)));return Q(P,L,"blocked"),L}),H=G.fn("TaskRegistry.unblock")(function*(C){let P=yield*O1.make(),D=Date.now();z$.use((R)=>R.update(L$).set({status:"open",last_event_at:D}).where(_0(G$(L$.session_id,C.session_id),G$(L$.id,C.id))).run()),Y(C.session_id,C.id,"unblocked",C.event_summary,D);let L=yield*W({session_id:C.session_id,id:C.id});if(!L)return yield*G.die(new R0(LJ(C.id)));return Q(P,L,"unblocked"),L}),q=G.fn("TaskRegistry.start")(function*(C){let P=yield*O1.make(),D=Date.now(),L=yield*W({session_id:C.session_id,id:C.id});if(!L)return yield*G.die(new R0(LJ(C.id)));if(L.status==="done"||L.status==="abandoned")return yield*G.logWarning(`refusing to start terminal task ${C.id} (status=${L.status})`),L;let R=C.owner??L.owner;if(L.status==="in_progress"&&R===L.owner)return L;z$.use((x)=>x.update(L$).set({status:"in_progress",owner:R??null,last_event_at:D}).where(_0(G$(L$.session_id,C.session_id),G$(L$.id,C.id))).run()),Y(C.session_id,C.id,"started",C.event_summary,D);let N=yield*W({session_id:C.session_id,id:C.id});if(!N)return yield*G.die(new R0(LJ(C.id)));return Q(P,N,"started"),N}),U=G.fn("TaskRegistry.finish")(function*(C){let P=yield*O1.make(),D=Date.now(),L=yield*Z(D);z$.use((N)=>N.update(L$).set({status:C.status,ended_at:D,cleanup_after:L,last_event_at:D}).where(_0(G$(L$.session_id,C.session_id),G$(L$.id,C.id))).run()),Y(C.session_id,C.id,C.status,C.event_summary,D);let R=yield*W({session_id:C.session_id,id:C.id});if(!R)return yield*G.die(new R0(LJ(C.id)));return Q(P,R,C.status),R}),z=G.fn("TaskRegistry.done")(function*(C){return yield*U({...C,status:"done"})}),M=G.fn("TaskRegistry.abandon")(function*(C){return yield*U({...C,status:"abandoned"})}),I=G.fn("TaskRegistry.rename")(function*(C){let P=yield*O1.make(),D=Date.now();z$.use((R)=>R.update(L$).set({summary:C.summary,last_event_at:D}).where(_0(G$(L$.session_id,C.session_id),G$(L$.id,C.id))).run()),Y(C.session_id,C.id,"renamed",C.summary,D);let L=yield*W({session_id:C.session_id,id:C.id});if(!L)return yield*G.die(new R0(LJ(C.id)));return Q(P,L,"renamed"),L});return wZ.of({create:V,list:X,get:W,events:_,block:j,unblock:H,done:z,abandon:M,rename:I,start:q})})),iz=f.suspend(()=>OX.pipe(f.provide(P$.layer),f.provide(R$.defaultLayer)));var o2={};o$(o2,{renderRebuildContext:()=>DC,renderIndex:()=>MC,loadLatest:()=>zC,loadCheckpoints:()=>CC,layer:()=>dX,lastBoundary:()=>PC,isWriterRunning:()=>IC,hasCheckpoint:()=>FC,defaultLayer:()=>pX,composeWriterPromptForTest:()=>LZ,SessionCheckpoint:()=>o2,Service:()=>D8});import OC from"path";import qC from"fs/promises";import EX from"path";var qX={current:void 0};function RZ(){try{return B$.current?.project?.id}catch{return}}function sz($){if(!Array.isArray($.content))return[];let J=[];for(let Z of $.content)if(Z.type==="tool_result"&&typeof Z.tool_use_id==="string")J.push(Z.tool_use_id);return J}function FX($){if(!Array.isArray($.content))return[];let J=[];for(let Z of $.content)if(Z.type==="tool_use"&&typeof Z.id==="string")J.push(Z.id);return J}function zX($,J){if(J<=0||J>=$.length)return J;let Z=J,Y=[],K=new Set;for(let X=Z;X<$.length;X++){Y.push(...sz($[X]));for(let W of FX($[X]))K.add(W)}let Q=new Set(Y.filter((X)=>!K.has(X)));for(let X=Z-1;X>=0&&Q.size>0;X--){let W=$[X];if(W.role!=="assistant")continue;let _=!1;for(let j of FX(W))if(Q.delete(j))_=!0;if(_)Z=X}let V=$[Z]?.id;if(V)for(let X=Z-1;X>=0;X--)if($[X].id===V)Z=X;else break;return Z}function CX($,J){if(J>=$.length)return J;for(let Z=J;Z>=0;Z--){let Y=$[Z];if(Y.info.role!=="user")continue;if(!(Y.parts.length>0&&Y.parts.every((Q)=>Q.type==="tool_result")))return Z}return 0}import nz from"fs/promises";import az from"path";var tz=O$.create({service:"session.progress-reconcile"});function ez($){let J=$.match(/^---\n([\s\S]*?)\n---\n/);if(!J)return null;let Z=J[1].split(`
7392
- `).find((K)=>K.startsWith("written-at:"));if(!Z)return null;let Y=Number(Z.slice(11).trim());if(!Number.isFinite(Y))return null;return Y}function $C($){let J=new Map,Z=/(?<!`)\(progress:\s*tasks\/([^/]+)\/progress\.md,\s*last-reconciled-written-at:\s*(\d+)\)/g;for(let Y of $.matchAll(Z)){let K=Number(Y[2]);if(Number.isFinite(K))J.set(Y[1],K)}return J}async function JC($){let J=await Bun.file(Q1($)).text().catch(()=>""),Z=$C(J),Y=MX($),K;try{K=await nz.readdir(Y)}catch{return[]}let Q=[];for(let V of K){let X=az.join(Y,V,"progress.md"),W;try{W=await Bun.file(X).text()}catch{continue}let _=ez(W);if(_===null)continue;let j=Z.get(V);if(j===void 0)Q.push({taskId:V,writtenAt:_,status:"NEW"});else if(_>j)Q.push({taskId:V,writtenAt:_,status:"CHANGED",prior:j})}return Q}function ZC($){if($.length===0)return"";let J=["SUBAGENT PROGRESS to integrate (since last reconcile):"];for(let Z of $)if(Z.status==="NEW")J.push(` - ${Z.taskId} (NEW, written-at=${Z.writtenAt})`);else J.push(` - ${Z.taskId} (CHANGED, written-at=${Z.writtenAt}, prior=${Z.prior})`);return J.push(""),J.push("For each: Read tasks/<TID>/progress.md, integrate \xA74 (verbatim commands) verbatim into main \xA75 Current work; integrate \xA75 (outcome+discoveries) into main \xA75 or \xA77 as appropriate. Then update the corresponding \xA74 line in main checkpoint to:"),J.push(" (progress: tasks/<TID>/progress.md, last-reconciled-written-at: <written-at from above>)"),J.join(`
7393
- `)}async function DX($){let J=await JC($).catch((Z)=>{return tz.warn("buildProgressDiff failed; reconcile skipped this turn",{err:Z,sessionID:$}),[]});return ZC(J)}var YC=1e4,PX=20000,KC=5,AX=new Set(["read","bash","grep","glob","webfetch","websearch","edit","write","multiedit","apply_patch","codesearch"]);function QC($){let J=0;for(let Z of $.parts)try{J+=D0.estimate(JSON.stringify(Z))}catch{J+=1000}return J}function IX($){return $.parts.some((J)=>J.type==="text"||J.type==="reasoning")}function SX($){if($.length===0)return"";let J=$.findLastIndex((V)=>V.info.role==="assistant"&&V.info.finish!==void 0);if(J<=0)return $[J>=0?J:0].info.id;let Z=$.map((V)=>QC(V)),Y=J-1,K=0,Q=0;for(let V=Y;V<$.length;V++)if(K+=Z[V],IX($[V]))Q+=1;if(K>=PX)return $[Y].info.id;while(Y>0&&K<PX&&(K<YC||Q<KC))if(Y-=1,K+=Z[Y],IX($[Y]))Q+=1;return $[Y].info.id}import m7 from"fs/promises";import u7 from"path";async function yX($){if(!await Bun.file($).exists())await m7.mkdir(u7.dirname($),{recursive:!0}),await Bun.write($,wX)}async function TX($){if(!await Bun.file($).exists())await m7.mkdir(u7.dirname($),{recursive:!0}),await Bun.write($,RX)}async function kX($){if(!await Bun.file($).exists())await m7.mkdir(u7.dirname($),{recursive:!0}),await Bun.write($,NX)}function VC($){let J=Object.entries($);if(J.length===0)throw Error("CHECKPOINT_SECTION_BUDGETS is empty \u2014 F43 substitution would produce an empty prompt block");let Z=3,Y=["Section budgets (~tokens):"];for(let K=0;K<J.length;K+=Z){let Q=J.slice(K,K+Z).map(([V,X])=>`${V}: ${X}`).join(" ");Y.push(` ${Q}`)}return Y.join(`
7394
- `)}async function LZ($){let J=await e.resolvePrompt("agent/checkpoint-writer");if(!J)throw Error("checkpoint-writer prompt unavailable from backend (agent/checkpoint-writer)");return[yJ({source:"checkpoint",trust:"session-state",posture:"system",body:["You are now operating in checkpoint-writer mode. Ignore the general coding-assistant framing in the system prompt above. The read, write, edit, glob, grep, and task tools are available; do not invoke others.","","========================================================================","ABSOLUTE PATHS \u2014 USE THESE VERBATIM. NEVER COMPUTE, INFER, OR MODIFY.","========================================================================","",`CHECKPOINT_PATH = ${$.checkpointFile}`,`MEMORY_PATH = ${$.memoryFile}`,`TASK_MEM_DIR = ${$.taskMemDir}`,`NOTES_PATH = ${$.notesFile}`,"","When using the Write tool, the first arg MUST be one of these literal","absolute paths (or for task narrative, TASK_MEM_DIR + '/' + task_id +","'/progress.md' or '/notes.md'). Do NOT abbreviate. Do NOT change","parent directories. Do NOT insert paths from memory of similar projects.","If you find yourself typing '/data/checkpoints/' as a parent, STOP \u2014 that","is the legacy v2 layout and is wrong. The current parent for the","checkpoint file is the directory portion of CHECKPOINT_PATH above.","========================================================================","",$.progressDiff,"",J.replace("{{SECTION_BUDGETS}}",VC(LX))].join(`
7375
+ </system-reminder>`;return{title:z,output:L,metadata:{preview:P.raw.slice(0,20).join(`
7376
+ `),truncated:x,loaded:D.map((b)=>b.filepath)}}});return{description:$,parameters:ZX,execute:(B,q)=>j(B,q).pipe(X.orDie)}}));async function Sz($,J){let Z=tX($,{highWaterMark:65536}),Y=10,K=13,V=J.offset-1,Q=[],G=0,W=0,_=!1,j=!1,B=0,q=(D)=>{if(W+=1,W<=V)return!0;if(Q.length>=J.limit)return j=!0,!1;let M=D.length>b7?D.substring(0,b7)+Dz:D,I=Buffer.byteLength(M,"utf-8")+(Q.length>0?1:0);if(G+I>u1)return _=!0,j=!0,!1;return Q.push(M),G+=I,!0},U=Buffer.alloc(0),z=0,C=!1;try{for await(let D of Z){if(D.length===0)continue;let M=U.length>0?Buffer.concat([U,D]):D,I=0;while(!0){let P=M.indexOf(10,I),L=M.indexOf(13,I);if(P===-1&&L===-1)break;let w,N;if(L!==-1&&(P===-1||L<P)){if(L===M.length-1)break;w=L,N=M[L+1]===10?2:1}else w=P,N=1;let x=q(M.subarray(I,w).toString("utf8"));if(B=z+w+N,I=w+N,!x){C=!0;break}}if(C)break;U=M.subarray(I),z+=I}}finally{Z.destroy()}if(!C&&U.length>0){let D=U[U.length-1]===13?U.length-1:U.length;q(U.subarray(0,D).toString("utf8")),B=z+U.length}if(j)W=await Rz($,{start:B,lines:W});return{raw:Q,count:W,cut:_,more:j,offset:J.offset}}async function Rz($,J){let Z=tX($,{highWaterMark:65536,...J&&J.start>0?{start:J.start}:{}}),Y=J?.lines??0,K=10,V=13,Q=0,G=-1,W=!0;try{for await(let _ of Z){if(_.length===0)continue;W=!1;let j=-1;while((j=_.indexOf(10,j+1))!==-1)Q+=1;j=-1;while((j=_.indexOf(13,j+1))!==-1)if((j+1<_.length?_[j+1]:-1)!==10)Q+=1;if(G===13&&_[0]===10)Q-=1;G=_[_.length-1]}}finally{Z.destroy()}if(W)return Y;return Y+(G===10||G===13?Q:Q+1)}var UG=S9(jG(),1);function mz($){return`\x00HD${$}\x00`}function uz($){let J=[],Z="",Y=null,K=0,V=1;while(K<$.length){let Q=$[K];if(Y){if(Q==="\\"&&Y==='"'&&K+1<$.length){if(Z+=Q+$[K+1],$[K+1]===`
7377
+ `)V++;K+=2;continue}if(Q===Y){Y=null,Z+=Q,K++;continue}if(Q===`
7378
+ `)V++;Z+=Q,K++;continue}if(Q==='"'||Q==="'"){Y=Q,Z+=Q,K++;continue}if(Q==="<"&&$[K+1]==="<"){if($[K+2]==="<"){Z+="<<< ",K+=3;while(K<$.length&&$[K]!==`
7379
+ `)K++;continue}let G=K+2,W=G;if(G<$.length&&/[A-Za-z_]/.test($[G])){while(G<$.length&&/[A-Za-z0-9_]/.test($[G]))G++;let _=$.slice(W,G),j=G;while(j<$.length&&($[j]===" "||$[j]==="\t"))j++;if(j<$.length&&$[j]!==`
7380
+ `)return{ok:!1,error:{kind:"unsupported-operator",line:V,detail:"tokens after <<MARKER on the same line are not supported"}};let B=J.length,q=V;Z+=mz(B)+`
7381
+ `,K=j+1,V++;let U=[],z=!1;while(K<$.length){let C=K;while(C<$.length&&$[C]!==`
7382
+ `)C++;let D=$.slice(K,C);if(Z+=`
7383
+ `,D.trim()===_){K=C+(C<$.length?1:0),V++,z=!0;break}U.push(D),K=C+(C<$.length?1:0),V++}if(!z)return{ok:!1,error:{kind:"unclosed-heredoc",line:q,detail:`unclosed heredoc <<${_}`}};J.push(U.join(`
7384
+ `));continue}Z+=Q,K++;continue}if(Z+=Q,Q===`
7385
+ `)V++;K++}return{ok:!0,stripped:Z,bodies:J}}var dz=/^\x00HD(\d+)\x00$/;function pz($){let J="",Z=0,Y=null,K=!0;while(Z<$.length){let V=$[Z];if(Y){if(J+=V,V==="\\"&&Y==='"'&&Z+1<$.length){J+=$[Z+1],Z+=2;continue}if(V===Y)Y=null;Z++,K=!1;continue}if(V==='"'||V==="'"){Y=V,J+=V,Z++,K=!1;continue}if(V==="\\"){if(Z+1<$.length&&$[Z+1]==="#"){J+="\\#",Z+=2,K=!1;continue}J+=V,Z++,K=!1;continue}if(V==="#"){if(K){while(Z<$.length&&$[Z]!==`
7386
+ `)Z++;continue}J+="\\#",Z++,K=!1;continue}J+=V,K=V===`
7387
+ `||/\s/.test(V),Z++}return J}function DZ($){return X.suspend(()=>{if($.trim()==="")return X.succeed([]);let J=uz($);if(!J.ok)return X.fail(J.error);let{stripped:Z,bodies:Y}=J,K=lz(pz(Z)).filter((Q)=>Q.text.trim()!==""),V=[];for(let Q of K){let G=cz(Q.text);if(G)return X.fail({kind:"unclosed-quote",line:Q.line,detail:`unclosed ${G}-quoted string`});let W=UG.parse(Q.text,(j)=>"$"+j,{escape:"\\"}),_=[];for(let j of W){if(typeof j==="string"){let B=dz.exec(j);if(B){_.push(Y[parseInt(B[1],10)]);continue}_.push(j);continue}if(typeof j==="object"&&j!==null&&"op"in j){let B=j,q=B.op==="glob"&&B.pattern!=null?`unsupported glob pattern: ${B.pattern}`:`unsupported shell operator: ${B.op}`;return X.fail({kind:"unsupported-operator",line:Q.line,detail:q})}}if(_.length>0)V.push({line:Q.line,tokens:_})}return X.succeed(V)})}function cz($){let J=null;for(let Z=0;Z<$.length;Z++){let Y=$[Z];if(J){if(Y==="\\"&&J==='"'&&Z+1<$.length){Z++;continue}if(Y===J)J=null;continue}if(Y==='"'||Y==="'")J=Y}return J}function lz($){let J=[],Z="",Y=1,K=1,V=null,Q=0;while(Q<$.length){let G=$[Q];if(V){if(G==="\\"&&V==='"'&&Q+1<$.length){if(Z+=G+$[Q+1],$[Q+1]===`
7388
+ `)K++;Q+=2;continue}if(G===V){V=null,Z+=G,Q++;continue}if(G===`
7389
+ `)K++;Z+=G,Q++;continue}if(G==='"'||G==="'"){V=G,Z+=G,Q++;continue}if(G==="\\"&&Q+1<$.length&&$[Q+1]===`
7390
+ `){K++,Q+=2;continue}if(G===`
7391
+ `){J.push({line:Y,text:Z}),Z="",K++,Y=K,Q++;continue}Z+=G,Q++}if(Z.length>0)J.push({line:Y,text:Z});return J}function HG($,J,Z){let Y=$.length,K=J.length;if(Math.abs(Y-K)>Z)return Z+1;if(Y===0)return K;if(K===0)return Y;if(Y<K)return HG(J,$,Z);let V=Array(K+1),Q=Array(K+1);for(let G=0;G<=K;G++)V[G]=G;for(let G=1;G<=Y;G++){Q.fill(Z+1),Q[0]=G;let W=Math.max(1,G-Z),_=Math.min(K,G+Z),j=Number.POSITIVE_INFINITY;for(let B=W;B<=_;B++){let q=$[G-1]===J[B-1]?0:1;Q[B]=Math.min(V[B]+1,Q[B-1]+1,V[B-1]+q),j=Math.min(j,Q[B])}if(j>Z)return Z+1;[V,Q]=[Q,V]}return V[K]}function PZ($,J){let Z;for(let Y of J){if(HG($,Y,2)>2)continue;if(Z!==void 0)return;Z=Y}return Z}function IZ($){if($==null||typeof $!=="object")return;let J=$;if(typeof J.operation==="string")try{let Z=JSON.parse(J.operation);if(Z&&typeof Z==="object"&&!Array.isArray(Z))J={operation:Z}}catch{}if(J.operation&&typeof J.operation==="object"&&!Array.isArray(J.operation))return{kind:"operation",operation:J.operation};return{kind:"bare",obj:J}}var c2={};o$(c2,{layer:()=>OG,defaultLayer:()=>nz,Service:()=>AZ,ActorWaiter:()=>c2});var oz=/^\s*\*\*Status\*\*:\s*(success|partial|failed|blocked)\b/im,rz=/\*\*Summary\*\*:\s*(.+)$/im;function BG($){if(!$)return{};let J=$.match(oz)?.[1]?.toLowerCase(),Z=$.match(rz)?.[1]?.trim();return{...J?{status:J}:{},...Z?{summary:Z}:{}}}var sz=600000;function h7($){return $.status==="idle"&&($.lifecycle==="ephemeral"||$.lastOutcome!==void 0&&$.lastOutcome!=="success")}class AZ extends D$.Service()("@qitqode/ActorWaiter"){}var OG=f.effect(AZ,X.gen(function*(){let $=yield*L1.Service,J=yield*P$.Service,Z=yield*Y1.Service,Y=(Q,G)=>X.gen(function*(){let _=(yield*Z.messages({sessionID:Q,agentID:G})).findLast((q)=>q.info.role==="assistant");if(!_)return{result:void 0,structured:void 0};let j=_.info.role==="assistant"?_.info.structured:void 0;if(j!==void 0)return{result:void 0,structured:j};return{result:_.parts.findLast((q)=>q.type==="text")?.text,structured:void 0}}),K=(Q,G,W)=>X.gen(function*(){let _=W.status==="idle"&&W.lastOutcome==="success"?yield*Y(Q,G):{result:void 0,structured:void 0},j=BG(_.result);return{status:W.status,actor_id:W.actorID,description:W.description,agent:W.agent,background:W.background,turnCount:W.turnCount,lastTurnTime:W.lastTurnTime,lastOutcome:W.lastOutcome,...W.lastError!==void 0?{error:W.lastError}:{},..._.result!==void 0?{result:_.result}:{},..._.structured!==void 0?{structured:_.structured}:{},...j.status?{reportedStatus:j.status}:{},...j.summary?{reportedSummary:j.summary}:{},time:W.time}}),V=X.fn("ActorWaiter.wait")(function*(Q){let G=yield*$.get(Q.sessionID,Q.actor_id);if(!G)return{status:"unknown",actor_id:Q.actor_id};if(h7(G))return yield*K(Q.sessionID,Q.actor_id,G);let W=yield*H0.make(),_=Q.timeout_ms??sz,j=yield*O1.make();return yield*X.acquireUseRelease(J.subscribeCallback(_G,(B)=>{if(B.properties.actorID!==Q.actor_id)return;if(B.properties.sessionID!==Q.sessionID)return;j.fork(X.gen(function*(){let q=yield*$.get(Q.sessionID,Q.actor_id);if(!q)return;if(!h7(q))return;let U=yield*K(Q.sessionID,Q.actor_id,q);H0.doneUnsafe(W,X.succeed(U))}).pipe(X.catchCause((q)=>X.logError(`waiter rehydrate failed: ${q}`))))}),()=>X.gen(function*(){let B=yield*$.get(Q.sessionID,Q.actor_id);if(B&&h7(B))return yield*K(Q.sessionID,Q.actor_id,B);let q=yield*H0.await(W).pipe(X.timeout(_),X.catchTag("TimeoutError",()=>X.succeed(null)));if(q===null)return{status:"timeout",actor_id:Q.actor_id};return q}),(B)=>X.sync(()=>B()))});return AZ.of({wait:V})})),nz=OG.pipe(f.provide(P$.defaultLayer),f.provide(L1.defaultLayer),f.provide(Y1.defaultLayer));var SZ={current:void 0};var K1={};o$(K1,{layer:()=>CG,defaultLayer:()=>ZM,TaskRegistry:()=>K1,Service:()=>RZ});var L$=b2("task",{id:i$().notNull(),session_id:i$().$type().notNull().references(()=>Q0.id,{onDelete:"cascade"}),parent_task_id:i$(),status:i$().$type().notNull(),summary:i$().notNull(),owner:i$(),created_at:t0().notNull(),last_event_at:t0().notNull(),ended_at:t0(),cleanup_after:t0()},($)=>[FG({columns:[$.session_id,$.id]}),e0("task_session_idx").on($.session_id),e0("task_parent_idx").on($.session_id,$.parent_task_id),e0("task_status_idx").on($.status)]),wJ=b2("task_event",{id:t0().primaryKey({autoIncrement:!0}),session_id:i$().$type().notNull().references(()=>Q0.id,{onDelete:"cascade"}),task_id:i$().notNull(),at:t0().notNull(),kind:i$().notNull(),summary:i$()},($)=>[qG({columns:[$.session_id,$.task_id],foreignColumns:[L$.session_id,L$.id]}).onDelete("cascade"),e0("task_event_task_idx").on($.session_id,$.task_id,$.at)]);var M8=F.string().regex(/^T\d+(\.\d+)*$/,"Task ID must be Tn or Tn.m..."),az=F.enum(["open","in_progress","blocked","done","abandoned"]),g7=F.object({id:M8,session_id:F0.zod,parent_task_id:M8.optional(),status:az,summary:F.string(),owner:F.string().optional(),created_at:F.number(),last_event_at:F.number(),ended_at:F.number().optional(),cleanup_after:F.number().optional()}),f7=F.enum(["created","started","unstarted","blocked","unblocked","done","abandoned","renamed"]),mk=F.object({id:F.number(),task_id:M8,at:F.number(),kind:f7,summary:F.string().optional()});var zG=Z0.define("task.created",F.object({sessionID:F0.zod,task:g7})),tz=f7.exclude(["created"]),MG=Z0.define("task.updated",F.object({sessionID:F0.zod,task:g7,kind:tz}));var ez=86400000,LJ=($)=>`Task ${$} not found. Use \`task list\` to see valid task IDs, or \`task create\` to add one.`;function m7($){return{id:$.id,session_id:$.session_id,parent_task_id:$.parent_task_id??void 0,status:$.status,summary:$.summary,owner:$.owner??void 0,created_at:$.created_at,last_event_at:$.last_event_at,ended_at:$.ended_at??void 0,cleanup_after:$.cleanup_after??void 0}}function $M($){return{id:$.id,task_id:$.task_id,at:$.at,kind:$.kind,summary:$.summary??void 0}}function JM($,J){let Z=$?`${$}.`:"T",Y=J.filter((V)=>$?V.startsWith(Z):/^T\d+$/.test(V)).map((V)=>{let Q=V.slice(Z.length);return/^\d+$/.test(Q)?Number(Q):0}),K=Y.length>0?Math.max(...Y)+1:1;return`${Z}${K}`}class RZ extends D$.Service()("@qitqode/TaskRegistry"){}var CG=f.effect(RZ,X.gen(function*(){let $=yield*P$.Service,J=yield*w$.Service,Z=X.fn("TaskRegistry.cleanupAfter")(function*(M){let I=yield*J.get(),P=I.checkpoint?.task_archive_days??I.checkpoint?.task_cleanup_days??7;return M+P*ez}),Y=(M,I,P,L,w)=>{z$.use((N)=>N.insert(wJ).values({session_id:M,task_id:I,at:w,kind:P,summary:L??null}).run())},K=(M,I)=>M.fork($.publish(zG,{sessionID:I.session_id,task:I})),V=(M,I,P)=>M.fork($.publish(MG,{sessionID:I.session_id,task:I,kind:P})),Q=X.fn("TaskRegistry.create")(function*(M){let I=yield*O1.make(),P=Date.now(),L=z$.use((b)=>b.select({id:L$.id}).from(L$).where(_0(X$(L$.session_id,M.session_id),M.parent_id?X$(L$.parent_task_id,M.parent_id):u7(L$.parent_task_id))).all()),w=JM(M.parent_id,L.map((b)=>b.id)),N={id:w,session_id:M.session_id,parent_task_id:M.parent_id??null,status:"open",summary:M.summary,owner:M.owner??null,created_at:P,last_event_at:P,ended_at:null,cleanup_after:null};z$.use((b)=>b.insert(L$).values(N).run()),Y(M.session_id,w,"created",void 0,P);let x=m7(N);return K(I,x),x}),G=X.fn("TaskRegistry.list")(function*(M){let I=Date.now(),P=[];if(M.session_id)P.push(X$(L$.session_id,M.session_id));if(M.status)P.push(X$(L$.status,M.status));if(M.owner)P.push(X$(L$.owner,M.owner));if(!M.include_terminal){let N=NJ(X$(L$.status,"open"),X$(L$.status,"in_progress"),X$(L$.status,"blocked"));if(N)P.push(N)}if(!M.include_archived){let N=NJ(u7(L$.cleanup_after),JZ(L$.cleanup_after,I));if(N)P.push(N)}let L=P.length>0?_0(...P):void 0;return z$.use((N)=>N.select().from(L$).where(L).orderBy(L$.created_at).all()).map(m7)}),W=X.fn("TaskRegistry.get")(function*(M){let I=z$.use((P)=>P.select().from(L$).where(_0(X$(L$.session_id,M.session_id),X$(L$.id,M.id))).get());return I?m7(I):void 0}),_=X.fn("TaskRegistry.events")(function*(M){return z$.use((P)=>P.select().from(wJ).where(_0(X$(wJ.session_id,M.session_id),X$(wJ.task_id,M.task_id))).orderBy(wJ.at).all()).map($M)}),j=X.fn("TaskRegistry.block")(function*(M){let I=yield*O1.make(),P=Date.now();z$.use((w)=>w.update(L$).set({status:"blocked",last_event_at:P}).where(_0(X$(L$.session_id,M.session_id),X$(L$.id,M.id))).run()),Y(M.session_id,M.id,"blocked",M.event_summary,P);let L=yield*W({session_id:M.session_id,id:M.id});if(!L)return yield*X.die(new w0(LJ(M.id)));return V(I,L,"blocked"),L}),B=X.fn("TaskRegistry.unblock")(function*(M){let I=yield*O1.make(),P=Date.now();z$.use((w)=>w.update(L$).set({status:"open",last_event_at:P}).where(_0(X$(L$.session_id,M.session_id),X$(L$.id,M.id))).run()),Y(M.session_id,M.id,"unblocked",M.event_summary,P);let L=yield*W({session_id:M.session_id,id:M.id});if(!L)return yield*X.die(new w0(LJ(M.id)));return V(I,L,"unblocked"),L}),q=X.fn("TaskRegistry.start")(function*(M){let I=yield*O1.make(),P=Date.now(),L=yield*W({session_id:M.session_id,id:M.id});if(!L)return yield*X.die(new w0(LJ(M.id)));if(L.status==="done"||L.status==="abandoned")return yield*X.logWarning(`refusing to start terminal task ${M.id} (status=${L.status})`),L;let w=M.owner??L.owner;if(L.status==="in_progress"&&w===L.owner)return L;z$.use((x)=>x.update(L$).set({status:"in_progress",owner:w??null,last_event_at:P}).where(_0(X$(L$.session_id,M.session_id),X$(L$.id,M.id))).run()),Y(M.session_id,M.id,"started",M.event_summary,P);let N=yield*W({session_id:M.session_id,id:M.id});if(!N)return yield*X.die(new w0(LJ(M.id)));return V(I,N,"started"),N}),U=X.fn("TaskRegistry.finish")(function*(M){let I=yield*O1.make(),P=Date.now(),L=yield*Z(P);z$.use((N)=>N.update(L$).set({status:M.status,ended_at:P,cleanup_after:L,last_event_at:P}).where(_0(X$(L$.session_id,M.session_id),X$(L$.id,M.id))).run()),Y(M.session_id,M.id,M.status,M.event_summary,P);let w=yield*W({session_id:M.session_id,id:M.id});if(!w)return yield*X.die(new w0(LJ(M.id)));return V(I,w,M.status),w}),z=X.fn("TaskRegistry.done")(function*(M){return yield*U({...M,status:"done"})}),C=X.fn("TaskRegistry.abandon")(function*(M){return yield*U({...M,status:"abandoned"})}),D=X.fn("TaskRegistry.rename")(function*(M){let I=yield*O1.make(),P=Date.now();z$.use((w)=>w.update(L$).set({summary:M.summary,last_event_at:P}).where(_0(X$(L$.session_id,M.session_id),X$(L$.id,M.id))).run()),Y(M.session_id,M.id,"renamed",M.summary,P);let L=yield*W({session_id:M.session_id,id:M.id});if(!L)return yield*X.die(new w0(LJ(M.id)));return V(I,L,"renamed"),L});return RZ.of({create:Q,list:G,get:W,events:_,block:j,unblock:B,done:z,abandon:C,rename:D,start:q})})),ZM=f.suspend(()=>CG.pipe(f.provide(P$.layer),f.provide(w$.defaultLayer)));var o2={};o$(o2,{renderRebuildContext:()=>NM,renderIndex:()=>LM,loadLatest:()=>RM,loadCheckpoints:()=>wM,layer:()=>rG,lastBoundary:()=>yM,isWriterRunning:()=>TM,hasCheckpoint:()=>SM,defaultLayer:()=>iG,composeWriterPromptForTest:()=>LZ,SessionCheckpoint:()=>o2,Service:()=>D8});import IM from"path";import AM from"fs/promises";import gG from"path";var DG={current:void 0};function wZ(){try{return H$.current?.project?.id}catch{return}}function YM($){if(!Array.isArray($.content))return[];let J=[];for(let Z of $.content)if(Z.type==="tool_result"&&typeof Z.tool_use_id==="string")J.push(Z.tool_use_id);return J}function PG($){if(!Array.isArray($.content))return[];let J=[];for(let Z of $.content)if(Z.type==="tool_use"&&typeof Z.id==="string")J.push(Z.id);return J}function IG($,J){if(J<=0||J>=$.length)return J;let Z=J,Y=[],K=new Set;for(let G=Z;G<$.length;G++){Y.push(...YM($[G]));for(let W of PG($[G]))K.add(W)}let V=new Set(Y.filter((G)=>!K.has(G)));for(let G=Z-1;G>=0&&V.size>0;G--){let W=$[G];if(W.role!=="assistant")continue;let _=!1;for(let j of PG(W))if(V.delete(j))_=!0;if(_)Z=G}let Q=$[Z]?.id;if(Q)for(let G=Z-1;G>=0;G--)if($[G].id===Q)Z=G;else break;return Z}function AG($,J){if(J>=$.length)return J;for(let Z=J;Z>=0;Z--){let Y=$[Z];if(Y.info.role!=="user")continue;if(!(Y.parts.length>0&&Y.parts.every((V)=>V.type==="tool_result")))return Z}return 0}import KM from"fs/promises";import VM from"path";var QM=O$.create({service:"session.progress-reconcile"});function XM($){let J=$.match(/^---\n([\s\S]*?)\n---\n/);if(!J)return null;let Z=J[1].split(`
7392
+ `).find((K)=>K.startsWith("written-at:"));if(!Z)return null;let Y=Number(Z.slice(11).trim());if(!Number.isFinite(Y))return null;return Y}function GM($){let J=new Map,Z=/(?<!`)\(progress:\s*tasks\/([^/]+)\/progress\.md,\s*last-reconciled-written-at:\s*(\d+)\)/g;for(let Y of $.matchAll(Z)){let K=Number(Y[2]);if(Number.isFinite(K))J.set(Y[1],K)}return J}async function WM($){let J=await Bun.file(V1($)).text().catch(()=>""),Z=GM(J),Y=SG($),K;try{K=await KM.readdir(Y)}catch{return[]}let V=[];for(let Q of K){let G=VM.join(Y,Q,"progress.md"),W;try{W=await Bun.file(G).text()}catch{continue}let _=XM(W);if(_===null)continue;let j=Z.get(Q);if(j===void 0)V.push({taskId:Q,writtenAt:_,status:"NEW"});else if(_>j)V.push({taskId:Q,writtenAt:_,status:"CHANGED",prior:j})}return V}function jM($){if($.length===0)return"";let J=["SUBAGENT PROGRESS to integrate (since last reconcile):"];for(let Z of $)if(Z.status==="NEW")J.push(` - ${Z.taskId} (NEW, written-at=${Z.writtenAt})`);else J.push(` - ${Z.taskId} (CHANGED, written-at=${Z.writtenAt}, prior=${Z.prior})`);return J.push(""),J.push("For each: Read tasks/<TID>/progress.md, integrate \xA74 (verbatim commands) verbatim into main \xA75 Current work; integrate \xA75 (outcome+discoveries) into main \xA75 or \xA77 as appropriate. Then update the corresponding \xA74 line in main checkpoint to:"),J.push(" (progress: tasks/<TID>/progress.md, last-reconciled-written-at: <written-at from above>)"),J.join(`
7393
+ `)}async function RG($){let J=await WM($).catch((Z)=>{return QM.warn("buildProgressDiff failed; reconcile skipped this turn",{err:Z,sessionID:$}),[]});return jM(J)}var UM=1e4,wG=20000,HM=5,NG=new Set(["read","bash","grep","glob","webfetch","websearch","edit","write","multiedit","apply_patch","codesearch"]);function BM($){let J=0;for(let Z of $.parts)try{J+=D0.estimate(JSON.stringify(Z))}catch{J+=1000}return J}function LG($){return $.parts.some((J)=>J.type==="text"||J.type==="reasoning")}function yG($){if($.length===0)return"";let J=$.findLastIndex((Q)=>Q.info.role==="assistant"&&Q.info.finish!==void 0);if(J<=0)return $[J>=0?J:0].info.id;let Z=$.map((Q)=>BM(Q)),Y=J-1,K=0,V=0;for(let Q=Y;Q<$.length;Q++)if(K+=Z[Q],LG($[Q]))V+=1;if(K>=wG)return $[Y].info.id;while(Y>0&&K<wG&&(K<UM||V<HM))if(Y-=1,K+=Z[Y],LG($[Y]))V+=1;return $[Y].info.id}import d7 from"fs/promises";import p7 from"path";async function bG($){if(!await Bun.file($).exists())await d7.mkdir(p7.dirname($),{recursive:!0}),await Bun.write($,TG)}async function vG($){if(!await Bun.file($).exists())await d7.mkdir(p7.dirname($),{recursive:!0}),await Bun.write($,kG)}async function hG($){if(!await Bun.file($).exists())await d7.mkdir(p7.dirname($),{recursive:!0}),await Bun.write($,xG)}function _M($){let J=Object.entries($);if(J.length===0)throw Error("CHECKPOINT_SECTION_BUDGETS is empty \u2014 F43 substitution would produce an empty prompt block");let Z=3,Y=["Section budgets (~tokens):"];for(let K=0;K<J.length;K+=Z){let V=J.slice(K,K+Z).map(([Q,G])=>`${Q}: ${G}`).join(" ");Y.push(` ${V}`)}return Y.join(`
7394
+ `)}async function LZ($){let J=await e.resolvePrompt("agent/checkpoint-writer");if(!J)throw Error("checkpoint-writer prompt unavailable from backend (agent/checkpoint-writer)");return[yJ({source:"checkpoint",trust:"session-state",posture:"system",body:["You are now operating in checkpoint-writer mode. Ignore the general coding-assistant framing in the system prompt above. The read, write, edit, glob, grep, and task tools are available; do not invoke others.","","========================================================================","ABSOLUTE PATHS \u2014 USE THESE VERBATIM. NEVER COMPUTE, INFER, OR MODIFY.","========================================================================","",`CHECKPOINT_PATH = ${$.checkpointFile}`,`MEMORY_PATH = ${$.memoryFile}`,`TASK_MEM_DIR = ${$.taskMemDir}`,`NOTES_PATH = ${$.notesFile}`,"","When using the Write tool, the first arg MUST be one of these literal","absolute paths (or for task narrative, TASK_MEM_DIR + '/' + task_id +","'/progress.md' or '/notes.md'). Do NOT abbreviate. Do NOT change","parent directories. Do NOT insert paths from memory of similar projects.","If you find yourself typing '/data/checkpoints/' as a parent, STOP \u2014 that","is the legacy v2 layout and is wrong. The current parent for the","checkpoint file is the directory portion of CHECKPOINT_PATH above.","========================================================================","",$.progressDiff,"",J.replace("{{SECTION_BUDGETS}}",_M(EG))].join(`
7395
7395
  `)}),"","Write the next checkpoint for this session.","",$.rangeDesc,"","Use the `task` tool for ALL task state ops (create / start / progress / done / abandon / approve / rename / block / unblock / batch_create). Use the Write tool for the checkpoint, memory, and task narrative files at the CHECKPOINT_PATH / MEMORY_PATH / TASK_MEM_DIR locations declared above. After all writes and tool calls, stop immediately."].join(`
7396
- `)}import d7 from"fs/promises";var g0=O$.create({service:"session.checkpoint.writer"});function GC($,J,Z){return G.gen(function*(){let Y=yield*$.messages({sessionID:J,agentID:"*"}),K=0,Q=0,V=0,X=0;for(let H of Y){if(H.info.role!=="assistant")continue;if(H.info.agentID!==Z)continue;X+=1;let q=H.info.tokens;if(!q)continue;K+=(q.input??0)+(q.cache?.read??0)+(q.cache?.write??0),Q+=q.cache?.read??0,V+=q.cache?.write??0}let W=K-Q-V,_=Q+Math.max(W,0),j=_>0?Q/_:0;return{total_input_tokens:K,cache_read_tokens:Q,cache_write_tokens:V,cache_hit_rate:j,num_llm_calls:X}})}function gX($,J){let{session:Z,config:Y,actorRegistry:K,bus:Q,scope:V}=J,X=G.fn("SessionCheckpoint.tryStartCheckpointWriter")(function*(j){let H=$.get(j.sessionID);if(H){if(H.pending)g0.info("writer pending evicted (newer range arrived)",{sessionID:j.sessionID});else g0.info("writer already running, queueing",{sessionID:j.sessionID});return H.pending=j,"queued"}if(yield*K.isSystemSpawned(j.sessionID,"main"))return g0.info("tryStartCheckpointWriter skipping system-spawned session"),"skipped";let q=yield*Z.get(j.sessionID),U=yield*w0.filterCompactedEffect(j.sessionID,{contextFrom:q.contextFrom,contextWatermark:q.contextWatermark,agentID:"main"});if(U.length===0)return g0.info("no messages, skipping checkpoint",{sessionID:j.sessionID}),"skipped";let z=SX(U),M=U.findIndex((Y$)=>Y$.info.id===z),I=zX(U.map((Y$)=>({role:Y$.info.role,id:Y$.info.id,content:Y$.parts.flatMap((g)=>g.type==="tool"?[{type:"tool_use",id:g.callID},{type:"tool_result",tool_use_id:g.callID}]:[])})),Math.max(M,0)),C=U[I]?.info.id??z,P=RZ()??U2.global,D=NZ(j.sessionID),L=EX.join(f$.Path.data,"memory","projects",P),R=Q1(j.sessionID),N=M8(P),x=EX.join(D,"tasks"),b=TZ(j.sessionID);yield*G.promise(()=>d7.mkdir(D,{recursive:!0})),yield*G.promise(()=>d7.mkdir(x,{recursive:!0})),yield*G.promise(()=>d7.mkdir(L,{recursive:!0})),yield*G.promise(()=>yZ(P)),yield*G.promise(()=>yX(R)),yield*G.promise(()=>TX(N)),yield*G.promise(()=>kX(b));let v=yield*G.promise(()=>Bun.file(R).exists()),m=yield*G.promise(()=>Bun.file(N).exists()),A=v?[`Previous checkpoint: ${R}`,m?`Previous memory: ${N}`:"","Read BOTH the prior checkpoint (to dedupe Discovered/Dead-end titles AND to carry forward Live Resources, Execution-context frames, and Session-metadata fields that are still alive) AND the prior memory (project memory) before writing yours."].filter((Y$)=>Y$.length>0).join(`
7397
- `):"This is the first checkpoint of this session. No prior checkpoint exists; MEMORY.md and the task narrative directory likely don't exist yet either.",u=yield*G.promise(()=>DX(j.sessionID)),r=yield*G.promise(()=>LZ({checkpointFile:R,memoryFile:N,taskMemDir:x,notesFile:b,rangeDesc:A,progressDiff:u})),S=SZ.current;if(!S)return g0.warn("tryStartCheckpointWriter skipping \u2014 Actor service unavailable",{sessionID:j.sessionID}),"skipped";let k=(yield*Y.get()).checkpoint?.fork??!1,s=(yield*G.sync(()=>z$.use((Y$)=>Y$.select({last:V0.last_checkpoint_message_id}).from(V0).where(G$(V0.id,j.sessionID)).get())).pipe(G.catch(()=>G.succeed(void 0))))?.last??void 0,J$=U.findIndex((Y$)=>Y$.info.id===C);if(J$<0)return g0.warn("tryStartCheckpointWriter: watermark message not found, skipping",{sessionID:j.sessionID,endMessageID:C}),"skipped";let Z$=s?U.findIndex((Y$)=>Y$.info.id===s):-1,W$=Z$>=0?Z$+1:0,y$=CX(U.map((Y$)=>({info:{role:Y$.info.role},parts:Y$.parts})),W$),Q$=k?[]:U.slice(y$,J$+1);if(!k&&Q$.length===0)return g0.warn("tryStartCheckpointWriter: empty delta under fork:false, skipping",{sessionID:j.sessionID,endMessageID:C,lastCheckpointMessageID:s}),"skipped";let y=qX.current;if(!y)g0.warn("tryStartCheckpointWriter: prefixCaptureRef not set, spawning without forkContext",{sessionID:j.sessionID});let n=yield*y?G.gen(function*(){let g=U[J$].info.agent;if(k){if(!g){g0.warn("tryStartCheckpointWriter: watermark has no agent, fork:true requires parent agent \u2014 falling back to no forkContext",{sessionID:j.sessionID,endMessageID:C});return}let C$=U.slice(0,J$+1),T$=yield*y({sessionID:j.sessionID,agentName:g,providerID:j.model.providerID,modelID:j.model.modelID,msgs:C$});return{system:T$.system,tools:T$.tools,inheritedMessages:T$.inheritedMessages,parentPermission:T$.parentPermission,watermarkMsgID:C,model:{providerID:j.model.providerID,modelID:j.model.modelID}}}let t=yield*y({sessionID:j.sessionID,agentName:"checkpoint-writer",providerID:j.model.providerID,modelID:j.model.modelID,msgs:Q$});return{system:t.system,tools:t.tools,inheritedMessages:t.inheritedMessages,parentPermission:t.parentPermission,watermarkMsgID:C,model:{providerID:j.model.providerID,modelID:j.model.modelID}}}):G.succeed(void 0),a=yield*Z.create({parentID:j.sessionID,title:`checkpoint-writer: ${A}`});g0.info("tryStartCheckpointWriter spawning",{sessionID:j.sessionID,childSessionID:a.id,mode:k?"fork":"no-fork",inheritedMessageCount:n?.inheritedMessages?.length??0,rangeDesc:A});let c$=yield*S.spawn({mode:"subagent",sessionID:a.id,parentSessionID:j.sessionID,agentType:"checkpoint-writer",description:`checkpoint writer for session ${j.sessionID} covering ${A}`,task:r,context:"full",tools:["read","write","edit","apply_patch","glob","grep","task"],model:{providerID:j.model.providerID,modelID:j.model.modelID},background:!0,forkContext:n}),l=c$.actorID;j.onStarted?.(c$.outcome);let d=yield*G.promise(()=>xX(j.sessionID));return bX(j.sessionID,l,{priorTitles:d,expectedRevisions:[]}),$.set(j.sessionID,{writing:c$.outcome}),yield*G.gen(function*(){let Y$=yield*B0.await(c$.outcome);yield*G.sync(()=>z$.use((C$)=>C$.update(V0).set({last_checkpoint_message_id:C}).where(G$(V0.id,j.sessionID)).run()));let g=$.get(j.sessionID)?.pending;$.delete(j.sessionID);let t=yield*GC(Z,j.sessionID,c$.actorID).pipe(G.catch(()=>G.succeed({total_input_tokens:0,cache_read_tokens:0,cache_write_tokens:0,cache_hit_rate:0,num_llm_calls:0})));if(yield*Q.publish(hX,{sessionID:j.sessionID,writerActorID:c$.actorID,status:Y$.status==="success"?"completed":"failed",...t}).pipe(G.ignore),g)g0.info("draining pending writer",{sessionID:j.sessionID}),yield*X(g).pipe(G.ignore)}).pipe(G.ensuring(G.sync(()=>vX(j.sessionID,l))),G.forkIn(V)),"started"}),W=G.fn("SessionCheckpoint.waitForWriter")(function*(j){let H=$.get(j);if(!H)return"no-writer";return(yield*B0.await(H.writing).pipe(G.timeout(300000),G.catch(()=>G.succeed({status:"failure",error:"timeout"})))).status==="success"?"success":"failure"}),_=G.fn("SessionCheckpoint.drainWriters")(function*(j){let H=j?.timeoutMs??120000,q=[...$.values()];if(q.length===0)return{drained:0,timedOut:0};g0.info("draining checkpoint writers before shutdown",{count:q.length,timeoutMs:H}),yield*G.all(q.map((M)=>B0.await(M.writing)),{concurrency:"unbounded"}).pipe(G.timeout(H),G.catch(()=>G.succeed(void 0)));let U=$.size,z=q.length-U;if(U>0)g0.warn("drain timed out, writers still pending",{drained:z,timedOut:U});else g0.info("drain complete",{drained:z});return{drained:z,timedOut:U}});return{tryStartCheckpointWriter:X,waitForWriter:W,drainWriters:_}}import p7 from"path";async function fX($,J){let Z=await Bun.file($).text().catch(()=>{return});if(Z===void 0)return;let Y=D0.estimate(Z);if(Y<=J)return{done:{text:Z,truncated:!1,totalTokens:Y}};return{fullText:Z,totalTokens:Y}}async function mX($,J){let Z=await fX($,J);if(Z===void 0)return;if("done"in Z)return Z.done;let{fullText:Y,totalTokens:K}=Z,Q=J/K,V=Y.slice(0,Math.floor(Y.length*Q*0.95)),X=V.lastIndexOf(`
7398
- `),W=X>0?V.slice(0,X):V,_=W.split(`
7396
+ `)}import c7 from"fs/promises";var g0=O$.create({service:"session.checkpoint.writer"});function OM($,J,Z){return X.gen(function*(){let Y=yield*$.messages({sessionID:J,agentID:"*"}),K=0,V=0,Q=0,G=0;for(let B of Y){if(B.info.role!=="assistant")continue;if(B.info.agentID!==Z)continue;G+=1;let q=B.info.tokens;if(!q)continue;K+=(q.input??0)+(q.cache?.read??0)+(q.cache?.write??0),V+=q.cache?.read??0,Q+=q.cache?.write??0}let W=K-V-Q,_=V+Math.max(W,0),j=_>0?V/_:0;return{total_input_tokens:K,cache_read_tokens:V,cache_write_tokens:Q,cache_hit_rate:j,num_llm_calls:G}})}function pG($,J){let{session:Z,config:Y,actorRegistry:K,bus:V,scope:Q}=J,G=X.fn("SessionCheckpoint.tryStartCheckpointWriter")(function*(j){let B=$.get(j.sessionID);if(B){if(B.pending)g0.info("writer pending evicted (newer range arrived)",{sessionID:j.sessionID});else g0.info("writer already running, queueing",{sessionID:j.sessionID});return B.pending=j,"queued"}if(yield*K.isSystemSpawned(j.sessionID,"main"))return g0.info("tryStartCheckpointWriter skipping system-spawned session"),"skipped";let q=yield*Z.get(j.sessionID),U=yield*R0.filterCompactedEffect(j.sessionID,{contextFrom:q.contextFrom,contextWatermark:q.contextWatermark,agentID:"main"});if(U.length===0)return g0.info("no messages, skipping checkpoint",{sessionID:j.sessionID}),"skipped";let z=yG(U),C=U.findIndex((Y$)=>Y$.info.id===z),D=IG(U.map((Y$)=>({role:Y$.info.role,id:Y$.info.id,content:Y$.parts.flatMap((g)=>g.type==="tool"?[{type:"tool_use",id:g.callID},{type:"tool_result",tool_use_id:g.callID}]:[])})),Math.max(C,0)),M=U[D]?.info.id??z,I=wZ()??U2.global,P=NZ(j.sessionID),L=gG.join(f$.Path.data,"memory","projects",I),w=V1(j.sessionID),N=C8(I),x=gG.join(P,"tasks"),b=TZ(j.sessionID);yield*X.promise(()=>c7.mkdir(P,{recursive:!0})),yield*X.promise(()=>c7.mkdir(x,{recursive:!0})),yield*X.promise(()=>c7.mkdir(L,{recursive:!0})),yield*X.promise(()=>yZ(I)),yield*X.promise(()=>bG(w)),yield*X.promise(()=>vG(N)),yield*X.promise(()=>hG(b));let v=yield*X.promise(()=>Bun.file(w).exists()),m=yield*X.promise(()=>Bun.file(N).exists()),A=v?[`Previous checkpoint: ${w}`,m?`Previous memory: ${N}`:"","Read BOTH the prior checkpoint (to dedupe Discovered/Dead-end titles AND to carry forward Live Resources, Execution-context frames, and Session-metadata fields that are still alive) AND the prior memory (project memory) before writing yours."].filter((Y$)=>Y$.length>0).join(`
7397
+ `):"This is the first checkpoint of this session. No prior checkpoint exists; MEMORY.md and the task narrative directory likely don't exist yet either.",u=yield*X.promise(()=>RG(j.sessionID)),r=yield*X.promise(()=>LZ({checkpointFile:w,memoryFile:N,taskMemDir:x,notesFile:b,rangeDesc:A,progressDiff:u})),S=SZ.current;if(!S)return g0.warn("tryStartCheckpointWriter skipping \u2014 Actor service unavailable",{sessionID:j.sessionID}),"skipped";let k=(yield*Y.get()).checkpoint?.fork??!1,s=(yield*X.sync(()=>z$.use((Y$)=>Y$.select({last:Q0.last_checkpoint_message_id}).from(Q0).where(X$(Q0.id,j.sessionID)).get())).pipe(X.catch(()=>X.succeed(void 0))))?.last??void 0,J$=U.findIndex((Y$)=>Y$.info.id===M);if(J$<0)return g0.warn("tryStartCheckpointWriter: watermark message not found, skipping",{sessionID:j.sessionID,endMessageID:M}),"skipped";let Z$=s?U.findIndex((Y$)=>Y$.info.id===s):-1,W$=Z$>=0?Z$+1:0,y$=AG(U.map((Y$)=>({info:{role:Y$.info.role},parts:Y$.parts})),W$),V$=k?[]:U.slice(y$,J$+1);if(!k&&V$.length===0)return g0.warn("tryStartCheckpointWriter: empty delta under fork:false, skipping",{sessionID:j.sessionID,endMessageID:M,lastCheckpointMessageID:s}),"skipped";let y=DG.current;if(!y)g0.warn("tryStartCheckpointWriter: prefixCaptureRef not set, spawning without forkContext",{sessionID:j.sessionID});let n=yield*y?X.gen(function*(){let g=U[J$].info.agent;if(k){if(!g){g0.warn("tryStartCheckpointWriter: watermark has no agent, fork:true requires parent agent \u2014 falling back to no forkContext",{sessionID:j.sessionID,endMessageID:M});return}let M$=U.slice(0,J$+1),T$=yield*y({sessionID:j.sessionID,agentName:g,providerID:j.model.providerID,modelID:j.model.modelID,msgs:M$});return{system:T$.system,tools:T$.tools,inheritedMessages:T$.inheritedMessages,parentPermission:T$.parentPermission,watermarkMsgID:M,model:{providerID:j.model.providerID,modelID:j.model.modelID}}}let t=yield*y({sessionID:j.sessionID,agentName:"checkpoint-writer",providerID:j.model.providerID,modelID:j.model.modelID,msgs:V$});return{system:t.system,tools:t.tools,inheritedMessages:t.inheritedMessages,parentPermission:t.parentPermission,watermarkMsgID:M,model:{providerID:j.model.providerID,modelID:j.model.modelID}}}):X.succeed(void 0),a=yield*Z.create({parentID:j.sessionID,title:`checkpoint-writer: ${A}`});g0.info("tryStartCheckpointWriter spawning",{sessionID:j.sessionID,childSessionID:a.id,mode:k?"fork":"no-fork",inheritedMessageCount:n?.inheritedMessages?.length??0,rangeDesc:A});let c$=yield*S.spawn({mode:"subagent",sessionID:a.id,parentSessionID:j.sessionID,agentType:"checkpoint-writer",description:`checkpoint writer for session ${j.sessionID} covering ${A}`,task:r,context:"full",tools:["read","write","edit","apply_patch","glob","grep","task"],model:{providerID:j.model.providerID,modelID:j.model.modelID},background:!0,forkContext:n}),l=c$.actorID;j.onStarted?.(c$.outcome);let d=yield*X.promise(()=>fG(j.sessionID));return mG(j.sessionID,l,{priorTitles:d,expectedRevisions:[]}),$.set(j.sessionID,{writing:c$.outcome}),yield*X.gen(function*(){let Y$=yield*H0.await(c$.outcome);yield*X.sync(()=>z$.use((M$)=>M$.update(Q0).set({last_checkpoint_message_id:M}).where(X$(Q0.id,j.sessionID)).run()));let g=$.get(j.sessionID)?.pending;$.delete(j.sessionID);let t=yield*OM(Z,j.sessionID,c$.actorID).pipe(X.catch(()=>X.succeed({total_input_tokens:0,cache_read_tokens:0,cache_write_tokens:0,cache_hit_rate:0,num_llm_calls:0})));if(yield*V.publish(dG,{sessionID:j.sessionID,writerActorID:c$.actorID,status:Y$.status==="success"?"completed":"failed",...t}).pipe(X.ignore),g)g0.info("draining pending writer",{sessionID:j.sessionID}),yield*G(g).pipe(X.ignore)}).pipe(X.ensuring(X.sync(()=>uG(j.sessionID,l))),X.forkIn(Q)),"started"}),W=X.fn("SessionCheckpoint.waitForWriter")(function*(j){let B=$.get(j);if(!B)return"no-writer";return(yield*H0.await(B.writing).pipe(X.timeout(300000),X.catch(()=>X.succeed({status:"failure",error:"timeout"})))).status==="success"?"success":"failure"}),_=X.fn("SessionCheckpoint.drainWriters")(function*(j){let B=j?.timeoutMs??120000,q=[...$.values()];if(q.length===0)return{drained:0,timedOut:0};g0.info("draining checkpoint writers before shutdown",{count:q.length,timeoutMs:B}),yield*X.all(q.map((C)=>H0.await(C.writing)),{concurrency:"unbounded"}).pipe(X.timeout(B),X.catch(()=>X.succeed(void 0)));let U=$.size,z=q.length-U;if(U>0)g0.warn("drain timed out, writers still pending",{drained:z,timedOut:U});else g0.info("drain complete",{drained:z});return{drained:z,timedOut:U}});return{tryStartCheckpointWriter:G,waitForWriter:W,drainWriters:_}}import l7 from"path";async function cG($,J){let Z=await Bun.file($).text().catch(()=>{return});if(Z===void 0)return;let Y=D0.estimate(Z);if(Y<=J)return{done:{text:Z,truncated:!1,totalTokens:Y}};return{fullText:Z,totalTokens:Y}}async function lG($,J){let Z=await cG($,J);if(Z===void 0)return;if("done"in Z)return Z.done;let{fullText:Y,totalTokens:K}=Z,V=J/K,Q=Y.slice(0,Math.floor(Y.length*V*0.95)),G=Q.lastIndexOf(`
7398
+ `),W=G>0?Q.slice(0,G):Q,_=W.split(`
7399
7399
  `).length+1,j=`
7400
7400
 
7401
- \u26A0\uFE0F Truncated at ~${J} tokens. ${$} is ~${K} tokens total. Read("${$}", offset=${_}) for the rest.`;return{text:W+j,truncated:!0,totalTokens:K}}function XC($){let J=[],Z=[],Y=null,K=!1;for(let Q of $.split(`
7402
- `)){if(Q.startsWith("## ")){if(Y)Z.push(Y);Y={header:Q,italic:"",body:[],indexLines:[]},K=!1;continue}if(Y){if(!K&&Q.startsWith("_")&&Q.endsWith("_")){Y.italic=Q,K=!0;continue}if(/^- See \S+\.md \(\d+/.test(Q.trim()))Y.indexLines.push(Q);Y.body.push(Q)}else J.push(Q)}if(Y)Z.push(Y);return{preamble:J,sections:Z}}async function kZ($,J){let Z=await fX($,J);if(Z===void 0)return;if("done"in Z)return Z.done;let{fullText:Y,totalTokens:K}=Z,{preamble:Q,sections:V}=XC(Y);if(D0.estimate([...Q,...V.flatMap((H)=>[H.header,H.italic,...H.indexLines])].join(`
7403
- `))>=J){let H=[...Q,...V.flatMap((U)=>[U.header,U.italic,...U.indexLines,""])].join(`
7401
+ \u26A0\uFE0F Truncated at ~${J} tokens. ${$} is ~${K} tokens total. Read("${$}", offset=${_}) for the rest.`;return{text:W+j,truncated:!0,totalTokens:K}}function qM($){let J=[],Z=[],Y=null,K=!1;for(let V of $.split(`
7402
+ `)){if(V.startsWith("## ")){if(Y)Z.push(Y);Y={header:V,italic:"",body:[],indexLines:[]},K=!1;continue}if(Y){if(!K&&V.startsWith("_")&&V.endsWith("_")){Y.italic=V,K=!0;continue}if(/^- See \S+\.md \(\d+/.test(V.trim()))Y.indexLines.push(V);Y.body.push(V)}else J.push(V)}if(Y)Z.push(Y);return{preamble:J,sections:Z}}async function kZ($,J){let Z=await cG($,J);if(Z===void 0)return;if("done"in Z)return Z.done;let{fullText:Y,totalTokens:K}=Z,{preamble:V,sections:Q}=qM(Y);if(D0.estimate([...V,...Q.flatMap((B)=>[B.header,B.italic,...B.indexLines])].join(`
7403
+ `))>=J){let B=[...V,...Q.flatMap((U)=>[U.header,U.italic,...U.indexLines,""])].join(`
7404
7404
  `),q=`
7405
7405
 
7406
7406
  \u26A0\uFE0F File extremely large (${K} tokens vs budget ${J}). Only structure shown.
7407
- Read("${$}") for full content.`;return{text:H+q,truncated:!0,totalTokens:K}}let W=[...Q],_=D0.estimate(W.join(`
7408
- `));for(let H of V){_+=D0.estimate([H.header,H.italic,...H.indexLines].join(`
7409
- `)),W.push(H.header,H.italic,...H.indexLines);let q=new Set(H.indexLines),U=H.body.filter((M)=>!q.has(M)).join(`
7410
- `),z=D0.estimate(U);if(_+z<=J)W.push(U),_+=z;else{let M=J-_;if(M>50){let I=Math.floor(U.length*(M/z)*0.95);W.push(U.slice(0,I)),_+=M}}W.push("")}let j=`
7407
+ Read("${$}") for full content.`;return{text:B+q,truncated:!0,totalTokens:K}}let W=[...V],_=D0.estimate(W.join(`
7408
+ `));for(let B of Q){_+=D0.estimate([B.header,B.italic,...B.indexLines].join(`
7409
+ `)),W.push(B.header,B.italic,...B.indexLines);let q=new Set(B.indexLines),U=B.body.filter((C)=>!q.has(C)).join(`
7410
+ `),z=D0.estimate(U);if(_+z<=J)W.push(U),_+=z;else{let C=J-_;if(C>50){let D=Math.floor(U.length*(C/z)*0.95);W.push(U.slice(0,D)),_+=C}}W.push("")}let j=`
7411
7411
 
7412
7412
  \u26A0\uFE0F Truncated at ~${J} tokens. ${$} is ~${K} tokens total. Read("${$}") for full content.`;return{text:W.join(`
7413
- `)+j,truncated:!0,totalTokens:K}}function WC($,J){if($.length<=J)return $;let Z=`
7414
- ... (truncated, full body at file)`;if(J<=0)return"";if(J<=Z.length)return Z.slice(0,J);return $.slice(0,J-Z.length)+Z}function jC($,J,Z){if(D0.estimate($)<=J)return $;let Y=$.slice(0,Math.floor(J*0.6)*4).replace(/[\uD800-\uDBFF]$/,""),K=Math.floor(J*0.3)*4,Q=(K>0?$.slice(-K):"").replace(/^[\uDC00-\uDFFF]/,""),V=Math.max(0,D0.estimate($)-D0.estimate(Y)-D0.estimate(Q));return[Y,`[\u2026elided ${V} tokens; messageID=${Z}; use the history tool with operation=around to fetch full content]`,Q].join(`
7415
- `)}function UC($){return $.filter((J)=>J.type==="text"&&!J.synthetic&&typeof J.text==="string"&&J.text.length>0).map((J)=>J.text).join(`
7416
- `)}function BC(){return yJ({source:"checkpoint",trust:"runtime-safety",body:["You are mid-loop in an autonomous task. Continue your work loop:","respond to the tool results below and proceed to the next iteration."].join(`
7417
- `)})}function HC($){let J=$?`Consult this session's tasks/${$}/progress.md head section.`:"Consult the most recently active task's progress.md head section.";return yJ({source:"checkpoint",trust:"runtime-safety",body:["The previous assistant turn ended with a stop. Before stopping again,",J,"Compare the Task spec to the latest Progress entries. If the task is","incomplete, proceed to the next concrete step. Only stop when the spec","is genuinely satisfied or you need user input you cannot infer."].join(`
7418
- `)})}function _C(){return yJ({source:"tool-result",trust:"runtime-safety",body:["Tool results above are real history from the autonomous loop. Process","them and continue to the next iteration. Do not pause to summarize."].join(`
7419
- `)})}var EZ=O$.create({service:"session.checkpoint.renderer"});function uX($,J){let{session:Z,config:Y,memory:K,taskRegistry:Q,actorRegistry:V}=J,X=G.fn("SessionCheckpoint.renderIndex")(function*(j){let H=Q1(j);if(!(yield*G.promise(()=>Bun.file(H).exists())))return"No checkpoints yet for this session.";let z=(yield*G.promise(()=>Bun.file(H).text().catch(()=>""))).match(/^Topic:\s*(.+)$/m),M=z?z[1].trim():"(unknown)",I=NZ(j),C=[];return C.push("## Checkpoint"),C.push(""),C.push(`Directory: ${I}/`),C.push(""),C.push(`Current checkpoint (${M}): checkpoint.md [shown below]`),C.push(""),C.push(`Use read("${H}") to access the full checkpoint.`),C.join(`
7420
- `)}),W=G.fn("SessionCheckpoint.renderRebuildContext")(function*(j,H){if(H?.agentID&&H.agentID!=="main")return"";let q=$.get(j);if(q)EZ.info("rebuild waiting for in-flight writer",{sessionID:j}),yield*G.race(B0.await(q.writing).pipe(G.as("done")),G.sleep("60 seconds").pipe(G.tap(()=>G.sync(()=>EZ.warn("writer wait timeout \u2014 using on-disk checkpoint",{sessionID:j}))),G.as("timeout"))).pipe(G.catch(()=>G.succeed("error")));let z=(yield*Y.get()).checkpoint?.push_caps??{},M=RZ(),I=M??U2.global,C=yield*Q.list({session_id:j,include_terminal:!0}),D=(yield*G.promise(()=>kZ(Q1(j),z.checkpoint??11000)))?.text??"";yield*G.promise(()=>yZ(I));let R=(yield*G.promise(()=>kZ(M8(I),z.memory??1e4)))?.text??"",x=(yield*G.promise(()=>mX(TZ(j),z.notes??6000)))?.text??"",v=(yield*G.promise(()=>kZ(c7(),z.global??6000)))?.text??"",m=yield*V.listActive(),A=z.recent_user??16000,u=z.recent_user_per_msg??2000,r=[];if(A>0){let W$=w0.page({sessionID:j,agentID:"main",limit:200}).items.filter((Q$)=>Q$.info.role==="user"&&!Q$.parts.some((y)=>y.type==="tool"||y.type==="checkpoint"||y.type==="compaction")),y$=A;for(let Q$=W$.length-1;Q$>=0;Q$--){let y=UC(W$[Q$].parts);if(!y.trim())continue;let n=jC(y,u,W$[Q$].info.id),a=D0.estimate(n);if(y$-a<0)break;r.unshift(n),y$-=a}}if(C.length===0&&!D.trim()&&!R.trim()&&!v.trim()&&m.length===0&&r.length===0)return"";let S=[];if(S.push("The following blocks are auto-loaded from your session memory. They are already in your context \u2014 do not Read them as whole files. Use Grep for specific facts instead."),S.push(""),S.push("## Tasks ledger"),C.length===0)S.push("(none)");else{let W$=C.filter((n)=>!n.parent_task_id),y$=new Map;for(let n of C){if(!n.parent_task_id)continue;let a=y$.get(n.parent_task_id)??[];a.push(n),y$.set(n.parent_task_id,a)}let Q$=(n)=>({open:"\uD83D\uDD35",in_progress:"\uD83D\uDD04",blocked:"\uD83D\uDFE1",done:"\u2705",abandoned:"\u274C"})[n]??n,y=[];for(let n of W$){y.push(`- ${n.id} ${n.status} \u2014 ${n.summary}`);let a=y$.get(n.id)??[];if(a.length===0)continue;let c$=a.map((l)=>`${Q$(l.status)}${l.id}`).join(" / ");y.push(` Subtasks: ${c$}`)}S.push(WC(y.join(`
7421
- `),z.tasks_ledger??2000))}if(S.push(""),D.trim())S.push("## Session checkpoint"),S.push(D.trim()),S.push("");if(m.length>0){S.push("## Active actors");let W$=z.actor_ledger??500;for(let y$ of m){let Q$=`- ${y$.actorID} \u2014 ${y$.status}, "${y$.description}" (agent=${y$.agent})`,y=D0.estimate(Q$);if(W$-y<0)break;S.push(Q$),W$-=y}S.push("")}if(r.length>0)S.push("## Recent user input (verbatim)"),S.push(...r),S.push("");if(R.trim())S.push("## Project memory"),S.push(R.trim()),S.push("");if(v.trim())S.push("## Global memory"),S.push(v.trim()),S.push("");if(x.trim())S.push("## Session notes"),S.push(x.trim()),S.push("");yield*K.reconcile().pipe(G.ignore);let T=new Set([M8(I),Q1(j),c7()].filter((W$)=>W$.length>0)),k=M&&M!==U2.global?NJ(G$(q0.scope,"global"),_0(G$(q0.scope,"sessions"),G$(q0.scope_id,j)),_0(G$(q0.scope,"projects"),G$(q0.scope_id,M))):NJ(G$(q0.scope,"global"),_0(G$(q0.scope,"sessions"),G$(q0.scope_id,j))),A$=yield*G.sync(()=>z$.use((W$)=>W$.select({path:q0.path}).from(q0).where(k).all())),s=yield*K.root(),J$=A$.map((W$)=>W$.path).filter((W$)=>!T.has(W$)&&!W$.includes(`${p7.sep}checkpoint${p7.sep}learning-`)).map((W$)=>W$.replace(s+p7.sep,""));if(J$.length>0){S.push("## Memory keys index");let W$=z.memory_titles??500;for(let y$ of J$){let Q$=D0.estimate(y$);if(W$-Q$<0)break;S.push(`- ${y$}`),W$-=Q$}S.push("")}S.push(""),S.push("This session is being continued from a previous conversation that hit a checkpoint. The session checkpoint and project memory above cover the earlier portion of the conversation."),S.push(""),S.push("Recent messages are preserved verbatim below \u2014 the assistant turn (and any tool results) you'll see is real history, not pseudo-content. Continue your task by responding to the most recent state."),S.push(""),S.push(`Resume directly. Do not acknowledge this memory dump, do not recap, do not preface with "I'll continue" or similar. Pick up the last task as if the break never happened.`);let Z$=H?.lastMessageInfo;if(Z$){let W$=(()=>{switch(Z$.role){case"assistant":if(Z$.finish==="tool-calls")return BC();return HC(void 0);case"tool":return _C();case"user":return""}})();if(W$)S.push(""),S.push(W$)}return S.join(`
7422
- `)}),_=G.fn("SessionCheckpoint.insertRebuildBoundary")(function*(j){let H=yield*W(j.sessionID,{lastMessageInfo:j.lastMessageInfo,agentID:j.agentID}).pipe(G.catch(()=>G.succeed("")));if(!H)return!1;let q=yield*X(j.sessionID).pipe(G.catch(()=>G.succeed(""))),U=(j.boundaryCreatedAt??Date.now())+1,z=yield*Z.updateMessage({id:IJ.ascending(),role:"user",model:{providerID:j.model.providerID,modelID:j.model.modelID},sessionID:j.sessionID,agent:j.agent,time:{created:U}});if(yield*Z.updatePart({id:f2.ascending(),messageID:z.id,sessionID:j.sessionID,type:"checkpoint",checkpointDir:"",checkpointNumber:0,coveredUpTo:j.boundary}),q)yield*Z.updatePart({id:f2.ascending(),messageID:z.id,sessionID:j.sessionID,type:"text",synthetic:!0,text:q});yield*Z.updatePart({id:f2.ascending(),messageID:z.id,sessionID:j.sessionID,type:"text",synthetic:!0,text:H});let M=yield*V.renderForAgent(j.sessionID).pipe(G.catch(()=>G.succeed("")));if(M)yield*Z.updatePart({id:f2.ascending(),messageID:z.id,sessionID:j.sessionID,type:"text",synthetic:!0,text:M});let I=yield*Z.messages({sessionID:j.sessionID,agentID:"*"}),C=j.boundaryCreatedAt??I.find((D)=>D.info.id===j.boundary)?.info.time.created;if(C===void 0)return EZ.warn("microcompact skipped: no boundary timestamp available",{sessionID:j.sessionID,boundary:j.boundary}),!0;let P=0;for(let D of I){if(D.info.id===z.id)continue;if(D.info.time.created<=C)continue;for(let L of D.parts){if(L.type!=="tool")continue;if(!AX.has(L.tool))continue;if(L.state.status!=="completed")continue;if(L.state.time.compacted)continue;L.state.time.compacted=Date.now(),yield*Z.updatePart(L),P+=1}}if(P>0)EZ.info("rebuild microcompact",{sessionID:j.sessionID,cleared:P});return!0});return{renderIndex:X,renderRebuildContext:W,insertRebuildBoundary:_}}class D8 extends D$.Service()("@qitqode/SessionCheckpoint"){}var dX=f.effect(D8,G.gen(function*(){let $=yield*cX,J=yield*R$.Service,Z=yield*g1.Service,Y=yield*K1.Service,K=yield*L1.Service,Q=yield*P$.Service,V=yield*UJ.Scope,X=new Map,W=gX(X,{session:$,config:J,actorRegistry:K,bus:Q,scope:V}),_=uX(X,{session:$,config:J,memory:Z,taskRegistry:Y,actorRegistry:K}),{tryStartCheckpointWriter:j,waitForWriter:H,drainWriters:q}=W,{renderIndex:U,renderRebuildContext:z,insertRebuildBoundary:M}=_,I=G.fn("SessionCheckpoint.hasCheckpoint")(function*(N){return yield*G.promise(()=>Bun.file(Q1(N)).exists())}),C=G.fn("SessionCheckpoint.hasMemoryOrTasks")(function*(N){let x=yield*Z.root(),b=OC.join(x,"sessions",N);if((yield*G.promise(()=>qC.readdir(b).catch(()=>[]))).length>0)return!0;return(yield*Y.list({session_id:N,include_terminal:!0})).length>0}),P=G.fn("SessionCheckpoint.loadLatest")(function*(N){return(yield*G.promise(()=>Bun.file(Q1(N)).text().catch(()=>"")))||void 0}),D=G.fn("SessionCheckpoint.loadCheckpoints")(function*(N,x){let b=yield*G.promise(()=>Bun.file(Q1(N)).text().catch(()=>""));return b?[b]:[]}),L=G.fn("SessionCheckpoint.lastBoundary")(function*(N){return(yield*G.sync(()=>z$.use((b)=>b.select({last_checkpoint_message_id:V0.last_checkpoint_message_id}).from(V0).where(G$(V0.id,N)).get())))?.last_checkpoint_message_id}),R=G.fn("SessionCheckpoint.isWriterRunning")(function*(N){return X.has(N)});return D8.of({tryStartCheckpointWriter:j,waitForWriter:H,drainWriters:q,hasCheckpoint:I,hasMemoryOrTasks:C,loadLatest:P,loadCheckpoints:D,renderIndex:U,renderRebuildContext:z,lastBoundary:L,isWriterRunning:R,insertRebuildBoundary:M})})),pX=f.suspend(()=>dX.pipe(f.provide(lX),f.provide(P$.layer),f.provide(R$.defaultLayer),f.provide(g1.defaultLayer),f.provide(K1.defaultLayer),f.provide(L1.defaultLayer))),{runPromise:l2}=HZ(D8,pX);function FC($){return l2((J)=>J.hasCheckpoint($.sessionID))}function zC($){return l2((J)=>J.loadLatest($.sessionID))}function CC($){return l2((J)=>J.loadCheckpoints($.sessionID,$.count))}function MC($){return l2((J)=>J.renderIndex($.sessionID))}function DC($){return l2((J)=>J.renderRebuildContext($.sessionID,{lastMessageInfo:$.lastMessageInfo,agentID:$.agentID}))}function PC($){return l2((J)=>J.lastBoundary($.sessionID))}function IC($){return l2((J)=>J.isWriterRunning($.sessionID))}var Ax={current:void 0},oX={current:void 0};var AC="actor",rX=["run","spawn","status","wait","cancel","send"];function P8($,J,Z,Y){return G.fail({kind:"arity",line:Y,detail:`actor: ${$}: arity mismatch
7413
+ `)+j,truncated:!0,totalTokens:K}}function FM($,J){if($.length<=J)return $;let Z=`
7414
+ ... (truncated, full body at file)`;if(J<=0)return"";if(J<=Z.length)return Z.slice(0,J);return $.slice(0,J-Z.length)+Z}function zM($,J,Z){if(D0.estimate($)<=J)return $;let Y=$.slice(0,Math.floor(J*0.6)*4).replace(/[\uD800-\uDBFF]$/,""),K=Math.floor(J*0.3)*4,V=(K>0?$.slice(-K):"").replace(/^[\uDC00-\uDFFF]/,""),Q=Math.max(0,D0.estimate($)-D0.estimate(Y)-D0.estimate(V));return[Y,`[\u2026elided ${Q} tokens; messageID=${Z}; use the history tool with operation=around to fetch full content]`,V].join(`
7415
+ `)}function MM($){return $.filter((J)=>J.type==="text"&&!J.synthetic&&typeof J.text==="string"&&J.text.length>0).map((J)=>J.text).join(`
7416
+ `)}function CM(){return yJ({source:"checkpoint",trust:"runtime-safety",body:["You are mid-loop in an autonomous task. Continue your work loop:","respond to the tool results below and proceed to the next iteration."].join(`
7417
+ `)})}function DM($){let J=$?`Consult this session's tasks/${$}/progress.md head section.`:"Consult the most recently active task's progress.md head section.";return yJ({source:"checkpoint",trust:"runtime-safety",body:["The previous assistant turn ended with a stop. Before stopping again,",J,"Compare the Task spec to the latest Progress entries. If the task is","incomplete, proceed to the next concrete step. Only stop when the spec","is genuinely satisfied or you need user input you cannot infer."].join(`
7418
+ `)})}function PM(){return yJ({source:"tool-result",trust:"runtime-safety",body:["Tool results above are real history from the autonomous loop. Process","them and continue to the next iteration. Do not pause to summarize."].join(`
7419
+ `)})}var EZ=O$.create({service:"session.checkpoint.renderer"});function oG($,J){let{session:Z,config:Y,memory:K,taskRegistry:V,actorRegistry:Q}=J,G=X.fn("SessionCheckpoint.renderIndex")(function*(j){let B=V1(j);if(!(yield*X.promise(()=>Bun.file(B).exists())))return"No checkpoints yet for this session.";let z=(yield*X.promise(()=>Bun.file(B).text().catch(()=>""))).match(/^Topic:\s*(.+)$/m),C=z?z[1].trim():"(unknown)",D=NZ(j),M=[];return M.push("## Checkpoint"),M.push(""),M.push(`Directory: ${D}/`),M.push(""),M.push(`Current checkpoint (${C}): checkpoint.md [shown below]`),M.push(""),M.push(`Use read("${B}") to access the full checkpoint.`),M.join(`
7420
+ `)}),W=X.fn("SessionCheckpoint.renderRebuildContext")(function*(j,B){if(B?.agentID&&B.agentID!=="main")return"";let q=$.get(j);if(q)EZ.info("rebuild waiting for in-flight writer",{sessionID:j}),yield*X.race(H0.await(q.writing).pipe(X.as("done")),X.sleep("60 seconds").pipe(X.tap(()=>X.sync(()=>EZ.warn("writer wait timeout \u2014 using on-disk checkpoint",{sessionID:j}))),X.as("timeout"))).pipe(X.catch(()=>X.succeed("error")));let z=(yield*Y.get()).checkpoint?.push_caps??{},C=wZ(),D=C??U2.global,M=yield*V.list({session_id:j,include_terminal:!0}),P=(yield*X.promise(()=>kZ(V1(j),z.checkpoint??11000)))?.text??"";yield*X.promise(()=>yZ(D));let w=(yield*X.promise(()=>kZ(C8(D),z.memory??1e4)))?.text??"",x=(yield*X.promise(()=>lG(TZ(j),z.notes??6000)))?.text??"",v=(yield*X.promise(()=>kZ(o7(),z.global??6000)))?.text??"",m=yield*Q.listActive(),A=z.recent_user??16000,u=z.recent_user_per_msg??2000,r=[];if(A>0){let W$=R0.page({sessionID:j,agentID:"main",limit:200}).items.filter((V$)=>V$.info.role==="user"&&!V$.parts.some((y)=>y.type==="tool"||y.type==="checkpoint"||y.type==="compaction")),y$=A;for(let V$=W$.length-1;V$>=0;V$--){let y=MM(W$[V$].parts);if(!y.trim())continue;let n=zM(y,u,W$[V$].info.id),a=D0.estimate(n);if(y$-a<0)break;r.unshift(n),y$-=a}}if(M.length===0&&!P.trim()&&!w.trim()&&!v.trim()&&m.length===0&&r.length===0)return"";let S=[];if(S.push("The following blocks are auto-loaded from your session memory. They are already in your context \u2014 do not Read them as whole files. Use Grep for specific facts instead."),S.push(""),S.push("## Tasks ledger"),M.length===0)S.push("(none)");else{let W$=M.filter((n)=>!n.parent_task_id),y$=new Map;for(let n of M){if(!n.parent_task_id)continue;let a=y$.get(n.parent_task_id)??[];a.push(n),y$.set(n.parent_task_id,a)}let V$=(n)=>({open:"\uD83D\uDD35",in_progress:"\uD83D\uDD04",blocked:"\uD83D\uDFE1",done:"\u2705",abandoned:"\u274C"})[n]??n,y=[];for(let n of W$){y.push(`- ${n.id} ${n.status} \u2014 ${n.summary}`);let a=y$.get(n.id)??[];if(a.length===0)continue;let c$=a.map((l)=>`${V$(l.status)}${l.id}`).join(" / ");y.push(` Subtasks: ${c$}`)}S.push(FM(y.join(`
7421
+ `),z.tasks_ledger??2000))}if(S.push(""),P.trim())S.push("## Session checkpoint"),S.push(P.trim()),S.push("");if(m.length>0){S.push("## Active actors");let W$=z.actor_ledger??500;for(let y$ of m){let V$=`- ${y$.actorID} \u2014 ${y$.status}, "${y$.description}" (agent=${y$.agent})`,y=D0.estimate(V$);if(W$-y<0)break;S.push(V$),W$-=y}S.push("")}if(r.length>0)S.push("## Recent user input (verbatim)"),S.push(...r),S.push("");if(w.trim())S.push("## Project memory"),S.push(w.trim()),S.push("");if(v.trim())S.push("## Global memory"),S.push(v.trim()),S.push("");if(x.trim())S.push("## Session notes"),S.push(x.trim()),S.push("");yield*K.reconcile().pipe(X.ignore);let T=new Set([C8(D),V1(j),o7()].filter((W$)=>W$.length>0)),k=C&&C!==U2.global?NJ(X$(q0.scope,"global"),_0(X$(q0.scope,"sessions"),X$(q0.scope_id,j)),_0(X$(q0.scope,"projects"),X$(q0.scope_id,C))):NJ(X$(q0.scope,"global"),_0(X$(q0.scope,"sessions"),X$(q0.scope_id,j))),A$=yield*X.sync(()=>z$.use((W$)=>W$.select({path:q0.path}).from(q0).where(k).all())),s=yield*K.root(),J$=A$.map((W$)=>W$.path).filter((W$)=>!T.has(W$)&&!W$.includes(`${l7.sep}checkpoint${l7.sep}learning-`)).map((W$)=>W$.replace(s+l7.sep,""));if(J$.length>0){S.push("## Memory keys index");let W$=z.memory_titles??500;for(let y$ of J$){let V$=D0.estimate(y$);if(W$-V$<0)break;S.push(`- ${y$}`),W$-=V$}S.push("")}S.push(""),S.push("This session is being continued from a previous conversation that hit a checkpoint. The session checkpoint and project memory above cover the earlier portion of the conversation."),S.push(""),S.push("Recent messages are preserved verbatim below \u2014 the assistant turn (and any tool results) you'll see is real history, not pseudo-content. Continue your task by responding to the most recent state."),S.push(""),S.push(`Resume directly. Do not acknowledge this memory dump, do not recap, do not preface with "I'll continue" or similar. Pick up the last task as if the break never happened.`);let Z$=B?.lastMessageInfo;if(Z$){let W$=(()=>{switch(Z$.role){case"assistant":if(Z$.finish==="tool-calls")return CM();return DM(void 0);case"tool":return PM();case"user":return""}})();if(W$)S.push(""),S.push(W$)}return S.join(`
7422
+ `)}),_=X.fn("SessionCheckpoint.insertRebuildBoundary")(function*(j){let B=yield*W(j.sessionID,{lastMessageInfo:j.lastMessageInfo,agentID:j.agentID}).pipe(X.catch(()=>X.succeed("")));if(!B)return!1;let q=yield*G(j.sessionID).pipe(X.catch(()=>X.succeed(""))),U=(j.boundaryCreatedAt??Date.now())+1,z=yield*Z.updateMessage({id:IJ.ascending(),role:"user",model:{providerID:j.model.providerID,modelID:j.model.modelID},sessionID:j.sessionID,agent:j.agent,time:{created:U}});if(yield*Z.updatePart({id:f2.ascending(),messageID:z.id,sessionID:j.sessionID,type:"checkpoint",checkpointDir:"",checkpointNumber:0,coveredUpTo:j.boundary}),q)yield*Z.updatePart({id:f2.ascending(),messageID:z.id,sessionID:j.sessionID,type:"text",synthetic:!0,text:q});yield*Z.updatePart({id:f2.ascending(),messageID:z.id,sessionID:j.sessionID,type:"text",synthetic:!0,text:B});let C=yield*Q.renderForAgent(j.sessionID).pipe(X.catch(()=>X.succeed("")));if(C)yield*Z.updatePart({id:f2.ascending(),messageID:z.id,sessionID:j.sessionID,type:"text",synthetic:!0,text:C});let D=yield*Z.messages({sessionID:j.sessionID,agentID:"*"}),M=j.boundaryCreatedAt??D.find((P)=>P.info.id===j.boundary)?.info.time.created;if(M===void 0)return EZ.warn("microcompact skipped: no boundary timestamp available",{sessionID:j.sessionID,boundary:j.boundary}),!0;let I=0;for(let P of D){if(P.info.id===z.id)continue;if(P.info.time.created<=M)continue;for(let L of P.parts){if(L.type!=="tool")continue;if(!NG.has(L.tool))continue;if(L.state.status!=="completed")continue;if(L.state.time.compacted)continue;L.state.time.compacted=Date.now(),yield*Z.updatePart(L),I+=1}}if(I>0)EZ.info("rebuild microcompact",{sessionID:j.sessionID,cleared:I});return!0});return{renderIndex:G,renderRebuildContext:W,insertRebuildBoundary:_}}class D8 extends D$.Service()("@qitqode/SessionCheckpoint"){}var rG=f.effect(D8,X.gen(function*(){let $=yield*sG,J=yield*w$.Service,Z=yield*g1.Service,Y=yield*K1.Service,K=yield*L1.Service,V=yield*P$.Service,Q=yield*UJ.Scope,G=new Map,W=pG(G,{session:$,config:J,actorRegistry:K,bus:V,scope:Q}),_=oG(G,{session:$,config:J,memory:Z,taskRegistry:Y,actorRegistry:K}),{tryStartCheckpointWriter:j,waitForWriter:B,drainWriters:q}=W,{renderIndex:U,renderRebuildContext:z,insertRebuildBoundary:C}=_,D=X.fn("SessionCheckpoint.hasCheckpoint")(function*(N){return yield*X.promise(()=>Bun.file(V1(N)).exists())}),M=X.fn("SessionCheckpoint.hasMemoryOrTasks")(function*(N){let x=yield*Z.root(),b=IM.join(x,"sessions",N);if((yield*X.promise(()=>AM.readdir(b).catch(()=>[]))).length>0)return!0;return(yield*Y.list({session_id:N,include_terminal:!0})).length>0}),I=X.fn("SessionCheckpoint.loadLatest")(function*(N){return(yield*X.promise(()=>Bun.file(V1(N)).text().catch(()=>"")))||void 0}),P=X.fn("SessionCheckpoint.loadCheckpoints")(function*(N,x){let b=yield*X.promise(()=>Bun.file(V1(N)).text().catch(()=>""));return b?[b]:[]}),L=X.fn("SessionCheckpoint.lastBoundary")(function*(N){return(yield*X.sync(()=>z$.use((b)=>b.select({last_checkpoint_message_id:Q0.last_checkpoint_message_id}).from(Q0).where(X$(Q0.id,N)).get())))?.last_checkpoint_message_id}),w=X.fn("SessionCheckpoint.isWriterRunning")(function*(N){return G.has(N)});return D8.of({tryStartCheckpointWriter:j,waitForWriter:B,drainWriters:q,hasCheckpoint:D,hasMemoryOrTasks:M,loadLatest:I,loadCheckpoints:P,renderIndex:U,renderRebuildContext:z,lastBoundary:L,isWriterRunning:w,insertRebuildBoundary:C})})),iG=f.suspend(()=>rG.pipe(f.provide(nG),f.provide(P$.layer),f.provide(w$.defaultLayer),f.provide(g1.defaultLayer),f.provide(K1.defaultLayer),f.provide(L1.defaultLayer))),{runPromise:l2}=BZ(D8,iG);function SM($){return l2((J)=>J.hasCheckpoint($.sessionID))}function RM($){return l2((J)=>J.loadLatest($.sessionID))}function wM($){return l2((J)=>J.loadCheckpoints($.sessionID,$.count))}function LM($){return l2((J)=>J.renderIndex($.sessionID))}function NM($){return l2((J)=>J.renderRebuildContext($.sessionID,{lastMessageInfo:$.lastMessageInfo,agentID:$.agentID}))}function yM($){return l2((J)=>J.lastBoundary($.sessionID))}function TM($){return l2((J)=>J.isWriterRunning($.sessionID))}var Ex={current:void 0},aG={current:void 0};var kM="actor",tG=["run","spawn","status","wait","cancel","send"];function P8($,J,Z,Y){return X.fail({kind:"arity",line:Y,detail:`actor: ${$}: arity mismatch
7423
7423
  got: actor ${$} ${Z.join(" ")}
7424
- expected: actor ${$} ${J}`})}function l7($,J,Z){let Y=[],K={};for(let Q=0;Q<$.length;Q++){let V=$[Q],X=J.find((_)=>V===`--${_}`);if(X){let _=$[Q+1];if(_===void 0)return G.fail({kind:"flag",line:Z,detail:`actor: --${X} requires a value`});K[X]=_,Q++;continue}let W=J.find((_)=>V.startsWith(`--${_}=`));if(W){let _=V.slice(`--${W}=`.length);if(_==="")return G.fail({kind:"flag",line:Z,detail:`actor: --${W} requires a value`});K[W]=_;continue}Y.push(V)}return G.succeed({flags:K,rest:Y})}var iX=G.fn("mapActorRunSpawn")(function*($,J,Z){let Y=$==="run",K=["model","task","actor",...Y?["timeout"]:[],"command","context","output-schema"],{flags:Q,rest:V}=yield*l7(J,K,Z);if(V.length!==3)return yield*P8($,`<subagent_type> "<description>" "<prompt>" [--model <ref>] [--task <TID>] [--actor <id>]${Y?" [--timeout <ms>]":""} [--command <cmd>] [--context none|state|full] [--output-schema <json>]`,V,Z);return{operation:{action:$,subagent_type:V[0],description:V[1],prompt:V[2],...Q.model?{model:Q.model}:{},...Q.task?{task_id:Q.task}:{},...Q.actor?{actor_id:Q.actor}:{},...Y&&Q.timeout?{timeout_ms:Number(Q.timeout)}:{},...Q.command?{command:Q.command}:{},...Q.context?{context:Q.context}:{},...Q["output-schema"]?{output_schema:JSON.parse(Q["output-schema"])}:{}}}}),SC=G.fn("mapActorVerb")(function*($,J,Z){switch($){case"run":return yield*iX("run",J,Z);case"spawn":return yield*iX("spawn",J,Z);case"status":if(J.length!==1)return yield*P8("status","<actor_id>",J,Z);return{operation:{action:"status",actor_id:J[0]}};case"wait":{let{flags:Y,rest:K}=yield*l7(J,["timeout"],Z);if(K.length!==1)return yield*P8("wait","<actor_id> [--timeout <ms>]",K,Z);return{operation:{action:"wait",actor_id:K[0],...Y.timeout?{timeout_ms:Number(Y.timeout)}:{}}}}case"cancel":if(J.length!==1)return yield*P8("cancel","<actor_id>",J,Z);return{operation:{action:"cancel",actor_id:J[0]}};case"send":{let{flags:Y,rest:K}=yield*l7(J,["session","type"],Z);if(K.length!==2)return yield*P8("send",'<to_actor_id> "<content>" [--session <id>] [--type <t>]',K,Z);return{operation:{action:"send",to_actor_id:K[0],content:K[1],...Y.session?{to_session_id:Y.session}:{},...Y.type?{type:Y.type}:{}}}}default:{let Y=PZ($??"",rX),K=`actor: unknown verb "${$??""}"
7425
- available verbs: ${rX.join(", ")}`+(Y?`
7426
- did you mean: ${Y}?`:"");return yield*G.fail({kind:"unknown-verb",line:Z,detail:K})}}});function wC($){return G.gen(function*(){let J=yield*DZ($),Z=[];for(let Y of J){let[K,Q,...V]=Y.tokens;if(K!=="actor")return yield*G.fail({kind:"unknown-verb",line:Y.line,detail:`actor: every command must start with 'actor' (got '${K??""}')`});let X=yield*SC(Q,V,Y.line);Z.push(X)}return Z})}function RC($){if($.action==="spawn"||$.action==="run")return $.action;if($.background===!0||$.async===!0)return"spawn";return"run"}function LC($){let J=IZ($);if(!J)return;if(J.kind==="operation")return{operation:J.operation};let Z=J.obj,Y=Z.subagent_type,K=Z.description,Q=Z.prompt;if(typeof Y==="string"&&typeof K==="string"&&typeof Q==="string"){let V={action:RC(Z),subagent_type:Y,description:K,prompt:Q};if(typeof Z.model==="string")V.model=Z.model;if(typeof Z.task_id==="string")V.task_id=Z.task_id;if(typeof Z.actor_id==="string")V.actor_id=Z.actor_id;return{operation:V}}return}var o7=H$(AC,G.gen(function*(){let $=(yield*e.toolDescriptionEffect("actor"))??"",J=(yield*e.toolDescriptionEffect("actor.shell"))??"",Z=yield*c0.Service,Y=yield*R$.Service,K=yield*H1.Service,Q=yield*Y1.Service,V=yield*L1.Service,X=yield*o2.Service,W=yield*c2.Service,_=yield*K1.Service,j=()=>{let H=SZ.current;if(!H)return G.fail(Error("Actor service unavailable \u2014 Actor.defaultLayer must be running for the actor tool to spawn or cancel actors"));return G.succeed(H)};return G.fn("ActorTool.init")(function*(){let U=(yield*Z.list()).filter((C)=>C.mode==="subagent"&&!C.hidden).map((C)=>C.name);if(U.length===0)return yield*G.die(Error("No spawnable subagent types"));let z=F.enum(U),M=KG(z),I=G.fn("ActorTool.execute")(function*(C,P){let D=C.operation,L=yield*Y.get(),R=(Q$,y)=>{let n={status:"unknown",actor_id:y};return{title:`Actor ${Q$}: unknown`,output:JSON.stringify(n),metadata:{actor_id:y,status:"unknown"}}},N=G.fn("ActorTool.findActor")(function*(Q$){let y=yield*V.get(P.sessionID,Q$);if(y)return{entry:y,sessionID:P.sessionID};let n=F0.make(Q$),a=yield*V.get(n,Q$);if(a)return{entry:a,sessionID:n};return});if(D.action==="send"){let Q$=oX.current;if(!Q$)return yield*G.fail(Error("Inbox service unavailable \u2014 Inbox.layer must be running for the actor tool to send messages"));let y=D.to_session_id!==void 0?F0.make(D.to_session_id):P.sessionID,n=yield*Q$.send({receiverSessionID:y,receiverActorID:D.to_actor_id,senderSessionID:P.sessionID,senderActorID:P.agent??"main",content:D.content,...D.type!==void 0?{type:D.type}:{}}).pipe(G.catchTag("InboxReceiverNotFound",()=>G.succeed({inboxID:null,error:"receiver not found"})));if("error"in n)return{title:"Send failed: receiver not found",output:JSON.stringify(n),metadata:{receiver_actor_id:D.to_actor_id,receiver_session_id:y,error:n.error}};return{title:`Sent to ${D.to_actor_id}`,output:JSON.stringify({inboxID:n.inboxID}),metadata:{inboxID:n.inboxID,receiver_actor_id:D.to_actor_id,receiver_session_id:y}}}if(D.action==="status"){let Q$=yield*N(D.actor_id);if(!Q$)return R("status",D.actor_id);let y=Q$.entry,n={status:y.status,actor_id:y.actorID,description:y.description,agent:y.agent,background:y.background,turnCount:y.turnCount,lastTurnTime:y.lastTurnTime,...y.lastError!==void 0?{error:y.lastError}:{},time:y.time};return{title:`Actor status: ${y.status}`,output:JSON.stringify(n),metadata:{actor_id:y.actorID,status:y.status}}}if(D.action==="wait"){let Q$=yield*N(D.actor_id);if(!Q$)return R("wait",D.actor_id);let y=yield*W.wait({sessionID:Q$.sessionID,actor_id:D.actor_id,timeout_ms:D.timeout_ms});return{title:`Actor wait: ${y.status}${y.lastOutcome?"/"+y.lastOutcome:""}`,output:JSON.stringify(y),metadata:{actor_id:y.actor_id,status:y.status,...y.lastOutcome?{lastOutcome:y.lastOutcome}:{}}}}if(D.action==="cancel"){let Q$=yield*N(D.actor_id);if(!Q$)return R("cancel",D.actor_id);let y=Q$.entry;if(y.status==="idle"){let c$={status:y.status,actor_id:y.actorID,description:y.description,agent:y.agent,background:y.background};return{title:`Actor cancel: ${y.status}`,output:JSON.stringify(c$),metadata:{actor_id:y.actorID,status:y.status}}}yield*(yield*j()).cancel(Q$.sessionID,y.actorID,"graceful");let a={status:"cancelled",actor_id:y.actorID,description:y.description,agent:y.agent,background:y.background};return{title:"Actor cancel: cancelled",output:JSON.stringify(a),metadata:{actor_id:y.actorID,status:"cancelled"}}}if(!P.extra?.bypassAgentCheck)yield*P.ask({permission:"actor",patterns:[D.subagent_type],always:["*"],metadata:{description:D.description,subagent_type:D.subagent_type}});let x=yield*Z.get(D.subagent_type);if(!x)return yield*G.fail(new R0(`Unknown agent type "${D.subagent_type}". Valid subagent_type values are listed in the actor tool description \u2014 pass one of those.`));let b=D.prompt,v=D.action==="spawn";if(D.context==="state"){let Q$=yield*X.loadLatest(P.sessionID).pipe(G.catch(()=>G.succeed(void 0)));if(Q$)b=["<session-state>","Here is a summary of the parent session's progress:","",Q$,"</session-state>",""].join(`
7427
- `)+b}let m=yield*G.sync(()=>w0.get({sessionID:P.sessionID,messageID:P.messageID}));if(m.info.role!=="assistant")return yield*G.fail(Error("Not an assistant message"));let A=D.model??x.modelRef,u=A?yield*K.resolveModelRef(A,m.info.providerID).pipe(G.map((Q$)=>({modelID:Q$.id,providerID:Q$.providerID}))):x.model??{modelID:m.info.modelID,providerID:m.info.providerID},r=D.task_id,S="";if(D.task_id){if(!C8.safeParse(D.task_id).success)r=void 0,S=`note: task_id "${D.task_id}" is not a valid task ID (expected Tn or Tn.m); ran ad-hoc. Task IDs come from the \`task\` tool.`;else if(!(yield*_.get({session_id:P.sessionID,id:D.task_id})))r=void 0,S=`note: task_id "${D.task_id}" does not exist in this session; ran ad-hoc. Create it with the \`task\` tool first, or omit task_id.`}let T=yield*j(),k=yield*T.spawn({mode:"subagent",sessionID:P.sessionID,agentType:x.name,description:D.description,task:b,context:D.context??"none",tools:x.toolAllowlist?[...x.toolAllowlist]:"INHERIT",model:u,background:v,task_id:r,onReady:({actorID:Q$,sessionID:y})=>P.metadata({title:D.description,metadata:{sessionId:y,actorId:Q$,model:u}}),...D.output_schema?{format:{type:"json_schema",schema:D.output_schema,retryCount:2}}:{}});if(D.action==="spawn")return{title:D.description,metadata:{sessionId:k.sessionID,actorId:k.actorID,model:u},output:(S?S+`
7424
+ expected: actor ${$} ${J}`})}function r7($,J,Z){let Y=[],K={};for(let V=0;V<$.length;V++){let Q=$[V],G=J.find((_)=>Q===`--${_}`);if(G){let _=$[V+1];if(_===void 0)return X.fail({kind:"flag",line:Z,detail:`actor: --${G} requires a value`});K[G]=_,V++;continue}let W=J.find((_)=>Q.startsWith(`--${_}=`));if(W){let _=Q.slice(`--${W}=`.length);if(_==="")return X.fail({kind:"flag",line:Z,detail:`actor: --${W} requires a value`});K[W]=_;continue}Y.push(Q)}return X.succeed({flags:K,rest:Y})}var eG=X.fn("mapActorRunSpawn")(function*($,J,Z){let Y=$==="run",K=["model","task","actor",...Y?["timeout"]:[],"command","context","output-schema"],{flags:V,rest:Q}=yield*r7(J,K,Z);if(Q.length!==3)return yield*P8($,`<subagent_type> "<description>" "<prompt>" [--model <ref>] [--task <TID>] [--actor <id>]${Y?" [--timeout <ms>]":""} [--command <cmd>] [--context none|state|full] [--output-schema <json>]`,Q,Z);return{operation:{action:$,subagent_type:Q[0],description:Q[1],prompt:Q[2],...V.model?{model:V.model}:{},...V.task?{task_id:V.task}:{},...V.actor?{actor_id:V.actor}:{},...Y&&V.timeout?{timeout_ms:Number(V.timeout)}:{},...V.command?{command:V.command}:{},...V.context?{context:V.context}:{},...V["output-schema"]?{output_schema:JSON.parse(V["output-schema"])}:{}}}}),EM=X.fn("mapActorVerb")(function*($,J,Z){switch($){case"run":return yield*eG("run",J,Z);case"spawn":return yield*eG("spawn",J,Z);case"status":if(J.length!==1)return yield*P8("status","<actor_id>",J,Z);return{operation:{action:"status",actor_id:J[0]}};case"wait":{let{flags:Y,rest:K}=yield*r7(J,["timeout"],Z);if(K.length!==1)return yield*P8("wait","<actor_id> [--timeout <ms>]",K,Z);return{operation:{action:"wait",actor_id:K[0],...Y.timeout?{timeout_ms:Number(Y.timeout)}:{}}}}case"cancel":if(J.length!==1)return yield*P8("cancel","<actor_id>",J,Z);return{operation:{action:"cancel",actor_id:J[0]}};case"send":{let{flags:Y,rest:K}=yield*r7(J,["session","type"],Z);if(K.length!==2)return yield*P8("send",'<to_actor_id> "<content>" [--session <id>] [--type <t>]',K,Z);return{operation:{action:"send",to_actor_id:K[0],content:K[1],...Y.session?{to_session_id:Y.session}:{},...Y.type?{type:Y.type}:{}}}}default:{let Y=PZ($??"",tG),K=`actor: unknown verb "${$??""}"
7425
+ available verbs: ${tG.join(", ")}`+(Y?`
7426
+ did you mean: ${Y}?`:"");return yield*X.fail({kind:"unknown-verb",line:Z,detail:K})}}});function xM($){return X.gen(function*(){let J=yield*DZ($),Z=[];for(let Y of J){let[K,V,...Q]=Y.tokens;if(K!=="actor")return yield*X.fail({kind:"unknown-verb",line:Y.line,detail:`actor: every command must start with 'actor' (got '${K??""}')`});let G=yield*EM(V,Q,Y.line);Z.push(G)}return Z})}function bM($){if($.action==="spawn"||$.action==="run")return $.action;if($.background===!0||$.async===!0)return"spawn";return"run"}function vM($){let J=IZ($);if(!J)return;if(J.kind==="operation")return{operation:J.operation};let Z=J.obj,Y=Z.subagent_type,K=Z.description,V=Z.prompt;if(typeof Y==="string"&&typeof K==="string"&&typeof V==="string"){let Q={action:bM(Z),subagent_type:Y,description:K,prompt:V};if(typeof Z.model==="string")Q.model=Z.model;if(typeof Z.task_id==="string")Q.task_id=Z.task_id;if(typeof Z.actor_id==="string")Q.actor_id=Z.actor_id;return{operation:Q}}return}var i7=B$(kM,X.gen(function*(){let $=(yield*e.toolDescriptionEffect("actor"))??"",J=(yield*e.toolDescriptionEffect("actor.shell"))??"",Z=yield*c0.Service,Y=yield*w$.Service,K=yield*B1.Service,V=yield*Y1.Service,Q=yield*L1.Service,G=yield*o2.Service,W=yield*c2.Service,_=yield*K1.Service,j=()=>{let B=SZ.current;if(!B)return X.fail(Error("Actor service unavailable \u2014 Actor.defaultLayer must be running for the actor tool to spawn or cancel actors"));return X.succeed(B)};return X.fn("ActorTool.init")(function*(){let U=(yield*Z.list()).filter((M)=>M.mode==="subagent"&&!M.hidden).map((M)=>M.name);if(U.length===0)return yield*X.die(Error("No spawnable subagent types"));let z=F.enum(U),C=XX(z),D=X.fn("ActorTool.execute")(function*(M,I){let P=M.operation,L=yield*Y.get(),w=(V$,y)=>{let n={status:"unknown",actor_id:y};return{title:`Actor ${V$}: unknown`,output:JSON.stringify(n),metadata:{actor_id:y,status:"unknown"}}},N=X.fn("ActorTool.findActor")(function*(V$){let y=yield*Q.get(I.sessionID,V$);if(y)return{entry:y,sessionID:I.sessionID};let n=F0.make(V$),a=yield*Q.get(n,V$);if(a)return{entry:a,sessionID:n};return});if(P.action==="send"){let V$=aG.current;if(!V$)return yield*X.fail(Error("Inbox service unavailable \u2014 Inbox.layer must be running for the actor tool to send messages"));let y=P.to_session_id!==void 0?F0.make(P.to_session_id):I.sessionID,n=yield*V$.send({receiverSessionID:y,receiverActorID:P.to_actor_id,senderSessionID:I.sessionID,senderActorID:I.agent??"main",content:P.content,...P.type!==void 0?{type:P.type}:{}}).pipe(X.catchTag("InboxReceiverNotFound",()=>X.succeed({inboxID:null,error:"receiver not found"})));if("error"in n)return{title:"Send failed: receiver not found",output:JSON.stringify(n),metadata:{receiver_actor_id:P.to_actor_id,receiver_session_id:y,error:n.error}};return{title:`Sent to ${P.to_actor_id}`,output:JSON.stringify({inboxID:n.inboxID}),metadata:{inboxID:n.inboxID,receiver_actor_id:P.to_actor_id,receiver_session_id:y}}}if(P.action==="status"){let V$=yield*N(P.actor_id);if(!V$)return w("status",P.actor_id);let y=V$.entry,n={status:y.status,actor_id:y.actorID,description:y.description,agent:y.agent,background:y.background,turnCount:y.turnCount,lastTurnTime:y.lastTurnTime,...y.lastError!==void 0?{error:y.lastError}:{},time:y.time};return{title:`Actor status: ${y.status}`,output:JSON.stringify(n),metadata:{actor_id:y.actorID,status:y.status}}}if(P.action==="wait"){let V$=yield*N(P.actor_id);if(!V$)return w("wait",P.actor_id);let y=yield*W.wait({sessionID:V$.sessionID,actor_id:P.actor_id,timeout_ms:P.timeout_ms});return{title:`Actor wait: ${y.status}${y.lastOutcome?"/"+y.lastOutcome:""}`,output:JSON.stringify(y),metadata:{actor_id:y.actor_id,status:y.status,...y.lastOutcome?{lastOutcome:y.lastOutcome}:{}}}}if(P.action==="cancel"){let V$=yield*N(P.actor_id);if(!V$)return w("cancel",P.actor_id);let y=V$.entry;if(y.status==="idle"){let c$={status:y.status,actor_id:y.actorID,description:y.description,agent:y.agent,background:y.background};return{title:`Actor cancel: ${y.status}`,output:JSON.stringify(c$),metadata:{actor_id:y.actorID,status:y.status}}}yield*(yield*j()).cancel(V$.sessionID,y.actorID,"graceful");let a={status:"cancelled",actor_id:y.actorID,description:y.description,agent:y.agent,background:y.background};return{title:"Actor cancel: cancelled",output:JSON.stringify(a),metadata:{actor_id:y.actorID,status:"cancelled"}}}if(!I.extra?.bypassAgentCheck)yield*I.ask({permission:"actor",patterns:[P.subagent_type],always:["*"],metadata:{description:P.description,subagent_type:P.subagent_type}});let x=yield*Z.get(P.subagent_type);if(!x)return yield*X.fail(new w0(`Unknown agent type "${P.subagent_type}". Valid subagent_type values are listed in the actor tool description \u2014 pass one of those.`));let b=P.prompt,v=P.action==="spawn";if(P.context==="state"){let V$=yield*G.loadLatest(I.sessionID).pipe(X.catch(()=>X.succeed(void 0)));if(V$)b=["<session-state>","Here is a summary of the parent session's progress:","",V$,"</session-state>",""].join(`
7427
+ `)+b}let m=yield*X.sync(()=>R0.get({sessionID:I.sessionID,messageID:I.messageID}));if(m.info.role!=="assistant")return yield*X.fail(Error("Not an assistant message"));let A=P.model??x.modelRef,u=A?yield*K.resolveModelRef(A,m.info.providerID).pipe(X.map((V$)=>({modelID:V$.id,providerID:V$.providerID}))):x.model??{modelID:m.info.modelID,providerID:m.info.providerID},r=P.task_id,S="";if(P.task_id){if(!M8.safeParse(P.task_id).success)r=void 0,S=`note: task_id "${P.task_id}" is not a valid task ID (expected Tn or Tn.m); ran ad-hoc. Task IDs come from the \`task\` tool.`;else if(!(yield*_.get({session_id:I.sessionID,id:P.task_id})))r=void 0,S=`note: task_id "${P.task_id}" does not exist in this session; ran ad-hoc. Create it with the \`task\` tool first, or omit task_id.`}let T=yield*j(),k=yield*T.spawn({mode:"subagent",sessionID:I.sessionID,agentType:x.name,description:P.description,task:b,context:P.context??"none",tools:x.toolAllowlist?[...x.toolAllowlist]:"INHERIT",model:u,background:v,task_id:r,onReady:({actorID:V$,sessionID:y})=>I.metadata({title:P.description,metadata:{sessionId:y,actorId:V$,model:u}}),...P.output_schema?{format:{type:"json_schema",schema:P.output_schema,retryCount:2}}:{}});if(P.action==="spawn")return{title:P.description,metadata:{sessionId:k.sessionID,actorId:k.actorID,model:u},output:(S?S+`
7428
7428
  `:"")+`Background actor started. actor_id: ${k.actorID}
7429
- The result will be delivered as a notification when complete.`};let A$=yield*O1.make(),s=()=>{A$.fork(T.cancel(k.sessionID,k.actorID,"graceful"))},J$=yield*G.acquireUseRelease(G.sync(()=>{P.abort.addEventListener("abort",s)}),()=>B0.await(k.outcome).pipe(G.timeout(D.timeout_ms??600000),G.catchTag("TimeoutError",()=>G.succeed({status:"timeout"}))),()=>G.sync(()=>{P.abort.removeEventListener("abort",s)}));if(J$.status==="failure")return yield*G.fail(Error(`Tool execution failed: ${J$.error??"unknown"}`));let Z$=J$.status==="success"?J$.structured!==void 0?JSON.stringify(J$.structured):J$.finalText??"(no output)":J$.status==="timeout"?"<timeout>task did not complete within timeout</timeout>":"<cancelled>task was cancelled</cancelled>",W$=J$.status==="success"?J$.reportedStatus??"unknown":J$.status,y$=J$.status==="success"&&J$.reportedSummary?` summary="${J$.reportedSummary.replace(/\s+/g," ").replace(/"/g,"'").trim()}"`:"";return{title:D.description,metadata:{sessionId:k.sessionID,actorId:k.actorID,model:u},output:[...S?[S,""]:[],`actor_id: ${k.actorID} (for resuming to continue this task if needed)`,"",`<actor_result status="${W$}"${y$}>`,Z$,"</actor_result>"].join(`
7430
- `)}});return{description:$,parameters:M,execute:(C,P)=>I(C,P).pipe(G.orDie),shell:{description:J,parse:wC,recover:LC}}})}));var sX=["create","list","get","start","block","unblock","done","abandon","rename"],NC="task";function yC($){return G.gen(function*(){let J=yield*DZ($),Z=[];for(let Y of J){let[K,Q,...V]=Y.tokens;if(K!=="task")return yield*G.fail({kind:"unknown-verb",line:Y.line,detail:`task: every command must start with 'task' (got '${K??""}')`});let X=yield*kC(Q,V,Y.line);Z.push(X)}return Z})}function TC($){let J=IZ($);if(!J)return;if(J.kind==="operation")return{operation:J.operation};let Z=J.obj;if(typeof Z.summary==="string"){let Y={action:"create",summary:Z.summary};if(typeof Z.parent_id==="string")Y.parent_id=Z.parent_id;if(typeof Z.session_id==="string")Y.session_id=Z.session_id;return{operation:Y}}return}function c1($,J,Z){let Y=[],K={},Q={};for(let V=0;V<$.length;V++){let X=$[V],W=Z.find((H)=>X===`--${H}`);if(W){Q[W]=!0;continue}let _=J.find((H)=>X===`--${H}`);if(_){let H=$[V+1];if(H===void 0)return{flags:K,bools:Q,rest:Y,error:`--${_} requires a value`};K[_]=H,V++;continue}let j=J.find((H)=>X.startsWith(`--${H}=`));if(j){let H=X.slice(`--${j}=`.length);if(H==="")return{flags:K,bools:Q,rest:Y,error:`--${j} requires a value`};K[j]=H;continue}Y.push(X)}return{flags:K,bools:Q,rest:Y}}function l1($,J,Z){return G.fail({kind:"flag",line:Z,detail:`task: ${$}: ${J}`})}function kC($,J,Z){switch($){case"create":{let{flags:Y,rest:K,error:Q}=c1(J,["parent","session"],[]);if(Q)return l1("create",Q,Z);if(K.length!==1)return o1("create","<summary> [--parent <TID>] [--session <id>]",K,Z);return G.succeed({operation:{action:"create",summary:K[0],...Y.parent?{parent_id:Y.parent}:{},...Y.session?{session_id:Y.session}:{}}})}case"list":{let{flags:Y,bools:K,rest:Q,error:V}=c1(J,["session"],["include-terminal","include-archived"]);if(V)return l1("list",V,Z);if(Q.length>1)return o1("list","[<status>] [--include-terminal] [--include-archived] [--session <id>]",Q,Z);return G.succeed({operation:{action:"list",...Q.length===1?{status:Q[0]}:{},...K["include-terminal"]?{include_terminal:!0}:{},...K["include-archived"]?{include_archived:!0}:{},...Y.session?{session_id:Y.session}:{}}})}case"get":{let{flags:Y,rest:K,error:Q}=c1(J,["session"],[]);if(Q)return l1("get",Q,Z);if(K.length!==1)return o1("get","<id> [--session <id>]",K,Z);return G.succeed({operation:{action:"get",id:K[0],...Y.session?{session_id:Y.session}:{}}})}case"start":{let{flags:Y,rest:K,error:Q}=c1(J,["reason","session"],[]);if(Q)return l1("start",Q,Z);if(K.length!==1)return o1("start","<id> [--reason <note>] [--session <id>]",K,Z);return G.succeed({operation:{action:"start",id:K[0],...Y.reason?{event_summary:Y.reason}:{},...Y.session?{session_id:Y.session}:{}}})}case"block":{let{flags:Y,rest:K,error:Q}=c1(J,["session"],[]);if(Q)return l1("block",Q,Z);if(K.length!==2)return o1("block","<id> <reason> [--session <id>]",K,Z);return G.succeed({operation:{action:"block",id:K[0],event_summary:K[1],...Y.session?{session_id:Y.session}:{}}})}case"unblock":{let{flags:Y,rest:K,error:Q}=c1(J,["session"],[]);if(Q)return l1("unblock",Q,Z);if(K.length!==2)return o1("unblock","<id> <reason> [--session <id>]",K,Z);return G.succeed({operation:{action:"unblock",id:K[0],event_summary:K[1],...Y.session?{session_id:Y.session}:{}}})}case"done":{let{flags:Y,rest:K,error:Q}=c1(J,["session"],[]);if(Q)return l1("done",Q,Z);if(K.length!==2)return o1("done","<id> <summary> [--session <id>]",K,Z);return G.succeed({operation:{action:"done",id:K[0],event_summary:K[1],...Y.session?{session_id:Y.session}:{}}})}case"abandon":{let{flags:Y,rest:K,error:Q}=c1(J,["session"],[]);if(Q)return l1("abandon",Q,Z);if(K.length!==2)return o1("abandon","<id> <reason> [--session <id>]",K,Z);return G.succeed({operation:{action:"abandon",id:K[0],event_summary:K[1],...Y.session?{session_id:Y.session}:{}}})}case"rename":{let{flags:Y,rest:K,error:Q}=c1(J,["session"],[]);if(Q)return l1("rename",Q,Z);if(K.length!==2)return o1("rename","<id> <summary> [--session <id>]",K,Z);return G.succeed({operation:{action:"rename",id:K[0],summary:K[1],...Y.session?{session_id:Y.session}:{}}})}default:{let Y=PZ($??"",sX),K=`task: unknown verb "${$??""}"
7431
- available verbs: ${sX.join(", ")}`+(Y?`
7432
- did you mean: ${Y}?`:"");return G.fail({kind:"unknown-verb",line:Z,detail:K})}}}function o1($,J,Z,Y){return G.fail({kind:"arity",line:Y,detail:`task: ${$}: arity mismatch
7429
+ The result will be delivered as a notification when complete.`};let A$=yield*O1.make(),s=()=>{A$.fork(T.cancel(k.sessionID,k.actorID,"graceful"))},J$=yield*X.acquireUseRelease(X.sync(()=>{I.abort.addEventListener("abort",s)}),()=>H0.await(k.outcome).pipe(X.timeout(P.timeout_ms??600000),X.catchTag("TimeoutError",()=>X.succeed({status:"timeout"}))),()=>X.sync(()=>{I.abort.removeEventListener("abort",s)}));if(J$.status==="failure")return yield*X.fail(Error(`Tool execution failed: ${J$.error??"unknown"}`));let Z$=J$.status==="success"?J$.structured!==void 0?JSON.stringify(J$.structured):J$.finalText??"(no output)":J$.status==="timeout"?"<timeout>task did not complete within timeout</timeout>":"<cancelled>task was cancelled</cancelled>",W$=J$.status==="success"?J$.reportedStatus??"unknown":J$.status,y$=J$.status==="success"&&J$.reportedSummary?` summary="${J$.reportedSummary.replace(/\s+/g," ").replace(/"/g,"'").trim()}"`:"";return{title:P.description,metadata:{sessionId:k.sessionID,actorId:k.actorID,model:u},output:[...S?[S,""]:[],`actor_id: ${k.actorID} (for resuming to continue this task if needed)`,"",`<actor_result status="${W$}"${y$}>`,Z$,"</actor_result>"].join(`
7430
+ `)}});return{description:$,parameters:C,execute:(M,I)=>D(M,I).pipe(X.orDie),shell:{description:J,parse:xM,recover:vM}}})}));var $W=["create","list","get","start","block","unblock","done","abandon","rename"],hM="task";function gM($){return X.gen(function*(){let J=yield*DZ($),Z=[];for(let Y of J){let[K,V,...Q]=Y.tokens;if(K!=="task")return yield*X.fail({kind:"unknown-verb",line:Y.line,detail:`task: every command must start with 'task' (got '${K??""}')`});let G=yield*mM(V,Q,Y.line);Z.push(G)}return Z})}function fM($){let J=IZ($);if(!J)return;if(J.kind==="operation")return{operation:J.operation};let Z=J.obj;if(typeof Z.summary==="string"){let Y={action:"create",summary:Z.summary};if(typeof Z.parent_id==="string")Y.parent_id=Z.parent_id;if(typeof Z.session_id==="string")Y.session_id=Z.session_id;return{operation:Y}}return}function c1($,J,Z){let Y=[],K={},V={};for(let Q=0;Q<$.length;Q++){let G=$[Q],W=Z.find((B)=>G===`--${B}`);if(W){V[W]=!0;continue}let _=J.find((B)=>G===`--${B}`);if(_){let B=$[Q+1];if(B===void 0)return{flags:K,bools:V,rest:Y,error:`--${_} requires a value`};K[_]=B,Q++;continue}let j=J.find((B)=>G.startsWith(`--${B}=`));if(j){let B=G.slice(`--${j}=`.length);if(B==="")return{flags:K,bools:V,rest:Y,error:`--${j} requires a value`};K[j]=B;continue}Y.push(G)}return{flags:K,bools:V,rest:Y}}function l1($,J,Z){return X.fail({kind:"flag",line:Z,detail:`task: ${$}: ${J}`})}function mM($,J,Z){switch($){case"create":{let{flags:Y,rest:K,error:V}=c1(J,["parent","session"],[]);if(V)return l1("create",V,Z);if(K.length!==1)return o1("create","<summary> [--parent <TID>] [--session <id>]",K,Z);return X.succeed({operation:{action:"create",summary:K[0],...Y.parent?{parent_id:Y.parent}:{},...Y.session?{session_id:Y.session}:{}}})}case"list":{let{flags:Y,bools:K,rest:V,error:Q}=c1(J,["session"],["include-terminal","include-archived"]);if(Q)return l1("list",Q,Z);if(V.length>1)return o1("list","[<status>] [--include-terminal] [--include-archived] [--session <id>]",V,Z);return X.succeed({operation:{action:"list",...V.length===1?{status:V[0]}:{},...K["include-terminal"]?{include_terminal:!0}:{},...K["include-archived"]?{include_archived:!0}:{},...Y.session?{session_id:Y.session}:{}}})}case"get":{let{flags:Y,rest:K,error:V}=c1(J,["session"],[]);if(V)return l1("get",V,Z);if(K.length!==1)return o1("get","<id> [--session <id>]",K,Z);return X.succeed({operation:{action:"get",id:K[0],...Y.session?{session_id:Y.session}:{}}})}case"start":{let{flags:Y,rest:K,error:V}=c1(J,["reason","session"],[]);if(V)return l1("start",V,Z);if(K.length!==1)return o1("start","<id> [--reason <note>] [--session <id>]",K,Z);return X.succeed({operation:{action:"start",id:K[0],...Y.reason?{event_summary:Y.reason}:{},...Y.session?{session_id:Y.session}:{}}})}case"block":{let{flags:Y,rest:K,error:V}=c1(J,["session"],[]);if(V)return l1("block",V,Z);if(K.length!==2)return o1("block","<id> <reason> [--session <id>]",K,Z);return X.succeed({operation:{action:"block",id:K[0],event_summary:K[1],...Y.session?{session_id:Y.session}:{}}})}case"unblock":{let{flags:Y,rest:K,error:V}=c1(J,["session"],[]);if(V)return l1("unblock",V,Z);if(K.length!==2)return o1("unblock","<id> <reason> [--session <id>]",K,Z);return X.succeed({operation:{action:"unblock",id:K[0],event_summary:K[1],...Y.session?{session_id:Y.session}:{}}})}case"done":{let{flags:Y,rest:K,error:V}=c1(J,["session"],[]);if(V)return l1("done",V,Z);if(K.length!==2)return o1("done","<id> <summary> [--session <id>]",K,Z);return X.succeed({operation:{action:"done",id:K[0],event_summary:K[1],...Y.session?{session_id:Y.session}:{}}})}case"abandon":{let{flags:Y,rest:K,error:V}=c1(J,["session"],[]);if(V)return l1("abandon",V,Z);if(K.length!==2)return o1("abandon","<id> <reason> [--session <id>]",K,Z);return X.succeed({operation:{action:"abandon",id:K[0],event_summary:K[1],...Y.session?{session_id:Y.session}:{}}})}case"rename":{let{flags:Y,rest:K,error:V}=c1(J,["session"],[]);if(V)return l1("rename",V,Z);if(K.length!==2)return o1("rename","<id> <summary> [--session <id>]",K,Z);return X.succeed({operation:{action:"rename",id:K[0],summary:K[1],...Y.session?{session_id:Y.session}:{}}})}default:{let Y=PZ($??"",$W),K=`task: unknown verb "${$??""}"
7431
+ available verbs: ${$W.join(", ")}`+(Y?`
7432
+ did you mean: ${Y}?`:"");return X.fail({kind:"unknown-verb",line:Z,detail:K})}}}function o1($,J,Z,Y){return X.fail({kind:"arity",line:Y,detail:`task: ${$}: arity mismatch
7433
7433
  got: task ${$} ${Z.join(" ")}
7434
- expected: task ${$} ${J}`})}var nX=H$(NC,G.gen(function*(){let $=(yield*e.toolDescriptionEffect("task"))??"",J=(yield*e.toolDescriptionEffect("task.shell"))??"",Z=yield*K1.Service,Y=G.fn("TaskTool.execute")(function*(K,Q){let V=K.operation,X=V.session_id||Q.sessionID;if(V.action==="create"){let W=yield*Z.create({session_id:X,summary:V.summary,parent_id:V.parent_id||void 0,owner:Q.actorID??Q.agent});return{title:`Task created: ${W.id}`,output:`Created ${W.id} (${W.status}): ${W.summary}`,metadata:{id:W.id,status:W.status}}}if(V.action==="list"){let W=yield*Z.list({session_id:X,status:V.status,include_terminal:V.include_terminal,include_archived:V.include_archived}),_=W.length===0?["No tasks."]:W.map((j)=>{return`${j.id} ${j.status} \u2014 ${j.summary}`});return{title:`Tasks: ${W.length}`,output:_.join(`
7435
- `),metadata:{count:W.length,ids:W.map((j)=>j.id)}}}if(V.action==="get"){let W=yield*Z.get({session_id:X,id:V.id});if(!W)return{title:`Task ${V.id}: not found`,output:`No task ${V.id}. Use \`task list\` to see valid task IDs.`,metadata:{}};return{title:`Task ${V.id}: ${W.status}`,output:JSON.stringify(W,null,2),metadata:{id:W.id,status:W.status}}}if(V.action==="start"){let W=yield*Z.start({session_id:X,id:V.id,owner:Q.actorID??Q.agent,event_summary:V.event_summary});return{title:`Task ${V.id}: ${W.status}`,output:`start \u2192 ${W.status}`,metadata:{id:W.id,status:W.status}}}if(V.action==="block"){let W=yield*Z.block({session_id:X,id:V.id,event_summary:V.event_summary});return{title:`Task ${V.id}: blocked`,output:`block \u2192 ${W.status}`,metadata:{id:W.id,status:W.status}}}if(V.action==="unblock"){let W=yield*Z.unblock({session_id:X,id:V.id,event_summary:V.event_summary});return{title:`Task ${V.id}: ${W.status}`,output:`unblock \u2192 ${W.status}`,metadata:{id:W.id,status:W.status}}}if(V.action==="done"){let W=yield*Z.done({session_id:X,id:V.id,event_summary:V.event_summary});return{title:`Task ${V.id}: done`,output:`done \u2192 ${W.status}`,metadata:{id:W.id,status:W.status}}}if(V.action==="abandon"){let W=yield*Z.abandon({session_id:X,id:V.id,event_summary:V.event_summary});return{title:`Task ${V.id}: abandoned`,output:`abandon \u2192 ${W.status}`,metadata:{id:W.id,status:W.status}}}if(V.action==="rename"){let W=yield*Z.rename({session_id:X,id:V.id,summary:V.summary});return{title:`Task ${V.id}: renamed`,output:`rename \u2192 "${W.summary}"`,metadata:{id:W.id,status:W.status}}}return yield*G.fail(Error(`Unknown operation: ${V.action}`))});return{description:$,parameters:qG,execute:(K,Q)=>Y(K,Q).pipe(G.orDie),shell:{description:J,parse:yC,recover:TC}}}));var aX={current:void 0};var B2={};o$(B2,{list:()=>EC,get:()=>xC,BuiltinWorkflow:()=>B2});function EC(){return e.resolveWorkflowSummaries()}function xC($){return e.resolveWorkflowSpec($)}var bC="workflow",vC=FG,r7=40,i7=160;function tX($){if($.length<=r7+i7+1)return $.slice();let J=$.length-r7-i7;return[...$.slice(0,r7),{kind:"log",text:`\u2026(${J} lines omitted)`},...$.slice($.length-i7)]}var s7=H$(bC,G.gen(function*(){let $=(yield*e.toolDescriptionEffect("workflow"))??"",J=yield*R$.Service,Z=()=>{let K=aX.current;if(!K)return G.fail(Error("Workflow runtime unavailable \u2014 WorkflowRuntime.defaultLayer must be running for the workflow tool"));return G.succeed(K)},Y=G.fn("WorkflowTool.execute")(function*(K,Q){let V=yield*Z();if(K.operation==="run"){let X=yield*J.get();if(K.name&&K.script)return yield*G.fail(Error("workflow run: provide either `name` (a built-in) or `script` (inline), not both."));let W=K.name?(yield*G.promise(()=>B2.get(K.name)))?.script:K.script;if(!W){let C=(yield*G.promise(()=>B2.list())).map((P)=>P.name).join(", ");return yield*G.fail(Error(K.name?`Unknown built-in workflow "${K.name}". Known: ${C||"(none)"}.`:"workflow run requires either `name` (a built-in) or `script` (inline)."))}let j=(yield*V.start({script:W,sessionID:Q.sessionID,parentActorID:Q.agent??"main",args:K.args,workspace:K.workspace,maxConcurrentAgents:X.workflow?.maxConcurrentAgents,scriptDeadlineMs:X.workflow?.scriptDeadlineMs,notifyOnTerminal:K.async===!0})).runID,H=K.name??"inline";if(K.async===!0)return{title:"workflow started",output:`Workflow started in background. run_id: ${j}
7436
- The result will be delivered as a notification when complete.`,metadata:{runID:j,status:"running"}};yield*Q.metadata({metadata:{runID:j,status:"running",transcript:[]}});let q=0,U=yield*G.forkScoped(G.gen(function*(){while(!0){yield*G.sleep("250 millis");let C=yield*V.transcript({runID:j});if(C.length===q)continue;q=C.length,yield*Q.metadata({metadata:{runID:j,status:"running",transcript:tX(C)}})}})),z=yield*V.wait({runID:j});yield*Z8.interrupt(U);let M=tX(yield*V.transcript({runID:j})),I=M.map((C)=>C.kind==="phase"?`\u25B8 ${C.text}`:` ${C.text}`);if(z.status==="completed"){let C=JSON.stringify(z.result??null),P=C.length>4000?C.slice(0,4000)+" \u2026(truncated)":C;return{title:`workflow ${H} completed`,output:(I.length?I.join(`
7434
+ expected: task ${$} ${J}`})}var JW=B$(hM,X.gen(function*(){let $=(yield*e.toolDescriptionEffect("task"))??"",J=(yield*e.toolDescriptionEffect("task.shell"))??"",Z=yield*K1.Service,Y=X.fn("TaskTool.execute")(function*(K,V){let Q=K.operation,G=Q.session_id||V.sessionID;if(Q.action==="create"){let W=yield*Z.create({session_id:G,summary:Q.summary,parent_id:Q.parent_id||void 0,owner:V.actorID??V.agent});return{title:`Task created: ${W.id}`,output:`Created ${W.id} (${W.status}): ${W.summary}`,metadata:{id:W.id,status:W.status}}}if(Q.action==="list"){let W=yield*Z.list({session_id:G,status:Q.status,include_terminal:Q.include_terminal,include_archived:Q.include_archived}),_=W.length===0?["No tasks."]:W.map((j)=>{return`${j.id} ${j.status} \u2014 ${j.summary}`});return{title:`Tasks: ${W.length}`,output:_.join(`
7435
+ `),metadata:{count:W.length,ids:W.map((j)=>j.id)}}}if(Q.action==="get"){let W=yield*Z.get({session_id:G,id:Q.id});if(!W)return{title:`Task ${Q.id}: not found`,output:`No task ${Q.id}. Use \`task list\` to see valid task IDs.`,metadata:{}};return{title:`Task ${Q.id}: ${W.status}`,output:JSON.stringify(W,null,2),metadata:{id:W.id,status:W.status}}}if(Q.action==="start"){let W=yield*Z.start({session_id:G,id:Q.id,owner:V.actorID??V.agent,event_summary:Q.event_summary});return{title:`Task ${Q.id}: ${W.status}`,output:`start \u2192 ${W.status}`,metadata:{id:W.id,status:W.status}}}if(Q.action==="block"){let W=yield*Z.block({session_id:G,id:Q.id,event_summary:Q.event_summary});return{title:`Task ${Q.id}: blocked`,output:`block \u2192 ${W.status}`,metadata:{id:W.id,status:W.status}}}if(Q.action==="unblock"){let W=yield*Z.unblock({session_id:G,id:Q.id,event_summary:Q.event_summary});return{title:`Task ${Q.id}: ${W.status}`,output:`unblock \u2192 ${W.status}`,metadata:{id:W.id,status:W.status}}}if(Q.action==="done"){let W=yield*Z.done({session_id:G,id:Q.id,event_summary:Q.event_summary});return{title:`Task ${Q.id}: done`,output:`done \u2192 ${W.status}`,metadata:{id:W.id,status:W.status}}}if(Q.action==="abandon"){let W=yield*Z.abandon({session_id:G,id:Q.id,event_summary:Q.event_summary});return{title:`Task ${Q.id}: abandoned`,output:`abandon \u2192 ${W.status}`,metadata:{id:W.id,status:W.status}}}if(Q.action==="rename"){let W=yield*Z.rename({session_id:G,id:Q.id,summary:Q.summary});return{title:`Task ${Q.id}: renamed`,output:`rename \u2192 "${W.summary}"`,metadata:{id:W.id,status:W.status}}}return yield*X.fail(Error(`Unknown operation: ${Q.action}`))});return{description:$,parameters:MX,execute:(K,V)=>Y(K,V).pipe(X.orDie),shell:{description:J,parse:gM,recover:fM}}}));var ZW={current:void 0};var H2={};o$(H2,{list:()=>uM,get:()=>dM,BuiltinWorkflow:()=>H2});function uM(){return e.resolveWorkflowSummaries()}function dM($){return e.resolveWorkflowSpec($)}var pM="workflow",cM=CX,s7=40,n7=160;function YW($){if($.length<=s7+n7+1)return $.slice();let J=$.length-s7-n7;return[...$.slice(0,s7),{kind:"log",text:`\u2026(${J} lines omitted)`},...$.slice($.length-n7)]}var a7=B$(pM,X.gen(function*(){let $=(yield*e.toolDescriptionEffect("workflow"))??"",J=yield*w$.Service,Z=()=>{let K=ZW.current;if(!K)return X.fail(Error("Workflow runtime unavailable \u2014 WorkflowRuntime.defaultLayer must be running for the workflow tool"));return X.succeed(K)},Y=X.fn("WorkflowTool.execute")(function*(K,V){let Q=yield*Z();if(K.operation==="run"){let G=yield*J.get();if(K.name&&K.script)return yield*X.fail(Error("workflow run: provide either `name` (a built-in) or `script` (inline), not both."));let W=K.name?(yield*X.promise(()=>H2.get(K.name)))?.script:K.script;if(!W){let M=(yield*X.promise(()=>H2.list())).map((I)=>I.name).join(", ");return yield*X.fail(Error(K.name?`Unknown built-in workflow "${K.name}". Known: ${M||"(none)"}.`:"workflow run requires either `name` (a built-in) or `script` (inline)."))}let j=(yield*Q.start({script:W,sessionID:V.sessionID,parentActorID:V.agent??"main",args:K.args,workspace:K.workspace,maxConcurrentAgents:G.workflow?.maxConcurrentAgents,scriptDeadlineMs:G.workflow?.scriptDeadlineMs,notifyOnTerminal:K.async===!0})).runID,B=K.name??"inline";if(K.async===!0)return{title:"workflow started",output:`Workflow started in background. run_id: ${j}
7436
+ The result will be delivered as a notification when complete.`,metadata:{runID:j,status:"running"}};yield*V.metadata({metadata:{runID:j,status:"running",transcript:[]}});let q=0,U=yield*X.forkScoped(X.gen(function*(){while(!0){yield*X.sleep("250 millis");let M=yield*Q.transcript({runID:j});if(M.length===q)continue;q=M.length,yield*V.metadata({metadata:{runID:j,status:"running",transcript:YW(M)}})}})),z=yield*Q.wait({runID:j});yield*Z8.interrupt(U);let C=YW(yield*Q.transcript({runID:j})),D=C.map((M)=>M.kind==="phase"?`\u25B8 ${M.text}`:` ${M.text}`);if(z.status==="completed"){let M=JSON.stringify(z.result??null),I=M.length>4000?M.slice(0,4000)+" \u2026(truncated)":M;return{title:`workflow ${B} completed`,output:(D.length?D.join(`
7437
7437
  `)+`
7438
7438
 
7439
- `:"")+`Result: ${P}
7440
- run_id: ${j}`,metadata:{runID:j,status:"completed",transcript:M}}}if(z.status==="failed")return{title:`workflow ${H} failed`,output:(I.length?I.join(`
7439
+ `:"")+`Result: ${I}
7440
+ run_id: ${j}`,metadata:{runID:j,status:"completed",transcript:C}}}if(z.status==="failed")return{title:`workflow ${B} failed`,output:(D.length?D.join(`
7441
7441
  `)+`
7442
7442
 
7443
7443
  `:"")+`Error: ${z.error}
7444
- run_id: ${j}`,metadata:{runID:j,status:"failed",transcript:M}};return{title:`workflow ${H} cancelled`,output:(I.length?I.join(`
7444
+ run_id: ${j}`,metadata:{runID:j,status:"failed",transcript:C}};return{title:`workflow ${B} cancelled`,output:(D.length?D.join(`
7445
7445
  `)+`
7446
7446
 
7447
7447
  `:"")+`Cancelled.
7448
- run_id: ${j}`,metadata:{runID:j,status:"cancelled",transcript:M}}}if(K.operation==="status"){let X=yield*V.status({runID:K.run_id});return{title:`workflow ${X.status}`,output:JSON.stringify(X),metadata:{runID:K.run_id,status:X.status}}}if(K.operation==="wait"){let X=yield*V.wait({runID:K.run_id,timeoutMs:K.timeout_ms});return{title:`workflow ${X.status}`,output:JSON.stringify(X),metadata:{runID:K.run_id,status:X.status}}}if(K.operation==="cancel")return yield*V.cancel({runID:K.run_id}),{title:"workflow cancelled",output:`Cancelled ${K.run_id}`,metadata:{runID:K.run_id,status:"cancelled"}};if(K.operation==="resume"){let X=yield*V.resume({runID:K.run_id});return{title:X.resumed?"workflow resumed":"workflow not resumable",output:JSON.stringify(X),metadata:{runID:K.run_id}}}throw Error(`unhandled workflow operation: ${K.operation}`)});return{description:$,parameters:vC,execute:(K,Q)=>Y(K,Q).pipe(G.scoped,G.orDie)}}));function _I($){for(var J=1;J<arguments.length;J++){var Z=arguments[J];for(var Y in Z)if(Z.hasOwnProperty(Y))$[Y]=Z[Y]}return $}function _3($,J){return Array(J+1).join($)}function OI($){return $.replace(/^\n*/,"")}function qI($){var J=$.length;while(J>0&&$[J-1]===`
7449
- `)J--;return $.substring(0,J)}var FI=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function O3($){return q3($,FI)}var WU=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function jU($){return q3($,WU)}function zI($){return BU($,WU)}var UU=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function CI($){return q3($,UU)}function MI($){return BU($,UU)}function q3($,J){return J.indexOf($.nodeName)>=0}function BU($,J){return $.getElementsByTagName&&J.some(function(Z){return $.getElementsByTagName(Z).length})}var T0={};T0.paragraph={filter:"p",replacement:function($){return`
7448
+ run_id: ${j}`,metadata:{runID:j,status:"cancelled",transcript:C}}}if(K.operation==="status"){let G=yield*Q.status({runID:K.run_id});return{title:`workflow ${G.status}`,output:JSON.stringify(G),metadata:{runID:K.run_id,status:G.status}}}if(K.operation==="wait"){let G=yield*Q.wait({runID:K.run_id,timeoutMs:K.timeout_ms});return{title:`workflow ${G.status}`,output:JSON.stringify(G),metadata:{runID:K.run_id,status:G.status}}}if(K.operation==="cancel")return yield*Q.cancel({runID:K.run_id}),{title:"workflow cancelled",output:`Cancelled ${K.run_id}`,metadata:{runID:K.run_id,status:"cancelled"}};if(K.operation==="resume"){let G=yield*Q.resume({runID:K.run_id});return{title:G.resumed?"workflow resumed":"workflow not resumable",output:JSON.stringify(G),metadata:{runID:K.run_id}}}throw Error(`unhandled workflow operation: ${K.operation}`)});return{description:$,parameters:cM,execute:(K,V)=>Y(K,V).pipe(X.scoped,X.orDie)}}));function PI($){for(var J=1;J<arguments.length;J++){var Z=arguments[J];for(var Y in Z)if(Z.hasOwnProperty(Y))$[Y]=Z[Y]}return $}function q3($,J){return Array(J+1).join($)}function II($){return $.replace(/^\n*/,"")}function AI($){var J=$.length;while(J>0&&$[J-1]===`
7449
+ `)J--;return $.substring(0,J)}var SI=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function F3($){return z3($,SI)}var _U=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function OU($){return z3($,_U)}function RI($){return FU($,_U)}var qU=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function wI($){return z3($,qU)}function LI($){return FU($,qU)}function z3($,J){return J.indexOf($.nodeName)>=0}function FU($,J){return $.getElementsByTagName&&J.some(function(Z){return $.getElementsByTagName(Z).length})}var T0={};T0.paragraph={filter:"p",replacement:function($){return`
7450
7450
 
7451
7451
  `+$+`
7452
7452
 
7453
7453
  `}};T0.lineBreak={filter:"br",replacement:function($,J,Z){return Z.br+`
7454
- `}};T0.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function($,J,Z){var Y=Number(J.nodeName.charAt(1));if(Z.headingStyle==="setext"&&Y<3){var K=_3(Y===1?"=":"-",$.length);return`
7454
+ `}};T0.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function($,J,Z){var Y=Number(J.nodeName.charAt(1));if(Z.headingStyle==="setext"&&Y<3){var K=q3(Y===1?"=":"-",$.length);return`
7455
7455
 
7456
7456
  `+$+`
7457
7457
  `+K+`
7458
7458
 
7459
7459
  `}else return`
7460
7460
 
7461
- `+_3("#",Y)+" "+$+`
7461
+ `+q3("#",Y)+" "+$+`
7462
7462
 
7463
7463
  `}};T0.blockquote={filter:"blockquote",replacement:function($){return $=$.replace(/^\n+|\n+$/g,""),$=$.replace(/^/gm,"> "),`
7464
7464
 
@@ -7471,29 +7471,29 @@ run_id: ${j}`,metadata:{runID:j,status:"cancelled",transcript:M}}}if(K.operation
7471
7471
 
7472
7472
  `}};T0.listItem={filter:"li",replacement:function($,J,Z){$=$.replace(/^\n+/,"").replace(/\n+$/,`
7473
7473
  `).replace(/\n/gm,`
7474
- `);var Y=Z.bulletListMarker+" ",K=J.parentNode;if(K.nodeName==="OL"){var Q=K.getAttribute("start"),V=Array.prototype.indexOf.call(K.children,J);Y=(Q?Number(Q)+V:V+1)+". "}return Y+$+(J.nextSibling&&!/\n$/.test($)?`
7474
+ `);var Y=Z.bulletListMarker+" ",K=J.parentNode;if(K.nodeName==="OL"){var V=K.getAttribute("start"),Q=Array.prototype.indexOf.call(K.children,J);Y=(V?Number(V)+Q:Q+1)+". "}return Y+$+(J.nextSibling&&!/\n$/.test($)?`
7475
7475
  `:"")}};T0.indentedCodeBlock={filter:function($,J){return J.codeBlockStyle==="indented"&&$.nodeName==="PRE"&&$.firstChild&&$.firstChild.nodeName==="CODE"},replacement:function($,J,Z){return`
7476
7476
 
7477
7477
  `+J.firstChild.textContent.replace(/\n/g,`
7478
7478
  `)+`
7479
7479
 
7480
- `}};T0.fencedCodeBlock={filter:function($,J){return J.codeBlockStyle==="fenced"&&$.nodeName==="PRE"&&$.firstChild&&$.firstChild.nodeName==="CODE"},replacement:function($,J,Z){var Y=J.firstChild.getAttribute("class")||"",K=(Y.match(/language-(\S+)/)||[null,""])[1],Q=J.firstChild.textContent,V=Z.fence.charAt(0),X=3,W=new RegExp("^"+V+"{3,}","gm"),_;while(_=W.exec(Q))if(_[0].length>=X)X=_[0].length+1;var j=_3(V,X);return`
7480
+ `}};T0.fencedCodeBlock={filter:function($,J){return J.codeBlockStyle==="fenced"&&$.nodeName==="PRE"&&$.firstChild&&$.firstChild.nodeName==="CODE"},replacement:function($,J,Z){var Y=J.firstChild.getAttribute("class")||"",K=(Y.match(/language-(\S+)/)||[null,""])[1],V=J.firstChild.textContent,Q=Z.fence.charAt(0),G=3,W=new RegExp("^"+Q+"{3,}","gm"),_;while(_=W.exec(V))if(_[0].length>=G)G=_[0].length+1;var j=q3(Q,G);return`
7481
7481
 
7482
7482
  `+j+K+`
7483
- `+Q.replace(/\n$/,"")+`
7483
+ `+V.replace(/\n$/,"")+`
7484
7484
  `+j+`
7485
7485
 
7486
7486
  `}};T0.horizontalRule={filter:"hr",replacement:function($,J,Z){return`
7487
7487
 
7488
7488
  `+Z.hr+`
7489
7489
 
7490
- `}};T0.inlineLink={filter:function($,J){return J.linkStyle==="inlined"&&$.nodeName==="A"&&$.getAttribute("href")},replacement:function($,J){var Z=J.getAttribute("href");if(Z)Z=Z.replace(/([()])/g,"\\$1");var Y=_6(J.getAttribute("title"));if(Y)Y=' "'+Y.replace(/"/g,"\\\"")+'"';return"["+$+"]("+Z+Y+")"}};T0.referenceLink={filter:function($,J){return J.linkStyle==="referenced"&&$.nodeName==="A"&&$.getAttribute("href")},replacement:function($,J,Z){var Y=J.getAttribute("href"),K=_6(J.getAttribute("title"));if(K)K=' "'+K+'"';var Q,V;switch(Z.linkReferenceStyle){case"collapsed":Q="["+$+"][]",V="["+$+"]: "+Y+K;break;case"shortcut":Q="["+$+"]",V="["+$+"]: "+Y+K;break;default:var X=this.references.length+1;Q="["+$+"]["+X+"]",V="["+X+"]: "+Y+K}return this.references.push(V),Q},references:[],append:function($){var J="";if(this.references.length)J=`
7490
+ `}};T0.inlineLink={filter:function($,J){return J.linkStyle==="inlined"&&$.nodeName==="A"&&$.getAttribute("href")},replacement:function($,J){var Z=J.getAttribute("href");if(Z)Z=Z.replace(/([()])/g,"\\$1");var Y=_6(J.getAttribute("title"));if(Y)Y=' "'+Y.replace(/"/g,"\\\"")+'"';return"["+$+"]("+Z+Y+")"}};T0.referenceLink={filter:function($,J){return J.linkStyle==="referenced"&&$.nodeName==="A"&&$.getAttribute("href")},replacement:function($,J,Z){var Y=J.getAttribute("href"),K=_6(J.getAttribute("title"));if(K)K=' "'+K+'"';var V,Q;switch(Z.linkReferenceStyle){case"collapsed":V="["+$+"][]",Q="["+$+"]: "+Y+K;break;case"shortcut":V="["+$+"]",Q="["+$+"]: "+Y+K;break;default:var G=this.references.length+1;V="["+$+"]["+G+"]",Q="["+G+"]: "+Y+K}return this.references.push(Q),V},references:[],append:function($){var J="";if(this.references.length)J=`
7491
7491
 
7492
7492
  `+this.references.join(`
7493
7493
  `)+`
7494
7494
 
7495
- `,this.references=[];return J}};T0.emphasis={filter:["em","i"],replacement:function($,J,Z){if(!$.trim())return"";return Z.emDelimiter+$+Z.emDelimiter}};T0.strong={filter:["strong","b"],replacement:function($,J,Z){if(!$.trim())return"";return Z.strongDelimiter+$+Z.strongDelimiter}};T0.code={filter:function($){var J=$.previousSibling||$.nextSibling,Z=$.parentNode.nodeName==="PRE"&&!J;return $.nodeName==="CODE"&&!Z},replacement:function($){if(!$)return"";$=$.replace(/\r?\n|\r/g," ");var J=/^`|^ .*?[^ ].* $|`$/.test($)?" ":"",Z="`",Y=$.match(/`+/gm)||[];while(Y.indexOf(Z)!==-1)Z=Z+"`";return Z+J+$+J+Z}};T0.image={filter:"img",replacement:function($,J){var Z=_6(J.getAttribute("alt")),Y=J.getAttribute("src")||"",K=_6(J.getAttribute("title")),Q=K?' "'+K+'"':"";return Y?"!["+Z+"]("+Y+Q+")":""}};function _6($){return $?$.replace(/(\n+\s*)+/g,`
7496
- `):""}function HU($){this.options=$,this._keep=[],this._remove=[],this.blankRule={replacement:$.blankReplacement},this.keepReplacement=$.keepReplacement,this.defaultRule={replacement:$.defaultReplacement},this.array=[];for(var J in $.rules)this.array.push($.rules[J])}HU.prototype={add:function($,J){this.array.unshift(J)},keep:function($){this._keep.unshift({filter:$,replacement:this.keepReplacement})},remove:function($){this._remove.unshift({filter:$,replacement:function(){return""}})},forNode:function($){if($.isBlank)return this.blankRule;var J;if(J=U3(this.array,$,this.options))return J;if(J=U3(this._keep,$,this.options))return J;if(J=U3(this._remove,$,this.options))return J;return this.defaultRule},forEach:function($){for(var J=0;J<this.array.length;J++)$(this.array[J],J)}};function U3($,J,Z){for(var Y=0;Y<$.length;Y++){var K=$[Y];if(DI(K,J,Z))return K}return}function DI($,J,Z){var Y=$.filter;if(typeof Y==="string"){if(Y===J.nodeName.toLowerCase())return!0}else if(Array.isArray(Y)){if(Y.indexOf(J.nodeName.toLowerCase())>-1)return!0}else if(typeof Y==="function"){if(Y.call($,J,Z))return!0}else throw TypeError("`filter` needs to be a string, array, or function")}function PI($){var{element:J,isBlock:Z,isVoid:Y}=$,K=$.isPre||function(H){return H.nodeName==="PRE"};if(!J.firstChild||K(J))return;var Q=null,V=!1,X=null,W=GU(X,J,K);while(W!==J){if(W.nodeType===3||W.nodeType===4){var _=W.data.replace(/[ \r\n\t]+/g," ");if((!Q||/ $/.test(Q.data))&&!V&&_[0]===" ")_=_.substr(1);if(!_){W=B3(W);continue}W.data=_,Q=W}else if(W.nodeType===1){if(Z(W)||W.nodeName==="BR"){if(Q)Q.data=Q.data.replace(/ $/,"");Q=null,V=!1}else if(Y(W)||K(W))Q=null,V=!0;else if(Q)V=!1}else{W=B3(W);continue}var j=GU(X,W,K);X=W,W=j}if(Q){if(Q.data=Q.data.replace(/ $/,""),!Q.data)B3(Q)}}function B3($){var J=$.nextSibling||$.parentNode;return $.parentNode.removeChild($),J}function GU($,J,Z){if($&&$.parentNode===J||Z(J))return J.nextSibling||J.parentNode;return J.firstChild||J.nextSibling||J.parentNode}var _U=typeof window<"u"?window:{};function II(){var $=_U.DOMParser,J=!1;try{if(new $().parseFromString("","text/html"))J=!0}catch(Z){}return J}function AI(){var $=function(){};{var J=VU();$.prototype.parseFromString=function(Z){return J.createDocument(Z)}}return $}var SI=II()?_U.DOMParser:AI();function wI($,J){var Z;if(typeof $==="string"){var Y=RI().parseFromString('<x-turndown id="turndown-root">'+$+"</x-turndown>","text/html");Z=Y.getElementById("turndown-root")}else Z=$.cloneNode(!0);return PI({element:Z,isBlock:O3,isVoid:jU,isPre:J.preformattedCode?LI:null}),Z}var H3;function RI(){return H3=H3||new SI,H3}function LI($){return $.nodeName==="PRE"||$.nodeName==="CODE"}function NI($,J){return $.isBlock=O3($),$.isCode=$.nodeName==="CODE"||$.parentNode.isCode,$.isBlank=yI($),$.flankingWhitespace=TI($,J),$}function yI($){return!jU($)&&!CI($)&&/^\s*$/i.test($.textContent)&&!zI($)&&!MI($)}function TI($,J){if($.isBlock||J.preformattedCode&&$.isCode)return{leading:"",trailing:""};var Z=kI($.textContent);if(Z.leadingAscii&&XU("left",$,J))Z.leading=Z.leadingNonAscii;if(Z.trailingAscii&&XU("right",$,J))Z.trailing=Z.trailingNonAscii;return{leading:Z.leading,trailing:Z.trailing}}function kI($){var J=$.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:J[1],leadingAscii:J[2],leadingNonAscii:J[3],trailing:J[4],trailingNonAscii:J[5],trailingAscii:J[6]}}function XU($,J,Z){var Y,K,Q;if($==="left")Y=J.previousSibling,K=/ $/;else Y=J.nextSibling,K=/^ /;if(Y){if(Y.nodeType===3)Q=K.test(Y.nodeValue);else if(Z.preformattedCode&&Y.nodeName==="CODE")Q=!1;else if(Y.nodeType===1&&!O3(Y))Q=K.test(Y.textContent)}return Q}var EI=Array.prototype.reduce,xI=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function O6($){if(!(this instanceof O6))return new O6($);var J={rules:T0,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(Z,Y){return Y.isBlock?`
7495
+ `,this.references=[];return J}};T0.emphasis={filter:["em","i"],replacement:function($,J,Z){if(!$.trim())return"";return Z.emDelimiter+$+Z.emDelimiter}};T0.strong={filter:["strong","b"],replacement:function($,J,Z){if(!$.trim())return"";return Z.strongDelimiter+$+Z.strongDelimiter}};T0.code={filter:function($){var J=$.previousSibling||$.nextSibling,Z=$.parentNode.nodeName==="PRE"&&!J;return $.nodeName==="CODE"&&!Z},replacement:function($){if(!$)return"";$=$.replace(/\r?\n|\r/g," ");var J=/^`|^ .*?[^ ].* $|`$/.test($)?" ":"",Z="`",Y=$.match(/`+/gm)||[];while(Y.indexOf(Z)!==-1)Z=Z+"`";return Z+J+$+J+Z}};T0.image={filter:"img",replacement:function($,J){var Z=_6(J.getAttribute("alt")),Y=J.getAttribute("src")||"",K=_6(J.getAttribute("title")),V=K?' "'+K+'"':"";return Y?"!["+Z+"]("+Y+V+")":""}};function _6($){return $?$.replace(/(\n+\s*)+/g,`
7496
+ `):""}function zU($){this.options=$,this._keep=[],this._remove=[],this.blankRule={replacement:$.blankReplacement},this.keepReplacement=$.keepReplacement,this.defaultRule={replacement:$.defaultReplacement},this.array=[];for(var J in $.rules)this.array.push($.rules[J])}zU.prototype={add:function($,J){this.array.unshift(J)},keep:function($){this._keep.unshift({filter:$,replacement:this.keepReplacement})},remove:function($){this._remove.unshift({filter:$,replacement:function(){return""}})},forNode:function($){if($.isBlank)return this.blankRule;var J;if(J=B3(this.array,$,this.options))return J;if(J=B3(this._keep,$,this.options))return J;if(J=B3(this._remove,$,this.options))return J;return this.defaultRule},forEach:function($){for(var J=0;J<this.array.length;J++)$(this.array[J],J)}};function B3($,J,Z){for(var Y=0;Y<$.length;Y++){var K=$[Y];if(NI(K,J,Z))return K}return}function NI($,J,Z){var Y=$.filter;if(typeof Y==="string"){if(Y===J.nodeName.toLowerCase())return!0}else if(Array.isArray(Y)){if(Y.indexOf(J.nodeName.toLowerCase())>-1)return!0}else if(typeof Y==="function"){if(Y.call($,J,Z))return!0}else throw TypeError("`filter` needs to be a string, array, or function")}function yI($){var{element:J,isBlock:Z,isVoid:Y}=$,K=$.isPre||function(B){return B.nodeName==="PRE"};if(!J.firstChild||K(J))return;var V=null,Q=!1,G=null,W=HU(G,J,K);while(W!==J){if(W.nodeType===3||W.nodeType===4){var _=W.data.replace(/[ \r\n\t]+/g," ");if((!V||/ $/.test(V.data))&&!Q&&_[0]===" ")_=_.substr(1);if(!_){W=_3(W);continue}W.data=_,V=W}else if(W.nodeType===1){if(Z(W)||W.nodeName==="BR"){if(V)V.data=V.data.replace(/ $/,"");V=null,Q=!1}else if(Y(W)||K(W))V=null,Q=!0;else if(V)Q=!1}else{W=_3(W);continue}var j=HU(G,W,K);G=W,W=j}if(V){if(V.data=V.data.replace(/ $/,""),!V.data)_3(V)}}function _3($){var J=$.nextSibling||$.parentNode;return $.parentNode.removeChild($),J}function HU($,J,Z){if($&&$.parentNode===J||Z(J))return J.nextSibling||J.parentNode;return J.firstChild||J.nextSibling||J.parentNode}var MU=typeof window<"u"?window:{};function TI(){var $=MU.DOMParser,J=!1;try{if(new $().parseFromString("","text/html"))J=!0}catch(Z){}return J}function kI(){var $=function(){};{var J=UU();$.prototype.parseFromString=function(Z){return J.createDocument(Z)}}return $}var EI=TI()?MU.DOMParser:kI();function xI($,J){var Z;if(typeof $==="string"){var Y=bI().parseFromString('<x-turndown id="turndown-root">'+$+"</x-turndown>","text/html");Z=Y.getElementById("turndown-root")}else Z=$.cloneNode(!0);return yI({element:Z,isBlock:F3,isVoid:OU,isPre:J.preformattedCode?vI:null}),Z}var O3;function bI(){return O3=O3||new EI,O3}function vI($){return $.nodeName==="PRE"||$.nodeName==="CODE"}function hI($,J){return $.isBlock=F3($),$.isCode=$.nodeName==="CODE"||$.parentNode.isCode,$.isBlank=gI($),$.flankingWhitespace=fI($,J),$}function gI($){return!OU($)&&!wI($)&&/^\s*$/i.test($.textContent)&&!RI($)&&!LI($)}function fI($,J){if($.isBlock||J.preformattedCode&&$.isCode)return{leading:"",trailing:""};var Z=mI($.textContent);if(Z.leadingAscii&&BU("left",$,J))Z.leading=Z.leadingNonAscii;if(Z.trailingAscii&&BU("right",$,J))Z.trailing=Z.trailingNonAscii;return{leading:Z.leading,trailing:Z.trailing}}function mI($){var J=$.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:J[1],leadingAscii:J[2],leadingNonAscii:J[3],trailing:J[4],trailingNonAscii:J[5],trailingAscii:J[6]}}function BU($,J,Z){var Y,K,V;if($==="left")Y=J.previousSibling,K=/ $/;else Y=J.nextSibling,K=/^ /;if(Y){if(Y.nodeType===3)V=K.test(Y.nodeValue);else if(Z.preformattedCode&&Y.nodeName==="CODE")V=!1;else if(Y.nodeType===1&&!F3(Y))V=K.test(Y.textContent)}return V}var uI=Array.prototype.reduce,dI=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function O6($){if(!(this instanceof O6))return new O6($);var J={rules:T0,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(Z,Y){return Y.isBlock?`
7497
7497
 
7498
7498
  `:""},keepReplacement:function(Z,Y){return Y.isBlock?`
7499
7499
 
@@ -7503,87 +7503,87 @@ run_id: ${j}`,metadata:{runID:j,status:"cancelled",transcript:M}}}if(K.operation
7503
7503
 
7504
7504
  `+Z+`
7505
7505
 
7506
- `:Z}};this.options=_I({},J,$),this.rules=new HU(this.options)}O6.prototype={turndown:function($){if(!hI($))throw TypeError($+" is not a string, or an element/document/fragment node.");if($==="")return"";var J=OU.call(this,new wI($,this.options));return bI.call(this,J)},use:function($){if(Array.isArray($))for(var J=0;J<$.length;J++)this.use($[J]);else if(typeof $==="function")$(this);else throw TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function($,J){return this.rules.add($,J),this},keep:function($){return this.rules.keep($),this},remove:function($){return this.rules.remove($),this},escape:function($){return xI.reduce(function(J,Z){return J.replace(Z[0],Z[1])},$)}};function OU($){var J=this;return EI.call($.childNodes,function(Z,Y){Y=new NI(Y,J.options);var K="";if(Y.nodeType===3)K=Y.isCode?Y.nodeValue:J.escape(Y.nodeValue);else if(Y.nodeType===1)K=vI.call(J,Y);return qU(Z,K)},"")}function bI($){var J=this;return this.rules.forEach(function(Z){if(typeof Z.append==="function")$=qU($,Z.append(J.options))}),$.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function vI($){var J=this.rules.forNode($),Z=OU.call(this,$),Y=$.flankingWhitespace;if(Y.leading||Y.trailing)Z=Z.trim();return Y.leading+J.replacement(Z,$,this.options)+Y.trailing}function qU($,J){var Z=qI($),Y=OI(J),K=Math.max($.length-Z.length,J.length-Y.length),Q=`
7506
+ `:Z}};this.options=PI({},J,$),this.rules=new zU(this.options)}O6.prototype={turndown:function($){if(!lI($))throw TypeError($+" is not a string, or an element/document/fragment node.");if($==="")return"";var J=CU.call(this,new xI($,this.options));return pI.call(this,J)},use:function($){if(Array.isArray($))for(var J=0;J<$.length;J++)this.use($[J]);else if(typeof $==="function")$(this);else throw TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function($,J){return this.rules.add($,J),this},keep:function($){return this.rules.keep($),this},remove:function($){return this.rules.remove($),this},escape:function($){return dI.reduce(function(J,Z){return J.replace(Z[0],Z[1])},$)}};function CU($){var J=this;return uI.call($.childNodes,function(Z,Y){Y=new hI(Y,J.options);var K="";if(Y.nodeType===3)K=Y.isCode?Y.nodeValue:J.escape(Y.nodeValue);else if(Y.nodeType===1)K=cI.call(J,Y);return DU(Z,K)},"")}function pI($){var J=this;return this.rules.forEach(function(Z){if(typeof Z.append==="function")$=DU($,Z.append(J.options))}),$.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function cI($){var J=this.rules.forNode($),Z=CU.call(this,$),Y=$.flankingWhitespace;if(Y.leading||Y.trailing)Z=Z.trim();return Y.leading+J.replacement(Z,$,this.options)+Y.trailing}function DU($,J){var Z=AI($),Y=II(J),K=Math.max($.length-Z.length,J.length-Y.length),V=`
7507
7507
 
7508
- `.substring(0,K);return Z+Q+Y}function hI($){return $!=null&&(typeof $==="string"||$.nodeType&&($.nodeType===1||$.nodeType===9||$.nodeType===11))}var FU=O6;import F3 from"net";function gI($){if(F3.isIP($)!==4)return;let J=$.split(".").map(Number);if(J.length!==4||J.some((Z)=>!Number.isInteger(Z)||Z<0||Z>255))return;return J}function zU($){let J=$.replace(/^\[|\]$/g,"").split("%")[0].toLowerCase(),Z=gI(J);if(Z){let[K,Q]=Z;return K===0||K===10||K===127||K===100&&Q>=64&&Q<=127||K===169&&Q===254||K===172&&Q>=16&&Q<=31||K===192&&Q===0||K===192&&Q===168||K===198&&(Q===18||Q===19)||K>=224}if(F3.isIP(J)!==6)return!0;let Y=J.match(/::ffff:(\d+\.\d+\.\d+\.\d+)$/)?.[1];if(Y)return zU(Y);return!J.startsWith("2")&&!J.startsWith("3")}function z3($){let J=new URL($);if(J.protocol!=="http:"&&J.protocol!=="https:")throw Error("URL must use http:// or https://");if(J.username||J.password)throw Error("URL credentials are not allowed");return J.hash="",J}async function CU($,J,Z={}){let Y=$.hostname.replace(/^\[|\]$/g,""),K=F3.isIP(Y),Q=K===4?[{address:Y,family:4}]:K===6?[{address:Y,family:6}]:await(Z.lookup??((j)=>Bun.dns.lookup(j,{family:0,socketType:"tcp"})))(Y);if(!Q.length)throw Error(`Unable to resolve webfetch host: ${Y}`);let V=Z.allowAddress??((j)=>!zU(j)),X=Q.find((j)=>!V(j.address,J));if(X)throw Error(`Webfetch blocked non-public address: ${X.address}`);let W=Q.toSorted((j,H)=>j.family-H.family)[0],_=new URL($);return _.hostname=W.family===6?`[${W.address}]`:W.address,{logical:$,pinned:_,serverName:Y}}function MU($,J,Z){return fetch($.pinned,{headers:{...J,Host:$.logical.host},redirect:"manual",signal:Z,...$.logical.protocol==="https:"?{tls:{serverName:$.serverName}}:{}})}async function DU($,J,Z){let Y=Number($.headers.get("content-length"));if(Number.isFinite(Y)&&Y>J)throw Error(`Response too large (exceeds ${Math.floor(J/1024)}KB limit)`);if(!$.body)return new Uint8Array;let K=$.body.getReader(),Q=()=>void K.cancel(Z.reason);Z.addEventListener("abort",Q,{once:!0});let V=new Uint8Array(J),X=0;try{for(;;){let W=await K.read();if(W.done)break;if(X+=W.value.byteLength,X>J)throw await K.cancel(),Error(`Response too large (exceeds ${Math.floor(J/1024)}KB limit)`);V.set(W.value,X-W.value.byteLength)}}finally{Z.removeEventListener("abort",Q)}return V.slice(0,X)}var fI=524288,mI=30000,uI=120000,PU=5,dI=new Set([301,302,303,307,308]);function p8($){return $ instanceof Error?$:Error(String($))}function pI($={}){return H$("webfetch",G.gen(function*(){return{description:(yield*e.toolDescriptionEffect("webfetch"))??"",parameters:QG,execute:(Z,Y)=>G.gen(function*(){let K=yield*G.try({try:()=>z3(Z.url),catch:p8}),Q=(Z.timeout??mI/1000)*1000,V=Math.min(Math.max(Q,1000),uI),X="*/*";switch(Z.format){case"markdown":X="text/markdown;q=1.0, text/x-markdown;q=0.9, text/plain;q=0.8, text/html;q=0.7, */*;q=0.1";break;case"text":X="text/plain;q=1.0, text/markdown;q=0.9, text/html;q=0.8, */*;q=0.1";break;case"html":X="text/html;q=1.0, application/xhtml+xml;q=0.9, text/plain;q=0.8, text/markdown;q=0.7, */*;q=0.1";break;default:X="text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8"}let W={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36",Accept:X,"Accept-Language":"en-US,en;q=0.9"},_=(C,P)=>G.gen(function*(){let D=yield*G.tryPromise({try:()=>CU(C,P,$),catch:p8});yield*Y.ask({permission:"webfetch",patterns:[C.toString()],always:["*"],metadata:{url:C.toString(),format:Z.format,timeout:Z.timeout}});let L=(v)=>G.tryPromise({try:(m)=>MU(D,{...W,"User-Agent":v},AbortSignal.any([m,Y.abort])),catch:p8}),R=yield*L(W["User-Agent"]),N=R.status===403&&R.headers.get("cf-mitigated")==="challenge"?yield*G.gen(function*(){return yield*G.promise(()=>R.body?.cancel()??Promise.resolve()),yield*L("qitqode")}):R,x=N.headers.get("location");if(dI.has(N.status)&&x){if(P>=PU)throw Error(`Too many redirects (maximum ${PU})`);yield*G.promise(()=>N.body?.cancel()??Promise.resolve());let v=yield*G.try({try:()=>z3(new URL(x,C).toString()),catch:p8});return yield*_(v,P+1)}if(!N.ok)throw Error(`Request failed with HTTP status ${N.status}`);let b=yield*G.tryPromise({try:(v)=>DU(N,fI,AbortSignal.any([v,Y.abort])),catch:p8});return{response:N,bytes:b,url:C}}),{response:j,bytes:H,url:q}=yield*_(K,0).pipe(G.timeoutOrElse({duration:V,orElse:()=>G.die(Error("Request timed out"))})),U=j.headers.get("content-type")||"",z=U.split(";")[0]?.trim().toLowerCase()||"",M=`${q.toString()} (${U})`;if(CZ(z)){let C=Buffer.from(H).toString("base64");return{title:M,output:"Image fetched successfully",metadata:{},attachments:[{type:"file",mime:z,url:`data:${z};base64,${C}`}]}}let I=new TextDecoder().decode(H);switch(Z.format){case"markdown":if(U.includes("text/html"))return{output:lI(I),title:M,metadata:{}};return{output:I,title:M,metadata:{}};case"text":if(U.includes("text/html"))return{output:yield*G.promise(()=>cI(I)),title:M,metadata:{}};return{output:I,title:M,metadata:{}};case"html":return{output:I,title:M,metadata:{}};default:return{output:I,title:M,metadata:{}}}}).pipe(G.orDie)}}))}var IU=pI();async function cI($){let J="",Z=!1;return await new HTMLRewriter().on("script, style, noscript, iframe, object, embed",{element(){Z=!0},text(){}}).on("*",{element(K){if(!["script","style","noscript","iframe","object","embed"].includes(K.tagName))Z=!1},text(K){if(!Z)J+=K.text}}).transform(new Response($)).text(),J.trim()}function lI($){let J=new FU({headingStyle:"atx",hr:"---",bulletListMarker:"-",codeBlockStyle:"fenced",emDelimiter:"*"});return J.remove(["script","style","meta","link"]),J.turndown($)}import*as n1 from"path";import{mkdir as oI}from"fs/promises";var rI=5,C3=H$("write",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("write"))??"",J=yield*b0.Service,Z=yield*$$.Service,Y=yield*P$.Service,K=yield*W1.Service;return{description:$,parameters:YG,execute:(Q,V)=>G.gen(function*(){let X=n1.isAbsolute(Q.filePath)?Q.filePath:n1.join(t$.get(V.sessionID),Q.filePath);yield*u2(V,X);let W=yield*Z.existsSafe(X),_=W?yield*Z.readFileString(X):"";yield*F8({ctx:V,filePath:X,diffOld:_,diffNew:Q.content,write:G.gen(function*(){let z=n1.dirname(X);yield*G.promise(()=>oI(z,{recursive:!0}));let M=n1.join(z,`.tmp-${crypto.randomUUID()}`);yield*Z.writeFileString(M,Q.content),yield*Z.rename(M,X)}),event:W?"change":"add",format:K,bus:Y});let j="Wrote file successfully.";yield*J.touchFile(X,!0);let H=yield*J.diagnostics(),q=$$.normalizePath(X),U=0;for(let[z,M]of Object.entries(H)){let I=z===q;if(!I&&U>=rI)continue;let C=b0.Diagnostic.report(I?X:z,M);if(!C)continue;if(I){j+=`
7508
+ `.substring(0,K);return Z+V+Y}function lI($){return $!=null&&(typeof $==="string"||$.nodeType&&($.nodeType===1||$.nodeType===9||$.nodeType===11))}var PU=O6;import M3 from"net";function oI($){if(M3.isIP($)!==4)return;let J=$.split(".").map(Number);if(J.length!==4||J.some((Z)=>!Number.isInteger(Z)||Z<0||Z>255))return;return J}function IU($){let J=$.replace(/^\[|\]$/g,"").split("%")[0].toLowerCase(),Z=oI(J);if(Z){let[K,V]=Z;return K===0||K===10||K===127||K===100&&V>=64&&V<=127||K===169&&V===254||K===172&&V>=16&&V<=31||K===192&&V===0||K===192&&V===168||K===198&&(V===18||V===19)||K>=224}if(M3.isIP(J)!==6)return!0;let Y=J.match(/::ffff:(\d+\.\d+\.\d+\.\d+)$/)?.[1];if(Y)return IU(Y);return!J.startsWith("2")&&!J.startsWith("3")}function C3($){let J=new URL($);if(J.protocol!=="http:"&&J.protocol!=="https:")throw Error("URL must use http:// or https://");if(J.username||J.password)throw Error("URL credentials are not allowed");return J.hash="",J}async function AU($,J,Z={}){let Y=$.hostname.replace(/^\[|\]$/g,""),K=M3.isIP(Y),V=K===4?[{address:Y,family:4}]:K===6?[{address:Y,family:6}]:await(Z.lookup??((j)=>Bun.dns.lookup(j,{family:0,socketType:"tcp"})))(Y);if(!V.length)throw Error(`Unable to resolve webfetch host: ${Y}`);let Q=Z.allowAddress??((j)=>!IU(j)),G=V.find((j)=>!Q(j.address,J));if(G)throw Error(`Webfetch blocked non-public address: ${G.address}`);let W=V.toSorted((j,B)=>j.family-B.family)[0],_=new URL($);return _.hostname=W.family===6?`[${W.address}]`:W.address,{logical:$,pinned:_,serverName:Y}}function SU($,J,Z){return fetch($.pinned,{headers:{...J,Host:$.logical.host},redirect:"manual",signal:Z,...$.logical.protocol==="https:"?{tls:{serverName:$.serverName}}:{}})}async function RU($,J,Z){let Y=Number($.headers.get("content-length"));if(Number.isFinite(Y)&&Y>J)throw Error(`Response too large (exceeds ${Math.floor(J/1024)}KB limit)`);if(!$.body)return new Uint8Array;let K=$.body.getReader(),V=()=>void K.cancel(Z.reason);Z.addEventListener("abort",V,{once:!0});let Q=new Uint8Array(J),G=0;try{for(;;){let W=await K.read();if(W.done)break;if(G+=W.value.byteLength,G>J)throw await K.cancel(),Error(`Response too large (exceeds ${Math.floor(J/1024)}KB limit)`);Q.set(W.value,G-W.value.byteLength)}}finally{Z.removeEventListener("abort",V)}return Q.slice(0,G)}var rI=524288,iI=30000,sI=120000,wU=5,nI=new Set([301,302,303,307,308]);function p8($){return $ instanceof Error?$:Error(String($))}function aI($={}){return B$("webfetch",X.gen(function*(){return{description:(yield*e.toolDescriptionEffect("webfetch"))??"",parameters:GX,execute:(Z,Y)=>X.gen(function*(){let K=yield*X.try({try:()=>C3(Z.url),catch:p8}),V=(Z.timeout??iI/1000)*1000,Q=Math.min(Math.max(V,1000),sI),G="*/*";switch(Z.format){case"markdown":G="text/markdown;q=1.0, text/x-markdown;q=0.9, text/plain;q=0.8, text/html;q=0.7, */*;q=0.1";break;case"text":G="text/plain;q=1.0, text/markdown;q=0.9, text/html;q=0.8, */*;q=0.1";break;case"html":G="text/html;q=1.0, application/xhtml+xml;q=0.9, text/plain;q=0.8, text/markdown;q=0.7, */*;q=0.1";break;default:G="text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8"}let W={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36",Accept:G,"Accept-Language":"en-US,en;q=0.9"},_=(M,I)=>X.gen(function*(){let P=yield*X.tryPromise({try:()=>AU(M,I,$),catch:p8});yield*Y.ask({permission:"webfetch",patterns:[M.toString()],always:["*"],metadata:{url:M.toString(),format:Z.format,timeout:Z.timeout}});let L=(v)=>X.tryPromise({try:(m)=>SU(P,{...W,"User-Agent":v},AbortSignal.any([m,Y.abort])),catch:p8}),w=yield*L(W["User-Agent"]),N=w.status===403&&w.headers.get("cf-mitigated")==="challenge"?yield*X.gen(function*(){return yield*X.promise(()=>w.body?.cancel()??Promise.resolve()),yield*L("qitqode")}):w,x=N.headers.get("location");if(nI.has(N.status)&&x){if(I>=wU)throw Error(`Too many redirects (maximum ${wU})`);yield*X.promise(()=>N.body?.cancel()??Promise.resolve());let v=yield*X.try({try:()=>C3(new URL(x,M).toString()),catch:p8});return yield*_(v,I+1)}if(!N.ok)throw Error(`Request failed with HTTP status ${N.status}`);let b=yield*X.tryPromise({try:(v)=>RU(N,rI,AbortSignal.any([v,Y.abort])),catch:p8});return{response:N,bytes:b,url:M}}),{response:j,bytes:B,url:q}=yield*_(K,0).pipe(X.timeoutOrElse({duration:Q,orElse:()=>X.die(Error("Request timed out"))})),U=j.headers.get("content-type")||"",z=U.split(";")[0]?.trim().toLowerCase()||"",C=`${q.toString()} (${U})`;if(MZ(z)){let M=Buffer.from(B).toString("base64");return{title:C,output:"Image fetched successfully",metadata:{},attachments:[{type:"file",mime:z,url:`data:${z};base64,${M}`}]}}let D=new TextDecoder().decode(B);switch(Z.format){case"markdown":if(U.includes("text/html"))return{output:eI(D),title:C,metadata:{}};return{output:D,title:C,metadata:{}};case"text":if(U.includes("text/html"))return{output:yield*X.promise(()=>tI(D)),title:C,metadata:{}};return{output:D,title:C,metadata:{}};case"html":return{output:D,title:C,metadata:{}};default:return{output:D,title:C,metadata:{}}}}).pipe(X.orDie)}}))}var LU=aI();async function tI($){let J="",Z=!1;return await new HTMLRewriter().on("script, style, noscript, iframe, object, embed",{element(){Z=!0},text(){}}).on("*",{element(K){if(!["script","style","noscript","iframe","object","embed"].includes(K.tagName))Z=!1},text(K){if(!Z)J+=K.text}}).transform(new Response($)).text(),J.trim()}function eI($){let J=new PU({headingStyle:"atx",hr:"---",bulletListMarker:"-",codeBlockStyle:"fenced",emDelimiter:"*"});return J.remove(["script","style","meta","link"]),J.turndown($)}import*as n1 from"path";import{mkdir as $A}from"fs/promises";var JA=5,D3=B$("write",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("write"))??"",J=yield*b0.Service,Z=yield*$$.Service,Y=yield*P$.Service,K=yield*W1.Service;return{description:$,parameters:QX,execute:(V,Q)=>X.gen(function*(){let G=n1.isAbsolute(V.filePath)?V.filePath:n1.join(t$.get(Q.sessionID),V.filePath);yield*u2(Q,G);let W=yield*Z.existsSafe(G),_=W?yield*Z.readFileString(G):"";yield*F8({ctx:Q,filePath:G,diffOld:_,diffNew:V.content,write:X.gen(function*(){let z=n1.dirname(G);yield*X.promise(()=>$A(z,{recursive:!0}));let C=n1.join(z,`.tmp-${crypto.randomUUID()}`);yield*Z.writeFileString(C,V.content),yield*Z.rename(C,G)}),event:W?"change":"add",format:K,bus:Y});let j="Wrote file successfully.";yield*J.touchFile(G,!0);let B=yield*J.diagnostics(),q=$$.normalizePath(G),U=0;for(let[z,C]of Object.entries(B)){let D=z===q;if(!D&&U>=JA)continue;let M=b0.Diagnostic.report(D?G:z,C);if(!M)continue;if(D){j+=`
7509
7509
 
7510
7510
  LSP errors detected in this file, please fix:
7511
- ${C}`;continue}U++,j+=`
7511
+ ${M}`;continue}U++,j+=`
7512
7512
 
7513
7513
  LSP errors detected in other files:
7514
- ${C}`}return{title:n1.relative(B$.worktree,X),metadata:{diagnostics:H,filepath:X,exists:W},output:j}}).pipe(G.orDie)}}));var AU=H$("invalid",G.succeed({description:"Do not use",parameters:nV,execute:($)=>G.succeed({title:"Invalid Tool",output:`The arguments provided to the tool are invalid: ${$.error}`,metadata:{}})}));import SU from"path";import{pathToFileURL as iI}from"url";var M3=H$("skill",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("skill"))??"",J=yield*a0.Service,Z=yield*h0.Service;return{description:$,parameters:XG,execute:(Y,K)=>G.gen(function*(){let Q=yield*J.get(Y.name);if(!Q){let H=(yield*J.all()).map((q)=>q.name).join(", ");throw Error(`Skill "${Y.name}" not found. Available skills: ${H||"none"}`)}yield*K.ask({permission:"skill",patterns:[Y.name],always:[Y.name],metadata:{}});let V=SU.dirname(Q.location),X=iI(V).href,W=10,_=yield*Z.files({cwd:V,follow:!1,hidden:!0,signal:K.abort}).pipe(RU((j)=>!j.includes("SKILL.md")),wU((j)=>SU.resolve(V,j)),qZ(W),BJ,G.map((j)=>[...j].map((H)=>`<file>${H}</file>`).join(`
7515
- `)));return{title:`Loaded skill: ${Q.name}`,output:[`<skill_content name="${Q.name}">`,`# Skill: ${Q.name}`,"",Q.content.trim(),"",`Base directory for this skill: ${X}`,"Relative paths in this skill (e.g., scripts/, reference/) are relative to this base directory.","Note: file list is sampled.","","<skill_files>",_,"</skill_files>","</skill_content>"].join(`
7516
- `),metadata:{name:Q.name,dir:V}}}).pipe(G.orDie)}}));var sI=120000;function nI($){if(typeof $==="string")return $.trim()||"No results found.";let J=Array.isArray($)?$:Array.isArray($?.results)?$.results:[];if(J.length===0)return"No results found.";return J.map((Z,Y)=>{let K=Z,Q=K?.title??K?.name??"(no title)",V=K?.url??K?.link??K?.href??"",X=K?.snippet??K?.description??K?.body??K?.text??"",W=[`${Y+1}. ${Q}`];if(V)W.push(` ${V}`);if(X)W.push(` ${X}`);return W.join(`
7514
+ ${M}`}return{title:n1.relative(H$.worktree,G),metadata:{diagnostics:B,filepath:G,exists:W},output:j}}).pipe(X.orDie)}}));var NU=B$("invalid",X.succeed({description:"Do not use",parameters:eQ,execute:($)=>X.succeed({title:"Invalid Tool",output:`The arguments provided to the tool are invalid: ${$.error}`,metadata:{}})}));import yU from"path";import{pathToFileURL as ZA}from"url";var P3=B$("skill",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("skill"))??"",J=yield*a0.Service,Z=yield*h0.Service;return{description:$,parameters:UX,execute:(Y,K)=>X.gen(function*(){let V=yield*J.get(Y.name);if(!V){let B=(yield*J.all()).map((q)=>q.name).join(", ");throw Error(`Skill "${Y.name}" not found. Available skills: ${B||"none"}`)}yield*K.ask({permission:"skill",patterns:[Y.name],always:[Y.name],metadata:{}});let Q=yU.dirname(V.location),G=ZA(Q).href,W=10,_=yield*Z.files({cwd:Q,follow:!1,hidden:!0,signal:K.abort}).pipe(kU((j)=>!j.includes("SKILL.md")),TU((j)=>yU.resolve(Q,j)),qZ(W),HJ,X.map((j)=>[...j].map((B)=>`<file>${B}</file>`).join(`
7515
+ `)));return{title:`Loaded skill: ${V.name}`,output:[`<skill_content name="${V.name}">`,`# Skill: ${V.name}`,"",V.content.trim(),"",`Base directory for this skill: ${G}`,"Relative paths in this skill (e.g., scripts/, reference/) are relative to this base directory.","Note: file list is sampled.","","<skill_files>",_,"</skill_files>","</skill_content>"].join(`
7516
+ `),metadata:{name:V.name,dir:Q}}}).pipe(X.orDie)}}));var YA=120000;function KA($){if(typeof $==="string")return $.trim()||"No results found.";let J=Array.isArray($)?$:Array.isArray($?.results)?$.results:[];if(J.length===0)return"No results found.";return J.map((Z,Y)=>{let K=Z,V=K?.title??K?.name??"(no title)",Q=K?.url??K?.link??K?.href??"",G=K?.snippet??K?.description??K?.body??K?.text??"",W=[`${Y+1}. ${V}`];if(Q)W.push(` ${Q}`);if(G)W.push(` ${G}`);return W.join(`
7517
7517
  `)}).join(`
7518
7518
 
7519
- `)}var D3=H$("websearch",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("websearch"))??"";return{get description(){return $.replace("{{year}}",new Date().getFullYear().toString())},parameters:VG,execute:(J,Z)=>G.gen(function*(){yield*Z.ask({permission:"websearch",patterns:[J.query],always:["*"],metadata:{query:J.query,numResults:J.numResults,livecrawl:J.livecrawl,type:J.type,contextMaxCharacters:J.contextMaxCharacters,timeout:J.timeout}});let Y=J.timeout?Math.min(Math.max(J.timeout*1000,1000),sI):30000;return{output:yield*G.promise(()=>e.resolveBraveSearch(J.query,{numResults:J.numResults,timeoutMs:Y}).then(nI).catch((Q)=>`Web search failed: ${Q instanceof Error?Q.message:String(Q)}. Try using webfetch with a specific URL instead.`)),title:`Web search: ${J.query}`,metadata:{}}}).pipe(G.orDie)}}));function aI($){return Math.max(1,Math.min(20,Math.round($/500)))}function tI($){if(typeof $==="string")return $.trim()||"No results found.";let J=Array.isArray($)?$:Array.isArray($?.results)?$.results:[];if(J.length===0)return"No results found.";return J.map((Z,Y)=>{let K=Z,Q=K?.title??K?.name??"(no title)",V=K?.url??K?.link??K?.href??"",X=K?.snippet??K?.description??K?.body??K?.text??"",W=[`${Y+1}. ${Q}`];if(V)W.push(` ${V}`);if(X)W.push(` ${X}`);return W.join(`
7519
+ `)}var I3=B$("websearch",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("websearch"))??"";return{get description(){return $.replace("{{year}}",new Date().getFullYear().toString())},parameters:WX,execute:(J,Z)=>X.gen(function*(){yield*Z.ask({permission:"websearch",patterns:[J.query],always:["*"],metadata:{query:J.query,numResults:J.numResults,livecrawl:J.livecrawl,type:J.type,contextMaxCharacters:J.contextMaxCharacters,timeout:J.timeout}});let Y=J.timeout?Math.min(Math.max(J.timeout*1000,1000),YA):30000;return{output:yield*X.promise(()=>e.resolveBraveSearch(J.query,{numResults:J.numResults,timeoutMs:Y}).then(KA).catch((V)=>`Web search failed: ${V instanceof Error?V.message:String(V)}. Try using webfetch with a specific URL instead.`)),title:`Web search: ${J.query}`,metadata:{}}}).pipe(X.orDie)}}));function VA($){return Math.max(1,Math.min(20,Math.round($/500)))}function QA($){if(typeof $==="string")return $.trim()||"No results found.";let J=Array.isArray($)?$:Array.isArray($?.results)?$.results:[];if(J.length===0)return"No results found.";return J.map((Z,Y)=>{let K=Z,V=K?.title??K?.name??"(no title)",Q=K?.url??K?.link??K?.href??"",G=K?.snippet??K?.description??K?.body??K?.text??"",W=[`${Y+1}. ${V}`];if(Q)W.push(` ${Q}`);if(G)W.push(` ${G}`);return W.join(`
7520
7520
  `)}).join(`
7521
7521
 
7522
- `)}var P3=H$("codesearch",G.gen(function*(){return{description:(yield*e.toolDescriptionEffect("codesearch"))??"",parameters:GG,execute:(J,Z)=>G.gen(function*(){yield*Z.ask({permission:"codesearch",patterns:[J.query],always:["*"],metadata:{query:J.query,tokensNum:J.tokensNum}});let Y=aI(J.tokensNum||5000);return{output:yield*G.promise(()=>e.resolveBraveSearch(J.query,{numResults:Y,timeoutMs:30000}).then(tI).catch(()=>"No code snippets or documentation found. Please try a different query, be more specific about the library or programming concept, or check the spelling of framework names.")),title:`Code search: ${J.query}`,metadata:{}}}).pipe(G.orDie)}}));var eI=F.object({filePath:F.string().describe("Path to the file to analyze"),fileContent:F.string().describe("Full content of the file"),focusAreas:F.array(F.string()).optional().describe('Optional list of focus areas to check, e.g. ["security", "performance", "correctness", "style"]. When omitted the analysis covers all areas.')}),I3=H$("analyze_code",G.gen(function*(){return{description:(yield*e.toolDescriptionEffect("analyze_code"))??"",parameters:eI,execute:(J,Z)=>G.gen(function*(){let Y=yield*G.promise(()=>e.resolveAnalyzeCodeForIssues({filePath:J.filePath,fileContent:J.fileContent,focusAreas:J.focusAreas})),K=Y.issues??[],Q;if(K.length===0)Q=Y.summary??"No issues found.";else{let V=K.map((X,W)=>{let _=X.line!=null?` (line ${X.line})`:"",j=X.severity?`[${X.severity}]`:"",H=X.category?` {${X.category}}`:"",q=X.suggestion?`
7523
- Suggestion: ${X.suggestion}`:"";return`${W+1}. ${j}${H}${_} ${X.description}${q}`});if(Y.summary)V.unshift(Y.summary,"");Q=V.join(`
7522
+ `)}var A3=B$("codesearch",X.gen(function*(){return{description:(yield*e.toolDescriptionEffect("codesearch"))??"",parameters:jX,execute:(J,Z)=>X.gen(function*(){yield*Z.ask({permission:"codesearch",patterns:[J.query],always:["*"],metadata:{query:J.query,tokensNum:J.tokensNum}});let Y=VA(J.tokensNum||5000);return{output:yield*X.promise(()=>e.resolveBraveSearch(J.query,{numResults:Y,timeoutMs:30000}).then(QA).catch(()=>"No code snippets or documentation found. Please try a different query, be more specific about the library or programming concept, or check the spelling of framework names.")),title:`Code search: ${J.query}`,metadata:{}}}).pipe(X.orDie)}}));var XA=F.object({filePath:F.string().describe("Path to the file to analyze"),fileContent:F.string().describe("Full content of the file"),focusAreas:F.array(F.string()).optional().describe('Optional list of focus areas to check, e.g. ["security", "performance", "correctness", "style"]. When omitted the analysis covers all areas.')}),S3=B$("analyze_code",X.gen(function*(){return{description:(yield*e.toolDescriptionEffect("analyze_code"))??"",parameters:XA,execute:(J,Z)=>X.gen(function*(){let Y=yield*X.promise(()=>e.resolveAnalyzeCodeForIssues({filePath:J.filePath,fileContent:J.fileContent,focusAreas:J.focusAreas})),K=Y.issues??[],V;if(K.length===0)V=Y.summary??"No issues found.";else{let Q=K.map((G,W)=>{let _=G.line!=null?` (line ${G.line})`:"",j=G.severity?`[${G.severity}]`:"",B=G.category?` {${G.category}}`:"",q=G.suggestion?`
7523
+ Suggestion: ${G.suggestion}`:"";return`${W+1}. ${j}${B}${_} ${G.description}${q}`});if(Y.summary)Q.unshift(Y.summary,"");V=Q.join(`
7524
7524
 
7525
- `)}return{title:`Code analysis: ${J.filePath}`,output:Q,metadata:{issueCount:K.length,issues:K,summary:Y.summary}}}).pipe(G.orDie)}}));var $A=F.object({filePath:F.string().describe("Path to the file"),fileContent:F.string().describe("Full content of the file"),functionName:F.string().optional().describe("When provided, generate documentation only for this specific function or method"),format:F.enum(["markdown","jsdoc","docstring"]).optional().describe("Output format: markdown (default), jsdoc, or docstring")}),A3=H$("generate_docs",G.gen(function*(){return{description:(yield*e.toolDescriptionEffect("generate_docs"))??"",parameters:$A,execute:(J,Z)=>G.gen(function*(){let Y=yield*G.promise(()=>e.resolveGenerateDocumentation({filePath:J.filePath,fileContent:J.fileContent,functionName:J.functionName,format:J.format})),K=Y.documentation??Y.content??"";return{title:`Documentation: ${J.functionName??J.filePath}`,output:K||"No documentation generated.",metadata:{}}}).pipe(G.orDie)}}));var JA=F.object({filePath:F.string().describe("Path to the file"),fileContent:F.string().describe("Full content of the file to annotate with inline comments")}),S3=H$("add_inline_comments",G.gen(function*(){return{description:(yield*e.toolDescriptionEffect("add_inline_comments"))??"",parameters:JA,execute:(J,Z)=>G.gen(function*(){let Y=yield*G.promise(()=>e.resolveGenerateInlineComments({filePath:J.filePath,fileContent:J.fileContent})),K=Y.annotatedCode??Y.code??Y.content??"",Q=K?d1(R1(J.filePath,J.filePath,J.fileContent,K)):void 0;return{title:`Inline comments: ${J.filePath}`,output:K||"No annotated code returned.",metadata:K?{originalContent:J.fileContent,diff:Q}:{}}}).pipe(G.orDie)}}));import w3 from"path";import{pathToFileURL as ZA}from"url";var LU=H$("lsp",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("lsp"))??"",J=yield*b0.Service,Z=yield*$$.Service;return{description:$,parameters:UG,execute:(Y,K)=>G.gen(function*(){let Q=w3.isAbsolute(Y.filePath)?Y.filePath:w3.join(B$.directory,Y.filePath);yield*_1(K,Q),yield*K.ask({permission:"lsp",patterns:["*"],always:["*"],metadata:{}});let V=ZA(Q).href,X={file:Q,line:Y.line-1,character:Y.character-1},W=w3.relative(B$.worktree,Q),_=`${Y.operation} ${W}:${Y.line}:${Y.character}`;if(!(yield*Z.existsSafe(Q)))throw Error(`File not found: ${Q}`);if(!(yield*J.hasClients(Q)))throw Error("No LSP server available for this file type.");yield*J.touchFile(Q,!0);let q=yield*(()=>{switch(Y.operation){case"goToDefinition":return J.definition(X);case"findReferences":return J.references(X);case"hover":return J.hover(X);case"documentSymbol":return J.documentSymbol(V);case"workspaceSymbol":return J.workspaceSymbol("");case"goToImplementation":return J.implementation(X);case"prepareCallHierarchy":return J.prepareCallHierarchy(X);case"incomingCalls":return J.incomingCalls(X);case"outgoingCalls":return J.outgoingCalls(X)}})();return{title:_,metadata:{result:q},output:q.length===0?`No results found for ${Y.operation}`:JSON.stringify(q,null,2)}})}}));import*as r0 from"path";import{rename as HA}from"fs/promises";var F2={};o$(F2,{parsePatch:()=>c8,maybeParseApplyPatchVerified:()=>BA,maybeParseApplyPatch:()=>EU,deriveNewContentsFromFileContents:()=>xU,deriveNewContentsFromChunks:()=>L3,applyPatch:()=>UA,applyHunksToFiles:()=>bU,PatchSchema:()=>YA,Patch:()=>F2,MaybeApplyPatchVerified:()=>kU,MaybeApplyPatch:()=>TU,ApplyPatchError:()=>yU});import*as a1 from"path";import*as o0 from"fs/promises";var q6=O$.create({service:"patch"}),YA=F.object({patchText:F.string().describe("The full patch text that describes all changes to be made")}),yU;((K)=>{K.ParseError="ParseError";K.IoError="IoError";K.ComputeReplacements="ComputeReplacements";K.ImplicitInvocation="ImplicitInvocation"})(yU||={});var TU;((K)=>{K.Body="Body";K.ShellParseError="ShellParseError";K.PatchParseError="PatchParseError";K.NotApplyPatch="NotApplyPatch"})(TU||={});var kU;((K)=>{K.Body="Body";K.ShellParseError="ShellParseError";K.CorrectnessError="CorrectnessError";K.NotApplyPatch="NotApplyPatch"})(kU||={});function KA($,J){let Z=$[J];if(Z.startsWith("*** Add File:")){let Y=Z.slice(13).trim();return Y?{filePath:Y,nextIdx:J+1}:null}if(Z.startsWith("*** Delete File:")){let Y=Z.slice(16).trim();return Y?{filePath:Y,nextIdx:J+1}:null}if(Z.startsWith("*** Update File:")){let Y=Z.slice(16).trim(),K,Q=J+1;if(Q<$.length&&$[Q].startsWith("*** Move to:"))K=$[Q].slice(12).trim(),Q++;return Y?{filePath:Y,movePath:K,nextIdx:Q}:null}return null}function QA($,J){let Z=[],Y=J;while(Y<$.length&&!$[Y].startsWith("***"))if($[Y].startsWith("@@")){let K=$[Y].substring(2).trim();Y++;let Q=[],V=[],X=!1;while(Y<$.length&&!$[Y].startsWith("@@")&&!$[Y].startsWith("***")){let W=$[Y];if(W==="*** End of File"){X=!0,Y++;break}if(W.startsWith(" ")){let _=W.substring(1);Q.push(_),V.push(_)}else if(W.startsWith("-"))Q.push(W.substring(1));else if(W.startsWith("+"))V.push(W.substring(1));Y++}Z.push({old_lines:Q,new_lines:V,change_context:K||void 0,is_end_of_file:X||void 0})}else Y++;return{chunks:Z,nextIdx:Y}}function VA($,J){let Z="",Y=J;while(Y<$.length&&!$[Y].startsWith("***")){if($[Y].startsWith("+"))Z+=$[Y].substring(1)+`
7525
+ `)}return{title:`Code analysis: ${J.filePath}`,output:V,metadata:{issueCount:K.length,issues:K,summary:Y.summary}}}).pipe(X.orDie)}}));var GA=F.object({filePath:F.string().describe("Path to the file"),fileContent:F.string().describe("Full content of the file"),functionName:F.string().optional().describe("When provided, generate documentation only for this specific function or method"),format:F.enum(["markdown","jsdoc","docstring"]).optional().describe("Output format: markdown (default), jsdoc, or docstring")}),R3=B$("generate_docs",X.gen(function*(){return{description:(yield*e.toolDescriptionEffect("generate_docs"))??"",parameters:GA,execute:(J,Z)=>X.gen(function*(){let Y=yield*X.promise(()=>e.resolveGenerateDocumentation({filePath:J.filePath,fileContent:J.fileContent,functionName:J.functionName,format:J.format})),K=Y.documentation??Y.content??"";return{title:`Documentation: ${J.functionName??J.filePath}`,output:K||"No documentation generated.",metadata:{}}}).pipe(X.orDie)}}));var WA=F.object({filePath:F.string().describe("Path to the file"),fileContent:F.string().describe("Full content of the file to annotate with inline comments")}),w3=B$("add_inline_comments",X.gen(function*(){return{description:(yield*e.toolDescriptionEffect("add_inline_comments"))??"",parameters:WA,execute:(J,Z)=>X.gen(function*(){let Y=yield*X.promise(()=>e.resolveGenerateInlineComments({filePath:J.filePath,fileContent:J.fileContent})),K=Y.annotatedCode??Y.code??Y.content??"",V=K?d1(w1(J.filePath,J.filePath,J.fileContent,K)):void 0;return{title:`Inline comments: ${J.filePath}`,output:K||"No annotated code returned.",metadata:K?{originalContent:J.fileContent,diff:V}:{}}}).pipe(X.orDie)}}));import L3 from"path";import{pathToFileURL as jA}from"url";var EU=B$("lsp",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("lsp"))??"",J=yield*b0.Service,Z=yield*$$.Service;return{description:$,parameters:_X,execute:(Y,K)=>X.gen(function*(){let V=L3.isAbsolute(Y.filePath)?Y.filePath:L3.join(H$.directory,Y.filePath);yield*_1(K,V),yield*K.ask({permission:"lsp",patterns:["*"],always:["*"],metadata:{}});let Q=jA(V).href,G={file:V,line:Y.line-1,character:Y.character-1},W=L3.relative(H$.worktree,V),_=`${Y.operation} ${W}:${Y.line}:${Y.character}`;if(!(yield*Z.existsSafe(V)))throw Error(`File not found: ${V}`);if(!(yield*J.hasClients(V)))throw Error("No LSP server available for this file type.");yield*J.touchFile(V,!0);let q=yield*(()=>{switch(Y.operation){case"goToDefinition":return J.definition(G);case"findReferences":return J.references(G);case"hover":return J.hover(G);case"documentSymbol":return J.documentSymbol(Q);case"workspaceSymbol":return J.workspaceSymbol("");case"goToImplementation":return J.implementation(G);case"prepareCallHierarchy":return J.prepareCallHierarchy(G);case"incomingCalls":return J.incomingCalls(G);case"outgoingCalls":return J.outgoingCalls(G)}})();return{title:_,metadata:{result:q},output:q.length===0?`No results found for ${Y.operation}`:JSON.stringify(q,null,2)}})}}));import*as r0 from"path";import{rename as DA}from"fs/promises";var F2={};o$(F2,{parsePatch:()=>c8,maybeParseApplyPatchVerified:()=>CA,maybeParseApplyPatch:()=>gU,deriveNewContentsFromFileContents:()=>fU,deriveNewContentsFromChunks:()=>y3,applyPatch:()=>MA,applyHunksToFiles:()=>mU,PatchSchema:()=>UA,Patch:()=>F2,MaybeApplyPatchVerified:()=>hU,MaybeApplyPatch:()=>vU,ApplyPatchError:()=>bU});import*as a1 from"path";import*as o0 from"fs/promises";var q6=O$.create({service:"patch"}),UA=F.object({patchText:F.string().describe("The full patch text that describes all changes to be made")}),bU;((K)=>{K.ParseError="ParseError";K.IoError="IoError";K.ComputeReplacements="ComputeReplacements";K.ImplicitInvocation="ImplicitInvocation"})(bU||={});var vU;((K)=>{K.Body="Body";K.ShellParseError="ShellParseError";K.PatchParseError="PatchParseError";K.NotApplyPatch="NotApplyPatch"})(vU||={});var hU;((K)=>{K.Body="Body";K.ShellParseError="ShellParseError";K.CorrectnessError="CorrectnessError";K.NotApplyPatch="NotApplyPatch"})(hU||={});function HA($,J){let Z=$[J];if(Z.startsWith("*** Add File:")){let Y=Z.slice(13).trim();return Y?{filePath:Y,nextIdx:J+1}:null}if(Z.startsWith("*** Delete File:")){let Y=Z.slice(16).trim();return Y?{filePath:Y,nextIdx:J+1}:null}if(Z.startsWith("*** Update File:")){let Y=Z.slice(16).trim(),K,V=J+1;if(V<$.length&&$[V].startsWith("*** Move to:"))K=$[V].slice(12).trim(),V++;return Y?{filePath:Y,movePath:K,nextIdx:V}:null}return null}function BA($,J){let Z=[],Y=J;while(Y<$.length&&!$[Y].startsWith("***"))if($[Y].startsWith("@@")){let K=$[Y].substring(2).trim();Y++;let V=[],Q=[],G=!1;while(Y<$.length&&!$[Y].startsWith("@@")&&!$[Y].startsWith("***")){let W=$[Y];if(W==="*** End of File"){G=!0,Y++;break}if(W.startsWith(" ")){let _=W.substring(1);V.push(_),Q.push(_)}else if(W.startsWith("-"))V.push(W.substring(1));else if(W.startsWith("+"))Q.push(W.substring(1));Y++}Z.push({old_lines:V,new_lines:Q,change_context:K||void 0,is_end_of_file:G||void 0})}else Y++;return{chunks:Z,nextIdx:Y}}function _A($,J){let Z="",Y=J;while(Y<$.length&&!$[Y].startsWith("***")){if($[Y].startsWith("+"))Z+=$[Y].substring(1)+`
7526
7526
  `;Y++}if(Z.endsWith(`
7527
- `))Z=Z.slice(0,-1);return{content:Z,nextIdx:Y}}function GA($){let J=$.match(/^(?:cat\s+)?<<['"]?(\w+)['"]?\s*\n([\s\S]*?)\n\1\s*$/);if(J)return J[2];return $}function c8($){let Z=GA($.trim()).split(`
7528
- `),Y=[],K=0,Q="*** Begin Patch",V="*** End Patch",X=Z.findIndex((_)=>_.trim()===Q),W=Z.findIndex((_)=>_.trim()===V);if(X===-1||W===-1||X>=W)throw Error("Invalid patch format: missing Begin/End markers");K=X+1;while(K<W){let _=KA(Z,K);if(!_){K++;continue}if(Z[K].startsWith("*** Add File:")){let{content:j,nextIdx:H}=VA(Z,_.nextIdx);Y.push({type:"add",path:_.filePath,contents:j}),K=H}else if(Z[K].startsWith("*** Delete File:"))Y.push({type:"delete",path:_.filePath}),K=_.nextIdx;else if(Z[K].startsWith("*** Update File:")){let{chunks:j,nextIdx:H}=QA(Z,_.nextIdx);Y.push({type:"update",path:_.filePath,move_path:_.movePath,chunks:j}),K=H}else K++}return{hunks:Y}}function EU($){let J=["apply_patch","applypatch"];if($.length===2&&J.includes($[0]))try{let{hunks:Z}=c8($[1]);return{type:"Body",args:{patch:$[1],hunks:Z}}}catch(Z){return{type:"PatchParseError",error:Z}}if($.length===3&&$[0]==="bash"&&$[1]==="-lc"){let Y=$[2].match(/apply_patch\s*<<['"](\w+)['"]\s*\n([\s\S]*?)\n\1/);if(Y){let K=Y[2];try{let{hunks:Q}=c8(K);return{type:"Body",args:{patch:K,hunks:Q}}}catch(Q){return{type:"PatchParseError",error:Q}}}}return{type:"NotApplyPatch"}}async function L3($,J){let Z;try{Z=await o0.readFile($,"utf-8")}catch(Y){throw Error(`Failed to read file ${$}: ${Y}`,{cause:Y})}return xU(Z,$,J)}function xU($,J,Z){let Y=$.split(`
7529
- `);if(Y.length>0&&Y[Y.length-1]==="")Y.pop();let K=XA(Y,J,Z),Q=WA(Y,K);if(Q.length===0||Q[Q.length-1]!=="")Q.push("");let V=Q.join(`
7530
- `);return{unified_diff:jA($,V),content:V}}function XA($,J,Z){let Y=[],K=0;for(let Q of Z){if(Q.change_context){let _=R3($,[Q.change_context],K);if(_===-1)throw Error(`Failed to find context '${Q.change_context}' in ${J}`);K=_+1}if(Q.old_lines.length===0){let _=$.length>0&&$[$.length-1]===""?$.length-1:$.length;Y.push([_,0,Q.new_lines]);continue}let{old_lines:V,new_lines:X}=Q,W=R3($,V,K,Q.is_end_of_file);if(W===-1&&V.length>0&&V[V.length-1]===""){if(V=V.slice(0,-1),X.length>0&&X[X.length-1]==="")X=X.slice(0,-1);W=R3($,V,K,Q.is_end_of_file)}if(W!==-1)Y.push([W,V.length,X]),K=W+V.length;else throw Error(`Failed to find expected lines in ${J}:
7531
- ${Q.old_lines.join(`
7532
- `)}`)}return Y.sort((Q,V)=>Q[0]-V[0]),Y}function WA($,J){let Z=[],Y=0;for(let[K,Q,V]of J){for(let X=Y;X<K;X++)Z.push($[X]);for(let X of V)Z.push(X);Y=K+Q}for(let K=Y;K<$.length;K++)Z.push($[K]);return Z}function NU($){return $.replace(/[\u2018\u2019\u201A\u201B]/g,"'").replace(/[\u201C\u201D\u201E\u201F]/g,'"').replace(/[\u2010\u2011\u2012\u2013\u2014\u2015]/g,"-").replace(/\u2026/g,"...").replace(/\u00A0/g," ")}function F6($,J,Z,Y,K){if(K){let Q=$.length-J.length;if(Q>=Z){let V=!0;for(let X=0;X<J.length;X++)if(!Y($[Q+X],J[X])){V=!1;break}if(V)return Q}}for(let Q=Z;Q<=$.length-J.length;Q++){let V=!0;for(let X=0;X<J.length;X++)if(!Y($[Q+X],J[X])){V=!1;break}if(V)return Q}return-1}function R3($,J,Z,Y=!1){if(J.length===0)return-1;let K=F6($,J,Z,(W,_)=>W===_,Y);if(K!==-1)return K;let Q=F6($,J,Z,(W,_)=>W.trimEnd()===_.trimEnd(),Y);if(Q!==-1)return Q;let V=F6($,J,Z,(W,_)=>W.trim()===_.trim(),Y);if(V!==-1)return V;return F6($,J,Z,(W,_)=>NU(W.trim())===NU(_.trim()),Y)}function jA($,J){let Z=$.split(`
7527
+ `))Z=Z.slice(0,-1);return{content:Z,nextIdx:Y}}function OA($){let J=$.match(/^(?:cat\s+)?<<['"]?(\w+)['"]?\s*\n([\s\S]*?)\n\1\s*$/);if(J)return J[2];return $}function c8($){let Z=OA($.trim()).split(`
7528
+ `),Y=[],K=0,V="*** Begin Patch",Q="*** End Patch",G=Z.findIndex((_)=>_.trim()===V),W=Z.findIndex((_)=>_.trim()===Q);if(G===-1||W===-1||G>=W)throw Error("Invalid patch format: missing Begin/End markers");K=G+1;while(K<W){let _=HA(Z,K);if(!_){K++;continue}if(Z[K].startsWith("*** Add File:")){let{content:j,nextIdx:B}=_A(Z,_.nextIdx);Y.push({type:"add",path:_.filePath,contents:j}),K=B}else if(Z[K].startsWith("*** Delete File:"))Y.push({type:"delete",path:_.filePath}),K=_.nextIdx;else if(Z[K].startsWith("*** Update File:")){let{chunks:j,nextIdx:B}=BA(Z,_.nextIdx);Y.push({type:"update",path:_.filePath,move_path:_.movePath,chunks:j}),K=B}else K++}return{hunks:Y}}function gU($){let J=["apply_patch","applypatch"];if($.length===2&&J.includes($[0]))try{let{hunks:Z}=c8($[1]);return{type:"Body",args:{patch:$[1],hunks:Z}}}catch(Z){return{type:"PatchParseError",error:Z}}if($.length===3&&$[0]==="bash"&&$[1]==="-lc"){let Y=$[2].match(/apply_patch\s*<<['"](\w+)['"]\s*\n([\s\S]*?)\n\1/);if(Y){let K=Y[2];try{let{hunks:V}=c8(K);return{type:"Body",args:{patch:K,hunks:V}}}catch(V){return{type:"PatchParseError",error:V}}}}return{type:"NotApplyPatch"}}async function y3($,J){let Z;try{Z=await o0.readFile($,"utf-8")}catch(Y){throw Error(`Failed to read file ${$}: ${Y}`,{cause:Y})}return fU(Z,$,J)}function fU($,J,Z){let Y=$.split(`
7529
+ `);if(Y.length>0&&Y[Y.length-1]==="")Y.pop();let K=qA(Y,J,Z),V=FA(Y,K);if(V.length===0||V[V.length-1]!=="")V.push("");let Q=V.join(`
7530
+ `);return{unified_diff:zA($,Q),content:Q}}function qA($,J,Z){let Y=[],K=0;for(let V of Z){if(V.change_context){let _=N3($,[V.change_context],K);if(_===-1)throw Error(`Failed to find context '${V.change_context}' in ${J}`);K=_+1}if(V.old_lines.length===0){let _=$.length>0&&$[$.length-1]===""?$.length-1:$.length;Y.push([_,0,V.new_lines]);continue}let{old_lines:Q,new_lines:G}=V,W=N3($,Q,K,V.is_end_of_file);if(W===-1&&Q.length>0&&Q[Q.length-1]===""){if(Q=Q.slice(0,-1),G.length>0&&G[G.length-1]==="")G=G.slice(0,-1);W=N3($,Q,K,V.is_end_of_file)}if(W!==-1)Y.push([W,Q.length,G]),K=W+Q.length;else throw Error(`Failed to find expected lines in ${J}:
7531
+ ${V.old_lines.join(`
7532
+ `)}`)}return Y.sort((V,Q)=>V[0]-Q[0]),Y}function FA($,J){let Z=[],Y=0;for(let[K,V,Q]of J){for(let G=Y;G<K;G++)Z.push($[G]);for(let G of Q)Z.push(G);Y=K+V}for(let K=Y;K<$.length;K++)Z.push($[K]);return Z}function xU($){return $.replace(/[\u2018\u2019\u201A\u201B]/g,"'").replace(/[\u201C\u201D\u201E\u201F]/g,'"').replace(/[\u2010\u2011\u2012\u2013\u2014\u2015]/g,"-").replace(/\u2026/g,"...").replace(/\u00A0/g," ")}function F6($,J,Z,Y,K){if(K){let V=$.length-J.length;if(V>=Z){let Q=!0;for(let G=0;G<J.length;G++)if(!Y($[V+G],J[G])){Q=!1;break}if(Q)return V}}for(let V=Z;V<=$.length-J.length;V++){let Q=!0;for(let G=0;G<J.length;G++)if(!Y($[V+G],J[G])){Q=!1;break}if(Q)return V}return-1}function N3($,J,Z,Y=!1){if(J.length===0)return-1;let K=F6($,J,Z,(W,_)=>W===_,Y);if(K!==-1)return K;let V=F6($,J,Z,(W,_)=>W.trimEnd()===_.trimEnd(),Y);if(V!==-1)return V;let Q=F6($,J,Z,(W,_)=>W.trim()===_.trim(),Y);if(Q!==-1)return Q;return F6($,J,Z,(W,_)=>xU(W.trim())===xU(_.trim()),Y)}function zA($,J){let Z=$.split(`
7533
7533
  `),Y=J.split(`
7534
- `),K=["@@ -1 +1 @@"],Q=Math.max(Z.length,Y.length),V=!1;for(let X=0;X<Q;X++){let W=Z[X]||"",_=Y[X]||"";if(W!==_){if(W)K.push(`-${W}`);if(_)K.push(`+${_}`);V=!0}else if(W)K.push(` ${W}`)}return V?K.join(`
7534
+ `),K=["@@ -1 +1 @@"],V=Math.max(Z.length,Y.length),Q=!1;for(let G=0;G<V;G++){let W=Z[G]||"",_=Y[G]||"";if(W!==_){if(W)K.push(`-${W}`);if(_)K.push(`+${_}`);Q=!0}else if(W)K.push(` ${W}`)}return Q?K.join(`
7535
7535
  `)+`
7536
- `:""}async function bU($){if($.length===0)throw Error("No files were modified.");let J=[],Z=[],Y=[];for(let K of $)switch(K.type){case"add":let Q=a1.dirname(K.path);if(Q!=="."&&Q!=="/")await o0.mkdir(Q,{recursive:!0});await o0.writeFile(K.path,K.contents,"utf-8"),J.push(K.path),q6.info(`Added file: ${K.path}`);break;case"delete":await o0.unlink(K.path),Y.push(K.path),q6.info(`Deleted file: ${K.path}`);break;case"update":let V=await L3(K.path,K.chunks);if(K.move_path){let X=a1.dirname(K.move_path);if(X!=="."&&X!=="/")await o0.mkdir(X,{recursive:!0});await o0.writeFile(K.move_path,V.content,"utf-8"),await o0.unlink(K.path),Z.push(K.move_path),q6.info(`Moved file: ${K.path} -> ${K.move_path}`)}else await o0.writeFile(K.path,V.content,"utf-8"),Z.push(K.path),q6.info(`Updated file: ${K.path}`);break}return{added:J,modified:Z,deleted:Y}}async function UA($){let{hunks:J}=c8($);return bU(J)}async function BA($,J){if($.length===1)try{return c8($[0]),{type:"CorrectnessError",error:Error("ImplicitInvocation")}}catch{}let Z=EU($);switch(Z.type){case"Body":let{args:Y}=Z,K=Y.workdir?a1.resolve(J,Y.workdir):J,Q=new Map;for(let V of Y.hunks){let X=a1.resolve(K,V.type==="update"&&V.move_path?V.move_path:V.path);switch(V.type){case"add":Q.set(X,{type:"add",content:V.contents});break;case"delete":let W=a1.resolve(K,V.path);try{let j=await o0.readFile(W,"utf-8");Q.set(X,{type:"delete",content:j})}catch{return{type:"CorrectnessError",error:Error(`Failed to read file for deletion: ${W}`)}}break;case"update":let _=a1.resolve(K,V.path);try{let j=await L3(_,V.chunks);Q.set(X,{type:"update",unified_diff:j.unified_diff,move_path:V.move_path?a1.resolve(K,V.move_path):void 0,new_content:j.content})}catch(j){return{type:"CorrectnessError",error:j}}break}}return{type:"Body",action:{changes:Q,patch:Y.patch,cwd:K}};case"PatchParseError":return{type:"CorrectnessError",error:Z.error};case"NotApplyPatch":return{type:"NotApplyPatch"}}}var N3=H$("apply_patch",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("apply_patch"))??"",J=yield*b0.Service,Z=yield*$$.Service,Y=yield*W1.Service,K=yield*P$.Service,Q=G.fn("ApplyPatchTool.execute")(function*(V,X){if(!V.patchText)return yield*G.fail(Error("patchText is required"));let W;try{W=F2.parsePatch(V.patchText).hunks}catch(P){return yield*G.fail(Error(`apply_patch verification failed: ${P}`))}if(W.length===0){if(V.patchText.replace(/\r\n/g,`
7536
+ `:""}async function mU($){if($.length===0)throw Error("No files were modified.");let J=[],Z=[],Y=[];for(let K of $)switch(K.type){case"add":let V=a1.dirname(K.path);if(V!=="."&&V!=="/")await o0.mkdir(V,{recursive:!0});await o0.writeFile(K.path,K.contents,"utf-8"),J.push(K.path),q6.info(`Added file: ${K.path}`);break;case"delete":await o0.unlink(K.path),Y.push(K.path),q6.info(`Deleted file: ${K.path}`);break;case"update":let Q=await y3(K.path,K.chunks);if(K.move_path){let G=a1.dirname(K.move_path);if(G!=="."&&G!=="/")await o0.mkdir(G,{recursive:!0});await o0.writeFile(K.move_path,Q.content,"utf-8"),await o0.unlink(K.path),Z.push(K.move_path),q6.info(`Moved file: ${K.path} -> ${K.move_path}`)}else await o0.writeFile(K.path,Q.content,"utf-8"),Z.push(K.path),q6.info(`Updated file: ${K.path}`);break}return{added:J,modified:Z,deleted:Y}}async function MA($){let{hunks:J}=c8($);return mU(J)}async function CA($,J){if($.length===1)try{return c8($[0]),{type:"CorrectnessError",error:Error("ImplicitInvocation")}}catch{}let Z=gU($);switch(Z.type){case"Body":let{args:Y}=Z,K=Y.workdir?a1.resolve(J,Y.workdir):J,V=new Map;for(let Q of Y.hunks){let G=a1.resolve(K,Q.type==="update"&&Q.move_path?Q.move_path:Q.path);switch(Q.type){case"add":V.set(G,{type:"add",content:Q.contents});break;case"delete":let W=a1.resolve(K,Q.path);try{let j=await o0.readFile(W,"utf-8");V.set(G,{type:"delete",content:j})}catch{return{type:"CorrectnessError",error:Error(`Failed to read file for deletion: ${W}`)}}break;case"update":let _=a1.resolve(K,Q.path);try{let j=await y3(_,Q.chunks);V.set(G,{type:"update",unified_diff:j.unified_diff,move_path:Q.move_path?a1.resolve(K,Q.move_path):void 0,new_content:j.content})}catch(j){return{type:"CorrectnessError",error:j}}break}}return{type:"Body",action:{changes:V,patch:Y.patch,cwd:K}};case"PatchParseError":return{type:"CorrectnessError",error:Z.error};case"NotApplyPatch":return{type:"NotApplyPatch"}}}var T3=B$("apply_patch",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("apply_patch"))??"",J=yield*b0.Service,Z=yield*$$.Service,Y=yield*W1.Service,K=yield*P$.Service,V=X.fn("ApplyPatchTool.execute")(function*(Q,G){if(!Q.patchText)return yield*X.fail(Error("patchText is required"));let W;try{W=F2.parsePatch(Q.patchText).hunks}catch(I){return yield*X.fail(Error(`apply_patch verification failed: ${I}`))}if(W.length===0){if(Q.patchText.replace(/\r\n/g,`
7537
7537
  `).replace(/\r/g,`
7538
7538
  `).trim()===`*** Begin Patch
7539
- *** End Patch`)return yield*G.fail(Error("patch rejected: empty patch"));return yield*G.fail(Error("apply_patch verification failed: no hunks found"))}let _=[],j="";for(let P of W){let D=r0.resolve(t$.get(X.sessionID),P.path);switch(yield*u2(X,D),P.type){case"add":{let L=_.some((u)=>u.type==="delete"&&u.filePath===D);if(!L&&_.some((u)=>u.type==="add"&&u.filePath===D||u.type==="move"&&u.movePath===D))return yield*G.fail(Error(`apply_patch verification failed: Add File target already staged in this patch: ${D}. Remove the duplicate hunk.`));if(L?void 0:yield*Z.stat(D).pipe(G.catch(()=>G.succeed(void 0))))return yield*G.fail(Error(`apply_patch verification failed: Add File target already exists: ${D}. Use an Update File hunk to modify it, or delete it first if you intend to replace it.`));let x="",b=P.contents.length===0||P.contents.endsWith(`
7540
- `)?P.contents:`${P.contents}
7541
- `,v=d1(R1(D,D,x,b)),m=0,A=0;for(let u of z8(x,b)){if(u.added)m+=u.count||0;if(u.removed)A+=u.count||0}_.push({filePath:D,oldContent:x,newContent:b,type:"add",diff:v,additions:m,deletions:A}),j+=v+`
7542
- `;break}case"update":{let L=yield*Z.stat(D).pipe(G.catch(()=>G.succeed(void 0)));if(!L||L.type==="Directory")return yield*G.fail(Error(`apply_patch verification failed: Failed to read file to update: ${D}`));let R=yield*Z.readFileString(D),N=R;try{N=F2.deriveNewContentsFromFileContents(R,D,P.chunks).content}catch(A){return yield*G.fail(Error(`apply_patch verification failed: ${A}`))}let x=d1(R1(D,D,R,N)),b=0,v=0;for(let A of z8(R,N)){if(A.added)b+=A.count||0;if(A.removed)v+=A.count||0}let m=P.move_path?r0.resolve(t$.get(X.sessionID),P.move_path):void 0;if(yield*u2(X,m),m&&m!==D){let A=_.some((S)=>S.type==="delete"&&S.filePath===m);if(!A&&_.some((S)=>S.type==="add"&&S.filePath===m||S.type==="move"&&S.movePath===m))return yield*G.fail(Error(`apply_patch verification failed: Move destination already staged in this patch: ${m}. Delete it first if you intend to replace it.`));if(A?void 0:yield*Z.stat(m).pipe(G.catch(()=>G.succeed(void 0))))return yield*G.fail(Error(`apply_patch verification failed: Move destination already exists: ${m}. Delete it first if you intend to replace it.`))}_.push({filePath:D,oldContent:R,newContent:N,type:P.move_path?"move":"update",movePath:m,diff:x,additions:b,deletions:v}),j+=x+`
7543
- `;break}case"delete":{let L=yield*Z.readFileString(D).pipe(G.catch((x)=>G.fail(Error(`apply_patch verification failed: ${x instanceof Error?x.message:String(x)}`)))),R=d1(R1(D,D,L,"")),N=L.split(`
7544
- `).length;_.push({filePath:D,oldContent:L,newContent:"",type:"delete",diff:R,additions:0,deletions:N}),j+=R+`
7545
- `;break}}}let H=_.map((P)=>({filePath:P.filePath,relativePath:r0.relative(B$.worktree,P.movePath??P.filePath).replaceAll("\\","/"),type:P.type,patch:P.diff,additions:P.additions,deletions:P.deletions,movePath:P.movePath})),q=H.length===1?H[0].relativePath:`${H.length} files`,U=_.filter((P)=>!$$.contains(r0.join(f$.Path.data,"memory"),P.movePath??P.filePath));if(U.length>0){let P=U.map((D)=>r0.relative(B$.worktree,D.filePath).replaceAll("\\","/"));yield*X.ask({permission:"edit",patterns:P,always:["*"],metadata:{filepath:P.join(", "),diff:U.map((D)=>D.diff).join(`
7539
+ *** End Patch`)return yield*X.fail(Error("patch rejected: empty patch"));return yield*X.fail(Error("apply_patch verification failed: no hunks found"))}let _=[],j="";for(let I of W){let P=r0.resolve(t$.get(G.sessionID),I.path);switch(yield*u2(G,P),I.type){case"add":{let L=_.some((u)=>u.type==="delete"&&u.filePath===P);if(!L&&_.some((u)=>u.type==="add"&&u.filePath===P||u.type==="move"&&u.movePath===P))return yield*X.fail(Error(`apply_patch verification failed: Add File target already staged in this patch: ${P}. Remove the duplicate hunk.`));if(L?void 0:yield*Z.stat(P).pipe(X.catch(()=>X.succeed(void 0))))return yield*X.fail(Error(`apply_patch verification failed: Add File target already exists: ${P}. Use an Update File hunk to modify it, or delete it first if you intend to replace it.`));let x="",b=I.contents.length===0||I.contents.endsWith(`
7540
+ `)?I.contents:`${I.contents}
7541
+ `,v=d1(w1(P,P,x,b)),m=0,A=0;for(let u of z8(x,b)){if(u.added)m+=u.count||0;if(u.removed)A+=u.count||0}_.push({filePath:P,oldContent:x,newContent:b,type:"add",diff:v,additions:m,deletions:A}),j+=v+`
7542
+ `;break}case"update":{let L=yield*Z.stat(P).pipe(X.catch(()=>X.succeed(void 0)));if(!L||L.type==="Directory")return yield*X.fail(Error(`apply_patch verification failed: Failed to read file to update: ${P}`));let w=yield*Z.readFileString(P),N=w;try{N=F2.deriveNewContentsFromFileContents(w,P,I.chunks).content}catch(A){return yield*X.fail(Error(`apply_patch verification failed: ${A}`))}let x=d1(w1(P,P,w,N)),b=0,v=0;for(let A of z8(w,N)){if(A.added)b+=A.count||0;if(A.removed)v+=A.count||0}let m=I.move_path?r0.resolve(t$.get(G.sessionID),I.move_path):void 0;if(yield*u2(G,m),m&&m!==P){let A=_.some((S)=>S.type==="delete"&&S.filePath===m);if(!A&&_.some((S)=>S.type==="add"&&S.filePath===m||S.type==="move"&&S.movePath===m))return yield*X.fail(Error(`apply_patch verification failed: Move destination already staged in this patch: ${m}. Delete it first if you intend to replace it.`));if(A?void 0:yield*Z.stat(m).pipe(X.catch(()=>X.succeed(void 0))))return yield*X.fail(Error(`apply_patch verification failed: Move destination already exists: ${m}. Delete it first if you intend to replace it.`))}_.push({filePath:P,oldContent:w,newContent:N,type:I.move_path?"move":"update",movePath:m,diff:x,additions:b,deletions:v}),j+=x+`
7543
+ `;break}case"delete":{let L=yield*Z.readFileString(P).pipe(X.catch((x)=>X.fail(Error(`apply_patch verification failed: ${x instanceof Error?x.message:String(x)}`)))),w=d1(w1(P,P,L,"")),N=L.split(`
7544
+ `).length;_.push({filePath:P,oldContent:L,newContent:"",type:"delete",diff:w,additions:0,deletions:N}),j+=w+`
7545
+ `;break}}}let B=_.map((I)=>({filePath:I.filePath,relativePath:r0.relative(H$.worktree,I.movePath??I.filePath).replaceAll("\\","/"),type:I.type,patch:I.diff,additions:I.additions,deletions:I.deletions,movePath:I.movePath})),q=B.length===1?B[0].relativePath:`${B.length} files`,U=_.filter((I)=>!$$.contains(r0.join(f$.Path.data,"memory"),I.movePath??I.filePath));if(U.length>0){let I=U.map((P)=>r0.relative(H$.worktree,P.filePath).replaceAll("\\","/"));yield*G.ask({permission:"edit",patterns:I,always:["*"],metadata:{filepath:I.join(", "),diff:U.map((P)=>P.diff).join(`
7546
7546
  `)+`
7547
- `,files:H.filter((D)=>!$$.contains(r0.join(f$.Path.data,"memory"),D.movePath??D.filePath))}})}let z=[];for(let P of _){let D=P.type==="delete"?void 0:P.movePath??P.filePath;switch(P.type){case"add":yield*Z.writeWithDirs(P.filePath,P.newContent),z.push({file:P.filePath,event:"add"});break;case"update":yield*Z.writeWithDirs(P.filePath,P.newContent),z.push({file:P.filePath,event:"change"});break;case"move":if(P.movePath){let{filePath:L,movePath:R}=P,N=!1;if(P.newContent===P.oldContent)N=yield*G.promise(async()=>{try{return await HA(L,R),!0}catch{return!1}});if(!N)yield*Z.writeWithDirs(R,P.newContent),yield*Z.remove(L).pipe(G.mapError((x)=>Error(`Move partially completed: '${R}' was written but '${L}' could not be removed: ${x}. Remove '${L}' manually to complete the move.`)));z.push({file:L,event:"unlink"}),z.push({file:R,event:"add"})}break;case"delete":yield*Z.remove(P.filePath),z.push({file:P.filePath,event:"unlink"});break}if(D)yield*Y.file(D),yield*K.publish(w2.Event.Edited,{file:D})}for(let P of z)yield*K.publish(k2.Event.Updated,P);for(let P of _){if(P.type==="delete")continue;let D=P.movePath??P.filePath;yield*J.touchFile(D,!0)}let M=yield*J.diagnostics(),C=`Success. Updated the following files:
7548
- ${_.map((P)=>{if(P.type==="add")return`A ${r0.relative(B$.worktree,P.filePath).replaceAll("\\","/")}`;if(P.type==="delete")return`D ${r0.relative(B$.worktree,P.filePath).replaceAll("\\","/")}`;let D=P.movePath??P.filePath;return`M ${r0.relative(B$.worktree,D).replaceAll("\\","/")}`}).join(`
7549
- `)}`;for(let P of _){if(P.type==="delete")continue;let D=P.movePath??P.filePath,L=b0.Diagnostic.report(D,M[$$.normalizePath(D)]??[]);if(!L)continue;let R=r0.relative(B$.worktree,D).replaceAll("\\","/");C+=`
7550
-
7551
- LSP errors detected in ${R}, please fix:
7552
- ${L}`}return{title:q,metadata:{diff:j,files:H,diagnostics:M},output:C}});return{description:$,parameters:WG,execute:(V,X)=>Q(V,X).pipe(G.orDie)}}));import z6 from"path";var _A=["Switch the working directory for the current session (like cd in a terminal).","","Use this when the user asks to switch, change, or cd into a directory,","or when you need to work extensively within a subdirectory (e.g., a monorepo package).","","After calling this tool, all subsequent file operations (read, edit, write, glob, grep, bash)","will resolve relative paths from the new directory. Subagents inherit the changed directory.","","Pass an absolute path, or a relative path (resolved from the current working directory).",'Pass "~" to reset back to the project root.'].join(`
7553
- `),vU=H$("change_directory",G.gen(function*(){let $=yield*$$.Service,J=yield*P$.Service;return{description:_A,parameters:jG,execute:(Z,Y)=>G.gen(function*(){let K=yield*i.context,Q=t$.get(Y.sessionID);if(Z.path==="~"||Z.path==="")return t$.clear(Y.sessionID),yield*J.publish(t$.Event.Changed,{sessionID:Y.sessionID,cwd:K.directory}),{title:"reset",metadata:{from:Q,to:K.directory},output:`Working directory reset to project root: ${K.directory}`};let V=z6.isAbsolute(Z.path)?Z.path:z6.resolve(Q,Z.path),X=z6.normalize(V),W=yield*$.stat(X).pipe(G.catch(()=>G.succeed(void 0)));if(!W)throw Error(`Directory does not exist: ${X}`);if(W.type!=="Directory")throw Error(`Path is not a directory: ${X}`);return yield*_1(Y,X,{kind:"directory"}),t$.set(Y.sessionID,X),yield*J.publish(t$.Event.Changed,{sessionID:Y.sessionID,cwd:X}),{title:z6.relative(K.worktree,X)||".",metadata:{from:Q,to:X},output:`Working directory changed: ${Q} \u2192 ${X}`}})}}));import sU from"path";import{pathToFileURL as PA}from"url";var l8={};o$(l8,{layer:()=>fU,defaultLayer:()=>OA,Todo:()=>l8,Service:()=>C6,Info:()=>hU,Event:()=>gU});var hU=F.object({content:F.string().describe("Brief description of the task"),status:F.string().describe("Current status of the task: pending, in_progress, completed, cancelled")}).meta({ref:"Todo"}),gU={Updated:Z0.define("todo.updated",F.object({sessionID:F0.zod,todos:F.array(hU)}))};class C6 extends D$.Service()("@qitqode/SessionTodo"){}var fU=f.effect(C6,G.gen(function*(){let $=yield*P$.Service,J=G.fn("Todo.update")(function*(Y){yield*G.sync(()=>z$.transaction((K)=>{if(K.delete(JJ).where(G$(JJ.session_id,Y.sessionID)).run(),Y.todos.length===0)return;K.insert(JJ).values(Y.todos.map((Q,V)=>({session_id:Y.sessionID,content:Q.content,status:Q.status,position:V}))).run()})),yield*$.publish(gU.Updated,Y)}),Z=G.fn("Todo.get")(function*(Y){return(yield*G.sync(()=>z$.use((Q)=>Q.select().from(JJ).where(G$(JJ.session_id,Y)).orderBy(m1(JJ.position)).all()))).map((Q)=>({content:Q.content,status:Q.status}))});return C6.of({update:J,get:Z})})),OA=fU.pipe(f.provide(P$.layer));var o8={};o$(o8,{layer:()=>uU,defaultLayer:()=>FA,Team:()=>o8,Service:()=>M6});var mU=Z0.define("team.created",F.object({teamID:F.string(),creatorSessionID:F0.zod})),Hg=Z0.define("team.member.joined",F.object({teamID:F.string(),sessionID:F0.zod,agent:F.string(),role:F.string()}));import*as ZJ from"fs/promises";import y3 from"path";var T3=O$.create({service:"team"});class M6 extends D$.Service()("@qitqode/Team"){}var uU=f.effect(M6,G.gen(function*(){let $=yield*P$.Service,J=(j)=>G.gen(function*(){let H=yield*i.context;return y3.join(H.directory,".qitqode","teams",j)}),Z=(j)=>G.map(J(j),(H)=>y3.join(H,"members.json")),Y=(j)=>G.gen(function*(){let H=yield*Z(j);return yield*G.promise(async()=>{try{let q=await ZJ.readFile(H,"utf-8");return JSON.parse(q)}catch{return[]}})}),K=(j,H)=>G.gen(function*(){let q=yield*Z(j);yield*G.promise(()=>ZJ.writeFile(q,JSON.stringify(H,null,2)))}),Q=G.fn("Team.create")(function*(j,H){let q=yield*J(j);yield*G.promise(()=>ZJ.mkdir(q,{recursive:!0})),yield*G.promise(()=>ZJ.writeFile(y3.join(q,"members.json"),"[]")),T3.info("team created",{teamID:j}),yield*$.publish(mU,{teamID:j,creatorSessionID:H})}),V=G.fn("Team.addMember")(function*(j,H,q,U){let z=yield*Y(j);if(!z.find((I)=>I.sessionID===H))z.push({sessionID:H,agent:q,role:U,joinedAt:Date.now()}),yield*K(j,z),T3.info("team member added",{teamID:j,sessionID:H,agent:q,role:U})}),X=G.fn("Team.removeMember")(function*(j,H){let q=yield*Y(j),U=q.filter((z)=>z.sessionID!==H);if(U.length!==q.length)yield*K(j,U),T3.info("team member removed",{teamID:j,sessionID:H})}),W=G.fn("Team.getMembers")(function*(j){return yield*Y(j)}),_=G.fn("Team.teamDir")(function*(j){return yield*J(j)});return M6.of({create:Q,addMember:V,removeMember:X,getMembers:W,teamDir:_})})),FA=uU.pipe(f.provide(P$.defaultLayer));var dU=F.object({script:F.string().min(1).describe(["Multi-line shell-style script. Each non-blank line is one command; commands run sequentially and stop on first failure.",`Quoting: "..." preserves literal newlines and processes \\" \\\\ escapes; '...' is verbatim.`,"<<EOF heredoc bodies are fully verbatim (no escape, no $vars).","# starts a line comment to end-of-line (quoted # is literal).","Variables ($VAR, ${VAR}) are preserved as literal text \u2014 no expansion.","See the tool description for the verb table."].join(" ")).refine(($)=>$.trim().length>0,{message:"script must not be blank"})});function oU($){if(!$.shell)throw Error(`shellWrap called on tool '${$.id}' that has no shell field`);let J=$.shell;return{id:$.id,description:J.description,parameters:dU,execute:(Z,Y)=>G.gen(function*(){let K=_Z(Z),Q=dU.safeParse(K.value);if(!Q.success){let H=J.recover?.(K.value);if(H!==void 0){let z=pU(H),M=yield*G.exit($.execute(H,Y));if(M._tag==="Failure")return{title:`${$.id}: invalid arguments`,output:D6(lU($.id,cU(M.cause))),metadata:{commands:0,success:0}};return{title:`${$.id}: ${z}`,output:M.value.output,metadata:{...M.value.metadata,commands:1,success:1}}}let U="script"in(typeof K.value==="object"&&K.value?K.value:{})?MA($.id):lU($.id);return{title:`${$.id}: missing script`,output:D6(U),metadata:{commands:0,success:0}}}let V=yield*G.exit(J.parse(Q.data.script));if(V._tag==="Failure"){let H=u0.squash(V.cause),q=DA($.id,H);return{title:`${$.id}: parse error`,output:D6(q),metadata:{commands:0,success:0}}}let X=V.value;if(X.length===0)return{title:`${$.id}: empty script`,output:D6(`${$.id}: no commands found in script`),metadata:{commands:0,success:0}};let W=[],_={},j=0;for(let H=0;H<X.length;H++){let q=X[H],U=pU(q),z=yield*G.exit($.execute(q,Y));if(z._tag==="Failure"){if(W.push(CA(H+1,U,cU(z.cause))),H+1<X.length)W.push(`<not-executed>commands #${H+2}..#${X.length}</not-executed>`);return{title:`${$.id}: command #${H+1} failed`,output:W.join(`
7554
- `),metadata:{commands:X.length,success:j}}}j++,_=z.value.metadata,W.push(zA(H+1,U,z.value.output))}return{title:`${$.id}: ${X.length} command(s)`,output:W.join(`
7555
- `),metadata:{..._,commands:X.length,success:j}}})}}function zA($,J,Z){return`<command index="${$}" operation="${rU(J)}">
7547
+ `,files:B.filter((P)=>!$$.contains(r0.join(f$.Path.data,"memory"),P.movePath??P.filePath))}})}let z=[];for(let I of _){let P=I.type==="delete"?void 0:I.movePath??I.filePath;switch(I.type){case"add":yield*Z.writeWithDirs(I.filePath,I.newContent),z.push({file:I.filePath,event:"add"});break;case"update":yield*Z.writeWithDirs(I.filePath,I.newContent),z.push({file:I.filePath,event:"change"});break;case"move":if(I.movePath){let{filePath:L,movePath:w}=I,N=!1;if(I.newContent===I.oldContent)N=yield*X.promise(async()=>{try{return await DA(L,w),!0}catch{return!1}});if(!N)yield*Z.writeWithDirs(w,I.newContent),yield*Z.remove(L).pipe(X.mapError((x)=>Error(`Move partially completed: '${w}' was written but '${L}' could not be removed: ${x}. Remove '${L}' manually to complete the move.`)));z.push({file:L,event:"unlink"}),z.push({file:w,event:"add"})}break;case"delete":yield*Z.remove(I.filePath),z.push({file:I.filePath,event:"unlink"});break}if(P)yield*Y.file(P),yield*K.publish(R2.Event.Edited,{file:P})}for(let I of z)yield*K.publish(k2.Event.Updated,I);for(let I of _){if(I.type==="delete")continue;let P=I.movePath??I.filePath;yield*J.touchFile(P,!0)}let C=yield*J.diagnostics(),M=`Success. Updated the following files:
7548
+ ${_.map((I)=>{if(I.type==="add")return`A ${r0.relative(H$.worktree,I.filePath).replaceAll("\\","/")}`;if(I.type==="delete")return`D ${r0.relative(H$.worktree,I.filePath).replaceAll("\\","/")}`;let P=I.movePath??I.filePath;return`M ${r0.relative(H$.worktree,P).replaceAll("\\","/")}`}).join(`
7549
+ `)}`;for(let I of _){if(I.type==="delete")continue;let P=I.movePath??I.filePath,L=b0.Diagnostic.report(P,C[$$.normalizePath(P)]??[]);if(!L)continue;let w=r0.relative(H$.worktree,P).replaceAll("\\","/");M+=`
7550
+
7551
+ LSP errors detected in ${w}, please fix:
7552
+ ${L}`}return{title:q,metadata:{diff:j,files:B,diagnostics:C},output:M}});return{description:$,parameters:HX,execute:(Q,G)=>V(Q,G).pipe(X.orDie)}}));import z6 from"path";var PA=["Switch the working directory for the current session (like cd in a terminal).","","Use this when the user asks to switch, change, or cd into a directory,","or when you need to work extensively within a subdirectory (e.g., a monorepo package).","","After calling this tool, all subsequent file operations (read, edit, write, glob, grep, bash)","will resolve relative paths from the new directory. Subagents inherit the changed directory.","","Pass an absolute path, or a relative path (resolved from the current working directory).",'Pass "~" to reset back to the project root.'].join(`
7553
+ `),uU=B$("change_directory",X.gen(function*(){let $=yield*$$.Service,J=yield*P$.Service;return{description:PA,parameters:BX,execute:(Z,Y)=>X.gen(function*(){let K=yield*i.context,V=t$.get(Y.sessionID);if(Z.path==="~"||Z.path==="")return t$.clear(Y.sessionID),yield*J.publish(t$.Event.Changed,{sessionID:Y.sessionID,cwd:K.directory}),{title:"reset",metadata:{from:V,to:K.directory},output:`Working directory reset to project root: ${K.directory}`};let Q=z6.isAbsolute(Z.path)?Z.path:z6.resolve(V,Z.path),G=z6.normalize(Q),W=yield*$.stat(G).pipe(X.catch(()=>X.succeed(void 0)));if(!W)throw Error(`Directory does not exist: ${G}`);if(W.type!=="Directory")throw Error(`Path is not a directory: ${G}`);return yield*_1(Y,G,{kind:"directory"}),t$.set(Y.sessionID,G),yield*J.publish(t$.Event.Changed,{sessionID:Y.sessionID,cwd:G}),{title:z6.relative(K.worktree,G)||".",metadata:{from:V,to:G},output:`Working directory changed: ${V} \u2192 ${G}`}})}}));import $H from"path";import{pathToFileURL as yA}from"url";var l8={};o$(l8,{layer:()=>cU,defaultLayer:()=>IA,Todo:()=>l8,Service:()=>M6,Info:()=>dU,Event:()=>pU});var dU=F.object({content:F.string().describe("Brief description of the task"),status:F.string().describe("Current status of the task: pending, in_progress, completed, cancelled")}).meta({ref:"Todo"}),pU={Updated:Z0.define("todo.updated",F.object({sessionID:F0.zod,todos:F.array(dU)}))};class M6 extends D$.Service()("@qitqode/SessionTodo"){}var cU=f.effect(M6,X.gen(function*(){let $=yield*P$.Service,J=X.fn("Todo.update")(function*(Y){yield*X.sync(()=>z$.transaction((K)=>{if(K.delete(JJ).where(X$(JJ.session_id,Y.sessionID)).run(),Y.todos.length===0)return;K.insert(JJ).values(Y.todos.map((V,Q)=>({session_id:Y.sessionID,content:V.content,status:V.status,position:Q}))).run()})),yield*$.publish(pU.Updated,Y)}),Z=X.fn("Todo.get")(function*(Y){return(yield*X.sync(()=>z$.use((V)=>V.select().from(JJ).where(X$(JJ.session_id,Y)).orderBy(m1(JJ.position)).all()))).map((V)=>({content:V.content,status:V.status}))});return M6.of({update:J,get:Z})})),IA=cU.pipe(f.provide(P$.layer));var o8={};o$(o8,{layer:()=>oU,defaultLayer:()=>SA,Team:()=>o8,Service:()=>C6});var lU=Z0.define("team.created",F.object({teamID:F.string(),creatorSessionID:F0.zod})),Pg=Z0.define("team.member.joined",F.object({teamID:F.string(),sessionID:F0.zod,agent:F.string(),role:F.string()}));import*as ZJ from"fs/promises";import k3 from"path";var E3=O$.create({service:"team"});class C6 extends D$.Service()("@qitqode/Team"){}var oU=f.effect(C6,X.gen(function*(){let $=yield*P$.Service,J=(j)=>X.gen(function*(){let B=yield*i.context;return k3.join(B.directory,".qitqode","teams",j)}),Z=(j)=>X.map(J(j),(B)=>k3.join(B,"members.json")),Y=(j)=>X.gen(function*(){let B=yield*Z(j);return yield*X.promise(async()=>{try{let q=await ZJ.readFile(B,"utf-8");return JSON.parse(q)}catch{return[]}})}),K=(j,B)=>X.gen(function*(){let q=yield*Z(j);yield*X.promise(()=>ZJ.writeFile(q,JSON.stringify(B,null,2)))}),V=X.fn("Team.create")(function*(j,B){let q=yield*J(j);yield*X.promise(()=>ZJ.mkdir(q,{recursive:!0})),yield*X.promise(()=>ZJ.writeFile(k3.join(q,"members.json"),"[]")),E3.info("team created",{teamID:j}),yield*$.publish(lU,{teamID:j,creatorSessionID:B})}),Q=X.fn("Team.addMember")(function*(j,B,q,U){let z=yield*Y(j);if(!z.find((D)=>D.sessionID===B))z.push({sessionID:B,agent:q,role:U,joinedAt:Date.now()}),yield*K(j,z),E3.info("team member added",{teamID:j,sessionID:B,agent:q,role:U})}),G=X.fn("Team.removeMember")(function*(j,B){let q=yield*Y(j),U=q.filter((z)=>z.sessionID!==B);if(U.length!==q.length)yield*K(j,U),E3.info("team member removed",{teamID:j,sessionID:B})}),W=X.fn("Team.getMembers")(function*(j){return yield*Y(j)}),_=X.fn("Team.teamDir")(function*(j){return yield*J(j)});return C6.of({create:V,addMember:Q,removeMember:G,getMembers:W,teamDir:_})})),SA=oU.pipe(f.provide(P$.defaultLayer));var rU=F.object({script:F.string().min(1).describe(["Multi-line shell-style script. Each non-blank line is one command; commands run sequentially and stop on first failure.",`Quoting: "..." preserves literal newlines and processes \\" \\\\ escapes; '...' is verbatim.`,"<<EOF heredoc bodies are fully verbatim (no escape, no $vars).","# starts a line comment to end-of-line (quoted # is literal).","Variables ($VAR, ${VAR}) are preserved as literal text \u2014 no expansion.","See the tool description for the verb table."].join(" ")).refine(($)=>$.trim().length>0,{message:"script must not be blank"})});function aU($){if(!$.shell)throw Error(`shellWrap called on tool '${$.id}' that has no shell field`);let J=$.shell;return{id:$.id,description:J.description,parameters:rU,execute:(Z,Y)=>X.gen(function*(){let K=_Z(Z),V=rU.safeParse(K.value);if(!V.success){let B=J.recover?.(K.value);if(B!==void 0){let z=iU(B),C=yield*X.exit($.execute(B,Y));if(C._tag==="Failure")return{title:`${$.id}: invalid arguments`,output:D6(nU($.id,sU(C.cause))),metadata:{commands:0,success:0}};return{title:`${$.id}: ${z}`,output:C.value.output,metadata:{...C.value.metadata,commands:1,success:1}}}let U="script"in(typeof K.value==="object"&&K.value?K.value:{})?LA($.id):nU($.id);return{title:`${$.id}: missing script`,output:D6(U),metadata:{commands:0,success:0}}}let Q=yield*X.exit(J.parse(V.data.script));if(Q._tag==="Failure"){let B=u0.squash(Q.cause),q=NA($.id,B);return{title:`${$.id}: parse error`,output:D6(q),metadata:{commands:0,success:0}}}let G=Q.value;if(G.length===0)return{title:`${$.id}: empty script`,output:D6(`${$.id}: no commands found in script`),metadata:{commands:0,success:0}};let W=[],_={},j=0;for(let B=0;B<G.length;B++){let q=G[B],U=iU(q),z=yield*X.exit($.execute(q,Y));if(z._tag==="Failure"){if(W.push(wA(B+1,U,sU(z.cause))),B+1<G.length)W.push(`<not-executed>commands #${B+2}..#${G.length}</not-executed>`);return{title:`${$.id}: command #${B+1} failed`,output:W.join(`
7554
+ `),metadata:{commands:G.length,success:j}}}j++,_=z.value.metadata,W.push(RA(B+1,U,z.value.output))}return{title:`${$.id}: ${G.length} command(s)`,output:W.join(`
7555
+ `),metadata:{..._,commands:G.length,success:j}}})}}function RA($,J,Z){return`<command index="${$}" operation="${tU(J)}">
7556
7556
  ${Z}
7557
- </command>`}function CA($,J,Z){return`<command index="${$}" operation="${rU(J)}" failed="true">
7557
+ </command>`}function wA($,J,Z){return`<command index="${$}" operation="${tU(J)}" failed="true">
7558
7558
  ${Z}
7559
- </command>`}function pU($){let J=$?.operation;if(typeof J==="string")return J;if(J&&typeof J==="object"&&typeof J.action==="string")return J.action;return"?"}function rU($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function cU($){let J=u0.squash($);if(J instanceof Error)return J.message;return String(J)}function D6($){return`<command failed="true">
7559
+ </command>`}function iU($){let J=$?.operation;if(typeof J==="string")return J;if(J&&typeof J==="object"&&typeof J.action==="string")return J.action;return"?"}function tU($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function sU($){let J=u0.squash($);if(J instanceof Error)return J.message;return String(J)}function D6($){return`<command failed="true">
7560
7560
  ${$}
7561
- </command>`}function MA($){return[`${$}: this tool takes a single \`script\` string (shell-style), not JSON fields.`,`Put the command in \`script\`, e.g.: ${$} <verb> ...`,"See the tool description for the verb list and examples."].join(`
7562
- `)}function lU($,J){return[`${$}: could not run the call.`,'Pass the operation as JSON, e.g.: {"operation":{"action":"<verb>", ...}}',...J?[`detail: ${J}`]:[]].join(`
7563
- `)}function DA($,J){if(J&&typeof J==="object"&&"kind"in J){let Z=J,Y=Z.line??"?";return`${$}: parse error at line ${Y}
7561
+ </command>`}function LA($){return[`${$}: this tool takes a single \`script\` string (shell-style), not JSON fields.`,`Put the command in \`script\`, e.g.: ${$} <verb> ...`,"See the tool description for the verb list and examples."].join(`
7562
+ `)}function nU($,J){return[`${$}: could not run the call.`,'Pass the operation as JSON, e.g.: {"operation":{"action":"<verb>", ...}}',...J?[`detail: ${J}`]:[]].join(`
7563
+ `)}function NA($,J){if(J&&typeof J==="object"&&"kind"in J){let Z=J,Y=Z.line??"?";return`${$}: parse error at line ${Y}
7564
7564
  ${Z.detail??Z.kind}`}if(J instanceof Error)return`${$}: parse error
7565
7565
  ${J.message}`;return`${$}: parse error
7566
- ${String(J)}`}function iU($,J){return $?.invocation_style_by_tool?.[J]??$?.invocation_style??"json"}var tU=O$.create({service:"tool.registry"});async function eU(){let $=await B2.list();if($.length===0)return"";return["","## Built-in workflows",'These named workflows are available via operation "run" with `name`. When a request matches one, invoke it instead of writing a script from scratch:',"",...$.map((Z)=>{let Y=Z.phases?.length?`
7567
- Phases: `+Z.phases.map((Q)=>Q.title).join(" \u2192 "):"",K=Z.whenToUse?`
7566
+ ${String(J)}`}function eU($,J){return $?.invocation_style_by_tool?.[J]??$?.invocation_style??"json"}var YH=O$.create({service:"tool.registry"});async function KH(){let $=await H2.list();if($.length===0)return"";return["","## Built-in workflows",'These named workflows are available via operation "run" with `name`. When a request matches one, invoke it instead of writing a script from scratch:',"",...$.map((Z)=>{let Y=Z.phases?.length?`
7567
+ Phases: `+Z.phases.map((V)=>V.title).join(" \u2192 "):"",K=Z.whenToUse?`
7568
7568
  When to use: ${Z.whenToUse}`:"";return`- ${Z.name}: ${Z.description}${K}${Y}`}),"",'Invoke a built-in: workflow({ operation: "run", name: "deep-research", args: "<the refined request>" })'].join(`
7569
- `)}var nU=new Set;function IA($){if(nU.has($))return;nU.add($),tU.warn(`tool '${$}' configured with invocation_style='shell' but has no shell field; falling back to JSON`)}class P6 extends D$.Service()("@qitqode/ToolRegistry"){}var $B=f.effect(P6,G.gen(function*(){let $=yield*R$.Service,J=yield*z2.Service,Z=yield*c0.Service,Y=yield*a0.Service,K=yield*Z1,Q=yield*AU,V=yield*o7,X=yield*iG,W=yield*AG,_=yield*LU,j=yield*PG,H=yield*DG,q=yield*IU,U=yield*D3,z=yield*aU,M=yield*P3,I=yield*I3,C=yield*A3,P=yield*S3,D=yield*hG,L=yield*C3,R=yield*T7,N=yield*fG,x=yield*N3,b=yield*vU,v=yield*M3,m=yield*mG,A=yield*uG,u=yield*nX,r=yield*s7,S=yield*c0.Service,T=yield*i.make(G.fn("ToolRegistry.state")(function*(y){let n=[];function a(t,C$){return{id:t,parameters:F.object(C$.args),description:C$.description,execute:(T$,M$)=>G.gen(function*(){let r$={...M$,ask:(M1)=>M$.ask(M1),directory:y.directory,worktree:y.worktree},K0=yield*G.promise(()=>C$.execute(T$,r$)),t1=typeof K0==="string"?K0:K0.output,a8=typeof K0==="string"?{}:K0.metadata??{},e1=yield*S.get(M$.agent),C1=yield*K.output(t1,{},e1);return{title:"",output:C1.truncated?C1.content:t1,metadata:{...a8,truncated:C1.truncated,...C1.truncated&&{outputPath:C1.outputPath}}}})}}let l=(yield*$.directories()).flatMap((t)=>y2.scanSync("{tool,tools}/*.{js,ts}",{cwd:t,absolute:!0,dot:!0,symlink:!0}));if(l.length)yield*$.waitForDependencies();for(let t of l){let C$=sU.basename(t,sU.extname(t)),T$=yield*G.promise(()=>import(`${PA(t).href}?v=${Date.now()}`));for(let[M$,r$]of Object.entries(T$))n.push(a(M$==="default"?C$:`${C$}_${M$}`,r$))}let d=yield*J.list();for(let t of d)for(let[C$,T$]of Object.entries(t.tool??{}))n.push(a(C$,T$));yield*$.get();let Y$=["app","cli","desktop"].includes(k$.QITQODE_CLIENT)||k$.QITQODE_ENABLE_QUESTION_TOOL,g=yield*G.all({invalid:n$(Q),bash:n$(z),read:n$(X),glob:n$(D),grep:n$(N),edit:n$(R),write:n$(L),actor:n$(V),fetch:n$(q),search:n$(U),code:n$(M),analyzecode:n$(I),generatedocs:n$(C),addinlinecomments:n$(P),skill:n$(v),patch:n$(x),changedir:n$(b),question:n$(W),lsp:n$(_),planexit:n$(j),planenter:n$(H),memory:n$(A),history:n$(m),task:n$(u),workflow:n$(r)});return{custom:n,builtin:[g.invalid,...Y$?[g.question]:[],g.bash,g.read,g.glob,g.grep,g.edit,g.write,g.actor,g.fetch,g.search,g.code,g.analyzecode,g.generatedocs,g.addinlinecomments,g.skill,g.patch,g.changedir,...k$.QITQODE_EXPERIMENTAL_LSP_TOOL?[g.lsp]:[],g.planexit,g.planenter,g.memory,g.history,g.task,...k$.QITQODE_EXPERIMENTAL_WORKFLOW_TOOL?[g.workflow]:[]],actor:g.actor,read:g.read}})),k=G.fn("ToolRegistry.all")(function*(){let y=yield*i.get(T),n=new Set(y.custom.map((c$)=>c$.id));return[...y.builtin.filter((c$)=>!n.has(c$.id)),...y.custom]}),A$=G.fn("ToolRegistry.ids")(function*(){return(yield*k()).map((y)=>y.id)}),s=G.fn("ToolRegistry.describeSkill")(function*(y){let n=yield*Y.available(y);if(n.length===0)return"No skills are currently available.";return["Load a specialized skill that provides domain-specific instructions and workflows.","","When you recognize that a task matches one of the available skills listed below, use this tool to load the full skill instructions.","","The skill will inject detailed instructions, workflows, and access to bundled resources (scripts, references, templates) into the conversation context.","",'Tool output includes a `<skill_content name="...">` block with the loaded content.',"","The following skills provide specialized sets of instructions for particular tasks","Invoke this tool to load a skill when a task matches one of the available skills listed below:","",a0.fmt(n,{verbose:!1})].join(`
7570
- `)}),J$=G.fn("ToolRegistry.describeWorkflow")(function*(){return yield*G.promise(()=>eU())}),Z$=G.fn("ToolRegistry.describeTask")(function*(y){return["Available agent types and the tools they have access to:",(yield*Z.list()).filter((d)=>d.mode!=="primary"&&!d.hidden).filter((d)=>E$.evaluate("task",d.name,y.permission).action!=="deny").toSorted((d,Y$)=>d.name.localeCompare(Y$.name)).map((d)=>`- ${d.name}: ${d.description??"This subagent should only be called manually by the user."}`).join(`
7569
+ `)}var JH=new Set;function TA($){if(JH.has($))return;JH.add($),YH.warn(`tool '${$}' configured with invocation_style='shell' but has no shell field; falling back to JSON`)}class P6 extends D$.Service()("@qitqode/ToolRegistry"){}var VH=f.effect(P6,X.gen(function*(){let $=yield*w$.Service,J=yield*z2.Service,Z=yield*c0.Service,Y=yield*a0.Service,K=yield*Z1,V=yield*NU,Q=yield*i7,G=yield*eX,W=yield*NX,_=yield*EU,j=yield*wX,B=yield*RX,q=yield*LU,U=yield*I3,z=yield*ZH,C=yield*A3,D=yield*S3,M=yield*R3,I=yield*w3,P=yield*dX,L=yield*D3,w=yield*E7,N=yield*cX,x=yield*T3,b=yield*uU,v=yield*P3,m=yield*lX,A=yield*oX,u=yield*JW,r=yield*a7,S=yield*c0.Service,T=yield*i.make(X.fn("ToolRegistry.state")(function*(y){let n=[];function a(t,M$){return{id:t,parameters:F.object(M$.args),description:M$.description,execute:(T$,C$)=>X.gen(function*(){let r$={...C$,ask:(C1)=>C$.ask(C1),directory:y.directory,worktree:y.worktree},K0=yield*X.promise(()=>M$.execute(T$,r$)),t1=typeof K0==="string"?K0:K0.output,a8=typeof K0==="string"?{}:K0.metadata??{},e1=yield*S.get(C$.agent),M1=yield*K.output(t1,{},e1);return{title:"",output:M1.truncated?M1.content:t1,metadata:{...a8,truncated:M1.truncated,...M1.truncated&&{outputPath:M1.outputPath}}}})}}let l=(yield*$.directories()).flatMap((t)=>y2.scanSync("{tool,tools}/*.{js,ts}",{cwd:t,absolute:!0,dot:!0,symlink:!0}));if(l.length)yield*$.waitForDependencies();for(let t of l){let M$=$H.basename(t,$H.extname(t)),T$=yield*X.promise(()=>import(`${yA(t).href}?v=${Date.now()}`));for(let[C$,r$]of Object.entries(T$))n.push(a(C$==="default"?M$:`${M$}_${C$}`,r$))}let d=yield*J.list();for(let t of d)for(let[M$,T$]of Object.entries(t.tool??{}))n.push(a(M$,T$));yield*$.get();let Y$=["app","cli","desktop"].includes(k$.QITQODE_CLIENT)||k$.QITQODE_ENABLE_QUESTION_TOOL,g=yield*X.all({invalid:n$(V),bash:n$(z),read:n$(G),glob:n$(P),grep:n$(N),edit:n$(w),write:n$(L),actor:n$(Q),fetch:n$(q),search:n$(U),code:n$(C),analyzecode:n$(D),generatedocs:n$(M),addinlinecomments:n$(I),skill:n$(v),patch:n$(x),changedir:n$(b),question:n$(W),lsp:n$(_),planexit:n$(j),planenter:n$(B),memory:n$(A),history:n$(m),task:n$(u),workflow:n$(r)});return{custom:n,builtin:[g.invalid,...Y$?[g.question]:[],g.bash,g.read,g.glob,g.grep,g.edit,g.write,g.actor,g.fetch,g.search,g.code,g.analyzecode,g.generatedocs,g.addinlinecomments,g.skill,g.patch,g.changedir,...k$.QITQODE_EXPERIMENTAL_LSP_TOOL?[g.lsp]:[],g.planexit,g.planenter,g.memory,g.history,g.task,...k$.QITQODE_EXPERIMENTAL_WORKFLOW_TOOL?[g.workflow]:[]],actor:g.actor,read:g.read}})),k=X.fn("ToolRegistry.all")(function*(){let y=yield*i.get(T),n=new Set(y.custom.map((c$)=>c$.id));return[...y.builtin.filter((c$)=>!n.has(c$.id)),...y.custom]}),A$=X.fn("ToolRegistry.ids")(function*(){return(yield*k()).map((y)=>y.id)}),s=X.fn("ToolRegistry.describeSkill")(function*(y){let n=yield*Y.available(y);if(n.length===0)return"No skills are currently available.";return["Load a specialized skill that provides domain-specific instructions and workflows.","","When you recognize that a task matches one of the available skills listed below, use this tool to load the full skill instructions.","","The skill will inject detailed instructions, workflows, and access to bundled resources (scripts, references, templates) into the conversation context.","",'Tool output includes a `<skill_content name="...">` block with the loaded content.',"","The following skills provide specialized sets of instructions for particular tasks","Invoke this tool to load a skill when a task matches one of the available skills listed below:","",a0.fmt(n,{verbose:!1})].join(`
7570
+ `)}),J$=X.fn("ToolRegistry.describeWorkflow")(function*(){return yield*X.promise(()=>KH())}),Z$=X.fn("ToolRegistry.describeTask")(function*(y){return["Available agent types and the tools they have access to:",(yield*Z.list()).filter((d)=>d.mode!=="primary"&&!d.hidden).filter((d)=>E$.evaluate("task",d.name,y.permission).action!=="deny").toSorted((d,Y$)=>d.name.localeCompare(Y$.name)).map((d)=>`- ${d.name}: ${d.description??"This subagent should only be called manually by the user."}`).join(`
7571
7571
  `)].join(`
7572
- `)}),W$=G.fn("ToolRegistry.tools")(function*(y){let n=(yield*k()).filter((l)=>{if(l.id===P3.id||l.id===D3.id)return y.providerID==="qlex"||y.providerID===I6.opencode||k$.QITQODE_ENABLE_EXA;if(l.id===I3.id||l.id===A3.id||l.id===S3.id)return y.providerID==="qlex";let d=y.modelID.includes("gpt-")&&!y.modelID.includes("oss")&&!y.modelID.includes("gpt-4");if(l.id===N3.id)return d;if(l.id===T7.id||l.id===C3.id)return!d;return!0});if(y.agent.toolAllowlist){let l=new Set(y.agent.toolAllowlist);n=n.filter((d)=>d.id==="invalid"||l.has(d.id))}let a=yield*$.get(),c$=(l)=>iU(a.tool,l);return yield*G.forEach(n,G.fnUntraced(function*(l){let M$=[];try{const d=w9(M$,tU.time(l.id),0);let Y$={description:l.description,parameters:l.parameters};yield*J.trigger("tool.definition",{toolID:l.id},Y$);let g=c$(l.id);let t=g==="shell"&&l.shell!==void 0;if(g==="shell"&&!l.shell)IA(l.id);let C$=t?oU(l):l;let T$=t?l.shell.description:Y$.description;return{id:l.id,description:[T$,l.id===o7.id?yield*Z$(y.agent):void 0,l.id===M3.id?yield*s(y.agent):void 0,l.id===s7.id?yield*J$():void 0].filter(Boolean).join(`
7573
- `),parameters:t?C$.parameters:Y$.parameters,execute:C$.execute,formatValidationError:C$.formatValidationError}}catch(r$){var K0=r$,t1=1}finally{R9(M$,K0,t1)}}),{concurrency:25})}),y$=G.fn("ToolRegistry.named")(function*(){let y=yield*i.get(T);return{actor:y.actor,read:y.read}}),Q$=G.fn("ToolRegistry.reload")(function*(){yield*Y.reload(),yield*J.reloadFileHooks(),yield*i.invalidate(T)});return P6.of({ids:A$,all:k,named:y$,tools:W$,reload:Q$})})),AA=f.suspend(()=>$B.pipe(f.provide(R$.defaultLayer),f.provide(z2.defaultLayer),f.provide(B1.defaultLayer),f.provide(l8.defaultLayer),f.provide(a0.defaultLayer),f.provide(c0.defaultLayer),f.provide(Y1.defaultLayer),f.provide(H1.defaultLayer),f.provide(b0.defaultLayer),f.provide(d2.defaultLayer),f.provide($$.defaultLayer),f.provide(P$.layer),f.provide(X2.layer),f.provide(W1.defaultLayer),f.provide(XJ),f.provide(h0.defaultLayer),f.provide(I7),f.provide(f.mergeAll(L1.defaultLayer,c2.defaultLayer)),f.provide(o8.defaultLayer),f.provide(f.mergeAll(g1.defaultLayer,MJ.defaultLayer,o2.defaultLayer,K1.defaultLayer,r8.defaultLayer))));import C2 from"path";function YJ($){return $.pipe(G.catchDefect((J)=>J instanceof e.BackendAuthRejectedError?G.succeed(void 0):G.die(J)))}var SA=F.object({name:F.string(),description:F.string().optional(),mode:F.enum(["subagent","primary","all"]),native:F.boolean().optional(),hidden:F.boolean().optional(),topP:F.number().optional(),temperature:F.number().optional(),color:F.union([F.string(),F.object({light:F.string(),dark:F.string()})]).optional(),permission:E$.Ruleset.zod,model:F.object({modelID:GB.zod,providerID:I6.zod}).optional(),modelRef:F.string().optional(),variant:F.string().optional(),prompt:F.string().optional(),options:F.record(F.string(),F.any()),steps:F.number().int().positive().optional(),toolAllowlist:F.array(F.string()).optional(),posture:jB.optional()}).meta({ref:"Agent"});class A6 extends D$.Service()("@qitqode/Agent"){}var BB=f.effect(A6,G.gen(function*(){let $=yield*R$.Service,J=yield*r8.Service,Z=yield*z2.Service,Y=yield*a0.Service,K=yield*H1.Service,Q=yield*i.make(G.fn("Agent.state")(function*(V){let X=yield*G.all([YJ(G.promise(()=>e.resolveAgentPrompt("explore"))),YJ(G.promise(()=>e.resolveAgentPrompt("title"))),YJ(G.promise(()=>e.resolveAgentPrompt("summary"))),YJ(G.promise(()=>e.resolveAgentPrompt("compaction"))),YJ(G.promise(()=>e.resolveAgentPrompt("dream"))),YJ(G.promise(()=>e.resolveAgentPrompt("distill")))],{concurrency:"unbounded"}),W=X[0]??"",_=X[1]??"",j=X[2]??"",H=X[3]??"",q=X[4]??"",U=X[5]??"",z=yield*$.get(),M=yield*Y.dirs(),I=[j1.GLOB,...M.map((v)=>C2.join(v,"*"))],C=E$.fromConfig({"*":"allow",doom_loop:"ask",external_directory:{"*":"ask",...Object.fromEntries(I.map((v)=>[v,"allow"]))},question:"deny",read:{"*":"allow","*.env":"ask","*.env.*":"ask","*.env.example":"allow"}}),P=E$.fromConfig(z.permission??{}),D=E$.merge(C,E$.fromConfig({"*":"deny",read:"allow",write:"allow",edit:"allow",glob:"allow",grep:"allow",memory:"allow",bash:"allow",external_directory:{[C2.join(f$.Path.data,"memory")]:"allow",[C2.join(f$.Path.data,"memory","*")]:"allow"}}),P),L=["read","write","edit","glob","grep","memory","bash"],R={build:{name:"build",color:{dark:"#ff6a00",light:"#b84a00"},description:"Executes tools based on configured permissions.",options:{},permission:E$.merge(C,E$.fromConfig({question:"allow"}),P),mode:"primary",native:!0},...z.experimental?.maxMode?{max:{name:"max",color:{dark:"#ff8a00",light:"#c2410c"},description:"Max mode (experimental). Runs N parallel reasoning candidates each step and executes the best one. Same permissions as build.",options:{},permission:E$.merge(C,E$.fromConfig({question:"allow"}),P),mode:"primary",native:!0}}:{},plan:{name:"plan",color:{dark:"#1cc7bb",light:"#0f766e"},description:"Plan mode. Disallows all edit tools.",options:{},permission:E$.merge(C,E$.fromConfig({question:"allow",external_directory:{[C2.join(f$.Path.data,"plans","*")]:"allow"},edit:{"*":"deny",[C2.join(".qitqode","plans","*.md")]:"allow",[C2.relative(B$.worktree,C2.join(f$.Path.data,C2.join("plans","*.md")))]:"allow"}}),P),mode:"primary",native:!0},compose:{name:"compose",color:{dark:"#a84462",light:"#6d213c"},description:"Compose mode. Orchestrates workflows with built-in compose skills.",options:{},permission:E$.merge(C,E$.fromConfig({question:"allow"}),P),mode:"primary",native:!0},general:{name:"general",color:{dark:"#8a8f98",light:"#6f747d"},description:"General-purpose agent for researching complex questions and executing multi-step tasks. Use this agent to execute multiple units of work in parallel.",permission:E$.merge(C,E$.fromConfig({change_directory:"deny"}),P),options:{},mode:"subagent",native:!0},explore:{name:"explore",color:{dark:"#ffb000",light:"#b45309"},permission:E$.merge(C,E$.fromConfig({"*":"deny",grep:"allow",glob:"allow",list:"allow",bash:"allow",webfetch:"allow",websearch:"allow",codesearch:"allow",read:"allow",external_directory:{"*":"ask",...Object.fromEntries(I.map((v)=>[v,"allow"]))}}),P),description:'Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. "src/components/**/*.tsx"), search code for keywords (eg. "API endpoints"), or answer questions about the codebase (eg. "how do API endpoints work?"). When calling this agent, specify the desired thoroughness level: "quick" for basic searches, "medium" for moderate exploration, or "very thorough" for comprehensive analysis across multiple locations and naming conventions.',prompt:W,options:{},mode:"subagent",native:!0},title:{name:"title",mode:"subagent",options:{},native:!0,hidden:!0,temperature:0.5,permission:E$.merge(C,E$.fromConfig({"*":"deny"}),P),prompt:_,toolAllowlist:[]},summary:{name:"summary",mode:"subagent",options:{},native:!0,hidden:!0,permission:E$.merge(C,E$.fromConfig({"*":"deny"}),P),prompt:j,toolAllowlist:[]},compaction:{name:"compaction",mode:"subagent",options:{},native:!0,hidden:!0,permission:E$.merge(C,E$.fromConfig({"*":"deny"}),P),prompt:H,toolAllowlist:[]},"checkpoint-writer":{name:"checkpoint-writer",mode:"subagent",options:{},native:!0,hidden:!0,permission:E$.merge(C,P)},dream:{name:"dream",mode:"subagent",options:{},native:!0,hidden:!0,prompt:q,permission:D,toolAllowlist:L},distill:{name:"distill",mode:"subagent",options:{},native:!0,hidden:!0,prompt:U,permission:D,toolAllowlist:L}};for(let[v,m]of Object.entries(z.agent??{})){if(m.disable){delete R[v];continue}let A=R[v];if(!A)A=R[v]={name:v,mode:"all",permission:E$.merge(C,P),options:{},native:!1};if(m.model)if(m.model.includes("/"))A.model=H1.parseModel(m.model);else A.modelRef=m.model;A.variant=m.variant??A.variant,A.prompt=m.prompt??A.prompt,A.description=m.description??A.description,A.temperature=m.temperature??A.temperature,A.topP=m.top_p??A.topP,A.mode=m.mode??A.mode,A.color=m.color??A.color,A.hidden=m.hidden??A.hidden,A.name=m.name??A.name,A.steps=m.steps??A.steps,A.toolAllowlist=m.tool_allowlist??A.toolAllowlist,A.options=F9(A.options,m.options??{}),A.permission=E$.merge(A.permission,E$.fromConfig(m.permission??{}))}for(let v of Object.values(R))v.posture=UB(v);for(let v in R){if(R[v].permission.some((u)=>{if(u.permission!=="external_directory")return!1;if(u.action!=="deny")return!1;return u.pattern===j1.GLOB}))continue;R[v].permission=E$.merge(R[v].permission,E$.fromConfig({external_directory:{[j1.GLOB]:"allow"}}))}let N=G.fnUntraced(function*(v){return R[v]}),x=G.fnUntraced(function*(){let v=yield*$.get();return YB(R,KB(),QB([(m)=>v.default_agent!==void 0&&m.name===v.default_agent,"desc"],[(m)=>m.name==="plan","desc"],[(m)=>m.name==="build","desc"],[(m)=>m.name==="compose","desc"],[(m)=>m.name==="max","desc"],[(m)=>m.name,"asc"]))}),b=G.fnUntraced(function*(){let v=yield*$.get();if(v.default_agent){let u=R[v.default_agent];if(!u)throw Error(`default agent "${v.default_agent}" not found`);if(u.mode==="subagent")throw Error(`default agent "${v.default_agent}" is a subagent`);if(u.hidden===!0)throw Error(`default agent "${v.default_agent}" is hidden`);return u.name}let m=R.plan;if(m&&m.mode!=="subagent"&&m.hidden!==!0)return m.name;let A=Object.values(R).find((u)=>u.mode!=="subagent"&&u.hidden!==!0);if(!A)throw Error("no primary visible agent found");return A.name});return{get:N,list:x,defaultAgent:b}}));return A6.of({get:G.fn("Agent.get")(function*(V){return yield*i.useEffect(Q,(X)=>X.get(V))}),list:G.fn("Agent.list")(function*(){return yield*i.useEffect(Q,(V)=>V.list())}),defaultAgent:G.fn("Agent.defaultAgent")(function*(){return yield*i.useEffect(Q,(V)=>V.defaultAgent())}),generate:G.fn("Agent.generate")(function*(V){let X=yield*$.get(),W=V.model??(yield*K.defaultModel()),_=yield*K.getModel(W.providerID,W.modelID),j=yield*K.getLanguage(_),H=X.experimental?.openTelemetry?ZB(yield*G.serviceOption(VB)):void 0,q=[(yield*YJ(G.promise(()=>e.resolveAgentPrompt("generate"))))??""];yield*Z.trigger("experimental.chat.system.transform",{model:_},{system:q});let U=yield*i.useEffect(Q,(C)=>C.list()),z=yield*J.get(W.providerID).pipe(G.orDie),M=W.providerID==="openai"&&z?.type==="oauth",I={experimental_telemetry:{isEnabled:X.experimental?.openTelemetry,tracer:H,metadata:{userId:X.username??"unknown"}},temperature:0.3,messages:[...M?[]:q.map((C)=>({role:"system",content:C})),{role:"user",content:`Create an agent configuration based on this request:
7572
+ `)}),W$=X.fn("ToolRegistry.tools")(function*(y){let n=(yield*k()).filter((l)=>{if(l.id===A3.id||l.id===I3.id)return y.providerID==="qlex"||y.providerID===I6.opencode||k$.QITQODE_ENABLE_EXA;if(l.id===S3.id||l.id===R3.id||l.id===w3.id)return y.providerID==="qlex";let d=y.modelID.includes("gpt-")&&!y.modelID.includes("oss")&&!y.modelID.includes("gpt-4");if(l.id===T3.id)return d;if(l.id===E7.id||l.id===D3.id)return!d;return!0});if(y.agent.toolAllowlist){let l=new Set(y.agent.toolAllowlist);n=n.filter((d)=>d.id==="invalid"||l.has(d.id))}let a=yield*$.get(),c$=(l)=>eU(a.tool,l);return yield*X.forEach(n,X.fnUntraced(function*(l){let C$=[];try{const d=R9(C$,YH.time(l.id),0);let Y$={description:l.description,parameters:l.parameters};yield*J.trigger("tool.definition",{toolID:l.id},Y$);let g=c$(l.id);let t=g==="shell"&&l.shell!==void 0;if(g==="shell"&&!l.shell)TA(l.id);let M$=t?aU(l):l;let T$=t?l.shell.description:Y$.description;return{id:l.id,description:[T$,l.id===i7.id?yield*Z$(y.agent):void 0,l.id===P3.id?yield*s(y.agent):void 0,l.id===a7.id?yield*J$():void 0].filter(Boolean).join(`
7573
+ `),parameters:t?M$.parameters:Y$.parameters,execute:M$.execute,formatValidationError:M$.formatValidationError}}catch(r$){var K0=r$,t1=1}finally{w9(C$,K0,t1)}}),{concurrency:25})}),y$=X.fn("ToolRegistry.named")(function*(){let y=yield*i.get(T);return{actor:y.actor,read:y.read}}),V$=X.fn("ToolRegistry.reload")(function*(){yield*Y.reload(),yield*J.reloadFileHooks(),yield*i.invalidate(T)});return P6.of({ids:A$,all:k,named:y$,tools:W$,reload:V$})})),kA=f.suspend(()=>VH.pipe(f.provide(w$.defaultLayer),f.provide(z2.defaultLayer),f.provide(H1.defaultLayer),f.provide(l8.defaultLayer),f.provide(a0.defaultLayer),f.provide(c0.defaultLayer),f.provide(Y1.defaultLayer),f.provide(B1.defaultLayer),f.provide(b0.defaultLayer),f.provide(d2.defaultLayer),f.provide($$.defaultLayer),f.provide(P$.layer),f.provide(G2.layer),f.provide(W1.defaultLayer),f.provide(GJ),f.provide(h0.defaultLayer),f.provide(I7),f.provide(f.mergeAll(L1.defaultLayer,c2.defaultLayer)),f.provide(o8.defaultLayer),f.provide(f.mergeAll(g1.defaultLayer,CJ.defaultLayer,o2.defaultLayer,K1.defaultLayer,r8.defaultLayer))));import M2 from"path";function YJ($){return $.pipe(X.catchDefect((J)=>J instanceof e.BackendAuthRejectedError?X.succeed(void 0):X.die(J)))}var EA=F.object({name:F.string(),description:F.string().optional(),mode:F.enum(["subagent","primary","all"]),native:F.boolean().optional(),hidden:F.boolean().optional(),topP:F.number().optional(),temperature:F.number().optional(),color:F.union([F.string(),F.object({light:F.string(),dark:F.string()})]).optional(),permission:E$.Ruleset.zod,model:F.object({modelID:HH.zod,providerID:I6.zod}).optional(),modelRef:F.string().optional(),variant:F.string().optional(),prompt:F.string().optional(),options:F.record(F.string(),F.any()),steps:F.number().int().positive().optional(),toolAllowlist:F.array(F.string()).optional(),posture:OH.optional()}).meta({ref:"Agent"});class A6 extends D$.Service()("@qitqode/Agent"){}var FH=f.effect(A6,X.gen(function*(){let $=yield*w$.Service,J=yield*r8.Service,Z=yield*z2.Service,Y=yield*a0.Service,K=yield*B1.Service,V=yield*i.make(X.fn("Agent.state")(function*(Q){let G=yield*X.all([YJ(X.promise(()=>e.resolveAgentPrompt("explore"))),YJ(X.promise(()=>e.resolveAgentPrompt("title"))),YJ(X.promise(()=>e.resolveAgentPrompt("summary"))),YJ(X.promise(()=>e.resolveAgentPrompt("compaction"))),YJ(X.promise(()=>e.resolveAgentPrompt("dream"))),YJ(X.promise(()=>e.resolveAgentPrompt("distill")))],{concurrency:"unbounded"}),W=G[0]??"",_=G[1]??"",j=G[2]??"",B=G[3]??"",q=G[4]??"",U=G[5]??"",z=yield*$.get(),C=yield*Y.dirs(),D=[j1.GLOB,...C.map((v)=>M2.join(v,"*"))],M=E$.fromConfig({"*":"allow",doom_loop:"ask",external_directory:{"*":"ask",...Object.fromEntries(D.map((v)=>[v,"allow"]))},question:"deny",read:{"*":"allow","*.env":"ask","*.env.*":"ask","*.env.example":"allow"}}),I=E$.fromConfig(z.permission??{}),P=E$.merge(M,E$.fromConfig({"*":"deny",read:"allow",write:"allow",edit:"allow",glob:"allow",grep:"allow",memory:"allow",bash:"allow",external_directory:{[M2.join(f$.Path.data,"memory")]:"allow",[M2.join(f$.Path.data,"memory","*")]:"allow"}}),I),L=["read","write","edit","glob","grep","memory","bash"],w={build:{name:"build",color:{dark:"#ff6a00",light:"#b84a00"},description:"Executes tools based on configured permissions.",options:{},permission:E$.merge(M,E$.fromConfig({question:"allow"}),I),mode:"primary",native:!0},...z.experimental?.maxMode?{max:{name:"max",color:{dark:"#ff8a00",light:"#c2410c"},description:"Max mode (experimental). Runs N parallel reasoning candidates each step and executes the best one. Same permissions as build.",options:{},permission:E$.merge(M,E$.fromConfig({question:"allow"}),I),mode:"primary",native:!0}}:{},plan:{name:"plan",color:{dark:"#1cc7bb",light:"#0f766e"},description:"Plan mode. Disallows all edit tools.",options:{},permission:E$.merge(M,E$.fromConfig({question:"allow",external_directory:{[M2.join(f$.Path.data,"plans","*")]:"allow"},edit:{"*":"deny",[M2.join(".qitqode","plans","*.md")]:"allow",[M2.relative(H$.worktree,M2.join(f$.Path.data,M2.join("plans","*.md")))]:"allow"}}),I),mode:"primary",native:!0},compose:{name:"compose",color:{dark:"#a84462",light:"#6d213c"},description:"Compose mode. Orchestrates workflows with built-in compose skills.",options:{},permission:E$.merge(M,E$.fromConfig({question:"allow"}),I),mode:"primary",native:!0},general:{name:"general",color:{dark:"#8a8f98",light:"#6f747d"},description:"General-purpose agent for researching complex questions and executing multi-step tasks. Use this agent to execute multiple units of work in parallel.",permission:E$.merge(M,E$.fromConfig({change_directory:"deny"}),I),options:{},mode:"subagent",native:!0},explore:{name:"explore",color:{dark:"#ffb000",light:"#b45309"},permission:E$.merge(M,E$.fromConfig({"*":"deny",grep:"allow",glob:"allow",list:"allow",bash:"allow",webfetch:"allow",websearch:"allow",codesearch:"allow",read:"allow",external_directory:{"*":"ask",...Object.fromEntries(D.map((v)=>[v,"allow"]))}}),I),description:'Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. "src/components/**/*.tsx"), search code for keywords (eg. "API endpoints"), or answer questions about the codebase (eg. "how do API endpoints work?"). When calling this agent, specify the desired thoroughness level: "quick" for basic searches, "medium" for moderate exploration, or "very thorough" for comprehensive analysis across multiple locations and naming conventions.',prompt:W,options:{},mode:"subagent",native:!0},title:{name:"title",mode:"subagent",options:{},native:!0,hidden:!0,temperature:0.5,permission:E$.merge(M,E$.fromConfig({"*":"deny"}),I),prompt:_,toolAllowlist:[]},summary:{name:"summary",mode:"subagent",options:{},native:!0,hidden:!0,permission:E$.merge(M,E$.fromConfig({"*":"deny"}),I),prompt:j,toolAllowlist:[]},compaction:{name:"compaction",mode:"subagent",options:{},native:!0,hidden:!0,permission:E$.merge(M,E$.fromConfig({"*":"deny"}),I),prompt:B,toolAllowlist:[]},"checkpoint-writer":{name:"checkpoint-writer",mode:"subagent",options:{},native:!0,hidden:!0,permission:E$.merge(M,I)},dream:{name:"dream",mode:"subagent",options:{},native:!0,hidden:!0,prompt:q,permission:P,toolAllowlist:L},distill:{name:"distill",mode:"subagent",options:{},native:!0,hidden:!0,prompt:U,permission:P,toolAllowlist:L}};for(let[v,m]of Object.entries(z.agent??{})){if(m.disable){delete w[v];continue}let A=w[v];if(!A)A=w[v]={name:v,mode:"all",permission:E$.merge(M,I),options:{},native:!1};if(m.model)if(m.model.includes("/"))A.model=B1.parseModel(m.model);else A.modelRef=m.model;A.variant=m.variant??A.variant,A.prompt=m.prompt??A.prompt,A.description=m.description??A.description,A.temperature=m.temperature??A.temperature,A.topP=m.top_p??A.topP,A.mode=m.mode??A.mode,A.color=m.color??A.color,A.hidden=m.hidden??A.hidden,A.name=m.name??A.name,A.steps=m.steps??A.steps,A.toolAllowlist=m.tool_allowlist??A.toolAllowlist,A.options=F9(A.options,m.options??{}),A.permission=E$.merge(A.permission,E$.fromConfig(m.permission??{}))}for(let v of Object.values(w))v.posture=qH(v);for(let v in w){if(w[v].permission.some((u)=>{if(u.permission!=="external_directory")return!1;if(u.action!=="deny")return!1;return u.pattern===j1.GLOB}))continue;w[v].permission=E$.merge(w[v].permission,E$.fromConfig({external_directory:{[j1.GLOB]:"allow"}}))}let N=X.fnUntraced(function*(v){return w[v]}),x=X.fnUntraced(function*(){let v=yield*$.get();return GH(w,WH(),jH([(m)=>v.default_agent!==void 0&&m.name===v.default_agent,"desc"],[(m)=>m.name==="plan","desc"],[(m)=>m.name==="build","desc"],[(m)=>m.name==="compose","desc"],[(m)=>m.name==="max","desc"],[(m)=>m.name,"asc"]))}),b=X.fnUntraced(function*(){let v=yield*$.get();if(v.default_agent){let u=w[v.default_agent];if(!u)throw Error(`default agent "${v.default_agent}" not found`);if(u.mode==="subagent")throw Error(`default agent "${v.default_agent}" is a subagent`);if(u.hidden===!0)throw Error(`default agent "${v.default_agent}" is hidden`);return u.name}let m=w.plan;if(m&&m.mode!=="subagent"&&m.hidden!==!0)return m.name;let A=Object.values(w).find((u)=>u.mode!=="subagent"&&u.hidden!==!0);if(!A)throw Error("no primary visible agent found");return A.name});return{get:N,list:x,defaultAgent:b}}));return A6.of({get:X.fn("Agent.get")(function*(Q){return yield*i.useEffect(V,(G)=>G.get(Q))}),list:X.fn("Agent.list")(function*(){return yield*i.useEffect(V,(Q)=>Q.list())}),defaultAgent:X.fn("Agent.defaultAgent")(function*(){return yield*i.useEffect(V,(Q)=>Q.defaultAgent())}),generate:X.fn("Agent.generate")(function*(Q){let G=yield*$.get(),W=Q.model??(yield*K.defaultModel()),_=yield*K.getModel(W.providerID,W.modelID),j=yield*K.getLanguage(_),B=G.experimental?.openTelemetry?XH(yield*X.serviceOption(UH)):void 0,q=[(yield*YJ(X.promise(()=>e.resolveAgentPrompt("generate"))))??""];yield*Z.trigger("experimental.chat.system.transform",{model:_},{system:q});let U=yield*i.useEffect(V,(M)=>M.list()),z=yield*J.get(W.providerID).pipe(X.orDie),C=W.providerID==="openai"&&z?.type==="oauth",D={experimental_telemetry:{isEnabled:G.experimental?.openTelemetry,tracer:B,metadata:{userId:G.username??"unknown"}},temperature:0.3,messages:[...C?[]:q.map((M)=>({role:"system",content:M})),{role:"user",content:`Create an agent configuration based on this request:
7574
7574
 
7575
- > ${V.description.replace(/\n/g,`
7575
+ > ${Q.description.replace(/\n/g,`
7576
7576
  > `)}
7577
7577
 
7578
- IMPORTANT: The following identifiers already exist and must NOT be used: ${U.map((C)=>C.name).join(", ")}
7579
- Return ONLY the JSON object, no other text, do not wrap in backticks`}],model:j,schema:F.object({identifier:F.string(),whenToUse:F.string(),systemPrompt:F.string()})};if(M)return yield*G.promise(async()=>{let C=WB({...I,providerOptions:HB.providerOptions(_,{instructions:q.join(`
7580
- `),store:!1}),onError:()=>{}});for await(let P of C.fullStream)if(P.type==="error")throw P.error;return C.object});return yield*G.promise(()=>XB(I).then((C)=>C.object))})})})),wA=BB.pipe(f.provide(z2.defaultLayer),f.provide(H1.defaultLayer),f.provide(r8.defaultLayer),f.provide(R$.defaultLayer),f.provide(a0.defaultLayer));var _B=O$.create({service:"tool-executor"});function RA($,J){if(J instanceof F.ZodError)return`Invalid arguments for the ${$} tool:
7578
+ IMPORTANT: The following identifiers already exist and must NOT be used: ${U.map((M)=>M.name).join(", ")}
7579
+ Return ONLY the JSON object, no other text, do not wrap in backticks`}],model:j,schema:F.object({identifier:F.string(),whenToUse:F.string(),systemPrompt:F.string()})};if(C)return yield*X.promise(async()=>{let M=_H({...D,providerOptions:zH.providerOptions(_,{instructions:q.join(`
7580
+ `),store:!1}),onError:()=>{}});for await(let I of M.fullStream)if(I.type==="error")throw I.error;return M.object});return yield*X.promise(()=>BH(D).then((M)=>M.object))})})})),xA=FH.pipe(f.provide(z2.defaultLayer),f.provide(B1.defaultLayer),f.provide(r8.defaultLayer),f.provide(w$.defaultLayer),f.provide(a0.defaultLayer));var x3=O$.create({service:"tool-executor"});function bA($,J){if(J instanceof F.ZodError)return`Invalid arguments for the ${$} tool:
7581
7581
  ${F.prettifyError(J)}`;return`The ${$} tool was called with invalid arguments: ${J}.
7582
- Please rewrite the input so it satisfies the expected schema.`}var LA=4;function i8($,J=0){if(J>LA)return{};if(!$||typeof $!=="object")return{};let Z=$;if(Z.const!==void 0)return Z.const;if(Array.isArray(Z.enum)&&Z.enum.length>0)return Z.enum[0];for(let K of["anyOf","oneOf","allOf"]){let Q=Z[K];if(Array.isArray(Q)&&Q.length>0)return i8(Q[0],J)}switch(Array.isArray(Z.type)?Z.type[0]:Z.type){case"object":{let K=Z.properties??{},Q=Array.isArray(Z.required)?Z.required:[],V=Q.length>0?Q:Object.keys(K).slice(0,3),X={};for(let W of V)X[W]=W in K?i8(K[W],J+1):null;return X}case"array":return Z.items?[i8(Z.items,J+1)]:[];case"string":return"...";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;default:return Z.properties?i8({...Z,type:"object"},J):{}}}function NA($,J,Z){if(!Z.issues.some((Q)=>Q.code==="invalid_type"&&Q.path.length===0&&Q.expected==="object"))return;let K="";try{K=`
7582
+ Please rewrite the input so it satisfies the expected schema.`}var vA=4;function i8($,J=0){if(J>vA)return{};if(!$||typeof $!=="object")return{};let Z=$;if(Z.const!==void 0)return Z.const;if(Array.isArray(Z.enum)&&Z.enum.length>0)return Z.enum[0];for(let K of["anyOf","oneOf","allOf"]){let V=Z[K];if(Array.isArray(V)&&V.length>0)return i8(V[0],J)}switch(Array.isArray(Z.type)?Z.type[0]:Z.type){case"object":{let K=Z.properties??{},V=Array.isArray(Z.required)?Z.required:[],Q=V.length>0?V:Object.keys(K).slice(0,3),G={};for(let W of Q)G[W]=W in K?i8(K[W],J+1):null;return G}case"array":return Z.items?[i8(Z.items,J+1)]:[];case"string":return"...";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;default:return Z.properties?i8({...Z,type:"object"},J):{}}}function hA($,J,Z){if(!Z.issues.some((V)=>V.code==="invalid_type"&&V.path.length===0&&V.expected==="object"))return;let K="";try{K=`
7583
7583
  A well-formed call looks like: ${JSON.stringify(i8(F.toJSONSchema(J)))}`}catch{K=""}return[`Invalid arguments for the ${$} tool: the arguments arrived as a JSON string, but this tool expects a JSON object.`,`Do not stringify the arguments \u2014 send the object itself.${K}`].join(`
7584
- `)}function yA($,J,Z,Y){return()=>G.gen(function*(){let K=typeof J==="function"?{...yield*J()}:{...J},Q=K.execute;return K.execute=(V,X)=>{let W={"tool.name":$,"session.id":X.sessionID,"message.id":X.messageID,...X.callID?{"tool.call_id":X.callID}:{}};return _B.info("tool call started",{...W}),G.gen(function*(){let _=_Z(V);if(typeof V==="string")_B.debug("tool arguments arrived as a string",{...W,raw:CG(V),recovered:_.decoded,decodeAttempts:_.attempts});let j=_.value;yield*G.try({try:()=>K.parameters.parse(j),catch:(z)=>{if(z instanceof F.ZodError){let M=NA($,K.parameters,z);if(M)return new R0(M,{cause:z});if(K.formatValidationError)return new R0(K.formatValidationError(z),{cause:z})}return new R0(RA($,z),{cause:z})}});let H=yield*K.timeout?Q(j,X).pipe(G.timeoutOrElse({duration:h2.millis(K.timeout),orElse:()=>G.die(new R0(`The ${$} tool timed out after ${K.timeout} ms. If this operation is expected to take longer, retry with a larger timeout value.`))})):Q(j,X);if(H.metadata.truncated!==void 0)return H;let q=yield*Y.get(X.agent),U=yield*Z.output(H.output,{},q);return{...H,output:U.content,metadata:{...H.metadata,truncated:U.truncated,...U.truncated&&{outputPath:U.outputPath}}}}).pipe(G.orDie,G.withSpan("Tool.execute",{attributes:W}))},K})}function H$($,J){return Object.assign(G.gen(function*(){let Z=yield*J,Y=yield*Z1,K=yield*c0.Service;return{id:$,init:yA($,Z,Y,K)}}),{id:$})}function n$($){return G.gen(function*(){return{...yield*$.init(),id:$.id}})}import QJ from"path";import{fileURLToPath as CB}from"url";var KJ={};o$(KJ,{preferred:()=>uA,posix:()=>mA,name:()=>s8,login:()=>fA,killTree:()=>bA,gitbash:()=>k3,acceptable:()=>dA,Shell:()=>KJ});import S6 from"path";import{spawn as TA}from"child_process";import{setTimeout as OB}from"timers/promises";var qB=200,kA=new Set(["fish","nu"]),EA=new Set(["bash","dash","fish","ksh","sh","zsh"]),xA=new Set(["bash","dash","ksh","sh","zsh"]);async function bA($,J){let Z=$.pid;if(!Z||J?.exited?.())return;if(process.platform==="win32"){await new Promise((Y)=>{let K=TA("taskkill",["/pid",String(Z),"/f","/t"],{stdio:"ignore",windowsHide:!0});K.once("exit",()=>Y()),K.once("error",()=>Y())});return}try{if(process.kill(-Z,"SIGTERM"),await OB(qB),!J?.exited?.())process.kill(-Z,"SIGKILL")}catch(Y){if($.kill("SIGTERM"),await OB(qB),!J?.exited?.())$.kill("SIGKILL")}}function vA($){if(process.platform!=="win32")return $;let J=O0.windowsPath($);if(S6.win32.dirname(J)!=="."){if(J.startsWith("/")&&s8(J)==="bash")return k3()||J;return J}return x$(J)||J}function hA(){let $=x$("pwsh.exe");if($)return $;let J=x$("powershell.exe");if(J)return J}function FB($,J){if($&&(!J?.acceptable||!kA.has(s8($))))return vA($);if(process.platform==="win32"){let Z=hA();if(Z)return Z}return gA()}function k3(){if(process.platform!=="win32")return;if(k$.QITQODE_GIT_BASH_PATH)return k$.QITQODE_GIT_BASH_PATH;let $=x$("git");if(!$)return;let J=S6.join($,"..","..","bin","bash.exe");if(O0.stat(J)?.size)return J}function gA(){if(process.platform==="win32"){let J=k3();if(J)return J;return process.env.COMSPEC||"cmd.exe"}if(process.platform==="darwin")return"/bin/zsh";let $=x$("bash");if($)return $;return"/bin/sh"}function s8($){if(process.platform==="win32")return S6.win32.parse(O0.windowsPath($)).name.toLowerCase();return S6.basename($).toLowerCase()}function fA($){return EA.has(s8($))}function mA($){return xA.has(s8($))}var uA=T2(()=>FB(process.env.SHELL)),dA=T2(()=>FB(process.env.SHELL,{acceptable:!0}));var n8={};o$(n8,{prefixWith:()=>pA,BashArity:()=>n8});function pA($,J){return zB.bashPrefixWith($,J)}var MB=30000,rA=k$.QITQODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS||120000,wB=new Set(["powershell","pwsh"]),RB=new Set(["cd","push-location","set-location"]),iA=new Set([...RB,"rm","cp","mv","mkdir","touch","chmod","chown","cat","get-content","set-content","add-content","copy-item","move-item","remove-item","new-item","rename-item"]),sA=new Set(["-destination","-literalpath","-path"]),nA=new Set(["-confirm","-debug","-force","-nonewline","-recurse","-verbose","-whatif"]),v3=O$.create({service:"bash-tool"}),E3=($)=>{if($.startsWith("file://"))return CB($);if($.startsWith("/")||/^[a-z]:/i.test($))return $;let J=new URL($,import.meta.url);return CB(J)};function aA($){let J=[];for(let Z=0;Z<$.childCount;Z++){let Y=$.child(Z);if(!Y)continue;if(Y.type==="command_elements"){for(let K=0;K<Y.childCount;K++){let Q=Y.child(K);if(!Q||Q.type==="command_argument_sep"||Q.type==="redirection")continue;J.push({type:Q.type,text:Q.text})}continue}if(Y.type!=="command_name"&&Y.type!=="command_name_expr"&&Y.type!=="word"&&Y.type!=="string"&&Y.type!=="raw_string"&&Y.type!=="concatenation")continue;J.push({type:Y.type,text:Y.text})}return J}function tA($){return($.parent?.type==="redirected_statement"?$.parent.text:$.text).trim()}function eA($){return $.descendantsOfType("command").filter((J)=>Boolean(J))}function LB($){if($.length<2)return $;let J=$[0],Z=$[$.length-1];if((J==='"'||J==="'")&&J===Z)return $.slice(1,-1);return $}function NB($){if($==="~")return b3.homedir();if($.startsWith("~/")||$.startsWith("~\\"))return QJ.join(b3.homedir(),$.slice(2));return $}function DB($){if(process.platform!=="win32")return process.env[$];let J=Object.keys(process.env).find((Z)=>Z.toLowerCase()===$.toLowerCase());return J?process.env[J]:void 0}function $S($,J,Z){let Y=$.toUpperCase();if(Y==="HOME")return b3.homedir();if(Y==="PWD")return J;if(Y==="PSHOME")return QJ.dirname(Z)}function JS($,J,Z){let Y=LB($).replace(/\$\{env:([^}]+)\}/gi,(K,Q)=>DB(Q)||"").replace(/\$env:([A-Za-z_][A-Za-z0-9_]*)/gi,(K,Q)=>DB(Q)||"").replace(/\$(HOME|PWD|PSHOME)(?=$|[\\/])/gi,(K,Q)=>$S(Q,J,Z)||"");return NB(Y)}function ZS($){let J=$.match(/^([A-Za-z]+)::(.*)$/);if(J){if(J[1].toLowerCase()!=="filesystem")return;return J[2]}let Z=$.match(/^([A-Za-z]+):(.*)$/);if(!Z)return $;if(Z[1].length===1)return $;return}function YS($,J){if($.startsWith("(")||$.startsWith("@("))return!0;if($.includes("$(")||$.includes("${")||$.includes("`"))return!0;if(J)return/\$(?!env:)/i.test($);return $.includes("$")}function KS($){let J=/[?*[]/.exec($);if(!J)return $;if(J.index===0)return;return $.slice(0,J.index)}function QS($,J){if(!J)return $.slice(1).filter((K)=>!K.text.startsWith("-")&&!($[0]?.text==="chmod"&&K.text.startsWith("+"))).map((K)=>K.text);let Z=[],Y=!1;for(let K of $.slice(1)){if(Y){Z.push(K.text),Y=!1;continue}if(K.type==="command_parameter"){let Q=K.text.toLowerCase();if(nA.has(Q))continue;Y=sA.has(Q);continue}Z.push(K.text)}return Z}function PB($){if($.length<=MB)return $;return`...
7584
+ `)}function gA($,J,Z,Y){return()=>X.gen(function*(){let K=typeof J==="function"?{...yield*J()}:{...J},V=K.execute;return K.execute=(Q,G)=>{let W={"tool.name":$,"session.id":G.sessionID,"message.id":G.messageID,...G.callID?{"tool.call_id":G.callID}:{}};return x3.info("tool call started",{...W}),X.gen(function*(){let _=_Z(Q);if(typeof Q==="string")x3.debug("tool arguments arrived as a string",{...W,raw:PX(Q),recovered:_.decoded,decodeAttempts:_.attempts});let j=AX(_.value,K.parameters),B=j.value;if(j.repaired)x3.debug("repaired string-shaped nested arguments",{...W,paths:j.repairedPaths});yield*X.try({try:()=>K.parameters.parse(B),catch:(C)=>{if(C instanceof F.ZodError){let D=hA($,K.parameters,C);if(D)return new w0(D,{cause:C});if(K.formatValidationError)return new w0(K.formatValidationError(C),{cause:C})}return new w0(bA($,C),{cause:C})}});let q=yield*K.timeout?V(B,G).pipe(X.timeoutOrElse({duration:h2.millis(K.timeout),orElse:()=>X.die(new w0(`The ${$} tool timed out after ${K.timeout} ms. If this operation is expected to take longer, retry with a larger timeout value.`))})):V(B,G);if(q.metadata.truncated!==void 0)return q;let U=yield*Y.get(G.agent),z=yield*Z.output(q.output,{},U);return{...q,output:z.content,metadata:{...q.metadata,truncated:z.truncated,...z.truncated&&{outputPath:z.outputPath}}}}).pipe(X.orDie,X.withSpan("Tool.execute",{attributes:W}))},K})}function B$($,J){return Object.assign(X.gen(function*(){let Z=yield*J,Y=yield*Z1,K=yield*c0.Service;return{id:$,init:gA($,Z,Y,K)}}),{id:$})}function n$($){return X.gen(function*(){return{...yield*$.init(),id:$.id}})}import VJ from"path";import{fileURLToPath as IH}from"url";var KJ={};o$(KJ,{preferred:()=>sA,posix:()=>iA,name:()=>s8,login:()=>rA,killTree:()=>pA,gitbash:()=>b3,acceptable:()=>nA,Shell:()=>KJ});import S6 from"path";import{spawn as fA}from"child_process";import{setTimeout as MH}from"timers/promises";var CH=200,mA=new Set(["fish","nu"]),uA=new Set(["bash","dash","fish","ksh","sh","zsh"]),dA=new Set(["bash","dash","ksh","sh","zsh"]);async function pA($,J){let Z=$.pid;if(!Z||J?.exited?.())return;if(process.platform==="win32"){await new Promise((Y)=>{let K=fA("taskkill",["/pid",String(Z),"/f","/t"],{stdio:"ignore",windowsHide:!0});K.once("exit",()=>Y()),K.once("error",()=>Y())});return}try{if(process.kill(-Z,"SIGTERM"),await MH(CH),!J?.exited?.())process.kill(-Z,"SIGKILL")}catch(Y){if($.kill("SIGTERM"),await MH(CH),!J?.exited?.())$.kill("SIGKILL")}}function cA($){if(process.platform!=="win32")return $;let J=O0.windowsPath($);if(S6.win32.dirname(J)!=="."){if(J.startsWith("/")&&s8(J)==="bash")return b3()||J;return J}return x$(J)||J}function lA(){let $=x$("pwsh.exe");if($)return $;let J=x$("powershell.exe");if(J)return J}function DH($,J){if($&&(!J?.acceptable||!mA.has(s8($))))return cA($);if(process.platform==="win32"){let Z=lA();if(Z)return Z}return oA()}function b3(){if(process.platform!=="win32")return;if(k$.QITQODE_GIT_BASH_PATH)return k$.QITQODE_GIT_BASH_PATH;let $=x$("git");if(!$)return;let J=S6.join($,"..","..","bin","bash.exe");if(O0.stat(J)?.size)return J}function oA(){if(process.platform==="win32"){let J=b3();if(J)return J;return process.env.COMSPEC||"cmd.exe"}if(process.platform==="darwin")return"/bin/zsh";let $=x$("bash");if($)return $;return"/bin/sh"}function s8($){if(process.platform==="win32")return S6.win32.parse(O0.windowsPath($)).name.toLowerCase();return S6.basename($).toLowerCase()}function rA($){return uA.has(s8($))}function iA($){return dA.has(s8($))}var sA=T2(()=>DH(process.env.SHELL)),nA=T2(()=>DH(process.env.SHELL,{acceptable:!0}));var n8={};o$(n8,{prefixWith:()=>aA,BashArity:()=>n8});function aA($,J){return PH.bashPrefixWith($,J)}var AH=30000,JS=k$.QITQODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS||120000,yH=new Set(["powershell","pwsh"]),TH=new Set(["cd","push-location","set-location"]),ZS=new Set([...TH,"rm","cp","mv","mkdir","touch","chmod","chown","cat","get-content","set-content","add-content","copy-item","move-item","remove-item","new-item","rename-item"]),YS=new Set(["-destination","-literalpath","-path"]),KS=new Set(["-confirm","-debug","-force","-nonewline","-recurse","-verbose","-whatif"]),f3=O$.create({service:"bash-tool"}),v3=($)=>{if($.startsWith("file://"))return IH($);if($.startsWith("/")||/^[a-z]:/i.test($))return $;let J=new URL($,import.meta.url);return IH(J)};function VS($){let J=[];for(let Z=0;Z<$.childCount;Z++){let Y=$.child(Z);if(!Y)continue;if(Y.type==="command_elements"){for(let K=0;K<Y.childCount;K++){let V=Y.child(K);if(!V||V.type==="command_argument_sep"||V.type==="redirection")continue;J.push({type:V.type,text:V.text})}continue}if(Y.type!=="command_name"&&Y.type!=="command_name_expr"&&Y.type!=="word"&&Y.type!=="string"&&Y.type!=="raw_string"&&Y.type!=="concatenation")continue;J.push({type:Y.type,text:Y.text})}return J}function QS($){return($.parent?.type==="redirected_statement"?$.parent.text:$.text).trim()}function XS($){return $.descendantsOfType("command").filter((J)=>Boolean(J))}function kH($){if($.length<2)return $;let J=$[0],Z=$[$.length-1];if((J==='"'||J==="'")&&J===Z)return $.slice(1,-1);return $}function EH($){if($==="~")return g3.homedir();if($.startsWith("~/")||$.startsWith("~\\"))return VJ.join(g3.homedir(),$.slice(2));return $}function SH($){if(process.platform!=="win32")return process.env[$];let J=Object.keys(process.env).find((Z)=>Z.toLowerCase()===$.toLowerCase());return J?process.env[J]:void 0}function GS($,J,Z){let Y=$.toUpperCase();if(Y==="HOME")return g3.homedir();if(Y==="PWD")return J;if(Y==="PSHOME")return VJ.dirname(Z)}function WS($,J,Z){let Y=kH($).replace(/\$\{env:([^}]+)\}/gi,(K,V)=>SH(V)||"").replace(/\$env:([A-Za-z_][A-Za-z0-9_]*)/gi,(K,V)=>SH(V)||"").replace(/\$(HOME|PWD|PSHOME)(?=$|[\\/])/gi,(K,V)=>GS(V,J,Z)||"");return EH(Y)}function jS($){let J=$.match(/^([A-Za-z]+)::(.*)$/);if(J){if(J[1].toLowerCase()!=="filesystem")return;return J[2]}let Z=$.match(/^([A-Za-z]+):(.*)$/);if(!Z)return $;if(Z[1].length===1)return $;return}function US($,J){if($.startsWith("(")||$.startsWith("@("))return!0;if($.includes("$(")||$.includes("${")||$.includes("`"))return!0;if(J)return/\$(?!env:)/i.test($);return $.includes("$")}function HS($){let J=/[?*[]/.exec($);if(!J)return $;if(J.index===0)return;return $.slice(0,J.index)}function BS($,J){if(!J)return $.slice(1).filter((K)=>!K.text.startsWith("-")&&!($[0]?.text==="chmod"&&K.text.startsWith("+"))).map((K)=>K.text);let Z=[],Y=!1;for(let K of $.slice(1)){if(Y){Z.push(K.text),Y=!1;continue}if(K.type==="command_parameter"){let V=K.text.toLowerCase();if(KS.has(V))continue;Y=YS.has(V);continue}Z.push(K.text)}return Z}function RH($){if($.length<=AH)return $;return`...
7585
7585
 
7586
- `+$.slice(-MB)}var VS=/error|exception|failed|fatal|traceback|panic|exit code/i,IB=Math.floor(u1*0.7),AB=Math.floor(DJ*0.7),GS=G.fn("BashTool.parse")(function*($,J){let Z=yield*G.promise(()=>jS().then((Y)=>(J?Y.ps:Y.bash).parse($)).catch((Y)=>{return v3.warn("tree-sitter parse of command failed",{error:String(Y)}),null}));if(!Z)throw Error("Failed to parse command");return Z.rootNode}),XS=G.fn("BashTool.ask")(function*($,J){if(J.dirs.size>0){let Z=Array.from(J.dirs).map((Y)=>{if(process.platform==="win32")return $$.normalizePathPattern(QJ.join(Y,"*"));return QJ.join(Y,"*")});yield*$.ask({permission:"external_directory",patterns:Z,always:Z,metadata:{}})}if(J.patterns.size===0)return;yield*$.ask({permission:"bash",patterns:Array.from(J.patterns),always:Array.from(J.always),metadata:{}})});function WS($,J,Z,Y,K){if(process.platform==="win32"&&wB.has(J))return S1.make($,["-NoLogo","-NoProfile","-NonInteractive","-Command",Z],{cwd:Y,env:K,stdin:"ignore",detached:!1});return S1.make(Z,[],{shell:$,cwd:Y,env:K,stdin:"ignore",detached:process.platform!=="win32"})}var jS=T2(async()=>{let{Parser:$}=await import("./chunk-fwr2qgqb.js"),{default:J}=await import("./chunk-g204pt98.js",{with:{type:"wasm"}}),Z=E3(J);await $.init({locateFile(){return Z}});let{default:Y}=await import("./chunk-r78kfhvz.js",{with:{type:"wasm"}}),{default:K}=await import("./chunk-m31d2n6h.js",{with:{type:"wasm"}}),Q=E3(Y),V=E3(K),[X,W]=await Promise.all([x3.load(Q),x3.load(V)]),_=new $;_.setLanguage(X);let j=new $;return j.setLanguage(W),{bash:_,ps:j}}),aU=H$("bash",G.gen(function*(){let $=(yield*e.toolDescriptionEffect("bash"))??"",J=yield*M9,Z=yield*$$.Service,Y=yield*Z1,K=yield*z2.Service,Q=G.fn("BashTool.cygpath")(function*(H,q){let z=(yield*J.lines(S1.make(H,["-lc",'cygpath -w -- "$1"',"_",q])).pipe(G.catch(()=>G.succeed([]))))[0]?.trim();if(!z)return;return $$.normalizePath(z)}),V=G.fn("BashTool.resolvePath")(function*(H,q,U){if(process.platform==="win32"){if(KJ.posix(U)&&H.startsWith("/")&&$$.windowsPath(H)===H){let z=yield*Q(U,H);if(z)return z}return $$.normalizePath(QJ.resolve(q,$$.windowsPath(H)))}return QJ.resolve(q,H)}),X=G.fn("BashTool.argPath")(function*(H,q,U,z){let M=U?JS(H,q,z):NB(LB(H)),I=M&&KS(M);if(!I||YS(I,U))return;let C=U?ZS(I):I;if(!C)return;return yield*V(C,q,z)}),W=G.fn("BashTool.collect")(function*(H,q,U,z){let M={dirs:new Set,patterns:new Set,always:new Set},I=yield*G.promise(()=>e.resolveBashArity());for(let C of eA(H)){let P=aA(C),D=P.map((R)=>R.text),L=U?D[0]?.toLowerCase():D[0];if(L&&iA.has(L))for(let R of QS(P,U)){let N=yield*X(R,q,U,z);if(v3.info("resolved path",{arg:R,resolved:N}),!N||B$.containsPath(N))continue;let x=(yield*Z.isDir(N))?N:QJ.dirname(N);M.dirs.add(x)}if(D.length&&(!L||!RB.has(L)))M.patterns.add(tA(C)),M.always.add(n8.prefixWith(I,D).join(" ")+" *")}return M}),_=G.fn("BashTool.shellEnv")(function*(H,q){let U=yield*K.trigger("shell.env",{cwd:q,sessionID:H.sessionID,callID:H.callID},{env:{}});return{...SB(),...U.env}}),j=G.fn("BashTool.run")(function*(H,q){let U=u1,z=DJ,M=U*2,I="",C="",P=[],D=0,L="",R,N=!1,x=!1,b=!1;yield*q.metadata({metadata:{output:"",description:H.description}});let v=yield*G.scoped(G.gen(function*(){let S=yield*J.spawn(WS(H.shell,H.name,H.command,H.cwd,H.env));yield*G.forkScoped(l$.runForEach(l$.decodeText(S.all),(s)=>{let J$=Buffer.byteLength(s,"utf-8");P.push({text:s,size:J$}),D+=J$;while(D>M&&P.length>1){let Z$=P.shift();if(!Z$)break;D-=Z$.size,N=!0}if(C=PB(C+s),L)R?.write(s);else if(I+=s,Buffer.byteLength(I,"utf-8")>U)return Y.write(I).pipe(G.andThen((Z$)=>G.sync(()=>{L=Z$,N=!0,R=cA(Z$,{flags:"a"}),I=""})),G.andThen(q.metadata({metadata:{output:C,description:H.description}})));return q.metadata({metadata:{output:C,description:H.description}})}));let T=G.callback((s)=>{if(q.abort.aborted)return s(G.void);let J$=()=>s(G.void);if(q.abort.addEventListener("abort",J$,{once:!0}),q.abort.aborted)J$();return G.sync(()=>q.abort.removeEventListener("abort",J$))}),k=G.sleep(`${H.timeout+100} millis`),A$=yield*G.raceAll([S.exitCode.pipe(G.map((s)=>({kind:"exit",code:s}))),T.pipe(G.map(()=>({kind:"abort",code:null}))),k.pipe(G.map(()=>({kind:"timeout",code:null})))]);if(A$.kind==="abort")b=!0,yield*S.kill({forceKillAfter:"3 seconds"}).pipe(G.orDie);if(A$.kind==="timeout")x=!0,yield*S.kill({forceKillAfter:"3 seconds"}).pipe(G.orDie);return A$.kind==="exit"?A$.code:null})).pipe(G.orDie),m=[];if(x)m.push(`bash tool terminated command after exceeding timeout ${H.timeout} ms. If this command is expected to take longer and is not waiting for interactive input, retry with a larger timeout value in milliseconds.`);if(b)m.push("User aborted the command");let A=P.map((S)=>S.text).join(""),u=P7(A,z,U);if(u.cut)N=!0;if(!L&&u.cut)L=yield*Y.write(A);let r=u.text;if(!r)r="(no output)";if(N&&L){let S=u.text.length>2048?u.text.slice(-2048):u.text;if(VS.test(S)){let k=yield*G.promise(async()=>{try{let A$=await oA(L),s=IB*2,J$=await lA(L,"r");try{let Z$=Math.min(Number(A$.size),s),W$=Buffer.alloc(Z$);await J$.read(W$,0,Z$,0);let y$=W$.toString("utf-8"),Q$=1;for(let n=0;n<y$.length;n++)if(y$.charCodeAt(n)===10)Q$++;let y=Q$<=AB+z;return{text:y$,overlaps:y}}finally{await J$.close()}}catch{return}});if(k){let A$=k.text;if(!k.overlaps){let s=D7(A$,AB,IB);r=`...output truncated (head+tail shown due to errors)...
7586
+ `+$.slice(-AH)}var _S=/error|exception|failed|fatal|traceback|panic|exit code/i,wH=Math.floor(u1*0.7),LH=Math.floor(DJ*0.7),OS=X.fn("BashTool.parse")(function*($,J){let Z=yield*X.promise(()=>zS().then((Y)=>(J?Y.ps:Y.bash).parse($)).catch((Y)=>{return f3.warn("tree-sitter parse of command failed",{error:String(Y)}),null}));if(!Z)throw Error("Failed to parse command");return Z.rootNode}),qS=X.fn("BashTool.ask")(function*($,J){if(J.dirs.size>0){let Z=Array.from(J.dirs).map((Y)=>{if(process.platform==="win32")return $$.normalizePathPattern(VJ.join(Y,"*"));return VJ.join(Y,"*")});yield*$.ask({permission:"external_directory",patterns:Z,always:Z,metadata:{}})}if(J.patterns.size===0)return;yield*$.ask({permission:"bash",patterns:Array.from(J.patterns),always:Array.from(J.always),metadata:{}})});function FS($,J,Z,Y,K){if(process.platform==="win32"&&yH.has(J))return S1.make($,["-NoLogo","-NoProfile","-NonInteractive","-Command",Z],{cwd:Y,env:K,stdin:"ignore",detached:!1});return S1.make(Z,[],{shell:$,cwd:Y,env:K,stdin:"ignore",detached:process.platform!=="win32"})}var zS=T2(async()=>{let{Parser:$}=await import("./chunk-eyr0vf92.js"),{default:J}=await import("./chunk-4zx3ze68.js",{with:{type:"wasm"}}),Z=v3(J);await $.init({locateFile(){return Z}});let{default:Y}=await import("./chunk-79aka9xe.js",{with:{type:"wasm"}}),{default:K}=await import("./chunk-aq1j9y18.js",{with:{type:"wasm"}}),V=v3(Y),Q=v3(K),[G,W]=await Promise.all([h3.load(V),h3.load(Q)]),_=new $;_.setLanguage(G);let j=new $;return j.setLanguage(W),{bash:_,ps:j}}),ZH=B$("bash",X.gen(function*(){let $=(yield*e.toolDescriptionEffect("bash"))??"",J=yield*C9,Z=yield*$$.Service,Y=yield*Z1,K=yield*z2.Service,V=X.fn("BashTool.cygpath")(function*(B,q){let z=(yield*J.lines(S1.make(B,["-lc",'cygpath -w -- "$1"',"_",q])).pipe(X.catch(()=>X.succeed([]))))[0]?.trim();if(!z)return;return $$.normalizePath(z)}),Q=X.fn("BashTool.resolvePath")(function*(B,q,U){if(process.platform==="win32"){if(KJ.posix(U)&&B.startsWith("/")&&$$.windowsPath(B)===B){let z=yield*V(U,B);if(z)return z}return $$.normalizePath(VJ.resolve(q,$$.windowsPath(B)))}return VJ.resolve(q,B)}),G=X.fn("BashTool.argPath")(function*(B,q,U,z){let C=U?WS(B,q,z):EH(kH(B)),D=C&&HS(C);if(!D||US(D,U))return;let M=U?jS(D):D;if(!M)return;return yield*Q(M,q,z)}),W=X.fn("BashTool.collect")(function*(B,q,U,z){let C={dirs:new Set,patterns:new Set,always:new Set},D=yield*X.promise(()=>e.resolveBashArity());for(let M of XS(B)){let I=VS(M),P=I.map((w)=>w.text),L=U?P[0]?.toLowerCase():P[0];if(L&&ZS.has(L))for(let w of BS(I,U)){let N=yield*G(w,q,U,z);if(f3.info("resolved path",{arg:w,resolved:N}),!N||H$.containsPath(N))continue;let x=(yield*Z.isDir(N))?N:VJ.dirname(N);C.dirs.add(x)}if(P.length&&(!L||!TH.has(L)))C.patterns.add(QS(M)),C.always.add(n8.prefixWith(D,P).join(" ")+" *")}return C}),_=X.fn("BashTool.shellEnv")(function*(B,q){let U=yield*K.trigger("shell.env",{cwd:q,sessionID:B.sessionID,callID:B.callID},{env:{}});return{...NH(),...U.env}}),j=X.fn("BashTool.run")(function*(B,q){let U=u1,z=DJ,C=U*2,D="",M="",I=[],P=0,L="",w,N=!1,x=!1,b=!1;yield*q.metadata({metadata:{output:"",description:B.description}});let v=yield*X.scoped(X.gen(function*(){let S=yield*J.spawn(FS(B.shell,B.name,B.command,B.cwd,B.env));yield*X.forkScoped(l$.runForEach(l$.decodeText(S.all),(s)=>{let J$=Buffer.byteLength(s,"utf-8");I.push({text:s,size:J$}),P+=J$;while(P>C&&I.length>1){let Z$=I.shift();if(!Z$)break;P-=Z$.size,N=!0}if(M=RH(M+s),L)w?.write(s);else if(D+=s,Buffer.byteLength(D,"utf-8")>U)return Y.write(D).pipe(X.andThen((Z$)=>X.sync(()=>{L=Z$,N=!0,w=tA(Z$,{flags:"a"}),D=""})),X.andThen(q.metadata({metadata:{output:M,description:B.description}})));return q.metadata({metadata:{output:M,description:B.description}})}));let T=X.callback((s)=>{if(q.abort.aborted)return s(X.void);let J$=()=>s(X.void);if(q.abort.addEventListener("abort",J$,{once:!0}),q.abort.aborted)J$();return X.sync(()=>q.abort.removeEventListener("abort",J$))}),k=X.sleep(`${B.timeout+100} millis`),A$=yield*X.raceAll([S.exitCode.pipe(X.map((s)=>({kind:"exit",code:s}))),T.pipe(X.map(()=>({kind:"abort",code:null}))),k.pipe(X.map(()=>({kind:"timeout",code:null})))]);if(A$.kind==="abort")b=!0,yield*S.kill({forceKillAfter:"3 seconds"}).pipe(X.orDie);if(A$.kind==="timeout")x=!0,yield*S.kill({forceKillAfter:"3 seconds"}).pipe(X.orDie);return A$.kind==="exit"?A$.code:null})).pipe(X.orDie),m=[];if(x)m.push(`bash tool terminated command after exceeding timeout ${B.timeout} ms. If this command is expected to take longer and is not waiting for interactive input, retry with a larger timeout value in milliseconds.`);if(b)m.push("User aborted the command");let A=I.map((S)=>S.text).join(""),u=P7(A,z,U);if(u.cut)N=!0;if(!L&&u.cut)L=yield*Y.write(A);let r=u.text;if(!r)r="(no output)";if(N&&L){let S=u.text.length>2048?u.text.slice(-2048):u.text;if(_S.test(S)){let k=yield*X.promise(async()=>{try{let A$=await $S(L),s=wH*2,J$=await eA(L,"r");try{let Z$=Math.min(Number(A$.size),s),W$=Buffer.alloc(Z$);await J$.read(W$,0,Z$,0);let y$=W$.toString("utf-8"),V$=1;for(let n=0;n<y$.length;n++)if(y$.charCodeAt(n)===10)V$++;let y=V$<=LH+z;return{text:y$,overlaps:y}}finally{await J$.close()}}catch{return}});if(k){let A$=k.text;if(!k.overlaps){let s=D7(A$,LH,wH);r=`...output truncated (head+tail shown due to errors)...
7587
7587
 
7588
7588
  Full output saved to: ${L}
7589
7589
 
@@ -7608,5 +7608,5 @@ Full output saved to: ${L}
7608
7608
  <bash_metadata>
7609
7609
  `+m.join(`
7610
7610
  `)+`
7611
- </bash_metadata>`;if(R){let S=R;yield*G.promise(()=>new Promise((T)=>{S.end(()=>T()),S.on("error",()=>T())}))}return{title:H.description,metadata:{output:C||PB(r),exit:v,description:H.description,truncated:N,...N&&L?{outputPath:L}:{}},output:r}});return()=>G.sync(()=>{let H=KJ.acceptable(),q=KJ.name(H),U=q==="powershell"?"If the commands depend on each other and must run sequentially, avoid '&&' in this shell because Windows PowerShell 5.1 does not support it. Use PowerShell conditionals such as `cmd1; if ($?) { cmd2 }` when later commands must depend on earlier success.":"If the commands depend on each other and must run sequentially, use a single Bash call with '&&' to chain them together (e.g., `git add . && git commit -m \"message\" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before Bash for git operations, or git add before git commit), run these operations sequentially instead.";return v3.info("bash tool using shell",{shell:H}),{description:$.replaceAll("${directory}",B$.directory).replaceAll("${os}",process.platform).replaceAll("${shell}",q).replaceAll("${chaining}",U).replaceAll("${maxLines}",String(DJ)).replaceAll("${maxBytes}",String(u1)),parameters:tV,execute:(z,M)=>G.gen(function*(){let I=t$.get(M.sessionID),C=z.workdir?yield*V(z.workdir,I,H):I;if(z.timeout!==void 0&&z.timeout<0)throw Error(`Invalid timeout value: ${z.timeout}. Timeout must be a positive number.`);let P=z.timeout??rA,D=wB.has(q),L=yield*GS(z.command,D),R=yield*W(L,C,D,H);if(!B$.containsPath(C))R.dirs.add(C);if(yield*XS(M,R),z.interactive){let N=yield*_(M,C);yield*M.metadata({metadata:{output:"(waiting for user interaction...)",description:z.description}});let x=yield*G.tryPromise(()=>iV({command:z.command,cwd:C,env:N,description:z.description})).pipe(G.orDie);return{title:z.description,metadata:{output:x.output||"(interactive command completed)",exit:x.exitCode,description:z.description,truncated:!1},output:x.output||`(interactive command completed with exit code ${x.exitCode})`}}return yield*j({shell:H,name:q,command:z.command,cwd:C,env:yield*_(M,C),timeout:P,description:z.description},M)})}})}));var m3={};o$(m3,{retryable:()=>cB,policy:()=>AS,persistentRetryDelay:()=>IS,isRetryableTransientError:()=>dB,delay:()=>pB,SessionRetry:()=>m3,RETRY_MAX_DELAY_NO_HEADERS:()=>FS,RETRY_MAX_DELAY:()=>zS,RETRY_INITIAL_DELAY:()=>OS,RETRY_BACKOFF_FACTOR:()=>qS,PERSISTENT_RETRY_MAX_DELAY:()=>DS,PERSISTENT_RETRY_MAX_ATTEMPTS:()=>PS,PERSISTENT_RETRY_INITIAL_DELAY:()=>CS,PERSISTENT_RETRY_BACKOFF_FACTOR:()=>MS,GO_UPSELL_MESSAGE:()=>uB});var yB=2000,TB=2,kB=30000,EB=2147483647,US=new Set(["ECONNRESET","EPIPE","ETIMEDOUT"]);var BS=new Set([429,500,502,503,504,529]);function xB($){if(!($ instanceof Error))return!1;let J=$.status??$.statusCode??$.response?.status;if(typeof J==="number"&&BS.has(J))return!0;let Z=$.code;if(typeof Z==="string"&&US.has(Z))return!0;if($.message==="SSE read timed out")return!0;if(HS($))return!0;return!1}function HS($){let J=$;return J.retryable===!0&&typeof J.category==="string"&&J.category.length>0}function oJ($){return Math.min($,2147483647)}function bB($,J){if(J){if(typeof J.retryAfterMs==="number"&&!Number.isNaN(J.retryAfterMs))return oJ(J.retryAfterMs);let Z=J.data?.responseHeaders;if(Z){let Y=Z["retry-after-ms"];if(Y){let Q=Number.parseFloat(Y);if(!Number.isNaN(Q))return oJ(Q)}let K=Z["retry-after"];if(K){let Q=Number.parseFloat(K);if(!Number.isNaN(Q))return oJ(Math.ceil(Q*1000));let V=Date.parse(K)-Date.now();if(!Number.isNaN(V)&&V>0)return oJ(Math.ceil(V))}return oJ(2000*Math.pow(2,$-1))}}return oJ(Math.min(2000*Math.pow(2,$-1),30000))}var h3=500,g3=2,f3=300000,vB=10;function hB($){return Math.min(h3*g3**($-1),f3)}var uB="Free usage exceeded, subscribe to Go https://opencode.ai/go",OS=yB,qS=TB,FS=kB,zS=EB,dB=xB,pB=bB,CS=h3,MS=g3,DS=f3,PS=vB,IS=hB;function cB($){if(w0.ContextOverflowError.isInstance($))return;if(dB($))return $.message||"Transient network error";if(w0.APIError.isInstance($)){let K=$.data.statusCode;if($.data.category==="output_budget_exhausted"||$.data.category==="empty_output")return;if($.data.category==="stream_failed"&&$.data.isRetryable)return $.data.message;if($.data.category==="stream_truncated"&&$.data.isRetryable)return $.data.message;if(!$.data.isRetryable&&!(K!==void 0&&K>=500))return;if($.data.responseBody?.includes("FreeUsageLimitError"))return uB;return $.data.message.includes("Overloaded")?"Provider is overloaded":$.data.message}let J=$.data?.message;if(typeof J==="string"){let K=J.toLowerCase();if(K.includes("rate increased too quickly")||K.includes("rate limit")||K.includes("too many requests"))return J}let Z=mB(()=>{try{if(typeof $.data?.message==="string")return JSON.parse($.data.message);return JSON.parse($.data.message)}catch{return}});if(!Z||typeof Z!=="object")return;let Y=typeof Z.code==="string"?Z.code:"";if(Z.type==="error"&&Z.error?.type==="too_many_requests")return"Too Many Requests";if(Y.includes("exhausted")||Y.includes("unavailable"))return"Provider is overloaded";if(Z.type==="error"&&typeof Z.error?.code==="string"&&Z.error.code.includes("rate_limit"))return"Rate Limited";return}function AS($){let J=0;return fB.fromStepWithMetadata(G.succeed((Z)=>{let Y=$.parse(Z.input),K=cB(Y);if(!K)return u0.done(Z.attempt);if(w0.APIError.isInstance(Y)&&Y.data.category==="stream_failed"){if(J>=2)return u0.done(Z.attempt);J+=1}return G.gen(function*(){let Q=Z.input,V=typeof Q?.retryAfterMs==="number"?Q.retryAfterMs:void 0,X=pB(Z.attempt,w0.APIError.isInstance(Y)?Y:V!==void 0?{retryAfterMs:V}:void 0),W=yield*gB.currentTimeMillis;return yield*$.set({attempt:Z.attempt,message:K,next:W+X}),[Z.attempt,h2.millis(X)]})}))}var um=Z0.define("tui.instructions.loaded",F.object({files:F.array(F.string()).describe("Display labels of loaded instruction files: worktree-relative path, ~-path, or absolute")}));
7612
- export{W1 as Yg,h0 as Zg,w2 as _g,k2 as $g,FJ as ah,MR as bh,a0 as ch,g1 as dh,e9 as eh,$Z as fh,MJ as gh,um as hh,j1 as ih,PJ as jh,Wy as kh,GF as lh,B1 as mh,KJ as nh,BZ as oh,UF as ph,d1 as qh,d2 as rh,QX as sh,XX as th,c2 as uh,SZ as vh,v7 as wh,K1 as xh,qX as yh,RZ as zh,o2 as Ah,Ax as Bh,oX as Ch,o7 as Dh,aX as Eh,l8 as Fh,o8 as Gh,iU as Hh,JB as Ih,c0 as Jh,dB as Kh,CS as Lh,MS as Mh,DS as Nh,PS as Oh,IS as Ph,m3 as Qh};
7611
+ </bash_metadata>`;if(w){let S=w;yield*X.promise(()=>new Promise((T)=>{S.end(()=>T()),S.on("error",()=>T())}))}return{title:B.description,metadata:{output:M||RH(r),exit:v,description:B.description,truncated:N,...N&&L?{outputPath:L}:{}},output:r}});return()=>X.sync(()=>{let B=KJ.acceptable(),q=KJ.name(B),U=q==="powershell"?"If the commands depend on each other and must run sequentially, avoid '&&' in this shell because Windows PowerShell 5.1 does not support it. Use PowerShell conditionals such as `cmd1; if ($?) { cmd2 }` when later commands must depend on earlier success.":"If the commands depend on each other and must run sequentially, use a single Bash call with '&&' to chain them together (e.g., `git add . && git commit -m \"message\" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before Bash for git operations, or git add before git commit), run these operations sequentially instead.";return f3.info("bash tool using shell",{shell:B}),{description:$.replaceAll("${directory}",H$.directory).replaceAll("${os}",process.platform).replaceAll("${shell}",q).replaceAll("${chaining}",U).replaceAll("${maxLines}",String(DJ)).replaceAll("${maxBytes}",String(u1)),parameters:JX,execute:(z,C)=>X.gen(function*(){let D=t$.get(C.sessionID),M=z.workdir?yield*Q(z.workdir,D,B):D;if(z.timeout!==void 0&&z.timeout<0)throw Error(`Invalid timeout value: ${z.timeout}. Timeout must be a positive number.`);let I=z.timeout??JS,P=yH.has(q),L=yield*OS(z.command,P),w=yield*W(L,M,P,B);if(!H$.containsPath(M))w.dirs.add(M);if(yield*qS(C,w),z.interactive){let N=yield*_(C,M);yield*C.metadata({metadata:{output:"(waiting for user interaction...)",description:z.description}});let x=yield*X.tryPromise(()=>aQ({command:z.command,cwd:M,env:N,description:z.description})).pipe(X.orDie);return{title:z.description,metadata:{output:x.output||"(interactive command completed)",exit:x.exitCode,description:z.description,truncated:!1},output:x.output||`(interactive command completed with exit code ${x.exitCode})`}}return yield*j({shell:B,name:q,command:z.command,cwd:M,env:yield*_(C,M),timeout:I,description:z.description},C)})}})}));var p3={};o$(p3,{retryable:()=>iH,policy:()=>kS,persistentRetryDelay:()=>TS,isRetryableTransientError:()=>oH,delay:()=>rH,SessionRetry:()=>p3,RETRY_MAX_DELAY_NO_HEADERS:()=>SS,RETRY_MAX_DELAY:()=>RS,RETRY_INITIAL_DELAY:()=>IS,RETRY_BACKOFF_FACTOR:()=>AS,PERSISTENT_RETRY_MAX_DELAY:()=>NS,PERSISTENT_RETRY_MAX_ATTEMPTS:()=>yS,PERSISTENT_RETRY_INITIAL_DELAY:()=>wS,PERSISTENT_RETRY_BACKOFF_FACTOR:()=>LS,GO_UPSELL_MESSAGE:()=>lH});var xH=2000,bH=2,vH=30000,hH=2147483647,MS=new Set(["ECONNRESET","EPIPE","ETIMEDOUT"]);var CS=new Set([429,500,502,503,504,529]);function gH($){if(!($ instanceof Error))return!1;let J=$.status??$.statusCode??$.response?.status;if(typeof J==="number"&&CS.has(J))return!0;let Z=$.code;if(typeof Z==="string"&&MS.has(Z))return!0;if($.message==="SSE read timed out")return!0;if(DS($))return!0;return!1}function DS($){let J=$;return J.retryable===!0&&typeof J.category==="string"&&J.category.length>0}function oJ($){return Math.min($,2147483647)}function fH($,J){if(J){if(typeof J.retryAfterMs==="number"&&!Number.isNaN(J.retryAfterMs))return oJ(J.retryAfterMs);let Z=J.data?.responseHeaders;if(Z){let Y=Z["retry-after-ms"];if(Y){let V=Number.parseFloat(Y);if(!Number.isNaN(V))return oJ(V)}let K=Z["retry-after"];if(K){let V=Number.parseFloat(K);if(!Number.isNaN(V))return oJ(Math.ceil(V*1000));let Q=Date.parse(K)-Date.now();if(!Number.isNaN(Q)&&Q>0)return oJ(Math.ceil(Q))}return oJ(2000*Math.pow(2,$-1))}}return oJ(Math.min(2000*Math.pow(2,$-1),30000))}var m3=500,u3=2,d3=300000,mH=10;function uH($){return Math.min(m3*u3**($-1),d3)}var lH="Free usage exceeded, subscribe to Go https://opencode.ai/go",IS=xH,AS=bH,SS=vH,RS=hH,oH=gH,rH=fH,wS=m3,LS=u3,NS=d3,yS=mH,TS=uH;function iH($){if(R0.ContextOverflowError.isInstance($))return;if(oH($))return $.message||"Transient network error";if(R0.APIError.isInstance($)){let K=$.data.statusCode;if($.data.category==="output_budget_exhausted"||$.data.category==="empty_output")return;if($.data.category==="stream_failed"&&$.data.isRetryable)return $.data.message;if($.data.category==="stream_truncated"&&$.data.isRetryable)return $.data.message;if(!$.data.isRetryable&&!(K!==void 0&&K>=500))return;if($.data.responseBody?.includes("FreeUsageLimitError"))return lH;return $.data.message.includes("Overloaded")?"Provider is overloaded":$.data.message}let J=$.data?.message;if(typeof J==="string"){let K=J.toLowerCase();if(K.includes("rate increased too quickly")||K.includes("rate limit")||K.includes("too many requests"))return J}let Z=cH(()=>{try{if(typeof $.data?.message==="string")return JSON.parse($.data.message);return JSON.parse($.data.message)}catch{return}});if(!Z||typeof Z!=="object")return;let Y=typeof Z.code==="string"?Z.code:"";if(Z.type==="error"&&Z.error?.type==="too_many_requests")return"Too Many Requests";if(Y.includes("exhausted")||Y.includes("unavailable"))return"Provider is overloaded";if(Z.type==="error"&&typeof Z.error?.code==="string"&&Z.error.code.includes("rate_limit"))return"Rate Limited";return}function kS($){let J=0;return pH.fromStepWithMetadata(X.succeed((Z)=>{let Y=$.parse(Z.input),K=iH(Y);if(!K)return u0.done(Z.attempt);if(R0.APIError.isInstance(Y)&&Y.data.category==="stream_failed"){if(J>=2)return u0.done(Z.attempt);J+=1}return X.gen(function*(){let V=Z.input,Q=typeof V?.retryAfterMs==="number"?V.retryAfterMs:void 0,G=rH(Z.attempt,R0.APIError.isInstance(Y)?Y:Q!==void 0?{retryAfterMs:Q}:void 0),W=yield*dH.currentTimeMillis;return yield*$.set({attempt:Z.attempt,message:K,next:W+G}),[Z.attempt,h2.millis(G)]})}))}var am=Z0.define("tui.instructions.loaded",F.object({files:F.array(F.string()).describe("Display labels of loaded instruction files: worktree-relative path, ~-path, or absolute")}));
7612
+ export{W1 as _g,h0 as $g,R2 as ah,k2 as bh,FJ as ch,Lw as dh,a0 as eh,g1 as fh,e9 as gh,$Z as hh,CJ as ih,am as jh,j1 as kh,PJ as lh,Fy as mh,UF as nh,H1 as oh,KJ as ph,HZ as qh,OF as rh,d1 as sh,d2 as th,jG as uh,BG as vh,c2 as wh,SZ as xh,g7 as yh,K1 as zh,DG as Ah,wZ as Bh,o2 as Ch,Ex as Dh,aG as Eh,i7 as Fh,ZW as Gh,l8 as Hh,o8 as Ih,eU as Jh,QH as Kh,c0 as Lh,oH as Mh,wS as Nh,LS as Oh,NS as Ph,yS as Qh,TS as Rh,p3 as Sh};