cognova 0.2.2 → 0.2.4

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 (1205) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{DJjDvbZE.js → -2wkydbj.js} +1 -1
  3. package/.output/public/_nuxt/0J8pJb0Z.js +1 -0
  4. package/.output/public/_nuxt/0LyRrTRM.js +1 -0
  5. package/.output/public/_nuxt/1Hz98MKF.js +1 -0
  6. package/.output/public/_nuxt/{DIoI0uJm.js → 1IuG3yiQ.js} +1 -1
  7. package/.output/public/_nuxt/{D_3Rq1BS.js → 4bC1z31I.js} +1 -1
  8. package/.output/public/_nuxt/{yuf23kh9.js → A5lrd5_j.js} +1 -1
  9. package/.output/public/_nuxt/{CxuZBC8n.js → B-5roYpk.js} +1 -1
  10. package/.output/public/_nuxt/B-YQztaH.js +1 -0
  11. package/.output/public/_nuxt/B1gFtqXK.js +1 -0
  12. package/.output/public/_nuxt/B43p0So7.js +1 -0
  13. package/.output/public/_nuxt/{C6RC3lA1.js → B5OWqWCh.js} +1 -1
  14. package/.output/public/_nuxt/{BZXMQuYP.js → B7-0ADn3.js} +1 -1
  15. package/.output/public/_nuxt/{CeIVm4A3.js → B8Kve-DH.js} +1 -1
  16. package/.output/public/_nuxt/{iBGCpHdw.js → B9Kd_0HK.js} +2 -2
  17. package/.output/public/_nuxt/BJ_GgKV0.js +1 -0
  18. package/.output/public/_nuxt/BJi2ZHtT.js +1 -0
  19. package/.output/public/_nuxt/{BsEZoHd1.js → BLL1JLwq.js} +1 -1
  20. package/.output/public/_nuxt/{C_BdYLzz.js → BLszW9T3.js} +1 -1
  21. package/.output/public/_nuxt/{YuTZB7sD.js → BMLwzSDu.js} +1 -1
  22. package/.output/public/_nuxt/{DAQhmSv4.js → BNlugvM3.js} +1 -1
  23. package/.output/public/_nuxt/BTfZ7nek.js +1 -0
  24. package/.output/public/_nuxt/{IRSbVPIu.js → BTk5mgdf.js} +1 -1
  25. package/.output/public/_nuxt/{CitkKxhw.js → BW-E-Sar.js} +1 -1
  26. package/.output/public/_nuxt/BZFXnEwe.js +1 -0
  27. package/.output/public/_nuxt/{CihWZmJe.js → B_28CKij.js} +2 -2
  28. package/.output/public/_nuxt/BaJEGr8G.js +1 -0
  29. package/.output/public/_nuxt/{xuzLdW-o.js → BaVaTug8.js} +1 -1
  30. package/.output/public/_nuxt/{yNrp2XvX.js → Bb1B0ntt.js} +1 -1
  31. package/.output/public/_nuxt/Bb9LNSu_.js +1 -0
  32. package/.output/public/_nuxt/BbPnqQJ0.js +1 -0
  33. package/.output/public/_nuxt/{KKK6HVeG.js → Bc0NIKN7.js} +1 -1
  34. package/.output/public/_nuxt/{cABRLVee.js → BdCB2PoJ.js} +1 -1
  35. package/.output/public/_nuxt/{BffWCM73.js → Bf34lExB.js} +1 -1
  36. package/.output/public/_nuxt/BhOIdu3Z.js +1 -0
  37. package/.output/public/_nuxt/{DfQu3kEw.js → BhSWIRpp.js} +1 -1
  38. package/.output/public/_nuxt/{Lwdv_RKd.js → BjFs8Ujb.js} +1 -1
  39. package/.output/public/_nuxt/BmTCDcNm.js +1 -0
  40. package/.output/public/_nuxt/{Cvp7FI3T.js → Bn8loaeQ.js} +1 -1
  41. package/.output/public/_nuxt/{4MiwzAAt.js → BoPAYize.js} +2 -2
  42. package/.output/public/_nuxt/{BCtfQCzC.js → BrICHPil.js} +1 -1
  43. package/.output/public/_nuxt/{FNC8XZTk.js → Brqrl-cH.js} +1 -1
  44. package/.output/public/_nuxt/{9IQmsEjr.js → BsPj3ifk.js} +1 -1
  45. package/.output/public/_nuxt/{EuOqK1A6.js → BsXPllgv.js} +1 -1
  46. package/.output/public/_nuxt/{wCGVE8_e.js → BvuV9uCn.js} +1 -1
  47. package/.output/public/_nuxt/By6kmkhJ.js +1 -0
  48. package/.output/public/_nuxt/{DKZxeXDQ.js → ByfSJZV6.js} +1 -1
  49. package/.output/public/_nuxt/{DSRrg8JT.js → C14DGwaT.js} +1 -1
  50. package/.output/public/_nuxt/C4XVJnNJ.js +1 -0
  51. package/.output/public/_nuxt/{g20UHUCv.js → C5nfaH9w.js} +1 -1
  52. package/.output/public/_nuxt/{DTDgHTuh.js → C6Kc4XvS.js} +2 -2
  53. package/.output/public/_nuxt/{eko-0FUm.js → CB8_A8N4.js} +1 -1
  54. package/.output/public/_nuxt/{JJ3634gV.js → CBrXB4hk.js} +1 -1
  55. package/.output/public/_nuxt/{FvlxxmNk.js → CEfkp9Rl.js} +2 -2
  56. package/.output/public/_nuxt/{B1X4Bzcy.js → CG0fS-BQ.js} +1 -1
  57. package/.output/public/_nuxt/{Fukkqjkf.js → CJ85o8FK.js} +1 -1
  58. package/.output/public/_nuxt/CK5Ef4YR.js +1 -0
  59. package/.output/public/_nuxt/CLZS246x.js +1 -0
  60. package/.output/public/_nuxt/{C6aqGHu1.js → CNwGp6eP.js} +1 -1
  61. package/.output/public/_nuxt/CSQ-nblB.js +1 -0
  62. package/.output/public/_nuxt/CVr40yKH.js +1 -0
  63. package/.output/public/_nuxt/{DznawRFW.js → CW8xtqwN.js} +1 -1
  64. package/.output/public/_nuxt/{Cr8ixbr1.js → CXuKrnTA.js} +1 -1
  65. package/.output/public/_nuxt/{Cp2MA0cm.js → CeDxLTxX.js} +1 -1
  66. package/.output/public/_nuxt/{Cqy_L_ip.js → Cebw7Q7c.js} +1 -1
  67. package/.output/public/_nuxt/Cedv1M65.js +1 -0
  68. package/.output/public/_nuxt/{Bm9LyG4F.js → CfWDee_q.js} +1 -1
  69. package/.output/public/_nuxt/{DnjGH3SQ.js → CgQKyBSS.js} +1 -1
  70. package/.output/public/_nuxt/{CqU2XbzO.js → Ci-MVdCd.js} +1 -1
  71. package/.output/public/_nuxt/CjRmY2OQ.js +1 -0
  72. package/.output/public/_nuxt/{Jez9DHn7.js → CjYUi9c8.js} +1 -1
  73. package/.output/public/_nuxt/CkvyAKbu.js +1 -0
  74. package/.output/public/_nuxt/CnW8zyuA.js +1 -0
  75. package/.output/public/_nuxt/{BlAZO7nq.js → Cow1TrPj.js} +1 -1
  76. package/.output/public/_nuxt/{BjjCvHLT.js → CpC3C9gj.js} +1 -1
  77. package/.output/public/_nuxt/{D6t3dcTl.js → CphXSvBo.js} +1 -1
  78. package/.output/public/_nuxt/{_CYZi8HN.js → CqiOV9n1.js} +1 -1
  79. package/.output/public/_nuxt/{D3RiUGdz.js → CrjKigv8.js} +1 -1
  80. package/.output/public/_nuxt/{BxXOsXrM.js → CvMqUdkl.js} +10 -10
  81. package/.output/public/_nuxt/CwCEQ4Dw.js +1 -0
  82. package/.output/public/_nuxt/{BqKFIuRj.js → CwJR22-0.js} +1 -1
  83. package/.output/public/_nuxt/{D3e44mCL.js → CwaMSU1O.js} +1 -1
  84. package/.output/public/_nuxt/{DJMS2og1.js → CxJr4mB0.js} +1 -1
  85. package/.output/public/_nuxt/{BOj6t-oo.js → CzTTKfet.js} +1 -1
  86. package/.output/public/_nuxt/{CtYFj7k1.js → CzqLfT8k.js} +1 -1
  87. package/.output/public/_nuxt/{C4pxqdgg.js → D-wVwRIx.js} +1 -1
  88. package/.output/public/_nuxt/D2f7BlK2.js +1 -0
  89. package/.output/public/_nuxt/D2lmhTjQ.js +1 -0
  90. package/.output/public/_nuxt/D3V98LVR.js +1 -0
  91. package/.output/public/_nuxt/D64-rCSQ.js +1 -0
  92. package/.output/public/_nuxt/{CsJ9KhQ4.js → DAFasgHH.js} +1 -1
  93. package/.output/public/_nuxt/{DHKLCQRG.js → DAs574wU.js} +1 -1
  94. package/.output/public/_nuxt/DB3y_21M.js +1 -0
  95. package/.output/public/_nuxt/{m5kGCDpI.js → DCco_rlV.js} +3 -3
  96. package/.output/public/_nuxt/{DK9jxJ0g.js → DGP2JJt8.js} +1 -1
  97. package/.output/public/_nuxt/{Nb2jBtYT.js → DImdNj-F.js} +1 -1
  98. package/.output/public/_nuxt/{Dy_Cq5LQ.js → DMsHLHmB.js} +1 -1
  99. package/.output/public/_nuxt/{BasgsT_S.js → DNpsjOxN.js} +1 -1
  100. package/.output/public/_nuxt/{B3y_Qqox.js → DV0JMebZ.js} +1 -1
  101. package/.output/public/_nuxt/DZ_azKLI.js +1 -0
  102. package/.output/public/_nuxt/DZdh7_lh.js +1 -0
  103. package/.output/public/_nuxt/{DCzfkCGa.js → DaiWSWdm.js} +1 -1
  104. package/.output/public/_nuxt/{CKkC3Ptm.js → Db5XIfWS.js} +1 -1
  105. package/.output/public/_nuxt/DfpSaqgV.js +1 -0
  106. package/.output/public/_nuxt/{CNnJrDvu.js → DgKeJf5C.js} +1 -1
  107. package/.output/public/_nuxt/{CYP_MLH8.js → DgPiIWA2.js} +1 -1
  108. package/.output/public/_nuxt/Dkzqkzki.js +1 -0
  109. package/.output/public/_nuxt/DpYns7cT.js +1 -0
  110. package/.output/public/_nuxt/Dpp5cOwJ.js +1 -0
  111. package/.output/public/_nuxt/{Daz4MeL6.js → Drr-RSSP.js} +1 -1
  112. package/.output/public/_nuxt/{C0JKNMDO.js → DsKy-gee.js} +1 -1
  113. package/.output/public/_nuxt/DuOsLoVR.js +1 -0
  114. package/.output/public/_nuxt/{CtchsY6e.js → DvgLoqaC.js} +1 -1
  115. package/.output/public/_nuxt/Dx2Tgm6S.js +71 -0
  116. package/.output/public/_nuxt/{BAIz-dEB.js → DxR8g9So.js} +1 -1
  117. package/.output/public/_nuxt/Dysa6np_.js +1 -0
  118. package/.output/public/_nuxt/DytaiikM.js +1 -0
  119. package/.output/public/_nuxt/{nIU2F7ia.js → EgYyfo1g.js} +3 -3
  120. package/.output/public/_nuxt/HC3657Xq.js +1 -0
  121. package/.output/public/_nuxt/{DGX0tzL8.js → HCCuOAgZ.js} +1 -1
  122. package/.output/public/_nuxt/{Ci7UEZQh.js → JJIcQEna.js} +1 -1
  123. package/.output/public/_nuxt/{BYjadNrw.js → MdebRWqA.js} +1 -1
  124. package/.output/public/_nuxt/{BzOqrmGa.js → MzEmU9ER.js} +3 -3
  125. package/.output/public/_nuxt/{Db2v8O7O.js → NBE83ZQn.js} +1 -1
  126. package/.output/public/_nuxt/{ghuJ76mD.js → NlScC3GW.js} +1 -1
  127. package/.output/public/_nuxt/{BWhMnjID.js → RRoc4m9d.js} +1 -1
  128. package/.output/public/_nuxt/S4a_N6rD.js +1 -0
  129. package/.output/public/_nuxt/WWNeb45u.js +1 -0
  130. package/.output/public/_nuxt/XzRnkkwG.js +1 -0
  131. package/.output/public/_nuxt/{DG-T44jj.js → Zjvb5YJR.js} +1 -1
  132. package/.output/public/_nuxt/{pcUI-zuY.js → _16_b82K.js} +1 -1
  133. package/.output/public/_nuxt/{CmzH6R-N.js → atVSHCxP.js} +19 -19
  134. package/.output/public/_nuxt/builds/latest.json +1 -1
  135. package/.output/public/_nuxt/builds/meta/92941c1a-266b-42f8-9e67-ac947a462d37.json +1 -0
  136. package/.output/public/_nuxt/{CVgTJeSq.js → deSeNTOh.js} +1 -1
  137. package/.output/public/_nuxt/entry._7ZkP07A.css +1 -0
  138. package/.output/public/_nuxt/f7zDjk6q.js +1 -0
  139. package/.output/public/_nuxt/{C69W7k2j.js → fTEmwfo4.js} +1 -1
  140. package/.output/public/_nuxt/{gBC9k4Qj.js → hqpqUuXS.js} +2 -2
  141. package/.output/public/_nuxt/{B6S_ob86.js → jeu3Xx8e.js} +1 -1
  142. package/.output/public/_nuxt/{DyRelyfs.js → pkbwpgSD.js} +1 -1
  143. package/.output/public/_nuxt/{BrNqhp1a.js → qW7F87d8.js} +7 -7
  144. package/.output/public/_nuxt/{C3FxIITy.js → sdvIKLwS.js} +1 -1
  145. package/.output/public/_nuxt/{usage.vakN1lvi.css → usage.BDeyCZwW.css} +1 -1
  146. package/.output/public/_nuxt/{9QnH0xQM.js → vM-wdhkZ.js} +1 -1
  147. package/.output/public/_nuxt/{Cdt3I3Go.js → w3t8WD8v.js} +1 -1
  148. package/.output/public/_nuxt/zBoPDS4z.js +1 -0
  149. package/.output/public/favicon.svg +1 -0
  150. package/.output/server/chunks/build/A-BWukSPjS.mjs +5 -1
  151. package/.output/server/chunks/build/Accordion-BaJYea6e.mjs +5 -1
  152. package/.output/server/chunks/build/AccordionItem-DdG2zgcN.mjs +5 -1
  153. package/.output/server/chunks/build/Badge-BrU9UkCv.mjs +5 -1
  154. package/.output/server/chunks/build/Blockquote-DND8wTkU.mjs +5 -1
  155. package/.output/server/chunks/build/Callout-1halpaEg.mjs +5 -1
  156. package/.output/server/chunks/build/Card-BHCSDKDt.mjs +5 -1
  157. package/.output/server/chunks/build/CardGroup-BOuJcNGp.mjs +5 -1
  158. package/.output/server/chunks/build/Caution-BP3y-TcC.mjs +5 -1
  159. package/.output/server/chunks/build/Code-B1xkAS5a.mjs +5 -1
  160. package/.output/server/chunks/build/CodeCollapse-BIhaNa22.mjs +5 -1
  161. package/.output/server/chunks/build/CodeGroup-BviYyCuo.mjs +5 -1
  162. package/.output/server/chunks/build/CodeIcon-CWD5HcV7.mjs +6 -2
  163. package/.output/server/chunks/build/CodePreview-D8PsCQ6m.mjs +5 -1
  164. package/.output/server/chunks/build/CodeTree-BUTLupmL.mjs +5 -1
  165. package/.output/server/chunks/build/Collapsible-BIvXNaSq.mjs +5 -1
  166. package/.output/server/chunks/build/DropdownMenu-BBrV9nXz.mjs +1 -1
  167. package/.output/server/chunks/build/EditorToolbar-DIfb5arC.mjs +1 -1
  168. package/.output/server/chunks/build/Em-DsIz_BnD.mjs +5 -1
  169. package/.output/server/chunks/build/Field-cwwmSQDT.mjs +5 -1
  170. package/.output/server/chunks/build/FieldGroup-CAIpQv8s.mjs +5 -1
  171. package/.output/server/chunks/build/H1-BbFNsPyP.mjs +5 -1
  172. package/.output/server/chunks/build/H2-vHTl_pWr.mjs +5 -1
  173. package/.output/server/chunks/build/H3-7eTcfO3s.mjs +5 -1
  174. package/.output/server/chunks/build/H4-C89p_PKO.mjs +5 -1
  175. package/.output/server/chunks/build/Hr-Bm8RlL3O.mjs +5 -1
  176. package/.output/server/chunks/build/Icon-Dp9iy0BI.mjs +5 -1
  177. package/.output/server/chunks/build/Img-CWLmvN1t.mjs +6 -2
  178. package/.output/server/chunks/build/Kbd-CQG6I_Ch.mjs +5 -1
  179. package/.output/server/chunks/build/Li-Bw1QUaGv.mjs +5 -1
  180. package/.output/server/chunks/build/MDC-Dx0YPDhe.mjs +1 -1
  181. package/.output/server/chunks/build/Note-CHkjm9jm.mjs +5 -1
  182. package/.output/server/chunks/build/Ol-D-fPnfFM.mjs +5 -1
  183. package/.output/server/chunks/build/P-B5YI1V9y.mjs +5 -1
  184. package/.output/server/chunks/build/Pre-ChiJcf3C.mjs +5 -1
  185. package/.output/server/chunks/build/ProseH5-DahJyv8h.mjs +5 -1
  186. package/.output/server/chunks/build/ProseH6-C4Is5h6c.mjs +5 -1
  187. package/.output/server/chunks/build/Select-BB1oLrCD.mjs +1 -1
  188. package/.output/server/chunks/build/SelectMenu-DPssg6zD.mjs +1 -1
  189. package/.output/server/chunks/build/Steps-BZpvXfzb.mjs +5 -1
  190. package/.output/server/chunks/build/Strong-DXJqOWL3.mjs +5 -1
  191. package/.output/server/chunks/build/Table-BSrLZ7dt.mjs +5 -1
  192. package/.output/server/chunks/build/Table-DCwTlhCj.mjs +1 -1
  193. package/.output/server/chunks/build/Tabs-Dk3nvOFF.mjs +5 -1
  194. package/.output/server/chunks/build/TabsItem-CDhyuBtJ.mjs +5 -1
  195. package/.output/server/chunks/build/Tbody-CjMT5oH-.mjs +5 -1
  196. package/.output/server/chunks/build/Td-ZBVaEjFN.mjs +5 -1
  197. package/.output/server/chunks/build/Th-D317icbd.mjs +5 -1
  198. package/.output/server/chunks/build/Thead-Ca_ZESTK.mjs +5 -1
  199. package/.output/server/chunks/build/Tip-CP3oTARR.mjs +5 -1
  200. package/.output/server/chunks/build/Tooltip-TRyl6dje.mjs +1 -1
  201. package/.output/server/chunks/build/Tr-6jI8j9gD.mjs +5 -1
  202. package/.output/server/chunks/build/{docs-Dk2JnYq3.mjs → Tree-DUhXKd8y.mjs} +46 -2235
  203. package/.output/server/chunks/build/Tree-DUhXKd8y.mjs.map +1 -0
  204. package/.output/server/chunks/build/Ul-BUGj_CPb.mjs +5 -1
  205. package/.output/server/chunks/build/Warning-BJ8G6cxC.mjs +5 -1
  206. package/.output/server/chunks/build/_id_-DN00UDdO.mjs +5 -1
  207. package/.output/server/chunks/build/_id_-DN00UDdO.mjs.map +1 -1
  208. package/.output/server/chunks/build/_name_-BnS_KEfX.mjs +1595 -0
  209. package/.output/server/chunks/build/_name_-BnS_KEfX.mjs.map +1 -0
  210. package/.output/server/chunks/build/{_uuid_-0UgdUhfY.mjs → _uuid_-DfJaumTE.mjs} +9 -5
  211. package/.output/server/chunks/build/{_uuid_-0UgdUhfY.mjs.map → _uuid_-DfJaumTE.mjs.map} +1 -1
  212. package/.output/server/chunks/build/auth-BGPNH2QJ.mjs +20 -0
  213. package/.output/server/chunks/build/auth-BGPNH2QJ.mjs.map +1 -0
  214. package/.output/server/chunks/build/auth-CvD7MqKW.mjs +5 -1
  215. package/.output/server/chunks/build/auth-CvD7MqKW.mjs.map +1 -1
  216. package/.output/server/chunks/build/chat-CZMiB68R.mjs +5 -1
  217. package/.output/server/chunks/build/chat-CZMiB68R.mjs.map +1 -1
  218. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  219. package/.output/server/chunks/build/cookie-C_iulBi6.mjs +1 -1
  220. package/.output/server/chunks/build/{dashboard-YEscLBQN.mjs → dashboard-CLk1NlbR.mjs} +19 -5
  221. package/.output/server/chunks/build/dashboard-CLk1NlbR.mjs.map +1 -0
  222. package/.output/server/chunks/build/{dashboard-CpMVYnDV.mjs → dashboard-CiVTAZuF.mjs} +16 -5
  223. package/.output/server/chunks/build/{dashboard-CpMVYnDV.mjs.map → dashboard-CiVTAZuF.mjs.map} +1 -1
  224. package/.output/server/chunks/build/docs-ChGwOPg5.mjs +2207 -0
  225. package/.output/server/chunks/build/docs-ChGwOPg5.mjs.map +1 -0
  226. package/.output/server/chunks/build/error-404-BzbcNcdU.mjs +5 -1
  227. package/.output/server/chunks/build/error-500-uCDjGRW8.mjs +5 -1
  228. package/.output/server/chunks/build/fetch-BB7Qzkwe.mjs +1 -1
  229. package/.output/server/chunks/build/{hooks-DP8WoUPS.mjs → hooks-D328DcO6.mjs} +7 -3
  230. package/.output/server/chunks/build/hooks-D328DcO6.mjs.map +1 -0
  231. package/.output/server/chunks/build/{index-DVx-QlhP.mjs → index-Byt-3Yq6.mjs} +7 -3
  232. package/.output/server/chunks/build/{index-DVx-QlhP.mjs.map → index-Byt-3Yq6.mjs.map} +1 -1
  233. package/.output/server/chunks/build/{index-Ba_bPJgk.mjs → index-C9PuieXh.mjs} +7 -3
  234. package/.output/server/chunks/build/index-C9PuieXh.mjs.map +1 -0
  235. package/.output/server/chunks/build/index-CAnGTRlu.mjs +1775 -0
  236. package/.output/server/chunks/build/index-CAnGTRlu.mjs.map +1 -0
  237. package/.output/server/chunks/build/index-CxDxc9fm.mjs +1 -1
  238. package/.output/server/chunks/build/index-DzdvIi8V.mjs +5 -1
  239. package/.output/server/chunks/build/library-Aeg7_Lsb.mjs +606 -0
  240. package/.output/server/chunks/build/library-Aeg7_Lsb.mjs.map +1 -0
  241. package/.output/server/chunks/build/{login-BAysbpyX.mjs → login-DnnElTl2.mjs} +19 -8
  242. package/.output/server/chunks/build/{login-BAysbpyX.mjs.map → login-DnnElTl2.mjs.map} +1 -1
  243. package/.output/server/chunks/build/memories-BqA719O1.mjs +5 -1
  244. package/.output/server/chunks/build/memories-BqA719O1.mjs.map +1 -1
  245. package/.output/server/chunks/build/server.mjs +67 -36
  246. package/.output/server/chunks/build/server.mjs.map +1 -1
  247. package/.output/server/chunks/build/{settings-DdkKCJ00.mjs → settings-DuT6LGJZ.mjs} +525 -12
  248. package/.output/server/chunks/build/settings-DuT6LGJZ.mjs.map +1 -0
  249. package/.output/server/chunks/build/styles.mjs +2 -2
  250. package/.output/server/chunks/build/{tasks-DiOi1HG_.mjs → tasks-DnAFqbtt.mjs} +7 -3
  251. package/.output/server/chunks/build/tasks-DnAFqbtt.mjs.map +1 -0
  252. package/.output/server/chunks/build/{usage-H_mcd_fz.mjs → usage-CSrBh4Or.mjs} +163 -45
  253. package/.output/server/chunks/build/{usage-H_mcd_fz.mjs.map → usage-CSrBh4Or.mjs.map} +1 -1
  254. package/.output/server/chunks/build/useNotificationBus-BG5JNQf1.mjs +1 -1
  255. package/.output/server/chunks/build/{usePreferences-CzC8fRzd.mjs → usePreferences-DH1QjxOj.mjs} +7 -1
  256. package/.output/server/chunks/build/usePreferences-DH1QjxOj.mjs.map +1 -0
  257. package/.output/server/chunks/build/{view-Dc8mvzCB.mjs → view-n2sYa4Zh.mjs} +8 -4
  258. package/.output/server/chunks/build/{view-Dc8mvzCB.mjs.map → view-n2sYa4Zh.mjs.map} +1 -1
  259. package/.output/server/chunks/build/virtual_nuxt__Users_tony_Documents_GitHub_second-brain_node_modules_.cache_nuxt_.nuxt_mdc-imports-PtwWlZ2H.mjs +5 -1
  260. package/.output/server/chunks/nitro/nitro.mjs +2473 -1040
  261. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  262. package/.output/server/chunks/routes/_ws/chat.mjs +5 -1
  263. package/.output/server/chunks/routes/_ws/chat.mjs.map +1 -1
  264. package/.output/server/chunks/routes/api/agents/_id/cancel.post.mjs +5 -1
  265. package/.output/server/chunks/routes/api/agents/_id/cancel.post.mjs.map +1 -1
  266. package/.output/server/chunks/routes/api/agents/_id/run.post.mjs +5 -1
  267. package/.output/server/chunks/routes/api/agents/_id/run.post.mjs.map +1 -1
  268. package/.output/server/chunks/routes/api/agents/_id/runs.get.mjs +5 -1
  269. package/.output/server/chunks/routes/api/agents/_id/runs.get.mjs.map +1 -1
  270. package/.output/server/chunks/routes/api/agents/_id/stats.get.mjs +5 -1
  271. package/.output/server/chunks/routes/api/agents/_id/stats.get.mjs.map +1 -1
  272. package/.output/server/chunks/routes/api/agents/_id_.delete.mjs +5 -1
  273. package/.output/server/chunks/routes/api/agents/_id_.delete.mjs.map +1 -1
  274. package/.output/server/chunks/routes/api/agents/_id_.get.mjs +5 -1
  275. package/.output/server/chunks/routes/api/agents/_id_.get.mjs.map +1 -1
  276. package/.output/server/chunks/routes/api/agents/_id_.patch.mjs +5 -1
  277. package/.output/server/chunks/routes/api/agents/_id_.patch.mjs.map +1 -1
  278. package/.output/server/chunks/routes/api/agents/stats.get.mjs +5 -1
  279. package/.output/server/chunks/routes/api/agents/stats.get.mjs.map +1 -1
  280. package/.output/server/chunks/routes/api/auth/_...all_.mjs +5 -1
  281. package/.output/server/chunks/routes/api/auth/_...all_.mjs.map +1 -1
  282. package/.output/server/chunks/routes/api/bridges/_id/health.get.mjs +98 -0
  283. package/.output/server/chunks/routes/api/bridges/_id/health.get.mjs.map +1 -0
  284. package/.output/server/chunks/routes/api/bridges/_id_.delete.mjs +68 -0
  285. package/.output/server/chunks/routes/api/bridges/_id_.delete.mjs.map +1 -0
  286. package/.output/server/chunks/routes/api/bridges/_id_.get.mjs +60 -0
  287. package/.output/server/chunks/routes/api/bridges/_id_.get.mjs.map +1 -0
  288. package/.output/server/chunks/routes/api/bridges/_id_.put.mjs +79 -0
  289. package/.output/server/chunks/routes/api/bridges/_id_.put.mjs.map +1 -0
  290. package/.output/server/chunks/routes/api/bridges/context.get.mjs +183 -0
  291. package/.output/server/chunks/routes/api/bridges/context.get.mjs.map +1 -0
  292. package/.output/server/chunks/routes/api/conversations/_id_.delete.mjs +6 -2
  293. package/.output/server/chunks/routes/api/conversations/_id_.delete.mjs.map +1 -1
  294. package/.output/server/chunks/routes/api/conversations/_id_.get.mjs +6 -2
  295. package/.output/server/chunks/routes/api/conversations/_id_.get.mjs.map +1 -1
  296. package/.output/server/chunks/routes/api/dashboard/overview.get.mjs +6 -2
  297. package/.output/server/chunks/routes/api/dashboard/overview.get.mjs.map +1 -1
  298. package/.output/server/chunks/routes/api/documents/_id/public.get.mjs +6 -2
  299. package/.output/server/chunks/routes/api/documents/_id/public.get.mjs.map +1 -1
  300. package/.output/server/chunks/routes/api/documents/_id/restore.post.mjs +6 -2
  301. package/.output/server/chunks/routes/api/documents/_id/restore.post.mjs.map +1 -1
  302. package/.output/server/chunks/routes/api/documents/by-path.post.mjs +6 -2
  303. package/.output/server/chunks/routes/api/documents/by-path.post.mjs.map +1 -1
  304. package/.output/server/chunks/routes/api/documents/index.delete.mjs +6 -2
  305. package/.output/server/chunks/routes/api/documents/index.delete.mjs.map +1 -1
  306. package/.output/server/chunks/routes/api/documents/index.put.mjs +6 -2
  307. package/.output/server/chunks/routes/api/documents/index.put.mjs.map +1 -1
  308. package/.output/server/chunks/routes/api/fs/delete.post.mjs +6 -2
  309. package/.output/server/chunks/routes/api/fs/delete.post.mjs.map +1 -1
  310. package/.output/server/chunks/routes/api/fs/list.get.mjs +6 -2
  311. package/.output/server/chunks/routes/api/fs/list.get.mjs.map +1 -1
  312. package/.output/server/chunks/routes/api/fs/mkdir.post.mjs +6 -2
  313. package/.output/server/chunks/routes/api/fs/mkdir.post.mjs.map +1 -1
  314. package/.output/server/chunks/routes/api/fs/move.post.mjs +6 -2
  315. package/.output/server/chunks/routes/api/fs/move.post.mjs.map +1 -1
  316. package/.output/server/chunks/routes/api/fs/read.post.mjs +6 -2
  317. package/.output/server/chunks/routes/api/fs/read.post.mjs.map +1 -1
  318. package/.output/server/chunks/routes/api/fs/rename.post.mjs +6 -2
  319. package/.output/server/chunks/routes/api/fs/rename.post.mjs.map +1 -1
  320. package/.output/server/chunks/routes/api/fs/write.post.mjs +6 -2
  321. package/.output/server/chunks/routes/api/fs/write.post.mjs.map +1 -1
  322. package/.output/server/chunks/routes/api/health.get.mjs +6 -2
  323. package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
  324. package/.output/server/chunks/routes/api/home.get.mjs +6 -2
  325. package/.output/server/chunks/routes/api/home.get.mjs.map +1 -1
  326. package/.output/server/chunks/routes/api/hooks/index.get.mjs +6 -2
  327. package/.output/server/chunks/routes/api/hooks/index.get.mjs.map +1 -1
  328. package/.output/server/chunks/routes/api/hooks/index.post.mjs +6 -2
  329. package/.output/server/chunks/routes/api/hooks/index.post.mjs.map +1 -1
  330. package/.output/server/chunks/routes/api/hooks/stats.get.mjs +6 -2
  331. package/.output/server/chunks/routes/api/hooks/stats.get.mjs.map +1 -1
  332. package/.output/server/chunks/routes/api/index.get.mjs +5 -1
  333. package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
  334. package/.output/server/chunks/routes/api/index.get10.mjs +86 -0
  335. package/.output/server/chunks/routes/api/index.get10.mjs.map +1 -0
  336. package/.output/server/chunks/routes/api/index.get2.mjs +12 -5
  337. package/.output/server/chunks/routes/api/index.get2.mjs.map +1 -1
  338. package/.output/server/chunks/routes/api/index.get3.mjs +9 -34
  339. package/.output/server/chunks/routes/api/index.get3.mjs.map +1 -1
  340. package/.output/server/chunks/routes/api/index.get4.mjs +36 -5
  341. package/.output/server/chunks/routes/api/index.get4.mjs.map +1 -1
  342. package/.output/server/chunks/routes/api/index.get5.mjs +13 -15
  343. package/.output/server/chunks/routes/api/index.get5.mjs.map +1 -1
  344. package/.output/server/chunks/routes/api/index.get6.mjs +18 -22
  345. package/.output/server/chunks/routes/api/index.get6.mjs.map +1 -1
  346. package/.output/server/chunks/routes/api/index.get7.mjs +24 -34
  347. package/.output/server/chunks/routes/api/index.get7.mjs.map +1 -1
  348. package/.output/server/chunks/routes/api/index.get8.mjs +58 -45
  349. package/.output/server/chunks/routes/api/index.get8.mjs.map +1 -1
  350. package/.output/server/chunks/routes/api/index.get9.mjs +80 -0
  351. package/.output/server/chunks/routes/api/index.get9.mjs.map +1 -0
  352. package/.output/server/chunks/routes/api/index.post.mjs +5 -1
  353. package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
  354. package/.output/server/chunks/routes/api/index.post2.mjs +27 -17
  355. package/.output/server/chunks/routes/api/index.post2.mjs.map +1 -1
  356. package/.output/server/chunks/routes/api/index.post3.mjs +22 -35
  357. package/.output/server/chunks/routes/api/index.post3.mjs.map +1 -1
  358. package/.output/server/chunks/routes/api/index.post4.mjs +36 -25
  359. package/.output/server/chunks/routes/api/index.post4.mjs.map +1 -1
  360. package/.output/server/chunks/routes/api/index.post5.mjs +75 -0
  361. package/.output/server/chunks/routes/api/index.post5.mjs.map +1 -0
  362. package/.output/server/chunks/routes/api/index.put.mjs +6 -2
  363. package/.output/server/chunks/routes/api/index.put.mjs.map +1 -1
  364. package/.output/server/chunks/routes/api/memory/_id_.delete.mjs +6 -2
  365. package/.output/server/chunks/routes/api/memory/_id_.delete.mjs.map +1 -1
  366. package/.output/server/chunks/routes/api/memory/context.get.mjs +6 -2
  367. package/.output/server/chunks/routes/api/memory/context.get.mjs.map +1 -1
  368. package/.output/server/chunks/routes/api/memory/extract.post.mjs +6 -2
  369. package/.output/server/chunks/routes/api/memory/extract.post.mjs.map +1 -1
  370. package/.output/server/chunks/routes/api/memory/search.get.mjs +6 -2
  371. package/.output/server/chunks/routes/api/memory/search.get.mjs.map +1 -1
  372. package/.output/server/chunks/routes/api/memory/store.post.mjs +6 -2
  373. package/.output/server/chunks/routes/api/memory/store.post.mjs.map +1 -1
  374. package/.output/server/chunks/routes/api/projects/index.delete.mjs +6 -2
  375. package/.output/server/chunks/routes/api/projects/index.delete.mjs.map +1 -1
  376. package/.output/server/chunks/routes/api/projects/index.get.mjs +6 -2
  377. package/.output/server/chunks/routes/api/projects/index.get.mjs.map +1 -1
  378. package/.output/server/chunks/routes/api/projects/index.put.mjs +6 -2
  379. package/.output/server/chunks/routes/api/projects/index.put.mjs.map +1 -1
  380. package/.output/server/chunks/routes/api/secrets/_key_.delete.mjs +6 -2
  381. package/.output/server/chunks/routes/api/secrets/_key_.delete.mjs.map +1 -1
  382. package/.output/server/chunks/routes/api/secrets/_key_.get.mjs +6 -2
  383. package/.output/server/chunks/routes/api/secrets/_key_.get.mjs.map +1 -1
  384. package/.output/server/chunks/routes/api/secrets/_key_.put.mjs +6 -2
  385. package/.output/server/chunks/routes/api/secrets/_key_.put.mjs.map +1 -1
  386. package/.output/server/chunks/routes/api/skills/_name/delete.post.mjs +69 -0
  387. package/.output/server/chunks/routes/api/skills/_name/delete.post.mjs.map +1 -0
  388. package/.output/server/chunks/routes/api/skills/_name/export.get.mjs +75 -0
  389. package/.output/server/chunks/routes/api/skills/_name/export.get.mjs.map +1 -0
  390. package/.output/server/chunks/routes/api/skills/_name/files/create.post.mjs +76 -0
  391. package/.output/server/chunks/routes/api/skills/_name/files/create.post.mjs.map +1 -0
  392. package/.output/server/chunks/routes/api/skills/_name/files/delete.post.mjs +74 -0
  393. package/.output/server/chunks/routes/api/skills/_name/files/delete.post.mjs.map +1 -0
  394. package/.output/server/chunks/routes/api/skills/_name/files/read.post.mjs +72 -0
  395. package/.output/server/chunks/routes/api/skills/_name/files/read.post.mjs.map +1 -0
  396. package/.output/server/chunks/routes/api/skills/_name/files/write.post.mjs +72 -0
  397. package/.output/server/chunks/routes/api/skills/_name/files/write.post.mjs.map +1 -0
  398. package/.output/server/chunks/routes/api/skills/_name/index.get.mjs +63 -0
  399. package/.output/server/chunks/routes/api/skills/_name/index.get.mjs.map +1 -0
  400. package/.output/server/chunks/routes/api/skills/_name/rename.post.mjs +90 -0
  401. package/.output/server/chunks/routes/api/skills/_name/rename.post.mjs.map +1 -0
  402. package/.output/server/chunks/routes/api/skills/_name/toggle.post.mjs +65 -0
  403. package/.output/server/chunks/routes/api/skills/_name/toggle.post.mjs.map +1 -0
  404. package/.output/server/chunks/routes/api/skills/create.post.mjs +82 -0
  405. package/.output/server/chunks/routes/api/skills/create.post.mjs.map +1 -0
  406. package/.output/server/chunks/routes/api/skills/generate.post.mjs +146 -0
  407. package/.output/server/chunks/routes/api/skills/generate.post.mjs.map +1 -0
  408. package/.output/server/chunks/routes/api/skills/import.post.mjs +99 -0
  409. package/.output/server/chunks/routes/api/skills/import.post.mjs.map +1 -0
  410. package/.output/server/chunks/routes/api/skills/index.get.mjs +85 -0
  411. package/.output/server/chunks/routes/api/skills/index.get.mjs.map +1 -0
  412. package/.output/server/chunks/routes/api/skills/index.get2.mjs +86 -0
  413. package/.output/server/chunks/routes/api/skills/index.get2.mjs.map +1 -0
  414. package/.output/server/chunks/routes/api/skills/library/check-updates.get.mjs +75 -0
  415. package/.output/server/chunks/routes/api/skills/library/check-updates.get.mjs.map +1 -0
  416. package/.output/server/chunks/routes/api/skills/library/install.post.mjs +95 -0
  417. package/.output/server/chunks/routes/api/skills/library/install.post.mjs.map +1 -0
  418. package/.output/server/chunks/routes/api/tasks/_id/restore.post.mjs +6 -2
  419. package/.output/server/chunks/routes/api/tasks/_id/restore.post.mjs.map +1 -1
  420. package/.output/server/chunks/routes/api/tasks/index.delete.mjs +6 -2
  421. package/.output/server/chunks/routes/api/tasks/index.delete.mjs.map +1 -1
  422. package/.output/server/chunks/routes/api/tasks/index.get.mjs +5 -1
  423. package/.output/server/chunks/routes/api/tasks/index.get.mjs.map +1 -1
  424. package/.output/server/chunks/routes/api/tasks/index.put.mjs +6 -2
  425. package/.output/server/chunks/routes/api/tasks/index.put.mjs.map +1 -1
  426. package/.output/server/chunks/routes/api/tasks/tags.get.mjs +6 -2
  427. package/.output/server/chunks/routes/api/tasks/tags.get.mjs.map +1 -1
  428. package/.output/server/chunks/routes/api/usage/stats.get.mjs +9 -3
  429. package/.output/server/chunks/routes/api/usage/stats.get.mjs.map +1 -1
  430. package/.output/server/chunks/routes/api/user/email.patch.mjs +6 -2
  431. package/.output/server/chunks/routes/api/user/email.patch.mjs.map +1 -1
  432. package/.output/server/chunks/routes/api/webhooks/bluebubbles.post.mjs +56 -0
  433. package/.output/server/chunks/routes/api/webhooks/bluebubbles.post.mjs.map +1 -0
  434. package/.output/server/chunks/routes/api/webhooks/telegram.post.mjs +60 -0
  435. package/.output/server/chunks/routes/api/webhooks/telegram.post.mjs.map +1 -0
  436. package/.output/server/chunks/routes/notifications.mjs +6 -2
  437. package/.output/server/chunks/routes/notifications.mjs.map +1 -1
  438. package/.output/server/chunks/routes/renderer.mjs +2 -2
  439. package/.output/server/chunks/routes/terminal.mjs +6 -2
  440. package/.output/server/chunks/routes/terminal.mjs.map +1 -1
  441. package/.output/server/index.mjs +6 -2
  442. package/.output/server/index.mjs.map +1 -1
  443. package/.output/server/node_modules/.nitro/@discordjs/collection@1.5.3/dist/index.js +543 -0
  444. package/.output/server/node_modules/.nitro/@discordjs/collection@1.5.3/package.json +76 -0
  445. package/.output/server/node_modules/.nitro/@discordjs/collection@2.1.1/dist/index.js +567 -0
  446. package/.output/server/node_modules/.nitro/@discordjs/collection@2.1.1/package.json +86 -0
  447. package/.output/server/node_modules/@discordjs/builders/dist/index.js +4229 -0
  448. package/.output/server/node_modules/@discordjs/builders/package.json +99 -0
  449. package/.output/server/node_modules/@discordjs/formatters/dist/index.js +519 -0
  450. package/.output/server/node_modules/@discordjs/formatters/package.json +83 -0
  451. package/.output/server/node_modules/@discordjs/rest/dist/index.js +1515 -0
  452. package/.output/server/node_modules/@discordjs/rest/package.json +119 -0
  453. package/.output/server/node_modules/@discordjs/util/dist/index.js +159 -0
  454. package/.output/server/node_modules/@discordjs/util/package.json +94 -0
  455. package/.output/server/node_modules/@discordjs/ws/dist/defaultWorker.js +1057 -0
  456. package/.output/server/node_modules/@discordjs/ws/dist/index.js +1506 -0
  457. package/.output/server/node_modules/@discordjs/ws/package.json +113 -0
  458. package/.output/server/node_modules/@sapphire/async-queue/dist/cjs/index.cjs +137 -0
  459. package/.output/server/node_modules/@sapphire/async-queue/package.json +74 -0
  460. package/.output/server/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs +3210 -0
  461. package/.output/server/node_modules/@sapphire/shapeshift/package.json +125 -0
  462. package/.output/server/node_modules/@sapphire/snowflake/dist/cjs/index.cjs +194 -0
  463. package/.output/server/node_modules/@sapphire/snowflake/package.json +72 -0
  464. package/.output/server/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs +2825 -0
  465. package/.output/server/node_modules/@vladfrangu/async_event_emitter/package.json +112 -0
  466. package/.output/server/node_modules/adm-zip/adm-zip.js +949 -0
  467. package/.output/server/node_modules/adm-zip/headers/entryHeader.js +374 -0
  468. package/.output/server/node_modules/adm-zip/headers/index.js +2 -0
  469. package/.output/server/node_modules/adm-zip/headers/mainHeader.js +130 -0
  470. package/.output/server/node_modules/adm-zip/methods/deflater.js +33 -0
  471. package/.output/server/node_modules/adm-zip/methods/index.js +3 -0
  472. package/.output/server/node_modules/adm-zip/methods/inflater.js +34 -0
  473. package/.output/server/node_modules/adm-zip/methods/zipcrypto.js +175 -0
  474. package/.output/server/node_modules/adm-zip/package.json +49 -0
  475. package/.output/server/node_modules/adm-zip/util/constants.js +142 -0
  476. package/.output/server/node_modules/adm-zip/util/decoder.js +5 -0
  477. package/.output/server/node_modules/adm-zip/util/errors.js +63 -0
  478. package/.output/server/node_modules/adm-zip/util/fattr.js +76 -0
  479. package/.output/server/node_modules/adm-zip/util/index.js +5 -0
  480. package/.output/server/node_modules/adm-zip/util/utils.js +336 -0
  481. package/.output/server/node_modules/adm-zip/zipEntry.js +405 -0
  482. package/.output/server/node_modules/adm-zip/zipFile.js +446 -0
  483. package/.output/server/node_modules/discord-api-types/gateway/v10.js +277 -0
  484. package/.output/server/node_modules/discord-api-types/globals.js +105 -0
  485. package/.output/server/node_modules/discord-api-types/package.json +215 -0
  486. package/.output/server/node_modules/discord-api-types/payloads/common.js +310 -0
  487. package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/shared.js +21 -0
  488. package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/chatInput.js +18 -0
  489. package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/permissions.js +21 -0
  490. package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/applicationCommands.js +89 -0
  491. package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/responses.js +63 -0
  492. package/.output/server/node_modules/discord-api-types/payloads/v10/application.js +138 -0
  493. package/.output/server/node_modules/discord-api-types/payloads/v10/auditLog.js +85 -0
  494. package/.output/server/node_modules/discord-api-types/payloads/v10/autoModeration.js +88 -0
  495. package/.output/server/node_modules/discord-api-types/payloads/v10/channel.js +219 -0
  496. package/.output/server/node_modules/discord-api-types/payloads/v10/gateway.js +103 -0
  497. package/.output/server/node_modules/discord-api-types/payloads/v10/guild.js +403 -0
  498. package/.output/server/node_modules/discord-api-types/payloads/v10/guildScheduledEvent.js +74 -0
  499. package/.output/server/node_modules/discord-api-types/payloads/v10/index.js +37 -0
  500. package/.output/server/node_modules/discord-api-types/payloads/v10/interactions.js +19 -0
  501. package/.output/server/node_modules/discord-api-types/payloads/v10/invite.js +31 -0
  502. package/.output/server/node_modules/discord-api-types/payloads/v10/message.js +379 -0
  503. package/.output/server/node_modules/discord-api-types/payloads/v10/monetization.js +101 -0
  504. package/.output/server/node_modules/discord-api-types/payloads/v10/oauth2.js +148 -0
  505. package/.output/server/node_modules/discord-api-types/payloads/v10/permissions.js +17 -0
  506. package/.output/server/node_modules/discord-api-types/payloads/v10/poll.js +17 -0
  507. package/.output/server/node_modules/discord-api-types/payloads/v10/stageInstance.js +21 -0
  508. package/.output/server/node_modules/discord-api-types/payloads/v10/sticker.js +31 -0
  509. package/.output/server/node_modules/discord-api-types/payloads/v10/teams.js +24 -0
  510. package/.output/server/node_modules/discord-api-types/payloads/v10/user.js +189 -0
  511. package/.output/server/node_modules/discord-api-types/payloads/v10/webhook.js +73 -0
  512. package/.output/server/node_modules/discord-api-types/rest/common.js +273 -0
  513. package/.output/server/node_modules/discord-api-types/rest/v10/channel.js +12 -0
  514. package/.output/server/node_modules/discord-api-types/rest/v10/index.js +1272 -0
  515. package/.output/server/node_modules/discord-api-types/rest/v10/monetization.js +12 -0
  516. package/.output/server/node_modules/discord-api-types/rpc/common.js +240 -0
  517. package/.output/server/node_modules/discord-api-types/rpc/v10.js +299 -0
  518. package/.output/server/node_modules/discord-api-types/utils/internals.js +13 -0
  519. package/.output/server/node_modules/discord-api-types/utils/v10.js +158 -0
  520. package/.output/server/node_modules/discord-api-types/v10.js +25 -0
  521. package/.output/server/node_modules/discord.js/package.json +107 -0
  522. package/.output/server/node_modules/discord.js/src/client/BaseClient.js +120 -0
  523. package/.output/server/node_modules/discord.js/src/client/Client.js +649 -0
  524. package/.output/server/node_modules/discord.js/src/client/WebhookClient.js +103 -0
  525. package/.output/server/node_modules/discord.js/src/client/actions/Action.js +143 -0
  526. package/.output/server/node_modules/discord.js/src/client/actions/ActionsManager.js +85 -0
  527. package/.output/server/node_modules/discord.js/src/client/actions/ApplicationCommandPermissionsUpdate.js +34 -0
  528. package/.output/server/node_modules/discord.js/src/client/actions/AutoModerationActionExecution.js +26 -0
  529. package/.output/server/node_modules/discord.js/src/client/actions/AutoModerationRuleCreate.js +27 -0
  530. package/.output/server/node_modules/discord.js/src/client/actions/AutoModerationRuleDelete.js +31 -0
  531. package/.output/server/node_modules/discord.js/src/client/actions/AutoModerationRuleUpdate.js +29 -0
  532. package/.output/server/node_modules/discord.js/src/client/actions/ChannelCreate.js +23 -0
  533. package/.output/server/node_modules/discord.js/src/client/actions/ChannelDelete.js +23 -0
  534. package/.output/server/node_modules/discord.js/src/client/actions/ChannelUpdate.js +42 -0
  535. package/.output/server/node_modules/discord.js/src/client/actions/EntitlementCreate.js +23 -0
  536. package/.output/server/node_modules/discord.js/src/client/actions/EntitlementDelete.js +27 -0
  537. package/.output/server/node_modules/discord.js/src/client/actions/EntitlementUpdate.js +25 -0
  538. package/.output/server/node_modules/discord.js/src/client/actions/GuildAuditLogEntryCreate.js +29 -0
  539. package/.output/server/node_modules/discord.js/src/client/actions/GuildBanAdd.js +20 -0
  540. package/.output/server/node_modules/discord.js/src/client/actions/GuildBanRemove.js +25 -0
  541. package/.output/server/node_modules/discord.js/src/client/actions/GuildChannelsPositionUpdate.js +21 -0
  542. package/.output/server/node_modules/discord.js/src/client/actions/GuildDelete.js +44 -0
  543. package/.output/server/node_modules/discord.js/src/client/actions/GuildEmojiCreate.js +20 -0
  544. package/.output/server/node_modules/discord.js/src/client/actions/GuildEmojiDelete.js +19 -0
  545. package/.output/server/node_modules/discord.js/src/client/actions/GuildEmojiUpdate.js +20 -0
  546. package/.output/server/node_modules/discord.js/src/client/actions/GuildEmojisUpdate.js +34 -0
  547. package/.output/server/node_modules/discord.js/src/client/actions/GuildIntegrationsUpdate.js +19 -0
  548. package/.output/server/node_modules/discord.js/src/client/actions/GuildMemberRemove.js +31 -0
  549. package/.output/server/node_modules/discord.js/src/client/actions/GuildMemberUpdate.js +44 -0
  550. package/.output/server/node_modules/discord.js/src/client/actions/GuildRoleCreate.js +25 -0
  551. package/.output/server/node_modules/discord.js/src/client/actions/GuildRoleDelete.js +29 -0
  552. package/.output/server/node_modules/discord.js/src/client/actions/GuildRoleUpdate.js +39 -0
  553. package/.output/server/node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js +21 -0
  554. package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventCreate.js +27 -0
  555. package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventDelete.js +31 -0
  556. package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventUpdate.js +30 -0
  557. package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventUserAdd.js +32 -0
  558. package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventUserRemove.js +32 -0
  559. package/.output/server/node_modules/discord.js/src/client/actions/GuildSoundboardSoundDelete.js +29 -0
  560. package/.output/server/node_modules/discord.js/src/client/actions/GuildStickerCreate.js +20 -0
  561. package/.output/server/node_modules/discord.js/src/client/actions/GuildStickerDelete.js +19 -0
  562. package/.output/server/node_modules/discord.js/src/client/actions/GuildStickerUpdate.js +20 -0
  563. package/.output/server/node_modules/discord.js/src/client/actions/GuildStickersUpdate.js +34 -0
  564. package/.output/server/node_modules/discord.js/src/client/actions/GuildUpdate.js +33 -0
  565. package/.output/server/node_modules/discord.js/src/client/actions/InteractionCreate.js +105 -0
  566. package/.output/server/node_modules/discord.js/src/client/actions/InviteCreate.js +27 -0
  567. package/.output/server/node_modules/discord.js/src/client/actions/InviteDelete.js +29 -0
  568. package/.output/server/node_modules/discord.js/src/client/actions/MessageCreate.js +41 -0
  569. package/.output/server/node_modules/discord.js/src/client/actions/MessageDelete.js +32 -0
  570. package/.output/server/node_modules/discord.js/src/client/actions/MessageDeleteBulk.js +47 -0
  571. package/.output/server/node_modules/discord.js/src/client/actions/MessagePollVoteAdd.js +40 -0
  572. package/.output/server/node_modules/discord.js/src/client/actions/MessagePollVoteRemove.js +38 -0
  573. package/.output/server/node_modules/discord.js/src/client/actions/MessageReactionAdd.js +70 -0
  574. package/.output/server/node_modules/discord.js/src/client/actions/MessageReactionRemove.js +50 -0
  575. package/.output/server/node_modules/discord.js/src/client/actions/MessageReactionRemoveAll.js +33 -0
  576. package/.output/server/node_modules/discord.js/src/client/actions/MessageReactionRemoveEmoji.js +28 -0
  577. package/.output/server/node_modules/discord.js/src/client/actions/MessageUpdate.js +26 -0
  578. package/.output/server/node_modules/discord.js/src/client/actions/PresenceUpdate.js +45 -0
  579. package/.output/server/node_modules/discord.js/src/client/actions/StageInstanceCreate.js +28 -0
  580. package/.output/server/node_modules/discord.js/src/client/actions/StageInstanceDelete.js +31 -0
  581. package/.output/server/node_modules/discord.js/src/client/actions/StageInstanceUpdate.js +30 -0
  582. package/.output/server/node_modules/discord.js/src/client/actions/ThreadCreate.js +24 -0
  583. package/.output/server/node_modules/discord.js/src/client/actions/ThreadDelete.js +26 -0
  584. package/.output/server/node_modules/discord.js/src/client/actions/ThreadListSync.js +60 -0
  585. package/.output/server/node_modules/discord.js/src/client/actions/ThreadMemberUpdate.js +30 -0
  586. package/.output/server/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js +47 -0
  587. package/.output/server/node_modules/discord.js/src/client/actions/TypingStart.js +29 -0
  588. package/.output/server/node_modules/discord.js/src/client/actions/UserUpdate.js +36 -0
  589. package/.output/server/node_modules/discord.js/src/client/actions/VoiceStateUpdate.js +43 -0
  590. package/.output/server/node_modules/discord.js/src/client/actions/WebhooksUpdate.js +37 -0
  591. package/.output/server/node_modules/discord.js/src/client/voice/ClientVoiceManager.js +44 -0
  592. package/.output/server/node_modules/discord.js/src/client/websocket/WebSocketManager.js +407 -0
  593. package/.output/server/node_modules/discord.js/src/client/websocket/WebSocketShard.js +234 -0
  594. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/APPLICATION_COMMAND_PERMISSIONS_UPDATE.js +5 -0
  595. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/AUTO_MODERATION_ACTION_EXECUTION.js +5 -0
  596. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/AUTO_MODERATION_RULE_CREATE.js +5 -0
  597. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/AUTO_MODERATION_RULE_DELETE.js +5 -0
  598. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/AUTO_MODERATION_RULE_UPDATE.js +5 -0
  599. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/CHANNEL_CREATE.js +5 -0
  600. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/CHANNEL_DELETE.js +5 -0
  601. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js +22 -0
  602. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/CHANNEL_UPDATE.js +16 -0
  603. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/ENTITLEMENT_CREATE.js +5 -0
  604. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/ENTITLEMENT_DELETE.js +5 -0
  605. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/ENTITLEMENT_UPDATE.js +5 -0
  606. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_AUDIT_LOG_ENTRY_CREATE.js +5 -0
  607. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_BAN_ADD.js +5 -0
  608. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_BAN_REMOVE.js +5 -0
  609. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_CREATE.js +33 -0
  610. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_DELETE.js +5 -0
  611. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.js +5 -0
  612. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js +5 -0
  613. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js +39 -0
  614. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_ADD.js +20 -0
  615. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js +5 -0
  616. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js +5 -0
  617. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_ROLE_CREATE.js +5 -0
  618. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_ROLE_DELETE.js +5 -0
  619. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_ROLE_UPDATE.js +5 -0
  620. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_CREATE.js +5 -0
  621. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_DELETE.js +5 -0
  622. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_UPDATE.js +5 -0
  623. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_ADD.js +5 -0
  624. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_REMOVE.js +5 -0
  625. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUNDS_UPDATE.js +24 -0
  626. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_CREATE.js +18 -0
  627. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_DELETE.js +5 -0
  628. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_UPDATE.js +20 -0
  629. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_STICKERS_UPDATE.js +5 -0
  630. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_UPDATE.js +5 -0
  631. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js +5 -0
  632. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/INVITE_CREATE.js +5 -0
  633. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/INVITE_DELETE.js +5 -0
  634. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js +5 -0
  635. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_DELETE.js +5 -0
  636. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_DELETE_BULK.js +5 -0
  637. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_POLL_VOTE_ADD.js +5 -0
  638. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_POLL_VOTE_REMOVE.js +5 -0
  639. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_ADD.js +5 -0
  640. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.js +5 -0
  641. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.js +5 -0
  642. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.js +5 -0
  643. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_UPDATE.js +16 -0
  644. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/PRESENCE_UPDATE.js +5 -0
  645. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/RATE_LIMITED.js +25 -0
  646. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/READY.js +27 -0
  647. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/RESUMED.js +14 -0
  648. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/SOUNDBOARD_SOUNDS.js +24 -0
  649. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/STAGE_INSTANCE_CREATE.js +5 -0
  650. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/STAGE_INSTANCE_DELETE.js +5 -0
  651. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/STAGE_INSTANCE_UPDATE.js +5 -0
  652. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/SUBSCRIPTION_CREATE.js +14 -0
  653. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/SUBSCRIPTION_DELETE.js +16 -0
  654. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/SUBSCRIPTION_UPDATE.js +16 -0
  655. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_CREATE.js +5 -0
  656. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_DELETE.js +5 -0
  657. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_LIST_SYNC.js +5 -0
  658. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js +5 -0
  659. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBER_UPDATE.js +5 -0
  660. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_UPDATE.js +16 -0
  661. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/TYPING_START.js +5 -0
  662. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/USER_UPDATE.js +5 -0
  663. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.js +16 -0
  664. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/VOICE_SERVER_UPDATE.js +6 -0
  665. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/VOICE_STATE_UPDATE.js +5 -0
  666. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/WEBHOOKS_UPDATE.js +5 -0
  667. package/.output/server/node_modules/discord.js/src/client/websocket/handlers/index.js +79 -0
  668. package/.output/server/node_modules/discord.js/src/errors/DJSError.js +48 -0
  669. package/.output/server/node_modules/discord.js/src/errors/ErrorCodes.js +356 -0
  670. package/.output/server/node_modules/discord.js/src/errors/Messages.js +187 -0
  671. package/.output/server/node_modules/discord.js/src/errors/index.js +5 -0
  672. package/.output/server/node_modules/discord.js/src/index.js +254 -0
  673. package/.output/server/node_modules/discord.js/src/managers/ApplicationCommandManager.js +269 -0
  674. package/.output/server/node_modules/discord.js/src/managers/ApplicationCommandPermissionsManager.js +428 -0
  675. package/.output/server/node_modules/discord.js/src/managers/ApplicationEmojiManager.js +142 -0
  676. package/.output/server/node_modules/discord.js/src/managers/AutoModerationRuleManager.js +292 -0
  677. package/.output/server/node_modules/discord.js/src/managers/BaseGuildEmojiManager.js +85 -0
  678. package/.output/server/node_modules/discord.js/src/managers/BaseManager.js +19 -0
  679. package/.output/server/node_modules/discord.js/src/managers/CachedManager.js +64 -0
  680. package/.output/server/node_modules/discord.js/src/managers/CategoryChannelChildManager.js +79 -0
  681. package/.output/server/node_modules/discord.js/src/managers/ChannelManager.js +135 -0
  682. package/.output/server/node_modules/discord.js/src/managers/DMMessageManager.js +17 -0
  683. package/.output/server/node_modules/discord.js/src/managers/DataManager.js +61 -0
  684. package/.output/server/node_modules/discord.js/src/managers/EntitlementManager.js +174 -0
  685. package/.output/server/node_modules/discord.js/src/managers/GuildApplicationCommandManager.js +28 -0
  686. package/.output/server/node_modules/discord.js/src/managers/GuildBanManager.js +249 -0
  687. package/.output/server/node_modules/discord.js/src/managers/GuildChannelManager.js +519 -0
  688. package/.output/server/node_modules/discord.js/src/managers/GuildEmojiManager.js +174 -0
  689. package/.output/server/node_modules/discord.js/src/managers/GuildEmojiRoleManager.js +126 -0
  690. package/.output/server/node_modules/discord.js/src/managers/GuildForumThreadManager.js +83 -0
  691. package/.output/server/node_modules/discord.js/src/managers/GuildInviteManager.js +215 -0
  692. package/.output/server/node_modules/discord.js/src/managers/GuildManager.js +408 -0
  693. package/.output/server/node_modules/discord.js/src/managers/GuildMemberManager.js +638 -0
  694. package/.output/server/node_modules/discord.js/src/managers/GuildMemberRoleManager.js +217 -0
  695. package/.output/server/node_modules/discord.js/src/managers/GuildMessageManager.js +17 -0
  696. package/.output/server/node_modules/discord.js/src/managers/GuildScheduledEventManager.js +315 -0
  697. package/.output/server/node_modules/discord.js/src/managers/GuildSoundboardSoundManager.js +214 -0
  698. package/.output/server/node_modules/discord.js/src/managers/GuildStickerManager.js +182 -0
  699. package/.output/server/node_modules/discord.js/src/managers/GuildTextThreadManager.js +91 -0
  700. package/.output/server/node_modules/discord.js/src/managers/MessageManager.js +368 -0
  701. package/.output/server/node_modules/discord.js/src/managers/PartialGroupDMMessageManager.js +17 -0
  702. package/.output/server/node_modules/discord.js/src/managers/PermissionOverwriteManager.js +166 -0
  703. package/.output/server/node_modules/discord.js/src/managers/PollAnswerVoterManager.js +50 -0
  704. package/.output/server/node_modules/discord.js/src/managers/PresenceManager.js +58 -0
  705. package/.output/server/node_modules/discord.js/src/managers/ReactionManager.js +68 -0
  706. package/.output/server/node_modules/discord.js/src/managers/ReactionUserManager.js +78 -0
  707. package/.output/server/node_modules/discord.js/src/managers/RoleManager.js +444 -0
  708. package/.output/server/node_modules/discord.js/src/managers/StageInstanceManager.js +159 -0
  709. package/.output/server/node_modules/discord.js/src/managers/SubscriptionManager.js +81 -0
  710. package/.output/server/node_modules/discord.js/src/managers/ThreadManager.js +193 -0
  711. package/.output/server/node_modules/discord.js/src/managers/ThreadMemberManager.js +204 -0
  712. package/.output/server/node_modules/discord.js/src/managers/UserManager.js +146 -0
  713. package/.output/server/node_modules/discord.js/src/managers/VoiceStateManager.js +59 -0
  714. package/.output/server/node_modules/discord.js/src/sharding/Shard.js +482 -0
  715. package/.output/server/node_modules/discord.js/src/sharding/ShardClientUtil.js +292 -0
  716. package/.output/server/node_modules/discord.js/src/sharding/ShardingManager.js +331 -0
  717. package/.output/server/node_modules/discord.js/src/structures/ActionRow.js +46 -0
  718. package/.output/server/node_modules/discord.js/src/structures/ActionRowBuilder.js +35 -0
  719. package/.output/server/node_modules/discord.js/src/structures/AnonymousGuild.js +97 -0
  720. package/.output/server/node_modules/discord.js/src/structures/ApplicationCommand.js +639 -0
  721. package/.output/server/node_modules/discord.js/src/structures/ApplicationEmoji.js +169 -0
  722. package/.output/server/node_modules/discord.js/src/structures/ApplicationRoleConnectionMetadata.js +46 -0
  723. package/.output/server/node_modules/discord.js/src/structures/Attachment.js +163 -0
  724. package/.output/server/node_modules/discord.js/src/structures/AttachmentBuilder.js +111 -0
  725. package/.output/server/node_modules/discord.js/src/structures/AutoModerationActionExecution.js +116 -0
  726. package/.output/server/node_modules/discord.js/src/structures/AutoModerationRule.js +288 -0
  727. package/.output/server/node_modules/discord.js/src/structures/AutocompleteInteraction.js +102 -0
  728. package/.output/server/node_modules/discord.js/src/structures/Base.js +43 -0
  729. package/.output/server/node_modules/discord.js/src/structures/BaseChannel.js +171 -0
  730. package/.output/server/node_modules/discord.js/src/structures/BaseGuild.js +119 -0
  731. package/.output/server/node_modules/discord.js/src/structures/BaseGuildEmoji.js +111 -0
  732. package/.output/server/node_modules/discord.js/src/structures/BaseGuildTextChannel.js +196 -0
  733. package/.output/server/node_modules/discord.js/src/structures/BaseGuildVoiceChannel.js +234 -0
  734. package/.output/server/node_modules/discord.js/src/structures/BaseInteraction.js +349 -0
  735. package/.output/server/node_modules/discord.js/src/structures/BaseSelectMenuComponent.js +56 -0
  736. package/.output/server/node_modules/discord.js/src/structures/ButtonBuilder.js +44 -0
  737. package/.output/server/node_modules/discord.js/src/structures/ButtonComponent.js +65 -0
  738. package/.output/server/node_modules/discord.js/src/structures/ButtonInteraction.js +11 -0
  739. package/.output/server/node_modules/discord.js/src/structures/CategoryChannel.js +45 -0
  740. package/.output/server/node_modules/discord.js/src/structures/ChannelSelectMenuBuilder.js +31 -0
  741. package/.output/server/node_modules/discord.js/src/structures/ChannelSelectMenuComponent.js +20 -0
  742. package/.output/server/node_modules/discord.js/src/structures/ChannelSelectMenuInteraction.js +33 -0
  743. package/.output/server/node_modules/discord.js/src/structures/ChatInputCommandInteraction.js +42 -0
  744. package/.output/server/node_modules/discord.js/src/structures/ClientApplication.js +415 -0
  745. package/.output/server/node_modules/discord.js/src/structures/ClientPresence.js +84 -0
  746. package/.output/server/node_modules/discord.js/src/structures/ClientUser.js +204 -0
  747. package/.output/server/node_modules/discord.js/src/structures/CommandInteraction.js +168 -0
  748. package/.output/server/node_modules/discord.js/src/structures/CommandInteractionOptionResolver.js +308 -0
  749. package/.output/server/node_modules/discord.js/src/structures/Component.js +56 -0
  750. package/.output/server/node_modules/discord.js/src/structures/ContainerComponent.js +60 -0
  751. package/.output/server/node_modules/discord.js/src/structures/ContextMenuCommandInteraction.js +65 -0
  752. package/.output/server/node_modules/discord.js/src/structures/DMChannel.js +129 -0
  753. package/.output/server/node_modules/discord.js/src/structures/DirectoryChannel.js +36 -0
  754. package/.output/server/node_modules/discord.js/src/structures/Embed.js +237 -0
  755. package/.output/server/node_modules/discord.js/src/structures/EmbedBuilder.js +50 -0
  756. package/.output/server/node_modules/discord.js/src/structures/Emoji.js +115 -0
  757. package/.output/server/node_modules/discord.js/src/structures/Entitlement.js +179 -0
  758. package/.output/server/node_modules/discord.js/src/structures/FileComponent.js +40 -0
  759. package/.output/server/node_modules/discord.js/src/structures/ForumChannel.js +31 -0
  760. package/.output/server/node_modules/discord.js/src/structures/Guild.js +1496 -0
  761. package/.output/server/node_modules/discord.js/src/structures/GuildAuditLogs.js +91 -0
  762. package/.output/server/node_modules/discord.js/src/structures/GuildAuditLogsEntry.js +527 -0
  763. package/.output/server/node_modules/discord.js/src/structures/GuildBan.js +59 -0
  764. package/.output/server/node_modules/discord.js/src/structures/GuildChannel.js +476 -0
  765. package/.output/server/node_modules/discord.js/src/structures/GuildEmoji.js +148 -0
  766. package/.output/server/node_modules/discord.js/src/structures/GuildMember.js +591 -0
  767. package/.output/server/node_modules/discord.js/src/structures/GuildOnboarding.js +64 -0
  768. package/.output/server/node_modules/discord.js/src/structures/GuildOnboardingPrompt.js +78 -0
  769. package/.output/server/node_modules/discord.js/src/structures/GuildOnboardingPromptOption.js +86 -0
  770. package/.output/server/node_modules/discord.js/src/structures/GuildPreview.js +193 -0
  771. package/.output/server/node_modules/discord.js/src/structures/GuildPreviewEmoji.js +27 -0
  772. package/.output/server/node_modules/discord.js/src/structures/GuildScheduledEvent.js +534 -0
  773. package/.output/server/node_modules/discord.js/src/structures/GuildTemplate.js +242 -0
  774. package/.output/server/node_modules/discord.js/src/structures/Integration.js +220 -0
  775. package/.output/server/node_modules/discord.js/src/structures/IntegrationApplication.js +85 -0
  776. package/.output/server/node_modules/discord.js/src/structures/InteractionCallback.js +74 -0
  777. package/.output/server/node_modules/discord.js/src/structures/InteractionCallbackResource.js +52 -0
  778. package/.output/server/node_modules/discord.js/src/structures/InteractionCallbackResponse.js +33 -0
  779. package/.output/server/node_modules/discord.js/src/structures/InteractionCollector.js +269 -0
  780. package/.output/server/node_modules/discord.js/src/structures/InteractionResponse.js +102 -0
  781. package/.output/server/node_modules/discord.js/src/structures/InteractionWebhook.js +59 -0
  782. package/.output/server/node_modules/discord.js/src/structures/Invite.js +341 -0
  783. package/.output/server/node_modules/discord.js/src/structures/InviteGuild.js +22 -0
  784. package/.output/server/node_modules/discord.js/src/structures/InviteStageInstance.js +87 -0
  785. package/.output/server/node_modules/discord.js/src/structures/LabelComponent.js +54 -0
  786. package/.output/server/node_modules/discord.js/src/structures/MediaChannel.js +11 -0
  787. package/.output/server/node_modules/discord.js/src/structures/MediaGalleryComponent.js +31 -0
  788. package/.output/server/node_modules/discord.js/src/structures/MediaGalleryItem.js +51 -0
  789. package/.output/server/node_modules/discord.js/src/structures/MentionableSelectMenuBuilder.js +32 -0
  790. package/.output/server/node_modules/discord.js/src/structures/MentionableSelectMenuComponent.js +11 -0
  791. package/.output/server/node_modules/discord.js/src/structures/MentionableSelectMenuInteraction.js +71 -0
  792. package/.output/server/node_modules/discord.js/src/structures/Message.js +1137 -0
  793. package/.output/server/node_modules/discord.js/src/structures/MessageCollector.js +146 -0
  794. package/.output/server/node_modules/discord.js/src/structures/MessageComponentInteraction.js +108 -0
  795. package/.output/server/node_modules/discord.js/src/structures/MessageContextMenuCommandInteraction.js +20 -0
  796. package/.output/server/node_modules/discord.js/src/structures/MessageMentions.js +297 -0
  797. package/.output/server/node_modules/discord.js/src/structures/MessagePayload.js +344 -0
  798. package/.output/server/node_modules/discord.js/src/structures/MessageReaction.js +200 -0
  799. package/.output/server/node_modules/discord.js/src/structures/ModalBuilder.js +36 -0
  800. package/.output/server/node_modules/discord.js/src/structures/ModalSubmitFields.js +232 -0
  801. package/.output/server/node_modules/discord.js/src/structures/ModalSubmitInteraction.js +256 -0
  802. package/.output/server/node_modules/discord.js/src/structures/NewsChannel.js +32 -0
  803. package/.output/server/node_modules/discord.js/src/structures/OAuth2Guild.js +28 -0
  804. package/.output/server/node_modules/discord.js/src/structures/PartialGroupDMChannel.js +131 -0
  805. package/.output/server/node_modules/discord.js/src/structures/PermissionOverwrites.js +199 -0
  806. package/.output/server/node_modules/discord.js/src/structures/Poll.js +175 -0
  807. package/.output/server/node_modules/discord.js/src/structures/PollAnswer.js +114 -0
  808. package/.output/server/node_modules/discord.js/src/structures/Presence.js +385 -0
  809. package/.output/server/node_modules/discord.js/src/structures/PrimaryEntryPointCommandInteraction.js +11 -0
  810. package/.output/server/node_modules/discord.js/src/structures/ReactionCollector.js +229 -0
  811. package/.output/server/node_modules/discord.js/src/structures/ReactionEmoji.js +31 -0
  812. package/.output/server/node_modules/discord.js/src/structures/Role.js +519 -0
  813. package/.output/server/node_modules/discord.js/src/structures/RoleSelectMenuBuilder.js +31 -0
  814. package/.output/server/node_modules/discord.js/src/structures/RoleSelectMenuComponent.js +11 -0
  815. package/.output/server/node_modules/discord.js/src/structures/RoleSelectMenuInteraction.js +33 -0
  816. package/.output/server/node_modules/discord.js/src/structures/SKU.js +52 -0
  817. package/.output/server/node_modules/discord.js/src/structures/SectionComponent.js +42 -0
  818. package/.output/server/node_modules/discord.js/src/structures/SelectMenuBuilder.js +26 -0
  819. package/.output/server/node_modules/discord.js/src/structures/SelectMenuComponent.js +26 -0
  820. package/.output/server/node_modules/discord.js/src/structures/SelectMenuInteraction.js +26 -0
  821. package/.output/server/node_modules/discord.js/src/structures/SelectMenuOptionBuilder.js +26 -0
  822. package/.output/server/node_modules/discord.js/src/structures/SeparatorComponent.js +30 -0
  823. package/.output/server/node_modules/discord.js/src/structures/SoundboardSound.js +204 -0
  824. package/.output/server/node_modules/discord.js/src/structures/StageChannel.js +112 -0
  825. package/.output/server/node_modules/discord.js/src/structures/StageInstance.js +167 -0
  826. package/.output/server/node_modules/discord.js/src/structures/Sticker.js +268 -0
  827. package/.output/server/node_modules/discord.js/src/structures/StickerPack.js +95 -0
  828. package/.output/server/node_modules/discord.js/src/structures/StringSelectMenuBuilder.js +79 -0
  829. package/.output/server/node_modules/discord.js/src/structures/StringSelectMenuComponent.js +20 -0
  830. package/.output/server/node_modules/discord.js/src/structures/StringSelectMenuInteraction.js +21 -0
  831. package/.output/server/node_modules/discord.js/src/structures/StringSelectMenuOptionBuilder.js +49 -0
  832. package/.output/server/node_modules/discord.js/src/structures/Subscription.js +117 -0
  833. package/.output/server/node_modules/discord.js/src/structures/Team.js +117 -0
  834. package/.output/server/node_modules/discord.js/src/structures/TeamMember.js +79 -0
  835. package/.output/server/node_modules/discord.js/src/structures/TextChannel.js +33 -0
  836. package/.output/server/node_modules/discord.js/src/structures/TextDisplayComponent.js +20 -0
  837. package/.output/server/node_modules/discord.js/src/structures/TextInputBuilder.js +31 -0
  838. package/.output/server/node_modules/discord.js/src/structures/TextInputComponent.js +29 -0
  839. package/.output/server/node_modules/discord.js/src/structures/ThreadChannel.js +612 -0
  840. package/.output/server/node_modules/discord.js/src/structures/ThreadMember.js +119 -0
  841. package/.output/server/node_modules/discord.js/src/structures/ThreadOnlyChannel.js +249 -0
  842. package/.output/server/node_modules/discord.js/src/structures/ThumbnailComponent.js +49 -0
  843. package/.output/server/node_modules/discord.js/src/structures/Typing.js +74 -0
  844. package/.output/server/node_modules/discord.js/src/structures/UnfurledMediaItem.js +33 -0
  845. package/.output/server/node_modules/discord.js/src/structures/User.js +505 -0
  846. package/.output/server/node_modules/discord.js/src/structures/UserContextMenuCommandInteraction.js +29 -0
  847. package/.output/server/node_modules/discord.js/src/structures/UserSelectMenuBuilder.js +31 -0
  848. package/.output/server/node_modules/discord.js/src/structures/UserSelectMenuComponent.js +11 -0
  849. package/.output/server/node_modules/discord.js/src/structures/UserSelectMenuInteraction.js +51 -0
  850. package/.output/server/node_modules/discord.js/src/structures/VoiceChannel.js +116 -0
  851. package/.output/server/node_modules/discord.js/src/structures/VoiceChannelEffect.js +78 -0
  852. package/.output/server/node_modules/discord.js/src/structures/VoiceRegion.js +46 -0
  853. package/.output/server/node_modules/discord.js/src/structures/VoiceState.js +312 -0
  854. package/.output/server/node_modules/discord.js/src/structures/Webhook.js +489 -0
  855. package/.output/server/node_modules/discord.js/src/structures/WelcomeChannel.js +60 -0
  856. package/.output/server/node_modules/discord.js/src/structures/WelcomeScreen.js +49 -0
  857. package/.output/server/node_modules/discord.js/src/structures/Widget.js +97 -0
  858. package/.output/server/node_modules/discord.js/src/structures/WidgetMember.js +99 -0
  859. package/.output/server/node_modules/discord.js/src/structures/interfaces/Application.js +158 -0
  860. package/.output/server/node_modules/discord.js/src/structures/interfaces/Collector.js +335 -0
  861. package/.output/server/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js +494 -0
  862. package/.output/server/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js +447 -0
  863. package/.output/server/node_modules/discord.js/src/util/ActivityFlagsBitField.js +26 -0
  864. package/.output/server/node_modules/discord.js/src/util/ApplicationFlagsBitField.js +41 -0
  865. package/.output/server/node_modules/discord.js/src/util/AttachmentFlagsBitField.js +26 -0
  866. package/.output/server/node_modules/discord.js/src/util/BitField.js +178 -0
  867. package/.output/server/node_modules/discord.js/src/util/ChannelFlagsBitField.js +41 -0
  868. package/.output/server/node_modules/discord.js/src/util/Channels.js +161 -0
  869. package/.output/server/node_modules/discord.js/src/util/Colors.js +73 -0
  870. package/.output/server/node_modules/discord.js/src/util/Components.js +311 -0
  871. package/.output/server/node_modules/discord.js/src/util/Constants.js +283 -0
  872. package/.output/server/node_modules/discord.js/src/util/DataResolver.js +142 -0
  873. package/.output/server/node_modules/discord.js/src/util/Enums.js +13 -0
  874. package/.output/server/node_modules/discord.js/src/util/Events.js +190 -0
  875. package/.output/server/node_modules/discord.js/src/util/Formatters.js +413 -0
  876. package/.output/server/node_modules/discord.js/src/util/GuildMemberFlagsBitField.js +42 -0
  877. package/.output/server/node_modules/discord.js/src/util/IntentsBitField.js +34 -0
  878. package/.output/server/node_modules/discord.js/src/util/InviteFlagsBitField.js +28 -0
  879. package/.output/server/node_modules/discord.js/src/util/LimitedCollection.js +68 -0
  880. package/.output/server/node_modules/discord.js/src/util/MessageFlagsBitField.js +41 -0
  881. package/.output/server/node_modules/discord.js/src/util/Options.js +239 -0
  882. package/.output/server/node_modules/discord.js/src/util/Partials.js +50 -0
  883. package/.output/server/node_modules/discord.js/src/util/PermissionsBitField.js +104 -0
  884. package/.output/server/node_modules/discord.js/src/util/RoleFlagsBitField.js +26 -0
  885. package/.output/server/node_modules/discord.js/src/util/SKUFlagsBitField.js +26 -0
  886. package/.output/server/node_modules/discord.js/src/util/ShardEvents.js +29 -0
  887. package/.output/server/node_modules/discord.js/src/util/Status.js +33 -0
  888. package/.output/server/node_modules/discord.js/src/util/Sweepers.js +487 -0
  889. package/.output/server/node_modules/discord.js/src/util/Symbols.js +3 -0
  890. package/.output/server/node_modules/discord.js/src/util/SystemChannelFlagsBitField.js +43 -0
  891. package/.output/server/node_modules/discord.js/src/util/ThreadMemberFlagsBitField.js +32 -0
  892. package/.output/server/node_modules/discord.js/src/util/Transformers.js +125 -0
  893. package/.output/server/node_modules/discord.js/src/util/UserFlagsBitField.js +32 -0
  894. package/.output/server/node_modules/discord.js/src/util/Util.js +558 -0
  895. package/.output/server/node_modules/discord.js/src/util/WebSocketShardEvents.js +25 -0
  896. package/.output/server/node_modules/fast-deep-equal/es6/index.js +72 -0
  897. package/.output/server/node_modules/fast-deep-equal/index.js +46 -0
  898. package/.output/server/node_modules/fast-deep-equal/package.json +61 -0
  899. package/.output/server/node_modules/lodash/_Hash.js +32 -0
  900. package/.output/server/node_modules/lodash/_ListCache.js +32 -0
  901. package/.output/server/node_modules/lodash/_Map.js +7 -0
  902. package/.output/server/node_modules/lodash/_MapCache.js +32 -0
  903. package/.output/server/node_modules/lodash/_Set.js +7 -0
  904. package/.output/server/node_modules/lodash/_SetCache.js +27 -0
  905. package/.output/server/node_modules/lodash/_Symbol.js +6 -0
  906. package/.output/server/node_modules/lodash/_arrayIncludes.js +17 -0
  907. package/.output/server/node_modules/lodash/_arrayIncludesWith.js +22 -0
  908. package/.output/server/node_modules/lodash/_arrayMap.js +21 -0
  909. package/.output/server/node_modules/lodash/_assocIndexOf.js +21 -0
  910. package/.output/server/node_modules/lodash/_baseFindIndex.js +24 -0
  911. package/.output/server/node_modules/lodash/_baseGet.js +24 -0
  912. package/.output/server/node_modules/lodash/_baseGetTag.js +28 -0
  913. package/.output/server/node_modules/lodash/_baseIndexOf.js +20 -0
  914. package/.output/server/node_modules/lodash/_baseIsNaN.js +12 -0
  915. package/.output/server/node_modules/lodash/_baseIsNative.js +47 -0
  916. package/.output/server/node_modules/lodash/_baseToString.js +37 -0
  917. package/.output/server/node_modules/lodash/_baseUniq.js +72 -0
  918. package/.output/server/node_modules/lodash/_cacheHas.js +13 -0
  919. package/.output/server/node_modules/lodash/_castPath.js +21 -0
  920. package/.output/server/node_modules/lodash/_coreJsData.js +6 -0
  921. package/.output/server/node_modules/lodash/_createSet.js +19 -0
  922. package/.output/server/node_modules/lodash/_freeGlobal.js +4 -0
  923. package/.output/server/node_modules/lodash/_getMapData.js +18 -0
  924. package/.output/server/node_modules/lodash/_getNative.js +17 -0
  925. package/.output/server/node_modules/lodash/_getRawTag.js +46 -0
  926. package/.output/server/node_modules/lodash/_getValue.js +13 -0
  927. package/.output/server/node_modules/lodash/_hashClear.js +15 -0
  928. package/.output/server/node_modules/lodash/_hashDelete.js +17 -0
  929. package/.output/server/node_modules/lodash/_hashGet.js +30 -0
  930. package/.output/server/node_modules/lodash/_hashHas.js +23 -0
  931. package/.output/server/node_modules/lodash/_hashSet.js +23 -0
  932. package/.output/server/node_modules/lodash/_isKey.js +29 -0
  933. package/.output/server/node_modules/lodash/_isKeyable.js +15 -0
  934. package/.output/server/node_modules/lodash/_isMasked.js +20 -0
  935. package/.output/server/node_modules/lodash/_listCacheClear.js +13 -0
  936. package/.output/server/node_modules/lodash/_listCacheDelete.js +35 -0
  937. package/.output/server/node_modules/lodash/_listCacheGet.js +19 -0
  938. package/.output/server/node_modules/lodash/_listCacheHas.js +16 -0
  939. package/.output/server/node_modules/lodash/_listCacheSet.js +26 -0
  940. package/.output/server/node_modules/lodash/_mapCacheClear.js +21 -0
  941. package/.output/server/node_modules/lodash/_mapCacheDelete.js +18 -0
  942. package/.output/server/node_modules/lodash/_mapCacheGet.js +16 -0
  943. package/.output/server/node_modules/lodash/_mapCacheHas.js +16 -0
  944. package/.output/server/node_modules/lodash/_mapCacheSet.js +22 -0
  945. package/.output/server/node_modules/lodash/_memoizeCapped.js +26 -0
  946. package/.output/server/node_modules/lodash/_nativeCreate.js +6 -0
  947. package/.output/server/node_modules/lodash/_objectToString.js +22 -0
  948. package/.output/server/node_modules/lodash/_root.js +9 -0
  949. package/.output/server/node_modules/lodash/_setCacheAdd.js +19 -0
  950. package/.output/server/node_modules/lodash/_setCacheHas.js +14 -0
  951. package/.output/server/node_modules/lodash/_setToArray.js +18 -0
  952. package/.output/server/node_modules/lodash/_strictIndexOf.js +23 -0
  953. package/.output/server/node_modules/lodash/_stringToPath.js +27 -0
  954. package/.output/server/node_modules/lodash/_toKey.js +21 -0
  955. package/.output/server/node_modules/lodash/_toSource.js +26 -0
  956. package/.output/server/node_modules/lodash/eq.js +37 -0
  957. package/.output/server/node_modules/lodash/get.js +33 -0
  958. package/.output/server/node_modules/lodash/isArray.js +26 -0
  959. package/.output/server/node_modules/lodash/isFunction.js +37 -0
  960. package/.output/server/node_modules/lodash/isObject.js +31 -0
  961. package/.output/server/node_modules/lodash/isObjectLike.js +29 -0
  962. package/.output/server/node_modules/lodash/isSymbol.js +29 -0
  963. package/.output/server/node_modules/lodash/memoize.js +73 -0
  964. package/.output/server/node_modules/lodash/noop.js +17 -0
  965. package/.output/server/node_modules/lodash/package.json +19 -0
  966. package/.output/server/node_modules/lodash/toString.js +28 -0
  967. package/.output/server/node_modules/lodash/uniqWith.js +28 -0
  968. package/.output/server/node_modules/lodash.snakecase/index.js +435 -0
  969. package/.output/server/node_modules/lodash.snakecase/package.json +19 -0
  970. package/.output/server/node_modules/magic-bytes.js/dist/index.js +61 -0
  971. package/.output/server/node_modules/magic-bytes.js/dist/model/pattern-tree.js +1176 -0
  972. package/.output/server/node_modules/magic-bytes.js/dist/model/toHex.js +8 -0
  973. package/.output/server/node_modules/magic-bytes.js/dist/model/tree.js +61 -0
  974. package/.output/server/node_modules/magic-bytes.js/package.json +77 -0
  975. package/.output/server/node_modules/ts-mixer/dist/cjs/decorator.js +109 -0
  976. package/.output/server/node_modules/ts-mixer/dist/cjs/index.js +12 -0
  977. package/.output/server/node_modules/ts-mixer/dist/cjs/mixin-tracking.js +42 -0
  978. package/.output/server/node_modules/ts-mixer/dist/cjs/mixins.js +82 -0
  979. package/.output/server/node_modules/ts-mixer/dist/cjs/proxy.js +82 -0
  980. package/.output/server/node_modules/ts-mixer/dist/cjs/settings.js +9 -0
  981. package/.output/server/node_modules/ts-mixer/dist/cjs/util.js +85 -0
  982. package/.output/server/node_modules/ts-mixer/package.json +63 -0
  983. package/.output/server/node_modules/tslib/package.json +47 -0
  984. package/.output/server/node_modules/tslib/tslib.js +484 -0
  985. package/.output/server/node_modules/undici/index.js +169 -0
  986. package/.output/server/node_modules/undici/lib/api/abort-signal.js +57 -0
  987. package/.output/server/node_modules/undici/lib/api/api-connect.js +108 -0
  988. package/.output/server/node_modules/undici/lib/api/api-pipeline.js +251 -0
  989. package/.output/server/node_modules/undici/lib/api/api-request.js +214 -0
  990. package/.output/server/node_modules/undici/lib/api/api-stream.js +220 -0
  991. package/.output/server/node_modules/undici/lib/api/api-upgrade.js +108 -0
  992. package/.output/server/node_modules/undici/lib/api/index.js +7 -0
  993. package/.output/server/node_modules/undici/lib/api/readable.js +385 -0
  994. package/.output/server/node_modules/undici/lib/api/util.js +93 -0
  995. package/.output/server/node_modules/undici/lib/core/connect.js +240 -0
  996. package/.output/server/node_modules/undici/lib/core/constants.js +118 -0
  997. package/.output/server/node_modules/undici/lib/core/diagnostics.js +202 -0
  998. package/.output/server/node_modules/undici/lib/core/errors.js +244 -0
  999. package/.output/server/node_modules/undici/lib/core/request.js +395 -0
  1000. package/.output/server/node_modules/undici/lib/core/symbols.js +67 -0
  1001. package/.output/server/node_modules/undici/lib/core/tree.js +152 -0
  1002. package/.output/server/node_modules/undici/lib/core/util.js +719 -0
  1003. package/.output/server/node_modules/undici/lib/dispatcher/agent.js +129 -0
  1004. package/.output/server/node_modules/undici/lib/dispatcher/balanced-pool.js +209 -0
  1005. package/.output/server/node_modules/undici/lib/dispatcher/client-h1.js +1370 -0
  1006. package/.output/server/node_modules/undici/lib/dispatcher/client-h2.js +744 -0
  1007. package/.output/server/node_modules/undici/lib/dispatcher/client.js +622 -0
  1008. package/.output/server/node_modules/undici/lib/dispatcher/dispatcher-base.js +190 -0
  1009. package/.output/server/node_modules/undici/lib/dispatcher/dispatcher.js +65 -0
  1010. package/.output/server/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +160 -0
  1011. package/.output/server/node_modules/undici/lib/dispatcher/fixed-queue.js +117 -0
  1012. package/.output/server/node_modules/undici/lib/dispatcher/pool-base.js +194 -0
  1013. package/.output/server/node_modules/undici/lib/dispatcher/pool-stats.js +34 -0
  1014. package/.output/server/node_modules/undici/lib/dispatcher/pool.js +107 -0
  1015. package/.output/server/node_modules/undici/lib/dispatcher/proxy-agent.js +192 -0
  1016. package/.output/server/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
  1017. package/.output/server/node_modules/undici/lib/global.js +32 -0
  1018. package/.output/server/node_modules/undici/lib/handler/decorator-handler.js +44 -0
  1019. package/.output/server/node_modules/undici/lib/handler/redirect-handler.js +232 -0
  1020. package/.output/server/node_modules/undici/lib/handler/retry-handler.js +374 -0
  1021. package/.output/server/node_modules/undici/lib/interceptor/dns.js +375 -0
  1022. package/.output/server/node_modules/undici/lib/interceptor/dump.js +123 -0
  1023. package/.output/server/node_modules/undici/lib/interceptor/redirect-interceptor.js +21 -0
  1024. package/.output/server/node_modules/undici/lib/interceptor/redirect.js +24 -0
  1025. package/.output/server/node_modules/undici/lib/interceptor/retry.js +19 -0
  1026. package/.output/server/node_modules/undici/lib/llhttp/constants.js +278 -0
  1027. package/.output/server/node_modules/undici/lib/llhttp/llhttp-wasm.js +5 -0
  1028. package/.output/server/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +5 -0
  1029. package/.output/server/node_modules/undici/lib/llhttp/utils.js +15 -0
  1030. package/.output/server/node_modules/undici/lib/mock/mock-agent.js +160 -0
  1031. package/.output/server/node_modules/undici/lib/mock/mock-client.js +59 -0
  1032. package/.output/server/node_modules/undici/lib/mock/mock-errors.js +17 -0
  1033. package/.output/server/node_modules/undici/lib/mock/mock-interceptor.js +207 -0
  1034. package/.output/server/node_modules/undici/lib/mock/mock-pool.js +59 -0
  1035. package/.output/server/node_modules/undici/lib/mock/mock-symbols.js +23 -0
  1036. package/.output/server/node_modules/undici/lib/mock/mock-utils.js +367 -0
  1037. package/.output/server/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
  1038. package/.output/server/node_modules/undici/lib/mock/pluralizer.js +29 -0
  1039. package/.output/server/node_modules/undici/lib/util/timers.js +423 -0
  1040. package/.output/server/node_modules/undici/lib/web/cache/cache.js +859 -0
  1041. package/.output/server/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
  1042. package/.output/server/node_modules/undici/lib/web/cache/symbols.js +5 -0
  1043. package/.output/server/node_modules/undici/lib/web/cache/util.js +45 -0
  1044. package/.output/server/node_modules/undici/lib/web/cookies/constants.js +12 -0
  1045. package/.output/server/node_modules/undici/lib/web/cookies/index.js +184 -0
  1046. package/.output/server/node_modules/undici/lib/web/cookies/parse.js +317 -0
  1047. package/.output/server/node_modules/undici/lib/web/cookies/util.js +282 -0
  1048. package/.output/server/node_modules/undici/lib/web/eventsource/eventsource-stream.js +398 -0
  1049. package/.output/server/node_modules/undici/lib/web/eventsource/eventsource.js +480 -0
  1050. package/.output/server/node_modules/undici/lib/web/eventsource/util.js +37 -0
  1051. package/.output/server/node_modules/undici/lib/web/fetch/body.js +533 -0
  1052. package/.output/server/node_modules/undici/lib/web/fetch/constants.js +124 -0
  1053. package/.output/server/node_modules/undici/lib/web/fetch/data-url.js +744 -0
  1054. package/.output/server/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +46 -0
  1055. package/.output/server/node_modules/undici/lib/web/fetch/file.js +126 -0
  1056. package/.output/server/node_modules/undici/lib/web/fetch/formdata-parser.js +474 -0
  1057. package/.output/server/node_modules/undici/lib/web/fetch/formdata.js +252 -0
  1058. package/.output/server/node_modules/undici/lib/web/fetch/global.js +40 -0
  1059. package/.output/server/node_modules/undici/lib/web/fetch/headers.js +687 -0
  1060. package/.output/server/node_modules/undici/lib/web/fetch/index.js +2266 -0
  1061. package/.output/server/node_modules/undici/lib/web/fetch/request.js +1037 -0
  1062. package/.output/server/node_modules/undici/lib/web/fetch/response.js +605 -0
  1063. package/.output/server/node_modules/undici/lib/web/fetch/symbols.js +9 -0
  1064. package/.output/server/node_modules/undici/lib/web/fetch/util.js +1632 -0
  1065. package/.output/server/node_modules/undici/lib/web/fetch/webidl.js +695 -0
  1066. package/.output/server/node_modules/undici/lib/web/fileapi/encoding.js +290 -0
  1067. package/.output/server/node_modules/undici/lib/web/fileapi/filereader.js +344 -0
  1068. package/.output/server/node_modules/undici/lib/web/fileapi/progressevent.js +78 -0
  1069. package/.output/server/node_modules/undici/lib/web/fileapi/symbols.js +10 -0
  1070. package/.output/server/node_modules/undici/lib/web/fileapi/util.js +391 -0
  1071. package/.output/server/node_modules/undici/lib/web/websocket/connection.js +371 -0
  1072. package/.output/server/node_modules/undici/lib/web/websocket/constants.js +66 -0
  1073. package/.output/server/node_modules/undici/lib/web/websocket/events.js +329 -0
  1074. package/.output/server/node_modules/undici/lib/web/websocket/frame.js +96 -0
  1075. package/.output/server/node_modules/undici/lib/web/websocket/permessage-deflate.js +70 -0
  1076. package/.output/server/node_modules/undici/lib/web/websocket/receiver.js +424 -0
  1077. package/.output/server/node_modules/undici/lib/web/websocket/sender.js +104 -0
  1078. package/.output/server/node_modules/undici/lib/web/websocket/symbols.js +12 -0
  1079. package/.output/server/node_modules/undici/lib/web/websocket/util.js +314 -0
  1080. package/.output/server/node_modules/undici/lib/web/websocket/websocket.js +588 -0
  1081. package/.output/server/node_modules/undici/package.json +160 -0
  1082. package/.output/server/node_modules/ws/index.js +13 -0
  1083. package/.output/server/node_modules/ws/lib/buffer-util.js +131 -0
  1084. package/.output/server/node_modules/ws/lib/constants.js +18 -0
  1085. package/.output/server/node_modules/ws/lib/event-target.js +292 -0
  1086. package/.output/server/node_modules/ws/lib/extension.js +203 -0
  1087. package/.output/server/node_modules/ws/lib/limiter.js +55 -0
  1088. package/.output/server/node_modules/ws/lib/permessage-deflate.js +528 -0
  1089. package/.output/server/node_modules/ws/lib/receiver.js +706 -0
  1090. package/.output/server/node_modules/ws/lib/sender.js +602 -0
  1091. package/.output/server/node_modules/ws/lib/stream.js +161 -0
  1092. package/.output/server/node_modules/ws/lib/subprotocol.js +62 -0
  1093. package/.output/server/node_modules/ws/lib/validation.js +152 -0
  1094. package/.output/server/node_modules/ws/lib/websocket-server.js +550 -0
  1095. package/.output/server/node_modules/ws/lib/websocket.js +1388 -0
  1096. package/.output/server/node_modules/ws/package.json +69 -0
  1097. package/.output/server/package.json +22 -1
  1098. package/Claude/hooks/lib/hook_client.py +38 -0
  1099. package/Claude/hooks/session-start.py +8 -1
  1100. package/Claude/skills/bridge/SKILL.md +125 -0
  1101. package/Claude/skills/bridge/bridge.py +234 -0
  1102. package/README.md +3 -0
  1103. package/app/app.vue +1 -1
  1104. package/app/components/dashboard/StatCards.vue +21 -2
  1105. package/app/components/skills/Card.vue +18 -0
  1106. package/app/components/usage/UsageCostChart.client.vue +59 -23
  1107. package/app/components/usage/UsageCostChart.server.vue +1 -0
  1108. package/app/components/usage/UsageSourceDonut.client.vue +17 -5
  1109. package/app/components/usage/UsageSourceDonut.server.vue +1 -0
  1110. package/app/components/usage/UsageTopConsumers.vue +13 -3
  1111. package/app/composables/usePreferences.ts +9 -1
  1112. package/app/layouts/auth.vue +0 -10
  1113. package/app/pages/login.vue +18 -8
  1114. package/app/pages/settings.vue +279 -3
  1115. package/app/pages/skills/[name].vue +12 -0
  1116. package/app/pages/skills/index.vue +153 -0
  1117. package/app/pages/skills/library.vue +20 -1
  1118. package/app/pages/usage.vue +43 -16
  1119. package/dist/cli/index.js +12 -13
  1120. package/package.json +8 -7
  1121. package/server/api/bridges/[id]/health.get.ts +78 -0
  1122. package/server/api/bridges/[id].delete.ts +41 -0
  1123. package/server/api/bridges/[id].get.ts +25 -0
  1124. package/server/api/bridges/[id].put.ts +54 -0
  1125. package/server/api/bridges/context.get.ts +168 -0
  1126. package/server/api/bridges/index.get.ts +15 -0
  1127. package/server/api/bridges/index.post.ts +39 -0
  1128. package/server/api/skills/[name]/delete.post.ts +38 -0
  1129. package/server/api/skills/[name]/export.get.ts +45 -0
  1130. package/server/api/skills/import.post.ts +87 -0
  1131. package/server/api/skills/index.get.ts +24 -0
  1132. package/server/api/skills/library/install.post.ts +7 -3
  1133. package/server/api/usage/stats.get.ts +4 -2
  1134. package/server/api/webhooks/bluebubbles.post.ts +23 -0
  1135. package/server/api/webhooks/telegram.post.ts +34 -0
  1136. package/server/bridge/adapters/discord.ts +180 -0
  1137. package/server/bridge/adapters/email.ts +50 -0
  1138. package/server/bridge/adapters/google.ts +215 -0
  1139. package/server/bridge/adapters/imessage.ts +352 -0
  1140. package/server/bridge/adapters/telegram.ts +294 -0
  1141. package/server/bridge/lifecycle.ts +124 -0
  1142. package/server/bridge/registry.ts +50 -0
  1143. package/server/bridge/router.ts +126 -0
  1144. package/server/bridge/types.ts +87 -0
  1145. package/server/db/schema.ts +53 -0
  1146. package/server/drizzle/migrations/0014_worthless_cable.sql +36 -0
  1147. package/server/drizzle/migrations/meta/0014_snapshot.json +1959 -0
  1148. package/server/drizzle/migrations/meta/_journal.json +7 -0
  1149. package/server/plugins/06.message-bridge.ts +42 -0
  1150. package/server/utils/get-secret.ts +18 -0
  1151. package/server/utils/notify-resource.ts +2 -1
  1152. package/shared/types/index.ts +115 -1
  1153. package/shared/utils/notification-defaults.ts +2 -1
  1154. package/.output/public/_nuxt/5ZXA0Ckq.js +0 -1
  1155. package/.output/public/_nuxt/BIIJhjQO.js +0 -1
  1156. package/.output/public/_nuxt/BIckl6wA.js +0 -1
  1157. package/.output/public/_nuxt/BJ3o57WW.js +0 -1
  1158. package/.output/public/_nuxt/BNetzZzF.js +0 -1
  1159. package/.output/public/_nuxt/BS0ofHJK.js +0 -1
  1160. package/.output/public/_nuxt/B_3_hrpn.js +0 -1
  1161. package/.output/public/_nuxt/BaBZjmMC.js +0 -1
  1162. package/.output/public/_nuxt/BaMqDm5u.js +0 -1
  1163. package/.output/public/_nuxt/BhzMoffi.js +0 -1
  1164. package/.output/public/_nuxt/BlhFigLL.js +0 -1
  1165. package/.output/public/_nuxt/BoIxv-gM.js +0 -1
  1166. package/.output/public/_nuxt/Br19oYkq.js +0 -1
  1167. package/.output/public/_nuxt/C0kh_F7v.js +0 -1
  1168. package/.output/public/_nuxt/C61KgSco.js +0 -1
  1169. package/.output/public/_nuxt/CJUdYEdO.js +0 -1
  1170. package/.output/public/_nuxt/CVJQGP1Q.js +0 -1
  1171. package/.output/public/_nuxt/CWMUi89H.js +0 -1
  1172. package/.output/public/_nuxt/Cdu2qGgq.js +0 -1
  1173. package/.output/public/_nuxt/CeIu7z4p.js +0 -1
  1174. package/.output/public/_nuxt/D2689qk4.js +0 -1
  1175. package/.output/public/_nuxt/D31L7Ks6.js +0 -1
  1176. package/.output/public/_nuxt/DB359q8R.js +0 -1
  1177. package/.output/public/_nuxt/DHG66LPS.js +0 -1
  1178. package/.output/public/_nuxt/DJ5V-y_x.js +0 -1
  1179. package/.output/public/_nuxt/DLETdGFL.js +0 -1
  1180. package/.output/public/_nuxt/DOICd-Ld.js +0 -1
  1181. package/.output/public/_nuxt/DPEcH-gi.js +0 -65
  1182. package/.output/public/_nuxt/Db8-_gO7.js +0 -1
  1183. package/.output/public/_nuxt/DgV-EDJ9.js +0 -1
  1184. package/.output/public/_nuxt/Dp2X5R2m.js +0 -1
  1185. package/.output/public/_nuxt/DqB723Z0.js +0 -1
  1186. package/.output/public/_nuxt/Q8Ps7oN5.js +0 -1
  1187. package/.output/public/_nuxt/SXTDhzp6.js +0 -1
  1188. package/.output/public/_nuxt/Sg2Lwc46.js +0 -1
  1189. package/.output/public/_nuxt/_J_7XIn-.js +0 -1
  1190. package/.output/public/_nuxt/builds/meta/a1e9100c-1a4f-4f7e-bb53-9dbe0d07effb.json +0 -1
  1191. package/.output/public/_nuxt/entry.CGxIBGAf.css +0 -1
  1192. package/.output/public/_nuxt/inmzPrjz.js +0 -1
  1193. package/.output/public/_nuxt/oIX-ZDN6.js +0 -1
  1194. package/.output/public/_nuxt/sf57orEk.js +0 -1
  1195. package/.output/server/chunks/build/auth-CDHRohj4.mjs +0 -77
  1196. package/.output/server/chunks/build/auth-CDHRohj4.mjs.map +0 -1
  1197. package/.output/server/chunks/build/dashboard-YEscLBQN.mjs.map +0 -1
  1198. package/.output/server/chunks/build/docs-Dk2JnYq3.mjs.map +0 -1
  1199. package/.output/server/chunks/build/hooks-DP8WoUPS.mjs.map +0 -1
  1200. package/.output/server/chunks/build/index-Ba_bPJgk.mjs.map +0 -1
  1201. package/.output/server/chunks/build/settings-DdkKCJ00.mjs.map +0 -1
  1202. package/.output/server/chunks/build/tasks-DiOi1HG_.mjs.map +0 -1
  1203. package/.output/server/chunks/build/usePreferences-CzC8fRzd.mjs.map +0 -1
  1204. package/Claude/CLAUDE.md +0 -129
  1205. /package/.output/public/_nuxt/{useCopyToClipboard.Be_IvFWy.css → CodeEditor.Be_IvFWy.css} +0 -0
@@ -1,4 +1,4 @@
1
- import{a as ze,Q as z,R as k,S as T,a3 as Y,V as G,C as v,a2 as ht,aM as Vn,aL as da,e as J,aW as gt,a0 as wi,aK as fa,Z as jn,c as te,y as wr,c1 as _a,T as O,$ as Xt,bh as Yn,bB as pa,aE as gi,c2 as ga,ba as Cr,a5 as $r,bU as Gn,bv as ji,a7 as $,q as Ci,G as j,ag as ke,aH as va,b3 as ma,f as Ce,k as kt,I as Xn,az as Sa,am as ei,O as Yi,P as ba,aA as ot,aP as Mt,L as ns,N as $t,aj as Ne,W as Jt,aQ as Jn,by as os,a9 as ie,U as H,ah as Ge,bN as Gi,aI as Et,aJ as Lt,aD as zt,aF as ya,aG as wa,bQ as Ca,av as kr,_ as De,aO as Oe,a8 as at,ac as Me,as as Di,al as ka,an as Ni,bR as zi,bS as Yt,ao as Xi,ap as vi,bb as Zn,X as xa,b as dt,c3 as Ea,b5 as Qn,bV as La,aS as Ba,M as Da,c4 as Ma,ak as Ra,ae as Ta,ai as mi,a1 as eo,bz as fs,c5 as _s,c6 as Aa,aa as Pa,n as Ia}from"./BxXOsXrM.js";import{c as Zt,g as Oa,h as Na}from"./DGX0tzL8.js";import{u as to,a as za,b as Fa,_ as Ha,p as $a}from"./C3FxIITy.js";import{_ as xr,u as Wa}from"./CVgTJeSq.js";import{_ as io}from"./DznawRFW.js";import{_ as qa,c as Ka}from"./yNrp2XvX.js";import{b as Wr,A as Ua,c as Va,d as qr}from"./cABRLVee.js";import{u as ja}from"./Cvp7FI3T.js";import{u as so}from"./DqB723Z0.js";import{u as ro}from"./C6Y-ieo6.js";import{_ as Ya}from"./DG-T44jj.js";import{H as Ga,P as Xa,_ as Ja}from"./C0kh_F7v.js";import{_ as Za}from"./eko-0FUm.js";import{_ as Qa}from"./ghuJ76mD.js";import{_ as Er}from"./DyRelyfs.js";import{_ as el}from"./CYP_MLH8.js";import{i as tl,g as il,L as sl,a as rl,b as nl,c as ol,d as al,e as ll,f as hl,_ as cl}from"./_J_7XIn-.js";import{_ as ul}from"./CeIu7z4p.js";import{_ as dl}from"./Db8-_gO7.js";import{u as fl,_ as _l,a as pl,b as gl}from"./gBC9k4Qj.js";import{u as Lr}from"./BIckl6wA.js";import{s as vl}from"./Q8Ps7oN5.js";import{u as ml}from"./DAQhmSv4.js";import{u as Sl}from"./sf57orEk.js";import"./BlAZO7nq.js";import"./Nb2jBtYT.js";import"./DJjDvbZE.js";import"./g20UHUCv.js";import"./oIX-ZDN6.js";import"./5ZXA0Ckq.js";import"./Cr8ixbr1.js";import"./BJ3o57WW.js";import"./DB359q8R.js";import"./Fukkqjkf.js";import"./Cdu2qGgq.js";import"./_CYZi8HN.js";import"./DJMS2og1.js";import"./iBGCpHdw.js";import"./CsJ9KhQ4.js";import"./BAIz-dEB.js";import"./CihWZmJe.js";import"./88opOQSr.js";import"./iik6CYzq.js";import"./BZXMQuYP.js";var bl=ze({__name:"ListboxGroupLabel",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,i=tl({id:""});return(s,r)=>(k(),z(v(ht),G(t,{id:v(i).id}),{default:T(()=>[Y(s.$slots,"default")]),_:3},16,["id"]))}}),yl=bl;const[Wt,wl]=Vn(["NavigationMenuRoot","NavigationMenuSub"],"NavigationMenuContext");var Cl=ze({__name:"NavigationMenuRoot",props:{modelValue:{type:String,required:!1,default:void 0},defaultValue:{type:String,required:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:"horizontal"},delayDuration:{type:Number,required:!1,default:200},skipDelayDuration:{type:Number,required:!1,default:300},disableClickTrigger:{type:Boolean,required:!1,default:!1},disableHoverTrigger:{type:Boolean,required:!1,default:!1},disablePointerLeaveClose:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"nav"}},emits:["update:modelValue"],setup(e,{emit:t}){const i=e,r=da(i,"modelValue",t,{defaultValue:i.defaultValue??"",passive:i.modelValue===void 0}),n=J(""),{forwardRef:o,currentElement:a}=gt(),h=J(),l=J(),f=J(),{getItems:u,CollectionSlot:d}=wi({key:"NavigationMenu",isProvider:!0}),{delayDuration:c,skipDelayDuration:p,dir:_,disableClickTrigger:S,disableHoverTrigger:w,unmountOnHide:y}=fa(i),x=ja(_),g=jn(!1,p),L=te(()=>r.value!==""||g.value?150:c.value),B=_a(E=>{typeof E=="string"&&(n.value=r.value,r.value=E)},L);return wr(()=>{if(!r.value)return;const E=u().map(W=>W.ref);f.value=E.find(W=>W.id.includes(r.value))}),wl({isRootMenu:!0,modelValue:r,previousValue:n,baseId:so(void 0,"reka-navigation-menu"),disableClickTrigger:S,disableHoverTrigger:w,dir:x,unmountOnHide:y,orientation:i.orientation,rootNavigationMenu:a,indicatorTrack:h,activeTrigger:f,onIndicatorTrackChange:E=>{h.value=E},viewport:l,onViewportChange:E=>{l.value=E},onTriggerEnter:E=>{B(E)},onTriggerLeave:()=>{g.value=!0,B("")},onContentEnter:()=>{B()},onContentLeave:()=>{i.disablePointerLeaveClose||B("")},onItemSelect:E=>{n.value=r.value,r.value=E},onItemDismiss:()=>{n.value=r.value,r.value=""}}),(E,W)=>(k(),z(v(d),null,{default:T(()=>[O(v(ht),{ref:v(o),"aria-label":"Main",as:E.as,"as-child":E.asChild,"data-orientation":E.orientation,dir:v(x),"data-reka-navigation-menu":""},{default:T(()=>[Y(E.$slots,"default",{modelValue:v(r)})]),_:3},8,["as","as-child","data-orientation","dir"])]),_:3}))}}),kl=Cl;function as(e){return e?"open":"closed"}function no(e,t){return`${e}-trigger-${t}`}function Br(e,t){return`${e}-content-${t}`}const xl="navigationMenu.linkSelect",Fi="navigationMenu.rootContentDismiss";function Rs(e){const t=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)t.push(i.currentNode);return t}function oo(e){const t=Xt();return e.some(i=>i===t?!0:(i.focus(),Xt()!==t))}function El(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const i=t.dataset.tabindex;t.setAttribute("tabindex",i)})}}function ao(e){return t=>t.pointerType==="mouse"?e(t):void 0}const[Dr,Ll]=Vn("NavigationMenuItem");var Bl=ze({__name:"NavigationMenuItem",props:{value:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"li"}},setup(e){const t=e;gt();const{getItems:i}=wi({key:"NavigationMenu"}),s=Wt(),r=so(t.value),n=J(),o=J(),a=Br(s.baseId,r);let h=()=>({});const l=J(!1);async function f(p="start"){const _=document.getElementById(a);if(_){h();const S=Rs(_);S.length&&oo(p==="start"?S:S.reverse())}}function u(){const p=document.getElementById(a);if(p){const _=Rs(p);_.length&&(h=El(_))}}Ll({value:r,contentId:a,triggerRef:n,focusProxyRef:o,wasEscapeCloseRef:l,onEntryKeyDown:f,onFocusProxyEnter:f,onContentFocusOutside:u,onRootContentClose:u});function d(){s.onItemDismiss(),n.value?.focus()}function c(p){const _=Xt();if(p.keyCode===32||p.key==="Enter")if(s.modelValue.value===r){d(),p.preventDefault();return}else{p.target.click(),p.preventDefault();return}const S=i().filter(y=>y.ref.parentElement?.hasAttribute("data-menu-item")).map(y=>y.ref);if(!S.includes(_))return;const w=ro(p,_,void 0,{itemsArray:S,loop:!1});w&&w?.focus(),p.preventDefault(),p.stopPropagation()}return(p,_)=>(k(),z(v(ht),{"as-child":p.asChild,as:p.as,"data-menu-item":"",onKeydown:Yn(c,["up","down","left","right","home","end","space"])},{default:T(()=>[Y(p.$slots,"default")]),_:3},8,["as-child","as"]))}}),Dl=Bl,Ml=ze({__name:"NavigationMenuContentImpl",props:{disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside"],setup(e,{emit:t}){const i=e,s=t,{getItems:r}=wi({key:"NavigationMenu"}),{forwardRef:n,currentElement:o}=gt(),a=Wt(),h=Dr(),l=no(a.baseId,h.value),f=Br(a.baseId,h.value),u=J(null),d=te(()=>{const y=r().map(W=>W.ref.id.split("trigger-")[1]);a.dir.value==="rtl"&&y.reverse();const x=y.indexOf(a.modelValue.value),g=y.indexOf(a.previousValue.value),L=h.value===a.modelValue.value,B=g===y.indexOf(h.value);if(!L&&!B)return u.value;const E=(()=>{if(x!==g){if(L&&g!==-1)return x>g?"from-end":"from-start";if(B&&x!==-1)return x>g?"to-start":"to-end"}return null})();return u.value=E,E});function c(y){if(s("focusOutside",y),s("interactOutside",y),y.detail.originalEvent.target.hasAttribute("data-navigation-menu-trigger")&&y.preventDefault(),!y.defaultPrevented){h.onContentFocusOutside();const g=y.target;a.rootNavigationMenu?.value?.contains(g)&&y.preventDefault()}}function p(y){if(s("pointerDownOutside",y),!y.defaultPrevented){const x=y.target,g=r().some(B=>B.ref.contains(x)),L=a.isRootMenu&&a.viewport.value?.contains(x);(g||L||!a.isRootMenu)&&y.preventDefault()}}wr(y=>{const x=o.value;if(a.isRootMenu&&x){const g=()=>{a.onItemDismiss(),h.onRootContentClose(),x.contains(Xt())&&h.triggerRef.value?.focus()};x.addEventListener(Fi,g),y(()=>x.removeEventListener(Fi,g))}});function _(y){s("escapeKeyDown",y),y.defaultPrevented||(a.onItemDismiss(),h.triggerRef?.value?.focus(),h.wasEscapeCloseRef.value=!0)}function S(y){if(y.target.closest("[data-reka-navigation-menu]")!==a.rootNavigationMenu.value)return;const x=y.altKey||y.ctrlKey||y.metaKey,g=y.key==="Tab"&&!x,L=Rs(y.currentTarget);if(g){const E=Xt(),W=L.findIndex(V=>V===E),Z=y.shiftKey?L.slice(0,W).reverse():L.slice(W+1,L.length);if(oo(Z))y.preventDefault();else{h.focusProxyRef.value?.focus();return}}ro(y,Xt(),void 0,{itemsArray:L,loop:!1,enableIgnoredElement:!0})?.focus()}function w(){const y=new Event(Fi,{bubbles:!0,cancelable:!0});o.value?.dispatchEvent(y)}return(y,x)=>(k(),z(v(pa),G({id:v(f),ref:v(n),"aria-labelledby":v(l),"data-motion":d.value,"data-state":v(as)(v(a).modelValue.value===v(h).value),"data-orientation":v(a).orientation},i,{onKeydown:S,onEscapeKeyDown:_,onPointerDownOutside:p,onFocusOutside:c,onDismiss:w}),{default:T(()=>[Y(y.$slots,"default")]),_:3},16,["id","aria-labelledby","data-motion","data-state","data-orientation"]))}}),Rl=Ml,Tl=ze({inheritAttrs:!1,__name:"NavigationMenuContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside"],setup(e,{emit:t}){const i=e,s=t,r=gi(ga(i,"forceMount"),s),{forwardRef:n}=gt(),o=Wt(),a=Dr(),h=te(()=>a.value===o.modelValue.value),l=te(()=>o.viewport.value&&!o.modelValue.value&&o.previousValue.value?o.previousValue.value===a.value:!1);return(f,u)=>(k(),z(Gn,{to:v($r)&&v(o).viewport.value?v(o).viewport.value:"body",disabled:v($r)&&v(o).viewport.value?!v(o).viewport.value:!0},[O(v(Cr),{present:f.forceMount||h.value||l.value,"force-mount":!v(o).unmountOnHide.value},{default:T(({present:d})=>[O(Rl,G({ref:v(n),"data-state":v(as)(h.value),style:{pointerEvents:!h.value&&v(o).isRootMenu?"none":void 0}},{...f.$attrs,...v(r)},{hidden:!d,onPointerenter:u[0]||(u[0]=c=>v(o).onContentEnter(v(a).value)),onPointerleave:u[1]||(u[1]=c=>v(ao)(()=>v(o).onContentLeave())(c)),onPointerDownOutside:u[2]||(u[2]=c=>s("pointerDownOutside",c)),onFocusOutside:u[3]||(u[3]=c=>s("focusOutside",c)),onInteractOutside:u[4]||(u[4]=c=>s("interactOutside",c))}),{default:T(()=>[Y(f.$slots,"default")]),_:2},1040,["data-state","style","hidden"])]),_:3},8,["present","force-mount"])],8,["to","disabled"]))}}),Al=Tl,Pl=ze({inheritAttrs:!1,__name:"NavigationMenuIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:i}=gt(),s=Wt(),r=J(),n=te(()=>s.orientation==="horizontal"),o=te(()=>!!s.modelValue.value),{activeTrigger:a}=s;function h(){a.value&&(r.value={size:n.value?a.value.offsetWidth:a.value.offsetHeight,position:n.value?a.value.offsetLeft:a.value.offsetTop})}return wr(()=>{s.modelValue.value&&h()}),ji(a,h),ji(s.indicatorTrack,h),(l,f)=>v(s).indicatorTrack.value?(k(),z(Gn,{key:0,to:v(s).indicatorTrack.value},[O(v(Cr),{present:l.forceMount||o.value},{default:T(()=>[O(v(ht),G({ref:v(i),"aria-hidden":"true","data-state":o.value?"visible":"hidden","data-orientation":v(s).orientation,"as-child":t.asChild,as:l.as,style:{...r.value?{"--reka-navigation-menu-indicator-size":`${r.value.size}px`,"--reka-navigation-menu-indicator-position":`${r.value.position}px`}:{}}},l.$attrs),{default:T(()=>[Y(l.$slots,"default")]),_:3},16,["data-state","data-orientation","as-child","as","style"])]),_:3},8,["present"])],8,["to"])):$("v-if",!0)}}),Il=Pl,Ol=ze({__name:"NavigationMenuLink",props:{active:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"a"}},emits:["select"],setup(e,{emit:t}){const i=e,s=t,{CollectionItem:r}=wi({key:"NavigationMenu"});gt();async function n(o){const a=new CustomEvent(xl,{bubbles:!0,cancelable:!0,detail:{originalEvent:o}});if(s("select",a),!a.defaultPrevented&&!o.metaKey){const h=new CustomEvent(Fi,{bubbles:!0,cancelable:!0});o.target?.dispatchEvent(h)}}return(o,a)=>(k(),z(v(r),null,{default:T(()=>[O(v(ht),{as:o.as,"data-active":o.active?"":void 0,"aria-current":o.active?"page":void 0,"as-child":i.asChild,onClick:n},{default:T(()=>[Y(o.$slots,"default")]),_:3},8,["as","data-active","aria-current","as-child"])]),_:3}))}}),ps=Ol,Nl=ze({inheritAttrs:!1,__name:"NavigationMenuList",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"ul"}},setup(e){const t=e,i=Wt(),{forwardRef:s,currentElement:r}=gt();return Ci(()=>{i.onIndicatorTrackChange(r.value)}),(n,o)=>(k(),z(v(ht),{ref:v(s),style:{position:"relative"}},{default:T(()=>[O(v(ht),G(n.$attrs,{"as-child":t.asChild,as:n.as,"data-orientation":v(i).orientation}),{default:T(()=>[Y(n.$slots,"default")]),_:3},16,["as-child","as","data-orientation"])]),_:3},512))}}),zl=Nl;const Fl=["aria-owns"];var Hl=ze({inheritAttrs:!1,__name:"NavigationMenuTrigger",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,i=Wt(),s=Dr(),{CollectionItem:r}=wi({key:"NavigationMenu"}),{forwardRef:n,currentElement:o}=gt(),a=J(""),h=J(""),l=jn(!1,300),f=J(!1),u=te(()=>s.value===i.modelValue.value);Ci(()=>{s.triggerRef=o,a.value=no(i.baseId,s.value),h.value=Br(i.baseId,s.value)});function d(){i.disableHoverTrigger.value||(f.value=!1,s.wasEscapeCloseRef.value=!1)}function c(x){if(!i.disableHoverTrigger.value&&x.pointerType==="mouse"){if(t.disabled||f.value||s.wasEscapeCloseRef.value||l.value)return;i.onTriggerEnter(s.value),l.value=!0}}function p(x){if(!i.disableHoverTrigger.value&&x.pointerType==="mouse"){if(t.disabled)return;i.onTriggerLeave(),l.value=!1}}function _(x){(!("pointerType"in x)||x.pointerType==="mouse")&&i.disableClickTrigger.value||l.value||(u.value?i.onItemSelect(""):i.onItemSelect(s.value),f.value=u.value)}function S(x){const L={horizontal:"ArrowDown",vertical:i.dir.value==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];u.value&&x.key===L&&(s.onEntryKeyDown(),x.preventDefault(),x.stopPropagation())}function w(x){s.focusProxyRef.value=ma(x)}function y(x){const g=document.getElementById(s.contentId),L=x.relatedTarget,B=L===o.value,E=g?.contains(L);(B||!E)&&s.onFocusProxyEnter(B?"start":"end")}return(x,g)=>(k(),j(ke,null,[O(v(r),null,{default:T(()=>[O(v(ht),G({id:a.value,ref:v(n),disabled:x.disabled,"data-disabled":x.disabled?"":void 0,"data-state":v(as)(u.value),"data-navigation-menu-trigger":"","aria-expanded":u.value,"aria-controls":h.value,"as-child":t.asChild,as:x.as},x.$attrs,{onPointerenter:d,onPointermove:c,onPointerleave:p,onClick:_,onKeydown:S}),{default:T(()=>[Y(x.$slots,"default")]),_:3},16,["id","disabled","data-disabled","data-state","aria-expanded","aria-controls","as-child","as"])]),_:3}),u.value?(k(),j(ke,{key:0},[O(v(va),{ref:w,"aria-hidden":"true",tabindex:0,onFocus:y}),v(i).viewport?(k(),j("span",{key:0,"aria-owns":h.value},null,8,Fl)):$("v-if",!0)],64)):$("v-if",!0)],64))}}),$l=Hl,Wl=ze({inheritAttrs:!1,__name:"NavigationMenuViewport",props:{forceMount:{type:Boolean,required:!1},align:{type:String,required:!1,default:"center"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:i,currentElement:s}=gt(),r=Wt(),{activeTrigger:n,rootNavigationMenu:o,modelValue:a}=r,h=J(),l=J(),f=te(()=>!!r.modelValue.value);Ce(s,()=>{r.onViewportChange(s.value)});const u=J();Ce([a,f],()=>{kt(()=>{s.value&&requestAnimationFrame(()=>{const c=s.value?.querySelector("[data-state=open]");u.value=c})})},{immediate:!0});function d(){if(u.value&&n.value&&o.value){const c=document.documentElement.offsetWidth,p=document.documentElement.offsetHeight,_=o.value.getBoundingClientRect(),S=n.value.getBoundingClientRect(),{offsetWidth:w,offsetHeight:y}=u.value,x=S.left-_.left,g=S.top-_.top;let L=null,B=null;switch(t.align){case"start":L=x,B=g;break;case"end":L=x-w+S.width,B=g-y+S.height;break;default:L=x-w/2+S.width/2,B=g-y/2+S.height/2}const E=10;L+_.left<E&&(L=E-_.left);const W=L+_.left+w;W>c-E&&(L-=W-c+E,L<E-_.left&&(L=E-_.left)),B+_.top<E&&(B=E-_.top);const U=B+_.top+y;U>p-E&&(B-=U-p+E,B<E-_.top&&(B=E-_.top)),L=Math.round(L),B=Math.round(B),l.value={left:L,top:B}}}return ji(u,()=>{u.value&&(h.value={width:u.value.offsetWidth,height:u.value.offsetHeight},d())}),ji([globalThis.document?.body,o],()=>{d()}),(c,p)=>(k(),z(v(Cr),{present:c.forceMount||f.value,"force-mount":!v(r).unmountOnHide.value,onAfterLeave:p[2]||(p[2]=()=>{h.value=void 0,l.value=void 0})},{default:T(({present:_})=>[O(v(ht),G(c.$attrs,{ref:v(i),as:c.as,"as-child":c.asChild,"data-state":v(as)(f.value),"data-orientation":v(r).orientation,style:{pointerEvents:!f.value&&v(r).isRootMenu?"none":void 0,"--reka-navigation-menu-viewport-width":h.value?`${h.value?.width}px`:void 0,"--reka-navigation-menu-viewport-height":h.value?`${h.value?.height}px`:void 0,"--reka-navigation-menu-viewport-left":l.value?`${l.value?.left}px`:void 0,"--reka-navigation-menu-viewport-top":l.value?`${l.value?.top}px`:void 0},hidden:!_,onPointerenter:p[0]||(p[0]=S=>v(r).onContentEnter(v(r).modelValue.value)),onPointerleave:p[1]||(p[1]=S=>v(ao)(()=>v(r).onContentLeave())(S))}),{default:T(()=>[Y(c.$slots,"default")]),_:2},1040,["as","as-child","data-state","data-orientation","style","hidden"])]),_:3},8,["present","force-mount"]))}}),ql=Wl;function Ts(e,t){const s=Xn().hook(e,t);Sa(s)}const Kl={slots:{base:"",label:"",trailing:"hidden lg:flex items-center gap-0.5 ms-auto"},variants:{collapsed:{true:{label:"hidden",trailing:"lg:hidden"}}}},Ul=Object.assign({inheritAttrs:!1},{__name:"UDashboardSearchButton",props:{icon:{type:null,required:!1},label:{type:String,required:!1},color:{type:null,required:!1,default:"neutral"},variant:{type:null,required:!1},collapsed:{type:Boolean,required:!1,default:!1},tooltip:{type:[Boolean,Object],required:!1,default:!1},kbds:{type:Array,required:!1,default:()=>["meta","k"]},ui:{type:void 0,required:!1},class:{type:null,required:!1},activeColor:{type:null,required:!1},activeVariant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},block:{type:Boolean,required:!1},loadingAuto:{type:Boolean,required:!1},onClick:{type:[Function,Array],required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},as:{type:null,required:!1},type:{type:null,required:!1},disabled:{type:Boolean,required:!1},exactActiveClass:{type:String,required:!1},viewTransition:{type:Boolean,required:!1}},setup(e){const t=e,i=ei(),[s,r]=Zt(),n=()=>Gi(i,["trailing"]),o=Yi(ba(t,"icon","label","variant","collapsed","tooltip","kbds","class","ui")),a=ot(()=>Mt(typeof t.tooltip=="boolean"?{}:t.tooltip,{delayDuration:0,content:{side:"right"}})),{t:h}=ns(),l=$t(),{toggleSearch:f}=to({toggleSearch:()=>{}}),u=te(()=>Ne({extend:Ne(Kl),...l.ui?.dashboardSearchButton||{}})({collapsed:t.collapsed}));return(d,c)=>(k(),j(ke,null,[O(v(s),null,{default:T(()=>[O(Jt,G({icon:e.icon||v(l).ui.icons.search,label:e.label||v(h)("dashboardSearchButton.label"),variant:e.variant||(e.collapsed?"ghost":"outline")},{...v(o),...e.collapsed?{square:!0,"aria-label":e.label||v(h)("dashboardSearchButton.label")}:{},...d.$attrs},{class:u.value.base({class:[t.ui?.base,t.class]}),ui:v(Jn)(u.value,t.ui),onClick:v(f)}),os({trailing:T(({ui:p})=>[ie("div",{"data-slot":"trailing",class:H(u.value.trailing({class:t.ui?.trailing}))},[Y(d.$slots,"trailing",{ui:p},()=>[e.kbds?.length?(k(!0),j(ke,{key:0},Ge(e.kbds,(_,S)=>(k(),z(xr,G({key:S,variant:"subtle"},{ref_for:!0},typeof _=="string"?{value:_}:_),null,16))),128)):$("",!0)])],2)]),_:2},[Ge(n(),(p,_)=>({name:_,fn:T(S=>[Y(d.$slots,_,Et(Lt(S)))])}))]),1040,["icon","label","variant","class","ui","onClick"])]),_:3}),e.collapsed&&e.tooltip?(k(),z(io,G({key:0,text:e.label||v(h)("dashboardSearchButton.label")},a.value),{default:T(()=>[O(v(r))]),_:1},16,["text"])):(k(),z(v(r),{key:1}))],64))}}),Vl={slots:{content:"bg-default shadow-lg rounded-md ring ring-default data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-popover-content-transform-origin) focus:outline-none pointer-events-auto",arrow:"fill-default"}},jl={__name:"UPopover",props:{mode:{type:null,required:!1,default:"click"},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:null,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},modal:{type:Boolean,required:!1},openDelay:{type:Number,required:!1,default:0},closeDelay:{type:Number,required:!1,default:0}},emits:["close:prevent","update:open"],setup(e,{emit:t}){const i=e,s=t,r=ei(),n=$t(),o=i.mode==="hover"?zt(i,"defaultOpen","open","openDelay","closeDelay"):zt(i,"defaultOpen","open","modal"),a=gi(o,s),h=ya(ot(()=>i.portal)),l=ot(()=>Mt(i.content,{side:"bottom",sideOffset:8,collisionPadding:8})),f=te(()=>i.dismissible?{}:["pointerDownOutside","interactOutside","escapeKeyDown"].reduce((_,S)=>(_[S]=w=>{w.preventDefault(),s("close:prevent")},_),{})),u=ot(()=>i.arrow),d=te(()=>Ne({extend:Ne(Vl),...n.ui?.popover||{}})({side:l.value.side})),c=te(()=>i.mode==="hover"?Ga:Xa);return(p,_)=>(k(),z(v(c).Root,Et(Lt(v(a))),{default:T(({open:S,close:w})=>[r.default||e.reference?(k(),z(v(c).Trigger,{key:0,"as-child":"",reference:e.reference,class:H(i.class)},{default:T(()=>[Y(p.$slots,"default",{open:S})]),_:2},1032,["reference","class"])):$("",!0),"Anchor"in c.value&&r.anchor?(k(),z(v(c).Anchor,{key:1,"as-child":""},{default:T(()=>[Y(p.$slots,"anchor",Et(Lt(w?{close:w}:{})))]),_:2},1024)):$("",!0),O(v(c).Portal,Et(Lt(v(h))),{default:T(()=>[O(v(c).Content,G(l.value,{"data-slot":"content",class:d.value.content({class:[!r.default&&i.class,i.ui?.content]})},wa(f.value)),{default:T(()=>[Y(p.$slots,"content",Et(Lt(w?{close:w}:{}))),e.arrow?(k(),z(v(c).Arrow,G({key:0},u.value,{"data-slot":"arrow",class:d.value.arrow({class:i.ui?.arrow})}),null,16,["class"])):$("",!0)]),_:2},1040,["class"])]),_:2},1040)]),_:3},16))}},Yl={slots:{root:"relative flex gap-1.5 [&>div]:min-w-0",list:"isolate min-w-0",label:"w-full flex items-center gap-1.5 font-semibold text-xs/5 text-highlighted px-2.5 py-1.5",item:"min-w-0",link:"group relative w-full flex items-center gap-1.5 font-medium text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",linkLeadingIcon:"shrink-0 size-5",linkLeadingAvatar:"shrink-0",linkLeadingAvatarSize:"2xs",linkTrailing:"group ms-auto inline-flex gap-1.5 items-center",linkTrailingBadge:"shrink-0",linkTrailingBadgeSize:"sm",linkTrailingIcon:"size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",linkLabel:"truncate",linkLabelExternalIcon:"inline-block size-3 align-top text-dimmed",childList:"isolate",childLabel:"text-xs text-highlighted",childItem:"",childLink:"group relative size-full flex items-start text-start text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",childLinkWrapper:"min-w-0",childLinkIcon:"size-5 shrink-0",childLinkLabel:"truncate",childLinkLabelExternalIcon:"inline-block size-3 align-top text-dimmed",childLinkDescription:"text-muted",separator:"px-2 h-px bg-border",viewportWrapper:"absolute top-full left-0 flex w-full",viewport:"relative overflow-hidden bg-default shadow-lg rounded-md ring ring-default h-(--reka-navigation-menu-viewport-height) w-full transition-[width,height,left] duration-200 origin-[top_center] data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] z-[1]",content:"",indicator:"absolute data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] data-[state=hidden]:opacity-0 bottom-0 z-[2] w-(--reka-navigation-menu-indicator-size) translate-x-(--reka-navigation-menu-indicator-position) flex h-2.5 items-end justify-center overflow-hidden transition-[translate,width] duration-200",arrow:"relative top-[50%] size-2.5 rotate-45 border border-default bg-default z-[1] rounded-xs"},variants:{color:{primary:{link:"focus-visible:before:ring-primary",childLink:"focus-visible:before:ring-primary"},secondary:{link:"focus-visible:before:ring-secondary",childLink:"focus-visible:before:ring-secondary"},success:{link:"focus-visible:before:ring-success",childLink:"focus-visible:before:ring-success"},info:{link:"focus-visible:before:ring-info",childLink:"focus-visible:before:ring-info"},warning:{link:"focus-visible:before:ring-warning",childLink:"focus-visible:before:ring-warning"},error:{link:"focus-visible:before:ring-error",childLink:"focus-visible:before:ring-error"},neutral:{link:"focus-visible:before:ring-inverted",childLink:"focus-visible:before:ring-inverted"}},highlightColor:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{pill:"",link:""},orientation:{horizontal:{root:"items-center justify-between",list:"flex items-center",item:"py-2",link:"px-2.5 py-1.5 before:inset-x-px before:inset-y-0",childList:"grid p-2",childLink:"px-3 py-2 gap-2 before:inset-x-px before:inset-y-0",childLinkLabel:"font-medium",content:"absolute top-0 left-0 w-full max-h-[70vh] overflow-y-auto"},vertical:{root:"flex-col",link:"flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0",childLabel:"px-1.5 py-0.5",childLink:"p-1.5 gap-1.5 before:inset-y-px before:inset-x-0"}},contentOrientation:{horizontal:{viewportWrapper:"justify-center",content:"data-[motion=from-start]:animate-[enter-from-left_200ms_ease] data-[motion=from-end]:animate-[enter-from-right_200ms_ease] data-[motion=to-start]:animate-[exit-to-left_200ms_ease] data-[motion=to-end]:animate-[exit-to-right_200ms_ease]"},vertical:{viewport:"sm:w-(--reka-navigation-menu-viewport-width) left-(--reka-navigation-menu-viewport-left)"}},active:{true:{childLink:"before:bg-elevated text-highlighted",childLinkIcon:"text-default"},false:{link:"text-muted",linkLeadingIcon:"text-dimmed",childLink:["hover:before:bg-elevated/50 text-default hover:text-highlighted","transition-colors before:transition-colors"],childLinkIcon:["text-dimmed group-hover:text-default","transition-colors"]}},disabled:{true:{link:"cursor-not-allowed opacity-75"}},highlight:{true:""},level:{true:""},collapsed:{true:""}},compoundVariants:[{orientation:"horizontal",contentOrientation:"horizontal",class:{childList:"grid-cols-2 gap-2"}},{orientation:"horizontal",contentOrientation:"vertical",class:{childList:"gap-1",content:"w-60"}},{orientation:"vertical",collapsed:!1,class:{childList:"ms-5 border-s border-default",childItem:"ps-1.5 -ms-px",content:"data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden"}},{orientation:"vertical",collapsed:!0,class:{link:"px-1.5",linkLabel:"hidden",linkTrailing:"hidden",content:"shadow-sm rounded-sm min-h-6 p-1"}},{orientation:"horizontal",highlight:!0,class:{link:["after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full","after:transition-colors"]}},{orientation:"vertical",highlight:!0,level:!0,class:{link:["after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-px after:rounded-full","after:transition-colors"]}},{disabled:!1,active:!1,variant:"pill",class:{link:["hover:text-highlighted hover:before:bg-elevated/50","transition-colors before:transition-colors"],linkLeadingIcon:["group-hover:text-default","transition-colors"]}},{disabled:!1,active:!1,variant:"pill",orientation:"horizontal",class:{link:"data-[state=open]:text-highlighted",linkLeadingIcon:"group-data-[state=open]:text-default"}},{disabled:!1,variant:"pill",highlight:!0,orientation:"horizontal",class:{link:"data-[state=open]:before:bg-elevated/50"}},{disabled:!1,variant:"pill",highlight:!1,active:!1,orientation:"horizontal",class:{link:"data-[state=open]:before:bg-elevated/50"}},{color:"primary",variant:"pill",active:!0,class:{link:"text-primary",linkLeadingIcon:"text-primary group-data-[state=open]:text-primary"}},{color:"secondary",variant:"pill",active:!0,class:{link:"text-secondary",linkLeadingIcon:"text-secondary group-data-[state=open]:text-secondary"}},{color:"success",variant:"pill",active:!0,class:{link:"text-success",linkLeadingIcon:"text-success group-data-[state=open]:text-success"}},{color:"info",variant:"pill",active:!0,class:{link:"text-info",linkLeadingIcon:"text-info group-data-[state=open]:text-info"}},{color:"warning",variant:"pill",active:!0,class:{link:"text-warning",linkLeadingIcon:"text-warning group-data-[state=open]:text-warning"}},{color:"error",variant:"pill",active:!0,class:{link:"text-error",linkLeadingIcon:"text-error group-data-[state=open]:text-error"}},{color:"neutral",variant:"pill",active:!0,class:{link:"text-highlighted",linkLeadingIcon:"text-highlighted group-data-[state=open]:text-highlighted"}},{variant:"pill",active:!0,highlight:!1,class:{link:"before:bg-elevated"}},{variant:"pill",active:!0,highlight:!0,disabled:!1,class:{link:["hover:before:bg-elevated/50","before:transition-colors"]}},{disabled:!1,active:!1,variant:"link",class:{link:["hover:text-highlighted","transition-colors"],linkLeadingIcon:["group-hover:text-default","transition-colors"]}},{disabled:!1,active:!1,variant:"link",orientation:"horizontal",class:{link:"data-[state=open]:text-highlighted",linkLeadingIcon:"group-data-[state=open]:text-default"}},{color:"primary",variant:"link",active:!0,class:{link:"text-primary",linkLeadingIcon:"text-primary group-data-[state=open]:text-primary"}},{color:"secondary",variant:"link",active:!0,class:{link:"text-secondary",linkLeadingIcon:"text-secondary group-data-[state=open]:text-secondary"}},{color:"success",variant:"link",active:!0,class:{link:"text-success",linkLeadingIcon:"text-success group-data-[state=open]:text-success"}},{color:"info",variant:"link",active:!0,class:{link:"text-info",linkLeadingIcon:"text-info group-data-[state=open]:text-info"}},{color:"warning",variant:"link",active:!0,class:{link:"text-warning",linkLeadingIcon:"text-warning group-data-[state=open]:text-warning"}},{color:"error",variant:"link",active:!0,class:{link:"text-error",linkLeadingIcon:"text-error group-data-[state=open]:text-error"}},{color:"neutral",variant:"link",active:!0,class:{link:"text-highlighted",linkLeadingIcon:"text-highlighted group-data-[state=open]:text-highlighted"}},{highlightColor:"primary",highlight:!0,level:!0,active:!0,class:{link:"after:bg-primary"}},{highlightColor:"secondary",highlight:!0,level:!0,active:!0,class:{link:"after:bg-secondary"}},{highlightColor:"success",highlight:!0,level:!0,active:!0,class:{link:"after:bg-success"}},{highlightColor:"info",highlight:!0,level:!0,active:!0,class:{link:"after:bg-info"}},{highlightColor:"warning",highlight:!0,level:!0,active:!0,class:{link:"after:bg-warning"}},{highlightColor:"error",highlight:!0,level:!0,active:!0,class:{link:"after:bg-error"}},{highlightColor:"neutral",highlight:!0,level:!0,active:!0,class:{link:"after:bg-inverted"}}],defaultVariants:{color:"primary",highlightColor:"primary",variant:"pill"}},Gl=Object.assign({inheritAttrs:!1},{__name:"UNavigationMenu",props:{as:{type:null,required:!1},type:{type:null,required:!1,default:"multiple"},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},trailingIcon:{type:null,required:!1},externalIcon:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},items:{type:null,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},collapsed:{type:Boolean,required:!1},tooltip:{type:[Boolean,Object],required:!1},popover:{type:[Boolean,Object],required:!1},highlight:{type:Boolean,required:!1},highlightColor:{type:null,required:!1},content:{type:Object,required:!1},contentOrientation:{type:null,required:!1,default:"horizontal"},arrow:{type:Boolean,required:!1},labelKey:{type:null,required:!1,default:"label"},class:{type:null,required:!1},ui:{type:null,required:!1},delayDuration:{type:Number,required:!1,default:0},disableClickTrigger:{type:Boolean,required:!1},disableHoverTrigger:{type:Boolean,required:!1},skipDelayDuration:{type:Number,required:!1},disablePointerLeaveClose:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},disabled:{type:Boolean,required:!1},collapsible:{type:Boolean,required:!1,default:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const i=e,s=t,r=ei(),n=$t(),o=gi(te(()=>({as:i.as,delayDuration:i.delayDuration,skipDelayDuration:i.skipDelayDuration,orientation:i.orientation,disableClickTrigger:i.disableClickTrigger,disableHoverTrigger:i.disableHoverTrigger,disablePointerLeaveClose:i.disablePointerLeaveClose,unmountOnHide:i.unmountOnHide})),s),a=gi(zt(i,"collapsible","disabled","type","unmountOnHide"),s),h=ot(()=>i.content),l=ot(()=>Mt(typeof i.tooltip=="boolean"?{}:i.tooltip,{delayDuration:0,content:{side:"right"}})),f=ot(()=>Mt(typeof i.popover=="boolean"?{}:i.popover,{mode:"hover",content:{side:"right",align:"start",alignOffset:2}})),[u,d]=Zt(),[c,p]=Zt({props:{item:Object,index:Number,level:Number}}),_=te(()=>Ne({extend:Ne(Yl),...n.ui?.navigationMenu||{}})({orientation:i.orientation,contentOrientation:i.orientation==="vertical"?void 0:i.contentOrientation,collapsed:i.collapsed,color:i.color,variant:i.variant,highlight:i.highlight,highlightColor:i.highlightColor||i.color})),S=te(()=>i.items?.length?Ca(i.items)?i.items:[i.items]:[]);function w(y,x=0){const g=y.reduce((L,B,E)=>((B.defaultOpen||B.open)&&L.push(B.value||(x>0?`item-${x}-${E}`:`item-${E}`)),L),[]);return i.type==="single"?g[0]:g}return(y,x)=>(k(),j(ke,null,[O(v(u),null,{default:T(({item:g,active:L,index:B})=>[Y(y.$slots,g.slot||"item",{item:g,index:B,active:L,ui:_.value},()=>[Y(y.$slots,g.slot?`${g.slot}-leading`:"item-leading",{item:g,active:L,index:B,ui:_.value},()=>[g.avatar?(k(),z(kr,G({key:0,size:g.ui?.linkLeadingAvatarSize||i.ui?.linkLeadingAvatarSize||_.value.linkLeadingAvatarSize()},g.avatar,{"data-slot":"linkLeadingAvatar",class:_.value.linkLeadingAvatar({class:[i.ui?.linkLeadingAvatar,g.ui?.linkLeadingAvatar],active:L,disabled:!!g.disabled})}),null,16,["size","class"])):g.icon?(k(),z(De,{key:1,name:g.icon,"data-slot":"linkLeadingIcon",class:H(_.value.linkLeadingIcon({class:[i.ui?.linkLeadingIcon,g.ui?.linkLeadingIcon],active:L,disabled:!!g.disabled}))},null,8,["name","class"])):$("",!0)]),v(Oe)(g,i.labelKey)||r[g.slot?`${g.slot}-label`:"item-label"]?(k(),j("span",{key:0,"data-slot":"linkLabel",class:H(_.value.linkLabel({class:[i.ui?.linkLabel,g.ui?.linkLabel]}))},[Y(y.$slots,g.slot?`${g.slot}-label`:"item-label",{item:g,active:L,index:B},()=>[at(Me(v(Oe)(g,i.labelKey)),1)]),g.target==="_blank"&&e.externalIcon!==!1?(k(),z(De,{key:0,name:typeof e.externalIcon=="string"?e.externalIcon:v(n).ui.icons.external,"data-slot":"linkLabelExternalIcon",class:H(_.value.linkLabelExternalIcon({class:[i.ui?.linkLabelExternalIcon,g.ui?.linkLabelExternalIcon],active:L}))},null,8,["name","class"])):$("",!0)],2)):$("",!0),g.badge||g.badge===0||e.orientation==="horizontal"&&(g.children?.length||r[g.slot?`${g.slot}-content`:"item-content"])||e.orientation==="vertical"&&g.children?.length||g.trailingIcon||r[g.slot?`${g.slot}-trailing`:"item-trailing"]?(k(),z(Di(e.orientation==="vertical"&&g.children?.length&&!e.collapsed?v(Wr):"span"),{key:1,as:"span","data-slot":"linkTrailing",class:H(_.value.linkTrailing({class:[i.ui?.linkTrailing,g.ui?.linkTrailing]})),onClick:x[0]||(x[0]=ka(()=>{},["stop","prevent"]))},{default:T(()=>[Y(y.$slots,g.slot?`${g.slot}-trailing`:"item-trailing",{item:g,active:L,index:B,ui:_.value},()=>[g.badge||g.badge===0?(k(),z(Ya,G({key:0,color:"neutral",variant:"outline",size:g.ui?.linkTrailingBadgeSize||i.ui?.linkTrailingBadgeSize||_.value.linkTrailingBadgeSize()},typeof g.badge=="string"||typeof g.badge=="number"?{label:g.badge}:g.badge,{"data-slot":"linkTrailingBadge",class:_.value.linkTrailingBadge({class:[i.ui?.linkTrailingBadge,g.ui?.linkTrailingBadge]})}),null,16,["size","class"])):$("",!0),e.orientation==="horizontal"&&(g.children?.length||r[g.slot?`${g.slot}-content`:"item-content"])||e.orientation==="vertical"&&g.children?.length?(k(),z(De,{key:1,name:g.trailingIcon||e.trailingIcon||v(n).ui.icons.chevronDown,"data-slot":"linkTrailingIcon",class:H(_.value.linkTrailingIcon({class:[i.ui?.linkTrailingIcon,g.ui?.linkTrailingIcon],active:L}))},null,8,["name","class"])):g.trailingIcon?(k(),z(De,{key:2,name:g.trailingIcon,"data-slot":"linkTrailingIcon",class:H(_.value.linkTrailingIcon({class:[i.ui?.linkTrailingIcon,g.ui?.linkTrailingIcon],active:L}))},null,8,["name","class"])):$("",!0)])]),_:2},1032,["class"])):$("",!0)])]),_:3}),O(v(c),null,{default:T(({item:g,index:L,level:B=0})=>[(k(),z(Di(e.orientation==="vertical"&&!e.collapsed?v(Ua):v(Dl)),{as:"li",value:g.value||(B>0?`item-${B}-${L}`:`item-${L}`)},{default:T(()=>[e.orientation==="vertical"&&g.type==="label"&&!e.collapsed?(k(),j("div",{key:0,"data-slot":"label",class:H(_.value.label({class:[i.ui?.label,g.ui?.label,g.class]}))},[O(v(d),{item:g,index:L},null,8,["item","index"])],2)):g.type!=="label"?(k(),z(Ni,G({key:1},e.orientation==="vertical"&&g.children?.length&&!e.collapsed&&g.type==="trigger"?{}:v(zi)(g),{custom:""}),{default:T(({active:E,...W})=>[(k(),z(Di(e.orientation==="horizontal"&&(g.children?.length||r[g.slot?`${g.slot}-content`:"item-content"])?v($l):e.orientation==="vertical"&&g.children?.length&&!e.collapsed&&!W.href?v(Wr):v(ps)),{"as-child":"",active:E||g.active,disabled:g.disabled,onSelect:g.onSelect},{default:T(()=>[e.orientation==="vertical"&&e.collapsed&&g.children?.length&&(i.popover||g.popover)?(k(),z(jl,G({key:0},{...f.value,...typeof g.popover=="boolean"?{}:g.popover||{}},{ui:{content:_.value.content({class:[i.ui?.content,g.ui?.content]})}}),{content:T(({close:U})=>[Y(y.$slots,g.slot?`${g.slot}-content`:"item-content",{item:g,active:E||g.active,index:L,ui:_.value,close:U},()=>[ie("ul",{"data-slot":"childList",class:H(_.value.childList({class:[i.ui?.childList,g.ui?.childList]}))},[ie("li",{"data-slot":"childLabel",class:H(_.value.childLabel({class:[i.ui?.childLabel,g.ui?.childLabel]}))},Me(v(Oe)(g,i.labelKey)),3),(k(!0),j(ke,null,Ge(g.children,(Z,V)=>(k(),j("li",{key:V,"data-slot":"childItem",class:H(_.value.childItem({class:[i.ui?.childItem,g.ui?.childItem]}))},[O(Ni,G({ref_for:!0},v(zi)(Z),{custom:""}),{default:T(({active:A,...b})=>[O(v(ps),{"as-child":"",active:A,onSelect:Z.onSelect},{default:T(()=>[O(Yt,G({ref_for:!0},b,{"data-slot":"childLink",class:_.value.childLink({class:[i.ui?.childLink,g.ui?.childLink,Z.class],active:A})}),{default:T(()=>[Z.icon?(k(),z(De,{key:0,name:Z.icon,"data-slot":"childLinkIcon",class:H(_.value.childLinkIcon({class:[i.ui?.childLinkIcon,g.ui?.childLinkIcon],active:A}))},null,8,["name","class"])):$("",!0),ie("span",{"data-slot":"childLinkLabel",class:H(_.value.childLinkLabel({class:[i.ui?.childLinkLabel,g.ui?.childLinkLabel],active:A}))},[at(Me(v(Oe)(Z,i.labelKey))+" ",1),Z.target==="_blank"&&e.externalIcon!==!1?(k(),z(De,{key:0,name:typeof e.externalIcon=="string"?e.externalIcon:v(n).ui.icons.external,"data-slot":"childLinkLabelExternalIcon",class:H(_.value.childLinkLabelExternalIcon({class:[i.ui?.childLinkLabelExternalIcon,g.ui?.childLinkLabelExternalIcon],active:A}))},null,8,["name","class"])):$("",!0)],2)]),_:2},1040,["class"])]),_:2},1032,["active","onSelect"])]),_:2},1040)],2))),128))],2)])]),default:T(()=>[O(Yt,G(W,{"data-slot":"link",class:_.value.link({class:[i.ui?.link,g.ui?.link,g.class],active:E||g.active,disabled:!!g.disabled,level:B>0})}),{default:T(()=>[O(v(d),{item:g,active:E||g.active,index:L},null,8,["item","active","index"])]),_:2},1040,["class"])]),_:2},1040,["ui"])):e.orientation==="vertical"&&e.collapsed&&(i.tooltip||g.tooltip)?(k(),z(io,G({key:1,text:v(Oe)(g,i.labelKey)},{...l.value,...typeof g.tooltip=="boolean"?{}:g.tooltip||{}}),{default:T(()=>[O(Yt,G(W,{"data-slot":"link",class:_.value.link({class:[i.ui?.link,g.ui?.link,g.class],active:E||g.active,disabled:!!g.disabled,level:B>0})}),{default:T(()=>[O(v(d),{item:g,active:E||g.active,index:L},null,8,["item","active","index"])]),_:2},1040,["class"])]),_:2},1040,["text"])):(k(),z(Yt,G({key:2},W,{"data-slot":"link",class:_.value.link({class:[i.ui?.link,g.ui?.link,g.class],active:E||g.active,disabled:!!g.disabled,level:e.orientation==="horizontal"||B>0})}),{default:T(()=>[O(v(d),{item:g,active:E||g.active,index:L},null,8,["item","active","index"])]),_:2},1040,["class"]))]),_:2},1064,["active","disabled","onSelect"])),e.orientation==="horizontal"&&(g.children?.length||r[g.slot?`${g.slot}-content`:"item-content"])?(k(),z(v(Al),G({key:0},h.value,{"data-slot":"content",class:_.value.content({class:[i.ui?.content,g.ui?.content]})}),{default:T(()=>[Y(y.$slots,g.slot?`${g.slot}-content`:"item-content",{item:g,active:E||g.active,index:L,ui:_.value},()=>[ie("ul",{"data-slot":"childList",class:H(_.value.childList({class:[i.ui?.childList,g.ui?.childList]}))},[(k(!0),j(ke,null,Ge(g.children,(U,Z)=>(k(),j("li",{key:Z,"data-slot":"childItem",class:H(_.value.childItem({class:[i.ui?.childItem,g.ui?.childItem]}))},[O(Ni,G({ref_for:!0},v(zi)(U),{custom:""}),{default:T(({active:V,...A})=>[O(v(ps),{"as-child":"",active:V,onSelect:U.onSelect},{default:T(()=>[O(Yt,G({ref_for:!0},A,{"data-slot":"childLink",class:_.value.childLink({class:[i.ui?.childLink,g.ui?.childLink,U.class],active:V})}),{default:T(()=>[U.icon?(k(),z(De,{key:0,name:U.icon,"data-slot":"childLinkIcon",class:H(_.value.childLinkIcon({class:[i.ui?.childLinkIcon,g.ui?.childLinkIcon],active:V}))},null,8,["name","class"])):$("",!0),ie("div",{"data-slot":"childLinkWrapper",class:H(_.value.childLinkWrapper({class:[i.ui?.childLinkWrapper,g.ui?.childLinkWrapper]}))},[ie("p",{"data-slot":"childLinkLabel",class:H(_.value.childLinkLabel({class:[i.ui?.childLinkLabel,g.ui?.childLinkLabel],active:V}))},[at(Me(v(Oe)(U,i.labelKey))+" ",1),U.target==="_blank"&&e.externalIcon!==!1?(k(),z(De,{key:0,name:typeof e.externalIcon=="string"?e.externalIcon:v(n).ui.icons.external,"data-slot":"childLinkLabelExternalIcon",class:H(_.value.childLinkLabelExternalIcon({class:[i.ui?.childLinkLabelExternalIcon,g.ui?.childLinkLabelExternalIcon],active:V}))},null,8,["name","class"])):$("",!0)],2),U.description?(k(),j("p",{key:0,"data-slot":"childLinkDescription",class:H(_.value.childLinkDescription({class:[i.ui?.childLinkDescription,g.ui?.childLinkDescription],active:V}))},Me(U.description),3)):$("",!0)],2)]),_:2},1040,["class"])]),_:2},1032,["active","onSelect"])]),_:2},1040)],2))),128))],2)])]),_:2},1040,["class"])):$("",!0)]),_:2},1040)):$("",!0),e.orientation==="vertical"&&g.children?.length&&!e.collapsed?(k(),z(v(Va),{key:2,"data-slot":"content",class:H(_.value.content({class:[i.ui?.content,g.ui?.content]}))},{default:T(()=>[O(v(qr),G({...v(a),defaultValue:w(g.children,B+1)},{as:"ul","data-slot":"childList",class:_.value.childList({class:i.ui?.childList})}),{default:T(()=>[(k(!0),j(ke,null,Ge(g.children,(E,W)=>(k(),z(v(p),{key:W,item:E,index:W,level:B+1,"data-slot":"childItem",class:H(_.value.childItem({class:[i.ui?.childItem,E.ui?.childItem]}))},null,8,["item","index","level","class"]))),128))]),_:2},1040,["class"])]),_:2},1032,["class"])):$("",!0)]),_:2},1032,["value"]))]),_:3}),O(v(kl),G({...v(o),...e.orientation==="horizontal"?{modelValue:e.modelValue,defaultValue:e.defaultValue}:{},...y.$attrs},{"data-collapsed":e.collapsed,"data-slot":"root",class:_.value.root({class:[i.ui?.root,i.class]})}),{default:T(()=>[Y(y.$slots,"list-leading"),(k(!0),j(ke,null,Ge(S.value,(g,L)=>(k(),j(ke,{key:`list-${L}`},[(k(),z(Di(e.orientation==="vertical"?v(qr):v(zl)),G({ref_for:!0},e.orientation==="vertical"&&!e.collapsed?{...v(a),modelValue:e.modelValue,defaultValue:e.defaultValue??w(g)}:{},{as:"ul","data-slot":"list",class:_.value.list({class:i.ui?.list})}),{default:T(()=>[(k(!0),j(ke,null,Ge(g,(B,E)=>(k(),z(v(p),{key:`list-${L}-${E}`,item:B,index:E,"data-slot":"item",class:H(_.value.item({class:[i.ui?.item,B.ui?.item]}))},null,8,["item","index","class"]))),128))]),_:2},1040,["class"])),e.orientation==="vertical"&&L<S.value.length-1?(k(),j("div",{key:0,"data-slot":"separator",class:H(_.value.separator({class:i.ui?.separator}))},null,2)):$("",!0)],64))),128)),Y(y.$slots,"list-trailing"),e.orientation==="horizontal"?(k(),j("div",{key:0,"data-slot":"viewportWrapper",class:H(_.value.viewportWrapper({class:i.ui?.viewportWrapper}))},[e.arrow?(k(),z(v(Il),{key:0,"data-slot":"indicator",class:H(_.value.indicator({class:i.ui?.indicator}))},{default:T(()=>[ie("div",{"data-slot":"arrow",class:H(_.value.arrow({class:i.ui?.arrow}))},null,2)]),_:1},8,["class"])):$("",!0),O(v(ql),{"data-slot":"viewport",class:H(_.value.viewport({class:i.ui?.viewport}))},null,8,["class"])],2)):$("",!0)]),_:3},16,["data-collapsed","class"])],64))}}),Xl={slots:{root:"relative hidden lg:flex flex-col min-h-svh min-w-16 w-(--width) shrink-0",header:"h-(--ui-header-height) shrink-0 flex items-center gap-1.5 px-4",body:"flex flex-col gap-4 flex-1 overflow-y-auto px-4 py-2",footer:"shrink-0 flex items-center gap-1.5 px-4 py-2",toggle:"",handle:"",content:"lg:hidden",overlay:"lg:hidden"},variants:{menu:{true:{header:"sm:px-6",body:"sm:px-6",footer:"sm:px-6"}},side:{left:{root:"border-e border-default"},right:{root:""}},toggleSide:{left:{toggle:""},right:{toggle:"ms-auto"}}}},Jl=["data-collapsed","data-dragging"],Zl=Object.assign({inheritAttrs:!1},{__name:"UDashboardSidebar",props:Xi({mode:{type:null,required:!1,default:"slideover"},menu:{type:null,required:!1},toggle:{type:[Boolean,Object],required:!1,default:!0},toggleSide:{type:String,required:!1,default:"left"},class:{type:null,required:!1},ui:{type:null,required:!1},id:{type:String,required:!1},side:{type:String,required:!1,default:"left"},minSize:{type:Number,required:!1,default:10},maxSize:{type:Number,required:!1,default:20},defaultSize:{type:Number,required:!1,default:15},resizable:{type:Boolean,required:!1,default:!1},collapsible:{type:Boolean,required:!1,default:!1},collapsedSize:{type:Number,required:!1,default:0}},{open:{type:Boolean,default:!1},openModifiers:{},collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:["update:open","update:collapsed"],setup(e){const t=e,i=ei(),s=vi(e,"open",{type:Boolean,default:!1}),r=vi(e,"collapsed",{type:Boolean,default:!1}),n=Zn(),{t:o}=ns(),a=$t(),h=to({storageKey:"dashboard",unit:"%",sidebarOpen:J(!1),sidebarCollapsed:J(!1)}),l=`${h.storageKey}-sidebar-${t.id||xa()}`,{el:f,size:u,collapse:d,isCollapsed:c,isDragging:p,onMouseDown:_,onTouchStart:S,onDoubleClick:w}=za(l,ot(()=>({...h,...t})),{collapsed:r}),[y,x]=Zt(),[g,L]=Zt();Ts("dashboard:sidebar:toggle",()=>{s.value=!s.value}),Ts("dashboard:sidebar:collapse",Z=>{c.value=Z}),Ce(s,()=>h.sidebarOpen.value=s.value,{immediate:!0}),Ce(c,()=>h.sidebarCollapsed.value=c.value,{immediate:!0}),Ce(()=>n.fullPath,()=>{s.value=!1});const B=te(()=>Ne({extend:Ne(Xl),...a.ui?.dashboardSidebar||{}})({side:t.side})),E=te(()=>({slideover:Qa,modal:Er,drawer:el})[t.mode]),W=ot(()=>Mt(t.menu,{content:{onOpenAutoFocus:Z=>Z.preventDefault()}},t.mode==="modal"?{fullscreen:!0,transition:!1}:t.mode==="slideover"?{side:"left"}:{}));function U(){s.value=!s.value}return(Z,V)=>(k(),j(ke,null,[O(v(y),null,{default:T(()=>[Y(Z.$slots,"toggle",{open:s.value,toggle:U,ui:B.value},()=>[e.toggle?(k(),z(Fa,G({key:0},typeof e.toggle=="object"?e.toggle:{},{side:e.toggleSide,"data-slot":"toggle",class:B.value.toggle({class:t.ui?.toggle,toggleSide:e.toggleSide})}),null,16,["side","class"])):$("",!0)])]),_:3}),O(v(g),null,{default:T(()=>[Y(Z.$slots,"resize-handle",{onMouseDown:v(_),onTouchStart:v(S),onDoubleClick:v(w),ui:B.value},()=>[e.resizable?(k(),z(Ha,{key:0,"aria-controls":l,"data-slot":"handle",class:H(B.value.handle({class:t.ui?.handle})),onMousedown:v(_),onTouchstart:v(S),onDblclick:v(w)},null,8,["class","onMousedown","onTouchstart","onDblclick"])):$("",!0)])]),_:3}),e.side==="right"?(k(),z(v(L),{key:0})):$("",!0),ie("div",G({id:l,ref_key:"el",ref:f},Z.$attrs,{"data-collapsed":v(c),"data-dragging":v(p),"data-slot":"root",class:B.value.root({class:[t.ui?.root,t.class]}),style:{"--width":`${v(u)||0}${v(h).unit}`}}),[i.header?(k(),j("div",{key:0,"data-slot":"header",class:H(B.value.header({class:t.ui?.header}))},[Y(Z.$slots,"header",{collapsed:v(c),collapse:v(d)})],2)):$("",!0),ie("div",{"data-slot":"body",class:H(B.value.body({class:t.ui?.body}))},[Y(Z.$slots,"default",{collapsed:v(c),collapse:v(d)})],2),i.footer?(k(),j("div",{key:1,"data-slot":"footer",class:H(B.value.footer({class:t.ui?.footer}))},[Y(Z.$slots,"footer",{collapsed:v(c),collapse:v(d)})],2)):$("",!0)],16,Jl),e.side==="left"?(k(),z(v(L),{key:1})):$("",!0),O(v(E),G({open:s.value,"onUpdate:open":V[0]||(V[0]=A=>s.value=A),title:v(o)("dashboardSidebar.title"),description:v(o)("dashboardSidebar.description")},W.value,{ui:{overlay:B.value.overlay({class:t.ui?.overlay}),content:B.value.content({class:t.ui?.content})}}),{content:T(A=>[Y(Z.$slots,"content",Et(Lt(A)),()=>[i.header||e.mode!=="drawer"?(k(),j("div",{key:0,"data-slot":"header",class:H(B.value.header({class:t.ui?.header,menu:!0}))},[e.mode!=="drawer"&&e.toggleSide==="left"?(k(),z(v(x),{key:0})):$("",!0),Y(Z.$slots,"header"),e.mode!=="drawer"&&e.toggleSide==="right"?(k(),z(v(x),{key:1})):$("",!0)],2)):$("",!0),ie("div",{"data-slot":"body",class:H(B.value.body({class:t.ui?.body,menu:!0}))},[Y(Z.$slots,"default")],2),i.footer?(k(),j("div",{key:1,"data-slot":"footer",class:H(B.value.footer({class:t.ui?.footer,menu:!0}))},[Y(Z.$slots,"footer")],2)):$("",!0)])]),_:3},16,["open","title","description","ui"])],64))}});function pt(e){return Array.isArray?Array.isArray(e):co(e)==="[object Array]"}function Ql(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function eh(e){return e==null?"":Ql(e)}function rt(e){return typeof e=="string"}function lo(e){return typeof e=="number"}function th(e){return e===!0||e===!1||ih(e)&&co(e)=="[object Boolean]"}function ho(e){return typeof e=="object"}function ih(e){return ho(e)&&e!==null}function qe(e){return e!=null}function gs(e){return!e.trim().length}function co(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const sh="Incorrect 'index' type",rh=e=>`Invalid value for key ${e}`,nh=e=>`Pattern length exceeds max of ${e}.`,oh=e=>`Missing ${e} property in key`,ah=e=>`Property 'weight' in key '${e}' must be a positive integer`,Kr=Object.prototype.hasOwnProperty;class lh{constructor(t){this._keys=[],this._keyMap={};let i=0;t.forEach(s=>{let r=uo(s);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(s=>{s.weight/=i})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function uo(e){let t=null,i=null,s=null,r=1,n=null;if(rt(e)||pt(e))s=e,t=Ur(e),i=As(e);else{if(!Kr.call(e,"name"))throw new Error(oh("name"));const o=e.name;if(s=o,Kr.call(e,"weight")&&(r=e.weight,r<=0))throw new Error(ah(o));t=Ur(o),i=As(o),n=e.getFn}return{path:t,id:i,weight:r,src:s,getFn:n}}function Ur(e){return pt(e)?e:e.split(".")}function As(e){return pt(e)?e.join("."):e}function hh(e,t){let i=[],s=!1;const r=(n,o,a)=>{if(qe(n))if(!o[a])i.push(n);else{let h=o[a];const l=n[h];if(!qe(l))return;if(a===o.length-1&&(rt(l)||lo(l)||th(l)))i.push(eh(l));else if(pt(l)){s=!0;for(let f=0,u=l.length;f<u;f+=1)r(l[f],o,a+1)}else o.length&&r(l,o,a+1)}};return r(e,rt(t)?t.split("."):t,0),s?i:i[0]}const ch={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},uh={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},dh={location:0,threshold:.6,distance:100},fh={useExtendedSearch:!1,getFn:hh,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var q={...uh,...ch,...dh,...fh};const _h=/[^ ]+/g;function ph(e=1,t=3){const i=new Map,s=Math.pow(10,t);return{get(r){const n=r.match(_h).length;if(i.has(n))return i.get(n);const o=1/Math.pow(n,.5*e),a=parseFloat(Math.round(o*s)/s);return i.set(n,a),a},clear(){i.clear()}}}class Mr{constructor({getFn:t=q.getFn,fieldNormWeight:i=q.fieldNormWeight}={}){this.norm=ph(i,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((i,s)=>{this._keysMap[i.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,rt(this.docs[0])?this.docs.forEach((t,i)=>{this._addString(t,i)}):this.docs.forEach((t,i)=>{this._addObject(t,i)}),this.norm.clear())}add(t){const i=this.size();rt(t)?this._addString(t,i):this._addObject(t,i)}removeAt(t){this.records.splice(t,1);for(let i=t,s=this.size();i<s;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(t,i){return t[this._keysMap[i]]}size(){return this.records.length}_addString(t,i){if(!qe(t)||gs(t))return;let s={v:t,i,n:this.norm.get(t)};this.records.push(s)}_addObject(t,i){let s={i,$:{}};this.keys.forEach((r,n)=>{let o=r.getFn?r.getFn(t):this.getFn(t,r.path);if(qe(o)){if(pt(o)){let a=[];const h=[{nestedArrIndex:-1,value:o}];for(;h.length;){const{nestedArrIndex:l,value:f}=h.pop();if(qe(f))if(rt(f)&&!gs(f)){let u={v:f,i:l,n:this.norm.get(f)};a.push(u)}else pt(f)&&f.forEach((u,d)=>{h.push({nestedArrIndex:d,value:u})})}s.$[n]=a}else if(rt(o)&&!gs(o)){let a={v:o,n:this.norm.get(o)};s.$[n]=a}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function fo(e,t,{getFn:i=q.getFn,fieldNormWeight:s=q.fieldNormWeight}={}){const r=new Mr({getFn:i,fieldNormWeight:s});return r.setKeys(e.map(uo)),r.setSources(t),r.create(),r}function gh(e,{getFn:t=q.getFn,fieldNormWeight:i=q.fieldNormWeight}={}){const{keys:s,records:r}=e,n=new Mr({getFn:t,fieldNormWeight:i});return n.setKeys(s),n.setIndexRecords(r),n}function Mi(e,{errors:t=0,currentLocation:i=0,expectedLocation:s=0,distance:r=q.distance,ignoreLocation:n=q.ignoreLocation}={}){const o=t/e.length;if(n)return o;const a=Math.abs(s-i);return r?o+a/r:a?1:o}function vh(e=[],t=q.minMatchCharLength){let i=[],s=-1,r=-1,n=0;for(let o=e.length;n<o;n+=1){let a=e[n];a&&s===-1?s=n:!a&&s!==-1&&(r=n-1,r-s+1>=t&&i.push([s,r]),s=-1)}return e[n-1]&&n-s>=t&&i.push([s,n-1]),i}const It=32;function mh(e,t,i,{location:s=q.location,distance:r=q.distance,threshold:n=q.threshold,findAllMatches:o=q.findAllMatches,minMatchCharLength:a=q.minMatchCharLength,includeMatches:h=q.includeMatches,ignoreLocation:l=q.ignoreLocation}={}){if(t.length>It)throw new Error(nh(It));const f=t.length,u=e.length,d=Math.max(0,Math.min(s,u));let c=n,p=d;const _=a>1||h,S=_?Array(u):[];let w;for(;(w=e.indexOf(t,p))>-1;){let E=Mi(t,{currentLocation:w,expectedLocation:d,distance:r,ignoreLocation:l});if(c=Math.min(E,c),p=w+f,_){let W=0;for(;W<f;)S[w+W]=1,W+=1}}p=-1;let y=[],x=1,g=f+u;const L=1<<f-1;for(let E=0;E<f;E+=1){let W=0,U=g;for(;W<U;)Mi(t,{errors:E,currentLocation:d+U,expectedLocation:d,distance:r,ignoreLocation:l})<=c?W=U:g=U,U=Math.floor((g-W)/2+W);g=U;let Z=Math.max(1,d-U+1),V=o?u:Math.min(d+U,u)+f,A=Array(V+2);A[V+1]=(1<<E)-1;for(let M=V;M>=Z;M-=1){let m=M-1,I=i[e.charAt(m)];if(_&&(S[m]=+!!I),A[M]=(A[M+1]<<1|1)&I,E&&(A[M]|=(y[M+1]|y[M])<<1|1|y[M+1]),A[M]&L&&(x=Mi(t,{errors:E,currentLocation:m,expectedLocation:d,distance:r,ignoreLocation:l}),x<=c)){if(c=x,p=m,p<=d)break;Z=Math.max(1,2*d-p)}}if(Mi(t,{errors:E+1,currentLocation:d,expectedLocation:d,distance:r,ignoreLocation:l})>c)break;y=A}const B={isMatch:p>=0,score:Math.max(.001,x)};if(_){const E=vh(S,a);E.length?h&&(B.indices=E):B.isMatch=!1}return B}function Sh(e){let t={};for(let i=0,s=e.length;i<s;i+=1){const r=e.charAt(i);t[r]=(t[r]||0)|1<<s-i-1}return t}const Ji=String.prototype.normalize?(e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(e=>e);class _o{constructor(t,{location:i=q.location,threshold:s=q.threshold,distance:r=q.distance,includeMatches:n=q.includeMatches,findAllMatches:o=q.findAllMatches,minMatchCharLength:a=q.minMatchCharLength,isCaseSensitive:h=q.isCaseSensitive,ignoreDiacritics:l=q.ignoreDiacritics,ignoreLocation:f=q.ignoreLocation}={}){if(this.options={location:i,threshold:s,distance:r,includeMatches:n,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:h,ignoreDiacritics:l,ignoreLocation:f},t=h?t:t.toLowerCase(),t=l?Ji(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const u=(c,p)=>{this.chunks.push({pattern:c,alphabet:Sh(c),startIndex:p})},d=this.pattern.length;if(d>It){let c=0;const p=d%It,_=d-p;for(;c<_;)u(this.pattern.substr(c,It),c),c+=It;if(p){const S=d-It;u(this.pattern.substr(S),S)}}else u(this.pattern,0)}searchIn(t){const{isCaseSensitive:i,ignoreDiacritics:s,includeMatches:r}=this.options;if(t=i?t:t.toLowerCase(),t=s?Ji(t):t,this.pattern===t){let _={isMatch:!0,score:0};return r&&(_.indices=[[0,t.length-1]]),_}const{location:n,distance:o,threshold:a,findAllMatches:h,minMatchCharLength:l,ignoreLocation:f}=this.options;let u=[],d=0,c=!1;this.chunks.forEach(({pattern:_,alphabet:S,startIndex:w})=>{const{isMatch:y,score:x,indices:g}=mh(t,_,S,{location:n+w,distance:o,threshold:a,findAllMatches:h,minMatchCharLength:l,includeMatches:r,ignoreLocation:f});y&&(c=!0),d+=x,y&&g&&(u=[...u,...g])});let p={isMatch:c,score:c?d/this.chunks.length:1};return c&&r&&(p.indices=u),p}}class Rt{constructor(t){this.pattern=t}static isMultiMatch(t){return Vr(t,this.multiRegex)}static isSingleMatch(t){return Vr(t,this.singleRegex)}search(){}}function Vr(e,t){const i=e.match(t);return i?i[1]:null}class bh extends Rt{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const i=t===this.pattern;return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class yh extends Rt{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const s=t.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class wh extends Rt{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const i=t.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class Ch extends Rt{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const i=!t.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,t.length-1]}}}class kh extends Rt{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const i=t.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class xh extends Rt{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const i=!t.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,t.length-1]}}}class po extends Rt{constructor(t,{location:i=q.location,threshold:s=q.threshold,distance:r=q.distance,includeMatches:n=q.includeMatches,findAllMatches:o=q.findAllMatches,minMatchCharLength:a=q.minMatchCharLength,isCaseSensitive:h=q.isCaseSensitive,ignoreDiacritics:l=q.ignoreDiacritics,ignoreLocation:f=q.ignoreLocation}={}){super(t),this._bitapSearch=new _o(t,{location:i,threshold:s,distance:r,includeMatches:n,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:h,ignoreDiacritics:l,ignoreLocation:f})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class go extends Rt{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let i=0,s;const r=[],n=this.pattern.length;for(;(s=t.indexOf(this.pattern,i))>-1;)i=s+n,r.push([s,i-1]);const o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}const Ps=[bh,go,wh,Ch,xh,kh,yh,po],jr=Ps.length,Eh=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Lh="|";function Bh(e,t={}){return e.split(Lh).map(i=>{let s=i.trim().split(Eh).filter(n=>n&&!!n.trim()),r=[];for(let n=0,o=s.length;n<o;n+=1){const a=s[n];let h=!1,l=-1;for(;!h&&++l<jr;){const f=Ps[l];let u=f.isMultiMatch(a);u&&(r.push(new f(u,t)),h=!0)}if(!h)for(l=-1;++l<jr;){const f=Ps[l];let u=f.isSingleMatch(a);if(u){r.push(new f(u,t));break}}}return r})}const Dh=new Set([po.type,go.type]);class Mh{constructor(t,{isCaseSensitive:i=q.isCaseSensitive,ignoreDiacritics:s=q.ignoreDiacritics,includeMatches:r=q.includeMatches,minMatchCharLength:n=q.minMatchCharLength,ignoreLocation:o=q.ignoreLocation,findAllMatches:a=q.findAllMatches,location:h=q.location,threshold:l=q.threshold,distance:f=q.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:s,includeMatches:r,minMatchCharLength:n,findAllMatches:a,ignoreLocation:o,location:h,threshold:l,distance:f},t=i?t:t.toLowerCase(),t=s?Ji(t):t,this.pattern=t,this.query=Bh(this.pattern,this.options)}static condition(t,i){return i.useExtendedSearch}searchIn(t){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:r,ignoreDiacritics:n}=this.options;t=r?t:t.toLowerCase(),t=n?Ji(t):t;let o=0,a=[],h=0;for(let l=0,f=i.length;l<f;l+=1){const u=i[l];a.length=0,o=0;for(let d=0,c=u.length;d<c;d+=1){const p=u[d],{isMatch:_,indices:S,score:w}=p.search(t);if(_){if(o+=1,h+=w,s){const y=p.constructor.type;Dh.has(y)?a=[...a,...S]:a.push(S)}}else{h=0,o=0,a.length=0;break}}if(o){let d={isMatch:!0,score:h/o};return s&&(d.indices=a),d}}return{isMatch:!1,score:1}}}const Is=[];function Rh(...e){Is.push(...e)}function Os(e,t){for(let i=0,s=Is.length;i<s;i+=1){let r=Is[i];if(r.condition(e,t))return new r(e,t)}return new _o(e,t)}const Zi={AND:"$and",OR:"$or"},Ns={PATH:"$path",PATTERN:"$val"},zs=e=>!!(e[Zi.AND]||e[Zi.OR]),Th=e=>!!e[Ns.PATH],Ah=e=>!pt(e)&&ho(e)&&!zs(e),Yr=e=>({[Zi.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function vo(e,t,{auto:i=!0}={}){const s=r=>{let n=Object.keys(r);const o=Th(r);if(!o&&n.length>1&&!zs(r))return s(Yr(r));if(Ah(r)){const h=o?r[Ns.PATH]:n[0],l=o?r[Ns.PATTERN]:r[h];if(!rt(l))throw new Error(rh(h));const f={keyId:As(h),pattern:l};return i&&(f.searcher=Os(l,t)),f}let a={children:[],operator:n[0]};return n.forEach(h=>{const l=r[h];pt(l)&&l.forEach(f=>{a.children.push(s(f))})}),a};return zs(e)||(e=Yr(e)),s(e)}function Ph(e,{ignoreFieldNorm:t=q.ignoreFieldNorm}){e.forEach(i=>{let s=1;i.matches.forEach(({key:r,norm:n,score:o})=>{const a=r?r.weight:null;s*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(t?1:n))}),i.score=s})}function Ih(e,t){const i=e.matches;t.matches=[],qe(i)&&i.forEach(s=>{if(!qe(s.indices)||!s.indices.length)return;const{indices:r,value:n}=s;let o={indices:r,value:n};s.key&&(o.key=s.key.src),s.idx>-1&&(o.refIndex=s.idx),t.matches.push(o)})}function Oh(e,t){t.score=e.score}function Nh(e,t,{includeMatches:i=q.includeMatches,includeScore:s=q.includeScore}={}){const r=[];return i&&r.push(Ih),s&&r.push(Oh),e.map(n=>{const{idx:o}=n,a={item:t[o],refIndex:o};return r.length&&r.forEach(h=>{h(n,a)}),a})}class ti{constructor(t,i={},s){this.options={...q,...i},this.options.useExtendedSearch,this._keyStore=new lh(this.options.keys),this.setCollection(t,s)}setCollection(t,i){if(this._docs=t,i&&!(i instanceof Mr))throw new Error(sh);this._myIndex=i||fo(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){qe(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const i=[];for(let s=0,r=this._docs.length;s<r;s+=1){const n=this._docs[s];t(n,s)&&(this.removeAt(s),s-=1,r-=1,i.push(n))}return i}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:i=-1}={}){const{includeMatches:s,includeScore:r,shouldSort:n,sortFn:o,ignoreFieldNorm:a}=this.options;let h=rt(t)?rt(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return Ph(h,{ignoreFieldNorm:a}),n&&h.sort(o),lo(i)&&i>-1&&(h=h.slice(0,i)),Nh(h,this._docs,{includeMatches:s,includeScore:r})}_searchStringList(t){const i=Os(t,this.options),{records:s}=this._myIndex,r=[];return s.forEach(({v:n,i:o,n:a})=>{if(!qe(n))return;const{isMatch:h,score:l,indices:f}=i.searchIn(n);h&&r.push({item:n,idx:o,matches:[{score:l,value:n,norm:a,indices:f}]})}),r}_searchLogical(t){const i=vo(t,this.options),s=(a,h,l)=>{if(!a.children){const{keyId:u,searcher:d}=a,c=this._findMatches({key:this._keyStore.get(u),value:this._myIndex.getValueForItemAtKeyId(h,u),searcher:d});return c&&c.length?[{idx:l,item:h,matches:c}]:[]}const f=[];for(let u=0,d=a.children.length;u<d;u+=1){const c=a.children[u],p=s(c,h,l);if(p.length)f.push(...p);else if(a.operator===Zi.AND)return[]}return f},r=this._myIndex.records,n={},o=[];return r.forEach(({$:a,i:h})=>{if(qe(a)){let l=s(i,a,h);l.length&&(n[h]||(n[h]={idx:h,item:a,matches:[]},o.push(n[h])),l.forEach(({matches:f})=>{n[h].matches.push(...f)}))}}),o}_searchObjectList(t){const i=Os(t,this.options),{keys:s,records:r}=this._myIndex,n=[];return r.forEach(({$:o,i:a})=>{if(!qe(o))return;let h=[];s.forEach((l,f)=>{h.push(...this._findMatches({key:l,value:o[f],searcher:i}))}),h.length&&n.push({idx:a,item:o,matches:h})}),n}_findMatches({key:t,value:i,searcher:s}){if(!qe(i))return[];let r=[];if(pt(i))i.forEach(({v:n,i:o,n:a})=>{if(!qe(n))return;const{isMatch:h,score:l,indices:f}=s.searchIn(n);h&&r.push({score:l,key:t,value:n,idx:o,norm:a,indices:f})});else{const{v:n,n:o}=i,{isMatch:a,score:h,indices:l}=s.searchIn(n);a&&r.push({score:h,key:t,value:n,norm:o,indices:l})}return r}}ti.version="7.1.0";ti.createIndex=fo;ti.parseIndex=gh;ti.config=q;ti.parseQuery=vo;Rh(Mh);function zh(e,t,i){const s=()=>{var n,o;return new ti((n=dt(t))!==null&&n!==void 0?n:[],(o=dt(i))===null||o===void 0?void 0:o.fuseOptions)},r=J(s());return Ce(()=>{var n;return(n=dt(i))===null||n===void 0?void 0:n.fuseOptions},()=>{r.value=s()},{deep:!0}),Ce(()=>dt(t),n=>{r.value.setCollection(n)},{deep:!0}),{fuse:r,results:te(()=>{const n=dt(i);if(n?.matchAllWhenSearchEmpty&&!dt(e))return dt(t).map((a,h)=>({item:a,refIndex:h}));const o=n?.resultLimit;return r.value.search(dt(e),o?{limit:o}:void 0)})}}function Fh(e,t){let i="",s=0,r=!1;for(let n=e.length-1;n>=0;n--){if(e[n]===">")r=!0;else if(e[n]==="<"){r=!1,i=e[n]+i;continue}if(r||s++,s<=t)i=e[n]+i;else{i="..."+i;break}}return i}function Gr(e,t,i,s){function r(n,o=[]){n=n||"";let a="",h=0;o.forEach(f=>{if(f.length===2&&f[0]===f[1])return;const u=f[1]+1,d=u-f[0]>=t.length;a+=[n.substring(h,f[0]),d&&"<mark>",n.substring(f[0],u),d&&"</mark>"].filter(Boolean).join(""),h=u}),a+=n.substring(h);const l=a.indexOf("<mark>");return l!==-1&&(a=Fh(a,a.length-l)),a}if(e.matches?.length){for(const n of e.matches)if(!(i&&n.key!==i)&&!s?.includes(n.key))return r(n.value,n.indices)}}const Hh={slots:{root:"flex flex-col min-h-0 min-w-0 divide-y divide-default",input:"[&>input]:h-12",close:"",back:"p-0",content:"relative overflow-hidden flex flex-col",footer:"p-1",viewport:"relative scroll-py-1 overflow-y-auto flex-1 focus:outline-none",group:"p-1 isolate",empty:"py-6 text-center text-sm text-muted",label:"p-1.5 text-xs font-semibold text-highlighted",item:"group relative w-full flex items-start gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75",itemLeadingIcon:"shrink-0 size-5",itemLeadingAvatar:"shrink-0",itemLeadingAvatarSize:"2xs",itemLeadingChip:"shrink-0 size-5",itemLeadingChipSize:"md",itemTrailing:"ms-auto inline-flex gap-1.5 items-center",itemTrailingIcon:"shrink-0 size-5",itemTrailingHighlightedIcon:"shrink-0 size-5 text-dimmed hidden group-data-highlighted:inline-flex",itemTrailingKbds:"hidden lg:inline-flex items-center shrink-0 gap-0.5",itemTrailingKbdsSize:"md",itemWrapper:"flex-1 flex flex-col text-start min-w-0",itemLabel:"truncate space-x-1 text-dimmed",itemDescription:"truncate text-muted",itemLabelBase:"text-highlighted [&>mark]:text-inverted [&>mark]:bg-primary",itemLabelPrefix:"text-default",itemLabelSuffix:"text-dimmed [&>mark]:text-inverted [&>mark]:bg-primary"},variants:{virtualize:{true:{viewport:"p-1 isolate"},false:{viewport:"divide-y divide-default"}},active:{true:{item:"text-highlighted before:bg-elevated",itemLeadingIcon:"text-default"},false:{item:["text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50","transition-colors before:transition-colors"],itemLeadingIcon:["text-dimmed group-data-highlighted:not-group-data-disabled:text-default","transition-colors"]}},loading:{true:{itemLeadingIcon:"animate-spin"}}}},$h=["innerHTML"],Wh=["innerHTML"],qh=Object.assign({inheritAttrs:!1},{__name:"UCommandPalette",props:Xi({as:{type:null,required:!1},icon:{type:null,required:!1},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},childrenIcon:{type:null,required:!1},placeholder:{type:String,required:!1},autofocus:{type:Boolean,required:!1,default:!0},close:{type:[Boolean,Object],required:!1},closeIcon:{type:null,required:!1},back:{type:[Boolean,Object],required:!1,default:!0},backIcon:{type:null,required:!1},groups:{type:Array,required:!1},fuse:{type:Object,required:!1},virtualize:{type:[Boolean,Object],required:!1,default:!1},labelKey:{type:null,required:!1,default:"label"},descriptionKey:{type:null,required:!1,default:"description"},preserveGroupOrder:{type:Boolean,required:!1,default:!1},class:{type:null,required:!1},ui:{type:null,required:!1},multiple:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},modelValue:{type:null,required:!1,default:""},defaultValue:{type:null,required:!1},highlightOnHover:{type:Boolean,required:!1,default:!0},selectionBehavior:{type:String,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:""},searchTermModifiers:{}}),emits:Xi(["update:modelValue","highlight","entryFocus","leave","update:open"],["update:searchTerm"]),setup(e,{emit:t}){const i=e,s=t,r=ei(),n=vi(e,"searchTerm",{type:String,default:""}),{t:o}=ns(),a=$t(),h=gi(zt(i,"as","disabled","multiple","modelValue","defaultValue","highlightOnHover"),s),l=Yi(zt(i,"loading")),f=ot(()=>i.virtualize?Mt(typeof i.virtualize=="boolean"?{}:i.virtualize,{estimateSize:il(E.value,"md",i.descriptionKey)}):!1),[u,d]=Zt({props:{item:{type:Object,required:!0},group:{type:Object,required:!1},index:{type:Number,required:!1}}}),c=te(()=>Ne({extend:Ne(Hh),...a.ui?.commandPalette||{}})({virtualize:!!i.virtualize})),p=te(()=>Mt({},i.fuse,{fuseOptions:{ignoreLocation:!0,threshold:.1,keys:[i.labelKey,"suffix"]},resultLimit:12,matchAllWhenSearchEmpty:!0})),_=J([]),S=te(()=>_.value[_.value.length-1]?.placeholder||i.placeholder||o("commandPalette.placeholder")),w=te(()=>_.value?.length?[_.value[_.value.length-1]]:i.groups),y=te(()=>w.value?.filter(b=>b.id?!b.ignoreFilter:(console.warn("[@nuxt/ui] CommandPalette group is missing an `id` property"),!1))?.flatMap(b=>b.items?.map(M=>({...M,group:b.id}))||[])||[]),{results:x}=zh(n,y,p),g=Ea(x,16,!0);function L(b,M){let m=M;return b?.postFilter&&typeof b.postFilter=="function"&&(m=b.postFilter(n.value,m)),{...b,items:m.slice(0,p.value.resultLimit).map(I=>({...I,labelHtml:Gr(I,n.value,i.labelKey),suffixHtml:Gr(I,n.value,void 0,[i.labelKey])}))}}const B=te(()=>{const b=w.value,M=g.value.reduce((R,D)=>{const{item:X,matches:se}=D;return X.group&&(R[X.group]||=[],R[X.group]?.push({...X,matches:se})),R},{});if(i.preserveGroupOrder){const R=[];for(const D of b||[]){if(!D.items?.length)continue;const X=D.ignoreFilter?D.items:M[D.id];if(!X?.length)continue;const se=L(D,X);se.items?.length&&R.push(se)}return R}const m=Object.entries(M).map(([R,D])=>{const X=b?.find(Ee=>Ee.id===R);if(!X)return;const se=L(X,D);return se.items?.length?se:void 0}).filter(R=>!!R);return(b?.map((R,D)=>({...R,index:D}))?.filter(R=>R.ignoreFilter&&R.items?.length)?.map(R=>({...L(R,R.items||[]),index:R.index}))?.filter(R=>R.items?.length)||[]).reduce((R,D)=>(R.splice(D.index,0,D),R),[...m])}),E=te(()=>B.value.flatMap(b=>b.items||[])),W=Qn("rootRef");function U(b){b.children?.length&&(_.value.push({id:`history-${_.value.length}`,label:b.label,slot:b.slot,placeholder:b.placeholder,items:b.children}),n.value="",W.value?.highlightFirstItem())}function Z(){_.value.length&&(_.value.pop(),n.value="",W.value?.highlightFirstItem())}function V(){n.value||Z()}function A(b,M){M.children?.length?(b.preventDefault(),U(M)):M.onSelect?.(b)}return(b,M)=>(k(),j(ke,null,[O(v(u),null,{default:T(({item:m,index:I,group:R})=>[O(v(sl),{value:v(Gi)(m,["matches","group","onSelect","labelHtml","suffixHtml","children"]),disabled:m.disabled,"as-child":"",onSelect:D=>A(D,m)},{default:T(()=>[O(Ni,G(v(zi)(m),{custom:""}),{default:T(({active:D,...X})=>[O(Yt,G(X,{"data-slot":"item",class:c.value.item({class:[i.ui?.item,m.ui?.item,m.class],active:D||m.active})}),{default:T(()=>[Y(b.$slots,m.slot||R?.slot||"item",{item:m,index:I,ui:c.value},()=>[Y(b.$slots,m.slot?`${m.slot}-leading`:R?.slot?`${R.slot}-leading`:"item-leading",{item:m,index:I,ui:c.value},()=>[m.loading?(k(),z(De,{key:0,name:e.loadingIcon||v(a).ui.icons.loading,"data-slot":"itemLeadingIcon",class:H(c.value.itemLeadingIcon({class:[i.ui?.itemLeadingIcon,m.ui?.itemLeadingIcon],loading:!0}))},null,8,["name","class"])):m.icon?(k(),z(De,{key:1,name:m.icon,"data-slot":"itemLeadingIcon",class:H(c.value.itemLeadingIcon({class:[i.ui?.itemLeadingIcon,m.ui?.itemLeadingIcon],active:D||m.active}))},null,8,["name","class"])):m.avatar?(k(),z(kr,G({key:2,size:m.ui?.itemLeadingAvatarSize||i.ui?.itemLeadingAvatarSize||c.value.itemLeadingAvatarSize()},m.avatar,{"data-slot":"itemLeadingAvatar",class:c.value.itemLeadingAvatar({class:[i.ui?.itemLeadingAvatar,m.ui?.itemLeadingAvatar],active:D||m.active})}),null,16,["size","class"])):m.chip?(k(),z(La,G({key:3,size:m.ui?.itemLeadingChipSize||i.ui?.itemLeadingChipSize||c.value.itemLeadingChipSize(),inset:"",standalone:""},m.chip,{"data-slot":"itemLeadingChip",class:c.value.itemLeadingChip({class:[i.ui?.itemLeadingChip,m.ui?.itemLeadingChip],active:D||m.active})}),null,16,["size","class"])):$("",!0)]),m.prefix||m.labelHtml||v(Oe)(m,i.labelKey)||m.suffixHtml||m.suffix||r[m.slot?`${m.slot}-label`:R?.slot?`${R.slot}-label`:"item-label"]||v(Oe)(m,i.descriptionKey)||r[m.slot?`${m.slot}-description`:R?.slot?`${R.slot}-description`:"item-description"]?(k(),j("span",{key:0,"data-slot":"itemWrapper",class:H(c.value.itemWrapper({class:[i.ui?.itemWrapper,m.ui?.itemWrapper]}))},[ie("span",{"data-slot":"itemLabel",class:H(c.value.itemLabel({class:[i.ui?.itemLabel,m.ui?.itemLabel],active:D||m.active}))},[Y(b.$slots,m.slot?`${m.slot}-label`:R?.slot?`${R.slot}-label`:"item-label",{item:m,index:I,ui:c.value},()=>[m.prefix?(k(),j("span",{key:0,"data-slot":"itemLabelPrefix",class:H(c.value.itemLabelPrefix({class:[i.ui?.itemLabelPrefix,m.ui?.itemLabelPrefix]}))},Me(m.prefix),3)):$("",!0),m.labelHtml?(k(),j("span",{key:1,"data-slot":"itemLabelBase",class:H(c.value.itemLabelBase({class:[i.ui?.itemLabelBase,m.ui?.itemLabelBase],active:D||m.active})),innerHTML:m.labelHtml},null,10,$h)):(k(),j("span",{key:2,"data-slot":"itemLabelBase",class:H(c.value.itemLabelBase({class:[i.ui?.itemLabelBase,m.ui?.itemLabelBase],active:D||m.active}))},Me(v(Oe)(m,i.labelKey)),3)),m.suffixHtml?(k(),j("span",{key:3,"data-slot":"itemLabelSuffix",class:H(c.value.itemLabelSuffix({class:[i.ui?.itemLabelSuffix,m.ui?.itemLabelSuffix],active:D||m.active})),innerHTML:m.suffixHtml},null,10,Wh)):m.suffix?(k(),j("span",{key:4,"data-slot":"itemLabelSuffix",class:H(c.value.itemLabelSuffix({class:[i.ui?.itemLabelSuffix,m.ui?.itemLabelSuffix],active:D||m.active}))},Me(m.suffix),3)):$("",!0)])],2),v(Oe)(m,i.descriptionKey)?(k(),j("span",{key:0,"data-slot":"itemDescription",class:H(c.value.itemDescription({class:[i.ui?.itemDescription,m.ui?.itemDescription]}))},[Y(b.$slots,m.slot?`${m.slot}-description`:R?.slot?`${R.slot}-description`:"item-description",{item:m,index:I,ui:c.value},()=>[at(Me(v(Oe)(m,i.descriptionKey)),1)])],2)):$("",!0)],2)):$("",!0),ie("span",{"data-slot":"itemTrailing",class:H(c.value.itemTrailing({class:[i.ui?.itemTrailing,m.ui?.itemTrailing]}))},[Y(b.$slots,m.slot?`${m.slot}-trailing`:R?.slot?`${R.slot}-trailing`:"item-trailing",{item:m,index:I,ui:c.value},()=>[m.children&&m.children.length>0?(k(),z(De,{key:0,name:e.childrenIcon||v(a).ui.icons.chevronRight,"data-slot":"itemTrailingIcon",class:H(c.value.itemTrailingIcon({class:[i.ui?.itemTrailingIcon,m.ui?.itemTrailingIcon]}))},null,8,["name","class"])):m.kbds?.length?(k(),j("span",{key:1,"data-slot":"itemTrailingKbds",class:H(c.value.itemTrailingKbds({class:[i.ui?.itemTrailingKbds,m.ui?.itemTrailingKbds]}))},[(k(!0),j(ke,null,Ge(m.kbds,(se,Ee)=>(k(),z(xr,G({key:Ee,size:m.ui?.itemTrailingKbdsSize||i.ui?.itemTrailingKbdsSize||c.value.itemTrailingKbdsSize()},{ref_for:!0},typeof se=="string"?{value:se}:se),null,16,["size"]))),128))],2)):R?.highlightedIcon?(k(),z(De,{key:2,name:R.highlightedIcon,"data-slot":"itemTrailingHighlightedIcon",class:H(c.value.itemTrailingHighlightedIcon({class:[i.ui?.itemTrailingHighlightedIcon,m.ui?.itemTrailingHighlightedIcon]}))},null,8,["name","class"])):$("",!0)]),m.children?.length?$("",!0):(k(),z(v(rl),{key:0,"as-child":""},{default:T(()=>[O(De,{name:e.selectedIcon||v(a).ui.icons.check,"data-slot":"itemTrailingIcon",class:H(c.value.itemTrailingIcon({class:[i.ui?.itemTrailingIcon,m.ui?.itemTrailingIcon]}))},null,8,["name","class"])]),_:2},1024))],2)])]),_:2},1040,["class"])]),_:2},1040)]),_:2},1032,["value","disabled","onSelect"])]),_:3}),O(v(hl),G({...v(h),...b.$attrs},{ref_key:"rootRef",ref:W,"selection-behavior":e.selectionBehavior,"data-slot":"root",class:c.value.root({class:[i.ui?.root,i.class]})}),{default:T(()=>[O(v(nl),{modelValue:n.value,"onUpdate:modelValue":M[1]||(M[1]=m=>n.value=m),"as-child":""},{default:T(()=>[O(ul,G({placeholder:S.value,variant:"none",autofocus:e.autofocus},v(l),{"loading-icon":e.loadingIcon,"trailing-icon":e.trailingIcon,icon:e.icon||v(a).ui.icons.search,"data-slot":"input",class:c.value.input({class:i.ui?.input}),onKeydown:Yn(V,["backspace"])}),os({_:2},[_.value?.length&&(e.back||r.back)?{name:"leading",fn:T(()=>[Y(b.$slots,"back",{ui:c.value},()=>[O(Jt,G({icon:e.backIcon||v(a).ui.icons.arrowLeft,color:"neutral",variant:"link","aria-label":v(o)("commandPalette.back")},typeof e.back=="object"?e.back:{},{"data-slot":"back",class:c.value.back({class:i.ui?.back}),onClick:Z}),null,16,["icon","aria-label","class"])])]),key:"0"}:void 0,e.close||r.close?{name:"trailing",fn:T(()=>[Y(b.$slots,"close",{ui:c.value},()=>[e.close?(k(),z(Jt,G({key:0,icon:e.closeIcon||v(a).ui.icons.close,color:"neutral",variant:"ghost","aria-label":v(o)("commandPalette.close")},typeof e.close=="object"?e.close:{},{"data-slot":"close",class:c.value.close({class:i.ui?.close}),onClick:M[0]||(M[0]=m=>s("update:open",!1))}),null,16,["icon","aria-label","class"])):$("",!0)])]),key:"1"}:void 0]),1040,["placeholder","autofocus","loading-icon","trailing-icon","icon","class"])]),_:3},8,["modelValue"]),O(v(ol),{"data-slot":"content",class:H(c.value.content({class:i.ui?.content}))},{default:T(()=>[B.value?.length?(k(),j("div",{key:0,role:"presentation","data-slot":"viewport",class:H(c.value.viewport({class:i.ui?.viewport}))},[e.virtualize?(k(),z(v(al),G({key:0,options:E.value,"text-content":m=>v(Oe)(m,i.labelKey)},f.value),{default:T(({option:m,virtualItem:I})=>[O(v(d),{item:m,index:I.index},null,8,["item","index"])]),_:1},16,["options","text-content"])):(k(!0),j(ke,{key:1},Ge(B.value,m=>(k(),z(v(ll),{key:`group-${m.id}`,"data-slot":"group",class:H(c.value.group({class:i.ui?.group}))},{default:T(()=>[v(Oe)(m,i.labelKey)?(k(),z(v(yl),{key:0,"data-slot":"label",class:H(c.value.label({class:i.ui?.label}))},{default:T(()=>[at(Me(v(Oe)(m,i.labelKey)),1)]),_:2},1032,["class"])):$("",!0),(k(!0),j(ke,null,Ge(m.items,(I,R)=>(k(),z(v(d),{key:`group-${m.id}-${R}`,item:I,index:R,group:m},null,8,["item","index","group"]))),128))]),_:2},1032,["class"]))),128))],2)):(k(),j("div",{key:1,"data-slot":"empty",class:H(c.value.empty({class:i.ui?.empty}))},[Y(b.$slots,"empty",{searchTerm:n.value},()=>[at(Me(n.value?v(o)("commandPalette.noMatch",{searchTerm:n.value}):v(o)("commandPalette.noData")),1)])],2))]),_:3},8,["class"]),r.footer?(k(),j("div",{key:0,"data-slot":"footer",class:H(c.value.footer({class:i.ui?.footer}))},[Y(b.$slots,"footer",{ui:c.value})],2)):$("",!0)]),_:3},16,["selection-behavior","class"])],64))}}),Kh={slots:{modal:"",input:"[&>input]:text-base/5"},variants:{fullscreen:{false:{modal:"sm:max-w-3xl h-full sm:h-[28rem]"}}}},Uh=/^[^-]+.*-.*[^-]+$/,Vh=/^[^_]+.*_.*[^_]+$/,Xr=["arrowleft","arrowright","arrowup","arrowright","tab","escape","enter","backspace"];function vs(e){return/^[a-z]$/i.test(e)?`Key${e.toUpperCase()}`:/^\d$/.test(e)?`Digit${e}`:/^f\d+$/i.test(e)?e.toUpperCase():{space:"Space",enter:"Enter",escape:"Escape",tab:"Tab",backspace:"Backspace",delete:"Delete",arrowup:"ArrowUp",arrowdown:"ArrowDown",arrowleft:"ArrowLeft",arrowright:"ArrowRight"}[e.toLowerCase()]||e}function jh(e,t={}){const i=J([]),s=()=>{i.value.splice(0,i.value.length)},r=Ba(s,t.chainDelay??800),{macOS:n}=Wa(),o=Oa(),a=t.layoutIndependent??!1,h=Xr.map(d=>vs(d)),l=d=>{if(!d.key)return;const c=a?/^Key[A-Z]$/i.test(d.code):/^[a-z]{1}$/i.test(d.key),p=a?h.includes(d.code):Xr.includes(d.key.toLowerCase());let _;if(i.value.push(a?d.code:d.key),i.value.length>=2){_=i.value.slice(-2).join("-");for(const S of u.value.filter(w=>w.chained))if(S.key===_){S.enabled&&(d.preventDefault(),S.handler(d)),s();return}}for(const S of u.value.filter(w=>!w.chained)){if(a){if(d.code!==S.key)continue}else if(d.key.toLowerCase()!==S.key)continue;if(d.metaKey===S.metaKey&&d.ctrlKey===S.ctrlKey&&!((c||p)&&d.shiftKey!==S.shiftKey)){S.enabled&&(d.preventDefault(),S.handler(d)),s();return}}r()},f=te(()=>{const d=o.value?.tagName,c=o.value?.contentEditable;return d==="INPUT"||d==="TEXTAREA"||c==="true"||c==="plaintext-only"?o.value?.name||!0:!1}),u=te(()=>Object.entries(dt(e)).map(([d,c])=>{if(!c)return null;let p;d.includes("-")&&d!=="-"&&!d.includes("_")&&!d.match(Uh)?.length&&console.trace(`[Shortcut] Invalid key: "${d}"`),d.includes("_")&&d!=="_"&&!d.match(Vh)?.length&&console.trace(`[Shortcut] Invalid key: "${d}"`);const _=d.includes("-")&&d!=="-"&&!d.includes("_");if(_)a?p={key:d.split("-").map(y=>vs(y)).join("-"),metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1}:p={key:d.toLowerCase(),metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1};else{const w=d.toLowerCase().split("_").map(x=>x);let y=w.filter(x=>!["meta","command","ctrl","shift","alt","option"].includes(x)).join("_");a&&(y=vs(y)),p={key:y,metaKey:w.includes("meta")||w.includes("command"),ctrlKey:w.includes("ctrl"),shiftKey:w.includes("shift"),altKey:w.includes("alt")||w.includes("option")}}if(p.chained=_,!n.value&&p.metaKey&&!p.ctrlKey&&(p.metaKey=!1,p.ctrlKey=!0),typeof c=="function"?p.handler=c:typeof c=="object"&&(p={...p,handler:c.handler}),!p.handler)return console.trace("[Shortcut] Invalid value"),null;let S=!0;return c.usingInput?typeof c.usingInput=="string"&&(S=f.value===c.usingInput):S=!f.value,p.enabled=S,p}).filter(Boolean));return Na("keydown",l)}const Yh={__name:"UDashboardSearch",props:Xi({icon:{type:null,required:!1},placeholder:{type:String,required:!1},autofocus:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},shortcut:{type:String,required:!1,default:"meta_k"},groups:{type:Array,required:!1},fuse:{type:Object,required:!1},colorMode:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:void 0,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},overlay:{type:Boolean,required:!1},transition:{type:Boolean,required:!1},content:{type:Object,required:!1},dismissible:{type:Boolean,required:!1},fullscreen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0}},{open:{type:Boolean,default:!1},openModifiers:{},searchTerm:{type:String,default:""},searchTermModifiers:{}}),emits:["update:open","update:searchTerm"],setup(e,{expose:t}){const i=e,s=ei(),r=vi(e,"open",{type:Boolean,default:!1}),n=vi(e,"searchTerm",{type:String,default:""});Ts("dashboard:search:toggle",()=>{r.value=!r.value});const{t:o}=ns(),a=Da(),h=$t(),l=Yi(zt(i,"icon","placeholder","autofocus","loading","loadingIcon","close","closeIcon")),f=Yi(zt(i,"overlay","transition","content","dismissible","fullscreen","modal","portal")),u=()=>Gi(s,["content"]),d=te(()=>Mt({},i.fuse,{fuseOptions:{}})),c=te(()=>Ne({extend:Ne(Kh),...h.ui?.dashboardSearch||{}})({fullscreen:i.fullscreen})),p=te(()=>{const w=[];return w.push(...i.groups||[]),i.colorMode&&!a?.forced&&w.push({id:"theme",label:o("dashboardSearch.theme"),items:[{label:o("colorMode.system"),icon:h.ui.icons.system,active:a.preference==="system",onSelect:()=>{a.preference="system"}},{label:o("colorMode.light"),icon:h.ui.icons.light,active:a.preference==="light",onSelect:()=>{a.preference="light"}},{label:o("colorMode.dark"),icon:h.ui.icons.dark,active:a.preference==="dark",onSelect:()=>{a.preference="dark"}}]}),w}),_=Qn("commandPaletteRef");function S(w){w.disabled||(r.value=!1,n.value="")}return jh({[i.shortcut]:{usingInput:!0,handler:()=>r.value=!r.value}}),t({commandPaletteRef:_}),(w,y)=>(k(),z(Er,G({open:r.value,"onUpdate:open":y[2]||(y[2]=x=>r.value=x),title:e.title||v(o)("dashboardSearch.title"),description:e.description||v(o)("dashboardSearch.description")},v(f),{"data-slot":"modal",class:c.value.modal({class:[i.ui?.modal,i.class]})}),{content:T(x=>[Y(w.$slots,"content",Et(Lt(x)),()=>[O(qh,G({ref_key:"commandPaletteRef",ref:_,"search-term":n.value,"onUpdate:searchTerm":y[0]||(y[0]=g=>n.value=g)},v(l),{groups:p.value,fuse:d.value,ui:v(Jn)(v(Gi)(c.value,["modal"]),i.ui),"onUpdate:modelValue":S,"onUpdate:open":y[1]||(y[1]=g=>r.value=g)}),os({_:2},[Ge(u(),(g,L)=>({name:L,fn:T(B=>[Y(w.$slots,L,Et(Lt(B)))])}))]),1040,["search-term","groups","fuse","ui"])])]),_:3},16,["open","title","description","class"]))}};function Gh(){const e=J(""),t=Ma(e,300),i=J(!1),s=J({tasks:[],documents:[]});Ce(t,async n=>{if(!n||n.length<2){s.value={tasks:[],documents:[]};return}i.value=!0;try{const[o,a]=await Promise.all([$fetch("/api/tasks",{query:{search:n}}),$fetch("/api/documents",{query:{search:n}})]);s.value={tasks:o.data.slice(0,5),documents:a.data.slice(0,5)}}catch{s.value={tasks:[],documents:[]}}finally{i.value=!1}});function r(){e.value="",s.value={tasks:[],documents:[]}}return{searchTerm:e,loading:i,results:s,reset:r}}const Xh=ze({__name:"DashboardSearch",setup(e){const t=Ra(),i=Ta(),{searchTerm:s,loading:r,results:n,reset:o}=Gh(),a={todo:"i-lucide-circle",in_progress:"i-lucide-clock",done:"i-lucide-check-circle",blocked:"i-lucide-alert-circle"},h={1:"Low",2:"Medium",3:"High"},l=[{label:"Dashboard",icon:"i-lucide-layout-dashboard",to:"/dashboard",kbds:["G","D"]},{label:"Tasks",icon:"i-lucide-check-square",to:"/tasks",kbds:["G","T"]},{label:"Docs",icon:"i-lucide-file-text",to:"/docs",kbds:["G","O"]},{label:"Settings",icon:"i-lucide-settings",to:"/settings",kbds:["G","S"]}],f=[{label:"Create new document",icon:"i-lucide-file-plus",onSelect:()=>{t.push("/docs"),i.add({title:"Create a document",description:"Right-click in the file tree to create a new file",icon:"i-lucide-info"}),o()}},{label:"Add new task",icon:"i-lucide-plus-square",onSelect:()=>{t.push("/tasks?action=new"),o()}}],u=te(()=>{const d=[];return n.value.tasks.length&&d.push({id:"tasks",label:"Tasks",ignoreFilter:!0,items:n.value.tasks.map(c=>({label:c.title,icon:a[c.status]||"i-lucide-circle",suffix:c.project?.name||h[c.priority]||"",onSelect:()=>{t.push(`/tasks?selected=${c.id}`),o()}}))}),n.value.documents.length&&d.push({id:"documents",label:"Documents",ignoreFilter:!0,items:n.value.documents.map(c=>({label:c.title,icon:"i-lucide-file-text",suffix:c.path,onSelect:()=>{t.push(`/docs?path=${encodeURIComponent(c.path)}`),o()}}))}),d.push({id:"navigation",label:"Navigation",items:l}),d.push({id:"actions",label:"Actions",items:f,postFilter:(c,p)=>{if(!c)return p;const _=c.toLowerCase();return["new","create","add"].some(S=>_.includes(S))?p:[]}}),d});return(d,c)=>{const p=Yh;return k(),z(p,{"search-term":v(s),"onUpdate:searchTerm":c[0]||(c[0]=_=>mi(s)?s.value=_:null),groups:v(u),loading:v(r),placeholder:"Search tasks, docs, or type a command...",fuse:{resultLimit:10}},null,8,["search-term","groups","loading"])}}}),Jh=Object.assign(Xh,{__name:"SearchDashboardSearch"});var mo=Object.defineProperty,Zh=Object.getOwnPropertyDescriptor,Qh=(e,t)=>{for(var i in t)mo(e,i,{get:t[i],enumerable:!0})},ce=(e,t,i,s)=>{for(var r=s>1?void 0:s?Zh(t,i):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&mo(t,i,r),r},N=(e,t)=>(i,s)=>t(i,s,e),Jr="Terminal input",Fs={get:()=>Jr,set:e=>Jr=e},Zr="Too much output to announce, navigate to rows manually to read",Hs={get:()=>Zr,set:e=>Zr=e};function ec(e){return e.replace(/\r?\n/g,"\r")}function tc(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function ic(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function sc(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let r=e.clipboardData.getData("text/plain");So(r,t,i,s)}}function So(e,t,i,s){e=ec(e),e=tc(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function bo(e,t,i){let s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function Qr(e,t,i,s,r){bo(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function xt(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function ls(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let n=e[r];n>65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var rc=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){let n=e.charCodeAt(r++);56320<=n&&n<=57343?t[s++]=(this._interim-55296)*1024+n-56320+65536:(t[s++]=this._interim,t[s++]=n),this._interim=0}for(let n=r;n<i;++n){let o=e.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=i)return this._interim=o,s;let a=e.charCodeAt(n);56320<=a&&a<=57343?t[s++]=(o-55296)*1024+a-56320+65536:(t[s++]=o,t[s++]=a);continue}o!==65279&&(t[s++]=o)}return s}},nc=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r,n,o,a,h=0,l=0;if(this.interim[0]){let d=!1,c=this.interim[0];c&=(c&224)===192?31:(c&240)===224?15:7;let p=0,_;for(;(_=this.interim[++p]&63)&&p<4;)c<<=6,c|=_;let S=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,w=S-p;for(;l<w;){if(l>=i)return 0;if(_=e[l++],(_&192)!==128){l--,d=!0;break}else this.interim[p++]=_,c<<=6,c|=_&63}d||(S===2?c<128?l--:t[s++]=c:S===3?c<2048||c>=55296&&c<=57343||c===65279||(t[s++]=c):c<65536||c>1114111||(t[s++]=c)),this.interim.fill(0)}let f=i-4,u=l;for(;u<i;){for(;u<f&&!((r=e[u])&128)&&!((n=e[u+1])&128)&&!((o=e[u+2])&128)&&!((a=e[u+3])&128);)t[s++]=r,t[s++]=n,t[s++]=o,t[s++]=a,u+=4;if(r=e[u++],r<128)t[s++]=r;else if((r&224)===192){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(h=(r&31)<<6|n&63,h<128){u--;continue}t[s++]=h}else if((r&240)===224){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[u++],(o&192)!==128){u--;continue}if(h=(r&15)<<12|(n&63)<<6|o&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[s++]=h}else if((r&248)===240){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[u++],(o&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=o,s;if(a=e[u++],(a&192)!==128){u--;continue}if(h=(r&7)<<18|(n&63)<<12|(o&63)<<6|a&63,h<65536||h>1114111)continue;t[s++]=h}}return s}},yo="",Bt=" ",ki=class wo{constructor(){this.fg=0,this.bg=0,this.extended=new Qi}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new wo;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Qi=class Co{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Co(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Xe=class ko extends ki{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Qi,this.combinedData=""}static fromCharData(t){let i=new ko;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?xt(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},en="di$target",$s="di$dependencies",ms=new Map;function oc(e){return e[$s]||[]}function we(e){if(ms.has(e))return ms.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ac(t,i,r)};return t._id=e,ms.set(e,t),t}function ac(e,t,i){t[en]===t?t[$s].push({id:e,index:i}):(t[$s]=[{id:e,index:i}],t[en]=t)}var Te=we("BufferService"),xo=we("CoreMouseService"),qt=we("CoreService"),lc=we("CharsetService"),Rr=we("InstantiationService"),Eo=we("LogService"),Ae=we("OptionsService"),Lo=we("OscLinkService"),hc=we("UnicodeService"),xi=we("DecorationService"),Ws=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,n=new Xe,o=i.getTrimmedLength(),a=-1,h=-1,l=!1;for(let f=0;f<o;f++)if(!(h===-1&&!i.hasContent(f))){if(i.loadCell(f,n),n.hasExtendedAttrs()&&n.extended.urlId)if(h===-1){h=f,a=n.extended.urlId;continue}else l=n.extended.urlId!==a;else h!==-1&&(l=!0);if(l||h!==-1&&f===o-1){let u=this._oscLinkService.getLinkData(a)?.uri;if(u){let d={start:{x:h+1,y:e},end:{x:f+(!l&&f===o-1?1:0),y:e}},c=!1;if(!r?.allowNonHttpProtocols)try{let p=new URL(u);["http:","https:"].includes(p.protocol)||(c=!0)}catch{c=!0}c||s.push({text:u,range:d,activate:(p,_)=>r?r.activate(p,_,d):cc(p,_),hover:(p,_)=>r?.hover?.(p,_,d),leave:(p,_)=>r?.leave?.(p,_,d)})}l=!1,n.hasExtendedAttrs()&&n.extended.urlId?(h=f,a=n.extended.urlId):(h=-1,a=-1)}}t(s)}};Ws=ce([N(0,Te),N(1,Ae),N(2,Lo)],Ws);function cc(e,t){if(confirm(`Do you want to navigate to ${t}?
1
+ import{a as ze,Q as z,R as k,S as T,a4 as Y,V as G,C as v,a3 as ht,aR as Vn,aQ as da,e as J,a_ as gt,a1 as wi,aP as fa,$ as jn,c as te,y as wr,c1 as _a,T as O,a0 as Xt,bm as Yn,bG as pa,aJ as gi,c2 as ga,bf as Cr,a7 as $r,bU as Gn,bB as ji,a9 as $,q as Ci,G as j,ai as ke,aM as va,a5 as ma,f as Ce,k as kt,I as Xn,aB as Sa,ao as ei,O as Yi,P as ba,aC as ot,aT as Mt,L as ns,N as $t,al as Ne,W as Jt,aU as Jn,b8 as os,ab as ie,U as H,aj as Ge,b9 as Gi,aN as Et,aO as Lt,aI as zt,aK as ya,aL as wa,b7 as Ca,ax as kr,_ as De,Y as Oe,aa as at,ae as Me,au as Di,an as ka,ap as Ni,ba as zi,bb as Yt,aq as Xi,ar as vi,bg as Zn,X as xa,b as dt,c3 as Ea,aG as Qn,bV as La,aW as Ba,M as Da,c4 as Ma,am as Ra,ag as Ta,ak as mi,a2 as eo,bE as fs,c5 as _s,c6 as Aa,ac as Pa,n as Ia}from"./CvMqUdkl.js";import{c as Zt,g as Oa,h as Na}from"./HCCuOAgZ.js";import{u as to,a as za,b as Fa,_ as Ha,p as $a}from"./sdvIKLwS.js";import{_ as xr,u as Wa}from"./deSeNTOh.js";import{_ as io}from"./CW8xtqwN.js";import{_ as qa,c as Ka}from"./Bb1B0ntt.js";import{b as Wr,A as Ua,c as Va,d as qr}from"./BdCB2PoJ.js";import{u as ja}from"./Bn8loaeQ.js";import{u as so}from"./D2lmhTjQ.js";import{u as ro}from"./C6Y-ieo6.js";import{_ as Ya}from"./Zjvb5YJR.js";import{H as Ga,P as Xa}from"./DfpSaqgV.js";import{_ as Ja}from"./zBoPDS4z.js";import{_ as Za}from"./CB8_A8N4.js";import{_ as Qa}from"./NlScC3GW.js";import{_ as Er}from"./pkbwpgSD.js";import{_ as el}from"./DgPiIWA2.js";import{i as tl,L as il,a as sl,b as rl,c as nl,d as ol,e as al,f as ll,_ as hl}from"./DB3y_21M.js";import{g as cl}from"./BhOIdu3Z.js";import{_ as ul}from"./BaJEGr8G.js";import{_ as dl}from"./CnW8zyuA.js";import{u as fl,_ as _l,a as pl,b as gl}from"./hqpqUuXS.js";import{u as Lr}from"./DZ_azKLI.js";import{s as vl}from"./D2f7BlK2.js";import{u as ml}from"./BNlugvM3.js";import{u as Sl}from"./DpYns7cT.js";import"./Cow1TrPj.js";import"./DImdNj-F.js";import"./-2wkydbj.js";import"./C5nfaH9w.js";import"./D3V98LVR.js";import"./BJi2ZHtT.js";import"./CXuKrnTA.js";import"./Dkzqkzki.js";import"./WWNeb45u.js";import"./CJ85o8FK.js";import"./BJ_GgKV0.js";import"./CqiOV9n1.js";import"./B1gFtqXK.js";import"./CxJr4mB0.js";import"./B9Kd_0HK.js";import"./DAFasgHH.js";import"./DxR8g9So.js";import"./B_28CKij.js";import"./88opOQSr.js";import"./iik6CYzq.js";import"./B7-0ADn3.js";var bl=ze({__name:"ListboxGroupLabel",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,i=tl({id:""});return(s,r)=>(k(),z(v(ht),G(t,{id:v(i).id}),{default:T(()=>[Y(s.$slots,"default")]),_:3},16,["id"]))}}),yl=bl;const[Wt,wl]=Vn(["NavigationMenuRoot","NavigationMenuSub"],"NavigationMenuContext");var Cl=ze({__name:"NavigationMenuRoot",props:{modelValue:{type:String,required:!1,default:void 0},defaultValue:{type:String,required:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:"horizontal"},delayDuration:{type:Number,required:!1,default:200},skipDelayDuration:{type:Number,required:!1,default:300},disableClickTrigger:{type:Boolean,required:!1,default:!1},disableHoverTrigger:{type:Boolean,required:!1,default:!1},disablePointerLeaveClose:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"nav"}},emits:["update:modelValue"],setup(e,{emit:t}){const i=e,r=da(i,"modelValue",t,{defaultValue:i.defaultValue??"",passive:i.modelValue===void 0}),n=J(""),{forwardRef:o,currentElement:a}=gt(),h=J(),l=J(),f=J(),{getItems:u,CollectionSlot:d}=wi({key:"NavigationMenu",isProvider:!0}),{delayDuration:c,skipDelayDuration:p,dir:_,disableClickTrigger:S,disableHoverTrigger:w,unmountOnHide:y}=fa(i),x=ja(_),g=jn(!1,p),L=te(()=>r.value!==""||g.value?150:c.value),B=_a(E=>{typeof E=="string"&&(n.value=r.value,r.value=E)},L);return wr(()=>{if(!r.value)return;const E=u().map(W=>W.ref);f.value=E.find(W=>W.id.includes(r.value))}),wl({isRootMenu:!0,modelValue:r,previousValue:n,baseId:so(void 0,"reka-navigation-menu"),disableClickTrigger:S,disableHoverTrigger:w,dir:x,unmountOnHide:y,orientation:i.orientation,rootNavigationMenu:a,indicatorTrack:h,activeTrigger:f,onIndicatorTrackChange:E=>{h.value=E},viewport:l,onViewportChange:E=>{l.value=E},onTriggerEnter:E=>{B(E)},onTriggerLeave:()=>{g.value=!0,B("")},onContentEnter:()=>{B()},onContentLeave:()=>{i.disablePointerLeaveClose||B("")},onItemSelect:E=>{n.value=r.value,r.value=E},onItemDismiss:()=>{n.value=r.value,r.value=""}}),(E,W)=>(k(),z(v(d),null,{default:T(()=>[O(v(ht),{ref:v(o),"aria-label":"Main",as:E.as,"as-child":E.asChild,"data-orientation":E.orientation,dir:v(x),"data-reka-navigation-menu":""},{default:T(()=>[Y(E.$slots,"default",{modelValue:v(r)})]),_:3},8,["as","as-child","data-orientation","dir"])]),_:3}))}}),kl=Cl;function as(e){return e?"open":"closed"}function no(e,t){return`${e}-trigger-${t}`}function Br(e,t){return`${e}-content-${t}`}const xl="navigationMenu.linkSelect",Fi="navigationMenu.rootContentDismiss";function Rs(e){const t=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)t.push(i.currentNode);return t}function oo(e){const t=Xt();return e.some(i=>i===t?!0:(i.focus(),Xt()!==t))}function El(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const i=t.dataset.tabindex;t.setAttribute("tabindex",i)})}}function ao(e){return t=>t.pointerType==="mouse"?e(t):void 0}const[Dr,Ll]=Vn("NavigationMenuItem");var Bl=ze({__name:"NavigationMenuItem",props:{value:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"li"}},setup(e){const t=e;gt();const{getItems:i}=wi({key:"NavigationMenu"}),s=Wt(),r=so(t.value),n=J(),o=J(),a=Br(s.baseId,r);let h=()=>({});const l=J(!1);async function f(p="start"){const _=document.getElementById(a);if(_){h();const S=Rs(_);S.length&&oo(p==="start"?S:S.reverse())}}function u(){const p=document.getElementById(a);if(p){const _=Rs(p);_.length&&(h=El(_))}}Ll({value:r,contentId:a,triggerRef:n,focusProxyRef:o,wasEscapeCloseRef:l,onEntryKeyDown:f,onFocusProxyEnter:f,onContentFocusOutside:u,onRootContentClose:u});function d(){s.onItemDismiss(),n.value?.focus()}function c(p){const _=Xt();if(p.keyCode===32||p.key==="Enter")if(s.modelValue.value===r){d(),p.preventDefault();return}else{p.target.click(),p.preventDefault();return}const S=i().filter(y=>y.ref.parentElement?.hasAttribute("data-menu-item")).map(y=>y.ref);if(!S.includes(_))return;const w=ro(p,_,void 0,{itemsArray:S,loop:!1});w&&w?.focus(),p.preventDefault(),p.stopPropagation()}return(p,_)=>(k(),z(v(ht),{"as-child":p.asChild,as:p.as,"data-menu-item":"",onKeydown:Yn(c,["up","down","left","right","home","end","space"])},{default:T(()=>[Y(p.$slots,"default")]),_:3},8,["as-child","as"]))}}),Dl=Bl,Ml=ze({__name:"NavigationMenuContentImpl",props:{disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside"],setup(e,{emit:t}){const i=e,s=t,{getItems:r}=wi({key:"NavigationMenu"}),{forwardRef:n,currentElement:o}=gt(),a=Wt(),h=Dr(),l=no(a.baseId,h.value),f=Br(a.baseId,h.value),u=J(null),d=te(()=>{const y=r().map(W=>W.ref.id.split("trigger-")[1]);a.dir.value==="rtl"&&y.reverse();const x=y.indexOf(a.modelValue.value),g=y.indexOf(a.previousValue.value),L=h.value===a.modelValue.value,B=g===y.indexOf(h.value);if(!L&&!B)return u.value;const E=(()=>{if(x!==g){if(L&&g!==-1)return x>g?"from-end":"from-start";if(B&&x!==-1)return x>g?"to-start":"to-end"}return null})();return u.value=E,E});function c(y){if(s("focusOutside",y),s("interactOutside",y),y.detail.originalEvent.target.hasAttribute("data-navigation-menu-trigger")&&y.preventDefault(),!y.defaultPrevented){h.onContentFocusOutside();const g=y.target;a.rootNavigationMenu?.value?.contains(g)&&y.preventDefault()}}function p(y){if(s("pointerDownOutside",y),!y.defaultPrevented){const x=y.target,g=r().some(B=>B.ref.contains(x)),L=a.isRootMenu&&a.viewport.value?.contains(x);(g||L||!a.isRootMenu)&&y.preventDefault()}}wr(y=>{const x=o.value;if(a.isRootMenu&&x){const g=()=>{a.onItemDismiss(),h.onRootContentClose(),x.contains(Xt())&&h.triggerRef.value?.focus()};x.addEventListener(Fi,g),y(()=>x.removeEventListener(Fi,g))}});function _(y){s("escapeKeyDown",y),y.defaultPrevented||(a.onItemDismiss(),h.triggerRef?.value?.focus(),h.wasEscapeCloseRef.value=!0)}function S(y){if(y.target.closest("[data-reka-navigation-menu]")!==a.rootNavigationMenu.value)return;const x=y.altKey||y.ctrlKey||y.metaKey,g=y.key==="Tab"&&!x,L=Rs(y.currentTarget);if(g){const E=Xt(),W=L.findIndex(V=>V===E),Z=y.shiftKey?L.slice(0,W).reverse():L.slice(W+1,L.length);if(oo(Z))y.preventDefault();else{h.focusProxyRef.value?.focus();return}}ro(y,Xt(),void 0,{itemsArray:L,loop:!1,enableIgnoredElement:!0})?.focus()}function w(){const y=new Event(Fi,{bubbles:!0,cancelable:!0});o.value?.dispatchEvent(y)}return(y,x)=>(k(),z(v(pa),G({id:v(f),ref:v(n),"aria-labelledby":v(l),"data-motion":d.value,"data-state":v(as)(v(a).modelValue.value===v(h).value),"data-orientation":v(a).orientation},i,{onKeydown:S,onEscapeKeyDown:_,onPointerDownOutside:p,onFocusOutside:c,onDismiss:w}),{default:T(()=>[Y(y.$slots,"default")]),_:3},16,["id","aria-labelledby","data-motion","data-state","data-orientation"]))}}),Rl=Ml,Tl=ze({inheritAttrs:!1,__name:"NavigationMenuContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside"],setup(e,{emit:t}){const i=e,s=t,r=gi(ga(i,"forceMount"),s),{forwardRef:n}=gt(),o=Wt(),a=Dr(),h=te(()=>a.value===o.modelValue.value),l=te(()=>o.viewport.value&&!o.modelValue.value&&o.previousValue.value?o.previousValue.value===a.value:!1);return(f,u)=>(k(),z(Gn,{to:v($r)&&v(o).viewport.value?v(o).viewport.value:"body",disabled:v($r)&&v(o).viewport.value?!v(o).viewport.value:!0},[O(v(Cr),{present:f.forceMount||h.value||l.value,"force-mount":!v(o).unmountOnHide.value},{default:T(({present:d})=>[O(Rl,G({ref:v(n),"data-state":v(as)(h.value),style:{pointerEvents:!h.value&&v(o).isRootMenu?"none":void 0}},{...f.$attrs,...v(r)},{hidden:!d,onPointerenter:u[0]||(u[0]=c=>v(o).onContentEnter(v(a).value)),onPointerleave:u[1]||(u[1]=c=>v(ao)(()=>v(o).onContentLeave())(c)),onPointerDownOutside:u[2]||(u[2]=c=>s("pointerDownOutside",c)),onFocusOutside:u[3]||(u[3]=c=>s("focusOutside",c)),onInteractOutside:u[4]||(u[4]=c=>s("interactOutside",c))}),{default:T(()=>[Y(f.$slots,"default")]),_:2},1040,["data-state","style","hidden"])]),_:3},8,["present","force-mount"])],8,["to","disabled"]))}}),Al=Tl,Pl=ze({inheritAttrs:!1,__name:"NavigationMenuIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:i}=gt(),s=Wt(),r=J(),n=te(()=>s.orientation==="horizontal"),o=te(()=>!!s.modelValue.value),{activeTrigger:a}=s;function h(){a.value&&(r.value={size:n.value?a.value.offsetWidth:a.value.offsetHeight,position:n.value?a.value.offsetLeft:a.value.offsetTop})}return wr(()=>{s.modelValue.value&&h()}),ji(a,h),ji(s.indicatorTrack,h),(l,f)=>v(s).indicatorTrack.value?(k(),z(Gn,{key:0,to:v(s).indicatorTrack.value},[O(v(Cr),{present:l.forceMount||o.value},{default:T(()=>[O(v(ht),G({ref:v(i),"aria-hidden":"true","data-state":o.value?"visible":"hidden","data-orientation":v(s).orientation,"as-child":t.asChild,as:l.as,style:{...r.value?{"--reka-navigation-menu-indicator-size":`${r.value.size}px`,"--reka-navigation-menu-indicator-position":`${r.value.position}px`}:{}}},l.$attrs),{default:T(()=>[Y(l.$slots,"default")]),_:3},16,["data-state","data-orientation","as-child","as","style"])]),_:3},8,["present"])],8,["to"])):$("v-if",!0)}}),Il=Pl,Ol=ze({__name:"NavigationMenuLink",props:{active:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"a"}},emits:["select"],setup(e,{emit:t}){const i=e,s=t,{CollectionItem:r}=wi({key:"NavigationMenu"});gt();async function n(o){const a=new CustomEvent(xl,{bubbles:!0,cancelable:!0,detail:{originalEvent:o}});if(s("select",a),!a.defaultPrevented&&!o.metaKey){const h=new CustomEvent(Fi,{bubbles:!0,cancelable:!0});o.target?.dispatchEvent(h)}}return(o,a)=>(k(),z(v(r),null,{default:T(()=>[O(v(ht),{as:o.as,"data-active":o.active?"":void 0,"aria-current":o.active?"page":void 0,"as-child":i.asChild,onClick:n},{default:T(()=>[Y(o.$slots,"default")]),_:3},8,["as","data-active","aria-current","as-child"])]),_:3}))}}),ps=Ol,Nl=ze({inheritAttrs:!1,__name:"NavigationMenuList",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"ul"}},setup(e){const t=e,i=Wt(),{forwardRef:s,currentElement:r}=gt();return Ci(()=>{i.onIndicatorTrackChange(r.value)}),(n,o)=>(k(),z(v(ht),{ref:v(s),style:{position:"relative"}},{default:T(()=>[O(v(ht),G(n.$attrs,{"as-child":t.asChild,as:n.as,"data-orientation":v(i).orientation}),{default:T(()=>[Y(n.$slots,"default")]),_:3},16,["as-child","as","data-orientation"])]),_:3},512))}}),zl=Nl;const Fl=["aria-owns"];var Hl=ze({inheritAttrs:!1,__name:"NavigationMenuTrigger",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,i=Wt(),s=Dr(),{CollectionItem:r}=wi({key:"NavigationMenu"}),{forwardRef:n,currentElement:o}=gt(),a=J(""),h=J(""),l=jn(!1,300),f=J(!1),u=te(()=>s.value===i.modelValue.value);Ci(()=>{s.triggerRef=o,a.value=no(i.baseId,s.value),h.value=Br(i.baseId,s.value)});function d(){i.disableHoverTrigger.value||(f.value=!1,s.wasEscapeCloseRef.value=!1)}function c(x){if(!i.disableHoverTrigger.value&&x.pointerType==="mouse"){if(t.disabled||f.value||s.wasEscapeCloseRef.value||l.value)return;i.onTriggerEnter(s.value),l.value=!0}}function p(x){if(!i.disableHoverTrigger.value&&x.pointerType==="mouse"){if(t.disabled)return;i.onTriggerLeave(),l.value=!1}}function _(x){(!("pointerType"in x)||x.pointerType==="mouse")&&i.disableClickTrigger.value||l.value||(u.value?i.onItemSelect(""):i.onItemSelect(s.value),f.value=u.value)}function S(x){const L={horizontal:"ArrowDown",vertical:i.dir.value==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];u.value&&x.key===L&&(s.onEntryKeyDown(),x.preventDefault(),x.stopPropagation())}function w(x){s.focusProxyRef.value=ma(x)}function y(x){const g=document.getElementById(s.contentId),L=x.relatedTarget,B=L===o.value,E=g?.contains(L);(B||!E)&&s.onFocusProxyEnter(B?"start":"end")}return(x,g)=>(k(),j(ke,null,[O(v(r),null,{default:T(()=>[O(v(ht),G({id:a.value,ref:v(n),disabled:x.disabled,"data-disabled":x.disabled?"":void 0,"data-state":v(as)(u.value),"data-navigation-menu-trigger":"","aria-expanded":u.value,"aria-controls":h.value,"as-child":t.asChild,as:x.as},x.$attrs,{onPointerenter:d,onPointermove:c,onPointerleave:p,onClick:_,onKeydown:S}),{default:T(()=>[Y(x.$slots,"default")]),_:3},16,["id","disabled","data-disabled","data-state","aria-expanded","aria-controls","as-child","as"])]),_:3}),u.value?(k(),j(ke,{key:0},[O(v(va),{ref:w,"aria-hidden":"true",tabindex:0,onFocus:y}),v(i).viewport?(k(),j("span",{key:0,"aria-owns":h.value},null,8,Fl)):$("v-if",!0)],64)):$("v-if",!0)],64))}}),$l=Hl,Wl=ze({inheritAttrs:!1,__name:"NavigationMenuViewport",props:{forceMount:{type:Boolean,required:!1},align:{type:String,required:!1,default:"center"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:i,currentElement:s}=gt(),r=Wt(),{activeTrigger:n,rootNavigationMenu:o,modelValue:a}=r,h=J(),l=J(),f=te(()=>!!r.modelValue.value);Ce(s,()=>{r.onViewportChange(s.value)});const u=J();Ce([a,f],()=>{kt(()=>{s.value&&requestAnimationFrame(()=>{const c=s.value?.querySelector("[data-state=open]");u.value=c})})},{immediate:!0});function d(){if(u.value&&n.value&&o.value){const c=document.documentElement.offsetWidth,p=document.documentElement.offsetHeight,_=o.value.getBoundingClientRect(),S=n.value.getBoundingClientRect(),{offsetWidth:w,offsetHeight:y}=u.value,x=S.left-_.left,g=S.top-_.top;let L=null,B=null;switch(t.align){case"start":L=x,B=g;break;case"end":L=x-w+S.width,B=g-y+S.height;break;default:L=x-w/2+S.width/2,B=g-y/2+S.height/2}const E=10;L+_.left<E&&(L=E-_.left);const W=L+_.left+w;W>c-E&&(L-=W-c+E,L<E-_.left&&(L=E-_.left)),B+_.top<E&&(B=E-_.top);const U=B+_.top+y;U>p-E&&(B-=U-p+E,B<E-_.top&&(B=E-_.top)),L=Math.round(L),B=Math.round(B),l.value={left:L,top:B}}}return ji(u,()=>{u.value&&(h.value={width:u.value.offsetWidth,height:u.value.offsetHeight},d())}),ji([globalThis.document?.body,o],()=>{d()}),(c,p)=>(k(),z(v(Cr),{present:c.forceMount||f.value,"force-mount":!v(r).unmountOnHide.value,onAfterLeave:p[2]||(p[2]=()=>{h.value=void 0,l.value=void 0})},{default:T(({present:_})=>[O(v(ht),G(c.$attrs,{ref:v(i),as:c.as,"as-child":c.asChild,"data-state":v(as)(f.value),"data-orientation":v(r).orientation,style:{pointerEvents:!f.value&&v(r).isRootMenu?"none":void 0,"--reka-navigation-menu-viewport-width":h.value?`${h.value?.width}px`:void 0,"--reka-navigation-menu-viewport-height":h.value?`${h.value?.height}px`:void 0,"--reka-navigation-menu-viewport-left":l.value?`${l.value?.left}px`:void 0,"--reka-navigation-menu-viewport-top":l.value?`${l.value?.top}px`:void 0},hidden:!_,onPointerenter:p[0]||(p[0]=S=>v(r).onContentEnter(v(r).modelValue.value)),onPointerleave:p[1]||(p[1]=S=>v(ao)(()=>v(r).onContentLeave())(S))}),{default:T(()=>[Y(c.$slots,"default")]),_:2},1040,["as","as-child","data-state","data-orientation","style","hidden"])]),_:3},8,["present","force-mount"]))}}),ql=Wl;function Ts(e,t){const s=Xn().hook(e,t);Sa(s)}const Kl={slots:{base:"",label:"",trailing:"hidden lg:flex items-center gap-0.5 ms-auto"},variants:{collapsed:{true:{label:"hidden",trailing:"lg:hidden"}}}},Ul=Object.assign({inheritAttrs:!1},{__name:"UDashboardSearchButton",props:{icon:{type:null,required:!1},label:{type:String,required:!1},color:{type:null,required:!1,default:"neutral"},variant:{type:null,required:!1},collapsed:{type:Boolean,required:!1,default:!1},tooltip:{type:[Boolean,Object],required:!1,default:!1},kbds:{type:Array,required:!1,default:()=>["meta","k"]},ui:{type:void 0,required:!1},class:{type:null,required:!1},activeColor:{type:null,required:!1},activeVariant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},block:{type:Boolean,required:!1},loadingAuto:{type:Boolean,required:!1},onClick:{type:[Function,Array],required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},as:{type:null,required:!1},type:{type:null,required:!1},disabled:{type:Boolean,required:!1},exactActiveClass:{type:String,required:!1},viewTransition:{type:Boolean,required:!1}},setup(e){const t=e,i=ei(),[s,r]=Zt(),n=()=>Gi(i,["trailing"]),o=Yi(ba(t,"icon","label","variant","collapsed","tooltip","kbds","class","ui")),a=ot(()=>Mt(typeof t.tooltip=="boolean"?{}:t.tooltip,{delayDuration:0,content:{side:"right"}})),{t:h}=ns(),l=$t(),{toggleSearch:f}=to({toggleSearch:()=>{}}),u=te(()=>Ne({extend:Ne(Kl),...l.ui?.dashboardSearchButton||{}})({collapsed:t.collapsed}));return(d,c)=>(k(),j(ke,null,[O(v(s),null,{default:T(()=>[O(Jt,G({icon:e.icon||v(l).ui.icons.search,label:e.label||v(h)("dashboardSearchButton.label"),variant:e.variant||(e.collapsed?"ghost":"outline")},{...v(o),...e.collapsed?{square:!0,"aria-label":e.label||v(h)("dashboardSearchButton.label")}:{},...d.$attrs},{class:u.value.base({class:[t.ui?.base,t.class]}),ui:v(Jn)(u.value,t.ui),onClick:v(f)}),os({trailing:T(({ui:p})=>[ie("div",{"data-slot":"trailing",class:H(u.value.trailing({class:t.ui?.trailing}))},[Y(d.$slots,"trailing",{ui:p},()=>[e.kbds?.length?(k(!0),j(ke,{key:0},Ge(e.kbds,(_,S)=>(k(),z(xr,G({key:S,variant:"subtle"},{ref_for:!0},typeof _=="string"?{value:_}:_),null,16))),128)):$("",!0)])],2)]),_:2},[Ge(n(),(p,_)=>({name:_,fn:T(S=>[Y(d.$slots,_,Et(Lt(S)))])}))]),1040,["icon","label","variant","class","ui","onClick"])]),_:3}),e.collapsed&&e.tooltip?(k(),z(io,G({key:0,text:e.label||v(h)("dashboardSearchButton.label")},a.value),{default:T(()=>[O(v(r))]),_:1},16,["text"])):(k(),z(v(r),{key:1}))],64))}}),Vl={slots:{content:"bg-default shadow-lg rounded-md ring ring-default data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-popover-content-transform-origin) focus:outline-none pointer-events-auto",arrow:"fill-default"}},jl={__name:"UPopover",props:{mode:{type:null,required:!1,default:"click"},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:null,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},modal:{type:Boolean,required:!1},openDelay:{type:Number,required:!1,default:0},closeDelay:{type:Number,required:!1,default:0}},emits:["close:prevent","update:open"],setup(e,{emit:t}){const i=e,s=t,r=ei(),n=$t(),o=i.mode==="hover"?zt(i,"defaultOpen","open","openDelay","closeDelay"):zt(i,"defaultOpen","open","modal"),a=gi(o,s),h=ya(ot(()=>i.portal)),l=ot(()=>Mt(i.content,{side:"bottom",sideOffset:8,collisionPadding:8})),f=te(()=>i.dismissible?{}:["pointerDownOutside","interactOutside","escapeKeyDown"].reduce((_,S)=>(_[S]=w=>{w.preventDefault(),s("close:prevent")},_),{})),u=ot(()=>i.arrow),d=te(()=>Ne({extend:Ne(Vl),...n.ui?.popover||{}})({side:l.value.side})),c=te(()=>i.mode==="hover"?Ga:Xa);return(p,_)=>(k(),z(v(c).Root,Et(Lt(v(a))),{default:T(({open:S,close:w})=>[r.default||e.reference?(k(),z(v(c).Trigger,{key:0,"as-child":"",reference:e.reference,class:H(i.class)},{default:T(()=>[Y(p.$slots,"default",{open:S})]),_:2},1032,["reference","class"])):$("",!0),"Anchor"in c.value&&r.anchor?(k(),z(v(c).Anchor,{key:1,"as-child":""},{default:T(()=>[Y(p.$slots,"anchor",Et(Lt(w?{close:w}:{})))]),_:2},1024)):$("",!0),O(v(c).Portal,Et(Lt(v(h))),{default:T(()=>[O(v(c).Content,G(l.value,{"data-slot":"content",class:d.value.content({class:[!r.default&&i.class,i.ui?.content]})},wa(f.value)),{default:T(()=>[Y(p.$slots,"content",Et(Lt(w?{close:w}:{}))),e.arrow?(k(),z(v(c).Arrow,G({key:0},u.value,{"data-slot":"arrow",class:d.value.arrow({class:i.ui?.arrow})}),null,16,["class"])):$("",!0)]),_:2},1040,["class"])]),_:2},1040)]),_:3},16))}},Yl={slots:{root:"relative flex gap-1.5 [&>div]:min-w-0",list:"isolate min-w-0",label:"w-full flex items-center gap-1.5 font-semibold text-xs/5 text-highlighted px-2.5 py-1.5",item:"min-w-0",link:"group relative w-full flex items-center gap-1.5 font-medium text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",linkLeadingIcon:"shrink-0 size-5",linkLeadingAvatar:"shrink-0",linkLeadingAvatarSize:"2xs",linkTrailing:"group ms-auto inline-flex gap-1.5 items-center",linkTrailingBadge:"shrink-0",linkTrailingBadgeSize:"sm",linkTrailingIcon:"size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",linkLabel:"truncate",linkLabelExternalIcon:"inline-block size-3 align-top text-dimmed",childList:"isolate",childLabel:"text-xs text-highlighted",childItem:"",childLink:"group relative size-full flex items-start text-start text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",childLinkWrapper:"min-w-0",childLinkIcon:"size-5 shrink-0",childLinkLabel:"truncate",childLinkLabelExternalIcon:"inline-block size-3 align-top text-dimmed",childLinkDescription:"text-muted",separator:"px-2 h-px bg-border",viewportWrapper:"absolute top-full left-0 flex w-full",viewport:"relative overflow-hidden bg-default shadow-lg rounded-md ring ring-default h-(--reka-navigation-menu-viewport-height) w-full transition-[width,height,left] duration-200 origin-[top_center] data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] z-[1]",content:"",indicator:"absolute data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] data-[state=hidden]:opacity-0 bottom-0 z-[2] w-(--reka-navigation-menu-indicator-size) translate-x-(--reka-navigation-menu-indicator-position) flex h-2.5 items-end justify-center overflow-hidden transition-[translate,width] duration-200",arrow:"relative top-[50%] size-2.5 rotate-45 border border-default bg-default z-[1] rounded-xs"},variants:{color:{primary:{link:"focus-visible:before:ring-primary",childLink:"focus-visible:before:ring-primary"},secondary:{link:"focus-visible:before:ring-secondary",childLink:"focus-visible:before:ring-secondary"},success:{link:"focus-visible:before:ring-success",childLink:"focus-visible:before:ring-success"},info:{link:"focus-visible:before:ring-info",childLink:"focus-visible:before:ring-info"},warning:{link:"focus-visible:before:ring-warning",childLink:"focus-visible:before:ring-warning"},error:{link:"focus-visible:before:ring-error",childLink:"focus-visible:before:ring-error"},neutral:{link:"focus-visible:before:ring-inverted",childLink:"focus-visible:before:ring-inverted"}},highlightColor:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{pill:"",link:""},orientation:{horizontal:{root:"items-center justify-between",list:"flex items-center",item:"py-2",link:"px-2.5 py-1.5 before:inset-x-px before:inset-y-0",childList:"grid p-2",childLink:"px-3 py-2 gap-2 before:inset-x-px before:inset-y-0",childLinkLabel:"font-medium",content:"absolute top-0 left-0 w-full max-h-[70vh] overflow-y-auto"},vertical:{root:"flex-col",link:"flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0",childLabel:"px-1.5 py-0.5",childLink:"p-1.5 gap-1.5 before:inset-y-px before:inset-x-0"}},contentOrientation:{horizontal:{viewportWrapper:"justify-center",content:"data-[motion=from-start]:animate-[enter-from-left_200ms_ease] data-[motion=from-end]:animate-[enter-from-right_200ms_ease] data-[motion=to-start]:animate-[exit-to-left_200ms_ease] data-[motion=to-end]:animate-[exit-to-right_200ms_ease]"},vertical:{viewport:"sm:w-(--reka-navigation-menu-viewport-width) left-(--reka-navigation-menu-viewport-left)"}},active:{true:{childLink:"before:bg-elevated text-highlighted",childLinkIcon:"text-default"},false:{link:"text-muted",linkLeadingIcon:"text-dimmed",childLink:["hover:before:bg-elevated/50 text-default hover:text-highlighted","transition-colors before:transition-colors"],childLinkIcon:["text-dimmed group-hover:text-default","transition-colors"]}},disabled:{true:{link:"cursor-not-allowed opacity-75"}},highlight:{true:""},level:{true:""},collapsed:{true:""}},compoundVariants:[{orientation:"horizontal",contentOrientation:"horizontal",class:{childList:"grid-cols-2 gap-2"}},{orientation:"horizontal",contentOrientation:"vertical",class:{childList:"gap-1",content:"w-60"}},{orientation:"vertical",collapsed:!1,class:{childList:"ms-5 border-s border-default",childItem:"ps-1.5 -ms-px",content:"data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden"}},{orientation:"vertical",collapsed:!0,class:{link:"px-1.5",linkLabel:"hidden",linkTrailing:"hidden",content:"shadow-sm rounded-sm min-h-6 p-1"}},{orientation:"horizontal",highlight:!0,class:{link:["after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full","after:transition-colors"]}},{orientation:"vertical",highlight:!0,level:!0,class:{link:["after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-px after:rounded-full","after:transition-colors"]}},{disabled:!1,active:!1,variant:"pill",class:{link:["hover:text-highlighted hover:before:bg-elevated/50","transition-colors before:transition-colors"],linkLeadingIcon:["group-hover:text-default","transition-colors"]}},{disabled:!1,active:!1,variant:"pill",orientation:"horizontal",class:{link:"data-[state=open]:text-highlighted",linkLeadingIcon:"group-data-[state=open]:text-default"}},{disabled:!1,variant:"pill",highlight:!0,orientation:"horizontal",class:{link:"data-[state=open]:before:bg-elevated/50"}},{disabled:!1,variant:"pill",highlight:!1,active:!1,orientation:"horizontal",class:{link:"data-[state=open]:before:bg-elevated/50"}},{color:"primary",variant:"pill",active:!0,class:{link:"text-primary",linkLeadingIcon:"text-primary group-data-[state=open]:text-primary"}},{color:"secondary",variant:"pill",active:!0,class:{link:"text-secondary",linkLeadingIcon:"text-secondary group-data-[state=open]:text-secondary"}},{color:"success",variant:"pill",active:!0,class:{link:"text-success",linkLeadingIcon:"text-success group-data-[state=open]:text-success"}},{color:"info",variant:"pill",active:!0,class:{link:"text-info",linkLeadingIcon:"text-info group-data-[state=open]:text-info"}},{color:"warning",variant:"pill",active:!0,class:{link:"text-warning",linkLeadingIcon:"text-warning group-data-[state=open]:text-warning"}},{color:"error",variant:"pill",active:!0,class:{link:"text-error",linkLeadingIcon:"text-error group-data-[state=open]:text-error"}},{color:"neutral",variant:"pill",active:!0,class:{link:"text-highlighted",linkLeadingIcon:"text-highlighted group-data-[state=open]:text-highlighted"}},{variant:"pill",active:!0,highlight:!1,class:{link:"before:bg-elevated"}},{variant:"pill",active:!0,highlight:!0,disabled:!1,class:{link:["hover:before:bg-elevated/50","before:transition-colors"]}},{disabled:!1,active:!1,variant:"link",class:{link:["hover:text-highlighted","transition-colors"],linkLeadingIcon:["group-hover:text-default","transition-colors"]}},{disabled:!1,active:!1,variant:"link",orientation:"horizontal",class:{link:"data-[state=open]:text-highlighted",linkLeadingIcon:"group-data-[state=open]:text-default"}},{color:"primary",variant:"link",active:!0,class:{link:"text-primary",linkLeadingIcon:"text-primary group-data-[state=open]:text-primary"}},{color:"secondary",variant:"link",active:!0,class:{link:"text-secondary",linkLeadingIcon:"text-secondary group-data-[state=open]:text-secondary"}},{color:"success",variant:"link",active:!0,class:{link:"text-success",linkLeadingIcon:"text-success group-data-[state=open]:text-success"}},{color:"info",variant:"link",active:!0,class:{link:"text-info",linkLeadingIcon:"text-info group-data-[state=open]:text-info"}},{color:"warning",variant:"link",active:!0,class:{link:"text-warning",linkLeadingIcon:"text-warning group-data-[state=open]:text-warning"}},{color:"error",variant:"link",active:!0,class:{link:"text-error",linkLeadingIcon:"text-error group-data-[state=open]:text-error"}},{color:"neutral",variant:"link",active:!0,class:{link:"text-highlighted",linkLeadingIcon:"text-highlighted group-data-[state=open]:text-highlighted"}},{highlightColor:"primary",highlight:!0,level:!0,active:!0,class:{link:"after:bg-primary"}},{highlightColor:"secondary",highlight:!0,level:!0,active:!0,class:{link:"after:bg-secondary"}},{highlightColor:"success",highlight:!0,level:!0,active:!0,class:{link:"after:bg-success"}},{highlightColor:"info",highlight:!0,level:!0,active:!0,class:{link:"after:bg-info"}},{highlightColor:"warning",highlight:!0,level:!0,active:!0,class:{link:"after:bg-warning"}},{highlightColor:"error",highlight:!0,level:!0,active:!0,class:{link:"after:bg-error"}},{highlightColor:"neutral",highlight:!0,level:!0,active:!0,class:{link:"after:bg-inverted"}}],defaultVariants:{color:"primary",highlightColor:"primary",variant:"pill"}},Gl=Object.assign({inheritAttrs:!1},{__name:"UNavigationMenu",props:{as:{type:null,required:!1},type:{type:null,required:!1,default:"multiple"},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},trailingIcon:{type:null,required:!1},externalIcon:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},items:{type:null,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},collapsed:{type:Boolean,required:!1},tooltip:{type:[Boolean,Object],required:!1},popover:{type:[Boolean,Object],required:!1},highlight:{type:Boolean,required:!1},highlightColor:{type:null,required:!1},content:{type:Object,required:!1},contentOrientation:{type:null,required:!1,default:"horizontal"},arrow:{type:Boolean,required:!1},labelKey:{type:null,required:!1,default:"label"},class:{type:null,required:!1},ui:{type:null,required:!1},delayDuration:{type:Number,required:!1,default:0},disableClickTrigger:{type:Boolean,required:!1},disableHoverTrigger:{type:Boolean,required:!1},skipDelayDuration:{type:Number,required:!1},disablePointerLeaveClose:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},disabled:{type:Boolean,required:!1},collapsible:{type:Boolean,required:!1,default:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const i=e,s=t,r=ei(),n=$t(),o=gi(te(()=>({as:i.as,delayDuration:i.delayDuration,skipDelayDuration:i.skipDelayDuration,orientation:i.orientation,disableClickTrigger:i.disableClickTrigger,disableHoverTrigger:i.disableHoverTrigger,disablePointerLeaveClose:i.disablePointerLeaveClose,unmountOnHide:i.unmountOnHide})),s),a=gi(zt(i,"collapsible","disabled","type","unmountOnHide"),s),h=ot(()=>i.content),l=ot(()=>Mt(typeof i.tooltip=="boolean"?{}:i.tooltip,{delayDuration:0,content:{side:"right"}})),f=ot(()=>Mt(typeof i.popover=="boolean"?{}:i.popover,{mode:"hover",content:{side:"right",align:"start",alignOffset:2}})),[u,d]=Zt(),[c,p]=Zt({props:{item:Object,index:Number,level:Number}}),_=te(()=>Ne({extend:Ne(Yl),...n.ui?.navigationMenu||{}})({orientation:i.orientation,contentOrientation:i.orientation==="vertical"?void 0:i.contentOrientation,collapsed:i.collapsed,color:i.color,variant:i.variant,highlight:i.highlight,highlightColor:i.highlightColor||i.color})),S=te(()=>i.items?.length?Ca(i.items)?i.items:[i.items]:[]);function w(y,x=0){const g=y.reduce((L,B,E)=>((B.defaultOpen||B.open)&&L.push(B.value||(x>0?`item-${x}-${E}`:`item-${E}`)),L),[]);return i.type==="single"?g[0]:g}return(y,x)=>(k(),j(ke,null,[O(v(u),null,{default:T(({item:g,active:L,index:B})=>[Y(y.$slots,g.slot||"item",{item:g,index:B,active:L,ui:_.value},()=>[Y(y.$slots,g.slot?`${g.slot}-leading`:"item-leading",{item:g,active:L,index:B,ui:_.value},()=>[g.avatar?(k(),z(kr,G({key:0,size:g.ui?.linkLeadingAvatarSize||i.ui?.linkLeadingAvatarSize||_.value.linkLeadingAvatarSize()},g.avatar,{"data-slot":"linkLeadingAvatar",class:_.value.linkLeadingAvatar({class:[i.ui?.linkLeadingAvatar,g.ui?.linkLeadingAvatar],active:L,disabled:!!g.disabled})}),null,16,["size","class"])):g.icon?(k(),z(De,{key:1,name:g.icon,"data-slot":"linkLeadingIcon",class:H(_.value.linkLeadingIcon({class:[i.ui?.linkLeadingIcon,g.ui?.linkLeadingIcon],active:L,disabled:!!g.disabled}))},null,8,["name","class"])):$("",!0)]),v(Oe)(g,i.labelKey)||r[g.slot?`${g.slot}-label`:"item-label"]?(k(),j("span",{key:0,"data-slot":"linkLabel",class:H(_.value.linkLabel({class:[i.ui?.linkLabel,g.ui?.linkLabel]}))},[Y(y.$slots,g.slot?`${g.slot}-label`:"item-label",{item:g,active:L,index:B},()=>[at(Me(v(Oe)(g,i.labelKey)),1)]),g.target==="_blank"&&e.externalIcon!==!1?(k(),z(De,{key:0,name:typeof e.externalIcon=="string"?e.externalIcon:v(n).ui.icons.external,"data-slot":"linkLabelExternalIcon",class:H(_.value.linkLabelExternalIcon({class:[i.ui?.linkLabelExternalIcon,g.ui?.linkLabelExternalIcon],active:L}))},null,8,["name","class"])):$("",!0)],2)):$("",!0),g.badge||g.badge===0||e.orientation==="horizontal"&&(g.children?.length||r[g.slot?`${g.slot}-content`:"item-content"])||e.orientation==="vertical"&&g.children?.length||g.trailingIcon||r[g.slot?`${g.slot}-trailing`:"item-trailing"]?(k(),z(Di(e.orientation==="vertical"&&g.children?.length&&!e.collapsed?v(Wr):"span"),{key:1,as:"span","data-slot":"linkTrailing",class:H(_.value.linkTrailing({class:[i.ui?.linkTrailing,g.ui?.linkTrailing]})),onClick:x[0]||(x[0]=ka(()=>{},["stop","prevent"]))},{default:T(()=>[Y(y.$slots,g.slot?`${g.slot}-trailing`:"item-trailing",{item:g,active:L,index:B,ui:_.value},()=>[g.badge||g.badge===0?(k(),z(Ya,G({key:0,color:"neutral",variant:"outline",size:g.ui?.linkTrailingBadgeSize||i.ui?.linkTrailingBadgeSize||_.value.linkTrailingBadgeSize()},typeof g.badge=="string"||typeof g.badge=="number"?{label:g.badge}:g.badge,{"data-slot":"linkTrailingBadge",class:_.value.linkTrailingBadge({class:[i.ui?.linkTrailingBadge,g.ui?.linkTrailingBadge]})}),null,16,["size","class"])):$("",!0),e.orientation==="horizontal"&&(g.children?.length||r[g.slot?`${g.slot}-content`:"item-content"])||e.orientation==="vertical"&&g.children?.length?(k(),z(De,{key:1,name:g.trailingIcon||e.trailingIcon||v(n).ui.icons.chevronDown,"data-slot":"linkTrailingIcon",class:H(_.value.linkTrailingIcon({class:[i.ui?.linkTrailingIcon,g.ui?.linkTrailingIcon],active:L}))},null,8,["name","class"])):g.trailingIcon?(k(),z(De,{key:2,name:g.trailingIcon,"data-slot":"linkTrailingIcon",class:H(_.value.linkTrailingIcon({class:[i.ui?.linkTrailingIcon,g.ui?.linkTrailingIcon],active:L}))},null,8,["name","class"])):$("",!0)])]),_:2},1032,["class"])):$("",!0)])]),_:3}),O(v(c),null,{default:T(({item:g,index:L,level:B=0})=>[(k(),z(Di(e.orientation==="vertical"&&!e.collapsed?v(Ua):v(Dl)),{as:"li",value:g.value||(B>0?`item-${B}-${L}`:`item-${L}`)},{default:T(()=>[e.orientation==="vertical"&&g.type==="label"&&!e.collapsed?(k(),j("div",{key:0,"data-slot":"label",class:H(_.value.label({class:[i.ui?.label,g.ui?.label,g.class]}))},[O(v(d),{item:g,index:L},null,8,["item","index"])],2)):g.type!=="label"?(k(),z(Ni,G({key:1},e.orientation==="vertical"&&g.children?.length&&!e.collapsed&&g.type==="trigger"?{}:v(zi)(g),{custom:""}),{default:T(({active:E,...W})=>[(k(),z(Di(e.orientation==="horizontal"&&(g.children?.length||r[g.slot?`${g.slot}-content`:"item-content"])?v($l):e.orientation==="vertical"&&g.children?.length&&!e.collapsed&&!W.href?v(Wr):v(ps)),{"as-child":"",active:E||g.active,disabled:g.disabled,onSelect:g.onSelect},{default:T(()=>[e.orientation==="vertical"&&e.collapsed&&g.children?.length&&(i.popover||g.popover)?(k(),z(jl,G({key:0},{...f.value,...typeof g.popover=="boolean"?{}:g.popover||{}},{ui:{content:_.value.content({class:[i.ui?.content,g.ui?.content]})}}),{content:T(({close:U})=>[Y(y.$slots,g.slot?`${g.slot}-content`:"item-content",{item:g,active:E||g.active,index:L,ui:_.value,close:U},()=>[ie("ul",{"data-slot":"childList",class:H(_.value.childList({class:[i.ui?.childList,g.ui?.childList]}))},[ie("li",{"data-slot":"childLabel",class:H(_.value.childLabel({class:[i.ui?.childLabel,g.ui?.childLabel]}))},Me(v(Oe)(g,i.labelKey)),3),(k(!0),j(ke,null,Ge(g.children,(Z,V)=>(k(),j("li",{key:V,"data-slot":"childItem",class:H(_.value.childItem({class:[i.ui?.childItem,g.ui?.childItem]}))},[O(Ni,G({ref_for:!0},v(zi)(Z),{custom:""}),{default:T(({active:A,...b})=>[O(v(ps),{"as-child":"",active:A,onSelect:Z.onSelect},{default:T(()=>[O(Yt,G({ref_for:!0},b,{"data-slot":"childLink",class:_.value.childLink({class:[i.ui?.childLink,g.ui?.childLink,Z.class],active:A})}),{default:T(()=>[Z.icon?(k(),z(De,{key:0,name:Z.icon,"data-slot":"childLinkIcon",class:H(_.value.childLinkIcon({class:[i.ui?.childLinkIcon,g.ui?.childLinkIcon],active:A}))},null,8,["name","class"])):$("",!0),ie("span",{"data-slot":"childLinkLabel",class:H(_.value.childLinkLabel({class:[i.ui?.childLinkLabel,g.ui?.childLinkLabel],active:A}))},[at(Me(v(Oe)(Z,i.labelKey))+" ",1),Z.target==="_blank"&&e.externalIcon!==!1?(k(),z(De,{key:0,name:typeof e.externalIcon=="string"?e.externalIcon:v(n).ui.icons.external,"data-slot":"childLinkLabelExternalIcon",class:H(_.value.childLinkLabelExternalIcon({class:[i.ui?.childLinkLabelExternalIcon,g.ui?.childLinkLabelExternalIcon],active:A}))},null,8,["name","class"])):$("",!0)],2)]),_:2},1040,["class"])]),_:2},1032,["active","onSelect"])]),_:2},1040)],2))),128))],2)])]),default:T(()=>[O(Yt,G(W,{"data-slot":"link",class:_.value.link({class:[i.ui?.link,g.ui?.link,g.class],active:E||g.active,disabled:!!g.disabled,level:B>0})}),{default:T(()=>[O(v(d),{item:g,active:E||g.active,index:L},null,8,["item","active","index"])]),_:2},1040,["class"])]),_:2},1040,["ui"])):e.orientation==="vertical"&&e.collapsed&&(i.tooltip||g.tooltip)?(k(),z(io,G({key:1,text:v(Oe)(g,i.labelKey)},{...l.value,...typeof g.tooltip=="boolean"?{}:g.tooltip||{}}),{default:T(()=>[O(Yt,G(W,{"data-slot":"link",class:_.value.link({class:[i.ui?.link,g.ui?.link,g.class],active:E||g.active,disabled:!!g.disabled,level:B>0})}),{default:T(()=>[O(v(d),{item:g,active:E||g.active,index:L},null,8,["item","active","index"])]),_:2},1040,["class"])]),_:2},1040,["text"])):(k(),z(Yt,G({key:2},W,{"data-slot":"link",class:_.value.link({class:[i.ui?.link,g.ui?.link,g.class],active:E||g.active,disabled:!!g.disabled,level:e.orientation==="horizontal"||B>0})}),{default:T(()=>[O(v(d),{item:g,active:E||g.active,index:L},null,8,["item","active","index"])]),_:2},1040,["class"]))]),_:2},1064,["active","disabled","onSelect"])),e.orientation==="horizontal"&&(g.children?.length||r[g.slot?`${g.slot}-content`:"item-content"])?(k(),z(v(Al),G({key:0},h.value,{"data-slot":"content",class:_.value.content({class:[i.ui?.content,g.ui?.content]})}),{default:T(()=>[Y(y.$slots,g.slot?`${g.slot}-content`:"item-content",{item:g,active:E||g.active,index:L,ui:_.value},()=>[ie("ul",{"data-slot":"childList",class:H(_.value.childList({class:[i.ui?.childList,g.ui?.childList]}))},[(k(!0),j(ke,null,Ge(g.children,(U,Z)=>(k(),j("li",{key:Z,"data-slot":"childItem",class:H(_.value.childItem({class:[i.ui?.childItem,g.ui?.childItem]}))},[O(Ni,G({ref_for:!0},v(zi)(U),{custom:""}),{default:T(({active:V,...A})=>[O(v(ps),{"as-child":"",active:V,onSelect:U.onSelect},{default:T(()=>[O(Yt,G({ref_for:!0},A,{"data-slot":"childLink",class:_.value.childLink({class:[i.ui?.childLink,g.ui?.childLink,U.class],active:V})}),{default:T(()=>[U.icon?(k(),z(De,{key:0,name:U.icon,"data-slot":"childLinkIcon",class:H(_.value.childLinkIcon({class:[i.ui?.childLinkIcon,g.ui?.childLinkIcon],active:V}))},null,8,["name","class"])):$("",!0),ie("div",{"data-slot":"childLinkWrapper",class:H(_.value.childLinkWrapper({class:[i.ui?.childLinkWrapper,g.ui?.childLinkWrapper]}))},[ie("p",{"data-slot":"childLinkLabel",class:H(_.value.childLinkLabel({class:[i.ui?.childLinkLabel,g.ui?.childLinkLabel],active:V}))},[at(Me(v(Oe)(U,i.labelKey))+" ",1),U.target==="_blank"&&e.externalIcon!==!1?(k(),z(De,{key:0,name:typeof e.externalIcon=="string"?e.externalIcon:v(n).ui.icons.external,"data-slot":"childLinkLabelExternalIcon",class:H(_.value.childLinkLabelExternalIcon({class:[i.ui?.childLinkLabelExternalIcon,g.ui?.childLinkLabelExternalIcon],active:V}))},null,8,["name","class"])):$("",!0)],2),U.description?(k(),j("p",{key:0,"data-slot":"childLinkDescription",class:H(_.value.childLinkDescription({class:[i.ui?.childLinkDescription,g.ui?.childLinkDescription],active:V}))},Me(U.description),3)):$("",!0)],2)]),_:2},1040,["class"])]),_:2},1032,["active","onSelect"])]),_:2},1040)],2))),128))],2)])]),_:2},1040,["class"])):$("",!0)]),_:2},1040)):$("",!0),e.orientation==="vertical"&&g.children?.length&&!e.collapsed?(k(),z(v(Va),{key:2,"data-slot":"content",class:H(_.value.content({class:[i.ui?.content,g.ui?.content]}))},{default:T(()=>[O(v(qr),G({...v(a),defaultValue:w(g.children,B+1)},{as:"ul","data-slot":"childList",class:_.value.childList({class:i.ui?.childList})}),{default:T(()=>[(k(!0),j(ke,null,Ge(g.children,(E,W)=>(k(),z(v(p),{key:W,item:E,index:W,level:B+1,"data-slot":"childItem",class:H(_.value.childItem({class:[i.ui?.childItem,E.ui?.childItem]}))},null,8,["item","index","level","class"]))),128))]),_:2},1040,["class"])]),_:2},1032,["class"])):$("",!0)]),_:2},1032,["value"]))]),_:3}),O(v(kl),G({...v(o),...e.orientation==="horizontal"?{modelValue:e.modelValue,defaultValue:e.defaultValue}:{},...y.$attrs},{"data-collapsed":e.collapsed,"data-slot":"root",class:_.value.root({class:[i.ui?.root,i.class]})}),{default:T(()=>[Y(y.$slots,"list-leading"),(k(!0),j(ke,null,Ge(S.value,(g,L)=>(k(),j(ke,{key:`list-${L}`},[(k(),z(Di(e.orientation==="vertical"?v(qr):v(zl)),G({ref_for:!0},e.orientation==="vertical"&&!e.collapsed?{...v(a),modelValue:e.modelValue,defaultValue:e.defaultValue??w(g)}:{},{as:"ul","data-slot":"list",class:_.value.list({class:i.ui?.list})}),{default:T(()=>[(k(!0),j(ke,null,Ge(g,(B,E)=>(k(),z(v(p),{key:`list-${L}-${E}`,item:B,index:E,"data-slot":"item",class:H(_.value.item({class:[i.ui?.item,B.ui?.item]}))},null,8,["item","index","class"]))),128))]),_:2},1040,["class"])),e.orientation==="vertical"&&L<S.value.length-1?(k(),j("div",{key:0,"data-slot":"separator",class:H(_.value.separator({class:i.ui?.separator}))},null,2)):$("",!0)],64))),128)),Y(y.$slots,"list-trailing"),e.orientation==="horizontal"?(k(),j("div",{key:0,"data-slot":"viewportWrapper",class:H(_.value.viewportWrapper({class:i.ui?.viewportWrapper}))},[e.arrow?(k(),z(v(Il),{key:0,"data-slot":"indicator",class:H(_.value.indicator({class:i.ui?.indicator}))},{default:T(()=>[ie("div",{"data-slot":"arrow",class:H(_.value.arrow({class:i.ui?.arrow}))},null,2)]),_:1},8,["class"])):$("",!0),O(v(ql),{"data-slot":"viewport",class:H(_.value.viewport({class:i.ui?.viewport}))},null,8,["class"])],2)):$("",!0)]),_:3},16,["data-collapsed","class"])],64))}}),Xl={slots:{root:"relative hidden lg:flex flex-col min-h-svh min-w-16 w-(--width) shrink-0",header:"h-(--ui-header-height) shrink-0 flex items-center gap-1.5 px-4",body:"flex flex-col gap-4 flex-1 overflow-y-auto px-4 py-2",footer:"shrink-0 flex items-center gap-1.5 px-4 py-2",toggle:"",handle:"",content:"lg:hidden",overlay:"lg:hidden"},variants:{menu:{true:{header:"sm:px-6",body:"sm:px-6",footer:"sm:px-6"}},side:{left:{root:"border-e border-default"},right:{root:""}},toggleSide:{left:{toggle:""},right:{toggle:"ms-auto"}}}},Jl=["data-collapsed","data-dragging"],Zl=Object.assign({inheritAttrs:!1},{__name:"UDashboardSidebar",props:Xi({mode:{type:null,required:!1,default:"slideover"},menu:{type:null,required:!1},toggle:{type:[Boolean,Object],required:!1,default:!0},toggleSide:{type:String,required:!1,default:"left"},class:{type:null,required:!1},ui:{type:null,required:!1},id:{type:String,required:!1},side:{type:String,required:!1,default:"left"},minSize:{type:Number,required:!1,default:10},maxSize:{type:Number,required:!1,default:20},defaultSize:{type:Number,required:!1,default:15},resizable:{type:Boolean,required:!1,default:!1},collapsible:{type:Boolean,required:!1,default:!1},collapsedSize:{type:Number,required:!1,default:0}},{open:{type:Boolean,default:!1},openModifiers:{},collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:["update:open","update:collapsed"],setup(e){const t=e,i=ei(),s=vi(e,"open",{type:Boolean,default:!1}),r=vi(e,"collapsed",{type:Boolean,default:!1}),n=Zn(),{t:o}=ns(),a=$t(),h=to({storageKey:"dashboard",unit:"%",sidebarOpen:J(!1),sidebarCollapsed:J(!1)}),l=`${h.storageKey}-sidebar-${t.id||xa()}`,{el:f,size:u,collapse:d,isCollapsed:c,isDragging:p,onMouseDown:_,onTouchStart:S,onDoubleClick:w}=za(l,ot(()=>({...h,...t})),{collapsed:r}),[y,x]=Zt(),[g,L]=Zt();Ts("dashboard:sidebar:toggle",()=>{s.value=!s.value}),Ts("dashboard:sidebar:collapse",Z=>{c.value=Z}),Ce(s,()=>h.sidebarOpen.value=s.value,{immediate:!0}),Ce(c,()=>h.sidebarCollapsed.value=c.value,{immediate:!0}),Ce(()=>n.fullPath,()=>{s.value=!1});const B=te(()=>Ne({extend:Ne(Xl),...a.ui?.dashboardSidebar||{}})({side:t.side})),E=te(()=>({slideover:Qa,modal:Er,drawer:el})[t.mode]),W=ot(()=>Mt(t.menu,{content:{onOpenAutoFocus:Z=>Z.preventDefault()}},t.mode==="modal"?{fullscreen:!0,transition:!1}:t.mode==="slideover"?{side:"left"}:{}));function U(){s.value=!s.value}return(Z,V)=>(k(),j(ke,null,[O(v(y),null,{default:T(()=>[Y(Z.$slots,"toggle",{open:s.value,toggle:U,ui:B.value},()=>[e.toggle?(k(),z(Fa,G({key:0},typeof e.toggle=="object"?e.toggle:{},{side:e.toggleSide,"data-slot":"toggle",class:B.value.toggle({class:t.ui?.toggle,toggleSide:e.toggleSide})}),null,16,["side","class"])):$("",!0)])]),_:3}),O(v(g),null,{default:T(()=>[Y(Z.$slots,"resize-handle",{onMouseDown:v(_),onTouchStart:v(S),onDoubleClick:v(w),ui:B.value},()=>[e.resizable?(k(),z(Ha,{key:0,"aria-controls":l,"data-slot":"handle",class:H(B.value.handle({class:t.ui?.handle})),onMousedown:v(_),onTouchstart:v(S),onDblclick:v(w)},null,8,["class","onMousedown","onTouchstart","onDblclick"])):$("",!0)])]),_:3}),e.side==="right"?(k(),z(v(L),{key:0})):$("",!0),ie("div",G({id:l,ref_key:"el",ref:f},Z.$attrs,{"data-collapsed":v(c),"data-dragging":v(p),"data-slot":"root",class:B.value.root({class:[t.ui?.root,t.class]}),style:{"--width":`${v(u)||0}${v(h).unit}`}}),[i.header?(k(),j("div",{key:0,"data-slot":"header",class:H(B.value.header({class:t.ui?.header}))},[Y(Z.$slots,"header",{collapsed:v(c),collapse:v(d)})],2)):$("",!0),ie("div",{"data-slot":"body",class:H(B.value.body({class:t.ui?.body}))},[Y(Z.$slots,"default",{collapsed:v(c),collapse:v(d)})],2),i.footer?(k(),j("div",{key:1,"data-slot":"footer",class:H(B.value.footer({class:t.ui?.footer}))},[Y(Z.$slots,"footer",{collapsed:v(c),collapse:v(d)})],2)):$("",!0)],16,Jl),e.side==="left"?(k(),z(v(L),{key:1})):$("",!0),O(v(E),G({open:s.value,"onUpdate:open":V[0]||(V[0]=A=>s.value=A),title:v(o)("dashboardSidebar.title"),description:v(o)("dashboardSidebar.description")},W.value,{ui:{overlay:B.value.overlay({class:t.ui?.overlay}),content:B.value.content({class:t.ui?.content})}}),{content:T(A=>[Y(Z.$slots,"content",Et(Lt(A)),()=>[i.header||e.mode!=="drawer"?(k(),j("div",{key:0,"data-slot":"header",class:H(B.value.header({class:t.ui?.header,menu:!0}))},[e.mode!=="drawer"&&e.toggleSide==="left"?(k(),z(v(x),{key:0})):$("",!0),Y(Z.$slots,"header"),e.mode!=="drawer"&&e.toggleSide==="right"?(k(),z(v(x),{key:1})):$("",!0)],2)):$("",!0),ie("div",{"data-slot":"body",class:H(B.value.body({class:t.ui?.body,menu:!0}))},[Y(Z.$slots,"default")],2),i.footer?(k(),j("div",{key:1,"data-slot":"footer",class:H(B.value.footer({class:t.ui?.footer,menu:!0}))},[Y(Z.$slots,"footer")],2)):$("",!0)])]),_:3},16,["open","title","description","ui"])],64))}});function pt(e){return Array.isArray?Array.isArray(e):co(e)==="[object Array]"}function Ql(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function eh(e){return e==null?"":Ql(e)}function rt(e){return typeof e=="string"}function lo(e){return typeof e=="number"}function th(e){return e===!0||e===!1||ih(e)&&co(e)=="[object Boolean]"}function ho(e){return typeof e=="object"}function ih(e){return ho(e)&&e!==null}function qe(e){return e!=null}function gs(e){return!e.trim().length}function co(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const sh="Incorrect 'index' type",rh=e=>`Invalid value for key ${e}`,nh=e=>`Pattern length exceeds max of ${e}.`,oh=e=>`Missing ${e} property in key`,ah=e=>`Property 'weight' in key '${e}' must be a positive integer`,Kr=Object.prototype.hasOwnProperty;class lh{constructor(t){this._keys=[],this._keyMap={};let i=0;t.forEach(s=>{let r=uo(s);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(s=>{s.weight/=i})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function uo(e){let t=null,i=null,s=null,r=1,n=null;if(rt(e)||pt(e))s=e,t=Ur(e),i=As(e);else{if(!Kr.call(e,"name"))throw new Error(oh("name"));const o=e.name;if(s=o,Kr.call(e,"weight")&&(r=e.weight,r<=0))throw new Error(ah(o));t=Ur(o),i=As(o),n=e.getFn}return{path:t,id:i,weight:r,src:s,getFn:n}}function Ur(e){return pt(e)?e:e.split(".")}function As(e){return pt(e)?e.join("."):e}function hh(e,t){let i=[],s=!1;const r=(n,o,a)=>{if(qe(n))if(!o[a])i.push(n);else{let h=o[a];const l=n[h];if(!qe(l))return;if(a===o.length-1&&(rt(l)||lo(l)||th(l)))i.push(eh(l));else if(pt(l)){s=!0;for(let f=0,u=l.length;f<u;f+=1)r(l[f],o,a+1)}else o.length&&r(l,o,a+1)}};return r(e,rt(t)?t.split("."):t,0),s?i:i[0]}const ch={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},uh={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},dh={location:0,threshold:.6,distance:100},fh={useExtendedSearch:!1,getFn:hh,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var q={...uh,...ch,...dh,...fh};const _h=/[^ ]+/g;function ph(e=1,t=3){const i=new Map,s=Math.pow(10,t);return{get(r){const n=r.match(_h).length;if(i.has(n))return i.get(n);const o=1/Math.pow(n,.5*e),a=parseFloat(Math.round(o*s)/s);return i.set(n,a),a},clear(){i.clear()}}}class Mr{constructor({getFn:t=q.getFn,fieldNormWeight:i=q.fieldNormWeight}={}){this.norm=ph(i,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((i,s)=>{this._keysMap[i.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,rt(this.docs[0])?this.docs.forEach((t,i)=>{this._addString(t,i)}):this.docs.forEach((t,i)=>{this._addObject(t,i)}),this.norm.clear())}add(t){const i=this.size();rt(t)?this._addString(t,i):this._addObject(t,i)}removeAt(t){this.records.splice(t,1);for(let i=t,s=this.size();i<s;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(t,i){return t[this._keysMap[i]]}size(){return this.records.length}_addString(t,i){if(!qe(t)||gs(t))return;let s={v:t,i,n:this.norm.get(t)};this.records.push(s)}_addObject(t,i){let s={i,$:{}};this.keys.forEach((r,n)=>{let o=r.getFn?r.getFn(t):this.getFn(t,r.path);if(qe(o)){if(pt(o)){let a=[];const h=[{nestedArrIndex:-1,value:o}];for(;h.length;){const{nestedArrIndex:l,value:f}=h.pop();if(qe(f))if(rt(f)&&!gs(f)){let u={v:f,i:l,n:this.norm.get(f)};a.push(u)}else pt(f)&&f.forEach((u,d)=>{h.push({nestedArrIndex:d,value:u})})}s.$[n]=a}else if(rt(o)&&!gs(o)){let a={v:o,n:this.norm.get(o)};s.$[n]=a}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function fo(e,t,{getFn:i=q.getFn,fieldNormWeight:s=q.fieldNormWeight}={}){const r=new Mr({getFn:i,fieldNormWeight:s});return r.setKeys(e.map(uo)),r.setSources(t),r.create(),r}function gh(e,{getFn:t=q.getFn,fieldNormWeight:i=q.fieldNormWeight}={}){const{keys:s,records:r}=e,n=new Mr({getFn:t,fieldNormWeight:i});return n.setKeys(s),n.setIndexRecords(r),n}function Mi(e,{errors:t=0,currentLocation:i=0,expectedLocation:s=0,distance:r=q.distance,ignoreLocation:n=q.ignoreLocation}={}){const o=t/e.length;if(n)return o;const a=Math.abs(s-i);return r?o+a/r:a?1:o}function vh(e=[],t=q.minMatchCharLength){let i=[],s=-1,r=-1,n=0;for(let o=e.length;n<o;n+=1){let a=e[n];a&&s===-1?s=n:!a&&s!==-1&&(r=n-1,r-s+1>=t&&i.push([s,r]),s=-1)}return e[n-1]&&n-s>=t&&i.push([s,n-1]),i}const It=32;function mh(e,t,i,{location:s=q.location,distance:r=q.distance,threshold:n=q.threshold,findAllMatches:o=q.findAllMatches,minMatchCharLength:a=q.minMatchCharLength,includeMatches:h=q.includeMatches,ignoreLocation:l=q.ignoreLocation}={}){if(t.length>It)throw new Error(nh(It));const f=t.length,u=e.length,d=Math.max(0,Math.min(s,u));let c=n,p=d;const _=a>1||h,S=_?Array(u):[];let w;for(;(w=e.indexOf(t,p))>-1;){let E=Mi(t,{currentLocation:w,expectedLocation:d,distance:r,ignoreLocation:l});if(c=Math.min(E,c),p=w+f,_){let W=0;for(;W<f;)S[w+W]=1,W+=1}}p=-1;let y=[],x=1,g=f+u;const L=1<<f-1;for(let E=0;E<f;E+=1){let W=0,U=g;for(;W<U;)Mi(t,{errors:E,currentLocation:d+U,expectedLocation:d,distance:r,ignoreLocation:l})<=c?W=U:g=U,U=Math.floor((g-W)/2+W);g=U;let Z=Math.max(1,d-U+1),V=o?u:Math.min(d+U,u)+f,A=Array(V+2);A[V+1]=(1<<E)-1;for(let M=V;M>=Z;M-=1){let m=M-1,I=i[e.charAt(m)];if(_&&(S[m]=+!!I),A[M]=(A[M+1]<<1|1)&I,E&&(A[M]|=(y[M+1]|y[M])<<1|1|y[M+1]),A[M]&L&&(x=Mi(t,{errors:E,currentLocation:m,expectedLocation:d,distance:r,ignoreLocation:l}),x<=c)){if(c=x,p=m,p<=d)break;Z=Math.max(1,2*d-p)}}if(Mi(t,{errors:E+1,currentLocation:d,expectedLocation:d,distance:r,ignoreLocation:l})>c)break;y=A}const B={isMatch:p>=0,score:Math.max(.001,x)};if(_){const E=vh(S,a);E.length?h&&(B.indices=E):B.isMatch=!1}return B}function Sh(e){let t={};for(let i=0,s=e.length;i<s;i+=1){const r=e.charAt(i);t[r]=(t[r]||0)|1<<s-i-1}return t}const Ji=String.prototype.normalize?(e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(e=>e);class _o{constructor(t,{location:i=q.location,threshold:s=q.threshold,distance:r=q.distance,includeMatches:n=q.includeMatches,findAllMatches:o=q.findAllMatches,minMatchCharLength:a=q.minMatchCharLength,isCaseSensitive:h=q.isCaseSensitive,ignoreDiacritics:l=q.ignoreDiacritics,ignoreLocation:f=q.ignoreLocation}={}){if(this.options={location:i,threshold:s,distance:r,includeMatches:n,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:h,ignoreDiacritics:l,ignoreLocation:f},t=h?t:t.toLowerCase(),t=l?Ji(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const u=(c,p)=>{this.chunks.push({pattern:c,alphabet:Sh(c),startIndex:p})},d=this.pattern.length;if(d>It){let c=0;const p=d%It,_=d-p;for(;c<_;)u(this.pattern.substr(c,It),c),c+=It;if(p){const S=d-It;u(this.pattern.substr(S),S)}}else u(this.pattern,0)}searchIn(t){const{isCaseSensitive:i,ignoreDiacritics:s,includeMatches:r}=this.options;if(t=i?t:t.toLowerCase(),t=s?Ji(t):t,this.pattern===t){let _={isMatch:!0,score:0};return r&&(_.indices=[[0,t.length-1]]),_}const{location:n,distance:o,threshold:a,findAllMatches:h,minMatchCharLength:l,ignoreLocation:f}=this.options;let u=[],d=0,c=!1;this.chunks.forEach(({pattern:_,alphabet:S,startIndex:w})=>{const{isMatch:y,score:x,indices:g}=mh(t,_,S,{location:n+w,distance:o,threshold:a,findAllMatches:h,minMatchCharLength:l,includeMatches:r,ignoreLocation:f});y&&(c=!0),d+=x,y&&g&&(u=[...u,...g])});let p={isMatch:c,score:c?d/this.chunks.length:1};return c&&r&&(p.indices=u),p}}class Rt{constructor(t){this.pattern=t}static isMultiMatch(t){return Vr(t,this.multiRegex)}static isSingleMatch(t){return Vr(t,this.singleRegex)}search(){}}function Vr(e,t){const i=e.match(t);return i?i[1]:null}class bh extends Rt{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const i=t===this.pattern;return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class yh extends Rt{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const s=t.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class wh extends Rt{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const i=t.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class Ch extends Rt{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const i=!t.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,t.length-1]}}}class kh extends Rt{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const i=t.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class xh extends Rt{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const i=!t.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,t.length-1]}}}class po extends Rt{constructor(t,{location:i=q.location,threshold:s=q.threshold,distance:r=q.distance,includeMatches:n=q.includeMatches,findAllMatches:o=q.findAllMatches,minMatchCharLength:a=q.minMatchCharLength,isCaseSensitive:h=q.isCaseSensitive,ignoreDiacritics:l=q.ignoreDiacritics,ignoreLocation:f=q.ignoreLocation}={}){super(t),this._bitapSearch=new _o(t,{location:i,threshold:s,distance:r,includeMatches:n,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:h,ignoreDiacritics:l,ignoreLocation:f})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class go extends Rt{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let i=0,s;const r=[],n=this.pattern.length;for(;(s=t.indexOf(this.pattern,i))>-1;)i=s+n,r.push([s,i-1]);const o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}const Ps=[bh,go,wh,Ch,xh,kh,yh,po],jr=Ps.length,Eh=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Lh="|";function Bh(e,t={}){return e.split(Lh).map(i=>{let s=i.trim().split(Eh).filter(n=>n&&!!n.trim()),r=[];for(let n=0,o=s.length;n<o;n+=1){const a=s[n];let h=!1,l=-1;for(;!h&&++l<jr;){const f=Ps[l];let u=f.isMultiMatch(a);u&&(r.push(new f(u,t)),h=!0)}if(!h)for(l=-1;++l<jr;){const f=Ps[l];let u=f.isSingleMatch(a);if(u){r.push(new f(u,t));break}}}return r})}const Dh=new Set([po.type,go.type]);class Mh{constructor(t,{isCaseSensitive:i=q.isCaseSensitive,ignoreDiacritics:s=q.ignoreDiacritics,includeMatches:r=q.includeMatches,minMatchCharLength:n=q.minMatchCharLength,ignoreLocation:o=q.ignoreLocation,findAllMatches:a=q.findAllMatches,location:h=q.location,threshold:l=q.threshold,distance:f=q.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:s,includeMatches:r,minMatchCharLength:n,findAllMatches:a,ignoreLocation:o,location:h,threshold:l,distance:f},t=i?t:t.toLowerCase(),t=s?Ji(t):t,this.pattern=t,this.query=Bh(this.pattern,this.options)}static condition(t,i){return i.useExtendedSearch}searchIn(t){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:r,ignoreDiacritics:n}=this.options;t=r?t:t.toLowerCase(),t=n?Ji(t):t;let o=0,a=[],h=0;for(let l=0,f=i.length;l<f;l+=1){const u=i[l];a.length=0,o=0;for(let d=0,c=u.length;d<c;d+=1){const p=u[d],{isMatch:_,indices:S,score:w}=p.search(t);if(_){if(o+=1,h+=w,s){const y=p.constructor.type;Dh.has(y)?a=[...a,...S]:a.push(S)}}else{h=0,o=0,a.length=0;break}}if(o){let d={isMatch:!0,score:h/o};return s&&(d.indices=a),d}}return{isMatch:!1,score:1}}}const Is=[];function Rh(...e){Is.push(...e)}function Os(e,t){for(let i=0,s=Is.length;i<s;i+=1){let r=Is[i];if(r.condition(e,t))return new r(e,t)}return new _o(e,t)}const Zi={AND:"$and",OR:"$or"},Ns={PATH:"$path",PATTERN:"$val"},zs=e=>!!(e[Zi.AND]||e[Zi.OR]),Th=e=>!!e[Ns.PATH],Ah=e=>!pt(e)&&ho(e)&&!zs(e),Yr=e=>({[Zi.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function vo(e,t,{auto:i=!0}={}){const s=r=>{let n=Object.keys(r);const o=Th(r);if(!o&&n.length>1&&!zs(r))return s(Yr(r));if(Ah(r)){const h=o?r[Ns.PATH]:n[0],l=o?r[Ns.PATTERN]:r[h];if(!rt(l))throw new Error(rh(h));const f={keyId:As(h),pattern:l};return i&&(f.searcher=Os(l,t)),f}let a={children:[],operator:n[0]};return n.forEach(h=>{const l=r[h];pt(l)&&l.forEach(f=>{a.children.push(s(f))})}),a};return zs(e)||(e=Yr(e)),s(e)}function Ph(e,{ignoreFieldNorm:t=q.ignoreFieldNorm}){e.forEach(i=>{let s=1;i.matches.forEach(({key:r,norm:n,score:o})=>{const a=r?r.weight:null;s*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(t?1:n))}),i.score=s})}function Ih(e,t){const i=e.matches;t.matches=[],qe(i)&&i.forEach(s=>{if(!qe(s.indices)||!s.indices.length)return;const{indices:r,value:n}=s;let o={indices:r,value:n};s.key&&(o.key=s.key.src),s.idx>-1&&(o.refIndex=s.idx),t.matches.push(o)})}function Oh(e,t){t.score=e.score}function Nh(e,t,{includeMatches:i=q.includeMatches,includeScore:s=q.includeScore}={}){const r=[];return i&&r.push(Ih),s&&r.push(Oh),e.map(n=>{const{idx:o}=n,a={item:t[o],refIndex:o};return r.length&&r.forEach(h=>{h(n,a)}),a})}class ti{constructor(t,i={},s){this.options={...q,...i},this.options.useExtendedSearch,this._keyStore=new lh(this.options.keys),this.setCollection(t,s)}setCollection(t,i){if(this._docs=t,i&&!(i instanceof Mr))throw new Error(sh);this._myIndex=i||fo(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){qe(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const i=[];for(let s=0,r=this._docs.length;s<r;s+=1){const n=this._docs[s];t(n,s)&&(this.removeAt(s),s-=1,r-=1,i.push(n))}return i}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:i=-1}={}){const{includeMatches:s,includeScore:r,shouldSort:n,sortFn:o,ignoreFieldNorm:a}=this.options;let h=rt(t)?rt(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return Ph(h,{ignoreFieldNorm:a}),n&&h.sort(o),lo(i)&&i>-1&&(h=h.slice(0,i)),Nh(h,this._docs,{includeMatches:s,includeScore:r})}_searchStringList(t){const i=Os(t,this.options),{records:s}=this._myIndex,r=[];return s.forEach(({v:n,i:o,n:a})=>{if(!qe(n))return;const{isMatch:h,score:l,indices:f}=i.searchIn(n);h&&r.push({item:n,idx:o,matches:[{score:l,value:n,norm:a,indices:f}]})}),r}_searchLogical(t){const i=vo(t,this.options),s=(a,h,l)=>{if(!a.children){const{keyId:u,searcher:d}=a,c=this._findMatches({key:this._keyStore.get(u),value:this._myIndex.getValueForItemAtKeyId(h,u),searcher:d});return c&&c.length?[{idx:l,item:h,matches:c}]:[]}const f=[];for(let u=0,d=a.children.length;u<d;u+=1){const c=a.children[u],p=s(c,h,l);if(p.length)f.push(...p);else if(a.operator===Zi.AND)return[]}return f},r=this._myIndex.records,n={},o=[];return r.forEach(({$:a,i:h})=>{if(qe(a)){let l=s(i,a,h);l.length&&(n[h]||(n[h]={idx:h,item:a,matches:[]},o.push(n[h])),l.forEach(({matches:f})=>{n[h].matches.push(...f)}))}}),o}_searchObjectList(t){const i=Os(t,this.options),{keys:s,records:r}=this._myIndex,n=[];return r.forEach(({$:o,i:a})=>{if(!qe(o))return;let h=[];s.forEach((l,f)=>{h.push(...this._findMatches({key:l,value:o[f],searcher:i}))}),h.length&&n.push({idx:a,item:o,matches:h})}),n}_findMatches({key:t,value:i,searcher:s}){if(!qe(i))return[];let r=[];if(pt(i))i.forEach(({v:n,i:o,n:a})=>{if(!qe(n))return;const{isMatch:h,score:l,indices:f}=s.searchIn(n);h&&r.push({score:l,key:t,value:n,idx:o,norm:a,indices:f})});else{const{v:n,n:o}=i,{isMatch:a,score:h,indices:l}=s.searchIn(n);a&&r.push({score:h,key:t,value:n,norm:o,indices:l})}return r}}ti.version="7.1.0";ti.createIndex=fo;ti.parseIndex=gh;ti.config=q;ti.parseQuery=vo;Rh(Mh);function zh(e,t,i){const s=()=>{var n,o;return new ti((n=dt(t))!==null&&n!==void 0?n:[],(o=dt(i))===null||o===void 0?void 0:o.fuseOptions)},r=J(s());return Ce(()=>{var n;return(n=dt(i))===null||n===void 0?void 0:n.fuseOptions},()=>{r.value=s()},{deep:!0}),Ce(()=>dt(t),n=>{r.value.setCollection(n)},{deep:!0}),{fuse:r,results:te(()=>{const n=dt(i);if(n?.matchAllWhenSearchEmpty&&!dt(e))return dt(t).map((a,h)=>({item:a,refIndex:h}));const o=n?.resultLimit;return r.value.search(dt(e),o?{limit:o}:void 0)})}}function Fh(e,t){let i="",s=0,r=!1;for(let n=e.length-1;n>=0;n--){if(e[n]===">")r=!0;else if(e[n]==="<"){r=!1,i=e[n]+i;continue}if(r||s++,s<=t)i=e[n]+i;else{i="..."+i;break}}return i}function Gr(e,t,i,s){function r(n,o=[]){n=n||"";let a="",h=0;o.forEach(f=>{if(f.length===2&&f[0]===f[1])return;const u=f[1]+1,d=u-f[0]>=t.length;a+=[n.substring(h,f[0]),d&&"<mark>",n.substring(f[0],u),d&&"</mark>"].filter(Boolean).join(""),h=u}),a+=n.substring(h);const l=a.indexOf("<mark>");return l!==-1&&(a=Fh(a,a.length-l)),a}if(e.matches?.length){for(const n of e.matches)if(!(i&&n.key!==i)&&!s?.includes(n.key))return r(n.value,n.indices)}}const Hh={slots:{root:"flex flex-col min-h-0 min-w-0 divide-y divide-default",input:"[&>input]:h-12",close:"",back:"p-0",content:"relative overflow-hidden flex flex-col",footer:"p-1",viewport:"relative scroll-py-1 overflow-y-auto flex-1 focus:outline-none",group:"p-1 isolate",empty:"py-6 text-center text-sm text-muted",label:"p-1.5 text-xs font-semibold text-highlighted",item:"group relative w-full flex items-start gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75",itemLeadingIcon:"shrink-0 size-5",itemLeadingAvatar:"shrink-0",itemLeadingAvatarSize:"2xs",itemLeadingChip:"shrink-0 size-5",itemLeadingChipSize:"md",itemTrailing:"ms-auto inline-flex gap-1.5 items-center",itemTrailingIcon:"shrink-0 size-5",itemTrailingHighlightedIcon:"shrink-0 size-5 text-dimmed hidden group-data-highlighted:inline-flex",itemTrailingKbds:"hidden lg:inline-flex items-center shrink-0 gap-0.5",itemTrailingKbdsSize:"md",itemWrapper:"flex-1 flex flex-col text-start min-w-0",itemLabel:"truncate space-x-1 text-dimmed",itemDescription:"truncate text-muted",itemLabelBase:"text-highlighted [&>mark]:text-inverted [&>mark]:bg-primary",itemLabelPrefix:"text-default",itemLabelSuffix:"text-dimmed [&>mark]:text-inverted [&>mark]:bg-primary"},variants:{virtualize:{true:{viewport:"p-1 isolate"},false:{viewport:"divide-y divide-default"}},active:{true:{item:"text-highlighted before:bg-elevated",itemLeadingIcon:"text-default"},false:{item:["text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50","transition-colors before:transition-colors"],itemLeadingIcon:["text-dimmed group-data-highlighted:not-group-data-disabled:text-default","transition-colors"]}},loading:{true:{itemLeadingIcon:"animate-spin"}}}},$h=["innerHTML"],Wh=["innerHTML"],qh=Object.assign({inheritAttrs:!1},{__name:"UCommandPalette",props:Xi({as:{type:null,required:!1},icon:{type:null,required:!1},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},childrenIcon:{type:null,required:!1},placeholder:{type:String,required:!1},autofocus:{type:Boolean,required:!1,default:!0},close:{type:[Boolean,Object],required:!1},closeIcon:{type:null,required:!1},back:{type:[Boolean,Object],required:!1,default:!0},backIcon:{type:null,required:!1},groups:{type:Array,required:!1},fuse:{type:Object,required:!1},virtualize:{type:[Boolean,Object],required:!1,default:!1},labelKey:{type:null,required:!1,default:"label"},descriptionKey:{type:null,required:!1,default:"description"},preserveGroupOrder:{type:Boolean,required:!1,default:!1},class:{type:null,required:!1},ui:{type:null,required:!1},multiple:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},modelValue:{type:null,required:!1,default:""},defaultValue:{type:null,required:!1},highlightOnHover:{type:Boolean,required:!1,default:!0},selectionBehavior:{type:String,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:""},searchTermModifiers:{}}),emits:Xi(["update:modelValue","highlight","entryFocus","leave","update:open"],["update:searchTerm"]),setup(e,{emit:t}){const i=e,s=t,r=ei(),n=vi(e,"searchTerm",{type:String,default:""}),{t:o}=ns(),a=$t(),h=gi(zt(i,"as","disabled","multiple","modelValue","defaultValue","highlightOnHover"),s),l=Yi(zt(i,"loading")),f=ot(()=>i.virtualize?Mt(typeof i.virtualize=="boolean"?{}:i.virtualize,{estimateSize:cl(E.value,"md",i.descriptionKey)}):!1),[u,d]=Zt({props:{item:{type:Object,required:!0},group:{type:Object,required:!1},index:{type:Number,required:!1}}}),c=te(()=>Ne({extend:Ne(Hh),...a.ui?.commandPalette||{}})({virtualize:!!i.virtualize})),p=te(()=>Mt({},i.fuse,{fuseOptions:{ignoreLocation:!0,threshold:.1,keys:[i.labelKey,"suffix"]},resultLimit:12,matchAllWhenSearchEmpty:!0})),_=J([]),S=te(()=>_.value[_.value.length-1]?.placeholder||i.placeholder||o("commandPalette.placeholder")),w=te(()=>_.value?.length?[_.value[_.value.length-1]]:i.groups),y=te(()=>w.value?.filter(b=>b.id?!b.ignoreFilter:(console.warn("[@nuxt/ui] CommandPalette group is missing an `id` property"),!1))?.flatMap(b=>b.items?.map(M=>({...M,group:b.id}))||[])||[]),{results:x}=zh(n,y,p),g=Ea(x,16,!0);function L(b,M){let m=M;return b?.postFilter&&typeof b.postFilter=="function"&&(m=b.postFilter(n.value,m)),{...b,items:m.slice(0,p.value.resultLimit).map(I=>({...I,labelHtml:Gr(I,n.value,i.labelKey),suffixHtml:Gr(I,n.value,void 0,[i.labelKey])}))}}const B=te(()=>{const b=w.value,M=g.value.reduce((R,D)=>{const{item:X,matches:se}=D;return X.group&&(R[X.group]||=[],R[X.group]?.push({...X,matches:se})),R},{});if(i.preserveGroupOrder){const R=[];for(const D of b||[]){if(!D.items?.length)continue;const X=D.ignoreFilter?D.items:M[D.id];if(!X?.length)continue;const se=L(D,X);se.items?.length&&R.push(se)}return R}const m=Object.entries(M).map(([R,D])=>{const X=b?.find(Ee=>Ee.id===R);if(!X)return;const se=L(X,D);return se.items?.length?se:void 0}).filter(R=>!!R);return(b?.map((R,D)=>({...R,index:D}))?.filter(R=>R.ignoreFilter&&R.items?.length)?.map(R=>({...L(R,R.items||[]),index:R.index}))?.filter(R=>R.items?.length)||[]).reduce((R,D)=>(R.splice(D.index,0,D),R),[...m])}),E=te(()=>B.value.flatMap(b=>b.items||[])),W=Qn("rootRef");function U(b){b.children?.length&&(_.value.push({id:`history-${_.value.length}`,label:b.label,slot:b.slot,placeholder:b.placeholder,items:b.children}),n.value="",W.value?.highlightFirstItem())}function Z(){_.value.length&&(_.value.pop(),n.value="",W.value?.highlightFirstItem())}function V(){n.value||Z()}function A(b,M){M.children?.length?(b.preventDefault(),U(M)):M.onSelect?.(b)}return(b,M)=>(k(),j(ke,null,[O(v(u),null,{default:T(({item:m,index:I,group:R})=>[O(v(il),{value:v(Gi)(m,["matches","group","onSelect","labelHtml","suffixHtml","children"]),disabled:m.disabled,"as-child":"",onSelect:D=>A(D,m)},{default:T(()=>[O(Ni,G(v(zi)(m),{custom:""}),{default:T(({active:D,...X})=>[O(Yt,G(X,{"data-slot":"item",class:c.value.item({class:[i.ui?.item,m.ui?.item,m.class],active:D||m.active})}),{default:T(()=>[Y(b.$slots,m.slot||R?.slot||"item",{item:m,index:I,ui:c.value},()=>[Y(b.$slots,m.slot?`${m.slot}-leading`:R?.slot?`${R.slot}-leading`:"item-leading",{item:m,index:I,ui:c.value},()=>[m.loading?(k(),z(De,{key:0,name:e.loadingIcon||v(a).ui.icons.loading,"data-slot":"itemLeadingIcon",class:H(c.value.itemLeadingIcon({class:[i.ui?.itemLeadingIcon,m.ui?.itemLeadingIcon],loading:!0}))},null,8,["name","class"])):m.icon?(k(),z(De,{key:1,name:m.icon,"data-slot":"itemLeadingIcon",class:H(c.value.itemLeadingIcon({class:[i.ui?.itemLeadingIcon,m.ui?.itemLeadingIcon],active:D||m.active}))},null,8,["name","class"])):m.avatar?(k(),z(kr,G({key:2,size:m.ui?.itemLeadingAvatarSize||i.ui?.itemLeadingAvatarSize||c.value.itemLeadingAvatarSize()},m.avatar,{"data-slot":"itemLeadingAvatar",class:c.value.itemLeadingAvatar({class:[i.ui?.itemLeadingAvatar,m.ui?.itemLeadingAvatar],active:D||m.active})}),null,16,["size","class"])):m.chip?(k(),z(La,G({key:3,size:m.ui?.itemLeadingChipSize||i.ui?.itemLeadingChipSize||c.value.itemLeadingChipSize(),inset:"",standalone:""},m.chip,{"data-slot":"itemLeadingChip",class:c.value.itemLeadingChip({class:[i.ui?.itemLeadingChip,m.ui?.itemLeadingChip],active:D||m.active})}),null,16,["size","class"])):$("",!0)]),m.prefix||m.labelHtml||v(Oe)(m,i.labelKey)||m.suffixHtml||m.suffix||r[m.slot?`${m.slot}-label`:R?.slot?`${R.slot}-label`:"item-label"]||v(Oe)(m,i.descriptionKey)||r[m.slot?`${m.slot}-description`:R?.slot?`${R.slot}-description`:"item-description"]?(k(),j("span",{key:0,"data-slot":"itemWrapper",class:H(c.value.itemWrapper({class:[i.ui?.itemWrapper,m.ui?.itemWrapper]}))},[ie("span",{"data-slot":"itemLabel",class:H(c.value.itemLabel({class:[i.ui?.itemLabel,m.ui?.itemLabel],active:D||m.active}))},[Y(b.$slots,m.slot?`${m.slot}-label`:R?.slot?`${R.slot}-label`:"item-label",{item:m,index:I,ui:c.value},()=>[m.prefix?(k(),j("span",{key:0,"data-slot":"itemLabelPrefix",class:H(c.value.itemLabelPrefix({class:[i.ui?.itemLabelPrefix,m.ui?.itemLabelPrefix]}))},Me(m.prefix),3)):$("",!0),m.labelHtml?(k(),j("span",{key:1,"data-slot":"itemLabelBase",class:H(c.value.itemLabelBase({class:[i.ui?.itemLabelBase,m.ui?.itemLabelBase],active:D||m.active})),innerHTML:m.labelHtml},null,10,$h)):(k(),j("span",{key:2,"data-slot":"itemLabelBase",class:H(c.value.itemLabelBase({class:[i.ui?.itemLabelBase,m.ui?.itemLabelBase],active:D||m.active}))},Me(v(Oe)(m,i.labelKey)),3)),m.suffixHtml?(k(),j("span",{key:3,"data-slot":"itemLabelSuffix",class:H(c.value.itemLabelSuffix({class:[i.ui?.itemLabelSuffix,m.ui?.itemLabelSuffix],active:D||m.active})),innerHTML:m.suffixHtml},null,10,Wh)):m.suffix?(k(),j("span",{key:4,"data-slot":"itemLabelSuffix",class:H(c.value.itemLabelSuffix({class:[i.ui?.itemLabelSuffix,m.ui?.itemLabelSuffix],active:D||m.active}))},Me(m.suffix),3)):$("",!0)])],2),v(Oe)(m,i.descriptionKey)?(k(),j("span",{key:0,"data-slot":"itemDescription",class:H(c.value.itemDescription({class:[i.ui?.itemDescription,m.ui?.itemDescription]}))},[Y(b.$slots,m.slot?`${m.slot}-description`:R?.slot?`${R.slot}-description`:"item-description",{item:m,index:I,ui:c.value},()=>[at(Me(v(Oe)(m,i.descriptionKey)),1)])],2)):$("",!0)],2)):$("",!0),ie("span",{"data-slot":"itemTrailing",class:H(c.value.itemTrailing({class:[i.ui?.itemTrailing,m.ui?.itemTrailing]}))},[Y(b.$slots,m.slot?`${m.slot}-trailing`:R?.slot?`${R.slot}-trailing`:"item-trailing",{item:m,index:I,ui:c.value},()=>[m.children&&m.children.length>0?(k(),z(De,{key:0,name:e.childrenIcon||v(a).ui.icons.chevronRight,"data-slot":"itemTrailingIcon",class:H(c.value.itemTrailingIcon({class:[i.ui?.itemTrailingIcon,m.ui?.itemTrailingIcon]}))},null,8,["name","class"])):m.kbds?.length?(k(),j("span",{key:1,"data-slot":"itemTrailingKbds",class:H(c.value.itemTrailingKbds({class:[i.ui?.itemTrailingKbds,m.ui?.itemTrailingKbds]}))},[(k(!0),j(ke,null,Ge(m.kbds,(se,Ee)=>(k(),z(xr,G({key:Ee,size:m.ui?.itemTrailingKbdsSize||i.ui?.itemTrailingKbdsSize||c.value.itemTrailingKbdsSize()},{ref_for:!0},typeof se=="string"?{value:se}:se),null,16,["size"]))),128))],2)):R?.highlightedIcon?(k(),z(De,{key:2,name:R.highlightedIcon,"data-slot":"itemTrailingHighlightedIcon",class:H(c.value.itemTrailingHighlightedIcon({class:[i.ui?.itemTrailingHighlightedIcon,m.ui?.itemTrailingHighlightedIcon]}))},null,8,["name","class"])):$("",!0)]),m.children?.length?$("",!0):(k(),z(v(sl),{key:0,"as-child":""},{default:T(()=>[O(De,{name:e.selectedIcon||v(a).ui.icons.check,"data-slot":"itemTrailingIcon",class:H(c.value.itemTrailingIcon({class:[i.ui?.itemTrailingIcon,m.ui?.itemTrailingIcon]}))},null,8,["name","class"])]),_:2},1024))],2)])]),_:2},1040,["class"])]),_:2},1040)]),_:2},1032,["value","disabled","onSelect"])]),_:3}),O(v(ll),G({...v(h),...b.$attrs},{ref_key:"rootRef",ref:W,"selection-behavior":e.selectionBehavior,"data-slot":"root",class:c.value.root({class:[i.ui?.root,i.class]})}),{default:T(()=>[O(v(rl),{modelValue:n.value,"onUpdate:modelValue":M[1]||(M[1]=m=>n.value=m),"as-child":""},{default:T(()=>[O(ul,G({placeholder:S.value,variant:"none",autofocus:e.autofocus},v(l),{"loading-icon":e.loadingIcon,"trailing-icon":e.trailingIcon,icon:e.icon||v(a).ui.icons.search,"data-slot":"input",class:c.value.input({class:i.ui?.input}),onKeydown:Yn(V,["backspace"])}),os({_:2},[_.value?.length&&(e.back||r.back)?{name:"leading",fn:T(()=>[Y(b.$slots,"back",{ui:c.value},()=>[O(Jt,G({icon:e.backIcon||v(a).ui.icons.arrowLeft,color:"neutral",variant:"link","aria-label":v(o)("commandPalette.back")},typeof e.back=="object"?e.back:{},{"data-slot":"back",class:c.value.back({class:i.ui?.back}),onClick:Z}),null,16,["icon","aria-label","class"])])]),key:"0"}:void 0,e.close||r.close?{name:"trailing",fn:T(()=>[Y(b.$slots,"close",{ui:c.value},()=>[e.close?(k(),z(Jt,G({key:0,icon:e.closeIcon||v(a).ui.icons.close,color:"neutral",variant:"ghost","aria-label":v(o)("commandPalette.close")},typeof e.close=="object"?e.close:{},{"data-slot":"close",class:c.value.close({class:i.ui?.close}),onClick:M[0]||(M[0]=m=>s("update:open",!1))}),null,16,["icon","aria-label","class"])):$("",!0)])]),key:"1"}:void 0]),1040,["placeholder","autofocus","loading-icon","trailing-icon","icon","class"])]),_:3},8,["modelValue"]),O(v(nl),{"data-slot":"content",class:H(c.value.content({class:i.ui?.content}))},{default:T(()=>[B.value?.length?(k(),j("div",{key:0,role:"presentation","data-slot":"viewport",class:H(c.value.viewport({class:i.ui?.viewport}))},[e.virtualize?(k(),z(v(ol),G({key:0,options:E.value,"text-content":m=>v(Oe)(m,i.labelKey)},f.value),{default:T(({option:m,virtualItem:I})=>[O(v(d),{item:m,index:I.index},null,8,["item","index"])]),_:1},16,["options","text-content"])):(k(!0),j(ke,{key:1},Ge(B.value,m=>(k(),z(v(al),{key:`group-${m.id}`,"data-slot":"group",class:H(c.value.group({class:i.ui?.group}))},{default:T(()=>[v(Oe)(m,i.labelKey)?(k(),z(v(yl),{key:0,"data-slot":"label",class:H(c.value.label({class:i.ui?.label}))},{default:T(()=>[at(Me(v(Oe)(m,i.labelKey)),1)]),_:2},1032,["class"])):$("",!0),(k(!0),j(ke,null,Ge(m.items,(I,R)=>(k(),z(v(d),{key:`group-${m.id}-${R}`,item:I,index:R,group:m},null,8,["item","index","group"]))),128))]),_:2},1032,["class"]))),128))],2)):(k(),j("div",{key:1,"data-slot":"empty",class:H(c.value.empty({class:i.ui?.empty}))},[Y(b.$slots,"empty",{searchTerm:n.value},()=>[at(Me(n.value?v(o)("commandPalette.noMatch",{searchTerm:n.value}):v(o)("commandPalette.noData")),1)])],2))]),_:3},8,["class"]),r.footer?(k(),j("div",{key:0,"data-slot":"footer",class:H(c.value.footer({class:i.ui?.footer}))},[Y(b.$slots,"footer",{ui:c.value})],2)):$("",!0)]),_:3},16,["selection-behavior","class"])],64))}}),Kh={slots:{modal:"",input:"[&>input]:text-base/5"},variants:{fullscreen:{false:{modal:"sm:max-w-3xl h-full sm:h-[28rem]"}}}},Uh=/^[^-]+.*-.*[^-]+$/,Vh=/^[^_]+.*_.*[^_]+$/,Xr=["arrowleft","arrowright","arrowup","arrowright","tab","escape","enter","backspace"];function vs(e){return/^[a-z]$/i.test(e)?`Key${e.toUpperCase()}`:/^\d$/.test(e)?`Digit${e}`:/^f\d+$/i.test(e)?e.toUpperCase():{space:"Space",enter:"Enter",escape:"Escape",tab:"Tab",backspace:"Backspace",delete:"Delete",arrowup:"ArrowUp",arrowdown:"ArrowDown",arrowleft:"ArrowLeft",arrowright:"ArrowRight"}[e.toLowerCase()]||e}function jh(e,t={}){const i=J([]),s=()=>{i.value.splice(0,i.value.length)},r=Ba(s,t.chainDelay??800),{macOS:n}=Wa(),o=Oa(),a=t.layoutIndependent??!1,h=Xr.map(d=>vs(d)),l=d=>{if(!d.key)return;const c=a?/^Key[A-Z]$/i.test(d.code):/^[a-z]{1}$/i.test(d.key),p=a?h.includes(d.code):Xr.includes(d.key.toLowerCase());let _;if(i.value.push(a?d.code:d.key),i.value.length>=2){_=i.value.slice(-2).join("-");for(const S of u.value.filter(w=>w.chained))if(S.key===_){S.enabled&&(d.preventDefault(),S.handler(d)),s();return}}for(const S of u.value.filter(w=>!w.chained)){if(a){if(d.code!==S.key)continue}else if(d.key.toLowerCase()!==S.key)continue;if(d.metaKey===S.metaKey&&d.ctrlKey===S.ctrlKey&&!((c||p)&&d.shiftKey!==S.shiftKey)){S.enabled&&(d.preventDefault(),S.handler(d)),s();return}}r()},f=te(()=>{const d=o.value?.tagName,c=o.value?.contentEditable;return d==="INPUT"||d==="TEXTAREA"||c==="true"||c==="plaintext-only"?o.value?.name||!0:!1}),u=te(()=>Object.entries(dt(e)).map(([d,c])=>{if(!c)return null;let p;d.includes("-")&&d!=="-"&&!d.includes("_")&&!d.match(Uh)?.length&&console.trace(`[Shortcut] Invalid key: "${d}"`),d.includes("_")&&d!=="_"&&!d.match(Vh)?.length&&console.trace(`[Shortcut] Invalid key: "${d}"`);const _=d.includes("-")&&d!=="-"&&!d.includes("_");if(_)a?p={key:d.split("-").map(y=>vs(y)).join("-"),metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1}:p={key:d.toLowerCase(),metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1};else{const w=d.toLowerCase().split("_").map(x=>x);let y=w.filter(x=>!["meta","command","ctrl","shift","alt","option"].includes(x)).join("_");a&&(y=vs(y)),p={key:y,metaKey:w.includes("meta")||w.includes("command"),ctrlKey:w.includes("ctrl"),shiftKey:w.includes("shift"),altKey:w.includes("alt")||w.includes("option")}}if(p.chained=_,!n.value&&p.metaKey&&!p.ctrlKey&&(p.metaKey=!1,p.ctrlKey=!0),typeof c=="function"?p.handler=c:typeof c=="object"&&(p={...p,handler:c.handler}),!p.handler)return console.trace("[Shortcut] Invalid value"),null;let S=!0;return c.usingInput?typeof c.usingInput=="string"&&(S=f.value===c.usingInput):S=!f.value,p.enabled=S,p}).filter(Boolean));return Na("keydown",l)}const Yh={__name:"UDashboardSearch",props:Xi({icon:{type:null,required:!1},placeholder:{type:String,required:!1},autofocus:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},shortcut:{type:String,required:!1,default:"meta_k"},groups:{type:Array,required:!1},fuse:{type:Object,required:!1},colorMode:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:void 0,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},overlay:{type:Boolean,required:!1},transition:{type:Boolean,required:!1},content:{type:Object,required:!1},dismissible:{type:Boolean,required:!1},fullscreen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0}},{open:{type:Boolean,default:!1},openModifiers:{},searchTerm:{type:String,default:""},searchTermModifiers:{}}),emits:["update:open","update:searchTerm"],setup(e,{expose:t}){const i=e,s=ei(),r=vi(e,"open",{type:Boolean,default:!1}),n=vi(e,"searchTerm",{type:String,default:""});Ts("dashboard:search:toggle",()=>{r.value=!r.value});const{t:o}=ns(),a=Da(),h=$t(),l=Yi(zt(i,"icon","placeholder","autofocus","loading","loadingIcon","close","closeIcon")),f=Yi(zt(i,"overlay","transition","content","dismissible","fullscreen","modal","portal")),u=()=>Gi(s,["content"]),d=te(()=>Mt({},i.fuse,{fuseOptions:{}})),c=te(()=>Ne({extend:Ne(Kh),...h.ui?.dashboardSearch||{}})({fullscreen:i.fullscreen})),p=te(()=>{const w=[];return w.push(...i.groups||[]),i.colorMode&&!a?.forced&&w.push({id:"theme",label:o("dashboardSearch.theme"),items:[{label:o("colorMode.system"),icon:h.ui.icons.system,active:a.preference==="system",onSelect:()=>{a.preference="system"}},{label:o("colorMode.light"),icon:h.ui.icons.light,active:a.preference==="light",onSelect:()=>{a.preference="light"}},{label:o("colorMode.dark"),icon:h.ui.icons.dark,active:a.preference==="dark",onSelect:()=>{a.preference="dark"}}]}),w}),_=Qn("commandPaletteRef");function S(w){w.disabled||(r.value=!1,n.value="")}return jh({[i.shortcut]:{usingInput:!0,handler:()=>r.value=!r.value}}),t({commandPaletteRef:_}),(w,y)=>(k(),z(Er,G({open:r.value,"onUpdate:open":y[2]||(y[2]=x=>r.value=x),title:e.title||v(o)("dashboardSearch.title"),description:e.description||v(o)("dashboardSearch.description")},v(f),{"data-slot":"modal",class:c.value.modal({class:[i.ui?.modal,i.class]})}),{content:T(x=>[Y(w.$slots,"content",Et(Lt(x)),()=>[O(qh,G({ref_key:"commandPaletteRef",ref:_,"search-term":n.value,"onUpdate:searchTerm":y[0]||(y[0]=g=>n.value=g)},v(l),{groups:p.value,fuse:d.value,ui:v(Jn)(v(Gi)(c.value,["modal"]),i.ui),"onUpdate:modelValue":S,"onUpdate:open":y[1]||(y[1]=g=>r.value=g)}),os({_:2},[Ge(u(),(g,L)=>({name:L,fn:T(B=>[Y(w.$slots,L,Et(Lt(B)))])}))]),1040,["search-term","groups","fuse","ui"])])]),_:3},16,["open","title","description","class"]))}};function Gh(){const e=J(""),t=Ma(e,300),i=J(!1),s=J({tasks:[],documents:[]});Ce(t,async n=>{if(!n||n.length<2){s.value={tasks:[],documents:[]};return}i.value=!0;try{const[o,a]=await Promise.all([$fetch("/api/tasks",{query:{search:n}}),$fetch("/api/documents",{query:{search:n}})]);s.value={tasks:o.data.slice(0,5),documents:a.data.slice(0,5)}}catch{s.value={tasks:[],documents:[]}}finally{i.value=!1}});function r(){e.value="",s.value={tasks:[],documents:[]}}return{searchTerm:e,loading:i,results:s,reset:r}}const Xh=ze({__name:"DashboardSearch",setup(e){const t=Ra(),i=Ta(),{searchTerm:s,loading:r,results:n,reset:o}=Gh(),a={todo:"i-lucide-circle",in_progress:"i-lucide-clock",done:"i-lucide-check-circle",blocked:"i-lucide-alert-circle"},h={1:"Low",2:"Medium",3:"High"},l=[{label:"Dashboard",icon:"i-lucide-layout-dashboard",to:"/dashboard",kbds:["G","D"]},{label:"Tasks",icon:"i-lucide-check-square",to:"/tasks",kbds:["G","T"]},{label:"Docs",icon:"i-lucide-file-text",to:"/docs",kbds:["G","O"]},{label:"Settings",icon:"i-lucide-settings",to:"/settings",kbds:["G","S"]}],f=[{label:"Create new document",icon:"i-lucide-file-plus",onSelect:()=>{t.push("/docs"),i.add({title:"Create a document",description:"Right-click in the file tree to create a new file",icon:"i-lucide-info"}),o()}},{label:"Add new task",icon:"i-lucide-plus-square",onSelect:()=>{t.push("/tasks?action=new"),o()}}],u=te(()=>{const d=[];return n.value.tasks.length&&d.push({id:"tasks",label:"Tasks",ignoreFilter:!0,items:n.value.tasks.map(c=>({label:c.title,icon:a[c.status]||"i-lucide-circle",suffix:c.project?.name||h[c.priority]||"",onSelect:()=>{t.push(`/tasks?selected=${c.id}`),o()}}))}),n.value.documents.length&&d.push({id:"documents",label:"Documents",ignoreFilter:!0,items:n.value.documents.map(c=>({label:c.title,icon:"i-lucide-file-text",suffix:c.path,onSelect:()=>{t.push(`/docs?path=${encodeURIComponent(c.path)}`),o()}}))}),d.push({id:"navigation",label:"Navigation",items:l}),d.push({id:"actions",label:"Actions",items:f,postFilter:(c,p)=>{if(!c)return p;const _=c.toLowerCase();return["new","create","add"].some(S=>_.includes(S))?p:[]}}),d});return(d,c)=>{const p=Yh;return k(),z(p,{"search-term":v(s),"onUpdate:searchTerm":c[0]||(c[0]=_=>mi(s)?s.value=_:null),groups:v(u),loading:v(r),placeholder:"Search tasks, docs, or type a command...",fuse:{resultLimit:10}},null,8,["search-term","groups","loading"])}}}),Jh=Object.assign(Xh,{__name:"SearchDashboardSearch"});var mo=Object.defineProperty,Zh=Object.getOwnPropertyDescriptor,Qh=(e,t)=>{for(var i in t)mo(e,i,{get:t[i],enumerable:!0})},ce=(e,t,i,s)=>{for(var r=s>1?void 0:s?Zh(t,i):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&mo(t,i,r),r},N=(e,t)=>(i,s)=>t(i,s,e),Jr="Terminal input",Fs={get:()=>Jr,set:e=>Jr=e},Zr="Too much output to announce, navigate to rows manually to read",Hs={get:()=>Zr,set:e=>Zr=e};function ec(e){return e.replace(/\r?\n/g,"\r")}function tc(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function ic(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function sc(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let r=e.clipboardData.getData("text/plain");So(r,t,i,s)}}function So(e,t,i,s){e=ec(e),e=tc(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function bo(e,t,i){let s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function Qr(e,t,i,s,r){bo(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function xt(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function ls(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let n=e[r];n>65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var rc=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){let n=e.charCodeAt(r++);56320<=n&&n<=57343?t[s++]=(this._interim-55296)*1024+n-56320+65536:(t[s++]=this._interim,t[s++]=n),this._interim=0}for(let n=r;n<i;++n){let o=e.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=i)return this._interim=o,s;let a=e.charCodeAt(n);56320<=a&&a<=57343?t[s++]=(o-55296)*1024+a-56320+65536:(t[s++]=o,t[s++]=a);continue}o!==65279&&(t[s++]=o)}return s}},nc=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r,n,o,a,h=0,l=0;if(this.interim[0]){let d=!1,c=this.interim[0];c&=(c&224)===192?31:(c&240)===224?15:7;let p=0,_;for(;(_=this.interim[++p]&63)&&p<4;)c<<=6,c|=_;let S=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,w=S-p;for(;l<w;){if(l>=i)return 0;if(_=e[l++],(_&192)!==128){l--,d=!0;break}else this.interim[p++]=_,c<<=6,c|=_&63}d||(S===2?c<128?l--:t[s++]=c:S===3?c<2048||c>=55296&&c<=57343||c===65279||(t[s++]=c):c<65536||c>1114111||(t[s++]=c)),this.interim.fill(0)}let f=i-4,u=l;for(;u<i;){for(;u<f&&!((r=e[u])&128)&&!((n=e[u+1])&128)&&!((o=e[u+2])&128)&&!((a=e[u+3])&128);)t[s++]=r,t[s++]=n,t[s++]=o,t[s++]=a,u+=4;if(r=e[u++],r<128)t[s++]=r;else if((r&224)===192){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(h=(r&31)<<6|n&63,h<128){u--;continue}t[s++]=h}else if((r&240)===224){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[u++],(o&192)!==128){u--;continue}if(h=(r&15)<<12|(n&63)<<6|o&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[s++]=h}else if((r&248)===240){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[u++],(o&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=o,s;if(a=e[u++],(a&192)!==128){u--;continue}if(h=(r&7)<<18|(n&63)<<12|(o&63)<<6|a&63,h<65536||h>1114111)continue;t[s++]=h}}return s}},yo="",Bt=" ",ki=class wo{constructor(){this.fg=0,this.bg=0,this.extended=new Qi}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new wo;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Qi=class Co{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Co(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Xe=class ko extends ki{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Qi,this.combinedData=""}static fromCharData(t){let i=new ko;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?xt(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},en="di$target",$s="di$dependencies",ms=new Map;function oc(e){return e[$s]||[]}function we(e){if(ms.has(e))return ms.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ac(t,i,r)};return t._id=e,ms.set(e,t),t}function ac(e,t,i){t[en]===t?t[$s].push({id:e,index:i}):(t[$s]=[{id:e,index:i}],t[en]=t)}var Te=we("BufferService"),xo=we("CoreMouseService"),qt=we("CoreService"),lc=we("CharsetService"),Rr=we("InstantiationService"),Eo=we("LogService"),Ae=we("OptionsService"),Lo=we("OscLinkService"),hc=we("UnicodeService"),xi=we("DecorationService"),Ws=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,n=new Xe,o=i.getTrimmedLength(),a=-1,h=-1,l=!1;for(let f=0;f<o;f++)if(!(h===-1&&!i.hasContent(f))){if(i.loadCell(f,n),n.hasExtendedAttrs()&&n.extended.urlId)if(h===-1){h=f,a=n.extended.urlId;continue}else l=n.extended.urlId!==a;else h!==-1&&(l=!0);if(l||h!==-1&&f===o-1){let u=this._oscLinkService.getLinkData(a)?.uri;if(u){let d={start:{x:h+1,y:e},end:{x:f+(!l&&f===o-1?1:0),y:e}},c=!1;if(!r?.allowNonHttpProtocols)try{let p=new URL(u);["http:","https:"].includes(p.protocol)||(c=!0)}catch{c=!0}c||s.push({text:u,range:d,activate:(p,_)=>r?r.activate(p,_,d):cc(p,_),hover:(p,_)=>r?.hover?.(p,_,d),leave:(p,_)=>r?.leave?.(p,_,d)})}l=!1,n.hasExtendedAttrs()&&n.extended.urlId?(h=f,a=n.extended.urlId):(h=-1,a=-1)}}t(s)}};Ws=ce([N(0,Te),N(1,Ae),N(2,Lo)],Ws);function cc(e,t){if(confirm(`Do you want to navigate to ${t}?
2
2
 
3
3
  WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var hs=we("CharSizeService"),vt=we("CoreBrowserService"),Tr=we("MouseService"),mt=we("RenderService"),uc=we("SelectionService"),Bo=we("CharacterJoinerService"),ii=we("ThemeService"),Do=we("LinkProviderService"),dc=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?tn.isErrorNoTelemetry(e)?new tn(e.message+`
4
4
 
@@ -13,4 +13,4 @@ WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){t
13
13
  `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Hr&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s||!t?!1:this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s?!1:this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=yn(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Fr(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-ks),ks),t/=ks,t/Math.abs(t)+Math.round(t*(od-1)))}shouldForceSelection(e){return is?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),ad)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(is&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let s=i.lines.get(this._model.selectionEnd[1]);s&&s.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<ld&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&i[0]!==void 0&&i[1]!==void 0){let s=Zu(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!i){this._oldHasSelection&&this._fireOnSelectionChange(e,t,i);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){let r=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:r>1&&t!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;let o=r.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(n,e[0]),h=a,l=e[0]-a,f=0,u=0,d=0,c=0;if(o.charAt(a)===" "){for(;a>0&&o.charAt(a-1)===" ";)a--;for(;h<o.length&&o.charAt(h+1)===" ";)h++}else{let S=e[0],w=e[0];n.getWidth(S)===0&&(f++,S--),n.getWidth(w)===2&&(u++,w++);let y=n.getString(w).length;for(y>1&&(c+=y-1,h+=y-1);S>0&&a>0&&!this._isCharWordSeparator(n.loadCell(S-1,this._workCell));){n.loadCell(S-1,this._workCell);let x=this._workCell.getChars().length;this._workCell.getWidth()===0?(f++,S--):x>1&&(d+=x-1,a-=x-1),a--,S--}for(;w<n.length&&h+1<o.length&&!this._isCharWordSeparator(n.loadCell(w+1,this._workCell));){n.loadCell(w+1,this._workCell);let x=this._workCell.getChars().length;this._workCell.getWidth()===2?(u++,w++):x>1&&(c+=x-1,h+=x-1),h++,w++}}h++;let p=a+l-f+d,_=Math.min(this._bufferService.cols,h-a+f+u-d-c);if(!(!t&&o.slice(a,h).trim()==="")){if(i&&p===0&&n.getCodePoint(0)!==32){let S=r.lines.get(e[1]-1);if(S&&n.isWrapped&&S.getCodePoint(this._bufferService.cols-1)!==32){let w=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(w){let y=this._bufferService.cols-w.start;p-=y,_+=y}}}if(s&&p+_===this._bufferService.cols&&n.getCodePoint(this._bufferService.cols-1)!==32){let S=r.lines.get(e[1]+1);if(S?.isWrapped&&S.getCodePoint(0)!==32){let w=this._getWordAt([0,e[1]+1],!1,!1,!0);w&&(_+=w.length)}}return{start:p,length:_}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=yn(i,this._bufferService.cols)}};dr=ce([N(3,Te),N(4,qt),N(5,Tr),N(6,Ae),N(7,mt),N(8,vt)],dr);var wn=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},Cn=class{constructor(){this._color=new wn,this._css=new wn}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},pe=Object.freeze((()=>{let e=[le.toColor("#2e3436"),le.toColor("#cc0000"),le.toColor("#4e9a06"),le.toColor("#c4a000"),le.toColor("#3465a4"),le.toColor("#75507b"),le.toColor("#06989a"),le.toColor("#d3d7cf"),le.toColor("#555753"),le.toColor("#ef2929"),le.toColor("#8ae234"),le.toColor("#fce94f"),le.toColor("#729fcf"),le.toColor("#ad7fa8"),le.toColor("#34e2e2"),le.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let s=t[i/36%6|0],r=t[i/6%6|0],n=t[i%6];e.push({css:_e.toCss(s,r,n),rgba:_e.toRgba(s,r,n)})}for(let i=0;i<24;i++){let s=8+i*10;e.push({css:_e.toCss(s,s,s),rgba:_e.toRgba(s,s,s)})}return e})()),At=le.toColor("#ffffff"),ui=le.toColor("#000000"),kn=le.toColor("#ffffff"),xn=ui,oi={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},ud=At,fr=class extends ee{constructor(e){super(),this._optionsService=e,this._contrastCache=new Cn,this._halfContrastCache=new Cn,this._onChangeColors=this._register(new P),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:At,background:ui,cursor:kn,cursorAccent:xn,selectionForeground:void 0,selectionBackgroundTransparent:oi,selectionBackgroundOpaque:ne.blend(ui,oi),selectionInactiveBackgroundTransparent:oi,selectionInactiveBackgroundOpaque:ne.blend(ui,oi),scrollbarSliderBackground:ne.opacity(At,.2),scrollbarSliderHoverBackground:ne.opacity(At,.4),scrollbarSliderActiveBackground:ne.opacity(At,.5),overviewRulerBorder:At,ansi:pe.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=re(e.foreground,At),t.background=re(e.background,ui),t.cursor=ne.blend(t.background,re(e.cursor,kn)),t.cursorAccent=ne.blend(t.background,re(e.cursorAccent,xn)),t.selectionBackgroundTransparent=re(e.selectionBackground,oi),t.selectionBackgroundOpaque=ne.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=re(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=ne.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?re(e.selectionForeground,mn):void 0,t.selectionForeground===mn&&(t.selectionForeground=void 0),ne.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=ne.opacity(t.selectionBackgroundTransparent,.3)),ne.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=ne.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=re(e.scrollbarSliderBackground,ne.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=re(e.scrollbarSliderHoverBackground,ne.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=re(e.scrollbarSliderActiveBackground,ne.opacity(t.foreground,.5)),t.overviewRulerBorder=re(e.overviewRulerBorder,ud),t.ansi=pe.slice(),t.ansi[0]=re(e.black,pe[0]),t.ansi[1]=re(e.red,pe[1]),t.ansi[2]=re(e.green,pe[2]),t.ansi[3]=re(e.yellow,pe[3]),t.ansi[4]=re(e.blue,pe[4]),t.ansi[5]=re(e.magenta,pe[5]),t.ansi[6]=re(e.cyan,pe[6]),t.ansi[7]=re(e.white,pe[7]),t.ansi[8]=re(e.brightBlack,pe[8]),t.ansi[9]=re(e.brightRed,pe[9]),t.ansi[10]=re(e.brightGreen,pe[10]),t.ansi[11]=re(e.brightYellow,pe[11]),t.ansi[12]=re(e.brightBlue,pe[12]),t.ansi[13]=re(e.brightMagenta,pe[13]),t.ansi[14]=re(e.brightCyan,pe[14]),t.ansi[15]=re(e.brightWhite,pe[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<i;s++)t.ansi[s+16]=re(e.extendedAnsi[s],pe[s+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};fr=ce([N(0,Ae)],fr);function re(e,t){if(e!==void 0)try{return le.toColor(e)}catch{}return t}var dd=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(let[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},fd=class{constructor(){this._services=new dd,this._services.set(Rr,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=oc(e).sort((n,o)=>n.index-o.index),s=[];for(let n of i){let o=this._services.get(n.id);if(!o)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${n.id._id}.`);s.push(o)}let r=i.length>0?i[0].index:t.length;if(t.length!==r)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);return new e(...t,...s)}},_d={trace:0,debug:1,info:2,warn:3,error:4,off:5},pd="xterm.js: ",_r=class extends ee{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=_d[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":pd)+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};_r=ce([N(0,Ae)],_r);var En=class extends ee{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new P),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new P),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new P),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...i){if(t){for(let s=e;s<this._length-t;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<i.length;s++)this._array[this._getCyclicIndex(e+s)]=i[s];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));let s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+i,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Q=3,fe=Object.freeze(new ki),Oi=0,xs=2,di=class ia{constructor(t,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Q);let r=i||Xe.fromCharData([0,yo,1,0]);for(let n=0;n<t;++n)this.setCell(n,r);this.length=t}get(t){let i=this._data[t*Q+0],s=i&2097151;return[this._data[t*Q+1],i&2097152?this._combined[t]:s?xt(s):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*Q+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*Q+0]=t|2097152|i[2]<<22):this._data[t*Q+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*Q+0]>>22}hasWidth(t){return this._data[t*Q+0]&12582912}getFg(t){return this._data[t*Q+1]}getBg(t){return this._data[t*Q+2]}hasContent(t){return this._data[t*Q+0]&4194303}getCodePoint(t){let i=this._data[t*Q+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*Q+0]&2097152}getString(t){let i=this._data[t*Q+0];return i&2097152?this._combined[t]:i&2097151?xt(i&2097151):""}isProtected(t){return this._data[t*Q+2]&536870912}loadCell(t,i){return Oi=t*Q,i.content=this._data[Oi+0],i.fg=this._data[Oi+1],i.bg=this._data[Oi+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*Q+0]=i.content,this._data[t*Q+1]=i.fg,this._data[t*Q+2]=i.bg}setCellFromCodepoint(t,i,s,r){r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Q+0]=i|s<<22,this._data[t*Q+1]=r.fg,this._data[t*Q+2]=r.bg}addCodepointToCell(t,i,s){let r=this._data[t*Q+0];r&2097152?this._combined[t]+=xt(i):r&2097151?(this._combined[t]=xt(r&2097151)+xt(i),r&=-2097152,r|=2097152):r=i|1<<22,s&&(r&=-12582913,r|=s<<22),this._data[t*Q+0]=r}insertCells(t,i,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length-t){let r=new Xe;for(let n=this.length-t-i-1;n>=0;--n)this.setCell(t+i+n,this.loadCell(t+n,r));for(let n=0;n<i;++n)this.setCell(t+n,s)}else for(let r=t;r<this.length;++r)this.setCell(r,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(t,i,s){if(t%=this.length,i<this.length-t){let r=new Xe;for(let n=0;n<this.length-t-i;++n)this.setCell(t+n,this.loadCell(t+i+n,r));for(let n=this.length-i;n<this.length;++n)this.setCell(n,s)}else for(let r=t;r<this.length;++r)this.setCell(r,s);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,s)}replaceCells(t,i,s,r=!1){if(r){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,s),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.setCell(t++,s)}resize(t,i){if(t===this.length)return this._data.length*4*xs<this._data.buffer.byteLength;let s=t*Q;if(t>this.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let r=new Uint32Array(s);r.set(this._data),this._data=r}for(let r=this.length;r<t;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,s);let r=Object.keys(this._combined);for(let o=0;o<r.length;o++){let a=parseInt(r[o],10);a>=t&&delete this._combined[a]}let n=Object.keys(this._extendedAttrs);for(let o=0;o<n.length;o++){let a=parseInt(n[o],10);a>=t&&delete this._extendedAttrs[a]}}return this.length=t,s*4*xs<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*xs<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i){for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,t);return}this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(let i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){let t=new ia(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let i in this._combined)t._combined[i]=this._combined[i];for(let i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Q+0]&4194303)return t+(this._data[t*Q+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Q+0]&4194303||this._data[t*Q+2]&50331648)return t+(this._data[t*Q+0]>>22);return 0}copyCellsFrom(t,i,s,r,n){let o=t._data;if(n)for(let h=r-1;h>=0;h--){for(let l=0;l<Q;l++)this._data[(s+h)*Q+l]=o[(i+h)*Q+l];o[(i+h)*Q+2]&268435456&&(this._extendedAttrs[s+h]=t._extendedAttrs[i+h])}else for(let h=0;h<r;h++){for(let l=0;l<Q;l++)this._data[(s+h)*Q+l]=o[(i+h)*Q+l];o[(i+h)*Q+2]&268435456&&(this._extendedAttrs[s+h]=t._extendedAttrs[i+h])}let a=Object.keys(t._combined);for(let h=0;h<a.length;h++){let l=parseInt(a[h],10);l>=i&&(this._combined[l-i+s]=t._combined[l])}}translateToString(t,i,s,r){i=i??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),r&&(r.length=0);let n="";for(;i<s;){let o=this._data[i*Q+0],a=o&2097151,h=o&2097152?this._combined[i]:a?xt(a):Bt;if(n+=h,r)for(let l=0;l<h.length;++l)r.push(i);i+=o>>22||1}return r&&r.push(i),n}};function gd(e,t,i,s,r,n){let o=[];for(let a=0;a<e.length-1;a++){let h=a,l=e.get(++h);if(!l.isWrapped)continue;let f=[e.get(a)];for(;h<e.length&&l.isWrapped;)f.push(l),l=e.get(++h);if(!n&&s>=a&&s<h){a+=f.length-1;continue}let u=0,d=yi(f,u,t),c=1,p=0;for(;c<f.length;){let S=yi(f,c,t),w=S-p,y=i-d,x=Math.min(w,y);f[u].copyCellsFrom(f[c],p,d,x,!1),d+=x,d===i&&(u++,d=0),p+=x,p===S&&(c++,p=0),d===0&&u!==0&&f[u-1].getWidth(i-1)===2&&(f[u].copyCellsFrom(f[u-1],i-1,d++,1,!1),f[u-1].setCell(i-1,r))}f[u].replaceCells(d,i,r);let _=0;for(let S=f.length-1;S>0&&(S>u||f[S].getTrimmedLength()===0);S--)_++;_>0&&(o.push(a+f.length-_),o.push(_)),a+=f.length-1}return o}function vd(e,t){let i=[],s=0,r=t[s],n=0;for(let o=0;o<e.length;o++)if(r===o){let a=t[++s];e.onDeleteEmitter.fire({index:o-n,amount:a}),o+=a-1,n+=a,r=t[++s]}else i.push(o);return{layout:i,countRemoved:n}}function md(e,t){let i=[];for(let s=0;s<t.length;s++)i.push(e.get(t[s]));for(let s=0;s<i.length;s++)e.set(s,i[s]);e.length=t.length}function Sd(e,t,i){let s=[],r=e.map((h,l)=>yi(e,l,t)).reduce((h,l)=>h+l),n=0,o=0,a=0;for(;a<r;){if(r-a<i){s.push(r-a);break}n+=i;let h=yi(e,o,t);n>h&&(n-=h,o++);let l=e[o].getWidth(n-1)===2;l&&n--;let f=l?i-1:i;s.push(f),a+=f}return s}function yi(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,r=e[t+1].getWidth(0)===2;return s&&r?i-1:i}var sa=class ra{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=ra._nextId++,this._onDispose=this.register(new P),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Ft(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};sa._nextId=1;var bd=sa,ve={},Pt=ve.B;ve[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};ve.A={"#":"£"};ve.B=void 0;ve[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ve.C=ve[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ve.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ve.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ve.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ve.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ve.E=ve[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ve.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ve.H=ve[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ve["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Ln=4294967295,Bn=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=fe.clone(),this.savedCharset=Pt,this.markers=[],this._nullCell=Xe.fromCharData([0,yo,1,0]),this._whitespaceCell=Xe.fromCharData([0,Bt,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new ss,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new En(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Qi),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Qi),this._whitespaceCell}getBlankLine(e,t){return new di(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>Ln?Ln:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=fe);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new En(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(fe),s=0,r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols<e)for(let o=0;o<this.lines.length;o++)s+=+this.lines.get(o).resize(e,i);let n=0;if(this._rows<t)for(let o=this._rows;o<t;o++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new di(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new di(e,i)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){let o=this.lines.length-r;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let n=0;n<this.lines.length;n++)s+=+this.lines.get(n).resize(e,i);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),s>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=gd(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(fe),i);if(s.length>0){let r=vd(this.lines,s);md(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let s=this.getNullCell(fe),r=i;for(;r-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new di(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=this.getNullCell(fe),r=[],n=0;for(let o=this.lines.length-1;o>=0;o--){let a=this.lines.get(o);if(!a||!a.isWrapped&&a.getTrimmedLength()<=e)continue;let h=[a];for(;a.isWrapped&&o>0;)a=this.lines.get(--o),h.unshift(a);if(!i){let x=this.ybase+this.y;if(x>=o&&x<o+h.length)continue}let l=h[h.length-1].getTrimmedLength(),f=Sd(h,this._cols,e),u=f.length-h.length,d;this.ybase===0&&this.y!==this.lines.length-1?d=Math.max(0,this.y-this.lines.maxLength+u):d=Math.max(0,this.lines.length-this.lines.maxLength+u);let c=[];for(let x=0;x<u;x++){let g=this.getBlankLine(fe,!0);c.push(g)}c.length>0&&(r.push({start:o+h.length+n,newLines:c}),n+=c.length),h.push(...c);let p=f.length-1,_=f[p];_===0&&(p--,_=f[p]);let S=h.length-u-1,w=l;for(;S>=0;){let x=Math.min(w,_);if(h[p]===void 0)break;if(h[p].copyCellsFrom(h[S],w-x,_-x,x,!0),_-=x,_===0&&(p--,_=f[p]),w-=x,w===0){S--;let g=Math.max(S,0);w=yi(h,g,this._cols)}}for(let x=0;x<h.length;x++)f[x]<e&&h[x].setCell(f[x],s);let y=u-d;for(;y-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+u,this.ybase+t-1)}if(r.length>0){let o=[],a=[];for(let _=0;_<this.lines.length;_++)a.push(this.lines.get(_));let h=this.lines.length,l=h-1,f=0,u=r[f];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);let d=0;for(let _=Math.min(this.lines.maxLength-1,h+n-1);_>=0;_--)if(u&&u.start>l+d){for(let S=u.newLines.length-1;S>=0;S--)this.lines.set(_--,u.newLines[S]);_++,o.push({index:l+1,amount:u.newLines.length}),d+=u.newLines.length,u=r[++f]}else this.lines.set(_,a[l--]);let c=0;for(let _=o.length-1;_>=0;_--)o[_].index+=c,this.lines.onInsertEmitter.fire(o[_]),c+=o[_].amount;let p=Math.max(0,h+n-this.lines.maxLength);p>0&&this.lines.onTrimEmitter.fire(p)}}translateBufferLineToString(e,t,i=0,s){let r=this.lines.get(e);return r?r.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new bd(e);return this.markers.push(t),t.register(this.lines.onTrim(i=>{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.line<i.index+i.amount&&t.dispose(),t.line>i.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},yd=class extends ee{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new P),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new Bn(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Bn(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},na=2,oa=1,pr=class extends ee{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new P),this.onResize=this._onResize.event,this._onScroll=this._register(new P),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,na),this.rows=Math.max(e.rawOptions.rows||0,oa),this.buffers=this._register(new yd(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(i.scrollTop===0){let o=i.lines.isFull;n===i.lines.length-1?o?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),o?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let o=n-r+1;i.lines.shiftElements(r+1,o-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),s!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};pr=ce([N(0,Ae)],pr);var jt={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:is,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},wd=["normal","bold","100","200","300","400","500","600","700","800","900"],Cd=class extends ee{constructor(e){super(),this._onOptionChange=this._register(new P),this.onOptionChange=this._onOptionChange.event;let t={...jt};for(let i in e)if(i in t)try{let s=e[i];t[i]=this._sanitizeAndValidateOption(i,s)}catch(s){console.error(s)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(oe(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in jt))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in jt))throw new Error(`No option with key "${i}"`);s=this._sanitizeAndValidateOption(i,s),this.rawOptions[i]!==s&&(this.rawOptions[i]=s,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let s={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=jt[e]),!kd(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=jt[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=wd.includes(t)?t:jt[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function kd(e){return e==="block"||e==="underline"||e==="bar"}function fi(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let s in e)i[s]=t<=1?e[s]:e[s]&&fi(e[s],t-1);return i}var Dn=Object.freeze({insertMode:!1}),Mn=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),gr=class extends ee{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new P),this.onData=this._onData.event,this._onUserInput=this._register(new P),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new P),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new P),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=fi(Dn),this.decPrivateModes=fi(Mn)}reset(){this.modes=fi(Dn),this.decPrivateModes=fi(Mn)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};gr=ce([N(0,Te),N(1,Eo),N(2,Ae)],gr);var Rn={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Es(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}var Ls=String.fromCharCode,Tn={DEFAULT:e=>{let t=[Es(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Ls(t[0])}${Ls(t[1])}${Ls(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Es(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Es(e,!0)};${e.x};${e.y}${t}`}},vr=class extends ee{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new P),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(Rn))this.addProtocol(s,Rn[s]);for(let s of Object.keys(Tn))this.addEncoding(s,Tn[s]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let s=t/i,r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=s+0,Math.abs(e.deltaY)<50&&(r*=.3),this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};vr=ce([N(0,Te),N(1,qt),N(2,Ae)],vr);var Bs=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],xd=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],ge;function Ed(e,t){let i=0,s=t.length-1,r;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e<t[r][0])s=r-1;else return!0;return!1}var Ld=class{constructor(){if(this.version="6",!ge){ge=new Uint8Array(65536),ge.fill(1),ge[0]=0,ge.fill(0,1,32),ge.fill(0,127,160),ge.fill(2,4352,4448),ge[9001]=2,ge[9002]=2,ge.fill(2,11904,42192),ge[12351]=1,ge.fill(2,44032,55204),ge.fill(2,63744,64256),ge.fill(2,65040,65050),ge.fill(2,65072,65136),ge.fill(2,65280,65377),ge.fill(2,65504,65511);for(let e=0;e<Bs.length;++e)ge.fill(0,Bs[e][0],Bs[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ge[e]:Ed(e,xd)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let r=Ot.extractWidth(t);r===0?s=!1:r>i&&(i=r)}return Ot.createPropertyValue(0,i,s)}},Ot=class Ui{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new P,this.onChange=this._onChange.event;let t=new Ld;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,s=!1){return(t&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,s=0,r=t.length;for(let n=0;n<r;++n){let o=t.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=r)return i+this.wcwidth(o);let l=t.charCodeAt(n);56320<=l&&l<=57343?o=(o-55296)*1024+l-56320+65536:i+=this.wcwidth(l)}let a=this.charProperties(o,s),h=Ui.extractWidth(a);Ui.extractShouldJoin(a)&&(h-=Ui.extractWidth(s)),i+=h,s=a}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},Bd=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function An(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}var ai=2147483647,Dd=256,aa=class mr{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>Dd)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new mr;if(!t.length)return i;for(let s=Array.isArray(t[0])?1:0;s<t.length;++s){let r=t[s];if(Array.isArray(r))for(let n=0;n<r.length;++n)i.addSubParam(r[n]);else i.addParam(r)}return i}clone(){let t=new mr(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let i=0;i<this.length;++i){t.push(this.params[i]);let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>ai?ai:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>ai?ai:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,s=this._subParamsIdx[t]&255;return s-i>0?this._subParams.subarray(i,s):null}getSubParamsAll(){let t={};for(let i=0;i<this.length;++i){let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&(t[i]=this._subParams.slice(s,r))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,r=s[i-1];s[i-1]=~r?Math.min(r*10+t,ai):t}},li=[],Md=class{constructor(){this._state=0,this._active=li,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=li}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=li,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||li,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,i){if(!this._active.length)this._handlerFb(this._id,"PUT",ls(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t<i;){let s=e[t++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-48}this._state===2&&i-t>0&&this._put(e,t,i)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].end(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=li,this._id=-1,this._state=0}}},$e=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=ls(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},hi=[],Rd=class{constructor(){this._handlers=Object.create(null),this._active=hi,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=hi}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=hi,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||hi,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",ls(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].unhook(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=hi,this._ident=0}},_i=new aa;_i.addParam(0);var Pn=class{constructor(e){this._handler=e,this._data="",this._params=_i,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():_i,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=ls(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(i=>(this._params=_i,this._data="",this._hitLimit=!1,i));return this._params=_i,this._data="",this._hitLimit=!1,t}},Td=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}},Ye=160,Ad=(function(){let e=new Td(4095),t=Array.apply(null,Array(256)).map((a,h)=>h),i=(a,h)=>t.slice(a,h),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));let n=i(0,14),o;e.setDefault(1,0),e.addMany(s,0,2,0);for(o in n)e.addMany([24,26,153,154],o,3,0),e.addMany(i(128,144),o,3,0),e.addMany(i(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Ye,0,2,0),e.add(Ye,8,5,8),e.add(Ye,6,0,6),e.add(Ye,11,0,11),e.add(Ye,13,13,13),e})(),Pd=class extends ee{constructor(e=Ad){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new aa,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,s)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(oe(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Md),this._dcsParser=this._register(new Rd),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let r=0;r<e.intermediates.length;++r){let n=e.intermediates.charCodeAt(r);if(32>n||n>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=n}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let s=this._escHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let s=this._csiHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s=0,r=0,n=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,n=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let a=this._parseStack.handlers,h=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&h>-1){for(;h>=0&&(o=a[h](this._params),o!==!0);h--)if(o instanceof Promise)return this._parseStack.handlerPos=h,o}this._parseStack.handlers=[];break;case 4:if(i===!1&&h>-1){for(;h>=0&&(o=a[h](),o!==!0);h--)if(o instanceof Promise)return this._parseStack.handlerPos=h,o}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(s!==24&&s!==26,i),o)return o;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],o=this._oscParser.end(s!==24&&s!==26,i),o)return o;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,n=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let a=n;a<t;++a){switch(s=e[a],r=this._transitions.table[this.currentState<<8|(s<160?s:Ye)],r>>4){case 2:for(let d=a+1;;++d){if(d>=t||(s=e[d])<32||s>126&&s<Ye){this._printHandler(e,a,d),a=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<Ye){this._printHandler(e,a,d),a=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<Ye){this._printHandler(e,a,d),a=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<Ye){this._printHandler(e,a,d),a=d-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:a,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let h=this._csiHandlers[this._collect<<8|s],l=h?h.length-1:-1;for(;l>=0&&(o=h[l](this._params),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(3,h,l,r,a),o;l<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++a<t&&(s=e[a])>47&&s<60);a--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let f=this._escHandlers[this._collect<<8|s],u=f?f.length-1:-1;for(;u>=0&&(o=f[u](),o!==!0);u--)if(o instanceof Promise)return this._preserveStack(4,f,u,r,a),o;u<0&&this._escHandlerFb(this._collect<<8|s),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|s,this._params);break;case 13:for(let d=a+1;;++d)if(d>=t||(s=e[d])===24||s===26||s===27||s>127&&s<Ye){this._dcsParser.put(e,a,d),a=d-1;break}break;case 14:if(o=this._dcsParser.unhook(s!==24&&s!==26),o)return this._preserveStack(6,[],0,r,a),o;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let d=a+1;;d++)if(d>=t||(s=e[d])<32||s>127&&s<Ye){this._oscParser.put(e,a,d),a=d-1;break}break;case 6:if(o=this._oscParser.end(s!==24&&s!==26),o)return this._preserveStack(5,[],0,r,a),o;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=r&15}}},Id=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,Od=/^[\da-f]+$/;function In(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=Id.exec(t);if(i){let s=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/s*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/s*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/s*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),Od.exec(t)&&[3,6,9,12].includes(t.length))){let i=t.length/3,s=[0,0,0];for(let r=0;r<3;++r){let n=parseInt(t.slice(i*r,i*r+i),16);s[r]=i===1?n<<4:i===2?n:i===3?n>>4:n>>8}return s}}function Ds(e,t){let i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function Nd(e,t=16){let[i,s,r]=e;return`rgb:${Ds(i,t)}/${Ds(s,t)}/${Ds(r,t)}`}var zd={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Ct=131072,On=10;function Nn(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var zn=5e3,Fn=0,Fd=class extends ee{constructor(e,t,i,s,r,n,o,a,h=new Pd){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=n,this._coreMouseService=o,this._unicodeService=a,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new rc,this._utf8Decoder=new nc,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=fe.clone(),this._eraseAttrDataInternal=fe.clone(),this._onRequestBell=this._register(new P),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new P),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new P),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new P),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new P),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new P),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new P),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new P),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new P),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new P),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new P),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new P),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new P),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Sr(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(l=>this._activeBuffer=l.activeBuffer)),this._parser.setCsiHandlerFallback((l,f)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(l),params:f.toArray()})}),this._parser.setEscHandlerFallback(l=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(l)})}),this._parser.setExecuteHandlerFallback(l=>{this._logService.debug("Unknown EXECUTE code: ",{code:l})}),this._parser.setOscHandlerFallback((l,f,u)=>{this._logService.debug("Unknown OSC code: ",{identifier:l,action:f,data:u})}),this._parser.setDcsHandlerFallback((l,f,u)=>{f==="HOOK"&&(u=u.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(l),action:f,payload:u})}),this._parser.setPrintHandler((l,f,u)=>this.print(l,f,u)),this._parser.registerCsiHandler({final:"@"},l=>this.insertChars(l)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},l=>this.scrollLeft(l)),this._parser.registerCsiHandler({final:"A"},l=>this.cursorUp(l)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},l=>this.scrollRight(l)),this._parser.registerCsiHandler({final:"B"},l=>this.cursorDown(l)),this._parser.registerCsiHandler({final:"C"},l=>this.cursorForward(l)),this._parser.registerCsiHandler({final:"D"},l=>this.cursorBackward(l)),this._parser.registerCsiHandler({final:"E"},l=>this.cursorNextLine(l)),this._parser.registerCsiHandler({final:"F"},l=>this.cursorPrecedingLine(l)),this._parser.registerCsiHandler({final:"G"},l=>this.cursorCharAbsolute(l)),this._parser.registerCsiHandler({final:"H"},l=>this.cursorPosition(l)),this._parser.registerCsiHandler({final:"I"},l=>this.cursorForwardTab(l)),this._parser.registerCsiHandler({final:"J"},l=>this.eraseInDisplay(l,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},l=>this.eraseInDisplay(l,!0)),this._parser.registerCsiHandler({final:"K"},l=>this.eraseInLine(l,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},l=>this.eraseInLine(l,!0)),this._parser.registerCsiHandler({final:"L"},l=>this.insertLines(l)),this._parser.registerCsiHandler({final:"M"},l=>this.deleteLines(l)),this._parser.registerCsiHandler({final:"P"},l=>this.deleteChars(l)),this._parser.registerCsiHandler({final:"S"},l=>this.scrollUp(l)),this._parser.registerCsiHandler({final:"T"},l=>this.scrollDown(l)),this._parser.registerCsiHandler({final:"X"},l=>this.eraseChars(l)),this._parser.registerCsiHandler({final:"Z"},l=>this.cursorBackwardTab(l)),this._parser.registerCsiHandler({final:"`"},l=>this.charPosAbsolute(l)),this._parser.registerCsiHandler({final:"a"},l=>this.hPositionRelative(l)),this._parser.registerCsiHandler({final:"b"},l=>this.repeatPrecedingCharacter(l)),this._parser.registerCsiHandler({final:"c"},l=>this.sendDeviceAttributesPrimary(l)),this._parser.registerCsiHandler({prefix:">",final:"c"},l=>this.sendDeviceAttributesSecondary(l)),this._parser.registerCsiHandler({final:"d"},l=>this.linePosAbsolute(l)),this._parser.registerCsiHandler({final:"e"},l=>this.vPositionRelative(l)),this._parser.registerCsiHandler({final:"f"},l=>this.hVPosition(l)),this._parser.registerCsiHandler({final:"g"},l=>this.tabClear(l)),this._parser.registerCsiHandler({final:"h"},l=>this.setMode(l)),this._parser.registerCsiHandler({prefix:"?",final:"h"},l=>this.setModePrivate(l)),this._parser.registerCsiHandler({final:"l"},l=>this.resetMode(l)),this._parser.registerCsiHandler({prefix:"?",final:"l"},l=>this.resetModePrivate(l)),this._parser.registerCsiHandler({final:"m"},l=>this.charAttributes(l)),this._parser.registerCsiHandler({final:"n"},l=>this.deviceStatus(l)),this._parser.registerCsiHandler({prefix:"?",final:"n"},l=>this.deviceStatusPrivate(l)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},l=>this.softReset(l)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},l=>this.setCursorStyle(l)),this._parser.registerCsiHandler({final:"r"},l=>this.setScrollRegion(l)),this._parser.registerCsiHandler({final:"s"},l=>this.saveCursor(l)),this._parser.registerCsiHandler({final:"t"},l=>this.windowOptions(l)),this._parser.registerCsiHandler({final:"u"},l=>this.restoreCursor(l)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},l=>this.insertColumns(l)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},l=>this.deleteColumns(l)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},l=>this.selectProtected(l)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},l=>this.requestMode(l,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},l=>this.requestMode(l,!1)),this._parser.setExecuteHandler(C.BEL,()=>this.bell()),this._parser.setExecuteHandler(C.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(C.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(C.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(C.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(C.BS,()=>this.backspace()),this._parser.setExecuteHandler(C.HT,()=>this.tab()),this._parser.setExecuteHandler(C.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(C.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(qi.IND,()=>this.index()),this._parser.setExecuteHandler(qi.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(qi.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new $e(l=>(this.setTitle(l),this.setIconName(l),!0))),this._parser.registerOscHandler(1,new $e(l=>this.setIconName(l))),this._parser.registerOscHandler(2,new $e(l=>this.setTitle(l))),this._parser.registerOscHandler(4,new $e(l=>this.setOrReportIndexedColor(l))),this._parser.registerOscHandler(8,new $e(l=>this.setHyperlink(l))),this._parser.registerOscHandler(10,new $e(l=>this.setOrReportFgColor(l))),this._parser.registerOscHandler(11,new $e(l=>this.setOrReportBgColor(l))),this._parser.registerOscHandler(12,new $e(l=>this.setOrReportCursorColor(l))),this._parser.registerOscHandler(104,new $e(l=>this.restoreIndexedColor(l))),this._parser.registerOscHandler(110,new $e(l=>this.restoreFgColor(l))),this._parser.registerOscHandler(111,new $e(l=>this.restoreBgColor(l))),this._parser.registerOscHandler(112,new $e(l=>this.restoreCursorColor(l))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let l in ve)this._parser.registerEscHandler({intermediates:"(",final:l},()=>this.selectCharset("("+l)),this._parser.registerEscHandler({intermediates:")",final:l},()=>this.selectCharset(")"+l)),this._parser.registerEscHandler({intermediates:"*",final:l},()=>this.selectCharset("*"+l)),this._parser.registerEscHandler({intermediates:"+",final:l},()=>this.selectCharset("+"+l)),this._parser.registerEscHandler({intermediates:"-",final:l},()=>this.selectCharset("-"+l)),this._parser.registerEscHandler({intermediates:".",final:l},()=>this.selectCharset("."+l)),this._parser.registerEscHandler({intermediates:"/",final:l},()=>this.selectCharset("/"+l));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(l=>(this._logService.error("Parsing error: ",l),l)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Pn((l,f)=>this.requestStatusString(l,f)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),zn))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${zn} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0,o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Ct&&(n=this._parseStack.position+Ct)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,l=>String.fromCharCode(l)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(l=>l.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Ct&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Ct))),o||this._dirtyRowTracker.clearRange(),e.length>Ct)for(let l=n;l<e.length;l+=Ct){let f=l+Ct<e.length?l+Ct:e.length,u=typeof e=="string"?this._stringDecoder.decode(e.substring(l,f),this._parseBuffer):this._utf8Decoder.decode(e.subarray(l,f),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,u))return this._preserveStack(s,r,u,l),this._logSlowResolvingAsync(i),i}else if(!o){let l=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,l))return this._preserveStack(s,r,l,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==s||this._activeBuffer.y!==r)&&this._onCursorMove.fire();let a=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),h=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);h<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(h,this._bufferService.rows-1),end:Math.min(a,this._bufferService.rows-1)})}print(e,t,i){let s,r,n=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,a=this._bufferService.cols,h=this._coreService.decPrivateModes.wraparound,l=this._coreService.modes.insertMode,f=this._curAttrData,u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&u.getWidth(this._activeBuffer.x-1)===2&&u.setCellFromCodepoint(this._activeBuffer.x-1,0,1,f);let d=this._parser.precedingJoinState;for(let c=t;c<i;++c){if(s=e[c],s<127&&n){let w=n[String.fromCharCode(s)];w&&(s=w.charCodeAt(0))}let p=this._unicodeService.charProperties(s,d);r=Ot.extractWidth(p);let _=Ot.extractShouldJoin(p),S=_?Ot.extractWidth(d):0;if(d=p,o&&this._onA11yChar.fire(xt(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+r-S>a){if(h){let w=u,y=this._activeBuffer.x-S;for(this._activeBuffer.x=S,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),S>0&&u instanceof di&&u.copyCellsFrom(w,y,0,S,!1);y<a;)w.setCellFromCodepoint(y++,0,1,f)}else if(this._activeBuffer.x=a-1,r===2)continue}if(_&&this._activeBuffer.x){let w=u.getWidth(this._activeBuffer.x-1)?1:2;u.addCodepointToCell(this._activeBuffer.x-w,s,r);for(let y=r-S;--y>=0;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,f);continue}if(l&&(u.insertCells(this._activeBuffer.x,r-S,this._activeBuffer.getNullCell(f)),u.getWidth(a-1)===2&&u.setCellFromCodepoint(a-1,0,1,f)),u.setCellFromCodepoint(this._activeBuffer.x++,s,r,f),r>0)for(;--r;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,f)}this._parser.precedingJoinState=d,this._activeBuffer.x<a&&i-t>0&&u.getWidth(this._activeBuffer.x)===0&&!u.hasContent(this._activeBuffer.x)&&u.setCellFromCodepoint(this._activeBuffer.x,0,1,f),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>Nn(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Pn(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new $e(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(fe));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let i=e.params[0]||1,s=Ot.extractWidth(t),r=this._activeBuffer.x-s,n=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(r),o=new Uint32Array(n.length*i),a=0;for(let l=0;l<n.length;){let f=n.codePointAt(l)||0;o[a++]=f,l+=f>65535?2:1}let h=a;for(let l=1;l<i;++l)o.copyWithin(h,0,a),h+=a;return this.print(o,0,h),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(C.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(C.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(C.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(C.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(C.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Pt),this._charsetService.setgCharset(1,Pt),this._charsetService.setgCharset(2,Pt),this._charsetService.setgCharset(3,Pt);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let i;(_=>(_[_.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",_[_.SET=1]="SET",_[_.RESET=2]="RESET",_[_.PERMANENTLY_SET=3]="PERMANENTLY_SET",_[_.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let s=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:n}=this._coreMouseService,o=this._coreService,{buffers:a,cols:h}=this._bufferService,{active:l,alt:f}=a,u=this._optionsService.rawOptions,d=(_,S)=>(o.triggerDataEvent(`${C.ESC}[${t?"":"?"}${_};${S}$y`),!0),c=_=>_?1:2,p=e.params[0];return t?p===2?d(p,4):p===4?d(p,c(o.modes.insertMode)):p===12?d(p,3):p===20?d(p,c(u.convertEol)):d(p,0):p===1?d(p,c(s.applicationCursorKeys)):p===3?d(p,u.windowOptions.setWinLines?h===80?2:h===132?1:0:0):p===6?d(p,c(s.origin)):p===7?d(p,c(s.wraparound)):p===8?d(p,3):p===9?d(p,c(r==="X10")):p===12?d(p,c(u.cursorBlink)):p===25?d(p,c(!o.isCursorHidden)):p===45?d(p,c(s.reverseWraparound)):p===66?d(p,c(s.applicationKeypad)):p===67?d(p,4):p===1e3?d(p,c(r==="VT200")):p===1002?d(p,c(r==="DRAG")):p===1003?d(p,c(r==="ANY")):p===1004?d(p,c(s.sendFocus)):p===1005?d(p,4):p===1006?d(p,c(n==="SGR")):p===1015?d(p,4):p===1016?d(p,c(n==="SGR_PIXELS")):p===1048?d(p,1):p===47||p===1047||p===1049?d(p,c(l===f)):p===2004?d(p,c(s.bracketedPasteMode)):p===2026?d(p,c(s.synchronizedOutput)):d(p,0)}_updateAttrColor(e,t,i,s,r){return t===2?(e|=50331648,e&=-16777216,e|=ki.fromColorRGB([i,s,r])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let s=[0,0,-1,0,0,0],r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){let o=e.getSubParams(t+n),a=0;do s[1]===5&&(r=1),s[n+a+1+r]=o[a];while(++a<o.length&&a+n+1+r<s.length);break}if(s[1]===5&&n+r>=2||s[1]===2&&n+r>=5)break;s[1]&&(r=1)}while(++n+t<e.length&&n+r<s.length);for(let o=2;o<s.length;++o)s[o]===-1&&(s[o]=0);switch(s[0]){case 38:i.fg=this._updateAttrColor(i.fg,s[1],s[3],s[4],s[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,s[1],s[3],s[4],s[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,s[1],s[3],s[4],s[5])}return n}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=fe.fg,e.bg=fe.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,i,s=this._curAttrData;for(let r=0;r<t;r++)i=e.params[r],i>=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777216|i-90|8):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777216|i-100|8):i===0?this._processSGR0(s):i===1?s.fg|=134217728:i===3?s.bg|=67108864:i===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):i===5?s.fg|=536870912:i===7?s.fg|=67108864:i===8?s.fg|=1073741824:i===9?s.fg|=2147483648:i===2?s.bg|=134217728:i===21?this._processUnderline(2,s):i===22?(s.fg&=-134217729,s.bg&=-134217729):i===23?s.bg&=-67108865:i===24?(s.fg&=-268435457,this._processUnderline(0,s)):i===25?s.fg&=-536870913:i===27?s.fg&=-67108865:i===28?s.fg&=-1073741825:i===29?s.fg&=2147483647:i===39?(s.fg&=-67108864,s.fg|=fe.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=fe.bg&16777215):i===38||i===48||i===58?r+=this._extractColor(e,r,s):i===53?s.bg|=1073741824:i===55?s.bg&=-1073741825:i===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):i===100?(s.fg&=-67108864,s.fg|=fe.fg&16777215,s.bg&=-67108864,s.bg|=fe.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${C.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${C.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${C.ESC}[?${t};${i}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=fe.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Nn(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${C.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>On&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>On&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],i=e.split(";");for(;i.length>1;){let s=i.shift(),r=i.shift();if(/^\d+$/.exec(s)){let n=parseInt(s);if(Hn(n))if(r==="?")t.push({type:0,index:n});else{let o=In(r);o&&t.push({type:1,index:n,color:o})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(i,s):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),s,r=i.findIndex(n=>n.startsWith("id="));return r!==-1&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let i=e.split(";");for(let s=0;s<i.length&&!(t>=this._specialColors.length);++s,++t)if(i[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=In(i[s]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],i=e.split(";");for(let s=0;s<i.length;++s)if(/^\d+$/.exec(i[s])){let r=parseInt(i[s]);Hn(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,Pt),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(zd[e[0]],ve[e[1]]||Pt),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=fe.clone(),this._eraseAttrDataInternal=fe.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Xe;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let i=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(i);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let i=o=>(this._coreService.triggerDataEvent(`${C.ESC}${o}${C.ESC}\\`),!0),s=this._bufferService.buffer,r=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${s.scrollTop+1};${s.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Sr=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(Fn=e,e=t,t=Fn),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Sr=ce([N(0,Te)],Sr);function Hn(e){return 0<=e&&e<256}var Hd=5e7,$n=12,$d=50,Wd=class extends ee{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new P),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let i;for(;i=this._writeBuffer.shift();){this._action(i);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>Hd)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],r=this._action(s,t);if(r){let o=a=>performance.now()-i>=$n?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(i,a);r.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(o);return}let n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-i>=$n)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>$d&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},br=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let a=t.addMarker(t.ybase+t.y),h={data:e,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(h,a)),this._dataByLinkId.set(h.id,h),h.id}let i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;let n=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(o,n)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);i.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(i,s))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};br=ce([N(0,Te)],br);var Wn=!1,qd=class extends ee{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Qt),this._onBinary=this._register(new P),this.onBinary=this._onBinary.event,this._onData=this._register(new P),this.onData=this._onData.event,this._onLineFeed=this._register(new P),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new P),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new P),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new P),this._instantiationService=new fd,this.optionsService=this._register(new Cd(e)),this._instantiationService.setService(Ae,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(pr)),this._instantiationService.setService(Te,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(_r)),this._instantiationService.setService(Eo,this._logService),this.coreService=this._register(this._instantiationService.createInstance(gr)),this._instantiationService.setService(qt,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(vr)),this._instantiationService.setService(xo,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ot)),this._instantiationService.setService(hc,this.unicodeService),this._charsetService=this._instantiationService.createInstance(Bd),this._instantiationService.setService(lc,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(br),this._instantiationService.setService(Lo,this._oscLinkService),this._inputHandler=this._register(new Fd(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(xe.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(xe.forward(this._bufferService.onResize,this._onResize)),this._register(xe.forward(this.coreService.onData,this._onData)),this._register(xe.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new Wd((t,i)=>this._inputHandler.parse(t,i))),this._register(xe.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new P),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Wn&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Wn=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,na),t=Math.max(t,oa),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(An.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(An(this._bufferService),!1))),this._windowsWrappingHeuristics.value=oe(()=>{for(let t of e)t.dispose()})}}},Kd={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function Ud(e,t,i,s){let r={type:0,cancel:!1,key:void 0},n=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?r.key=C.ESC+"OA":r.key=C.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?r.key=C.ESC+"OD":r.key=C.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?r.key=C.ESC+"OC":r.key=C.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?r.key=C.ESC+"OB":r.key=C.ESC+"[B");break;case 8:r.key=e.ctrlKey?"\b":C.DEL,e.altKey&&(r.key=C.ESC+r.key);break;case 9:if(e.shiftKey){r.key=C.ESC+"[Z";break}r.key=C.HT,r.cancel=!0;break;case 13:r.key=e.altKey?C.ESC+C.CR:C.CR,r.cancel=!0;break;case 27:r.key=C.ESC,e.altKey&&(r.key=C.ESC+C.ESC),r.cancel=!0;break;case 37:if(e.metaKey)break;n?r.key=C.ESC+"[1;"+(n+1)+"D":t?r.key=C.ESC+"OD":r.key=C.ESC+"[D";break;case 39:if(e.metaKey)break;n?r.key=C.ESC+"[1;"+(n+1)+"C":t?r.key=C.ESC+"OC":r.key=C.ESC+"[C";break;case 38:if(e.metaKey)break;n?r.key=C.ESC+"[1;"+(n+1)+"A":t?r.key=C.ESC+"OA":r.key=C.ESC+"[A";break;case 40:if(e.metaKey)break;n?r.key=C.ESC+"[1;"+(n+1)+"B":t?r.key=C.ESC+"OB":r.key=C.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(r.key=C.ESC+"[2~");break;case 46:n?r.key=C.ESC+"[3;"+(n+1)+"~":r.key=C.ESC+"[3~";break;case 36:n?r.key=C.ESC+"[1;"+(n+1)+"H":t?r.key=C.ESC+"OH":r.key=C.ESC+"[H";break;case 35:n?r.key=C.ESC+"[1;"+(n+1)+"F":t?r.key=C.ESC+"OF":r.key=C.ESC+"[F";break;case 33:e.shiftKey?r.type=2:e.ctrlKey?r.key=C.ESC+"[5;"+(n+1)+"~":r.key=C.ESC+"[5~";break;case 34:e.shiftKey?r.type=3:e.ctrlKey?r.key=C.ESC+"[6;"+(n+1)+"~":r.key=C.ESC+"[6~";break;case 112:n?r.key=C.ESC+"[1;"+(n+1)+"P":r.key=C.ESC+"OP";break;case 113:n?r.key=C.ESC+"[1;"+(n+1)+"Q":r.key=C.ESC+"OQ";break;case 114:n?r.key=C.ESC+"[1;"+(n+1)+"R":r.key=C.ESC+"OR";break;case 115:n?r.key=C.ESC+"[1;"+(n+1)+"S":r.key=C.ESC+"OS";break;case 116:n?r.key=C.ESC+"[15;"+(n+1)+"~":r.key=C.ESC+"[15~";break;case 117:n?r.key=C.ESC+"[17;"+(n+1)+"~":r.key=C.ESC+"[17~";break;case 118:n?r.key=C.ESC+"[18;"+(n+1)+"~":r.key=C.ESC+"[18~";break;case 119:n?r.key=C.ESC+"[19;"+(n+1)+"~":r.key=C.ESC+"[19~";break;case 120:n?r.key=C.ESC+"[20;"+(n+1)+"~":r.key=C.ESC+"[20~";break;case 121:n?r.key=C.ESC+"[21;"+(n+1)+"~":r.key=C.ESC+"[21~";break;case 122:n?r.key=C.ESC+"[23;"+(n+1)+"~":r.key=C.ESC+"[23~";break;case 123:n?r.key=C.ESC+"[24;"+(n+1)+"~":r.key=C.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?r.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?r.key=C.NUL:e.keyCode>=51&&e.keyCode<=55?r.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?r.key=C.DEL:e.keyCode===219?r.key=C.ESC:e.keyCode===220?r.key=C.FS:e.keyCode===221&&(r.key=C.GS);else if((!i||s)&&e.altKey&&!e.metaKey){let o=Kd[e.keyCode]?.[e.shiftKey?1:0];if(o)r.key=C.ESC+o;else if(e.keyCode>=65&&e.keyCode<=90){let a=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(a);e.shiftKey&&(h=h.toUpperCase()),r.key=C.ESC+h}else if(e.keyCode===32)r.key=C.ESC+(e.ctrlKey?C.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let a=e.code.slice(3,4);e.shiftKey||(a=a.toLowerCase()),r.key=C.ESC+a,r.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(r.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?r.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(r.key=C.US),e.key==="@"&&(r.key=C.NUL));break}return r}var ue=0,Vd=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new ss,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new ss,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((r,n)=>this._getKey(r)-this._getKey(n)),t=0,i=0,s=new Array(this._array.length+this._insertedValues.length);for(let r=0;r<s.length;r++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(s[r]=e[t],t++):s[r]=this._array[i++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(ue=this._search(t),ue===-1)||this._getKey(this._array[ue])!==t)return!1;do if(this._array[ue]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ue),!0;while(++ue<this._array.length&&this._getKey(this._array[ue])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((r,n)=>r-n),t=0,i=new Array(this._array.length-e.length),s=0;for(let r=0;r<this._array.length;r++)e[t]===r?t++:i[s++]=this._array[r];this._array=i,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ue=this._search(e),!(ue<0||ue>=this._array.length)&&this._getKey(this._array[ue])===e))do yield this._array[ue];while(++ue<this._array.length&&this._getKey(this._array[ue])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ue=this._search(e),!(ue<0||ue>=this._array.length)&&this._getKey(this._array[ue])===e))do t(this._array[ue]);while(++ue<this._array.length&&this._getKey(this._array[ue])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,i=this._array.length-1;for(;i>=t;){let s=t+i>>1,r=this._getKey(this._array[s]);if(r>e)i=s-1;else if(r<e)t=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},Ms=0,qn=0,jd=class extends ee{constructor(){super(),this._decorations=new Vd(e=>e?.marker.line),this._onDecorationRegistered=this._register(new P),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new P),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(oe(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new Yd(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let s=0,r=0;for(let n of this._decorations.getKeyIterator(t))s=n.options.x??0,r=s+(n.options.width??1),e>=s&&e<r&&(!i||(n.options.layer??"bottom")===i)&&(yield n)}forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,r=>{Ms=r.options.x??0,qn=Ms+(r.options.width??1),e>=Ms&&e<qn&&(!i||(r.options.layer??"bottom")===i)&&s(r)})}},Yd=class extends Dt{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new P),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new P),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=le.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=le.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},Gd=1e3,Xd=class{constructor(e,t=Gd){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let r=s-this._lastRefreshMs,n=this._debounceThresholdMS-r;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},n)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Kn=20,rs=class extends ee{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let r=this._coreBrowserService.mainDocument;this._accessibilityContainer=r.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=r.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let n=0;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);if(this._topBoundaryFocusListener=n=>this._handleBoundaryFocus(n,0),this._bottomBoundaryFocusListener=n=>this._handleBoundaryFocus(n,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=r.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new Xd(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(n=>this._handleResize(n.rows))),this._register(this._terminal.onRender(n=>this._refreshRows(n.start,n.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(n=>this._handleChar(n))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
14
14
  `))),this._register(this._terminal.onA11yTab(n=>this._handleTab(n))),this._register(this._terminal.onKey(n=>this._handleKey(n.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(K(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(oe(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Kn+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
15
15
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===Kn+1&&(this._liveRegion.textContent+=Hs.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){let n=i.lines.get(i.ydisp+r),o=[],a=n?.translateToString(!0,void 0,void 0,o)||"",h=(i.ydisp+r+1).toString(),l=this._rowElements[r];l&&(a.length===0?(l.textContent=" ",this._rowColumns.set(l,[0,1])):(l.textContent=a,this._rowColumns.set(l,o)),l.setAttribute("aria-posinset",h),l.setAttribute("aria-setsize",s),this._alignRowWidth(l))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),n=t===0?"1":`${this._terminal.buffer.lines.length}`;if(r===n||e.relatedTarget!==s)return;let o,a;if(t===0?(o=i,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(o=this._rowElements.shift(),a=i,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),a.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let r=({node:a,offset:h})=>{let l=a instanceof Text?a.parentNode:a,f=parseInt(l?.getAttribute("aria-posinset"),10)-1;if(isNaN(f))return console.warn("row is invalid. Race condition?"),null;let u=this._rowColumns.get(l);if(!u)return console.warn("columns is null. Race condition?"),null;let d=h<u.length?u[h]:u.slice(-1)[0]+1;return d>=this._terminal.cols&&(++f,d=0),{row:f,column:d}},n=r(t),o=r(i);if(!(!n||!o)){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,i=this._rowColumns.get(e)?.slice(-1)?.[0];if(!i)return;let s=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${s/t})`}};rs=ce([N(1,Rr),N(2,vt),N(3,mt)],rs);var yr=class extends ee{constructor(e,t,i,s,r){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new P),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new P),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(oe(()=>{Ft(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(K(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(K(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(K(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(K(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let s=0;s<i.length;s++){let r=i[s];if(r.classList.contains("xterm"))break;if(r.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(s=>{s?.forEach(r=>{r.link.dispose&&r.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[s,r]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(s)&&(i=this._checkLinkProviderResult(s,e,i)):r.provideLinks(e.y,n=>{if(this._isMouseOut)return;let o=n?.map(a=>({link:a}));this._activeProviderReplies?.set(s,o),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let s=0;s<t.size;s++){let r=t.get(s);if(r)for(let n=0;n<r.length;n++){let o=r[n],a=o.link.range.start.y<e?0:o.link.range.start.x,h=o.link.range.end.y>e?this._bufferService.cols:o.link.range.end.x;for(let l=a;l<=h;l++){if(i.has(l)){r.splice(n--,1);break}i.add(l)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let s=this._activeProviderReplies.get(e),r=!1;for(let n=0;n<e;n++)(!this._activeProviderReplies.has(n)||this._activeProviderReplies.get(n))&&(r=!0);if(!r&&s){let n=s.find(o=>this._linkAtPosition(o.link,t));n&&(i=!0,this._handleNewLink(n))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let n=0;n<this._activeProviderReplies.size;n++){let o=this._activeProviderReplies.get(n)?.find(a=>this._linkAtPosition(a.link,t));if(o){i=!0,this._handleNewLink(o);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&Jd(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Ft(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let s=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(s,r),this._lastMouseEvent)){let n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._askForLink(n,!1)}})))}_linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=s}_positionFromMouseEvent(e,t,i){let s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};yr=ce([N(1,Tr),N(2,mt),N(3,Te),N(4,Do)],yr);function Jd(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var Zd=class extends qd{constructor(e={}){super(e),this._linkifier=this._register(new Qt),this.browser=Yo,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Qt),this._onCursorMove=this._register(new P),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new P),this.onKey=this._onKey.event,this._onRender=this._register(new P),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new P),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new P),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new P),this.onBell=this._onBell.event,this._onFocus=this._register(new P),this._onBlur=this._register(new P),this._onA11yCharEmitter=this._register(new P),this._onA11yTabEmitter=this._register(new P),this._onWillOpen=this._register(new P),this._setup(),this._decorationService=this._instantiationService.createInstance(jd),this._instantiationService.setService(xi,this._decorationService),this._linkProviderService=this._instantiationService.createInstance($u),this._instantiationService.setService(Do,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Ws)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(xe.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(xe.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(xe.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(xe.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(oe(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let i,s="";switch(t.index){case 256:i="foreground",s="10";break;case 257:i="background",s="11";break;case 258:i="cursor",s="12";break;default:i="ansi",s="4;"+t.index}switch(t.type){case 0:let r=ne.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${C.ESC}]${s};${Nd(r)}${Vo.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(n=>n.ansi[t.index]=_e.toColor(...t.color));else{let n=i;this._themeService.modifyColors(o=>o[n]=_e.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(rs,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(C.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(C.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,o=this.buffer.y*this._renderService.dimensions.css.cell.height,a=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(K(this.element,"copy",t=>{this.hasSelection()&&ic(t,this._selectionService)}));let e=t=>sc(t,this.textarea,this.coreService,this.optionsService);this._register(K(this.textarea,"paste",e)),this._register(K(this.element,"paste",e)),Go?this._register(K(this.element,"mousedown",t=>{t.button===2&&Qr(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(K(this.element,"contextmenu",t=>{Qr(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Hr&&this._register(K(this.element,"auxclick",t=>{t.button===1&&bo(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(K(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(K(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(K(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(K(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(K(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(K(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(K(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(K(this.screenElement,"mousemove",r=>this.updateCursorStyle(r))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Fs.get()),Zo||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(Fu,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(vt,this._coreBrowserService),this._register(K(this.textarea,"focus",r=>this._handleTextAreaFocus(r))),this._register(K(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(hr,this._document,this._helperContainer),this._instantiationService.setService(hs,this._charSizeService),this._themeService=this._instantiationService.createInstance(fr),this._instantiationService.setService(ii,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(ts),this._instantiationService.setService(Bo,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(ur,this.rows,this.screenElement)),this._instantiationService.setService(mt,this._renderService),this._register(this._renderService.onRenderedViewportChange(r=>this._onRender.fire(r))),this.onResize(r=>this._renderService.resize(r.cols,r.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(or,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(cr),this._instantiationService.setService(Tr,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(yr,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(rr,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(r=>{super.scrollLines(r,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(dr,this.element,this.screenElement,s)),this._instantiationService.setService(uc,this._selectionService),this._register(this._selectionService.onRequestScrollLines(r=>this.scrollLines(r.amount,r.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(r=>this._renderService.handleSelectionChanged(r.start,r.end,r.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(r=>{this.textarea.value=r,this.textarea.focus(),this.textarea.select()})),this._register(xe.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(nr,this.screenElement)),this._register(K(this.element,"mousedown",r=>this._selectionService.handleMouseDown(r))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(rs,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",r=>this._handleScreenReaderModeOptionChange(r))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(es,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",r=>{!this._overviewRulerRenderer&&r&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(es,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(lr,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(n){let o=e._mouseService.getMouseReportCoords(n,e.screenElement);if(!o)return!1;let a,h;switch(n.overrideType||n.type){case"mousemove":h=32,n.buttons===void 0?(a=3,n.button!==void 0&&(a=n.button<3?n.button:3)):a=n.buttons&1?0:n.buttons&4?1:n.buttons&2?2:3;break;case"mouseup":h=0,a=n.button<3?n.button:3;break;case"mousedown":h=1,a=n.button<3?n.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(n)===!1)return!1;let l=n.deltaY;if(l===0||e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;h=l<0?0:1,a=4;break;default:return!1}return h===void 0||a===void 0||a>4?!1:e.coreMouseService.triggerMouseEvent({col:o.col,row:o.row,x:o.x,y:o.y,button:a,action:h,ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:n=>(i(n),n.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(n)),wheel:n=>(i(n),this.cancel(n,!0)),mousedrag:n=>{n.buttons&&i(n)},mousemove:n=>{n.buttons||i(n)}};this._register(this.coreMouseService.onProtocolChange(n=>{n?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(n)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),n&8?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),n&16?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),n&2?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),n&4?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(K(t,"mousedown",n=>{if(n.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(n)))return i(n),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(n)})),this._register(K(t,"wheel",n=>{if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(n)===!1)return!1;if(!this.buffer.hasScrollback){if(n.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(n,!0);let o=C.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(n.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(o,!0),this.cancel(n,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){So(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let i=Ud(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let s=this.rows-1;return this.scrollLines(i.type===2?-s:s),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((i.key===C.ETX||i.key===C.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Qd(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(fe));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(C.ESC+"[I"):this.coreService.triggerDataEvent(C.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${C.ESC}[4;${i};${t}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${C.ESC}[6;${r};${s}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function Qd(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var ef=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},tf=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Xe)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},Un=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new tf(t)}getNullCell(){return new Xe}},sf=class extends ee{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new P),this.onBufferChange=this._onBufferChange.event,this._normal=new Un(this._core.buffers.normal,"normal"),this._alternate=new Un(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},rf=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,s)=>t(i,s.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},nf=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},of=["cols","rows"],it=0,af=class extends ee{constructor(e){super(),this._core=this._register(new Zd(e)),this._addonManager=this._register(new ef),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],i=(s,r)=>{this._checkReadonlyOptions(s),this._core.options[s]=r};for(let s in this._core.options){let r={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,r)}}_checkReadonlyOptions(e){if(of.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new rf(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new nf(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new sf(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
16
- `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Fs.get()},set promptLabel(e){Fs.set(e)},get tooMuchOutput(){return Hs.get()},set tooMuchOutput(e){Hs.set(e)}}}_verifyIntegers(...e){for(it of e)if(it===1/0||isNaN(it)||it%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(it of e)if(it&&(it===1/0||isNaN(it)||it%1!==0||it<0))throw new Error("This API only accepts positive integers")}};var lf=2,hf=1,cf=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},a=o.top+o.bottom,h=o.right+o.left,l=s-a,f=r-h-t;return{cols:Math.max(lf,Math.floor(f/e.css.cell.width)),rows:Math.max(hf,Math.floor(l/e.css.cell.height))}}};var uf=class{constructor(e,t,i,s={}){this._terminal=e,this._regex=t,this._handler=i,this._options=s}provideLinks(e,t){let i=ff.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(i))}_addCallbacks(e){return e.map(t=>(t.leave=this._options.leave,t.hover=(i,s)=>{if(this._options.hover){let{range:r}=t;this._options.hover(i,s,r)}},t))}};function df(e){try{let t=new URL(e),i=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(i.toLocaleLowerCase())}catch{return!1}}var ff=class Vi{static computeLink(t,i,s,r){let n=new RegExp(i.source,(i.flags||"")+"g"),[o,a]=Vi._getWindowedLineStrings(t-1,s),h=o.join(""),l,f=[];for(;l=n.exec(h);){let u=l[0];if(!df(u))continue;let[d,c]=Vi._mapStrIdx(s,a,0,l.index),[p,_]=Vi._mapStrIdx(s,d,c,u.length);if(d===-1||c===-1||p===-1||_===-1)continue;let S={start:{x:c+1,y:d+1},end:{x:_,y:p+1}};f.push({range:S,text:u,activate:r})}return f}static _getWindowedLineStrings(t,i){let s,r=t,n=t,o=0,a="",h=[];if(s=i.buffer.active.getLine(t)){let l=s.translateToString(!0);if(s.isWrapped&&l[0]!==" "){for(o=0;(s=i.buffer.active.getLine(--r))&&o<2048&&(a=s.translateToString(!0),o+=a.length,h.push(a),!(!s.isWrapped||a.indexOf(" ")!==-1)););h.reverse()}for(h.push(l),o=0;(s=i.buffer.active.getLine(++n))&&s.isWrapped&&o<2048&&(a=s.translateToString(!0),o+=a.length,h.push(a),a.indexOf(" ")===-1););}return[h,r]}static _mapStrIdx(t,i,s,r){let n=t.buffer.active,o=n.getNullCell(),a=s;for(;r;){let h=n.getLine(i);if(!h)return[-1,-1];for(let l=a;l<h.length;++l){h.getCell(l,o);let f=o.getChars();if(o.getWidth()&&(r-=f.length||1,l===h.length-1&&f==="")){let u=n.getLine(i+1);u&&u.isWrapped&&(u.getCell(0,o),o.getWidth()===2&&(r+=1))}if(r<0)return[i,l]}i++,a=0}return[i,a]}},_f=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function pf(e,t){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var gf=class{constructor(e=pf,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,i=t.urlRegex||_f;this._linkProvider=this._terminal.registerLinkProvider(new uf(this._terminal,i,this._handler,t))}dispose(){this._linkProvider?.dispose()}};function vf(){const e=J("disconnected"),t=J(null),i=J(null),s=J(0),r=5,n=2e3;function o(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/terminal`}function a(_){t.value=_,e.value="connecting";const S=new WebSocket(o());i.value=S,S.onopen=()=>{e.value="connected",s.value=0,f(_.cols,_.rows)},S.onmessage=w=>{try{const y=JSON.parse(w.data);y.type==="output"&&y.data?_.write(y.data):y.type==="error"&&y.data&&(e.value="error",_.write(`\x1B[31m${y.data}\x1B[0m`))}catch{_.write(w.data)}},S.onclose=()=>{e.value="disconnected",s.value<r&&(s.value++,setTimeout(()=>{t.value&&a(t.value)},n))},S.onerror=()=>{e.value="error"}}function h(){i.value&&(i.value.close(),i.value=null),e.value="disconnected"}function l(_){i.value?.readyState===WebSocket.OPEN&&i.value.send(JSON.stringify({type:"input",data:_}))}function f(_,S){i.value?.readyState===WebSocket.OPEN&&i.value.send(JSON.stringify({type:"resize",cols:_,rows:S}))}function u(){i.value?.readyState===WebSocket.OPEN&&i.value.send(JSON.stringify({type:"ping"}))}let d=null;function c(){d&&clearInterval(d),d=vl(u,3e4)}function p(){d&&(clearInterval(d),d=null)}return eo(()=>{p(),h()}),{status:e,connect:a,disconnect:h,sendInput:l,sendResize:f,startPingInterval:c,stopPingInterval:p}}const mf={key:0,class:"fixed bottom-4 right-4 z-50"},Sf={class:"assistant-panel absolute bottom-14 right-0 flex flex-col bg-default border-2 rounded-lg overflow-hidden shadow-lg border-default resize"},bf={class:"flex items-center justify-between border-b border-default bg-muted/50"},yf={class:"flex items-center gap-1 px-2"},wf={class:"flex flex-col flex-1 min-h-0"},Cf={class:"flex items-center gap-2 px-3 py-2 border-b border-default"},kf={key:0,class:"absolute inset-0 flex items-center justify-center bg-elevated/80 z-10"},xf={key:1,class:"flex flex-col items-center justify-center h-full text-dimmed"},Ef={class:"flex flex-col flex-1 min-h-0"},Lf={class:"flex items-center justify-between px-3 py-1.5 border-b border-default text-sm bg-muted/50"},Bf={class:"flex items-center gap-2 text-muted text-xs"},Df=ze({__name:"AssistantPanel.client",setup(e){const t=Zn(),i=te(()=>t.path==="/chat"),{assistantPanelOpen:s,assistantPanelTab:r,assistantLastConversationId:n}=Lr(),o=J(s.value);Ce(o,F=>{s.value=F});const a=J(r.value);Ce(a,F=>{r.value=F});const h=[{label:"Chat",icon:"i-lucide-message-square",value:"chat"},{label:"Terminal",icon:"i-lucide-terminal",value:"terminal"}],{connectionStatus:l,sessionStatus:f,activeConversationId:u,messages:d,conversations:c,streamingText:p,streamingToolCalls:_,loading:S,connect:w,sendMessage:y,interrupt:x,startNewConversation:g,loadConversation:L,loadConversations:B}=fl(),E=J(null),W=te(()=>c.value.map(F=>({label:F.title||`Chat ${new Date(F.startedAt).toLocaleDateString()}`,value:F.id}))),U=J(n.value??void 0);Ce(U,F=>{n.value=F??null,F&&F!==u.value&&L(F)}),Ce(u,F=>{F&&(U.value=F)});function Z(F){y(F),kt(A)}function V(){g(),U.value=void 0}function A(){E.value&&(E.value.scrollTop=E.value.scrollHeight)}Ce(p,()=>kt(A)),Ce(()=>d.value.length,()=>kt(A));function b(){w(),B(),n.value&&!u.value&&L(n.value)}const M=J(null),m=J(null),I=J(null),R=J(!1),{status:D,connect:X,disconnect:se,sendInput:Ee,sendResize:Ze,startPingInterval:Ke,stopPingInterval:Le}=vf(),Fe=te(()=>{switch(D.value){case"connected":return"i-lucide-wifi";case"connecting":return"i-lucide-loader-2";default:return"i-lucide-wifi-off"}}),Pe=te(()=>{switch(l.value){case"connected":return"i-lucide-wifi";case"connecting":return"i-lucide-loader-2";default:return"i-lucide-wifi-off"}});function Qe(F){return[F==="connecting"&&"animate-spin",F==="connected"&&"text-success",(F==="error"||F==="disconnected")&&"text-muted"]}function Kt(){if(!M.value||R.value)return;const F=new af({cursorBlink:!0,fontSize:14,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",theme:{background:"#1a1a1a",foreground:"#e5e5e5",cursor:"#e5e5e5",cursorAccent:"#1a1a1a",selectionBackground:"#3b3b3b",black:"#1a1a1a",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#6272a4",magenta:"#ff79c6",cyan:"#8be9fd",white:"#e5e5e5",brightBlack:"#4d4d4d",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#ffffff"}}),de=new cf;I.value=de,F.loadAddon(de),F.loadAddon(new gf),F.open(M.value),de.fit(),m.value=F,R.value=!0,F.onData(St=>{Ee(St)}),F.onResize(({cols:St,rows:ds})=>{Ze(St,ds)}),X(F),Ke()}function Je(){I.value&&m.value&&I.value.fit()}function Ut(){if(D.value!=="connecting"){if(!R.value){kt(Kt);return}m.value&&X(m.value)}}let et=null;function Ue(){R.value?(Je(),m.value?.focus()):(Kt(),M.value&&(et=new ResizeObserver(()=>Je()),et.observe(M.value)))}return Ce(o,F=>{F&&(a.value==="chat"?b():kt(Ue))}),Ce(a,F=>{o.value&&(F==="chat"?b():kt(Ue))}),Ci(()=>{o.value&&(a.value==="chat"?b():kt(Ue))}),eo(()=>{Le(),se(),et&&et.disconnect(),m.value&&m.value.dispose()}),(F,de)=>{const St=Jt,ds=dl,Bi=De,la=cl,ha=_l,ca=pl,ua=gl;return v(i)?$("",!0):(k(),j("div",mf,[O(St,{icon:v(o)?"i-lucide-x":"i-lucide-message-square",size:"lg",color:"primary",class:"rounded-full!",onClick:de[0]||(de[0]=bt=>o.value=!v(o))},null,8,["icon"]),O(Aa,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:T(()=>[fs(ie("div",Sf,[ie("div",bf,[O(ds,{modelValue:v(a),"onUpdate:modelValue":de[1]||(de[1]=bt=>mi(a)?a.value=bt:null),items:h,variant:"link",size:"sm",content:!1,class:"flex-1"},null,8,["modelValue"]),ie("div",yf,[O(Bi,{name:v(a)==="chat"?v(Pe):v(Fe),class:H(["size-3.5",...Qe(v(a)==="chat"?v(l):v(D))])},null,8,["name","class"]),O(St,{size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-x",onClick:de[2]||(de[2]=bt=>o.value=!1)})])]),fs(ie("div",wf,[ie("div",Cf,[O(la,{modelValue:v(U),"onUpdate:modelValue":de[3]||(de[3]=bt=>mi(U)?U.value=bt:null),items:v(W),"value-key":"value",placeholder:"New conversation",size:"xs",class:"flex-1",icon:"i-lucide-messages-square"},null,8,["modelValue","items"]),O(St,{icon:"i-lucide-plus",size:"xs",color:"primary",variant:"soft",onClick:V})]),ie("div",{ref_key:"messagesContainer",ref:E,class:"relative flex-1 overflow-y-auto p-3 space-y-3"},[v(S)?(k(),j("div",kf,[O(Bi,{name:"i-lucide-loader-2",class:"size-6 animate-spin text-primary"})])):$("",!0),v(d).length===0&&v(f)!=="streaming"&&!v(S)?(k(),j("div",xf,[O(Bi,{name:"i-lucide-message-square",class:"size-8 mb-2"}),de[4]||(de[4]=ie("p",{class:"text-sm"}," Send a message to start chatting ",-1))])):$("",!0),(k(!0),j(ke,null,Ge(v(d),bt=>(k(),z(ha,{key:bt.id,message:bt},null,8,["message"]))),128)),v(f)==="streaming"?(k(),z(ca,{key:2,text:v(p),"tool-calls":v(_)},null,8,["text","tool-calls"])):$("",!0)],512),O(ua,{"session-status":v(f),"connection-status":v(l),onSend:Z,onInterrupt:v(x)},null,8,["session-status","connection-status","onInterrupt"])],512),[[_s,v(a)==="chat"]]),fs(ie("div",Ef,[ie("div",Lf,[ie("div",Bf,[O(Bi,{name:v(Fe),class:H(["size-3.5",...Qe(v(D))])},null,8,["name","class"]),ie("span",null,Me(v(D)==="connected"?"Connected":v(D)==="connecting"?"Connecting...":v(D)==="error"?"Connection error":"Disconnected"),1)]),v(D)==="disconnected"||v(D)==="error"?(k(),z(St,{key:0,size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-refresh-cw",onClick:Ut},{default:T(()=>[...de[5]||(de[5]=[at(" Reconnect ",-1)])]),_:1})):$("",!0)]),ie("div",{ref_key:"terminalRef",ref:M,class:"flex-1 p-1 bg-[#1a1a1a]"},null,512)],512),[[_s,v(a)==="terminal"]])],512),[[_s,v(o)]])]),_:1})]))}}}),Mf=Object.assign(Df,{__name:"AssistantPanel"}),Rf={class:"p-8 text-center"},Tf={class:"mx-auto mb-6 flex size-16 items-center justify-center rounded-full bg-primary/10"},Af={class:"text-2xl font-bold text-default"},Pf={class:"mt-4 text-sm leading-relaxed text-muted"},If={class:"mt-8 flex flex-col gap-3 sm:flex-row sm:justify-center"},Of=ze({__name:"WelcomeModal",setup(e){const{onboardingDismissed:t}=Lr(),{public:{agentName:i,agentTone:s}}=Pa(),r=J(!1),n=J(!0),o={formal:{greeting:`Good day. I am ${i}.`,body:"It is a pleasure to make your acquaintance. I am your personal knowledge management assistant, here to help you organize documents, track tasks, and retain important information across sessions. To serve you most effectively, I would like to learn a bit about you — your work, your projects, and how you prefer to operate. Shall we have a brief introductory conversation?",cta:"Begin Introduction"},casual:{greeting:`Hey there! I'm ${i}!`,body:"Super excited to meet you! I'm your personal assistant — I'll help you keep your notes organized, track your tasks, and remember the important stuff so you never have to repeat yourself. But first, let's have a quick chat so I can get to know you a little. What you do, what kind of projects you work on, that sort of thing. It'll only take a minute!",cta:"Let's Chat!"},concise:{greeting:`Hi, I'm ${i}.`,body:"I'm your knowledge management assistant. I handle documents, tasks, and memory across sessions. A quick intro chat will help me understand your work and preferences so I can be more useful from the start.",cta:"Start Chat"}},a=te(()=>o[s]??o.casual);Ci(async()=>{if(t.value){n.value=!1;return}try{(await $fetch("/api/memory/search",{query:{limit:"1"}})).data?.length||(r.value=!0)}catch{}finally{n.value=!1}});function h(){t.value=!0,r.value=!1,Ia("/chat?onboarding=true")}function l(){t.value=!0,r.value=!1}return(f,u)=>{const d=De,c=Jt,p=Er;return k(),z(p,{open:v(r),"onUpdate:open":u[0]||(u[0]=_=>mi(r)?r.value=_:null),class:"sm:max-w-lg"},{content:T(()=>[ie("div",Rf,[ie("div",Tf,[O(d,{name:"i-lucide-sparkles",class:"size-8 text-primary"})]),ie("h2",Af,Me(v(a).greeting),1),ie("p",Pf,Me(v(a).body),1),ie("div",If,[O(c,{size:"lg",icon:"i-lucide-message-square",onClick:h},{default:T(()=>[at(Me(v(a).cta),1)]),_:1}),O(c,{size:"lg",color:"neutral",variant:"ghost",onClick:l},{default:T(()=>[...u[1]||(u[1]=[at(" Maybe Later ",-1)])]),_:1})])])]),_:1},8,["open"])}}}),Nf=Object.assign(Of,{__name:"WelcomeModal"}),zf={base:"fixed inset-0 flex overflow-hidden"},Ff={__name:"UDashboardGroup",props:{as:{type:null,required:!1},class:{type:null,required:!1},storage:{type:String,required:!1,default:"cookie"},storageKey:{type:String,required:!1,default:"dashboard"},persistent:{type:Boolean,required:!1,default:!0},unit:{type:String,required:!1,default:"%"}},setup(e){const t=e,i=Xn(),s=$t(),r=te(()=>Ne({extend:Ne(zf),...s.ui?.dashboardGroup||{}})),n=J(!1),o=J(!1);return $a({storage:t.storage,storageKey:t.storageKey,persistent:t.persistent,unit:t.unit,sidebarOpen:n,toggleSidebar:()=>{i.hooks.callHook("dashboard:sidebar:toggle")},sidebarCollapsed:o,collapseSidebar:a=>{i.hooks.callHook("dashboard:sidebar:collapse",a)},toggleSearch:()=>{i.hooks.callHook("dashboard:search:toggle")}}),(a,h)=>(k(),z(v(ht),{as:e.as,class:H(r.value({class:t.class}))},{default:T(()=>[Y(a.$slots,"default")]),_:3},8,["as","class"]))}},Hf=Ka(Mf),$f={class:"flex items-center gap-2 px-2 py-1.5"},Wf={key:0,class:"font-semibold text-lg"},qf={key:0,class:"text-sm truncate"},N_=ze({__name:"dashboard",setup(e){const{user:t,logout:i}=ml(),{sidebarOpen:s}=Lr(),r=J(s.value);Ce(r,a=>s.value=a);const{connect:n}=Sl();Ci(()=>{n()});const o=[[{label:"Dashboard",icon:"i-lucide-home",to:"/dashboard",onSelect:()=>{r.value=!1}},{label:"Docs",icon:"i-lucide-file-text",to:"/docs",onSelect:()=>{r.value=!1}},{label:"Tasks",icon:"i-lucide-check-square",to:"/tasks",onSelect:()=>{r.value=!1}},{label:"Agents",icon:"i-lucide-bot",to:"/agents",onSelect:()=>{r.value=!1}},{label:"Hooks",icon:"i-lucide-webhook",to:"/hooks",onSelect:()=>{r.value=!1}},{label:"Memories",icon:"i-lucide-brain",to:"/memories",onSelect:()=>{r.value=!1}},{label:"Usage",icon:"i-lucide-bar-chart-3",to:"/usage",onSelect:()=>{r.value=!1}},{label:"Chat",icon:"i-lucide-message-square",to:"/chat",onSelect:()=>{r.value=!1}},{label:"Settings",icon:"i-lucide-settings",to:"/settings",onSelect:()=>{r.value=!1}}]];return(a,h)=>{const l=De,f=Ul,u=xr,d=Jt,c=qa,p=Gl,_=kr,S=Ja,w=Za,y=Zl,x=Jh,g=Hf,L=Nf,B=Ff;return k(),z(B,{unit:"rem"},{default:T(()=>[O(y,{id:"main",open:v(r),"onUpdate:open":h[0]||(h[0]=E=>mi(r)?r.value=E:null),collapsible:"",resizable:"",class:"bg-elevated/25",ui:{footer:"lg:border-t lg:border-default"}},{header:T(({collapsed:E})=>[ie("div",$f,[O(l,{name:"i-lucide-brain",class:"size-6 text-primary shrink-0"}),E?$("",!0):(k(),j("span",Wf,"Cognova"))])]),default:T(({collapsed:E})=>[O(c,null,{fallback:T(()=>[O(d,{label:E?void 0:"Search...",icon:"i-lucide-search",color:"neutral",variant:"ghost",class:"w-full justify-start",ui:{trailingIcon:"ms-auto"}},os({_:2},[E?void 0:{name:"trailing",fn:T(()=>[O(u,null,{default:T(()=>[...h[1]||(h[1]=[at("⌘K",-1)])]),_:1})]),key:"0"}]),1032,["label"])]),default:T(()=>[O(f,{collapsed:E},null,8,["collapsed"])]),_:2},1024),O(p,{collapsed:E,items:o[0],orientation:"vertical",tooltip:"",popover:""},null,8,["collapsed","items"])]),footer:T(({collapsed:E})=>[O(c,null,{fallback:T(()=>[O(d,{variant:"ghost",class:"w-full justify-start",ui:{leadingIcon:"size-5"}},{default:T(()=>[O(w,{class:"size-5 rounded-full"}),E?$("",!0):(k(),z(w,{key:0,class:"h-4 w-20"}))]),_:2},1024)]),default:T(()=>[O(S,{items:[[{label:"Sign out",icon:"i-lucide-log-out",onSelect:v(i)}]]},{default:T(()=>[O(d,{variant:"ghost",class:"w-full justify-start",ui:{leadingIcon:"size-5"}},{default:T(()=>[O(_,{alt:v(t)?.name||"User",size:"2xs"},null,8,["alt"]),E?$("",!0):(k(),j("span",qf,Me(v(t)?.name||v(t)?.email||"User"),1))]),_:2},1024)]),_:2},1032,["items"])]),_:2},1024)]),_:1},8,["open"]),O(c,null,{fallback:T(()=>[...h[2]||(h[2]=[ie("span",null,null,-1)])]),default:T(()=>[O(x)]),_:1}),Y(a.$slots,"default"),O(c,null,{fallback:T(()=>[...h[3]||(h[3]=[ie("span",null,null,-1)])]),default:T(()=>[O(g)]),_:1}),O(c,null,{default:T(()=>[O(L)]),_:1})]),_:3})}}});export{N_ as default};
16
+ `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Fs.get()},set promptLabel(e){Fs.set(e)},get tooMuchOutput(){return Hs.get()},set tooMuchOutput(e){Hs.set(e)}}}_verifyIntegers(...e){for(it of e)if(it===1/0||isNaN(it)||it%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(it of e)if(it&&(it===1/0||isNaN(it)||it%1!==0||it<0))throw new Error("This API only accepts positive integers")}};var lf=2,hf=1,cf=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},a=o.top+o.bottom,h=o.right+o.left,l=s-a,f=r-h-t;return{cols:Math.max(lf,Math.floor(f/e.css.cell.width)),rows:Math.max(hf,Math.floor(l/e.css.cell.height))}}};var uf=class{constructor(e,t,i,s={}){this._terminal=e,this._regex=t,this._handler=i,this._options=s}provideLinks(e,t){let i=ff.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(i))}_addCallbacks(e){return e.map(t=>(t.leave=this._options.leave,t.hover=(i,s)=>{if(this._options.hover){let{range:r}=t;this._options.hover(i,s,r)}},t))}};function df(e){try{let t=new URL(e),i=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(i.toLocaleLowerCase())}catch{return!1}}var ff=class Vi{static computeLink(t,i,s,r){let n=new RegExp(i.source,(i.flags||"")+"g"),[o,a]=Vi._getWindowedLineStrings(t-1,s),h=o.join(""),l,f=[];for(;l=n.exec(h);){let u=l[0];if(!df(u))continue;let[d,c]=Vi._mapStrIdx(s,a,0,l.index),[p,_]=Vi._mapStrIdx(s,d,c,u.length);if(d===-1||c===-1||p===-1||_===-1)continue;let S={start:{x:c+1,y:d+1},end:{x:_,y:p+1}};f.push({range:S,text:u,activate:r})}return f}static _getWindowedLineStrings(t,i){let s,r=t,n=t,o=0,a="",h=[];if(s=i.buffer.active.getLine(t)){let l=s.translateToString(!0);if(s.isWrapped&&l[0]!==" "){for(o=0;(s=i.buffer.active.getLine(--r))&&o<2048&&(a=s.translateToString(!0),o+=a.length,h.push(a),!(!s.isWrapped||a.indexOf(" ")!==-1)););h.reverse()}for(h.push(l),o=0;(s=i.buffer.active.getLine(++n))&&s.isWrapped&&o<2048&&(a=s.translateToString(!0),o+=a.length,h.push(a),a.indexOf(" ")===-1););}return[h,r]}static _mapStrIdx(t,i,s,r){let n=t.buffer.active,o=n.getNullCell(),a=s;for(;r;){let h=n.getLine(i);if(!h)return[-1,-1];for(let l=a;l<h.length;++l){h.getCell(l,o);let f=o.getChars();if(o.getWidth()&&(r-=f.length||1,l===h.length-1&&f==="")){let u=n.getLine(i+1);u&&u.isWrapped&&(u.getCell(0,o),o.getWidth()===2&&(r+=1))}if(r<0)return[i,l]}i++,a=0}return[i,a]}},_f=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function pf(e,t){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var gf=class{constructor(e=pf,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,i=t.urlRegex||_f;this._linkProvider=this._terminal.registerLinkProvider(new uf(this._terminal,i,this._handler,t))}dispose(){this._linkProvider?.dispose()}};function vf(){const e=J("disconnected"),t=J(null),i=J(null),s=J(0),r=5,n=2e3;function o(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/terminal`}function a(_){t.value=_,e.value="connecting";const S=new WebSocket(o());i.value=S,S.onopen=()=>{e.value="connected",s.value=0,f(_.cols,_.rows)},S.onmessage=w=>{try{const y=JSON.parse(w.data);y.type==="output"&&y.data?_.write(y.data):y.type==="error"&&y.data&&(e.value="error",_.write(`\x1B[31m${y.data}\x1B[0m`))}catch{_.write(w.data)}},S.onclose=()=>{e.value="disconnected",s.value<r&&(s.value++,setTimeout(()=>{t.value&&a(t.value)},n))},S.onerror=()=>{e.value="error"}}function h(){i.value&&(i.value.close(),i.value=null),e.value="disconnected"}function l(_){i.value?.readyState===WebSocket.OPEN&&i.value.send(JSON.stringify({type:"input",data:_}))}function f(_,S){i.value?.readyState===WebSocket.OPEN&&i.value.send(JSON.stringify({type:"resize",cols:_,rows:S}))}function u(){i.value?.readyState===WebSocket.OPEN&&i.value.send(JSON.stringify({type:"ping"}))}let d=null;function c(){d&&clearInterval(d),d=vl(u,3e4)}function p(){d&&(clearInterval(d),d=null)}return eo(()=>{p(),h()}),{status:e,connect:a,disconnect:h,sendInput:l,sendResize:f,startPingInterval:c,stopPingInterval:p}}const mf={key:0,class:"fixed bottom-4 right-4 z-50"},Sf={class:"assistant-panel absolute bottom-14 right-0 flex flex-col bg-default border-2 rounded-lg overflow-hidden shadow-lg border-default resize"},bf={class:"flex items-center justify-between border-b border-default bg-muted/50"},yf={class:"flex items-center gap-1 px-2"},wf={class:"flex flex-col flex-1 min-h-0"},Cf={class:"flex items-center gap-2 px-3 py-2 border-b border-default"},kf={key:0,class:"absolute inset-0 flex items-center justify-center bg-elevated/80 z-10"},xf={key:1,class:"flex flex-col items-center justify-center h-full text-dimmed"},Ef={class:"flex flex-col flex-1 min-h-0"},Lf={class:"flex items-center justify-between px-3 py-1.5 border-b border-default text-sm bg-muted/50"},Bf={class:"flex items-center gap-2 text-muted text-xs"},Df=ze({__name:"AssistantPanel.client",setup(e){const t=Zn(),i=te(()=>t.path==="/chat"),{assistantPanelOpen:s,assistantPanelTab:r,assistantLastConversationId:n}=Lr(),o=J(s.value);Ce(o,F=>{s.value=F});const a=J(r.value);Ce(a,F=>{r.value=F});const h=[{label:"Chat",icon:"i-lucide-message-square",value:"chat"},{label:"Terminal",icon:"i-lucide-terminal",value:"terminal"}],{connectionStatus:l,sessionStatus:f,activeConversationId:u,messages:d,conversations:c,streamingText:p,streamingToolCalls:_,loading:S,connect:w,sendMessage:y,interrupt:x,startNewConversation:g,loadConversation:L,loadConversations:B}=fl(),E=J(null),W=te(()=>c.value.map(F=>({label:F.title||`Chat ${new Date(F.startedAt).toLocaleDateString()}`,value:F.id}))),U=J(n.value??void 0);Ce(U,F=>{n.value=F??null,F&&F!==u.value&&L(F)}),Ce(u,F=>{F&&(U.value=F)});function Z(F){y(F),kt(A)}function V(){g(),U.value=void 0}function A(){E.value&&(E.value.scrollTop=E.value.scrollHeight)}Ce(p,()=>kt(A)),Ce(()=>d.value.length,()=>kt(A));function b(){w(),B(),n.value&&!u.value&&L(n.value)}const M=J(null),m=J(null),I=J(null),R=J(!1),{status:D,connect:X,disconnect:se,sendInput:Ee,sendResize:Ze,startPingInterval:Ke,stopPingInterval:Le}=vf(),Fe=te(()=>{switch(D.value){case"connected":return"i-lucide-wifi";case"connecting":return"i-lucide-loader-2";default:return"i-lucide-wifi-off"}}),Pe=te(()=>{switch(l.value){case"connected":return"i-lucide-wifi";case"connecting":return"i-lucide-loader-2";default:return"i-lucide-wifi-off"}});function Qe(F){return[F==="connecting"&&"animate-spin",F==="connected"&&"text-success",(F==="error"||F==="disconnected")&&"text-muted"]}function Kt(){if(!M.value||R.value)return;const F=new af({cursorBlink:!0,fontSize:14,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",theme:{background:"#1a1a1a",foreground:"#e5e5e5",cursor:"#e5e5e5",cursorAccent:"#1a1a1a",selectionBackground:"#3b3b3b",black:"#1a1a1a",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#6272a4",magenta:"#ff79c6",cyan:"#8be9fd",white:"#e5e5e5",brightBlack:"#4d4d4d",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#ffffff"}}),de=new cf;I.value=de,F.loadAddon(de),F.loadAddon(new gf),F.open(M.value),de.fit(),m.value=F,R.value=!0,F.onData(St=>{Ee(St)}),F.onResize(({cols:St,rows:ds})=>{Ze(St,ds)}),X(F),Ke()}function Je(){I.value&&m.value&&I.value.fit()}function Ut(){if(D.value!=="connecting"){if(!R.value){kt(Kt);return}m.value&&X(m.value)}}let et=null;function Ue(){R.value?(Je(),m.value?.focus()):(Kt(),M.value&&(et=new ResizeObserver(()=>Je()),et.observe(M.value)))}return Ce(o,F=>{F&&(a.value==="chat"?b():kt(Ue))}),Ce(a,F=>{o.value&&(F==="chat"?b():kt(Ue))}),Ci(()=>{o.value&&(a.value==="chat"?b():kt(Ue))}),eo(()=>{Le(),se(),et&&et.disconnect(),m.value&&m.value.dispose()}),(F,de)=>{const St=Jt,ds=dl,Bi=De,la=hl,ha=_l,ca=pl,ua=gl;return v(i)?$("",!0):(k(),j("div",mf,[O(St,{icon:v(o)?"i-lucide-x":"i-lucide-message-square",size:"lg",color:"primary",class:"rounded-full!",onClick:de[0]||(de[0]=bt=>o.value=!v(o))},null,8,["icon"]),O(Aa,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:T(()=>[fs(ie("div",Sf,[ie("div",bf,[O(ds,{modelValue:v(a),"onUpdate:modelValue":de[1]||(de[1]=bt=>mi(a)?a.value=bt:null),items:h,variant:"link",size:"sm",content:!1,class:"flex-1"},null,8,["modelValue"]),ie("div",yf,[O(Bi,{name:v(a)==="chat"?v(Pe):v(Fe),class:H(["size-3.5",...Qe(v(a)==="chat"?v(l):v(D))])},null,8,["name","class"]),O(St,{size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-x",onClick:de[2]||(de[2]=bt=>o.value=!1)})])]),fs(ie("div",wf,[ie("div",Cf,[O(la,{modelValue:v(U),"onUpdate:modelValue":de[3]||(de[3]=bt=>mi(U)?U.value=bt:null),items:v(W),"value-key":"value",placeholder:"New conversation",size:"xs",class:"flex-1",icon:"i-lucide-messages-square"},null,8,["modelValue","items"]),O(St,{icon:"i-lucide-plus",size:"xs",color:"primary",variant:"soft",onClick:V})]),ie("div",{ref_key:"messagesContainer",ref:E,class:"relative flex-1 overflow-y-auto p-3 space-y-3"},[v(S)?(k(),j("div",kf,[O(Bi,{name:"i-lucide-loader-2",class:"size-6 animate-spin text-primary"})])):$("",!0),v(d).length===0&&v(f)!=="streaming"&&!v(S)?(k(),j("div",xf,[O(Bi,{name:"i-lucide-message-square",class:"size-8 mb-2"}),de[4]||(de[4]=ie("p",{class:"text-sm"}," Send a message to start chatting ",-1))])):$("",!0),(k(!0),j(ke,null,Ge(v(d),bt=>(k(),z(ha,{key:bt.id,message:bt},null,8,["message"]))),128)),v(f)==="streaming"?(k(),z(ca,{key:2,text:v(p),"tool-calls":v(_)},null,8,["text","tool-calls"])):$("",!0)],512),O(ua,{"session-status":v(f),"connection-status":v(l),onSend:Z,onInterrupt:v(x)},null,8,["session-status","connection-status","onInterrupt"])],512),[[_s,v(a)==="chat"]]),fs(ie("div",Ef,[ie("div",Lf,[ie("div",Bf,[O(Bi,{name:v(Fe),class:H(["size-3.5",...Qe(v(D))])},null,8,["name","class"]),ie("span",null,Me(v(D)==="connected"?"Connected":v(D)==="connecting"?"Connecting...":v(D)==="error"?"Connection error":"Disconnected"),1)]),v(D)==="disconnected"||v(D)==="error"?(k(),z(St,{key:0,size:"xs",color:"neutral",variant:"ghost",icon:"i-lucide-refresh-cw",onClick:Ut},{default:T(()=>[...de[5]||(de[5]=[at(" Reconnect ",-1)])]),_:1})):$("",!0)]),ie("div",{ref_key:"terminalRef",ref:M,class:"flex-1 p-1 bg-[#1a1a1a]"},null,512)],512),[[_s,v(a)==="terminal"]])],512),[[_s,v(o)]])]),_:1})]))}}}),Mf=Object.assign(Df,{__name:"AssistantPanel"}),Rf={class:"p-8 text-center"},Tf={class:"mx-auto mb-6 flex size-16 items-center justify-center rounded-full bg-primary/10"},Af={class:"text-2xl font-bold text-default"},Pf={class:"mt-4 text-sm leading-relaxed text-muted"},If={class:"mt-8 flex flex-col gap-3 sm:flex-row sm:justify-center"},Of=ze({__name:"WelcomeModal",setup(e){const{onboardingDismissed:t}=Lr(),{public:{agentName:i,agentTone:s}}=Pa(),r=J(!1),n=J(!0),o={formal:{greeting:`Good day. I am ${i}.`,body:"It is a pleasure to make your acquaintance. I am your personal knowledge management assistant, here to help you organize documents, track tasks, and retain important information across sessions. To serve you most effectively, I would like to learn a bit about you — your work, your projects, and how you prefer to operate. Shall we have a brief introductory conversation?",cta:"Begin Introduction"},casual:{greeting:`Hey there! I'm ${i}!`,body:"Super excited to meet you! I'm your personal assistant — I'll help you keep your notes organized, track your tasks, and remember the important stuff so you never have to repeat yourself. But first, let's have a quick chat so I can get to know you a little. What you do, what kind of projects you work on, that sort of thing. It'll only take a minute!",cta:"Let's Chat!"},concise:{greeting:`Hi, I'm ${i}.`,body:"I'm your knowledge management assistant. I handle documents, tasks, and memory across sessions. A quick intro chat will help me understand your work and preferences so I can be more useful from the start.",cta:"Start Chat"}},a=te(()=>o[s]??o.casual);Ci(async()=>{if(t.value){n.value=!1;return}try{(await $fetch("/api/memory/search",{query:{limit:"1"}})).data?.length||(r.value=!0)}catch{}finally{n.value=!1}});function h(){t.value=!0,r.value=!1,Ia("/chat?onboarding=true")}function l(){t.value=!0,r.value=!1}return(f,u)=>{const d=De,c=Jt,p=Er;return k(),z(p,{open:v(r),"onUpdate:open":u[0]||(u[0]=_=>mi(r)?r.value=_:null),class:"sm:max-w-lg"},{content:T(()=>[ie("div",Rf,[ie("div",Tf,[O(d,{name:"i-lucide-sparkles",class:"size-8 text-primary"})]),ie("h2",Af,Me(v(a).greeting),1),ie("p",Pf,Me(v(a).body),1),ie("div",If,[O(c,{size:"lg",icon:"i-lucide-message-square",onClick:h},{default:T(()=>[at(Me(v(a).cta),1)]),_:1}),O(c,{size:"lg",color:"neutral",variant:"ghost",onClick:l},{default:T(()=>[...u[1]||(u[1]=[at(" Maybe Later ",-1)])]),_:1})])])]),_:1},8,["open"])}}}),Nf=Object.assign(Of,{__name:"WelcomeModal"}),zf={base:"fixed inset-0 flex overflow-hidden"},Ff={__name:"UDashboardGroup",props:{as:{type:null,required:!1},class:{type:null,required:!1},storage:{type:String,required:!1,default:"cookie"},storageKey:{type:String,required:!1,default:"dashboard"},persistent:{type:Boolean,required:!1,default:!0},unit:{type:String,required:!1,default:"%"}},setup(e){const t=e,i=Xn(),s=$t(),r=te(()=>Ne({extend:Ne(zf),...s.ui?.dashboardGroup||{}})),n=J(!1),o=J(!1);return $a({storage:t.storage,storageKey:t.storageKey,persistent:t.persistent,unit:t.unit,sidebarOpen:n,toggleSidebar:()=>{i.hooks.callHook("dashboard:sidebar:toggle")},sidebarCollapsed:o,collapseSidebar:a=>{i.hooks.callHook("dashboard:sidebar:collapse",a)},toggleSearch:()=>{i.hooks.callHook("dashboard:search:toggle")}}),(a,h)=>(k(),z(v(ht),{as:e.as,class:H(r.value({class:t.class}))},{default:T(()=>[Y(a.$slots,"default")]),_:3},8,["as","class"]))}},Hf=Ka(Mf),$f={class:"flex items-center gap-2 px-2 py-1.5"},Wf={key:0,class:"font-semibold text-lg"},qf={key:0,class:"text-sm truncate"},H_=ze({__name:"dashboard",setup(e){const{user:t,logout:i}=ml(),{sidebarOpen:s}=Lr(),r=J(s.value);Ce(r,a=>s.value=a);const{connect:n}=Sl();Ci(()=>{n()});const o=[[{label:"Dashboard",icon:"i-lucide-home",to:"/dashboard",onSelect:()=>{r.value=!1}},{label:"Docs",icon:"i-lucide-file-text",to:"/docs",onSelect:()=>{r.value=!1}},{label:"Tasks",icon:"i-lucide-check-square",to:"/tasks",onSelect:()=>{r.value=!1}},{label:"Agents",icon:"i-lucide-bot",to:"/agents",onSelect:()=>{r.value=!1}},{label:"Hooks",icon:"i-lucide-webhook",to:"/hooks",onSelect:()=>{r.value=!1}},{label:"Skills",icon:"i-lucide-puzzle",to:"/skills",onSelect:()=>{r.value=!1}},{label:"Memories",icon:"i-lucide-brain",to:"/memories",onSelect:()=>{r.value=!1}},{label:"Usage",icon:"i-lucide-bar-chart-3",to:"/usage",onSelect:()=>{r.value=!1}},{label:"Chat",icon:"i-lucide-message-square",to:"/chat",onSelect:()=>{r.value=!1}},{label:"Settings",icon:"i-lucide-settings",to:"/settings",onSelect:()=>{r.value=!1}}]];return(a,h)=>{const l=De,f=Ul,u=xr,d=Jt,c=qa,p=Gl,_=kr,S=Ja,w=Za,y=Zl,x=Jh,g=Hf,L=Nf,B=Ff;return k(),z(B,{unit:"rem"},{default:T(()=>[O(y,{id:"main",open:v(r),"onUpdate:open":h[0]||(h[0]=E=>mi(r)?r.value=E:null),collapsible:"",resizable:"",class:"bg-elevated/25",ui:{footer:"lg:border-t lg:border-default"}},{header:T(({collapsed:E})=>[ie("div",$f,[O(l,{name:"i-lucide-brain",class:"size-6 text-primary shrink-0"}),E?$("",!0):(k(),j("span",Wf,"Cognova"))])]),default:T(({collapsed:E})=>[O(c,null,{fallback:T(()=>[O(d,{label:E?void 0:"Search...",icon:"i-lucide-search",color:"neutral",variant:"ghost",class:"w-full justify-start",ui:{trailingIcon:"ms-auto"}},os({_:2},[E?void 0:{name:"trailing",fn:T(()=>[O(u,null,{default:T(()=>[...h[1]||(h[1]=[at("⌘K",-1)])]),_:1})]),key:"0"}]),1032,["label"])]),default:T(()=>[O(f,{collapsed:E},null,8,["collapsed"])]),_:2},1024),O(p,{collapsed:E,items:o[0],orientation:"vertical",tooltip:"",popover:""},null,8,["collapsed","items"])]),footer:T(({collapsed:E})=>[O(c,null,{fallback:T(()=>[O(d,{variant:"ghost",class:"w-full justify-start",ui:{leadingIcon:"size-5"}},{default:T(()=>[O(w,{class:"size-5 rounded-full"}),E?$("",!0):(k(),z(w,{key:0,class:"h-4 w-20"}))]),_:2},1024)]),default:T(()=>[O(S,{items:[[{label:"Sign out",icon:"i-lucide-log-out",onSelect:v(i)}]]},{default:T(()=>[O(d,{variant:"ghost",class:"w-full justify-start",ui:{leadingIcon:"size-5"}},{default:T(()=>[O(_,{alt:v(t)?.name||"User",size:"2xs"},null,8,["alt"]),E?$("",!0):(k(),j("span",qf,Me(v(t)?.name||v(t)?.email||"User"),1))]),_:2},1024)]),_:2},1032,["items"])]),_:2},1024)]),_:1},8,["open"]),O(c,null,{fallback:T(()=>[...h[2]||(h[2]=[ie("span",null,null,-1)])]),default:T(()=>[O(x)]),_:1}),Y(a.$slots,"default"),O(c,null,{fallback:T(()=>[...h[3]||(h[3]=[ie("span",null,null,-1)])]),default:T(()=>[O(g)]),_:1}),O(c,null,{default:T(()=>[O(L)]),_:1})]),_:3})}}});export{H_ as default};