aitu-app 0.5.38 → 0.5.39

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 (129) hide show
  1. package/README.md +3 -3
  2. package/assets/{ChatMessagesArea-BMm8OOb7.js → ChatMessagesArea-DBsSaQfM.js} +3 -3
  3. package/assets/{DialogTaskList-BeC_eC3Q.js → DialogTaskList-Fy2YnTcK.js} +1 -1
  4. package/assets/{Serializer-C6C_UTa3.js → Serializer-BBbyVbcD.js} +1 -1
  5. package/assets/{ToolboxDrawer-BkXaNTSp.css → ToolboxDrawer-BGGMfGy1.css} +1 -1
  6. package/assets/ToolboxDrawer-DrkR1kan.js +91 -0
  7. package/assets/{_baseUniq-CA_VnacE.js → _baseUniq-ItLLAPPG.js} +1 -1
  8. package/assets/{advancedFormat-CgdHkbgG.js → advancedFormat-Cyt8ycVj.js} +1 -1
  9. package/assets/{ai-analyze-DSX6F5NS.js → ai-analyze-hCO9RVDQ.js} +1 -1
  10. package/assets/{ai-image-generation-Bgg-NPV5.js → ai-image-generation-k6P0qCkq.js} +1 -1
  11. package/assets/{ai-video-generation-BZtpELZd.js → ai-video-generation-zbeqUVxV.js} +1 -1
  12. package/assets/{arc-DCdmisV5.js → arc-BqKX1pNT.js} +1 -1
  13. package/assets/{architectureDiagram-VXUJARFQ-j1lF3IAs.js → architectureDiagram-VXUJARFQ-oG-5UYdQ.js} +1 -1
  14. package/assets/batch-image-generation-Dq5gE6pJ.js +6 -0
  15. package/assets/{blockDiagram-38ab4fdb-D94FlpcQ.js → blockDiagram-38ab4fdb-B9R_268e.js} +1 -1
  16. package/assets/{blockDiagram-VD42YOAC-Dz279RDx.js → blockDiagram-VD42YOAC-Ffi9rZ54.js} +1 -1
  17. package/assets/{c4Diagram-3d4e48cf-Cuwj5AcN.js → c4Diagram-3d4e48cf-B420fEns.js} +1 -1
  18. package/assets/{c4Diagram-YG6GDRKO-BdiEazih.js → c4Diagram-YG6GDRKO-BYPf3pLk.js} +1 -1
  19. package/assets/channel-CDS_Qf4B.js +1 -0
  20. package/assets/{chunk-4BX2VUAB-CFG8OyNK.js → chunk-4BX2VUAB-ClMWk9EW.js} +1 -1
  21. package/assets/{chunk-55IACEB6-D1aH-ZMP.js → chunk-55IACEB6-DDJ68Z6q.js} +1 -1
  22. package/assets/{chunk-B4BG7PRW-DVmXK7L8.js → chunk-B4BG7PRW-ClXSfaDb.js} +1 -1
  23. package/assets/{chunk-DI55MBZ5-B2M5GZxd.js → chunk-DI55MBZ5-BfZfImW7.js} +1 -1
  24. package/assets/{chunk-FMBD7UC4-B3_Onr_4.js → chunk-FMBD7UC4-DA2q3AyT.js} +1 -1
  25. package/assets/{chunk-QN33PNHL-DONB7_eE.js → chunk-QN33PNHL-CY28Hdcd.js} +1 -1
  26. package/assets/{chunk-QZHKN3VN-DEJUnB0y.js → chunk-QZHKN3VN-B9bTwnHc.js} +1 -1
  27. package/assets/{chunk-TZMSLE5B-D32GOr1m.js → chunk-TZMSLE5B-BRq1BWUZ.js} +1 -1
  28. package/assets/classDiagram-2ON5EDUG-Dz5m-vOe.js +1 -0
  29. package/assets/{classDiagram-70f12bd4-C-77qri3.js → classDiagram-70f12bd4-DNzQyAPw.js} +1 -1
  30. package/assets/classDiagram-v2-WZHVMYZB-Dz5m-vOe.js +1 -0
  31. package/assets/{classDiagram-v2-f2320105-Doeud585.js → classDiagram-v2-f2320105-XTvONY-O.js} +1 -1
  32. package/assets/clone-B85cFPZq.js +1 -0
  33. package/assets/{cose-bilkent-S5V4N54A-rgneAX7r.js → cose-bilkent-S5V4N54A-wTQBClc3.js} +1 -1
  34. package/assets/{createText-2e5e7dd3-DyHEupOm.js → createText-2e5e7dd3-Cpz7ChtF.js} +1 -1
  35. package/assets/{cytoscape-cose-bilkent-C_45nI_A.js → cytoscape-cose-bilkent-BtkKO3EV.js} +1 -1
  36. package/assets/{dagre-6UL2VRFP-COJTh6dB.js → dagre-6UL2VRFP-CLAcQT8D.js} +1 -1
  37. package/assets/{diagram-PSM6KHXK-jzEFBmSt.js → diagram-PSM6KHXK-BGrxmpLC.js} +1 -1
  38. package/assets/{diagram-QEK2KX5R-DSuDRINJ.js → diagram-QEK2KX5R-C39Q2zPM.js} +1 -1
  39. package/assets/{diagram-S2PKOQOG-UTpttqtr.js → diagram-S2PKOQOG-CQsKcR2w.js} +1 -1
  40. package/assets/{edges-e0da2a9e-z3zQt4WY.js → edges-e0da2a9e-DyDxahje.js} +1 -1
  41. package/assets/{erDiagram-9861fffd-xU-c9SlN.js → erDiagram-9861fffd-C8pPIiys.js} +1 -1
  42. package/assets/{erDiagram-Q2GNP2WA-BSu5-_Gx.js → erDiagram-Q2GNP2WA-WsIShkjS.js} +1 -1
  43. package/assets/{flowDb-956e92f1-Ml41QXSf.js → flowDb-956e92f1-D7f_AaMZ.js} +1 -1
  44. package/assets/{flowDiagram-66a62f08-DuB8a1SN.js → flowDiagram-66a62f08-CEZu2OG2.js} +1 -1
  45. package/assets/{flowDiagram-NV44I4VS-B0BMQYH4.js → flowDiagram-NV44I4VS-DN9cNNDH.js} +1 -1
  46. package/assets/flowDiagram-v2-96b9c2cf-aHk-L0CX.js +1 -0
  47. package/assets/{flowchart-elk-definition-4a651766-B7QEXbde.js → flowchart-elk-definition-4a651766-Byz0W5JX.js} +1 -1
  48. package/assets/{ganttDiagram-JELNMOA3-ChpQbSUX.js → ganttDiagram-JELNMOA3-BEtoPRCT.js} +1 -1
  49. package/assets/{ganttDiagram-c361ad54-D7WOF9KS.js → ganttDiagram-c361ad54-D8cDKIDW.js} +1 -1
  50. package/assets/{gitGraphDiagram-72cf32ee-B3f3ICnl.js → gitGraphDiagram-72cf32ee-CeR12uHG.js} +1 -1
  51. package/assets/{gitGraphDiagram-NY62KEGX-CTAm0EFa.js → gitGraphDiagram-NY62KEGX-DEkOgNji.js} +1 -1
  52. package/assets/{graph-BF0dmYuW.js → graph-BuEKTPWn.js} +1 -1
  53. package/assets/{graph-jjijZ-3j.js → graph-DF6C7Pb4.js} +1 -1
  54. package/assets/{grid-image-DAG1e4vn.js → grid-image-S8DxjybO.js} +1 -1
  55. package/assets/{has-Bixk-Cbu.js → has-B9f4jyaz.js} +1 -1
  56. package/assets/{hasIn-CXC947zD.js → hasIn-CzYnYdke.js} +1 -1
  57. package/assets/{index-CtPFv75x.js → index--_4Ju5mY.js} +1 -1
  58. package/assets/{index-3862675e-9M7IDNaR.js → index-3862675e-B5v1keEn.js} +1 -1
  59. package/assets/{index-76E5fFh0.js → index-B5HQGfrF.js} +1 -1
  60. package/assets/{index-wnsAvwis.js → index-BALzTgAE.js} +1 -1
  61. package/assets/index-BXp-gQxZ.js +2081 -0
  62. package/assets/{index-DoPmTzyk.js → index-BfW_kMkx.js} +3 -3
  63. package/assets/{index-BKj-LLNy.js → index-BjOQVure.js} +1 -1
  64. package/assets/{index-DHOeeoQy.js → index-C43H8OQj.js} +1 -1
  65. package/assets/{index-DH-K1DNV.js → index-CljpoCtv.js} +28 -28
  66. package/assets/index-CwbXCuSp.css +9 -0
  67. package/assets/{index-7rN2RsMG.js → index-DsTb49bw.js} +1 -1
  68. package/assets/{index-B7B-0LEz.js → index-e40yW5SA.js} +10 -10
  69. package/assets/{infoDiagram-WHAUD3N6-Cd3oShoa.js → infoDiagram-WHAUD3N6-CkRZTQlJ.js} +1 -1
  70. package/assets/{infoDiagram-f8f76790-BuhNYS1l.js → infoDiagram-f8f76790-DnJUQA5f.js} +1 -1
  71. package/assets/{inspiration-board-DieycUiP.js → inspiration-board-BBS7Ggir.js} +1 -1
  72. package/assets/{isEmpty-CKblYN-m.js → isEmpty-Cb-sxNzj.js} +1 -1
  73. package/assets/{journeyDiagram-49397b02-BAEchNjb.js → journeyDiagram-49397b02-C15lY7d_.js} +1 -1
  74. package/assets/{journeyDiagram-XKPGCS4Q-DkdB80Ea.js → journeyDiagram-XKPGCS4Q-BrVPMh4M.js} +1 -1
  75. package/assets/{kanban-definition-3W4ZIXB7-bi38WFpV.js → kanban-definition-3W4ZIXB7-CiDmOTP0.js} +1 -1
  76. package/assets/{layout-DmM0CiGU.js → layout-DOUBEDJ0.js} +1 -1
  77. package/assets/{layout-BLWuewAI.js → layout-LlEK-Af9.js} +1 -1
  78. package/assets/{line-VBOTQp5C.js → line-5DqkKu5a.js} +1 -1
  79. package/assets/{linear-lLtQn6Xd.js → linear-nORGeaV4.js} +1 -1
  80. package/assets/{mermaid.core-DmzAedD2.js → mermaid.core-CeadxHhK.js} +4 -4
  81. package/assets/{min--FlqSAVj.js → min-BqFoyXNs.js} +1 -1
  82. package/assets/{mindmap-definition-VGOIOE7T-CEeEwzzp.js → mindmap-definition-VGOIOE7T-CAqwaVIW.js} +1 -1
  83. package/assets/{mindmap-definition-fc14e90a-CYQJc5ux.js → mindmap-definition-fc14e90a-D-DDHujP.js} +1 -1
  84. package/assets/{photo-wall-splitter-BHMcfCoZ.js → photo-wall-splitter-fKX9Yhjh.js} +1 -1
  85. package/assets/{pick-XvC-yO1P.js → pick-BGF0ULYb.js} +1 -1
  86. package/assets/{pie-5FeuuBAj.js → pie-C-K0-SKW.js} +1 -1
  87. package/assets/{pieDiagram-8a3498a8-BmdY6MyZ.js → pieDiagram-8a3498a8-COAeUCCn.js} +1 -1
  88. package/assets/{pieDiagram-ADFJNKIX-DB0bBPOZ.js → pieDiagram-ADFJNKIX-D5mQZmnj.js} +1 -1
  89. package/assets/{quadrantDiagram-120e2f19-BYVQNiRQ.js → quadrantDiagram-120e2f19-BVZGZWy5.js} +1 -1
  90. package/assets/{quadrantDiagram-AYHSOK5B-gyVAAoPe.js → quadrantDiagram-AYHSOK5B-DTN7IUf6.js} +1 -1
  91. package/assets/{requirementDiagram-UZGBJVZJ-DsO3Lcbq.js → requirementDiagram-UZGBJVZJ-B7uIb-QP.js} +1 -1
  92. package/assets/{requirementDiagram-deff3bca-CzM_FAok.js → requirementDiagram-deff3bca-3s56zRS3.js} +1 -1
  93. package/assets/{sankeyDiagram-04a897e0-BL_sV_wS.js → sankeyDiagram-04a897e0-NCf_QTUH.js} +1 -1
  94. package/assets/{sankeyDiagram-TZEHDZUN-BCbSzVUW.js → sankeyDiagram-TZEHDZUN-DN8QnN_i.js} +1 -1
  95. package/assets/{sequenceDiagram-704730f1-DHHxeFO0.js → sequenceDiagram-704730f1-DGwqPawx.js} +1 -1
  96. package/assets/{sequenceDiagram-WL72ISMW-DOQH08G9.js → sequenceDiagram-WL72ISMW-Chuzy8HN.js} +1 -1
  97. package/assets/{settings-dialog-DI_AkLWK.js → settings-dialog-FRnZQ5kM.js} +1 -1
  98. package/assets/{stateDiagram-587899a1-BQf0jjNC.js → stateDiagram-587899a1-DYbD44BX.js} +1 -1
  99. package/assets/{stateDiagram-FKZM4ZOC-0JCF81gW.js → stateDiagram-FKZM4ZOC-DYfvAmje.js} +1 -1
  100. package/assets/stateDiagram-v2-4FDKWEC3-BWDNmR_6.js +1 -0
  101. package/assets/{stateDiagram-v2-d93cdb3a-b035ekKu.js → stateDiagram-v2-d93cdb3a-BoJkxeLI.js} +1 -1
  102. package/assets/{styles-6aaf32cf-_LAnoj86.js → styles-6aaf32cf-DKg2ECnu.js} +1 -1
  103. package/assets/{styles-9a916d00-BTQ3FlVM.js → styles-9a916d00-D69GuT3h.js} +1 -1
  104. package/assets/{styles-c10674c1-CHEcqmZP.js → styles-c10674c1-C_CUHqzf.js} +1 -1
  105. package/assets/{svgDrawCommon-08f97a94-RzX-PsSJ.js → svgDrawCommon-08f97a94-BXpHAhFM.js} +1 -1
  106. package/assets/{timeline-definition-85554ec2-eDhlW6wM.js → timeline-definition-85554ec2-D30-0j4U.js} +1 -1
  107. package/assets/{timeline-definition-IT6M3QCI-lUXxDVLD.js → timeline-definition-IT6M3QCI-B4FEc43V.js} +1 -1
  108. package/assets/{treemap-KMMF4GRG-_xKFpSD8.js → treemap-KMMF4GRG-pDyLkft9.js} +1 -1
  109. package/assets/{ttd-dialog-CfT8gCSf.js → ttd-dialog-DeCpGM5R.js} +4 -4
  110. package/assets/{union-C6Iw9CBL.js → union-Dp_E3U6e.js} +1 -1
  111. package/assets/{upload-CjQJqhNI.js → upload-T9XlfBAZ.js} +1 -1
  112. package/assets/{video-recovery-service-D0I6m0s9.js → video-recovery-service-CBUtwYI8.js} +1 -1
  113. package/assets/{xychartDiagram-PRI3JC2R-BKYneYen.js → xychartDiagram-PRI3JC2R-m_qKGk-m.js} +1 -1
  114. package/assets/{xychartDiagram-e933f94c-DBA-_uiR.js → xychartDiagram-e933f94c-Bup4w7yN.js} +1 -1
  115. package/assets/{zipObject-B3Id2LQm.js → zipObject-nNXDWpiI.js} +1 -1
  116. package/package.json +1 -1
  117. package/precache-manifest.json +240 -240
  118. package/sw.js +7 -7
  119. package/version.json +11 -3
  120. package/assets/ToolboxDrawer-BbZSkfO0.js +0 -87
  121. package/assets/batch-image-generation-BBb6W6Lc.js +0 -6
  122. package/assets/channel--w4pWTKn.js +0 -1
  123. package/assets/classDiagram-2ON5EDUG-mEkvPFp-.js +0 -1
  124. package/assets/classDiagram-v2-WZHVMYZB-mEkvPFp-.js +0 -1
  125. package/assets/clone-C7rIei2X.js +0 -1
  126. package/assets/flowDiagram-v2-96b9c2cf-B0sUfV8D.js +0 -1
  127. package/assets/index-5b2FBrcK.css +0 -1
  128. package/assets/index-B4TbOAXp.js +0 -2164
  129. package/assets/stateDiagram-v2-4FDKWEC3-4wnQkdZJ.js +0 -1
