@sentry/mcp-server 0.11.0 → 0.13.0

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 (581) hide show
  1. package/README.md +4 -2
  2. package/dist/analyze-issue-with-seer-Bq3kefOr.cjs +169 -0
  3. package/dist/analyze-issue-with-seer-Bq3kefOr.cjs.map +1 -0
  4. package/dist/analyze-issue-with-seer-Dk0ZFwN8.js +163 -0
  5. package/dist/analyze-issue-with-seer-Dk0ZFwN8.js.map +1 -0
  6. package/dist/api-client/client.cjs +2 -2
  7. package/dist/api-client/client.d.cts +3 -3
  8. package/dist/api-client/client.d.ts +3 -3
  9. package/dist/api-client/client.js +2 -2
  10. package/dist/api-client/index.cjs +10 -2
  11. package/dist/api-client/index.d.cts +4 -4
  12. package/dist/api-client/index.d.ts +5 -5
  13. package/dist/api-client/index.js +5 -5
  14. package/dist/api-client/schema.cjs +9 -1
  15. package/dist/api-client/schema.d.cts +2 -2
  16. package/dist/api-client/schema.d.ts +2 -2
  17. package/dist/api-client/schema.js +2 -2
  18. package/dist/api-client/types.d.cts +3 -3
  19. package/dist/api-client/types.d.ts +3 -3
  20. package/dist/api-client/types.js +1 -1
  21. package/dist/api-utils-BJS0CChW.cjs +36 -0
  22. package/dist/api-utils-BJS0CChW.cjs.map +1 -0
  23. package/dist/api-utils-BcB1cMXS.js +31 -0
  24. package/dist/api-utils-BcB1cMXS.js.map +1 -0
  25. package/dist/client-BNTsOycD.cjs +620 -0
  26. package/dist/client-BNTsOycD.cjs.map +1 -0
  27. package/dist/client-BbamPqV4.js +609 -0
  28. package/dist/client-BbamPqV4.js.map +1 -0
  29. package/dist/client-Dae1ZwWb.d.cts +556 -0
  30. package/dist/client-Dae1ZwWb.d.cts.map +1 -0
  31. package/dist/client-qyEu8fvj.d.ts +556 -0
  32. package/dist/client-qyEu8fvj.d.ts.map +1 -0
  33. package/dist/constants-ClkMK29-.cjs +182 -0
  34. package/dist/constants-ClkMK29-.cjs.map +1 -0
  35. package/dist/constants-S7AU45oQ.js +164 -0
  36. package/dist/constants-S7AU45oQ.js.map +1 -0
  37. package/dist/constants.cjs +5 -0
  38. package/dist/constants.d.cts +23 -0
  39. package/dist/constants.d.cts.map +1 -0
  40. package/dist/constants.d.ts +23 -0
  41. package/dist/constants.d.ts.map +1 -0
  42. package/dist/constants.js +3 -0
  43. package/dist/create-dsn-B3L8iWno.js +59 -0
  44. package/dist/create-dsn-B3L8iWno.js.map +1 -0
  45. package/dist/create-dsn-CVPtt_Es.cjs +65 -0
  46. package/dist/create-dsn-CVPtt_Es.cjs.map +1 -0
  47. package/dist/create-project-B_6a6okf.cjs +82 -0
  48. package/dist/create-project-B_6a6okf.cjs.map +1 -0
  49. package/dist/create-project-DdIXMvWI.js +76 -0
  50. package/dist/create-project-DdIXMvWI.js.map +1 -0
  51. package/dist/create-team-BarRdaZK.js +47 -0
  52. package/dist/create-team-BarRdaZK.js.map +1 -0
  53. package/dist/create-team-C1DP5Z1r.cjs +53 -0
  54. package/dist/create-team-C1DP5Z1r.cjs.map +1 -0
  55. package/dist/defineTool-77H4nSna.js +8 -0
  56. package/dist/defineTool-77H4nSna.js.map +1 -0
  57. package/dist/defineTool-lWNTzWl_.cjs +14 -0
  58. package/dist/defineTool-lWNTzWl_.cjs.map +1 -0
  59. package/dist/{errors-BJSrT6Ou.js → errors-CIoxzIug.js} +1 -1
  60. package/dist/{errors-BJSrT6Ou.js.map → errors-CIoxzIug.js.map} +1 -1
  61. package/dist/{errors-B9fwS-aP.cjs → errors-YmiXLOyx.cjs} +1 -1
  62. package/dist/{errors-B9fwS-aP.cjs.map → errors-YmiXLOyx.cjs.map} +1 -1
  63. package/dist/errors.cjs +1 -1
  64. package/dist/errors.js +1 -1
  65. package/dist/fetch-utils-B-a92ObC.d.ts +14 -0
  66. package/dist/fetch-utils-B-a92ObC.d.ts.map +1 -0
  67. package/dist/fetch-utils-BMKjO-cc.js +29 -0
  68. package/dist/fetch-utils-BMKjO-cc.js.map +1 -0
  69. package/dist/fetch-utils-DlPjrSk2.js +0 -0
  70. package/dist/fetch-utils-DzdRW4Yd.d.cts +14 -0
  71. package/dist/fetch-utils-DzdRW4Yd.d.cts.map +1 -0
  72. package/dist/fetch-utils-oab6uNp3.cjs +35 -0
  73. package/dist/fetch-utils-oab6uNp3.cjs.map +1 -0
  74. package/dist/find-dsns-BDJWY6nZ.cjs +58 -0
  75. package/dist/find-dsns-BDJWY6nZ.cjs.map +1 -0
  76. package/dist/find-dsns-BPbblgrn.js +52 -0
  77. package/dist/find-dsns-BPbblgrn.js.map +1 -0
  78. package/dist/find-errors-B9wLxXA0.js +91 -0
  79. package/dist/find-errors-B9wLxXA0.js.map +1 -0
  80. package/dist/find-errors-DnFs3PaH.cjs +97 -0
  81. package/dist/find-errors-DnFs3PaH.cjs.map +1 -0
  82. package/dist/find-issues-BI1tI3cJ.js +92 -0
  83. package/dist/find-issues-BI1tI3cJ.js.map +1 -0
  84. package/dist/find-issues-CwPbwRXK.cjs +98 -0
  85. package/dist/find-issues-CwPbwRXK.cjs.map +1 -0
  86. package/dist/find-organizations-CdiouW48.js +45 -0
  87. package/dist/find-organizations-CdiouW48.js.map +1 -0
  88. package/dist/find-organizations-DqS6zoTK.cjs +50 -0
  89. package/dist/find-organizations-DqS6zoTK.cjs.map +1 -0
  90. package/dist/find-projects-Ba6cdX7n.cjs +45 -0
  91. package/dist/find-projects-Ba6cdX7n.cjs.map +1 -0
  92. package/dist/find-projects-Ccfxv47h.js +39 -0
  93. package/dist/find-projects-Ccfxv47h.js.map +1 -0
  94. package/dist/find-releases-CFl86XMT.cjs +99 -0
  95. package/dist/find-releases-CFl86XMT.cjs.map +1 -0
  96. package/dist/find-releases-CFoGytN-.js +93 -0
  97. package/dist/find-releases-CFoGytN-.js.map +1 -0
  98. package/dist/find-tags-ORtYLH5b.js +39 -0
  99. package/dist/find-tags-ORtYLH5b.js.map +1 -0
  100. package/dist/find-tags-h2o0BKWO.cjs +45 -0
  101. package/dist/find-tags-h2o0BKWO.cjs.map +1 -0
  102. package/dist/find-teams-DUcDfSOl.cjs +45 -0
  103. package/dist/find-teams-DUcDfSOl.cjs.map +1 -0
  104. package/dist/find-teams-hreVp1nw.js +39 -0
  105. package/dist/find-teams-hreVp1nw.js.map +1 -0
  106. package/dist/find-transactions-BehUqQYs.js +83 -0
  107. package/dist/find-transactions-BehUqQYs.js.map +1 -0
  108. package/dist/find-transactions-BkPscam3.cjs +89 -0
  109. package/dist/find-transactions-BkPscam3.cjs.map +1 -0
  110. package/dist/formatting-B-u5CbYn.d.ts +47 -0
  111. package/dist/formatting-B-u5CbYn.d.ts.map +1 -0
  112. package/dist/formatting-BlMiQa9i.cjs +388 -0
  113. package/dist/formatting-BlMiQa9i.cjs.map +1 -0
  114. package/dist/formatting-Di1X9Jn3.d.cts +47 -0
  115. package/dist/formatting-Di1X9Jn3.d.cts.map +1 -0
  116. package/dist/formatting-pUm38KOj.js +370 -0
  117. package/dist/formatting-pUm38KOj.js.map +1 -0
  118. package/dist/formatting-utils-C3sej5ER.js +14 -0
  119. package/dist/formatting-utils-C3sej5ER.js.map +1 -0
  120. package/dist/formatting-utils-DDz14xeB.cjs +20 -0
  121. package/dist/formatting-utils-DDz14xeB.cjs.map +1 -0
  122. package/dist/get-doc-AuAW_qr9.cjs +86 -0
  123. package/dist/get-doc-AuAW_qr9.cjs.map +1 -0
  124. package/dist/get-doc-BtxZOy7y.js +80 -0
  125. package/dist/get-doc-BtxZOy7y.js.map +1 -0
  126. package/dist/get-event-attachment-Bq5lkaKV.cjs +144 -0
  127. package/dist/get-event-attachment-Bq5lkaKV.cjs.map +1 -0
  128. package/dist/get-event-attachment-DwAl54zv.js +138 -0
  129. package/dist/get-event-attachment-DwAl54zv.js.map +1 -0
  130. package/dist/get-issue-details-DrpD5LlK.js +104 -0
  131. package/dist/get-issue-details-DrpD5LlK.js.map +1 -0
  132. package/dist/get-issue-details-qGwu18JX.cjs +110 -0
  133. package/dist/get-issue-details-qGwu18JX.cjs.map +1 -0
  134. package/dist/index.cjs +60 -21
  135. package/dist/index.cjs.map +1 -1
  136. package/dist/index.js +62 -23
  137. package/dist/index.js.map +1 -1
  138. package/dist/internal/fetch-utils.cjs +3 -0
  139. package/dist/internal/fetch-utils.d.cts +2 -0
  140. package/dist/internal/fetch-utils.d.ts +2 -0
  141. package/dist/internal/fetch-utils.js +3 -0
  142. package/dist/internal/formatting.cjs +1 -1
  143. package/dist/internal/formatting.d.cts +5 -24
  144. package/dist/internal/formatting.d.ts +6 -25
  145. package/dist/internal/formatting.js +1 -1
  146. package/dist/internal/issue-helpers.cjs +1 -1
  147. package/dist/internal/issue-helpers.d.cts +2 -44
  148. package/dist/internal/issue-helpers.d.ts +2 -44
  149. package/dist/internal/issue-helpers.js +1 -1
  150. package/dist/internal/test-fixtures.cjs +214 -0
  151. package/dist/internal/test-fixtures.cjs.map +1 -0
  152. package/dist/internal/test-fixtures.d.cts +2138 -0
  153. package/dist/internal/test-fixtures.d.cts.map +1 -0
  154. package/dist/internal/test-fixtures.d.ts +2138 -0
  155. package/dist/internal/test-fixtures.d.ts.map +1 -0
  156. package/dist/internal/test-fixtures.js +205 -0
  157. package/dist/internal/test-fixtures.js.map +1 -0
  158. package/dist/issue-helpers-BOn4g7rx.d.ts +52 -0
  159. package/dist/issue-helpers-BOn4g7rx.d.ts.map +1 -0
  160. package/dist/{issue-helpers-CSNNO03f.js → issue-helpers-CqqYnwYE.js} +9 -1
  161. package/dist/issue-helpers-CqqYnwYE.js.map +1 -0
  162. package/dist/issue-helpers-Cz01Ipvl.d.cts +52 -0
  163. package/dist/issue-helpers-Cz01Ipvl.d.cts.map +1 -0
  164. package/dist/{issue-helpers-71XgJVXC.cjs → issue-helpers-DyAIO0w6.cjs} +9 -1
  165. package/dist/issue-helpers-DyAIO0w6.cjs.map +1 -0
  166. package/dist/issue-utils-BVAB6I-Z.js +0 -0
  167. package/dist/issue-utils-pdbo-5LW.cjs +0 -0
  168. package/dist/{logging-CXLD0FFB.js → logging-LnQMFw-_.js} +1 -1
  169. package/dist/logging-LnQMFw-_.js.map +1 -0
  170. package/dist/{logging-ByvSjT6V.cjs → logging-oIouXrcb.cjs} +1 -1
  171. package/dist/logging-oIouXrcb.cjs.map +1 -0
  172. package/dist/logging.cjs +1 -1
  173. package/dist/logging.d.cts +30 -1
  174. package/dist/logging.d.cts.map +1 -1
  175. package/dist/logging.d.ts +30 -1
  176. package/dist/logging.d.ts.map +1 -1
  177. package/dist/logging.js +1 -1
  178. package/dist/{promptDefinitions-H0q1_X-K.d.ts → promptDefinitions-6xelipaz.d.ts} +11 -3
  179. package/dist/promptDefinitions-6xelipaz.d.ts.map +1 -0
  180. package/dist/{promptDefinitions-D3ll3qCd.cjs → promptDefinitions-C29BWGYg.cjs} +11 -4
  181. package/dist/promptDefinitions-C29BWGYg.cjs.map +1 -0
  182. package/dist/{promptDefinitions-aKmUZWWO.js → promptDefinitions-CSKE8T0a.js} +11 -4
  183. package/dist/promptDefinitions-CSKE8T0a.js.map +1 -0
  184. package/dist/{promptDefinitions-DMucOchd.d.cts → promptDefinitions-CVHtYaj8.d.cts} +11 -3
  185. package/dist/promptDefinitions-CVHtYaj8.d.cts.map +1 -0
  186. package/dist/promptDefinitions.cjs +3 -2
  187. package/dist/promptDefinitions.d.cts +1 -1
  188. package/dist/promptDefinitions.d.ts +1 -1
  189. package/dist/promptDefinitions.js +3 -2
  190. package/dist/{prompts-CzD0yl7Z.js → prompts-C8Y9w5c4.js} +9 -7
  191. package/dist/prompts-C8Y9w5c4.js.map +1 -0
  192. package/dist/{prompts-DMwoay8l.cjs → prompts-Df3i1XSB.cjs} +8 -7
  193. package/dist/prompts-Df3i1XSB.cjs.map +1 -0
  194. package/dist/prompts.cjs +2 -1
  195. package/dist/prompts.d.cts +4 -5
  196. package/dist/prompts.d.cts.map +1 -1
  197. package/dist/prompts.d.ts +4 -5
  198. package/dist/prompts.d.ts.map +1 -1
  199. package/dist/prompts.js +2 -1
  200. package/dist/resources-BHF8a1ZB.js +92 -0
  201. package/dist/resources-BHF8a1ZB.js.map +1 -0
  202. package/dist/resources-BM_YQGcb.cjs +104 -0
  203. package/dist/resources-BM_YQGcb.cjs.map +1 -0
  204. package/dist/resources.cjs +5 -2
  205. package/dist/resources.d.cts +30 -7
  206. package/dist/resources.d.cts.map +1 -1
  207. package/dist/resources.d.ts +30 -7
  208. package/dist/resources.d.ts.map +1 -1
  209. package/dist/resources.js +4 -2
  210. package/dist/{schema-DqxkW9Tx.d.cts → schema-B5BpplNK.d.ts} +3746 -575
  211. package/dist/schema-B5BpplNK.d.ts.map +1 -0
  212. package/dist/{schema-DkyWSqp_.cjs → schema-B_cMyyJJ.cjs} +130 -13
  213. package/dist/schema-B_cMyyJJ.cjs.map +1 -0
  214. package/dist/{schema-B8lT632E.cjs → schema-BpJVmev8.cjs} +51 -2
  215. package/dist/schema-BpJVmev8.cjs.map +1 -0
  216. package/dist/{schema-C-MLkWMc.d.ts → schema-Dt-HKnd_.d.cts} +3674 -503
  217. package/dist/schema-Dt-HKnd_.d.cts.map +1 -0
  218. package/dist/schema-DtsnsxMl.js +36 -0
  219. package/dist/schema-DtsnsxMl.js.map +1 -0
  220. package/dist/{schema-CewAKS9A.js → schema-WDk5Yqww.js} +83 -14
  221. package/dist/schema-WDk5Yqww.js.map +1 -0
  222. package/dist/schema.cjs +7 -1
  223. package/dist/schema.d.cts +16 -3
  224. package/dist/schema.d.cts.map +1 -1
  225. package/dist/schema.d.ts +16 -3
  226. package/dist/schema.d.ts.map +1 -1
  227. package/dist/schema.js +3 -2
  228. package/dist/search-docs-CrMdRDJy.js +102 -0
  229. package/dist/search-docs-CrMdRDJy.js.map +1 -0
  230. package/dist/search-docs-VhefTOOH.cjs +108 -0
  231. package/dist/search-docs-VhefTOOH.cjs.map +1 -0
  232. package/dist/seer-utils-Ckr8nYlz.js +87 -0
  233. package/dist/seer-utils-Ckr8nYlz.js.map +1 -0
  234. package/dist/seer-utils-CzYEEZb2.cjs +129 -0
  235. package/dist/seer-utils-CzYEEZb2.cjs.map +1 -0
  236. package/dist/server-CHG27fcn.cjs +243 -0
  237. package/dist/server-CHG27fcn.cjs.map +1 -0
  238. package/dist/server-DeuBftc5.js +237 -0
  239. package/dist/server-DeuBftc5.js.map +1 -0
  240. package/dist/server.cjs +40 -13
  241. package/dist/server.d.cts +22 -4
  242. package/dist/server.d.cts.map +1 -1
  243. package/dist/server.d.ts +22 -4
  244. package/dist/server.d.ts.map +1 -1
  245. package/dist/server.js +42 -15
  246. package/dist/stdio-BtVdTwx-.cjs +57 -0
  247. package/dist/stdio-BtVdTwx-.cjs.map +1 -0
  248. package/dist/stdio-DIuLW5EE.js +51 -0
  249. package/dist/stdio-DIuLW5EE.js.map +1 -0
  250. package/dist/test-setup.cjs +1763 -1410
  251. package/dist/test-setup.cjs.map +1 -1
  252. package/dist/test-setup.js +1581 -1201
  253. package/dist/test-setup.js.map +1 -1
  254. package/dist/toolDefinitions.d.ts +25 -2
  255. package/dist/toolDefinitions.js +1059 -4
  256. package/dist/tools/analyze-issue-with-seer.cjs +16 -0
  257. package/dist/tools/analyze-issue-with-seer.d.cts +16 -0
  258. package/dist/tools/analyze-issue-with-seer.d.cts.map +1 -0
  259. package/dist/tools/analyze-issue-with-seer.d.ts +16 -0
  260. package/dist/tools/analyze-issue-with-seer.d.ts.map +1 -0
  261. package/dist/tools/analyze-issue-with-seer.js +16 -0
  262. package/dist/tools/create-dsn.cjs +12 -0
  263. package/dist/tools/create-dsn.d.cts +15 -0
  264. package/dist/tools/create-dsn.d.cts.map +1 -0
  265. package/dist/tools/create-dsn.d.ts +15 -0
  266. package/dist/tools/create-dsn.d.ts.map +1 -0
  267. package/dist/tools/create-dsn.js +12 -0
  268. package/dist/tools/create-project.cjs +13 -0
  269. package/dist/tools/create-project.d.cts +16 -0
  270. package/dist/tools/create-project.d.cts.map +1 -0
  271. package/dist/tools/create-project.d.ts +16 -0
  272. package/dist/tools/create-project.d.ts.map +1 -0
  273. package/dist/tools/create-project.js +13 -0
  274. package/dist/tools/create-team.cjs +12 -0
  275. package/dist/tools/create-team.d.cts +14 -0
  276. package/dist/tools/create-team.d.cts.map +1 -0
  277. package/dist/tools/create-team.d.ts +14 -0
  278. package/dist/tools/create-team.d.ts.map +1 -0
  279. package/dist/tools/create-team.js +12 -0
  280. package/dist/tools/find-dsns.cjs +12 -0
  281. package/dist/tools/find-dsns.d.cts +14 -0
  282. package/dist/tools/find-dsns.d.cts.map +1 -0
  283. package/dist/tools/find-dsns.d.ts +14 -0
  284. package/dist/tools/find-dsns.d.ts.map +1 -0
  285. package/dist/tools/find-dsns.js +12 -0
  286. package/dist/tools/find-errors.cjs +12 -0
  287. package/dist/tools/find-errors.d.cts +18 -0
  288. package/dist/tools/find-errors.d.cts.map +1 -0
  289. package/dist/tools/find-errors.d.ts +18 -0
  290. package/dist/tools/find-errors.d.ts.map +1 -0
  291. package/dist/tools/find-errors.js +12 -0
  292. package/dist/tools/find-issues.cjs +12 -0
  293. package/dist/tools/find-issues.d.cts +16 -0
  294. package/dist/tools/find-issues.d.cts.map +1 -0
  295. package/dist/tools/find-issues.d.ts +16 -0
  296. package/dist/tools/find-issues.d.ts.map +1 -0
  297. package/dist/tools/find-issues.js +12 -0
  298. package/dist/tools/find-organizations.cjs +10 -0
  299. package/dist/tools/find-organizations.d.cts +9 -0
  300. package/dist/tools/find-organizations.d.cts.map +1 -0
  301. package/dist/tools/find-organizations.d.ts +9 -0
  302. package/dist/tools/find-organizations.d.ts.map +1 -0
  303. package/dist/tools/find-organizations.js +10 -0
  304. package/dist/tools/find-projects.cjs +12 -0
  305. package/dist/tools/find-projects.d.cts +13 -0
  306. package/dist/tools/find-projects.d.cts.map +1 -0
  307. package/dist/tools/find-projects.d.ts +13 -0
  308. package/dist/tools/find-projects.d.ts.map +1 -0
  309. package/dist/tools/find-projects.js +12 -0
  310. package/dist/tools/find-releases.cjs +12 -0
  311. package/dist/tools/find-releases.d.cts +15 -0
  312. package/dist/tools/find-releases.d.cts.map +1 -0
  313. package/dist/tools/find-releases.d.ts +15 -0
  314. package/dist/tools/find-releases.d.ts.map +1 -0
  315. package/dist/tools/find-releases.js +12 -0
  316. package/dist/tools/find-tags.cjs +12 -0
  317. package/dist/tools/find-tags.d.cts +13 -0
  318. package/dist/tools/find-tags.d.cts.map +1 -0
  319. package/dist/tools/find-tags.d.ts +13 -0
  320. package/dist/tools/find-tags.d.ts.map +1 -0
  321. package/dist/tools/find-tags.js +12 -0
  322. package/dist/tools/find-teams.cjs +12 -0
  323. package/dist/tools/find-teams.d.cts +13 -0
  324. package/dist/tools/find-teams.d.cts.map +1 -0
  325. package/dist/tools/find-teams.d.ts +13 -0
  326. package/dist/tools/find-teams.d.ts.map +1 -0
  327. package/dist/tools/find-teams.js +12 -0
  328. package/dist/tools/find-transactions.cjs +12 -0
  329. package/dist/tools/find-transactions.d.cts +17 -0
  330. package/dist/tools/find-transactions.d.cts.map +1 -0
  331. package/dist/tools/find-transactions.d.ts +17 -0
  332. package/dist/tools/find-transactions.d.ts.map +1 -0
  333. package/dist/tools/find-transactions.js +12 -0
  334. package/dist/tools/get-doc.cjs +11 -0
  335. package/dist/tools/get-doc.d.cts +12 -0
  336. package/dist/tools/get-doc.d.cts.map +1 -0
  337. package/dist/tools/get-doc.d.ts +12 -0
  338. package/dist/tools/get-doc.d.ts.map +1 -0
  339. package/dist/tools/get-doc.js +11 -0
  340. package/dist/tools/get-event-attachment.cjs +12 -0
  341. package/dist/tools/get-event-attachment.d.cts +16 -0
  342. package/dist/tools/get-event-attachment.d.cts.map +1 -0
  343. package/dist/tools/get-event-attachment.d.ts +16 -0
  344. package/dist/tools/get-event-attachment.d.ts.map +1 -0
  345. package/dist/tools/get-event-attachment.js +12 -0
  346. package/dist/tools/get-issue-details.cjs +15 -0
  347. package/dist/tools/get-issue-details.d.cts +16 -0
  348. package/dist/tools/get-issue-details.d.cts.map +1 -0
  349. package/dist/tools/get-issue-details.d.ts +16 -0
  350. package/dist/tools/get-issue-details.d.ts.map +1 -0
  351. package/dist/tools/get-issue-details.js +15 -0
  352. package/dist/tools/index.cjs +40 -0
  353. package/dist/tools/index.d.cts +127 -0
  354. package/dist/tools/index.d.cts.map +1 -0
  355. package/dist/tools/index.d.ts +127 -0
  356. package/dist/tools/index.d.ts.map +1 -0
  357. package/dist/tools/index.js +40 -0
  358. package/dist/tools/search-docs.cjs +12 -0
  359. package/dist/tools/search-docs.d.cts +14 -0
  360. package/dist/tools/search-docs.d.cts.map +1 -0
  361. package/dist/tools/search-docs.d.ts +14 -0
  362. package/dist/tools/search-docs.d.ts.map +1 -0
  363. package/dist/tools/search-docs.js +12 -0
  364. package/dist/tools/types.cjs +0 -0
  365. package/dist/tools/types.d.cts +4 -0
  366. package/dist/tools/types.d.ts +4 -0
  367. package/dist/tools/types.js +0 -0
  368. package/dist/tools/update-issue.cjs +16 -0
  369. package/dist/tools/update-issue.d.cts +17 -0
  370. package/dist/tools/update-issue.d.cts.map +1 -0
  371. package/dist/tools/update-issue.d.ts +17 -0
  372. package/dist/tools/update-issue.d.ts.map +1 -0
  373. package/dist/tools/update-issue.js +16 -0
  374. package/dist/tools/update-project.cjs +13 -0
  375. package/dist/tools/update-project.d.cts +18 -0
  376. package/dist/tools/update-project.d.cts.map +1 -0
  377. package/dist/tools/update-project.d.ts +18 -0
  378. package/dist/tools/update-project.d.ts.map +1 -0
  379. package/dist/tools/update-project.js +13 -0
  380. package/dist/tools/utils/api-utils.cjs +8 -0
  381. package/dist/tools/utils/api-utils.d.cts +24 -0
  382. package/dist/tools/utils/api-utils.d.cts.map +1 -0
  383. package/dist/tools/utils/api-utils.d.ts +24 -0
  384. package/dist/tools/utils/api-utils.d.ts.map +1 -0
  385. package/dist/tools/utils/api-utils.js +8 -0
  386. package/dist/tools/utils/defineTool.cjs +3 -0
  387. package/dist/tools/utils/defineTool.d.cts +12 -0
  388. package/dist/tools/utils/defineTool.d.cts.map +1 -0
  389. package/dist/tools/utils/defineTool.d.ts +12 -0
  390. package/dist/tools/utils/defineTool.d.ts.map +1 -0
  391. package/dist/tools/utils/defineTool.js +3 -0
  392. package/dist/tools/utils/fetch-utils.cjs +4 -0
  393. package/dist/tools/utils/fetch-utils.d.cts +2 -0
  394. package/dist/tools/utils/fetch-utils.d.ts +2 -0
  395. package/dist/tools/utils/fetch-utils.js +4 -0
  396. package/dist/tools/utils/formatting-utils.cjs +3 -0
  397. package/dist/tools/utils/formatting-utils.d.cts +15 -0
  398. package/dist/tools/utils/formatting-utils.d.cts.map +1 -0
  399. package/dist/tools/utils/formatting-utils.d.ts +15 -0
  400. package/dist/tools/utils/formatting-utils.d.ts.map +1 -0
  401. package/dist/tools/utils/formatting-utils.js +3 -0
  402. package/dist/tools/utils/issue-utils.cjs +6 -0
  403. package/dist/tools/utils/issue-utils.d.cts +7 -0
  404. package/dist/tools/utils/issue-utils.d.ts +7 -0
  405. package/dist/tools/utils/issue-utils.js +5 -0
  406. package/dist/tools/utils/seer-utils.cjs +9 -0
  407. package/dist/tools/utils/seer-utils.d.cts +28 -0
  408. package/dist/tools/utils/seer-utils.d.cts.map +1 -0
  409. package/dist/tools/utils/seer-utils.d.ts +28 -0
  410. package/dist/tools/utils/seer-utils.d.ts.map +1 -0
  411. package/dist/tools/utils/seer-utils.js +3 -0
  412. package/dist/tools/whoami.cjs +10 -0
  413. package/dist/tools/whoami.d.cts +9 -0
  414. package/dist/tools/whoami.d.cts.map +1 -0
  415. package/dist/tools/whoami.d.ts +9 -0
  416. package/dist/tools/whoami.d.ts.map +1 -0
  417. package/dist/tools/whoami.js +10 -0
  418. package/dist/tools-BiZ7ZDKf.cjs +53 -0
  419. package/dist/tools-BiZ7ZDKf.cjs.map +1 -0
  420. package/dist/tools-DGF9GhbP.js +48 -0
  421. package/dist/tools-DGF9GhbP.js.map +1 -0
  422. package/dist/transports/stdio.cjs +42 -14
  423. package/dist/transports/stdio.d.cts +25 -4
  424. package/dist/transports/stdio.d.cts.map +1 -1
  425. package/dist/transports/stdio.d.ts +25 -4
  426. package/dist/transports/stdio.d.ts.map +1 -1
  427. package/dist/transports/stdio.js +44 -16
  428. package/dist/types-B2qOfefC.d.ts +29 -0
  429. package/dist/types-B2qOfefC.d.ts.map +1 -0
  430. package/dist/{types-DuUmV9zh.d.ts → types-Br0saqtE.d.ts} +7 -3
  431. package/dist/types-Br0saqtE.d.ts.map +1 -0
  432. package/dist/{types-CcffrLXB.d.cts → types-C3pRFQyA.d.cts} +7 -3
  433. package/dist/types-C3pRFQyA.d.cts.map +1 -0
  434. package/dist/types-CCHsZshF.js +0 -0
  435. package/dist/types-CYjev2Ep.d.cts +29 -0
  436. package/dist/types-CYjev2Ep.d.cts.map +1 -0
  437. package/dist/types-CZaMk5Yg.d.cts +29 -0
  438. package/dist/types-CZaMk5Yg.d.cts.map +1 -0
  439. package/dist/types-D5KkaSjc.d.ts +29 -0
  440. package/dist/types-D5KkaSjc.d.ts.map +1 -0
  441. package/dist/types.d.cts +3 -4
  442. package/dist/types.d.ts +3 -4
  443. package/dist/update-issue-Bz-u_Yaa.cjs +115 -0
  444. package/dist/update-issue-Bz-u_Yaa.cjs.map +1 -0
  445. package/dist/update-issue-DN80uuKU.js +109 -0
  446. package/dist/update-issue-DN80uuKU.js.map +1 -0
  447. package/dist/update-project-5j-SOHWU.js +120 -0
  448. package/dist/update-project-5j-SOHWU.js.map +1 -0
  449. package/dist/update-project-C7Xbmhqg.cjs +126 -0
  450. package/dist/update-project-C7Xbmhqg.cjs.map +1 -0
  451. package/dist/version-DvMKCu-i.js +6 -0
  452. package/dist/version-DvMKCu-i.js.map +1 -0
  453. package/dist/{version-CRzAHHGZ.cjs → version-Dyz6_b54.cjs} +2 -2
  454. package/dist/version-Dyz6_b54.cjs.map +1 -0
  455. package/dist/version.cjs +1 -1
  456. package/dist/version.js +1 -1
  457. package/dist/whoami-qIbcECMA.cjs +28 -0
  458. package/dist/whoami-qIbcECMA.cjs.map +1 -0
  459. package/dist/whoami-raA70UBD.js +23 -0
  460. package/dist/whoami-raA70UBD.js.map +1 -0
  461. package/package.json +24 -14
  462. package/dist/api-client/client.test.cjs +0 -33
  463. package/dist/api-client/client.test.cjs.map +0 -1
  464. package/dist/api-client/client.test.d.ts +0 -1
  465. package/dist/api-client/client.test.js +0 -33
  466. package/dist/api-client/client.test.js.map +0 -1
  467. package/dist/chunk-BLXvPPr8.js +0 -30
  468. package/dist/client-Bxf4MxOz.d.cts +0 -179
  469. package/dist/client-Bxf4MxOz.d.cts.map +0 -1
  470. package/dist/client-D5xFZtxK.js +0 -224
  471. package/dist/client-D5xFZtxK.js.map +0 -1
  472. package/dist/client-DOhBiaMJ.d.ts +0 -179
  473. package/dist/client-DOhBiaMJ.d.ts.map +0 -1
  474. package/dist/client-GKHZSXgV.cjs +0 -235
  475. package/dist/client-GKHZSXgV.cjs.map +0 -1
  476. package/dist/dist-BlIWGSIM.cjs +0 -8197
  477. package/dist/dist-BlIWGSIM.cjs.map +0 -1
  478. package/dist/dist-DDpQABxe.js +0 -8054
  479. package/dist/dist-DDpQABxe.js.map +0 -1
  480. package/dist/errors.test.cjs +0 -24
  481. package/dist/errors.test.cjs.map +0 -1
  482. package/dist/errors.test.d.cts +0 -1
  483. package/dist/errors.test.d.ts +0 -1
  484. package/dist/errors.test.js +0 -24
  485. package/dist/errors.test.js.map +0 -1
  486. package/dist/formatting-BaARL2gT.js +0 -68
  487. package/dist/formatting-BaARL2gT.js.map +0 -1
  488. package/dist/formatting-C2kN0ok6.cjs +0 -86
  489. package/dist/formatting-C2kN0ok6.cjs.map +0 -1
  490. package/dist/index-h64gcVNJ.d.ts +0 -1
  491. package/dist/internal/formatting.d.cts.map +0 -1
  492. package/dist/internal/formatting.d.ts.map +0 -1
  493. package/dist/internal/issue-helpers.d.cts.map +0 -1
  494. package/dist/internal/issue-helpers.d.ts.map +0 -1
  495. package/dist/internal/issue-helpers.test.cjs +0 -110
  496. package/dist/internal/issue-helpers.test.cjs.map +0 -1
  497. package/dist/internal/issue-helpers.test.d.cts +0 -1
  498. package/dist/internal/issue-helpers.test.d.ts +0 -1
  499. package/dist/internal/issue-helpers.test.js +0 -110
  500. package/dist/internal/issue-helpers.test.js.map +0 -1
  501. package/dist/issue-helpers-71XgJVXC.cjs.map +0 -1
  502. package/dist/issue-helpers-CSNNO03f.js.map +0 -1
  503. package/dist/logging-ByvSjT6V.cjs.map +0 -1
  504. package/dist/logging-CXLD0FFB.js.map +0 -1
  505. package/dist/magic-string.es-CybcVAw7.cjs +0 -1016
  506. package/dist/magic-string.es-CybcVAw7.cjs.map +0 -1
  507. package/dist/magic-string.es-DY8GVHw9.js +0 -1015
  508. package/dist/magic-string.es-DY8GVHw9.js.map +0 -1
  509. package/dist/promptDefinitions-D3ll3qCd.cjs.map +0 -1
  510. package/dist/promptDefinitions-DMucOchd.d.cts.map +0 -1
  511. package/dist/promptDefinitions-H0q1_X-K.d.ts.map +0 -1
  512. package/dist/promptDefinitions-aKmUZWWO.js.map +0 -1
  513. package/dist/prompts-CzD0yl7Z.js.map +0 -1
  514. package/dist/prompts-DMwoay8l.cjs.map +0 -1
  515. package/dist/resources-D6TW2ER0.cjs +0 -32
  516. package/dist/resources-D6TW2ER0.cjs.map +0 -1
  517. package/dist/resources-x-GaokG8.js +0 -26
  518. package/dist/resources-x-GaokG8.js.map +0 -1
  519. package/dist/schema-B8lT632E.cjs.map +0 -1
  520. package/dist/schema-BkHf97d7.js +0 -17
  521. package/dist/schema-BkHf97d7.js.map +0 -1
  522. package/dist/schema-C-MLkWMc.d.ts.map +0 -1
  523. package/dist/schema-CewAKS9A.js.map +0 -1
  524. package/dist/schema-DkyWSqp_.cjs.map +0 -1
  525. package/dist/schema-DqxkW9Tx.d.cts.map +0 -1
  526. package/dist/server-pGtEIwE3.cjs +0 -148
  527. package/dist/server-pGtEIwE3.cjs.map +0 -1
  528. package/dist/server-qpWdf-ST.js +0 -142
  529. package/dist/server-qpWdf-ST.js.map +0 -1
  530. package/dist/stdio-D8u2W847.js +0 -19
  531. package/dist/stdio-D8u2W847.js.map +0 -1
  532. package/dist/stdio-DydB2Pxu.cjs +0 -25
  533. package/dist/stdio-DydB2Pxu.cjs.map +0 -1
  534. package/dist/toolDefinitions-BSC2D_S-.js +0 -430
  535. package/dist/toolDefinitions-BSC2D_S-.js.map +0 -1
  536. package/dist/toolDefinitions-BtHN8t_d.cjs +0 -436
  537. package/dist/toolDefinitions-BtHN8t_d.cjs.map +0 -1
  538. package/dist/toolDefinitions-Dp13BpEu.d.cts +0 -296
  539. package/dist/toolDefinitions-Dp13BpEu.d.cts.map +0 -1
  540. package/dist/toolDefinitions-fQrpWznJ.d.ts +0 -296
  541. package/dist/toolDefinitions-fQrpWznJ.d.ts.map +0 -1
  542. package/dist/toolDefinitions.cjs +0 -4
  543. package/dist/toolDefinitions.d.cts +0 -2
  544. package/dist/toolDefinitions.test.cjs +0 -15
  545. package/dist/toolDefinitions.test.cjs.map +0 -1
  546. package/dist/toolDefinitions.test.d.cts +0 -1
  547. package/dist/toolDefinitions.test.d.ts +0 -1
  548. package/dist/toolDefinitions.test.js +0 -15
  549. package/dist/toolDefinitions.test.js.map +0 -1
  550. package/dist/tools-4Rtn4WEf.js +0 -470
  551. package/dist/tools-4Rtn4WEf.js.map +0 -1
  552. package/dist/tools-DHHqAqP9.cjs +0 -476
  553. package/dist/tools-DHHqAqP9.cjs.map +0 -1
  554. package/dist/tools.cjs +0 -11
  555. package/dist/tools.d.cts +0 -251
  556. package/dist/tools.d.cts.map +0 -1
  557. package/dist/tools.d.ts +0 -251
  558. package/dist/tools.d.ts.map +0 -1
  559. package/dist/tools.js +0 -11
  560. package/dist/tools.test.cjs +0 -1018
  561. package/dist/tools.test.cjs.map +0 -1
  562. package/dist/tools.test.d.cts +0 -1
  563. package/dist/tools.test.d.ts +0 -1
  564. package/dist/tools.test.js +0 -1018
  565. package/dist/tools.test.js.map +0 -1
  566. package/dist/types-CbLyQvVe.d.cts +0 -38
  567. package/dist/types-CbLyQvVe.d.cts.map +0 -1
  568. package/dist/types-CcffrLXB.d.cts.map +0 -1
  569. package/dist/types-CfJ51LyL.d.ts +0 -38
  570. package/dist/types-CfJ51LyL.d.ts.map +0 -1
  571. package/dist/types-DuUmV9zh.d.ts.map +0 -1
  572. package/dist/version-BT9r_3jm.js +0 -6
  573. package/dist/version-BT9r_3jm.js.map +0 -1
  574. package/dist/version-CRzAHHGZ.cjs.map +0 -1
  575. package/dist/vi.bdSIJ99Y-BfJr7I2s.js +0 -6349
  576. package/dist/vi.bdSIJ99Y-BfJr7I2s.js.map +0 -1
  577. package/dist/vi.bdSIJ99Y-Dft_B_Ta.cjs +0 -6355
  578. package/dist/vi.bdSIJ99Y-Dft_B_Ta.cjs.map +0 -1
  579. /package/dist/{api-client-CNv_hbPO.js → api-client-ChL_0F2u.js} +0 -0
  580. /package/dist/{types-6zHoEWAx.js → fetch-utils-C0F4eH6S.cjs} +0 -0
  581. /package/dist/{api-client/client.test.d.cts → index-BrojxuhJ.d.ts} +0 -0
