@promptowl/contextnest-community 1.24.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/API.md +177 -14
  2. package/CONFIGURATION.md +577 -116
  3. package/README.md +4 -3
  4. package/STEWARDSHIP.md +24 -0
  5. package/dist/{chunk-XUIWAWDO.js → chunk-2QOJE7A5.js} +4 -4
  6. package/dist/{chunk-2TPQTN4Y.js → chunk-DGPTJXIV.js} +47 -15
  7. package/dist/chunk-I5EDEZBQ.js +523 -0
  8. package/dist/{chunk-ZTT4U4NE.js → chunk-IEAWRHMV.js} +99 -12
  9. package/dist/{chunk-YVMSM7LS.js → chunk-LHWOJPFE.js} +7 -0
  10. package/dist/{chunk-5EZOPA47.js → chunk-M6PGYMBD.js} +20 -11
  11. package/dist/{chunk-F66VCBLA.js → chunk-PICUHQEM.js} +51 -2
  12. package/dist/{chunk-I3CSD6CK.js → chunk-RPGFHESR.js} +2 -2
  13. package/dist/{chunk-KIAAEHWL.js → chunk-SWA5M5XX.js} +88 -546
  14. package/dist/{chunk-LA3VTQ22.js → chunk-TRSGPS27.js} +81 -14
  15. package/dist/{engine-S3QBQ7LH.js → engine-QNMFDIBV.js} +4 -3
  16. package/dist/{external-edit-service-6FNFPOJJ.js → external-edit-service-4MEGPT4D.js} +5 -4
  17. package/dist/{grants-service-UT3EQ3R7.js → grants-service-24GLUBY4.js} +3 -3
  18. package/dist/index.js +1739 -583
  19. package/dist/invited-user-AM6A3WGO.js +12 -0
  20. package/dist/{migrations.postgres-AIQ7WSU7.js → migrations.postgres-HGSQ7IA5.js} +16 -2
  21. package/dist/{review-service-HHGOTO6P.js → review-service-2EWN7WWO.js} +8 -7
  22. package/dist/{stewardship-service-4DHNRULG.js → stewardship-service-TDZUC2Q6.js} +7 -4
  23. package/dist/{version-service-KIOQME6U.js → version-service-C3JTZLJH.js} +5 -4
  24. package/dist/web3/assets/ActivityTracePage-DzwWIjjx.js +1 -0
  25. package/dist/web3/assets/{AgentDocsPage-CIiaBqMy.js → AgentDocsPage-ixP2UdAE.js} +1 -1
  26. package/dist/web3/assets/CollaboratorManager-C9VAXZ0h.js +1 -0
  27. package/dist/web3/assets/CollaboratorsTab-tq4ZTexH.js +1 -0
  28. package/dist/web3/assets/DocumentEditor-C2CP2fiE.js +36 -0
  29. package/dist/web3/assets/DocumentsTab-Mh7KxUoB.js +6 -0
  30. package/dist/web3/assets/ExternalEditsTab-B_CWKXZ_.js +1 -0
  31. package/dist/web3/assets/MarkdownEditor-CKh4WSn-.js +653 -0
  32. package/dist/web3/assets/MarkdownEditor-ndtIx5x0.css +1 -0
  33. package/dist/web3/assets/NestPageHeader-Cizo8nUi.js +1 -0
  34. package/dist/web3/assets/NestView-EW-sraEb.js +73 -0
  35. package/dist/web3/assets/OverviewTab-CjidsMX_.js +6 -0
  36. package/dist/web3/assets/PersonCombobox-BKI7dff4.js +1 -0
  37. package/dist/web3/assets/{ReviewActions-OfOdqzCn.js → ReviewActions-CS8JXgXF.js} +2 -2
  38. package/dist/web3/assets/ReviewTab-CwVrXzw5.js +1 -0
  39. package/dist/web3/assets/StewardsTab-C-iP6gnh.js +1 -0
  40. package/dist/web3/assets/SubmitForReviewModal-Biq3m79i.js +1 -0
  41. package/dist/web3/assets/{alert-dialog-DTozKlmV.js → alert-dialog-BvF3NFr7.js} +2 -2
  42. package/dist/web3/assets/{arrow-left-BCKt4CwQ.js → arrow-left-CWIsv-sG.js} +1 -1
  43. package/dist/web3/assets/backlinks-Cqcn7n1J.js +19 -0
  44. package/dist/web3/assets/boxes-ClbgQqG2.js +6 -0
  45. package/dist/web3/assets/{chevron-left-BPwUT9DS.js → chevron-left-CK_ZPFm9.js} +1 -1
  46. package/dist/web3/assets/{circle-check-DI8IBGeo.js → circle-check-Bw_aTXiH.js} +1 -1
  47. package/dist/web3/assets/{circle-x-VKVhC88W.js → circle-x-DkIG68H7.js} +1 -1
  48. package/dist/web3/assets/client-attribution-BraarYaP.js +1 -0
  49. package/dist/web3/assets/{code-xml-CMabYZvH.js → code-xml-BlR7EN6l.js} +1 -1
  50. package/dist/web3/assets/{corner-down-right-BGxwK6wH.js → corner-down-right-DSVxK3tf.js} +1 -1
  51. package/dist/web3/assets/count-skeleton-DToLM74B.js +1 -0
  52. package/dist/web3/assets/{earth-BEp1EKTo.js → earth-BXhVPvCR.js} +1 -1
  53. package/dist/web3/assets/{file-exclamation-point-r8qZGIjP.js → file-exclamation-point-BevGZgtj.js} +1 -1
  54. package/dist/web3/assets/{folder-input-Cmtx1Jhk.js → folder-input-m8UBV4fA.js} +1 -1
  55. package/dist/web3/assets/{index-C1wTSjfP.js → index-BOVYgMvj.js} +1 -1
  56. package/dist/web3/assets/index-DVnaYqj9.css +1 -0
  57. package/dist/web3/assets/index-WYDmEOfO.js +404 -0
  58. package/dist/web3/assets/page-B6pkc9cd.js +2 -0
  59. package/dist/web3/assets/page-BJrFCKXB.js +1 -0
  60. package/dist/web3/assets/page-Bgy9Ng9p.js +1 -0
  61. package/dist/web3/assets/page-C2zoxumw.js +1 -0
  62. package/dist/web3/assets/page-CJWO06dN.js +1 -0
  63. package/dist/web3/assets/page-CptuAPJc.js +6 -0
  64. package/dist/web3/assets/page-DPY01SOj.js +1 -0
  65. package/dist/web3/assets/page-Dea2SblF.js +9 -0
  66. package/dist/web3/assets/page-Deq6IKiN.js +6 -0
  67. package/dist/web3/assets/page-Dfjg8p7Z.js +1 -0
  68. package/dist/web3/assets/{page-ByyVLDVo.js → page-Dh57L0RG.js} +5 -5
  69. package/dist/web3/assets/page-Dwbp4Seu.js +6 -0
  70. package/dist/web3/assets/{page-CHb0F5hV.js → page-DzKwP5Ds.js} +3 -3
  71. package/dist/web3/assets/page-YxjrE5b5.js +45 -0
  72. package/dist/web3/assets/{page-title-ClvvBsIo.js → page-title-DVq4qvMR.js} +1 -1
  73. package/dist/web3/assets/{play-C5YNKpAH.js → play-CXhS6Pgq.js} +1 -1
  74. package/dist/web3/assets/{send-0CHvmluT.js → send-DdfwnIrj.js} +1 -1
  75. package/dist/web3/assets/{settings-CeeF4LEb.js → settings-DKX0Q4gO.js} +1 -1
  76. package/dist/web3/assets/{share-2-CMnOlOt-.js → share-2-CxmXRt58.js} +1 -1
  77. package/dist/web3/assets/{tag-DQ_6J5Gv.js → tag-DeYC_mRv.js} +1 -1
  78. package/dist/web3/assets/{trash-2-HBi-Pslz.js → trash-2-B0HyPTnI.js} +1 -1
  79. package/dist/web3/assets/{user-plus-CvBNcpn4.js → user-plus-Ckm_Isyc.js} +1 -1
  80. package/dist/web3/assets/{x-By7piikG.js → x-mNtADYHc.js} +1 -1
  81. package/dist/web3/assets/zap-D2ifcnYb.js +16 -0
  82. package/dist/web3/index.html +2 -2
  83. package/package.json +3 -2
  84. package/dist/client-KEY4PYJH.js +0 -11
  85. package/dist/keys-CTOGAG3W.js +0 -20
  86. package/dist/web3/assets/ActivityTracePage-BOZHgJ8S.js +0 -1
  87. package/dist/web3/assets/CollaboratorManager-By91wrIr.js +0 -1
  88. package/dist/web3/assets/CollaboratorsTab-D1EE64Fs.js +0 -1
  89. package/dist/web3/assets/DocumentEditor-DrQfrW3d.js +0 -36
  90. package/dist/web3/assets/DocumentsTab-Vba-AzBv.js +0 -6
  91. package/dist/web3/assets/ExternalEditsTab-BSzAQIGM.js +0 -1
  92. package/dist/web3/assets/MarkdownEditor-74N_naNQ.css +0 -1
  93. package/dist/web3/assets/MarkdownEditor-C9zqZjC5.js +0 -643
  94. package/dist/web3/assets/NestPageHeader-CoLUV1Oz.js +0 -1
  95. package/dist/web3/assets/NestView-CTZ55tXD.js +0 -63
  96. package/dist/web3/assets/OverviewTab-Dxi-Hu-N.js +0 -1
  97. package/dist/web3/assets/PersonCombobox-CPOlNs6G.js +0 -1
  98. package/dist/web3/assets/ReasonDialog-DgLxfRWv.js +0 -1
  99. package/dist/web3/assets/ReviewTab-CyX8yxd3.js +0 -1
  100. package/dist/web3/assets/StewardsTab-DBEEfAQI.js +0 -1
  101. package/dist/web3/assets/SubmitForReviewModal-Ci2DdWs0.js +0 -1
  102. package/dist/web3/assets/backlinks-CYd4xENL.js +0 -24
  103. package/dist/web3/assets/card-XG2dP5Xf.js +0 -1
  104. package/dist/web3/assets/count-skeleton-DMbdpscX.js +0 -1
  105. package/dist/web3/assets/dates-BCxbm4_q.js +0 -1
  106. package/dist/web3/assets/index-BM-h3DwI.css +0 -1
  107. package/dist/web3/assets/index-EaX2yql0.js +0 -389
  108. package/dist/web3/assets/page-B3yvQvHy.js +0 -1
  109. package/dist/web3/assets/page-BExMvttJ.js +0 -1
  110. package/dist/web3/assets/page-BUOADv2X.js +0 -1
  111. package/dist/web3/assets/page-BYUFhYWZ.js +0 -1
  112. package/dist/web3/assets/page-Bicf02Cz.js +0 -1
  113. package/dist/web3/assets/page-BsPMDm5d.js +0 -45
  114. package/dist/web3/assets/page-CC0NJi8v.js +0 -1
  115. package/dist/web3/assets/page-CPjWQNKx.js +0 -11
  116. package/dist/web3/assets/page-CQt3ZGbf.js +0 -2
  117. package/dist/web3/assets/page-Cj1NetQ-.js +0 -1
  118. package/dist/web3/assets/page-CtaW65El.js +0 -1
  119. package/dist/web3/assets/page-DGOL9l8i.js +0 -6
  120. package/dist/web3/assets/refresh-cw-BhHzSH9m.js +0 -6
  121. package/dist/web3/assets/scroll-area-dRWncRqa.css +0 -1
  122. package/dist/web3/assets/scroll-area-hz-xtayP.js +0 -1
  123. package/dist/web3/assets/select-DBFTrUmI.js +0 -6
  124. package/dist/web3/assets/triangle-alert-CDy8-7sv.js +0 -6
  125. package/dist/web3/assets/zap-C2T8riBp.js +0 -11
@@ -0,0 +1,653 @@
1
+ var Qw=Object.defineProperty;var e7=(t,e,n)=>e in t?Qw(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Kl=(t,e,n)=>e7(t,typeof e!="symbol"?e+"":e,n);import{c as Be,r as B,j as S,w as Yn,au as p3,cg as t7,ch as n7,ci as r7,cj as i7,ck as s7,cl as o7,C as a7,as as Jh,at as Xh,B as Xn,av as Qh,ay as l7,ax as Iu,cm as U1,cn as u7,L as m3,h as c7,bZ as d7,i as $t,u as g3,l as xo,co as h7,D as Lp,z as zp,G as Bp,H as Fp,J as Pp,bJ as b3,I as Na,F as $p,cp as f7,cq as p7,cr as y3,cs as pi,ct as m7,cu as v3,cv as x3,cw as w3,cx as k3,cy as E3,cz as S3,cA as C3,cB as _3,cC as Hp,cD as Up,cE as A3,aE as g7,a_ as q1,Y as j1,Q as b7,cF as y7,b6 as v7,bK as x7,az as w7,M as T3,K as M3,aq as k7,E as E7}from"./index-WYDmEOfO.js";import{F as S7,G as C7}from"./zap-D2ifcnYb.js";import{o as ma,l as _7,f as Yl,m as _s,a as A7,p as V1,b as W1,n as G1,h as T7,s as M7,c as N7,v as D7,S as O7,d as qs,M as R7,r as I7}from"./index-BOVYgMvj.js";import{A as L7}from"./arrow-left-CWIsv-sG.js";import{T as ef}from"./trash-2-B0HyPTnI.js";import{X as K1}from"./x-mNtADYHc.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const z7=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],B7=Be("arrow-down",z7);/**
7
+ * @license lucide-react v0.577.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const F7=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],P7=Be("arrow-right",F7);/**
12
+ * @license lucide-react v0.577.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const $7=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],H7=Be("arrow-up",$7);/**
17
+ * @license lucide-react v0.577.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const U7=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],N3=Be("bold",U7);/**
22
+ * @license lucide-react v0.577.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const q7=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],D3=Be("code",q7);/**
27
+ * @license lucide-react v0.577.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const j7=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],V7=Be("columns-2",j7);/**
32
+ * @license lucide-react v0.577.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const W7=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],G7=Be("ellipsis-vertical",W7);/**
37
+ * @license lucide-react v0.577.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const K7=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Y7=Be("file-spreadsheet",K7);/**
42
+ * @license lucide-react v0.577.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const Z7=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],NW=Be("folder-plus",Z7);/**
47
+ * @license lucide-react v0.577.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const J7=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],tf=Be("heading-1",J7);/**
52
+ * @license lucide-react v0.577.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const X7=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],nf=Be("heading-2",X7);/**
57
+ * @license lucide-react v0.577.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const Q7=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],ek=Be("heading-3",Q7);/**
62
+ * @license lucide-react v0.577.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const tk=[["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v3a1 1 0 0 0 1 1h3",key:"tj5zdr"}],["path",{d:"M21 10v8",key:"1kdml4"}],["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}]],nk=Be("heading-4",tk);/**
67
+ * @license lucide-react v0.577.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const rk=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]],ik=Be("heading-5",rk);/**
72
+ * @license lucide-react v0.577.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const sk=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]],ok=Be("heading-6",sk);/**
77
+ * @license lucide-react v0.577.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const ak=[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]],lk=Be("highlighter",ak);/**
82
+ * @license lucide-react v0.577.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const uk=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],O3=Be("image-plus",uk);/**
87
+ * @license lucide-react v0.577.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const ck=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],R3=Be("italic",ck);/**
92
+ * @license lucide-react v0.577.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const dk=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],I3=Be("link",dk);/**
97
+ * @license lucide-react v0.577.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const hk=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],fk=Be("list-ordered",hk);/**
102
+ * @license lucide-react v0.577.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const pk=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Lu=Be("list",pk);/**
107
+ * @license lucide-react v0.577.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const mk=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],rf=Be("quote",mk);/**
112
+ * @license lucide-react v0.577.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const gk=[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]],bk=Be("redo",gk);/**
117
+ * @license lucide-react v0.577.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const yk=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],DW=Be("rotate-ccw",yk);/**
122
+ * @license lucide-react v0.577.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const vk=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],xk=Be("square-check-big",vk);/**
127
+ * @license lucide-react v0.577.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const wk=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],OW=Be("star",wk);/**
132
+ * @license lucide-react v0.577.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const kk=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],L3=Be("strikethrough",kk);/**
137
+ * @license lucide-react v0.577.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const Ek=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],RW=Be("table-2",Ek);/**
142
+ * @license lucide-react v0.577.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const Sk=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],Ck=Be("table",Sk);/**
147
+ * @license lucide-react v0.577.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const _k=[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]],Ak=Be("undo",_k);/**
152
+ * @license lucide-react v0.577.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const Tk=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],sf=Be("upload",Tk);/**
157
+ * @license lucide-react v0.577.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const Mk=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],IW=Be("user-check",Mk);/**
162
+ * @license lucide-react v0.577.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const Nk=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],Dk=Be("video",Nk);/**
167
+ * @license lucide-react v0.577.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const Ok=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],LW=Be("wrench",Ok);function zW({value:t,onChange:e,options:n,placeholder:r="Select…",searchPlaceholder:i="Search…",emptyText:s="No matches.",disabled:o,id:a,testId:l}){const[u,c]=B.useState(!1),d=B.useRef(null),h=n.find(f=>f.value===t);return B.useEffect(()=>{if(!u)return;const f=m=>{var g;(g=d.current)!=null&&g.contains(m.target)||c(!1)},p=m=>{m.key==="Escape"&&(m.stopPropagation(),c(!1))};return document.addEventListener("pointerdown",f,!0),document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("pointerdown",f,!0),document.removeEventListener("keydown",p,!0)}},[u]),S.jsxs("div",{ref:d,className:"relative",children:[S.jsxs("button",{id:a,type:"button",role:"combobox","aria-expanded":u,disabled:o,"data-testid":l,onClick:()=>c(f=>!f),className:"flex h-10 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx("span",{className:Yn("truncate text-left",!h&&"text-muted-foreground"),children:h?h.label:r}),S.jsx(p3,{className:"h-4 w-4 shrink-0 opacity-50"})]}),u&&S.jsx("div",{className:"absolute z-50 mt-1 w-full rounded-md border bg-popover text-popover-foreground shadow-md",children:S.jsxs(t7,{filter:(f,p)=>{const m=n.find(y=>y.value===f);return`${(m==null?void 0:m.label)??""} ${f}`.toLowerCase().includes(p.toLowerCase())?1:0},children:[S.jsx(n7,{placeholder:i,autoFocus:!0}),S.jsxs(r7,{children:[S.jsx(i7,{children:s}),S.jsx(s7,{children:n.map(f=>S.jsxs(o7,{value:f.value,className:"items-start",onSelect:p=>{e(p),c(!1)},children:[S.jsx(a7,{className:Yn("mr-2 h-4 w-4 shrink-0",f.value===t?"opacity-100":"opacity-0")}),S.jsx("span",{className:"min-w-0 whitespace-normal break-words",children:f.label})]},f.value))})]})]})})]})}function Rk(){return{enter:{mathFlow:t,mathFlowFenceMeta:e,mathText:s},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:a,mathText:o,mathTextData:a}};function t(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function e(){this.buffer()}function n(){const l=this.resume(),u=this.stack[this.stack.length-1];ma(u.type==="math"),u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),c=this.stack[this.stack.length-1];ma(c.type==="math"),this.exit(l),c.value=u;const d=c.data.hChildren[0];ma(d.type==="element"),ma(d.tagName==="code"),d.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function s(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function o(l){const u=this.resume(),c=this.stack[this.stack.length-1];ma(c.type==="inlineMath"),this.exit(l),c.value=u,c.data.hChildren.push({type:"text",value:u})}function a(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function Ik(t){let e=(t||{}).singleDollarTextMath;return e==null&&(e=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
172
+ `,inConstruct:"mathFlowMeta"},{character:"$",after:e?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(s,o,a,l){const u=s.value||"",c=a.createTracker(l),d="$".repeat(Math.max(_7(u,"$")+1,2)),h=a.enter("mathFlow");let f=c.move(d);if(s.meta){const p=a.enter("mathFlowMeta");f+=c.move(a.safe(s.meta,{after:`
173
+ `,before:f,encode:["$"],...c.current()})),p()}return f+=c.move(`
174
+ `),u&&(f+=c.move(u+`
175
+ `)),f+=c.move(d),h(),f}function r(s,o,a){let l=s.value||"",u=1;for(e||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(l);)u++;const c="$".repeat(u);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let d=-1;for(;++d<a.unsafe.length;){const h=a.unsafe[d];if(!h.atBreak)continue;const f=a.compilePattern(h);let p;for(;p=f.exec(l);){let m=p.index;l.codePointAt(m)===10&&l.codePointAt(m-1)===13&&m--,l=l.slice(0,m)+" "+l.slice(p.index+1)}}return c+l+c}function i(){return"$"}}const Lk={tokenize:zk,concrete:!0,name:"mathFlow"},Y1={tokenize:Bk,partial:!0};function zk(t,e,n){const r=this,i=r.events[r.events.length-1],s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let o=0;return a;function a(x){return t.enter("mathFlow"),t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),l(x)}function l(x){return x===36?(t.consume(x),o++,l):o<2?n(x):(t.exit("mathFlowFenceSequence"),Yl(t,u,"whitespace")(x))}function u(x){return x===null||_s(x)?d(x):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),c(x))}function c(x){return x===null||_s(x)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),d(x)):x===36?n(x):(t.consume(x),c)}function d(x){return t.exit("mathFlowFence"),r.interrupt?e(x):t.attempt(Y1,h,g)(x)}function h(x){return t.attempt({tokenize:y,partial:!0},g,f)(x)}function f(x){return(s?Yl(t,p,"linePrefix",s+1):p)(x)}function p(x){return x===null?g(x):_s(x)?t.attempt(Y1,h,g)(x):(t.enter("mathFlowValue"),m(x))}function m(x){return x===null||_s(x)?(t.exit("mathFlowValue"),p(x)):(t.consume(x),m)}function g(x){return t.exit("mathFlow"),e(x)}function y(x,k,C){let _=0;return Yl(x,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function T(L){return x.enter("mathFlowFence"),x.enter("mathFlowFenceSequence"),D(L)}function D(L){return L===36?(_++,x.consume(L),D):_<o?C(L):(x.exit("mathFlowFenceSequence"),Yl(x,I,"whitespace")(L))}function I(L){return L===null||_s(L)?(x.exit("mathFlowFence"),k(L)):C(L)}}}function Bk(t,e,n){const r=this;return i;function i(o){return o===null?e(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}function Fk(t){let n=(t||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:Pk,previous:$k,name:"mathText"};function r(i,s,o){let a=0,l,u;return c;function c(m){return i.enter("mathText"),i.enter("mathTextSequence"),d(m)}function d(m){return m===36?(i.consume(m),a++,d):a<2&&!n?o(m):(i.exit("mathTextSequence"),h(m))}function h(m){return m===null?o(m):m===36?(u=i.enter("mathTextSequence"),l=0,p(m)):m===32?(i.enter("space"),i.consume(m),i.exit("space"),h):_s(m)?(i.enter("lineEnding"),i.consume(m),i.exit("lineEnding"),h):(i.enter("mathTextData"),f(m))}function f(m){return m===null||m===32||m===36||_s(m)?(i.exit("mathTextData"),h(m)):(i.consume(m),f)}function p(m){return m===36?(i.consume(m),l++,p):l===a?(i.exit("mathTextSequence"),i.exit("mathText"),s(m)):(u.type="mathTextData",f(m))}}}function Pk(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="mathTextData"){t[e][1].type="mathTextPadding",t[n][1].type="mathTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="mathTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function $k(t){return t!==36||this.events[this.events.length-1][1].type==="characterEscape"}function Hk(t){return{flow:{36:Lk},text:{36:Fk(t)}}}class V extends Error{constructor(e,n){var r="KaTeX parse error: "+e,i,s,o=n&&n.loc;if(o&&o.start<=o.end){var a=o.lexer.input;i=o.start,s=o.end,i===a.length?r+=" at end of input: ":r+=" at position "+(i+1)+": ";var l=a.slice(i,s).replace(/[^]/g,"$&̲"),u;i>15?u="…"+a.slice(i-15,i):u=a.slice(0,i);var c;s+15<a.length?c=a.slice(s,s+15)+"…":c=a.slice(s),r+=u+l+c}super(r),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,V.prototype),this.position=i,i!=null&&s!=null&&(this.length=s-i),this.rawMessage=e}}var Uk=/([A-Z])/g,qk=t=>t.replace(Uk,"-$1").toLowerCase(),jk={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},Vk=/[&><"']/g,Qt=t=>String(t).replace(Vk,e=>jk[e]),zu=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?zu(t.body[0]):t:t.type==="font"?zu(t.body):t,Wk=new Set(["mathord","textord","atom"]),gi=t=>Wk.has(zu(t).type),Gk=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},of={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand <n>",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function Kk(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Yk(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return Kk(e)}function Zk(t,e,n,r){var i=n[e];t[e]=i!==void 0?r.processor?r.processor(i):i:Yk(r)}class qp{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var n of Object.keys(of)){var r=of[n];r&&Zk(this,n,e,r)}}reportNonstrict(e,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(e,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new V("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,r){var i=this.strict;if(typeof i=="function")try{i=i(e,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var n=Gk(e.url);if(n==null)return!1;e.protocol=n}var r=typeof this.trust=="function"?this.trust(e):this.trust;return!!r}}class Ti{constructor(e,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=r}sup(){return Dr[Jk[this.id]]}sub(){return Dr[Xk[this.id]]}fracNum(){return Dr[Qk[this.id]]}fracDen(){return Dr[e9[this.id]]}cramp(){return Dr[t9[this.id]]}text(){return Dr[n9[this.id]]}isTight(){return this.size>=2}}var jp=0,Xu=1,Ao=2,li=3,Va=4,Qn=5,Bo=6,un=7,Dr=[new Ti(jp,0,!1),new Ti(Xu,0,!0),new Ti(Ao,1,!1),new Ti(li,1,!0),new Ti(Va,2,!1),new Ti(Qn,2,!0),new Ti(Bo,3,!1),new Ti(un,3,!0)],Jk=[Va,Qn,Va,Qn,Bo,un,Bo,un],Xk=[Qn,Qn,Qn,Qn,un,un,un,un],Qk=[Ao,li,Va,Qn,Bo,un,Bo,un],e9=[li,li,Qn,Qn,un,un,un,un],t9=[Xu,Xu,li,li,Qn,Qn,un,un],n9=[jp,Xu,Ao,li,Ao,li,Ao,li],ye={DISPLAY:Dr[jp],TEXT:Dr[Ao],SCRIPT:Dr[Va],SCRIPTSCRIPT:Dr[Bo]},af=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function r9(t){for(var e=0;e<af.length;e++)for(var n=af[e],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(t>=i[0]&&t<=i[1])return n.name}return null}var Bu=[];af.forEach(t=>t.blocks.forEach(e=>Bu.push(...e)));function z3(t){for(var e=0;e<Bu.length;e+=2)if(t>=Bu[e]&&t<=Bu[e+1])return!0;return!1}var Lt=t=>t+" "+t,po=80,i9=function(e,n){return"M95,"+(622+e+n)+`
176
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
177
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
178
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
179
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
180
+ c69,-144,104.5,-217.7,106.5,-221
181
+ l`+e/2.075+" -"+e+`
182
+ c5.3,-9.3,12,-14,20,-14
183
+ H400000v`+(40+e)+`H845.2724
184
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
185
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
186
+ M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},s9=function(e,n){return"M263,"+(601+e+n)+`c0.7,0,18,39.7,52,119
187
+ c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
188
+ c340,-704.7,510.7,-1060.3,512,-1067
189
+ l`+e/2.084+" -"+e+`
190
+ c4.7,-7.3,11,-11,19,-11
191
+ H40000v`+(40+e)+`H1012.3
192
+ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
193
+ c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
194
+ s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
195
+ c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
196
+ M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},o9=function(e,n){return"M983 "+(10+e+n)+`
197
+ l`+e/3.13+" -"+e+`
198
+ c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
199
+ H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
200
+ s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
201
+ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
202
+ c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
203
+ c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
204
+ c53.7,-170.3,84.5,-266.8,92.5,-289.5z
205
+ M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},a9=function(e,n){return"M424,"+(2398+e+n)+`
206
+ c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
207
+ c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
208
+ s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
209
+ s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
210
+ l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
211
+ v`+(40+e)+`H1014.6
212
+ s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
213
+ c-2,6,-10,9,-24,9
214
+ c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+n+`
215
+ h400000v`+(40+e)+"h-400000z"},l9=function(e,n){return"M473,"+(2713+e+n)+`
216
+ c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
217
+ c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
218
+ s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
219
+ c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
220
+ c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
221
+ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
222
+ 606zM`+(1001+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},u9=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},c9=function(e,n,r){var i=r-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+`
223
+ H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
224
+ h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
225
+ c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
226
+ 219 661 l218 661zM702 `+n+"H400000v"+(40+e)+"H742z"},d9=function(e,n,r){n=1e3*n;var i="";switch(e){case"sqrtMain":i=i9(n,po);break;case"sqrtSize1":i=s9(n,po);break;case"sqrtSize2":i=o9(n,po);break;case"sqrtSize3":i=a9(n,po);break;case"sqrtSize4":i=l9(n,po);break;case"sqrtTall":i=c9(n,po,r)}return i},h9=function(e,n){switch(e){case"⎜":return Lt("M291 0 H417 V"+n+" H291z");case"∣":return Lt("M145 0 H188 V"+n+" H145z");case"∥":return Lt("M145 0 H188 V"+n+" H145z")+Lt("M367 0 H410 V"+n+" H367z");case"⎟":return Lt("M457 0 H583 V"+n+" H457z");case"⎢":return Lt("M319 0 H403 V"+n+" H319z");case"⎥":return Lt("M263 0 H347 V"+n+" H263z");case"⎪":return Lt("M384 0 H504 V"+n+" H384z");case"⏐":return Lt("M312 0 H355 V"+n+" H312z");case"‖":return Lt("M257 0 H300 V"+n+" H257z")+Lt("M478 0 H521 V"+n+" H478z");default:return""}},Z1={doubleleftarrow:`M262 157
227
+ l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
228
+ 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
229
+ 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
230
+ c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
231
+ 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
232
+ -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
233
+ -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
234
+ m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
235
+ -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
236
+ 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
237
+ -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
238
+ -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
239
+ -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
240
+ c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
241
+ -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
242
+ 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
243
+ -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
244
+ c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
245
+ 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
246
+ 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
247
+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
248
+ -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
249
+ 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
250
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
251
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
252
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
253
+ H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
254
+ 435 0h399565z`,leftgroupunder:`M400000 262
255
+ H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
256
+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
257
+ -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
258
+ -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
259
+ -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
260
+ 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
261
+ -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
262
+ -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
263
+ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
264
+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
265
+ 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
266
+ -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
267
+ 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
268
+ -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
269
+ v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
270
+ -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
271
+ -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
272
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Lt("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Lt("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Lt("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Lt("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
273
+ -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
274
+ c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
275
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Lt("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
276
+ c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
277
+ -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
278
+ 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
279
+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
280
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
281
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
282
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
283
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
284
+ -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
285
+ m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
286
+ 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
287
+ -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
288
+ m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
289
+ c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
290
+ -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
291
+ m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
292
+ 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
293
+ -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
294
+ m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
295
+ c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
296
+ -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
297
+ 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
298
+ 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
299
+ -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
300
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
301
+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
302
+ -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
303
+ s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
304
+ c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
305
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
306
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
307
+ 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
308
+ 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
309
+ -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
310
+ -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
311
+ 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
312
+ -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
313
+ 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
314
+ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
315
+ 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
316
+ -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
317
+ -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
318
+ 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
319
+ 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
320
+ -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
321
+ m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
322
+ 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
323
+ -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
324
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Lt("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Lt("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Lt("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
325
+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
326
+ -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
327
+ -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
328
+ 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
329
+ -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
330
+ -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
331
+ -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
332
+ 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
333
+ c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
334
+ 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
335
+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
336
+ -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
337
+ 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
338
+ -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
339
+ 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
340
+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
341
+ -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
342
+ -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
343
+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
344
+ c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
345
+ 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
346
+ -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
347
+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
348
+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
349
+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
350
+ -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
351
+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
352
+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
353
+ -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
354
+ 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
355
+ 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
356
+ -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
357
+ -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
358
+ H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
359
+ c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
360
+ c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
361
+ -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
362
+ -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
363
+ -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
364
+ -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
365
+ -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
366
+ -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
367
+ -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
368
+ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
369
+ c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
370
+ s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
371
+ 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
372
+ s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
373
+ c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
374
+ M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
375
+ -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
376
+ 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
377
+ -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
378
+ -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
379
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
380
+ 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
381
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
382
+ c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
383
+ c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
384
+ c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
385
+ M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
386
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
387
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
388
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
389
+ M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
390
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
391
+ 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
392
+ -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
393
+ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
394
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
395
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
396
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
397
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},f9=function(e,n){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
398
+ H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
399
+ M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
400
+ c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
401
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
402
+ c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
403
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
404
+ M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
405
+ c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
406
+ c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
407
+ MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
408
+ MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
409
+ M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
410
+ M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
411
+ c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
412
+ -36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
413
+ 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
414
+ c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
415
+ -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
416
+ l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
417
+ -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
418
+ 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
419
+ c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
420
+ c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
421
+ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
422
+ c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
423
+ c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
424
+ l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
425
+ -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function p9(t){return"toText"in t}class ea{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){for(var e="",n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e}toText(){return this.children.map(e=>{if(p9(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var lf={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},m9={ex:!0,em:!0,mu:!0},B3=function(e){return typeof e!="string"&&(e=e.unit),e in lf||e in m9||e==="ex"},bt=function(e,n){var r;if(e.unit in lf)r=lf[e.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(e.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,e.unit==="ex")r=i.fontMetrics().xHeight;else if(e.unit==="em")r=i.fontMetrics().quad;else throw new V("Invalid unit: '"+e.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*r,n.maxSize)},K=function(e){return+e.toFixed(4)+"em"},Ji=function(e){return e.filter(n=>n).join(" ")},Vp=function(e){var n="";for(var r of Object.keys(e)){var i=e[r];i!==void 0&&(n+=qk(r)+":"+i+";")}return n},F3=function(e,n,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},P3=function(e){var n=document.createElement(e);n.className=Ji(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n},g9=/[\s"'>/=\x00-\x1f]/,$3=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+Qt(Ji(this.classes))+'"');var r=Vp(this.style);r&&(n+=' style="'+Qt(r)+'"');for(var i of Object.keys(this.attributes)){if(g9.test(i))throw new V("Invalid attribute name '"+i+"'");n+=" "+i+'="'+Qt(this.attributes[i])+'"'}n+=">";for(var s=0;s<this.children.length;s++)n+=this.children[s].toMarkup();return n+="</"+e+">",n};class ta{constructor(e,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,F3.call(this,e,r,i),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return P3.call(this,"span")}toMarkup(){return $3.call(this,"span")}}class x0{constructor(e,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,F3.call(this,n,i),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return P3.call(this,"a")}toMarkup(){return $3.call(this,"a")}}class b9{constructor(e,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e='<img src="'+Qt(this.src)+'"'+(' alt="'+Qt(this.alt)+'"'),n=Vp(this.style);return n&&(e+=' style="'+Qt(n)+'"'),e+="'/>",e}}var y9={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class In{constructor(e,n,r,i,s,o,a,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=n||0,this.depth=r||0,this.italic=i||0,this.skew=s||0,this.width=o||0,this.classes=a||[],this.style=l||{},this.maxFontSize=0;var u=r9(this.text.charCodeAt(0));u&&this.classes.push(u+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=y9[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=K(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Ji(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(e),n):e}toMarkup(){var e=!1,n="<span";this.classes.length&&(e=!0,n+=' class="',n+=Qt(Ji(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+K(this.italic)+";"),r+=Vp(this.style),r&&(e=!0,n+=' style="'+Qt(r)+'"');var i=Qt(this.text);return e?(n+=">",n+=i,n+="</span>",n):i}}class mi{constructor(e,n){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=n||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))e+=" "+n+'="'+Qt(this.attributes[n])+'"';e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</svg>",e}}class Xi{constructor(e,n){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=n}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",Z1[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+Qt(this.alternate)+'"/>':'<path d="'+Qt(Z1[this.pathName])+'"/>'}}class uf{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var e="<line";for(var n of Object.keys(this.attributes))e+=" "+n+'="'+Qt(this.attributes[n])+'"';return e+="/>",e}}function v9(t){if(t instanceof In)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function x9(t){if(t instanceof ta)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}var w9=t=>t instanceof ta||t instanceof x0||t instanceof ea,Or={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Zl={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},J1={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function k9(t,e){Or[t]=e}function Wp(t,e,n){if(!Or[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),i=Or[e][r];if(!i&&t[0]in J1&&(r=J1[t[0]].charCodeAt(0),i=Or[e][r]),!i&&n==="text"&&z3(r)&&(i=Or[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var wd={};function E9(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!wd[e]){var n=wd[e]={cssEmPerMu:Zl.quad[e]/18};for(var r in Zl)Zl.hasOwnProperty(r)&&(n[r]=Zl[r][e])}return wd[e]}var dt={math:{},text:{}};function b(t,e,n,r,i,s){dt[t][i]={font:e,group:n,replace:r},s&&r&&(dt[t][r]=dt[t][i])}var v="math",H="text",w="main",A="ams",ht="accent-token",re="bin",mn="close",na="inner",he="mathord",Rt="op-token",zn="open",El="punct",M="rel",bi="spacing",O="textord";b(v,w,M,"≡","\\equiv",!0);b(v,w,M,"≺","\\prec",!0);b(v,w,M,"≻","\\succ",!0);b(v,w,M,"∼","\\sim",!0);b(v,w,M,"⊥","\\perp");b(v,w,M,"⪯","\\preceq",!0);b(v,w,M,"⪰","\\succeq",!0);b(v,w,M,"≃","\\simeq",!0);b(v,w,M,"∣","\\mid",!0);b(v,w,M,"≪","\\ll",!0);b(v,w,M,"≫","\\gg",!0);b(v,w,M,"≍","\\asymp",!0);b(v,w,M,"∥","\\parallel");b(v,w,M,"⋈","\\bowtie",!0);b(v,w,M,"⌣","\\smile",!0);b(v,w,M,"⊑","\\sqsubseteq",!0);b(v,w,M,"⊒","\\sqsupseteq",!0);b(v,w,M,"≐","\\doteq",!0);b(v,w,M,"⌢","\\frown",!0);b(v,w,M,"∋","\\ni",!0);b(v,w,M,"∝","\\propto",!0);b(v,w,M,"⊢","\\vdash",!0);b(v,w,M,"⊣","\\dashv",!0);b(v,w,M,"∋","\\owns");b(v,w,El,".","\\ldotp");b(v,w,El,"⋅","\\cdotp");b(v,w,El,"⋅","·");b(H,w,O,"⋅","·");b(v,w,O,"#","\\#");b(H,w,O,"#","\\#");b(v,w,O,"&","\\&");b(H,w,O,"&","\\&");b(v,w,O,"ℵ","\\aleph",!0);b(v,w,O,"∀","\\forall",!0);b(v,w,O,"ℏ","\\hbar",!0);b(v,w,O,"∃","\\exists",!0);b(v,w,O,"∇","\\nabla",!0);b(v,w,O,"♭","\\flat",!0);b(v,w,O,"ℓ","\\ell",!0);b(v,w,O,"♮","\\natural",!0);b(v,w,O,"♣","\\clubsuit",!0);b(v,w,O,"℘","\\wp",!0);b(v,w,O,"♯","\\sharp",!0);b(v,w,O,"♢","\\diamondsuit",!0);b(v,w,O,"ℜ","\\Re",!0);b(v,w,O,"♡","\\heartsuit",!0);b(v,w,O,"ℑ","\\Im",!0);b(v,w,O,"♠","\\spadesuit",!0);b(v,w,O,"§","\\S",!0);b(H,w,O,"§","\\S");b(v,w,O,"¶","\\P",!0);b(H,w,O,"¶","\\P");b(v,w,O,"†","\\dag");b(H,w,O,"†","\\dag");b(H,w,O,"†","\\textdagger");b(v,w,O,"‡","\\ddag");b(H,w,O,"‡","\\ddag");b(H,w,O,"‡","\\textdaggerdbl");b(v,w,mn,"⎱","\\rmoustache",!0);b(v,w,zn,"⎰","\\lmoustache",!0);b(v,w,mn,"⟯","\\rgroup",!0);b(v,w,zn,"⟮","\\lgroup",!0);b(v,w,re,"∓","\\mp",!0);b(v,w,re,"⊖","\\ominus",!0);b(v,w,re,"⊎","\\uplus",!0);b(v,w,re,"⊓","\\sqcap",!0);b(v,w,re,"∗","\\ast");b(v,w,re,"⊔","\\sqcup",!0);b(v,w,re,"◯","\\bigcirc",!0);b(v,w,re,"∙","\\bullet",!0);b(v,w,re,"‡","\\ddagger");b(v,w,re,"≀","\\wr",!0);b(v,w,re,"⨿","\\amalg");b(v,w,re,"&","\\And");b(v,w,M,"⟵","\\longleftarrow",!0);b(v,w,M,"⇐","\\Leftarrow",!0);b(v,w,M,"⟸","\\Longleftarrow",!0);b(v,w,M,"⟶","\\longrightarrow",!0);b(v,w,M,"⇒","\\Rightarrow",!0);b(v,w,M,"⟹","\\Longrightarrow",!0);b(v,w,M,"↔","\\leftrightarrow",!0);b(v,w,M,"⟷","\\longleftrightarrow",!0);b(v,w,M,"⇔","\\Leftrightarrow",!0);b(v,w,M,"⟺","\\Longleftrightarrow",!0);b(v,w,M,"↦","\\mapsto",!0);b(v,w,M,"⟼","\\longmapsto",!0);b(v,w,M,"↗","\\nearrow",!0);b(v,w,M,"↩","\\hookleftarrow",!0);b(v,w,M,"↪","\\hookrightarrow",!0);b(v,w,M,"↘","\\searrow",!0);b(v,w,M,"↼","\\leftharpoonup",!0);b(v,w,M,"⇀","\\rightharpoonup",!0);b(v,w,M,"↙","\\swarrow",!0);b(v,w,M,"↽","\\leftharpoondown",!0);b(v,w,M,"⇁","\\rightharpoondown",!0);b(v,w,M,"↖","\\nwarrow",!0);b(v,w,M,"⇌","\\rightleftharpoons",!0);b(v,A,M,"≮","\\nless",!0);b(v,A,M,"","\\@nleqslant");b(v,A,M,"","\\@nleqq");b(v,A,M,"⪇","\\lneq",!0);b(v,A,M,"≨","\\lneqq",!0);b(v,A,M,"","\\@lvertneqq");b(v,A,M,"⋦","\\lnsim",!0);b(v,A,M,"⪉","\\lnapprox",!0);b(v,A,M,"⊀","\\nprec",!0);b(v,A,M,"⋠","\\npreceq",!0);b(v,A,M,"⋨","\\precnsim",!0);b(v,A,M,"⪹","\\precnapprox",!0);b(v,A,M,"≁","\\nsim",!0);b(v,A,M,"","\\@nshortmid");b(v,A,M,"∤","\\nmid",!0);b(v,A,M,"⊬","\\nvdash",!0);b(v,A,M,"⊭","\\nvDash",!0);b(v,A,M,"⋪","\\ntriangleleft");b(v,A,M,"⋬","\\ntrianglelefteq",!0);b(v,A,M,"⊊","\\subsetneq",!0);b(v,A,M,"","\\@varsubsetneq");b(v,A,M,"⫋","\\subsetneqq",!0);b(v,A,M,"","\\@varsubsetneqq");b(v,A,M,"≯","\\ngtr",!0);b(v,A,M,"","\\@ngeqslant");b(v,A,M,"","\\@ngeqq");b(v,A,M,"⪈","\\gneq",!0);b(v,A,M,"≩","\\gneqq",!0);b(v,A,M,"","\\@gvertneqq");b(v,A,M,"⋧","\\gnsim",!0);b(v,A,M,"⪊","\\gnapprox",!0);b(v,A,M,"⊁","\\nsucc",!0);b(v,A,M,"⋡","\\nsucceq",!0);b(v,A,M,"⋩","\\succnsim",!0);b(v,A,M,"⪺","\\succnapprox",!0);b(v,A,M,"≆","\\ncong",!0);b(v,A,M,"","\\@nshortparallel");b(v,A,M,"∦","\\nparallel",!0);b(v,A,M,"⊯","\\nVDash",!0);b(v,A,M,"⋫","\\ntriangleright");b(v,A,M,"⋭","\\ntrianglerighteq",!0);b(v,A,M,"","\\@nsupseteqq");b(v,A,M,"⊋","\\supsetneq",!0);b(v,A,M,"","\\@varsupsetneq");b(v,A,M,"⫌","\\supsetneqq",!0);b(v,A,M,"","\\@varsupsetneqq");b(v,A,M,"⊮","\\nVdash",!0);b(v,A,M,"⪵","\\precneqq",!0);b(v,A,M,"⪶","\\succneqq",!0);b(v,A,M,"","\\@nsubseteqq");b(v,A,re,"⊴","\\unlhd");b(v,A,re,"⊵","\\unrhd");b(v,A,M,"↚","\\nleftarrow",!0);b(v,A,M,"↛","\\nrightarrow",!0);b(v,A,M,"⇍","\\nLeftarrow",!0);b(v,A,M,"⇏","\\nRightarrow",!0);b(v,A,M,"↮","\\nleftrightarrow",!0);b(v,A,M,"⇎","\\nLeftrightarrow",!0);b(v,A,M,"△","\\vartriangle");b(v,A,O,"ℏ","\\hslash");b(v,A,O,"▽","\\triangledown");b(v,A,O,"◊","\\lozenge");b(v,A,O,"Ⓢ","\\circledS");b(v,A,O,"®","\\circledR");b(H,A,O,"®","\\circledR");b(v,A,O,"∡","\\measuredangle",!0);b(v,A,O,"∄","\\nexists");b(v,A,O,"℧","\\mho");b(v,A,O,"Ⅎ","\\Finv",!0);b(v,A,O,"⅁","\\Game",!0);b(v,A,O,"‵","\\backprime");b(v,A,O,"▲","\\blacktriangle");b(v,A,O,"▼","\\blacktriangledown");b(v,A,O,"■","\\blacksquare");b(v,A,O,"⧫","\\blacklozenge");b(v,A,O,"★","\\bigstar");b(v,A,O,"∢","\\sphericalangle",!0);b(v,A,O,"∁","\\complement",!0);b(v,A,O,"ð","\\eth",!0);b(H,w,O,"ð","ð");b(v,A,O,"╱","\\diagup");b(v,A,O,"╲","\\diagdown");b(v,A,O,"□","\\square");b(v,A,O,"□","\\Box");b(v,A,O,"◊","\\Diamond");b(v,A,O,"¥","\\yen",!0);b(H,A,O,"¥","\\yen",!0);b(v,A,O,"✓","\\checkmark",!0);b(H,A,O,"✓","\\checkmark");b(v,A,O,"ℶ","\\beth",!0);b(v,A,O,"ℸ","\\daleth",!0);b(v,A,O,"ℷ","\\gimel",!0);b(v,A,O,"ϝ","\\digamma",!0);b(v,A,O,"ϰ","\\varkappa");b(v,A,zn,"┌","\\@ulcorner",!0);b(v,A,mn,"┐","\\@urcorner",!0);b(v,A,zn,"└","\\@llcorner",!0);b(v,A,mn,"┘","\\@lrcorner",!0);b(v,A,M,"≦","\\leqq",!0);b(v,A,M,"⩽","\\leqslant",!0);b(v,A,M,"⪕","\\eqslantless",!0);b(v,A,M,"≲","\\lesssim",!0);b(v,A,M,"⪅","\\lessapprox",!0);b(v,A,M,"≊","\\approxeq",!0);b(v,A,re,"⋖","\\lessdot");b(v,A,M,"⋘","\\lll",!0);b(v,A,M,"≶","\\lessgtr",!0);b(v,A,M,"⋚","\\lesseqgtr",!0);b(v,A,M,"⪋","\\lesseqqgtr",!0);b(v,A,M,"≑","\\doteqdot");b(v,A,M,"≓","\\risingdotseq",!0);b(v,A,M,"≒","\\fallingdotseq",!0);b(v,A,M,"∽","\\backsim",!0);b(v,A,M,"⋍","\\backsimeq",!0);b(v,A,M,"⫅","\\subseteqq",!0);b(v,A,M,"⋐","\\Subset",!0);b(v,A,M,"⊏","\\sqsubset",!0);b(v,A,M,"≼","\\preccurlyeq",!0);b(v,A,M,"⋞","\\curlyeqprec",!0);b(v,A,M,"≾","\\precsim",!0);b(v,A,M,"⪷","\\precapprox",!0);b(v,A,M,"⊲","\\vartriangleleft");b(v,A,M,"⊴","\\trianglelefteq");b(v,A,M,"⊨","\\vDash",!0);b(v,A,M,"⊪","\\Vvdash",!0);b(v,A,M,"⌣","\\smallsmile");b(v,A,M,"⌢","\\smallfrown");b(v,A,M,"≏","\\bumpeq",!0);b(v,A,M,"≎","\\Bumpeq",!0);b(v,A,M,"≧","\\geqq",!0);b(v,A,M,"⩾","\\geqslant",!0);b(v,A,M,"⪖","\\eqslantgtr",!0);b(v,A,M,"≳","\\gtrsim",!0);b(v,A,M,"⪆","\\gtrapprox",!0);b(v,A,re,"⋗","\\gtrdot");b(v,A,M,"⋙","\\ggg",!0);b(v,A,M,"≷","\\gtrless",!0);b(v,A,M,"⋛","\\gtreqless",!0);b(v,A,M,"⪌","\\gtreqqless",!0);b(v,A,M,"≖","\\eqcirc",!0);b(v,A,M,"≗","\\circeq",!0);b(v,A,M,"≜","\\triangleq",!0);b(v,A,M,"∼","\\thicksim");b(v,A,M,"≈","\\thickapprox");b(v,A,M,"⫆","\\supseteqq",!0);b(v,A,M,"⋑","\\Supset",!0);b(v,A,M,"⊐","\\sqsupset",!0);b(v,A,M,"≽","\\succcurlyeq",!0);b(v,A,M,"⋟","\\curlyeqsucc",!0);b(v,A,M,"≿","\\succsim",!0);b(v,A,M,"⪸","\\succapprox",!0);b(v,A,M,"⊳","\\vartriangleright");b(v,A,M,"⊵","\\trianglerighteq");b(v,A,M,"⊩","\\Vdash",!0);b(v,A,M,"∣","\\shortmid");b(v,A,M,"∥","\\shortparallel");b(v,A,M,"≬","\\between",!0);b(v,A,M,"⋔","\\pitchfork",!0);b(v,A,M,"∝","\\varpropto");b(v,A,M,"◀","\\blacktriangleleft");b(v,A,M,"∴","\\therefore",!0);b(v,A,M,"∍","\\backepsilon");b(v,A,M,"▶","\\blacktriangleright");b(v,A,M,"∵","\\because",!0);b(v,A,M,"⋘","\\llless");b(v,A,M,"⋙","\\gggtr");b(v,A,re,"⊲","\\lhd");b(v,A,re,"⊳","\\rhd");b(v,A,M,"≂","\\eqsim",!0);b(v,w,M,"⋈","\\Join");b(v,A,M,"≑","\\Doteq",!0);b(v,A,re,"∔","\\dotplus",!0);b(v,A,re,"∖","\\smallsetminus");b(v,A,re,"⋒","\\Cap",!0);b(v,A,re,"⋓","\\Cup",!0);b(v,A,re,"⩞","\\doublebarwedge",!0);b(v,A,re,"⊟","\\boxminus",!0);b(v,A,re,"⊞","\\boxplus",!0);b(v,A,re,"⋇","\\divideontimes",!0);b(v,A,re,"⋉","\\ltimes",!0);b(v,A,re,"⋊","\\rtimes",!0);b(v,A,re,"⋋","\\leftthreetimes",!0);b(v,A,re,"⋌","\\rightthreetimes",!0);b(v,A,re,"⋏","\\curlywedge",!0);b(v,A,re,"⋎","\\curlyvee",!0);b(v,A,re,"⊝","\\circleddash",!0);b(v,A,re,"⊛","\\circledast",!0);b(v,A,re,"⋅","\\centerdot");b(v,A,re,"⊺","\\intercal",!0);b(v,A,re,"⋒","\\doublecap");b(v,A,re,"⋓","\\doublecup");b(v,A,re,"⊠","\\boxtimes",!0);b(v,A,M,"⇢","\\dashrightarrow",!0);b(v,A,M,"⇠","\\dashleftarrow",!0);b(v,A,M,"⇇","\\leftleftarrows",!0);b(v,A,M,"⇆","\\leftrightarrows",!0);b(v,A,M,"⇚","\\Lleftarrow",!0);b(v,A,M,"↞","\\twoheadleftarrow",!0);b(v,A,M,"↢","\\leftarrowtail",!0);b(v,A,M,"↫","\\looparrowleft",!0);b(v,A,M,"⇋","\\leftrightharpoons",!0);b(v,A,M,"↶","\\curvearrowleft",!0);b(v,A,M,"↺","\\circlearrowleft",!0);b(v,A,M,"↰","\\Lsh",!0);b(v,A,M,"⇈","\\upuparrows",!0);b(v,A,M,"↿","\\upharpoonleft",!0);b(v,A,M,"⇃","\\downharpoonleft",!0);b(v,w,M,"⊶","\\origof",!0);b(v,w,M,"⊷","\\imageof",!0);b(v,A,M,"⊸","\\multimap",!0);b(v,A,M,"↭","\\leftrightsquigarrow",!0);b(v,A,M,"⇉","\\rightrightarrows",!0);b(v,A,M,"⇄","\\rightleftarrows",!0);b(v,A,M,"↠","\\twoheadrightarrow",!0);b(v,A,M,"↣","\\rightarrowtail",!0);b(v,A,M,"↬","\\looparrowright",!0);b(v,A,M,"↷","\\curvearrowright",!0);b(v,A,M,"↻","\\circlearrowright",!0);b(v,A,M,"↱","\\Rsh",!0);b(v,A,M,"⇊","\\downdownarrows",!0);b(v,A,M,"↾","\\upharpoonright",!0);b(v,A,M,"⇂","\\downharpoonright",!0);b(v,A,M,"⇝","\\rightsquigarrow",!0);b(v,A,M,"⇝","\\leadsto");b(v,A,M,"⇛","\\Rrightarrow",!0);b(v,A,M,"↾","\\restriction");b(v,w,O,"‘","`");b(v,w,O,"$","\\$");b(H,w,O,"$","\\$");b(H,w,O,"$","\\textdollar");b(v,w,O,"%","\\%");b(H,w,O,"%","\\%");b(v,w,O,"_","\\_");b(H,w,O,"_","\\_");b(H,w,O,"_","\\textunderscore");b(v,w,O,"∠","\\angle",!0);b(v,w,O,"∞","\\infty",!0);b(v,w,O,"′","\\prime");b(v,w,O,"△","\\triangle");b(v,w,O,"Γ","\\Gamma",!0);b(v,w,O,"Δ","\\Delta",!0);b(v,w,O,"Θ","\\Theta",!0);b(v,w,O,"Λ","\\Lambda",!0);b(v,w,O,"Ξ","\\Xi",!0);b(v,w,O,"Π","\\Pi",!0);b(v,w,O,"Σ","\\Sigma",!0);b(v,w,O,"Υ","\\Upsilon",!0);b(v,w,O,"Φ","\\Phi",!0);b(v,w,O,"Ψ","\\Psi",!0);b(v,w,O,"Ω","\\Omega",!0);b(v,w,O,"A","Α");b(v,w,O,"B","Β");b(v,w,O,"E","Ε");b(v,w,O,"Z","Ζ");b(v,w,O,"H","Η");b(v,w,O,"I","Ι");b(v,w,O,"K","Κ");b(v,w,O,"M","Μ");b(v,w,O,"N","Ν");b(v,w,O,"O","Ο");b(v,w,O,"P","Ρ");b(v,w,O,"T","Τ");b(v,w,O,"X","Χ");b(v,w,O,"¬","\\neg",!0);b(v,w,O,"¬","\\lnot");b(v,w,O,"⊤","\\top");b(v,w,O,"⊥","\\bot");b(v,w,O,"∅","\\emptyset");b(v,A,O,"∅","\\varnothing");b(v,w,he,"α","\\alpha",!0);b(v,w,he,"β","\\beta",!0);b(v,w,he,"γ","\\gamma",!0);b(v,w,he,"δ","\\delta",!0);b(v,w,he,"ϵ","\\epsilon",!0);b(v,w,he,"ζ","\\zeta",!0);b(v,w,he,"η","\\eta",!0);b(v,w,he,"θ","\\theta",!0);b(v,w,he,"ι","\\iota",!0);b(v,w,he,"κ","\\kappa",!0);b(v,w,he,"λ","\\lambda",!0);b(v,w,he,"μ","\\mu",!0);b(v,w,he,"ν","\\nu",!0);b(v,w,he,"ξ","\\xi",!0);b(v,w,he,"ο","\\omicron",!0);b(v,w,he,"π","\\pi",!0);b(v,w,he,"ρ","\\rho",!0);b(v,w,he,"σ","\\sigma",!0);b(v,w,he,"τ","\\tau",!0);b(v,w,he,"υ","\\upsilon",!0);b(v,w,he,"ϕ","\\phi",!0);b(v,w,he,"χ","\\chi",!0);b(v,w,he,"ψ","\\psi",!0);b(v,w,he,"ω","\\omega",!0);b(v,w,he,"ε","\\varepsilon",!0);b(v,w,he,"ϑ","\\vartheta",!0);b(v,w,he,"ϖ","\\varpi",!0);b(v,w,he,"ϱ","\\varrho",!0);b(v,w,he,"ς","\\varsigma",!0);b(v,w,he,"φ","\\varphi",!0);b(v,w,re,"∗","*",!0);b(v,w,re,"+","+");b(v,w,re,"−","-",!0);b(v,w,re,"⋅","\\cdot",!0);b(v,w,re,"∘","\\circ",!0);b(v,w,re,"÷","\\div",!0);b(v,w,re,"±","\\pm",!0);b(v,w,re,"×","\\times",!0);b(v,w,re,"∩","\\cap",!0);b(v,w,re,"∪","\\cup",!0);b(v,w,re,"∖","\\setminus",!0);b(v,w,re,"∧","\\land");b(v,w,re,"∨","\\lor");b(v,w,re,"∧","\\wedge",!0);b(v,w,re,"∨","\\vee",!0);b(v,w,O,"√","\\surd");b(v,w,zn,"⟨","\\langle",!0);b(v,w,zn,"∣","\\lvert");b(v,w,zn,"∥","\\lVert");b(v,w,mn,"?","?");b(v,w,mn,"!","!");b(v,w,mn,"⟩","\\rangle",!0);b(v,w,mn,"∣","\\rvert");b(v,w,mn,"∥","\\rVert");b(v,w,M,"=","=");b(v,w,M,":",":");b(v,w,M,"≈","\\approx",!0);b(v,w,M,"≅","\\cong",!0);b(v,w,M,"≥","\\ge");b(v,w,M,"≥","\\geq",!0);b(v,w,M,"←","\\gets");b(v,w,M,">","\\gt",!0);b(v,w,M,"∈","\\in",!0);b(v,w,M,"","\\@not");b(v,w,M,"⊂","\\subset",!0);b(v,w,M,"⊃","\\supset",!0);b(v,w,M,"⊆","\\subseteq",!0);b(v,w,M,"⊇","\\supseteq",!0);b(v,A,M,"⊈","\\nsubseteq",!0);b(v,A,M,"⊉","\\nsupseteq",!0);b(v,w,M,"⊨","\\models");b(v,w,M,"←","\\leftarrow",!0);b(v,w,M,"≤","\\le");b(v,w,M,"≤","\\leq",!0);b(v,w,M,"<","\\lt",!0);b(v,w,M,"→","\\rightarrow",!0);b(v,w,M,"→","\\to");b(v,A,M,"≱","\\ngeq",!0);b(v,A,M,"≰","\\nleq",!0);b(v,w,bi," ","\\ ");b(v,w,bi," ","\\space");b(v,w,bi," ","\\nobreakspace");b(H,w,bi," ","\\ ");b(H,w,bi," "," ");b(H,w,bi," ","\\space");b(H,w,bi," ","\\nobreakspace");b(v,w,bi,"","\\nobreak");b(v,w,bi,"","\\allowbreak");b(v,w,El,",",",");b(v,w,El,";",";");b(v,A,re,"⊼","\\barwedge",!0);b(v,A,re,"⊻","\\veebar",!0);b(v,w,re,"⊙","\\odot",!0);b(v,w,re,"⊕","\\oplus",!0);b(v,w,re,"⊗","\\otimes",!0);b(v,w,O,"∂","\\partial",!0);b(v,w,re,"⊘","\\oslash",!0);b(v,A,re,"⊚","\\circledcirc",!0);b(v,A,re,"⊡","\\boxdot",!0);b(v,w,re,"△","\\bigtriangleup");b(v,w,re,"▽","\\bigtriangledown");b(v,w,re,"†","\\dagger");b(v,w,re,"⋄","\\diamond");b(v,w,re,"⋆","\\star");b(v,w,re,"◃","\\triangleleft");b(v,w,re,"▹","\\triangleright");b(v,w,zn,"{","\\{");b(H,w,O,"{","\\{");b(H,w,O,"{","\\textbraceleft");b(v,w,mn,"}","\\}");b(H,w,O,"}","\\}");b(H,w,O,"}","\\textbraceright");b(v,w,zn,"{","\\lbrace");b(v,w,mn,"}","\\rbrace");b(v,w,zn,"[","\\lbrack",!0);b(H,w,O,"[","\\lbrack",!0);b(v,w,mn,"]","\\rbrack",!0);b(H,w,O,"]","\\rbrack",!0);b(v,w,zn,"(","\\lparen",!0);b(v,w,mn,")","\\rparen",!0);b(H,w,O,"<","\\textless",!0);b(H,w,O,">","\\textgreater",!0);b(v,w,zn,"⌊","\\lfloor",!0);b(v,w,mn,"⌋","\\rfloor",!0);b(v,w,zn,"⌈","\\lceil",!0);b(v,w,mn,"⌉","\\rceil",!0);b(v,w,O,"\\","\\backslash");b(v,w,O,"∣","|");b(v,w,O,"∣","\\vert");b(H,w,O,"|","\\textbar",!0);b(v,w,O,"∥","\\|");b(v,w,O,"∥","\\Vert");b(H,w,O,"∥","\\textbardbl");b(H,w,O,"~","\\textasciitilde");b(H,w,O,"\\","\\textbackslash");b(H,w,O,"^","\\textasciicircum");b(v,w,M,"↑","\\uparrow",!0);b(v,w,M,"⇑","\\Uparrow",!0);b(v,w,M,"↓","\\downarrow",!0);b(v,w,M,"⇓","\\Downarrow",!0);b(v,w,M,"↕","\\updownarrow",!0);b(v,w,M,"⇕","\\Updownarrow",!0);b(v,w,Rt,"∐","\\coprod");b(v,w,Rt,"⋁","\\bigvee");b(v,w,Rt,"⋀","\\bigwedge");b(v,w,Rt,"⨄","\\biguplus");b(v,w,Rt,"⋂","\\bigcap");b(v,w,Rt,"⋃","\\bigcup");b(v,w,Rt,"∫","\\int");b(v,w,Rt,"∫","\\intop");b(v,w,Rt,"∬","\\iint");b(v,w,Rt,"∭","\\iiint");b(v,w,Rt,"∏","\\prod");b(v,w,Rt,"∑","\\sum");b(v,w,Rt,"⨂","\\bigotimes");b(v,w,Rt,"⨁","\\bigoplus");b(v,w,Rt,"⨀","\\bigodot");b(v,w,Rt,"∮","\\oint");b(v,w,Rt,"∯","\\oiint");b(v,w,Rt,"∰","\\oiiint");b(v,w,Rt,"⨆","\\bigsqcup");b(v,w,Rt,"∫","\\smallint");b(H,w,na,"…","\\textellipsis");b(v,w,na,"…","\\mathellipsis");b(H,w,na,"…","\\ldots",!0);b(v,w,na,"…","\\ldots",!0);b(v,w,na,"⋯","\\@cdots",!0);b(v,w,na,"⋱","\\ddots",!0);b(v,w,O,"⋮","\\varvdots");b(H,w,O,"⋮","\\varvdots");b(v,w,ht,"ˊ","\\acute");b(v,w,ht,"ˋ","\\grave");b(v,w,ht,"¨","\\ddot");b(v,w,ht,"~","\\tilde");b(v,w,ht,"ˉ","\\bar");b(v,w,ht,"˘","\\breve");b(v,w,ht,"ˇ","\\check");b(v,w,ht,"^","\\hat");b(v,w,ht,"⃗","\\vec");b(v,w,ht,"˙","\\dot");b(v,w,ht,"˚","\\mathring");b(v,w,he,"","\\@imath");b(v,w,he,"","\\@jmath");b(v,w,O,"ı","ı");b(v,w,O,"ȷ","ȷ");b(H,w,O,"ı","\\i",!0);b(H,w,O,"ȷ","\\j",!0);b(H,w,O,"ß","\\ss",!0);b(H,w,O,"æ","\\ae",!0);b(H,w,O,"œ","\\oe",!0);b(H,w,O,"ø","\\o",!0);b(H,w,O,"Æ","\\AE",!0);b(H,w,O,"Œ","\\OE",!0);b(H,w,O,"Ø","\\O",!0);b(H,w,ht,"ˊ","\\'");b(H,w,ht,"ˋ","\\`");b(H,w,ht,"ˆ","\\^");b(H,w,ht,"˜","\\~");b(H,w,ht,"ˉ","\\=");b(H,w,ht,"˘","\\u");b(H,w,ht,"˙","\\.");b(H,w,ht,"¸","\\c");b(H,w,ht,"˚","\\r");b(H,w,ht,"ˇ","\\v");b(H,w,ht,"¨",'\\"');b(H,w,ht,"˝","\\H");b(H,w,ht,"◯","\\textcircled");var H3={"--":!0,"---":!0,"``":!0,"''":!0};b(H,w,O,"–","--",!0);b(H,w,O,"–","\\textendash");b(H,w,O,"—","---",!0);b(H,w,O,"—","\\textemdash");b(H,w,O,"‘","`",!0);b(H,w,O,"‘","\\textquoteleft");b(H,w,O,"’","'",!0);b(H,w,O,"’","\\textquoteright");b(H,w,O,"“","``",!0);b(H,w,O,"“","\\textquotedblleft");b(H,w,O,"”","''",!0);b(H,w,O,"”","\\textquotedblright");b(v,w,O,"°","\\degree",!0);b(H,w,O,"°","\\degree");b(H,w,O,"°","\\textdegree",!0);b(v,w,O,"£","\\pounds");b(v,w,O,"£","\\mathsterling",!0);b(H,w,O,"£","\\pounds");b(H,w,O,"£","\\textsterling",!0);b(v,A,O,"✠","\\maltese");b(H,A,O,"✠","\\maltese");var X1='0123456789/@."';for(var kd=0;kd<X1.length;kd++){var Q1=X1.charAt(kd);b(v,w,O,Q1,Q1)}var eg='0123456789!@*()-=+";:?/.,';for(var Ed=0;Ed<eg.length;Ed++){var tg=eg.charAt(Ed);b(H,w,O,tg,tg)}var Qu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Sd=0;Sd<Qu.length;Sd++){var Jl=Qu.charAt(Sd);b(v,w,he,Jl,Jl),b(H,w,O,Jl,Jl)}b(v,A,O,"C","ℂ");b(H,A,O,"C","ℂ");b(v,A,O,"H","ℍ");b(H,A,O,"H","ℍ");b(v,A,O,"N","ℕ");b(H,A,O,"N","ℕ");b(v,A,O,"P","ℙ");b(H,A,O,"P","ℙ");b(v,A,O,"Q","ℚ");b(H,A,O,"Q","ℚ");b(v,A,O,"R","ℝ");b(H,A,O,"R","ℝ");b(v,A,O,"Z","ℤ");b(H,A,O,"Z","ℤ");b(v,w,he,"h","ℎ");b(H,w,he,"h","ℎ");var ge;for(var on=0;on<Qu.length;on++){var yt=Qu.charAt(on);ge=String.fromCharCode(55349,56320+on),b(v,w,he,yt,ge),b(H,w,O,yt,ge),ge=String.fromCharCode(55349,56372+on),b(v,w,he,yt,ge),b(H,w,O,yt,ge),ge=String.fromCharCode(55349,56424+on),b(v,w,he,yt,ge),b(H,w,O,yt,ge),ge=String.fromCharCode(55349,56580+on),b(v,w,he,yt,ge),b(H,w,O,yt,ge),ge=String.fromCharCode(55349,56684+on),b(v,w,he,yt,ge),b(H,w,O,yt,ge),ge=String.fromCharCode(55349,56736+on),b(v,w,he,yt,ge),b(H,w,O,yt,ge),ge=String.fromCharCode(55349,56788+on),b(v,w,he,yt,ge),b(H,w,O,yt,ge),ge=String.fromCharCode(55349,56840+on),b(v,w,he,yt,ge),b(H,w,O,yt,ge),ge=String.fromCharCode(55349,56944+on),b(v,w,he,yt,ge),b(H,w,O,yt,ge),on<26&&(ge=String.fromCharCode(55349,56632+on),b(v,w,he,yt,ge),b(H,w,O,yt,ge),ge=String.fromCharCode(55349,56476+on),b(v,w,he,yt,ge),b(H,w,O,yt,ge))}ge="𝕜";b(v,w,he,"k",ge);b(H,w,O,"k",ge);for(var ws=0;ws<10;ws++){var Mi=ws.toString();ge=String.fromCharCode(55349,57294+ws),b(v,w,he,Mi,ge),b(H,w,O,Mi,ge),ge=String.fromCharCode(55349,57314+ws),b(v,w,he,Mi,ge),b(H,w,O,Mi,ge),ge=String.fromCharCode(55349,57324+ws),b(v,w,he,Mi,ge),b(H,w,O,Mi,ge),ge=String.fromCharCode(55349,57334+ws),b(v,w,he,Mi,ge),b(H,w,O,Mi,ge)}var cf="ÐÞþ";for(var Cd=0;Cd<cf.length;Cd++){var Xl=cf.charAt(Cd);b(v,w,he,Xl,Xl),b(H,w,O,Xl,Xl)}var df={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},ng={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},rg={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},S9={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},As={mathClass:"",textClass:"",font:""},ig={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},sg={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},og={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},hf={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},ff={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},ag={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},pf={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},lg=[df,df,ng,ng,rg,rg,S9,As,As,As,ig,ig,sg,sg,og,og,hf,hf,ff,ff,ag,ag,As,As,pf,pf],C9=[df,As,hf,ff,pf],_9=t=>{var e=t.charCodeAt(0),n=t.charCodeAt(1),r=(e-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var i=Math.floor((r-119808)/26);return lg[i]}else if(120782<=r&&r<=120831){var s=Math.floor((r-120782)/10);return C9[s]}else{if(r===120485||r===120486)return lg[0];if(120486<r&&r<120782)return As;throw new V("Unsupported character: "+t)}},w0=function(e,n,r){if(dt[r][e]){var i=dt[r][e].replace;i&&(e=i)}return{value:e,metrics:Wp(e,n,r)}},ln=function(e,n,r,i,s){var o=w0(e,n,r),a=o.metrics;e=o.value;var l;if(a){var u=a.italic;(r==="text"||i&&i.font==="mathit")&&(u=0),l=new In(e,a.height,a.depth,u,a.skew,a.width,s)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+n+"' and mode '"+r+"'")),l=new In(e,0,0,0,0,0,s);if(i){l.maxFontSize=i.sizeMultiplier,i.style.isTight()&&l.classes.push("mtight");var c=i.getColor();c&&(l.style.color=c)}return l},Gp=function(e,n,r,i){return i===void 0&&(i=[]),r.font==="boldsymbol"&&w0(e,"Main-Bold",n).metrics?ln(e,"Main-Bold",n,r,i.concat(["mathbf"])):e==="\\"||dt[n][e].font==="main"?ln(e,"Main-Regular",n,r,i):ln(e,"AMS-Regular",n,r,i.concat(["amsrm"]))},A9=function(e,n,r){return r!=="textord"&&w0(e,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},k0=function(e,n,r){var i=e.mode,s=e.text,o=["mord"],{font:a,fontFamily:l,fontWeight:u,fontShape:c}=n,d=i==="math"||i==="text"&&!!a,h=d?a:l,f="",p="";if(s.charCodeAt(0)===55349){var m=_9(s);f=m.font,p=m[i+"Class"]}if(f)return ln(s,f,i,n,o.concat(p));if(h){var g,y;if(h==="boldsymbol"){var x=A9(s,i,r);g=x.fontName,y=[x.fontClass]}else d?(g=mf[a].fontName,y=[a]):(g=Ql(l,u,c),y=[l,u,c]);if(w0(s,g,i).metrics)return ln(s,g,i,n,o.concat(y));if(H3.hasOwnProperty(s)&&g.slice(0,10)==="Typewriter"){for(var k=[],C=0;C<s.length;C++)k.push(ln(s[C],g,i,n,o.concat(y)));return yi(k)}}if(r==="mathord")return ln(s,"Math-Italic",i,n,o.concat(["mathnormal"]));if(r==="textord"){var _=dt[i][s]&&dt[i][s].font;if(_==="ams"){var T=Ql("amsrm",u,c);return ln(s,T,i,n,o.concat("amsrm",u,c))}else if(_==="main"||!_){var D=Ql("textrm",u,c);return ln(s,D,i,n,o.concat(u,c))}else{var I=Ql(_,u,c);return ln(s,I,i,n,o.concat(I,u,c))}}else throw new Error("unexpected type: "+r+" in makeOrd")},T9=(t,e)=>{if(Ji(t.classes)!==Ji(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var n=t.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(t.style))if(t.style[r]!==e.style[r])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},U3=t=>{for(var e=0;e<t.length-1;e++){var n=t[e],r=t[e+1];n instanceof In&&r instanceof In&&T9(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,t.splice(e+1,1),e--)}return t},Kp=function(e){for(var n=0,r=0,i=0,s=0;s<e.children.length;s++){var o=e.children[s];o.height>n&&(n=o.height),o.depth>r&&(r=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}e.height=n,e.depth=r,e.maxFontSize=i},q=function(e,n,r,i){var s=new ta(e,n,r,i);return Kp(s),s},Qi=(t,e,n,r)=>new ta(t,e,n,r),Fo=function(e,n,r){var i=q([e],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=K(i.height),i.maxFontSize=1,i},M9=function(e,n,r,i){var s=new x0(e,n,r,i);return Kp(s),s},yi=function(e){var n=new ea(e);return Kp(n),n},Po=function(e,n){return e instanceof ea?q([],[e],n):e},N9=function(e){if(e.positionType==="individualShift"){for(var n=e.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,s=i,o=1;o<n.length;o++){var a=-n[o].shift-s-n[o].elem.depth,l=a-(n[o-1].elem.height+n[o-1].elem.depth);s=s+a,r.push({type:"kern",size:l}),r.push(n[o])}return{children:r,depth:i}}var u;if(e.positionType==="top"){for(var c=e.positionData,d=0;d<e.children.length;d++){var h=e.children[d];c-=h.type==="kern"?h.size:h.elem.height+h.elem.depth}u=c}else if(e.positionType==="bottom")u=-e.positionData;else{var f=e.children[0];if(f.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")u=-f.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")u=-f.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:u}},He=function(e,n){for(var{children:r,depth:i}=N9(e),s=0,o=0;o<r.length;o++){var a=r[o];if(a.type==="elem"){var l=a.elem;s=Math.max(s,l.maxFontSize,l.height)}}s+=2;var u=q(["pstrut"],[]);u.style.height=K(s);for(var c=[],d=i,h=i,f=i,p=0;p<r.length;p++){var m=r[p];if(m.type==="kern")f+=m.size;else{var g=m.elem,y=m.wrapperClasses||[],x=m.wrapperStyle||{},k=q(y,[u,g],void 0,x);k.style.top=K(-s-f-g.depth),m.marginLeft&&(k.style.marginLeft=m.marginLeft),m.marginRight&&(k.style.marginRight=m.marginRight),c.push(k),f+=g.height+g.depth}d=Math.min(d,f),h=Math.max(h,f)}var C=q(["vlist"],c);C.style.height=K(h);var _;if(d<0){var T=q([],[]),D=q(["vlist"],[T]);D.style.height=K(-d);var I=q(["vlist-s"],[new In("​")]);_=[q(["vlist-r"],[C,I]),q(["vlist-r"],[D])]}else _=[q(["vlist-r"],[C])];var L=q(["vlist-t"],_);return _.length===2&&L.classes.push("vlist-t2"),L.height=h,L.depth=-d,L},q3=(t,e)=>{var n=q(["mspace"],[],e),r=bt(t,e);return n.style.marginRight=K(r),n},Ql=(t,e,n)=>{var r,i;switch(t){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=t}return e==="textbf"&&n==="textit"?i="BoldItalic":e==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",r+"-"+i},mf={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},j3={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},V3=function(e,n){var[r,i,s]=j3[e],o=new Xi(r),a=new mi([o],{width:K(i),height:K(s),style:"width:"+K(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=Qi(["overlay"],[a],n);return l.height=s,l.style.height=K(s),l.style.width=K(i),l},gt={number:3,unit:"mu"},ks={number:4,unit:"mu"},Jr={number:5,unit:"mu"},D9={mord:{mop:gt,mbin:ks,mrel:Jr,minner:gt},mop:{mord:gt,mop:gt,mrel:Jr,minner:gt},mbin:{mord:ks,mop:ks,mopen:ks,minner:ks},mrel:{mord:Jr,mop:Jr,mopen:Jr,minner:Jr},mopen:{},mclose:{mop:gt,mbin:ks,mrel:Jr,minner:gt},mpunct:{mord:gt,mop:gt,mrel:Jr,mopen:gt,mclose:gt,mpunct:gt,minner:gt},minner:{mord:gt,mop:gt,mbin:ks,mrel:Jr,mopen:gt,mpunct:gt,minner:gt}},O9={mord:{mop:gt},mop:{mord:gt,mop:gt},mbin:{},mrel:{},mopen:{},mclose:{mop:gt},mpunct:{},minner:{mop:gt}},W3={},ec={},tc={};function ee(t){for(var{type:e,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:o}=t,a={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l<n.length;++l)W3[n[l]]=a;e&&(s&&(ec[e]=s),o&&(tc[e]=o))}function to(t){var{type:e,htmlBuilder:n,mathmlBuilder:r}=t;ee({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var nc=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},Tt=function(e){return e.type==="ordgroup"?e.body:[e]},R9=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),I9=new Set(["rightmost","mrel","mclose","mpunct"]),L9={display:ye.DISPLAY,text:ye.TEXT,script:ye.SCRIPT,scriptscript:ye.SCRIPTSCRIPT},z9={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},zt=function(e,n,r,i){i===void 0&&(i=[null,null]);for(var s=[],o=0;o<e.length;o++){var a=Ue(e[o],n);if(a instanceof ea){var l=a.children;s.push(...l)}else s.push(a)}if(U3(s),!r)return s;var u=n;if(e.length===1){var c=e[0];c.type==="sizing"?u=n.havingSize(c.size):c.type==="styling"&&(u=n.havingStyle(L9[c.style]))}var d=q([i[0]||"leftmost"],[],n),h=q([i[1]||"rightmost"],[],n),f=r==="root";return gf(s,(p,m)=>{var g=m.classes[0],y=p.classes[0];g==="mbin"&&I9.has(y)?m.classes[0]="mord":y==="mbin"&&R9.has(g)&&(p.classes[0]="mord")},{node:d},h,f),gf(s,(p,m)=>{var g,y,x=yf(m),k=yf(p),C=x&&k?p.hasClass("mtight")?(g=O9[x])==null?void 0:g[k]:(y=D9[x])==null?void 0:y[k]:null;if(C)return q3(C,u)},{node:d},h,f),s},gf=function(e,n,r,i,s){i&&e.push(i);for(var o=0;o<e.length;o++){var a=e[o],l=G3(a);if(l){gf(l.children,n,r,null,s);continue}var u=!a.hasClass("mspace");if(u){var c=n(a,r.node);c&&(r.insertAfter?r.insertAfter(c):(e.unshift(c),o++))}u?r.node=a:s&&a.hasClass("newline")&&(r.node=q(["leftmost"])),r.insertAfter=(d=>h=>{e.splice(d+1,0,h),o++})(o)}i&&e.pop()},G3=function(e){return e instanceof ea||e instanceof x0||e instanceof ta&&e.hasClass("enclosing")?e:null},bf=function(e,n){var r=G3(e);if(r){var i=r.children;if(i.length){if(n==="right")return bf(i[i.length-1],"right");if(n==="left")return bf(i[0],"left")}}return e},yf=function(e,n){if(!e)return null;n&&(e=bf(e,n));var r=e.classes[0];return z9[r]||null},Wa=function(e,n){var r=["nulldelimiter"].concat(e.baseSizingClasses());return q(n.concat(r))},Ue=function(e,n,r){if(!e)return q();if(ec[e.type]){var i=ec[e.type](e,n);if(r&&n.size!==r.size){i=q(n.sizingClasses(r),[i],n);var s=n.sizeMultiplier/r.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new V("Got group of unknown type: '"+e.type+"'")};function eu(t,e){var n=q(["base"],t,e),r=q(["strut"]);return r.style.height=K(n.height+n.depth),n.depth&&(r.style.verticalAlign=K(-n.depth)),n.children.unshift(r),n}function vf(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var r=zt(t,e,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var s=[],o=[],a=0;a<r.length;a++)if(o.push(r[a]),r[a].hasClass("mbin")||r[a].hasClass("mrel")||r[a].hasClass("allowbreak")){for(var l=!1;a<r.length-1&&r[a+1].hasClass("mspace")&&!r[a+1].hasClass("newline");)a++,o.push(r[a]),r[a].hasClass("nobreak")&&(l=!0);l||(s.push(eu(o,e)),o=[])}else r[a].hasClass("newline")&&(o.pop(),o.length>0&&(s.push(eu(o,e)),o=[]),s.push(r[a]));o.length>0&&s.push(eu(o,e));var u;n?(u=eu(zt(n,e,!0),e),u.classes=["tag"],s.push(u)):i&&s.push(i);var c=q(["katex-html"],s);if(c.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=K(c.height+c.depth),c.depth&&(d.style.verticalAlign=K(-c.depth))}return c}function K3(t){return new ea(t)}class W{constructor(e,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(e,n){this.attributes[e]=n}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&e.setAttribute(n,this.attributes[n]);this.classes.length>0&&(e.className=Ji(this.classes));for(var r=0;r<this.children.length;r++)if(this.children[r]instanceof Mt&&this.children[r+1]instanceof Mt){for(var i=this.children[r].toText()+this.children[++r].toText();this.children[r+1]instanceof Mt;)i+=this.children[++r].toText();e.appendChild(new Mt(i).toNode())}else e.appendChild(this.children[r].toNode());return e}toMarkup(){var e="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(e+=" "+n+'="',e+=Qt(this.attributes[n]),e+='"');this.classes.length>0&&(e+=' class ="'+Qt(Ji(this.classes))+'"'),e+=">";for(var r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}let Mt=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Qt(this.toText())}toText(){return this.text}};class Y3{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",K(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+K(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var B9=new Set(["\\imath","\\jmath"]),F9=new Set(["mrow","mtable"]),rr=function(e,n,r){return dt[n][e]&&dt[n][e].replace&&e.charCodeAt(0)!==55349&&!(H3.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=dt[n][e].replace),new Mt(e)},Yp=function(e){return e.length===1?e[0]:new W("mrow",e)},P9={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},Zp=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var n=e.font;if(!n||n==="mathnormal")return null;var r=t.mode,i=P9[n];if(i)return typeof i=="function"?i(t):i;var s=t.text;if(B9.has(s))return null;if(dt[r][s]){var o=dt[r][s].replace;o&&(s=o)}var a=mf[n].fontName;return Wp(s,a,r)?mf[n].variant:null};function _d(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Mt&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var n=t.children[0];return n instanceof Mt&&n.text===","}else return!1}var Bn=function(e,n,r){if(e.length===1){var i=Xe(e[0],n);return r&&i instanceof W&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],o,a=0;a<e.length;a++){var l=Xe(e[a],n);if(l instanceof W&&o instanceof W){if(l.type==="mtext"&&o.type==="mtext"&&l.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...l.children);continue}else if(l.type==="mn"&&o.type==="mn"){o.children.push(...l.children);continue}else if(_d(l)&&o.type==="mn"){o.children.push(...l.children);continue}else if(l.type==="mn"&&_d(o))l.children=[...o.children,...l.children],s.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(o.type==="mn"||_d(o))){var u=l.children[0];u instanceof W&&u.type==="mn"&&(u.children=[...o.children,...u.children],s.pop())}else if(o.type==="mi"&&o.children.length===1){var c=o.children[0];if(c instanceof Mt&&c.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Mt&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),o=l}return s},es=function(e,n,r){return Yp(Bn(e,n,r))},Xe=function(e,n){if(!e)return new W("mrow");if(tc[e.type])return tc[e.type](e,n);throw new V("Got group of unknown type: '"+e.type+"'")};function ug(t,e,n,r,i){var s=Bn(t,n),o;s.length===1&&s[0]instanceof W&&F9.has(s[0].type)?o=s[0]:o=new W("mrow",s);var a=new W("annotation",[new Mt(e)]);a.setAttribute("encoding","application/x-tex");var l=new W("semantics",[o,a]),u=new W("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var c=i?"katex":"katex-mathml";return q([c],[u])}var $9=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],cg=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],dg=function(e,n){return n.size<2?e:$9[e-1][n.size-1]};let Z3=class Cs{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Cs.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=cg[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,e),new Cs(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:dg(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:cg[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=dg(Cs.BASESIZE,e);return this.size===n&&this.textSize===Cs.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Cs.BASESIZE?["sizing","reset-size"+this.size,"size"+Cs.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=E9(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};Z3.BASESIZE=6;var J3=function(e){return new Z3({style:e.displayMode?ye.DISPLAY:ye.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},X3=function(e,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),e=q(r,[e])}return e},H9=function(e,n,r){var i=J3(r),s;if(r.output==="mathml")return ug(e,n,i,r.displayMode,!0);if(r.output==="html"){var o=vf(e,i);s=q(["katex"],[o])}else{var a=ug(e,n,i,r.displayMode,!1),l=vf(e,i);s=q(["katex"],[a,l])}return X3(s,r)},U9=function(e,n,r){var i=J3(r),s=vf(e,i),o=q(["katex"],[s]);return X3(o,r)},q9={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},E0=function(e){var n=new W("mo",[new Mt(q9[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},j9={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},V9=new Set(["widehat","widecheck","widetilde","utilde"]),S0=function(e,n){function r(){var a=4e5,l=e.label.slice(1);if(V9.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,c,d,h;if(u>5)l==="widehat"||l==="widecheck"?(c=420,a=2364,h=.42,d=l+"4"):(c=312,a=2340,h=.34,d="tilde4");else{var f=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(a=[0,1062,2364,2364,2364][f],c=[0,239,300,360,420][f],h=[0,.24,.3,.3,.36,.42][f],d=l+f):(a=[0,600,1033,2339,2340][f],c=[0,260,286,306,312][f],h=[0,.26,.286,.3,.306,.34][f],d="tilde"+f)}var p=new Xi(d),m=new mi([p],{width:"100%",height:K(h),viewBox:"0 0 "+a+" "+c,preserveAspectRatio:"none"});return{span:Qi([],[m],n),minWidth:0,height:h}}else{var g=[],y=j9[l];if(!y)throw new Error('No SVG data for "'+l+'".');var[x,k,C]=y,_=C/1e3,T=x.length,D,I;if(T===1){if(y.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');D=["hide-tail"],I=[y[3]]}else if(T===2)D=["halfarrow-left","halfarrow-right"],I=["xMinYMin","xMaxYMin"];else if(T===3)D=["brace-left","brace-center","brace-right"],I=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
426
+ `+T+" children.");for(var L=0;L<T;L++){var G=new Xi(x[L]),ie=new mi([G],{width:"400em",height:K(_),viewBox:"0 0 "+a+" "+C,preserveAspectRatio:I[L]+" slice"}),oe=Qi([D[L]],[ie],n);if(T===1)return{span:oe,minWidth:k,height:_};oe.style.height=K(_),g.push(oe)}return{span:q(["stretchy"],g,n),minWidth:k,height:_}}}var{span:i,minWidth:s,height:o}=r();return i.height=o,i.style.height=K(o),s>0&&(i.style.minWidth=K(s)),i},W9=function(e,n,r,i,s){var o,a=e.height+e.depth+r+i;if(/fbox|color|angl/.test(n)){if(o=q(["stretchy",n],[],s),n==="fbox"){var l=s.color&&s.getColor();l&&(o.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(n)&&u.push(new uf({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&u.push(new uf({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new mi(u,{width:"100%",height:K(a)});o=Qi([],[c],s)}return o.height=a,o.style.height=K(a),o},G9={bin:1,close:1,inner:1,open:1,punct:1,rel:1},K9={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Y9(t){return t in G9}function Ce(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function C0(t){var e=_0(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function _0(t){return t&&(t.type==="atom"||K9.hasOwnProperty(t.type))?t:null}var Q3=t=>{if(t instanceof In)return t;if(w9(t)&&t.children.length===1)return Q3(t.children[0])},Jp=(t,e)=>{var n,r,i;t&&t.type==="supsub"?(r=Ce(t.base,"accent"),n=r.base,t.base=n,i=x9(Ue(t,e)),t.base=r):(r=Ce(t,"accent"),n=r.base);var s=Ue(n,e.havingCrampedStyle()),o=r.isShifty&&gi(n),a=0;if(o){var l,u;a=(l=(u=Q3(s))==null?void 0:u.skew)!=null?l:0}var c=r.label==="\\c",d=c?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),h;if(r.isStretchy)h=S0(r,e),h=He({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+K(2*a)+")",marginLeft:K(2*a)}:void 0}]});else{var f,p;r.label==="\\vec"?(f=V3("vec",e),p=j3.vec[1]):(f=k0({mode:r.mode,text:r.label},e,"textord"),f=v9(f),f.italic=0,p=f.width,c&&(d+=f.depth)),h=q(["accent-body"],[f]);var m=r.label==="\\textcircled";m&&(h.classes.push("accent-full"),d=s.height);var g=a;m||(g-=p/2),h.style.left=K(g),r.label==="\\textcircled"&&(h.style.top=".2em"),h=He({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:h}]})}var y=q(["mord","accent"],[h],e);return i?(i.children[0]=y,i.height=Math.max(y.height,i.height),i.classes[0]="mord",i):y},ey=(t,e)=>{var n=t.isStretchy?E0(t.label):new W("mo",[rr(t.label,t.mode)]),r=new W("mover",[Xe(t.base,e),n]);return r.setAttribute("accent","true"),r},Z9=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));ee({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var n=nc(e[0]),r=!Z9.test(t.funcName),i=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Jp,mathmlBuilder:ey});ee({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Jp,mathmlBuilder:ey});ee({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(t,e)=>{var n=Ue(t.base,e),r=S0(t,e),i=t.label==="\\utilde"?.12:0,s=He({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]});return q(["mord","accentunder"],[s],e)},mathmlBuilder:(t,e)=>{var n=E0(t.label),r=new W("munder",[Xe(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var tu=t=>{var e=new W("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};ee({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r,funcName:i}=t;return{type:"xArrow",mode:r.mode,label:i,body:e[0],below:n[0]}},htmlBuilder(t,e){var n=e.style,r=e.havingStyle(n.sup()),i=Po(Ue(t.body,r,e),e),s=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var o;t.below&&(r=e.havingStyle(n.sub()),o=Po(Ue(t.below,r,e),e),o.classes.push(s+"-arrow-pad"));var a=S0(t,e),l=-e.fontMetrics().axisHeight+.5*a.height,u=-e.fontMetrics().axisHeight-.5*a.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var c;if(o){var d=-e.fontMetrics().axisHeight+o.height+.5*a.height+.111;c=He({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:a,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:d}]})}else c=He({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:a,shift:l,wrapperClasses:["svg-align"]}]});return q(["mrel","x-arrow"],[c],e)},mathmlBuilder(t,e){var n=E0(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(t.body){var i=tu(Xe(t.body,e));if(t.below){var s=tu(Xe(t.below,e));r=new W("munderover",[n,s,i])}else r=new W("mover",[n,i])}else if(t.below){var o=tu(Xe(t.below,e));r=new W("munder",[n,o])}else r=tu(),r=new W("mover",[n,r]);return r}});function ty(t,e){var n=zt(t.body,e,!0);return q([t.mclass],n,e)}function ny(t,e){var n,r=Bn(t.body,e);return t.mclass==="minner"?n=new W("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new W("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new W("mo",r),t.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):t.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):t.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}ee({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Tt(i),isCharacterBox:gi(i)}},htmlBuilder:ty,mathmlBuilder:ny});var A0=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};ee({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:A0(e[0]),body:Tt(e[1]),isCharacterBox:gi(e[1])}}});ee({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:n,funcName:r}=t,i=e[1],s=e[0],o;r!=="\\stackrel"?o=A0(i):o="mrel";var a={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Tt(i)},l={type:"supsub",mode:s.mode,base:a,sup:r==="\\underset"?null:s,sub:r==="\\underset"?s:null};return{type:"mclass",mode:n.mode,mclass:o,body:[l],isCharacterBox:gi(l)}},htmlBuilder:ty,mathmlBuilder:ny});ee({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:A0(e[0]),body:Tt(e[0])}},htmlBuilder(t,e){var n=zt(t.body,e,!0),r=q([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=Bn(t.body,e),r=new W("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var J9={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},hg=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),fg=t=>t.type==="textord"&&t.text==="@",X9=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function Q9(t,e,n){var r=J9[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:r,mode:"math",family:"rel"},o=n.callFunction("\\Big",[s],[]),a=n.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,o,a]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function eE(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var n=t.fetch().text;if(n==="&"||n==="\\\\")t.consume();else if(n==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new V("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var r=[],i=[r],s=0;s<e.length;s++){for(var o=e[s],a=hg(),l=0;l<o.length;l++)if(!fg(o[l]))a.body.push(o[l]);else{r.push(a),l+=1;var u=C0(o[l]).text,c=new Array(2);if(c[0]={type:"ordgroup",mode:"math",body:[]},c[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(u))if("<>AV".includes(u))for(var d=0;d<2;d++){for(var h=!0,f=l+1;f<o.length;f++){if(X9(o[f],u)){h=!1,l=f;break}if(fg(o[f]))throw new V("Missing a "+u+" character to complete a CD arrow.",o[f]);c[d].body.push(o[f])}if(h)throw new V("Missing a "+u+" character to complete a CD arrow.",o[l])}else throw new V('Expected one of "<>AV=|." after @',o[l]);var p=Q9(u,c,t),m={type:"styling",body:[p],mode:"math",style:"display",resetFont:!0};r.push(m),a=hg()}s%2===0?r.push(a):r.shift(),r=[],i.push(r)}t.gullet.endGroup(),t.gullet.endGroup();var g=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:g,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}ee({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),r=Po(Ue(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=K(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new W("mrow",[Xe(t.label,e)]);return n=new W("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new W("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});ee({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:n}=t;return{type:"cdlabelparent",mode:n.mode,fragment:e[0]}},htmlBuilder(t,e){var n=Po(Ue(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new W("mrow",[Xe(t.fragment,e)])}});ee({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=Ce(e[0],"ordgroup"),i=r.body,s="",o=0;o<i.length;o++){var a=Ce(i[o],"textord");s+=a.text}var l=parseInt(s),u;if(isNaN(l))throw new V("\\@char has non-numeric argument "+s);if(l<0||l>=1114111)throw new V("\\@char with invalid code point "+s);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:n.mode,text:u}}});var ry=(t,e)=>{var n=zt(t.body,e.withColor(t.color),!1);return yi(n)},iy=(t,e)=>{var n=Bn(t.body,e.withColor(t.color)),r=new W("mstyle",n);return r.setAttribute("mathcolor",t.color),r};ee({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=Ce(e[0],"color-token").color,i=e[1];return{type:"color",mode:n.mode,color:r,body:Tt(i)}},htmlBuilder:ry,mathmlBuilder:iy});ee({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,i=Ce(e[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var s=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:s}},htmlBuilder:ry,mathmlBuilder:iy});ee({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:r}=t,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,s=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:s,size:i&&Ce(i,"size").value}},htmlBuilder(t,e){var n=q(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=K(bt(t.size,e)))),n},mathmlBuilder(t,e){var n=new W("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",K(bt(t.size,e)))),n}});var xf={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},sy=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new V("Expected a control sequence",t);return e},tE=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},oy=(t,e,n,r)=>{var i=t.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,i,r)};ee({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var r=e.fetch();if(xf[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=xf[r.text]),Ce(e.parseFunction(),"internal");throw new V("Invalid token after macro prefix",r)}});ee({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=e.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new V("Expected a control sequence",r);for(var s=0,o,a=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),a[s].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new V('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==s+1)throw new V('Argument number "'+r.text+'" out of order');s++,a.push([])}else{if(r.text==="EOF")throw new V("Expected a macro definition");a[s].push(r.text)}var{tokens:l}=e.gullet.consumeArg();return o&&l.unshift(o),(n==="\\edef"||n==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:a},n===xf[n]),{type:"internal",mode:e.mode}}});ee({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=sy(e.gullet.popToken());e.gullet.consumeSpaces();var i=tE(e);return oy(e,r,i,n==="\\\\globallet"),{type:"internal",mode:e.mode}}});ee({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=sy(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return oy(e,r,s,n==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var Sa=function(e,n,r){var i=dt.math[e]&&dt.math[e].replace,s=Wp(i||e,n,r);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return s},Xp=function(e,n,r,i){var s=r.havingBaseStyle(n),o=q(i.concat(s.sizingClasses(r)),[e],r),a=s.sizeMultiplier/r.sizeMultiplier;return o.height*=a,o.depth*=a,o.maxFontSize=s.sizeMultiplier,o},ay=function(e,n,r){var i=n.havingBaseStyle(r),s=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=K(s),e.height-=s,e.depth+=s},nE=function(e,n,r,i,s,o){var a=ln(e,"Main-Regular",s,i),l=Xp(a,n,i,o);return ay(l,i,n),l},rE=function(e,n,r,i){return ln(e,"Size"+n+"-Regular",r,i)},ly=function(e,n,r,i,s,o){var a=rE(e,n,s,i),l=Xp(q(["delimsizing","size"+n],[a],i),ye.TEXT,i,o);return r&&ay(l,i,ye.TEXT),l},Ad=function(e,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=q(["delimsizinginner",i],[q([],[ln(e,n,r)])]);return{type:"elem",elem:s}},Td=function(e,n,r){var i=Or["Size4-Regular"][e.charCodeAt(0)]?Or["Size4-Regular"][e.charCodeAt(0)][4]:Or["Size1-Regular"][e.charCodeAt(0)][4],s=new Xi("inner",h9(e,Math.round(1e3*n))),o=new mi([s],{width:K(i),height:K(n),style:"width:"+K(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),a=Qi([],[o],r);return a.height=n,a.style.height=K(n),a.style.width=K(i),{type:"elem",elem:a}},wf=.008,nu={type:"kern",size:-1*wf},iE=new Set(["|","\\lvert","\\rvert","\\vert"]),sE=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),uy=function(e,n,r,i,s,o){var a,l,u,c,d="",h=0;a=u=c=e,l=null;var f="Size1-Regular";e==="\\uparrow"?u=c="⏐":e==="\\Uparrow"?u=c="‖":e==="\\downarrow"?a=u="⏐":e==="\\Downarrow"?a=u="‖":e==="\\updownarrow"?(a="\\uparrow",u="⏐",c="\\downarrow"):e==="\\Updownarrow"?(a="\\Uparrow",u="‖",c="\\Downarrow"):iE.has(e)?(u="∣",d="vert",h=333):sE.has(e)?(u="∥",d="doublevert",h=556):e==="["||e==="\\lbrack"?(a="⎡",u="⎢",c="⎣",f="Size4-Regular",d="lbrack",h=667):e==="]"||e==="\\rbrack"?(a="⎤",u="⎥",c="⎦",f="Size4-Regular",d="rbrack",h=667):e==="\\lfloor"||e==="⌊"?(u=a="⎢",c="⎣",f="Size4-Regular",d="lfloor",h=667):e==="\\lceil"||e==="⌈"?(a="⎡",u=c="⎢",f="Size4-Regular",d="lceil",h=667):e==="\\rfloor"||e==="⌋"?(u=a="⎥",c="⎦",f="Size4-Regular",d="rfloor",h=667):e==="\\rceil"||e==="⌉"?(a="⎤",u=c="⎥",f="Size4-Regular",d="rceil",h=667):e==="("||e==="\\lparen"?(a="⎛",u="⎜",c="⎝",f="Size4-Regular",d="lparen",h=875):e===")"||e==="\\rparen"?(a="⎞",u="⎟",c="⎠",f="Size4-Regular",d="rparen",h=875):e==="\\{"||e==="\\lbrace"?(a="⎧",l="⎨",c="⎩",u="⎪",f="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(a="⎫",l="⎬",c="⎭",u="⎪",f="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(a="⎧",c="⎩",u="⎪",f="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(a="⎫",c="⎭",u="⎪",f="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(a="⎧",c="⎭",u="⎪",f="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(a="⎫",c="⎩",u="⎪",f="Size4-Regular");var p=Sa(a,f,s),m=p.height+p.depth,g=Sa(u,f,s),y=g.height+g.depth,x=Sa(c,f,s),k=x.height+x.depth,C=0,_=1;if(l!==null){var T=Sa(l,f,s);C=T.height+T.depth,_=2}var D=m+k+C,I=Math.max(0,Math.ceil((n-D)/(_*y))),L=D+I*_*y,G=i.fontMetrics().axisHeight;r&&(G*=i.sizeMultiplier);var ie=L/2-G,oe=[];if(d.length>0){var be=L-m-k,Y=Math.round(L*1e3),te=f9(d,Math.round(be*1e3)),Te=new Xi(d,te),St=K(h/1e3),ke=K(Y/1e3),ft=new mi([Te],{width:St,height:ke,viewBox:"0 0 "+h+" "+Y}),et=Qi([],[ft],i);et.height=Y/1e3,et.style.width=St,et.style.height=ke,oe.push({type:"elem",elem:et})}else{if(oe.push(Ad(c,f,s)),oe.push(nu),l===null){var Ze=L-m-k+2*wf;oe.push(Td(u,Ze,i))}else{var tt=(L-m-k-C)/2+2*wf;oe.push(Td(u,tt,i)),oe.push(nu),oe.push(Ad(l,f,s)),oe.push(nu),oe.push(Td(u,tt,i))}oe.push(nu),oe.push(Ad(a,f,s))}var it=i.havingBaseStyle(ye.TEXT),ir=He({positionType:"bottom",positionData:ie,children:oe});return Xp(q(["delimsizing","mult"],[ir],it),ye.TEXT,i,o)},Md=80,Nd=.08,Dd=function(e,n,r,i,s){var o=d9(e,i,r),a=new Xi(e,o),l=new mi([a],{width:"400em",height:K(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Qi(["hide-tail"],[l],s)},oE=function(e,n){var r=n.havingBaseSizing(),i=py("\\surd",e*r.sizeMultiplier,fy,r),s=r.sizeMultiplier,o=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),a,l,u,c,d;return i.type==="small"?(c=1e3+1e3*o+Md,e<1?s=1:e<1.4&&(s=.7),l=(1+o+Nd)/s,u=(1+o)/s,a=Dd("sqrtMain",l,c,o,n),a.style.minWidth="0.853em",d=.833/s):i.type==="large"?(c=(1e3+Md)*Da[i.size],u=(Da[i.size]+o)/s,l=(Da[i.size]+o+Nd)/s,a=Dd("sqrtSize"+i.size,l,c,o,n),a.style.minWidth="1.02em",d=1/s):(l=e+o+Nd,u=e+o,c=Math.floor(1e3*e+o)+Md,a=Dd("sqrtTall",l,c,o,n),a.style.minWidth="0.742em",d=1.056),a.height=u,a.style.height=K(l),{span:a,advanceWidth:d,ruleWidth:(n.fontMetrics().sqrtRuleThickness+o)*s}},cy=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),aE=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),dy=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Da=[0,1.2,1.8,2.4,3],hy=function(e,n,r,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),cy.has(e)||dy.has(e))return ly(e,n,!1,r,i,s);if(aE.has(e))return uy(e,Da[n],!1,r,i,s);throw new V("Illegal delimiter: '"+e+"'")},lE=[{type:"small",style:ye.SCRIPTSCRIPT},{type:"small",style:ye.SCRIPT},{type:"small",style:ye.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],uE=[{type:"small",style:ye.SCRIPTSCRIPT},{type:"small",style:ye.SCRIPT},{type:"small",style:ye.TEXT},{type:"stack"}],fy=[{type:"small",style:ye.SCRIPTSCRIPT},{type:"small",style:ye.SCRIPT},{type:"small",style:ye.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],cE=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var n=e.type;throw new Error("Add support for delim type '"+n+"' here.")},py=function(e,n,r,i){for(var s=Math.min(2,3-i.style.size),o=s;o<r.length;o++){var a=r[o];if(a.type==="stack")break;var l=Sa(e,cE(a),"math"),u=l.height+l.depth;if(a.type==="small"){var c=i.havingBaseStyle(a.style);u*=c.sizeMultiplier}if(u>n)return a}return r[r.length-1]},kf=function(e,n,r,i,s,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var a;dy.has(e)?a=lE:cy.has(e)?a=fy:a=uE;var l=py(e,n,a,i);return l.type==="small"?nE(e,l.style,r,i,s,o):l.type==="large"?ly(e,l.size,r,i,s,o):uy(e,n,r,i,s,o)},Od=function(e,n,r,i,s,o){var a=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,c=Math.max(n-a,r+a),d=Math.max(c/500*l,2*c-u);return kf(e,d,!0,i,s,o)},pg={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},dE=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function mg(t){return"isMiddle"in t}function T0(t,e){var n=_0(t);if(n&&dE.has(n.text))return n;throw n?new V("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new V("Invalid delimiter type '"+t.type+"'",t)}ee({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var n=T0(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:pg[t.funcName].size,mclass:pg[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?q([t.mclass]):hy(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(rr(t.delim,t.mode));var n=new W("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=K(Da[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function gg(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ee({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=t.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new V("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:T0(e[0],t).text,color:n}}});ee({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=T0(e[0],t),r=t.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var s=Ce(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(t,e)=>{gg(t);for(var n=zt(t.body,e,!0,["mopen","mclose"]),r=0,i=0,s=!1,o=0;o<n.length;o++){var a=n[o];mg(a)?s=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=e.sizeMultiplier,i*=e.sizeMultiplier;var l;if(t.left==="."?l=Wa(e,["mopen"]):l=Od(t.left,r,i,e,t.mode,["mopen"]),n.unshift(l),s)for(var u=1;u<n.length;u++){var c=n[u];if(mg(c)){var d=c.isMiddle;n[u]=Od(d.delim,r,i,d.options,t.mode,[])}}var h;if(t.right===".")h=Wa(e,["mclose"]);else{var f=t.rightColor?e.withColor(t.rightColor):e;h=Od(t.right,r,i,f,t.mode,["mclose"])}return n.push(h),q(["minner"],n,e)},mathmlBuilder:(t,e)=>{gg(t);var n=Bn(t.body,e);if(t.left!=="."){var r=new W("mo",[rr(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var i=new W("mo",[rr(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),n.push(i)}return Yp(n)}});ee({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=T0(e[0],t);if(!t.parser.leftrightDepth)throw new V("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:(t,e)=>{var n;return t.delim==="."?n=Wa(e,[]):(n=hy(t.delim,1,e,t.mode,[]),n.isMiddle={delim:t.delim,options:e}),n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?rr("|","text"):rr(t.delim,t.mode),r=new W("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var M0=(t,e)=>{var n=Po(Ue(t.body,e),e),r=t.label.slice(1),i=e.sizeMultiplier,s,o,a=gi(t.body);if(r==="sout")s=q(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,o=-.5*e.fontMetrics().xHeight;else if(r==="phase"){var l=bt({number:.6,unit:"pt"},e),u=bt({number:.35,unit:"ex"},e),c=e.havingBaseSizing();i=i/c.sizeMultiplier;var d=n.height+n.depth+l+u;n.style.paddingLeft=K(d/2+l);var h=Math.floor(1e3*d*i),f=u9(h),p=new mi([new Xi("phase",f)],{width:"400em",height:K(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});s=Qi(["hide-tail"],[p],e),s.style.height=K(d),o=n.depth+l+u}else{/cancel/.test(r)?a||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var m,g,y=0;/box/.test(r)?(y=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(r==="colorbox"?0:y),g=m):r==="angl"?(y=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*y,g=Math.max(0,.25-n.depth)):(m=a?.2:0,g=m),s=W9(n,r,m,g,e),/fbox|boxed|fcolorbox/.test(r)?(s.style.borderStyle="solid",s.style.borderWidth=K(y)):r==="angl"&&y!==.049&&(s.style.borderTopWidth=K(y),s.style.borderRightWidth=K(y)),o=n.depth+g,t.backgroundColor&&(s.style.backgroundColor=t.backgroundColor,t.borderColor&&(s.style.borderColor=t.borderColor))}var x;if(t.backgroundColor)x=He({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:n,shift:0}]});else{var k=/cancel|phase/.test(r)?["svg-align"]:[];x=He({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:k}]})}return/cancel/.test(r)&&(x.height=n.height,x.depth=n.depth),/cancel/.test(r)&&!a?q(["mord","cancel-lap"],[x],e):q(["mord"],[x],e)},N0=(t,e)=>{var n,r=new W(t.label.includes("colorbox")?"mpadded":"menclose",[Xe(t.body,e)]);switch(t.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+K(i)+" solid "+t.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r};ee({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,n){var{parser:r,funcName:i}=t,s=Ce(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:M0,mathmlBuilder:N0});ee({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,n){var{parser:r,funcName:i}=t,s=Ce(e[0],"color-token").color,o=Ce(e[1],"color-token").color,a=e[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:M0,mathmlBuilder:N0});ee({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}});ee({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:M0,mathmlBuilder:N0});ee({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:M0,mathmlBuilder:N0});ee({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var my={};function Pr(t){for(var{type:e,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:o}=t,a={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<n.length;++l)my[n[l]]=a;s&&(ec[e]=s),o&&(tc[e]=o)}var gy={};function E(t,e){gy[t]=e}class xn{constructor(e,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=r}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new xn(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}let hr=class by{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new by(n,xn.range(this,e))}};function bg(t){var e=[];t.consumeSpaces();var n=t.fetch().text;for(n==="\\relax"&&(t.consume(),t.consumeSpaces(),n=t.fetch().text);n==="\\hline"||n==="\\hdashline";)t.consume(),e.push(n==="\\hdashline"),t.consumeSpaces(),n=t.fetch().text;return e}var D0=t=>{var e=t.parser.settings;if(!e.displayMode)throw new V("{"+t.envName+"} can be used only in display mode.")},hE=new Set(["gather","gather*"]);function Qp(t){if(!t.includes("ed"))return!t.includes("*")}function ds(t,e,n){var{hskipBeforeAndAfter:r,addJot:i,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:u,emptySingleRow:c,maxNumCols:d,leqno:h}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!o){var f=t.gullet.expandMacroAsText("\\arraystretch");if(f==null)o=1;else if(o=parseFloat(f),!o||o<0)throw new V("Invalid \\arraystretch: "+f)}t.gullet.beginGroup();var p=[],m=[p],g=[],y=[],x=l!=null?[]:void 0;function k(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function C(){x&&(t.gullet.macros.get("\\df@tag")?(x.push(t.subparse([new hr("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(k(),y.push(bg(t));;){var _=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var T={type:"ordgroup",mode:t.mode,body:_};n&&(T={type:"styling",mode:t.mode,style:n,resetFont:!0,body:[T]}),p.push(T);var D=t.fetch().text;if(D==="&"){if(d&&p.length===d){if(u||a)throw new V("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(D==="\\end"){C(),p.length===1&&T.type==="styling"&&T.body.length===1&&T.body[0].type==="ordgroup"&&T.body[0].body.length===0&&(m.length>1||!c)&&m.pop(),y.length<m.length+1&&y.push([]);break}else if(D==="\\\\"){t.consume();var I=void 0;t.gullet.future().text!==" "&&(I=t.parseSizeGroup(!0)),g.push(I?I.value:null),C(),y.push(bg(t)),p=[],m.push(p),k()}else throw new V("Expected & or \\\\ or \\cr or \\end",t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:i,arraystretch:o,body:m,cols:s,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:y,colSeparationType:a,tags:x,leqno:h}}function em(t){return t.slice(0,1)==="d"?"display":"text"}var $r=function(e,n){var r,i,s=e.body.length,o=e.hLinesBeforeRow,a=0,l=new Array(s),u=[],c=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),d=1/n.fontMetrics().ptPerEm,h=5*d;if(e.colSeparationType&&e.colSeparationType==="small"){var f=n.havingStyle(ye.SCRIPT).sizeMultiplier;h=.2778*(f/n.sizeMultiplier)}var p=e.colSeparationType==="CD"?bt({number:3,unit:"ex"},n):12*d,m=3*d,g=e.arraystretch*p,y=.7*g,x=.3*g,k=0;function C(kr){for(var Si=0;Si<kr.length;++Si)Si>0&&(k+=.25),u.push({pos:k,isDashed:kr[Si]})}for(C(o[0]),r=0;r<e.body.length;++r){var _=e.body[r],T=y,D=x;a<_.length&&(a=_.length);var I={cells:new Array(_.length),height:0,depth:0,pos:0};for(i=0;i<_.length;++i){var L=Ue(_[i],n);D<L.depth&&(D=L.depth),T<L.height&&(T=L.height),I.cells[i]=L}var G=e.rowGaps[r],ie=0;G&&(ie=bt(G,n),ie>0&&(ie+=x,D<ie&&(D=ie),ie=0)),e.addJot&&r<e.body.length-1&&(D+=m),I.height=T,I.depth=D,k+=T,I.pos=k,k+=D+ie,l[r]=I,C(o[r+1])}var oe=k/2+n.fontMetrics().axisHeight,be=e.cols||[],Y=[],te,Te,St=[];if(e.tags&&e.tags.some(kr=>kr))for(r=0;r<s;++r){var ke=l[r],ft=ke.pos-oe,et=e.tags[r],Ze=void 0;et===!0?Ze=q(["eqn-num"],[],n):et===!1?Ze=q([],[],n):Ze=q([],zt(et,n,!0),n),Ze.depth=ke.depth,Ze.height=ke.height,St.push({type:"elem",elem:Ze,shift:ft})}for(i=0,Te=0;i<a||Te<be.length;++i,++Te){for(var tt,it=be[Te],ir=!0;((Fn=it)==null?void 0:Fn.type)==="separator";){var Fn;if(ir||(te=q(["arraycolsep"],[]),te.style.width=K(n.fontMetrics().doubleRuleSep),Y.push(te)),it.separator==="|"||it.separator===":"){var bn=it.separator==="|"?"solid":"dashed",yn=q(["vertical-separator"],[],n);yn.style.height=K(k),yn.style.borderRightWidth=K(c),yn.style.borderRightStyle=bn,yn.style.margin="0 "+K(-c/2);var sr=k-oe;sr&&(yn.style.verticalAlign=K(-sr)),Y.push(yn)}else throw new V("Invalid separator type: "+it.separator);Te++,it=be[Te],ir=!1}if(!(i>=a)){var Pn=void 0;if(i>0||e.hskipBeforeAndAfter){var An,ki;Pn=(An=(ki=it)==null?void 0:ki.pregap)!=null?An:h,Pn!==0&&(te=q(["arraycolsep"],[]),te.style.width=K(Pn),Y.push(te))}var xr=[];for(r=0;r<s;++r){var wr=l[r],$n=wr.cells[i];if($n){var ms=wr.pos-oe;$n.depth=wr.depth,$n.height=wr.height,xr.push({type:"elem",elem:$n,shift:ms})}}var Re=He({positionType:"individualShift",children:xr}),Ct=q(["col-align-"+(((tt=it)==null?void 0:tt.align)||"c")],[Re]);if(Y.push(Ct),i<a-1||e.hskipBeforeAndAfter){var Tn,Hn;Pn=(Tn=(Hn=it)==null?void 0:Hn.postgap)!=null?Tn:h,Pn!==0&&(te=q(["arraycolsep"],[]),te.style.width=K(Pn),Y.push(te))}}}var or=q(["mtable"],Y);if(u.length>0){for(var Un=Fo("hline",n,c),gs=Fo("hdashline",n,c),Wr=[{type:"elem",elem:or,shift:0}];u.length>0;){var qn=u.pop(),Gr=qn.pos-oe;qn.isDashed?Wr.push({type:"elem",elem:gs,shift:Gr}):Wr.push({type:"elem",elem:Un,shift:Gr})}or=He({positionType:"individualShift",children:Wr})}if(St.length===0)return q(["mord"],[or],n);var ar=He({positionType:"individualShift",children:St}),Ei=q(["tag"],[ar],n);return yi([or,Ei])},fE={c:"center ",l:"left ",r:"right "},Hr=function(e,n){for(var r=[],i=new W("mtd",[],["mtr-glue"]),s=new W("mtd",[],["mml-eqn-num"]),o=0;o<e.body.length;o++){for(var a=e.body[o],l=[],u=0;u<a.length;u++)l.push(new W("mtd",[Xe(a[u],n)]));e.tags&&e.tags[o]&&(l.unshift(i),l.push(i),e.leqno?l.unshift(s):l.push(s)),r.push(new W("mtr",l))}var c=new W("mtable",r),d=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",K(d));var h="",f="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",g=!1,y=0,x=p.length;p[0].type==="separator"&&(h+="top ",y=1),p[p.length-1].type==="separator"&&(h+="bottom ",x-=1);for(var k=y;k<x;k++){var C=p[k];C.type==="align"?(f+=fE[C.align],g&&(m+="none "),g=!0):C.type==="separator"&&g&&(m+=C.separator==="|"?"solid ":"dashed ",g=!1)}c.setAttribute("columnalign",f.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if(e.colSeparationType==="align"){for(var _=e.cols||[],T="",D=1;D<_.length;D++)T+=D%2?"0em ":"1em ";c.setAttribute("columnspacing",T.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?c.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?c.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var I="",L=e.hLinesBeforeRow;h+=L[0].length>0?"left ":"",h+=L[L.length-1].length>0?"right ":"";for(var G=1;G<L.length-1;G++)I+=L[G].length===0?"none ":L[G][0]?"dashed ":"solid ";return/[sd]/.test(I)&&c.setAttribute("rowlines",I.trim()),h!==""&&(c=new W("menclose",[c]),c.setAttribute("notation",h.trim())),e.arraystretch&&e.arraystretch<1&&(c=new W("mstyle",[c]),c.setAttribute("scriptlevel","1")),c},yy=function(e,n){e.envName.includes("ed")||D0(e);var r=[],i=e.envName.includes("at")?"alignat":"align",s=e.envName==="split",o=ds(e.parser,{cols:r,addJot:!0,autoTag:s?void 0:Qp(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a=0,l=0,u={type:"ordgroup",mode:e.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var c="",d=0;d<n[0].body.length;d++){var h=Ce(n[0].body[d],"textord");c+=h.text}a=Number(c),l=a*2}var f=!l;o.body.forEach(function(y){for(var x=1;x<y.length;x+=2){var k=Ce(y[x],"styling"),C=Ce(k.body[0],"ordgroup");C.body.unshift(u)}if(f)l<y.length&&(l=y.length);else{var _=y.length/2;if(a<_)throw new V("Too many math in a row: "+("expected "+a+", but got "+_),y[0])}});for(var p=0;p<l;++p){var m="r",g=0;p%2===1?m="l":p>0&&f&&(g=1),r[p]={type:"align",align:m,pregap:g,postgap:0}}return o.colSeparationType=f?"align":"alignat",o};Pr({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=_0(e[0]),r=n?[e[0]]:Ce(e[0],"ordgroup").body,i=r.map(function(o){var a=C0(o),l=a.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new V("Unknown column alignment: "+l,o)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return ds(t.parser,s,em(t.envName))},htmlBuilder:$r,mathmlBuilder:Hr});Pr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!"lcr".includes(n))throw new V("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var s=ds(t.parser,r,em(t.envName)),o=Math.max(0,...s.body.map(a=>a.length));return s.cols=new Array(o).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:$r,mathmlBuilder:Hr});Pr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=ds(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:$r,mathmlBuilder:Hr});Pr({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=_0(e[0]),r=n?[e[0]]:Ce(e[0],"ordgroup").body,i=r.map(function(a){var l=C0(a),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new V("Unknown column alignment: "+u,a)});if(i.length>1)throw new V("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},o=ds(t.parser,s,"script");if(o.body.length>0&&o.body[0].length>1)throw new V("{subarray} can contain only one column");return o},htmlBuilder:$r,mathmlBuilder:Hr});Pr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=ds(t.parser,e,em(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:$r,mathmlBuilder:Hr});Pr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:yy,htmlBuilder:$r,mathmlBuilder:Hr});Pr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){hE.has(t.envName)&&D0(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Qp(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return ds(t.parser,e,"display")},htmlBuilder:$r,mathmlBuilder:Hr});Pr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:yy,htmlBuilder:$r,mathmlBuilder:Hr});Pr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){D0(t);var e={autoTag:Qp(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return ds(t.parser,e,"display")},htmlBuilder:$r,mathmlBuilder:Hr});Pr({type:"array",names:["CD"],props:{numArgs:0},handler(t){return D0(t),eE(t.parser)},htmlBuilder:$r,mathmlBuilder:Hr});E("\\nonumber","\\gdef\\@eqnsw{0}");E("\\notag","\\nonumber");ee({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new V(t.funcName+" valid only within array environment")}});var yg=my;ee({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];if(i.type!=="ordgroup")throw new V("Invalid environment name",i);for(var s="",o=0;o<i.body.length;++o)s+=Ce(i.body[o],"textord").text;if(r==="\\begin"){if(!yg.hasOwnProperty(s))throw new V("No such environment: "+s,i);var a=yg[s],{args:l,optArgs:u}=n.parseArguments("\\begin{"+s+"}",a),c={mode:n.mode,envName:s,parser:n},d=a.handler(c,l,u);n.expect("\\end",!1);var h=n.nextToken,f=Ce(n.parseFunction(),"environment");if(f.name!==s)throw new V("Mismatch: \\begin{"+s+"} matched by \\end{"+f.name+"}",h);return d}return{type:"environment",mode:n.mode,name:s,nameGroup:i}}});var vy=(t,e)=>{var n=t.font,r=e.withFont(n);return Ue(t.body,r)},xy=(t,e)=>{var n=t.font,r=e.withFont(n);return Xe(t.body,r)},vg={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};ee({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=nc(e[0]),s=r;return s in vg&&(s=vg[s]),{type:"font",mode:n.mode,font:s.slice(1),body:i}},htmlBuilder:vy,mathmlBuilder:xy});ee({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"mclass",mode:n.mode,mclass:A0(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:gi(r)}}});ee({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,breakOnTokenText:i}=t,{mode:s}=n,o=n.parseExpression(!0,i);return{type:"font",mode:s,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:vy,mathmlBuilder:xy});var pE=(t,e)=>{var n=e.style,r=n.fracNum(),i=n.fracDen(),s;s=e.havingStyle(r);var o=Ue(t.numer,s,e);if(t.continued){var a=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;o.height=o.height<a?a:o.height,o.depth=o.depth<l?l:o.depth}s=e.havingStyle(i);var u=Ue(t.denom,s,e),c,d,h;t.hasBarLine?(t.barSize?(d=bt(t.barSize,e),c=Fo("frac-line",e,d)):c=Fo("frac-line",e),d=c.height,h=c.height):(c=null,d=0,h=e.fontMetrics().defaultRuleThickness);var f,p,m;n.size===ye.DISPLAY.size?(f=e.fontMetrics().num1,d>0?p=3*h:p=7*h,m=e.fontMetrics().denom1):(d>0?(f=e.fontMetrics().num2,p=h):(f=e.fontMetrics().num3,p=3*h),m=e.fontMetrics().denom2);var g;if(c){var x=e.fontMetrics().axisHeight;f-o.depth-(x+.5*d)<p&&(f+=p-(f-o.depth-(x+.5*d))),x-.5*d-(u.height-m)<p&&(m+=p-(x-.5*d-(u.height-m)));var k=-(x-.5*d);g=He({positionType:"individualShift",children:[{type:"elem",elem:u,shift:m},{type:"elem",elem:c,shift:k},{type:"elem",elem:o,shift:-f}]})}else{var y=f-o.depth-(u.height-m);y<p&&(f+=.5*(p-y),m+=.5*(p-y)),g=He({positionType:"individualShift",children:[{type:"elem",elem:u,shift:m},{type:"elem",elem:o,shift:-f}]})}s=e.havingStyle(n),g.height*=s.sizeMultiplier/e.sizeMultiplier,g.depth*=s.sizeMultiplier/e.sizeMultiplier;var C;n.size===ye.DISPLAY.size?C=e.fontMetrics().delim1:n.size===ye.SCRIPTSCRIPT.size?C=e.havingStyle(ye.SCRIPT).fontMetrics().delim2:C=e.fontMetrics().delim2;var _,T;return t.leftDelim==null?_=Wa(e,["mopen"]):_=kf(t.leftDelim,C,!0,e.havingStyle(n),t.mode,["mopen"]),t.continued?T=q([]):t.rightDelim==null?T=Wa(e,["mclose"]):T=kf(t.rightDelim,C,!0,e.havingStyle(n),t.mode,["mclose"]),q(["mord"].concat(s.sizingClasses(e)),[_,q(["mfrac"],[g]),T],e)},mE=(t,e)=>{var n=new W("mfrac",[Xe(t.numer,e),Xe(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=bt(t.barSize,e);n.setAttribute("linethickness",K(r))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var s=new W("mo",[new Mt(t.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}if(i.push(n),t.rightDelim!=null){var o=new W("mo",[new Mt(t.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),i.push(o)}return Yp(i)}return n},wy=(t,e)=>{if(!e)return t;var n={type:"styling",mode:t.mode,style:e,body:[t]};return n};ee({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0],s=e[1],o,a=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,a="(",l=")";break;case"\\\\bracefrac":o=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",c=null;return u||r.startsWith("\\d")?c="display":r.startsWith("\\t")&&(c="text"),wy({type:"genfrac",mode:n.mode,numer:i,denom:s,continued:u,hasBarLine:o,leftDelim:a,rightDelim:l,barSize:null},c)},htmlBuilder:pE,mathmlBuilder:mE});ee({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:n,token:r}=t,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:r}}});var xg=["display","text","script","scriptscript"],wg=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};ee({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:n}=t,r=e[4],i=e[5],s=nc(e[0]),o=s.type==="atom"&&s.family==="open"?wg(s.text):null,a=nc(e[1]),l=a.type==="atom"&&a.family==="close"?wg(a.text):null,u=Ce(e[2],"size"),c,d=null;u.isBlank?c=!0:(d=u.value,c=d.number>0);var h=null,f=e[3];if(f.type==="ordgroup"){if(f.body.length>0){var p=Ce(f.body[0],"textord");h=xg[Number(p.text)]}}else f=Ce(f,"textord"),h=xg[Number(f.text)];return wy({type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:c,barSize:d,leftDelim:o,rightDelim:l},h)}});ee({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:r,token:i}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Ce(e[0],"size").value,token:i}}});ee({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0],s=Ce(e[1],"infix").size;if(!s)throw new Error("\\\\abovefrac expected size, but got "+String(s));var o=e[2],a=s.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null}}});var ky=(t,e)=>{var n=e.style,r,i;t.type==="supsub"?(r=t.sup?Ue(t.sup,e.havingStyle(n.sup()),e):Ue(t.sub,e.havingStyle(n.sub()),e),i=Ce(t.base,"horizBrace")):i=Ce(t,"horizBrace");var s=Ue(i.base,e.havingBaseStyle(ye.DISPLAY)),o=S0(i,e),a;if(i.isOver?a=He({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):a=He({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:s}]}),r){var l=q(["minner",i.isOver?"mover":"munder"],[a],e);i.isOver?a=He({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):a=He({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return q(["minner",i.isOver?"mover":"munder"],[a],e)},gE=(t,e)=>{var n=E0(t.label);return new W(t.isOver?"mover":"munder",[Xe(t.base,e),n])};ee({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:e[0]}},htmlBuilder:ky,mathmlBuilder:gE});ee({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[1],i=Ce(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:Tt(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=zt(t.body,e,!1);return M9(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=es(t.body,e);return n instanceof W||(n=new W("mrow",[n])),n.setAttribute("href",t.href),n}});ee({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=Ce(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<r.length;s++){var o=r[s];o==="~"&&(o="\\textasciitilde"),i.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:n.mode,font:"\\texttt",body:i};return{type:"href",mode:n.mode,href:r,body:Tt(a)}}});ee({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(t,e){var{parser:n}=t;return{type:"hbox",mode:n.mode,body:Tt(e[0])}},htmlBuilder(t,e){var n=zt(t.body,e.withFont(""),!1);return yi(n)},mathmlBuilder(t,e){return new W("mrow",Bn(t.body,e.withFont("")))}});ee({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,token:i}=t,s=Ce(e[0],"raw").string,o=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var a,l={};switch(r){case"\\htmlClass":l.class=s,a={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,a={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,a={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var u=s.split(","),c=0;c<u.length;c++){var d=u[c],h=d.indexOf("=");if(h<0)throw new V("\\htmlData key/value '"+d+"' missing equals sign");var f=d.slice(0,h),p=d.slice(h+1);l["data-"+f.trim()]=p}a={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(a)?{type:"html",mode:n.mode,attributes:l,body:Tt(o)}:n.formatUnsupportedCmd(r)},htmlBuilder:(t,e)=>{var n=zt(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var i=q(r,n,e);for(var s in t.attributes)s!=="class"&&t.attributes.hasOwnProperty(s)&&i.setAttribute(s,t.attributes[s]);return i},mathmlBuilder:(t,e)=>es(t.body,e)});ee({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:Tt(e[0]),mathml:Tt(e[1])}},htmlBuilder:(t,e)=>{var n=zt(t.html,e,!1);return yi(n)},mathmlBuilder:(t,e)=>es(t.mathml,e)});var Rd=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!n)throw new V("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!B3(r))throw new V("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};ee({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,n)=>{var{parser:r}=t,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(n[0])for(var l=Ce(n[0],"raw").string,u=l.split(","),c=0;c<u.length;c++){var d=u[c].split("=");if(d.length===2){var h=d[1].trim();switch(d[0].trim()){case"alt":a=h;break;case"width":i=Rd(h);break;case"height":s=Rd(h);break;case"totalheight":o=Rd(h);break;default:throw new V("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var f=Ce(e[0],"url").url;return a===""&&(a=f,a=a.replace(/^.*[\\/]/,""),a=a.substring(0,a.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:f})?{type:"includegraphics",mode:r.mode,alt:a,width:i,height:s,totalheight:o,src:f}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(t,e)=>{var n=bt(t.height,e),r=0;t.totalheight.number>0&&(r=bt(t.totalheight,e)-n);var i=0;t.width.number>0&&(i=bt(t.width,e));var s={height:K(n+r)};i>0&&(s.width=K(i)),r>0&&(s.verticalAlign=K(-r));var o=new b9(t.src,t.alt,s);return o.height=n,o.depth=r,o},mathmlBuilder:(t,e)=>{var n=new W("mglyph",[]);n.setAttribute("alt",t.alt);var r=bt(t.height,e),i=0;if(t.totalheight.number>0&&(i=bt(t.totalheight,e)-r,n.setAttribute("valign",K(-i))),n.setAttribute("height",K(r+i)),t.width.number>0){var s=bt(t.width,e);n.setAttribute("width",K(s))}return n.setAttribute("src",t.src),n}});ee({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,i=Ce(e[0],"size");if(n.settings.strict){var s=r[1]==="m",o=i.value.unit==="mu";s?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(t,e){return q3(t.dimension,e)},mathmlBuilder(t,e){var n=bt(t.dimension,e);return new Y3(n)}});ee({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(t,e)=>{var n;t.alignment==="clap"?(n=q([],[Ue(t.body,e)]),n=q(["inner"],[n],e)):n=q(["inner"],[Ue(t.body,e)]);var r=q(["fix"],[]),i=q([t.alignment],[n,r],e),s=q(["strut"]);return s.style.height=K(i.height+i.depth),i.depth&&(s.style.verticalAlign=K(-i.depth)),i.children.unshift(s),i=q(["thinbox"],[i],e),q(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var n=new W("mpadded",[Xe(t.body,e)]);if(t.alignment!=="rlap"){var r=t.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});ee({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:r}=t,i=r.mode;r.switchMode("math");var s=n==="\\("?"\\)":"$",o=r.parseExpression(!1,s);return r.expect(s),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:o}}});ee({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new V("Mismatched "+t.funcName)}});var kg=(t,e)=>{switch(e.style.size){case ye.DISPLAY.size:return t.display;case ye.TEXT.size:return t.text;case ye.SCRIPT.size:return t.script;case ye.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};ee({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:Tt(e[0]),text:Tt(e[1]),script:Tt(e[2]),scriptscript:Tt(e[3])}},htmlBuilder:(t,e)=>{var n=kg(t,e),r=zt(n,e,!1);return yi(r)},mathmlBuilder:(t,e)=>{var n=kg(t,e);return es(n,e)}});var Ey=(t,e,n,r,i,s,o)=>{t=q([],[t]);var a=n&&gi(n),l,u;if(e){var c=Ue(e,r.havingStyle(i.sup()),r);u={elem:c,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-c.depth)}}if(n){var d=Ue(n,r.havingStyle(i.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var h;if(u&&l){var f=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+o;h=He({positionType:"bottom",positionData:f,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:K(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:K(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var p=t.height-o;h=He({positionType:"top",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:K(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+o;h=He({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:K(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return t;var g=[h];if(l&&s!==0&&!a){var y=q(["mspace"],[],r);y.style.marginRight=K(s),g.unshift(y)}return q(["mop","op-limits"],g,r)},Sy=new Set(["\\smallint"]),ra=(t,e)=>{var n,r,i=!1,s;t.type==="supsub"?(n=t.sup,r=t.sub,s=Ce(t.base,"op"),i=!0):s=Ce(t,"op");var o=e.style,a=!1;o.size===ye.DISPLAY.size&&s.symbol&&!Sy.has(s.name)&&(a=!0);var l,u;if(s.symbol){var c=a?"Size2-Regular":"Size1-Regular",d="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(d=s.name.slice(1),s.name=d==="oiint"?"\\iint":"\\iiint"),l=ln(s.name,c,"math",e,["mop","op-symbol",a?"large-op":"small-op"]),u=l.italic,d.length>0){var h=V3(d+"Size"+(a?"2":"1"),e);l=He({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:h,shift:a?.08:0}]}),s.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(s.body){var f=zt(s.body,e,!0);f.length===1&&f[0]instanceof In?(l=f[0],l.classes[0]="mop"):l=q(["mop"],f,e)}else{for(var p=[],m=1;m<s.name.length;m++)p.push(Gp(s.name[m],s.mode,e));l=q(["mop"],p,e)}var g=0,y=0;if((l instanceof In||s.name==="\\oiint"||s.name==="\\oiiint")&&!s.suppressBaseShift){var x;g=(l.height-l.depth)/2-e.fontMetrics().axisHeight,y=(x=l.italic)!=null?x:0}return i?Ey(l,n,r,e,o,y,g):(g&&(l.style.position="relative",l.style.top=K(g)),l)},Sl=(t,e)=>{var n;if(t.symbol)n=new W("mo",[rr(t.name,t.mode)]),Sy.has(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new W("mo",Bn(t.body,e));else{n=new W("mi",[new Mt(t.name.slice(1))]);var r=new W("mo",[rr("⁡","text")]);t.parentIsSupSub?n=new W("mrow",[n,r]):n=K3([n,r])}return n},bE={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};ee({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=r;return i.length===1&&(i=bE[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:ra,mathmlBuilder:Sl});ee({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Tt(r)}},htmlBuilder:ra,mathmlBuilder:Sl});var yE={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};ee({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ra,mathmlBuilder:Sl});ee({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ra,mathmlBuilder:Sl});ee({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:n}=t,r=n;return r.length===1&&(r=yE[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:ra,mathmlBuilder:Sl});var Cy=(t,e)=>{var n,r,i=!1,s;t.type==="supsub"?(n=t.sup,r=t.sub,s=Ce(t.base,"operatorname"),i=!0):s=Ce(t,"operatorname");var o;if(s.body.length>0){for(var a=s.body.map(d=>{var h="text"in d?d.text:void 0;return typeof h=="string"?{type:"textord",mode:d.mode,text:h}:d}),l=zt(a,e.withFont("mathrm"),!0),u=0;u<l.length;u++){var c=l[u];c instanceof In&&(c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=q(["mop"],l,e)}else o=q(["mop"],[],e);return i?Ey(o,n,r,e,e.style,0,0):o},vE=(t,e)=>{for(var n=Bn(t.body,e.withFont("mathrm")),r=!0,i=0;i<n.length;i++){var s=n[i];if(!(s instanceof Y3))if(s instanceof W)switch(s.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var o=s.children[0];s.children.length===1&&o instanceof Mt?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var a=n.map(c=>c.toText()).join("");n=[new Mt(a)]}var l=new W("mi",n);l.setAttribute("mathvariant","normal");var u=new W("mo",[rr("⁡","text")]);return t.parentIsSupSub?new W("mrow",[l,u]):K3([l,u])};ee({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"operatorname",mode:n.mode,body:Tt(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Cy,mathmlBuilder:vE});E("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");to({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?yi(zt(t.body,e,!1)):q(["mord"],zt(t.body,e,!0),e)},mathmlBuilder(t,e){return es(t.body,e,!0)}});ee({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=Ue(t.body,e.havingCrampedStyle()),r=Fo("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=He({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]});return q(["mord","overline"],[s],e)},mathmlBuilder(t,e){var n=new W("mo",[new Mt("‾")]);n.setAttribute("stretchy","true");var r=new W("mover",[Xe(t.body,e),n]);return r.setAttribute("accent","true"),r}});ee({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"phantom",mode:n.mode,body:Tt(r)}},htmlBuilder:(t,e)=>{var n=zt(t.body,e.withPhantom(),!1);return yi(n)},mathmlBuilder:(t,e)=>{var n=Bn(t.body,e);return new W("mphantom",n)}});E("\\hphantom","\\smash{\\phantom{#1}}");ee({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=q(["inner"],[Ue(t.body,e.withPhantom())]),r=q(["fix"],[]);return q(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=Bn(Tt(t.body),e),r=new W("mphantom",n),i=new W("mpadded",[r]);return i.setAttribute("width","0px"),i}});ee({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=Ce(e[0],"size").value,i=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(t,e){var n=Ue(t.body,e),r=bt(t.dy,e);return He({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(t,e){var n=new W("mpadded",[Xe(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}});ee({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});ee({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,n){var{parser:r}=t,i=n[0],s=Ce(e[0],"size"),o=Ce(e[1],"size");return{type:"rule",mode:r.mode,shift:i&&Ce(i,"size").value,width:s.value,height:o.value}},htmlBuilder(t,e){var n=q(["mord","rule"],[],e),r=bt(t.width,e),i=bt(t.height,e),s=t.shift?bt(t.shift,e):0;return n.style.borderRightWidth=K(r),n.style.borderTopWidth=K(i),n.style.bottom=K(s),n.width=r,n.height=i+s,n.depth=-s,n.maxFontSize=i*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=bt(t.width,e),r=bt(t.height,e),i=t.shift?bt(t.shift,e):0,s=e.color&&e.getColor()||"black",o=new W("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",K(n)),o.setAttribute("height",K(r));var a=new W("mpadded",[o]);return i>=0?a.setAttribute("height",K(i)):(a.setAttribute("height",K(i)),a.setAttribute("depth",K(-i))),a.setAttribute("voffset",K(i)),a}});function _y(t,e,n){for(var r=zt(t,e,!1),i=e.sizeMultiplier/n.sizeMultiplier,s=0;s<r.length;s++){var o=r[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(r[s].classes,e.sizingClasses(n)):r[s].classes[o+1]==="reset-size"+e.size&&(r[s].classes[o+1]="reset-size"+n.size),r[s].height*=i,r[s].depth*=i}return yi(r)}var Eg=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],xE=(t,e)=>{var n=e.havingSize(t.size);return _y(t.body,n,e)};ee({type:"sizing",names:Eg,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:n,funcName:r,parser:i}=t,s=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:Eg.indexOf(r)+1,body:s}},htmlBuilder:xE,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=Bn(t.body,n),i=new W("mstyle",r);return i.setAttribute("mathsize",K(n.sizeMultiplier)),i}});ee({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,n)=>{var{parser:r}=t,i=!1,s=!1,o=n[0]&&Ce(n[0],"ordgroup");if(o)for(var a,l=0;l<o.body.length;++l){var u=o.body[l];if(a=C0(u).text,a==="t")i=!0;else if(a==="b")s=!0;else{i=!1,s=!1;break}}else i=!0,s=!0;var c=e[0];return{type:"smash",mode:r.mode,body:c,smashHeight:i,smashDepth:s}},htmlBuilder:(t,e)=>{var n=q([],[Ue(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0),t.smashDepth&&(n.depth=0),t.smashHeight&&t.smashDepth)return q(["mord","smash"],[n],e);if(n.children)for(var r=0;r<n.children.length;r++)t.smashHeight&&(n.children[r].height=0),t.smashDepth&&(n.children[r].depth=0);var i=He({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return q(["mord"],[i],e)},mathmlBuilder:(t,e)=>{var n=new W("mpadded",[Xe(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}});ee({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r}=t,i=n[0],s=e[0];return{type:"sqrt",mode:r.mode,body:s,index:i}},htmlBuilder(t,e){var n=Ue(t.body,e.havingCrampedStyle());n.height===0&&(n.height=e.fontMetrics().xHeight),n=Po(n,e);var r=e.fontMetrics(),i=r.defaultRuleThickness,s=i;e.style.id<ye.TEXT.id&&(s=e.fontMetrics().xHeight);var o=i+s/4,a=n.height+n.depth+o+i,{span:l,ruleWidth:u,advanceWidth:c}=oE(a,e),d=l.height-u;d>n.height+n.depth+o&&(o=(o+d-n.height-n.depth)/2);var h=l.height-n.height-o-u;n.style.paddingLeft=K(c);var f=He({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var p=e.havingStyle(ye.SCRIPTSCRIPT),m=Ue(t.index,p,e),g=.6*(f.height-f.depth),y=He({positionType:"shift",positionData:-g,children:[{type:"elem",elem:m}]}),x=q(["root"],[y]);return q(["mord","sqrt"],[x,f],e)}else return q(["mord","sqrt"],[f],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new W("mroot",[Xe(n,e),Xe(r,e)]):new W("msqrt",[Xe(n,e)])}});var Ef={display:ye.DISPLAY,text:ye.TEXT,script:ye.SCRIPT,scriptscript:ye.SCRIPTSCRIPT};function wE(t){return t in Ef}ee({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:r,parser:i}=t,s=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!wE(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(t,e){var n=Ef[t.style],r=e.havingStyle(n);return t.resetFont&&(r=r.withFont("")),_y(t.body,r,e)},mathmlBuilder(t,e){var n=Ef[t.style],r=e.havingStyle(n);t.resetFont&&(r=r.withFont(""));var i=Bn(t.body,r),s=new W("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},a=o[t.style];return s.setAttribute("scriptlevel",a[0]),s.setAttribute("displaystyle",a[1]),s}});var kE=function(e,n){var r=e.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===ye.DISPLAY.size||r.alwaysHandleSupSub);return i?ra:null}else if(r.type==="operatorname"){var s=r.alwaysHandleSupSub&&(n.style.size===ye.DISPLAY.size||r.limits);return s?Cy:null}else{if(r.type==="accent")return gi(r.base)?Jp:null;if(r.type==="horizBrace"){var o=!e.sub;return o===r.isOver?ky:null}else return null}else return null};to({type:"supsub",htmlBuilder(t,e){var n=kE(t,e);if(n)return n(t,e);var{base:r,sup:i,sub:s}=t,o=Ue(r,e),a,l,u=e.fontMetrics(),c=0,d=0,h=r&&gi(r);if(i){var f=e.havingStyle(e.style.sup());a=Ue(i,f,e),h||(c=o.height-f.fontMetrics().supDrop*f.sizeMultiplier/e.sizeMultiplier)}if(s){var p=e.havingStyle(e.style.sub());l=Ue(s,p,e),h||(d=o.depth+p.fontMetrics().subDrop*p.sizeMultiplier/e.sizeMultiplier)}var m;e.style===ye.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var g=e.sizeMultiplier,y=K(.5/u.ptPerEm/g),x=null;if(l){var k=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(o instanceof In||k){var C;x=K(-((C=o.italic)!=null?C:0))}}var _;if(a&&l){c=Math.max(c,m,a.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var T=u.defaultRuleThickness,D=4*T;if(c-a.depth-(l.height-d)<D){d=D-(c-a.depth)+l.height;var I=.8*u.xHeight-(c-a.depth);I>0&&(c+=I,d-=I)}var L=[{type:"elem",elem:l,shift:d,marginRight:y,marginLeft:x},{type:"elem",elem:a,shift:-c,marginRight:y}];_=He({positionType:"individualShift",children:L})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var G=[{type:"elem",elem:l,marginLeft:x,marginRight:y}];_=He({positionType:"shift",positionData:d,children:G})}else if(a)c=Math.max(c,m,a.depth+.25*u.xHeight),_=He({positionType:"shift",positionData:-c,children:[{type:"elem",elem:a,marginRight:y}]});else throw new Error("supsub must have either sup or sub.");var ie=yf(o,"right")||"mord";return q([ie],[o,q(["msupsub"],[_])],e)},mathmlBuilder(t,e){var n=!1,r,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(n=!0,r=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var s=[Xe(t.base,e)];t.sub&&s.push(Xe(t.sub,e)),t.sup&&s.push(Xe(t.sup,e));var o;if(n)o=r?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===ye.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===ye.DISPLAY||u.limits)?o="munderover":o="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===ye.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===ye.DISPLAY)?o="munder":o="msub"}else{var a=t.base;a&&a.type==="op"&&a.limits&&(e.style===ye.DISPLAY||a.alwaysHandleSupSub)||a&&a.type==="operatorname"&&a.alwaysHandleSupSub&&(a.limits||e.style===ye.DISPLAY)?o="mover":o="msup"}return new W(o,s)}});to({type:"atom",htmlBuilder(t,e){return Gp(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new W("mo",[rr(t.text,t.mode)]);if(t.family==="bin"){var r=Zp(t,e);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else t.family==="punct"?n.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&n.setAttribute("stretchy","false");return n}});var Ay={mi:"italic",mn:"normal",mtext:"normal"};to({type:"mathord",htmlBuilder(t,e){return k0(t,e,"mathord")},mathmlBuilder(t,e){var n=new W("mi",[rr(t.text,t.mode,e)]),r=Zp(t,e)||"italic";return r!==Ay[n.type]&&n.setAttribute("mathvariant",r),n}});to({type:"textord",htmlBuilder(t,e){return k0(t,e,"textord")},mathmlBuilder(t,e){var n=rr(t.text,t.mode,e),r=Zp(t,e)||"normal",i;return t.mode==="text"?i=new W("mtext",[n]):/[0-9]/.test(t.text)?i=new W("mn",[n]):t.text==="\\prime"?i=new W("mo",[n]):i=new W("mi",[n]),r!==Ay[i.type]&&i.setAttribute("mathvariant",r),i}});var Id={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Ld={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};to({type:"spacing",htmlBuilder(t,e){if(Ld.hasOwnProperty(t.text)){var n=Ld[t.text].className||"";if(t.mode==="text"){var r=k0(t,e,"textord");return r.classes.push(n),r}else return q(["mspace",n],[Gp(t.text,t.mode,e)],e)}else{if(Id.hasOwnProperty(t.text))return q(["mspace",Id[t.text]],[],e);throw new V('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(Ld.hasOwnProperty(t.text))n=new W("mtext",[new Mt(" ")]);else{if(Id.hasOwnProperty(t.text))return new W("mspace");throw new V('Unknown type of space "'+t.text+'"')}return n}});var Sg=()=>{var t=new W("mtd",[]);return t.setAttribute("width","50%"),t};to({type:"tag",mathmlBuilder(t,e){var n=new W("mtable",[new W("mtr",[Sg(),new W("mtd",[es(t.body,e)]),Sg(),new W("mtd",[es(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var Cg={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},_g={"\\textbf":"textbf","\\textmd":"textmd"},EE={"\\textit":"textit","\\textup":"textup"},Ag=(t,e)=>{var n=t.font;if(n){if(Cg[n])return e.withTextFontFamily(Cg[n]);if(_g[n])return e.withTextFontWeight(_g[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(EE[n])};ee({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"text",mode:n.mode,body:Tt(i),font:r}},htmlBuilder(t,e){var n=Ag(t,e),r=zt(t.body,n,!0);return q(["mord","text"],r,n)},mathmlBuilder(t,e){var n=Ag(t,e);return es(t.body,n)}});ee({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Ue(t.body,e),r=Fo("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=He({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]});return q(["mord","underline"],[s],e)},mathmlBuilder(t,e){var n=new W("mo",[new Mt("‾")]);n.setAttribute("stretchy","true");var r=new W("munder",[Xe(t.body,e),n]);return r.setAttribute("accentunder","true"),r}});ee({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=Ue(t.body,e),r=e.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return He({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]})},mathmlBuilder(t,e){var n=new W("mpadded",[Xe(t.body,e)],["vcenter"]);return new W("mrow",[n])}});ee({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new V("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=Tg(t),r=[],i=e.havingStyle(e.style.text()),s=0;s<n.length;s++){var o=n[s];o==="~"&&(o="\\textasciitilde"),r.push(ln(o,"Typewriter-Regular",t.mode,i,["mord","texttt"]))}return q(["mord","text"].concat(i.sizingClasses(e)),U3(r),i)},mathmlBuilder(t,e){var n=new Mt(Tg(t)),r=new W("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Tg=t=>t.body.replace(/ /g,t.star?"␣":" "),$i=W3,Ty=`[ \r
427
+ ]`,SE="\\\\[a-zA-Z@]+",CE="\\\\[^\uD800-\uDFFF]",_E="("+SE+")"+Ty+"*",AE=`\\\\(
428
+ |[ \r ]+
429
+ ?)[ \r ]*`,Sf="[̀-ͯ]",TE=new RegExp(Sf+"+$"),ME="("+Ty+"+)|"+(AE+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Sf+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Sf+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+_E)+("|"+CE+")");class Mg{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(ME,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new hr("EOF",new xn(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new V("Unexpected character: '"+e[n]+"'",new hr(e[n],new xn(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(`
430
+ `,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new hr(i,new xn(this,n,this.tokenRegex.lastIndex))}}class NE{constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new V("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var DE=gy;E("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});E("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});E("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});E("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});E("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});E("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");E("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Ng={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};E("\\char",function(t){var e=t.popToken(),n,r=0;if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new V("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=Ng[e.text],r==null||r>=n)throw new V("Invalid base-"+n+" digit "+e.text);for(var i;(i=Ng[t.future().text])!=null&&i<n;)r*=n,r+=i,t.popToken()}return"\\@char{"+r+"}"});var tm=(t,e,n,r)=>{var i=t.consumeArg().tokens;if(i.length!==1)throw new V("\\newcommand's first argument must be a macro name");var s=i[0].text,o=t.isDefined(s);if(o&&!e)throw new V("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!o&&!n)throw new V("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new V("Invalid number of arguments: "+l);a=parseInt(l),i=t.consumeArg().tokens}return o&&r||t.macros.set(s,{tokens:i,numArgs:a}),""};E("\\newcommand",t=>tm(t,!1,!0,!1));E("\\renewcommand",t=>tm(t,!0,!1,!1));E("\\providecommand",t=>tm(t,!0,!0,!0));E("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});E("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});E("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),$i[n],dt.math[n],dt.text[n]),""});E("\\bgroup","{");E("\\egroup","}");E("~","\\nobreakspace");E("\\lq","`");E("\\rq","'");E("\\aa","\\r a");E("\\AA","\\r A");E("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");E("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");E("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");E("ℬ","\\mathscr{B}");E("ℰ","\\mathscr{E}");E("ℱ","\\mathscr{F}");E("ℋ","\\mathscr{H}");E("ℐ","\\mathscr{I}");E("ℒ","\\mathscr{L}");E("ℳ","\\mathscr{M}");E("ℛ","\\mathscr{R}");E("ℭ","\\mathfrak{C}");E("ℌ","\\mathfrak{H}");E("ℨ","\\mathfrak{Z}");E("\\Bbbk","\\Bbb{k}");E("\\llap","\\mathllap{\\textrm{#1}}");E("\\rlap","\\mathrlap{\\textrm{#1}}");E("\\clap","\\mathclap{\\textrm{#1}}");E("\\mathstrut","\\vphantom{(}");E("\\underbar","\\underline{\\text{#1}}");E("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');E("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");E("\\ne","\\neq");E("≠","\\neq");E("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");E("∉","\\notin");E("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");E("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");E("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");E("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");E("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");E("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");E("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");E("⟂","\\perp");E("‼","\\mathclose{!\\mkern-0.8mu!}");E("∌","\\notni");E("⌜","\\ulcorner");E("⌝","\\urcorner");E("⌞","\\llcorner");E("⌟","\\lrcorner");E("©","\\copyright");E("®","\\textregistered");E("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');E("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');E("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');E("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');E("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");E("⋮","\\vdots");E("\\varGamma","\\mathit{\\Gamma}");E("\\varDelta","\\mathit{\\Delta}");E("\\varTheta","\\mathit{\\Theta}");E("\\varLambda","\\mathit{\\Lambda}");E("\\varXi","\\mathit{\\Xi}");E("\\varPi","\\mathit{\\Pi}");E("\\varSigma","\\mathit{\\Sigma}");E("\\varUpsilon","\\mathit{\\Upsilon}");E("\\varPhi","\\mathit{\\Phi}");E("\\varPsi","\\mathit{\\Psi}");E("\\varOmega","\\mathit{\\Omega}");E("\\substack","\\begin{subarray}{c}#1\\end{subarray}");E("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");E("\\boxed","\\fbox{$\\displaystyle{#1}$}");E("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");E("\\implies","\\DOTSB\\;\\Longrightarrow\\;");E("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");E("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");E("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Dg={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},OE=new Set(["bin","rel"]);E("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in Dg?e=Dg[n]:(n.slice(0,4)==="\\not"||n in dt.math&&OE.has(dt.math[n].group))&&(e="\\dotsb"),e});var nm={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};E("\\dotso",function(t){var e=t.future().text;return e in nm?"\\ldots\\,":"\\ldots"});E("\\dotsc",function(t){var e=t.future().text;return e in nm&&e!==","?"\\ldots\\,":"\\ldots"});E("\\cdots",function(t){var e=t.future().text;return e in nm?"\\@cdots\\,":"\\@cdots"});E("\\dotsb","\\cdots");E("\\dotsm","\\cdots");E("\\dotsi","\\!\\cdots");E("\\dotsx","\\ldots\\,");E("\\DOTSI","\\relax");E("\\DOTSB","\\relax");E("\\DOTSX","\\relax");E("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");E("\\,","\\tmspace+{3mu}{.1667em}");E("\\thinspace","\\,");E("\\>","\\mskip{4mu}");E("\\:","\\tmspace+{4mu}{.2222em}");E("\\medspace","\\:");E("\\;","\\tmspace+{5mu}{.2777em}");E("\\thickspace","\\;");E("\\!","\\tmspace-{3mu}{.1667em}");E("\\negthinspace","\\!");E("\\negmedspace","\\tmspace-{4mu}{.2222em}");E("\\negthickspace","\\tmspace-{5mu}{.277em}");E("\\enspace","\\kern.5em ");E("\\enskip","\\hskip.5em\\relax");E("\\quad","\\hskip1em\\relax");E("\\qquad","\\hskip2em\\relax");E("\\tag","\\@ifstar\\tag@literal\\tag@paren");E("\\tag@paren","\\tag@literal{({#1})}");E("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new V("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});E("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");E("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");E("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");E("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");E("\\newline","\\\\\\relax");E("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var My=K(Or["Main-Regular"][84][1]-.7*Or["Main-Regular"][65][1]);E("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+My+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");E("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+My+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");E("\\hspace","\\@ifstar\\@hspacer\\@hspace");E("\\@hspace","\\hskip #1\\relax");E("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");E("\\ordinarycolon",":");E("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");E("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');E("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');E("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');E("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');E("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');E("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');E("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');E("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');E("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');E("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');E("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');E("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');E("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');E("∷","\\dblcolon");E("∹","\\eqcolon");E("≔","\\coloneqq");E("≕","\\eqqcolon");E("⩴","\\Coloneqq");E("\\ratio","\\vcentcolon");E("\\coloncolon","\\dblcolon");E("\\colonequals","\\coloneqq");E("\\coloncolonequals","\\Coloneqq");E("\\equalscolon","\\eqqcolon");E("\\equalscoloncolon","\\Eqqcolon");E("\\colonminus","\\coloneq");E("\\coloncolonminus","\\Coloneq");E("\\minuscolon","\\eqcolon");E("\\minuscoloncolon","\\Eqcolon");E("\\coloncolonapprox","\\Colonapprox");E("\\coloncolonsim","\\Colonsim");E("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");E("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");E("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");E("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");E("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");E("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");E("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");E("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");E("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");E("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");E("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");E("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");E("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");E("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");E("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");E("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");E("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");E("\\nleqq","\\html@mathml{\\@nleqq}{≰}");E("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");E("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");E("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");E("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");E("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");E("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");E("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");E("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");E("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");E("\\imath","\\html@mathml{\\@imath}{ı}");E("\\jmath","\\html@mathml{\\@jmath}{ȷ}");E("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");E("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");E("⟦","\\llbracket");E("⟧","\\rrbracket");E("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");E("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");E("⦃","\\lBrace");E("⦄","\\rBrace");E("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");E("⦵","\\minuso");E("\\darr","\\downarrow");E("\\dArr","\\Downarrow");E("\\Darr","\\Downarrow");E("\\lang","\\langle");E("\\rang","\\rangle");E("\\uarr","\\uparrow");E("\\uArr","\\Uparrow");E("\\Uarr","\\Uparrow");E("\\N","\\mathbb{N}");E("\\R","\\mathbb{R}");E("\\Z","\\mathbb{Z}");E("\\alef","\\aleph");E("\\alefsym","\\aleph");E("\\Alpha","\\mathrm{A}");E("\\Beta","\\mathrm{B}");E("\\bull","\\bullet");E("\\Chi","\\mathrm{X}");E("\\clubs","\\clubsuit");E("\\cnums","\\mathbb{C}");E("\\Complex","\\mathbb{C}");E("\\Dagger","\\ddagger");E("\\diamonds","\\diamondsuit");E("\\empty","\\emptyset");E("\\Epsilon","\\mathrm{E}");E("\\Eta","\\mathrm{H}");E("\\exist","\\exists");E("\\harr","\\leftrightarrow");E("\\hArr","\\Leftrightarrow");E("\\Harr","\\Leftrightarrow");E("\\hearts","\\heartsuit");E("\\image","\\Im");E("\\infin","\\infty");E("\\Iota","\\mathrm{I}");E("\\isin","\\in");E("\\Kappa","\\mathrm{K}");E("\\larr","\\leftarrow");E("\\lArr","\\Leftarrow");E("\\Larr","\\Leftarrow");E("\\lrarr","\\leftrightarrow");E("\\lrArr","\\Leftrightarrow");E("\\Lrarr","\\Leftrightarrow");E("\\Mu","\\mathrm{M}");E("\\natnums","\\mathbb{N}");E("\\Nu","\\mathrm{N}");E("\\Omicron","\\mathrm{O}");E("\\plusmn","\\pm");E("\\rarr","\\rightarrow");E("\\rArr","\\Rightarrow");E("\\Rarr","\\Rightarrow");E("\\real","\\Re");E("\\reals","\\mathbb{R}");E("\\Reals","\\mathbb{R}");E("\\Rho","\\mathrm{P}");E("\\sdot","\\cdot");E("\\sect","\\S");E("\\spades","\\spadesuit");E("\\sub","\\subset");E("\\sube","\\subseteq");E("\\supe","\\supseteq");E("\\Tau","\\mathrm{T}");E("\\thetasym","\\vartheta");E("\\weierp","\\wp");E("\\Zeta","\\mathrm{Z}");E("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");E("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");E("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");E("\\bra","\\mathinner{\\langle{#1}|}");E("\\ket","\\mathinner{|{#1}\\rangle}");E("\\braket","\\mathinner{\\langle{#1}\\rangle}");E("\\Bra","\\left\\langle#1\\right|");E("\\Ket","\\left|#1\\right\\rangle");var Ny=t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,o=e.macros.get("|"),a=e.macros.get("\\|");e.macros.beginGroup();var l=d=>h=>{t&&(h.macros.set("|",o),i.length&&h.macros.set("\\|",a));var f=d;if(!d&&i.length){var p=h.future();p.text==="|"&&(h.popToken(),f=!0)}return{tokens:f?i:r,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,c=e.expandTokens([...s,...u,...n]);return e.macros.endGroup(),{tokens:c.reverse(),numArgs:0}};E("\\bra@ket",Ny(!1));E("\\bra@set",Ny(!0));E("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");E("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");E("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");E("\\angln","{\\angl n}");E("\\blue","\\textcolor{##6495ed}{#1}");E("\\orange","\\textcolor{##ffa500}{#1}");E("\\pink","\\textcolor{##ff00af}{#1}");E("\\red","\\textcolor{##df0030}{#1}");E("\\green","\\textcolor{##28ae7b}{#1}");E("\\gray","\\textcolor{gray}{#1}");E("\\purple","\\textcolor{##9d38bd}{#1}");E("\\blueA","\\textcolor{##ccfaff}{#1}");E("\\blueB","\\textcolor{##80f6ff}{#1}");E("\\blueC","\\textcolor{##63d9ea}{#1}");E("\\blueD","\\textcolor{##11accd}{#1}");E("\\blueE","\\textcolor{##0c7f99}{#1}");E("\\tealA","\\textcolor{##94fff5}{#1}");E("\\tealB","\\textcolor{##26edd5}{#1}");E("\\tealC","\\textcolor{##01d1c1}{#1}");E("\\tealD","\\textcolor{##01a995}{#1}");E("\\tealE","\\textcolor{##208170}{#1}");E("\\greenA","\\textcolor{##b6ffb0}{#1}");E("\\greenB","\\textcolor{##8af281}{#1}");E("\\greenC","\\textcolor{##74cf70}{#1}");E("\\greenD","\\textcolor{##1fab54}{#1}");E("\\greenE","\\textcolor{##0d923f}{#1}");E("\\goldA","\\textcolor{##ffd0a9}{#1}");E("\\goldB","\\textcolor{##ffbb71}{#1}");E("\\goldC","\\textcolor{##ff9c39}{#1}");E("\\goldD","\\textcolor{##e07d10}{#1}");E("\\goldE","\\textcolor{##a75a05}{#1}");E("\\redA","\\textcolor{##fca9a9}{#1}");E("\\redB","\\textcolor{##ff8482}{#1}");E("\\redC","\\textcolor{##f9685d}{#1}");E("\\redD","\\textcolor{##e84d39}{#1}");E("\\redE","\\textcolor{##bc2612}{#1}");E("\\maroonA","\\textcolor{##ffbde0}{#1}");E("\\maroonB","\\textcolor{##ff92c6}{#1}");E("\\maroonC","\\textcolor{##ed5fa6}{#1}");E("\\maroonD","\\textcolor{##ca337c}{#1}");E("\\maroonE","\\textcolor{##9e034e}{#1}");E("\\purpleA","\\textcolor{##ddd7ff}{#1}");E("\\purpleB","\\textcolor{##c6b9fc}{#1}");E("\\purpleC","\\textcolor{##aa87ff}{#1}");E("\\purpleD","\\textcolor{##7854ab}{#1}");E("\\purpleE","\\textcolor{##543b78}{#1}");E("\\mintA","\\textcolor{##f5f9e8}{#1}");E("\\mintB","\\textcolor{##edf2df}{#1}");E("\\mintC","\\textcolor{##e0e5cc}{#1}");E("\\grayA","\\textcolor{##f6f7f7}{#1}");E("\\grayB","\\textcolor{##f0f1f2}{#1}");E("\\grayC","\\textcolor{##e3e5e6}{#1}");E("\\grayD","\\textcolor{##d6d8da}{#1}");E("\\grayE","\\textcolor{##babec2}{#1}");E("\\grayF","\\textcolor{##888d93}{#1}");E("\\grayG","\\textcolor{##626569}{#1}");E("\\grayH","\\textcolor{##3b3e40}{#1}");E("\\grayI","\\textcolor{##21242c}{#1}");E("\\kaBlue","\\textcolor{##314453}{#1}");E("\\kaGreen","\\textcolor{##71B307}{#1}");var Dy={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class RE{constructor(e,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(e),this.macros=new NE(DE,n.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new Mg(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var n,r,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new hr("EOF",r.loc)),this.pushTokens(i),new hr("",xn.range(n,r))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],r=e&&e.length>0;r||this.consumeSpaces();var i=this.future(),s,o=0,a=0;do{if(s=this.popToken(),n.push(s),s.text==="{")++o;else if(s.text==="}"){if(--o,o===-1)throw new V("Extra }",s)}else if(s.text==="EOF")throw new V("Unexpected end of input in a macro argument, expected '"+(e&&r?e[a]:"}")+"'",s);if(e&&r)if((o===0||o===1&&e[a]==="{")&&s.text===e[a]){if(++a,a===e.length){n.splice(-a,a);break}}else a=0}while(o!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:s}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new V("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;i<r.length;i++){var s=this.popToken();if(r[i]!==s.text)throw new V("Use of the macro doesn't match its definition",s)}}for(var o=[],a=0;a<e;a++)o.push(this.consumeArg(n&&n[a+1]).tokens);return o}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new V("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||e&&i.unexpandable){if(e&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new V("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var s=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var a=s.length-1;a>=0;--a){var l=s[a];if(l.text==="#"){if(a===0)throw new V("Incomplete placeholder at end of macro body",l);if(l=s[--a],l.text==="#")s.splice(a+1,1);else if(/^[1-9]$/.test(l.text))s.splice(a,2,...o[+l.text-1]);else throw new V("Not a valid argument number",l)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new hr(e)]):void 0}expandTokens(e){var n=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(r=>r.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var r=this.lexer.catcodes[e];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var s=0;if(i.includes("#"))for(var o=i.replace(/##/g,"");o.includes("#"+(s+1));)++s;for(var a=new Mg(i,this.settings),l=[],u=a.lex();u.text!=="EOF";)l.push(u),u=a.lex();l.reverse();var c={tokens:l,numArgs:s};return c}return i}isDefined(e){return this.macros.has(e)||$i.hasOwnProperty(e)||dt.math.hasOwnProperty(e)||dt.text.hasOwnProperty(e)||Dy.hasOwnProperty(e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:$i.hasOwnProperty(e)&&!$i[e].primitive}}var Og=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,ru=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),zd={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Rg={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class O0{constructor(e,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new RE(e,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(e,n){if(n===void 0&&(n=!0),this.fetch().text!==e)throw new V("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var n=this.nextToken;this.consume(),this.gullet.pushToken(new hr("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(e,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(O0.endOfExpression.has(i.text)||n&&i.text===n||e&&$i[i.text]&&$i[i.text].infix)break;var s=this.parseAtom(n);if(s){if(s.type==="internal")continue}else break;r.push(s)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var n=-1,r,i=0;i<e.length;i++){var s=e[i];if(s.type==="infix"){if(n!==-1)throw new V("only one infix operator per group",s.token);n=i,r=s.replaceWith}}if(n!==-1&&r){var o,a,l=e.slice(0,n),u=e.slice(n+1);l.length===1&&l[0].type==="ordgroup"?o=l[0]:o={type:"ordgroup",mode:this.mode,body:l},u.length===1&&u[0].type==="ordgroup"?a=u[0]:a={type:"ordgroup",mode:this.mode,body:u};var c;return r==="\\\\abovefrac"?c=this.callFunction(r,[o,e[n],a],[]):c=this.callFunction(r,[o,a],[]),[c]}else return e}handleSupSubscript(e){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var i;do{var s;i=this.parseGroup(e)}while(((s=i)==null?void 0:s.type)==="internal");if(!i)throw new V("Expected group after '"+r+"'",n);return i}formatUnsupportedCmd(e){for(var n=[],r=0;r<e.length;r++)n.push({type:"textord",mode:"text",text:e[r]});var i={type:"text",mode:this.mode,body:n},s={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return s}parseAtom(e){var n=this.parseGroup("atom",e);if((n==null?void 0:n.type)==="internal"||this.mode==="text")return n;for(var r,i;;){this.consumeSpaces();var s=this.fetch();if(s.text==="\\limits"||s.text==="\\nolimits"){if(n&&n.type==="op"){var o=s.text==="\\limits";n.limits=o,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=s.text==="\\limits");else throw new V("Limit controls must follow a math operator",s);this.consume()}else if(s.text==="^"){if(r)throw new V("Double superscript",s);r=this.handleSupSubscript("superscript")}else if(s.text==="_"){if(i)throw new V("Double subscript",s);i=this.handleSupSubscript("subscript")}else if(s.text==="'"){if(r)throw new V("Double superscript",s);var a={type:"textord",mode:this.mode,text:"\\prime"},l=[a];for(this.consume();this.fetch().text==="'";)l.push(a),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:l}}else if(ru[s.text]){var u=Og.test(s.text),c=[];for(c.push(new hr(ru[s.text])),this.consume();;){var d=this.fetch().text;if(!ru[d]||Og.test(d)!==u)break;c.unshift(new hr(ru[d])),this.consume()}var h=this.subparse(c);u?i={type:"ordgroup",mode:"math",body:h}:r={type:"ordgroup",mode:"math",body:h}}else break}return r||i?{type:"supsub",mode:this.mode,base:n,sup:r,sub:i}:n}parseFunction(e,n){var r=this.fetch(),i=r.text,s=$i[i];if(!s)return null;if(this.consume(),n&&n!=="atom"&&!s.allowedInArgument)throw new V("Got function '"+i+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!s.allowedInText)throw new V("Can't use function '"+i+"' in text mode",r);if(this.mode==="math"&&s.allowedInMath===!1)throw new V("Can't use function '"+i+"' in math mode",r);var{args:o,optArgs:a}=this.parseArguments(i,s);return this.callFunction(i,o,a,r,e)}callFunction(e,n,r,i,s){var o={funcName:e,parser:this,token:i,breakOnTokenText:s},a=$i[e];if(a&&a.handler)return a.handler(o,n,r);throw new V("No function handler for "+e)}parseArguments(e,n){var r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};for(var i=[],s=[],o=0;o<r;o++){var a=n.argTypes&&n.argTypes[o],l=o<n.numOptionalArgs;("primitive"in n&&n.primitive&&a==null||n.type==="sqrt"&&o===1&&s[0]==null)&&(a="primitive");var u=this.parseGroupOfType("argument to '"+e+"'",a,l);if(l)s.push(u);else if(u!=null)i.push(u);else throw new V("Null argument, please report this as a bug")}return{args:i,optArgs:s}}parseGroupOfType(e,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var i=this.parseArgumentGroup(r,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text",resetFont:!0}:null}case"raw":{var s=this.parseStringGroup("raw",r);return s!=null?{type:"raw",mode:"text",string:s.text}:null}case"primitive":{if(r)throw new V("A primitive argument cannot be optional");var o=this.parseGroup(e);if(o==null)throw new V("Expected group as "+e,this.fetch());return o}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new V("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,n){var r=this.gullet.scanArgument(n);if(r==null)return null;for(var i="",s;(s=this.fetch()).text!=="EOF";)i+=s.text,this.consume();return this.consume(),r.text=i,r}parseRegexGroup(e,n){for(var r=this.fetch(),i=r,s="",o;(o=this.fetch()).text!=="EOF"&&e.test(s+o.text);)i=o,s+=i.text,this.consume();if(s==="")throw new V("Invalid "+n+": '"+r.text+"'",r);return r.range(i,s)}parseColorGroup(e){var n=this.parseStringGroup("color",e);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new V("Invalid color: '"+n.text+"'",n);var i=r[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var n,r=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",e),!n)return null;!e&&n.text.length===0&&(n.text="0pt",r=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!i)throw new V("Invalid size: '"+n.text+"'",n);var s={number:+(i[1]+i[2]),unit:i[3]};if(!B3(s))throw new V("Invalid unit: '"+s.unit+"'",n);return{type:"size",mode:this.mode,value:s,isBlank:r}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(e,n){var r=this.gullet.scanArgument(e);if(r==null)return null;var i=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var s=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:r.loc,body:s};return n&&this.switchMode(i),o}parseGroup(e,n){var r=this.fetch(),i=r.text,s;if(i==="{"||i==="\\begingroup"){this.consume();var o=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,o),l=this.fetch();this.expect(o),this.gullet.endGroup(),s={type:"ordgroup",mode:this.mode,loc:xn.range(r,l),body:a,semisimple:i==="\\begingroup"||void 0}}else if(s=this.parseFunction(n,e)||this.parseSymbol(),s==null&&i[0]==="\\"&&!Dy.hasOwnProperty(i)){if(this.settings.throwOnError)throw new V("Undefined control sequence: "+i,r);s=this.formatUnsupportedCmd(i),this.consume()}return s}formLigatures(e){for(var n=e.length-1,r=0;r<n;++r){var i=e[r];if(i.type==="textord"){var s=i.text,o=e[r+1];if(!(!o||o.type!=="textord")){if(s==="-"&&o.text==="-"){var a=e[r+2];r+1<n&&a&&a.type==="textord"&&a.text==="-"?(e.splice(r,3,{type:"textord",mode:"text",loc:xn.range(i,a),text:"---"}),n-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:xn.range(i,o),text:"--"}),n-=1)}(s==="'"||s==="`")&&o.text===s&&(e.splice(r,2,{type:"textord",mode:"text",loc:xn.range(i,o),text:s+s}),n-=1)}}}}parseSymbol(){var e=this.fetch(),n=e.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),i=r.charAt(0)==="*";if(i&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new V(`\\verb assertion failed --
431
+ please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:i}}Rg.hasOwnProperty(n[0])&&!dt[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',e),n=Rg[n[0]]+n.slice(1));var s=TE.exec(n);s&&(n=n.substring(0,s.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var o;if(dt[this.mode][n]){this.settings.strict&&this.mode==="math"&&cf.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var a=dt[this.mode][n].group,l=xn.range(e),u;Y9(a)?u={type:"atom",mode:this.mode,family:a,loc:l,text:n}:u={type:a,mode:this.mode,loc:l,text:n},o=u}else if(n.charCodeAt(0)>=128)this.settings.strict&&(z3(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),o={type:"textord",mode:"text",loc:xn.range(e),text:n};else return null;if(this.consume(),s)for(var c=0;c<s[0].length;c++){var d=s[0][c];if(!zd[d])throw new V("Unknown accent ' "+d+"'",e);var h=zd[d][this.mode]||zd[d].text;if(!h)throw new V("Accent "+d+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:xn.range(e),label:h,isStretchy:!1,isShifty:!0,base:o}}return o}}O0.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var rm=function(e,n){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new O0(e,n);delete r.gullet.macros.current["\\df@tag"];var i=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new V("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:r.subparse([new hr("\\df@tag")])}]}return i},Oy=function(e,n,r){n.textContent="";var i=im(e,r).toNode();n.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Oy=function(){throw new V("KaTeX doesn't work in quirks mode.")});var IE=function(e,n){var r=im(e,n).toMarkup();return r},LE=function(e,n){var r=new qp(n);return rm(e,r)},Ry=function(e,n,r){if(r.throwOnError||!(e instanceof V))throw e;var i=q(["katex-error"],[new In(n)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+r.errorColor),i},im=function(e,n){var r=new qp(n);try{var i=rm(e,r);return H9(i,e,r)}catch(s){return Ry(s,e,r)}},zE=function(e,n){var r=new qp(n);try{var i=rm(e,r);return U9(i,e,r)}catch(s){return Ry(s,e,r)}},BE="0.16.47",FE={Span:ta,Anchor:x0,SymbolNode:In,SvgNode:mi,PathNode:Xi,LineNode:uf},Ig={version:BE,render:Oy,renderToString:IE,ParseError:V,SETTINGS_SCHEMA:of,__parse:LE,__renderToDomTree:im,__renderToHTMLTree:zE,__setFontMetrics:k9,__defineSymbol:b,__defineFunction:ee,__defineMacro:E,__domTree:FE};const PE={};function $E(t){const e=this,n=t||PE,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Hk(n)),s.push(Rk()),o.push(Ik(n))}const Lg=/[#.]/g;function HE(t,e){const n=t||"",r={};let i=0,s,o;for(;i<n.length;){Lg.lastIndex=i;const a=Lg.exec(n),l=n.slice(i,a?a.index:n.length);l&&(s?s==="#"?r.id=l:Array.isArray(r.className)?r.className.push(l):r.className=[l]:o=l,i+=l.length),a&&(s=a[0],i++)}return{type:"element",tagName:o||e||"div",properties:r,children:[]}}function Iy(t,e,n){const r=n?VE(n):void 0;function i(s,o,...a){let l;if(s==null){l={type:"root",children:[]};const u=o;a.unshift(u)}else{l=HE(s,e);const u=l.tagName.toLowerCase(),c=r?r.get(u):void 0;if(l.tagName=c||u,UE(o))a.unshift(o);else for(const[d,h]of Object.entries(o))qE(t,l.properties,d,h)}for(const u of a)Cf(l.children,u);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return i}function UE(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const r of n){const i=e[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const o of s)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function qE(t,e,n,r){const i=A7(t,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=V1(r):i.commaSeparated?s=W1(r):i.commaOrSpaceSeparated?s=V1(W1(r).join(" ")):s=zg(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?jE(r):String(r);if(Array.isArray(s)){const o=[];for(const a of s)o.push(zg(i,i.property,a));s=o}i.property==="className"&&Array.isArray(e.className)&&(s=e.className.concat(s)),e[i.property]=s}}function Cf(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)Cf(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?Cf(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function zg(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||G1(n)===G1(e)))return!0}return n}function jE(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function VE(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const WE=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],GE=Iy(T7,"div"),KE=Iy(M7,"g",WE),Bd={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function YE(t,e){return Ly(t,{})||{type:"root",children:[]}}function Ly(t,e){const n=ZE(t,e);return n&&e.afterTransform&&e.afterTransform(t,n),n}function ZE(t,e){switch(t.nodeType){case 1:return eS(t,e);case 3:return XE(t);case 8:return QE(t);case 9:return Bg(t,e);case 10:return JE();case 11:return Bg(t,e);default:return}}function Bg(t,e){return{type:"root",children:zy(t,e)}}function JE(){return{type:"doctype"}}function XE(t){return{type:"text",value:t.nodeValue||""}}function QE(t){return{type:"comment",value:t.nodeValue||""}}function eS(t,e){const n=t.namespaceURI,r=n===Bd.svg?KE:GE,i=n===Bd.html?t.tagName.toLowerCase():t.tagName,s=n===Bd.html&&i==="template"?t.content:t,o=t.getAttributeNames(),a={};let l=-1;for(;++l<o.length;)a[o[l]]=t.getAttribute(o[l])||"";return r(i,a,zy(s,e))}function zy(t,e){const n=t.childNodes,r=[];let i=-1;for(;++i<n.length;){const s=Ly(n[i],e);s!==void 0&&r.push(s)}return r}new DOMParser;function tS(t,e){const n=nS(t);return YE(n)}function nS(t){const e=document.createElement("template");return e.innerHTML=t,e.content}const Fg=(function(t,e,n){const r=N7(n);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(r(t.children[e],e,t))return t.children[e]}),no=(function(t){if(t==null)return sS;if(typeof t=="string")return iS(t);if(typeof t=="object")return rS(t);if(typeof t=="function")return sm(t);throw new Error("Expected function, string, or array as `test`")});function rS(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=no(t[n]);return sm(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function iS(t){return sm(e);function e(n){return n.tagName===t}}function sm(t){return e;function e(n,r,i){return!!(oS(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function sS(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function oS(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const Pg=/\n/g,$g=/[\t ]+/g,_f=no("br"),Hg=no(pS),aS=no("p"),Ug=no("tr"),lS=no(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",fS,mS]),By=no(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function uS(t,e){const n=e||{},r="children"in t?t.children:[],i=By(t),s=$y(t,{whitespace:n.whitespace||"normal"}),o=[];(t.type==="text"||t.type==="comment")&&o.push(...Py(t,{breakBefore:!0,breakAfter:!0}));let a=-1;for(;++a<r.length;)o.push(...Fy(r[a],t,{whitespace:s,breakBefore:a?void 0:i,breakAfter:a<r.length-1?_f(r[a+1]):i}));const l=[];let u;for(a=-1;++a<o.length;){const c=o[a];typeof c=="number"?u!==void 0&&c>u&&(u=c):c&&(u!==void 0&&u>-1&&l.push(`
432
+ `.repeat(u)||" "),u=-1,l.push(c))}return l.join("")}function Fy(t,e,n){return t.type==="element"?cS(t,e,n):t.type==="text"?n.whitespace==="normal"?Py(t,n):dS(t):[]}function cS(t,e,n){const r=$y(t,n),i=t.children||[];let s=-1,o=[];if(lS(t))return o;let a,l;for(_f(t)||Ug(t)&&Fg(e,t,Ug)?l=`
433
+ `:aS(t)?(a=2,l=2):By(t)&&(a=1,l=1);++s<i.length;)o=o.concat(Fy(i[s],t,{whitespace:r,breakBefore:s?void 0:a,breakAfter:s<i.length-1?_f(i[s+1]):l}));return Hg(t)&&Fg(e,t,Hg)&&o.push(" "),a&&o.unshift(a),l&&o.push(l),o}function Py(t,e){const n=String(t.value),r=[],i=[];let s=0;for(;s<=n.length;){Pg.lastIndex=s;const l=Pg.exec(n),u=l&&"index"in l?l.index:n.length;r.push(hS(n.slice(s,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?e.breakBefore:!0,u===n.length?e.breakAfter:!0)),s=u+1}let o=-1,a;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),a=void 0):r[o]?(typeof a=="number"&&i.push(a),i.push(r[o]),a=0):(o===0||o===r.length-1)&&i.push(0);return i}function dS(t){return[String(t.value)]}function hS(t,e,n){const r=[];let i=0,s;for(;i<t.length;){$g.lastIndex=i;const o=$g.exec(t);s=o?o.index:t.length,!i&&!s&&o&&!e&&r.push(""),i!==s&&r.push(t.slice(i,s)),i=o?s+o[0].length:s}return i!==s&&!n&&r.push(""),r.join(" ")}function $y(t,e){if(t.type==="element"){const n=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function fS(t){return!!(t.properties||{}).hidden}function pS(t){return t.tagName==="td"||t.tagName==="th"}function mS(t){return t.tagName==="dialog"&&!(t.properties||{}).open}const gS={},bS=[];function yS(t){const e=t||gS;return function(n,r){D7(n,"element",function(i,s){const o=Array.isArray(i.properties.className)?i.properties.className:bS,a=o.includes("language-math"),l=o.includes("math-display"),u=o.includes("math-inline");let c=l;if(!a&&!l&&!u)return;let d=s[s.length-1],h=i;if(i.tagName==="code"&&a&&d&&d.type==="element"&&d.tagName==="pre"&&(h=d,d=s[s.length-2],c=!0),!d)return;const f=uS(h,{whitespace:"pre"});let p;try{p=Ig.renderToString(f,{...e,displayMode:c,throwOnError:!0})}catch(g){const y=g,x=y.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...s,i],cause:y,place:i.position,ruleId:x,source:"rehype-katex"});try{p=Ig.renderToString(f,{...e,displayMode:c,strict:"ignore",throwOnError:!1})}catch{p=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(e.errorColor||"#cc0000"),title:String(g)},children:[{type:"text",value:f}]}]}}typeof p=="string"&&(p=tS(p).children);const m=d.children.indexOf(h);return d.children.splice(m,1,...p),O7})}}const vS=()=>(t,e)=>{const n=String(e);qs(t,"inlineMath",r=>{if(!/^\s|\s$/.test(r.value??""))return;const{start:i,end:s}=r.position??{};r.type="text",r.value=i&&s?n.slice(i.offset,s.offset):`$${r.value}$`})},xS=/\$\$([\s\S]+?)\$\$|\$(?![\s$])([^\n$]*[^\s$])\$/g,wS=/\\([`*\\~[\]_])/g;function kS(t){return t.replace(xS,(e,n,r)=>{const i=n??r;if(i===void 0)return e;const s=i.replace(wS,"$1");return n===void 0?`$${s}$`:`$$${s}$$`})}const ga=/(?:^|\s)@\(([^)]+)\)/g,qg=(t,e)=>({type:"mention",data:{hName:"mention",hProperties:e?{"data-mention-email":e}:{},hChildren:[{type:"text",value:`@${t}`}]}}),ES=()=>t=>{qs(t,"link",(e,n,r)=>{if(!r||n===null||n===void 0||typeof e.url!="string"||!e.url.startsWith("mailto:"))return;const i=r.children[n-1];if(!i||i.type!=="text"||!i.value.endsWith("@"))return;const s=decodeURIComponent(e.url.slice(7)),o=i.value.slice(0,-1),a=[...o?[{type:"text",value:o}]:[],qg(s.split("@")[0],s)];return r.children.splice(n-1,2,...a),n-1+a.length}),qs(t,"text",(e,n,r)=>{if(!r||n===null||n===void 0)return;const i=e.value;if(ga.lastIndex=0,!ga.test(i))return;ga.lastIndex=0;const s=[];let o=0,a;for(;(a=ga.exec(i))!==null;){const l=/^\s/.test(a[0])?a[0][0]:"",u=i.slice(o,a.index)+l;u&&s.push({type:"text",value:u}),s.push(qg(a[1])),o=ga.lastIndex}return o<i.length&&s.push({type:"text",value:i.slice(o)}),r.children.splice(n,1,...s),n+s.length})},SS=new Set(["a","b","blockquote","br","code","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","li","mark","ol","p","pre","s","span","strong","sub","sup","table","tbody","td","th","thead","tr","u","ul"]),Hy=/<(\/?)([a-zA-Z][a-zA-Z0-9-]*)((?:\s[^<>]*)?\/?)>/g;function Uy(t){return SS.has(t.toLowerCase())}const CS=new RegExp("(```[\\s\\S]*?```|~~~[\\s\\S]*?~~~|`[^`\\n]*`)|"+Hy.source,"g");function jg(t){return t.replace(CS,(e,n,r,i,s)=>n!==void 0?n:Uy(i)?e:`&lt;${r}${i}${s}>`)}function _S(t){let e=t,n;do n=e,e=e.replace(Hy,(r,i,s)=>Uy(s)?"":r);while(e!==n);return e}const Af=/^\/nests\/[^/]+\/assets\/[0-9a-f-]{36}\.(mp4|webm)$/,AS=new Set(["youtube.com","www.youtube.com","m.youtube.com","youtu.be","youtube-nocookie.com","www.youtube-nocookie.com"]),TS=new Set(["vimeo.com","www.vimeo.com","player.vimeo.com"]),MS=/^[A-Za-z0-9_-]{11}$/,NS=/^\d{1,12}$/,DS=/^[0-9a-f]+$/i,OS=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s?)?$/;function RS(t){if(!t)return 0;const e=OS.exec(t);if(!e)return 0;const[,n,r,i]=e;return Number(n??0)*3600+Number(r??0)*60+Number(i??0)}function IS(t){const e=t.pathname.split("/").filter(Boolean);let n=null;return t.hostname==="youtu.be"?e.length===1&&(n=e[0]):e.length===1&&e[0]==="watch"?n=t.searchParams.get("v"):e.length===2&&(e[0]==="shorts"||e[0]==="embed")&&(n=e[1]),n&&MS.test(n)?n:null}function LS(t){const e=t.pathname.split("/").filter(Boolean);let n,r=null;if(t.hostname==="player.vimeo.com"){if(e.length!==2||e[0]!=="video")return null;n=e[1],r=t.searchParams.get("h")}else{if(e.length<1||e.length>2)return null;n=e[0],r=e[1]??null}if(!n||!NS.test(n)||r!==null&&!DS.test(r))return null;const i=`https://player.vimeo.com/video/${n}`;return r?`${i}?h=${r}`:i}function qy(t){let e;try{e=new URL(t.trim())}catch{return null}if(e.protocol!=="https:"&&e.protocol!=="http:"||e.username||e.password||e.port)return null;const n=e.hostname.toLowerCase();if(AS.has(n)){const r=IS(e);if(!r)return null;const i=RS(e.searchParams.get("t")??e.searchParams.get("start")),s=`https://www.youtube-nocookie.com/embed/${r}`;return{provider:"youtube",embedUrl:i>0?`${s}?start=${i}`:s}}if(TS.has(n)){const r=LS(e);return r?{provider:"vimeo",embedUrl:r}:null}return null}function zS(t){const e=t.trim();if(!e)return null;if(Af.test(e))return{kind:"asset",src:e};const n=qy(e);return n?{kind:"embed",...n}:null}function rc(t,e){const n=t.trim();return e!=null&&e!==n?null:zS(n)}function jy(t){return t.type==="text"?t.value??"":(t.children??[]).map(jy).join("")}function BS(t){var r;const e=(t??[]).filter(i=>!(i.type==="text"&&!(i.value??"").trim()));if(e.length!==1)return null;const n=e[0];if(n.type==="text")return rc(n.value??"");if(n.type==="element"&&n.tagName==="a"){const i=(r=n.properties)==null?void 0:r.href;return typeof i!="string"?null:rc(jy(n),i)}return null}const Tf="contextnest://",FS=/contextnest:\/\/[^\s<>()[\]"'`,;]*[^\s<>()[\]"'`,;.:!?]/g;function Vg(t){if(!t.startsWith(Tf))return null;let e=t.slice(Tf.length);return!e||e.includes("//")||e.startsWith("tag/")||e.startsWith("search/")||(e=e.split("#")[0].split("@")[0].replace(/[.,;:!?]+$/,""),!e||e.endsWith("/"))?null:e}function Wg(t){return t.split("/").filter(Boolean).pop()??t}function Gg(t){const e=t.lastIndexOf("/");return e>=0?t.slice(e+1):t}function Vy(t,e){const n=e.trim().toLowerCase();if(!n)return null;const r=Gg(n);return t.find(i=>i.id.toLowerCase()===n||i.title.toLowerCase()===n||Gg(i.id).toLowerCase()===r)??null}function FW(t,e,n,r){const i=Vy(t,e);if(i)return{kind:"navigate",node:i};const s=(r==null?void 0:r.trim())||e;return n?{kind:"create",title:s}:{kind:"blocked",title:s}}function PS(t,e){return e?e(t)===null:!1}function $S(t,e=280){const n=(t??"").replace(/```[\s\S]*?```/g," ").replace(/^#{1,6}\s+/gm,"").replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(r,i,s)=>s??i).replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/[*_`~>]/g,"").replace(/\s+/g," ").trim();return n.length>e?n.slice(0,e).trimEnd()+"…":n}const mo=new RegExp(`\\[\\[([^\\]|\\n]+)(?:\\|([^\\]\\n]+))?\\]\\]|(${FS.source})`,"g"),HS=()=>t=>{qs(t,"text",(e,n,r)=>{if(!r||n===null||n===void 0)return;const i=e.value;if(mo.lastIndex=0,!mo.test(i))return;mo.lastIndex=0;const s=[];let o=0,a;for(;(a=mo.exec(i))!==null;){a.index>o&&s.push({type:"text",value:i.slice(o,a.index)});let l,u;if(a[3]){const c=Vg(a[3]);if(!c){s.push({type:"text",value:a[3]}),o=mo.lastIndex;continue}l=c,u=Wg(c)}else l=a[1].trim(),u=(a[2]??a[1]).trim();s.push(Kg(l,u)),o=mo.lastIndex}return o<i.length&&s.push({type:"text",value:i.slice(o)}),r.children.splice(n,1,...s),n+s.length}),qs(t,"link",(e,n,r)=>{if(!r||n===null||n===void 0||typeof e.url!="string"||!e.url.startsWith(Tf))return;const i=Vg(e.url);if(!i)return;const s=(e.children??[]).map(o=>o.type==="text"?o.value:"").join("").trim();r.children.splice(n,1,Kg(i,s||Wg(i)))})};function Kg(t,e){return{type:"wikiLink",data:{hName:"wikilink",hProperties:{"data-wiki-target":t,"data-wiki-display":e},hChildren:[{type:"text",value:`«${e}»`}]}}}const Yg=/^<span style=["']color:\s*(#[0-9a-fA-F]{3,8})["']>$/,US=/^<\/span>$/,qS=()=>t=>{qs(t,"html",(e,n,r)=>{if(!r||n===null||n===void 0)return;const i=Yg.exec((e.value??"").trim());if(!i)return;const s=r.children;let o=-1;for(let u=n+1;u<s.length;u++){const c=s[u];if(c.type!=="html")continue;const d=(c.value??"").trim();if(Yg.test(d))break;US.test(d)&&(o=u);break}if(o===-1)return;const a=s.slice(n+1,o);if(!a.every(u=>u.type==="text"))return;const l=a.map(u=>u.value).join("");return s.splice(n,o-n+1,{type:"colorSpan",data:{hName:"span",hProperties:{style:`color: ${i[1]}`},hChildren:[{type:"text",value:l}]}}),n})},jS=()=>t=>{qs(t,"html",e=>{e.type="text",e.value=_S(e.value||"")})},Fd=({src:t})=>S.jsx("video",{controls:!0,preload:"metadata",className:"max-w-full",src:t,onClick:e=>e.stopPropagation()}),VS=({embedUrl:t,provider:e})=>S.jsx("div",{className:"not-prose my-4 aspect-video w-full max-w-3xl",onClick:n=>n.stopPropagation(),children:S.jsx("iframe",{src:t,title:e==="youtube"?"YouTube video":"Vimeo video",className:"h-full w-full rounded-md border-0",loading:"lazy",allow:"fullscreen; picture-in-picture; encrypted-media",allowFullScreen:!0,referrerPolicy:"strict-origin-when-cross-origin",sandbox:"allow-scripts allow-same-origin allow-presentation allow-popups"})});function WS({content:t,onWikiLinkClick:e,previewFor:n,className:r,plainLinks:i=!1}){const[s,o]=B.useState(null),a=B.useRef(null),l=(h,f,p)=>{n&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{const m=n(h);m&&o({...m,x:f,y:p})},250))},u=()=>{a.current&&clearTimeout(a.current),o(null)};B.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);let c=0;const d=h=>({children:f,...p})=>S.jsx(h,{id:`doc-h-${c++}`,...p,children:f});return S.jsxs("div",{className:Yn("prose prose-sm dark:prose-invert max-w-none px-6 py-4","min-h-[60vh] max-h-[60vh] overflow-y-auto",r),children:[S.jsx(R7,{remarkPlugins:[I7,ES,$E,vS,qS,jS,HS],rehypePlugins:[yS],components:{h1:d("h1"),h2:d("h2"),h3:d("h3"),mention:({children:h})=>S.jsx("span",{className:"mention mention-user",children:h}),wikilink:({children:h,...f})=>{const p=f["data-wiki-target"]??"",m=f["data-wiki-display"]??p,g=!PS(p,n);return S.jsx("button",{type:"button",className:i?"bg-transparent border-0 p-0 m-0 cursor-pointer text-primary underline underline-offset-2 decoration-primary/40 hover:decoration-primary font-normal":`wiki-link ${g?"wiki-link-exists":"wiki-link-broken"} bg-transparent border-0 p-0 m-0 cursor-pointer`,title:n?g?void 0:`"${m}" not found in this nest`:`Open "${p}"`,onClick:y=>{y.preventDefault(),y.stopPropagation(),u(),e==null||e(p,m)},onMouseEnter:y=>l(p,y.clientX,y.clientY),onMouseLeave:u,children:i?m:h})},p:({node:h,children:f,...p})=>{const m=BS(h==null?void 0:h.children);return(m==null?void 0:m.kind)==="asset"?S.jsx(Fd,{src:m.src}):(m==null?void 0:m.kind)==="embed"?S.jsx(VS,{embedUrl:m.embedUrl,provider:m.provider}):S.jsx("p",{...p,children:f})},img:({src:h,...f})=>typeof h=="string"&&Af.test(h)?S.jsx(Fd,{src:h}):S.jsx("img",{src:h,...f}),a:({href:h,children:f,...p})=>typeof h=="string"&&Af.test(h)?S.jsx(Fd,{src:h}):S.jsx("a",{href:h,target:"_blank",rel:"noreferrer noopener",onClick:m=>m.stopPropagation(),...p,children:f})},children:t}),s&&S.jsxs("div",{className:"fixed z-50 max-w-xs rounded-md border bg-popover text-popover-foreground shadow-md p-3 pointer-events-none",style:{left:Math.min(s.x+12,window.innerWidth-320),top:s.y+16},children:[S.jsx("div",{className:"text-sm font-semibold mb-1",children:s.title}),S.jsx("div",{className:"text-xs text-muted-foreground leading-relaxed",children:s.snippet||"(empty document)"})]})]})}function PW({actions:t,align:e="end",variant:n="ghost",className:r,triggerTitle:i="More actions",testId:s}){return t.length===0?null:S.jsxs(Jh,{modal:!1,children:[S.jsx(Xh,{asChild:!0,children:S.jsx(Xn,{variant:n,size:"icon",className:r,title:i,"data-testid":s,onClick:o=>o.stopPropagation(),children:S.jsx(G7,{className:"h-4 w-4"})})}),S.jsx(Qh,{align:e,className:"min-w-44",children:t.map((o,a)=>{const l=o.icon;return S.jsxs(B.Fragment,{children:[o.separatorBefore&&a>0&&S.jsx(l7,{}),S.jsxs(Iu,{onSelect:o.onSelect,disabled:o.disabled,"data-testid":o.testId,className:o.destructive?"text-destructive focus:text-destructive":void 0,children:[l&&S.jsx(l,{className:`h-4 w-4 mr-2 ${o.iconClassName??""}`}),o.label]})]},o.testId??o.label??a)})})]})}function $W(t,e){return t==="public"?!0:t==="org"?e.sharedDeployment:!1}function HW(t,e){switch(t){case"private":return"Only people added to the nest";case"org":return e.sharedDeployment?"Every account on this server can read — other organizations included":"Everyone signed in here can read";case"public":return e.sharedDeployment?"Anyone with the URL can read — on the internet and on this server":"Anyone with the URL can read"}}function UW(t,e){if(t==="public")return{title:"Make this nest public?",body:e.sharedDeployment?"This makes the nest readable by anyone on the internet — including every account on this server, which belongs to other organizations too. Anyone with the URL will be able to read it.":"This makes the nest readable by anyone on the internet, outside your organization. Anyone with the URL will be able to read it.",confirm:"Make public"};if(!e.sharedDeployment)throw new Error("visibilityConfirmCopy('org') is only defined on a shared deployment");return{title:"Open this nest to everyone on this server?",body:"This server is shared: Organization makes the nest readable by every account on this server, including other organizations — not just yours. Only choose it for context that any of them may see.",confirm:"Open to everyone here"}}function GS(t){return t>=1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:t>=1024?`${Math.round(t/1024)} KB`:`${t} B`}function qW({nestId:t,nodeId:e,title:n,pdf:r,approvedOnly:i=!1,canReplace:s=!1,onReplaced:o}){const a=B.useRef(null),[l,u]=B.useState(!1),c=U1(t,e,{approvedOnly:i}),d=async h=>{u(!0);try{await d7(t,h,{nodeId:e}),$t.success("PDF replaced — saved as a new version."),o==null||o()}catch(f){$t.error((f==null?void 0:f.message)||"Couldn't replace the PDF.")}finally{u(!1)}};return S.jsxs("div",{className:"mb-6 space-y-3","data-testid":"pdf-document-panel",children:[S.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[S.jsxs("span",{className:"inline-flex items-center gap-1.5 font-medium text-foreground/80",children:[S.jsx(S7,{className:"h-3.5 w-3.5 text-rose-500"}),"PDF"]}),r&&S.jsxs("span",{children:[r.pages," ",r.pages===1?"page":"pages"," · ",GS(r.bytes)]}),S.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[S.jsx(Xn,{asChild:!0,variant:"outline",size:"sm",className:"h-7",children:S.jsxs("a",{href:U1(t,e,{approvedOnly:i,download:!0}),"data-testid":"pdf-download",children:[S.jsx(u7,{className:"h-3.5 w-3.5 mr-1.5"}),"Download"]})}),s&&S.jsxs(S.Fragment,{children:[S.jsx("input",{ref:a,type:"file",accept:"application/pdf,.pdf",className:"hidden",onChange:h=>{var p;const f=(p=h.target.files)==null?void 0:p[0];h.target.value="",f&&d(f)}}),S.jsxs(Xn,{variant:"outline",size:"sm",className:"h-7",disabled:l,onClick:()=>{var h;return(h=a.current)==null?void 0:h.click()},title:"Upload a new PDF — the text is re-extracted and saved as a new version","data-testid":"pdf-replace",children:[l?S.jsx(m3,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}):S.jsx(sf,{className:"h-3.5 w-3.5 mr-1.5"}),"Replace PDF"]})]})]})]}),r&&!r.text_layer&&S.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-300 bg-amber-50/70 px-3 py-2 text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/20 dark:text-amber-200","data-testid":"pdf-no-text-layer",children:[S.jsx(c7,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),S.jsx("span",{children:"This PDF has no text layer — it looks like a scan, so no text could be extracted and agents can't read its contents. Upload a version with selectable text to make it searchable."})]}),S.jsx("iframe",{src:c,title:`${n||"PDF"} (PDF)`,className:"h-[75vh] w-full rounded-lg border bg-muted","data-testid":"pdf-viewer"},(r==null?void 0:r.sha256)??"pdf"),S.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Extracted text (read-only — what agents read)"})]})}function KS(t){return t.replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(e,n,r)=>r??n).replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/[*_`~]/g,"").trim()}function YS(t){return t.trim()?!/^\s*([#>|]|[-*+]\s|\d+[.)]\s|```|~~~)/.test(t):!1}function jW(t){const e=[];let n=!1,r=0;const i=(a,l)=>e.push({level:a,text:KS(l),id:`doc-h-${r++}`}),s=(t??"").split(`
434
+ `);let o="";for(const a of s){if(/^\s*(```|~~~)/.test(a)){n=!n,o=a;continue}if(n){o=a;continue}const l=a.match(/^\s{0,3}(=+|-+)\s*$/);if(l&&YS(o)){i(l[1][0]==="="?1:2,o),o="";continue}const u=a.replace(/^(\s*>+\s?)+/,"").match(/^(#{1,3})\s+(.+?)\s*#*\s*$/);u&&i(u[1].length,u[2]),o=a}return e}function VW({isOpen:t,onClose:e,nestId:n,excludeNodeId:r,onSelect:i,title:s="Link to a document",description:o="Pick a document in this nest. The link will use this title and point at the document — clicking it inside the editor opens the target."}){const[a,l]=B.useState([]),[u,c]=B.useState(null),[d,h]=B.useState(""),[f,p]=B.useState(!1),[m,g]=B.useState(null),y=g3();B.useEffect(()=>{if(!t){h(""),c(null),g(null);return}let k=!1;return(async()=>{p(!0);try{const{nodes:C}=await y.fetchQuery(xo.nodes(n));k||l(C)}catch(C){k||g(C.message)}finally{k||p(!1)}})(),()=>{k=!0}},[t,n,y]),B.useEffect(()=>{if(!t)return;if(!d.trim()){c(null);return}let k=!1;const C=setTimeout(async()=>{p(!0);try{const{nodes:_}=await h7(n,d.trim());k||c(_)}catch(_){k||g(_.message)}finally{k||p(!1)}},200);return()=>{k=!0,clearTimeout(C)}},[t,n,d]);const x=B.useMemo(()=>{const k=d.trim().toLowerCase();return(k&&u!==null?u:a).filter(_=>_.id===r?!1:k?_.title.toLowerCase().includes(k):!0)},[a,u,d,r]);return S.jsx(Lp,{open:t,onOpenChange:e,children:S.jsxs(zp,{className:"sm:max-w-[520px] max-h-[80vh] flex flex-col",children:[S.jsxs(Bp,{children:[S.jsx(Fp,{children:s}),S.jsx(Pp,{children:o})]}),S.jsxs("div",{className:"relative",children:[S.jsx(b3,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),S.jsx(Na,{value:d,onChange:k=>h(k.target.value),placeholder:"Search by title...",className:"pl-8",autoFocus:!0,"data-testid":"document-picker-search"})]}),S.jsxs("div",{className:"flex-1 overflow-y-auto -mx-1 px-1",children:[m&&S.jsx("div",{className:"text-sm text-destructive p-2",children:m}),f&&a.length===0?S.jsxs("div",{className:"flex items-center justify-center py-10 text-muted-foreground",children:[S.jsx(m3,{className:"h-5 w-5 animate-spin mr-2"}),"Loading documents..."]}):x.length===0?S.jsx("div",{className:"text-center text-sm text-muted-foreground py-10",children:d.trim()?"No matches":"No other documents in this nest yet"}):S.jsx("div",{className:"space-y-1",children:x.map(k=>S.jsxs("button",{type:"button",onClick:()=>{i({id:k.id,title:k.title}),e()},className:"w-full flex items-center gap-2 p-2 rounded hover:bg-muted text-left","data-testid":`document-picker-row-${k.id}`,children:[S.jsx($p,{className:"h-4 w-4 text-muted-foreground shrink-0"}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("div",{className:"font-medium truncate",children:k.title}),k.tags&&k.tags.length>0&&S.jsx("div",{className:"text-xs text-muted-foreground truncate",children:k.tags.slice(0,4).join(" · ")})]})]},k.id))})]})]})})}function Gt(t){this.content=t}Gt.prototype={constructor:Gt,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new Gt(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Gt(n)},addToStart:function(t,e){return new Gt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Gt(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new Gt(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Gt.from(t),t.size?new Gt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Gt.from(t),t.size?new Gt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Gt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Gt.from=function(t){if(t instanceof Gt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Gt(e)};function Wy(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=Wy(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function Gy(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let u=0,c=Math.min(o.text.length,a.text.length);for(;u<c&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let u=Gy(o.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class P{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,a=0;a<n;o++){let l=this.content[o],u=a+l.nodeSize;if(u>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new P(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new P(r,i)}cutByIndex(e,n){return e==n?P.empty:e==0&&n==this.content.length?this:new P(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new P(i,s)}addToStart(e){return new P([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new P(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return Wy(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Gy(this,e,n,r)}findIndex(e){if(e==0)return iu(0,e);if(e==this.size)return iu(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?iu(n+1,s):iu(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return P.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new P(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return P.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new P(n||e,r)}static from(e){if(!e)return P.empty;if(e instanceof P)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new P([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}P.empty=new P([],0);const Pd={index:0,offset:0};function iu(t,e){return Pd.index=t,Pd.offset=e,Pd}function ic(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ic(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ic(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Ve=class Mf{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ic(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Mf.none;if(e instanceof Mf)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Ve.none=[];class sc extends Error{}class Z{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Yy(this.content,e+this.openStart,n);return r&&new Z(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Z(Ky(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Z.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Z(P.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new Z(e,r,i)}}Z.empty=new Z(P.empty,0,0);function Ky(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(Ky(s.content,e-i-1,n-i-1)))}function Yy(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=Yy(o.content,e-s-1,n,o);return a&&t.replaceChild(i,o.copy(a))}function ZS(t,e,n){if(n.openStart>t.depth)throw new sc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new sc("Inconsistent open depths");return Zy(t,e,n,0)}function Zy(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=Zy(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return Bs(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=JS(n,t);return Bs(s,Xy(t,o,a,e,r))}else return Bs(s,oc(t,e,r))}function Jy(t,e){if(!e.type.compatibleContent(t.type))throw new sc("Cannot join "+e.type.name+" onto "+t.type.name)}function Nf(t,e,n){let r=t.node(n);return Jy(r,e.node(n)),r}function zs(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Oa(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(zs(t.nodeAfter,r),s++));for(let a=s;a<o;a++)zs(i.child(a),r);e&&e.depth==n&&e.textOffset&&zs(e.nodeBefore,r)}function Bs(t,e){return t.type.checkContent(e),t.copy(e)}function Xy(t,e,n,r,i){let s=t.depth>i&&Nf(t,e,i+1),o=r.depth>i&&Nf(n,r,i+1),a=[];return Oa(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(Jy(s,o),zs(Bs(s,Xy(t,e,n,r,i+1)),a)):(s&&zs(Bs(s,oc(t,e,i+1)),a),Oa(e,n,i,a),o&&zs(Bs(o,oc(n,r,i+1)),a)),Oa(r,null,i,a),new P(a)}function oc(t,e,n){let r=[];if(Oa(null,t,n,r),t.depth>n){let i=Nf(t,e,n+1);zs(Bs(i,oc(t,e,n+1)),r)}return Oa(e,null,n,r),new P(r)}function JS(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(P.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Ga{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ve.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ka(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),u=s-l;if(r.push(o,a,i+l),!u||(o=o.child(a),o.isText))break;s=u-1,i+=l+1}return new Ga(n,r,s)}static resolveCached(e,n){let r=Zg.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else Zg.set(e,r=new XS);let i=r.elts[r.i]=Ga.resolve(e,n);return r.i=(r.i+1)%QS,i}}class XS{constructor(){this.elts=[],this.i=0}}const QS=12,Zg=new WeakMap;class Ka{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const eC=Object.create(null);let Gi=class Df{constructor(e,n,r,i=Ve.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||P.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ic(this.attrs,n||e.defaultAttrs||eC)&&Ve.sameSet(this.marks,r||Ve.none)}copy(e=null){return e==this.content?this:new Df(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Df(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return Z.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),u=i.node(o).content.cut(i.pos-a,s.pos-a);return new Z(u,i.depth-o,s.depth-o)}replace(e,n,r){return ZS(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Ga.resolveCached(this,e)}resolveNoCache(e){return Ga.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Qy(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=P.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ve.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Ve.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=P.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Gi.prototype.text=void 0;class ac extends Gi{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Qy(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ac(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ac(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Qy(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class js{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new tC(e,n);if(r.next==null)return js.empty;let i=e6(r);r.next&&r.err("Unexpected trailing text");let s=lC(aC(i));return uC(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return P.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:c,next:d}=o.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let h=s(d,a.concat(c));if(h)return h}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
435
+ `)}}js.empty=new js(!0);class tC{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function e6(t){let e=[];do e.push(nC(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function nC(t){let e=[];do e.push(rC(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function rC(t){let e=oC(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=iC(t,e);else break;return e}function Jg(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function iC(t,e){let n=Jg(t),r=n;return t.eat(",")&&(t.next!="}"?r=Jg(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function sC(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function oC(t){if(t.eat("(")){let e=e6(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=sC(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function aC(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let u={term:l,to:a};return e[o].push(u),u}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(s(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=s(o.exprs[l],a);if(l==o.exprs.length-1)return u;i(u,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u<o.min;u++){let c=n();i(s(o.expr,l),c),l=c}if(o.max==-1)i(s(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let c=n();r(l,c),i(s(o.expr,l),c),l=c}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function t6(t,e){return e-t}function Xg(t,e){let n=[];return r(e),n.sort(t6);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&n.indexOf(l)==-1&&r(l)}}}function lC(t){let e=Object.create(null);return n(Xg(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c<i.length;c++)i[c][0]==a&&(u=i[c][1]);Xg(t,l).forEach(c=>{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=e[r.join(",")]=new js(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(t6);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function uC(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:u}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(u)==-1&&r.push(u)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function n6(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function r6(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function i6(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function s6(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new dC(t,r,e[r]);return n}let Qg=class o6{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=s6(e,r.attrs),this.defaultAttrs=n6(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==js.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:r6(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Gi(this,this.computeAttrs(e),P.from(n),Ve.setFrom(r))}createChecked(e=null,n,r){return n=P.from(n),this.checkContent(n),new Gi(this,this.computeAttrs(e),n,Ve.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=P.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(P.empty,!0);return s?new Gi(this,e,n.append(s),Ve.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){i6(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Ve.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new o6(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function cC(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class dC{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?cC(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class R0{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=s6(e,i.attrs),this.excluded=null;let s=n6(this.attrs);this.instance=s?new Ve(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Ve(this,r6(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new R0(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){i6(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let om=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Gt.from(e.nodes),n.marks=Gt.from(e.marks||{}),this.nodes=Qg.compile(this.spec.nodes,this),this.marks=R0.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=js.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?eb(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:eb(this,o.split(" "))}this.nodeFromJSON=i=>Gi.fromJSON(this,i),this.markFromJSON=i=>Ve.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Qg){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new ac(r,r.defaultAttrs,e,Ve.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function eb(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function hC(t){return t.tag!=null}function fC(t){return t.style!=null}let To=class Of{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(hC(i))this.tags.push(i);else if(fC(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new nb(this,n,!1);return r.addAll(e,Ve.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new nb(this,n,!0);return r.addAll(e,Ve.none,n.from,n.to),Z.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(gC(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=rb(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=rb(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Of(e,Of.schemaRules(e)))}};const a6={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},pC={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},l6={ol:!0,ul:!0},Ya=1,Rf=2,Ra=4;function tb(t,e,n){return e!=null?(e?Ya:0)|(e==="full"?Rf:0):t&&t.whitespace=="pre"?Ya|Rf:n&~Ra}class su{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=Ve.none,this.match=s||(o&Ra?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(P.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ya)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=P.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(P.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!a6.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class nb{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=tb(null,n.preserveWhitespace,0)|(r?Ra:0);i?s=new su(i.type,i.attrs,Ve.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new su(null,null,Ve.none,!0,null,o):s=new su(e.schema.topNodeType,null,Ve.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&Rf?"full":this.localPreserveWS||(i.options&Ya)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
436
+ `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(o.text(a[l]),n,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;l6.hasOwnProperty(o)&&this.parser.normalizeLists&&mC(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:pC.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,c=this.needsBlock;if(a6.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),u=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),u&&this.sync(s),this.needsBlock=c}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
437
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+a)&&(i=u,s=l,!u.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=Ve.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):ib(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=tb(e,s,o.options);o.options&Ra&&o.content.length==0&&(a|=Ra);let l=Ve.none;return r=r.filter(u=>(o.type?o.type.allowsMarkType(u.type):ib(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new su(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Ya)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function mC(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&l6.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function gC(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function rb(t){let e={};for(let n in t)e[n]=t[n];return e}function ib(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:c}=a.edge(l);if(u==e||s.indexOf(c)<0&&o(c))return!0}};if(o(i.contentMatch))return!0}}class ro{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=$d(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(s[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],c=this.serializeMark(u,o.isInline,n);c&&(s.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Fu($d(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Fu($d(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Fu(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ro(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=sb(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return sb(e.marks)}}function sb(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function $d(t){return t.document||window.document}const ob=new WeakMap;function bC(t){let e=ob.get(t);return e===void 0&&ob.set(t,e=yC(t)),e}function yC(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function Fu(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=bC(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let h=d.indexOf(" ");h>0?l.setAttributeNS(d.slice(0,h),d.slice(h+1),u[d]):d=="style"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:p}=Fu(t,h,n,r);if(l.appendChild(f),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const u6=65535,c6=Math.pow(2,16);function vC(t,e){return t+e*c6}function ab(t){return t&u6}function xC(t){return(t-(t&u6))/c6}const d6=1,h6=2,Pu=4,f6=8;class If{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&f6)>0}get deletedBefore(){return(this.delInfo&(d6|Pu))>0}get deletedAfter(){return(this.delInfo&(h6|Pu))>0}get deletedAcross(){return(this.delInfo&Pu)>0}}class Dn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Dn.empty)return Dn.empty}recover(e){let n=0,r=ab(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+xC(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+s],c=this.ranges[a+o],d=l+u;if(e<=d){let h=u?e==l?-1:e==d?1:n:n,f=l+i+(h<0?0:c);if(r)return f;let p=e==(n<0?l:d)?null:vC(a/3,e-l),m=e==l?h6:e==d?d6:Pu;return(n<0?e!=l:e!=d)&&(m|=f6),new If(f,m,p)}i+=c-u}return r?e+i:new If(e+i,0,null)}touches(e,n){let r=0,i=ab(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+s],c=l+u;if(e<=c&&a==i*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+n],c=this.ranges[i+r];e(a,a+u,l,l+c),s+=c-u}}invert(){return new Dn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Dn.empty:new Dn(e<0?[0,-e,0]:[0,0,e])}}Dn.empty=new Dn([]);class Za{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Za(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Za;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new If(e,i,null)}}const Hd=Object.create(null);class rn{getMap(){return Dn.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Hd[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Hd)throw new RangeError("Duplicate use of step JSON ID "+e);return Hd[e]=n,n.prototype.jsonID=e,n}}class Nt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Nt(e,null)}static fail(e){return new Nt(null,e)}static fromReplace(e,n,r,i){try{return Nt.ok(e.replace(n,r,i))}catch(s){if(s instanceof sc)return Nt.fail(s.message);throw s}}}function am(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(am(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return P.fromArray(r)}class Hi extends rn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new Z(am(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return Nt.fromReplace(e,this.from,this.to,s)}invert(){return new cr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Hi(n.pos,r.pos,this.mark)}merge(e){return e instanceof Hi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Hi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Hi(n.from,n.to,e.markFromJSON(n.mark))}}rn.jsonID("addMark",Hi);class cr extends rn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Z(am(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Nt.fromReplace(e,this.from,this.to,r)}invert(){return new Hi(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new cr(n.pos,r.pos,this.mark)}merge(e){return e instanceof cr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new cr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new cr(n.from,n.to,e.markFromJSON(n.mark))}}rn.jsonID("removeMark",cr);class Ui extends rn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Nt.fromReplace(e,this.pos,this.pos+1,new Z(P.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Ui(this.pos,n.marks[i]);return new Ui(this.pos,this.mark)}}return new Vs(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ui(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ui(n.pos,e.markFromJSON(n.mark))}}rn.jsonID("addNodeMark",Ui);class Vs extends rn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Nt.fromReplace(e,this.pos,this.pos+1,new Z(P.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ui(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Vs(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Vs(n.pos,e.markFromJSON(n.mark))}}rn.jsonID("removeNodeMark",Vs);class At extends rn{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Lf(e,this.from,this.to)?Nt.fail("Structure replace would overwrite content"):Nt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Dn([this.from,this.to-this.from,this.slice.size])}invert(e){return new At(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&At.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new At(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof At)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?Z.empty:new Z(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new At(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?Z.empty:new Z(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new At(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new At(n.from,n.to,Z.fromJSON(e,n.slice),!!n.structure)}}At.MAP_BIAS=1;rn.jsonID("replace",At);class Ut extends rn{constructor(e,n,r,i,s,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(Lf(e,this.from,this.gapFrom)||Lf(e,this.gapTo,this.to)))return Nt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Nt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Nt.fromReplace(e,this.from,this.to,r):Nt.fail("Content does not fit in gap")}getMap(){return new Dn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ut(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new Ut(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ut(n.from,n.to,n.gapFrom,n.gapTo,Z.fromJSON(e,n.slice),n.insert,!!n.structure)}}rn.jsonID("replaceAround",Ut);function Lf(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function wC(t,e,n,r){let i=[],s=[],o,a;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let h=Math.max(u,e),f=Math.min(u+l.nodeSize,n),p=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(p)||(o&&o.to==h&&o.mark.eq(d[m])?o.to=f:i.push(o=new cr(h,f,d[m])));a&&a.to==h?a.to=f:s.push(a=new Hi(h,f,r))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function kC(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof R0){let u=o.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let u=Math.min(a+o.nodeSize,n);for(let c=0;c<l.length;c++){let d=l[c],h;for(let f=0;f<i.length;f++){let p=i[f];p.step==s-1&&d.eq(i[f].style)&&(h=p)}h?(h.to=u,h.step=s):i.push({style:d,from:Math.max(a,e),to:u,step:s})}}}),i.forEach(o=>t.step(new cr(o.from,o.to,o.style)))}function lm(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let u=s.child(l),c=a+u.nodeSize,d=r.matchType(u.type);if(!d)o.push(new At(a,c,Z.empty));else{r=d;for(let h=0;h<u.marks.length;h++)n.allowsMarkType(u.marks[h].type)||t.step(new cr(a,c,u.marks[h]));if(i&&u.isText&&n.whitespace!="pre"){let h,f=/\r?\n|\r/g,p;for(;h=f.exec(u.text);)p||(p=new Z(P.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new At(a+h.index,a+h.index+h[0].length,p))}}a=c}if(!r.validEnd){let l=r.fillBefore(P.empty,!0);t.replace(a,a,new Z(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function EC(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ia(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),a=t.$from.index(r)+i,l=t.$to.indexAfter(r)-s;if(r<t.depth&&o.canReplace(a,l,n))return r;if(r==0||o.type.spec.isolating||!EC(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function SC(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,u=a,c=P.empty,d=0;for(let p=s,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,c=P.from(r.node(p).copy(c)),d++):l--;let h=P.empty,f=0;for(let p=s,m=!1;p>n;p--)m||i.after(p+1)<i.end(p)?(m=!0,h=P.from(i.node(p).copy(h)),f++):u++;t.step(new Ut(l,u,o,a,new Z(c.append(h),d,f),c.size-d,!0))}function um(t,e,n=null,r=t){let i=CC(t,e),s=i&&_C(r,e);return s?i.map(lb).concat({type:e,attrs:n}).concat(s.map(lb)):null}function lb(t){return{type:t,attrs:null}}function CC(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function _C(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:o}function AC(t,e,n){let r=P.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=P.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new Ut(i,s,i,s,new Z(r,0,0),n.length,!0))}function TC(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&MC(t.doc,t.mapping.slice(s).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!p?u=!1:!f&&p&&(u=!0)}u===!1&&m6(t,o,a,s),lm(t,t.mapping.slice(s).map(a,1),r,void 0,u===null);let c=t.mapping.slice(s),d=c.map(a,1),h=c.map(a+o.nodeSize,1);return t.step(new Ut(d,h,d+1,h-1,new Z(P.from(r.create(l,null,o.marks)),0,0),1,!0)),u===!0&&p6(t,o,a,s),!1}})}function p6(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function m6(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
438
+ `))}})}function MC(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function NC(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ut(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new Z(P.from(o),0,0),1,!0))}function ui(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=n-2;u>s;u--,c--){let d=i.node(u),h=i.index(u);if(d.type.spec.isolating)return!1;let f=d.content.cutByIndex(h,d.childCount),p=r&&r[c+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[c]||d;if(!d.canReplace(h+1,d.childCount)||!m.type.validContent(f))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function DC(t,e,n=1,r){let i=t.doc.resolve(e),s=P.empty,o=P.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){s=P.from(i.node(a).copy(s));let c=r&&r[u];o=P.from(c?c.type.create(c.attrs,o):i.node(a).copy(o))}t.step(new At(e,e,new Z(s.append(o),n,n),!0))}function hs(t,e){let n=t.resolve(e),r=n.index();return g6(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function OC(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function g6(t,e){return!!(t&&e&&!t.isLeaf&&OC(t,e))}function I0(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&g6(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function RC(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),o=s.node().type;if(i&&o.inlineContent){let c=o.whitespace=="pre",d=!!o.contentMatch.matchType(i);c&&!d?r=!1:!c&&d&&(r=!0)}let a=t.steps.length;if(r===!1){let c=t.doc.resolve(e+n);m6(t,c.node(),c.before(),a)}o.inlineContent&&lm(t,e+n-1,o,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(a),u=l.map(e-n);if(t.step(new At(u,l.map(e+n,-1),Z.empty,!0)),r===!0){let c=t.doc.resolve(u);p6(t,c.node(),c.before(),t.steps.length)}return t}function IC(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function b6(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),u=r.node(o),c=!1;if(s==1)c=u.canReplace(l,l,i);else{let d=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=d&&u.canReplaceWith(l,l,d[0])}if(c)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function L0(t,e,n=e,r=Z.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return y6(i,s,r)?new At(e,n,r):new LC(i,s,r).fit()}function y6(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class LC{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=P.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=P.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new Z(s,o,a);return e>-1?new Ut(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new At(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=Ud(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,d=null;if(n==1&&(o?u.matchType(o.type)||(d=u.fillBefore(P.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:d};if(n==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Ud(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Z(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Ud(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new Z(Ca(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new Z(Ca(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let m=0;m<s.length;m++)this.openFrontierNode(s[m]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,u=0,c=[],{match:d,type:h}=this.frontier[n];if(i){for(let m=0;m<i.childCount;m++)c.push(i.child(m));d=d.matchFragment(i)}let f=a.size+e-(o.content.size-o.openEnd);for(;u<a.childCount;){let m=a.child(u),g=d.matchType(m.type);if(!g)break;u++,(u>1||l==0||m.content.size)&&(d=g,c.push(v6(m.mark(h.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?f:-1)))}let p=u==a.childCount;p||(f=-1),this.placed=_a(this.placed,n,P.from(c)),this.frontier[n].match=d,p&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m<f;m++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=p?e==0?Z.empty:new Z(Ca(o.content,e-1,1),e-1,f<0?o.openEnd:e-1):new Z(Ca(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!qd(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=qd(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],c=qd(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:o,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=_a(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=_a(this.placed,this.depth,P.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(P.empty,!0);n.childCount&&(this.placed=_a(this.placed,this.frontier.length,n))}}function Ca(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ca(t.firstChild.content,e-1,n)))}function _a(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(_a(t.lastChild.content,e-1,n)))}function Ud(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function v6(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,v6(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(P.empty,!0)))),t.copy(r)}function qd(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!zC(n,s.content,o)?a:null}function zC(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function BC(t){return t.spec.defining||t.spec.definingForContent}function FC(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(y6(i,s,r))return t.step(new At(e,n,r));let o=w6(i,s);o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let h=i.depth,f=i.pos-1;h>0;h--,f--){let p=i.node(h).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(h)>-1?a=h:i.before(h)==f&&o.splice(1,0,-h)}let l=o.indexOf(a),u=[],c=r.openStart;for(let h=r.content,f=0;;f++){let p=h.firstChild;if(u.push(p),f==r.openStart)break;h=p.content}for(let h=c-1;h>=0;h--){let f=u[h],p=BC(f.type);if(p&&!f.sameMarkup(i.node(Math.abs(a)-1)))c=h;else if(p||!f.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let f=(h+c+1)%(r.openStart+1),p=u[f];if(p)for(let m=0;m<o.length;m++){let g=o[(m+l)%o.length],y=!0;g<0&&(y=!1,g=-g);let x=i.node(g-1),k=i.index(g-1);if(x.canReplaceWith(k,k,p.type,p.marks))return t.replace(i.before(g),y?s.after(g):n,new Z(x6(r.content,0,r.openStart,f),f,r.openEnd))}}let d=t.steps.length;for(let h=o.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>d));h--){let f=o[h];f<0||(e=i.before(f),n=s.after(f))}}function x6(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(x6(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(P.empty,!0))}return t}function PC(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=IC(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Z(P.from(r),0,0))}function $C(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let o=r.sharedDepth(n),a=!1;for(let l=r.depth;l>o;l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=i.depth;l>o;l--)i.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&e==r.start(l);l--)e=r.before(l);for(let l=i.depth;l>0&&n==i.start(l);l--)n=i.before(l);r=t.doc.resolve(e),i=t.doc.resolve(n)}}let s=w6(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function w6(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class Mo extends rn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nt.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Nt.fromReplace(e,this.pos,this.pos+1,new Z(P.from(i),0,n.isLeaf?0:1))}getMap(){return Dn.empty}invert(e){return new Mo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Mo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Mo(n.pos,n.attr,n.value)}}rn.jsonID("attr",Mo);class Ja extends rn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Nt.ok(r)}getMap(){return Dn.empty}invert(e){return new Ja(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ja(n.attr,n.value)}}rn.jsonID("docAttr",Ja);let $o=class extends Error{};$o=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};$o.prototype=Object.create(Error.prototype);$o.prototype.constructor=$o;$o.prototype.name="TransformError";class cm{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Za}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new $o(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((s,o,a,l)=>{e=Math.min(e,a),n=Math.max(n,l)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=Z.empty){let i=L0(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new Z(P.from(r),0,0))}delete(e,n){return this.replace(e,n,Z.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return FC(this,e,n,r),this}replaceRangeWith(e,n,r){return PC(this,e,n,r),this}deleteRange(e,n){return $C(this,e,n),this}lift(e,n){return SC(this,e,n),this}join(e,n=1){return RC(this,e,n),this}wrap(e,n){return AC(this,e,n),this}setBlockType(e,n=e,r,i=null){return TC(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return NC(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Mo(e,n,r)),this}setDocAttribute(e,n){return this.step(new Ja(e,n)),this}addNodeMark(e,n){return this.step(new Ui(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof Ve)n.isInSet(r.marks)&&this.step(new Vs(e,n));else{let i=r.marks,s,o=[];for(;s=n.isInSet(i);)o.push(new Vs(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,n=1,r){return DC(this,e,n,r),this}addMark(e,n,r){return wC(this,e,n,r),this}removeMark(e,n,r){return kC(this,e,n,r),this}clearIncompatible(e,n,r){return lm(this,e,n,r),this}}const jd=Object.create(null);class fe{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new dm(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=Z.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:u}=o[a],c=e.mapping.slice(s);e.replaceRange(c.map(l.pos),c.map(u.pos),a?Z.empty:n),a==0&&db(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(r),u=l.map(o.pos),c=l.map(a.pos);s?e.deleteRange(u,c):(e.replaceRangeWith(u,c,n),db(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new le(e):wo(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=n<0?wo(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):wo(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new En(e.node(0))}static atStart(e){return wo(e,e,0,0,1)||new En(e)}static atEnd(e){return wo(e,e,e.content.size,e.childCount,-1)||new En(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=jd[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in jd)throw new RangeError("Duplicate use of selection JSON ID "+e);return jd[e]=n,n.prototype.jsonID=e,n}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}}fe.prototype.visible=!0;class dm{constructor(e,n){this.$from=e,this.$to=n}}let ub=!1;function cb(t){!ub&&!t.parent.inlineContent&&(ub=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class le extends fe{constructor(e,n=e){cb(e),cb(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return fe.near(r);let i=e.resolve(n.map(this.anchor));return new le(i.parent.inlineContent?i:r,r)}replace(e,n=Z.empty){if(super.replace(e,n),n==Z.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof le&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new z0(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new le(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=fe.findFrom(n,r,!0)||fe.findFrom(n,-r,!0);if(s)n=s.$head;else return fe.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(fe.findFrom(e,-r,!0)||fe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new le(e,n)}}fe.jsonID("text",le);class z0{constructor(e,n){this.anchor=e,this.head=n}map(e){return new z0(e.map(this.anchor),e.map(this.head))}resolve(e){return le.between(e.resolve(this.anchor),e.resolve(this.head))}}class ue extends fe{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?fe.near(s):new ue(s)}content(){return new Z(P.from(this.node),0,0)}eq(e){return e instanceof ue&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new hm(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ue(e.resolve(n.anchor))}static create(e,n){return new ue(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ue.prototype.visible=!1;fe.jsonID("node",ue);class hm{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new z0(r,r):new hm(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&ue.isSelectable(r)?new ue(n):fe.near(n)}}class En extends fe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=Z.empty){if(n==Z.empty){e.delete(0,e.doc.content.size);let r=fe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new En(e)}map(e){return new En(e)}eq(e){return e instanceof En}getBookmark(){return HC}}fe.jsonID("all",En);const HC={map(){return this},resolve(t){return new En(t)}};function wo(t,e,n,r,i,s=!1){if(e.inlineContent)return le.create(t,n);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&ue.isSelectable(a))return ue.create(t,n-(i<0?a.nodeSize:0))}else{let l=wo(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function db(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof At||i instanceof Ut))return;let s=t.mapping.maps[r],o;s.forEach((a,l,u,c)=>{o==null&&(o=c)}),t.setSelection(fe.near(t.doc.resolve(o),n))}const hb=1,ou=2,fb=4;let UC=class extends cm{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|hb)&~ou,this.storedMarks=null,this}get selectionSet(){return(this.updated&hb)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ou,this}ensureMarks(e){return Ve.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ou)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~ou,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ve.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(fe.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=fb,this}get scrolledIntoView(){return(this.updated&fb)>0}};function pb(t,e){return!e||!t?t:t.bind(e)}class Aa{constructor(e,n,r){this.name=e,this.init=pb(n.init,r),this.apply=pb(n.apply,r)}}const qC=[new Aa("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Aa("selection",{init(t,e){return t.selection||fe.atStart(e.doc)},apply(t){return t.selection}}),new Aa("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Aa("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Vd{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=qC.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Aa(r.key,r.spec.state,r))})}}class _o{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,u=i?i[o].state:this,c=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,u,r);if(c&&r.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<o?{state:r,n:n.length}:{state:this,n:0})}n.push(c),r=r.applyInner(c),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new _o(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new UC(this)}static create(e){let n=new Vd(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new _o(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Vd(this.schema,e.plugins),r=n.fields,i=new _o(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Vd(e.schema,e.plugins),s=new _o(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Gi.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=fe.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=u.fromJSON.call(l,e,n[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function k6(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=k6(i,e,{})),n[r]=i}return n}class _e{constructor(e){this.spec=e,this.props={},e.props&&k6(e.props,this,this.props),this.key=e.key?e.key.key:E6("plugin")}getState(e){return e[this.key]}}const Wd=Object.create(null);function E6(t){return t in Wd?t+"$"+ ++Wd[t]:(Wd[t]=0,t+"$")}class Ae{constructor(e="key"){this.key=E6(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const fm=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function S6(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const C6=(t,e,n)=>{let r=S6(t,n);if(!r)return!1;let i=pm(r);if(!i){let o=r.blockRange(),a=o&&ia(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(I6(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Ho(s,"end")||ue.isSelectable(s)))for(let o=r.depth;;o--){let a=L0(t.doc,r.before(o),r.after(o),Z.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Ho(s,"end")?fe.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):ue.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},jC=(t,e,n)=>{let r=S6(t,n);if(!r)return!1;let i=pm(r);return i?_6(t,i,e):!1},VC=(t,e,n)=>{let r=T6(t,n);if(!r)return!1;let i=mm(r);return i?_6(t,i,e):!1};function _6(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=L0(t.doc,s,l,Z.empty);if(!u||u.from!=s||u instanceof At&&u.slice.size>=l-s)return!1;if(n){let c=t.tr.step(u);c.setSelection(le.create(c.doc,s)),n(c.scrollIntoView())}return!0}function Ho(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const A6=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=pm(r)}let o=s&&s.nodeBefore;return!o||!ue.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ue.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function pm(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function T6(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const M6=(t,e,n)=>{let r=T6(t,n);if(!r)return!1;let i=mm(r);if(!i)return!1;let s=i.nodeAfter;if(I6(t,i,e,1))return!0;if(r.parent.content.size==0&&(Ho(s,"start")||ue.isSelectable(s))){let o=L0(t.doc,r.before(),r.after(),Z.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(Ho(s,"start")?fe.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ue.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},N6=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=mm(r)}let o=s&&s.nodeAfter;return!o||!ue.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ue.create(t.doc,s.pos)).scrollIntoView()),!0)};function mm(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const WC=(t,e)=>{let n=t.selection,r=n instanceof ue,i;if(r){if(n.node.isTextblock||!hs(t.doc,n.from))return!1;i=n.from}else if(i=I0(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(ue.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},GC=(t,e)=>{let n=t.selection,r;if(n instanceof ue){if(n.node.isTextblock||!hs(t.doc,n.to))return!1;r=n.to}else if(r=I0(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},KC=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&ia(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},D6=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
439
+ `).scrollIntoView()),!0)};function gm(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const YC=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=gm(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(fe.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},O6=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof En||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=gm(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(o,s.createAndFill());a.setSelection(le.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},R6=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(ui(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ia(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function ZC(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof ue&&e.selection.node.isBlock)return!r.parentOffset||!ui(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,a,l=!1,u=!1;for(let f=r.depth;;f--)if(r.node(f).isBlock){l=r.end(f)==r.pos+(r.depth-f),u=r.start(f)==r.pos-(r.depth-f),a=gm(r.node(f-1).contentMatchAt(r.indexAfter(f-1))),s.unshift(l&&a?{type:a}:null),o=f;break}else{if(f==1)return!1;s.unshift(null)}let c=e.tr;(e.selection instanceof le||e.selection instanceof En)&&c.deleteSelection();let d=c.mapping.map(r.pos),h=ui(c.doc,d,s.length,s);if(h||(s[0]=a?{type:a}:null,h=ui(c.doc,d,s.length,s)),!h)return!1;if(c.split(d,s.length,s),!l&&u&&r.node(o).type!=a){let f=c.mapping.map(r.before(o)),p=c.doc.resolve(f);a&&r.node(o-1).canReplaceWith(p.index(),p.index()+1,a)&&c.setNodeMarkup(c.mapping.map(r.before(o)),a)}return n&&n(c.scrollIntoView()),!0}}const JC=ZC(),XC=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(ue.create(t.doc,i))),!0)};function QC(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||hs(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function I6(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&QC(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(n){let f=e.pos+s.nodeSize,p=P.empty;for(let y=o.length-1;y>=0;y--)p=P.from(o[y].create(null,p));p=P.from(i.copy(p));let m=t.tr.step(new Ut(e.pos-1,f,e.pos,f,new Z(p,1,0),o.length,!0)),g=m.doc.resolve(f+2*o.length);g.nodeAfter&&g.nodeAfter.type==i.type&&hs(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let c=s.type.spec.isolating||r>0&&l?null:fe.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),h=d&&ia(d);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(d,h).scrollIntoView()),!0;if(u&&Ho(s,"start",!0)&&Ho(i,"end")){let f=i,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let m=s,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(f.canReplace(f.childCount,f.childCount,m.content)){if(n){let y=P.empty;for(let k=p.length-1;k>=0;k--)y=P.from(p[k].copy(y));let x=t.tr.step(new Ut(e.pos-p.length,e.pos+s.nodeSize,e.pos+g,e.pos+s.nodeSize-g,new Z(y,p.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function L6(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(le.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const e_=L6(-1),t_=L6(1);function n_(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&um(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function mb(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(o,a,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let c=n.doc.resolve(u),d=c.index();i=c.parent.canReplaceWith(d,d+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[o];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}function bm(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}bm(fm,C6,A6);bm(fm,M6,N6);bm(D6,O6,R6,JC);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function r_(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s);if(!o)return!1;let a=r?n.tr:null;return i_(a,o,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function i_(t,e,n,r=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);s=new Ka(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new Ka(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=um(s,n,r,e);return a?(t&&s_(t,e,a,i,n),!0):!1}function s_(t,e,n,r,i){let s=P.empty;for(let c=n.length-1;c>=0;c--)s=P.from(n[c].type.create(n[c].attrs,s));t.step(new Ut(e.start-(r?2:0),e.end,e.start,e.end,new Z(s,0,0),n.length,!0));let o=0;for(let c=0;c<n.length;c++)n[c].type==i&&(o=c+1);let a=n.length-o,l=e.start+n.length-(r?2:0),u=e.parent;for(let c=e.startIndex,d=e.endIndex,h=!0;c<d;c++,h=!1)!h&&ui(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(c).nodeSize;return t}function o_(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?a_(e,n,t,s):l_(e,n,s):!0:!1}}function a_(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new Ut(s-1,o,s,o,new Z(P.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ka(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=ia(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return hs(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function l_(t,e,n){let r=t.tr,i=n.parent;for(let f=n.end,p=n.endIndex-1,m=n.startIndex;p>m;p--)f-=i.child(p).nodeSize,r.delete(f-1,f+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=s.node(-1),c=s.index(-1);if(!u.canReplace(c+(a?0:1),c+1,o.content.append(l?P.empty:P.from(i))))return!1;let d=s.pos,h=d+o.nodeSize;return r.step(new Ut(d-(a?1:0),h+(l?1:0),d+1,h-1,new Z((a?P.empty:P.from(i.copy(P.empty))).append(l?P.empty:P.from(i.copy(P.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function u_(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=P.from(u?t.create():null),d=new Z(P.from(t.create(null,P.from(a.type.create(null,c)))),u?3:1,0),h=s.start,f=s.end;n(e.tr.step(new Ut(h-(u?3:1),f,h,f,d,1,!0)).scrollIntoView())}return!0}}const Kt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Uo=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let zf=null;const ii=function(t,e,n){let r=zf||(zf=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},c_=function(){zf=null},Ws=function(t,e,n,r){return n&&(gb(t,e,n,r,-1)||gb(t,e,n,r,1))},d_=/^(img|br|input|textarea|hr)$/i;function gb(t,e,n,r,i){for(var s;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Zn(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Cl(t)||d_.test(t.nodeName)||t.contentEditable=="false")return!1;e=Kt(t)+(i<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=o,e=i<0?Zn(t):0}else return!1}}function Zn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function h_(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Zn(t)}else if(t.parentNode&&!Cl(t))e=Kt(t),t=t.parentNode;else return null}}function f_(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Cl(t))e=Kt(t)+1,t=t.parentNode;else return null}}function p_(t,e,n){for(let r=e==0,i=e==Zn(t);r||i;){if(t==n)return!0;let s=Kt(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==Zn(t)}}function Cl(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const B0=function(t){return t.focusNode&&Ws(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Ts(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function m_(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function g_(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Zn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Zn(r.startContainer),r.startOffset)}}}const zr=typeof navigator<"u"?navigator:null,bb=typeof document<"u"?document:null,fs=zr&&zr.userAgent||"",Bf=/Edge\/(\d+)/.exec(fs),z6=/MSIE \d/.exec(fs),Ff=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(fs),Sn=!!(z6||Ff||Bf),Ki=z6?document.documentMode:Ff?+Ff[1]:Bf?+Bf[1]:0,er=!Sn&&/gecko\/(\d+)/i.test(fs);er&&+(/Firefox\/(\d+)/.exec(fs)||[0,0])[1];const Pf=!Sn&&/Chrome\/(\d+)/.exec(fs),Zt=!!Pf,B6=Pf?+Pf[1]:0,tn=!Sn&&!!zr&&/Apple Computer/.test(zr.vendor),qo=tn&&(/Mobile\/\w+/.test(fs)||!!zr&&zr.maxTouchPoints>2),Kn=qo||(zr?/Mac/.test(zr.platform):!1),F6=zr?/Win/.test(zr.platform):!1,oi=/Android \d/.test(fs),_l=!!bb&&"webkitFontSmoothing"in bb.documentElement.style,b_=_l?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function y_(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Xr(t,e){return typeof t=="number"?t:t[e]}function v_(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function yb(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=Uo(o);continue}let a=o,l=a==s.body,u=l?y_(s):v_(a),c=0,d=0;if(e.top<u.top+Xr(r,"top")?d=-(u.top-e.top+Xr(i,"top")):e.bottom>u.bottom-Xr(r,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Xr(i,"top")-u.top:e.bottom-u.bottom+Xr(i,"bottom")),e.left<u.left+Xr(r,"left")?c=-(u.left-e.left+Xr(i,"left")):e.right>u.right-Xr(r,"right")&&(c=e.right-u.right+Xr(i,"right")),c||d)if(l)s.defaultView.scrollBy(c,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),c&&(a.scrollLeft+=c);let m=a.scrollLeft-f,g=a.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}let h=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(h))break;o=h=="absolute"?o.offsetParent:Uo(o)}}function x_(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(s,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:P6(t.dom)}}function P6(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Uo(r));return e}function w_({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;$6(n,r==0?0:r-e)}function $6(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let go=null;function k_(t){if(t.setActive)return t.setActive();if(go)return t.focus(go);let e=P6(t);t.focus(go==null?{get preventScroll(){return go={preventScroll:!0},!0}}:void 0),go||(go=!1,$6(e,0))}function H6(t,e){let n,r=2e8,i,s=0,o=e.top,a=e.top,l,u;for(let c=t.firstChild,d=0;c;c=c.nextSibling,d++){let h;if(c.nodeType==1)h=c.getClientRects();else if(c.nodeType==3)h=ii(c).getClientRects();else continue;for(let f=0;f<h.length;f++){let p=h[f];if(p.top<=o&&p.bottom>=a){o=Math.max(p.bottom,o),a=Math.min(p.top,a);let m=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(m<r){n=c,r=m,i=m&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,c.nodeType==1&&m&&(s=d+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=c,u={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=d+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?E_(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:H6(n,i)}function E_(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let o=Oi(r,1);if(o.top!=o.bottom&&ym(e,o)){i={node:t,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:t,offset:0}}function ym(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function S_(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function C_(t,e,n){let{node:r,offset:i}=H6(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function __(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>r.top?i=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function U6(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let o=t.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(ym(e,u))return U6(o,e,u)}}if((s=(s+1)%r)==i)break}return t}function A_(t,e){let n=t.dom.ownerDocument,r,i=0,s=g_(n,e.left,e.top);s&&({node:r,offset:i}=s);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=t.dom.getBoundingClientRect();if(!ym(e,u)||(o=U6(t.dom,e,u),!o))return null}if(tn)for(let u=o;r&&u;u=Uo(u))u.draggable&&(r=void 0);if(o=S_(o,e),r){if(er&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let c=r.childNodes[i],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let u;_l&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=__(t,r,i,e))}a==null&&(a=C_(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function vb(t){return t.top<t.bottom||t.left<t.right}function Oi(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(vb(r))return r}return Array.prototype.find.call(n,vb)||t.getBoundingClientRect()}const T_=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function q6(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=_l||er;if(r.nodeType==3)if(o&&(T_.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=Oi(ii(r,i,i),n);if(er&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=Oi(ii(r,i-1,i-1),-1);if(u.top==l.top){let c=Oi(ii(r,i,i+1),-1);if(c.top!=l.top)return ba(c,c.left<u.left)}}return l}else{let l=i,u=i,c=n<0?1:-1;return n<0&&!i?(u++,c=-1):n>=0&&i==r.nodeValue.length?(l--,c=1):n<0?l--:u++,ba(Oi(ii(r,l,u),c),c<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Zn(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Gd(l.getBoundingClientRect(),!1)}if(s==null&&i<Zn(r)){let l=r.childNodes[i];if(l.nodeType==1)return Gd(l.getBoundingClientRect(),!0)}return Gd(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Zn(r))){let l=r.childNodes[i-1],u=l.nodeType==3?ii(l,Zn(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return ba(Oi(u,1),!1)}if(s==null&&i<Zn(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?ii(l,0,o?0:1):l.nodeType==1?l:null:null;if(u)return ba(Oi(u,-1),!0)}return ba(Oi(r.nodeType==3?ii(r):r,-n),n>=0)}function ba(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Gd(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function j6(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function M_(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return j6(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=q6(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=ii(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let c=l[u];if(c.bottom>c.top+1&&(n=="up"?o.top-c.top>(c.bottom-o.top)*2:c.bottom-o.bottom>(o.bottom-c.top)*2))return!1}}return!0})}const N_=/[\u0590-\u08ac]/;function D_(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=t.domSelection();return a?!N_.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:j6(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:d}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let f=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:m}=t.domSelectionRange(),g=p&&!f.contains(p.nodeType==1?p:p.parentNode)||l==p&&u==m;try{a.collapse(c,d),l&&(l!=c||u!=d)&&a.extend&&a.extend(l,u)}catch{}return h!=null&&(a.caretBidiLevel=h),g}):r.pos==r.start()||r.pos==r.end()}let xb=null,wb=null,kb=!1;function O_(t,e,n){return xb==e&&wb==n?kb:(xb=e,wb=n,kb=n=="up"||n=="down"?M_(t,e,n):D_(t,e,n))}const tr=0,Eb=1,Ds=2,Br=3;class Al{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=tr,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,o;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Kt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let a=i.children[o];if(a.size){i=a;break}}return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>e||o instanceof W6){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof V6&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Kt(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Kt(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],u=o+l.size;if(i==-1&&e<=u){let c=o+l.border;if(e>=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,c);e=o;for(let d=a;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=Kt(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(u>n||a==this.children.length-1)){n=u;for(let c=a+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=Kt(d.dom);break}n+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),o=Math.max(e,n);for(let f=0,p=0;f<this.children.length;f++){let m=this.children[f],g=p+m.size;if(s>p&&o<g)return m.setSelection(e-p-m.border,n-p-m.border,r,i);p=g}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),u=r.root.getSelection(),c=r.domSelectionRange(),d=!1;if((er||tn)&&e==n){let{node:f,offset:p}=a;if(f.nodeType==3){if(d=!!(p&&f.nodeValue[p-1]==`
440
+ `),d&&p==f.nodeValue.length)for(let m=f,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:Kt(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=f.childNodes[p-1];d=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(er&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let f=c.focusNode.childNodes[c.focusOffset];f&&f.contentEditable=="false"&&(i=!0)}if(!(i||d&&tn)&&Ws(a.node,a.offset,c.anchorNode,c.anchorOffset)&&Ws(l.node,l.offset,c.focusNode,c.focusOffset))return;let h=!1;if((u.extend||e==n)&&!(d&&er)){u.collapse(a.node,a.offset);try{e!=n&&u.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>n){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let a=r+s.border,l=o-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?Ds:Eb,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Br:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Ds:Br}r=o}this.dirty=Ds}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ds:Eb;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class V6 extends Al{constructor(e,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==tr&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class R_ extends Al{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Gs extends Al{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=ro.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Gs(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Br||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Br&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=tr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=tr}}slice(e,n,r){let i=Gs.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=Hf(s,n,o,r)),e>0&&(s=Hf(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Yi extends Al{constructor(e,n,r,i,s,o,a,l,u){super(e,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,s,o){let a=s.nodeViews[n.type.name],l,u=a&&a(n,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),c=u&&u.dom,d=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:d}=ro.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let h=c;return c=Y6(c,r,n),u?l=new I_(e,n,r,i,c,d||null,h,u,s,o+1):n.isText?new F0(e,n,r,i,c,h,s):new Yi(e,n,r,i,c,d||null,h,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>P.empty)}return e}matchesNode(e,n,r){return this.dirty==tr&&e.eq(this.node)&&lc(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new z_(this,o&&o.node,e);P_(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e,c):u.type.side>=0&&!d&&l.syncToMarks(c==this.node.childCount?Ve.none:this.node.child(c).marks,r,e,c),l.placeWidget(u,e,i)},(u,c,d,h)=>{l.syncToMarks(u.marks,r,e,h);let f;l.findNodeMatch(u,c,d,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(f=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(u,c,d,f,e)||l.updateNextNode(u,c,d,e,h,i)||l.addNode(u,c,d,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ds)&&(o&&this.protectLocalComposition(e,o),G6(this.contentDOM,this.children,e),qo&&$_(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof le)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=H_(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new R_(this,s,n,i);e.input.compositionNodes.push(o),this.children=Hf(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==Br||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=tr}updateOuterDeco(e){if(lc(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=K6(this.dom,this.nodeDOM,$f(this.outerDeco,this.node,n),$f(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Sb(t,e,n,r,i){Y6(r,e,t);let s=new Yi(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class F0 extends Yi{constructor(e,n,r,i,s,o,a){super(e,n,r,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Br||this.dirty!=tr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=tr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=tr,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new F0(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Br)}get domAtom(){return!1}isText(e){return this.node.text==e}}class W6 extends Al{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==tr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class I_ extends Yi{constructor(e,n,r,i,s,o,a,l,u,c){super(e,n,r,i,s,o,a,u,c),this.spec=l}update(e,n,r,i){if(this.dirty==Br)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function G6(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==t){for(;a!=r;)r=Cb(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof Gs){let l=r?r.previousSibling:t.lastChild;G6(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Cb(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Ia=function(t){t&&(this.nodeName=t)};Ia.prototype=Object.create(null);const Os=[new Ia];function $f(t,e,n){if(t.length==0)return Os;let r=n?Os[0]:new Ia,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new Ia(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new Ia(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function K6(t,e,n,r){if(n==Os&&r==Os)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],a=n[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Os[0]),i=l}L_(i,a||Os[0],o)}return i}function L_(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function Y6(t,e,n){return K6(t,t,Os,$f(e,n,t.nodeType!=1))}function lc(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Cb(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class z_{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=B_(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,i){let s=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;s<a&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=tr,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1,u=this.top.children.length;i<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let c=this.index;c<u;c++){let d=this.top.children[c];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){l=c;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=Gs.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,n,r)&&!this.preMatch.matched.has(u)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let o=this.top.children[i];return o.dirty==Br&&o.dom==o.contentDOM&&(o.dirty=Ds),o.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Yi){let u=this.preMatch.matched.get(l);if(u!=null&&u!=s)return!1;let c=l.dom,d,h=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Br&&lc(n,l.outerDeco));if(!h&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!h&&(d=this.recreateWrapper(l,e,n,r,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=Ds,d.updateChildren(i,o+1),d.dirty=tr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!lc(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=Yi.create(this.top,n,r,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,s){let o=Yi.create(this.top,e,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new V6(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Gs;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof F0)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((tn||Zt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new W6(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function B_(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof Gs)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function F_(t,e){return t.type.side-e.type.side}function P_(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let u=0;u<t.childCount;u++){let c=t.child(u);r(c,i,e.forChild(s,c),u),s+=c.nodeSize}return}let o=0,a=[],l=null;for(let u=0;;){let c,d;for(;o<i.length&&i[o].to==s;){let g=i[o++];g.widget&&(c?(d||(d=[c])).push(g):c=g)}if(c)if(d){d.sort(F_);for(let g=0;g<d.length;g++)n(d[g],u,!!l)}else n(c,u,!!l);let h,f;if(l)f=-1,h=l,l=null;else if(u<t.childCount)f=u,h=t.child(u++);else break;for(let g=0;g<a.length;g++)a[g].to<=s&&a.splice(g--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let p=s+h.nodeSize;if(h.isText){let g=p;o<i.length&&i[o].from<g&&(g=i[o].from);for(let y=0;y<a.length;y++)a[y].to<g&&(g=a[y].to);g<p&&(l=h.cut(g-s),h=h.cut(0,g-s),p=g,f=-1)}else for(;o<i.length&&i[o].to<p;)o++;let m=h.isInline&&!h.isLeaf?a.filter(g=>!g.inline):a.slice();r(h,m,e.forChild(s,h),f),s=p}}function $_(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function H_(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let o=t.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<t.childCount;){let u=t.child(i++);if(s+=u.nodeSize,!u.isText)break;l+=u.text}if(s>=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a<r?l.lastIndexOf(e,r-a-1):-1;if(u>=0&&u+e.length+a>=n)return a+u;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Hf(t,e,n,r,i){let s=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],u=a,c=a+=l.size;u>=n||c<=e?s.push(l):(u<e&&s.push(l.slice(0,e-u,r)),i&&(s.push(i),i=void 0),c>n&&s.push(l.slice(n-u,l.size,r)))}return s}function vm(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,u;if(B0(n)){for(l=o;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&ue.isSelectable(d)&&i.parent&&!(d.isInline&&p_(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;u=new ue(o==h?a:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=o,h=o;for(let f=0;f<n.rangeCount;f++){let p=n.getRangeAt(f);d=Math.min(d,t.docView.posFromDOM(p.startContainer,p.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(d<0)return null;[l,o]=h==t.state.selection.anchor?[h,d]:[d,h],a=r.resolve(o)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let c=r.resolve(l);if(!u){let d=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;u=xm(t,c,a,d)}return u}function Z6(t){return t.editable?t.hasFocus():X6(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function ci(t,e=!1){let n=t.state.selection;if(J6(t,n),!!Z6(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Zt){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Ws(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)q_(t);else{let{anchor:r,head:i}=n,s,o;_b&&!(n instanceof le)&&(n.$from.parent.inlineContent||(s=Ab(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Ab(t,n.to))),t.docView.setSelection(r,i,t,e),_b&&(s&&Tb(s),o&&Tb(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&U_(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const _b=tn||Zt&&B6<63;function Ab(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(tn&&i&&i.contentEditable=="false")return Kd(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Kd(i);if(s)return Kd(s)}}function Kd(t){return t.contentEditable="true",tn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Tb(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function U_(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Z6(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function q_(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Kt(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Sn&&Ki<=11&&(n.disabled=!0,n.disabled=!1)}function J6(t,e){if(e instanceof ue){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Mb(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Mb(t)}function Mb(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function xm(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||le.between(e,n,r)}function Nb(t){return t.editable&&!t.hasFocus()?!1:X6(t)}function X6(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function j_(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Ws(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Uf(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&fe.findFrom(s,e)}function Ii(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Db(t,e,n){let r=t.state.selection;if(r instanceof le)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Ii(t,new le(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Uf(t.state,e);return i&&i instanceof ue?Ii(t,i):!1}else if(!(Kn&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?ue.isSelectable(s)?Ii(t,new ue(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):_l?Ii(t,new le(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ue&&r.node.isInline)return Ii(t,new le(e>0?r.$to:r.$from));{let i=Uf(t.state,e);return i?Ii(t,i):!1}}}function uc(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function La(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function bo(t,e){return e<0?V_(t):W_(t)}function V_(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(er&&n.nodeType==1&&r<uc(n)&&La(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(La(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Q6(n))break;{let a=n.previousSibling;for(;a&&La(a,-1);)i=n.parentNode,s=Kt(a),a=a.previousSibling;if(a)n=a,r=uc(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?qf(t,n,r):i&&qf(t,i,s)}function W_(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=uc(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(La(a,1))s=n,o=++r;else break}else{if(Q6(n))break;{let a=n.nextSibling;for(;a&&La(a,1);)s=a.parentNode,o=Kt(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=uc(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&qf(t,s,o)}function Q6(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function G_(t,e){for(;t&&e==t.childNodes.length&&!Cl(t);)e=Kt(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function K_(t,e){for(;t&&!e&&!Cl(t);)e=Kt(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function qf(t,e,n){if(e.nodeType!=3){let s,o;(o=G_(e,n))?(e=o,n=0):(s=K_(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(B0(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&ci(t)},50)}function Ob(t,e){let n=t.state.doc.resolve(e);if(!(Zt||F6)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Rb(t,e,n){let r=t.state.selection;if(r instanceof le&&!r.empty||n.indexOf("s")>-1||Kn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=Uf(t.state,e);if(o&&o instanceof ue)return Ii(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof En?fe.near(o,e):fe.findFrom(o,e);return a?Ii(t,a):!1}return!1}function Ib(t,e){if(!(t.state.selection instanceof le))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function Lb(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Y_(t){if(!tn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Lb(t,r,"true"),setTimeout(()=>Lb(t,r,"false"),20)}return!1}function Z_(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function J_(t,e){let n=e.keyCode,r=Z_(e);if(n==8||Kn&&n==72&&r=="c")return Ib(t,-1)||bo(t,-1);if(n==46&&!e.shiftKey||Kn&&n==68&&r=="c")return Ib(t,1)||bo(t,1);if(n==13||n==27)return!0;if(n==37||Kn&&n==66&&r=="c"){let i=n==37?Ob(t,t.state.selection.from)=="ltr"?-1:1:-1;return Db(t,i,r)||bo(t,i)}else if(n==39||Kn&&n==70&&r=="c"){let i=n==39?Ob(t,t.state.selection.from)=="ltr"?1:-1:1;return Db(t,i,r)||bo(t,i)}else{if(n==38||Kn&&n==80&&r=="c")return Rb(t,-1,r)||bo(t,-1);if(n==40||Kn&&n==78&&r=="c")return Y_(t)||Rb(t,1,r)||bo(t,1);if(r==(Kn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function wm(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let o=t.someProp("clipboardSerializer")||ro.fromSchema(t.state.schema),a=s5(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let u=l.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=i5[u.nodeName.toLowerCase()]);){for(let f=c.length-1;f>=0;f--){let p=a.createElement(c[f]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),d++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,`
441
+
442
+ `);return{dom:l,text:h,slice:e}}function e5(t,e,n,r,i){let s=i.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=!!e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",h=>{e=h(e,s||r,t)}),s)return a=new Z(P.from(t.state.schema.text(e.replace(/\r\n?/g,`
443
+ `))),0,0),t.someProp("transformPasted",h=>{a=h(a,t,!0)}),a;let d=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(d)a=d;else{let h=i.marks(),{schema:f}=t.state,p=ro.fromSchema(f);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=o.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(f.text(m,h)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),o=tA(n),_l&&nA(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||To.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!X_.test(h.parentNode.nodeName)?{ignore:!0}:null}})),c)a=rA(zb(a,+c[1],+c[2]),c[4]);else if(a=Z.maxOpen(Q_(a.content,i),!0),a.openStart||a.openEnd){let d=0,h=0;for(let f=a.content.firstChild;d<a.openStart&&!f.type.spec.isolating;d++,f=f.firstChild);for(let f=a.content.lastChild;h<a.openEnd&&!f.type.spec.isolating;h++,f=f.lastChild);a=zb(a,d,h)}return t.someProp("transformPasted",d=>{a=d(a,t,l)}),a}const X_=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Q_(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,o=[];if(t.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),u;if(!l)return o=null;if(u=o.length&&s.length&&n5(l,s,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=r5(o[o.length-1],s.length));let c=t5(a,l);o.push(c),i=i.matchType(c.type),s=l}}),o)return P.from(o)}return t}function t5(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,P.from(t));return t}function n5(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=n5(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(P.from(t5(n,t,i+1))))}}function r5(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,r5(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(P.empty,!0);return t.copy(n.append(r))}function jf(t,e,n,r,i,s){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(s=0),i<r-1&&(a=jf(a,e,n,r,i+1,s)),i>=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(P.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function zb(t,e,n){return e<t.openStart&&(t=new Z(jf(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Z(jf(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const i5={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Bb=null;function s5(){return Bb||(Bb=document.implementation.createHTMLDocument("title"))}let Yd=null;function eA(t){let e=window.trustedTypes;return e?(Yd||(Yd=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Yd.createHTML(t)):t}function tA(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=s5().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&i5[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=eA(t),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function nA(t){let e=t.querySelectorAll(Zt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function rA(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:o}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=P.from(l.create(r[a+1],i)),s++,o++}return new Z(i,s,o)}const hn={},fn={},iA={touchstart:!0,touchmove:!0};class sA{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function oA(t){for(let e in hn){let n=hn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{lA(t,r)&&!km(t,r)&&(t.editable||!(r.type in fn))&&n(t,r)},iA[e]?{passive:!0}:void 0)}tn&&t.dom.addEventListener("input",()=>null),Vf(t)}function qi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function aA(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Vf(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>km(t,r))})}function km(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function lA(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function uA(t,e){!km(t,e)&&hn[e.type]&&(t.editable||!(e.type in fn))&&hn[e.type](t,e)}fn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!a5(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(oi&&Zt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),qo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Ts(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||J_(t,n)?n.preventDefault():qi(t,"key")};fn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};fn.keypress=(t,e)=>{let n=e;if(a5(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Kn&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof le)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i,s))&&t.dispatch(s()),n.preventDefault()}};function P0(t){return{left:t.clientX,top:t.clientY}}function cA(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Em(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,a=>o>s.depth?a(t,n,s.nodeAfter,s.before(o),i,!0):a(t,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function No(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function dA(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ue.isSelectable(r)?(No(t,new ue(n)),!0):!1}function hA(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof ue&&(r=n.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(ue.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(No(t,ue.create(t.state.doc,i)),!0):!1}function fA(t,e,n,r,i){return Em(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?hA(t,n):dA(t,n))}function pA(t,e,n,r){return Em(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function mA(t,e,n,r){return Em(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||gA(t,n,r)}function gA(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(No(t,le.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)No(t,le.create(r,a+1,a+1+o.content.size));else if(ue.isSelectable(o))No(t,ue.create(r,a));else continue;return!0}}function Sm(t){return cc(t)}const o5=Kn?"metaKey":"ctrlKey";hn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Sm(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&cA(n,t.input.lastClick)&&!n[o5]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let o=t.posAtCoords(P0(n));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new bA(t,o,n,!!r)):(s=="doubleClick"?pA:mA)(t,o.pos,o.inside,n)?n.preventDefault():qi(t,"pointer"))};class bA{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[o5],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),o=n.inside;else{let c=e.state.doc.resolve(n.pos);s=c.parent,o=c.depth?c.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof ue&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&er&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),qi(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>ci(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(P0(e))),this.updateAllowDefault(e),this.allowDefault||!n?qi(this.view,"pointer"):fA(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||tn&&this.mightDrag&&!this.mightDrag.node.isAtom||Zt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(No(this.view,fe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):qi(this.view,"pointer")}move(e){this.updateAllowDefault(e),qi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}hn.touchstart=t=>{t.input.lastTouch=Date.now(),Sm(t),qi(t,"pointer")};hn.touchmove=t=>{t.input.lastTouch=Date.now(),qi(t,"pointer")};hn.contextmenu=t=>Sm(t);function a5(t,e){return t.composing?!0:tn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const yA=oi?5e3:-1;fn.compositionstart=fn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof le&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Zt&&F6&&vA(t)))t.markCursor=t.state.storedMarks||n.marks(),cc(t,!0),t.markCursor=null;else if(cc(t,!e.selection.empty),er&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}l5(t,yA)};function vA(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}fn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,l5(t,20))};function l5(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>cc(t),e))}function u5(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=wA());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function xA(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=h_(e.focusNode,e.focusOffset),r=f_(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function wA(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function cc(t,e=!1){if(!(oi&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),u5(t),e||t.docView&&t.docView.dirty){let n=vm(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function kA(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Xa=Sn&&Ki<15||qo&&b_<604;hn.copy=fn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=Xa?null:n.clipboardData,o=r.content(),{dom:a,text:l}=wm(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):kA(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function EA(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function SA(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Qa(t,r.value,null,i,e):Qa(t,r.textContent,r.innerHTML,i,e)},50)}function Qa(t,e,n,r,i){let s=e5(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||Z.empty)))return!0;if(!s)return!1;let o=EA(s),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function c5(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}fn.paste=(t,e)=>{let n=e;if(t.composing&&!oi)return;let r=Xa?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Qa(t,c5(r),r.getData("text/html"),i,n)?n.preventDefault():SA(t,n)};class d5{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const CA=Kn?"altKey":"ctrlKey";function h5(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[CA]}hn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(P0(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof ue?i.to-1:i.to))){if(r&&r.mightDrag)o=ue.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(o=ue.create(t.state.doc,d.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:u,slice:c}=wm(t,a);(!n.dataTransfer.files.length||!Zt||B6>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Xa?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Xa||n.dataTransfer.setData("text/plain",u),t.dragging=new d5(c,h5(t,n),o)};hn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};fn.dragover=fn.dragenter=(t,e)=>e.preventDefault();fn.drop=(t,e)=>{try{_A(t,e,t.dragging)}finally{t.dragging=null}};function _A(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(P0(e));if(!r)return;let i=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",f=>{s=f(s,t,!1)}):s=e5(t,c5(e.dataTransfer),Xa?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(n&&h5(t,e));if(t.someProp("handleDrop",f=>f(t,e,s||Z.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?b6(t.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let l=t.state.tr;if(o){let{node:f}=n;f?f.replace(l):l.deleteSelection()}let u=l.mapping.map(a),c=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=l.doc;if(c?l.replaceRangeWith(u,u,s.content.firstChild):l.replaceRange(u,u,s),l.doc.eq(d))return;let h=l.doc.resolve(u);if(c&&ue.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new ue(h));else{let f=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((p,m,g,y)=>f=y),l.setSelection(xm(t,h,l.doc.resolve(f)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}hn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&ci(t)},20))};hn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};hn.beforeinput=(t,e)=>{if(Zt&&oi&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,Ts(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in fn)hn[t]=fn[t];function el(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class dc{constructor(e,n){this.toDOM=e,this.spec=n||Fs,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:o}=e.mapResult(n.from+i,this.side<0?-1:1);return o?null:new Ge(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof dc&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&el(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Zi{constructor(e,n){this.attrs=e,this.spec=n||Fs}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new Ge(s,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Zi&&el(this.attrs,e.attrs)&&el(this.spec,e.spec)}static is(e){return e.type instanceof Zi}destroy(){}}class Cm{constructor(e,n){this.attrs=e,this.spec=n||Fs}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let o=e.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new Ge(s.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof Cm&&el(this.attrs,e.attrs)&&el(this.spec,e.spec)}destroy(){}}class Ge{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Ge(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Ge(e,e,new dc(n,r))}static inline(e,n,r,i){return new Ge(e,n,new Zi(r,i))}static node(e,n,r,i){return new Ge(e,n,new Cm(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Zi}get widget(){return this.type instanceof dc}}const ko=[],Fs={};class Le{constructor(e,n){this.local=e.length?e:ko,this.children=n.length?n:ko}static create(e,n){return n.length?hc(n,e,0,Fs):Xt}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,i+a,s)}}map(e,n,r){return this==Xt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Fs)}mapInner(e,n,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?AA(this.children,o||[],e,n,r,i,s):o?new Le(o.sort(Ps),ko):Xt}add(e,n){return n.length?this==Xt?Le.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((a,l)=>{let u=l+r,c;if(c=p5(n,a,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,c,u+1):i.splice(s,0,l,l+a.nodeSize,hc(c,a,u+1,Fs)),s+=3}});let o=f5(s?m5(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new Le(o.length?this.local.concat(o).sort(Ps):this.local,i||this.children)}remove(e){return e.length==0||this==Xt?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+n,l=r[s+1]+n;for(let c=0,d;c<e.length;c++)(d=e[c])&&d.from>a&&d.to<l&&(e[c]=null,(o||(o=[])).push(d));if(!o)continue;r==this.children&&(r=this.children.slice());let u=r[s+2].removeInner(o,a+1);u!=Xt?r[s+2]=u:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Le(i,r):Xt}forChild(e,n){if(this==Xt)return this;if(n.isLeaf)return Le.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof Zi){let u=Math.max(s,l.from)-s,c=Math.min(o,l.to)-s;u<c&&(i||(i=[])).push(l.copy(u,c))}}if(i){let a=new Le(i.sort(Ps),ko);return r?new Fi([a,r]):a}return r||Xt}eq(e){if(this==e)return!0;if(!(e instanceof Le)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return _m(this.localsInner(e))}localsInner(e){if(this==Xt)return ko;if(e.inlineContent||!this.local.some(Zi.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Zi||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Le.empty=new Le([],[]);Le.removeOverlap=_m;const Xt=Le.empty;class Fi{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Fs));return Fi.from(r)}forChild(e,n){if(n.isLeaf)return Le.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=Xt&&(s instanceof Fi?r=r.concat(s.members):r.push(s))}return Fi.from(r)}eq(e){if(!(e instanceof Fi)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?_m(r?n:n.sort(Ps)):ko}static from(e){switch(e.length){case 0:return Xt;case 1:return e[0];default:return new Fi(e.every(n=>n instanceof Le)?e:e.reduce((n,r)=>n.concat(r instanceof Le?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function AA(t,e,n,r,i,s,o){let a=t.slice();for(let u=0,c=s;u<n.maps.length;u++){let d=0;n.maps[u].forEach((h,f,p,m)=>{let g=m-p-(f-h);for(let y=0;y<a.length;y+=3){let x=a[y+1];if(x<0||h>x+c-d)continue;let k=a[y]+c-d;f>=k?a[y+1]=h<=k?-2:-1:h>=c&&g&&(a[y]+=g,a[y+1]+=g)}d+=g}),c=n.maps[u].map(c,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let c=n.map(t[u]+s),d=c-i;if(d<0||d>=r.content.size){l=!0;continue}let h=n.map(t[u+1]+s,-1),f=h-i,{index:p,offset:m}=r.content.findIndex(d),g=r.maybeChild(p);if(g&&m==d&&m+g.nodeSize==f){let y=a[u+2].mapInner(n,g,c+1,t[u]+s+1,o);y!=Xt?(a[u]=d,a[u+1]=f,a[u+2]=y):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=TA(a,t,e,n,i,s,o),c=hc(u,r,0,o);e=c.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,h=0;d<c.children.length;d+=3){let f=c.children[d];for(;h<a.length&&a[h]<f;)h+=3;a.splice(h,0,c.children[d],c.children[d+1],c.children[d+2])}}return new Le(e.sort(Ps),a)}function f5(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Ge(i.from+e,i.to+e,i.type))}return n}function TA(t,e,n,r,i,s,o){function a(l,u){for(let c=0;c<l.local.length;c++){let d=l.local[c].map(r,i,u);d?n.push(d):o.onRemove&&o.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)a(l.children[c+2],l.children[c]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function p5(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,o;s<t.length;s++)(o=t[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[s]=null);return i}function m5(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function hc(t,e,n,r){let i=[],s=!1;e.forEach((a,l)=>{let u=p5(t,a,l+n);if(u){s=!0;let c=hc(u,a,n+l+1,r);c!=Xt&&i.push(l,l+a.nodeSize,c)}});let o=f5(s?m5(t):t,-n).sort(Ps);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new Le(o,i):Xt}function Ps(t,e){return t.from-e.from||t.to-e.to}function _m(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),Fb(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),Fb(e,i,r.copy(s.from,r.to)));break}}}return e}function Fb(t,e,n){for(;e<t.length&&Ps(n,t[e])>0;)e++;t.splice(e,0,n)}function Zd(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Xt&&e.push(r)}),t.cursorWrapper&&e.push(Le.create(t.state.doc,[t.cursorWrapper.deco])),Fi.from(e)}const MA={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},NA=Sn&&Ki<=11;class DA{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class OA{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new DA,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Sn&&Ki<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():tn&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),NA&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,MA)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Nb(this.view)){if(this.suppressingSelectionUpdates)return ci(this.view);if(Sn&&Ki<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ws(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Uo(s))n.add(s);for(let s=e.anchorNode;s;s=Uo(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Nb(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let c=0;c<n.length;c++){let d=this.registerMutation(n[c],l);d&&(s=s<0?d.from:Math.min(d.from,s),o=o<0?d.to:Math.max(d.to,o),d.typeOver&&(a=!0))}if(l.some(c=>c.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let c of l)if(c.nodeName=="BR"&&c.parentNode){let d=c.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){c.parentNode.removeChild(c);break}d=d.firstChild}}}else if(er&&l.length){let c=l.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,h]=c;d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let h of c){let f=h.parentNode;f&&f.nodeName=="LI"&&(!d||LA(e,d)!=f)&&h.remove()}}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&B0(r)&&(u=vm(e))&&u.eq(fe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,ci(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),RA(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,zA(e,l)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||ci(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let d=e.addedNodes[c];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Sn&&Ki<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:d,nextSibling:h}=e.addedNodes[c];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(s=h)}let o=i&&i.parentNode==e.target?Kt(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?Kt(s):e.target.childNodes.length,u=r.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Pb=new WeakMap,$b=!1;function RA(t){if(!Pb.has(t)&&(Pb.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=er,$b)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),$b=!0}}function Hb(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return Ws(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function IA(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Hb(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Hb(t,n):null}function LA(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function zA(t,e){var n;let{focusNode:r,focusOffset:i}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let a=o;for(;;){let l=a.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(s,a.firstChild),r==s&&t.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function BA(t,e,n){let{node:r,fromOffset:i,toOffset:s,from:o,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),u,c=l.anchorNode;if(c&&t.dom.contains(c.nodeType==1?c:c.parentNode)&&(u=[{node:c,offset:l.anchorOffset}],B0(l)||u.push({node:l.focusNode,offset:l.focusOffset})),Zt&&t.input.lastKeyCode===8)for(let g=s;g>i;g--){let y=r.childNodes[g-1],x=y.pmViewDesc;if(y.nodeName=="BR"&&!x){s=g;break}if(!x||x.size)break}let d=t.state.doc,h=t.someProp("domParser")||To.fromSchema(t.state.schema),f=d.resolve(o),p=null,m=h.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:s,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:FA,context:f});if(u&&u[0].pos!=null){let g=u[0].pos,y=u[1]&&u[1].pos;y==null&&(y=g),p={anchor:g+o,head:y+o}}return{doc:m,sel:p,from:o,to:a}}function FA(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(tn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||tn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const PA=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function $A(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let D=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,I=vm(t,D);if(I&&!t.state.selection.eq(I)){if(Zt&&oi&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",G=>G(t,Ts(13,"Enter"))))return;let L=t.state.tr.setSelection(I);D=="pointer"?L.setMeta("pointer",!0):D=="key"&&L.scrollIntoView(),s&&L.setMeta("composition",s),t.dispatch(L)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=BA(t,e,n),c=t.state.doc,d=c.slice(u.from,u.to),h,f;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,f="end"):(h=t.state.selection.from,f="start"),t.input.lastKeyCode=null;let p=qA(d.content,u.doc.content,u.from,h,f);if(p&&t.input.domChangeCount++,(qo&&t.input.lastIOSEnter>Date.now()-225||oi)&&i.some(D=>D.nodeType==1&&!PA.test(D.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",D=>D(t,Ts(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof le&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let D=Ub(t,t.state.doc,u.sel);if(D&&!D.eq(t.state.selection)){let I=t.state.tr.setSelection(D);s&&I.setMeta("composition",s),t.dispatch(I)}}return}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof le&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),Sn&&Ki<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>u.from&&u.doc.textBetween(p.start-u.from-1,p.start-u.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=u.doc.resolveNoCache(p.start-u.from),g=u.doc.resolveNoCache(p.endB-u.from),y=c.resolve(p.start),x=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA;if((qo&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(D=>D.nodeName=="DIV"||D.nodeName=="P"))||!x&&m.pos<u.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(u.doc.textBetween(m.pos,g.pos,"","")))&&t.someProp("handleKeyDown",D=>D(t,Ts(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&UA(c,p.start,p.endA,m,g)&&t.someProp("handleKeyDown",D=>D(t,Ts(8,"Backspace")))){oi&&Zt&&t.domObserver.suppressSelectionUpdates();return}Zt&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),oi&&!x&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==p.endA&&(p.endB-=2,g=u.doc.resolveNoCache(p.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(D){return D(t,Ts(13,"Enter"))})},20));let k=p.start,C=p.endA,_=D=>{let I=D||t.state.tr.replace(k,C,u.doc.slice(p.start-u.from,p.endB-u.from));if(u.sel){let L=Ub(t,I.doc,u.sel);L&&!(Zt&&t.composing&&L.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(L.head==k||L.head==I.mapping.map(C)-1)||Sn&&L.empty&&L.head==k)&&I.setSelection(L)}return s&&I.setMeta("composition",s),I.scrollIntoView()},T;if(x)if(m.pos==g.pos){Sn&&Ki<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>ci(t),20));let D=_(t.state.tr.delete(k,C)),I=c.resolve(p.start).marksAcross(c.resolve(p.endA));I&&D.ensureMarks(I),t.dispatch(D)}else if(p.endA==p.endB&&(T=HA(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start())))){let D=_(t.state.tr);T.type=="add"?D.addMark(k,C,T.mark):D.removeMark(k,C,T.mark),t.dispatch(D)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let D=m.parent.textBetween(m.parentOffset,g.parentOffset),I=()=>_(t.state.tr.insertText(D,k,C));t.someProp("handleTextInput",L=>L(t,k,C,D,I))||t.dispatch(I())}else t.dispatch(_());else t.dispatch(_())}function Ub(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:xm(t,e.resolve(n.anchor),e.resolve(n.head))}function HA(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,o,a,l;for(let c=0;c<r.length;c++)i=r[c].removeFromSet(i);for(let c=0;c<n.length;c++)s=n[c].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=c=>c.mark(a.addToSet(c.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=c=>c.mark(a.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(l(e.child(c)));if(P.from(u).eq(t))return{mark:a,type:o}}function UA(t,e,n,r,i){if(n-e<=i.pos-r.pos||Jd(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=t.resolve(Jd(s,!0,!0));return!o.parent.isTextblock||o.pos>n||Jd(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Jd(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function qA(t,e,n,r,i){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:o,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));r-=o+l-s}if(o<s&&t.size<e.size){let l=r<=s&&r>=o?s-r:0;s-=l,s&&s<e.size&&qb(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,s&&s<t.size&&qb(t.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function qb(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class g5{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new sA,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Kb),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Wb(this),Vb(this),this.nodeViews=Gb(this),this.docView=Sb(this.state.doc,jb(this),Zd(this),this.dom,this),this.domObserver=new OA(this,(r,i,s,o)=>$A(this,r,i,s,o)),this.domObserver.start(),oA(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Vf(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Kb),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(u5(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=Gb(this);VA(f,this.nodeViews)&&(this.nodeViews=f,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Vf(this),this.editable=Wb(this),Vb(this);let l=Zd(this),u=jb(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,u,l);(d||!e.selection.eq(i.selection))&&(o=!0);let h=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&x_(this);if(o){this.domObserver.stop();let f=d&&(Sn||Zt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&jA(i.selection,e.selection);if(d){let p=Zt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=xA(this)),(s||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=Sb(e.doc,u,l,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&j_(this))?ci(this,f):(J6(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():h&&w_(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ue){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&yb(this,n.getBoundingClientRect(),e)}else yb(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new d5(e.slice,e.move,i<0?void 0:ue.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=n?n(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Sn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&k_(this.dom),ci(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return A_(this,e)}coordsAtPos(e,n=1){return q6(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return O_(this,n||this.state,e)}pasteHTML(e,n){return Qa(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Qa(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return wm(this,e)}destroy(){this.docView&&(aA(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Zd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,c_())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return uA(this,e)}domSelectionRange(){let e=this.domSelection();return e?tn&&this.root.nodeType===11&&m_(this.dom.ownerDocument)==this.dom&&IA(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}g5.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function jb(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Ge.node(0,t.state.doc.content.size,e)]}function Vb(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ge.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Wb(t){return!t.someProp("editable",e=>e(t.state)===!1)}function jA(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Gb(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function VA(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function Kb(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var ts={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},fc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},WA=typeof navigator<"u"&&/Mac/.test(navigator.platform),GA=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Yt=0;Yt<10;Yt++)ts[48+Yt]=ts[96+Yt]=String(Yt);for(var Yt=1;Yt<=24;Yt++)ts[Yt+111]="F"+Yt;for(var Yt=65;Yt<=90;Yt++)ts[Yt]=String.fromCharCode(Yt+32),fc[Yt]=String.fromCharCode(Yt);for(var Xd in ts)fc.hasOwnProperty(Xd)||(fc[Xd]=ts[Xd]);function KA(t){var e=WA&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||GA&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?fc:ts)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const YA=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ZA=typeof navigator<"u"&&/Win/.test(navigator.platform);function JA(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))YA?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function XA(t){let e=Object.create(null);for(let n in t)e[JA(n)]=t[n];return e}function Qd(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function QA(t){return new _e({props:{handleKeyDown:Am(t)}})}function Am(t){let e=XA(t);return function(n,r){let i=KA(r),s,o=e[Qd(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Qd(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(ZA&&r.ctrlKey&&r.altKey)&&(s=ts[r.keyCode])&&s!=i){let a=e[Qd(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var eT=Object.defineProperty,Tm=(t,e)=>{for(var n in e)eT(t,n,{get:e[n],enumerable:!0})};function $0(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var H0=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([o,a])=>[o,(...u)=>{const c=a(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),c}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],a=!!t,l=t||i.tr,u=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(l),o.every(d=>d===!0)),c={...Object.fromEntries(Object.entries(n).map(([d,h])=>[d,(...p)=>{const m=this.buildProps(l,e),g=h(...p)(m);return o.push(g),c}])),run:u};return c}createCan(t){const{rawCommands:e,state:n}=this,r=!1,i=t||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>l(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:t,editor:r,view:s,state:$0({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...u)=>l(...u)(o)]))}};return o}},b5={};Tm(b5,{blur:()=>tT,clearContent:()=>nT,clearNodes:()=>rT,command:()=>iT,createParagraphNear:()=>sT,cut:()=>oT,deleteCurrentNode:()=>aT,deleteNode:()=>lT,deleteRange:()=>uT,deleteSelection:()=>cT,enter:()=>dT,exitCode:()=>hT,extendMarkRange:()=>fT,first:()=>pT,focus:()=>gT,forEach:()=>bT,insertContent:()=>yT,insertContentAt:()=>wT,joinBackward:()=>ST,joinDown:()=>ET,joinForward:()=>CT,joinItemBackward:()=>_T,joinItemForward:()=>AT,joinTextblockBackward:()=>TT,joinTextblockForward:()=>MT,joinUp:()=>kT,keyboardShortcut:()=>DT,lift:()=>OT,liftEmptyBlock:()=>RT,liftListItem:()=>IT,newlineInCode:()=>LT,resetAttributes:()=>zT,scrollIntoView:()=>BT,selectAll:()=>FT,selectNodeBackward:()=>PT,selectNodeForward:()=>$T,selectParentNode:()=>HT,selectTextblockEnd:()=>UT,selectTextblockStart:()=>qT,setContent:()=>jT,setMark:()=>oM,setMeta:()=>aM,setNode:()=>lM,setNodeSelection:()=>uM,setTextDirection:()=>cM,setTextSelection:()=>dM,sinkListItem:()=>hM,splitBlock:()=>fM,splitListItem:()=>pM,toggleList:()=>gM,toggleMark:()=>bM,toggleNode:()=>yM,toggleWrap:()=>vM,undoInputRule:()=>xM,unsetAllMarks:()=>wM,unsetMark:()=>kM,unsetTextDirection:()=>EM,updateAttributes:()=>SM,wrapIn:()=>CM,wrapInList:()=>_M});var tT=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),nT=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),rT=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,d=u.resolve(c.map(l)),h=u.resolve(c.map(l+a.nodeSize)),f=d.blockRange(h);if(!f)return;const p=ia(f);if(a.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(f.start,m)}(p||p===0)&&e.lift(f,p)})}),!0},iT=t=>e=>t(e),sT=()=>({state:t,dispatch:e})=>O6(t,e),oT=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new le(r.doc.resolve(Math.max(o-1,0)))),!0},aT=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1};function Dt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var lT=t=>({tr:e,state:n,dispatch:r})=>{const i=Dt(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),u=s.after(o);e.delete(l,u).scrollIntoView()}return!0}return!1},uT=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},cT=()=>({state:t,dispatch:e})=>fm(t,e),dT=()=>({commands:t})=>t.keyboardShortcut("Enter"),hT=()=>({state:t,dispatch:e})=>YC(t,e);function Mm(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function pc(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Mm(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function y5(t,e,n={}){return t.find(r=>r.type===e&&pc(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Yb(t,e,n={}){return!!y5(t,e,n)}function Nm(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(u=>u.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(u=>u.type===e))return;if(!n){const u=r.node.marks.find(c=>c.type===e);u&&(n=u.attrs)}if(!y5([...r.node.marks],e,n))return;let s=r.index,o=t.start()+r.offset,a=s+1,l=o+r.node.nodeSize;for(;s>0&&Yb([...t.parent.child(s-1).marks],e,n);)s-=1,o-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&Yb([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function vi(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var fT=(t,e)=>({tr:n,state:r,dispatch:i})=>{const s=vi(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const d=Nm(l,s,e);if(d&&d.from<=u&&d.to>=c){const h=le.create(o,d.from,d.to);n.setSelection(h)}}return!0},pT=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Dm(t){return t instanceof le}function ai(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function v5(t,e=null){if(!e)return null;const n=fe.atStart(t),r=fe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?le.create(t,ai(0,i,s),ai(t.content.size,i,s)):le.create(t,ai(e,i,s),ai(e,i,s))}function Zb(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function mc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function mT(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var gT=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(mc()||Zb())&&r.dom.focus(),mT()&&!mc()&&!Zb()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(s&&t===null&&!Dm(n.state.selection))return o(),!0;const a=v5(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},bT=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),yT=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),x5=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&x5(r)}return t};function au(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return x5(n)}function tl(t,e,n){if(t instanceof Gi||t instanceof P)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return P.fromArray(t.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),tl("",e,n)}if(i){if(n.errorOnInvalidContent){let o=!1,a="";const l=new om({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?To.fromSchema(l).parseSlice(au(t),n.parseOptions):To.fromSchema(l).parse(au(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=To.fromSchema(e);return n.slice?s.parseSlice(au(t),n.parseOptions).content:s.parse(au(t),n.parseOptions)}return tl("",e,n)}function vT(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof At||i instanceof Ut))return;const s=t.mapping.maps[r];let o=0;s.forEach((a,l,u,c)=>{o===0&&(o=c)}),t.setSelection(fe.near(t.doc.resolve(o),n))}var xT=t=>!("type"in t),wT=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{tl(e,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(g){l(g)}try{a=tl(e,s.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:s.options.enableContentCheck})}catch(g){return l(g),!1}let{from:c,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},h=!0,f=!0;if((xT(a)?a:[a]).forEach(g=>{g.check(),h=h?g.isText&&g.marks.length===0:!1,f=f?g.isBlock:!1}),c===d&&f){const{parent:g}=r.doc.resolve(c);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(c-=1,d+=1)}let m;if(h){if(Array.isArray(e))m=e.map(g=>g.text||"").join("");else if(e instanceof P){let g="";e.forEach(y=>{y.text&&(g+=y.text)}),m=g}else typeof e=="object"&&e&&e.text?m=e.text:m=e;r.insertText(m,c,d)}else{m=a;const g=r.doc.resolve(c),y=g.node(),x=g.parentOffset===0,k=y.isText||y.isTextblock,C=y.content.size>0;x&&k&&C&&f&&(c=Math.max(0,c-1)),r.replaceWith(c,d,m)}n.updateSelection&&vT(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:m}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:m})}return!0},kT=()=>({state:t,dispatch:e})=>WC(t,e),ET=()=>({state:t,dispatch:e})=>GC(t,e),ST=()=>({state:t,dispatch:e})=>C6(t,e),CT=()=>({state:t,dispatch:e})=>M6(t,e),_T=()=>({state:t,dispatch:e,tr:n})=>{try{const r=I0(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},AT=()=>({state:t,dispatch:e,tr:n})=>{try{const r=I0(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},TT=()=>({state:t,dispatch:e})=>jC(t,e),MT=()=>({state:t,dispatch:e})=>VC(t,e);function w5(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function NT(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))mc()||w5()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var DT=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=NT(t).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const c=u.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function ns(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?Dt(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(d,h)=>{if(d.isText)return;const f=Math.max(r,h),p=Math.min(i,h+d.nodeSize);a.push({node:d,from:f,to:p})});const l=i-r,u=a.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>pc(d.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((d,h)=>d+h.to-h.from,0)>=l}var OT=(t,e={})=>({state:n,dispatch:r})=>{const i=Dt(t,n.schema);return ns(n,i,e)?KC(n,r):!1},RT=()=>({state:t,dispatch:e})=>R6(t,e),IT=t=>({state:e,dispatch:n})=>{const r=Dt(t,e.schema);return o_(r)(e,n)},LT=()=>({state:t,dispatch:e})=>D6(t,e);function U0(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Jb(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var zT=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=U0(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=Dt(t,r.schema)),a==="mark"&&(o=vi(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,d)=>{s&&s===c.type&&(l=!0,i&&n.setNodeMarkup(d,void 0,Jb(c.attrs,e))),o&&c.marks.length&&c.marks.forEach(h=>{o===h.type&&(l=!0,i&&n.addMark(d,d+c.nodeSize,o.create(Jb(h.attrs,e))))})})}),l},BT=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),FT=()=>({tr:t,dispatch:e})=>{if(e){const n=new En(t.doc);t.setSelection(n)}return!0},PT=()=>({state:t,dispatch:e})=>A6(t,e),$T=()=>({state:t,dispatch:e})=>N6(t,e),HT=()=>({state:t,dispatch:e})=>XC(t,e),UT=()=>({state:t,dispatch:e})=>t_(t,e),qT=()=>({state:t,dispatch:e})=>e_(t,e);function Wf(t,e,n={},r={}){return tl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var jT=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if(r.preserveWhitespace!=="full"){const u=Wf(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function k5(t,e){const n=vi(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function E5(t,e){const n=new cm(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Om(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function $s(t,e){const n=[];return t.descendants((r,i)=>{e(r)&&n.push({node:r,pos:i})}),n}function VT(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function S5(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function io(t){return e=>S5(e.$from,t)}function ce(t,e,n){return t.config[e]===void 0&&t.parent?ce(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ce(t.parent,e,n):null}):t.config[e]}function Rm(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=ce(e,"addExtensions",n);return r?[e,...Rm(r())]:e}).flat(10)}function Tl(t,e){const n=ro.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function C5(t){return typeof t=="function"}function qe(t,e=void 0,...n){return C5(t)?e?t.bind(e)(...n):t(...n):t}function WT(t={}){return Object.keys(t).length===0&&t.constructor===Object}function jo(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function _5(t){const e=[],{nodeExtensions:n,markExtensions:r}=jo(t),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(u=>u.name!=="text").map(u=>u.name),a=r.map(u=>u.name),l=[...o,...a];return t.forEach(u=>{const c={name:u.name,options:u.options,storage:u.storage,extensions:i},d=ce(u,"addGlobalAttributes",c);if(!d)return;d().forEach(f=>{let p;Array.isArray(f.types)?p=f.types:f.types==="*"?p=l:f.types==="nodes"?p=o:f.types==="marks"?p=a:p=[],p.forEach(m=>{Object.entries(f.attributes).forEach(([g,y])=>{e.push({type:m,name:g,attribute:{...s,...y}})})})})}),i.forEach(u=>{const c={name:u.name,options:u.options,storage:u.storage},d=ce(u,"addAttributes",c);if(!d)return;const h=d();Object.entries(h).forEach(([f,p])=>{const m={...s,...p};typeof(m==null?void 0:m.default)=="function"&&(m.default=m.default()),m!=null&&m.isRequired&&(m==null?void 0:m.default)===void 0&&delete m.default,e.push({type:u.name,name:f,attribute:m})})}),e}function GT(t){const e=[];let n="",r=!1,i=!1,s=0;const o=t.length;for(let a=0;a<o;a+=1){const l=t[a];if(l==="'"&&!i){r=!r,n+=l;continue}if(l==='"'&&!r){i=!i,n+=l;continue}if(!r&&!i){if(l==="("){s+=1,n+=l;continue}if(l===")"&&s>0){s-=1,n+=l;continue}if(l===";"&&s===0){e.push(n),n="";continue}}n+=l}return n&&e.push(n),e}function Xb(t){const e=[],n=GT(t||""),r=n.length;for(let i=0;i<r;i+=1){const s=n[i],o=s.indexOf(":");if(o===-1)continue;const a=s.slice(0,o).trim(),l=s.slice(o+1).trim();a&&l&&e.push([a,l])}return e}function ze(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const a=s?String(s).split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(c=>!l.includes(c));r[i]=[...l,...u].join(" ")}else if(i==="style"){const a=new Map([...Xb(r[i]),...Xb(s)]);r[i]=Array.from(a.entries()).map(([l,u])=>`${l}: ${u}`).join("; ")}else r[i]=s}),r},{})}function nl(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ze(n,r),{})}function KT(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Qb(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):KT(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function e2(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&WT(n)?!1:n!=null))}function t2(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function YT(t,e){var n;const r=_5(t),{nodeExtensions:i,markExtensions:s}=jo(t),o=(n=i.find(u=>ce(u,"topNode")))==null?void 0:n.name,a=Object.fromEntries(i.map(u=>{const c=r.filter(y=>y.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},h=t.reduce((y,x)=>{const k=ce(x,"extendNodeSchema",d);return{...y,...k?k(u):{}}},{}),f=e2({...h,content:qe(ce(u,"content",d)),marks:qe(ce(u,"marks",d)),group:qe(ce(u,"group",d)),inline:qe(ce(u,"inline",d)),atom:qe(ce(u,"atom",d)),selectable:qe(ce(u,"selectable",d)),draggable:qe(ce(u,"draggable",d)),code:qe(ce(u,"code",d)),whitespace:qe(ce(u,"whitespace",d)),linebreakReplacement:qe(ce(u,"linebreakReplacement",d)),defining:qe(ce(u,"defining",d)),isolating:qe(ce(u,"isolating",d)),attrs:Object.fromEntries(c.map(t2))}),p=qe(ce(u,"parseHTML",d));p&&(f.parseDOM=p.map(y=>Qb(y,c)));const m=ce(u,"renderHTML",d);m&&(f.toDOM=y=>m({node:y,HTMLAttributes:nl(y,c)}));const g=ce(u,"renderText",d);return g&&(f.toText=g),[u.name,f]})),l=Object.fromEntries(s.map(u=>{const c=r.filter(g=>g.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},h=t.reduce((g,y)=>{const x=ce(y,"extendMarkSchema",d);return{...g,...x?x(u):{}}},{}),f=e2({...h,inclusive:qe(ce(u,"inclusive",d)),excludes:qe(ce(u,"excludes",d)),group:qe(ce(u,"group",d)),spanning:qe(ce(u,"spanning",d)),code:qe(ce(u,"code",d)),attrs:Object.fromEntries(c.map(t2))}),p=qe(ce(u,"parseHTML",d));p&&(f.parseDOM=p.map(g=>Qb(g,c)));const m=ce(u,"renderHTML",d);return m&&(f.toDOM=g=>m({mark:g,HTMLAttributes:nl(g,c)})),[u.name,f]}));return new om({topNode:o,nodes:a,marks:l})}function ZT(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function za(t){return t.sort((n,r)=>{const i=ce(n,"priority")||100,s=ce(r,"priority")||100;return i>s?-1:i<s?1:0})}function A5(t){const e=za(Rm(t)),n=ZT(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function T5(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=`
444
+
445
+ `,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,c,d)=>{var h;l.isBlock&&u>r&&(a+=s);const f=o==null?void 0:o[l.type.name];if(f)return c&&(a+=f({node:l,pos:u,parent:c,index:d,range:e})),!1;l.isText&&(a+=(h=l==null?void 0:l.text)==null?void 0:h.slice(Math.max(r,u)-u,i-u))}),a}function M5(t,e){const n={from:0,to:t.content.size};return T5(t,n,e)}function Im(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function JT(t,e){const n=Dt(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function N5(t,e){const n=U0(typeof e=="string"?e:e.name,t.schema);return n==="node"?JT(t,e):n==="mark"?k5(t,e):{}}function XT(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function QT(t){const e=XT(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,o)=>o!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function D5(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const u=e.slice(s).map(a,-1),c=e.slice(s).map(l),d=e.invert().map(u,-1),h=e.invert().map(c);r.push({oldRange:{from:d,to:h},newRange:{from:u,to:c}})})}),QT(r)}function Lm(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=Nm(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}var eM=(t,e,n,r=20)=>{const i=t.doc.resolve(n);let s=r,o=null;for(;s>0&&o===null;){const a=i.node(s);(a==null?void 0:a.type.name)===e?o=a:s-=1}return[o,s]};function ya(t,e){return e.nodes[t]||e.marks[t]||null}function $u(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var tM=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,u;const c=((u=(l=i.type.spec).toText)==null?void 0:u.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,r-s))}),n};function Gf(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?vi(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>s?s.name===d.type.name:!0).find(d=>pc(d.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:d,$to:h})=>{const f=d.pos,p=h.pos;t.doc.nodesBetween(f,p,(m,g)=>{if(s&&m.inlineContent&&!m.type.allowsMarkType(s))return!1;if(!m.isText&&!m.marks.length)return;const y=Math.max(f,g),x=Math.min(p,g+m.nodeSize),k=x-y;o+=k,a.push(...m.marks.map(C=>({mark:C,from:y,to:x})))})}),o===0)return!1;const l=a.filter(d=>s?s.name===d.mark.type.name:!0).filter(d=>pc(d.mark.attrs,n,{strict:!1})).reduce((d,h)=>d+h.to-h.from,0),u=a.filter(d=>s?d.mark.type!==s&&d.mark.type.excludes(s):!0).reduce((d,h)=>d+h.to-h.from,0);return(l>0?l+u:l)>=o}function O5(t,e,n={}){if(!e)return ns(t,null,n)||Gf(t,null,n);const r=U0(e,t.schema);return r==="node"?ns(t,e,n):r==="mark"?Gf(t,e,n):!1}var nM=(t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const s=io(a=>a.type.name===e)(t.selection);if(!s)return!1;const o=t.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},rM=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function n2(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function eh(t,e){const{nodeExtensions:n}=jo(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=qe(ce(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function q0(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(q0(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function R5(t){return t instanceof ue}var zm=class I5{constructor(e){this.position=e}static fromJSON(e){return new I5(e.position)}toJSON(){return{position:this.position}}};function L5(t,e){const n=e.mapping.mapResult(t.position);return{position:new zm(n.pos),mapResult:n}}function iM(t){return new zm(t)}function z5(t,e,n){const i=t.state.doc.content.size,s=ai(e,0,i),o=ai(n,0,i),a=t.coordsAtPos(s),l=t.coordsAtPos(o,-1),u=Math.min(a.top,l.top),c=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),h=Math.max(a.right,l.right),f=h-d,p=c-u,y={top:u,bottom:c,left:d,right:h,width:f,height:p,x:d,y:u};return{...y,toJSON:()=>y}}function sM(t,e,n){var r;const{selection:i}=e;let s=null;if(Dm(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(u=>u.type.excludes(n)))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(c,d,h)=>{if(u)return!1;if(c.isInline){const f=!h||h.type.allowsMarkType(n),p=!!n.isInSet(c.marks)||!c.marks.some(m=>m.type.excludes(n));u=f&&p}return!u}),u})}var oM=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=vi(t,r.schema);if(i)if(o){const u=k5(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;r.doc.nodesBetween(c,d,(h,f)=>{const p=Math.max(f,c),m=Math.min(f+h.nodeSize,d);h.marks.find(y=>y.type===l)?h.marks.forEach(y=>{l===y.type&&n.addMark(p,m,l.create({...y.attrs,...e}))}):n.addMark(p,m,l.create(e))})});return sM(r,n,l)},aM=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),lM=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=Dt(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>mb(s,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>mb(s,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},uM=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=ai(t,0,r.content.size),s=ue.create(r,i);e.setSelection(s)}return!0},cM=(t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let o,a;return typeof e=="number"?(o=e,a=e):e&&"from"in e&&"to"in e?(o=e.from,a=e.to):(o=s.from,a=s.to),i&&n.doc.nodesBetween(o,a,(l,u)=>{l.isText||n.setNodeMarkup(u,void 0,{...l.attrs,dir:t})}),!0},dM=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=le.atStart(r).from,a=le.atEnd(r).to,l=ai(i,o,a),u=ai(s,o,a),c=le.create(r,l,u);e.setSelection(c)}return!0},hM=t=>({state:e,dispatch:n})=>{const r=Dt(t,e.schema);return u_(r)(e,n)};function r2(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}var fM=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,u=i.extensionManager.attributes,c=$u(u,a.node().type.name,a.node().attrs);if(s instanceof ue&&s.node.isBlock)return!a.parentOffset||!ui(o,a.pos)?!1:(r&&(t&&r2(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=a.depth===0?void 0:Om(a.node(-1).contentMatchAt(a.indexAfter(-1)));let f=d&&h?[{type:h,attrs:c}]:void 0,p=ui(e.doc,e.mapping.map(a.pos),1,f);if(!f&&!p&&ui(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(p=!0,f=h?[{type:h,attrs:c}]:void 0),r){if(p&&(s instanceof le&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,f),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const m=e.mapping.map(a.before()),g=e.doc.resolve(m);a.node(-1).canReplaceWith(g.index(),g.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&r2(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return p},pM=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=Dt(t,r.schema),{$from:l,$to:u}=r.selection,c=r.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(u))return!1;const d=l.node(-1);if(d.type!==a)return!1;const h=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let y=P.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let I=l.depth-x;I>=l.depth-3;I-=1)y=P.from(l.node(I).copy(y));const k=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,C={...$u(h,l.node().type.name,l.node().attrs),...e},_=((o=a.contentMatch.defaultType)==null?void 0:o.createAndFill(C))||void 0;y=y.append(P.from(a.createAndFill(null,_)||void 0));const T=l.before(l.depth-(x-1));n.replace(T,l.after(-k),new Z(y,4-x,0));let D=-1;n.doc.nodesBetween(T,n.doc.content.size,(I,L)=>{if(D>-1)return!1;I.isTextblock&&I.content.size===0&&(D=L+1)}),D>-1&&n.setSelection(le.near(n.doc.resolve(D))),n.scrollIntoView()}return!0}const f=u.pos===l.end()?d.contentMatchAt(0).defaultType:null,p={...$u(h,d.type.name,d.attrs),...e},m={...$u(h,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,u.pos);const g=f?[{type:a,attrs:p},{type:f,attrs:m}]:[{type:a,attrs:p}];if(!ui(n.doc,l.pos,2))return!1;if(i){const{selection:y,storedMarks:x}=r,{splittableMarks:k}=s.extensionManager,C=x||y.$to.parentOffset&&y.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!C||!i)return!0;const _=C.filter(T=>k.includes(T.type.name));n.ensureMarks(_)}return!0},th=(t,e)=>{const n=io(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&hs(t.doc,n.pos)&&t.join(n.pos),!0},nh=(t,e)=>{const n=io(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&hs(t.doc,r)&&t.join(r),!0};function mM(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),i=e.resolve(n.nodeSize-1);return le.between(r,i)}var gM=(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:d,splittableMarks:h}=i.extensionManager,f=Dt(t,o.schema),p=Dt(e,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:x}=m,k=y.blockRange(x),C=g||m.$to.parentOffset&&m.$from.marks();if(!k)return!1;const _=io(be=>eh(be.type.name,d))(m),T=m.from===0&&m.to===o.doc.content.size,D=o.doc.content.content,I=D.length===1?D[0]:null,L=T&&I&&eh(I.type.name,d)?{node:I,pos:0}:null,G=_??L,ie=!!_&&k.depth>=1&&k.depth-_.depth<=1,oe=!!L;if((ie||oe)&&G){if(G.node.type===f)return T&&oe?l().command(({tr:be,dispatch:Y})=>{const te=mM(be);return te?(be.setSelection(te),Y&&Y(be),!0):!1}).liftListItem(p).run():u.liftListItem(p);if(eh(G.node.type.name,d)&&f.validContent(G.node.content))return l().command(()=>(s.setNodeMarkup(G.pos,f),!0)).command(()=>th(s,f)).command(()=>nh(s,f)).run()}return!n||!C||!a?l().command(()=>c().wrapInList(f,r)?!0:u.clearNodes()).wrapInList(f,r).command(()=>th(s,f)).command(()=>nh(s,f)).run():l().command(()=>{const be=c().wrapInList(f,r),Y=C.filter(te=>h.includes(te.type.name));return s.ensureMarks(Y),be?!0:u.clearNodes()}).wrapInList(f,r).command(()=>th(s,f)).command(()=>nh(s,f)).run()},bM=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=vi(t,r.schema);return Gf(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},yM=(t,e,n={})=>({state:r,commands:i})=>{const s=Dt(t,r.schema),o=Dt(e,r.schema),a=ns(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},vM=(t,e={})=>({state:n,commands:r})=>{const i=Dt(t,n.schema);return ns(n,i,e)?r.lift(i):r.wrapIn(i,e)},xM=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const o=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},wM=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},kM=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=vi(t,r.schema),{$from:u,empty:c,ranges:d}=a;if(!i)return!0;if(c&&o){let{from:h,to:f}=a;const p=(s=u.marks().find(g=>g.type===l))==null?void 0:s.attrs,m=Nm(u,l,p);m&&(h=m.from,f=m.to),n.removeMark(h,f,l)}else d.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,l)});return n.removeStoredMark(l),!0},EM=t=>({tr:e,state:n,dispatch:r})=>{const{selection:i}=n;let s,o;return typeof t=="number"?(s=t,o=t):t&&"from"in t&&"to"in t?(s=t.from,o=t.to):(s=i.from,o=i.to),r&&e.doc.nodesBetween(s,o,(a,l)=>{if(a.isText)return;const u={...a.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},SM=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=U0(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=Dt(t,r.schema)),a==="mark"&&(o=vi(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;let h,f,p,m;n.selection.empty?r.doc.nodesBetween(c,d,(g,y)=>{s&&s===g.type&&(l=!0,p=Math.max(y,c),m=Math.min(y+g.nodeSize,d),h=y,f=g)}):r.doc.nodesBetween(c,d,(g,y)=>{y<c&&s&&s===g.type&&(l=!0,p=Math.max(y,c),m=Math.min(y+g.nodeSize,d),h=y,f=g),y>=c&&y<=d&&(s&&s===g.type&&(l=!0,i&&n.setNodeMarkup(y,void 0,{...g.attrs,...e})),o&&g.marks.length&&g.marks.forEach(x=>{if(o===x.type&&(l=!0,i)){const k=Math.max(y,c),C=Math.min(y+g.nodeSize,d);n.addMark(k,C,o.create({...x.attrs,...e}))}}))}),f&&(h!==void 0&&i&&n.setNodeMarkup(h,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(g=>{o===g.type&&i&&n.addMark(p,m,o.create({...g.attrs,...e}))}))}),l},CM=(t,e={})=>({state:n,dispatch:r})=>{const i=Dt(t,n.schema);return n_(i,e)(n,r)},_M=(t,e={})=>({state:n,dispatch:r})=>{const i=Dt(t,n.schema);return r_(i,e)(n,r)},AM=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Ml=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},TM=(t,e)=>{if(Mm(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function lu(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(e=u.nodeBefore||u.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let c=!1;const d=tM(u)+s;return o.forEach(h=>{if(c)return;const f=TM(d,h.find);if(!f)return;const p=l.state.tr,m=$0({state:l.state,transaction:p}),g={from:r-(f[0].length-s.length),to:i},{commands:y,chain:x,can:k}=new H0({editor:n,state:m});h.handler({state:m,range:g,match:f,commands:y,chain:x,can:k})===null||!p.steps.length||(h.undoable&&p.setMeta(a,{transform:p,from:r,to:i,text:s}),l.dispatch(p),c=!0)}),c}function MM(t){const{editor:e,rules:n}=t,r=new _e({state:{init(){return null},apply(i,s,o){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:c}=l;typeof c=="string"?c=c:c=Tl(P.from(c),o.schema);const{from:d}=l,h=d+c.length;lu({editor:e,from:d,to:h,text:c,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return lu({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&lu({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?lu({editor:e,from:o.pos,to:o.pos,text:`
446
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function NM(t){return Object.prototype.toString.call(t).slice(8,-1)}function uu(t){return NM(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function B5(t,e){const n={...t};return uu(t)&&uu(e)&&Object.keys(e).forEach(r=>{uu(e[r])&&uu(t[r])?n[r]=B5(t[r],e[r]):n[r]=e[r]}),n}var Bm=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...qe(ce(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...qe(ce(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>B5(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},gn=class F5 extends Bm{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new F5(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=o.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function DM(t){return typeof t=="number"}var OM=class{constructor(t){this.find=t.find,this.handler=t.handler}},RM=(t,e,n)=>{if(Mm(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function IM(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:u,can:c}=new H0({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,i,(f,p)=>{var m,g,y,x,k;if((g=(m=f.type)==null?void 0:m.spec)!=null&&g.code||!(f.isText||f.isTextblock||f.isInline))return;const C=(k=(x=(y=f.content)==null?void 0:y.size)!=null?x:f.nodeSize)!=null?k:0,_=Math.max(r,p),T=Math.min(i,p+C);if(_>=T)return;const D=f.isText?f.text||"":f.textBetween(_-p,T-p,void 0,"");RM(D,s.find,o).forEach(L=>{if(L.index===void 0)return;const G=_+L.index+1,ie=G+L[0].length,oe={from:n.tr.mapping.map(G),to:n.tr.mapping.map(ie)},be=s.handler({state:n,range:oe,match:L,commands:l,chain:u,can:c,pasteEvent:o,dropEvent:a});d.push(be)})}),d.every(f=>f!==null)}var cu=null,LM=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function zM(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:c,from:d,to:h,rule:f,pasteEvt:p})=>{const m=c.tr,g=$0({state:c,transaction:m});if(!(!IM({editor:e,state:g,from:Math.max(d-1,0),to:h.b-1,rule:f,pasteEvent:p,dropEvent:a})||!m.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(c=>new _e({view(d){const h=p=>{var m;r=(m=d.dom.parentElement)!=null&&m.contains(p.target)?d.dom.parentElement:null,r&&(cu=e)},f=()=>{cu&&(cu=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,h)=>{if(s=r===d.dom.parentElement,a=h,!s){const f=cu;f!=null&&f.isEditable&&setTimeout(()=>{const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(d,h)=>{var f;const p=(f=h.clipboardData)==null?void 0:f.getData("text/html");return o=h,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(d,h,f)=>{const p=d[0],m=p.getMeta("uiEvent")==="paste"&&!i,g=p.getMeta("uiEvent")==="drop"&&!s,y=p.getMeta("applyPasteRules"),x=!!y;if(!m&&!g&&!x)return;if(x){let{text:_}=y;typeof _=="string"?_=_:_=Tl(P.from(_),f.schema);const{from:T}=y,D=T+_.length,I=LM(_);return l({rule:c,state:f,from:T,to:{b:D},pasteEvt:I})}const k=h.doc.content.findDiffStart(f.doc.content),C=h.doc.content.findDiffEnd(f.doc.content);if(!(!DM(k)||!C||k===C.b))return l({rule:c,state:f,from:k,to:C,pasteEvt:o})}}))}var j0=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=A5(t),this.schema=YT(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:ya(e.name,this.schema)},r=ce(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return za([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:ya(r.name,this.schema)},s=[],o=ce(r,"addKeyboardShortcuts",i);let a={};if(r.type==="mark"&&ce(r,"exitable",i)&&(a.ArrowRight=()=>gn.handleExit({editor:t,mark:r})),o){const h=Object.fromEntries(Object.entries(o()).map(([f,p])=>[f,()=>p({editor:t})]));a={...a,...h}}const l=QA(a);s.push(l);const u=ce(r,"addInputRules",i);if(n2(r,t.options.enableInputRules)&&u){const h=u();if(h&&h.length){const f=MM({editor:t,rules:h}),p=Array.isArray(f)?f:[f];s.push(...p)}}const c=ce(r,"addPasteRules",i);if(n2(r,t.options.enablePasteRules)&&c){const h=c();if(h&&h.length){const f=zM({editor:t,rules:h});s.push(...f)}}const d=ce(r,"addProseMirrorPlugins",i);if(d){const h=d();s.push(...h)}return s})}get attributes(){return _5(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=jo(this.extensions);return Object.fromEntries(e.filter(n=>!!ce(n,"addNodeView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Dt(n.name,this.schema)},s=ce(n,"addNodeView",i);if(!s)return[];const o=s();if(!o)return[];const a=(l,u,c,d,h)=>{const f=nl(l,r);return o({node:l,view:u,getPos:c,decorations:d,innerDecorations:h,editor:t,extension:n,HTMLAttributes:f})};return[n.name,a]}))}dispatchTransaction(t){const{editor:e}=this;return za([...this.extensions].reverse()).reduceRight((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:ya(i.name,this.schema)},o=ce(i,"dispatchTransaction",s);return o?a=>{o.call(s,{transaction:a,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return za([...this.extensions]).reduce((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:ya(i.name,this.schema)},o=ce(i,"transformPastedHTML",s);return o?(a,l)=>{const u=r(a,l);return o.call(s,u)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=jo(this.extensions);return Object.fromEntries(e.filter(n=>!!ce(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:vi(n.name,this.schema)},s=ce(n,"addMarkView",i);if(!s)return[];const o=(a,l,u)=>{const c=nl(a,r);return s()({mark:a,view:l,inline:u,editor:t,extension:n,HTMLAttributes:c,updateAttributes:d=>{ZM(a,t,d)}})};return[n.name,o]}))}destroy(){this.extensions.forEach(t=>{let e=t;for(;e.parent;){const n=e.parent;n.child===e&&(n.child=null),e=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:ya(e.name,this.schema)};e.type==="mark"&&((n=qe(ce(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const i=ce(e,"onBeforeCreate",r),s=ce(e,"onCreate",r),o=ce(e,"onUpdate",r),a=ce(e,"onSelectionUpdate",r),l=ce(e,"onTransaction",r),u=ce(e,"onFocus",r),c=ce(e,"onBlur",r),d=ce(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}};j0.resolve=A5;j0.sort=za;j0.flatten=Rm;var P5={};Tm(P5,{ClipboardTextSerializer:()=>H5,Commands:()=>U5,Delete:()=>q5,Drop:()=>j5,Editable:()=>V5,FocusEvents:()=>G5,Keymap:()=>K5,Paste:()=>Y5,Tabindex:()=>Z5,TextDirection:()=>J5,focusEventsPluginKey:()=>W5});var Se=class $5 extends Bm{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new $5(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},H5=Se.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new _e({key:new Ae("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(c=>c.$from.pos)),a=Math.max(...s.map(c=>c.$to.pos)),l=Im(n);return T5(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),U5=Se.create({name:"commands",addCommands(){return{...b5}}}),q5=Se.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,i;const s=()=>{var o,a,l,u;if((u=(l=(a=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?u:t.getMeta("y-sync$"))return;const c=E5(t.before,[t,...e]);D5(c).forEach(f=>{c.mapping.mapResult(f.oldRange.from).deletedAfter&&c.mapping.mapResult(f.oldRange.to).deletedBefore&&c.before.nodesBetween(f.oldRange.from,f.oldRange.to,(p,m)=>{const g=m+p.nodeSize-2,y=f.oldRange.from<=m&&g<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:m,to:g,newFrom:c.mapping.map(m),newTo:c.mapping.map(g),deletedRange:f.oldRange,newRange:f.newRange,partial:!y,editor:this.editor,transaction:t,combinedTransform:c})})});const h=c.mapping;c.steps.forEach((f,p)=>{var m,g;if(f instanceof cr){const y=h.slice(p).map(f.from,-1),x=h.slice(p).map(f.to),k=h.invert().map(y,-1),C=h.invert().map(x),_=y>0?(m=c.doc.nodeAt(y-1))==null?void 0:m.marks.some(D=>D.eq(f.mark)):!1,T=(g=c.doc.nodeAt(x))==null?void 0:g.marks.some(D=>D.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:k,to:C},newRange:{from:y,to:x},partial:!!(T||_),editor:this.editor,transaction:t,combinedTransform:c})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(s,0):s()}}),j5=Se.create({name:"drop",addProseMirrorPlugins(){return[new _e({key:new Ae("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),V5=Se.create({name:"editable",addProseMirrorPlugins(){return[new _e({key:new Ae("editable"),props:{editable:()=>this.editor.options.editable}})]}}),W5=new Ae("focusEvents"),G5=Se.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new _e({key:W5,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),K5=Se.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:c,$anchor:d}=l,{pos:h,parent:f}=d,p=d.parent.isTextblock&&h>0?a.doc.resolve(h-1):d,m=p.parent.type.spec.isolating,g=d.pos-d.parentOffset,y=m&&p.parent.childCount===1?g===d.pos:fe.atStart(u).from===h;return!c||!f.type.isTextblock||f.textContent.length||!y||y&&d.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return mc()||w5()?s:i},addProseMirrorPlugins(){return[new _e({key:new Ae("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(m=>m.getMeta("composition")))return;const r=t.some(m=>m.docChanged)&&!e.doc.eq(n.doc),i=t.some(m=>m.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=e.selection,l=fe.atStart(e.doc).from,u=fe.atEnd(e.doc).to;if(s||!(o===l&&a===u)||!q0(n.doc))return;const h=n.tr,f=$0({state:n,transaction:h}),{commands:p}=new H0({editor:this.editor,state:f});if(p.clearNodes(),!!h.steps.length)return h}})]}}),Y5=Se.create({name:"paste",addProseMirrorPlugins(){return[new _e({key:new Ae("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Z5=Se.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new _e({key:new Ae("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),J5=Se.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=jo(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new _e({key:new Ae("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),BM=class Ta{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Ta(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Ta(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Ta(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=n.isInline,a=this.pos+r+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!i&&!o&&l.depth<=this.depth)return;const u=new Ta(l,this.editor,i,i||o?n:null);i&&(u.actualDepth=this.depth+1),e.push(u)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(l=>n[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},FM=`.ProseMirror {
447
+ position: relative;
448
+ }
449
+
450
+ .ProseMirror {
451
+ word-wrap: break-word;
452
+ white-space: pre-wrap;
453
+ white-space: break-spaces;
454
+ -webkit-font-variant-ligatures: none;
455
+ font-variant-ligatures: none;
456
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
457
+ }
458
+
459
+ .ProseMirror [contenteditable="false"] {
460
+ white-space: normal;
461
+ }
462
+
463
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
464
+ white-space: pre-wrap;
465
+ }
466
+
467
+ .ProseMirror pre {
468
+ white-space: pre-wrap;
469
+ }
470
+
471
+ img.ProseMirror-separator {
472
+ display: inline !important;
473
+ border: none !important;
474
+ margin: 0 !important;
475
+ width: 0 !important;
476
+ height: 0 !important;
477
+ }
478
+
479
+ .ProseMirror-gapcursor {
480
+ display: none;
481
+ pointer-events: none;
482
+ position: absolute;
483
+ margin: 0;
484
+ }
485
+
486
+ .ProseMirror-gapcursor:after {
487
+ content: "";
488
+ display: block;
489
+ position: absolute;
490
+ top: -2px;
491
+ width: 20px;
492
+ border-top: 1px solid black;
493
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
494
+ }
495
+
496
+ @keyframes ProseMirror-cursor-blink {
497
+ to {
498
+ visibility: hidden;
499
+ }
500
+ }
501
+
502
+ .ProseMirror-hideselection *::selection {
503
+ background: transparent;
504
+ }
505
+
506
+ .ProseMirror-hideselection *::-moz-selection {
507
+ background: transparent;
508
+ }
509
+
510
+ .ProseMirror-hideselection * {
511
+ caret-color: transparent;
512
+ }
513
+
514
+ .ProseMirror-focused .ProseMirror-gapcursor {
515
+ display: block;
516
+ }`;function PM(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var $M=class extends AM{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:L5,createMappablePosition:iM},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:s})=>this.options.onDrop(r,i,s)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=v5(e,this.options.autofocus);this.editorState=_o.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=PM(FM,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=C5(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(o=>!o.key.startsWith(s))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e,n,r;const s=[...this.options.enableCoreExtensions?[V5,H5.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),U5,G5,K5,Z5.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),j5,Y5,q5,J5.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new j0(s,this)}createCommandManager(){this.commandManager=new H0({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Wf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=Wf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,s=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(s);this.editorView=new g5(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(u=>{var c;return(c=this.capturedTransaction)==null?void 0:c.step(u)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),i=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),a=o==null?void 0:o.getMeta("focus"),l=o==null?void 0:o.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return N5(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return O5(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Tl(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
517
+
518
+ `,textSerializers:n={}}=t||{};return M5(this.state.doc,{blockSeparator:e,textSerializers:{...Im(this.schema),...n}})}get isEmpty(){return q0(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new BM(e,this)}get $doc(){return this.$pos(0)}};function Ks(t){return new Ml({find:t.find,handler:({state:e,range:n,match:r})=>{const i=qe(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),u=n.from+a.indexOf(o),c=u+o.length;if(Lm(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(m=>m===t.type&&m!==f.mark.type)).filter(f=>f.to>u).length)return null;c<n.to&&s.delete(c,n.to),u>n.from&&s.delete(n.from+l,u);const h=n.from+l+o.length;s.addMark(n.from+l,h,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function X5(t){return new Ml({find:t.find,handler:({state:e,range:n,match:r})=>{const i=qe(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let c=o+u;c>a?c=a:a=c+r[1].length;const d=r[0][r[0].length-1];s.insertText(d,o+r[0].length-1),s.replaceWith(c,a,l)}else if(r[0]){const u=t.type.isInline?o:o-1;s.insert(u,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()},undoable:t.undoable})}function gc(t){return new Ml({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=qe(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function wt(t){return new Ml({find:t.find,handler:({state:e,range:n,match:r})=>{let i=t.replace,s=n.from;const o=n.to;if(r[1]){const a=r[0].lastIndexOf(r[1]);i+=r[0].slice(a+r[1].length),s+=a;const l=s-o;l>0&&(i=r[0].slice(a-l,a)+i,s=o)}e.tr.insertText(i,s,o)},undoable:t.undoable})}function Vo(t){return new Ml({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=qe(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),u=l&&um(l,t.type,s);if(!u)return null;if(o.wrap(l,u),t.keepMarks&&t.editor){const{selection:d,storedMarks:h}=e,{splittableMarks:f}=t.editor.extensionManager,p=h||d.$to.parentOffset&&d.$from.marks();if(p){const m=p.filter(g=>f.includes(g.type.name));o.ensureMarks(m)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,s).run()}const c=o.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&hs(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&o.join(n.from-1)},undoable:t.undoable})}var HM=t=>"touches"in t,UM=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=a=>{if(!this.isResizing||!this.activeHandle)return;const l=a.clientX-this.startX,u=a.clientY-this.startY;this.handleResize(l,u)},this.handleTouchMove=a=>{if(!this.isResizing||!this.activeHandle)return;const l=a.touches[0];if(!l)return;const u=l.clientX-this.startX,c=l.clientY-this.startY;this.handleResize(u,c)},this.handleMouseUp=()=>{if(!this.isResizing)return;const a=this.element.offsetWidth,l=this.element.offsetHeight;this.onCommit(a,l),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=a=>{a.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=a=>{a.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,n,r,i,s,o;this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(e=t.options)!=null&&e.min&&(this.minSize={...this.minSize,...t.options.min}),(n=t.options)!=null&&n.max&&(this.maxSize=t.options.max),(r=t==null?void 0:t.options)!=null&&r.directions&&(this.directions=t.options.directions),(i=t.options)!=null&&i.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(s=t.options)!=null&&s.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(o=t.options)!=null&&o.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return(t=this.contentElement)!=null?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,n){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,n):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const n=e.includes("top"),r=e.includes("bottom"),i=e.includes("left"),s=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),i&&(t.style.left="0"),s&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",n=>this.handleResizeStart(n,t)),e.addEventListener("touchstart",n=>this.handleResizeStart(n,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,HM(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,t,e),s=this.applyConstraints(r,i,n);this.element.style.width=`${s.width}px`,this.element.style.height=`${s.height}px`,this.onResize&&this.onResize(s.width,s.height)}calculateNewDimensions(t,e,n){let r=this.startWidth,i=this.startHeight;const s=t.includes("right"),o=t.includes("left"),a=t.includes("bottom"),l=t.includes("top");return s?r=this.startWidth+e:o&&(r=this.startWidth-e),a?i=this.startHeight+n:l&&(i=this.startHeight-n),(t==="right"||t==="left")&&(r=this.startWidth+(s?e:-e)),(t==="top"||t==="bottom")&&(i=this.startHeight+(a?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,t):{width:r,height:i}}applyConstraints(t,e,n){var r,i,s,o;if(!n){let u=Math.max(this.minSize.width,t),c=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(u=Math.min(this.maxSize.width,u)),(i=this.maxSize)!=null&&i.height&&(c=Math.min(this.maxSize.height,c)),{width:u,height:c}}let a=t,l=e;return a<this.minSize.width&&(a=this.minSize.width,l=a/this.aspectRatio),l<this.minSize.height&&(l=this.minSize.height,a=l*this.aspectRatio),(s=this.maxSize)!=null&&s.width&&a>this.maxSize.width&&(a=this.maxSize.width,l=a/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&l>this.maxSize.height&&(l=this.maxSize.height,a=l*this.aspectRatio),{width:a,height:l}}applyAspectRatio(t,e,n){const r=n==="left"||n==="right",i=n==="top"||n==="bottom";return r?{width:t,height:t/this.aspectRatio}:i?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function qM(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof ue){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function sa(t,e){const n=t.getAttribute("style");if(!n)return null;const r=n.split(";").map(s=>s.trim()).filter(Boolean),i=e.toLowerCase();for(let s=r.length-1;s>=0;s-=1){const o=r[s],a=o.indexOf(":");if(a===-1)continue;if(o.slice(0,a).trim().toLowerCase()===i)return o.slice(a+1).trim()}return null}function jM(){return typeof navigator<"u"?/Firefox/.test(navigator.userAgent):!1}var VM={};Tm(VM,{createAtomBlockMarkdownSpec:()=>WM,createBlockMarkdownSpec:()=>V0,createInlineMarkdownSpec:()=>YM,parseAttributes:()=>Fm,parseIndentedBlocks:()=>Kf,renderNestedMarkdownContent:()=>$m,serializeAttributes:()=>Pm});function Fm(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,u=>(n.push(u),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const u=i.map(c=>c.trim().slice(1));e.class=u.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,u,c])=>{var d;const h=parseInt(((d=c.match(/__QUOTED_(\d+)__/))==null?void 0:d[1])||"0",10),f=n[h];f&&(e[u]=f.slice(1,-1))});const l=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(c=>{c.match(/^[a-zA-Z][\w-]*$/)&&(e[c]=!0)}),e}function Pm(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function WM(t){const{nodeName:e,name:n,parseAttributes:r=Fm,serializeAttributes:i=Pm,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=t,l=n||e,u=c=>{if(!a)return c;const d={};return a.forEach(h=>{h in c&&(d[h]=c[h])}),d};return{parseMarkdown:(c,d)=>{const h={...s,...c.attributes};return d.createNode(e,h,[])},markdownTokenizer:{name:e,level:"block",start(c){var d;const h=new RegExp(`^:::${l}(?:\\s|$)`,"m"),f=(d=c.match(h))==null?void 0:d.index;return f!==void 0?f:-1},tokenize(c,d,h){const f=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=c.match(f);if(!p)return;const m=p[1]||"",g=r(m);if(!o.find(x=>!(x in g)))return{type:e,raw:p[0],attributes:g}}},renderMarkdown:c=>{const d=u(c.attrs||{}),h=i(d),f=h?` {${h}}`:"";return`:::${l}${f} :::`}}}function V0(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=Fm,serializeAttributes:s=Pm,defaultAttributes:o={},content:a="block",allowedAttributes:l}=t,u=n||e,c=d=>{if(!l)return d;const h={};return l.forEach(f=>{f in d&&(h[f]=d[f])}),h};return{parseMarkdown:(d,h)=>{let f;if(r){const m=r(d);f=typeof m=="string"?[{type:"text",text:m}]:m}else a==="block"?f=h.parseChildren(d.tokens||[]):f=h.parseInline(d.tokens||[]);const p={...o,...d.attributes};return h.createNode(e,p,f)},markdownTokenizer:{name:e,level:"block",start(d){var h;const f=new RegExp(`^:::${u}`,"m"),p=(h=d.match(f))==null?void 0:h.index;return p!==void 0?p:-1},tokenize(d,h,f){var p;const m=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=d.match(m);if(!g)return;const[y,x=""]=g,k=i(x);let C=1;const _=y.length;let T="";const D=/^:::([\w-]*)(\s.*)?/gm,I=d.slice(_);for(D.lastIndex=0;;){const L=D.exec(I);if(L===null)break;const G=L.index,ie=L[1];if(!((p=L[2])!=null&&p.endsWith(":::"))){if(ie)C+=1;else if(C-=1,C===0){const oe=I.slice(0,G);T=oe.trim();const be=d.slice(0,_+G+L[0].length);let Y=[];if(T)if(a==="block")for(Y=f.blockTokens(oe),Y.forEach(te=>{te.text&&(!te.tokens||te.tokens.length===0)&&(te.tokens=f.inlineTokens(te.text))});Y.length>0;){const te=Y[Y.length-1];if(te.type==="paragraph"&&(!te.text||te.text.trim()===""))Y.pop();else break}else Y=f.inlineTokens(T);return{type:e,raw:be,attributes:k,content:T,tokens:Y}}}}}},renderMarkdown:(d,h)=>{const f=c(d.attrs||{}),p=s(f),m=p?` {${p}}`:"",g=h.renderChildren(d.content||[],`
519
+
520
+ `);return`:::${u}${m}
521
+
522
+ ${g}
523
+
524
+ :::`}}}function GM(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,i,s,o]=r;e[i]=s||o,r=n.exec(t)}return e}function KM(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function YM(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=GM,serializeAttributes:s=KM,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=t,u=n||e,c=h=>{if(!l)return h;const f={};return l.forEach(p=>{const m=typeof p=="string"?p:p.name,g=typeof p=="string"?void 0:p.skipIfDefault;if(m in h){const y=h[m];if(g!==void 0&&y===g)return;f[m]=y}}),f},d=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(h,f)=>{const p={...o,...h.attributes};if(a)return f.createNode(e,p);const m=r?r(h):h.content||"";return m?f.createNode(e,p,[f.createTextNode(m)]):f.createNode(e,p,[])},markdownTokenizer:{name:e,level:"inline",start(h){const f=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),p=h.match(f),m=p==null?void 0:p.index;return m!==void 0?m:-1},tokenize(h,f,p){const m=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),g=h.match(m);if(!g)return;let y="",x="";if(a){const[,C]=g;x=C}else{const[,C,_]=g;x=C,y=_||""}const k=i(x.trim());return{type:e,raw:g[0],content:y.trim(),attributes:k}}},renderMarkdown:h=>{let f="";r?f=r(h):h.content&&h.content.length>0&&(f=h.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const p=c(h.attrs||{}),m=s(p),g=m?` ${m}`:"";return a?`[${u}${g}]`:`[${u}${g}]${f}[/${u}]`}}}function Kf(t,e,n){var r,i,s,o;const a=t.split(`
525
+ `),l=[];let u="",c=0;const d=e.baseIndentSize||2;for(;c<a.length;){const h=a[c],f=h.match(e.itemPattern);if(!f){if(l.length>0)break;if(h.trim()===""){c+=1,u=`${u}${h}
526
+ `;continue}else return}const p=e.extractItemData(f),{indentLevel:m,mainContent:g}=p;u=`${u}${h}
527
+ `;const y=[g];for(c+=1;c<a.length;){const _=a[c];if(_.trim()===""){const D=a.slice(c+1).findIndex(G=>G.trim()!=="");if(D===-1)break;if((((i=(r=a[c+1+D].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>m){y.push(_),u=`${u}${_}
528
+ `,c+=1;continue}else break}if((((o=(s=_.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:o.length)||0)>m)y.push(_),u=`${u}${_}
529
+ `,c+=1;else break}let x;const k=y.slice(1);if(k.length>0){const _=k.map(T=>T.slice(m+d)).join(`
530
+ `);_.trim()&&(e.customNestedParser?x=e.customNestedParser(_):x=n.blockTokens(_))}const C=e.createToken(p,x);l.push(C)}if(l.length!==0)return{items:l,raw:u}}function $m(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(r):n,[s,...o]=t.content,a=e.renderChildren([s]);let l=`${i}${a}`;return o&&o.length>0&&o.forEach((u,c)=>{var d,h;const f=(h=(d=e.renderChild)==null?void 0:d.call(e,u,c+1))!=null?h:e.renderChildren([u]);if(f!=null){const p=f.split(`
531
+ `).map(m=>m?e.indent(m):e.indent("")).join(`
532
+ `);l+=u.type==="paragraph"?`
533
+
534
+ ${p}`:`
535
+ ${p}`}}),l}function ZM(t,e,n={}){const{state:r}=e,{doc:i,tr:s}=r,o=t;i.descendants((a,l)=>{const u=s.mapping.map(l),c=s.mapping.map(l)+a.nodeSize;let d=null;if(a.marks.forEach(f=>{if(f!==o)return!1;d=f}),!d)return;let h=!1;if(Object.keys(n).forEach(f=>{n[f]!==d.attrs[f]&&(h=!0)}),h){const f=t.type.create({...t.attrs,...n});s.removeMark(u,c,t.type),s.addMark(u,c,f)}}),s.docChanged&&e.view.dispatch(s)}var Oe=class Q5 extends Bm{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new Q5(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function rs(t){return new OM({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=qe(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const c=l.search(/\S/),d=n.from+l.indexOf(a),h=d+a.length;if(Lm(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>d).length)return null;h<n.to&&o.delete(h,n.to),d>n.from&&o.delete(n.from+c,d),u=n.from+c+a.length,o.addMark(n.from+c,u,t.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:JM,getOwnPropertySymbols:XM}=Object,{hasOwnProperty:QM}=Object.prototype;function rh(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function du(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);const{cache:s}=i,o=s.get(n),a=s.get(r);if(o&&a)return o===r&&a===n;s.set(n,r),s.set(r,n);const l=t(n,r,i);return s.delete(n),s.delete(r),l}}function eN(t){return t!=null?t[Symbol.toStringTag]:void 0}function i2(t){return JM(t).concat(XM(t))}const tN=Object.hasOwn||((t,e)=>QM.call(t,e));function so(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const nN="__v",rN="__o",iN="_owner",{getOwnPropertyDescriptor:s2,keys:o2}=Object;function sN(t,e){return t.byteLength===e.byteLength&&bc(new Uint8Array(t),new Uint8Array(e))}function oN(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function aN(t,e){return t.byteLength===e.byteLength&&bc(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function lN(t,e){return so(t.getTime(),e.getTime())}function uN(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function cN(t,e){return t===e}function a2(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=t.entries();let o,a,l=0;for(;(o=s.next())&&!o.done;){const u=e.entries();let c=!1,d=0;for(;(a=u.next())&&!a.done;){if(i[d]){d++;continue}const h=o.value,f=a.value;if(n.equals(h[0],f[0],l,d,t,e,n)&&n.equals(h[1],f[1],h[0],f[0],t,e,n)){c=i[d]=!0;break}d++}if(!c)return!1;l++}return!0}const dN=so;function hN(t,e,n){const r=o2(t);let i=r.length;if(o2(e).length!==i)return!1;for(;i-- >0;)if(!ev(t,e,n,r[i]))return!1;return!0}function va(t,e,n){const r=i2(t);let i=r.length;if(i2(e).length!==i)return!1;let s,o,a;for(;i-- >0;)if(s=r[i],!ev(t,e,n,s)||(o=s2(t,s),a=s2(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function fN(t,e){return so(t.valueOf(),e.valueOf())}function pN(t,e){return t.source===e.source&&t.flags===e.flags}function l2(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=t.values();let o,a;for(;(o=s.next())&&!o.done;){const l=e.values();let u=!1,c=0;for(;(a=l.next())&&!a.done;){if(!i[c]&&n.equals(o.value,a.value,o.value,a.value,t,e,n)){u=i[c]=!0;break}c++}if(!u)return!1}return!0}function bc(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function mN(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function ev(t,e,n,r){return(r===iN||r===rN||r===nN)&&(t.$$typeof||e.$$typeof)?!0:tN(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const gN="[object ArrayBuffer]",bN="[object Arguments]",yN="[object Boolean]",vN="[object DataView]",xN="[object Date]",wN="[object Error]",kN="[object Map]",EN="[object Number]",SN="[object Object]",CN="[object RegExp]",_N="[object Set]",AN="[object String]",TN={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},MN="[object URL]",NN=Object.prototype.toString;function DN({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:f,unknownTagComparators:p}){return function(g,y,x){if(g===y)return!0;if(g==null||y==null)return!1;const k=typeof g;if(k!==typeof y)return!1;if(k!=="object")return k==="number"?a(g,y,x):k==="function"?s(g,y,x):!1;const C=g.constructor;if(C!==y.constructor)return!1;if(C===Object)return l(g,y,x);if(Array.isArray(g))return e(g,y,x);if(C===Date)return r(g,y,x);if(C===RegExp)return c(g,y,x);if(C===Map)return o(g,y,x);if(C===Set)return d(g,y,x);const _=NN.call(g);if(_===xN)return r(g,y,x);if(_===CN)return c(g,y,x);if(_===kN)return o(g,y,x);if(_===_N)return d(g,y,x);if(_===SN)return typeof g.then!="function"&&typeof y.then!="function"&&l(g,y,x);if(_===MN)return f(g,y,x);if(_===wN)return i(g,y,x);if(_===bN)return l(g,y,x);if(TN[_])return h(g,y,x);if(_===gN)return t(g,y,x);if(_===vN)return n(g,y,x);if(_===yN||_===EN||_===AN)return u(g,y,x);if(p){let T=p[_];if(!T){const D=eN(g);D&&(T=p[D])}if(T)return T(g,y,x)}return!1}}function ON({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:sN,areArraysEqual:n?va:oN,areDataViewsEqual:aN,areDatesEqual:lN,areErrorsEqual:uN,areFunctionsEqual:cN,areMapsEqual:n?rh(a2,va):a2,areNumbersEqual:dN,areObjectsEqual:n?va:hN,arePrimitiveWrappersEqual:fN,areRegExpsEqual:pN,areSetsEqual:n?rh(l2,va):l2,areTypedArraysEqual:n?rh(bc,va):bc,areUrlsEqual:mN,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const i=du(r.areArraysEqual),s=du(r.areMapsEqual),o=du(r.areObjectsEqual),a=du(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:a})}return r}function RN(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function IN({circular:t,comparator:e,createState:n,equals:r,strict:i}){if(n)return function(a,l){const{cache:u=t?new WeakMap:void 0,meta:c}=n();return e(a,l,{cache:u,equals:r,meta:c,strict:i})};if(t)return function(a,l){return e(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(a,l){return e(a,l,s)}}const LN=ps();ps({strict:!0});ps({circular:!0});ps({circular:!0,strict:!0});ps({createInternalComparator:()=>so});ps({strict:!0,createInternalComparator:()=>so});ps({circular:!0,createInternalComparator:()=>so});ps({circular:!0,createInternalComparator:()=>so,strict:!0});function ps(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:i=!1}=t,s=ON(t),o=DN(s),a=n?n(o):RN(o);return IN({circular:e,comparator:o,createState:r,equals:a,strict:i})}var ih={exports:{}},sh={};/**
536
+ * @license React
537
+ * use-sync-external-store-shim/with-selector.production.js
538
+ *
539
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
540
+ *
541
+ * This source code is licensed under the MIT license found in the
542
+ * LICENSE file in the root directory of this source tree.
543
+ */var u2;function zN(){if(u2)return sh;u2=1;var t=f7(),e=p7();function n(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;return sh.useSyncExternalStoreWithSelector=function(u,c,d,h,f){var p=s(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function y(T){if(!x){if(x=!0,k=T,T=h(T),f!==void 0&&m.hasValue){var D=m.value;if(f(D,T))return C=D}return C=T}if(D=C,r(k,T))return D;var I=h(T);return f!==void 0&&f(D,I)?(k=T,D):(k=T,C=I)}var x=!1,k,C,_=d===void 0?null:d;return[function(){return y(c())},_===null?void 0:function(){return y(_())}]},[c,d,h,f]);var g=i(u,p[0],p[1]);return o(function(){m.hasValue=!0,m.value=g},[g]),l(g),g},sh}var c2;function BN(){return c2||(c2=1,ih.exports=zN()),ih.exports}var FN=BN(),PN=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},$N=({contentComponent:t})=>{const e=y3.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return S.jsx(S.Fragment,{children:Object.values(e)})};function HN(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:m7.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}var UN=class extends pi.Component{constructor(t){super(t),this.editorContentRef=pi.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=HN(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var t;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:PN(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&S.jsx($N,{contentComponent:t.contentComponent})]})}},qN=B.forwardRef((t,e)=>{const n=pi.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return pi.createElement(UN,{key:n,innerRef:e,...t})}),tv=pi.memo(qN),jN=typeof window<"u"?B.useLayoutEffect:B.useEffect,VN=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function WN(t){var e;const[n]=B.useState(()=>new VN(t.editor)),r=FN.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:LN);return jN(()=>n.watch(t.editor),[t.editor,n]),B.useDebugValue(r),r}var nv=typeof window>"u",GN=nv||!!(typeof window<"u"&&window.next),KN=class rv{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){var e;let n=(e=this.options.current.immediatelyRender)!=null?e:!0;return n&&(nv||GN)&&(n=!1),n?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...r)},onDelete:(...r)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...r)}};return new $M(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((i,s)=>{var o;return i===((o=n.extensions)==null?void 0:o[s])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?rv.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function YN(t={},e=[]){const n=B.useRef(t);n.current=t;const[r]=B.useState(()=>new KN(n)),i=y3.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return B.useDebugValue(i),B.useEffect(r.onRender(e)),WN({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&s===0?0:s+1}),i}var Hm=B.createContext({editor:null});Hm.Consumer;var iv=()=>B.useContext(Hm),ZN=B.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),JN=()=>B.useContext(ZN);pi.forwardRef((t,e)=>{const{onDragStart:n}=JN(),r=t.as||"div";return S.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});pi.createContext({markViewContentRef:()=>{}});var Um=B.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Um.displayName="TiptapContext";var XN=()=>B.useContext(Um);function sv({editor:t,instance:e,children:n}){const r=t??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const i=B.useMemo(()=>({editor:r}),[r]),s=B.useMemo(()=>({editor:r}),[r]);return S.jsx(Hm.Provider,{value:s,children:S.jsx(Um.Provider,{value:i,children:n})})}sv.displayName="Tiptap";function ov({...t}){const{editor:e}=XN();return S.jsx(tv,{editor:e,...t})}ov.displayName="Tiptap.Content";Object.assign(sv,{Content:ov});let Yf,Zf;if(typeof WeakMap<"u"){let t=new WeakMap;Yf=e=>t.get(e),Zf=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Yf=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Zf=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var xt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,i=e/this.width|0;let s=r+1,o=i+1;for(let a=1;s<this.width&&this.map[e+a]==n;a++)s++;for(let a=1;o<this.height&&this.map[e+this.width*a]==n;a++)o++;return{left:r,top:i,right:s,bottom:o}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:i,top:s,bottom:o}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[s*this.width+(n<0?r-1:i)]:(n<0?s==0:o==this.height)?null:this.map[r+this.width*(n<0?s-1:o)]}rectBetween(t,e){const{left:n,right:r,top:i,bottom:s}=this.findCell(t),{left:o,right:a,top:l,bottom:u}=this.findCell(e);return{left:Math.min(n,o),top:Math.min(i,l),right:Math.max(r,a),bottom:Math.max(s,u)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){const s=r*this.width+i,o=this.map[s];n[o]||(n[o]=!0,!(i==t.left&&i&&this.map[s-1]==o||r==t.top&&r&&this.map[s-this.width]==o)&&e.push(o))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){const s=i+n.child(r).nodeSize;if(r==t){let o=e+t*this.width;const a=(t+1)*this.width;for(;o<a&&this.map[o]<i;)o++;return o==a?s-1:this.map[o]}i=s}}static get(t){return Yf(t)||Zf(t,QN(t))}};function QN(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=eD(t),n=t.childCount,r=[];let i=0,s=null;const o=[];for(let u=0,c=e*n;u<c;u++)r[u]=0;for(let u=0,c=0;u<n;u++){const d=t.child(u);c++;for(let p=0;;p++){for(;i<r.length&&r[i]!=0;)i++;if(p==d.childCount)break;const m=d.child(p),{colspan:g,rowspan:y,colwidth:x}=m.attrs;for(let k=0;k<y;k++){if(k+u>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:c,n:y-k});break}const C=i+k*e;for(let _=0;_<g;_++){r[C+_]==0?r[C+_]=c:(s||(s=[])).push({type:"collision",row:u,pos:c,n:g-_});const T=x&&x[_];if(T){const D=(C+_)%e*2,I=o[D];I==null||I!=T&&o[D+1]==1?(o[D]=T,o[D+1]=1):I==T&&o[D+1]++}}}i+=g,c+=m.nodeSize}const h=(u+1)*e;let f=0;for(;i<h;)r[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:u,n:f}),c++}(e===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const a=new xt(e,n,r,s);let l=!1;for(let u=0;!l&&u<o.length;u+=2)o[u]!=null&&o[u+1]<n&&(l=!0);return l&&tD(a,o,t),a}function eD(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let s=0;if(n)for(let o=0;o<r;o++){const a=t.child(o);for(let l=0;l<a.childCount;l++){const u=a.child(l);o+u.attrs.rowspan>r&&(s+=u.attrs.colspan)}}for(let o=0;o<i.childCount;o++){const a=i.child(o);s+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function tD(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const s=t.map[i];if(r[s])continue;r[s]=!0;const o=n.nodeAt(s);if(!o)throw new RangeError(`No cell with offset ${s} found`);let a=null;const l=o.attrs;for(let u=0;u<l.colspan;u++){const c=e[(i+u)%t.width*2];c!=null&&(!l.colwidth||l.colwidth[u]!=c)&&((a||(a=nD(l)))[u]=c)}a&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function nD(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function nn(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}const Pi=new Ae("selectingCells");function Ys(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function rD(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function br(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function W0(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Ys(e.$head)||iD(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function iD(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Jf(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function sD(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function qm(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function av(t,e,n){const r=t.node(-1),i=xt.get(r),s=t.start(-1),o=i.nextCell(t.pos-s,e,n);return o==null?null:t.node(0).resolve(s+o)}function Zs(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function lv(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function oD(t,e,n){const r=nn(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}var Qe=class ni extends fe{constructor(e,n=e){const r=e.node(-1),i=xt.get(r),s=e.start(-1),o=i.rectBetween(e.pos-s,n.pos-s),a=e.node(0),l=i.cellsInRect(o).filter(c=>c!=n.pos-s);l.unshift(n.pos-s);const u=l.map(c=>{const d=r.nodeAt(c);if(!d)throw new RangeError(`No cell with offset ${c} found`);const h=s+c+1;return new dm(a.resolve(h),a.resolve(h+d.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Jf(r)&&Jf(i)&&qm(r,i)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?ni.rowSelection(r,i):s&&this.isColSelection()?ni.colSelection(r,i):new ni(r,i)}return le.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=xt.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},o=[];for(let l=i.top;l<i.bottom;l++){const u=[];for(let c=l*n.width+i.left,d=i.left;d<i.right;d++,c++){const h=n.map[c];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=e.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const m=i.left-f.left,g=f.right-i.right;if(m>0||g>0){let y=p.attrs;if(m>0&&(y=Zs(y,0,m)),g>0&&(y=Zs(y,y.colspan-g,g)),f.left<i.left){if(p=p.type.createAndFill(y),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else p=p.type.create(y,p.content)}if(f.top<i.top||f.bottom>i.bottom){const y={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(y):p=p.type.create(y,p.content)}u.push(p)}o.push(e.child(l).copy(P.from(u)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new Z(P.from(a),1,1)}replace(e,n=Z.empty){const r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){const{$from:a,$to:l}=i[o],u=e.mapping.slice(r);e.replace(u.map(a.pos),u.map(l.pos),o?Z.empty:n)}const s=fe.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new Z(P.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=xt.get(n),i=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<s.length;o++)e(n.nodeAt(s[o]),i+s[o])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=xt.get(r),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(n.pos-s),l=e.node(0);return o.top<=a.top?(o.top>0&&(e=l.resolve(s+i.map[o.left])),a.bottom<i.height&&(n=l.resolve(s+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(s+i.map[a.left])),o.bottom<i.height&&(e=l.resolve(s+i.map[i.width*(i.height-1)+o.right-1]))),new ni(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=xt.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(i,s)>0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,a=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==n.width}eq(e){return e instanceof ni&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=xt.get(r),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(n.pos-s),l=e.node(0);return o.left<=a.left?(o.left>0&&(e=l.resolve(s+i.map[o.top*i.width])),a.right<i.width&&(n=l.resolve(s+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(s+i.map[a.top*i.width])),o.right<i.width&&(e=l.resolve(s+i.map[i.width*(o.top+1)-1]))),new ni(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new ni(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new ni(e.resolve(n),e.resolve(r))}getBookmark(){return new aD(this.$anchorCell.pos,this.$headCell.pos)}};Qe.prototype.visible=!1;fe.jsonID("cell",Qe);var aD=class uv{constructor(e,n){this.anchor=e,this.head=n}map(e){return new uv(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&qm(n,r)?new Qe(n,r):fe.near(r,1)}};function lD(t){if(!(t.selection instanceof Qe))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Ge.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Le.create(t.doc,e)}function uD({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function cD({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function dD(t,e,n){const r=(e||t).selection,i=(e||t).doc;let s,o;if(r instanceof ue&&(o=r.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")s=Qe.create(i,r.from);else if(o=="row"){const a=i.resolve(r.from+1);s=Qe.rowSelection(a,a)}else if(!n){const a=xt.get(r.node),l=r.from+1,u=l+a.map[a.width*a.height-1];s=Qe.create(i,l+1,u)}}else r instanceof le&&uD(r)?s=le.create(i,r.from):r instanceof le&&cD(r)&&(s=le.create(i,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}const hD=new Ae("fix-tables");function cv(t,e,n,r){const i=t.childCount,s=e.childCount;e:for(let o=0,a=0;o<s;o++){const l=e.child(o);for(let u=a,c=Math.min(i,o+3);u<c;u++)if(t.child(u)==l){a=u+1,n+=l.nodeSize;continue e}r(l,n),a<i&&t.child(a).sameMarkup(l)?cv(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function dv(t,e){let n;const r=(i,s)=>{i.type.spec.tableRole=="table"&&(n=fD(t,i,s,n))};return e?e.doc!=t.doc&&cv(e.doc,t.doc,0,r):t.doc.descendants(r),n}function fD(t,e,n,r){const i=xt.get(e);if(!i.problems)return r;r||(r=t.tr);const s=[];for(let l=0;l<i.height;l++)s.push(0);for(let l=0;l<i.problems.length;l++){const u=i.problems[l];if(u.type=="collision"){const c=e.nodeAt(u.pos);if(!c)continue;const d=c.attrs;for(let h=0;h<d.rowspan;h++)s[u.row+h]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,Zs(d,d.colspan-u.n,u.n))}else if(u.type=="missing")s[u.row]+=u.n;else if(u.type=="overlong_rowspan"){const c=e.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,{...c.attrs,rowspan:c.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){const c=e.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,{...c.attrs,colwidth:u.colwidth})}else if(u.type=="zero_sized"){const c=r.mapping.map(n);r.delete(c,c+e.nodeSize)}}let o,a;for(let l=0;l<s.length;l++)s[l]&&(o==null&&(o=l),a=l);for(let l=0,u=n+1;l<i.height;l++){const c=e.child(l),d=u+c.nodeSize,h=s[l];if(h>0){let f="cell";c.firstChild&&(f=c.firstChild.type.spec.tableRole);const p=[];for(let g=0;g<h;g++){const y=nn(t.schema)[f].createAndFill();y&&p.push(y)}const m=(l==0||o==l-1)&&a==l?u+1:d-1;r.insert(r.mapping.map(m),p)}u=d}return r.setMeta(hD,{fixTables:!0})}function Ur(t){const e=t.selection,n=W0(t),r=n.node(-1),i=n.start(-1),s=xt.get(r);return{...e instanceof Qe?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:r}}function hv(t,{map:e,tableStart:n,table:r},i){let s=i>0?-1:0;oD(e,r,i+s)&&(s=i==0||i==e.width?null:0);for(let o=0;o<e.height;o++){const a=o*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],u=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,lv(u.attrs,i-e.colCount(l))),o+=u.attrs.rowspan-1}else{const l=s==null?nn(r.type.schema).cell:r.nodeAt(e.map[a+s]).type,u=e.positionAt(o,i,r);t.insert(t.mapping.map(n+u),l.createAndFill())}}return t}function pD(t,e){if(!br(t))return!1;if(e){const n=Ur(t);e(hv(t.tr,n,n.left))}return!0}function mD(t,e){if(!br(t))return!1;if(e){const n=Ur(t);e(hv(t.tr,n,n.right))}return!0}function gD(t,{map:e,table:n,tableStart:r},i){const s=t.mapping.maps.length;for(let o=0;o<e.height;){const a=o*e.width+i,l=e.map[a],u=n.nodeAt(l),c=u.attrs;if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(s).map(r+l),null,Zs(c,i-e.colCount(l)));else{const d=t.mapping.slice(s).map(r+l);t.delete(d,d+u.nodeSize)}o+=c.rowspan}}function bD(t,e){if(!br(t))return!1;if(e){const n=Ur(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;gD(r,n,i),i!=n.left;i--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=xt.get(s)}e(r)}return!0}function yD(t,e,n){var r;const i=nn(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))===null||r===void 0?void 0:r.type)!=i)return!1;return!0}function fv(t,{map:e,tableStart:n,table:r},i){let s=n;for(let u=0;u<i;u++)s+=r.child(u).nodeSize;const o=[];let a=i>0?-1:0;yD(e,r,i+a)&&(a=i==0||i==e.height?null:0);for(let u=0,c=e.width*i;u<e.width;u++,c++)if(i>0&&i<e.height&&e.map[c]==e.map[c-e.width]){const d=e.map[c],h=r.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),u+=h.colspan-1}else{var l;const d=a==null?nn(r.type.schema).cell:(l=r.nodeAt(e.map[c+a*e.width]))===null||l===void 0?void 0:l.type,h=d==null?void 0:d.createAndFill();h&&o.push(h)}return t.insert(s,nn(r.type.schema).row.create(null,o)),t}function vD(t,e){if(!br(t))return!1;if(e){const n=Ur(t);e(fv(t.tr,n,n.top))}return!0}function xD(t,e){if(!br(t))return!1;if(e){const n=Ur(t);e(fv(t.tr,n,n.bottom))}return!0}function wD(t,{map:e,table:n,tableStart:r},i){let s=0;for(let u=0;u<i;u++)s+=n.child(u).nodeSize;const o=s+n.child(i).nodeSize,a=t.mapping.maps.length;t.delete(s+r,o+r);const l=new Set;for(let u=0,c=i*e.width;u<e.width;u++,c++){const d=e.map[c];if(!l.has(d)){if(l.add(d),i>0&&d==e.map[c-e.width]){const h=n.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(a).map(d+r),null,{...h,rowspan:h.rowspan-1}),u+=h.colspan-1}else if(i<e.height&&d==e.map[c+e.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),m=e.positionAt(i+1,u,n);t.insert(t.mapping.slice(a).map(r+m),p),u+=f.colspan-1}}}}function kD(t,e){if(!br(t))return!1;if(e){const n=Ur(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;wD(r,n,i),i!=n.top;i--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=xt.get(n.table)}e(r)}return!0}function d2(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function ED({width:t,height:e,map:n},r){let i=r.top*t+r.left,s=i,o=(r.bottom-1)*t+r.left,a=i+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[a]==n[a+1])return!0;s+=t,a+=t}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[o]==n[o+t])return!0;i++,o++}return!1}function h2(t,e){const n=t.selection;if(!(n instanceof Qe)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Ur(t),{map:i}=r;if(ED(i,r))return!1;if(e){const s=t.tr,o={};let a=P.empty,l,u;for(let c=r.top;c<r.bottom;c++)for(let d=r.left;d<r.right;d++){const h=i.map[c*i.width+d],f=r.table.nodeAt(h);if(!(o[h]||!f))if(o[h]=!0,l==null)l=h,u=f;else{d2(f)||(a=a.append(f.content));const p=s.mapping.map(h+r.tableStart);s.delete(p,p+f.nodeSize)}}if(l==null||u==null)return!0;if(s.setNodeMarkup(l+r.tableStart,null,{...lv(u.attrs,u.attrs.colspan,r.right-r.left-u.attrs.colspan),rowspan:r.bottom-r.top}),a.size>0){const c=l+1+u.content.size,d=d2(u)?l+1:c;s.replaceWith(d+r.tableStart,c+r.tableStart,a)}s.setSelection(new Qe(s.doc.resolve(l+r.tableStart))),e(s)}return!0}function f2(t,e){const n=nn(t.schema);return SD(({node:r})=>n[r.type.spec.tableRole])(t,e)}function SD(t){return(e,n)=>{const r=e.selection;let i,s;if(r instanceof Qe){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,s=r.$anchorCell.pos}else{var o;if(i=rD(r.$from),!i)return!1;s=(o=Ys(r.$from))===null||o===void 0?void 0:o.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let a=i.attrs;const l=[],u=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const c=Ur(e),d=e.tr;for(let f=0;f<c.right-c.left;f++)l.push(u?{...a,colwidth:u&&u[f]?[u[f]]:null}:a);let h;for(let f=c.top;f<c.bottom;f++){let p=c.map.positionAt(f,c.left,c.table);f==c.top&&(p+=i.nodeSize);for(let m=c.left,g=0;m<c.right;m++,g++)m==c.left&&f==c.top||d.insert(h=d.mapping.map(p+c.tableStart,1),t({node:i,row:f,col:m}).createAndFill(l[g]))}d.setNodeMarkup(s,t({node:i,row:c.top,col:c.left}),l[0]),r instanceof Qe&&d.setSelection(new Qe(d.doc.resolve(r.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function CD(t,e){return function(n,r){if(!br(n))return!1;const i=W0(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof Qe?n.selection.forEachCell((o,a)=>{o.attrs[t]!==e&&s.setNodeMarkup(a,null,{...o.attrs,[t]:e})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function _D(t){return function(e,n){if(!br(e))return!1;if(n){const r=nn(e.schema),i=Ur(e),s=e.tr,o=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=o.map(l=>i.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==r.header_cell&&s.setNodeMarkup(i.tableStart+o[l],r.cell,a[l].attrs);if(s.steps.length===0)for(let l=0;l<o.length;l++)s.setNodeMarkup(i.tableStart+o[l],r.header_cell,a[l].attrs);n(s)}return!0}}function p2(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const s=e.table.nodeAt(r[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function rl(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?_D(t):function(n,r){if(!br(n))return!1;if(r){const i=nn(n.schema),s=Ur(n),o=n.tr,a=p2("row",s,i),l=p2("column",s,i),u=(t==="column"?a:t==="row"&&l)?1:0,c=t=="column"?{left:0,top:u,right:1,bottom:s.map.height}:t=="row"?{left:u,top:0,right:s.map.width,bottom:1}:s,d=t=="column"?l?i.cell:i.header_cell:t=="row"?a?i.cell:i.header_cell:i.cell;s.map.cellsInRect(c).forEach(h=>{const f=h+s.tableStart,p=o.doc.nodeAt(f);p&&o.setNodeMarkup(f,d,p.attrs)}),r(o)}return!0}}rl("row",{useDeprecatedLogic:!0});rl("column",{useDeprecatedLogic:!0});const AD=rl("cell",{useDeprecatedLogic:!0});function TD(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const s=t.node(-1).child(r),o=s.lastChild;if(o)return i-1-o.nodeSize;i-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function m2(t){return function(e,n){if(!br(e))return!1;const r=TD(W0(e),t);if(r==null)return!1;if(n){const i=e.doc.resolve(r);n(e.tr.setSelection(le.between(i,sD(i))).scrollIntoView())}return!0}}function MD(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function hu(t,e){const n=t.selection;if(!(n instanceof Qe))return!1;if(e){const r=t.tr,i=nn(t.schema).cell.createAndFill().content;n.forEachCell((s,o)=>{s.content.eq(i)||r.replace(r.mapping.map(o+1),r.mapping.map(o+s.nodeSize-1),new Z(i,0,0))}),r.docChanged&&e(r)}return!0}function ND(t){if(t.size===0)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),s=i.type.spec.tableRole,o=i.type.schema,a=[];if(s=="row")for(let l=0;l<e.childCount;l++){let u=e.child(l).content;const c=l?0:Math.max(0,n-1),d=l<e.childCount-1?0:Math.max(0,r-1);(c||d)&&(u=Xf(nn(o).row,new Z(u,c,d)).content),a.push(u)}else if(s=="cell"||s=="header_cell")a.push(n||r?Xf(nn(o).row,new Z(e,n,r)).content:e);else return null;return DD(o,a)}function DD(t,e){const n=[];for(let i=0;i<e.length;i++){const s=e[i];for(let o=s.childCount-1;o>=0;o--){const{rowspan:a,colspan:l}=s.child(o).attrs;for(let u=i;u<i+a;u++)n[u]=(n[u]||0)+l}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(P.empty),n[i]<r){const s=nn(t).cell.createAndFill(),o=[];for(let a=n[i];a<r;a++)o.push(s);e[i]=e[i].append(P.from(o))}return{height:e.length,width:r,rows:e}}function Xf(t,e){const n=t.createAndFill();return new cm(n).replace(0,n.content.size,e).doc}function OD({width:t,height:e,rows:n},r,i){if(t!=r){const s=[],o=[];for(let a=0;a<n.length;a++){const l=n[a],u=[];for(let c=s[a]||0,d=0;c<r;d++){let h=l.child(d%l.childCount);c+h.attrs.colspan>r&&(h=h.type.createChecked(Zs(h.attrs,h.attrs.colspan,c+h.attrs.colspan-r),h.content)),u.push(h),c+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[a+f]=(s[a+f]||0)+h.attrs.colspan}o.push(P.from(u))}n=o,t=r}if(e!=i){const s=[];for(let o=0,a=0;o<i;o++,a++){const l=[],u=n[a%e];for(let c=0;c<u.childCount;c++){let d=u.child(c);o+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),l.push(d)}s.push(P.from(l))}n=s,e=i}return{width:t,height:e,rows:n}}function RD(t,e,n,r,i,s,o){const a=t.doc.type.schema,l=nn(a);let u,c;if(i>e.width)for(let d=0,h=0;d<e.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let m;f.lastChild==null||f.lastChild.type==l.cell?m=u||(u=l.cell.createAndFill()):m=c||(c=l.header_cell.createAndFill());for(let g=e.width;g<i;g++)p.push(m);t.insert(t.mapping.slice(o).map(h-1+r),p)}if(s>e.height){const d=[];for(let p=0,m=(e.height-1)*e.width;p<Math.max(e.width,i);p++){const g=p>=e.width?!1:n.nodeAt(e.map[m+p]).type==l.header_cell;d.push(g?c||(c=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}const h=l.row.create(null,P.from(d)),f=[];for(let p=e.height;p<s;p++)f.push(h);t.insert(t.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(u||c)}function g2(t,e,n,r,i,s,o,a){if(o==0||o==e.height)return!1;let l=!1;for(let u=i;u<s;u++){const c=o*e.width+u,d=e.map[c];if(e.map[c-e.width]==d){l=!0;const h=n.nodeAt(d),{top:f,left:p}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(a).map(d+r),null,{...h.attrs,rowspan:o-f}),t.insert(t.mapping.slice(a).map(e.positionAt(o,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-o})),u+=h.attrs.colspan-1}}return l}function b2(t,e,n,r,i,s,o,a){if(o==0||o==e.width)return!1;let l=!1;for(let u=i;u<s;u++){const c=u*e.width+o,d=e.map[c];if(e.map[c-1]==d){l=!0;const h=n.nodeAt(d),f=e.colCount(d),p=t.mapping.slice(a).map(d+r);t.setNodeMarkup(p,null,Zs(h.attrs,o-f,h.attrs.colspan-(o-f))),t.insert(p+h.nodeSize,h.type.createAndFill(Zs(h.attrs,0,o-f))),u+=h.attrs.rowspan-1}}return l}function y2(t,e,n,r,i){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let o=xt.get(s);const{top:a,left:l}=r,u=l+i.width,c=a+i.height,d=t.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");o=xt.get(s),h=d.mapping.maps.length}RD(d,o,s,n,u,c,h)&&f(),g2(d,o,s,n,l,u,a,h)&&f(),g2(d,o,s,n,l,u,c,h)&&f(),b2(d,o,s,n,a,c,l,h)&&f(),b2(d,o,s,n,a,c,u,h)&&f();for(let p=a;p<c;p++){const m=o.positionAt(p,l,s),g=o.positionAt(p,u,s);d.replace(d.mapping.slice(h).map(m+n),d.mapping.slice(h).map(g+n),new Z(i.rows[p-a],0,0))}f(),d.setSelection(new Qe(d.doc.resolve(n+o.positionAt(a,l,s)),d.doc.resolve(n+o.positionAt(c-1,u-1,s)))),e(d)}const ID=Am({ArrowLeft:fu("horiz",-1),ArrowRight:fu("horiz",1),ArrowUp:fu("vert",-1),ArrowDown:fu("vert",1),"Shift-ArrowLeft":pu("horiz",-1),"Shift-ArrowRight":pu("horiz",1),"Shift-ArrowUp":pu("vert",-1),"Shift-ArrowDown":pu("vert",1),Backspace:hu,"Mod-Backspace":hu,Delete:hu,"Mod-Delete":hu});function Hu(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function fu(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof Qe)return Hu(n,r,fe.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const o=pv(i,t,e);if(o==null)return!1;if(t=="horiz")return Hu(n,r,fe.near(n.doc.resolve(s.head+e),e));{const a=n.doc.resolve(o),l=av(a,t,e);let u;return l?u=fe.near(l,1):e<0?u=fe.near(n.doc.resolve(a.before(-1)),-1):u=fe.near(n.doc.resolve(a.after(-1)),1),Hu(n,r,u)}}}function pu(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;let o;if(s instanceof Qe)o=s;else{const l=pv(i,t,e);if(l==null)return!1;o=new Qe(n.doc.resolve(l))}const a=av(o.$headCell,t,e);return a?Hu(n,r,new Qe(o.$anchorCell,a)):!1}}function LD(t,e){const n=t.state.doc,r=Ys(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Qe(r))),!0):!1}function zD(t,e,n){if(!br(t.state))return!1;let r=ND(n);const i=t.state.selection;if(i instanceof Qe){r||(r={width:1,height:1,rows:[P.from(Xf(nn(t.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),a=xt.get(s).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=OD(r,a.right-a.left,a.bottom-a.top),y2(t.state,t.dispatch,o,a,r),!0}else if(r){const s=W0(t.state),o=s.start(-1);return y2(t.state,t.dispatch,o,xt.get(s.node(-1)).findCell(s.pos-o),r),!0}else return!1}function BD(t,e){var n;if(e.button!=0||e.ctrlKey||e.metaKey)return;const r=v2(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Qe)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Ys(t.state.selection.$anchor))!=null&&((n=oh(t,e))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,e),e.preventDefault();else if(!r)return;function s(l,u){let c=oh(t,u);const d=Pi.getState(t.state)==null;if(!c||!qm(l,c))if(d)c=l;else return;const h=new Qe(l,c);if(d||!t.state.selection.eq(h)){const f=t.state.tr.setSelection(h);d&&f.setMeta(Pi,l.pos),t.dispatch(f)}}function o(){t.root.removeEventListener("mouseup",o),t.root.removeEventListener("dragstart",o),t.root.removeEventListener("mousemove",a),Pi.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Pi,-1))}function a(l){const u=l,c=Pi.getState(t.state);let d;if(c!=null)d=t.state.doc.resolve(c);else if(v2(t,u.target)!=r&&(d=oh(t,e),!d))return o();d&&s(d,u)}t.root.addEventListener("mouseup",o),t.root.addEventListener("dragstart",o),t.root.addEventListener("mousemove",a)}function pv(t,e,n){if(!(t.state.selection instanceof le))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const s=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const o=r.before(i),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?o:null}}return null}function v2(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function oh(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&Ys(t.state.doc.resolve(r))||Ys(t.state.doc.resolve(i))}var FD=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Qf(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,Qf(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Qf(t,e,n,r,i,s){let o=0,a=!0,l=e.firstChild;const u=t.firstChild;if(u){for(let d=0,h=0;d<u.childCount;d++){const{colspan:f,colwidth:p}=u.child(d).attrs;for(let m=0;m<f;m++,h++){const g=i==h?s:p&&p[m],y=g?g+"px":"";if(o+=g||r,g||(a=!1),l)l.style.width!=y&&(l.style.width=y),l=l.nextSibling;else{const x=document.createElement("col");x.style.width=y,e.appendChild(x)}}}for(;l;){var c;const d=l.nextSibling;(c=l.parentNode)===null||c===void 0||c.removeChild(l),l=d}a?(n.style.width=o+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=o+"px")}}const On=new Ae("tableColumnResizing");function PD({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=FD,lastColumnResizable:i=!0}={}){const s=new _e({key:On,state:{init(o,a){var l;const u=(l=s.spec)===null||l===void 0||(l=l.props)===null||l===void 0?void 0:l.nodeViews,c=nn(a.schema).table.name;return r&&u&&(u[c]=(d,h)=>new r(d,n,h)),new $D(-1,!1)},apply(o,a){return a.apply(o)}},props:{attributes:o=>{const a=On.getState(o);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,a)=>{HD(o,a,t,i)},mouseleave:o=>{UD(o)},mousedown:(o,a)=>{qD(o,a,e,n)}},decorations:o=>{const a=On.getState(o);if(a&&a.activeHandle>-1)return KD(o,a.activeHandle)},nodeViews:{}}});return s}var $D=class Uu{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(On);if(r&&r.setHandle!=null)return new Uu(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Uu(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Jf(e.doc.resolve(i))||(i=-1),new Uu(i,n.dragging)}return n}};function HD(t,e,n,r){if(!t.editable)return;const i=On.getState(t.state);if(i&&!i.dragging){const s=VD(e.target);let o=-1;if(s){const{left:a,right:l}=s.getBoundingClientRect();e.clientX-a<=n?o=x2(t,e,"left",n):l-e.clientX<=n&&(o=x2(t,e,"right",n))}if(o!=i.activeHandle){if(!r&&o!==-1){const a=t.state.doc.resolve(o),l=a.node(-1),u=xt.get(l),c=a.start(-1);if(u.colCount(a.pos-c)+a.nodeAfter.attrs.colspan-1==u.width-1)return}mv(t,o)}}}function UD(t){if(!t.editable)return;const e=On.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&mv(t,-1)}function qD(t,e,n,r){var i;if(!t.editable)return!1;const s=(i=t.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,o=On.getState(t.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const a=t.state.doc.nodeAt(o.activeHandle),l=jD(t,o.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(On,{setDragging:{startX:e.clientX,startWidth:l}}));function u(d){s.removeEventListener("mouseup",u),s.removeEventListener("mousemove",c);const h=On.getState(t.state);h!=null&&h.dragging&&(WD(t,h.activeHandle,w2(h.dragging,d,n)),t.dispatch(t.state.tr.setMeta(On,{setDragging:null})))}function c(d){if(!d.which)return u(d);const h=On.getState(t.state);if(h&&h.dragging){const f=w2(h.dragging,d,n);k2(t,h.activeHandle,f,r)}}return k2(t,o.activeHandle,l,r),s.addEventListener("mouseup",u),s.addEventListener("mousemove",c),e.preventDefault(),!0}function jD(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const s=t.domAtPos(e);let o=s.node.childNodes[s.offset].offsetWidth,a=n;if(r)for(let l=0;l<n;l++)r[l]&&(o-=r[l],a--);return o/a}function VD(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function x2(t,e,n,r){const i=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!s)return-1;const{pos:o}=s,a=Ys(t.state.doc.resolve(o));if(!a)return-1;if(n=="right")return a.pos;const l=xt.get(a.node(-1)),u=a.start(-1),c=l.map.indexOf(a.pos-u);return c%l.width==0?-1:u+l.map[c-1]}function w2(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function mv(t,e){t.dispatch(t.state.tr.setMeta(On,{setHandle:e}))}function WD(t,e,n){const r=t.state.doc.resolve(e),i=r.node(-1),s=xt.get(i),o=r.start(-1),a=s.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let u=0;u<s.height;u++){const c=u*s.width+a;if(u&&s.map[c]==s.map[c-s.width])continue;const d=s.map[c],h=i.nodeAt(d).attrs,f=h.colspan==1?0:a-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():GD(h.colspan);p[f]=n,l.setNodeMarkup(o+d,null,{...h,colwidth:p})}l.docChanged&&t.dispatch(l)}function k2(t,e,n,r){const i=t.state.doc.resolve(e),s=i.node(-1),o=i.start(-1),a=xt.get(s).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1;let l=t.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&Qf(s,l.firstChild,l,r,a,n)}function GD(t){return Array(t).fill(0)}function KD(t,e){const n=[],r=t.doc.resolve(e),i=r.node(-1);if(!i)return Le.empty;const s=xt.get(i),o=r.start(-1),a=s.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let u=0;u<s.height;u++){const c=a+u*s.width;if((a==s.width-1||s.map[c]!=s.map[c+1])&&(u==0||s.map[c]!=s.map[c-s.width])){var l;const d=s.map[c],h=o+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((l=On.getState(t))===null||l===void 0)&&l.dragging&&n.push(Ge.node(o+d,o+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(Ge.widget(h,f))}}return Le.create(t.doc,n)}function YD({allowTableNodeSelection:t=!1}={}){return new _e({key:Pi,state:{init(){return null},apply(e,n){const r=e.getMeta(Pi);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:i,pos:s}=e.mapping.mapResult(n);return i?null:s}},props:{decorations:lD,handleDOMEvents:{mousedown:BD},createSelectionBetween(e){return Pi.getState(e.state)!=null?e.state.selection:null},handleTripleClick:LD,handleKeyDown:ID,handlePaste:zD},appendTransaction(e,n,r){return dD(r,dv(r,n),t)}})}function ZD(t,e){const n=Math.min(t.top,e.top),r=Math.max(t.bottom,e.bottom),i=Math.min(t.left,e.left),o=Math.max(t.right,e.right)-i,a=r-n,l=i,u=n;return new DOMRect(l,u,o,a)}var JD=class{constructor({editor:t,element:e,view:n,pluginKey:r="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:o,appendTo:a,getReferencedVirtualElement:l,options:u}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:h,from:f,to:p})=>{const{doc:m,selection:g}=h,{empty:y}=g,x=!m.textBetween(f,p).length&&Dm(h.selection),k=this.element.contains(document.activeElement);return!(!(d.hasFocus()||k)||y||x||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d!=null&&d.relatedTarget&&((h=this.element.parentNode)!=null&&h.contains(d.relatedTarget))||(d==null?void 0:d.relatedTarget)!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!(h!=null&&h.selection.eq(d.state.selection)),p=!(h!=null&&h.doc.eq(d.state.doc));!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:m}=d;if(m||!h&&!f)return;if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())};var c;this.editor=t,this.element=e,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=s,this.appendTo=a,this.scrollTarget=(c=u==null?void 0:u.scrollTarget)!=null?c:window,this.getReferencedVirtualElement=l,this.floatingUIOptions={...this.floatingUIOptions,...u},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(v3(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(x3(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(w3(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(k3(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(E3(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(S3(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(C3(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(_3(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t,e,n;const{selection:r}=this.editor.state,i=(t=this.getReferencedVirtualElement)==null?void 0:t.call(this);if(i)return i;if(!((n=(e=this.view)==null?void 0:e.dom)!=null&&n.parentNode))return;const s=z5(this.view,r.from,r.to);let o={getBoundingClientRect:()=>s,getClientRects:()=>[s]};if(r instanceof ue){let a=this.view.nodeDOM(r.from);const l=a.dataset.nodeViewWrapper?a:a.querySelector("[data-node-view-wrapper]");l&&(a=l),a&&(o={getBoundingClientRect:()=>a.getBoundingClientRect(),getClientRects:()=>[a.getBoundingClientRect()]})}if(r instanceof Qe){const{$anchorCell:a,$headCell:l}=r,u=a?a.pos:l.pos,c=l?l.pos:a.pos,d=this.view.nodeDOM(u),h=this.view.nodeDOM(c);if(!d||!h)return;const f=d===h?d.getBoundingClientRect():ZD(d.getBoundingClientRect(),h.getBoundingClientRect());o={getBoundingClientRect:()=>f,getClientRects:()=>[f]}}return o}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&Hp(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:n,strategy:r,middlewareData:i})=>{var s,o;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if((s=i.hide)!=null&&s.referenceHidden||(o=i.hide)!=null&&o.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${e}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(t,e){const{state:n}=t,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(t,e);return}const i=!(e!=null&&e.selection.eq(t.state.selection)),s=!(e!=null&&e.doc.eq(t.state.doc));this.updateHandler(t,i,s,e)}getShouldShow(t){var e;const{state:n}=this.view,{selection:r}=n,{ranges:i}=r,s=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:t,from:s,to:o}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(t){var e;if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=t.getReferencedVirtualElement),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){const n=(e=t.options.scrollTarget)!=null?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},gv=t=>new _e({key:typeof t.pluginKey=="string"?new Ae(t.pluginKey):t.pluginKey,view:e=>new JD({view:e,...t})});Se.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[gv({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var XD=class{constructor({editor:t,element:e,view:n,pluginKey:r="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:o,appendTo:a,shouldShow:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:c,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,m=f.depth===1,g=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!c.hasFocus()||!p||!m||!g||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(c,d,h,f)=>{const{composing:p}=c;if(p||!d&&!h)return;if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:c})=>{var d;if(this.preventHide){this.preventHide=!1;return}c!=null&&c.relatedTarget&&((d=this.element.parentNode)!=null&&d.contains(c.relatedTarget))||(c==null?void 0:c.relatedTarget)!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:c})=>{const d=c.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)};var u;this.editor=t,this.element=e,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=s,this.appendTo=a,this.scrollTarget=(u=o==null?void 0:o.scrollTarget)!=null?u:window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(t){return M5(t,{textSerializers:Im(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(v3(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(x3(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(w3(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(k3(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(E3(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(S3(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(C3(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push(_3(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}getShouldShow(t){var e;const{state:n}=this.view,{selection:r}=n,{ranges:i}=r,s=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:n,oldState:t,from:s,to:o})}updateOptions(t){var e;if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){const n=(e=t.options.scrollTarget)!=null?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}updatePosition(){var t,e;if(!((e=(t=this.view)==null?void 0:t.dom)!=null&&e.parentNode))return;const{selection:n}=this.editor.state,r=z5(this.view,n.from,n.to);Hp({getBoundingClientRect:()=>r,getClientRects:()=>[r]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:s,y:o,strategy:a,middlewareData:l})=>{var u,c;if((u=l.hide)!=null&&u.referenceHidden||(c=l.hide)!=null&&c.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=a,this.element.style.left=`${s}px`,this.element.style.top=`${o}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const n=!(e!=null&&e.selection.eq(t.state.selection)),r=!(e!=null&&e.doc.eq(t.state.doc));this.updateHandler(t,n,r,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},bv=t=>new _e({key:typeof t.pluginKey=="string"?new Ae(t.pluginKey):t.pluginKey,view:e=>new XD({view:e,...t})});Se.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:t,dispatch:e})=>(e&&t.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[bv({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function yv(t,e){return t??new Ae(e)}var QD=typeof window<"u"?B.useLayoutEffect:B.useEffect,vv=new Set(["left","opacity","position","top","visibility","width"]),eO=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),tO=new Set(["children","className","style"]),nO=new Set(["tabIndex"]),rO=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),iO={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function ep(t,e){return/^on[A-Z]/.test(t)&&typeof e=="function"}function sO(t){return t.startsWith("aria-")||t.startsWith("data-"),t}function oO(t){return t.startsWith("aria-")||t.startsWith("data-")||rO.has(t)}function xv(t){return t.startsWith("--")?t:t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function aO(t){var e;const n=t.endsWith("Capture"),i=(n?t.slice(0,-7):t).slice(2);return{eventName:(e=iO[i])!=null?e:i.toLowerCase(),options:n?{capture:!0}:void 0}}function lO(t,e){let n=e.defaultPrevented,r=!1;const i=Object.create(e);return Object.defineProperties(i,{nativeEvent:{value:e},currentTarget:{value:t},target:{value:e.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,e.preventDefault()}},stopPropagation:{value:()=>{r=!0,e.stopPropagation()}}}),i}function ah(t){return nO.has(t)}function E2(t,e,n){if(e==="tabIndex"){t.tabIndex=Number(n);return}t[e]=n}function uO(t,e){if(e==="tabIndex"){t.removeAttribute("tabindex");return}const n=t[e];if(typeof n=="boolean"){t[e]=!1;return}if(typeof n=="number"){t[e]=0;return}t[e]=""}function cO(t,e){return typeof e!="number"||e===0||t.startsWith("--")||eO.has(t)?String(e):`${e}px`}function dO(t,e){vv.has(e)||t.style.removeProperty(xv(e))}function hO(t,e,n){vv.has(e)||t.style.setProperty(xv(e),cO(e,n))}function fO(t,e,n){new Set([...Object.keys(e),...Object.keys(n)]).forEach(i=>{if(tO.has(i)||!oO(i)||ep(i,e[i])||ep(i,n[i]))return;const s=e[i],o=n[i];if(s===o)return;const a=sO(i);if(o==null||o===!1){ah(i)&&uO(t,i),t.removeAttribute(a);return}if(o===!0){ah(i)&&E2(t,i,!0),t.setAttribute(a,"");return}if(ah(i)){E2(t,i,o);return}t.setAttribute(a,String(o))})}function pO(t,e,n){if(e!==n){if(n){t.className=n;return}t.removeAttribute("class")}}function mO(t,e,n){const r=e??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(o=>{const a=r[o],l=i[o];if(a!==l){if(l==null){dO(t,o);return}hO(t,o,l)}})}function gO(t,e,n){e.forEach(({eventName:i,listener:s,options:o})=>{t.removeEventListener(i,s,o)});const r=[];return Object.entries(n).forEach(([i,s])=>{if(!ep(i,s))return;const{eventName:o,options:a}=aO(i),l=u=>{s(lO(t,u))};t.addEventListener(o,l,a),r.push({eventName:o,listener:l,options:a})}),r}function wv(t,e){const n=B.useRef({}),r=B.useRef([]);QD(()=>{const i=n.current;return pO(t,i.className,e.className),mO(t,i.style,e.style),fO(t,i,e),r.current=gO(t,r.current,e),n.current=e,()=>{r.current.forEach(({eventName:s,listener:o,options:a})=>{t.removeEventListener(s,o,a)}),r.current=[]}},[t,e])}var bO=pi.forwardRef(({pluginKey:t,editor:e,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:o,options:a,children:l,...u},c)=>{const d=B.useRef(document.createElement("div")),h=B.useRef(yv(t,"bubbleMenu")).current;wv(d.current,u),typeof c=="function"?c(d.current):c&&(c.current=d.current);const{editor:f}=iv(),p=e||f,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:o,options:a},g=B.useRef(m);g.current=m;const[y,x]=B.useState(!1),k=B.useRef(!0);return B.useEffect(()=>{if(p!=null&&p.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const C=d.current;C.style.visibility="hidden",C.style.position="absolute";const _=gv({...g.current,editor:p,element:C});p.registerPlugin(_);const T=g.current.pluginKey;return k.current=!0,x(!0),()=>{x(!1),p.unregisterPlugin(T),window.requestAnimationFrame(()=>{C.parentNode&&C.parentNode.removeChild(C)})}},[p]),B.useEffect(()=>{if(!(!y||!p||p.isDestroyed)){if(k.current){k.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:g.current}))}},[y,p,n,r,s,a,i,o,h]),Up.createPortal(l,d.current)});pi.forwardRef(({pluginKey:t,editor:e,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:s=null,options:o,children:a,...l},u)=>{const c=B.useRef(document.createElement("div")),d=B.useRef(yv(t,"floatingMenu")).current;wv(c.current,l),typeof u=="function"?u(c.current):u&&(u.current=c.current);const{editor:h}=iv(),f=e||h,p={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:s,options:o},m=B.useRef(p);m.current=p;const[g,y]=B.useState(!1),x=B.useRef(!0);return B.useEffect(()=>{if(f!=null&&f.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const k=c.current;k.style.visibility="hidden",k.style.position="absolute";const C=bv({...m.current,editor:f,element:k});f.registerPlugin(C);const _=m.current.pluginKey;return x.current=!0,y(!0),()=>{y(!1),f.unregisterPlugin(_),window.requestAnimationFrame(()=>{k.parentNode&&k.parentNode.removeChild(k)})}},[f]),B.useEffect(()=>{if(!(!g||!f||f.isDestroyed)){if(x.current){x.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:m.current}))}},[g,f,n,r,s,o,i,d]),Up.createPortal(a,c.current)});const yO=["ArrowRight","ArrowLeft"],vO=["ArrowDown","ArrowUp"],xO=[...yO,...vO,"Home","End"];function wO(t,e,n){if(n<1||e<0||e>=n)return null;switch(t){case"Home":return 0;case"End":return n-1;case"ArrowRight":case"ArrowDown":return(e+1)%n;case"ArrowLeft":case"ArrowUp":return(e-1+n)%n;default:return null}}function kO(t,e){return t>=0?t:e>=0?e:0}function EO(t="button:not([disabled])"){const e=B.useRef(null),n=B.useCallback(()=>{var i;return Array.from(((i=e.current)==null?void 0:i.querySelectorAll(t))??[])},[t]);B.useEffect(()=>{const i=n();if(!i.length)return;const s=kO(i.findIndex(o=>o===document.activeElement),i.findIndex(o=>o.getAttribute("aria-checked")==="true"));for(const[o,a]of i.entries())a.tabIndex=o===s?0:-1});const r=B.useCallback(i=>{if(!xO.includes(i.key))return;const s=n(),o=wO(i.key,s.indexOf(document.activeElement),s.length);o!==null&&(i.preventDefault(),s[o].focus())},[n]);return{ref:e,onKeyDown:r}}var yc=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},SO=/^\s*>\s$/,CO=Oe.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return yc("blockquote",{...ze(this.options.HTMLAttributes,t),children:yc("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((i,s)=>{var o,a;const c=((a=(o=e.renderChild)==null?void 0:o.call(e,i,s))!=null?a:e.renderChildren([i])).split(`
544
+ `).map(d=>d.trim()===""?n:`${n} ${d}`);r.push(c.join(`
545
+ `))}),r.join(`
546
+ ${n}
547
+ `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Vo({find:SO,type:this.type})]}}),_O=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,AO=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,TO=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,MO=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,NO=gn.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return yc("strong",{...ze(this.options.HTMLAttributes,t),children:yc("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Ks({find:_O,type:this.type}),Ks({find:TO,type:this.type})]},addPasteRules(){return[rs({find:AO,type:this.type}),rs({find:MO,type:this.type})]}}),DO=/(^|[^`])`([^`]+)`(?!`)$/,OO=/(^|[^`])`([^`]+)`(?!`)/g,RO=gn.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ze(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Ks({find:DO,type:this.type})]},addPasteRules(){return[rs({find:OO,type:this.type})]}}),lh=4,IO=/^```([a-z]+)?[\s\n]$/,LO=/^~~~([a-z]+)?[\s\n]$/,kv=Oe.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:lh,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const s=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ze(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((r=t.raw)==null?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const i=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(`
548
+ `):r=`\`\`\`${i}
549
+
550
+ \`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:lh,{state:r}=t,{selection:i}=r,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;const a=" ".repeat(n);return o?t.commands.insertContent(a):t.commands.command(({tr:l})=>{const{from:u,to:c}=i,f=r.doc.textBetween(u,c,`
551
+ `,`
552
+ `).split(`
553
+ `).map(p=>a+p).join(`
554
+ `);return l.replaceWith(u,c,r.schema.text(f)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:lh,{state:r}=t,{selection:i}=r,{$from:s,empty:o}=i;return s.parent.type!==this.type?!1:o?t.commands.command(({tr:a})=>{var l;const{pos:u}=s,c=s.start(),d=s.end(),f=r.doc.textBetween(c,d,`
555
+ `,`
556
+ `).split(`
557
+ `);let p=0,m=0;const g=u-c;for(let T=0;T<f.length;T+=1){if(m+f[T].length>=g){p=T;break}m+=f[T].length+1}const x=((l=f[p].match(/^ */))==null?void 0:l[0])||"",k=Math.min(x.length,n);if(k===0)return!0;let C=c;for(let T=0;T<p;T+=1)C+=f[T].length+1;return a.delete(C,C+k),u-C<=k&&a.setSelection(le.create(a.doc,C)),!0}):t.commands.command(({tr:a})=>{const{from:l,to:u}=i,h=r.doc.textBetween(l,u,`
558
+ `,`
559
+ `).split(`
560
+ `).map(f=>{var p;const m=((p=f.match(/^ */))==null?void 0:p[0])||"",g=Math.min(m.length,n);return f.slice(g)}).join(`
561
+ `);return a.replaceWith(l,u,r.schema.text(h)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
562
+
563
+ `);return!s||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:u})=>(u.setSelection(fe.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[gc({find:IO,type:this.type,getAttributes:t=>({language:t[1]})}),gc({find:LO,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new _e({key:new Ae("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
564
+ `));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(le.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),zO=Oe.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
565
+
566
+ `):""}),BO=Oe.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ze(this.options.HTMLAttributes,t)]},renderText(){return`
567
+ `},renderMarkdown:()=>`
568
+ `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&o){const d=l.filter(h=>a.includes(h.type.name));u.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),FO=Oe.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ze(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,i="#".repeat(r);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>gc({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),PO=Oe.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ze(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!qM(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,i=t();return R5(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:o,dispatch:a})=>{if(a){const{$to:l}=o.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(le.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(ue.create(o.doc,l.pos)):o.setSelection(le.create(o.doc,l.pos));else{const c=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=c==null?void 0:c.create();d&&(o.insert(u,d),o.setSelection(le.create(o.doc,u+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[X5({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),$O=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,HO=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,UO=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,qO=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,jO=gn.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ze(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Ks({find:$O,type:this.type}),Ks({find:UO,type:this.type})]},addPasteRules(){return[rs({find:HO,type:this.type}),rs({find:qO,type:this.type})]}});const VO="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",WO="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",tp="numeric",np="ascii",rp="alpha",Ba="asciinumeric",Ma="alphanumeric",ip="domain",Ev="emoji",GO="scheme",KO="slashscheme",uh="whitespace";function YO(t,e){return t in e||(e[t]=[]),e[t]}function Rs(t,e,n){e[tp]&&(e[Ba]=!0,e[Ma]=!0),e[np]&&(e[Ba]=!0,e[rp]=!0),e[Ba]&&(e[Ma]=!0),e[rp]&&(e[Ma]=!0),e[Ma]&&(e[ip]=!0),e[Ev]&&(e[ip]=!0);for(const r in e){const i=YO(r,n);i.indexOf(t)<0&&i.push(t)}}function ZO(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function wn(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}wn.groups={};wn.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||wn.groups;let i;return e&&e.j?i=e:(i=new wn(e),n&&r&&Rs(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const s=t.length;if(!s)return i;for(let o=0;o<s-1;o++)i=i.tt(t[o]);return i.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||wn.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let o,a=i.go(t);if(a?(o=new wn,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new wn,s){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(ZO(o.t,r),n);Rs(s,l,r)}else n&&Rs(s,n,r);o.t=s}return i.j[t]=o,o}};const Ne=(t,e,n,r,i)=>t.ta(e,n,r,i),vt=(t,e,n,r,i)=>t.tr(e,n,r,i),S2=(t,e,n,r,i)=>t.ts(e,n,r,i),j=(t,e,n,r,i)=>t.tt(e,n,r,i),ri="WORD",sp="UWORD",Sv="ASCIINUMERICAL",Cv="ALPHANUMERICAL",il="LOCALHOST",op="TLD",ap="UTLD",qu="SCHEME",Eo="SLASH_SCHEME",jm="NUM",lp="WS",Vm="NL",Fa="OPENBRACE",Pa="CLOSEBRACE",vc="OPENBRACKET",xc="CLOSEBRACKET",wc="OPENPAREN",kc="CLOSEPAREN",Ec="OPENANGLEBRACKET",Sc="CLOSEANGLEBRACKET",Cc="FULLWIDTHLEFTPAREN",_c="FULLWIDTHRIGHTPAREN",Ac="LEFTCORNERBRACKET",Tc="RIGHTCORNERBRACKET",Mc="LEFTWHITECORNERBRACKET",Nc="RIGHTWHITECORNERBRACKET",Dc="FULLWIDTHLESSTHAN",Oc="FULLWIDTHGREATERTHAN",Rc="AMPERSAND",Ic="APOSTROPHE",Lc="ASTERISK",Li="AT",zc="BACKSLASH",Bc="BACKTICK",Fc="CARET",Is="COLON",Wm="COMMA",Pc="DOLLAR",Mr="DOT",$c="EQUALS",Gm="EXCLAMATION",Wn="HYPHEN",$a="PERCENT",Hc="PIPE",Uc="PLUS",qc="POUND",Ha="QUERY",Km="QUOTE",_v="FULLWIDTHMIDDLEDOT",Ym="SEMI",Nr="SLASH",Ua="TILDE",jc="UNDERSCORE",Av="EMOJI",Vc="SYM";var Tv=Object.freeze({__proto__:null,ALPHANUMERICAL:Cv,AMPERSAND:Rc,APOSTROPHE:Ic,ASCIINUMERICAL:Sv,ASTERISK:Lc,AT:Li,BACKSLASH:zc,BACKTICK:Bc,CARET:Fc,CLOSEANGLEBRACKET:Sc,CLOSEBRACE:Pa,CLOSEBRACKET:xc,CLOSEPAREN:kc,COLON:Is,COMMA:Wm,DOLLAR:Pc,DOT:Mr,EMOJI:Av,EQUALS:$c,EXCLAMATION:Gm,FULLWIDTHGREATERTHAN:Oc,FULLWIDTHLEFTPAREN:Cc,FULLWIDTHLESSTHAN:Dc,FULLWIDTHMIDDLEDOT:_v,FULLWIDTHRIGHTPAREN:_c,HYPHEN:Wn,LEFTCORNERBRACKET:Ac,LEFTWHITECORNERBRACKET:Mc,LOCALHOST:il,NL:Vm,NUM:jm,OPENANGLEBRACKET:Ec,OPENBRACE:Fa,OPENBRACKET:vc,OPENPAREN:wc,PERCENT:$a,PIPE:Hc,PLUS:Uc,POUND:qc,QUERY:Ha,QUOTE:Km,RIGHTCORNERBRACKET:Tc,RIGHTWHITECORNERBRACKET:Nc,SCHEME:qu,SEMI:Ym,SLASH:Nr,SLASH_SCHEME:Eo,SYM:Vc,TILDE:Ua,TLD:op,UNDERSCORE:jc,UTLD:ap,UWORD:sp,WORD:ri,WS:lp});const Qr=/[a-z]/,xa=new RegExp("\\p{L}","u"),ch=new RegExp("\\p{Emoji}","u"),ei=/\d/,dh=/\s/,C2="\r",hh=`
569
+ `,JO="️",XO="‍",fh="";let mu=null,gu=null;function QO(t=[]){const e={};wn.groups=e;const n=new wn;mu==null&&(mu=_2(VO)),gu==null&&(gu=_2(WO)),j(n,"'",Ic),j(n,"{",Fa),j(n,"}",Pa),j(n,"[",vc),j(n,"]",xc),j(n,"(",wc),j(n,")",kc),j(n,"<",Ec),j(n,">",Sc),j(n,"(",Cc),j(n,")",_c),j(n,"「",Ac),j(n,"」",Tc),j(n,"『",Mc),j(n,"』",Nc),j(n,"<",Dc),j(n,">",Oc),j(n,"&",Rc),j(n,"*",Lc),j(n,"@",Li),j(n,"`",Bc),j(n,"^",Fc),j(n,":",Is),j(n,",",Wm),j(n,"$",Pc),j(n,".",Mr),j(n,"=",$c),j(n,"!",Gm),j(n,"-",Wn),j(n,"%",$a),j(n,"|",Hc),j(n,"+",Uc),j(n,"#",qc),j(n,"?",Ha),j(n,'"',Km),j(n,"/",Nr),j(n,";",Ym),j(n,"~",Ua),j(n,"_",jc),j(n,"\\",zc),j(n,"・",_v);const r=vt(n,ei,jm,{[tp]:!0});vt(r,ei,r);const i=vt(r,Qr,Sv,{[Ba]:!0}),s=vt(r,xa,Cv,{[Ma]:!0}),o=vt(n,Qr,ri,{[np]:!0});vt(o,ei,i),vt(o,Qr,o),vt(i,ei,i),vt(i,Qr,i);const a=vt(n,xa,sp,{[rp]:!0});vt(a,Qr),vt(a,ei,s),vt(a,xa,a),vt(s,ei,s),vt(s,Qr),vt(s,xa,s);const l=j(n,hh,Vm,{[uh]:!0}),u=j(n,C2,lp,{[uh]:!0}),c=vt(n,dh,lp,{[uh]:!0});j(n,fh,c),j(u,hh,l),j(u,fh,c),vt(u,dh,c),j(c,C2),j(c,hh),vt(c,dh,c),j(c,fh,c);const d=vt(n,ch,Av,{[Ev]:!0});j(d,"#"),vt(d,ch,d),j(d,JO,d);const h=j(d,XO);j(h,"#"),vt(h,ch,d);const f=[[Qr,o],[ei,i]],p=[[Qr,null],[xa,a],[ei,s]];for(let m=0;m<mu.length;m++)Ni(n,mu[m],op,ri,f);for(let m=0;m<gu.length;m++)Ni(n,gu[m],ap,sp,p);Rs(op,{tld:!0,ascii:!0},e),Rs(ap,{utld:!0,alpha:!0},e),Ni(n,"file",qu,ri,f),Ni(n,"mailto",qu,ri,f),Ni(n,"http",Eo,ri,f),Ni(n,"https",Eo,ri,f),Ni(n,"ftp",Eo,ri,f),Ni(n,"ftps",Eo,ri,f),Rs(qu,{scheme:!0,ascii:!0},e),Rs(Eo,{slashscheme:!0,ascii:!0},e),t=t.sort((m,g)=>m[0]>g[0]?1:-1);for(let m=0;m<t.length;m++){const g=t[m][0],x=t[m][1]?{[GO]:!0}:{[KO]:!0};g.indexOf("-")>=0?x[ip]=!0:Qr.test(g)?ei.test(g)?x[Ba]=!0:x[np]=!0:x[tp]=!0,S2(n,g,g,x)}return S2(n,"localhost",il,{ascii:!0}),n.jd=new wn(Vc),{start:n,tokens:Object.assign({groups:e},Tv)}}function Mv(t,e){const n=eR(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let s=0,o=0;for(;o<r;){let a=t,l=null,u=0,c=null,d=-1,h=-1;for(;o<r&&(l=a.go(n[o]));)a=l,a.accepts()?(d=0,h=0,c=a):d>=0&&(d+=n[o].length,h++),u+=n[o].length,s+=n[o].length,o++;s-=d,o-=h,u-=d,i.push({t:c.t,v:e.slice(s-u,s),s:s-u,e:s})}return i}function eR(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),s,o=i<55296||i>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function Ni(t,e,n,r,i){let s;const o=e.length;for(let a=0;a<o-1;a++){const l=e[a];t.j[l]?s=t.j[l]:(s=new wn(r),s.jr=i.slice(),t.j[l]=s),t=s}return s=new wn(n),s.jr=i.slice(),t.j[e[o-1]]=s,s}function _2(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let s=0;for(;i.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+s),10);o>0;o--)n.pop();r+=s}else n.push(t[r]),r++}return e}const sl={defaultProtocol:"http",events:null,format:A2,formatHref:A2,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Zm(t,e=null){let n=Object.assign({},sl);t&&(n=Object.assign(n,t instanceof Zm?t.o:t));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}Zm.prototype={o:sl,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:sl[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function A2(t){return t}function Nv(t,e){this.t="token",this.v=t,this.tk=e}Nv.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=sl.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),o={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),c=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),u&&(o.rel=u),c&&Object.assign(o,c),{tagName:i,attributes:o,content:s,eventListeners:d}}};function G0(t,e){class n extends Nv{constructor(i,s){super(i,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const tR=G0("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),T2=G0("text"),nR=G0("nl"),bu=G0("url",{isLink:!0,toHref(t=sl.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==il&&t[1].t===Is}}),Vn=t=>new wn(t);function rR({groups:t}){const e=t.domain.concat([Rc,Lc,Li,zc,Bc,Fc,Pc,$c,Wn,jm,$a,Hc,Uc,qc,Nr,Vc,Ua,jc]),n=[Ic,Is,Wm,Mr,Gm,$a,Ha,Km,Ym,Ec,Sc,Fa,Pa,xc,vc,wc,kc,Cc,_c,Ac,Tc,Mc,Nc,Dc,Oc],r=[Rc,Ic,Lc,zc,Bc,Fc,Pc,$c,Wn,Fa,Pa,$a,Hc,Uc,qc,Ha,Nr,Vc,Ua,jc],i=Vn(),s=j(i,Ua);Ne(s,r,s),Ne(s,t.domain,s);const o=Vn(),a=Vn(),l=Vn();Ne(i,t.domain,o),Ne(i,t.scheme,a),Ne(i,t.slashscheme,l),Ne(o,r,s),Ne(o,t.domain,o);const u=j(o,Li);j(s,Li,u),j(a,Li,u),j(l,Li,u);const c=j(s,Mr);Ne(c,r,s),Ne(c,t.domain,s);const d=Vn();Ne(u,t.domain,d),Ne(d,t.domain,d);const h=j(d,Mr);Ne(h,t.domain,d);const f=Vn(tR);Ne(h,t.tld,f),Ne(h,t.utld,f),j(u,il,f);const p=j(d,Wn);j(p,Wn,p),Ne(p,t.domain,d),Ne(f,t.domain,d),j(f,Mr,h),j(f,Wn,p);const m=j(o,Wn),g=j(o,Mr);j(m,Wn,m),Ne(m,t.domain,o),Ne(g,r,s),Ne(g,t.domain,o);const y=Vn(bu);Ne(g,t.tld,y),Ne(g,t.utld,y),Ne(y,t.domain,o),Ne(y,r,s),j(y,Mr,g),j(y,Wn,m),j(y,Li,u);const x=j(y,Is),k=Vn(bu);Ne(x,t.numeric,k);const C=Vn(bu),_=Vn();Ne(C,e,C),Ne(C,n,_),Ne(_,e,C),Ne(_,n,_),j(y,Nr,C),j(k,Nr,C);const T=j(a,Is),D=j(l,Is),I=j(D,Nr),L=j(I,Nr);Ne(a,t.domain,o),j(a,Mr,g),j(a,Wn,m),Ne(l,t.domain,o),j(l,Mr,g),j(l,Wn,m),Ne(T,t.domain,C),j(T,Nr,C),j(T,Ha,C),Ne(L,t.domain,C),Ne(L,e,C),j(L,Nr,C);const G=[[Fa,Pa],[vc,xc],[wc,kc],[Ec,Sc],[Cc,_c],[Ac,Tc],[Mc,Nc],[Dc,Oc]];for(let ie=0;ie<G.length;ie++){const[oe,be]=G[ie],Y=j(C,oe);j(_,oe,Y);const te=Vn(bu);Ne(Y,e,te);const Te=Vn();Ne(Y,n,Te),j(Y,be,C),Ne(te,e,te),Ne(te,n,Te),Ne(Te,e,te),Ne(Te,n,Te),j(te,be,C),j(Te,be,C)}return j(i,il,y),j(i,Vm,nR),{start:i,tokens:Tv}}function iR(t,e,n){let r=n.length,i=0,s=[],o=[];for(;i<r;){let a=t,l=null,u=null,c=0,d=null,h=-1;for(;i<r&&!(l=a.go(n[i].t));)o.push(n[i++]);for(;i<r&&(u=l||a.go(n[i].t));)l=null,a=u,a.accepts()?(h=0,d=a):h>=0&&h++,i++,c++;if(h<0)i-=c,i<r&&(o.push(n[i]),i++);else{o.length>0&&(s.push(ph(T2,e,o)),o=[]),i-=h,c-=h;const f=d.t,p=n.slice(i-c,i);s.push(ph(f,e,p))}}return o.length>0&&s.push(ph(T2,e,o)),s}function ph(t,e,n){const r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}const sR=typeof console<"u"&&console&&console.warn||(()=>{}),oR="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",st={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function aR(){return wn.groups={},st.scanner=null,st.parser=null,st.tokenQueue=[],st.pluginQueue=[],st.customSchemes=[],st.initialized=!1,st}function M2(t,e=!1){if(st.initialized&&sR(`linkifyjs: already initialized - will not register custom scheme "${t}" ${oR}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
570
+ 1. Must only contain digits, lowercase ASCII letters or "-"
571
+ 2. Cannot start or end with "-"
572
+ 3. "-" cannot repeat`);st.customSchemes.push([t,e])}function lR(){st.scanner=QO(st.customSchemes);for(let t=0;t<st.tokenQueue.length;t++)st.tokenQueue[t][1]({scanner:st.scanner});st.parser=rR(st.scanner.tokens);for(let t=0;t<st.pluginQueue.length;t++)st.pluginQueue[t][1]({scanner:st.scanner,parser:st.parser});return st.initialized=!0,st}function Jm(t){return st.initialized||lR(),iR(st.parser.start,t,Mv(st.scanner.start,t))}Jm.scan=Mv;function Dv(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Zm(n),i=Jm(t),s=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!e||a.t===e)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}var Xm="[\0-   ᠎ -\u2029  ]",uR=new RegExp(Xm),cR=new RegExp(`${Xm}$`),dR=new RegExp(Xm,"g");function hR(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function fR(t){return new _e({key:new Ae("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),s=e.some(u=>u.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,a=E5(n.doc,[...e]);if(D5(a).forEach(({newRange:u})=>{const c=VT(r.doc,u,f=>f.isTextblock);let d,h;if(c.length>1)d=c[0],h=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(c.length){const f=r.doc.textBetween(u.from,u.to," "," ");if(!cR.test(f))return;d=c[0],h=r.doc.textBetween(d.pos,u.to,void 0," ")}if(d&&h){const f=h.split(uR).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],m=d.pos+h.lastIndexOf(p);if(!p)return!1;const g=Jm(p).map(y=>y.toObject(t.defaultProtocol));if(!hR(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{Lm(y.from,y.to,r.doc).some(x=>x.mark.type===t.type)||o.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!o.steps.length)return o}})}function pR(t){return new _e({key:new Ae("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{const l=r.target;if(!l)return!1;const u=t.editor.view.dom;o=l.closest("a"),o&&!u.contains(o)&&(o=null)}if(!o)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const l=N5(e.state,t.type.name),u=(i=o.href)!=null?i:l.href,c=(s=o.target)!=null?s:l.target;u&&(window.open(u,c),a=!0)}return a}}})}function mR(t){return new _e({key:new Ae("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:i}=t,{state:s}=e,{selection:o}=s,{empty:a}=o;if(a)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const u=Dv(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!u||i!==void 0&&!i(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function Es(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(dR,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Ov=gn.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){M2(t);return}M2(t.scheme,t.optionalSlashes)})},onDestroy(){aR()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Es(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const i=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Es(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Es(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ze(this.options.HTMLAttributes,t),0]:["a",ze(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,i,s;const o=(r=(n=t.attrs)==null?void 0:n.href)!=null?r:"",a=(s=(i=t.attrs)==null?void 0:i.title)!=null?s:"",l=e.renderChildren(t);return a?`[${l}](${o} "${a}")`:`[${l}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Es(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Es(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[rs({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=Dv(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!Es(o,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>{this.options.shouldAutoLink(s.value)&&e.push({text:s.value,data:{href:s.href},index:s.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(fR({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Es(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(pR({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(mR({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),gR=Ov,bR=Object.defineProperty,yR=(t,e)=>{for(var n in e)bR(t,n,{get:e[n],enumerable:!0})},vR="listItem",N2="textStyle",D2=/^\s*([-+*])\s$/,Rv=Oe.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ze(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
573
+ `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(vR,this.editor.getAttributes(N2)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Vo({find:D2,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Vo({find:D2,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(N2),editor:this.editor})),[t]}});function xR(t){var e,n;const r=(e=t.tokens)==null?void 0:e[0];return!!(t.text&&((n=t.tokens)==null?void 0:n.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===t.text)}function wR(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var Iv=Oe.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ze(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;let i=[];if(t.tokens&&t.tokens.length>0){if(xR(t))return{type:"listItem",content:[{type:"paragraph",content:wR(t.text||"",e)}]};if(t.tokens.some(o=>o.type==="paragraph"))i=r(t.tokens);else{const o=t.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(o.tokens)}],t.tokens.length>1){const l=t.tokens.slice(1),u=r(l);i.push(...u)}}else i=r(t.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(t,e,n)=>$m(t,e,r=>{var i,s;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((s=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:s.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),kR={};yR(kR,{findListItemPos:()=>Nl,getNextListDepth:()=>Qm,handleBackspace:()=>up,handleDelete:()=>cp,hasListBefore:()=>Lv,hasListItemAfter:()=>ER,hasListItemBefore:()=>zv,listItemHasSubList:()=>Bv,nextListIsDeeper:()=>Fv,nextListIsHigher:()=>Pv});var Nl=(t,e)=>{const{$from:n}=e.selection,r=Dt(t,e.schema);let i=null,s=n.depth,o=n.pos,a=null;for(;s>0&&a===null;)i=n.node(s),i.type===r?a=s:(s-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},Qm=(t,e)=>{const n=Nl(t,e);if(!n)return!1;const[,r]=eM(e,t,n.$pos.pos+4);return r},Lv=(t,e,n)=>{const{$anchor:r}=t.selection,i=Math.max(0,r.pos-2),s=t.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},zv=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==t)},Bv=(t,e,n)=>{if(!n)return!1;const r=Dt(t,e.schema);let i=!1;return n.descendants(s=>{s.type===r&&(i=!0)}),i},up=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!ns(t.state,e)&&Lv(t.state,e,n)){const{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),u=[];l.node().descendants((h,f)=>{h.type.name===e&&u.push({node:h,pos:f})});const c=u.at(-1);if(!c)return!1;const d=t.state.doc.resolve(l.start()+c.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},d.end()).joinForward().run()}if(!ns(t.state,e)||!rM(t.state))return!1;const r=Nl(e,t.state);if(!r)return!1;const s=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=Bv(e,t.state,s);return zv(e,t.state)&&!o?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},Fv=(t,e)=>{const n=Qm(t,e),r=Nl(t,e);return!r||!n?!1:n>r.depth},Pv=(t,e)=>{const n=Qm(t,e),r=Nl(t,e);return!r||!n?!1:n<r.depth},cp=(t,e)=>{if(!ns(t.state,e)||!nM(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:Fv(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():Pv(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},ER=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==t)},$v=Se.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&cp(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&cp(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&up(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&up(t,n,r)&&(e=!0)}),e}}}}),O2=/^(\s*)(\d+)\.\s+(.*)$/,SR=/^\s/;function CR(t){const e=t.trimStart();return/^[-+*]\s+/.test(e)||/^\d+\.\s+/.test(e)||/^>\s?/.test(e)||/^```/.test(e)||/^~~~/.test(e)}function _R(t){const e=[],n=[];let r=!1;return t.forEach(i=>{if(r){n.push(i);return}if(i.trim()===""){r=!0,n.push(i);return}if(e.length>0&&CR(i)){r=!0,n.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:n}}function AR(t){const e=[];let n=0,r=0;for(;n<t.length;){const i=t[n],s=i.match(O2);if(!s)break;const[,o,a,l]=s,u=o.length,c=[l];let d=n+1;const h=[i];let f=!1;for(;d<t.length;){const p=t[d];if(p.match(O2))break;if(p.trim()==="")h.push(p),c.push(""),f=!0,d+=1;else if(p.match(SR))h.push(p),c.push(p.slice(u+2)),d+=1;else{if(f)break;h.push(p),c.push(p),d+=1}}e.push({indent:u,number:parseInt(a,10),content:c.join(`
574
+ `).trim(),contentLines:c,raw:h.join(`
575
+ `)}),r=d,n=d}return[e,r]}function Hv(t,e,n){const r=[];let i=0;for(;i<t.length;){const s=t[i];if(s.indent===e){const{paragraphLines:o,blockLines:a}=_R(s.contentLines),l=o.join(`
576
+ `).trim(),u=[];l&&u.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const c=a.join(`
577
+ `).trim();if(c){const f=n.blockTokens(c);u.push(...f)}let d=i+1;const h=[];for(;d<t.length&&t[d].indent>e;)h.push(t[d]),d+=1;if(h.length>0){const f=Math.min(...h.map(m=>m.indent)),p=Hv(h,f,n);u.push({type:"list",ordered:!0,start:h[0].number,items:p,raw:h.map(m=>m.raw).join(`
578
+ `)})}r.push({type:"list_item",raw:s.raw,tokens:u}),i=d}else i+=1}return r}function TR(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var MR="listItem",R2="textStyle",I2=/^(\d+)\.\s$/,Uv=Oe.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ze(this.options.HTMLAttributes,n),0]:["ol",ze(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?TR(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
579
+ `):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var r;const i=t.split(`
580
+ `),[s,o]=AR(i);if(s.length===0)return;const a=Hv(s,0,n);return a.length===0?void 0:{type:"list",ordered:!0,start:((r=s[0])==null?void 0:r.number)||1,items:a,raw:i.slice(0,o).join(`
581
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(MR,this.editor.getAttributes(R2)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Vo({find:I2,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Vo({find:I2,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(R2)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),NR=/^\s*(\[([( |x])?\])\s$/,qv=Oe.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",ze(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const i=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return $m(t,e,i)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),u=d=>{var h,f;a.ariaLabel=((f=(h=this.options.a11y)==null?void 0:h.checkboxLabel)==null?void 0:f.call(h,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};u(t),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:h}=d.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const p=n();if(typeof p!="number")return!1;const m=f.doc.nodeAt(p);return f.setNodeMarkup(p,void 0,{...m==null?void 0:m.attrs,checked:h}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,h)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,h])=>{i.setAttribute(d,h)}),i.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,s.append(a,o),i.append(s,l),Object.entries(e).forEach(([d,h])=>{i.setAttribute(d,h)});let c=new Set(Object.keys(e));return{dom:i,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;i.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,u(d);const h=r.extensionManager.attributes,f=nl(d,h),p=new Set(Object.keys(f)),m=this.options.HTMLAttributes;return c.forEach(g=>{p.has(g)||(g in m?i.setAttribute(g,m[g]):i.removeAttribute(g))}),Object.entries(f).forEach(([g,y])=>{y==null?g in m?i.setAttribute(g,m[g]):i.removeAttribute(g):i.setAttribute(g,y)}),c=p,!0}}}},addInputRules(){return[Vo({find:NR,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),jv=Oe.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",ze(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
582
+ `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=s=>{const o=Kf(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(s)},i=Kf(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,o)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:o}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Se.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(Rv.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(Iv.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push($v.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Uv.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(qv.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(jv.configure(this.options.taskList)),t}});var yu="&nbsp;",mh=" ",DR=Oe.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ze(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===yu||n[0].text===yu||n[0].raw===mh||n[0].text===mh)&&r.length===1&&r[0].type==="text"&&(r[0].text===yu||r[0].text===mh)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,i;if(!t)return"";const s=Array.isArray(t.content)?t.content:[];if(s.length===0){const o=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((i=n==null?void 0:n.previousNode)==null?void 0:i.type)==="paragraph"&&o.length===0?yu:""}return e.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),OR=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,RR=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,IR=gn.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ze(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ks({find:OR,type:this.type})]},addPasteRules(){return[rs({find:RR,type:this.type})]}}),LR=Oe.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),zR=gn.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ze(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!i)return;const s=i[2].trim();return{type:"underline",raw:i[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function BR(t={}){return new _e({view(e){return new FR(e,t)}})}class FR{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(n){let d=e.nodeBefore,h=e.nodeAfter;if(d||h){let f=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(f){let p=f.getBoundingClientRect(),m=d?p.bottom:p.top;d&&h&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*a;r={left:p.left,right:p.right,top:m-g,bottom:m+g}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*o;r={left:d.left-h,right:d.left+h,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,c;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,c=-pageYOffset;else{let d=l.getBoundingClientRect(),h=d.width/l.offsetWidth,f=d.height/l.offsetHeight;u=d.left-l.scrollLeft*h,c=d.top-l.scrollTop*f}this.element.style.left=(r.left-u)/o+"px",this.element.style.top=(r.top-c)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=b6(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ct extends fe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return ct.valid(r)?new ct(r):fe.near(r)}content(){return Z.empty}eq(e){return e instanceof ct&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ct(e.resolve(n.pos))}getBookmark(){return new e1(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!PR(e)||!$R(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&ct.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=n;let l=e.doc.resolve(i);if(ct.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!ue.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let a=e.doc.resolve(i);if(ct.valid(a))return a}return null}}}ct.prototype.visible=!1;ct.findFrom=ct.findGapCursorFrom;fe.jsonID("gapcursor",ct);class e1{constructor(e){this.pos=e}map(e){return new e1(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ct.valid(n)?new ct(n):fe.near(n)}}function Vv(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function PR(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Vv(i.type))return!0;if(i.inlineContent)return!1}}return!0}function $R(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Vv(i.type))return!0;if(i.inlineContent)return!1}}return!0}function HR(){return new _e({props:{decorations:VR,createSelectionBetween(t,e,n){return e.pos==n.pos&&ct.valid(n)?new ct(n):null},handleClick:qR,handleKeyDown:UR,handleDOMEvents:{beforeinput:jR}}})}const UR=Am({ArrowLeft:vu("horiz",-1),ArrowRight:vu("horiz",1),ArrowUp:vu("vert",-1),ArrowDown:vu("vert",1)});function vu(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof le){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=ct.findGapCursorFrom(a,e,l);return u?(i&&i(r.tr.setSelection(new ct(u))),!0):!1}}function qR(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!ct.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ue.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ct(r))),!0)}function jR(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ct))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=P.empty;for(let o=r.length-1;o>=0;o--)i=P.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new Z(i,0,0));return s.setSelection(le.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function VR(t){if(!(t.selection instanceof ct))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Le.create(t.doc,[Ge.widget(t.selection.head,e,{key:"gapcursor"})])}var Wc=200,qt=function(){};qt.prototype.append=function(e){return e.length?(e=qt.from(e),!this.length&&e||e.length<Wc&&this.leafAppend(e)||this.length<Wc&&e.leafPrepend(this)||this.appendInner(e)):this};qt.prototype.prepend=function(e){return e.length?qt.from(e).append(this):this};qt.prototype.appendInner=function(e){return new WR(this,e)};qt.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?qt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};qt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};qt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};qt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},n,r),i};qt.from=function(e){return e instanceof qt?e:e&&e.length?new Wv(e):qt.empty};var Wv=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Wc)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Wc)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(qt);qt.empty=new Wv([]);var WR=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(qt);const GR=500;class lr{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,u=[],c=[];return this.items.forEach((d,h)=>{if(!d.step){i||(i=this.remapping(r,h+1),s=i.maps.length),s--,c.push(d);return}if(i){c.push(new Di(d.map));let f=d.step.map(i.slice(s)),p;f&&o.maybeStep(f).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],u.push(new Di(p,void 0,void 0,u.length+c.length))),s--,p&&i.appendMap(p,s)}else o.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(s)):d.selection,l=new lr(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let d=e.steps[c].invert(e.docs[c]),h=new Di(e.mapping.maps[c],d,n),f;(f=l&&l.merge(h))&&(h=f,c?s.pop():a=a.slice(0,a.length-1)),s.push(h),n&&(o++,n=void 0),i||(l=h)}let u=o-r.depth;return u>YR&&(a=KR(a,u),o-=u),new lr(a.append(s),o)}remapping(e,n){let r=new Za;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new lr(this.items.append(e.map(n=>new Di(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=n;this.items.forEach(h=>{let f=s.getMirror(--l);if(f==null)return;o=Math.min(o,f);let p=s.maps[f];if(h.step){let m=e.steps[f].invert(e.docs[f]),g=h.selection&&h.selection.map(s.slice(l+1,f));g&&a++,r.push(new Di(p,m,g))}else r.push(new Di(p))},i);let u=[];for(let h=n;h<o;h++)u.push(new Di(s.maps[h]));let c=this.items.slice(0,i).append(u).append(r),d=new lr(c,a);return d.emptyItemCount()>GR&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let c=o.selection&&o.selection.map(n.slice(r));c&&s++;let d=new Di(u.invert(),l,c),h,f=i.length-1;(h=i.length&&i[f].merge(d))?i[f]=h:i.push(d)}}else o.map&&r--},this.items.length,0),new lr(qt.from(i.reverse()),s)}}lr.empty=new lr(qt.empty,0);function KR(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}let Di=class Gv{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Gv(n.getMap().invert(),n,this.selection)}}};class zi{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const YR=20;function ZR(t,e,n,r){let i=n.getMeta(Hs),s;if(i)return i.historyState;n.getMeta(QR)&&(t=new zi(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Hs))return o.getMeta(Hs).redo?new zi(t.done.addTransform(n,void 0,r,ju(e)),t.undone,L2(n.mapping.maps),t.prevTime,t.prevComposition):new zi(t.done,t.undone.addTransform(n,void 0,r,ju(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!JR(n,t.prevRanges)),u=o?gh(t.prevRanges,n.mapping):L2(n.mapping.maps);return new zi(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,ju(e)),lr.empty,u,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new zi(t.done.rebased(n,s),t.undone.rebased(n,s),gh(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new zi(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),gh(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function JR(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function L2(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,o)=>e.push(s,o));return e}function gh(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function XR(t,e,n){let r=ju(e),i=Hs.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),l=new zi(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(Hs,{redo:n,historyState:l})}let bh=!1,z2=null;function ju(t){let e=t.plugins;if(z2!=e){bh=!1,z2=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){bh=!0;break}}return bh}const Hs=new Ae("history"),QR=new Ae("closeHistory");function eI(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new _e({key:Hs,state:{init(){return new zi(lr.empty,lr.empty,null,0,-1)},apply(e,n,r){return ZR(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Yv:r=="historyRedo"?Zv:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}function Kv(t,e){return(n,r)=>{let i=Hs.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=XR(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const Yv=Kv(!1,!0),Zv=Kv(!0,!0);var tI=Se.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new _e({key:new Ae("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const i=this.options.limit;if(i==null||i===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const o=s-i,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,l);return t=!0,u}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=s-r,u=a-l,c=a;return e.deleteRange(u,c),!(this.storage.characters({node:e.doc})>r)}})]}}),nI=Se.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[BR(this.options)]}});Se.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new _e({key:new Ae("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!n||!r)return Le.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((l,u)=>{if(l.isText)return;if(!(i>=u&&i<=u+l.nodeSize-1))return!1;o+=1});let a=0;return t.descendants((l,u)=>{if(l.isText||!(i>=u&&i<=u+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(Ge.node(u,u+l.nodeSize,{class:this.options.className}))}),Le.create(t,s)}}})]}});var rI=Se.create({name:"gapCursor",addProseMirrorPlugins(){return[HR()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=qe(ce(t,"allowGapCursor",n)))!=null?e:null}}}),B2="placeholder";function iI(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var sI=Se.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:B2,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${iI(this.options.dataAttribute)}`:`data-${B2}`;return[new _e({key:new Ae("placeholder"),props:{decorations:({doc:e,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,s=[];if(!r)return null;const o=this.editor.isEmpty;return e.descendants((a,l)=>{const u=i>=l&&i<=l+a.nodeSize,c=!a.isLeaf&&q0(a);if(!a.type.isTextblock)return this.options.includeChildren;if((u||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];o&&d.push(this.options.emptyEditorClass);const h=Ge.node(l,l+a.nodeSize,{class:d.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});s.push(h)}return this.options.includeChildren}),Le.create(e,s)}}})]}});Se.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new _e({key:new Ae("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||R5(n.selection)||t.view.dragging?null:Le.create(n.doc,[Ge.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});var oI="skipTrailingNode";function F2({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var aI=Se.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Ae(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new _e({key:e,appendTransaction:(i,s,o)=>{const{doc:a,tr:l,schema:u}=o,c=e.getState(o),d=a.content.size,h=u.nodes[n];if(!i.some(f=>f.getMeta(oI))&&c)return l.insert(d,h.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!F2({node:o,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!F2({node:o,types:r})}}})]}}),lI=Se.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Yv(t,e),redo:()=>({state:t,dispatch:e})=>Zv(t,e)}},addProseMirrorPlugins(){return[eI(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),uI=Se.create({name:"starterKit",addExtensions(){var t,e,n,r;const i=[];return this.options.bold!==!1&&i.push(NO.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(CO.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Rv.configure(this.options.bulletList)),this.options.code!==!1&&i.push(RO.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(kv.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(zO.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(nI.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(rI.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(BO.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(FO.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(lI.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(PO.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(jO.configure(this.options.italic)),this.options.listItem!==!1&&i.push(Iv.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push($v.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(Ov.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(Uv.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(DR.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(IR.configure(this.options.strike)),this.options.text!==!1&&i.push(LR.configure(this.options.text)),this.options.underline!==!1&&i.push(zR.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(aI.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),cI=uI,dI=sI,hI=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,fI=Oe.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ze(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,i,s,o;const a=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",l=(i=(r=t.attrs)==null?void 0:r.alt)!=null?i:"",u=(o=(s=t.attrs)==null?void 0:s.title)!=null?o:"";return u?`![${l}](${a} "${u}")`:`![${l}](${a})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:s,HTMLAttributes:o,editor:a})=>{const l=document.createElement("img");Object.entries(o).forEach(([d,h])=>{if(h!=null)switch(d){case"width":case"height":break;default:l.setAttribute(d,h);break}}),l.src=o.src;const u=new UM({element:l,editor:a,node:i,getPos:s,onResize:(d,h)=>{l.style.width=`${d}px`,l.style.height=`${h}px`},onCommit:(d,h)=>{const f=s();f!==void 0&&this.editor.chain().setNodeSelection(f).updateAttributes(this.name,{width:d,height:h}).run()},onUpdate:(d,h,f)=>d.type===i.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),c=u.dom;return c.style.visibility="hidden",c.style.pointerEvents="none",l.onload=()=>{c.style.visibility="",c.style.pointerEvents=""},u}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[X5({find:hI,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),pI=fI,mI=jv,gI=qv,bI=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,yI=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,vI=gn.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||sa(t,"background-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",ze(this.options.HTMLAttributes,t),0]},renderMarkdown:(t,e)=>`==${e.renderChildren(t)}==`,parseMarkdown:(t,e)=>e.applyMark("highlight",e.parseInline(t.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:t=>t.indexOf("=="),tokenize(t,e,n){const i=/^(==)([^=]+)(==)/.exec(t);if(i){const s=i[2].trim(),o=n.inlineTokens(s);return{type:"highlight",raw:i[0],text:s,tokens:o}}}},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Ks({find:bI,type:this.type})]},addPasteRules(){return[rs({find:yI,type:this.type})]}}),xI=vI,wI=20,Jv=(t,e=0)=>{const n=[];return!t.children.length||e>wI||Array.from(t.children).forEach(r=>{r.tagName==="SPAN"?n.push(r):r.children.length&&n.push(...Jv(r,e+1))}),n},kI=t=>{if(!t.children.length)return;const e=Jv(t);e&&e.forEach(n=>{var r,i;const s=n.getAttribute("style"),o=(i=(r=n.parentElement)==null?void 0:r.closest("span"))==null?void 0:i.getAttribute("style");n.setAttribute("style",`${o};${s}`)})},Xv=gn.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&kI(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",ze(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(s=>!!s))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),EI=Se.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;const n=(e=sa(t,"background-color"))!=null?e:t.style.backgroundColor;return n==null?void 0:n.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),Qv=Se.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;const n=(e=sa(t,"color"))!=null?e:t.style.color;return n==null?void 0:n.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),SI=Se.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>{var e;return(e=sa(t,"font-family"))!=null?e:t.style.fontFamily},renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),CI=Se.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>{var e;return(e=sa(t,"font-size"))!=null?e:t.style.fontSize},renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),_I=Se.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>{var e;return(e=sa(t,"line-height"))!=null?e:t.style.lineHeight},renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});Se.create({name:"textStyleKit",addExtensions(){const t=[];return this.options.backgroundColor!==!1&&t.push(EI.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(Qv.configure(this.options.color)),this.options.fontFamily!==!1&&t.push(SI.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(CI.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(_I.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(Xv.configure(this.options.textStyle)),t}});var AI=t=>wt({find:/--$/,replace:t??"—"}),TI=t=>wt({find:/\.\.\.$/,replace:t??"…"}),yh=t=>wt({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:t??"“"}),vh=t=>wt({find:/"$/,replace:t??"”"}),xh=t=>wt({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:t??"‘"}),wh=t=>wt({find:/'$/,replace:t??"’"}),MI=t=>wt({find:/<-$/,replace:t??"←"}),NI=t=>wt({find:/->$/,replace:t??"→"}),DI=t=>wt({find:/\(c\)$/,replace:t??"©"}),OI=t=>wt({find:/\(tm\)$/,replace:t??"™"}),RI=t=>wt({find:/\(sm\)$/,replace:t??"℠"}),II=t=>wt({find:/\(r\)$/,replace:t??"®"}),LI=t=>wt({find:/(?:^|\s)(1\/2)\s$/,replace:t??"½"}),zI=t=>wt({find:/\+\/-$/,replace:t??"±"}),BI=t=>wt({find:/!=$/,replace:t??"≠"}),FI=t=>wt({find:/<<$/,replace:t??"«"}),PI=t=>wt({find:/>>$/,replace:t??"»"}),$I=t=>wt({find:/\d+\s?([*x])\s?\d+$/,replace:t??"×"}),HI=t=>wt({find:/\^2$/,replace:t??"²"}),UI=t=>wt({find:/\^3$/,replace:t??"³"}),qI=t=>wt({find:/(?:^|\s)(1\/4)\s$/,replace:t??"¼"}),jI=t=>wt({find:/(?:^|\s)(3\/4)\s$/,replace:t??"¾"}),VI=Se.create({name:"typography",addOptions(){return{closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"©",ellipsis:"…",emDash:"—",laquo:"«",leftArrow:"←",multiplication:"×",notEqual:"≠",oneHalf:"½",oneQuarter:"¼",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"±",raquo:"»",registeredTrademark:"®",rightArrow:"→",servicemark:"℠",superscriptThree:"³",superscriptTwo:"²",threeQuarters:"¾",trademark:"™"}},addInputRules(){var t,e;const n=[];this.options.emDash!==!1&&n.push(AI(this.options.emDash)),this.options.ellipsis!==!1&&n.push(TI(this.options.ellipsis));const r=this.editor.options.textDirection==="rtl";if((t=this.options.doubleQuotes)!=null&&t.rtl){const{open:i,close:s}=this.options.doubleQuotes.rtl;n.push(yh(i)),n.push(vh(s))}else r?(n.push(yh("”")),n.push(vh("“"))):(this.options.openDoubleQuote!==!1&&n.push(yh(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&n.push(vh(this.options.closeDoubleQuote)));if((e=this.options.singleQuotes)!=null&&e.rtl){const{open:i,close:s}=this.options.singleQuotes.rtl;n.push(xh(i)),n.push(wh(s))}else r?(n.push(xh("’")),n.push(wh("‘"))):(this.options.openSingleQuote!==!1&&n.push(xh(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&n.push(wh(this.options.closeSingleQuote)));return this.options.leftArrow!==!1&&n.push(MI(this.options.leftArrow)),this.options.rightArrow!==!1&&n.push(NI(this.options.rightArrow)),this.options.copyright!==!1&&n.push(DI(this.options.copyright)),this.options.trademark!==!1&&n.push(OI(this.options.trademark)),this.options.servicemark!==!1&&n.push(RI(this.options.servicemark)),this.options.registeredTrademark!==!1&&n.push(II(this.options.registeredTrademark)),this.options.oneHalf!==!1&&n.push(LI(this.options.oneHalf)),this.options.plusMinus!==!1&&n.push(zI(this.options.plusMinus)),this.options.notEqual!==!1&&n.push(BI(this.options.notEqual)),this.options.laquo!==!1&&n.push(FI(this.options.laquo)),this.options.raquo!==!1&&n.push(PI(this.options.raquo)),this.options.multiplication!==!1&&n.push($I(this.options.multiplication)),this.options.superscriptTwo!==!1&&n.push(HI(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&n.push(UI(this.options.superscriptThree)),this.options.oneQuarter!==!1&&n.push(qI(this.options.oneQuarter)),this.options.threeQuarters!==!1&&n.push(jI(this.options.threeQuarters)),n}}),WI=VI,GI=tI;const fr=()=>new Map,dp=t=>{const e=fr();return t.forEach((n,r)=>{e.set(r,n)}),e},xi=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},KI=(t,e)=>{const n=[];for(const[r,i]of t)n.push(e(i,r));return n},YI=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1},Js=()=>new Set,kh=t=>t[t.length-1],ZI=(t,e)=>{for(let n=0;n<e.length;n++)t.push(e[n])},Xs=Array.from,t1=(t,e)=>{for(let n=0;n<t.length;n++)if(!e(t[n],n,t))return!1;return!0},n1=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},JI=(t,e)=>{const n=new Array(t);for(let r=0;r<t;r++)n[r]=e(r,n);return n},Wo=Array.isArray;class ex{constructor(){this._observers=fr()}on(e,n){return xi(this._observers,e,Js).add(n),n}once(e,n){const r=(...i)=>{this.off(e,r),n(...i)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return Xs((this._observers.get(e)||fr()).values()).forEach(r=>r(...n))}destroy(){this._observers=fr()}}const pr=Math.floor,Vu=Math.abs,Go=(t,e)=>t<e?t:e,is=(t,e)=>t>e?t:e,tx=t=>t!==0?t<0:1/t<0,P2=1,$2=2,Eh=4,Sh=8,ol=32,di=64,dn=128,XI=1<<29,K0=31,hp=63,Us=127,QI=2147483647,Gc=Number.MAX_SAFE_INTEGER,H2=Number.MIN_SAFE_INTEGER,eL=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&pr(t)===t),nx=String.fromCharCode,tL=t=>t.toLowerCase(),nL=/^\s*/g,rL=t=>t.replace(nL,""),iL=/([A-Z])/g,U2=(t,e)=>rL(t.replace(iL,n=>`${e}${tL(n)}`)),sL=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=e.codePointAt(i);return r},al=typeof TextEncoder<"u"?new TextEncoder:null,oL=t=>al.encode(t),aL=al?oL:sL;let qa=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});qa&&qa.decode(new Uint8Array).length===1&&(qa=null);const lL=(t,e)=>JI(e,()=>t).join("");class Dl{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Ol=()=>new Dl,uL=t=>{const e=Ol();return t(e),dr(e)},cL=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},dr=t=>{const e=new Uint8Array(cL(t));let n=0;for(let r=0;r<t.bufs.length;r++){const i=t.bufs[r];e.set(i,n),n+=i.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},dL=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(is(n,e)*2),t.cpos=0)},Pt=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},fp=Pt,$e=(t,e)=>{for(;e>Us;)Pt(t,dn|Us&e),e=pr(e/128);Pt(t,Us&e)},r1=(t,e)=>{const n=tx(e);for(n&&(e=-e),Pt(t,(e>hp?dn:0)|(n?di:0)|hp&e),e=pr(e/64);e>0;)Pt(t,(e>Us?dn:0)|Us&e),e=pr(e/128)},pp=new Uint8Array(3e4),hL=pp.length/3,fL=(t,e)=>{if(e.length<hL){const n=al.encodeInto(e,pp).written||0;$e(t,n);for(let r=0;r<n;r++)Pt(t,pp[r])}else Nn(t,aL(e))},pL=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;$e(t,r);for(let i=0;i<r;i++)Pt(t,n.codePointAt(i))},Do=al&&al.encodeInto?fL:pL,Y0=(t,e)=>{const n=t.cbuf.length,r=t.cpos,i=Go(n-r,e.length),s=e.length-i;t.cbuf.set(e.subarray(0,i),r),t.cpos+=i,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(is(n*2,s)),t.cbuf.set(e.subarray(i)),t.cpos=s)},Nn=(t,e)=>{$e(t,e.byteLength),Y0(t,e)},i1=(t,e)=>{dL(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},mL=(t,e)=>i1(t,4).setFloat32(0,e,!1),gL=(t,e)=>i1(t,8).setFloat64(0,e,!1),bL=(t,e)=>i1(t,8).setBigInt64(0,e,!1),q2=new DataView(new ArrayBuffer(4)),yL=t=>(q2.setFloat32(0,t),q2.getFloat32(0)===t),Ko=(t,e)=>{switch(typeof e){case"string":Pt(t,119),Do(t,e);break;case"number":eL(e)&&Vu(e)<=QI?(Pt(t,125),r1(t,e)):yL(e)?(Pt(t,124),mL(t,e)):(Pt(t,123),gL(t,e));break;case"bigint":Pt(t,122),bL(t,e);break;case"object":if(e===null)Pt(t,126);else if(Wo(e)){Pt(t,117),$e(t,e.length);for(let n=0;n<e.length;n++)Ko(t,e[n])}else if(e instanceof Uint8Array)Pt(t,116),Nn(t,e);else{Pt(t,118);const n=Object.keys(e);$e(t,n.length);for(let r=0;r<n.length;r++){const i=n[r];Do(t,i),Ko(t,e[i])}}break;case"boolean":Pt(t,e?120:121);break;default:Pt(t,127)}};class j2 extends Dl{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&$e(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const V2=t=>{t.count>0&&(r1(t.encoder,t.count===1?t.s:-t.s),t.count>1&&$e(t.encoder,t.count-2))};class Wu{constructor(){this.encoder=new Dl,this.s=0,this.count=0}write(e){this.s===e?this.count++:(V2(this),this.count=1,this.s=e)}toUint8Array(){return V2(this),dr(this.encoder)}}const W2=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);r1(t.encoder,e),t.count>1&&$e(t.encoder,t.count-2)}};class Ch{constructor(){this.encoder=new Dl,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(W2(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return W2(this),dr(this.encoder)}}class vL{constructor(){this.sarr=[],this.s="",this.lensE=new Wu}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Dl;return this.sarr.push(this.s),this.s="",Do(e,this.sarr.join("")),Y0(e,this.lensE.toUint8Array()),dr(e)}}const Fr=t=>new Error(t),nr=()=>{throw Fr("Method unimplemented")},pn=()=>{throw Fr("Unexpected case")},rx=Fr("Unexpected end of array"),ix=Fr("Integer out of Range");class Z0{constructor(e){this.arr=e,this.pos=0}}const s1=t=>new Z0(t),xL=t=>t.pos!==t.arr.length,wL=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},Gn=t=>wL(t,ot(t)),ll=t=>t.arr[t.pos++],ot=t=>{let e=0,n=1;const r=t.arr.length;for(;t.pos<r;){const i=t.arr[t.pos++];if(e=e+(i&Us)*n,n*=128,i<dn)return e;if(e>Gc)throw ix}throw rx},o1=t=>{let e=t.arr[t.pos++],n=e&hp,r=64;const i=(e&di)>0?-1:1;if((e&dn)===0)return i*n;const s=t.arr.length;for(;t.pos<s;){if(e=t.arr[t.pos++],n=n+(e&Us)*r,r*=128,e<dn)return i*n;if(n>Gc)throw ix}throw rx},kL=t=>{let e=ot(t);if(e===0)return"";{let n=String.fromCodePoint(ll(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(ll(t));else for(;e>0;){const r=e<1e4?e:1e4,i=t.arr.subarray(t.pos,t.pos+r);t.pos+=r,n+=String.fromCodePoint.apply(null,i),e-=r}return decodeURIComponent(escape(n))}},EL=t=>qa.decode(Gn(t)),mp=qa?EL:kL,a1=(t,e)=>{const n=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);return t.pos+=e,n},SL=t=>a1(t,4).getFloat32(0,!1),CL=t=>a1(t,8).getFloat64(0,!1),_L=t=>a1(t,8).getBigInt64(0,!1),AL=[t=>{},t=>null,o1,SL,CL,_L,t=>!1,t=>!0,mp,t=>{const e=ot(t),n={};for(let r=0;r<e;r++){const i=mp(t);n[i]=Kc(t)}return n},t=>{const e=ot(t),n=[];for(let r=0;r<e;r++)n.push(Kc(t));return n},Gn],Kc=t=>AL[127-ll(t)](t);class G2 extends Z0{constructor(e,n){super(e),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),xL(this)?this.count=ot(this)+1:this.count=-1),this.count--,this.s}}class Gu extends Z0{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=o1(this);const e=tx(this.s);this.count=1,e&&(this.s=-this.s,this.count=ot(this)+2)}return this.count--,this.s}}class _h extends Z0{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const e=o1(this),n=e&1;this.diff=pr(e/2),this.count=1,n&&(this.count=ot(this)+2)}return this.s+=this.diff,this.count--,this.s}}class TL{constructor(e){this.decoder=new Gu(e),this.str=mp(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),n=this.str.slice(this.spos,e);return this.spos=e,n}}const ML=crypto.getRandomValues.bind(crypto),NL=Math.random,sx=()=>ML(new Uint32Array(1))[0],DL=t=>t[pr(NL()*t.length)],OL="10000000-1000-4000-8000"+-1e11,RL=()=>OL.replace(/[018]/g,t=>(t^sx()&15>>t/4).toString(16)),IL=Date.now,K2=t=>new Promise(t);Promise.all.bind(Promise);const Y2=t=>t===void 0?null:t;class LL{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let ox=new LL,zL=!0;try{typeof localStorage<"u"&&localStorage&&(ox=localStorage,zL=!1)}catch{}const BL=ox,ul=Symbol("Equality"),ax=(t,e)=>{var n;return t===e||!!((n=t==null?void 0:t[ul])!=null&&n.call(t,e))||!1},FL=t=>typeof t=="object",PL=Object.assign,lx=Object.keys,$L=(t,e)=>{for(const n in t)e(t[n],n)},Yc=t=>lx(t).length,HL=t=>{for(const e in t)return!1;return!0},oa=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},l1=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),UL=(t,e)=>t===e||Yc(t)===Yc(e)&&oa(t,(n,r)=>(n!==void 0||l1(e,r))&&ax(e[r],n)),qL=Object.freeze,ux=t=>{for(const e in t){const n=t[e];(typeof n=="object"||typeof n=="function")&&ux(t[e])}return qL(t)},u1=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&u1(t,e,n+1)}},Ku=(t,e)=>{if(t===e)return!0;if(t==null||e==null||t.constructor!==e.constructor&&(t.constructor||Object)!==(e.constructor||Object))return!1;if(t[ul]!=null)return t[ul](e);switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;break}case Set:{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;break}case Map:{if(t.size!==e.size)return!1;for(const n of t.keys())if(!e.has(n)||!Ku(t.get(n),e.get(n)))return!1;break}case void 0:case Object:if(Yc(t)!==Yc(e))return!1;for(const n in t)if(!l1(t,n)||!Ku(t[n],e[n]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Ku(t[n],e[n]))return!1;break;default:return!1}return!0},jL=(t,e)=>e.includes(t);var cx={};const Yo=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",dx=typeof window<"u"&&typeof document<"u"&&!Yo;let _r;const VL=()=>{if(_r===void 0)if(Yo){_r=fr();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&_r.set(e,""),e=r):e!==null&&(_r.set(e,r),e=null)}e!==null&&_r.set(e,"")}else typeof location=="object"?(_r=fr(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");_r.set(`--${U2(e,"-")}`,n),_r.set(`-${U2(e,"-")}`,n)}})):_r=fr();return _r},gp=t=>VL().has(t),Zc=t=>Y2(Yo?cx[t.toUpperCase().replaceAll("-","_")]:BL.getItem(t)),hx=t=>gp("--"+t)||Zc(t)!==null,WL=hx("production"),GL=Yo&&jL(cx.FORCE_COLOR,["true","1","2"]),KL=GL||!gp("--no-colors")&&!hx("no-color")&&(!Yo||process.stdout.isTTY)&&(!Yo||gp("--color")||Zc("COLORTERM")!==null||(Zc("TERM")||"").includes("color")),YL=t=>{let e="";for(let n=0;n<t.byteLength;n++)e+=nx(t[n]);return btoa(e)},ZL=t=>Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("base64"),JL=dx?YL:ZL,XL=t=>uL(e=>Ko(e,t));class QL{constructor(e,n){this.left=e,this.right=n}}const ti=(t,e)=>new QL(t,e),Z2=t=>t.next()>=.5,Ah=(t,e,n)=>pr(t.next()*(n+1-e)+e),fx=(t,e,n)=>pr(t.next()*(n+1-e)+e),c1=(t,e,n)=>fx(t,e,n),ez=t=>nx(c1(t,97,122)),tz=(t,e=0,n=20)=>{const r=c1(t,e,n);let i="";for(let s=0;s<r;s++)i+=ez(t);return i},Th=(t,e)=>e[c1(t,0,e.length-1)],nz=Symbol("0schema");class rz{constructor(){this._rerrs=[]}extend(e,n,r,i=null){this._rerrs.push({path:e,expected:n,has:r,message:i})}toString(){const e=[];for(let n=this._rerrs.length-1;n>0;n--){const r=this._rerrs[n];e.push(lL(" ",(this._rerrs.length-n)*2)+`${r.path!=null?`[${r.path}] `:""}${r.has} doesn't match ${r.expected}. ${r.message}`)}return e.join(`
583
+ `)}}const bp=(t,e)=>t===e?!0:t==null||e==null||t.constructor!==e.constructor?!1:t[ul]?ax(t,e):Wo(t)?t1(t,n=>n1(e,r=>bp(n,r))):FL(t)?oa(t,(n,r)=>bp(n,e[r])):!1;class sn{extends(e){let[n,r]=[this.shape,e.shape];return this.constructor._dilutes&&([r,n]=[n,r]),bp(n,r)}equals(e){return this.constructor===e.constructor&&Ku(this.shape,e.shape)}[nz](){return!0}[ul](e){return this.equals(e)}validate(e){return this.check(e)}check(e,n){nr()}get nullable(){return aa(this,td)}get optional(){return new gx(this)}cast(e){return J2(e,this),e}expect(e){return J2(e,this),e}}Kl(sn,"_dilutes",!1);class d1 extends sn{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n=void 0){const r=(e==null?void 0:e.constructor)===this.shape&&(this._c==null||this._c(e));return!r&&(n==null||n.extend(null,this.shape.name,e==null?void 0:e.constructor.name,(e==null?void 0:e.constructor)!==this.shape?"Constructor match failed":"Check failed")),r}}const It=(t,e=null)=>new d1(t,e);It(d1);class h1 extends sn{constructor(e){super(),this.shape=e}check(e,n){const r=this.shape(e);return!r&&(n==null||n.extend(null,"custom prop",e==null?void 0:e.constructor.name,"failed to check custom prop")),r}}const Vt=t=>new h1(t);It(h1);class J0 extends sn{constructor(e){super(),this.shape=e}check(e,n){const r=this.shape.some(i=>i===e);return!r&&(n==null||n.extend(null,this.shape.join(" | "),e.toString())),r}}const X0=(...t)=>new J0(t),px=It(J0),iz=RegExp.escape||(t=>t.replace(/[().|&,$^[\]]/g,e=>"\\"+e)),mx=t=>{if(Zo.check(t))return[iz(t)];if(px.check(t))return t.shape.map(e=>e+"");if(Cx.check(t))return["[+-]?\\d+.?\\d*"];if(_x.check(t))return[".*"];if(Xc.check(t))return t.shape.map(mx).flat(1);pn()};class sz extends sn{constructor(e){super(),this.shape=e,this._r=new RegExp("^"+e.map(mx).map(n=>`(${n.join("|")})`).join("")+"$")}check(e,n){const r=this._r.exec(e)!=null;return!r&&(n==null||n.extend(null,this._r.toString(),e.toString(),"String doesn't match string template.")),r}}It(sz);const oz=Symbol("optional");class gx extends sn{constructor(e){super(),this.shape=e}check(e,n){const r=e===void 0||this.shape.check(e);return!r&&(n==null||n.extend(null,"undefined (optional)","()")),r}get[oz](){return!0}}const az=It(gx);class lz extends sn{check(e,n){return n==null||n.extend(null,"never",typeof e),!1}}It(lz);const v0=class v0 extends sn{constructor(e,n=!1){super(),this.shape=e,this._isPartial=n}get partial(){return new v0(this.shape,!0)}check(e,n){return e==null?(n==null||n.extend(null,"object","null"),!1):oa(this.shape,(r,i)=>{const s=this._isPartial&&!l1(e,i)||r.check(e[i],n);return!s&&(n==null||n.extend(i.toString(),r.toString(),typeof e[i],"Object property does not match")),s})}};Kl(v0,"_dilutes",!0);let Jc=v0;const uz=t=>new Jc(t),cz=It(Jc),dz=Vt(t=>t!=null&&(t.constructor===Object||t.constructor==null));class bx extends sn{constructor(e,n){super(),this.shape={keys:e,values:n}}check(e,n){return e!=null&&oa(e,(r,i)=>{const s=this.shape.keys.check(i,n);return!s&&(n==null||n.extend(i+"","Record",typeof e,s?"Key doesn't match schema":"Value doesn't match value")),s&&this.shape.values.check(r,n)})}}const yx=(t,e)=>new bx(t,e),hz=It(bx);class vx extends sn{constructor(e){super(),this.shape=e}check(e,n){return e!=null&&oa(this.shape,(r,i)=>{const s=r.check(e[i],n);return!s&&(n==null||n.extend(i.toString(),"Tuple",typeof r)),s})}}const fz=(...t)=>new vx(t);It(vx);class xx extends sn{constructor(e){super(),this.shape=e.length===1?e[0]:new Q0(e)}check(e,n){const r=Wo(e)&&t1(e,i=>this.shape.check(i));return!r&&(n==null||n.extend(null,"Array","")),r}}const wx=(...t)=>new xx(t),pz=It(xx),mz=Vt(t=>Wo(t));class kx extends sn{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n){const r=e instanceof this.shape&&(this._c==null||this._c(e));return!r&&(n==null||n.extend(null,this.shape.name,e==null?void 0:e.constructor.name)),r}}const gz=(t,e=null)=>new kx(t,e);It(kx);const bz=gz(sn);class yz extends sn{constructor(e){super(),this.len=e.length-1,this.args=fz(...e.slice(-1)),this.res=e[this.len]}check(e,n){const r=e.constructor===Function&&e.length<=this.len;return!r&&(n==null||n.extend(null,"function",typeof e)),r}}const vz=It(yz),xz=Vt(t=>typeof t=="function");class wz extends sn{constructor(e){super(),this.shape=e}check(e,n){const r=t1(this.shape,i=>i.check(e,n));return!r&&(n==null||n.extend(null,"Intersectinon",typeof e)),r}}It(wz,t=>t.shape.length>0);class Q0 extends sn{constructor(e){super(),this.shape=e}check(e,n){const r=n1(this.shape,i=>i.check(e,n));return n==null||n.extend(null,"Union",typeof e),r}}Kl(Q0,"_dilutes",!0);const aa=(...t)=>t.findIndex(e=>Xc.check(e))>=0?aa(...t.map(e=>cl(e)).map(e=>Xc.check(e)?e.shape:[e]).flat(1)):t.length===1?t[0]:new Q0(t),Xc=It(Q0),Ex=()=>!0,Qc=Vt(Ex),kz=It(h1,t=>t.shape===Ex),f1=Vt(t=>typeof t=="bigint"),Ez=Vt(t=>t===f1),Sx=Vt(t=>typeof t=="symbol");Vt(t=>t===Sx);const Oo=Vt(t=>typeof t=="number"),Cx=Vt(t=>t===Oo),Zo=Vt(t=>typeof t=="string"),_x=Vt(t=>t===Zo),ed=Vt(t=>typeof t=="boolean"),Sz=Vt(t=>t===ed),Ax=X0(void 0);It(J0,t=>t.shape.length===1&&t.shape[0]===void 0);X0(void 0);const td=X0(null),Cz=It(J0,t=>t.shape.length===1&&t.shape[0]===null);It(Uint8Array);It(d1,t=>t.shape===Uint8Array);const _z=aa(Oo,Zo,td,Ax,f1,ed,Sx);(()=>{const t=wx(Qc),e=yx(Zo,Qc),n=aa(Oo,Zo,td,ed,t,e);return t.shape=n,e.shape.values=n,n})();const cl=t=>{if(bz.check(t))return t;if(dz.check(t)){const e={};for(const n in t)e[n]=cl(t[n]);return uz(e)}else{if(mz.check(t))return aa(...t.map(cl));if(_z.check(t))return X0(t);if(xz.check(t))return It(t)}pn()},J2=WL?()=>{}:(t,e)=>{const n=new rz;if(!e.check(t,n))throw Fr(`Expected value to be of type ${e.constructor.name}.
584
+ ${n.toString()}`)};class Az{constructor(e){this.patterns=[],this.$state=e}if(e,n){return this.patterns.push({if:cl(e),h:n}),this}else(e){return this.if(Qc,e)}done(){return(e,n)=>{for(let r=0;r<this.patterns.length;r++){const i=this.patterns[r];if(i.if.check(e))return i.h(e,n)}throw Fr("Unhandled pattern")}}}const Tz=t=>new Az(t),Tx=Tz(Qc).if(Cx,(t,e)=>Ah(e,H2,Gc)).if(_x,(t,e)=>tz(e)).if(Sz,(t,e)=>Z2(e)).if(Ez,(t,e)=>BigInt(Ah(e,H2,Gc))).if(Xc,(t,e)=>yo(e,Th(e,t.shape))).if(cz,(t,e)=>{const n={};for(const r in t.shape){let i=t.shape[r];if(az.check(i)){if(Z2(e))continue;i=i.shape}n[r]=Tx(i,e)}return n}).if(pz,(t,e)=>{const n=[],r=fx(e,0,42);for(let i=0;i<r;i++)n.push(yo(e,t.shape));return n}).if(px,(t,e)=>Th(e,t.shape)).if(Cz,(t,e)=>null).if(vz,(t,e)=>{const n=yo(e,t.res);return()=>n}).if(kz,(t,e)=>yo(e,Th(e,[Oo,Zo,td,Ax,f1,ed,wx(Oo),yx(aa("a","b","c"),Oo)]))).if(hz,(t,e)=>{const n={},r=Ah(e,0,3);for(let i=0;i<r;i++){const s=yo(e,t.shape.keys),o=yo(e,t.shape.values);n[s]=o}return n}).done(),yo=(t,e)=>Tx(cl(e),t),Rl=typeof document<"u"?document:{};Vt(t=>t.nodeType===Rz);typeof DOMParser<"u"&&new DOMParser;Vt(t=>t.nodeType===Nz);Vt(t=>t.nodeType===Dz);const Mz=t=>KI(t,(e,n)=>`${n}:${e};`).join(""),Nz=Rl.ELEMENT_NODE,Dz=Rl.TEXT_NODE,Oz=Rl.DOCUMENT_NODE,Rz=Rl.DOCUMENT_FRAGMENT_NODE;Vt(t=>t.nodeType===Oz);const Iz=t=>class{constructor(n){this._=n}destroy(){t(this._)}},Lz=Iz(clearTimeout),Mx=(t,e)=>new Lz(setTimeout(e,t)),wi=Symbol,Nx=wi(),Dx=wi(),zz=wi(),Bz=wi(),Fz=wi(),Ox=wi(),Pz=wi(),p1=wi(),$z=wi(),Hz=t=>{var i;t.length===1&&((i=t[0])==null?void 0:i.constructor)===Function&&(t=t[0]());const e=[],n=[];let r=0;for(;r<t.length;r++){const s=t[r];if(s===void 0)break;if(s.constructor===String||s.constructor===Number)e.push(s);else if(s.constructor===Object)break}for(r>0&&n.push(e.join(""));r<t.length;r++){const s=t[r];s instanceof Symbol||n.push(s)}return n},Uz={[Nx]:ti("font-weight","bold"),[Dx]:ti("font-weight","normal"),[zz]:ti("color","blue"),[Fz]:ti("color","green"),[Bz]:ti("color","grey"),[Ox]:ti("color","red"),[Pz]:ti("color","purple"),[p1]:ti("color","orange"),[$z]:ti("color","black")},qz=t=>{var o;t.length===1&&((o=t[0])==null?void 0:o.constructor)===Function&&(t=t[0]());const e=[],n=[],r=fr();let i=[],s=0;for(;s<t.length;s++){const a=t[s],l=Uz[a];if(l!==void 0)r.set(l.left,l.right);else{if(a===void 0)break;if(a.constructor===String||a.constructor===Number){const u=Mz(r);s>0||u.length>0?(e.push("%c"+a),n.push(u)):e.push(a)}else break}}for(s>0&&(i=n,i.unshift(e.join("")));s<t.length;s++){const a=t[s];a instanceof Symbol||i.push(a)}return i},Rx=KL?qz:Hz,jz=(...t)=>{console.log(...Rx(t)),Lx.forEach(e=>e.print(t))},Ix=(...t)=>{console.warn(...Rx(t)),t.unshift(p1),Lx.forEach(e=>e.print(t))},Lx=Js(),zx=t=>({[Symbol.iterator](){return this},next:t}),Vz=(t,e)=>zx(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),Mh=(t,e)=>zx(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class nd{constructor(e,n){this.clock=e,this.len=n}}class la{constructor(){this.clients=new Map}}const ss=(t,e,n)=>e.clients.forEach((r,i)=>{const s=t.doc.store.clients.get(i);if(s!=null){const o=s[s.length-1],a=o.id.clock+o.length;for(let l=0,u=r[l];l<r.length&&u.clock<a;u=r[++l])jx(t,s,u.clock,u.len,n)}}),Wz=(t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const i=pr((n+r)/2),s=t[i],o=s.clock;if(o<=e){if(e<o+s.len)return i;n=i+1}else r=i-1}return null},ua=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&Wz(n,e.clock)!==null},m1=t=>{t.clients.forEach(e=>{e.sort((i,s)=>i.clock-s.clock);let n,r;for(n=1,r=1;n<e.length;n++){const i=e[r-1],s=e[n];i.clock+i.len>=s.clock?e[r-1]=new nd(i.clock,is(i.len,s.clock+s.len-i.clock)):(r<n&&(e[r]=s),r++)}e.length=r})},yp=t=>{const e=new la;for(let n=0;n<t.length;n++)t[n].clients.forEach((r,i)=>{if(!e.clients.has(i)){const s=r.slice();for(let o=n+1;o<t.length;o++)ZI(s,t[o].clients.get(i)||[]);e.clients.set(i,s)}});return m1(e),e},dl=(t,e,n,r)=>{xi(t.clients,e,()=>[]).push(new nd(n,r))},Bx=()=>new la,Gz=t=>{const e=Bx();return t.clients.forEach((n,r)=>{const i=[];for(let s=0;s<n.length;s++){const o=n[s];if(o.deleted){const a=o.id.clock;let l=o.length;if(s+1<n.length)for(let u=n[s+1];s+1<n.length&&u.deleted;u=n[++s+1])l+=u.length;i.push(new nd(a,l))}}i.length>0&&e.clients.set(r,i)}),e},g1=(t,e)=>{$e(t.restEncoder,e.clients.size),Xs(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),$e(t.restEncoder,n);const i=r.length;$e(t.restEncoder,i);for(let s=0;s<i;s++){const o=r[s];t.writeDsClock(o.clock),t.writeDsLen(o.len)}})},Kz=t=>{const e=new la,n=ot(t.restDecoder);for(let r=0;r<n;r++){t.resetDsCurVal();const i=ot(t.restDecoder),s=ot(t.restDecoder);if(s>0){const o=xi(e.clients,i,()=>[]);for(let a=0;a<s;a++)o.push(new nd(t.readDsClock(),t.readDsLen()))}}return e},X2=(t,e,n)=>{const r=new la,i=ot(t.restDecoder);for(let s=0;s<i;s++){t.resetDsCurVal();const o=ot(t.restDecoder),a=ot(t.restDecoder),l=n.clients.get(o)||[],u=Et(n,o);for(let c=0;c<a;c++){const d=t.readDsClock(),h=d+t.readDsLen();if(d<u){u<h&&dl(r,o,u,h-u);let f=mr(l,d),p=l[f];for(!p.deleted&&p.id.clock<d&&(l.splice(f+1,0,o0(e,p,d-p.id.clock)),f++);f<l.length&&(p=l[f++],p.id.clock<h);)p.deleted||(h<p.id.clock+p.length&&l.splice(f,0,o0(e,p,h-p.id.clock)),p.delete(e))}else dl(r,o,d,h-d)}}if(r.clients.size>0){const s=new rd;return $e(s.restEncoder,0),g1(s,r),s.toUint8Array()}return null},Fx=sx;class oo extends ex{constructor({guid:e=RL(),collectionid:n=null,gc:r=!0,gcFilter:i=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:a=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=Fx(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new Ux,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=K2(u=>{this.on("load",()=>{this.isLoaded=!0,u(this)})});const l=()=>K2(u=>{const c=d=>{(d===void 0||d===!0)&&(this.off("sync",c),u())};this.on("sync",c)});this.on("sync",u=>{u===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=u===void 0||u===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const e=this._item;e!==null&&!this.shouldLoad&&Je(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Xs(this.subdocs).map(e=>e.guid))}transact(e,n=null){return Je(this,e,n)}get(e,n=jt){const r=xi(this.share,e,()=>{const s=new n;return s._integrate(this,null),s}),i=r.constructor;if(n!==jt&&i!==n)if(i===jt){const s=new n;s._map=r._map,r._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=r._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=r._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Lo)}getText(e=""){return this.get(e,as)}getMap(e=""){return this.get(e,Jo)}getXmlElement(e=""){return this.get(e,cn)}getXmlFragment(e=""){return this.get(e,Qs)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){this.isDestroyed=!0,Xs(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new oo({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,Je(e.parent.doc,r=>{const i=n.doc;e.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Yz{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=ot(this.restDecoder),this.dsCurrVal}readDsLen(){const e=ot(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class e0 extends Yz{constructor(e){super(e),this.keys=[],ot(e),this.keyClockDecoder=new _h(Gn(e)),this.clientDecoder=new Gu(Gn(e)),this.leftClockDecoder=new _h(Gn(e)),this.rightClockDecoder=new _h(Gn(e)),this.infoDecoder=new G2(Gn(e),ll),this.stringDecoder=new TL(Gn(e)),this.parentInfoDecoder=new G2(Gn(e),ll),this.typeRefDecoder=new Gu(Gn(e)),this.lenDecoder=new Gu(Gn(e))}readLeftID(){return new Ro(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Ro(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Kc(this.restDecoder)}readBuf(){return Gn(this.restDecoder)}readJSON(){return Kc(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const n=this.stringDecoder.read();return this.keys.push(n),n}}}class Zz{constructor(){this.restEncoder=Ol()}toUint8Array(){return dr(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){$e(this.restEncoder,e)}writeDsLen(e){$e(this.restEncoder,e)}}class Jz extends Zz{writeLeftID(e){$e(this.restEncoder,e.client),$e(this.restEncoder,e.clock)}writeRightID(e){$e(this.restEncoder,e.client),$e(this.restEncoder,e.clock)}writeClient(e){$e(this.restEncoder,e)}writeInfo(e){fp(this.restEncoder,e)}writeString(e){Do(this.restEncoder,e)}writeParentInfo(e){$e(this.restEncoder,e?1:0)}writeTypeRef(e){$e(this.restEncoder,e)}writeLen(e){$e(this.restEncoder,e)}writeAny(e){Ko(this.restEncoder,e)}writeBuf(e){Nn(this.restEncoder,e)}writeJSON(e){Do(this.restEncoder,JSON.stringify(e))}writeKey(e){Do(this.restEncoder,e)}}class Xz{constructor(){this.restEncoder=Ol(),this.dsCurrVal=0}toUint8Array(){return dr(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,$e(this.restEncoder,n)}writeDsLen(e){e===0&&pn(),$e(this.restEncoder,e-1),this.dsCurrVal+=e}}class rd extends Xz{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Ch,this.clientEncoder=new Wu,this.leftClockEncoder=new Ch,this.rightClockEncoder=new Ch,this.infoEncoder=new j2(fp),this.stringEncoder=new vL,this.parentInfoEncoder=new j2(fp),this.typeRefEncoder=new Wu,this.lenEncoder=new Wu}toUint8Array(){const e=Ol();return $e(e,0),Nn(e,this.keyClockEncoder.toUint8Array()),Nn(e,this.clientEncoder.toUint8Array()),Nn(e,this.leftClockEncoder.toUint8Array()),Nn(e,this.rightClockEncoder.toUint8Array()),Nn(e,dr(this.infoEncoder)),Nn(e,this.stringEncoder.toUint8Array()),Nn(e,dr(this.parentInfoEncoder)),Nn(e,this.typeRefEncoder.toUint8Array()),Nn(e,this.lenEncoder.toUint8Array()),Y0(e,dr(this.restEncoder)),dr(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Ko(this.restEncoder,e)}writeBuf(e){Nn(this.restEncoder,e)}writeJSON(e){Ko(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const Qz=(t,e,n,r)=>{r=is(r,e[0].id.clock);const i=mr(e,r);$e(t.restEncoder,e.length-i),t.writeClient(n),$e(t.restEncoder,r);const s=e[i];s.write(t,r-s.id.clock);for(let o=i+1;o<e.length;o++)e[o].write(t,0)},Px=(t,e,n)=>{const r=new Map;n.forEach((i,s)=>{Et(e,s)>i&&r.set(s,i)}),id(e).forEach((i,s)=>{n.has(s)||r.set(s,0)}),$e(t.restEncoder,r.size),Xs(r.entries()).sort((i,s)=>s[0]-i[0]).forEach(([i,s])=>{Qz(t,e.clients.get(i),i,s)})},eB=(t,e)=>{const n=fr(),r=ot(t.restDecoder);for(let i=0;i<r;i++){const s=ot(t.restDecoder),o=new Array(s),a=t.readClient();let l=ot(t.restDecoder);n.set(a,{i:0,refs:o});for(let u=0;u<s;u++){const c=t.readInfo();switch(K0&c){case 0:{const d=t.readLen();o[u]=new Jn(De(a,l),d),l+=d;break}case 10:{const d=ot(t.restDecoder);o[u]=new ur(De(a,l),d),l+=d;break}default:{const d=(c&(di|dn))===0,h=new Ke(De(a,l),null,(c&dn)===dn?t.readLeftID():null,null,(c&di)===di?t.readRightID():null,d?t.readParentInfo()?e.get(t.readString()):t.readLeftID():null,d&&(c&ol)===ol?t.readString():null,h8(t,c));o[u]=h,l+=h.length}}}}return n},tB=(t,e,n)=>{const r=[];let i=Xs(n.keys()).sort((f,p)=>f-p);if(i.length===0)return null;const s=()=>{if(i.length===0)return null;let f=n.get(i[i.length-1]);for(;f.refs.length===f.i;)if(i.pop(),i.length>0)f=n.get(i[i.length-1]);else return null;return f};let o=s();if(o===null)return null;const a=new Ux,l=new Map,u=(f,p)=>{const m=l.get(f);(m==null||m>p)&&l.set(f,p)};let c=o.refs[o.i++];const d=new Map,h=()=>{for(const f of r){const p=f.id.client,m=n.get(p);m?(m.i--,a.clients.set(p,m.refs.slice(m.i)),n.delete(p),m.i=0,m.refs=[]):a.clients.set(p,[f]),i=i.filter(g=>g!==p)}r.length=0};for(;;){if(c.constructor!==ur){const p=xi(d,c.id.client,()=>Et(e,c.id.client))-c.id.clock;if(p<0)r.push(c),u(c.id.client,c.id.clock-1),h();else{const m=c.getMissing(t,e);if(m!==null){r.push(c);const g=n.get(m)||{refs:[],i:0};if(g.refs.length===g.i)u(m,Et(e,m)),h();else{c=g.refs[g.i++];continue}}else(p===0||p<c.length)&&(c.integrate(t,p),d.set(c.id.client,c.id.clock+c.length))}}if(r.length>0)c=r.pop();else if(o!==null&&o.i<o.refs.length)c=o.refs[o.i++];else{if(o=s(),o===null)break;c=o.refs[o.i++]}}if(a.clients.size>0){const f=new rd;return Px(f,a,new Map),$e(f.restEncoder,0),{missing:l,update:f.toUint8Array()}}return null},nB=(t,e)=>Px(t,e.doc.store,e.beforeState),rB=(t,e,n,r=new e0(t))=>Je(e,i=>{i.local=!1;let s=!1;const o=i.doc,a=o.store,l=eB(r,o),u=tB(i,a,l),c=a.pendingStructs;if(c){for(const[h,f]of c.missing)if(f<Et(a,h)){s=!0;break}if(u){for(const[h,f]of u.missing){const p=c.missing.get(h);(p==null||p>f)&&c.missing.set(h,f)}c.update=a4([c.update,u.update])}}else a.pendingStructs=u;const d=X2(r,i,a);if(a.pendingDs){const h=new e0(s1(a.pendingDs));ot(h.restDecoder);const f=X2(h,i,a);d&&f?a.pendingDs=a4([d,f]):a.pendingDs=d||f}else a.pendingDs=d;if(s){const h=a.pendingStructs.update;a.pendingStructs=null,vp(i.doc,h)}},n,!1),vp=(t,e,n,r=e0)=>{const i=s1(e);rB(i,t,n,new r(i))};class iB{constructor(){this.l=[]}}const Q2=()=>new iB,e4=(t,e)=>t.l.push(e),t4=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(i=>e!==i),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},$x=(t,e,n)=>u1(t.l,[e,n]);class Ro{constructor(e,n){this.client=e,this.clock=n}}const xu=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,De=(t,e)=>new Ro(t,e),hl=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw pn()},fl=(t,e)=>{for(;e!==null;){if(e.parent===t)return!0;e=e.parent._item}return!1};class t0{constructor(e,n,r,i=0){this.type=e,this.tname=n,this.item=r,this.assoc=i}}class sB{constructor(e,n,r=0){this.type=e,this.index=n,this.assoc=r}}const oB=(t,e,n=0)=>new sB(t,e,n),wu=(t,e,n)=>{let r=null,i=null;return t._item===null?i=hl(t):r=De(t._item.id.client,t._item.id.clock),new t0(r,i,e,n)},Nh=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return wu(t,null,n);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return wu(t,De(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return wu(t,r.lastId,n);r=r.right}return wu(t,null,n)},aB=(t,e)=>{const n=Io(t,e),r=e.clock-n.id.clock;return{item:n,diff:r}},lB=(t,e,n=!0)=>{const r=e.store,i=t.item,s=t.type,o=t.tname,a=t.assoc;let l=null,u=0;if(i!==null){if(Et(r,i.client)<=i.clock)return null;const c=n?Ep(r,i):aB(r,i),d=c.item;if(!(d instanceof Ke))return null;if(l=d.parent,l._item===null||!l._item.deleted){u=d.deleted||!d.countable?0:c.diff+(a>=0?0:1);let h=d.left;for(;h!==null;)!h.deleted&&h.countable&&(u+=h.length),h=h.left}}else{if(o!==null)l=e.get(o);else if(s!==null){if(Et(r,s.client)<=s.clock)return null;const{item:c}=n?Ep(r,s):{item:Io(r,s)};if(c instanceof Ke&&c.content instanceof yr)l=c.content.type;else return null}else throw pn();a>=0?u=l._length:u=0}return oB(l,u,t.assoc)};class b1{constructor(e,n){this.ds=e,this.sv=n}}const Hx=(t,e)=>new b1(t,e),Dh=t=>Hx(Gz(t.store),id(t.store)),Ms=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!ua(e.ds,t.id),xp=(t,e)=>{const n=xi(t.meta,xp,Js),r=t.doc.store;n.has(e)||(e.sv.forEach((i,s)=>{i<Et(r,s)&&kn(t,De(s,i))}),ss(t,e.ds,i=>{}),n.add(e))};class Ux{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const id=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const i=n[n.length-1];e.set(r,i.id.clock+i.length)}),e},Et=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},qx=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw pn()}n.push(e)},mr=(t,e)=>{let n=0,r=t.length-1,i=t[r],s=i.id.clock;if(s===e)return r;let o=pr(e/(s+i.length-1)*r);for(;n<=r;){if(i=t[o],s=i.id.clock,s<=e){if(e<s+i.length)return o;n=o+1}else r=o-1;o=pr((n+r)/2)}throw pn()},uB=(t,e)=>{const n=t.clients.get(e.client);return n[mr(n,e.clock)]},Io=uB,wp=(t,e,n)=>{const r=mr(e,n),i=e[r];return i.id.clock<n&&i instanceof Ke?(e.splice(r+1,0,o0(t,i,n-i.id.clock)),r+1):r},kn=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[wp(t,n,e.clock)]},n4=(t,e,n)=>{const r=e.clients.get(n.client),i=mr(r,n.clock),s=r[i];return n.clock!==s.id.clock+s.length-1&&s.constructor!==Jn&&r.splice(i+1,0,o0(t,s,n.clock-s.id.clock+1)),s},cB=(t,e,n)=>{const r=t.clients.get(e.id.client);r[mr(r,e.id.clock)]=n},jx=(t,e,n,r,i)=>{if(r===0)return;const s=n+r;let o=wp(t,e,n),a;do a=e[o++],s<a.id.clock+a.length&&wp(t,e,s),i(a);while(o<e.length&&e[o].id.clock<s)};class dB{constructor(e,n,r){this.doc=e,this.deleteSet=new la,this.beforeState=id(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const r4=(t,e)=>e.deleteSet.clients.size===0&&!YI(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(m1(e.deleteSet),nB(t,e),g1(t,e.deleteSet),!0),i4=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&xi(t.changed,e,Js).add(n)},Yu=(t,e)=>{let n=t[e],r=t[e-1],i=e;for(;i>0;n=r,r=t[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof Ke&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const s=e-i;return s&&t.splice(e+1-s,s),s},hB=(t,e,n)=>{for(const[r,i]of t.clients.entries()){const s=e.clients.get(r);for(let o=i.length-1;o>=0;o--){const a=i[o],l=a.clock+a.len;for(let u=mr(s,a.clock),c=s[u];u<s.length&&c.id.clock<l;c=s[++u]){const d=s[u];if(a.clock+a.len<=d.id.clock)break;d instanceof Ke&&d.deleted&&!d.keep&&n(d)&&d.gc(e,!1)}}}},fB=(t,e)=>{t.clients.forEach((n,r)=>{const i=e.clients.get(r);for(let s=n.length-1;s>=0;s--){const o=n[s],a=Go(i.length-1,1+mr(i,o.clock+o.len-1));for(let l=a,u=i[l];l>0&&u.id.clock>=o.clock;u=i[l])l-=1+Yu(i,l)}})},Vx=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,i=r.store,s=n.deleteSet,o=n._mergeStructs;try{m1(s),n.afterState=id(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const a=[];n.changed.forEach((l,u)=>a.push(()=>{(u._item===null||!u._item.deleted)&&u._callObserver(n,l)})),a.push(()=>{n.changedParentTypes.forEach((l,u)=>{u._dEH.l.length>0&&(u._item===null||!u._item.deleted)&&(l=l.filter(c=>c.target._item===null||!c.target._item.deleted),l.forEach(c=>{c.currentTarget=u,c._path=null}),l.sort((c,d)=>c.path.length-d.path.length),a.push(()=>{$x(u._dEH,l,n)}))}),a.push(()=>r.emit("afterTransaction",[n,r])),a.push(()=>{n._needFormattingCleanup&&RB(n)})}),u1(a,[])}finally{r.gc&&hB(s,i,r.gcFilter),fB(s,i),n.afterState.forEach((c,d)=>{const h=n.beforeState.get(d)||0;if(h!==c){const f=i.clients.get(d),p=is(mr(f,h),1);for(let m=f.length-1;m>=p;)m-=1+Yu(f,m)}});for(let c=o.length-1;c>=0;c--){const{client:d,clock:h}=o[c].id,f=i.clients.get(d),p=mr(f,h);p+1<f.length&&Yu(f,p+1)>1||p>0&&Yu(f,p)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(jz(p1,Nx,"[yjs] ",Dx,Ox,"Changed the client-id because another client seems to be using it."),r.clientID=Fx()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const c=new Jz;r4(c,n)&&r.emit("update",[c.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const c=new rd;r4(c,n)&&r.emit("updateV2",[c.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:u}=n;(a.size>0||u.size>0||l.size>0)&&(a.forEach(c=>{c.clientID=r.clientID,c.collectionid==null&&(c.collectionid=r.collectionid),r.subdocs.add(c)}),u.forEach(c=>r.subdocs.delete(c)),r.emit("subdocs",[{loaded:l,added:a,removed:u},r,n]),u.forEach(c=>c.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):Vx(t,e+1)}}},Je=(t,e,n=null,r=!0)=>{const i=t._transactionCleanups;let s=!1,o=null;t._transaction===null&&(s=!0,t._transaction=new dB(t,n,r),i.push(t._transaction),i.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{o=e(t._transaction)}finally{if(s){const a=t._transaction===i[0];t._transaction=null,a&&Vx(i,0)}}return o};class pB{constructor(e,n){this.insertions=n,this.deletions=e,this.meta=new Map}}const s4=(t,e,n)=>{ss(t,n.deletions,r=>{r instanceof Ke&&e.scope.some(i=>i===t.doc||fl(i,r))&&k1(r,!1)})},o4=(t,e,n)=>{let r=null;const i=t.doc,s=t.scope;Je(i,a=>{for(;e.length>0&&t.currStackItem===null;){const l=i.store,u=e.pop(),c=new Set,d=[];let h=!1;ss(a,u.insertions,f=>{if(f instanceof Ke){if(f.redone!==null){let{item:p,diff:m}=Ep(l,f.id);m>0&&(p=kn(a,De(p.id.client,p.id.clock+m))),f=p}!f.deleted&&s.some(p=>p===a.doc||fl(p,f))&&d.push(f)}}),ss(a,u.deletions,f=>{f instanceof Ke&&s.some(p=>p===a.doc||fl(p,f))&&!ua(u.insertions,f.id)&&c.add(f)}),c.forEach(f=>{h=d8(a,f,c,u.insertions,t.ignoreRemoteMapChanges,t)!==null||h});for(let f=d.length-1;f>=0;f--){const p=d[f];t.deleteFilter(p)&&(p.delete(a),h=!0)}t.currStackItem=h?u:null}a.changed.forEach((l,u)=>{l.has(null)&&u._searchMarker&&(u._searchMarker.length=0)}),r=a},t);const o=t.currStackItem;if(o!=null){const a=r.changedParentTypes;t.emit("stack-item-popped",[{stackItem:o,type:n,changedParentTypes:a,origin:t},t]),t.currStackItem=null}return o};class Wx extends ex{constructor(e,{captureTimeout:n=500,captureTransaction:r=l=>!0,deleteFilter:i=()=>!0,trackedOrigins:s=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:a=Wo(e)?e[0].doc:e instanceof oo?e:e.doc}={}){super(),this.scope=[],this.doc=a,this.addToScope(e),this.deleteFilter=i,s.add(this),this.trackedOrigins=s,this.captureTransaction=r,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=n,this.afterTransactionHandler=l=>{if(!this.captureTransaction(l)||!this.scope.some(g=>l.changedParentTypes.has(g)||g===this.doc)||!this.trackedOrigins.has(l.origin)&&(!l.origin||!this.trackedOrigins.has(l.origin.constructor)))return;const u=this.undoing,c=this.redoing,d=u?this.redoStack:this.undoStack;u?this.stopCapturing():c||this.clear(!1,!0);const h=new la;l.afterState.forEach((g,y)=>{const x=l.beforeState.get(y)||0,k=g-x;k>0&&dl(h,y,x,k)});const f=IL();let p=!1;if(this.lastChange>0&&f-this.lastChange<this.captureTimeout&&d.length>0&&!u&&!c){const g=d[d.length-1];g.deletions=yp([g.deletions,l.deleteSet]),g.insertions=yp([g.insertions,h])}else d.push(new pB(l.deleteSet,h)),p=!0;!u&&!c&&(this.lastChange=f),ss(l,l.deleteSet,g=>{g instanceof Ke&&this.scope.some(y=>y===l.doc||fl(y,g))&&k1(g,!0)});const m=[{stackItem:d[d.length-1],origin:l.origin,type:u?"redo":"undo",changedParentTypes:l.changedParentTypes},this];p?this.emit("stack-item-added",m):this.emit("stack-item-updated",m)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){const n=new Set(this.scope);e=Wo(e)?e:[e],e.forEach(r=>{n.has(r)||(n.add(r),(r instanceof jt?r.doc!==this.doc:r!==this.doc)&&Ix("[yjs#509] Not same Y.Doc"),this.scope.push(r))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,n=!0){(e&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(r=>{e&&(this.undoStack.forEach(i=>s4(r,this,i)),this.undoStack=[]),n&&(this.redoStack.forEach(i=>s4(r,this,i)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=o4(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=o4(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*mB(t){const e=ot(t.restDecoder);for(let n=0;n<e;n++){const r=ot(t.restDecoder),i=t.readClient();let s=ot(t.restDecoder);for(let o=0;o<r;o++){const a=t.readInfo();if(a===10){const l=ot(t.restDecoder);yield new ur(De(i,s),l),s+=l}else if((K0&a)!==0){const l=(a&(di|dn))===0,u=new Ke(De(i,s),null,(a&dn)===dn?t.readLeftID():null,null,(a&di)===di?t.readRightID():null,l?t.readParentInfo()?t.readString():t.readLeftID():null,l&&(a&ol)===ol?t.readString():null,h8(t,a));yield u,s+=u.length}else{const l=t.readLen();yield new Jn(De(i,s),l),s+=l}}}}class gB{constructor(e,n){this.gen=mB(e),this.curr=null,this.done=!1,this.filterSkips=n,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===ur);return this.curr}}class bB{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const yB=(t,e)=>{if(t.constructor===Jn){const{client:n,clock:r}=t.id;return new Jn(De(n,r+e),t.length-e)}else if(t.constructor===ur){const{client:n,clock:r}=t.id;return new ur(De(n,r+e),t.length-e)}else{const n=t,{client:r,clock:i}=n.id;return new Ke(De(r,i+e),null,De(r,i+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},a4=(t,e=e0,n=rd)=>{if(t.length===1)return t[0];const r=t.map(c=>new e(s1(c)));let i=r.map(c=>new gB(c,!0)),s=null;const o=new n,a=new bB(o);for(;i=i.filter(h=>h.curr!==null),i.sort((h,f)=>{if(h.curr.id.client===f.curr.id.client){const p=h.curr.id.clock-f.curr.id.clock;return p===0?h.curr.constructor===f.curr.constructor?0:h.curr.constructor===ur?1:-1:p}else return f.curr.id.client-h.curr.id.client}),i.length!==0;){const c=i[0],d=c.curr.id.client;if(s!==null){let h=c.curr,f=!1;for(;h!==null&&h.id.clock+h.length<=s.struct.id.clock+s.struct.length&&h.id.client>=s.struct.id.client;)h=c.next(),f=!0;if(h===null||h.id.client!==d||f&&h.id.clock>s.struct.id.clock+s.struct.length)continue;if(d!==s.struct.id.client)wa(a,s.struct,s.offset),s={struct:h,offset:0},c.next();else if(s.struct.id.clock+s.struct.length<h.id.clock)if(s.struct.constructor===ur)s.struct.length=h.id.clock+h.length-s.struct.id.clock;else{wa(a,s.struct,s.offset);const p=h.id.clock-s.struct.id.clock-s.struct.length;s={struct:new ur(De(d,s.struct.id.clock+s.struct.length),p),offset:0}}else{const p=s.struct.id.clock+s.struct.length-h.id.clock;p>0&&(s.struct.constructor===ur?s.struct.length-=p:h=yB(h,p)),s.struct.mergeWith(h)||(wa(a,s.struct,s.offset),s={struct:h,offset:0},c.next())}}else s={struct:c.curr,offset:0},c.next();for(let h=c.curr;h!==null&&h.id.client===d&&h.id.clock===s.struct.id.clock+s.struct.length&&h.constructor!==ur;h=c.next())wa(a,s.struct,s.offset),s={struct:h,offset:0}}s!==null&&(wa(a,s.struct,s.offset),s=null),vB(a);const l=r.map(c=>Kz(c)),u=yp(l);return g1(o,u),o.toUint8Array()},Gx=t=>{t.written>0&&(t.clientStructs.push({written:t.written,restEncoder:dr(t.encoder.restEncoder)}),t.encoder.restEncoder=Ol(),t.written=0)},wa=(t,e,n)=>{t.written>0&&t.currClient!==e.id.client&&Gx(t),t.written===0&&(t.currClient=e.id.client,t.encoder.writeClient(e.id.client),$e(t.encoder.restEncoder,e.id.clock+n)),e.write(t.encoder,n),t.written++},vB=t=>{Gx(t);const e=t.encoder.restEncoder;$e(e,t.clientStructs.length);for(let n=0;n<t.clientStructs.length;n++){const r=t.clientStructs[n];$e(e,r.written),Y0(e,r.restEncoder)}},l4="You must not compute changes after the event-handler fired.";class sd{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=xB(this.currentTarget,this.target))}deletes(e){return ua(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Fr(l4);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(i=>{if(i!==null){const s=n._map.get(i);let o,a;if(this.adds(s)){let l=s.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(s))if(l!==null&&this.deletes(l))o="delete",a=kh(l.content.getContent());else return;else l!==null&&this.deletes(l)?(o="update",a=kh(l.content.getContent())):(o="add",a=void 0)}else if(this.deletes(s))o="delete",a=kh(s.content.getContent());else return;e.set(i,{action:o,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Fr(l4);const n=this.target,r=Js(),i=Js(),s=[];if(e={added:r,deleted:i,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let a=null;const l=()=>{a&&s.push(a)};for(let u=n._start;u!==null;u=u.right)u.deleted?this.deletes(u)&&!this.adds(u)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=u.length,i.add(u)):this.adds(u)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(u.content.getContent()),r.add(u)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=u.length);a!==null&&a.retain===void 0&&l()}this._changes=e}return e}}const xB=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)!i.deleted&&i.countable&&(r+=i.length),i=i.right;n.unshift(r)}e=e._item.parent}return n},en=()=>{Ix("Invalid access: Add Yjs type to a document before reading data.")},Kx=80;let y1=0;class wB{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=y1++}}const kB=t=>{t.timestamp=y1++},Yx=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=y1++},EB=(t,e,n)=>{if(t.length>=Kx){const r=t.reduce((i,s)=>i.timestamp<s.timestamp?i:s);return Yx(r,e,n),r}else{const r=new wB(e,n);return t.push(r),r}},od=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((s,o)=>Vu(e-s.index)<Vu(e-o.index)?s:o);let r=t._start,i=0;for(n!==null&&(r=n.p,i=n.index,kB(n));r.right!==null&&i<e;){if(!r.deleted&&r.countable){if(e<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>e;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&Vu(n.index-i)<r.parent.length/Kx?(Yx(n,r,i),n):EB(t._searchMarker,r,i)},pl=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const i=t[r];if(n>0){let s=i.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(i.index-=s.length);if(s===null||s.marker===!0){t.splice(r,1);continue}i.p=s,s.marker=!0}(e<i.index||n>0&&e===i.index)&&(i.index=is(e,i.index+n))}},ad=(t,e,n)=>{const r=t,i=e.changedParentTypes;for(;xi(i,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;$x(r._eH,n,e)};class jt{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Q2(),this._dEH=Q2(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw nr()}clone(){throw nr()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){e4(this._eH,e)}observeDeep(e){e4(this._dEH,e)}unobserve(e){t4(this._eH,e)}unobserveDeep(e){t4(this._dEH,e)}toJSON(){}}const Zx=(t,e,n)=>{t.doc??en(),e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const i=[];let s=t._start;for(;s!==null&&r>0;){if(s.countable&&!s.deleted){const o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let a=e;a<o.length&&r>0;a++)i.push(o[a]),r--;e=0}}s=s.right}return i},Jx=t=>{t.doc??en();const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let i=0;i<r.length;i++)e.push(r[i])}n=n.right}return e},Xx=(t,e)=>{const n=[];let r=t._start;for(;r!==null;){if(r.countable&&Ms(r,e)){const i=r.content.getContent();for(let s=0;s<i.length;s++)n.push(i[s])}r=r.right}return n},ml=(t,e)=>{let n=0,r=t._start;for(t.doc??en();r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let s=0;s<i.length;s++)e(i[s],n++,t)}r=r.right}},Qx=(t,e)=>{const n=[];return ml(t,(r,i)=>{n.push(e(r,i,t))}),n},SB=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const i=n[r++];return n.length<=r&&(n=null),{done:!1,value:i}}}},e8=(t,e)=>{t.doc??en();const n=od(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},n0=(t,e,n,r)=>{let i=n;const s=t.doc,o=s.clientID,a=s.store,l=n===null?e._start:n.right;let u=[];const c=()=>{u.length>0&&(i=new Ke(De(o,Et(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new eo(u)),i.integrate(t,0),u=[])};r.forEach(d=>{if(d===null)u.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:u.push(d);break;default:switch(c(),d.constructor){case Uint8Array:case ArrayBuffer:i=new Ke(De(o,Et(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Il(new Uint8Array(d))),i.integrate(t,0);break;case oo:i=new Ke(De(o,Et(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Ll(d)),i.integrate(t,0);break;default:if(d instanceof jt)i=new Ke(De(o,Et(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new yr(d)),i.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),c()},t8=()=>Fr("Length exceeded!"),n8=(t,e,n,r)=>{if(n>e._length)throw t8();if(n===0)return e._searchMarker&&pl(e._searchMarker,n,r.length),n0(t,e,null,r);const i=n,s=od(e,n);let o=e._start;for(s!==null&&(o=s.p,n-=s.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&kn(t,De(o.id.client,o.id.clock+n));break}n-=o.length}return e._searchMarker&&pl(e._searchMarker,i,r.length),n0(t,e,o,r)},CB=(t,e,n)=>{let i=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return n0(t,e,i,n)},r8=(t,e,n,r)=>{if(r===0)return;const i=n,s=r,o=od(e,n);let a=e._start;for(o!==null&&(a=o.p,n-=o.index);a!==null&&n>0;a=a.right)!a.deleted&&a.countable&&(n<a.length&&kn(t,De(a.id.client,a.id.clock+n)),n-=a.length);for(;r>0&&a!==null;)a.deleted||(r<a.length&&kn(t,De(a.id.client,a.id.clock+r)),a.delete(t),r-=a.length),a=a.right;if(r>0)throw t8();e._searchMarker&&pl(e._searchMarker,i,-s+r)},r0=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},v1=(t,e,n,r)=>{const i=e._map.get(n)||null,s=t.doc,o=s.clientID;let a;if(r==null)a=new eo([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:a=new eo([r]);break;case Uint8Array:a=new Il(r);break;case oo:a=new Ll(r);break;default:if(r instanceof jt)a=new yr(r);else throw new Error("Unexpected content type")}new Ke(De(o,Et(s.store,o)),i,i&&i.lastId,null,null,e,n,a).integrate(t,0)},x1=(t,e)=>{t.doc??en();const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},i8=t=>{const e={};return t.doc??en(),t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},s8=(t,e)=>{t.doc??en();const n=t._map.get(e);return n!==void 0&&!n.deleted},_B=(t,e)=>{const n={};return t._map.forEach((r,i)=>{let s=r;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&Ms(s,e)&&(n[i]=s.content.getContent()[s.length-1])}),n},ku=t=>(t.doc??en(),Vz(t._map.entries(),e=>!e[1].deleted));class AB extends sd{}class Lo extends jt{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new Lo;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Lo}clone(){const e=new Lo;return e.insert(0,this.toArray().map(n=>n instanceof jt?n.clone():n)),e}get length(){return this.doc??en(),this._length}_callObserver(e,n){super._callObserver(e,n),ad(this,e,new AB(this,e))}insert(e,n){this.doc!==null?Je(this.doc,r=>{n8(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?Je(this.doc,n=>{CB(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?Je(this.doc,r=>{r8(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return e8(this,e)}toArray(){return Jx(this)}slice(e=0,n=this.length){return Zx(this,e,n)}toJSON(){return this.map(e=>e instanceof jt?e.toJSON():e)}map(e){return Qx(this,e)}forEach(e){ml(this,e)}[Symbol.iterator](){return SB(this)}_write(e){e.writeTypeRef(XB)}}const TB=t=>new Lo;class MB extends sd{constructor(e,n,r){super(e,n),this.keysChanged=r}}class Jo extends jt{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new Jo}clone(){const e=new Jo;return this.forEach((n,r)=>{e.set(r,n instanceof jt?n.clone():n)}),e}_callObserver(e,n){ad(this,e,new MB(this,e,n))}toJSON(){this.doc??en();const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];e[r]=i instanceof jt?i.toJSON():i}}),e}get size(){return[...ku(this)].length}keys(){return Mh(ku(this),e=>e[0])}values(){return Mh(ku(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Mh(ku(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??en(),this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?Je(this.doc,n=>{r0(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?Je(this.doc,r=>{v1(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return x1(this,e)}has(e){return s8(this,e)}clear(){this.doc!==null?Je(this.doc,e=>{this.forEach(function(n,r,i){r0(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(QB)}}const NB=t=>new Jo,ji=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&UL(t,e);class kp{constructor(e,n,r,i){this.left=e,this.right=n,this.index=r,this.currentAttributes=i}forward(){switch(this.right===null&&pn(),this.right.content.constructor){case Ot:this.right.deleted||ca(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const u4=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case Ot:e.right.deleted||ca(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n<e.right.length&&kn(t,De(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},Eu=(t,e,n,r)=>{const i=new Map,s=r?od(e,n):null;if(s){const o=new kp(s.p.left,s.p,s.index,i);return u4(t,o,n-s.index)}else{const o=new kp(null,e._start,0,i);return u4(t,o,n)}},o8=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Ot&&ji(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const i=t.doc,s=i.clientID;r.forEach((o,a)=>{const l=n.left,u=n.right,c=new Ke(De(s,Et(i.store,s)),l,l&&l.lastId,u,u&&u.id,e,null,new Ot(a,o));c.integrate(t,0),n.right=c,n.forward()})},ca=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},a8=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===Ot&&ji(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},l8=(t,e,n,r)=>{const i=t.doc,s=i.clientID,o=new Map;for(const a in r){const l=r[a],u=n.currentAttributes.get(a)??null;if(!ji(u,l)){o.set(a,u);const{left:c,right:d}=n;n.right=new Ke(De(s,Et(i.store,s)),c,c&&c.lastId,d,d&&d.id,e,null,new Ot(a,l)),n.right.integrate(t,0),n.forward()}}return o},Oh=(t,e,n,r,i)=>{n.currentAttributes.forEach((h,f)=>{i[f]===void 0&&(i[f]=null)});const s=t.doc,o=s.clientID;a8(n,i);const a=l8(t,e,n,i),l=r.constructor===String?new gr(r):r instanceof jt?new yr(r):new ao(r);let{left:u,right:c,index:d}=n;e._searchMarker&&pl(e._searchMarker,n.index,l.getLength()),c=new Ke(De(o,Et(s.store,o)),u,u&&u.lastId,c,c&&c.id,e,null,l),c.integrate(t,0),n.right=c,n.index=d,n.forward(),o8(t,e,n,a)},c4=(t,e,n,r,i)=>{const s=t.doc,o=s.clientID;a8(n,i);const a=l8(t,e,n,i);e:for(;n.right!==null&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===Ot));){if(!n.right.deleted)switch(n.right.content.constructor){case Ot:{const{key:l,value:u}=n.right.content,c=i[l];if(c!==void 0){if(ji(c,u))a.delete(l);else{if(r===0)break e;a.set(l,u)}n.right.delete(t)}else n.currentAttributes.set(l,u);break}default:r<n.right.length&&kn(t,De(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let l="";for(;r>0;r--)l+=`
585
+ `;n.right=new Ke(De(o,Et(s.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new gr(l)),n.right.integrate(t,0),n.forward()}o8(t,e,n,a)},u8=(t,e,n,r,i)=>{let s=e;const o=fr();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===Ot){const u=s.content;o.set(u.key,u)}s=s.right}let a=0,l=!1;for(;e!==s;){if(n===e&&(l=!0),!e.deleted){const u=e.content;switch(u.constructor){case Ot:{const{key:c,value:d}=u,h=r.get(c)??null;(o.get(c)!==u||h===d)&&(e.delete(t),a++,!l&&(i.get(c)??null)===d&&h!==d&&(h===null?i.delete(c):i.set(c,h))),!l&&!e.deleted&&ca(i,u);break}}}e=e.right}return a},DB=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===Ot){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},OB=t=>{let e=0;return Je(t.doc,n=>{let r=t._start,i=t._start,s=fr();const o=dp(s);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case Ot:ca(o,i.content);break;default:e+=u8(n,r,i,s,o),s=dp(o),r=i;break}i=i.right}}),e},RB=t=>{const e=new Set,n=t.doc;for(const[r,i]of t.afterState.entries()){const s=t.beforeState.get(r)||0;i!==s&&jx(t,n.store.clients.get(r),s,i,o=>{!o.deleted&&o.content.constructor===Ot&&o.constructor!==Jn&&e.add(o.parent)})}Je(n,r=>{ss(t,t.deleteSet,i=>{if(i instanceof Jn||!i.parent._hasFormatting||e.has(i.parent))return;const s=i.parent;i.content.constructor===Ot?e.add(s):DB(r,i)});for(const i of e)OB(i)})},d4=(t,e,n)=>{const r=n,i=dp(e.currentAttributes),s=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case yr:case ao:case gr:n<e.right.length&&kn(t,De(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}s&&u8(t,s,e.right,i,e.currentAttributes);const o=(e.left||e.right).parent;return o._searchMarker&&pl(o._searchMarker,e.index,-r+n),e};class IB extends sd{constructor(e,n,r){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(i=>{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];Je(e,r=>{const i=new Map,s=new Map;let o=this.target._start,a=null;const l={};let u="",c=0,d=0;const h=()=>{if(a!==null){let f=null;switch(a){case"delete":d>0&&(f={delete:d}),d=0;break;case"insert":(typeof u=="object"||u.length>0)&&(f={insert:u},i.size>0&&(f.attributes={},i.forEach((p,m)=>{p!==null&&(f.attributes[m]=p)}))),u="";break;case"retain":c>0&&(f={retain:c},HL(l)||(f.attributes=PL({},l))),c=0;break}f&&n.push(f),a=null}};for(;o!==null;){switch(o.content.constructor){case yr:case ao:this.adds(o)?this.deletes(o)||(h(),a="insert",u=o.content.getContent()[0],h()):this.deletes(o)?(a!=="delete"&&(h(),a="delete"),d+=1):o.deleted||(a!=="retain"&&(h(),a="retain"),c+=1);break;case gr:this.adds(o)?this.deletes(o)||(a!=="insert"&&(h(),a="insert"),u+=o.content.str):this.deletes(o)?(a!=="delete"&&(h(),a="delete"),d+=o.length):o.deleted||(a!=="retain"&&(h(),a="retain"),c+=o.length);break;case Ot:{const{key:f,value:p}=o.content;if(this.adds(o)){if(!this.deletes(o)){const m=i.get(f)??null;ji(m,p)?p!==null&&o.delete(r):(a==="retain"&&h(),ji(p,s.get(f)??null)?delete l[f]:l[f]=p)}}else if(this.deletes(o)){s.set(f,p);const m=i.get(f)??null;ji(m,p)||(a==="retain"&&h(),l[f]=m)}else if(!o.deleted){s.set(f,p);const m=l[f];m!==void 0&&(ji(m,p)?m!==null&&o.delete(r):(a==="retain"&&h(),p===null?delete l[f]:l[f]=p))}o.deleted||(a==="insert"&&h(),ca(i,o.content));break}}o=o.right}for(h();n.length>0;){const f=n[n.length-1];if(f.retain!==void 0&&f.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class as extends jt{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??en(),this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new as}clone(){const e=new as;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new IB(this,e,n);ad(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??en();let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===gr&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?Je(this.doc,r=>{const i=new kp(null,this._start,0,new Map);for(let s=0;s<e.length;s++){const o=e[s];if(o.insert!==void 0){const a=!n&&typeof o.insert=="string"&&s===e.length-1&&i.right===null&&o.insert.slice(-1)===`
586
+ `?o.insert.slice(0,-1):o.insert;(typeof a!="string"||a.length>0)&&Oh(r,this,i,a,o.attributes||{})}else o.retain!==void 0?c4(r,this,i,o.retain,o.attributes||{}):o.delete!==void 0&&d4(r,i,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){this.doc??en();const i=[],s=new Map,o=this.doc;let a="",l=this._start;function u(){if(a.length>0){const d={};let h=!1;s.forEach((p,m)=>{h=!0,d[m]=p});const f={insert:a};h&&(f.attributes=d),i.push(f),a=""}}const c=()=>{for(;l!==null;){if(Ms(l,e)||n!==void 0&&Ms(l,n))switch(l.content.constructor){case gr:{const d=s.get("ychange");e!==void 0&&!Ms(l,e)?(d===void 0||d.user!==l.id.client||d.type!=="removed")&&(u(),s.set("ychange",r?r("removed",l.id):{type:"removed"})):n!==void 0&&!Ms(l,n)?(d===void 0||d.user!==l.id.client||d.type!=="added")&&(u(),s.set("ychange",r?r("added",l.id):{type:"added"})):d!==void 0&&(u(),s.delete("ychange")),a+=l.content.str;break}case yr:case ao:{u();const d={insert:l.content.getContent()[0]};if(s.size>0){const h={};d.attributes=h,s.forEach((f,p)=>{h[p]=f})}i.push(d);break}case Ot:Ms(l,e)&&(u(),ca(s,l.content));break}l=l.right}u()};return e||n?Je(o,d=>{e&&xp(d,e),n&&xp(d,n),c()},"cleanup"):c(),i}insert(e,n,r){if(n.length<=0)return;const i=this.doc;i!==null?Je(i,s=>{const o=Eu(s,this,e,!r);r||(r={},o.currentAttributes.forEach((a,l)=>{r[l]=a})),Oh(s,this,o,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const i=this.doc;i!==null?Je(i,s=>{const o=Eu(s,this,e,!r);Oh(s,this,o,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?Je(r,i=>{d4(i,Eu(i,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,r){if(n===0)return;const i=this.doc;i!==null?Je(i,s=>{const o=Eu(s,this,e,!1);o.right!==null&&c4(s,this,o,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?Je(this.doc,n=>{r0(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?Je(this.doc,r=>{v1(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return x1(this,e)}getAttributes(){return i8(this)}_write(e){e.writeTypeRef(eF)}}const LB=t=>new as;class Rh{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??en()}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===cn||n.constructor===Qs)&&n._start!==null)e=n._start;else for(;e!==null;){const r=e.next;if(r!==null){e=r;break}else e.parent===this._root?e=null:e=e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class Qs extends jt{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Qs}clone(){const e=new Qs;return e.insert(0,this.toArray().map(n=>n instanceof jt?n.clone():n)),e}get length(){return this.doc??en(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Rh(this,e)}querySelector(e){e=e.toUpperCase();const r=new Rh(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),Xs(new Rh(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){ad(this,e,new FB(this,n,e))}toString(){return Qx(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},r){const i=e.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),ml(this,s=>{i.insertBefore(s.toDOM(e,n,r),null)}),i}insert(e,n){this.doc!==null?Je(this.doc,r=>{n8(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)Je(this.doc,r=>{const i=e&&e instanceof jt?e._item:e;n0(r,this,i,n)});else{const r=this._prelimContent,i=e===null?0:r.findIndex(s=>s===e)+1;if(i===0&&e!==null)throw Fr("Reference item not found");r.splice(i,0,...n)}}delete(e,n=1){this.doc!==null?Je(this.doc,r=>{r8(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return Jx(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return e8(this,e)}slice(e=0,n=this.length){return Zx(this,e,n)}forEach(e){ml(this,e)}_write(e){e.writeTypeRef(nF)}}const zB=t=>new Qs;class cn extends Qs{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new cn(this.nodeName)}clone(){const e=new cn(this.nodeName),n=this.getAttributes();return $L(n,(r,i)=>{e.setAttribute(i,r)}),e.insert(0,this.toArray().map(r=>r instanceof jt?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const a in e)r.push(a);r.sort();const i=r.length;for(let a=0;a<i;a++){const l=r[a];n.push(l+'="'+e[l]+'"')}const s=this.nodeName.toLocaleLowerCase(),o=n.length>0?" "+n.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}removeAttribute(e){this.doc!==null?Je(this.doc,n=>{r0(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?Je(this.doc,r=>{v1(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return x1(this,e)}hasAttribute(e){return s8(this,e)}getAttributes(e){return e?_B(this,e):i8(this)}toDOM(e=document,n={},r){const i=e.createElement(this.nodeName),s=this.getAttributes();for(const o in s){const a=s[o];typeof a=="string"&&i.setAttribute(o,a)}return ml(this,o=>{i.appendChild(o.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(tF),e.writeKey(this.nodeName)}}const BB=t=>new cn(t.readKey());class FB extends sd{constructor(e,n,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class i0 extends Jo{constructor(e){super(),this.hookName=e}_copy(){return new i0(this.hookName)}clone(){const e=new i0(this.hookName);return this.forEach((n,r)=>{e.set(r,n)}),e}toDOM(e=document,n={},r){const i=n[this.hookName];let s;return i!==void 0?s=i.createDom(this):s=document.createElement(this.hookName),s.setAttribute("data-yjs-hook",this.hookName),r!==void 0&&r._createAssociation(s,this),s}_write(e){e.writeTypeRef(rF),e.writeKey(this.hookName)}}const PB=t=>new i0(t.readKey());class Rn extends as{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Rn}clone(){const e=new Rn;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,r){const i=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const n=[];for(const i in e.attributes){const s=[];for(const o in e.attributes[i])s.push({key:o,value:e.attributes[i][o]});s.sort((o,a)=>o.key<a.key?-1:1),n.push({nodeName:i,attrs:s})}n.sort((i,s)=>i.nodeName<s.nodeName?-1:1);let r="";for(let i=0;i<n.length;i++){const s=n[i];r+=`<${s.nodeName}`;for(let o=0;o<s.attrs.length;o++){const a=s.attrs[o];r+=` ${a.key}="${a.value}"`}r+=">"}r+=e.insert;for(let i=n.length-1;i>=0;i--)r+=`</${n[i].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(iF)}}const $B=t=>new Rn;class w1{constructor(e,n){this.id=e,this.length=n}get deleted(){throw nr()}mergeWith(e){return!1}write(e,n,r){throw nr()}integrate(e,n){throw nr()}}const HB=0;class Jn extends w1{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),qx(e.doc.store,this)}write(e,n){e.writeInfo(HB),e.writeLen(this.length-n)}getMissing(e,n){return null}}class Il{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Il(this.content)}splice(e){throw nr()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}const UB=t=>new Il(t.readBuf());class gl{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new gl(this.len)}splice(e){const n=new gl(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){dl(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const qB=t=>new gl(t.readLen()),c8=(t,e)=>new oo({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Ll{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Ll(c8(this.doc.guid,this.opts))}splice(e){throw nr()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}const jB=t=>new Ll(c8(t.readString(),t.readAny()));class ao{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new ao(this.embed)}splice(e){throw nr()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}const VB=t=>new ao(t.readJSON());class Ot{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Ot(this.key,this.value)}splice(e){throw nr()}mergeWith(e){return!1}integrate(e,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const WB=t=>new Ot(t.readKey(),t.readJSON());class s0{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new s0(this.arr)}splice(e){const n=new s0(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let i=n;i<r;i++){const s=this.arr[i];e.writeString(s===void 0?"undefined":JSON.stringify(s))}}getRef(){return 2}}const GB=t=>{const e=t.readLen(),n=[];for(let r=0;r<e;r++){const i=t.readString();i==="undefined"?n.push(void 0):n.push(JSON.parse(i))}return new s0(n)},KB=Zc("node_env")==="development";class eo{constructor(e){this.arr=e,KB&&ux(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new eo(this.arr)}splice(e){const n=new eo(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let i=n;i<r;i++){const s=this.arr[i];e.writeAny(s)}}getRef(){return 8}}const YB=t=>{const e=t.readLen(),n=[];for(let r=0;r<e;r++)n.push(t.readAny());return new eo(n)};class gr{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new gr(this.str)}splice(e){const n=new gr(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const ZB=t=>new gr(t.readString()),JB=[TB,NB,LB,BB,zB,PB,$B],XB=0,QB=1,eF=2,tF=3,nF=4,rF=5,iF=6;class yr{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new yr(this.type._copy())}splice(e){throw nr()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const sF=t=>new yr(JB[t.readTypeRef()](t)),Ep=(t,e)=>{let n=e,r=0,i;do r>0&&(n=De(n.client,n.clock+r)),i=Io(t,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof Ke);return{item:i,diff:r}},k1=(t,e)=>{for(;t!==null&&t.keep!==e;)t.keep=e,t=t.parent._item},o0=(t,e,n)=>{const{client:r,clock:i}=e.id,s=new Ke(De(r,i+n),e,De(r,i+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=De(e.redone.client,e.redone.clock+n)),e.right=s,s.right!==null&&(s.right.left=s),t._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=n,s},h4=(t,e)=>n1(t,n=>ua(n.deletions,e)),d8=(t,e,n,r,i,s)=>{const o=t.doc,a=o.store,l=o.clientID,u=e.redone;if(u!==null)return kn(t,u);let c=e.parent._item,d=null,h;if(c!==null&&c.deleted===!0){if(c.redone===null&&(!n.has(c)||d8(t,c,n,r,i,s)===null))return null;for(;c.redone!==null;)c=kn(t,c.redone)}const f=c===null?e.parent:c.content.type;if(e.parentSub===null){for(d=e.left,h=e;d!==null;){let y=d;for(;y!==null&&y.parent._item!==c;)y=y.redone===null?null:kn(t,y.redone);if(y!==null&&y.parent._item===c){d=y;break}d=d.left}for(;h!==null;){let y=h;for(;y!==null&&y.parent._item!==c;)y=y.redone===null?null:kn(t,y.redone);if(y!==null&&y.parent._item===c){h=y;break}h=h.right}}else{if(h=null,e.right&&!i){for(d=e;d!==null&&d.right!==null&&(d.right.redone||ua(r,d.right.id)||h4(s.undoStack,d.right.id)||h4(s.redoStack,d.right.id));)for(d=d.right;d.redone;)d=kn(t,d.redone);if(d&&d.right!==null)return null}else d=f._map.get(e.parentSub)||null;d!==null&&d.parent._item!==c&&(d=f._map.get(e.parentSub)||null)}const p=Et(a,l),m=De(l,p),g=new Ke(m,d,d&&d.lastId,h,h&&h.id,f,e.parentSub,e.content.copy());return e.redone=m,k1(g,!0),g.integrate(t,0),g};class Ke extends w1{constructor(e,n,r,i,s,o,a,l){super(e,l.getLength()),this.origin=r,this.left=n,this.right=i,this.rightOrigin=s,this.parent=o,this.parentSub=a,this.redone=null,this.content=l,this.info=this.content.isCountable()?$2:0}set marker(e){(this.info&Sh)>0!==e&&(this.info^=Sh)}get marker(){return(this.info&Sh)>0}get keep(){return(this.info&P2)>0}set keep(e){this.keep!==e&&(this.info^=P2)}get countable(){return(this.info&$2)>0}get deleted(){return(this.info&Eh)>0}set deleted(e){this.deleted!==e&&(this.info^=Eh)}markDeleted(){this.info|=Eh}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Et(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Et(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Ro&&this.id.client!==this.parent.client&&this.parent.clock>=Et(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=n4(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=kn(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Jn||this.right&&this.right.constructor===Jn)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===Ke?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===Ke&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Ro){const r=Io(n,this.parent);r.constructor===Jn?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=n4(e,e.doc.store,De(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,i;if(r!==null)i=r.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const s=new Set,o=new Set;for(;i!==null&&i!==this.right;){if(o.add(i),s.add(i),xu(this.origin,i.origin)){if(i.id.client<this.id.client)r=i,s.clear();else if(xu(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&o.has(Io(e.doc.store,i.origin)))s.has(Io(e.doc.store,i.origin))||(r=i,s.clear());else break;i=i.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),qx(e.doc.store,this),this.content.integrate(e,this),i4(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new Jn(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:De(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&xu(e.origin,this.lastId)&&this.right===e&&xu(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),dl(e.deleteSet,this.id.client,this.id.clock,this.length),i4(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw pn();this.content.gc(e),n?cB(e,this,new Jn(this.id,this.length)):this.content=new gl(this.length)}write(e,n){const r=n>0?De(this.id.client,this.id.clock+n-1):this.origin,i=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&K0|(r===null?0:dn)|(i===null?0:di)|(s===null?0:ol);if(e.writeInfo(o),r!==null&&e.writeLeftID(r),i!==null&&e.writeRightID(i),r===null&&i===null){const a=this.parent;if(a._item!==void 0){const l=a._item;if(l===null){const u=hl(a);e.writeParentInfo(!0),e.writeString(u)}else e.writeParentInfo(!1),e.writeLeftID(l.id)}else a.constructor===String?(e.writeParentInfo(!0),e.writeString(a)):a.constructor===Ro?(e.writeParentInfo(!1),e.writeLeftID(a)):pn();s!==null&&e.writeString(s)}this.content.write(e,n)}}const h8=(t,e)=>oF[e&K0](t),oF=[()=>{pn()},qB,GB,UB,ZB,VB,WB,sF,YB,jB,()=>{pn()}],aF=10;class ur extends w1{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){pn()}write(e,n){e.writeInfo(aF),$e(e.restEncoder,this.length-n)}getMissing(e,n){return null}}const f8=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},p8="__ $YJS$ __";f8[p8]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");f8[p8]=!0;const lF=()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else n!==void 0&&n()}},uF=/[\uD800-\uDBFF]/,cF=/[\uDC00-\uDFFF]/,dF=(t,e)=>{let n=0,r=0;for(;n<t.length&&n<e.length&&t[n]===e[n];)n++;for(n>0&&uF.test(t[n-1])&&n--;r+n<t.length&&r+n<e.length&&t[t.length-r-1]===e[e.length-r-1];)r++;return r>0&&cF.test(t[t.length-r])&&r--,{index:n,remove:t.length-n-r,insert:e.slice(n,e.length-r)}},hF=dF,Lr=(t,e)=>t>>>e|t<<32-e,fF=t=>Lr(t,2)^Lr(t,13)^Lr(t,22),pF=t=>Lr(t,6)^Lr(t,11)^Lr(t,25),mF=t=>Lr(t,7)^Lr(t,18)^t>>>3,gF=t=>Lr(t,17)^Lr(t,19)^t>>>10,bF=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),yF=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);class vF{constructor(){const e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(yF),this._W=new Uint32Array(e,64,64)}_updateHash(){const e=this._H,n=this._W;for(let d=16;d<64;d++)n[d]=gF(n[d-2])+n[d-7]+mF(n[d-15])+n[d-16];let r=e[0],i=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7];for(let d=0,h,f;d<64;d++)h=c+pF(a)+(a&l^~a&u)+bF[d]+n[d]>>>0,f=fF(r)+(r&i^r&s^i&s)>>>0,c=u,u=l,l=a,a=o+h>>>0,o=s,s=i,i=r,r=h+f>>>0;e[0]+=r,e[1]+=i,e[2]+=s,e[3]+=o,e[4]+=a,e[5]+=l,e[6]+=u,e[7]+=c}digest(e){let n=0;for(;n+56<=e.length;){let o=0;for(;o<16&&n+3<e.length;o++)this._W[o]=e[n++]<<24|e[n++]<<16|e[n++]<<8|e[n++];if(n%64!==0){for(this._W.fill(0,o,16);n<e.length;)this._W[o]|=e[n]<<(3-n%4)*8,n++;this._W[o]|=dn<<(3-n%4)*8}this._updateHash()}const r=n%64!==0;this._W.fill(0,0,16);let i=0;for(;n<e.length;i++)for(let o=3;o>=0&&n<e.length;o--)this._W[i]|=e[n++]<<o*8;r||(this._W[i-(n%4===0?0:1)]|=dn<<(3-n%4)*8),this._W[14]=e.byteLength/XI,this._W[15]=e.byteLength*8,this._updateHash();const s=new Uint8Array(32);for(let o=0;o<this._H.length;o++)for(let a=0;a<4;a++)s[o*4+a]=this._H[o]>>>(3-a)*8;return s}}const xF=t=>new vF().digest(t),ut=new Ae("y-sync"),hi=new Ae("y-undo");new Ae("yjs-cursor");const wF=t=>{for(let n=6;n<t.length;n++)t[n%6]=t[n%6]^t[n];return t.slice(0,6)},kF=t=>JL(wF(xF(XL(t)))),a0=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!ua(e.ds,t.id),EF=[{light:"#ecd44433",dark:"#ecd444"}],SF=(t,e,n)=>{if(!t.has(n)){if(t.size<e.length){const r=Js();t.forEach(i=>r.add(i)),e=e.filter(i=>!r.has(i))}t.set(n,DL(e))}return t.get(n)},CF=(t,{colors:e=EF,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:s}={})=>{let o=!1;const a=new TF(t,s),l=new _e({props:{editable:u=>{const c=ut.getState(u);return c.snapshot==null&&c.prevSnapshot==null}},key:ut,state:{init:(u,c)=>({type:t,doc:t.doc,binding:a,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:n,permanentUserData:r}),apply:(u,c)=>{const d=u.getMeta(ut);if(d!==void 0){c=Object.assign({},c);for(const h in d)c[h]=d[h]}return c.addToHistory=u.getMeta("addToHistory")!==!1,c.isChangeOrigin=d!==void 0&&!!d.isChangeOrigin,c.isUndoRedoOperation=d!==void 0&&!!d.isChangeOrigin&&!!d.isUndoRedoOperation,a.prosemirrorView!==null&&d!==void 0&&(d.snapshot!=null||d.prevSnapshot!=null)&&Mx(0,()=>{a.prosemirrorView!=null&&(d.restore==null?a._renderSnapshot(d.snapshot,d.prevSnapshot,c):(a._renderSnapshot(d.snapshot,d.snapshot,c),delete c.restore,delete c.snapshot,delete c.prevSnapshot,a.mux(()=>{a._prosemirrorChanged(a.prosemirrorView.state.doc)})))}),c}},view:u=>(a.initView(u),s==null&&a._forceRerender(),i(),{update:()=>{const c=l.getState(u.state);if(c.snapshot==null&&c.prevSnapshot==null&&(o||u.state.doc.content.findDiffStart(u.state.doc.type.createAndFill().content)!==null)){if(o=!0,c.addToHistory===!1&&!c.isChangeOrigin){const d=hi.getState(u.state),h=d&&d.undoManager;h&&h.stopCapturing()}a.mux(()=>{c.doc.transact(d=>{d.meta.set("addToHistory",c.addToHistory),a._prosemirrorChanged(u.state.doc)},ut)})}},destroy:()=>{a.destroy()}})});return l},_F=(t,e,n)=>{if(e!==null&&e.anchor!==null&&e.head!==null)if(e.type==="all")t.setSelection(new En(t.doc));else if(e.type==="node"){const r=ja(n.doc,n.type,e.anchor,n.mapping);t.setSelection(AF(t,r))}else{const r=ja(n.doc,n.type,e.anchor,n.mapping),i=ja(n.doc,n.type,e.head,n.mapping);r!==null&&i!==null&&t.setSelection(le.between(t.doc.resolve(r),t.doc.resolve(i)))}},AF=(t,e)=>{const n=t.doc.resolve(e);return n.nodeAfter?ue.create(t.doc,e):le.near(n)},Sp=(t,e)=>({type:e.selection.jsonID,anchor:u0(e.selection.anchor,t.type,t.mapping),head:u0(e.selection.head,t.type,t.mapping)});class TF{constructor(e,n=new Map){this.type=e,this.prosemirrorView=null,this.mux=lF(),this.mapping=n,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=Sp(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(dx&&this._domSelectionInView===null&&(Mx(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;const n=this.prosemirrorView._root.createRange();n.setStart(e.anchorNode,e.anchorOffset),n.setEnd(e.focusNode,e.focusOffset),n.getClientRects().length===0&&n.startContainer&&n.collapsed&&n.selectNodeContents(n.startContainer);const i=n.getBoundingClientRect(),s=Rl.documentElement;return i.bottom>=0&&i.right>=0&&i.left<=(window.innerWidth||s.clientWidth||0)&&i.top<=(window.innerHeight||s.clientHeight||0)}renderSnapshot(e,n){n||(n=Hx(Bx(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(ut,{snapshot:e,prevSnapshot:n}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{const e=this.type.toArray().map(r=>Zu(r,this.prosemirrorView.state.schema,this)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new Z(P.from(e),0,0));n.setMeta(ut,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(n)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{const e=this.beforeTransactionSelection!==null?null:this.prosemirrorView.state.selection,n=this.type.toArray().map(i=>Zu(i,this.prosemirrorView.state.schema,this)).filter(i=>i!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new Z(P.from(n),0,0));if(e){const i=Go(is(e.anchor,0),r.doc.content.size),s=Go(is(e.head,0),r.doc.content.size);r.setSelection(le.create(r.doc,i,s))}this.prosemirrorView.dispatch(r.setMeta(ut,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,n,r){let i=this.doc,s=this.type;if(e||(e=Dh(this.doc)),e instanceof Uint8Array||n instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(n instanceof Uint8Array))&&pn(),i=new oo({gc:!1}),vp(i,n),n=Dh(i),vp(i,e),e=Dh(i),s._item===null){const o=Array.from(this.doc.share.keys()).find(a=>this.doc.share.get(a)===this.type);s=i.getXmlFragment(o)}else{const o=i.store.clients.get(s._item.id.client)??[],a=mr(o,s._item.id.clock);s=o[a].content.type}this.mapping.clear(),this.mux(()=>{i.transact(o=>{const a=r.permanentUserData;a&&a.dss.forEach(d=>{ss(o,d,h=>{})});const l=(d,h)=>{const f=d==="added"?a.getUserByClientId(h.client):a.getUserByDeletedId(h);return{user:f,type:d,color:SF(r.colorMapping,r.colors,f)}},u=Xx(s,new b1(n.ds,e.sv)).map(d=>!d._item.deleted||a0(d._item,e)||a0(d._item,n)?Zu(d,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,n,l):null).filter(d=>d!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new Z(P.from(u),0,0));this.prosemirrorView.dispatch(c.setMeta(ut,{isChangeOrigin:!0}))},ut)})}_typeChanged(e,n){if(this.prosemirrorView==null)return;const r=ut.getState(this.prosemirrorView.state);if(e.length===0||r.snapshot!=null||r.prevSnapshot!=null){this.renderSnapshot(r.snapshot,r.prevSnapshot);return}this.mux(()=>{const i=(a,l)=>this.mapping.delete(l);ss(n,n.deleteSet,a=>{if(a.constructor===Ke){const l=a.content.type;l&&this.mapping.delete(l)}}),n.changed.forEach(i),n.changedParentTypes.forEach(i);const s=this.type.toArray().map(a=>m8(a,this.prosemirrorView.state.schema,this)).filter(a=>a!==null);let o=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new Z(P.from(s),0,0));_F(o,this.beforeTransactionSelection,this),o=o.setMeta(ut,{isChangeOrigin:!0,isUndoRedoOperation:n.origin instanceof Wx}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&o.scrollIntoView(),this.prosemirrorView.dispatch(o)})}_prosemirrorChanged(e){this.doc.transact(()=>{_p(this.doc,this.type,e,this),this.beforeTransactionSelection=Sp(this,this.prosemirrorView.state)},ut)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions))}}const m8=(t,e,n,r,i,s)=>{const o=n.mapping.get(t);if(o===void 0){if(t instanceof cn)return Zu(t,e,n,r,i,s);throw nr()}return o},Zu=(t,e,n,r,i,s)=>{const o=[],a=l=>{var u,c;if(l instanceof cn){const d=m8(l,e,n,r,i,s);d!==null&&o.push(d)}else{const d=(c=(u=l._item.right)==null?void 0:u.content)==null?void 0:c.type;d instanceof as&&!d._item.deleted&&d._item.id.client===d.doc.clientID&&(l.applyDelta([{retain:l.length},...d.toDelta()]),d.doc.transact(f=>{d._item.delete(f)}));const h=MF(l,e,n,r,i,s);h!==null&&h.forEach(f=>{f!==null&&o.push(f)})}};r===void 0||i===void 0?t.toArray().forEach(a):Xx(t,new b1(i.ds,r.sv)).forEach(a);try{const l=t.getAttributes(r);r!==void 0&&(a0(t._item,r)?a0(t._item,i)||(l.ychange=s?s("added",t._item.id):{type:"added"}):l.ychange=s?s("removed",t._item.id):{type:"removed"});const u=e.node(t.nodeName,l,o);return n.mapping.set(t,u),u}catch{return t.doc.transact(u=>{t._item.delete(u)},ut),n.mapping.delete(t),null}},MF=(t,e,n,r,i,s)=>{const o=[],a=t.toDelta(r,i,s);try{for(let l=0;l<a.length;l++){const u=a[l];o.push(e.text(u.insert,LF(u.attributes,e)))}}catch{return t.doc.transact(u=>{t._item.delete(u)},ut),null}return o},NF=(t,e)=>{const n=new Rn,r=t.map(i=>({insert:i.text,attributes:y8(i.marks,e)}));return n.applyDelta(r),e.mapping.set(n,t),n},DF=(t,e)=>{const n=new cn(t.type.name);for(const r in t.attrs){const i=t.attrs[r];i!==null&&r!=="ychange"&&n.setAttribute(r,i)}return n.insert(0,ld(t).map(r=>Cp(r,e))),e.mapping.set(n,t),n},Cp=(t,e)=>t instanceof Array?NF(t,e):DF(t,e),f4=t=>typeof t=="object"&&t!==null,E1=(t,e)=>{const n=Object.keys(t).filter(i=>t[i]!==null);let r=n.length===Object.keys(e).filter(i=>e[i]!==null).length;for(let i=0;i<n.length&&r;i++){const s=n[i],o=t[s],a=e[s];r=s==="ychange"||o===a||f4(o)&&f4(a)&&E1(o,a)}return r},ld=t=>{const e=t.content.content,n=[];for(let r=0;r<e.length;r++){const i=e[r];if(i.isText){const s=[];for(let o=e[r];r<e.length&&o.isText;o=e[++r])s.push(o);r--,n.push(s)}else n.push(i)}return n},g8=(t,e)=>{const n=t.toDelta();return n.length===e.length&&n.every((r,i)=>r.insert===e[i].text&&lx(r.attributes||{}).length===e[i].marks.length&&oa(r.attributes,(s,o)=>{var c;const a=b8(o),l=e[i].marks;return l.find(d=>d.type.name===a)?E1(s,(c=l.find(d=>d.type.name===a))==null?void 0:c.attrs):!1}))},bl=(t,e)=>{if(t instanceof cn&&!(e instanceof Array)&&Ap(t,e)){const n=ld(e);return t._length===n.length&&E1(t.getAttributes(),e.attrs)&&t.toArray().every((r,i)=>bl(r,n[i]))}return t instanceof Rn&&e instanceof Array&&g8(t,e)},l0=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((n,r)=>e[r]===n),p4=(t,e,n)=>{const r=t.toArray(),i=ld(e),s=i.length,o=r.length,a=Go(o,s);let l=0,u=0,c=!1;for(;l<a;l++){const d=r[l],h=i[l];if(l0(n.mapping.get(d),h))c=!0;else if(!bl(d,h))break}for(;l+u<a;u++){const d=r[o-u-1],h=i[s-u-1];if(l0(n.mapping.get(d),h))c=!0;else if(!bl(d,h))break}return{equalityFactor:l+u,foundMappedChild:c}},OF=t=>{let e="",n=t._start;const r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof gr?e+=n.content.str:n.content instanceof Ot&&(r[n.content.key]=null)),n=n.right;return{str:e,nAttrs:r}},RF=(t,e,n)=>{n.mapping.set(t,e);const{nAttrs:r,str:i}=OF(t),s=e.map(u=>({insert:u.text,attributes:Object.assign({},r,y8(u.marks,n))})),{insert:o,remove:a,index:l}=hF(i,s.map(u=>u.insert).join(""));t.delete(l,a),t.insert(l,o),t.applyDelta(s.map(u=>({retain:u.insert.length,attributes:u.attributes})))},IF=/(.*)(--[a-zA-Z0-9+/=]{8})$/,b8=t=>{var e;return((e=IF.exec(t))==null?void 0:e[1])??t},LF=(t,e)=>{const n=[];for(const r in t)n.push(e.mark(b8(r),t[r]));return n},y8=(t,e)=>{const n={};return t.forEach(r=>{if(r.type.name!=="ychange"){const i=xi(e.isOMark,r.type,()=>!r.type.excludes(r.type));n[i?`${r.type.name}--${kF(r.toJSON())}`:r.type.name]=r.attrs}}),n},_p=(t,e,n,r)=>{if(e instanceof cn&&e.nodeName!==n.type.name)throw new Error("node name mismatch!");if(r.mapping.set(e,n),e instanceof cn){const d=e.getAttributes(),h=n.attrs;for(const f in h)h[f]!==null?d[f]!==h[f]&&f!=="ychange"&&e.setAttribute(f,h[f]):e.removeAttribute(f);for(const f in d)h[f]===void 0&&e.removeAttribute(f)}const i=ld(n),s=i.length,o=e.toArray(),a=o.length,l=Go(s,a);let u=0,c=0;for(;u<l;u++){const d=o[u],h=i[u];if(!l0(r.mapping.get(d),h))if(bl(d,h))r.mapping.set(d,h);else break}for(;c+u+1<l;c++){const d=o[a-c-1],h=i[s-c-1];if(!l0(r.mapping.get(d),h))if(bl(d,h))r.mapping.set(d,h);else break}t.transact(()=>{for(;a-u-c>0&&s-u-c>0;){const h=o[u],f=i[u],p=o[a-c-1],m=i[s-c-1];if(h instanceof Rn&&f instanceof Array)g8(h,f)||RF(h,f,r),u+=1;else{let g=h instanceof cn&&Ap(h,f),y=p instanceof cn&&Ap(p,m);if(g&&y){const x=p4(h,f,r),k=p4(p,m,r);x.foundMappedChild&&!k.foundMappedChild?y=!1:!x.foundMappedChild&&k.foundMappedChild||x.equalityFactor<k.equalityFactor?g=!1:y=!1}g?(_p(t,h,f,r),u+=1):y?(_p(t,p,m,r),c+=1):(r.mapping.delete(e.get(u)),e.delete(u,1),e.insert(u,[Cp(f,r)]),u+=1)}}const d=a-u-c;if(a===1&&s===0&&o[0]instanceof Rn?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):d>0&&(e.slice(u,u+d).forEach(h=>r.mapping.delete(h)),e.delete(u,d)),u+c<s){const h=[];for(let f=u;f<s-c;f++)h.push(Cp(i[f],r));e.insert(u,h)}},ut)},Ap=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name,u0=(t,e,n)=>{if(t===0)return Nh(e,0,-1);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof Rn){if(r._length>=t)return Nh(r,t,-1);if(t-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,t--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&t<i)r=r._first.content.type,t--;else{if(t===1&&r._length===0&&i>1)return new t0(r._item===null?null:r._item.id,r._item===null?hl(r):null,null);if(t-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(t===0)return r=r._item===null?r:r._item.parent,new t0(r._item===null?null:r._item.id,r._item===null?hl(r):null,null);do r=r._item.parent,t--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw pn();if(t===0&&r.constructor!==Rn&&r!==e)return zF(r._item.parent,r._item)}return Nh(e,e._length,-1)},zF=(t,e)=>{let n=null,r=null;return t._item===null?r=hl(t):n=De(t._item.id.client,t._item.id.clock),new t0(n,r,e.id)},ja=(t,e,n,r)=>{const i=lB(n,t);if(i===null||i.type!==e&&!fl(e,i.type._item))return null;let s=i.type,o=0;if(s.constructor===Rn)o=i.index;else if(s._item===null||!s._item.deleted){let a=s._first,l=0;for(;l<s._length&&l<i.index&&a!==null;){if(!a.deleted){const u=a.content.type;l++,u instanceof Rn?o+=u._length:o+=r.get(u).nodeSize}a=a.right}o+=1}for(;s!==e&&s._item!==null;){const a=s._item.parent;if(a._item===null||!a._item.deleted){o+=1;let l=a._first;for(;l!==null;){const u=l.content.type;if(u===s)break;l.deleted||(u instanceof Rn?o+=u._length:o+=r.get(u).nodeSize),l=l.right}}s=a}return o-1},BF=t=>{const e=hi.getState(t).undoManager;if(e!=null)return e.undo(),!0},FF=t=>{const e=hi.getState(t).undoManager;if(e!=null)return e.redo(),!0},PF=new Set(["paragraph"]),$F=(t,e)=>!(t instanceof Ke)||!(t.content instanceof yr)||!(t.content.type instanceof as||t.content.type instanceof cn&&e.has(t.content.type.nodeName))||t.content.type._length===0,HF=({protectedNodes:t=PF,trackedOrigins:e=[],undoManager:n=null}={})=>new _e({key:hi,state:{init:(r,i)=>{const s=ut.getState(i);let o=n;if(!o){const a=s.doc,l=new Set(a?a._observers.get("destroy"):[]);o=new Wx(s.type,{trackedOrigins:new Set([ut].concat(e)),deleteFilter:c=>$F(c,t),captureTransaction:c=>c.meta.get("addToHistory")!==!1});const u=a?a._observers.get("destroy"):new Set;o._yTiptapDocDestroyListeners=Array.from(u||[]).filter(c=>!l.has(c))}return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(r,i,s,o)=>{const a=ut.getState(o).binding,l=i.undoManager,u=l.undoStack.length>0,c=l.redoStack.length>0;return a?{undoManager:l,prevSel:Sp(a,s),hasUndoOps:u,hasRedoOps:c}:u!==i.hasUndoOps||c!==i.hasRedoOps?Object.assign({},i,{hasUndoOps:l.undoStack.length>0,hasRedoOps:l.redoStack.length>0}):i}},view:r=>{const i=ut.getState(r.state),s=hi.getState(r.state).undoManager;return s.on("stack-item-added",({stackItem:o})=>{const a=i.binding;a&&o.meta.set(a,hi.getState(r.state).prevSel)}),s.on("stack-item-popped",({stackItem:o})=>{const a=i.binding;a&&(a.beforeTransactionSelection=o.meta.get(a)||a.beforeTransactionSelection)}),{destroy:()=>{s.destroy();const o=s._yTiptapDocDestroyListeners;o&&s.doc&&(o.forEach(a=>s.doc.off("destroy",a)),s._yTiptapDocDestroyListeners=null)}}}});function S1(t){return!!t.getMeta(ut)}function UF(t,e){const n=ut.getState(t);return ja(n.doc,n.type,e,n.binding.mapping)||0}function v8(t,e){const n=ut.getState(t);return u0(e,n.type,n.binding.mapping)}var Ju=class x8 extends zm{constructor(e,n){super(e),this.yRelativePosition=n}static fromJSON(e){return new x8(e.position,e.yRelativePosition)}toJSON(){return{position:this.position,yRelativePosition:this.yRelativePosition}}};function qF(t,e){const n=v8(e,t);return new Ju(t,n)}function jF(t,e,n){const r=t instanceof Ju?t.yRelativePosition:null;if(S1(e)&&r){const o=UF(n,r);return{position:new Ju(o,r),mapResult:null}}const i=L5(t,e),s=i.position.position;return{position:new Ju(s,r??v8(n,s)),mapResult:i.mapResult}}Se.create({name:"collaboration",priority:1e3,addOptions(){return{document:null,field:"default",fragment:null,provider:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(t=>t.name==="undoRedo")&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-undo-redo".')},onBeforeCreate(){this.editor.utils.getUpdatedPosition=(t,e)=>jF(t,e,this.editor.state),this.editor.utils.createMappablePosition=t=>qF(t,this.editor.state)},addCommands(){return{undo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),hi.getState(e).undoManager.undoStack.length===0?!1:n?BF(e):!0),redo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),hi.getState(e).undoManager.redoStack.length===0?!1:n?FF(e):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){const t=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),e=HF(this.options.yUndoOptions),n=e.spec.view;e.spec.view=s=>{const{undoManager:o}=hi.getState(s.state);o.restore&&(o.restore(),o.restore=()=>{});const a=n?n(s):void 0;return{destroy:()=>{const l=o.trackedOrigins.has(o),u=o._observers;o.restore=()=>{l&&o.trackedOrigins.add(o),o.doc.on("afterTransaction",o.afterTransactionHandler),o._observers=u},a!=null&&a.destroy&&a.destroy()}}};const r={...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender};return[CF(t,r),e,this.editor.options.enableContentCheck&&new _e({key:new Ae("filterInvalidContent"),filterTransaction:s=>{if(!S1(s))return!0;if(this.storage.isDisabled)return!1;if(!s.docChanged)return!0;try{return s.doc.check(),!0}catch(o){return this.storage.isDisabled=!0,this.editor.emit("contentError",{error:o,editor:this.editor,disableCollaboration:()=>{var a;(a=t.doc)==null||a.destroy()}}),!1}}})].filter(Boolean)}});function m4(t){if(!t.length)return Le.empty;const e=[],n=t[0].$from.node(0);return t.forEach(r=>{const i=r.$from.pos,s=r.$from.nodeAfter;s&&e.push(Ge.node(i,i+s.nodeSize,{class:"ProseMirror-selectednoderange"}))}),Le.create(n,e)}function VF(t,e,n){const r=n.isText||n.isAtom?0:1;return{start:t+r,end:t+e-r}}function ud(t,e,n,r={}){const i=[],s=t.node(0),{extendOnBoundaryOverlap:o=!0}=r;typeof n=="number"&&n>=0||(t.sameParent(e)?n=Math.max(0,t.sharedDepth(e.pos)-1):n=t.sharedDepth(e.pos));const a=new Ka(t,e,n),l=a.depth===0?0:s.resolve(a.start).posAtIndex(0);return a.parent.forEach((u,c)=>{const d=l+c,h=d+u.nodeSize,f=VF(d,u.nodeSize,u),p=o?e.pos>=f.start&&t.pos<=f.end:e.pos>f.start&&t.pos<f.end;if(d<a.start||d>=a.end||!p)return;const m=new dm(s.resolve(d),s.resolve(h));i.push(m)}),i}var WF=class w8{constructor(e,n){this.anchor=e,this.head=n}map(e){return new w8(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return new Vi(n,r)}},Vi=class Ri extends fe{constructor(e,n,r,i=1){const{doc:s}=e,o=e===n,a=e.pos===s.content.size&&n.pos===s.content.size,l=o&&!a?s.resolve(n.pos+(i>0?1:-1)):n,u=o&&a?s.resolve(e.pos-(i>0?1:-1)):e,c=ud(u.min(l),u.max(l),r),d=l.pos>=e.pos?c[0].$from:c[c.length-1].$to,h=l.pos>=e.pos?c[c.length-1].$to:c[0].$from;super(d,h,c),this.depth=r}get $to(){return this.ranges[this.ranges.length-1].$to}eq(e){return e instanceof Ri&&e.$from.pos===this.$from.pos&&e.$to.pos===this.$to.pos}map(e,n){const r=e.resolve(n.map(this.anchor)),i=e.resolve(n.map(this.head));return new Ri(r,i)}toJSON(){return{type:"nodeRange",anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){const{doc:e}=this.$from;if(this.isForwards&&this.ranges.length>1){const i=this.ranges.slice(0,-1),s=i[0].$from,o=i[i.length-1].$to;return new Ri(s,o,this.depth)}const n=this.ranges[0],r=e.resolve(Math.max(0,n.$from.pos-1));return new Ri(this.$anchor,r,this.depth)}extendForwards(){const{doc:e}=this.$from;if(this.isBackwards&&this.ranges.length>1){const i=this.ranges.slice(1),s=i[0].$from,o=i[i.length-1].$to;return new Ri(o,s,this.depth)}const n=this.ranges[this.ranges.length-1],r=e.resolve(Math.min(e.content.size,n.$to.pos+1));return new Ri(this.$anchor,r,this.depth)}static fromJSON(e,n){return new Ri(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r,i,s=1){return new this(e.resolve(n),e.resolve(r),i,s)}getBookmark(){return new WF(this.anchor,this.head)}};Vi.prototype.visible=!1;function Su(t){return t instanceof Vi}var GF=Se.create({name:"nodeRange",addOptions(){return{depth:void 0,key:"Mod"}},addKeyboardShortcuts(){return{"Shift-ArrowUp":({editor:t})=>{const{depth:e}=this.options,{view:n,state:r}=t,{doc:i,selection:s,tr:o}=r,{anchor:a,head:l}=s;if(!Su(s)){const c=Vi.create(i,a,l,e,-1);return o.setSelection(c),n.dispatch(o),!0}const u=s.extendBackwards();return o.setSelection(u),n.dispatch(o),!0},"Shift-ArrowDown":({editor:t})=>{const{depth:e}=this.options,{view:n,state:r}=t,{doc:i,selection:s,tr:o}=r,{anchor:a,head:l}=s;if(!Su(s)){const c=Vi.create(i,a,l,e);return o.setSelection(c),n.dispatch(o),!0}const u=s.extendForwards();return o.setSelection(u),n.dispatch(o),!0},"Mod-a":({editor:t})=>{const{depth:e}=this.options,{view:n,state:r}=t,{doc:i,tr:s}=r,o=Vi.create(i,0,i.content.size,e);return s.setSelection(o),n.dispatch(s),!0}}},onSelectionUpdate(){const{selection:t}=this.editor.state;Su(t)&&this.editor.view.dom.classList.add("ProseMirror-noderangeselection")},addProseMirrorPlugins(){let t=!1,e=!1;return[new _e({key:new Ae("nodeRange"),props:{attributes:()=>t?{class:"ProseMirror-noderangeselection"}:{class:""},handleDOMEvents:{mousedown:(n,r)=>{const{key:i}=this.options,s=/Mac/.test(navigator.platform),o=!!r.shiftKey,a=!!r.ctrlKey,l=!!r.altKey,u=!!r.metaKey,c=s?u:a;return(i==null||i==="Shift"&&o||i==="Control"&&a||i==="Alt"&&l||i==="Meta"&&u||i==="Mod"&&c)&&(e=!0),e&&document.addEventListener("mouseup",()=>{e=!1;const{state:d}=n,{doc:h,selection:f,tr:p}=d,{$anchor:m,$head:g}=f;if(m.sameParent(g))return;const y=Vi.create(h,m.pos,g.pos,this.options.depth);p.setSelection(y),n.dispatch(p)},{once:!0}),!1}},decorations:n=>{const{selection:r}=n,i=Su(r);if(t=!1,!e)return i?(t=!0,m4(r.ranges)):null;const{$from:s,$to:o}=r;if(!i&&s.sameParent(o))return null;const a=ud(s,o,this.options.depth);return a.length?(t=!0,m4(a)):null}}})]}});function KF(t){let e="";const n=getComputedStyle(t);for(let r=0;r<n.length;r+=1)e+=`${n[r]}:${n.getPropertyValue(n[r])};`;return e}function YF(t){const e=t.cloneNode(!0),n=[t,...Array.from(t.getElementsByTagName("*"))],r=[e,...Array.from(e.getElementsByTagName("*"))];return n.forEach((i,s)=>{r[s].style.cssText=KF(i)}),e}var ZF={id:"listItemFirstChild",evaluate:({parent:t,isFirst:e})=>e&&t&&["listItem","taskItem"].includes(t.type.name)?1e3:0},JF={id:"listWrapperDeprioritize",evaluate:({node:t})=>{const e=["listItem","taskItem"],n=t.firstChild;return n&&e.includes(n.type.name)?1e3:0}},XF={id:"tableStructure",evaluate:({node:t,parent:e})=>["tableRow","tableCell","tableHeader"].includes(t.type.name)||e&&e.type.name==="tableHeader"?1e3:0},QF={id:"inlineContent",evaluate:({node:t})=>t.isInline||t.isText?1e3:0},eP=[ZF,JF,XF,QF],g4={edges:["left","top"],threshold:12,strength:500};function Ih(t){return t===void 0||t==="left"?{...g4}:t==="right"?{edges:["right","top"],threshold:12,strength:500}:t==="both"?{edges:["left","right","top"],threshold:12,strength:500}:t==="none"?{edges:[],threshold:0,strength:0}:{...g4,...t}}function tP(t,e,n){if(n.edges.length===0)return!1;const r=e.getBoundingClientRect(),{threshold:i,edges:s}=n;return s.some(o=>o==="left"?t.x-r.left<i:o==="right"?r.right-t.x<i:o==="top"?t.y-r.top<i:o==="bottom"?r.bottom-t.y<i:!1)}function nP(t,e,n,r){return!e||n.edges.length===0?0:tP(t,e,n)?n.strength*r:0}var rP=1e3;function b4(t,e,n,r){let i=rP,s=!1;if(e.every(a=>{const l=a.evaluate(t);return i-=l,i<=0?(s=!0,!1):!0}),s)return-1;const o=t.view.nodeDOM(t.pos);return i-=nP(r,o,n,t.depth),i<=0?-1:i}function y4(t,e,n){return Array.from({length:e},(i,s)=>e-1-s).some(i=>n.includes(t.node(i).type.name))}function iP(t,e,n){if(!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;const r=t.posAtCoords({left:e.x,top:e.y});if(!r)return null;const{doc:i}=t.state,s=i.resolve(r.pos),o=[];n.defaultRules&&o.push(...eP),o.push(...n.rules);const l=Array.from({length:s.depth},(d,h)=>s.depth-h).map(d=>{const h=s.node(d),f=s.before(d);if(n.allowedContainers&&d>0&&!y4(s,d,n.allowedContainers))return null;const p=d>0?s.node(d-1):null,m=d>0?s.index(d-1):0,g=p?p.childCount:1,y={node:h,pos:f,depth:d,parent:p,index:m,isFirst:m===0,isLast:m===g-1,$pos:s,view:t},x=b4(y,o,n.edgeDetection,e);if(x<0)return null;const k=t.nodeDOM(f);return{node:h,pos:f,depth:d,score:x,dom:k}}).filter(d=>d!==null),u=s.nodeAfter;if(u&&u.isAtom&&!u.isInline){const d=r.pos,h=s.depth+1,f=s.parent,p=s.index(),m=f.childCount;let g=!0;if(n.allowedContainers&&(g=y4(s,h,n.allowedContainers)),g){const y={node:u,pos:d,depth:h,parent:f,index:p,isFirst:p===0,isLast:p===m-1,$pos:s,view:t},x=b4(y,o,n.edgeDetection,e);if(x>=0){const k=t.nodeDOM(d);k&&l.push({node:u,pos:d,depth:h,score:x,dom:k})}}}if(l.length===0)return null;l.sort((d,h)=>h.score!==d.score?h.score-d.score:h.depth-d.depth);const c=l[0];return c.dom?{node:c.node,pos:c.pos,dom:c.dom}:null}function sP(t,e){let n=t;for(;n!=null&&n.parentElement&&n.parentElement!==e.dom;)n=n.parentElement;return(n==null?void 0:n.parentElement)===e.dom?n:void 0}function v4(t){return Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)&&t.width>0&&t.height>0}function oP(t,e,n,r=5){if(!Number.isFinite(e)||!Number.isFinite(n))return null;const i=t.dom,s=i.firstElementChild,o=i.lastElementChild;if(!s||!o)return null;const a=s.getBoundingClientRect(),l=o.getBoundingClientRect();if(!v4(a)||!v4(l))return null;const u=Math.min(Math.max(a.top+r,n),l.bottom-r),c=.5,d=Math.abs(a.left-l.left)<c,h=Math.abs(a.right-l.right)<c;let f=a;d&&h&&(f=a);const p=Math.min(Math.max(f.left+r,e),f.right-r);return!Number.isFinite(p)||!Number.isFinite(u)?null:{x:p,y:u}}var k8=t=>{const{x:e,y:n,editor:r,nestedOptions:i}=t,{view:s,state:o}=r,a=oP(s,e,n,5);if(!a)return{resultElement:null,resultNode:null,pos:null};const{x:l,y:u}=a;if(i!=null&&i.enabled){const p=iP(s,{x:l,y:u},i);return p?{resultElement:p.dom,resultNode:p.node,pos:p.pos}:{resultElement:null,resultNode:null,pos:null}}const c=s.root.elementsFromPoint(l,u);let d;if(Array.prototype.some.call(c,p=>{if(!s.dom.contains(p))return!1;const m=sP(p,s);return m?(d=m,!0):!1}),!d){const p=s.posAtCoords({left:l,top:u});if(p){const m=o.doc.resolve(p.pos),g=Math.min(m.depth,1),y=g>0?m.before(g):m.pos,x=o.doc.nodeAt(y);if(x){const k=s.nodeDOM(y);return{resultElement:k instanceof HTMLElement?k:null,resultNode:x,pos:y}}}return{resultElement:null,resultNode:null,pos:null}}let h;try{h=s.posAtDOM(d,0)}catch{return{resultElement:null,resultNode:null,pos:null}}const f=o.doc.nodeAt(h);if(!f){const p=o.doc.resolve(h),m=p.parent;return{resultElement:d,resultNode:m,pos:p.start()}}return{resultElement:d,resultNode:f,pos:h}};function E8(t,e){const n=t.nodeDOM(e);if(n instanceof Element&&n!==t.dom)return n;const{node:r,offset:i}=t.domAtPos(e),s=r.childNodes[i];return s instanceof Element?s:r instanceof Element?r:r.nodeType===Node.TEXT_NODE&&r.parentElement?r.parentElement:null}function aP(t,e){const n=E8(t,e);return(n?getComputedStyle(n).direction:getComputedStyle(t.dom).direction)||"ltr"}function S8(t){var e;(e=t.parentNode)==null||e.removeChild(t)}function lP(t,e){return t==="rtl"?e:0}function uP(t,e,n,r){const{doc:i}=e.view.state;if(n!=null&&n.enabled&&(r!=null&&r.node)&&r.pos>=0){const u=r.pos,c=r.pos+r.node.nodeSize;return[{$from:i.resolve(u),$to:i.resolve(c)}]}const s=k8({editor:e,x:t.clientX,y:t.clientY,nestedOptions:n});if(!s.resultNode||s.pos===null)return[];const o=s.resultNode.isText||s.resultNode.isAtom?0:-1,a=i.resolve(s.pos),l=i.resolve(s.pos+s.resultNode.nodeSize+o);return ud(a,l,0,{extendOnBoundaryOverlap:!1})}function cP(t,e,n,r){const{view:i}=e;if(!t.dataTransfer)return;const{empty:s,$from:o,$to:a}=i.state.selection,l=uP(t,e,n,r),u=ud(o,a,0,{extendOnBoundaryOverlap:!1}),c=u.some(L=>l.find(G=>G.$from===L.$from&&G.$to===L.$to)),d=s||!c?l:u;if(!d.length)return;const{tr:h}=i.state,f=document.createElement("div"),p=d[0].$from.pos,m=d[d.length-1].$to.pos,g=aP(i,p);f.setAttribute("dir",g);const y=(n==null?void 0:n.enabled)&&(r==null?void 0:r.node);let x,k;y?(x=i.state.doc.slice(p,m),k=ue.create(i.state.doc,p)):(k=Vi.create(i.state.doc,p,m),x=k.content()),d.forEach(L=>{const G=E8(i,L.$from.pos);if(!G)return;const ie=YF(G);ie.style.margin="0",f.append(ie)}),f.style.position="absolute",f.style.top="-10000px",document.body.append(f),t.dataTransfer.clearData();const C=f.getBoundingClientRect(),_=lP(g,C.width);t.dataTransfer.setDragImage(f,_,0);let T=!1;const D=()=>{T||(T=!0,S8(f),document.removeEventListener("drop",D),document.removeEventListener("dragend",D))},I=k instanceof ue?k:void 0;i.dragging={slice:x,move:!0,node:I},h.setSelection(k),i.dispatch(h),document.addEventListener("drop",D),document.addEventListener("dragend",D)}var x4=(t,e)=>{const n=t.resolve(e),{depth:r}=n;return r===0?e:n.pos-n.parentOffset-1},w4=(t,e)=>{const n=t.nodeAt(e),r=t.resolve(e);let{depth:i}=r,s=n;for(;i>0;){const o=r.node(i);i-=1,i===0&&(s=o)}return s},Lh=(t,e)=>{const n=ut.getState(t);return n?u0(e,n.type,n.binding.mapping):null},dP=(t,e)=>{const n=ut.getState(t);return n?ja(n.doc,n.type,e,n.binding.mapping)||0:-1},k4=(t,e)=>{let n=e;for(;n!=null&&n.parentNode&&n.parentNode!==t.dom;)n=n.parentNode;return n},C8=new Ae("dragHandle"),_8=({pluginKey:t=C8,element:e,editor:n,computePositionConfig:r,getReferencedVirtualElement:i,onNodeChange:s,onElementDragStart:o,onElementDragEnd:a,nestedOptions:l})=>{const u=document.createElement("div");let c=!1,d=null,h=-1,f,p=null,m=null;function g(){e&&(e.style.visibility="hidden",e.style.pointerEvents="none")}function y(){if(e){if(!n.isEditable){g();return}e.style.visibility="",e.style.pointerEvents="auto"}}function x(T){const D=(i==null?void 0:i())||{getBoundingClientRect:()=>T.getBoundingClientRect()};Hp(D,e,r).then(I=>{Object.assign(e.style,{position:I.strategy,left:`${I.x}px`,top:`${I.y}px`})})}function k(T){o==null||o(T),cP(T,n,l,{node:d,pos:h}),e&&(e.dataset.dragging="true"),setTimeout(()=>{e&&(e.style.pointerEvents="none")},0)}function C(T){a==null||a(T),g(),e&&(e.style.pointerEvents="auto",e.dataset.dragging="false")}function _(){if(jM()){const T=n.view.dom;requestAnimationFrame(()=>{T.isContentEditable&&(T.contentEditable="false",T.contentEditable="true")})}}return u.appendChild(e),{unbind(){e.removeEventListener("dragstart",k),e.removeEventListener("dragend",C),document.removeEventListener("drop",_),p&&(cancelAnimationFrame(p),p=null,m=null)},plugin:new _e({key:typeof t=="string"?new Ae(t):t,state:{init(){return{locked:!1}},apply(T,D,I,L){const G=T.getMeta("lockDragHandle"),ie=T.getMeta("hideDragHandle");if(G!==void 0&&(c=G),ie)return g(),c=!1,d=null,h=-1,s==null||s({editor:n,node:null,pos:-1}),D;if(T.docChanged&&h!==-1&&e)if(S1(T)){const oe=dP(L,f);oe!==h&&(h=oe)}else{const oe=T.mapping.map(h);oe!==h&&(h=oe,f=Lh(L,h))}return D}},view:T=>{var D;return e.draggable=!0,e.style.pointerEvents="auto",e.dataset.dragging="false",(D=n.view.dom.parentElement)==null||D.appendChild(u),u.style.pointerEvents="none",u.style.position="absolute",u.style.top="0",u.style.left="0",e.addEventListener("dragstart",k),e.addEventListener("dragend",C),document.addEventListener("drop",_),{update(I,L){if(!e)return;if(!n.isEditable){g();return}if(c?e.draggable=!1:e.draggable=!0,T.state.doc.eq(L.doc)||h===-1)return;let G=T.nodeDOM(h);if(G=k4(T,G),G===T.dom||(G==null?void 0:G.nodeType)!==1)return;const ie=T.posAtDOM(G,0),oe=w4(n.state.doc,ie),be=x4(n.state.doc,ie);d=oe,h=be,f=Lh(T.state,h),s==null||s({editor:n,node:d,pos:h}),x(G)},destroy(){e.removeEventListener("dragstart",k),e.removeEventListener("dragend",C),document.removeEventListener("drop",_),p&&(cancelAnimationFrame(p),p=null,m=null),e&&S8(u)}}},props:{handleDOMEvents:{keydown(T){return!e||c||T.hasFocus()&&(g(),d=null,h=-1,s==null||s({editor:n,node:null,pos:-1})),!1},mouseleave(T,D){return c||D.target&&!u.contains(D.relatedTarget)&&(g(),d=null,h=-1,s==null||s({editor:n,node:null,pos:-1})),!1},mousemove(T,D){return!e||c||(m={x:D.clientX,y:D.clientY},p)||(p=requestAnimationFrame(()=>{if(p=null,!m)return;const{x:I,y:L}=m;m=null;const G=k8({x:I,y:L,editor:n,nestedOptions:l});if(!G.resultElement)return;let ie=G.resultElement,oe=G.resultNode,be=G.pos;if(!(l!=null&&l.enabled)){if(ie=k4(T,ie),ie===T.dom||(ie==null?void 0:ie.nodeType)!==1)return;const Y=T.posAtDOM(ie,0);oe=w4(n.state.doc,Y),be=x4(n.state.doc,Y)}oe!==d&&(d=oe,h=be??-1,f=Lh(T.state,h),s==null||s({editor:n,node:d,pos:h}),x(ie),y())})),!1}}}})}};function A8(t){var e,n;return t===!1||t===void 0?{enabled:!1,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:Ih("none")}:t===!0?{enabled:!0,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:Ih("left")}:{enabled:!0,rules:(e=t.rules)!=null?e:[],defaultRules:(n=t.defaultRules)!=null?n:!0,allowedContainers:t.allowedContainers,edgeDetection:Ih(t.edgeDetection)}}var Tp={placement:"left-start",strategy:"absolute"};Se.create({name:"dragHandle",addOptions(){return{render(){const t=document.createElement("div");return t.classList.add("drag-handle"),t},computePositionConfig:{},locked:!1,onNodeChange:()=>null,onElementDragStart:void 0,onElementDragEnd:void 0,nested:!1}},addCommands(){return{lockDragHandle:()=>({editor:t})=>(this.options.locked=!0,t.commands.setMeta("lockDragHandle",this.options.locked)),unlockDragHandle:()=>({editor:t})=>(this.options.locked=!1,t.commands.setMeta("lockDragHandle",this.options.locked)),toggleDragHandle:()=>({editor:t})=>(this.options.locked=!this.options.locked,t.commands.setMeta("lockDragHandle",this.options.locked))}},addProseMirrorPlugins(){const t=this.options.render(),e=A8(this.options.nested);return[_8({computePositionConfig:{...Tp,...this.options.computePositionConfig},getReferencedVirtualElement:this.options.getReferencedVirtualElement,element:t,editor:this.editor,onNodeChange:this.options.onNodeChange,onElementDragStart:this.options.onElementDragStart,onElementDragEnd:this.options.onElementDragEnd,nestedOptions:e}).plugin]}});var hP=t=>{const{className:e="drag-handle",children:n,editor:r,pluginKey:i=C8,onNodeChange:s,onElementDragStart:o,onElementDragEnd:a,computePositionConfig:l=Tp,nested:u=!1}=t,[c]=B.useState(()=>typeof document>"u"?null:document.createElement("div")),d=B.useMemo(()=>A8(u),[JSON.stringify(u)]);return B.useEffect(()=>{c&&(c.className=e,c.style.visibility="hidden",c.style.position="absolute",c.dataset.dragging="false")},[e,c]),B.useEffect(()=>{if(!c||r.isDestroyed)return;const{plugin:h,unbind:f}=_8({editor:r,element:c,pluginKey:i,computePositionConfig:{...Tp,...l},onElementDragStart:o,onElementDragEnd:a,onNodeChange:s,nestedOptions:d});return r.registerPlugin(h),()=>{r.isDestroyed||r.unregisterPlugin(i),f()}},[c,r,s,i,l,o,a,d]),c?Up.createPortal(n,c):null};const E4={};function fP(t){let e=E4[t];if(e)return e;e=E4[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}function Xo(t,e){typeof e!="string"&&(e=Xo.defaultChars);const n=fP(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let s=0,o=r.length;s<o;s+=3){const a=parseInt(r.slice(s+1,s+3),16);if(a<128){i+=n[a];continue}if((a&224)===192&&s+3<o){const l=parseInt(r.slice(s+4,s+6),16);if((l&192)===128){const u=a<<6&1984|l&63;u<128?i+="��":i+=String.fromCharCode(u),s+=3;continue}}if((a&240)===224&&s+6<o){const l=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16);if((l&192)===128&&(u&192)===128){const c=a<<12&61440|l<<6&4032|u&63;c<2048||c>=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),s+=6;continue}}if((a&248)===240&&s+9<o){const l=parseInt(r.slice(s+4,s+6),16),u=parseInt(r.slice(s+7,s+9),16),c=parseInt(r.slice(s+10,s+12),16);if((l&192)===128&&(u&192)===128&&(c&192)===128){let d=a<<18&1835008|l<<12&258048|u<<6&4032|c&63;d<65536||d>1114111?i+="����":(d-=65536,i+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}i+="�"}return i})}Xo.defaultChars=";/?:@&=+$,#";Xo.componentChars="";const S4={};function pP(t){let e=S4[t];if(e)return e;e=S4[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}function zl(t,e,n){typeof e!="string"&&(n=e,e=zl.defaultChars),typeof n>"u"&&(n=!0);const r=pP(e);let i="";for(let s=0,o=t.length;s<o;s++){const a=t.charCodeAt(s);if(n&&a===37&&s+2<o&&/^[0-9a-f]{2}$/i.test(t.slice(s+1,s+3))){i+=t.slice(s,s+3),s+=2;continue}if(a<128){i+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<o){const l=t.charCodeAt(s+1);if(l>=56320&&l<=57343){i+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[s])}return i}zl.defaultChars=";/?:@&=+$,-_.!~*'()#";zl.componentChars="-_.!~*'()";function C1(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function c0(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const mP=/^([a-z0-9.+-]+:)/i,gP=/:[0-9]*$/,bP=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,yP=["<",">",'"',"`"," ","\r",`
587
+ `," "],vP=["{","}","|","\\","^","`"].concat(yP),xP=["'"].concat(vP),C4=["%","/","?",";","#"].concat(xP),_4=["/","?","#"],wP=255,A4=/^[+a-z0-9A-Z_-]{0,63}$/,kP=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,T4={javascript:!0,"javascript:":!0},M4={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function _1(t,e){if(t&&t instanceof c0)return t;const n=new c0;return n.parse(t,e),n}c0.prototype.parse=function(t,e){let n,r,i,s=t;if(s=s.trim(),!e&&t.split("#").length===1){const u=bP.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let o=mP.exec(s);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,s=s.substr(o.length)),(e||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=s.substr(0,2)==="//",i&&!(o&&T4[o])&&(s=s.substr(2),this.slashes=!0)),!T4[o]&&(i||o&&!M4[o])){let u=-1;for(let p=0;p<_4.length;p++)r=s.indexOf(_4[p]),r!==-1&&(u===-1||r<u)&&(u=r);let c,d;u===-1?d=s.lastIndexOf("@"):d=s.lastIndexOf("@",u),d!==-1&&(c=s.slice(0,d),s=s.slice(d+1),this.auth=c),u=-1;for(let p=0;p<C4.length;p++)r=s.indexOf(C4[p]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=s.length),s[u-1]===":"&&u--;const h=s.slice(0,u);s=s.slice(u),this.parseHost(h),this.hostname=this.hostname||"";const f=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!f){const p=this.hostname.split(/\./);for(let m=0,g=p.length;m<g;m++){const y=p[m];if(y&&!y.match(A4)){let x="";for(let k=0,C=y.length;k<C;k++)y.charCodeAt(k)>127?x+="x":x+=y[k];if(!x.match(A4)){const k=p.slice(0,m),C=p.slice(m+1),_=y.match(kP);_&&(k.push(_[1]),C.unshift(_[2])),C.length&&(s=C.join(".")+s),this.hostname=k.join(".");break}}}}this.hostname.length>wP&&(this.hostname=""),f&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const l=s.indexOf("?");return l!==-1&&(this.search=s.substr(l),s=s.slice(0,l)),s&&(this.pathname=s),M4[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};c0.prototype.parseHost=function(t){let e=gP.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const EP=Object.freeze(Object.defineProperty({__proto__:null,decode:Xo,encode:zl,format:C1,parse:_1},Symbol.toStringTag,{value:"Module"})),T8=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,M8=/[\0-\x1F\x7F-\x9F]/,SP=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,A1=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,N8=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,D8=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,CP=Object.freeze(Object.defineProperty({__proto__:null,Any:T8,Cc:M8,Cf:SP,P:A1,S:N8,Z:D8},Symbol.toStringTag,{value:"Module"})),_P=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),AP=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var zh;const TP=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),MP=(zh=String.fromCodePoint)!==null&&zh!==void 0?zh:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function NP(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=TP.get(t))!==null&&e!==void 0?e:t}var Ht;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Ht||(Ht={}));const DP=32;var Wi;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Wi||(Wi={}));function Mp(t){return t>=Ht.ZERO&&t<=Ht.NINE}function OP(t){return t>=Ht.UPPER_A&&t<=Ht.UPPER_F||t>=Ht.LOWER_A&&t<=Ht.LOWER_F}function RP(t){return t>=Ht.UPPER_A&&t<=Ht.UPPER_Z||t>=Ht.LOWER_A&&t<=Ht.LOWER_Z||Mp(t)}function IP(t){return t===Ht.EQUALS||RP(t)}var Ft;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Ft||(Ft={}));var si;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(si||(si={}));class LP{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Ft.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=si.Strict}startEntity(e){this.decodeMode=e,this.state=Ft.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Ft.EntityStart:return e.charCodeAt(n)===Ht.NUM?(this.state=Ft.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Ft.NamedEntity,this.stateNamedEntity(e,n));case Ft.NumericStart:return this.stateNumericStart(e,n);case Ft.NumericDecimal:return this.stateNumericDecimal(e,n);case Ft.NumericHex:return this.stateNumericHex(e,n);case Ft.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|DP)===Ht.LOWER_X?(this.state=Ft.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Ft.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Mp(i)||OP(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Mp(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ht.SEMI)this.consumed+=1;else if(this.decodeMode===si.Strict)return 0;return this.emitCodePoint(NP(this.result),this.consumed),this.errors&&(e!==Ht.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Wi.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const o=e.charCodeAt(n);if(this.treeIndex=zP(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===si.Attribute&&(s===0||IP(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Wi.VALUE_LENGTH)>>14,s!==0){if(o===Ht.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==si.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Wi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Wi.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case Ft.NamedEntity:return this.result!==0&&(this.decodeMode!==si.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ft.NumericDecimal:return this.emitNumericEntity(0,2);case Ft.NumericHex:return this.emitNumericEntity(0,3);case Ft.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ft.EntityStart:return 0}}}function O8(t){let e="";const n=new LP(t,r=>e+=MP(r));return function(i,s){let o=0,a=0;for(;(a=i.indexOf("&",a))>=0;){e+=i.slice(o,a),n.startEntity(s);const u=n.write(i,a+1);if(u<0){o=a+n.end();break}o=a+u,a=u===0?o+1:o}const l=e+i.slice(o);return e="",l}}function zP(t,e,n,r){const i=(e&Wi.BRANCH_LENGTH)>>7,s=e&Wi.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const l=r-s;return l<0||l>=i?-1:t[n+l]-1}let o=n,a=o+i-1;for(;o<=a;){const l=o+a>>>1,u=t[l];if(u<r)o=l+1;else if(u>r)a=l-1;else return t[l+i]}return-1}const R8=O8(_P);O8(AP);function BP(t,e=si.Legacy){return R8(t,e)}function FP(t){return R8(t,si.Strict)}function PP(t){return Object.prototype.toString.call(t)}function T1(t){return PP(t)==="[object String]"}const $P=Object.prototype.hasOwnProperty;function HP(t,e){return $P.call(t,e)}function cd(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function I8(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function M1(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function yl(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const L8=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,UP=/&([a-z#][a-z0-9]{1,31});/gi,qP=new RegExp(L8.source+"|"+UP.source,"gi"),jP=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function VP(t,e){if(e.charCodeAt(0)===35&&jP.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return M1(r)?yl(r):t}const n=BP(t);return n!==t?n:t}function WP(t){return t.indexOf("\\")<0?t:t.replace(L8,"$1")}function Qo(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(qP,function(e,n,r){return n||VP(e,r)})}const GP=/[&<>"]/,KP=/[&<>"]/g,YP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function ZP(t){return YP[t]}function ls(t){return GP.test(t)?t.replace(KP,ZP):t}const JP=/[.?*+^$[\]\\(){}|-]/g;function XP(t){return t.replace(JP,"\\$&")}function rt(t){switch(t){case 9:case 32:return!0}return!1}function vl(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function z8(t){return A1.test(t)||N8.test(t)}function xl(t){return z8(yl(t))}function wl(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function dd(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}function N4(t){return t===32||t===9||t===10||t===13}function hd(t){let e=0;for(;e<t.length&&N4(t.charCodeAt(e));e++);let n=t.length-1;for(;n>=e&&N4(t.charCodeAt(n));n--);return t.slice(e,n+1)}const QP={mdurl:EP,ucmicro:CP},e$=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:I8,asciiTrim:hd,assign:cd,escapeHtml:ls,escapeRE:XP,fromCodePoint:yl,has:HP,isMdAsciiPunct:wl,isPunctChar:z8,isPunctCharCode:xl,isSpace:rt,isString:T1,isValidEntityCode:M1,isWhiteSpace:vl,lib:QP,normalizeReference:dd,unescapeAll:Qo,unescapeMd:WP},Symbol.toStringTag,{value:"Module"}));function t$(t,e,n){let r,i,s,o;const a=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos<a;){if(s=t.src.charCodeAt(t.pos),s===93&&(r--,r===0)){i=!0;break}if(o=t.pos,t.md.inline.skipToken(t),s===91){if(o===t.pos-1)r++;else if(n)return t.pos=l,-1}}let u=-1;return i&&(u=t.pos),t.pos=l,u}function n$(t,e,n){let r,i=e;const s={ok:!1,pos:0,str:""};if(t.charCodeAt(i)===60){for(i++;i<n;){if(r=t.charCodeAt(i),r===10||r===60)return s;if(r===62)return s.pos=i+1,s.str=Qo(t.slice(e+1,i)),s.ok=!0,s;if(r===92&&i+1<n){i+=2;continue}i++}return s}let o=0;for(;i<n&&(r=t.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(t.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return s;if(r===41){if(o===0)break;o--}i++}return e===i||o!==0||(s.str=Qo(t.slice(e,i)),s.pos=i,s.ok=!0),s}function r$(t,e,n,r){let i,s=e;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(s>=n)return o;let a=t.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return o;e++,s++,a===40&&(a=41),o.marker=a}for(;s<n;){if(i=t.charCodeAt(s),i===o.marker)return o.pos=s+1,o.str+=Qo(t.slice(e,s)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&s+1<n&&s++,s++}return o.can_continue=!0,o.str+=Qo(t.slice(e,s)),o}const i$=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:n$,parseLinkLabel:t$,parseLinkTitle:r$},Symbol.toStringTag,{value:"Module"})),qr={};qr.code_inline=function(t,e,n,r,i){const s=t[e];return"<code"+i.renderAttrs(s)+">"+ls(s.content)+"</code>"};qr.code_block=function(t,e,n,r,i){const s=t[e];return"<pre"+i.renderAttrs(s)+"><code>"+ls(t[e].content)+`</code></pre>
588
+ `};qr.fence=function(t,e,n,r,i){const s=t[e],o=s.info?Qo(s.info).trim():"";let a="",l="";if(o){const c=o.split(/(\s+)/g);a=c[0],l=c.slice(2).join("")}let u;if(n.highlight?u=n.highlight(s.content,a,l)||ls(s.content):u=ls(s.content),u.indexOf("<pre")===0)return u+`
589
+ `;if(o){const c=s.attrIndex("class"),d=s.attrs?s.attrs.slice():[];c<0?d.push(["class",n.langPrefix+a]):(d[c]=d[c].slice(),d[c][1]+=" "+n.langPrefix+a);const h={attrs:d};return`<pre><code${i.renderAttrs(h)}>${u}</code></pre>
590
+ `}return`<pre><code${i.renderAttrs(s)}>${u}</code></pre>
591
+ `};qr.image=function(t,e,n,r,i){const s=t[e];return s.attrs[s.attrIndex("alt")][1]=i.renderInlineAsText(s.children,n,r),i.renderToken(t,e,n)};qr.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
592
+ `:`<br>
593
+ `};qr.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
594
+ `:`<br>
595
+ `:`
596
+ `};qr.text=function(t,e){return ls(t[e].content)};qr.html_block=function(t,e){return t[e].content};qr.html_inline=function(t,e){return t[e].content};function da(){this.rules=cd({},qr)}da.prototype.renderAttrs=function(e){let n,r,i;if(!e.attrs)return"";for(i="",n=0,r=e.attrs.length;n<r;n++)i+=" "+ls(e.attrs[n][0])+'="'+ls(e.attrs[n][1])+'"';return i};da.prototype.renderToken=function(e,n,r){const i=e[n];let s="";if(i.hidden)return"";i.block&&i.nesting!==-1&&n&&e[n-1].hidden&&(s+=`
597
+ `),s+=(i.nesting===-1?"</":"<")+i.tag,s+=this.renderAttrs(i),i.nesting===0&&r.xhtmlOut&&(s+=" /");let o=!1;if(i.block&&(o=!0,i.nesting===1&&n+1<e.length)){const a=e[n+1];(a.type==="inline"||a.hidden||a.nesting===-1&&a.tag===i.tag)&&(o=!1)}return s+=o?`>
598
+ `:">",s};da.prototype.renderInline=function(t,e,n){let r="";const i=this.rules;for(let s=0,o=t.length;s<o;s++){const a=t[s].type;typeof i[a]<"u"?r+=i[a](t,s,e,n,this):r+=this.renderToken(t,s,e)}return r};da.prototype.renderInlineAsText=function(t,e,n){let r="";for(let i=0,s=t.length;i<s;i++)switch(t[i].type){case"text":r+=t[i].content;break;case"image":r+=this.renderInlineAsText(t[i].children,e,n);break;case"html_inline":case"html_block":r+=t[i].content;break;case"softbreak":case"hardbreak":r+=`
599
+ `;break}return r};da.prototype.render=function(t,e,n){let r="";const i=this.rules;for(let s=0,o=t.length;s<o;s++){const a=t[s].type;a==="inline"?r+=this.renderInline(t[s].children,e,n):typeof i[a]<"u"?r+=i[a](t,s,e,n,this):r+=this.renderToken(t,s,e,n)}return r};function Cn(){this.__rules__=[],this.__cache__=null}Cn.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};Cn.prototype.__compile__=function(){const t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||t.__cache__[n].push(r.fn))})})};Cn.prototype.at=function(t,e,n){const r=this.__find__(t),i=n||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=i.alt||[],this.__cache__=null};Cn.prototype.before=function(t,e,n,r){const i=this.__find__(t),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null};Cn.prototype.after=function(t,e,n,r){const i=this.__find__(t),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null};Cn.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};Cn.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,n.push(r)},this),this.__cache__=null,n};Cn.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};Cn.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,n.push(r)},this),this.__cache__=null,n};Cn.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function vr(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}vr.prototype.attrIndex=function(e){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,i=n.length;r<i;r++)if(n[r][0]===e)return r;return-1};vr.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};vr.prototype.attrSet=function(e,n){const r=this.attrIndex(e),i=[e,n];r<0?this.attrPush(i):this.attrs[r]=i};vr.prototype.attrGet=function(e){const n=this.attrIndex(e);let r=null;return n>=0&&(r=this.attrs[n][1]),r};vr.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function B8(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}B8.prototype.Token=vr;const s$=/\r\n?|\n/g,o$=/\0/g;function a$(t){let e;e=t.src.replace(s$,`
600
+ `),e=e.replace(o$,"�"),t.src=e}function l$(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function u$(t){const e=t.tokens;for(let n=0,r=e.length;n<r;n++){const i=e[n];i.type==="inline"&&t.md.inline.parse(i.content,t.md,t.env,i.children)}}function c$(t){return/^<a[>\s]/i.test(t)}function d$(t){return/^<\/a\s*>/i.test(t)}function h$(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n<r;n++){if(e[n].type!=="inline"||!t.md.linkify.pretest(e[n].content))continue;let i=e[n].children,s=0;for(let o=i.length-1;o>=0;o--){const a=i[o];if(a.type==="link_close"){for(o--;i[o].level!==a.level&&i[o].type!=="link_open";)o--;continue}if(a.type==="html_inline"&&(c$(a.content)&&s>0&&s--,d$(a.content)&&s++),!(s>0)&&a.type==="text"&&t.md.linkify.test(a.content)){const l=a.content;let u=t.md.linkify.match(l);const c=[];let d=a.level,h=0;u.length>0&&u[0].index===0&&o>0&&i[o-1].type==="text_special"&&(u=u.slice(1));for(let f=0;f<u.length;f++){const p=u[f].url,m=t.md.normalizeLink(p);if(!t.md.validateLink(m))continue;let g=u[f].text;u[f].schema?u[f].schema==="mailto:"&&!/^mailto:/i.test(g)?g=t.md.normalizeLinkText("mailto:"+g).replace(/^mailto:/,""):g=t.md.normalizeLinkText(g):g=t.md.normalizeLinkText("http://"+g).replace(/^http:\/\//,"");const y=u[f].index;if(y>h){const _=new t.Token("text","",0);_.content=l.slice(h,y),_.level=d,c.push(_)}const x=new t.Token("link_open","a",1);x.attrs=[["href",m]],x.level=d++,x.markup="linkify",x.info="auto",c.push(x);const k=new t.Token("text","",0);k.content=g,k.level=d,c.push(k);const C=new t.Token("link_close","a",-1);C.level=--d,C.markup="linkify",C.info="auto",c.push(C),h=u[f].lastIndex}if(h<l.length){const f=new t.Token("text","",0);f.content=l.slice(h),f.level=d,c.push(f)}e[n].children=i=I8(i,o,c)}}}}const F8=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,f$=/\((c|tm|r)\)/i,p$=/\((c|tm|r)\)/ig,m$={c:"©",r:"®",tm:"™"};function g$(t,e){return m$[e.toLowerCase()]}function b$(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(p$,g$)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function y$(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&F8.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function v$(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(f$.test(t.tokens[e].content)&&b$(t.tokens[e].children),F8.test(t.tokens[e].content)&&y$(t.tokens[e].children))}const x$=/['"]/,D4=/['"]/g,O4="’";function Cu(t,e,n,r){t[e]||(t[e]=[]),t[e].push({pos:n,ch:r})}function w$(t,e){let n="",r=0;e.sort((i,s)=>i.pos-s.pos);for(let i=0;i<e.length;i++){const s=e[i];n+=t.slice(r,s.pos)+s.ch,r=s.pos+1}return n+t.slice(r)}function k$(t,e){let n;const r=[],i={};for(let s=0;s<t.length;s++){const o=t[s],a=t[s].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,o.type!=="text")continue;const l=o.content;let u=0;const c=l.length;e:for(;u<c;){D4.lastIndex=u;const d=D4.exec(l);if(!d)break;let h=!0,f=!0;u=d.index+1;const p=d[0]==="'";let m=32;if(d.index-1>=0)m=l.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){m=t[n].content.charCodeAt(t[n].content.length-1);break}let g=32;if(u<c)g=l.charCodeAt(u);else for(n=s+1;n<t.length&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n++)if(t[n].content){g=t[n].content.charCodeAt(0);break}const y=wl(m)||xl(m),x=wl(g)||xl(g),k=vl(m),C=vl(g);if(C?h=!1:x&&(k||y||(h=!1)),k?f=!1:y&&(C||x||(f=!1)),g===34&&d[0]==='"'&&m>=48&&m<=57&&(f=h=!1),h&&f&&(h=y,f=x),!h&&!f){p&&Cu(i,s,d.index,O4);continue}if(f)for(n=r.length-1;n>=0;n--){let _=r[n];if(r[n].level<a)break;if(_.single===p&&r[n].level===a){_=r[n];let T,D;p?(T=e.md.options.quotes[2],D=e.md.options.quotes[3]):(T=e.md.options.quotes[0],D=e.md.options.quotes[1]),Cu(i,s,d.index,D),Cu(i,_.token,_.pos,T),r.length=n;continue e}}h?r.push({token:s,pos:d.index,single:p,level:a}):f&&p&&Cu(i,s,d.index,O4)}}Object.keys(i).forEach(function(s){t[s].content=w$(t[s].content,i[s])})}function E$(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!x$.test(t.tokens[e].content)||k$(t.tokens[e].children,t)}function S$(t){let e,n;const r=t.tokens,i=r.length;for(let s=0;s<i;s++){if(r[s].type!=="inline")continue;const o=r[s].children,a=o.length;for(e=0;e<a;e++)o[e].type==="text_special"&&(o[e].type="text");for(e=n=0;e<a;e++)o[e].type==="text"&&e+1<a&&o[e+1].type==="text"?o[e+1].content=o[e].content+o[e+1].content:(e!==n&&(o[n]=o[e]),n++);e!==n&&(o.length=n)}}const Bh=[["normalize",a$],["block",l$],["inline",u$],["linkify",h$],["replacements",v$],["smartquotes",E$],["text_join",S$]];function N1(){this.ruler=new Cn;for(let t=0;t<Bh.length;t++)this.ruler.push(Bh[t][0],Bh[t][1])}N1.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)};N1.prototype.State=B8;function jr(t,e,n,r){this.src=t,this.md=e,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const i=this.src;for(let s=0,o=0,a=0,l=0,u=i.length,c=!1;o<u;o++){const d=i.charCodeAt(o);if(!c)if(rt(d)){a++,d===9?l+=4-l%4:l++;continue}else c=!0;(d===10||o===u-1)&&(d!==10&&o++,this.bMarks.push(s),this.eMarks.push(o),this.tShift.push(a),this.sCount.push(l),this.bsCount.push(0),c=!1,a=0,l=0,s=o+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}jr.prototype.push=function(t,e,n){const r=new vr(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};jr.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};jr.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};jr.prototype.skipSpaces=function(e){for(let n=this.src.length;e<n;e++){const r=this.src.charCodeAt(e);if(!rt(r))break}return e};jr.prototype.skipSpacesBack=function(e,n){if(e<=n)return e;for(;e>n;)if(!rt(this.src.charCodeAt(--e)))return e+1;return e};jr.prototype.skipChars=function(e,n){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e};jr.prototype.skipCharsBack=function(e,n,r){if(e<=r)return e;for(;e>r;)if(n!==this.src.charCodeAt(--e))return e+1;return e};jr.prototype.getLines=function(e,n,r,i){if(e>=n)return"";const s=new Array(n-e);for(let o=0,a=e;a<n;a++,o++){let l=0;const u=this.bMarks[a];let c=u,d;for(a+1<n||i?d=this.eMarks[a]+1:d=this.eMarks[a];c<d&&l<r;){const h=this.src.charCodeAt(c);if(rt(h))h===9?l+=4-(l+this.bsCount[a])%4:l++;else if(c-u<this.tShift[a])l++;else break;c++}l>r?s[o]=new Array(l-r+1).join(" ")+this.src.slice(c,d):s[o]=this.src.slice(c,d)}return s.join("")};jr.prototype.Token=vr;const C$=65536;function Fh(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function R4(t){const e=[],n=t.length;let r=0,i=t.charCodeAt(r),s=!1,o=0,a="";for(;r<n;)i===124&&(s?(a+=t.substring(o,r-1),o=r):(e.push(a+t.substring(o,r)),a="",o=r+1)),s=i===92,r++,i=t.charCodeAt(r);return e.push(a+t.substring(o)),e}function _$(t,e,n,r){if(e+2>n)return!1;let i=e+1;if(t.sCount[i]<t.blkIndent||t.sCount[i]-t.blkIndent>=4)return!1;let s=t.bMarks[i]+t.tShift[i];if(s>=t.eMarks[i])return!1;const o=t.src.charCodeAt(s++);if(o!==124&&o!==45&&o!==58||s>=t.eMarks[i])return!1;const a=t.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!rt(a)||o===45&&rt(a))return!1;for(;s<t.eMarks[i];){const C=t.src.charCodeAt(s);if(C!==124&&C!==45&&C!==58&&!rt(C))return!1;s++}let l=Fh(t,e+1),u=l.split("|");const c=[];for(let C=0;C<u.length;C++){const _=u[C].trim();if(!_){if(C===0||C===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(_))return!1;_.charCodeAt(_.length-1)===58?c.push(_.charCodeAt(0)===58?"center":"right"):_.charCodeAt(0)===58?c.push("left"):c.push("")}if(l=Fh(t,e).trim(),l.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;u=R4(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(r)return!0;const h=t.parentType;t.parentType="table";const f=t.md.block.ruler.getRules("blockquote"),p=t.push("table_open","table",1),m=[e,0];p.map=m;const g=t.push("thead_open","thead",1);g.map=[e,e+1];const y=t.push("tr_open","tr",1);y.map=[e,e+1];for(let C=0;C<u.length;C++){const _=t.push("th_open","th",1);c[C]&&(_.attrs=[["style","text-align:"+c[C]]]);const T=t.push("inline","",0);T.content=u[C].trim(),T.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let x,k=0;for(i=e+2;i<n&&!(t.sCount[i]<t.blkIndent);i++){let C=!1;for(let T=0,D=f.length;T<D;T++)if(f[T](t,i,n,!0)){C=!0;break}if(C||(l=Fh(t,i).trim(),!l)||t.sCount[i]-t.blkIndent>=4||(u=R4(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),k+=d-u.length,k>C$))break;if(i===e+2){const T=t.push("tbody_open","tbody",1);T.map=x=[e+2,0]}const _=t.push("tr_open","tr",1);_.map=[i,i+1];for(let T=0;T<d;T++){const D=t.push("td_open","td",1);c[T]&&(D.attrs=[["style","text-align:"+c[T]]]);const I=t.push("inline","",0);I.content=u[T]?u[T].trim():"",I.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return x&&(t.push("tbody_close","tbody",-1),x[1]=i),t.push("table_close","table",-1),m[1]=i,t.parentType=h,t.line=i,!0}function A$(t,e,n){if(t.sCount[e]-t.blkIndent<4)return!1;let r=e+1,i=r;for(;r<n;){if(t.isEmpty(r)){r++;continue}if(t.sCount[r]-t.blkIndent>=4){r++,i=r;continue}break}t.line=i;const s=t.push("code_block","code",0);return s.content=t.getLines(e,i,4+t.blkIndent,!1)+`
601
+ `,s.map=[e,t.line],!0}function T$(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||i+3>s)return!1;const o=t.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let a=i;i=t.skipChars(i,o);let l=i-a;if(l<3)return!1;const u=t.src.slice(a,i),c=t.src.slice(i,s);if(o===96&&c.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=e,h=!1;for(;d++,!(d>=n||(i=a=t.bMarks[d]+t.tShift[d],s=t.eMarks[d],i<s&&t.sCount[d]<t.blkIndent));)if(t.src.charCodeAt(i)===o&&!(t.sCount[d]-t.blkIndent>=4)&&(i=t.skipChars(i,o),!(i-a<l)&&(i=t.skipSpaces(i),!(i<s)))){h=!0;break}l=t.sCount[e],t.line=d+(h?1:0);const f=t.push("fence","code",0);return f.info=c,f.content=t.getLines(e+1,d,l,!0),f.markup=u,f.map=[e,t.line],!0}function M$(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];const o=t.lineMax;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],l=[],u=[],c=[],d=t.md.block.ruler.getRules("blockquote"),h=t.parentType;t.parentType="blockquote";let f=!1,p;for(p=e;p<n;p++){const k=t.sCount[p]<t.blkIndent;if(i=t.bMarks[p]+t.tShift[p],s=t.eMarks[p],i>=s)break;if(t.src.charCodeAt(i++)===62&&!k){let _=t.sCount[p]+1,T,D;t.src.charCodeAt(i)===32?(i++,_++,D=!1,T=!0):t.src.charCodeAt(i)===9?(T=!0,(t.bsCount[p]+_)%4===3?(i++,_++,D=!1):D=!0):T=!1;let I=_;for(a.push(t.bMarks[p]),t.bMarks[p]=i;i<s;){const L=t.src.charCodeAt(i);if(rt(L))L===9?I+=4-(I+t.bsCount[p]+(D?1:0))%4:I++;else break;i++}f=i>=s,l.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(T?1:0),u.push(t.sCount[p]),t.sCount[p]=I-_,c.push(t.tShift[p]),t.tShift[p]=i-t.bMarks[p];continue}if(f)break;let C=!1;for(let _=0,T=d.length;_<T;_++)if(d[_](t,p,n,!0)){C=!0;break}if(C){t.lineMax=p,t.blkIndent!==0&&(a.push(t.bMarks[p]),l.push(t.bsCount[p]),c.push(t.tShift[p]),u.push(t.sCount[p]),t.sCount[p]-=t.blkIndent);break}a.push(t.bMarks[p]),l.push(t.bsCount[p]),c.push(t.tShift[p]),u.push(t.sCount[p]),t.sCount[p]=-1}const m=t.blkIndent;t.blkIndent=0;const g=t.push("blockquote_open","blockquote",1);g.markup=">";const y=[e,0];g.map=y,t.md.block.tokenize(t,e,p);const x=t.push("blockquote_close","blockquote",-1);x.markup=">",t.lineMax=o,t.parentType=h,y[1]=t.line;for(let k=0;k<c.length;k++)t.bMarks[k+e]=a[k],t.tShift[k+e]=c[k],t.sCount[k+e]=u[k],t.bsCount[k+e]=l[k];return t.blkIndent=m,!0}function N$(t,e,n,r){const i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.bMarks[e]+t.tShift[e];const o=t.src.charCodeAt(s++);if(o!==42&&o!==45&&o!==95)return!1;let a=1;for(;s<i;){const u=t.src.charCodeAt(s++);if(u!==o&&!rt(u))return!1;u===o&&a++}if(a<3)return!1;if(r)return!0;t.line=e+1;const l=t.push("hr","hr",0);return l.map=[e,t.line],l.markup=Array(a+1).join(String.fromCharCode(o)),!0}function I4(t,e){const n=t.eMarks[e];let r=t.bMarks[e]+t.tShift[e];const i=t.src.charCodeAt(r++);if(i!==42&&i!==45&&i!==43)return-1;if(r<n){const s=t.src.charCodeAt(r);if(!rt(s))return-1}return r}function L4(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];let i=n;if(i+1>=r)return-1;let s=t.src.charCodeAt(i++);if(s<48||s>57)return-1;for(;;){if(i>=r)return-1;if(s=t.src.charCodeAt(i++),s>=48&&s<=57){if(i-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return i<r&&(s=t.src.charCodeAt(i),!rt(s))?-1:i}function D$(t,e){const n=t.level+2;for(let r=e+2,i=t.tokens.length-2;r<i;r++)t.tokens[r].level===n&&t.tokens[r].type==="paragraph_open"&&(t.tokens[r+2].hidden=!0,t.tokens[r].hidden=!0,r+=2)}function O$(t,e,n,r){let i,s,o,a,l=e,u=!0;if(t.sCount[l]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]<t.blkIndent)return!1;let c=!1;r&&t.parentType==="paragraph"&&t.sCount[l]>=t.blkIndent&&(c=!0);let d,h,f;if((f=L4(t,l))>=0){if(d=!0,o=t.bMarks[l]+t.tShift[l],h=Number(t.src.slice(o,f-1)),c&&h!==1)return!1}else if((f=I4(t,l))>=0)d=!1;else return!1;if(c&&t.skipSpaces(f)>=t.eMarks[l])return!1;if(r)return!0;const p=t.src.charCodeAt(f-1),m=t.tokens.length;d?(a=t.push("ordered_list_open","ol",1),h!==1&&(a.attrs=[["start",h]])):a=t.push("bullet_list_open","ul",1);const g=[l,0];a.map=g,a.markup=String.fromCharCode(p);let y=!1;const x=t.md.block.ruler.getRules("list"),k=t.parentType;for(t.parentType="list";l<n;){s=f,i=t.eMarks[l];const C=t.sCount[l]+f-(t.bMarks[l]+t.tShift[l]);let _=C;for(;s<i;){const te=t.src.charCodeAt(s);if(te===9)_+=4-(_+t.bsCount[l])%4;else if(te===32)_++;else break;s++}const T=s;let D;T>=i?D=1:D=_-C,D>4&&(D=1);const I=C+D;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const L=[l,0];a.map=L,d&&(a.info=t.src.slice(o,f-1));const G=t.tight,ie=t.tShift[l],oe=t.sCount[l],be=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=I,t.tight=!0,t.tShift[l]=T-t.bMarks[l],t.sCount[l]=_,T>=i&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),(!t.tight||y)&&(u=!1),y=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=be,t.tShift[l]=ie,t.sCount[l]=oe,t.tight=G,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),l=t.line,L[1]=l,l>=n||t.sCount[l]<t.blkIndent||t.sCount[l]-t.blkIndent>=4)break;let Y=!1;for(let te=0,Te=x.length;te<Te;te++)if(x[te](t,l,n,!0)){Y=!0;break}if(Y)break;if(d){if(f=L4(t,l),f<0)break;o=t.bMarks[l]+t.tShift[l]}else if(f=I4(t,l),f<0)break;if(p!==t.src.charCodeAt(f-1))break}return d?a=t.push("ordered_list_close","ol",-1):a=t.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(p),g[1]=l,t.line=l,t.parentType=k,u&&D$(t,m),!0}function R$(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e],o=e+1;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(i)!==91)return!1;function a(x){const k=t.lineMax;if(x>=k||t.isEmpty(x))return null;let C=!1;if(t.sCount[x]-t.blkIndent>3&&(C=!0),t.sCount[x]<0&&(C=!0),!C){const D=t.md.block.ruler.getRules("reference"),I=t.parentType;t.parentType="reference";let L=!1;for(let G=0,ie=D.length;G<ie;G++)if(D[G](t,x,k,!0)){L=!0;break}if(t.parentType=I,L)return null}const _=t.bMarks[x]+t.tShift[x],T=t.eMarks[x];return t.src.slice(_,T+1)}let l=t.src.slice(i,s+1);s=l.length;let u=-1;for(i=1;i<s;i++){const x=l.charCodeAt(i);if(x===91)return!1;if(x===93){u=i;break}else if(x===10){const k=a(o);k!==null&&(l+=k,s=l.length,o++)}else if(x===92&&(i++,i<s&&l.charCodeAt(i)===10)){const k=a(o);k!==null&&(l+=k,s=l.length,o++)}}if(u<0||l.charCodeAt(u+1)!==58)return!1;for(i=u+2;i<s;i++){const x=l.charCodeAt(i);if(x===10){const k=a(o);k!==null&&(l+=k,s=l.length,o++)}else if(!rt(x))break}const c=t.md.helpers.parseLinkDestination(l,i,s);if(!c.ok)return!1;const d=t.md.normalizeLink(c.str);if(!t.md.validateLink(d))return!1;i=c.pos;const h=i,f=o,p=i;for(;i<s;i++){const x=l.charCodeAt(i);if(x===10){const k=a(o);k!==null&&(l+=k,s=l.length,o++)}else if(!rt(x))break}let m=t.md.helpers.parseLinkTitle(l,i,s);for(;m.can_continue;){const x=a(o);if(x===null)break;l+=x,i=s,s=l.length,o++,m=t.md.helpers.parseLinkTitle(l,i,s,m)}let g;for(i<s&&p!==i&&m.ok?(g=m.str,i=m.pos):(g="",i=h,o=f);i<s;){const x=l.charCodeAt(i);if(!rt(x))break;i++}if(i<s&&l.charCodeAt(i)!==10&&g)for(g="",i=h,o=f;i<s;){const x=l.charCodeAt(i);if(!rt(x))break;i++}if(i<s&&l.charCodeAt(i)!==10)return!1;const y=dd(l.slice(1,u));return y?(r||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[y]>"u"&&(t.env.references[y]={title:g,href:d}),t.line=o),!0):!1}const I$=["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"],L$="[a-zA-Z_:][a-zA-Z0-9:._-]*",z$="[^\"'=<>`\\x00-\\x20]+",B$="'[^']*'",F$='"[^"]*"',P$="(?:"+z$+"|"+B$+"|"+F$+")",$$="(?:\\s+"+L$+"(?:\\s*=\\s*"+P$+")?)",P8="<[A-Za-z][A-Za-z0-9\\-]*"+$$+"*\\s*\\/?>",$8="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",H$="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",U$="<[?][\\s\\S]*?[?]>",q$="<![A-Za-z][^>]*>",j$="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",V$=new RegExp("^(?:"+P8+"|"+$8+"|"+H$+"|"+U$+"|"+q$+"|"+j$+")"),W$=new RegExp("^(?:"+P8+"|"+$8+")"),Ss=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+I$.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(W$.source+"\\s*$"),/^$/,!1]];function G$(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(i)!==60)return!1;let o=t.src.slice(i,s),a=0;for(;a<Ss.length&&!Ss[a][0].test(o);a++);if(a===Ss.length)return!1;if(r)return Ss[a][2];let l=e+1;const u=Ss[a][1].test("");if(!Ss[a][1].test(o)){for(;l<n&&!(t.sCount[l]<t.blkIndent&&(u||!t.isEmpty(l)));l++)if(i=t.bMarks[l]+t.tShift[l],s=t.eMarks[l],o=t.src.slice(i,s),Ss[a][1].test(o)){o.length!==0&&l++;break}}t.line=l;const c=t.push("html_block","",0);return c.map=[e,l],c.content=t.getLines(e,l,t.blkIndent,!0),!0}function K$(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let o=t.src.charCodeAt(i);if(o!==35||i>=s)return!1;let a=1;for(o=t.src.charCodeAt(++i);o===35&&i<s&&a<=6;)a++,o=t.src.charCodeAt(++i);if(a>6||i<s&&!rt(o))return!1;if(r)return!0;s=t.skipSpacesBack(s,i);const l=t.skipCharsBack(s,35,i);l>i&&rt(t.src.charCodeAt(l-1))&&(s=l),t.line=e+1;const u=t.push("heading_open","h"+String(a),1);u.markup="########".slice(0,a),u.map=[e,t.line];const c=t.push("inline","",0);c.content=hd(t.src.slice(i,s)),c.map=[e,t.line],c.children=[];const d=t.push("heading_close","h"+String(a),-1);return d.markup="########".slice(0,a),!0}function Y$(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const i=t.parentType;t.parentType="paragraph";let s=0,o,a=e+1;for(;a<n&&!t.isEmpty(a);a++){if(t.sCount[a]-t.blkIndent>3)continue;if(t.sCount[a]>=t.blkIndent){let f=t.bMarks[a]+t.tShift[a];const p=t.eMarks[a];if(f<p&&(o=t.src.charCodeAt(f),(o===45||o===61)&&(f=t.skipChars(f,o),f=t.skipSpaces(f),f>=p))){s=o===61?1:2;break}}if(t.sCount[a]<0)continue;let h=!1;for(let f=0,p=r.length;f<p;f++)if(r[f](t,a,n,!0)){h=!0;break}if(h)break}if(!s)return t.parentType=i,!1;const l=hd(t.getLines(e,a,t.blkIndent,!1));t.line=a+1;const u=t.push("heading_open","h"+String(s),1);u.markup=String.fromCharCode(o),u.map=[e,t.line];const c=t.push("inline","",0);c.content=l,c.map=[e,t.line-1],c.children=[];const d=t.push("heading_close","h"+String(s),-1);return d.markup=String.fromCharCode(o),t.parentType=i,!0}function Z$(t,e,n){const r=t.md.block.ruler.getRules("paragraph"),i=t.parentType;let s=e+1;for(t.parentType="paragraph";s<n&&!t.isEmpty(s);s++){if(t.sCount[s]-t.blkIndent>3||t.sCount[s]<0)continue;let u=!1;for(let c=0,d=r.length;c<d;c++)if(r[c](t,s,n,!0)){u=!0;break}if(u)break}const o=hd(t.getLines(e,s,t.blkIndent,!1));t.line=s;const a=t.push("paragraph_open","p",1);a.map=[e,t.line];const l=t.push("inline","",0);return l.content=o,l.map=[e,t.line],l.children=[],t.push("paragraph_close","p",-1),t.parentType=i,!0}const _u=[["table",_$,["paragraph","reference"]],["code",A$],["fence",T$,["paragraph","reference","blockquote","list"]],["blockquote",M$,["paragraph","reference","blockquote","list"]],["hr",N$,["paragraph","reference","blockquote","list"]],["list",O$,["paragraph","reference","blockquote"]],["reference",R$],["html_block",G$,["paragraph","reference","blockquote"]],["heading",K$,["paragraph","reference","blockquote"]],["lheading",Y$],["paragraph",Z$]];function fd(){this.ruler=new Cn;for(let t=0;t<_u.length;t++)this.ruler.push(_u[t][0],_u[t][1],{alt:(_u[t][2]||[]).slice()})}fd.prototype.tokenize=function(t,e,n){const r=this.ruler.getRules(""),i=r.length,s=t.md.options.maxNesting;let o=e,a=!1;for(;o<n&&(t.line=o=t.skipEmptyLines(o),!(o>=n||t.sCount[o]<t.blkIndent));){if(t.level>=s){t.line=n;break}const l=t.line;let u=!1;for(let c=0;c<i;c++)if(u=r[c](t,o,n,!1),u){if(l>=t.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),o=t.line,o<n&&t.isEmpty(o)&&(a=!0,o++,t.line=o)}};fd.prototype.parse=function(t,e,n,r){if(!t)return;const i=new this.State(t,e,n,r);this.tokenize(i,i.line,i.lineMax)};fd.prototype.State=jr;function Bl(t,e,n,r){this.src=t,this.env=n,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Bl.prototype.pushPending=function(){const t=new vr("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};Bl.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new vr(t,e,n);let i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};Bl.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t);let i;if(t===0)i=32;else if(t===1)i=this.src.charCodeAt(0),(i&63488)===55296&&(i=65533);else if(i=this.src.charCodeAt(t-1),(i&64512)===56320){const g=this.src.charCodeAt(t-2);i=(g&64512)===55296?65536+(g-55296<<10)+(i-56320):65533}else(i&64512)===55296&&(i=65533);let s=t;for(;s<n&&this.src.charCodeAt(s)===r;)s++;const o=s-t;let a=s<n?this.src.charCodeAt(s):32;if((a&64512)===55296){const g=this.src.charCodeAt(s+1);a=(g&64512)===56320?65536+(a-55296<<10)+(g-56320):65533}else(a&64512)===56320&&(a=65533);const l=wl(i)||xl(i),u=wl(a)||xl(a),c=vl(i),d=vl(a),h=!d&&(!u||c||l),f=!c&&(!l||d||u);return{can_open:h&&(e||!f||l),can_close:f&&(e||!h||u),length:o}};Bl.prototype.Token=vr;function J$(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function X$(t,e){let n=t.pos;for(;n<t.posMax&&!J$(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}const Q$=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function eH(t,e){if(!t.md.options.linkify||t.linkLevel>0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const i=t.pending.match(Q$);if(!i)return!1;const s=i[1],o=t.md.linkify.matchAtStart(t.src.slice(n-s.length));if(!o)return!1;let a=o.url;if(a.length<=s.length)return!1;let l=a.length;for(;l>0&&a.charCodeAt(l-1)===42;)l--;l!==a.length&&(a=a.slice(0,l));const u=t.md.normalizeLink(a);if(!t.md.validateLink(u))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);const c=t.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=t.push("text","",0);d.content=t.md.normalizeLinkText(a);const h=t.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return t.pos+=a.length-s.length,!0}function tH(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,i=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n<i&&rt(t.src.charCodeAt(n));)n++;return t.pos=n,!0}const D1=[];for(let t=0;t<256;t++)D1.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){D1[t.charCodeAt(0)]=1});function nH(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=t.src.charCodeAt(n);if(i===10){for(e||t.push("hardbreak","br",0),n++;n<r&&(i=t.src.charCodeAt(n),!!rt(i));)n++;return t.pos=n,!0}let s=t.src[n];if(i>=55296&&i<=56319&&n+1<r){const a=t.src.charCodeAt(n+1);a>=56320&&a<=57343&&(s+=t.src[n+1],n++)}const o="\\"+s;if(!e){const a=t.push("text_special","",0);i<256&&D1[i]!==0?a.content=s:a.content=o,a.markup=o,a.info="escape"}return t.pos=n+1,!0}function rH(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const i=n;n++;const s=t.posMax;for(;n<s&&t.src.charCodeAt(n)===96;)n++;const o=t.src.slice(i,n),a=o.length;if(t.backticksScanned&&(t.backticks[a]||0)<=i)return e||(t.pending+=o),t.pos+=a,!0;let l=n,u;for(;(u=t.src.indexOf("`",l))!==-1;){for(l=u+1;l<s&&t.src.charCodeAt(l)===96;)l++;const c=l-u;if(c===a){if(!e){const d=t.push("code_inline","code",0);d.markup=o,d.content=t.src.slice(n,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=l,!0}t.backticks[c]=u}return t.backticksScanned=!0,e||(t.pending+=o),t.pos+=a,!0}function iH(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==126)return!1;const i=t.scanDelims(t.pos,!0);let s=i.length;const o=String.fromCharCode(r);if(s<2)return!1;let a;s%2&&(a=t.push("text","",0),a.content=o,s--);for(let l=0;l<s;l+=2)a=t.push("text","",0),a.content=o+o,t.delimiters.push({marker:r,length:0,token:t.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return t.pos+=i.length,!0}function z4(t,e){let n;const r=[],i=e.length;for(let s=0;s<i;s++){const o=e[s];if(o.marker!==126||o.end===-1)continue;const a=e[o.end];n=t.tokens[o.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=t.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[a.token-1].type==="text"&&t.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const s=r.pop();let o=s+1;for(;o<t.tokens.length&&t.tokens[o].type==="s_close";)o++;o--,s!==o&&(n=t.tokens[o],t.tokens[o]=t.tokens[s],t.tokens[s]=n)}}function sH(t){const e=t.tokens_meta,n=t.tokens_meta.length;z4(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&z4(t,e[r].delimiters)}const H8={tokenize:iH,postProcess:sH};function oH(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==95&&r!==42)return!1;const i=t.scanDelims(t.pos,r===42);for(let s=0;s<i.length;s++){const o=t.push("text","",0);o.content=String.fromCharCode(r),t.delimiters.push({marker:r,length:i.length,token:t.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return t.pos+=i.length,!0}function B4(t,e){const n=e.length;for(let r=n-1;r>=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const s=e[i.end],o=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===s.token+1,a=String.fromCharCode(i.marker),l=t.tokens[i.token];l.type=o?"strong_open":"em_open",l.tag=o?"strong":"em",l.nesting=1,l.markup=o?a+a:a,l.content="";const u=t.tokens[s.token];u.type=o?"strong_close":"em_close",u.tag=o?"strong":"em",u.nesting=-1,u.markup=o?a+a:a,u.content="",o&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}function aH(t){const e=t.tokens_meta,n=t.tokens_meta.length;B4(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&B4(t,e[r].delimiters)}const U8={tokenize:oH,postProcess:aH};function lH(t,e){let n,r,i,s,o="",a="",l=t.pos,u=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const c=t.pos,d=t.posMax,h=t.pos+1,f=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(f<0)return!1;let p=f+1;if(p<d&&t.src.charCodeAt(p)===40){for(u=!1,p++;p<d&&(n=t.src.charCodeAt(p),!(!rt(n)&&n!==10));p++);if(p>=d)return!1;if(l=p,i=t.md.helpers.parseLinkDestination(t.src,p,t.posMax),i.ok){for(o=t.md.normalizeLink(i.str),t.md.validateLink(o)?p=i.pos:o="",l=p;p<d&&(n=t.src.charCodeAt(p),!(!rt(n)&&n!==10));p++);if(i=t.md.helpers.parseLinkTitle(t.src,p,t.posMax),p<d&&l!==p&&i.ok)for(a=i.str,p=i.pos;p<d&&(n=t.src.charCodeAt(p),!(!rt(n)&&n!==10));p++);}(p>=d||t.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof t.env.references>"u")return!1;if(p<d&&t.src.charCodeAt(p)===91?(l=p+1,p=t.md.helpers.parseLinkLabel(t,p),p>=0?r=t.src.slice(l,p++):p=f+1):p=f+1,r||(r=t.src.slice(h,f)),s=t.env.references[dd(r)],!s)return t.pos=c,!1;o=s.href,a=s.title}if(!e){t.pos=h,t.posMax=f;const m=t.push("link_open","a",1),g=[["href",o]];m.attrs=g,a&&g.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=p,t.posMax=d,!0}function uH(t,e){let n,r,i,s,o,a,l,u,c="";const d=t.pos,h=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const f=t.pos+2,p=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(p<0)return!1;if(s=p+1,s<h&&t.src.charCodeAt(s)===40){for(s++;s<h&&(n=t.src.charCodeAt(s),!(!rt(n)&&n!==10));s++);if(s>=h)return!1;for(u=s,a=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),a.ok&&(c=t.md.normalizeLink(a.str),t.md.validateLink(c)?s=a.pos:c=""),u=s;s<h&&(n=t.src.charCodeAt(s),!(!rt(n)&&n!==10));s++);if(a=t.md.helpers.parseLinkTitle(t.src,s,t.posMax),s<h&&u!==s&&a.ok)for(l=a.str,s=a.pos;s<h&&(n=t.src.charCodeAt(s),!(!rt(n)&&n!==10));s++);else l="";if(s>=h||t.src.charCodeAt(s)!==41)return t.pos=d,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s<h&&t.src.charCodeAt(s)===91?(u=s+1,s=t.md.helpers.parseLinkLabel(t,s),s>=0?i=t.src.slice(u,s++):s=p+1):s=p+1,i||(i=t.src.slice(f,p)),o=t.env.references[dd(i)],!o)return t.pos=d,!1;c=o.href,l=o.title}if(!e){r=t.src.slice(f,p);const m=[];t.md.inline.parse(r,t.md,t.env,m);const g=t.push("image","img",0),y=[["src",c],["alt",""]];g.attrs=y,g.children=m,g.content=r,l&&y.push(["title",l])}return t.pos=s,t.posMax=h,!0}const cH=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,dH=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function hH(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,i=t.posMax;for(;;){if(++n>=i)return!1;const o=t.src.charCodeAt(n);if(o===60)return!1;if(o===62)break}const s=t.src.slice(r+1,n);if(dH.test(s)){const o=t.md.normalizeLink(s);if(!t.md.validateLink(o))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(s);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=s.length+2,!0}if(cH.test(s)){const o=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(o))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(s);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=s.length+2,!0}return!1}function fH(t){return/^<a[>\s]/i.test(t)}function pH(t){return/^<\/a\s*>/i.test(t)}function mH(t){const e=t|32;return e>=97&&e<=122}function gH(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=t.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!mH(i))return!1;const s=t.src.slice(r).match(V$);if(!s)return!1;if(!e){const o=t.push("html_inline","",0);o.content=s[0],fH(o.content)&&t.linkLevel++,pH(o.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}const bH=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,yH=/^&([a-z][a-z0-9]{1,31});/i;function vH(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const s=t.src.slice(n).match(bH);if(s){if(!e){const o=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),a=t.push("text_special","",0);a.content=M1(o)?yl(o):yl(65533),a.markup=s[0],a.info="entity"}return t.pos+=s[0].length,!0}}else{const s=t.src.slice(n).match(yH);if(s){const o=FP(s[0]);if(o!==s[0]){if(!e){const a=t.push("text_special","",0);a.content=o,a.markup=s[0],a.info="entity"}return t.pos+=s[0].length,!0}}}return!1}function F4(t){const e={},n=t.length;if(!n)return;let r=0,i=-2;const s=[];for(let o=0;o<n;o++){const a=t[o];if(s.push(0),(t[r].marker!==a.marker||i!==a.token-1)&&(r=o),i=a.token,a.length=a.length||0,!a.close)continue;e.hasOwnProperty(a.marker)||(e[a.marker]=[-1,-1,-1,-1,-1,-1]);const l=e[a.marker][(a.open?3:0)+a.length%3];let u=r-s[r]-1,c=u;for(;u>l;u-=s[u]+1){const d=t[u];if(d.marker===a.marker&&d.open&&d.end<0){let h=!1;if((d.close||a.open)&&(d.length+a.length)%3===0&&(d.length%3!==0||a.length%3!==0)&&(h=!0),!h){const f=u>0&&!t[u-1].open?s[u-1]+1:0;s[o]=o-u+f,s[u]=f,a.open=!1,d.end=o,d.close=!1,c=-1,i=-2;break}}}c!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=c)}}function xH(t){const e=t.tokens_meta,n=t.tokens_meta.length;F4(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&F4(e[r].delimiters)}function wH(t){let e,n,r=0;const i=t.tokens,s=t.tokens.length;for(e=n=0;e<s;e++)i[e].nesting<0&&r--,i[e].level=r,i[e].nesting>0&&r++,i[e].type==="text"&&e+1<s&&i[e+1].type==="text"?i[e+1].content=i[e].content+i[e+1].content:(e!==n&&(i[n]=i[e]),n++);e!==n&&(i.length=n)}const Ph=[["text",X$],["linkify",eH],["newline",tH],["escape",nH],["backticks",rH],["strikethrough",H8.tokenize],["emphasis",U8.tokenize],["link",lH],["image",uH],["autolink",hH],["html_inline",gH],["entity",vH]],$h=[["balance_pairs",xH],["strikethrough",H8.postProcess],["emphasis",U8.postProcess],["fragments_join",wH]];function Fl(){this.ruler=new Cn;for(let t=0;t<Ph.length;t++)this.ruler.push(Ph[t][0],Ph[t][1]);this.ruler2=new Cn;for(let t=0;t<$h.length;t++)this.ruler2.push($h[t][0],$h[t][1])}Fl.prototype.skipToken=function(t){const e=t.pos,n=this.ruler.getRules(""),r=n.length,i=t.md.options.maxNesting,s=t.cache;if(typeof s[e]<"u"){t.pos=s[e];return}let o=!1;if(t.level<i){for(let a=0;a<r;a++)if(t.level++,o=n[a](t,!0),t.level--,o){if(e>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;o||t.pos++,s[e]=t.pos};Fl.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,i=t.md.options.maxNesting;for(;t.pos<r;){const s=t.pos;let o=!1;if(t.level<i){for(let a=0;a<n;a++)if(o=e[a](t,!1),o){if(s>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Fl.prototype.parse=function(t,e,n,r){const i=new this.State(t,e,n,r);this.tokenize(i);const s=this.ruler2.getRules(""),o=s.length;for(let a=0;a<o;a++)s[a](i)};Fl.prototype.State=Bl;function kH(t){const e={};t=t||{},e.src_Any=T8.source,e.src_Cc=M8.source,e.src_Z=D8.source,e.src_P=A1.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const n="[><|]";return e.src_pseudo_letter="(?:(?!"+n+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+n+"|"+e.src_ZPCc+")(?!"+(t["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function Np(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function pd(t){return Object.prototype.toString.call(t)}function EH(t){return pd(t)==="[object String]"}function SH(t){return pd(t)==="[object Object]"}function CH(t){return pd(t)==="[object RegExp]"}function P4(t){return pd(t)==="[object Function]"}function _H(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const q8={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function AH(t){return Object.keys(t||{}).reduce(function(e,n){return e||q8.hasOwnProperty(n)},!1)}const TH={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},MH="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",NH="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function DH(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function $4(){return function(t,e){e.normalize(t)}}function d0(t){const e=t.re=kH(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(MH),n.push(e.src_xn),e.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(r(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(r(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(r(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const i=[];t.__compiled__={};function s(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(t.__schemas__).forEach(function(a){const l=t.__schemas__[a];if(l===null)return;const u={validate:null,link:null};if(t.__compiled__[a]=u,SH(l)){CH(l.validate)?u.validate=DH(l.validate):P4(l.validate)?u.validate=l.validate:s(a,l),P4(l.normalize)?u.normalize=l.normalize:l.normalize?s(a,l):u.normalize=$4();return}if(EH(l)){i.push(a);return}s(a,l)}),i.forEach(function(a){t.__compiled__[t.__schemas__[a]]&&(t.__compiled__[a].validate=t.__compiled__[t.__schemas__[a]].validate,t.__compiled__[a].normalize=t.__compiled__[t.__schemas__[a]].normalize)}),t.__compiled__[""]={validate:null,normalize:$4()};const o=Object.keys(t.__compiled__).filter(function(a){return a.length>0&&t.__compiled__[a]}).map(_H).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i")}function j8(t,e,n,r){const i=t.slice(n,r);this.schema=e.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function Ln(t,e){if(!(this instanceof Ln))return new Ln(t,e);e||AH(t)&&(e=t,t={}),this.__opts__=Np({},q8,e),this.__schemas__=Np({},TH,t),this.__compiled__={},this.__tlds__=NH,this.__tlds_replaced__=!1,this.re={},d0(this)}Ln.prototype.add=function(e,n){return this.__schemas__[e]=n,d0(this),this};Ln.prototype.set=function(e){return this.__opts__=Np(this.__opts__,e),this};Ln.prototype.test=function(e){if(!e.length)return!1;let n,r;if(this.re.schema_test.test(e)){for(r=this.re.schema_search,r.lastIndex=0;(n=r.exec(e))!==null;)if(this.testSchemaAt(e,n[2],r.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)};Ln.prototype.pretest=function(e){return this.re.pretest.test(e)};Ln.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};Ln.prototype.match=function(e){const n=[],r=[],i=[],s=[];let o,a,l;function u(h,f){return h?f?h.index!==f.index?h.index<f.index?h:f:h.lastIndex>=f.lastIndex?h:f:h:f}if(!e.length)return null;if(this.re.schema_test.test(e))for(l=this.re.schema_search,l.lastIndex=0;(o=l.exec(e))!==null;)a=this.testSchemaAt(e,o[2],l.lastIndex),a&&r.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+a});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(l=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,l.lastIndex=0;(o=l.exec(e))!==null;)i.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(l=this.re.email_fuzzy_global,l.lastIndex=0;(o=l.exec(e))!==null;)s.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});const c=[0,0,0];let d=0;for(;;){const h=[r[c[0]],s[c[1]],i[c[2]]],f=u(u(h[0],h[1]),h[2]);if(!f)break;if(f===h[0]?c[0]++:f===h[1]?c[1]++:c[2]++,f.index<d)continue;const p=new j8(e,f.schema,f.index,f.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=f.lastIndex}return n.length?n:null};Ln.prototype.matchAtStart=function(e){if(!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);if(!r)return null;const i=new j8(e,n[2],n.index+n[1].length,n.index+n[0].length+r);return this.__compiled__[i.schema].normalize(i,this),i};Ln.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,s){return r!==s[i-1]}).reverse(),d0(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,d0(this),this)};Ln.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};Ln.prototype.onCompile=function(){};const zo=2147483647,Rr=36,O1=1,kl=26,OH=38,RH=700,V8=72,W8=128,G8="-",IH=/^xn--/,LH=/[^\0-\x7F]/,zH=/[\x2E\u3002\uFF0E\uFF61]/g,BH={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Hh=Rr-O1,Ir=Math.floor,Uh=String.fromCharCode;function Bi(t){throw new RangeError(BH[t])}function FH(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function K8(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(zH,".");const i=t.split("."),s=FH(i,e).join(".");return r+s}function Y8(t){const e=[];let n=0;const r=t.length;for(;n<r;){const i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const s=t.charCodeAt(n++);(s&64512)==56320?e.push(((i&1023)<<10)+(s&1023)+65536):(e.push(i),n--)}else e.push(i)}return e}const PH=t=>String.fromCodePoint(...t),$H=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:Rr},H4=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Z8=function(t,e,n){let r=0;for(t=n?Ir(t/RH):t>>1,t+=Ir(t/e);t>Hh*kl>>1;r+=Rr)t=Ir(t/Hh);return Ir(r+(Hh+1)*t/(t+OH))},J8=function(t){const e=[],n=t.length;let r=0,i=W8,s=V8,o=t.lastIndexOf(G8);o<0&&(o=0);for(let a=0;a<o;++a)t.charCodeAt(a)>=128&&Bi("not-basic"),e.push(t.charCodeAt(a));for(let a=o>0?o+1:0;a<n;){const l=r;for(let c=1,d=Rr;;d+=Rr){a>=n&&Bi("invalid-input");const h=$H(t.charCodeAt(a++));h>=Rr&&Bi("invalid-input"),h>Ir((zo-r)/c)&&Bi("overflow"),r+=h*c;const f=d<=s?O1:d>=s+kl?kl:d-s;if(h<f)break;const p=Rr-f;c>Ir(zo/p)&&Bi("overflow"),c*=p}const u=e.length+1;s=Z8(r-l,u,l==0),Ir(r/u)>zo-i&&Bi("overflow"),i+=Ir(r/u),r%=u,e.splice(r++,0,i)}return String.fromCodePoint(...e)},X8=function(t){const e=[];t=Y8(t);const n=t.length;let r=W8,i=0,s=V8;for(const l of t)l<128&&e.push(Uh(l));const o=e.length;let a=o;for(o&&e.push(G8);a<n;){let l=zo;for(const c of t)c>=r&&c<l&&(l=c);const u=a+1;l-r>Ir((zo-i)/u)&&Bi("overflow"),i+=(l-r)*u,r=l;for(const c of t)if(c<r&&++i>zo&&Bi("overflow"),c===r){let d=i;for(let h=Rr;;h+=Rr){const f=h<=s?O1:h>=s+kl?kl:h-s;if(d<f)break;const p=d-f,m=Rr-f;e.push(Uh(H4(f+p%m,0))),d=Ir(p/m)}e.push(Uh(H4(d,0))),s=Z8(i,u,a===o),i=0,++a}++i,++r}return e.join("")},HH=function(t){return K8(t,function(e){return IH.test(e)?J8(e.slice(4).toLowerCase()):e})},UH=function(t){return K8(t,function(e){return LH.test(e)?"xn--"+X8(e):e})},Q8={version:"2.3.1",ucs2:{decode:Y8,encode:PH},decode:J8,encode:X8,toASCII:UH,toUnicode:HH},qH={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},jH={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},VH={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},WH={default:qH,zero:jH,commonmark:VH},GH=/^(vbscript|javascript|file|data):/,KH=/^data:image\/(gif|png|jpeg|webp);/;function YH(t){const e=t.trim().toLowerCase();return GH.test(e)?KH.test(e):!0}const ew=["http:","https:","mailto:"];function ZH(t){const e=_1(t,!0);if(e.hostname&&(!e.protocol||ew.indexOf(e.protocol)>=0))try{e.hostname=Q8.toASCII(e.hostname)}catch{}return zl(C1(e))}function JH(t){const e=_1(t,!0);if(e.hostname&&(!e.protocol||ew.indexOf(e.protocol)>=0))try{e.hostname=Q8.toUnicode(e.hostname)}catch{}return Xo(C1(e),Xo.defaultChars+"%")}function _n(t,e){if(!(this instanceof _n))return new _n(t,e);e||T1(t)||(e=t||{},t="default"),this.inline=new Fl,this.block=new fd,this.core=new N1,this.renderer=new da,this.linkify=new Ln,this.validateLink=YH,this.normalizeLink=ZH,this.normalizeLinkText=JH,this.utils=e$,this.helpers=cd({},i$),this.options={},this.configure(t),e&&this.set(e)}_n.prototype.set=function(t){return cd(this.options,t),this};_n.prototype.configure=function(t){const e=this;if(T1(t)){const n=t;if(t=WH[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};_n.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};_n.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};_n.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};_n.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};_n.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};_n.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};_n.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const XH=new om({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function QH(t,e){if(t.isText&&e.isText&&Ve.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}class eU{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:Ve.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let n=this.top(),r=n.content,i=r[r.length-1],s=this.schema.text(e,n.marks),o;i&&(o=QH(i,s))?r[r.length-1]=o:r.push(s)}openMark(e){let n=this.top();n.marks=e.addToSet(n.marks)}closeMark(e){let n=this.top();n.marks=e.removeFromSet(n.marks)}parseTokens(e){for(let n=0;n<e.length;n++){let r=e[n],i=this.tokenHandlers[r.type];if(!i)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");i(this,r,e,n)}}addNode(e,n,r){let i=this.top(),s=e.createAndFill(n,r,i?i.marks:[]);return s?(this.push(s),s):null}openNode(e,n){this.stack.push({type:e,attrs:n,content:[],marks:Ve.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}}function ka(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function qh(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}function U4(t){return t[t.length-1]==`
602
+ `?t.slice(0,t.length-1):t}function jh(){}function tU(t,e){let n=Object.create(null);for(let r in e){let i=e[r];if(i.block){let s=t.nodeType(i.block);qh(i,r)?n[r]=(o,a,l,u)=>{o.openNode(s,ka(i,a,l,u)),o.addText(U4(a.content)),o.closeNode()}:(n[r+"_open"]=(o,a,l,u)=>o.openNode(s,ka(i,a,l,u)),n[r+"_close"]=o=>o.closeNode())}else if(i.node){let s=t.nodeType(i.node);n[r]=(o,a,l,u)=>o.addNode(s,ka(i,a,l,u))}else if(i.mark){let s=t.marks[i.mark];qh(i,r)?n[r]=(o,a,l,u)=>{o.openMark(s.create(ka(i,a,l,u))),o.addText(U4(a.content)),o.closeMark(s)}:(n[r+"_open"]=(o,a,l,u)=>o.openMark(s.create(ka(i,a,l,u))),n[r+"_close"]=o=>o.closeMark(s))}else if(i.ignore)qh(i,r)?n[r]=jh:(n[r+"_open"]=jh,n[r+"_close"]=jh);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(r,i)=>r.addText(i.content),n.inline=(r,i)=>r.parseTokens(i.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}let nU=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=tU(e,r)}parse(e,n={}){let r=new eU(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(e,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}};function q4(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}new nU(XH,_n("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(t,e,n)=>({tight:q4(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:q4(e,n)})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:t=>({params:t.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const rU={open:"",close:"",mixable:!0};let iU=class{constructor(e,n,r={}){this.nodes=e,this.marks=n,this.options=r}serialize(e,n={}){n=Object.assign({},this.options,n);let r=new tw(this.nodes,this.marks,n);return r.renderContent(e),r.out}};const Vr=new iU({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+`
603
+ `),t.text(e.textContent,!1),t.write(`
604
+ `),t.write(r),t.closeBlock(e)},heading(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e,!1),t.closeBlock(e)},horizontal_rule(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list(t,e){t.renderList(e," ",()=>(e.attrs.bullet||"*")+" ")},ordered_list(t,e){let n=e.attrs.order||1,r=String(n+e.childCount-1).length,i=t.repeat(" ",r+2);t.renderList(e,i,s=>{let o=String(n+s);return t.repeat(" ",r-o.length)+o+". "})},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("!["+t.esc(e.attrs.alt||"")+"]("+e.attrs.src.replace(/[\(\)]/g,"\\$&")+(e.attrs.title?' "'+e.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(t,e,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=e.type){t.write(`\\
605
+ `);return}},text(t,e){t.text(e.text,!t.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(t,e,n,r){return t.inAutolink=sU(e,n,r),t.inAutolink?"<":"["},close(t,e,n,r){let{inAutolink:i}=t;return t.inAutolink=void 0,i?">":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return j4(n.child(r),-1)},close(t,e,n,r){return j4(n.child(r-1),1)},escape:!1}});function j4(t,e){let n=/`+/g,r,i=0;if(t.isText)for(;r=n.exec(t.text);)i=Math.max(i,r[0].length);let s=i>0&&e>0?" `":"`";for(let o=0;o<i;o++)s+="`";return i>0&&e<0&&(s+=" "),s}function sU(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}let tw=class{constructor(e,n,r){this.nodes=e,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=`
606
+ `),e>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let i=1;i<e;i++)this.out+=n+`
607
+ `}this.closed=null}}getMark(e){let n=this.marks[e];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${e}\` not supported by Markdown renderer`);n=rU}return n}wrapBlock(e,n,r,i){let s=this.delim;this.write(n??e),this.delim+=e,i(),this.delim=s,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
608
+ `)}write(e){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),e&&(this.out+=e)}closeBlock(e){this.closed=e}text(e,n=!0){let r=e.split(`
609
+ `);for(let i=0;i<r.length;i++)this.write(),!n&&r[i][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(r[i],this.atBlockStart):r[i],i!=r.length-1&&(this.out+=`
610
+ `)}render(e,n,r){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+e.type.name+"` not supported by Markdown renderer");e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}}renderContent(e){e.forEach((n,r,i)=>this.render(n,e,i))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],i="",s=(o,a,l)=>{let u=o?o.marks:[];o&&o.type.name===this.options.hardBreakNodeName&&(u=u.filter(m=>{if(l+1==e.childCount)return!1;let g=e.child(l+1);return m.isInSet(g.marks)&&(!g.isText||/\S/.test(g.text))}));let c=i;if(i="",o&&o.isText&&u.some(m=>{let g=this.getMark(m.type.name);return g&&g.expelEnclosingWhitespace&&!m.isInSet(r)})){let[m,g,y]=/^(\s*)(.*)$/m.exec(o.text);g&&(c+=g,o=y?o.withText(y):null,o||(u=r))}if(o&&o.isText&&u.some(m=>{let g=this.getMark(m.type.name);return g&&g.expelEnclosingWhitespace&&!this.isMarkAhead(e,l+1,m)})){let[m,g,y]=/^(.*?)(\s*)$/m.exec(o.text);y&&(i=y,o=g?o.withText(g):null,o||(u=r))}let d=u.length?u[u.length-1]:null,h=d&&this.getMark(d.type.name).escape===!1,f=u.length-(h?1:0);e:for(let m=0;m<f;m++){let g=u[m];if(!this.getMark(g.type.name).mixable)break;for(let y=0;y<r.length;y++){let x=r[y];if(!this.getMark(x.type.name).mixable)break;if(g.eq(x)){m>y?u=u.slice(0,y).concat(g).concat(u.slice(y,m)).concat(u.slice(m+1,f)):y>m&&(u=u.slice(0,m).concat(u.slice(m+1,y)).concat(g).concat(u.slice(y,f)));continue e}}}let p=0;for(;p<Math.min(r.length,f)&&u[p].eq(r[p]);)++p;for(;p<r.length;)this.text(this.markString(r.pop(),!1,e,l),!1);if(c&&this.text(c),o){for(;r.length<f;){let m=u[r.length];r.push(m),this.text(this.markString(m,!0,e,l),!1),this.atBlockStart=!1}h&&o.isText?this.text(this.markString(d,!0,e,l)+o.text+this.markString(d,!1,e,l+1),!1):this.render(o,e,l),this.atBlockStart=!1}o!=null&&o.isText&&o.nodeSize>0&&(this.atBlockStart=!1)};e.forEach(s),s(null,0,e.childCount),this.atBlockStart=!1}renderList(e,n,r){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let i=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,s=this.inTightList;this.inTightList=i,e.forEach((o,a,l)=>{l&&i&&this.flushClose(1),this.wrapBlock(n,r(l),e,()=>this.render(o,e,l))}),this.inTightList=s}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1<e.length&&e[i-1].match(/\w/)&&e[i+1].match(/\w/)?r:"\\"+r),n&&(e=e.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let n=e.indexOf('"')==-1?'""':e.indexOf("'")==-1?"''":"()";return n[0]+e+n[1]}repeat(e,n){let r="";for(let i=0;i<n;i++)r+=e;return r}markString(e,n,r,i){let s=this.getMark(e.type.name),o=n?s.open:s.close;return typeof o=="string"?o:o(this,e,r,i)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(e,n,r){for(;;n++){if(n>=e.childCount)return!1;let i=e.child(n);if(i.type.name!=this.options.hardBreakNodeName)return r.isInSet(i.marks);n++}}};var Vh,V4;function oU(){if(V4)return Vh;V4=1;var t=!0,e=!1,n=!1;Vh=function(m,g){g&&(t=!g.enabled,e=!!g.label,n=!!g.labelAfter),m.core.ruler.after("inline","github-task-lists",function(y){for(var x=y.tokens,k=2;k<x.length;k++)s(x,k)&&(o(x[k],y.Token),r(x[k-2],"class","task-list-item"+(t?"":" enabled")),r(x[i(x,k-2)],"class","contains-task-list"))})};function r(m,g,y){var x=m.attrIndex(g),k=[g,y];x<0?m.attrPush(k):m.attrs[x]=k}function i(m,g){for(var y=m[g].level-1,x=g-1;x>=0;x--)if(m[x].level===y)return x;return-1}function s(m,g){return d(m[g])&&h(m[g-1])&&f(m[g-2])&&p(m[g])}function o(m,g){if(m.children.unshift(a(m,g)),m.children[1].content=m.children[1].content.slice(3),m.content=m.content.slice(3),e)if(n){m.children.pop();var y="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);m.children[0].content=m.children[0].content.slice(0,-1)+' id="'+y+'">',m.children.push(c(m.content,y,g))}else m.children.unshift(l(g)),m.children.push(u(g))}function a(m,g){var y=new g("html_inline","",0),x=t?' disabled="" ':"";return m.content.indexOf("[ ] ")===0?y.content='<input class="task-list-item-checkbox"'+x+'type="checkbox">':(m.content.indexOf("[x] ")===0||m.content.indexOf("[X] ")===0)&&(y.content='<input class="task-list-item-checkbox" checked=""'+x+'type="checkbox">'),y}function l(m){var g=new m("html_inline","",0);return g.content="<label>",g}function u(m){var g=new m("html_inline","",0);return g.content="</label>",g}function c(m,g,y){var x=new y("html_inline","",0);return x.content='<label class="task-list-item-label" for="'+g+'">'+m+"</label>",x.attrs=[{for:g}],x}function d(m){return m.type==="inline"}function h(m){return m.type==="paragraph_open"}function f(m){return m.type==="list_item_open"}function p(m){return m.content.indexOf("[ ] ")===0||m.content.indexOf("[x] ")===0||m.content.indexOf("[X] ")===0}return Vh}var aU=oU();const lU=A3(aU);var uU=Object.defineProperty,cU=(t,e,n)=>e in t?uU(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,h0=(t,e,n)=>(cU(t,typeof e!="symbol"?e+"":e,n),n);const dU=Se.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:t=>t.getAttribute("data-tight")==="true"||!t.querySelector("p"),renderHTML:t=>({class:t.tight?this.options.tightClass:null,"data-tight":t.tight?"true":null})}}}]},addCommands(){var t=this;return{toggleTight:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;function s(o){if(!r.isActive(o))return!1;const a=r.getAttributes(o);return i.updateAttributes(o,{tight:e??!(a!=null&&a.tight)})}return t.options.listTypes.some(o=>s(o))}}}}}),W4=_n();function nw(t,e){return W4.inline.State.prototype.scanDelims.call({src:t,posMax:t.length}),new W4.inline.State(t,null,null,[]).scanDelims(e,!0)}function rw(t,e,n,r){let i=t.substring(0,n)+t.substring(n+e.length);return i=i.substring(0,n+r)+e+i.substring(n+r),i}function hU(t,e,n,r){let i=n,s=t;for(;i<r&&!nw(s,i).can_open;)s=rw(s,e,i,1),i++;return{text:s,from:i,to:r}}function fU(t,e,n,r){let i=r,s=t;for(;i>n&&!nw(s,i).can_close;)s=rw(s,e,i,-1),i--;return{text:s,from:n,to:i}}function pU(t,e,n,r){let i={text:t,from:n,to:r};return i=hU(i.text,e,i.from,i.to),i=fU(i.text,e,i.from,i.to),i.to-i.from<e.length+1&&(i.text=i.text.substring(0,i.from)+i.text.substring(i.to+e.length)),i.text}class mU extends tw{constructor(e,n,r){super(e,n,r??{}),h0(this,"inTable",!1),this.inlines=[]}render(e,n,r){super.render(e,n,r);const i=this.inlines[this.inlines.length-1];if(i!=null&&i.start&&i!==null&&i!==void 0&&i.end){const{delimiter:s,start:o,end:a}=this.normalizeInline(i);this.out=pU(this.out,s,o,a),this.inlines.pop()}}markString(e,n,r,i){const s=this.marks[e.type.name];if(s.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:s.open});else{const o=this.inlines.pop();this.inlines.push({...o,end:this.out.length})}return super.markString(e,n,r,i)}normalizeInline(e){let{start:n,end:r}=e;for(;this.out.charAt(n).match(/\s/);)n++;return{...e,start:n}}}const iw=gn.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(t,e){var n,r;return this.editor.storage.markdown.options.html?(n=(r=G4(e))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${e.type.name}" mark is only available in html mode`),"")},close(t,e){var n,r;return this.editor.storage.markdown.options.html&&(n=(r=G4(e))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function G4(t){const e=t.type.schema,n=e.text(" ",[t]),i=Tl(P.from(n),e).match(/^(<.*?>) (<\/.*?>)$/);return i?[i[1],i[2]]:null}function R1(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function gU(t){return t==null?void 0:t.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function bU(t){const e=t.parentElement,n=e.cloneNode();for(;e.firstChild&&e.firstChild!==t;)n.appendChild(e.firstChild);n.childNodes.length>0&&e.parentElement.insertBefore(n,e),e.parentElement.insertBefore(t,e),e.childNodes.length===0&&e.remove()}function yU(t){const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}const md=Oe.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(t,e,n){this.editor.storage.markdown.options.html?t.write(vU(e,n)):(console.warn(`Tiptap Markdown: "${e.type.name}" node is only available in html mode`),t.write(`[${e.type.name}]`)),e.isBlock&&t.closeBlock(e)},parse:{}}}}});function vU(t,e){const n=t.type.schema,r=Tl(P.from(t),n);return t.isBlock&&(e instanceof P||e.type.name===n.topNodeType.name)?xU(r):r}function xU(t){const n=R1(t).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
611
+ ${n.innerHTML}
612
+ `:`
613
+ `,n.outerHTML}const wU=Oe.create({name:"blockquote"}),kU=wU.extend({addStorage(){return{markdown:{serialize:Vr.nodes.blockquote,parse:{}}}}}),EU=Oe.create({name:"bulletList"}),sw=EU.extend({addStorage(){return{markdown:{serialize(t,e){return t.renderList(e," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),SU=Oe.create({name:"codeBlock"}),CU=SU.extend({addStorage(){return{markdown:{serialize(t,e){t.write("```"+(e.attrs.language||"")+`
614
+ `),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},parse:{setup(t){var e;t.set({langPrefix:(e=this.options.languageClassPrefix)!==null&&e!==void 0?e:"language-"})},updateDOM(t){t.innerHTML=t.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),_U=Oe.create({name:"hardBreak"}),ow=_U.extend({addStorage(){return{markdown:{serialize(t,e,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=e.type){t.write(t.inTable?md.storage.markdown.serialize.call(this,t,e,n):`\\
615
+ `);return}},parse:{}}}}}),AU=Oe.create({name:"heading"}),TU=AU.extend({addStorage(){return{markdown:{serialize:Vr.nodes.heading,parse:{}}}}}),MU=Oe.create({name:"horizontalRule"}),NU=MU.extend({addStorage(){return{markdown:{serialize:Vr.nodes.horizontal_rule,parse:{}}}}}),DU=Oe.create({name:"image"}),OU=DU.extend({addStorage(){return{markdown:{serialize:Vr.nodes.image,parse:{}}}}}),RU=Oe.create({name:"listItem"}),IU=RU.extend({addStorage(){return{markdown:{serialize:Vr.nodes.list_item,parse:{}}}}}),LU=Oe.create({name:"orderedList"});function zU(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}const BU=LU.extend({addStorage(){return{markdown:{serialize(t,e,n,r){const i=e.attrs.start||1,s=String(i+e.childCount-1).length,o=t.repeat(" ",s+2),l=zU(e,n,r)%2?") ":". ";t.renderList(e,o,u=>{const c=String(i+u);return t.repeat(" ",s-c.length)+c+l})},parse:{}}}}}),FU=Oe.create({name:"paragraph"}),PU=FU.extend({addStorage(){return{markdown:{serialize:Vr.nodes.paragraph,parse:{}}}}});function Wh(t){var e,n;return(e=t==null||(n=t.content)===null||n===void 0?void 0:n.content)!==null&&e!==void 0?e:[]}const $U=Oe.create({name:"table"}),HU=$U.extend({addStorage(){return{markdown:{serialize(t,e,n){if(!UU(e)){md.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,i,s)=>{if(t.write("| "),r.forEach((o,a,l)=>{l&&t.write(" | ");const u=o.firstChild;u.textContent.trim()&&t.renderInline(u)}),t.write(" |"),t.ensureNewLine(),!s){const o=Array.from({length:r.childCount}).map(()=>"---").join(" | ");t.write(`| ${o} |`),t.ensureNewLine()}}),t.closeBlock(e),t.inTable=!1},parse:{}}}}});function K4(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function UU(t){const e=Wh(t),n=e[0],r=e.slice(1);return!(Wh(n).some(i=>i.type.name!=="tableHeader"||K4(i)||i.childCount>1)||r.some(i=>Wh(i).some(s=>s.type.name==="tableHeader"||K4(s)||s.childCount>1)))}const qU=Oe.create({name:"taskItem"}),jU=qU.extend({addStorage(){return{markdown:{serialize(t,e){const n=e.attrs.checked?"[x]":"[ ]";t.write(`${n} `),t.renderContent(e)},parse:{updateDOM(t){[...t.querySelectorAll(".task-list-item")].forEach(e=>{const n=e.querySelector("input");e.setAttribute("data-type","taskItem"),n&&(e.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),VU=Oe.create({name:"taskList"}),WU=VU.extend({addStorage(){return{markdown:{serialize:sw.storage.markdown.serialize,parse:{setup(t){t.use(lU)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),GU=Oe.create({name:"text"}),KU=GU.extend({addStorage(){return{markdown:{serialize(t,e){t.text(gU(e.text))},parse:{}}}}}),YU=gn.create({name:"bold"}),ZU=YU.extend({addStorage(){return{markdown:{serialize:Vr.marks.strong,parse:{}}}}}),JU=gn.create({name:"code"}),XU=JU.extend({addStorage(){return{markdown:{serialize:Vr.marks.code,parse:{}}}}}),QU=gn.create({name:"italic"}),eq=QU.extend({addStorage(){return{markdown:{serialize:Vr.marks.em,parse:{}}}}}),tq=gn.create({name:"link"}),nq=tq.extend({addStorage(){return{markdown:{serialize:Vr.marks.link,parse:{}}}}}),rq=gn.create({name:"strike"}),iq=rq.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),sq=[kU,sw,CU,ow,TU,NU,md,OU,IU,BU,PU,HU,jU,WU,KU,ZU,XU,iw,eq,nq,iq];function f0(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,i=(n=sq.find(s=>s.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}class oq{constructor(e){h0(this,"editor",null),this.editor=e}serialize(e){const n=new mU(this.nodes,this.marks,{hardBreakNodeName:ow.name});return n.renderContent(e),n.out}get nodes(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(md)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&e!==void 0?e:[])}}get marks(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(iw)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&e!==void 0?e:[])}}serializeNode(e){var n;return(n=f0(e))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:e.options})}serializeMark(e){var n;const r=(n=f0(e))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:e.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:e.options}):r.close}:null}}class aq{constructor(e,n){h0(this,"editor",null),h0(this,"md",null);let{html:r,linkify:i,breaks:s}=n;this.editor=e,this.md=this.withPatchedRenderer(_n({html:r,linkify:i,breaks:s}))}parse(e){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e=="string"){this.editor.extensionManager.extensions.forEach(s=>{var o;return(o=f0(s))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.setup)===null||o===void 0?void 0:o.call({editor:this.editor,options:s.options},this.md)});const r=this.md.render(e),i=R1(r);return this.editor.extensionManager.extensions.forEach(s=>{var o;return(o=f0(s))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.updateDOM)===null||o===void 0?void 0:o.call({editor:this.editor,options:s.options},i)}),this.normalizeDOM(i,{inline:n,content:e}),i.innerHTML}return e}normalizeDOM(e,n){let{inline:r,content:i}=n;return this.normalizeBlocks(e),e.querySelectorAll("*").forEach(s=>{var o;((o=s.nextSibling)===null||o===void 0?void 0:o.nodeType)===Node.TEXT_NODE&&!s.closest("pre")&&(s.nextSibling.textContent=s.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(e,i),e}normalizeBlocks(e){const r=Object.values(this.editor.schema.nodes).filter(i=>i.isBlock).map(i=>{var s;return(s=i.spec.parseDOM)===null||s===void 0?void 0:s.map(o=>o.tag)}).flat().filter(Boolean).join(",");r&&[...e.querySelectorAll(r)].forEach(i=>{i.parentElement.matches("p")&&bU(i)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,s,o,a;const l=e.firstElementChild,{nextElementSibling:u}=l,c=(i=(s=n.match(/^\s+/))===null||s===void 0?void 0:s[0])!==null&&i!==void 0?i:"",d=u?"":(o=(a=n.match(/\s+$/))===null||a===void 0?void 0:a[0])!==null&&o!==void 0?o:"";if(n.match(/^\n\n/)){l.innerHTML=`${l.innerHTML}${d}`;return}yU(l),e.innerHTML=`${c}${e.innerHTML}${d}`}}withPatchedRenderer(e){const n=r=>function(){const i=r(...arguments);return i===`
616
+ `?i:i[i.length-1]===`
617
+ `?i.slice(0,-1):i};return e.renderer.rules.hardbreak=n(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=n(e.renderer.rules.softbreak),e.renderer.rules.fence=n(e.renderer.rules.fence),e.renderer.rules.code_block=n(e.renderer.rules.code_block),e.renderer.renderToken=n(e.renderer.renderToken.bind(e.renderer)),e}}const lq=Se.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new _e({key:new Ae("markdownClipboard"),props:{clipboardTextParser:(t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return To.fromSchema(this.editor.schema).parseSlice(R1(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),uq=Se.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const t=P5.Commands.config.addCommands();return{setContent:(e,n)=>r=>t.setContent(r.editor.storage.markdown.parser.parse(e),n)(r),insertContentAt:(e,n,r)=>i=>t.insertContentAt(e,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new aq(this.editor,this.options),serializer:new oq(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[dU.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),lq.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});function cq(t,e){const n=t.esc(e.attrs.alt||""),r=e.attrs.src.replace(/[()]/g,"\\$&"),i=e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"";t.write(`![${n}](${r}${i})`),t.closeBlock(e)}const dq=500;function us(t,e){const n=[];let r=[],i="",s=!1,o=t.charCodeAt(0)===65279?1:0;const a=()=>{r.push(i),i=""},l=()=>{a(),n.push(r),r=[]};for(;o<t.length;){const u=t[o];if(s){if(u==='"'){if(t[o+1]==='"'){i+='"',o+=2;continue}s=!1,o++;continue}i+=u,o++;continue}if(u==='"'&&i===""){s=!0,o++;continue}if(u===e){a(),o++;continue}if(u==="\r"){t[o+1]===`
618
+ `&&o++,l(),o++;continue}if(u===`
619
+ `){l(),o++;continue}i+=u,o++}return(i!==""||r.length>0)&&l(),n.filter(u=>u.some(c=>c.trim()!==""))}function Dp(t){return t.length>0&&t.every(e=>e.length===t[0].length)}function aw(t){const e=[" ",",",";"];for(const n of e){if(!t.includes(n))continue;const r=us(t,n);if(r.length>=1&&r[0].length>=2&&Dp(r))return n}return null}const hq=/^[+-]?[$€£]?\d[\d,]*(\.\d+)?%?$/;function Op(t){return hq.test(t.trim())}function QW(t){const e=t[0]??[],n=[];return e.forEach((r,i)=>{const s=r.split(":").map(f=>f.trim()),o=s[0],a=new Set(s.slice(1).map(f=>f.toLowerCase())),l=a.has("key"),u=a.has("number")?f=>!Op(f):a.has("date")?f=>Number.isNaN(Date.parse(f)):null;if(!l&&!u)return;const c=new Set;let d=null,h=null;for(let f=1;f<t.length;f++){const p=(t[f][i]??"").trim();if(p){if(l){const m=p.toLowerCase();c.has(m)?d?d.count+=1:d={column:o,kind:"duplicate-key",value:p,row:f,count:1}:c.add(m)}u!=null&&u(p)&&(h?h.count+=1:h={column:o,kind:a.has("number")?"not-a-number":"not-a-date",value:p,row:f,count:1})}}d&&n.push(d),h&&n.push(h)}),n}function eG(t){const e=t.count>1?` (+${t.count-1} more)`:"",n=`row ${t.row}`;if(t.kind==="duplicate-key")return`"${t.column}" is a :key column but "${t.value}" repeats at ${n}${e}.`;const r=t.kind==="not-a-number"?"a number":"a date";return`"${t.column}" expects ${r} but ${n} has "${t.value}"${e}.`}function I1(t){if(t.length<2)return!1;const e=t[0];return e.length===0||e.some(i=>i.trim()==="")||e.some(Op)?!1:t.slice(1).some(i=>i.some(Op))?!0:new Set(e.map(i=>i.trim().toLowerCase())).size===e.length}function fq(t){return t.trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|").replace(/\r\n|\r|\n/g,"<br>")}function lw(t,e={}){if(t.length===0)return"";const n=t.reduce((u,c)=>Math.max(u,c.length),0);if(n===0)return"";const r=t.map(u=>{const c=u.map(fq);for(;c.length<n;)c.push("");return c}),i=e.hasHeader??I1(t),s=i?r[0]:Array.from({length:n},(u,c)=>`Column ${c+1}`),o=i?r.slice(1):r,a=u=>`| ${u.join(" | ")} |`,l=`| ${Array.from({length:n},()=>"---").join(" | ")} |`;return[a(s),l,...o.map(a)].join(`
620
+ `)}function pq(t){return/[",\n\r]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function tG(t){return t.map(e=>e.map(pq).join(",")).join(`
621
+ `)}const uw=200;function mq(t){const e=t.replace(/\s+$/,"");if(!e||!e.includes(`
622
+ `))return null;if(e.includes(" ")){const r=us(e," ");return r.length>=2&&r[0].length>=2&&Dp(r)?{delimiter:" ",rows:r}:null}const n=[",",";"];for(const r of n){if(!e.includes(r))continue;const i=us(e,r);if(i.length>=3&&i[0].length>=2&&Dp(i)&&i.every(s=>s.every(o=>o.length<=uw)))return{delimiter:r,rows:i}}return null}function nG(t){const e=t.replace(/\s+$/,"");if(!e||e.includes(`
623
+ `)||e.includes("\r"))return null;if(e.includes(" ")){const n=us(e," ");return n.length===1&&n[0].length>=2?{delimiter:" ",rows:n}:null}if(e.includes(";")&&!e.includes(",")){const n=us(e,";");if(n.length===1&&n[0].length>=2&&n[0].every(r=>r.length<=uw))return{delimiter:";",rows:n}}return null}const gq=10*1024*1024;async function bq(t){if(t.size>gq)return{ok:!1,error:"too-large"};let e;try{e=await t.text()}catch{return{ok:!1,error:"unreadable"}}const n=/\.tsv$/i.test(t.name)?" ":aw(e)??",",r=us(e,n);return r.length===0?{ok:!1,error:"empty"}:{ok:!0,text:e,delimiter:n,rows:r}}function yq(t,e){switch(t){case"too-large":return`That file is ${(e.size/(1024*1024)).toFixed(1)} MB — the limit for table import is 10 MB.`;case"unreadable":return"Couldn't read that file.";case"empty":return"No table rows found in that file."}}function vq(t){return us(t,",").filter(e=>!(e[0]??"").trimStart().startsWith("#")&&e.some(n=>n.trim()!==""))}function rG(t,e){const n=l=>l.map(u=>u.trim()).join("\0"),r=l=>{const u=vq(l);return{columns:(u[0]??[]).map(c=>c.split(":")[0].trim()),rows:u.slice(1)}},i=r(t),s=r(e),o=l=>{const u=new Map;for(const c of l){const d=n(c);u.set(d,(u.get(d)??0)+1)}return u},a=(l,u)=>l.map(c=>{const d=n(c),h=u.get(d)??0;return h<=0?!0:(u.set(d,h-1),!1)});return{past:{...i,changed:a(i.rows,o(s.rows))},current:{...s,changed:a(s.rows,o(i.rows))}}}const xq=/\[\[([^\]\n]*)$/,wq=/(?:^|\s)@([\w.@+-]*)$/;function kq(t){const e=xq.exec(t);if(e)return{kind:"wiki",query:e[1],length:e[0].length};const n=wq.exec(t);if(n){const r=/^\s/.test(n[0])?1:0;return{kind:"mention",query:n[1],length:n[0].length-r}}return null}function cw(t){const e=t.email.toLowerCase();return[e,e.split("@")[0],(t.name||"").toLowerCase()].filter(Boolean)}function Eq(t,e,n=8){const r=e.trim().toLowerCase();return t.filter(i=>!r||cw(i).some(s=>s.includes(r))).slice(0,n)}function Sq(t,e){const n=e.trim().toLowerCase();return n?t.some(r=>r.email.toLowerCase()===n)?!0:t.filter(r=>cw(r).includes(n)).length===1:!1}const Y4=/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,Ls=new Map;function Cq(t,e){return`${t??""}::${e.toLowerCase()}`}function _q(t){if(t===void 0){Ls.clear();return}const e=`${t}::`;for(const n of Ls.keys())n.startsWith(e)&&Ls.delete(n)}function Rp(t){const e=[];return t.descendants((n,r,i)=>{var a;if(!n.isText||!n.text||(i==null?void 0:i.type.name)==="codeBlock"||n.marks.some(l=>l.type.name==="code"))return;const s=n.text;let o;for(Y4.lastIndex=0;(o=Y4.exec(s))!==null;){const l=o[0],u=o[1].trim(),c=o[2]!==void 0,d=((a=o[2])==null?void 0:a.trim())||u,h=r+o.index,f=h+l.length,p=c?h+l.lastIndexOf("|")+1:h+2,m=f-2;e.push({start:h,labelStart:p,labelEnd:m,end:f,target:u,displayText:d,hasAlias:c})}}),e}function Aq(t,e,n){const r=[];for(const i of Rp(t)){const{start:s,labelStart:o,labelEnd:a,end:l,target:u,displayText:c}=i;{const d=Cq(n,u),h=Ls.get(d),f=(h==null?void 0:h.exists)??!e,p=h==null?void 0:h.id,g={class:`wiki-link ${f?"wiki-link-exists":"wiki-link-broken"}`,"data-wiki-title":u,"data-wiki-id":p||"","data-wiki-display":c};f||(g.title=`"${c}" not found in this nest`),r.push(Ge.inline(s,o,{class:"wiki-bracket-hidden"})),r.push(Ge.inline(o,a,g)),r.push(Ge.inline(a,l,{class:"wiki-bracket-hidden"})),e&&!Ls.has(d)&&(Ls.set(d,{exists:!1}),e(u).then(y=>{Ls.set(d,y)}).catch(()=>{}))}}return r}function Tq(t,e){for(const n of t){if(e>n.start&&e<n.labelStart)return n.start;if(e>n.labelEnd&&e<n.end)return n.end}return null}const Mq=Se.create({name:"wikiLink",addOptions(){return{onWikiLinkClick:void 0,checkExists:void 0,nestId:void 0}},addProseMirrorPlugins(){const{onWikiLinkClick:t,checkExists:e,nestId:n}=this.options;return[new _e({key:new Ae("wikiLink"),appendTransaction(r,i,s){const o=s.selection;if(!o.empty)return null;const a=!i.selection.eq(o),l=r.some(d=>d.docChanged);if(!a&&!l)return null;const u=Rp(s.doc),c=Tq(u,o.from);return c===null?null:s.tr.setSelection(le.create(s.doc,c))},props:{decorations(r){return Le.create(r.doc,Aq(r.doc,e,n))},handleClick(r,i,s){const o=s.target;if(!o.classList.contains("wiki-link"))return!1;const a=o.getAttribute("data-wiki-title"),l=o.getAttribute("data-wiki-id")||null,u=o.getAttribute("data-wiki-display");return a&&t?(t(a,l,u),!0):!1},handleKeyDown(r,i){if(i.key!=="Backspace"&&i.key!=="Delete")return!1;const{state:s}=r,o=s.selection;if(!o.empty)return!1;const a=o.from,l=Rp(s.doc);for(const u of l){const c=u.displayText;if(!(i.key==="Backspace"?a>u.start&&a<=u.end:a>=u.start&&a<u.end))continue;const f=`[[${i.key==="Backspace"?c.slice(0,-1):c.slice(1)}`,p=s.tr.insertText(f,u.start,u.end),m=u.start+f.length;return p.setSelection(le.create(p.doc,m)),r.dispatch(p.scrollIntoView()),!0}return!1}}})]}});var Gh,Z4;function Nq(){if(Z4)return Gh;Z4=1;function t(N){return N instanceof Map?N.clear=N.delete=N.set=function(){throw new Error("map is read-only")}:N instanceof Set&&(N.add=N.clear=N.delete=function(){throw new Error("set is read-only")}),Object.freeze(N),Object.getOwnPropertyNames(N).forEach($=>{const J=N[$],pe=typeof J;(pe==="object"||pe==="function")&&!Object.isFrozen(J)&&t(J)}),N}class e{constructor($){$.data===void 0&&($.data={}),this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(N){return N.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function r(N,...$){const J=Object.create(null);for(const pe in N)J[pe]=N[pe];return $.forEach(function(pe){for(const at in pe)J[at]=pe[at]}),J}const i="</span>",s=N=>!!N.scope,o=(N,{prefix:$})=>{if(N.startsWith("language:"))return N.replace("language:","language-");if(N.includes(".")){const J=N.split(".");return[`${$}${J.shift()}`,...J.map((pe,at)=>`${pe}${"_".repeat(at+1)}`)].join(" ")}return`${$}${N}`};class a{constructor($,J){this.buffer="",this.classPrefix=J.classPrefix,$.walk(this)}addText($){this.buffer+=n($)}openNode($){if(!s($))return;const J=o($.scope,{prefix:this.classPrefix});this.span(J)}closeNode($){s($)&&(this.buffer+=i)}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}const l=(N={})=>{const $={children:[]};return Object.assign($,N),$};class u{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add($){this.top.children.push($)}openNode($){const J=l({scope:$});this.add(J),this.stack.push(J)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk($){return this.constructor._walk($,this.rootNode)}static _walk($,J){return typeof J=="string"?$.addText(J):J.children&&($.openNode(J),J.children.forEach(pe=>this._walk($,pe)),$.closeNode(J)),$}static _collapse($){typeof $!="string"&&$.children&&($.children.every(J=>typeof J=="string")?$.children=[$.children.join("")]:$.children.forEach(J=>{u._collapse(J)}))}}class c extends u{constructor($){super(),this.options=$}addText($){$!==""&&this.add($)}startScope($){this.openNode($)}endScope(){this.closeNode()}__addSublanguage($,J){const pe=$.root;J&&(pe.scope=`language:${J}`),this.add(pe)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(N){return N?typeof N=="string"?N:N.source:null}function h(N){return m("(?=",N,")")}function f(N){return m("(?:",N,")*")}function p(N){return m("(?:",N,")?")}function m(...N){return N.map(J=>d(J)).join("")}function g(N){const $=N[N.length-1];return typeof $=="object"&&$.constructor===Object?(N.splice(N.length-1,1),$):{}}function y(...N){return"("+(g(N).capture?"":"?:")+N.map(pe=>d(pe)).join("|")+")"}function x(N){return new RegExp(N.toString()+"|").exec("").length-1}function k(N,$){const J=N&&N.exec($);return J&&J.index===0}const C=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function _(N,{joinWith:$}){let J=0;return N.map(pe=>{J+=1;const at=J;let pt=d(pe),ae="";for(;pt.length>0;){const X=C.exec(pt);if(!X){ae+=pt;break}ae+=pt.substring(0,X.index),pt=pt.substring(X.index+X[0].length),X[0][0]==="\\"&&X[1]?ae+="\\"+String(Number(X[1])+at):(ae+=X[0],X[0]==="("&&J++)}return ae}).map(pe=>`(${pe})`).join($)}const T=/\b\B/,D="[a-zA-Z]\\w*",I="[a-zA-Z_]\\w*",L="\\b\\d+(\\.\\d+)?",G="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ie="\\b(0b[01]+)",oe="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",be=(N={})=>{const $=/^#![ ]*\//;return N.binary&&(N.begin=m($,/.*\b/,N.binary,/\b.*/)),r({scope:"meta",begin:$,end:/$/,relevance:0,"on:begin":(J,pe)=>{J.index!==0&&pe.ignoreMatch()}},N)},Y={begin:"\\\\[\\s\\S]",relevance:0},te={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Y]},Te={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Y]},St={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ke=function(N,$,J={}){const pe=r({scope:"comment",begin:N,end:$,contains:[]},J);pe.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const at=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return pe.contains.push({begin:m(/[ ]+/,"(",at,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),pe},ft=ke("//","$"),et=ke("/\\*","\\*/"),Ze=ke("#","$"),tt={scope:"number",begin:L,relevance:0},it={scope:"number",begin:G,relevance:0},ir={scope:"number",begin:ie,relevance:0},Fn={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Y,{begin:/\[/,end:/\]/,relevance:0,contains:[Y]}]},bn={scope:"title",begin:D,relevance:0},yn={scope:"title",begin:I,relevance:0},sr={begin:"\\.\\s*"+I,relevance:0};var An=Object.freeze({__proto__:null,APOS_STRING_MODE:te,BACKSLASH_ESCAPE:Y,BINARY_NUMBER_MODE:ir,BINARY_NUMBER_RE:ie,COMMENT:ke,C_BLOCK_COMMENT_MODE:et,C_LINE_COMMENT_MODE:ft,C_NUMBER_MODE:it,C_NUMBER_RE:G,END_SAME_AS_BEGIN:function(N){return Object.assign(N,{"on:begin":($,J)=>{J.data._beginMatch=$[1]},"on:end":($,J)=>{J.data._beginMatch!==$[1]&&J.ignoreMatch()}})},HASH_COMMENT_MODE:Ze,IDENT_RE:D,MATCH_NOTHING_RE:T,METHOD_GUARD:sr,NUMBER_MODE:tt,NUMBER_RE:L,PHRASAL_WORDS_MODE:St,QUOTE_STRING_MODE:Te,REGEXP_MODE:Fn,RE_STARTERS_RE:oe,SHEBANG:be,TITLE_MODE:bn,UNDERSCORE_IDENT_RE:I,UNDERSCORE_TITLE_MODE:yn});function ki(N,$){N.input[N.index-1]==="."&&$.ignoreMatch()}function xr(N,$){N.className!==void 0&&(N.scope=N.className,delete N.className)}function wr(N,$){$&&N.beginKeywords&&(N.begin="\\b("+N.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",N.__beforeBegin=ki,N.keywords=N.keywords||N.beginKeywords,delete N.beginKeywords,N.relevance===void 0&&(N.relevance=0))}function $n(N,$){Array.isArray(N.illegal)&&(N.illegal=y(...N.illegal))}function ms(N,$){if(N.match){if(N.begin||N.end)throw new Error("begin & end are not supported with match");N.begin=N.match,delete N.match}}function Re(N,$){N.relevance===void 0&&(N.relevance=1)}const Ct=(N,$)=>{if(!N.beforeMatch)return;if(N.starts)throw new Error("beforeMatch cannot be used with starts");const J=Object.assign({},N);Object.keys(N).forEach(pe=>{delete N[pe]}),N.keywords=J.keywords,N.begin=m(J.beforeMatch,h(J.begin)),N.starts={relevance:0,contains:[Object.assign(J,{endsParent:!0})]},N.relevance=0,delete J.beforeMatch},Tn=["of","and","for","in","not","or","if","then","parent","list","value"],Hn="keyword";function or(N,$,J=Hn){const pe=Object.create(null);return typeof N=="string"?at(J,N.split(" ")):Array.isArray(N)?at(J,N):Object.keys(N).forEach(function(pt){Object.assign(pe,or(N[pt],$,pt))}),pe;function at(pt,ae){$&&(ae=ae.map(X=>X.toLowerCase())),ae.forEach(function(X){const me=X.split("|");pe[me[0]]=[pt,Un(me[0],me[1])]})}}function Un(N,$){return $?Number($):gs(N)?0:1}function gs(N){return Tn.includes(N.toLowerCase())}const Wr={},qn=N=>{console.error(N)},Gr=(N,...$)=>{console.log(`WARN: ${N}`,...$)},ar=(N,$)=>{Wr[`${N}/${$}`]||(console.log(`Deprecated as of ${N}. ${$}`),Wr[`${N}/${$}`]=!0)},Ei=new Error;function kr(N,$,{key:J}){let pe=0;const at=N[J],pt={},ae={};for(let X=1;X<=$.length;X++)ae[X+pe]=at[X],pt[X+pe]=!0,pe+=x($[X-1]);N[J]=ae,N[J]._emit=pt,N[J]._multi=!0}function Si(N){if(Array.isArray(N.begin)){if(N.skip||N.excludeBegin||N.returnBegin)throw qn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ei;if(typeof N.beginScope!="object"||N.beginScope===null)throw qn("beginScope must be object"),Ei;kr(N,N.begin,{key:"beginScope"}),N.begin=_(N.begin,{joinWith:""})}}function gd(N){if(Array.isArray(N.end)){if(N.skip||N.excludeEnd||N.returnEnd)throw qn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ei;if(typeof N.endScope!="object"||N.endScope===null)throw qn("endScope must be object"),Ei;kr(N,N.end,{key:"endScope"}),N.end=_(N.end,{joinWith:""})}}function Pl(N){N.scope&&typeof N.scope=="object"&&N.scope!==null&&(N.beginScope=N.scope,delete N.scope)}function bs(N){Pl(N),typeof N.beginScope=="string"&&(N.beginScope={_wrap:N.beginScope}),typeof N.endScope=="string"&&(N.endScope={_wrap:N.endScope}),Si(N),gd(N)}function lo(N){function $(ae,X){return new RegExp(d(ae),"m"+(N.case_insensitive?"i":"")+(N.unicodeRegex?"u":"")+(X?"g":""))}class J{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(X,me){me.position=this.position++,this.matchIndexes[this.matchAt]=me,this.regexes.push([me,X]),this.matchAt+=x(X)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const X=this.regexes.map(me=>me[1]);this.matcherRe=$(_(X,{joinWith:"|"}),!0),this.lastIndex=0}exec(X){this.matcherRe.lastIndex=this.lastIndex;const me=this.matcherRe.exec(X);if(!me)return null;const lt=me.findIndex((Ci,ha)=>ha>0&&Ci!==void 0),mt=this.matchIndexes[lt];return me.splice(0,lt),Object.assign(me,mt)}}class pe{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(X){if(this.multiRegexes[X])return this.multiRegexes[X];const me=new J;return this.rules.slice(X).forEach(([lt,mt])=>me.addRule(lt,mt)),me.compile(),this.multiRegexes[X]=me,me}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(X,me){this.rules.push([X,me]),me.type==="begin"&&this.count++}exec(X){const me=this.getMatcher(this.regexIndex);me.lastIndex=this.lastIndex;let lt=me.exec(X);if(this.resumingScanAtSamePosition()&&!(lt&&lt.index===this.lastIndex)){const mt=this.getMatcher(0);mt.lastIndex=this.lastIndex+1,lt=mt.exec(X)}return lt&&(this.regexIndex+=lt.position+1,this.regexIndex===this.count&&this.considerAll()),lt}}function at(ae){const X=new pe;return ae.contains.forEach(me=>X.addRule(me.begin,{rule:me,type:"begin"})),ae.terminatorEnd&&X.addRule(ae.terminatorEnd,{type:"end"}),ae.illegal&&X.addRule(ae.illegal,{type:"illegal"}),X}function pt(ae,X){const me=ae;if(ae.isCompiled)return me;[xr,ms,bs,Ct].forEach(mt=>mt(ae,X)),N.compilerExtensions.forEach(mt=>mt(ae,X)),ae.__beforeBegin=null,[wr,$n,Re].forEach(mt=>mt(ae,X)),ae.isCompiled=!0;let lt=null;return typeof ae.keywords=="object"&&ae.keywords.$pattern&&(ae.keywords=Object.assign({},ae.keywords),lt=ae.keywords.$pattern,delete ae.keywords.$pattern),lt=lt||/\w+/,ae.keywords&&(ae.keywords=or(ae.keywords,N.case_insensitive)),me.keywordPatternRe=$(lt,!0),X&&(ae.begin||(ae.begin=/\B|\b/),me.beginRe=$(me.begin),!ae.end&&!ae.endsWithParent&&(ae.end=/\B|\b/),ae.end&&(me.endRe=$(me.end)),me.terminatorEnd=d(me.end)||"",ae.endsWithParent&&X.terminatorEnd&&(me.terminatorEnd+=(ae.end?"|":"")+X.terminatorEnd)),ae.illegal&&(me.illegalRe=$(ae.illegal)),ae.contains||(ae.contains=[]),ae.contains=[].concat(...ae.contains.map(function(mt){return co(mt==="self"?ae:mt)})),ae.contains.forEach(function(mt){pt(mt,me)}),ae.starts&&pt(ae.starts,X),me.matcher=at(me),me}if(N.compilerExtensions||(N.compilerExtensions=[]),N.contains&&N.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return N.classNameAliases=r(N.classNameAliases||{}),pt(N)}function uo(N){return N?N.endsWithParent||uo(N.starts):!1}function co(N){return N.variants&&!N.cachedVariants&&(N.cachedVariants=N.variants.map(function($){return r(N,{variants:null},$)})),N.cachedVariants?N.cachedVariants:uo(N)?r(N,{starts:N.starts?r(N.starts):null}):Object.isFrozen(N)?r(N):N}var bd="11.11.1";class $l extends Error{constructor($,J){super($),this.name="HTMLInjectionError",this.html=J}}const ys=n,ho=r,fo=Symbol("nomatch"),F=7,Er=function(N){const $=Object.create(null),J=Object.create(null),pe=[];let at=!0;const pt="Could not find the language '{}', did you forget to load/include a language module?",ae={disableAutodetect:!0,name:"Plain text",contains:[]};let X={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function me(U){return X.noHighlightRe.test(U)}function lt(U){let se=U.className+" ";se+=U.parentNode?U.parentNode.className:"";const Ee=X.languageDetectRe.exec(se);if(Ee){const Pe=ne(Ee[1]);return Pe||(Gr(pt.replace("{}",Ee[1])),Gr("Falling back to no-highlight mode for this block.",U)),Pe?Ee[1]:"no-highlight"}return se.split(/\s+/).find(Pe=>me(Pe)||ne(Pe))}function mt(U,se,Ee){let Pe="",kt="";typeof se=="object"?(Pe=U,Ee=se.ignoreIllegals,kt=se.language):(ar("10.7.0","highlight(lang, code, ...args) has been deprecated."),ar("10.7.0",`Please use highlight(code, options) instead.
624
+ https://github.com/highlightjs/highlight.js/issues/2277`),kt=U,Pe=se),Ee===void 0&&(Ee=!0);const vn={code:Pe,language:kt};_t("before:highlight",vn);const Ai=vn.result?vn.result:Ci(vn.language,vn.code,Ee);return Ai.code=vn.code,_t("after:highlight",Ai),Ai}function Ci(U,se,Ee,Pe){const kt=Object.create(null);function vn(Q,de){return Q.keywords[de]}function Ai(){if(!we.keywords){Wt.addText(nt);return}let Q=0;we.keywordPatternRe.lastIndex=0;let de=we.keywordPatternRe.exec(nt),Me="";for(;de;){Me+=nt.substring(Q,de.index);const We=Cr.case_insensitive?de[0].toLowerCase():de[0],Jt=vn(we,We);if(Jt){const[Zr,Jw]=Jt;if(Wt.addText(Me),Me="",kt[We]=(kt[We]||0)+1,kt[We]<=F&&(Gl+=Jw),Zr.startsWith("_"))Me+=de[0];else{const Xw=Cr.classNameAliases[Zr]||Zr;Sr(de[0],Xw)}}else Me+=de[0];Q=we.keywordPatternRe.lastIndex,de=we.keywordPatternRe.exec(nt)}Me+=nt.substring(Q),Wt.addText(Me)}function Vl(){if(nt==="")return;let Q=null;if(typeof we.subLanguage=="string"){if(!$[we.subLanguage]){Wt.addText(nt);return}Q=Ci(we.subLanguage,nt,!0,H1[we.subLanguage]),H1[we.subLanguage]=Q._top}else Q=fa(nt,we.subLanguage.length?we.subLanguage:null);we.relevance>0&&(Gl+=Q.relevance),Wt.__addSublanguage(Q._emitter,Q.language)}function Mn(){we.subLanguage!=null?Vl():Ai(),nt=""}function Sr(Q,de){Q!==""&&(Wt.startScope(de),Wt.addText(Q),Wt.endScope())}function B1(Q,de){let Me=1;const We=de.length-1;for(;Me<=We;){if(!Q._emit[Me]){Me++;continue}const Jt=Cr.classNameAliases[Q[Me]]||Q[Me],Zr=de[Me];Jt?Sr(Zr,Jt):(nt=Zr,Ai(),nt=""),Me++}}function F1(Q,de){return Q.scope&&typeof Q.scope=="string"&&Wt.openNode(Cr.classNameAliases[Q.scope]||Q.scope),Q.beginScope&&(Q.beginScope._wrap?(Sr(nt,Cr.classNameAliases[Q.beginScope._wrap]||Q.beginScope._wrap),nt=""):Q.beginScope._multi&&(B1(Q.beginScope,de),nt="")),we=Object.create(Q,{parent:{value:we}}),we}function P1(Q,de,Me){let We=k(Q.endRe,Me);if(We){if(Q["on:end"]){const Jt=new e(Q);Q["on:end"](de,Jt),Jt.isMatchIgnored&&(We=!1)}if(We){for(;Q.endsParent&&Q.parent;)Q=Q.parent;return Q}}if(Q.endsWithParent)return P1(Q.parent,de,Me)}function Ww(Q){return we.matcher.regexIndex===0?(nt+=Q[0],1):(xd=!0,0)}function Gw(Q){const de=Q[0],Me=Q.rule,We=new e(Me),Jt=[Me.__beforeBegin,Me["on:begin"]];for(const Zr of Jt)if(Zr&&(Zr(Q,We),We.isMatchIgnored))return Ww(de);return Me.skip?nt+=de:(Me.excludeBegin&&(nt+=de),Mn(),!Me.returnBegin&&!Me.excludeBegin&&(nt=de)),F1(Me,Q),Me.returnBegin?0:de.length}function Kw(Q){const de=Q[0],Me=se.substring(Q.index),We=P1(we,Q,Me);if(!We)return fo;const Jt=we;we.endScope&&we.endScope._wrap?(Mn(),Sr(de,we.endScope._wrap)):we.endScope&&we.endScope._multi?(Mn(),B1(we.endScope,Q)):Jt.skip?nt+=de:(Jt.returnEnd||Jt.excludeEnd||(nt+=de),Mn(),Jt.excludeEnd&&(nt=de));do we.scope&&Wt.closeNode(),!we.skip&&!we.subLanguage&&(Gl+=we.relevance),we=we.parent;while(we!==We.parent);return We.starts&&F1(We.starts,Q),Jt.returnEnd?0:de.length}function Yw(){const Q=[];for(let de=we;de!==Cr;de=de.parent)de.scope&&Q.unshift(de.scope);Q.forEach(de=>Wt.openNode(de))}let Wl={};function $1(Q,de){const Me=de&&de[0];if(nt+=Q,Me==null)return Mn(),0;if(Wl.type==="begin"&&de.type==="end"&&Wl.index===de.index&&Me===""){if(nt+=se.slice(de.index,de.index+1),!at){const We=new Error(`0 width match regex (${U})`);throw We.languageName=U,We.badRule=Wl.rule,We}return 1}if(Wl=de,de.type==="begin")return Gw(de);if(de.type==="illegal"&&!Ee){const We=new Error('Illegal lexeme "'+Me+'" for mode "'+(we.scope||"<unnamed>")+'"');throw We.mode=we,We}else if(de.type==="end"){const We=Kw(de);if(We!==fo)return We}if(de.type==="illegal"&&Me==="")return nt+=`
625
+ `,1;if(vd>1e5&&vd>de.index*3)throw new Error("potential infinite loop, way more iterations than matches");return nt+=Me,Me.length}const Cr=ne(U);if(!Cr)throw qn(pt.replace("{}",U)),new Error('Unknown language: "'+U+'"');const Zw=lo(Cr);let yd="",we=Pe||Zw;const H1={},Wt=new X.__emitter(X);Yw();let nt="",Gl=0,xs=0,vd=0,xd=!1;try{if(Cr.__emitTokens)Cr.__emitTokens(se,Wt);else{for(we.matcher.considerAll();;){vd++,xd?xd=!1:we.matcher.considerAll(),we.matcher.lastIndex=xs;const Q=we.matcher.exec(se);if(!Q)break;const de=se.substring(xs,Q.index),Me=$1(de,Q);xs=Q.index+Me}$1(se.substring(xs))}return Wt.finalize(),yd=Wt.toHTML(),{language:U,value:yd,relevance:Gl,illegal:!1,_emitter:Wt,_top:we}}catch(Q){if(Q.message&&Q.message.includes("Illegal"))return{language:U,value:ys(se),illegal:!0,relevance:0,_illegalBy:{message:Q.message,index:xs,context:se.slice(xs-100,xs+100),mode:Q.mode,resultSoFar:yd},_emitter:Wt};if(at)return{language:U,value:ys(se),illegal:!1,relevance:0,errorRaised:Q,_emitter:Wt,_top:we};throw Q}}function ha(U){const se={value:ys(U),illegal:!1,relevance:0,_top:ae,_emitter:new X.__emitter(X)};return se._emitter.addText(U),se}function fa(U,se){se=se||X.languages||Object.keys($);const Ee=ha(U),Pe=se.filter(ne).filter(Ie).map(Mn=>Ci(Mn,U,!1));Pe.unshift(Ee);const kt=Pe.sort((Mn,Sr)=>{if(Mn.relevance!==Sr.relevance)return Sr.relevance-Mn.relevance;if(Mn.language&&Sr.language){if(ne(Mn.language).supersetOf===Sr.language)return 1;if(ne(Sr.language).supersetOf===Mn.language)return-1}return 0}),[vn,Ai]=kt,Vl=vn;return Vl.secondBest=Ai,Vl}function Hl(U,se,Ee){const Pe=se&&J[se]||Ee;U.classList.add("hljs"),U.classList.add(`language-${Pe}`)}function Yr(U){let se=null;const Ee=lt(U);if(me(Ee))return;if(_t("before:highlightElement",{el:U,language:Ee}),U.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",U);return}if(U.children.length>0&&(X.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(U)),X.throwUnescapedHTML))throw new $l("One of your code blocks includes unescaped HTML.",U.innerHTML);se=U;const Pe=se.textContent,kt=Ee?mt(Pe,{language:Ee,ignoreIllegals:!0}):fa(Pe);U.innerHTML=kt.value,U.dataset.highlighted="yes",Hl(U,Ee,kt.language),U.result={language:kt.language,re:kt.relevance,relevance:kt.relevance},kt.secondBest&&(U.secondBest={language:kt.secondBest.language,relevance:kt.secondBest.relevance}),_t("after:highlightElement",{el:U,result:kt,text:Pe})}function _i(U){X=ho(X,U)}const Ul=()=>{vs(),ar("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function ql(){vs(),ar("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let pa=!1;function vs(){function U(){vs()}if(document.readyState==="loading"){pa||window.addEventListener("DOMContentLoaded",U,!1),pa=!0;return}document.querySelectorAll(X.cssSelector).forEach(Yr)}function jl(U,se){let Ee=null;try{Ee=se(N)}catch(Pe){if(qn("Language definition for '{}' could not be registered.".replace("{}",U)),at)qn(Pe);else throw Pe;Ee=ae}Ee.name||(Ee.name=U),$[U]=Ee,Ee.rawDefinition=se.bind(null,N),Ee.aliases&&ve(Ee.aliases,{languageName:U})}function R(U){delete $[U];for(const se of Object.keys(J))J[se]===U&&delete J[se]}function z(){return Object.keys($)}function ne(U){return U=(U||"").toLowerCase(),$[U]||$[J[U]]}function ve(U,{languageName:se}){typeof U=="string"&&(U=[U]),U.forEach(Ee=>{J[Ee.toLowerCase()]=se})}function Ie(U){const se=ne(U);return se&&!se.disableAutodetect}function Fe(U){U["before:highlightBlock"]&&!U["before:highlightElement"]&&(U["before:highlightElement"]=se=>{U["before:highlightBlock"](Object.assign({block:se.el},se))}),U["after:highlightBlock"]&&!U["after:highlightElement"]&&(U["after:highlightElement"]=se=>{U["after:highlightBlock"](Object.assign({block:se.el},se))})}function xe(U){Fe(U),pe.push(U)}function Bt(U){const se=pe.indexOf(U);se!==-1&&pe.splice(se,1)}function _t(U,se){const Ee=U;pe.forEach(function(Pe){Pe[Ee]&&Pe[Ee](se)})}function jn(U){return ar("10.7.0","highlightBlock will be removed entirely in v12.0"),ar("10.7.0","Please use highlightElement now."),Yr(U)}Object.assign(N,{highlight:mt,highlightAuto:fa,highlightAll:vs,highlightElement:Yr,highlightBlock:jn,configure:_i,initHighlighting:Ul,initHighlightingOnLoad:ql,registerLanguage:jl,unregisterLanguage:R,listLanguages:z,getLanguage:ne,registerAliases:ve,autoDetection:Ie,inherit:ho,addPlugin:xe,removePlugin:Bt}),N.debugMode=function(){at=!1},N.safeMode=function(){at=!0},N.versionString=bd,N.regex={concat:m,lookahead:h,either:y,optional:p,anyNumberOfTimes:f};for(const U in An)typeof An[U]=="object"&&t(An[U]);return Object.assign(N,An),N},Kr=Er({});return Kr.newInstance=()=>Er({}),Gh=Kr,Kr.HighlightJS=Kr,Kr.default=Kr,Gh}var Dq=Nq();const dw=A3(Dq);function hw(t,e=[]){return t.flatMap(n=>{const r=[...e,...n.properties?n.properties.className:[]];return n.children?hw(n.children,r):{text:n.value,classes:r}})}function J4(t){return t.value||t.children||[]}function Oq(t){return!!dw.getLanguage(t)}function X4({doc:t,name:e,lowlight:n,defaultLanguage:r}){const i=[];return $s(t,s=>s.type.name===e).forEach(s=>{var o;let a=s.pos+1;const l=s.node.attrs.language||r,u=n.listLanguages(),c=l&&(u.includes(l)||Oq(l)||(o=n.registered)!=null&&o.call(n,l))?J4(n.highlight(l,s.node.textContent)):J4(n.highlightAuto(s.node.textContent));hw(c).forEach(d=>{const h=a+d.text.length;if(d.classes.length){const f=Ge.inline(a,h,{class:d.classes.join(" ")});i.push(f)}a=h})}),Le.create(t,i)}function Rq(t){return typeof t=="function"}function Iq({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>Rq(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new _e({key:new Ae("lowlight"),state:{init:(i,{doc:s})=>X4({doc:s,name:t,lowlight:e,defaultLanguage:n}),apply:(i,s,o,a)=>{const l=o.selection.$head.parent.type.name,u=a.selection.$head.parent.type.name,c=$s(o.doc,h=>h.type.name===t),d=$s(a.doc,h=>h.type.name===t);return i.docChanged&&([l,u].includes(t)||d.length!==c.length||i.steps.some(h=>h.from!==void 0&&h.to!==void 0&&c.some(f=>f.pos>=h.from&&f.pos+f.node.nodeSize<=h.to)))?X4({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):s.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var Lq=kv.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)==null?void 0:t.call(this))||[],Iq({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});function zq(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},f=e.optional(i)+t.IDENT_RE+"\\s*\\(",p=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],C={type:m,keyword:p,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},_={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},T=[_,d,a,n,t.C_BLOCK_COMMENT_MODE,c,u],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:T.concat([{begin:/\(/,end:/\)/,keywords:C,contains:T.concat(["self"]),relevance:0}]),relevance:0},I={className:"function",begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:C,relevance:0},{begin:f,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:C,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,I,_,T,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:C,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:C},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Bq(t){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=zq(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function Fq(t){const e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(a);const l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},c={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],f=t.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],g=["true","false"],y={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],C=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],_=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:g,built_in:[...x,...k,"set","shopt",...C,..._]},contains:[f,t.SHEBANG(),p,d,s,o,y,a,l,u,c,n]}}function Pq(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},f=e.optional(i)+t.IDENT_RE+"\\s*\\(",g={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[d,a,n,t.C_BLOCK_COMMENT_MODE,c,u],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:g,contains:y.concat([{begin:/\(/,end:/\)/,keywords:g,contains:y.concat(["self"]),relevance:0}]),relevance:0},k={begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:g,relevance:0},{begin:f,returnBegin:!0,contains:[t.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:g,disableAutodetect:!0,illegal:"</",contains:[].concat(x,k,y,[d,{begin:t.IDENT_RE+"::",keywords:g},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:d,strings:u,keywords:g}}}function $q(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},f=e.optional(i)+t.IDENT_RE+"\\s*\\(",p=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],C={type:m,keyword:p,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},_={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},T=[_,d,a,n,t.C_BLOCK_COMMENT_MODE,c,u],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:T.concat([{begin:/\(/,end:/\)/,keywords:C,contains:T.concat(["self"]),relevance:0}]),relevance:0},I={className:"function",begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:C,relevance:0},{begin:f,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:C,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,I,_,T,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:C,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:C},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Hq(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:i.concat(s),built_in:e,literal:r},a=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},c={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},d=t.inherit(c,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:o},f=t.inherit(h,{illegal:/\n/}),p={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,f]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},g=t.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]});h.contains=[m,p,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.C_BLOCK_COMMENT_MODE],f.contains=[g,p,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,m,p,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},k=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",C={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,x,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,x,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+k+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},C]}}const Uq=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),qq=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],jq=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Vq=[...qq,...jq],Wq=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Gq=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Kq=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Yq=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Zq(t){const e=t.regex,n=Uq(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",a=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Gq.join("|")+")"},{begin:":(:)?("+Kq.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Yq.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Wq.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Vq.join("|")+")\\b"}]}}function Jq(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Xq(t){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function Qq(t){const e=t.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(n,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function ej(t){const e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},r=t.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,s,i,o,n,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,u=/"(\\"|[^"])*"/,c=/'[^']*'/,d=e.either(l,u,c),h=e.concat(d,"(\\s*\\.\\s*",d,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:h,className:"attr",starts:{end:/$/,contains:[r,a,s,i,o,n]}}]}}var So="[0-9](_*[0-9])*",Au=`\\.(${So})`,Tu="[0-9a-fA-F](_*[0-9a-fA-F])*",Q4={className:"number",variants:[{begin:`(\\b(${So})((${Au})|\\.)?|(${Au}))[eE][+-]?(${So})[fFdD]?\\b`},{begin:`\\b(${So})((${Au})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Au})[fFdD]?\\b`},{begin:`\\b(${So})[fFdD]\\b`},{begin:`\\b0[xX]((${Tu})\\.?|(${Tu})?\\.(${Tu}))[pP][+-]?(${So})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Tu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function fw(t,e,n){return n===-1?"":t.replace(e,r=>fw(t,e,n-1))}function tj(t){const e=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+fw("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},c={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[c,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Q4,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Q4,u]}}const e3="[A-Za-z$_][0-9A-Za-z$_]*",nj=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],rj=["true","false","null","undefined","NaN","Infinity"],pw=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],mw=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],gw=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ij=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],sj=[].concat(gw,pw,mw);function oj(t){const e=t.regex,n=(ke,{after:ft})=>{const et="</"+ke[0].slice(1);return ke.input.indexOf(et,ft)!==-1},r=e3,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ke,ft)=>{const et=ke[0].length+ke.index,Ze=ke.input[et];if(Ze==="<"||Ze===","){ft.ignoreMatch();return}Ze===">"&&(n(ke,{after:et})||ft.ignoreMatch());let tt;const it=ke.input.substring(et);if(tt=it.match(/^\s*=/)){ft.ignoreMatch();return}if((tt=it.match(/^\s+extends\s+/))&&tt.index===0){ft.ignoreMatch();return}}},a={$pattern:e3,keyword:nj,literal:rj,built_in:sj,"variable.language":ij},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,h]},x={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,p,m,g,{match:/\$\d+/},d];h.contains=k.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(k)});const C=[].concat(x,h.contains),_=C.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(C)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},D={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},I={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...pw,...mw]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},ie={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function oe(ke){return e.concat("(?!",ke.join("|"),")")}const be={match:e.concat(/\b/,oe([...gw,"super","import"].map(ke=>`${ke}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},Te="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",St={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Te)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:I},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,p,m,g,x,{match:/\$\d+/},d,I,{scope:"attr",match:r+e.lookahead(":"),relevance:0},St,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,t.REGEXP_MODE,{className:"function",begin:Te,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},be,ie,D,te,{match:/\$[(.]/}]}}function aj(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Co="[0-9](_*[0-9])*",Mu=`\\.(${Co})`,Nu="[0-9a-fA-F](_*[0-9a-fA-F])*",lj={className:"number",variants:[{begin:`(\\b(${Co})((${Mu})|\\.)?|(${Mu}))[eE][+-]?(${Co})[fFdD]?\\b`},{begin:`\\b(${Co})((${Mu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Mu})[fFdD]?\\b`},{begin:`\\b(${Co})[fFdD]\\b`},{begin:`\\b0[xX]((${Nu})\\.?|(${Nu})?\\.(${Nu}))[pP][+-]?(${Co})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Nu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function uj(t){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(o);const a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(o,{className:"string"}),"self"]}]},u=lj,c=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=d;return h.variants[1].contains=[d],d.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,c,n,r,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,t.C_LINE_COMMENT_MODE,c],relevance:0},t.C_LINE_COMMENT_MODE,c,a,l,o,t.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
626
+ `},u]}}const cj=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),dj=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],hj=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],fj=[...dj,...hj],pj=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),bw=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),yw=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),mj=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),gj=bw.concat(yw).sort().reverse();function bj(t){const e=cj(t),n=gj,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",o=[],a=[],l=function(k){return{className:"string",begin:"~?"+k+".*?"+k}},u=function(k,C,_){return{className:k,begin:C,relevance:_}},c={$pattern:/[a-z-]+/,keyword:r,attribute:pj.join(" ")},d={begin:"\\(",end:"\\)",contains:a,keywords:c,relevance:0};a.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,u("variable","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const h=a.concat({begin:/\{/,end:/\}/,contains:o}),f={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},p={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+mj.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:a,relevance:0}},g={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,f,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+fj.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+bw.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+yw.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},e.FUNCTION_DISPATCH]},x={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,m,g,x,p,y,f,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function yj(t){const e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function vj(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,n]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,r,i,s,o]}}function xj(t){const e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},c={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=t.inherit(u,{contains:[]}),h=t.inherit(c,{contains:[]});u.contains.push(h),c.contains.push(d);let f=[n,l];return[u,c,d,h].forEach(y=>{y.contains=y.contains.concat(f)}),f=f.concat(u,c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},n,s,u,c,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},i,r,l,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function wj(t){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function kj(t){const e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},o={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},c=[t.BACKSLASH_ESCAPE,s,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(m,g,y="\\1")=>{const x=y==="\\1"?y:e.concat(y,g);return e.concat(e.concat("(?:",m,")"),g,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,y,r)},f=(m,g,y)=>e.concat(e.concat("(?:",m,")"),g,/(?:\\.|[^\\\/])*?/,y,r),p=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:c,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",e.either(...d,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:f("(?:m|qr)?",/\//,/\//)},{begin:f("m|qr",e.either(...d,{capture:!0}),/\1/)},{begin:f("m|qr",/\(/,/\)/)},{begin:f("m|qr",/\[/,/\]/)},{begin:f("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,a,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=p,o.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:p}}function Ej(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=e.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=t.inherit(t.APOS_STRING_MODE,{illegal:null}),c=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(Y,te)=>{te.data._beginMatch=Y[1]||Y[2]},"on:end":(Y,te)=>{te.data._beginMatch!==Y[1]&&te.ignoreMatch()}},h=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[
627
+ ]`,p={scope:"string",variants:[c,u,d,h]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},g=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],x=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],C={keyword:y,literal:(Y=>{const te=[];return Y.forEach(Te=>{te.push(Te),Te.toLowerCase()===Te?te.push(Te.toUpperCase()):te.push(Te.toLowerCase())}),te})(g),built_in:x},_=Y=>Y.map(te=>te.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,e.concat(f,"+"),e.concat("(?!",_(x).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},D=e.concat(r,"\\b(?!\\()"),I={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),D],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),D],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},L={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},G={relevance:0,begin:/\(/,end:/\)/,keywords:C,contains:[L,o,I,t.C_BLOCK_COMMENT_MODE,p,m,T]},ie={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",_(y).join("\\b|"),"|",_(x).join("\\b|"),"\\b)"),r,e.concat(f,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[G]};G.contains.push(ie);const oe=[L,I,t.C_BLOCK_COMMENT_MODE,p,m,T],be={begin:e.concat(/#\[\s*\\?/,e.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]},contains:["self",...oe]},...oe,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:C,contains:[be,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},o,ie,I,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},T,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:C,contains:["self",be,o,I,t.C_BLOCK_COMMENT_MODE,p,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},p,m]}}function Sj(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Cj(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function _j(t){const e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},c={begin:/\{\{/,relevance:0},d={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l,c,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,c,u]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",f=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,p=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${f}))[eE][+-]?(${h})[jJ]?(?=${p})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${h})[jJ](?=${p})`}]},g={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,m,d,t.HASH_COMMENT_MODE]}]};return u.contains=[d,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,g,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,y,d]}]}}function Aj(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Tj(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Mj(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[t.COMMENT("#","$",{contains:[a]}),t.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},d={className:"string",contains:[t.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,c]})]}]},h="[1-9](_?[0-9])*|0",f="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},T=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);c.contains=T,m.contains=T;const G=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:T}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(G).concat(u).concat(T)}}function Nj(t){const e=t.regex,n=/(r#)?/,r=e.concat(n,t.UNDERSCORE_IDENT_RE),i=e.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],c=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:c,keyword:a,literal:l,built_in:u},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:c}},{className:"punctuation",begin:"->"},s]}}const Dj=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Oj=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Rj=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Ij=[...Oj,...Rj],Lj=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),zj=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Bj=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Fj=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Pj(t){const e=Dj(t),n=Bj,r=zj,i="@[a-z-]+",s="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Ij.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Fj.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,a,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Lj.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function $j(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Hj(t){const e=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],c=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=c,p=[...u,...l].filter(_=>!c.includes(_)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},g={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:e.concat(/\b/,e.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function x(_){return e.concat(/\b/,e.either(..._.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:x(h),relevance:0};function C(_,{exceptions:T,when:D}={}){const I=D;return T=T||[],_.map(L=>L.match(/\|\d+$/)||T.includes(L)?L:I(L)?`${L}|0`:L)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:C(p,{when:_=>_.length<3}),literal:s,type:a,built_in:d},contains:[{scope:"type",match:x(o)},k,y,m,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,g]}}function vw(t){return t?typeof t=="string"?t:t.source:null}function Ea(t){return Ye("(?=",t,")")}function Ye(...t){return t.map(n=>vw(n)).join("")}function Uj(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function an(...t){return"("+(Uj(t).capture?"":"?:")+t.map(r=>vw(r)).join("|")+")"}const L1=t=>Ye(/\b/,t,/\w$/.test(t)?/\b/:/\B/),qj=["Protocol","Type"].map(L1),t3=["init","self"].map(L1),jj=["Any","Self"],Kh=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],n3=["false","nil","true"],Vj=["assignment","associativity","higherThan","left","lowerThan","none","right"],Wj=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],r3=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],xw=an(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),ww=an(xw,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Yh=Ye(xw,ww,"*"),kw=an(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),p0=an(kw,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Tr=Ye(kw,p0,"*"),Du=Ye(/[A-Z]/,p0,"*"),Gj=["attached","autoclosure",Ye(/convention\(/,an("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ye(/objc\(/,Tr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Kj=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Yj(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,an(...qj,...t3)],className:{2:"keyword"}},s={match:Ye(/\./,an(...Kh)),relevance:0},o=Kh.filter(Re=>typeof Re=="string").concat(["_|0"]),a=Kh.filter(Re=>typeof Re!="string").concat(jj).map(L1),l={variants:[{className:"keyword",match:an(...a,...t3)}]},u={$pattern:an(/\b\w+/,/#\w+/),keyword:o.concat(Wj),literal:n3},c=[i,s,l],d={match:Ye(/\./,an(...r3)),relevance:0},h={className:"built_in",match:Ye(/\b/,an(...r3),/(?=\()/)},f=[d,h],p={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:Yh},{match:`\\.(\\.|${ww})+`}]},g=[p,m],y="([0-9]_*)+",x="([0-9a-fA-F]_*)+",k={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},C=(Re="")=>({className:"subst",variants:[{match:Ye(/\\/,Re,/[0\\tnr"']/)},{match:Ye(/\\/,Re,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(Re="")=>({className:"subst",match:Ye(/\\/,Re,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(Re="")=>({className:"subst",label:"interpol",begin:Ye(/\\/,Re,/\(/),end:/\)/}),D=(Re="")=>({begin:Ye(Re,/"""/),end:Ye(/"""/,Re),contains:[C(Re),_(Re),T(Re)]}),I=(Re="")=>({begin:Ye(Re,/"/),end:Ye(/"/,Re),contains:[C(Re),T(Re)]}),L={className:"string",variants:[D(),D("#"),D("##"),D("###"),I(),I("#"),I("##"),I("###")]},G=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],ie={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:G},oe=Re=>{const Ct=Ye(Re,/\//),Tn=Ye(/\//,Re);return{begin:Ct,end:Tn,contains:[...G,{scope:"comment",begin:`#(?!.*${Tn})`,end:/$/}]}},be={scope:"regexp",variants:[oe("###"),oe("##"),oe("#"),ie]},Y={match:Ye(/`/,Tr,/`/)},te={className:"variable",match:/\$\d+/},Te={className:"variable",match:`\\$${p0}+`},St=[Y,te,Te],ke={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Kj,contains:[...g,k,L]}]}},ft={scope:"keyword",match:Ye(/@/,an(...Gj),Ea(an(/\(/,/\s+/)))},et={scope:"meta",match:Ye(/@/,Tr)},Ze=[ke,ft,et],tt={match:Ea(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ye(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,p0,"+")},{className:"type",match:Du,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ye(/\s+&\s+/,Ea(Du)),relevance:0}]},it={begin:/</,end:/>/,keywords:u,contains:[...r,...c,...Ze,p,tt]};tt.contains.push(it);const ir={match:Ye(Tr,/\s*:/),keywords:"_|0",relevance:0},Fn={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ir,...r,be,...c,...f,...g,k,L,...St,...Ze,tt]},bn={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,tt]},yn={begin:an(Ea(Ye(Tr,/\s*:/)),Ea(Ye(Tr,/\s+/,Tr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Tr}]},sr={begin:/\(/,end:/\)/,keywords:u,contains:[yn,...r,...c,...g,k,L,...Ze,tt,Fn],endsParent:!0,illegal:/["']/},Pn={match:[/(func|macro)/,/\s+/,an(Y.match,Tr,Yh)],className:{1:"keyword",3:"title.function"},contains:[bn,sr,e],illegal:[/\[/,/%/]},An={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[bn,sr,e],illegal:/\[|%/},ki={match:[/operator/,/\s+/,Yh],className:{1:"keyword",3:"title"}},xr={begin:[/precedencegroup/,/\s+/,Du],className:{1:"keyword",3:"title"},contains:[tt],keywords:[...Vj,...n3],end:/}/},wr={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},$n={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ms={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Tr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[bn,...c,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Du},...c],relevance:0}]};for(const Re of L.variants){const Ct=Re.contains.find(Hn=>Hn.label==="interpol");Ct.keywords=u;const Tn=[...c,...f,...g,k,L,...St];Ct.contains=[...Tn,{begin:/\(/,end:/\)/,contains:["self",...Tn]}]}return{name:"Swift",keywords:u,contains:[...r,Pn,An,wr,$n,ms,ki,xr,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},be,...c,...f,...g,k,L,...St,...Ze,tt,Fn]}}const m0="[A-Za-z$_][0-9A-Za-z$_]*",Ew=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Sw=["true","false","null","undefined","NaN","Infinity"],Cw=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],_w=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Aw=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Tw=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Mw=[].concat(Aw,Cw,_w);function Zj(t){const e=t.regex,n=(ke,{after:ft})=>{const et="</"+ke[0].slice(1);return ke.input.indexOf(et,ft)!==-1},r=m0,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ke,ft)=>{const et=ke[0].length+ke.index,Ze=ke.input[et];if(Ze==="<"||Ze===","){ft.ignoreMatch();return}Ze===">"&&(n(ke,{after:et})||ft.ignoreMatch());let tt;const it=ke.input.substring(et);if(tt=it.match(/^\s*=/)){ft.ignoreMatch();return}if((tt=it.match(/^\s+extends\s+/))&&tt.index===0){ft.ignoreMatch();return}}},a={$pattern:m0,keyword:Ew,literal:Sw,built_in:Mw,"variable.language":Tw},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,h],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,h]},x={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,p,m,g,{match:/\$\d+/},d];h.contains=k.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(k)});const C=[].concat(x,h.contains),_=C.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(C)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},D={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},I={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Cw,..._w]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},ie={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function oe(ke){return e.concat("(?!",ke.join("|"),")")}const be={match:e.concat(/\b/,oe([...Aw,"super","import"].map(ke=>`${ke}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},Te="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",St={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Te)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:I},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,p,m,g,x,{match:/\$\d+/},d,I,{scope:"attr",match:r+e.lookahead(":"),relevance:0},St,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,t.REGEXP_MODE,{className:"function",begin:Te,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},be,ie,D,te,{match:/\$[(.]/}]}}function Jj(t){const e=t.regex,n=Zj(t),r=m0,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:m0,keyword:Ew.concat(l),literal:Sw,built_in:Mw.concat(i),"variable.language":Tw},c={className:"meta",begin:"@"+r},d=(m,g,y)=>{const x=m.contains.findIndex(k=>k.label===g);if(x===-1)throw new Error("can not find mode to replace");m.contains.splice(x,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(c);const h=n.contains.find(m=>m.scope==="attr"),f=Object.assign({},h,{match:e.concat(r,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,f]),n.contains=n.contains.concat([c,s,o,f]),d(n,"shebang",t.SHEBANG()),d(n,"use_strict",a);const p=n.contains.find(m=>m.label==="func.def");return p.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Xj(t){const e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(s,i),/ *#/)},{begin:e.concat(/# */,a,/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,e.either(s,i),/ +/,e.either(o,a),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},c={className:"label",begin:/^\w+:/},d=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,u,c,d,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function Qj(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,i,t.QUOTE_STRING_MODE,l,u,a]}}function eV(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=t.inherit(s,{begin:/\(/,end:/\)/}),a=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,l,a,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,o,l,a]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function tV(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},a=t.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},p={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},g=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},h,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},p,m,s,o],y=[...g];return y.pop(),y.push(a),f.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}const nV={arduino:Bq,bash:Fq,c:Pq,cpp:$q,csharp:Hq,css:Zq,diff:Jq,go:Xq,graphql:Qq,ini:ej,java:tj,javascript:oj,json:aj,kotlin:uj,less:bj,lua:yj,makefile:vj,markdown:xj,objectivec:wj,perl:kj,php:Ej,"php-template":Sj,plaintext:Cj,python:_j,"python-repl":Aj,r:Tj,ruby:Mj,rust:Nj,scss:Pj,shell:$j,sql:Hj,swift:Yj,typescript:Jj,vbnet:Xj,wasm:Qj,xml:eV,yaml:tV},i3={},rV="hljs-";function iV(t){const e=dw.newInstance();return t&&s(t),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:o,registered:a};function n(l,u,c){const d=c||i3,h=typeof d.prefix=="string"?d.prefix:rV;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:sV,classPrefix:h});const f=e.highlight(u,{ignoreIllegals:!0,language:l});if(f.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:f.errorRaised});const p=f._emitter.root,m=p.data;return m.language=f.language,m.relevance=f.relevance,p}function r(l,u){const d=(u||i3).subset||i();let h=-1,f=0,p;for(;++h<d.length;){const m=d[h];if(!e.getLanguage(m))continue;const g=n(m,l,u);g.data&&g.data.relevance!==void 0&&g.data.relevance>f&&(f=g.data.relevance,p=g)}return p||{type:"root",children:[],data:{language:void 0,relevance:f}}}function i(){return e.listLanguages()}function s(l,u){if(typeof l=="string")e.registerLanguage(l,u);else{let c;for(c in l)Object.hasOwn(l,c)&&e.registerLanguage(c,l[c])}}function o(l,u){if(typeof l=="string")e.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let c;for(c in l)if(Object.hasOwn(l,c)){const d=l[c];e.registerAliases(typeof d=="string"?d:[...d],{languageName:c})}}}function a(l){return!!e.getLanguage(l)}}class sV{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){const n=this,r=e.split(".").map(function(o,a){return a?o+"_".repeat(a):n.options.classPrefix+o}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const oV=iV(nV),aV=[{id:"plaintext",label:"Plain text"},{id:"bash",label:"Bash"},{id:"c",label:"C"},{id:"cpp",label:"C++"},{id:"csharp",label:"C#"},{id:"css",label:"CSS"},{id:"csv",label:"CSV"},{id:"tsv",label:"TSV"},{id:"diff",label:"Diff"},{id:"go",label:"Go"},{id:"graphql",label:"GraphQL"},{id:"html",label:"HTML"},{id:"java",label:"Java"},{id:"javascript",label:"JavaScript"},{id:"json",label:"JSON"},{id:"kotlin",label:"Kotlin"},{id:"markdown",label:"Markdown"},{id:"php",label:"PHP"},{id:"python",label:"Python"},{id:"ruby",label:"Ruby"},{id:"rust",label:"Rust"},{id:"sql",label:"SQL"},{id:"swift",label:"Swift"},{id:"typescript",label:"TypeScript"},{id:"xml",label:"XML"},{id:"yaml",label:"YAML"}],lV=Lq.extend({addInputRules(){var t;return[...((t=this.parent)==null?void 0:t.call(this))??[],gc({find:/^```$/,type:this.type})]},addNodeView(){return({node:t,editor:e,getPos:n})=>{const r=document.createElement("div");r.className="cn-code-block";const i=document.createElement("div");i.className="cn-code-block-header",i.contentEditable="false",i.addEventListener("mousedown",h=>{h.target===i&&h.preventDefault()});const s=document.createElement("select");s.className="cn-code-lang";for(const h of aV){const f=document.createElement("option");f.value=h.id,f.textContent=h.label,s.append(f)}s.value=t.attrs.language||"plaintext",s.addEventListener("change",()=>{const h=typeof n=="function"?n():void 0;h!==void 0&&e.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>(f.setNodeMarkup(h,void 0,{...t.attrs,language:s.value}),!0)).run()});const o=document.createElement("button");o.type="button",o.className="cn-code-copy cn-code-to-table",o.textContent="Convert to table",o.addEventListener("click",()=>{const h=typeof n=="function"?n():void 0;if(h===void 0)return;const f=e.state.doc.nodeAt(h);if(!f)return;const p=f.textContent.replace(/\n$/,""),g=(f.attrs.language||"")==="tsv"?" ":aw(p)??",",y=us(p,g);if(y.length===0)return;const x=lw(y,{hasHeader:I1(y)});e.chain().focus().deleteRange({from:h,to:h+f.nodeSize}).insertContentAt(h,x).run()});const a=document.createElement("button");a.type="button",a.className="cn-code-copy",a.textContent="Copy",a.addEventListener("click",()=>{const h=d.textContent??"";g7(h).then(f=>{f&&(a.textContent="Copied",window.setTimeout(()=>{a.textContent="Copy"},1200))})});const l=h=>{o.style.display=h==="csv"||h==="tsv"?"":"none"};l(s.value);const u=document.createElement("div");u.className="cn-code-actions",u.append(o,a),i.append(s,u);const c=document.createElement("pre"),d=document.createElement("code");return c.append(d),r.append(i,c),{dom:r,contentDOM:d,update(h){if(h.type!==t.type)return!1;const f=h.attrs.language||"plaintext";return s.value!==f&&(s.value=f),l(f),!0}}}}}).configure({lowlight:oV});function g0(t){return t==="left"||t==="right"||t==="center"?t:null}function uV(t){const e=(t.style.textAlign||"").trim().toLowerCase(),n=(t.getAttribute("align")||"").trim().toLowerCase();return g0(e||n)}function cV(t){return g0(t==null?void 0:t.align)}function Nw(){return{default:null,parseHTML:t=>uV(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}var Dw=Oe.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{var e,n;const r=t.getAttribute("colwidth"),i=r?r.split(",").map(s=>parseInt(s,10)):null;if(!i){const s=(e=t.closest("table"))==null?void 0:e.querySelectorAll("colgroup > col"),o=Array.from(((n=t.parentElement)==null?void 0:n.children)||[]).indexOf(t);if(o&&o>-1&&s&&s[o]){const a=s[o].getAttribute("width");return a?[parseInt(a,10)]:null}}return i}},align:Nw()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",ze(this.options.HTMLAttributes,t),0]}}),Ow=Oe.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}},align:Nw()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",ze(this.options.HTMLAttributes,t),0]}}),Rw=Oe.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",ze(this.options.HTMLAttributes,t),0]}});function Ip(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function s3(t,e,n,r,i,s){var o;let a=0,l=!0,u=e.firstChild;const c=t.firstChild;if(c!==null)for(let h=0,f=0;h<c.childCount;h+=1){const{colspan:p,colwidth:m}=c.child(h).attrs;for(let g=0;g<p;g+=1,f+=1){const y=i===f?s:m&&m[g],x=y?`${y}px`:"";if(a+=y||r,y||(l=!1),u){if(u.style.width!==x){const[k,C]=Ip(r,y);u.style.setProperty(k,C)}u=u.nextSibling}else{const k=document.createElement("col"),[C,_]=Ip(r,y);k.style.setProperty(C,_),e.appendChild(k)}}}for(;u;){const h=u.nextSibling;(o=u.parentNode)==null||o.removeChild(u),u=h}const d=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);l&&!d?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var dV=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),s3(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,s3(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(n&&!r&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function hV(t,e,n,r){let i=0,s=!0;const o=[],a=t.firstChild;if(!a)return{};for(let d=0,h=0;d<a.childCount;d+=1){const{colspan:f,colwidth:p}=a.child(d).attrs;for(let m=0;m<f;m+=1,h+=1){const g=n===h?r:p&&p[m];i+=g||e,g||(s=!1);const[y,x]=Ip(e,g);o.push(["col",{style:`${y}: ${x}`}])}}const l=s?`${i}px`:"",u=s?"":`${i}px`;return{colgroup:["colgroup",{},...o],tableWidth:l,tableMinWidth:u}}function o3(t,e){return t.createAndFill()}function fV(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function pV(t,e,n,r,i){const s=fV(t),o=[],a=[];for(let u=0;u<n;u+=1){const c=o3(s.cell);if(c&&a.push(c),r){const d=o3(s.header_cell);d&&o.push(d)}}const l=[];for(let u=0;u<e;u+=1)l.push(s.row.createChecked(null,r&&u===0?o:a));return s.table.createChecked(null,l)}function mV(t){return t instanceof Qe}var Ou=({editor:t})=>{const{selection:e}=t.state;if(!mV(e))return!1;let n=0;const r=S5(e.ranges[0].$from,s=>s.type.name==="table");return r==null||r.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},gV="";function bV(t){return(t||"").replace(/\s+/g," ").trim()}function yV(t,e,n={}){var r;const i=(r=n.cellLineSeparator)!=null?r:gV;if(!t||!t.content||t.content.length===0)return"";const s=[];t.content.forEach(m=>{const g=[];m.content&&m.content.forEach(y=>{let x="";y.content&&Array.isArray(y.content)&&y.content.length>1?x=y.content.map(D=>e.renderChildren(D)).join(i):x=y.content?e.renderChildren(y.content):"";const k=bV(x),C=y.type==="tableHeader",_=cV(y.attrs);g.push({text:k,isHeader:C,align:_})}),s.push(g)});const o=s.reduce((m,g)=>Math.max(m,g.length),0);if(o===0)return"";const a=new Array(o).fill(0);s.forEach(m=>{var g;for(let y=0;y<o;y+=1){const k=(((g=m[y])==null?void 0:g.text)||"").length;k>a[y]&&(a[y]=k),a[y]<3&&(a[y]=3)}});const l=(m,g)=>m+" ".repeat(Math.max(0,g-m.length)),u=s[0],c=u.some(m=>m.isHeader),d=new Array(o).fill(null);s.forEach(m=>{var g;for(let y=0;y<o;y+=1)!d[y]&&((g=m[y])!=null&&g.align)&&(d[y]=m[y].align)});let h=`
628
+ `;const f=new Array(o).fill(0).map((m,g)=>c&&u[g]&&u[g].text||"");return h+=`| ${f.map((m,g)=>l(m,a[g])).join(" | ")} |
629
+ `,h+=`| ${a.map((m,g)=>{const y=Math.max(3,m),x=d[g];return x==="left"?`:${"-".repeat(y)}`:x==="right"?`${"-".repeat(y)}:`:x==="center"?`:${"-".repeat(y)}:`:"-".repeat(y)}).join(" | ")} |
630
+ `,(c?s.slice(1):s).forEach(m=>{h+=`| ${new Array(o).fill(0).map((g,y)=>l(m[y]&&m[y].text||"",a[y])).join(" | ")} |
631
+ `}),h}var vV=yV,Iw=Oe.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:dV,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=hV(t,this.options.cellMinWidth),s=e.style;function o(){return s||(r?`width: ${r}`:`min-width: ${i}`)}const a=["table",ze(this.options.HTMLAttributes,e,{style:o()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},a]:a},parseMarkdown:(t,e)=>{const n=[],r=Array.isArray(t.align)?t.align:[];if(t.header){const i=[];t.header.forEach((s,o)=>{var a;const l=g0((a=r[o])!=null?a:s.align),u=l?{align:l}:{};i.push(e.createNode("tableHeader",u,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),n.push(e.createNode("tableRow",{},i))}return t.rows&&t.rows.forEach(i=>{const s=[];i.forEach((o,a)=>{var l;const u=g0((l=r[a])!=null?l:o.align),c=u?{align:u}:{};s.push(e.createNode("tableCell",c,[{type:"paragraph",content:e.parseInline(o.tokens)}]))}),n.push(e.createNode("tableRow",{},s))}),e.createNode("table",void 0,n)},renderMarkdown:(t,e)=>vV(t,e),addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:s})=>{const o=pV(s.schema,t,e,n);if(i){const a=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(le.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>pD(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>mD(t,e),deleteColumn:()=>({state:t,dispatch:e})=>bD(t,e),addRowBefore:()=>({state:t,dispatch:e})=>vD(t,e),addRowAfter:()=>({state:t,dispatch:e})=>xD(t,e),deleteRow:()=>({state:t,dispatch:e})=>kD(t,e),deleteTable:()=>({state:t,dispatch:e})=>MD(t,e),mergeCells:()=>({state:t,dispatch:e})=>h2(t,e),splitCell:()=>({state:t,dispatch:e})=>f2(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>rl("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>rl("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>AD(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>h2(t,e)?!0:f2(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>CD(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>m2(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>m2(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&dv(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=Qe.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Ou,"Mod-Backspace":Ou,Delete:Ou,"Mod-Delete":Ou}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[PD({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],YD({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){const t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:n,view:r})=>new e(n,this.options.cellMinWidth,r)},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:qe(ce(t,"tableRole",e))}}});Se.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(Iw.configure(this.options.table)),this.options.tableCell!==!1&&t.push(Dw.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(Ow.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(Rw.configure(this.options.tableRow)),t}});function xV(t){const e=[];return t.descendants(n=>{if(n.type.name==="hardBreak")return e.push("<br>"),!1;if(n.isText&&n.text){let r=n.text.replace(/\\/g,"\\\\").replace(/\|/g,"\\|");for(const i of n.marks)switch(i.type.name){case"bold":case"strong":r=`**${r}**`;break;case"italic":case"em":r=`*${r}*`;break;case"code":r=`\`${r}\``;break;case"strike":r=`~~${r}~~`;break;case"highlight":r=`==${r}==`;break;case"link":r=`[${r}](${i.attrs.href})`;break}e.push(r)}return!0}),e.join("").replace(/\s*\n\s*/g," ").trim()}function wV(t,e){const n=[];if(e.forEach(o=>{const a=[];o.forEach(l=>a.push(xV(l))),n.push(a)}),n.length===0){t.closeBlock(e);return}const r=Math.max(...n.map(o=>o.length)),i=o=>{const a=o.slice();for(;a.length<r;)a.push("");return a},s=i(n[0]);t.write(`| ${s.join(" | ")} |
632
+ `),t.write(`| ${s.map(()=>"---").join(" | ")} |
633
+ `);for(let o=1;o<n.length;o++)t.write(`| ${i(n[o]).join(" | ")} |
634
+ `);t.closeBlock(e)}const z1={serialize(){},parse:{}},kV=Iw.configure({resizable:!0}).extend({addStorage(){return{markdown:{serialize:wV,parse:{}}}}}),EV=Rw.extend({addStorage(){return{markdown:z1}}}),SV=Ow.extend({addStorage(){return{markdown:z1}}}),CV=Dw.extend({addStorage(){return{markdown:z1}}}),_V=[kV,EV,SV,CV];function b0(t,e,n){function r(h){return h.trim().split(" ",2)[0]===e}function i(h,f,p,m,g){return h[f].nesting===1&&h[f].attrJoin("class",e),g.renderToken(h,f,p,m,g)}n=n||{};const s=3,o=n.marker||":",a=o.charCodeAt(0),l=o.length,u=n.validate||r,c=n.render||i;function d(h,f,p,m){let g,y=!1,x=h.bMarks[f]+h.tShift[f],k=h.eMarks[f];if(a!==h.src.charCodeAt(x))return!1;for(g=x+1;g<=k&&o[(g-x)%l]===h.src[g];g++);const C=Math.floor((g-x)/l);if(C<s)return!1;g-=(g-x)%l;const _=h.src.slice(x,g),T=h.src.slice(g,k);if(!u(T,_))return!1;if(m)return!0;let D=f;for(;D++,!(D>=p||(x=h.bMarks[D]+h.tShift[D],k=h.eMarks[D],x<k&&h.sCount[D]<h.blkIndent));)if(a===h.src.charCodeAt(x)&&!(h.sCount[D]-h.blkIndent>=4)){for(g=x+1;g<=k&&o[(g-x)%l]===h.src[g];g++);if(!(Math.floor((g-x)/l)<C)&&(g-=(g-x)%l,g=h.skipSpaces(g),!(g<k))){y=!0;break}}const I=h.parentType,L=h.lineMax;h.parentType="container",h.lineMax=D;const G=h.push("container_"+e+"_open","div",1);G.markup=_,G.block=!0,G.info=T,G.map=[f,D],h.md.block.tokenize(h,f+1,D);const ie=h.push("container_"+e+"_close","div",-1);return ie.markup=h.src.slice(x,g),ie.block=!0,h.parentType=I,h.lineMax=L,h.line=D+(y?1:0),!0}t.block.ruler.before("fence","container_"+e,d,{alt:["paragraph","reference","blockquote","list"]}),t.renderer.rules["container_"+e+"_open"]=c,t.renderer.rules["container_"+e+"_close"]=c}function Lw(t){const e=t.toLowerCase();return e==="tip"?"tip":e==="warn"||e==="warning"?"warn":"info"}function AV(t){t.use(b0,"callout",{validate:e=>/^(info|tip|warn|warning)\s*$/.test(e.trim()),render:(e,n)=>{const r=e[n];return r.nesting===1?`<div data-callout="${Lw(r.info.trim())}">
635
+ `:`</div>
636
+ `}})}const TV=Oe.create({name:"callout",group:"block",content:"block+",defining:!0,addAttributes(){return{type:{default:"info",parseHTML:t=>Lw(t.getAttribute("data-callout")||"info"),renderHTML:t=>({"data-callout":t.type})}}},parseHTML(){return[{tag:"div[data-callout]"}]},renderHTML({HTMLAttributes:t}){return["div",ze(t,{class:"cn-callout"}),0]},addCommands(){return{setCallout:(t="info")=>({commands:e})=>e.wrapIn(this.name,{type:t}),toggleCallout:(t="info")=>({commands:e})=>e.toggleWrap(this.name,{type:t})}},addStorage(){return{markdown:{serialize(t,e){t.write(`::: ${e.attrs.type}
637
+ `),t.renderContent(e),t.ensureNewLine(),t.write(":::"),t.closeBlock(e)},parse:{setup(t){AV(t)}}}}}});var y0=(t,e)=>e.view.domAtPos(t).node.offsetParent!==null,MV=(t,e,n)=>{for(let r=t.depth;r>0;r-=1){const i=t.node(r),s=e(i),o=y0(t.start(r),n);if(s&&o)return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:i}}},a3=(t,e)=>{const{state:n,view:r,extensionManager:i}=t,{schema:s,selection:o}=n,{empty:a,$anchor:l}=o,u=!!i.extensions.find(y=>y.name==="gapCursor");if(!a||l.parent.type!==s.nodes.detailsSummary||!u||e==="right"&&l.parentOffset!==l.parent.nodeSize-2)return!1;const c=io(y=>y.type===s.nodes.details)(o);if(!c)return!1;const d=$s(c.node,y=>y.type===s.nodes.detailsContent);if(!d.length||y0(c.start+d[0].pos+1,t))return!1;const f=n.doc.resolve(c.pos+c.node.nodeSize),p=ct.findFrom(f,1,!1);if(!p)return!1;const{tr:m}=n,g=new ct(p);return m.setSelection(g),m.scrollIntoView(),r.dispatch(m),!0},NV=Oe.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{persist:!1,openClassName:"is-open",HTMLAttributes:{},renderToggleButton:({element:t,isOpen:e})=>{t.setAttribute("aria-label",e?"Collapse details content":"Expand details content")}}},addAttributes(){return this.options.persist?{open:{default:!1,parseHTML:t=>t.hasAttribute("open"),renderHTML:({open:t})=>t?{open:""}:{}}}:[]},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",ze(this.options.HTMLAttributes,t),0]},...V0({nodeName:"details",content:"block"}),addNodeView(){return({editor:t,getPos:e,node:n,HTMLAttributes:r})=>{const i=document.createElement("div"),s=ze(this.options.HTMLAttributes,r,{"data-type":this.name});Object.entries(s).forEach(([c,d])=>i.setAttribute(c,d));const o=document.createElement("button");o.type="button";const a=c=>{this.options.renderToggleButton({element:o,...c})};i.append(o);const l=document.createElement("div");i.append(l);const u=c=>{const{setToValue:d,node:h=n}=c||{};if(d!==void 0)if(d){if(i.classList.contains(this.options.openClassName))return;i.classList.add(this.options.openClassName)}else{if(!i.classList.contains(this.options.openClassName))return;i.classList.remove(this.options.openClassName)}else i.classList.toggle(this.options.openClassName);const f=i.classList.contains(this.options.openClassName);a({isOpen:f,node:h});const p=new Event("toggleDetailsContent"),m=l.querySelector(':scope > div[data-type="detailsContent"]');m==null||m.dispatchEvent(p)};return a({isOpen:!!n.attrs.open,node:n}),n.attrs.open&&setTimeout(()=>u()),o.addEventListener("click",()=>{if(u(),!this.options.persist){t.commands.focus(void 0,{scrollIntoView:!1});return}if(t.isEditable&&typeof e=="function"){const{from:c,to:d}=t.state.selection;t.chain().command(({tr:h})=>{const f=e();if(!f)return!1;const p=h.doc.nodeAt(f);return(p==null?void 0:p.type)!==this.type?!1:(h.setNodeMarkup(f,void 0,{open:!p.attrs.open}),!0)}).setTextSelection({from:c,to:d}).focus(void 0,{scrollIntoView:!1}).run()}}),{dom:i,contentDOM:l,ignoreMutation(c){if(c.type==="selection")return!1;const d=c.target,h=i.contains(d);return o.contains(d)||!h||i===d},update:c=>c.type!==this.type?!1:(c.attrs.open!==void 0?u({setToValue:c.attrs.open,node:c}):a({isOpen:i.classList.contains(this.options.openClassName),node:c}),!0)}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var n;const{schema:r,selection:i}=t,{$from:s,$to:o}=i,a=s.blockRange(o);if(!a)return!1;const l=t.doc.slice(a.start,a.end);if(!r.nodes.detailsContent.contentMatch.matchFragment(l.content))return!1;const c=((n=l.toJSON())==null?void 0:n.content)||[];return e().insertContentAt({from:a.start,to:a.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:c}]}).setTextSelection(a.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{const{selection:n,schema:r}=t,i=io(y=>y.type===this.type)(n);if(!i)return!1;const s=$s(i.node,y=>y.type===r.nodes.detailsSummary),o=$s(i.node,y=>y.type===r.nodes.detailsContent);if(!s.length||!o.length)return!1;const a=s[0],l=o[0],u=i.pos,c=t.doc.resolve(u),d=u+i.node.nodeSize,h={from:u,to:d},f=l.node.content.toJSON()||[],p=c.parent.type.contentMatch.defaultType,g=[p==null?void 0:p.create(null,a.node.content).toJSON(),...f];return e().insertContentAt(h,g).setTextSelection(u+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{const{schema:t,selection:e}=this.editor.state,{empty:n,$anchor:r}=e;return!n||r.parent.type!==t.nodes.detailsSummary?!1:r.parentOffset!==0?this.editor.commands.command(({tr:i})=>{const s=r.pos-1,o=r.pos;return i.delete(s,o),!0}):this.editor.commands.unsetDetails()},Enter:({editor:t})=>{const{state:e,view:n}=t,{schema:r,selection:i}=e,{$head:s}=i;if(s.parent.type!==r.nodes.detailsSummary)return!1;const o=y0(s.after()+1,t),a=o?e.doc.nodeAt(s.after()):s.node(-2);if(!a)return!1;const l=o?0:s.indexAfter(-1),u=Om(a.contentMatchAt(l));if(!u||!a.canReplaceWith(l,l,u))return!1;const c=u.createAndFill();if(!c)return!1;const d=o?s.after()+1:s.after(-1),h=e.tr.replaceWith(d,d,c),f=h.doc.resolve(d),p=fe.near(f,1);return h.setSelection(p),h.scrollIntoView(),n.dispatch(h),!0},ArrowRight:({editor:t})=>a3(t,"right"),ArrowDown:({editor:t})=>a3(t,"down")}},addProseMirrorPlugins(){return[new _e({key:new Ae("detailsSelection"),appendTransaction:(t,e,n)=>{const{editor:r,type:i}=this;if(r.view.composing||!t.some(y=>y.selectionSet)||!e.selection.empty||!n.selection.empty||!O5(n,i.name))return;const{$from:l}=n.selection;if(y0(l.pos,r))return;const c=MV(l,y=>y.type===i,r);if(!c)return;const d=$s(c.node,y=>y.type===n.schema.nodes.detailsSummary);if(!d.length)return;const h=d[0],p=(e.selection.from<n.selection.from?"forward":"backward")==="forward"?c.start+h.pos:c.pos+h.pos+h.node.nodeSize,m=le.create(n.doc,p);return n.tr.setSelection(m)}})]}}),DV=Oe.create({name:"detailsContent",content:"block+",defining:!0,selectable:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["div",ze(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addNodeView(){return({HTMLAttributes:t})=>{const e=document.createElement("div"),n=ze(this.options.HTMLAttributes,t,{"data-type":this.name,hidden:"hidden"});return Object.entries(n).forEach(([r,i])=>e.setAttribute(r,i)),e.addEventListener("toggleDetailsContent",()=>{e.toggleAttribute("hidden")}),{dom:e,contentDOM:e,ignoreMutation(r){return r.type==="selection"?!1:!e.contains(r.target)||e===r.target},update:r=>r.type===this.type}}},addKeyboardShortcuts(){return{Enter:({editor:t})=>{const{state:e,view:n}=t,{selection:r}=e,{$from:i,empty:s}=r,o=io(ie=>ie.type===this.type)(r);if(!s||!o||!o.node.childCount)return!1;const a=i.index(o.depth),{childCount:l}=o.node;if(!(l===a+1))return!1;const c=o.node.type.contentMatch.defaultType,d=c==null?void 0:c.createAndFill();if(!d)return!1;const h=e.doc.resolve(o.pos+1),f=l-1,p=o.node.child(f),m=h.posAtIndex(f,o.depth);if(!p.eq(d))return!1;const y=i.node(-3);if(!y)return!1;const x=i.indexAfter(-3),k=Om(y.contentMatchAt(x));if(!k||!y.canReplaceWith(x,x,k))return!1;const C=k.createAndFill();if(!C)return!1;const{tr:_}=e,T=i.after(-2);_.replaceWith(T,T,C);const D=_.doc.resolve(T),I=fe.near(D,1);_.setSelection(I);const L=m,G=m+p.nodeSize;return _.delete(L,G),_.scrollIntoView(),n.dispatch(_),!0}}},...V0({nodeName:"detailsContent"})}),OV=Oe.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",ze(this.options.HTMLAttributes,t),0]},...V0({nodeName:"detailsSummary",content:"inline"})});const zw={serialize(){},parse:{}};function RV(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function IV(t){t.use(b0,"toggle",{validate:e=>/^toggle(\s+.*)?$/.test(e.trim()),render:(e,n)=>{const r=e[n];if(r.nesting===1){const i=r.info.trim().replace(/^toggle\s*/,"");return`<details><summary>${RV(i)||"Toggle"}</summary><div data-type="detailsContent">
638
+ `}return`</div></details>
639
+ `}})}const LV=NV.configure({persist:!0}).extend({addProseMirrorPlugins(){const t=this.type;return[new _e({props:{handleClick(e,n,r){if(r.detail>1)return!1;const i=e.state.doc.resolve(n);for(let s=i.depth;s>0;s--){if(i.node(s).type.name!=="detailsSummary")continue;const o=i.node(s-1);if(o.type!==t)return!1;const a=i.before(s-1);return e.dispatch(e.state.tr.setNodeMarkup(a,void 0,{...o.attrs,open:!o.attrs.open})),!0}return!1}}})]},addStorage(){return{markdown:{serialize(t,e){let n="",r=null;e.forEach(i=>{i.type.name==="detailsSummary"?n=i.textContent.replace(/\s*\n\s*/g," ").trim():i.type.name==="detailsContent"&&(r=i)}),t.write(`::: toggle ${n}
640
+ `),r&&t.renderContent(r),t.ensureNewLine(),t.write(":::"),t.closeBlock(e)},parse:{setup(t){IV(t)}}}}}}),zV=OV.extend({addStorage(){return{markdown:zw}}}),BV=DV.extend({addStorage(){return{markdown:zw}}}),FV=[LV,zV,BV],PV={serialize(){},parse:{}};function $V(t){const e=t;e.use(b0,"columns",{marker:":",validate:n=>/^columns\s*$/.test(n.trim()),render:(n,r)=>n[r].nesting===1?`<div data-columns>
641
+ `:`</div>
642
+ `}),e.use(b0,"column",{marker:":",validate:n=>/^column\s*$/.test(n.trim()),render:(n,r)=>n[r].nesting===1?`<div data-column>
643
+ `:`</div>
644
+ `})}const HV=Oe.create({name:"columns",group:"block",content:"column+",defining:!0,parseHTML(){return[{tag:"div[data-columns]"}]},renderHTML({HTMLAttributes:t}){return["div",ze(t,{"data-columns":"",class:"cn-columns"}),0]},addCommands(){return{insertColumns:(t=2)=>({commands:e})=>e.insertContent({type:this.name,content:Array.from({length:Math.max(2,t)},()=>({type:"column",content:[{type:"paragraph"}]}))})}},addStorage(){return{markdown:{serialize(t,e){t.write(`:::: columns
645
+ `),e.forEach(n=>{t.write(`::: column
646
+ `),t.renderContent(n),t.ensureNewLine(),t.write(`:::
647
+ `)}),t.write("::::"),t.closeBlock(e)},parse:{setup(t){$V(t)}}}}}}),UV=Oe.create({name:"column",content:"block+",isolating:!0,parseHTML(){return[{tag:"div[data-column]"}]},renderHTML({HTMLAttributes:t}){return["div",ze(t,{"data-column":"",class:"cn-column"}),0]},addStorage(){return{markdown:PV}}}),qV=[HV,UV];function jV({editor:t}){const[e,n]=B.useState(null),[r,i]=B.useState(null),[s,o]=B.useState(null),a=B.useRef(void 0);B.useEffect(()=>{const y=t.view.dom,x=k=>{const C=k.target.closest("table");C&&n(C)};return y.addEventListener("mousemove",x),()=>y.removeEventListener("mousemove",x)},[t]),B.useEffect(()=>{const y=x=>{if(s)return;const k=x.target;let _=!!k.closest("table")||!!k.closest("[data-table-control]");if(!_&&e){const T=e.getBoundingClientRect(),D=32;_=x.clientX>=T.left-D&&x.clientX<=T.right+D&&x.clientY>=T.top-D&&x.clientY<=T.bottom+D}window.clearTimeout(a.current),_||(a.current=window.setTimeout(()=>n(null),120))};return document.addEventListener("mousemove",y),()=>{document.removeEventListener("mousemove",y),window.clearTimeout(a.current)}},[s,e]);const l=B.useCallback(()=>{if(!e||!e.isConnected){i(null);return}const y=t.view.dom.parentElement,x=(y==null?void 0:y.getBoundingClientRect())??new DOMRect(0,0,9999,9999),k=e.getBoundingClientRect(),C=e.querySelector("tr"),_=Array.from(e.querySelectorAll("tr"));if(!C){i(null);return}const T=Array.from(C.children).map(I=>{const L=I.getBoundingClientRect();return{start:L.left,size:L.width,center:L.left+L.width/2}}),D=_.map(I=>{const L=I.getBoundingClientRect();return{start:L.top,size:L.height,center:L.top+L.height/2}});i({table:k,clip:x,cols:T,rows:D})},[e,t]);B.useEffect(()=>{l()},[l]),B.useEffect(()=>{if(!e)return;const y=()=>l();return window.addEventListener("scroll",y,!0),window.addEventListener("resize",y),t.on("update",y),()=>{window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y),t.off("update",y)}},[e,l,t]);const u=(y,x,k)=>{var G;if(!e)return;const C=e.querySelectorAll("tr"),_=C[y],T=_==null?void 0:_.children[x];if(!T)return;const D=t.view.posAtDOM(T,0);if(t.chain().focus().setTextSelection(D).run(),o(null),C.length*(((G=C[0])==null?void 0:G.children.length)??0)<=400){k(t),window.requestAnimationFrame(l);return}const L=$t.loading("Updating table…");window.requestAnimationFrame(()=>window.requestAnimationFrame(()=>{k(t),window.requestAnimationFrame(l),$t.dismiss(L)}))};if(!r||!(r.table.bottom>r.clip.top&&r.table.top<r.clip.bottom&&r.table.right>r.clip.left&&r.table.left<r.clip.right))return null;const d=y=>Math.max(r.clip.top,Math.min(r.clip.bottom,y)),h=y=>Math.max(r.clip.left,Math.min(r.clip.right,y)),f=r.table.bottom>=r.clip.top&&r.table.bottom+3<=r.clip.bottom,p=r.table.right>=r.clip.left&&r.table.right+3<=r.clip.right,m=Math.max(r.clip.top,r.table.top),g=Math.min(r.clip.bottom,r.table.bottom);return S.jsxs(S.Fragment,{children:[r.cols.map((y,x)=>{const k=Math.max(r.clip.left,y.start+1),C=Math.min(r.clip.right,y.start+y.size-1);return C<=k?null:S.jsx("button",{"data-table-control":!0,type:"button",title:"Column actions",onMouseDown:_=>_.preventDefault(),onClick:()=>o({kind:"col",index:x,x:h(y.center),y:r.table.top}),className:"fixed z-40 flex items-center justify-center rounded-sm bg-border/70 text-muted-foreground hover:bg-primary hover:text-primary-foreground",style:{left:k,top:d(r.table.top-12),width:C-k,height:9},children:S.jsx("span",{className:"text-[8px] leading-none",children:"⋯"})},`col-${x}`)}),r.rows.map((y,x)=>y.start+y.size<=r.clip.top||y.start>=r.clip.bottom?null:S.jsx("button",{"data-table-control":!0,type:"button",title:"Row actions",onMouseDown:k=>k.preventDefault(),onClick:()=>o({kind:"row",index:x,x:h(r.table.left),y:y.center}),className:"fixed z-40 flex items-center justify-center rounded-sm bg-border/70 text-muted-foreground hover:bg-primary hover:text-primary-foreground",style:{left:h(r.table.left-12),top:d(y.start+1),width:9,height:y.size-2},children:S.jsx("span",{className:"rotate-90 text-[8px] leading-none",children:"⋯"})},`row-${x}`)),p&&S.jsx("button",{"data-table-control":!0,type:"button",title:"Add column",onMouseDown:y=>y.preventDefault(),onClick:()=>u(0,r.cols.length-1,y=>y.chain().focus().addColumnAfter().run()),className:"fixed z-40 flex items-center justify-center rounded-sm bg-border/50 text-muted-foreground hover:bg-primary hover:text-primary-foreground",style:{left:r.table.right+3,top:m,width:14,height:g-m},children:S.jsx(q1,{className:"h-3 w-3"})}),f&&S.jsx("button",{"data-table-control":!0,type:"button",title:"Add row",onMouseDown:y=>y.preventDefault(),onClick:()=>u(r.rows.length-1,0,y=>y.chain().focus().addRowAfter().run()),className:"fixed z-40 flex items-center justify-center rounded-sm bg-border/50 text-muted-foreground hover:bg-primary hover:text-primary-foreground",style:{left:Math.max(r.clip.left,r.table.left),top:r.table.bottom+3,width:Math.min(r.clip.right,r.table.right)-Math.max(r.clip.left,r.table.left),height:14},children:S.jsx(q1,{className:"h-3 w-3"})}),s&&S.jsx("div",{"data-table-control":!0,className:"fixed z-50 min-w-40 overflow-hidden rounded-md border bg-popover py-1 text-popover-foreground shadow-md",style:{left:h(s.x),top:d(s.y)},onMouseDown:y=>y.preventDefault(),children:s.kind==="col"?S.jsxs(S.Fragment,{children:[S.jsxs(vo,{onClick:()=>u(0,s.index,y=>y.chain().focus().addColumnBefore().run()),children:[S.jsx(L7,{className:"h-3.5 w-3.5"})," Insert left"]}),S.jsxs(vo,{onClick:()=>u(0,s.index,y=>y.chain().focus().addColumnAfter().run()),children:[S.jsx(P7,{className:"h-3.5 w-3.5"})," Insert right"]}),S.jsxs(vo,{destructive:!0,onClick:()=>u(0,s.index,y=>y.chain().focus().deleteColumn().run()),children:[S.jsx(ef,{className:"h-3.5 w-3.5"})," Delete column"]})]}):S.jsxs(S.Fragment,{children:[S.jsxs(vo,{onClick:()=>u(s.index,0,y=>y.chain().focus().addRowBefore().run()),children:[S.jsx(H7,{className:"h-3.5 w-3.5"})," Insert above"]}),S.jsxs(vo,{onClick:()=>u(s.index,0,y=>y.chain().focus().addRowAfter().run()),children:[S.jsx(B7,{className:"h-3.5 w-3.5"})," Insert below"]}),S.jsxs(vo,{destructive:!0,onClick:()=>u(s.index,0,y=>y.chain().focus().deleteRow().run()),children:[S.jsx(ef,{className:"h-3.5 w-3.5"})," Delete row"]})]})}),s&&S.jsx("div",{className:"fixed inset-0 z-30",onMouseDown:()=>o(null)})]})}function vo({onClick:t,destructive:e,children:n}){return S.jsx("button",{type:"button",onMouseDown:r=>r.preventDefault(),onClick:t,className:Yn("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-sm hover:bg-muted",e&&"text-destructive"),children:n})}const Ru=/\[([ xX])\]/g,VV=Se.create({name:"taskCheckbox",addProseMirrorPlugins(){return[new _e({key:new Ae("taskCheckbox"),props:{decorations(t){const e=[],n=t.doc;return n.descendants((r,i,s)=>{if(!r.isText||!r.text||(s==null?void 0:s.type.name)==="codeBlock"||r.marks.some(l=>l.type.name==="code"))return;const o=r.text;let a;for(Ru.lastIndex=0;(a=Ru.exec(o))!==null;){const l=a[1]==="x"||a[1]==="X",u=i+a.index,c=u+a[0].length;e.push(Ge.inline(u,c,{class:`task-checkbox ${l?"task-checked":"task-unchecked"}`,"data-task-checked":l?"true":"false"}))}}),Le.create(n,e)},handleClick(t,e,n){const r=n.target;if(!r.classList.contains("task-checkbox"))return!1;const i=r.getAttribute("data-task-checked")==="true",{state:s}=t,{doc:o}=s;let a=!1;return o.descendants((l,u)=>{if(a||!l.isText||!l.text)return;const c=l.text;let d;for(Ru.lastIndex=0;(d=Ru.exec(c))!==null;){const h=u+d.index,f=h+d[0].length;if(e>=h&&e<=f){const p=i?"[ ]":"[x]",m=s.tr.replaceWith(h,f,s.schema.text(p));return t.dispatch(m),a=!0,!1}}}),a}}})]}});function WV(t){const e=document.createElement("video");return e.controls=!0,e.preload="metadata",e.className="cn-video-embed",e.src=t,e}function GV(t,e){const n=document.createElement("div");n.className="cn-video-embed cn-video-embed--iframe",n.contentEditable="false";const r=document.createElement("iframe");return r.src=t,r.title=e==="youtube"?"YouTube video":"Vimeo video",r.loading="lazy",r.allow="fullscreen; picture-in-picture; encrypted-media",r.allowFullscreen=!0,r.referrerPolicy="strict-origin-when-cross-origin",r.setAttribute("sandbox","allow-scripts allow-same-origin allow-presentation allow-popups"),n.appendChild(r),n}function KV(t){return t.kind==="asset"?{key:`video-asset:${t.src}`,toDOM:()=>WV(t.src)}:{key:`video-embed:${t.embedUrl}`,toDOM:()=>GV(t.embedUrl,t.provider)}}function YV(t,e){const n=(e.get(t)??0)+1;return e.set(t,n),n===1?t:`${t}#${n}`}function ZV(t){const e=[],n=new Map;return t.descendants((r,i)=>{if(r.type.name!=="paragraph"||r.childCount!==1)return;const s=r.firstChild;if(!(s!=null&&s.isText)||!s.text)return;const o=s.marks.find(f=>f.type.name==="link"),a=rc(s.text,o?o.attrs.href:void 0);if(!a)return;const l=i+1,u=l+s.nodeSize,{key:c,toDOM:d}=KV(a),h=YV(c,n);e.push(Ge.inline(l,u,{class:"video-url-hidden"})),e.push(Ge.widget(l,d,{side:-1,ignoreSelection:!0,key:h}))}),e}function JV(t,e){const n=t.resolve(e);if(n.parentOffset!==0)return null;const r=n.before(n.depth);if(r<=0)return null;const i=t.resolve(r).nodeBefore;if(!i||i.type.name!=="paragraph"||i.childCount!==1)return null;const s=i.firstChild;if(!(s!=null&&s.isText)||!s.text)return null;const o=s.marks.find(l=>l.type.name==="link");return rc(s.text,o?o.attrs.href:void 0)?{pos:r-i.nodeSize}:null}const XV=Se.create({name:"videoPreview",addProseMirrorPlugins(){return[new _e({key:new Ae("videoPreview"),props:{decorations(t){return Le.create(t.doc,ZV(t.doc))},handleKeyDown(t,e){if(e.key!=="Backspace")return!1;const{state:n}=t;if(!n.selection.empty)return!1;const r=JV(n.doc,n.selection.from);if(!r)return!1;const{$from:i}=n.selection,s=n.tr;return i.parent.content.size===0&&s.delete(i.before(),i.after()),s.setSelection(ue.create(s.doc,r.pos)),t.dispatch(s.scrollIntoView()),!0}}})]}}),Bw="image/png,image/jpeg,image/gif,image/webp,video/mp4,video/webm",Fw=/\.(png|jpe?g|gif|webp|mp4|webm)$/i,QV=/\.(mp4|webm)$/i,Pw=10*1024*1024,$w=30*1024*1024,l3=1024*1024,Hw=`PNG, JPG, GIF, WebP up to ${Pw/l3} MB · MP4, WebM up to ${$w/l3} MB`,eW="Start writing...",tW="Start writing… — drop in images or videos, or paste a YouTube link";function nW(t){const e=t.editable&&!t.previewing;return{upload:e&&t.canUpload,embed:e,dropOverlay:e&&t.canUpload}}function rW(t,e){return t!==void 0?t:e?tW:eW}function iW(t){return!!t&&Array.from(t).includes("Files")}const sW=new Set(Bw.split(","));function oW(t){if(!t)return!1;const e=Array.from(t).filter(n=>n.kind==="file");return e.length===0?!1:e.every(n=>n.type!==""&&!sW.has(n.type))}function aW(t){return`"${t}" isn't a supported image or video. ${Hw}`}function lW(t){if(!t)return null;for(const e of Array.from(t))if(Fw.test(e.name))return e;return null}function uW(t){const e=t.trim();if(!e)return{ok:!1,error:"Paste a YouTube or Vimeo link."};const n={ok:!1,error:"That isn't a YouTube or Vimeo video link."};if(/\s/.test(e))return n;const r=/^[a-z][a-z0-9+.-]*:/i.test(e)?e:`https://${e}`;return qy(r)?{ok:!0,url:r}:n}function cW(t){return t.canUpload&&t.editable&&!t.inCodeBlock&&!t.inTable}const u3=/(?:^|\s)@(?:\(([^)]+)\)|([a-zA-Z0-9._@-]+))/g;function dW(t){const e=[];u3.lastIndex=0;let n;for(;(n=u3.exec(t))!==null;){const r=n[0],i=n[1]!==void 0,s=n[1]??n[2]??"",o=r.startsWith(" ")||r.startsWith(`
648
+ `)?1:0,a=n.index+o,l=a+r.length-o,u=i?-1:s.indexOf("@"),c=u>0?a+1+u:l;e.push({start:a,end:l,localEnd:c,name:s})}return e}const hW=Se.create({name:"mention",addOptions(){return{onMentionClick:void 0,isMember:void 0}},addProseMirrorPlugins(){const{onMentionClick:t,isMember:e}=this.options;return[new _e({key:new Ae("mention"),props:{decorations(n){const r=[],i=n.doc;return i.descendants((s,o,a)=>{if(!s.isText||!s.text||(a==null?void 0:a.type.name)==="codeBlock"||s.marks.some(u=>u.type.name==="code"))return;const l=s.text;for(const u of dW(l)){const c=o+u.start,d=o+u.end,h=o+u.localEnd,f=!e||e(u.name),p={class:`mention ${f?"mention-user":"mention-unresolved"}`,"data-mention-name":u.name};f||(p.title=`No member named "${u.name}" in this nest`),r.push(Ge.inline(c,h,p)),h<d&&r.push(Ge.inline(h,d,{class:"mention-domain-hidden","aria-hidden":"true"}))}}),Le.create(i,r)},handleClick(n,r,i){const s=i.target;if(!s.classList.contains("mention"))return!1;const o=s.getAttribute("data-mention-name");return o&&t?(t(o),!0):!1}}})]}});function c3(t,e,n){const r=[];if(!e)return r;const i=n?e:e.toLowerCase();return t.descendants((s,o)=>{if(!s.isText||!s.text)return;const a=n?s.text:s.text.toLowerCase();let l=0;for(;(l=a.indexOf(i,l))!==-1;)r.push({from:o+l,to:o+l+i.length}),l+=i.length}),r}const fi=new Ae("searchReplace"),Uw={query:"",caseSensitive:!1,results:[],current:-1},fW=Se.create({name:"searchReplace",addProseMirrorPlugins(){return[new _e({key:fi,state:{init:()=>Uw,apply(t,e){const n=t.getMeta(fi);if(n){const r=n.query??e.query,i=n.caseSensitive??e.caseSensitive,s=c3(t.doc,r,i);let o=n.current??e.current;return o>=s.length&&(o=s.length?0:-1),o<0&&s.length&&(o=0),{query:r,caseSensitive:i,results:s,current:o}}if(t.docChanged&&e.query){const r=c3(t.doc,e.query,e.caseSensitive);let i=e.current;return i>=r.length&&(i=r.length?0:-1),{...e,results:r,current:i}}return e}},props:{decorations(t){const e=fi.getState(t);if(!e||e.results.length===0)return Le.empty;const n=e.results.map((r,i)=>Ge.inline(r.from,r.to,{class:i===e.current?"rounded bg-orange-300 dark:bg-orange-600":"rounded bg-yellow-200 dark:bg-yellow-700/60"}));return Le.create(t.doc,n)}}})]}});function cs(t){return fi.getState(t.state)??Uw}function pW(t,e,n=!1){t.view.dispatch(t.state.tr.setMeta(fi,{query:e,caseSensitive:n,current:0}));const r=cs(t);return qw(t,r.current),r}function d3(t,e){const n=cs(t);if(n.results.length===0)return n;let r=n.current+e;return r>=n.results.length&&(r=0),r<0&&(r=n.results.length-1),t.view.dispatch(t.state.tr.setMeta(fi,{current:r})),qw(t,r),cs(t)}function qw(t,e){const r=cs(t).results[e];r&&(t.commands.setTextSelection({from:r.from,to:r.to}),t.commands.scrollIntoView())}function mW(t,e){const n=cs(t),r=n.results[n.current];return r?(t.view.dispatch(t.state.tr.insertText(e,r.from,r.to).setMeta(fi,{current:n.current})),cs(t)):n}function gW(t,e){const n=cs(t);if(n.results.length===0)return n;let r=t.state.tr;for(let i=n.results.length-1;i>=0;i--){const s=n.results[i];r=r.insertText(e,s.from,s.to)}return r.setMeta(fi,{current:0}),t.view.dispatch(r),cs(t)}function bW(t){t.view.dispatch(t.state.tr.setMeta(fi,{query:"",current:-1}))}function Zh(t){const n=t.storage.markdown.getMarkdown();return kS(n.replace(/\\\[\\\[/g,"[[").replace(/\\\]\\\]/g,"]]").replace(/\\\[\^([^\]\\\s]+)\\?\]/g,"[^$1]"))}const jw=[1,2,3,4,5,6],yW={1:tf,2:nf,3:ek,4:nk,5:ik,6:ok};function h3(t){if(!t)return"";const e=t.lastIndexOf("/");return e>=0?t.slice(e+1):t}function vW(t){const{state:e}=t,{from:n,to:r}=e.selection;if(n===r||t.isActive("codeBlock")){t.chain().focus().toggleCodeBlock().run();return}const i=e.doc.textBetween(n,r,`
649
+ `,`
650
+ `);t.chain().focus().deleteRange({from:n,to:r}).insertContent(i?{type:"codeBlock",content:[{type:"text",text:i}]}:{type:"codeBlock"}).run()}function xW(t){const e=t.trim();if(!e)return{url:"",error:null};const n=i=>{try{return new URL(i)}catch{return null}},r=n(e)??n(`https://${e}`);return r?r.protocol==="javascript:"?{url:null,error:"javascript: links are not allowed."}:{url:r.toString(),error:null}:{url:null,error:"Enter a valid URL (e.g. https://example.com)."}}function f3(t,e){const n=(t||e).trim(),r=(e||t).trim();return n?`[[${n.startsWith("nodes/")?n:`nodes/${n}`}|${r}]] `:""}const iG=B.forwardRef(function({content:e,onChange:n,onSave:r,onBlur:i,nestId:s,currentNodeId:o,onRequestDocLink:a,onUploadImage:l,onWikiLinkClick:u,onMentionClick:c,placeholder:d,editable:h=!0,className:f,autofocus:p="end",variant:m="boxed",toolbarEnd:g},y){var pa,vs,jl;const[x,k]=B.useState(!1),C=m==="page",[_,T]=B.useState(""),D=g3(),I=h&&!x,{data:L}=j1({...xo.nodes(s??""),enabled:!!s&&x}),G=B.useCallback(R=>{const z=(L==null?void 0:L.nodes)??[],ne=Vy(z,R);return ne?{title:ne.title,snippet:$S(ne.content??"")}:null},[L]),ie=nW({editable:h,previewing:x,canUpload:!!l}),[oe,be]=B.useState(!1),[Y,te]=B.useState(null),[Te,St]=B.useState([]),ke=B.useRef([]),[ft,et]=B.useState(0),[Ze,tt]=B.useState(!1),it=B.useRef(Y),ir=B.useRef(Te);B.useEffect(()=>{it.current=Y},[Y]),B.useEffect(()=>{ir.current=Te},[Te]);const{data:Fn}=j1({...xo.collaborators(s??""),enabled:!!s&&I}),bn=B.useMemo(()=>((Fn==null?void 0:Fn.people)||[]).filter(R=>!!R.email).map(R=>({email:R.email,name:R.name})),[Fn]),yn=B.useRef(bn);B.useEffect(()=>{yn.current=bn},[bn]);const[sr,Pn]=B.useState(!1),[An,ki]=B.useState(""),[xr,wr]=B.useState(""),[$n,ms]=B.useState({current:0,total:0}),Re=B.useRef(()=>{}),[Ct,Tn]=B.useState(null),[Hn,or]=B.useState(!1),[Un,gs]=B.useState(null),Wr=B.useRef(null),qn=B.useRef(null),Gr=B.useRef(null),[ar,Ei]=B.useState({words:0,characters:0}),[kr,Si]=B.useState([]),[gd,Pl]=B.useState(!1),[bs,lo]=B.useState(null),uo=B.useRef(null),co=B.useRef(l);co.current=l;const[bd,$l]=B.useState(!1),ys=B.useRef(!1),ho=async(R,z,ne)=>{const ve=co.current;if(ve){if(ys.current){$t.error("An upload is already in progress — try again when it finishes.");return}ys.current=!0,$l(!0);try{await wW(R,z,ve,ne)}finally{ys.current=!1,$l(!1)}}},fo=B.useRef(ho);fo.current=ho;const F=YN({extensions:[cI.configure({heading:{levels:[...jw]},link:!1,codeBlock:!1}),lV,dI.configure({placeholder:rW(d,!!l)}),gR.configure({openOnClick:!0,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"},autolink:!0,linkOnPaste:!0}),mI,gI.configure({nested:!0}),pI.extend({addStorage(){return{markdown:{serialize:cq}}}}).configure({inline:!1,allowBase64:!1}),xI.configure({multicolor:!0}),Xv,Qv,WI,GI,GF.extend({addKeyboardShortcuts:()=>({})}).configure({key:"Mod"}),..._V,TV,...FV,...qV,Mq.configure({onWikiLinkClick:u,nestId:s,checkExists:s?async R=>{try{const{nodes:z}=await D.fetchQuery(xo.nodes(s)),ne=z,ve=R.toLowerCase(),Ie=h3(R).toLowerCase(),Fe=ne.find(xe=>xe.id.toLowerCase()===ve||xe.title.toLowerCase()===ve||h3(xe.id).toLowerCase()===Ie);return Fe?{exists:!0,id:Fe.id}:{exists:!1}}catch{return{exists:!1}}}:void 0}),VV,XV,hW.configure({onMentionClick:c,isMember:R=>yn.current.length===0||Sq(yn.current,R)}),fW,uq.configure({html:!0,tightLists:!0,bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!0,transformCopiedText:!0})],content:jg(e),editable:h,autofocus:p,immediatelyRender:!1,onUpdate:({editor:R,transaction:z})=>{if(!z.docChanged)return;const ne=Zh(R),ve=R.isEmpty||R.getText().trim().length===0;n(ve?"":ne)},editorProps:{attributes:{class:C?"prose dark:prose-invert max-w-none focus:outline-none min-h-[40vh] py-2":"prose prose-sm dark:prose-invert max-w-none focus:outline-none min-h-[300px] px-6 py-4"},handlePaste:(R,z)=>{const ne=uo.current;if(!ne||!z.clipboardData)return!1;const ve=lW(z.clipboardData.files);if(ve&&cW({canUpload:!!co.current,editable:ne.isEditable,inCodeBlock:ne.isActive("codeBlock"),inTable:ne.isActive("table")}))return z.preventDefault(),fo.current(ne,ve),!0;if(ne.isActive("codeBlock")||ne.isActive("table"))return!1;const Ie=z.clipboardData.getData("text/html");if(Ie&&/<table[\s>]/i.test(Ie))return!1;const Fe=z.clipboardData.getData("text/plain");if(!Fe)return!1;const xe=mq(Fe);return xe?Vw(ne,xe.rows,{text:Fe,delimiter:xe.delimiter}):!1},handleDrop:(R,z)=>{var Bt,_t;const ne=uo.current,ve=co.current,Ie=(Bt=z.dataTransfer)==null?void 0:Bt.files;if(!ne||!ve||!Ie||Ie.length===0||!ne.isEditable)return!1;const Fe=Ie[0];if(!Fw.test(Fe.name))return z.preventDefault(),$t.error(aW(Fe.name)),!0;z.preventDefault(),Ie.length>1&&$t("Only the first file was uploaded — drop one file at a time.");const xe=(_t=R.posAtCoords({left:z.clientX,top:z.clientY}))==null?void 0:_t.pos;return fo.current(ne,Fe,xe),!0},handleKeyDown:(R,z)=>{var Ie,Fe;const ne=it.current,ve=ir.current;if(ne&&ve.length>0){if(z.key==="ArrowDown")return z.preventDefault(),te(xe=>xe&&{...xe,selectedIdx:(xe.selectedIdx+1)%ve.length}),!0;if(z.key==="ArrowUp")return z.preventDefault(),te(xe=>xe&&{...xe,selectedIdx:(xe.selectedIdx-1+ve.length)%ve.length}),!0;if(z.key==="Enter"||z.key==="Tab"){z.preventDefault();const xe=ve[ne.selectedIdx];return xe&&((Ie=Er.current)==null||Ie.call(Er,xe)),!0}}return ne&&z.key==="Escape"?(z.preventDefault(),te(null),!0):(z.ctrlKey||z.metaKey)&&(z.key==="f"||z.key==="F")?(z.preventDefault(),(Fe=Re.current)==null||Fe.call(Re),!0):(z.ctrlKey||z.metaKey)&&z.key==="s"?(z.preventDefault(),r==null||r(),!0):!1}}});B.useEffect(()=>{uo.current=F},[F]),B.useEffect(()=>{F&&F.isEditable!==I&&F.setEditable(I,!1)},[F,I]);const Er=B.useRef(null);B.useEffect(()=>{Er.current=R=>{if(!F)return;const z=it.current;z&&(F.chain().focus().insertContentAt({from:z.from,to:z.to},R.insert).run(),te(null))}},[F]),B.useEffect(()=>{!F||F.isDestroyed||F.view.dispatch(F.state.tr)},[F,bn]),B.useEffect(()=>{if(!F)return;const R=()=>{if(!I){te(null);return}const{state:z,view:ne}=F,{selection:ve}=z;if(!ve.empty){te(null);return}const Ie=ve.$from,Fe=Ie.start(),xe=z.doc.textBetween(Math.max(Fe,Ie.pos-200),Ie.pos,`
651
+ `,""),Bt=kq(xe);if(!Bt){te(null);return}const{kind:_t,query:jn}=Bt,U=Ie.pos-Bt.length,se=ne.coordsAtPos(Ie.pos);te(Ee=>({kind:_t,query:jn,from:U,to:Ie.pos,coords:{left:se.left,top:se.top,bottom:se.bottom},selectedIdx:Ee&&Ee.kind===_t&&Ee.query===jn?Ee.selectedIdx:0}))};return F.on("selectionUpdate",R),F.on("update",R),()=>{F.off("selectionUpdate",R),F.off("update",R)}},[F,I]);const Kr=(Y==null?void 0:Y.kind)==="wiki";B.useEffect(()=>{if(!Kr||!s)return;let R=!1;return tt(!0),(async()=>{try{const z=await D.fetchQuery(xo.nodes(s));if(R)return;ke.current=z.nodes||[],et(ne=>ne+1)}catch{}finally{R||tt(!1)}})(),()=>{R=!0}},[Kr,s]);const N=(jl=(vs=(pa=b7().adminStatus)==null?void 0:pa.me)==null?void 0:vs.email)==null?void 0:jl.toLowerCase();B.useEffect(()=>{if(!Y){St([]);return}if(Y.kind==="mention"){St(Eq(bn.filter(z=>z.email.toLowerCase()!==N),Y.query).map(z=>({key:z.email,primary:z.name||z.email.split("@")[0],secondary:z.email,insert:`@${z.email} `})));return}const R=Y.query.trim().toLowerCase();St(ke.current.filter(z=>z.id!==o).filter(z=>!R||z.title.toLowerCase().includes(R)).slice(0,8).map(z=>({key:z.id,primary:z.title,secondary:z.id,insert:f3(z.id,z.title)})))},[Y==null?void 0:Y.kind,Y==null?void 0:Y.query,o,ft,bn,N]),B.useEffect(()=>{F&&(F.isFocused||e!==Zh(F)&&F.commands.setContent(jg(e),{emitUpdate:!1}))},[e,F]),B.useImperativeHandle(y,()=>({insertWikiLink:(R,z)=>{F&&F.chain().focus().insertContent(f3(R,z)).run()},focus:()=>{F==null||F.chain().focus("start").run()}}),[F]),B.useEffect(()=>{Re.current=()=>Pn(!0)},[]),B.useEffect(()=>()=>_q(s),[s]),B.useEffect(()=>{if(!F)return;const R=F.view.dom,z=()=>{R.dispatchEvent(new DragEvent("dragleave",{bubbles:!1})),document.querySelectorAll(".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline").forEach(ne=>{ne.style.height="0",ne.style.width="0"})};return document.addEventListener("dragend",z),document.addEventListener("drop",z),()=>{document.removeEventListener("dragend",z),document.removeEventListener("drop",z)}},[F]),B.useEffect(()=>{if(!F)return;const R=()=>{var ve,Ie;const z=F.storage.characterCount;Ei({words:((ve=z==null?void 0:z.words)==null?void 0:ve.call(z))??0,characters:((Ie=z==null?void 0:z.characters)==null?void 0:Ie.call(z))??0});const ne=[];F.state.doc.descendants((Fe,xe)=>{Fe.type.name==="heading"&&ne.push({level:Fe.attrs.level,text:Fe.textContent||"Untitled",pos:xe})}),Si(ne)};return R(),F.on("update",R),()=>{F.off("update",R)}},[F]),B.useEffect(()=>{if(!F||!s)return;const R=F.view.dom;let z,ne=null;const ve=Fe=>{const xe=Fe.target.closest(".wiki-link");if(!xe||xe===ne)return;ne=xe;const Bt=xe.getAttribute("data-wiki-id"),_t=xe.getAttribute("data-wiki-display")||xe.getAttribute("data-wiki-title")||"",jn=xe.getBoundingClientRect();window.clearTimeout(z),z=window.setTimeout(async()=>{if(!Bt){lo({title:_t,excerpt:"Not found in this nest yet.",left:jn.left,top:jn.bottom+6});return}try{const{node:U}=await D.fetchQuery({...xo.node(s,Bt),staleTime:3e4}),se=((U==null?void 0:U.content)||"").replace(/```[\s\S]*?```/g,"").replace(/[#>*`_~|-]/g,"").replace(/\n{2,}/g,`
652
+ `).trim();lo({title:(U==null?void 0:U.title)||_t,excerpt:se.slice(0,280)||"(empty document)",left:jn.left,top:jn.bottom+6})}catch{lo(null)}},350)},Ie=Fe=>{Fe.target.closest(".wiki-link")&&(ne=null,window.clearTimeout(z),z=window.setTimeout(()=>lo(null),150))};return R.addEventListener("mouseover",ve),R.addEventListener("mouseout",Ie),()=>{R.removeEventListener("mouseover",ve),R.removeEventListener("mouseout",Ie),window.clearTimeout(z)}},[F,s]);const $=R=>{F&&(F.chain().focus().setTextSelection(R+1).scrollIntoView().run(),Pl(!1))},J=B.useRef(i);B.useEffect(()=>{J.current=i},[i]),B.useEffect(()=>{if(!F)return;const R=()=>{var z;return(z=J.current)==null?void 0:z.call(J)};return F.on("blur",R),()=>{F.off("blur",R)}},[F]),B.useEffect(()=>{if(!F)return;const R=({transaction:z})=>{z.docChanged&&Tn(ne=>ne&&{pos:z.mapping.map(ne.pos)})};return F.on("transaction",R),()=>{F.off("transaction",R)}},[F]),B.useEffect(()=>{if(!Hn)return;const R=()=>{or(!1),gs(null)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[Hn]);const pe=()=>{or(!1),gs(null)};B.useLayoutEffect(()=>{if(!Hn||!Un)return;const R=Wr.current;if(!R)return;const z=8,{offsetHeight:ne,offsetWidth:ve}=R,Ie=window.innerHeight,Fe=window.innerWidth;let xe=Un.top;if(xe+ne>Ie-z){const _t=Un.anchorTop-ne-4;xe=_t>=z?_t:Math.max(z,Ie-ne-z)}let Bt=Un.left;Bt+ve>Fe-z&&(Bt=Math.max(z,Fe-ve-z)),R.style.top=`${xe}px`,R.style.left=`${Bt}px`,R.style.maxHeight=`${Ie-z*2}px`,R.style.overflowY="auto"},[Hn,Un]);const at=R=>(F==null?void 0:F.state.doc.nodeAt(R))??null,pt=()=>{if(!F||!Ct)return;const R=at(Ct.pos);R&&(F.chain().focus().insertContentAt(Ct.pos+R.nodeSize,R.toJSON()).run(),pe())},ae=()=>{if(!F||!Ct)return;const R=at(Ct.pos);if(!R)return;const z=Ct.pos,ne=z+R.nodeSize;pe();const ve=()=>F.chain().focus().deleteRange({from:z,to:ne}).run();if(!(R.type.name==="image"||R.type.name==="table"||R.type.name==="codeBlock"||R.nodeSize>400)){ve();return}const Fe=$t.loading("Deleting…");requestAnimationFrame(()=>requestAnimationFrame(()=>{ve(),$t.success("Deleted.",{id:Fe})}))},X=R=>{if(!F||!Ct)return;const z=F.chain().focus().setTextSelection(Ct.pos+1);R(z),pe()},me=()=>{if(!F||!Ct)return;const R=F.state.doc.nodeAt(Ct.pos);if(!R)return;const z=Ct.pos,ne=z+R.nodeSize,ve=R.textContent;F.chain().focus().insertContentAt({from:z,to:ne},{type:"details",attrs:{open:!0},content:[{type:"detailsSummary",...ve?{content:[{type:"text",text:ve}]}:{}},{type:"detailsContent",content:[{type:"paragraph"}]}]}).run(),pe()},lt=R=>ms({current:R.results.length?R.current+1:0,total:R.results.length});B.useEffect(()=>{if(F){if(!sr){bW(F);return}lt(pW(F,An))}},[F,sr,An]);const mt=()=>F&&lt(d3(F,1)),Ci=()=>F&&lt(d3(F,-1)),ha=()=>{F&&lt(mW(F,xr))},fa=()=>{F&&lt(gW(F,xr))},Hl=()=>Pn(!1),[Yr,_i]=B.useState({open:!1,url:"",error:null}),Ul=()=>{if(!F)return;const R=F.getAttributes("link").href??"";_i({open:!0,url:R,error:null})},ql=()=>{if(!F)return;const R=xW(Yr.url);if(R.url===null){_i(ne=>({...ne,error:R.error}));return}const z=F.chain().focus().extendMarkRange("link");R.url===""?z.unsetLink().run():z.setLink({href:R.url}).run(),_i({open:!1,url:"",error:null})};return F?S.jsxs("div",{ref:qn,className:Yn("relative",C?"":"border rounded-lg bg-background shadow-sm",f),"data-variant":m,onDragOver:R=>{var z,ne;if(ie.dropOverlay&&iW((z=R.dataTransfer)==null?void 0:z.types)){const ve=!oW((ne=R.dataTransfer)==null?void 0:ne.items);oe!==ve&&be(ve)}},onDragLeave:R=>{const z=R.relatedTarget;(!z||!R.currentTarget.contains(z))&&be(!1)},onDropCapture:()=>be(!1),children:[ie.dropOverlay&&oe&&S.jsx("div",{className:"pointer-events-none absolute inset-0 z-30 flex items-center justify-center rounded-lg border-2 border-dashed border-primary/60 bg-background/80","data-testid":"markdown-editor-drop-overlay",children:S.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[S.jsx(O3,{className:"h-4 w-4"}),"Drop to add an image or video"]})}),h&&S.jsx("div",{className:Yn("sticky z-20 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/75",C?"top-14 -mx-2 mb-3 rounded-md border shadow-sm":"top-0 border-b"),"data-testid":"markdown-editor-toolbar",children:S.jsx(kW,{editor:F,onLink:Ul,onRequestDocLink:a,onMediaFile:ie.upload?R=>void ho(F,R):void 0,canEmbed:ie.embed,uploading:bd,previewing:x,onTogglePreview:()=>k(R=>(!R&&F&&T(Zh(F)),!R)),end:g})}),h&&sr&&S.jsxs("div",{className:Yn("sticky z-30 flex flex-wrap items-center gap-1 border-b bg-background/95 px-2 py-1 backdrop-blur",C?"top-[6.75rem]":"top-0"),children:[S.jsx(b3,{className:"h-3.5 w-3.5 text-muted-foreground"}),S.jsx(Na,{autoFocus:!0,value:An,onChange:R=>ki(R.target.value),onKeyDown:R=>{R.key==="Escape"&&(R.preventDefault(),Hl()),R.key==="Enter"&&(R.preventDefault(),R.shiftKey?Ci():mt())},placeholder:"Find",className:"h-7 w-40"}),S.jsx("span",{className:"w-14 text-center text-xs text-muted-foreground tabular-nums",children:$n.total?`${$n.current}/${$n.total}`:"0/0"}),S.jsx(je,{onClick:Ci,title:"Previous (Shift+Enter)",children:S.jsx(y7,{className:"h-3.5 w-3.5"})}),S.jsx(je,{onClick:mt,title:"Next (Enter)",children:S.jsx(p3,{className:"h-3.5 w-3.5"})}),S.jsx(Na,{value:xr,onChange:R=>wr(R.target.value),placeholder:"Replace",className:"h-7 w-40"}),S.jsx(Xn,{type:"button",variant:"ghost",size:"sm",className:"h-7",onMouseDown:R=>R.preventDefault(),onClick:ha,children:"Replace"}),S.jsx(Xn,{type:"button",variant:"ghost",size:"sm",className:"h-7",onMouseDown:R=>R.preventDefault(),onClick:fa,children:"All"}),S.jsx(je,{onClick:Hl,title:"Close (Esc)",children:S.jsx(K1,{className:"h-3.5 w-3.5"})})]}),h&&!x&&S.jsxs(bO,{editor:F,options:{flip:{boundary:(C?void 0:Gr.current)??void 0,padding:8},shift:{boundary:(C?void 0:Gr.current)??void 0,padding:8}},className:"z-50 flex items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",children:[S.jsx(je,{active:F.isActive("bold"),onClick:()=>F.chain().focus().toggleBold().run(),title:"Bold (Ctrl+B)",children:S.jsx(N3,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:F.isActive("italic"),onClick:()=>F.chain().focus().toggleItalic().run(),title:"Italic (Ctrl+I)",children:S.jsx(R3,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:F.isActive("strike"),onClick:()=>F.chain().focus().toggleStrike().run(),title:"Strikethrough",children:S.jsx(L3,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:F.isActive("code"),onClick:()=>F.chain().focus().toggleCode().run(),title:"Inline code",children:S.jsx(D3,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:F.isActive("link"),onClick:Ul,title:"Link",children:S.jsx(I3,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:F.isActive("highlight"),onClick:()=>F.chain().focus().toggleHighlight().run(),title:"Highlight (==text==)",children:S.jsx(lk,{className:"h-3.5 w-3.5"})}),S.jsx(Ns,{}),["#ef4444","#f59e0b","#10b981","#3b82f6","#8b5cf6"].map(R=>S.jsx("button",{type:"button",title:`Text color ${R}`,onMouseDown:z=>z.preventDefault(),onClick:()=>{const{to:z}=F.state.selection;F.chain().focus().setColor(R).setTextSelection(z).run()},className:"m-0.5 h-4 w-4 rounded-full border border-border",style:{backgroundColor:R}},R)),S.jsx(je,{onClick:()=>F.chain().focus().unsetColor().run(),title:"Clear color",children:S.jsx(K1,{className:"h-3.5 w-3.5"})}),S.jsx(Ns,{}),S.jsx(je,{active:F.isActive("heading",{level:1}),onClick:()=>F.chain().focus().toggleHeading({level:1}).run(),title:"Turn into Heading 1",children:S.jsx(tf,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:F.isActive("heading",{level:2}),onClick:()=>F.chain().focus().toggleHeading({level:2}).run(),title:"Turn into Heading 2",children:S.jsx(nf,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:F.isActive("bulletList"),onClick:()=>F.chain().focus().toggleBulletList().run(),title:"Turn into bullet list",children:S.jsx(Lu,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:F.isActive("blockquote"),onClick:()=>F.chain().focus().toggleBlockquote().run(),title:"Turn into quote",children:S.jsx(rf,{className:"h-3.5 w-3.5"})})]}),x&&S.jsx(WS,{content:_,onWikiLinkClick:(R,z)=>u==null?void 0:u(R,null,z),previewFor:s?G:void 0}),S.jsx(tv,{ref:Gr,editor:F,className:Yn(C?"min-h-[40vh]":"min-h-[60vh] max-h-[60vh] overflow-y-auto",x&&"hidden"),onMouseDown:R=>{if(!I)return;const z=F.view.dom;R.clientY<=z.getBoundingClientRect().bottom||(R.preventDefault(),F.chain().focus().setTextSelection(F.state.doc.content.size).run())},"data-testid":"markdown-editor-content"}),I&&S.jsx(jV,{editor:F}),h&&S.jsxs("div",{className:Yn("flex items-center gap-3 py-1 text-xs text-muted-foreground",C?"mt-4 opacity-60 hover:opacity-100":"border-t px-3"),children:[S.jsxs("button",{type:"button",onMouseDown:R=>R.preventDefault(),onClick:()=>Pl(R=>!R),className:"flex items-center gap-1 rounded px-1 hover:bg-muted hover:text-foreground",title:"Document outline",children:[S.jsx(Lu,{className:"h-3.5 w-3.5"}),"Outline"]}),S.jsxs("span",{className:"ml-auto tabular-nums",children:[ar.words," words · ",ar.characters," chars"]})]}),h&&gd&&S.jsxs("div",{className:"absolute bottom-9 right-3 z-40 max-h-72 w-64 overflow-y-auto rounded-md border bg-popover py-1 text-popover-foreground shadow-md",onMouseDown:R=>R.preventDefault(),children:[S.jsx("div",{className:"border-b px-3 py-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:"Outline"}),kr.length===0?S.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No headings yet."}):S.jsx("ul",{className:"py-1",children:kr.map((R,z)=>S.jsx("li",{children:S.jsx("button",{type:"button",onClick:()=>$(R.pos),className:"block w-full truncate px-3 py-1 text-left text-sm hover:bg-muted",style:{paddingLeft:12+(R.level-1)*12},title:R.text,children:R.text})},`${R.pos}-${z}`))})]}),bs&&S.jsxs("div",{className:"fixed z-50 w-72 rounded-md border bg-popover p-3 text-popover-foreground shadow-md",style:{left:bs.left,top:bs.top},children:[S.jsx("div",{className:"mb-1 truncate text-sm font-medium",children:bs.title}),S.jsx("div",{className:"line-clamp-4 whitespace-pre-wrap text-xs text-muted-foreground",children:bs.excerpt})]}),Y&&(()=>{const{left:Ie,top:Fe,bottom:xe}=Y.coords,Bt=Y.kind==="mention",_t=window.innerHeight-xe,jn=Fe,U=_t<260&&jn>_t,se=Math.max(8,Math.min(Ie,window.innerWidth-288-8)),Ee=U?{left:se,bottom:window.innerHeight-Fe+4,maxHeight:jn-4-8}:{left:se,top:xe+4,maxHeight:_t-4-8};return S.jsxs("div",{className:"fixed z-50 w-72 overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md",style:Ee,onMouseDown:Pe=>Pe.preventDefault(),children:[S.jsx("div",{className:"px-2 py-1 text-[10px] uppercase tracking-wider text-muted-foreground border-b",children:Bt?"Mention a person":"Link a document"}),Te.length===0?S.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:Bt?Y.query.trim()?`Nobody on this nest matches “${Y.query.trim()}”.`:"Nobody to mention yet — share the nest to add people.":Ze?"Loading documents…":Y.query.trim()?`No documents match “${Y.query.trim()}”.`:"No documents to link yet."}):S.jsx("ul",{className:"py-1",children:Te.map((Pe,kt)=>S.jsx("li",{children:S.jsxs("button",{type:"button",className:Yn("w-full text-left px-3 py-1.5 text-sm hover:bg-muted",kt===Y.selectedIdx&&"bg-muted"),onClick:()=>{var vn;return(vn=Er.current)==null?void 0:vn.call(Er,Pe)},children:[S.jsx("div",{className:"truncate font-medium",children:Pe.primary}),S.jsx("div",{className:"truncate text-xs text-muted-foreground",children:Pe.secondary})]})},Pe.key))})]})})(),I&&S.jsx(hP,{editor:F,onNodeChange:({node:R,pos:z})=>Tn(R?{pos:z}:null),children:S.jsx("button",{type:"button",title:"Drag to move · click for actions","data-block-handle":!0,className:"flex h-6 w-5 cursor-grab items-center justify-center rounded text-muted-foreground/70 hover:bg-muted hover:text-foreground active:cursor-grabbing",onMouseDown:R=>R.stopPropagation(),onClick:R=>{const z=R.currentTarget.getBoundingClientRect();gs({top:z.bottom+2,left:z.left,anchorTop:z.top}),or(ne=>!ne)},children:S.jsx(C7,{className:"h-4 w-4"})})}),I&&Hn&&Un&&S.jsxs("div",{ref:Wr,"data-block-handle":!0,className:"fixed z-50 min-w-44 select-none overflow-hidden rounded-md border bg-popover py-1 text-popover-foreground shadow-md",style:{top:Un.top,left:Un.left},onMouseDown:R=>{R.preventDefault(),R.stopPropagation()},children:[S.jsx("div",{className:"px-3 pb-1 pt-0.5 text-[10px] uppercase tracking-wider text-muted-foreground",children:"Turn into"}),S.jsxs(Ar,{onClick:()=>X(R=>R.setParagraph().run()),children:[S.jsx($p,{className:"h-3.5 w-3.5"})," Text"]}),S.jsxs(Ar,{onClick:()=>X(R=>R.toggleHeading({level:1}).run()),children:[S.jsx(tf,{className:"h-3.5 w-3.5"})," Heading 1"]}),S.jsxs(Ar,{onClick:()=>X(R=>R.toggleHeading({level:2}).run()),children:[S.jsx(nf,{className:"h-3.5 w-3.5"})," Heading 2"]}),S.jsxs(Ar,{onClick:()=>X(R=>R.toggleBulletList().run()),children:[S.jsx(Lu,{className:"h-3.5 w-3.5"})," Bullet list"]}),S.jsxs(Ar,{onClick:()=>X(R=>R.toggleBlockquote().run()),children:[S.jsx(rf,{className:"h-3.5 w-3.5"})," Quote"]}),S.jsxs(Ar,{onClick:()=>X(R=>R.toggleCallout("info").run()),children:[S.jsx(v7,{className:"h-3.5 w-3.5"})," Callout"]}),S.jsxs(Ar,{onClick:me,children:[S.jsx(x7,{className:"h-3.5 w-3.5"})," Toggle"]}),S.jsxs(Ar,{onClick:()=>X(R=>R.insertColumns(2).run()),children:[S.jsx(V7,{className:"h-3.5 w-3.5"})," Columns"]}),S.jsx("div",{className:"my-1 h-px bg-border"}),S.jsxs(Ar,{onClick:pt,children:[S.jsx(w7,{className:"h-3.5 w-3.5"})," Duplicate"]}),S.jsxs(Ar,{onClick:ae,destructive:!0,children:[S.jsx(ef,{className:"h-3.5 w-3.5"})," Delete"]})]}),S.jsx(Lp,{open:Yr.open,onOpenChange:R=>_i(z=>({...z,open:R,error:R?z.error:null})),children:S.jsxs(zp,{className:"sm:max-w-[440px]",children:[S.jsxs(Bp,{children:[S.jsx(Fp,{children:"Insert link"}),S.jsxs(Pp,{children:["Paste a URL. Bare domains get ",S.jsx("code",{children:"https://"})," added automatically. Leave blank to remove the link."]})]}),S.jsxs("div",{className:"space-y-2 py-1",children:[S.jsx(T3,{htmlFor:"link-url",className:"text-xs",children:"URL"}),S.jsx(Na,{id:"link-url",autoFocus:!0,placeholder:"https://example.com",value:Yr.url,onChange:R=>_i(z=>({...z,url:R.target.value,error:null})),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),ql())}}),Yr.error&&S.jsx("p",{className:"text-xs text-destructive",children:Yr.error})]}),S.jsxs(M3,{children:[S.jsx(Xn,{variant:"outline",onClick:()=>_i({open:!1,url:"",error:null}),children:"Cancel"}),S.jsx(Xn,{onClick:ql,children:"Apply"})]})]})})]}):C?S.jsx("div",{className:"animate-pulse bg-muted/20 h-[40vh] rounded-md"}):S.jsxs("div",{className:"border rounded-lg bg-background shadow-sm",children:[S.jsx("div",{className:"h-12 bg-muted/40 rounded-t-lg border-b"}),S.jsx("div",{className:"animate-pulse bg-muted/20 h-[300px] rounded-b-lg"})]})});function Ar({onClick:t,destructive:e,children:n}){return S.jsx("button",{type:"button",className:Yn("flex w-full cursor-pointer items-center gap-2 px-3 py-1.5 text-sm hover:bg-muted",e&&"text-destructive"),onClick:t,children:n})}function Vw(t,e,n){const r=I1(e),i=e.length-(r?1:0),s=o=>t.chain().focus().insertContent(lw(e,{hasHeader:o})).run();if(i>dq){const o=n.delimiter===" "?"tsv":"csv",a="```"+o+`
653
+ `+n.text.trim()+"\n```";return t.chain().focus().insertContent(a).run(),$t(`${i.toLocaleString()} rows kept as a ${o.toUpperCase()} code block — a live table this large slows the editor.`,{action:{label:"Insert as table anyway",onClick:()=>{t.chain().focus().undo().run(),s(r)}}}),!0}return s(r),$t("Table inserted.",{action:{label:r?"First row is data":"First row is header",onClick:()=>{t.chain().focus().undo().run(),s(!r)}}}),!0}async function wW(t,e,n,r){const i=QV.test(e.name),s=i?"video":"image",o=i?$w:Pw;if(e.size>o){$t.error(`That ${s} is ${(e.size/(1024*1024)).toFixed(1)} MB — the limit is ${o/(1024*1024)} MB.`);return}const a=$t.loading(`Uploading ${s}… (${(e.size/(1024*1024)).toFixed(1)} MB)`);try{const l=await n(e);let u=t.chain().focus();r!==void 0&&(u=u.setTextSelection(r)),i?u.insertContent({type:"paragraph",content:[{type:"text",text:l}]}).run():u.setImage({src:l,alt:e.name.replace(/\.[^.]+$/,"")}).run(),$t.success(`${i?"Video":"Image"} uploaded.`,{id:a})}catch(l){$t.error((l==null?void 0:l.message)||`${s} upload failed`,{id:a})}}function kW({editor:t,onLink:e,onRequestDocLink:n,onMediaFile:r,canEmbed:i,uploading:s,previewing:o,onTogglePreview:a,end:l}){const u=EO(),c=B.useRef(null),d=()=>{var k;return(k=c.current)==null?void 0:k.click()},h=async k=>{var D;const C=(D=k.target.files)==null?void 0:D[0];if(k.target.value="",!C)return;const _=$t.loading("Processing file…");await new Promise(I=>requestAnimationFrame(()=>requestAnimationFrame(()=>I(null))));const T=await bq(C);if(!T.ok){$t.error(yq(T.error,C),{id:_});return}$t.dismiss(_),Vw(t,T.rows,{text:T.text,delimiter:T.delimiter})},f=B.useRef(null),p=()=>{var k;return(k=f.current)==null?void 0:k.click()},m=k=>{var _;const C=(_=k.target.files)==null?void 0:_[0];k.target.value="",C&&(r==null||r(C))},[g,y]=B.useState({open:!1,url:"",error:null}),x=()=>{const k=uW(g.url);if(!k.ok){y(C=>({...C,error:k.error}));return}t.chain().focus().insertContent({type:"paragraph",content:[{type:"text",text:k.url}]}).run(),y({open:!1,url:"",error:null})};return o?S.jsxs("div",{className:"flex items-center gap-0.5 p-1 flex-wrap",role:"toolbar","aria-label":"Editor",children:[S.jsx(je,{active:!0,onClick:a,title:"Back to editing",label:"Edit",children:S.jsx(k7,{className:"h-3.5 w-3.5"})}),S.jsx("span",{className:"text-xs text-muted-foreground px-2",children:"Preview — read-only"})]}):S.jsxs("div",{className:"flex items-center gap-0.5 p-1 flex-wrap",role:"toolbar","aria-label":"Formatting",...u,children:[S.jsx(je,{active:t.isActive("bold"),onClick:()=>t.chain().focus().toggleBold().run(),title:"Bold (Ctrl+B)",children:S.jsx(N3,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:t.isActive("italic"),onClick:()=>t.chain().focus().toggleItalic().run(),title:"Italic (Ctrl+I)",children:S.jsx(R3,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:t.isActive("strike"),onClick:()=>t.chain().focus().toggleStrike().run(),title:"Strikethrough",children:S.jsx(L3,{className:"h-3.5 w-3.5"})}),S.jsx(Ns,{}),jw.map(k=>{const C=yW[k];return S.jsx(je,{active:t.isActive("heading",{level:k}),onClick:()=>t.chain().focus().toggleHeading({level:k}).run(),title:`Heading ${k}`,children:S.jsx(C,{className:"h-3.5 w-3.5"})},k)}),S.jsx(Ns,{}),S.jsx(je,{active:t.isActive("bulletList"),onClick:()=>t.chain().focus().toggleBulletList().run(),title:"Bullet list",children:S.jsx(Lu,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:t.isActive("orderedList"),onClick:()=>t.chain().focus().toggleOrderedList().run(),title:"Numbered list",children:S.jsx(fk,{className:"h-3.5 w-3.5"})}),S.jsx(je,{onClick:()=>t.chain().focus().insertContent("[ ] ").run(),title:"Insert task ([ ])",children:S.jsx(xk,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:t.isActive("blockquote"),onClick:()=>t.chain().focus().toggleBlockquote().run(),title:"Quote",children:S.jsx(rf,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:t.isActive("codeBlock"),onClick:()=>vW(t),title:"Code block",children:S.jsx(D3,{className:"h-3.5 w-3.5"})}),S.jsx(je,{active:t.isActive("table"),onClick:()=>t.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),title:"Insert table",children:S.jsx(Ck,{className:"h-3.5 w-3.5"})}),(r||i)&&S.jsxs(Jh,{children:[S.jsx(Xh,{asChild:!0,children:S.jsxs(Xn,{type:"button",variant:"ghost",size:"sm",title:"Add an image or video",onMouseDown:k=>k.preventDefault(),className:"h-7 gap-1 px-2",disabled:s,"data-testid":"markdown-editor-media-button",children:[S.jsx(O3,{className:"h-3.5 w-3.5"}),S.jsx("span",{className:"hidden text-xs sm:inline",children:"Image / video"})]})}),S.jsxs(Qh,{align:"start",children:[r&&S.jsxs(Iu,{onSelect:p,className:"items-start",children:[S.jsx(sf,{className:"mr-2 mt-0.5 h-4 w-4"}),S.jsxs("span",{className:"flex flex-col",children:[S.jsx("span",{children:"Upload image or video"}),S.jsx("span",{className:"text-xs text-muted-foreground",children:Hw})]})]}),i&&S.jsxs(Iu,{onSelect:()=>y({open:!0,url:"",error:null}),children:[S.jsx(Dk,{className:"mr-2 h-4 w-4"}),"Embed YouTube or Vimeo link"]})]})]}),S.jsxs(Jh,{children:[S.jsx(Xh,{asChild:!0,children:S.jsx(Xn,{type:"button",variant:"ghost",size:"sm",title:"Upload a file",onMouseDown:k=>k.preventDefault(),className:"h-7 w-7 p-0",disabled:s,children:S.jsx(sf,{className:"h-3.5 w-3.5"})})}),S.jsx(Qh,{align:"start",children:S.jsxs(Iu,{onSelect:d,children:[S.jsx(Y7,{className:"mr-2 h-4 w-4"}),"Table from CSV / TSV"]})})]}),S.jsx("input",{ref:c,type:"file",accept:".csv,.tsv,text/csv,text/tab-separated-values",className:"hidden",onChange:h}),r&&S.jsx("input",{ref:f,type:"file",accept:Bw,className:"hidden",onChange:m}),S.jsx(Lp,{open:g.open,onOpenChange:k=>y(C=>k?C:{open:!1,url:"",error:null}),children:S.jsxs(zp,{className:"sm:max-w-[440px]",children:[S.jsxs(Bp,{children:[S.jsx(Fp,{children:"Embed a video"}),S.jsx(Pp,{children:"Paste a YouTube or Vimeo link. It plays in place; the document keeps the plain link."})]}),S.jsxs("div",{className:"space-y-2 py-1",children:[S.jsx(T3,{htmlFor:"embed-url",className:"text-xs",children:"Video link"}),S.jsx(Na,{id:"embed-url",autoFocus:!0,placeholder:"https://www.youtube.com/watch?v=…",value:g.url,onChange:k=>y(C=>({...C,url:k.target.value,error:null})),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),x())}}),g.error&&S.jsx("p",{className:"text-xs text-destructive",children:g.error})]}),S.jsxs(M3,{children:[S.jsx(Xn,{variant:"outline",onClick:()=>y({open:!1,url:"",error:null}),children:"Cancel"}),S.jsx(Xn,{onClick:x,children:"Embed"})]})]})}),S.jsx(Ns,{}),S.jsx(je,{active:t.isActive("link"),onClick:e,title:"Insert URL link",children:S.jsx(I3,{className:"h-3.5 w-3.5"})}),n&&S.jsx(je,{onClick:n,title:"Link to a document in this nest",children:S.jsx($p,{className:"h-3.5 w-3.5"})}),S.jsx(Ns,{}),S.jsx(je,{onClick:()=>t.chain().focus().undo().run(),disabled:!t.can().undo(),title:"Undo (Ctrl+Z)",children:S.jsx(Ak,{className:"h-3.5 w-3.5"})}),S.jsx(je,{onClick:()=>t.chain().focus().redo().run(),disabled:!t.can().redo(),title:"Redo (Ctrl+Shift+Z)",children:S.jsx(bk,{className:"h-3.5 w-3.5"})}),S.jsx(Ns,{}),S.jsx(je,{onClick:a,title:"Preview — see how it will render",label:"Preview",children:S.jsx(E7,{className:"h-3.5 w-3.5"})}),S.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[S.jsxs("div",{className:"hidden items-center gap-2 px-1 text-xs text-muted-foreground lg:flex",children:[S.jsx("span",{children:"[[wiki]]"}),S.jsx("span",{children:"@mention"}),S.jsx("span",{children:"[ ] task"})]}),l]})]})}function je({active:t,onClick:e,disabled:n,title:r,label:i,children:s}){return S.jsxs(Xn,{type:"button",variant:"ghost",size:"sm",onMouseDown:o=>o.preventDefault(),onClick:e,disabled:n,title:r,className:Yn(i?"h-7 gap-1 px-2":"h-7 w-7 p-0",t&&"bg-muted text-foreground"),children:[s,i&&S.jsx("span",{className:"text-xs",children:i})]})}function Ns(){return S.jsx("span",{className:"mx-1 inline-block h-5 w-px bg-border"})}export{P7 as A,WS as D,G7 as E,NW as F,lk as H,O3 as I,I3 as L,iG as M,PW as O,qW as P,rf as Q,DW as R,zW as S,RW as T,sf as U,LW as W,eG as a,tG as b,nG as c,iV as d,kq as e,EO as f,nV as g,jW as h,Sq as i,Vy as j,$S as k,mq as l,Eq as m,OW as n,rG as o,us as p,VW as q,bq as r,FW as s,QW as t,yq as u,IW as v,HW as w,UW as x,$W as y,Lu as z};