@@ -1,3 +1,3 @@
1
- import{dA as Cn,cl as Tn,dB as Fn,dC as jt}from"./index-B4TbOAXp.js";import{t as Qt,e as Bn,b as rt,i as jn}from"./index-7rN2RsMG.js";import{d as Zn}from"./index.dom-C3-224fz.js";function Sn(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?it(n.position):"start"in n||"end"in n?it(n):"line"in n||"column"in n?Qn(n):""}function Qn(n){return ut(n&&n.line)+":"+ut(n&&n.column)}function it(n){return Qn(n&&n.start)+"-"+Qn(n&&n.end)}function ut(n){return n&&typeof n=="number"?n:1}class $ extends Error{constructor(e,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let u="",i={},l=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof e=="string"?u=e:!i.cause&&e&&(l=!0,u=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const p=r.indexOf(":");p===-1?i.ruleId=r:(i.source=r.slice(0,p),i.ruleId=r.slice(p+1))}if(!i.place&&i.ancestors&&i.ancestors){const p=i.ancestors[i.ancestors.length-1];p&&(i.place=p.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=a?a.line:void 0,this.name=Sn(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$.prototype.file="";$.prototype.name="";$.prototype.reason="";$.prototype.message="";$.prototype.stack="";$.prototype.column=void 0;$.prototype.line=void 0;$.prototype.ancestors=void 0;$.prototype.cause=void 0;$.prototype.fatal=void 0;$.prototype.place=void 0;$.prototype.ruleId=void 0;$.prototype.source=void 0;const tn={basename:Ut,dirname:Wt,extname:Yt,join:$t,sep:"/"};function Ut(n,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');En(n);let t=0,r=-1,u=n.length,i;if(e===void 0||e.length===0||e.length>n.length){for(;u--;)if(n.codePointAt(u)===47){if(i){t=u+1;break}}else r<0&&(i=!0,r=u+1);return r<0?"":n.slice(t,r)}if(e===n)return"";let l=-1,a=e.length-1;for(;u--;)if(n.codePointAt(u)===47){if(i){t=u+1;break}}else l<0&&(i=!0,l=u+1),a>-1&&(n.codePointAt(u)===e.codePointAt(a--)?a<0&&(r=u):(a=-1,r=l));return t===r?r=l:r<0&&(r=n.length),n.slice(t,r)}function Wt(n){if(En(n),n.length===0)return".";let e=-1,t=n.length,r;for(;--t;)if(n.codePointAt(t)===47){if(r){e=t;break}}else r||(r=!0);return e<0?n.codePointAt(0)===47?"/":".":e===1&&n.codePointAt(0)===47?"//":n.slice(0,e)}function Yt(n){En(n);let e=n.length,t=-1,r=0,u=-1,i=0,l;for(;e--;){const a=n.codePointAt(e);if(a===47){if(l){r=e+1;break}continue}t<0&&(l=!0,t=e+1),a===46?u<0?u=e:i!==1&&(i=1):u>-1&&(i=-1)}return u<0||t<0||i===0||i===1&&u===t-1&&u===r+1?"":n.slice(u,t)}function $t(...n){let e=-1,t;for(;++e<n.length;)En(n[e]),n[e]&&(t=t===void 0?n[e]:t+"/"+n[e]);return t===void 0?".":Zt(t)}function Zt(n){En(n);const e=n.codePointAt(0)===47;let t=Gt(n,!e);return t.length===0&&!e&&(t="."),t.length>0&&n.codePointAt(n.length-1)===47&&(t+="/"),e?"/"+t:t}function Gt(n,e){let t="",r=0,u=-1,i=0,l=-1,a,p;for(;++l<=n.length;){if(l<n.length)a=n.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(u===l-1||i===1))if(u!==l-1&&i===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(p=t.lastIndexOf("/"),p!==t.length-1){p<0?(t="",r=0):(t=t.slice(0,p),r=t.length-1-t.lastIndexOf("/")),u=l,i=0;continue}}else if(t.length>0){t="",r=0,u=l,i=0;continue}}e&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+n.slice(u+1,l):t=n.slice(u+1,l),r=l-u-1;u=l,i=0}else a===46&&i>-1?i++:i=-1}return t}function En(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const Jt={cwd:Kt};function Kt(){return"/"}function Un(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function Xt(n){if(typeof n=="string")n=new URL(n);else if(!Un(n)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(n.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return vt(n)}function vt(n){if(n.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=n.pathname;let t=-1;for(;++t<e.length;)if(e.codePointAt(t)===37&&e.codePointAt(t+1)===50){const r=e.codePointAt(t+2);if(r===70||r===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(e)}const Mn=["history","path","basename","stem","extname","dirname"];class ne{constructor(e){let t;e?Un(e)?t={path:e}:typeof e=="string"||te(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":Jt.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Mn.length;){const i=Mn[r];i in t&&t[i]!==void 0&&t[i]!==null&&(this[i]=i==="history"?[...t[i]]:t[i])}let u;for(u in t)Mn.includes(u)||(this[u]=t[u])}get basename(){return typeof this.path=="string"?tn.basename(this.path):void 0}set basename(e){Rn(e,"basename"),Nn(e,"basename"),this.path=tn.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?tn.dirname(this.path):void 0}set dirname(e){lt(this.basename,"dirname"),this.path=tn.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?tn.extname(this.path):void 0}set extname(e){if(Nn(e,"extname"),lt(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=tn.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Un(e)&&(e=Xt(e)),Rn(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?tn.basename(this.path,this.extname):void 0}set stem(e){Rn(e,"stem"),Nn(e,"stem"),this.path=tn.join(this.dirname||"",e+(this.extname||""))}fail(e,t,r){const u=this.message(e,t,r);throw u.fatal=!0,u}info(e,t,r){const u=this.message(e,t,r);return u.fatal=void 0,u}message(e,t,r){const u=new $(e,t,r);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Nn(n,e){if(n&&n.includes(tn.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+tn.sep+"`")}function Rn(n,e){if(!n)throw new Error("`"+e+"` cannot be empty")}function lt(n,e){if(!n)throw new Error("Setting `"+e+"` requires `path` to be set too")}function te(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const ee=(function(n){const r=this.constructor.prototype,u=r[n],i=function(){return u.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),re={}.hasOwnProperty;class Gn extends ee{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Qt()}copy(){const e=new Gn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];e.use(...r)}return e.data(Bn(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(On("data",this.frozen),this.namespace[e]=t,this):re.call(this.namespace,e)&&this.namespace[e]||void 0:e?(On("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const u=t.call(e,...r);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=An(e),r=this.parser||this.Parser;return Dn("parse",r),r(String(t),t)}process(e,t){const r=this;return this.freeze(),Dn("process",this.parser||this.Parser),Vn("process",this.compiler||this.Compiler),t?u(void 0,t):new Promise(u);function u(i,l){const a=An(e),p=r.parse(a);r.run(p,a,function(m,f,g){if(m||!f||!g)return s(m);const h=f,C=r.stringify(h,g);le(C)?g.value=C:g.result=C,s(m,g)});function s(m,f){m||!f?l(m):i?i(f):t(void 0,f)}}}processSync(e){let t=!1,r;return this.freeze(),Dn("processSync",this.parser||this.Parser),Vn("processSync",this.compiler||this.Compiler),this.process(e,u),st("processSync","process",t),r;function u(i,l){t=!0,rt(i),r=l}}run(e,t,r){at(e),this.freeze();const u=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?i(void 0,r):new Promise(i);function i(l,a){const p=An(t);u.run(e,p,s);function s(m,f,g){const h=f||e;m?a(m):l?l(h):r(void 0,h,g)}}}runSync(e,t){let r=!1,u;return this.run(e,t,i),st("runSync","run",r),u;function i(l,a){rt(l),u=a,r=!0}}stringify(e,t){this.freeze();const r=An(t),u=this.compiler||this.Compiler;return Vn("stringify",u),at(e),u(e,r)}use(e,...t){const r=this.attachers,u=this.namespace;if(On("use",this.frozen),e!=null)if(typeof e=="function")p(e,t);else if(typeof e=="object")Array.isArray(e)?a(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function i(s){if(typeof s=="function")p(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[m,...f]=s;p(m,f)}else l(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function l(s){if(!("plugins"in s)&&!("settings"in s))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(s.plugins),s.settings&&(u.settings=Bn(!0,u.settings,s.settings))}function a(s){let m=-1;if(s!=null)if(Array.isArray(s))for(;++m<s.length;){const f=s[m];i(f)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function p(s,m){let f=-1,g=-1;for(;++f<r.length;)if(r[f][0]===s){g=f;break}if(g===-1)r.push([s,...m]);else if(m.length>0){let[h,...C]=m;const F=r[g][1];jn(F)&&jn(h)&&(h=Bn(!0,F,h)),r[g]=[s,h,...C]}}}}const ie=new Gn().freeze();function Dn(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Vn(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function On(n,e){if(e)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function at(n){if(!jn(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function st(n,e,t){if(!t)throw new Error("`"+n+"` finished async. Use `"+e+"` instead")}function An(n){return ue(n)?n:new ne(n)}function ue(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function le(n){return typeof n=="string"||ae(n)}function ae(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const se={};function oe(n,e){const t=se,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,u=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return bt(n,r,u)}function bt(n,e,t){if(ce(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(e&&"alt"in n&&n.alt)return n.alt;if("children"in n)return ot(n.children,e,t)}return Array.isArray(n)?ot(n,e,t):""}function ot(n,e,t){const r=[];let u=-1;for(;++u<n.length;)r[u]=bt(n[u],e,t);return r.join("")}function ce(n){return!!(n&&typeof n=="object")}function rn(n,e,t,r){const u=n.length;let i=0,l;if(e<0?e=-e>u?0:u+e:e=e>u?u:e,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(e,t),n.splice(...l);else for(t&&n.splice(e,t);i<r.length;)l=r.slice(i,i+1e4),l.unshift(e,0),n.splice(...l),i+=1e4,e+=1e4}function G(n,e){return n.length>0?(rn(n,n.length,0,e),n):e}const ct={}.hasOwnProperty;function he(n){const e={};let t=-1;for(;++t<n.length;)fe(e,n[t]);return e}function fe(n,e){let t;for(t in e){const u=(ct.call(n,t)?n[t]:void 0)||(n[t]={}),i=e[t];let l;if(i)for(l in i){ct.call(u,l)||(u[l]=[]);const a=i[l];pe(u[l],Array.isArray(a)?a:a?[a]:[])}}}function pe(n,e){let t=-1;const r=[];for(;++t<e.length;)(e[t].add==="after"?n:r).push(e[t]);rn(n,0,0,r)}function wt(n,e){const t=Number.parseInt(n,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function xn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const en=hn(/[A-Za-z]/),nn=hn(/[\dA-Za-z]/),me=hn(/[#-'*+\--9=?A-Z^-~]/);function Wn(n){return n!==null&&(n<32||n===127)}const Yn=hn(/\d/),ge=hn(/[\dA-Fa-f]/),de=hn(/[!-/:-@[-`{-~]/);function I(n){return n!==null&&n<-2}function Y(n){return n!==null&&(n<0||n===32)}function P(n){return n===-2||n===-1||n===32}const xe=hn(new RegExp("\\p{P}|\\p{S}","u")),ke=hn(/\s/);function hn(n){return e;function e(t){return t!==null&&t>-1&&n.test(String.fromCharCode(t))}}function R(n,e,t,r){const u=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(p){return P(p)?(n.enter(t),a(p)):e(p)}function a(p){return P(p)&&i++<u?(n.consume(p),a):(n.exit(t),e(p))}}const ye={tokenize:be};function be(n){const e=n.attempt(this.parser.constructs.contentInitial,r,u);let t;return e;function r(a){if(a===null){n.consume(a);return}return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),R(n,e,"linePrefix")}function u(a){return n.enter("paragraph"),i(a)}function i(a){const p=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=p),t=p,l(a)}function l(a){if(a===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(a);return}return I(a)?(n.consume(a),n.exit("chunkText"),i):(n.consume(a),l)}}const we={tokenize:Se},ht={tokenize:Ie};function Se(n){const e=this,t=[];let r=0,u,i,l;return a;function a(b){if(r<t.length){const L=t[r];return e.containerState=L[1],n.attempt(L[0].continuation,p,s)(b)}return s(b)}function p(b){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,u&&D();const L=e.events.length;let B=L,x;for(;B--;)if(e.events[B][0]==="exit"&&e.events[B][1].type==="chunkFlow"){x=e.events[B][1].end;break}y(r);let A=L;for(;A<e.events.length;)e.events[A][1].end={...x},A++;return rn(e.events,B+1,0,e.events.slice(L)),e.events.length=A,s(b)}return a(b)}function s(b){if(r===t.length){if(!u)return g(b);if(u.currentConstruct&&u.currentConstruct.concrete)return C(b);e.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return e.containerState={},n.check(ht,m,f)(b)}function m(b){return u&&D(),y(r),g(b)}function f(b){return e.parser.lazy[e.now().line]=r!==t.length,l=e.now().offset,C(b)}function g(b){return e.containerState={},n.attempt(ht,h,C)(b)}function h(b){return r++,t.push([e.currentConstruct,e.containerState]),g(b)}function C(b){if(b===null){u&&D(),y(0),n.consume(b);return}return u=u||e.parser.flow(e.now()),n.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:i}),F(b)}function F(b){if(b===null){E(n.exit("chunkFlow"),!0),y(0),n.consume(b);return}return I(b)?(n.consume(b),E(n.exit("chunkFlow")),r=0,e.interrupt=void 0,a):(n.consume(b),F)}function E(b,L){const B=e.sliceStream(b);if(L&&B.push(null),b.previous=i,i&&(i.next=b),i=b,u.defineSkip(b.start),u.write(B),e.parser.lazy[b.start.line]){let x=u.events.length;for(;x--;)if(u.events[x][1].start.offset<l&&(!u.events[x][1].end||u.events[x][1].end.offset>l))return;const A=e.events.length;let q=A,M,V;for(;q--;)if(e.events[q][0]==="exit"&&e.events[q][1].type==="chunkFlow"){if(M){V=e.events[q][1].end;break}M=!0}for(y(r),x=A;x<e.events.length;)e.events[x][1].end={...V},x++;rn(e.events,q+1,0,e.events.slice(A)),e.events.length=x}}function y(b){let L=t.length;for(;L-- >b;){const B=t[L];e.containerState=B[1],B[0].exit.call(e,n)}t.length=b}function D(){u.write([null]),i=void 0,u=void 0,e.containerState._closeFlow=void 0}}function Ie(n,e,t){return R(n,n.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ft(n){if(n===null||Y(n)||ke(n))return 1;if(xe(n))return 2}function Jn(n,e,t){const r=[];let u=-1;for(;++u<n.length;){const i=n[u].resolveAll;i&&!r.includes(i)&&(e=i(e,t),r.push(i))}return e}const $n={name:"attention",resolveAll:Ee,tokenize:ze};function Ee(n,e){let t=-1,r,u,i,l,a,p,s,m;for(;++t<n.length;)if(n[t][0]==="enter"&&n[t][1].type==="attentionSequence"&&n[t][1]._close){for(r=t;r--;)if(n[r][0]==="exit"&&n[r][1].type==="attentionSequence"&&n[r][1]._open&&e.sliceSerialize(n[r][1]).charCodeAt(0)===e.sliceSerialize(n[t][1]).charCodeAt(0)){if((n[r][1]._close||n[t][1]._open)&&(n[t][1].end.offset-n[t][1].start.offset)%3&&!((n[r][1].end.offset-n[r][1].start.offset+n[t][1].end.offset-n[t][1].start.offset)%3))continue;p=n[r][1].end.offset-n[r][1].start.offset>1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;const f={...n[r][1].end},g={...n[t][1].start};pt(f,-p),pt(g,p),l={type:p>1?"strongSequence":"emphasisSequence",start:f,end:{...n[r][1].end}},a={type:p>1?"strongSequence":"emphasisSequence",start:{...n[t][1].start},end:g},i={type:p>1?"strongText":"emphasisText",start:{...n[r][1].end},end:{...n[t][1].start}},u={type:p>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},n[r][1].end={...l.start},n[t][1].start={...a.end},s=[],n[r][1].end.offset-n[r][1].start.offset&&(s=G(s,[["enter",n[r][1],e],["exit",n[r][1],e]])),s=G(s,[["enter",u,e],["enter",l,e],["exit",l,e],["enter",i,e]]),s=G(s,Jn(e.parser.constructs.insideSpan.null,n.slice(r+1,t),e)),s=G(s,[["exit",i,e],["enter",a,e],["exit",a,e],["exit",u,e]]),n[t][1].end.offset-n[t][1].start.offset?(m=2,s=G(s,[["enter",n[t][1],e],["exit",n[t][1],e]])):m=0,rn(n,r-1,t-r+3,s),t=r+s.length-m-2;break}}for(t=-1;++t<n.length;)n[t][1].type==="attentionSequence"&&(n[t][1].type="data");return n}function ze(n,e){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,u=ft(r);let i;return l;function l(p){return i=p,n.enter("attentionSequence"),a(p)}function a(p){if(p===i)return n.consume(p),a;const s=n.exit("attentionSequence"),m=ft(p),f=!m||m===2&&u||t.includes(p),g=!u||u===2&&m||t.includes(r);return s._open=!!(i===42?f:f&&(u||!g)),s._close=!!(i===42?g:g&&(m||!f)),e(p)}}function pt(n,e){n.column+=e,n.offset+=e,n._bufferIndex+=e}const Ce={name:"autolink",tokenize:Te};function Te(n,e,t){let r=0;return u;function u(h){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(h),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),i}function i(h){return en(h)?(n.consume(h),l):h===64?t(h):s(h)}function l(h){return h===43||h===45||h===46||nn(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(n.consume(h),r=0,p):(h===43||h===45||h===46||nn(h))&&r++<32?(n.consume(h),a):(r=0,s(h))}function p(h){return h===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(h),n.exit("autolinkMarker"),n.exit("autolink"),e):h===null||h===32||h===60||Wn(h)?t(h):(n.consume(h),p)}function s(h){return h===64?(n.consume(h),m):me(h)?(n.consume(h),s):t(h)}function m(h){return nn(h)?f(h):t(h)}function f(h){return h===46?(n.consume(h),r=0,m):h===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(h),n.exit("autolinkMarker"),n.exit("autolink"),e):g(h)}function g(h){if((h===45||nn(h))&&r++<63){const C=h===45?g:f;return n.consume(h),C}return t(h)}}const Pn={partial:!0,tokenize:Fe};function Fe(n,e,t){return r;function r(i){return P(i)?R(n,u,"linePrefix")(i):u(i)}function u(i){return i===null||I(i)?e(i):t(i)}}const St={continuation:{tokenize:_e},exit:Le,name:"blockQuote",tokenize:Ae};function Ae(n,e,t){const r=this;return u;function u(l){if(l===62){const a=r.containerState;return a.open||(n.enter("blockQuote",{_container:!0}),a.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(l),n.exit("blockQuoteMarker"),i}return t(l)}function i(l){return P(l)?(n.enter("blockQuotePrefixWhitespace"),n.consume(l),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),e):(n.exit("blockQuotePrefix"),e(l))}}function _e(n,e,t){const r=this;return u;function u(l){return P(l)?R(n,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return n.attempt(St,e,t)(l)}}function Le(n){n.exit("blockQuote")}const It={name:"characterEscape",tokenize:Pe};function Pe(n,e,t){return r;function r(i){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(i),n.exit("escapeMarker"),u}function u(i){return de(i)?(n.enter("characterEscapeValue"),n.consume(i),n.exit("characterEscapeValue"),n.exit("characterEscape"),e):t(i)}}const Et={name:"characterReference",tokenize:Be};function Be(n,e,t){const r=this;let u=0,i,l;return a;function a(f){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(f),n.exit("characterReferenceMarker"),p}function p(f){return f===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(f),n.exit("characterReferenceMarkerNumeric"),s):(n.enter("characterReferenceValue"),i=31,l=nn,m(f))}function s(f){return f===88||f===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(f),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),i=6,l=ge,m):(n.enter("characterReferenceValue"),i=7,l=Yn,m(f))}function m(f){if(f===59&&u){const g=n.exit("characterReferenceValue");return l===nn&&!Zn(r.sliceSerialize(g))?t(f):(n.enter("characterReferenceMarker"),n.consume(f),n.exit("characterReferenceMarker"),n.exit("characterReference"),e)}return l(f)&&u++<i?(n.consume(f),m):t(f)}}const mt={partial:!0,tokenize:Ne},gt={concrete:!0,name:"codeFenced",tokenize:Me};function Me(n,e,t){const r=this,u={partial:!0,tokenize:B};let i=0,l=0,a;return p;function p(x){return s(x)}function s(x){const A=r.events[r.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=x,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),m(x)}function m(x){return x===a?(l++,n.consume(x),m):l<3?t(x):(n.exit("codeFencedFenceSequence"),P(x)?R(n,f,"whitespace")(x):f(x))}function f(x){return x===null||I(x)?(n.exit("codeFencedFence"),r.interrupt?e(x):n.check(mt,F,L)(x)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||I(x)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),f(x)):P(x)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),R(n,h,"whitespace")(x)):x===96&&x===a?t(x):(n.consume(x),g)}function h(x){return x===null||I(x)?f(x):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),C(x))}function C(x){return x===null||I(x)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),f(x)):x===96&&x===a?t(x):(n.consume(x),C)}function F(x){return n.attempt(u,L,E)(x)}function E(x){return n.enter("lineEnding"),n.consume(x),n.exit("lineEnding"),y}function y(x){return i>0&&P(x)?R(n,D,"linePrefix",i+1)(x):D(x)}function D(x){return x===null||I(x)?n.check(mt,F,L)(x):(n.enter("codeFlowValue"),b(x))}function b(x){return x===null||I(x)?(n.exit("codeFlowValue"),D(x)):(n.consume(x),b)}function L(x){return n.exit("codeFenced"),e(x)}function B(x,A,q){let M=0;return V;function V(_){return x.enter("lineEnding"),x.consume(_),x.exit("lineEnding"),S}function S(_){return x.enter("codeFencedFence"),P(_)?R(x,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):w(_)}function w(_){return _===a?(x.enter("codeFencedFenceSequence"),O(_)):q(_)}function O(_){return _===a?(M++,x.consume(_),O):M>=l?(x.exit("codeFencedFenceSequence"),P(_)?R(x,H,"whitespace")(_):H(_)):q(_)}function H(_){return _===null||I(_)?(x.exit("codeFencedFence"),A(_)):q(_)}}}function Ne(n,e,t){const r=this;return u;function u(l){return l===null?t(l):(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?t(l):e(l)}}const qn={name:"codeIndented",tokenize:De},Re={partial:!0,tokenize:Ve};function De(n,e,t){const r=this;return u;function u(s){return n.enter("codeIndented"),R(n,i,"linePrefix",5)(s)}function i(s){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(s):t(s)}function l(s){return s===null?p(s):I(s)?n.attempt(Re,l,p)(s):(n.enter("codeFlowValue"),a(s))}function a(s){return s===null||I(s)?(n.exit("codeFlowValue"),l(s)):(n.consume(s),a)}function p(s){return n.exit("codeIndented"),e(s)}}function Ve(n,e,t){const r=this;return u;function u(l){return r.parser.lazy[r.now().line]?t(l):I(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),u):R(n,i,"linePrefix",5)(l)}function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(l):I(l)?u(l):t(l)}}const Oe={name:"codeText",previous:He,resolve:qe,tokenize:je};function qe(n){let e=n.length-4,t=3,r,u;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[e][1].type==="lineEnding"||n[e][1].type==="space")){for(r=t;++r<e;)if(n[r][1].type==="codeTextData"){n[t][1].type="codeTextPadding",n[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(r=t-1,e++;++r<=e;)u===void 0?r!==e&&n[r][1].type!=="lineEnding"&&(u=r):(r===e||n[r][1].type==="lineEnding")&&(n[u][1].type="codeTextData",r!==u+2&&(n[u][1].end=n[r-1][1].end,n.splice(u+2,r-u-2),e-=r-u-2,r=u+2),u=void 0);return n}function He(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function je(n,e,t){let r=0,u,i;return l;function l(f){return n.enter("codeText"),n.enter("codeTextSequence"),a(f)}function a(f){return f===96?(n.consume(f),r++,a):(n.exit("codeTextSequence"),p(f))}function p(f){return f===null?t(f):f===32?(n.enter("space"),n.consume(f),n.exit("space"),p):f===96?(i=n.enter("codeTextSequence"),u=0,m(f)):I(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),p):(n.enter("codeTextData"),s(f))}function s(f){return f===null||f===32||f===96||I(f)?(n.exit("codeTextData"),p(f)):(n.consume(f),s)}function m(f){return f===96?(n.consume(f),u++,m):u===r?(n.exit("codeTextSequence"),n.exit("codeText"),e(f)):(i.type="codeTextData",s(f))}}class Qe{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){const u=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&wn(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),wn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),wn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);wn(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);wn(this.left,t.reverse())}}}function wn(n,e){let t=0;if(e.length<1e4)n.push(...e);else for(;t<e.length;)n.push(...e.slice(t,t+1e4)),t+=1e4}function zt(n){const e={};let t=-1,r,u,i,l,a,p,s;const m=new Qe(n);for(;++t<m.length;){for(;t in e;)t=e[t];if(r=m.get(t),t&&r[1].type==="chunkFlow"&&m.get(t-1)[1].type==="listItemPrefix"&&(p=r[1]._tokenizer.events,i=0,i<p.length&&p[i][1].type==="lineEndingBlank"&&(i+=2),i<p.length&&p[i][1].type==="content"))for(;++i<p.length&&p[i][1].type!=="content";)p[i][1].type==="chunkText"&&(p[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,Ue(m,t)),t=e[t],s=!0);else if(r[1]._container){for(i=t,u=void 0;i--;)if(l=m.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(u&&(m.get(u)[1].type="lineEndingBlank"),l[1].type="lineEnding",u=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;u&&(r[1].end={...m.get(u)[1].start},a=m.slice(u,t),a.unshift(r),m.splice(u,t-u+1,a))}}return rn(n,0,Number.POSITIVE_INFINITY,m.slice(0)),!s}function Ue(n,e){const t=n.get(e)[1],r=n.get(e)[2];let u=e-1;const i=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,p=[],s={};let m,f,g=-1,h=t,C=0,F=0;const E=[F];for(;h;){for(;n.get(++u)[1]!==h;);i.push(u),h._tokenizer||(m=r.sliceStream(h),h.next||m.push(null),f&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=t;++g<a.length;)a[g][0]==="exit"&&a[g-1][0]==="enter"&&a[g][1].type===a[g-1][1].type&&a[g][1].start.line!==a[g][1].end.line&&(F=g+1,E.push(F),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):E.pop(),g=E.length;g--;){const y=a.slice(E[g],E[g+1]),D=i.pop();p.push([D,D+y.length-1]),n.splice(D,2,y)}for(p.reverse(),g=-1;++g<p.length;)s[C+p[g][0]]=C+p[g][1],C+=p[g][1]-p[g][0]-1;return s}const We={resolve:$e,tokenize:Ze},Ye={partial:!0,tokenize:Ge};function $e(n){return zt(n),n}function Ze(n,e){let t;return r;function r(a){return n.enter("content"),t=n.enter("chunkContent",{contentType:"content"}),u(a)}function u(a){return a===null?i(a):I(a)?n.check(Ye,l,i)(a):(n.consume(a),u)}function i(a){return n.exit("chunkContent"),n.exit("content"),e(a)}function l(a){return n.consume(a),n.exit("chunkContent"),t.next=n.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,u}}function Ge(n,e,t){const r=this;return u;function u(l){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),R(n,i,"linePrefix")}function i(l){if(l===null||I(l))return t(l);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(l):n.interrupt(r.parser.constructs.flow,t,e)(l)}}function Ct(n,e,t,r,u,i,l,a,p){const s=p||Number.POSITIVE_INFINITY;let m=0;return f;function f(y){return y===60?(n.enter(r),n.enter(u),n.enter(i),n.consume(y),n.exit(i),g):y===null||y===32||y===41||Wn(y)?t(y):(n.enter(r),n.enter(l),n.enter(a),n.enter("chunkString",{contentType:"string"}),F(y))}function g(y){return y===62?(n.enter(i),n.consume(y),n.exit(i),n.exit(u),n.exit(r),e):(n.enter(a),n.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(n.exit("chunkString"),n.exit(a),g(y)):y===null||y===60||I(y)?t(y):(n.consume(y),y===92?C:h)}function C(y){return y===60||y===62||y===92?(n.consume(y),h):h(y)}function F(y){return!m&&(y===null||y===41||Y(y))?(n.exit("chunkString"),n.exit(a),n.exit(l),n.exit(r),e(y)):m<s&&y===40?(n.consume(y),m++,F):y===41?(n.consume(y),m--,F):y===null||y===32||y===40||Wn(y)?t(y):(n.consume(y),y===92?E:F)}function E(y){return y===40||y===41||y===92?(n.consume(y),F):F(y)}}function Tt(n,e,t,r,u,i){const l=this;let a=0,p;return s;function s(h){return n.enter(r),n.enter(u),n.consume(h),n.exit(u),n.enter(i),m}function m(h){return a>999||h===null||h===91||h===93&&!p||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(n.exit(i),n.enter(u),n.consume(h),n.exit(u),n.exit(r),e):I(h)?(n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),m):(n.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||I(h)||a++>999?(n.exit("chunkString"),m(h)):(n.consume(h),p||(p=!P(h)),h===92?g:f)}function g(h){return h===91||h===92||h===93?(n.consume(h),a++,f):f(h)}}function Ft(n,e,t,r,u,i){let l;return a;function a(g){return g===34||g===39||g===40?(n.enter(r),n.enter(u),n.consume(g),n.exit(u),l=g===40?41:g,p):t(g)}function p(g){return g===l?(n.enter(u),n.consume(g),n.exit(u),n.exit(r),e):(n.enter(i),s(g))}function s(g){return g===l?(n.exit(i),p(l)):g===null?t(g):I(g)?(n.enter("lineEnding"),n.consume(g),n.exit("lineEnding"),R(n,s,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===l||g===null||I(g)?(n.exit("chunkString"),s(g)):(n.consume(g),g===92?f:m)}function f(g){return g===l||g===92?(n.consume(g),m):m(g)}}function In(n,e){let t;return r;function r(u){return I(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),t=!0,r):P(u)?R(n,r,t?"linePrefix":"lineSuffix")(u):e(u)}}const Je={name:"definition",tokenize:Xe},Ke={partial:!0,tokenize:ve};function Xe(n,e,t){const r=this;let u;return i;function i(h){return n.enter("definition"),l(h)}function l(h){return Tt.call(r,n,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return u=xn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(n.enter("definitionMarker"),n.consume(h),n.exit("definitionMarker"),p):t(h)}function p(h){return Y(h)?In(n,s)(h):s(h)}function s(h){return Ct(n,m,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function m(h){return n.attempt(Ke,f,f)(h)}function f(h){return P(h)?R(n,g,"whitespace")(h):g(h)}function g(h){return h===null||I(h)?(n.exit("definition"),r.parser.defined.push(u),e(h)):t(h)}}function ve(n,e,t){return r;function r(a){return Y(a)?In(n,u)(a):t(a)}function u(a){return Ft(n,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return P(a)?R(n,l,"whitespace")(a):l(a)}function l(a){return a===null||I(a)?e(a):t(a)}}const nr={name:"hardBreakEscape",tokenize:tr};function tr(n,e,t){return r;function r(i){return n.enter("hardBreakEscape"),n.consume(i),u}function u(i){return I(i)?(n.exit("hardBreakEscape"),e(i)):t(i)}}const er={name:"headingAtx",resolve:rr,tokenize:ir};function rr(n,e){let t=n.length-2,r=3,u,i;return n[r][1].type==="whitespace"&&(r+=2),t-2>r&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&n[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(u={type:"atxHeadingText",start:n[r][1].start,end:n[t][1].end},i={type:"chunkText",start:n[r][1].start,end:n[t][1].end,contentType:"text"},rn(n,r,t-r+1,[["enter",u,e],["enter",i,e],["exit",i,e],["exit",u,e]])),n}function ir(n,e,t){let r=0;return u;function u(m){return n.enter("atxHeading"),i(m)}function i(m){return n.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(n.consume(m),l):m===null||Y(m)?(n.exit("atxHeadingSequence"),a(m)):t(m)}function a(m){return m===35?(n.enter("atxHeadingSequence"),p(m)):m===null||I(m)?(n.exit("atxHeading"),e(m)):P(m)?R(n,a,"whitespace")(m):(n.enter("atxHeadingText"),s(m))}function p(m){return m===35?(n.consume(m),p):(n.exit("atxHeadingSequence"),a(m))}function s(m){return m===null||m===35||Y(m)?(n.exit("atxHeadingText"),a(m)):(n.consume(m),s)}}const ur=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],dt=["pre","script","style","textarea"],lr={concrete:!0,name:"htmlFlow",resolveTo:or,tokenize:cr},ar={partial:!0,tokenize:fr},sr={partial:!0,tokenize:hr};function or(n){let e=n.length;for(;e--&&!(n[e][0]==="enter"&&n[e][1].type==="htmlFlow"););return e>1&&n[e-2][1].type==="linePrefix"&&(n[e][1].start=n[e-2][1].start,n[e+1][1].start=n[e-2][1].start,n.splice(e-2,2)),n}function cr(n,e,t){const r=this;let u,i,l,a,p;return s;function s(c){return m(c)}function m(c){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(c),f}function f(c){return c===33?(n.consume(c),g):c===47?(n.consume(c),i=!0,F):c===63?(n.consume(c),u=3,r.interrupt?e:o):en(c)?(n.consume(c),l=String.fromCharCode(c),E):t(c)}function g(c){return c===45?(n.consume(c),u=2,h):c===91?(n.consume(c),u=5,a=0,C):en(c)?(n.consume(c),u=4,r.interrupt?e:o):t(c)}function h(c){return c===45?(n.consume(c),r.interrupt?e:o):t(c)}function C(c){const X="CDATA[";return c===X.charCodeAt(a++)?(n.consume(c),a===X.length?r.interrupt?e:w:C):t(c)}function F(c){return en(c)?(n.consume(c),l=String.fromCharCode(c),E):t(c)}function E(c){if(c===null||c===47||c===62||Y(c)){const X=c===47,fn=l.toLowerCase();return!X&&!i&&dt.includes(fn)?(u=1,r.interrupt?e(c):w(c)):ur.includes(l.toLowerCase())?(u=6,X?(n.consume(c),y):r.interrupt?e(c):w(c)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(c):i?D(c):b(c))}return c===45||nn(c)?(n.consume(c),l+=String.fromCharCode(c),E):t(c)}function y(c){return c===62?(n.consume(c),r.interrupt?e:w):t(c)}function D(c){return P(c)?(n.consume(c),D):V(c)}function b(c){return c===47?(n.consume(c),V):c===58||c===95||en(c)?(n.consume(c),L):P(c)?(n.consume(c),b):V(c)}function L(c){return c===45||c===46||c===58||c===95||nn(c)?(n.consume(c),L):B(c)}function B(c){return c===61?(n.consume(c),x):P(c)?(n.consume(c),B):b(c)}function x(c){return c===null||c===60||c===61||c===62||c===96?t(c):c===34||c===39?(n.consume(c),p=c,A):P(c)?(n.consume(c),x):q(c)}function A(c){return c===p?(n.consume(c),p=null,M):c===null||I(c)?t(c):(n.consume(c),A)}function q(c){return c===null||c===34||c===39||c===47||c===60||c===61||c===62||c===96||Y(c)?B(c):(n.consume(c),q)}function M(c){return c===47||c===62||P(c)?b(c):t(c)}function V(c){return c===62?(n.consume(c),S):t(c)}function S(c){return c===null||I(c)?w(c):P(c)?(n.consume(c),S):t(c)}function w(c){return c===45&&u===2?(n.consume(c),U):c===60&&u===1?(n.consume(c),j):c===62&&u===4?(n.consume(c),K):c===63&&u===3?(n.consume(c),o):c===93&&u===5?(n.consume(c),un):I(c)&&(u===6||u===7)?(n.exit("htmlFlowData"),n.check(ar,ln,O)(c)):c===null||I(c)?(n.exit("htmlFlowData"),O(c)):(n.consume(c),w)}function O(c){return n.check(sr,H,ln)(c)}function H(c){return n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),_}function _(c){return c===null||I(c)?O(c):(n.enter("htmlFlowData"),w(c))}function U(c){return c===45?(n.consume(c),o):w(c)}function j(c){return c===47?(n.consume(c),l="",J):w(c)}function J(c){if(c===62){const X=l.toLowerCase();return dt.includes(X)?(n.consume(c),K):w(c)}return en(c)&&l.length<8?(n.consume(c),l+=String.fromCharCode(c),J):w(c)}function un(c){return c===93?(n.consume(c),o):w(c)}function o(c){return c===62?(n.consume(c),K):c===45&&u===2?(n.consume(c),o):w(c)}function K(c){return c===null||I(c)?(n.exit("htmlFlowData"),ln(c)):(n.consume(c),K)}function ln(c){return n.exit("htmlFlow"),e(c)}}function hr(n,e,t){const r=this;return u;function u(l){return I(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),i):t(l)}function i(l){return r.parser.lazy[r.now().line]?t(l):e(l)}}function fr(n,e,t){return r;function r(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),n.attempt(Pn,e,t)}}const pr={name:"htmlText",tokenize:mr};function mr(n,e,t){const r=this;let u,i,l;return a;function a(o){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(o),p}function p(o){return o===33?(n.consume(o),s):o===47?(n.consume(o),B):o===63?(n.consume(o),b):en(o)?(n.consume(o),q):t(o)}function s(o){return o===45?(n.consume(o),m):o===91?(n.consume(o),i=0,C):en(o)?(n.consume(o),D):t(o)}function m(o){return o===45?(n.consume(o),h):t(o)}function f(o){return o===null?t(o):o===45?(n.consume(o),g):I(o)?(l=f,j(o)):(n.consume(o),f)}function g(o){return o===45?(n.consume(o),h):f(o)}function h(o){return o===62?U(o):o===45?g(o):f(o)}function C(o){const K="CDATA[";return o===K.charCodeAt(i++)?(n.consume(o),i===K.length?F:C):t(o)}function F(o){return o===null?t(o):o===93?(n.consume(o),E):I(o)?(l=F,j(o)):(n.consume(o),F)}function E(o){return o===93?(n.consume(o),y):F(o)}function y(o){return o===62?U(o):o===93?(n.consume(o),y):F(o)}function D(o){return o===null||o===62?U(o):I(o)?(l=D,j(o)):(n.consume(o),D)}function b(o){return o===null?t(o):o===63?(n.consume(o),L):I(o)?(l=b,j(o)):(n.consume(o),b)}function L(o){return o===62?U(o):b(o)}function B(o){return en(o)?(n.consume(o),x):t(o)}function x(o){return o===45||nn(o)?(n.consume(o),x):A(o)}function A(o){return I(o)?(l=A,j(o)):P(o)?(n.consume(o),A):U(o)}function q(o){return o===45||nn(o)?(n.consume(o),q):o===47||o===62||Y(o)?M(o):t(o)}function M(o){return o===47?(n.consume(o),U):o===58||o===95||en(o)?(n.consume(o),V):I(o)?(l=M,j(o)):P(o)?(n.consume(o),M):U(o)}function V(o){return o===45||o===46||o===58||o===95||nn(o)?(n.consume(o),V):S(o)}function S(o){return o===61?(n.consume(o),w):I(o)?(l=S,j(o)):P(o)?(n.consume(o),S):M(o)}function w(o){return o===null||o===60||o===61||o===62||o===96?t(o):o===34||o===39?(n.consume(o),u=o,O):I(o)?(l=w,j(o)):P(o)?(n.consume(o),w):(n.consume(o),H)}function O(o){return o===u?(n.consume(o),u=void 0,_):o===null?t(o):I(o)?(l=O,j(o)):(n.consume(o),O)}function H(o){return o===null||o===34||o===39||o===60||o===61||o===96?t(o):o===47||o===62||Y(o)?M(o):(n.consume(o),H)}function _(o){return o===47||o===62||Y(o)?M(o):t(o)}function U(o){return o===62?(n.consume(o),n.exit("htmlTextData"),n.exit("htmlText"),e):t(o)}function j(o){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),J}function J(o){return P(o)?R(n,un,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):un(o)}function un(o){return n.enter("htmlTextData"),l(o)}}const Kn={name:"labelEnd",resolveAll:kr,resolveTo:yr,tokenize:br},gr={tokenize:wr},dr={tokenize:Sr},xr={tokenize:Ir};function kr(n){let e=-1;const t=[];for(;++e<n.length;){const r=n[e][1];if(t.push(n[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const u=r.type==="labelImage"?4:2;r.type="data",e+=u}}return n.length!==t.length&&rn(n,0,n.length,t),n}function yr(n,e){let t=n.length,r=0,u,i,l,a;for(;t--;)if(u=n[t][1],i){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;n[t][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(l){if(n[t][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(i=t,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(l=t);const p={type:n[i][1].type==="labelLink"?"link":"image",start:{...n[i][1].start},end:{...n[n.length-1][1].end}},s={type:"label",start:{...n[i][1].start},end:{...n[l][1].end}},m={type:"labelText",start:{...n[i+r+2][1].end},end:{...n[l-2][1].start}};return a=[["enter",p,e],["enter",s,e]],a=G(a,n.slice(i+1,i+r+3)),a=G(a,[["enter",m,e]]),a=G(a,Jn(e.parser.constructs.insideSpan.null,n.slice(i+r+4,l-3),e)),a=G(a,[["exit",m,e],n[l-2],n[l-1],["exit",s,e]]),a=G(a,n.slice(l+1)),a=G(a,[["exit",p,e]]),rn(n,i,n.length,a),n}function br(n,e,t){const r=this;let u=r.events.length,i,l;for(;u--;)if((r.events[u][1].type==="labelImage"||r.events[u][1].type==="labelLink")&&!r.events[u][1]._balanced){i=r.events[u][1];break}return a;function a(g){return i?i._inactive?f(g):(l=r.parser.defined.includes(xn(r.sliceSerialize({start:i.end,end:r.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(g),n.exit("labelMarker"),n.exit("labelEnd"),p):t(g)}function p(g){return g===40?n.attempt(gr,m,l?m:f)(g):g===91?n.attempt(dr,m,l?s:f)(g):l?m(g):f(g)}function s(g){return n.attempt(xr,m,f)(g)}function m(g){return e(g)}function f(g){return i._balanced=!0,t(g)}}function wr(n,e,t){return r;function r(f){return n.enter("resource"),n.enter("resourceMarker"),n.consume(f),n.exit("resourceMarker"),u}function u(f){return Y(f)?In(n,i)(f):i(f)}function i(f){return f===41?m(f):Ct(n,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function l(f){return Y(f)?In(n,p)(f):m(f)}function a(f){return t(f)}function p(f){return f===34||f===39||f===40?Ft(n,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):m(f)}function s(f){return Y(f)?In(n,m)(f):m(f)}function m(f){return f===41?(n.enter("resourceMarker"),n.consume(f),n.exit("resourceMarker"),n.exit("resource"),e):t(f)}}function Sr(n,e,t){const r=this;return u;function u(a){return Tt.call(r,n,i,l,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(xn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(a):t(a)}function l(a){return t(a)}}function Ir(n,e,t){return r;function r(i){return n.enter("reference"),n.enter("referenceMarker"),n.consume(i),n.exit("referenceMarker"),u}function u(i){return i===93?(n.enter("referenceMarker"),n.consume(i),n.exit("referenceMarker"),n.exit("reference"),e):t(i)}}const Er={name:"labelStartImage",resolveAll:Kn.resolveAll,tokenize:zr};function zr(n,e,t){const r=this;return u;function u(a){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(a),n.exit("labelImageMarker"),i}function i(a){return a===91?(n.enter("labelMarker"),n.consume(a),n.exit("labelMarker"),n.exit("labelImage"),l):t(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):e(a)}}const Cr={name:"labelStartLink",resolveAll:Kn.resolveAll,tokenize:Tr};function Tr(n,e,t){const r=this;return u;function u(l){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(l),n.exit("labelMarker"),n.exit("labelLink"),i}function i(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):e(l)}}const Hn={name:"lineEnding",tokenize:Fr};function Fr(n,e){return t;function t(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),R(n,e,"linePrefix")}}const Ln={name:"thematicBreak",tokenize:Ar};function Ar(n,e,t){let r=0,u;return i;function i(s){return n.enter("thematicBreak"),l(s)}function l(s){return u=s,a(s)}function a(s){return s===u?(n.enter("thematicBreakSequence"),p(s)):r>=3&&(s===null||I(s))?(n.exit("thematicBreak"),e(s)):t(s)}function p(s){return s===u?(n.consume(s),r++,p):(n.exit("thematicBreakSequence"),P(s)?R(n,a,"whitespace")(s):a(s))}}const W={continuation:{tokenize:Br},exit:Nr,name:"list",tokenize:Pr},_r={partial:!0,tokenize:Rr},Lr={partial:!0,tokenize:Mr};function Pr(n,e,t){const r=this,u=r.events[r.events.length-1];let i=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,l=0;return a;function a(h){const C=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Yn(h)){if(r.containerState.type||(r.containerState.type=C,n.enter(C,{_container:!0})),C==="listUnordered")return n.enter("listItemPrefix"),h===42||h===45?n.check(Ln,t,s)(h):s(h);if(!r.interrupt||h===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(h)}return t(h)}function p(h){return Yn(h)&&++l<10?(n.consume(h),p):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(n.exit("listItemValue"),s(h)):t(h)}function s(h){return n.enter("listItemMarker"),n.consume(h),n.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,n.check(Pn,r.interrupt?t:m,n.attempt(_r,g,f))}function m(h){return r.containerState.initialBlankLine=!0,i++,g(h)}function f(h){return P(h)?(n.enter("listItemPrefixWhitespace"),n.consume(h),n.exit("listItemPrefixWhitespace"),g):t(h)}function g(h){return r.containerState.size=i+r.sliceSerialize(n.exit("listItemPrefix"),!0).length,e(h)}}function Br(n,e,t){const r=this;return r.containerState._closeFlow=void 0,n.check(Pn,u,i);function u(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,R(n,e,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!P(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,n.attempt(Lr,e,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,R(n,n.attempt(W,e,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Mr(n,e,t){const r=this;return R(n,u,"listItemIndent",r.containerState.size+1);function u(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?e(i):t(i)}}function Nr(n){n.exit(this.containerState.type)}function Rr(n,e,t){const r=this;return R(n,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(i){const l=r.events[r.events.length-1];return!P(i)&&l&&l[1].type==="listItemPrefixWhitespace"?e(i):t(i)}}const xt={name:"setextUnderline",resolveTo:Dr,tokenize:Vr};function Dr(n,e){let t=n.length,r,u,i;for(;t--;)if(n[t][0]==="enter"){if(n[t][1].type==="content"){r=t;break}n[t][1].type==="paragraph"&&(u=t)}else n[t][1].type==="content"&&n.splice(t,1),!i&&n[t][1].type==="definition"&&(i=t);const l={type:"setextHeading",start:{...n[r][1].start},end:{...n[n.length-1][1].end}};return n[u][1].type="setextHeadingText",i?(n.splice(u,0,["enter",l,e]),n.splice(i+1,0,["exit",n[r][1],e]),n[r][1].end={...n[i][1].end}):n[r][1]=l,n.push(["exit",l,e]),n}function Vr(n,e,t){const r=this;let u;return i;function i(s){let m=r.events.length,f;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){f=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(n.enter("setextHeadingLine"),u=s,l(s)):t(s)}function l(s){return n.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===u?(n.consume(s),a):(n.exit("setextHeadingLineSequence"),P(s)?R(n,p,"lineSuffix")(s):p(s))}function p(s){return s===null||I(s)?(n.exit("setextHeadingLine"),e(s)):t(s)}}const Or={tokenize:qr};function qr(n){const e=this,t=n.attempt(Pn,r,n.attempt(this.parser.constructs.flowInitial,u,R(n,n.attempt(this.parser.constructs.flow,u,n.attempt(We,u)),"linePrefix")));return t;function r(i){if(i===null){n.consume(i);return}return n.enter("lineEndingBlank"),n.consume(i),n.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function u(i){if(i===null){n.consume(i);return}return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),e.currentConstruct=void 0,t}}const Hr={resolveAll:_t()},jr=At("string"),Qr=At("text");function At(n){return{resolveAll:_t(n==="text"?Ur:void 0),tokenize:e};function e(t){const r=this,u=this.parser.constructs[n],i=t.attempt(u,l,a);return l;function l(m){return s(m)?i(m):a(m)}function a(m){if(m===null){t.consume(m);return}return t.enter("data"),t.consume(m),p}function p(m){return s(m)?(t.exit("data"),i(m)):(t.consume(m),p)}function s(m){if(m===null)return!0;const f=u[m];let g=-1;if(f)for(;++g<f.length;){const h=f[g];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function _t(n){return e;function e(t,r){let u=-1,i;for(;++u<=t.length;)i===void 0?t[u]&&t[u][1].type==="data"&&(i=u,u++):(!t[u]||t[u][1].type!=="data")&&(u!==i+2&&(t[i][1].end=t[u-1][1].end,t.splice(i+2,u-i-2),u=i+2),i=void 0);return n?n(t,r):t}}function Ur(n,e){let t=0;for(;++t<=n.length;)if((t===n.length||n[t][1].type==="lineEnding")&&n[t-1][1].type==="data"){const r=n[t-1][1],u=e.sliceStream(r);let i=u.length,l=-1,a=0,p;for(;i--;){const s=u[i];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)p=!0,a++;else if(s!==-1){i++;break}}if(e._contentTypeTextTrailing&&t===n.length&&(a=0),a){const s={type:t===n.length||p||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(n.splice(t,0,["enter",s,e],["exit",s,e]),t+=2)}t++}return n}const Wr={42:W,43:W,45:W,48:W,49:W,50:W,51:W,52:W,53:W,54:W,55:W,56:W,57:W,62:St},Yr={91:Je},$r={[-2]:qn,[-1]:qn,32:qn},Zr={35:er,42:Ln,45:[xt,Ln],60:lr,61:xt,95:Ln,96:gt,126:gt},Gr={38:Et,92:It},Jr={[-5]:Hn,[-4]:Hn,[-3]:Hn,33:Er,38:Et,42:$n,60:[Ce,pr],91:Cr,92:[nr,It],93:Kn,95:$n,96:Oe},Kr={null:[$n,Hr]},Xr={null:[42,95]},vr={null:[]},ni=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Xr,contentInitial:Yr,disable:vr,document:Wr,flow:Zr,flowInitial:$r,insideSpan:Kr,string:Gr,text:Jr},Symbol.toStringTag,{value:"Module"}));function ti(n,e,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const u={},i=[];let l=[],a=[];const p={attempt:A(B),check:A(x),consume:D,enter:b,exit:L,interrupt:A(x,{interrupt:!0})},s={code:null,containerState:{},defineSkip:F,events:[],now:C,parser:n,previous:null,sliceSerialize:g,sliceStream:h,write:f};let m=e.tokenize.call(s,p);return e.resolveAll&&i.push(e),s;function f(S){return l=G(l,S),E(),l[l.length-1]!==null?[]:(q(e,0),s.events=Jn(i,s.events,s),s.events)}function g(S,w){return ri(h(S),w)}function h(S){return ei(l,S)}function C(){const{_bufferIndex:S,_index:w,line:O,column:H,offset:_}=r;return{_bufferIndex:S,_index:w,line:O,column:H,offset:_}}function F(S){u[S.line]=S.column,V()}function E(){let S;for(;r._index<l.length;){const w=l[r._index];if(typeof w=="string")for(S=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===S&&r._bufferIndex<w.length;)y(w.charCodeAt(r._bufferIndex));else y(w)}}function y(S){m=m(S)}function D(S){I(S)?(r.line++,r.column=1,r.offset+=S===-3?2:1,V()):S!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=S}function b(S,w){const O=w||{};return O.type=S,O.start=C(),s.events.push(["enter",O,s]),a.push(O),O}function L(S){const w=a.pop();return w.end=C(),s.events.push(["exit",w,s]),w}function B(S,w){q(S,w.from)}function x(S,w){w.restore()}function A(S,w){return O;function O(H,_,U){let j,J,un,o;return Array.isArray(H)?ln(H):"tokenize"in H?ln([H]):K(H);function K(Q){return kn;function kn(on){const mn=on!==null&&Q[on],gn=on!==null&&Q.null,zn=[...Array.isArray(mn)?mn:mn?[mn]:[],...Array.isArray(gn)?gn:gn?[gn]:[]];return ln(zn)(on)}}function ln(Q){return j=Q,J=0,Q.length===0?U:c(Q[J])}function c(Q){return kn;function kn(on){return o=M(),un=Q,Q.partial||(s.currentConstruct=Q),Q.name&&s.parser.constructs.disable.null.includes(Q.name)?fn():Q.tokenize.call(w?Object.assign(Object.create(s),w):s,p,X,fn)(on)}}function X(Q){return S(un,o),_}function fn(Q){return o.restore(),++J<j.length?c(j[J]):U}}}function q(S,w){S.resolveAll&&!i.includes(S)&&i.push(S),S.resolve&&rn(s.events,w,s.events.length-w,S.resolve(s.events.slice(w),s)),S.resolveTo&&(s.events=S.resolveTo(s.events,s))}function M(){const S=C(),w=s.previous,O=s.currentConstruct,H=s.events.length,_=Array.from(a);return{from:H,restore:U};function U(){r=S,s.previous=w,s.currentConstruct=O,s.events.length=H,a=_,V()}}function V(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function ei(n,e){const t=e.start._index,r=e.start._bufferIndex,u=e.end._index,i=e.end._bufferIndex;let l;if(t===u)l=[n[t].slice(r,i)];else{if(l=n.slice(t,u),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}i>0&&l.push(n[u].slice(0,i))}return l}function ri(n,e){let t=-1;const r=[];let u;for(;++t<n.length;){const i=n[t];let l;if(typeof i=="string")l=i;else switch(i){case-5:{l="\r";break}case-4:{l=`
1
+ import{dC as Cn,co as Tn,dD as Fn,dE as jt}from"./index-BXp-gQxZ.js";import{t as Qt,e as Bn,b as rt,i as jn}from"./index-DsTb49bw.js";import{d as Zn}from"./index.dom-C3-224fz.js";function Sn(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?it(n.position):"start"in n||"end"in n?it(n):"line"in n||"column"in n?Qn(n):""}function Qn(n){return ut(n&&n.line)+":"+ut(n&&n.column)}function it(n){return Qn(n&&n.start)+"-"+Qn(n&&n.end)}function ut(n){return n&&typeof n=="number"?n:1}class $ extends Error{constructor(e,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let u="",i={},l=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof e=="string"?u=e:!i.cause&&e&&(l=!0,u=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const p=r.indexOf(":");p===-1?i.ruleId=r:(i.source=r.slice(0,p),i.ruleId=r.slice(p+1))}if(!i.place&&i.ancestors&&i.ancestors){const p=i.ancestors[i.ancestors.length-1];p&&(i.place=p.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=a?a.line:void 0,this.name=Sn(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$.prototype.file="";$.prototype.name="";$.prototype.reason="";$.prototype.message="";$.prototype.stack="";$.prototype.column=void 0;$.prototype.line=void 0;$.prototype.ancestors=void 0;$.prototype.cause=void 0;$.prototype.fatal=void 0;$.prototype.place=void 0;$.prototype.ruleId=void 0;$.prototype.source=void 0;const tn={basename:Ut,dirname:Wt,extname:Yt,join:$t,sep:"/"};function Ut(n,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');En(n);let t=0,r=-1,u=n.length,i;if(e===void 0||e.length===0||e.length>n.length){for(;u--;)if(n.codePointAt(u)===47){if(i){t=u+1;break}}else r<0&&(i=!0,r=u+1);return r<0?"":n.slice(t,r)}if(e===n)return"";let l=-1,a=e.length-1;for(;u--;)if(n.codePointAt(u)===47){if(i){t=u+1;break}}else l<0&&(i=!0,l=u+1),a>-1&&(n.codePointAt(u)===e.codePointAt(a--)?a<0&&(r=u):(a=-1,r=l));return t===r?r=l:r<0&&(r=n.length),n.slice(t,r)}function Wt(n){if(En(n),n.length===0)return".";let e=-1,t=n.length,r;for(;--t;)if(n.codePointAt(t)===47){if(r){e=t;break}}else r||(r=!0);return e<0?n.codePointAt(0)===47?"/":".":e===1&&n.codePointAt(0)===47?"//":n.slice(0,e)}function Yt(n){En(n);let e=n.length,t=-1,r=0,u=-1,i=0,l;for(;e--;){const a=n.codePointAt(e);if(a===47){if(l){r=e+1;break}continue}t<0&&(l=!0,t=e+1),a===46?u<0?u=e:i!==1&&(i=1):u>-1&&(i=-1)}return u<0||t<0||i===0||i===1&&u===t-1&&u===r+1?"":n.slice(u,t)}function $t(...n){let e=-1,t;for(;++e<n.length;)En(n[e]),n[e]&&(t=t===void 0?n[e]:t+"/"+n[e]);return t===void 0?".":Zt(t)}function Zt(n){En(n);const e=n.codePointAt(0)===47;let t=Gt(n,!e);return t.length===0&&!e&&(t="."),t.length>0&&n.codePointAt(n.length-1)===47&&(t+="/"),e?"/"+t:t}function Gt(n,e){let t="",r=0,u=-1,i=0,l=-1,a,p;for(;++l<=n.length;){if(l<n.length)a=n.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(u===l-1||i===1))if(u!==l-1&&i===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(p=t.lastIndexOf("/"),p!==t.length-1){p<0?(t="",r=0):(t=t.slice(0,p),r=t.length-1-t.lastIndexOf("/")),u=l,i=0;continue}}else if(t.length>0){t="",r=0,u=l,i=0;continue}}e&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+n.slice(u+1,l):t=n.slice(u+1,l),r=l-u-1;u=l,i=0}else a===46&&i>-1?i++:i=-1}return t}function En(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const Jt={cwd:Kt};function Kt(){return"/"}function Un(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function Xt(n){if(typeof n=="string")n=new URL(n);else if(!Un(n)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(n.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return vt(n)}function vt(n){if(n.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=n.pathname;let t=-1;for(;++t<e.length;)if(e.codePointAt(t)===37&&e.codePointAt(t+1)===50){const r=e.codePointAt(t+2);if(r===70||r===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(e)}const Mn=["history","path","basename","stem","extname","dirname"];class ne{constructor(e){let t;e?Un(e)?t={path:e}:typeof e=="string"||te(e)?t={value:e}:t=e:t={},this.cwd="cwd"in t?"":Jt.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Mn.length;){const i=Mn[r];i in t&&t[i]!==void 0&&t[i]!==null&&(this[i]=i==="history"?[...t[i]]:t[i])}let u;for(u in t)Mn.includes(u)||(this[u]=t[u])}get basename(){return typeof this.path=="string"?tn.basename(this.path):void 0}set basename(e){Rn(e,"basename"),Nn(e,"basename"),this.path=tn.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?tn.dirname(this.path):void 0}set dirname(e){lt(this.basename,"dirname"),this.path=tn.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?tn.extname(this.path):void 0}set extname(e){if(Nn(e,"extname"),lt(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=tn.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Un(e)&&(e=Xt(e)),Rn(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?tn.basename(this.path,this.extname):void 0}set stem(e){Rn(e,"stem"),Nn(e,"stem"),this.path=tn.join(this.dirname||"",e+(this.extname||""))}fail(e,t,r){const u=this.message(e,t,r);throw u.fatal=!0,u}info(e,t,r){const u=this.message(e,t,r);return u.fatal=void 0,u}message(e,t,r){const u=new $(e,t,r);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Nn(n,e){if(n&&n.includes(tn.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+tn.sep+"`")}function Rn(n,e){if(!n)throw new Error("`"+e+"` cannot be empty")}function lt(n,e){if(!n)throw new Error("Setting `"+e+"` requires `path` to be set too")}function te(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const ee=(function(n){const r=this.constructor.prototype,u=r[n],i=function(){return u.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),re={}.hasOwnProperty;class Gn extends ee{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Qt()}copy(){const e=new Gn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];e.use(...r)}return e.data(Bn(!0,{},this.namespace)),e}data(e,t){return typeof e=="string"?arguments.length===2?(On("data",this.frozen),this.namespace[e]=t,this):re.call(this.namespace,e)&&this.namespace[e]||void 0:e?(On("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const u=t.call(e,...r);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=An(e),r=this.parser||this.Parser;return Dn("parse",r),r(String(t),t)}process(e,t){const r=this;return this.freeze(),Dn("process",this.parser||this.Parser),Vn("process",this.compiler||this.Compiler),t?u(void 0,t):new Promise(u);function u(i,l){const a=An(e),p=r.parse(a);r.run(p,a,function(m,f,g){if(m||!f||!g)return s(m);const h=f,C=r.stringify(h,g);le(C)?g.value=C:g.result=C,s(m,g)});function s(m,f){m||!f?l(m):i?i(f):t(void 0,f)}}}processSync(e){let t=!1,r;return this.freeze(),Dn("processSync",this.parser||this.Parser),Vn("processSync",this.compiler||this.Compiler),this.process(e,u),st("processSync","process",t),r;function u(i,l){t=!0,rt(i),r=l}}run(e,t,r){at(e),this.freeze();const u=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?i(void 0,r):new Promise(i);function i(l,a){const p=An(t);u.run(e,p,s);function s(m,f,g){const h=f||e;m?a(m):l?l(h):r(void 0,h,g)}}}runSync(e,t){let r=!1,u;return this.run(e,t,i),st("runSync","run",r),u;function i(l,a){rt(l),u=a,r=!0}}stringify(e,t){this.freeze();const r=An(t),u=this.compiler||this.Compiler;return Vn("stringify",u),at(e),u(e,r)}use(e,...t){const r=this.attachers,u=this.namespace;if(On("use",this.frozen),e!=null)if(typeof e=="function")p(e,t);else if(typeof e=="object")Array.isArray(e)?a(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function i(s){if(typeof s=="function")p(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[m,...f]=s;p(m,f)}else l(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function l(s){if(!("plugins"in s)&&!("settings"in s))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(s.plugins),s.settings&&(u.settings=Bn(!0,u.settings,s.settings))}function a(s){let m=-1;if(s!=null)if(Array.isArray(s))for(;++m<s.length;){const f=s[m];i(f)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function p(s,m){let f=-1,g=-1;for(;++f<r.length;)if(r[f][0]===s){g=f;break}if(g===-1)r.push([s,...m]);else if(m.length>0){let[h,...C]=m;const F=r[g][1];jn(F)&&jn(h)&&(h=Bn(!0,F,h)),r[g]=[s,h,...C]}}}}const ie=new Gn().freeze();function Dn(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Vn(n,e){if(typeof e!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function On(n,e){if(e)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function at(n){if(!jn(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function st(n,e,t){if(!t)throw new Error("`"+n+"` finished async. Use `"+e+"` instead")}function An(n){return ue(n)?n:new ne(n)}function ue(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function le(n){return typeof n=="string"||ae(n)}function ae(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const se={};function oe(n,e){const t=se,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,u=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return bt(n,r,u)}function bt(n,e,t){if(ce(n)){if("value"in n)return n.type==="html"&&!t?"":n.value;if(e&&"alt"in n&&n.alt)return n.alt;if("children"in n)return ot(n.children,e,t)}return Array.isArray(n)?ot(n,e,t):""}function ot(n,e,t){const r=[];let u=-1;for(;++u<n.length;)r[u]=bt(n[u],e,t);return r.join("")}function ce(n){return!!(n&&typeof n=="object")}function rn(n,e,t,r){const u=n.length;let i=0,l;if(e<0?e=-e>u?0:u+e:e=e>u?u:e,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(e,t),n.splice(...l);else for(t&&n.splice(e,t);i<r.length;)l=r.slice(i,i+1e4),l.unshift(e,0),n.splice(...l),i+=1e4,e+=1e4}function G(n,e){return n.length>0?(rn(n,n.length,0,e),n):e}const ct={}.hasOwnProperty;function he(n){const e={};let t=-1;for(;++t<n.length;)fe(e,n[t]);return e}function fe(n,e){let t;for(t in e){const u=(ct.call(n,t)?n[t]:void 0)||(n[t]={}),i=e[t];let l;if(i)for(l in i){ct.call(u,l)||(u[l]=[]);const a=i[l];pe(u[l],Array.isArray(a)?a:a?[a]:[])}}}function pe(n,e){let t=-1;const r=[];for(;++t<e.length;)(e[t].add==="after"?n:r).push(e[t]);rn(n,0,0,r)}function wt(n,e){const t=Number.parseInt(n,e);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function xn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const en=hn(/[A-Za-z]/),nn=hn(/[\dA-Za-z]/),me=hn(/[#-'*+\--9=?A-Z^-~]/);function Wn(n){return n!==null&&(n<32||n===127)}const Yn=hn(/\d/),ge=hn(/[\dA-Fa-f]/),de=hn(/[!-/:-@[-`{-~]/);function I(n){return n!==null&&n<-2}function Y(n){return n!==null&&(n<0||n===32)}function P(n){return n===-2||n===-1||n===32}const xe=hn(new RegExp("\\p{P}|\\p{S}","u")),ke=hn(/\s/);function hn(n){return e;function e(t){return t!==null&&t>-1&&n.test(String.fromCharCode(t))}}function R(n,e,t,r){const u=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(p){return P(p)?(n.enter(t),a(p)):e(p)}function a(p){return P(p)&&i++<u?(n.consume(p),a):(n.exit(t),e(p))}}const ye={tokenize:be};function be(n){const e=n.attempt(this.parser.constructs.contentInitial,r,u);let t;return e;function r(a){if(a===null){n.consume(a);return}return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),R(n,e,"linePrefix")}function u(a){return n.enter("paragraph"),i(a)}function i(a){const p=n.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=p),t=p,l(a)}function l(a){if(a===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(a);return}return I(a)?(n.consume(a),n.exit("chunkText"),i):(n.consume(a),l)}}const we={tokenize:Se},ht={tokenize:Ie};function Se(n){const e=this,t=[];let r=0,u,i,l;return a;function a(b){if(r<t.length){const L=t[r];return e.containerState=L[1],n.attempt(L[0].continuation,p,s)(b)}return s(b)}function p(b){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,u&&D();const L=e.events.length;let B=L,x;for(;B--;)if(e.events[B][0]==="exit"&&e.events[B][1].type==="chunkFlow"){x=e.events[B][1].end;break}y(r);let A=L;for(;A<e.events.length;)e.events[A][1].end={...x},A++;return rn(e.events,B+1,0,e.events.slice(L)),e.events.length=A,s(b)}return a(b)}function s(b){if(r===t.length){if(!u)return g(b);if(u.currentConstruct&&u.currentConstruct.concrete)return C(b);e.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return e.containerState={},n.check(ht,m,f)(b)}function m(b){return u&&D(),y(r),g(b)}function f(b){return e.parser.lazy[e.now().line]=r!==t.length,l=e.now().offset,C(b)}function g(b){return e.containerState={},n.attempt(ht,h,C)(b)}function h(b){return r++,t.push([e.currentConstruct,e.containerState]),g(b)}function C(b){if(b===null){u&&D(),y(0),n.consume(b);return}return u=u||e.parser.flow(e.now()),n.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:i}),F(b)}function F(b){if(b===null){E(n.exit("chunkFlow"),!0),y(0),n.consume(b);return}return I(b)?(n.consume(b),E(n.exit("chunkFlow")),r=0,e.interrupt=void 0,a):(n.consume(b),F)}function E(b,L){const B=e.sliceStream(b);if(L&&B.push(null),b.previous=i,i&&(i.next=b),i=b,u.defineSkip(b.start),u.write(B),e.parser.lazy[b.start.line]){let x=u.events.length;for(;x--;)if(u.events[x][1].start.offset<l&&(!u.events[x][1].end||u.events[x][1].end.offset>l))return;const A=e.events.length;let q=A,M,V;for(;q--;)if(e.events[q][0]==="exit"&&e.events[q][1].type==="chunkFlow"){if(M){V=e.events[q][1].end;break}M=!0}for(y(r),x=A;x<e.events.length;)e.events[x][1].end={...V},x++;rn(e.events,q+1,0,e.events.slice(A)),e.events.length=x}}function y(b){let L=t.length;for(;L-- >b;){const B=t[L];e.containerState=B[1],B[0].exit.call(e,n)}t.length=b}function D(){u.write([null]),i=void 0,u=void 0,e.containerState._closeFlow=void 0}}function Ie(n,e,t){return R(n,n.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ft(n){if(n===null||Y(n)||ke(n))return 1;if(xe(n))return 2}function Jn(n,e,t){const r=[];let u=-1;for(;++u<n.length;){const i=n[u].resolveAll;i&&!r.includes(i)&&(e=i(e,t),r.push(i))}return e}const $n={name:"attention",resolveAll:Ee,tokenize:ze};function Ee(n,e){let t=-1,r,u,i,l,a,p,s,m;for(;++t<n.length;)if(n[t][0]==="enter"&&n[t][1].type==="attentionSequence"&&n[t][1]._close){for(r=t;r--;)if(n[r][0]==="exit"&&n[r][1].type==="attentionSequence"&&n[r][1]._open&&e.sliceSerialize(n[r][1]).charCodeAt(0)===e.sliceSerialize(n[t][1]).charCodeAt(0)){if((n[r][1]._close||n[t][1]._open)&&(n[t][1].end.offset-n[t][1].start.offset)%3&&!((n[r][1].end.offset-n[r][1].start.offset+n[t][1].end.offset-n[t][1].start.offset)%3))continue;p=n[r][1].end.offset-n[r][1].start.offset>1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;const f={...n[r][1].end},g={...n[t][1].start};pt(f,-p),pt(g,p),l={type:p>1?"strongSequence":"emphasisSequence",start:f,end:{...n[r][1].end}},a={type:p>1?"strongSequence":"emphasisSequence",start:{...n[t][1].start},end:g},i={type:p>1?"strongText":"emphasisText",start:{...n[r][1].end},end:{...n[t][1].start}},u={type:p>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},n[r][1].end={...l.start},n[t][1].start={...a.end},s=[],n[r][1].end.offset-n[r][1].start.offset&&(s=G(s,[["enter",n[r][1],e],["exit",n[r][1],e]])),s=G(s,[["enter",u,e],["enter",l,e],["exit",l,e],["enter",i,e]]),s=G(s,Jn(e.parser.constructs.insideSpan.null,n.slice(r+1,t),e)),s=G(s,[["exit",i,e],["enter",a,e],["exit",a,e],["exit",u,e]]),n[t][1].end.offset-n[t][1].start.offset?(m=2,s=G(s,[["enter",n[t][1],e],["exit",n[t][1],e]])):m=0,rn(n,r-1,t-r+3,s),t=r+s.length-m-2;break}}for(t=-1;++t<n.length;)n[t][1].type==="attentionSequence"&&(n[t][1].type="data");return n}function ze(n,e){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,u=ft(r);let i;return l;function l(p){return i=p,n.enter("attentionSequence"),a(p)}function a(p){if(p===i)return n.consume(p),a;const s=n.exit("attentionSequence"),m=ft(p),f=!m||m===2&&u||t.includes(p),g=!u||u===2&&m||t.includes(r);return s._open=!!(i===42?f:f&&(u||!g)),s._close=!!(i===42?g:g&&(m||!f)),e(p)}}function pt(n,e){n.column+=e,n.offset+=e,n._bufferIndex+=e}const Ce={name:"autolink",tokenize:Te};function Te(n,e,t){let r=0;return u;function u(h){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(h),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),i}function i(h){return en(h)?(n.consume(h),l):h===64?t(h):s(h)}function l(h){return h===43||h===45||h===46||nn(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(n.consume(h),r=0,p):(h===43||h===45||h===46||nn(h))&&r++<32?(n.consume(h),a):(r=0,s(h))}function p(h){return h===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(h),n.exit("autolinkMarker"),n.exit("autolink"),e):h===null||h===32||h===60||Wn(h)?t(h):(n.consume(h),p)}function s(h){return h===64?(n.consume(h),m):me(h)?(n.consume(h),s):t(h)}function m(h){return nn(h)?f(h):t(h)}function f(h){return h===46?(n.consume(h),r=0,m):h===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(h),n.exit("autolinkMarker"),n.exit("autolink"),e):g(h)}function g(h){if((h===45||nn(h))&&r++<63){const C=h===45?g:f;return n.consume(h),C}return t(h)}}const Pn={partial:!0,tokenize:Fe};function Fe(n,e,t){return r;function r(i){return P(i)?R(n,u,"linePrefix")(i):u(i)}function u(i){return i===null||I(i)?e(i):t(i)}}const St={continuation:{tokenize:_e},exit:Le,name:"blockQuote",tokenize:Ae};function Ae(n,e,t){const r=this;return u;function u(l){if(l===62){const a=r.containerState;return a.open||(n.enter("blockQuote",{_container:!0}),a.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(l),n.exit("blockQuoteMarker"),i}return t(l)}function i(l){return P(l)?(n.enter("blockQuotePrefixWhitespace"),n.consume(l),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),e):(n.exit("blockQuotePrefix"),e(l))}}function _e(n,e,t){const r=this;return u;function u(l){return P(l)?R(n,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):i(l)}function i(l){return n.attempt(St,e,t)(l)}}function Le(n){n.exit("blockQuote")}const It={name:"characterEscape",tokenize:Pe};function Pe(n,e,t){return r;function r(i){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(i),n.exit("escapeMarker"),u}function u(i){return de(i)?(n.enter("characterEscapeValue"),n.consume(i),n.exit("characterEscapeValue"),n.exit("characterEscape"),e):t(i)}}const Et={name:"characterReference",tokenize:Be};function Be(n,e,t){const r=this;let u=0,i,l;return a;function a(f){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(f),n.exit("characterReferenceMarker"),p}function p(f){return f===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(f),n.exit("characterReferenceMarkerNumeric"),s):(n.enter("characterReferenceValue"),i=31,l=nn,m(f))}function s(f){return f===88||f===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(f),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),i=6,l=ge,m):(n.enter("characterReferenceValue"),i=7,l=Yn,m(f))}function m(f){if(f===59&&u){const g=n.exit("characterReferenceValue");return l===nn&&!Zn(r.sliceSerialize(g))?t(f):(n.enter("characterReferenceMarker"),n.consume(f),n.exit("characterReferenceMarker"),n.exit("characterReference"),e)}return l(f)&&u++<i?(n.consume(f),m):t(f)}}const mt={partial:!0,tokenize:Ne},gt={concrete:!0,name:"codeFenced",tokenize:Me};function Me(n,e,t){const r=this,u={partial:!0,tokenize:B};let i=0,l=0,a;return p;function p(x){return s(x)}function s(x){const A=r.events[r.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=x,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),m(x)}function m(x){return x===a?(l++,n.consume(x),m):l<3?t(x):(n.exit("codeFencedFenceSequence"),P(x)?R(n,f,"whitespace")(x):f(x))}function f(x){return x===null||I(x)?(n.exit("codeFencedFence"),r.interrupt?e(x):n.check(mt,F,L)(x)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||I(x)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),f(x)):P(x)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),R(n,h,"whitespace")(x)):x===96&&x===a?t(x):(n.consume(x),g)}function h(x){return x===null||I(x)?f(x):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),C(x))}function C(x){return x===null||I(x)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),f(x)):x===96&&x===a?t(x):(n.consume(x),C)}function F(x){return n.attempt(u,L,E)(x)}function E(x){return n.enter("lineEnding"),n.consume(x),n.exit("lineEnding"),y}function y(x){return i>0&&P(x)?R(n,D,"linePrefix",i+1)(x):D(x)}function D(x){return x===null||I(x)?n.check(mt,F,L)(x):(n.enter("codeFlowValue"),b(x))}function b(x){return x===null||I(x)?(n.exit("codeFlowValue"),D(x)):(n.consume(x),b)}function L(x){return n.exit("codeFenced"),e(x)}function B(x,A,q){let M=0;return V;function V(_){return x.enter("lineEnding"),x.consume(_),x.exit("lineEnding"),S}function S(_){return x.enter("codeFencedFence"),P(_)?R(x,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):w(_)}function w(_){return _===a?(x.enter("codeFencedFenceSequence"),O(_)):q(_)}function O(_){return _===a?(M++,x.consume(_),O):M>=l?(x.exit("codeFencedFenceSequence"),P(_)?R(x,H,"whitespace")(_):H(_)):q(_)}function H(_){return _===null||I(_)?(x.exit("codeFencedFence"),A(_)):q(_)}}}function Ne(n,e,t){const r=this;return u;function u(l){return l===null?t(l):(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?t(l):e(l)}}const qn={name:"codeIndented",tokenize:De},Re={partial:!0,tokenize:Ve};function De(n,e,t){const r=this;return u;function u(s){return n.enter("codeIndented"),R(n,i,"linePrefix",5)(s)}function i(s){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(s):t(s)}function l(s){return s===null?p(s):I(s)?n.attempt(Re,l,p)(s):(n.enter("codeFlowValue"),a(s))}function a(s){return s===null||I(s)?(n.exit("codeFlowValue"),l(s)):(n.consume(s),a)}function p(s){return n.exit("codeIndented"),e(s)}}function Ve(n,e,t){const r=this;return u;function u(l){return r.parser.lazy[r.now().line]?t(l):I(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),u):R(n,i,"linePrefix",5)(l)}function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(l):I(l)?u(l):t(l)}}const Oe={name:"codeText",previous:He,resolve:qe,tokenize:je};function qe(n){let e=n.length-4,t=3,r,u;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[e][1].type==="lineEnding"||n[e][1].type==="space")){for(r=t;++r<e;)if(n[r][1].type==="codeTextData"){n[t][1].type="codeTextPadding",n[e][1].type="codeTextPadding",t+=2,e-=2;break}}for(r=t-1,e++;++r<=e;)u===void 0?r!==e&&n[r][1].type!=="lineEnding"&&(u=r):(r===e||n[r][1].type==="lineEnding")&&(n[u][1].type="codeTextData",r!==u+2&&(n[u][1].end=n[r-1][1].end,n.splice(u+2,r-u-2),e-=r-u-2,r=u+2),u=void 0);return n}function He(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function je(n,e,t){let r=0,u,i;return l;function l(f){return n.enter("codeText"),n.enter("codeTextSequence"),a(f)}function a(f){return f===96?(n.consume(f),r++,a):(n.exit("codeTextSequence"),p(f))}function p(f){return f===null?t(f):f===32?(n.enter("space"),n.consume(f),n.exit("space"),p):f===96?(i=n.enter("codeTextSequence"),u=0,m(f)):I(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),p):(n.enter("codeTextData"),s(f))}function s(f){return f===null||f===32||f===96||I(f)?(n.exit("codeTextData"),p(f)):(n.consume(f),s)}function m(f){return f===96?(n.consume(f),u++,m):u===r?(n.exit("codeTextSequence"),n.exit("codeText"),e(f)):(i.type="codeTextData",s(f))}}class Qe{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){const u=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&wn(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),wn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),wn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);wn(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);wn(this.left,t.reverse())}}}function wn(n,e){let t=0;if(e.length<1e4)n.push(...e);else for(;t<e.length;)n.push(...e.slice(t,t+1e4)),t+=1e4}function zt(n){const e={};let t=-1,r,u,i,l,a,p,s;const m=new Qe(n);for(;++t<m.length;){for(;t in e;)t=e[t];if(r=m.get(t),t&&r[1].type==="chunkFlow"&&m.get(t-1)[1].type==="listItemPrefix"&&(p=r[1]._tokenizer.events,i=0,i<p.length&&p[i][1].type==="lineEndingBlank"&&(i+=2),i<p.length&&p[i][1].type==="content"))for(;++i<p.length&&p[i][1].type!=="content";)p[i][1].type==="chunkText"&&(p[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,Ue(m,t)),t=e[t],s=!0);else if(r[1]._container){for(i=t,u=void 0;i--;)if(l=m.get(i),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(u&&(m.get(u)[1].type="lineEndingBlank"),l[1].type="lineEnding",u=i);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;u&&(r[1].end={...m.get(u)[1].start},a=m.slice(u,t),a.unshift(r),m.splice(u,t-u+1,a))}}return rn(n,0,Number.POSITIVE_INFINITY,m.slice(0)),!s}function Ue(n,e){const t=n.get(e)[1],r=n.get(e)[2];let u=e-1;const i=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,p=[],s={};let m,f,g=-1,h=t,C=0,F=0;const E=[F];for(;h;){for(;n.get(++u)[1]!==h;);i.push(u),h._tokenizer||(m=r.sliceStream(h),h.next||m.push(null),f&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=t;++g<a.length;)a[g][0]==="exit"&&a[g-1][0]==="enter"&&a[g][1].type===a[g-1][1].type&&a[g][1].start.line!==a[g][1].end.line&&(F=g+1,E.push(F),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):E.pop(),g=E.length;g--;){const y=a.slice(E[g],E[g+1]),D=i.pop();p.push([D,D+y.length-1]),n.splice(D,2,y)}for(p.reverse(),g=-1;++g<p.length;)s[C+p[g][0]]=C+p[g][1],C+=p[g][1]-p[g][0]-1;return s}const We={resolve:$e,tokenize:Ze},Ye={partial:!0,tokenize:Ge};function $e(n){return zt(n),n}function Ze(n,e){let t;return r;function r(a){return n.enter("content"),t=n.enter("chunkContent",{contentType:"content"}),u(a)}function u(a){return a===null?i(a):I(a)?n.check(Ye,l,i)(a):(n.consume(a),u)}function i(a){return n.exit("chunkContent"),n.exit("content"),e(a)}function l(a){return n.consume(a),n.exit("chunkContent"),t.next=n.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,u}}function Ge(n,e,t){const r=this;return u;function u(l){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),R(n,i,"linePrefix")}function i(l){if(l===null||I(l))return t(l);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(l):n.interrupt(r.parser.constructs.flow,t,e)(l)}}function Ct(n,e,t,r,u,i,l,a,p){const s=p||Number.POSITIVE_INFINITY;let m=0;return f;function f(y){return y===60?(n.enter(r),n.enter(u),n.enter(i),n.consume(y),n.exit(i),g):y===null||y===32||y===41||Wn(y)?t(y):(n.enter(r),n.enter(l),n.enter(a),n.enter("chunkString",{contentType:"string"}),F(y))}function g(y){return y===62?(n.enter(i),n.consume(y),n.exit(i),n.exit(u),n.exit(r),e):(n.enter(a),n.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(n.exit("chunkString"),n.exit(a),g(y)):y===null||y===60||I(y)?t(y):(n.consume(y),y===92?C:h)}function C(y){return y===60||y===62||y===92?(n.consume(y),h):h(y)}function F(y){return!m&&(y===null||y===41||Y(y))?(n.exit("chunkString"),n.exit(a),n.exit(l),n.exit(r),e(y)):m<s&&y===40?(n.consume(y),m++,F):y===41?(n.consume(y),m--,F):y===null||y===32||y===40||Wn(y)?t(y):(n.consume(y),y===92?E:F)}function E(y){return y===40||y===41||y===92?(n.consume(y),F):F(y)}}function Tt(n,e,t,r,u,i){const l=this;let a=0,p;return s;function s(h){return n.enter(r),n.enter(u),n.consume(h),n.exit(u),n.enter(i),m}function m(h){return a>999||h===null||h===91||h===93&&!p||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(n.exit(i),n.enter(u),n.consume(h),n.exit(u),n.exit(r),e):I(h)?(n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),m):(n.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||I(h)||a++>999?(n.exit("chunkString"),m(h)):(n.consume(h),p||(p=!P(h)),h===92?g:f)}function g(h){return h===91||h===92||h===93?(n.consume(h),a++,f):f(h)}}function Ft(n,e,t,r,u,i){let l;return a;function a(g){return g===34||g===39||g===40?(n.enter(r),n.enter(u),n.consume(g),n.exit(u),l=g===40?41:g,p):t(g)}function p(g){return g===l?(n.enter(u),n.consume(g),n.exit(u),n.exit(r),e):(n.enter(i),s(g))}function s(g){return g===l?(n.exit(i),p(l)):g===null?t(g):I(g)?(n.enter("lineEnding"),n.consume(g),n.exit("lineEnding"),R(n,s,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===l||g===null||I(g)?(n.exit("chunkString"),s(g)):(n.consume(g),g===92?f:m)}function f(g){return g===l||g===92?(n.consume(g),m):m(g)}}function In(n,e){let t;return r;function r(u){return I(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),t=!0,r):P(u)?R(n,r,t?"linePrefix":"lineSuffix")(u):e(u)}}const Je={name:"definition",tokenize:Xe},Ke={partial:!0,tokenize:ve};function Xe(n,e,t){const r=this;let u;return i;function i(h){return n.enter("definition"),l(h)}function l(h){return Tt.call(r,n,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return u=xn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(n.enter("definitionMarker"),n.consume(h),n.exit("definitionMarker"),p):t(h)}function p(h){return Y(h)?In(n,s)(h):s(h)}function s(h){return Ct(n,m,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function m(h){return n.attempt(Ke,f,f)(h)}function f(h){return P(h)?R(n,g,"whitespace")(h):g(h)}function g(h){return h===null||I(h)?(n.exit("definition"),r.parser.defined.push(u),e(h)):t(h)}}function ve(n,e,t){return r;function r(a){return Y(a)?In(n,u)(a):t(a)}function u(a){return Ft(n,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return P(a)?R(n,l,"whitespace")(a):l(a)}function l(a){return a===null||I(a)?e(a):t(a)}}const nr={name:"hardBreakEscape",tokenize:tr};function tr(n,e,t){return r;function r(i){return n.enter("hardBreakEscape"),n.consume(i),u}function u(i){return I(i)?(n.exit("hardBreakEscape"),e(i)):t(i)}}const er={name:"headingAtx",resolve:rr,tokenize:ir};function rr(n,e){let t=n.length-2,r=3,u,i;return n[r][1].type==="whitespace"&&(r+=2),t-2>r&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&n[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(u={type:"atxHeadingText",start:n[r][1].start,end:n[t][1].end},i={type:"chunkText",start:n[r][1].start,end:n[t][1].end,contentType:"text"},rn(n,r,t-r+1,[["enter",u,e],["enter",i,e],["exit",i,e],["exit",u,e]])),n}function ir(n,e,t){let r=0;return u;function u(m){return n.enter("atxHeading"),i(m)}function i(m){return n.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(n.consume(m),l):m===null||Y(m)?(n.exit("atxHeadingSequence"),a(m)):t(m)}function a(m){return m===35?(n.enter("atxHeadingSequence"),p(m)):m===null||I(m)?(n.exit("atxHeading"),e(m)):P(m)?R(n,a,"whitespace")(m):(n.enter("atxHeadingText"),s(m))}function p(m){return m===35?(n.consume(m),p):(n.exit("atxHeadingSequence"),a(m))}function s(m){return m===null||m===35||Y(m)?(n.exit("atxHeadingText"),a(m)):(n.consume(m),s)}}const ur=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],dt=["pre","script","style","textarea"],lr={concrete:!0,name:"htmlFlow",resolveTo:or,tokenize:cr},ar={partial:!0,tokenize:fr},sr={partial:!0,tokenize:hr};function or(n){let e=n.length;for(;e--&&!(n[e][0]==="enter"&&n[e][1].type==="htmlFlow"););return e>1&&n[e-2][1].type==="linePrefix"&&(n[e][1].start=n[e-2][1].start,n[e+1][1].start=n[e-2][1].start,n.splice(e-2,2)),n}function cr(n,e,t){const r=this;let u,i,l,a,p;return s;function s(c){return m(c)}function m(c){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(c),f}function f(c){return c===33?(n.consume(c),g):c===47?(n.consume(c),i=!0,F):c===63?(n.consume(c),u=3,r.interrupt?e:o):en(c)?(n.consume(c),l=String.fromCharCode(c),E):t(c)}function g(c){return c===45?(n.consume(c),u=2,h):c===91?(n.consume(c),u=5,a=0,C):en(c)?(n.consume(c),u=4,r.interrupt?e:o):t(c)}function h(c){return c===45?(n.consume(c),r.interrupt?e:o):t(c)}function C(c){const X="CDATA[";return c===X.charCodeAt(a++)?(n.consume(c),a===X.length?r.interrupt?e:w:C):t(c)}function F(c){return en(c)?(n.consume(c),l=String.fromCharCode(c),E):t(c)}function E(c){if(c===null||c===47||c===62||Y(c)){const X=c===47,fn=l.toLowerCase();return!X&&!i&&dt.includes(fn)?(u=1,r.interrupt?e(c):w(c)):ur.includes(l.toLowerCase())?(u=6,X?(n.consume(c),y):r.interrupt?e(c):w(c)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(c):i?D(c):b(c))}return c===45||nn(c)?(n.consume(c),l+=String.fromCharCode(c),E):t(c)}function y(c){return c===62?(n.consume(c),r.interrupt?e:w):t(c)}function D(c){return P(c)?(n.consume(c),D):V(c)}function b(c){return c===47?(n.consume(c),V):c===58||c===95||en(c)?(n.consume(c),L):P(c)?(n.consume(c),b):V(c)}function L(c){return c===45||c===46||c===58||c===95||nn(c)?(n.consume(c),L):B(c)}function B(c){return c===61?(n.consume(c),x):P(c)?(n.consume(c),B):b(c)}function x(c){return c===null||c===60||c===61||c===62||c===96?t(c):c===34||c===39?(n.consume(c),p=c,A):P(c)?(n.consume(c),x):q(c)}function A(c){return c===p?(n.consume(c),p=null,M):c===null||I(c)?t(c):(n.consume(c),A)}function q(c){return c===null||c===34||c===39||c===47||c===60||c===61||c===62||c===96||Y(c)?B(c):(n.consume(c),q)}function M(c){return c===47||c===62||P(c)?b(c):t(c)}function V(c){return c===62?(n.consume(c),S):t(c)}function S(c){return c===null||I(c)?w(c):P(c)?(n.consume(c),S):t(c)}function w(c){return c===45&&u===2?(n.consume(c),U):c===60&&u===1?(n.consume(c),j):c===62&&u===4?(n.consume(c),K):c===63&&u===3?(n.consume(c),o):c===93&&u===5?(n.consume(c),un):I(c)&&(u===6||u===7)?(n.exit("htmlFlowData"),n.check(ar,ln,O)(c)):c===null||I(c)?(n.exit("htmlFlowData"),O(c)):(n.consume(c),w)}function O(c){return n.check(sr,H,ln)(c)}function H(c){return n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),_}function _(c){return c===null||I(c)?O(c):(n.enter("htmlFlowData"),w(c))}function U(c){return c===45?(n.consume(c),o):w(c)}function j(c){return c===47?(n.consume(c),l="",J):w(c)}function J(c){if(c===62){const X=l.toLowerCase();return dt.includes(X)?(n.consume(c),K):w(c)}return en(c)&&l.length<8?(n.consume(c),l+=String.fromCharCode(c),J):w(c)}function un(c){return c===93?(n.consume(c),o):w(c)}function o(c){return c===62?(n.consume(c),K):c===45&&u===2?(n.consume(c),o):w(c)}function K(c){return c===null||I(c)?(n.exit("htmlFlowData"),ln(c)):(n.consume(c),K)}function ln(c){return n.exit("htmlFlow"),e(c)}}function hr(n,e,t){const r=this;return u;function u(l){return I(l)?(n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),i):t(l)}function i(l){return r.parser.lazy[r.now().line]?t(l):e(l)}}function fr(n,e,t){return r;function r(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),n.attempt(Pn,e,t)}}const pr={name:"htmlText",tokenize:mr};function mr(n,e,t){const r=this;let u,i,l;return a;function a(o){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(o),p}function p(o){return o===33?(n.consume(o),s):o===47?(n.consume(o),B):o===63?(n.consume(o),b):en(o)?(n.consume(o),q):t(o)}function s(o){return o===45?(n.consume(o),m):o===91?(n.consume(o),i=0,C):en(o)?(n.consume(o),D):t(o)}function m(o){return o===45?(n.consume(o),h):t(o)}function f(o){return o===null?t(o):o===45?(n.consume(o),g):I(o)?(l=f,j(o)):(n.consume(o),f)}function g(o){return o===45?(n.consume(o),h):f(o)}function h(o){return o===62?U(o):o===45?g(o):f(o)}function C(o){const K="CDATA[";return o===K.charCodeAt(i++)?(n.consume(o),i===K.length?F:C):t(o)}function F(o){return o===null?t(o):o===93?(n.consume(o),E):I(o)?(l=F,j(o)):(n.consume(o),F)}function E(o){return o===93?(n.consume(o),y):F(o)}function y(o){return o===62?U(o):o===93?(n.consume(o),y):F(o)}function D(o){return o===null||o===62?U(o):I(o)?(l=D,j(o)):(n.consume(o),D)}function b(o){return o===null?t(o):o===63?(n.consume(o),L):I(o)?(l=b,j(o)):(n.consume(o),b)}function L(o){return o===62?U(o):b(o)}function B(o){return en(o)?(n.consume(o),x):t(o)}function x(o){return o===45||nn(o)?(n.consume(o),x):A(o)}function A(o){return I(o)?(l=A,j(o)):P(o)?(n.consume(o),A):U(o)}function q(o){return o===45||nn(o)?(n.consume(o),q):o===47||o===62||Y(o)?M(o):t(o)}function M(o){return o===47?(n.consume(o),U):o===58||o===95||en(o)?(n.consume(o),V):I(o)?(l=M,j(o)):P(o)?(n.consume(o),M):U(o)}function V(o){return o===45||o===46||o===58||o===95||nn(o)?(n.consume(o),V):S(o)}function S(o){return o===61?(n.consume(o),w):I(o)?(l=S,j(o)):P(o)?(n.consume(o),S):M(o)}function w(o){return o===null||o===60||o===61||o===62||o===96?t(o):o===34||o===39?(n.consume(o),u=o,O):I(o)?(l=w,j(o)):P(o)?(n.consume(o),w):(n.consume(o),H)}function O(o){return o===u?(n.consume(o),u=void 0,_):o===null?t(o):I(o)?(l=O,j(o)):(n.consume(o),O)}function H(o){return o===null||o===34||o===39||o===60||o===61||o===96?t(o):o===47||o===62||Y(o)?M(o):(n.consume(o),H)}function _(o){return o===47||o===62||Y(o)?M(o):t(o)}function U(o){return o===62?(n.consume(o),n.exit("htmlTextData"),n.exit("htmlText"),e):t(o)}function j(o){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),J}function J(o){return P(o)?R(n,un,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):un(o)}function un(o){return n.enter("htmlTextData"),l(o)}}const Kn={name:"labelEnd",resolveAll:kr,resolveTo:yr,tokenize:br},gr={tokenize:wr},dr={tokenize:Sr},xr={tokenize:Ir};function kr(n){let e=-1;const t=[];for(;++e<n.length;){const r=n[e][1];if(t.push(n[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const u=r.type==="labelImage"?4:2;r.type="data",e+=u}}return n.length!==t.length&&rn(n,0,n.length,t),n}function yr(n,e){let t=n.length,r=0,u,i,l,a;for(;t--;)if(u=n[t][1],i){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;n[t][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(l){if(n[t][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(i=t,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(l=t);const p={type:n[i][1].type==="labelLink"?"link":"image",start:{...n[i][1].start},end:{...n[n.length-1][1].end}},s={type:"label",start:{...n[i][1].start},end:{...n[l][1].end}},m={type:"labelText",start:{...n[i+r+2][1].end},end:{...n[l-2][1].start}};return a=[["enter",p,e],["enter",s,e]],a=G(a,n.slice(i+1,i+r+3)),a=G(a,[["enter",m,e]]),a=G(a,Jn(e.parser.constructs.insideSpan.null,n.slice(i+r+4,l-3),e)),a=G(a,[["exit",m,e],n[l-2],n[l-1],["exit",s,e]]),a=G(a,n.slice(l+1)),a=G(a,[["exit",p,e]]),rn(n,i,n.length,a),n}function br(n,e,t){const r=this;let u=r.events.length,i,l;for(;u--;)if((r.events[u][1].type==="labelImage"||r.events[u][1].type==="labelLink")&&!r.events[u][1]._balanced){i=r.events[u][1];break}return a;function a(g){return i?i._inactive?f(g):(l=r.parser.defined.includes(xn(r.sliceSerialize({start:i.end,end:r.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(g),n.exit("labelMarker"),n.exit("labelEnd"),p):t(g)}function p(g){return g===40?n.attempt(gr,m,l?m:f)(g):g===91?n.attempt(dr,m,l?s:f)(g):l?m(g):f(g)}function s(g){return n.attempt(xr,m,f)(g)}function m(g){return e(g)}function f(g){return i._balanced=!0,t(g)}}function wr(n,e,t){return r;function r(f){return n.enter("resource"),n.enter("resourceMarker"),n.consume(f),n.exit("resourceMarker"),u}function u(f){return Y(f)?In(n,i)(f):i(f)}function i(f){return f===41?m(f):Ct(n,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function l(f){return Y(f)?In(n,p)(f):m(f)}function a(f){return t(f)}function p(f){return f===34||f===39||f===40?Ft(n,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):m(f)}function s(f){return Y(f)?In(n,m)(f):m(f)}function m(f){return f===41?(n.enter("resourceMarker"),n.consume(f),n.exit("resourceMarker"),n.exit("resource"),e):t(f)}}function Sr(n,e,t){const r=this;return u;function u(a){return Tt.call(r,n,i,l,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(xn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(a):t(a)}function l(a){return t(a)}}function Ir(n,e,t){return r;function r(i){return n.enter("reference"),n.enter("referenceMarker"),n.consume(i),n.exit("referenceMarker"),u}function u(i){return i===93?(n.enter("referenceMarker"),n.consume(i),n.exit("referenceMarker"),n.exit("reference"),e):t(i)}}const Er={name:"labelStartImage",resolveAll:Kn.resolveAll,tokenize:zr};function zr(n,e,t){const r=this;return u;function u(a){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(a),n.exit("labelImageMarker"),i}function i(a){return a===91?(n.enter("labelMarker"),n.consume(a),n.exit("labelMarker"),n.exit("labelImage"),l):t(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):e(a)}}const Cr={name:"labelStartLink",resolveAll:Kn.resolveAll,tokenize:Tr};function Tr(n,e,t){const r=this;return u;function u(l){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(l),n.exit("labelMarker"),n.exit("labelLink"),i}function i(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):e(l)}}const Hn={name:"lineEnding",tokenize:Fr};function Fr(n,e){return t;function t(r){return n.enter("lineEnding"),n.consume(r),n.exit("lineEnding"),R(n,e,"linePrefix")}}const Ln={name:"thematicBreak",tokenize:Ar};function Ar(n,e,t){let r=0,u;return i;function i(s){return n.enter("thematicBreak"),l(s)}function l(s){return u=s,a(s)}function a(s){return s===u?(n.enter("thematicBreakSequence"),p(s)):r>=3&&(s===null||I(s))?(n.exit("thematicBreak"),e(s)):t(s)}function p(s){return s===u?(n.consume(s),r++,p):(n.exit("thematicBreakSequence"),P(s)?R(n,a,"whitespace")(s):a(s))}}const W={continuation:{tokenize:Br},exit:Nr,name:"list",tokenize:Pr},_r={partial:!0,tokenize:Rr},Lr={partial:!0,tokenize:Mr};function Pr(n,e,t){const r=this,u=r.events[r.events.length-1];let i=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,l=0;return a;function a(h){const C=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Yn(h)){if(r.containerState.type||(r.containerState.type=C,n.enter(C,{_container:!0})),C==="listUnordered")return n.enter("listItemPrefix"),h===42||h===45?n.check(Ln,t,s)(h):s(h);if(!r.interrupt||h===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(h)}return t(h)}function p(h){return Yn(h)&&++l<10?(n.consume(h),p):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(n.exit("listItemValue"),s(h)):t(h)}function s(h){return n.enter("listItemMarker"),n.consume(h),n.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,n.check(Pn,r.interrupt?t:m,n.attempt(_r,g,f))}function m(h){return r.containerState.initialBlankLine=!0,i++,g(h)}function f(h){return P(h)?(n.enter("listItemPrefixWhitespace"),n.consume(h),n.exit("listItemPrefixWhitespace"),g):t(h)}function g(h){return r.containerState.size=i+r.sliceSerialize(n.exit("listItemPrefix"),!0).length,e(h)}}function Br(n,e,t){const r=this;return r.containerState._closeFlow=void 0,n.check(Pn,u,i);function u(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,R(n,e,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!P(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,n.attempt(Lr,e,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,R(n,n.attempt(W,e,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Mr(n,e,t){const r=this;return R(n,u,"listItemIndent",r.containerState.size+1);function u(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?e(i):t(i)}}function Nr(n){n.exit(this.containerState.type)}function Rr(n,e,t){const r=this;return R(n,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(i){const l=r.events[r.events.length-1];return!P(i)&&l&&l[1].type==="listItemPrefixWhitespace"?e(i):t(i)}}const xt={name:"setextUnderline",resolveTo:Dr,tokenize:Vr};function Dr(n,e){let t=n.length,r,u,i;for(;t--;)if(n[t][0]==="enter"){if(n[t][1].type==="content"){r=t;break}n[t][1].type==="paragraph"&&(u=t)}else n[t][1].type==="content"&&n.splice(t,1),!i&&n[t][1].type==="definition"&&(i=t);const l={type:"setextHeading",start:{...n[r][1].start},end:{...n[n.length-1][1].end}};return n[u][1].type="setextHeadingText",i?(n.splice(u,0,["enter",l,e]),n.splice(i+1,0,["exit",n[r][1],e]),n[r][1].end={...n[i][1].end}):n[r][1]=l,n.push(["exit",l,e]),n}function Vr(n,e,t){const r=this;let u;return i;function i(s){let m=r.events.length,f;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){f=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(n.enter("setextHeadingLine"),u=s,l(s)):t(s)}function l(s){return n.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===u?(n.consume(s),a):(n.exit("setextHeadingLineSequence"),P(s)?R(n,p,"lineSuffix")(s):p(s))}function p(s){return s===null||I(s)?(n.exit("setextHeadingLine"),e(s)):t(s)}}const Or={tokenize:qr};function qr(n){const e=this,t=n.attempt(Pn,r,n.attempt(this.parser.constructs.flowInitial,u,R(n,n.attempt(this.parser.constructs.flow,u,n.attempt(We,u)),"linePrefix")));return t;function r(i){if(i===null){n.consume(i);return}return n.enter("lineEndingBlank"),n.consume(i),n.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function u(i){if(i===null){n.consume(i);return}return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),e.currentConstruct=void 0,t}}const Hr={resolveAll:_t()},jr=At("string"),Qr=At("text");function At(n){return{resolveAll:_t(n==="text"?Ur:void 0),tokenize:e};function e(t){const r=this,u=this.parser.constructs[n],i=t.attempt(u,l,a);return l;function l(m){return s(m)?i(m):a(m)}function a(m){if(m===null){t.consume(m);return}return t.enter("data"),t.consume(m),p}function p(m){return s(m)?(t.exit("data"),i(m)):(t.consume(m),p)}function s(m){if(m===null)return!0;const f=u[m];let g=-1;if(f)for(;++g<f.length;){const h=f[g];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function _t(n){return e;function e(t,r){let u=-1,i;for(;++u<=t.length;)i===void 0?t[u]&&t[u][1].type==="data"&&(i=u,u++):(!t[u]||t[u][1].type!=="data")&&(u!==i+2&&(t[i][1].end=t[u-1][1].end,t.splice(i+2,u-i-2),u=i+2),i=void 0);return n?n(t,r):t}}function Ur(n,e){let t=0;for(;++t<=n.length;)if((t===n.length||n[t][1].type==="lineEnding")&&n[t-1][1].type==="data"){const r=n[t-1][1],u=e.sliceStream(r);let i=u.length,l=-1,a=0,p;for(;i--;){const s=u[i];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)p=!0,a++;else if(s!==-1){i++;break}}if(e._contentTypeTextTrailing&&t===n.length&&(a=0),a){const s={type:t===n.length||p||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(n.splice(t,0,["enter",s,e],["exit",s,e]),t+=2)}t++}return n}const Wr={42:W,43:W,45:W,48:W,49:W,50:W,51:W,52:W,53:W,54:W,55:W,56:W,57:W,62:St},Yr={91:Je},$r={[-2]:qn,[-1]:qn,32:qn},Zr={35:er,42:Ln,45:[xt,Ln],60:lr,61:xt,95:Ln,96:gt,126:gt},Gr={38:Et,92:It},Jr={[-5]:Hn,[-4]:Hn,[-3]:Hn,33:Er,38:Et,42:$n,60:[Ce,pr],91:Cr,92:[nr,It],93:Kn,95:$n,96:Oe},Kr={null:[$n,Hr]},Xr={null:[42,95]},vr={null:[]},ni=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Xr,contentInitial:Yr,disable:vr,document:Wr,flow:Zr,flowInitial:$r,insideSpan:Kr,string:Gr,text:Jr},Symbol.toStringTag,{value:"Module"}));function ti(n,e,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const u={},i=[];let l=[],a=[];const p={attempt:A(B),check:A(x),consume:D,enter:b,exit:L,interrupt:A(x,{interrupt:!0})},s={code:null,containerState:{},defineSkip:F,events:[],now:C,parser:n,previous:null,sliceSerialize:g,sliceStream:h,write:f};let m=e.tokenize.call(s,p);return e.resolveAll&&i.push(e),s;function f(S){return l=G(l,S),E(),l[l.length-1]!==null?[]:(q(e,0),s.events=Jn(i,s.events,s),s.events)}function g(S,w){return ri(h(S),w)}function h(S){return ei(l,S)}function C(){const{_bufferIndex:S,_index:w,line:O,column:H,offset:_}=r;return{_bufferIndex:S,_index:w,line:O,column:H,offset:_}}function F(S){u[S.line]=S.column,V()}function E(){let S;for(;r._index<l.length;){const w=l[r._index];if(typeof w=="string")for(S=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===S&&r._bufferIndex<w.length;)y(w.charCodeAt(r._bufferIndex));else y(w)}}function y(S){m=m(S)}function D(S){I(S)?(r.line++,r.column=1,r.offset+=S===-3?2:1,V()):S!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=S}function b(S,w){const O=w||{};return O.type=S,O.start=C(),s.events.push(["enter",O,s]),a.push(O),O}function L(S){const w=a.pop();return w.end=C(),s.events.push(["exit",w,s]),w}function B(S,w){q(S,w.from)}function x(S,w){w.restore()}function A(S,w){return O;function O(H,_,U){let j,J,un,o;return Array.isArray(H)?ln(H):"tokenize"in H?ln([H]):K(H);function K(Q){return kn;function kn(on){const mn=on!==null&&Q[on],gn=on!==null&&Q.null,zn=[...Array.isArray(mn)?mn:mn?[mn]:[],...Array.isArray(gn)?gn:gn?[gn]:[]];return ln(zn)(on)}}function ln(Q){return j=Q,J=0,Q.length===0?U:c(Q[J])}function c(Q){return kn;function kn(on){return o=M(),un=Q,Q.partial||(s.currentConstruct=Q),Q.name&&s.parser.constructs.disable.null.includes(Q.name)?fn():Q.tokenize.call(w?Object.assign(Object.create(s),w):s,p,X,fn)(on)}}function X(Q){return S(un,o),_}function fn(Q){return o.restore(),++J<j.length?c(j[J]):U}}}function q(S,w){S.resolveAll&&!i.includes(S)&&i.push(S),S.resolve&&rn(s.events,w,s.events.length-w,S.resolve(s.events.slice(w),s)),S.resolveTo&&(s.events=S.resolveTo(s.events,s))}function M(){const S=C(),w=s.previous,O=s.currentConstruct,H=s.events.length,_=Array.from(a);return{from:H,restore:U};function U(){r=S,s.previous=w,s.currentConstruct=O,s.events.length=H,a=_,V()}}function V(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function ei(n,e){const t=e.start._index,r=e.start._bufferIndex,u=e.end._index,i=e.end._bufferIndex;let l;if(t===u)l=[n[t].slice(r,i)];else{if(l=n.slice(t,u),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}i>0&&l.push(n[u].slice(0,i))}return l}function ri(n,e){let t=-1;const r=[];let u;for(;++t<n.length;){const i=n[t];let l;if(typeof i=="string")l=i;else switch(i){case-5:{l="\r";break}case-4:{l=`
2
2
  `;break}case-3:{l=`\r
3
3
  `;break}case-2:{l=e?" ":" ";break}case-1:{if(!e&&u)continue;l=" ";break}default:l=String.fromCharCode(i)}u=i===-2,r.push(l)}return r.join("")}function ii(n){const r={constructs:he([ni,...(n||{}).extensions||[]]),content:u(ye),defined:[],document:u(we),flow:u(Or),lazy:{},string:u(jr),text:u(Qr)};return r;function u(i){return l;function l(a){return ti(r,i,a)}}}function ui(n){for(;!zt(n););return n}const kt=/[\0\t\n\r]/g;function li(){let n=1,e="",t=!0,r;return u;function u(i,l,a){const p=[];let s,m,f,g,h;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(l||void 0).decode(i)),f=0,e="",t&&(i.charCodeAt(0)===65279&&f++,t=void 0);f<i.length;){if(kt.lastIndex=f,s=kt.exec(i),g=s&&s.index!==void 0?s.index:i.length,h=i.charCodeAt(g),!s){e=i.slice(f);break}if(h===10&&f===g&&r)p.push(-3),r=void 0;else switch(r&&(p.push(-5),r=void 0),f<g&&(p.push(i.slice(f,g)),n+=g-f),h){case 0:{p.push(65533),n++;break}case 9:{for(m=Math.ceil(n/4)*4,p.push(-2);n++<m;)p.push(-1);break}case 10:{p.push(-4),n=1;break}default:r=!0,n=1}f=g+1}return a&&(r&&p.push(-5),e&&p.push(e),p.push(null)),p}}const ai=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function si(n){return n.replace(ai,oi)}function oi(n,e,t){if(e)return e;if(t.charCodeAt(0)===35){const u=t.charCodeAt(1),i=u===120||u===88;return wt(t.slice(i?2:1),i?16:10)}return Zn(t)||n}const Lt={}.hasOwnProperty;function ci(n,e,t){return typeof e!="string"&&(t=e,e=void 0),hi(t)(ui(ii(t).document().write(li()(n,e,!0))))}function hi(n){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(tt),autolinkProtocol:M,autolinkEmail:M,atxHeading:i(Xn),blockQuote:i(gn),characterEscape:M,characterReference:M,codeFenced:i(zn),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(zn,l),codeText:i(Bt,l),codeTextData:M,data:M,codeFlowValue:M,definition:i(Mt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(Nt),hardBreakEscape:i(vn),hardBreakTrailing:i(vn),htmlFlow:i(nt,l),htmlFlowData:M,htmlText:i(nt,l),htmlTextData:M,image:i(Rt),label:l,link:i(tt),listItem:i(Dt),listItemValue:g,listOrdered:i(et,f),listUnordered:i(et),paragraph:i(Vt),reference:c,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(Xn),strong:i(Ot),thematicBreak:i(Ht)},exit:{atxHeading:p(),atxHeadingSequence:B,autolink:p(),autolinkEmail:mn,autolinkProtocol:on,blockQuote:p(),characterEscapeValue:V,characterReferenceMarkerHexadecimal:fn,characterReferenceMarkerNumeric:fn,characterReferenceValue:Q,characterReference:kn,codeFenced:p(E),codeFencedFence:F,codeFencedFenceInfo:h,codeFencedFenceMeta:C,codeFlowValue:V,codeIndented:p(y),codeText:p(_),codeTextData:V,data:V,definition:p(),definitionDestinationString:L,definitionLabelString:D,definitionTitleString:b,emphasis:p(),hardBreakEscape:p(w),hardBreakTrailing:p(w),htmlFlow:p(O),htmlFlowData:V,htmlText:p(H),htmlTextData:V,image:p(j),label:un,labelText:J,lineEnding:S,link:p(U),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:X,resourceDestinationString:o,resourceTitleString:K,resource:ln,setextHeading:p(q),setextHeadingLineSequence:A,setextHeadingText:x,strong:p(),thematicBreak:p()}};Pt(e,(n||{}).mdastExtensions||[]);const t={};return r;function r(d){let k={type:"root",children:[]};const z={stack:[k],tokenStack:[],config:e,enter:a,exit:s,buffer:l,resume:m,data:t},T=[];let N=-1;for(;++N<d.length;)if(d[N][1].type==="listOrdered"||d[N][1].type==="listUnordered")if(d[N][0]==="enter")T.push(N);else{const v=T.pop();N=u(d,v,N)}for(N=-1;++N<d.length;){const v=e[d[N][0]];Lt.call(v,d[N][1].type)&&v[d[N][1].type].call(Object.assign({sliceSerialize:d[N][2].sliceSerialize},z),d[N][1])}if(z.tokenStack.length>0){const v=z.tokenStack[z.tokenStack.length-1];(v[1]||yt).call(z,void 0,v[0])}for(k.position={start:cn(d.length>0?d[0][1].start:{line:1,column:1,offset:0}),end:cn(d.length>0?d[d.length-2][1].end:{line:1,column:1,offset:0})},N=-1;++N<e.transforms.length;)k=e.transforms[N](k)||k;return k}function u(d,k,z){let T=k-1,N=-1,v=!1,pn,an,yn,bn;for(;++T<=z;){const Z=d[T];switch(Z[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Z[0]==="enter"?N++:N--,bn=void 0;break}case"lineEndingBlank":{Z[0]==="enter"&&(pn&&!bn&&!N&&!yn&&(yn=T),bn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:bn=void 0}if(!N&&Z[0]==="enter"&&Z[1].type==="listItemPrefix"||N===-1&&Z[0]==="exit"&&(Z[1].type==="listUnordered"||Z[1].type==="listOrdered")){if(pn){let dn=T;for(an=void 0;dn--;){const sn=d[dn];if(sn[1].type==="lineEnding"||sn[1].type==="lineEndingBlank"){if(sn[0]==="exit")continue;an&&(d[an][1].type="lineEndingBlank",v=!0),sn[1].type="lineEnding",an=dn}else if(!(sn[1].type==="linePrefix"||sn[1].type==="blockQuotePrefix"||sn[1].type==="blockQuotePrefixWhitespace"||sn[1].type==="blockQuoteMarker"||sn[1].type==="listItemIndent"))break}yn&&(!an||yn<an)&&(pn._spread=!0),pn.end=Object.assign({},an?d[an][1].start:Z[1].end),d.splice(an||T,0,["exit",pn,Z[2]]),T++,z++}if(Z[1].type==="listItemPrefix"){const dn={type:"listItem",_spread:!1,start:Object.assign({},Z[1].start),end:void 0};pn=dn,d.splice(T,0,["enter",dn,Z[2]]),T++,z++,yn=void 0,bn=!0}}}return d[k][1]._spread=v,z}function i(d,k){return z;function z(T){a.call(this,d(T),T),k&&k.call(this,T)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(d,k,z){this.stack[this.stack.length-1].children.push(d),this.stack.push(d),this.tokenStack.push([k,z||void 0]),d.position={start:cn(k.start),end:void 0}}function p(d){return k;function k(z){d&&d.call(this,z),s.call(this,z)}}function s(d,k){const z=this.stack.pop(),T=this.tokenStack.pop();if(T)T[0].type!==d.type&&(k?k.call(this,d,T[0]):(T[1]||yt).call(this,d,T[0]));else throw new Error("Cannot close `"+d.type+"` ("+Sn({start:d.start,end:d.end})+"): it’s not open");z.position.end=cn(d.end)}function m(){return oe(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function g(d){if(this.data.expectingFirstListItemValue){const k=this.stack[this.stack.length-2];k.start=Number.parseInt(this.sliceSerialize(d),10),this.data.expectingFirstListItemValue=void 0}}function h(){const d=this.resume(),k=this.stack[this.stack.length-1];k.lang=d}function C(){const d=this.resume(),k=this.stack[this.stack.length-1];k.meta=d}function F(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const d=this.resume(),k=this.stack[this.stack.length-1];k.value=d.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const d=this.resume(),k=this.stack[this.stack.length-1];k.value=d.replace(/(\r?\n|\r)$/g,"")}function D(d){const k=this.resume(),z=this.stack[this.stack.length-1];z.label=k,z.identifier=xn(this.sliceSerialize(d)).toLowerCase()}function b(){const d=this.resume(),k=this.stack[this.stack.length-1];k.title=d}function L(){const d=this.resume(),k=this.stack[this.stack.length-1];k.url=d}function B(d){const k=this.stack[this.stack.length-1];if(!k.depth){const z=this.sliceSerialize(d).length;k.depth=z}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function A(d){const k=this.stack[this.stack.length-1];k.depth=this.sliceSerialize(d).codePointAt(0)===61?1:2}function q(){this.data.setextHeadingSlurpLineEnding=void 0}function M(d){const z=this.stack[this.stack.length-1].children;let T=z[z.length-1];(!T||T.type!=="text")&&(T=qt(),T.position={start:cn(d.start),end:void 0},z.push(T)),this.stack.push(T)}function V(d){const k=this.stack.pop();k.value+=this.sliceSerialize(d),k.position.end=cn(d.end)}function S(d){const k=this.stack[this.stack.length-1];if(this.data.atHardBreak){const z=k.children[k.children.length-1];z.position.end=cn(d.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(k.type)&&(M.call(this,d),V.call(this,d))}function w(){this.data.atHardBreak=!0}function O(){const d=this.resume(),k=this.stack[this.stack.length-1];k.value=d}function H(){const d=this.resume(),k=this.stack[this.stack.length-1];k.value=d}function _(){const d=this.resume(),k=this.stack[this.stack.length-1];k.value=d}function U(){const d=this.stack[this.stack.length-1];if(this.data.inReference){const k=this.data.referenceType||"shortcut";d.type+="Reference",d.referenceType=k,delete d.url,delete d.title}else delete d.identifier,delete d.label;this.data.referenceType=void 0}function j(){const d=this.stack[this.stack.length-1];if(this.data.inReference){const k=this.data.referenceType||"shortcut";d.type+="Reference",d.referenceType=k,delete d.url,delete d.title}else delete d.identifier,delete d.label;this.data.referenceType=void 0}function J(d){const k=this.sliceSerialize(d),z=this.stack[this.stack.length-2];z.label=si(k),z.identifier=xn(k).toLowerCase()}function un(){const d=this.stack[this.stack.length-1],k=this.resume(),z=this.stack[this.stack.length-1];if(this.data.inReference=!0,z.type==="link"){const T=d.children;z.children=T}else z.alt=k}function o(){const d=this.resume(),k=this.stack[this.stack.length-1];k.url=d}function K(){const d=this.resume(),k=this.stack[this.stack.length-1];k.title=d}function ln(){this.data.inReference=void 0}function c(){this.data.referenceType="collapsed"}function X(d){const k=this.resume(),z=this.stack[this.stack.length-1];z.label=k,z.identifier=xn(this.sliceSerialize(d)).toLowerCase(),this.data.referenceType="full"}function fn(d){this.data.characterReferenceType=d.type}function Q(d){const k=this.sliceSerialize(d),z=this.data.characterReferenceType;let T;z?(T=wt(k,z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):T=Zn(k);const N=this.stack[this.stack.length-1];N.value+=T}function kn(d){const k=this.stack.pop();k.position.end=cn(d.end)}function on(d){V.call(this,d);const k=this.stack[this.stack.length-1];k.url=this.sliceSerialize(d)}function mn(d){V.call(this,d);const k=this.stack[this.stack.length-1];k.url="mailto:"+this.sliceSerialize(d)}function gn(){return{type:"blockquote",children:[]}}function zn(){return{type:"code",lang:null,meta:null,value:""}}function Bt(){return{type:"inlineCode",value:""}}function Mt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Nt(){return{type:"emphasis",children:[]}}function Xn(){return{type:"heading",depth:0,children:[]}}function vn(){return{type:"break"}}function nt(){return{type:"html",value:""}}function Rt(){return{type:"image",title:null,url:"",alt:null}}function tt(){return{type:"link",title:null,url:"",children:[]}}function et(d){return{type:"list",ordered:d.type==="listOrdered",start:null,spread:d._spread,children:[]}}function Dt(d){return{type:"listItem",spread:d._spread,checked:null,children:[]}}function Vt(){return{type:"paragraph",children:[]}}function Ot(){return{type:"strong",children:[]}}function qt(){return{type:"text",value:""}}function Ht(){return{type:"thematicBreak"}}}function cn(n){return{line:n.line,column:n.column,offset:n.offset}}function Pt(n,e){let t=-1;for(;++t<e.length;){const r=e[t];Array.isArray(r)?Pt(n,r):fi(n,r)}}function fi(n,e){let t;for(t in e)if(Lt.call(e,t))switch(t){case"canContainEols":{const r=e[t];r&&n[t].push(...r);break}case"transforms":{const r=e[t];r&&n[t].push(...r);break}case"enter":case"exit":{const r=e[t];r&&Object.assign(n[t],r);break}}}function yt(n,e){throw n?new Error("Cannot close `"+n.type+"` ("+Sn({start:n.start,end:n.end})+"): a different token (`"+e.type+"`, "+Sn({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Sn({start:e.start,end:e.end})+") is still open")}function pi(n){const e=this;e.parser=t;function t(r){return ci(r,{...e.data("settings"),...n,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}const _n=n=>{let e="";const t=r=>{if(r.type==="text"||r.type==="inlineCode"||r.type==="code"){e+=r.value;return}if(r.type==="link"){e+=`${r.url}`;return}r.children&&r.children.length>0&&r.children.forEach(u=>{t(u)})};return t(n),e},mi=(n,e)=>{if(n.type==="heading"){const t=n.depth;for(let r=t-1;r>=0;r--)if(e[`${r}`])return e[`${r}`]}return e[0]},ki=(n,e)=>{var h,C,F;const r=ie().use(pi).parse(n);let u=!1;const i=(h=r.children)==null?void 0:h.find(E=>{if(E.type==="heading")return E});i&&((C=r.children)==null?void 0:C.filter(E=>E.type==="heading"&&i&&E.depth===i.depth).length)===1&&(u=!0);const l=_n(i),a=e||u&&l||"中心主题",p=Cn(null,!0,!1,Tn(a)),s=Fn(a,p.width,p.height,{layout:jt.right});s.isRoot=!0,s.type="mindmap";const m={0:s};let f=s;const g=(E,y=!1)=>{var D;if(!(u&&!e&&E===i))if(E.type==="heading"){const b=mi(E,m),L=_n(E);if(!L)return;const{width:B,height:x}=Cn(null,!1,!1,Tn(L)),A=Fn(L,B,x,{});b.children.push(A),m[`${E.depth}`]=A,f=A}else if(E.type==="list")(D=E.children)==null||D.forEach(b=>{g(b)});else if(E.type==="listItem"){if(E.children&&E.children.length>1){const A=f;E.children.forEach((q,M)=>{g(q,M===0)}),f=A;return}const b=_n(E);if(!b)return;const{width:L,height:B}=Cn(null,!1,!1,Tn(b)),x=Fn(b,L,B,{});f.children.push(x)}else{const b=_n(E);if(!b)return;const{width:L,height:B}=Cn(null,!1,!1,Tn(b)),x=Fn(b,L,B,{});f.children.push(x),y&&(f=x)}};return(F=r.children)==null||F.forEach(E=>{g(E)}),s};export{mi as getParentMindNode,_n as getTextFromNode,ki as parseMarkdownToDrawnix};
@@ -1 +1 @@
1
- import{G as A}from"./graph-BF0dmYuW.js";import{l as H}from"./layout-BLWuewAI.js";import{A as N}from"./index-B4TbOAXp.js";import{c as V}from"./clone-C7rIei2X.js";import{m as $}from"./min--FlqSAVj.js";import{i as U,u as W,s as _,c as q,b as z,g as D,d as O,a as K,p as Q,e as B,f as J,h as Y,j as Z}from"./edges-e0da2a9e-z3zQt4WY.js";import{l as s,g as T,r as S}from"./index-DH-K1DNV.js";import{c as I}from"./createText-2e5e7dd3-DyHEupOm.js";import{s as L}from"./Serializer-C6C_UTa3.js";function y(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:tt(e),edges:et(e)};return N(e.graph())||(t.value=V(e.graph())),t}function tt(e){return $(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),i={v:t};return N(n)||(i.value=n),N(r)||(i.parent=r),i})}function et(e){return $(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return N(t.name)||(r.name=t.name),N(n)||(r.value=n),r})}let l={},g={},R={};const nt=()=>{g={},R={},l={}},p=(e,t)=>(s.trace("In isDescendant",t," ",e," = ",g[t].includes(e)),!!g[t].includes(e)),it=(e,t)=>(s.info("Descendants of ",t," is ",g[t]),s.info("Edge is ",e),e.v===t||e.w===t?!1:g[t]?g[t].includes(e.v)||p(e.v,t)||p(e.w,t)||g[t].includes(e.w):(s.debug("Tilt, ",t,",not in descendants"),!1)),P=(e,t,n,r)=>{s.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];e!==r&&i.push(e),s.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)P(a,t,n,r);else{const d=t.node(a);s.info("cp ",a," to ",r," with parent ",e),n.setNode(a,d),r!==t.parent(a)&&(s.warn("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==r&&a!==e?(s.debug("Setting parent",a,e),n.setParent(a,e)):(s.info("In copy ",e,"root",r,"data",t.node(e),r),s.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==r,"node!==clusterId",a!==e));const u=t.edges(a);s.debug("Copying Edges",u),u.forEach(f=>{s.info("Edge",f);const h=t.edge(f.v,f.w,f.name);s.info("Edge data",h,r);try{it(f,r)?(s.info("Copying as ",f.v,f.w,h,f.name),n.setEdge(f.v,f.w,h,f.name),s.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):s.info("Skipping copy of edge ",f.v,"-->",f.w," rootId: ",r," clusterId:",e)}catch(w){s.error(w)}})}s.debug("Removing node",a),t.removeNode(a)})},k=(e,t)=>{const n=t.children(e);let r=[...n];for(const i of n)R[i]=e,r=[...r,...k(i,t)];return r},C=(e,t)=>{s.trace("Searching",e);const n=t.children(e);if(s.trace("Searching children of id ",e,n),n.length<1)return s.trace("This is a valid node",e),e;for(const r of n){const i=C(r,t);if(i)return s.trace("Found replacement for",e," => ",i),i}},X=e=>!l[e]||!l[e].externalConnections?e:l[e]?l[e].id:e,st=(e,t)=>{if(!e||t>10){s.debug("Opting out, no graph ");return}else s.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(s.warn("Cluster identified",n," Replacement id in edges: ",C(n,e)),g[n]=k(n,e),l[n]={id:C(n,e),clusterData:e.node(n)})}),e.nodes().forEach(function(n){const r=e.children(n),i=e.edges();r.length>0?(s.debug("Cluster identified",n,g),i.forEach(a=>{if(a.v!==n&&a.w!==n){const d=p(a.v,n),u=p(a.w,n);d^u&&(s.warn("Edge: ",a," leaves cluster ",n),s.warn("Descendants of XXX ",n,": ",g[n]),l[n].externalConnections=!0)}})):s.debug("Not a cluster ",n,g)});for(let n of Object.keys(l)){const r=l[n].id,i=e.parent(r);i!==n&&l[i]&&!l[i].externalConnections&&(l[n].id=i)}e.edges().forEach(function(n){const r=e.edge(n);s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,a=n.w;if(s.warn("Fix XXX",l,"ids:",n.v,n.w,"Translating: ",l[n.v]," --- ",l[n.w]),l[n.v]&&l[n.w]&&l[n.v]===l[n.w]){s.warn("Fixing and trixing link to self - removing XXX",n.v,n.w,n.name),s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name);const d=n.w+"---"+n.v;e.setNode(d,{domId:d,id:d,labelStyle:"",labelText:r.label,padding:0,shape:"labelRect",style:""});const u=structuredClone(r),f=structuredClone(r);u.label="",u.arrowTypeEnd="none",f.label="",u.fromCluster=n.v,f.toCluster=n.v,e.setEdge(i,d,u,n.name+"-cyclic-special"),e.setEdge(d,a,f,n.name+"-cyclic-special")}else if(l[n.v]||l[n.w]){if(s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const d=e.parent(i);l[d].externalConnections=!0,r.fromCluster=n.v}if(a!==n.w){const d=e.parent(a);l[d].externalConnections=!0,r.toCluster=n.w}s.warn("Fix Replacing with XXX",i,a,n.name),e.setEdge(i,a,r,n.name)}}),s.warn("Adjusted Graph",y(e)),F(e,0),s.trace(l)},F=(e,t)=>{if(s.warn("extractor - ",t,y(e),e.children("D")),t>10){s.error("Bailing out");return}let n=e.nodes(),r=!1;for(const i of n){const a=e.children(i);r=r||a.length>0}if(!r){s.debug("Done, no node has children",e.nodes());return}s.debug("Nodes = ",n,t);for(const i of n)if(s.debug("Extracting node",i,l,l[i]&&!l[i].externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!l[i])s.debug("Not a cluster",i,t);else if(!l[i].externalConnections&&e.children(i)&&e.children(i).length>0){s.warn("Cluster without external connections, without a parent and with children",i,t);let d=e.graph().rankdir==="TB"?"LR":"TB";l[i]&&l[i].clusterData&&l[i].clusterData.dir&&(d=l[i].clusterData.dir,s.warn("Fixing dir",l[i].clusterData.dir,d));const u=new A({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});s.warn("Old graph before copy",y(e)),P(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:l[i].clusterData,labelText:l[i].labelText,graph:u}),s.warn("New graph after copy node: (",i,")",y(u)),s.debug("Old graph after copy",y(e))}else s.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!l[i].externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),s.debug(l);n=e.nodes(),s.warn("New list of nodes",n);for(const i of n){const a=e.node(i);s.warn(" Now next level",i,a),a.clusterNode&&F(a.graph,t+1)}},G=(e,t)=>{if(t.length===0)return[];let n=Object.assign(t);return t.forEach(r=>{const i=e.children(r),a=G(e,i);n=[...n,...a]}),n},rt=e=>G(e,e.children()),at=(e,t)=>{s.info("Creating subgraph rect for ",t.id,t);const n=T(),r=e.insert("g").attr("class","cluster"+(t.class?" "+t.class:"")).attr("id",t.id),i=r.insert("rect",":first-child"),a=S(n.flowchart.htmlLabels),d=r.insert("g").attr("class","cluster-label"),u=t.labelType==="markdown"?I(d,t.labelText,{style:t.labelStyle,useHtmlLabels:a}):d.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}const h=0*t.padding,w=h/2,m=t.width<=f.width+h?f.width+h:t.width;t.width<=f.width+h?t.diff=(f.width-t.width)/2-t.padding/2:t.diff=-t.padding/2,s.trace("Data ",t,JSON.stringify(t)),i.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-m/2).attr("y",t.y-t.height/2-w).attr("width",m).attr("height",t.height+h);const{subGraphTitleTopMargin:v}=D(n);a?d.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2+v})`):d.attr("transform",`translate(${t.x}, ${t.y-t.height/2+v})`);const x=i.node().getBBox();return t.width=x.width,t.height=x.height,t.intersect=function(c){return B(t,c)},r},ct=(e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.intersect=function(u){return B(t,u)},n},ot=(e,t)=>{const n=T(),r=e.insert("g").attr("class",t.classes).attr("id",t.id),i=r.insert("rect",":first-child"),a=r.insert("g").attr("class","cluster-label"),d=r.append("rect"),u=a.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}f=u.getBBox();const h=0*t.padding,w=h/2,m=t.width<=f.width+t.padding?f.width+t.padding:t.width;t.width<=f.width+t.padding?t.diff=(f.width+t.padding*0-t.width)/2:t.diff=-t.padding/2,i.attr("class","outer").attr("x",t.x-m/2-w).attr("y",t.y-t.height/2-w).attr("width",m+h).attr("height",t.height+h),d.attr("class","inner").attr("x",t.x-m/2-w).attr("y",t.y-t.height/2-w+f.height-1).attr("width",m+h).attr("height",t.height+h-f.height-3);const{subGraphTitleTopMargin:v}=D(n);a.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2-t.padding/3+(S(n.flowchart.htmlLabels)?5:3)+v})`);const x=i.node().getBBox();return t.height=x.height,t.intersect=function(c){return B(t,c)},r},lt=(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("class","divider").attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2).attr("width",t.width+i).attr("height",t.height+i);const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.diff=-t.padding/2,t.intersect=function(u){return B(t,u)},n},ft={rect:at,roundedWithTitle:ot,noteGroup:ct,divider:lt};let j={};const dt=(e,t)=>{s.trace("Inserting cluster");const n=t.shape||"rect";j[t.id]=ft[n](e,t)},ut=()=>{j={}},M=async(e,t,n,r,i,a)=>{s.info("Graph in recursive render: XXX",y(t),i);const d=t.graph().rankdir;s.trace("Dir in recursive render - dir:",d);const u=e.insert("g").attr("class","root");t.nodes()?s.info("Recursive render XXX",t.nodes()):s.info("No nodes found for",t),t.edges().length>0&&s.trace("Recursive edges",t.edge(t.edges()[0]));const f=u.insert("g").attr("class","clusters"),h=u.insert("g").attr("class","edgePaths"),w=u.insert("g").attr("class","edgeLabels"),m=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(c){const o=t.node(c);if(i!==void 0){const b=JSON.parse(JSON.stringify(i.clusterData));s.info("Setting data for cluster XXX (",c,") ",b,i),t.setNode(i.id,b),t.parent(c)||(s.trace("Setting parent",c,i.id),t.setParent(c,i.id,b))}if(s.info("(Insert) Node XXX"+c+": "+JSON.stringify(t.node(c))),o&&o.clusterNode){s.info("Cluster identified",c,o.width,t.node(c));const b=await M(m,o.graph,n,r,t.node(c),a),E=b.elem;W(o,E),o.diff=b.diff||0,s.info("Node bounds (abc123)",c,o,o.width,o.x,o.y),_(E,o),s.warn("Recursive render complete ",E,o)}else t.children(c).length>0?(s.info("Cluster - the non recursive path XXX",c,o.id,o,t),s.info(C(o.id,t)),l[o.id]={id:C(o.id,t),node:o}):(s.info("Node - the non recursive path",c,o.id,o),await q(m,t.node(c),d))})),t.edges().forEach(function(c){const o=t.edge(c.v,c.w,c.name);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c)),s.info("Edge "+c.v+" -> "+c.w+": ",c," ",JSON.stringify(t.edge(c))),s.info("Fix",l,"ids:",c.v,c.w,"Translating: ",l[c.v],l[c.w]),z(w,o)}),t.edges().forEach(function(c){s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c))}),s.info("#############################################"),s.info("### Layout ###"),s.info("#############################################"),s.info(t),H(t),s.info("Graph after layout:",y(t));let v=0;const{subGraphTitleTotalMargin:x}=D(a);return rt(t).forEach(function(c){const o=t.node(c);s.info("Position "+c+": "+JSON.stringify(t.node(c))),s.info("Position "+c+": ("+o.x,","+o.y,") width: ",o.width," height: ",o.height),o&&o.clusterNode?(o.y+=x,O(o)):t.children(c).length>0?(o.height+=x,dt(f,o),l[o.id].node=o):(o.y+=x/2,O(o))}),t.edges().forEach(function(c){const o=t.edge(c);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(o),o),o.points.forEach(E=>E.y+=x/2);const b=K(h,c,o,l,n,t,r);Q(o,b)}),t.nodes().forEach(function(c){const o=t.node(c);s.info(c,o.type,o.diff),o.type==="group"&&(v=o.diff)}),{elem:u,diff:v}},Nt=async(e,t,n,r,i)=>{U(e,n,r,i),Y(),Z(),ut(),nt(),s.warn("Graph at first:",JSON.stringify(y(t))),st(t),s.warn("Graph after:",JSON.stringify(y(t)));const a=T();await M(e,t,r,i,void 0,a)};export{Nt as r};
1
+ import{G as A}from"./graph-BuEKTPWn.js";import{l as H}from"./layout-LlEK-Af9.js";import{A as N}from"./index-BXp-gQxZ.js";import{c as V}from"./clone-B85cFPZq.js";import{m as $}from"./min-BqFoyXNs.js";import{i as U,u as W,s as _,c as q,b as z,g as D,d as O,a as K,p as Q,e as B,f as J,h as Y,j as Z}from"./edges-e0da2a9e-DyDxahje.js";import{l as s,g as T,r as S}from"./index-CljpoCtv.js";import{c as I}from"./createText-2e5e7dd3-Cpz7ChtF.js";import{s as L}from"./Serializer-BBbyVbcD.js";function y(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:tt(e),edges:et(e)};return N(e.graph())||(t.value=V(e.graph())),t}function tt(e){return $(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),i={v:t};return N(n)||(i.value=n),N(r)||(i.parent=r),i})}function et(e){return $(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return N(t.name)||(r.name=t.name),N(n)||(r.value=n),r})}let l={},g={},R={};const nt=()=>{g={},R={},l={}},p=(e,t)=>(s.trace("In isDescendant",t," ",e," = ",g[t].includes(e)),!!g[t].includes(e)),it=(e,t)=>(s.info("Descendants of ",t," is ",g[t]),s.info("Edge is ",e),e.v===t||e.w===t?!1:g[t]?g[t].includes(e.v)||p(e.v,t)||p(e.w,t)||g[t].includes(e.w):(s.debug("Tilt, ",t,",not in descendants"),!1)),P=(e,t,n,r)=>{s.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];e!==r&&i.push(e),s.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)P(a,t,n,r);else{const d=t.node(a);s.info("cp ",a," to ",r," with parent ",e),n.setNode(a,d),r!==t.parent(a)&&(s.warn("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==r&&a!==e?(s.debug("Setting parent",a,e),n.setParent(a,e)):(s.info("In copy ",e,"root",r,"data",t.node(e),r),s.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==r,"node!==clusterId",a!==e));const u=t.edges(a);s.debug("Copying Edges",u),u.forEach(f=>{s.info("Edge",f);const h=t.edge(f.v,f.w,f.name);s.info("Edge data",h,r);try{it(f,r)?(s.info("Copying as ",f.v,f.w,h,f.name),n.setEdge(f.v,f.w,h,f.name),s.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):s.info("Skipping copy of edge ",f.v,"-->",f.w," rootId: ",r," clusterId:",e)}catch(w){s.error(w)}})}s.debug("Removing node",a),t.removeNode(a)})},k=(e,t)=>{const n=t.children(e);let r=[...n];for(const i of n)R[i]=e,r=[...r,...k(i,t)];return r},C=(e,t)=>{s.trace("Searching",e);const n=t.children(e);if(s.trace("Searching children of id ",e,n),n.length<1)return s.trace("This is a valid node",e),e;for(const r of n){const i=C(r,t);if(i)return s.trace("Found replacement for",e," => ",i),i}},X=e=>!l[e]||!l[e].externalConnections?e:l[e]?l[e].id:e,st=(e,t)=>{if(!e||t>10){s.debug("Opting out, no graph ");return}else s.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(s.warn("Cluster identified",n," Replacement id in edges: ",C(n,e)),g[n]=k(n,e),l[n]={id:C(n,e),clusterData:e.node(n)})}),e.nodes().forEach(function(n){const r=e.children(n),i=e.edges();r.length>0?(s.debug("Cluster identified",n,g),i.forEach(a=>{if(a.v!==n&&a.w!==n){const d=p(a.v,n),u=p(a.w,n);d^u&&(s.warn("Edge: ",a," leaves cluster ",n),s.warn("Descendants of XXX ",n,": ",g[n]),l[n].externalConnections=!0)}})):s.debug("Not a cluster ",n,g)});for(let n of Object.keys(l)){const r=l[n].id,i=e.parent(r);i!==n&&l[i]&&!l[i].externalConnections&&(l[n].id=i)}e.edges().forEach(function(n){const r=e.edge(n);s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,a=n.w;if(s.warn("Fix XXX",l,"ids:",n.v,n.w,"Translating: ",l[n.v]," --- ",l[n.w]),l[n.v]&&l[n.w]&&l[n.v]===l[n.w]){s.warn("Fixing and trixing link to self - removing XXX",n.v,n.w,n.name),s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name);const d=n.w+"---"+n.v;e.setNode(d,{domId:d,id:d,labelStyle:"",labelText:r.label,padding:0,shape:"labelRect",style:""});const u=structuredClone(r),f=structuredClone(r);u.label="",u.arrowTypeEnd="none",f.label="",u.fromCluster=n.v,f.toCluster=n.v,e.setEdge(i,d,u,n.name+"-cyclic-special"),e.setEdge(d,a,f,n.name+"-cyclic-special")}else if(l[n.v]||l[n.w]){if(s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const d=e.parent(i);l[d].externalConnections=!0,r.fromCluster=n.v}if(a!==n.w){const d=e.parent(a);l[d].externalConnections=!0,r.toCluster=n.w}s.warn("Fix Replacing with XXX",i,a,n.name),e.setEdge(i,a,r,n.name)}}),s.warn("Adjusted Graph",y(e)),F(e,0),s.trace(l)},F=(e,t)=>{if(s.warn("extractor - ",t,y(e),e.children("D")),t>10){s.error("Bailing out");return}let n=e.nodes(),r=!1;for(const i of n){const a=e.children(i);r=r||a.length>0}if(!r){s.debug("Done, no node has children",e.nodes());return}s.debug("Nodes = ",n,t);for(const i of n)if(s.debug("Extracting node",i,l,l[i]&&!l[i].externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!l[i])s.debug("Not a cluster",i,t);else if(!l[i].externalConnections&&e.children(i)&&e.children(i).length>0){s.warn("Cluster without external connections, without a parent and with children",i,t);let d=e.graph().rankdir==="TB"?"LR":"TB";l[i]&&l[i].clusterData&&l[i].clusterData.dir&&(d=l[i].clusterData.dir,s.warn("Fixing dir",l[i].clusterData.dir,d));const u=new A({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});s.warn("Old graph before copy",y(e)),P(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:l[i].clusterData,labelText:l[i].labelText,graph:u}),s.warn("New graph after copy node: (",i,")",y(u)),s.debug("Old graph after copy",y(e))}else s.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!l[i].externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),s.debug(l);n=e.nodes(),s.warn("New list of nodes",n);for(const i of n){const a=e.node(i);s.warn(" Now next level",i,a),a.clusterNode&&F(a.graph,t+1)}},G=(e,t)=>{if(t.length===0)return[];let n=Object.assign(t);return t.forEach(r=>{const i=e.children(r),a=G(e,i);n=[...n,...a]}),n},rt=e=>G(e,e.children()),at=(e,t)=>{s.info("Creating subgraph rect for ",t.id,t);const n=T(),r=e.insert("g").attr("class","cluster"+(t.class?" "+t.class:"")).attr("id",t.id),i=r.insert("rect",":first-child"),a=S(n.flowchart.htmlLabels),d=r.insert("g").attr("class","cluster-label"),u=t.labelType==="markdown"?I(d,t.labelText,{style:t.labelStyle,useHtmlLabels:a}):d.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}const h=0*t.padding,w=h/2,m=t.width<=f.width+h?f.width+h:t.width;t.width<=f.width+h?t.diff=(f.width-t.width)/2-t.padding/2:t.diff=-t.padding/2,s.trace("Data ",t,JSON.stringify(t)),i.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-m/2).attr("y",t.y-t.height/2-w).attr("width",m).attr("height",t.height+h);const{subGraphTitleTopMargin:v}=D(n);a?d.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2+v})`):d.attr("transform",`translate(${t.x}, ${t.y-t.height/2+v})`);const x=i.node().getBBox();return t.width=x.width,t.height=x.height,t.intersect=function(c){return B(t,c)},r},ct=(e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.intersect=function(u){return B(t,u)},n},ot=(e,t)=>{const n=T(),r=e.insert("g").attr("class",t.classes).attr("id",t.id),i=r.insert("rect",":first-child"),a=r.insert("g").attr("class","cluster-label"),d=r.append("rect"),u=a.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}f=u.getBBox();const h=0*t.padding,w=h/2,m=t.width<=f.width+t.padding?f.width+t.padding:t.width;t.width<=f.width+t.padding?t.diff=(f.width+t.padding*0-t.width)/2:t.diff=-t.padding/2,i.attr("class","outer").attr("x",t.x-m/2-w).attr("y",t.y-t.height/2-w).attr("width",m+h).attr("height",t.height+h),d.attr("class","inner").attr("x",t.x-m/2-w).attr("y",t.y-t.height/2-w+f.height-1).attr("width",m+h).attr("height",t.height+h-f.height-3);const{subGraphTitleTopMargin:v}=D(n);a.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2-t.padding/3+(S(n.flowchart.htmlLabels)?5:3)+v})`);const x=i.node().getBBox();return t.height=x.height,t.intersect=function(c){return B(t,c)},r},lt=(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("class","divider").attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2).attr("width",t.width+i).attr("height",t.height+i);const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.diff=-t.padding/2,t.intersect=function(u){return B(t,u)},n},ft={rect:at,roundedWithTitle:ot,noteGroup:ct,divider:lt};let j={};const dt=(e,t)=>{s.trace("Inserting cluster");const n=t.shape||"rect";j[t.id]=ft[n](e,t)},ut=()=>{j={}},M=async(e,t,n,r,i,a)=>{s.info("Graph in recursive render: XXX",y(t),i);const d=t.graph().rankdir;s.trace("Dir in recursive render - dir:",d);const u=e.insert("g").attr("class","root");t.nodes()?s.info("Recursive render XXX",t.nodes()):s.info("No nodes found for",t),t.edges().length>0&&s.trace("Recursive edges",t.edge(t.edges()[0]));const f=u.insert("g").attr("class","clusters"),h=u.insert("g").attr("class","edgePaths"),w=u.insert("g").attr("class","edgeLabels"),m=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(c){const o=t.node(c);if(i!==void 0){const b=JSON.parse(JSON.stringify(i.clusterData));s.info("Setting data for cluster XXX (",c,") ",b,i),t.setNode(i.id,b),t.parent(c)||(s.trace("Setting parent",c,i.id),t.setParent(c,i.id,b))}if(s.info("(Insert) Node XXX"+c+": "+JSON.stringify(t.node(c))),o&&o.clusterNode){s.info("Cluster identified",c,o.width,t.node(c));const b=await M(m,o.graph,n,r,t.node(c),a),E=b.elem;W(o,E),o.diff=b.diff||0,s.info("Node bounds (abc123)",c,o,o.width,o.x,o.y),_(E,o),s.warn("Recursive render complete ",E,o)}else t.children(c).length>0?(s.info("Cluster - the non recursive path XXX",c,o.id,o,t),s.info(C(o.id,t)),l[o.id]={id:C(o.id,t),node:o}):(s.info("Node - the non recursive path",c,o.id,o),await q(m,t.node(c),d))})),t.edges().forEach(function(c){const o=t.edge(c.v,c.w,c.name);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c)),s.info("Edge "+c.v+" -> "+c.w+": ",c," ",JSON.stringify(t.edge(c))),s.info("Fix",l,"ids:",c.v,c.w,"Translating: ",l[c.v],l[c.w]),z(w,o)}),t.edges().forEach(function(c){s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c))}),s.info("#############################################"),s.info("### Layout ###"),s.info("#############################################"),s.info(t),H(t),s.info("Graph after layout:",y(t));let v=0;const{subGraphTitleTotalMargin:x}=D(a);return rt(t).forEach(function(c){const o=t.node(c);s.info("Position "+c+": "+JSON.stringify(t.node(c))),s.info("Position "+c+": ("+o.x,","+o.y,") width: ",o.width," height: ",o.height),o&&o.clusterNode?(o.y+=x,O(o)):t.children(c).length>0?(o.height+=x,dt(f,o),l[o.id].node=o):(o.y+=x/2,O(o))}),t.edges().forEach(function(c){const o=t.edge(c);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(o),o),o.points.forEach(E=>E.y+=x/2);const b=K(h,c,o,l,n,t,r);Q(o,b)}),t.nodes().forEach(function(c){const o=t.node(c);s.info(c,o.type,o.diff),o.type==="group"&&(v=o.diff)}),{elem:u,diff:v}},Nt=async(e,t,n,r,i)=>{U(e,n,r,i),Y(),Z(),ut(),nt(),s.warn("Graph at first:",JSON.stringify(y(t))),st(t),s.warn("Graph after:",JSON.stringify(y(t)));const a=T();await M(e,t,r,i,void 0,a)};export{Nt as r};
@@ -1 +1 @@
1
- import{J as a,ao as o,ap as n,aq as r,ar as _,as as b,at as c,au as m,av as u,aw as x,ax as j}from"./index-B4TbOAXp.js";import{aA as N,aC as L,az as f,aB as z,ay as S}from"./index-B4TbOAXp.js";import{P as h}from"./index-DHOeeoQy.js";function y({assetCount:e,storageStatus:i}){var d,l;const t=((d=i==null?void 0:i.quota)==null?void 0:d.percentUsed)||0,s=((l=i==null?void 0:i.quota)==null?void 0:l.usage)||0;return a.jsxs("div",{className:"storage-bar",children:[a.jsxs("div",{className:"storage-bar__header",children:[a.jsxs("div",{className:"storage-bar__header-left",children:[a.jsx(o,{size:14,className:"storage-bar__icon"}),a.jsx("span",{className:"storage-bar__title",children:"本地存储空间"})]}),a.jsxs("span",{className:"storage-bar__count",children:[e," 个素材"]})]}),a.jsx("div",{className:"storage-bar__usage",children:a.jsxs("span",{className:"storage-bar__usage-value",children:["已用:",n(s)]})}),a.jsx(h,{percentage:t,size:"small",strokeWidth:6,label:!1})]})}function p({filters:e,assetCount:i,storageStatus:t,onFilterChange:s}){return a.jsxs("div",{className:"media-library-sidebar",children:[a.jsxs("div",{className:"media-library-sidebar__section",children:[a.jsx("h3",{className:"media-library-sidebar__title",children:"类型"}),a.jsxs("div",{className:"media-library-sidebar__buttons",children:[a.jsxs(r,{variant:e.activeType==="ALL"?"base":"outline",onClick:()=>s({activeType:"ALL"}),block:!0,theme:"default","data-track":"sidebar_filter_type_all",children:[a.jsx(_,{size:16}),a.jsx("span",{children:"全部素材"})]}),a.jsxs(r,{variant:e.activeType===c.IMAGE?"base":"outline",onClick:()=>s({activeType:c.IMAGE}),block:!0,theme:"default","data-track":"sidebar_filter_type_image",children:[a.jsx(b,{size:16}),a.jsx("span",{children:"图片"})]}),a.jsxs(r,{variant:e.activeType===c.VIDEO?"base":"outline",onClick:()=>s({activeType:c.VIDEO}),block:!0,theme:"default","data-track":"sidebar_filter_type_video",children:[a.jsx(m,{size:16}),a.jsx("span",{children:"视频"})]})]})]}),a.jsxs("div",{className:"media-library-sidebar__section",children:[a.jsx("h3",{className:"media-library-sidebar__title",children:"来源"}),a.jsxs("div",{className:"media-library-sidebar__buttons",children:[a.jsxs(r,{variant:e.activeSource==="ALL"?"base":"outline",onClick:()=>s({activeSource:"ALL"}),block:!0,theme:"default","data-track":"sidebar_filter_source_all",children:[a.jsx(u,{size:16}),a.jsx("span",{children:"全部来源"})]}),a.jsxs(r,{variant:e.activeSource===AssetSource.LOCAL?"base":"outline",onClick:()=>s({activeSource:AssetSource.LOCAL}),block:!0,theme:"default","data-track":"sidebar_filter_source_local",children:[a.jsx(x,{size:16}),a.jsx("span",{children:"本地上传"})]}),a.jsxs(r,{variant:e.activeSource===AssetSource.AI_GENERATED?"base":"outline",onClick:()=>s({activeSource:AssetSource.AI_GENERATED}),block:!0,theme:"default","data-track":"sidebar_filter_source_ai",children:[a.jsx(j,{size:16}),a.jsx("span",{children:"AI生成"})]})]})]}),a.jsxs("div",{className:"media-library-sidebar__section",children:[a.jsx("h3",{className:"media-library-sidebar__title",children:"排序"}),a.jsxs("div",{className:"media-library-sidebar__buttons",children:[a.jsx(r,{variant:e.sortBy==="DATE_DESC"?"base":"outline",onClick:()=>s({sortBy:"DATE_DESC"}),block:!0,size:"small",theme:"default","data-track":"sidebar_sort_date_desc",children:"最新优先"}),a.jsx(r,{variant:e.sortBy==="DATE_ASC"?"base":"outline",onClick:()=>s({sortBy:"DATE_ASC"}),block:!0,size:"small",theme:"default","data-track":"sidebar_sort_date_asc",children:"最旧优先"}),a.jsx(r,{variant:e.sortBy==="NAME_ASC"?"base":"outline",onClick:()=>s({sortBy:"NAME_ASC"}),block:!0,size:"small",theme:"default","data-track":"sidebar_sort_name_asc",children:"名称排序"}),a.jsx(r,{variant:e.sortBy==="SIZE_DESC"?"base":"outline",onClick:()=>s({sortBy:"SIZE_DESC"}),block:!0,size:"small",theme:"default","data-track":"sidebar_sort_size_desc",children:"大小排序"})]})]}),a.jsx("div",{className:"media-library-sidebar__section media-library-sidebar__section--storage",children:a.jsx(y,{assetCount:i,storageStatus:t})})]})}export{N as AssetItem,L as MediaLibraryEmpty,f as MediaLibraryGrid,z as MediaLibraryInspector,S as MediaLibraryModal,p as MediaLibrarySidebar,y as MediaLibraryStorageBar};
1
+ import{J as a,ao as o,ap as n,aq as r,ar as _,as as b,at as c,au as m,av as u,aw as x,ax as j}from"./index-BXp-gQxZ.js";import{aA as N,aC as L,az as f,aB as z,ay as S}from"./index-BXp-gQxZ.js";import{P as h}from"./index-C43H8OQj.js";function y({assetCount:e,storageStatus:i}){var d,l;const t=((d=i==null?void 0:i.quota)==null?void 0:d.percentUsed)||0,s=((l=i==null?void 0:i.quota)==null?void 0:l.usage)||0;return a.jsxs("div",{className:"storage-bar",children:[a.jsxs("div",{className:"storage-bar__header",children:[a.jsxs("div",{className:"storage-bar__header-left",children:[a.jsx(o,{size:14,className:"storage-bar__icon"}),a.jsx("span",{className:"storage-bar__title",children:"本地存储空间"})]}),a.jsxs("span",{className:"storage-bar__count",children:[e," 个素材"]})]}),a.jsx("div",{className:"storage-bar__usage",children:a.jsxs("span",{className:"storage-bar__usage-value",children:["已用:",n(s)]})}),a.jsx(h,{percentage:t,size:"small",strokeWidth:6,label:!1})]})}function p({filters:e,assetCount:i,storageStatus:t,onFilterChange:s}){return a.jsxs("div",{className:"media-library-sidebar",children:[a.jsxs("div",{className:"media-library-sidebar__section",children:[a.jsx("h3",{className:"media-library-sidebar__title",children:"类型"}),a.jsxs("div",{className:"media-library-sidebar__buttons",children:[a.jsxs(r,{variant:e.activeType==="ALL"?"base":"outline",onClick:()=>s({activeType:"ALL"}),block:!0,theme:"default","data-track":"sidebar_filter_type_all",children:[a.jsx(_,{size:16}),a.jsx("span",{children:"全部素材"})]}),a.jsxs(r,{variant:e.activeType===c.IMAGE?"base":"outline",onClick:()=>s({activeType:c.IMAGE}),block:!0,theme:"default","data-track":"sidebar_filter_type_image",children:[a.jsx(b,{size:16}),a.jsx("span",{children:"图片"})]}),a.jsxs(r,{variant:e.activeType===c.VIDEO?"base":"outline",onClick:()=>s({activeType:c.VIDEO}),block:!0,theme:"default","data-track":"sidebar_filter_type_video",children:[a.jsx(m,{size:16}),a.jsx("span",{children:"视频"})]})]})]}),a.jsxs("div",{className:"media-library-sidebar__section",children:[a.jsx("h3",{className:"media-library-sidebar__title",children:"来源"}),a.jsxs("div",{className:"media-library-sidebar__buttons",children:[a.jsxs(r,{variant:e.activeSource==="ALL"?"base":"outline",onClick:()=>s({activeSource:"ALL"}),block:!0,theme:"default","data-track":"sidebar_filter_source_all",children:[a.jsx(u,{size:16}),a.jsx("span",{children:"全部来源"})]}),a.jsxs(r,{variant:e.activeSource===AssetSource.LOCAL?"base":"outline",onClick:()=>s({activeSource:AssetSource.LOCAL}),block:!0,theme:"default","data-track":"sidebar_filter_source_local",children:[a.jsx(x,{size:16}),a.jsx("span",{children:"本地上传"})]}),a.jsxs(r,{variant:e.activeSource===AssetSource.AI_GENERATED?"base":"outline",onClick:()=>s({activeSource:AssetSource.AI_GENERATED}),block:!0,theme:"default","data-track":"sidebar_filter_source_ai",children:[a.jsx(j,{size:16}),a.jsx("span",{children:"AI生成"})]})]})]}),a.jsxs("div",{className:"media-library-sidebar__section",children:[a.jsx("h3",{className:"media-library-sidebar__title",children:"排序"}),a.jsxs("div",{className:"media-library-sidebar__buttons",children:[a.jsx(r,{variant:e.sortBy==="DATE_DESC"?"base":"outline",onClick:()=>s({sortBy:"DATE_DESC"}),block:!0,size:"small",theme:"default","data-track":"sidebar_sort_date_desc",children:"最新优先"}),a.jsx(r,{variant:e.sortBy==="DATE_ASC"?"base":"outline",onClick:()=>s({sortBy:"DATE_ASC"}),block:!0,size:"small",theme:"default","data-track":"sidebar_sort_date_asc",children:"最旧优先"}),a.jsx(r,{variant:e.sortBy==="NAME_ASC"?"base":"outline",onClick:()=>s({sortBy:"NAME_ASC"}),block:!0,size:"small",theme:"default","data-track":"sidebar_sort_name_asc",children:"名称排序"}),a.jsx(r,{variant:e.sortBy==="SIZE_DESC"?"base":"outline",onClick:()=>s({sortBy:"SIZE_DESC"}),block:!0,size:"small",theme:"default","data-track":"sidebar_sort_size_desc",children:"大小排序"})]})]}),a.jsx("div",{className:"media-library-sidebar__section media-library-sidebar__section--storage",children:a.jsx(y,{assetCount:i,storageStatus:t})})]})}export{N as AssetItem,L as MediaLibraryEmpty,f as MediaLibraryGrid,z as MediaLibraryInspector,S as MediaLibraryModal,p as MediaLibrarySidebar,y as MediaLibraryStorageBar};