@@ -1,1016 +0,0 @@
1
-
2
- //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
3
- const comma = ",".charCodeAt(0);
4
- const semicolon = ";".charCodeAt(0);
5
- const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
6
- const intToChar = new Uint8Array(64);
7
- const charToInt = new Uint8Array(128);
8
- for (let i = 0; i < chars.length; i++) {
9
- const c = chars.charCodeAt(i);
10
- intToChar[i] = c;
11
- charToInt[c] = i;
12
- }
13
- function encodeInteger(builder, num, relative) {
14
- let delta = num - relative;
15
- delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
16
- do {
17
- let clamped = delta & 31;
18
- delta >>>= 5;
19
- if (delta > 0) clamped |= 32;
20
- builder.write(intToChar[clamped]);
21
- } while (delta > 0);
22
- return num;
23
- }
24
- const bufLength = 1024 * 16;
25
- const td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
26
- const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
27
- return out.toString();
28
- } } : { decode(buf) {
29
- let out = "";
30
- for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
31
- return out;
32
- } };
33
- var StringWriter = class {
34
- constructor() {
35
- this.pos = 0;
36
- this.out = "";
37
- this.buffer = new Uint8Array(bufLength);
38
- }
39
- write(v) {
40
- const { buffer } = this;
41
- buffer[this.pos++] = v;
42
- if (this.pos === bufLength) {
43
- this.out += td.decode(buffer);
44
- this.pos = 0;
45
- }
46
- }
47
- flush() {
48
- const { buffer, out, pos } = this;
49
- return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
50
- }
51
- };
52
- function encode(decoded) {
53
- const writer = new StringWriter();
54
- let sourcesIndex = 0;
55
- let sourceLine = 0;
56
- let sourceColumn = 0;
57
- let namesIndex = 0;
58
- for (let i = 0; i < decoded.length; i++) {
59
- const line = decoded[i];
60
- if (i > 0) writer.write(semicolon);
61
- if (line.length === 0) continue;
62
- let genColumn = 0;
63
- for (let j = 0; j < line.length; j++) {
64
- const segment = line[j];
65
- if (j > 0) writer.write(comma);
66
- genColumn = encodeInteger(writer, segment[0], genColumn);
67
- if (segment.length === 1) continue;
68
- sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
69
- sourceLine = encodeInteger(writer, segment[2], sourceLine);
70
- sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
71
- if (segment.length === 4) continue;
72
- namesIndex = encodeInteger(writer, segment[4], namesIndex);
73
- }
74
- }
75
- return writer.flush();
76
- }
77
-
78
- //#endregion
79
- //#region ../../node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.mjs
80
- var BitSet = class BitSet {
81
- constructor(arg) {
82
- this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
83
- }
84
- add(n$1) {
85
- this.bits[n$1 >> 5] |= 1 << (n$1 & 31);
86
- }
87
- has(n$1) {
88
- return !!(this.bits[n$1 >> 5] & 1 << (n$1 & 31));
89
- }
90
- };
91
- var Chunk = class Chunk {
92
- constructor(start, end, content) {
93
- this.start = start;
94
- this.end = end;
95
- this.original = content;
96
- this.intro = "";
97
- this.outro = "";
98
- this.content = content;
99
- this.storeName = false;
100
- this.edited = false;
101
- {
102
- this.previous = null;
103
- this.next = null;
104
- }
105
- }
106
- appendLeft(content) {
107
- this.outro += content;
108
- }
109
- appendRight(content) {
110
- this.intro = this.intro + content;
111
- }
112
- clone() {
113
- const chunk = new Chunk(this.start, this.end, this.original);
114
- chunk.intro = this.intro;
115
- chunk.outro = this.outro;
116
- chunk.content = this.content;
117
- chunk.storeName = this.storeName;
118
- chunk.edited = this.edited;
119
- return chunk;
120
- }
121
- contains(index) {
122
- return this.start < index && index < this.end;
123
- }
124
- eachNext(fn) {
125
- let chunk = this;
126
- while (chunk) {
127
- fn(chunk);
128
- chunk = chunk.next;
129
- }
130
- }
131
- eachPrevious(fn) {
132
- let chunk = this;
133
- while (chunk) {
134
- fn(chunk);
135
- chunk = chunk.previous;
136
- }
137
- }
138
- edit(content, storeName, contentOnly) {
139
- this.content = content;
140
- if (!contentOnly) {
141
- this.intro = "";
142
- this.outro = "";
143
- }
144
- this.storeName = storeName;
145
- this.edited = true;
146
- return this;
147
- }
148
- prependLeft(content) {
149
- this.outro = content + this.outro;
150
- }
151
- prependRight(content) {
152
- this.intro = content + this.intro;
153
- }
154
- reset() {
155
- this.intro = "";
156
- this.outro = "";
157
- if (this.edited) {
158
- this.content = this.original;
159
- this.storeName = false;
160
- this.edited = false;
161
- }
162
- }
163
- split(index) {
164
- const sliceIndex = index - this.start;
165
- const originalBefore = this.original.slice(0, sliceIndex);
166
- const originalAfter = this.original.slice(sliceIndex);
167
- this.original = originalBefore;
168
- const newChunk = new Chunk(index, this.end, originalAfter);
169
- newChunk.outro = this.outro;
170
- this.outro = "";
171
- this.end = index;
172
- if (this.edited) {
173
- newChunk.edit("", false);
174
- this.content = "";
175
- } else this.content = originalBefore;
176
- newChunk.next = this.next;
177
- if (newChunk.next) newChunk.next.previous = newChunk;
178
- newChunk.previous = this;
179
- this.next = newChunk;
180
- return newChunk;
181
- }
182
- toString() {
183
- return this.intro + this.content + this.outro;
184
- }
185
- trimEnd(rx) {
186
- this.outro = this.outro.replace(rx, "");
187
- if (this.outro.length) return true;
188
- const trimmed = this.content.replace(rx, "");
189
- if (trimmed.length) {
190
- if (trimmed !== this.content) {
191
- this.split(this.start + trimmed.length).edit("", void 0, true);
192
- if (this.edited) this.edit(trimmed, this.storeName, true);
193
- }
194
- return true;
195
- } else {
196
- this.edit("", void 0, true);
197
- this.intro = this.intro.replace(rx, "");
198
- if (this.intro.length) return true;
199
- }
200
- }
201
- trimStart(rx) {
202
- this.intro = this.intro.replace(rx, "");
203
- if (this.intro.length) return true;
204
- const trimmed = this.content.replace(rx, "");
205
- if (trimmed.length) {
206
- if (trimmed !== this.content) {
207
- const newChunk = this.split(this.end - trimmed.length);
208
- if (this.edited) newChunk.edit(trimmed, this.storeName, true);
209
- this.edit("", void 0, true);
210
- }
211
- return true;
212
- } else {
213
- this.edit("", void 0, true);
214
- this.outro = this.outro.replace(rx, "");
215
- if (this.outro.length) return true;
216
- }
217
- }
218
- };
219
- function getBtoa() {
220
- if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
221
- else if (typeof Buffer === "function") return (str) => Buffer.from(str, "utf-8").toString("base64");
222
- else return () => {
223
- throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
224
- };
225
- }
226
- const btoa = /* @__PURE__ */ getBtoa();
227
- var SourceMap = class {
228
- constructor(properties) {
229
- this.version = 3;
230
- this.file = properties.file;
231
- this.sources = properties.sources;
232
- this.sourcesContent = properties.sourcesContent;
233
- this.names = properties.names;
234
- this.mappings = encode(properties.mappings);
235
- if (typeof properties.x_google_ignoreList !== "undefined") this.x_google_ignoreList = properties.x_google_ignoreList;
236
- if (typeof properties.debugId !== "undefined") this.debugId = properties.debugId;
237
- }
238
- toString() {
239
- return JSON.stringify(this);
240
- }
241
- toUrl() {
242
- return "data:application/json;charset=utf-8;base64," + btoa(this.toString());
243
- }
244
- };
245
- function guessIndent(code) {
246
- const lines = code.split("\n");
247
- const tabbed = lines.filter((line) => /^\t+/.test(line));
248
- const spaced = lines.filter((line) => /^ {2,}/.test(line));
249
- if (tabbed.length === 0 && spaced.length === 0) return null;
250
- if (tabbed.length >= spaced.length) return " ";
251
- const min = spaced.reduce((previous, current) => {
252
- const numSpaces = /^ +/.exec(current)[0].length;
253
- return Math.min(numSpaces, previous);
254
- }, Infinity);
255
- return new Array(min + 1).join(" ");
256
- }
257
- function getRelativePath(from, to) {
258
- const fromParts = from.split(/[/\\]/);
259
- const toParts = to.split(/[/\\]/);
260
- fromParts.pop();
261
- while (fromParts[0] === toParts[0]) {
262
- fromParts.shift();
263
- toParts.shift();
264
- }
265
- if (fromParts.length) {
266
- let i = fromParts.length;
267
- while (i--) fromParts[i] = "..";
268
- }
269
- return fromParts.concat(toParts).join("/");
270
- }
271
- const toString = Object.prototype.toString;
272
- function isObject(thing) {
273
- return toString.call(thing) === "[object Object]";
274
- }
275
- function getLocator(source) {
276
- const originalLines = source.split("\n");
277
- const lineOffsets = [];
278
- for (let i = 0, pos = 0; i < originalLines.length; i++) {
279
- lineOffsets.push(pos);
280
- pos += originalLines[i].length + 1;
281
- }
282
- return function locate(index) {
283
- let i = 0;
284
- let j = lineOffsets.length;
285
- while (i < j) {
286
- const m = i + j >> 1;
287
- if (index < lineOffsets[m]) j = m;
288
- else i = m + 1;
289
- }
290
- const line = i - 1;
291
- const column = index - lineOffsets[line];
292
- return {
293
- line,
294
- column
295
- };
296
- };
297
- }
298
- const wordRegex = /\w/;
299
- var Mappings = class {
300
- constructor(hires) {
301
- this.hires = hires;
302
- this.generatedCodeLine = 0;
303
- this.generatedCodeColumn = 0;
304
- this.raw = [];
305
- this.rawSegments = this.raw[this.generatedCodeLine] = [];
306
- this.pending = null;
307
- }
308
- addEdit(sourceIndex, content, loc, nameIndex) {
309
- if (content.length) {
310
- const contentLengthMinusOne = content.length - 1;
311
- let contentLineEnd = content.indexOf("\n", 0);
312
- let previousContentLineEnd = -1;
313
- while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {
314
- const segment$1 = [
315
- this.generatedCodeColumn,
316
- sourceIndex,
317
- loc.line,
318
- loc.column
319
- ];
320
- if (nameIndex >= 0) segment$1.push(nameIndex);
321
- this.rawSegments.push(segment$1);
322
- this.generatedCodeLine += 1;
323
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
324
- this.generatedCodeColumn = 0;
325
- previousContentLineEnd = contentLineEnd;
326
- contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
327
- }
328
- const segment = [
329
- this.generatedCodeColumn,
330
- sourceIndex,
331
- loc.line,
332
- loc.column
333
- ];
334
- if (nameIndex >= 0) segment.push(nameIndex);
335
- this.rawSegments.push(segment);
336
- this.advance(content.slice(previousContentLineEnd + 1));
337
- } else if (this.pending) {
338
- this.rawSegments.push(this.pending);
339
- this.advance(content);
340
- }
341
- this.pending = null;
342
- }
343
- addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
344
- let originalCharIndex = chunk.start;
345
- let first = true;
346
- let charInHiresBoundary = false;
347
- while (originalCharIndex < chunk.end) {
348
- if (original[originalCharIndex] === "\n") {
349
- loc.line += 1;
350
- loc.column = 0;
351
- this.generatedCodeLine += 1;
352
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
353
- this.generatedCodeColumn = 0;
354
- first = true;
355
- charInHiresBoundary = false;
356
- } else {
357
- if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
358
- const segment = [
359
- this.generatedCodeColumn,
360
- sourceIndex,
361
- loc.line,
362
- loc.column
363
- ];
364
- if (this.hires === "boundary") if (wordRegex.test(original[originalCharIndex])) {
365
- if (!charInHiresBoundary) {
366
- this.rawSegments.push(segment);
367
- charInHiresBoundary = true;
368
- }
369
- } else {
370
- this.rawSegments.push(segment);
371
- charInHiresBoundary = false;
372
- }
373
- else this.rawSegments.push(segment);
374
- }
375
- loc.column += 1;
376
- this.generatedCodeColumn += 1;
377
- first = false;
378
- }
379
- originalCharIndex += 1;
380
- }
381
- this.pending = null;
382
- }
383
- advance(str) {
384
- if (!str) return;
385
- const lines = str.split("\n");
386
- if (lines.length > 1) {
387
- for (let i = 0; i < lines.length - 1; i++) {
388
- this.generatedCodeLine++;
389
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
390
- }
391
- this.generatedCodeColumn = 0;
392
- }
393
- this.generatedCodeColumn += lines[lines.length - 1].length;
394
- }
395
- };
396
- const n = "\n";
397
- const warned = {
398
- insertLeft: false,
399
- insertRight: false,
400
- storeName: false
401
- };
402
- var MagicString = class MagicString {
403
- constructor(string, options = {}) {
404
- const chunk = new Chunk(0, string.length, string);
405
- Object.defineProperties(this, {
406
- original: {
407
- writable: true,
408
- value: string
409
- },
410
- outro: {
411
- writable: true,
412
- value: ""
413
- },
414
- intro: {
415
- writable: true,
416
- value: ""
417
- },
418
- firstChunk: {
419
- writable: true,
420
- value: chunk
421
- },
422
- lastChunk: {
423
- writable: true,
424
- value: chunk
425
- },
426
- lastSearchedChunk: {
427
- writable: true,
428
- value: chunk
429
- },
430
- byStart: {
431
- writable: true,
432
- value: {}
433
- },
434
- byEnd: {
435
- writable: true,
436
- value: {}
437
- },
438
- filename: {
439
- writable: true,
440
- value: options.filename
441
- },
442
- indentExclusionRanges: {
443
- writable: true,
444
- value: options.indentExclusionRanges
445
- },
446
- sourcemapLocations: {
447
- writable: true,
448
- value: new BitSet()
449
- },
450
- storedNames: {
451
- writable: true,
452
- value: {}
453
- },
454
- indentStr: {
455
- writable: true,
456
- value: void 0
457
- },
458
- ignoreList: {
459
- writable: true,
460
- value: options.ignoreList
461
- },
462
- offset: {
463
- writable: true,
464
- value: options.offset || 0
465
- }
466
- });
467
- this.byStart[0] = chunk;
468
- this.byEnd[string.length] = chunk;
469
- }
470
- addSourcemapLocation(char) {
471
- this.sourcemapLocations.add(char);
472
- }
473
- append(content) {
474
- if (typeof content !== "string") throw new TypeError("outro content must be a string");
475
- this.outro += content;
476
- return this;
477
- }
478
- appendLeft(index, content) {
479
- index = index + this.offset;
480
- if (typeof content !== "string") throw new TypeError("inserted content must be a string");
481
- this._split(index);
482
- const chunk = this.byEnd[index];
483
- if (chunk) chunk.appendLeft(content);
484
- else this.intro += content;
485
- return this;
486
- }
487
- appendRight(index, content) {
488
- index = index + this.offset;
489
- if (typeof content !== "string") throw new TypeError("inserted content must be a string");
490
- this._split(index);
491
- const chunk = this.byStart[index];
492
- if (chunk) chunk.appendRight(content);
493
- else this.outro += content;
494
- return this;
495
- }
496
- clone() {
497
- const cloned = new MagicString(this.original, {
498
- filename: this.filename,
499
- offset: this.offset
500
- });
501
- let originalChunk = this.firstChunk;
502
- let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
503
- while (originalChunk) {
504
- cloned.byStart[clonedChunk.start] = clonedChunk;
505
- cloned.byEnd[clonedChunk.end] = clonedChunk;
506
- const nextOriginalChunk = originalChunk.next;
507
- const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
508
- if (nextClonedChunk) {
509
- clonedChunk.next = nextClonedChunk;
510
- nextClonedChunk.previous = clonedChunk;
511
- clonedChunk = nextClonedChunk;
512
- }
513
- originalChunk = nextOriginalChunk;
514
- }
515
- cloned.lastChunk = clonedChunk;
516
- if (this.indentExclusionRanges) cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
517
- cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
518
- cloned.intro = this.intro;
519
- cloned.outro = this.outro;
520
- return cloned;
521
- }
522
- generateDecodedMap(options) {
523
- options = options || {};
524
- const sourceIndex = 0;
525
- const names = Object.keys(this.storedNames);
526
- const mappings = new Mappings(options.hires);
527
- const locate = getLocator(this.original);
528
- if (this.intro) mappings.advance(this.intro);
529
- this.firstChunk.eachNext((chunk) => {
530
- const loc = locate(chunk.start);
531
- if (chunk.intro.length) mappings.advance(chunk.intro);
532
- if (chunk.edited) mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1);
533
- else mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
534
- if (chunk.outro.length) mappings.advance(chunk.outro);
535
- });
536
- return {
537
- file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
538
- sources: [options.source ? getRelativePath(options.file || "", options.source) : options.file || ""],
539
- sourcesContent: options.includeContent ? [this.original] : void 0,
540
- names,
541
- mappings: mappings.raw,
542
- x_google_ignoreList: this.ignoreList ? [sourceIndex] : void 0
543
- };
544
- }
545
- generateMap(options) {
546
- return new SourceMap(this.generateDecodedMap(options));
547
- }
548
- _ensureindentStr() {
549
- if (this.indentStr === void 0) this.indentStr = guessIndent(this.original);
550
- }
551
- _getRawIndentString() {
552
- this._ensureindentStr();
553
- return this.indentStr;
554
- }
555
- getIndentString() {
556
- this._ensureindentStr();
557
- return this.indentStr === null ? " " : this.indentStr;
558
- }
559
- indent(indentStr, options) {
560
- const pattern = /^[^\r\n]/gm;
561
- if (isObject(indentStr)) {
562
- options = indentStr;
563
- indentStr = void 0;
564
- }
565
- if (indentStr === void 0) {
566
- this._ensureindentStr();
567
- indentStr = this.indentStr || " ";
568
- }
569
- if (indentStr === "") return this;
570
- options = options || {};
571
- const isExcluded = {};
572
- if (options.exclude) {
573
- const exclusions = typeof options.exclude[0] === "number" ? [options.exclude] : options.exclude;
574
- exclusions.forEach((exclusion) => {
575
- for (let i = exclusion[0]; i < exclusion[1]; i += 1) isExcluded[i] = true;
576
- });
577
- }
578
- let shouldIndentNextCharacter = options.indentStart !== false;
579
- const replacer = (match) => {
580
- if (shouldIndentNextCharacter) return `${indentStr}${match}`;
581
- shouldIndentNextCharacter = true;
582
- return match;
583
- };
584
- this.intro = this.intro.replace(pattern, replacer);
585
- let charIndex = 0;
586
- let chunk = this.firstChunk;
587
- while (chunk) {
588
- const end = chunk.end;
589
- if (chunk.edited) {
590
- if (!isExcluded[charIndex]) {
591
- chunk.content = chunk.content.replace(pattern, replacer);
592
- if (chunk.content.length) shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === "\n";
593
- }
594
- } else {
595
- charIndex = chunk.start;
596
- while (charIndex < end) {
597
- if (!isExcluded[charIndex]) {
598
- const char = this.original[charIndex];
599
- if (char === "\n") shouldIndentNextCharacter = true;
600
- else if (char !== "\r" && shouldIndentNextCharacter) {
601
- shouldIndentNextCharacter = false;
602
- if (charIndex === chunk.start) chunk.prependRight(indentStr);
603
- else {
604
- this._splitChunk(chunk, charIndex);
605
- chunk = chunk.next;
606
- chunk.prependRight(indentStr);
607
- }
608
- }
609
- }
610
- charIndex += 1;
611
- }
612
- }
613
- charIndex = chunk.end;
614
- chunk = chunk.next;
615
- }
616
- this.outro = this.outro.replace(pattern, replacer);
617
- return this;
618
- }
619
- insert() {
620
- throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)");
621
- }
622
- insertLeft(index, content) {
623
- if (!warned.insertLeft) {
624
- console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead");
625
- warned.insertLeft = true;
626
- }
627
- return this.appendLeft(index, content);
628
- }
629
- insertRight(index, content) {
630
- if (!warned.insertRight) {
631
- console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead");
632
- warned.insertRight = true;
633
- }
634
- return this.prependRight(index, content);
635
- }
636
- move(start, end, index) {
637
- start = start + this.offset;
638
- end = end + this.offset;
639
- index = index + this.offset;
640
- if (index >= start && index <= end) throw new Error("Cannot move a selection inside itself");
641
- this._split(start);
642
- this._split(end);
643
- this._split(index);
644
- const first = this.byStart[start];
645
- const last = this.byEnd[end];
646
- const oldLeft = first.previous;
647
- const oldRight = last.next;
648
- const newRight = this.byStart[index];
649
- if (!newRight && last === this.lastChunk) return this;
650
- const newLeft = newRight ? newRight.previous : this.lastChunk;
651
- if (oldLeft) oldLeft.next = oldRight;
652
- if (oldRight) oldRight.previous = oldLeft;
653
- if (newLeft) newLeft.next = first;
654
- if (newRight) newRight.previous = last;
655
- if (!first.previous) this.firstChunk = last.next;
656
- if (!last.next) {
657
- this.lastChunk = first.previous;
658
- this.lastChunk.next = null;
659
- }
660
- first.previous = newLeft;
661
- last.next = newRight || null;
662
- if (!newLeft) this.firstChunk = first;
663
- if (!newRight) this.lastChunk = last;
664
- return this;
665
- }
666
- overwrite(start, end, content, options) {
667
- options = options || {};
668
- return this.update(start, end, content, {
669
- ...options,
670
- overwrite: !options.contentOnly
671
- });
672
- }
673
- update(start, end, content, options) {
674
- start = start + this.offset;
675
- end = end + this.offset;
676
- if (typeof content !== "string") throw new TypeError("replacement content must be a string");
677
- if (this.original.length !== 0) {
678
- while (start < 0) start += this.original.length;
679
- while (end < 0) end += this.original.length;
680
- }
681
- if (end > this.original.length) throw new Error("end is out of bounds");
682
- if (start === end) throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");
683
- this._split(start);
684
- this._split(end);
685
- if (options === true) {
686
- if (!warned.storeName) {
687
- console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string");
688
- warned.storeName = true;
689
- }
690
- options = { storeName: true };
691
- }
692
- const storeName = options !== void 0 ? options.storeName : false;
693
- const overwrite = options !== void 0 ? options.overwrite : false;
694
- if (storeName) {
695
- const original = this.original.slice(start, end);
696
- Object.defineProperty(this.storedNames, original, {
697
- writable: true,
698
- value: true,
699
- enumerable: true
700
- });
701
- }
702
- const first = this.byStart[start];
703
- const last = this.byEnd[end];
704
- if (first) {
705
- let chunk = first;
706
- while (chunk !== last) {
707
- if (chunk.next !== this.byStart[chunk.end]) throw new Error("Cannot overwrite across a split point");
708
- chunk = chunk.next;
709
- chunk.edit("", false);
710
- }
711
- first.edit(content, storeName, !overwrite);
712
- } else {
713
- const newChunk = new Chunk(start, end, "").edit(content, storeName);
714
- last.next = newChunk;
715
- newChunk.previous = last;
716
- }
717
- return this;
718
- }
719
- prepend(content) {
720
- if (typeof content !== "string") throw new TypeError("outro content must be a string");
721
- this.intro = content + this.intro;
722
- return this;
723
- }
724
- prependLeft(index, content) {
725
- index = index + this.offset;
726
- if (typeof content !== "string") throw new TypeError("inserted content must be a string");
727
- this._split(index);
728
- const chunk = this.byEnd[index];
729
- if (chunk) chunk.prependLeft(content);
730
- else this.intro = content + this.intro;
731
- return this;
732
- }
733
- prependRight(index, content) {
734
- index = index + this.offset;
735
- if (typeof content !== "string") throw new TypeError("inserted content must be a string");
736
- this._split(index);
737
- const chunk = this.byStart[index];
738
- if (chunk) chunk.prependRight(content);
739
- else this.outro = content + this.outro;
740
- return this;
741
- }
742
- remove(start, end) {
743
- start = start + this.offset;
744
- end = end + this.offset;
745
- if (this.original.length !== 0) {
746
- while (start < 0) start += this.original.length;
747
- while (end < 0) end += this.original.length;
748
- }
749
- if (start === end) return this;
750
- if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
751
- if (start > end) throw new Error("end must be greater than start");
752
- this._split(start);
753
- this._split(end);
754
- let chunk = this.byStart[start];
755
- while (chunk) {
756
- chunk.intro = "";
757
- chunk.outro = "";
758
- chunk.edit("");
759
- chunk = end > chunk.end ? this.byStart[chunk.end] : null;
760
- }
761
- return this;
762
- }
763
- reset(start, end) {
764
- start = start + this.offset;
765
- end = end + this.offset;
766
- if (this.original.length !== 0) {
767
- while (start < 0) start += this.original.length;
768
- while (end < 0) end += this.original.length;
769
- }
770
- if (start === end) return this;
771
- if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
772
- if (start > end) throw new Error("end must be greater than start");
773
- this._split(start);
774
- this._split(end);
775
- let chunk = this.byStart[start];
776
- while (chunk) {
777
- chunk.reset();
778
- chunk = end > chunk.end ? this.byStart[chunk.end] : null;
779
- }
780
- return this;
781
- }
782
- lastChar() {
783
- if (this.outro.length) return this.outro[this.outro.length - 1];
784
- let chunk = this.lastChunk;
785
- do {
786
- if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
787
- if (chunk.content.length) return chunk.content[chunk.content.length - 1];
788
- if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
789
- } while (chunk = chunk.previous);
790
- if (this.intro.length) return this.intro[this.intro.length - 1];
791
- return "";
792
- }
793
- lastLine() {
794
- let lineIndex = this.outro.lastIndexOf(n);
795
- if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
796
- let lineStr = this.outro;
797
- let chunk = this.lastChunk;
798
- do {
799
- if (chunk.outro.length > 0) {
800
- lineIndex = chunk.outro.lastIndexOf(n);
801
- if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
802
- lineStr = chunk.outro + lineStr;
803
- }
804
- if (chunk.content.length > 0) {
805
- lineIndex = chunk.content.lastIndexOf(n);
806
- if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
807
- lineStr = chunk.content + lineStr;
808
- }
809
- if (chunk.intro.length > 0) {
810
- lineIndex = chunk.intro.lastIndexOf(n);
811
- if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
812
- lineStr = chunk.intro + lineStr;
813
- }
814
- } while (chunk = chunk.previous);
815
- lineIndex = this.intro.lastIndexOf(n);
816
- if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
817
- return this.intro + lineStr;
818
- }
819
- slice(start = 0, end = this.original.length - this.offset) {
820
- start = start + this.offset;
821
- end = end + this.offset;
822
- if (this.original.length !== 0) {
823
- while (start < 0) start += this.original.length;
824
- while (end < 0) end += this.original.length;
825
- }
826
- let result = "";
827
- let chunk = this.firstChunk;
828
- while (chunk && (chunk.start > start || chunk.end <= start)) {
829
- if (chunk.start < end && chunk.end >= end) return result;
830
- chunk = chunk.next;
831
- }
832
- if (chunk && chunk.edited && chunk.start !== start) throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
833
- const startChunk = chunk;
834
- while (chunk) {
835
- if (chunk.intro && (startChunk !== chunk || chunk.start === start)) result += chunk.intro;
836
- const containsEnd = chunk.start < end && chunk.end >= end;
837
- if (containsEnd && chunk.edited && chunk.end !== end) throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
838
- const sliceStart = startChunk === chunk ? start - chunk.start : 0;
839
- const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
840
- result += chunk.content.slice(sliceStart, sliceEnd);
841
- if (chunk.outro && (!containsEnd || chunk.end === end)) result += chunk.outro;
842
- if (containsEnd) break;
843
- chunk = chunk.next;
844
- }
845
- return result;
846
- }
847
- snip(start, end) {
848
- const clone = this.clone();
849
- clone.remove(0, start);
850
- clone.remove(end, clone.original.length);
851
- return clone;
852
- }
853
- _split(index) {
854
- if (this.byStart[index] || this.byEnd[index]) return;
855
- let chunk = this.lastSearchedChunk;
856
- const searchForward = index > chunk.end;
857
- while (chunk) {
858
- if (chunk.contains(index)) return this._splitChunk(chunk, index);
859
- chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
860
- }
861
- }
862
- _splitChunk(chunk, index) {
863
- if (chunk.edited && chunk.content.length) {
864
- const loc = getLocator(this.original)(index);
865
- throw new Error(`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`);
866
- }
867
- const newChunk = chunk.split(index);
868
- this.byEnd[index] = chunk;
869
- this.byStart[index] = newChunk;
870
- this.byEnd[newChunk.end] = newChunk;
871
- if (chunk === this.lastChunk) this.lastChunk = newChunk;
872
- this.lastSearchedChunk = chunk;
873
- return true;
874
- }
875
- toString() {
876
- let str = this.intro;
877
- let chunk = this.firstChunk;
878
- while (chunk) {
879
- str += chunk.toString();
880
- chunk = chunk.next;
881
- }
882
- return str + this.outro;
883
- }
884
- isEmpty() {
885
- let chunk = this.firstChunk;
886
- do
887
- if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) return false;
888
- while (chunk = chunk.next);
889
- return true;
890
- }
891
- length() {
892
- let chunk = this.firstChunk;
893
- let length = 0;
894
- do
895
- length += chunk.intro.length + chunk.content.length + chunk.outro.length;
896
- while (chunk = chunk.next);
897
- return length;
898
- }
899
- trimLines() {
900
- return this.trim("[\\r\\n]");
901
- }
902
- trim(charType) {
903
- return this.trimStart(charType).trimEnd(charType);
904
- }
905
- trimEndAborted(charType) {
906
- const rx = new RegExp((charType || "\\s") + "+$");
907
- this.outro = this.outro.replace(rx, "");
908
- if (this.outro.length) return true;
909
- let chunk = this.lastChunk;
910
- do {
911
- const end = chunk.end;
912
- const aborted = chunk.trimEnd(rx);
913
- if (chunk.end !== end) {
914
- if (this.lastChunk === chunk) this.lastChunk = chunk.next;
915
- this.byEnd[chunk.end] = chunk;
916
- this.byStart[chunk.next.start] = chunk.next;
917
- this.byEnd[chunk.next.end] = chunk.next;
918
- }
919
- if (aborted) return true;
920
- chunk = chunk.previous;
921
- } while (chunk);
922
- return false;
923
- }
924
- trimEnd(charType) {
925
- this.trimEndAborted(charType);
926
- return this;
927
- }
928
- trimStartAborted(charType) {
929
- const rx = new RegExp("^" + (charType || "\\s") + "+");
930
- this.intro = this.intro.replace(rx, "");
931
- if (this.intro.length) return true;
932
- let chunk = this.firstChunk;
933
- do {
934
- const end = chunk.end;
935
- const aborted = chunk.trimStart(rx);
936
- if (chunk.end !== end) {
937
- if (chunk === this.lastChunk) this.lastChunk = chunk.next;
938
- this.byEnd[chunk.end] = chunk;
939
- this.byStart[chunk.next.start] = chunk.next;
940
- this.byEnd[chunk.next.end] = chunk.next;
941
- }
942
- if (aborted) return true;
943
- chunk = chunk.next;
944
- } while (chunk);
945
- return false;
946
- }
947
- trimStart(charType) {
948
- this.trimStartAborted(charType);
949
- return this;
950
- }
951
- hasChanged() {
952
- return this.original !== this.toString();
953
- }
954
- _replaceRegexp(searchValue, replacement) {
955
- function getReplacement(match, str) {
956
- if (typeof replacement === "string") return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
957
- if (i === "$") return "$";
958
- if (i === "&") return match[0];
959
- const num = +i;
960
- if (num < match.length) return match[+i];
961
- return `$${i}`;
962
- });
963
- else return replacement(...match, match.index, str, match.groups);
964
- }
965
- function matchAll(re, str) {
966
- let match;
967
- const matches = [];
968
- while (match = re.exec(str)) matches.push(match);
969
- return matches;
970
- }
971
- if (searchValue.global) {
972
- const matches = matchAll(searchValue, this.original);
973
- matches.forEach((match) => {
974
- if (match.index != null) {
975
- const replacement$1 = getReplacement(match, this.original);
976
- if (replacement$1 !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement$1);
977
- }
978
- });
979
- } else {
980
- const match = this.original.match(searchValue);
981
- if (match && match.index != null) {
982
- const replacement$1 = getReplacement(match, this.original);
983
- if (replacement$1 !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement$1);
984
- }
985
- }
986
- return this;
987
- }
988
- _replaceString(string, replacement) {
989
- const { original } = this;
990
- const index = original.indexOf(string);
991
- if (index !== -1) this.overwrite(index, index + string.length, replacement);
992
- return this;
993
- }
994
- replace(searchValue, replacement) {
995
- if (typeof searchValue === "string") return this._replaceString(searchValue, replacement);
996
- return this._replaceRegexp(searchValue, replacement);
997
- }
998
- _replaceAllString(string, replacement) {
999
- const { original } = this;
1000
- const stringLength = string.length;
1001
- for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
1002
- const previous = original.slice(index, index + stringLength);
1003
- if (previous !== replacement) this.overwrite(index, index + stringLength, replacement);
1004
- }
1005
- return this;
1006
- }
1007
- replaceAll(searchValue, replacement) {
1008
- if (typeof searchValue === "string") return this._replaceAllString(searchValue, replacement);
1009
- if (!searchValue.global) throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");
1010
- return this._replaceRegexp(searchValue, replacement);
1011
- }
1012
- };
1013
-
1014
- //#endregion
1015
- exports.default = MagicString;
1016
- //# sourceMappingURL=magic-string.es-CybcVAw7.cjs.map