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